@olympeio/runtime-node 9.9.0 → 9.9.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
@@ -217,24 +217,24 @@ ea('Promise.prototype.finally',function(a){return a?a:function(b){return this.th
217
217
  ea('String.prototype.padStart',function(a){return a?a:function(b,c){var d=va(this);return wa(c,b-d.length)+d}});ea('String.prototype.padEnd',function(a){return a?a:function(b,c){var d=va(this);return d+wa(c,b-d.length)}});ea('Promise.allSettled',function(a){function b(d){return{status:'fulfilled',value:d}}function c(d){return{status:'rejected',reason:d}}return a?a:function(d){var e=this;d=Array.from(d,function(f){return e.resolve(f).then(b,c)});return e.all(d)}});
218
218
  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}});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}});
219
219
  ea('Array.prototype.flat',function(a){return a?a:function(b){b=void 0===b?1:b;for(var c=[],d=0;d<this.length;d++){var e=this[d];Array.isArray(e)&&0<b?(e=Array.prototype.flat.call(e,b-1),c.push.apply(c,e)):c.push(e)}return c}});var ya=this||self;function w(a,b){a=a.split('.');let c=ya;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={Yd:()=>'object'===typeof window?window:'object'===typeof global?global:self};if('olympe'in olympe.Yd())throw Error('The olympe runtime is loaded more than once. Make sure not to import `@olympeio/runtime-web` or `@olympeio/runtime-node` explicitly, and to always use the `olympe` alias.');olympe.Yd().olympe=olympe;olympe.RD=(a,...b)=>{b.forEach(c=>{Object.getOwnPropertyNames(c.prototype).forEach(d=>{'constructor'!==d&&void 0===a.prototype[d]&&(a.prototype[d]=c.prototype[d])})})};const za=(a,b)=>{a={level:a,message:b.map(c=>String(c)).join(' ')};for(const c of b){let d;if(null==(d=c)?0:d.stack)a.stackTrace||(a.stackTrace=''),a.stackTrace+=c.stack}return JSON.stringify(a)};
220
- (()=>{const a=console.trace,b=console.debug,c=console.log,d=console.info,e=console.warn,f=console.error;console.trace=(...g)=>a(za('TRACE',g));console.debug=(...g)=>b(za('DEBUG',g));console.log=(...g)=>c(za('LOG',g));console.info=(...g)=>d(za('INFO',g));console.warn=(...g)=>e(za('WARN',g));console.error=(...g)=>f(za('ERROR',g))})();olympe.Ua={};olympe.Ua.node={};olympe.W={};olympe.W.Af={};olympe.W.Af.$n=class{process(a){for(const b of Object.keys(a.ue))if(a.vd(b).$m())throw Error('Service "'+b+'" is defined as abstract and needs to be overridden');}};olympe.W.Af.$n.ya=[olympe.W.Af.lq];olympe.W.Af.ao=class{process(a){function b(e,f){if(f.includes(e))throw Error('Circular dependency detected: '+f.join(' > ')+' > '+e);if(d.has(e)){f=f.concat(e);d.delete(e);e=a.vd(e);c(e.dj(),f);for(const g of Aa(e))c(g.dj(),f)}}function c(e,f){for(const g of e)g instanceof olympe.W.wb&&b(g.U(),f)}const d=new Set(Object.keys(a.ue));for(const e of d)b(e,[])}};olympe.W.Af.ao.ya=[olympe.W.Af.lq];olympe.W.Af.lq=class{process(){}};const Ba=[],Ca=[];function Da(a){const b=a.ib();b.debug('Registering configurations...');b.C++;Ba.forEach(c=>{B(a.H,'Registering configure callback '+(c.C?'for module '+c.C:''));a.J.push(c.F)});Ea(b);b.debug('done registering')}function Fa(a){const b=a.ib();b.debug('Running run callbacks of container...');b.C++;Ca.forEach(c=>{const d=Ga(a,c.dj());a.H.debug('Calling run callback '+`for module ${c.C}`);c.F.apply(null,d)});Ea(b);b.debug('done calling run callbacks. DI process completed!')}
220
+ (()=>{const a=console.trace,b=console.debug,c=console.log,d=console.info,e=console.warn,f=console.error;console.trace=(...g)=>a(za('TRACE',g));console.debug=(...g)=>b(za('DEBUG',g));console.log=(...g)=>c(za('LOG',g));console.info=(...g)=>d(za('INFO',g));console.warn=(...g)=>e(za('WARN',g));console.error=(...g)=>f(za('ERROR',g))})();olympe.Ua={};olympe.Ua.node={};olympe.W={};olympe.W.Af={};olympe.W.Af.$n=class{process(a){for(const b of Object.keys(a.ue))if(a.vd(b).$m())throw Error('Service "'+b+'" is defined as abstract and needs to be overridden');}};olympe.W.Af.$n.ya=[olympe.W.Af.lq];olympe.W.Af.ao=class{process(a){function b(e,f){if(f.includes(e))throw Error('Circular dependency detected: '+f.join(' > ')+' > '+e);if(d.has(e)){f=f.concat(e);d.delete(e);e=a.vd(e);c(e.dj(),f);for(const g of Aa(e))c(g.dj(),f)}}function c(e,f){for(const g of e)g instanceof olympe.W.wb&&b(g.U(),f)}const d=new Set(Object.keys(a.ue));for(const e of d)b(e,[])}};olympe.W.Af.ao.ya=[olympe.W.Af.lq];olympe.W.Af.lq=class{process(){}};const Ba=[],Ca=[];function Da(a){const b=a.ab();b.debug('Registering configurations...');b.C++;Ba.forEach(c=>{B(a.H,'Registering configure callback '+(c.C?'for module '+c.C:''));a.J.push(c.F)});Ea(b);b.debug('done registering')}function Fa(a){const b=a.ab();b.debug('Running run callbacks of container...');b.C++;Ca.forEach(c=>{const d=Ga(a,c.dj());a.H.debug('Calling run callback '+`for module ${c.C}`);c.F.apply(null,d)});Ea(b);b.debug('done calling run callbacks. DI process completed!')}
221
221
  olympe.W.ho=class{constructor(){}static C(a,b){Ba.push(new olympe.W.hl(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');});Ca.push(new olympe.W.hl(b,c,a))}};olympe.W.config=olympe.W.ho.C;olympe.W.run=olympe.W.ho.F;olympe.W.Pr=a=>{const b=new Map,c=(d,e)=>{for(const [f,g]of Object.entries(d))d=e.concat((f.startsWith('#')?f.substring(1):f).toLowerCase()),'object'!==typeof g||null===g||f.startsWith('#')?b.set(d.join('.'),g):c(g,d)};c(a,[]);return b};olympe.W.wj=class{constructor(){}getValue(){}};function Ha(a,b){let c,d;return null!=(d=null==(c=a.G)?void 0:c.call(a,b))?d:!0}olympe.W.hl=class{constructor(a,b,c){this.F=a;this.J=(null!=c?c:[]).map(d=>'string'===typeof d?new olympe.W.wb(d):d);this.C=null!=b?b:'no name di callback';this.G=null}dj(){return this.J}};function Ia(a,b){var c=olympe.W.R.og;if(void 0!==a.C[c])throw Error('Service "'+c+'" has already been instantiated');a.C[c]=b}function Ja(a,b,c){let d=a.C[b];if(void 0===d){const e=a.J[b];if(void 0===e){if(c===olympe.W.hh.C.Rl)return null;throw Error('Service "'+b+'" not found');}try{d=e.instantiate(a)}catch(f){throw a.H.error('Error during instantiation of service '+b),f;}!e.J&&(a.C[b]=d)}return d}
222
222
  function Ka(a,b,c){b=b.toLowerCase();let d;const e=null!=(d=a.F.get(b))?d:[];e.push(c);a.F.set(b,e)}function Ga(a,b){const c=b.length,d=Array(c);let e,f;for(e=0;e<c;e++)a.H.C++,f=b[e],d[e]=f instanceof olympe.W.wj?f.getValue(a):f,Ea(a.H);return d}
223
- olympe.W.hh=class{constructor(a,b,c,d,e=2){this.J=a;this.G=b;this.parameters=c;this.C=Object.create(null);this.H=new olympe.W.Ep(e);this.F=new Map;Ia(this,this);this.H.debug('Instantiate all computed parameters');d.forEach(f=>Ja(this,f).subscribe(this.sj.bind(this,f)))}ib(){return this.H}getParameter(a){a=a.toLowerCase();let b;return null!=(b=this.parameters[a])?b:this.G[a]}sj(a,b){a=a.toLowerCase();if(this.parameters[a]!==b){var c,d;this.H.debug(`Updating parameter ${a} to ${b} and notify ${null!=
223
+ olympe.W.hh=class{constructor(a,b,c,d,e=2){this.J=a;this.G=b;this.parameters=c;this.C=Object.create(null);this.H=new olympe.W.Ep(e);this.F=new Map;Ia(this,this);this.H.debug('Instantiate all computed parameters');d.forEach(f=>Ja(this,f).subscribe(this.sj.bind(this,f)))}ab(){return this.H}getParameter(a){a=a.toLowerCase();let b;return null!=(b=this.parameters[a])?b:this.G[a]}sj(a,b){a=a.toLowerCase();if(this.parameters[a]!==b){var c,d;this.H.debug(`Updating parameter ${a} to ${b} and notify ${null!=
224
224
  (d=null==(c=this.F.get(a))?void 0:c.length)?d:0} listeners.`);this.parameters[a]=b;var e;for(const f of null!=(e=this.F.get(a))?e:[])f(b)}}};olympe.W.hh.C={nt:'exception',Rl:'null'};function La(a,b){b=olympe.W.Pr(b);for(const [c,d]of b)Ma(a,c,d)}function C(a,b,c,...d){B(a.H,'Defining service '+b);a.C(b,c,d,!1,!1)}function Na(a,b,c,...d){B(a.H,'Defining service '+b);a.C(b,c,d,!1,!0)}function E(a,b,c,d,e=!1){B(a.H,'Defining service (as a factory) '+b);a.C(b,d,c,!0,e)}function Oa(a,b,c,d=!1){B(a.H,'Defining service alias '+b);a.C(b,e=>e,[c],!0,d)}function Pa(a,b){B(a.H,'Defining abstract service '+b);a.C(b).G=!0}function Ma(a,b,c){a.parameters[b.toLowerCase()]=c}
225
225
  function Qa(a,b,c,d){a.G.push(b);Ma(a,b,d(...c.map(e=>a.getParameter(e))));E(a,b,c.map(e=>new olympe.W.lh(e)),(...e)=>rxjs.combineLatest(e).pipe(rxjs.operators.skip(1),rxjs.operators.map(f=>d(...f)),rxjs.operators.distinctUntilChanged()))}function F(a,b,c){a.F[b.toLowerCase()]=c}
226
- olympe.W.dt=class{constructor(a,b){this.ue=Object.create(null);this.parameters=Object.create(null);this.F=Object.create(null);this.G=[];La(this,a);La(this,b);this.T=[new olympe.W.Af.$n,new olympe.W.Af.ao];this.J=[];a=this.getParameter(olympe.W.V.tu);this.O=void 0!==a?a:3;this.H=new olympe.W.Ep(this.O)}ib(){return this.H}C(a,b,c,d,e){const f=a instanceof olympe.W.wb?a.U():a;if(3<=arguments.length&&c){const h=c.indexOf(f);if(-1!==h){if(void 0===this.ue[f])throw Error(`ContainerBuilder.define: Service ${f} references itself and is not an override definition!`);
226
+ olympe.W.dt=class{constructor(a,b){this.ue=Object.create(null);this.parameters=Object.create(null);this.F=Object.create(null);this.G=[];La(this,a);La(this,b);this.T=[new olympe.W.Af.$n,new olympe.W.Af.ao];this.J=[];a=this.getParameter(olympe.W.V.tu);this.O=void 0!==a?a:3;this.H=new olympe.W.Ep(this.O)}ab(){return this.H}C(a,b,c,d,e){const f=a instanceof olympe.W.wb?a.U():a;if(3<=arguments.length&&c){const h=c.indexOf(f);if(-1!==h){if(void 0===this.ue[f])throw Error(`ContainerBuilder.define: Service ${f} references itself and is not an override definition!`);
227
227
  var g=this.ue[f];g.id=g.id+'!!'+ ++olympe.W.ql.C;g.J=!0;g=g.id;c[h]=g;this.ue[g]=this.ue[f]}}this.ue[f]=new olympe.W.ql(b,c,d||!1,f);return this.ue[f]}vd(a){const b=this.ue[a];if(void 0===b)throw Error(`DI Error: Definition ${a} was not found`);return b}getParameter(a){a=a.toLowerCase();let b;return null!=(b=this.parameters[a])?b:this.F[a]}compile(){const a=this.J;this.H.debug('Calling '+a.length+' configure callbacks');this.H.C++;a.forEach(b=>{B(this.H,'Calling callback');this.H.C++;b(this);Ea(this.H)});
228
228
  Ea(this.H);this.H.debug('Configuration summary: '+Object.keys(this.ue).length+' definitions');this.H.debug('Compiling...');this.H.C++;this.T.forEach((b,c)=>{this.H.debug('running compilation pass '+(c+1)+': '+b.constructor.name);b.process(this)});Ea(this.H);this.H.debug('Compilation done, returning container');return new olympe.W.hh(this.ue,this.F,this.parameters,this.G,this.O)}};function Aa(a){let b,c;return null!=(c=null==(b=a.C)?void 0:b.values())?c:[]}
229
- olympe.W.ql=class{constructor(a,b,c,d){this.O=a||null;this.T=!!c;this.F=(null!=b?b:[]).map(e=>'string'===typeof e?new olympe.W.wb(e):e);this.G=!1;this.C=null;this.id=null!=d?d:'';this.J=!1}U(){return this.id}instantiate(a){const b=a.ib();b.debug('Resolving arguments for '+this.id);const c=this.O;let d=Ga(a,this.F);const e=()=>{if(this.T)return c.apply(null,d);d.unshift(null);return new (c.bind.apply(c,d))};B(b,'Instantiating '+this.id);const f=olympe.D?olympe.D.Sg().run(()=>e()):e();let g;if(0<(null==
229
+ olympe.W.ql=class{constructor(a,b,c,d){this.O=a||null;this.T=!!c;this.F=(null!=b?b:[]).map(e=>'string'===typeof e?new olympe.W.wb(e):e);this.G=!1;this.C=null;this.id=null!=d?d:'';this.J=!1}U(){return this.id}instantiate(a){const b=a.ab();b.debug('Resolving arguments for '+this.id);const c=this.O;let d=Ga(a,this.F);const e=()=>{if(this.T)return c.apply(null,d);d.unshift(null);return new (c.bind.apply(c,d))};B(b,'Instantiating '+this.id);const f=olympe.D?olympe.D.Sg().run(()=>e()):e();let g;if(0<(null==
230
230
  (g=this.C)?void 0:g.size)){b.C++;B(b,'Calling configuration callbacks:');for(const h of this.C.values())b.C++,B(b,'Check if need to call additional configuration callback '+h.C),Ha(h,f)?(B(b,'Calling additional configuration callback '+h.C),d=Ga(a,h.dj()),d.push(f),h.F.apply(null,d)):B(b,'Will not call additional configuration callback '+h.C+'predicate has returned false'),Ea(b);Ea(b)}B(b,'Done instantiating '+this.id);return f}dj(){return this.F}$m(){return this.G}config(a,b,c,d,e){null===this.C&&
231
231
  (this.C=new Map);var f=this.C,g=f.set;b=new olympe.W.hl(c,e,b);b.G=d;g.call(f,a,b)}};olympe.W.ql.C=0;olympe.W.lh=class extends olympe.W.wj{constructor(a){super();this.id=a}U(){return this.id}getValue(a){return new rxjs.Observable(b=>{b.next(a.getParameter(this.id));Ka(a,this.id,c=>b.next(c))})}};function Ea(a){0<a.C&&a.C--}function B(a,b){1>=a.F&&Sa(a,'log','DI: '+b)}function Sa(a,b,c){if(console&&console[b]){var d='';for(let e=0;e<a.C;e++)d+=' ';console[b](d+c)}}olympe.W.Ep=class{constructor(a){this.F=a;this.C=0}debug(a){2>=this.F&&Sa(this,'log','DI: '+a)}info(a){3>=this.F&&Sa(this,'info','DI: '+a)}warn(a){4>=this.F&&Sa(this,'warn','DI: '+a)}error(a){5>=this.F&&Sa(this,'error','DI: '+a)}};olympe.W.oa=class extends olympe.W.wj{constructor(a){super();this.id=a}U(){return this.id}getValue(a){return a.getParameter(this.id)}};olympe.W.wb=class extends olympe.W.wj{constructor(a,b){super();this.id=a;this.C=b||olympe.W.hh.C.nt}U(){return this.id}getValue(a){return Ja(a,this.id,this.C)}};olympe.W.R={og:'di.Container',BB:'di.PublicContainer'};olympe.W.V={tu:'logging.di'};olympe.W.run([olympe.W.R.og],a=>{olympe.W.getParameter=b=>a.getParameter(b);olympe.W.sj=(b,c)=>a.sj(b,c);olympe.Yd().getConfig=b=>a.getParameter(b);olympe.Yd().getConfigNames=()=>Object.keys(a.parameters);olympe.Yd().updateConfig=(b,c)=>a.sj(b,c)});olympe.Y={};olympe.Y.sp=class{constructor(a){this.id=a||olympe.Y.sp.C++}Fa(a){return a?this.id===a.id:!1}toJSON(){return this.id.toString()}toString(){return this.id.toString()}};olympe.Y.sp.C=0;olympe.Y.gB=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.Y.vh=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.Y.vh.F=function(a){return new olympe.Y.vh(.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.Y.vh.C=function(){return new olympe.Y.vh(0,0,0,0,0,0,0,0,0,.2125,.7154,.0721,0)};olympe.Y.vh.prototype.set=function(a,b,c){this.values[5*a+b]=c};olympe.Y.vh.prototype.get=function(a,b){return this.values[5*a+b]};function Ta(a){return(new TextEncoder).encode(a)}function Ua(a,b){return a.C(Ta(b))}function Va(a){return(new TextDecoder('utf8')).decode(a)}
232
232
  olympe.Y.$k=class{F(){}C(){}J(a){return v(function*(){if(a instanceof ArrayBuffer)return new Uint8Array(a);if(a instanceof Uint8Array)return a;if('string'===typeof a)return Ta(a);if(a instanceof Blob)return new Uint8Array(yield a.arrayBuffer());if(a instanceof olympe.Y.stream.Eg){const b=[];for(const c=ha(a);;){const d=yield c.next();if(d.done)break;b.push(...d.value)}return new Uint8Array(b)}throw Error('Unsupported value type for binary conversion.');})}G(){}};
233
233
  olympe.Y.vr=a=>a.replace('+','-').replace('/','_');olympe.Y.pw=a=>a.replace('-','+').replace('_','/');function Wa(a){a.C=setTimeout(()=>{const b=Date.now(),c=a.timeout;for(const [d,e]of a.values)b-e>c&&(a.delete(d),a.F&&a.F(d));if(0<a.values.size)Wa(a);else{let d;null==(d=a.G)||d.call(a)}},a.J)}function Xa(a,b){return a.values.has(b)?(a.values.set(b,Date.now()),!0):!1}function Ya(a,b){a.F=b;return a}
234
234
  olympe.Y.um=class{constructor(a,b=a/2){this.timeout=a;this.J=b;this.values=new Map;this.G=this.F=this.C=null}add(a){this.values.set(a,Date.now());null===this.C&&Wa(this)}has(a){return this.values.has(a)}forEach(a){this.values.forEach((b,c)=>a(c))}delete(a){a=this.values.delete(a);if(0===this.values.size){this.C&&clearTimeout(this.C);this.C=null;let b;null==(b=this.G)||b.call(this)}return a}clear(){this.C&&clearTimeout(this.C);this.C=null;this.values.clear();return this}};function Za(a,b){a.F=b;return a}function $a(a,b){a.C.G=b}
235
235
  olympe.Y.Hh=class{constructor(a){this.C=Ya(new olympe.Y.um(a,void 0),b=>{const c=this.values.get(b);this.values.delete(b);let d;null==(d=this.F)||d.call(this,b,c)});this.values=new Map;this.F=null}set(a,b){this.values.set(a,b);this.C.add(a);return this}has(a){return this.values.has(a)}get(a){return this.values.get(a)}forEach(a){this.values.forEach((b,c)=>a(b,c))}delete(a){this.values.delete(a);return this.C.delete(a)}clear(){this.C.clear();this.values.clear();return this}};function ab(a,b){a.T.push(b)}function bb(a,b){a.Z.push(b)}function cb(a,b){let c;'object'!==typeof b&&'function'!==typeof b?c=b:b instanceof olympe.dc.CloudObject?c=b.toJSON():Array.isArray(b)?c=b.map(d=>cb(a,d)):c='N/A';return c}function db(a,b,c,d){b={cat:b,epoch:null!=d?d:performance.now()-a.F};let e;for(const [f,g]of null!=(e=c)?e:[])b[f]=cb(a,g);a.G.push(b)}
236
- olympe.Y.$u=class{constructor(){this.G=[];this.T=[];this.Z=[];this.O=new Map;this.J=new Map;this.C=!1;this.F=null}start(){this.C||(this.F||(this.F=performance.now()),this.C=!0,this.T.forEach(a=>a()))}stop(){this.C&&(this.Z.forEach(a=>a()),this.C=!1)}};function eb(a,b,c=5E3){return rxjs.operators.retry({resetOnSuccess:!0,delay:(d,e)=>{if(d instanceof a){const f=Math.round(Math.random()*(e+1)*c);return rxjs.timer(f).pipe(rxjs.operators.tap(()=>null==b?void 0:b(d,f)))}return rxjs.throwError(()=>d)}})}olympe.Y.operators={qE(a,b=0){return c=>c.pipe(rxjs.operators.map((d,e)=>{e===b&&a(d);return d}))}};olympe.Y.Promise={};olympe.Y.Promise.$i=function(a,b){let c=null;return(...d)=>new Promise((e,f)=>{clearTimeout(c);c=setTimeout(()=>v(function*(){try{const g=yield a(...d);e(g)}catch(g){f(g)}}),b)})};olympe.Y.Promise.vn=function(a,b,c='Promise timeout'){return new Promise((d,e)=>{const f=setTimeout(()=>{e(Error(c))},b);a.then(g=>{clearTimeout(f);d(g)}).catch(g=>{clearTimeout(f);e(g)})})};olympe.Y.promise={};function fb(a){if(0===a.size())a.F.next(!1);else if(a.G()){a.C++;var b=gb(a);b&&b.F.call(a).then(c=>{b.resolve(c)}).catch(c=>{b.C(c)}).finally(()=>{a.C--;0===a.size()&&a.F.next(!1);fb(a)})}}function hb(a,b){return new Promise((c,d)=>{a.Xa.push(new olympe.Y.promise.Ev(c,d,b));fb(a)})}function gb(a){a.F.next(!0);let b;return null!=(b=a.Xa.shift())?b:null}
237
- olympe.Y.promise.nm=class{constructor(){this.Xa=[];this.F=new rxjs.BehaviorSubject(!1);this.C=0}G(){return 0===this.C}clear(){for(;0<this.Xa.length;)this.Xa.shift().C(Error('Canceled by a clearStack'));fb(this)}size(){return this.Xa.length}};olympe.Y.promise.Ev=class{constructor(a,b,c){this.resolve=a;this.C=b;this.F=c}};olympe.Y.promise.Fv=class extends olympe.Y.promise.nm{constructor(a){super();if('number'!==typeof a||0>=a)throw Error('StackWindow with an invalid concurrentLimit. It must be a number > 0 for the stack to work properly');this.kj=a}G(){return this.C<this.kj}};olympe.Y.promise.VC=class{constructor(a,...b){this.G=a;this.parameters=b;this.C=this.F=null;this.promise=new Promise((c,d)=>{this.F=c;this.C=d});this.start()}then(a){return this.promise.then(a)}catch(a){return this.promise.catch(a)}finally(a){return this.promise.finally(a)}start(){'undefined'!==typeof Worker?setTimeout(()=>{const a=URL.createObjectURL(new Blob([`
236
+ olympe.Y.$u=class{constructor(){this.G=[];this.T=[];this.Z=[];this.O=new Map;this.J=new Map;this.C=!1;this.F=null}start(){this.C||(this.F||(this.F=performance.now()),this.C=!0,this.T.forEach(a=>a()))}stop(){this.C&&(this.Z.forEach(a=>a()),this.C=!1)}};function eb(a,b,c=5E3){return rxjs.operators.retry({resetOnSuccess:!0,delay:(d,e)=>{if(d instanceof a){const f=Math.round(Math.random()*(e+1)*c);return rxjs.timer(f).pipe(rxjs.operators.tap(()=>null==b?void 0:b(d,f)))}return rxjs.throwError(()=>d)}})}olympe.Y.operators={qE(a,b=0){return c=>c.pipe(rxjs.operators.map((d,e)=>{e===b&&a(d);return d}))}};olympe.Y.Promise={};olympe.Y.Promise.$i=function(a,b){let c=null;return(...d)=>new Promise((e,f)=>{clearTimeout(c);c=setTimeout(()=>v(function*(){try{const g=yield a(...d);e(g)}catch(g){f(g)}}),b)})};olympe.Y.Promise.vn=function(a,b,c='Promise timeout'){return new Promise((d,e)=>{const f=setTimeout(()=>{e(Error(c))},b);a.then(g=>{clearTimeout(f);d(g)}).catch(g=>{clearTimeout(f);e(g)})})};olympe.Y.promise={};function fb(a){if(0===a.size())a.F.next(!1);else if(a.G()){a.C++;var b=gb(a);b&&b.F.call(a).then(c=>{b.resolve(c)}).catch(c=>{b.C(c)}).finally(()=>{a.C--;0===a.size()&&a.F.next(!1);fb(a)})}}function hb(a,b){return new Promise((c,d)=>{a.Ya.push(new olympe.Y.promise.Ev(c,d,b));fb(a)})}function gb(a){a.F.next(!0);let b;return null!=(b=a.Ya.shift())?b:null}
237
+ olympe.Y.promise.nm=class{constructor(){this.Ya=[];this.F=new rxjs.BehaviorSubject(!1);this.C=0}G(){return 0===this.C}clear(){for(;0<this.Ya.length;)this.Ya.shift().C(Error('Canceled by a clearStack'));fb(this)}size(){return this.Ya.length}};olympe.Y.promise.Ev=class{constructor(a,b,c){this.resolve=a;this.C=b;this.F=c}};olympe.Y.promise.Fv=class extends olympe.Y.promise.nm{constructor(a){super();if('number'!==typeof a||0>=a)throw Error('StackWindow with an invalid concurrentLimit. It must be a number > 0 for the stack to work properly');this.kj=a}G(){return this.C<this.kj}};olympe.Y.promise.VC=class{constructor(a,...b){this.G=a;this.parameters=b;this.C=this.F=null;this.promise=new Promise((c,d)=>{this.F=c;this.C=d});this.start()}then(a){return this.promise.then(a)}catch(a){return this.promise.catch(a)}finally(a){return this.promise.finally(a)}start(){'undefined'!==typeof Worker?setTimeout(()=>{const a=URL.createObjectURL(new Blob([`
238
238
  function onFullfilledCallback(data) {
239
239
  self.postMessage({ type: "done", data, });
240
240
  self.close();
@@ -266,45 +266,45 @@ a.G}Fa(a){return this.C===a.C&&this.F===a.F&&this.G===a.G}toString(){return`${th
266
266
  olympe.ka.Eb.C={Lv:0,Rf:1,su:2,Dl:3,$v:4,xb:5,qt:6,Ei:7};olympe.ka.Eb.F={0:'TRACE',1:'DEBUG',2:'LOG',3:'INFO',4:'WARN',5:'ERROR',6:'FATAL',7:'NOTHING'};olympe.ka.Ta=class{Vc(){}};olympe.ka.oe={};function tb(a,b,c,d){a.Ga[b](`[OLYMPE.${c}]:`,d.join(' '));if(0<a.Z.size){var e=new Date;e=('00'+e.getHours()).substring(-2)+':'+('00'+e.getMinutes()).substring(-2)+':'+('00'+e.getSeconds()).substring(-2)+'.'+('00'+e.getMilliseconds()).substring(-3);for(const f of a.Z.values())f(e,c,b,...d)}}
267
267
  olympe.ka.oe.Eb=class{constructor(a,b){this.name=a;const c=b instanceof rxjs.Observable;this.F=c?olympe.ka.Eb.C.Dl:b;c&&b.subscribe(d=>{this.F=d});this.G=a.toUpperCase();this.Z=new Map;this.Ga=console}ma(){return this.name}O(){return this.F}J(){return this.F<=olympe.ka.Eb.C.Lv}C(){return this.F<=olympe.ka.Eb.C.Rf}T(){return this.F<=olympe.ka.Eb.C.su}ja(){return this.F<=olympe.ka.Eb.C.Dl}ua(){return this.F<=olympe.ka.Eb.C.$v}aa(){return this.F<=olympe.ka.Eb.C.xb}ea(){return this.F<=olympe.ka.Eb.C.qt}trace(...a){this.J()&&
268
268
  tb(this,'trace',this.G,a)}debug(...a){this.C()&&tb(this,'debug',this.G,a)}log(...a){this.T()&&tb(this,'log',this.G,a)}info(...a){this.ja()&&tb(this,'info',this.G,a)}warn(...a){this.ua()&&tb(this,'warn',this.G,a)}error(...a){this.aa()&&tb(this,'error',this.G,a)}fatal(...a){this.ea()&&tb(this,'error',this.G,a)}};olympe.ka.oe.Eb.ya=[olympe.ka.Eb];olympe.ka.oe.Ta=class{constructor(a,b,c){this.C=a;this.F=parseInt(b,10);this.G=c;this.channels=new Map;this.H=this.Vc('logging');this.H.info('Logging initialized, global log level is '+olympe.ka.Eb.F[b])}Vc(a){var b=this.channels.get(a);if(!b){b=`${olympe.ka.V.Rs}.${a}`;var c;const d=new rxjs.BehaviorSubject(null!=(c=this.C.getParameter(b))?c:this.F);Ka(this.C,b,e=>{d.next(e)});c=this.G;b=`${b}.${olympe.ka.V.xv}`;Object.prototype.hasOwnProperty.call(this.C.parameters,b.toLowerCase())&&(c=!0===this.C.getParameter(b));
269
- b=new olympe.ka.oe.Eb(a,d.asObservable(),c);this.channels.set(a,b)}return b}};olympe.ka.oe.Ta.ya=[olympe.ka.Ta];olympe.ka.R={Ea:'logging.Manager'};olympe.ka.V={Wo:'logging',Xo:'logging.showLogLevel',Rs:'logging',xv:'showLogLevel'};olympe.W.config(function(a){F(a,olympe.ka.V.Wo,olympe.ka.Eb.C.Dl);F(a,olympe.ka.V.Xo,!0);Na(a,olympe.ka.R.Ea,olympe.ka.oe.Ta,olympe.W.R.og,new olympe.W.oa(olympe.ka.V.Wo),new olympe.W.oa(olympe.ka.V.Xo))},'olympe.logging');olympe.W.run([olympe.ka.R.Ea],a=>{olympe.ka.ib=b=>a.Vc(b)},'Logging singleton getter initialization');olympe.D={};olympe.D.V={Kp:'df.nodeCreationThreshold'};const ub=[];function vb(){}function wb(){}olympe.D.K=class a{constructor(b,c,d){this.C=void 0===b?vb:b;this.F=void 0===c?ub:c;this.Z=d}static J(){var b=[];return void 0===b||0===b.length?olympe.D.K.aa:new a(wb,b)}J(){return this.C?this.C():void 0}G(){return this.F?this.F:ub}O(){return null===this.C&&null===this.F}T(){return this.C===wb}};olympe.D.K.Z=new olympe.D.K;olympe.D.K.C=new olympe.D.K(null,null);olympe.D.K.aa=new olympe.D.K(wb);olympe.D.K.G=new olympe.D.K(()=>olympe.D.ba);
270
- olympe.D.K.F=new olympe.D.K(()=>olympe.D.Pa);olympe.D.K.O=new olympe.D.K(()=>olympe.D.fa);olympe.D.K.T=new olympe.D.K(()=>olympe.D.$b);olympe.D.mh=class{U(){return''}Uc(){return''}destroy(){}eb(){return!1}od(){return!1}run(a,...b){return a(...b)}G(a){return a}getParent(){return null}Bf(){}Cc(){}Tc(){}wk(){}ja(){}onDestroy(){return''}Mf(){}Z(){return''}Vd(){}};olympe.D.mh.prototype.offDestroy=olympe.D.mh.prototype.Mf;olympe.D.mh.prototype.onDestroy=olympe.D.mh.prototype.onDestroy;let xb=0;olympe.W.run([new olympe.W.oa(olympe.D.V.Kp)],()=>{});
271
- olympe.D.Xb=class{constructor(a='SimpleContext',b){++xb;this.gb=new Map;this.ab=new Map;this.Ga=new Map;this.ac=0;this.name=a;this.id=String(xb);this.J=this.yb=!1;(this.aa=void 0===b?olympe.D.$a():b)&&this.aa.Cc(this);this.debug=!1}U(){return this.id}Uc(){return this.name}run(a,...b){if(!this.yb){var c=olympe.D.ps(this);a=a(...b);c&&olympe.D.ps(c);return a}}G(a){return(...b)=>this.run(a,...b)}destroy(){if(!this.yb&&!this.J){this.J=!0;this.ja();for(const a of this.ab.keys())this.ab.has(a)&&this.ab.get(a)();
272
- this.ab.clear();this.Ga.clear();this.aa&&(this.aa.Tc(this,!1),this.aa=null);this.yb=!0;this.J=!1;this.ja()}}eb(){return this.yb}od(){return this.J}Cc(a){if(!this.yb){var b;olympe.D.jb(a)?b=a.Da:olympe.D.cn(a)&&(b=a);b&&this.gb.set(b.U(),b)}}Tc(a,b=!0){let c;olympe.D.jb(a)?c=a.Da:olympe.D.cn(a)&&(c=a);c&&this.gb.has(c.U())&&(b&&c.wk(this),this.gb.delete(c.U()))}wk(){this.aa=null;this.destroy()}ja(){const a=this.gb;for(const b of a.keys())a.has(b)&&a.get(b).wk(this);this.gb.clear();for(const b of this.Ga.keys())this.Ga.has(b)&&
273
- this.Ga.get(b)();this.Ga.clear()}onDestroy(a,b){void 0===b&&(++this.ac,b=String(this.ac));this.ab.set(b,a);return b}Mf(a){this.ab.delete(a)}Z(a){if(void 0===b){++this.ac;var b=String(this.ac)}this.Ga.set(b,a);return b}Vd(a){this.Ga.delete(a)}Bf(a){this.aa&&this.aa.Tc(this,!1);(this.aa=a||null)&&this.aa.Cc(this)}getParent(){return this.aa}};olympe.D.Hq=class extends olympe.D.Xb{constructor(){super('Root',null)}destroy(){}onDestroy(){return''}Mf(){}};olympe.D.mh.ya=[olympe.D.mh];let yb=0;
269
+ b=new olympe.ka.oe.Eb(a,d.asObservable(),c);this.channels.set(a,b)}return b}};olympe.ka.oe.Ta.ya=[olympe.ka.Ta];olympe.ka.R={Ea:'logging.Manager'};olympe.ka.V={Wo:'logging',Xo:'logging.showLogLevel',Rs:'logging',xv:'showLogLevel'};olympe.W.config(function(a){F(a,olympe.ka.V.Wo,olympe.ka.Eb.C.Dl);F(a,olympe.ka.V.Xo,!0);Na(a,olympe.ka.R.Ea,olympe.ka.oe.Ta,olympe.W.R.og,new olympe.W.oa(olympe.ka.V.Wo),new olympe.W.oa(olympe.ka.V.Xo))},'olympe.logging');olympe.W.run([olympe.ka.R.Ea],a=>{olympe.ka.ab=b=>a.Vc(b)},'Logging singleton getter initialization');olympe.D={};olympe.D.V={Kp:'df.nodeCreationThreshold'};const ub=[];function vb(){}function wb(){}olympe.D.K=class a{constructor(b,c,d){this.C=void 0===b?vb:b;this.F=void 0===c?ub:c;this.Z=d}static J(){var b=[];return void 0===b||0===b.length?olympe.D.K.aa:new a(wb,b)}J(){return this.C?this.C():void 0}G(){return this.F?this.F:ub}O(){return null===this.C&&null===this.F}T(){return this.C===wb}};olympe.D.K.Z=new olympe.D.K;olympe.D.K.C=new olympe.D.K(null,null);olympe.D.K.aa=new olympe.D.K(wb);olympe.D.K.G=new olympe.D.K(()=>olympe.D.ba);
270
+ olympe.D.K.F=new olympe.D.K(()=>olympe.D.Qa);olympe.D.K.O=new olympe.D.K(()=>olympe.D.fa);olympe.D.K.T=new olympe.D.K(()=>olympe.D.$b);olympe.D.mh=class{U(){return''}Uc(){return''}destroy(){}fb(){return!1}od(){return!1}run(a,...b){return a(...b)}G(a){return a}getParent(){return null}Bf(){}Cc(){}Tc(){}wk(){}ja(){}onDestroy(){return''}Mf(){}Z(){return''}Vd(){}};olympe.D.mh.prototype.offDestroy=olympe.D.mh.prototype.Mf;olympe.D.mh.prototype.onDestroy=olympe.D.mh.prototype.onDestroy;let xb=0;olympe.W.run([new olympe.W.oa(olympe.D.V.Kp)],()=>{});
271
+ olympe.D.Xb=class{constructor(a='SimpleContext',b){++xb;this.hb=new Map;this.bb=new Map;this.Ga=new Map;this.ac=0;this.name=a;this.id=String(xb);this.J=this.yb=!1;(this.aa=void 0===b?olympe.D.Wa():b)&&this.aa.Cc(this);this.debug=!1}U(){return this.id}Uc(){return this.name}run(a,...b){if(!this.yb){var c=olympe.D.ps(this);a=a(...b);c&&olympe.D.ps(c);return a}}G(a){return(...b)=>this.run(a,...b)}destroy(){if(!this.yb&&!this.J){this.J=!0;this.ja();for(const a of this.bb.keys())this.bb.has(a)&&this.bb.get(a)();
272
+ this.bb.clear();this.Ga.clear();this.aa&&(this.aa.Tc(this,!1),this.aa=null);this.yb=!0;this.J=!1;this.ja()}}fb(){return this.yb}od(){return this.J}Cc(a){if(!this.yb){var b;olympe.D.jb(a)?b=a.Da:olympe.D.cn(a)&&(b=a);b&&this.hb.set(b.U(),b)}}Tc(a,b=!0){let c;olympe.D.jb(a)?c=a.Da:olympe.D.cn(a)&&(c=a);c&&this.hb.has(c.U())&&(b&&c.wk(this),this.hb.delete(c.U()))}wk(){this.aa=null;this.destroy()}ja(){const a=this.hb;for(const b of a.keys())a.has(b)&&a.get(b).wk(this);this.hb.clear();for(const b of this.Ga.keys())this.Ga.has(b)&&
273
+ this.Ga.get(b)();this.Ga.clear()}onDestroy(a,b){void 0===b&&(++this.ac,b=String(this.ac));this.bb.set(b,a);return b}Mf(a){this.bb.delete(a)}Z(a){if(void 0===b){++this.ac;var b=String(this.ac)}this.Ga.set(b,a);return b}Vd(a){this.Ga.delete(a)}Bf(a){this.aa&&this.aa.Tc(this,!1);(this.aa=a||null)&&this.aa.Cc(this)}getParent(){return this.aa}};olympe.D.Hq=class extends olympe.D.Xb{constructor(){super('Root',null)}destroy(){}onDestroy(){return''}Mf(){}};olympe.D.mh.ya=[olympe.D.mh];let yb=0;
274
274
  function zb(a,b){a.ea||(a.ea=new Map);a.ea.set(b.U(),b);switch(b.Gc()){case olympe.D.Node.C.wh:break;case olympe.D.Node.C.Ih:break;case olympe.D.Node.C.Sj:case olympe.D.Node.C.Sf:olympe.D.H.warn('Not bad as such but should not happen!');break;case olympe.D.Node.C.nh:Ab(a,olympe.D.Node.C.nh);break;case olympe.D.Node.C.OBSOLETE:a.hc=!0;a.C!==olympe.D.Node.C.nh&&Ab(a,olympe.D.Node.C.OBSOLETE);break;case olympe.D.Node.C.Qd:olympe.D.H.warn('Adding a destroyed node as upstream => should never happen!');break;
275
275
  default:olympe.D.H.warn('Unknown state, investigate: ',b.Gc())}Bb(b,a)}
276
- function Cb(a){if(a.Cd){var b=[],c=[];if(a.Nf)if(a.Nf instanceof olympe.D.Node)if(Db(a.Nf))b=a.Nf.Fb;else return;else b=a.Nf;else b=null;if(null!==a.ua){const e=a.dg;for(let f=0,g=a.ua.length;f<g;f++)if(null!==e&&-1<e.indexOf(f)){const h=a.ua[f];if(Db(h))c.push(h.Fb);else return}else c.push(a.ua[f])}if(a.Cd instanceof Function)var d=a.Cd;else b&&(b[a.Cd]||olympe.D.H.warn('looks like you forget a cast somewhere around '+a.Cd),d=b[a.Cd]);a.run(()=>{a.ja();if(void 0!==d){const e=d.apply(b,c);e&&e.qr?
276
+ function Cb(a){if(a.Cd){var b=[],c=[];if(a.Nf)if(a.Nf instanceof olympe.D.Node)if(Db(a.Nf))b=a.Nf.Gb;else return;else b=a.Nf;else b=null;if(null!==a.ua){const e=a.dg;for(let f=0,g=a.ua.length;f<g;f++)if(null!==e&&-1<e.indexOf(f)){const h=a.ua[f];if(Db(h))c.push(h.Gb);else return}else c.push(a.ua[f])}if(a.Cd instanceof Function)var d=a.Cd;else b&&(b[a.Cd]||olympe.D.H.warn('looks like you forget a cast somewhere around '+a.Cd),d=b[a.Cd]);a.run(()=>{a.ja();if(void 0!==d){const e=d.apply(b,c);e&&e.qr?
277
277
  Eb(a,e.Da):e instanceof olympe.D.Node?Eb(a,e):(K(a,e),void 0===e&&void 0===a.valueType&&Ab(a,olympe.D.Node.C.Ih))}else Fb(a)})}}function L(a){void 0===a.Ub&&(a.Ub=a.valueType===olympe.D.Proxy?Gb(void 0,a.Ud):Gb(a.valueType,a.Ud),a.Ub.Da=a);return a.Ub}function Hb(a){void 0!==a.O&&(Ib(a.O,a),a.O=void 0)}function Jb(a){if(a.C===olympe.D.Node.C.OBSOLETE&&(a.C=olympe.D.Node.C.Ih,null!==a.T))for(const b of a.T.values())Kb(b)}function Ab(a,b){b!==a.C&&(a.C=b)}
278
278
  function Lb(a){if(a.C!==olympe.D.Node.C.OBSOLETE&&a.C!==olympe.D.Node.C.Sj&&a.C!==olympe.D.Node.C.wh&&a.C!==olympe.D.Node.C.nh){Ab(a,olympe.D.Node.C.Sj);var b=a.T;if(b)for(const c of b.values())b.has(c.U())&&Lb(c);Ab(a,olympe.D.Node.C.OBSOLETE)}}function Mb(a,b,c){if(a.C!==olympe.D.Node.C.Sf)if(b===a.O)K(a,c,!0);else{if(a.C===olympe.D.Node.C.OBSOLETE||a.C===olympe.D.Node.C.Sj)a.hc=!0;Cb(a)}}
279
- function K(a,b,c){b instanceof olympe.D.Node&&(olympe.D.H.warn('We are setting the value of a node as a node, that should never happen?'),b=b.Fb);a.Jb||c||void 0===a.O||Hb(a);if(void 0!==b){if((a.Jb||a.C===olympe.D.Node.C.Ih||a.C===olympe.D.Node.C.OBSOLETE)&&!olympe.D.jb(b)&&void 0!==a.Fb){if(null===b&&null===a.Fb){Jb(a);return}if(null!==b&&null!==a.Fb&&(b.valueOf()===a.Fb.valueOf()||a.Fb.Fa&&a.Fb.Fa(b))){Jb(a);return}}if(!0===a.Jb)olympe.D.H.error("Circular dependency detected: updating a downstream node caused this node's (#"+
280
- a.U()+') value to get updated !');else{a.C===olympe.D.Node.C.Qd&&olympe.D.H.warn(`trying to set a value on a destroyed node (#${a.U()} ${a.ld?', '+a.ld:''})`);a.C===olympe.D.Node.C.Sf&&olympe.D.H.warn(`trying to set a value on a node being destroyed (#${a.U()} ${a.ld?', '+a.ld:''})`);a.Jb=!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
281
- Object?d=!0:b.toLowerCase()!==e.toLowerCase()&&a.valueType!==Object&&(d=!0),d&&('string'===b.toLowerCase()&&a.valueType===olympe.D.Pa?(c=olympe.D.Ab(c),d=!1):'number'===b.toLowerCase()&&a.valueType===olympe.D.ba?(c=olympe.D.ra(c),d=!1):'boolean'===b.toLowerCase()&&a.valueType===olympe.D.fa&&(c=olympe.D.Sb(c),d=!1)));a.Fb=c;Ab(a,olympe.D.Node.C.Ih);if(b=a.T){d=0;for(const f of b.values())0<d&&Lb(f),d++;for(const f of b.values())Mb(f,a,c)}a.Jb=!1}}}
282
- function Nb(a,b){if(a.C!==olympe.D.Node.C.Sf&&a.C!==olympe.D.Node.C.Qd&&(a.C!==olympe.D.Node.C.wh||a.Cd)){var c=void 0!==a.defaultValue;a.Cd&&b!==a.O&&a.ja();if(c)K(a,a.defaultValue,!0);else if(a.Fb=void 0,Ab(a,olympe.D.Node.C.wh),b=a.T)for(const d of b.values())Nb(d,a)}}function Fb(a){if(a.C!==olympe.D.Node.C.nh){Ab(a,olympe.D.Node.C.nh);var b=a.T;if(b)for(const c of b.values())Fb(c);a.ja();void 0!==a.O&&Hb(a);a.Fb=a.defaultValue}}function Db(a){return a.C===olympe.D.Node.C.Ih}
283
- function Eb(a,b){b===a?olympe.D.H.error('Setting a node as provider of itself. Ignoring'):(a.O&&a.O!==b&&Hb(a),Bb(b,a),Db(b)?K(a,b.Fb,!0):void 0!==a.defaultValue?K(a,a.defaultValue,!0):Nb(a),a.O=b)}function Ob(a,b){a.Cd&&(a.Cd=void 0);a.ld='Repeater';Eb(a,b)}function Kb(a){a.O?Jb(a):null!==a.ea&&0===Array.from(a.ea.values()).filter(b=>!Db(b)).length&&(a.hc&&(a.hc=!1,Cb(a)),Jb(a))}
279
+ function K(a,b,c){b instanceof olympe.D.Node&&(olympe.D.H.warn('We are setting the value of a node as a node, that should never happen?'),b=b.Gb);a.Fb||c||void 0===a.O||Hb(a);if(void 0!==b){if((a.Fb||a.C===olympe.D.Node.C.Ih||a.C===olympe.D.Node.C.OBSOLETE)&&!olympe.D.jb(b)&&void 0!==a.Gb){if(null===b&&null===a.Gb){Jb(a);return}if(null!==b&&null!==a.Gb&&(b.valueOf()===a.Gb.valueOf()||a.Gb.Fa&&a.Gb.Fa(b))){Jb(a);return}}if(!0===a.Fb)olympe.D.H.error("Circular dependency detected: updating a downstream node caused this node's (#"+
280
+ a.U()+') value to get updated !');else{a.C===olympe.D.Node.C.Qd&&olympe.D.H.warn(`trying to set a value on a destroyed node (#${a.U()} ${a.ld?', '+a.ld:''})`);a.C===olympe.D.Node.C.Sf&&olympe.D.H.warn(`trying to set a value on a node being destroyed (#${a.U()} ${a.ld?', '+a.ld:''})`);a.Fb=!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
281
+ Object?d=!0:b.toLowerCase()!==e.toLowerCase()&&a.valueType!==Object&&(d=!0),d&&('string'===b.toLowerCase()&&a.valueType===olympe.D.Qa?(c=olympe.D.Ab(c),d=!1):'number'===b.toLowerCase()&&a.valueType===olympe.D.ba?(c=olympe.D.ra(c),d=!1):'boolean'===b.toLowerCase()&&a.valueType===olympe.D.fa&&(c=olympe.D.Sb(c),d=!1)));a.Gb=c;Ab(a,olympe.D.Node.C.Ih);if(b=a.T){d=0;for(const f of b.values())0<d&&Lb(f),d++;for(const f of b.values())Mb(f,a,c)}a.Fb=!1}}}
282
+ function Nb(a,b){if(a.C!==olympe.D.Node.C.Sf&&a.C!==olympe.D.Node.C.Qd&&(a.C!==olympe.D.Node.C.wh||a.Cd)){var c=void 0!==a.defaultValue;a.Cd&&b!==a.O&&a.ja();if(c)K(a,a.defaultValue,!0);else if(a.Gb=void 0,Ab(a,olympe.D.Node.C.wh),b=a.T)for(const d of b.values())Nb(d,a)}}function Fb(a){if(a.C!==olympe.D.Node.C.nh){Ab(a,olympe.D.Node.C.nh);var b=a.T;if(b)for(const c of b.values())Fb(c);a.ja();void 0!==a.O&&Hb(a);a.Gb=a.defaultValue}}function Db(a){return a.C===olympe.D.Node.C.Ih}
283
+ function Eb(a,b){b===a?olympe.D.H.error('Setting a node as provider of itself. Ignoring'):(a.O&&a.O!==b&&Hb(a),Bb(b,a),Db(b)?K(a,b.Gb,!0):void 0!==a.defaultValue?K(a,a.defaultValue,!0):Nb(a),a.O=b)}function Ob(a,b){a.Cd&&(a.Cd=void 0);a.ld='Repeater';Eb(a,b)}function Kb(a){a.O?Jb(a):null!==a.ea&&0===Array.from(a.ea.values()).filter(b=>!Db(b)).length&&(a.hc&&(a.hc=!1,Cb(a)),Jb(a))}
284
284
  function Bb(a,b){a.T||(a.T=new Map);a.T.set(b.U(),b);a.C===olympe.D.Node.C.Qd&&olympe.D.H.warn('adding a downstream node on a deleted one (#'+a.U()+') !')}function Ib(a,b){a.T&&(b=b.U(),a.T.has(b)&&(a.T.delete(b),Pb(a)))}function Pb(a){if(null===a.getParent()){var b=a.T;b&&0<b.size||a.destroy()}}
285
- olympe.D.Node=class extends olympe.D.Xb{constructor({valueType:a,Cd:b,Sy:c=!0,Nf:d,Zm:e,debug:f=!1,dg:g=null,ld:h='Node',Xi:k}={}){++yb;super(String(yb));this.debug=!!f;this.ld=h;h&&'string'===typeof h||(b?this.ld=b.name?b.name:'anon()':this.ld='Node');this.ua=e&&0<e.length?e:null;this.dg=g&&0<g.length?g:null;this.valueType=a;this.Fb=void 0;this.Jb=!1;this.C=olympe.D.Node.C.wh;this.hc=!1;this.T=this.ea=null;this.Cd=b;this.Nf=d||null;this.defaultValue=this.Ub=this.O=void 0;this.Xi=k;d&&d instanceof
286
- olympe.D.Node&&zb(this,d);if(g)for(b=0;b<g.length;b++)a=e[g[b]],zb(this,a);c&&Cb(this)}eh(a){this.defaultValue=a;this.C===olympe.D.Node.C.wh&&K(this,a,!0);return this}Yi(a){this.valueType=a}Mb(){return this.valueType||Object}asObservable(a=olympe.D.$a()){return new rxjs.Observable(b=>{const c=a.run(()=>olympe.D.createNode(this.valueType,b.next.bind(b),null,[this],[0],`Observable of ${this.ld}`));c.onDestroy(()=>b.complete());return()=>c.destroy()})}Gc(){return this.C}eb(){return this.C===olympe.D.Node.C.Qd}od(){return this.C===
285
+ olympe.D.Node=class extends olympe.D.Xb{constructor({valueType:a,Cd:b,Sy:c=!0,Nf:d,Zm:e,debug:f=!1,dg:g=null,ld:h='Node',Xi:k}={}){++yb;super(String(yb));this.debug=!!f;this.ld=h;h&&'string'===typeof h||(b?this.ld=b.name?b.name:'anon()':this.ld='Node');this.ua=e&&0<e.length?e:null;this.dg=g&&0<g.length?g:null;this.valueType=a;this.Gb=void 0;this.Fb=!1;this.C=olympe.D.Node.C.wh;this.hc=!1;this.T=this.ea=null;this.Cd=b;this.Nf=d||null;this.defaultValue=this.Ub=this.O=void 0;this.Xi=k;d&&d instanceof
286
+ olympe.D.Node&&zb(this,d);if(g)for(b=0;b<g.length;b++)a=e[g[b]],zb(this,a);c&&Cb(this)}eh(a){this.defaultValue=a;this.C===olympe.D.Node.C.wh&&K(this,a,!0);return this}Yi(a){this.valueType=a}Mb(){return this.valueType||Object}asObservable(a=olympe.D.Wa()){return new rxjs.Observable(b=>{const c=a.run(()=>olympe.D.createNode(this.valueType,b.next.bind(b),null,[this],[0],`Observable of ${this.ld}`));c.onDestroy(()=>b.complete());return()=>c.destroy()})}Gc(){return this.C}fb(){return this.C===olympe.D.Node.C.Qd}od(){return this.C===
287
287
  olympe.D.Node.C.Sf}Ud(...a){if(this.Xi instanceof Function)return this.Xi(...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.Gc();a!==olympe.D.Node.C.Sf&&a!==olympe.D.Node.C.Qd||olympe.D.H.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.jb(g)&&b.push(g.Da);else for(let h=0,k=a.length;h<k;h++)g=a[h],f=e[g],void 0!==f&&null!==f&&f.Og&&(e[g]=f.Da,b.push(g));return L(new olympe.D.Node({valueType:d.J(),
288
288
  Cd:c,Nf:this,Zm:e,debug:!1,dg:b,ld:'Proxy.'+c+'()'}))}wk(a){if(null===this.getParent())olympe.D.H.warn('context is undefined, investigate');else if(this.getParent()!==a){olympe.D.H.warn('Investigate a potential issue in creator-createe link: create node mismatch',a,this.getParent());return}this.Bf(null);Pb(this)}destroy(){var a=this.C;if(a!==olympe.D.Node.C.Sf&&a!==olympe.D.Node.C.Qd){Ab(this,olympe.D.Node.C.Sf);if(a=this.T){for(const c of a.values())if(a.has(c.U())){var b=c;b.ea&&b.ea.delete(this.U());
289
- b.O&&b.O.U()===this.U()?b.O=void 0:b.destroy()}a.clear()}this.T=null;super.destroy();if(this.ea){for(const c of this.ea.values())this.ea.has(c.U())&&Ib(c,this);this.ea.clear()}this.ea=null;this.O&&(Ib(this.O,this),this.O=void 0);this.Fb=void 0;this.ua&&(this.ua.length=0,this.ua=null);this.dg&&(this.dg.length=0,this.dg=null);this.Xi=this.Cd=void 0;this.defaultValue=this.Nf=null;this.ld=`** Destroyed ** ${this.ld}`;Ab(this,olympe.D.Node.C.Qd)}}Uc(){return this.ld}};olympe.D.Node.F='rootNode';
289
+ b.O&&b.O.U()===this.U()?b.O=void 0:b.destroy()}a.clear()}this.T=null;super.destroy();if(this.ea){for(const c of this.ea.values())this.ea.has(c.U())&&Ib(c,this);this.ea.clear()}this.ea=null;this.O&&(Ib(this.O,this),this.O=void 0);this.Gb=void 0;this.ua&&(this.ua.length=0,this.ua=null);this.dg&&(this.dg.length=0,this.dg=null);this.Xi=this.Cd=void 0;this.defaultValue=this.Nf=null;this.ld=`** Destroyed ** ${this.ld}`;Ab(this,olympe.D.Node.C.Qd)}}Uc(){return this.ld}};olympe.D.Node.F='rootNode';
290
290
  olympe.D.Node.C={wh:0,Ih:1,nh:3,Sj:4,OBSOLETE:5,Sf:6,Qd:7};function Gb(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.H.error('investigate');c=Object.create(Qb(c,a.prototype));c.Lh=a;c.rr=b;return c}function Qb(a,b){Object.prototype.hasOwnProperty.call(b,olympe.D.Proxy.$l)||Object.defineProperty(b,olympe.D.Proxy.$l,{enumerable:!1,configurable:!1,writable:!1,value:Rb(a,b)});return b[olympe.D.Proxy.$l]}
291
291
  function Sb(a,b){if(a.Lh!==b){a.Lh=b;b.prototype||olympe.D.H.error('Cast not possible, provided type is not a valid type!');var c=Qb(a,b.prototype);Object.setPrototypeOf?Object.setPrototypeOf(a,c):a.__proto__=c;a.Da&&a.Da.Yi(b)}}
292
- function Rb(a,b){let c={};if(b.prototype)olympe.D.H.error('first level of prototyping, investigate');else if(b.__proto__)c=Object.create(Qb(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].L;null===e||e&&e.O()?c[d]=function(...f){var g=this.Da;if(g&&Db(g)&&(g=g.Fb)&&g[d]&&'function'===typeof g[d])return g[d].apply(g,f)}:(e=e||b[d].__oSig__||olympe.D.K.Z,c[d]=function(...f){f=this.rr.call(this.Da,
293
- ...f,e,d);const g=e.Z;if(g){const h=this.Da.Fb;h&&h[g]&&Sb(f,h[g])}return e.T()?this:f})}});return c}function Tb(a,b){K(a.Da,b)}function Ub(a){Nb(a.Da)}function Vb(a,b){Ob(a.Da,olympe.D.Jf(b)?b:b.Da)}function Wb(a,b){olympe.D.jb(b)||olympe.D.Jf(b)?Vb(a,b):Tb(a,b)}
294
- olympe.D.Proxy=class{constructor(a,b){this.Da=null;this.Lh=a;this.rr=b}static jb(a){return!(!a||!a.Og)}Fa(a){return olympe.D.va([this,a],(b,c)=>b===c,Boolean)}Ad(a){return olympe.D.va([this,a],(b,c)=>null===b||null===c?b===c?olympe.D.fa.F:olympe.D.fa.C:b.valueOf()===c.valueOf()?olympe.D.fa.F:olympe.D.fa.C,olympe.D.fa)}asObservable(a){return this.Da.asObservable(a)}qr(){return this.Da}};olympe.D.Proxy.$l='__opp__';olympe.D.Proxy.prototype.Og=!0;function Xb(a,b){a.node.eh(b);return a}olympe.D.Mj=class{constructor(a,b='FlowSource'){this.node=olympe.D.createNode(a,void 0,void 0,void 0,void 0,b)}update(a){olympe.D.jb(a)?K(this.node,olympe.D.Na(a)):K(this.node,a);return this}repeat(a){Ob(this.node,olympe.D.jb(a)?a.Da:a);return this}clear(){Nb(this.node);return this}sb(){return L(this.node)}getContext(){return this.node}};function Yb(a,b,c=1E3,d,e){const f=olympe.D.ec(olympe.D.ba),g=d||olympe.D.ba.Bo.Cp;let h,k,l,n;f.update(olympe.D.ra(a));const p=window.performance.now(),q=b.valueOf();l=q-a.valueOf();if(0!==l&&void 0===n){const r=()=>{f.getContext().eb()||(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.ra(h)),1===k&&void 0!==e&&e(h),1>k&&(n=window.requestAnimationFrame(r)))};n=window.requestAnimationFrame(r)}return f.sb()}
292
+ function Rb(a,b){let c={};if(b.prototype)olympe.D.H.error('first level of prototyping, investigate');else if(b.__proto__)c=Object.create(Qb(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].L;null===e||e&&e.O()?c[d]=function(...f){var g=this.Da;if(g&&Db(g)&&(g=g.Gb)&&g[d]&&'function'===typeof g[d])return g[d].apply(g,f)}:(e=e||b[d].__oSig__||olympe.D.K.Z,c[d]=function(...f){f=this.rr.call(this.Da,
293
+ ...f,e,d);const g=e.Z;if(g){const h=this.Da.Gb;h&&h[g]&&Sb(f,h[g])}return e.T()?this:f})}});return c}function Tb(a,b){K(a.Da,b)}function Ub(a){Nb(a.Da)}function Vb(a,b){Ob(a.Da,olympe.D.Jf(b)?b:b.Da)}function Wb(a,b){olympe.D.jb(b)||olympe.D.Jf(b)?Vb(a,b):Tb(a,b)}
294
+ olympe.D.Proxy=class{constructor(a,b){this.Da=null;this.Lh=a;this.rr=b}static jb(a){return!(!a||!a.Og)}Fa(a){return olympe.D.va([this,a],(b,c)=>b===c,Boolean)}Ad(a){return olympe.D.va([this,a],(b,c)=>null===b||null===c?b===c?olympe.D.fa.F:olympe.D.fa.C:b.valueOf()===c.valueOf()?olympe.D.fa.F:olympe.D.fa.C,olympe.D.fa)}asObservable(a){return this.Da.asObservable(a)}qr(){return this.Da}};olympe.D.Proxy.$l='__opp__';olympe.D.Proxy.prototype.Og=!0;function Xb(a,b){a.node.eh(b);return a}olympe.D.Mj=class{constructor(a,b='FlowSource'){this.node=olympe.D.createNode(a,void 0,void 0,void 0,void 0,b)}update(a){olympe.D.jb(a)?K(this.node,olympe.D.Na(a)):K(this.node,a);return this}repeat(a){Ob(this.node,olympe.D.jb(a)?a.Da:a);return this}clear(){Nb(this.node);return this}sb(){return L(this.node)}getContext(){return this.node}};function Yb(a,b,c=1E3,d,e){const f=olympe.D.ec(olympe.D.ba),g=d||olympe.D.ba.Bo.Cp;let h,k,l,n;f.update(olympe.D.ra(a));const p=window.performance.now(),q=b.valueOf();l=q-a.valueOf();if(0!==l&&void 0===n){const r=()=>{f.getContext().fb()||(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.ra(h)),1===k&&void 0!==e&&e(h),1>k&&(n=window.requestAnimationFrame(r)))};n=window.requestAnimationFrame(r)}return f.sb()}
295
295
  olympe.D.ba=class{constructor(a){this.value=void 0===a||null===a?0:a}toJSON(){return'{ "type": "number", "value": '+JSON.stringify(this.value)+' }'}static Pb(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return olympe.D.ra(b.value)}un(){return'number'===typeof this.value&&!isNaN(this.value)}isNaN(){return olympe.D.Sb(!this.un())}Oc(){return null===this.value||void 0===this.value||void 0===this.value.toString||isNaN(this.value)?olympe.D.Ab(''):olympe.D.Ab(this.value.toString())}toString(a,b){return void 0!==
296
- 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.un()?this.valueOf().toFixed(a):''}static max(a){const b=new Map;let c=-Infinity;const d=olympe.D.ec(olympe.D.ba,'ONumber.max result'),e=()=>{c=-Infinity;for(const f of b.values())f>c&&(c=f);d.update(olympe.D.ra(c))};a.forEach((f,g)=>{olympe.D.Nc([f],h=>{b.set(g,h.valueOf());e()})},f=>{if(!d.getContext().eb()){var g=b.get(f);b.delete(f);
296
+ 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.un()?this.valueOf().toFixed(a):''}static max(a){const b=new Map;let c=-Infinity;const d=olympe.D.ec(olympe.D.ba,'ONumber.max result'),e=()=>{c=-Infinity;for(const f of b.values())f>c&&(c=f);d.update(olympe.D.ra(c))};a.forEach((f,g)=>{olympe.D.Nc([f],h=>{b.set(g,h.valueOf());e()})},f=>{if(!d.getContext().fb()){var g=b.get(f);b.delete(f);
297
297
  g===c&&e()}});return d.sb()}ae(a){return olympe.D.va([this,a],(b,c)=>olympe.D.ra(b.valueOf()+c.valueOf()),olympe.D.ba,'ONumber.plus')}bh(a){return olympe.D.va([this,a],(b,c)=>olympe.D.ra(b.valueOf()-c.valueOf()),olympe.D.ba,'ONumber.minus')}round(){return olympe.D.ra(Math.round(this.valueOf()))}rj(){return olympe.D.ra(-this.valueOf())}Kk(a){return olympe.D.va([this,a],(b,c)=>olympe.D.ra(b.valueOf()*c.valueOf()),olympe.D.ba,'ONumber.mul')}aj(a){return olympe.D.va([this,a],(b,c)=>olympe.D.ra(b.valueOf()/
298
298
  c.valueOf()),olympe.D.ba,'ONumber.div')}vy(a){return olympe.D.va([this,a],(b,c)=>olympe.D.ra(b.valueOf()%c.valueOf()),olympe.D.ba,'ONumber.div')}floor(){return olympe.D.ra(Math.floor(this.valueOf()))}ceil(){return olympe.D.ra(Math.ceil(this.valueOf()))}trunc(){return olympe.D.ra(Math.trunc(this.valueOf()))}log(){return olympe.D.ra(Math.log(this.valueOf()))}pow(a){return olympe.D.va([this,a],(b,c)=>olympe.D.ra(Math.pow(b.valueOf(),c.valueOf())),olympe.D.ba,'ONumber.pow')}exp(){return olympe.D.ra(Math.exp(this.valueOf()))}Ad(a){return olympe.D.va([this,
299
299
  a],(b,c)=>olympe.D.Sb(b.Fa(c)),olympe.D.fa,'ONumber.oEquals')}Fa(a){return this.valueOf()===(void 0!==a&&null!==a?a.valueOf():void 0)}valueOf(){return void 0!==this.value?this.value.valueOf():void 0}Fx(){return this.valueOf()}bn(a){return olympe.D.va([this,a],(b,c)=>b.valueOf()>c.valueOf()?olympe.D.fa.F:olympe.D.fa.C,olympe.D.fa,'ONumber.isBiggerThan')}Wy(a){return olympe.D.va([this,a],(b,c)=>b.valueOf()>=c.valueOf()?b:olympe.D.ra(c),olympe.D.ba,'ONumber.returnsBiggest')}ls(a){return olympe.D.va([this,
300
300
  a],(b,c)=>b.valueOf()<=c.valueOf()?b:olympe.D.ra(c),olympe.D.ba,'ONumber.returnsSmallest')}my(a){return olympe.D.va([this,a],(b,c)=>b.valueOf()<c.valueOf()?olympe.D.fa.F:olympe.D.fa.C,olympe.D.fa,'ONumber.isSmallerThan')}sin(){return olympe.D.ra(Math.sin(this.valueOf()))}cos(){return olympe.D.ra(Math.cos(this.valueOf()))}atan2(a){return olympe.D.jb(a)?olympe.D.qe([a],b=>olympe.D.ra(Math.atan2(this.valueOf(),b.valueOf())),olympe.D.ba):olympe.D.ra(Math.atan2(this.valueOf(),a.valueOf()))}abs(){return olympe.D.ra(Math.abs(this.valueOf()))}lj(a,
301
- b){return olympe.D.jb(a)||olympe.D.jb(b)?olympe.D.qe([a,b],(c,d)=>olympe.D.ra(this.valueOf()*d.valueOf()+c.valueOf()*(1-d.valueOf())),olympe.D.ba):olympe.D.ra(this.valueOf()*b.valueOf()+a.valueOf()*(1-b.valueOf()))}static cw(a,b,c,d){'number'===typeof a&&(a=olympe.D.$d(a));'number'===typeof b&&(b=olympe.D.$d(b));'number'===typeof c&&(c=olympe.D.$d(c));let e=0;const f=olympe.D.$d(0);let g,h;void 0!==b&&void 0!==c&&olympe.D.ij(b.bn(c),()=>{olympe.ka.ib('df').warn('You have a min bigger than max, cap your inputs')});
301
+ b){return olympe.D.jb(a)||olympe.D.jb(b)?olympe.D.qe([a,b],(c,d)=>olympe.D.ra(this.valueOf()*d.valueOf()+c.valueOf()*(1-d.valueOf())),olympe.D.ba):olympe.D.ra(this.valueOf()*b.valueOf()+a.valueOf()*(1-b.valueOf()))}static cw(a,b,c,d){'number'===typeof a&&(a=olympe.D.$d(a));'number'===typeof b&&(b=olympe.D.$d(b));'number'===typeof c&&(c=olympe.D.$d(c));let e=0;const f=olympe.D.$d(0);let g,h;void 0!==b&&void 0!==c&&olympe.D.ij(b.bn(c),()=>{olympe.ka.ab('df').warn('You have a min bigger than max, cap your inputs')});
302
302
  const k=(l,n)=>{n=olympe.D.$d(n);const p=olympe.D.ba.animate(n,500);Vb(f,p);Tb(n,olympe.D.ra(l));e=l};olympe.D.qe([a],l=>{e+=l.valueOf();e>h?k(h,e):e<g?k(g,e):Vb(f,olympe.D.$d(e))},olympe.D.ba);void 0!==b&&olympe.D.fn(b.valueOf(),l=>{if(g!==l&&(g=l,g>e)){const n=olympe.D.$d(e),p=olympe.D.ba.animate(n,400,d);l=olympe.D.ra(g);K(n.Da,l);e=g;Vb(f,p)}});void 0!==c&&olympe.D.fn(c.valueOf(),l=>{if(h!==l&&(h=l,h<e)){const n=olympe.D.$d(e),p=olympe.D.ba.animate(n,400,d);l=olympe.D.ra(h);K(n.Da,l);e=h;Vb(f,
303
303
  p)}});return f}static offset(a){let b;return olympe.D.qe([a],c=>{void 0===b&&(b=c);return olympe.D.ra(c-b)},olympe.D.ba,'offset')}static Dr(a){let b,c,d;return olympe.D.va([a],e=>{if(void 0===b)return b=e,c=window.performance.now(),olympe.D.ra(0);d=window.performance.now();const f=olympe.D.ra((e.valueOf()-b.valueOf())/(d-c));b=e;c=d;return f},olympe.D.ba,'derivative')}static by(a){let b=olympe.D.ra(0),c,d,e;return olympe.D.va([a],f=>{if(void 0===c)return c=f,d=window.performance.now(),olympe.D.ra(0);
304
304
  e=window.performance.now();b=b.ae((f.valueOf()+c.valueOf())/2*(e-d));c=f;d=e;return b},olympe.D.ba,'integrate')}static Hw(a){let b;return olympe.D.va([a],c=>{void 0===b&&(b=c.valueOf());const d=olympe.D.ra(c.valueOf()-b.valueOf());b=c;return d},olympe.D.ba,'diff')}static xw(a,b,c){return olympe.D.qe([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.ra(d>=e?d<=f?d:f:e)},olympe.D.ba)}static animate(a,b,c,d){let e;
305
305
  return e=olympe.D.va([a],f=>{const g=olympe.D.Na(b,1E3),h=olympe.D.Na(e);return void 0===h?olympe.D.ra(f):Yb(h,f,g,c,k=>{d&&d(k)})},olympe.D.ba)}static nw(a,b,c){let d,e,f,g,h,k,l=olympe.D.$d(),n;olympe.D.Nc([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);Tb(l,olympe.D.ra(g));1===h&&(clearTimeout(n),n=void 0)},0))});return l}static Oc(a){return olympe.D.jb(a)?
306
- olympe.D.va([a],b=>olympe.D.Ab(b.valueOf().toString()),olympe.D.Pa):olympe.D.Ab(a)}static rj(a){return olympe.D.jb(a)?olympe.D.va([a],b=>olympe.D.ra(-b.valueOf()),olympe.D.ba):olympe.D.ra(-a.valueOf())}static ae(a,b){return olympe.D.jb(a)||olympe.D.jb(b)?olympe.D.va([a,b],(c,d)=>olympe.D.ra(c.valueOf()+d.valueOf()),olympe.D.ba,'plus'):olympe.D.ra(a.valueOf()+b.valueOf())}static bh(a,b){return olympe.D.jb(a)||olympe.D.jb(b)?olympe.D.qe([a,b],(c,d)=>olympe.D.ra(c.valueOf()-d.valueOf()),olympe.D.ba,
307
- 'minus'):olympe.D.ra(a.valueOf()-b.valueOf())}static aj(a,b){return olympe.D.jb(a)||olympe.D.jb(b)?olympe.D.qe([a,b],(c,d)=>olympe.D.ra(c.valueOf()/d.valueOf()),olympe.D.ba,'div'):olympe.D.ra(a.valueOf()/b.valueOf())}static Qy(a,b){if(void 0===b)return a;olympe.D.Nc([b],c=>{c=olympe.D.ra(a.Da.Fb.valueOf()+c.valueOf());K(a.Da,c)},'plusEqual');return a}};olympe.D.ba.ZERO=new olympe.D.ba(0);olympe.D.ba.ONE=new olympe.D.ba(1);olympe.D.ba.Ov=new olympe.D.ba(2);olympe.D.ba.PI=new olympe.D.ba(Math.PI);
306
+ olympe.D.va([a],b=>olympe.D.Ab(b.valueOf().toString()),olympe.D.Qa):olympe.D.Ab(a)}static rj(a){return olympe.D.jb(a)?olympe.D.va([a],b=>olympe.D.ra(-b.valueOf()),olympe.D.ba):olympe.D.ra(-a.valueOf())}static ae(a,b){return olympe.D.jb(a)||olympe.D.jb(b)?olympe.D.va([a,b],(c,d)=>olympe.D.ra(c.valueOf()+d.valueOf()),olympe.D.ba,'plus'):olympe.D.ra(a.valueOf()+b.valueOf())}static bh(a,b){return olympe.D.jb(a)||olympe.D.jb(b)?olympe.D.qe([a,b],(c,d)=>olympe.D.ra(c.valueOf()-d.valueOf()),olympe.D.ba,
307
+ 'minus'):olympe.D.ra(a.valueOf()-b.valueOf())}static aj(a,b){return olympe.D.jb(a)||olympe.D.jb(b)?olympe.D.qe([a,b],(c,d)=>olympe.D.ra(c.valueOf()/d.valueOf()),olympe.D.ba,'div'):olympe.D.ra(a.valueOf()/b.valueOf())}static Qy(a,b){if(void 0===b)return a;olympe.D.Nc([b],c=>{c=olympe.D.ra(a.Da.Gb.valueOf()+c.valueOf());K(a.Da,c)},'plusEqual');return a}};olympe.D.ba.ZERO=new olympe.D.ba(0);olympe.D.ba.ONE=new olympe.D.ba(1);olympe.D.ba.Ov=new olympe.D.ba(2);olympe.D.ba.PI=new olympe.D.ba(Math.PI);
308
308
  olympe.D.ba.Ht=new olympe.D.ba(Infinity);olympe.D.ba.Du=new olympe.D.ba(-Infinity);olympe.D.ba.Jp=new olympe.D.ba(NaN);olympe.D.ba.DB=olympe.D.ba.Qy;olympe.D.ba.pz=olympe.D.ba.cw;olympe.D.ba.rB=olympe.D.ba.offset;olympe.D.ba.Xz=olympe.D.ba.Dr;olympe.D.ba.MD=olympe.D.ba.Dr;olympe.D.ba.UA=olympe.D.ba.by;olympe.D.ba.Yz=olympe.D.ba.Hw;olympe.D.ba.Fz=olympe.D.ba.xw;olympe.D.ba.qz=olympe.D.ba.animate;olympe.D.ba.rz=olympe.D.ba.nw;olympe.D.ba.WC=olympe.D.ba.Oc;olympe.D.ba.XC=olympe.D.ba.rj;
309
309
  olympe.D.ba.CB=olympe.D.ba.ae;olympe.D.ba.hB=olympe.D.ba.bh;olympe.D.ba.Zz=olympe.D.ba.aj;
310
310
  olympe.D.ba.Bo={Cp:function(a,b,c,d){return c*a/d+b},sA:function(a,b,c,d){a/=d;return c*a*a+b},CA:function(a,b,c,d){a/=d;return-c*a*(a-2)+b},oA: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},hA:function(a,b,c,d){a/=d;return c*a*a*a+b},yA:function(a,b,c,d){a/=d;a--;return c*(a*a*a+1)+b},mA: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},tA:function(a,b,c,d){a/=d;return c*a*a*a*a+b},DA:function(a,b,c,d){a/=d;a--;return-c*(a*a*a*a-1)+b},
@@ -313,26 +313,26 @@ pA: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
313
313
  c*(2*d*d+2*d*a+-3*d)},dA:function(a,b,c,d){d=(a/=d)*a;return b+c*(4*d*a+-9*d+6*a)},eA:function(a,b,c,d){d=(a/=d)*a;return b+c*(-2*d*d+10*d*a+-15*d+8*a)},AA: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)},zA: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)},jA:function(a,b,c,d){d=(a/=d)*a;a*=d;return b+c*(33*a*d+-59*d*d+32*a+-5*d)},iA:function(a,b,c,d){d=(a/=d)*a;a*=d;return b+c*(56*a*d+-105*d*d+60*a+-10*d)},wA:function(a,
314
314
  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},fA: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.ba.prototype;m.toJSON.L=olympe.D.K.C;m.un.L=olympe.D.K.C;m.isNaN.L=olympe.D.K.O;m.Oc.L=olympe.D.K.F;
315
315
  m.toString.L=new olympe.D.K(()=>String,[]);m.toFixed.L=new olympe.D.K(()=>String,[]);m.ae.L=new olympe.D.K(()=>olympe.D.ba,[0]);m.bh.L=new olympe.D.K(()=>olympe.D.ba,[0]);m.round.L=olympe.D.K.G;m.rj.L=olympe.D.K.G;m.Kk.L=new olympe.D.K(()=>olympe.D.ba,[0]);m.aj.L=new olympe.D.K(()=>olympe.D.ba,[0]);m.vy.L=new olympe.D.K(()=>olympe.D.ba,[0]);m.floor.L=olympe.D.K.G;m.ceil.L=olympe.D.K.G;m.trunc.L=olympe.D.K.G;m.log.L=olympe.D.K.G;m.pow.L=new olympe.D.K(()=>olympe.D.ba,[0]);m.exp.L=olympe.D.K.G;
316
- m.Ad.L=new olympe.D.K(()=>olympe.D.fa,[0]);m.Fa.L=olympe.D.K.C;m.valueOf.L=olympe.D.K.C;m.Fx.L=olympe.D.K.C;m.bn.L=new olympe.D.K(()=>olympe.D.fa,[0]);m.Wy.L=new olympe.D.K(()=>olympe.D.ba,[0]);m.ls.L=new olympe.D.K(()=>olympe.D.ba,[0]);m.my.L=new olympe.D.K(()=>olympe.D.fa,[0]);m.sin.L=olympe.D.K.G;m.cos.L=olympe.D.K.G;m.atan2.L=new olympe.D.K(()=>olympe.D.ba,[0]);m.abs.L=olympe.D.K.G;m.lj.L=new olympe.D.K(()=>olympe.D.ba,[0,1]);olympe.D.Pa=class{constructor(a){this.value=a}toJSON(){return'{ "type": "string", "value": '+JSON.stringify(this.value)+' }'}static Pb(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return olympe.D.Ab(b.value)}Ar(a){return olympe.D.Pa.concat(this,'.',a)}concat(...a){let b;Array.isArray(a[0])?b=a[0]:b=a;return olympe.D.va([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.Ab(d)},olympe.D.Pa,'OString.concat')}Oc(){return this}jz(a){return olympe.D.ra(parseInt(this.value,
317
- a))}rs(){return olympe.D.ra(parseFloat(this.value))}toString(){return this.value}valueOf(){return this.value.valueOf()}Fa(a){return this.value===(void 0===a||null===a?void 0:a.valueOf())}Ad(a){return olympe.D.va([this,a],(b,c)=>olympe.D.Sb(c&&b.valueOf()===c.valueOf()),olympe.D.fa,'OString.oEquals')}af(){return olympe.D.Sb(!this.value||0===this.value.length)}contains(a){return olympe.D.va([this,a],(b,c)=>olympe.D.Sb((c instanceof olympe.D.Pa||'string'===typeof c)&&b.valueOf().includes(c.valueOf())),
316
+ m.Ad.L=new olympe.D.K(()=>olympe.D.fa,[0]);m.Fa.L=olympe.D.K.C;m.valueOf.L=olympe.D.K.C;m.Fx.L=olympe.D.K.C;m.bn.L=new olympe.D.K(()=>olympe.D.fa,[0]);m.Wy.L=new olympe.D.K(()=>olympe.D.ba,[0]);m.ls.L=new olympe.D.K(()=>olympe.D.ba,[0]);m.my.L=new olympe.D.K(()=>olympe.D.fa,[0]);m.sin.L=olympe.D.K.G;m.cos.L=olympe.D.K.G;m.atan2.L=new olympe.D.K(()=>olympe.D.ba,[0]);m.abs.L=olympe.D.K.G;m.lj.L=new olympe.D.K(()=>olympe.D.ba,[0,1]);olympe.D.Qa=class{constructor(a){this.value=a}toJSON(){return'{ "type": "string", "value": '+JSON.stringify(this.value)+' }'}static Pb(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return olympe.D.Ab(b.value)}Ar(a){return olympe.D.Qa.concat(this,'.',a)}concat(...a){let b;Array.isArray(a[0])?b=a[0]:b=a;return olympe.D.va([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.Ab(d)},olympe.D.Qa,'OString.concat')}Oc(){return this}jz(a){return olympe.D.ra(parseInt(this.value,
317
+ a))}rs(){return olympe.D.ra(parseFloat(this.value))}toString(){return this.value}valueOf(){return this.value.valueOf()}Fa(a){return this.value===(void 0===a||null===a?void 0:a.valueOf())}Ad(a){return olympe.D.va([this,a],(b,c)=>olympe.D.Sb(c&&b.valueOf()===c.valueOf()),olympe.D.fa,'OString.oEquals')}af(){return olympe.D.Sb(!this.value||0===this.value.length)}contains(a){return olympe.D.va([this,a],(b,c)=>olympe.D.Sb((c instanceof olympe.D.Qa||'string'===typeof c)&&b.valueOf().includes(c.valueOf())),
318
318
  olympe.D.fa,'OString.contains')}startsWith(a,b){return olympe.D.va([this,a,b||0],(c,d,e)=>olympe.D.Sb(c.valueOf().startsWith(d.valueOf(),e.valueOf())),olympe.D.fa,'OString.startsWith')}endsWith(a,b){return olympe.D.va([this,a,b||-1],(c,d,e)=>{e=0<=e.valueOf()?e.valueOf():this.Um().valueOf()+e.valueOf()+1;return olympe.D.Sb(c.valueOf().endsWith(d.valueOf(),e))},olympe.D.fa,'OString.endsWith')}indexOf(a,b){return olympe.D.va([this,a,b||0],(c,d,e)=>olympe.D.ra(c.valueOf().indexOf(d.valueOf(),e.valueOf())),
319
- olympe.D.ba,'OString.indexOf')}lastIndexOf(a,b){return olympe.D.va([this,a,b||Infinity],(c,d,e)=>olympe.D.ra(c.valueOf().lastIndexOf(d.valueOf(),e.valueOf())),olympe.D.ba,'OString.lastIndexOf')}slice(a,b){return olympe.D.va([this,a,b],(c,d,e)=>olympe.D.Ab(c.valueOf().slice(d.valueOf(),e?e.valueOf():void 0)),olympe.D.Pa,'OString.slice')}Um(){return olympe.D.ra(this.value.length)}threshold(a){return olympe.D.va([this,a],(b,c)=>b.valueOf().length>=c.valueOf()?b:olympe.D.Pa.EMPTY,olympe.D.Pa,'OString.threshold')}toLowerCase(){return olympe.D.Ab(this.value.toLowerCase())}toUpperCase(){return olympe.D.Ab(this.value.toUpperCase())}trim(){return olympe.D.Ab(this.value.trim())}padStart(a,
320
- b){return olympe.D.va([this,a,b],(c,d,e)=>olympe.D.Ab(c.valueOf().padStart(d.valueOf(),e.valueOf())),olympe.D.Pa,'OString.padStart')}padEnd(a,b){return olympe.D.va([this,a,b],(c,d,e)=>olympe.D.Ab(c.valueOf().padEnd(d.valueOf(),e.valueOf())),olympe.D.Pa,'OString.padEnd')}replace(a,b){return olympe.D.va([this,a,b],(c,d,e)=>olympe.D.Ab(c.valueOf().replace(d.valueOf(),e.valueOf())),olympe.D.Pa,'OString.replace')}fz(a,b){return olympe.D.va([this,a,b],(c,d,e)=>olympe.D.Ab(c.valueOf().substr(d.valueOf(),
321
- e.valueOf())),olympe.D.Pa,'OString.subOStr')}static concat(...a){return olympe.D.Ab('').concat(...a)}};olympe.D.Pa.EMPTY=new olympe.D.Pa('');olympe.D.Pa.Av=new olympe.D.Pa(' ');m=olympe.D.Pa.prototype;m.toJSON.L=olympe.D.K.C;m.Ar.L=new olympe.D.K(()=>olympe.D.Pa,[0,1]);m.concat.L=olympe.D.K.F;m.Oc.L=olympe.D.K.F;m.jz.L=olympe.D.K.G;m.rs.L=olympe.D.K.G;m.toString.L=olympe.D.K.C;m.valueOf.L=olympe.D.K.C;m.Fa.L=olympe.D.K.C;m.Ad.L=new olympe.D.K(()=>olympe.D.fa,[0]);m.af.L=olympe.D.K.O;
322
- m.contains.L=new olympe.D.K(()=>olympe.D.fa,[0]);m.startsWith.L=new olympe.D.K(()=>olympe.D.fa,[0,1]);m.endsWith.L=new olympe.D.K(()=>olympe.D.fa,[0,1]);m.indexOf.L=new olympe.D.K(()=>olympe.D.ba,[0,1]);m.lastIndexOf.L=new olympe.D.K(()=>olympe.D.ba,[0,1]);m.slice.L=new olympe.D.K(()=>olympe.D.Pa,[0,1]);m.Um.L=olympe.D.K.G;m.threshold.L=new olympe.D.K(()=>olympe.D.Pa,[0]);m.toLowerCase.L=olympe.D.K.F;m.toUpperCase.L=olympe.D.K.F;m.trim.L=olympe.D.K.F;m.padStart.L=olympe.D.K.F;m.padEnd.L=olympe.D.K.F;
319
+ olympe.D.ba,'OString.indexOf')}lastIndexOf(a,b){return olympe.D.va([this,a,b||Infinity],(c,d,e)=>olympe.D.ra(c.valueOf().lastIndexOf(d.valueOf(),e.valueOf())),olympe.D.ba,'OString.lastIndexOf')}slice(a,b){return olympe.D.va([this,a,b],(c,d,e)=>olympe.D.Ab(c.valueOf().slice(d.valueOf(),e?e.valueOf():void 0)),olympe.D.Qa,'OString.slice')}Um(){return olympe.D.ra(this.value.length)}threshold(a){return olympe.D.va([this,a],(b,c)=>b.valueOf().length>=c.valueOf()?b:olympe.D.Qa.EMPTY,olympe.D.Qa,'OString.threshold')}toLowerCase(){return olympe.D.Ab(this.value.toLowerCase())}toUpperCase(){return olympe.D.Ab(this.value.toUpperCase())}trim(){return olympe.D.Ab(this.value.trim())}padStart(a,
320
+ b){return olympe.D.va([this,a,b],(c,d,e)=>olympe.D.Ab(c.valueOf().padStart(d.valueOf(),e.valueOf())),olympe.D.Qa,'OString.padStart')}padEnd(a,b){return olympe.D.va([this,a,b],(c,d,e)=>olympe.D.Ab(c.valueOf().padEnd(d.valueOf(),e.valueOf())),olympe.D.Qa,'OString.padEnd')}replace(a,b){return olympe.D.va([this,a,b],(c,d,e)=>olympe.D.Ab(c.valueOf().replace(d.valueOf(),e.valueOf())),olympe.D.Qa,'OString.replace')}fz(a,b){return olympe.D.va([this,a,b],(c,d,e)=>olympe.D.Ab(c.valueOf().substr(d.valueOf(),
321
+ e.valueOf())),olympe.D.Qa,'OString.subOStr')}static concat(...a){return olympe.D.Ab('').concat(...a)}};olympe.D.Qa.EMPTY=new olympe.D.Qa('');olympe.D.Qa.Av=new olympe.D.Qa(' ');m=olympe.D.Qa.prototype;m.toJSON.L=olympe.D.K.C;m.Ar.L=new olympe.D.K(()=>olympe.D.Qa,[0,1]);m.concat.L=olympe.D.K.F;m.Oc.L=olympe.D.K.F;m.jz.L=olympe.D.K.G;m.rs.L=olympe.D.K.G;m.toString.L=olympe.D.K.C;m.valueOf.L=olympe.D.K.C;m.Fa.L=olympe.D.K.C;m.Ad.L=new olympe.D.K(()=>olympe.D.fa,[0]);m.af.L=olympe.D.K.O;
322
+ m.contains.L=new olympe.D.K(()=>olympe.D.fa,[0]);m.startsWith.L=new olympe.D.K(()=>olympe.D.fa,[0,1]);m.endsWith.L=new olympe.D.K(()=>olympe.D.fa,[0,1]);m.indexOf.L=new olympe.D.K(()=>olympe.D.ba,[0,1]);m.lastIndexOf.L=new olympe.D.K(()=>olympe.D.ba,[0,1]);m.slice.L=new olympe.D.K(()=>olympe.D.Qa,[0,1]);m.Um.L=olympe.D.K.G;m.threshold.L=new olympe.D.K(()=>olympe.D.Qa,[0]);m.toLowerCase.L=olympe.D.K.F;m.toUpperCase.L=olympe.D.K.F;m.trim.L=olympe.D.K.F;m.padStart.L=olympe.D.K.F;m.padEnd.L=olympe.D.K.F;
323
323
  m.replace.L=olympe.D.K.F;m.fz.L=olympe.D.K.F;olympe.D.fa=class{constructor(a){this.value=a}toJSON(){return`{ "type": "boolean", "value": ${this.value.valueOf()}}`}static Pb(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return b.value?olympe.D.fa.F:olympe.D.fa.C}and(a){if(void 0!==a)return olympe.D.jb(a)?olympe.D.qe([a],b=>new olympe.D.fa(this.valueOf()&&b.valueOf()),olympe.D.fa,'and'):this.value&&a.valueOf()?olympe.D.fa.F:olympe.D.fa.C}Fa(a){return this.valueOf()===(void 0!==a?a.valueOf():void 0)}Ad(a){if(void 0!==a)return olympe.D.jb(a)?
324
324
  olympe.D.qe([a],b=>new olympe.D.fa(this.valueOf()===b.valueOf()),olympe.D.fa,'oEquals'):this.Fa(a)?olympe.D.fa.F:olympe.D.fa.C}pd(){return this.value?olympe.D.fa.C:olympe.D.fa.F}mw(a){if(void 0!==a)return olympe.D.jb(a)?olympe.D.qe([a],b=>new olympe.D.fa(!(this.valueOf()&&b.valueOf())),olympe.D.fa,'andNot'):this.value&&!a.valueOf()?olympe.D.fa.F:olympe.D.fa.C}or(a){if(void 0!==a)return olympe.D.jb(a)?olympe.D.qe([a],b=>new olympe.D.fa(this.valueOf()||b.valueOf()),olympe.D.fa,'or'):this.value||a.valueOf()?
325
325
  olympe.D.fa.F:olympe.D.fa.C}xor(a){return olympe.D.va([this,a],(b,c)=>{b=b.valueOf();c=c.valueOf();return olympe.D.Sb(b&&!c||!b&&c)},olympe.D.fa,'OBoolean.xor')}Vw(){return this.value}Tr(){return!0===this.value?olympe.D.ba.ONE:olympe.D.ba.ZERO}Oc(){return olympe.D.Ab(this.toString())}toString(){return this.value?'true':'false'}valueOf(){return this.value}};olympe.D.fa.F=new olympe.D.fa(!0);olympe.D.fa.C=new olympe.D.fa(!1);m=olympe.D.fa.prototype;m.toJSON.L=olympe.D.K.C;
326
- m.and.L=new olympe.D.K(()=>olympe.D.fa,[0]);m.Fa.L=olympe.D.K.C;m.Ad.L=new olympe.D.K(()=>olympe.D.fa,[0]);m.pd.L=olympe.D.K.O;m.mw.L=new olympe.D.K(()=>olympe.D.fa,[0]);m.or.L=new olympe.D.K(()=>olympe.D.fa,[0]);m.xor.L=new olympe.D.K(()=>olympe.D.fa,[0]);m.Vw.L=new olympe.D.K(()=>Boolean,[]);m.Tr.L=olympe.D.K.G;m.Oc.L=olympe.D.K.F;m.toString.L=olympe.D.K.C;m.valueOf.L=olympe.D.K.C;function Zb(a){return new olympe.D.fb(new Date(a))}
327
- olympe.D.fb=class{constructor(a){this.rb=a}toJSON(){return'{ "type": "dateTime", "value": "'+this.rb.toJSON()+'" }'}static Pb(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return new olympe.D.fb(new Date(b.value.valueOf()))}static now(){return new olympe.D.fb(new Date)}jj(){return this.rb&&!isNaN(this.rb.getTime())?olympe.D.fa.F:olympe.D.fa.C}Pt(){return olympe.D.ra(this.rb.getMilliseconds())}Rt(){return olympe.D.ra(this.rb.getSeconds())}Qt(){return olympe.D.ra(this.rb.getMinutes())}Ot(){return olympe.D.ra(this.rb.getHours())}kx(){return olympe.D.ra(this.rb.getDate())}getMonth(){return olympe.D.ra(this.rb.getMonth()+1)}St(){return olympe.D.ra(this.rb.getFullYear())}getTime(){return this.rb.getTime()}cz(){var a=
328
- olympe.D,b=a.Ab;var c=this.rb.getDate();c=10>c?'0'+c:c;var d=this.rb.getMonth()+1;return b.call(a,`${c}.${10>d?'0'+d:d}.${this.rb.getFullYear()}`)}toLocaleString(a){return void 0===a||'string'===typeof a?olympe.D.Ab(this.rb.toLocaleString(a)):olympe.D.va([this,a],(b,c)=>olympe.D.Ab(b.rb.toLocaleString(c.valueOf())),olympe.D.Pa)}toLocaleDateString(a){return void 0===a||'string'===typeof a?olympe.D.Ab(this.rb.toLocaleDateString(a)):olympe.D.va([this,a],(b,c)=>olympe.D.Ab(b.rb.toLocaleDateString(c.valueOf())),
329
- olympe.D.Pa)}toLocaleTimeString(a){return void 0===a||'string'===typeof a?olympe.D.Ab(this.rb.toLocaleTimeString(a)):olympe.D.va([this,a],(b,c)=>olympe.D.Ab(b.rb.toLocaleTimeString(c.valueOf())),olympe.D.Pa)}Oc(){return olympe.D.Ab(this.rb.toISOString())}gz(){return new Date(this.getTime())}iz(){return this}kz(){return this}cg(a,b){return olympe.D.va([b],c=>{const d=new olympe.D.fb(new Date(this.rb.getTime()));d.rb['set'+a](this.rb['get'+a]()+c.valueOf());return d},olympe.D.fb)}ew(a){return this.cg('Milliseconds',
330
- a)}jw(a){return this.cg('Seconds',a)}fw(a){return this.cg('Minutes',a)}dw(a){return this.cg('Hours',a)}Dm(a){return this.cg('Date',a)}kw(a){return'number'===typeof a?this.Dm(7*a):this.Dm(a.Kk(7))}gw(a){return this.cg('Month',a)}lw(a){return this.cg('FullYear',a)}dz(){let a=this.rb.getDay();a=0===a?6:a-1;return new olympe.D.fb(new Date(this.rb.getFullYear(),this.rb.getMonth(),this.rb.getDate()-a))}ez(){return new olympe.D.fb(new Date(this.rb.getFullYear(),this.rb.getMonth()))}Ad(a){return olympe.D.va([a],
331
- b=>olympe.D.Sb(this.Fa(b)),olympe.D.fa)}Fa(a){return a instanceof olympe.D.fb?this.getTime()===a.getTime()||isNaN(this.getTime())&&isNaN(a.getTime()):!1}xx(){let a=this.rb.getDay();0===a&&(a=7);return olympe.D.ra(a)}ox(a,b){return olympe.D.va([a,b],(c,d)=>{d=d.valueOf();'years'===d?c=this.rb.getFullYear()-c.rb.getFullYear():'months'===d?c=12*(this.rb.getFullYear()-c.rb.getFullYear())+(this.rb.getMonth()-c.rb.getMonth()):(d={milliseconds:1,seconds:1E3,minutes:6E4,hours:36E5,days:864E5,weeks:6048E5}[d],
332
- void 0===d&&(olympe.ka.ib('df').warn("[getDiff] '_unit' is not a valid unit! Defaulting to milliseconds"),d=1),c=Math.trunc((this.rb.getTime()-c.rb.getTime())/d));return olympe.D.ra(c)},olympe.D.ba)}hy(a){return olympe.D.va([a],b=>olympe.D.Sb(this.getTime()<b.getTime()),olympe.D.fa)}ey(a){return olympe.D.va([a],b=>olympe.D.Sb(this.getTime()>b.getTime()),olympe.D.fa)}iy(a,b){return olympe.D.va([a,b],(c,d)=>olympe.D.Sb(this.getTime()>c.getTime()&&this.getTime()<d.getTime()),olympe.D.fa)}valueOf(){return this.jj().valueOf()?
333
- new Date(this.getTime()):new Date(0)}};olympe.D.fb.C=Zb(0);olympe.D.fb.F=Zb(Number.NaN);m=olympe.D.fb.prototype;m.jj.L=olympe.D.K.O;m.Pt.L=olympe.D.K.G;m.Rt.L=olympe.D.K.G;m.Qt.L=olympe.D.K.G;m.Ot.L=olympe.D.K.G;m.kx.L=olympe.D.K.G;m.getMonth.L=olympe.D.K.G;m.St.L=olympe.D.K.G;m.getTime.L=olympe.D.K.C;m.cz.L=new olympe.D.K(()=>olympe.D.Pa,[0]);m.toLocaleString.L=olympe.D.K.F;m.toLocaleDateString.L=olympe.D.K.F;m.toLocaleTimeString.L=olympe.D.K.F;m.Oc.L=olympe.D.K.F;m.gz.L=olympe.D.K.C;
334
- m.iz.L=new olympe.D.K(()=>olympe.D.fb,[]);m.kz.L=new olympe.D.K(()=>olympe.D.fb,[]);m.cg.L=new olympe.D.K(()=>olympe.D.fb,[]);m.ew.L=new olympe.D.K(()=>olympe.D.fb,[]);m.jw.L=new olympe.D.K(()=>olympe.D.fb,[]);m.fw.L=new olympe.D.K(()=>olympe.D.fb,[]);m.dw.L=new olympe.D.K(()=>olympe.D.fb,[]);m.Dm.L=new olympe.D.K(()=>olympe.D.fb,[0]);m.kw.L=new olympe.D.K(()=>olympe.D.fb,[]);m.gw.L=new olympe.D.K(()=>olympe.D.fb,[]);m.lw.L=new olympe.D.K(()=>olympe.D.fb,[0]);
335
- m.dz.L=new olympe.D.K(()=>olympe.D.fb,[]);m.ez.L=new olympe.D.K(()=>olympe.D.fb,[]);m.Ad.L=olympe.D.K.O;m.Fa.L=olympe.D.K.C;m.xx.L=olympe.D.K.G;m.ox.L=new olympe.D.K(()=>olympe.D.ba,[0,1]);m.hy.L=new olympe.D.K(()=>olympe.D.fa,[0]);m.ey.L=new olympe.D.K(()=>olympe.D.fa,[0]);m.iy.L=new olympe.D.K(()=>olympe.D.fa,[0,1]);m.valueOf.L=olympe.D.K.C;const $b=new Map,ac=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})?$/i,bc=/^#?([a-f\d])([a-f\d])([a-f\d])([a-f\d])?$/i;function cc(a){const b=c=>{let d;c=c.valueOf();6>c.length?(d=17,c=bc.exec(c)):(d=1,c=ac.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.bf(a)?olympe.D.qe([a],b,olympe.D.Color):b(a)}
326
+ m.and.L=new olympe.D.K(()=>olympe.D.fa,[0]);m.Fa.L=olympe.D.K.C;m.Ad.L=new olympe.D.K(()=>olympe.D.fa,[0]);m.pd.L=olympe.D.K.O;m.mw.L=new olympe.D.K(()=>olympe.D.fa,[0]);m.or.L=new olympe.D.K(()=>olympe.D.fa,[0]);m.xor.L=new olympe.D.K(()=>olympe.D.fa,[0]);m.Vw.L=new olympe.D.K(()=>Boolean,[]);m.Tr.L=olympe.D.K.G;m.Oc.L=olympe.D.K.F;m.toString.L=olympe.D.K.C;m.valueOf.L=olympe.D.K.C;function Zb(a){return new olympe.D.gb(new Date(a))}
327
+ olympe.D.gb=class{constructor(a){this.rb=a}toJSON(){return'{ "type": "dateTime", "value": "'+this.rb.toJSON()+'" }'}static Pb(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return new olympe.D.gb(new Date(b.value.valueOf()))}static now(){return new olympe.D.gb(new Date)}jj(){return this.rb&&!isNaN(this.rb.getTime())?olympe.D.fa.F:olympe.D.fa.C}Pt(){return olympe.D.ra(this.rb.getMilliseconds())}Rt(){return olympe.D.ra(this.rb.getSeconds())}Qt(){return olympe.D.ra(this.rb.getMinutes())}Ot(){return olympe.D.ra(this.rb.getHours())}kx(){return olympe.D.ra(this.rb.getDate())}getMonth(){return olympe.D.ra(this.rb.getMonth()+1)}St(){return olympe.D.ra(this.rb.getFullYear())}getTime(){return this.rb.getTime()}cz(){var a=
328
+ olympe.D,b=a.Ab;var c=this.rb.getDate();c=10>c?'0'+c:c;var d=this.rb.getMonth()+1;return b.call(a,`${c}.${10>d?'0'+d:d}.${this.rb.getFullYear()}`)}toLocaleString(a){return void 0===a||'string'===typeof a?olympe.D.Ab(this.rb.toLocaleString(a)):olympe.D.va([this,a],(b,c)=>olympe.D.Ab(b.rb.toLocaleString(c.valueOf())),olympe.D.Qa)}toLocaleDateString(a){return void 0===a||'string'===typeof a?olympe.D.Ab(this.rb.toLocaleDateString(a)):olympe.D.va([this,a],(b,c)=>olympe.D.Ab(b.rb.toLocaleDateString(c.valueOf())),
329
+ olympe.D.Qa)}toLocaleTimeString(a){return void 0===a||'string'===typeof a?olympe.D.Ab(this.rb.toLocaleTimeString(a)):olympe.D.va([this,a],(b,c)=>olympe.D.Ab(b.rb.toLocaleTimeString(c.valueOf())),olympe.D.Qa)}Oc(){return olympe.D.Ab(this.rb.toISOString())}gz(){return new Date(this.getTime())}iz(){return this}kz(){return this}cg(a,b){return olympe.D.va([b],c=>{const d=new olympe.D.gb(new Date(this.rb.getTime()));d.rb['set'+a](this.rb['get'+a]()+c.valueOf());return d},olympe.D.gb)}ew(a){return this.cg('Milliseconds',
330
+ a)}jw(a){return this.cg('Seconds',a)}fw(a){return this.cg('Minutes',a)}dw(a){return this.cg('Hours',a)}Dm(a){return this.cg('Date',a)}kw(a){return'number'===typeof a?this.Dm(7*a):this.Dm(a.Kk(7))}gw(a){return this.cg('Month',a)}lw(a){return this.cg('FullYear',a)}dz(){let a=this.rb.getDay();a=0===a?6:a-1;return new olympe.D.gb(new Date(this.rb.getFullYear(),this.rb.getMonth(),this.rb.getDate()-a))}ez(){return new olympe.D.gb(new Date(this.rb.getFullYear(),this.rb.getMonth()))}Ad(a){return olympe.D.va([a],
331
+ b=>olympe.D.Sb(this.Fa(b)),olympe.D.fa)}Fa(a){return a instanceof olympe.D.gb?this.getTime()===a.getTime()||isNaN(this.getTime())&&isNaN(a.getTime()):!1}xx(){let a=this.rb.getDay();0===a&&(a=7);return olympe.D.ra(a)}ox(a,b){return olympe.D.va([a,b],(c,d)=>{d=d.valueOf();'years'===d?c=this.rb.getFullYear()-c.rb.getFullYear():'months'===d?c=12*(this.rb.getFullYear()-c.rb.getFullYear())+(this.rb.getMonth()-c.rb.getMonth()):(d={milliseconds:1,seconds:1E3,minutes:6E4,hours:36E5,days:864E5,weeks:6048E5}[d],
332
+ void 0===d&&(olympe.ka.ab('df').warn("[getDiff] '_unit' is not a valid unit! Defaulting to milliseconds"),d=1),c=Math.trunc((this.rb.getTime()-c.rb.getTime())/d));return olympe.D.ra(c)},olympe.D.ba)}hy(a){return olympe.D.va([a],b=>olympe.D.Sb(this.getTime()<b.getTime()),olympe.D.fa)}ey(a){return olympe.D.va([a],b=>olympe.D.Sb(this.getTime()>b.getTime()),olympe.D.fa)}iy(a,b){return olympe.D.va([a,b],(c,d)=>olympe.D.Sb(this.getTime()>c.getTime()&&this.getTime()<d.getTime()),olympe.D.fa)}valueOf(){return this.jj().valueOf()?
333
+ new Date(this.getTime()):new Date(0)}};olympe.D.gb.C=Zb(0);olympe.D.gb.F=Zb(Number.NaN);m=olympe.D.gb.prototype;m.jj.L=olympe.D.K.O;m.Pt.L=olympe.D.K.G;m.Rt.L=olympe.D.K.G;m.Qt.L=olympe.D.K.G;m.Ot.L=olympe.D.K.G;m.kx.L=olympe.D.K.G;m.getMonth.L=olympe.D.K.G;m.St.L=olympe.D.K.G;m.getTime.L=olympe.D.K.C;m.cz.L=new olympe.D.K(()=>olympe.D.Qa,[0]);m.toLocaleString.L=olympe.D.K.F;m.toLocaleDateString.L=olympe.D.K.F;m.toLocaleTimeString.L=olympe.D.K.F;m.Oc.L=olympe.D.K.F;m.gz.L=olympe.D.K.C;
334
+ m.iz.L=new olympe.D.K(()=>olympe.D.gb,[]);m.kz.L=new olympe.D.K(()=>olympe.D.gb,[]);m.cg.L=new olympe.D.K(()=>olympe.D.gb,[]);m.ew.L=new olympe.D.K(()=>olympe.D.gb,[]);m.jw.L=new olympe.D.K(()=>olympe.D.gb,[]);m.fw.L=new olympe.D.K(()=>olympe.D.gb,[]);m.dw.L=new olympe.D.K(()=>olympe.D.gb,[]);m.Dm.L=new olympe.D.K(()=>olympe.D.gb,[0]);m.kw.L=new olympe.D.K(()=>olympe.D.gb,[]);m.gw.L=new olympe.D.K(()=>olympe.D.gb,[]);m.lw.L=new olympe.D.K(()=>olympe.D.gb,[0]);
335
+ m.dz.L=new olympe.D.K(()=>olympe.D.gb,[]);m.ez.L=new olympe.D.K(()=>olympe.D.gb,[]);m.Ad.L=olympe.D.K.O;m.Fa.L=olympe.D.K.C;m.xx.L=olympe.D.K.G;m.ox.L=new olympe.D.K(()=>olympe.D.ba,[0,1]);m.hy.L=new olympe.D.K(()=>olympe.D.fa,[0]);m.ey.L=new olympe.D.K(()=>olympe.D.fa,[0]);m.iy.L=new olympe.D.K(()=>olympe.D.fa,[0,1]);m.valueOf.L=olympe.D.K.C;const $b=new Map,ac=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})?$/i,bc=/^#?([a-f\d])([a-f\d])([a-f\d])([a-f\d])?$/i;function cc(a){const b=c=>{let d;c=c.valueOf();6>c.length?(d=17,c=bc.exec(c)):(d=1,c=ac.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.bf(a)?olympe.D.qe([a],b,olympe.D.Color):b(a)}
336
336
  olympe.D.Color=class{constructor(a,b,c,d){this.C=olympe.D.ra(void 0!==a?Math.min(255,Math.max(0,Math.round(a))):0);this.F=olympe.D.ra(void 0!==b?Math.min(255,Math.max(0,Math.round(b))):0);this.b=olympe.D.ra(void 0!==c?Math.min(255,Math.max(0,Math.round(c))):0);this.a=olympe.D.ra(void 0!==d?Math.min(1,Math.max(0,d)):1)}toJSON(){return{r:this.C.valueOf(),g:this.F.valueOf(),b:this.b.valueOf(),a:this.a.valueOf()}}static Pb(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return olympe.D.Color.create(b.r,
337
337
  b.g,b.b,b.a)}static create(a,b,c,d=1){return olympe.D.va([a,b,c,d],(e,f,g,h)=>{e=olympe.D.ra(void 0!==e?Math.min(255,Math.max(0,Math.round(e.valueOf()))):0);f=olympe.D.ra(void 0!==f?Math.min(255,Math.max(0,Math.round(f.valueOf()))):0);g=olympe.D.ra(void 0!==g?Math.min(255,Math.max(0,Math.round(g.valueOf()))):0);h=olympe.D.ra(void 0!==h?Math.min(1,Math.max(0,h.valueOf())):1);for(let k of $b.values())if(k&&k.C.Fa(e)&&k.F.Fa(f)&&k.b.Fa(g)&&k.a.Fa(h))return k;return new olympe.D.Color(e,f,g,h)},olympe.D.Color)}Wg(){return this.C}Qg(){return this.b}Tg(){return this.F}Pg(){return this.a}qw(a,
338
338
  b){return olympe.D.Color.create(this.C.lj(a.Wg(),b),this.F.lj(a.Tg(),b),this.b.lj(a.Qg(),b),this.a.lj(a.Pg(),b))}Ow(a){return olympe.D.Color.create(this.C,this.F,this.b,a)}ss(){return`rgba(${this.C},${this.F},${this.b},${this.a})`}sn(){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);return'#'+(a+b).toUpperCase()}toString(){return this.sn()}Fa(a){return a instanceof olympe.D.Color?this.C.valueOf()===a.C.valueOf()&&
@@ -341,45 +341,45 @@ olympe.D.Color.prototype.getAlpha=olympe.D.Color.prototype.Pg;olympe.D.Color.pro
341
341
  m.Ow.L=new olympe.D.K(()=>olympe.D.Color,[]);m.ss.L=new olympe.D.K(()=>String,[]);m.sn.L=new olympe.D.K(()=>String,[]);m.Fa.L=olympe.D.K.C;m.compare.L=olympe.D.K.C;olympe.D.File=class{ma(){}up(){}vp(){}Sr(){}zk(){}Rm(){}Ak(){}rename(){}};olympe.D.$b=class{constructor(a,b){this.x=olympe.D.$d(a);this.y=olympe.D.$d(b)}toJSON(){return'{ "type": "vector2", "x": '+JSON.stringify(olympe.D.Na(this.x).valueOf())+', "y": '+JSON.stringify(olympe.D.Na(this.y).valueOf())+' }'}static Pb(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return new olympe.D.$b(b.x,b.y)}Tt(){return this.x}az(a){Wb(this.x,a)}Ut(){return this.y}bz(a){Wb(this.y,a)}Qx(){return this.x.ls(this.y)}ae(a){return olympe.D.va([this,a],(b,c)=>new olympe.D.$b(b.x.ae(c.x),b.y.ae(c.y)),
342
342
  olympe.D.$b,'Vector2.plus')}bh(a){return olympe.D.va([this,a],(b,c)=>new olympe.D.$b(b.x.bh(c.x),b.y.bh(c.y)),olympe.D.$b,'Vector2.minus')}xy(a){return new olympe.D.$b(this.x.Kk(a),this.y.Kk(a))}Jw(a){return new olympe.D.$b(this.x.aj(a),this.y.aj(a))}zy(){return new olympe.D.$b(this.x.rj(),this.y.rj())}Kw(a){return olympe.D.va([this,a],(b,c)=>olympe.D.va([b.x,b.y,c.x,c.y],(d,e,f,g)=>olympe.D.ra(d*f+e*g),olympe.D.ba),olympe.D.ba)}length(){return olympe.D.va([this.x,this.y],(a,b)=>olympe.D.ra(Math.sqrt(a*
343
343
  a+b*b)),olympe.D.ba)}normalize(){return olympe.D.va([this.x,this.y],(a,b)=>{const c=Math.sqrt(a*a+b*b);return new olympe.D.$b(a/c,b/c)},olympe.D.$b)}floor(){return olympe.D.va([this.x,this.y],(a,b)=>new olympe.D.$b(Math.floor(a),Math.floor(b)),olympe.D.$b)}ceil(){return olympe.D.va([this.x,this.y],(a,b)=>new olympe.D.$b(Math.ceil(a),Math.ceil(b)),olympe.D.$b)}round(){return olympe.D.va([this.x,this.y],(a,b)=>new olympe.D.$b(Math.round(a),Math.round(b)),olympe.D.$b)}hw(a){return new olympe.D.$b(this.x.ae(a),
344
- this.y.ae(a))}iw(a,b){return new olympe.D.$b(this.x.ae(a),this.y.ae(b))}Oc(){return olympe.D.va([this.x,this.y],(a,b)=>olympe.D.Ab(`Vector2[${a.valueOf()}, ${b.valueOf()}]`),olympe.D.Pa)}toString(){return`Vector2[${this.x.Da.Fb}, ${this.y.Da.Fb}]`}Fa(a){return this===a?!0:!1}};m=olympe.D.$b.prototype;m.toJSON.L=olympe.D.K.C;m.Tt.L=olympe.D.K.G;m.az.L=olympe.D.K.C;m.Ut.L=olympe.D.K.G;m.bz.L=olympe.D.K.C;m.Qx.L=olympe.D.K.G;m.ae.L=new olympe.D.K(()=>olympe.D.$b,[0]);
344
+ this.y.ae(a))}iw(a,b){return new olympe.D.$b(this.x.ae(a),this.y.ae(b))}Oc(){return olympe.D.va([this.x,this.y],(a,b)=>olympe.D.Ab(`Vector2[${a.valueOf()}, ${b.valueOf()}]`),olympe.D.Qa)}toString(){return`Vector2[${this.x.Da.Gb}, ${this.y.Da.Gb}]`}Fa(a){return this===a?!0:!1}};m=olympe.D.$b.prototype;m.toJSON.L=olympe.D.K.C;m.Tt.L=olympe.D.K.G;m.az.L=olympe.D.K.C;m.Ut.L=olympe.D.K.G;m.bz.L=olympe.D.K.C;m.Qx.L=olympe.D.K.G;m.ae.L=new olympe.D.K(()=>olympe.D.$b,[0]);
345
345
  m.bh.L=new olympe.D.K(()=>olympe.D.$b,[0]);m.xy.L=olympe.D.K.T;m.Jw.L=olympe.D.K.T;m.zy.L=olympe.D.K.T;m.Kw.L=new olympe.D.K(()=>olympe.D.ba,[0]);m.length.L=olympe.D.K.G;m.normalize.L=olympe.D.K.T;m.floor.L=olympe.D.K.T;m.ceil.L=olympe.D.K.T;m.round.L=olympe.D.K.T;m.hw.L=olympe.D.K.T;m.iw.L=olympe.D.K.T;m.Oc.L=olympe.D.K.F;m.toString.L=olympe.D.K.C;m.Fa.L=olympe.D.K.C;olympe.D.sg=class{constructor(){}Mb(){}Hd(){}get(){}Xh(){}has(){}Zg(){}Fc(){}Gf(){}mf(){}fg(){}forEach(){}he(){}};olympe.D.sg.prototype.forEachCurrentValue=olympe.D.sg.prototype.he;olympe.D.sg.prototype.forEach=olympe.D.sg.prototype.forEach;m=olympe.D.sg.prototype;m.has.L=olympe.D.K.O;m.Zg.L=olympe.D.K.C;m.Fc.L=new olympe.D.K(()=>Object,[]);m.Gf.L=new olympe.D.K(()=>String,[]);m.mf.L=olympe.D.K.G;m.fg.L=olympe.D.K.C;m.forEach.L=new olympe.D.K(()=>{},[]);m.he.L=olympe.D.K.C;olympe.D.kd=class extends olympe.D.sg{xd(){}Ff(){}$e(){}Ef(){}ie(){}Ze(){}bj(){}Zh(){}};olympe.D.kd.prototype.getCurrentAt=olympe.D.kd.prototype.Ze;olympe.D.kd.prototype.getAt=olympe.D.kd.prototype.ie;olympe.D.kd.prototype.getCurrentKeyAt=olympe.D.kd.prototype.Ef;olympe.D.kd.prototype.getKeyAt=olympe.D.kd.prototype.$e;olympe.D.kd.prototype.getCurrentRank=olympe.D.kd.prototype.Ff;olympe.D.kd.prototype.getRank=olympe.D.kd.prototype.xd;m=olympe.D.kd.prototype;m.xd.L=olympe.D.K.G;m.Ff.L=olympe.D.K.C;
346
- m.$e.L=new olympe.D.K(()=>String,[]);m.Ef.L=olympe.D.K.C;m.ie.L=new olympe.D.K(()=>Object,[]);m.Ze.L=olympe.D.K.C;m.bj.L=olympe.D.K.C;m.Zh.L=new olympe.D.K(()=>Array,[]);olympe.D.fi=class{constructor(a,b){this.O=b||olympe.D.$a();this.valueType=a||Object;this.values={};this.gb=this.ua=null;this.Vd=0;this.Z=Object.create(null);this.yb=Object.create(null);this.size=0;this.J=null;this.O.onDestroy(()=>{const c=this.Z;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()}}})}getContext(){return this.O}Mb(){return this.valueType}Hd(a){this.valueType=a;const b=this.ua;if(null!==b)for(const c in b)Object.prototype.hasOwnProperty.call(b,
347
- c)&&Sb(b[c],a)}get(a){const b=c=>{null===this.ua&&(this.ua={});return this.ej(this.ua,c,this.values[c],this.valueType,'Map.get('+c+')')};return olympe.D.va([a],c=>b(c),this.valueType)}Xh(a){a=this.values[a];return olympe.D.jb(a)?Db(a.Da)?a.Da.Fb:void 0:a}has(a){const b=c=>{null===this.gb&&(this.gb={});return this.ej(this.gb,c,c in this.values?olympe.D.fa.F:olympe.D.fa.C,olympe.D.fa,'Map.has('+c+')')};return olympe.D.va([a],c=>b(c),olympe.D.fa)}Zg(a){return a in this.values}ej(a,b,c,d,e){let f=a[b];
346
+ m.$e.L=new olympe.D.K(()=>String,[]);m.Ef.L=olympe.D.K.C;m.ie.L=new olympe.D.K(()=>Object,[]);m.Ze.L=olympe.D.K.C;m.bj.L=olympe.D.K.C;m.Zh.L=new olympe.D.K(()=>Array,[]);olympe.D.fi=class{constructor(a,b){this.O=b||olympe.D.Wa();this.valueType=a||Object;this.values={};this.hb=this.ua=null;this.Vd=0;this.Z=Object.create(null);this.yb=Object.create(null);this.size=0;this.J=null;this.O.onDestroy(()=>{const c=this.Z;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()}}})}getContext(){return this.O}Mb(){return this.valueType}Hd(a){this.valueType=a;const b=this.ua;if(null!==b)for(const c in b)Object.prototype.hasOwnProperty.call(b,
347
+ c)&&Sb(b[c],a)}get(a){const b=c=>{null===this.ua&&(this.ua={});return this.ej(this.ua,c,this.values[c],this.valueType,'Map.get('+c+')')};return olympe.D.va([a],c=>b(c),this.valueType)}Xh(a){a=this.values[a];return olympe.D.jb(a)?Db(a.Da)?a.Da.Gb:void 0:a}has(a){const b=c=>{null===this.hb&&(this.hb={});return this.ej(this.hb,c,c in this.values?olympe.D.fa.F:olympe.D.fa.C,olympe.D.fa,'Map.has('+c+')')};return olympe.D.va([a],c=>b(c),olympe.D.fa)}Zg(a){return a in this.values}ej(a,b,c,d,e){let f=a[b];
348
348
  f||this.O.run(()=>{f=olympe.D.Nd(d,void 0,e);a[b]=f;f.Da.onDestroy(()=>delete a[b]);olympe.D.jb(c)?Vb(f,c):Tb(f,c)});return f}Fc(){throw Error('Abstract method getFirstKey needs to be overridden');}Gf(){throw Error('Abstract method getFirstKey needs to be overridden');}mf(){null===this.J&&this.O.run(()=>{this.J=olympe.D.Nd(olympe.D.ba,olympe.D.ra(this.size));this.J.Da.onDestroy(()=>{this.J=null})});return this.J}fg(){return this.size}forEach(a,b){const c=this.zm();a=this.sr(c,a,b);this.ym(c,a)}zm(){return String(++this.Vd)}ym(a,
349
- b){this.yb[a]=b;olympe.D.$a().Z(()=>{const c=this.Z;for(const d in c)Object.prototype.hasOwnProperty.call(c,d)&&delete c[d][a];delete this.yb[a]});this.he(b)}sr(a,b,c){const d=olympe.D.$a();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.Cm(a,f,g)})}}Cm(a,b,c){void 0===this.Z[b]&&(this.Z[b]={});this.Z[b][a]=c}he(a){const b=this.values;for(const c in b)if(Object.prototype.hasOwnProperty.call(b,c)&&!1===
350
- a(b[c],c,this))break}tk(a,b){void 0!==this.values[a]&&this.Wi(a,!0);this.values[a]=b;var c=this.ua;null!==c&&void 0!==c[a]&&(b&&b instanceof olympe.D.Proxy?Vb(c[a],b):Tb(c[a],b));c=this.gb;null!==c&&void 0!==c[a]&&Wb(c[a],!0);this.size++;c=this.yb;for(const d in c)if(Object.prototype.hasOwnProperty.call(c,d))c[d](b,a,this)}Wi(a,b){const c=this.values;if(Object.prototype.hasOwnProperty.call(c,a)){var d=(d=c[a])&&d.Og?d.Da.Fb:d;var e=this.ua;null!==e&&void 0!==e[a]&&Ub(e[a]);e=this.gb;null!==e&&void 0!==
351
- e[a]&&Wb(e[a],!1);delete c[a];this.size--;b||this.zf()}a=this.Z[a];if(void 0!==a)for(const f in a)Object.prototype.hasOwnProperty.call(a,f)&&a[f].destroy();return d}zf(){null!==this.J&&Wb(this.J,this.size)}Nh(){var a=this.ua;if(null!==a)for(const c in a)Object.prototype.hasOwnProperty.call(a,c)&&Ub(a[c]);a=this.gb;if(null!==a)for(var b in a)Object.prototype.hasOwnProperty.call(a,b)&&Wb(a[b],!1);for(const c in this.values)Object.prototype.hasOwnProperty.call(this.values,c)&&delete this.values[c];for(const c in this.Z)if(Object.prototype.hasOwnProperty.call(this.Z,
349
+ b){this.yb[a]=b;olympe.D.Wa().Z(()=>{const c=this.Z;for(const d in c)Object.prototype.hasOwnProperty.call(c,d)&&delete c[d][a];delete this.yb[a]});this.he(b)}sr(a,b,c){const d=olympe.D.Wa();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.Cm(a,f,g)})}}Cm(a,b,c){void 0===this.Z[b]&&(this.Z[b]={});this.Z[b][a]=c}he(a){const b=this.values;for(const c in b)if(Object.prototype.hasOwnProperty.call(b,c)&&!1===
350
+ a(b[c],c,this))break}tk(a,b){void 0!==this.values[a]&&this.Wi(a,!0);this.values[a]=b;var c=this.ua;null!==c&&void 0!==c[a]&&(b&&b instanceof olympe.D.Proxy?Vb(c[a],b):Tb(c[a],b));c=this.hb;null!==c&&void 0!==c[a]&&Wb(c[a],!0);this.size++;c=this.yb;for(const d in c)if(Object.prototype.hasOwnProperty.call(c,d))c[d](b,a,this)}Wi(a,b){const c=this.values;if(Object.prototype.hasOwnProperty.call(c,a)){var d=(d=c[a])&&d.Og?d.Da.Gb:d;var e=this.ua;null!==e&&void 0!==e[a]&&Ub(e[a]);e=this.hb;null!==e&&void 0!==
351
+ e[a]&&Wb(e[a],!1);delete c[a];this.size--;b||this.zf()}a=this.Z[a];if(void 0!==a)for(const f in a)Object.prototype.hasOwnProperty.call(a,f)&&a[f].destroy();return d}zf(){null!==this.J&&Wb(this.J,this.size)}Nh(){var a=this.ua;if(null!==a)for(const c in a)Object.prototype.hasOwnProperty.call(a,c)&&Ub(a[c]);a=this.hb;if(null!==a)for(var b in a)Object.prototype.hasOwnProperty.call(a,b)&&Wb(a[b],!1);for(const c in this.values)Object.prototype.hasOwnProperty.call(this.values,c)&&delete this.values[c];for(const c in this.Z)if(Object.prototype.hasOwnProperty.call(this.Z,
352
352
  c)){b=this.Z[c];for(const d in b)Object.prototype.hasOwnProperty.call(b,d)&&b[d].destroy()}this.size=0;null!==this.J&&Wb(this.J,this.size)}vg(){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.fi.ya=[olympe.D.sg];m=olympe.D.fi.prototype;m.getContext.L=olympe.D.K.C;m.Mb.L=olympe.D.K.C;m.Hd.L=olympe.D.K.C;m.get.L=new olympe.D.K(()=>Object,[],'valueType');m.Xh.L=olympe.D.K.C;m.has.L=olympe.D.K.O;m.Zg.L=olympe.D.K.C;m.ej.L=olympe.D.K.C;
353
- m.mf.L=olympe.D.K.G;m.fg.L=olympe.D.K.C;m.forEach.L=new olympe.D.K(()=>{},[]);m.zm.L=olympe.D.K.C;m.ym.L=olympe.D.K.C;m.sr.L=olympe.D.K.C;m.Cm.L=olympe.D.K.C;m.he.L=olympe.D.K.C;m.tk.L=olympe.D.K.C;m.Wi.L=olympe.D.K.C;m.zf.L=olympe.D.K.C;m.Nh.L=olympe.D.K.C;m.vg.L=olympe.D.K.C;olympe.D.vj=class extends olympe.D.fi{constructor(a,b){super(a,b);this.F=Object.create(null);this.C=[];this.ja=this.Ga=this.ab=this.ea=null}Hd(a){super.Hd(a);if(null!==this.ja)for(let b of this.ja.values())Sb(b,a)}Fc(){return this.ie(0)}Gf(){return this.$e(0)}xd(a){const b=c=>{null===this.ab&&(this.ab=Object.create(null));let d=this.Ff(a);d=void 0!==d?olympe.D.ra(d):void 0;return this.ej(this.ab,c,d,olympe.D.ba,`List.getRank(${c})`)};return olympe.D.jb(a)?L(olympe.D.createNode(olympe.D.ba,b,null,
354
- [a.Da],[0],'onResolved('+(b.name||'')+')')):b(a)}Ff(a){return this.F[a]}$e(a){const b=c=>{const d=c.valueOf(),e=this.Ef(d);null===this.Ga&&(this.Ga=Object.create(null));return this.ej(this.Ga,String(d),e,String,'List.getKeyAt('+c+')')};return olympe.D.va([a],c=>b(c),String)}Ef(a){return this.C[a.valueOf()]}ie(a){if(olympe.D.jb(a))return this.get(olympe.D.va([a],c=>{c=this.$e(c);if(!Db(c.Da)){const d=olympe.D.$a();olympe.D.Jf(d)&&Nb(d)}return c},String));null===this.ja&&(this.ja=new Map);let b=this.ja.get(a);
355
- b||this.O.run(()=>{b=this.get(this.$e(a));this.ja.set(a,b);b.Da.onDestroy(()=>this.ja.delete(a))});return b}Ze(a){return this.Xh(this.Ef(a))}bj(a,b,c,d){let e=this.zm();a=this.ds(e,a,b,c,d);this.ym(e,a)}ds(a,b,c,d,e){return olympe.D.$a().G((f,g)=>{let h=!1,k=olympe.D.di([b,c,this.xd(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.Cm(a,g,k)})}Zh(){null===this.ea&&this.O.run(()=>{this.ea=olympe.D.Nd(Array,this.C.filter(a=>void 0!==a));
356
- this.ea.Da.onDestroy(()=>{this.J=null})});return this.ea}he(a){if(this.C.length!==this.size)super.he(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}}Bm(a,b){const c=this.ab,d=this.Ga,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]&&Ub(c[g]),void 0!==
357
- c[a]&&Tb(c[a],olympe.D.ra(f)));null!==d&&(void 0!==e&&null!==e&&void 0!==d[e]&&Ub(d[e]),void 0!==d[b]&&Tb(d[b],a))}}Am(a){var b=this.Ga,c=this.F[a];null!==c&&void 0!==c&&null!==b&&(b=b[c],void 0!==b&&b.Da.Fb===a&&Ub(b));delete this.F[a];this.C.splice(c,1);c=this.ab;null!==c&&void 0!==c[a]&&Ub(c[a])}tr(){if(null!==this.ea){const a=this.C,b=this.ea.Da.Fb;b&&a.join(',')!==b.join(',')&&Tb(this.ea,a)}}zf(){this.tr();super.zf()}Nh(){var a=this.F;for(b in a)delete a[b];this.C.length=0;a=this.ab;if(null!==
353
+ m.mf.L=olympe.D.K.G;m.fg.L=olympe.D.K.C;m.forEach.L=new olympe.D.K(()=>{},[]);m.zm.L=olympe.D.K.C;m.ym.L=olympe.D.K.C;m.sr.L=olympe.D.K.C;m.Cm.L=olympe.D.K.C;m.he.L=olympe.D.K.C;m.tk.L=olympe.D.K.C;m.Wi.L=olympe.D.K.C;m.zf.L=olympe.D.K.C;m.Nh.L=olympe.D.K.C;m.vg.L=olympe.D.K.C;olympe.D.vj=class extends olympe.D.fi{constructor(a,b){super(a,b);this.F=Object.create(null);this.C=[];this.ja=this.Ga=this.bb=this.ea=null}Hd(a){super.Hd(a);if(null!==this.ja)for(let b of this.ja.values())Sb(b,a)}Fc(){return this.ie(0)}Gf(){return this.$e(0)}xd(a){const b=c=>{null===this.bb&&(this.bb=Object.create(null));let d=this.Ff(a);d=void 0!==d?olympe.D.ra(d):void 0;return this.ej(this.bb,c,d,olympe.D.ba,`List.getRank(${c})`)};return olympe.D.jb(a)?L(olympe.D.createNode(olympe.D.ba,b,null,
354
+ [a.Da],[0],'onResolved('+(b.name||'')+')')):b(a)}Ff(a){return this.F[a]}$e(a){const b=c=>{const d=c.valueOf(),e=this.Ef(d);null===this.Ga&&(this.Ga=Object.create(null));return this.ej(this.Ga,String(d),e,String,'List.getKeyAt('+c+')')};return olympe.D.va([a],c=>b(c),String)}Ef(a){return this.C[a.valueOf()]}ie(a){if(olympe.D.jb(a))return this.get(olympe.D.va([a],c=>{c=this.$e(c);if(!Db(c.Da)){const d=olympe.D.Wa();olympe.D.Jf(d)&&Nb(d)}return c},String));null===this.ja&&(this.ja=new Map);let b=this.ja.get(a);
355
+ b||this.O.run(()=>{b=this.get(this.$e(a));this.ja.set(a,b);b.Da.onDestroy(()=>this.ja.delete(a))});return b}Ze(a){return this.Xh(this.Ef(a))}bj(a,b,c,d){let e=this.zm();a=this.ds(e,a,b,c,d);this.ym(e,a)}ds(a,b,c,d,e){return olympe.D.Wa().G((f,g)=>{let h=!1,k=olympe.D.di([b,c,this.xd(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.Cm(a,g,k)})}Zh(){null===this.ea&&this.O.run(()=>{this.ea=olympe.D.Nd(Array,this.C.filter(a=>void 0!==a));
356
+ this.ea.Da.onDestroy(()=>{this.J=null})});return this.ea}he(a){if(this.C.length!==this.size)super.he(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}}Bm(a,b){const c=this.bb,d=this.Ga,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]&&Ub(c[g]),void 0!==
357
+ c[a]&&Tb(c[a],olympe.D.ra(f)));null!==d&&(void 0!==e&&null!==e&&void 0!==d[e]&&Ub(d[e]),void 0!==d[b]&&Tb(d[b],a))}}Am(a){var b=this.Ga,c=this.F[a];null!==c&&void 0!==c&&null!==b&&(b=b[c],void 0!==b&&b.Da.Gb===a&&Ub(b));delete this.F[a];this.C.splice(c,1);c=this.bb;null!==c&&void 0!==c[a]&&Ub(c[a])}tr(){if(null!==this.ea){const a=this.C,b=this.ea.Da.Gb;b&&a.join(',')!==b.join(',')&&Tb(this.ea,a)}}zf(){this.tr();super.zf()}Nh(){var a=this.F;for(b in a)delete a[b];this.C.length=0;a=this.bb;if(null!==
358
358
  a)for(b in a)Ub(a[b]);a=this.Ga;if(null!==a)for(b in a)Ub(a[parseInt(b,10)]);var b=this.ea;null!==b&&(Lb(b.Da),Tb(b,this.C));return olympe.D.fi.prototype.Nh.call(this)}vg(){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.vj.ya=[olympe.D.kd];m=olympe.D.vj.prototype;m.Hd.L=olympe.D.K.C;m.Fc.L=new olympe.D.K(()=>Object,[]);m.Gf.L=new olympe.D.K(()=>String,[]);m.xd.L=olympe.D.K.G;m.Ff.L=olympe.D.K.C;
359
359
  m.$e.L=new olympe.D.K(()=>String,[]);m.Ef.L=olympe.D.K.C;m.ie.L=new olympe.D.K(()=>Object,[]);m.Ze.L=olympe.D.K.C;m.bj.L=new olympe.D.K(()=>{},[]);m.ds.L=olympe.D.K.C;m.Zh.L=new olympe.D.K(()=>Array,[]);m.he.L=olympe.D.K.C;m.Bm.L=olympe.D.K.C;m.Am.L=olympe.D.K.C;m.tr.L=olympe.D.K.C;m.zf.L=olympe.D.K.C;m.Nh.L=olympe.D.K.C;m.vg.L=olympe.D.K.C;olympe.D.Map=class extends olympe.D.fi{constructor(a){a===olympe.D.Proxy&&(a=Object);super(a);this.C=this.F=null}Hd(a){a===olympe.D.Proxy&&(a=Object);null!==this.F&&Sb(this.F,a);super.Hd(a)}Fc(){null===this.F&&this.Lm();return this.F}Gf(){null===this.C&&this.Lm();return this.C}Lm(){this.getContext().run(()=>{this.F=olympe.D.Nd(this.Mb());this.C=olympe.D.Nd(String);this.pj(this.Om())})}Om(){const a=this.values;let b,c;for(b in a)if(Object.prototype.hasOwnProperty.call(a,b)){c=b;break}return c}pj(a){if(void 0!==
360
- a){const b=this.values[a];b&&b instanceof olympe.D.Proxy?Vb(this.F,b):Tb(this.F,b);Tb(this.C,a)}else void 0!==this.F.Da.Fb&&(Ub(this.F),Ub(this.C))}set(a,b){this.tk(a,b);1===this.size&&null!==this.C&&this.pj(a);this.zf()}remove(a){const b=this.Wi(a);null!==this.C&&this.C.Da.Fb===a&&this.pj(this.Om());return b}clear(){this.Nh();null!==this.C&&this.pj()}};m=olympe.D.Map.prototype;m.Hd.L=olympe.D.K.C;m.Fc.L=new olympe.D.K(()=>Object,[]);m.Gf.L=new olympe.D.K(()=>String,[]);m.Lm.L=olympe.D.K.C;
361
- m.Om.L=olympe.D.K.C;m.pj.L=olympe.D.K.C;m.set.L=olympe.D.K.C;m.remove.L=new olympe.D.K(()=>Object,[]);m.clear.L=olympe.D.K.C;olympe.D.yg=class extends olympe.D.vj{constructor(a){super(a)}set(a,b,c){this.tk(a,b);void 0!==c&&olympe.D.Nc([c],d=>{this.Bm(a,d)});this.zf()}remove(a){this.Am(a);return this.Wi(a)}clear(){this.Nh()}};olympe.D.yg.prototype.remove.L=olympe.D.K.C;olympe.D.yg.prototype.clear.L=olympe.D.K.C;olympe.D.Ds=class extends olympe.D.Mj{constructor(a,b){super(olympe.D.ba,'animatedFlowSource');this.duration=a;this.C=b||olympe.D.ba.Bo.Cp}sb(){return olympe.D.By(this.node,this.duration,this.C,void 0)}};let dc=null;olympe.D.H=void 0;olympe.D.jn=void 0;olympe.D.Sh=void 0;olympe.D.Mh=new Map;olympe.D.Mh.set(0,olympe.D.ba.ZERO);olympe.D.Mh.set(1,olympe.D.ba.ONE);olympe.D.Mh.set(2,olympe.D.ba.Ov);olympe.D.sk=new Map;olympe.D.sk.set('',olympe.D.Pa.EMPTY);olympe.D.sk.set(' ',olympe.D.Pa.Av);olympe.D.createNode=function(a,b,c,d,e,f,g,h){return new olympe.D.Node({valueType:a,Cd:b,Nf:c,Zm:d,debug:g,dg:e,ld:f,Xi:h})};olympe.D.Jf=function(a){return a instanceof olympe.D.Node};
360
+ a){const b=this.values[a];b&&b instanceof olympe.D.Proxy?Vb(this.F,b):Tb(this.F,b);Tb(this.C,a)}else void 0!==this.F.Da.Gb&&(Ub(this.F),Ub(this.C))}set(a,b){this.tk(a,b);1===this.size&&null!==this.C&&this.pj(a);this.zf()}remove(a){const b=this.Wi(a);null!==this.C&&this.C.Da.Gb===a&&this.pj(this.Om());return b}clear(){this.Nh();null!==this.C&&this.pj()}};m=olympe.D.Map.prototype;m.Hd.L=olympe.D.K.C;m.Fc.L=new olympe.D.K(()=>Object,[]);m.Gf.L=new olympe.D.K(()=>String,[]);m.Lm.L=olympe.D.K.C;
361
+ m.Om.L=olympe.D.K.C;m.pj.L=olympe.D.K.C;m.set.L=olympe.D.K.C;m.remove.L=new olympe.D.K(()=>Object,[]);m.clear.L=olympe.D.K.C;olympe.D.yg=class extends olympe.D.vj{constructor(a){super(a)}set(a,b,c){this.tk(a,b);void 0!==c&&olympe.D.Nc([c],d=>{this.Bm(a,d)});this.zf()}remove(a){this.Am(a);return this.Wi(a)}clear(){this.Nh()}};olympe.D.yg.prototype.remove.L=olympe.D.K.C;olympe.D.yg.prototype.clear.L=olympe.D.K.C;olympe.D.Ds=class extends olympe.D.Mj{constructor(a,b){super(olympe.D.ba,'animatedFlowSource');this.duration=a;this.C=b||olympe.D.ba.Bo.Cp}sb(){return olympe.D.By(this.node,this.duration,this.C,void 0)}};let dc=null;olympe.D.H=void 0;olympe.D.jn=void 0;olympe.D.Sh=void 0;olympe.D.Mh=new Map;olympe.D.Mh.set(0,olympe.D.ba.ZERO);olympe.D.Mh.set(1,olympe.D.ba.ONE);olympe.D.Mh.set(2,olympe.D.ba.Ov);olympe.D.sk=new Map;olympe.D.sk.set('',olympe.D.Qa.EMPTY);olympe.D.sk.set(' ',olympe.D.Qa.Av);olympe.D.createNode=function(a,b,c,d,e,f,g,h){return new olympe.D.Node({valueType:a,Cd:b,Nf:c,Zm:d,debug:g,dg:e,ld:f,Xi:h})};olympe.D.Jf=function(a){return a instanceof olympe.D.Node};
362
362
  olympe.D.Nd=function(a,b,c){a=olympe.D.createNode(a,void 0,void 0,void 0,void 0,c);olympe.D.Jf(b)?Ob(a,b):olympe.D.jb(b)?Ob(a,b.Da):K(a,b);return L(a)};olympe.D.jb=function(a){return!(!a||!a.Og)};olympe.D.bf=function(a){return!(!a||!(a instanceof olympe.D.Node||a.Og))};olympe.D.cn=function(a){return a instanceof olympe.D.Xb||a instanceof olympe.D.Hq||a instanceof olympe.D.Node};olympe.D.$g=function(a){return a instanceof olympe.D.Mj};
363
- olympe.D.fn=function(a,b){if(void 0!==a){olympe.D.$g(a)&&(a=a.sb().Da);if(!olympe.D.bf(a))return b(a);var c=[];olympe.D.jb(a)?c.push(a.Da):c.push(a);return olympe.D.createNode(void 0,b,null,c,[0],'onResolved')}};olympe.D.Na=function(a,b){let c=a;olympe.D.jb(a)?c=a.Da.Fb:olympe.D.Jf(a)?c=a.Fb:olympe.D.$g(a)&&(c=a.sb().Da.Fb);return void 0===c?b:c};
363
+ olympe.D.fn=function(a,b){if(void 0!==a){olympe.D.$g(a)&&(a=a.sb().Da);if(!olympe.D.bf(a))return b(a);var c=[];olympe.D.jb(a)?c.push(a.Da):c.push(a);return olympe.D.createNode(void 0,b,null,c,[0],'onResolved')}};olympe.D.Na=function(a,b){let c=a;olympe.D.jb(a)?c=a.Da.Gb:olympe.D.Jf(a)?c=a.Gb:olympe.D.$g(a)&&(c=a.sb().Da.Gb);return void 0===c?b:c};
364
364
  olympe.D.eh=function(a,b){let c;olympe.D.jb(a)?c=a.Da:olympe.D.Jf(a)?c=a:olympe.D.$g(a)&&(c=a.sb().Da);c&&olympe.D.Nc([b],d=>{c.eh(d)},'setDefaultValue');return a};olympe.D.di=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.qr?(h=h.Da,g.push(k)):h instanceof olympe.D.Node?g.push(k):olympe.D.$g(h)&&(h=h.sb().Da,g.push(k))),f[k]=h;return olympe.D.createNode(c,b,null,f,g,d||'syncNodes')};
365
365
  olympe.D.qe=function(a,b,c,d){return L(olympe.D.di(a,b,c,d||'syncProxies'))};const ec=a=>{for(const b of a)if(olympe.D.bf(b)||olympe.D.$g(b))return!1;return!0};olympe.D.va=function(a,b,c,d,e){if(ec(a))return b(...a);const f=olympe.D.di(a,b,c,d||'TransformFlows');e&&olympe.D.Nc([e],g=>{f.eh(g)},'setDefaultValue');return L(f)};olympe.D.Nc=function(a,b,c){ec(a)?b(...a):olympe.D.di(a,b,void 0,c||'processFlows')};
366
- olympe.D.KD=function(a,b,c){const d=olympe.D.Jf(a)?a.Mb():olympe.D.$g(a)?a.sb().Lh:a.Lh,e=olympe.D.ec(d,c),f=olympe.Y.Promise.$i(g=>{e.getContext().eb()||e.update(g)},b);olympe.D.Nc([a],g=>f(g).then());return e.sb()};olympe.D.hs=function(a,b){if(ec(a))b(...a);else{const c=olympe.D.$a();olympe.D.di(a,(...d)=>{olympe.D.$a().destroy();c.run(b,...d)},void 0,'processFlowsOnce')}};
367
- olympe.D.gn=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.jb(g)?(g=g.Da,f.push(h)):g instanceof olympe.D.Node?f.push(h):olympe.D.$g(g)&&(g=g.sb().Da,f.push(h))),e[h]=g;0!==f.length&&new olympe.D.Node({Cd:b,Zm:e,dg:f,Sy:!1,ld:c})};olympe.D.js=function(a,b){const c=olympe.D.$a();olympe.D.gn(a,(...d)=>{olympe.D.$a().destroy();c.run(b,...d)},'processFutureFlowsOnce')};olympe.D.ID=function(a,b,c){a=new olympe.D.Mj(a,c);b(a);return a.sb()};
368
- olympe.D.ec=function(a,b='flowSource'){return new olympe.D.Mj(a,b)};olympe.D.pE=function(a,b,c,d){const e=olympe.D.$a();olympe.D.di(a,(...f)=>{olympe.D.$a().destroy();e.run(b,...f)},c,d||'syncProxiesOnce')};olympe.D.ij=function(a,b,c){olympe.D.va([a],d=>d.valueOf()?b.apply(null,void 0):c&&c.apply(null,void 0),Object,'If')};olympe.D.VD=function(a,b,c='from observable'){const d=olympe.D.ec(b,c),e=a.subscribe(f=>d.update(f));d.getContext().onDestroy(()=>e.unsubscribe());return d.sb()};
369
- olympe.D.SD=function(a,b,...c){return a?a.run(b,...c):b(...c)};olympe.D.tE=function(a){return olympe.D.$a().G(a)};olympe.D.PD=function(a,b,c){olympe.D.Lw(a?a.Da:a,b,c)};
366
+ olympe.D.KD=function(a,b,c){const d=olympe.D.Jf(a)?a.Mb():olympe.D.$g(a)?a.sb().Lh:a.Lh,e=olympe.D.ec(d,c),f=olympe.Y.Promise.$i(g=>{e.getContext().fb()||e.update(g)},b);olympe.D.Nc([a],g=>f(g).then());return e.sb()};olympe.D.hs=function(a,b){if(ec(a))b(...a);else{const c=olympe.D.Wa();olympe.D.di(a,(...d)=>{olympe.D.Wa().destroy();c.run(b,...d)},void 0,'processFlowsOnce')}};
367
+ olympe.D.gn=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.jb(g)?(g=g.Da,f.push(h)):g instanceof olympe.D.Node?f.push(h):olympe.D.$g(g)&&(g=g.sb().Da,f.push(h))),e[h]=g;0!==f.length&&new olympe.D.Node({Cd:b,Zm:e,dg:f,Sy:!1,ld:c})};olympe.D.js=function(a,b){const c=olympe.D.Wa();olympe.D.gn(a,(...d)=>{olympe.D.Wa().destroy();c.run(b,...d)},'processFutureFlowsOnce')};olympe.D.ID=function(a,b,c){a=new olympe.D.Mj(a,c);b(a);return a.sb()};
368
+ olympe.D.ec=function(a,b='flowSource'){return new olympe.D.Mj(a,b)};olympe.D.pE=function(a,b,c,d){const e=olympe.D.Wa();olympe.D.di(a,(...f)=>{olympe.D.Wa().destroy();e.run(b,...f)},c,d||'syncProxiesOnce')};olympe.D.ij=function(a,b,c){olympe.D.va([a],d=>d.valueOf()?b.apply(null,void 0):c&&c.apply(null,void 0),Object,'If')};olympe.D.VD=function(a,b,c='from observable'){const d=olympe.D.ec(b,c),e=a.subscribe(f=>d.update(f));d.getContext().onDestroy(()=>e.unsubscribe());return d.sb()};
369
+ olympe.D.SD=function(a,b,...c){return a?a.run(b,...c):b(...c)};olympe.D.tE=function(a){return olympe.D.Wa().G(a)};olympe.D.PD=function(a,b,c){olympe.D.Lw(a?a.Da:a,b,c)};
370
370
  olympe.D.Lw=function(a,b,c){if(a){var d=a.U();null===dc&&(dc={});if(dc[d])olympe.D.H.log(`Already started node #${d} dump`+(b?`: ${b}`:''));else{dc[d]=!0;var e=`Starting node #${d} dump`+(b?`: ${b}`:'');c?olympe.D.H.warn(e):olympe.D.H.log(e);var f=`#${d}`+(b?`: ${b}`:'')+':';c=olympe.D.createNode(null,g=>{void 0===g?olympe.D.H.log(f,'undefined'):null===g?olympe.D.H.log(f,'null'):olympe.D.H.log(f,String(g))},null,[a],[0],'DataFlowDump');a.onDestroy(()=>{olympe.D.H.log(`Node #${d} destroyed`+(b?`: ${b}`:
371
- ''))});c.onDestroy(()=>{delete dc[d]})}}else olympe.D.H.log('NOT starting node dump, node is '+String(a))};olympe.D.OD=function(){let a='',b=olympe.D.$a();for(;null!==b;)a+=b.Uc()+' --\x3e ',b=b.getParent();olympe.D.H.log(a)};
371
+ ''))});c.onDestroy(()=>{delete dc[d]})}}else olympe.D.H.log('NOT starting node dump, node is '+String(a))};olympe.D.OD=function(){let a='',b=olympe.D.Wa();for(;null!==b;)a+=b.Uc()+' --\x3e ',b=b.getParent();olympe.D.H.log(a)};
372
372
  olympe.D.ra=function(a){if(void 0===a)return olympe.D.ba.ZERO;if(a instanceof olympe.D.ba)return a;a&&a.valueOf&&(a=a.valueOf());if('number'===typeof a){if(isNaN(a))return olympe.D.ba.Jp;if(a===Math.PI)return olympe.D.ba.PI;if(Infinity===a)return olympe.D.ba.Ht;if(-Infinity===a)return olympe.D.ba.Du;if(isNaN(a))var b=!1;else b=parseFloat(a),b=(b|0)===b;return b&&-1<=a&&100>=a?(olympe.D.Mh.has(a)||olympe.D.Mh.set(a,new olympe.D.ba(a)),olympe.D.Mh.get(a)):new olympe.D.ba(a)}return null};
373
- olympe.D.$d=function(a){return void 0===a?olympe.D.Nd(olympe.D.ba):olympe.D.Nd(olympe.D.ba,olympe.D.bf(a)?a:olympe.D.ra(a))};olympe.D.By=olympe.D.ba.animate;olympe.D.eE=function(a,b){return new olympe.D.Ds(a,b)};olympe.D.Ab=function(a){if(a instanceof olympe.D.Pa)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.sk.has(a)?olympe.D.sk.get(a):new olympe.D.Pa(a)};
374
- olympe.D.jE=function(a){return void 0===a?olympe.D.Nd(olympe.D.Pa):olympe.D.Nd(olympe.D.Pa,olympe.D.bf(a)?a:olympe.D.Ab(a))};olympe.D.Sb=function(a){return a instanceof olympe.D.fa?a:void 0!==a&&null!==a&&a.valueOf()?olympe.D.fa.F:olympe.D.fa.C};olympe.D.gE=function(a){return void 0===a?olympe.D.Nd(olympe.D.fa):olympe.D.Nd(olympe.D.fa,olympe.D.bf(a)?a:olympe.D.Sb(a))};olympe.D.fE=function(a){if(a instanceof Date)return new olympe.D.fb(a)};
375
- olympe.D.iE=function(a){return olympe.D.Nd(olympe.D.fb,void 0!==a?new olympe.D.fb(a):null)};olympe.D.Yr=a=>a instanceof olympe.D.fa||a instanceof olympe.D.ba||a instanceof olympe.D.Pa||a instanceof olympe.D.fb;olympe.D.kE=function(a,b){return olympe.D.Nd(olympe.D.$b,void 0===a&&void 0===b?void 0:new olympe.D.$b(a,b))};olympe.D.My=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.Nd(olympe.D.Color,e)};olympe.D.hE=olympe.D.My;
376
- olympe.D.Cw=function(a){olympe.D.H=a;olympe.D.Sh=olympe.D.Sg()};olympe.D.Sg=function(){olympe.D.jn||(olympe.D.jn=new olympe.D.Hq);return olympe.D.jn};olympe.D.$a=function(){olympe.D.Sh||(olympe.D.Sh=olympe.D.Sg());return olympe.D.Sh};olympe.D.ps=function(a){const b=olympe.D.Sh;olympe.D.cn(a)&&(olympe.D.Sh=a);return null!=b?b:null};
377
- olympe.D.Pb=a=>{a='string'===typeof a?JSON.parse(a):a;if(a.type){let b=null;switch(a.type){case 'dateTime':b=olympe.D.fb.Pb(a);break;case 'number':b=olympe.D.ba.Pb(a);break;case 'string':b=olympe.D.Pa.Pb(a);break;case 'vector2':b=olympe.D.$b.Pb(a);break;case 'color':b=olympe.D.Color.Pb(a);break;case 'boolean':b=olympe.D.fa.Pb(a)}return b}return null};function fc(a){a.C.eb()||(a.G.forEach(b=>{b.destroy()}),a.G.clear(),a.F.clear(),a.size.clear(),a.O.clear(),a.T.length=0,a.J.length=0)}
373
+ olympe.D.$d=function(a){return void 0===a?olympe.D.Nd(olympe.D.ba):olympe.D.Nd(olympe.D.ba,olympe.D.bf(a)?a:olympe.D.ra(a))};olympe.D.By=olympe.D.ba.animate;olympe.D.eE=function(a,b){return new olympe.D.Ds(a,b)};olympe.D.Ab=function(a){if(a instanceof olympe.D.Qa)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.sk.has(a)?olympe.D.sk.get(a):new olympe.D.Qa(a)};
374
+ olympe.D.jE=function(a){return void 0===a?olympe.D.Nd(olympe.D.Qa):olympe.D.Nd(olympe.D.Qa,olympe.D.bf(a)?a:olympe.D.Ab(a))};olympe.D.Sb=function(a){return a instanceof olympe.D.fa?a:void 0!==a&&null!==a&&a.valueOf()?olympe.D.fa.F:olympe.D.fa.C};olympe.D.gE=function(a){return void 0===a?olympe.D.Nd(olympe.D.fa):olympe.D.Nd(olympe.D.fa,olympe.D.bf(a)?a:olympe.D.Sb(a))};olympe.D.fE=function(a){if(a instanceof Date)return new olympe.D.gb(a)};
375
+ olympe.D.iE=function(a){return olympe.D.Nd(olympe.D.gb,void 0!==a?new olympe.D.gb(a):null)};olympe.D.Yr=a=>a instanceof olympe.D.fa||a instanceof olympe.D.ba||a instanceof olympe.D.Qa||a instanceof olympe.D.gb;olympe.D.kE=function(a,b){return olympe.D.Nd(olympe.D.$b,void 0===a&&void 0===b?void 0:new olympe.D.$b(a,b))};olympe.D.My=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.Nd(olympe.D.Color,e)};olympe.D.hE=olympe.D.My;
376
+ olympe.D.Cw=function(a){olympe.D.H=a;olympe.D.Sh=olympe.D.Sg()};olympe.D.Sg=function(){olympe.D.jn||(olympe.D.jn=new olympe.D.Hq);return olympe.D.jn};olympe.D.Wa=function(){olympe.D.Sh||(olympe.D.Sh=olympe.D.Sg());return olympe.D.Sh};olympe.D.ps=function(a){const b=olympe.D.Sh;olympe.D.cn(a)&&(olympe.D.Sh=a);return null!=b?b:null};
377
+ olympe.D.Pb=a=>{a='string'===typeof a?JSON.parse(a):a;if(a.type){let b=null;switch(a.type){case 'dateTime':b=olympe.D.gb.Pb(a);break;case 'number':b=olympe.D.ba.Pb(a);break;case 'string':b=olympe.D.Qa.Pb(a);break;case 'vector2':b=olympe.D.$b.Pb(a);break;case 'color':b=olympe.D.Color.Pb(a);break;case 'boolean':b=olympe.D.fa.Pb(a)}return b}return null};function fc(a){a.C.fb()||(a.G.forEach(b=>{b.destroy()}),a.G.clear(),a.F.clear(),a.size.clear(),a.O.clear(),a.T.length=0,a.J.length=0)}
378
378
  olympe.D.gC=class{constructor(){this.C=new olympe.D.Xb('Slot Manager context');this.G=new Map;this.C.run(()=>{this.F=olympe.D.ec(gc,'Last slot manager entry');this.size=Xb(olympe.D.ec(olympe.D.ba,'SlotManager size').repeat(this.F.sb().Tm()),olympe.D.ba.ZERO);this.O=Xb(olympe.D.ec(olympe.D.ba,'last valid slots'),olympe.D.ra(-1))});this.T=[];this.J=[];this.C.onDestroy(()=>{fc(this)})}};
379
379
  class gc{constructor(a,b,c,d){this.id=a;this.F=new olympe.D.Xb('Slot manager entry');this.J=c;this.O=d;this.F.run(()=>{const e=Xb(olympe.D.ec(olympe.D.ba),olympe.D.ba.ZERO);olympe.D.jb(b)?e.repeat(b):e.update(b);this.C=olympe.D.ec(olympe.D.ba);this.G=this.C.sb().ae(e.sb())});this.next=null}U(){return this.id}Ux(){return this.C.sb()}Tm(){return this.G}xd(){return this.J}gy(){return this.O}mz(a){this.J=a}$y(a){null===a?this.C.update(olympe.D.ba.ZERO):(this.C.repeat(a.Tm()),a.next=this)}Vt(){this.C.clear();
380
- this.next=null}destroy(){this.F.destroy();this.G=this.C=this.next=null}}m=gc.prototype;m.U.L=olympe.D.K.C;m.Ux.L=new olympe.D.K(()=>olympe.D.ba);m.Tm.L=new olympe.D.K(()=>olympe.D.ba);m.xd.L=olympe.D.K.C;m.gy.L=olympe.D.K.C;m.mz.L=olympe.D.K.C;m.$y.L=olympe.D.K.C;m.Vt.L=olympe.D.K.C;m.destroy.L=olympe.D.K.C;olympe.D.R={Ca:'df.Logger'};olympe.W.config(a=>{F(a,olympe.D.V.Kp,Number.POSITIVE_INFINITY);E(a,olympe.D.R.Ca,[olympe.ka.R.Ea],b=>b.Vc('df'))},'olympe.df');olympe.W.run([olympe.D.R.Ca],a=>{olympe.D.Cw(a)},'olympe.df');olympe.host={};const hc=new Map,ic=new Map;olympe.host.Op=class{static register(a,b,...c){hc.set(a,b);0<c.length&&ic.set(a,c)}static create(a,b,c,d){const e=hc.get(a);if(void 0===e)throw Error('Undefined UI element type: '+a);a=ic.get(a);return void 0!==a?new e(b,c,...a.map(f=>Ja(d,f))):new e(b,c)}};function jc(a,b,c){a.H.debug('CREATE #',b,', type=',c);a.C.set(b,olympe.host.Op.create(c,b,a.H,a.J))}function kc(a,b,c,...d){const e=a.C.get(b);if(void 0!==e){a.H.O()<=olympe.ka.Eb.C.Rf&&a.H.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.jb(f))b.push(a.C.get(f.bw)||null);else if('function'===typeof f){const g=f,h=olympe.D.$a();b.push((...k)=>{h.eb()||g(...k)})}else b.push(f.valueOf());e[c].apply(e,b)}}
380
+ this.next=null}destroy(){this.F.destroy();this.G=this.C=this.next=null}}m=gc.prototype;m.U.L=olympe.D.K.C;m.Ux.L=new olympe.D.K(()=>olympe.D.ba);m.Tm.L=new olympe.D.K(()=>olympe.D.ba);m.xd.L=olympe.D.K.C;m.gy.L=olympe.D.K.C;m.mz.L=olympe.D.K.C;m.$y.L=olympe.D.K.C;m.Vt.L=olympe.D.K.C;m.destroy.L=olympe.D.K.C;olympe.D.R={Ca:'df.Logger'};olympe.W.config(a=>{F(a,olympe.D.V.Kp,Number.POSITIVE_INFINITY);E(a,olympe.D.R.Ca,[olympe.ka.R.Ea],b=>b.Vc('df'))},'olympe.df');olympe.W.run([olympe.D.R.Ca],a=>{olympe.D.Cw(a)},'olympe.df');olympe.host={};const hc=new Map,ic=new Map;olympe.host.Op=class{static register(a,b,...c){hc.set(a,b);0<c.length&&ic.set(a,c)}static create(a,b,c,d){const e=hc.get(a);if(void 0===e)throw Error('Undefined UI element type: '+a);a=ic.get(a);return void 0!==a?new e(b,c,...a.map(f=>Ja(d,f))):new e(b,c)}};function jc(a,b,c){a.H.debug('CREATE #',b,', type=',c);a.C.set(b,olympe.host.Op.create(c,b,a.H,a.J))}function kc(a,b,c,...d){const e=a.C.get(b);if(void 0!==e){a.H.O()<=olympe.ka.Eb.C.Rf&&a.H.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.jb(f))b.push(a.C.get(f.bw)||null);else if('function'===typeof f){const g=f,h=olympe.D.Wa();b.push((...k)=>{h.fb()||g(...k)})}else b.push(f.valueOf());e[c].apply(e,b)}}
381
381
  function lc(a){var b=olympe.host.Ee.ud,c=olympe.host.Ee.Np.gr;++a.G;const d=a.G;jc(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.jb(p)?(h.push(n),p=p.Da):olympe.D.Jf(p)&&h.push(n);g[n]=p}0===h.length?e.run(()=>{kc(this,d,k,...g)}):(f=olympe.D.createNode(void 0,(...n)=>{e.run(()=>
382
- {kc(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.Z(a.O.bind(a,d));a=L(e);a.bw=d;K(e,a);return a}olympe.host.Ta=class{constructor(a,b){this.H=a;this.J=b;this.G=0;this.C=new Map;this.F=new Map;a.debug('Starting host manager')}ib(){return this.H}O(a){this.H.debug('DESTROY #',a);const b=this.C.get(a);this.C.delete(a);b.destroy()}};olympe.host.Jd=class{constructor(a){this.C=a;this.F=olympe.D.$a()}G(){return this.C}od(){return this.C.Da.od()||this.F.od()}eb(){return this.C.Da.eb()}};olympe.host.Jd.prototype.G.L=new olympe.D.K(()=>olympe.host.Ee.Jd,[]);olympe.host.mk=class{C(){}F(){}};olympe.host.Bt=class{F(){}C(){return v(function*(){})}jj(){}};function mc(a,b){var c=olympe.host.Of;const d=olympe.Y.Mc(),e=new olympe.D.Xb('onTimeout context');c.C.Z(b,d,()=>{e.eb()||e.od()||e.run(a);c.C.G(d)});return new olympe.host.ud.F(c.C,d,e)}function nc(a,b){var c=olympe.host.Of;const d=olympe.Y.Mc(),e=new olympe.D.Xb('onInterval context');c.C.T(b,d,()=>{e.eb()||e.od()?c.C.F(d):e.run(a)})}olympe.host.ud=class{constructor(a){this.C=lc(a)}};olympe.host.ud.C=class{constructor(a,b,c){this.Of=a;this.id=b;this.C=null!=c?c:null}U(){return this.id}cancel(){}};
382
+ {kc(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.Z(a.O.bind(a,d));a=L(e);a.bw=d;K(e,a);return a}olympe.host.Ta=class{constructor(a,b){this.H=a;this.J=b;this.G=0;this.C=new Map;this.F=new Map;a.debug('Starting host manager')}ab(){return this.H}O(a){this.H.debug('DESTROY #',a);const b=this.C.get(a);this.C.delete(a);b.destroy()}};olympe.host.Jd=class{constructor(a){this.C=a;this.F=olympe.D.Wa()}G(){return this.C}od(){return this.C.Da.od()||this.F.od()}fb(){return this.C.Da.fb()}};olympe.host.Jd.prototype.G.L=new olympe.D.K(()=>olympe.host.Ee.Jd,[]);olympe.host.mk=class{C(){}F(){}};olympe.host.Bt=class{F(){}C(){return v(function*(){})}jj(){}};function mc(a,b){var c=olympe.host.Of;const d=olympe.Y.Mc(),e=new olympe.D.Xb('onTimeout context');c.C.Z(b,d,()=>{e.fb()||e.od()||e.run(a);c.C.G(d)});return new olympe.host.ud.F(c.C,d,e)}function nc(a,b){var c=olympe.host.Of;const d=olympe.Y.Mc(),e=new olympe.D.Xb('onInterval context');c.C.T(b,d,()=>{e.fb()||e.od()?c.C.F(d):e.run(a)})}olympe.host.ud=class{constructor(a){this.C=lc(a)}};olympe.host.ud.C=class{constructor(a,b,c){this.Of=a;this.id=b;this.C=null!=c?c:null}U(){return this.id}cancel(){}};
383
383
  olympe.host.ud.J=class extends olympe.host.ud.C{cancel(){this.Of.O(this.id);let a;null==(a=this.C)||a.destroy();this.C=null}};olympe.host.ud.F=class extends olympe.host.ud.C{cancel(){this.Of.G(this.id);let a;null==(a=this.C)||a.destroy();this.C=null}};olympe.host.ud.G=class extends olympe.host.ud.C{cancel(){this.Of.F(this.id);let a;null==(a=this.C)||a.destroy();this.C=null}};olympe.host.ze=class{F(a,b){return null!=b?b:''}ja(a,b){return null!=b?b:''}O(){}C(a,b){return null!=b?b:''}G(){}};olympe.host.ze.C={LIVENESS:'liveness',READINESS:'readiness',ALL:'all'};olympe.host.Ee={};olympe.host.Ee.Jd=class{destroy(){}};olympe.host.Ee.Jd.prototype.destroy=olympe.host.Ee.Jd.prototype.destroy;olympe.host.Ee.Np={uz:100,wz:101,vz:102,yz:103,xz:104,sz:105,YB:201,WB:202,TB:204,aC:205,SB:206,VB:207,ZB:208,bC:209,cC:210,dC:211,UB:212,$B:218,XB:219,eC:220,RB:221,QB:222,lC:300,mC:301,nC:302,rC:303,sC:304,tC:305,oC:310,pC:311,qC:312,sB:400,tB:401,uB:402,iB:450,bB:500,$A:501,eB:502,dB:503,aB:504,cB:505,MC:600,DC:601,HC:602,zC:603,AC:604,xC:605,CC:606,SC:607,KC:608,uC:609,yC:610,BC:611,JC:612,OC:613,vC:614,NC:615,IC:616,RC:617,EC:618,FC:619,GC:620,LC:630,wC:631,PC:632,QC:633,wD:700,$C:701,aD:702,
384
384
  bD:703,dD:704,eD:705,fD:706,cD:707,hD:708,gD:709,iD:710,mD:711,uD:712,jD:713,kD:714,nD:715,oD:716,qD:717,rD:718,tD:719,pD:720,sD:721,vD:722,lD:723,xD:724,yD:725,gr:800};olympe.host.Ee.ud=class{O(){}Z(){}G(){}T(){}F(){}};olympe.host.R={ik:'host.System',wl:'host.HistoryManager',Jq:'host.Scheduler',Ca:'host.platform.Logger',Ea:'host.Manager',Pe:'host.ProcessManager'};olympe.host.V={ck:'role',ep:'host.currentHost',hq:'host.processProbe',Pq:'host.gracefulShutdownTimeout'};olympe.host.Gg={ws:'active',Bh:'preview'};olympe.host.Of=null;
385
385
  olympe.W.config(function(a){var b,c;const d='object'===typeof window&&(null==(b=window)?void 0:null==(c=b.location)?void 0:c.hostname)||'127.0.0.1';Ma(a,olympe.host.V.ep,d);b=olympe.host.Gg.ws;c=olympe.host.Gg.Bh;F(a,olympe.host.V.ck,d.startsWith(`${c}.`)?c:b);Pa(a,olympe.host.R.ik);Pa(a,olympe.host.R.wl);C(a,olympe.host.R.Pe,olympe.host.ze);E(a,olympe.host.R.Ca,[olympe.ka.R.Ea],e=>e.Vc('host'));C(a,olympe.host.R.Ea,olympe.host.Ta,olympe.host.R.Ca,olympe.W.R.og);E(a,olympe.host.R.Jq,[olympe.host.R.Ea],
@@ -387,16 +387,16 @@ e=>{null===olympe.host.Of&&(olympe.host.Of=new olympe.host.ud(e));return olympe.
387
387
  olympe.net.Aa.Yb={Qs:0,xh:200,Zn:201,tj:202,Xk:400,Rv:401,No:403,Ql:404,fB:405,Li:500,rv:503};function oc(a){return a.host&&encodeURI(a.host)}function pc(a){return encodeURI(a.path).replace(olympe.net.Vi.C,(b,c)=>'%'+c)}function qc(a){return void 0===a.G?443===a.port:a.G}olympe.net.Vi=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`${qc(this)?'wss':'ws'}://${oc(this)}:${this.port}/${pc(this)}`}toString(){return`${oc(this)}:${this.port}/${pc(this)}`}};
388
388
  olympe.net.Vi.C=/%25([0-9a-f]{2})/i;olympe.net.WebSocket=class{send(){}close(){}ea(){}aa(){}Z(){}F(){}};function N(a,b,c,d){a=olympe.Y.Ny(a.valueOf());if(!a.host&&!a.path)return null;const e=a.scheme?a.scheme.includes('s'):!1;b=new olympe.net.wi(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=Ua(olympe.Y.Xe(),`${c[0]}:${c[1]}`),rc(b,{Authorization:`Basic ${c}`})));return b}function sc(a){return void 0!==a.query?a.query.replace(/[^=&]+/g,b=>encodeURIComponent(b)):null}function rc(a,b){Object.assign(a.headers,b)}
389
389
  olympe.net.wi=class extends olympe.net.Vi{constructor(a,b,c,d,e,f,g,h){super(a,b,c,d);this.method=void 0!==e?e:olympe.net.Aa.Id.GET;this.query=h;this.headers={};this.body=f;this.F=void 0!==g?g:olympe.net.Aa.ResponseType.qm;this.ca=this.cert=this.key=null;this.rejectUnauthorized=!1}fj(){return this.headers}C(){let a=sc(this);a=a?`?${a}`:'';if(!oc(this))return`${pc(this)}${a}`;const b=Number.isInteger(this.port)?`:${this.port}`:'';return`${qc(this)?'https':'http'}://${oc(this)}${b}/${pc(this)}${a}`}toString(){return this.C()}};
390
- olympe.net.wi.Id={Ah:'POST',GET:'GET',yt:'HEAD',iq:'PUT',Dc:'DELETE',Xp:'OPTIONS'};olympe.net.be=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}Gc(){return this.status}fj(){return this.headers}};function tc(a,b,c){const d=olympe.D.$a(),e=d.onDestroy(()=>{var f=a.F();const g=f.C.get(b);g&&(f.C.delete(b),g())});return d.G(f=>{d.Mf(e);a.F().C.delete(b);c(f)})}olympe.net.Ta=class{constructor(a){this.H=a;this.J=1;a='Initializing NET layer';this.H.C()&&(a+=' (implementation: '+this.T()+')');this.H.info(a);this.H.log('DONE initializing NET layer (ready to receive connection requests)')}F(){}G(){}C(){}O(){}Kf(){}T(){}};function uc(a){let b;return!(null==(b=a.C)||!b.connected)&&a.J}function vc(a){if(!a.F)throw Error('Cannot build connection options because the configuration is not available yet');const b=()=>({username:`${a.F.vhost}:${a.F.username}`,password:a.F.password});return Object.assign({},a.F,b(),{transformWsUrl:(c,d)=>{null!==a.F&&Object.assign(d,b());return c}})}
390
+ olympe.net.wi.Id={Ah:'POST',GET:'GET',yt:'HEAD',iq:'PUT',Dc:'DELETE',Xp:'OPTIONS'};olympe.net.be=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}Gc(){return this.status}fj(){return this.headers}};function tc(a,b,c){const d=olympe.D.Wa(),e=d.onDestroy(()=>{var f=a.F();const g=f.C.get(b);g&&(f.C.delete(b),g())});return d.G(f=>{d.Mf(e);a.F().C.delete(b);c(f)})}olympe.net.Ta=class{constructor(a){this.H=a;this.J=1;a='Initializing NET layer';this.H.C()&&(a+=' (implementation: '+this.T()+')');this.H.info(a);this.H.log('DONE initializing NET layer (ready to receive connection requests)')}F(){}G(){}C(){}O(){}Kf(){}T(){}};function uc(a){let b;return!(null==(b=a.C)||!b.connected)&&a.J}function vc(a){if(!a.F)throw Error('Cannot build connection options because the configuration is not available yet');const b=()=>({username:`${a.F.vhost}:${a.F.username}`,password:a.F.password});return Object.assign({},a.F,b(),{transformWsUrl:(c,d)=>{null!==a.F&&Object.assign(d,b());return c}})}
391
391
  function wc(a,b){if(!uc(a))return Promise.reject(Error('Cannot unsubscribe because the MQTT client is disconnected'));a.H.C()&&a.H.debug(`MQTT unsubscribe topic ${b}`);return new Promise((c,d)=>{a.C.unsubscribe(b,void 0,e=>{a.G.delete(b);e?d(e):c()})})}function xc(a,b){a.T.push(b)}function yc(a,b){a.O.push(b)}function zc(a,b){a.Z.push(b)}
392
- olympe.net.pf=class{constructor(a){this.H=olympe.ka.ib('MQTT');this.J=!1;this.C=this.F=null;this.O=[];this.Z=[];this.ea=[];this.aa=[];this.T=[];this.G=new Map;const b=olympe.Y.Promise.$i(()=>this.connect(),0);a.subscribe(c=>{this.H.C()&&this.H.debug('New MQTT configuration received',JSON.stringify(c));this.F=c;null!==c&&this.J&&(uc(this)?this.end(!1,()=>b().then()):b().then())})}connect(a){if(uc(this))return null==a||a(),this;a&&this.O.push(a);this.J=!0;null===this.C&&null!==this.F&&(this.C=mqtt.connect(this.F.url,
392
+ olympe.net.pf=class{constructor(a){this.H=olympe.ka.ab('MQTT');this.J=!1;this.C=this.F=null;this.O=[];this.Z=[];this.ea=[];this.aa=[];this.T=[];this.G=new Map;const b=olympe.Y.Promise.$i(()=>this.connect(),0);a.subscribe(c=>{this.H.C()&&this.H.debug('New MQTT configuration received',JSON.stringify(c));this.F=c;null!==c&&this.J&&(uc(this)?this.end(!1,()=>b().then()):b().then())})}connect(a){if(uc(this))return null==a||a(),this;a&&this.O.push(a);this.J=!0;null===this.C&&null!==this.F&&(this.C=mqtt.connect(this.F.url,
393
393
  vc(this)),this.C.on(olympe.net.pf.C.Cu,(b,c)=>{this.H.C()&&this.H.debug(`MQTT < ${c}`);this.G.has(b)?this.G.get(b)(JSON.parse(c.toString())):this.H.warn('There is no subscriber for topic '+b)}),this.C.on(olympe.net.pf.C.Ws,()=>{this.H.info('Mqtt client is connected to bus');this.O.forEach(b=>b())}),this.C.on(olympe.net.pf.C.fv,()=>{this.H.info('Mqtt client is reconnecting to bus ... ');null===this.F&&this.end(!1);this.Z.forEach(b=>b())}),this.C.on(olympe.net.pf.C.xb,b=>{this.H.error('Mqtt client error ',
394
394
  b);this.aa.forEach(c=>c(b))}),this.C.on(olympe.net.pf.C.ee,()=>{this.H.info('Mqtt client is offline');this.ea.forEach(b=>b())}),this.C.on(olympe.net.pf.C.Vs,()=>{this.H.info('Mqtt client is closed');this.T.forEach(b=>b())}),this.C.on(olympe.net.pf.C.Vf,()=>{this.H.info('Mqtt client has ended')}));return this}publish(a,b,c){if(!uc(this))return Promise.reject(Error('Cannot publish message because the MQTT client is disconnected'));const d=JSON.stringify(b);this.H.C()&&this.H.debug(`MQTT > ${d}`);return new Promise((e,
395
395
  f)=>{this.C.publish(a,d,c,g=>{g?f(Error('Failed to publish a message '+d)):e()})})}subscribe(a,b){if(!uc(this))return Promise.reject(Error('Cannot subscribe because the MQTT client is disconnected'));this.H.debug(`MQTT subscribe to topic ${a}`);return new Promise((c,d)=>{this.C.subscribe(a,void 0,e=>{e?d(Error(`Failed to subscribe to topic ${a}: ${e}`)):(this.G.set(a,b),c())})})}end(a,b){this.J=!1;this.G.clear();this.C?this.C.end(a,{},()=>{this.C=null;null==b||b()}):null==b||b();return this}};
396
396
  olympe.net.pf.C={Ws:'connect',fv:'reconnect',Cu:'message',Vs:'close',Vf:'end',xb:'error',ee:'offline'};olympe.net.Kh=class{constructor(a){this.H=a}start(){return Promise.reject('Try to start web server with the browser implementation.')}J(){return Promise.reject('Try to restart web server with the browser implementation.')}stop(){return Promise.reject('Try to stop web server with the browser implementation.')}G(){return Promise.reject('Try to open a route on a web server using the browser implementation.')}Z(){return Promise.reject('Try to close a route on a web server using the browser implementation.')}};
397
397
  olympe.net.Kh.ALL='*';olympe.net.Dv=class{register(){return v(function*(){throw Error('Service Worker Manager must be overridden by a native layer: called "register"');})}};olympe.net.R={Ea:'net.Manager',Ca:'net.Logger',Ui:'net.WebServer',wv:'net.ServiceWorkerManager',Tl:'net.OfflineConfig'};olympe.net.V={lf:'net.httpPort',hp:'net.httpBodyLimit',fr:'net.http2',gp:'net.httpsCertificatesPath',Ll:'net.localNetworkSuffix',Ii:'offline.enabled',Sl:'offline.autoBackOnline',Wp:'offline.downloadBatchSize'};
398
398
  olympe.W.config(function(a){F(a,olympe.net.V.lf,3141);F(a,olympe.net.V.hp,100);F(a,olympe.net.V.fr,!1);F(a,olympe.net.V.gp,null);F(a,olympe.net.V.Ll,'frontend');F(a,olympe.net.V.Ii,!1);F(a,olympe.net.V.Sl,!1);F(a,olympe.net.V.Wp,20);Pa(a,olympe.net.R.Ea);E(a,olympe.net.R.Ca,[olympe.ka.R.Ea],b=>b.Vc('net'));C(a,olympe.net.R.Ui,olympe.net.Kh,olympe.net.R.Ca);C(a,olympe.net.R.wv,olympe.net.Dv);E(a,olympe.net.R.Tl,[new olympe.W.oa(olympe.net.V.Ii),new olympe.W.oa(olympe.net.V.Sl)],(b,c)=>new Map([['offlineEnabled',
399
- b],['offlineAutoBackOnline',!b||c]]))},'olympe.net');olympe.Ua.node.host={};olympe.Ua.node.host.Jd=function(a,b){this.H=b};olympe.Ua.node.host.Jd.prototype.constructor=olympe.Ua.node.host.Jd;olympe.Ua.node.host.Jd.prototype.destroy=function(){};olympe.Ua.node.host.Jd.prototype.destroy=olympe.Ua.node.host.Jd.prototype.destroy;olympe.Ua.node.host.Jd.prototype.ib=function(){return this.H};olympe.Ua.node.host.Jd.ya=[olympe.host.Ee.Jd];function Ac(a){a.H.error('No history manager implemented in Node')}olympe.Ua.node.host.Pp=class{constructor(a){this.H=a}jj(){return!1}F(){Ac(this);return null}C(){const a=this;return v(function*(){Ac(a)})}};olympe.Ua.node.host.Pp.ya=[olympe.host.Bt];olympe.Ua.node.host.ud=class{constructor(){this.C={};this.J={}}destroy(){}O(a){clearTimeout(this.C[a]);delete this.C[a]}Z(a,b,c){this.C[b]=setTimeout(c,a)}G(a){clearTimeout(this.C[a]);delete this.C[a]}T(a,b,c){this.J[b]=setInterval(c,a)}F(a){clearInterval(this.J[a]);delete this.J[a]}};olympe.host.Op.register(olympe.host.Ee.Np.gr,olympe.Ua.node.host.ud);olympe.Ua.node.host.ud.ya=[olympe.host.Ee.ud];olympe.Ua.node.host.mk=class{constructor(a){this.H=a}C(){return olympe.D.fa.F}F(){return!0}};olympe.Ua.node.host.mk.ya=[olympe.host.mk];function Bc(a){a.ea.G('readinessProbe','/readiness',[olympe.net.Aa.Id.GET],()=>Cc(a,a.aa)).catch(b=>a.H.error(`Failed to add readiness health check route ${b}`));a.ea.G('livenessProbe','/liveness',[olympe.net.Aa.Id.GET],()=>Cc(a,a.Z)).catch(b=>a.H.error(`Failed to add liveness health check route ${b}`));a.F(()=>a.ea.stop())}
399
+ b],['offlineAutoBackOnline',!b||c]]))},'olympe.net');olympe.Ua.node.host={};olympe.Ua.node.host.Jd=function(a,b){this.H=b};olympe.Ua.node.host.Jd.prototype.constructor=olympe.Ua.node.host.Jd;olympe.Ua.node.host.Jd.prototype.destroy=function(){};olympe.Ua.node.host.Jd.prototype.destroy=olympe.Ua.node.host.Jd.prototype.destroy;olympe.Ua.node.host.Jd.prototype.ab=function(){return this.H};olympe.Ua.node.host.Jd.ya=[olympe.host.Ee.Jd];function Ac(a){a.H.error('No history manager implemented in Node')}olympe.Ua.node.host.Pp=class{constructor(a){this.H=a}jj(){return!1}F(){Ac(this);return null}C(){const a=this;return v(function*(){Ac(a)})}};olympe.Ua.node.host.Pp.ya=[olympe.host.Bt];olympe.Ua.node.host.ud=class{constructor(){this.C={};this.J={}}destroy(){}O(a){clearTimeout(this.C[a]);delete this.C[a]}Z(a,b,c){this.C[b]=setTimeout(c,a)}G(a){clearTimeout(this.C[a]);delete this.C[a]}T(a,b,c){this.J[b]=setInterval(c,a)}F(a){clearInterval(this.J[a]);delete this.J[a]}};olympe.host.Op.register(olympe.host.Ee.Np.gr,olympe.Ua.node.host.ud);olympe.Ua.node.host.ud.ya=[olympe.host.Ee.ud];olympe.Ua.node.host.mk=class{constructor(a){this.H=a}C(){return olympe.D.fa.F}F(){return!0}};olympe.Ua.node.host.mk.ya=[olympe.host.mk];function Bc(a){a.ea.G('readinessProbe','/readiness',[olympe.net.Aa.Id.GET],()=>Cc(a,a.aa)).catch(b=>a.H.error(`Failed to add readiness health check route ${b}`));a.ea.G('livenessProbe','/liveness',[olympe.net.Aa.Id.GET],()=>Cc(a,a.Z)).catch(b=>a.H.error(`Failed to add liveness health check route ${b}`));a.F(()=>a.ea.stop())}
400
400
  function Dc(a,b){b=Array.from(b.entries()).map(([c,d])=>olympe.Y.Promise.vn(d(),a.ua,`Shutdown hook ${c} has timeout`));return Promise.allSettled(b).then(c=>{let d=!1;for(const e of c)'rejected'===e.status&&(d=!0,a.H.warn(`Failed to close some resource: ${e.reason}`));return d})}function Ec(a){return v(function*(){try{const b=yield Dc(a,a.J),c=yield Dc(a,a.T);if(b||c)throw Error('Failed to gracefully close the backend');}finally{a.J.clear(),a.T.clear()}})}
401
401
  function Cc(a,b){const c=olympe.net.Aa.Yb.xh,d=olympe.net.Aa.Yb.Li;b=Array.from(b.values()).map(e=>e.apply(a));return 0===b.length?Promise.resolve(new olympe.net.be('No healthCheck is set',c,'Nothing to check')):Promise.allSettled(b).then(e=>{let f=!1,g='Health check result: ';for(const h of e)'rejected'===h.status?(f=!0,e=h.reason,g+=`\n${e}`,a.H.warn(`Health check detected a service which is DOWN: ${e}`)):g+=`\n${h.value}`;return new olympe.net.be(g,f?d:c,f?'Some services are not working':'Everything is OK')})}
402
402
  olympe.Ua.node.host.ze=class extends olympe.host.ze{constructor(a,b,c,d=!0){super();this.H=a;this.ea=b;this.ua=c;this.Z=new Map;this.aa=new Map;this.J=new Map;this.T=new Map;d&&Bc(this)}C(a,b=olympe.Y.Cf(),c=olympe.host.ze.C.ALL){switch(c){case olympe.host.ze.C.LIVENESS:this.Z.set(b,a);break;case olympe.host.ze.C.READINESS:this.aa.set(b,a);break;default:this.Z.set(b,a),this.aa.set(b,a)}return b}G(a){this.aa.delete(a);this.Z.delete(a)}F(a,b=olympe.Y.Cf()){this.J.set(b,a);return b}ja(a,b=olympe.Y.Cf()){this.T.set(b,
@@ -417,78 +417,78 @@ yield c.F.close();c.F=c.createServer();yield c.start()})})})}stop(){return this.
417
417
  d)=>{d(null,c)});return a}$i(a,b=1E3){this.timer&&clearTimeout(this.timer);this.timer=setTimeout(a,b)}};olympe.W.config(function(a){C(a,olympe.net.R.Ui,olympe.Ua.node.net.http.Kh,olympe.net.R.Ca,new olympe.W.oa(olympe.net.V.lf),new olympe.W.oa(olympe.net.V.hp),new olympe.W.oa(olympe.net.V.fr),new olympe.W.oa(olympe.net.V.gp))},'olympe.native.node.net.http');olympe.Ua.node.Y={};const Rc=require('stream').Readable,Sc=require('buffer');
418
418
  olympe.Ua.node.Y.$k=class extends olympe.Y.$k{F(a){return new Uint8Array(Buffer.from(a,'base64'))}C(a){return a instanceof Uint8Array?Buffer.from(a,a.byteOffset,a.byteLength).toString('base64'):Buffer.from(a).toString('base64')}J(a){const b=this,c=()=>super.J;return v(function*(){if(a instanceof Rc){const d=[];for(const e=ha(a);;){const f=yield e.next();if(f.done)break;d.push(f.value)}return Buffer.concat(d)}return c().call(b,a)})}G(a){return Promise.resolve().then(()=>Sc.resolveObjectURL(a)).catch(b=>
419
419
  {throw Error(`Error while trying to fetch buffer from ObjectURL: ${b}`);})}};olympe.W.config(function(a){Na(a,olympe.Y.R.mg,olympe.Ua.node.Y.$k)},'olympe.native.node.utils');olympe.async={};function Tc(a,b){a.J||a.Z.push(a.G.G(b))}
420
- olympe.async.Io=class{constructor(a,b=void 0===a){this.F=[];this.Z=[];this.G=a||new olympe.D.Xb('Async executor context');this.ja=b;this.C=null;this.env=new Map;this.env.set('Executor',this);this.J=this.O=!1;this.H=null;this.timer=this.timeout=0;this.aa=olympe.Y.Mc()}vn(a){0<=a&&(this.timeout=a);return this}ib(){return this.H}add(a){this.J||this.F.push(this.G.G(a));return this}start(){this.O||(this.H&&this.H.log('Executor started.'),this.O=!0,this.G.onDestroy(()=>{this.C='Context destroyed.';this.complete(!1)},
420
+ olympe.async.Io=class{constructor(a,b=void 0===a){this.F=[];this.Z=[];this.G=a||new olympe.D.Xb('Async executor context');this.ja=b;this.C=null;this.env=new Map;this.env.set('Executor',this);this.J=this.O=!1;this.H=null;this.timer=this.timeout=0;this.aa=olympe.Y.Mc()}vn(a){0<=a&&(this.timeout=a);return this}ab(){return this.H}add(a){this.J||this.F.push(this.G.G(a));return this}start(){this.O||(this.H&&this.H.log('Executor started.'),this.O=!0,this.G.onDestroy(()=>{this.C='Context destroyed.';this.complete(!1)},
421
421
  this.aa),0<this.timeout&&(this.timer=setTimeout(()=>{this.C='Timeout expired.';this.timer=0;this.complete(!1)},this.timeout)))}clear(){this.F=[];this.Z=[];this.env.clear();this.ja&&this.G.destroy()}complete(a){this.G.Mf(this.aa);if(!this.J){this.J=!0;this.timer&&(clearTimeout(this.timer),this.timer=0);this.H&&this.H.log(a?'Executor completed successfully':`Executor completed with error: ${this.C}`);for(const b of this.Z)b(a,a?null:this.C,this.env);this.clear()}}getContext(){return this.G}};
422
422
  function Uc(a){if(0<a.F.length){const b=a.F.shift();a.H&&a.H.log(`Executing next task. ${a.F.length} tasks left in the pipeline.`);a.getContext().run(()=>{b(()=>{Promise.resolve().then(()=>{Uc(a)})},c=>{c&&(a.C=c);a.complete(!1)},a.env)})}else a.complete(!0)}olympe.async.Tq=class extends olympe.async.Io{static create(){return new olympe.async.Tq(new olympe.D.Xb('SequencedExecutor'),!0)}start(){this.O||(super.start(),Uc(this))}};
423
423
  olympe.async.Yj=class extends olympe.async.Io{constructor(a,b){super(a,b);this.T=0;this.ea=!0}static create(){return new olympe.async.Yj(new olympe.D.Xb('ParallelExecutor'),!0)}run(a){this.H&&this.H.log('Starting a task');this.getContext().run(()=>{a(()=>{this.done()},b=>{this.ea=!1;b&&(this.C=this.C?`${this.C}. ${b}`:b);this.done()},this.env)})}add(a){super.add(a);this.O&&!this.J&&(this.T++,this.run(a));return this}done(){this.T--;0>=this.T&&this.complete(this.ea)}start(){if(!this.O)if(super.start(),
424
424
  0<this.F.length){this.T=this.F.length;for(const a of this.F)this.run(a)}else this.complete(!0)}};olympe.Db={};olympe.Db.pu=class{F(){return v(function*(){})}Z(){}O(){}G(){}T(){}forEach(){}has(){}get(){}set(){}remove(){}ea(){}aa(){}clear(){}J(){}};olympe.Db.qu=class{F(){}};olympe.Db.Storage=class{open(){}write(){}close(){}};olympe.Db.zu=class{get(){return null}set(){return this}delete(){}};olympe.Db.R={Pj:'localStorage.KeyValueDatabaseManager',Mi:'localStorage.Storage',Mz:'localStorage.DatacloudStorage',Ml:'localStorage.LocalStorage',Ca:'localStorage.Logger',Jg:'localStorage.prefix'};olympe.W.config(function(a){Pa(a,olympe.Db.R.Pj);E(a,olympe.Db.R.Jg,[],()=>'olympe');E(a,olympe.Db.R.Ca,[olympe.ka.R.Ea],b=>b.Vc('localstorage'));C(a,olympe.Db.R.Ml,olympe.Db.zu)},'olympe.localstorage');olympe.N={};olympe.N.errors={};olympe.N.errors.Ao=class extends Error{};olympe.N.errors.aq=class extends Error{};olympe.N.errors.Tp=class extends Error{};olympe.N.errors.nk=class extends Error{};olympe.N.errors.fo=class extends Error{};olympe.N.errors.Eq=class extends Error{};olympe.N.errors.fq=class extends Error{};olympe.N.errors.Xv=class extends Error{};olympe.N.errors.om=class extends Error{constructor(a,b){super(a);this.id=b}U(){return this.id}};olympe.N.errors.Gi=class extends olympe.N.errors.om{};
425
425
  olympe.N.errors.Sn=class extends olympe.N.errors.om{};olympe.N.errors.cp=class extends olympe.N.errors.om{};olympe.N.Zb={Kj:'urls.FileSvc',Jn:'urls.BackupSvc',xq:'urls.RestoreBackupSvc',tg:'urls.GetContext',Zo:'urls.GraphDef',Un:'urls.StaticGraphDef',TRANSACTION:'urls.Transaction',er:'urls.UserTagFromToken',Wv:'urls.UserNameFromTag',Vv:'urls.UserRoles',kv:'urls.RoleMembers',Tj:'urls.OpenIDSvc'};
426
426
  olympe.W.config(a=>{F(a,olympe.N.Zb.Kj,'rest/filesvc');F(a,olympe.N.Zb.Jn,'rest/backupsvc');F(a,olympe.N.Zb.xq,'rest/backupsvc/restore');F(a,olympe.N.Zb.Tj,'rest/openid');F(a,olympe.N.Zb.tg,'rest/initialData');F(a,olympe.N.Zb.Zo,'rest/querysvc/graphDef');F(a,olympe.N.Zb.Un,'rest/querysvc/graphDef/static');F(a,olympe.N.Zb.TRANSACTION,'rest/transaction');F(a,olympe.N.Zb.er,'rest/token');F(a,olympe.N.Zb.Wv,'rest/authorization/getUserTag');F(a,olympe.N.Zb.Vv,'rest/authorization/getUserRoles');F(a,olympe.N.Zb.kv,
427
- 'rest/authorization/roleMembers')});function Vc(a){xc(a.F,()=>{Wc(a)});zc(a.F,()=>{a.aa=!0});yc(a.F,()=>{Yc(a).then(()=>{a.aa=!1;Zc(a)}).catch(b=>{a.H.error(`An error occurred while trying to subscribe to "response topic" on the bus. Close connection: ${b}`);a.F.end()})})}function $c(a){return ad(a.Jb)&&uc(a.F)}
428
- function bd(a,b,c){return v(function*(){$c(a)||(yield a.connect());a.H.debug(`Bus: Subscribe to ${b}`);a.ea.set(b,c);yield a.F.subscribe(a.ja+b,d=>{a.H.C()&&a.H.debug(`BUS < #${b}: ${JSON.stringify(d)}`);let e=null;try{if(cd(a,d.seq,'consumed'),e=olympe.N.jk.F(d,a.ab,f=>dd(a,d.src,f).stream),cd(a,e.ce.toString(),'deserialized',(new Map).set('source',e.tb()).set('messageType',e.getType().toString())),e.getType()===olympe.N.cb.C.$f){ed(a,e);return}}catch(f){a.H.error(`An error occurred while trying to deserialize the request: ${JSON.stringify(d)} with error ${f}`)}null!==
427
+ 'rest/authorization/roleMembers')});function Vc(a){xc(a.F,()=>{Wc(a)});zc(a.F,()=>{a.aa=!0});yc(a.F,()=>{Yc(a).then(()=>{a.aa=!1;Zc(a)}).catch(b=>{a.H.error(`An error occurred while trying to subscribe to "response topic" on the bus. Close connection: ${b}`);a.F.end()})})}function $c(a){return ad(a.Fb)&&uc(a.F)}
428
+ function bd(a,b,c){return v(function*(){$c(a)||(yield a.connect());a.H.debug(`Bus: Subscribe to ${b}`);a.ea.set(b,c);yield a.F.subscribe(a.ja+b,d=>{a.H.C()&&a.H.debug(`BUS < #${b}: ${JSON.stringify(d)}`);let e=null;try{if(cd(a,d.seq,'consumed'),e=olympe.N.jk.F(d,a.bb,f=>dd(a,d.src,f).stream),cd(a,e.ce.toString(),'deserialized',(new Map).set('source',e.tb()).set('messageType',e.getType().toString())),e.getType()===olympe.N.eb.C.$f){ed(a,e);return}}catch(f){a.H.error(`An error occurred while trying to deserialize the request: ${JSON.stringify(d)} with error ${f}`)}null!==
429
429
  e&&c(e)})})}function Wc(a){a.H.info('Disconnected from bus');let b;null==(b=a.C)||b.forEach((c,d)=>{null!==c.F&&(a.H.info(`Disconnected from bus: pause keep alive of ${c.C.size} subscriptions for ${d} service.`),fd(c))})}
430
- function Yc(a){a.H.debug('Connection to bus established. Listening to responses on topic',a.J);return a.F.subscribe(a.J,b=>{a.H.C()&&a.H.debug('BUS <',JSON.stringify(b));cd(a,b.seq,'consumed');const c=olympe.N.cb.F(b,a.ab,d=>dd(a,b.src,d).stream);cd(a,c.ce.toString(),'deserialized',(new Map).set('source',c.tb()).set('messageType',c.getType().toString()));if(c.getType()===olympe.N.cb.C.$f)ed(a,c);else{let d;null==(d=a.G.get(c.ce))||d(c)}})}
430
+ function Yc(a){a.H.debug('Connection to bus established. Listening to responses on topic',a.J);return a.F.subscribe(a.J,b=>{a.H.C()&&a.H.debug('BUS <',JSON.stringify(b));cd(a,b.seq,'consumed');const c=olympe.N.eb.F(b,a.bb,d=>dd(a,b.src,d).stream);cd(a,c.ce.toString(),'deserialized',(new Map).set('source',c.tb()).set('messageType',c.getType().toString()));if(c.getType()===olympe.N.eb.C.$f)ed(a,c);else{let d;null==(d=a.G.get(c.ce))||d(c)}})}
431
431
  function Zc(a){a.H.debug(`Connected to bus: subscribe to ${a.ea.size} active topics.`);a.ea.forEach((c,d)=>{bd(a,d,c).catch(e=>{a.H.error(`Failed to subscribe topic after connecting to the bus, with error: ${e}`)})});let b;null==(b=a.C)||b.forEach((c,d)=>{null===c.F&&(a.H.debug(`Connected to bus: start keep alive of ${c.C.size} subscriptions for ${d} service.`),gd(c,!0))});a.T.forEach(c=>c(null));a.T=[]}
432
432
  function hd(a){a.ac=a.Ga.C(()=>$c(a)?Promise.resolve('Bus connection OK'):Promise.reject('Bus is disconnected'))}function cd(a,b,c,d=new Map){a.Ub.C&&db(a.Ub,'com',d.set('id',`${b}`).set('channel','bus').set('eventType',c))}function dd(a,b,c){const d=`${b}:${c}`;b=a.ua.get(d);b||(b=new olympe.N.eq(()=>a.ua.delete(d)),a.ua.set(d,b));return b}
433
433
  function ed(a,b){const c=olympe.N.Ce.qg,d=olympe.N.Ce.Vf,e=olympe.N.Ce.xb,f=b.C,{id:g,e:h}=f,k=`${b.tb()}:${g}`,l=dd(a,b.tb(),g);if(h===c){Xa(a.ua.C,k);const {i:n,c:p}=f;l.write(p,n).catch(q=>{l.throw(q)})}else h===d?l.complete(f.s):h===e&&l.throw(Error(`Received stream error: ${f.reason}`))}function id(a,b,c,d){const e=jd(a.O).wd();a.Z++;return new olympe.N.jk(b,a.J,e,a.Z,c,d)}
434
- function kd(a,b,c,d){const e=b.ce;let f=null;f=setTimeout(()=>ld(a,e),a.Tc);a.G.set(e,g=>{f&&clearTimeout(f);g.getType()===olympe.N.cb.C.Sk?f=setTimeout(()=>ld(a,e),d):(a.G.delete(e),c(g))})}function ld(a,b){const c=a.G.get(b);a.G.delete(b);null==c||c(new olympe.N.cb(a.J,a.J,b,olympe.N.cb.C.xb,{reason:'Timeout'}))}function md(a,b){a.Z++;const c=a.Z,d=setTimeout(()=>ld(a,c),a.Tc);a.G.set(c,e=>{a.G.delete(c);clearTimeout(d);b(e)});return a.Z}
434
+ function kd(a,b,c,d){const e=b.ce;let f=null;f=setTimeout(()=>ld(a,e),a.Tc);a.G.set(e,g=>{f&&clearTimeout(f);g.getType()===olympe.N.eb.C.Sk?f=setTimeout(()=>ld(a,e),d):(a.G.delete(e),c(g))})}function ld(a,b){const c=a.G.get(b);a.G.delete(b);null==c||c(new olympe.N.eb(a.J,a.J,b,olympe.N.eb.C.xb,{reason:'Timeout'}))}function md(a,b){a.Z++;const c=a.Z,d=setTimeout(()=>ld(a,c),a.Tc);a.G.set(c,e=>{a.G.delete(c);clearTimeout(d);b(e)});return a.Z}
435
435
  function nd(a,b){return v(function*(){let c;const d=null==(c=a.C)?void 0:c.get(b);d&&(fd(d),a.C.delete(b));a.ea.delete(b);a.H.debug(`Bus: Unsubscribe to ${b}`);$c(a)&&(yield wc(a.F,a.ja+b))})}function od(a,b,c,d,e){null===a.C&&(a.C=new Map);let f=a.C.get(b);f?(a=f,a.G!==d&&(a.G=d,null!==a.F&&(fd(a),gd(a,!1)))):(f=new olympe.N.Iv(a.H,a,b,d),a.C.set(b,f));d=f;d.C.set(c,e);1===d.C.size&&gd(d,!1)}
436
- function pd(a,b,c){var d;const e=null==(d=a.C)?void 0:d.get(b);if(null==e?0:qd(e,c))d=olympe.N.cb.C.wm,$c(a)&&a.publish(id(a,b,d,c)).catch(f=>a.H.error(`Impossible to keep alive subscriptions: ${f}`)),0===e.C.size&&(a.C.delete(b),0===a.C.size&&(a.C=null))}function rd(a,b){return new Promise((c,d)=>{a.O.Yg(b.le(),(e,f)=>{e?d(e):c(f)})})}
437
- olympe.N.Tn=class{constructor(a,b,c,d,e,f,g,h){this.H=a;this.Jb=c;this.O=d;this.Ga=e;this.ab=f;this.Ub=g;this.G=new Map;this.Tc=h.get('shortTimeout');this.Cc=h.get('requestTimeout');this.Uc=h.get('subscriptionsRefreshRate');this.yb=h.get('allowGuest');a=h.get('connection');b=this.O.C.sb().asObservable();c=c.Kf().asObservable();c=rxjs.combineLatest([a,b,c]).pipe(rxjs.operators.map(([k,l,n])=>n.valueOf()?Object.assign({},k,{username:l.Bc(),password:l.wd()}):null));this.F=new olympe.net.pf(c);Vc(this);
436
+ function pd(a,b,c){var d;const e=null==(d=a.C)?void 0:d.get(b);if(null==e?0:qd(e,c))d=olympe.N.eb.C.wm,$c(a)&&a.publish(id(a,b,d,c)).catch(f=>a.H.error(`Impossible to keep alive subscriptions: ${f}`)),0===e.C.size&&(a.C.delete(b),0===a.C.size&&(a.C=null))}function rd(a,b){return new Promise((c,d)=>{a.O.Yg(b.le(),(e,f)=>{e?d(e):c(f)})})}
437
+ olympe.N.Tn=class{constructor(a,b,c,d,e,f,g,h){this.H=a;this.Fb=c;this.O=d;this.Ga=e;this.bb=f;this.Ub=g;this.G=new Map;this.Tc=h.get('shortTimeout');this.Cc=h.get('requestTimeout');this.Uc=h.get('subscriptionsRefreshRate');this.yb=h.get('allowGuest');a=h.get('connection');b=this.O.C.sb().asObservable();c=c.Kf().asObservable();c=rxjs.combineLatest([a,b,c]).pipe(rxjs.operators.map(([k,l,n])=>n.valueOf()?Object.assign({},k,{username:l.Bc(),password:l.wd()}):null));this.F=new olympe.net.pf(c);Vc(this);
438
438
  this.ja='';h.get('topicPrefix').subscribe(k=>{this.H.debug(`Bus: new topic prefix: ${k}`);const l=this.ja;this.ja=k;if($c(this)){this.H.debug(`Resubscribe to queues with new topic prefix: ${k}`);Promise.all(Array.from(this.ea).map(([p,q])=>{const r=this;return v(function*(){yield bd(r,p,q);yield wc(r.F,l+p)})})).catch(p=>this.H.error(`Failed to subscribe topics after changing the topic prefix: ${p}`));let n;null==(n=this.C)||n.forEach(p=>{sd(p)})}});this.Vd=this.Z=0;this.J=olympe.Y.Mc();this.C=null;
439
- this.aa=!1;this.T=[];this.ea=new Map;this.ua=new olympe.Y.Hh(this.Cc);this.hc=this.ac='';this.gb=!1}connect(){return new Promise((a,b)=>{const c=d=>{b(d);this.T.forEach(e=>e(d));this.T=[]};$c(this)?a():this.aa||this.gb?this.T.push(d=>d?b(d):a()):ad(this.Jb)?(this.gb=!0,olympe.D.hs([this.O.Jk()],d=>{hd(this);this.gb=!1;d.valueOf()||this.yb?(this.yb||td(this.O,()=>this.disconnect().then()),this.aa=!0,this.T.push(e=>e?b(e):a()),this.F.connect(),this.hc=this.Ga.ja(()=>this.disconnect(),'Bus websocket')):
440
- c(Error('Guest user is not allowed to connect to RabbitMQ, you can allow guest with the bus.allowGuest oConfig parameter!'))})):c(Error('Cannot connect to the bus if working offline'))})}disconnect(){return new Promise(a=>{this.H.debug('Disconnecting from bus');this.O.ja.delete('busLogoutCallback');this.Ga.G(this.ac);this.Ga.O(this.hc);this.F.end(!1,()=>a())})}publish(a,b=!1){const c=this;return v(function*(){if(!c.aa||a.getType()!==olympe.N.cb.C.ve){$c(c)||(yield c.connect());var d=b?a.jc():c.ja+
441
- a.jc();try{cd(c,a.ce.toString(),'serialize');var e=a.ha(c.ab,c.Ud.bind(c,a));c.H.C()&&c.H.debug(`BUS > #${d}: ${JSON.stringify(e)}`)}catch(f){throw Error(`An error occurred while serializing the message (seqId=${a.ce}): ${f}`);}yield c.F.publish(d,e);cd(c,a.ce.toString(),'publish',(new Map).set('destination',a.jc()).set('messageType',a.getType().toString()))}})}Ud(a,b){const c=this.Vd++;(()=>{const d=this;return v(function*(){const e=l=>d.publish(new olympe.N.cb(a.jc(),a.tb(),a.ce,olympe.N.cb.C.$f,
442
- l)),f=olympe.N.Ce.qg,g=olympe.N.Ce.Vf,h=olympe.N.Ce.xb;let k=0;try{for(const l=ha(b);;){const n=yield l.next();if(n.done)break;const p=n.value;yield e({id:c,i:k++,e:f,c:p})}yield e({id:c,s:k,e:g})}catch(l){yield e({id:c,e:h,reason:`Error to complete the stream: ${l}`})}})})();return c}qd(a,b,c){return this.send(a.ce,a.tb(),b,c,!0)}send(a,b,c,d,e){return this.publish(new olympe.N.cb(b,this.J,a,c,d),e)}request(a,b,c,d){const e=id(this,a,b,c);c=olympe.N.cb.C.Sk;if(b===olympe.N.cb.C.PUBLISH){const f=
443
- new olympe.N.cb(a,this.J,e.ce,c);return this.publish(e).then(()=>f)}return new Promise((f,g)=>{kd(this,e,f,null!=d?d:this.Cc);this.publish(e).catch(g)})}};olympe.N.Tn.C='Timeout';const ud=olympe.net.Aa.Headers.In,vd=olympe.net.Aa.Yb.xh,wd=olympe.net.Aa.Yb.Zn,xd=olympe.net.Aa.Yb.tj,yd=olympe.net.Aa.Yb.rv,zd=olympe.net.Aa.Yb.Qs,Ad=olympe.net.Aa.Yb.No,Bd=olympe.net.Aa.Yb.Rv,Cd=olympe.net.Aa.Yb.Ql;function Dd(a,b){let c;return null!=(c=a.G.get(b))?c:''}function Ed(a,b,c,d=new Map){a.C.C&&db(a.C,'com',d.set('id',`${b}`).set('channel','http').set('eventType',c))}
439
+ this.aa=!1;this.T=[];this.ea=new Map;this.ua=new olympe.Y.Hh(this.Cc);this.hc=this.ac='';this.hb=!1}connect(){return new Promise((a,b)=>{const c=d=>{b(d);this.T.forEach(e=>e(d));this.T=[]};$c(this)?a():this.aa||this.hb?this.T.push(d=>d?b(d):a()):ad(this.Fb)?(this.hb=!0,olympe.D.hs([this.O.Jk()],d=>{hd(this);this.hb=!1;d.valueOf()||this.yb?(this.yb||td(this.O,()=>this.disconnect().then()),this.aa=!0,this.T.push(e=>e?b(e):a()),this.F.connect(),this.hc=this.Ga.ja(()=>this.disconnect(),'Bus websocket')):
440
+ c(Error('Guest user is not allowed to connect to RabbitMQ, you can allow guest with the bus.allowGuest oConfig parameter!'))})):c(Error('Cannot connect to the bus if working offline'))})}disconnect(){return new Promise(a=>{this.H.debug('Disconnecting from bus');this.O.ja.delete('busLogoutCallback');this.Ga.G(this.ac);this.Ga.O(this.hc);this.F.end(!1,()=>a())})}publish(a,b=!1){const c=this;return v(function*(){if(!c.aa||a.getType()!==olympe.N.eb.C.ve){$c(c)||(yield c.connect());var d=b?a.jc():c.ja+
441
+ a.jc();try{cd(c,a.ce.toString(),'serialize');var e=a.ha(c.bb,c.Ud.bind(c,a));c.H.C()&&c.H.debug(`BUS > #${d}: ${JSON.stringify(e)}`)}catch(f){throw Error(`An error occurred while serializing the message (seqId=${a.ce}): ${f}`);}yield c.F.publish(d,e);cd(c,a.ce.toString(),'publish',(new Map).set('destination',a.jc()).set('messageType',a.getType().toString()))}})}Ud(a,b){const c=this.Vd++;(()=>{const d=this;return v(function*(){const e=l=>d.publish(new olympe.N.eb(a.jc(),a.tb(),a.ce,olympe.N.eb.C.$f,
442
+ l)),f=olympe.N.Ce.qg,g=olympe.N.Ce.Vf,h=olympe.N.Ce.xb;let k=0;try{for(const l=ha(b);;){const n=yield l.next();if(n.done)break;const p=n.value;yield e({id:c,i:k++,e:f,c:p})}yield e({id:c,s:k,e:g})}catch(l){yield e({id:c,e:h,reason:`Error to complete the stream: ${l}`})}})})();return c}qd(a,b,c){return this.send(a.ce,a.tb(),b,c,!0)}send(a,b,c,d,e){return this.publish(new olympe.N.eb(b,this.J,a,c,d),e)}request(a,b,c,d){const e=id(this,a,b,c);c=olympe.N.eb.C.Sk;if(b===olympe.N.eb.C.PUBLISH){const f=
443
+ new olympe.N.eb(a,this.J,e.ce,c);return this.publish(e).then(()=>f)}return new Promise((f,g)=>{kd(this,e,f,null!=d?d:this.Cc);this.publish(e).catch(g)})}};olympe.N.Tn.C='Timeout';const ud=olympe.net.Aa.Headers.In,vd=olympe.net.Aa.Yb.xh,wd=olympe.net.Aa.Yb.Zn,xd=olympe.net.Aa.Yb.tj,yd=olympe.net.Aa.Yb.rv,zd=olympe.net.Aa.Yb.Qs,Ad=olympe.net.Aa.Yb.No,Bd=olympe.net.Aa.Yb.Rv,Cd=olympe.net.Aa.Yb.Ql;function Dd(a,b){let c;return null!=(c=a.G.get(b))?c:''}function Ed(a,b,c,d=new Map){a.C.C&&db(a.C,'com',d.set('id',`${b}`).set('channel','http').set('eventType',c))}
444
444
  function Fd(a,b,c){if(null===b)return Promise.reject('No http request to send');rc(b,{[ud]:c});const d=b.C();return rxjs.firstValueFrom(rxjs.defer(()=>new Promise((e,f)=>{a.F++;const g=a.F;if(a.H.C()){const h=b.body;a.H.debug('HTTP >',d,`body: ${'string'===typeof h?h:typeof h}`)}Ed(a,g,'request',(new Map).set('destination',b.C()).set('messageType',b.method.toString()));a.J.C(b,h=>{Ed(a,g,'reply');switch(h.Gc()){case vd:case wd:case xd:var k=h.getData();a.H.C()&&a.H.debug('HTTP <',h.Gc(),`content: ${'string'===
445
445
  typeof k?k:typeof k}`);e(k);break;case yd:h=`HTTP < Service provider for http request to ${b.C()} is overloaded, retry later`;a.H.warn(h);f(new olympe.N.errors.fq(h));break;case zd:a.H.debug(`HTTP < request canceled (${b.C()}).`);e();break;case Ad:case Bd:h=`HTTP < request authorization denied: ${b.C()}`;a.H.error(h);f(new olympe.N.errors.Xv(h));break;case Cd:h=`HTTP < requested resource not found: ${b.C()}`;a.H.error(h);f(new olympe.N.errors.Tp(h));break;default:k=`HTTP < Error: ${h.Gc()}, ${h.statusText}`,
446
- a.H.error(k),500===h.Gc()&&'Connection refused'===h.statusText?f(new olympe.N.errors.fo(k)):f(Error(k))}})})).pipe(eb(olympe.N.errors.fq,(e,f)=>{a.H.warn(`Service overloaded (${d}), retry sending http request after ${f}ms.`)},a.O)))}olympe.N.zt=class{constructor(a,b,c,d,e){this.H=a;this.J=b;this.C=c;this.G=null;d.subscribe(f=>{this.G=f});this.O=e;this.F=0}};function P(a,b){if(a.C!==b)switch(a.H.debug('State change '+a.C+' --\x3e '+b),a.C=b,a.Jb.forEach(c=>c(b)),b){case olympe.N.La.C.rk:case olympe.N.La.C.CONNECTING:case olympe.N.La.C.vo:break;case olympe.N.La.C.ng:a.connected.update(olympe.D.fa.F);break;case olympe.N.La.C.Cg:a.J=[0,0,a.J[2]];Gd(a);break;case olympe.N.La.C.xb:let c;a.H.error('Connection to server',null==(c=a.T)?void 0:c.C(),'aborted due to error');a.connected.update(olympe.D.fa.C);break;case olympe.N.La.C.Dn:Gd(a);break;case olympe.N.La.C.Rd:a.connected.update(olympe.D.fa.C);
446
+ a.H.error(k),500===h.Gc()&&'Connection refused'===h.statusText?f(new olympe.N.errors.fo(k)):f(Error(k))}})})).pipe(eb(olympe.N.errors.fq,(e,f)=>{a.H.warn(`Service overloaded (${d}), retry sending http request after ${f}ms.`)},a.O)))}olympe.N.zt=class{constructor(a,b,c,d,e){this.H=a;this.J=b;this.C=c;this.G=null;d.subscribe(f=>{this.G=f});this.O=e;this.F=0}};function P(a,b){if(a.C!==b)switch(a.H.debug('State change '+a.C+' --\x3e '+b),a.C=b,a.Fb.forEach(c=>c(b)),b){case olympe.N.La.C.rk:case olympe.N.La.C.CONNECTING:case olympe.N.La.C.vo:break;case olympe.N.La.C.ng:a.connected.update(olympe.D.fa.F);break;case olympe.N.La.C.Cg:a.J=[0,0,a.J[2]];Gd(a);break;case olympe.N.La.C.xb:let c;a.H.error('Connection to server',null==(c=a.T)?void 0:c.C(),'aborted due to error');a.connected.update(olympe.D.fa.C);break;case olympe.N.La.C.Dn:Gd(a);break;case olympe.N.La.C.Rd:a.connected.update(olympe.D.fa.C);
447
447
  break;default:throw Error('State machine error in server manager. Should not get in state '+b);}}
448
448
  function Hd(a){const b=olympe.N.La.C.Dn,c=olympe.N.La.C.rk,d=olympe.N.La.C.Rd,e=pc(a.ea);a.H.info(`Trying to wakeup orchestrator with ${e}`);P(a,c);const f=a.Ub.G(a.ea);f.aa(g=>{const h=JSON.parse(g);a.H.info(`${e}: ${null==h?void 0:h.status}`);switch(null==h?void 0:h.status){case 'ready':P(a,b);f.close();break;case 'asleep':a.H.info(`Trying to wakeup orchestrator with ${e}`);f.send('{"action": "wakeup"}');P(a,c);break;case 'waking-up':break;default:a.H.warn(`Invalid message from ${e}: ${g}`),f.close(),
449
449
  P(a,d)}});f.F(()=>{a.H.warn(`Communication with ${e} failed.`);f.close();P(a,d)});f.ea(()=>{a.H.info(`Checking orchestrator status with ${e}`);f.send('{"action": "status"}')})}
450
- function Id(a,b,c){a.H.info('Initializing COMMUNICATION layer');if(a.H.C()){const d=['Server layer parameters:'];b.forEach((e,f)=>{d.push(f+'="'+e+'"')});a.H.debug(d.join('\n\t'))}Jd(a,olympe.N.we.xb,d=>{switch(d.c){case olympe.N.Di.Tv:a.H.error('Unknown message sent to the server:',olympe.N.La.Gb[d.s]);break;case olympe.N.Di.rt:a.H.error('Fatal error, the last message is probably too big according to the websocket config.'),a.G.forEach((e,f)=>{null!==e.kn&&Kd(a,f,d.i)})}});Jd(a,olympe.N.we.Gb,d=>
451
- {d.c===olympe.N.Di.ev&&'boolean'===typeof d.a&&a.$h.update(olympe.D.Sb(d.a))});olympe.D.ij(a.connected,()=>{let d=!1;olympe.D.ij(a.gb.C(),()=>{d&&(a.hc(),a.yb(),d=!1);nc(a.hc.bind(a),a.Uc);nc(a.yb.bind(a),a.Ga)},()=>{a.J=[0,0,a.J[2]];d=!0})},()=>{a.Z=null;mc(a.yb.bind(a),a.Ga)});c.C(()=>Ld(a)?Promise.resolve('WebSocket connection to Orchestrator OK'):Promise.reject(`WebSocket connection to Orchestrator is ${a.C}`));c.ja(()=>a.disconnect(),'Orchestrator websocket');Za(a.O,(d,e)=>{e.throw(Error('Stream timeout'))});
452
- a.H.log('DONE initializing SERVER layer (waiting for NET layer connection to be opened)')}function Ld(a){return a.C===olympe.N.La.C.ng}function Md(a,b,c,d=!1){const e=f=>{if(0===b.length||b.includes(f))d&&a.Jb.delete(e),c(f)};a.Jb.add(e);e(a.C)}function Nd(a,b,c,d,e){a.ja.C&&db(a.ja,'com',d.set('id',`${b}`).set('channel','ws').set('eventType',c),e)}
450
+ function Id(a,b,c){a.H.info('Initializing COMMUNICATION layer');if(a.H.C()){const d=['Server layer parameters:'];b.forEach((e,f)=>{d.push(f+'="'+e+'"')});a.H.debug(d.join('\n\t'))}Jd(a,olympe.N.we.xb,d=>{switch(d.c){case olympe.N.Di.Tv:a.H.error('Unknown message sent to the server:',olympe.N.La.Hb[d.s]);break;case olympe.N.Di.rt:a.H.error('Fatal error, the last message is probably too big according to the websocket config.'),a.G.forEach((e,f)=>{null!==e.kn&&Kd(a,f,d.i)})}});Jd(a,olympe.N.we.Hb,d=>
451
+ {d.c===olympe.N.Di.ev&&'boolean'===typeof d.a&&a.$h.update(olympe.D.Sb(d.a))});olympe.D.ij(a.connected,()=>{let d=!1;olympe.D.ij(a.hb.C(),()=>{d&&(a.hc(),a.yb(),d=!1);nc(a.hc.bind(a),a.Uc);nc(a.yb.bind(a),a.Ga)},()=>{a.J=[0,0,a.J[2]];d=!0})},()=>{a.Z=null;mc(a.yb.bind(a),a.Ga)});c.C(()=>Ld(a)?Promise.resolve('WebSocket connection to Orchestrator OK'):Promise.reject(`WebSocket connection to Orchestrator is ${a.C}`));c.ja(()=>a.disconnect(),'Orchestrator websocket');Za(a.O,(d,e)=>{e.throw(Error('Stream timeout'))});
452
+ a.H.log('DONE initializing SERVER layer (waiting for NET layer connection to be opened)')}function Ld(a){return a.C===olympe.N.La.C.ng}function Md(a,b,c,d=!1){const e=f=>{if(0===b.length||b.includes(f))d&&a.Fb.delete(e),c(f)};a.Fb.add(e);e(a.C)}function Nd(a,b,c,d,e){a.ja.C&&db(a.ja,'com',d.set('id',`${b}`).set('channel','ws').set('eventType',c),e)}
453
453
  function Gd(a){const b=olympe.N.La.C.INIT,c=olympe.N.La.C.CONNECTING,d=olympe.N.La.C.ng,e=olympe.N.La.C.Rd,f=olympe.N.La.C.Cg,g=olympe.N.La.C.rk,h=olympe.N.La.C.xb;if(null===a.T)a.H.warn('Trying to open a connection to the orchestrator without a valid server request. Ignoring...'),P(a,e);else{null!==a.F&&(a.F.Z(null),a.F.close());var k,l;a.H.log(`Asking NET layer for a connection to ${null==(k=a.T)?void 0:oc(k)}:${null==(l=a.T)?void 0:l.port}...`);a.F=a.Ub.G(a.T);a.F.ea(a.Ud.bind(a));a.F.aa(a.Bf.bind(a));
454
454
  a.F.Z(()=>{a.F=null;a.C===d?P(a,f):a.C!==h&&a.C!==g&&P(a,e)});a.ea&&a.C===b&&a.F.F(()=>{a.F.F(null);a.C===c&&Hd(a);a.ea=null});a.C!==f&&P(a,c)}}function Od(a,b,c,d){const e=a.Vd;a.Vd++;c={message:{seqId:e,messageFamily:b,payload:c},Gm:d?Pd(d):null,kn:null};a.G.set(e,c);Nd(a,e,'publish',(new Map).set('family',b));d=[olympe.N.La.C.CONNECTING,olympe.N.La.C.Cg];(Ld(a)||b===olympe.N.we.Oj&&d.includes(a.C))&&Qd(a,e,c)}
455
- function Pd(a){const b=olympe.N.La.F.Ni;return c=>{if(null!==c&&void 0!==c){var d=null,e=c.s;if(void 0!==e&&e!==b){d=void 0!==olympe.N.La.Gb[e]?`Status code = ${e} [${olympe.N.La.Gb[e]}]`:`Status code = ${e}`;e=olympe.N.errors.Eq;const f=c.error;'string'===typeof f&&0<f.length&&(f.includes('Message timeout')&&(e=olympe.N.errors.nk),d+=`\nReason:\n${f}`);d=new e('Rejected by orchestrator:\n'+d)}a(d,c)}}}
456
- function Qd(a,b,c){var d=c.message;a.H.C()&&a.H.debug('WS >',JSON.stringify(d.payload));(d=a.F.send(JSON.stringify(d)))?null===c.Gm?a.G.delete(b):c.kn=Date.now():olympe.D.Na(a.gb.C()).valueOf()&&P(a,olympe.N.La.C.Cg);return d}function Jd(a,b,c,d){void 0===d&&(d=olympe.Y.Mc());let e=a.ua.get(b);void 0===e&&(e=new Map,a.ua.set(b,e));e.set(d,c)}function Rd(a){a=a.ua.get(olympe.N.we.xg);void 0!==a&&a.delete('logoutHandler')}
455
+ function Pd(a){const b=olympe.N.La.F.Ni;return c=>{if(null!==c&&void 0!==c){var d=null,e=c.s;if(void 0!==e&&e!==b){d=void 0!==olympe.N.La.Hb[e]?`Status code = ${e} [${olympe.N.La.Hb[e]}]`:`Status code = ${e}`;e=olympe.N.errors.Eq;const f=c.error;'string'===typeof f&&0<f.length&&(f.includes('Message timeout')&&(e=olympe.N.errors.nk),d+=`\nReason:\n${f}`);d=new e('Rejected by orchestrator:\n'+d)}a(d,c)}}}
456
+ function Qd(a,b,c){var d=c.message;a.H.C()&&a.H.debug('WS >',JSON.stringify(d.payload));(d=a.F.send(JSON.stringify(d)))?null===c.Gm?a.G.delete(b):c.kn=Date.now():olympe.D.Na(a.hb.C()).valueOf()&&P(a,olympe.N.La.C.Cg);return d}function Jd(a,b,c,d){void 0===d&&(d=olympe.Y.Mc());let e=a.ua.get(b);void 0===e&&(e=new Map,a.ua.set(b,e));e.set(d,c)}function Rd(a){a=a.ua.get(olympe.N.we.xg);void 0!==a&&a.delete('logoutHandler')}
457
457
  function Kd(a,b,c){if(a.G.has(b)){const {Gm:d}=a.G.get(b);a.G.delete(b);null==d||d({s:olympe.N.La.F.Kt,error:c})}}function Sd(a,b){a.H.error(b);P(a,olympe.N.La.C.xb)}function Td(a,b,c){a.Cc=c?1E3*c:-1;let d;a.H.info(`Connected to ${null==(d=a.T)?void 0:d.C()}`,'|',b?`server version: ${b}`:'','|',null!==c?`activity timeout: ${c}s`:'');b=Array.from(a.G).sort(([e],[f])=>e-f);for(const [e,f]of b)if(!Qd(a,e,f))return;P(a,olympe.N.La.C.ng)}
458
458
  function Ud(a,b){const c=olympe.N.Ce.qg,d=olympe.N.Ce.Vf,e=olympe.N.Ce.xb,{id:f,e:g}=b;let h=a.O.get(f);h||(h=new olympe.N.eq(()=>a.O.delete(f)),a.O.set(f,h));if(g===c){Xa(a.O.C,f);const {i:k,c:l}=b;h.write(l,k).catch(n=>{h.throw(n)})}else g===d?h.complete(b.s):g===e&&h.throw(Error(`Received stream error: ${b.reason}`))}
459
- olympe.N.La=class{constructor(a,b,c,d,e,f,g,h){this.H=a;this.Ub=b;this.T=null;e.subscribe(k=>{this.T=k;k=olympe.N.La.C.CONNECTING;if(this.C===olympe.N.La.C.ng||this.C===k){let l;null==(l=this.F)||l.close()}});this.ea=this.F=null;e.subscribe(k=>{this.ea=k;k=olympe.N.La.C.Rd;this.C===olympe.N.La.C.rk&&(P(this,k),Hd(this))});this.ja=g;this.Uc=h.get('pingInterval');this.Ga=h.get('messageTimeout');this.aa=olympe.Y.yf.parse(h.get('clientVersion'));this.ab=olympe.Y.yf.parse(h.get('serverVersion'));this.C=
460
- olympe.N.La.C.INIT;this.gb=d;this.ac=h.get('getContextMode');this.Vd=1;this.Z=null;this.J=[0,0,0];this.ua=new Map;this.connected=olympe.D.ec(olympe.D.fa,'Server is connected');this.$h=Xb(olympe.D.ec(olympe.D.fa,'Server is readonly'),olympe.D.fa.C);this.Jb=new Set;this.G=new Map;this.O=new olympe.Y.Hh(this.Ga);this.Tc=new Map;this.Cc=-1;Id(this,h,c)}connect(){const a=olympe.N.La.C.ng,b=olympe.N.La.C.Rd,c=olympe.N.La.C.xb,d=olympe.N.La.C.INIT;return new Promise((e,f)=>{this.C!==d&&this.C!==b||Gd(this);
459
+ olympe.N.La=class{constructor(a,b,c,d,e,f,g,h){this.H=a;this.Ub=b;this.T=null;e.subscribe(k=>{this.T=k;k=olympe.N.La.C.CONNECTING;if(this.C===olympe.N.La.C.ng||this.C===k){let l;null==(l=this.F)||l.close()}});this.ea=this.F=null;e.subscribe(k=>{this.ea=k;k=olympe.N.La.C.Rd;this.C===olympe.N.La.C.rk&&(P(this,k),Hd(this))});this.ja=g;this.Uc=h.get('pingInterval');this.Ga=h.get('messageTimeout');this.aa=olympe.Y.yf.parse(h.get('clientVersion'));this.bb=olympe.Y.yf.parse(h.get('serverVersion'));this.C=
460
+ olympe.N.La.C.INIT;this.hb=d;this.ac=h.get('getContextMode');this.Vd=1;this.Z=null;this.J=[0,0,0];this.ua=new Map;this.connected=olympe.D.ec(olympe.D.fa,'Server is connected');this.$h=Xb(olympe.D.ec(olympe.D.fa,'Server is readonly'),olympe.D.fa.C);this.Fb=new Set;this.G=new Map;this.O=new olympe.Y.Hh(this.Ga);this.Tc=new Map;this.Cc=-1;Id(this,h,c)}connect(){const a=olympe.N.La.C.ng,b=olympe.N.La.C.Rd,c=olympe.N.La.C.xb,d=olympe.N.La.C.INIT;return new Promise((e,f)=>{this.C!==d&&this.C!==b||Gd(this);
461
461
  Md(this,[a,b,c],g=>{g===a?e():f(Error('Was not able to open a connection to the orchestrator'))},!0)})}disconnect(){return new Promise((a,b)=>{const c=olympe.N.La.C.vo,d=olympe.N.La.C.Rd,e=olympe.N.La.C.CONNECTING,f=olympe.N.La.C.xb;this.C===olympe.N.La.C.ng||this.C===e||this.C===c?(Md(this,[d,f],g=>{g===d?a():b(Error('Was not able to disconnect'))},!0),this.C!==c&&(P(this,c),this.F.close())):(P(this,d),a())})}Ud(){this.H.debug('Websocket connected, sending handshake. Client version:',sb(this.aa),
462
- 'subscribeEverything:',this.ac?'NO':'YES');Od(this,olympe.N.we.Oj,{c:olympe.N.Di.Oj,cv:sb(this.aa),m:this.ac?0:1,s:this.Z,b:this.gb.F()},this.Uh.bind(this))}Uh(a,b){if(a)Sd(this,'Error in receiving handshake response: '+a.message);else{this.H.debug('Handshake response received');var c=olympe.N.La.G;a=b.sv||'undefined';var d=b.activityTimeout?Math.max(b.activityTimeout-60,5):null;switch(b.status){case c.Lt:Sd(this,`Framework version (${sb(this.aa)}) provided to the orchestrator was not valid. See orchestrator logs for more info.`);
463
- return;case c.Kv:Sd(this,`Framework version (${sb(this.aa)}) is not compatible with the orchestrator in use. See orchestrator logs for more info.`);return;case c.ut:Sd(this,'Handshake failed. See orchestrator logs for more info.');return}if(this.ab.Fa(olympe.Y.yf.C))this.H.warn('Handshake successful but received server version',a,'is invalid. Cannot check against it');else try{var e=olympe.Y.yf.parse(a);if(e.qj(this.ab)){Sd(this,`Framework v${sb(this.aa)} is expecting Orchestrator to be at least in v${sb(this.ab)}`);
464
- return}this.H.log('Handshake successful. Orchestrator version: ',e,'required:',sb(this.ab))}catch(f){Sd(this,f);return}e=olympe.N.La.C.Rd;if(this.C===olympe.N.La.C.Cg&&null!==this.Z&&this.Z!==b.sessionId)this.H.warn('Trying to do a session recovering, but got another session id so retry from disconnected state'),P(this,e);else{if(e=b.identityProviders)for(const [f,g]of Object.entries(e))this.Tc.set(f,g);this.Z=b.sessionId||null;Td(this,a,d)}}}hc(){this.J[0]-this.J[1]>this.Uc/2?(this.H.debug('Ping did not get answer, try to reconnect'),
465
- P(this,olympe.N.La.C.Cg)):(this.J[0]=Date.now(),this.F.send('ping')||(this.H.debug('Impossible to send ping, try to reconnect'),P(this,olympe.N.La.C.Cg)))}Bf(a){this.J[2]=Date.now();if(a.startsWith('pong'))return olympe.D.Na(this.gb.C()).valueOf()&&(this.J[1]=this.J[2]),null;var b=0;this.ja.C&&(b=performance.now()-this.ja.F);try{var c=JSON.parse(a)}catch(g){return this.H.error('Unable to parse response from server: '+g.toString()),Error('Unable to parse response from server')}a=c.seqId;var d=c.stream;
462
+ 'subscribeEverything:',this.ac?'NO':'YES');Od(this,olympe.N.we.Oj,{c:olympe.N.Di.Oj,cv:sb(this.aa),m:this.ac?0:1,s:this.Z,b:this.hb.F()},this.Uh.bind(this))}Uh(a,b){if(a)Sd(this,'Error in receiving handshake response: '+a.message);else{this.H.debug('Handshake response received');var c=olympe.N.La.G;a=b.sv||'undefined';var d=b.activityTimeout?Math.max(b.activityTimeout-60,5):null;switch(b.status){case c.Lt:Sd(this,`Framework version (${sb(this.aa)}) provided to the orchestrator was not valid. See orchestrator logs for more info.`);
463
+ return;case c.Kv:Sd(this,`Framework version (${sb(this.aa)}) is not compatible with the orchestrator in use. See orchestrator logs for more info.`);return;case c.ut:Sd(this,'Handshake failed. See orchestrator logs for more info.');return}if(this.bb.Fa(olympe.Y.yf.C))this.H.warn('Handshake successful but received server version',a,'is invalid. Cannot check against it');else try{var e=olympe.Y.yf.parse(a);if(e.qj(this.bb)){Sd(this,`Framework v${sb(this.aa)} is expecting Orchestrator to be at least in v${sb(this.bb)}`);
464
+ return}this.H.log('Handshake successful. Orchestrator version: ',e,'required:',sb(this.bb))}catch(f){Sd(this,f);return}e=olympe.N.La.C.Rd;if(this.C===olympe.N.La.C.Cg&&null!==this.Z&&this.Z!==b.sessionId)this.H.warn('Trying to do a session recovering, but got another session id so retry from disconnected state'),P(this,e);else{if(e=b.identityProviders)for(const [f,g]of Object.entries(e))this.Tc.set(f,g);this.Z=b.sessionId||null;Td(this,a,d)}}}hc(){this.J[0]-this.J[1]>this.Uc/2?(this.H.debug('Ping did not get answer, try to reconnect'),
465
+ P(this,olympe.N.La.C.Cg)):(this.J[0]=Date.now(),this.F.send('ping')||(this.H.debug('Impossible to send ping, try to reconnect'),P(this,olympe.N.La.C.Cg)))}Bf(a){this.J[2]=Date.now();if(a.startsWith('pong'))return olympe.D.Na(this.hb.C()).valueOf()&&(this.J[1]=this.J[2]),null;var b=0;this.ja.C&&(b=performance.now()-this.ja.F);try{var c=JSON.parse(a)}catch(g){return this.H.error('Unable to parse response from server: '+g.toString()),Error('Unable to parse response from server')}a=c.seqId;var d=c.stream;
466
466
  const e=c.messageFamily;c=c.payload;if(this.H.C()){const g=({id:h,i:k,e:l,c:n})=>l===olympe.N.Ce.qg?`stream[${h}][${k}]: ${JSON.stringify(n)}`:l===olympe.N.Ce.Vf?`stream[${h}]:END`:`stream[${h}]:ERROR`;this.H.debug(`WS < ${JSON.stringify(c)}, ${d?g(d):''}`)}Nd(this,a,'consumed',new Map,b);Nd(this,a,'deserialized',(new Map).set('family',e));if(void 0!==d){var f=d.id;b=this.O.has(f);Ud(this,d);if(b)return null;d=this.O.get(f);if(!d)return this.H.error(`Received a stream chunk for an unknown stream id: ${f}`),
467
467
  null;f=d.stream}this.G.has(a)&&({Gm:d}=this.G.get(a),this.G.delete(a),null==d||d(c,f));a=this.ua.get(e);if(void 0!==a)for(const g of a.values())g(c,f);return null}yb(){const a=Date.now();for(const [b,{kn:c}]of this.G)null!==c&&a-c>this.Ga&&(this.H.warn(`No response was received from the server for the seqId = ${b}`),Kd(this,b,'Message timeout: never receive acknowledge'))}};function ad(a){return olympe.D.Na(a.C)===olympe.N.rc.C.Ji}
468
468
  function Vd(a,b){const c=olympe.N.rc.C.Yl,d=olympe.N.rc.C.ee,e=olympe.N.rc.C.Rd,f=olympe.N.rc.C.yv,g=b.get('reconnectionDelay');Md(a.G,[olympe.N.La.C.INIT],()=>{Wd(a)?(a.C.update(c),a.connect().catch(h=>a.H.error(h))):a.G.disconnect().catch(h=>a.H.error(h))},!0);Md(a.G,[olympe.N.La.C.Rd],()=>{if(olympe.D.Na(a.C)===f)a.H.info('Disconnected, from orchestrator for shutdown');else if(a.C.update(a.F?d:e),Wd(a)&&a.O){const h=`Disconnected, will try to auto reconnect in ${g} ms`;a.F?a.H.log(h):a.H.error(h);
469
469
  setTimeout(()=>a.connect().catch(k=>a.H.error(k)),g)}else a.H.info('Disconnected, stay offline.')});a.T.F(()=>{a.C.update(f);return Promise.resolve()},'Connectivity manager: shutdown state')}function Wd(a){return null===a.storage.get(a.J+'olympe_manual_offline')}
470
470
  olympe.N.rc=class{constructor(a,b,c,d,e,f){this.H=a;this.G=b;this.T=d;this.storage=e;this.C=olympe.D.ec(Number).update(olympe.N.rc.C.INIT);this.F=f.get('offlineEnabled');this.O=f.get('offlineAutoBackOnline');this.J=f.get('storagePrefix');Vd(this,f)}Kf(){const a=olympe.N.rc.C.Ji,b=olympe.N.rc.C.ee,c=olympe.N.rc.C.Rd;let d=olympe.D.fa.C;return olympe.D.va([this.C],e=>{if(e===a)d=olympe.D.fa.F;else if(e===b||e===c)d=olympe.D.fa.C;return d},olympe.D.fa)}getState(){return this.C.sb()}connect(){const a=
471
471
  this;return v(function*(){const b=olympe.N.rc.C.Ji,c=olympe.N.rc.C.Yl;olympe.D.Na(a.C)!==b&&(a.C.update(c),a.storage.delete(a.J+'olympe_manual_offline'),yield a.G.connect(),yield Xd(),a.C.update(b))})}disconnect(){const a=this;return v(function*(){const b=olympe.N.rc.C.ee,c=olympe.N.rc.C.Yl;if(!a.F)throw Error('Try to go offline manually while the process does not support it. Please add `offline.enabled=true` in the config');a.storage.set(a.J+'olympe_manual_offline','true');olympe.D.Na(a.C)!==b&&
472
- (a.C.update(c),yield olympe.N.Wh().disconnect(),yield a.G.disconnect())})}};olympe.N.rc.C={INIT:0,Yl:1,Ji:2,ee:3,Rd:4,yv:5};olympe.N.rc.F='olympe_manual_offline';olympe.N.cb=class{constructor(a,b,c,d,e){this.ce=c;this.F=a;this.source=b;this.messageType=d;this.C=null!=e?e:null}static F(a,b,c){let d;var e=olympe.N.cb,f=a.dest,g=a.src,h=a.seq,k=a.type;b.T=c;return new e(f,g,h,k,b.O(null!=(d=a.content)?d:null))}jc(){return this.F}tb(){return this.source}getType(){return this.messageType}ha(a,b){const c={dest:this.F,src:this.source,seq:this.ce,type:this.messageType};null!==this.C&&(a.Z=b,c.content=a.ha(this.C));return c}toString(){return`Message(dest: ${this.F}, src: ${this.source}, seqId: ${this.ce}, type: ${this.messageType})`}};
473
- olympe.N.cb.C={SEND:0,GET:1,SUBSCRIBE:2,PUBLISH:3,ir:4,$f:5,sm:6,xb:7,Sk:10,Kq:11,ar:12,ve:13,wm:14};olympe.N.jk=class extends olympe.N.cb{constructor(a,b,c,d,e,f){super(a,b,d,e,f);this.G=c}static F(a,b,c){let d;var e=olympe.N.jk,f=a.dest,g=a.src,h=a.auth,k=a.seq,l=a.type;b.T=c;return new e(f,g,h,k,l,b.O(null!=(d=a.content)?d:null))}le(){return this.G}ha(a,b){return Object.assign(super.ha(a,b),{auth:this.G})}};olympe.N.jk.Di={SEND:0,GET:1,PUBLISH:2,SUBSCRIBE:3,ve:4,wm:5};const Yd=olympe.N.cb.C.SEND,Zd=olympe.N.cb.C.GET,$d=olympe.N.cb.C.SUBSCRIBE,ae=olympe.N.cb.C.ve,be=olympe.N.cb.C.Kq,ce=olympe.N.cb.C.xb,de=olympe.N.cb.C.ir,ee=olympe.N.cb.C.sm,fe=olympe.N.cb.C.ar;
472
+ (a.C.update(c),yield olympe.N.Wh().disconnect(),yield a.G.disconnect())})}};olympe.N.rc.C={INIT:0,Yl:1,Ji:2,ee:3,Rd:4,yv:5};olympe.N.rc.F='olympe_manual_offline';olympe.N.eb=class{constructor(a,b,c,d,e){this.ce=c;this.F=a;this.source=b;this.messageType=d;this.C=null!=e?e:null}static F(a,b,c){let d;var e=olympe.N.eb,f=a.dest,g=a.src,h=a.seq,k=a.type;b.T=c;return new e(f,g,h,k,b.O(null!=(d=a.content)?d:null))}jc(){return this.F}tb(){return this.source}getType(){return this.messageType}ha(a,b){const c={dest:this.F,src:this.source,seq:this.ce,type:this.messageType};null!==this.C&&(a.Z=b,c.content=a.ha(this.C));return c}toString(){return`Message(dest: ${this.F}, src: ${this.source}, seqId: ${this.ce}, type: ${this.messageType})`}};
473
+ olympe.N.eb.C={SEND:0,GET:1,SUBSCRIBE:2,PUBLISH:3,ir:4,$f:5,sm:6,xb:7,Sk:10,Kq:11,ar:12,ve:13,wm:14};olympe.N.jk=class extends olympe.N.eb{constructor(a,b,c,d,e,f){super(a,b,d,e,f);this.G=c}static F(a,b,c){let d;var e=olympe.N.jk,f=a.dest,g=a.src,h=a.auth,k=a.seq,l=a.type;b.T=c;return new e(f,g,h,k,l,b.O(null!=(d=a.content)?d:null))}le(){return this.G}ha(a,b){return Object.assign(super.ha(a,b),{auth:this.G})}};olympe.N.jk.Di={SEND:0,GET:1,PUBLISH:2,SUBSCRIBE:3,ve:4,wm:5};const Yd=olympe.N.eb.C.SEND,Zd=olympe.N.eb.C.GET,$d=olympe.N.eb.C.SUBSCRIBE,ae=olympe.N.eb.C.ve,be=olympe.N.eb.C.Kq,ce=olympe.N.eb.C.xb,de=olympe.N.eb.C.ir,ee=olympe.N.eb.C.sm,fe=olympe.N.eb.C.ar;
474
474
  olympe.N.Sc=class{constructor(a,b,c){this.C=a;this.F=b;this.J=c;this.G=null}ei(){return null!==this.G?Promise.resolve(this.G):rd(this.F,this.C).then(a=>this.G=a)}ks(){return this.C.getType()}source(){return this.C.tb()}body(){return this.C.C}ur(){return this.C.getType()===Yd?this.F.qd(this.C,be):Promise.reject('Should only call `ack` on SEND requests')}qd(a){const b=this.C.getType();return b===Zd||b===ae?this.F.qd(this.C,de,a):Promise.reject('Should only call `reply` on GET requests')}en(a){if(this.C.getType()!==
475
475
  $d)return Promise.reject('Should only call `notifyOn` on SUBSCRIBE requests');const b=olympe.Y.Mc();return new Promise((c,d)=>{const e={seq:md(this.F,f=>{switch(f.getType()){case fe:ge(this.J,b);c(b);break;case ce:d(f.C.reason);break;default:d('Unsupported response type for a SUBSCRIBE request')}}),topic:a,id:b,refresh:this.F.Uc};this.F.qd(this.C,ee,e).catch(d)})}Th(a){return this.F.qd(this.C,ce,{reason:a.message})}};olympe.N.Sc.prototype.fail=olympe.N.Sc.prototype.Th;
476
476
  olympe.N.Sc.prototype.notifyOn=olympe.N.Sc.prototype.en;olympe.N.Sc.prototype.reply=olympe.N.Sc.prototype.qd;olympe.N.Sc.prototype.ack=olympe.N.Sc.prototype.ur;olympe.N.Sc.prototype.body=olympe.N.Sc.prototype.body;olympe.N.Sc.prototype.source=olympe.N.Sc.prototype.source;olympe.N.Sc.prototype.requestType=olympe.N.Sc.prototype.ks;olympe.N.Sc.prototype.userTag=olympe.N.Sc.prototype.ei;function sd(a){const b=olympe.N.errors.Gi;a.C.forEach((c,d)=>{qd(a,d);null==c||c(new b(`Subscription ${d} to be refreshed`,d))})}function fd(a){if(null!==a.F){var b=a.F;a.F=null;clearInterval(b)}}function gd(a,b){b&&a.cf();null===a.F&&(a.F=setInterval(a.cf.bind(a),a.G))}function qd(a,b){b=a.C.delete(b);0===a.C.size&&fd(a);return b}function he(a,b){a.C.forEach((c,d)=>{qd(a,d);c(b)})}
477
- olympe.N.Iv=class{constructor(a,b,c,d){this.H=a;this.J=b;this.O=c;this.G=d;this.C=new Map;this.F=null}cf(){const a=olympe.N.errors.Gi;$c(this.J)?this.J.request(this.O,olympe.N.cb.C.ve,Array.from(this.C.keys())).then(b=>{b=b.C;0<b.length&&b.forEach(c=>{const d=this.C.get(c);qd(this,c);null==d||d(new a('Subscription does not exist in the service.',c))})}).catch(b=>{b=`Impossible to keep alive subscriptions: ${b}`;this.H.error(b);he(this,Error(b))}):fd(this)}};function Q(a,b){return{t:a,v:b}}
478
- olympe.N.fc=class{constructor(){this.T=this.Z=null}ha(a){a=this.F(a);this.Z=null;return a}O(a){a=this.C(a);this.T=null;return a}F(a){switch(!0){case null===a:case void 0===a:return null;case 'string'===typeof a:case 'boolean'===typeof a:case 'number'===typeof a:return a;case a instanceof olympe.D.fb:return Q(olympe.N.fc.C.kl,a.valueOf().toISOString());case a instanceof Date:return Q(olympe.N.fc.C.kl,a.toISOString());case a instanceof olympe.D.Color:return Q(olympe.N.fc.C.COLOR,a.toJSON());case a instanceof
477
+ olympe.N.Iv=class{constructor(a,b,c,d){this.H=a;this.J=b;this.O=c;this.G=d;this.C=new Map;this.F=null}cf(){const a=olympe.N.errors.Gi;$c(this.J)?this.J.request(this.O,olympe.N.eb.C.ve,Array.from(this.C.keys())).then(b=>{b=b.C;0<b.length&&b.forEach(c=>{const d=this.C.get(c);qd(this,c);null==d||d(new a('Subscription does not exist in the service.',c))})}).catch(b=>{b=`Impossible to keep alive subscriptions: ${b}`;this.H.error(b);he(this,Error(b))}):fd(this)}};function Q(a,b){return{t:a,v:b}}
478
+ olympe.N.fc=class{constructor(){this.T=this.Z=null}ha(a){a=this.F(a);this.Z=null;return a}O(a){a=this.C(a);this.T=null;return a}F(a){switch(!0){case null===a:case void 0===a:return null;case 'string'===typeof a:case 'boolean'===typeof a:case 'number'===typeof a:return a;case a instanceof olympe.D.gb:return Q(olympe.N.fc.C.kl,a.valueOf().toISOString());case a instanceof Date:return Q(olympe.N.fc.C.kl,a.toISOString());case a instanceof olympe.D.Color:return Q(olympe.N.fc.C.COLOR,a.toJSON());case a instanceof
479
479
  Map:return a=Object.fromEntries(Array.from(a).map(([c,d])=>[c,this.F(d)])),Q(olympe.N.fc.C.Gp,a);case a instanceof Set:return a=Array.from(a).map(this.F.bind(this)),Q(olympe.N.fc.C.Ig,a);case Array.isArray(a):return a.map(this.F.bind(this));case a instanceof ArrayBuffer:return a=olympe.Y.Xe().C(new Uint8Array(a)),Q(olympe.N.fc.C.ARRAY_BUFFER,a);case a instanceof Uint8Array:return a=olympe.Y.Xe().C(a),Q(olympe.N.fc.C.Ti,a);case a instanceof olympe.Y.stream.Eg:if(!this.Z)throw Error('No stream handler has been set, so cannot serialize the stream.');
480
480
  let b;return Q(olympe.N.fc.C.$f,null==(b=this.Z)?void 0:b.call(this,a));case 'object'===typeof a:return a=Object.entries(a).reduce((c,[d,e])=>{c[d]=this.F(e);return c},{}),Q(olympe.N.fc.C.Up,a);default:throw Error(`Impossible to serialize the following value: ${a}`);}}C(a){switch(!0){case null===a:case void 0===a:return null;case 'string'===typeof a:case 'boolean'===typeof a:case 'number'===typeof a:return a}if(Array.isArray(a))return a.map(d=>this.C(d));if('object'!==typeof a)throw new olympe.N.errors.Ao(`Impossible to deserialize the following value: ${a}`);
481
481
  const {t:b,v:c}=a;switch(b){case olympe.N.fc.C.kl:return new Date(c);case olympe.N.fc.C.COLOR:return olympe.D.Color.Pb(c);case olympe.N.fc.C.Gp:return new Map(Object.entries(c).map(([e,f])=>[e,this.C(f)]));case olympe.N.fc.C.Ig:return new Set(c.map(e=>this.C(e)));case olympe.N.fc.C.ARRAY_BUFFER:return olympe.Y.Xe().F(c).buffer;case olympe.N.fc.C.Ti:return olympe.Y.Xe().F(c);case olympe.N.fc.C.$f:if(!this.T)throw Error('No stream handler has been set, so cannot deserialize the stream.');let d;return null==
482
- (d=this.T)?void 0:d.call(this,c);case olympe.N.fc.C.Up:return Object.entries(c).reduce((e,[f,g])=>{e[f]=this.C(g);return e},{});default:throw new olympe.N.errors.Ao(`Impossible to deserialize the following value: ${c}`);}}};olympe.N.fc.C={kl:1,COLOR:2,Gp:3,Ig:4,ARRAY_BUFFER:5,Ti:6,$f:7,Up:8};const ie=olympe.N.cb.C.SEND,je=olympe.N.cb.C.GET,ke=olympe.N.cb.C.PUBLISH,le=olympe.N.cb.C.SUBSCRIBE,me=olympe.N.cb.C.ve,ne=olympe.N.cb.C.wm,oe=olympe.N.cb.C.Kq,pe=olympe.N.cb.C.Sk,qe=olympe.N.cb.C.xb,re=olympe.N.cb.C.ir,se=olympe.N.cb.C.sm;function ge(a,b){a.C||(a.C=Ya(new olympe.Y.um(a.F.Uc+3E4),c=>{let d;null==(d=a.G)||d.call(a,c)}));a.C.add(b)}
483
- function te(a,b){const c=olympe.N.cb.C.sm,d=olympe.N.cb.C.ar;return b.getType()!==c?Promise.reject('Should only call `topicAck` on TOPIC responses'):a.send(b.C.seq,b.tb(),d,null,!0)}function ue(a){let b,c;a=null!=(c=null==(b=a.C)?void 0:b.reason)?c:'Unknown reason';return'Timeout'===a?new olympe.N.errors.nk(a):Error(a)}
484
- olympe.N.wb=class{constructor(a,b){this.F=olympe.N.Wh();this.J=a;this.G=this.C=null;this.O=new olympe.D.Xb(`Service ${a}`,'function'===typeof b.F?b.F():b);this.H=olympe.ka.ib(`Service ${this.J}`)}static observe(a,b,c,d={}){const e='function'===typeof b.F?b.F():b,f=olympe.N.Wh();return(new rxjs.Observable(g=>{let h=null,k=null;const l=()=>{g.complete();k&&pd(f,a,k);h&&nd(f,h).catch(n=>olympe.ka.ib('Service '+a).error('Failed to unsubscribe from a topic '+n))};e.Z(l);f.request(a,le,c,d.timeout).then(n=>
482
+ (d=this.T)?void 0:d.call(this,c);case olympe.N.fc.C.Up:return Object.entries(c).reduce((e,[f,g])=>{e[f]=this.C(g);return e},{});default:throw new olympe.N.errors.Ao(`Impossible to deserialize the following value: ${c}`);}}};olympe.N.fc.C={kl:1,COLOR:2,Gp:3,Ig:4,ARRAY_BUFFER:5,Ti:6,$f:7,Up:8};const ie=olympe.N.eb.C.SEND,je=olympe.N.eb.C.GET,ke=olympe.N.eb.C.PUBLISH,le=olympe.N.eb.C.SUBSCRIBE,me=olympe.N.eb.C.ve,ne=olympe.N.eb.C.wm,oe=olympe.N.eb.C.Kq,pe=olympe.N.eb.C.Sk,qe=olympe.N.eb.C.xb,re=olympe.N.eb.C.ir,se=olympe.N.eb.C.sm;function ge(a,b){a.C||(a.C=Ya(new olympe.Y.um(a.F.Uc+3E4),c=>{let d;null==(d=a.G)||d.call(a,c)}));a.C.add(b)}
483
+ function te(a,b){const c=olympe.N.eb.C.sm,d=olympe.N.eb.C.ar;return b.getType()!==c?Promise.reject('Should only call `topicAck` on TOPIC responses'):a.send(b.C.seq,b.tb(),d,null,!0)}function ue(a){let b,c;a=null!=(c=null==(b=a.C)?void 0:b.reason)?c:'Unknown reason';return'Timeout'===a?new olympe.N.errors.nk(a):Error(a)}
484
+ olympe.N.wb=class{constructor(a,b){this.F=olympe.N.Wh();this.J=a;this.G=this.C=null;this.O=new olympe.D.Xb(`Service ${a}`,'function'===typeof b.F?b.F():b);this.H=olympe.ka.ab(`Service ${this.J}`)}static observe(a,b,c,d={}){const e='function'===typeof b.F?b.F():b,f=olympe.N.Wh();return(new rxjs.Observable(g=>{let h=null,k=null;const l=()=>{g.complete();k&&pd(f,a,k);h&&nd(f,h).catch(n=>olympe.ka.ab('Service '+a).error('Failed to unsubscribe from a topic '+n))};e.Z(l);f.request(a,le,c,d.timeout).then(n=>
485
485
  {switch(n.getType()){case se:const p=n.C;h=p.topic;bd(f,h,q=>{q.getType()===ke?g.next(q.C):(g.error('Unsupported notification message. It should be a publish'),l())}).then(()=>{k=p.id;od(f,a,k,p.refresh,q=>g.error(q));te(f,n).catch(q=>{g.error(`Was unable to ack the subscription: ${q}`);l()})}).catch(q=>{g.error(`Was not able to subscribe to notification topic ${h}: ${q}`);l()});break;case qe:g.error(ue(n));break;default:g.error('Unsupported response type for a SUBSCRIBE request')}}).catch(n=>g.error(n));
486
- return l})).pipe(eb(olympe.N.errors.Gi,(g,h)=>{olympe.ka.ib(`Service ${a}`).debug(`Subscribed to topic ${g.U()} now that we are back online, after waiting for ${h}ms`);let k;null==(k=d.onRetry)||k.call(d)}))}qs(a){this.G=a;return this}stop(){this.O.destroy()}clear(){nd(this.F,this.J).catch(b=>this.H.error('Failed to unsubscribe from '+this.J+', error: '+b));if(this.G){let b;null==(b=this.C)||b.forEach(c=>{let d;return null==(d=this.G)?void 0:d.call(this,c)})}let a;null==(a=this.C)||a.clear()}static publish(a,
486
+ return l})).pipe(eb(olympe.N.errors.Gi,(g,h)=>{olympe.ka.ab(`Service ${a}`).debug(`Subscribed to topic ${g.U()} now that we are back online, after waiting for ${h}ms`);let k;null==(k=d.onRetry)||k.call(d)}))}qs(a){this.G=a;return this}stop(){this.O.destroy()}clear(){nd(this.F,this.J).catch(b=>this.H.error('Failed to unsubscribe from '+this.J+', error: '+b));if(this.G){let b;null==(b=this.C)||b.forEach(c=>{let d;return null==(d=this.G)?void 0:d.call(this,c)})}let a;null==(a=this.C)||a.clear()}static publish(a,
487
487
  b){return v(function*(){yield olympe.N.Wh().request(a,ke,b)})}static send(a,b,c={}){return olympe.N.Wh().request(a,ie,b,c.timeout).then(d=>{switch(d.getType()){case oe:break;case qe:throw ue(d);default:throw Error('Unsupported response type for a SEND request');}})}static get(a,b,c={}){return olympe.N.Wh().request(a,je,b,c.timeout).then(d=>{switch(d.getType()){case re:d=d.C;if(null!==d)return d;throw Error('No payload after request to service: '+a);case qe:throw ue(d);default:throw Error('Unsupported response type for a GET request');
488
488
  }})}listen(){return new rxjs.Observable(a=>{const b=()=>{a.complete();this.clear()};this.O.onDestroy(b);bd(this.F,this.J,c=>{const d=new olympe.N.Sc(c,this.F,this);switch(c.getType()){case me:var e=d.body().filter(g=>{let h;return!(null==(h=this.C)?0:Xa(h,g))});d.qd(e).catch(g=>this.H.error('Not able to validate subscription keep alive',g));break;case ne:c=d.body();null==(e=this.C)||e.delete(c);let f;null==(f=this.G)||f.call(this,c);break;case ke:a.next(d);break;default:this.F.qd(c,pe).then(()=>a.next(d))}}).catch(c=>
489
489
  {c='Failed to connect to the bus: '+c;this.H.error(c);a.error(Error(c))});return b})}};olympe.N.wb.prototype.listen=olympe.N.wb.prototype.listen;olympe.N.wb.get=olympe.N.wb.get;olympe.N.wb.send=olympe.N.wb.send;olympe.N.wb.publish=olympe.N.wb.publish;olympe.N.wb.prototype.stop=olympe.N.wb.prototype.stop;olympe.N.wb.prototype.setUnsubscriptionHandler=olympe.N.wb.prototype.qs;olympe.N.wb.observe=olympe.N.wb.observe;olympe.N.eq=class{constructor(a){this.C=0;this.buffer=[];this.size=null;this.stream=new olympe.Y.stream.Eg;this.F=null!=a?a:()=>{}}write(a,b){const c=this;return v(function*(){if(b<c.C||null!==c.size&&b>=c.size)throw Error(`Received stream chunk with unexpected index = ${b}. That index has already been processed. Next expected once is ${c.C}`);for(c.buffer[b-c.C]=a;void 0!==c.buffer[0];){c.C++;const d=c.buffer.shift();yield c.stream.write(d)}c.C===c.size&&(c.F(),c.stream.complete())})}complete(a){if(null!==
490
- this.size)throw Error('The stream has already been completed');if(a<this.C+this.buffer.length)throw Error(`The stream has already reached element n\u00b0${this.C+this.buffer.length}, specified index must be greater or equal to it.`);this.size=a;this.C===this.size&&(this.F(),this.stream.complete())}throw(a){this.F();this.stream.throw(a)}};olympe.N.we={qg:1,Rf:2,xb:3,xg:4,Cz:5,Oj:6,Gb:7};olympe.N.Di={Oj:1,Tv:2,rt:3,ve:5,ev:1,YC:2};olympe.N.Ce={qg:0,Vf:1,xb:2};olympe.N.La.C={INIT:'initialize',CONNECTING:'connecting',Rd:'disconnected',vo:'disconnecting',ng:'connected',Cg:'reconnecting',rk:'waking',Dn:'awake',xb:'error'};olympe.N.La.G={xh:1,ut:-1,Lt:-2,Kv:-3};olympe.N.La.F={Ni:0,Kt:23};
491
- olympe.N.La.Gb={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',
490
+ this.size)throw Error('The stream has already been completed');if(a<this.C+this.buffer.length)throw Error(`The stream has already reached element n\u00b0${this.C+this.buffer.length}, specified index must be greater or equal to it.`);this.size=a;this.C===this.size&&(this.F(),this.stream.complete())}throw(a){this.F();this.stream.throw(a)}};olympe.N.we={qg:1,Rf:2,xb:3,xg:4,Cz:5,Oj:6,Hb:7};olympe.N.Di={Oj:1,Tv:2,rt:3,ve:5,ev:1,YC:2};olympe.N.Ce={qg:0,Vf:1,xb:2};olympe.N.La.C={INIT:'initialize',CONNECTING:'connecting',Rd:'disconnected',vo:'disconnecting',ng:'connected',Cg:'reconnecting',rk:'waking',Dn:'awake',xb:'error'};olympe.N.La.G={xh:1,ut:-1,Lt:-2,Kv:-3};olympe.N.La.F={Ni:0,Kt:23};
491
+ olympe.N.La.Hb={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',
492
492
  18:'Try to unsubscribe multiple times',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.N.R={ff:'com.ConnectivityManager',fk:'com.ServerManager',On:'com.BusManager',yl:'com.HttpManager',Be:'com.Serializer',Ca:'com.Logger',Rq:'com.Source',cr:'com.Urls',wB:'com.peerFileSvcUrl'};
493
493
  olympe.N.V={ml:'defaultHost',qv:'server.host',tv:'server.port',uv:'server.ssl',Lq:'server.basePath',lr:'server.wsPath',em:'server.reconnectionDelay',gq:'server.pingInterval',kr:'server.messageTimeout',zq:'server.retryHttpOnOverload',el:'server.clientVersion',Oq:'server.serverVersion',vv:'server.wakeUpService',Ls:'bus.host',Ms:'bus.path',Ns:'bus.port',Ps:'bus.vhost',Os:'bus.ssl',ve:'bus.keepalive',hv:'bus.reschedulePings',Us:'bus.clientId',Ss:'bus.clean',Xs:'bus.connectTimeout',Qn:'bus.shortTimeout',
494
494
  Pn:'bus.requestTimeout',Rn:'bus.subscriptionRefreshRate',bv:'bus.queueQoSZero',Zk:'bus.allowGuest',br:'bus.topicPrefix'};
@@ -506,22 +506,22 @@ olympe.N.we.xg,Object.assign({},{c:olympe.auth.jd.C.vu},d&&{idpName:d}),c)}funct
506
506
  function ze(a,b,c){if(b.wg()!==olympe.auth.Ec.C.OAUTH2)c(Error('Only oAuth2 tokens can be refreshed'),null);else{var d=`?idpName=${b.nf()}&access_token=${xe(b)}`;d=`${Dd(a.th,olympe.N.Zb.Tj)}/refresh${d}`;Fd(a.th,N(d),b.wd()).then(e=>{'string'===typeof e?(e=JSON.parse(e),e=new olympe.auth.Wj(b.Bc(),b.me(),b.wd(),e,b.nf()),c(null,e)):c(null,b)}).catch(e=>c(Error(e),null))}}
507
507
  olympe.auth.jd=class{constructor(a,b,c,d,e,f){this.H=a;this.C=b;this.th=c;this.J=d;this.F=e;this.G=f;Ae(this.G).then(g=>{g&&this.G.db.remove('main','redirectTo').then(()=>{this.F.redirect(g,null,olympe.auth.ek.C.GET)}).catch(h=>{this.H.error(`Error when trying to remove redirect key from AUTH storage: ${h}`)})}).catch(g=>{this.H.error(`Error when trying to get redirect key from AUTH storage: ${g}`)})}cf(a){Od(this.C,olympe.N.we.xg,{c:olympe.auth.jd.C.ve},b=>a(b))}Yg(a,b,c){const d=Dd(this.th,olympe.N.Zb.er);
508
508
  a=N(`${d}/${a}`);Fd(this.th,a,b).then(e=>c(null,e)).catch(e=>c(Error(e)))}};olympe.auth.jd.C={xg:1,vu:2,xb:3,ve:5,Ni:6,Ct:10,Cv:11,zs:12,SAML:13,ov:14,uu:20};function td(a,b){var c='busLogoutCallback';void 0===c&&(c=olympe.Y.Vh());a.ja.set(c,b)}function jd(a){return olympe.D.Na(a.C.sb())}
509
- function Xd(){var a=olympe.auth.je();const b=olympe.auth.Ta.C.uj,c=olympe.auth.Ta.C.INIT;Be(a,b);a.ab?(a.G=olympe.auth.Ta.G.ys,a.H.log('Connector online, parameter auth.autoLogin=true --\x3e attempting to log with parameters'),Ce(a)):(a.G=olympe.auth.Ta.G.Pi,a.H.log('Connector online, attempting to log with token'),De(a));return rxjs.firstValueFrom(a.F.sb().asObservable().pipe(rxjs.operators.filter(d=>!(d===b||d===c)))).catch(()=>{})}
510
- function Ee(a){a.H.info('Initializing AUTH layer');let b=a.hc;if(a.ea){const c=a.ea.F();b=null!=c?c:b;c&&a.ea.C().then(()=>{})}b&&a.storage&&Fe(a.storage,b).catch(c=>a.H.error(c));a.H.debug('Asking to be notified when auth connector gets online');olympe.D.Nc([a.gb.getState()],c=>{switch(c){case olympe.N.rc.C.ee:a.G=olympe.auth.Ta.G.Pi;a.H.log('Connector offline, attempting to recover sessions from current token');De(a);break;case olympe.N.rc.C.Rd:switch(olympe.D.Na(a.F)){case olympe.auth.Ta.C.df:c=
509
+ function Xd(){var a=olympe.auth.je();const b=olympe.auth.Ta.C.uj,c=olympe.auth.Ta.C.INIT;Be(a,b);a.bb?(a.G=olympe.auth.Ta.G.ys,a.H.log('Connector online, parameter auth.autoLogin=true --\x3e attempting to log with parameters'),Ce(a)):(a.G=olympe.auth.Ta.G.Pi,a.H.log('Connector online, attempting to log with token'),De(a));return rxjs.firstValueFrom(a.F.sb().asObservable().pipe(rxjs.operators.filter(d=>!(d===b||d===c)))).catch(()=>{})}
510
+ function Ee(a){a.H.info('Initializing AUTH layer');let b=a.hc;if(a.ea){const c=a.ea.F();b=null!=c?c:b;c&&a.ea.C().then(()=>{})}b&&a.storage&&Fe(a.storage,b).catch(c=>a.H.error(c));a.H.debug('Asking to be notified when auth connector gets online');olympe.D.Nc([a.hb.getState()],c=>{switch(c){case olympe.N.rc.C.ee:a.G=olympe.auth.Ta.G.Pi;a.H.log('Connector offline, attempting to recover sessions from current token');De(a);break;case olympe.N.rc.C.Rd:switch(olympe.D.Na(a.F)){case olympe.auth.Ta.C.df:c=
511
511
  olympe.D.Na(a.C).Bc();Ge(a,`Disconnected from server - session of user ${c} lost`);break;case olympe.auth.Ta.C.si:a.H.info('Disconnected from server - guest session lost');break;case olympe.auth.Ta.C.uj:Ge(a,'Disconnected from server - authentication aborted');break;case olympe.auth.Ta.C.INIT:Ge(a,'Cannot open auth session - no server connection');break;default:Ge(a,'Should not get there, investigate',!0)}}});ve(a.J,(c,d)=>{if(c===olympe.auth.Ta.F.tj)Ge(a,'authentication revoked'),a.storage&&He(a.storage),
512
512
  a.ja.forEach(e=>{e(c,d)});else if(c===olympe.auth.Ta.F.kp)a.H.info('Redirection to IDP to invalidate token (SAML)'),jd(a),a.storage&&He(a.storage),a.yb.F();else throw Error(`Unknown logout step coming from server : ${c}`);});a.Ga=Ie(a);a.T.F(()=>a.bi().catch(c=>a.H.error(`Failed to logout ${c}`)),'Logout');a.H.log('DONE initializing AUTH layer (waiting for connector to be online)')}
513
513
  function Je(a,b){let c=null;olympe.D.ij(a.F.sb().Ad(olympe.auth.Ta.C.df).and(b),()=>{const d=jd(a);!Ke(a)&&d&&(c=a.Od.get(d.wg()).J(d,(e,f)=>{e?(a.H.error('Failed to refresh token, error message: ',e.message),a.bi().catch(g=>a.H.error(`Failed to logout after wrong refresh ${g}`))):f&&Le(a,f)}))},()=>{let d;null==(d=c)||d()})}
514
514
  function De(a){null!==a.storage?(a.H.debug('Retrieving token from local storage'),a.storage.le().then(b=>{if(b){const e=new olympe.auth.Request;var c=b.Bc();e.set('username',c);c=e;var d=b.wd();c.set('nonce',d);'string'===typeof b.nf()&&e.set('idpName',b.nf());a.H.debug('Token found, trying login with',e);Me(a,e,olympe.auth.Ec.C.Ul)}else Ge(a,'No token found, cannot perform auto login')}).catch(b=>{Ge(a,b.message,!0)})):Ge(a,'Cannot retrieve token: no storage configured, cannot perform auto login',
515
- !0)}function Ge(a,b,c=!1){a.C.update(a.aa);Be(a,olympe.auth.Ta.C.si);b=`Authenticated as guest (${b})`;c?a.H.error(b):a.H.info(b)}function Ie(a){const b=[olympe.auth.Ta.C.df];a.ab||b.push(olympe.auth.Ta.C.si);return a.T.C(()=>{const c=Ne(a);return b.includes(c)?Promise.resolve('The auth manager is OK'):Promise.reject(`The auth manager is not in valid state, the current state is: ${c}`)})}function Be(a,b){a.H.log('State change: ',Ne(a),'--\x3e',b);a.F.update(b)}
516
- function Ce(a){if(a.Z){const b=new olympe.auth.Request;b.set('username',a.Z);b.set('password',a.Jb);a.H.log('Autologin with user "'+a.Z+'"');Me(a,b)}else Ge(a,'No user specified for auto login',!0)}function Ke(a){return olympe.D.Na(a.C)===a.aa}function Le(a,b){if(b){a.C.update(b);let c;null==(c=a.storage)||Fe(c,b).catch(d=>a.H.error(d));a.H.debug('Token updated')}}function Ne(a){return olympe.D.Na(a.F.sb())}function Oe(){var a=olympe.public.Ka.get();return new Map(a.J.C.Tc)}
515
+ !0)}function Ge(a,b,c=!1){a.C.update(a.aa);Be(a,olympe.auth.Ta.C.si);b=`Authenticated as guest (${b})`;c?a.H.error(b):a.H.info(b)}function Ie(a){const b=[olympe.auth.Ta.C.df];a.bb||b.push(olympe.auth.Ta.C.si);return a.T.C(()=>{const c=Ne(a);return b.includes(c)?Promise.resolve('The auth manager is OK'):Promise.reject(`The auth manager is not in valid state, the current state is: ${c}`)})}function Be(a,b){a.H.log('State change: ',Ne(a),'--\x3e',b);a.F.update(b)}
516
+ function Ce(a){if(a.Z){const b=new olympe.auth.Request;b.set('username',a.Z);b.set('password',a.Fb);a.H.log('Autologin with user "'+a.Z+'"');Me(a,b)}else Ge(a,'No user specified for auto login',!0)}function Ke(a){return olympe.D.Na(a.C)===a.aa}function Le(a,b){if(b){a.C.update(b);let c;null==(c=a.storage)||Fe(c,b).catch(d=>a.H.error(d));a.H.debug('Token updated')}}function Ne(a){return olympe.D.Na(a.F.sb())}function Oe(){var a=olympe.public.Ka.get();return new Map(a.J.C.Tc)}
517
517
  function Pe(a,b,c,d=!1){b=b+c?':'+c.message:'';a.H.error(b);a.error.update(olympe.D.Ab(b));Be(a,olympe.auth.Ta.C.xb);if(d)throw Error(b);}function Me(a,b,c,d){void 0===c&&(c=a.ac);void 0===c&&Pe(a,'No authentication provider specified',null,!0);const e=a.Od.get(c);e||Pe(a,'Undefined authentication provider "'+c+'"',null,!0);d&&a.O.set('login',d);a.H.log('Sending authentication request using "'+c+'" for '+b);e.le(b,a.Ub.bind(a));Be(a,olympe.auth.Ta.C.uj)}
518
518
  function Qe(a,b,c){a.O.forEach(d=>{d(b,c)})}
519
- olympe.auth.Ta=class{constructor(a,b,c,d,e,f,g,h,k,l){this.H=a;this.gb=b;this.J=c;this.storage=d;this.yb=e;this.ea=f;this.ac=l.get('defaultProvider');this.ab=!!l.get('autoLogin');this.Z=l.get('autoUser');this.Jb=l.get('autoPassword');this.hc=l.get('autoToken');this.Od=new Map;this.T=g;this.Ga='';this.F=olympe.D.ec(String).update(olympe.auth.Ta.C.INIT);this.error=olympe.D.ec(olympe.D.Pa);this.G=null;this.aa=new olympe.auth.Ng('guest','0163d9653067b6237f62','e96e099c-55bb-4004-b0e8-bd76b6209218');this.C=
519
+ olympe.auth.Ta=class{constructor(a,b,c,d,e,f,g,h,k,l){this.H=a;this.hb=b;this.J=c;this.storage=d;this.yb=e;this.ea=f;this.ac=l.get('defaultProvider');this.bb=!!l.get('autoLogin');this.Z=l.get('autoUser');this.Fb=l.get('autoPassword');this.hc=l.get('autoToken');this.Od=new Map;this.T=g;this.Ga='';this.F=olympe.D.ec(String).update(olympe.auth.Ta.C.INIT);this.error=olympe.D.ec(olympe.D.Qa);this.G=null;this.aa=new olympe.auth.Ng('guest','0163d9653067b6237f62','e96e099c-55bb-4004-b0e8-bd76b6209218');this.C=
520
520
  olympe.D.ec(olympe.auth.Ng).update(this.aa);this.O=new Map;this.ja=new Map;this.ua=new olympe.Y.Hh(l.get('cacheTokenTimeout'));k.forEach(n=>{const p=n.G();if(this.Od.has(p))throw Error('Provider "'+p+'" has already been registered !');this.Od.set(p,n)});Ee(this);Je(this,h.C())}Jk(){const a=olympe.auth.Ta.C.df,b=olympe.auth.Ta.C.si,c=olympe.auth.Ta.C.xb,d=olympe.D.ec(olympe.D.fa);olympe.D.Nc([this.F],e=>{e===a?d.update(olympe.D.fa.F):e===b?d.update(olympe.D.fa.C):e===c?(this.H.error('Authentication failed.'),
521
521
  d.update(olympe.D.fa.C)):d.clear()});return d.sb()}hg(a){if(olympe.D.Na(this.F)===olympe.auth.Ta.C.df){var b=jd(this);!Ke(this)&&b&&this.Od.get(b.wg()).hg(b,(c,d)=>{c?(this.H.error('Failed to refresh token, error message: ',c.message),this.bi().catch(e=>this.H.error(`Failed to logout after wrong refresh ${e}`))):d&&Le(this,d);a(c)})}}getState(){return this.F.sb()}Bc(){return this.C.sb().Bc()}me(){return this.C.sb().me()}Yh(){return this.C.sb().Yh()}Yg(a,b){if(Xa(this.ua.C,a))b(null,this.ua.get(a));
522
522
  else{var c,d=null==(c=olympe.D.Na(this.C.sb()))?void 0:c.wd();this.J.Yg(a,d,(e,f)=>{'string'===typeof f&&this.ua.set(a,f);b(e,f)})}}bi(){return Ke(this)?(this.H.warn('Logout called for Guest user so it will be ignored'),Promise.resolve()):new Promise((a,b)=>{this.H.debug('Sending logout');He(this.storage);we(this.J,jd(this),c=>{c?(Pe(this,'Logout request rejected:',c),b(c)):(this.H.debug('Logout request acknowledged'),a())});this.T.G(this.Ga)})}cf(a){Ne(this)===olympe.auth.Ta.C.df&&this.J.cf(b=>{b&&
523
523
  this.H.error('Was not able to send the auth keep alive message:',b.message);null==a||a(b)})}Ub(a,b){const c=null===this.G?olympe.auth.Ta.G.Bu:this.G;this.G=null;if(!a||a instanceof olympe.N.errors.aq){null===a?this.H.info(`User ${b.Bc()} (#${b.me()}) successfully authenticated`):this.H.info(`User ${b.Bc()} (#${b.me()}) recovered from token, while offline`);this.C.update(b);Be(this,olympe.auth.Ta.C.df);Qe(this,a,c);let d;null==(d=this.storage)||Fe(d,b).catch(e=>this.H.error(e))}else{let d;null==(d=
524
- this.storage)||He(d).catch(e=>this.H.error(e));this.error.update(olympe.D.Ab(a.message));Ge(this,'authentication rejected: '+a.message);Qe(this,a,c)}this.O.has('login')&&this.O.delete('login')}};olympe.auth.Ta.C={INIT:'init',uj:'authenticating',si:'guest',df:'authenticated',xb:'error'};olympe.auth.Ta.G={Bu:'manual',ys:'auto',Pi:'tokenOnFirstConnection'};olympe.auth.Ta.F={tj:'accepted',kp:'redirect'};olympe.auth.Ec=class{constructor(a,b){this.H=a;this.F=b;this.C=null}G(){}le(){}J(a,b){const c=()=>{this.C=setTimeout(()=>this.F.cf(d=>{d?b(d,null):(b(null,null),c())}),this.F.C.Cc)};c();return()=>{this.C&&clearTimeout(this.C);this.C=null}}hg(a,b){this.F.cf(c=>{b(c,null)})}};olympe.auth.Ec.C={SAML:'saml',OAUTH2:'openID',SRP:'srp',Ul:'olympeToken'};function Re(a){return a.get('idpName')}olympe.auth.Request=class{constructor(){this.C=new Map}set(a,b){olympe.D.Nc([b],c=>{this.C.set(a.toLocaleLowerCase(),c.toString())})}get(a){(a=this.C.get(a.toLowerCase()))&&a.Og&&(a=a.Da.Fb);return a?a.valueOf():a}Bc(){return this.get('username')}wd(){return this.get('nonce')}toString(){return this.Bc()+(this.wd()?' with nonce':'')+(this.get('password')?' with password':'')+(Re(this)?` with idp name ${Re(this)}`:'')}};olympe.auth.Ng=class{constructor(a,b,c,d={},e=null){this.J=a;this.ei=b;this.F=c;this.C=e;this.G=d}Bc(){return this.J}me(){return this.ei}wd(){return this.F}zi(){return this.G}Yh(){return null}nf(){return this.C}ha(){const a=olympe.Y.Xe(),b=Object.assign({},{user:this.J,userTag:this.ei,nonce:this.F},this.C&&{idpName:this.C},{payload:this.G});return olympe.Y.vr(Ua(a,JSON.stringify(b)))}wg(){return olympe.auth.Ec.C.SRP}};m=olympe.auth.Ng.prototype;m.Bc.L=new olympe.D.K(()=>String,[]);
524
+ this.storage)||He(d).catch(e=>this.H.error(e));this.error.update(olympe.D.Ab(a.message));Ge(this,'authentication rejected: '+a.message);Qe(this,a,c)}this.O.has('login')&&this.O.delete('login')}};olympe.auth.Ta.C={INIT:'init',uj:'authenticating',si:'guest',df:'authenticated',xb:'error'};olympe.auth.Ta.G={Bu:'manual',ys:'auto',Pi:'tokenOnFirstConnection'};olympe.auth.Ta.F={tj:'accepted',kp:'redirect'};olympe.auth.Ec=class{constructor(a,b){this.H=a;this.F=b;this.C=null}G(){}le(){}J(a,b){const c=()=>{this.C=setTimeout(()=>this.F.cf(d=>{d?b(d,null):(b(null,null),c())}),this.F.C.Cc)};c();return()=>{this.C&&clearTimeout(this.C);this.C=null}}hg(a,b){this.F.cf(c=>{b(c,null)})}};olympe.auth.Ec.C={SAML:'saml',OAUTH2:'openID',SRP:'srp',Ul:'olympeToken'};function Re(a){return a.get('idpName')}olympe.auth.Request=class{constructor(){this.C=new Map}set(a,b){olympe.D.Nc([b],c=>{this.C.set(a.toLocaleLowerCase(),c.toString())})}get(a){(a=this.C.get(a.toLowerCase()))&&a.Og&&(a=a.Da.Gb);return a?a.valueOf():a}Bc(){return this.get('username')}wd(){return this.get('nonce')}toString(){return this.Bc()+(this.wd()?' with nonce':'')+(this.get('password')?' with password':'')+(Re(this)?` with idp name ${Re(this)}`:'')}};olympe.auth.Ng=class{constructor(a,b,c,d={},e=null){this.J=a;this.ei=b;this.F=c;this.C=e;this.G=d}Bc(){return this.J}me(){return this.ei}wd(){return this.F}zi(){return this.G}Yh(){return null}nf(){return this.C}ha(){const a=olympe.Y.Xe(),b=Object.assign({},{user:this.J,userTag:this.ei,nonce:this.F},this.C&&{idpName:this.C},{payload:this.G});return olympe.Y.vr(Ua(a,JSON.stringify(b)))}wg(){return olympe.auth.Ec.C.SRP}};m=olympe.auth.Ng.prototype;m.Bc.L=new olympe.D.K(()=>String,[]);
525
525
  m.me.L=new olympe.D.K(()=>String,[]);m.wd.L=new olympe.D.K(()=>String,[]);m.zi.L=new olympe.D.K(()=>Object,[]);m.Yh.L=new olympe.D.K(()=>String,[]);m.nf.L=new olympe.D.K(()=>String,[]);m.ha.L=new olympe.D.K(()=>String,[]);m.wg.L=new olympe.D.K(()=>String,[]);function xe(a){return a.zi().access_token||null}function Se(a){return 1E3*parseInt(a.zi().access_token_exp||'0',10)}olympe.auth.Wj=class extends olympe.auth.Ng{constructor(a,b,c,d,e){super(a,b,c,d,e);this.O=Date.now()}Yh(){return xe(this)}wg(){return olympe.auth.Ec.C.OAUTH2}};olympe.auth.Iq=class extends olympe.auth.Ng{constructor(a,b,c,d,e,f){super(a,b,c,e,f);this.O=d}Yh(){return this.O}wg(){return olympe.auth.Ec.C.SAML}ha(){const a=olympe.Y.Xe(),b=Object.assign({},{user:this.Bc(),userTag:this.me(),nonce:this.wd()},this.nf()&&{idpName:this.nf()},{payload:this.zi(),fullToken:this.O});return olympe.Y.vr(Ua(a,JSON.stringify(b)))}};function Ae(a){let b;return null!=(b=a.db.get('main','redirectTo'))?b:null}function Fe(a,b){return hb(a.F,()=>a.db.set('main','string'===typeof b?b:b.ha(),a.C).catch(c=>{throw Error(`Error when trying to set the token from the auth store: ${c}`);}))}function He(a){return hb(a.F,()=>a.db.remove('main',a.C).catch(b=>{a.H.error(`Error when trying to remove the token from the auth store: ${b}`)}))}
526
526
  olympe.auth.Fs=class{constructor(a,b,c){this.G=a;this.H=b;this.C='OlympeToken-'+c.C;this.F=new olympe.Y.promise.nm;this.db=this.G.F('AUTH')}le(){this.H.debug(`olympe.auth.AuthStorage: retrieve token with key ${this.C}`);return hb(this.F,()=>{const a=this;return v(function*(){let b;try{b=yield a.db.get('main',a.C)}catch(g){throw Error(`Error when trying to get the token from the auth store: ${g}`);}let c=null;if(b)try{a.H.debug('olympe.auth.AuthStorage: Token retrieved successfully');var d=JSON,e=
527
527
  d.parse;var f=Va(olympe.Y.Xe().F(olympe.Y.pw(b)));const g=e.call(d,f);let h;g.fullToken?h=new olympe.auth.Iq(g.user,g.userTag,g.nonce,g.fullToken,g.payload,g.idpName):g.payload&&g.payload.id_token?h=new olympe.auth.Wj(g.user,g.userTag,g.nonce,g.payload,g.idpName):h=new olympe.auth.Ng(g.user,g.userTag,g.nonce,g.payload,g.idpName);c=h}catch(g){throw Error(`Error while unserializing token: ${g}`);}else a.H.debug('olympe.auth.AuthStorage: No token found');return c})})}};olympe.auth.ek=class{redirect(){}F(){}C(){}};olympe.auth.ek.C={GET:'GET',Ah:'POST'};olympe.auth.Gn=class{constructor(a){this.C=a||'default'}};olympe.auth.Od={};function Te(a,b,c){ye(a.F,olympe.auth.jd.C.xg,{token:b.wd()},(d,e)=>{if(null!==d)c(d,null);else switch(e.c){case olympe.auth.jd.C.xb:c(Error('Invalid token'),null);break;case olympe.auth.jd.C.Ni:d=null;if(e=e.payload){const f=e.userName,g=e.userTag,h=e.rndCook,k=e.payload,l=e.protocol;'SAML'===l?d=new olympe.auth.Iq(f,g,h,e.samlToken,k,Re(b)):'openid'===l&&(d=new olympe.auth.Wj(f,g,h,k,Re(b)))}c(null,d);break;default:c(Error('Unknown response from server'),null)}})}
@@ -538,55 +538,55 @@ return v(function*(){let d,e;return null!=(e=null==(d=c.C.get(a))?void 0:d.has(b
538
538
  null==(c=b.C.get(a))||c.clear()})}J(){Ye();return Promise.resolve([])}F(){return v(function*(){Ye()})}};olympe.Ua.node.Db.Qp.ya=[olympe.Db.pu];olympe.Ua.node.Db.Rp=class{constructor(a){this.C=new Map;this.H=a}F(a){this.C.has(a)||this.C.set(a,new olympe.Ua.node.Db.Qp(this.H));return this.C.get(a)}};olympe.Ua.node.Db.Rp.ya=[olympe.Db.qu];olympe.W.config(function(a){C(a,olympe.Db.R.Pj,olympe.Ua.node.Db.Rp,olympe.Db.R.Ca)},'olympe.native.node.localstorage');olympe.Ua.node.storage={};olympe.Ua.node.storage.Storage=class{constructor(a){this.H=a}write(a,b,c,d,e){e&&e('Not Implemented.')}open(a){a(null)}close(a){a(null)}};olympe.Ua.node.storage.Storage.ya=[olympe.Db.Storage];olympe.W.config(function(a){Na(a,olympe.Db.R.Mi,olympe.Ua.node.storage.Storage,olympe.host.R.Ca)},'olympe.native.html.storage');olympe.gg={};olympe.gg.V={VERSION:'version.version',Js:'version.branch',ef:'version.commit',Jv:'version.tag',Oo:'version.olympe-framework',Ks:'version.build'};olympe.W.config(function(a){F(a,olympe.gg.V.VERSION,'');F(a,olympe.gg.V.Js,'');F(a,olympe.gg.V.ef,'');F(a,olympe.gg.V.Jv,'');F(a,olympe.gg.V.Oo,'');F(a,olympe.gg.V.Ks,'')},'olympe.main');const Ze=require('fs'),$e=require('fs/promises');let af;const bf=null!=(af=process.env.EXTRA_CONFIG_PATH)?af:null;let cf;const rb=null!=(cf=process.env.EXTRA_CONFIG_KEY_PREFIX)?cf:'';function qb(a){return $e.readFile(a,{encoding:'utf8'}).then(b=>'string'===typeof b?b:null).catch(()=>null)}
539
539
  function df(a){var b=ef;console.debug(`Start watching config files for changes: ${b}`);b.forEach(c=>{$e.access(c,Ze.constants.F_OK).then(()=>{Ze.watch(c,d=>v(function*(){if('change'===d){console.log(`Config file "${c}" has changed. Loading new configuration...`);try{const e=yield olympe.Y.cs([c]),f=olympe.W.Pr(e);for(const [g,h]of f)a.sj(g,h)}catch(e){console.error(`Failed to updated config from file ${c} with message: ${e.message}`)}}}))}).catch(()=>{})})}
540
540
  function ff(){console.log('The node process received a signal for graceful shutdown');let a,b;null==(b=(a=olympe.Ua.node.host).Dk)||Ec(b.call(a)).then(()=>console.log('The node backend has stopped successfully')).catch(c=>console.warn(c)).finally(()=>process.exit(0))}process.on('SIGTERM',ff);process.on('SIGINT',ff);process.on('SIGBREAK',ff);process.on('SIGHUP',ff);process.on('uncaughtException',a=>{console.error('Uncaught Exception:',a);ff()});const ef=['oConfig.json','conf.d/oConfig.json','version.json'];
541
- bf&&ef.push(bf);olympe.Y.cs(ef).catch(a=>{console.error(`Failed to load config files: ${a.message}`);ff()}).then(a=>{const b=Object.create(null),c=process.argv;for(let d=2;d<c.length;d++){const e=/([^?&=]+)(=?([^?&=]+))?/g.exec(c[d]);!Array.isArray(e)||4>e.length?console.warn(`Malformed config parameter "${c[d]}" ignored. It should of the form 'a=b'`):b[e[1]]=olympe.Y.wr(e[3])}a=new olympe.W.dt(a,b);Da(a);a=a.compile();Fa(a);return a}).then(a=>df(a));olympe.dc={};olympe.dc.wa={ORIGIN:'<',DESTINATION:'>'};w('olympe.dc.Direction',olympe.dc.wa);olympe.dc.nc={Yc:'ff022000000000000000',ni:'ff02200000000000000e',Bj:'ff02200000000000000f'};olympe.dc.tp={VERSION:'@v',Rq:'@s'};olympe.dc.Oe={Me:'?',qh:'~'};olympe.dc.iC={Ji:'online',ee:'offline',QA:'invalidate'};olympe.dc.Ra={SELF:'self',SERVER:'server',sf:'remote',ee:'offline'};
542
- olympe.dc.Nb={NONE:null,wo:'ff023000000000000037',Dc:'ff023000000000000137',Yf:'ff023000000000000237',zv:'ff023000000000000337',kt:'ff023000000000000437',SA:olympe.dc.Oe.qh+'ff023000000000000037',TA:olympe.dc.Oe.qh+'ff023000000000000237',RA:olympe.dc.Oe.qh+'ff023000000000000437'};olympe.dc.Zp=class extends Error{constructor(a){var b=olympe.dc.ia(),c=olympe.dc.Zd(),d=b.model(a);d=`\n- model: ${d} (${d?b.name(d):'no name'})`;b=b.source(a);c=`\n- source: ${b} (${b?c.tb(b).name():'no name'})`;super(`Trying to use a CloudObject that does not exist:\n- tag: ${a}${d}${c}${''}`)}};olympe.dc.Writable=class{$c(){}Qc(){}F(){}Ma(){}ic(){}};olympe.dc.Xu=class{Jc(){}U(){}O(){}};olympe.dc.uc=class{constructor(a){this.tag='string'===typeof a?a:a.X()}X(){return this.tag}Fa(a){return a instanceof olympe.dc.uc&&this.tag===a.tag}};olympe.dc.uc.ya=[olympe.dc.Ne];olympe.dc.uc.prototype.Fa.L=olympe.D.K.C;olympe.dc.tt=class a{constructor(b,c,d,e,f,g){this.H=b;this.Z=c;this.db=c.view;this.aa=d;this.Wb=e;this.F=f;this.O=g;this.C=new Map;this.G=Za(new olympe.Y.Hh(6E5),(h,k)=>{URL.revokeObjectURL(k);gf(this.db,h,a.C(h))})}ea(b,c,d,e,f){this.Ga(c).then(g=>{this.ab(b,g,d,!!this.O,e,f)}).catch(g=>this.H.error(g))}J(b){const c=this;return v(function*(){const d=f=>{f=`Failed to download file ${b.X()}: ${f}`;c.H.error(f);throw Error(f);},e=b.X();if(Xa(c.G.C,e)){const f=c.G.get(e);return c.F.G(f).then(g=>g.arrayBuffer()).then(g=>
541
+ bf&&ef.push(bf);olympe.Y.cs(ef).catch(a=>{console.error(`Failed to load config files: ${a.message}`);ff()}).then(a=>{const b=Object.create(null),c=process.argv;for(let d=2;d<c.length;d++){const e=/([^?&=]+)(=?([^?&=]+))?/g.exec(c[d]);!Array.isArray(e)||4>e.length?console.warn(`Malformed config parameter "${c[d]}" ignored. It should of the form 'a=b'`):b[e[1]]=olympe.Y.wr(e[3])}a=new olympe.W.dt(a,b);Da(a);a=a.compile();Fa(a);return a}).then(a=>df(a));olympe.dc={};olympe.dc.wa={ORIGIN:'<',DESTINATION:'>'};w('olympe.dc.Direction',olympe.dc.wa);olympe.dc.nc={Yc:'ff022000000000000000',ni:'ff02200000000000000e',Bj:'ff02200000000000000f'};olympe.dc.tp={VERSION:'@v',Rq:'@s'};olympe.dc.Oe={Me:'?',qh:'~'};olympe.dc.iC={Ji:'online',ee:'offline',QA:'invalidate'};olympe.dc.Sa={SELF:'self',SERVER:'server',sf:'remote',ee:'offline'};
542
+ olympe.dc.Nb={NONE:null,wo:'ff023000000000000037',Dc:'ff023000000000000137',Yf:'ff023000000000000237',zv:'ff023000000000000337',kt:'ff023000000000000437',SA:olympe.dc.Oe.qh+'ff023000000000000037',TA:olympe.dc.Oe.qh+'ff023000000000000237',RA:olympe.dc.Oe.qh+'ff023000000000000437'};olympe.dc.Zp=class extends Error{constructor(a){var b=olympe.dc.ia(),c=olympe.dc.Zd(),d=b.model(a);d=`\n- model: ${d} (${d?b.name(d):'no name'})`;b=b.source(a);c=`\n- source: ${b} (${b?c.tb(b).name():'no name'})`;super(`Trying to use a CloudObject that does not exist:\n- tag: ${a}${d}${c}${''}`)}};olympe.dc.Writable=class{$c(){}Qc(){}F(){}Ma(){}ic(){}};olympe.dc.Xu=class{Jc(){}U(){}O(){}};olympe.dc.uc=class{constructor(a){this.tag='string'===typeof a?a:a.X()}X(){return this.tag}Fa(a){return a instanceof olympe.dc.uc&&this.tag===a.tag}};olympe.dc.uc.ya=[olympe.dc.Ne];olympe.dc.uc.prototype.Fa.L=olympe.D.K.C;olympe.dc.tt=class a{constructor(b,c,d,e,f,g){this.H=b;this.Z=c;this.db=c.view;this.aa=d;this.Wb=e;this.F=f;this.O=g;this.C=new Map;this.G=Za(new olympe.Y.Hh(6E5),(h,k)=>{URL.revokeObjectURL(k);gf(this.db,h,a.C(h))})}ea(b,c,d,e,f){this.Ga(c).then(g=>{this.bb(b,g,d,!!this.O,e,f)}).catch(g=>this.H.error(g))}J(b){const c=this;return v(function*(){const d=f=>{f=`Failed to download file ${b.X()}: ${f}`;c.H.error(f);throw Error(f);},e=b.X();if(Xa(c.G.C,e)){const f=c.G.get(e);return c.F.G(f).then(g=>g.arrayBuffer()).then(g=>
543
543
  new Uint8Array(g)).catch(d)}return c.downloadFileContent(b).then(f=>c.F.J(f)).then(f=>{if(c.O){let g;const h=null!=(g=b.get(olympe.dm.File.mimeTypeProp))?g:'application/data';c.T(e,new Blob([f],{type:h}))}return f}).catch(d)})}downloadFileContent(b){var c=b.X(),d=b.get(olympe.dm.File.C);const e=b.get(olympe.dm.File.urlProp);return e.startsWith('stream:')?this.ja(c).then(()=>this.downloadFileContent(b)):e.startsWith('blob:')?this.F.G(e).then(f=>f.arrayBuffer()).then(f=>new Uint8Array(f)):d?(d=this.db.model(b),
544
544
  c=new olympe.dc.Request(olympe.dc.Request.C.Tf,olympe.dc.Zd().Fe(b),{tag:c,model:d,url:e.valueOf()}),this.Wb.request(c)):new Promise((f,g)=>{const h=N(e);h.F=olympe.net.Aa.ResponseType.Yk;this.aa.C(h,k=>{const l=k.Gc();200<=l&&300>l?f(k.getData()):g(`Failed to download file ${b}. Response code ${l}`)})})}ua(b){const c=new olympe.Y.stream.Eg;this.J(b).then(d=>{const e=new olympe.Y.stream.Eg;for(let f=0;f<d.length;f+=65536){const g=f+65536;e.write(d.subarray(f,g>d.length?d.length:g))}e.complete();e.G(c)});
545
- return c}gb(b,c){this.F.J(c).then(d=>{d=URL.createObjectURL(new Blob([d]));const e=new olympe.dc.db.tc;e.Qc(b,(new Map).set(olympe.dm.File.urlProp.X(),d));this.Z.xc(hf(e));let f;null==(f=this.C.get(b))||f.forEach(g=>g(null))}).catch(d=>{let e;null==(e=this.C.get(b))||e.forEach(f=>f(d))}).finally(()=>{this.C.delete(b)})}ja(b){return new Promise((c,d)=>{let e;const f=null!=(e=this.C.get(b))?e:[];f.push(g=>g?d(g):c());this.C.set(b,f)})}ab(b,c,d,e,f,g){const h=e?k=>{this.T(b,new Blob([c],{type:d}));f(k)}:
546
- f;e=this.db.model(b);e=new olympe.dc.Request(olympe.dc.Request.C.ag,olympe.dc.Zd().Fe(b),{tag:b,model:e,content:c,mimeType:d});this.Wb.request(e).then(k=>h(null!=k?k:'')).catch(null!=g?g:this.H.error.bind(this.H))}Ga(b){return v(function*(){var c=b instanceof olympe.D.Pa?b.valueOf():b;return'string'===typeof c?Ta(c):c instanceof ArrayBuffer?new Uint8Array(c,0,c.byteLength):c instanceof Blob?(c=yield c.arrayBuffer(),new Uint8Array(c,0,c.byteLength)):c})}T(b,c){const d=olympe.dc.ga(b);b=URL.createObjectURL(c);
547
- this.G.set(d,b);const e=a.C(d);jf(this.db,d,f=>{f||(this.G.delete(d),gf(this.db,d,e))},e)}static C(b){return`cacheBinary${b}`}};function kf(a,b){let c=lf(b),d=null;for(;!c&&b&&b!==d;){d=b;b=a.db.Ve(b);if(null===b)break;c=lf(b)}let e;return null!=(e=c)?e:null}olympe.dc.Nt=class{constructor(a,b,c){this.H=a;this.C=b;this.db=b.view;this.F=c;this.Oa=new FinalizationRegistry(d=>{this.H.J()&&this.H.debug(`Collect instance ${d} (${this.db.name(d)||'no name'})`);this.C.C.Jb([d])})}};function mf(a,b){a.origin=b;return a}function nf(a,b,c){a.F.set(b,c);return a}function of(a){let b;return null!=(b=a.F)?b:new Map}olympe.dc.Request=class{constructor(a,b,c,d){this.type=a;this.origin=olympe.dc.Ra.SELF;this.C=b;this.content=null!=c?c:null;this.G=null!=d?d:jd(olympe.auth.je()).me();this.F=new Map}getType(){return this.type}Bc(){return this.G}jc(){return this.C}toString(){return`Request of type ${this.type}, from ${this.origin} to ${this.C}; content: ${this.content}`}};
548
- olympe.dc.Request.C={Gb:1,tg:10,vt:24,$o:25,wt:28,Bg:30,$j:31,FB:32,Ue:40,Mg:41,Kn:42,yq:43,UC:44,ii:45,Mn:46,Lj:47,ag:50,Tf:51,rg:52,Sv:60,gv:61,Vo:62,IA:63,Ts:64,fh:65,mo:91,xt:93,Pl:95,QUERY_RESULT:97};function pf(a,b,c,d,e){const f=olympe.D.Sg();a.sources.set(olympe.dc.Ra.SERVER,e.init(a));a.G?a.sources.set(olympe.dc.Ra.sf,d.init(a)):jf(b,a.C,()=>{a.sources.set(olympe.dc.Ra.sf,d.init(a));const g=new Map;olympe.dc.pa.from(a.C,a.C).hb(olympe.dm.DataSource.nj).filter(olympe.dc.query.Ba.Fa(olympe.dm.DataSource.Oh,!0)).observe(f).subscribe(h=>{var k=qf(h);for(var l of k){const [p,q]=g.get(l);c.G(p);c.O(q);k=a.sources.get(l);a.sources.delete(l);var n=void 0;null==(n=k)||n.destroy()}h=rf(h);for(const p of h)if(h=
545
+ return c}hb(b,c){this.F.J(c).then(d=>{d=URL.createObjectURL(new Blob([d]));const e=new olympe.dc.db.tc;e.Qc(b,(new Map).set(olympe.dm.File.urlProp.X(),d));this.Z.xc(hf(e));let f;null==(f=this.C.get(b))||f.forEach(g=>g(null))}).catch(d=>{let e;null==(e=this.C.get(b))||e.forEach(f=>f(d))}).finally(()=>{this.C.delete(b)})}ja(b){return new Promise((c,d)=>{let e;const f=null!=(e=this.C.get(b))?e:[];f.push(g=>g?d(g):c());this.C.set(b,f)})}bb(b,c,d,e,f,g){const h=e?k=>{this.T(b,new Blob([c],{type:d}));f(k)}:
546
+ f;e=this.db.model(b);e=new olympe.dc.Request(olympe.dc.Request.C.ag,olympe.dc.Zd().Fe(b),{tag:b,model:e,content:c,mimeType:d});this.Wb.request(e).then(k=>h(null!=k?k:'')).catch(null!=g?g:this.H.error.bind(this.H))}Ga(b){return v(function*(){var c=b instanceof olympe.D.Qa?b.valueOf():b;return'string'===typeof c?Ta(c):c instanceof ArrayBuffer?new Uint8Array(c,0,c.byteLength):c instanceof Blob?(c=yield c.arrayBuffer(),new Uint8Array(c,0,c.byteLength)):c})}T(b,c){const d=olympe.dc.ga(b);b=URL.createObjectURL(c);
547
+ this.G.set(d,b);const e=a.C(d);jf(this.db,d,f=>{f||(this.G.delete(d),gf(this.db,d,e))},e)}static C(b){return`cacheBinary${b}`}};function kf(a,b){let c=lf(b),d=null;for(;!c&&b&&b!==d;){d=b;b=a.db.Ve(b);if(null===b)break;c=lf(b)}let e;return null!=(e=c)?e:null}olympe.dc.Nt=class{constructor(a,b,c){this.H=a;this.C=b;this.db=b.view;this.F=c;this.Pa=new FinalizationRegistry(d=>{this.H.J()&&this.H.debug(`Collect instance ${d} (${this.db.name(d)||'no name'})`);this.C.C.Fb([d])})}};function mf(a,b){a.origin=b;return a}function nf(a,b,c){a.F.set(b,c);return a}function of(a){let b;return null!=(b=a.F)?b:new Map}olympe.dc.Request=class{constructor(a,b,c,d){this.type=a;this.origin=olympe.dc.Sa.SELF;this.C=b;this.content=null!=c?c:null;this.G=null!=d?d:jd(olympe.auth.je()).me();this.F=new Map}getType(){return this.type}Bc(){return this.G}jc(){return this.C}toString(){return`Request of type ${this.type}, from ${this.origin} to ${this.C}; content: ${this.content}`}};
548
+ olympe.dc.Request.C={Hb:1,tg:10,vt:24,$o:25,wt:28,Bg:30,$j:31,FB:32,Ue:40,Mg:41,Kn:42,yq:43,UC:44,ii:45,Mn:46,Lj:47,ag:50,Tf:51,rg:52,Sv:60,gv:61,Vo:62,IA:63,Ts:64,fh:65,mo:91,xt:93,Pl:95,QUERY_RESULT:97};function pf(a,b,c,d,e){const f=olympe.D.Sg();a.sources.set(olympe.dc.Sa.SERVER,e.init(a));a.G?a.sources.set(olympe.dc.Sa.sf,d.init(a)):jf(b,a.C,()=>{a.sources.set(olympe.dc.Sa.sf,d.init(a));const g=new Map;olympe.dc.pa.from(a.C,a.C).ib(olympe.dm.DataSource.nj).filter(olympe.dc.query.Ba.Fa(olympe.dm.DataSource.Oh,!0)).observe(f).subscribe(h=>{var k=qf(h);for(var l of k){const [p,q]=g.get(l);c.G(p);c.O(q);k=a.sources.get(l);a.sources.delete(l);var n=void 0;null==(n=k)||n.destroy()}h=rf(h);for(const p of h)if(h=
549
549
  p.X(),!a.sources.has(h)){const q=new olympe.dc.sources.Dp(a.H,p);a.sources.set(h,q);l=c.C(()=>q.healthCheck(),h,olympe.host.ze.C.READINESS);n=c.F(()=>q.destroy(),`Datasource ${h}`);g.set(h,[l,n]);q.init(a)}});gf(b,a.C,'router',!0)},'router')}function sf(a,b,c){let d=a.F.get(b);void 0===d&&(d=[],a.F.set(b,d));d.push(c)}
550
550
  olympe.dc.mv=class{constructor(a,b,c,d,e,f,g){this.H=a;this.C=f;this.G=g;this.sources=new Map;this.F=new Map;pf(this,d,e,b,c)}request(a){this.H.debug('Router: sends',a);return this.tb(a.jc()).request(a)}subscribe(a,b){this.H.debug('Router: subscribes',a);return this.tb(a.jc()).subscribe(a,b)}qd(a){const b=a.jc();if(b===this.C){let c;null==(c=this.F.get(a.getType()))||c.forEach(d=>d(a))}else olympe.N.wb.publish(b,a).catch(c=>{this.H.error(`Error while publishing the message ${a} to remote router: ${c}`)})}tb(a){let b;
551
- return null!=(b=this.sources.get(a))?b:this.sources.get(olympe.dc.Ra.sf)}};function hf(a,b){return new olympe.dc.kh(a,null!=b?b:null)}function tf(a,b){a=(new olympe.dc.transaction.zh(b)).C(a);return new olympe.dc.kh(a,null)}olympe.dc.kh=class{constructor(a,b){this.C=a;this.F=b}U(){return this.C.U()}qc(){return this.C}static C(a){const b=(new olympe.dc.transaction.zh).C(a.p);return new olympe.dc.kh(b,a.t)}ha(){const a=new olympe.dc.transaction.qf;this.C.Jc(a);return{p:uf(a),t:this.F}}};olympe.dc.Oa={};const vf=olympe.dc.wa.ORIGIN,wf=olympe.dc.wa.DESTINATION,xf=new Map,yf=new Map,zf=new Map,Af=new Map;function lf(a){let b;return null!=(b=xf.get(a))?b:null}function Bf(a,b,c){let d=a;'function'===typeof a&&(d=c.entry);a=[...(d.rn||[])];return olympe.dc.na.C(b,c,...a)}function Cf(a,b){Af.set(a,b);return a}function Df(a){let b,c;return null!=(c=null==(b=xf.get(a))?void 0:b.F)?c:olympe.dc.CloudObject}
551
+ return null!=(b=this.sources.get(a))?b:this.sources.get(olympe.dc.Sa.sf)}};function hf(a,b){return new olympe.dc.kh(a,null!=b?b:null)}function tf(a,b){a=(new olympe.dc.transaction.zh(b)).C(a);return new olympe.dc.kh(a,null)}olympe.dc.kh=class{constructor(a,b){this.C=a;this.F=b}U(){return this.C.U()}qc(){return this.C}static C(a){const b=(new olympe.dc.transaction.zh).C(a.p);return new olympe.dc.kh(b,a.t)}ha(){const a=new olympe.dc.transaction.qf;this.C.Jc(a);return{p:uf(a),t:this.F}}};olympe.dc.Pa={};const vf=olympe.dc.wa.ORIGIN,wf=olympe.dc.wa.DESTINATION,xf=new Map,yf=new Map,zf=new Map,Af=new Map;function lf(a){let b;return null!=(b=xf.get(a))?b:null}function Bf(a,b,c){let d=a;'function'===typeof a&&(d=c.entry);a=[...(d.rn||[])];return olympe.dc.na.C(b,c,...a)}function Cf(a,b){Af.set(a,b);return a}function Df(a){let b,c;return null!=(c=null==(b=xf.get(a))?void 0:b.F)?c:olympe.dc.CloudObject}
552
552
  function Ef(a,b,c){const d=a+'@'+(b===wf?vf:wf);if(yf.has(d))throw Error(`Try to register the same relation (${b+a}) multiple times.`);yf.set(d,c)}function Ff(a){a=a.X()+'@'+a.Ia();return yf.get(a)||olympe.dc.CloudObject}function R(a,b){b.NAME=a;zf.set(a,b)}function S(a){let b;return null!=(b=a.NAME)?b:null}
553
- olympe.dc.na=class{constructor(){}static C(a,b,...c){if(xf.has(a))throw Error(`Tag: ${a} - overwriting already defined CloudObject class ${xf.get(a).F.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.W.wb(g):g}}b=new olympe.dc.Oa.Entry(a,b,d);xf.set(a,b);return b.F.entry=b}static cc(a){let b,c;return null!=(c=null==(b=a.entry)?void 0:b.X())?c:null}};function Gf(a,b){a.C=b}function T(a,b){b=b.bc();Ef(b.X(),b.Ia(),a.F);return b}function Hf(a){a.G=!0;return a}
554
- olympe.dc.Oa.Entry=class{constructor(a,b,c){this.tag=a;this.F=b;this.rn=c||null;this.C=null;this.G=!1}X(){return this.tag}instantiate(a,b){const c=this.F;if(this.$m()&&b.getParameter(olympe.dc.V.Fo)){var d=olympe.dc.ia();d=`Trying to instantiate an abstract class ${d.name(this)} (${this.X()}).`+` This may happen when the implementation of another class extending ${d.name(this)} has not been registered`;olympe.ka.ib('dc').error(d)}return this.rn?(a=[void 0,a].concat(Ga(b,this.rn)),new c(...a)):new c(void 0,
555
- a)}la(a){return new olympe.dc.Oa.Property(a)}sa(a,b=olympe.dc.wa.DESTINATION){Ef(a,b,this.F);return new olympe.dc.da.Qe(a,b)}$m(){return this.G}};w('olympe.dc.registry.Entry',olympe.dc.Oa.Entry);olympe.dc.Oa.Entry.prototype.addRelation=olympe.dc.Oa.Entry.prototype.sa;olympe.dc.Oa.Entry.prototype.addProperty=olympe.dc.Oa.Entry.prototype.la;olympe.dc.Oa.Entry.ya=[olympe.dc.Ne];olympe.dc.Oa.Property=class{constructor(a){this.tag=a}X(){return this.tag}toString(){return`Property: ${this.tag}`}};olympe.dc.Oa.Property.prototype.getTag=olympe.dc.Oa.Property.prototype.X;olympe.dc.Oa.Property.ya=[olympe.dc.Ne];olympe.dc.Oa.Relation=class{constructor(a,b=olympe.dc.wa.DESTINATION,c=olympe.dc.CloudObject,d=olympe.dc.CloudObject){this.tag=olympe.dc.ga(a);this.direction=b;this.origin=c;this.J=d}X(){return this.tag}Ia(){return this.direction}type(){return this.J}bc(){return new olympe.dc.Oa.Relation(this.tag,this.direction===olympe.dc.wa.DESTINATION?olympe.dc.wa.ORIGIN:olympe.dc.wa.DESTINATION,this.J,this.origin)}Fa(a){return a instanceof olympe.dc.Oa.Relation?a.X()===this.X()&&a.Ia()===this.Ia():!1}toString(){return`${this.direction}${olympe.dc.ia().name(this.tag)} (${this.tag})`}};
556
- olympe.dc.Oa.Relation.prototype.getInverse=olympe.dc.Oa.Relation.prototype.bc;olympe.dc.Oa.Relation.prototype.getDirection=olympe.dc.Oa.Relation.prototype.Ia;olympe.dc.Oa.Relation.prototype.getTag=olympe.dc.Oa.Relation.prototype.X;olympe.dc.Oa.Relation.ya=[olympe.dc.Ne];olympe.dc.db={};function If(a,b){const c=a.J,d=olympe.dc.ia(),e=olympe.dc.db.Database.F.Ki,f=olympe.dc.db.Database.F.Me,g=olympe.dc.db.Database.F.ORIGIN,h=olympe.dc.db.Database.F.DESTINATION,k=new olympe.dc.db.tc('rev-'+b.U());a.H.debug('Generate the reverse graphLayer of',b.U());b.C.forEach((l,n)=>{if(l.F()){k.F(n,olympe.dc.Nb.NONE);for(const [r,t]of l.yd())k.ic(r,n,t)}else{var p=c.get(n);if(void 0!==p)if(l.zd())for(const r of Jf(d,n,l.J())){l=c.get(r);const t=new Map;l.forEach((u,x)=>{const y=x[0],z=x.substring(1);
557
- y===e?t.set(z,u):y===f?t.set(x,u):y===g?u.forEach((A,D)=>{k.Ma(z,D,r)}):y===h&&u.forEach((A,D)=>{k.Ma(z,r,D)})});l=l.source();k.$c(r,l,t)}else{const r=new Map;for(const t of l.Cb().keys()){var q=t[0]===f;const u=q?t.substring(1):t;q=q?Kf(p,u,!0):p.Sa(u,!0);let x;r.set(t,null!=(x=q)?x:null)}0<r.size&&k.Qc(n,r);for(const [t,u,x]of l.yd())x?k.ic(t,n,u):k.Ma(t,n,u)}}});return k}
553
+ olympe.dc.na=class{constructor(){}static C(a,b,...c){if(xf.has(a))throw Error(`Tag: ${a} - overwriting already defined CloudObject class ${xf.get(a).F.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.W.wb(g):g}}b=new olympe.dc.Pa.Entry(a,b,d);xf.set(a,b);return b.F.entry=b}static cc(a){let b,c;return null!=(c=null==(b=a.entry)?void 0:b.X())?c:null}};function Gf(a,b){a.C=b}function T(a,b){b=b.bc();Ef(b.X(),b.Ia(),a.F);return b}function Hf(a){a.G=!0;return a}
554
+ olympe.dc.Pa.Entry=class{constructor(a,b,c){this.tag=a;this.F=b;this.rn=c||null;this.C=null;this.G=!1}X(){return this.tag}instantiate(a,b){const c=this.F;if(this.$m()&&b.getParameter(olympe.dc.V.Fo)){var d=olympe.dc.ia();d=`Trying to instantiate an abstract class ${d.name(this)} (${this.X()}).`+` This may happen when the implementation of another class extending ${d.name(this)} has not been registered`;olympe.ka.ab('dc').error(d)}return this.rn?(a=[void 0,a].concat(Ga(b,this.rn)),new c(...a)):new c(void 0,
555
+ a)}la(a){return new olympe.dc.Pa.Property(a)}sa(a,b=olympe.dc.wa.DESTINATION){Ef(a,b,this.F);return new olympe.dc.da.Qe(a,b)}$m(){return this.G}};w('olympe.dc.registry.Entry',olympe.dc.Pa.Entry);olympe.dc.Pa.Entry.prototype.addRelation=olympe.dc.Pa.Entry.prototype.sa;olympe.dc.Pa.Entry.prototype.addProperty=olympe.dc.Pa.Entry.prototype.la;olympe.dc.Pa.Entry.ya=[olympe.dc.Ne];olympe.dc.Pa.Property=class{constructor(a){this.tag=a}X(){return this.tag}toString(){return`Property: ${this.tag}`}};olympe.dc.Pa.Property.prototype.getTag=olympe.dc.Pa.Property.prototype.X;olympe.dc.Pa.Property.ya=[olympe.dc.Ne];olympe.dc.Pa.Relation=class{constructor(a,b=olympe.dc.wa.DESTINATION,c=olympe.dc.CloudObject,d=olympe.dc.CloudObject){this.tag=olympe.dc.ga(a);this.direction=b;this.origin=c;this.J=d}X(){return this.tag}Ia(){return this.direction}type(){return this.J}bc(){return new olympe.dc.Pa.Relation(this.tag,this.direction===olympe.dc.wa.DESTINATION?olympe.dc.wa.ORIGIN:olympe.dc.wa.DESTINATION,this.J,this.origin)}Fa(a){return a instanceof olympe.dc.Pa.Relation?a.X()===this.X()&&a.Ia()===this.Ia():!1}toString(){return`${this.direction}${olympe.dc.ia().name(this.tag)} (${this.tag})`}};
556
+ olympe.dc.Pa.Relation.prototype.getInverse=olympe.dc.Pa.Relation.prototype.bc;olympe.dc.Pa.Relation.prototype.getDirection=olympe.dc.Pa.Relation.prototype.Ia;olympe.dc.Pa.Relation.prototype.getTag=olympe.dc.Pa.Relation.prototype.X;olympe.dc.Pa.Relation.ya=[olympe.dc.Ne];olympe.dc.db={};function If(a,b){const c=a.J,d=olympe.dc.ia(),e=olympe.dc.db.Database.F.Ki,f=olympe.dc.db.Database.F.Me,g=olympe.dc.db.Database.F.ORIGIN,h=olympe.dc.db.Database.F.DESTINATION,k=new olympe.dc.db.tc('rev-'+b.U());a.H.debug('Generate the reverse graphLayer of',b.U());b.C.forEach((l,n)=>{if(l.F()){k.F(n,olympe.dc.Nb.NONE);for(const [r,t]of l.yd())k.ic(r,n,t)}else{var p=c.get(n);if(void 0!==p)if(l.zd())for(const r of Jf(d,n,l.J())){l=c.get(r);const t=new Map;l.forEach((u,x)=>{const y=x[0],z=x.substring(1);
557
+ y===e?t.set(z,u):y===f?t.set(x,u):y===g?u.forEach((A,D)=>{k.Ma(z,D,r)}):y===h&&u.forEach((A,D)=>{k.Ma(z,r,D)})});l=l.source();k.$c(r,l,t)}else{const r=new Map;for(const t of l.Cb().keys()){var q=t[0]===f;const u=q?t.substring(1):t;q=q?Kf(p,u,!0):p.Oa(u,!0);let x;r.set(t,null!=(x=q)?x:null)}0<r.size&&k.Qc(n,r);for(const [t,u,x]of l.yd())x?k.ic(t,n,u):k.Ma(t,n,u)}}});return k}
558
558
  function Lf(a,b,c){const d=b.U();if(a.F.has(d))throw Error(`You try to execute the patch ${d} a second times whereas the first execution has not been validated yet.`);const e=new Mf(b,If(a,b));a.G.unshift(d);a.F.set(d,e);a.J.$r(c);a.write(b,!1)}
559
559
  function Nf(a,b,c){if(0>=a.O||null===c)return b;var d=a.C.findIndex(h=>h.U()===b.U()),e=a.C[d];-1<d&&a.C.splice(d,1);d=0<a.C.length?a.C.findIndex(h=>c>=h.F):0;d=-1<d?d:a.C.length;const f=a.C.slice(0,d).reduce((h,k)=>k.xc(h),b);let g;e=null!=(g=null==e?void 0:e.update(f,c))?g:new Of(f,c,a.C,a.O);a.C.splice(d,0,e);a.H.J()&&a.H.debug('CommitController buffer:\n',a.C.map(h=>`${h.U()} at ${h.F}`).join('\n'));return f}
560
560
  function Pf(a,b,c){return a.G.slice(0,c).map(d=>a.F.get(d)).reduce((d,e)=>{let f;return null!=(f=null==e?void 0:e.xc(d))?f:d},b)}
561
561
  olympe.dc.db.at=class{constructor(a,b,c,d){this.H=a;this.J=b;this.ia=c;let e;this.T=null!=(e=d.get('debug'))?e:!1;let f;this.O=null!=(f=d.get('bufferTimeout'))?f:0;this.G=[];this.F=new Map;this.C=[];b.addEventListener(olympe.dc.db.Database.C.So,g=>{this.C.forEach(h=>{for(const k of g)h.C.G(k)})})}xc(a,b){const c=a.U();this.F.has(c)?this.push(c,b):(a=Nf(this,Pf(this,a,this.G.length),b),this.write(a,!0))}push(a,b){const c=this.G.indexOf(a);if(-1<c){const d=this.F.get(a);this.G.splice(c,1);Nf(this,Pf(this,
562
562
  d.F,c),b);this.F.delete(a)}}write(a,b){(new olympe.dc.db.nr(this.H,this.J,this.ia,this.T,b)).write(a)}};class Qf{U(){}xc(){}}function Rf(a,b,c,d){const e=olympe.dc.wa.DESTINATION;c=c.tag();const f=a.C.Lc(c);b.Cb().forEach((g,h)=>{f.la(h,g);b.ea(h)});for(const [g,h,k,l]of b.ja()){if(!l)continue;const n=h===e?c:k,p=h===e?k:c;a.C.Ma(g,n,p);d.T(g,n,p)}}
563
- function Sf(a,b,c,d){const e=olympe.dc.wa.DESTINATION,f=c.tag(),g=a.C.Lc(f);b.Cb().forEach((h,k)=>{void 0!==c.Sa(k)&&(g.la(k,h),b.ea(k))});for(const [h,k,l]of b.yd()){const n=c.yb(h,e,k);void 0!==n&&(d.T(h,f,k),n===l&&a.C.T(h,f,k))}}
563
+ function Sf(a,b,c,d){const e=olympe.dc.wa.DESTINATION,f=c.tag(),g=a.C.Lc(f);b.Cb().forEach((h,k)=>{void 0!==c.Oa(k)&&(g.la(k,h),b.ea(k))});for(const [h,k,l]of b.yd()){const n=c.yb(h,e,k);void 0!==n&&(d.T(h,f,k),n===l&&a.C.T(h,f,k))}}
564
564
  class Mf extends Qf{constructor(a,b){super();this.F=a;this.C=b;this.db=olympe.dc.ia()}U(){return this.F.U()}xc(a){for(const [b,c]of this.F.ja(a)){const d=b.tag();c.zd()?b.F()?a.G(d,b.J()):(this.F.G(d,c.J()),this.C.G(d,c.J())):b.zd()?(Rf(this,c,b,a),a.G(d,b.J())):Sf(this,c,b,a)}return a}}function Tf(a){clearTimeout(a.G);a.G=setTimeout(()=>{a.buffer.splice(a.buffer.indexOf(a),1)},a.J)}
565
565
  class Of extends Qf{constructor(a,b,c,d){super();this.C=a;this.F=b;this.buffer=c;this.J=d;this.G=null;Tf(this)}U(){return this.C.U()}xc(a){return a.Z(this.C)}update(a,b){this.F=b;a.Jc(this.C);Tf(this);return this}};const Uf=olympe.dc.nc.Yc,Vf=olympe.dc.nc.ni,Wf=olympe.dc.wa.ORIGIN,Xf=olympe.dc.wa.DESTINATION;
566
- olympe.dc.db.Database=class a extends Map{constructor(b,c,d){super();let e;this.id=null!=(e=d.get('selfTag'))?e:olympe.dc.Ra.SELF;this.H=b;this.Tc=olympe.D.$a();this.Z=olympe.dc.db.Database.G.IDLE;this.ea=new Map;this.Ub=[];this.O=[];this.ja=new Map;var f;b=null!=(f=d.get('garbageCollector'))?f:olympe.dc.db.kf.C.pl;let g;f=null!=(g=d.get('garbageCollectorDelay'))?g:5E3;this.Uc=new olympe.dc.db.kf(c,this,b,f);d.get('debug')&&this.Hk()}U(){return this.id}getState(){return this.Z}ib(){return this.H}create(b,
566
+ olympe.dc.db.Database=class a extends Map{constructor(b,c,d){super();let e;this.id=null!=(e=d.get('selfTag'))?e:olympe.dc.Sa.SELF;this.H=b;this.Tc=olympe.D.Wa();this.Z=olympe.dc.db.Database.G.IDLE;this.ea=new Map;this.Ub=[];this.O=[];this.ja=new Map;var f;b=null!=(f=d.get('garbageCollector'))?f:olympe.dc.db.kf.C.pl;let g;f=null!=(g=d.get('garbageCollectorDelay'))?g:5E3;this.Uc=new olympe.dc.db.kf(c,this,b,f);d.get('debug')&&this.Hk()}U(){return this.id}getState(){return this.Z}ab(){return this.H}create(b,
567
567
  c,d,e=!1){var f=this.G(b,!0);if(!f.e&&null!==c&&(null===f.G||f.G===c)){f.G=c;let g;(null==(g=f.model())?0:g.e)&&f.db.aa(f,!0)}e&&f.persist();d&&this.Cc(f,d);this.F(a.C.np,b)}update(b,c){c&&(b=this.G(b,!0),this.Cc(b,c))}ua(b){const c=this.get(b);void 0!==c&&(this.aa(c,!1),this.F(a.C.op,b))}link(b,c,d){c=this.G(c,!0);d=this.G(d,!0);switch(b){case Uf:Yf(c,d);break;case Vf:Zf(c,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!==d)switch(b){case Uf:$f(c,d);
568
- break;case Vf:ag(c,d);break;default:c.unlink(b,d)}}gb(b){for(const c of b)bg(this.G(c))}Jb(b){for(const c of b)(b=this.get(c))&&cg(b)}$r(b){b.forEach(c=>{this.G(c).persist()})}Ud(b){const c=this.get(b);void 0!==c&&(c.clear(),super.delete(b),this.F(a.C.Do,b))}G(b,c=!1){let d=this.get(b);void 0===d&&(d=new olympe.dc.db.Instance(b,this),this.set(b,d),this.F(a.C.Co,b),c&&this.F(a.C.xm,b));return d}yb(b){dg(this.O[0],olympe.Y.Vh(),b)}T(b){this.O[0].C.delete(b)}Ga(b,...c){this.ea.has(b)&&this.ea.get(b).forEach(d=>
569
- {d(...c)})}F(b,c,...d){this.Ga(b,c,...d)}aa(b,c){this.ja.set(b,c)}Uh(b,c,d,e){let f;null!=(f=this.O[0])&&eg(f,b).la(e?fg+c:c,d)}$h(b,c,d,e,f){let g;null!=(g=this.O[0])&&(d===gg?f?eg(g,b).link(c,e):eg(g,b).unlink(c,e):f?eg(g,b).Jb(c,e):eg(g,b).Ub(c,e))}ac(b,c,d){let e;null!=(e=this.O[0])&&eg(e,b).Uc(c,d)}addEventListener(b,c){let d=this.ea.get(b);void 0===d&&(d=[],this.ea.set(b,d));d.push(c)}C(b,c){this.addEventListener(b,c)}ab(b){this.Ub.push(b)}J(b){return this.O.reduce((c,d)=>d.O.has(b)||c,!1)}Bf(){this.Z===
568
+ break;case Vf:ag(c,d);break;default:c.unlink(b,d)}}hb(b){for(const c of b)bg(this.G(c))}Fb(b){for(const c of b)(b=this.get(c))&&cg(b)}$r(b){b.forEach(c=>{this.G(c).persist()})}Ud(b){const c=this.get(b);void 0!==c&&(c.clear(),super.delete(b),this.F(a.C.Do,b))}G(b,c=!1){let d=this.get(b);void 0===d&&(d=new olympe.dc.db.Instance(b,this),this.set(b,d),this.F(a.C.Co,b),c&&this.F(a.C.xm,b));return d}yb(b){dg(this.O[0],olympe.Y.Vh(),b)}T(b){this.O[0].C.delete(b)}Ga(b,...c){this.ea.has(b)&&this.ea.get(b).forEach(d=>
569
+ {d(...c)})}F(b,c,...d){this.Ga(b,c,...d)}aa(b,c){this.ja.set(b,c)}Uh(b,c,d,e){let f;null!=(f=this.O[0])&&eg(f,b).la(e?fg+c:c,d)}$h(b,c,d,e,f){let g;null!=(g=this.O[0])&&(d===gg?f?eg(g,b).link(c,e):eg(g,b).unlink(c,e):f?eg(g,b).Fb(c,e):eg(g,b).Ub(c,e))}ac(b,c,d){let e;null!=(e=this.O[0])&&eg(e,b).Uc(c,d)}addEventListener(b,c){let d=this.ea.get(b);void 0===d&&(d=[],this.ea.set(b,d));d.push(c)}C(b,c){this.addEventListener(b,c)}bb(b){this.Ub.push(b)}J(b){return this.O.reduce((c,d)=>d.O.has(b)||c,!1)}Bf(){this.Z===
570
570
  a.G.IDLE&&(this.Z=a.G.Hs);this.O.unshift(new olympe.dc.db.pt(this,this.Tc))}Vd(){this.Z=a.G.ef;this.bs();hg(this.O[0]);this.O.shift();0===this.O.length&&(this.Z=a.G.IDLE,this.Ub.forEach(b=>{b()}),ig(this.Uc))}Cc(b,c){const d=a.F.Me;for(const [e,f]of c)void 0!==f&&(e[0]===d?jg(b,e.substring(1),f):b.update(e,f))}bs(){const b=this.O[0];for(const [c,d]of this.ja)this.hc(new Set,c).filter(e=>{var f=d;const g=e.e!==f;g&&(f?(e.e=f,kg(e)):(lg(e),e.e=f),e.db.F(f?mg.rl:mg.Dc,e.C));return g}).forEach(e=>{e=
571
- e.tag();d?eg(b,e).create():eg(b,e).delete()});this.ja.clear()}hc(b,c,d=[]){const e=c.tag();if(!b.has(e)&&(b.add(e),d.push(c),c=c.get(Wf+Uf)))for(const f of c.values())null!==f.source()&&this.hc(b,f,d);return d}Hk(){const b=a.C.rl,c=a.C.bk,d=new Set,e=new Map;this.C(a.C.np,f=>{d.add(f)});this.C(b,f=>{d.delete(f);e.delete(f)});this.C(c,(f,...g)=>{if(g[0]===Vf&&g[1]===Xf){const h=g[2];this.get(h).Ha()||(g=e.get(h)||new Set,0===g.size&&e.set(h,g),g.add(f))}});this.ab(()=>{d.forEach(f=>{const g=this.get(f);
571
+ e.tag();d?eg(b,e).create():eg(b,e).delete()});this.ja.clear()}hc(b,c,d=[]){const e=c.tag();if(!b.has(e)&&(b.add(e),d.push(c),c=c.get(Wf+Uf)))for(const f of c.values())null!==f.source()&&this.hc(b,f,d);return d}Hk(){const b=a.C.rl,c=a.C.bk,d=new Set,e=new Map;this.C(a.C.np,f=>{d.add(f)});this.C(b,f=>{d.delete(f);e.delete(f)});this.C(c,(f,...g)=>{if(g[0]===Vf&&g[1]===Xf){const h=g[2];this.get(h).Ha()||(g=e.get(h)||new Set,0===g.size&&e.set(h,g),g.add(f))}});this.bb(()=>{d.forEach(f=>{const g=this.get(f);
572
572
  g&&null===g.model()&&this.H.error(`\n[DEBUG - DATABASE]\nInstance ${f} created but does not exist !\n${g.toString()}`)});d.clear();e.forEach((f,g)=>{const h=this.get(g);h&&this.H.error(`\n[DEBUG - DATABASE]\nThe model ${g} is extended by other models but does not exist !`+`\nExtension models: ${Array.from(f.values()).join(', ')}`+`\n\n ${h.toString()}`)});e.clear()})}};olympe.dc.db.Database.F={Ki:'$',It:'~',Me:'?',Tk:'=',lp:'|',dl:'@',ORIGIN:olympe.dc.wa.ORIGIN,DESTINATION:olympe.dc.wa.DESTINATION};
573
- olympe.dc.db.Database.C={Co:0,Do:1,dr:2,xm:3,Wn:4,Xn:5,rl:6,Dc:7,bk:8,gm:9,np:10,op:11,sq:12,Ez:13,Dz:14,Nv:15,So:16};olympe.dc.db.Database.G={IDLE:0,Hs:1,ef:2};function ng(a,b,c=[]){const d=b.U();Lf(a.F,b,c);return e=>{if(null!==e)a.F.push(d,e);else{e=a.F;var f=e.F.get(d);if(void 0!==f){const g=e.G.indexOf(d);e.G.splice(g,1);f=Pf(e,f.C,e.G.length);e.write(Nf(e,f,Date.now()),!1);e.F.delete(d)}}}}function og(a,b){a.C.ab(b)}olympe.dc.db.lt=class{constructor(a,b,c,d,e){this.H=a;this.C=b;this.view=c;this.F=new olympe.dc.db.at(a,b,c,d);this.wy=new olympe.dc.db.Gu(a,c,b,e)}ib(){return this.H}xc(a){this.F.xc(a.qc(),a.F)}};const pg=olympe.dc.db.Database.F.ORIGIN,qg=olympe.dc.db.Database.F.DESTINATION,rg=olympe.dc.db.Database.F.Ki,sg=olympe.dc.db.Database.F.Me,tg=olympe.dc.db.Database.F.Tk,ug=olympe.dc.db.Database.F.lp,vg=pg+qg,wg=rg+rg,xg=olympe.dc.db.Database.G;let yg=0;function gf(a,b,c,d=!1){const e=U(a,b);if(null!==e){const f=zg(e,'',c);void 0!==f&&(a.C.getState()!==xg.ef||e.J()&&!d||a.C.T(c),d||!e.Ha()&&!e.J()||f(!1,b))}}
573
+ olympe.dc.db.Database.C={Co:0,Do:1,dr:2,xm:3,Wn:4,Xn:5,rl:6,Dc:7,bk:8,gm:9,np:10,op:11,sq:12,Ez:13,Dz:14,Nv:15,So:16};olympe.dc.db.Database.G={IDLE:0,Hs:1,ef:2};function ng(a,b,c=[]){const d=b.U();Lf(a.F,b,c);return e=>{if(null!==e)a.F.push(d,e);else{e=a.F;var f=e.F.get(d);if(void 0!==f){const g=e.G.indexOf(d);e.G.splice(g,1);f=Pf(e,f.C,e.G.length);e.write(Nf(e,f,Date.now()),!1);e.F.delete(d)}}}}function og(a,b){a.C.bb(b)}olympe.dc.db.lt=class{constructor(a,b,c,d,e){this.H=a;this.C=b;this.view=c;this.F=new olympe.dc.db.at(a,b,c,d);this.wy=new olympe.dc.db.Gu(a,c,b,e)}ab(){return this.H}xc(a){this.F.xc(a.qc(),a.F)}};const pg=olympe.dc.db.Database.F.ORIGIN,qg=olympe.dc.db.Database.F.DESTINATION,rg=olympe.dc.db.Database.F.Ki,sg=olympe.dc.db.Database.F.Me,tg=olympe.dc.db.Database.F.Tk,ug=olympe.dc.db.Database.F.lp,vg=pg+qg,wg=rg+rg,xg=olympe.dc.db.Database.G;let yg=0;function gf(a,b,c,d=!1){const e=U(a,b);if(null!==e){const f=zg(e,'',c);void 0!==f&&(a.C.getState()!==xg.ef||e.J()&&!d||a.C.T(c),d||!e.Ha()&&!e.J()||f(!1,b))}}
574
574
  function jf(a,b,c,d){a=a.C.G(olympe.dc.ga(b));d=null!=d?d:Ag();Bg(a,'',d,c)&&a.Ha()&&c(!0,b);return d}function Jf(a,b,c){return{[Symbol.iterator]:function*(d,e,f){const g=(new Set).add(olympe.dc.ga(e));for(const h of g)yield h,d.Bk(h,f).forEach(([k,,,l])=>{l&&g.add(k)})}.bind(null,a,b,c)}}function Ag(){++yg;return String(yg)}
575
575
  function Cg(a,b,c,d,e){a=a.C.G(olympe.dc.ga(b));c=olympe.dc.ga(c);b=rg+c;e=null!=e?e:Ag();if(Bg(a,b,e,d)&&a.Ha()){let f=!1;b=a.get(b);void 0===b&&(f=!0,b=a.get(tg+c));void 0!==b&&d(b,f)}return e}function U(a,b,c=!1){if(b)return a=a.C.get(olympe.dc.ga(b)),!a||c&&!a.Ha()?null:a;throw Error('DBView: Impossible to get instance, provided tag is null or undefined.');}function Dg(a,b,c,d){b=U(a,b);null!==b&&(c=olympe.dc.ga(c),zg(b,rg+c,d),a.C.getState()===xg.ef&&a.C.T(d))}
576
576
  function Eg(a,b,c,d){a=a.C.G(olympe.dc.ga(b));d=null!=d?d:Ag();Bg(a,wg,d,c)&&a.Ha()&&a.forEach((e,f)=>{const g=f[0];g!==rg&&g!==tg||c(f.substring(1),e,g===tg)});return d}function Fg(a,b,c){b=U(a,b);null!==b&&(zg(b,wg,c),a.C.getState()===xg.ef&&a.C.T(c))}function Gg(a,b,c,d,e){let f;null==(f=a.get(b))||f.forEach((g,h)=>{if(g.Ha()||!c&&g.J())e?d(b.substring(1),b[0],c,h):d(c,h)})}
577
577
  function V(a,b,c,d,e){a=a.C.G(olympe.dc.ga(b));c=c.Ia()+c.X();e=null!=e?e:Ag();(d=Hg(a,c,e,d))&&a.Ha()&&Gg(a,c,!0,d,!1);return e}function Ig(a,b,c,d){const e=a.C.G(olympe.dc.ga(b));a=null!=d?d:Ag();const f=Hg(e,vg,a,c);f&&e.Ha()&&e.forEach((g,h)=>{g=h[0];g!==pg&&g!==qg||Gg(e,h,!0,f,!0)})}function Jg(a,b,c){const d=U(a,b);if(null!==d){const e=zg(d,vg,c);void 0!==e&&(a.C.getState()!==xg.ef||d.J()||a.C.T(c),!d.Ha()&&!d.J()||d.forEach((f,g)=>{f=g[0];(f===pg||f===qg)&&e&&Gg(d,g,!1,e,!0)}))}}
578
578
  function Kg(a,b,c){b=U(a,b,!1);if(!b||c===olympe.dc.Nb.NONE)return[];const d=olympe.dm.Relation.C.im,e=olympe.dm.Relation.C.jv,f=olympe.dm.Relation.C.vm,g=olympe.dm.Relation.C.tq,h=c[0]===olympe.dc.Oe.qh,k=[];b.forEach((l,n)=>{const p=n[0];if(!h&&l instanceof olympe.dc.uc&&(p===rg||p===sg))(l=a.C.get(l.X()))&&k.push([l,n.substring(1),null,!0]);else if(p===pg||p===qg){const q=n.substring(1),r=Lg(a,q,c),t=p===pg?d|e:f|g;t&r&&l.forEach(u=>{k.push([u,q,p,!!(t&10&r)])})}});if(h&&void 0!==b.F){const [l,
579
579
  n]=void 0!==b.F?[b.F.tag,b.F.Ja]:null;b=a.C.get(l);k.push([b,n,null,!0])}return k}function Mg(a,b,c,d,e){const f=a.C.G(olympe.dc.ga(b));e=null!=e?e:Ag();const g=Hg(f,ug+c,e,d);g&&f.Ha()&&Kg(a,b,c).forEach(([h,...k])=>{h.Ha()&&g(...k,!0,h.tag())})}function Ng(a,b,c,d){const e=U(a,b);if(null!==e){const f=zg(e,ug+c,d);void 0!==f&&(a.C.getState()!==xg.ef||e.J()||a.C.T(d),!e.Ha()&&!e.J()||Kg(a,b,c).forEach(([g,...h])=>{(g.Ha()||g.J())&&f(...h,!1,g.tag())}))}}
580
- function Og(a,b){a=U(a,b,!0);b=new Map;if(a)for(const [c,d]of a)c[0]===sg&&b.set(c.substring(1),d);return b}function Lg(a,b,c){if(c===olympe.dc.Nb.NONE)return 0;const d=c[0]===olympe.dc.Oe.qh;c=d?c.substring(1):c;a=a.Sa(b,c,!0)||0;return d?((a&3)<<2)+((a&12)>>2):a}function Pg(a,b){return function*(c){if(c)for(const [d,e]of c)if(c=d[0],c===pg||c===qg){const f=d.substring(1);for(const g of e.keys())yield[f,c,g]}}(U(a,b,!0))}
581
- function Qg(a,b,c){if(!a.Ha(b))return a.H.warn(`No instance found with tag ${b}`),new Map;const d=new Map,e=[olympe.dc.ga(b)];for(const f of e){const g=a.bb(f,c);d.set(f,g);for(const h of g.filter(k=>!d.has(k)))e.push(h)}a.H.debug(`Found ${d.size} instances in sub-tree rooted at ${olympe.dc.ga(b)}`);return d}function Rg(a,b,c,d){return(c=(a=U(a,b,!0))&&a.get(d+c))?Array.from(c.values()).filter(e=>e.Ha()).length:0}
582
- olympe.dc.lb=class{constructor(a,b){this.H=a;this.C=b}U(){return this.C.U()}F(a,b,c,d=!1){a=U(this,a);if(null!==a){b=b.Ia()+b.X();const e=zg(a,b,c);void 0!==e&&(this.C.getState()!==xg.ef||a.J()&&!d||this.C.T(c),d||!a.Ha()&&!a.J()||Gg(a,b,!1,e,!1))}}Ha(a){a=this.C.get(olympe.dc.ga(a));return!(null==a||!a.Ha())}name(a){let b,c;return null!=(c=null==(b=U(this,a))?void 0:b.Sa(olympe.dc.CloudObject.nameProp.X()))?c:''}model(a){return(a=(a=U(this,a,!0))?a.model():null)?a.tag():null}Ve(a){return(a=(a=U(this,
583
- a,!0))&&a.Ve())?a.tag():null}ai(a){a=U(this,a,!0);return!(!a||!a.Ve())}Rb(a,b){a=(a=U(this,a,!0))&&a.model();return!(!a||!this.If(a.tag(),b))}source(a){return(a=U(this,a,!0))&&a.source()}Lf(a){a=U(this,a,!1);return!a||a.O}Sa(a,b,c){let d;a=null==(d=U(this,a,!0))?void 0:d.Sa(olympe.dc.ga(b),c);return void 0!==a?a:null}Cb(a,b=!1){var c=U(this,a,!0);a=new Map;if(c)for(const [d,e]of c)c=d[0],(c===rg||!b&&c===tg)&&a.set(d.substring(1),e);return a}Bk(a,b){return Kg(this,a,b).filter(([c])=>c.Ha()).map(([c,
584
- ...d])=>[c.tag(),...d])}bb(a,b){a=U(this,a,!0);b=b.Ia()+b.X();b=null==a?void 0:a.get(b);a=[];if(b)for(const c of b.values())c.Ha()&&a.push(c.tag());return a}Zr(a,b,c){let d,e;a=null==(d=U(this,a,!0))?void 0:null==(e=d.get(b.Ia()+b.X()))?void 0:e.get(olympe.dc.ga(c));return!(null==a||!a.Ha())}Wm(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.Ia()+c.X()),void 0!==a)for(const e of a.values())e.Ha()&&b.push(e.tag());a=b}return a}Kb(a,b){var c=
580
+ function Og(a,b){a=U(a,b,!0);b=new Map;if(a)for(const [c,d]of a)c[0]===sg&&b.set(c.substring(1),d);return b}function Lg(a,b,c){if(c===olympe.dc.Nb.NONE)return 0;const d=c[0]===olympe.dc.Oe.qh;c=d?c.substring(1):c;a=a.Oa(b,c,!0)||0;return d?((a&3)<<2)+((a&12)>>2):a}function Pg(a,b){return function*(c){if(c)for(const [d,e]of c)if(c=d[0],c===pg||c===qg){const f=d.substring(1);for(const g of e.keys())yield[f,c,g]}}(U(a,b,!0))}
581
+ function Qg(a,b,c){if(!a.Ha(b))return a.H.warn(`No instance found with tag ${b}`),new Map;const d=new Map,e=[olympe.dc.ga(b)];for(const f of e){const g=a.cb(f,c);d.set(f,g);for(const h of g.filter(k=>!d.has(k)))e.push(h)}a.H.debug(`Found ${d.size} instances in sub-tree rooted at ${olympe.dc.ga(b)}`);return d}function Rg(a,b,c,d){return(c=(a=U(a,b,!0))&&a.get(d+c))?Array.from(c.values()).filter(e=>e.Ha()).length:0}
582
+ olympe.dc.lb=class{constructor(a,b){this.H=a;this.C=b}U(){return this.C.U()}F(a,b,c,d=!1){a=U(this,a);if(null!==a){b=b.Ia()+b.X();const e=zg(a,b,c);void 0!==e&&(this.C.getState()!==xg.ef||a.J()&&!d||this.C.T(c),d||!a.Ha()&&!a.J()||Gg(a,b,!1,e,!1))}}Ha(a){a=this.C.get(olympe.dc.ga(a));return!(null==a||!a.Ha())}name(a){let b,c;return null!=(c=null==(b=U(this,a))?void 0:b.Oa(olympe.dc.CloudObject.nameProp.X()))?c:''}model(a){return(a=(a=U(this,a,!0))?a.model():null)?a.tag():null}Ve(a){return(a=(a=U(this,
583
+ a,!0))&&a.Ve())?a.tag():null}ai(a){a=U(this,a,!0);return!(!a||!a.Ve())}Rb(a,b){a=(a=U(this,a,!0))&&a.model();return!(!a||!this.If(a.tag(),b))}source(a){return(a=U(this,a,!0))&&a.source()}Lf(a){a=U(this,a,!1);return!a||a.O}Oa(a,b,c){let d;a=null==(d=U(this,a,!0))?void 0:d.Oa(olympe.dc.ga(b),c);return void 0!==a?a:null}Cb(a,b=!1){var c=U(this,a,!0);a=new Map;if(c)for(const [d,e]of c)c=d[0],(c===rg||!b&&c===tg)&&a.set(d.substring(1),e);return a}Bk(a,b){return Kg(this,a,b).filter(([c])=>c.Ha()).map(([c,
584
+ ...d])=>[c.tag(),...d])}cb(a,b){a=U(this,a,!0);b=b.Ia()+b.X();b=null==a?void 0:a.get(b);a=[];if(b)for(const c of b.values())c.Ha()&&a.push(c.tag());return a}Zr(a,b,c){let d,e;a=null==(d=U(this,a,!0))?void 0:null==(e=d.get(b.Ia()+b.X()))?void 0:e.get(olympe.dc.ga(c));return!(null==a||!a.Ha())}Wm(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.Ia()+c.X()),void 0!==a)for(const e of a.values())e.Ha()&&b.push(e.tag());a=b}return a}Kb(a,b){var c=
585
585
  U(this,a,!0);const d=b.Ia()+b.X();c=null==c?void 0:c.get(d);if(1<(null==c?void 0:c.size))return this.H.warn(`Relation ${b.X()} to instance ${a} is not unique: found ${c.size} related items`),null;a=null==c?void 0:c.values().next().value;return(null==a?0:a.Ha())?a.tag():null}Vg(a,b,c){a=olympe.dc.ga(a);const d=Qg(this,a,b);d.delete(a);return c?(c=olympe.dc.ga(c),d.has(c)?Array.from(Qg(this,c,b.bc()).keys()).filter(e=>d.has(e)):[]):Array.from(d.keys())}Gr(a,b,c){if(!this.Ha(a))return null;b=Qg(this,
586
586
  a,b);const d=[olympe.dc.ga(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}Pm(a,b,c){return this.Wm(a,b).find(c)||null}Pw(a,b,c){return this.Wm(a,b).filter(c)}Mr(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.Ve();if(e.includes(c))throw Error(`Cycle detected when following recursively extend relations from base model instance "${a}".`);if(c&&!c.Ha())throw a=`Try to get all extensions of the model ${olympe.dc.ga(a)} but one of them does not exists (${c.tag()})`,
587
- 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}).`);return e.map(f=>f.tag())}If(a,b){const c=olympe.dc.ga(b);return!!this.Gr(a,olympe.dc.CloudObject.extendRel,d=>d===c)}ad(a){return this.bb(a,olympe.dc.CloudObject.instancesRel)}};olympe.dc.lb.prototype.getInstances=olympe.dc.lb.prototype.ad;olympe.dc.lb.prototype.isExtending=olympe.dc.lb.prototype.If;
587
+ 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}).`);return e.map(f=>f.tag())}If(a,b){const c=olympe.dc.ga(b);return!!this.Gr(a,olympe.dc.CloudObject.extendRel,d=>d===c)}ad(a){return this.cb(a,olympe.dc.CloudObject.instancesRel)}};olympe.dc.lb.prototype.getInstances=olympe.dc.lb.prototype.ad;olympe.dc.lb.prototype.isExtending=olympe.dc.lb.prototype.If;
588
588
  olympe.dc.lb.prototype.getExtendedModels=olympe.dc.lb.prototype.Mr;olympe.dc.lb.prototype.findAllRelated=olympe.dc.lb.prototype.Pw;olympe.dc.lb.prototype.findRelated=olympe.dc.lb.prototype.Pm;olympe.dc.lb.prototype.findRecursive=olympe.dc.lb.prototype.Gr;olympe.dc.lb.prototype.getRecursiveRelated=olympe.dc.lb.prototype.Vg;olympe.dc.lb.prototype.getUniqueRelated=olympe.dc.lb.prototype.Kb;olympe.dc.lb.prototype.getMultiRelated=olympe.dc.lb.prototype.Wm;olympe.dc.lb.prototype.isRelated=olympe.dc.lb.prototype.Zr;
589
- olympe.dc.lb.prototype.getRelated=olympe.dc.lb.prototype.bb;olympe.dc.lb.prototype.getProperties=olympe.dc.lb.prototype.Cb;olympe.dc.lb.prototype.getProperty=olympe.dc.lb.prototype.Sa;olympe.dc.lb.prototype.isPersisted=olympe.dc.lb.prototype.Lf;olympe.dc.lb.prototype.instanceOf=olympe.dc.lb.prototype.Rb;olympe.dc.lb.prototype.isModel=olympe.dc.lb.prototype.ai;olympe.dc.lb.prototype.extension=olympe.dc.lb.prototype.Ve;olympe.dc.lb.prototype.model=olympe.dc.lb.prototype.model;
589
+ olympe.dc.lb.prototype.getRelated=olympe.dc.lb.prototype.cb;olympe.dc.lb.prototype.getProperties=olympe.dc.lb.prototype.Cb;olympe.dc.lb.prototype.getProperty=olympe.dc.lb.prototype.Oa;olympe.dc.lb.prototype.isPersisted=olympe.dc.lb.prototype.Lf;olympe.dc.lb.prototype.instanceOf=olympe.dc.lb.prototype.Rb;olympe.dc.lb.prototype.isModel=olympe.dc.lb.prototype.ai;olympe.dc.lb.prototype.extension=olympe.dc.lb.prototype.Ve;olympe.dc.lb.prototype.model=olympe.dc.lb.prototype.model;
590
590
  olympe.dc.lb.prototype.name=olympe.dc.lb.prototype.name;olympe.dc.lb.prototype.exist=olympe.dc.lb.prototype.Ha;const Sg=olympe.dc.db.Database.F.ORIGIN,gg=olympe.dc.db.Database.F.DESTINATION,fg=olympe.dc.db.Database.F.Tk,Tg=olympe.dc.db.Database.F.Ki,Ug=olympe.dc.db.Database.F.lp,Vg=olympe.dc.db.Database.F.dl,Wg=Sg+gg,Xg=Tg+Tg,Yg=Array.from(Object.values(olympe.dc.Nb)).filter(a=>null!==a);function dg(a,b,c){let d=a.C.get(b);void 0===d&&(d=[],a.C.set(b,d));a.buffer.push([b,d.length]);d.push(c)}
591
591
  function hg(a){const b=a.J;a.F.forEach((c,d)=>{var e=b.get(d);if(c.F()||c.zd()){var f=e.get(Vg);f&&Zg(a,f,c.F(),d);c.zd()&&a.O.add(d)}for(const [n,p]of c.Cb()){var g=n[0]===fg,h=g?n.substring(1):n;f=a;var k=e,l=p;const q=k.get(Vg+Tg+h);q&&Zg(f,q,l,g);(k=k.get(Vg+Xg))&&Zg(f,k,h,l,g)}for(const n of c.ja())$g(a,e,...n);(e=c.aa)&&ah(a,b.get(e),c.ac,!c.zd(),d)});a.F.clear();a.G.clear();bh(a)}function eg(a,b){let c=a.F.get(b);void 0===c&&(c=new olympe.dc.db.rh(b),a.F.set(b,c));return c}
592
592
  function Zg(a,b,...c){b.forEach((d,e)=>{dg(a,e,d.bind(null,...c))})}function $g(a,b,c,d,e,f){var g=b.get(Vg+d+c);g&&Zg(a,g,f,e);(g=b.get(Vg+Wg))&&Zg(a,g,c,d,f,e);ch(a,c,d).forEach((h,k)=>{(k=b.get(Vg+Ug+k))&&Zg(a,k,c,d,h,f,e)})}function ah(a,b,c,d,e){Yg.forEach(f=>{(f=b.get(Vg+Ug+f))&&Zg(a,f,c,null,!0,d,e)})}function bh(a){a.T.run(()=>{const b=a.C;for(const [c,d]of a.buffer){let e,f,g;null==(e=b.get(c))||null==(g=(f=e)[d])||g.call(f)}});a.C.clear();a.buffer.length=0}
@@ -594,28 +594,28 @@ function ch(a,b,c){const d=b+c;let e=a.G.get(d);if(!e){const f=a.J.get(b);e=new
594
594
  olympe.dc.db.kf=class{constructor(a,b,c,d){this.H=a;this.C=b;this.F=new Set;this.mode=c;this.delay=d;this.G=!1;c!==olympe.dc.db.kf.C.pl&&this.init()}run(){const a=this.C;this.H.debug('Start garbage collector with',this.F.size,'instances to check');const b=[];for(const c of this.F){const d=a.get(c);!d||0<d.c||(this.H.debug('Remove unused instance',c,'from database'),a.Ud(c),b.push(c))}this.F.clear();this.C.Ga(olympe.dc.db.Database.C.So,b);this.G=!1}init(){const a=olympe.dc.db.Database.C.dr,b=olympe.dc.db.Database.C.op,
595
595
  c=olympe.dc.db.Database.C.sq,d=olympe.dc.db.Database.G.IDLE,e=f=>{this.F.add(f);this.C.getState()===d&&ig(this)};this.C.C(olympe.dc.db.Database.C.xm,e.bind(this));this.C.C(b,e.bind(this));this.C.C(a,f=>{this.F.delete(f)});this.C.addEventListener(olympe.dc.db.Database.C.Nv,()=>{this.run()});this.C.C(c,(f,...g)=>{this.H.error(g[0])})}};olympe.dc.db.kf.C={pl:0,Bv:1,yn:2};olympe.dc.db.kf.F=5E3;olympe.dc.db.tc=class{constructor(a){this.id=null!=a?a:olympe.Y.Cf();this.C=new Map}U(){return this.id}Jc(a){const b=olympe.dc.db.rh.C.Ol,c=olympe.dc.db.rh.C.Dc,d=olympe.dc.db.rh.C.pk;this.C.forEach((e,f)=>{const g=e.Vb();switch(e.getState()){case b:const h=e.tb();if(null===h)throw Error(`GraphPatch: try to create the instance ${f} with no source`);const k=e.T()?e.Cb():void 0;a.$c(f,h,k,g);break;case d:e.T()&&a.Qc(f,e.Cb(),g);break;case c:a.F(f,e.J(),g)}for(const [h,k,l]of e.yd())e=this.C.get(k),
596
596
  l?a.Ma(h,f,k,g,e.Vb()):a.ic(h,f,k,g,e.Vb())})}af(){return 0===this.C.size}O(){let a=0;this.C.forEach(b=>{a+=b.Cc()});return a}$c(a,b,c,d=null){b=this.J(a).create(b);'string'===typeof d&&this.Ma(olympe.dc.nc.Yc,a,d,d,null);c&&b.Em(c)}Qc(a,b,c=null){b&&this.J(a,c).Em(b)}F(a,b=olympe.dc.Nb.NONE,c=null){const d=this.C.get(a);if(d&&d.F())this.G(a,b);else{this.J(a,c).delete(b);for(const e of this.Bk(a,b,!1))this.C.get(e).Cb().clear(),this.aa(e,!0)}}Ma(a,b,c,d=null,e=null){this.J(b,d).link(a,c);this.J(c,
597
- e).Jb(a,b)}ic(a,b,c,d=null,e=null){this.J(b,d).unlink(a,c);this.J(c,e).Ub(a,b)}ea(a){var b=olympe.dc.ia();if(b.Ha(a)){const c=b.model(a),d=b.source(a),e=b.Cb(a,!0);Og(b,a).forEach((f,g)=>{e.set(`${olympe.dc.Oe.Me}${g}`,f)});this.$c(a,d,e,c);(b=b.Ve(a))&&this.Ma(olympe.dc.nc.ni,a,b);e.forEach(f=>{f instanceof olympe.dc.uc&&this.ea(f.X())})}}ad(){return function*(a){for(const b of a.values())if(b.F()||b.zd()||b.T())yield b}(this.C)}Lc(a){let b;return null!=(b=this.C.get(olympe.dc.ga(a)))?b:null}G(a,
598
- b=olympe.dc.Nb.NONE){a=this.Bk(a,b);for(const c of a)this.aa(c,!1),this.C.delete(c)}yd(){return function*(a){for(var b=a.next();!b.done;){b=b.value;const c=b.tag();yield*b.yd((d,e,f)=>[d,c,e,f]);b=a.next()}}(this.C.values())}Vg(a,b,c=(d,e)=>[d,e]){return this.ua(a,b,c)}*ua(a,b,c,d=[]){d.push(a);a=this.Lc(a);for(const [e,f]of a.bb(b))d.includes(e)||(yield*this.ua(e,b,c,d),yield c(e,f))}T(a,b,c){const d=this.C.get(b),e=this.C.get(c);d&&d.O(a,olympe.dc.wa.DESTINATION,c);e&&e.O(a,olympe.dc.wa.ORIGIN,
599
- b)}aa(a,b){const c=olympe.dc.wa.ORIGIN,d=olympe.dc.wa.DESTINATION,e=this.C.get(a);for(const [g,h,k]of e.yd())if(k||!b){e.O(g,d,h);var f=this.C.get(h);f&&f.O(g,c,a)}for(const [g,h,k]of e.gb())if(k||!b)e.O(g,c,h),(f=this.C.get(h))&&f.O(g,d,a)}*Rr(a){let b;for(const [c,d]of(null==(b=this.Lc(a))?void 0:b.bb(olympe.dc.CloudObject.instancesRel))||[])d&&(a=this.C.get(c),a.zd()||(yield a))}Bk(a,b,c=!0){const d=olympe.dm.Relation.C.im,e=olympe.dm.Relation.C.vm,f=olympe.dc.wa.ORIGIN,g=olympe.dc.ia();a=new Set([a]);
600
- const h=new Set;for(const l of a){var k=this.C.get(l);if(void 0!==k){for(const [n,p,q]of k.yd())q&&Lg(g,n,b)&e?a.add(p):c||q||h.add(`${l}.${n}.${p}`);for(const [n,p,q]of k.gb())q&&Lg(g,n,b)&d?a.add(p):c||q||h.add(`${p}.${n}.${l}`)}for(const [n,p,q]of Pg(g,l))k=p===f?d:e,!h.has(p===f?`${q}.${n}.${l}`:`${l}.${n}.${q}`)&&Lg(g,n,b)&k&&a.add(q)}return Array.from(a).filter(l=>this.C.has(l))}J(a,b){let c=this.C.get(a);void 0===c&&(c=new olympe.dc.db.rh(a),this.C.set(a,c));return b?c.Ga(b):c}Z(a){const b=
601
- olympe.dc.wa.DESTINATION;for(const [c,d]of this.ja(a))if(a=c.tag(),d.zd())this.G(a,d.J());else if(c.zd())d.F()&&this.G(a,c.J());else{c.Cb().forEach((e,f)=>{void 0!==d.Sa(f)&&c.ea(f)});for(const [e,f,g]of c.yd()){const h=d.yb(e,b,f);void 0!==h&&g!==h&&this.T(e,a,f)}}return this}*ja(a){var b=this.C;const c=a.C,d=(a=a.O()>this.O())?c:b;b=a?b:c;for(const [e,f]of b)b=d.get(e),void 0!==b&&(yield[a?f:b,a?b:f])}};olympe.dc.db.tc.ya=[olympe.dc.Writable,olympe.dc.Xu];const mg=olympe.dc.db.Database.C,dh=olympe.dc.db.Database.F.Ki,eh=olympe.dc.db.Database.F.It,fh=olympe.dc.db.Database.F.Me,gh=olympe.dc.db.Database.F.Tk,hh=olympe.dc.db.Database.F.dl,W=olympe.dc.wa.ORIGIN,X=olympe.dc.wa.DESTINATION,ih=olympe.dc.nc.Yc,jh=olympe.dc.nc.ni;function Kf(a,b,c=!1){const d=a.get(fh+b);return c||void 0!==d?d:a.get(eh+b)}
597
+ e).Fb(a,b)}ic(a,b,c,d=null,e=null){this.J(b,d).unlink(a,c);this.J(c,e).Ub(a,b)}ea(a){var b=olympe.dc.ia();if(b.Ha(a)){const c=b.model(a),d=b.source(a),e=b.Cb(a,!0);Og(b,a).forEach((f,g)=>{e.set(`${olympe.dc.Oe.Me}${g}`,f)});this.$c(a,d,e,c);(b=b.Ve(a))&&this.Ma(olympe.dc.nc.ni,a,b);e.forEach(f=>{f instanceof olympe.dc.uc&&this.ea(f.X())})}}ad(){return function*(a){for(const b of a.values())if(b.F()||b.zd()||b.T())yield b}(this.C)}Lc(a){let b;return null!=(b=this.C.get(olympe.dc.ga(a)))?b:null}G(a,
598
+ b=olympe.dc.Nb.NONE){a=this.Bk(a,b);for(const c of a)this.aa(c,!1),this.C.delete(c)}yd(){return function*(a){for(var b=a.next();!b.done;){b=b.value;const c=b.tag();yield*b.yd((d,e,f)=>[d,c,e,f]);b=a.next()}}(this.C.values())}Vg(a,b,c=(d,e)=>[d,e]){return this.ua(a,b,c)}*ua(a,b,c,d=[]){d.push(a);a=this.Lc(a);for(const [e,f]of a.cb(b))d.includes(e)||(yield*this.ua(e,b,c,d),yield c(e,f))}T(a,b,c){const d=this.C.get(b),e=this.C.get(c);d&&d.O(a,olympe.dc.wa.DESTINATION,c);e&&e.O(a,olympe.dc.wa.ORIGIN,
599
+ b)}aa(a,b){const c=olympe.dc.wa.ORIGIN,d=olympe.dc.wa.DESTINATION,e=this.C.get(a);for(const [g,h,k]of e.yd())if(k||!b){e.O(g,d,h);var f=this.C.get(h);f&&f.O(g,c,a)}for(const [g,h,k]of e.hb())if(k||!b)e.O(g,c,h),(f=this.C.get(h))&&f.O(g,d,a)}*Rr(a){let b;for(const [c,d]of(null==(b=this.Lc(a))?void 0:b.cb(olympe.dc.CloudObject.instancesRel))||[])d&&(a=this.C.get(c),a.zd()||(yield a))}Bk(a,b,c=!0){const d=olympe.dm.Relation.C.im,e=olympe.dm.Relation.C.vm,f=olympe.dc.wa.ORIGIN,g=olympe.dc.ia();a=new Set([a]);
600
+ const h=new Set;for(const l of a){var k=this.C.get(l);if(void 0!==k){for(const [n,p,q]of k.yd())q&&Lg(g,n,b)&e?a.add(p):c||q||h.add(`${l}.${n}.${p}`);for(const [n,p,q]of k.hb())q&&Lg(g,n,b)&d?a.add(p):c||q||h.add(`${p}.${n}.${l}`)}for(const [n,p,q]of Pg(g,l))k=p===f?d:e,!h.has(p===f?`${q}.${n}.${l}`:`${l}.${n}.${q}`)&&Lg(g,n,b)&k&&a.add(q)}return Array.from(a).filter(l=>this.C.has(l))}J(a,b){let c=this.C.get(a);void 0===c&&(c=new olympe.dc.db.rh(a),this.C.set(a,c));return b?c.Ga(b):c}Z(a){const b=
601
+ olympe.dc.wa.DESTINATION;for(const [c,d]of this.ja(a))if(a=c.tag(),d.zd())this.G(a,d.J());else if(c.zd())d.F()&&this.G(a,c.J());else{c.Cb().forEach((e,f)=>{void 0!==d.Oa(f)&&c.ea(f)});for(const [e,f,g]of c.yd()){const h=d.yb(e,b,f);void 0!==h&&g!==h&&this.T(e,a,f)}}return this}*ja(a){var b=this.C;const c=a.C,d=(a=a.O()>this.O())?c:b;b=a?b:c;for(const [e,f]of b)b=d.get(e),void 0!==b&&(yield[a?f:b,a?b:f])}};olympe.dc.db.tc.ya=[olympe.dc.Writable,olympe.dc.Xu];const mg=olympe.dc.db.Database.C,dh=olympe.dc.db.Database.F.Ki,eh=olympe.dc.db.Database.F.It,fh=olympe.dc.db.Database.F.Me,gh=olympe.dc.db.Database.F.Tk,hh=olympe.dc.db.Database.F.dl,W=olympe.dc.wa.ORIGIN,X=olympe.dc.wa.DESTINATION,ih=olympe.dc.nc.Yc,jh=olympe.dc.nc.ni;function Kf(a,b,c=!1){const d=a.get(fh+b);return c||void 0!==d?d:a.get(eh+b)}
602
602
  function Yf(a,b){const c=a.model();if(null!==c){if(c===b)return;a.unlink(ih,c)}a.link(ih,b);b.forEach((d,e)=>{if(e[0]===fh||e[0]===eh)e=e.substring(1),kh(a,e,d)});null===a.G||!b.e&&b!==a||a.db.aa(a,!0)}function Zf(a,b){const c=a.Ve();if(null!==c){if(c===b)return;a.unlink(jh,c)}a.link(jh,b);const d=new Map;b.forEach((e,f)=>{if(f[0]===fh||f[0]===eh)f=f.substring(1),a.has(fh+f)||(a.set(eh+f,e),d.set(f,e))});lh(a,d)}
603
603
  function $f(a,b){a.unlink(ih,b);a.forEach((c,d)=>{c=d.substring(1);kh(a,c,null)});a.db.aa(a,!1)}function ag(a,b){a.unlink(jh,b);const c=new Map;a.forEach((d,e)=>{e[0]===eh&&(a.delete(e),d=e.substring(1),c.set(d,null))});lh(a,c)}function bg(a){a.c++;1===a.c&&a.db.F(mg.dr,a.C)}
604
604
  function cg(a){0<a.c?--a.c:a.db.F(mg.sq,a.C,`Try to decrease references on instance ${a.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===a.c&&a.db.F(mg.xm,a.C)}
605
605
  function jg(a,b,c){const d=fh+b;var e=a.get(d);e=void 0===e?null:e;if(!mh(e,c))if(nh(a,b,e,c,!0),e=eh+b,null===c){a.delete(d);let f;c=null==(f=a.Ve())?void 0:Kf(f,b);c=void 0===c?null:c;null!==c&&a.set(e,c);lh(a,(new Map).set(b,c))}else void 0!==a.get(e)&&a.delete(e),a.set(d,c),lh(a,(new Map).set(b,c))}function Bg(a,b,c,d){const e=oh(a,hh+b);return e.has(c)?!1:(e.set(c,d),bg(a),a.db.F(mg.Wn,a.C,b,c),!0)}function zg(a,b,c){const d=ph(a,hh+b,c);void 0!==d&&(cg(a),a.db.F(mg.Xn,a.C,b,c));return d}
606
606
  function Hg(a,b,c,d){const e=(...f)=>{var g=f.length;const h=f[g-2];(g=a.db.get(f[g-1]))&&(h?bg(g):cg(g));d(...f)};return Bg(a,b,c,e)?e:null}function mh(a,b){return a instanceof Date?b instanceof Date&&a.getTime()===b.getTime():null!==a&&'function'===typeof a.Fa?a.Fa(b):a===b}
607
- function nh(a,b,c,d,e){c instanceof olympe.dc.uc&&(qh(a.db.get(c.X())),a.db.ua(c.X()));d instanceof olympe.dc.uc&&(c=a.db.G(d.X(),!0),c.F&&c.F.tag!==a.C&&a.db.ib().fatal('Instance',d.X(),'referenced multiple times!\nThis instance is currently property of',c.F.tag,'(for the property '+c.F.Ja+')','and is assigned as a property of',a.C,'(for the property '+b+')'),d=c,a=a.C,void 0===d.F&&(bg(d),d.db.ac(d.C,a,b)),d.F={tag:a,Ja:b,jy:e})}function rh(a,b,c,d){a.e&&a.db.Uh(a.C,b,c,d)}
607
+ function nh(a,b,c,d,e){c instanceof olympe.dc.uc&&(qh(a.db.get(c.X())),a.db.ua(c.X()));d instanceof olympe.dc.uc&&(c=a.db.G(d.X(),!0),c.F&&c.F.tag!==a.C&&a.db.ab().fatal('Instance',d.X(),'referenced multiple times!\nThis instance is currently property of',c.F.tag,'(for the property '+c.F.Ja+')','and is assigned as a property of',a.C,'(for the property '+b+')'),d=c,a=a.C,void 0===d.F&&(bg(d),d.db.ac(d.C,a,b)),d.F={tag:a,Ja:b,jy:e})}function rh(a,b,c,d){a.e&&a.db.Uh(a.C,b,c,d)}
608
608
  function lh(a,b,c=[]){const d=a.get(W+ih);void 0!==d&&d.forEach(e=>{b.forEach((f,g)=>kh(e,g,f))});a=a.get(W+jh);void 0!==a&&a.forEach((e,f)=>{if(!c.includes(e.tag())){var g=new Map;b.forEach((h,k)=>{e.has(fh+k)||(g.set(k,h),null!==h?e.set(eh+k,h):e.delete(eh+k))});lh(e,g,[...c,f])}})}function oh(a,b){let c=a.get(b);void 0===c&&(c=new Map,a.set(b,c));return c}function sh(a,b,c,d,e){a.db.$h(a.C,b,c,d.C,e)}
609
609
  function ph(a,b,c){const d=a.get(b);if(void 0!==d){const e=d.get(c);d.delete(c);0===d.size&&a.delete(b);return e}}function kh(a,b,c){if(!a.has(dh+b)){const d=gh+b,e=a.get(d);mh(c,void 0!==e?e:null)||(null===c?a.delete(d):a.set(d,c),rh(a,b,c,null!==c))}}function kg(a){a.forEach((b,c)=>{const d=c[0];if(d===W||d===X){const e=c.substring(1),f=d===W?X:W;b.forEach(g=>{g.e&&(sh(a,e,d,g,!0),sh(g,e,f,a,!0))})}else if(d===dh||d===gh)c=c.substring(1),rh(a,c,b,d===gh)})}
610
610
  function lg(a){a.forEach((b,c)=>{const d=c[0];if(d!==hh){var e=c.substring(1);d===W?b.forEach(f=>{f.unlink(e,a)}):d===X?b.forEach(f=>{a.unlink(e,f)}):d===dh?a.update(e,null):d===fh&&jg(a,e,null);a.delete(c)}});if(void 0!==a.F){const b=a.db.get(a.F.tag),c=a.F.jy;let d,e;(null==(d=b.get(`${c?fh:dh}${a.F.Ja}`))?void 0:null==(e=d.X)?void 0:e.call(d))===a.C&&(c?jg(b,a.F.Ja,null):b.update(a.F.Ja,null))}}function qh(a){void 0!==a.F&&(cg(a),a.db.ac(a.C,a.F.tag,a.F.Ja),a.F=void 0)}
611
- olympe.dc.db.Instance=class extends Map{constructor(a,b){super();this.C=a;this.G=null;this.e=!1;this.F=void 0;this.c=0;this.O=!1;this.db=b}tag(){return this.C}Ha(){return this.e}J(){return this.db.J(this.C)}source(){return this.G}model(){const a=this.get(X+ih);let b;return null!=(b=a&&Array.from(a.values())[0])?b:null}Ve(){const a=this.get(X+jh);let b;return null!=(b=a&&Array.from(a.values())[0])?b:null}toString(){var a=this.Sa(olympe.dc.CloudObject.nameProp.X());a=`Instance: ${this.C}, Exist: ${this.e}, Name: ${a}`;
612
- var b=this.model();if(b){var c=b.Sa(olympe.dc.CloudObject.nameProp.X())||'No model name';a+=`\nModel: ${b.C}, Exist: ${b.e}, Model name: ${c}`}else a+='\nModel: no model';(b=this.Ve())?(c=b.Sa(olympe.dc.CloudObject.nameProp.X())||'No extension name',a+=`\nExtension: ${b.C}, Exist: ${b.e}, Extension name: ${c}`):a+='\nExtension: no extension';return a}Sa(a,b=!1){const c=this.get(dh+a);return b||void 0!==c?c:this.get(gh+a)}update(a,b){const c=dh+a;var d=this.get(c);d=void 0===d?null:d;if(!mh(d,b))if(nh(this,
611
+ olympe.dc.db.Instance=class extends Map{constructor(a,b){super();this.C=a;this.G=null;this.e=!1;this.F=void 0;this.c=0;this.O=!1;this.db=b}tag(){return this.C}Ha(){return this.e}J(){return this.db.J(this.C)}source(){return this.G}model(){const a=this.get(X+ih);let b;return null!=(b=a&&Array.from(a.values())[0])?b:null}Ve(){const a=this.get(X+jh);let b;return null!=(b=a&&Array.from(a.values())[0])?b:null}toString(){var a=this.Oa(olympe.dc.CloudObject.nameProp.X());a=`Instance: ${this.C}, Exist: ${this.e}, Name: ${a}`;
612
+ var b=this.model();if(b){var c=b.Oa(olympe.dc.CloudObject.nameProp.X())||'No model name';a+=`\nModel: ${b.C}, Exist: ${b.e}, Model name: ${c}`}else a+='\nModel: no model';(b=this.Ve())?(c=b.Oa(olympe.dc.CloudObject.nameProp.X())||'No extension name',a+=`\nExtension: ${b.C}, Exist: ${b.e}, Extension name: ${c}`):a+='\nExtension: no extension';return a}Oa(a,b=!1){const c=this.get(dh+a);return b||void 0!==c?c:this.get(gh+a)}update(a,b){const c=dh+a;var d=this.get(c);d=void 0===d?null:d;if(!mh(d,b))if(nh(this,
613
613
  a,d,b,!1),d=gh+a,null===b){this.delete(c);let e;b=null==(e=this.model())?void 0:Kf(e,a);void 0!==b?(this.set(d,b),rh(this,a,b,!0)):rh(this,a,null,!1)}else this.set(c,b),this.delete(d),rh(this,a,b,!1)}link(a,b){var c=W+a;const d=oh(this,X+a);c=oh(b,c);d.has(b.C)||(d.set(b.C,b),c.set(this.C,this),this.db.F(mg.bk,this.C,a,X,b.C),this.db.F(mg.bk,b.C,a,W,this.C),this.e&&b.e&&(sh(this,a,X,b,!0),sh(b,a,W,this,!0)))}unlink(a,b){const c=W+a;void 0!==ph(this,X+a,b.C)&&(ph(b,c,this.C),this.db.F(mg.gm,this.C,
614
- a,X,b.C),this.db.F(mg.gm,b.C,a,W,this.C),this.e&&b.e&&(sh(this,a,X,b,!1),sh(b,a,W,this,!1)))}persist(){this.O=!0;return this}clear(){this.forEach((a,b)=>{const c=b[0];if(c===W||c===X){const d=b.substring(1),e=c===W?X:W;a.forEach(f=>{const g=f.get(e+d);g.delete(this.C);0===g.size&&f.delete(e+d)})}c===dh&&a instanceof olympe.dc.uc&&qh(this.db.get(a.X()))});void 0!==this.F&&this.db.get(this.F.tag).delete(dh+this.F.Ja)}};olympe.dc.db.Instance.C={PA:'instance',IB:'rel',dl:'cb',fm:'ref',TRANSACTION:'tx'};olympe.dc.db.rh=class a{constructor(b){this.hc=b;this.Z=this.ab=null;this.Ob=olympe.dc.Nb.NONE;this.G=a.C.pk;this.C=this.pb=this.ac=this.aa=this.properties=null}tag(){return this.hc}Vb(){return this.Z}tb(){return this.ab}getState(){return this.G}Ga(b){if(null===this.Z)this.Z=b;else if(this.Z!==b)throw Error(`Try to set a model relation with another model ${b} than the one set initially ${this.Z}`);return this}J(){return this.G===a.C.Dc?this.Ob:olympe.dc.Nb.NONE}create(b){this.G=a.C.Ol;this.ab=null!=
614
+ a,X,b.C),this.db.F(mg.gm,b.C,a,W,this.C),this.e&&b.e&&(sh(this,a,X,b,!1),sh(b,a,W,this,!1)))}persist(){this.O=!0;return this}clear(){this.forEach((a,b)=>{const c=b[0];if(c===W||c===X){const d=b.substring(1),e=c===W?X:W;a.forEach(f=>{const g=f.get(e+d);g.delete(this.C);0===g.size&&f.delete(e+d)})}c===dh&&a instanceof olympe.dc.uc&&qh(this.db.get(a.X()))});void 0!==this.F&&this.db.get(this.F.tag).delete(dh+this.F.Ja)}};olympe.dc.db.Instance.C={PA:'instance',IB:'rel',dl:'cb',fm:'ref',TRANSACTION:'tx'};olympe.dc.db.rh=class a{constructor(b){this.hc=b;this.Z=this.bb=null;this.Ob=olympe.dc.Nb.NONE;this.G=a.C.pk;this.C=this.pb=this.ac=this.aa=this.properties=null}tag(){return this.hc}Vb(){return this.Z}tb(){return this.bb}getState(){return this.G}Ga(b){if(null===this.Z)this.Z=b;else if(this.Z!==b)throw Error(`Try to set a model relation with another model ${b} than the one set initially ${this.Z}`);return this}J(){return this.G===a.C.Dc?this.Ob:olympe.dc.Nb.NONE}create(b){this.G=a.C.Ol;this.bb=null!=
615
615
  b?b:null;return this}delete(b=olympe.dc.Nb.NONE){this.G=a.C.Dc;this.Ob=b;this.properties=null;return this}la(b,c){if(this.G===a.C.Dc)return this;this.properties||(this.properties=new Map);this.properties.set(b,c);return this}Em(b){this.G!==a.C.Dc&&(this.properties||(this.properties=new Map),b.forEach((c,d)=>{this.properties.set(d,c)}))}Uc(b,c){if(null!==this.aa&&this.aa!==b)throw Error('An instance should never be set as complex property of multiple instances');this.aa=b;this.ac=c}ea(b){let c;null==
616
- (c=this.properties)||c.delete(b);0===this.properties.size&&(this.properties=null)}link(b,c){null===this.pb&&(this.pb=new Map);b===olympe.dc.nc.Yc&&this.Ga(c);this.sa(this.pb,b,c,!0);return this}unlink(b,c){null===this.pb&&(this.pb=new Map);b===olympe.dc.nc.Yc&&this.Ga(c);this.sa(this.pb,b,c,!1);return this}Jb(b,c){null===this.C&&(this.C=new Map);this.sa(this.C,b,c,!0)}Ub(b,c){null===this.C&&(this.C=new Map);this.sa(this.C,b,c,!1)}yb(b,c,d){if(c=c===olympe.dc.wa.ORIGIN?this.C:this.pb)return(b=c.get(b))&&
617
- b.get(d)}O(b,c,d){const e=(c=c===olympe.dc.wa.ORIGIN?this.C:this.pb)&&c.get(b);e&&e.delete(d);e&&0===e.size&&c.delete(b)}F(){return this.G===a.C.Ol}zd(){return this.G===a.C.Dc}Cc(){let b=this.properties?this.properties.size:0,c;null==(c=this.pb)||c.forEach(d=>{b+=d.size});return b}T(){return null!==this.properties}Tc(){return null!==this.pb||null!==this.C}Cb(){let b;return null!=(b=this.properties)?b:new Map}Sa(b){if(this.properties)return this.properties.get(b)}bb(b,c=(d,e)=>[d,e]){return function*(d){if(d=
618
- d&&d.get(b.X()))for(const [e,f]of d)yield c(e,f)}(b.Ia()===olympe.dc.wa.ORIGIN?this.C:this.pb)}Kb(b){const c=b.Ia()===olympe.dc.wa.ORIGIN?this.C:this.pb;return(b=c&&c.get(b.X()))&&0!==b.size?Array.from(b.keys())[0]:null}yd(b=(c,d,e)=>[c,d,e]){return this.ua(this.pb,b)}gb(b=(c,d,e)=>[c,d,e]){return this.ua(this.C,b)}ja(b=(c,d,e,f)=>[c,d,e,f]){const c=olympe.dc.wa.ORIGIN,d=olympe.dc.wa.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.ua.bind(this),
616
+ (c=this.properties)||c.delete(b);0===this.properties.size&&(this.properties=null)}link(b,c){null===this.pb&&(this.pb=new Map);b===olympe.dc.nc.Yc&&this.Ga(c);this.sa(this.pb,b,c,!0);return this}unlink(b,c){null===this.pb&&(this.pb=new Map);b===olympe.dc.nc.Yc&&this.Ga(c);this.sa(this.pb,b,c,!1);return this}Fb(b,c){null===this.C&&(this.C=new Map);this.sa(this.C,b,c,!0)}Ub(b,c){null===this.C&&(this.C=new Map);this.sa(this.C,b,c,!1)}yb(b,c,d){if(c=c===olympe.dc.wa.ORIGIN?this.C:this.pb)return(b=c.get(b))&&
617
+ b.get(d)}O(b,c,d){const e=(c=c===olympe.dc.wa.ORIGIN?this.C:this.pb)&&c.get(b);e&&e.delete(d);e&&0===e.size&&c.delete(b)}F(){return this.G===a.C.Ol}zd(){return this.G===a.C.Dc}Cc(){let b=this.properties?this.properties.size:0,c;null==(c=this.pb)||c.forEach(d=>{b+=d.size});return b}T(){return null!==this.properties}Tc(){return null!==this.pb||null!==this.C}Cb(){let b;return null!=(b=this.properties)?b:new Map}Oa(b){if(this.properties)return this.properties.get(b)}cb(b,c=(d,e)=>[d,e]){return function*(d){if(d=
618
+ d&&d.get(b.X()))for(const [e,f]of d)yield c(e,f)}(b.Ia()===olympe.dc.wa.ORIGIN?this.C:this.pb)}Kb(b){const c=b.Ia()===olympe.dc.wa.ORIGIN?this.C:this.pb;return(b=c&&c.get(b.X()))&&0!==b.size?Array.from(b.keys())[0]:null}yd(b=(c,d,e)=>[c,d,e]){return this.ua(this.pb,b)}hb(b=(c,d,e)=>[c,d,e]){return this.ua(this.C,b)}ja(b=(c,d,e,f)=>[c,d,e,f]){const c=olympe.dc.wa.ORIGIN,d=olympe.dc.wa.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.ua.bind(this),
619
619
  this.pb,this.C)}sa(b,c,d,e){if(this.G!==a.C.Dc||!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)}}*ua(b,c){if(null!==b)for(const [d,e]of b){b=e.entries();for(const [f,g]of b)yield c(d,f,g)}}};olympe.dc.db.rh.C={Ol:0,pk:1,Dc:2};olympe.dc.db.Gu=class{constructor(a,b,c,d){this.H=a;this.view=b;this.C=c;(this.active=d.get('active'))&&this.init()}debug(a){const b=olympe.dc.ga(a);if(this.C.has(b)){var c=this.C.get(a);a='\n[DEBUG - DATABASE]\n'+c.toString();if(!c.Ha()){const d=[];for(;null!==c&&!d.includes(c.tag());)d.push(c.tag()),c=c.model();c=this.C.get(d[d.length-1]);const e=olympe.dc.db.Database.F.Ki+olympe.dc.CloudObject.nameProp.X();d.push('???');a+='\n\nThe instance <<'+b+'>> does not exists because the instance '+c.tag()+
620
620
  ' (name: '+c.get(e)+') has no model.\nList: '+d.join(' --M--\x3e ')}this.H.info(a)}else this.H.info('[DATABASE] Instance',b,'has never been created or referred by the database')}init(){const a=olympe.dc.db.Database.C.Do,b=olympe.dc.db.Database.C.rl,c=olympe.dc.db.Database.C.Dc,d=olympe.dc.db.Database.C.bk,e=olympe.dc.db.Database.C.gm,f=olympe.dc.db.Database.C.Wn,g=olympe.dc.db.Database.C.Xn,h=()=>{};this.C.C(olympe.dc.db.Database.C.Co,()=>{});this.C.C(a,()=>{});this.C.C(b,k=>{this.C.yb(()=>{Ig(this.view,
621
621
  k,h,`monitorRelations${k}`)})});this.C.C(c,k=>{this.C.yb(()=>{Jg(this.view,k,`monitorRelations${k}`)})});this.C.C(d,()=>{});this.C.C(e,()=>{});this.C.C(f,()=>{});this.C.C(g,()=>{})}};olympe.dc.db.nr=class{constructor(a,b,c,d,e){this.H=a;this.C=b;this.ia=c;this.G=d;this.J=e}write(a){if(this.G){const b=new th(this.ia);a.Jc(b);this.H.info(b.flush())}this.C.Bf();a.Jc(this);this.C.Vd()}$c(a,b,c){this.C.create(a,b,c,this.J)}Qc(a,b){this.C.update(a,b)}F(a,b=olympe.dc.Nb.NONE){for(const c of Jf(this.ia,a,b))this.C.ua(c)}Ma(a,b,c){this.C.link(a,b,c)}ic(a,b,c){this.C.unlink(a,b,c)}};
@@ -627,14 +627,14 @@ olympe.W.config(function(a){F(a,olympe.dc.db.V.To,olympe.dc.db.kf.C.yn);F(a,olym
627
627
  (b,c,d,e,f,g,h)=>{e=g?olympe.dc.db.kf.C.pl:e;d=(new Map).set('selfTag',d).set('garbageCollector',e).set('garbageCollectorDelay',f).set('debug',h);return new olympe.dc.db.Database(b,c,d)});C(a,olympe.dc.db.R.ll,olympe.dc.lb,olympe.dc.db.R.Ca,olympe.dc.db.R.Ej);E(a,olympe.dc.db.R.Ci,[olympe.dc.db.R.Ea],b=>b.wy);E(a,olympe.dc.db.R.Ea,[olympe.dc.db.R.Ca,olympe.dc.db.R.Ej,olympe.dc.db.R.ll,new olympe.W.oa(olympe.dc.V.Rf),new olympe.W.oa(olympe.dc.db.V.fl),new olympe.W.oa(olympe.dc.db.V.Ci),new olympe.W.oa(olympe.dc.db.V.Fu),
628
628
  new olympe.W.oa(olympe.dc.db.V.Eu)],(b,c,d,e,f,g,h,k)=>{g=(new Map).set('active',g).set('counters',h).set('callbacks',k);e=(new Map).set('debug',e).set('bufferTimeout',f);return new olympe.dc.db.lt(b,c,d,e,g)})},'olympe.dc.db');olympe.W.run([olympe.dc.db.R.Ej,olympe.dc.db.R.Ci],(a,b)=>{olympe.Yd().db=a;olympe.Yd().dbMonitor=b},'DC.DB debug service injection');olympe.dc.query={};function xh(a){return(b,c)=>{const d=null===b,e=null===c;return d||e?d&&e?0:d?1:-1:a(b,c)}}
629
629
  olympe.dc.query.gf=class{constructor(a,b,c){this.db=olympe.dc.ia();this.C=a;this.Ja=b;this.Ai=c}ha(){return{p:this.Ja.X(),o:this.Ai}}toString(){return'sortByQueryPart-'+this.Ai+this.Ja.X()}Rg(){const a=this.db.Kb(this.Ja,olympe.dm.Property.typeRel),b=olympe.dc.ga;if(this.db.If(a,olympe.dm.String))return xh((c,d)=>c.localeCompare(d));if(a===b(olympe.dm.Number)||a===b(olympe.dm.Boolean))return xh((c,d)=>c-d);if(a===b(olympe.dm.DateTime))return xh((c,d)=>c.getTime()-d.getTime());if(a===b(olympe.dm.Color))return xh((c,
630
- d)=>c.compare(d));olympe.ka.ib('dc.query').warn(`No comparator found for type with tag ${a}`);return xh(()=>-1)}Sa(){return this.Ja}};olympe.dc.Ne=class{X(){}};olympe.dc.Ne.prototype.getTag=olympe.dc.Ne.prototype.X;olympe.dc.MA=olympe.dc.Ne;function yh(a){let b;if(null==(b=a.C)?0:b.af())if(a=a.J,!a.O){let c;null==(c=a.T)||c.call(a)}}function zh(a,b,c,d,e){yh(a);let f,g;b?null==(f=a.C)||f.Ma(c,d,e):null==(g=a.C)||g.ic(c,d,e)}
630
+ d)=>c.compare(d));olympe.ka.ab('dc.query').warn(`No comparator found for type with tag ${a}`);return xh(()=>-1)}Oa(){return this.Ja}};olympe.dc.Ne=class{X(){}};olympe.dc.Ne.prototype.getTag=olympe.dc.Ne.prototype.X;olympe.dc.MA=olympe.dc.Ne;function yh(a){let b;if(null==(b=a.C)?0:b.af())if(a=a.J,!a.O){let c;null==(c=a.T)||c.call(a)}}function zh(a,b,c,d,e){yh(a);let f,g;b?null==(f=a.C)||f.Ma(c,d,e):null==(g=a.C)||g.ic(c,d,e)}
631
631
  olympe.dc.query.Ku=class{constructor(a,b,c,d){this.H=a;this.source=b;this.F=c;this.J=d;this.C=this.G=null;this.db=olympe.dc.ia()}watch(a,b){if(this.db.source(a)===this.source){var c=`${this.F}:${a}:notif`;jf(this.db,a,(d,e)=>{if(d){yh(this);let f;null==(f=this.C)||f.ea(e)}else if(b&&Fg(this.db,e,c),!this.db.Ha(e)){yh(this);let f;null==(f=this.C)||f.F(e,olympe.dc.Nb.NONE)}},c);b&&Eg(this.db,a,(d,e,f)=>{yh(this);let g;f||null!=(g=this.C)&&g.Qc(a,new Map([[d,e]]))},c)}}stop(a){gf(this.db,a,`${this.F}:${a}:notif`)}};olympe.dc.query.Xj={ASC:'ASC',DESC:'DESC'};function Ah(a){const b=Bh(a.query),c=new Map;for(let e=b.length;0<=e;e--){const f=0<e?b[e-1].U():a.G,g=0<e?b[e-1].C:'root',h=0<e&&b[e-1].T(),k=a.C.get(f),l=new Set(k.ad()),n=new Map,p=a.J.has(f);let q=p?';':'';if(c.has(f)){const [r,t,u]=c.get(f);c.delete(f);q+=u;r.forEach((x,y)=>{for(const z of k.F(y)){let A;n.set(z,Array.from(x).map(D=>p?`${y};${D}`:D).reduce((D,O)=>D.add(O),null!=(A=n.get(z))?A:new Set))}l.delete(y)});t&&l.forEach(x=>{const y=p?`${x};${u}`:u;for(const z of k.F(x)){let A;n.set(z,
632
632
  (null!=(A=n.get(z))?A:new Set).add(y))}})}else l.forEach(r=>{const t=p?`${r};`:'';for(const u of k.F(r))n.has(u)?n.get(u).add(t):n.set(u,(new Set).add(t))});if(0<e&&c.has(g)){const [r,t,u]=c.get(g),x=new Map;n.forEach((y,z)=>{let A;null==(A=r.get(z))||A.forEach(D=>{let O;const M=null!=(O=x.get(z))?O:new Set;y.forEach(xa=>M.add(xa+D));x.set(z,M)});n.delete(z);r.delete(z)});t&&n.forEach((y,z)=>{x.set(z,new Set(Array.from(y).map(A=>A+u)))});b[e-1].T()&&r.forEach((y,z)=>{x.set(z,new Set(Array.from(y).map(A=>
633
- q+A)))});c.set(g,[x,t&&h,q+u])}else c.set(g,[n,h,q])}let d;a=null==(d=c.get('root'))?void 0:d[0].get('root');return Array.from(null!=a?a:[]).map(e=>e.slice(0,-1).split(';'))}function Ch(a){if(null===a.F){const b={Hb:a.query.Rg(),Ed:a.Ed,max:a.query.C.max,offset:a.query.C.offset};a.F=olympe.dc.Qa.from(a.Z,Ah(a),b)}return a.F}function Dh(a,b){a.T=b}function Eh(a){if(!a.O){null!==a.F&&(a.Z=a.F);a.F=null;a.O=!0;let b;null==(b=a.T)||b.call(a)}}
633
+ q+A)))});c.set(g,[x,t&&h,q+u])}else c.set(g,[n,h,q])}let d;a=null==(d=c.get('root'))?void 0:d[0].get('root');return Array.from(null!=a?a:[]).map(e=>e.slice(0,-1).split(';'))}function Ch(a){if(null===a.F){const b={Ib:a.query.Rg(),Ed:a.Ed,max:a.query.C.max,offset:a.query.C.offset};a.F=olympe.dc.Ra.from(a.Z,Ah(a),b)}return a.F}function Dh(a,b){a.T=b}function Eh(a){if(!a.O){null!==a.F&&(a.Z=a.F);a.F=null;a.O=!0;let b;null==(b=a.T)||b.call(a)}}
634
634
  function Fh(a,b){let c;return null!=(c=a.C.get(b).ad())?c:[]}function Gh(a,b,c){let d,e;return null!=(e=null==(d=a.C.get(c))?void 0:d.has(b))?e:!1}function Hh(a,b,c=a.G,d='root'){const e=a.C.get(c);if(!e)return a.H.error('Try to insert result entry to a higher level than possible'),null;const f=!e.has(b);e.G(b,d)&&Eh(a);let g;f&&(null==(g=a.Ge)||g.watch(b,a.J.has(c)));return f}function Ih(a,b,c,d,e,f){null!==a.Ge&&(d===olympe.dc.wa.ORIGIN?zh(a.Ge,b,c,f,e):zh(a.Ge,b,c,e,f))}
635
635
  function Jh(a){a.H.C()&&a.H.debug(`Start sending notifications for query ${a.query.U()}`);const b=new olympe.dc.query.Ku(a.H,a.query.tb(),a.query.U(),a);a.C.forEach((c,d)=>{for(const e of c.ad())b.watch(e,a.J.has(d))});null!=b.C||(b.C=new olympe.dc.db.tc);a.Ge=b}function Kh(a){null!==a.Ge&&(a.H.C()&&a.H.debug(`Stop sending notifications for query ${a.query.U()}`),a.C.forEach(b=>{for(const c of b.ad())a.Ge.stop(c)}),a.Ge=null)}
636
636
  function Lh(a){a.O=!1;if(null!=(a=a.Ge)){let b;const c=!(null==(b=a.C)?0:b.af());a.G=c?a.C:null;c&&(a.C=new olympe.dc.db.tc,a.H.C()&&a.H.debug(`Commit notification with ${a.G.O()} operations for query ${a.F}`))}}
637
- olympe.dc.query.kq=class{constructor(a,b){this.H=a;this.query=b;this.G=olympe.Y.vb(b.F);this.ta=new Map;this.C=(new Map).set(this.G,new olympe.dc.query.ta.mm);this.J=new Set(b.J);this.Ed=-1;this.O=!1;this.T=null;this.Z=olympe.dc.Qa.empty();this.Ge=this.F=null;a=Bh(b);a.forEach(c=>{const d=c.U();this.ta.set(d,c.O());this.C.set(d,c.ua())});b=b.Rg();if(null!==b){b=b.C;let c=-1;for(const d of[this.G].concat(a.map(e=>e.U())))if(c+=this.J.has(d)?1:0,b===d){this.Ed=c;break}}}remove(a,b=this.G,c='root'){b=
637
+ olympe.dc.query.kq=class{constructor(a,b){this.H=a;this.query=b;this.G=olympe.Y.vb(b.F);this.ta=new Map;this.C=(new Map).set(this.G,new olympe.dc.query.ta.mm);this.J=new Set(b.J);this.Ed=-1;this.O=!1;this.T=null;this.Z=olympe.dc.Ra.empty();this.Ge=this.F=null;a=Bh(b);a.forEach(c=>{const d=c.U();this.ta.set(d,c.O());this.C.set(d,c.ua())});b=b.Rg();if(null!==b){b=b.C;let c=-1;for(const d of[this.G].concat(a.map(e=>e.U())))if(c+=this.J.has(d)?1:0,b===d){this.Ed=c;break}}}remove(a,b=this.G,c='root'){b=
638
638
  this.C.get(b);if(null==b||!b.has(a))return!0;b.remove(a,c)&&Eh(this);if(!b.has(a)){let d;null==(d=this.Ge)||d.stop(a);return!0}return!1}Kc(a){const b=a.F,c=olympe.Y.vb(b);a=Bh(a);const d=[];for(const [f,g]of this.C){if(g.O(b))return!0;g.has(b)&&d.push(f)}const e=(new Map).set(c,d);return 0<d.length&&a.every(f=>{let g;const h=(null!=(g=e.get(f.C))?g:[]).flatMap(k=>f.aa(k,this.ta.get(k))).filter(k=>{let l,n;return null!=(n=null==(l=this.ta.get(k))?void 0:l.Kc(f))?n:!1});e.set(f.U(),h);return 0<h.length})}};function Mh(a){if(!olympe.dc.ia().Rb(a,olympe.dm.Property))throw new olympe.dc.query.Ld(`The specified property while trying to build a query predicate is invalid: ${a}`);}
639
639
  function Nh(a){var b=olympe.dc.query.Ba.C.Zq;const c=olympe.dc.query.Ba.C.Eo,d=olympe.dc.query.Ba.C.Bj,e=olympe.dc.query.Ba.C.mp,f=olympe.dc.query.Ba.C.Lp,g=olympe.dc.query.Ba.C.uq,h=olympe.dc.query.Ba.C.wn,k=olympe.dc.query.Ba.C.Yp;switch(a.pr){case b:return new olympe.dc.query.$.tm(a.t);case c:b=a.v;switch(a.t){case 2:b=new Date(b);break;case 3:b=olympe.dc.CloudObject.get(b);break;case 4:b=olympe.D.Color.create(b.r,b.g,b.b,b.a)}return new olympe.dc.query.$.se(a.p,b,olympe.dc.ia());case d:return new olympe.dc.query.$.hf(a.p,
640
640
  a.s,olympe.dc.ia(),a.c);case e:return new olympe.dc.query.$.xi(olympe.dc.ia(),a.p,a.b,a.l,a.s);case f:return new olympe.dc.query.$.de(Nh(a.v));case g:return new olympe.dc.query.$.uf(a.p,new RegExp(a.r),olympe.dc.ia(),a.c);case k:return new olympe.dc.query.$.xe(...a.p.map(l=>Nh(l)));case h:return new olympe.dc.query.$.Fd(...a.p.map(l=>Nh(l)));default:return null}}
@@ -647,316 +647,316 @@ b.U();for(c=a.G+1;c<a.ta.length&&a.ta[c].U()!==d;)c++;b=c<a.ta.length?a.ta:a.ta.
647
647
  function Rh(a){const b=0===a.J.size?a.ge():a;if(null!==b.C.Ed&&!b.J.has(Ph(a,b.C.Ed)))throw new olympe.dc.query.Ld('AndReturn was not called for the current level before sortBy operator');return b}
648
648
  olympe.dc.pa=class{constructor(a,b,c=[],d=-1,e=new Set,f={max:-1,offset:0,Ed:null,He:null}){this.db=olympe.dc.ia();this.F=a;this.source=b;this.ta=c;this.G=d;this.J=e;this.C=f;this.id=null}static from(a,b){a=olympe.dc.ga(a);if(!olympe.dc.CloudObject.exists(a))throw new olympe.dc.query.Ld(`Try to create a query from an instance that does not exist (${a}). Please try to use \`Query.fromTag()\` instead.`);b=null!=b?b:olympe.dc.Zd().Fe(a);b=new olympe.dc.pa(a,b);b.C.He=olympe.dc.ia().model(a);return b}static Fe(a,
649
649
  b,c){if(!olympe.dc.CloudObject.exists(b))throw new olympe.dc.query.Ld(`Try to create a query from an instance (${a}) with an explicit datatype that does not exist (${b})`);a=olympe.dc.ga(a);c=null!=c?c:olympe.dc.Zd().fromModel(b);c=new olympe.dc.pa(a,c);c.C.He=olympe.dc.ga(b);return c}static Ik(a,b=!0,c){const d=olympe.dc.ga(a);var e=olympe.dc.ia();if(!e.ai(d))throw new olympe.dc.query.Ld(`Try to create a query to get instances of ${a}, which is not a data type or does not exist.`);a=null!=c?c:olympe.dc.Zd().fromModel(d);
650
- a=new olympe.dc.pa(d,a);a.C.He=e.model(d);b&&(a=Oh(a,new olympe.dc.query.ta.te(Ph(a),olympe.dc.CloudObject.extendedByRel,!0,!1)));b=a;e=new olympe.dc.query.ta.oh(Ph(a),olympe.dc.CloudObject.instancesRel,!1);e.ja=d;return Oh(b,e)}static Ob(a,b,c,d,e){const f=(null==e?0:e.Pd)?e.Pd:olympe.dc.pa.Zc.Qf;e=(null==e?0:e.qn)?'__code-as-data__':void 0;b=olympe.dc.ga(b);d=null!=d?d:olympe.dc.Zd().Fe(b);d=(new olympe.dc.pa(b,d)).ge();d.ta=[new olympe.dc.query.ta.Td(Ph(d),c)];return d.observe(a,{Pd:f,vk:e})}hb(a,
651
- b=!1){if(!(a instanceof olympe.dc.Oa.Relation))throw new olympe.dc.query.Ld(`The relation given to follow() is invalid: ${a}`);return Oh(this,new olympe.dc.query.ta.oh(Ph(this),a,b))}eg(a,b=!1,c=!1){if(!(a instanceof olympe.dc.Oa.Relation))throw new olympe.dc.query.Ld(`The relation given to followRecursively() is invalid: ${a}`);return Oh(this,new olympe.dc.query.ta.te(Ph(this),a,b,c))}ge(){const a=(new Set(this.J)).add(Ph(this));return new olympe.dc.pa(this.F,this.source,this.ta,this.G,a,this.C)}filter(a){if(!(a instanceof
650
+ a=new olympe.dc.pa(d,a);a.C.He=e.model(d);b&&(a=Oh(a,new olympe.dc.query.ta.te(Ph(a),olympe.dc.CloudObject.extendedByRel,!0,!1)));b=a;e=new olympe.dc.query.ta.oh(Ph(a),olympe.dc.CloudObject.instancesRel,!1);e.ja=d;return Oh(b,e)}static Ob(a,b,c,d,e){const f=(null==e?0:e.Pd)?e.Pd:olympe.dc.pa.Zc.Qf;e=(null==e?0:e.qn)?'__code-as-data__':void 0;b=olympe.dc.ga(b);d=null!=d?d:olympe.dc.Zd().Fe(b);d=(new olympe.dc.pa(b,d)).ge();d.ta=[new olympe.dc.query.ta.Td(Ph(d),c)];return d.observe(a,{Pd:f,vk:e})}ib(a,
651
+ b=!1){if(!(a instanceof olympe.dc.Pa.Relation))throw new olympe.dc.query.Ld(`The relation given to follow() is invalid: ${a}`);return Oh(this,new olympe.dc.query.ta.oh(Ph(this),a,b))}eg(a,b=!1,c=!1){if(!(a instanceof olympe.dc.Pa.Relation))throw new olympe.dc.query.Ld(`The relation given to followRecursively() is invalid: ${a}`);return Oh(this,new olympe.dc.query.ta.te(Ph(this),a,b,c))}ge(){const a=(new Set(this.J)).add(Ph(this));return new olympe.dc.pa(this.F,this.source,this.ta,this.G,a,this.C)}filter(a){if(!(a instanceof
652
652
  olympe.dc.query.Ba))throw new olympe.dc.query.Ld(`The specified predicate while trying to filter a query is invalid: ${a}`);const b=Array.from(this.ta);b[this.G]=b[this.G].filter(a);return new olympe.dc.pa(this.F,this.source,b,this.G,this.J,this.C)}Yi(){return this}kj(a,b=0){return new olympe.dc.pa(this.F,this.source,this.ta,this.G,this.J,{Ed:this.C.Ed,max:a,offset:b,He:this.C.He})}Qk(a,b=olympe.dc.query.Xj.ASC){if(0>this.G)throw new olympe.dc.query.Ld('You are trying to sort an empty query. Please first follow at least one relation to sort a query.');
653
653
  if(!olympe.dc.ia().Rb(a,olympe.dm.Property))throw new olympe.dc.query.Ld(`The specified property while trying to sort a query is invalid: ${a}`);const c=this.ta[this.G],d={Ed:this.G,max:this.C.max,offset:this.C.offset,He:this.C.He},e=Array.from(this.ta);e[this.G]=c.sort(a,b);return new olympe.dc.pa(this.F,this.source,e,this.G,this.J,d)}Rg(){const a=this.C.Ed;let b;return null!==a?null==(b=this.ta[a])?void 0:b.Rg():null}back(a=1){if(0>this.G||1>a)return this;let b=this.G;for(let c=0;c<a;c++){const d=
654
654
  this.ta[b].C;for(b--;-1<b&&Ph(this,b)!==d;)b--}return new olympe.dc.pa(this.F,this.source,Array.from(this.ta),b,this.J,this.C)}parse(){const a=new Map,b=Ph(this,-1),c={limit:this.C.max,offset:this.C.offset,returned:this.J.has(b),filter:[],optional:!1,inheritance:!1,next:[]};a.set(b,c);this.db.ai(this.F)?c.dataType=olympe.dc.ga(this.F):(c.root=olympe.dc.ga(this.F),c.dataType=this.C.He);this.ta.forEach((d,e)=>{const f=d.U(),g=d.Pc();Object.assign(g,{returned:this.J.has(f),next:[]});a.set(f,g);g.sort&&
655
655
  this.C.Ed!==e&&delete g.sort;if(1>=e&&d instanceof olympe.dc.query.ta.oh&&d.relation.Fa(olympe.dc.CloudObject.instancesRel))Object.assign(c,g);else if(0===e&&d instanceof olympe.dc.query.ta.te&&d.relation.Fa(olympe.dc.CloudObject.extendedByRel))Object.assign(c,g),c.inheritance=!0;else{let h;null==(h=a.get(d.C))||h.next.push(g)}});return c}ob(a){const b=(null==a?0:a.Pd)?a.Pd:olympe.dc.pa.Zc.am;let c;return olympe.dc.query.Ek().executeQuery(Rh(this),b,{Qh:null!=(c=null==a?void 0:a.vk)?c:null==a?void 0:
656
- a.cacheId,zc:null==a?void 0:a.zc}).then(d=>{let e;return null!=(e=null==d?void 0:Ch(d))?e:olympe.dc.Qa.empty()})}md(){return Ch(Sh(olympe.dc.query.Ek(),Rh(this)))}observe(a,b){const c=(null==b?0:b.Pd)?b.Pd:olympe.dc.pa.Zc.Qf;a='function'===typeof a.F?a.F():a;let d;return Th(olympe.dc.query.Ek(),Rh(this),a,olympe.dc.Ra.SELF,c,{Qh:null!=(d=null==b?void 0:b.vk)?d:null==b?void 0:b.cacheId,zc:null==b?void 0:b.zc}).pipe(rxjs.operators.map(e=>Ch(e)),rxjs.operators.distinctUntilChanged())}U(){null===this.id&&
656
+ a.cacheId,zc:null==a?void 0:a.zc}).then(d=>{let e;return null!=(e=null==d?void 0:Ch(d))?e:olympe.dc.Ra.empty()})}md(){return Ch(Sh(olympe.dc.query.Ek(),Rh(this)))}observe(a,b){const c=(null==b?0:b.Pd)?b.Pd:olympe.dc.pa.Zc.Qf;a='function'===typeof a.F?a.F():a;let d;return Th(olympe.dc.query.Ek(),Rh(this),a,olympe.dc.Sa.SELF,c,{Qh:null!=(d=null==b?void 0:b.vk)?d:null==b?void 0:b.cacheId,zc:null==b?void 0:b.zc}).pipe(rxjs.operators.map(e=>Ch(e)),rxjs.operators.distinctUntilChanged())}U(){null===this.id&&
657
657
  (this.id=olympe.Y.vb(this.F+Bh(this).map(a=>a.J()).join()+Array.from(new Set(this.J)).sort().toString()+this.C.Ed+this.C.max+this.C.offset));return this.id}tb(){return this.source}ha(){let a;return{b:this.F,p:this.ta.map(b=>b.ha()),r:Array.from(this.J),s:this.source,e:{m:this.C.max,o:this.C.offset,s:this.C.Ed,rm:null!=(a=this.C.He)?a:this.db.model(this.F)}}}toString(){return`Query: ${JSON.stringify(this)}`}toJSON(){return{origin:this.db.Ha(this.F)?olympe.dc.CloudObject.get(this.F):this.F,relations:this.ta.map(a=>
658
658
  a.toJSON())}}};olympe.dc.pa.prototype.observe=olympe.dc.pa.prototype.observe;olympe.dc.pa.prototype.executeFromCache=olympe.dc.pa.prototype.md;olympe.dc.pa.prototype.execute=olympe.dc.pa.prototype.ob;olympe.dc.pa.prototype.parse=olympe.dc.pa.prototype.parse;olympe.dc.pa.prototype.back=olympe.dc.pa.prototype.back;olympe.dc.pa.prototype.sortBy=olympe.dc.pa.prototype.Qk;olympe.dc.pa.prototype.limit=olympe.dc.pa.prototype.kj;olympe.dc.pa.prototype.cast=olympe.dc.pa.prototype.Yi;
659
- olympe.dc.pa.prototype.filter=olympe.dc.pa.prototype.filter;olympe.dc.pa.prototype.andReturn=olympe.dc.pa.prototype.ge;olympe.dc.pa.prototype.followRecursively=olympe.dc.pa.prototype.eg;olympe.dc.pa.prototype.follow=olympe.dc.pa.prototype.hb;olympe.dc.pa.followRule=olympe.dc.pa.Ob;olympe.dc.pa.instancesOf=olympe.dc.pa.Ik;olympe.dc.pa.fromTag=olympe.dc.pa.Fe;olympe.dc.pa.from=olympe.dc.pa.from;olympe.dc.pa.Zc={Qf:1,am:2,bm:3};olympe.dc.pa.C={bl:'cacheBucketName',rp:'isCacheable'};olympe.dc.query.td=class extends olympe.dc.kh{constructor(a,b){super(a,null);this.source=b}static cj(a){const b=new olympe.dc.db.tc(`DataResult_${a.U()}`);return new olympe.dc.query.td(b,a.tb())}static C(a){const b=(new olympe.dc.transaction.zh(a.s)).C(a.p);return new olympe.dc.query.td(b,a.s)}create(a,b,c){this.C.$c(a,this.source,c,b);return this}Ma(a,b,c){this.C.Ma(a,b,c,null,null);return this}ha(){const a=new olympe.dc.transaction.qf;this.C.Jc(a);return{s:this.source,p:uf(a)}}};
659
+ olympe.dc.pa.prototype.filter=olympe.dc.pa.prototype.filter;olympe.dc.pa.prototype.andReturn=olympe.dc.pa.prototype.ge;olympe.dc.pa.prototype.followRecursively=olympe.dc.pa.prototype.eg;olympe.dc.pa.prototype.follow=olympe.dc.pa.prototype.ib;olympe.dc.pa.followRule=olympe.dc.pa.Ob;olympe.dc.pa.instancesOf=olympe.dc.pa.Ik;olympe.dc.pa.fromTag=olympe.dc.pa.Fe;olympe.dc.pa.from=olympe.dc.pa.from;olympe.dc.pa.Zc={Qf:1,am:2,bm:3};olympe.dc.pa.C={bl:'cacheBucketName',rp:'isCacheable'};olympe.dc.query.td=class extends olympe.dc.kh{constructor(a,b){super(a,null);this.source=b}static cj(a){const b=new olympe.dc.db.tc(`DataResult_${a.U()}`);return new olympe.dc.query.td(b,a.tb())}static C(a){const b=(new olympe.dc.transaction.zh(a.s)).C(a.p);return new olympe.dc.query.td(b,a.s)}create(a,b,c){this.C.$c(a,this.source,c,b);return this}Ma(a,b,c){this.C.Ma(a,b,c,null,null);return this}ha(){const a=new olympe.dc.transaction.qf;this.C.Jc(a);return{s:this.source,p:uf(a)}}};
660
660
  olympe.dc.query.td.prototype.createRelation=olympe.dc.query.td.prototype.Ma;olympe.dc.query.td.prototype.create=olympe.dc.query.td.prototype.create;olympe.dc.query.td.fromQuery=olympe.dc.query.td.cj;function Sh(a,b){const c=new olympe.dc.query.kq(a.H,b);if(a.F.view.Ha(b.F)){Hh(c,b.F);for(const d of Bh(b))d.ob(c)}return c}
661
- function Th(a,b,c,d,e,f){const g=b.U();let h=a.C.get(g);if(!h){var k=b.tb();a.H.debug(`Create new subscription for query ${g} for subscriber ${d}, to be executed by the data source ${k}`);k=!1===f.zc||a.J&&k===olympe.dc.Ra.SERVER?[]:Array.from(a.C.values());h=new olympe.dc.query.rq(a.H,a.F,b,a.T.bind(a,e,f));a.C.set(g,h);Uh(h,l=>a.G.add(l));h.start(k)&&(null==f?0:f.Qh)&&Vh(a,b,e,f).catch(l=>{a.H.error(`Was not able to get the result of the subscribed query ${g} to add it to the cache: ${l}`)})}return new rxjs.Observable(l=>
662
- {const n=()=>{p&&c.Vd(p);l.complete();if(q){var r=q;const u=a.C.get(g);a.H.debug(`${d} unsubscribed from ${g}`);if(null==u)r=0;else{var t=u;t.J.delete(r)&&t.H.debug(`Remove subscriber ${d} for query ${t.query.U()}, now have ${t.J.size} subscribers`);d!==olympe.dc.Ra.SELF&&(t.Z--,0===t.Z&&Kh(t.C));r=0===t.J.size}r&&(a.H.debug(`No more subscriber to ${g}, remove the subscription`),a.G.delete(g),a.C.delete(g),u.destroy())}},p=c.Z(n),q=Wh(h,d,l);return n})}
663
- function Xh(a){a.G.forEach(b=>{let c;null==(c=a.C.get(b))||Yh(c)});a.G.clear()}function Zh(a,b){var c=b.U();b=a.O.J.has(c)?hf(new olympe.dc.db.tc(b.U()),b.F):b;a.F.xc(b)}function $h(a){a.H.debug('Send GetContext request to the orchestrator');const b=new olympe.dc.Request(olympe.dc.Request.C.tg,olympe.dc.Ra.SERVER);return a.Wb.request(b).then(c=>{a.F.xc(c)})}
664
- function ai(a,b){const c=b.tb();if(c===olympe.dc.Ra.SELF||a.J&&c===olympe.dc.Ra.SERVER)return Promise.resolve(!0);a=Array.from(a.C.values()).filter(d=>d.Kc(b)).map(d=>new Promise(e=>d.Bd(f=>e(!f))));return Promise.all(a).then(d=>d.some(e=>e))}function Vh(a,b,c,d){return v(function*(){var e=b.tb();e=nf(nf(new olympe.dc.Request(olympe.dc.Request.C.Bg,e,b),olympe.dc.pa.C.rp,c===olympe.dc.pa.Zc.bm),olympe.dc.pa.C.bl,null==d?void 0:d.Qh);return a.Wb.request(e)})}
661
+ function Th(a,b,c,d,e,f){const g=b.U();let h=a.C.get(g);if(!h){var k=b.tb();a.H.debug(`Create new subscription for query ${g} for subscriber ${d}, to be executed by the data source ${k}`);k=!1===f.zc||a.J&&k===olympe.dc.Sa.SERVER?[]:Array.from(a.C.values());h=new olympe.dc.query.rq(a.H,a.F,b,a.T.bind(a,e,f));a.C.set(g,h);Uh(h,l=>a.G.add(l));h.start(k)&&(null==f?0:f.Qh)&&Vh(a,b,e,f).catch(l=>{a.H.error(`Was not able to get the result of the subscribed query ${g} to add it to the cache: ${l}`)})}return new rxjs.Observable(l=>
662
+ {const n=()=>{p&&c.Vd(p);l.complete();if(q){var r=q;const u=a.C.get(g);a.H.debug(`${d} unsubscribed from ${g}`);if(null==u)r=0;else{var t=u;t.J.delete(r)&&t.H.debug(`Remove subscriber ${d} for query ${t.query.U()}, now have ${t.J.size} subscribers`);d!==olympe.dc.Sa.SELF&&(t.Z--,0===t.Z&&Kh(t.C));r=0===t.J.size}r&&(a.H.debug(`No more subscriber to ${g}, remove the subscription`),a.G.delete(g),a.C.delete(g),u.destroy())}},p=c.Z(n),q=Wh(h,d,l);return n})}
663
+ function Xh(a){a.G.forEach(b=>{let c;null==(c=a.C.get(b))||Yh(c)});a.G.clear()}function Zh(a,b){var c=b.U();b=a.O.J.has(c)?hf(new olympe.dc.db.tc(b.U()),b.F):b;a.F.xc(b)}function $h(a){a.H.debug('Send GetContext request to the orchestrator');const b=new olympe.dc.Request(olympe.dc.Request.C.tg,olympe.dc.Sa.SERVER);return a.Wb.request(b).then(c=>{a.F.xc(c)})}
664
+ function ai(a,b){const c=b.tb();if(c===olympe.dc.Sa.SELF||a.J&&c===olympe.dc.Sa.SERVER)return Promise.resolve(!0);a=Array.from(a.C.values()).filter(d=>d.Kc(b)).map(d=>new Promise(e=>d.Bd(f=>e(!f))));return Promise.all(a).then(d=>d.some(e=>e))}function Vh(a,b,c,d){return v(function*(){var e=b.tb();e=nf(nf(new olympe.dc.Request(olympe.dc.Request.C.Bg,e,b),olympe.dc.pa.C.rp,c===olympe.dc.pa.Zc.bm),olympe.dc.pa.C.bl,null==d?void 0:d.Qh);return a.Wb.request(e)})}
665
665
  function bi(a,b,c){const d=[];for(const e of a.C.values())ci(e,b,c)&&d.push(Vh(a,e.query,olympe.dc.pa.Zc.am,{}).then(f=>{a.F.xc(f)}));return Promise.all(d).then(()=>{})}
666
666
  olympe.dc.query.dv=class{constructor(a,b,c,d,e){this.H=a;this.F=b;this.O=c;this.Wb=d;this.J=e;this.C=new Map;this.G=new Set;og(b,()=>Xh(this));sf(d,olympe.dc.Request.C.mo,f=>{Zh(this,f.content)})}executeQuery(a,b,c){const d=this;return v(function*(){const e='boolean'===typeof c.zc?c.zc:yield ai(d,a);if(!e||(null==c?0:c.Qh))try{const f=yield Vh(d,a,b,c);e||d.F.xc(f)}catch(f){return d.H.error(`Error while sending a query to data source ${a.tb()}: ${f}`),null}return Sh(d,a)})}T(a,b,c,d,e){const f=c.tb();
667
- if(f===olympe.dc.Ra.SELF||b.zc||this.J&&f===olympe.dc.Ra.SERVER)return d(),null;if(a!==olympe.dc.pa.Zc.Qf)return Vh(this,c,a,b).then(q=>{this.F.xc(q);d()}).catch(e),null;let g,h=!1;const k=q=>{g=[];q&&this.H.debug(`Resend subscription ${c.U()} after detection of dead subscription in the remote service`);Vh(this,c,a,b).then(r=>{if(h)this.H.warn(`Received data result after query subscription ${c.U()} has been destroyed. Could happen with queries observed multiple times successively quickly.`);else{this.F.xc(r);
667
+ if(f===olympe.dc.Sa.SELF||b.zc||this.J&&f===olympe.dc.Sa.SERVER)return d(),null;if(a!==olympe.dc.pa.Zc.Qf)return Vh(this,c,a,b).then(q=>{this.F.xc(q);d()}).catch(e),null;let g,h=!1;const k=q=>{g=[];q&&this.H.debug(`Resend subscription ${c.U()} after detection of dead subscription in the remote service`);Vh(this,c,a,b).then(r=>{if(h)this.H.warn(`Received data result after query subscription ${c.U()} has been destroyed. Could happen with queries observed multiple times successively quickly.`);else{this.F.xc(r);
668
668
  let t;null==(t=g)||t.forEach(u=>Zh(this,u));g=null}d()}).catch(e)},l=c.U();k(!1);const n=nf(new olympe.dc.Request(olympe.dc.Request.C.$j,f,c),olympe.dc.pa.C.bl,null==b?void 0:b.Qh),p=this.Wb.subscribe(n,k.bind(this,!0)).pipe(eb(olympe.N.errors.cp,()=>{},0)).pipe(eb(olympe.N.errors.Sn,(q,r)=>{this.H.debug(`Data Provider: Subscribe to topic ${q.U()} now that we are back online, after waiting for ${r}ms`);k(!0)},0)).subscribe(rxjs.Subscriber.create(q=>{Array.isArray(g)?g.push(q):Zh(this,q)},q=>{this.H.error(`An error occurred with the subscription ${l}: ${q}`);
669
- e(String(q))}));return()=>{h=!0;this.H.debug(`Unsubscribe to query ${l} from data source ${f}`);p.unsubscribe()}}};function qf(a){return a.J.map(b=>{b=b.split('.');return 1===b.length?b[0]:b})}function rf(a){return a.G.map(b=>a.F.get(a.C[b]))}function di(a){const b=olympe.dc.ia();let c=!1;const d=a.k.map(e=>{const f=e.split('.').map(g=>b.Ha(g)?olympe.dc.CloudObject.get(g):(olympe.ka.ib('dc.query').error(`CloudObject with tag ${g} not present but required for deserialization`),c=!0,null));return[e,1===f.length?f[0]:f]});return c?null:olympe.dc.Qa.create(d,a.a,a.r)}
670
- olympe.dc.Qa=class{constructor(){this.C=[];this.F=new Map;this.G=[];this.J=[];this.hash=''}static empty(){return new olympe.dc.Qa}[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++);return b}}}entries(){return this.C.map(a=>[a,this.F.get(a)])}values(){return this.F.values()}keys(){return this.C.values()}Ie(){return this.C.map(a=>this.F.get(a))}size(){return this.C.length}has(a){return this.F.has(a)||this.Ie().includes(a)}indexOf(a){return null===
669
+ e(String(q))}));return()=>{h=!0;this.H.debug(`Unsubscribe to query ${l} from data source ${f}`);p.unsubscribe()}}};function qf(a){return a.J.map(b=>{b=b.split('.');return 1===b.length?b[0]:b})}function rf(a){return a.G.map(b=>a.F.get(a.C[b]))}function di(a){const b=olympe.dc.ia();let c=!1;const d=a.k.map(e=>{const f=e.split('.').map(g=>b.Ha(g)?olympe.dc.CloudObject.get(g):(olympe.ka.ab('dc.query').error(`CloudObject with tag ${g} not present but required for deserialization`),c=!0,null));return[e,1===f.length?f[0]:f]});return c?null:olympe.dc.Ra.create(d,a.a,a.r)}
670
+ olympe.dc.Ra=class{constructor(){this.C=[];this.F=new Map;this.G=[];this.J=[];this.hash=''}static empty(){return new olympe.dc.Ra}[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++);return b}}}entries(){return this.C.map(a=>[a,this.F.get(a)])}values(){return this.F.values()}keys(){return this.C.values()}Ie(){return this.C.map(a=>this.F.get(a))}size(){return this.C.length}has(a){return this.F.has(a)||this.Ie().includes(a)}indexOf(a){return null===
671
671
  a||void 0===a?-1:'string'===typeof a?this.C.indexOf(a):this.Ie().indexOf(a)}get(a){return(a=this.F.get(a))?a:null}Fc(){return this.ie(0)}ie(a){return a<this.C.length?this.F.get(this.C[a]):null}push(...a){const b=this.Ie();b.push(...a);return b}pop(){if(0===this.C.length)return[];const a=this.Ie();a.pop();return a}shift(){if(0<this.C.length){const a=this.Ie();a.shift();return a}return[]}filter(a){return this.Ie().filter(a)}find(a){return(a=this.Ie().find(a))?a:null}forEach(a){this.C.forEach((b,c)=>
672
- a(this.F.get(b),c))}map(a){return this.Ie().map(a)}sort(a){const b=this.entries().sort((c,d)=>a(c[1],d[1]));return olympe.dc.Qa.create(b,Array.from(this.G),Array.from(this.J))}reduce(a,b){return this.Ie().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.J.concat(...a.map(d=>d.J));return olympe.dc.Qa.create(b,c,a)}toString(){return`QueryResult: ${JSON.stringify(this)}`}toJSON(){return this.Ie()}static from(a,
673
- b,{Hb:c,Ed:d,offset:e,max:f}={}){if(null!==c&&-1<d){const p=olympe.dc.ia(),q=c.Ai===olympe.dc.query.Xj.ASC?1:-1,r=c.Rg(),t=c.Sa();b.sort((u,x)=>{x=x[d];u=p.Sa(u[d],t);x=p.Sa(x,t);return null===u?-q:null===x?q:q*r(olympe.dc.nb.Ac(u),olympe.dc.nb.Ac(x))})}else b.sort((p,q)=>p.reduce((r,t,u)=>r||t.localeCompare(q[u]),0));if(0<e||-1<f)b=b.slice(e,-1<f?e+f:void 0);c=olympe.Y.vb(b.flat().join(''));if(c===a.hash)return a;const g=p=>''===p?null:olympe.dc.CloudObject.get(p);e=b.map(p=>[p.join('.'),1===p.length?
674
- g(p[0]):p.map(g)]);const h=new Set(e.map(p=>p[0])),k=new Set(a.keys()),l=[],n=[];e.forEach(([p],q)=>{!k.has(p)&&l.push(q)});k.forEach(p=>{!h.has(p)&&n.push(p)});return olympe.dc.Qa.create(e,l,n,c)}static create(a,b,c,d){const e=new olympe.dc.Qa;e.C=a.map(f=>f[0]);e.F=new Map(a);e.hash=d||olympe.Y.vb(e.C.join(''));e.G=b||e.C.map((f,g)=>g);e.J=c||[];return e}ha(a){a&&this.C.flatMap(b=>b.split('.')).forEach(a);return{k:this.C,a:this.G,r:this.J}}};olympe.dc.Qa.prototype.concat=olympe.dc.Qa.prototype.concat;
675
- olympe.dc.Qa.prototype.reduce=olympe.dc.Qa.prototype.reduce;olympe.dc.Qa.prototype.sort=olympe.dc.Qa.prototype.sort;olympe.dc.Qa.prototype.map=olympe.dc.Qa.prototype.map;olympe.dc.Qa.prototype.forEach=olympe.dc.Qa.prototype.forEach;olympe.dc.Qa.prototype.find=olympe.dc.Qa.prototype.find;olympe.dc.Qa.prototype.filter=olympe.dc.Qa.prototype.filter;olympe.dc.Qa.prototype.shift=olympe.dc.Qa.prototype.shift;olympe.dc.Qa.prototype.pop=olympe.dc.Qa.prototype.pop;olympe.dc.Qa.prototype.push=olympe.dc.Qa.prototype.push;
676
- olympe.dc.Qa.prototype.getAt=olympe.dc.Qa.prototype.ie;olympe.dc.Qa.prototype.getFirst=olympe.dc.Qa.prototype.Fc;olympe.dc.Qa.prototype.get=olympe.dc.Qa.prototype.get;olympe.dc.Qa.prototype.indexOf=olympe.dc.Qa.prototype.indexOf;olympe.dc.Qa.prototype.has=olympe.dc.Qa.prototype.has;olympe.dc.Qa.prototype.size=olympe.dc.Qa.prototype.size;olympe.dc.Qa.prototype.toArray=olympe.dc.Qa.prototype.Ie;olympe.dc.Qa.prototype.keys=olympe.dc.Qa.prototype.keys;olympe.dc.Qa.prototype.values=olympe.dc.Qa.prototype.values;
677
- olympe.dc.Qa.prototype.entries=olympe.dc.Qa.prototype.entries;olympe.dc.Qa.empty=olympe.dc.Qa.empty;function ei(a){return 1<a.size()?(olympe.ka.ib('dc').warn(`a follow() on a QuerySingle has ${a.size()} results (0 or 1 expected) -> returns null`),null):a.Fc()||null}olympe.dc.gd=class{constructor(a){this.query=a}static from(a){return new olympe.dc.gd(olympe.dc.pa.from(a))}hb(a){return new olympe.dc.gd(this.query.hb(a))}Yi(){return this}ob(a){return this.query.ob(a).then(b=>ei(b))}md(){return ei(this.query.md())}};olympe.dc.gd.prototype.executeFromCache=olympe.dc.gd.prototype.md;
678
- olympe.dc.gd.prototype.execute=olympe.dc.gd.prototype.ob;olympe.dc.gd.prototype.cast=olympe.dc.gd.prototype.Yi;olympe.dc.gd.prototype.follow=olympe.dc.gd.prototype.hb;const fi=olympe.dc.wa.ORIGIN,gi=olympe.dc.wa.DESTINATION;function Uh(a,b){Dh(a.C,()=>{a.eb()||null!==a.G||b(a.query.U())})}function Wh(a,b,c){const d=a.aa;a.aa++;a.J.set(d,c);b===olympe.dc.Ra.SELF?a.Bd(e=>e?c.error(e):c.next(a.C)):(a.Z++,1===a.Z&&a.Bd(()=>Jh(a.C)));a.H.debug(`Add subscriber ${b} for query ${a.query.U()}, now have ${a.J.size} subscribers`);return d}
672
+ a(this.F.get(b),c))}map(a){return this.Ie().map(a)}sort(a){const b=this.entries().sort((c,d)=>a(c[1],d[1]));return olympe.dc.Ra.create(b,Array.from(this.G),Array.from(this.J))}reduce(a,b){return this.Ie().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.J.concat(...a.map(d=>d.J));return olympe.dc.Ra.create(b,c,a)}toString(){return`QueryResult: ${JSON.stringify(this)}`}toJSON(){return this.Ie()}static from(a,
673
+ b,{Ib:c,Ed:d,offset:e,max:f}={}){if(null!==c&&-1<d){const p=olympe.dc.ia(),q=c.Ai===olympe.dc.query.Xj.ASC?1:-1,r=c.Rg(),t=c.Oa();b.sort((u,x)=>{x=x[d];u=p.Oa(u[d],t);x=p.Oa(x,t);return null===u?-q:null===x?q:q*r(olympe.dc.nb.Ac(u),olympe.dc.nb.Ac(x))})}else b.sort((p,q)=>p.reduce((r,t,u)=>r||t.localeCompare(q[u]),0));if(0<e||-1<f)b=b.slice(e,-1<f?e+f:void 0);c=olympe.Y.vb(b.flat().join(''));if(c===a.hash)return a;const g=p=>''===p?null:olympe.dc.CloudObject.get(p);e=b.map(p=>[p.join('.'),1===p.length?
674
+ g(p[0]):p.map(g)]);const h=new Set(e.map(p=>p[0])),k=new Set(a.keys()),l=[],n=[];e.forEach(([p],q)=>{!k.has(p)&&l.push(q)});k.forEach(p=>{!h.has(p)&&n.push(p)});return olympe.dc.Ra.create(e,l,n,c)}static create(a,b,c,d){const e=new olympe.dc.Ra;e.C=a.map(f=>f[0]);e.F=new Map(a);e.hash=d||olympe.Y.vb(e.C.join(''));e.G=b||e.C.map((f,g)=>g);e.J=c||[];return e}ha(a){a&&this.C.flatMap(b=>b.split('.')).forEach(a);return{k:this.C,a:this.G,r:this.J}}};olympe.dc.Ra.prototype.concat=olympe.dc.Ra.prototype.concat;
675
+ olympe.dc.Ra.prototype.reduce=olympe.dc.Ra.prototype.reduce;olympe.dc.Ra.prototype.sort=olympe.dc.Ra.prototype.sort;olympe.dc.Ra.prototype.map=olympe.dc.Ra.prototype.map;olympe.dc.Ra.prototype.forEach=olympe.dc.Ra.prototype.forEach;olympe.dc.Ra.prototype.find=olympe.dc.Ra.prototype.find;olympe.dc.Ra.prototype.filter=olympe.dc.Ra.prototype.filter;olympe.dc.Ra.prototype.shift=olympe.dc.Ra.prototype.shift;olympe.dc.Ra.prototype.pop=olympe.dc.Ra.prototype.pop;olympe.dc.Ra.prototype.push=olympe.dc.Ra.prototype.push;
676
+ olympe.dc.Ra.prototype.getAt=olympe.dc.Ra.prototype.ie;olympe.dc.Ra.prototype.getFirst=olympe.dc.Ra.prototype.Fc;olympe.dc.Ra.prototype.get=olympe.dc.Ra.prototype.get;olympe.dc.Ra.prototype.indexOf=olympe.dc.Ra.prototype.indexOf;olympe.dc.Ra.prototype.has=olympe.dc.Ra.prototype.has;olympe.dc.Ra.prototype.size=olympe.dc.Ra.prototype.size;olympe.dc.Ra.prototype.toArray=olympe.dc.Ra.prototype.Ie;olympe.dc.Ra.prototype.keys=olympe.dc.Ra.prototype.keys;olympe.dc.Ra.prototype.values=olympe.dc.Ra.prototype.values;
677
+ olympe.dc.Ra.prototype.entries=olympe.dc.Ra.prototype.entries;olympe.dc.Ra.empty=olympe.dc.Ra.empty;function ei(a){return 1<a.size()?(olympe.ka.ab('dc').warn(`a follow() on a QuerySingle has ${a.size()} results (0 or 1 expected) -> returns null`),null):a.Fc()||null}olympe.dc.gd=class{constructor(a){this.query=a}static from(a){return new olympe.dc.gd(olympe.dc.pa.from(a))}ib(a){return new olympe.dc.gd(this.query.ib(a))}Yi(){return this}ob(a){return this.query.ob(a).then(b=>ei(b))}md(){return ei(this.query.md())}};olympe.dc.gd.prototype.executeFromCache=olympe.dc.gd.prototype.md;
678
+ olympe.dc.gd.prototype.execute=olympe.dc.gd.prototype.ob;olympe.dc.gd.prototype.cast=olympe.dc.gd.prototype.Yi;olympe.dc.gd.prototype.follow=olympe.dc.gd.prototype.ib;const fi=olympe.dc.wa.ORIGIN,gi=olympe.dc.wa.DESTINATION;function Uh(a,b){Dh(a.C,()=>{a.fb()||null!==a.G||b(a.query.U())})}function Wh(a,b,c){const d=a.aa;a.aa++;a.J.set(d,c);b===olympe.dc.Sa.SELF?a.Bd(e=>e?c.error(e):c.next(a.C)):(a.Z++,1===a.Z&&a.Bd(()=>Jh(a.C)));a.H.debug(`Add subscriber ${b} for query ${a.query.U()}, now have ${a.J.size} subscribers`);return d}
679
679
  function ci(a,b,c){if(a.query.tb()!==b)return!1;c.Jc(a.ea);(b=a.ea.flush())&&a.H.debug(`Subscription ${a.query.U()} is considered as obsolete after the transaction ${c.U()} applied on DB`);return b}function Yh(a){Lh(a.C);a.J.forEach(b=>{b.next(a.C)})}function hi(a,b,c){const d=[];let e=!1;const f=new olympe.async.Yj(olympe.D.Sg());for(const g of b)g.Kc(a.query)&&(e||(e=!0),f.add(h=>g.Bd(k=>{!k&&d.push(g);h()})));Tc(f,g=>c(g?d:[]));f.start();return e}
680
680
  function ii(a){const b=a.query.U(),c=new Map,d=q=>{const r=c.get(q);return r?1===r.size?Array.from(r)[0]:(t,u,x,y)=>r.forEach(z=>z(t,u,x,y)):()=>{}},e=Bh(a.query),f=a.C;for(let q=e.length-1;0<=q;q--){var g=e[q];const r=g.U(),t=g.C;g=g.observe(f,d(r));let u;c.set(t,(null!=(u=c.get(t))?u:new Set).add(g))}const h=a.db,k=a.query.F,l=olympe.Y.vb(k),n=jf(h,k,(q,r)=>{q?Hh(f,r):f.remove(r);d(l)(q,r,null,b)});let p;null==(p=a.T)||p.push(()=>{gf(h,k,n)});ji(a)}
681
- function ki(a){const b=a.ja(a.query,()=>{null===a.G||a.eb()||ii(a)},d=>{a.eb()||(a.H.error(`Error while getting data from data source (${a.query.tb()}) to ensure coverage of the query ${a.query.U()}: ${d}`),ji(a))});let c;b&&(null==(c=a.T)||c.push(b))}function li(a,b){a.O.delete(b);0===a.O.size&&(a.O=null,Promise.resolve().then(()=>{!a.eb()&&ki(a)}))}function ji(a){const b=a.G;a.G=null;null==b||b.forEach(c=>c())}
682
- olympe.dc.query.rq=class{constructor(a,b,c,d){this.H=a;this.db=b.view;this.query=c;this.C=new olympe.dc.query.kq(this.H,c);this.Z=0;this.aa=1;this.T=[];this.J=new Map;this.G=[()=>Lh(this.C)];this.ja=d;this.ea=new mi(a,this.db,c,this.C);this.F=this.O=null}start(a){return hi(this,a,b=>{0<b.length?(this.O=new Set(b),this.O.forEach(c=>{null===c.F&&(c.F=new Set);c.F.add(this)}),ii(this)):ki(this)})}Kc(a){return!this.eb()&&this.query.tb()===a.tb()&&(this.query.U()===a.U()||(null===this.G||this.query.F===
683
- a.F)&&this.C.Kc(a))}Bd(a){null!==this.G?this.G.push(a):a();return this}destroy(a){a?this.H.error(`Destroy subscription ${this.query.U()} after error: ${a}`):this.H.debug(`Destroy subscription ${this.query.U()}`);const b=this.T;this.T=null;this.J.forEach(e=>a?e.error(a):e.complete());let c;null==(c=this.F)||c.forEach(e=>li(e,this));let d;null==(d=this.O)||d.forEach(e=>{e.F.delete(this);0===e.F.size&&(e.F=null)});b.forEach(e=>e())}eb(){return null===this.T}};
681
+ function ki(a){const b=a.ja(a.query,()=>{null===a.G||a.fb()||ii(a)},d=>{a.fb()||(a.H.error(`Error while getting data from data source (${a.query.tb()}) to ensure coverage of the query ${a.query.U()}: ${d}`),ji(a))});let c;b&&(null==(c=a.T)||c.push(b))}function li(a,b){a.O.delete(b);0===a.O.size&&(a.O=null,Promise.resolve().then(()=>{!a.fb()&&ki(a)}))}function ji(a){const b=a.G;a.G=null;null==b||b.forEach(c=>c())}
682
+ olympe.dc.query.rq=class{constructor(a,b,c,d){this.H=a;this.db=b.view;this.query=c;this.C=new olympe.dc.query.kq(this.H,c);this.Z=0;this.aa=1;this.T=[];this.J=new Map;this.G=[()=>Lh(this.C)];this.ja=d;this.ea=new mi(a,this.db,c,this.C);this.F=this.O=null}start(a){return hi(this,a,b=>{0<b.length?(this.O=new Set(b),this.O.forEach(c=>{null===c.F&&(c.F=new Set);c.F.add(this)}),ii(this)):ki(this)})}Kc(a){return!this.fb()&&this.query.tb()===a.tb()&&(this.query.U()===a.U()||(null===this.G||this.query.F===
683
+ a.F)&&this.C.Kc(a))}Bd(a){null!==this.G?this.G.push(a):a();return this}destroy(a){a?this.H.error(`Destroy subscription ${this.query.U()} after error: ${a}`):this.H.debug(`Destroy subscription ${this.query.U()}`);const b=this.T;this.T=null;this.J.forEach(e=>a?e.error(a):e.complete());let c;null==(c=this.F)||c.forEach(e=>li(e,this));let d;null==(d=this.O)||d.forEach(e=>{e.F.delete(this);0===e.F.size&&(e.F=null)});b.forEach(e=>e())}fb(){return null===this.T}};
684
684
  function ni(a,b){return a.G.has(gi+b)||a.G.has(fi+b)}
685
685
  class mi{constructor(a,b,c,d){this.H=a;this.db=b;this.J=d;this.T=[];this.O=-1<c.C.max||0<c.C.offset;this.G=new Map;this.C=!1;const e=new Map;for(const f of Bh(c)){a=f.U();this.T.push(a);if(f instanceof olympe.dc.query.ta.Eh){a=f.relation;a=`${a.Ia()}${a.X()}`;let g;b=null!=(g=this.G.get(a))?g:[];b.push(f);this.G.set(a,b)}oi(f).forEach(g=>{let h;const k=null!=(h=e.get(g))?h:[];k.push(f.U());e.set(g,k)})}this.properties=Array.from(e.entries())}flush(){const a=this.C;this.C=!1;return a}$c(){}Qc(a,b){if(!(this.C||
686
686
  !this.O&&this.db.Ha(a))){var c;this.C||(this.C=null==(c=this.properties)?void 0:c.some(([d,e])=>b.has(d)&&Gh(this.J,a,e)))}}F(a){this.C||this.db.Ha(a)&&!this.O||this.C||(this.C=this.T.some(b=>Gh(this.J,a,b)))}Ma(a,b,c){if(!this.C&&ni(this,a)){var d=this.db.Ha(b),e=this.db.Ha(c);if(d&&!e||!d&&e){const f=this.G.get(gi+a);a=this.G.get(fi+a);this.C||(this.C=d&&(null==f?void 0:f.some(g=>Gh(this.J,b,g.C)))||e&&(null==a?void 0:a.some(g=>Gh(this.J,c,g.C))))}}}ic(a,b,c){if(!this.C&&this.O&&ni(this,a)&&this.db.Zr(b,
687
- new olympe.dc.Oa.Relation(a),c)){const d=this.G.get(gi+a);a=this.G.get(fi+a);const e=this.J;this.C||(this.C=(null==d?void 0:d.some(f=>Gh(e,b,f.C)&&Gh(e,c,f.U())))||(null==a?void 0:a.some(f=>Gh(e,c,f.C)&&Gh(e,b,f.U()))))}}}olympe.dc.query.rq.ya=[olympe.dc.Writable];function pi(a){return new olympe.dc.query.Relation(a.tag,a.direction,!0)}
688
- olympe.dc.query.Relation=class extends olympe.dc.Oa.Relation{constructor(a,b,c){super(a,b);this.recursive=c}toJSON(){let a='{ "tag": '+JSON.stringify(this.X())+', ';a+='"direction": '+JSON.stringify(this.Ia())+', ';a+='"recursive": '+JSON.stringify(this.recursive);return a+'}'}static Pb(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,b){return new olympe.dc.query.Relation(a.X(),a.Ia(),null!=b?b:a instanceof olympe.dc.da.Ae)}bc(){const a=
687
+ new olympe.dc.Pa.Relation(a),c)){const d=this.G.get(gi+a);a=this.G.get(fi+a);const e=this.J;this.C||(this.C=(null==d?void 0:d.some(f=>Gh(e,b,f.C)&&Gh(e,c,f.U())))||(null==a?void 0:a.some(f=>Gh(e,c,f.C)&&Gh(e,b,f.U()))))}}}olympe.dc.query.rq.ya=[olympe.dc.Writable];function pi(a){return new olympe.dc.query.Relation(a.tag,a.direction,!0)}
688
+ olympe.dc.query.Relation=class extends olympe.dc.Pa.Relation{constructor(a,b,c){super(a,b);this.recursive=c}toJSON(){let a='{ "tag": '+JSON.stringify(this.X())+', ';a+='"direction": '+JSON.stringify(this.Ia())+', ';a+='"recursive": '+JSON.stringify(this.recursive);return a+'}'}static Pb(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,b){return new olympe.dc.query.Relation(a.X(),a.Ia(),null!=b?b:a instanceof olympe.dc.da.Ae)}bc(){const a=
689
689
  olympe.dc.wa.DESTINATION,b=olympe.dc.wa.ORIGIN;return new olympe.dc.query.Relation(this.tag,this.direction===a?b:a,this.recursive)}U(){return`${this.direction}${this.tag}${this.recursive?'-r':''}`}};olympe.dc.query.R={Ca:'dc.query.Logger',Zj:'dc.query.QueryProcessor'};olympe.W.config(function(a){E(a,olympe.dc.query.R.Ca,[olympe.ka.R.Ea],b=>b.Vc('query'));C(a,olympe.dc.query.R.Zj,olympe.dc.query.dv,olympe.dc.query.R.Ca,olympe.dc.db.R.Ea,olympe.dc.transaction.R.Ea,olympe.dc.R.Dg,new olympe.W.oa(olympe.dc.V.Gh))});olympe.W.run([olympe.dc.query.R.Zj],a=>{olympe.dc.query.Ek=()=>a});olympe.dc.query.Ld=class extends Error{};olympe.dc.query.$={};olympe.dc.query.$.Fd=class extends olympe.dc.query.Ba{constructor(...a){super();this.$=a}compile(){return this.$.reduce((a,b)=>{const c=[];for(const d of b.compile()){for(const e of a)d.push(...e);c.push(d)}return c},[])}pd(){return new olympe.dc.query.$.xe(...this.$.map(a=>a.pd()))}Cb(){return this.$.flatMap(a=>a.Cb())}Kc(){throw Error('Should not try to check predicate coverage on And (should be removed by compiling predicates');}ob(a){return this.$.reduce((b,c)=>b&&c.ob(a),!0)}observe(a,b,c){const d=
690
- Array(this.$.length).fill(!1);let e=null;const f=(g,h)=>{d[g]=h;g=d.every(k=>k);e!==g&&(e=g,c(g))};this.$.forEach((g,h)=>{g.observe(a,olympe.Y.vb('AND-'+b+a+h),f.bind(null,h))})}ha(){return{pr:olympe.dc.query.Ba.C.wn,p:this.$.map(a=>a.ha())}}Pc(){throw Error('toObject for AND predicate should not be called');}toString(){return'And-'+this.$.reduce((a,b)=>a+'-'+b.toString(),'')}clear(a,b){this.$.forEach((c,d)=>{c.clear(a,olympe.Y.vb('AND-'+b+a+d))})}};olympe.dc.query.$.hf=class extends olympe.dc.query.Ba{constructor(a,b,c,d=!1){super();this.Ja=olympe.dc.ga(a);this.substring=b;this.db=c;this.C=d}Cb(){return[this.Ja]}Kc(a,b){return a instanceof olympe.dc.query.$.hf&&a.Ja===this.Ja?b?a.C?a.substring.toLowerCase().includes(this.substring.toLowerCase()):a.substring.includes(this.substring):this.C?this.substring.toLowerCase().includes(a.substring.toLowerCase()):this.substring.includes(a.substring):!1}Sa(){return this.Ja}ob(a){return this.apply(this.db.Sa(a,
691
- this.Ja))}observe(a,b,c){Cg(this.db,a,this.Ja,d=>{c(this.apply(d))},olympe.Y.vb(b+a+this.toString()))}apply(a){a=olympe.dc.nb.Ac(a);return'string'===typeof a?this.C?a.includes(this.substring):a.toLowerCase().includes(this.substring.toLowerCase()):!1}toString(){return'Contains'+this.Ja+'-'+this.substring+'-'+this.C}clear(a,b){Dg(this.db,a,this.Ja,olympe.Y.vb(b+a+this.toString()))}Pc(){return{name:'CONTAINS',property:this.Sa(),value:this.substring,caseSensitive:this.C}}ha(){return{pr:olympe.dc.query.Ba.C.Bj,
690
+ Array(this.$.length).fill(!1);let e=null;const f=(g,h)=>{d[g]=h;g=d.every(k=>k);e!==g&&(e=g,c(g))};this.$.forEach((g,h)=>{g.observe(a,olympe.Y.vb('AND-'+b+a+h),f.bind(null,h))})}ha(){return{pr:olympe.dc.query.Ba.C.wn,p:this.$.map(a=>a.ha())}}Pc(){throw Error('toObject for AND predicate should not be called');}toString(){return'And-'+this.$.reduce((a,b)=>a+'-'+b.toString(),'')}clear(a,b){this.$.forEach((c,d)=>{c.clear(a,olympe.Y.vb('AND-'+b+a+d))})}};olympe.dc.query.$.hf=class extends olympe.dc.query.Ba{constructor(a,b,c,d=!1){super();this.Ja=olympe.dc.ga(a);this.substring=b;this.db=c;this.C=d}Cb(){return[this.Ja]}Kc(a,b){return a instanceof olympe.dc.query.$.hf&&a.Ja===this.Ja?b?a.C?a.substring.toLowerCase().includes(this.substring.toLowerCase()):a.substring.includes(this.substring):this.C?this.substring.toLowerCase().includes(a.substring.toLowerCase()):this.substring.includes(a.substring):!1}Oa(){return this.Ja}ob(a){return this.apply(this.db.Oa(a,
691
+ this.Ja))}observe(a,b,c){Cg(this.db,a,this.Ja,d=>{c(this.apply(d))},olympe.Y.vb(b+a+this.toString()))}apply(a){a=olympe.dc.nb.Ac(a);return'string'===typeof a?this.C?a.includes(this.substring):a.toLowerCase().includes(this.substring.toLowerCase()):!1}toString(){return'Contains'+this.Ja+'-'+this.substring+'-'+this.C}clear(a,b){Dg(this.db,a,this.Ja,olympe.Y.vb(b+a+this.toString()))}Pc(){return{name:'CONTAINS',property:this.Oa(),value:this.substring,caseSensitive:this.C}}ha(){return{pr:olympe.dc.query.Ba.C.Bj,
692
692
  p:this.Ja,s:this.substring,c:this.C}}};olympe.dc.query.$.se=class extends olympe.dc.query.Ba{constructor(a,b,c){super();this.Ja=olympe.dc.ga(a);this.C=olympe.dc.nb.Ac(null!=b?b:null);this.db=c}Cb(){return[this.Ja]}Kc(a){if(a instanceof olympe.dc.query.$.se&&this.Ja===a.Ja)if('object'===typeof this.C&&null!==this.C){if(this.C instanceof olympe.dc.CloudObject)return this.C.Fa(a.C);if(this.C instanceof Date)return a.C instanceof Date&&this.C.getTime()===a.C.getTime();if(this.C instanceof olympe.D.Color)return this.C.Fa(a.C)}else return this.C===
693
- a.C;return!1}ob(a){return this.apply(this.db.Sa(a,this.Ja))}observe(a,b,c){Cg(this.db,a,this.Ja,d=>{c(this.apply(d))},olympe.Y.vb(b+a+this.toString()));null===this.C&&null===this.db.Sa(a,this.Ja)&&c(!0)}clear(a,b){Dg(this.db,a,this.Ja,olympe.Y.vb(b+a+this.toString()))}apply(a){a=olympe.dc.nb.Ac(a);return'object'===typeof a&&null!==a?a instanceof olympe.dc.CloudObject?a.Fa(this.C):a instanceof Date?this.C instanceof Date&&this.C.getTime()===a.getTime():a instanceof olympe.D.Color?a.Fa(this.C):!1:a===
694
- this.C}toString(){let a,b;const c=null!=(b=null==(a=this.C)?void 0:a.toString())?b:'null';return'Equals-'+this.Ja+'-'+c}Pc(){return{name:'EQUALS',property:this.Ja,value:this.C}}ha(){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.X();break;case this.C instanceof olympe.D.Color:a=4,b=this.C.toJSON()}return{pr:olympe.dc.query.Ba.C.Eo,p:this.Ja,t:a,v:b}}};function qi(a,b){return'number'===typeof a.C?a.C:a.db.Sa(b,a.C)}function ri(a,b,c){return olympe.Y.vb(c+b+a.C+a.Ja)}
695
- olympe.dc.query.$.xi=class extends olympe.dc.query.Ba{constructor(a,b,c,d=!0,e=!0){super();this.db=a;this.Ja=olympe.dc.ga(b);this.C='number'===typeof c?c:olympe.dc.ga(c);this.F=d;this.G=e}pd(){return new olympe.dc.query.$.xi(this.db,this.Ja,this.C,!this.F,!this.G)}Cb(){return[this.Ja]}Kc(a,b){if(b)throw Error('Check coverage of inequality should not happen with opposite = true');return a instanceof olympe.dc.query.$.xi&&this.Ja===a.Ja?typeof this.C!==typeof a.C||this.F!==a.F?!1:'number'===typeof this.C?
696
- this.F&&this.C>=a.C||!this.F&&this.C<=a.C:this.C===a.C:!1}Sa(){return this.Ja}ob(a){return this.compare(this.db.Sa(a,this.Ja),qi(this,a))}observe(a,b,c){'string'===typeof this.C&&Cg(this.db,a,this.C,d=>{const e=this.db.Sa(a,this.Ja);null!==e&&c(this.compare(e,d))},ri(this,a,b));Cg(this.db,a,this.Ja,d=>{const e=qi(this,a);c(null!==e?this.compare(d,e):!0)},ri(this,a,b))}compare(a,b){return null===a?!1:null===b?!0:this.G?this.F?a<b:a>b:this.F?a<=b:a>=b}clear(a,b){Dg(this.db,a,this.Ja,ri(this,a,b));'string'===
697
- typeof this.C&&Dg(this.db,a,this.C,ri(this,a,b))}Pc(){return{name:'INEQUALITY_OPERATOR',property:this.Sa(),operator:this.F?'<':'>',strict:this.G,value:this.C}}ha(){return{pr:olympe.dc.query.Ba.C.mp,p:this.Ja,b:this.C,l:this.F,s:this.G}}toString(){return'GreaterThan-'+this.Ja+'-'+this.G+'-'+this.C}};olympe.dc.query.$.de=class extends olympe.dc.query.Ba{constructor(a){super();this.C=a}compile(){const a=this.C.pd();return this.Fa(a)?super.compile():a.compile()}pd(){return this.C}Cb(){return this.C.Cb()}Kc(a,b){return a instanceof olympe.dc.query.$.de?this.C.Kc(a.C,b):this.C.Kc(a,!b)}ob(a){return!this.C.ob(a)}observe(a,b,c){let d=null;this.C.observe(a,olympe.Y.vb('NOT'+b+a),e=>{!e!==d&&(d=!e,c(d))})}Pc(){return{name:'NOT',predicate:this.C.Pc()}}ha(){return{pr:olympe.dc.query.Ba.C.Lp,v:this.C.ha()}}toString(){return`NOT-${this.C.toString()}`}clear(a,
693
+ a.C;return!1}ob(a){return this.apply(this.db.Oa(a,this.Ja))}observe(a,b,c){Cg(this.db,a,this.Ja,d=>{c(this.apply(d))},olympe.Y.vb(b+a+this.toString()));null===this.C&&null===this.db.Oa(a,this.Ja)&&c(!0)}clear(a,b){Dg(this.db,a,this.Ja,olympe.Y.vb(b+a+this.toString()))}apply(a){a=olympe.dc.nb.Ac(a);return'object'===typeof a&&null!==a?a instanceof olympe.dc.CloudObject?a.Fa(this.C):a instanceof Date?this.C instanceof Date&&this.C.getTime()===a.getTime():a instanceof olympe.D.Color?a.Fa(this.C):!1:a===
694
+ this.C}toString(){let a,b;const c=null!=(b=null==(a=this.C)?void 0:a.toString())?b:'null';return'Equals-'+this.Ja+'-'+c}Pc(){return{name:'EQUALS',property:this.Ja,value:this.C}}ha(){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.X();break;case this.C instanceof olympe.D.Color:a=4,b=this.C.toJSON()}return{pr:olympe.dc.query.Ba.C.Eo,p:this.Ja,t:a,v:b}}};function qi(a,b,c){return olympe.Y.vb(c+b+a.C+a.Ja)}
695
+ olympe.dc.query.$.xi=class extends olympe.dc.query.Ba{constructor(a,b,c,d=!0,e=!0){super();this.db=a;this.Ja=olympe.dc.ga(b);this.C=(this.G=('object'===typeof c||'string'===typeof c)&&olympe.dc.CloudObject.exists(c))?olympe.dc.ga(c):c;this.F=d;this.J=e}pd(){return new olympe.dc.query.$.xi(this.db,this.Ja,this.C,!this.F,!this.J)}Cb(){return[this.Ja]}Kc(a,b){if(b)throw Error('Check coverage of inequality should not happen with opposite = true');return a instanceof olympe.dc.query.$.xi&&this.Ja===a.Ja?
696
+ typeof this.C!==typeof a.C||this.F!==a.F?!1:this.G?this.C===a.C:this.F&&this.C>=a.C||!this.F&&this.C<=a.C:!1}Oa(){return this.Ja}ob(a){return this.compare(this.db.Oa(a,this.Ja),this.G?this.db.Oa(a,this.C):this.C)}observe(a,b,c){this.G&&Cg(this.db,a,this.C,d=>{const e=this.db.Oa(a,this.Ja);null!==e&&c(this.compare(e,d))},qi(this,a,b));Cg(this.db,a,this.Ja,d=>{const e=this.G?this.db.Oa(a,this.C):this.C;c(null!==e?this.compare(d,e):!0)},qi(this,a,b))}compare(a,b){return null===a?!1:null===b?!0:this.J?
697
+ this.F?a<b:a>b:this.F?a<=b:a>=b}clear(a,b){Dg(this.db,a,this.Ja,qi(this,a,b));this.G&&Dg(this.db,a,this.C,qi(this,a,b))}Pc(){return{name:'INEQUALITY_OPERATOR',property:this.Oa(),operator:this.F?'<':'>',strict:this.J,value:this.C}}ha(){return{pr:olympe.dc.query.Ba.C.mp,p:this.Ja,b:this.C,l:this.F,s:this.J}}toString(){return(this.F?'LowerThan-':'GreaterThan-')+this.Ja+'-'+this.J+'-'+this.C}};olympe.dc.query.$.de=class extends olympe.dc.query.Ba{constructor(a){super();this.C=a}compile(){const a=this.C.pd();return this.Fa(a)?super.compile():a.compile()}pd(){return this.C}Cb(){return this.C.Cb()}Kc(a,b){return a instanceof olympe.dc.query.$.de?this.C.Kc(a.C,b):this.C.Kc(a,!b)}ob(a){return!this.C.ob(a)}observe(a,b,c){let d=null;this.C.observe(a,olympe.Y.vb('NOT'+b+a),e=>{!e!==d&&(d=!e,c(d))})}Pc(){return{name:'NOT',predicate:this.C.Pc()}}ha(){return{pr:olympe.dc.query.Ba.C.Lp,v:this.C.ha()}}toString(){return`NOT-${this.C.toString()}`}clear(a,
698
698
  b){this.C.clear(a,olympe.Y.vb('NOT'+b+a))}Fa(a){return a instanceof olympe.dc.query.$.de?this.C.Fa(a.C):!1}};olympe.dc.query.$.xe=class extends olympe.dc.query.Ba{constructor(...a){super();this.$=a}compile(){return this.$.map(a=>a.compile()).flat()}pd(){return new olympe.dc.query.$.Fd(...this.$.map(a=>a.pd()))}Cb(){return this.$.flatMap(a=>a.Cb())}Kc(){throw Error('Should not try to check predicate coverage on And (should be removed by compiling predicates');}ob(a){return this.$.reduce((b,c)=>b||c.ob(a),!1)}observe(a,b,c){const d=Array(this.$.length).fill(!1);let e=null;const f=(g,h)=>{d[g]=h;g=d.some(k=>
699
- k);e!==g&&(e=g,c(g))};this.$.forEach((g,h)=>{g.observe(a,olympe.Y.vb('OR-'+b+a+h),f.bind(null,h))})}Pc(){throw Error('toObject for OR predicate should not be called');}ha(){return{pr:olympe.dc.query.Ba.C.Yp,p:this.$.map(a=>a.ha())}}toString(){return'And-'+this.$.reduce((a,b)=>a.toString()+'-'+b.toString(),'')}clear(a,b){this.$.forEach((c,d)=>{c.clear(a,olympe.Y.vb('OR-'+b+a+d))})}};olympe.dc.query.$.uf=class extends olympe.dc.query.Ba{constructor(a,b,c,d=!0){super();this.Ja=olympe.dc.ga(a);this.C='string'===typeof b?new RegExp(d?b:b.toLowerCase()):d?b:new RegExp(b.source.toLowerCase());this.db=c;this.F=d}Cb(){return[this.Ja]}Kc(a){return a instanceof olympe.dc.query.$.uf&&this.Ja===a.Ja&&this.C.toString()===a.C.toString()}ob(a){return this.apply(this.db.Sa(a,this.Ja))}observe(a,b,c){Cg(this.db,a,this.Ja,d=>{c(this.apply(d))},olympe.Y.vb(b+a+this.toString()))}apply(a){a=olympe.dc.nb.Ac(a);
700
- return'string'===typeof a?this.C.test(this.F?a:a.toLowerCase()):!1}toString(){return'Regex'+this.Ja+'-'+this.C.toString()+'-'+this.F}Pc(){return{name:'REGEX',property:this.Ja,pattern:this.C,caseSensitive:this.F}}ha(){return{pr:olympe.dc.query.Ba.C.uq,p:this.Ja,r:this.C.source,c:this.F}}clear(a,b){Dg(this.db,a,this.Ja,olympe.Y.vb(b+a+this.toString()))}};olympe.dc.query.$.tm=class extends olympe.dc.query.Ba{constructor(a){super();this.C=new Set(a.map(olympe.dc.ga))}Cb(){return[]}Kc(a){return a instanceof olympe.dc.query.$.tm&&Array.from(a.C).every(b=>this.C.has(b))}ob(a){return this.C.has(a)}observe(a,b,c){c(this.C.has(a))}clear(){}toString(){return'Tags-'+Array.from(this.C)}Pc(){return{name:'IS',tags:Array.from(this.C)}}ha(){return{pr:olympe.dc.query.Ba.C.Zq,t:Array.from(this.C)}}};olympe.dc.query.ta={};function oi(a){let b,c;const d=new Set(null!=(c=null==(b=a.F)?void 0:b.Cb())?c:[]);let e;a.Hb&&d.add(null==(e=a.Hb)?void 0:e.Sa().X());return d}function si(a){if(!a.ea){let b,c;a.ea=null!=(c=null==(b=a.F)?void 0:b.compile())?c:[]}return a.ea}function ti(a,b){for(const c of b)if(a.some(d=>d.Kc(c,!1)))return!0;return!1}
701
- function ui(a,b){if(null===a.F)return b;let c=!1;const d=a.toString();return(e,f,g,h)=>{const k=olympe.Y.vb(h+f+d);e?a.F.observe(f,k,l=>{c||b(l,f,g,k)}):(c=!0,a.F.clear(f,k),c=!1,b(!1,f,g,k))}}function vi(a,b,c){if(null===a.Hb)return c;const d=a.toString();return(e,f,g,h)=>{const k=a.Hb.Sa();h=olympe.Y.vb(h+d);e?Cg(a.db,f,k,()=>{Eh(b)},h):Dg(a.db,f,k,h);c(e,f,g,h)}}
702
- olympe.dc.query.ta.cm=class{constructor(a,b){this.db=olympe.dc.ia();this.C=a;this.optional=b;this.ea=this.Hb=this.F=this.id=null}static C(a){var b=a.i;if('string'===typeof a.f)return new olympe.dc.query.ta.Td(b,a.f);var c=a.o;const d=new olympe.dc.Oa.Relation(a.t,a.d);b='boolean'===typeof a.s?new olympe.dc.query.ta.te(b,d,a.s,c):new olympe.dc.query.ta.oh(b,d,c);void 0!==a.p&&(b.F=Nh(a.p));void 0!==a.c&&(c=b.U(),a=a.c,a=new olympe.dc.query.gf(c,new olympe.dc.Oa.Property(a.p),a.o),b.Hb=a);return b}O(){}J(){let a,
703
- b,c,d;return`${this.C}-${this.optional}${null!=(c=null==(a=this.F)?void 0:a.toString())?c:''}${null!=(d=null==(b=this.Hb)?void 0:b.toString())?d:''}`}Pc(){}toJSON(){}ha(){const a={i:this.C,o:this.optional};null!==this.F&&(a.p=this.F.ha());null!==this.Hb&&(a.c=this.Hb.ha());return a}Z(){}ua(){return new olympe.dc.query.ta.mm}aa(){}U(){null===this.id&&(this.id=this.Z());return this.id}T(){return this.optional}Kc(a){const b=si(this);if(0===b.length)return!0;a=si(a);if(0===a.length)return!1;for(const c of a)if(!b.some(d=>
704
- ti(d,c)))return!1;return!0}filter(a){const b=this.O(),c=b.F;null===c?b.F=a:b.F=c instanceof olympe.dc.query.$.Fd?new olympe.dc.query.$.Fd(...Array.from(c.$),a):new olympe.dc.query.$.Fd(b.F,a);return b}sort(a,b){const c=this.O();c.Hb=new olympe.dc.query.gf(this.U(),a,b);return c}Rg(){return this.Hb}ob(a){if(null!==this.F){var b=this.U();for(const c of Fh(a,b))this.F.ob(c)||a.remove(c,b,null)}}observe(a,b){const c=this.U();return ui(this,vi(this,a,(d,e,f,g)=>{(d?Hh(a,e,c,f):a.remove(e,c,f))&&b(d,e,
699
+ k);e!==g&&(e=g,c(g))};this.$.forEach((g,h)=>{g.observe(a,olympe.Y.vb('OR-'+b+a+h),f.bind(null,h))})}Pc(){throw Error('toObject for OR predicate should not be called');}ha(){return{pr:olympe.dc.query.Ba.C.Yp,p:this.$.map(a=>a.ha())}}toString(){return'And-'+this.$.reduce((a,b)=>a.toString()+'-'+b.toString(),'')}clear(a,b){this.$.forEach((c,d)=>{c.clear(a,olympe.Y.vb('OR-'+b+a+d))})}};olympe.dc.query.$.uf=class extends olympe.dc.query.Ba{constructor(a,b,c,d=!0){super();this.Ja=olympe.dc.ga(a);this.C='string'===typeof b?new RegExp(d?b:b.toLowerCase()):d?b:new RegExp(b.source.toLowerCase());this.db=c;this.F=d}Cb(){return[this.Ja]}Kc(a){return a instanceof olympe.dc.query.$.uf&&this.Ja===a.Ja&&this.C.toString()===a.C.toString()}ob(a){return this.apply(this.db.Oa(a,this.Ja))}observe(a,b,c){Cg(this.db,a,this.Ja,d=>{c(this.apply(d))},olympe.Y.vb(b+a+this.toString()))}apply(a){a=olympe.dc.nb.Ac(a);
700
+ return'string'===typeof a?this.C.test(this.F?a:a.toLowerCase()):!1}toString(){return'Regex'+this.Ja+'-'+this.C.toString()+'-'+this.F}Pc(){return{name:'REGEX',property:this.Ja,pattern:this.C,caseSensitive:this.F}}ha(){return{pr:olympe.dc.query.Ba.C.uq,p:this.Ja,r:this.C.source,c:this.F}}clear(a,b){Dg(this.db,a,this.Ja,olympe.Y.vb(b+a+this.toString()))}};olympe.dc.query.$.tm=class extends olympe.dc.query.Ba{constructor(a){super();this.C=new Set(a.map(olympe.dc.ga))}Cb(){return[]}Kc(a){return a instanceof olympe.dc.query.$.tm&&Array.from(a.C).every(b=>this.C.has(b))}ob(a){return this.C.has(a)}observe(a,b,c){c(this.C.has(a))}clear(){}toString(){return'Tags-'+Array.from(this.C)}Pc(){return{name:'IS',tags:Array.from(this.C)}}ha(){return{pr:olympe.dc.query.Ba.C.Zq,t:Array.from(this.C)}}};olympe.dc.query.ta={};function oi(a){let b,c;const d=new Set(null!=(c=null==(b=a.F)?void 0:b.Cb())?c:[]);let e;a.Ib&&d.add(null==(e=a.Ib)?void 0:e.Oa().X());return d}function ri(a){if(!a.ea){let b,c;a.ea=null!=(c=null==(b=a.F)?void 0:b.compile())?c:[]}return a.ea}function si(a,b){for(const c of b)if(a.some(d=>d.Kc(c,!1)))return!0;return!1}
701
+ function ti(a,b){if(null===a.F)return b;let c=!1;const d=a.toString();return(e,f,g,h)=>{const k=olympe.Y.vb(h+f+d);e?a.F.observe(f,k,l=>{c||b(l,f,g,k)}):(c=!0,a.F.clear(f,k),c=!1,b(!1,f,g,k))}}function ui(a,b,c){if(null===a.Ib)return c;const d=a.toString();return(e,f,g,h)=>{const k=a.Ib.Oa();h=olympe.Y.vb(h+d);e?Cg(a.db,f,k,()=>{Eh(b)},h):Dg(a.db,f,k,h);c(e,f,g,h)}}
702
+ olympe.dc.query.ta.cm=class{constructor(a,b){this.db=olympe.dc.ia();this.C=a;this.optional=b;this.ea=this.Ib=this.F=this.id=null}static C(a){var b=a.i;if('string'===typeof a.f)return new olympe.dc.query.ta.Td(b,a.f);var c=a.o;const d=new olympe.dc.Pa.Relation(a.t,a.d);b='boolean'===typeof a.s?new olympe.dc.query.ta.te(b,d,a.s,c):new olympe.dc.query.ta.oh(b,d,c);void 0!==a.p&&(b.F=Nh(a.p));void 0!==a.c&&(c=b.U(),a=a.c,a=new olympe.dc.query.gf(c,new olympe.dc.Pa.Property(a.p),a.o),b.Ib=a);return b}O(){}J(){let a,
703
+ b,c,d;return`${this.C}-${this.optional}${null!=(c=null==(a=this.F)?void 0:a.toString())?c:''}${null!=(d=null==(b=this.Ib)?void 0:b.toString())?d:''}`}Pc(){}toJSON(){}ha(){const a={i:this.C,o:this.optional};null!==this.F&&(a.p=this.F.ha());null!==this.Ib&&(a.c=this.Ib.ha());return a}Z(){}ua(){return new olympe.dc.query.ta.mm}aa(){}U(){null===this.id&&(this.id=this.Z());return this.id}T(){return this.optional}Kc(a){const b=ri(this);if(0===b.length)return!0;a=ri(a);if(0===a.length)return!1;for(const c of a)if(!b.some(d=>
704
+ si(d,c)))return!1;return!0}filter(a){const b=this.O(),c=b.F;null===c?b.F=a:b.F=c instanceof olympe.dc.query.$.Fd?new olympe.dc.query.$.Fd(...Array.from(c.$),a):new olympe.dc.query.$.Fd(b.F,a);return b}sort(a,b){const c=this.O();c.Ib=new olympe.dc.query.gf(this.U(),a,b);return c}Rg(){return this.Ib}ob(a){if(null!==this.F){var b=this.U();for(const c of Fh(a,b))this.F.ob(c)||a.remove(c,b,null)}}observe(a,b){const c=this.U();return ti(this,ui(this,a,(d,e,f,g)=>{(d?Hh(a,e,c,f):a.remove(e,c,f))&&b(d,e,
705
705
  f,g)}))}Fa(){}};olympe.dc.query.ta.Eh=class extends olympe.dc.query.ta.cm{constructor(a,b,c){super(a,c);this.relation=b;this.ja=null}};olympe.dc.query.ta.jq=class{has(){}O(){}F(){}ad(){}G(){}remove(){}};olympe.dc.query.ta.jo=class{constructor(a){this.C=null;this.content=new Map;this.J=null!=a?a:null}ad(){return this.content.keys()}F(a){return this.content.has(a)&&null!==this.C?[this.C].values():[].values()}has(a){return this.content.has(a)}O(a){let b;return(null==(b=this.J)?void 0:b.call(this,a))||!1}G(a,b){if(null===this.C)this.C=b;else if(b!==this.C)throw Error('Should never try to insert multi parent in the same counter part result. To be used with FollowRulePart only');let c;b=null!=(c=this.content.get(a))?
706
- c:0;this.content.set(a,b+1);return 0===b}remove(a,b){if(null===b)return this.content.delete(a);b=this.content.get(a);1<b?this.content.set(a,b-1):this.content.delete(a);return 1===b}};olympe.dc.query.ta.jo.ya=[olympe.dc.query.ta.jq];olympe.dc.query.ta.oh=class extends olympe.dc.query.ta.Eh{constructor(a,b,c){super(a,olympe.dc.query.Relation.from(b,!1),c)}O(){const a=new olympe.dc.query.ta.oh(this.C,this.relation,this.optional);a.F=this.F;a.Hb=this.Hb;return a}Z(){return olympe.Y.vb(this.C+this.relation.U())}aa(a,b){if(b instanceof olympe.dc.query.ta.Td)return[a];const c=[a+this.relation.U(),a+pi(this.relation).U()+!1,a+pi(this.relation).U()+!0,a+'followRules'].map(d=>olympe.Y.vb(d));b instanceof olympe.dc.query.ta.te&&b.relation.Fa(this.relation)&&
707
- c.push(a);return c}ob(a){const b=this.U();for(const c of Fh(a,this.C))this.db.bb(c,this.relation).forEach(d=>{Hh(a,d,b,c)});super.ob(a)}observe(a,b){const c=super.observe(a,b),d=this.relation.X(),e=this.relation.Ia();return(f,g,h,k)=>{const l=olympe.Y.vb(k+g+this.toString());f?V(this.db,g,this.relation,(n,p)=>{Ih(a,n,d,e,g,p);c(n,p,g,l)},l):this.db.F(g,this.relation,l)}}ha(){return Object.assign(super.ha(),{t:this.relation.X(),d:this.relation.Ia()})}J(){return`followPart-${this.relation.U()}-${super.J()}`}Pc(){const a=
708
- {recursive:!1,relation:this.relation,filter:si(this).map(b=>b.map(c=>c.Pc())),optional:this.T()};this.Hb&&(a.sort={property:this.Hb.Sa(),order:this.Hb.Ai});return a}toString(){return`Follow Part: ${this.relation}`}toJSON(){return{type:'follow',relation:`${this.db.name(this.relation)} (${this.relation.X()})`,direction:this.relation.Ia()}}Fa(a){return a instanceof olympe.dc.query.ta.oh&&this.relation.Fa(a.relation)}};olympe.dc.query.ta.te=class extends olympe.dc.query.ta.Eh{constructor(a,b,c,d){super(a,olympe.dc.query.Relation.from(b,!0),d);this.G=c}O(){const a=new olympe.dc.query.ta.te(this.C,this.relation,this.G,this.optional);a.F=this.F;a.Hb=this.Hb;return a}Z(){return olympe.Y.vb(this.C+this.relation.U()+this.G)}aa(a,b){if(b instanceof olympe.dc.query.ta.Td)return[a];const c=[a+this.relation.U()+this.G,a+'followRules'].map(d=>olympe.Y.vb(d));b instanceof olympe.dc.query.ta.te&&b.relation.Fa(this.relation)&&
706
+ c:0;this.content.set(a,b+1);return 0===b}remove(a,b){if(null===b)return this.content.delete(a);b=this.content.get(a);1<b?this.content.set(a,b-1):this.content.delete(a);return 1===b}};olympe.dc.query.ta.jo.ya=[olympe.dc.query.ta.jq];olympe.dc.query.ta.oh=class extends olympe.dc.query.ta.Eh{constructor(a,b,c){super(a,olympe.dc.query.Relation.from(b,!1),c)}O(){const a=new olympe.dc.query.ta.oh(this.C,this.relation,this.optional);a.F=this.F;a.Ib=this.Ib;return a}Z(){return olympe.Y.vb(this.C+this.relation.U())}aa(a,b){if(b instanceof olympe.dc.query.ta.Td)return[a];const c=[a+this.relation.U(),a+pi(this.relation).U()+!1,a+pi(this.relation).U()+!0,a+'followRules'].map(d=>olympe.Y.vb(d));b instanceof olympe.dc.query.ta.te&&b.relation.Fa(this.relation)&&
707
+ c.push(a);return c}ob(a){const b=this.U();for(const c of Fh(a,this.C))this.db.cb(c,this.relation).forEach(d=>{Hh(a,d,b,c)});super.ob(a)}observe(a,b){const c=super.observe(a,b),d=this.relation.X(),e=this.relation.Ia();return(f,g,h,k)=>{const l=olympe.Y.vb(k+g+this.toString());f?V(this.db,g,this.relation,(n,p)=>{Ih(a,n,d,e,g,p);c(n,p,g,l)},l):this.db.F(g,this.relation,l)}}ha(){return Object.assign(super.ha(),{t:this.relation.X(),d:this.relation.Ia()})}J(){return`followPart-${this.relation.U()}-${super.J()}`}Pc(){const a=
708
+ {recursive:!1,relation:this.relation,filter:ri(this).map(b=>b.map(c=>c.Pc())),optional:this.T()};this.Ib&&(a.sort={property:this.Ib.Oa(),order:this.Ib.Ai});return a}toString(){return`Follow Part: ${this.relation}`}toJSON(){return{type:'follow',relation:`${this.db.name(this.relation)} (${this.relation.X()})`,direction:this.relation.Ia()}}Fa(a){return a instanceof olympe.dc.query.ta.oh&&this.relation.Fa(a.relation)}};olympe.dc.query.ta.te=class extends olympe.dc.query.ta.Eh{constructor(a,b,c,d){super(a,olympe.dc.query.Relation.from(b,!0),d);this.G=c}O(){const a=new olympe.dc.query.ta.te(this.C,this.relation,this.G,this.optional);a.F=this.F;a.Ib=this.Ib;return a}Z(){return olympe.Y.vb(this.C+this.relation.U()+this.G)}aa(a,b){if(b instanceof olympe.dc.query.ta.Td)return[a];const c=[a+this.relation.U()+this.G,a+'followRules'].map(d=>olympe.Y.vb(d));b instanceof olympe.dc.query.ta.te&&b.relation.Fa(this.relation)&&
709
709
  c.push(a);return c}ob(a){const b=this.U();for(const c of Fh(a,this.C))this.G&&Hh(a,c,b,c),this.db.Vg(c,this.relation).forEach(d=>{Hh(a,d,b,c)});super.ob(a)}observe(a,b){const c=super.observe(a,b),d=this.relation.X(),e=this.relation.Ia(),f=new Set,g=(h,k,l,n,p)=>{k=olympe.Y.vb(k+h+p+l);if(this.G||0<l)0<l&&Ih(a,n,d,e,h,p),c(n,p,h,k);n?f.has(p)||(f.add(p),V(this.db,p,this.relation,g.bind(this,h,k,l+1),k)):(f.delete(p),this.db.F(p,this.relation,k))};return(h,k,l,n)=>g(k,n+this.toString(),0,h,k)}ha(){return Object.assign(super.ha(),
710
- {s:this.G,t:this.relation.X(),d:this.relation.Ia()})}J(){return`followRecursivelyPart-${this.relation.U()}-${this.G}-${super.J()}`}Pc(){const a={recursive:this.G?'INCLUDE_SELF':'EXCLUDE_SELF',relation:this.relation,filter:si(this).map(b=>b.map(c=>c.Pc())),optional:this.T()};this.Hb&&(a.sort={property:this.Hb.Sa(),order:this.Hb.Ai});return a}toString(){return`FollowRecursively Part: ${this.relation}`}toJSON(){return{type:'follow recursively',relation:`${this.db.name(this.relation)} (${this.relation.X()})`,
710
+ {s:this.G,t:this.relation.X(),d:this.relation.Ia()})}J(){return`followRecursivelyPart-${this.relation.U()}-${this.G}-${super.J()}`}Pc(){const a={recursive:this.G?'INCLUDE_SELF':'EXCLUDE_SELF',relation:this.relation,filter:ri(this).map(b=>b.map(c=>c.Pc())),optional:this.T()};this.Ib&&(a.sort={property:this.Ib.Oa(),order:this.Ib.Ai});return a}toString(){return`FollowRecursively Part: ${this.relation}`}toJSON(){return{type:'follow recursively',relation:`${this.db.name(this.relation)} (${this.relation.X()})`,
711
711
  direction:this.relation.Ia()}}Fa(a){return a instanceof olympe.dc.query.ta.te&&this.relation.Fa(a.relation)&&this.G===a.G}};olympe.dc.query.ta.Td=class extends olympe.dc.query.ta.cm{constructor(a,b,c){super(a,!1);this.Ob=b;this.G=null!=c?c:null}O(){return new olympe.dc.query.ta.Td(this.C,this.Ob,this.G)}Z(){return olympe.Y.vb(this.C+'followRules')}ua(){return new olympe.dc.query.ta.jo(this.G)}aa(a,b){return b instanceof olympe.dc.query.ta.Td?[a]:[olympe.Y.vb(a+'followRules')]}Kc(a){if(a instanceof olympe.dc.query.ta.Eh){const b=olympe.dc.wa.ORIGIN,c=olympe.dc.wa.DESTINATION,d=olympe.dc.nc.Yc,e=olympe.dc.nc.ni,f=olympe.dm.Relation.C.im,
712
- g=olympe.dm.Relation.C.vm;a=a.relation;const h=a.Ia(),k=a.X();return h!==c||k!==d&&k!==e?!!(Lg(this.db,a,this.Ob)&(a.Ia()===b?f:g)):!0}return a instanceof olympe.dc.query.ta.Td?this.Ob===a.Ob:!1}ob(a){const b=this.U();for(const c of Fh(a,this.C))for(const d of Jf(this.db,c,this.Ob))Hh(a,d,b,c)}observe(a,b){const c=this.U(),d=(e,f,g,h,k)=>{const l=`${h}:${g}`;f?Mg(this.db,g,this.Ob,(n,p,q,r,t)=>{q&&!k.includes(t)&&(q=r?Hh(a,t,c,e):a.remove(t,c,e),null!==p&&Ih(a,r,n,p,g,t),q&&d(e,r,t,h,new wi(t,k)))},
713
- l):Ng(this.db,g,this.Ob,l);b(f,g,e,l)};return(e,f,g,h)=>{g=olympe.Y.vb(h+f+this.toString());(e?Hh(a,f,c,f):a.remove(f,c,f))&&d(f,e,f,g,new wi(f,null))}}ha(){return Object.assign(super.ha(),{f:this.Ob})}J(){return`followRulePart-${this.Ob}-${super.J()}`}Pc(){throw Error('Try to parse a part of an implicit query. Data connectors do not support those queries.');}toString(){return`FollowRule Part: ${this.db.name(this.Ob)} (${this.Ob})`}Fa(a){return a instanceof olympe.dc.query.ta.Td&&this.Ob===a.Ob}toJSON(){return{type:'follow rule',
714
- rule:`${this.db.name(this.Ob)} (${this.Ob})`}}T(){return!1}filter(){olympe.ka.ib('dc.query').warn('Should never try to filter on queries with follow rules, ignore...');return this}sort(){olympe.ka.ib('dc.query').warn('Should never try to sort queries with follow rules, ignore...');return this}};olympe.dc.query.ta.Td.F='followRules';
715
- class wi{constructor(a,b){this.tag=a;this.C=b}includes(a){let b;return this.tag===a||!(null==(b=this.C)||!b.includes(a))}toString(){return this.C?`${this.C.toString()} -> ${this.tag}`:this.tag}};olympe.dc.query.ta.mm=class{constructor(){this.content=new Map}ad(){return this.content.keys()}F(a){let b,c;return null!=(c=null==(b=this.content.get(a))?void 0:b.values())?c:[]}has(a){return this.content.has(a)}O(){return!1}G(a,b){let c=this.content.get(a);c||(c=new Set,this.content.set(a,c));a=c.size;c.add(b);return a<c.size}remove(a,b){if(null===b)return this.content.delete(a);const c=this.content.get(a);b=c.delete(b);0===c.size&&this.content.delete(a);return b}};olympe.dc.query.ta.mm.ya=[olympe.dc.query.ta.jq];olympe.dc.sources={};olympe.dc.sources.Gq=class extends Error{};olympe.dc.sources.Hj=class{U(){}init(){}destroy(){}request(){return v(function*(){})}subscribe(){}};const xi=olympe.net.Aa.Id.GET,yi=olympe.net.Aa.Id.Ah,zi=olympe.net.Aa.Id.Dc,Ai=olympe.net.Aa.Id.iq,Bi=olympe.net.Aa.Headers.ki,Ci=olympe.net.Aa.Headers.In,Di=olympe.net.Aa.Yb.xh,Ei=olympe.net.Aa.Yb.Zn,Fi=olympe.net.Aa.Yb.No,Gi=olympe.net.Aa.Yb.Li,Hi=olympe.net.Aa.Yb.Ql;
716
- function Ii(a){const b=`/${olympe.W.getParameter(olympe.dc.sources.V.xl)}/:${'sourceId'}/:${'requestType'}`.replace(/\/+/g,'/').replace(/\/$/,'');a.T.G('_DataSourcesHTTPService',b,[xi,yi,zi,Ai],(c,d,e)=>v(function*(){const f=d.get('sourceId');var g=a.G.get(d.get('sourceId'));if(!g){var h;g=null!=(h=olympe.dc.ia().name(f))?h:'name unknown';return Promise.resolve(new olympe.net.be(`No handler found for datasource ${f} called '${g}'`,Hi,'Invalid source id'))}h=c.method;const k=c.fj();try{var l=yield Ji(a,
717
- k[Ci])}catch(r){return new olympe.net.be(`Invalid token ${r}`,Fi,'Access denied')}try{var n=Number(d.get('requestType')),p=c.body;const r=olympe.dc.Request.C.Gb,t=olympe.dc.Request.C.Bg,u=olympe.dc.Request.C.Ue,x=olympe.dc.Request.C.Mg,y=olympe.dc.Request.C.fh,z=olympe.dc.Request.C.rg,A=olympe.dc.Request.C.Tf,D=olympe.dc.Request.C.ag;let O;switch(n){case r:break;case t:case u:case y:case x:O=a.F.O(p);break;case D:case z:case A:O={tag:e.get('tag'),model:e.get('model'),mimeType:k[Bi]};p instanceof Uint8Array&&
718
- (O.content=p);break;default:throw Error(`Data Http request type not supported ${n}`);}let M;const xa=null!=(M=k['X-Source-Origin'])?M:olympe.dc.Ra.sf;var q=mf(new olympe.dc.Request(n,f,O,l),xa);const Ra=yield g(q);let Xc;void 0===Ra?Xc='':Ra instanceof Blob||Ra instanceof Uint8Array||Ra instanceof ArrayBuffer||'function'===typeof(null==Ra?void 0:Ra.pipe)?Xc=Ra:Xc=JSON.stringify(a.F.ha(Ra));return new olympe.net.be(Xc,h===Ai?Ei:Di)}catch(r){return r instanceof olympe.dc.sources.Gq?new olympe.net.be(`Authorization error: ${r}`,
719
- Fi,'Forbidden'):new olympe.net.be(`Internal server error: ${r}`,Gi,'Internal server error')}})).catch(c=>a.H.error(`Error while starting the HTTP Service: ${c}`));a.H.debug(`Started HTTP service with path: ${b}`)}function Ki(a){a.T.Z('_DataSourcesHTTPService').catch(b=>{a.H.error(`An error occurred while stopping the data sources http service: ${b}`)})}function Li(a,b,c){0===a.G.size&&Ii(a);a.G.set(b,c);return()=>{a.G.delete(b);0===a.G.size&&Ki(a)}}
720
- function Mi(a,b,c){c=b instanceof olympe.dm.DataSource?b.Df(c):Ni(b,c);null===c&&a.H.error(`Impossible to build URL for data source ${b}`);return c}
721
- function Oi(a,b,c){if(b===olympe.dc.Ra.SERVER){var d;return null!=(d=Dd(a.J,a.ea.get(c)))?d:null}var e=a.O.get(b);if(!e){d=a.aa.tb(b);e=olympe.dc.sources.V.ph;const f=olympe.dc.sources.V.lf,g=olympe.dc.sources.V.ti,h=olympe.dc.sources.V.xl;let k;e=`${Mi(a,null!=d?d:b,g)?'https':'http'}://${Mi(a,null!=d?d:b,e)}:${null!=(k=Mi(a,null!=d?d:b,f))?k:Mi(a,null!=d?d:b,g)?443:80}`+`/${Mi(a,null!=d?d:b,h)}/${b}`.replace(/\/+/g,'/').replace(/\/$/,'');a.O.set(b,e)}return`${e}/${c}`}
722
- function Pi(a,b){return b instanceof olympe.net.wi?Fd(a.J,b,jd(a.Z).wd()):Promise.reject('No http request to send')}function Qi(a,b){var c=Oi(a,b.jc(),b.getType());if(!c)return Promise.reject(`No destination URL to send the query to destination: ${b.jc()}`);const d=b.content,e=JSON.stringify(a.F.ha(d));c=N(c,yi,e);rc(c,{['X-Source-Origin']:b.origin,[Bi]:'application/json'});return Pi(a,c).then(f=>'string'===typeof f?a.F.O(JSON.parse(f)):olympe.dc.query.td.cj(d))}
723
- function Ri(a,b){var c=Oi(a,b.jc(),b.getType());if(!c)return Promise.reject(`No destination URL to send the transaction to destination: ${b.jc()}`);const d=JSON.stringify(a.F.ha(b.content));c=N(c,yi,d);rc(c,{['X-Source-Origin']:b.origin,[Bi]:'application/json'});return Pi(a,c).then(e=>Number.parseInt(e,10))}function Ji(a,b){return'string'!==typeof b?Promise.reject('Please provide an authorization token.'):new Promise((c,d)=>{a.Z.Yg(b,(e,f)=>{e?d(e):c(f)})})}
712
+ g=olympe.dm.Relation.C.vm;a=a.relation;const h=a.Ia(),k=a.X();return h!==c||k!==d&&k!==e?!!(Lg(this.db,a,this.Ob)&(a.Ia()===b?f:g)):!0}return a instanceof olympe.dc.query.ta.Td?this.Ob===a.Ob:!1}ob(a){const b=this.U();for(const c of Fh(a,this.C))for(const d of Jf(this.db,c,this.Ob))Hh(a,d,b,c)}observe(a,b){const c=this.U(),d=(e,f,g,h,k)=>{const l=`${h}:${g}`;f?Mg(this.db,g,this.Ob,(n,p,q,r,t)=>{q&&!k.includes(t)&&(q=r?Hh(a,t,c,e):a.remove(t,c,e),null!==p&&Ih(a,r,n,p,g,t),q&&d(e,r,t,h,new vi(t,k)))},
713
+ l):Ng(this.db,g,this.Ob,l);b(f,g,e,l)};return(e,f,g,h)=>{g=olympe.Y.vb(h+f+this.toString());(e?Hh(a,f,c,f):a.remove(f,c,f))&&d(f,e,f,g,new vi(f,null))}}ha(){return Object.assign(super.ha(),{f:this.Ob})}J(){return`followRulePart-${this.Ob}-${super.J()}`}Pc(){throw Error('Try to parse a part of an implicit query. Data connectors do not support those queries.');}toString(){return`FollowRule Part: ${this.db.name(this.Ob)} (${this.Ob})`}Fa(a){return a instanceof olympe.dc.query.ta.Td&&this.Ob===a.Ob}toJSON(){return{type:'follow rule',
714
+ rule:`${this.db.name(this.Ob)} (${this.Ob})`}}T(){return!1}filter(){olympe.ka.ab('dc.query').warn('Should never try to filter on queries with follow rules, ignore...');return this}sort(){olympe.ka.ab('dc.query').warn('Should never try to sort queries with follow rules, ignore...');return this}};olympe.dc.query.ta.Td.F='followRules';
715
+ class vi{constructor(a,b){this.tag=a;this.C=b}includes(a){let b;return this.tag===a||!(null==(b=this.C)||!b.includes(a))}toString(){return this.C?`${this.C.toString()} -> ${this.tag}`:this.tag}};olympe.dc.query.ta.mm=class{constructor(){this.content=new Map}ad(){return this.content.keys()}F(a){let b,c;return null!=(c=null==(b=this.content.get(a))?void 0:b.values())?c:[]}has(a){return this.content.has(a)}O(){return!1}G(a,b){let c=this.content.get(a);c||(c=new Set,this.content.set(a,c));a=c.size;c.add(b);return a<c.size}remove(a,b){if(null===b)return this.content.delete(a);const c=this.content.get(a);b=c.delete(b);0===c.size&&this.content.delete(a);return b}};olympe.dc.query.ta.mm.ya=[olympe.dc.query.ta.jq];olympe.dc.sources={};olympe.dc.sources.Gq=class extends Error{};olympe.dc.sources.Hj=class{U(){}init(){}destroy(){}request(){return v(function*(){})}subscribe(){}};const wi=olympe.net.Aa.Id.GET,xi=olympe.net.Aa.Id.Ah,yi=olympe.net.Aa.Id.Dc,zi=olympe.net.Aa.Id.iq,Ai=olympe.net.Aa.Headers.ki,Bi=olympe.net.Aa.Headers.In,Ci=olympe.net.Aa.Yb.xh,Di=olympe.net.Aa.Yb.Zn,Ei=olympe.net.Aa.Yb.No,Fi=olympe.net.Aa.Yb.Li,Gi=olympe.net.Aa.Yb.Ql;
716
+ function Hi(a){const b=`/${olympe.W.getParameter(olympe.dc.sources.V.xl)}/:${'sourceId'}/:${'requestType'}`.replace(/\/+/g,'/').replace(/\/$/,'');a.T.G('_DataSourcesHTTPService',b,[wi,xi,yi,zi],(c,d,e)=>v(function*(){const f=d.get('sourceId');var g=a.G.get(d.get('sourceId'));if(!g){var h;g=null!=(h=olympe.dc.ia().name(f))?h:'name unknown';return Promise.resolve(new olympe.net.be(`No handler found for datasource ${f} called '${g}'`,Gi,'Invalid source id'))}h=c.method;const k=c.fj();try{var l=yield Ii(a,
717
+ k[Bi])}catch(r){return new olympe.net.be(`Invalid token ${r}`,Ei,'Access denied')}try{var n=Number(d.get('requestType')),p=c.body;const r=olympe.dc.Request.C.Hb,t=olympe.dc.Request.C.Bg,u=olympe.dc.Request.C.Ue,x=olympe.dc.Request.C.Mg,y=olympe.dc.Request.C.fh,z=olympe.dc.Request.C.rg,A=olympe.dc.Request.C.Tf,D=olympe.dc.Request.C.ag;let O;switch(n){case r:break;case t:case u:case y:case x:O=a.F.O(p);break;case D:case z:case A:O={tag:e.get('tag'),model:e.get('model'),mimeType:k[Ai]};p instanceof Uint8Array&&
718
+ (O.content=p);break;default:throw Error(`Data Http request type not supported ${n}`);}let M;const xa=null!=(M=k['X-Source-Origin'])?M:olympe.dc.Sa.sf;var q=mf(new olympe.dc.Request(n,f,O,l),xa);const Ra=yield g(q);let Xc;void 0===Ra?Xc='':Ra instanceof Blob||Ra instanceof Uint8Array||Ra instanceof ArrayBuffer||'function'===typeof(null==Ra?void 0:Ra.pipe)?Xc=Ra:Xc=JSON.stringify(a.F.ha(Ra));return new olympe.net.be(Xc,h===zi?Di:Ci)}catch(r){return r instanceof olympe.dc.sources.Gq?new olympe.net.be(`Authorization error: ${r}`,
719
+ Ei,'Forbidden'):new olympe.net.be(`Internal server error: ${r}`,Fi,'Internal server error')}})).catch(c=>a.H.error(`Error while starting the HTTP Service: ${c}`));a.H.debug(`Started HTTP service with path: ${b}`)}function Ji(a){a.T.Z('_DataSourcesHTTPService').catch(b=>{a.H.error(`An error occurred while stopping the data sources http service: ${b}`)})}function Ki(a,b,c){0===a.G.size&&Hi(a);a.G.set(b,c);return()=>{a.G.delete(b);0===a.G.size&&Ji(a)}}
720
+ function Li(a,b,c){c=b instanceof olympe.dm.DataSource?b.Df(c):Mi(b,c);null===c&&a.H.error(`Impossible to build URL for data source ${b}`);return c}
721
+ function Ni(a,b,c){if(b===olympe.dc.Sa.SERVER){var d;return null!=(d=Dd(a.J,a.ea.get(c)))?d:null}var e=a.O.get(b);if(!e){d=a.aa.tb(b);e=olympe.dc.sources.V.ph;const f=olympe.dc.sources.V.lf,g=olympe.dc.sources.V.ti,h=olympe.dc.sources.V.xl;let k;e=`${Li(a,null!=d?d:b,g)?'https':'http'}://${Li(a,null!=d?d:b,e)}:${null!=(k=Li(a,null!=d?d:b,f))?k:Li(a,null!=d?d:b,g)?443:80}`+`/${Li(a,null!=d?d:b,h)}/${b}`.replace(/\/+/g,'/').replace(/\/$/,'');a.O.set(b,e)}return`${e}/${c}`}
722
+ function Oi(a,b){return b instanceof olympe.net.wi?Fd(a.J,b,jd(a.Z).wd()):Promise.reject('No http request to send')}function Pi(a,b){var c=Ni(a,b.jc(),b.getType());if(!c)return Promise.reject(`No destination URL to send the query to destination: ${b.jc()}`);const d=b.content,e=JSON.stringify(a.F.ha(d));c=N(c,xi,e);rc(c,{['X-Source-Origin']:b.origin,[Ai]:'application/json'});return Oi(a,c).then(f=>'string'===typeof f?a.F.O(JSON.parse(f)):olympe.dc.query.td.cj(d))}
723
+ function Qi(a,b){var c=Ni(a,b.jc(),b.getType());if(!c)return Promise.reject(`No destination URL to send the transaction to destination: ${b.jc()}`);const d=JSON.stringify(a.F.ha(b.content));c=N(c,xi,d);rc(c,{['X-Source-Origin']:b.origin,[Ai]:'application/json'});return Oi(a,c).then(e=>Number.parseInt(e,10))}function Ii(a,b){return'string'!==typeof b?Promise.reject('Please provide an authorization token.'):new Promise((c,d)=>{a.Z.Yg(b,(e,f)=>{e?d(e):c(f)})})}
724
724
  olympe.dc.sources.At=class{constructor(a,b,c,d,e,f){this.H=a;this.T=b;this.J=c;this.Z=d;this.aa=e;this.F=f;this.G=new Map;new olympe.D.Xb('Http service of remote data provider');this.O=new Map;this.C=new Map;this.ea=new Map([[olympe.dc.Request.C.tg,olympe.N.Zb.tg],[olympe.dc.Request.C.Tf,olympe.N.Zb.Kj],[olympe.dc.Request.C.ag,olympe.N.Zb.Kj],[olympe.dc.Request.C.rg,olympe.N.Zb.Kj],[olympe.dc.Request.C.Kn,olympe.N.Zb.Jn],[olympe.dc.Request.C.yq,olympe.N.Zb.xq],[olympe.dc.Request.C.$o,olympe.N.Zb.Zo],
725
- [olympe.dc.Request.C.Bg,olympe.N.Zb.Un],[olympe.dc.Request.C.Mg,olympe.N.Zb.TRANSACTION]])}Gc(a){var b=Oi(this,a.jc(),a.getType());if(!b)return Promise.reject(`No destination URL to send the status request to destination: ${a.jc()}`);b=N(b,xi);rc(b,{['X-Source-Origin']:a.origin});return Pi(this,b)}uploadFileContent(a){const {tag:b,model:c,content:d}=a.content,e=a.jc(),f=Oi(this,e,a.getType());if(!f)return Promise.reject(`No destination URL to upload the file. ${b}`);const g=N(e===olympe.dc.Ra.SERVER?
726
- `${f}/${b}`:`${f}?tag=${b}&model=${c}`,Ai,d);rc(g,{[Bi]:'application/octet-stream'});e!==olympe.dc.Ra.SERVER&&rc(g,{['X-Source-Origin']:a.origin});return Pi(this,g).then(()=>(new URL(g.C())).pathname)}deleteFileContent(a){const {tag:b,model:c}=a.content,d=a.jc();var e=Oi(this,d,a.getType());if(!e)return Promise.reject(`No destination URL to delete the file. ${b}`);e=N(d===olympe.dc.Ra.SERVER?`${e}/${b}`:`${e}?tag=${b}&model=${c}`,zi,b);d!==olympe.dc.Ra.SERVER&&rc(e,{['X-Source-Origin']:a.origin});
727
- return Pi(this,e).then()}downloadFileContent(a){const {tag:b,model:c}=a.content,d=a.jc();var e=Oi(this,d,a.getType());if(!e)return Promise.reject(Error(`No destination URL to download the file. ${b}`));var f;const g=null!=(f=this.C.get(b))?f:[];f=new Promise((h,k)=>{g.push({done:h,Th:k})});if(this.C.has(b))return f;this.C.set(b,g);e=N(d===olympe.dc.Ra.SERVER?`${e}/${b}`:`${e}?tag=${b}&model=${c}`,xi,b,olympe.net.Aa.ResponseType.Ti);d!==olympe.dc.Ra.SERVER&&rc(e,{['X-Source-Origin']:a.origin});Pi(this,
728
- e).then(h=>{const k=h instanceof ArrayBuffer?new Uint8Array(h,0,h.byteLength):h;let l;null==(l=this.C.get(b))||l.forEach(n=>n.done(k))}).catch(h=>{let k;null==(k=this.C.get(b))||k.forEach(l=>l.Th(`${h}`))}).finally(()=>{this.C.delete(b)});return f}};olympe.dc.sources.qp=class{constructor(a,b){this.H=a;this.Wb=b}};olympe.dc.sources.qp.Yb={Ni:0,NB:1,OB:3,jB:4};const Si=olympe.dc.Request.C.Gb,Ti=olympe.dc.Request.C.Bg,Ui=olympe.dc.Request.C.$j,Vi=olympe.dc.Request.C.ag,Wi=olympe.dc.Request.C.Tf,Xi=olympe.dc.Request.C.rg,Yi=olympe.dc.Request.C.ii,Zi=olympe.dc.Request.C.fh,$i=olympe.dc.Request.C.Ue,aj=olympe.dc.Request.C.Mg;
729
- function bj(a,b){const c=b.U();null===a.F&&(a.F=new olympe.Y.Hh(6E4),Za(a.F,(f,g)=>{a.applyTransaction(g,!1).catch(h=>{a.H.error(`Error occurred when applying burst transaction ${f} to the data source: ${h}`)})}),$a(a.F,()=>{a.F=null}));let d;const e=null!=(d=a.F.get(c))?d:new olympe.dc.db.tc(c);b.Jc(e);Xa(a.F.C,c)||a.F.set(c,e)}
730
- function cj(a,b){const c=b.U();let d,e;const f=null!=(e=null==(d=a.F)?void 0:d.get(c))?e:new olympe.dc.db.tc(c);let g;null==(g=a.F)||g.delete(c);b.Jc(f);return a.applyTransaction(f,!1).catch(h=>{a.H.error(`Error occurred when applying burst transaction ${c} to the data source: ${h}`)})}function dj(a,b){const c=rxjs.defer(()=>a.C.executeQuery(b));return 0<a.T?rxjs.interval(a.T).pipe(rxjs.operators.switchMap(()=>c)):c}
731
- olympe.dc.sources.Dp=class{constructor(a,b){this.H=a;this.C=b;this.Wb=null;this.O=olympe.dc.query.Ek();this.J=olympe.dc.Jr();this.G=new olympe.D.Xb('Context of source '+this.U());let c;this.T=null!=(c=b.Df(olympe.dc.sources.V.Zl))?c:-1;this.F=null}U(){return this.C.U()}init(a){this.Wb=a;if(this.U()===olympe.dc.Ra.SELF)return this;(new Promise((b,c)=>{let d=!0;ej(this.C,this.G).subscribe(rxjs.Subscriber.create(e=>{if(this.H.C()){this.H.debug(`Data source ${this.C.name()} has loaded ${e.size()} data types in its cache:`);
732
- for(const [f,g]of e)this.H.debug(`=> DataType: ${g.name()} (${f})`)}d&&(d=!1,b())},c))})).then(()=>this.C.init(this.G)).catch(b=>{this.H.error(`Error while initialization of DataSource ${this.C.name()} (${this.U()}): ${b}`)});return this}healthCheck(){return this.C.healthCheck().then(()=>`Data source ${this.C.name()} (${this.C.U()}) OK`)}destroy(){this.G.destroy();return this.C.destroy()}request(a){const b=a.content;var c=a.getType();switch(c){case Si:const d=olympe.dm.DataSource.Gb.xb,e=olympe.dm.DataSource.Gb.Dh;
733
- return this.C.healthCheck().then(()=>({s:e})).catch(g=>({s:d,r:String(g)}));case Ti:return this.C.executeQuery(b);case Yi:return c=b.qc(),bj(this,c),this.J.xc(hf(c)),Promise.resolve();case $i:case aj:const f=b.qc();return this.applyTransaction(f,c===aj).finally(()=>{if(a.origin===olympe.dc.Ra.SELF){var g=f.U();g=mf(new olympe.dc.Request(olympe.dc.Request.C.Lj,olympe.dc.Ra.SELF,{id:g,finalize:olympe.dc.transaction.vf.C.Fi,error:null}),this.U());let h;null==(h=this.Wb)||h.qd(g)}});case Zi:return cj(this,
734
- b.qc());case Vi:return b.content instanceof Uint8Array?this.C.uploadFileContent(b.tag,b.model,b.content).then(()=>`datasource://${b.tag}`):Promise.reject('File content is undefined');case Wi:return this.C.downloadFileContent(b.tag,b.model);case Xi:return this.C.deleteFileContent(b.tag,b.model);default:return Promise.reject(`Request of type ${a.getType()} is not supported by the data source`)}}subscribe(a){if(a.getType()===Ui){const b=a.content;a=a.origin;return a===olympe.dc.Ra.SELF?dj(this,b):Th(this.O,
735
- b,this.G,a,olympe.dc.pa.Zc.Qf,{}).pipe(rxjs.operators.map(c=>{let d,e;return null!=(e=null==(d=c.Ge)?void 0:d.G)?e:null}),rxjs.operators.filter(c=>null!==c),rxjs.operators.map(c=>hf(c,Date.now())))}return rxjs.throwError(()=>Error('Subscription request not supported'))}applyTransaction(a,b){const c=this;return v(function*(){var d=fj(a);yield c.C.applyTransaction(d,{batch:b});d=Date.now();yield bi(c.O,c.U(),a);c.J.xc(hf(a,d));return d})}};olympe.dc.sources.Dp.ya=[olympe.dc.sources.Hj];function fj(a){const b=olympe.dc.sources.Zf.C.Ys,c=olympe.dc.sources.Zf.C.Uv,d=olympe.dc.sources.Zf.C.et,e=olympe.dc.sources.Zf.C.Zs,f=olympe.dc.sources.Zf.C.ft,g=[],h=[],k=[],l=[],n=[];a.C.forEach((p,q)=>{const r=p.Vb();p.F()?g.push(gj(b,q,r,p.T()?p.Cb():null)):p.zd()?k.push(gj(d,q,r,null,p.J())):p.T()&&h.push(gj(c,q,r,p.Cb()));for(const [t,u,x]of p.yd())p=a.Lc(u),x?l.push(new hj(e,t,q,u,r,p.Vb())):n.push(new hj(f,t,q,u,r,p.Vb()))});return n.concat(k,g,h,l)}
736
- function gj(a,b,c,d,e){if('string'!==typeof c)throw Error(`Patch: model of instance ${b} is missing. It is invalid transaction.`);return new ij(a,b,c,d,e)}olympe.dc.sources.Zf=class{constructor(a){this.type=a}};class ij extends olympe.dc.sources.Zf{constructor(a,b,c,d,e){super(a);this.object=b;this.model=c;this.properties=null!=d?d:null;this.deleteRules=null!=e?e:olympe.dc.Nb.NONE}}
737
- class hj extends olympe.dc.sources.Zf{constructor(a,b,c,d,e,f){super(a);this.relation=b;this.from=c;this.to=d;this.fromModel=e;this.toModel=f}}olympe.dc.sources.Zf.C={Ys:'CREATE',Uv:'UPDATE',et:'DELETE',Zs:'CREATE_RELATION',ft:'DELETE_RELATION'};function jj(a,b){b=mf(new olympe.dc.Request(olympe.dc.Request.C.Lj,olympe.dc.Ra.SELF,{id:b,finalize:olympe.dc.transaction.vf.C.Fi,error:null}),a.U());let c;null==(c=a.Wb)||c.qd(b)}
738
- olympe.dc.sources.gl=class{constructor(a,b){this.H=a;this.F=b;this.Wb=null}U(){}T(){}Z(){}init(a){this.Wb=a;return this}destroy(){return Promise.resolve()}request(a){const b=this;return v(function*(){if(!b.F.F)return b.T(a);var c=olympe.dc.Request.C.Gb,d=olympe.dc.Request.C.Bg;const e=olympe.dc.Request.C.Ue,f=olympe.dc.Request.C.Mg;var g=olympe.dc.Request.C.ii;const h=olympe.dc.Request.C.fh,k=olympe.dc.Request.C.ag;var l=olympe.dc.Request.C.Tf;const n=olympe.dc.Request.C.rg,p=olympe.dc.sources.Xd(),
739
- q=a.getType();var r=a.jc();if(ad(b.F)){q===d&&(c=a.content,(g=of(a).get(olympe.dc.pa.C.bl))&&(yield kj(p,c.U(),g)),b.H.debug(`Data Provider: Query ${c.U()} will be executed with its default Remote or Server provider`));if(q===l&&(l=a.content,'string'===typeof(null==l?void 0:l.url)&&l.url.startsWith('offline://')))return p.downloadFileContent(l.tag);l=yield b.T(a);if(q===d)d=a.content,yield lj(p,d.U(),r,l.qc(),!0),b.H.C()&&b.H.debug(`Data Provider: Data result for query ${d.U()}`,l.qc().C.size,'instances',
740
- Array.from(l.qc().yd()).length,'relations');else if(q===e||q===f||q===h)b.H.debug('Data Provider: Persisting graph patch in offline cache after successful transaction'),yield lj(p,null,r,a.content.qc(),!1);return l}b.H.debug(`Data Provider: Request (type: ${q}) will be sent to the cache data provider: ${a.content}`);switch(q){case c:return{s:olympe.dm.DataSource.Gb.ee};case d:return p.executeQuery(a.content);case e:case f:case h:d=a.content;const t=d.qc().U();return p.applyTransaction(d,r).finally(()=>
741
- jj(b,t));case g:return Promise.resolve();case k:return r=a.content,p.uploadFileContent(r.tag,r.content,r.mimeType);case l:return p.downloadFileContent(a.content.tag);case n:return p.deleteFileContent(a.content.tag);default:return Promise.reject(`Messages of type ${a.getType()} is not supported by the source ${b.U()}`)}})}subscribe(a,b){if(!this.F.F)return this.Z(a,b);const c=olympe.dc.sources.Xd(),d=a.content,e=a.jc();return rxjs.of(null).pipe(rxjs.operators.switchMap(()=>{if(ad(this.F)){const f=
742
- new rxjs.Observable(h=>{olympe.D.js([this.F.Kf()],()=>{h.error(new olympe.N.errors.cp('Go Offline',d.U()))})}),g=this.Z(a,b);return rxjs.merge(f,g)}return new rxjs.Observable(f=>{olympe.D.js([this.F.Kf()],()=>{f.error(new olympe.N.errors.Sn('Back Online',d.U()))})})})).pipe(rxjs.operators.switchMap(f=>rxjs.from(lj(c,d.U(),e,f.qc()).then(()=>f).catch(g=>{this.H.error(`Data Provider: Cache database failed to handle the data result with message: ${g}`);throw g;}))))}};olympe.dc.sources.gl.ya=[olympe.dc.sources.Hj];const mj=olympe.dc.Request.C.Gb,nj=olympe.dc.Request.C.Bg,oj=olympe.dc.Request.C.$j,pj=olympe.dc.Request.C.Ue,qj=olympe.dc.Request.C.Mg,rj=olympe.dc.Request.C.ii,sj=olympe.dc.Request.C.fh,tj=olympe.dc.Request.C.ag,uj=olympe.dc.Request.C.Tf,vj=olympe.dc.Request.C.rg;function wj(a,b){let c;return(null==(c=a.ja.tb(b))?void 0:c.Df(olympe.dc.sources.V.Ke))!==olympe.dm.DataSource.Ke.fp}function xj(a,b){let c;return(null==(c=a.ja.tb(b))?void 0:c.Df(olympe.dc.sources.V.Ke))!==olympe.dm.DataSource.Ke.Nn}
743
- function yj(a,b){b=b.Bc();if(b!==olympe.dm.User.C&&a.Df(olympe.dc.sources.V.hm))throw a=`User ${b} has no right to access the restricted data source ${a.name()} (${a.U()}). Please use an admin account instead.`,new olympe.dc.sources.Gq(a);}
744
- function zj(a,b,c,d,e){return v(function*(){var f=olympe.N.cb.C.SEND,g=olympe.N.cb.C.GET;const h=olympe.N.cb.C.PUBLISH,k=olympe.N.cb.C.SUBSCRIBE,l=d.ks();var n=d.body();if(e!==n.Bc())throw Error('Access denied: try to impersonate a user');yj(c,n);let p;if(null==(p=a.Wb)||!p.sources.has(n.jc()))throw Error(`Try to process a message with destination data source ${n.jc()} coming from remote but not started here`);if(l===k){if(n.getType()===oj)f=n.content.U();else throw Error('Not supported type of subscription');
745
- g=yield d.en(f);a.aa.set(g,f);g=a.O.get(f);g||(g=new Aj(a.H,f,b,mf(n,olympe.dc.Ra.sf)),a.O.set(f,g));g.subscribe()}else l===g?(n=yield b.request(n),void 0!==n?yield d.qd(n):a.H.warn(`Request from ${d.source()} requires an output value, but got undefined instead.`)):l===f?(yield b.request(n),yield d.ur()):l===h&&(yield b.request(n))})}
746
- olympe.dc.sources.Fq=class extends olympe.dc.sources.gl{constructor(a,b,c,d,e,f){super(a,d);this.J=b;this.C=c;this.db=e;this.G=new olympe.D.Xb('Remote Provider Context');this.ea=new Map;this.O=new Map;this.aa=new Map;this.ja=f}U(){return olympe.dc.Ra.sf}T(a){var b=olympe.N.wb;const c=a.jc(),d=a.getType();this.H.C()&&this.H.debug(`Request (type: ${d}) will be sent to remote data provider ${c}: ${a.content}`);switch(d){case mj:const e=olympe.dm.DataSource.Gb.xb,f=olympe.dm.DataSource.Gb.Dh;b=wj(this,
747
- c)?b.get(c,a):Promise.resolve({s:f});a=xj(this,c)?this.C.Gc(a):Promise.resolve({s:f});return Promise.all([b,a]).then(([k,l])=>{if((null==k?void 0:k.s)===e||(null==l?void 0:l.s)===e){let n,p;return{s:e,r:`${null!=(n=null==k?void 0:k.r)?n:''} ${null!=(p=null==l?void 0:l.r)?p:''}`}}return{s:f}});case nj:return xj(this,c)?Qi(this.C,a):b.get(c,a);case pj:const g=a.content.qc().U();return(wj(this,c)?b.get(c,a):Ri(this.C,a)).finally(()=>jj(this,g));case qj:const h=a.content.qc().U();return(xj(this,c)?Ri(this.C,
748
- a):b.get(c,a)).finally(()=>jj(this,h));case rj:return wj(this,c)?b.publish(c,a).catch(k=>{this.H.error(`An error occurred while sending "burst transaction" to the data source ${c}: ${k}`)}):Promise.resolve();case sj:return wj(this,c)?b.get(c,a):Ri(this.C,a);case tj:return xj(this,c)?this.C.uploadFileContent(a):b.get(c,a);case uj:return xj(this,c)?this.C.downloadFileContent(a):b.get(c,a);case vj:return xj(this,c)?this.C.deleteFileContent(a):b.send(c,a);default:return Promise.reject(`Messages of type ${a.getType()} is not supported by the source ${this.U()}`)}}Z(a,
749
- b){const c=a.jc(),d=a.getType();if(!wj(this,c))return rxjs.throwError(()=>Error(`Subscription request not supported for data source ${this.db.name(c)} (${c}) which uses HTTP only.`));this.H.C()&&this.H.debug(`Subscription (type: ${d}) will be sent to remote data provider ${c}: ${a.content}`);return d===oj?olympe.N.wb.observe(c,this.G,a,{onRetry:b}):rxjs.throwError(()=>Error(`Do not handle subscription request of type ${d}`))}init(a){super.init(a);if(a.G)return this;olympe.dc.pa.from(this.J,this.J).hb(olympe.dm.DataSource.nj).filter(olympe.dc.query.Ba.Fa(olympe.dm.DataSource.Oh,
750
- !0)).filter(olympe.dc.query.Ba.Fa(olympe.dm.DataSource.Fr,!0)).observe(this.G).subscribe(b=>{rf(b).forEach(this.Ga.bind(this,a));qf(b).forEach(c=>{let d;null==(d=this.ea.get(c))||d.destroy();this.ea.delete(c)})});this.db.Sa(this.J,olympe.dm.DataSource.Fr)&&(new olympe.N.wb(this.J,this.G)).listen().subscribe(b=>{b=b.body();b instanceof olympe.dc.Request?a.qd(b):this.H.error('Self source received something else than a data request, ignore it.')});return this}destroy(){return v(function*(){})}Ga(a,b){const c=
751
- b.X(),d=new olympe.D.Xb(`Published data provider context ${c}`,this.G);this.ea.set(c,d);let e,f;Bj(b,d).subscribe(g=>{let h;null==(h=e)||h();let k;null==(k=f)||k.stop();g!==olympe.dm.DataSource.Ke.Nn&&(e=Li(this.C,c,l=>{yj(b,l);return a.request(l)}),d.onDestroy(()=>{let l;return null==(l=e)?void 0:l()}));g!==olympe.dm.DataSource.Ke.fp&&(g=new olympe.D.Xb(`Bus Service of data source ${c}`,d),f=(new olympe.N.wb(c,g)).qs(this.ua.bind(this)),f.listen().subscribe(l=>{l.ei().then(n=>zj(this,a,b,l,n)).catch(n=>
725
+ [olympe.dc.Request.C.Bg,olympe.N.Zb.Un],[olympe.dc.Request.C.Mg,olympe.N.Zb.TRANSACTION]])}Gc(a){var b=Ni(this,a.jc(),a.getType());if(!b)return Promise.reject(`No destination URL to send the status request to destination: ${a.jc()}`);b=N(b,wi);rc(b,{['X-Source-Origin']:a.origin});return Oi(this,b)}uploadFileContent(a){const {tag:b,model:c,content:d}=a.content,e=a.jc(),f=Ni(this,e,a.getType());if(!f)return Promise.reject(`No destination URL to upload the file. ${b}`);const g=N(e===olympe.dc.Sa.SERVER?
726
+ `${f}/${b}`:`${f}?tag=${b}&model=${c}`,zi,d);rc(g,{[Ai]:'application/octet-stream'});e!==olympe.dc.Sa.SERVER&&rc(g,{['X-Source-Origin']:a.origin});return Oi(this,g).then(()=>(new URL(g.C())).pathname)}deleteFileContent(a){const {tag:b,model:c}=a.content,d=a.jc();var e=Ni(this,d,a.getType());if(!e)return Promise.reject(`No destination URL to delete the file. ${b}`);e=N(d===olympe.dc.Sa.SERVER?`${e}/${b}`:`${e}?tag=${b}&model=${c}`,yi,b);d!==olympe.dc.Sa.SERVER&&rc(e,{['X-Source-Origin']:a.origin});
727
+ return Oi(this,e).then()}downloadFileContent(a){const {tag:b,model:c}=a.content,d=a.jc();var e=Ni(this,d,a.getType());if(!e)return Promise.reject(Error(`No destination URL to download the file. ${b}`));var f;const g=null!=(f=this.C.get(b))?f:[];f=new Promise((h,k)=>{g.push({done:h,Th:k})});if(this.C.has(b))return f;this.C.set(b,g);e=N(d===olympe.dc.Sa.SERVER?`${e}/${b}`:`${e}?tag=${b}&model=${c}`,wi,b,olympe.net.Aa.ResponseType.Ti);d!==olympe.dc.Sa.SERVER&&rc(e,{['X-Source-Origin']:a.origin});Oi(this,
728
+ e).then(h=>{const k=h instanceof ArrayBuffer?new Uint8Array(h,0,h.byteLength):h;let l;null==(l=this.C.get(b))||l.forEach(n=>n.done(k))}).catch(h=>{let k;null==(k=this.C.get(b))||k.forEach(l=>l.Th(`${h}`))}).finally(()=>{this.C.delete(b)});return f}};olympe.dc.sources.qp=class{constructor(a,b){this.H=a;this.Wb=b}};olympe.dc.sources.qp.Yb={Ni:0,NB:1,OB:3,jB:4};const Ri=olympe.dc.Request.C.Hb,Si=olympe.dc.Request.C.Bg,Ti=olympe.dc.Request.C.$j,Ui=olympe.dc.Request.C.ag,Vi=olympe.dc.Request.C.Tf,Wi=olympe.dc.Request.C.rg,Xi=olympe.dc.Request.C.ii,Yi=olympe.dc.Request.C.fh,Zi=olympe.dc.Request.C.Ue,$i=olympe.dc.Request.C.Mg;
729
+ function aj(a,b){const c=b.U();null===a.F&&(a.F=new olympe.Y.Hh(6E4),Za(a.F,(f,g)=>{a.applyTransaction(g,!1).catch(h=>{a.H.error(`Error occurred when applying burst transaction ${f} to the data source: ${h}`)})}),$a(a.F,()=>{a.F=null}));let d;const e=null!=(d=a.F.get(c))?d:new olympe.dc.db.tc(c);b.Jc(e);Xa(a.F.C,c)||a.F.set(c,e)}
730
+ function bj(a,b){const c=b.U();let d,e;const f=null!=(e=null==(d=a.F)?void 0:d.get(c))?e:new olympe.dc.db.tc(c);let g;null==(g=a.F)||g.delete(c);b.Jc(f);return a.applyTransaction(f,!1).catch(h=>{a.H.error(`Error occurred when applying burst transaction ${c} to the data source: ${h}`)})}function cj(a,b){const c=rxjs.defer(()=>a.C.executeQuery(b));return 0<a.T?rxjs.interval(a.T).pipe(rxjs.operators.switchMap(()=>c)):c}
731
+ olympe.dc.sources.Dp=class{constructor(a,b){this.H=a;this.C=b;this.Wb=null;this.O=olympe.dc.query.Ek();this.J=olympe.dc.Jr();this.G=new olympe.D.Xb('Context of source '+this.U());let c;this.T=null!=(c=b.Df(olympe.dc.sources.V.Zl))?c:-1;this.F=null}U(){return this.C.U()}init(a){this.Wb=a;if(this.U()===olympe.dc.Sa.SELF)return this;(new Promise((b,c)=>{let d=!0;dj(this.C,this.G).subscribe(rxjs.Subscriber.create(e=>{if(this.H.C()){this.H.debug(`Data source ${this.C.name()} has loaded ${e.size()} data types in its cache:`);
732
+ for(const [f,g]of e)this.H.debug(`=> DataType: ${g.name()} (${f})`)}d&&(d=!1,b())},c))})).then(()=>this.C.init(this.G)).catch(b=>{this.H.error(`Error while initialization of DataSource ${this.C.name()} (${this.U()}): ${b}`)});return this}healthCheck(){return this.C.healthCheck().then(()=>`Data source ${this.C.name()} (${this.C.U()}) OK`)}destroy(){this.G.destroy();return this.C.destroy()}request(a){const b=a.content;var c=a.getType();switch(c){case Ri:const d=olympe.dm.DataSource.Hb.xb,e=olympe.dm.DataSource.Hb.Dh;
733
+ return this.C.healthCheck().then(()=>({s:e})).catch(g=>({s:d,r:String(g)}));case Si:return this.C.executeQuery(b);case Xi:return c=b.qc(),aj(this,c),this.J.xc(hf(c)),Promise.resolve();case Zi:case $i:const f=b.qc();return this.applyTransaction(f,c===$i).finally(()=>{if(a.origin===olympe.dc.Sa.SELF){var g=f.U();g=mf(new olympe.dc.Request(olympe.dc.Request.C.Lj,olympe.dc.Sa.SELF,{id:g,finalize:olympe.dc.transaction.vf.C.Fi,error:null}),this.U());let h;null==(h=this.Wb)||h.qd(g)}});case Yi:return bj(this,
734
+ b.qc());case Ui:return b.content instanceof Uint8Array?this.C.uploadFileContent(b.tag,b.model,b.content).then(()=>`datasource://${b.tag}`):Promise.reject('File content is undefined');case Vi:return this.C.downloadFileContent(b.tag,b.model);case Wi:return this.C.deleteFileContent(b.tag,b.model);default:return Promise.reject(`Request of type ${a.getType()} is not supported by the data source`)}}subscribe(a){if(a.getType()===Ti){const b=a.content;a=a.origin;return a===olympe.dc.Sa.SELF?cj(this,b):Th(this.O,
735
+ b,this.G,a,olympe.dc.pa.Zc.Qf,{}).pipe(rxjs.operators.map(c=>{let d,e;return null!=(e=null==(d=c.Ge)?void 0:d.G)?e:null}),rxjs.operators.filter(c=>null!==c),rxjs.operators.map(c=>hf(c,Date.now())))}return rxjs.throwError(()=>Error('Subscription request not supported'))}applyTransaction(a,b){const c=this;return v(function*(){var d=ej(a);yield c.C.applyTransaction(d,{batch:b});d=Date.now();yield bi(c.O,c.U(),a);c.J.xc(hf(a,d));return d})}};olympe.dc.sources.Dp.ya=[olympe.dc.sources.Hj];function ej(a){const b=olympe.dc.sources.Zf.C.Ys,c=olympe.dc.sources.Zf.C.Uv,d=olympe.dc.sources.Zf.C.et,e=olympe.dc.sources.Zf.C.Zs,f=olympe.dc.sources.Zf.C.ft,g=[],h=[],k=[],l=[],n=[];a.C.forEach((p,q)=>{const r=p.Vb();p.F()?g.push(fj(b,q,r,p.T()?p.Cb():null)):p.zd()?k.push(fj(d,q,r,null,p.J())):p.T()&&h.push(fj(c,q,r,p.Cb()));for(const [t,u,x]of p.yd())p=a.Lc(u),x?l.push(new gj(e,t,q,u,r,p.Vb())):n.push(new gj(f,t,q,u,r,p.Vb()))});return n.concat(k,g,h,l)}
736
+ function fj(a,b,c,d,e){if('string'!==typeof c)throw Error(`Patch: model of instance ${b} is missing. It is invalid transaction.`);return new hj(a,b,c,d,e)}olympe.dc.sources.Zf=class{constructor(a){this.type=a}};class hj extends olympe.dc.sources.Zf{constructor(a,b,c,d,e){super(a);this.object=b;this.model=c;this.properties=null!=d?d:null;this.deleteRules=null!=e?e:olympe.dc.Nb.NONE}}
737
+ class gj extends olympe.dc.sources.Zf{constructor(a,b,c,d,e,f){super(a);this.relation=b;this.from=c;this.to=d;this.fromModel=e;this.toModel=f}}olympe.dc.sources.Zf.C={Ys:'CREATE',Uv:'UPDATE',et:'DELETE',Zs:'CREATE_RELATION',ft:'DELETE_RELATION'};function ij(a,b){b=mf(new olympe.dc.Request(olympe.dc.Request.C.Lj,olympe.dc.Sa.SELF,{id:b,finalize:olympe.dc.transaction.vf.C.Fi,error:null}),a.U());let c;null==(c=a.Wb)||c.qd(b)}
738
+ olympe.dc.sources.gl=class{constructor(a,b){this.H=a;this.F=b;this.Wb=null}U(){}T(){}Z(){}init(a){this.Wb=a;return this}destroy(){return Promise.resolve()}request(a){const b=this;return v(function*(){if(!b.F.F)return b.T(a);var c=olympe.dc.Request.C.Hb,d=olympe.dc.Request.C.Bg;const e=olympe.dc.Request.C.Ue,f=olympe.dc.Request.C.Mg;var g=olympe.dc.Request.C.ii;const h=olympe.dc.Request.C.fh,k=olympe.dc.Request.C.ag;var l=olympe.dc.Request.C.Tf;const n=olympe.dc.Request.C.rg,p=olympe.dc.sources.Xd(),
739
+ q=a.getType();var r=a.jc();if(ad(b.F)){q===d&&(c=a.content,(g=of(a).get(olympe.dc.pa.C.bl))&&(yield jj(p,c.U(),g)),b.H.debug(`Data Provider: Query ${c.U()} will be executed with its default Remote or Server provider`));if(q===l&&(l=a.content,'string'===typeof(null==l?void 0:l.url)&&l.url.startsWith('offline://')))return p.downloadFileContent(l.tag);l=yield b.T(a);if(q===d)d=a.content,yield kj(p,d.U(),r,l.qc(),!0),b.H.C()&&b.H.debug(`Data Provider: Data result for query ${d.U()}`,l.qc().C.size,'instances',
740
+ Array.from(l.qc().yd()).length,'relations');else if(q===e||q===f||q===h)b.H.debug('Data Provider: Persisting graph patch in offline cache after successful transaction'),yield kj(p,null,r,a.content.qc(),!1);return l}b.H.debug(`Data Provider: Request (type: ${q}) will be sent to the cache data provider: ${a.content}`);switch(q){case c:return{s:olympe.dm.DataSource.Hb.ee};case d:return p.executeQuery(a.content);case e:case f:case h:d=a.content;const t=d.qc().U();return p.applyTransaction(d,r).finally(()=>
741
+ ij(b,t));case g:return Promise.resolve();case k:return r=a.content,p.uploadFileContent(r.tag,r.content,r.mimeType);case l:return p.downloadFileContent(a.content.tag);case n:return p.deleteFileContent(a.content.tag);default:return Promise.reject(`Messages of type ${a.getType()} is not supported by the source ${b.U()}`)}})}subscribe(a,b){if(!this.F.F)return this.Z(a,b);const c=olympe.dc.sources.Xd(),d=a.content,e=a.jc();return rxjs.of(null).pipe(rxjs.operators.switchMap(()=>{if(ad(this.F)){const f=
742
+ new rxjs.Observable(h=>{olympe.D.js([this.F.Kf()],()=>{h.error(new olympe.N.errors.cp('Go Offline',d.U()))})}),g=this.Z(a,b);return rxjs.merge(f,g)}return new rxjs.Observable(f=>{olympe.D.js([this.F.Kf()],()=>{f.error(new olympe.N.errors.Sn('Back Online',d.U()))})})})).pipe(rxjs.operators.switchMap(f=>rxjs.from(kj(c,d.U(),e,f.qc()).then(()=>f).catch(g=>{this.H.error(`Data Provider: Cache database failed to handle the data result with message: ${g}`);throw g;}))))}};olympe.dc.sources.gl.ya=[olympe.dc.sources.Hj];const lj=olympe.dc.Request.C.Hb,mj=olympe.dc.Request.C.Bg,nj=olympe.dc.Request.C.$j,oj=olympe.dc.Request.C.Ue,pj=olympe.dc.Request.C.Mg,qj=olympe.dc.Request.C.ii,rj=olympe.dc.Request.C.fh,sj=olympe.dc.Request.C.ag,tj=olympe.dc.Request.C.Tf,uj=olympe.dc.Request.C.rg;function vj(a,b){let c;return(null==(c=a.ja.tb(b))?void 0:c.Df(olympe.dc.sources.V.Ke))!==olympe.dm.DataSource.Ke.fp}function wj(a,b){let c;return(null==(c=a.ja.tb(b))?void 0:c.Df(olympe.dc.sources.V.Ke))!==olympe.dm.DataSource.Ke.Nn}
743
+ function xj(a,b){b=b.Bc();if(b!==olympe.dm.User.C&&a.Df(olympe.dc.sources.V.hm))throw a=`User ${b} has no right to access the restricted data source ${a.name()} (${a.U()}). Please use an admin account instead.`,new olympe.dc.sources.Gq(a);}
744
+ function yj(a,b,c,d,e){return v(function*(){var f=olympe.N.eb.C.SEND,g=olympe.N.eb.C.GET;const h=olympe.N.eb.C.PUBLISH,k=olympe.N.eb.C.SUBSCRIBE,l=d.ks();var n=d.body();if(e!==n.Bc())throw Error('Access denied: try to impersonate a user');xj(c,n);let p;if(null==(p=a.Wb)||!p.sources.has(n.jc()))throw Error(`Try to process a message with destination data source ${n.jc()} coming from remote but not started here`);if(l===k){if(n.getType()===nj)f=n.content.U();else throw Error('Not supported type of subscription');
745
+ g=yield d.en(f);a.aa.set(g,f);g=a.O.get(f);g||(g=new zj(a.H,f,b,mf(n,olympe.dc.Sa.sf)),a.O.set(f,g));g.subscribe()}else l===g?(n=yield b.request(n),void 0!==n?yield d.qd(n):a.H.warn(`Request from ${d.source()} requires an output value, but got undefined instead.`)):l===f?(yield b.request(n),yield d.ur()):l===h&&(yield b.request(n))})}
746
+ olympe.dc.sources.Fq=class extends olympe.dc.sources.gl{constructor(a,b,c,d,e,f){super(a,d);this.J=b;this.C=c;this.db=e;this.G=new olympe.D.Xb('Remote Provider Context');this.ea=new Map;this.O=new Map;this.aa=new Map;this.ja=f}U(){return olympe.dc.Sa.sf}T(a){var b=olympe.N.wb;const c=a.jc(),d=a.getType();this.H.C()&&this.H.debug(`Request (type: ${d}) will be sent to remote data provider ${c}: ${a.content}`);switch(d){case lj:const e=olympe.dm.DataSource.Hb.xb,f=olympe.dm.DataSource.Hb.Dh;b=vj(this,
747
+ c)?b.get(c,a):Promise.resolve({s:f});a=wj(this,c)?this.C.Gc(a):Promise.resolve({s:f});return Promise.all([b,a]).then(([k,l])=>{if((null==k?void 0:k.s)===e||(null==l?void 0:l.s)===e){let n,p;return{s:e,r:`${null!=(n=null==k?void 0:k.r)?n:''} ${null!=(p=null==l?void 0:l.r)?p:''}`}}return{s:f}});case mj:return wj(this,c)?Pi(this.C,a):b.get(c,a);case oj:const g=a.content.qc().U();return(vj(this,c)?b.get(c,a):Qi(this.C,a)).finally(()=>ij(this,g));case pj:const h=a.content.qc().U();return(wj(this,c)?Qi(this.C,
748
+ a):b.get(c,a)).finally(()=>ij(this,h));case qj:return vj(this,c)?b.publish(c,a).catch(k=>{this.H.error(`An error occurred while sending "burst transaction" to the data source ${c}: ${k}`)}):Promise.resolve();case rj:return vj(this,c)?b.get(c,a):Qi(this.C,a);case sj:return wj(this,c)?this.C.uploadFileContent(a):b.get(c,a);case tj:return wj(this,c)?this.C.downloadFileContent(a):b.get(c,a);case uj:return wj(this,c)?this.C.deleteFileContent(a):b.send(c,a);default:return Promise.reject(`Messages of type ${a.getType()} is not supported by the source ${this.U()}`)}}Z(a,
749
+ b){const c=a.jc(),d=a.getType();if(!vj(this,c))return rxjs.throwError(()=>Error(`Subscription request not supported for data source ${this.db.name(c)} (${c}) which uses HTTP only.`));this.H.C()&&this.H.debug(`Subscription (type: ${d}) will be sent to remote data provider ${c}: ${a.content}`);return d===nj?olympe.N.wb.observe(c,this.G,a,{onRetry:b}):rxjs.throwError(()=>Error(`Do not handle subscription request of type ${d}`))}init(a){super.init(a);if(a.G)return this;olympe.dc.pa.from(this.J,this.J).ib(olympe.dm.DataSource.nj).filter(olympe.dc.query.Ba.Fa(olympe.dm.DataSource.Oh,
750
+ !0)).filter(olympe.dc.query.Ba.Fa(olympe.dm.DataSource.Fr,!0)).observe(this.G).subscribe(b=>{rf(b).forEach(this.Ga.bind(this,a));qf(b).forEach(c=>{let d;null==(d=this.ea.get(c))||d.destroy();this.ea.delete(c)})});this.db.Oa(this.J,olympe.dm.DataSource.Fr)&&(new olympe.N.wb(this.J,this.G)).listen().subscribe(b=>{b=b.body();b instanceof olympe.dc.Request?a.qd(b):this.H.error('Self source received something else than a data request, ignore it.')});return this}destroy(){return v(function*(){})}Ga(a,b){const c=
751
+ b.X(),d=new olympe.D.Xb(`Published data provider context ${c}`,this.G);this.ea.set(c,d);let e,f;Aj(b,d).subscribe(g=>{let h;null==(h=e)||h();let k;null==(k=f)||k.stop();g!==olympe.dm.DataSource.Ke.Nn&&(e=Ki(this.C,c,l=>{xj(b,l);return a.request(l)}),d.onDestroy(()=>{let l;return null==(l=e)?void 0:l()}));g!==olympe.dm.DataSource.Ke.fp&&(g=new olympe.D.Xb(`Bus Service of data source ${c}`,d),f=(new olympe.N.wb(c,g)).qs(this.ua.bind(this)),f.listen().subscribe(l=>{l.ei().then(n=>yj(this,a,b,l,n)).catch(n=>
752
752
  {this.H.warn(`Error occurred while processing request from ${l.source()}: ${n}`);return l.Th(n instanceof Error?n:Error(n))})}))})}ua(a){const b=this.aa.get(a);this.aa.delete(a);if(a=b)null==(a=this.O.get(b))?a=0:(0<a.C&&--a.C,0===a.C?(a.H.debug(`Data subscription ${a.F} has more subscriber: unsubscribe`),a.G.unsubscribe(),a=!0):(a.H.debug(`Data subscription ${a.F} has ${a.C} subscribers`),a=!1));a&&this.O.delete(b)}};
753
- class Aj{constructor(a,b,c,d){this.H=a;this.F=b;this.C=0;this.G=c.subscribe(d).subscribe({next:e=>{olympe.N.wb.publish(b,e).catch(f=>a.error(`Error occurred while publishing a data notification: ${f}`))},error:e=>a.error(`Error occurred while trying to subscribe to topic ${b} for a datasource: ${e}`)})}subscribe(){this.C++;this.H.debug(`Data subscription ${this.F} has ${this.C} subscribers`);return this}}olympe.dc.sources.Fq.ya=[olympe.dc.sources.Hj];const Y={mr:10,Yn:11,Jo:12,oq:13,QUERY_RESULT:14,ap:15,qo:16,Ue:17,pq:18,po:19,fm:20};function Cj(a,b){b=b.reduce((c,d)=>{const e=new Map(Array.from(Object.entries(d.p).map(([f,g])=>[f,a.C(g)])));c.$c(d.t,d.s,e,d.m);d.r.forEach(f=>c.Ma(f.r,d.t,f.d));return c},new olympe.dc.db.tc);a.aa.xc(hf(b))}
754
- olympe.dc.sources.fc=class extends olympe.N.fc{constructor(a){super();this.aa=a;this.db=a.view;this.G=new Map}ha(a){a=super.ha(a);if(0<this.G.size){const b=Array.from(this.G.values());this.G.clear();return Object.assign(Q(Y.mr,a),{i:b})}return a}O(a){return(null==a?void 0:a.t)===Y.mr&&Array.isArray(null==a?void 0:a.i)?(Cj(this,a.i),this.C(a.v)):this.C(a)}F(a){switch(!0){case a instanceof olympe.dm.File:var b=Y.Jo;{const c=a.X(),d={t:c};if(!this.G.has(c)&&(this.J(c),!this.db.Lf(c))){const e=a.get(olympe.dm.File.urlProp);
755
- if(e.startsWith('blob:')||e.startsWith('stream:'))a=olympe.dc.Nr().ua(a),this.G.get(c).p[olympe.dm.File.urlProp.X()]='stream://'+c,d.s=this.F(a)}a=d}return Q(b,a);case a instanceof olympe.dc.CloudObject:return Q(Y.Yn,this.J(a.X()));case a instanceof olympe.dc.pa:return Q(Y.oq,a.ha());case a instanceof olympe.dc.Qa:return Q(Y.QUERY_RESULT,a.ha(this.J.bind(this)));case a instanceof olympe.dc.db.tc:return b=new olympe.dc.transaction.qf,a.Jc(b),Q(Y.ap,{i:a.U(),p:uf(b)});case a instanceof olympe.dc.Request:return Q(Y.qo,
756
- {r:a.getType(),o:a.origin,d:a.jc(),u:a.Bc(),c:this.F(a.content)});case a instanceof olympe.dc.transaction.Ri:return Q(Y.Ue,{r:a.ah(),p:this.F(a.qc())});case a instanceof olympe.dc.query.td:return Q(Y.pq,a.ha());case a instanceof olympe.dc.kh:return Q(Y.po,a.ha());case a instanceof olympe.dc.uc:return Q(Y.fm,this.J(a.X()));default:return super.F(a)}}C(a){if(null===a||'object'!==typeof a)return super.C(a);const {t:b,v:c}=a;switch(b){case Y.Jo:var d=c.t;c.s&&(a=this.C(c.s),olympe.dc.Nr().gb(d,a));return olympe.dc.CloudObject.get(d);
753
+ class zj{constructor(a,b,c,d){this.H=a;this.F=b;this.C=0;this.G=c.subscribe(d).subscribe({next:e=>{olympe.N.wb.publish(b,e).catch(f=>a.error(`Error occurred while publishing a data notification: ${f}`))},error:e=>a.error(`Error occurred while trying to subscribe to topic ${b} for a datasource: ${e}`)})}subscribe(){this.C++;this.H.debug(`Data subscription ${this.F} has ${this.C} subscribers`);return this}}olympe.dc.sources.Fq.ya=[olympe.dc.sources.Hj];const Y={mr:10,Yn:11,Jo:12,oq:13,QUERY_RESULT:14,ap:15,qo:16,Ue:17,pq:18,po:19,fm:20};function Bj(a,b){b=b.reduce((c,d)=>{const e=new Map(Array.from(Object.entries(d.p).map(([f,g])=>[f,a.C(g)])));c.$c(d.t,d.s,e,d.m);d.r.forEach(f=>c.Ma(f.r,d.t,f.d));return c},new olympe.dc.db.tc);a.aa.xc(hf(b))}
754
+ olympe.dc.sources.fc=class extends olympe.N.fc{constructor(a){super();this.aa=a;this.db=a.view;this.G=new Map}ha(a){a=super.ha(a);if(0<this.G.size){const b=Array.from(this.G.values());this.G.clear();return Object.assign(Q(Y.mr,a),{i:b})}return a}O(a){return(null==a?void 0:a.t)===Y.mr&&Array.isArray(null==a?void 0:a.i)?(Bj(this,a.i),this.C(a.v)):this.C(a)}F(a){switch(!0){case a instanceof olympe.dm.File:var b=Y.Jo;{const c=a.X(),d={t:c};if(!this.G.has(c)&&(this.J(c),!this.db.Lf(c))){const e=a.get(olympe.dm.File.urlProp);
755
+ if(e.startsWith('blob:')||e.startsWith('stream:'))a=olympe.dc.Nr().ua(a),this.G.get(c).p[olympe.dm.File.urlProp.X()]='stream://'+c,d.s=this.F(a)}a=d}return Q(b,a);case a instanceof olympe.dc.CloudObject:return Q(Y.Yn,this.J(a.X()));case a instanceof olympe.dc.pa:return Q(Y.oq,a.ha());case a instanceof olympe.dc.Ra:return Q(Y.QUERY_RESULT,a.ha(this.J.bind(this)));case a instanceof olympe.dc.db.tc:return b=new olympe.dc.transaction.qf,a.Jc(b),Q(Y.ap,{i:a.U(),p:uf(b)});case a instanceof olympe.dc.Request:return Q(Y.qo,
756
+ {r:a.getType(),o:a.origin,d:a.jc(),u:a.Bc(),c:this.F(a.content)});case a instanceof olympe.dc.transaction.Ri:return Q(Y.Ue,{r:a.ah(),p:this.F(a.qc())});case a instanceof olympe.dc.query.td:return Q(Y.pq,a.ha());case a instanceof olympe.dc.kh:return Q(Y.po,a.ha());case a instanceof olympe.dc.uc:return Q(Y.fm,this.J(a.X()));default:return super.F(a)}}C(a){if(null===a||'object'!==typeof a)return super.C(a);const {t:b,v:c}=a;switch(b){case Y.Jo:var d=c.t;c.s&&(a=this.C(c.s),olympe.dc.Nr().hb(d,a));return olympe.dc.CloudObject.get(d);
757
757
  case Y.Yn:return olympe.dc.CloudObject.get(c);case Y.oq:return d=c.p.map(olympe.dc.query.ta.cm.C),a=c.e,new olympe.dc.pa(c.b,c.s,d,d.length-1,new Set(c.r),{max:a.m,offset:a.o,Ed:a.s,He:a.rm});case Y.QUERY_RESULT:return di(c);case Y.ap:return(new olympe.dc.transaction.zh).C(c.p,c.i);case Y.qo:return a=null!=(d=this.C(c.c))?d:void 0,mf(new olympe.dc.Request(c.r,c.d,a,c.u),c.o);case Y.Ue:return d=this.C(c.p),new olympe.dc.transaction.Ri(d,c.r);case Y.pq:return olympe.dc.query.td.C(c);case Y.po:return olympe.dc.kh.C(c);
758
- case Y.fm:return new olympe.dc.uc(c);default:return super.C(a)}}J(a){if(this.G.has(a))return a;if(!this.db.Ha(a))throw new olympe.dc.Zp(a);const b={};this.db.Cb(a).forEach((d,e)=>{b[e]=this.F(d)});const c=[];for(const [d,e,f]of Pg(this.db,a))this.G.has(f)&&c.push(e===olympe.dc.wa.DESTINATION?{r:d,o:a,d:f}:{r:d,o:f,d:a});this.G.set(a,{t:a,m:this.db.model(a),s:this.db.source(a),p:b,r:c});return a}};const Dj=olympe.dc.Request.C.tg,Ej=olympe.dc.Request.C.Ue,Fj=olympe.dc.Request.C.Mg,Gj=olympe.dc.Request.C.ii,Hj=olympe.dc.Request.C.Kn,Ij=olympe.dc.Request.C.yq,Jj=olympe.dc.Request.C.Bg,Kj=olympe.dc.Request.C.$j,Lj=olympe.dc.Request.C.$o,Mj=olympe.dc.Request.C.vt,Nj=olympe.dc.Request.C.wt,Oj=olympe.dc.Request.C.xt,Pj=olympe.dc.Request.C.rg,Qj=olympe.dc.Request.C.Tf,Rj=olympe.dc.Request.C.ag,Sj=olympe.dc.Request.C.Lj,Tj=olympe.dc.Request.C.Sv,Uj=olympe.dc.Request.C.gv,Vj=olympe.dc.Request.C.Vo,Wj=
759
- olympe.dc.Request.C.fh,Xj=olympe.dc.Request.C.Ts,Yj=olympe.dc.Request.C.Gb;function Zj(a){return ak(a,olympe.dc.Request.C.tg).then(b=>{b=b.p;const c=tf(b,a.U());a.H.C()&&a.H.debug('< Get Context result',b);a.H.T()&&a.H.log('< Get Context result has',b.length,'operations');return c})}function bk(a,b){const c=new olympe.dc.transaction.qf({fe:!1,Ph:!1}),d=b.qc(),e=b.C;d.Jc(c);return ck(a,Ej,{i:d.U(),r:b.ah(),p:uf(c),bd:e?!0:void 0}).then(f=>f.ct)}
760
- function dk(a,b){const c=b.qc(),d=new olympe.dc.transaction.qf({Pk:!0,fe:!1,Ph:!1});c.Jc(d);b=b.C?'bd=true':'';return ak(a,Fj,uf(d),b).then(e=>e.ct).finally(()=>{ek(a,Sj,{id:c.U(),finalize:olympe.dc.transaction.vf.C.Fi})})}function fk(a,b){const c=new olympe.dc.transaction.qf({fe:!1,Ph:!1}),d=b.qc();d.Jc(c);return ck(a,Gj,{i:d.U(),r:b.ah(),p:uf(c)},!1).catch(e=>a.H.error(`Error while publishing burst transaction: ${e}`))}
761
- function gk(a,b){const c=new olympe.dc.transaction.qf({fe:!1,Ph:!1});b=b.qc();b.Jc(c);return ck(a,Wj,{i:b.U(),p:uf(c)}).then(d=>d.ct)}function hk(a,b){const c=encodeURI(Ua(olympe.Y.Xe(),JSON.stringify(ik(a,b))));a.H.C()&&a.H.debug(`Static GraphDef query ${b} sent to orchestrator`);return ak(a,Jj,void 0,`query=${c}&v=${a.version}`).then(d=>jk(a,d))}function kk(a,b){const c=b.U();a.H.C()&&a.H.debug(`Query (${c}) sent to orchestrator: ${b}`);b=ik(a,b);return ak(a,Lj,b).then(d=>jk(a,d))}
762
- function ck(a,b,c,d=!0){const e=olympe.N.we.qg,f={c:b};Object.assign(f,c);if(d)return new Promise((g,h)=>{Od(a.G,e,f,(k,l)=>{k?h(k):g(l)})});Od(a.G,e,f);return Promise.resolve()}
763
- function ik(a,b){var c=Bh(b);b={i:b.U(),b:[b.F],m:!0,v:!0};if(c[0]instanceof olympe.dc.query.ta.Td)Object.assign(b,{f:c[0].Ob,q:[]});else{const d=(h,k)=>{h.every(l=>!l.Fa(k))&&h.push(k);return h},e=new Map;for(let h=c.length-1;0<=h;h--){const k=c[h],l=k.C;let n;const p=d(null!=(n=e.get(l))?n:[],k);if(k instanceof olympe.dc.query.ta.te&&k.G){let q;null==(q=e.get(k.U()))||q.forEach(r=>d(p,r))}e.set(l,p)}let f,g;c=null!=(g=e.get(null==(f=c[0])?void 0:f.C))?g:[];Object.assign(b,{f:olympe.dc.Nb.NONE,q:c.map(a.ea.bind(a,
764
- e))})}return b}function ek(a,b,c){b=mf(new olympe.dc.Request(b,olympe.dc.Ra.SELF,c),a.U());let d;null==(d=a.Wb)||d.qd(b)}
765
- function ak(a,b,c,d){const e=Oi(a.C,a.U(),b);if('string'!==typeof e)return Promise.reject(`ServerProvider: no url for type ${b}`);b=N(`${e}${'string'===typeof d&&0<d.length?`?${d}`:''}`,void 0!==c?olympe.net.Aa.Id.Ah:olympe.net.Aa.Id.GET,c&&JSON.stringify(c));rc(b,{[olympe.net.Aa.Headers.ki]:'application/json'});return Pi(a.C,b).then(f=>'string'===typeof f&&0<f.length?JSON.parse(f):f)}
766
- function jk(a,b){if(!b||'object'!==typeof b)throw Error('Data result can be created only from Object');if(0<b.s)throw Error(b.error);return tf(b.p,a.U())}function lk(a,b,c){return v(function*(){const d=b.pi;let e;if(c instanceof olympe.Y.stream.Eg){e=new olympe.dc.db.tc(d);try{for(const f=ha(c);;){const g=yield f.next();if(g.done)break;a.aa.C(g.value.p,d).Jc(e)}}catch(f){a.H.error(`Error while reading the stream: ${f}`),e=new olympe.dc.db.tc(d)}}else e=a.aa.C(b.p,d);return hf(e,b.ct)})}
767
- olympe.dc.sources.Uq=class extends olympe.dc.sources.gl{constructor(a,b,c,d,e){super(a,c);this.G=b;this.C=d;this.aa=new olympe.dc.transaction.zh(this.U());this.J=new Map;this.O=new Set;this.version=e||'unknown';olympe.D.ij(this.F.Kf(),()=>{this.J.forEach((f,g)=>{f.error(new olympe.N.errors.Gi('Connection to server has been recovered',g))})})}U(){return olympe.dc.Ra.SERVER}T(a){var b=a.getType(),c=a.content,d=of(a);switch(b){case Yj:return c=olympe.dm.DataSource.Gb.xb,a=olympe.dm.DataSource.Gb.Dh,
768
- Promise.resolve(Ld(this.G)?{s:a}:{s:c,r:'Disconnected'});case Dj:return Zj(this);case Ej:return bk(this,c);case Fj:return dk(this,c);case Gj:return fk(this,c);case Wj:return gk(this,c);case Jj:return d.get(olympe.dc.pa.C.rp)?hk(this,c):kk(this,c);case Hj:return Ld(this.G)?(c=ik(this,olympe.dc.pa.from(c)),c.f=olympe.dc.Nb.wo,c=N(Oi(this.C,olympe.dc.Ra.SERVER,Hj),olympe.net.Aa.Id.Ah,JSON.stringify(c),olympe.net.Aa.ResponseType.Ti),rc(c,{[olympe.net.Aa.Headers.ki]:olympe.net.Aa.il.JSON}),c=Pi(this.C,
769
- c)):(this.H.error(`Server is disconnected, backup of instance ${c} is canceled.`),c=Promise.reject('Server is disconnected')),c;case Ij:return a=c.uE,b=c.debug,c=c.optional,Ld(this.G)?(d=Oi(this.C,olympe.dc.Ra.SERVER,Ij),c=N(d+`?debug=${b}&optional=${c}`,olympe.net.Aa.Id.Ah,a),rc(c,{[olympe.net.Aa.Headers.ki]:olympe.net.Aa.il.aw}),c=Pi(this.C,c)):(this.H.error('Server is disconnected, restore of instance is canceled.'),c=Promise.reject('Server is disconnected')),c;case Tj:case Uj:case Vj:case Xj:return ck(this,
770
- b,{});case Qj:return this.C.downloadFileContent(a);case Pj:return this.C.deleteFileContent(a);case Rj:return this.C.uploadFileContent(a);default:return Promise.reject(`ServerProvider: Message of type ${b} not supported yet`)}}Z(a,b){if(a.getType()===Kj){const c=a.content,d=c.U();return(new rxjs.Observable(e=>{const f=ik(this,c);this.O.delete(d);this.J.set(d,e);ck(this,Mj,f).catch(g=>e.error(g))})).pipe(eb(olympe.N.errors.Gi,(e,f)=>{this.H.debug(`Subscribe to topic ${e.U()} now that we are back online, after waiting for ${f}ms`);
771
- b()}),rxjs.operators.finalize(()=>{this.O.add(d);ck(this,Nj,{i:d}).catch(e=>{this.H.warn(`Fail to unsubscribe to graphdef ${d}: ${e}`)}).finally(()=>{this.O.has(d)&&this.J.delete(d);this.O.delete(d)})}))}return rxjs.throwError(()=>Error(`Subscription of type ${a.getType()} is not supported`))}init(a){super.init(a);Jd(this.G,olympe.N.we.qg,this.ja.bind(this));return this}destroy(){return v(function*(){})}ja(a,b){const c=olympe.dc.Request.C.Mn,d=olympe.dc.Request.C.Pl,e=a.c;if(e===olympe.dc.Request.C.mo)lk(this,
772
- a,b).then(f=>{ek(this,e,f)});else if(e===c)b=this.aa.C(a.p,a.i),ek(this,e,{rollback:hf(b,a.ct),error:a.error});else if(e===Oj){const f=a.i;lk(this,a,b).then(g=>{let h;null==(h=this.J.get(f))||h.next(g)})}else e===d&&ek(this,Sj,{id:a.i,finalize:olympe.dc.transaction.vf.C.Pl,error:0<a.s?a.error:null})}ea(a,b){if(b instanceof olympe.dc.query.ta.Eh){const c=b.relation;let d;b=null!=(d=a.get(b.U()))?d:[];return{t:c.X(),d:c.Ia()===olympe.dc.wa.ORIGIN?1:2,v:!0,r:c.recursive,q:b.map(this.ea.bind(this,a))}}return{}}};
773
- olympe.dc.sources.Uq.ya=[olympe.dc.sources.Hj];function mk(a,b,c){const d=new olympe.D.Xb(`Source solver ${b.X()}`);b.hb(olympe.dm.rd.G.bc()).hb(olympe.dm.rd.F).ge().back().hb(olympe.dm.rd.C).ge().observe(d,{Pd:c,zc:!0}).subscribe(e=>{rf(e).forEach(([f,g])=>{a.F.set(f.X(),g.U())});qf(e).forEach(([f])=>{a.F.delete(f)})});b.hb(olympe.dm.kb.F).observe(d,{Pd:c,zc:!0}).subscribe(e=>{let f,g;a.G=null!=(g=null==(f=e.Fc())?void 0:f.U())?g:null});d.onDestroy(()=>{a.F.clear();a.G=null})}
774
- olympe.dc.sources.lk=class{constructor(a,b,c){this.db=a;this.C=b;this.O=c;this.F=new Map;this.G=null;this.J=!1}fromModel(a){a=olympe.dc.ga(a);return this.F.has(a)?this.F.get(a):this.G&&this.T(a)?this.G:this.O}Fe(a){let b;return null!=(b=this.db.source(a))?b:this.O}tb(a){return a===this.C?olympe.dc.CloudObject.get(this.C):a===olympe.dc.Ra.SERVER?olympe.dc.CloudObject.get(olympe.dm.DataSource.SERVER):this.db.Ha(a)&&this.db.Rb(a,olympe.dm.DataSource)?olympe.dc.CloudObject.get(a):null}T(){return!1}init(){if(!this.J){this.J=
775
- !0;var a=new olympe.dc.Wa;Z(a.create(olympe.dm.DataSource,this.C).ci(this.C),olympe.dm.DataSource.Oh,!0);a.Ma(olympe.dm.DataSource.nj,this.C,this.C);a.ob(()=>{olympe.dc.pa.from(this.C).observe(olympe.D.Sg()).subscribe(()=>{})})}}};olympe.dc.sources.R={Ca:'dc.sources.Logger',zl:'dc.sources.HTTPService',Mt:'dc.sources.IOService',wq:'dc.sources.RemoteProvider',Nq:'dc.sources.ServerProvider',kB:'dc.sources.OfflineProvider',Re:'dc.sources.SourceSolver',Be:'dc.sources.Serializer',no:'dc.sources.cache.Cache',oo:'dc.sources.cache.DATABASE',cl:'dc.sources.cache.Logger'};
758
+ case Y.fm:return new olympe.dc.uc(c);default:return super.C(a)}}J(a){if(this.G.has(a))return a;if(!this.db.Ha(a))throw new olympe.dc.Zp(a);const b={};this.db.Cb(a).forEach((d,e)=>{b[e]=this.F(d)});const c=[];for(const [d,e,f]of Pg(this.db,a))this.G.has(f)&&c.push(e===olympe.dc.wa.DESTINATION?{r:d,o:a,d:f}:{r:d,o:f,d:a});this.G.set(a,{t:a,m:this.db.model(a),s:this.db.source(a),p:b,r:c});return a}};const Cj=olympe.dc.Request.C.tg,Dj=olympe.dc.Request.C.Ue,Ej=olympe.dc.Request.C.Mg,Fj=olympe.dc.Request.C.ii,Gj=olympe.dc.Request.C.Kn,Hj=olympe.dc.Request.C.yq,Ij=olympe.dc.Request.C.Bg,Jj=olympe.dc.Request.C.$j,Kj=olympe.dc.Request.C.$o,Lj=olympe.dc.Request.C.vt,Mj=olympe.dc.Request.C.wt,Nj=olympe.dc.Request.C.xt,Oj=olympe.dc.Request.C.rg,Pj=olympe.dc.Request.C.Tf,Qj=olympe.dc.Request.C.ag,Rj=olympe.dc.Request.C.Lj,Sj=olympe.dc.Request.C.Sv,Tj=olympe.dc.Request.C.gv,Uj=olympe.dc.Request.C.Vo,Vj=
759
+ olympe.dc.Request.C.fh,Wj=olympe.dc.Request.C.Ts,Xj=olympe.dc.Request.C.Hb;function Yj(a){return Zj(a,olympe.dc.Request.C.tg).then(b=>{b=b.p;const c=tf(b,a.U());a.H.C()&&a.H.debug('< Get Context result',b);a.H.T()&&a.H.log('< Get Context result has',b.length,'operations');return c})}function ak(a,b){const c=new olympe.dc.transaction.qf({fe:!1,Ph:!1}),d=b.qc(),e=b.C;d.Jc(c);return bk(a,Dj,{i:d.U(),r:b.ah(),p:uf(c),bd:e?!0:void 0}).then(f=>f.ct)}
760
+ function ck(a,b){const c=b.qc(),d=new olympe.dc.transaction.qf({Pk:!0,fe:!1,Ph:!1});c.Jc(d);b=b.C?'bd=true':'';return Zj(a,Ej,uf(d),b).then(e=>e.ct).finally(()=>{dk(a,Rj,{id:c.U(),finalize:olympe.dc.transaction.vf.C.Fi})})}function ek(a,b){const c=new olympe.dc.transaction.qf({fe:!1,Ph:!1}),d=b.qc();d.Jc(c);return bk(a,Fj,{i:d.U(),r:b.ah(),p:uf(c)},!1).catch(e=>a.H.error(`Error while publishing burst transaction: ${e}`))}
761
+ function fk(a,b){const c=new olympe.dc.transaction.qf({fe:!1,Ph:!1});b=b.qc();b.Jc(c);return bk(a,Vj,{i:b.U(),p:uf(c)}).then(d=>d.ct)}function gk(a,b){const c=encodeURI(Ua(olympe.Y.Xe(),JSON.stringify(hk(a,b))));a.H.C()&&a.H.debug(`Static GraphDef query ${b} sent to orchestrator`);return Zj(a,Ij,void 0,`query=${c}&v=${a.version}`).then(d=>ik(a,d))}function jk(a,b){const c=b.U();a.H.C()&&a.H.debug(`Query (${c}) sent to orchestrator: ${b}`);b=hk(a,b);return Zj(a,Kj,b).then(d=>ik(a,d))}
762
+ function bk(a,b,c,d=!0){const e=olympe.N.we.qg,f={c:b};Object.assign(f,c);if(d)return new Promise((g,h)=>{Od(a.G,e,f,(k,l)=>{k?h(k):g(l)})});Od(a.G,e,f);return Promise.resolve()}
763
+ function hk(a,b){var c=Bh(b);b={i:b.U(),b:[b.F],m:!0,v:!0};if(c[0]instanceof olympe.dc.query.ta.Td)Object.assign(b,{f:c[0].Ob,q:[]});else{const d=(h,k)=>{h.every(l=>!l.Fa(k))&&h.push(k);return h},e=new Map;for(let h=c.length-1;0<=h;h--){const k=c[h],l=k.C;let n;const p=d(null!=(n=e.get(l))?n:[],k);if(k instanceof olympe.dc.query.ta.te&&k.G){let q;null==(q=e.get(k.U()))||q.forEach(r=>d(p,r))}e.set(l,p)}let f,g;c=null!=(g=e.get(null==(f=c[0])?void 0:f.C))?g:[];Object.assign(b,{f:olympe.dc.Nb.NONE,q:c.map(a.ea.bind(a,
764
+ e))})}return b}function dk(a,b,c){b=mf(new olympe.dc.Request(b,olympe.dc.Sa.SELF,c),a.U());let d;null==(d=a.Wb)||d.qd(b)}
765
+ function Zj(a,b,c,d){const e=Ni(a.C,a.U(),b);if('string'!==typeof e)return Promise.reject(`ServerProvider: no url for type ${b}`);b=N(`${e}${'string'===typeof d&&0<d.length?`?${d}`:''}`,void 0!==c?olympe.net.Aa.Id.Ah:olympe.net.Aa.Id.GET,c&&JSON.stringify(c));rc(b,{[olympe.net.Aa.Headers.ki]:'application/json'});return Oi(a.C,b).then(f=>'string'===typeof f&&0<f.length?JSON.parse(f):f)}
766
+ function ik(a,b){if(!b||'object'!==typeof b)throw Error('Data result can be created only from Object');if(0<b.s)throw Error(b.error);return tf(b.p,a.U())}function kk(a,b,c){return v(function*(){const d=b.pi;let e;if(c instanceof olympe.Y.stream.Eg){e=new olympe.dc.db.tc(d);try{for(const f=ha(c);;){const g=yield f.next();if(g.done)break;a.aa.C(g.value.p,d).Jc(e)}}catch(f){a.H.error(`Error while reading the stream: ${f}`),e=new olympe.dc.db.tc(d)}}else e=a.aa.C(b.p,d);return hf(e,b.ct)})}
767
+ olympe.dc.sources.Uq=class extends olympe.dc.sources.gl{constructor(a,b,c,d,e){super(a,c);this.G=b;this.C=d;this.aa=new olympe.dc.transaction.zh(this.U());this.J=new Map;this.O=new Set;this.version=e||'unknown';olympe.D.ij(this.F.Kf(),()=>{this.J.forEach((f,g)=>{f.error(new olympe.N.errors.Gi('Connection to server has been recovered',g))})})}U(){return olympe.dc.Sa.SERVER}T(a){var b=a.getType(),c=a.content,d=of(a);switch(b){case Xj:return c=olympe.dm.DataSource.Hb.xb,a=olympe.dm.DataSource.Hb.Dh,
768
+ Promise.resolve(Ld(this.G)?{s:a}:{s:c,r:'Disconnected'});case Cj:return Yj(this);case Dj:return ak(this,c);case Ej:return ck(this,c);case Fj:return ek(this,c);case Vj:return fk(this,c);case Ij:return d.get(olympe.dc.pa.C.rp)?gk(this,c):jk(this,c);case Gj:return Ld(this.G)?(c=hk(this,olympe.dc.pa.from(c)),c.f=olympe.dc.Nb.wo,c=N(Ni(this.C,olympe.dc.Sa.SERVER,Gj),olympe.net.Aa.Id.Ah,JSON.stringify(c),olympe.net.Aa.ResponseType.Ti),rc(c,{[olympe.net.Aa.Headers.ki]:olympe.net.Aa.il.JSON}),c=Oi(this.C,
769
+ c)):(this.H.error(`Server is disconnected, backup of instance ${c} is canceled.`),c=Promise.reject('Server is disconnected')),c;case Hj:return a=c.uE,b=c.debug,c=c.optional,Ld(this.G)?(d=Ni(this.C,olympe.dc.Sa.SERVER,Hj),c=N(d+`?debug=${b}&optional=${c}`,olympe.net.Aa.Id.Ah,a),rc(c,{[olympe.net.Aa.Headers.ki]:olympe.net.Aa.il.aw}),c=Oi(this.C,c)):(this.H.error('Server is disconnected, restore of instance is canceled.'),c=Promise.reject('Server is disconnected')),c;case Sj:case Tj:case Uj:case Wj:return bk(this,
770
+ b,{});case Pj:return this.C.downloadFileContent(a);case Oj:return this.C.deleteFileContent(a);case Qj:return this.C.uploadFileContent(a);default:return Promise.reject(`ServerProvider: Message of type ${b} not supported yet`)}}Z(a,b){if(a.getType()===Jj){const c=a.content,d=c.U();return(new rxjs.Observable(e=>{const f=hk(this,c);this.O.delete(d);this.J.set(d,e);bk(this,Lj,f).catch(g=>e.error(g))})).pipe(eb(olympe.N.errors.Gi,(e,f)=>{this.H.debug(`Subscribe to topic ${e.U()} now that we are back online, after waiting for ${f}ms`);
771
+ b()}),rxjs.operators.finalize(()=>{this.O.add(d);bk(this,Mj,{i:d}).catch(e=>{this.H.warn(`Fail to unsubscribe to graphdef ${d}: ${e}`)}).finally(()=>{this.O.has(d)&&this.J.delete(d);this.O.delete(d)})}))}return rxjs.throwError(()=>Error(`Subscription of type ${a.getType()} is not supported`))}init(a){super.init(a);Jd(this.G,olympe.N.we.qg,this.ja.bind(this));return this}destroy(){return v(function*(){})}ja(a,b){const c=olympe.dc.Request.C.Mn,d=olympe.dc.Request.C.Pl,e=a.c;if(e===olympe.dc.Request.C.mo)kk(this,
772
+ a,b).then(f=>{dk(this,e,f)});else if(e===c)b=this.aa.C(a.p,a.i),dk(this,e,{rollback:hf(b,a.ct),error:a.error});else if(e===Nj){const f=a.i;kk(this,a,b).then(g=>{let h;null==(h=this.J.get(f))||h.next(g)})}else e===d&&dk(this,Rj,{id:a.i,finalize:olympe.dc.transaction.vf.C.Pl,error:0<a.s?a.error:null})}ea(a,b){if(b instanceof olympe.dc.query.ta.Eh){const c=b.relation;let d;b=null!=(d=a.get(b.U()))?d:[];return{t:c.X(),d:c.Ia()===olympe.dc.wa.ORIGIN?1:2,v:!0,r:c.recursive,q:b.map(this.ea.bind(this,a))}}return{}}};
773
+ olympe.dc.sources.Uq.ya=[olympe.dc.sources.Hj];function lk(a,b,c){const d=new olympe.D.Xb(`Source solver ${b.X()}`);b.ib(olympe.dm.rd.G.bc()).ib(olympe.dm.rd.F).ge().back().ib(olympe.dm.rd.C).ge().observe(d,{Pd:c,zc:!0}).subscribe(e=>{rf(e).forEach(([f,g])=>{a.F.set(f.X(),g.U())});qf(e).forEach(([f])=>{a.F.delete(f)})});b.ib(olympe.dm.kb.F).observe(d,{Pd:c,zc:!0}).subscribe(e=>{let f,g;a.G=null!=(g=null==(f=e.Fc())?void 0:f.U())?g:null});d.onDestroy(()=>{a.F.clear();a.G=null})}
774
+ olympe.dc.sources.lk=class{constructor(a,b,c){this.db=a;this.C=b;this.O=c;this.F=new Map;this.G=null;this.J=!1}fromModel(a){a=olympe.dc.ga(a);return this.F.has(a)?this.F.get(a):this.G&&this.T(a)?this.G:this.O}Fe(a){let b;return null!=(b=this.db.source(a))?b:this.O}tb(a){return a===this.C?olympe.dc.CloudObject.get(this.C):a===olympe.dc.Sa.SERVER?olympe.dc.CloudObject.get(olympe.dm.DataSource.SERVER):this.db.Ha(a)&&this.db.Rb(a,olympe.dm.DataSource)?olympe.dc.CloudObject.get(a):null}T(){return!1}init(){if(!this.J){this.J=
775
+ !0;var a=new olympe.dc.Xa;Z(a.create(olympe.dm.DataSource,this.C).ci(this.C),olympe.dm.DataSource.Oh,!0);a.Ma(olympe.dm.DataSource.nj,this.C,this.C);a.ob(()=>{olympe.dc.pa.from(this.C).observe(olympe.D.Sg()).subscribe(()=>{})})}}};olympe.dc.sources.R={Ca:'dc.sources.Logger',zl:'dc.sources.HTTPService',Mt:'dc.sources.IOService',wq:'dc.sources.RemoteProvider',Nq:'dc.sources.ServerProvider',kB:'dc.sources.OfflineProvider',Re:'dc.sources.SourceSolver',Be:'dc.sources.Serializer',no:'dc.sources.cache.Cache',oo:'dc.sources.cache.DATABASE',cl:'dc.sources.cache.Logger'};
776
776
  olympe.dc.sources.V={ph:'data.httpHost',lf:'data.httpPort',ti:'data.httpSSL',xl:'data.httpBasePath',Zl:'data.pollingFrequency',Ke:'data.communicationMode',hm:'data.restrictedUse',VERSION:'version.version'};olympe.dc.sources.sh={Uu:'olympe.internal.data.',ph:'olympe.internal.data.httpHost',lf:'olympe.internal.data.httpPort',ti:'olympe.internal.data.httpSSL'};
777
777
  olympe.W.config(function(a){const b=['localhost','127.0.0.1'],c=a.getParameter(olympe.net.V.Ll),d=`-${olympe.host.Gg.Bh}`;F(a,olympe.dc.sources.V.ph,null);F(a,olympe.dc.sources.V.lf,null);F(a,olympe.dc.sources.V.ti,null);F(a,olympe.dc.sources.V.xl,'runtime/data');Qa(a,olympe.dc.sources.sh.ph,[olympe.host.V.ck,olympe.N.V.ml,olympe.dc.sources.V.ph],(e,f,g)=>{if(g)return g;e=e===olympe.host.Gg.Bh;return f.endsWith(c)&&e?f+d:f});Qa(a,olympe.dc.sources.sh.lf,[olympe.dc.sources.sh.ph,olympe.dc.sources.V.lf],
778
778
  (e,f)=>{if(f)return f;f=b.includes(e);const g=e.endsWith(d);e=e.endsWith(c);return f?3141:g?85:e?80:443});Qa(a,olympe.dc.sources.sh.ti,[olympe.dc.sources.sh.lf,olympe.dc.sources.V.ti],(e,f)=>null!==f?f:443===e);F(a,olympe.dc.sources.V.Zl,null);F(a,olympe.dc.sources.V.Ke,null);F(a,olympe.dc.sources.V.hm,null);E(a,olympe.dc.sources.R.Ca,[olympe.ka.R.Ea],e=>e.Vc('data'));C(a,olympe.dc.sources.R.Be,olympe.dc.sources.fc,olympe.dc.db.R.Ea);Oa(a,olympe.N.R.Be,olympe.dc.sources.R.Be);C(a,olympe.dc.sources.R.zl,
779
779
  olympe.dc.sources.At,olympe.dc.sources.R.Ca,olympe.net.R.Ui,olympe.N.R.yl,olympe.auth.R.Ea,olympe.dc.sources.R.Re,olympe.N.R.Be,new olympe.W.oa(olympe.N.V.Zk));C(a,olympe.dc.sources.R.Mt,olympe.dc.sources.qp,olympe.dc.sources.R.Ca,olympe.dc.R.Dg,olympe.net.R.Ea,olympe.auth.R.Ea);C(a,olympe.dc.sources.R.wq,olympe.dc.sources.Fq,olympe.dc.sources.R.Ca,new olympe.W.oa(olympe.dc.V.Hg),olympe.dc.sources.R.zl,olympe.N.R.ff,olympe.dc.R.jh,olympe.dc.sources.R.Re);C(a,olympe.dc.sources.R.Nq,olympe.dc.sources.Uq,
780
780
  olympe.dc.sources.R.Ca,olympe.N.R.fk,olympe.N.R.ff,olympe.dc.sources.R.zl,new olympe.W.oa(olympe.dc.sources.V.VERSION));C(a,olympe.dc.sources.R.Re,olympe.dc.sources.lk,olympe.dc.R.jh,new olympe.W.oa(olympe.dc.V.Hg),new olympe.W.oa(olympe.dc.V.ol));E(a,olympe.dc.sources.R.cl,[olympe.ka.R.Ea],e=>e.Vc('datacache'));C(a,olympe.dc.sources.R.no,olympe.dc.sources.cache.Cache,olympe.dc.sources.R.cl,olympe.dc.R.Dg,olympe.dc.sources.R.oo,olympe.dc.db.R.Ea,olympe.net.R.Ea,olympe.N.R.ff,olympe.Db.R.Ml,olympe.Y.R.mg,
781
- new olympe.W.oa(olympe.net.V.Wp),new olympe.W.oa(olympe.dc.sources.V.VERSION));C(a,olympe.dc.sources.R.oo,olympe.dc.sources.cache.Vj,olympe.Db.R.Jg,olympe.dc.sources.R.cl,olympe.Db.R.Pj)},'olympe.dc.sources');olympe.W.run([olympe.dc.sources.R.Re,olympe.dc.sources.R.no],(a,b)=>{olympe.dc.Zd=()=>a;olympe.dc.sources.Xd=()=>b});olympe.dc.sources.cache={};olympe.dc.sources.cache.errors={};olympe.dc.sources.cache.errors.pm=class extends Error{constructor(a){super(a)}};olympe.dc.sources.cache.errors.bt=class extends olympe.dc.sources.cache.errors.pm{};olympe.dc.sources.cache.errors.Pv=class extends olympe.dc.sources.cache.errors.pm{};olympe.dc.sources.cache.errors.Yv=class extends olympe.dc.sources.cache.errors.pm{};function nk(a){switch(!0){case null===a:case void 0===a:return null;case 'string'===typeof a:case 'boolean'===typeof a:case 'number'===typeof a:return a}switch(a.t){case 1:return new Date(a.d);case 2:return olympe.D.Color.Pb(a);case 17:return new olympe.dc.uc(a.v);case 13:return(new olympe.dc.transaction.zh).C(a.v,a.i);default:throw Error(`Impossible to deserialize the following value: ${a}`);}}
782
- olympe.dc.sources.cache.jp=class{ha(a){switch(!0){case null===a:case void 0===a:return null;case 'string'===typeof a:case 'boolean'===typeof a:case 'number'===typeof a:return a;case a instanceof olympe.D.fb:return{t:1,d:a.valueOf().toISOString()};case a instanceof Date:return{t:1,d:a.toISOString()};case a instanceof olympe.D.Color:return Object.assign({t:2},a.toJSON());case a instanceof olympe.dc.uc:return{t:17,v:a.X()};case a instanceof olympe.dc.db.tc:const b=new olympe.dc.transaction.qf;a.Jc(b);
783
- return{t:13,i:a.U(),v:uf(b)};default:throw Error(`Impossible to serialize the following value: ${a}`);}}};function kj(a,b,c){return v(function*(){ok(a,'queries',b);yield a.init();const d=a.F.has(c)?a.F.get(c):new Set;d.has(b)||(d.add(b),a.F.set(c,d),a.O.next(pk(a)));return qk(a.C,b,c)})}
784
- function lj(a,b,c,d,e=!1){return v(function*(){yield a.init();a.H.debug(`Cache: handle query ${b} graph patch: ${d.U()}`);d.Z(a.G);(()=>v(function*(){try{const f=null===b?[]:Array.from(a.F.entries()).filter(([,h])=>h.has(b)).map(([h])=>h),g=1===f.length&&'__code-as-data__'===f[0];if(null===b||!g||a.aa)a.H.debug('Cache: persist graph patch',d.U()),e&&b&&(Array.from(d.ad()).filter(h=>!h.zd()).map(h=>h.tag()),yield rk(a.C)),yield sk(a.C,d,0<f.length?b:null),tk(a,d,c).catch(h=>{a.H.error(`Cache: Failed to download files of a graph patch: ${h}`)})}catch(f){a.H.error(`Cache: Failed to handle graph patch ${d.U()} with message: ${f}`),
785
- a.hc.next(f)}finally{b&&uk(a,'queries',b)}}))().then(()=>{})})}function vk(){var a=olympe.dc.sources.Xd();a.aa=!0;a.yb=!0}function ok(a,b,c){const d=a.status.getValue();b in d||(d[b]={total:0,processed:0,values:new Set});d[b].total+=1;d[b].values.add(c);d.processing=!0;a.status.next(d)}
786
- function uk(a,b,c){const d=a.status.getValue();let e,f;null!=(f=null==(e=d[b])?void 0:e.values)&&f.delete(c)&&(d[b].processed+=1,0===d[b].values.size&&(delete d[b],('queries'===b?'files':'queries')in d||(d.processing=!1)),a.status.next(d))}function wk(a){return v(function*(){a.G=new olympe.dc.db.tc;const b=yield xk(a.C);for(const c of b)c.Jc(a.G);a.ea.next(0<b.length)})}
787
- function tk(a,b,c){return v(function*(){const d=yk(b),e=[];for(const g of d){const h=g.tag();if(!(yield zk(a.C,h)))if(ok(a,'files',h),!1===g.Sa(olympe.dm.File.C.X())&&g.Sa(olympe.dm.File.urlProp.X())){var f=g.Sa(olympe.dm.File.urlProp.X());const k=N(f);k.F=olympe.net.Aa.ResponseType.Yk;e.push(new Promise((l,n)=>{a.Cc.C(k,p=>{p=p.Gc();200<=p&&300>p?l():n(`Failed to download file ${g}. Response code ${p}`);uk(a,'files',h)})}))}else{let k;const l=null!=(k=g.Sa(olympe.dm.File.mimeTypeProp.X()))?k:'application/octet-stream';
788
- f={tag:h,model:g.Vb(),mimeType:l};const n=new olympe.dc.Request(olympe.dc.Request.C.Tf,c,f);f=hb(a.Tc,()=>a.Wb.request(n).then(p=>Ak(a.C,h,p,l))).finally(()=>uk(a,'files',h));e.push(f)}}yield Promise.allSettled(e).then(g=>{g.forEach((h,k)=>{if('rejected'===h.status){let l;a.H.warn(`Cache: File content for ${null==(l=d[k])?void 0:l.tag()} was not found`)}})})})}
789
- function yk(a){const b=[olympe.dc.ga(olympe.dm.File)];if(olympe.dc.CloudObject.exists(olympe.dm.File))b.push(...olympe.dc.pa.from(olympe.dm.File).eg(olympe.dc.CloudObject.extendedByRel).md().keys());else for(const c of b){let d,e;b.push(...(null!=(e=null==(d=a.Lc(c))?void 0:d.bb(olympe.dc.CloudObject.extendedByRel,f=>f))?e:[]))}return b.reduce((c,d)=>{let e,f;d=Array.from(null!=(f=null==(e=a.Lc(d))?void 0:e.bb(olympe.dc.CloudObject.instancesRel,g=>g))?f:[]).map(g=>a.Lc(g));return c.concat(d)},[])}
790
- function Bk(a,b){return Array.from(a.F.values()).some(c=>c.has(b))}function pk(a){return Array.from(a.F.keys()).filter(b=>'__code-as-data__'!==b)}function Ck(a,b){return v(function*(){yield a.init();if(b){var c,d=Array.from(null!=(c=a.F.get(b))?c:[]);a.F.delete(b);var e=Array.from(a.F.values()).reduce((f,g)=>{g.forEach(h=>f.add(h));return f},new Set);yield Dk(a.C,b);a.O.next(pk(a));d.filter(f=>!e.has(f));yield rk(a.C)}else yield Promise.all(pk(a).map(f=>Ck(a,f)))})}
791
- function Ek(a){if(!(2>a.length))for(let b=a.length-1;0<b;b--)for(let c=b-1;0<=c;c--)a[c].Z(a[b])}
792
- function Fk(a,b,c){return v(function*(){var d=olympe.dc.Request.C.Ue;const e=olympe.dc.Request.C.rg,f=olympe.dc.Request.C.ag;a.H.debug('Sync Cache: Applying transaction patch to destination',c,b.U());const g=yk(b);a.H.debug(`Sync Cache: Found ${g.length} files to send`);yield Promise.all(g.map(h=>v(function*(){const k=h.tag();var l=h.Vb();if(h.zd())l=new olympe.dc.Request(e,c,{tag:k,model:l});else{const n=yield Gk(a.C,k);l=new olympe.dc.Request(f,c,{tag:k,model:l,content:n.content,mimeType:n.C})}if(!ad(a.gb))throw Error('Lost connection, stop syncing');
793
- l=yield a.Wb.request(l);b.Qc(k,new Map([[olympe.dm.File.urlProp.X(),l]]))})));d=new olympe.dc.Request(d,c,new olympe.dc.transaction.Ri(b,!1));if(!ad(a.gb))throw Error('Lost connection, stop syncing');yield a.Wb.request(d)})}
794
- function Hk(a,b,c){return c instanceof olympe.N.errors.nk||c instanceof olympe.N.errors.fo?(a.H.error('Sync Cache: Timeout or Connection error',c),new olympe.dc.sources.cache.errors.bt('The connection has been lost. It can happen when the application loose connectivity or when the remote server is not responding correctly',c.message)):c instanceof olympe.N.errors.Eq?(a.H.error(`Sync Cache: transaction has been rejected by ${b} data source`,c),new olympe.dc.sources.cache.errors.Pv('The transaction has been rejected by the datasource',
781
+ new olympe.W.oa(olympe.net.V.Wp),new olympe.W.oa(olympe.dc.sources.V.VERSION));C(a,olympe.dc.sources.R.oo,olympe.dc.sources.cache.Vj,olympe.Db.R.Jg,olympe.dc.sources.R.cl,olympe.Db.R.Pj)},'olympe.dc.sources');olympe.W.run([olympe.dc.sources.R.Re,olympe.dc.sources.R.no],(a,b)=>{olympe.dc.Zd=()=>a;olympe.dc.sources.Xd=()=>b});olympe.dc.sources.cache={};olympe.dc.sources.cache.errors={};olympe.dc.sources.cache.errors.pm=class extends Error{constructor(a){super(a)}};olympe.dc.sources.cache.errors.bt=class extends olympe.dc.sources.cache.errors.pm{};olympe.dc.sources.cache.errors.Pv=class extends olympe.dc.sources.cache.errors.pm{};olympe.dc.sources.cache.errors.Yv=class extends olympe.dc.sources.cache.errors.pm{};function mk(a){switch(!0){case null===a:case void 0===a:return null;case 'string'===typeof a:case 'boolean'===typeof a:case 'number'===typeof a:return a}switch(a.t){case 1:return new Date(a.d);case 2:return olympe.D.Color.Pb(a);case 17:return new olympe.dc.uc(a.v);case 13:return(new olympe.dc.transaction.zh).C(a.v,a.i);default:throw Error(`Impossible to deserialize the following value: ${a}`);}}
782
+ olympe.dc.sources.cache.jp=class{ha(a){switch(!0){case null===a:case void 0===a:return null;case 'string'===typeof a:case 'boolean'===typeof a:case 'number'===typeof a:return a;case a instanceof olympe.D.gb:return{t:1,d:a.valueOf().toISOString()};case a instanceof Date:return{t:1,d:a.toISOString()};case a instanceof olympe.D.Color:return Object.assign({t:2},a.toJSON());case a instanceof olympe.dc.uc:return{t:17,v:a.X()};case a instanceof olympe.dc.db.tc:const b=new olympe.dc.transaction.qf;a.Jc(b);
783
+ return{t:13,i:a.U(),v:uf(b)};default:throw Error(`Impossible to serialize the following value: ${a}`);}}};function jj(a,b,c){return v(function*(){nk(a,'queries',b);yield a.init();const d=a.F.has(c)?a.F.get(c):new Set;d.has(b)||(d.add(b),a.F.set(c,d),a.O.next(ok(a)));return pk(a.C,b,c)})}
784
+ function kj(a,b,c,d,e=!1){return v(function*(){yield a.init();a.H.debug(`Cache: handle query ${b} graph patch: ${d.U()}`);d.Z(a.G);(()=>v(function*(){try{const f=null===b?[]:Array.from(a.F.entries()).filter(([,h])=>h.has(b)).map(([h])=>h),g=1===f.length&&'__code-as-data__'===f[0];if(null===b||!g||a.aa)a.H.debug('Cache: persist graph patch',d.U()),e&&b&&(Array.from(d.ad()).filter(h=>!h.zd()).map(h=>h.tag()),yield qk(a.C)),yield rk(a.C,d,0<f.length?b:null),sk(a,d,c).catch(h=>{a.H.error(`Cache: Failed to download files of a graph patch: ${h}`)})}catch(f){a.H.error(`Cache: Failed to handle graph patch ${d.U()} with message: ${f}`),
785
+ a.hc.next(f)}finally{b&&tk(a,'queries',b)}}))().then(()=>{})})}function uk(){var a=olympe.dc.sources.Xd();a.aa=!0;a.yb=!0}function nk(a,b,c){const d=a.status.getValue();b in d||(d[b]={total:0,processed:0,values:new Set});d[b].total+=1;d[b].values.add(c);d.processing=!0;a.status.next(d)}
786
+ function tk(a,b,c){const d=a.status.getValue();let e,f;null!=(f=null==(e=d[b])?void 0:e.values)&&f.delete(c)&&(d[b].processed+=1,0===d[b].values.size&&(delete d[b],('queries'===b?'files':'queries')in d||(d.processing=!1)),a.status.next(d))}function vk(a){return v(function*(){a.G=new olympe.dc.db.tc;const b=yield wk(a.C);for(const c of b)c.Jc(a.G);a.ea.next(0<b.length)})}
787
+ function sk(a,b,c){return v(function*(){const d=xk(b),e=[];for(const g of d){const h=g.tag();if(!(yield yk(a.C,h)))if(nk(a,'files',h),!1===g.Oa(olympe.dm.File.C.X())&&g.Oa(olympe.dm.File.urlProp.X())){var f=g.Oa(olympe.dm.File.urlProp.X());const k=N(f);k.F=olympe.net.Aa.ResponseType.Yk;e.push(new Promise((l,n)=>{a.Cc.C(k,p=>{p=p.Gc();200<=p&&300>p?l():n(`Failed to download file ${g}. Response code ${p}`);tk(a,'files',h)})}))}else{let k;const l=null!=(k=g.Oa(olympe.dm.File.mimeTypeProp.X()))?k:'application/octet-stream';
788
+ f={tag:h,model:g.Vb(),mimeType:l};const n=new olympe.dc.Request(olympe.dc.Request.C.Tf,c,f);f=hb(a.Tc,()=>a.Wb.request(n).then(p=>zk(a.C,h,p,l))).finally(()=>tk(a,'files',h));e.push(f)}}yield Promise.allSettled(e).then(g=>{g.forEach((h,k)=>{if('rejected'===h.status){let l;a.H.warn(`Cache: File content for ${null==(l=d[k])?void 0:l.tag()} was not found`)}})})})}
789
+ function xk(a){const b=[olympe.dc.ga(olympe.dm.File)];if(olympe.dc.CloudObject.exists(olympe.dm.File))b.push(...olympe.dc.pa.from(olympe.dm.File).eg(olympe.dc.CloudObject.extendedByRel).md().keys());else for(const c of b){let d,e;b.push(...(null!=(e=null==(d=a.Lc(c))?void 0:d.cb(olympe.dc.CloudObject.extendedByRel,f=>f))?e:[]))}return b.reduce((c,d)=>{let e,f;d=Array.from(null!=(f=null==(e=a.Lc(d))?void 0:e.cb(olympe.dc.CloudObject.instancesRel,g=>g))?f:[]).map(g=>a.Lc(g));return c.concat(d)},[])}
790
+ function Ak(a,b){return Array.from(a.F.values()).some(c=>c.has(b))}function ok(a){return Array.from(a.F.keys()).filter(b=>'__code-as-data__'!==b)}function Bk(a,b){return v(function*(){yield a.init();if(b){var c,d=Array.from(null!=(c=a.F.get(b))?c:[]);a.F.delete(b);var e=Array.from(a.F.values()).reduce((f,g)=>{g.forEach(h=>f.add(h));return f},new Set);yield Ck(a.C,b);a.O.next(ok(a));d.filter(f=>!e.has(f));yield qk(a.C)}else yield Promise.all(ok(a).map(f=>Bk(a,f)))})}
791
+ function Dk(a){if(!(2>a.length))for(let b=a.length-1;0<b;b--)for(let c=b-1;0<=c;c--)a[c].Z(a[b])}
792
+ function Ek(a,b,c){return v(function*(){var d=olympe.dc.Request.C.Ue;const e=olympe.dc.Request.C.rg,f=olympe.dc.Request.C.ag;a.H.debug('Sync Cache: Applying transaction patch to destination',c,b.U());const g=xk(b);a.H.debug(`Sync Cache: Found ${g.length} files to send`);yield Promise.all(g.map(h=>v(function*(){const k=h.tag();var l=h.Vb();if(h.zd())l=new olympe.dc.Request(e,c,{tag:k,model:l});else{const n=yield Fk(a.C,k);l=new olympe.dc.Request(f,c,{tag:k,model:l,content:n.content,mimeType:n.C})}if(!ad(a.hb))throw Error('Lost connection, stop syncing');
793
+ l=yield a.Wb.request(l);b.Qc(k,new Map([[olympe.dm.File.urlProp.X(),l]]))})));d=new olympe.dc.Request(d,c,new olympe.dc.transaction.Ri(b,!1));if(!ad(a.hb))throw Error('Lost connection, stop syncing');yield a.Wb.request(d)})}
794
+ function Gk(a,b,c){return c instanceof olympe.N.errors.nk||c instanceof olympe.N.errors.fo?(a.H.error('Sync Cache: Timeout or Connection error',c),new olympe.dc.sources.cache.errors.bt('The connection has been lost. It can happen when the application loose connectivity or when the remote server is not responding correctly',c.message)):c instanceof olympe.N.errors.Eq?(a.H.error(`Sync Cache: transaction has been rejected by ${b} data source`,c),new olympe.dc.sources.cache.errors.Pv('The transaction has been rejected by the datasource',
795
795
  c.message)):new olympe.dc.sources.cache.errors.Yv('Synchronisation error',c.message)}
796
- function Ik(){var a=olympe.dc.sources.Xd();if(a.T)return rxjs.throwError(()=>Error('Another synchronisation is in progress'));a.T=!0;a.H.info('Sync Cache: Start synchronising transactions');const b=new rxjs.BehaviorSubject([null,null]);(()=>v(function*(){yield a.init();const c=yield Jk(a.C);let d=0;const e=Array.from(c.values()).reduce((f,g)=>f+g.length,0);0<e&&b.next([e,d]);for(const [f,g]of c){Ek(g);for(const h of g){a.H.debug(`Sync Cache: Processing patch ${d+1}/${e} (${h.U()})`);try{yield Fk(a,
797
- h,f),yield Kk(a.C,h)}catch(k){throw Hk(a,f,k);}d+=1;b.next([e,d])}}a.J=null}))().then(()=>{a.T=!1;b.complete()}).catch(c=>{b.error(c.message)}).finally(()=>{wk(a).finally(()=>{a.T=!1})});return b.asObservable()}
798
- function Lk(){const a=olympe.dc.sources.Xd();return v(function*(){var b=new Set;const c={files:[],patches:[],version:a.version};var d=yk(a.G);for(const e of d)b.has(e.tag())||(d=yield Gk(a.C,e.tag()),c.files.push({t:e.tag(),m:d.C,c:a.ua.C(d.content)}),b.add(e.tag()));b=yield Mk(a.C);c.patches.push(...b);return JSON.stringify(c)})}
799
- function Nk(a){const b=olympe.dc.sources.Xd();return v(function*(){let c;try{c=JSON.parse(a)}catch(e){throw Error('Invalid pending changes, must be a JSON string');}var d=c.files;if(!Array.isArray(c.patches)||!Array.isArray(d))throw Error('Invalid pending changes, must contain a `patches` array and a `files` array');for(const e of c.files)d=b.ua.F(e.c),yield Ak(b.C,e.t,d,e.m);yield Ok(b.C,c.patches);yield wk(b);b.Ga.xc(hf(b.G))})}
800
- function Pk(){const a=olympe.dc.sources.Xd();return v(function*(){yield Qk(a.C);yield wk(a)})}
801
- olympe.dc.sources.cache.Cache=class{constructor(a,b,c,d,e,f,g,h,k,l){this.H=a;this.Wb=b;this.C=c;this.Ga=d;this.Cc=e;this.gb=f;this.ab=g;this.ua=h;this.version=l;this.aa=this.version!==this.ab.get('__code-as-data-version__');this.Jb=this.yb=!1;this.F=new Map;this.O=new rxjs.BehaviorSubject([]);this.J=null;this.ea=new rxjs.BehaviorSubject(!1);this.G=new olympe.dc.db.tc;this.Ub=this.ac=!1;this.ja=[];this.Z=0;this.Uc=new rxjs.BehaviorSubject(!1);this.status=new rxjs.BehaviorSubject({processing:!1});
802
- this.T=!1;this.hc=new rxjs.Subject;this.Tc=new olympe.Y.promise.Fv(k)}Gc(){return this.status.asObservable()}init(){const a=this;return v(function*(){if(!a.ac)if(a.Ub)yield new Promise(b=>{a.ja.push(b)});else{a.Ub=!0;(yield Rk(a.C)).forEach(b=>{a.F.set(b.name,new Set(b.C))});a.O.next(pk(a));yield wk(a);a.Ga.xc(hf(a.G));for(const b of a.ja)b();a.ac=!0;a.ja=[]}})}executeQuery(a){const b=this;return v(function*(){yield b.init();return Bk(b,a.U())&&Bh(a).some(c=>c instanceof olympe.dc.query.ta.Td)?Sk(b.C,
803
- a):b.C.executeQuery(a)})}applyTransaction(a,b){const c=this;return v(function*(){c.H.debug('Cache: apply transaction',a,b);yield c.init();const d=a.qc(),e=Array.from(d.C.keys());let f,g;const h=Array.from(null!=(g=null==(f=c.J)?void 0:f.C.C.keys())?g:[]);let k;b!==(null==(k=c.J)?void 0:k.F)||e.some(l=>!h.includes(l))?(yield Tk(c.C,d,b),c.J=new olympe.dc.sources.cache.$s(d,b),c.ea.next(!0)):(d.Jc(c.J.C),yield Tk(c.C,c.J.C,b));d.Jc(c.G);yield sk(c.C,d,'local-transaction')})}uploadFileContent(a,b,c){const d=
804
- this;return v(function*(){yield d.init();yield Ak(d.C,a,b,c);return`offline://${a}`})}downloadFileContent(a){const b=this;return v(function*(){yield b.init();return Gk(b.C,a).then(c=>c.content)})}deleteFileContent(a){const b=this;return v(function*(){yield b.init();yield Uk(b.C,[a])})}};olympe.dc.sources.cache.$s=class{constructor(a,b){this.C=a;this.F=b}};olympe.dc.sources.cache.Cache.F='__code-as-data-version__';olympe.dc.sources.cache.Cache.C='__code-as-data__';function Rk(a){return v(function*(){return(yield a.db.G('buckets')).map(b=>olympe.dc.sources.cache.$p.Pb(b))})}function xk(a){return v(function*(){return(yield a.db.G('pending-transactions')).map(b=>{b=olympe.dc.sources.cache.yh.Pb(b);return nk(b.C)})})}function qk(a,b,c){return v(function*(){a.H.debug(`Offline DB: Adding query ${b} in bucket ${c}`);return a.db.F()})}function rk(a){return v(function*(){return a.db.F()})}
805
- function sk(a,b,c){a.H.debug(`Offline DB: Apply patch ${b.U()} on local offline db`);Array.from(b.C.keys());return a.db.F().then(()=>{null===c&&(b.C.forEach((d,e)=>a.F.add(e)),a.G().then(()=>{}))})}function zk(a,b){return new Promise((c,d)=>{null!==a.files?c(a.files.has(b)):a.C.push(e=>{let f;return e?d(e):c(!(null==(f=a.files)||!f.has(b)))})})}
806
- function Ak(a,b,c,d){c=new olympe.dc.sources.cache.Xl(b,c,d);a.files.add(b);return a.db.set('files',c.toJSON()).then(()=>{}).catch(e=>{a.files.delete(b);throw e;})}function Dk(a,b){return v(function*(){return a.db.remove('buckets',b).then(()=>{})})}function Jk(a){return v(function*(){return(yield a.db.G('pending-transactions')).reduce((b,c)=>{c=olympe.dc.sources.cache.yh.Pb(c);const d=c.F;let e;const f=null!=(e=b.get(d))?e:[];f.push(nk(c.C));b.set(d,f);return b},new Map)})}
807
- function Kk(a,b){return v(function*(){return a.db.remove('pending-transactions',b.U()).then(()=>{})})}function Gk(a,b){return v(function*(){const c=yield a.db.get('files',b);if(!c)throw Error(`File ${b} not found in offline cache database`);return olympe.dc.sources.cache.Xl.Pb(c)})}function Mk(a){return v(function*(){return a.db.G('pending-transactions')})}
808
- function Ok(a,b){return v(function*(){const c=new Map;for(const d of b){const e=olympe.dc.sources.cache.yh.Pb(d);e&&c.set(e.C.i,d)}yield a.db.ea()})}function Qk(a){return v(function*(){return a.db.clear('pending-transactions').then(()=>{})})}
809
- function Sk(a,b){return v(function*(){const c=b.tb();a.H.debug(`Offline DB: Executing query ${b.U()} by ID with source ${c}`);const d=olympe.dc.query.td.cj(b);var e=(yield a.db.J(b.U())).map(f=>olympe.dc.sources.cache.zg.Pb(f));for(const f of e){if(f.source!==c)continue;e=olympe.dc.sources.cache.Vj.cc(f);const g=Vk(f.Dd);d.create(f.tag,e,g);for(const h of f.pb)if(e=h.match(/^([a-z0-9]*)(<|>)([a-z0-9]*)$/)){const [,k,l,n]=e;e='<'===l;k===olympe.dc.nc.Yc&&!0===e||d.Ma(k,e?n:f.tag,e?f.tag:n)}}a.H.C()&&
810
- a.H.debug(`Offline DB: Data result for query ${b.U()}`,d.qc().C.size,'instances',Array.from(d.qc().yd()).length,'relations');return d})}function Tk(a,b,c){b=a.O.ha(b);a.H.debug(`save transaction in destination '${c}'`,JSON.stringify(b));return a.db.set('pending-transactions',(new olympe.dc.sources.cache.yh(c,b,Date.now())).toJSON())}function Wk(a){return v(function*(){return a.db.O('pending-transactions')})}function Uk(a,b){return v(function*(){b.forEach(c=>a.files.delete(c));yield a.db.aa()})}
811
- function Vk(a){return Object.entries(a).reduce((b,[c,d])=>b.set(c,nk(d)),new Map)}
812
- olympe.dc.sources.cache.Vj=class{constructor(a,b,c){this.J=`Olympe_Cache_${a}`;this.H=b;this.O=new olympe.dc.sources.cache.jp;this.db=c.F(this.J);this.F=new Set;this.C=[];this.files=null;this.db.T('files').then(d=>{this.files=new Set(d);this.C.forEach(e=>e(null))}).catch(d=>{this.C.forEach(e=>e(d))});this.G=olympe.Y.Promise.$i(()=>{const d=this;return v(function*(){if(!(0===d.F.size||0<(yield Wk(d))))if(0<d.db.Z())d.G().then(()=>{}),d.H.debug('Offline DB GC: Postponing round while the stack is busy');
796
+ function Hk(){var a=olympe.dc.sources.Xd();if(a.T)return rxjs.throwError(()=>Error('Another synchronisation is in progress'));a.T=!0;a.H.info('Sync Cache: Start synchronising transactions');const b=new rxjs.BehaviorSubject([null,null]);(()=>v(function*(){yield a.init();const c=yield Ik(a.C);let d=0;const e=Array.from(c.values()).reduce((f,g)=>f+g.length,0);0<e&&b.next([e,d]);for(const [f,g]of c){Dk(g);for(const h of g){a.H.debug(`Sync Cache: Processing patch ${d+1}/${e} (${h.U()})`);try{yield Ek(a,
797
+ h,f),yield Jk(a.C,h)}catch(k){throw Gk(a,f,k);}d+=1;b.next([e,d])}}a.J=null}))().then(()=>{a.T=!1;b.complete()}).catch(c=>{b.error(c.message)}).finally(()=>{vk(a).finally(()=>{a.T=!1})});return b.asObservable()}
798
+ function Kk(){const a=olympe.dc.sources.Xd();return v(function*(){var b=new Set;const c={files:[],patches:[],version:a.version};var d=xk(a.G);for(const e of d)b.has(e.tag())||(d=yield Fk(a.C,e.tag()),c.files.push({t:e.tag(),m:d.C,c:a.ua.C(d.content)}),b.add(e.tag()));b=yield Lk(a.C);c.patches.push(...b);return JSON.stringify(c)})}
799
+ function Mk(a){const b=olympe.dc.sources.Xd();return v(function*(){let c;try{c=JSON.parse(a)}catch(e){throw Error('Invalid pending changes, must be a JSON string');}var d=c.files;if(!Array.isArray(c.patches)||!Array.isArray(d))throw Error('Invalid pending changes, must contain a `patches` array and a `files` array');for(const e of c.files)d=b.ua.F(e.c),yield zk(b.C,e.t,d,e.m);yield Nk(b.C,c.patches);yield vk(b);b.Ga.xc(hf(b.G))})}
800
+ function Ok(){const a=olympe.dc.sources.Xd();return v(function*(){yield Pk(a.C);yield vk(a)})}
801
+ olympe.dc.sources.cache.Cache=class{constructor(a,b,c,d,e,f,g,h,k,l){this.H=a;this.Wb=b;this.C=c;this.Ga=d;this.Cc=e;this.hb=f;this.bb=g;this.ua=h;this.version=l;this.aa=this.version!==this.bb.get('__code-as-data-version__');this.Fb=this.yb=!1;this.F=new Map;this.O=new rxjs.BehaviorSubject([]);this.J=null;this.ea=new rxjs.BehaviorSubject(!1);this.G=new olympe.dc.db.tc;this.Ub=this.ac=!1;this.ja=[];this.Z=0;this.Uc=new rxjs.BehaviorSubject(!1);this.status=new rxjs.BehaviorSubject({processing:!1});
802
+ this.T=!1;this.hc=new rxjs.Subject;this.Tc=new olympe.Y.promise.Fv(k)}Gc(){return this.status.asObservable()}init(){const a=this;return v(function*(){if(!a.ac)if(a.Ub)yield new Promise(b=>{a.ja.push(b)});else{a.Ub=!0;(yield Qk(a.C)).forEach(b=>{a.F.set(b.name,new Set(b.C))});a.O.next(ok(a));yield vk(a);a.Ga.xc(hf(a.G));for(const b of a.ja)b();a.ac=!0;a.ja=[]}})}executeQuery(a){const b=this;return v(function*(){yield b.init();return Ak(b,a.U())&&Bh(a).some(c=>c instanceof olympe.dc.query.ta.Td)?Rk(b.C,
803
+ a):b.C.executeQuery(a)})}applyTransaction(a,b){const c=this;return v(function*(){c.H.debug('Cache: apply transaction',a,b);yield c.init();const d=a.qc(),e=Array.from(d.C.keys());let f,g;const h=Array.from(null!=(g=null==(f=c.J)?void 0:f.C.C.keys())?g:[]);let k;b!==(null==(k=c.J)?void 0:k.F)||e.some(l=>!h.includes(l))?(yield Sk(c.C,d,b),c.J=new olympe.dc.sources.cache.$s(d,b),c.ea.next(!0)):(d.Jc(c.J.C),yield Sk(c.C,c.J.C,b));d.Jc(c.G);yield rk(c.C,d,'local-transaction')})}uploadFileContent(a,b,c){const d=
804
+ this;return v(function*(){yield d.init();yield zk(d.C,a,b,c);return`offline://${a}`})}downloadFileContent(a){const b=this;return v(function*(){yield b.init();return Fk(b.C,a).then(c=>c.content)})}deleteFileContent(a){const b=this;return v(function*(){yield b.init();yield Tk(b.C,[a])})}};olympe.dc.sources.cache.$s=class{constructor(a,b){this.C=a;this.F=b}};olympe.dc.sources.cache.Cache.F='__code-as-data-version__';olympe.dc.sources.cache.Cache.C='__code-as-data__';function Qk(a){return v(function*(){return(yield a.db.G('buckets')).map(b=>olympe.dc.sources.cache.$p.Pb(b))})}function wk(a){return v(function*(){return(yield a.db.G('pending-transactions')).map(b=>{b=olympe.dc.sources.cache.yh.Pb(b);return mk(b.C)})})}function pk(a,b,c){return v(function*(){a.H.debug(`Offline DB: Adding query ${b} in bucket ${c}`);return a.db.F()})}function qk(a){return v(function*(){return a.db.F()})}
805
+ function rk(a,b,c){a.H.debug(`Offline DB: Apply patch ${b.U()} on local offline db`);Array.from(b.C.keys());return a.db.F().then(()=>{null===c&&(b.C.forEach((d,e)=>a.F.add(e)),a.G().then(()=>{}))})}function yk(a,b){return new Promise((c,d)=>{null!==a.files?c(a.files.has(b)):a.C.push(e=>{let f;return e?d(e):c(!(null==(f=a.files)||!f.has(b)))})})}
806
+ function zk(a,b,c,d){c=new olympe.dc.sources.cache.Xl(b,c,d);a.files.add(b);return a.db.set('files',c.toJSON()).then(()=>{}).catch(e=>{a.files.delete(b);throw e;})}function Ck(a,b){return v(function*(){return a.db.remove('buckets',b).then(()=>{})})}function Ik(a){return v(function*(){return(yield a.db.G('pending-transactions')).reduce((b,c)=>{c=olympe.dc.sources.cache.yh.Pb(c);const d=c.F;let e;const f=null!=(e=b.get(d))?e:[];f.push(mk(c.C));b.set(d,f);return b},new Map)})}
807
+ function Jk(a,b){return v(function*(){return a.db.remove('pending-transactions',b.U()).then(()=>{})})}function Fk(a,b){return v(function*(){const c=yield a.db.get('files',b);if(!c)throw Error(`File ${b} not found in offline cache database`);return olympe.dc.sources.cache.Xl.Pb(c)})}function Lk(a){return v(function*(){return a.db.G('pending-transactions')})}
808
+ function Nk(a,b){return v(function*(){const c=new Map;for(const d of b){const e=olympe.dc.sources.cache.yh.Pb(d);e&&c.set(e.C.i,d)}yield a.db.ea()})}function Pk(a){return v(function*(){return a.db.clear('pending-transactions').then(()=>{})})}
809
+ function Rk(a,b){return v(function*(){const c=b.tb();a.H.debug(`Offline DB: Executing query ${b.U()} by ID with source ${c}`);const d=olympe.dc.query.td.cj(b);var e=(yield a.db.J(b.U())).map(f=>olympe.dc.sources.cache.zg.Pb(f));for(const f of e){if(f.source!==c)continue;e=olympe.dc.sources.cache.Vj.cc(f);const g=Uk(f.Dd);d.create(f.tag,e,g);for(const h of f.pb)if(e=h.match(/^([a-z0-9]*)(<|>)([a-z0-9]*)$/)){const [,k,l,n]=e;e='<'===l;k===olympe.dc.nc.Yc&&!0===e||d.Ma(k,e?n:f.tag,e?f.tag:n)}}a.H.C()&&
810
+ a.H.debug(`Offline DB: Data result for query ${b.U()}`,d.qc().C.size,'instances',Array.from(d.qc().yd()).length,'relations');return d})}function Sk(a,b,c){b=a.O.ha(b);a.H.debug(`save transaction in destination '${c}'`,JSON.stringify(b));return a.db.set('pending-transactions',(new olympe.dc.sources.cache.yh(c,b,Date.now())).toJSON())}function Vk(a){return v(function*(){return a.db.O('pending-transactions')})}function Tk(a,b){return v(function*(){b.forEach(c=>a.files.delete(c));yield a.db.aa()})}
811
+ function Uk(a){return Object.entries(a).reduce((b,[c,d])=>b.set(c,mk(d)),new Map)}
812
+ olympe.dc.sources.cache.Vj=class{constructor(a,b,c){this.J=`Olympe_Cache_${a}`;this.H=b;this.O=new olympe.dc.sources.cache.jp;this.db=c.F(this.J);this.F=new Set;this.C=[];this.files=null;this.db.T('files').then(d=>{this.files=new Set(d);this.C.forEach(e=>e(null))}).catch(d=>{this.C.forEach(e=>e(d))});this.G=olympe.Y.Promise.$i(()=>{const d=this;return v(function*(){if(!(0===d.F.size||0<(yield Vk(d))))if(0<d.db.Z())d.G().then(()=>{}),d.H.debug('Offline DB GC: Postponing round while the stack is busy');
813
813
  else{d.H.debug(`Offline DB GC: Round with ${d.F.size} candidates`);var e=Date.now();yield d.db.F().then(()=>{});d.H.debug(`Offline DB GC: has taken ${Date.now()-e}ms to run`)}})},5E3)}static cc(a){const b=new RegExp(`^(${olympe.dc.nc.Yc})>([a-z0-9]*)$`);for(const c of a.pb)if(a=c.match(b))return a[2];return null}executeQuery(a){const b=this;return v(function*(){const c=Date.now();b.H.debug(`Offline DB: Executing query ${a.U()} with source ${a.tb()}`);const d=olympe.dc.query.td.cj(a),e=a.tb();var f=
814
- yield b.db.get('instances',a.F),g=olympe.dc.sources.cache.zg.Pb(f);if(!g)return d;f=new Map;const h=new Set([g.tag]);d.create(g.tag,olympe.dc.sources.cache.Vj.cc(g),Vk(g.Dd));for(const p of Bh(a))if(p instanceof olympe.dc.query.ta.Eh){var k=p.relation;g=k.Ia()===olympe.dc.wa.ORIGIN;const q=k.X(),r=k.bc();k=new Set;f.set(p.U(),k);const t=[f.has(p.C)?new Set(f.get(p.C)):new Set([a.F])];for(const u of t){const x=new Map;var l=yield Promise.all(Array.from(u).map(y=>{if(!h.has(y))return b.H.warn(`Offline DB: Instance ${y} not found while processing query part, this should not happen`),
815
- Promise.resolve([]);r.X();return b.db.J().then(z=>z.map(A=>olympe.dc.sources.cache.zg.Pb(A))).then(z=>{x.set(y,z)})})).then(()=>x);for(const [y,z]of l){p instanceof olympe.dc.query.ta.te&&p.G&&k.add(y);for(const A of z)if(l=A.tag,A.source===e){if(p instanceof olympe.dc.query.ta.te&&!k.has(l)){var n=t[t.length-1];n||(n=new Set,t.push(n));n.add(l)}k.add(l);h.has(l)||(h.add(l),n=olympe.dc.sources.cache.Vj.cc(A),d.create(l,n,Vk(A.Dd)));q===olympe.dc.nc.Yc&&!0===g||d.Ma(q,g?l:y,g?y:l)}}}}else p instanceof
814
+ yield b.db.get('instances',a.F),g=olympe.dc.sources.cache.zg.Pb(f);if(!g)return d;f=new Map;const h=new Set([g.tag]);d.create(g.tag,olympe.dc.sources.cache.Vj.cc(g),Uk(g.Dd));for(const p of Bh(a))if(p instanceof olympe.dc.query.ta.Eh){var k=p.relation;g=k.Ia()===olympe.dc.wa.ORIGIN;const q=k.X(),r=k.bc();k=new Set;f.set(p.U(),k);const t=[f.has(p.C)?new Set(f.get(p.C)):new Set([a.F])];for(const u of t){const x=new Map;var l=yield Promise.all(Array.from(u).map(y=>{if(!h.has(y))return b.H.warn(`Offline DB: Instance ${y} not found while processing query part, this should not happen`),
815
+ Promise.resolve([]);r.X();return b.db.J().then(z=>z.map(A=>olympe.dc.sources.cache.zg.Pb(A))).then(z=>{x.set(y,z)})})).then(()=>x);for(const [y,z]of l){p instanceof olympe.dc.query.ta.te&&p.G&&k.add(y);for(const A of z)if(l=A.tag,A.source===e){if(p instanceof olympe.dc.query.ta.te&&!k.has(l)){var n=t[t.length-1];n||(n=new Set,t.push(n));n.add(l)}k.add(l);h.has(l)||(h.add(l),n=olympe.dc.sources.cache.Vj.cc(A),d.create(l,n,Uk(A.Dd)));q===olympe.dc.nc.Yc&&!0===g||d.Ma(q,g?l:y,g?y:l)}}}}else p instanceof
816
816
  olympe.dc.query.ta.Td&&b.H.warn(`Offline DB: Trying to execute a query ${a.U()} on the Cache DB that contains a FollowRule part. This is not supported and designed not to happen.`);b.H.C()&&(b.H.debug(`Offline DB: Data result for query ${a.U()}`,d.qc().C.size,'instances',Array.from(d.qc().yd()).length,'relations'),b.H.debug(`Offline DB: Data result for query ${a.U()} took ${Date.now()-c}ms to be executed`));return d})}};
817
817
  olympe.dc.sources.cache.$p=class{constructor(a,b){this.name=a;this.C=b}static Pb(a){return a?new olympe.dc.sources.cache.$p(a.name,a.queryIds):null}toJSON(){return{name:this.name,queryIds:this.C}}};
818
818
  olympe.dc.sources.cache.zg=class{constructor(a,b,c,d,e){this.tag=a;this.source=b;this.Dd=null!=c?c:{};this.pb=null!=d?d:[];this.C=null!=e?e:[]}static Pb(a){return a?new olympe.dc.sources.cache.zg(a.tag,a.source,a.props,a.relations,a.queryIds):null}toJSON(){return{tag:this.tag,source:this.source,props:this.Dd,relations:this.pb,queryIds:this.C}}};
819
819
  olympe.dc.sources.cache.yh=class{constructor(a,b,c){this.F=a;this.C=b;this.timestamp=c}static Pb(a){return a?new olympe.dc.sources.cache.yh(a.destination,a.patch,a.timestamp):null}toJSON(){return{destination:this.F,patch:this.C,timestamp:this.timestamp}}};
820
820
  olympe.dc.sources.cache.Pu=class extends olympe.dc.sources.cache.yh{constructor(a,b,c,d){super(a,b,c);this.error=d}static Pb(a){return a?new olympe.dc.sources.cache.Pu(a.destination,a.patch,a.timestamp,a.error):null}toJSON(){return{destination:this.F,patch:this.C,timestamp:this.timestamp,error:this.error}}};
821
- olympe.dc.sources.cache.Xl=class{constructor(a,b,c){this.tag=a;this.content=b;this.C=c}static Pb(a){return a?new olympe.dc.sources.cache.Xl(a.tag,a.content,a.mimetype):null}toJSON(){return{tag:this.tag,content:this.content,mimetype:this.C}}};function Xk(a,b){let c=a.O.get(b);c||(c=new Set(a.C.get(b).pb),a.O.set(b,c));return c}
821
+ olympe.dc.sources.cache.Xl=class{constructor(a,b,c){this.tag=a;this.content=b;this.C=c}static Pb(a){return a?new olympe.dc.sources.cache.Xl(a.tag,a.content,a.mimetype):null}toJSON(){return{tag:this.tag,content:this.content,mimetype:this.C}}};function Wk(a,b){let c=a.O.get(b);c||(c=new Set(a.C.get(b).pb),a.O.set(b,c));return c}
822
822
  olympe.dc.sources.cache.Dt=class{constructor(a,b){this.H=a;this.G=b;this.C=new Map;this.T=new Set;this.Z=new Set;this.J=new olympe.dc.sources.cache.jp;this.O=new Map}ad(){this.T.forEach(a=>this.C.delete(a));Array.from(this.C.entries()).forEach(([a,b])=>{b||this.C.delete(a)});return this.C}$c(a,b,c){const d=this.C.get(a);d||this.Z.add(a);var e;c=Array.from(null!=c?c:[]).reduce((h,k)=>{h[k[0]]=this.J.ha(k[1]);return h},null!=(e=null==d?void 0:d.Dd)?e:{});let f;e=null!=(f=null==d?void 0:d.C)?f:[];null===
823
823
  this.G||e.includes(this.G)||e.push(this.G);let g;b=new olympe.dc.sources.cache.zg(a,b,c,null!=(g=null==d?void 0:d.pb)?g:[],e);this.C.set(a,b)}Qc(a,b){const c=this.C.get(a);if(c){var d;c.Dd=Array.from(b).reduce((e,[f,g])=>{null===g?delete e[f]:e[f]=this.J.ha(g);return e},null!=(d=c.Dd)?d:{})}else this.H.warn(`Trying to update an instance (${a}) which do not exists in the cache database: ignoring.`)}F(a){this.T.add(a)}Ma(a,b,c){var d;const e=null!=(d=this.C.get(b))?d:new olympe.dc.sources.cache.zg(b,
824
- 'unknown',{},[],[]);var f;d=null!=(f=this.C.get(c))?f:new olympe.dc.sources.cache.zg(c,'unknown',{},[],[]);b=`${a}${olympe.dc.wa.ORIGIN}${b}`;f=(g,h)=>{this.C.set(g.tag,g);const k=Xk(this,g.tag);k.has(h)||(g.pb.push(h),k.add(h));null===this.G||g.C.includes(this.G)||g.C.push(this.G)};f(e,`${a}${olympe.dc.wa.DESTINATION}${c}`);f(d,b)}ic(a,b,c){const d=this.C.get(b),e=this.C.get(c);c=`${a}${olympe.dc.wa.DESTINATION}${c}`;a=`${a}${olympe.dc.wa.ORIGIN}${b}`;b=(f,g)=>{const h=Xk(this,f.tag);if(h.has(g)){const k=
825
- f.pb.indexOf(g);f.pb.splice(k,1);h.delete(g)}};d&&b(d,c);e&&b(e,a)}};olympe.dc.sources.cache.Dt.ya=[olympe.dc.Writable];olympe.dc.transaction={};olympe.dc.ji=class a{constructor(b,c){this.id=null!=b?b:olympe.Y.Mc();this.F=new olympe.D.Xb('BurstTransaction#'+this.id,c);this.yb=Yk(this);this.T=!1;this.F.onDestroy(()=>this.O());this.Z=new Set;this.G=new Map;this.J=new Set;this.C=null;let d;this.ab=null!=(d=olympe.W.getParameter(olympe.dc.transaction.V.Ln))?d:30;this.ja=[]}static C(b,c){return`${b},${c}`}Jb(b){for(const c of this.ja)c(b);this.stop()}Ga(){null!==this.C&&(clearTimeout(this.C),this.C=null);const b=this.ea(this.J);0<b.size&&Zk(this,
826
- b,!1);this.J.clear()}ea(b){const c=new Map;b.forEach(d=>{const e=d.split(',');let f=c.get(e[0]);void 0===f&&(f=new Map,c.set(e[0],f));f.set(e[1],this.G.get(d))});return c}aa(b,c,d){this.ua(b,c,d);this.yb(b,c,d);null===this.C&&(this.C=setTimeout(this.Ga.bind(this),this.ab))}ua(b,c,d){b=a.C(b,c);this.G.set(b,d);this.J.add(b)}gb(b,c){return this.G.get(a.C(b,c))}push(b,c){const d=olympe.dc.ga(b);b=c.subscribe(e=>{for(const [f,g]of e)e=olympe.dc.ga(f),this.gb(d,e)!==g&&this.aa(d,e,g.valueOf())});this.Z.add(b)}complete(){return new Promise((b,
827
- c)=>{this.O((d,e)=>{for(const f of this.Z)f.unsubscribe();d?b():c(e)})})}update(b,c,d){const e=olympe.dc.ga(b),f=olympe.dc.ga(c);void 0===e||void 0===f?olympe.ka.ib('dc').error('Burst transaction: instance tag or property tag is undefined'):(this.F.run(()=>{olympe.D.gn([d],g=>{this.T=!0;if(g instanceof olympe.dc.uc)olympe.ka.ib('dc').error('Cannot send complex property values in burst transactions');else{var h;this.aa(e,f,null!=(h=null==g?void 0:g.valueOf())?h:null)}})}),this.F.Z(()=>{this.O()}))}stop(){this.F.destroy();
828
- this.ja.length=0}getContext(){return this.F}U(){return this.id}ah(){return!1}O(b){if(this.T){this.T=!1;null!==this.C&&(clearTimeout(this.C),this.C=null);this.J.clear();const c=this.ea(new Set(this.G.keys()));Zk(this,c,!0,b)}else null==b||b(!0)}toString(){return'Burst transaction #'+this.id}};olympe.dc.ji.prototype.complete=olympe.dc.ji.prototype.complete;olympe.dc.ji.prototype.push=olympe.dc.ji.prototype.push;olympe.dc.bq=class{C(){}toString(){}};olympe.dc.transaction.zh=class a{constructor(b){this.F=null!=b?b:olympe.dc.Ra.SERVER}C(b,c){c=new olympe.dc.db.tc(c);this.G(b,c);return c}G(b,c){for(const d of b)switch(d.o){case 1:b=a.C(d.p||{});let e;c.$c(d.t,null!=(e=d.s)?e:this.F,b,d.m);break;case 2:c.Qc(d.t,a.C(d.p),d.m);break;case 3:c.F(d.t,d.f,d.m);break;case 4:c.Ma(d.m,d.l,d.r,d.lm,d.rm);break;case 5:c.ic(d.m,d.l,d.r,d.lm,d.rm);break;case 6:break;default:throw Error('Undefined patch operation: '+d.o);}}static C(b){const c=new Map;for(const [d,
824
+ 'unknown',{},[],[]);var f;d=null!=(f=this.C.get(c))?f:new olympe.dc.sources.cache.zg(c,'unknown',{},[],[]);b=`${a}${olympe.dc.wa.ORIGIN}${b}`;f=(g,h)=>{this.C.set(g.tag,g);const k=Wk(this,g.tag);k.has(h)||(g.pb.push(h),k.add(h));null===this.G||g.C.includes(this.G)||g.C.push(this.G)};f(e,`${a}${olympe.dc.wa.DESTINATION}${c}`);f(d,b)}ic(a,b,c){const d=this.C.get(b),e=this.C.get(c);c=`${a}${olympe.dc.wa.DESTINATION}${c}`;a=`${a}${olympe.dc.wa.ORIGIN}${b}`;b=(f,g)=>{const h=Wk(this,f.tag);if(h.has(g)){const k=
825
+ f.pb.indexOf(g);f.pb.splice(k,1);h.delete(g)}};d&&b(d,c);e&&b(e,a)}};olympe.dc.sources.cache.Dt.ya=[olympe.dc.Writable];olympe.dc.transaction={};olympe.dc.ji=class a{constructor(b,c){this.id=null!=b?b:olympe.Y.Mc();this.F=new olympe.D.Xb('BurstTransaction#'+this.id,c);this.yb=Xk(this);this.T=!1;this.F.onDestroy(()=>this.O());this.Z=new Set;this.G=new Map;this.J=new Set;this.C=null;let d;this.bb=null!=(d=olympe.W.getParameter(olympe.dc.transaction.V.Ln))?d:30;this.ja=[]}static C(b,c){return`${b},${c}`}Fb(b){for(const c of this.ja)c(b);this.stop()}Ga(){null!==this.C&&(clearTimeout(this.C),this.C=null);const b=this.ea(this.J);0<b.size&&Yk(this,
826
+ b,!1);this.J.clear()}ea(b){const c=new Map;b.forEach(d=>{const e=d.split(',');let f=c.get(e[0]);void 0===f&&(f=new Map,c.set(e[0],f));f.set(e[1],this.G.get(d))});return c}aa(b,c,d){this.ua(b,c,d);this.yb(b,c,d);null===this.C&&(this.C=setTimeout(this.Ga.bind(this),this.bb))}ua(b,c,d){b=a.C(b,c);this.G.set(b,d);this.J.add(b)}hb(b,c){return this.G.get(a.C(b,c))}push(b,c){const d=olympe.dc.ga(b);b=c.subscribe(e=>{for(const [f,g]of e)e=olympe.dc.ga(f),this.hb(d,e)!==g&&this.aa(d,e,g.valueOf())});this.Z.add(b)}complete(){return new Promise((b,
827
+ c)=>{this.O((d,e)=>{for(const f of this.Z)f.unsubscribe();d?b():c(e)})})}update(b,c,d){const e=olympe.dc.ga(b),f=olympe.dc.ga(c);void 0===e||void 0===f?olympe.ka.ab('dc').error('Burst transaction: instance tag or property tag is undefined'):(this.F.run(()=>{olympe.D.gn([d],g=>{this.T=!0;if(g instanceof olympe.dc.uc)olympe.ka.ab('dc').error('Cannot send complex property values in burst transactions');else{var h;this.aa(e,f,null!=(h=null==g?void 0:g.valueOf())?h:null)}})}),this.F.Z(()=>{this.O()}))}stop(){this.F.destroy();
828
+ this.ja.length=0}getContext(){return this.F}U(){return this.id}ah(){return!1}O(b){if(this.T){this.T=!1;null!==this.C&&(clearTimeout(this.C),this.C=null);this.J.clear();const c=this.ea(new Set(this.G.keys()));Yk(this,c,!0,b)}else null==b||b(!0)}toString(){return'Burst transaction #'+this.id}};olympe.dc.ji.prototype.complete=olympe.dc.ji.prototype.complete;olympe.dc.ji.prototype.push=olympe.dc.ji.prototype.push;olympe.dc.bq=class{C(){}toString(){}};olympe.dc.transaction.zh=class a{constructor(b){this.F=null!=b?b:olympe.dc.Sa.SERVER}C(b,c){c=new olympe.dc.db.tc(c);this.G(b,c);return c}G(b,c){for(const d of b)switch(d.o){case 1:b=a.C(d.p||{});let e;c.$c(d.t,null!=(e=d.s)?e:this.F,b,d.m);break;case 2:c.Qc(d.t,a.C(d.p),d.m);break;case 3:c.F(d.t,d.f,d.m);break;case 4:c.Ma(d.m,d.l,d.r,d.lm,d.rm);break;case 5:c.ic(d.m,d.l,d.r,d.lm,d.rm);break;case 6:break;default:throw Error('Undefined patch operation: '+d.o);}}static C(b){const c=new Map;for(const [d,
829
829
  e]of Object.entries(b)){b=d;let f=typeof e;20<b.length&&b.startsWith('fd')&&(b=olympe.dc.Oe.Me+b.substring(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;
830
- case '6':c.set(b,new Date(Date.UTC(e.y||1970,e.M&&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.uc(e.t));break;case 'untyped':null===e&&c.set(b,null)}}return c}};function $k(a,b){let c;return null!=(c=a.sources.get(b))?c:a.J.Fe(b)}function al(a,b){let c,d,e;return null!=(e=null!=(d=null==(c=a.C.Lc(b))?void 0:c.Vb())?d:a.db.model(b))?e:null}function bl(a,b){let c;return null!=(c=a.G.get(b))?c:a.db.Lf(b)||!a.db.Ha(b)}function cl(a,b){0===a.G.size?a.G=b:b.forEach((c,d)=>a.G.set(d,c))}function dl(a){return Array.from(a.C.ad()).filter(b=>!b.zd()).map(b=>b.tag())}
831
- function el(a,b,c,d){d(a.C);c&&b!==olympe.dc.Ra.SELF&&(c=a.F.get(b),c||(c=new olympe.dc.db.tc(a.id),a.F.set(b,c)),d(c))}function fl(a,b,c){const d=$k(a,b),e=bl(a,b),f=al(a,b);el(a,d,e,g=>{g.F(b,c,f)})}
832
- olympe.dc.transaction.Yu=class{constructor(a,b,c){this.id=null!=c?c:olympe.Y.Mc();this.J=b;this.db=a;this.F=new Map;this.C=new olympe.dc.db.tc(this.id);this.sources=new Map;this.G=new Map}af(){return 0===this.C.C.size}$c(a,b,c,d){let e;const f=null!=(e=null!=c?c:this.sources.get(a))?e:this.J.fromModel(b);c=bl(this,a);this.sources.set(a,f);el(this,f,c,g=>{g.$c(a,f,d,b)})}Qc(a,b){const c=$k(this,a),d=bl(this,a),e=al(this,a);el(this,c,d,f=>{f.Qc(a,null!=b?b:new Map,e)})}Ma(a,b,c){const d=$k(this,b),
833
- e=$k(this,c);var f=bl(this,b)&&bl(this,c)&&d!==olympe.dc.Ra.SELF&&e!==olympe.dc.Ra.SELF;f&&d!==e&&a!==olympe.dc.nc.Yc&&(f=g=>{let h;return null!=(h=olympe.dc.ia().name(g))?h:g},olympe.ka.ib('dc').warn(`Try to create a relation between 2 objects that have different locations: \n ${f(b)} (${b})-[${f(a)} (${a})]->${f(c)} (${c}), originSrc: ${f(d)} (${d}), destinationSrc: ${f(e)} (${e})`),f=!1);el(this,d,f,g=>{g.Ma(a,b,c,al(this,b),al(this,c))})}ic(a,b,c){const d=$k(this,b),e=$k(this,c);let f=bl(this,
834
- b)&&bl(this,c)&&d!==olympe.dc.Ra.SELF&&e!==olympe.dc.Ra.SELF;f&&d!==e&&a!==olympe.dc.nc.Yc&&(olympe.ka.ib('dc').warn(`Try to delete a relation between 2 objects that have different locations: ${b}-[${a}]->${c}`),f=!1);el(this,d,f,g=>{g.ic(a,b,c,al(this,b),al(this,c))})}};function gl(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.tp.Rq)if(e===olympe.dc.Ra.SELF)d[g]=olympe.dc.ia().U();else{if(e===olympe.dc.Ra.SERVER)continue}else g.startsWith(olympe.dc.Oe.Me)&&(g='fd'+g.substring(1));e=a.T(e);c&&e instanceof Object&&8===e.c?a.O.set(g,e):d[g]=e}return d}function hl(a){if(0===a.O.size)return null;const b=Object.create(null);a.O.forEach((c,d)=>{b[d]=c});a.O.clear();return b}
835
- class il{constructor(){this.O=new Map}T(a){return a instanceof olympe.D.Pa||a instanceof olympe.D.fa||a instanceof olympe.D.ba?a.valueOf():a instanceof Date||a instanceof olympe.D.fb?(a=a instanceof olympe.D.fb?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.Wg().valueOf(),g:a.Tg().valueOf(),b:a.Qg().valueOf(),a:a.Pg().valueOf()}:a&&'function'===
830
+ case '6':c.set(b,new Date(Date.UTC(e.y||1970,e.M&&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.uc(e.t));break;case 'untyped':null===e&&c.set(b,null)}}return c}};function Zk(a,b){let c;return null!=(c=a.sources.get(b))?c:a.J.Fe(b)}function $k(a,b){let c,d,e;return null!=(e=null!=(d=null==(c=a.C.Lc(b))?void 0:c.Vb())?d:a.db.model(b))?e:null}function al(a,b){let c;return null!=(c=a.G.get(b))?c:a.db.Lf(b)||!a.db.Ha(b)}function bl(a,b){0===a.G.size?a.G=b:b.forEach((c,d)=>a.G.set(d,c))}function cl(a){return Array.from(a.C.ad()).filter(b=>!b.zd()).map(b=>b.tag())}
831
+ function dl(a,b,c,d){d(a.C);c&&b!==olympe.dc.Sa.SELF&&(c=a.F.get(b),c||(c=new olympe.dc.db.tc(a.id),a.F.set(b,c)),d(c))}function el(a,b,c){const d=Zk(a,b),e=al(a,b),f=$k(a,b);dl(a,d,e,g=>{g.F(b,c,f)})}
832
+ olympe.dc.transaction.Yu=class{constructor(a,b,c){this.id=null!=c?c:olympe.Y.Mc();this.J=b;this.db=a;this.F=new Map;this.C=new olympe.dc.db.tc(this.id);this.sources=new Map;this.G=new Map}af(){return 0===this.C.C.size}$c(a,b,c,d){let e;const f=null!=(e=null!=c?c:this.sources.get(a))?e:this.J.fromModel(b);c=al(this,a);this.sources.set(a,f);dl(this,f,c,g=>{g.$c(a,f,d,b)})}Qc(a,b){const c=Zk(this,a),d=al(this,a),e=$k(this,a);dl(this,c,d,f=>{f.Qc(a,null!=b?b:new Map,e)})}Ma(a,b,c){const d=Zk(this,b),
833
+ e=Zk(this,c);var f=al(this,b)&&al(this,c)&&d!==olympe.dc.Sa.SELF&&e!==olympe.dc.Sa.SELF;f&&d!==e&&a!==olympe.dc.nc.Yc&&(f=g=>{let h;return null!=(h=olympe.dc.ia().name(g))?h:g},olympe.ka.ab('dc').warn(`Try to create a relation between 2 objects that have different locations: \n ${f(b)} (${b})-[${f(a)} (${a})]->${f(c)} (${c}), originSrc: ${f(d)} (${d}), destinationSrc: ${f(e)} (${e})`),f=!1);dl(this,d,f,g=>{g.Ma(a,b,c,$k(this,b),$k(this,c))})}ic(a,b,c){const d=Zk(this,b),e=Zk(this,c);let f=al(this,
834
+ b)&&al(this,c)&&d!==olympe.dc.Sa.SELF&&e!==olympe.dc.Sa.SELF;f&&d!==e&&a!==olympe.dc.nc.Yc&&(olympe.ka.ab('dc').warn(`Try to delete a relation between 2 objects that have different locations: ${b}-[${a}]->${c}`),f=!1);dl(this,d,f,g=>{g.ic(a,b,c,$k(this,b),$k(this,c))})}};function fl(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.tp.Rq)if(e===olympe.dc.Sa.SELF)d[g]=olympe.dc.ia().U();else{if(e===olympe.dc.Sa.SERVER)continue}else g.startsWith(olympe.dc.Oe.Me)&&(g='fd'+g.substring(1));e=a.T(e);c&&e instanceof Object&&8===e.c?a.O.set(g,e):d[g]=e}return d}function gl(a){if(0===a.O.size)return null;const b=Object.create(null);a.O.forEach((c,d)=>{b[d]=c});a.O.clear();return b}
835
+ class hl{constructor(){this.O=new Map}T(a){return a instanceof olympe.D.Qa||a instanceof olympe.D.fa||a instanceof olympe.D.ba?a.valueOf():a instanceof Date||a instanceof olympe.D.gb?(a=a instanceof olympe.D.gb?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.Wg().valueOf(),g:a.Tg().valueOf(),b:a.Qg().valueOf(),a:a.Pg().valueOf()}:a&&'function'===
836
836
  typeof a.X?{c:8,t:a.X()}:a}}function uf(a){const b=a.J.concat(a.G).concat(a.O).concat(a.C).concat(a.T);a.O=[];a.G=[];a.C=[];a.T=[];a.J=[];return b}
837
- olympe.dc.transaction.qf=class{constructor({Pk:a=!1,Ph:b=!0,fe:c=!0}={}){this.O=[];this.G=[];this.C=[];this.T=[];this.J=[];this.Pk=null!=a?a:!1;this.fe=null!=c?c:!0;this.Ph=null!=b?b:!0;this.Z=olympe.D?new il:new class extends il{T(d){return d&&'function'===typeof d.X?{c:8,t:d.X()}:d}}}flush(){return JSON.stringify(uf(this))}$c(a,b,c,d=null){c=gl(this.Z,null!=c?c:null,this.Pk);c={o:1,t:a,p:c};this.Ph&&(c.s=b);this.fe&&d&&(c.m=d);this.O.push(c);this.Pk&&(b=hl(this.Z))&&this.C.push({o:2,t:a,p:b})}Qc(a,
838
- b,c=null){b=gl(this.Z,b||null,!1);a={o:2,t:a,p:b};this.fe&&c&&(a.m=c);this.C.push(a)}F(a,b,c=null){a={o:3,t:a,f:b};this.fe&&c&&(a.m=c);this.G.push(a)}Ma(a,b,c,d=null,e=null){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`);a={o:4,m:a,l:b,r:c};this.fe&&d&&(a.lm=d);this.fe&&e&&(a.rm=e);this.T.push(a)}ic(a,b,c,d=null,e=null){if(!a)throw Error('Cannot delete relation of undefined type');
839
- if(!b)throw Error('Cannot delete relation with undefined origin');if(!c)throw Error('Cannot delete relation with undefined destination');a={o:5,m:a,l:b,r:c};this.fe&&d&&(a.lm=d);this.fe&&e&&(a.rm=e);this.J.push(a)}};olympe.dc.transaction.qf.ya=[olympe.dc.Writable];function jl(a){var b=new olympe.dc.Wa;b.Z=a;return b}function kl(a,b){b instanceof olympe.dc.Wa&&b.F.forEach((c,d)=>a.F.set(d,c));a.Xa.push(b);return b}
840
- function ll(a,b,c,d){c=a.create(null!=c?c:olympe.dc.CloudObject,void 0);if('string'===typeof b)b=b||'',Z(c,olympe.dc.CloudObject.nameProp.X(),b);else for(const [f,g]of Object.entries(b))Z(c,f,g);b=c.X();d=null!=d?d:olympe.dc.CloudObject;const e=olympe.dc.CloudObject.extendRel.X();kl(a,new olympe.dc.transaction.Xa.yo(e,b));kl(a,new olympe.dc.transaction.Xa.jl(e,b,d));return c}
841
- function ml(a,b){if(a.J)throw Error('Operation not permitted: this transaction has already been executed');a.J=!0;const c=[d=>{a.J=d},...a.aa,null!=b?b:()=>{}];return(d,e)=>{c.forEach(f=>f(d,e))}}
842
- olympe.dc.Wa=class{constructor(a){this.id=null!=a?a:olympe.Y.Mc();this.Xa=[];this.G=new Map;this.Z=!0;this.F=new Map;this.aa=[];this.J=this.O=!1;this.T=[...olympe.dc.hj().Z]}U(){return this.id}model(a){let b;return null!=(b=this.G.get(olympe.dc.ga(a)))?b:olympe.dc.ia().model(a)}C(a){cl(a,this.F);for(const b of this.Xa)b.C(a);try{this.T.forEach(b=>b(a))}catch(b){throw Error(`Transaction compilation error: ${b.message}`);}}create(a,b){b=kl(this,new olympe.dc.transaction.Xa.ko(a,b));const c=b.X();this.G.set(c,
843
- olympe.dc.ga(a));let d;this.persist(c,null!=(d=this.F.get(c))?d:this.Z);return b}persist(a,b=!0){const c=olympe.dc.ga(a);var d=olympe.dc.ia();this.F.set(c,b);if(b){let f;b=null!=(f=this.G.get(c))?f:d.model(c);if(null===b)throw Error(`Try to persist an instance that does not exist: ${c}`);var e;d=null!=(e=d.source(a))?e:olympe.dc.Zd().fromModel(b);kl(this,new olympe.dc.transaction.Xa.Zu(c,d))}else{if((e=d.Ha(c))&&d.Lf(c))throw Error(`Try to remove persistence of an instance already persisted: ${c}`);
844
- if(!e&&!this.G.has(c))throw Error(`Try to remove persistence of an instance that does not exist and is not part of the transaction: ${c}`);}return this}delete(a,b=olympe.dc.Nb.Dc){kl(this,new olympe.dc.transaction.Xa.zo(a,b))}update(a,b,c){return kl(this,new olympe.dc.transaction.Xa.Zv(a,b,c))}Ma(a,b,c){kl(this,new olympe.dc.transaction.Xa.jl(a,b,c))}ic(a,b,c){kl(this,new olympe.dc.transaction.Xa.mt(a,b,c))}Mm(a,b){kl(this,new olympe.dc.transaction.Xa.yo(a,b))}defineProperty(a,b,c,d,e,f){d=this.create(olympe.dm.Property,
837
+ olympe.dc.transaction.qf=class{constructor({Pk:a=!1,Ph:b=!0,fe:c=!0}={}){this.O=[];this.G=[];this.C=[];this.T=[];this.J=[];this.Pk=null!=a?a:!1;this.fe=null!=c?c:!0;this.Ph=null!=b?b:!0;this.Z=olympe.D?new hl:new class extends hl{T(d){return d&&'function'===typeof d.X?{c:8,t:d.X()}:d}}}flush(){return JSON.stringify(uf(this))}$c(a,b,c,d=null){c=fl(this.Z,null!=c?c:null,this.Pk);c={o:1,t:a,p:c};this.Ph&&(c.s=b);this.fe&&d&&(c.m=d);this.O.push(c);this.Pk&&(b=gl(this.Z))&&this.C.push({o:2,t:a,p:b})}Qc(a,
838
+ b,c=null){b=fl(this.Z,b||null,!1);a={o:2,t:a,p:b};this.fe&&c&&(a.m=c);this.C.push(a)}F(a,b,c=null){a={o:3,t:a,f:b};this.fe&&c&&(a.m=c);this.G.push(a)}Ma(a,b,c,d=null,e=null){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`);a={o:4,m:a,l:b,r:c};this.fe&&d&&(a.lm=d);this.fe&&e&&(a.rm=e);this.T.push(a)}ic(a,b,c,d=null,e=null){if(!a)throw Error('Cannot delete relation of undefined type');
839
+ if(!b)throw Error('Cannot delete relation with undefined origin');if(!c)throw Error('Cannot delete relation with undefined destination');a={o:5,m:a,l:b,r:c};this.fe&&d&&(a.lm=d);this.fe&&e&&(a.rm=e);this.J.push(a)}};olympe.dc.transaction.qf.ya=[olympe.dc.Writable];function il(a){var b=new olympe.dc.Xa;b.Z=a;return b}function jl(a,b){b instanceof olympe.dc.Xa&&b.F.forEach((c,d)=>a.F.set(d,c));a.Ya.push(b);return b}
840
+ function kl(a,b,c,d){c=a.create(null!=c?c:olympe.dc.CloudObject,void 0);if('string'===typeof b)b=b||'',Z(c,olympe.dc.CloudObject.nameProp.X(),b);else for(const [f,g]of Object.entries(b))Z(c,f,g);b=c.X();d=null!=d?d:olympe.dc.CloudObject;const e=olympe.dc.CloudObject.extendRel.X();jl(a,new olympe.dc.transaction.Ya.yo(e,b));jl(a,new olympe.dc.transaction.Ya.jl(e,b,d));return c}
841
+ function ll(a,b){if(a.J)throw Error('Operation not permitted: this transaction has already been executed');a.J=!0;const c=[d=>{a.J=d},...a.aa,null!=b?b:()=>{}];return(d,e)=>{c.forEach(f=>f(d,e))}}
842
+ olympe.dc.Xa=class{constructor(a){this.id=null!=a?a:olympe.Y.Mc();this.Ya=[];this.G=new Map;this.Z=!0;this.F=new Map;this.aa=[];this.J=this.O=!1;this.T=[...olympe.dc.hj().Z]}U(){return this.id}model(a){let b;return null!=(b=this.G.get(olympe.dc.ga(a)))?b:olympe.dc.ia().model(a)}C(a){bl(a,this.F);for(const b of this.Ya)b.C(a);try{this.T.forEach(b=>b(a))}catch(b){throw Error(`Transaction compilation error: ${b.message}`);}}create(a,b){b=jl(this,new olympe.dc.transaction.Ya.ko(a,b));const c=b.X();this.G.set(c,
843
+ olympe.dc.ga(a));let d;this.persist(c,null!=(d=this.F.get(c))?d:this.Z);return b}persist(a,b=!0){const c=olympe.dc.ga(a);var d=olympe.dc.ia();this.F.set(c,b);if(b){let f;b=null!=(f=this.G.get(c))?f:d.model(c);if(null===b)throw Error(`Try to persist an instance that does not exist: ${c}`);var e;d=null!=(e=d.source(a))?e:olympe.dc.Zd().fromModel(b);jl(this,new olympe.dc.transaction.Ya.Zu(c,d))}else{if((e=d.Ha(c))&&d.Lf(c))throw Error(`Try to remove persistence of an instance already persisted: ${c}`);
844
+ if(!e&&!this.G.has(c))throw Error(`Try to remove persistence of an instance that does not exist and is not part of the transaction: ${c}`);}return this}delete(a,b=olympe.dc.Nb.Dc){jl(this,new olympe.dc.transaction.Ya.zo(a,b))}update(a,b,c){return jl(this,new olympe.dc.transaction.Ya.Zv(a,b,c))}Ma(a,b,c){jl(this,new olympe.dc.transaction.Ya.jl(a,b,c))}ic(a,b,c){jl(this,new olympe.dc.transaction.Ya.mt(a,b,c))}Mm(a,b){jl(this,new olympe.dc.transaction.Ya.yo(a,b))}defineProperty(a,b,c,d,e,f){d=this.create(olympe.dm.Property,
845
845
  f);Z(d,olympe.dc.CloudObject.nameProp,c||'');void 0!==e&&this.update(a,olympe.dc.Oe.Me+d.X(),e);this.Ma(olympe.dc.CloudObject.propertyRel,a,d);this.Ma(olympe.dm.Property.typeRel,d,b);this.Ma(olympe.dc.CloudObject.containsRel,a,d);return d}Cr(a,b,c='',{ED:d=olympe.dm.Relation.J.Lu,QD:e=olympe.dm.Relation.C.tq,LD:f=olympe.dm.Relation.C.Is,nE:g=olympe.dm.Relation.C.Et,BD:h=olympe.dm.Vk.NONE,mE:k=olympe.dm.Relation.O|h}={},l=olympe.Y.Mc()){c=Z(Z(Z(Z(Z(Z(Z(Z(Z(this.create(olympe.dm.Relation,l),olympe.dc.CloudObject.nameProp,
846
- c||''),olympe.dm.Relation.F,d),olympe.dm.Relation.G,k),olympe.dm.Relation.ea,e),olympe.dm.Relation.ua,e),olympe.dm.Relation.aa,e),olympe.dm.Relation.Z,f),olympe.dm.Relation.ja,g),olympe.dm.Relation.T,h);this.Ma(olympe.dc.CloudObject.mj,a,c);this.Ma(olympe.dm.Relation.destinationModelRel,c,b);this.Ma(olympe.dc.CloudObject.containsRel,a,c);return c}ah(){return!1}Fm(a){this.aa.push(olympe.D.$a().G(a))}ob(a,b){nl(olympe.dc.hj(),this,ml(this,a),b)}Nm(a){a=ml(this,a);ol(olympe.dc.hj(),this,a,!0)}toString(){return`Transaction #${this.id}`}};
847
- olympe.dc.Wa.ya=[olympe.dc.bq];function Yk(a){var b=olympe.dc.hj();const c=a.U();b.J.set(c,a);return(d,e,f)=>{const g=new olympe.dc.db.tc(c);g.Qc(d,(new Map).set(e,f),b.db.model(d));b.C.xc(hf(g,Infinity))}}
848
- function Zk(a,b,c,d){var e=olympe.dc.hj();const f=olympe.dc.Request.C.ii,g=olympe.dc.Request.C.fh,h=a.U();a=a.ah();const k=new Map;for(const l of b.keys()){const n=e.db.source(l);if(n===olympe.dc.Ra.SELF||!e.db.Lf(l))continue;let p=k.get(n);p||(p=new olympe.dc.db.tc(h),k.set(n,p));p.Qc(l,b.get(l),e.db.model(l))}for(const [l,n]of k)b=new olympe.dc.Request(c?g:f,l,new olympe.dc.transaction.Ri(n,a)),b=e.Wb.request(b).catch(p=>null==d?void 0:d(!1,`${p}`)),c&&b.then(p=>{e.C.xc(hf(n,p));null==d||d(!0)})}
849
- function nl(a,b,c,d){if(d){const e=b.U();a.F.set(e,c);ol(a,b,(f,g)=>{f||(a.F.delete(e),c(f,g))},!1)}else ol(a,b,c,!1)}function pl(a){const b=olympe.dc.Request.C.Lj;sf(a.Wb,olympe.dc.Request.C.Mn,c=>{var d=c.content;c=d.rollback;d=d.error;const e=c.U(),f=a.J.get(e);void 0!==f&&(a.J.delete(e),f.Jb(d));a.C.xc(c);a.H.warn(`Burst update (id=${e}) has been refused and is rolled back. Error: ${d}`)});sf(a.Wb,b,c=>{c=c.content;ql(a,c.id,c.finalize,c.error)})}
850
- function rl(a,b,c){c&&a.ja.has(c)||a.Z.push(b);return a}
851
- function ol(a,b,c,d=!1){const e=b.U(),f=new olympe.dc.transaction.Yu(a.db,a.ea,e);try{b.C(f)}catch(p){c(!1,p.message);return}if(f.af()){c(!0);var g;null==(g=a.F.get(e))||g(!0);a.F.delete(e)}else{a.G.set(e,[]);var h=dl(f);a.C.C.gb(h);g=h.filter(p=>bl(f,p));var k=ng(a.C,f.C,g),l=olympe.D.$a().G((p,q)=>c(null!==p,q)),n=[k,l];sl(a,f,g).then(p=>{n.splice(1,0,p);tl(a,e,h,f.F.size+1);return ul(a,f.F,d,b.ah(),b.O)}).then(p=>{n.forEach(q=>q(p));ql(a,e,olympe.dc.transaction.vf.C.Fi)}).catch(p=>{a.H.error(p);
852
- n.forEach(q=>q(null,`${p}`));vl(a,e)})}}
853
- function sl(a,b,c){const d=b.C,e=olympe.dm.File.urlProp.X();c=c.filter(n=>{let p;return a.db.Rb(n,olympe.dm.File)&&void 0!==(null==(p=d.Lc(n))?void 0:p.Sa(e))}).map(olympe.dc.CloudObject.get);if(0===c.length)return Promise.resolve(()=>{});const f=olympe.dm.File.C.X(),g=olympe.dm.File.modificationDateProp.X(),h=Array.from(b.F.values()),k=[],l=olympe.Y.Xe();return Promise.all(c.map(n=>{const p=n.get(e);if(p.startsWith('blob:'))return l.G(p).then(q=>new Promise((r,t)=>{if(null===q)URL.revokeObjectURL(p),
846
+ c||''),olympe.dm.Relation.F,d),olympe.dm.Relation.G,k),olympe.dm.Relation.ea,e),olympe.dm.Relation.ua,e),olympe.dm.Relation.aa,e),olympe.dm.Relation.Z,f),olympe.dm.Relation.ja,g),olympe.dm.Relation.T,h);this.Ma(olympe.dc.CloudObject.mj,a,c);this.Ma(olympe.dm.Relation.destinationModelRel,c,b);this.Ma(olympe.dc.CloudObject.containsRel,a,c);return c}ah(){return!1}Fm(a){this.aa.push(olympe.D.Wa().G(a))}ob(a,b){ml(olympe.dc.hj(),this,ll(this,a),b)}Nm(a){a=ll(this,a);nl(olympe.dc.hj(),this,a,!0)}toString(){return`Transaction #${this.id}`}};
847
+ olympe.dc.Xa.ya=[olympe.dc.bq];function Xk(a){var b=olympe.dc.hj();const c=a.U();b.J.set(c,a);return(d,e,f)=>{const g=new olympe.dc.db.tc(c);g.Qc(d,(new Map).set(e,f),b.db.model(d));b.C.xc(hf(g,Infinity))}}
848
+ function Yk(a,b,c,d){var e=olympe.dc.hj();const f=olympe.dc.Request.C.ii,g=olympe.dc.Request.C.fh,h=a.U();a=a.ah();const k=new Map;for(const l of b.keys()){const n=e.db.source(l);if(n===olympe.dc.Sa.SELF||!e.db.Lf(l))continue;let p=k.get(n);p||(p=new olympe.dc.db.tc(h),k.set(n,p));p.Qc(l,b.get(l),e.db.model(l))}for(const [l,n]of k)b=new olympe.dc.Request(c?g:f,l,new olympe.dc.transaction.Ri(n,a)),b=e.Wb.request(b).catch(p=>null==d?void 0:d(!1,`${p}`)),c&&b.then(p=>{e.C.xc(hf(n,p));null==d||d(!0)})}
849
+ function ml(a,b,c,d){if(d){const e=b.U();a.F.set(e,c);nl(a,b,(f,g)=>{f||(a.F.delete(e),c(f,g))},!1)}else nl(a,b,c,!1)}function ol(a){const b=olympe.dc.Request.C.Lj;sf(a.Wb,olympe.dc.Request.C.Mn,c=>{var d=c.content;c=d.rollback;d=d.error;const e=c.U(),f=a.J.get(e);void 0!==f&&(a.J.delete(e),f.Fb(d));a.C.xc(c);a.H.warn(`Burst update (id=${e}) has been refused and is rolled back. Error: ${d}`)});sf(a.Wb,b,c=>{c=c.content;pl(a,c.id,c.finalize,c.error)})}
850
+ function ql(a,b,c){c&&a.ja.has(c)||a.Z.push(b);return a}
851
+ function nl(a,b,c,d=!1){const e=b.U(),f=new olympe.dc.transaction.Yu(a.db,a.ea,e);try{b.C(f)}catch(p){c(!1,p.message);return}if(f.af()){c(!0);var g;null==(g=a.F.get(e))||g(!0);a.F.delete(e)}else{a.G.set(e,[]);var h=cl(f);a.C.C.hb(h);g=h.filter(p=>al(f,p));var k=ng(a.C,f.C,g),l=olympe.D.Wa().G((p,q)=>c(null!==p,q)),n=[k,l];rl(a,f,g).then(p=>{n.splice(1,0,p);sl(a,e,h,f.F.size+1);return tl(a,f.F,d,b.ah(),b.O)}).then(p=>{n.forEach(q=>q(p));pl(a,e,olympe.dc.transaction.vf.C.Fi)}).catch(p=>{a.H.error(p);
852
+ n.forEach(q=>q(null,`${p}`));ul(a,e)})}}
853
+ function rl(a,b,c){const d=b.C,e=olympe.dm.File.urlProp.X();c=c.filter(n=>{let p;return a.db.Rb(n,olympe.dm.File)&&void 0!==(null==(p=d.Lc(n))?void 0:p.Oa(e))}).map(olympe.dc.CloudObject.get);if(0===c.length)return Promise.resolve(()=>{});const f=olympe.dm.File.C.X(),g=olympe.dm.File.modificationDateProp.X(),h=Array.from(b.F.values()),k=[],l=olympe.Y.Xe();return Promise.all(c.map(n=>{const p=n.get(e);if(p.startsWith('blob:'))return l.G(p).then(q=>new Promise((r,t)=>{if(null===q)URL.revokeObjectURL(p),
854
854
  r();else{var u=n.X(),x,y=null!=(x=n.get(olympe.dm.File.mimeTypeProp))?x:'application/data';a.ua.ea(u,q,y,z=>{const A=h.reduce((D,O)=>D||O.Lc(u),null);null!==A&&(z=(new Map).set(e,z).set(f,!0).set(g,new Date),A.Em(z),k.push([u,z]));URL.revokeObjectURL(p);r()},t)}}));2048<p.length&&a.H.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:',n.X());return Promise.resolve([])})).then(()=>{const n=k.reduce((p,[q,r])=>{p.Qc(q,r);return p},
855
- new olympe.dc.db.tc);return ng(a.C,n)})}function tl(a,b,c,d){const e=olympe.D.Sg(),f=new olympe.async.Yj(e);0<a.T&&f.vn(a.T);const g=olympe.dc.transaction.vf.C.Hu;let h=!0;const k=a.G.get(b);for(let l=0;l<d;l++)f.add((n,p)=>{k.push(e.G((q,r)=>{h&&(h=q!==g);r?p(r):n()}))});Tc(f,(l,n)=>{l||a.H.warn(`An error occurred while processing the notification of transaction (${b}): ${n}.`);h&&a.C.C.Jb(c);vl(a,b)});f.start()}
856
- function ul(a,b,c,d,e){if(c&&olympe.D.Na(a.aa.F)!==olympe.auth.Ta.C.df)return Promise.reject('Cannot persist with batch transactions API if not authenticated (aka: `Transaction.executeAsLarge()`).');const f=c?olympe.dc.Request.C.Mg:olympe.dc.Request.C.Ue;return Promise.all(Array.from(b).map(([g,h])=>{g=new olympe.dc.Request(f,g,new olympe.dc.transaction.Ri(h,d,e));return a.Wb.request(g)})).then(g=>g[0])}
857
- function ql(a,b,c,d){let e,f;null==(f=null==(e=a.G.get(b))?void 0:e.pop())||f(c,null!=d?d:null)}function vl(a,b){var c;null==(c=a.G.get(b))||c.forEach(d=>{d(olympe.dc.transaction.vf.C.Fi,null)});a.G.delete(b);if(0===a.G.size){for(const d of a.O)d();a.O=[]}a.F.has(b)&&(c=a.F.get(b),a.F.delete(b),c(!0))}function wl(a,b){if(0<a.G.size){const c=olympe.D.$a();a.O.push(()=>{!c.eb()&&c.run(b)})}else b()}
858
- olympe.dc.transaction.vf=class{constructor(a,b,c,d,e,f,g){this.H=a;this.C=b;this.db=b.view;this.Wb=c;this.ea=d;this.ua=e;this.aa=f;this.T=g.get('notificationTimeout');this.Z=[];let h;this.ja=new Set(null!=(h=g.get('disabledCompilers'))?h:[]);this.J=new olympe.Y.Hh(g.get('burstHoldTime'));this.G=new Map;this.O=[];this.F=new Map;this.Ga=new olympe.Y.promise.nm;pl(this)}ke(a){hb(this.Ga,()=>this.Wb.request(new olympe.dc.Request(olympe.dc.Request.C.Vo,olympe.dc.Ra.SERVER)).then(b=>{a(b.ids,b.undo_stack_size,
855
+ new olympe.dc.db.tc);return ng(a.C,n)})}function sl(a,b,c,d){const e=olympe.D.Sg(),f=new olympe.async.Yj(e);0<a.T&&f.vn(a.T);const g=olympe.dc.transaction.vf.C.Hu;let h=!0;const k=a.G.get(b);for(let l=0;l<d;l++)f.add((n,p)=>{k.push(e.G((q,r)=>{h&&(h=q!==g);r?p(r):n()}))});Tc(f,(l,n)=>{l||a.H.warn(`An error occurred while processing the notification of transaction (${b}): ${n}.`);h&&a.C.C.Fb(c);ul(a,b)});f.start()}
856
+ function tl(a,b,c,d,e){if(c&&olympe.D.Na(a.aa.F)!==olympe.auth.Ta.C.df)return Promise.reject('Cannot persist with batch transactions API if not authenticated (aka: `Transaction.executeAsLarge()`).');const f=c?olympe.dc.Request.C.Mg:olympe.dc.Request.C.Ue;return Promise.all(Array.from(b).map(([g,h])=>{g=new olympe.dc.Request(f,g,new olympe.dc.transaction.Ri(h,d,e));return a.Wb.request(g)})).then(g=>g[0])}
857
+ function pl(a,b,c,d){let e,f;null==(f=null==(e=a.G.get(b))?void 0:e.pop())||f(c,null!=d?d:null)}function ul(a,b){var c;null==(c=a.G.get(b))||c.forEach(d=>{d(olympe.dc.transaction.vf.C.Fi,null)});a.G.delete(b);if(0===a.G.size){for(const d of a.O)d();a.O=[]}a.F.has(b)&&(c=a.F.get(b),a.F.delete(b),c(!0))}function vl(a,b){if(0<a.G.size){const c=olympe.D.Wa();a.O.push(()=>{!c.fb()&&c.run(b)})}else b()}
858
+ olympe.dc.transaction.vf=class{constructor(a,b,c,d,e,f,g){this.H=a;this.C=b;this.db=b.view;this.Wb=c;this.ea=d;this.ua=e;this.aa=f;this.T=g.get('notificationTimeout');this.Z=[];let h;this.ja=new Set(null!=(h=g.get('disabledCompilers'))?h:[]);this.J=new olympe.Y.Hh(g.get('burstHoldTime'));this.G=new Map;this.O=[];this.F=new Map;this.Ga=new olympe.Y.promise.nm;ol(this)}ke(a){hb(this.Ga,()=>this.Wb.request(new olympe.dc.Request(olympe.dc.Request.C.Vo,olympe.dc.Sa.SERVER)).then(b=>{a(b.ids,b.undo_stack_size,
859
859
  b.redo_stack_size)}).catch(b=>this.H.error('Failed to process get stack request',b))).then(()=>{})}};olympe.dc.transaction.vf.C={Pl:0,Fi:1,Hu:2};olympe.dc.transaction.Ri=class{constructor(a,b=!1,c=!1){this.F=a;this.G=b;this.C=c}ah(){return this.G}qc(){return this.F}};olympe.dc.transaction.R={Ca:'dc.transaction.Logger',Ea:'dc.transaction.Manager'};olympe.dc.transaction.V={Mp:'dc.transaction.timeout',Ln:'dc.transaction.burstInterval',uo:'dc.transaction.disabledCompilers'};
860
860
  olympe.W.config(function(a){F(a,olympe.dc.transaction.V.Mp,9E4);F(a,olympe.dc.transaction.V.Ln,30);F(a,olympe.dc.transaction.V.uo,[]);E(a,olympe.dc.transaction.R.Ca,[olympe.ka.R.Ea],b=>b.Vc('dc'));E(a,'olympe.dc.transaction.Config',[new olympe.W.oa(olympe.dc.transaction.V.Mp),new olympe.W.oa(olympe.dc.transaction.V.uo),new olympe.W.oa(olympe.dc.db.V.fl)],(b,c,d)=>new Map([['notificationTimeout',b],['disabledCompilers',c],['burstHoldTime',d]]));C(a,olympe.dc.transaction.R.Ea,olympe.dc.transaction.vf,
861
- olympe.dc.transaction.R.Ca,olympe.dc.db.R.Ea,olympe.dc.R.Dg,olympe.dc.sources.R.Re,olympe.dc.R.Jj,olympe.auth.R.Ea,'olympe.dc.transaction.Config')},'olympe.dc.transaction');olympe.dc.transaction.Xa={};function xl(a,b){const c=new Map;for(const [d,e]of b)c.set(d,a.Na(e));return c}olympe.dc.transaction.Xa.lg=class{constructor(){this.ia=olympe.dc.ia()}C(){throw Error('Abstract method build() not override !');}toString(){throw Error('Abstract method toString() not override !');}Na(a){a=olympe.D.Na(a);return void 0===a||null===a?null:olympe.D.Yr(a)?a.valueOf():a}};olympe.dc.transaction.Xa.lg.ya=[olympe.dc.bq];olympe.dc.transaction.Xa.En=class extends olympe.dc.transaction.Xa.lg{constructor(a,b){super();this.relation=a instanceof olympe.dc.Oa.Relation?a:new olympe.dc.Oa.Relation(olympe.dc.ga(a));this.origin=this.ia.Ha(b)?olympe.dc.CloudObject.get(b):b}getType(){return this.relation.X()}Ia(){return this.relation.Ia()}C(){throw Error('Abstract method build() not override !');}toString(){throw Error('Abstract method toString() not override !');}};function Z(a,b,c){a.Dd.set(olympe.dc.ga(b),c);return a}olympe.dc.transaction.Xa.ko=class extends olympe.dc.transaction.Xa.lg{constructor(a,b){super();let c;this.tag=null!=(c=b&&olympe.dc.ga(b))?c:olympe.Y.Cf();this.model=olympe.dc.ga(a);this.source=null;this.Dd=new Map}X(){return this.tag}cc(){return this.model}ci(a){this.source=a;return this}C(a){const b=this.cc(),c=this.X();if(!b)throw Error('OperationError: Cannot create instance, model tag is undefined');a.$c(c,b,this.source,xl(this,this.Dd))}toString(){return`CreateInstance(${this.cc()}, ${this.X()})`}};
862
- olympe.dc.transaction.Xa.ko.ya=[olympe.dc.Ne];olympe.dc.transaction.Xa.jl=class extends olympe.dc.transaction.Xa.En{constructor(a,b,c){super(a,b);this.F=this.ia.Ha(c)?olympe.dc.CloudObject.get(c):c}C(a){const b=this.getType();if(''===b)throw Error('OperationError: Cannot create relation, type is undefined, null or empty string');if(b===olympe.dc.nc.Yc)throw Error('OperationError: Cannot create the instance -> model relation');if(!this.origin)throw Error('OperationError: Cannot create relation, origin tag is undefined, null or empty string');
863
- if(!this.F)throw Error('OperationError: Cannot create relation, destination tag is undefined, null or empty string');this.relation.Ia()===olympe.dc.wa.DESTINATION?a.Ma(b,olympe.dc.ga(this.origin),olympe.dc.ga(this.F)):a.Ma(b,olympe.dc.ga(this.F),olympe.dc.ga(this.origin))}toString(){return`CreateRelation('${this.relation.Ia()}${this.relation.X()}, ${olympe.dc.ga(this.origin)}, ${olympe.dc.ga(this.F)})`}};olympe.dc.transaction.Xa.Wz=class extends olympe.dc.transaction.Xa.lg{constructor(a,b=olympe.dc.Nb.Dc){super();this.model=a instanceof olympe.dc.CloudObject?a:olympe.dc.CloudObject.get(a);this.Ob=b}C(a){for(const b of this.ia.ad(this.model))b!==olympe.dc.ga(this.model)&&(new olympe.dc.transaction.Xa.zo(b,this.Ob)).C(a)}toString(){return`DeleteAllInstances(${this.model.X()}, ${this.Ob})`}};olympe.dc.transaction.Xa.yo=class extends olympe.dc.transaction.Xa.En{C(a){const b=this.getType();if(void 0===b)throw Error('OperationError: Cannot delete relation, type is undefined');if(b===olympe.dc.nc.Yc)throw Error('OperationError: Cannot delete the instance -> model relation');const c=olympe.dc.ga(this.origin);if(!this.origin)throw Error('OperationError: Cannot delete relation, left tag is undefined');const d=this.Ia(),e=this.ia.bb(c,this.relation);for(const f of e)d===olympe.dc.wa.DESTINATION?
864
- a.ic(b,c,f):a.ic(b,f,c)}toString(){return`DeleteAllRelations(${this.Ia()}${this.getType()})`}};olympe.dc.transaction.Xa.zo=class extends olympe.dc.transaction.Xa.lg{constructor(a,b=olympe.dc.Nb.Dc){super();this.tag=this.ia.Ha(a)?olympe.dc.CloudObject.get(a):a;this.Ob=b}X(){return olympe.dc.ga(this.tag)}C(a){const b=this.X();if(void 0===b)throw Error('OperationError: Cannot delete instance, tag is undefined');this.ia.Ha(b)&&fl(a,b,this.Ob)}toString(){return'DeleteInstance('+this.X()+', '+this.Ob+')'}};olympe.dc.transaction.Xa.mt=class extends olympe.dc.transaction.Xa.jl{C(a){const b=this.relation.X();if(void 0===b)throw Error('OperationError: Cannot delete relation, type is undefined');if(b===olympe.dc.nc.Yc)throw Error('OperationError: Cannot delete the instance -> model relation');const c=olympe.dc.ga(this.origin);if(void 0===c)throw Error('OperationError: Cannot delete relation, left tag is undefined');const d=olympe.dc.ga(this.F);if(void 0===d)throw Error('OperationError: Cannot delete relation, right tag is undefined');
865
- this.relation.Ia()===olympe.dc.wa.DESTINATION?a.ic(b,c,d):a.ic(b,d,c)}toString(){return'DeleteRelation('+this.relation.Ia()+this.relation.X()+', '+olympe.dc.ga(this.origin)+', '+olympe.dc.ga(this.F)+')'}};olympe.dc.transaction.Xa.Zv=class extends olympe.dc.transaction.Xa.lg{constructor(a,b,c){super();this.tag=this.ia.Ha(a)?olympe.dc.CloudObject.get(a):a;this.Dd=new Map;void 0!==b&&this.Dd.set(olympe.dc.ga(b),c)}X(){return olympe.dc.ga(this.tag)}C(a){const b=this.X();if(void 0===b)throw Error('OperationError: Cannot update instance, tag is undefined');var c;if(!(null!=(c=a.C.Lc(b))&&c.F()||this.ia.Ha(b)))throw Error('OperationError: Instance #'+b+' not found so it cannot be updated');c=xl(this,this.Dd);
866
- for(const [e,f]of c){var d=this.ia.Sa(b,e,!0);d instanceof olympe.dc.uc&&fl(a,d.X(),olympe.dc.Nb.Dc);f instanceof olympe.dc.uc&&!bl(a,f.X())&&(d=new olympe.dc.Wa,d.persist(f.X()),d.C(a))}a.Qc(b,c)}toString(){return'UpdateInstance('+this.X()+', '+xl(this,this.Dd)+')'}};olympe.dc.transaction.Xa.Zu=class a extends olympe.dc.transaction.Xa.lg{constructor(b,c){super();this.tag=b;this.source=c}C(b){const c=olympe.dc.ia();if(bl(b,this.tag)&&c.Ha(this.tag)&&!c.Lf(this.tag)){const e=c.Cb(this.tag,!0);var d;let f;null==(f=null==(d=b.C.Lc(this.tag))?void 0:d.Cb())||f.forEach((g,h)=>{e.set(h,g)});for(const g of e.values())g instanceof olympe.dc.uc&&c.Ha(g.X())&&(new a(g.X(),this.source)).C(b);d=c.model(this.tag);b.$c(this.tag,d,this.source,e);for(const [g,h,k]of Pg(c,this.tag))bl(b,
861
+ olympe.dc.transaction.R.Ca,olympe.dc.db.R.Ea,olympe.dc.R.Dg,olympe.dc.sources.R.Re,olympe.dc.R.Jj,olympe.auth.R.Ea,'olympe.dc.transaction.Config')},'olympe.dc.transaction');olympe.dc.transaction.Ya={};function wl(a,b){const c=new Map;for(const [d,e]of b)c.set(d,a.Na(e));return c}olympe.dc.transaction.Ya.lg=class{constructor(){this.ia=olympe.dc.ia()}C(){throw Error('Abstract method build() not override !');}toString(){throw Error('Abstract method toString() not override !');}Na(a){a=olympe.D.Na(a);return void 0===a||null===a?null:olympe.D.Yr(a)?a.valueOf():a}};olympe.dc.transaction.Ya.lg.ya=[olympe.dc.bq];olympe.dc.transaction.Ya.En=class extends olympe.dc.transaction.Ya.lg{constructor(a,b){super();this.relation=a instanceof olympe.dc.Pa.Relation?a:new olympe.dc.Pa.Relation(olympe.dc.ga(a));this.origin=this.ia.Ha(b)?olympe.dc.CloudObject.get(b):b}getType(){return this.relation.X()}Ia(){return this.relation.Ia()}C(){throw Error('Abstract method build() not override !');}toString(){throw Error('Abstract method toString() not override !');}};function Z(a,b,c){a.Dd.set(olympe.dc.ga(b),c);return a}olympe.dc.transaction.Ya.ko=class extends olympe.dc.transaction.Ya.lg{constructor(a,b){super();let c;this.tag=null!=(c=b&&olympe.dc.ga(b))?c:olympe.Y.Cf();this.model=olympe.dc.ga(a);this.source=null;this.Dd=new Map}X(){return this.tag}cc(){return this.model}ci(a){this.source=a;return this}C(a){const b=this.cc(),c=this.X();if(!b)throw Error('OperationError: Cannot create instance, model tag is undefined');a.$c(c,b,this.source,wl(this,this.Dd))}toString(){return`CreateInstance(${this.cc()}, ${this.X()})`}};
862
+ olympe.dc.transaction.Ya.ko.ya=[olympe.dc.Ne];olympe.dc.transaction.Ya.jl=class extends olympe.dc.transaction.Ya.En{constructor(a,b,c){super(a,b);this.F=this.ia.Ha(c)?olympe.dc.CloudObject.get(c):c}C(a){const b=this.getType();if(''===b)throw Error('OperationError: Cannot create relation, type is undefined, null or empty string');if(b===olympe.dc.nc.Yc)throw Error('OperationError: Cannot create the instance -> model relation');if(!this.origin)throw Error('OperationError: Cannot create relation, origin tag is undefined, null or empty string');
863
+ if(!this.F)throw Error('OperationError: Cannot create relation, destination tag is undefined, null or empty string');this.relation.Ia()===olympe.dc.wa.DESTINATION?a.Ma(b,olympe.dc.ga(this.origin),olympe.dc.ga(this.F)):a.Ma(b,olympe.dc.ga(this.F),olympe.dc.ga(this.origin))}toString(){return`CreateRelation('${this.relation.Ia()}${this.relation.X()}, ${olympe.dc.ga(this.origin)}, ${olympe.dc.ga(this.F)})`}};olympe.dc.transaction.Ya.Wz=class extends olympe.dc.transaction.Ya.lg{constructor(a,b=olympe.dc.Nb.Dc){super();this.model=a instanceof olympe.dc.CloudObject?a:olympe.dc.CloudObject.get(a);this.Ob=b}C(a){for(const b of this.ia.ad(this.model))b!==olympe.dc.ga(this.model)&&(new olympe.dc.transaction.Ya.zo(b,this.Ob)).C(a)}toString(){return`DeleteAllInstances(${this.model.X()}, ${this.Ob})`}};olympe.dc.transaction.Ya.yo=class extends olympe.dc.transaction.Ya.En{C(a){const b=this.getType();if(void 0===b)throw Error('OperationError: Cannot delete relation, type is undefined');if(b===olympe.dc.nc.Yc)throw Error('OperationError: Cannot delete the instance -> model relation');const c=olympe.dc.ga(this.origin);if(!this.origin)throw Error('OperationError: Cannot delete relation, left tag is undefined');const d=this.Ia(),e=this.ia.cb(c,this.relation);for(const f of e)d===olympe.dc.wa.DESTINATION?
864
+ a.ic(b,c,f):a.ic(b,f,c)}toString(){return`DeleteAllRelations(${this.Ia()}${this.getType()})`}};olympe.dc.transaction.Ya.zo=class extends olympe.dc.transaction.Ya.lg{constructor(a,b=olympe.dc.Nb.Dc){super();this.tag=this.ia.Ha(a)?olympe.dc.CloudObject.get(a):a;this.Ob=b}X(){return olympe.dc.ga(this.tag)}C(a){const b=this.X();if(void 0===b)throw Error('OperationError: Cannot delete instance, tag is undefined');this.ia.Ha(b)&&el(a,b,this.Ob)}toString(){return'DeleteInstance('+this.X()+', '+this.Ob+')'}};olympe.dc.transaction.Ya.mt=class extends olympe.dc.transaction.Ya.jl{C(a){const b=this.relation.X();if(void 0===b)throw Error('OperationError: Cannot delete relation, type is undefined');if(b===olympe.dc.nc.Yc)throw Error('OperationError: Cannot delete the instance -> model relation');const c=olympe.dc.ga(this.origin);if(void 0===c)throw Error('OperationError: Cannot delete relation, left tag is undefined');const d=olympe.dc.ga(this.F);if(void 0===d)throw Error('OperationError: Cannot delete relation, right tag is undefined');
865
+ this.relation.Ia()===olympe.dc.wa.DESTINATION?a.ic(b,c,d):a.ic(b,d,c)}toString(){return'DeleteRelation('+this.relation.Ia()+this.relation.X()+', '+olympe.dc.ga(this.origin)+', '+olympe.dc.ga(this.F)+')'}};olympe.dc.transaction.Ya.Zv=class extends olympe.dc.transaction.Ya.lg{constructor(a,b,c){super();this.tag=this.ia.Ha(a)?olympe.dc.CloudObject.get(a):a;this.Dd=new Map;void 0!==b&&this.Dd.set(olympe.dc.ga(b),c)}X(){return olympe.dc.ga(this.tag)}C(a){const b=this.X();if(void 0===b)throw Error('OperationError: Cannot update instance, tag is undefined');var c;if(!(null!=(c=a.C.Lc(b))&&c.F()||this.ia.Ha(b)))throw Error('OperationError: Instance #'+b+' not found so it cannot be updated');c=wl(this,this.Dd);
866
+ for(const [e,f]of c){var d=this.ia.Oa(b,e,!0);d instanceof olympe.dc.uc&&el(a,d.X(),olympe.dc.Nb.Dc);f instanceof olympe.dc.uc&&!al(a,f.X())&&(d=new olympe.dc.Xa,d.persist(f.X()),d.C(a))}a.Qc(b,c)}toString(){return'UpdateInstance('+this.X()+', '+wl(this,this.Dd)+')'}};olympe.dc.transaction.Ya.Zu=class a extends olympe.dc.transaction.Ya.lg{constructor(b,c){super();this.tag=b;this.source=c}C(b){const c=olympe.dc.ia();if(al(b,this.tag)&&c.Ha(this.tag)&&!c.Lf(this.tag)){const e=c.Cb(this.tag,!0);var d;let f;null==(f=null==(d=b.C.Lc(this.tag))?void 0:d.Cb())||f.forEach((g,h)=>{e.set(h,g)});for(const g of e.values())g instanceof olympe.dc.uc&&c.Ha(g.X())&&(new a(g.X(),this.source)).C(b);d=c.model(this.tag);b.$c(this.tag,d,this.source,e);for(const [g,h,k]of Pg(c,this.tag))al(b,
867
867
  k)&&(h===olympe.dc.wa.ORIGIN?b.Ma(g,k,this.tag):b.Ma(g,this.tag,k))}}toString(){return`PersistOperation: tag - ${this.tag}, src - ${this.source}`}};olympe.dc.ga=function(a){let b=null;if('string'===typeof a)return a;if('function'===typeof(null==a?void 0:a.X)&&(null==a||!a.Og))b=a.X();else if('function'===typeof a){let d;b=null!=(d=olympe.dc.na.cc(a))?d:''}else if(olympe.D.bf(a)){let d;b=olympe.dc.ga(null==(d=olympe.D.Na(a))?void 0:d.valueOf())}let c;return null!=(c=b)?c:''};w('olympe.dc.instanceToTag',olympe.dc.ga);olympe.dc.ia=function(){return olympe.dc.Jr().view};olympe.dc.register=function(a,b){olympe.dc.na.C(a,b)};
868
- olympe.dc.defineProperty=function(a){return new olympe.dc.Oa.Property(a)};olympe.dc.Cr=function(a,b=olympe.dc.wa.DESTINATION,c=olympe.dc.CloudObject,d=olympe.dc.wa.DESTINATION){const e=olympe.dc.wa.DESTINATION;return b===olympe.dc.wa.ORIGIN||b===e?new olympe.dc.Oa.Relation(a,b):new olympe.dc.Oa.Relation(a,d,b,c)};olympe.dc.Ew=function(a){return a.bc()};olympe.dc.nb={};olympe.dc.nb.Km=a=>'string'===typeof a||'number'===typeof a||'boolean'===typeof a||a instanceof String?olympe.D.Ab(a):a instanceof olympe.D.Pa?a:null;olympe.dc.nb.Hm=a=>'boolean'===typeof a||a instanceof Boolean?olympe.D.Sb(a):a instanceof olympe.D.fa?a:null;olympe.dc.nb.Jm=a=>'number'===typeof a||a instanceof Number?olympe.D.ra(a):'string'===typeof a||a instanceof String?olympe.D.ra(Number.parseFloat(a.valueOf())):a instanceof olympe.D.ba?a:null;
869
- olympe.dc.nb.Im=a=>'number'===typeof a||a instanceof Number?Zb(a.valueOf()):'string'===typeof a||a instanceof String?new olympe.D.fb(new Date(a.valueOf().valueOf())):a instanceof Date?new olympe.D.fb(a):a instanceof olympe.D.fb?a:null;olympe.dc.nb.xr=function(a){return a instanceof olympe.D.Color?a:'string'===typeof a||a instanceof String?cc(a.valueOf()):null};olympe.dc.nb.yr=a=>a instanceof olympe.dc.CloudObject?a:a instanceof olympe.dc.uc?olympe.dc.CloudObject.get(a.tag):null;
868
+ olympe.dc.defineProperty=function(a){return new olympe.dc.Pa.Property(a)};olympe.dc.Cr=function(a,b=olympe.dc.wa.DESTINATION,c=olympe.dc.CloudObject,d=olympe.dc.wa.DESTINATION){const e=olympe.dc.wa.DESTINATION;return b===olympe.dc.wa.ORIGIN||b===e?new olympe.dc.Pa.Relation(a,b):new olympe.dc.Pa.Relation(a,d,b,c)};olympe.dc.Ew=function(a){return a.bc()};olympe.dc.nb={};olympe.dc.nb.Km=a=>'string'===typeof a||'number'===typeof a||'boolean'===typeof a||a instanceof String?olympe.D.Ab(a):a instanceof olympe.D.Qa?a:null;olympe.dc.nb.Hm=a=>'boolean'===typeof a||a instanceof Boolean?olympe.D.Sb(a):a instanceof olympe.D.fa?a:null;olympe.dc.nb.Jm=a=>'number'===typeof a||a instanceof Number?olympe.D.ra(a):'string'===typeof a||a instanceof String?olympe.D.ra(Number.parseFloat(a.valueOf())):a instanceof olympe.D.ba?a:null;
869
+ olympe.dc.nb.Im=a=>'number'===typeof a||a instanceof Number?Zb(a.valueOf()):'string'===typeof a||a instanceof String?new olympe.D.gb(new Date(a.valueOf().valueOf())):a instanceof Date?new olympe.D.gb(a):a instanceof olympe.D.gb?a:null;olympe.dc.nb.xr=function(a){return a instanceof olympe.D.Color?a:'string'===typeof a||a instanceof String?cc(a.valueOf()):null};olympe.dc.nb.yr=a=>a instanceof olympe.dc.CloudObject?a:a instanceof olympe.dc.uc?olympe.dc.CloudObject.get(a.tag):null;
870
870
  olympe.dc.nb.Zi=a=>a instanceof olympe.dc.uc?olympe.dc.CloudObject.get(a.tag):a;olympe.dc.nb.Ac=a=>{a=a instanceof olympe.dc.uc?olympe.dc.CloudObject.get(a.tag):a;let b;return null!=(b=a instanceof olympe.dc.CloudObject?a.Ac():a)?b:null};
871
- olympe.dc.nb.Yw=a=>{switch(a){case olympe.D.fa:return olympe.dc.nb.Hm;case olympe.D.Pa:return olympe.dc.nb.Km;case olympe.D.ba:return olympe.dc.nb.Jm;case olympe.D.fb:return olympe.dc.nb.Im;case olympe.D.Color:return olympe.dc.nb.xr;case olympe.dc.CloudObject:return olympe.dc.nb.yr;default:return olympe.dc.nb.Zi}};olympe.dc.kc={};olympe.dc.gf=class{ma(){}G(){}compare(){}J(){}ha(){}toString(){}};function yl(a){let b=null;for(a=[...a.da];null===b&&0<a.length;)b=a.pop().Mb();return b}function zl(a,b){a.T()||(a=`Calling "${b}" on subscription with id ${a.U()} while it is not ready (thus no data is available).`+'This call should be made within an onReady callback. You can also consider to use Queries API instead of ListDefs (which are deprecated)',olympe.ka.ib('dc').warn(a))}
872
- olympe.dc.za=class{constructor(a,b,c){void 0===a||null===a?olympe.ka.ib('dc').warn('attempt to create a listdef with a null or undefind basetag. This listdef is thus without effect.'):(this.F=olympe.D.va([a],olympe.dc.ga,String),this.da=void 0!==b&&(Array.isArray(b)?b:[b])||[],this.valueType=c||yl(this),this.C=null,this.zc=void 0)}je(){return olympe.dc.je()}ob(){if(null===this.C){const a=olympe.dc.kc.zx();this.C=Al(a,this,this.zc);null!==this.valueType&&this.C.Hd(this.valueType);olympe.D.$a().Z(()=>
871
+ olympe.dc.nb.Yw=a=>{switch(a){case olympe.D.fa:return olympe.dc.nb.Hm;case olympe.D.Qa:return olympe.dc.nb.Km;case olympe.D.ba:return olympe.dc.nb.Jm;case olympe.D.gb:return olympe.dc.nb.Im;case olympe.D.Color:return olympe.dc.nb.xr;case olympe.dc.CloudObject:return olympe.dc.nb.yr;default:return olympe.dc.nb.Zi}};olympe.dc.kc={};olympe.dc.gf=class{ma(){}G(){}compare(){}J(){}ha(){}toString(){}};function xl(a){let b=null;for(a=[...a.da];null===b&&0<a.length;)b=a.pop().Mb();return b}function yl(a,b){a.T()||(a=`Calling "${b}" on subscription with id ${a.U()} while it is not ready (thus no data is available).`+'This call should be made within an onReady callback. You can also consider to use Queries API instead of ListDefs (which are deprecated)',olympe.ka.ab('dc').warn(a))}
872
+ olympe.dc.za=class{constructor(a,b,c){void 0===a||null===a?olympe.ka.ab('dc').warn('attempt to create a listdef with a null or undefind basetag. This listdef is thus without effect.'):(this.F=olympe.D.va([a],olympe.dc.ga,String),this.da=void 0!==b&&(Array.isArray(b)?b:[b])||[],this.valueType=c||xl(this),this.C=null,this.zc=void 0)}je(){return olympe.dc.je()}ob(){if(null===this.C){const a=olympe.dc.kc.zx();this.C=zl(a,this,this.zc);null!==this.valueType&&this.C.Hd(this.valueType);olympe.D.Wa().Z(()=>
873
873
  {var b=this.C.U();a.H.debug('QueryMGR: [ID:',b,'] - Unregistered');const c=a.C.get(b);if(null==c)var d=0;else 0<c.counter&&c.counter--,d=0===c.counter;d&&(c.C.release(),a.C.delete(b));this.C=null})}return this}mc(){null===this.C&&this.ob();return this.C}Hd(a){this.valueType=a;null!==this.C&&this.C.Hd(this.valueType)}Mb(){return null!==this.C?this.C.Mb():null===this.valueType?olympe.dc.CloudObject:this.valueType}Wd(){return this.F}Hl(){return this.da}Bd(a,b){return this.mc().Bd(a,b)}Mk(a){this.mc().Mk(a)}Yt(){return this.mc().Tc()}Xt(){return this.mc().T()}get(a){return this.mc().get(a)}Zh(){return this.mc().Zh()}Xh(a){const b=
874
- this.mc();zl(b,'getCurrent');return b.Xh(a)}has(a){return this.mc().has(a)}Zg(a){const b=this.mc();zl(b,'hasCurrent');return b.Zg(a)}ie(a){return this.mc().ie(a)}Cy(a){return this.ie(a).asObservable()}Ze(a){const b=this.mc();zl(b,'getCurrentAt');return b.Ze(a)}$e(a){return this.mc().$e(a)}Ef(a){const b=this.mc();zl(b,'getCurrentKeyAt');return b.Ef(a)}xd(a){return this.mc().xd(a)}Hy(a){return this.xd(a).asObservable()}Ff(a){const b=this.mc();zl(b,'getCurrentRank');return b.Ff(a)}Fc(){return this.mc().Fc()}Dy(){return this.Fc().asObservable()}Gf(){return this.mc().Gf()}mf(){return this.mc().mf()}Iy(){return this.mf().asObservable()}fg(){const a=
875
- this.mc();zl(a,'getCurrentSize');return a.fg()}forEach(a,b){this.mc().forEach(a,b)}he(a){const b=this.mc();zl(b,'forEachCurrentValue');return b.he(a)}bj(a,b,c,d){a=new olympe.dc.da.uh(a,b);(new olympe.dc.za(this.F,[...this.da,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.da];for(const c of b){if(void 0===c)throw Error('ListDef.transform(): Trying to set an undefined transformer');
876
- if(c instanceof olympe.dc.Oa.Property)throw Error(`ListDef.transform(): Properties cannot be used as transformer, unlike relations ${c}`);if(!c||'function'!==typeof c.C)break;a.push(c)}b=new olympe.dc.za(this.F,a);b.zc=this.zc;b.Hd(yl(b)||this.valueType||Object);return b}Rk(a){return this.transform(new olympe.dc.da.xf(a))}filter(a){return this.transform(new olympe.dc.da.jf(a))}uk(){const a=new olympe.dc.Qj(this.F,null===this.valueType?void 0:this.valueType);'boolean'===typeof this.zc&&(a.zc=this.zc);
877
- let b=this.da;b instanceof Array||(b=b?[b]:[]);a.transform(b);return a}toString(){let a=this.da;a=a?', '+(a.join?a.join(', '):a.toString()):'';return'ListDef(#'+olympe.D.Na(this.F)+a+')'}Wt(){return this.mc().vg()}Oc(){return olympe.D.va([this.mf()],a=>{let b='[';for(let c=0;c<a;c++){const d=this.Ze(c).toString();b=0<c&&c<a?b+(', '+d):b+d}return olympe.D.Ab(b+']')},olympe.D.Pa)}};olympe.dc.za.prototype.filter=olympe.dc.za.prototype.filter;olympe.dc.za.prototype.union=olympe.dc.za.prototype.Rk;
874
+ this.mc();yl(b,'getCurrent');return b.Xh(a)}has(a){return this.mc().has(a)}Zg(a){const b=this.mc();yl(b,'hasCurrent');return b.Zg(a)}ie(a){return this.mc().ie(a)}Cy(a){return this.ie(a).asObservable()}Ze(a){const b=this.mc();yl(b,'getCurrentAt');return b.Ze(a)}$e(a){return this.mc().$e(a)}Ef(a){const b=this.mc();yl(b,'getCurrentKeyAt');return b.Ef(a)}xd(a){return this.mc().xd(a)}Hy(a){return this.xd(a).asObservable()}Ff(a){const b=this.mc();yl(b,'getCurrentRank');return b.Ff(a)}Fc(){return this.mc().Fc()}Dy(){return this.Fc().asObservable()}Gf(){return this.mc().Gf()}mf(){return this.mc().mf()}Iy(){return this.mf().asObservable()}fg(){const a=
875
+ this.mc();yl(a,'getCurrentSize');return a.fg()}forEach(a,b){this.mc().forEach(a,b)}he(a){const b=this.mc();yl(b,'forEachCurrentValue');return b.he(a)}bj(a,b,c,d){a=new olympe.dc.da.uh(a,b);(new olympe.dc.za(this.F,[...this.da,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.da];for(const c of b){if(void 0===c)throw Error('ListDef.transform(): Trying to set an undefined transformer');
876
+ if(c instanceof olympe.dc.Pa.Property)throw Error(`ListDef.transform(): Properties cannot be used as transformer, unlike relations ${c}`);if(!c||'function'!==typeof c.C)break;a.push(c)}b=new olympe.dc.za(this.F,a);b.zc=this.zc;b.Hd(xl(b)||this.valueType||Object);return b}Rk(a){return this.transform(new olympe.dc.da.xf(a))}filter(a){return this.transform(new olympe.dc.da.jf(a))}uk(){const a=new olympe.dc.Qj(this.F,null===this.valueType?void 0:this.valueType);'boolean'===typeof this.zc&&(a.zc=this.zc);
877
+ let b=this.da;b instanceof Array||(b=b?[b]:[]);a.transform(b);return a}toString(){let a=this.da;a=a?', '+(a.join?a.join(', '):a.toString()):'';return'ListDef(#'+olympe.D.Na(this.F)+a+')'}Wt(){return this.mc().vg()}Oc(){return olympe.D.va([this.mf()],a=>{let b='[';for(let c=0;c<a;c++){const d=this.Ze(c).toString();b=0<c&&c<a?b+(', '+d):b+d}return olympe.D.Ab(b+']')},olympe.D.Qa)}};olympe.dc.za.prototype.filter=olympe.dc.za.prototype.filter;olympe.dc.za.prototype.union=olympe.dc.za.prototype.Rk;
878
878
  olympe.dc.za.prototype.transform=olympe.dc.za.prototype.transform;olympe.dc.za.prototype.forEachCurrentValue=olympe.dc.za.prototype.he;olympe.dc.za.prototype.forEach=olympe.dc.za.prototype.forEach;olympe.dc.za.prototype.getCurrentSize=olympe.dc.za.prototype.fg;olympe.dc.za.prototype.observeSize=olympe.dc.za.prototype.Iy;olympe.dc.za.prototype.observeFirst=olympe.dc.za.prototype.Dy;olympe.dc.za.prototype.getCurrentRank=olympe.dc.za.prototype.Ff;olympe.dc.za.prototype.observeRank=olympe.dc.za.prototype.Hy;
879
879
  olympe.dc.za.prototype.getCurrentAt=olympe.dc.za.prototype.Ze;olympe.dc.za.prototype.observeAt=olympe.dc.za.prototype.Cy;olympe.dc.za.prototype.offReady=olympe.dc.za.prototype.Mk;olympe.dc.za.prototype.onReady=olympe.dc.za.prototype.Bd;olympe.dc.za.prototype.getBaseTag=olympe.dc.za.prototype.Wd;olympe.dc.za.ya=[olympe.D.kd];m=olympe.dc.za.prototype;m.je.L=olympe.D.K.C;m.ob.L=olympe.D.K.J();m.mc.L=new olympe.D.K(()=>olympe.dc.kc.Subscription,[]);m.Hd.L=new olympe.D.K(()=>{},[]);
880
880
  m.Wd.L=new olympe.D.K(()=>String,[]);m.Hl.L=new olympe.D.K(()=>Array,[]);m.Bd.L=new olympe.D.K(()=>String,[]);m.Mk.L=new olympe.D.K(()=>{},[]);m.Yt.L=olympe.D.K.O;m.Xt.L=olympe.D.K.C;m.get.L=new olympe.D.K(()=>olympe.dc.CloudObject,[],'valueType');m.Zh.L=new olympe.D.K(()=>Array,[]);m.Xh.L=olympe.D.K.C;m.has.L=olympe.D.K.O;m.Zg.L=olympe.D.K.C;m.ie.L=new olympe.D.K(()=>olympe.dc.CloudObject,[],'valueType');m.Ze.L=olympe.D.K.C;m.$e.L=new olympe.D.K(()=>String,[]);m.Ef.L=olympe.D.K.C;m.xd.L=olympe.D.K.G;
881
- m.Ff.L=olympe.D.K.C;m.Fc.L=new olympe.D.K(()=>olympe.dc.CloudObject,[],'valueType');m.Gf.L=new olympe.D.K(()=>String,[]);m.mf.L=olympe.D.K.G;m.fg.L=olympe.D.K.C;m.forEach.L=new olympe.D.K(()=>{},[]);m.he.L=olympe.D.K.C;m.bj.L=new olympe.D.K(()=>{},[]);m.transform.L=new olympe.D.K(()=>olympe.dc.za,[]);m.Rk.L=new olympe.D.K(()=>olympe.dc.za,[]);m.filter.L=new olympe.D.K(()=>olympe.dc.za,[]);m.uk.L=new olympe.D.K(()=>olympe.dc.Qj,[]);m.toString.L=olympe.D.K.C;m.Wt.L=olympe.D.K.C;m.Oc.L=olympe.D.K.F;const Bl={nz:'append',tl:'filter_not',Lo:'filter_and',Mo:'filter_or'};function Cl(a,b){a=Dl(a);a=olympe.dc.CloudObject.get(a);return(new olympe.dc.Za.Fn(a,b)).F}
882
- olympe.dc.Qj=class{constructor(a,b){this.C=Dl(a);this.H=olympe.ka.ib('dc.query');this.valueType=void 0===b?olympe.dc.CloudObject:b;this.da=[];this.Xa=[];this.zc=void 0}Bi(){const a=new olympe.dc.za(this.C,this.da,this.valueType);'boolean'===typeof this.zc&&(a.zc=this.zc);return a}transform(a){for(let b=0,c=a.length,d;b<c;b++){d=a[b];if(void 0===d)throw new El('transform','Trying to set an undefined transformer');if(d instanceof olympe.dc.Oa.Property)throw new El('transform','Properties cannot be used as transformer, unlike relations '+
883
- d);if(!d||'function'!==typeof d.C)throw new El('transform','one of the argument is not a Transformer '+d);const e=d.Mb();null!==e&&(this.valueType=e);this.da.push(d)}return this}Rk(a){this.da.push(new olympe.dc.da.xf(a));return this}lz(a){this.da.push(new olympe.dc.da.xf(Dl(a)));return this}$t(a){this.valueType=a;return this}hb(a){this.da.push(a);this.valueType=a.Mb()||olympe.dc.CloudObject;return this}Sw(a){for(const b of a)this.da.push(b),this.valueType=b.Mb()||olympe.dc.CloudObject;return this}Rw(a,
884
- b,c){a=new olympe.dc.da.Ae(a,a.Ia(),b,c);this.da.push(a);this.valueType=a.Mb()||olympe.dc.CloudObject;return this}Qw(a){const b=[];let c;for(let d=0;d<a.length;d++){const e=a[d];b.push(e.X());void 0===c&&(c=e.Ia())}a=new olympe.dc.da.Rj(b,c);this.da.push(a);this.valueType=a.Mb()||olympe.dc.CloudObject;return this}Zt(){this.hb(olympe.dc.CloudObject.instancesRel);return this}We(a){var b=this.Xa.pop();b===Bl.tl&&(a=new olympe.dc.$.de(a),b=this.Xa.pop());switch(b){case Bl.Lo:b=this.da.pop().F;b instanceof
885
- olympe.dc.$.Fd?(b=b.$,b.push(a),a=new olympe.dc.$.Fd(...b)):a=new olympe.dc.$.Fd(b,a);b=this.Xa.pop();break;case Bl.Mo:b=this.da.pop().F,b instanceof olympe.dc.$.xe?(b=b.$,b.push(a),a=new olympe.dc.$.xe(...b)):a=new olympe.dc.$.xe(b,a),b=this.Xa.pop()}b===Bl.tl&&(a=new olympe.dc.$.de(a),this.Xa.pop());this.da.push(new olympe.dc.da.jf(a));return this}Mw(a,b,c){return this.We(new olympe.dc.$.se(Cl(a,c),new olympe.dc.Za.Le(b)))}contains(a,b,c=!1,d){return this.We(new olympe.dc.$.hf(Cl(a,d),new olympe.dc.Za.Le(b),
886
- c))}Rb(a){if(!(a instanceof Array))throw new El('instanceOf','Provided argument "models" must be an array.');const b=[];for(let c=0;c<a.length;c++)b.push(Dl(a[c]));return this.We(new olympe.dc.$.yi(b))}Gk(a){return this.We(new olympe.dc.$.se(new olympe.dc.Za.Qi,new olympe.dc.Za.Le(Dl(a))))}Nw(a){if(!Array.isArray(a))throw Error('ExcludeInstances should be called with an array');if(0<a.length){this.pd().Gk(a[0]);for(let b=1,c=a.length;b<c;b++)this.and().pd().Gk(a[b])}return this}$x(a,b){if(!(a instanceof
887
- Array))throw new El('hasRelated','Provided argument "relations" must be an array.');const c=[],d=[];a.forEach(e=>{c.push(e);d.push(e.Ia())});return this.We(new olympe.dc.$.vi(c,d,b))}Fk(a,b,c){a=Cl(a,c);return this.We(new olympe.dc.$.Nj(a,new olympe.dc.Za.Le(b)))}qj(a,b,c){a=Cl(a,c);return this.We(new olympe.dc.$.kk(a,new olympe.dc.Za.Le(b)))}uy(a,b,c,d){a=Cl(a,d);return this.We(new olympe.dc.$.uf(a,b,c))}filter(a){const b=new class extends olympe.dc.$.kg{C(c,d){return a(olympe.dc.CloudObject.get(d))}};
888
- return this.We(b)}pd(){this.Xa.push(Bl.tl);return this}and(){this.da[this.da.length-1]instanceof olympe.dc.da.jf&&this.Xa.push(Bl.Lo);return this}or(){this.da[this.da.length-1]instanceof olympe.dc.da.jf&&this.Xa.push(Bl.Mo);return this}Qk(a,b,c){a=Dl(a);let d=null;switch(olympe.dc.ia().Kb(a,olympe.dm.Property.typeRel)){case olympe.dm.String.P.X():d=new olympe.dc.vc.String(new olympe.dc.Za.Oi(a,c));break;case olympe.dm.Number.P.X():d=new olympe.dc.vc.Number(new olympe.dc.Za.Hi(a,c));break;case olympe.dm.DateTime.P.X():d=
889
- new olympe.dc.vc.DateTime(new olympe.dc.Za.li(a,c))}c=d;null!==c&&this.da.push(new olympe.dc.da.Kg(c,b));return this}sort(a,b,c){const d=new class extends olympe.dc.vc.kg{G(e,f){return a(olympe.dc.CloudObject.get(f))}compare(e,f){return b(e,f).valueOf()}};this.da.push(new olympe.dc.da.Kg(d,c));return this}Iw(){this.da.push(new olympe.dc.da.mi);return this}kj(a,b){this.da.push(new olympe.dc.da.uh(a,b));return this}};class El extends Error{constructor(a,b){super(`ListDefBuilder.${a}(): ${b}`)}}
890
- function Dl(a){return'string'===typeof a||a instanceof olympe.D.Pa?a:'function'===typeof a?olympe.dc.na.cc(a):olympe.D.jb(a)?a.Lh===olympe.D.Pa?a:olympe.D.va([a],b=>olympe.D.Ab(olympe.dc.ga(b)),olympe.D.Pa):a.X()}m=olympe.dc.Qj.prototype;m.Bi.L=new olympe.D.K(()=>olympe.dc.za,[]);m.transform.L=olympe.D.K.J();m.Rk.L=olympe.D.K.J();m.lz.L=olympe.D.K.J();m.$t.L=olympe.D.K.J();m.hb.L=olympe.D.K.J();m.Sw.L=olympe.D.K.J();m.Rw.L=olympe.D.K.J();m.Qw.L=olympe.D.K.J();m.Zt.L=olympe.D.K.J();m.We.L=olympe.D.K.J();
891
- m.Mw.L=olympe.D.K.J();m.contains.L=olympe.D.K.J();m.Rb.L=olympe.D.K.J();m.Gk.L=olympe.D.K.J();m.Nw.L=olympe.D.K.J();m.$x.L=olympe.D.K.J();m.Fk.L=olympe.D.K.J();m.qj.L=olympe.D.K.J();m.uy.L=olympe.D.K.J();m.filter.L=olympe.D.K.J();m.pd.L=olympe.D.K.J();m.and.L=olympe.D.K.J();m.or.L=olympe.D.K.J();m.Qk.L=olympe.D.K.J();m.sort.L=olympe.D.K.J();m.Iw.L=olympe.D.K.J();m.kj.L=olympe.D.K.J();function Al(a,b,c){const d=b.Wd();var e=new olympe.dc.query.Wu;let f;f=d;olympe.D.jb(f)&&(f=e.add(d));b=(b=b.Hl())?Array.isArray(b)?b:[b]:null;e=olympe.dc.kc.Subscription.G(f,b,e);let g,h,k=null!=(h=null==(g=a.C.get(e))?void 0:g.C)?h:null;null===k&&(a.H.debug('QueryMGR: new',a.F?'local':'remote','subscription "',e,'": #',`${f},`,b),k=new olympe.dc.kc.Subscription(e,d,b,a.G));k.getContext().run(()=>a.process(k,c));return k}
892
- function Fl(a,b){if(b.T())a.H.debug('ListProcessor: [ID:',b.U(),'] - Subscription already booted, ignoring');else{a.H.debug('ListProcessor: [ID:',b.U(),'] - Booting subscription');var c=new olympe.dc.lc.Yq(a.db,a.H),d=b.U();olympe.D.Nc([b.Wd()],e=>{const f=olympe.dc.ga(e);a.H.debug('ListProcessor: [ID:',b.U(),'] - Booting with baseTag',f);b.Uh()||b.Hk();jf(a.db,f,Gl(a,b,c),d);olympe.D.$a().Z(()=>gf(a.db,f,d));a.db.Ha(f.valueOf())||Hl(c);b.T()||(Hl(c),b.hc([]))})}}
893
- function Il(a,b,c,d,e){const f=[b.Wd()],g=l=>l instanceof olympe.dc.da.xf;let h;const k=(null!=(h=b.Xg())?h:[]).filter(g);for(const l of k){f.push(l.Wd());let n;k.push(...(null!=(n=l.Xg())?n:[]).filter(g))}wl(a.O,()=>{olympe.D.Nc(f,()=>{const l=b.Ud(c);Jl(a,l,b.U(),d,e)})})}
894
- function Jl(a,b,c,d,e){a.H.debug('CoverageProcessor: [ID:',c,'] - checking coverage of remote query over',b.length,'paths.');const f=olympe.D.$a(),g=new olympe.async.Yj(f);b.forEach(h=>{g.add((k,l)=>{let n=!1;Th(a.J,h,f,olympe.dc.Ra.SELF,olympe.dc.pa.Zc.Qf,{zc:e}).subscribe(rxjs.Subscriber.create(()=>{n||(n=!0,f.run(k))},p=>f.run(()=>l(`The query ${c} is not covered by an existing graphdef, `+`and the specific graphdef id ${h.U()} has encountered an error: ${p}`))))})});Tc(g,(h,k)=>d(k));g.start()}
895
- function Gl(a,b,c){const d=new olympe.dc.lc.xj;let e=!1;const f=olympe.D.$a(),g=b.Xg(),h=[];h[g?g.length:0]=(k,l,n,p)=>{f.od()||f.eb()||(k?b.Zg(n)?a.H.warn('Adding the same index twice (should never happen) for sub #',b.U(),', index #',n,', tag #',l):(a.H.debug('ListProcessor: [ID:',b.U(),'] - Adding Instance',l,'to the subscription'),b.Uc(n,l)):(a.H.debug('ListProcessor: [ID:',b.U(),'] - Removing Instance',l,'from the subscription'),b.$h(n)),e||(Kl(c,()=>{p.bg();Hl(c)}),f.run(()=>p.je().ig(b.hc.bind(b))),
896
- e=!0),Ll(c,n))};if(null!==g)for(let k=g.length-1;0<=k;k--)h[k]=g[k].C(f,c,h[k+1]);return(k,l)=>{const n=b.U();c.register(n,null);const p=d.C(k,l,n,null);if(null!==p)h[0](k,l,n,Ml(p,k,l,n))}}
897
- olympe.dc.kc.xu=class{constructor(a,b,c,d,e,f){this.H=a;this.db=b;this.F=f||e;this.O=c;this.J=d;this.C=new Map;this.G=new olympe.D.Xb('Legacy ListDef processor')}process(a,b){const c=a.U();var d=this.C.get(c);d||(d=new olympe.dc.kc.Hv(a),this.C.set(c,d));d.counter++;Nl(d)?this.H.debug('ListProcessor: [ID:',c,'] - id already processed'):(this.H.debug('ListProcessor: [ID:',c,'] - NOT processed yet.'),d=a.Bf(),b||this.F&&d===olympe.dc.Ra.SERVER||d===olympe.dc.Ra.SELF?(this.H.debug('QueryMGR: [ID:',c,
898
- '] - Local subscription, no need for coverage check, booting subscription '),Fl(this,a)):Il(this,a,d,e=>{e?this.H.error(e):Fl(this,a)},b))}};function Ol(a){return olympe.D.jb(a)?'Node#'+a.Da.U():String(a)}function Pl(a,b){return olympe.D.jb(b)?'{"c":"Parameter","v":"'+a.add(b)+'"}':JSON.stringify(b)}
881
+ m.Ff.L=olympe.D.K.C;m.Fc.L=new olympe.D.K(()=>olympe.dc.CloudObject,[],'valueType');m.Gf.L=new olympe.D.K(()=>String,[]);m.mf.L=olympe.D.K.G;m.fg.L=olympe.D.K.C;m.forEach.L=new olympe.D.K(()=>{},[]);m.he.L=olympe.D.K.C;m.bj.L=new olympe.D.K(()=>{},[]);m.transform.L=new olympe.D.K(()=>olympe.dc.za,[]);m.Rk.L=new olympe.D.K(()=>olympe.dc.za,[]);m.filter.L=new olympe.D.K(()=>olympe.dc.za,[]);m.uk.L=new olympe.D.K(()=>olympe.dc.Qj,[]);m.toString.L=olympe.D.K.C;m.Wt.L=olympe.D.K.C;m.Oc.L=olympe.D.K.F;const Al={nz:'append',tl:'filter_not',Lo:'filter_and',Mo:'filter_or'};function Bl(a,b){a=Cl(a);a=olympe.dc.CloudObject.get(a);return(new olympe.dc.$a.Fn(a,b)).F}
882
+ olympe.dc.Qj=class{constructor(a,b){this.C=Cl(a);this.H=olympe.ka.ab('dc.query');this.valueType=void 0===b?olympe.dc.CloudObject:b;this.da=[];this.Ya=[];this.zc=void 0}Bi(){const a=new olympe.dc.za(this.C,this.da,this.valueType);'boolean'===typeof this.zc&&(a.zc=this.zc);return a}transform(a){for(let b=0,c=a.length,d;b<c;b++){d=a[b];if(void 0===d)throw new Dl('transform','Trying to set an undefined transformer');if(d instanceof olympe.dc.Pa.Property)throw new Dl('transform','Properties cannot be used as transformer, unlike relations '+
883
+ d);if(!d||'function'!==typeof d.C)throw new Dl('transform','one of the argument is not a Transformer '+d);const e=d.Mb();null!==e&&(this.valueType=e);this.da.push(d)}return this}Rk(a){this.da.push(new olympe.dc.da.xf(a));return this}lz(a){this.da.push(new olympe.dc.da.xf(Cl(a)));return this}$t(a){this.valueType=a;return this}ib(a){this.da.push(a);this.valueType=a.Mb()||olympe.dc.CloudObject;return this}Sw(a){for(const b of a)this.da.push(b),this.valueType=b.Mb()||olympe.dc.CloudObject;return this}Rw(a,
884
+ b,c){a=new olympe.dc.da.Ae(a,a.Ia(),b,c);this.da.push(a);this.valueType=a.Mb()||olympe.dc.CloudObject;return this}Qw(a){const b=[];let c;for(let d=0;d<a.length;d++){const e=a[d];b.push(e.X());void 0===c&&(c=e.Ia())}a=new olympe.dc.da.Rj(b,c);this.da.push(a);this.valueType=a.Mb()||olympe.dc.CloudObject;return this}Zt(){this.ib(olympe.dc.CloudObject.instancesRel);return this}We(a){var b=this.Ya.pop();b===Al.tl&&(a=new olympe.dc.$.de(a),b=this.Ya.pop());switch(b){case Al.Lo:b=this.da.pop().F;b instanceof
885
+ olympe.dc.$.Fd?(b=b.$,b.push(a),a=new olympe.dc.$.Fd(...b)):a=new olympe.dc.$.Fd(b,a);b=this.Ya.pop();break;case Al.Mo:b=this.da.pop().F,b instanceof olympe.dc.$.xe?(b=b.$,b.push(a),a=new olympe.dc.$.xe(...b)):a=new olympe.dc.$.xe(b,a),b=this.Ya.pop()}b===Al.tl&&(a=new olympe.dc.$.de(a),this.Ya.pop());this.da.push(new olympe.dc.da.jf(a));return this}Mw(a,b,c){return this.We(new olympe.dc.$.se(Bl(a,c),new olympe.dc.$a.Le(b)))}contains(a,b,c=!1,d){return this.We(new olympe.dc.$.hf(Bl(a,d),new olympe.dc.$a.Le(b),
886
+ c))}Rb(a){if(!(a instanceof Array))throw new Dl('instanceOf','Provided argument "models" must be an array.');const b=[];for(let c=0;c<a.length;c++)b.push(Cl(a[c]));return this.We(new olympe.dc.$.yi(b))}Gk(a){return this.We(new olympe.dc.$.se(new olympe.dc.$a.Qi,new olympe.dc.$a.Le(Cl(a))))}Nw(a){if(!Array.isArray(a))throw Error('ExcludeInstances should be called with an array');if(0<a.length){this.pd().Gk(a[0]);for(let b=1,c=a.length;b<c;b++)this.and().pd().Gk(a[b])}return this}$x(a,b){if(!(a instanceof
887
+ Array))throw new Dl('hasRelated','Provided argument "relations" must be an array.');const c=[],d=[];a.forEach(e=>{c.push(e);d.push(e.Ia())});return this.We(new olympe.dc.$.vi(c,d,b))}Fk(a,b,c){a=Bl(a,c);return this.We(new olympe.dc.$.Nj(a,new olympe.dc.$a.Le(b)))}qj(a,b,c){a=Bl(a,c);return this.We(new olympe.dc.$.kk(a,new olympe.dc.$a.Le(b)))}uy(a,b,c,d){a=Bl(a,d);return this.We(new olympe.dc.$.uf(a,b,c))}filter(a){const b=new class extends olympe.dc.$.kg{C(c,d){return a(olympe.dc.CloudObject.get(d))}};
888
+ return this.We(b)}pd(){this.Ya.push(Al.tl);return this}and(){this.da[this.da.length-1]instanceof olympe.dc.da.jf&&this.Ya.push(Al.Lo);return this}or(){this.da[this.da.length-1]instanceof olympe.dc.da.jf&&this.Ya.push(Al.Mo);return this}Qk(a,b,c){a=Cl(a);let d=null;switch(olympe.dc.ia().Kb(a,olympe.dm.Property.typeRel)){case olympe.dm.String.P.X():d=new olympe.dc.vc.String(new olympe.dc.$a.Oi(a,c));break;case olympe.dm.Number.P.X():d=new olympe.dc.vc.Number(new olympe.dc.$a.Hi(a,c));break;case olympe.dm.DateTime.P.X():d=
889
+ new olympe.dc.vc.DateTime(new olympe.dc.$a.li(a,c))}c=d;null!==c&&this.da.push(new olympe.dc.da.Kg(c,b));return this}sort(a,b,c){const d=new class extends olympe.dc.vc.kg{G(e,f){return a(olympe.dc.CloudObject.get(f))}compare(e,f){return b(e,f).valueOf()}};this.da.push(new olympe.dc.da.Kg(d,c));return this}Iw(){this.da.push(new olympe.dc.da.mi);return this}kj(a,b){this.da.push(new olympe.dc.da.uh(a,b));return this}};class Dl extends Error{constructor(a,b){super(`ListDefBuilder.${a}(): ${b}`)}}
890
+ function Cl(a){return'string'===typeof a||a instanceof olympe.D.Qa?a:'function'===typeof a?olympe.dc.na.cc(a):olympe.D.jb(a)?a.Lh===olympe.D.Qa?a:olympe.D.va([a],b=>olympe.D.Ab(olympe.dc.ga(b)),olympe.D.Qa):a.X()}m=olympe.dc.Qj.prototype;m.Bi.L=new olympe.D.K(()=>olympe.dc.za,[]);m.transform.L=olympe.D.K.J();m.Rk.L=olympe.D.K.J();m.lz.L=olympe.D.K.J();m.$t.L=olympe.D.K.J();m.ib.L=olympe.D.K.J();m.Sw.L=olympe.D.K.J();m.Rw.L=olympe.D.K.J();m.Qw.L=olympe.D.K.J();m.Zt.L=olympe.D.K.J();m.We.L=olympe.D.K.J();
891
+ m.Mw.L=olympe.D.K.J();m.contains.L=olympe.D.K.J();m.Rb.L=olympe.D.K.J();m.Gk.L=olympe.D.K.J();m.Nw.L=olympe.D.K.J();m.$x.L=olympe.D.K.J();m.Fk.L=olympe.D.K.J();m.qj.L=olympe.D.K.J();m.uy.L=olympe.D.K.J();m.filter.L=olympe.D.K.J();m.pd.L=olympe.D.K.J();m.and.L=olympe.D.K.J();m.or.L=olympe.D.K.J();m.Qk.L=olympe.D.K.J();m.sort.L=olympe.D.K.J();m.Iw.L=olympe.D.K.J();m.kj.L=olympe.D.K.J();function zl(a,b,c){const d=b.Wd();var e=new olympe.dc.query.Wu;let f;f=d;olympe.D.jb(f)&&(f=e.add(d));b=(b=b.Hl())?Array.isArray(b)?b:[b]:null;e=olympe.dc.kc.Subscription.G(f,b,e);let g,h,k=null!=(h=null==(g=a.C.get(e))?void 0:g.C)?h:null;null===k&&(a.H.debug('QueryMGR: new',a.F?'local':'remote','subscription "',e,'": #',`${f},`,b),k=new olympe.dc.kc.Subscription(e,d,b,a.G));k.getContext().run(()=>a.process(k,c));return k}
892
+ function El(a,b){if(b.T())a.H.debug('ListProcessor: [ID:',b.U(),'] - Subscription already booted, ignoring');else{a.H.debug('ListProcessor: [ID:',b.U(),'] - Booting subscription');var c=new olympe.dc.lc.Yq(a.db,a.H),d=b.U();olympe.D.Nc([b.Wd()],e=>{const f=olympe.dc.ga(e);a.H.debug('ListProcessor: [ID:',b.U(),'] - Booting with baseTag',f);b.Uh()||b.Hk();jf(a.db,f,Fl(a,b,c),d);olympe.D.Wa().Z(()=>gf(a.db,f,d));a.db.Ha(f.valueOf())||Gl(c);b.T()||(Gl(c),b.hc([]))})}}
893
+ function Hl(a,b,c,d,e){const f=[b.Wd()],g=l=>l instanceof olympe.dc.da.xf;let h;const k=(null!=(h=b.Xg())?h:[]).filter(g);for(const l of k){f.push(l.Wd());let n;k.push(...(null!=(n=l.Xg())?n:[]).filter(g))}vl(a.O,()=>{olympe.D.Nc(f,()=>{const l=b.Ud(c);Il(a,l,b.U(),d,e)})})}
894
+ function Il(a,b,c,d,e){a.H.debug('CoverageProcessor: [ID:',c,'] - checking coverage of remote query over',b.length,'paths.');const f=olympe.D.Wa(),g=new olympe.async.Yj(f);b.forEach(h=>{g.add((k,l)=>{let n=!1;Th(a.J,h,f,olympe.dc.Sa.SELF,olympe.dc.pa.Zc.Qf,{zc:e}).subscribe(rxjs.Subscriber.create(()=>{n||(n=!0,f.run(k))},p=>f.run(()=>l(`The query ${c} is not covered by an existing graphdef, `+`and the specific graphdef id ${h.U()} has encountered an error: ${p}`))))})});Tc(g,(h,k)=>d(k));g.start()}
895
+ function Fl(a,b,c){const d=new olympe.dc.lc.xj;let e=!1;const f=olympe.D.Wa(),g=b.Xg(),h=[];h[g?g.length:0]=(k,l,n,p)=>{f.od()||f.fb()||(k?b.Zg(n)?a.H.warn('Adding the same index twice (should never happen) for sub #',b.U(),', index #',n,', tag #',l):(a.H.debug('ListProcessor: [ID:',b.U(),'] - Adding Instance',l,'to the subscription'),b.Uc(n,l)):(a.H.debug('ListProcessor: [ID:',b.U(),'] - Removing Instance',l,'from the subscription'),b.$h(n)),e||(Jl(c,()=>{p.bg();Gl(c)}),f.run(()=>p.je().ig(b.hc.bind(b))),
896
+ e=!0),Kl(c,n))};if(null!==g)for(let k=g.length-1;0<=k;k--)h[k]=g[k].C(f,c,h[k+1]);return(k,l)=>{const n=b.U();c.register(n,null);const p=d.C(k,l,n,null);if(null!==p)h[0](k,l,n,Ll(p,k,l,n))}}
897
+ olympe.dc.kc.xu=class{constructor(a,b,c,d,e,f){this.H=a;this.db=b;this.F=f||e;this.O=c;this.J=d;this.C=new Map;this.G=new olympe.D.Xb('Legacy ListDef processor')}process(a,b){const c=a.U();var d=this.C.get(c);d||(d=new olympe.dc.kc.Hv(a),this.C.set(c,d));d.counter++;Ml(d)?this.H.debug('ListProcessor: [ID:',c,'] - id already processed'):(this.H.debug('ListProcessor: [ID:',c,'] - NOT processed yet.'),d=a.Bf(),b||this.F&&d===olympe.dc.Sa.SERVER||d===olympe.dc.Sa.SELF?(this.H.debug('QueryMGR: [ID:',c,
898
+ '] - Local subscription, no need for coverage check, booting subscription '),El(this,a)):Hl(this,a,d,e=>{e?this.H.error(e):El(this,a)},b))}};function Nl(a){return olympe.D.jb(a)?'Node#'+a.Da.U():String(a)}function Ol(a,b){return olympe.D.jb(b)?'{"c":"Parameter","v":"'+a.add(b)+'"}':JSON.stringify(b)}
899
899
  olympe.dc.query.Wu=class{constructor(){this.C=0;this.values=null}add(a){let b;b=olympe.D.jb(a)?'n'+a.Da.U():'p'+ ++this.C;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.Ba=class{ma(){}C(){}F(){}ha(){}toString(){}};olympe.dc.kc.Subscription=class a extends olympe.D.vj{constructor(b,c,d,e){super(olympe.dc.CloudObject,new olympe.D.Xb('context subscription '+b,e));this.id=b;this.Cc=c;this.da=d||null;this.G=this.O.run(()=>olympe.D.$d(olympe.dc.kc.Subscription.C.INIT));this.Ub=!1;this.aa=this.ac=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].ha(d);else e+='|null';e=olympe.Y.vb(e)}catch(f){e=olympe.Y.Mc()}return e}U(){return this.id}Wd(){return this.Cc}Xg(){return this.da}Bf(){const b=
900
- olympe.dc.Zd(),c=olympe.D.Na(this.Wd());let d;return olympe.dc.CloudObject.instancesRel.Fa(null==(d=this.da)?void 0:d[0])?b.fromModel(c):b.Fe(c)}Uh(){const b=olympe.D.Na(this.G);return b&&b.valueOf()>=olympe.dc.kc.Subscription.C.Sq}Hk(){if(this.G.Da.eb())throw Error(`Cannot set destroyed subscription '${this.id}' as subscribed`);const b=this.ac;this.ac=null;for(let c in b)if(Object.prototype.hasOwnProperty.call(b,c))b[c](this);Wb(this.G,olympe.D.$d(olympe.dc.kc.Subscription.C.Sq))}Tc(){return olympe.D.va([this.G],
901
- ()=>{},olympe.D.fa)}T(){const b=this.G.Da.Fb;return b&&b.valueOf()>=olympe.dc.kc.Subscription.C.Dh}Bd(b,c){this.T()?b(this):(null===this.aa&&(this.aa=new Map),void 0===c&&(c=olympe.Y.Mc()),this.aa.set(c,olympe.D.$a().G(b)));return c||''}Mk(b){null!==this.aa&&b&&this.aa.delete(b)}Jb(){const b=olympe.dc.kc.Subscription.C.Dh;if(!this.G.Da.eb()&&olympe.D.Na(this.G)!==b&&(this.zf(),Wb(this.G,b),null!==this.aa)){for(const c of this.aa.values())c(this);this.aa=null}}onDestroy(b){this.O.onDestroy(b)}release(){this.O.destroy()}hc(b){if(!this.G.Da.eb()){for(let c=
902
- 0,d=b.length;c<d;c++)this.Bm(b[c],c);if(this.T())this.zf();else{this.Ub=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.Jb()}}}Uc(b,c){if(!this.G.Da.eb()&&(this.tk(b,olympe.dc.CloudObject.get(c)),b=this.T(),this.Ub&&!b)){b=!0;for(let d in this.F)if(Object.prototype.hasOwnProperty.call(this.F,d)&&!Object.prototype.hasOwnProperty.call(this.values,d)){b=!1;break}b&&this.Jb()}}$h(b){this.G.Da.eb()||(this.Am(b),
903
- this.Wi(b,!this.T()))}vg(){return this.T()?super.vg():'Subscription is not ready!'}Ud(b){const c=olympe.D.Na(this.Wd());return olympe.dc.kc.Subscription.F(c,b,this.Xg())}static F(b,c,d){var e=olympe.dc.pa.from(b,c).ge();if(null===d)return[e];b=[];b.push(e);for(let f=0,g=d.length;f<g;f++)if(e=d[f],e instanceof olympe.dc.da.Qe){const h=olympe.dc.query.Relation.from(e);b=b.map(k=>k.hb(h,!0))}else if(e instanceof olympe.dc.da.Ae){const h=olympe.dc.query.Relation.from(e);b=b.map(k=>k.eg(h,!0,!0))}else if(e instanceof
904
- olympe.dc.da.xf)e=a.F(olympe.D.Na(e.Wd()),c,e.Xg()),b.push(...e);else if(e instanceof olympe.dc.da.jf||e instanceof olympe.dc.da.Kg){const h=e.G();b=b.map(k=>{for(const l of h){for(const n of l)k=n.recursive?k.eg(n,!0,!0):k.hb(n,!0);k=k.back(l.length)}return k})}return b}};olympe.dc.kc.Subscription.C={INIT:0,Sq:1,Dh:2};olympe.dc.kc.Subscription.prototype.vg.L=olympe.D.K.C;function Nl(a){const b=a.F;a.F=!0;return b}olympe.dc.kc.Hv=class{constructor(a){this.counter=0;this.F=!1;this.C=a}};olympe.dc.wf=class{ma(){}Mb(){}C(){}ha(){}toString(){}};olympe.dc.mq=class{G(){}};olympe.dc.qk=class{ma(){}getValue(){}C(){}ha(){}toString(){}};olympe.dc.vc={};let Ql=0;olympe.dc.vc.kg=class{constructor(){this.id=Ql++}ma(){return'CustomLocalComparator#'+Ql}J(){return[]}G(){throw Error('GetComparedValue function was not implemented.');}compare(){throw Error('Compare function was not implemented.');}ha(){return`{"c":"${this.ma()}"}`}toString(){return this.ma()+'()'}};olympe.dc.vc.kg.ya=[olympe.dc.gf];olympe.dc.vc.DateTime=class{constructor(a){this.C=a}ma(){return S(olympe.dc.vc.DateTime)}J(){return this.C.C()}G(a,b){return this.C.getValue(a,b)}compare(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}ha(a){return'{"c":"'+this.ma()+'",a:['+this.C.ha(a)+']}'}toString(){return'Number('+this.C.toString()+')'}};R('olympe.dc.comparators.DateTime',olympe.dc.vc.DateTime);olympe.dc.vc.DateTime.ya=[olympe.dc.gf];olympe.dc.vc.Number=class{constructor(a){this.C=a}ma(){return S(olympe.dc.vc.Number)}J(){return this.C.C()}G(a,b){return this.C.getValue(a,b)}compare(a,b){return a!==b?a>b?1:-1:0}ha(a){return`{"c":"${this.ma()}",a:[${this.C.ha(a)}]}`}toString(){return`Number(${this.C.toString()})`}};R('olympe.dc.comparators.Number',olympe.dc.vc.Number);olympe.dc.vc.Number.ya=[olympe.dc.gf];olympe.dc.vc.String=class{constructor(a){this.C=a}ma(){return S(olympe.dc.vc.String)}J(){return this.C.C()}G(a,b){return olympe.D.va([this.C.getValue(a,b)],c=>c.toLowerCase(),olympe.D.Pa)}compare(a,b){return void 0===a?void 0===b?0:1:a!==b?a>b?1:-1:0}ha(a){return`{"c":"${this.ma()}",a:[${this.C.ha(a)}]}`}toString(){return`String(${this.C.toString()})`}};R('olympe.dc.comparators.String',olympe.dc.vc.String);olympe.dc.vc.String.ya=[olympe.dc.gf];olympe.dc.$={};let Rl=0;olympe.dc.$.kg=class{constructor(){this.id=Rl++}ma(){return'CustomLocalPredicate#'+this.id}F(){return[]}C(){throw Error('Test function was not implemented.');}ha(){return`{"c":"${this.ma()}"}`}toString(){return this.ma()+'()'}};olympe.dc.$.kg.ya=[olympe.dc.Ba];olympe.dc.$.Wk=class{constructor(a,b){this.G=a;this.J=b}ma(){}F(){return[this.G.C(),this.J.C()]}C(a,b){return a.run(()=>olympe.D.va([this.G.getValue(a,b),this.J.getValue(a,b)],(c,d)=>{c=c.valueOf();d=d.valueOf();return olympe.D.Sb(this.O('string'===typeof c?c:Number(c),'string'===typeof d?d:Number(d)))},olympe.D.fa))}O(){}ha(a){return'{"c":"'+this.ma()+'","a":['+this.G.ha(a)+','+this.J.ha(a)+']}'}toString(){return this.ma().replace(/^.+\./,'')+'('+this.G.toString()+','+this.J.toString()+')'}};
900
+ olympe.dc.Zd(),c=olympe.D.Na(this.Wd());let d;return olympe.dc.CloudObject.instancesRel.Fa(null==(d=this.da)?void 0:d[0])?b.fromModel(c):b.Fe(c)}Uh(){const b=olympe.D.Na(this.G);return b&&b.valueOf()>=olympe.dc.kc.Subscription.C.Sq}Hk(){if(this.G.Da.fb())throw Error(`Cannot set destroyed subscription '${this.id}' as subscribed`);const b=this.ac;this.ac=null;for(let c in b)if(Object.prototype.hasOwnProperty.call(b,c))b[c](this);Wb(this.G,olympe.D.$d(olympe.dc.kc.Subscription.C.Sq))}Tc(){return olympe.D.va([this.G],
901
+ ()=>{},olympe.D.fa)}T(){const b=this.G.Da.Gb;return b&&b.valueOf()>=olympe.dc.kc.Subscription.C.Dh}Bd(b,c){this.T()?b(this):(null===this.aa&&(this.aa=new Map),void 0===c&&(c=olympe.Y.Mc()),this.aa.set(c,olympe.D.Wa().G(b)));return c||''}Mk(b){null!==this.aa&&b&&this.aa.delete(b)}Fb(){const b=olympe.dc.kc.Subscription.C.Dh;if(!this.G.Da.fb()&&olympe.D.Na(this.G)!==b&&(this.zf(),Wb(this.G,b),null!==this.aa)){for(const c of this.aa.values())c(this);this.aa=null}}onDestroy(b){this.O.onDestroy(b)}release(){this.O.destroy()}hc(b){if(!this.G.Da.fb()){for(let c=
902
+ 0,d=b.length;c<d;c++)this.Bm(b[c],c);if(this.T())this.zf();else{this.Ub=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.Fb()}}}Uc(b,c){if(!this.G.Da.fb()&&(this.tk(b,olympe.dc.CloudObject.get(c)),b=this.T(),this.Ub&&!b)){b=!0;for(let d in this.F)if(Object.prototype.hasOwnProperty.call(this.F,d)&&!Object.prototype.hasOwnProperty.call(this.values,d)){b=!1;break}b&&this.Fb()}}$h(b){this.G.Da.fb()||(this.Am(b),
903
+ this.Wi(b,!this.T()))}vg(){return this.T()?super.vg():'Subscription is not ready!'}Ud(b){const c=olympe.D.Na(this.Wd());return olympe.dc.kc.Subscription.F(c,b,this.Xg())}static F(b,c,d){var e=olympe.dc.pa.from(b,c).ge();if(null===d)return[e];b=[];b.push(e);for(let f=0,g=d.length;f<g;f++)if(e=d[f],e instanceof olympe.dc.da.Qe){const h=olympe.dc.query.Relation.from(e);b=b.map(k=>k.ib(h,!0))}else if(e instanceof olympe.dc.da.Ae){const h=olympe.dc.query.Relation.from(e);b=b.map(k=>k.eg(h,!0,!0))}else if(e instanceof
904
+ olympe.dc.da.xf)e=a.F(olympe.D.Na(e.Wd()),c,e.Xg()),b.push(...e);else if(e instanceof olympe.dc.da.jf||e instanceof olympe.dc.da.Kg){const h=e.G();b=b.map(k=>{for(const l of h){for(const n of l)k=n.recursive?k.eg(n,!0,!0):k.ib(n,!0);k=k.back(l.length)}return k})}return b}};olympe.dc.kc.Subscription.C={INIT:0,Sq:1,Dh:2};olympe.dc.kc.Subscription.prototype.vg.L=olympe.D.K.C;function Ml(a){const b=a.F;a.F=!0;return b}olympe.dc.kc.Hv=class{constructor(a){this.counter=0;this.F=!1;this.C=a}};olympe.dc.wf=class{ma(){}Mb(){}C(){}ha(){}toString(){}};olympe.dc.mq=class{G(){}};olympe.dc.qk=class{ma(){}getValue(){}C(){}ha(){}toString(){}};olympe.dc.vc={};let Pl=0;olympe.dc.vc.kg=class{constructor(){this.id=Pl++}ma(){return'CustomLocalComparator#'+Pl}J(){return[]}G(){throw Error('GetComparedValue function was not implemented.');}compare(){throw Error('Compare function was not implemented.');}ha(){return`{"c":"${this.ma()}"}`}toString(){return this.ma()+'()'}};olympe.dc.vc.kg.ya=[olympe.dc.gf];olympe.dc.vc.DateTime=class{constructor(a){this.C=a}ma(){return S(olympe.dc.vc.DateTime)}J(){return this.C.C()}G(a,b){return this.C.getValue(a,b)}compare(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}ha(a){return'{"c":"'+this.ma()+'",a:['+this.C.ha(a)+']}'}toString(){return'Number('+this.C.toString()+')'}};R('olympe.dc.comparators.DateTime',olympe.dc.vc.DateTime);olympe.dc.vc.DateTime.ya=[olympe.dc.gf];olympe.dc.vc.Number=class{constructor(a){this.C=a}ma(){return S(olympe.dc.vc.Number)}J(){return this.C.C()}G(a,b){return this.C.getValue(a,b)}compare(a,b){return a!==b?a>b?1:-1:0}ha(a){return`{"c":"${this.ma()}",a:[${this.C.ha(a)}]}`}toString(){return`Number(${this.C.toString()})`}};R('olympe.dc.comparators.Number',olympe.dc.vc.Number);olympe.dc.vc.Number.ya=[olympe.dc.gf];olympe.dc.vc.String=class{constructor(a){this.C=a}ma(){return S(olympe.dc.vc.String)}J(){return this.C.C()}G(a,b){return olympe.D.va([this.C.getValue(a,b)],c=>c.toLowerCase(),olympe.D.Qa)}compare(a,b){return void 0===a?void 0===b?0:1:a!==b?a>b?1:-1:0}ha(a){return`{"c":"${this.ma()}",a:[${this.C.ha(a)}]}`}toString(){return`String(${this.C.toString()})`}};R('olympe.dc.comparators.String',olympe.dc.vc.String);olympe.dc.vc.String.ya=[olympe.dc.gf];olympe.dc.$={};let Ql=0;olympe.dc.$.kg=class{constructor(){this.id=Ql++}ma(){return'CustomLocalPredicate#'+this.id}F(){return[]}C(){throw Error('Test function was not implemented.');}ha(){return`{"c":"${this.ma()}"}`}toString(){return this.ma()+'()'}};olympe.dc.$.kg.ya=[olympe.dc.Ba];olympe.dc.$.Wk=class{constructor(a,b){this.G=a;this.J=b}ma(){}F(){return[this.G.C(),this.J.C()]}C(a,b){return a.run(()=>olympe.D.va([this.G.getValue(a,b),this.J.getValue(a,b)],(c,d)=>{c=c.valueOf();d=d.valueOf();return olympe.D.Sb(this.O('string'===typeof c?c:Number(c),'string'===typeof d?d:Number(d)))},olympe.D.fa))}O(){}ha(a){return'{"c":"'+this.ma()+'","a":['+this.G.ha(a)+','+this.J.ha(a)+']}'}toString(){return this.ma().replace(/^.+\./,'')+'('+this.G.toString()+','+this.J.toString()+')'}};
905
905
  olympe.dc.$.Wk.ya=[olympe.dc.Ba];olympe.dc.$.Fd=class{constructor(a){this.$=[];for(let b=arguments.length,c=0;c<b;c++)Array.isArray(arguments[c])?this.$=this.$.concat(arguments[c]):this.$.push(arguments[c])}ma(){return S(olympe.dc.$.Fd)}F(){return this.$.reduce((a,b)=>a.concat(b.F()),[])}C(a,b){return a.run(()=>olympe.D.va(this.$.map(c=>c.C(a,b)),(...c)=>olympe.D.Sb(c.every(d=>d.valueOf())),olympe.D.fa))}ha(a){const b=this.$.map(c=>c.ha(a));return'{"c":"'+this.ma()+'","a":['+b.join(',')+']}'}toString(){return'And('+this.$.map(a=>
906
- a.toString()).join(',')+')'}};R('olympe.dc.predicates.And',olympe.dc.$.Fd);olympe.dc.$.Fd.ya=[olympe.dc.Ba];olympe.dc.$.al=class{constructor(a,b){this.G=a;this.value=b}C(a,b){return a.run(()=>olympe.D.va([this.G,this.value.getValue(a,b)],(c,d)=>{c=c.valueOf();return olympe.D.Sb((Number(c)&Number(d.valueOf()))===Number(c))},olympe.D.fa))}ma(){return S(olympe.dc.$.al)}F(){return[this.value.C()]}ha(a){const b=olympe.D.jb(this.G)?this.G.Da.Fb.valueOf():this.G.valueOf();return'{"c":"'+this.ma()+'","a":['+b+','+this.value.ha(a)+']}'}toString(){const a=olympe.D.jb(this.G)?this.G.Da.Fb.valueOf():this.G.valueOf();
907
- return this.ma().replace(/^.+\./,'')+'('+a.toString()+','+this.value.toString()+')'}};R('olympe.dc.predicates.BitMask',olympe.dc.$.al);olympe.dc.$.al.ya=[olympe.dc.Ba];olympe.dc.$.hf=class{constructor(a,b,c){this.source=a;this.value=b;this.G=c?c:!1}ma(){return S(olympe.dc.$.hf)}F(){return[this.source.C(),this.value.C()]}tb(){return this.source}getValue(){return this.value}C(a,b){return a.run(()=>olympe.D.va([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.Sb(c.includes(d))},olympe.D.fa))}ha(a){const b=this.source.ha(a),c=this.value.ha(a);a=Pl(a,this.G);
908
- return'{"c":"'+this.ma()+'","a":['+b+','+c+','+a+']}'}toString(){const a=Ol(this.G);return'Contains('+this.source.toString()+','+this.value.toString()+','+a+')'}};R('olympe.dc.predicates.Contains',olympe.dc.$.hf);olympe.dc.$.hf.ya=[olympe.dc.Ba];olympe.dc.$.se=class{constructor(a,b){this.G=a;this.J=b}ma(){return S(olympe.dc.$.se)}F(){return[this.G.C(),this.J.C()]}C(a,b){return a.run(()=>olympe.D.va([this.G.getValue(a,b),this.J.getValue(a,b)],(c,d)=>'object'===typeof c&&void 0!==c.Ad?c.Ad(d):'object'===typeof d&&void 0!==d.Ad?d.Ad(c):olympe.D.Sb(c.valueOf()===d.valueOf()),olympe.D.fa,'Test equal predicate'))}ha(a){return'{"c":"'+this.ma()+'","a":['+this.G.ha(a)+','+this.J.ha(a)+']}'}toString(){return'Equals('+this.G.toString()+','+this.J.toString()+
909
- ')'}};R('olympe.dc.predicates.Equals',olympe.dc.$.se);olympe.dc.$.se.ya=[olympe.dc.Ba];olympe.dc.$.ot=class extends olympe.dc.$.se{constructor(a,b){super(a,new olympe.dc.Za.Le(b))}};olympe.dc.$.ot.ya=[olympe.dc.Ba];olympe.dc.$.Nj=class extends olympe.dc.$.Wk{constructor(a,b){super(a,b)}ma(){return S(olympe.dc.$.Nj)}O(a,b){return a>b}};R('olympe.dc.predicates.Greater',olympe.dc.$.Nj);olympe.dc.$.vi=class{constructor(a,b,c){this.pb=[];this.G=c instanceof Array?c:void 0!==c?[olympe.dc.ga(c)]:[];a=Array.isArray(a)?a:[a];for(let d=0,e=a.length;d<e;d++)c=a[d],c instanceof olympe.dc.da.Ae?this.pb.push(new Sl(c.X(),c.Ia(),c.G,c.F)):this.pb.push(new Sl(olympe.dc.ga(c),b[d],1,1))}ma(){return S(olympe.dc.$.vi)}F(){return[this.pb.reduce((a,b)=>a.concat(b),[])]}C(a,b){const c=a.run(()=>Xb(olympe.D.ec(Boolean),!1)),d=olympe.Y.Mc(),e=olympe.dc.ia();let f=0;a=(h,k)=>{0!==this.G.length&&!this.G.includes(k)||
910
- c.getContext().eb()||c.getContext().od()||(f+=h?1:-1,c.update(0<f))};const g=this.pb;for(let h=g.length-1;0<=h;h--)a=Tl(g[h],e,a,d+h);jf(e,b,a,d);c.getContext().onDestroy(()=>{gf(e,b,d)});return c.sb()}ha(){return'{"c":"'+this.ma()+'","a":['+JSON.stringify(this.pb.map(a=>a.ha()))+(0!==this.G.length?',"'+this.G.toString():'')+'"]}'}toString(){return'HasRelated('+(0!==this.G.length?'#'+this.G.toString()+', ':'')+this.pb.map(a=>a.ha())+')'}};R('olympe.dc.predicates.HasRelated',olympe.dc.$.vi);
911
- function Tl(a,b,c,d){const e=Object.create(null);d+=olympe.Y.Vh();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.F(h,a,l))}};return(g,h)=>f(g,h,0)}class Sl extends olympe.dc.query.Relation{constructor(a,b,c,d){super(a,b,1!==c||1!==d);this.F=c;this.C=d}ha(){return`${this.X()}, ${this.Ia()}, ${this.F}, ${this.C}`}}olympe.dc.$.vi.ya=[olympe.dc.Ba];olympe.dc.$.Al=class{constructor(a,b,c){this.pb=[];this.G=void 0!==c?c.map(olympe.dc.ga):null;a=Array.isArray(a)?a:[a];for(let d=0,e=a.length;d<e;d++)c=a[d],c instanceof olympe.dc.da.Ae?this.pb.push(new Ul(c.X(),c.Ia(),c.G,c.F)):this.pb.push(new Ul(olympe.dc.ga(c),b[d],1,1))}ma(){return S(olympe.dc.$.Al)}F(){return[this.pb.reduce((a,b)=>a.concat(b),[])]}C(a,b){const c=a.run(()=>Xb(olympe.D.ec(Boolean),!1)),d=olympe.dc.ia(),e=olympe.Y.Vh();let f=(k,l,n)=>{l&&(null===this.G||this.G.includes(n))&&k(1)};
912
- const g=this.pb;for(let k=g.length-1;0<=k;k--)f=Vl(g[k],d,f,e+k);let h=0;jf(d,b,f.bind(null,k=>{c.getContext().od()||c.getContext().eb()||(h+=k,c.update(0<h))}),e);a.onDestroy(()=>gf(d,b,e));return c.sb()}ha(){return'{"c":"'+this.ma()+'","a":['+JSON.stringify(this.pb.map(a=>a.ha()))+(null!==this.G?',"'+this.G.toString():'')+'"]}'}toString(){return'HasRelatedTree('+(null!==this.G?'#['+this.G.toString()+'], ':'')+this.pb.map(a=>a.ha())+')'}};R('olympe.dc.predicates.HasRelatedTree',olympe.dc.$.Al);
913
- function Vl(a,b,c,d){const e=a.G,f=a.O,g=new Set,h=(l,n,p)=>{f.has(n)?f.get(n).set(d+p,l):f.set(n,(new Map).set(d+p,l))},k=(l,n,p,q,r)=>{const t=olympe.Y.Vh();if(q){const u=p+r,x=y=>{const z=f.get(r);if(g.has(u))throw Error(`Try to use the predicate HasRelatedTree with recursion in a graph cluster containing a loop around instances ${p} and ${r}`);void 0!==z&&null!==z&&(g.add(u),e.set(r,(e.get(r)||0)+y),Array.from(z.values()).forEach(A=>A(y)));g.delete(u)};h(l,r,p);e.has(r)?l(e.get(r)):(n>=a.F&&c(y=>
914
- {e.set(r,(e.get(r)||0)+y);l(y)},q,r),(0>a.C||n<=a.C)&&r!==p&&V(b,r,a,k.bind(a,x,n+1,r),t))}else l(-e.get(r)),f.get(r).delete(d+p),0===f.get(r).size&&(e.delete(r),f.delete(r),b.F(r,a,t))};return(l,n,p)=>k(l,0,'origin',n,p)}class Ul extends olympe.dc.query.Relation{constructor(a,b,c,d){super(a,b,1!==c||1!==d);this.F=c;this.C=d;this.O=new Map;this.G=new Map}ha(){return`${this.X()}, ${this.Ia()}, ${this.F}, ${this.C}`}}olympe.dc.$.Al.ya=[olympe.dc.Ba];olympe.dc.$.yi=class{constructor(a){this.G=new Set;a instanceof Array?a.forEach(b=>{this.G.add(olympe.dc.ga(b))}):this.G.add(olympe.dc.ga(a))}ma(){return S(olympe.dc.$.yi)}F(){return[]}C(a,b){const c=a.run(()=>Xb(olympe.D.ec(olympe.D.fa),olympe.D.fa.C)),d=olympe.dc.ia();let e=[];const f=()=>{e.forEach(h=>{d.F(h.tag,h.relation,h.id)});e=[]},g=(h,k)=>{if(h)if(k===olympe.dc.ga(olympe.dc.CloudObject))c.update(olympe.D.Sb(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})`);
915
- this.G.has(k)?(c.update(olympe.D.fa.F),f()):(h=new Wl(k,olympe.dc.CloudObject.extendRel),e.push(h),V(d,h.tag,h.relation,g,h.id))}};a=new Wl(b,olympe.dc.CloudObject.modelRel);e.push(a);V(d,a.tag,a.relation,g,a.id);c.getContext().onDestroy(f);return c.sb()}ha(){return'{"c":"'+this.ma()+'","a":['+JSON.stringify(Array.from(this.G))+']}'}toString(){return'InstanceOf('+Array.from(this.G).join(', ')+')'}};class Wl{constructor(a,b){this.tag=a;this.relation=b;this.id=olympe.Y.Vh()}}
906
+ a.toString()).join(',')+')'}};R('olympe.dc.predicates.And',olympe.dc.$.Fd);olympe.dc.$.Fd.ya=[olympe.dc.Ba];olympe.dc.$.al=class{constructor(a,b){this.G=a;this.value=b}C(a,b){return a.run(()=>olympe.D.va([this.G,this.value.getValue(a,b)],(c,d)=>{c=c.valueOf();return olympe.D.Sb((Number(c)&Number(d.valueOf()))===Number(c))},olympe.D.fa))}ma(){return S(olympe.dc.$.al)}F(){return[this.value.C()]}ha(a){const b=olympe.D.jb(this.G)?this.G.Da.Gb.valueOf():this.G.valueOf();return'{"c":"'+this.ma()+'","a":['+b+','+this.value.ha(a)+']}'}toString(){const a=olympe.D.jb(this.G)?this.G.Da.Gb.valueOf():this.G.valueOf();
907
+ return this.ma().replace(/^.+\./,'')+'('+a.toString()+','+this.value.toString()+')'}};R('olympe.dc.predicates.BitMask',olympe.dc.$.al);olympe.dc.$.al.ya=[olympe.dc.Ba];olympe.dc.$.hf=class{constructor(a,b,c){this.source=a;this.value=b;this.G=c?c:!1}ma(){return S(olympe.dc.$.hf)}F(){return[this.source.C(),this.value.C()]}tb(){return this.source}getValue(){return this.value}C(a,b){return a.run(()=>olympe.D.va([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.Sb(c.includes(d))},olympe.D.fa))}ha(a){const b=this.source.ha(a),c=this.value.ha(a);a=Ol(a,this.G);
908
+ return'{"c":"'+this.ma()+'","a":['+b+','+c+','+a+']}'}toString(){const a=Nl(this.G);return'Contains('+this.source.toString()+','+this.value.toString()+','+a+')'}};R('olympe.dc.predicates.Contains',olympe.dc.$.hf);olympe.dc.$.hf.ya=[olympe.dc.Ba];olympe.dc.$.se=class{constructor(a,b){this.G=a;this.J=b}ma(){return S(olympe.dc.$.se)}F(){return[this.G.C(),this.J.C()]}C(a,b){return a.run(()=>olympe.D.va([this.G.getValue(a,b),this.J.getValue(a,b)],(c,d)=>'object'===typeof c&&void 0!==c.Ad?c.Ad(d):'object'===typeof d&&void 0!==d.Ad?d.Ad(c):olympe.D.Sb(c.valueOf()===d.valueOf()),olympe.D.fa,'Test equal predicate'))}ha(a){return'{"c":"'+this.ma()+'","a":['+this.G.ha(a)+','+this.J.ha(a)+']}'}toString(){return'Equals('+this.G.toString()+','+this.J.toString()+
909
+ ')'}};R('olympe.dc.predicates.Equals',olympe.dc.$.se);olympe.dc.$.se.ya=[olympe.dc.Ba];olympe.dc.$.ot=class extends olympe.dc.$.se{constructor(a,b){super(a,new olympe.dc.$a.Le(b))}};olympe.dc.$.ot.ya=[olympe.dc.Ba];olympe.dc.$.Nj=class extends olympe.dc.$.Wk{constructor(a,b){super(a,b)}ma(){return S(olympe.dc.$.Nj)}O(a,b){return a>b}};R('olympe.dc.predicates.Greater',olympe.dc.$.Nj);olympe.dc.$.vi=class{constructor(a,b,c){this.pb=[];this.G=c instanceof Array?c:void 0!==c?[olympe.dc.ga(c)]:[];a=Array.isArray(a)?a:[a];for(let d=0,e=a.length;d<e;d++)c=a[d],c instanceof olympe.dc.da.Ae?this.pb.push(new Rl(c.X(),c.Ia(),c.G,c.F)):this.pb.push(new Rl(olympe.dc.ga(c),b[d],1,1))}ma(){return S(olympe.dc.$.vi)}F(){return[this.pb.reduce((a,b)=>a.concat(b),[])]}C(a,b){const c=a.run(()=>Xb(olympe.D.ec(Boolean),!1)),d=olympe.Y.Mc(),e=olympe.dc.ia();let f=0;a=(h,k)=>{0!==this.G.length&&!this.G.includes(k)||
910
+ c.getContext().fb()||c.getContext().od()||(f+=h?1:-1,c.update(0<f))};const g=this.pb;for(let h=g.length-1;0<=h;h--)a=Sl(g[h],e,a,d+h);jf(e,b,a,d);c.getContext().onDestroy(()=>{gf(e,b,d)});return c.sb()}ha(){return'{"c":"'+this.ma()+'","a":['+JSON.stringify(this.pb.map(a=>a.ha()))+(0!==this.G.length?',"'+this.G.toString():'')+'"]}'}toString(){return'HasRelated('+(0!==this.G.length?'#'+this.G.toString()+', ':'')+this.pb.map(a=>a.ha())+')'}};R('olympe.dc.predicates.HasRelated',olympe.dc.$.vi);
911
+ function Sl(a,b,c,d){const e=Object.create(null);d+=olympe.Y.Vh();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.F(h,a,l))}};return(g,h)=>f(g,h,0)}class Rl extends olympe.dc.query.Relation{constructor(a,b,c,d){super(a,b,1!==c||1!==d);this.F=c;this.C=d}ha(){return`${this.X()}, ${this.Ia()}, ${this.F}, ${this.C}`}}olympe.dc.$.vi.ya=[olympe.dc.Ba];olympe.dc.$.Al=class{constructor(a,b,c){this.pb=[];this.G=void 0!==c?c.map(olympe.dc.ga):null;a=Array.isArray(a)?a:[a];for(let d=0,e=a.length;d<e;d++)c=a[d],c instanceof olympe.dc.da.Ae?this.pb.push(new Tl(c.X(),c.Ia(),c.G,c.F)):this.pb.push(new Tl(olympe.dc.ga(c),b[d],1,1))}ma(){return S(olympe.dc.$.Al)}F(){return[this.pb.reduce((a,b)=>a.concat(b),[])]}C(a,b){const c=a.run(()=>Xb(olympe.D.ec(Boolean),!1)),d=olympe.dc.ia(),e=olympe.Y.Vh();let f=(k,l,n)=>{l&&(null===this.G||this.G.includes(n))&&k(1)};
912
+ const g=this.pb;for(let k=g.length-1;0<=k;k--)f=Ul(g[k],d,f,e+k);let h=0;jf(d,b,f.bind(null,k=>{c.getContext().od()||c.getContext().fb()||(h+=k,c.update(0<h))}),e);a.onDestroy(()=>gf(d,b,e));return c.sb()}ha(){return'{"c":"'+this.ma()+'","a":['+JSON.stringify(this.pb.map(a=>a.ha()))+(null!==this.G?',"'+this.G.toString():'')+'"]}'}toString(){return'HasRelatedTree('+(null!==this.G?'#['+this.G.toString()+'], ':'')+this.pb.map(a=>a.ha())+')'}};R('olympe.dc.predicates.HasRelatedTree',olympe.dc.$.Al);
913
+ function Ul(a,b,c,d){const e=a.G,f=a.O,g=new Set,h=(l,n,p)=>{f.has(n)?f.get(n).set(d+p,l):f.set(n,(new Map).set(d+p,l))},k=(l,n,p,q,r)=>{const t=olympe.Y.Vh();if(q){const u=p+r,x=y=>{const z=f.get(r);if(g.has(u))throw Error(`Try to use the predicate HasRelatedTree with recursion in a graph cluster containing a loop around instances ${p} and ${r}`);void 0!==z&&null!==z&&(g.add(u),e.set(r,(e.get(r)||0)+y),Array.from(z.values()).forEach(A=>A(y)));g.delete(u)};h(l,r,p);e.has(r)?l(e.get(r)):(n>=a.F&&c(y=>
914
+ {e.set(r,(e.get(r)||0)+y);l(y)},q,r),(0>a.C||n<=a.C)&&r!==p&&V(b,r,a,k.bind(a,x,n+1,r),t))}else l(-e.get(r)),f.get(r).delete(d+p),0===f.get(r).size&&(e.delete(r),f.delete(r),b.F(r,a,t))};return(l,n,p)=>k(l,0,'origin',n,p)}class Tl extends olympe.dc.query.Relation{constructor(a,b,c,d){super(a,b,1!==c||1!==d);this.F=c;this.C=d;this.O=new Map;this.G=new Map}ha(){return`${this.X()}, ${this.Ia()}, ${this.F}, ${this.C}`}}olympe.dc.$.Al.ya=[olympe.dc.Ba];olympe.dc.$.yi=class{constructor(a){this.G=new Set;a instanceof Array?a.forEach(b=>{this.G.add(olympe.dc.ga(b))}):this.G.add(olympe.dc.ga(a))}ma(){return S(olympe.dc.$.yi)}F(){return[]}C(a,b){const c=a.run(()=>Xb(olympe.D.ec(olympe.D.fa),olympe.D.fa.C)),d=olympe.dc.ia();let e=[];const f=()=>{e.forEach(h=>{d.F(h.tag,h.relation,h.id)});e=[]},g=(h,k)=>{if(h)if(k===olympe.dc.ga(olympe.dc.CloudObject))c.update(olympe.D.Sb(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})`);
915
+ this.G.has(k)?(c.update(olympe.D.fa.F),f()):(h=new Vl(k,olympe.dc.CloudObject.extendRel),e.push(h),V(d,h.tag,h.relation,g,h.id))}};a=new Vl(b,olympe.dc.CloudObject.modelRel);e.push(a);V(d,a.tag,a.relation,g,a.id);c.getContext().onDestroy(f);return c.sb()}ha(){return'{"c":"'+this.ma()+'","a":['+JSON.stringify(Array.from(this.G))+']}'}toString(){return'InstanceOf('+Array.from(this.G).join(', ')+')'}};class Vl{constructor(a,b){this.tag=a;this.relation=b;this.id=olympe.Y.Vh()}}
916
916
  R('olympe.dc.predicates.InstanceOf',olympe.dc.$.yi);olympe.dc.$.yi.ya=[olympe.dc.Ba];olympe.dc.$.de=class{constructor(a){this.G=a}ma(){return S(olympe.dc.$.de)}F(){return this.G.F()}C(a,b){return a.run(()=>olympe.D.va([this.G.C(a,b)],c=>olympe.D.Sb(!c.valueOf()),olympe.D.fa))}ha(a){return`{"c":"${this.ma()}","a":[${this.G.ha(a)}]}`}toString(){return'Not('+this.G.toString()+')'}};R('olympe.dc.predicates.Not',olympe.dc.$.de);olympe.dc.$.de.ya=[olympe.dc.Ba];olympe.dc.$.xe=class{constructor(a){this.$=[];for(let b=arguments.length,c=0;c<b;c++)Array.isArray(arguments[c])?this.$=this.$.concat(arguments[c]):this.$.push(arguments[c])}ma(){return S(olympe.dc.$.xe)}F(){return this.$.reduce((a,b)=>a.concat(b.F()),[])}C(a,b){return a.run(()=>olympe.D.va(this.$.map(c=>c.C(a,b)),(...c)=>olympe.D.Sb(c.some(d=>d.valueOf())),olympe.D.fa))}ha(a){const b=this.$.map(c=>c.ha(a));return'{"c":"'+this.ma()+'","a":['+b.join(',')+']}'}toString(){return'Or('+this.$.map(a=>a.toString()).join(',')+
917
- ')'}};R('olympe.dc.predicates.Or',olympe.dc.$.xe);olympe.dc.$.xe.ya=[olympe.dc.Ba];olympe.dc.$.uf=class{constructor(a,b,c){this.source=a;this.J=b;this.G=void 0===c?!0:c}ma(){return S(olympe.dc.$.uf)}F(){return[this.source.C()]}tb(){return this.source}C(a,b){return a.run(()=>olympe.D.va([this.source.getValue(a,b),this.J,this.G],(c,d,e)=>{c=String(c);d=String(d);e.valueOf()||(c=c.toLowerCase(),d=d.toLowerCase());return olympe.D.Sb((new RegExp(d)).test(c))},olympe.D.fa))}ha(a){const b=this.source.ha(a),c=Pl(a,this.J);a=Pl(a,this.G);return'{"c":"'+this.ma()+'","a":['+b+','+c+','+a+
918
- ']}'}toString(){const a=Ol(this.G);return'Regex('+this.source.toString()+','+this.J+','+a+')'}};R('olympe.dc.predicates.Regex',olympe.dc.$.uf);olympe.dc.$.uf.ya=[olympe.dc.Ba];olympe.dc.$.kk=class extends olympe.dc.$.Wk{constructor(a,b){super(a,b)}ma(){return S(olympe.dc.$.kk)}O(a,b){return a<b}};R('olympe.dc.predicates.Smaller',olympe.dc.$.kk);olympe.dc.lc={};olympe.dc.lc.xj=class{constructor(){this.T=this.J=this.index=this.F=null}O(){return null!==this.F}Z(a){if(null!==this.F)throw Error('Manager already activated (depth='+this.F+')');this.F=a;this.G()}C(a,b,c){b=this.J;if(a&&null!==b)throw Error('The AutoManger handles only a single item.');a?(b=new olympe.dc.lc.Ij(this),this.index=c,this.J=b):this.J=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.T){const a=
919
- [];null!==this.J&&(0<=this.F?Xl(Yl(this.J,this.F),a):a.push(this.index));this.T(a)}}ig(a){this.T=a}};olympe.dc.lc.xj.ya=[olympe.dc.lc.Ta];function Ml(a,b,c,d){b?a.O[d]=c:delete a.O[d];null===a.F&&(a.F=new olympe.dc.lc.Ij(a.C,a));return a.F}function Yl(a,b){for(let c=0;c<b;c++)if(null!==a.F)a=a.F;else break;return a}function Xl(a,b){a=a.O;if(null!==a)for(let c in a)Object.prototype.hasOwnProperty.call(a,c)&&b.push(c)}olympe.dc.lc.Ij=class{constructor(a,b){this.C=a;this.depth=b?b.depth+1:0;this.O=Object.create(null);this.F=null}je(){return this.C}bg(){this.C.O()?this.C.G():this.C.Z(this.depth-1)}};class Zl extends olympe.dc.lc.Ij{constructor(a,b,c){super(a);this.index=b;this.tag=c;this.Z=this.T=this.J=!1;this.G=null}}
920
- function $l(a,b,c,d,e){const f=Object.create(null),g=a.ja,h=a.J;let k,l,n;a.ea=!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.J||(c.J=!0,e(!0,c.tag,c.index,c)));for(k in f)Object.prototype.hasOwnProperty.call(f,k)&&(c=h[k],c.J&&(c.J=!1,e(!1,c.tag,c.index,c)),c.T&&(c.G=null,delete h[k]),delete f[k]);a.ea=!1;null!==a.F&&a.G()}
921
- olympe.dc.lc.Nl=class{constructor(){this.J={};this.ja=[];this.F=null;this.ea=!1;this.T=[];this.aa=null}O(){return null!==this.F}Z(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.ea){var a=this.ja,b=a.length,c=this.J,d;for(d=this.T.length=0;d<b;d++){var e=c[a[d]];if(0>this.F)this.T.push(e.index);else{if(!e.Z){var f=e,g=this.F;f.Z=!0;f.G=Yl(f,
922
- g)}null!==e.G&&Xl(e.G,this.T)}}this.aa&&this.aa(this.T)}}ig(a){this.aa=a}C(a,b,c){let d=this.J[c];a?void 0===d?(d=new Zl(this,c,b),this.J[c]=d):(d.tag=b,d.T=!1):void 0!==d&&(d.T=!0);return d}};olympe.dc.lc.Nl.ya=[olympe.dc.lc.Ta];olympe.dc.lc.Ta=class{constructor(){}C(){}O(){}Z(){}G(){}ig(){}};function am(a,b){olympe.D.bf(a.value)?(a.node=olympe.D.fn(a.value,b),Db(a.node)||b()):b()}function bm(a,b){if(olympe.D.bf(a.value)){const c=olympe.D.$a(),d=a.J;olympe.D.Nc([a.value],e=>{d!==e.valueOf()&&(c.run(()=>am(a,b)),olympe.D.$a().destroy())})}}
923
- class cm extends olympe.dc.lc.Ij{constructor(a,b,c){super(a);this.index=b;this.value=c;this.J=this.Na();this.position=this.node=null;this.T=!1;this.G=null}Na(){const a=olympe.D.Na(this.value);return a?a.valueOf():a}destroy(){this.node&&(this.node.destroy(),this.node=null);this.G=this.value=null}eb(){return null===this.value}}
924
- function dm(a,b){if(!b.eb()){var c=a.F;var d=a.ja,e=b.Na(),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].J,e);if(0===k||2>g-f){0>k&&null!==b.position&&b.position<=h&&(k=d(c[g].J,e));h=0>k?g:h;break}0>k?f=h:g=h}c=h;b.J=b.Na();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.T&&a.G()}}}
925
- function em(a){const b=a.ja;a.F.sort((c,d)=>b(c.Na(),d.Na()))}
926
- olympe.dc.lc.Xq=class{constructor(a){this.ja=a;this.J=null;this.F=[];this.T=[];this.aa=null;this.ea=new Map}C(a,b,c,d){b='$'+c;const e=this.F;let f;if(a)f=new cm(this,c,d),this.ea.set(b,f),this.O()?am(f,()=>dm(this,f)):(f.position=e.length,e.push(f));else{f=this.ea.get(b);if(void 0===f)throw Error('Trying to remove an non-registered item: "'+c+'"');this.ea.delete(b);null!==f.position&&(this.O()?this.remove(f):delete e[f.position]);f.destroy()}return f}O(){return null!==this.J}Z(a){if(null!==this.J)throw Error('Manager already activated (depth='+
927
- this.J+')');this.J=a;em(this);for(let b=0,c=this.F.length;b<c;b++){const d=this.F[b];d.position=b;bm(d,()=>dm(this,d))}this.G()}G(){if(null===this.J)throw Error('Manager not activated, need to set a depth before updating ranks');const a=this.F.length;this.T.length=0;for(let d=0;d<a;d++){let e=this.F[d];if(!e.T){var b=e,c=this.J;b.T=!0;b.G=Yl(b,c)}0>this.J?this.T.push(e.index):e.G&&Xl(e.G,this.T)}this.aa&&this.aa(this.T)}ig(a){this.aa=a}remove(a){const b=this.F,c=b.length-1;if(null!==a.position){for(a=
928
- a.position;a<c;a++)b[a]=b[a+1],b[a].position=a;b.length=c}}};olympe.dc.lc.Xq.ya=[olympe.dc.lc.Ta];function Hl(a){if(!a.F){for(let b in a.G)fm(a.G[b]);a.F=!0}a.J=null;a.O=null}function Kl(a,b,c){a.G[c||'root'].T=b}function Ll(a,b,c){a.G[c||'root'].bg(b)}function gm(a,b,c,d){const e=a.O,f=b+d+c;let g=e[f];void 0===g&&(g=Rg(a.db,b,c,d),e[f]=g);return g}function hm(a,b){a.F||a.C.bg(b)}function im(a,b,c,d,e){if(!a.F){let f=gm(a,c,d,e||olympe.dc.wa.DESTINATION);e||(f+=gm(a,c,d,olympe.dc.wa.ORIGIN));0===f&&hm(a,b)}}
929
- function jm(a,b){const c=a.G[b];void 0!==c?(a.H&&a.H.debug('Set current block to',b,null!==c.G?'parent = '+c.G.U():''),a.C=c):a.H&&a.H.error('Try to set a block that does not exists:',b)}function km(a){const b=String(++a.T),c=a.C;a.G[b]=new lm(b,c);mm(c,b);c.J||(c.J=()=>jm(a,c.U()));return b}function nm(a,b){const c=a.C;a.C.J=()=>{jm(a,c.U());b()}}function om(a,b){fm(b?a.G[b]:a.C)}
930
- olympe.dc.lc.Yq=class{constructor(a,b){this.db=a;this.H=b||null;this.J=Object.create(null);this.O=Object.create(null);this.F=!1;this.T=0;this.C=new lm('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=gm(this,c,d,e),d=this.J[b]||0,this.J[b]=++d,this.C.C===b&&c<=d&&(this.C.C=a)):this.C.C=a)}};function mm(a,b){null===a.F&&(a.F=Object.create(null));a.F[b]=!1}function fm(a){a.O=!0;null!==a.G&&a.G.notify(a.id)}
931
- class lm{constructor(a,b){this.id=a;this.G=b||null;this.C=this.T=this.J=this.F=null;this.O=!1}U(){return this.id}bg(a){const b=this.T;if(this.O||this.C===a||null===a)b&&b(),!b&&fm(this)}notify(a){const b=this.J,c=this.F;if(this.O)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.Za={};function pm(a,b,c,d){const e=olympe.dc.ia(),f=new olympe.dc.lc.xj,g=new olympe.dc.lc.Yq(e);let h=!1;const k=Object.create(null),l=q=>{if(0<q.length)for(const r in k)q[0]===r&&d(k[r])};let n=(q,r,t,u)=>{a.od()||a.eb()||(h||(Kl(g,()=>{u.bg();Hl(g)}),u.je().ig(l),h=!0),q?k[t]=r:delete k[t],Ll(g,t))};if(null!==c)for(let q=c.length-1;0<=q;q--)n=c[q].C(a,g,n);const p=olympe.Y.Mc();jf(e,b,(q,r)=>{g.register(p,null);const t=f.C(q,b,p,null);n(q,r,p,Ml(t,q,b,p))},p);a.onDestroy(()=>{gf(e,b,p)});e.Ha(b)||Hl(g)}
932
- function qm(a,b,c){const d=c.getContext(),e=olympe.dc.ia(),f=a.G(),g=Cg(e,b,a.J,d.G(h=>{null!==h&&(h=f(h));null===h?c.clear():c.update(h)}));d.onDestroy(()=>Dg(e,b,a.J,g))}
933
- olympe.dc.Za.gi=class{constructor(a,b,c){this.J=a&&a.X?a.X():a;this.da=b&&b.filter(d=>d instanceof olympe.dc.da.Qe||d instanceof olympe.dc.da.Ae)||null;this.F=c||null;this.defaultValue=null}ma(){}Mb(){}G(){}C(){return(this.da||[]).reduce((a,b)=>a.concat(olympe.dc.query.Relation.from(b)),[])}eh(a){this.defaultValue=a;return this}Xg(){return this.da}Wd(){return this.F}getValue(a,b){const c=a.run(()=>olympe.D.ec(this.Mb()||Object,'AbstractProperty valueType'));null!==this.defaultValue&&Xb(c,this.defaultValue);
934
- b=this.F||b;null!==this.da?pm(a,b,this.da,d=>{qm(this,d,c)}):qm(this,b,c);return c.sb()}ha(a){const b=Pl(a,this.J),c=Pl(a,this.F);let d='null';this.da&&(d=this.da.map(function(e){return e.ha(a)}).join(','));return`{"c":"${this.ma()}","a":["${b}",${d},${c}]}`}toString(){const a=Ol(this.J),b=this.F?','+Ol(this.F):'';let c='';this.da&&(c=','+this.da.join(','));return this.ma().replace(/^.+\./,'')+'('+a+c+b+')'}};olympe.dc.Za.gi.ya=[olympe.dc.qk];olympe.dc.Za.Fn=class{constructor(a,b){if(olympe.D.bf(a))throw Error('Dataflows of Property not supported by AnyProperty');const c=a.X();var d=olympe.dc.ia();const e=d.Kb(a,olympe.dm.Property.typeRel);if(!e)throw Error('Type of property '+a+'unavailable locally, cannot proceed with AnyProperty');a=d.Vg(e,olympe.dc.CloudObject.extendRel,olympe.dm.ye);d=null;switch(1<a.length?a[a.length-2]:e){case olympe.dm.String.P.X():d=new olympe.dc.Za.Oi(c,b);break;case olympe.dm.Number.P.X():d=new olympe.dc.Za.Hi(c,
935
- b);break;case olympe.dm.Boolean.P.X():d=new olympe.dc.Za.yj(c,b);break;case olympe.dm.DateTime.P.X():d=new olympe.dc.Za.li(c,b)}this.F=d}ma(){return this.F.ma()}C(){return this.F.C()}getValue(a,b){return this.F.getValue(a,b)}ha(a){return this.F.ha(a)}toString(){return this.F.toString()}};olympe.dc.Za.Fn.ya=[olympe.dc.qk];olympe.dc.Za.yj=class extends olympe.dc.Za.gi{constructor(a,b,c){super(a,b,c)}ma(){return S(olympe.dc.Za.yj)}G(){return olympe.dc.nb.Hm}Mb(){return olympe.D.fa}};R('olympe.dc.valuedefs.BooleanProperty',olympe.dc.Za.yj);olympe.dc.Za.Le=class{constructor(a){this.value=a}ma(){return S(olympe.dc.Za.Le)}C(){return[]}getValue(){return this.value}ha(a){a=Pl(a,this.value);return`{"c":"${this.ma()}","a":[${a}]}`}toString(){return`Constant(${Ol(this.value)})`}};R('olympe.dc.valuedefs.Constant',olympe.dc.Za.Le);olympe.dc.Za.Le.ya=[olympe.dc.qk];olympe.dc.Za.li=class extends olympe.dc.Za.gi{constructor(a,b,c){super(a,b,c)}ma(){return S(olympe.dc.Za.li)}G(){return olympe.dc.nb.Im}Mb(){return olympe.D.fb}};R('olympe.dc.valuedefs.DateTimeProperty',olympe.dc.Za.li);olympe.dc.Za.Hi=class extends olympe.dc.Za.gi{constructor(a,b,c){super(a,b,c)}ma(){return S(olympe.dc.Za.Hi)}G(){return olympe.dc.nb.Jm}Mb(){return olympe.D.ba}};R('olympe.dc.valuedefs.NumberProperty',olympe.dc.Za.Hi);olympe.dc.Za.Oi=class extends olympe.dc.Za.gi{constructor(a,b,c){super(a,b,c)}ma(){return S(olympe.dc.Za.Oi)}G(){return olympe.dc.nb.Km}Mb(){return olympe.D.Pa}};R('olympe.dc.valuedefs.StringProperty',olympe.dc.Za.Oi);olympe.dc.Za.Qi=class{ma(){return S(olympe.dc.Za.Qi)}C(){return[]}getValue(a,b){return b}ha(){return'{"c":"'+this.ma()+'","a":[]}'}toString(){return'Tag()'}};R('olympe.dc.valuedefs.Tag',olympe.dc.Za.Qi);olympe.dc.Za.Qi.ya=[olympe.dc.qk];olympe.dc.da={};olympe.dc.da.mi=class{Mb(){return null}ma(){return S(olympe.dc.da.mi)}C(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,Ml(h,!0,f,f))):(d[f]++,hm(b,g)):void 0!==d[f]&&0>=--d[f]&&(delete d[f],c(!1,f,f,Ml(h,!1,f,f)))}}ha(){return'{"c":"'+this.ma()+'"}'}toString(){return'Distinct()'}};R('olympe.dc.transformers.Distinct',olympe.dc.da.mi);olympe.dc.da.mi.ya=[olympe.dc.wf];olympe.dc.da.jf=class{constructor(a){this.F=a}Mb(){return null}ma(){return S(olympe.dc.da.jf)}G(){return this.F.F()}C(a,b,c){function d(f,g,h,k){k=k.valueOf();!1===k&&hm(b,g);k!==!!e[g]&&(e[g]=k,c(k,f,g,Ml(h,k,f,g)))}const e={};return(f,g,h,k)=>{const l='@'+h;if(f){let n=this.F.C(a,g);olympe.D.jb(n)&&(n=n.Da);olympe.D.Jf(n)?(b.F||void 0!==olympe.D.Na(n)||hm(b,h),e[l]=n,a.run(()=>{olympe.D.Nc([n],p=>{d(g,h,k,p)},'filterResultHandler')})):d(g,h,k,n)}else void 0!==e[l]&&(e[l].destroy(),delete e[l]),
936
- d(g,h,k,!1),delete e[h]}}ha(a){return'{"c":"'+this.ma()+'","a":['+this.F.ha(a)+']}'}toString(){return'Filter('+this.F.toString()+')'}};R('olympe.dc.transformers.Filter',olympe.dc.da.jf);olympe.dc.da.jf.ya=[olympe.dc.wf,olympe.dc.mq];olympe.dc.da.ul=class{constructor(a,b,c,d){this.F=new olympe.dc.Oa.Relation(olympe.dc.ga(a),c||olympe.dc.wa.DESTINATION);this.G=new olympe.dc.Oa.Relation(olympe.dc.ga(b),d||olympe.dc.wa.DESTINATION)}Mb(){return Ff(this.F)}ma(){return S(olympe.dc.da.ul)}C(a,b,c){const d=olympe.dc.ia(),e={},f=this.F.X(),g=this.F.Ia(),h=this.G.X(),k=this.G.Ia();let l=null,n=null;const p=(r,t,u,x,y,z)=>{if(y){if(y=()=>{const A=olympe.Y.vb(u+g+(f+'_'+r)+z,20),D=Ml(t,!0,z,A);l=r;n=()=>{c(!1,z,A,Ml(t,!1,z,A))};b.register(A,
937
- u,x,f,g);c(!0,z,A,D)},y.Xr=r,e[x]=y,null===l||r<l)n&&n(),y()}else if(l===r){n();e[x]=!0;y=Infinity;let A=null;for(let D=Object.keys(e),O=D.length,M=0;M<O;M++){let xa=e[D[M]];xa.Xr<y&&(y=xa.Xr,A=xa)}A&&A()}},q=(r,t,u,x,y)=>{x?e[y]||(e[y]=!0,im(b,u,y,f,g),im(b,u,y,h,k),V(d,y,this.F,p.bind(this,r,t,u,y),u+'_val'),V(d,y,this.G,q.bind(this,r+1,t,u),u+'_follow')):(d.F(y,this.G,u+'_follow'),d.F(y,this.F,u+'_val'),delete e[y])};return(r,t,u,x)=>q(0,x,u,r,t)}ha(){return'{"c":"'+this.ma()+'","a":["'+this.F.toString()+
938
- '","'+this.G.toString()+'"]}'}toString(){return'FirstRelated('+this.F.toString()+', '+this.G.toString()+')'}};R('olympe.dc.transformers.FirstRelated',olympe.dc.da.ul);olympe.dc.da.ul.ya=[olympe.dc.wf];olympe.dc.da.uh=class{constructor(a,b){this.start=a;this.F=b}Mb(){return null}ma(){return S(olympe.dc.da.uh)}C(a,b,c){const d=new olympe.dc.lc.Nl;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]);$l(d,e,f,n,c)}};a.run(()=>olympe.D.Nc([this.start,this.F],(n,p)=>{f=n.valueOf();g=p.valueOf();k()}));nm(b,k);const l=km(b);jm(b,l);return(n,p,q,r)=>{h||(r.je().ig(t=>{e=t;om(b,l)}),Kl(b,()=>r.bg(),l),h=!0);d.C(n,p,q,null);Ll(b,q,l)}}ha(a){return'{"c":"'+
939
- this.ma()+'","a":['+Pl(a,this.start)+','+Pl(a,this.F)+']}'}toString(){return`Limit(${olympe.D.Na(this.start)},${olympe.D.Na(this.F)})`}};R('olympe.dc.transformers.Limit',olympe.dc.da.uh);olympe.dc.da.uh.ya=[olympe.dc.wf];function rm(a){return a.pb.map(b=>b.X())}
940
- olympe.dc.da.Rj=class{constructor(a,b){this.direction=b||olympe.dc.wa.DESTINATION;this.pb=a.map(c=>new olympe.dc.Oa.Relation(c,this.direction))}Mb(){return olympe.dc.CloudObject}ma(){return S(olympe.dc.da.Rj)}Ia(){return this.direction}C(a,b,c){const d=olympe.dc.ia(),e=(f,g,h,k)=>V(d,f,k,(l,n)=>{var p=k.X();p=olympe.Y.vb(g+k.Ia()+p+n,20);const q=Ml(h,l,n,p);l&&b.register(p,g,f,k.X(),k.Ia());c(l,n,p,q)},g);return(f,g,h,k)=>{f?this.pb.forEach(l=>{im(b,h,g,l.X(),l.Ia());e(g,h,k,l)}):this.pb.forEach(l=>
941
- {d.F(g,l,h)})}}ha(){return'{"c":"'+this.ma()+'","a":['+JSON.stringify(rm(this))+',"'+this.direction+'"]}'}toString(){return'MultiRelated('+this.Ia()+'['+rm(this).join(',')+'])'}};R('olympe.dc.transformers.MultiRelated',olympe.dc.da.Rj);olympe.dc.da.Rj.ya=[olympe.dc.wf];olympe.dc.da.Ae=class extends olympe.dc.Oa.Relation{constructor(a,b=olympe.dc.wa.DESTINATION,c=1,d=-1){super(a,b);this.G=c;this.F=d}Mb(){return Ff(this)}ma(){return S(olympe.dc.da.Ae)}C(a,b,c){const d=olympe.dc.ia(),e=Object.create(null),f=olympe.dc.wa.ORIGIN,g=olympe.dc.wa.DESTINATION,h=this.X(),k=this.Ia(),l=(p,q,r)=>{if(!(0<=this.F&&p>=this.F)){var t=d.bb(r,this);p+=1;for(let u=0,x=t.length;u<x;u++){if(void 0!==e[t[u]]||r===t[u])continue;const y=olympe.Y.vb(q+k+(h+'_'+p)+t[u],20);b.register(y,
942
- q,r,h,k||g);null===k&&b.register(y,q,r,h,f)}}},n=(p,q,r,t,u,x)=>{u&&!b.F&&l(p,t,x);p>=this.G?c(u,x,t,Ml(r,u,x,t)):im(b,t,x,h,k);0<=this.F&&p>=this.F||(u?e[x]||(e[x]=!0,V(d,x,this,(y,z)=>{const A=p+1,D=olympe.Y.vb(t+k+(h+'_'+A)+z,20);n(A,x,r,D,y,z)},t)):(d.F(x,this,t),delete e[x]))};return(p,q,r,t)=>n(0,null,t,r,p,q)}ha(){return'{"c":"'+this.ma()+'","a":["'+this.X()+'","'+this.Ia()+'",'+this.G+','+this.F+']}'}toString(){return'RecursiveRelated('+this.Ia()+this.X()+'['+this.G+'..'+this.F+'])'}};
943
- R('olympe.dc.transformers.RecursiveRelated',olympe.dc.da.Ae);olympe.dc.da.Ae.ya=[olympe.dc.wf];olympe.dc.da.Qe=class extends olympe.dc.Oa.Relation{constructor(a,b){super(a,b||olympe.dc.wa.DESTINATION)}Mb(){return Ff(this)}ma(){return S(olympe.dc.da.Qe)}bc(){return new olympe.dc.da.Qe(this.tag,this.direction===olympe.dc.wa.DESTINATION?olympe.dc.wa.ORIGIN:olympe.dc.wa.DESTINATION)}C(a,b,c){const d=olympe.dc.ia(),e=this.X(),f=this.Ia();return(g,h,k,l)=>{im(b,k,h,e,f);g?V(d,h,this,(n,p)=>{const q=olympe.Y.vb(k+f+e+p,20),r=Ml(l,n,p,q);n&&b.register(q,k,h,e,f);c(n,p,q,r)},k):d.F(h,this,k)}}ha(){return'{"c":"'+
944
- this.ma()+'","a":["'+this.X()+'","'+this.Ia()+'"]}'}toString(){return'Related('+this.Ia()+this.X()+')'}};R('olympe.dc.transformers.Related',olympe.dc.da.Qe);olympe.dc.da.Qe.ya=[olympe.dc.wf];olympe.dc.da.Kg=class{constructor(a,b){this.Hb=a;this.F=void 0===b?!0:!!b}Mb(){return null}ma(){return S(olympe.dc.da.Kg)}Rg(){return this.Hb}G(){return[this.Hb.J()]}C(a,b,c){const d=new olympe.dc.lc.Xq(a.G(this.F?this.Hb.compare.bind(this.Hb):(e,f)=>this.Hb.compare(f,e)));return(e,f,g)=>{var h=e?this.Hb.G(a,f):void 0;h=d.C(e,f,g,h);c(e,f,g,h)}}ha(a){return'{"c":"'+this.ma()+'","a":['+this.Hb.ha(a)+','+JSON.stringify(this.F)+']}'}toString(){return'Sort('+this.Hb.toString()+','+JSON.stringify(this.F)+
945
- ')'}};R('olympe.dc.transformers.Sort',olympe.dc.da.Kg);olympe.dc.da.Kg.ya=[olympe.dc.wf,olympe.dc.mq];function sm(a,b,c,d,e,f){function g(n,p){if(l)for(var q=l.length-1;0<=q;q--)f=l[q].C(b,e,f);e.register(h,null);q=d.C(n,p,c,null);f(n,p,h,Ml(q,n,p,h))}const h=olympe.Y.Mc(),k=olympe.dc.ia(),l=a.da;b.run(()=>olympe.D.Nc([a.F],n=>{tm(k,n,g,h);void 0===k.model(n)&&Hl(e)}))}function tm(a,b,c,d){const e=b&&b.valueOf();e&&(jf(a,e,c,d),olympe.D.$a().Z(()=>gf(a,e,d)))}
946
- olympe.dc.da.xf=class{constructor(a,b){this.da=this.F=null;a instanceof olympe.dc.za?(this.F=a.Wd(),this.da=a.Hl()):(this.F=a,b&&(this.da=b))}Mb(){return null}ma(){return S(olympe.dc.da.xf)||''}Xg(){return this.da}Wd(){return this.F}C(a,b,c){const d=new olympe.dc.lc.Nl,e=new olympe.dc.lc.xj;let f=[],g=[],h=!1,k=!1;const l=km(b),n=km(b);nm(b,()=>{const p=f.concat(g);0<p.length?b.F||(b.C.C=p[p.length-1]):om(b);$l(d,p,0,p.length,c)});jm(b,n);sm(this,a,this.F,e,b,(p,q,r,t)=>{const u=olympe.D.$a();u.od()||
947
- u.eb()||(k||(t.je().ig(x=>{g=x;om(b,n)}),Kl(b,()=>t.bg(),n),k=!0),d.C(p,q,r),Ll(b,r,n))});jm(b,l);return(p,q,r,t)=>{h||(t.je().ig(u=>{f=u;om(b,l)}),Kl(b,()=>t.bg(),l),h=!0);d.C(p,q,r,l);Ll(b,r,l)}}ha(a){const b=this.da?'['+this.da.map(c=>c.ha(a)).join(',')+']':'null';return'{"c":"'+this.ma()+'","a":['+Pl(a,this.F)+','+b+']}'}toString(){const a=olympe.D.jb(this.F)?'N:'+this.F.Da.U():this.F.valueOf(),b=this.da?','+this.da.map(c=>c.toString()).join(','):'';return'Union('+a+b+')'}};
948
- R('olympe.dc.transformers.Union',olympe.dc.da.xf);olympe.dc.da.xf.ya=[olympe.dc.wf];olympe.dc.da.Dq={GA:1,Gt:-1,Ft:0};olympe.dc.da.hC={oz:!0,Pz:!1};olympe.dc.kc.R={zp:'dc.legacy.listdefProcessor'};olympe.dc.kc.V={yp:'dc.legacy.listdefsCovered'};olympe.W.config(a=>{F(a,olympe.dc.kc.V.yp,!1);C(a,olympe.dc.kc.R.zp,olympe.dc.kc.xu,olympe.dc.query.R.Ca,olympe.dc.R.jh,olympe.dc.transaction.R.Ea,olympe.dc.query.R.Zj,new olympe.W.oa(olympe.dc.V.Gh),new olympe.W.oa(olympe.dc.kc.V.yp))});olympe.W.run([olympe.dc.kc.R.zp],a=>{olympe.dc.kc.zx=()=>a});function um(a){const b=olympe.dc.ia(),c=new Map;b.Mr(a).forEach(d=>{b.bb(d,olympe.dc.CloudObject.propertyRel).forEach(e=>{const f=b.name(e);c.has(f)||c.set(f,e)})});return c}
949
- olympe.dc.CloudObject=class{constructor(a,b){this.tag=b;this.db=olympe.dc.ia();this.model=null}static $c(a,b,c,...d){b=olympe.dc.ga(b);var e=lf(b);(e=e&&e.C)?e(a,c,...d):(a=a.create(b),void 0!==c&&null!==c&&Z(a,olympe.dc.CloudObject.nameProp,c),a.X())}static get(a){if(a instanceof olympe.dc.CloudObject)var b=a;else{b=olympe.dc.Qr();a=olympe.dc.ga(a);var c=b.db.model(a);c=kf(b,c);if(null===c)throw new olympe.dc.Zp(a);c=c.instantiate(a,b.F);b.C.C.gb([a]);b.Oa.register(c,a);b=c}return b}static exists(a){return olympe.dc.ia().Ha(olympe.dc.ga(a))}static Dw(a,
950
- b,c){const d=olympe.dc.ia();let e=null;const f=k=>{null===e&&(e=um(b||this));return e.has(k)?e.get(k):null},g=jl(!1),h=g.create(null!=b?b:this);void 0!==c&&h.ci(c);a.forEach((k,l)=>{d.Ha(olympe.dc.ga(l))?Z(h,l,k):(l=f(l))&&Z(h,l,k)});g.ob((k,l)=>{k||olympe.ka.ib('dc').error(`Error occurred for transaction executed by CloudObject.createWith: ${l}`)});return this.get(h)}static ow(){return this.get(this)}static Ik(a){return olympe.dc.pa.Ik(a)}static Cb(){return olympe.dc.ia().bb(this,olympe.dc.CloudObject.propertyRel).map(a=>
951
- new olympe.dc.Oa.Property(a))}static yd(){const a=olympe.dc.ia();return a.bb(this,olympe.dc.CloudObject.mj).map(b=>new olympe.dc.Oa.Relation(b)).concat(a.bb(this,olympe.dc.CloudObject.Er).map(b=>new olympe.dc.Oa.Relation(b,olympe.dc.wa.ORIGIN)))}static Lc(a){return olympe.dc.CloudObject.get(a)}static Rr(a){var b=kf(olympe.dc.Qr(),olympe.dc.ga(a));b=b&&b.F;return new olympe.dc.za(olympe.dc.ga(a),olympe.dc.CloudObject.instancesRel,b)}X(){return this.tag}name(){return this.db.name(this)}ma(){return this.zb(olympe.dc.CloudObject.nameProp)}Vb(){this.model||
952
- (this.model=olympe.dc.CloudObject.get(this.db.model(this)));return this.model}query(){return olympe.dc.pa.from(this)}Lf(){return this.db.Lf(this)}tb(){return this.db.source(this)}wx(){return this.db.ai(this)?olympe.dc.Zd().fromModel(this):null}Lr(){return olympe.D.va([this.ma()],a=>olympe.D.Ab(a),olympe.D.Pa,'getDisplayName',olympe.D.Ab('('+this.toString()+')'))}cc(){return this.model?this.model.X():this.db.model(this)}observe(a,b,c=!0){const d='function'===typeof a.F?a.F():a;return new rxjs.Observable(e=>
953
- {const f=olympe.dc.nb.Ac(this.db.Sa(this.tag,b));c||null!==f||e.next(f);const g=Cg(this.db,this.tag,b,h=>{e.next(olympe.dc.nb.Ac(h))});d.Z(()=>{e.complete();Dg(this.db,this.tag,b,g)});return()=>Dg(this.db,this.tag,b,g)})}Fy(a){const b='function'===typeof a.F?a.F():a;return new rxjs.Observable(c=>{const d=Eg(this.db,this.tag,(e,f)=>{null===f||void 0===f?c.next([new olympe.dc.Oa.Property(e),null]):c.next([new olympe.dc.Oa.Property(e),f])});b.Z(()=>{c.complete();Fg(this.db,this.tag,d)});return()=>Fg(this.db,
954
- this.tag,d)})}Gy(a){return this.observe(olympe.D.$a(),a)}get(a){return olympe.dc.nb.Ac(this.db.Sa(this.tag,a))}Sa(a){return this.get(a)}hb(a){return olympe.dc.pa.from(this).hb(a)}xk(a){return olympe.dc.gd.from(this).hb(a)}Ac(){return this}ex(){return this.pc(olympe.dc.CloudObject.zw,olympe.dc.CloudObject)}Sm(){return this.bb(olympe.dc.CloudObject.containsRel,olympe.dc.CloudObject)}Hf(a,b,c){const d=olympe.D.ec(c,'Sync valueType'),e=Cg(this.db,this.tag,a,olympe.D.$a().G(f=>{b&&null!==f&&void 0!==f&&
955
- (f=b(f));null===f||void 0===f?d.clear():d.update(f)}));d.getContext().onDestroy(()=>Dg(this.db,this.tag,a,e));return d.getContext()}zb(a){return L(this.Hf(a,olympe.dc.nb.Km,olympe.D.Pa))}nd(a){return L(this.Hf(a,olympe.dc.nb.Jm,olympe.D.ba))}Ug(a){return L(this.Hf(a,olympe.dc.nb.Hm,olympe.D.fa))}gj(a){return L(this.Hf(a,olympe.dc.nb.Im,olympe.D.fb))}Vr(){return L(this.Hf(olympe.dm.Color.valueProp,olympe.dc.nb.xr,olympe.D.Color))}Wr(){return L(this.Hf(olympe.sc.workflow.Transition.processRefProp,olympe.dc.nb.yr,
956
- olympe.dc.CloudObject))}bb(a,b){a=a instanceof olympe.dc.da.Qe?a:new olympe.dc.da.Qe(a.X(),a.Ia());return new olympe.dc.za(this.X(),a,b)}pc(a,b){return this.bb(a,b).Fc()}Hr(a,b){const c=this.db,d=olympe.Y.Mc(),e=olympe.D.$a(),f=new Map;V(c,this.tag,a,(g,h)=>{if(g)(g=e.run(b,olympe.dc.CloudObject.get(h)))&&f.set(h,g);else{let k;null==(k=f.get(h))||k();f.delete(h)}},d);e.onDestroy(()=>{c.F(this.tag,a,d)})}hz(){return new olympe.dc.za(this.X(),[],Df(this.X()))}transform(...a){return(new olympe.dc.za(this.X(),
917
+ ')'}};R('olympe.dc.predicates.Or',olympe.dc.$.xe);olympe.dc.$.xe.ya=[olympe.dc.Ba];olympe.dc.$.uf=class{constructor(a,b,c){this.source=a;this.J=b;this.G=void 0===c?!0:c}ma(){return S(olympe.dc.$.uf)}F(){return[this.source.C()]}tb(){return this.source}C(a,b){return a.run(()=>olympe.D.va([this.source.getValue(a,b),this.J,this.G],(c,d,e)=>{c=String(c);d=String(d);e.valueOf()||(c=c.toLowerCase(),d=d.toLowerCase());return olympe.D.Sb((new RegExp(d)).test(c))},olympe.D.fa))}ha(a){const b=this.source.ha(a),c=Ol(a,this.J);a=Ol(a,this.G);return'{"c":"'+this.ma()+'","a":['+b+','+c+','+a+
918
+ ']}'}toString(){const a=Nl(this.G);return'Regex('+this.source.toString()+','+this.J+','+a+')'}};R('olympe.dc.predicates.Regex',olympe.dc.$.uf);olympe.dc.$.uf.ya=[olympe.dc.Ba];olympe.dc.$.kk=class extends olympe.dc.$.Wk{constructor(a,b){super(a,b)}ma(){return S(olympe.dc.$.kk)}O(a,b){return a<b}};R('olympe.dc.predicates.Smaller',olympe.dc.$.kk);olympe.dc.lc={};olympe.dc.lc.xj=class{constructor(){this.T=this.J=this.index=this.F=null}O(){return null!==this.F}Z(a){if(null!==this.F)throw Error('Manager already activated (depth='+this.F+')');this.F=a;this.G()}C(a,b,c){b=this.J;if(a&&null!==b)throw Error('The AutoManger handles only a single item.');a?(b=new olympe.dc.lc.Ij(this),this.index=c,this.J=b):this.J=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.T){const a=
919
+ [];null!==this.J&&(0<=this.F?Wl(Xl(this.J,this.F),a):a.push(this.index));this.T(a)}}ig(a){this.T=a}};olympe.dc.lc.xj.ya=[olympe.dc.lc.Ta];function Ll(a,b,c,d){b?a.O[d]=c:delete a.O[d];null===a.F&&(a.F=new olympe.dc.lc.Ij(a.C,a));return a.F}function Xl(a,b){for(let c=0;c<b;c++)if(null!==a.F)a=a.F;else break;return a}function Wl(a,b){a=a.O;if(null!==a)for(let c in a)Object.prototype.hasOwnProperty.call(a,c)&&b.push(c)}olympe.dc.lc.Ij=class{constructor(a,b){this.C=a;this.depth=b?b.depth+1:0;this.O=Object.create(null);this.F=null}je(){return this.C}bg(){this.C.O()?this.C.G():this.C.Z(this.depth-1)}};class Yl extends olympe.dc.lc.Ij{constructor(a,b,c){super(a);this.index=b;this.tag=c;this.Z=this.T=this.J=!1;this.G=null}}
920
+ function Zl(a,b,c,d,e){const f=Object.create(null),g=a.ja,h=a.J;let k,l,n;a.ea=!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.J||(c.J=!0,e(!0,c.tag,c.index,c)));for(k in f)Object.prototype.hasOwnProperty.call(f,k)&&(c=h[k],c.J&&(c.J=!1,e(!1,c.tag,c.index,c)),c.T&&(c.G=null,delete h[k]),delete f[k]);a.ea=!1;null!==a.F&&a.G()}
921
+ olympe.dc.lc.Nl=class{constructor(){this.J={};this.ja=[];this.F=null;this.ea=!1;this.T=[];this.aa=null}O(){return null!==this.F}Z(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.ea){var a=this.ja,b=a.length,c=this.J,d;for(d=this.T.length=0;d<b;d++){var e=c[a[d]];if(0>this.F)this.T.push(e.index);else{if(!e.Z){var f=e,g=this.F;f.Z=!0;f.G=Xl(f,
922
+ g)}null!==e.G&&Wl(e.G,this.T)}}this.aa&&this.aa(this.T)}}ig(a){this.aa=a}C(a,b,c){let d=this.J[c];a?void 0===d?(d=new Yl(this,c,b),this.J[c]=d):(d.tag=b,d.T=!1):void 0!==d&&(d.T=!0);return d}};olympe.dc.lc.Nl.ya=[olympe.dc.lc.Ta];olympe.dc.lc.Ta=class{constructor(){}C(){}O(){}Z(){}G(){}ig(){}};function $l(a,b){olympe.D.bf(a.value)?(a.node=olympe.D.fn(a.value,b),Db(a.node)||b()):b()}function am(a,b){if(olympe.D.bf(a.value)){const c=olympe.D.Wa(),d=a.J;olympe.D.Nc([a.value],e=>{d!==e.valueOf()&&(c.run(()=>$l(a,b)),olympe.D.Wa().destroy())})}}
923
+ class bm extends olympe.dc.lc.Ij{constructor(a,b,c){super(a);this.index=b;this.value=c;this.J=this.Na();this.position=this.node=null;this.T=!1;this.G=null}Na(){const a=olympe.D.Na(this.value);return a?a.valueOf():a}destroy(){this.node&&(this.node.destroy(),this.node=null);this.G=this.value=null}fb(){return null===this.value}}
924
+ function cm(a,b){if(!b.fb()){var c=a.F;var d=a.ja,e=b.Na(),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].J,e);if(0===k||2>g-f){0>k&&null!==b.position&&b.position<=h&&(k=d(c[g].J,e));h=0>k?g:h;break}0>k?f=h:g=h}c=h;b.J=b.Na();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.T&&a.G()}}}
925
+ function dm(a){const b=a.ja;a.F.sort((c,d)=>b(c.Na(),d.Na()))}
926
+ olympe.dc.lc.Xq=class{constructor(a){this.ja=a;this.J=null;this.F=[];this.T=[];this.aa=null;this.ea=new Map}C(a,b,c,d){b='$'+c;const e=this.F;let f;if(a)f=new bm(this,c,d),this.ea.set(b,f),this.O()?$l(f,()=>cm(this,f)):(f.position=e.length,e.push(f));else{f=this.ea.get(b);if(void 0===f)throw Error('Trying to remove an non-registered item: "'+c+'"');this.ea.delete(b);null!==f.position&&(this.O()?this.remove(f):delete e[f.position]);f.destroy()}return f}O(){return null!==this.J}Z(a){if(null!==this.J)throw Error('Manager already activated (depth='+
927
+ this.J+')');this.J=a;dm(this);for(let b=0,c=this.F.length;b<c;b++){const d=this.F[b];d.position=b;am(d,()=>cm(this,d))}this.G()}G(){if(null===this.J)throw Error('Manager not activated, need to set a depth before updating ranks');const a=this.F.length;this.T.length=0;for(let d=0;d<a;d++){let e=this.F[d];if(!e.T){var b=e,c=this.J;b.T=!0;b.G=Xl(b,c)}0>this.J?this.T.push(e.index):e.G&&Wl(e.G,this.T)}this.aa&&this.aa(this.T)}ig(a){this.aa=a}remove(a){const b=this.F,c=b.length-1;if(null!==a.position){for(a=
928
+ a.position;a<c;a++)b[a]=b[a+1],b[a].position=a;b.length=c}}};olympe.dc.lc.Xq.ya=[olympe.dc.lc.Ta];function Gl(a){if(!a.F){for(let b in a.G)em(a.G[b]);a.F=!0}a.J=null;a.O=null}function Jl(a,b,c){a.G[c||'root'].T=b}function Kl(a,b,c){a.G[c||'root'].bg(b)}function fm(a,b,c,d){const e=a.O,f=b+d+c;let g=e[f];void 0===g&&(g=Rg(a.db,b,c,d),e[f]=g);return g}function gm(a,b){a.F||a.C.bg(b)}function hm(a,b,c,d,e){if(!a.F){let f=fm(a,c,d,e||olympe.dc.wa.DESTINATION);e||(f+=fm(a,c,d,olympe.dc.wa.ORIGIN));0===f&&gm(a,b)}}
929
+ function im(a,b){const c=a.G[b];void 0!==c?(a.H&&a.H.debug('Set current block to',b,null!==c.G?'parent = '+c.G.U():''),a.C=c):a.H&&a.H.error('Try to set a block that does not exists:',b)}function jm(a){const b=String(++a.T),c=a.C;a.G[b]=new km(b,c);lm(c,b);c.J||(c.J=()=>im(a,c.U()));return b}function mm(a,b){const c=a.C;a.C.J=()=>{im(a,c.U());b()}}function nm(a,b){em(b?a.G[b]:a.C)}
930
+ olympe.dc.lc.Yq=class{constructor(a,b){this.db=a;this.H=b||null;this.J=Object.create(null);this.O=Object.create(null);this.F=!1;this.T=0;this.C=new km('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=fm(this,c,d,e),d=this.J[b]||0,this.J[b]=++d,this.C.C===b&&c<=d&&(this.C.C=a)):this.C.C=a)}};function lm(a,b){null===a.F&&(a.F=Object.create(null));a.F[b]=!1}function em(a){a.O=!0;null!==a.G&&a.G.notify(a.id)}
931
+ class km{constructor(a,b){this.id=a;this.G=b||null;this.C=this.T=this.J=this.F=null;this.O=!1}U(){return this.id}bg(a){const b=this.T;if(this.O||this.C===a||null===a)b&&b(),!b&&em(this)}notify(a){const b=this.J,c=this.F;if(this.O)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.$a={};function om(a,b,c,d){const e=olympe.dc.ia(),f=new olympe.dc.lc.xj,g=new olympe.dc.lc.Yq(e);let h=!1;const k=Object.create(null),l=q=>{if(0<q.length)for(const r in k)q[0]===r&&d(k[r])};let n=(q,r,t,u)=>{a.od()||a.fb()||(h||(Jl(g,()=>{u.bg();Gl(g)}),u.je().ig(l),h=!0),q?k[t]=r:delete k[t],Kl(g,t))};if(null!==c)for(let q=c.length-1;0<=q;q--)n=c[q].C(a,g,n);const p=olympe.Y.Mc();jf(e,b,(q,r)=>{g.register(p,null);const t=f.C(q,b,p,null);n(q,r,p,Ll(t,q,b,p))},p);a.onDestroy(()=>{gf(e,b,p)});e.Ha(b)||Gl(g)}
932
+ function pm(a,b,c){const d=c.getContext(),e=olympe.dc.ia(),f=a.G(),g=Cg(e,b,a.J,d.G(h=>{null!==h&&(h=f(h));null===h?c.clear():c.update(h)}));d.onDestroy(()=>Dg(e,b,a.J,g))}
933
+ olympe.dc.$a.gi=class{constructor(a,b,c){this.J=a&&a.X?a.X():a;this.da=b&&b.filter(d=>d instanceof olympe.dc.da.Qe||d instanceof olympe.dc.da.Ae)||null;this.F=c||null;this.defaultValue=null}ma(){}Mb(){}G(){}C(){return(this.da||[]).reduce((a,b)=>a.concat(olympe.dc.query.Relation.from(b)),[])}eh(a){this.defaultValue=a;return this}Xg(){return this.da}Wd(){return this.F}getValue(a,b){const c=a.run(()=>olympe.D.ec(this.Mb()||Object,'AbstractProperty valueType'));null!==this.defaultValue&&Xb(c,this.defaultValue);
934
+ b=this.F||b;null!==this.da?om(a,b,this.da,d=>{pm(this,d,c)}):pm(this,b,c);return c.sb()}ha(a){const b=Ol(a,this.J),c=Ol(a,this.F);let d='null';this.da&&(d=this.da.map(function(e){return e.ha(a)}).join(','));return`{"c":"${this.ma()}","a":["${b}",${d},${c}]}`}toString(){const a=Nl(this.J),b=this.F?','+Nl(this.F):'';let c='';this.da&&(c=','+this.da.join(','));return this.ma().replace(/^.+\./,'')+'('+a+c+b+')'}};olympe.dc.$a.gi.ya=[olympe.dc.qk];olympe.dc.$a.Fn=class{constructor(a,b){if(olympe.D.bf(a))throw Error('Dataflows of Property not supported by AnyProperty');const c=a.X();var d=olympe.dc.ia();const e=d.Kb(a,olympe.dm.Property.typeRel);if(!e)throw Error('Type of property '+a+'unavailable locally, cannot proceed with AnyProperty');a=d.Vg(e,olympe.dc.CloudObject.extendRel,olympe.dm.ye);d=null;switch(1<a.length?a[a.length-2]:e){case olympe.dm.String.P.X():d=new olympe.dc.$a.Oi(c,b);break;case olympe.dm.Number.P.X():d=new olympe.dc.$a.Hi(c,
935
+ b);break;case olympe.dm.Boolean.P.X():d=new olympe.dc.$a.yj(c,b);break;case olympe.dm.DateTime.P.X():d=new olympe.dc.$a.li(c,b)}this.F=d}ma(){return this.F.ma()}C(){return this.F.C()}getValue(a,b){return this.F.getValue(a,b)}ha(a){return this.F.ha(a)}toString(){return this.F.toString()}};olympe.dc.$a.Fn.ya=[olympe.dc.qk];olympe.dc.$a.yj=class extends olympe.dc.$a.gi{constructor(a,b,c){super(a,b,c)}ma(){return S(olympe.dc.$a.yj)}G(){return olympe.dc.nb.Hm}Mb(){return olympe.D.fa}};R('olympe.dc.valuedefs.BooleanProperty',olympe.dc.$a.yj);olympe.dc.$a.Le=class{constructor(a){this.value=a}ma(){return S(olympe.dc.$a.Le)}C(){return[]}getValue(){return this.value}ha(a){a=Ol(a,this.value);return`{"c":"${this.ma()}","a":[${a}]}`}toString(){return`Constant(${Nl(this.value)})`}};R('olympe.dc.valuedefs.Constant',olympe.dc.$a.Le);olympe.dc.$a.Le.ya=[olympe.dc.qk];olympe.dc.$a.li=class extends olympe.dc.$a.gi{constructor(a,b,c){super(a,b,c)}ma(){return S(olympe.dc.$a.li)}G(){return olympe.dc.nb.Im}Mb(){return olympe.D.gb}};R('olympe.dc.valuedefs.DateTimeProperty',olympe.dc.$a.li);olympe.dc.$a.Hi=class extends olympe.dc.$a.gi{constructor(a,b,c){super(a,b,c)}ma(){return S(olympe.dc.$a.Hi)}G(){return olympe.dc.nb.Jm}Mb(){return olympe.D.ba}};R('olympe.dc.valuedefs.NumberProperty',olympe.dc.$a.Hi);olympe.dc.$a.Oi=class extends olympe.dc.$a.gi{constructor(a,b,c){super(a,b,c)}ma(){return S(olympe.dc.$a.Oi)}G(){return olympe.dc.nb.Km}Mb(){return olympe.D.Qa}};R('olympe.dc.valuedefs.StringProperty',olympe.dc.$a.Oi);olympe.dc.$a.Qi=class{ma(){return S(olympe.dc.$a.Qi)}C(){return[]}getValue(a,b){return b}ha(){return'{"c":"'+this.ma()+'","a":[]}'}toString(){return'Tag()'}};R('olympe.dc.valuedefs.Tag',olympe.dc.$a.Qi);olympe.dc.$a.Qi.ya=[olympe.dc.qk];olympe.dc.da={};olympe.dc.da.mi=class{Mb(){return null}ma(){return S(olympe.dc.da.mi)}C(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,Ll(h,!0,f,f))):(d[f]++,gm(b,g)):void 0!==d[f]&&0>=--d[f]&&(delete d[f],c(!1,f,f,Ll(h,!1,f,f)))}}ha(){return'{"c":"'+this.ma()+'"}'}toString(){return'Distinct()'}};R('olympe.dc.transformers.Distinct',olympe.dc.da.mi);olympe.dc.da.mi.ya=[olympe.dc.wf];olympe.dc.da.jf=class{constructor(a){this.F=a}Mb(){return null}ma(){return S(olympe.dc.da.jf)}G(){return this.F.F()}C(a,b,c){function d(f,g,h,k){k=k.valueOf();!1===k&&gm(b,g);k!==!!e[g]&&(e[g]=k,c(k,f,g,Ll(h,k,f,g)))}const e={};return(f,g,h,k)=>{const l='@'+h;if(f){let n=this.F.C(a,g);olympe.D.jb(n)&&(n=n.Da);olympe.D.Jf(n)?(b.F||void 0!==olympe.D.Na(n)||gm(b,h),e[l]=n,a.run(()=>{olympe.D.Nc([n],p=>{d(g,h,k,p)},'filterResultHandler')})):d(g,h,k,n)}else void 0!==e[l]&&(e[l].destroy(),delete e[l]),
936
+ d(g,h,k,!1),delete e[h]}}ha(a){return'{"c":"'+this.ma()+'","a":['+this.F.ha(a)+']}'}toString(){return'Filter('+this.F.toString()+')'}};R('olympe.dc.transformers.Filter',olympe.dc.da.jf);olympe.dc.da.jf.ya=[olympe.dc.wf,olympe.dc.mq];olympe.dc.da.ul=class{constructor(a,b,c,d){this.F=new olympe.dc.Pa.Relation(olympe.dc.ga(a),c||olympe.dc.wa.DESTINATION);this.G=new olympe.dc.Pa.Relation(olympe.dc.ga(b),d||olympe.dc.wa.DESTINATION)}Mb(){return Ff(this.F)}ma(){return S(olympe.dc.da.ul)}C(a,b,c){const d=olympe.dc.ia(),e={},f=this.F.X(),g=this.F.Ia(),h=this.G.X(),k=this.G.Ia();let l=null,n=null;const p=(r,t,u,x,y,z)=>{if(y){if(y=()=>{const A=olympe.Y.vb(u+g+(f+'_'+r)+z,20),D=Ll(t,!0,z,A);l=r;n=()=>{c(!1,z,A,Ll(t,!1,z,A))};b.register(A,
937
+ u,x,f,g);c(!0,z,A,D)},y.Xr=r,e[x]=y,null===l||r<l)n&&n(),y()}else if(l===r){n();e[x]=!0;y=Infinity;let A=null;for(let D=Object.keys(e),O=D.length,M=0;M<O;M++){let xa=e[D[M]];xa.Xr<y&&(y=xa.Xr,A=xa)}A&&A()}},q=(r,t,u,x,y)=>{x?e[y]||(e[y]=!0,hm(b,u,y,f,g),hm(b,u,y,h,k),V(d,y,this.F,p.bind(this,r,t,u,y),u+'_val'),V(d,y,this.G,q.bind(this,r+1,t,u),u+'_follow')):(d.F(y,this.G,u+'_follow'),d.F(y,this.F,u+'_val'),delete e[y])};return(r,t,u,x)=>q(0,x,u,r,t)}ha(){return'{"c":"'+this.ma()+'","a":["'+this.F.toString()+
938
+ '","'+this.G.toString()+'"]}'}toString(){return'FirstRelated('+this.F.toString()+', '+this.G.toString()+')'}};R('olympe.dc.transformers.FirstRelated',olympe.dc.da.ul);olympe.dc.da.ul.ya=[olympe.dc.wf];olympe.dc.da.uh=class{constructor(a,b){this.start=a;this.F=b}Mb(){return null}ma(){return S(olympe.dc.da.uh)}C(a,b,c){const d=new olympe.dc.lc.Nl;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]);Zl(d,e,f,n,c)}};a.run(()=>olympe.D.Nc([this.start,this.F],(n,p)=>{f=n.valueOf();g=p.valueOf();k()}));mm(b,k);const l=jm(b);im(b,l);return(n,p,q,r)=>{h||(r.je().ig(t=>{e=t;nm(b,l)}),Jl(b,()=>r.bg(),l),h=!0);d.C(n,p,q,null);Kl(b,q,l)}}ha(a){return'{"c":"'+
939
+ this.ma()+'","a":['+Ol(a,this.start)+','+Ol(a,this.F)+']}'}toString(){return`Limit(${olympe.D.Na(this.start)},${olympe.D.Na(this.F)})`}};R('olympe.dc.transformers.Limit',olympe.dc.da.uh);olympe.dc.da.uh.ya=[olympe.dc.wf];function qm(a){return a.pb.map(b=>b.X())}
940
+ olympe.dc.da.Rj=class{constructor(a,b){this.direction=b||olympe.dc.wa.DESTINATION;this.pb=a.map(c=>new olympe.dc.Pa.Relation(c,this.direction))}Mb(){return olympe.dc.CloudObject}ma(){return S(olympe.dc.da.Rj)}Ia(){return this.direction}C(a,b,c){const d=olympe.dc.ia(),e=(f,g,h,k)=>V(d,f,k,(l,n)=>{var p=k.X();p=olympe.Y.vb(g+k.Ia()+p+n,20);const q=Ll(h,l,n,p);l&&b.register(p,g,f,k.X(),k.Ia());c(l,n,p,q)},g);return(f,g,h,k)=>{f?this.pb.forEach(l=>{hm(b,h,g,l.X(),l.Ia());e(g,h,k,l)}):this.pb.forEach(l=>
941
+ {d.F(g,l,h)})}}ha(){return'{"c":"'+this.ma()+'","a":['+JSON.stringify(qm(this))+',"'+this.direction+'"]}'}toString(){return'MultiRelated('+this.Ia()+'['+qm(this).join(',')+'])'}};R('olympe.dc.transformers.MultiRelated',olympe.dc.da.Rj);olympe.dc.da.Rj.ya=[olympe.dc.wf];olympe.dc.da.Ae=class extends olympe.dc.Pa.Relation{constructor(a,b=olympe.dc.wa.DESTINATION,c=1,d=-1){super(a,b);this.G=c;this.F=d}Mb(){return Ff(this)}ma(){return S(olympe.dc.da.Ae)}C(a,b,c){const d=olympe.dc.ia(),e=Object.create(null),f=olympe.dc.wa.ORIGIN,g=olympe.dc.wa.DESTINATION,h=this.X(),k=this.Ia(),l=(p,q,r)=>{if(!(0<=this.F&&p>=this.F)){var t=d.cb(r,this);p+=1;for(let u=0,x=t.length;u<x;u++){if(void 0!==e[t[u]]||r===t[u])continue;const y=olympe.Y.vb(q+k+(h+'_'+p)+t[u],20);b.register(y,
942
+ q,r,h,k||g);null===k&&b.register(y,q,r,h,f)}}},n=(p,q,r,t,u,x)=>{u&&!b.F&&l(p,t,x);p>=this.G?c(u,x,t,Ll(r,u,x,t)):hm(b,t,x,h,k);0<=this.F&&p>=this.F||(u?e[x]||(e[x]=!0,V(d,x,this,(y,z)=>{const A=p+1,D=olympe.Y.vb(t+k+(h+'_'+A)+z,20);n(A,x,r,D,y,z)},t)):(d.F(x,this,t),delete e[x]))};return(p,q,r,t)=>n(0,null,t,r,p,q)}ha(){return'{"c":"'+this.ma()+'","a":["'+this.X()+'","'+this.Ia()+'",'+this.G+','+this.F+']}'}toString(){return'RecursiveRelated('+this.Ia()+this.X()+'['+this.G+'..'+this.F+'])'}};
943
+ R('olympe.dc.transformers.RecursiveRelated',olympe.dc.da.Ae);olympe.dc.da.Ae.ya=[olympe.dc.wf];olympe.dc.da.Qe=class extends olympe.dc.Pa.Relation{constructor(a,b){super(a,b||olympe.dc.wa.DESTINATION)}Mb(){return Ff(this)}ma(){return S(olympe.dc.da.Qe)}bc(){return new olympe.dc.da.Qe(this.tag,this.direction===olympe.dc.wa.DESTINATION?olympe.dc.wa.ORIGIN:olympe.dc.wa.DESTINATION)}C(a,b,c){const d=olympe.dc.ia(),e=this.X(),f=this.Ia();return(g,h,k,l)=>{hm(b,k,h,e,f);g?V(d,h,this,(n,p)=>{const q=olympe.Y.vb(k+f+e+p,20),r=Ll(l,n,p,q);n&&b.register(q,k,h,e,f);c(n,p,q,r)},k):d.F(h,this,k)}}ha(){return'{"c":"'+
944
+ this.ma()+'","a":["'+this.X()+'","'+this.Ia()+'"]}'}toString(){return'Related('+this.Ia()+this.X()+')'}};R('olympe.dc.transformers.Related',olympe.dc.da.Qe);olympe.dc.da.Qe.ya=[olympe.dc.wf];olympe.dc.da.Kg=class{constructor(a,b){this.Ib=a;this.F=void 0===b?!0:!!b}Mb(){return null}ma(){return S(olympe.dc.da.Kg)}Rg(){return this.Ib}G(){return[this.Ib.J()]}C(a,b,c){const d=new olympe.dc.lc.Xq(a.G(this.F?this.Ib.compare.bind(this.Ib):(e,f)=>this.Ib.compare(f,e)));return(e,f,g)=>{var h=e?this.Ib.G(a,f):void 0;h=d.C(e,f,g,h);c(e,f,g,h)}}ha(a){return'{"c":"'+this.ma()+'","a":['+this.Ib.ha(a)+','+JSON.stringify(this.F)+']}'}toString(){return'Sort('+this.Ib.toString()+','+JSON.stringify(this.F)+
945
+ ')'}};R('olympe.dc.transformers.Sort',olympe.dc.da.Kg);olympe.dc.da.Kg.ya=[olympe.dc.wf,olympe.dc.mq];function rm(a,b,c,d,e,f){function g(n,p){if(l)for(var q=l.length-1;0<=q;q--)f=l[q].C(b,e,f);e.register(h,null);q=d.C(n,p,c,null);f(n,p,h,Ll(q,n,p,h))}const h=olympe.Y.Mc(),k=olympe.dc.ia(),l=a.da;b.run(()=>olympe.D.Nc([a.F],n=>{sm(k,n,g,h);void 0===k.model(n)&&Gl(e)}))}function sm(a,b,c,d){const e=b&&b.valueOf();e&&(jf(a,e,c,d),olympe.D.Wa().Z(()=>gf(a,e,d)))}
946
+ olympe.dc.da.xf=class{constructor(a,b){this.da=this.F=null;a instanceof olympe.dc.za?(this.F=a.Wd(),this.da=a.Hl()):(this.F=a,b&&(this.da=b))}Mb(){return null}ma(){return S(olympe.dc.da.xf)||''}Xg(){return this.da}Wd(){return this.F}C(a,b,c){const d=new olympe.dc.lc.Nl,e=new olympe.dc.lc.xj;let f=[],g=[],h=!1,k=!1;const l=jm(b),n=jm(b);mm(b,()=>{const p=f.concat(g);0<p.length?b.F||(b.C.C=p[p.length-1]):nm(b);Zl(d,p,0,p.length,c)});im(b,n);rm(this,a,this.F,e,b,(p,q,r,t)=>{const u=olympe.D.Wa();u.od()||
947
+ u.fb()||(k||(t.je().ig(x=>{g=x;nm(b,n)}),Jl(b,()=>t.bg(),n),k=!0),d.C(p,q,r),Kl(b,r,n))});im(b,l);return(p,q,r,t)=>{h||(t.je().ig(u=>{f=u;nm(b,l)}),Jl(b,()=>t.bg(),l),h=!0);d.C(p,q,r,l);Kl(b,r,l)}}ha(a){const b=this.da?'['+this.da.map(c=>c.ha(a)).join(',')+']':'null';return'{"c":"'+this.ma()+'","a":['+Ol(a,this.F)+','+b+']}'}toString(){const a=olympe.D.jb(this.F)?'N:'+this.F.Da.U():this.F.valueOf(),b=this.da?','+this.da.map(c=>c.toString()).join(','):'';return'Union('+a+b+')'}};
948
+ R('olympe.dc.transformers.Union',olympe.dc.da.xf);olympe.dc.da.xf.ya=[olympe.dc.wf];olympe.dc.da.Dq={GA:1,Gt:-1,Ft:0};olympe.dc.da.hC={oz:!0,Pz:!1};olympe.dc.kc.R={zp:'dc.legacy.listdefProcessor'};olympe.dc.kc.V={yp:'dc.legacy.listdefsCovered'};olympe.W.config(a=>{F(a,olympe.dc.kc.V.yp,!1);C(a,olympe.dc.kc.R.zp,olympe.dc.kc.xu,olympe.dc.query.R.Ca,olympe.dc.R.jh,olympe.dc.transaction.R.Ea,olympe.dc.query.R.Zj,new olympe.W.oa(olympe.dc.V.Gh),new olympe.W.oa(olympe.dc.kc.V.yp))});olympe.W.run([olympe.dc.kc.R.zp],a=>{olympe.dc.kc.zx=()=>a});function tm(a){const b=olympe.dc.ia(),c=new Map;b.Mr(a).forEach(d=>{b.cb(d,olympe.dc.CloudObject.propertyRel).forEach(e=>{const f=b.name(e);c.has(f)||c.set(f,e)})});return c}
949
+ olympe.dc.CloudObject=class{constructor(a,b){this.tag=b;this.db=olympe.dc.ia();this.model=null}static $c(a,b,c,...d){b=olympe.dc.ga(b);var e=lf(b);(e=e&&e.C)?e(a,c,...d):(a=a.create(b),void 0!==c&&null!==c&&Z(a,olympe.dc.CloudObject.nameProp,c),a.X())}static get(a){if(a instanceof olympe.dc.CloudObject)var b=a;else{b=olympe.dc.Qr();a=olympe.dc.ga(a);var c=b.db.model(a);c=kf(b,c);if(null===c)throw new olympe.dc.Zp(a);c=c.instantiate(a,b.F);b.C.C.hb([a]);b.Pa.register(c,a);b=c}return b}static exists(a){return olympe.dc.ia().Ha(olympe.dc.ga(a))}static Dw(a,
950
+ b,c){const d=olympe.dc.ia();let e=null;const f=k=>{null===e&&(e=tm(b||this));return e.has(k)?e.get(k):null},g=il(!1),h=g.create(null!=b?b:this);void 0!==c&&h.ci(c);a.forEach((k,l)=>{d.Ha(olympe.dc.ga(l))?Z(h,l,k):(l=f(l))&&Z(h,l,k)});g.ob((k,l)=>{k||olympe.ka.ab('dc').error(`Error occurred for transaction executed by CloudObject.createWith: ${l}`)});return this.get(h)}static ow(){return this.get(this)}static Ik(a){return olympe.dc.pa.Ik(a)}static Cb(){return olympe.dc.ia().cb(this,olympe.dc.CloudObject.propertyRel).map(a=>
951
+ new olympe.dc.Pa.Property(a))}static yd(){const a=olympe.dc.ia();return a.cb(this,olympe.dc.CloudObject.mj).map(b=>new olympe.dc.Pa.Relation(b)).concat(a.cb(this,olympe.dc.CloudObject.Er).map(b=>new olympe.dc.Pa.Relation(b,olympe.dc.wa.ORIGIN)))}static Lc(a){return olympe.dc.CloudObject.get(a)}static Rr(a){var b=kf(olympe.dc.Qr(),olympe.dc.ga(a));b=b&&b.F;return new olympe.dc.za(olympe.dc.ga(a),olympe.dc.CloudObject.instancesRel,b)}X(){return this.tag}name(){return this.db.name(this)}ma(){return this.zb(olympe.dc.CloudObject.nameProp)}Vb(){this.model||
952
+ (this.model=olympe.dc.CloudObject.get(this.db.model(this)));return this.model}query(){return olympe.dc.pa.from(this)}Lf(){return this.db.Lf(this)}tb(){return this.db.source(this)}wx(){return this.db.ai(this)?olympe.dc.Zd().fromModel(this):null}Lr(){return olympe.D.va([this.ma()],a=>olympe.D.Ab(a),olympe.D.Qa,'getDisplayName',olympe.D.Ab('('+this.toString()+')'))}cc(){return this.model?this.model.X():this.db.model(this)}observe(a,b,c=!0){const d='function'===typeof a.F?a.F():a;return new rxjs.Observable(e=>
953
+ {const f=olympe.dc.nb.Ac(this.db.Oa(this.tag,b));c||null!==f||e.next(f);const g=Cg(this.db,this.tag,b,h=>{e.next(olympe.dc.nb.Ac(h))});d.Z(()=>{e.complete();Dg(this.db,this.tag,b,g)});return()=>Dg(this.db,this.tag,b,g)})}Fy(a){const b='function'===typeof a.F?a.F():a;return new rxjs.Observable(c=>{const d=Eg(this.db,this.tag,(e,f)=>{null===f||void 0===f?c.next([new olympe.dc.Pa.Property(e),null]):c.next([new olympe.dc.Pa.Property(e),f])});b.Z(()=>{c.complete();Fg(this.db,this.tag,d)});return()=>Fg(this.db,
954
+ this.tag,d)})}Gy(a){return this.observe(olympe.D.Wa(),a)}get(a){return olympe.dc.nb.Ac(this.db.Oa(this.tag,a))}Oa(a){return this.get(a)}ib(a){return olympe.dc.pa.from(this).ib(a)}xk(a){return olympe.dc.gd.from(this).ib(a)}Ac(){return this}ex(){return this.pc(olympe.dc.CloudObject.zw,olympe.dc.CloudObject)}Sm(){return this.cb(olympe.dc.CloudObject.containsRel,olympe.dc.CloudObject)}Hf(a,b,c){const d=olympe.D.ec(c,'Sync valueType'),e=Cg(this.db,this.tag,a,olympe.D.Wa().G(f=>{b&&null!==f&&void 0!==f&&
955
+ (f=b(f));null===f||void 0===f?d.clear():d.update(f)}));d.getContext().onDestroy(()=>Dg(this.db,this.tag,a,e));return d.getContext()}zb(a){return L(this.Hf(a,olympe.dc.nb.Km,olympe.D.Qa))}nd(a){return L(this.Hf(a,olympe.dc.nb.Jm,olympe.D.ba))}Ug(a){return L(this.Hf(a,olympe.dc.nb.Hm,olympe.D.fa))}gj(a){return L(this.Hf(a,olympe.dc.nb.Im,olympe.D.gb))}Vr(){return L(this.Hf(olympe.dm.Color.valueProp,olympe.dc.nb.xr,olympe.D.Color))}Wr(){return L(this.Hf(olympe.sc.workflow.Transition.processRefProp,olympe.dc.nb.yr,
956
+ olympe.dc.CloudObject))}cb(a,b){a=a instanceof olympe.dc.da.Qe?a:new olympe.dc.da.Qe(a.X(),a.Ia());return new olympe.dc.za(this.X(),a,b)}pc(a,b){return this.cb(a,b).Fc()}Hr(a,b){const c=this.db,d=olympe.Y.Mc(),e=olympe.D.Wa(),f=new Map;V(c,this.tag,a,(g,h)=>{if(g)(g=e.run(b,olympe.dc.CloudObject.get(h)))&&f.set(h,g);else{let k;null==(k=f.get(h))||k();f.delete(h)}},d);e.onDestroy(()=>{c.F(this.tag,a,d)})}hz(){return new olympe.dc.za(this.X(),[],Df(this.X()))}transform(...a){return(new olympe.dc.za(this.X(),
957
957
  [],this.constructor)).transform(...a)}Oc(){return this.Lr()}toString(){return`CloudObject: ${JSON.stringify(this)}`}toJSON(){return this.db.Ha(this.tag)?Object.assign({'#tag':this.X(),'#type':this.Vb().name()},this.Pc(!0,!0)):{'#tag':this.X(),'#error':'The object does not exist in the local database.'}}Pc(a=!1,b=!0){const c={};this.db.Cb(this,b).forEach((d,e)=>{this.db.Ha(e)&&(e=a?this.db.name(e):e,c[e]=olympe.dc.nb.Ac(d))});return c}Fa(a){return a instanceof olympe.dc.CloudObject?this.X()===a.X():
958
- 'function'===typeof a?olympe.dc.na.cc(a)===this.X():!1}Ad(a){return olympe.D.va([a],b=>olympe.D.Sb(this.Fa(b)),olympe.D.fa)}Gw(a){const b=this.db;let c=!1;if(void 0===a||null===a)a=new olympe.dc.Wa,c=!0;const d=olympe.dc.wa.ORIGIN;for(const [e,f,g]of Pg(b,this))f===d?a.ic(e,g,this):e!==olympe.dc.CloudObject.modelRel.X()&&a.ic(e,this,g);a.delete(this,olympe.dc.Nb.NONE);c&&a.ob()}};olympe.dc.CloudObject.prototype.equals=olympe.dc.CloudObject.prototype.Fa;olympe.dc.CloudObject.prototype.toObject=olympe.dc.CloudObject.prototype.Pc;
959
- olympe.dc.CloudObject.prototype.followSingle=olympe.dc.CloudObject.prototype.xk;olympe.dc.CloudObject.prototype.follow=olympe.dc.CloudObject.prototype.hb;olympe.dc.CloudObject.prototype.getProperty=olympe.dc.CloudObject.prototype.Sa;olympe.dc.CloudObject.prototype.get=olympe.dc.CloudObject.prototype.get;olympe.dc.CloudObject.prototype.observeProperty=olympe.dc.CloudObject.prototype.Gy;olympe.dc.CloudObject.prototype.observeProperties=olympe.dc.CloudObject.prototype.Fy;
958
+ 'function'===typeof a?olympe.dc.na.cc(a)===this.X():!1}Ad(a){return olympe.D.va([a],b=>olympe.D.Sb(this.Fa(b)),olympe.D.fa)}Gw(a){const b=this.db;let c=!1;if(void 0===a||null===a)a=new olympe.dc.Xa,c=!0;const d=olympe.dc.wa.ORIGIN;for(const [e,f,g]of Pg(b,this))f===d?a.ic(e,g,this):e!==olympe.dc.CloudObject.modelRel.X()&&a.ic(e,this,g);a.delete(this,olympe.dc.Nb.NONE);c&&a.ob()}};olympe.dc.CloudObject.prototype.equals=olympe.dc.CloudObject.prototype.Fa;olympe.dc.CloudObject.prototype.toObject=olympe.dc.CloudObject.prototype.Pc;
959
+ olympe.dc.CloudObject.prototype.followSingle=olympe.dc.CloudObject.prototype.xk;olympe.dc.CloudObject.prototype.follow=olympe.dc.CloudObject.prototype.ib;olympe.dc.CloudObject.prototype.getProperty=olympe.dc.CloudObject.prototype.Oa;olympe.dc.CloudObject.prototype.get=olympe.dc.CloudObject.prototype.get;olympe.dc.CloudObject.prototype.observeProperty=olympe.dc.CloudObject.prototype.Gy;olympe.dc.CloudObject.prototype.observeProperties=olympe.dc.CloudObject.prototype.Fy;
960
960
  olympe.dc.CloudObject.prototype.observe=olympe.dc.CloudObject.prototype.observe;olympe.dc.CloudObject.prototype.getModelTag=olympe.dc.CloudObject.prototype.cc;olympe.dc.CloudObject.prototype.getSource=olympe.dc.CloudObject.prototype.tb;olympe.dc.CloudObject.prototype.isPersisted=olympe.dc.CloudObject.prototype.Lf;olympe.dc.CloudObject.prototype.query=olympe.dc.CloudObject.prototype.query;olympe.dc.CloudObject.prototype.getModel=olympe.dc.CloudObject.prototype.Vb;
961
961
  olympe.dc.CloudObject.prototype.name=olympe.dc.CloudObject.prototype.name;olympe.dc.CloudObject.prototype.getTag=olympe.dc.CloudObject.prototype.X;olympe.dc.CloudObject.getInstancesOf=olympe.dc.CloudObject.Rr;olympe.dc.CloudObject.getInstance=olympe.dc.CloudObject.Lc;olympe.dc.CloudObject.getRelations=olympe.dc.CloudObject.yd;olympe.dc.CloudObject.getProperties=olympe.dc.CloudObject.Cb;olympe.dc.CloudObject.instancesOf=olympe.dc.CloudObject.Ik;olympe.dc.CloudObject.asInstance=olympe.dc.CloudObject.ow;
962
962
  olympe.dc.CloudObject.createWith=olympe.dc.CloudObject.Dw;olympe.dc.CloudObject.exists=olympe.dc.CloudObject.exists;olympe.dc.CloudObject.get=olympe.dc.CloudObject.get;olympe.dc.CloudObject.P=olympe.dc.na.C('ff021000000000000001',olympe.dc.CloudObject);olympe.dc.CloudObject.sE=olympe.dc.CloudObject.P.la(olympe.dc.tp.VERSION);olympe.dc.CloudObject.nameProp=olympe.dc.CloudObject.P.la('ff023000000000000011');w('olympe.dc.CloudObject.nameProp',olympe.dc.CloudObject.nameProp);
@@ -964,177 +964,179 @@ olympe.dc.CloudObject.dE=olympe.dc.CloudObject.P.la('ff023000000000000012');olym
964
964
  w('olympe.dc.CloudObject.propertyRel',olympe.dc.CloudObject.propertyRel);olympe.dc.CloudObject.typeRel=olympe.dc.CloudObject.P.sa('ff02200000000000000d',olympe.dc.wa.ORIGIN);olympe.dc.CloudObject.modelRel=olympe.dc.CloudObject.P.sa(olympe.dc.nc.Yc);w('olympe.dc.CloudObject.modelRel',olympe.dc.CloudObject.modelRel);olympe.dc.CloudObject.instancesRel=T(olympe.dc.CloudObject.P,olympe.dc.CloudObject.modelRel);w('olympe.dc.CloudObject.instancesRel',olympe.dc.CloudObject.instancesRel);
965
965
  olympe.dc.CloudObject.extendRel=olympe.dc.CloudObject.P.sa(olympe.dc.nc.ni);w('olympe.dc.CloudObject.extendRel',olympe.dc.CloudObject.extendRel);olympe.dc.CloudObject.extendedByRel=T(olympe.dc.CloudObject.P,olympe.dc.CloudObject.extendRel);w('olympe.dc.CloudObject.extendedByRel',olympe.dc.CloudObject.extendedByRel);olympe.dc.CloudObject.containsRel=olympe.dc.CloudObject.P.sa(olympe.dc.nc.Bj);w('olympe.dc.CloudObject.containsRel',olympe.dc.CloudObject.containsRel);
966
966
  olympe.dc.CloudObject.zw=T(olympe.dc.CloudObject.P,olympe.dc.CloudObject.containsRel);olympe.dc.CloudObject.Fw=olympe.dc.CloudObject.P.sa('018282d3ac0a474a0bf4');w('olympe.dc.CloudObject.deleteAlsoRel',olympe.dc.CloudObject.Fw);olympe.dc.jC=olympe.dc.CloudObject;olympe.dc.CloudObject.ya=[olympe.dc.Ne];m=olympe.dc.CloudObject.prototype;m.X.L=new olympe.D.K(()=>String,[]);m.name.L=new olympe.D.K(()=>String,[]);m.ma.L=olympe.D.K.F;m.Vb.L=new olympe.D.K(()=>olympe.dc.CloudObject,[]);
967
- m.tb.L=new olympe.D.K(()=>String,[]);m.wx.L=new olympe.D.K(()=>String,[]);m.Lr.L=olympe.D.K.F;m.cc.L=new olympe.D.K(()=>String,[]);m.ex.L=new olympe.D.K(()=>olympe.dc.CloudObject,[]);m.Sm.L=new olympe.D.K(()=>olympe.dc.za,[]);m.Hf.L=new olympe.D.K(()=>olympe.D.Node,[]);m.zb.L=olympe.D.K.F;m.nd.L=olympe.D.K.G;m.Ug.L=olympe.D.K.O;m.gj.L=new olympe.D.K(()=>olympe.D.fb,[]);m.Vr.L=new olympe.D.K(()=>olympe.D.Color,[]);m.Wr.L=new olympe.D.K(()=>olympe.dc.CloudObject,[]);
968
- m.bb.L=new olympe.D.K(()=>olympe.dc.za,[]);m.pc.L=new olympe.D.K(()=>olympe.dc.CloudObject,[]);m.Hr.L=new olympe.D.K(()=>Function,[]);m.hz.L=new olympe.D.K(()=>olympe.dc.za,[]);m.transform.L=new olympe.D.K(()=>olympe.dc.za,[]);m.Oc.L=olympe.D.K.F;m.toString.L=olympe.D.K.C;m.Fa.L=olympe.D.K.C;m.Ad.L=olympe.D.K.O;m.Gw.L=new olympe.D.K(()=>{},[]);olympe.dc.R={jh:'dc.DBView',pp:'dc.InstanceManager',Ca:'dc.Logger',Mv:'dc.TransactionLogger',Jj:'dc.FileServiceManager',Dg:'dc.Router'};olympe.dc.V={Hg:'dc.tag',Rf:'dc.debug',Gh:'dc.subscribeAll',ol:'dc.defaultSource',Ko:'dc.fileCache',lo:'dc.dataConsumerOnly',Fo:'dc.errorOnAbstractInstantiation'};
969
- olympe.W.config(function(a){const b='object'===typeof window;F(a,olympe.dc.V.Rf,!1);F(a,olympe.dc.V.Gh,!1);F(a,olympe.dc.V.ol,olympe.dc.Ra.SERVER);F(a,olympe.dc.V.lo,b);F(a,olympe.dc.V.Ko,b);F(a,olympe.dc.V.Fo,!0);F(a,olympe.dc.V.Hg,olympe.Y.Mc());E(a,olympe.dc.R.Ca,[olympe.ka.R.Ea],c=>c.Vc('dc'));Oa(a,olympe.dc.R.Mv,olympe.dc.transaction.R.Ca);Oa(a,olympe.dc.R.jh,olympe.dc.db.R.ll);C(a,olympe.dc.R.Jj,olympe.dc.tt,olympe.dc.R.Ca,olympe.dc.db.R.Ea,olympe.net.R.Ea,olympe.dc.R.Dg,olympe.Y.R.mg,new olympe.W.oa(olympe.dc.V.Ko));
967
+ m.tb.L=new olympe.D.K(()=>String,[]);m.wx.L=new olympe.D.K(()=>String,[]);m.Lr.L=olympe.D.K.F;m.cc.L=new olympe.D.K(()=>String,[]);m.ex.L=new olympe.D.K(()=>olympe.dc.CloudObject,[]);m.Sm.L=new olympe.D.K(()=>olympe.dc.za,[]);m.Hf.L=new olympe.D.K(()=>olympe.D.Node,[]);m.zb.L=olympe.D.K.F;m.nd.L=olympe.D.K.G;m.Ug.L=olympe.D.K.O;m.gj.L=new olympe.D.K(()=>olympe.D.gb,[]);m.Vr.L=new olympe.D.K(()=>olympe.D.Color,[]);m.Wr.L=new olympe.D.K(()=>olympe.dc.CloudObject,[]);
968
+ m.cb.L=new olympe.D.K(()=>olympe.dc.za,[]);m.pc.L=new olympe.D.K(()=>olympe.dc.CloudObject,[]);m.Hr.L=new olympe.D.K(()=>Function,[]);m.hz.L=new olympe.D.K(()=>olympe.dc.za,[]);m.transform.L=new olympe.D.K(()=>olympe.dc.za,[]);m.Oc.L=olympe.D.K.F;m.toString.L=olympe.D.K.C;m.Fa.L=olympe.D.K.C;m.Ad.L=olympe.D.K.O;m.Gw.L=new olympe.D.K(()=>{},[]);olympe.dc.R={jh:'dc.DBView',pp:'dc.InstanceManager',Ca:'dc.Logger',Mv:'dc.TransactionLogger',Jj:'dc.FileServiceManager',Dg:'dc.Router'};olympe.dc.V={Hg:'dc.tag',Rf:'dc.debug',Gh:'dc.subscribeAll',ol:'dc.defaultSource',Ko:'dc.fileCache',lo:'dc.dataConsumerOnly',Fo:'dc.errorOnAbstractInstantiation'};
969
+ olympe.W.config(function(a){const b='object'===typeof window;F(a,olympe.dc.V.Rf,!1);F(a,olympe.dc.V.Gh,!1);F(a,olympe.dc.V.ol,olympe.dc.Sa.SERVER);F(a,olympe.dc.V.lo,b);F(a,olympe.dc.V.Ko,b);F(a,olympe.dc.V.Fo,!0);F(a,olympe.dc.V.Hg,olympe.Y.Mc());E(a,olympe.dc.R.Ca,[olympe.ka.R.Ea],c=>c.Vc('dc'));Oa(a,olympe.dc.R.Mv,olympe.dc.transaction.R.Ca);Oa(a,olympe.dc.R.jh,olympe.dc.db.R.ll);C(a,olympe.dc.R.Jj,olympe.dc.tt,olympe.dc.R.Ca,olympe.dc.db.R.Ea,olympe.net.R.Ea,olympe.dc.R.Dg,olympe.Y.R.mg,new olympe.W.oa(olympe.dc.V.Ko));
970
970
  C(a,olympe.dc.R.Dg,olympe.dc.mv,olympe.dc.R.Ca,olympe.dc.sources.R.wq,olympe.dc.sources.R.Nq,olympe.dc.R.jh,olympe.host.R.Pe,new olympe.W.oa(olympe.dc.V.Hg),new olympe.W.oa(olympe.dc.V.lo));C(a,olympe.dc.R.pp,olympe.dc.Nt,olympe.dc.db.R.vl,olympe.dc.db.R.Ea,olympe.W.R.og)},'olympe.dc');
971
- olympe.W.run([olympe.dc.db.R.Ea,olympe.dc.transaction.R.Ea,olympe.dc.R.pp,olympe.dc.R.Jj,new olympe.W.oa(olympe.dc.V.Hg)],(a,b,c,d,e)=>{olympe.dc.Jr=()=>a;olympe.dc.hj=()=>b;olympe.dc.Qr=()=>c;olympe.dc.Nr=()=>d;olympe.dc.Ra.SELF=e},'DC singleton getter initialization');olympe.dm={};olympe.dm.Md=class extends olympe.dc.CloudObject{ma(){return this.zb(olympe.dc.CloudObject.nameProp)}C(){return olympe.D.Pa.EMPTY}F(){return olympe.D.fa.C}};olympe.dm.Md.P=olympe.dc.na.C('ff021000000000000002',olympe.dm.Md);olympe.dm.Md.O=olympe.dm.Md.P.la('ff023000000000000035');olympe.dm.Md.C=olympe.dm.Md.P.sa('ff022000000000000005');olympe.dm.Md.G=Cf('ff011000000000000001','AUTHENTICATED_USERS');olympe.dm.Md.J=Cf('ff011000000000000002','PROJECT_RUNNER_USERS_ROLE');
972
- olympe.dm.Md.F=Cf('014831d95f83635090ea','ADMIN_USERS_ROLE');olympe.dm.Md.prototype.ma.L=olympe.D.K.F;olympe.dm.Md.prototype.C.L=olympe.D.K.F;olympe.dm.Md.prototype.F.L=olympe.D.K.O;olympe.dm.Vk={NONE:0,Tz:1,gt:2,Uz:4,Qz:8,Sz:16,Rz:31,pB:32,mB:64,qB:128,nB:256,Nu:512,oB:992,HA:1023};olympe.dm.User=class extends olympe.dc.CloudObject{tx(){return this.Vm()}ma(){return this.Vm()}Vm(){return this.zb(olympe.dm.User.loginProp)}bu(){return this.zb(olympe.dm.User.F)}au(){return olympe.D.Pa.EMPTY}Ox(){return this.zb(olympe.dm.User.saltProp)}Xx(){return this.zb(olympe.dm.User.verifierProp)}Mx(){return this.bb(olympe.dm.User.G,olympe.dm.Md)}};olympe.dm.User.P=olympe.dc.na.C('ff021000000000000003',olympe.dm.User);olympe.dm.User.loginProp=olympe.dm.User.P.la('ff023000000000000001');
971
+ olympe.W.run([olympe.dc.db.R.Ea,olympe.dc.transaction.R.Ea,olympe.dc.R.pp,olympe.dc.R.Jj,new olympe.W.oa(olympe.dc.V.Hg)],(a,b,c,d,e)=>{olympe.dc.Jr=()=>a;olympe.dc.hj=()=>b;olympe.dc.Qr=()=>c;olympe.dc.Nr=()=>d;olympe.dc.Sa.SELF=e},'DC singleton getter initialization');olympe.dm={};olympe.dm.Md=class extends olympe.dc.CloudObject{ma(){return this.zb(olympe.dc.CloudObject.nameProp)}C(){return olympe.D.Qa.EMPTY}F(){return olympe.D.fa.C}};olympe.dm.Md.P=olympe.dc.na.C('ff021000000000000002',olympe.dm.Md);olympe.dm.Md.O=olympe.dm.Md.P.la('ff023000000000000035');olympe.dm.Md.C=olympe.dm.Md.P.sa('ff022000000000000005');olympe.dm.Md.G=Cf('ff011000000000000001','AUTHENTICATED_USERS');olympe.dm.Md.J=Cf('ff011000000000000002','PROJECT_RUNNER_USERS_ROLE');
972
+ olympe.dm.Md.F=Cf('014831d95f83635090ea','ADMIN_USERS_ROLE');olympe.dm.Md.prototype.ma.L=olympe.D.K.F;olympe.dm.Md.prototype.C.L=olympe.D.K.F;olympe.dm.Md.prototype.F.L=olympe.D.K.O;olympe.dm.Vk={NONE:0,Tz:1,gt:2,Uz:4,Qz:8,Sz:16,Rz:31,pB:32,mB:64,qB:128,nB:256,Nu:512,oB:992,HA:1023};olympe.dm.User=class extends olympe.dc.CloudObject{tx(){return this.Vm()}ma(){return this.Vm()}Vm(){return this.zb(olympe.dm.User.loginProp)}bu(){return this.zb(olympe.dm.User.F)}au(){return olympe.D.Qa.EMPTY}Ox(){return this.zb(olympe.dm.User.saltProp)}Xx(){return this.zb(olympe.dm.User.verifierProp)}Mx(){return this.cb(olympe.dm.User.G,olympe.dm.Md)}};olympe.dm.User.P=olympe.dc.na.C('ff021000000000000003',olympe.dm.User);olympe.dm.User.loginProp=olympe.dm.User.P.la('ff023000000000000001');
973
973
  w('olympe.dm.User.loginProp',olympe.dm.User.loginProp);olympe.dm.User.F=olympe.dm.User.P.la('ff023000000000000002');olympe.dm.User.T=olympe.dm.User.P.la('ff023000000000000003');olympe.dm.User.saltProp=olympe.dm.User.P.la('ff023000000000000004');w('olympe.dm.User.saltProp',olympe.dm.User.saltProp);olympe.dm.User.verifierProp=olympe.dm.User.P.la('ff023000000000000005');w('olympe.dm.User.verifierProp',olympe.dm.User.verifierProp);olympe.dm.User.O=olympe.dm.User.P.la('ff023000000000000020');
974
974
  olympe.dm.User.SAMLnameIdProp=olympe.dm.User.P.la('ff023000000000000036');w('olympe.dm.User.SAMLnameIdProp',olympe.dm.User.SAMLnameIdProp);olympe.dm.User.G=T(olympe.dm.User.P,olympe.dm.Md.C);olympe.dm.User.Z=olympe.dm.User.P.sa('ff022000000000000002');olympe.dm.User.C=Cf('014831d95fd7d12b8568','ADMIN_USER');olympe.dm.User.J=Cf('0163d9653067b6237f62','GUEST_USER');m=olympe.dm.User.prototype;m.tx.L=olympe.D.K.F;m.ma.L=olympe.D.K.F;m.Vm.L=olympe.D.K.F;m.bu.L=olympe.D.K.F;m.au.L=olympe.D.K.F;m.Ox.L=olympe.D.K.F;
975
- m.Xx.L=olympe.D.K.F;m.Mx.L=new olympe.D.K(()=>olympe.dc.za,[]);olympe.dm.Uf=class extends olympe.dc.CloudObject{Z(){return this.Sm()}ab(){return this.zb(olympe.dm.Uf.ua)}};olympe.dm.Uf.P=olympe.dc.na.C('01621fb84e3300000000',olympe.dm.Uf);olympe.dm.Uf.ua=olympe.dm.Uf.P.la('01609de3f292e3c2c6ff');olympe.dm.Uf.prototype.Z.L=new olympe.D.K(()=>olympe.D.kd,[]);olympe.dm.Uf.prototype.ab.L=olympe.D.K.F;olympe.dm.BrickMetadata=class extends olympe.dm.Uf{Yx(){return this.zb(olympe.dm.BrickMetadata.ac)}Gc(){return this.zb(olympe.dm.BrickMetadata.ea)}getType(){return this.zb(olympe.dm.BrickMetadata.Jb)}ly(){return this.Ug(olympe.dm.BrickMetadata.yb)}ne(){return null}$w(){return this.bb(olympe.sc.ui.yw.Comment.GD.bc(),olympe.sc.ui.yw.Comment)}Ck(){return this.xk(olympe.dm.BrickMetadata.Ga).md().Ck()}};olympe.dm.BrickMetadata.P=Hf(olympe.dc.na.C('01621fb84e3500000000',olympe.dm.BrickMetadata));
976
- olympe.dm.BrickMetadata.ac=olympe.dm.BrickMetadata.P.la('01621fb84e320000f001');olympe.dm.BrickMetadata.ea=olympe.dm.BrickMetadata.P.la('01703376c4a81c0e9d94');olympe.dm.BrickMetadata.Jb=olympe.dm.BrickMetadata.P.la('01703376c4a81c0e9d00');olympe.dm.BrickMetadata.yb=olympe.dm.BrickMetadata.P.la('01703376c4a81c0eaea5');olympe.dm.BrickMetadata.Ga=olympe.dm.BrickMetadata.P.sa('0161ae97622bb21f335b');olympe.dm.BrickMetadata.Uc={yB:'private',AB:'public'};
977
- olympe.dm.BrickMetadata.Yb={aA:'experimental',PB:'stable',Oz:'deprecated'};olympe.dm.BrickMetadata.Tc={Bz:'business',kC:'technical'};m=olympe.dm.BrickMetadata.prototype;m.Yx.L=olympe.D.K.F;m.Gc.L=olympe.D.K.F;m.getType.L=olympe.D.K.F;m.ly.L=olympe.D.K.O;m.ne.L=new olympe.D.K(()=>String,[]);m.$w.L=new olympe.D.K(()=>olympe.dc.za,[]);m.Ck.L=olympe.D.K.T;function Ni(a,b){b=b.startsWith('data.')?b.substring(5):b;let c,d;return null!=(d=null!=(c=olympe.W.getParameter(`${'data.'}${a}.${b}`))?c:olympe.W.getParameter(`${'data.'}${b}`))?d:olympe.W.getParameter(`${olympe.dc.sources.sh.Uu}${b}`)}
978
- function ej(a,b){const c=a.query().hb(olympe.dm.rd.C.bc()).hb(olympe.dm.rd.F);a=a.query().hb(olympe.dm.kb.F.bc()).eg(olympe.dm.kb.G,!0).hb(olympe.sc.yc.C.bc());const d=e=>e.ge().eg(olympe.dc.CloudObject.extendRel,!0).hb(olympe.dc.CloudObject.mj,!0).hb(olympe.dm.Relation.destinationModelRel).back(2).hb(olympe.dc.CloudObject.propertyRel,!0).hb(olympe.dm.Property.typeRel).observe(b);return rxjs.combineLatest([d(c),d(a)]).pipe(rxjs.operators.map(([e,...f])=>e.concat(...f)))}
979
- function Bj(a,b){return a.observe(b,olympe.dm.DataSource.zr).pipe(rxjs.operators.map(()=>a.Df(olympe.dc.sources.V.Ke)),rxjs.operators.distinctUntilChanged())}
980
- olympe.dm.DataSource=class extends olympe.dc.CloudObject{constructor(a,b,c){super(a,b);this.Wb=c;this.Br=new Map([[olympe.dc.sources.V.Zl,olympe.dm.DataSource.Ry],[olympe.dc.sources.V.Ke,olympe.dm.DataSource.zr],[olympe.dc.sources.V.hm,olympe.dm.DataSource.Vy]])}U(){return this.tag===olympe.dm.DataSource.SERVER?olympe.dc.Ra.SERVER:this.tag}Df(a){const b=a.startsWith('data.')?a.split('.')[1]:a,c=`${'data.'}${b}`;let d,e;return null!=(e=null!=(d=olympe.W.getParameter(`${'data.'}${this.name().toLowerCase().replace(/\W/g,
981
- '_')}.${b}`))?d:Ni(this.X(),a))?e:this.Br.has(c)?this.get(this.Br.get(c)):null}Gc(){const a=this;return v(function*(){const b=olympe.dm.DataSource.Gb.jt,c=olympe.dm.DataSource.Gb.xb,d=new olympe.dc.Request(olympe.dc.Request.C.Gb,a.U());return a.Wb.request(d).then(e=>{let f;const g=null!=(f=null==e?void 0:e.s)?f:c;(e=null==e?void 0:e.r)&&olympe.ka.ib('dc').warn(`Source ${a.name()} (${a.U()}) has encountered issues: ${e}`);return g}).catch(e=>{const f=olympe.N.errors.Tp;return e instanceof olympe.N.errors.nk||
975
+ m.Xx.L=olympe.D.K.F;m.Mx.L=new olympe.D.K(()=>olympe.dc.za,[]);olympe.dm.Uf=class extends olympe.dc.CloudObject{Z(){return this.Sm()}bb(){return this.zb(olympe.dm.Uf.ua)}};olympe.dm.Uf.P=olympe.dc.na.C('01621fb84e3300000000',olympe.dm.Uf);olympe.dm.Uf.ua=olympe.dm.Uf.P.la('01609de3f292e3c2c6ff');olympe.dm.Uf.prototype.Z.L=new olympe.D.K(()=>olympe.D.kd,[]);olympe.dm.Uf.prototype.bb.L=olympe.D.K.F;olympe.dm.BrickMetadata=class extends olympe.dm.Uf{Yx(){return this.zb(olympe.dm.BrickMetadata.ac)}Gc(){return this.zb(olympe.dm.BrickMetadata.ea)}getType(){return this.zb(olympe.dm.BrickMetadata.Fb)}ly(){return this.Ug(olympe.dm.BrickMetadata.yb)}ne(){return null}$w(){return this.cb(olympe.sc.ui.yw.Comment.GD.bc(),olympe.sc.ui.yw.Comment)}Ck(){return this.xk(olympe.dm.BrickMetadata.Ga).md().Ck()}};olympe.dm.BrickMetadata.P=Hf(olympe.dc.na.C('01621fb84e3500000000',olympe.dm.BrickMetadata));
976
+ olympe.dm.BrickMetadata.ac=olympe.dm.BrickMetadata.P.la('01621fb84e320000f001');olympe.dm.BrickMetadata.ea=olympe.dm.BrickMetadata.P.la('01703376c4a81c0e9d94');olympe.dm.BrickMetadata.Fb=olympe.dm.BrickMetadata.P.la('01703376c4a81c0e9d00');olympe.dm.BrickMetadata.yb=olympe.dm.BrickMetadata.P.la('01703376c4a81c0eaea5');olympe.dm.BrickMetadata.Ga=olympe.dm.BrickMetadata.P.sa('0161ae97622bb21f335b');olympe.dm.BrickMetadata.Uc={yB:'private',AB:'public'};
977
+ olympe.dm.BrickMetadata.Yb={aA:'experimental',PB:'stable',Oz:'deprecated'};olympe.dm.BrickMetadata.Tc={Bz:'business',kC:'technical'};m=olympe.dm.BrickMetadata.prototype;m.Yx.L=olympe.D.K.F;m.Gc.L=olympe.D.K.F;m.getType.L=olympe.D.K.F;m.ly.L=olympe.D.K.O;m.ne.L=new olympe.D.K(()=>String,[]);m.$w.L=new olympe.D.K(()=>olympe.dc.za,[]);m.Ck.L=olympe.D.K.T;function Mi(a,b){b=b.startsWith('data.')?b.substring(5):b;let c,d;return null!=(d=null!=(c=olympe.W.getParameter(`${'data.'}${a}.${b}`))?c:olympe.W.getParameter(`${'data.'}${b}`))?d:olympe.W.getParameter(`${olympe.dc.sources.sh.Uu}${b}`)}
978
+ function dj(a,b){const c=a.query().ib(olympe.dm.rd.C.bc()).ib(olympe.dm.rd.F);a=a.query().ib(olympe.dm.kb.F.bc()).eg(olympe.dm.kb.G,!0).ib(olympe.sc.yc.C.bc());const d=e=>e.ge().eg(olympe.dc.CloudObject.extendRel,!0).ib(olympe.dc.CloudObject.mj,!0).ib(olympe.dm.Relation.destinationModelRel).back(2).ib(olympe.dc.CloudObject.propertyRel,!0).ib(olympe.dm.Property.typeRel).observe(b);return rxjs.combineLatest([d(c),d(a)]).pipe(rxjs.operators.map(([e,...f])=>e.concat(...f)))}
979
+ function Aj(a,b){return a.observe(b,olympe.dm.DataSource.zr).pipe(rxjs.operators.map(()=>a.Df(olympe.dc.sources.V.Ke)),rxjs.operators.distinctUntilChanged())}
980
+ olympe.dm.DataSource=class extends olympe.dc.CloudObject{constructor(a,b,c){super(a,b);this.Wb=c;this.Br=new Map([[olympe.dc.sources.V.Zl,olympe.dm.DataSource.Ry],[olympe.dc.sources.V.Ke,olympe.dm.DataSource.zr],[olympe.dc.sources.V.hm,olympe.dm.DataSource.Vy]])}U(){return this.tag===olympe.dm.DataSource.SERVER?olympe.dc.Sa.SERVER:this.tag}Df(a){const b=a.startsWith('data.')?a.split('.')[1]:a,c=`${'data.'}${b}`;let d,e;return null!=(e=null!=(d=olympe.W.getParameter(`${'data.'}${this.name().toLowerCase().replace(/\W/g,
981
+ '_')}.${b}`))?d:Mi(this.X(),a))?e:this.Br.has(c)?this.get(this.Br.get(c)):null}Gc(){const a=this;return v(function*(){const b=olympe.dm.DataSource.Hb.jt,c=olympe.dm.DataSource.Hb.xb,d=new olympe.dc.Request(olympe.dc.Request.C.Hb,a.U());return a.Wb.request(d).then(e=>{let f;const g=null!=(f=null==e?void 0:e.s)?f:c;(e=null==e?void 0:e.r)&&olympe.ka.ab('dc').warn(`Source ${a.name()} (${a.U()}) has encountered issues: ${e}`);return g}).catch(e=>{const f=olympe.N.errors.Tp;return e instanceof olympe.N.errors.nk||
982
982
  e instanceof f?b:c})})}init(){const a=this;return v(function*(){if(a.constructor===olympe.dm.DataSource)throw Error(`Data source ${a.name()} (${a.tag}) has no implementation (is the file missing ?)`);})}destroy(){return v(function*(){})}healthCheck(){return v(function*(){})}executeQuery(a){return v(function*(){return olympe.dc.query.td.cj(a)})}applyTransaction(){return v(function*(){})}uploadFileContent(){return v(function*(){throw Error('Should not try to upload files with SELF source');})}downloadFileContent(){return v(function*(){throw Error('Should not try to download files with SELF source');
983
983
  })}deleteFileContent(){return v(function*(){})}};olympe.dm.DataSource.prototype.deleteFileContent=olympe.dm.DataSource.prototype.deleteFileContent;olympe.dm.DataSource.prototype.downloadFileContent=olympe.dm.DataSource.prototype.downloadFileContent;olympe.dm.DataSource.prototype.uploadFileContent=olympe.dm.DataSource.prototype.uploadFileContent;olympe.dm.DataSource.prototype.applyTransaction=olympe.dm.DataSource.prototype.applyTransaction;olympe.dm.DataSource.prototype.executeQuery=olympe.dm.DataSource.prototype.executeQuery;
984
984
  olympe.dm.DataSource.prototype.healthCheck=olympe.dm.DataSource.prototype.healthCheck;olympe.dm.DataSource.prototype.destroy=olympe.dm.DataSource.prototype.destroy;olympe.dm.DataSource.prototype.init=olympe.dm.DataSource.prototype.init;olympe.dm.DataSource.prototype.getConfig=olympe.dm.DataSource.prototype.Df;olympe.dm.DataSource.prototype.getId=olympe.dm.DataSource.prototype.U;olympe.dm.DataSource.P=olympe.dc.na.C('ff021000000000000060',olympe.dm.DataSource,olympe.dc.R.Dg);
985
985
  olympe.dm.DataSource.Oh=olympe.dm.DataSource.P.la('ff023000000000000060');w('olympe.dm.DataSource.activatedProp',olympe.dm.DataSource.Oh);olympe.dm.DataSource.JD=olympe.dm.DataSource.P.la('ff023000000000000061');olympe.dm.DataSource.Ry=olympe.dm.DataSource.P.la('ff023000000000000062');olympe.dm.DataSource.zr=olympe.dm.DataSource.P.la('ff023000000000000063');olympe.dm.DataSource.Fr=olympe.dm.DataSource.P.la('ff023000000000000064');olympe.dm.DataSource.Vy=olympe.dm.DataSource.P.la('ff023000000000000065');
986
- olympe.dm.DataSource.nj=olympe.dm.DataSource.P.sa('ff022000000000000060');olympe.dm.DataSource.SERVER=Cf('00000000000000000060','Server source');olympe.dm.DataSource.Ke={LA:'hybrid',Nn:'bus',fp:'http'};olympe.dm.DataSource.Gb={Dh:'ready',xb:'error',jt:'down',ee:'offline'};olympe.dm.rd=class extends olympe.dc.CloudObject{};olympe.dm.rd.P=olympe.dc.na.C('ff021000000000000070',olympe.dm.rd);olympe.dm.rd.C=olympe.dm.rd.P.sa('ff023000000000000071');olympe.dm.rd.F=olympe.dm.rd.P.sa('ff023000000000000072');olympe.dm.rd.G=olympe.dm.rd.P.sa('ff023000000000000073');olympe.dm.Lb=class extends olympe.dm.BrickMetadata{J(){return new olympe.dc.za(this.X(),[new olympe.dc.da.Ae(olympe.dm.Lb.C.X(),olympe.dc.wa.DESTINATION,olympe.dc.da.Dq.Ft,olympe.dc.da.Dq.Gt),olympe.dm.Lb.J])}ne(){return olympe.sc.pe.De.st}C(){return this.bb(olympe.dm.Lb.C,olympe.dm.Lb)}O(){return this.bb(olympe.dm.Lb.J)}};olympe.dm.Lb.P=olympe.dc.na.C('01612df1db9749227626',olympe.dm.Lb);olympe.dm.Lb.C=olympe.dm.Lb.P.sa('016a697ef00ce7554691');olympe.dm.Lb.ja=T(olympe.dm.Lb.P,olympe.dm.Lb.C);
987
- olympe.dm.Lb.J=olympe.dm.Lb.P.sa('016a697ef00ce7554692');T(olympe.dc.CloudObject.P,olympe.dm.Lb.J);olympe.dm.Lb.prototype.J.L=new olympe.D.K(()=>olympe.dc.za,[]);olympe.dm.Lb.prototype.C.L=new olympe.D.K(()=>olympe.dc.za,[]);olympe.dm.Lb.prototype.O.L=new olympe.D.K(()=>olympe.dc.za,[]);olympe.dm.Ic=class extends olympe.dm.Lb{C(){return this.X()===olympe.dm.Ic.aa?this.bb(olympe.dm.Ic.O,olympe.dm.Lb):this.bb(olympe.dm.Ic.T,olympe.dm.Lb)}};olympe.dm.Ic.P=olympe.dc.na.C('ff021000000000000020',olympe.dm.Ic);olympe.dm.Ic.T=olympe.dm.Ic.P.sa('017e9c34cf48bd6965c1');olympe.dm.Ic.O=olympe.dm.Ic.P.sa('017e9c2e013e06bfffd9');olympe.dm.Ic.$h=olympe.dm.Ic.P.sa('01811f12ad77673770d4');olympe.dm.Ic.aa=Cf('10000000000000000000','ROOT_OF_ROOTS');olympe.dm.Ic.hc=Cf('10000000000000000001','OLYMPE_FOLDER');
988
- olympe.dm.Ic.Ub=Cf('10000000000000000002','INTERNAL_FOLDER');olympe.dm.Ic.prototype.C.L=new olympe.D.K(()=>olympe.dc.za,[]);olympe.dm.Module=class extends olympe.dc.CloudObject{sx(){return this.zb(olympe.dm.Module.O)}Dx(){return this.nd(olympe.dm.Module.T)}cu(){return this.zb(olympe.dm.Module.F)}Hx(){return this.zb(olympe.dm.Module.Z)}ax(){return this.zb(olympe.dm.Module.G)}Ex(){return this.bb(olympe.dm.Module.J,olympe.dm.Module)}Px(){return this.bb(olympe.dm.Module.C,olympe.dm.Gd)}};olympe.dm.Module.P=olympe.dc.na.C('ff021000000000000040',olympe.dm.Module);olympe.dm.Module.O=olympe.dm.Module.P.la('ff023000000000000042');
986
+ olympe.dm.DataSource.nj=olympe.dm.DataSource.P.sa('ff022000000000000060');olympe.dm.DataSource.SERVER=Cf('00000000000000000060','Server source');olympe.dm.DataSource.Ke={LA:'hybrid',Nn:'bus',fp:'http'};olympe.dm.DataSource.Hb={Dh:'ready',xb:'error',jt:'down',ee:'offline'};olympe.dm.rd=class extends olympe.dc.CloudObject{};olympe.dm.rd.P=olympe.dc.na.C('ff021000000000000070',olympe.dm.rd);olympe.dm.rd.C=olympe.dm.rd.P.sa('ff023000000000000071');olympe.dm.rd.F=olympe.dm.rd.P.sa('ff023000000000000072');olympe.dm.rd.G=olympe.dm.rd.P.sa('ff023000000000000073');olympe.dm.Lb=class extends olympe.dm.BrickMetadata{J(){return new olympe.dc.za(this.X(),[new olympe.dc.da.Ae(olympe.dm.Lb.C.X(),olympe.dc.wa.DESTINATION,olympe.dc.da.Dq.Ft,olympe.dc.da.Dq.Gt),olympe.dm.Lb.J])}ne(){return olympe.sc.pe.De.st}C(){return this.cb(olympe.dm.Lb.C,olympe.dm.Lb)}O(){return this.cb(olympe.dm.Lb.J)}};olympe.dm.Lb.P=olympe.dc.na.C('01612df1db9749227626',olympe.dm.Lb);olympe.dm.Lb.C=olympe.dm.Lb.P.sa('016a697ef00ce7554691');olympe.dm.Lb.ja=T(olympe.dm.Lb.P,olympe.dm.Lb.C);
987
+ olympe.dm.Lb.J=olympe.dm.Lb.P.sa('016a697ef00ce7554692');T(olympe.dc.CloudObject.P,olympe.dm.Lb.J);olympe.dm.Lb.prototype.J.L=new olympe.D.K(()=>olympe.dc.za,[]);olympe.dm.Lb.prototype.C.L=new olympe.D.K(()=>olympe.dc.za,[]);olympe.dm.Lb.prototype.O.L=new olympe.D.K(()=>olympe.dc.za,[]);olympe.dm.Ic=class extends olympe.dm.Lb{C(){return this.X()===olympe.dm.Ic.aa?this.cb(olympe.dm.Ic.O,olympe.dm.Lb):this.cb(olympe.dm.Ic.T,olympe.dm.Lb)}};olympe.dm.Ic.P=olympe.dc.na.C('ff021000000000000020',olympe.dm.Ic);olympe.dm.Ic.T=olympe.dm.Ic.P.sa('017e9c34cf48bd6965c1');olympe.dm.Ic.O=olympe.dm.Ic.P.sa('017e9c2e013e06bfffd9');olympe.dm.Ic.$h=olympe.dm.Ic.P.sa('01811f12ad77673770d4');olympe.dm.Ic.aa=Cf('10000000000000000000','ROOT_OF_ROOTS');olympe.dm.Ic.hc=Cf('10000000000000000001','OLYMPE_FOLDER');
988
+ olympe.dm.Ic.Ub=Cf('10000000000000000002','INTERNAL_FOLDER');olympe.dm.Ic.prototype.C.L=new olympe.D.K(()=>olympe.dc.za,[]);olympe.dm.Module=class extends olympe.dc.CloudObject{sx(){return this.zb(olympe.dm.Module.O)}Dx(){return this.nd(olympe.dm.Module.T)}cu(){return this.zb(olympe.dm.Module.F)}Hx(){return this.zb(olympe.dm.Module.Z)}ax(){return this.zb(olympe.dm.Module.G)}Ex(){return this.cb(olympe.dm.Module.J,olympe.dm.Module)}Px(){return this.cb(olympe.dm.Module.C,olympe.dm.Gd)}};olympe.dm.Module.P=olympe.dc.na.C('ff021000000000000040',olympe.dm.Module);olympe.dm.Module.O=olympe.dm.Module.P.la('ff023000000000000042');
989
989
  olympe.dm.Module.T=olympe.dm.Module.P.la('ff023000000000000043');olympe.dm.Module.F=olympe.dm.Module.P.la('ff023000000000000044');olympe.dm.Module.Z=olympe.dm.Module.P.la('ff023000000000000045');olympe.dm.Module.G=olympe.dm.Module.P.la('ff023000000000000046');olympe.dm.Module.creationDateProp=olympe.dm.Module.P.la('ff023000000000000049');olympe.dm.Module.C=olympe.dm.Module.P.sa('ff022000000000000013');olympe.dm.Module.J=olympe.dm.Module.P.sa('ff022000000000000014');
990
- olympe.dm.Module.aa=Cf('016a69b9bceabd815b77','OLYMPE_SERVER_MODULE');m=olympe.dm.Module.prototype;m.sx.L=olympe.D.K.F;m.Dx.L=olympe.D.K.G;m.cu.L=olympe.D.K.F;m.Hx.L=olympe.D.K.F;m.ax.L=olympe.D.K.F;m.Ex.L=new olympe.D.K(()=>olympe.dc.za,[]);m.Px.L=new olympe.D.K(()=>olympe.dc.za,[]);olympe.dm.File=class extends olympe.dc.CloudObject{static F(a,b,c,d,e,f,g){e=e||'application/data';d=URL.createObjectURL(new Blob([d],{type:e}));g=null!=g?g:olympe.dc.Zd().fromModel(a);a=b.create(a,f).ci(g);b=olympe.D.fb.now();Z(Z(Z(Z(Z(Z(a,olympe.dm.File.fileNameProp,null!=c?c:'file'),olympe.dm.File.urlProp,d),olympe.dm.File.creationDateProp,b),olympe.dm.File.modificationDateProp,b),olympe.dm.File.mimeTypeProp,e||'application/data'),olympe.dm.File.C,!1);return a.X()}constructor(a,b,c,d,e){super(a,
991
- b);this.C=c;this.G=d;this.F=e}Sr(){return this.zb(olympe.dm.File.mimeTypeProp)}zk(a,b){const c=olympe.D.$a().G(a);a=olympe.D.$a().G(d=>null==b?void 0:b(`${d}`));this.C.J(this).then(d=>{c(d.buffer.slice(d.byteOffset,d.byteOffset+d.byteLength))}).catch(a)}Rm(a,b){this.zk(c=>{a(Va(c))},b)}Ak(a,b){const c=olympe.D.$a().G(a),d=olympe.D.$a().G(h=>null==b?void 0:b(`${h}`)),e=this.get(olympe.dm.File.C),f=this.get(olympe.dm.File.urlProp),g=this.get(olympe.dm.File.mimeTypeProp);e||(null==f?0:f.startsWith('blob:'))||
992
- (null==f?0:f.startsWith('stream:'))?this.C.J(this).then(h=>{c(`data:${g};base64,${this.F.C(h)}`)}).catch(d):'string'===typeof f?a(f):b(`No content nor URL associated to the file ${this.X()}`)}rename(a,b){const c=b&&olympe.D.$a().G(b);olympe.D.hs([a],d=>{const e=new olympe.dc.Wa;e.update(this,olympe.dc.CloudObject.nameProp,d);e.update(this,olympe.dm.File.fileNameProp,d);e.ob(f=>{c&&c(f)})})}Yy(){this.G.O(this.get(olympe.dm.File.mimeTypeProp))}vp(){return this.zb(olympe.dm.File.urlProp)}up(){return this.zb(olympe.dm.File.fileNameProp)}hx(){return this.gj(olympe.dm.File.creationDateProp)}Cx(){return this.gj(olympe.dm.File.modificationDateProp)}ky(){return this.Ug(olympe.dm.File.C)}};
990
+ olympe.dm.Module.aa=Cf('016a69b9bceabd815b77','OLYMPE_SERVER_MODULE');m=olympe.dm.Module.prototype;m.sx.L=olympe.D.K.F;m.Dx.L=olympe.D.K.G;m.cu.L=olympe.D.K.F;m.Hx.L=olympe.D.K.F;m.ax.L=olympe.D.K.F;m.Ex.L=new olympe.D.K(()=>olympe.dc.za,[]);m.Px.L=new olympe.D.K(()=>olympe.dc.za,[]);olympe.dm.File=class extends olympe.dc.CloudObject{static F(a,b,c,d,e,f,g){e=e||'application/data';d=URL.createObjectURL(new Blob([d],{type:e}));g=null!=g?g:olympe.dc.Zd().fromModel(a);a=b.create(a,f).ci(g);b=olympe.D.gb.now();Z(Z(Z(Z(Z(Z(a,olympe.dm.File.fileNameProp,null!=c?c:'file'),olympe.dm.File.urlProp,d),olympe.dm.File.creationDateProp,b),olympe.dm.File.modificationDateProp,b),olympe.dm.File.mimeTypeProp,e||'application/data'),olympe.dm.File.C,!1);return a.X()}constructor(a,b,c,d,e){super(a,
991
+ b);this.C=c;this.G=d;this.F=e}Sr(){return this.zb(olympe.dm.File.mimeTypeProp)}zk(a,b){void 0===a&&void 0===b||olympe.ka.ab('File.getContentAsBinary').warn('"onSuccess" and "onFailure" callbacks are deprecated in favor of the returned promise');const c=a&&olympe.D.Wa().G(a),d=b&&olympe.D.Wa().G(e=>null==b?void 0:b(`${e}`));return this.C.J(this).then(e=>{e=e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);null==c||c(e);return e}).catch(e=>{null==d||d(e.message);throw e;})}Rm(a,b){void 0===a&&
992
+ void 0===b||olympe.ka.ab('File.getContentAsString').warn('"onSuccess" and "onFailure" callbacks are deprecated in favor of the returned promise');const c=a&&olympe.D.Wa().G(a),d=b&&olympe.D.Wa().G(e=>null==b?void 0:b(`${e}`));return this.zk().then(e=>{e=Va(e);null==c||c(e);return e}).catch(e=>{null==d||d(e.message);throw e;})}Ak(a,b){void 0===a&&void 0===b||olympe.ka.ab('File.getContentUrl').warn('"onSuccess" and "onFailure" callbacks are deprecated in favor of the returned promise');const c=a&&olympe.D.Wa().G(a),
993
+ d=b&&olympe.D.Wa().G(g=>null==b?void 0:b(`${g}`));a=this.get(olympe.dm.File.C);const e=this.get(olympe.dm.File.urlProp),f=this.get(olympe.dm.File.mimeTypeProp);if(a||(null==e?0:e.startsWith('blob:'))||(null==e?0:e.startsWith('stream:')))return this.C.J(this).then(g=>{g=`data:${f};base64,${this.F.C(g)}`;null==c||c(g);return g}).catch(g=>{null==d||d(g.message);throw g;});if('string'===typeof e)return null==c||c(e),Promise.resolve(e);a=`No content nor URL associated to the file ${this.X()}`;null==d||
994
+ d(a);return Promise.reject(Error(a))}rename(a,b){const c=b&&olympe.D.Wa().G(b);olympe.D.hs([a],d=>{const e=new olympe.dc.Xa;e.update(this,olympe.dc.CloudObject.nameProp,d);e.update(this,olympe.dm.File.fileNameProp,d);e.ob(f=>{c&&c(f)})})}Yy(){this.G.O(this.get(olympe.dm.File.mimeTypeProp))}vp(){return this.zb(olympe.dm.File.urlProp)}up(){return this.zb(olympe.dm.File.fileNameProp)}hx(){return this.gj(olympe.dm.File.creationDateProp)}Cx(){return this.gj(olympe.dm.File.modificationDateProp)}ky(){return this.Ug(olympe.dm.File.C)}};
993
995
  olympe.dm.File.prototype.saveAs=olympe.dm.File.prototype.Yy;olympe.dm.File.prototype.getContentUrl=olympe.dm.File.prototype.Ak;olympe.dm.File.prototype.getContentAsString=olympe.dm.File.prototype.Rm;olympe.dm.File.prototype.getContentAsBinary=olympe.dm.File.prototype.zk;olympe.dm.File.P=olympe.dc.na.C('ff021000000000000030',olympe.dm.File,olympe.dc.R.Jj,olympe.net.R.Ea,olympe.Y.R.mg);olympe.dm.File.nameProp=olympe.dm.File.P.la('ff023000000000000050');w('olympe.dm.File.nameProp',olympe.dm.File.nameProp);
994
996
  olympe.dm.File.fileNameProp=olympe.dm.File.P.la('ff023000000000000050');w('olympe.dm.File.fileNameProp',olympe.dm.File.fileNameProp);olympe.dm.File.creationDateProp=olympe.dm.File.P.la('ff023000000000000051');w('olympe.dm.File.creationDateProp',olympe.dm.File.creationDateProp);olympe.dm.File.modificationDateProp=olympe.dm.File.P.la('ff023000000000000055');w('olympe.dm.File.modificationDateProp',olympe.dm.File.modificationDateProp);olympe.dm.File.mimeTypeProp=olympe.dm.File.P.la('ff023000000000000052');
995
997
  w('olympe.dm.File.mimeTypeProp',olympe.dm.File.mimeTypeProp);olympe.dm.File.urlProp=olympe.dm.File.P.la('ff023000000000000053');w('olympe.dm.File.urlProp',olympe.dm.File.urlProp);olympe.dm.File.C=olympe.dm.File.P.la('ff023000000000000054');olympe.dm.File.P.C=olympe.dm.File.F.bind(null,olympe.dm.File);olympe.dm.File.O='application/data';olympe.dm.File.ya=[olympe.D.File];m=olympe.dm.File.prototype;m.Sr.L=olympe.D.K.F;m.zk.L=new olympe.D.K(()=>{},[]);m.Rm.L=new olympe.D.K(()=>{},[]);
996
- m.Ak.L=new olympe.D.K(()=>{},[]);m.rename.L=olympe.D.K.C;m.vp.L=olympe.D.K.F;m.up.L=olympe.D.K.F;m.hx.L=new olympe.D.K(()=>olympe.D.fb,[]);m.Cx.L=new olympe.D.K(()=>olympe.D.fb,[]);m.ky.L=olympe.D.K.O;olympe.dm.Gd=class extends olympe.dc.CloudObject{C(){return this.zb(olympe.dm.Gd.F)}G(){return this.nd(olympe.dm.Gd.G)}F(){return this.bb(olympe.dm.Gd.C,olympe.dm.Module)}};olympe.dm.Gd.P=olympe.dc.na.C('ff021000000000000041',olympe.dm.Gd);olympe.dm.Gd.F=olympe.dm.Gd.P.la('ff023000000000000047');olympe.dm.Gd.G=olympe.dm.Gd.P.la('ff023000000000000048');olympe.dm.Gd.C=olympe.dm.Module.C.bc();olympe.dm.Gd.prototype.C.L=olympe.D.K.F;olympe.dm.Gd.prototype.G.L=olympe.D.K.G;
997
- olympe.dm.Gd.prototype.F.L=new olympe.D.K(()=>olympe.dc.za,[]);olympe.dm.kb=class extends olympe.dm.Ic{C(){return this.bb(olympe.dm.Lb.C,olympe.dm.Lb)}G(){return this.zb(olympe.dm.kb.Z)}T(){return this.zb(olympe.dm.kb.gb)}F(){return this.bb(olympe.dm.kb.G,olympe.dm.kb)}};olympe.dm.kb.P=olympe.dc.na.C('0163d9594700fcf61e54',olympe.dm.kb);olympe.dm.kb.Z=olympe.dm.kb.P.la('017869c7d2833c9492c1');olympe.dm.kb.bs=olympe.dm.kb.P.la('017869c7d2833c9492c2');olympe.dm.kb.Ud=olympe.dm.kb.P.la('017869c7d2833c9492c3');olympe.dm.kb.gb=olympe.dm.kb.P.la('017869c80bb9929c76d0');
998
- olympe.dm.kb.ab=olympe.dm.kb.P.sa('ff02200000000000002a');olympe.dm.kb.G=olympe.dm.kb.P.sa('ff02200000000000002b');olympe.dm.kb.Bf=T(olympe.dm.kb.P,olympe.dm.kb.G);olympe.dm.kb.F=olympe.dm.kb.P.sa('ff02200000000000002c');olympe.dm.kb.Uh=olympe.dm.kb.P.sa('017e9c412e2b944bc48f');olympe.dm.kb.Vd=olympe.dm.kb.P.sa('017e9c412e2b944bd590');olympe.dm.kb.$r=olympe.dm.kb.P.sa('017e9c416872a89d3415');olympe.dm.kb.Hk=olympe.dm.kb.P.sa('017ebf8fe5c506662098');T(olympe.dc.CloudObject.P,olympe.dm.kb.ab);
998
+ m.Ak.L=new olympe.D.K(()=>{},[]);m.rename.L=olympe.D.K.C;m.vp.L=olympe.D.K.F;m.up.L=olympe.D.K.F;m.hx.L=new olympe.D.K(()=>olympe.D.gb,[]);m.Cx.L=new olympe.D.K(()=>olympe.D.gb,[]);m.ky.L=olympe.D.K.O;olympe.dm.Gd=class extends olympe.dc.CloudObject{C(){return this.zb(olympe.dm.Gd.F)}G(){return this.nd(olympe.dm.Gd.G)}F(){return this.cb(olympe.dm.Gd.C,olympe.dm.Module)}};olympe.dm.Gd.P=olympe.dc.na.C('ff021000000000000041',olympe.dm.Gd);olympe.dm.Gd.F=olympe.dm.Gd.P.la('ff023000000000000047');olympe.dm.Gd.G=olympe.dm.Gd.P.la('ff023000000000000048');olympe.dm.Gd.C=olympe.dm.Module.C.bc();olympe.dm.Gd.prototype.C.L=olympe.D.K.F;olympe.dm.Gd.prototype.G.L=olympe.D.K.G;
999
+ olympe.dm.Gd.prototype.F.L=new olympe.D.K(()=>olympe.dc.za,[]);olympe.dm.kb=class extends olympe.dm.Ic{C(){return this.cb(olympe.dm.Lb.C,olympe.dm.Lb)}G(){return this.zb(olympe.dm.kb.Z)}T(){return this.zb(olympe.dm.kb.hb)}F(){return this.cb(olympe.dm.kb.G,olympe.dm.kb)}};olympe.dm.kb.P=olympe.dc.na.C('0163d9594700fcf61e54',olympe.dm.kb);olympe.dm.kb.Z=olympe.dm.kb.P.la('017869c7d2833c9492c1');olympe.dm.kb.bs=olympe.dm.kb.P.la('017869c7d2833c9492c2');olympe.dm.kb.Ud=olympe.dm.kb.P.la('017869c7d2833c9492c3');olympe.dm.kb.hb=olympe.dm.kb.P.la('017869c80bb9929c76d0');
1000
+ olympe.dm.kb.bb=olympe.dm.kb.P.sa('ff02200000000000002a');olympe.dm.kb.G=olympe.dm.kb.P.sa('ff02200000000000002b');olympe.dm.kb.Bf=T(olympe.dm.kb.P,olympe.dm.kb.G);olympe.dm.kb.F=olympe.dm.kb.P.sa('ff02200000000000002c');olympe.dm.kb.Uh=olympe.dm.kb.P.sa('017e9c412e2b944bc48f');olympe.dm.kb.Vd=olympe.dm.kb.P.sa('017e9c412e2b944bd590');olympe.dm.kb.$r=olympe.dm.kb.P.sa('017e9c416872a89d3415');olympe.dm.kb.Hk=olympe.dm.kb.P.sa('017ebf8fe5c506662098');T(olympe.dc.CloudObject.P,olympe.dm.kb.bb);
999
1001
  olympe.dm.kb.Cc=Cf('100000000000000000dd','PRIMORDIAL');olympe.dm.kb.prototype.C.L=new olympe.D.K(()=>olympe.dc.za,[]);olympe.dm.kb.prototype.G.L=olympe.D.K.F;olympe.dm.kb.prototype.T.L=olympe.D.K.F;olympe.dm.kb.prototype.F.L=new olympe.D.K(()=>olympe.dc.za,[]);olympe.dm.Property=class extends olympe.dc.CloudObject{C(){return this.pc(olympe.dm.Property.definingModelRel,olympe.dc.CloudObject)}getType(){return this.pc(olympe.dm.Property.typeRel,olympe.dc.CloudObject)}F(){return this.xk(olympe.dm.Property.typeRel).md()}Oc(){return this.C().ma().Ar(this.ma())}};olympe.dm.Property.P=olympe.dc.na.C('ff021000000000000005',olympe.dm.Property);olympe.dm.Property.definingModelRel=T(olympe.dm.Property.P,olympe.dc.CloudObject.propertyRel);
1000
- w('olympe.dm.Property.definingModelRel',olympe.dm.Property.definingModelRel);olympe.dm.Property.typeRel=T(olympe.dm.Property.P,olympe.dc.CloudObject.typeRel);w('olympe.dm.Property.typeRel',olympe.dm.Property.typeRel);olympe.dm.Property.prototype.C.L=new olympe.D.K(()=>olympe.dc.CloudObject,[]);olympe.dm.Property.prototype.getType.L=new olympe.D.K(()=>olympe.dc.CloudObject,[]);olympe.dm.Property.prototype.F.L=olympe.D.K.C;olympe.dm.Relation=class extends olympe.dc.CloudObject{constructor(a,b){super(a,b)}yx(){return olympe.D.Pa.EMPTY}Xw(){return this.nd(olympe.dm.Relation.F)}Ix(){return this.nd(olympe.dm.Relation.G)}Kr(){return this.bb(olympe.dm.Relation.destinationModelRel,olympe.dc.CloudObject).Fc()}Ur(){return this.bb(olympe.dm.Relation.originModelRel,olympe.dc.CloudObject).Fc()}Oc(){return this.Ur().ma().concat(['-',this.ma(),'->',this.Kr().ma()])}};olympe.dm.Relation.P=olympe.dc.na.C('ff021000000000000006',olympe.dm.Relation);
1002
+ w('olympe.dm.Property.definingModelRel',olympe.dm.Property.definingModelRel);olympe.dm.Property.typeRel=T(olympe.dm.Property.P,olympe.dc.CloudObject.typeRel);w('olympe.dm.Property.typeRel',olympe.dm.Property.typeRel);olympe.dm.Property.prototype.C.L=new olympe.D.K(()=>olympe.dc.CloudObject,[]);olympe.dm.Property.prototype.getType.L=new olympe.D.K(()=>olympe.dc.CloudObject,[]);olympe.dm.Property.prototype.F.L=olympe.D.K.C;olympe.dm.Relation=class extends olympe.dc.CloudObject{constructor(a,b){super(a,b)}yx(){return olympe.D.Qa.EMPTY}Xw(){return this.nd(olympe.dm.Relation.F)}Ix(){return this.nd(olympe.dm.Relation.G)}Kr(){return this.cb(olympe.dm.Relation.destinationModelRel,olympe.dc.CloudObject).Fc()}Ur(){return this.cb(olympe.dm.Relation.originModelRel,olympe.dc.CloudObject).Fc()}Oc(){return this.Ur().ma().concat(['-',this.ma(),'->',this.Kr().ma()])}};olympe.dm.Relation.P=olympe.dc.na.C('ff021000000000000006',olympe.dm.Relation);
1001
1003
  olympe.dm.Relation.G=olympe.dm.Relation.P.la('ff023000000000000030');olympe.dm.Relation.F=olympe.dm.Relation.P.la('ff023000000000000034');olympe.dm.Relation.ea=olympe.dm.Relation.P.la(olympe.dc.Nb.wo);olympe.dm.Relation.Z=olympe.dm.Relation.P.la(olympe.dc.Nb.Dc);olympe.dm.Relation.ja=olympe.dm.Relation.P.la(olympe.dc.Nb.Yf);olympe.dm.Relation.ua=olympe.dm.Relation.P.la(olympe.dc.Nb.zv);olympe.dm.Relation.aa=olympe.dm.Relation.P.la(olympe.dc.Nb.kt);olympe.dm.Relation.T=olympe.dm.Relation.P.la('ff023000000000000031');
1002
1004
  olympe.dm.Relation.originModelRel=T(olympe.dm.Relation.P,olympe.dc.CloudObject.mj);w('olympe.dm.Relation.originModelRel',olympe.dm.Relation.originModelRel);olympe.dm.Relation.destinationModelRel=T(olympe.dm.Relation.P,olympe.dc.CloudObject.Er);w('olympe.dm.Relation.destinationModelRel',olympe.dm.Relation.destinationModelRel);olympe.dm.Relation.C={Et:0,Is:5,tq:1,jv:4,vm:2,im:8,$z:10,GB:6,HB:9,Me:6,JB:9};olympe.dm.Relation.J={lB:3,Lu:4,ZA:5,YA:6};olympe.dm.Relation.O=olympe.dm.Vk.Nu+olympe.dm.Vk.gt;
1003
- m=olympe.dm.Relation.prototype;m.yx.L=olympe.D.K.F;m.Xw.L=olympe.D.K.G;m.Ix.L=olympe.D.K.G;m.Kr.L=new olympe.D.K(()=>olympe.dc.CloudObject,[]);m.Ur.L=new olympe.D.K(()=>olympe.dc.CloudObject,[]);function vm(a){a=olympe.dc.ga(a);if(olympe.dc.ia().If(a,olympe.dm.String))return olympe.dm.String.valueProp;switch(a){case olympe.dm.Number.P.X():return olympe.dm.Number.valueProp;case olympe.dm.Boolean.P.X():return olympe.dm.Boolean.valueProp;case olympe.dm.DateTime.P.X():return olympe.dm.DateTime.valueProp;case olympe.dm.Color.P.X():return olympe.dm.Color.valueProp;default:throw Error('Unknown primitive model: '+a);}}olympe.dm.ye=class extends olympe.dc.CloudObject{getValue(){}};
1005
+ m=olympe.dm.Relation.prototype;m.yx.L=olympe.D.K.F;m.Xw.L=olympe.D.K.G;m.Ix.L=olympe.D.K.G;m.Kr.L=new olympe.D.K(()=>olympe.dc.CloudObject,[]);m.Ur.L=new olympe.D.K(()=>olympe.dc.CloudObject,[]);function um(a){a=olympe.dc.ga(a);if(olympe.dc.ia().If(a,olympe.dm.String))return olympe.dm.String.valueProp;switch(a){case olympe.dm.Number.P.X():return olympe.dm.Number.valueProp;case olympe.dm.Boolean.P.X():return olympe.dm.Boolean.valueProp;case olympe.dm.DateTime.P.X():return olympe.dm.DateTime.valueProp;case olympe.dm.Color.P.X():return olympe.dm.Color.valueProp;default:throw Error('Unknown primitive model: '+a);}}olympe.dm.ye=class extends olympe.dc.CloudObject{getValue(){}};
1004
1006
  olympe.dm.ye.P=olympe.dc.na.C('ff021000000000000019',olympe.dm.ye);olympe.dm.String=class extends olympe.dm.ye{getValue(){return this.zb(olympe.dm.String.valueProp)}Ac(){return this.get(olympe.dm.String.valueProp)}toString(){let a;return null!=(a=this.get(olympe.dm.String.valueProp))?a:''}};olympe.dm.String.P=olympe.dc.na.C('ff021000000000000011',olympe.dm.String);olympe.dm.String.valueProp=olympe.dm.String.P.la('ff023000000000000026');w('olympe.dm.String.valueProp',olympe.dm.String.valueProp);olympe.dm.String.prototype.getValue.L=olympe.D.K.F;
1005
- olympe.dm.String.prototype.toString.L=olympe.D.K.C;olympe.dm.Boolean=class extends olympe.dm.ye{getValue(){return this.Ug(olympe.dm.Boolean.valueProp)}Ac(){return this.get(olympe.dm.Boolean.valueProp)}};olympe.dm.Boolean.P=olympe.dc.na.C('ff021000000000000012',olympe.dm.Boolean);olympe.dm.Boolean.valueProp=olympe.dm.Boolean.P.la('ff023000000000000027');w('olympe.dm.Boolean.valueProp',olympe.dm.Boolean.valueProp);olympe.dm.Boolean.prototype.getValue.L=olympe.D.K.O;olympe.dm.Color=class extends olympe.dm.ye{getValue(){return this.Vr()}Ac(){return this.get(olympe.dm.Color.valueProp)}};olympe.dm.Color.P=olympe.dc.na.C('ff021000000000000017',olympe.dm.Color);olympe.dm.Color.valueProp=olympe.dm.Color.P.la('ff023000000000000032');w('olympe.dm.Color.valueProp',olympe.dm.Color.valueProp);olympe.dm.Color.prototype.getValue.L=new olympe.D.K(()=>olympe.D.Color,[]);olympe.dm.DateTime=class extends olympe.dm.ye{getValue(){return this.gj(olympe.dm.DateTime.valueProp)}Ac(){return this.get(olympe.dm.DateTime.valueProp)}};olympe.dm.DateTime.P=olympe.dc.na.C('ff021000000000000014',olympe.dm.DateTime);olympe.dm.DateTime.valueProp=olympe.dm.DateTime.P.la('ff023000000000000029');w('olympe.dm.DateTime.valueProp',olympe.dm.DateTime.valueProp);olympe.dm.DateTime.prototype.getValue.L=new olympe.D.K(()=>olympe.D.fb,[]);olympe.dm.Enum=class extends olympe.dm.String{ma(){return olympe.D.va([super.ma(),super.getValue()],(a,b)=>''!==a.valueOf()?a:b,olympe.D.Pa)}xd(){return this.nd(olympe.dm.Enum.rankProp)}};olympe.dm.Enum.P=olympe.dc.na.C('016cdd861b32d56c81f7',olympe.dm.Enum);olympe.dm.Enum.rankProp=olympe.dm.Enum.P.la('017a7690c915975ea995');olympe.dm.Enum.prototype.xd.L=olympe.D.K.G;olympe.dm.Wf=class extends olympe.dm.BrickMetadata{Wx(){return this.hb(olympe.dc.CloudObject.instancesRel).Qk(olympe.dm.Enum.rankProp,olympe.dc.query.Xj.ASC).md()}static create(a,b){b=a.create(olympe.dm.Wf,(new Map).set(olympe.dc.CloudObject.nameProp,b));a.Ma(olympe.dc.CloudObject.extendRel,b,olympe.dm.Enum);return b}};olympe.dm.Wf.create=olympe.dm.Wf.create;olympe.dm.Wf.prototype.getValues=olympe.dm.Wf.prototype.Wx;olympe.dm.Wf.P=olympe.dc.na.C('017a768f966fc08ebb98',olympe.dm.Wf);olympe.dm.Number=class extends olympe.dm.ye{getValue(){return this.nd(olympe.dm.Number.valueProp)}Ac(){return this.get(olympe.dm.Number.valueProp)}};olympe.dm.Number.P=olympe.dc.na.C('ff021000000000000013',olympe.dm.Number);olympe.dm.Number.valueProp=olympe.dm.Number.P.la('ff023000000000000028');w('olympe.dm.Number.valueProp',olympe.dm.Number.valueProp);olympe.dm.Number.prototype.getValue.L=olympe.D.K.G;olympe.sc={};olympe.sc.R={Ca:'sc.Logger',dk:'sc.RootContext',Be:'sc.Serializer'};olympe.sc.V={Je:'sc.app',Rf:'sc.debug',zn:'sc.autostartProfiler',ro:'sc.debugger',ht:'sc.disableTheme',PRODUCTION:'sc.production',Mu:'sc.onstartTimeout',vq:'sc.remoteActionTimeout'};
1007
+ olympe.dm.String.prototype.toString.L=olympe.D.K.C;olympe.dm.Boolean=class extends olympe.dm.ye{getValue(){return this.Ug(olympe.dm.Boolean.valueProp)}Ac(){return this.get(olympe.dm.Boolean.valueProp)}};olympe.dm.Boolean.P=olympe.dc.na.C('ff021000000000000012',olympe.dm.Boolean);olympe.dm.Boolean.valueProp=olympe.dm.Boolean.P.la('ff023000000000000027');w('olympe.dm.Boolean.valueProp',olympe.dm.Boolean.valueProp);olympe.dm.Boolean.prototype.getValue.L=olympe.D.K.O;olympe.dm.Color=class extends olympe.dm.ye{getValue(){return this.Vr()}Ac(){return this.get(olympe.dm.Color.valueProp)}};olympe.dm.Color.P=olympe.dc.na.C('ff021000000000000017',olympe.dm.Color);olympe.dm.Color.valueProp=olympe.dm.Color.P.la('ff023000000000000032');w('olympe.dm.Color.valueProp',olympe.dm.Color.valueProp);olympe.dm.Color.prototype.getValue.L=new olympe.D.K(()=>olympe.D.Color,[]);olympe.dm.DateTime=class extends olympe.dm.ye{getValue(){return this.gj(olympe.dm.DateTime.valueProp)}Ac(){return this.get(olympe.dm.DateTime.valueProp)}};olympe.dm.DateTime.P=olympe.dc.na.C('ff021000000000000014',olympe.dm.DateTime);olympe.dm.DateTime.valueProp=olympe.dm.DateTime.P.la('ff023000000000000029');w('olympe.dm.DateTime.valueProp',olympe.dm.DateTime.valueProp);olympe.dm.DateTime.prototype.getValue.L=new olympe.D.K(()=>olympe.D.gb,[]);olympe.dm.Enum=class extends olympe.dm.String{ma(){return olympe.D.va([super.ma(),super.getValue()],(a,b)=>''!==a.valueOf()?a:b,olympe.D.Qa)}xd(){return this.nd(olympe.dm.Enum.rankProp)}};olympe.dm.Enum.P=olympe.dc.na.C('016cdd861b32d56c81f7',olympe.dm.Enum);olympe.dm.Enum.rankProp=olympe.dm.Enum.P.la('017a7690c915975ea995');olympe.dm.Enum.prototype.xd.L=olympe.D.K.G;olympe.dm.Wf=class extends olympe.dm.BrickMetadata{Wx(){return this.ib(olympe.dc.CloudObject.instancesRel).Qk(olympe.dm.Enum.rankProp,olympe.dc.query.Xj.ASC).md()}static create(a,b){b=a.create(olympe.dm.Wf,(new Map).set(olympe.dc.CloudObject.nameProp,b));a.Ma(olympe.dc.CloudObject.extendRel,b,olympe.dm.Enum);return b}};olympe.dm.Wf.create=olympe.dm.Wf.create;olympe.dm.Wf.prototype.getValues=olympe.dm.Wf.prototype.Wx;olympe.dm.Wf.P=olympe.dc.na.C('017a768f966fc08ebb98',olympe.dm.Wf);olympe.dm.Number=class extends olympe.dm.ye{getValue(){return this.nd(olympe.dm.Number.valueProp)}Ac(){return this.get(olympe.dm.Number.valueProp)}};olympe.dm.Number.P=olympe.dc.na.C('ff021000000000000013',olympe.dm.Number);olympe.dm.Number.valueProp=olympe.dm.Number.P.la('ff023000000000000028');w('olympe.dm.Number.valueProp',olympe.dm.Number.valueProp);olympe.dm.Number.prototype.getValue.L=olympe.D.K.G;olympe.sc={};olympe.sc.R={Ca:'sc.Logger',dk:'sc.RootContext',Be:'sc.Serializer'};olympe.sc.V={Je:'sc.app',Rf:'sc.debug',zn:'sc.autostartProfiler',ro:'sc.debugger',ht:'sc.disableTheme',PRODUCTION:'sc.production',Mu:'sc.onstartTimeout',vq:'sc.remoteActionTimeout'};
1006
1008
  olympe.W.config(a=>{F(a,olympe.sc.V.Je,'');F(a,olympe.sc.V.Rf,!1);F(a,olympe.sc.V.ht,!0);F(a,olympe.sc.V.PRODUCTION,!1);F(a,olympe.sc.V.Mu,2E4);F(a,olympe.sc.V.vq,3E4);F(a,olympe.sc.V.zn,!1);E(a,olympe.sc.R.Ca,[olympe.ka.R.Ea],b=>b.Vc('sc'));C(a,olympe.sc.R.Be,olympe.sc.fc,olympe.dc.db.R.Ea);Oa(a,olympe.dc.sources.R.Be,olympe.sc.R.Be);E(a,olympe.sc.R.dk,[new olympe.W.oa(olympe.sc.V.PRODUCTION)],b=>{const c=new olympe.sc.pg('root','root',null);olympe.sc.hn=c;c.set(olympe.sc.xa.C.PRODUCTION,b);return new olympe.sc.xa(c)})},
1007
1009
  'olympe.sc');olympe.W.run([olympe.sc.R.dk,new olympe.W.oa(olympe.N.V.el)],(a,b)=>{olympe.Yd().ctx=a;olympe.Yd().oVersion=()=>b});olympe.sc.an=()=>null!==olympe.dc.ia().Kb(void 0,olympe.sc.Runnable.C.bc());olympe.sc.HD=(a,b,c,d)=>{c=Z(Z(a.create(olympe.sc.Xc),olympe.sc.Xc.C,c||null),olympe.sc.Xc.G,d||null);a.Ma(olympe.sc.Xc.F,c,b);a.Ma(olympe.dc.CloudObject.containsRel,b,c);return c.X()};olympe.sc.Zi=(a,b)=>{a=olympe.dc.nb.Yw(b)(a);return a instanceof olympe.sc.Kd?a.C():a};
1008
- olympe.sc.ZD=function(a){const b=olympe.dc.CloudObject.containsRel.bc();var c=olympe.dc.ga(a);if(void 0===c)return[];a=olympe.dc.ia();const d=[];let e=[];const f=new Set;for(;!a.Rb(c,olympe.dm.Lb);){f.add(c);const g=a.Kb(c,b);if(null===g)return olympe.ka.ib('sc').warn(`Object ${c} has no container`),[];a.Rb(c,olympe.sc.logic.qb)||g===a.Kb(c,olympe.sc.Runnable.C.bc())||d.push(c);c=g;if(f.has(c))throw Error(`Instance ${c} (${a.name(c)}) is part of a cyclic contain pattern`);}e.push(c);e=e.concat(a.Vg(e[0],
1010
+ olympe.sc.ZD=function(a){const b=olympe.dc.CloudObject.containsRel.bc();var c=olympe.dc.ga(a);if(void 0===c)return[];a=olympe.dc.ia();const d=[];let e=[];const f=new Set;for(;!a.Rb(c,olympe.dm.Lb);){f.add(c);const g=a.Kb(c,b);if(null===g)return olympe.ka.ab('sc').warn(`Object ${c} has no container`),[];a.Rb(c,olympe.sc.logic.qb)||g===a.Kb(c,olympe.sc.Runnable.C.bc())||d.push(c);c=g;if(f.has(c))throw Error(`Instance ${c} (${a.name(c)}) is part of a cyclic contain pattern`);}e.push(c);e=e.concat(a.Vg(e[0],
1009
1011
  olympe.dm.Lb.ja));e=e.concat(a.Vg(e[e.length-1],olympe.dm.Ic.T.bc()));e=e.concat(a.Vg(e[e.length-1],olympe.dm.Ic.O.bc()));return[...d,...e].reverse()};olympe.sc.$D=a=>{a=a&&a.valueOf()||'';return a.startsWith('image/')?olympe.sc.ug:a.startsWith('video/')?olympe.sc.Jh:a.startsWith('font/')||a.startsWith('application/font-woff')?olympe.sc.Hc:olympe.dm.File};
1010
- olympe.sc.YD=a=>a instanceof olympe.sc.ug?'image/*':a instanceof olympe.sc.Jh?'video/*':a instanceof olympe.sc.Hc?'font/*,application/font-woff':null;olympe.sc.Ya={};function wm(a,b){var c=olympe.sc.xa,d=a.C;a=a.F();b=olympe.dc.ga(b);let e,f=null==(e=d.F)?void 0:e.get(b);if(!f){f=d.Rh(a,void 0,b);for(d=f.getParent();d&&d.ja&&!d.id.startsWith('_');)d=d.getParent();let g;null==(g=d)||xm(g,b,f)}return new c(f)}function ym(a){let b;return null!=(b=a.Na(olympe.sc.xa.C.PRODUCTION))?b:!1}
1011
- olympe.sc.xa=class{constructor(a=olympe.sc.hn){this.C=a;this.H=olympe.ka.ib('sc');this.G=null}U(){return this.C.U()}getParent(){if(null===this.G){const a=this.C.getParent();this.G=null===a?null:new olympe.sc.xa(a)}return this.G}Zw(a){const b=olympe.dc.ia();let c=this.getParent();if(!c)return this;const d=e=>{e=e.Ye();if('string'!==typeof e)return!1;const f=b.model(e);return f&&b.Sa(f,olympe.sc.Va.aa)||a.modelTag&&!b.Rb(e,a.modelTag)?!1:!0};for(;c&&!d(c);){const e=c.getParent();if(!e)break;c=e}return c}Ye(){return this.C.Ye()}F(){return this.C.C}set(a,
1012
+ olympe.sc.YD=a=>a instanceof olympe.sc.ug?'image/*':a instanceof olympe.sc.Jh?'video/*':a instanceof olympe.sc.Hc?'font/*,application/font-woff':null;olympe.sc.Za={};function vm(a,b){var c=olympe.sc.xa,d=a.C;a=a.F();b=olympe.dc.ga(b);let e,f=null==(e=d.F)?void 0:e.get(b);if(!f){f=d.Rh(a,void 0,b);for(d=f.getParent();d&&d.ja&&!d.id.startsWith('_');)d=d.getParent();let g;null==(g=d)||wm(g,b,f)}return new c(f)}function xm(a){let b;return null!=(b=a.Na(olympe.sc.xa.C.PRODUCTION))?b:!1}
1013
+ olympe.sc.xa=class{constructor(a=olympe.sc.hn){this.C=a;this.H=olympe.ka.ab('sc');this.G=null}U(){return this.C.U()}getParent(){if(null===this.G){const a=this.C.getParent();this.G=null===a?null:new olympe.sc.xa(a)}return this.G}Zw(a){const b=olympe.dc.ia();let c=this.getParent();if(!c)return this;const d=e=>{e=e.Ye();if('string'!==typeof e)return!1;const f=b.model(e);return f&&b.Oa(f,olympe.sc.Va.aa)||a.modelTag&&!b.Rb(e,a.modelTag)?!1:!0};for(;c&&!d(c);){const e=c.getParent();if(!e)break;c=e}return c}Ye(){return this.C.Ye()}F(){return this.C.C}set(a,
1012
1014
  b){this.C.set(a,b);return this}tn(a){return this.set(a,Date.now())}remove(a){this.set(a,null)}sb(a,b,c=!1){const d=olympe.dc.ga(a),e=olympe.D.ec(null!=b?b:Object,`Get context value flow source of ${d}`);e.getContext().onDestroy(this.on(a,f=>{null===f?e.clear():e.update(f)},c?this.C.U():void 0));return e.sb()}get(a,b=!1){a=this.Na(a,b);return void 0!==a?a:null}has(a,b=!1){return this.C.has(a,b)}observe(a,b=!0,c=!1){return new rxjs.Observable(d=>{const e=this.get(a);b||null!==e||d.next(e);const f=this.on(a,
1013
- d.next.bind(d),c?void 0:this.C.U(),!1);this.onDestroy(()=>{f();d.complete()});return f})}repeat(a,b){const c=zm(this.C,a);a=b.subscribe(d=>{null!==d?this.set(c,d):this.remove(c)});this.dh(a.unsubscribe.bind(a));return this}Xy(a){a=a instanceof olympe.sc.Runnable?a:this.get(a);if(!a)return null;const b=this.Rh(`Runner ${a.name()}`);a.run(b);return b}vs(a,b=!0,c=!1){return new Promise((d,e)=>{this.observe(a,b,c).pipe(rxjs.operators.first()).subscribe(rxjs.Subscriber.create(d,f=>{let g=`An error occurred while calling \`waitFor(${olympe.dc.ga(a)})\``+
1014
- `on the context ${this.U()}:\nStack: ${this.ke()}\n${f}`;f instanceof rxjs.EmptyError&&(g=`The context ${this.U()} has been destroyed while a Promise `+`created from a call to \`waitFor(${olympe.dc.ga(a)})\` `+`has never received any value:\nStack: ${this.ke()}`);e(Error(g))}))})}throw(a){var b=a instanceof Error?a.message:String(a);if(a instanceof Error){var c;const d=(null==(c=a.ke)?void 0:c.call(a))||this.ke();let e,f;c=null!=(f=null==(e=a.Ir)?void 0:e.call(a))?f:0;b=Am(b,c,d);b.stack=a.stack}else b=
1015
- Am(b,0,this.ke());Bm(this.C,b);return this}Zy(a){this.set(olympe.sc.xa.C.og,a);return this}Na(a,b=!0){return this.C.Na(a,b)}on(a,b,c,d=!0){return this.C.on(a,b,c,d)}Rh(a){return new olympe.sc.xa(this.C.Rh(this.F(),a))}Nk(a,b){return this.C.Nk(a,c=>{b(new olympe.sc.xa(c))})}Gx(a){a=Cm(this.C,a);return a===this.C?this:a&&new olympe.sc.xa(a)}destroy(){this.C.destroy()}dh(a,b){return this.C.dh(a,b)}Lk(a){this.C.Lk(a)}onDestroy(a){return this.eb()?(a(),'noId'):this.F().onDestroy(a)}Mf(a){this.eb()||this.F().Mf(a)}clear(){this.C.clear()}eb(){return this.F().eb()}Sa(a){a=
1016
- Dm(this.C,a);return null!==a?new olympe.sc.ui.Hz(a,this):null}qx(a){a=Dm(this.C,a);return null!==a?new olympe.sc.ui.Gz(a,this):null}Ey(...a){return rxjs.combineLatest(a.map(b=>{b=Dm(this.C,b);return null!==b?this.observe(b):rxjs.of(null)}))}Fa(a){return(null==a?void 0:a.constructor)!==this.constructor?!1:this.C===a.C}ke(){const a=olympe.dc.ia();let b;try{const c=[this];let d=this.getParent();for(;null!==d&&d.C!==olympe.sc.hn;)c.push(d),d=d.getParent();b='> '+c.map(e=>{const f=e.Ye();return null!==
1017
- f?(e=a.model(f),`${a.name(f)||e&&a.name(e)||f} (${e})`):e.U()}).join('\n> ')}catch(c){b=`No stack available for context ${this.U()}: ${c}`,this.H.warn(b)}return b}};olympe.sc.xa.prototype.observeMany=olympe.sc.xa.prototype.Ey;olympe.sc.xa.prototype.getEvent=olympe.sc.xa.prototype.qx;olympe.sc.xa.prototype.getProperty=olympe.sc.xa.prototype.Sa;olympe.sc.xa.prototype.isDestroyed=olympe.sc.xa.prototype.eb;olympe.sc.xa.prototype.clear=olympe.sc.xa.prototype.clear;olympe.sc.xa.prototype.offDestroy=olympe.sc.xa.prototype.Mf;
1015
+ d.next.bind(d),c?void 0:this.C.U(),!1);this.onDestroy(()=>{f();d.complete()});return f})}repeat(a,b){const c=ym(this.C,a);a=b.subscribe(d=>{null!==d?this.set(c,d):this.remove(c)});this.dh(a.unsubscribe.bind(a));return this}Xy(a){a=a instanceof olympe.sc.Runnable?a:this.get(a);if(!a)return null;const b=this.Rh(`Runner ${a.name()}`);a.run(b);return b}vs(a,b=!0,c=!1){return new Promise((d,e)=>{this.observe(a,b,c).pipe(rxjs.operators.first()).subscribe(rxjs.Subscriber.create(d,f=>{let g=`An error occurred while calling \`waitFor(${olympe.dc.ga(a)})\``+
1016
+ `on the context ${this.U()}:\nStack: ${this.ke()}\n${f}`;f instanceof rxjs.EmptyError&&(g=`The context ${this.U()} has been destroyed while a Promise `+`created from a call to \`waitFor(${olympe.dc.ga(a)})\` `+`has never received any value:\nStack: ${this.ke()}`);e(Error(g))}))})}throw(a){var b=a instanceof Error?a.message:String(a);if(a instanceof Error){var c;const d=(null==(c=a.ke)?void 0:c.call(a))||this.ke();let e,f;c=null!=(f=null==(e=a.Ir)?void 0:e.call(a))?f:0;b=zm(b,c,d);b.stack=a.stack}else b=
1017
+ zm(b,0,this.ke());Am(this.C,b);return this}Zy(a){this.set(olympe.sc.xa.C.og,a);return this}Na(a,b=!0){return this.C.Na(a,b)}on(a,b,c,d=!0){return this.C.on(a,b,c,d)}Rh(a){return new olympe.sc.xa(this.C.Rh(this.F(),a))}Nk(a,b){return this.C.Nk(a,c=>{b(new olympe.sc.xa(c))})}Gx(a){a=Bm(this.C,a);return a===this.C?this:a&&new olympe.sc.xa(a)}destroy(){this.C.destroy()}dh(a,b){return this.C.dh(a,b)}Lk(a){this.C.Lk(a)}onDestroy(a){return this.fb()?(a(),'noId'):this.F().onDestroy(a)}Mf(a){this.fb()||this.F().Mf(a)}clear(){this.C.clear()}fb(){return this.F().fb()}Oa(a){a=
1018
+ Cm(this.C,a);return null!==a?new olympe.sc.ui.Hz(a,this):null}qx(a){a=Cm(this.C,a);return null!==a?new olympe.sc.ui.Gz(a,this):null}Ey(...a){return rxjs.combineLatest(a.map(b=>{b=Cm(this.C,b);return null!==b?this.observe(b):rxjs.of(null)}))}Fa(a){return(null==a?void 0:a.constructor)!==this.constructor?!1:this.C===a.C}ke(){const a=olympe.dc.ia();let b;try{const c=[this];let d=this.getParent();for(;null!==d&&d.C!==olympe.sc.hn;)c.push(d),d=d.getParent();b='> '+c.map(e=>{const f=e.Ye();return null!==
1019
+ f?(e=a.model(f),`${a.name(f)||e&&a.name(e)||f} (${e})`):e.U()}).join('\n> ')}catch(c){b=`No stack available for context ${this.U()}: ${c}`,this.H.warn(b)}return b}};olympe.sc.xa.prototype.observeMany=olympe.sc.xa.prototype.Ey;olympe.sc.xa.prototype.getEvent=olympe.sc.xa.prototype.qx;olympe.sc.xa.prototype.getProperty=olympe.sc.xa.prototype.Oa;olympe.sc.xa.prototype.isDestroyed=olympe.sc.xa.prototype.fb;olympe.sc.xa.prototype.clear=olympe.sc.xa.prototype.clear;olympe.sc.xa.prototype.offDestroy=olympe.sc.xa.prototype.Mf;
1018
1020
  olympe.sc.xa.prototype.onDestroy=olympe.sc.xa.prototype.onDestroy;olympe.sc.xa.prototype.offClear=olympe.sc.xa.prototype.Lk;olympe.sc.xa.prototype.onClear=olympe.sc.xa.prototype.dh;olympe.sc.xa.prototype.destroy=olympe.sc.xa.prototype.destroy;olympe.sc.xa.prototype.getOtherContext=olympe.sc.xa.prototype.Gx;olympe.sc.xa.prototype.onContext=olympe.sc.xa.prototype.Nk;olympe.sc.xa.prototype.createChild=olympe.sc.xa.prototype.Rh;olympe.sc.xa.prototype.setParentElement=olympe.sc.xa.prototype.Zy;
1019
1021
  olympe.sc.xa.prototype['throw']=olympe.sc.xa.prototype.throw;olympe.sc.xa.prototype.waitFor=olympe.sc.xa.prototype.vs;olympe.sc.xa.prototype.runner=olympe.sc.xa.prototype.Xy;olympe.sc.xa.prototype.repeat=olympe.sc.xa.prototype.repeat;olympe.sc.xa.prototype.observe=olympe.sc.xa.prototype.observe;olympe.sc.xa.prototype.has=olympe.sc.xa.prototype.has;olympe.sc.xa.prototype.get=olympe.sc.xa.prototype.get;olympe.sc.xa.prototype.remove=olympe.sc.xa.prototype.remove;olympe.sc.xa.prototype.trigger=olympe.sc.xa.prototype.tn;
1020
- olympe.sc.xa.prototype.set=olympe.sc.xa.prototype.set;olympe.sc.xa.prototype.getClosest=olympe.sc.xa.prototype.Zw;olympe.sc.xa.prototype.getParent=olympe.sc.xa.prototype.getParent;olympe.sc.xa.C={PRODUCTION:'__production',EDITION:'__editionMode',TRANSACTION:'__transaction',og:'__htmlContainer',Vz:'__dockableElement',xn:'__appHasStarted'};olympe.sc.hr=class extends olympe.sc.xa{constructor(a){super(a);this.J=new olympe.D.Xb('SC Update Context',super.F());const b=a.dh(()=>{b&&a.Lk(b);this.J.destroy()})}F(){return this.J}dh(a,b){return this.F().onDestroy(a,null!=b?b:olympe.Y.Mc())}};let Em=0;function zm(a,b){b=olympe.dc.ga(b);let c,d,e,f;return null!=(f=null!=(e=null==(c=a.aa)?void 0:c.get('I#'+b))?e:null==(d=a.aa)?void 0:d.get('IO#'+b))?f:b}function Bm(a,b){if(null===a.J)a.H.error(`An error occurred in a brick: ${b.toString()}`);else if(a.ea){var c=Fm(olympe.dc.CloudObject.get(a.ea));null!==c&&Gm(a,c).some(d=>{let e,f;return 0<(null==(e=a.G)?void 0:null==(f=e.get(d))?void 0:f.size)})&&!a.O.has('$'+c)?a.set(c,b):Bm(a.J,b)}else Bm(a.J,b)}
1021
- function Cm(a,b){if(b===a.id||a.T.has(b)||!b)return a;for(a=a.J;a;){if(b===a.U()||a.T.has(b))return a;const c=Hm(a.F,b);if(c)return c;a=a.getParent()}return null}function Im(a,b,c=0){null===a.Ya&&(a.Ya=new Map);a.Ya.has(b.U())||(a.Ya.set(b.U(),{Ok:b,depth:c}),Jm(a,d=>{(-1===b.G||c<b.G)&&Im(d,b,c+1)}),a.onDestroy(()=>{Km(a,b.U())}));return b.U()}
1022
- function Km(a,b){if(null===a.Ya||!a.Ya.has(b))return!1;const {Ok:c,depth:d}=a.Ya.get(b);Jm(a,f=>{Km(f,b)});0===d&&c.F();const e=a.Ya.delete(b);0===a.Ya.size&&(a.Ya=null);return e}function Dm(a,b){let c;return(null==(c=a.aa)?void 0:c.get('IO#'+b))||null}
1023
- function Lm(a){a.C.Z(()=>{Jm(a,c=>c.destroy())});a.C.onDestroy(()=>{void 0!==a.Na(olympe.sc.xa.C.TRANSACTION,!1)&&a.H.warn(`The context ${a.U()} is being destroyed but still has unreleased transactions. You probably forgot to end a transaction.`);a.clear();let c;if(null!=(c=a.J)){let d;null==(d=c.F)||d.delete(a.U());let e;0===(null==(e=c.F)?void 0:e.size)&&(c.F=null)}a.T.clear()});let b;null==(b=a.J)||Mm(b,a)}
1024
- function Hm(a,b){if(null===a)return null;if(a.has(b))return a.get(b);for(const c of a.values())if(c.ja&&!c.id.startsWith('_')&&(a=Hm(c.F,b)))return a;return null}function Nm(a,b,...c){if(null!==a.Ya)for(const {Ok:d,depth:e}of a.Ya.values())d.process(a,b,e,...c)}function Om(a,b){a.ea=olympe.dc.ga(b);a.ja=b.vd().an();b.G().forEach(c=>{a.id===c||a.T.has(c)||(a.T.add(c),xm(a,c,a))});a.aa=b.T();Nm(a,olympe.sc.Ya.oc.C.INIT)}function Pm(a){a.ua=!0;let b;null==(b=a.F)||b.forEach(c=>{Pm(c)})}
1025
- function Qm(a){a.ua=!1;let b;null==(b=a.F)||b.forEach(c=>{Qm(c)})}function Gm(a,b){return['*',a.id,...a.T].map(c=>`${'@'}${c}.${b}`)}function Rm(a,b,c,d){c.forEach(f=>{let g,h;null==(g=a.G)||null==(h=g.get(f))||h.forEach(k=>{k(d)})});let e;null==(e=a.F)||e.forEach(f=>{!f.ua&&f.data.has(b)||Rm(f,b,c,d)})}function Sm(a,b,c){a.G||(a.G=new Map);let d=a.G.get(b);void 0===d&&(d=new Map,a.G.set(b,d));Em++;const e=Em;d.set(e,c);return()=>{const f=a.G.get(b);f&&(f.delete(e),0===f.size&&a.G.delete(b))}}
1026
- function xm(a,b,c){a.O.add(b);let d,e;null==(d=a.G)||null==(e=d.get('&'+b))||e.forEach(f=>{f(c)});Jm(a,f=>{f.O.has(b)||xm(f,b,c)});a.O.delete(b)}function Jm(a,b){let c;null==(c=a.F)||c.forEach(b)}function Tm(a,b){a.data.forEach((c,d)=>b(c,d.slice(1)))}function Um(a){var b=olympe.sc.Ya.oc.F.sf;const c=[];if(null!==a.Ya)for(const {Ok:d}of a.Ya.values())d.getType()===b&&(c.push(d.U()),d.F(),Km(a,d.U()))}function Mm(a,b){null===a.F&&(a.F=new Map);a.F.set(b.id,b)}
1027
- olympe.sc.pg=class{constructor(a,b='no name',c=olympe.sc.hn){this.id=a;this.ld=b;this.T=new Set;this.J=c;this.C=new olympe.D.Xb('SC Context');this.data=new Map;this.ea=this.Z=this.F=this.G=null;this.ja=!1;this.O=new Set;this.ua=!1;this.aa=null;this.H=olympe.ka.ib('sc');this.Ya=null;Lm(this)}U(){return this.id}getParent(){return this.J}Ye(){return this.ea}set(a,b){if(!this.C.od()&&!this.C.eb()){const g=olympe.dc.ga(a);var c,d;let h,k;a=null!=(k=null!=(h=null==(c=this.aa)?void 0:c.get('O#'+g))?h:null==
1028
- (d=this.aa)?void 0:d.get('IO#'+g))?k:g;c='$'+a;var e;d=null!=(e=this.data.get(c))?e:null;b=null!=b?b:null;if(e=!this.O.has(c)){a:{if('function'===typeof(null==b?void 0:b.Fa))try{var f=b.Fa(d);break a}catch(l){f=!1;break a}f=b===d}e=!f}e&&(null===b?this.data.delete(c):this.data.set(c,b),null!==this.Ya&&0<this.Ya.size&&Nm(this,olympe.sc.Ya.oc.C.Ig,a,b),f=Gm(this,a),this.O.add(c),Rm(this,c,f,b),this.O.delete(c))}}on(a,b,c,d=!0){if(this.C.eb()||this.C.od())return()=>{};const e=zm(this,a),f=c?olympe.dc.ga(c):
1029
- '*';a=Sm(this,'@'+f+'.'+e,b);c=c?(c=Cm(this,f))?c.Na(e,!1):void 0:this.Na(e);void 0!==c&&b(c);if(d)olympe.D.$a().onDestroy(a);return a}has(a,b=!1){a='$'+zm(this,a);let c=this.data.has(a),d=this.getParent();if(b)for(;!c&&d;)c=d.data.has(a),d=d.getParent();return c}Rh(a,b,c){const d=null!=c?c:'_'+olympe.Y.Mc();if(a.eb()||a.od())throw Error(`Try to create new child context in a destroyed context ${a.U()}, probably because \`runner()\` is called on a destroyed context`);const e=a.run(()=>new olympe.sc.pg(d,
1030
- b,this));null!==this.Ya&&0<this.Ya.size&&this.Ya.forEach(({Ok:f,depth:g})=>{(-1===f.G||g<f.G)&&Im(e,f,g+1)});return e}Nk(a,b){const c=Cm(this,a);if(c)return b(c),()=>{};const d=Sm(this,'&'+a,e=>{let f;null==(f=d)||f();b(e)});return d}Na(a,b=!0){a='$'+zm(this,a);let c=this.data.get(a),d=this.getParent();if(b)for(;void 0===c&&null!==d;)c=d.data.get(a),d=d.getParent();return c}destroy(){this.C.od()||this.C.eb()||(Nm(this,olympe.sc.Ya.oc.C.Fj),this.C.destroy(),Nm(this,olympe.sc.Ya.oc.C.Qd))}dh(a,b){if(this.C.eb())a();
1031
- else return Em++,b=null!=b?b:String(Em),null===this.Z&&(this.Z=new Map),this.Z.set(b,a),b;return b||'noId'}Lk(a){null!==this.Z&&this.Z.delete(a)}onDestroy(a){return this.eb()?(a(),'noId'):this.C.onDestroy(a)}clear(){if(!this.C.eb()){Nm(this,olympe.sc.Ya.oc.C.zj);let a;null==(a=this.Z)||a.forEach(b=>b());Nm(this,olympe.sc.Ya.oc.C.Aj)}}eb(){return this.C.eb()}};olympe.sc.pg.prototype.getParent=olympe.sc.pg.prototype.getParent;olympe.sc.pg.C={El:'I#',Vl:'O#',OA:'IO#'};function Vm(a,b,c){return(c=c.Ye())?`${a}.${c}.${b}`:`${a}.${b}`}olympe.sc.Ya.oc=class{constructor(a=-1){this.id=olympe.Y.Cf();this.active=!0;this.G=a}F(){this.active=!1}U(){return this.id}getType(){}process(){}};olympe.sc.Ya.oc.C={INIT:'INIT',Ig:'SET',zj:'CLEAR',Aj:'CLEARED',Fj:'DESTROY',Qd:'DESTROYED'};olympe.sc.Ya.oc.F={sf:'REMOTE',ru:'LOCAL',Xf:'PROFILER'};olympe.sc.Sd=class a{constructor(){this.F=this.J=this.O=null;this.T=new Map;this.G=new Map;this.C=new olympe.Y.um(1E4);Ya(this.C,b=>{Um(b)})}aa(b,c,d){const e=b.body(),f=e.c,g=this.T.get(f);switch(e.t){case olympe.sc.Sd.C.Ru:c=this.G.get(e.f);b.qd(c).catch(l=>{d.error('Unable to reply with paths: ',l)});break;case olympe.sc.Sd.C.Su:const h=f+c,k=(l,n,p=0)=>{Tm(l,(q,r)=>{let t;q instanceof olympe.dc.CloudObject?t=a.G(q):t=q;let u;q=null!=(u=l.Ye())?u:'';0<q.length&&(q+='.');n.push([`${p}.${q}${r}`,
1032
- t])})};b.en(h).then(()=>{const l=[];k(g,l,0);Jm(g,p=>{k(p,l,1)});olympe.N.wb.publish(h,{t:olympe.sc.Sd.C.Jt,v:l,ts:0}).catch(p=>{d.error('Error publishing on service : ',p)});const n=new olympe.sc.Ya.lv(h);Im(g,n);this.C.has(g)?Xa(this.C,g):this.C.add(g)}).catch(l=>{d.error('Error notifying on a contextId : ',l)});break;case olympe.sc.Sd.C.Tu:void 0!==g&&this.C.has(g)&&Xa(this.C,g);break;case olympe.sc.Sd.C.Vf:void 0!==g&&(this.C.delete(g),Um(g))}}ea(b,c,d){this.O=new olympe.N.wb('discovery_debug_id',
1022
+ olympe.sc.xa.prototype.set=olympe.sc.xa.prototype.set;olympe.sc.xa.prototype.getClosest=olympe.sc.xa.prototype.Zw;olympe.sc.xa.prototype.getParent=olympe.sc.xa.prototype.getParent;olympe.sc.xa.C={PRODUCTION:'__production',EDITION:'__editionMode',TRANSACTION:'__transaction',og:'__htmlContainer',Vz:'__dockableElement',xn:'__appHasStarted'};olympe.sc.hr=class extends olympe.sc.xa{constructor(a){super(a);this.J=new olympe.D.Xb('SC Update Context',super.F());const b=a.dh(()=>{b&&a.Lk(b);this.J.destroy()})}F(){return this.J}dh(a,b){return this.F().onDestroy(a,null!=b?b:olympe.Y.Mc())}};let Dm=0;function ym(a,b){b=olympe.dc.ga(b);let c,d,e,f;return null!=(f=null!=(e=null==(c=a.aa)?void 0:c.get('I#'+b))?e:null==(d=a.aa)?void 0:d.get('IO#'+b))?f:b}function Am(a,b){if(null===a.J)a.H.error(`An error occurred in a brick: ${b.toString()}`);else if(a.ea){var c=Em(olympe.dc.CloudObject.get(a.ea));null!==c&&Fm(a,c).some(d=>{let e,f;return 0<(null==(e=a.G)?void 0:null==(f=e.get(d))?void 0:f.size)})&&!a.O.has('$'+c)?a.set(c,b):Am(a.J,b)}else Am(a.J,b)}
1023
+ function Bm(a,b){if(b===a.id||a.T.has(b)||!b)return a;for(a=a.J;a;){if(b===a.U()||a.T.has(b))return a;const c=Gm(a.F,b);if(c)return c;a=a.getParent()}return null}function Hm(a,b,c=0){null===a.Za&&(a.Za=new Map);a.Za.has(b.U())||(a.Za.set(b.U(),{Ok:b,depth:c}),Im(a,d=>{(-1===b.G||c<b.G)&&Hm(d,b,c+1)}),a.onDestroy(()=>{Jm(a,b.U())}));return b.U()}
1024
+ function Jm(a,b){if(null===a.Za||!a.Za.has(b))return!1;const {Ok:c,depth:d}=a.Za.get(b);Im(a,f=>{Jm(f,b)});0===d&&c.F();const e=a.Za.delete(b);0===a.Za.size&&(a.Za=null);return e}function Cm(a,b){let c;return(null==(c=a.aa)?void 0:c.get('IO#'+b))||null}
1025
+ function Km(a){a.C.Z(()=>{Im(a,c=>c.destroy())});a.C.onDestroy(()=>{void 0!==a.Na(olympe.sc.xa.C.TRANSACTION,!1)&&a.H.warn(`The context ${a.U()} is being destroyed but still has unreleased transactions. You probably forgot to end a transaction.`);a.clear();let c;if(null!=(c=a.J)){let d;null==(d=c.F)||d.delete(a.U());let e;0===(null==(e=c.F)?void 0:e.size)&&(c.F=null)}a.T.clear()});let b;null==(b=a.J)||Lm(b,a)}
1026
+ function Gm(a,b){if(null===a)return null;if(a.has(b))return a.get(b);for(const c of a.values())if(c.ja&&!c.id.startsWith('_')&&(a=Gm(c.F,b)))return a;return null}function Mm(a,b,...c){if(null!==a.Za)for(const {Ok:d,depth:e}of a.Za.values())d.process(a,b,e,...c)}function Nm(a,b){a.ea=olympe.dc.ga(b);a.ja=b.vd().an();b.G().forEach(c=>{a.id===c||a.T.has(c)||(a.T.add(c),wm(a,c,a))});a.aa=b.T();Mm(a,olympe.sc.Za.oc.C.INIT)}function Om(a){a.ua=!0;let b;null==(b=a.F)||b.forEach(c=>{Om(c)})}
1027
+ function Pm(a){a.ua=!1;let b;null==(b=a.F)||b.forEach(c=>{Pm(c)})}function Fm(a,b){return['*',a.id,...a.T].map(c=>`${'@'}${c}.${b}`)}function Qm(a,b,c,d){c.forEach(f=>{let g,h;null==(g=a.G)||null==(h=g.get(f))||h.forEach(k=>{k(d)})});let e;null==(e=a.F)||e.forEach(f=>{!f.ua&&f.data.has(b)||Qm(f,b,c,d)})}function Rm(a,b,c){a.G||(a.G=new Map);let d=a.G.get(b);void 0===d&&(d=new Map,a.G.set(b,d));Dm++;const e=Dm;d.set(e,c);return()=>{const f=a.G.get(b);f&&(f.delete(e),0===f.size&&a.G.delete(b))}}
1028
+ function wm(a,b,c){a.O.add(b);let d,e;null==(d=a.G)||null==(e=d.get('&'+b))||e.forEach(f=>{f(c)});Im(a,f=>{f.O.has(b)||wm(f,b,c)});a.O.delete(b)}function Im(a,b){let c;null==(c=a.F)||c.forEach(b)}function Sm(a,b){a.data.forEach((c,d)=>b(c,d.slice(1)))}function Tm(a){var b=olympe.sc.Za.oc.F.sf;const c=[];if(null!==a.Za)for(const {Ok:d}of a.Za.values())d.getType()===b&&(c.push(d.U()),d.F(),Jm(a,d.U()))}function Lm(a,b){null===a.F&&(a.F=new Map);a.F.set(b.id,b)}
1029
+ olympe.sc.pg=class{constructor(a,b='no name',c=olympe.sc.hn){this.id=a;this.ld=b;this.T=new Set;this.J=c;this.C=new olympe.D.Xb('SC Context');this.data=new Map;this.ea=this.Z=this.F=this.G=null;this.ja=!1;this.O=new Set;this.ua=!1;this.aa=null;this.H=olympe.ka.ab('sc');this.Za=null;Km(this)}U(){return this.id}getParent(){return this.J}Ye(){return this.ea}set(a,b){if(!this.C.od()&&!this.C.fb()){const g=olympe.dc.ga(a);var c,d;let h,k;a=null!=(k=null!=(h=null==(c=this.aa)?void 0:c.get('O#'+g))?h:null==
1030
+ (d=this.aa)?void 0:d.get('IO#'+g))?k:g;c='$'+a;var e;d=null!=(e=this.data.get(c))?e:null;b=null!=b?b:null;if(e=!this.O.has(c)){a:{if('function'===typeof(null==b?void 0:b.Fa))try{var f=b.Fa(d);break a}catch(l){f=!1;break a}f=b===d}e=!f}e&&(null===b?this.data.delete(c):this.data.set(c,b),null!==this.Za&&0<this.Za.size&&Mm(this,olympe.sc.Za.oc.C.Ig,a,b),f=Fm(this,a),this.O.add(c),Qm(this,c,f,b),this.O.delete(c))}}on(a,b,c,d=!0){if(this.C.fb()||this.C.od())return()=>{};const e=ym(this,a),f=c?olympe.dc.ga(c):
1031
+ '*';a=Rm(this,'@'+f+'.'+e,b);c=c?(c=Bm(this,f))?c.Na(e,!1):void 0:this.Na(e);void 0!==c&&b(c);if(d)olympe.D.Wa().onDestroy(a);return a}has(a,b=!1){a='$'+ym(this,a);let c=this.data.has(a),d=this.getParent();if(b)for(;!c&&d;)c=d.data.has(a),d=d.getParent();return c}Rh(a,b,c){const d=null!=c?c:'_'+olympe.Y.Mc();if(a.fb()||a.od())throw Error(`Try to create new child context in a destroyed context ${a.U()}, probably because \`runner()\` is called on a destroyed context`);const e=a.run(()=>new olympe.sc.pg(d,
1032
+ b,this));null!==this.Za&&0<this.Za.size&&this.Za.forEach(({Ok:f,depth:g})=>{(-1===f.G||g<f.G)&&Hm(e,f,g+1)});return e}Nk(a,b){const c=Bm(this,a);if(c)return b(c),()=>{};const d=Rm(this,'&'+a,e=>{let f;null==(f=d)||f();b(e)});return d}Na(a,b=!0){a='$'+ym(this,a);let c=this.data.get(a),d=this.getParent();if(b)for(;void 0===c&&null!==d;)c=d.data.get(a),d=d.getParent();return c}destroy(){this.C.od()||this.C.fb()||(Mm(this,olympe.sc.Za.oc.C.Fj),this.C.destroy(),Mm(this,olympe.sc.Za.oc.C.Qd))}dh(a,b){if(this.C.fb())a();
1033
+ else return Dm++,b=null!=b?b:String(Dm),null===this.Z&&(this.Z=new Map),this.Z.set(b,a),b;return b||'noId'}Lk(a){null!==this.Z&&this.Z.delete(a)}onDestroy(a){return this.fb()?(a(),'noId'):this.C.onDestroy(a)}clear(){if(!this.C.fb()){Mm(this,olympe.sc.Za.oc.C.zj);let a;null==(a=this.Z)||a.forEach(b=>b());Mm(this,olympe.sc.Za.oc.C.Aj)}}fb(){return this.C.fb()}};olympe.sc.pg.prototype.getParent=olympe.sc.pg.prototype.getParent;olympe.sc.pg.C={El:'I#',Vl:'O#',OA:'IO#'};function Um(a,b,c){return(c=c.Ye())?`${a}.${c}.${b}`:`${a}.${b}`}olympe.sc.Za.oc=class{constructor(a=-1){this.id=olympe.Y.Cf();this.active=!0;this.G=a}F(){this.active=!1}U(){return this.id}getType(){}process(){}};olympe.sc.Za.oc.C={INIT:'INIT',Ig:'SET',zj:'CLEAR',Aj:'CLEARED',Fj:'DESTROY',Qd:'DESTROYED'};olympe.sc.Za.oc.F={sf:'REMOTE',ru:'LOCAL',Xf:'PROFILER'};olympe.sc.Sd=class a{constructor(){this.F=this.J=this.O=null;this.T=new Map;this.G=new Map;this.C=new olympe.Y.um(1E4);Ya(this.C,b=>{Tm(b)})}aa(b,c,d){const e=b.body(),f=e.c,g=this.T.get(f);switch(e.t){case olympe.sc.Sd.C.Ru:c=this.G.get(e.f);b.qd(c).catch(l=>{d.error('Unable to reply with paths: ',l)});break;case olympe.sc.Sd.C.Su:const h=f+c,k=(l,n,p=0)=>{Sm(l,(q,r)=>{let t;q instanceof olympe.dc.CloudObject?t=a.G(q):t=q;let u;q=null!=(u=l.Ye())?u:'';0<q.length&&(q+='.');n.push([`${p}.${q}${r}`,
1034
+ t])})};b.en(h).then(()=>{const l=[];k(g,l,0);Im(g,p=>{k(p,l,1)});olympe.N.wb.publish(h,{t:olympe.sc.Sd.C.Jt,v:l,ts:0}).catch(p=>{d.error('Error publishing on service : ',p)});const n=new olympe.sc.Za.lv(h);Hm(g,n);this.C.has(g)?Xa(this.C,g):this.C.add(g)}).catch(l=>{d.error('Error notifying on a contextId : ',l)});break;case olympe.sc.Sd.C.Tu:void 0!==g&&this.C.has(g)&&Xa(this.C,g);break;case olympe.sc.Sd.C.Vf:void 0!==g&&(this.C.delete(g),Tm(g))}}ea(b,c,d){this.O=new olympe.N.wb('discovery_debug_id',
1033
1035
  c);this.O.listen().subscribe(e=>{var f=e.body();if(f.t===olympe.sc.Sd.C.it){e=f.i;f=f.f;if(!this.G.has(f)){const g=this.Z(f,c,b);if(0!==g.length)this.G.set(f,g);else return}null===this.F&&(this.F=olympe.Y.Cf(),f=new olympe.D.Xb(this.F,c.F()),this.J=new olympe.N.wb(this.F,f),this.J.listen().subscribe(g=>{this.aa(g,b,d)}));olympe.N.wb.publish(e,{t:olympe.sc.Sd.C.xs,n:olympe.W.getParameter(olympe.sc.V.ro)||'no name',a:b,s:this.F}).catch(g=>{d.error('Error publishing on draw service : '+g)})}})}Z(b,c,
1034
- d){const e=[],f=olympe.dc.ia(),g=(h,k)=>{Jm(h,l=>{if(null!==l.Ye()){const n=olympe.dc.CloudObject.get(l.Ye()).xk(olympe.sc.Runnable.J).md();if(null!==n){const p=k+'/'+f.name(n);n.X()===b&&(e.push([p,l.U()]),this.T.set(l.U(),l));g(l,p)}}})};g(c.C,f.name(d));return e}static F(b,c,d){let e=d;d instanceof olympe.dc.CloudObject&&(e=a.G(d));olympe.N.wb.publish(b,{t:olympe.sc.Sd.C.pk,k:c,v:e,ts:Date.now()}).catch(f=>{olympe.ka.ib('Debugger').error('Error publishing on service : ',f)})}static G(b){if(null===
1035
- b||void 0===b)return'<null>';const c=olympe.dc.ia();if(b instanceof olympe.dc.CloudObject){var d=b.cc();if(!c.Rb(d,olympe.sc.yc))return b.toString();let f=`${b.Vb().name()} (${b.X()})`;var e=olympe.dc.CloudObject.get(d);d=olympe.dc.pa.from(e).eg(olympe.dc.CloudObject.extendRel,!0).ge().hb(olympe.dc.CloudObject.propertyRel).ge().md();e=olympe.dc.pa.from(e).eg(olympe.dc.CloudObject.extendRel,!0).ge().hb(olympe.dc.CloudObject.mj).ge().md();d=d.filter(([g])=>g instanceof olympe.sc.yc);0!==d.length&&(f+=
1036
- '<br> ',f+='Properties:<br>',d.forEach(([,g])=>{f+=' ';f+=' - '+c.name(g)+' : '+c.Sa(b.X(),g)+'<br>'}));d=e.filter(([g])=>g instanceof olympe.sc.yc);0!==d.length&&(f+=' ',f+='Relations:<br>',d.forEach(([,g])=>{f+=' ';f+=' - '+c.name(g)+'<br>'}));return f}return b.toString()}};olympe.sc.Sd.J='discovery_debug_id';olympe.sc.Sd.C={it:0,xs:1,Ru:2,Su:3,Jt:4,pk:5,Tu:6,Vf:7};olympe.sc.Ya.XA=class extends olympe.sc.Ya.oc{constructor(a=-1){super(a);this.C=new Map}getType(){return olympe.sc.Ya.oc.F.ru}process(a,b,c,...d){if(this.active&&b===olympe.sc.Ya.oc.C.Ig){a=Vm(c,zm(a,d[0]),a);d=d[1];let e;null==(e=this.C.get(a))||e(d)}}on(a,b){this.C.set(a,b)}};function Wm(a,b,c,d=new Map){for(var e=[];b;){const n=b.Ye();if(!n)break;e.push(n);b=b.getParent()}db(a.C,c,d.set('context',e));var f;let g;for(const n of[...e,null==(f=d)?void 0:f.get('propId'),null==(g=d)?void 0:g.get('type')])if(c=n,'string'===typeof c&&!a.J.has(c)){e=a;f=c;e.ia||(e.ia=olympe.dc.ia());d=e.ia.name(f);e=(f=e.ia.model(f))?e.ia.name(f):'';var [h,k,l]=[d,f,e];d=a.C;e=(new Map).set(c,h).set(k,l);c=(new Map).set(c,k);for(const [p,q]of e.entries())d.O.set(p,q);for(const [p,q]of c.entries())d.J.set(p,
1036
+ d){const e=[],f=olympe.dc.ia(),g=(h,k)=>{Im(h,l=>{if(null!==l.Ye()){const n=olympe.dc.CloudObject.get(l.Ye()).xk(olympe.sc.Runnable.J).md();if(null!==n){const p=k+'/'+f.name(n);n.X()===b&&(e.push([p,l.U()]),this.T.set(l.U(),l));g(l,p)}}})};g(c.C,f.name(d));return e}static F(b,c,d){let e=d;d instanceof olympe.dc.CloudObject&&(e=a.G(d));olympe.N.wb.publish(b,{t:olympe.sc.Sd.C.pk,k:c,v:e,ts:Date.now()}).catch(f=>{olympe.ka.ab('Debugger').error('Error publishing on service : ',f)})}static G(b){if(null===
1037
+ b||void 0===b)return'<null>';const c=olympe.dc.ia();if(b instanceof olympe.dc.CloudObject){var d=b.cc();if(!c.Rb(d,olympe.sc.yc))return b.toString();let f=`${b.Vb().name()} (${b.X()})`;var e=olympe.dc.CloudObject.get(d);d=olympe.dc.pa.from(e).eg(olympe.dc.CloudObject.extendRel,!0).ge().ib(olympe.dc.CloudObject.propertyRel).ge().md();e=olympe.dc.pa.from(e).eg(olympe.dc.CloudObject.extendRel,!0).ge().ib(olympe.dc.CloudObject.mj).ge().md();d=d.filter(([g])=>g instanceof olympe.sc.yc);0!==d.length&&(f+=
1038
+ '<br> ',f+='Properties:<br>',d.forEach(([,g])=>{f+=' ';f+=' - '+c.name(g)+' : '+c.Oa(b.X(),g)+'<br>'}));d=e.filter(([g])=>g instanceof olympe.sc.yc);0!==d.length&&(f+=' ',f+='Relations:<br>',d.forEach(([,g])=>{f+=' ';f+=' - '+c.name(g)+'<br>'}));return f}return b.toString()}};olympe.sc.Sd.J='discovery_debug_id';olympe.sc.Sd.C={it:0,xs:1,Ru:2,Su:3,Jt:4,pk:5,Tu:6,Vf:7};olympe.sc.Za.XA=class extends olympe.sc.Za.oc{constructor(a=-1){super(a);this.C=new Map}getType(){return olympe.sc.Za.oc.F.ru}process(a,b,c,...d){if(this.active&&b===olympe.sc.Za.oc.C.Ig){a=Um(c,ym(a,d[0]),a);d=d[1];let e;null==(e=this.C.get(a))||e(d)}}on(a,b){this.C.set(a,b)}};function Vm(a,b,c,d=new Map){for(var e=[];b;){const n=b.Ye();if(!n)break;e.push(n);b=b.getParent()}db(a.C,c,d.set('context',e));var f;let g;for(const n of[...e,null==(f=d)?void 0:f.get('propId'),null==(g=d)?void 0:g.get('type')])if(c=n,'string'===typeof c&&!a.J.has(c)){e=a;f=c;e.ia||(e.ia=olympe.dc.ia());d=e.ia.name(f);e=(f=e.ia.model(f))?e.ia.name(f):'';var [h,k,l]=[d,f,e];d=a.C;e=(new Map).set(c,h).set(k,l);c=(new Map).set(c,k);for(const [p,q]of e.entries())d.O.set(p,q);for(const [p,q]of c.entries())d.J.set(p,
1037
1039
  q)}}
1038
- olympe.sc.Ya.av=class extends olympe.sc.Ya.oc{constructor(a){super();this.C=a;this.ia=olympe.dc.ia();this.J=new Set}getType(){return olympe.sc.Ya.oc.F.Xf}process(a,b,c,...d){var e=Xm.El,f=Xm.Vl,g=Xm.Vu;const h=Xm.INIT,k=Xm.zj,l=Xm.Aj,n=Xm.Fj,p=Xm.Qd;c=Xm.Ou;if(b===olympe.sc.Ya.oc.C.Ig){const [q,r]=d;b=(d=a.Ye())?olympe.dc.ia().Rb(d,olympe.sc.logic.Function):!1;d=d?olympe.dc.ia().Rb(d,olympe.sc.ui.LB):!1;b?(g=this.ia.Kb(q,olympe.dm.Property.typeRel),b=this.ia.Rb(q,olympe.sc.logic.ub),d=this.ia.Rb(q,olympe.sc.logic.Bb),
1039
- Wm(this,a,b?e:d?f:c,new Map([['propId',q],['value',r],['type',g]]))):d&&(e=this.ia.Rb(q,olympe.dm.Property),f=this.ia.Kb(q,olympe.dm.Property.typeRel),Wm(this,a,e?g:c,new Map([['propId',q],['value',r],['type',f]])))}else b===olympe.sc.Ya.oc.C.INIT?Wm(this,a,h):b===olympe.sc.Ya.oc.C.zj?Wm(this,a,k):b===olympe.sc.Ya.oc.C.Aj?Wm(this,a,l):b===olympe.sc.Ya.oc.C.Fj?Wm(this,a,n):b===olympe.sc.Ya.oc.C.Qd&&Wm(this,a,p)}};
1040
- const Xm={El:'input',Vl:'output',Vu:'prop',INIT:'init',zj:'clear',Aj:'cleared',Fj:'destroy',Qd:'destroyed',Ou:'other'};olympe.sc.Ya.lv=class extends olympe.sc.Ya.oc{constructor(a){super(1);this.J=a;this.C=new Map;this.db=olympe.dc.ia()}getType(){return olympe.sc.Ya.oc.F.sf}F(){super.F();for(const a of this.C.values())a();this.C.clear()}process(a,b,c,...d){if(this.active&&b===olympe.sc.Ya.oc.C.Ig&&void 0!==d[0]&&null!==d[0]){const e=Vm(c,zm(a,d[0]),a),f=d[1];let g;null==(g=this.C.get(e))||g();this.C.delete(e);if(f instanceof olympe.dc.CloudObject&&f.Vb()instanceof olympe.sc.yc){const h=Eg(this.db,f,()=>{olympe.sc.Sd.F(this.J,
1041
- e,f)});this.C.set(e,()=>{Fg(this.db,f,h)})}olympe.sc.Sd.F(this.J,e,f)}}};olympe.sc.Metadata=class extends olympe.dc.CloudObject{du(){return this.nd(this.Xm())}eu(){return this.nd(this.Ym())}Ck(){return new olympe.D.$b(this.nd(this.Xm()),this.nd(this.Ym()))}Xm(){}Ym(){}};olympe.sc.Metadata.P=olympe.dc.na.C('0161ae936c62f9fcd131',olympe.sc.Metadata);m=olympe.sc.Metadata.prototype;m.du.L=olympe.D.K.G;m.eu.L=olympe.D.K.G;m.Ck.L=olympe.D.K.T;m.Xm.L=olympe.D.K.C;m.Ym.L=olympe.D.K.C;olympe.sc.Xc=class extends olympe.dc.CloudObject{F(){return this.zb(olympe.sc.Xc.G)}C(){return this.zb(olympe.sc.Xc.C)}};olympe.sc.Xc.P=olympe.dc.na.C('01703376c4a81c0e9d90',olympe.sc.Xc);olympe.sc.Xc.G=olympe.sc.Xc.P.la('01703376c4a81c0e9d91');olympe.sc.Xc.C=olympe.sc.Xc.P.la('01703376c4a81c0e9d92');olympe.sc.Xc.F=olympe.sc.Xc.P.sa('01703376c4a81c0e9d93');T(olympe.dc.CloudObject.P,olympe.sc.Xc.F);olympe.sc.Xc.prototype.F.L=olympe.D.K.F;olympe.sc.Xc.prototype.C.L=olympe.D.K.F;olympe.sc.pe={};olympe.sc.pe.De={st:'folders',pv:'screenflow',Qv:'ui-design',Qq:'software-intelligence',ih:'data-management',zB:'projects'};olympe.sc.tf=class extends olympe.dc.CloudObject{constructor(a,b){super(a,b)}xd(){return this.nd(olympe.sc.tf.F)}};olympe.sc.tf.P=olympe.dc.na.C('019131fb930466a1ad79',olympe.sc.tf);olympe.sc.tf.F=olympe.sc.tf.P.la('016d1bb681929c2cc3f1');olympe.sc.tf.C=olympe.sc.tf.P.sa('019131fb930466a1ad7a');T(olympe.dc.CloudObject.P,olympe.sc.tf.C);olympe.sc.tf.prototype.xd.L=olympe.D.K.G;olympe.sc.hd=class extends olympe.dm.BrickMetadata{ne(){return olympe.sc.pe.De.Qq}C(){return this.bb(olympe.sc.hd.C,olympe.sc.logic.Ch)}F(){return this.bb(olympe.sc.hd.F,olympe.sc.logic.Ag)}};olympe.sc.hd.P=olympe.dc.na.C('011100000000000adef0',olympe.sc.hd);olympe.sc.hd.C=olympe.sc.hd.P.sa('016ac4f59a2917fdef01');olympe.sc.hd.F=olympe.sc.hd.P.sa('016ac4f59a2917fdef02');olympe.sc.hd.P.C=(a,b)=>ll(a,b||'New function signature',olympe.sc.hd,olympe.sc.logic.sd).X();
1042
- olympe.sc.hd.prototype.C.L=new olympe.D.K(()=>olympe.dc.za,[]);olympe.sc.hd.prototype.F.L=new olympe.D.K(()=>olympe.dc.za,[]);function Ym(a,b){[].forEach(c=>c.call(a,b,(d,e)=>{null===e?b.remove(d):b.set(d,e)}))}function Zm(a,b){b=b.filter(c=>'string'===typeof c&&a.db.Rb(c,olympe.sc.logic.Tb));b.sort((c,d)=>{let e;c=null!=(e=a.db.Sa(c,olympe.sc.logic.Tb.C,!0))?e:0;let f;d=null!=(f=a.db.Sa(d,olympe.sc.logic.Tb.C,!0))?f:0;return c-d});return b}
1043
- olympe.sc.Va=class extends olympe.dm.BrickMetadata{gu(a,b,c,d,e=!0){e||olympe.ka.ib('sc').error('parameter own= false ignored, investigate');return olympe.D.eh(L(this.Hf(a,olympe.dc.nb.Zi,c)),d)}Nx(){return this.bb(olympe.sc.Va.O,olympe.sc.Runnable)}bx(){return this.bb(olympe.sc.Va.T,olympe.sc.Runnable)}dn(){return this.db.Sa(this,olympe.sc.Va.aa)}an(){return null!==this.db.Kb(this.tag,olympe.sc.Runnable.C.bc())}fu(){return this.bb(olympe.sc.Va.G,olympe.sc.logic.ub)}wp(){return this.bb(olympe.sc.Va.F,
1044
- olympe.sc.logic.Bb)}G(){return[olympe.sc.Va.ab]}};olympe.sc.Va.P=olympe.dc.na.C('0112000000000000def0',olympe.sc.Va);olympe.sc.Va.aa=olympe.sc.Va.P.la('01692aa71f3108454479');olympe.sc.Va.gb=olympe.sc.Va.P.la('0166446c1f128ebc903a');olympe.sc.Va.ab=olympe.sc.Va.P.la('0166446c1f128ebc904e');olympe.sc.Va.O=olympe.sc.Va.P.sa('01692a4af82e8984742c');olympe.sc.Va.T=olympe.sc.Va.P.sa('01692a4af82e8984742d');olympe.sc.Va.Z=olympe.sc.Va.P.sa('01692a4af82e8984742e');olympe.sc.Va.G=olympe.sc.Va.P.sa('01621fb84e320000f00a');
1045
- olympe.sc.Va.F=olympe.sc.Va.P.sa('01621fb84e320000f00b');olympe.sc.Va.Cc=olympe.sc.Va.P.sa('0171838bcfed0000e00e');olympe.sc.Va.hc=olympe.sc.Va.P.sa('0171838bcfed0000a00a');m=olympe.sc.Va.prototype;m.gu.L=olympe.D.K.C;m.Nx.L=new olympe.D.K(()=>olympe.dc.za,[]);m.bx.L=new olympe.D.K(()=>olympe.dc.za,[]);m.dn.L=olympe.D.K.C;m.an.L=olympe.D.K.C;m.fu.L=new olympe.D.K(()=>olympe.dc.za,[]);m.wp.L=new olympe.D.K(()=>olympe.dc.za,[]);function Fm(a){let b;return null!=(b=a.vd().G().map(olympe.dc.ga)[0])?b:null}function $m(a){const b=new olympe.dc.Wa;a=b.create(a);b.persist(a,!1);b.ob((d,e)=>{d||olympe.ka.ib('sc').error(`Error occurred for transaction executed by createLocalRunnable: ${e}`)});const c=olympe.dc.CloudObject.get(a);olympe.D.$a().onDestroy(()=>{const d=new olympe.dc.Wa;d.delete(c);d.ob()});return c}
1046
- function an(a,b){Om(b.C,a);Ym(a.vd(),b);const c=a.O(),d=bn(b,c),e=[];c.forEach((f,g)=>{f===a.ea?e[0]=g:f===a.aa&&(e[1]=g)});void 0!==e[0]&&void 0!==e[1]&&(cn(a,b,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])})}
1047
- function dn(a,b){var c=a.cc();const d=a.db.name(c),e=`Brick ${d} successfully run`,f=`Brick ${d} successfully cleared`,g=a.C(b);c=a.setupExecution(b).pipe(rxjs.operators.map(h=>{if(!b.eb()&&(b.clear(),null!==h)){const k=Array.isArray(h)?h:[h],l=new olympe.sc.hr(b.C);l.F().run(()=>v(function*(){try{yield a.update(l,k,g)}catch(n){l.throw(n)}}));return!0}return!1})).subscribe(rxjs.Subscriber.create(h=>h?a.H.debug(e):a.H.debug(f),h=>b.throw(h),()=>a.H.debug(`Brick ${d} completed`)));b.onDestroy(c.unsubscribe.bind(c))}
1048
- function en(a,b,c,d){const e=V(a.db,b,c,(f,g)=>{const h=wm(d,g);f?olympe.dc.CloudObject.get(g).run(h):h.destroy()});d.F().onDestroy(a.db.F.bind(a.db,b,c,e,!0))}function bn(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)}})}
1049
- function cn(a,b,c,d){b=b.F();const e=Eg(a.db,a.tag,b.G((f,g,h)=>{const k=h?d:c;null!==k&&(k(f,olympe.dc.nb.Ac(g)),h&&c!==k&&(null==c||c(f,null)))}));b.onDestroy(()=>{Fg(a.db,a.tag,e)})}
1050
- olympe.sc.Runnable=class extends olympe.dm.BrickMetadata{constructor(a,b,c){super(a,b);this.H=c}run(a){a.F().run(()=>{an(this,a);this.init(a);a.dh(this.clear.bind(this,a));a.onDestroy(this.destroy.bind(this,a));if(this.vd().dn())dn(this,a);else{const b=new olympe.sc.hr(a.C);this.update(b,[],[])}this.F(a)})}vd(){return this.Vb()}init(a){this.onInit(a)}update(a,b,c){const d=this.vd();if(d.dn())this.onUpdate(a,b,c);else this.H.debug(`Softcoded runnable ${this.db.name(this)} with tag ${this.tag} running in context ${a.U()}`),
1051
- en(this,d,olympe.sc.Va.O,a),this.ja()&&en(this,d,olympe.sc.Va.Z,a)}F(a){a.tn(olympe.sc.Va.gb)}clear(){}destroy(a){this.onDestroy(a)}setupExecution(){return rxjs.of([])}C(){return[]}onInit(){}onUpdate(){const a=this.cc(),b=this.db.name(a),c=this.db.name(this.db.model(a));this.H.error(`No code was found for ${b} (${c}: ${a})\n\n`+'This is probably because the code has not yet been deployed to the environment, or because the package.json does not import the required dependencies.')}onDestroy(){}getInputs(){var a=
1052
- this.vd();return Zm(a,a.db.bb(a.tag,olympe.sc.Va.G))}getOutputs(){var a=this.vd();return Zm(a,a.db.bb(a.tag,olympe.sc.Va.F))}G(){return[]}T(){return new Map}ja(){return!1}J(a,b,c,d){a=b.sb(a,c,!0);void 0!==d&&olympe.D.eh(a,d);return a}gb(a,b,c,d,e){olympe.D.gn([d],f=>{b.set(a,olympe.D.Yr(f)?f.valueOf():f)});return this.J(a,b,c,e)}O(){return[this.ea,this.aa]}ea(a,b){cn(this,a,b,null)}aa(a,b){cn(this,a,null,b)}yb(a,b){const c=this.db,d=olympe.sc.logic.qb.G.bc(),e=olympe.sc.logic.qb.F,f=olympe.sc.logic.qb.C;
1053
- this.Hr(d,g=>{var h=g.X();if(h=c.Kb(h,e)||c.Kb(h,f))return fn(g,a,b.bind(null,h))})}};olympe.sc.Runnable.P=Hf(olympe.dc.na.C('01130000000000ca1100',olympe.sc.Runnable));olympe.sc.Runnable.J=olympe.sc.Runnable.P.sa('01692a4af82e8984742b');olympe.sc.Runnable.C=olympe.sc.Runnable.P.sa('01756a18d4921c103111');olympe.sc.Runnable.O=T(olympe.sc.Runnable.P,olympe.sc.Va.O);olympe.sc.Runnable.T=T(olympe.sc.Runnable.P,olympe.sc.Va.T);olympe.sc.Runnable.Z=T(olympe.sc.Runnable.P,olympe.sc.Va.Z);
1054
- T(olympe.sc.Va.P,olympe.sc.Runnable.J);T(olympe.sc.Va.P,olympe.sc.Runnable.C);olympe.sc.Runnable.prototype.vd.L=new olympe.D.K(()=>olympe.sc.Va,[]);olympe.sc.Runnable.prototype.J.L=new olympe.D.K(()=>Object,[]);olympe.sc.Runnable.prototype.gb.L=olympe.D.K.C;function gn(a){if(a){if('string'===typeof a)return a;if(a instanceof olympe.sc.Kd)return(a=a.F())?a.valueOf():null;if('function'===typeof a.X)return a.X()}return null}olympe.sc.Kd=class extends olympe.dc.CloudObject{F(){return this.db.bb(this,olympe.sc.Kd.C)[0]}C(){const a=gn(this);return olympe.dc.CloudObject.get(a)}Ac(){return this.C().Ac()}toString(){const a=gn(this);let b;a&&(b=this.db.name(a));return b||super.toString()}};olympe.sc.Kd.P=olympe.dc.na.C('0163c9ae01f2d6e9ca49',olympe.sc.Kd);
1055
- olympe.sc.Kd.C=olympe.sc.Kd.P.sa('0169b5a8a33144fb0b49');T(olympe.dc.CloudObject.P,olympe.sc.Kd.C);olympe.sc.Kd.prototype.F.L=new olympe.D.K(()=>String,[]);olympe.sc.Kd.prototype.C.L=new olympe.D.K(()=>olympe.dc.CloudObject,[]);olympe.sc.xo=class extends olympe.dm.Lb{ne(){return olympe.sc.pe.De.ih}};olympe.sc.xo.P=olympe.dc.na.C('0163a68ce44f3d1fa84c',olympe.sc.xo);olympe.sc.yc=class extends olympe.dm.BrickMetadata{};olympe.sc.yc.P=olympe.dc.na.C('016324fde11a836f76c2',olympe.sc.yc);olympe.sc.yc.C=olympe.sc.yc.P.sa('016324fde11a836087c2');olympe.sc.yc.P.C=function(a,b){return ll(a,null!=b?b:'New type',olympe.sc.yc).X()};let hn=null,jn=null;
1056
- function kn(a,b,c){hn=a;const d=olympe.D.$a(),e=d.G(c);olympe.dc.gd.from(a).hb(olympe.sc.qa.Rc.C).hb(olympe.sc.Wc.C.bc()).ob({Qh:'__code-as-data__'}).then(f=>{jn=f;if(null!==f)if(b){var g=olympe.dc.ia();Qh(d,f,h=>{h=g.ai(h)?h:g.model(h);return null!==h&&g.Rb(h,olympe.sc.yc)},{qn:!0}).subscribe(rxjs.Subscriber.create(()=>{e(olympe.sc.Wc.Gb.Ap)},()=>{olympe.ka.ib('sc').error('Impossible to load the business container for the application',a,'maybe are you offline?');e(olympe.sc.Wc.Gb.Ei)}))}else olympe.ka.ib('sc').info("Found business container but won't load it's content according to configuration."),e(olympe.sc.Wc.Gb.Ei);
1057
- else olympe.ka.ib('sc').info(`No business container for application ${a}. You probably miss permissions.`),e(olympe.sc.Wc.Gb.Ei)}).catch(f=>{olympe.ka.ib('sc').error('Error while loading business container:',f.message);e(olympe.sc.Wc.Gb.xb)})}olympe.sc.Wc=class extends olympe.dc.CloudObject{};olympe.sc.Wc.Gb={Ap:0,Ei:1,xb:2};olympe.sc.Wc.P=olympe.dc.na.C('017b3aa8fae1e3d044dc',olympe.sc.Wc);olympe.sc.Wc.C=olympe.sc.Wc.P.sa('017b3aa8fd1659291b92');olympe.sc.Wc.F=olympe.sc.Wc.P.sa('017b3aa8fe7ec3fd52f2');olympe.sc.Map=class extends olympe.dc.CloudObject{};olympe.sc.Map.P=olympe.dc.na.C('018119241abce0e5696e',olympe.sc.Map);olympe.sc.yg=class extends olympe.sc.Map{};olympe.sc.yg.P=olympe.dc.na.C('01631aacd8276ea98490',olympe.sc.yg);olympe.sc.File=class extends olympe.dm.File{static Aw(a,b,c,d,e,f){e=a.create(olympe.sc.File,new Map,e,f);olympe.sc.File.ns(a,e,b,c,d);return e}static Bw(a,b,c,d,e,f){e=a.create(olympe.sc.File,new Map,e,f);olympe.sc.File.pn(a,e,b,c,d);return e}static ns(a,b,c,d,e){e=null!=e?e:'application/data';d=URL.createObjectURL(new Blob([d],{type:e}));olympe.sc.File.pn(a,b,c,d,e)}static pn(a,b,c,d,e){const f=olympe.dc.ia(),g=f.Ha(b);var h;const k=null!=(h=a.model(b))?h:olympe.sc.File;if(null===k||!f.If(k,olympe.dm.File))throw Error(`Try to set the content of an object which is not a file: ${b}`);
1058
- h=new Date;c=(new Map).set(olympe.dm.File.fileNameProp,null!=c?c:'file').set(olympe.dm.File.urlProp,d).set(olympe.dm.File.modificationDateProp,h).set(olympe.dm.File.mimeTypeProp,null!=e?e:'application/data');g&&null!==f.Sa(b,olympe.dm.File.urlProp)||c.set(olympe.dm.File.creationDateProp,h).set(olympe.dm.File.C,!1);a.gs(b,c)}};olympe.sc.File.setURLContent=olympe.sc.File.pn;olympe.sc.File.setContent=olympe.sc.File.ns;olympe.sc.File.createFromURL=olympe.sc.File.Bw;olympe.sc.File.createFromContent=olympe.sc.File.Aw;
1059
- olympe.sc.File.P=Bf(olympe.dm.File,'ff021000000000000031',olympe.sc.File);olympe.sc.ug=class extends olympe.sc.File{J(){const a=olympe.D.ec(olympe.D.Pa);this.Ak(b=>{a.update(olympe.D.Ab(b))});return a.sb()}};olympe.sc.ug.P=Bf(olympe.sc.File,'01644b6297305d62fca2',olympe.sc.ug);olympe.sc.ug.P.C=olympe.sc.File.F.bind(null,olympe.sc.ug);olympe.sc.ug.prototype.J.L=olympe.D.K.F;olympe.sc.Hc=class extends olympe.sc.File{J(){return this.zb(olympe.sc.Hc.fontFamilyProp)}O(){return this.zb(olympe.sc.Hc.G)}T(){return this.nd(olympe.sc.Hc.J)}};olympe.sc.Hc.P=Bf(olympe.sc.File,'01647e113043c637b541',olympe.sc.Hc);olympe.sc.Hc.fontFamilyProp=olympe.sc.Hc.P.la('01647e35ecd24ef0b88d');olympe.sc.Hc.G=olympe.sc.Hc.P.la('01647e677f5d1cfbdf42');olympe.sc.Hc.J=olympe.sc.Hc.P.la('01647e6780999bf8bd25');
1040
+ olympe.sc.Za.av=class extends olympe.sc.Za.oc{constructor(a){super();this.C=a;this.ia=olympe.dc.ia();this.J=new Set}getType(){return olympe.sc.Za.oc.F.Xf}process(a,b,c,...d){var e=Wm.El,f=Wm.Vl,g=Wm.Vu;const h=Wm.INIT,k=Wm.zj,l=Wm.Aj,n=Wm.Fj,p=Wm.Qd;c=Wm.Ou;if(b===olympe.sc.Za.oc.C.Ig){const [q,r]=d;b=(d=a.Ye())?olympe.dc.ia().Rb(d,olympe.sc.logic.Function):!1;d=d?olympe.dc.ia().Rb(d,olympe.sc.ui.LB):!1;b?(g=this.ia.Kb(q,olympe.dm.Property.typeRel),b=this.ia.Rb(q,olympe.sc.logic.ub),d=this.ia.Rb(q,olympe.sc.logic.Bb),
1041
+ Vm(this,a,b?e:d?f:c,new Map([['propId',q],['value',r],['type',g]]))):d&&(e=this.ia.Rb(q,olympe.dm.Property),f=this.ia.Kb(q,olympe.dm.Property.typeRel),Vm(this,a,e?g:c,new Map([['propId',q],['value',r],['type',f]])))}else b===olympe.sc.Za.oc.C.INIT?Vm(this,a,h):b===olympe.sc.Za.oc.C.zj?Vm(this,a,k):b===olympe.sc.Za.oc.C.Aj?Vm(this,a,l):b===olympe.sc.Za.oc.C.Fj?Vm(this,a,n):b===olympe.sc.Za.oc.C.Qd&&Vm(this,a,p)}};
1042
+ const Wm={El:'input',Vl:'output',Vu:'prop',INIT:'init',zj:'clear',Aj:'cleared',Fj:'destroy',Qd:'destroyed',Ou:'other'};olympe.sc.Za.lv=class extends olympe.sc.Za.oc{constructor(a){super(1);this.J=a;this.C=new Map;this.db=olympe.dc.ia()}getType(){return olympe.sc.Za.oc.F.sf}F(){super.F();for(const a of this.C.values())a();this.C.clear()}process(a,b,c,...d){if(this.active&&b===olympe.sc.Za.oc.C.Ig&&void 0!==d[0]&&null!==d[0]){const e=Um(c,ym(a,d[0]),a),f=d[1];let g;null==(g=this.C.get(e))||g();this.C.delete(e);if(f instanceof olympe.dc.CloudObject&&f.Vb()instanceof olympe.sc.yc){const h=Eg(this.db,f,()=>{olympe.sc.Sd.F(this.J,
1043
+ e,f)});this.C.set(e,()=>{Fg(this.db,f,h)})}olympe.sc.Sd.F(this.J,e,f)}}};olympe.sc.Metadata=class extends olympe.dc.CloudObject{du(){return this.nd(this.Xm())}eu(){return this.nd(this.Ym())}Ck(){return new olympe.D.$b(this.nd(this.Xm()),this.nd(this.Ym()))}Xm(){}Ym(){}};olympe.sc.Metadata.P=olympe.dc.na.C('0161ae936c62f9fcd131',olympe.sc.Metadata);m=olympe.sc.Metadata.prototype;m.du.L=olympe.D.K.G;m.eu.L=olympe.D.K.G;m.Ck.L=olympe.D.K.T;m.Xm.L=olympe.D.K.C;m.Ym.L=olympe.D.K.C;olympe.sc.Xc=class extends olympe.dc.CloudObject{F(){return this.zb(olympe.sc.Xc.G)}C(){return this.zb(olympe.sc.Xc.C)}};olympe.sc.Xc.P=olympe.dc.na.C('01703376c4a81c0e9d90',olympe.sc.Xc);olympe.sc.Xc.G=olympe.sc.Xc.P.la('01703376c4a81c0e9d91');olympe.sc.Xc.C=olympe.sc.Xc.P.la('01703376c4a81c0e9d92');olympe.sc.Xc.F=olympe.sc.Xc.P.sa('01703376c4a81c0e9d93');T(olympe.dc.CloudObject.P,olympe.sc.Xc.F);olympe.sc.Xc.prototype.F.L=olympe.D.K.F;olympe.sc.Xc.prototype.C.L=olympe.D.K.F;olympe.sc.pe={};olympe.sc.pe.De={st:'folders',pv:'screenflow',Qv:'ui-design',Qq:'software-intelligence',ih:'data-management',zB:'projects'};olympe.sc.tf=class extends olympe.dc.CloudObject{constructor(a,b){super(a,b)}xd(){return this.nd(olympe.sc.tf.F)}};olympe.sc.tf.P=olympe.dc.na.C('019131fb930466a1ad79',olympe.sc.tf);olympe.sc.tf.F=olympe.sc.tf.P.la('016d1bb681929c2cc3f1');olympe.sc.tf.C=olympe.sc.tf.P.sa('019131fb930466a1ad7a');T(olympe.dc.CloudObject.P,olympe.sc.tf.C);olympe.sc.tf.prototype.xd.L=olympe.D.K.G;olympe.sc.hd=class extends olympe.dm.BrickMetadata{ne(){return olympe.sc.pe.De.Qq}C(){return this.cb(olympe.sc.hd.C,olympe.sc.logic.Ch)}F(){return this.cb(olympe.sc.hd.F,olympe.sc.logic.Ag)}};olympe.sc.hd.P=olympe.dc.na.C('011100000000000adef0',olympe.sc.hd);olympe.sc.hd.C=olympe.sc.hd.P.sa('016ac4f59a2917fdef01');olympe.sc.hd.F=olympe.sc.hd.P.sa('016ac4f59a2917fdef02');olympe.sc.hd.P.C=(a,b)=>kl(a,b||'New function signature',olympe.sc.hd,olympe.sc.logic.sd).X();
1044
+ olympe.sc.hd.prototype.C.L=new olympe.D.K(()=>olympe.dc.za,[]);olympe.sc.hd.prototype.F.L=new olympe.D.K(()=>olympe.dc.za,[]);function Xm(a,b){[].forEach(c=>c.call(a,b,(d,e)=>{null===e?b.remove(d):b.set(d,e)}))}function Ym(a,b){b=b.filter(c=>'string'===typeof c&&a.db.Rb(c,olympe.sc.logic.Tb));b.sort((c,d)=>{let e;c=null!=(e=a.db.Oa(c,olympe.sc.logic.Tb.C,!0))?e:0;let f;d=null!=(f=a.db.Oa(d,olympe.sc.logic.Tb.C,!0))?f:0;return c-d});return b}
1045
+ olympe.sc.Va=class extends olympe.dm.BrickMetadata{gu(a,b,c,d,e=!0){e||olympe.ka.ab('sc').error('parameter own= false ignored, investigate');return olympe.D.eh(L(this.Hf(a,olympe.dc.nb.Zi,c)),d)}Nx(){return this.cb(olympe.sc.Va.O,olympe.sc.Runnable)}bx(){return this.cb(olympe.sc.Va.T,olympe.sc.Runnable)}dn(){return this.db.Oa(this,olympe.sc.Va.aa)}an(){return null!==this.db.Kb(this.tag,olympe.sc.Runnable.C.bc())}fu(){return this.cb(olympe.sc.Va.G,olympe.sc.logic.ub)}wp(){return this.cb(olympe.sc.Va.F,
1046
+ olympe.sc.logic.Bb)}G(){return[olympe.sc.Va.bb]}};olympe.sc.Va.P=olympe.dc.na.C('0112000000000000def0',olympe.sc.Va);olympe.sc.Va.aa=olympe.sc.Va.P.la('01692aa71f3108454479');olympe.sc.Va.hb=olympe.sc.Va.P.la('0166446c1f128ebc903a');olympe.sc.Va.bb=olympe.sc.Va.P.la('0166446c1f128ebc904e');olympe.sc.Va.O=olympe.sc.Va.P.sa('01692a4af82e8984742c');olympe.sc.Va.T=olympe.sc.Va.P.sa('01692a4af82e8984742d');olympe.sc.Va.Z=olympe.sc.Va.P.sa('01692a4af82e8984742e');olympe.sc.Va.G=olympe.sc.Va.P.sa('01621fb84e320000f00a');
1047
+ olympe.sc.Va.F=olympe.sc.Va.P.sa('01621fb84e320000f00b');olympe.sc.Va.Cc=olympe.sc.Va.P.sa('0171838bcfed0000e00e');olympe.sc.Va.hc=olympe.sc.Va.P.sa('0171838bcfed0000a00a');m=olympe.sc.Va.prototype;m.gu.L=olympe.D.K.C;m.Nx.L=new olympe.D.K(()=>olympe.dc.za,[]);m.bx.L=new olympe.D.K(()=>olympe.dc.za,[]);m.dn.L=olympe.D.K.C;m.an.L=olympe.D.K.C;m.fu.L=new olympe.D.K(()=>olympe.dc.za,[]);m.wp.L=new olympe.D.K(()=>olympe.dc.za,[]);function Em(a){let b;return null!=(b=a.vd().G().map(olympe.dc.ga)[0])?b:null}function Zm(a){const b=new olympe.dc.Xa;a=b.create(a);b.persist(a,!1);b.ob((d,e)=>{d||olympe.ka.ab('sc').error(`Error occurred for transaction executed by createLocalRunnable: ${e}`)});const c=olympe.dc.CloudObject.get(a);olympe.D.Wa().onDestroy(()=>{const d=new olympe.dc.Xa;d.delete(c);d.ob()});return c}
1048
+ function $m(a,b){Nm(b.C,a);Xm(a.vd(),b);const c=a.O(),d=an(b,c),e=[];c.forEach((f,g)=>{f===a.ea?e[0]=g:f===a.aa&&(e[1]=g)});void 0!==e[0]&&void 0!==e[1]&&(bn(a,b,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])})}
1049
+ function cn(a,b){var c=a.cc();const d=a.db.name(c),e=`Brick ${d} successfully run`,f=`Brick ${d} successfully cleared`,g=a.C(b);c=a.setupExecution(b).pipe(rxjs.operators.map(h=>{if(!b.fb()&&(b.clear(),null!==h)){const k=Array.isArray(h)?h:[h],l=new olympe.sc.hr(b.C);l.F().run(()=>v(function*(){try{yield a.update(l,k,g)}catch(n){l.throw(n)}}));return!0}return!1})).subscribe(rxjs.Subscriber.create(h=>h?a.H.debug(e):a.H.debug(f),h=>b.throw(h),()=>a.H.debug(`Brick ${d} completed`)));b.onDestroy(c.unsubscribe.bind(c))}
1050
+ function dn(a,b,c,d){const e=V(a.db,b,c,(f,g)=>{const h=vm(d,g);f?olympe.dc.CloudObject.get(g).run(h):h.destroy()});d.F().onDestroy(a.db.F.bind(a.db,b,c,e,!0))}function an(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)}})}
1051
+ function bn(a,b,c,d){b=b.F();const e=Eg(a.db,a.tag,b.G((f,g,h)=>{const k=h?d:c;null!==k&&(k(f,olympe.dc.nb.Ac(g)),h&&c!==k&&(null==c||c(f,null)))}));b.onDestroy(()=>{Fg(a.db,a.tag,e)})}
1052
+ olympe.sc.Runnable=class extends olympe.dm.BrickMetadata{constructor(a,b,c){super(a,b);this.H=c}run(a){a.F().run(()=>{$m(this,a);this.init(a);a.dh(this.clear.bind(this,a));a.onDestroy(this.destroy.bind(this,a));if(this.vd().dn())cn(this,a);else{const b=new olympe.sc.hr(a.C);this.update(b,[],[])}this.F(a)})}vd(){return this.Vb()}init(a){this.onInit(a)}update(a,b,c){const d=this.vd();if(d.dn())this.onUpdate(a,b,c);else this.H.debug(`Softcoded runnable ${this.db.name(this)} with tag ${this.tag} running in context ${a.U()}`),
1053
+ dn(this,d,olympe.sc.Va.O,a),this.ja()&&dn(this,d,olympe.sc.Va.Z,a)}F(a){a.tn(olympe.sc.Va.hb)}clear(){}destroy(a){this.onDestroy(a)}setupExecution(){return rxjs.of([])}C(){return[]}onInit(){}onUpdate(){const a=this.cc(),b=this.db.name(a),c=this.db.name(this.db.model(a));this.H.error(`No code was found for ${b} (${c}: ${a})\n\n`+'This is probably because the code has not yet been deployed to the environment, or because the package.json does not import the required dependencies.')}onDestroy(){}getInputs(){var a=
1054
+ this.vd();return Ym(a,a.db.cb(a.tag,olympe.sc.Va.G))}getOutputs(){var a=this.vd();return Ym(a,a.db.cb(a.tag,olympe.sc.Va.F))}G(){return[]}T(){return new Map}ja(){return!1}J(a,b,c,d){a=b.sb(a,c,!0);void 0!==d&&olympe.D.eh(a,d);return a}hb(a,b,c,d,e){olympe.D.gn([d],f=>{b.set(a,olympe.D.Yr(f)?f.valueOf():f)});return this.J(a,b,c,e)}O(){return[this.ea,this.aa]}ea(a,b){bn(this,a,b,null)}aa(a,b){bn(this,a,null,b)}yb(a,b){const c=this.db,d=olympe.sc.logic.qb.G.bc(),e=olympe.sc.logic.qb.F,f=olympe.sc.logic.qb.C;
1055
+ this.Hr(d,g=>{var h=g.X();if(h=c.Kb(h,e)||c.Kb(h,f))return en(g,a,b.bind(null,h))})}};olympe.sc.Runnable.P=Hf(olympe.dc.na.C('01130000000000ca1100',olympe.sc.Runnable));olympe.sc.Runnable.J=olympe.sc.Runnable.P.sa('01692a4af82e8984742b');olympe.sc.Runnable.C=olympe.sc.Runnable.P.sa('01756a18d4921c103111');olympe.sc.Runnable.O=T(olympe.sc.Runnable.P,olympe.sc.Va.O);olympe.sc.Runnable.T=T(olympe.sc.Runnable.P,olympe.sc.Va.T);olympe.sc.Runnable.Z=T(olympe.sc.Runnable.P,olympe.sc.Va.Z);
1056
+ T(olympe.sc.Va.P,olympe.sc.Runnable.J);T(olympe.sc.Va.P,olympe.sc.Runnable.C);olympe.sc.Runnable.prototype.vd.L=new olympe.D.K(()=>olympe.sc.Va,[]);olympe.sc.Runnable.prototype.J.L=new olympe.D.K(()=>Object,[]);olympe.sc.Runnable.prototype.hb.L=olympe.D.K.C;function fn(a){if(a){if('string'===typeof a)return a;if(a instanceof olympe.sc.Kd)return(a=a.F())?a.valueOf():null;if('function'===typeof a.X)return a.X()}return null}olympe.sc.Kd=class extends olympe.dc.CloudObject{F(){return this.db.cb(this,olympe.sc.Kd.C)[0]}C(){const a=fn(this);return olympe.dc.CloudObject.get(a)}Ac(){return this.C().Ac()}toString(){const a=fn(this);let b;a&&(b=this.db.name(a));return b||super.toString()}};olympe.sc.Kd.P=olympe.dc.na.C('0163c9ae01f2d6e9ca49',olympe.sc.Kd);
1057
+ olympe.sc.Kd.C=olympe.sc.Kd.P.sa('0169b5a8a33144fb0b49');T(olympe.dc.CloudObject.P,olympe.sc.Kd.C);olympe.sc.Kd.prototype.F.L=new olympe.D.K(()=>String,[]);olympe.sc.Kd.prototype.C.L=new olympe.D.K(()=>olympe.dc.CloudObject,[]);olympe.sc.xo=class extends olympe.dm.Lb{ne(){return olympe.sc.pe.De.ih}};olympe.sc.xo.P=olympe.dc.na.C('0163a68ce44f3d1fa84c',olympe.sc.xo);olympe.sc.yc=class extends olympe.dm.BrickMetadata{};olympe.sc.yc.P=olympe.dc.na.C('016324fde11a836f76c2',olympe.sc.yc);olympe.sc.yc.C=olympe.sc.yc.P.sa('016324fde11a836087c2');olympe.sc.yc.P.C=function(a,b){return kl(a,null!=b?b:'New type',olympe.sc.yc).X()};let gn=null,hn=null;
1058
+ function jn(a,b,c){gn=a;const d=olympe.D.Wa(),e=d.G(c);olympe.dc.gd.from(a).ib(olympe.sc.qa.Rc.C).ib(olympe.sc.Wc.C.bc()).ob({Qh:'__code-as-data__'}).then(f=>{hn=f;if(null!==f)if(b){var g=olympe.dc.ia();Qh(d,f,h=>{h=g.ai(h)?h:g.model(h);return null!==h&&g.Rb(h,olympe.sc.yc)},{qn:!0}).subscribe(rxjs.Subscriber.create(()=>{e(olympe.sc.Wc.Hb.Ap)},()=>{olympe.ka.ab('sc').error('Impossible to load the business container for the application',a,'maybe are you offline?');e(olympe.sc.Wc.Hb.Ei)}))}else olympe.ka.ab('sc').info("Found business container but won't load it's content according to configuration."),e(olympe.sc.Wc.Hb.Ei);
1059
+ else olympe.ka.ab('sc').info(`No business container for application ${a}. You probably miss permissions.`),e(olympe.sc.Wc.Hb.Ei)}).catch(f=>{olympe.ka.ab('sc').error('Error while loading business container:',f.message);e(olympe.sc.Wc.Hb.xb)})}olympe.sc.Wc=class extends olympe.dc.CloudObject{};olympe.sc.Wc.Hb={Ap:0,Ei:1,xb:2};olympe.sc.Wc.P=olympe.dc.na.C('017b3aa8fae1e3d044dc',olympe.sc.Wc);olympe.sc.Wc.C=olympe.sc.Wc.P.sa('017b3aa8fd1659291b92');olympe.sc.Wc.F=olympe.sc.Wc.P.sa('017b3aa8fe7ec3fd52f2');olympe.sc.Map=class extends olympe.dc.CloudObject{};olympe.sc.Map.P=olympe.dc.na.C('018119241abce0e5696e',olympe.sc.Map);olympe.sc.yg=class extends olympe.sc.Map{};olympe.sc.yg.P=olympe.dc.na.C('01631aacd8276ea98490',olympe.sc.yg);olympe.sc.File=class extends olympe.dm.File{static Aw(a,b,c,d,e,f){e=a.create(olympe.sc.File,new Map,e,f);olympe.sc.File.ns(a,e,b,c,d);return e}static Bw(a,b,c,d,e,f){e=a.create(olympe.sc.File,new Map,e,f);olympe.sc.File.pn(a,e,b,c,d);return e}static ns(a,b,c,d,e){e=null!=e?e:'application/data';d=URL.createObjectURL(new Blob([d],{type:e}));olympe.sc.File.pn(a,b,c,d,e)}static pn(a,b,c,d,e){const f=olympe.dc.ia(),g=f.Ha(b);var h;const k=null!=(h=a.model(b))?h:olympe.sc.File;if(null===k||!f.If(k,olympe.dm.File))throw Error(`Try to set the content of an object which is not a file: ${b}`);
1060
+ h=new Date;c=(new Map).set(olympe.dm.File.fileNameProp,null!=c?c:'file').set(olympe.dm.File.urlProp,d).set(olympe.dm.File.modificationDateProp,h).set(olympe.dm.File.mimeTypeProp,null!=e?e:'application/data');g&&null!==f.Oa(b,olympe.dm.File.urlProp)||c.set(olympe.dm.File.creationDateProp,h).set(olympe.dm.File.C,!1);a.gs(b,c)}};olympe.sc.File.setURLContent=olympe.sc.File.pn;olympe.sc.File.setContent=olympe.sc.File.ns;olympe.sc.File.createFromURL=olympe.sc.File.Bw;olympe.sc.File.createFromContent=olympe.sc.File.Aw;
1061
+ olympe.sc.File.P=Bf(olympe.dm.File,'ff021000000000000031',olympe.sc.File);olympe.sc.ug=class extends olympe.sc.File{J(){const a=olympe.D.ec(olympe.D.Qa);this.Ak(b=>{a.update(olympe.D.Ab(b))});return a.sb()}};olympe.sc.ug.P=Bf(olympe.sc.File,'01644b6297305d62fca2',olympe.sc.ug);olympe.sc.ug.P.C=olympe.sc.File.F.bind(null,olympe.sc.ug);olympe.sc.ug.prototype.J.L=olympe.D.K.F;olympe.sc.Hc=class extends olympe.sc.File{J(){return this.zb(olympe.sc.Hc.fontFamilyProp)}O(){return this.zb(olympe.sc.Hc.G)}T(){return this.nd(olympe.sc.Hc.J)}};olympe.sc.Hc.P=Bf(olympe.sc.File,'01647e113043c637b541',olympe.sc.Hc);olympe.sc.Hc.fontFamilyProp=olympe.sc.Hc.P.la('01647e35ecd24ef0b88d');olympe.sc.Hc.G=olympe.sc.Hc.P.la('01647e677f5d1cfbdf42');olympe.sc.Hc.J=olympe.sc.Hc.P.la('01647e6780999bf8bd25');
1060
1062
  olympe.sc.Hc.P.C=(a,b,c,d)=>{c=olympe.sc.File.F(olympe.sc.Hc,a,b,c,d);a.update(c,olympe.sc.Hc.fontFamilyProp,b.split('.')[0]);return c};olympe.sc.Hc.prototype.J.L=olympe.D.K.F;olympe.sc.Hc.prototype.O.L=olympe.D.K.F;olympe.sc.Hc.prototype.T.L=olympe.D.K.G;olympe.sc.Jh=class extends olympe.sc.File{};olympe.sc.Jh.P=Bf(olympe.sc.File,'0164643c432146a71d5c',olympe.sc.Jh);olympe.sc.Jh.P.C=olympe.sc.File.F.bind(null,olympe.sc.Jh);olympe.sc.jr=class extends olympe.dc.CloudObject{};olympe.sc.jr.P=olympe.dc.na.C('016421bb3797e22d1c4e',olympe.sc.jr);olympe.sc.logic={};olympe.sc.logic.bp=(a,b)=>a===b?0:a>b?1:-1;
1061
1063
  olympe.sc.logic.WA=(a,b,c,d,e,f,g)=>{const h=b.X();b=olympe.D.Na(b.getType().X());let k,l;if(b===olympe.dc.ga(olympe.dm.String))k=c.valueOf().toLowerCase(),l=p=>p.zb(h).toLowerCase();else if(b===olympe.dc.ga(olympe.dm.Number))k=c.valueOf(),l=p=>p.nd(h);else if(b===olympe.dc.ga(olympe.dm.DateTime))k=c.getTime(),l=p=>olympe.D.va([p.gj(h)],q=>q.getTime(),Number,'FilterList Date&DateTime TransformFlows');else{c=olympe.dc.ia().name(b);g.warn(`Properties of type ${c} are not supported. List will not be filtered.`);e(a);
1062
1064
  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.uk().filter(p=>olympe.D.va([l(p)],q=>{q=n(q.valueOf(),k);return olympe.D.Sb(d.valueOf()?1===q:0<=q)},olympe.D.fa,'FilterList ListDefBuilder Filter TransformFlows')).Bi())};
1063
- olympe.sc.logic.FD=(a,b)=>{if(a instanceof olympe.D.ba)return a;if(a instanceof olympe.D.Pa)return a.rs();if(a instanceof olympe.D.fa)return a.Tr();if('string'===typeof a||'number'===typeof a)return olympe.D.ra(Number(a));b.error(`Could not parse provided value ${a} into a number`);return olympe.D.ba.Jp};olympe.sc.logic.Oa={};function ln(a){Gf(a.P,(b,c)=>{b=b.create(a.P.F);Z(b,olympe.dc.CloudObject.nameProp,c);return b.X()})}olympe.sc.logic.Oa.Ro=class{constructor(a,b,c){this.P=olympe.dc.na.C(a,b,...c);ln(this)}X(){return this.P.X()}};olympe.sc.logic.Oa.Ro.ya=[olympe.dc.Ne];const mn=Object.create(null),nn=new Map;function on(a){if(void 0===mn[a])throw Error(`Tag: ${a} - does not correspond to a registered function`);return Df(a)}function pn(a,b,c=olympe.sc.logic.Function){if(nn.has(a))throw c=on(a),Error(`Tag: ${a} - overwriting existing function definition "${c.name}" with "${b.name}"`);const d=olympe.dc.na.C(a,b,...[]);nn.set(a,{P:d,WD:b,CD:c});return d}
1064
- olympe.sc.logic.na=class{constructor(){}static C(a,b,...c){if(mn[a])throw c=on(a),Error(`Tag: ${a} - overwriting already defined function "${c.name}" with "${b.name}"`);b=new olympe.sc.logic.Oa.Ro(a,b,[olympe.sc.R.Ca].concat(c));return mn[a]=b}};olympe.sc.logic.Kz=class{};olympe.sc.logic.Dj=class extends olympe.dc.CloudObject{};olympe.sc.logic.Dj.P=olympe.dc.na.C('01621fb84e320000cf00',olympe.sc.logic.Dj);function Am(a,b,c){return new olympe.sc.logic.Error(a,b,c)}olympe.sc.logic.Error=class extends Error{constructor(a,b,c){super(a);this.code=b;this.C=null!=c?c:null}static create(a,b){return new olympe.sc.logic.Error(a,b)}Bx(){return this.message}Ir(){return this.code}ke(){let a;return null!=(a=this.C)?a:''}toString(){return`${this.message}\nError found in:\n${this.ke()}\n\n${this.stack}`}};olympe.sc.logic.Error.prototype.getStack=olympe.sc.logic.Error.prototype.ke;
1065
- olympe.sc.logic.Error.prototype.getCode=olympe.sc.logic.Error.prototype.Ir;olympe.sc.logic.Error.prototype.getMessage=olympe.sc.logic.Error.prototype.Bx;olympe.sc.logic.Error.create=olympe.sc.logic.Error.create;olympe.sc.logic.ri=class extends olympe.sc.logic.Dj{};olympe.sc.logic.ri.P=olympe.dc.na.C('016eeb5ede9f3094d8f0',olympe.sc.logic.ri);olympe.sc.logic.ed=class extends olympe.dc.CloudObject{C(){return this.pc(olympe.sc.logic.ed.C,olympe.dc.CloudObject)}};olympe.sc.logic.ed.P=olympe.dc.na.C('016ac4f59ee8ea2081ba',olympe.sc.logic.ed);olympe.sc.logic.ed.F=olympe.sc.logic.ed.P.la('017bc044aeacce7ffc8f');olympe.sc.logic.ed.C=olympe.sc.logic.ed.P.sa('016ac4f5a0091c4790e2');T(olympe.dc.CloudObject.P,olympe.sc.logic.ed.C);olympe.sc.logic.ed.prototype.C.L=new olympe.D.K(()=>olympe.dc.CloudObject,[]);olympe.sc.logic.Ch=class extends olympe.sc.logic.ed{};olympe.sc.logic.Ch.P=olympe.dc.na.C('016ac4f59c592b862457',olympe.sc.logic.Ch);olympe.sc.logic.Ch.G=olympe.sc.hd.C.bc();olympe.sc.logic.Ch.P.C=(a,b,c,d,e)=>{b=ll(a,b||'New Predefined Input',olympe.sc.logic.Ch,olympe.sc.logic.ub);Z(b,olympe.sc.logic.ed.F,e);a.Ma(olympe.sc.logic.ed.C,b,c);a.Ma(olympe.sc.hd.C,d,b);return b.X()};olympe.sc.logic.Ag=class extends olympe.sc.logic.ed{};olympe.sc.logic.Ag.P=olympe.dc.na.C('016ac4f59dd99f5df3e1',olympe.sc.logic.Ag);olympe.sc.logic.Ag.G=T(olympe.sc.logic.Ag.P,olympe.sc.hd.F);olympe.sc.logic.Ag.P.C=(a,b,c,d,e)=>{b=ll(a,b||'New Predefined Output',olympe.sc.logic.Ag,olympe.sc.logic.Bb);Z(b,olympe.sc.logic.ed.F,e);a.Ma(olympe.sc.logic.ed.C,b,c);a.Ma(olympe.sc.hd.F,d,b);return b.X()};olympe.sc.logic.sd=class extends olympe.sc.Va{ne(){return olympe.sc.pe.De.Qq}Z(){return this.Sm().uk().Rb([olympe.sc.logic.Function]).and().pd().Rb([olympe.sc.logic.cd,olympe.sc.logic.dd]).Bi()}G(){const a=olympe.dc.ga(olympe.sc.logic.ri);return this.db.bb(this,olympe.sc.logic.sd.F).filter(b=>this.db.Kb(b,olympe.sc.logic.Tb.typeRel)===a)}C(a){const b=this.db.Pm(this,[olympe.sc.Va.G],c=>this.db.model(c)===olympe.dc.ga(a));return b?olympe.dc.CloudObject.get(b):null}F(a){const b=this.db.Pm(this,[olympe.sc.Va.F],
1066
- c=>this.db.model(c)===olympe.dc.ga(a));return b?olympe.dc.CloudObject.get(b):null}};olympe.sc.logic.sd.P=pn('01621fb84e320000f000',olympe.sc.logic.sd,olympe.sc.logic.Function);olympe.sc.logic.sd.prototype.C.L=new olympe.D.K(()=>olympe.sc.logic.ub,[]);olympe.sc.logic.sd.prototype.F.L=new olympe.D.K(()=>olympe.sc.logic.Bb,[]);olympe.sc.logic.Pf=class extends olympe.sc.logic.sd{J(){return this.C('016ac63229782039429f')}O(){return this.F('016ac6322acf67eebfe7')}T(){return this.wp().uk().hb(olympe.sc.logic.Tb.typeRel).Gk(olympe.sc.logic.ri).Bi().mf().bn(olympe.D.ba.ZERO)}};olympe.sc.logic.Pf.C='016ac63229782039429f';olympe.sc.logic.Pf.J='016ac6322acf67eebfe7';olympe.sc.logic.Pf.P=pn('01621fb84e320000a000',olympe.sc.logic.Pf,olympe.sc.logic.Action);olympe.sc.logic.Pf.prototype.J.L=new olympe.D.K(()=>olympe.sc.logic.ub,[]);
1067
- olympe.sc.logic.Pf.prototype.O.L=new olympe.D.K(()=>olympe.sc.logic.Bb,[]);olympe.sc.logic.Pf.prototype.T.L=olympe.D.K.O;olympe.sc.logic.co=class extends olympe.sc.logic.sd{};olympe.sc.logic.co.P=pn('01621fb84e320000f011',olympe.sc.logic.co);olympe.sc.logic.bo=class extends olympe.sc.logic.Pf{};olympe.sc.logic.bo.P=pn('01621fb84e320000f012',olympe.sc.logic.bo);olympe.sc.logic.Function=class extends olympe.sc.Runnable{O(){return[this.yb]}T(){const a=olympe.sc.pg.C.El,b=olympe.sc.pg.C.Vl,c=this.db,d=new Map,e=this.cc();c.bb(e,olympe.sc.Va.G).forEach(f=>{d.set(a+c.name(f),f)});c.bb(e,olympe.sc.Va.F).forEach(f=>{d.set(b+c.name(f),f)});return d}C(a){const b=olympe.dc.ga(olympe.sc.logic.Dj),c=olympe.dc.ga(olympe.sc.logic.ri);return this.getOutputs().map(d=>{switch(this.db.Kb(d,olympe.sc.logic.Tb.typeRel)){case b:return a.tn.bind(a,d);case c:return a.throw.bind(a);
1065
+ olympe.sc.logic.FD=(a,b)=>{if(a instanceof olympe.D.ba)return a;if(a instanceof olympe.D.Qa)return a.rs();if(a instanceof olympe.D.fa)return a.Tr();if('string'===typeof a||'number'===typeof a)return olympe.D.ra(Number(a));b.error(`Could not parse provided value ${a} into a number`);return olympe.D.ba.Jp};olympe.sc.logic.Pa={};function kn(a){Gf(a.P,(b,c)=>{b=b.create(a.P.F);Z(b,olympe.dc.CloudObject.nameProp,c);return b.X()})}olympe.sc.logic.Pa.Ro=class{constructor(a,b,c){this.P=olympe.dc.na.C(a,b,...c);kn(this)}X(){return this.P.X()}};olympe.sc.logic.Pa.Ro.ya=[olympe.dc.Ne];const ln=Object.create(null),mn=new Map;function nn(a){if(void 0===ln[a])throw Error(`Tag: ${a} - does not correspond to a registered function`);return Df(a)}function on(a,b,c=olympe.sc.logic.Function){if(mn.has(a))throw c=nn(a),Error(`Tag: ${a} - overwriting existing function definition "${c.name}" with "${b.name}"`);const d=olympe.dc.na.C(a,b,...[]);mn.set(a,{P:d,WD:b,CD:c});return d}
1066
+ olympe.sc.logic.na=class{constructor(){}static C(a,b,...c){if(ln[a])throw c=nn(a),Error(`Tag: ${a} - overwriting already defined function "${c.name}" with "${b.name}"`);b=new olympe.sc.logic.Pa.Ro(a,b,[olympe.sc.R.Ca].concat(c));return ln[a]=b}};olympe.sc.logic.Kz=class{};olympe.sc.logic.Dj=class extends olympe.dc.CloudObject{};olympe.sc.logic.Dj.P=olympe.dc.na.C('01621fb84e320000cf00',olympe.sc.logic.Dj);function zm(a,b,c){return new olympe.sc.logic.Error(a,b,c)}olympe.sc.logic.Error=class extends Error{constructor(a,b,c){super(a);this.code=b;this.C=null!=c?c:null}static create(a,b){return new olympe.sc.logic.Error(a,b)}Bx(){return this.message}Ir(){return this.code}ke(){let a;return null!=(a=this.C)?a:''}toString(){return`${this.message}\nError found in:\n${this.ke()}\n\n${this.stack}`}};olympe.sc.logic.Error.prototype.getStack=olympe.sc.logic.Error.prototype.ke;
1067
+ olympe.sc.logic.Error.prototype.getCode=olympe.sc.logic.Error.prototype.Ir;olympe.sc.logic.Error.prototype.getMessage=olympe.sc.logic.Error.prototype.Bx;olympe.sc.logic.Error.create=olympe.sc.logic.Error.create;olympe.sc.logic.ri=class extends olympe.sc.logic.Dj{};olympe.sc.logic.ri.P=olympe.dc.na.C('016eeb5ede9f3094d8f0',olympe.sc.logic.ri);olympe.sc.logic.ed=class extends olympe.dc.CloudObject{C(){return this.pc(olympe.sc.logic.ed.C,olympe.dc.CloudObject)}};olympe.sc.logic.ed.P=olympe.dc.na.C('016ac4f59ee8ea2081ba',olympe.sc.logic.ed);olympe.sc.logic.ed.F=olympe.sc.logic.ed.P.la('017bc044aeacce7ffc8f');olympe.sc.logic.ed.C=olympe.sc.logic.ed.P.sa('016ac4f5a0091c4790e2');T(olympe.dc.CloudObject.P,olympe.sc.logic.ed.C);olympe.sc.logic.ed.prototype.C.L=new olympe.D.K(()=>olympe.dc.CloudObject,[]);olympe.sc.logic.Ch=class extends olympe.sc.logic.ed{};olympe.sc.logic.Ch.P=olympe.dc.na.C('016ac4f59c592b862457',olympe.sc.logic.Ch);olympe.sc.logic.Ch.G=olympe.sc.hd.C.bc();olympe.sc.logic.Ch.P.C=(a,b,c,d,e)=>{b=kl(a,b||'New Predefined Input',olympe.sc.logic.Ch,olympe.sc.logic.ub);Z(b,olympe.sc.logic.ed.F,e);a.Ma(olympe.sc.logic.ed.C,b,c);a.Ma(olympe.sc.hd.C,d,b);return b.X()};olympe.sc.logic.Ag=class extends olympe.sc.logic.ed{};olympe.sc.logic.Ag.P=olympe.dc.na.C('016ac4f59dd99f5df3e1',olympe.sc.logic.Ag);olympe.sc.logic.Ag.G=T(olympe.sc.logic.Ag.P,olympe.sc.hd.F);olympe.sc.logic.Ag.P.C=(a,b,c,d,e)=>{b=kl(a,b||'New Predefined Output',olympe.sc.logic.Ag,olympe.sc.logic.Bb);Z(b,olympe.sc.logic.ed.F,e);a.Ma(olympe.sc.logic.ed.C,b,c);a.Ma(olympe.sc.hd.F,d,b);return b.X()};olympe.sc.logic.sd=class extends olympe.sc.Va{ne(){return olympe.sc.pe.De.Qq}Z(){return this.Sm().uk().Rb([olympe.sc.logic.Function]).and().pd().Rb([olympe.sc.logic.cd,olympe.sc.logic.dd]).Bi()}G(){const a=olympe.dc.ga(olympe.sc.logic.ri);return this.db.cb(this,olympe.sc.logic.sd.F).filter(b=>this.db.Kb(b,olympe.sc.logic.Tb.typeRel)===a)}C(a){const b=this.db.Pm(this,[olympe.sc.Va.G],c=>this.db.model(c)===olympe.dc.ga(a));return b?olympe.dc.CloudObject.get(b):null}F(a){const b=this.db.Pm(this,[olympe.sc.Va.F],
1068
+ c=>this.db.model(c)===olympe.dc.ga(a));return b?olympe.dc.CloudObject.get(b):null}};olympe.sc.logic.sd.P=on('01621fb84e320000f000',olympe.sc.logic.sd,olympe.sc.logic.Function);olympe.sc.logic.sd.prototype.C.L=new olympe.D.K(()=>olympe.sc.logic.ub,[]);olympe.sc.logic.sd.prototype.F.L=new olympe.D.K(()=>olympe.sc.logic.Bb,[]);olympe.sc.logic.Pf=class extends olympe.sc.logic.sd{J(){return this.C('016ac63229782039429f')}O(){return this.F('016ac6322acf67eebfe7')}T(){return this.wp().uk().ib(olympe.sc.logic.Tb.typeRel).Gk(olympe.sc.logic.ri).Bi().mf().bn(olympe.D.ba.ZERO)}};olympe.sc.logic.Pf.C='016ac63229782039429f';olympe.sc.logic.Pf.J='016ac6322acf67eebfe7';olympe.sc.logic.Pf.P=on('01621fb84e320000a000',olympe.sc.logic.Pf,olympe.sc.logic.Action);olympe.sc.logic.Pf.prototype.J.L=new olympe.D.K(()=>olympe.sc.logic.ub,[]);
1069
+ olympe.sc.logic.Pf.prototype.O.L=new olympe.D.K(()=>olympe.sc.logic.Bb,[]);olympe.sc.logic.Pf.prototype.T.L=olympe.D.K.O;olympe.sc.logic.co=class extends olympe.sc.logic.sd{};olympe.sc.logic.co.P=on('01621fb84e320000f011',olympe.sc.logic.co);olympe.sc.logic.bo=class extends olympe.sc.logic.Pf{};olympe.sc.logic.bo.P=on('01621fb84e320000f012',olympe.sc.logic.bo);olympe.sc.logic.Function=class extends olympe.sc.Runnable{O(){return[this.yb]}T(){const a=olympe.sc.pg.C.El,b=olympe.sc.pg.C.Vl,c=this.db,d=new Map,e=this.cc();c.cb(e,olympe.sc.Va.G).forEach(f=>{d.set(a+c.name(f),f)});c.cb(e,olympe.sc.Va.F).forEach(f=>{d.set(b+c.name(f),f)});return d}C(a){const b=olympe.dc.ga(olympe.sc.logic.Dj),c=olympe.dc.ga(olympe.sc.logic.ri);return this.getOutputs().map(d=>{switch(this.db.Kb(d,olympe.sc.logic.Tb.typeRel)){case b:return a.tn.bind(a,d);case c:return a.throw.bind(a);
1068
1070
  default:return a.set.bind(a,d)}})}setupExecution(a){const b=this.getInputs();return 0<b.length?rxjs.combineLatest(b.map(c=>a.observe(c))).pipe(rxjs.operators.map(c=>c.includes(null)?null:c)):rxjs.of([])}};olympe.sc.logic.Function.P=olympe.dc.na.C('0168c6f020f2a96f0000',olympe.sc.logic.Function,olympe.sc.R.Ca);olympe.sc.logic.Tb=class extends olympe.dc.CloudObject{getType(){return this.pc(olympe.sc.logic.Tb.typeRel,olympe.dc.CloudObject)}C(){return this.nd(olympe.sc.logic.Tb.C)}};olympe.sc.logic.Tb.P=olympe.dc.na.C('0168a431d25001540000',olympe.sc.logic.Tb);olympe.sc.logic.Tb.C=olympe.sc.logic.Tb.P.la('01740c5d4ae4b520dd01');olympe.sc.logic.Tb.typeRel=olympe.sc.logic.Tb.P.sa('0168a431d3b9b7438424');T(olympe.dc.CloudObject.P,olympe.sc.logic.Tb.typeRel);
1069
1071
  olympe.sc.logic.Tb.prototype.getType.L=new olympe.D.K(()=>olympe.dc.CloudObject,[]);olympe.sc.logic.Tb.prototype.C.L=olympe.D.K.G;olympe.sc.logic.ub=class extends olympe.sc.logic.Tb{};olympe.sc.logic.ub.P=olympe.dc.na.C('0168a431d25001540001',olympe.sc.logic.ub);olympe.sc.logic.ub.T=olympe.sc.logic.Tb.P.la('01740c5d4ae4b520dd02');olympe.sc.logic.ub.O=T(olympe.sc.logic.ub.P,olympe.sc.Va.G);olympe.sc.logic.ub.F=olympe.sc.logic.ub.P.sa('0168a431d91f2578000b',olympe.dc.wa.ORIGIN);olympe.sc.logic.ub.G=olympe.sc.logic.ub.P.sa('01621fb84e32000000a1',olympe.dc.wa.ORIGIN);
1070
1072
  olympe.sc.logic.ub.J=olympe.sc.logic.ub.P.sa('01621fb84e32000000d1',olympe.dc.wa.ORIGIN);olympe.sc.logic.ub.P.C=function(a,b,c,d,e,f=olympe.sc.logic.ub){f=a.create(f);Z(f,olympe.dc.CloudObject.nameProp,b||'New input');a.Ma(olympe.sc.logic.Tb.typeRel,f,c);void 0!==e&&Z(f,olympe.sc.logic.Tb.C,e);d&&a.Ma(olympe.sc.Va.G,d,f);return f.X()};olympe.sc.logic.Bb=class extends olympe.sc.logic.Tb{};olympe.sc.logic.Bb.P=olympe.dc.na.C('0168a431d25001540002',olympe.sc.logic.Bb);olympe.sc.logic.Bb.O=T(olympe.sc.logic.Bb.P,olympe.sc.Va.F);olympe.sc.logic.Bb.F=olympe.sc.logic.Bb.P.sa('0168a431d91f25780003',olympe.dc.wa.ORIGIN);olympe.sc.logic.Bb.J=olympe.sc.logic.Bb.P.sa('01621fb84e32000000a2',olympe.dc.wa.ORIGIN);olympe.sc.logic.Bb.G=olympe.sc.logic.Bb.P.sa('01621fb84e32000000d2',olympe.dc.wa.ORIGIN);
1071
- olympe.sc.logic.Bb.P.C=function(a,b,c,d,e,f=olympe.sc.logic.Bb){f=a.create(f);Z(f,olympe.dc.CloudObject.nameProp,b||'New output');a.Ma(olympe.sc.logic.Tb.typeRel,f,c);void 0!==e&&Z(f,olympe.sc.logic.Tb.C,e);d&&a.Ma(olympe.sc.Va.F,d,f);return f.X()};olympe.sc.logic.Action=class extends olympe.sc.logic.Function{setupExecution(a){const b=this.vd().J().X();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.na.C('0168c6f020f2a96a0000',olympe.sc.logic.Action,olympe.sc.R.Ca);olympe.sc.logic.cd=class extends olympe.sc.logic.Function{run(a){an(this,a);const b=a.getParent(),c=this.db.Kb(this,olympe.sc.logic.cd.G),d=this.db.Kb(this,olympe.sc.logic.cd.F);a.on(c,e=>b.set(d,e),this.tag)}ua(){return this.pc(olympe.sc.logic.cd.G,olympe.sc.logic.ub)}Ga(){return this.pc(olympe.sc.logic.cd.F,olympe.sc.logic.Bb)}};olympe.sc.logic.cd.P=olympe.dc.na.C('01621fb84e32000000a0',olympe.sc.logic.cd,olympe.sc.R.Ca);olympe.sc.logic.cd.G=T(olympe.sc.logic.cd.P,olympe.sc.logic.ub.G);
1073
+ olympe.sc.logic.Bb.P.C=function(a,b,c,d,e,f=olympe.sc.logic.Bb){f=a.create(f);Z(f,olympe.dc.CloudObject.nameProp,b||'New output');a.Ma(olympe.sc.logic.Tb.typeRel,f,c);void 0!==e&&Z(f,olympe.sc.logic.Tb.C,e);d&&a.Ma(olympe.sc.Va.F,d,f);return f.X()};olympe.sc.logic.Action=class extends olympe.sc.logic.Function{setupExecution(a){const b=this.vd().J().X();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.na.C('0168c6f020f2a96a0000',olympe.sc.logic.Action,olympe.sc.R.Ca);olympe.sc.logic.cd=class extends olympe.sc.logic.Function{run(a){$m(this,a);const b=a.getParent(),c=this.db.Kb(this,olympe.sc.logic.cd.G),d=this.db.Kb(this,olympe.sc.logic.cd.F);a.on(c,e=>b.set(d,e),this.tag)}ua(){return this.pc(olympe.sc.logic.cd.G,olympe.sc.logic.ub)}Ga(){return this.pc(olympe.sc.logic.cd.F,olympe.sc.logic.Bb)}};olympe.sc.logic.cd.P=olympe.dc.na.C('01621fb84e32000000a0',olympe.sc.logic.cd,olympe.sc.R.Ca);olympe.sc.logic.cd.G=T(olympe.sc.logic.cd.P,olympe.sc.logic.ub.G);
1072
1074
  olympe.sc.logic.cd.F=T(olympe.sc.logic.cd.P,olympe.sc.logic.Bb.J);olympe.sc.logic.cd.P.C=function(a,b,c){b=a.create(olympe.sc.logic.cd);a.Ma(olympe.sc.logic.cd.F,b,c);return b.X()};olympe.sc.logic.cd.prototype.ua.L=new olympe.D.K(()=>olympe.sc.logic.ub,[]);olympe.sc.logic.cd.prototype.Ga.L=new olympe.D.K(()=>olympe.sc.logic.Bb,[]);olympe.sc.logic.dd=class extends olympe.sc.logic.Function{run(a){const b=a.getParent(),c=this.db.Kb(this,olympe.sc.logic.dd.F),d=this.db.Kb(this,olympe.sc.logic.dd.G);b.on(c,e=>a.set(d,e),b.U())}Ga(){return this.pc(olympe.sc.logic.dd.F,olympe.sc.logic.ub)}ua(){return this.pc(olympe.sc.logic.dd.G,olympe.sc.logic.Bb)}};olympe.sc.logic.dd.P=olympe.dc.na.C('01621fb84e32000000d0',olympe.sc.logic.dd,olympe.sc.R.Ca);olympe.sc.logic.dd.F=T(olympe.sc.logic.dd.P,olympe.sc.logic.ub.J);
1073
- olympe.sc.logic.dd.G=T(olympe.sc.logic.dd.P,olympe.sc.logic.Bb.G);olympe.sc.logic.dd.P.C=function(a,b,c){b=a.create(olympe.sc.logic.dd);a.Ma(olympe.sc.logic.dd.F,b,c);return b.X()};olympe.sc.logic.dd.prototype.Ga.L=new olympe.D.K(()=>olympe.sc.logic.ub,[]);olympe.sc.logic.dd.prototype.ua.L=new olympe.D.K(()=>olympe.sc.logic.Bb,[]);function fn(a,b,c){var d;const e=null!=(d=a.db.Kb(a,olympe.sc.logic.qb.T))?d:a.db.Kb(a,olympe.sc.logic.qb.J),f=a.db.Kb(a,olympe.sc.logic.qb.O);if(null!==e&&null!==f){d=a.db.If(qn(a),olympe.dm.ye)?new olympe.D.Xb('Pipe Context'):null;const k=a.C.bind(a,c,d);let l;const n=b.Nk(f,p=>{let q;null==(q=l)||q();l=p.on(e,k,f)});return()=>{k(null);n();let p;null==(p=l)||p()}}const g=k=>c(olympe.dc.nb.Ac(k)),h=Cg(a.db,a,olympe.sc.logic.qb.valueProp,g);return()=>{g(null);Dg(a.db,a,olympe.sc.logic.qb.valueProp,
1074
- h)}}function qn(a){let b=null,c=a.db.Kb(a,olympe.sc.logic.qb.F);c?b=a.db.Kb(c,olympe.dm.Property.typeRel):(c=a.db.Kb(a,olympe.sc.logic.qb.C))&&(b=a.db.Kb(c,olympe.sc.logic.Tb.typeRel));return b||olympe.dc.ga(olympe.dc.CloudObject)}
1075
+ olympe.sc.logic.dd.G=T(olympe.sc.logic.dd.P,olympe.sc.logic.Bb.G);olympe.sc.logic.dd.P.C=function(a,b,c){b=a.create(olympe.sc.logic.dd);a.Ma(olympe.sc.logic.dd.F,b,c);return b.X()};olympe.sc.logic.dd.prototype.Ga.L=new olympe.D.K(()=>olympe.sc.logic.ub,[]);olympe.sc.logic.dd.prototype.ua.L=new olympe.D.K(()=>olympe.sc.logic.Bb,[]);function en(a,b,c){var d;const e=null!=(d=a.db.Kb(a,olympe.sc.logic.qb.T))?d:a.db.Kb(a,olympe.sc.logic.qb.J),f=a.db.Kb(a,olympe.sc.logic.qb.O);if(null!==e&&null!==f){d=a.db.If(pn(a),olympe.dm.ye)?new olympe.D.Xb('Pipe Context'):null;const k=a.C.bind(a,c,d);let l;const n=b.Nk(f,p=>{let q;null==(q=l)||q();l=p.on(e,k,f)});return()=>{k(null);n();let p;null==(p=l)||p()}}const g=k=>c(olympe.dc.nb.Ac(k)),h=Cg(a.db,a,olympe.sc.logic.qb.valueProp,g);return()=>{g(null);Dg(a.db,a,olympe.sc.logic.qb.valueProp,
1076
+ h)}}function pn(a){let b=null,c=a.db.Kb(a,olympe.sc.logic.qb.F);c?b=a.db.Kb(c,olympe.dm.Property.typeRel):(c=a.db.Kb(a,olympe.sc.logic.qb.C))&&(b=a.db.Kb(c,olympe.sc.logic.Tb.typeRel));return b||olympe.dc.ga(olympe.dc.CloudObject)}
1075
1077
  olympe.sc.logic.qb=class extends olympe.dc.CloudObject{constructor(a,b,c){super(a,b);this.H=c}C(a,b,c){const d=olympe.sc.Zi(c);null==b||b.ja();b&&d instanceof olympe.dm.ye?null==b||b.run(()=>{olympe.D.Nc([d.getValue()],e=>{a(e.valueOf())})}):a(d)}getValue(a){return this.Hf(olympe.sc.logic.qb.valueProp,a||olympe.dc.nb.Zi,Object)}getType(){const a=this.transform(olympe.sc.logic.qb.C,olympe.sc.logic.Tb.typeRel);a.Hd(olympe.dc.CloudObject);return a.Fc()}Tx(){return this.pc(olympe.sc.logic.qb.O,olympe.dc.CloudObject)}Rx(){return this.pc(olympe.sc.logic.qb.T,
1076
1078
  olympe.sc.logic.Bb)}Sx(){return this.pc(olympe.sc.logic.qb.J,olympe.dm.Property)}nx(){return this.pc(olympe.sc.logic.qb.G,olympe.dc.CloudObject)}lx(){return this.pc(olympe.sc.logic.qb.C,olympe.sc.logic.ub)}mx(){return this.pc(olympe.sc.logic.qb.F,olympe.dm.Property)}};olympe.sc.logic.qb.P=olympe.dc.na.C('0168a431d91f25780000',olympe.sc.logic.qb,olympe.sc.R.Ca);olympe.sc.logic.qb.valueProp=olympe.sc.logic.qb.P.la('0168a431d91f25780001');olympe.sc.logic.qb.O=olympe.sc.logic.qb.P.sa('0168a431d91f25780002');
1077
1079
  olympe.sc.logic.qb.T=T(olympe.sc.logic.qb.P,olympe.sc.logic.Bb.F);olympe.sc.logic.qb.J=olympe.sc.logic.qb.P.sa('0168a431d91f25780004');olympe.sc.logic.qb.G=olympe.sc.logic.qb.P.sa('0168a431d91f2578000a');olympe.sc.logic.qb.C=T(olympe.sc.logic.qb.P,olympe.sc.logic.ub.F);olympe.sc.logic.qb.F=olympe.sc.logic.qb.P.sa('0168a431d91f2578000c');T(olympe.dc.CloudObject.P,olympe.sc.logic.qb.O);T(olympe.dm.Property.P,olympe.sc.logic.qb.J);T(olympe.dc.CloudObject.P,olympe.sc.logic.qb.G);
1078
- T(olympe.dm.Property.P,olympe.sc.logic.qb.F);m=olympe.sc.logic.qb.prototype;m.getType.L=new olympe.D.K(()=>olympe.dc.CloudObject,[]);m.Tx.L=new olympe.D.K(()=>olympe.dc.CloudObject,[]);m.Rx.L=new olympe.D.K(()=>olympe.sc.logic.Bb,[]);m.Sx.L=new olympe.D.K(()=>olympe.dm.Property,[]);m.nx.L=new olympe.D.K(()=>olympe.dc.CloudObject,[]);m.lx.L=new olympe.D.K(()=>olympe.sc.logic.ub,[]);m.mx.L=new olympe.D.K(()=>olympe.dm.Property,[]);function rn(a,b){const c=a.vd(),d=c.Il().X(),e=c.Jl().X(),f=c.Kl().X();b.on(d,g=>{if(g){g=new Map(a.getInputs().map(k=>[k,b.get(k)]));const h={timeout:a.timeout};olympe.N.wb.get(a.cc(),g,h).then(k=>{for(const [l,n]of k)l!==e&&l!==f&&b.set(l,n);b.set(e,k.get(e));k=k.get(f);k instanceof olympe.sc.logic.Error&&(k=Am(k.message,k.code,k.ke()+'\n===== Remote Call =====\n'+b.ke()),b.throw(k))}).catch(k=>{k=`RemoteAction "${a.Vb().name()}" (${a.tag}) encountered an error:\n${k}`;a.H.error(k);b.throw(olympe.sc.logic.Error.create(k,
1080
+ T(olympe.dm.Property.P,olympe.sc.logic.qb.F);m=olympe.sc.logic.qb.prototype;m.getType.L=new olympe.D.K(()=>olympe.dc.CloudObject,[]);m.Tx.L=new olympe.D.K(()=>olympe.dc.CloudObject,[]);m.Rx.L=new olympe.D.K(()=>olympe.sc.logic.Bb,[]);m.Sx.L=new olympe.D.K(()=>olympe.dm.Property,[]);m.nx.L=new olympe.D.K(()=>olympe.dc.CloudObject,[]);m.lx.L=new olympe.D.K(()=>olympe.sc.logic.ub,[]);m.mx.L=new olympe.D.K(()=>olympe.dm.Property,[]);function qn(a,b){const c=a.vd(),d=c.Il().X(),e=c.Jl().X(),f=c.Kl().X();b.on(d,g=>{if(g){g=new Map(a.getInputs().map(k=>[k,b.get(k)]));const h={timeout:a.timeout};olympe.N.wb.get(a.cc(),g,h).then(k=>{for(const [l,n]of k)l!==e&&l!==f&&b.set(l,n);b.set(e,k.get(e));k=k.get(f);k instanceof olympe.sc.logic.Error&&(k=zm(k.message,k.code,k.ke()+'\n===== Remote Call =====\n'+b.ke()),b.throw(k))}).catch(k=>{k=`RemoteAction "${a.Vb().name()}" (${a.tag}) encountered an error:\n${k}`;a.H.error(k);b.throw(olympe.sc.logic.Error.create(k,
1079
1081
  400))})}},b.U())}
1080
- function sn(a,b,c,d,e,f){const g=n=>v(function*(){if(null!==n){e.cancel();let p;null==(p=k)||p();let q;null==(q=l)||q();try{const r=new Map(a.getOutputs().map(t=>[t,b.get(t)]));yield f.qd(r)}catch(r){const t=Error(`Error while trying to send the response of remote action ${a.Vb().name()} (${a.cc()}): ${r}`);f.Th(t).catch(u=>{a.H.error(`Cannot reply with an error to a remote action call ${a.Vb().name()} (${a.cc()}): ${u}`)})}finally{b.destroy()}}}),h=b.U(),k=b.on(c,g,h),l=b.on(d,g,h)}
1081
- olympe.sc.logic.Fh=class extends olympe.sc.logic.Function{constructor(a,b,c,d){super(a,b,c);this.timeout=d}run(a){let b;null!=(b=a.Na(olympe.sc.xa.C.EDITION))&&b||(this.db.Sa(this,olympe.sc.logic.Fh.F)?(Om(a.C,this),this.ua(a)):(an(this,a),rn(this,a)))}ua(a){const b=this.cc(),c=this.vd(),d=c.xp().X(),e=c.Il().X(),f=c.Jl().X(),g=c.Kl().X();(new olympe.N.wb(b,a)).listen().subscribe(rxjs.Subscriber.create(h=>{const k=a.Rh('remote call'),l=h.body(),n=mc(()=>{h.Th(Error(`Timeout reached on remote action ${this.db.name(this)} (${this.tag})`));
1082
- k.destroy()},this.timeout);sn(this,k,f,g,n,h);super.run(k);for(const [p,q]of l)p!==e&&k.set(p,q);h.ei().then(p=>{var q=k.get(d);null!==q&&olympe.dc.ga(q)!==p&&(q=this.cc(),this.H.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))}).catch(p=>{const q=this.cc();this.H.warn(`Remote action ${this.db.name(q)} ${q} Triggered by unrecognized user: ${p}.`);k.set(g,olympe.sc.logic.Error.create('Unrecognized User',
1083
- 1))})},h=>{const k=this.cc();this.H.error(`Error while listening on remote action ${this.db.name(k)} (${k}): ${h.message}`)}))}};olympe.sc.logic.Fh.P=olympe.dc.na.C('017a7b0c5dcbd8964c5d',olympe.sc.logic.Fh,olympe.sc.R.Ca,new olympe.W.oa(olympe.sc.V.vq));olympe.sc.logic.Fh.F=olympe.sc.logic.Fh.P.la('017a7b0c62a02a89444f');olympe.sc.logic.controllers={};olympe.sc.logic.controllers.Fl=class{constructor(a){this.db=olympe.dc.ia();this.typeRel=a}};olympe.sc.logic.controllers.Fl.C={Nz:-1,NA:1};olympe.sc.logic.controllers.EB=class extends olympe.sc.logic.controllers.Fl{constructor(){super(olympe.sc.logic.ed.C)}};olympe.sc.logic.controllers.MB=class extends olympe.sc.logic.controllers.Fl{constructor(){super(olympe.sc.logic.Tb.typeRel)}};olympe.sc.logic.yk={};olympe.sc.logic.yk.Gv=class extends olympe.sc.logic.Function{update(a,[b],[c]){const d=olympe.dc.ga(b);d?olympe.dc.pa.Ob(a,d,olympe.dc.Nb.Yf).subscribe(()=>{c(olympe.dc.CloudObject.get(d))}):this.H.warn('Cannot subscribe to an instance with no tag: '+d)}};olympe.sc.logic.na.C('0174bf4b7e006e4b788a',olympe.sc.logic.yk.Gv);olympe.sc.logic.actions={};olympe.sc.logic.yk.yu=class extends olympe.sc.logic.Function{run(a){an(this,a);const [b,c,d]=this.C(a);let e,f=null,g=null;const h=a.getParent(),k=()=>{null===g||0===e?(this.H.warn('No list to iter upon'),this.H.info(a.U())):f<e?(b(g.Ze(f)),f++,c(Date.now())):(Qm(h.C),d(Date.now()))};this.getInputs().forEach((l,n)=>a.on(l,p=>{if(p)switch(n){case 0:g=p;break;case 1:e=g.fg();f=0;Pm(h.C);k();break;case 2:k();break;default:this.H.error('Unhandled input')}},this.tag))}};
1084
- olympe.sc.logic.na.C('0171889b060b6cd54300',olympe.sc.logic.yk.yu);olympe.sc.logic.Qb={};olympe.sc.logic.Qb.sl=class extends olympe.sc.logic.sd{J(){return this.C('016ac638085357047a2d')}};olympe.sc.logic.Qb.sl.P=pn('0169b6876a03f14ae61b',olympe.sc.logic.Qb.sl);olympe.sc.logic.Qb.sl.prototype.J.L=new olympe.D.K(()=>olympe.sc.logic.ub,[]);olympe.sc.logic.Qb.Gl=class extends olympe.sc.logic.sd{J(){return this.C('016ac63808535703691c')}};olympe.sc.logic.Qb.Gl.P=pn('0169b6876a03f139d50a',olympe.sc.logic.Qb.Gl);olympe.sc.logic.Qb.Gl.prototype.J.L=new olympe.D.K(()=>olympe.sc.logic.ub,[]);olympe.sc.logic.Qb.Wl=class extends olympe.sc.logic.sd{J(){return this.C('016ac63809a9a8e6db96')}O(){return this.F('016ac6380ab003363b3e')}};pn('01646ad602f933b8caaf',olympe.sc.logic.Qb.Wl);olympe.sc.logic.Qb.Wl.prototype.J.L=new olympe.D.K(()=>olympe.sc.logic.ub,[]);olympe.sc.logic.Qb.Wl.prototype.O.L=new olympe.D.K(()=>olympe.sc.logic.Bb,[]);olympe.sc.logic.Qb.Uj=class extends olympe.sc.logic.sd{J(){return this.C('016ac6380bd98f1d91a0')}T(){return this.F('016ac63c589ae38ca3ae')}O(){return this.F('016ac63c5a377fceabaa')}};pn('0168ec42fc01747a98b6',olympe.sc.logic.Qb.Uj);olympe.sc.logic.Qb.Uj.prototype.J.L=new olympe.D.K(()=>olympe.sc.logic.ub,[]);olympe.sc.logic.Qb.Uj.prototype.T.L=new olympe.D.K(()=>olympe.sc.logic.Bb,[]);olympe.sc.logic.Qb.Uj.prototype.O.L=new olympe.D.K(()=>olympe.sc.logic.Bb,[]);olympe.sc.logic.Qb.Fg=class extends olympe.sc.logic.sd{Il(){return this.C('017a7b07b09e3b22c8b4')}xp(){return this.C('017a7b07ba05807a74b0')}Jl(){return this.F('017a7b0818c12388d731')}Kl(){return this.F('017a7b085146d5e69aec')}hu(){return olympe.D.fa.F}};olympe.sc.logic.Qb.Fg.J='017a7b07b09e3b22c8b4';olympe.sc.logic.Qb.Fg.Ub='017a7b07ba05807a74b0';olympe.sc.logic.Qb.Fg.ja='017a7b0818c12388d731';olympe.sc.logic.Qb.Fg.C='017a7b085146d5e69aec';
1085
- olympe.sc.logic.Qb.Fg.P=pn('017a7b07a948e30508fa',olympe.sc.logic.Qb.Fg,olympe.sc.logic.Fh);m=olympe.sc.logic.Qb.Fg.prototype;m.Il.L=new olympe.D.K(()=>olympe.sc.logic.ub,[]);m.xp.L=new olympe.D.K(()=>olympe.sc.logic.ub,[]);m.Jl.L=new olympe.D.K(()=>olympe.sc.logic.Bb,[]);m.Kl.L=new olympe.D.K(()=>olympe.sc.logic.Bb,[]);m.hu.L=olympe.D.K.O;olympe.sc.logic.Qb.Vq=class extends olympe.sc.logic.sd{J(){return this.C('016ac63c5b3ed0562740')}};pn('016a9766c230916ea5ec',olympe.sc.logic.Qb.Vq);olympe.sc.logic.Qb.Vq.prototype.J.L=new olympe.D.K(()=>olympe.sc.logic.ub,[]);olympe.sc.query={};olympe.sc.query.Hn=class extends olympe.sc.yg{};olympe.sc.query.Hn.P=olympe.dc.na.C('01631aacd8276ea98491',olympe.sc.query.Hn);olympe.sc.query.cq=class extends olympe.dm.Enum{};olympe.sc.query.cq.P=olympe.dc.na.C('01631aacd8276ea98495',olympe.sc.query.cq);olympe.sc.query.nq=class extends olympe.dm.Enum{};olympe.sc.query.nq.P=olympe.dc.na.C('01631aacd8276ea98494',olympe.sc.query.nq);olympe.sc.query.qq=class extends olympe.sc.yg{};olympe.sc.query.qq.P=olympe.dc.na.C('01631aacd8276ea98492',olympe.sc.query.qq);olympe.sc.query.Zc=class extends olympe.dc.CloudObject{};olympe.sc.query.Zc.P=olympe.dc.na.C('01631aacd8276ea98493',olympe.sc.query.Zc);olympe.sc.io=class extends olympe.dc.CloudObject{};olympe.sc.io.P=olympe.dc.na.C('018312ceeb3e93618a85',olympe.sc.io);olympe.sc.workflow={};olympe.sc.workflow.ObjectState=class extends olympe.dc.CloudObject{};olympe.sc.workflow.ObjectState.P=olympe.dc.na.C('017ffdd8f0b1e31fe138',olympe.sc.workflow.ObjectState);olympe.sc.workflow.ObjectState.workflowProp=olympe.sc.workflow.ObjectState.P.la('017ffdd8f0b1e31fe13e');olympe.sc.workflow.ObjectState.stateProp=olympe.sc.workflow.ObjectState.P.la('017ffdd8f0b1e31fe139');olympe.sc.workflow.ObjectState.assigneeProp=olympe.sc.workflow.ObjectState.P.la('017ffdd8f0b1e31fe13a');
1086
- olympe.sc.workflow.ObjectState.dateTimeProp=olympe.sc.workflow.ObjectState.P.la('017ffdd8f0b1e31fe13b');olympe.sc.workflow.ObjectState.serializedObjectProp=olympe.sc.workflow.ObjectState.P.la('017ffdd8f0b1e31fe13d');olympe.sc.workflow.ObjectState.objectRel=olympe.sc.workflow.ObjectState.P.sa('017ffdd8f0b1e31fe13c');olympe.sc.workflow.ObjectState.currentObjectRel=olympe.sc.workflow.ObjectState.P.sa('017ffdd8f0b1e31fe13f');olympe.sc.workflow.rf=class extends olympe.sc.logic.sd{iu(){return this.C('017ffe02381f9fac5060')}lu(){return this.C('017ffe02381f9fac5061')}mu(){return this.C('017ffe02381f9fac5062')}jx(){return this.C('017ffe02381f9fac5065')}ju(){return this.F('017ffe02381f9fac5063')}ku(){return this.F('017ffe02381f9fac5064')}};olympe.sc.workflow.rf.P=pn('017ffde21f5fe0f704ce',olympe.sc.workflow.rf);olympe.sc.workflow.rf.C='017ffe02381f9fac5060';olympe.sc.workflow.rf.Ud='017ffe02381f9fac5061';
1082
+ function rn(a,b,c,d,e,f){const g=n=>v(function*(){if(null!==n){e.cancel();let p;null==(p=k)||p();let q;null==(q=l)||q();try{const r=new Map(a.getOutputs().map(t=>[t,b.get(t)]));yield f.qd(r)}catch(r){const t=Error(`Error while trying to send the response of remote action ${a.Vb().name()} (${a.cc()}): ${r}`);f.Th(t).catch(u=>{a.H.error(`Cannot reply with an error to a remote action call ${a.Vb().name()} (${a.cc()}): ${u}`)})}finally{b.destroy()}}}),h=b.U(),k=b.on(c,g,h),l=b.on(d,g,h)}
1083
+ olympe.sc.logic.Fh=class extends olympe.sc.logic.Function{constructor(a,b,c,d){super(a,b,c);this.timeout=d}run(a){let b;null!=(b=a.Na(olympe.sc.xa.C.EDITION))&&b||(this.db.Oa(this,olympe.sc.logic.Fh.F)?(Nm(a.C,this),this.ua(a)):($m(this,a),qn(this,a)))}ua(a){const b=this.cc(),c=this.vd(),d=c.xp().X(),e=c.Il().X(),f=c.Jl().X(),g=c.Kl().X();(new olympe.N.wb(b,a)).listen().subscribe(rxjs.Subscriber.create(h=>{const k=a.Rh('remote call'),l=h.body(),n=mc(()=>{h.Th(Error(`Timeout reached on remote action ${this.db.name(this)} (${this.tag})`));
1084
+ k.destroy()},this.timeout);rn(this,k,f,g,n,h);super.run(k);for(const [p,q]of l)p!==e&&k.set(p,q);h.ei().then(p=>{var q=k.get(d);null!==q&&olympe.dc.ga(q)!==p&&(q=this.cc(),this.H.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))}).catch(p=>{const q=this.cc();this.H.warn(`Remote action ${this.db.name(q)} ${q} Triggered by unrecognized user: ${p}.`);k.set(g,olympe.sc.logic.Error.create('Unrecognized User',
1085
+ 1))})},h=>{const k=this.cc();this.H.error(`Error while listening on remote action ${this.db.name(k)} (${k}): ${h.message}`)}))}};olympe.sc.logic.Fh.P=olympe.dc.na.C('017a7b0c5dcbd8964c5d',olympe.sc.logic.Fh,olympe.sc.R.Ca,new olympe.W.oa(olympe.sc.V.vq));olympe.sc.logic.Fh.F=olympe.sc.logic.Fh.P.la('017a7b0c62a02a89444f');olympe.sc.logic.controllers={};olympe.sc.logic.controllers.Fl=class{constructor(a){this.db=olympe.dc.ia();this.typeRel=a}};olympe.sc.logic.controllers.Fl.C={Nz:-1,NA:1};olympe.sc.logic.controllers.EB=class extends olympe.sc.logic.controllers.Fl{constructor(){super(olympe.sc.logic.ed.C)}};olympe.sc.logic.controllers.MB=class extends olympe.sc.logic.controllers.Fl{constructor(){super(olympe.sc.logic.Tb.typeRel)}};olympe.sc.logic.yk={};olympe.sc.logic.yk.Gv=class extends olympe.sc.logic.Function{update(a,[b],[c]){const d=olympe.dc.ga(b);d?olympe.dc.pa.Ob(a,d,olympe.dc.Nb.Yf).subscribe(()=>{c(olympe.dc.CloudObject.get(d))}):this.H.warn('Cannot subscribe to an instance with no tag: '+d)}};olympe.sc.logic.na.C('0174bf4b7e006e4b788a',olympe.sc.logic.yk.Gv);olympe.sc.logic.actions={};olympe.sc.logic.yk.yu=class extends olympe.sc.logic.Function{run(a){$m(this,a);const [b,c,d]=this.C(a);let e,f=null,g=null;const h=a.getParent(),k=()=>{null===g||0===e?(this.H.warn('No list to iter upon'),this.H.info(a.U())):f<e?(b(g.Ze(f)),f++,c(Date.now())):(Pm(h.C),d(Date.now()))};this.getInputs().forEach((l,n)=>a.on(l,p=>{if(p)switch(n){case 0:g=p;break;case 1:e=g.fg();f=0;Om(h.C);k();break;case 2:k();break;default:this.H.error('Unhandled input')}},this.tag))}};
1086
+ olympe.sc.logic.na.C('0171889b060b6cd54300',olympe.sc.logic.yk.yu);olympe.sc.logic.Qb={};olympe.sc.logic.Qb.sl=class extends olympe.sc.logic.sd{J(){return this.C('016ac638085357047a2d')}};olympe.sc.logic.Qb.sl.P=on('0169b6876a03f14ae61b',olympe.sc.logic.Qb.sl);olympe.sc.logic.Qb.sl.prototype.J.L=new olympe.D.K(()=>olympe.sc.logic.ub,[]);olympe.sc.logic.Qb.Gl=class extends olympe.sc.logic.sd{J(){return this.C('016ac63808535703691c')}};olympe.sc.logic.Qb.Gl.P=on('0169b6876a03f139d50a',olympe.sc.logic.Qb.Gl);olympe.sc.logic.Qb.Gl.prototype.J.L=new olympe.D.K(()=>olympe.sc.logic.ub,[]);olympe.sc.logic.Qb.Wl=class extends olympe.sc.logic.sd{J(){return this.C('016ac63809a9a8e6db96')}O(){return this.F('016ac6380ab003363b3e')}};on('01646ad602f933b8caaf',olympe.sc.logic.Qb.Wl);olympe.sc.logic.Qb.Wl.prototype.J.L=new olympe.D.K(()=>olympe.sc.logic.ub,[]);olympe.sc.logic.Qb.Wl.prototype.O.L=new olympe.D.K(()=>olympe.sc.logic.Bb,[]);olympe.sc.logic.Qb.Uj=class extends olympe.sc.logic.sd{J(){return this.C('016ac6380bd98f1d91a0')}T(){return this.F('016ac63c589ae38ca3ae')}O(){return this.F('016ac63c5a377fceabaa')}};on('0168ec42fc01747a98b6',olympe.sc.logic.Qb.Uj);olympe.sc.logic.Qb.Uj.prototype.J.L=new olympe.D.K(()=>olympe.sc.logic.ub,[]);olympe.sc.logic.Qb.Uj.prototype.T.L=new olympe.D.K(()=>olympe.sc.logic.Bb,[]);olympe.sc.logic.Qb.Uj.prototype.O.L=new olympe.D.K(()=>olympe.sc.logic.Bb,[]);olympe.sc.logic.Qb.Fg=class extends olympe.sc.logic.sd{Il(){return this.C('017a7b07b09e3b22c8b4')}xp(){return this.C('017a7b07ba05807a74b0')}Jl(){return this.F('017a7b0818c12388d731')}Kl(){return this.F('017a7b085146d5e69aec')}hu(){return olympe.D.fa.F}};olympe.sc.logic.Qb.Fg.J='017a7b07b09e3b22c8b4';olympe.sc.logic.Qb.Fg.Ub='017a7b07ba05807a74b0';olympe.sc.logic.Qb.Fg.ja='017a7b0818c12388d731';olympe.sc.logic.Qb.Fg.C='017a7b085146d5e69aec';
1087
+ olympe.sc.logic.Qb.Fg.P=on('017a7b07a948e30508fa',olympe.sc.logic.Qb.Fg,olympe.sc.logic.Fh);m=olympe.sc.logic.Qb.Fg.prototype;m.Il.L=new olympe.D.K(()=>olympe.sc.logic.ub,[]);m.xp.L=new olympe.D.K(()=>olympe.sc.logic.ub,[]);m.Jl.L=new olympe.D.K(()=>olympe.sc.logic.Bb,[]);m.Kl.L=new olympe.D.K(()=>olympe.sc.logic.Bb,[]);m.hu.L=olympe.D.K.O;olympe.sc.logic.Qb.Vq=class extends olympe.sc.logic.sd{J(){return this.C('016ac63c5b3ed0562740')}};on('016a9766c230916ea5ec',olympe.sc.logic.Qb.Vq);olympe.sc.logic.Qb.Vq.prototype.J.L=new olympe.D.K(()=>olympe.sc.logic.ub,[]);olympe.sc.query={};olympe.sc.query.Hn=class extends olympe.sc.yg{};olympe.sc.query.Hn.P=olympe.dc.na.C('01631aacd8276ea98491',olympe.sc.query.Hn);olympe.sc.query.cq=class extends olympe.dm.Enum{};olympe.sc.query.cq.P=olympe.dc.na.C('01631aacd8276ea98495',olympe.sc.query.cq);olympe.sc.query.nq=class extends olympe.dm.Enum{};olympe.sc.query.nq.P=olympe.dc.na.C('01631aacd8276ea98494',olympe.sc.query.nq);olympe.sc.query.qq=class extends olympe.sc.yg{};olympe.sc.query.qq.P=olympe.dc.na.C('01631aacd8276ea98492',olympe.sc.query.qq);olympe.sc.query.Zc=class extends olympe.dc.CloudObject{};olympe.sc.query.Zc.P=olympe.dc.na.C('01631aacd8276ea98493',olympe.sc.query.Zc);olympe.sc.io=class extends olympe.dc.CloudObject{};olympe.sc.io.P=olympe.dc.na.C('018312ceeb3e93618a85',olympe.sc.io);olympe.sc.workflow={};olympe.sc.workflow.ObjectState=class extends olympe.dc.CloudObject{};olympe.sc.workflow.ObjectState.P=olympe.dc.na.C('017ffdd8f0b1e31fe138',olympe.sc.workflow.ObjectState);olympe.sc.workflow.ObjectState.workflowProp=olympe.sc.workflow.ObjectState.P.la('017ffdd8f0b1e31fe13e');olympe.sc.workflow.ObjectState.stateProp=olympe.sc.workflow.ObjectState.P.la('017ffdd8f0b1e31fe139');olympe.sc.workflow.ObjectState.assigneeProp=olympe.sc.workflow.ObjectState.P.la('017ffdd8f0b1e31fe13a');
1088
+ olympe.sc.workflow.ObjectState.dateTimeProp=olympe.sc.workflow.ObjectState.P.la('017ffdd8f0b1e31fe13b');olympe.sc.workflow.ObjectState.serializedObjectProp=olympe.sc.workflow.ObjectState.P.la('017ffdd8f0b1e31fe13d');olympe.sc.workflow.ObjectState.objectRel=olympe.sc.workflow.ObjectState.P.sa('017ffdd8f0b1e31fe13c');olympe.sc.workflow.ObjectState.currentObjectRel=olympe.sc.workflow.ObjectState.P.sa('017ffdd8f0b1e31fe13f');olympe.sc.workflow.rf=class extends olympe.sc.logic.sd{iu(){return this.C('017ffe02381f9fac5060')}lu(){return this.C('017ffe02381f9fac5061')}mu(){return this.C('017ffe02381f9fac5062')}jx(){return this.C('017ffe02381f9fac5065')}ju(){return this.F('017ffe02381f9fac5063')}ku(){return this.F('017ffe02381f9fac5064')}};olympe.sc.workflow.rf.P=on('017ffde21f5fe0f704ce',olympe.sc.workflow.rf);olympe.sc.workflow.rf.C='017ffe02381f9fac5060';olympe.sc.workflow.rf.Ud='017ffe02381f9fac5061';
1087
1089
  olympe.sc.workflow.rf.Vd='017ffe02381f9fac5062';olympe.sc.workflow.rf.ja='017ffe02381f9fac5065';olympe.sc.workflow.rf.J='017ffe02381f9fac5063';olympe.sc.workflow.rf.Ub='017ffe02381f9fac5064';m=olympe.sc.workflow.rf.prototype;m.iu.L=new olympe.D.K(()=>olympe.sc.logic.ub,[]);m.lu.L=new olympe.D.K(()=>olympe.sc.logic.ub,[]);m.mu.L=new olympe.D.K(()=>olympe.sc.logic.ub,[]);m.jx.L=new olympe.D.K(()=>Map,[]);m.ju.L=new olympe.D.K(()=>olympe.sc.logic.Bb,[]);m.ku.L=new olympe.D.K(()=>olympe.sc.logic.Bb,[]);olympe.sc.workflow.Te=class extends olympe.dm.BrickMetadata{Oc(){return this.pc(olympe.sc.workflow.Workflow.statesRel.bc(),olympe.sc.workflow.Workflow).ma().concat(['.',this.ma()])}};olympe.sc.workflow.Te.P=olympe.dc.na.C('017ffdc2dda51d46b430',olympe.sc.workflow.Te);olympe.sc.workflow.Transition=class extends olympe.dc.CloudObject{F(){return this.Wr()}C(){return this.pc(olympe.sc.workflow.Transition.fromStateRel,olympe.sc.workflow.Te)}G(){return this.pc(olympe.sc.workflow.Transition.toStateRel,olympe.sc.workflow.Te)}Oc(){const a=this.pc(olympe.sc.workflow.Transition.fromStateRel,olympe.sc.workflow.Te);return a.pc(olympe.sc.workflow.Workflow.statesRel.bc(),olympe.sc.workflow.Workflow).ma().concat(['.',a.ma(),'->',this.ma()])}};
1088
1090
  olympe.sc.workflow.Transition.P=olympe.dc.na.C('017ffdc633219f16beea',olympe.sc.workflow.Transition);olympe.sc.workflow.Transition.processRefProp=olympe.sc.workflow.Transition.P.la('017ffdc633219f16beec');olympe.sc.workflow.Transition.fromStateRel=olympe.sc.workflow.Transition.P.sa('017ffdc2dda51d46b431');olympe.sc.workflow.Transition.toStateRel=olympe.sc.workflow.Transition.P.sa('017ffdc633219f16beeb');olympe.sc.workflow.Transition.prototype.F.L=new olympe.D.K(()=>olympe.dc.CloudObject,[]);
1089
1091
  olympe.sc.workflow.Transition.prototype.C.L=new olympe.D.K(()=>olympe.sc.workflow.Te,[]);olympe.sc.workflow.Transition.prototype.G.L=new olympe.D.K(()=>olympe.sc.workflow.Te,[]);olympe.sc.workflow.Workflow=class extends olympe.dm.BrickMetadata{ne(){return olympe.sc.pe.De.ih}G(){return this.Ug(olympe.sc.workflow.Workflow.serializationEnabledProp)}C(){return this.pc(olympe.sc.workflow.Workflow.dataTypeRel,olympe.sc.yc)}F(){return this.pc(olympe.sc.workflow.Workflow.initialStateRel,olympe.sc.workflow.Te)}};olympe.sc.workflow.Workflow.P=olympe.dc.na.C('017ffdc010e5bcc9c971',olympe.sc.workflow.Workflow);olympe.sc.workflow.Workflow.serializationEnabledProp=olympe.sc.workflow.Workflow.P.la('017ffdc010e5bcc9c972');
1090
1092
  olympe.sc.workflow.Workflow.dataTypeRel=olympe.sc.workflow.Workflow.P.sa('017ffdc010e5bcc9c973');olympe.sc.workflow.Workflow.statesRel=olympe.sc.workflow.Workflow.P.sa('017ffdc010e5bcc9c974');olympe.sc.workflow.Workflow.initialStateRel=olympe.sc.workflow.Workflow.P.sa('017ffdc010e5bcc9c975');olympe.sc.workflow.Workflow.prototype.G.L=olympe.D.K.O;olympe.sc.workflow.Workflow.prototype.C.L=new olympe.D.K(()=>olympe.sc.yc,[]);
1091
- olympe.sc.workflow.Workflow.prototype.F.L=new olympe.D.K(()=>olympe.sc.workflow.Te,[]);olympe.sc.qa={};olympe.sc.qa.Rc=class extends olympe.sc.Va{ne(){return olympe.sc.pe.De.pv}};olympe.sc.qa.Rc.P=olympe.dc.na.C('01120300000000adef00',olympe.sc.qa.Rc);olympe.sc.qa.Rc.C=olympe.sc.qa.Rc.P.sa('0171bc1f15da96dfdb89');olympe.sc.qa.Rc.ja=olympe.sc.qa.Rc.P.sa('0171bc1f15da96dfdb90');T(olympe.dm.Ic.P,olympe.sc.qa.Rc.C);olympe.sc.qa.hi=class extends olympe.sc.Runnable{G(){return[this.cc()]}ua(){return olympe.dc.gd.from(this.cc()).hb(olympe.sc.qa.Rc.C).md()}};olympe.sc.qa.hi.P=Hf(olympe.dc.na.C('0113030000000aca1100',olympe.sc.qa.hi));olympe.sc.qa.hi.prototype.ua.L=new olympe.D.K(()=>olympe.dm.kb,[]);olympe.sc.qa.mb=class extends olympe.dc.CloudObject{ou(){return this.Ug(olympe.sc.qa.mb.Oh)}yy(){return this.Ug(olympe.sc.qa.mb.ja)}Gc(){return this.nd(olympe.sc.qa.mb.C)}px(){return this.zb(olympe.sc.qa.mb.J)}Lx(){return this.zb(olympe.sc.qa.mb.ea)}Kx(){return this.zb(olympe.sc.qa.mb.Z)}Df(){return this.zb(olympe.sc.qa.mb.aa)}Ax(){return this.zb(olympe.sc.qa.mb.O)}Ww(){return this.zb(olympe.sc.qa.mb.F)}Jx(){return this.zb(olympe.sc.qa.mb.T)}nu(){return this.zb(olympe.sc.qa.mb.G)}};
1093
+ olympe.sc.workflow.Workflow.prototype.F.L=new olympe.D.K(()=>olympe.sc.workflow.Te,[]);olympe.sc.qa={};olympe.sc.qa.Rc=class extends olympe.sc.Va{ne(){return olympe.sc.pe.De.pv}};olympe.sc.qa.Rc.P=olympe.dc.na.C('01120300000000adef00',olympe.sc.qa.Rc);olympe.sc.qa.Rc.C=olympe.sc.qa.Rc.P.sa('0171bc1f15da96dfdb89');olympe.sc.qa.Rc.ja=olympe.sc.qa.Rc.P.sa('0171bc1f15da96dfdb90');T(olympe.dm.Ic.P,olympe.sc.qa.Rc.C);olympe.sc.qa.hi=class extends olympe.sc.Runnable{G(){return[this.cc()]}ua(){return olympe.dc.gd.from(this.cc()).ib(olympe.sc.qa.Rc.C).md()}};olympe.sc.qa.hi.P=Hf(olympe.dc.na.C('0113030000000aca1100',olympe.sc.qa.hi));olympe.sc.qa.hi.prototype.ua.L=new olympe.D.K(()=>olympe.dm.kb,[]);olympe.sc.qa.mb=class extends olympe.dc.CloudObject{ou(){return this.Ug(olympe.sc.qa.mb.Oh)}yy(){return this.Ug(olympe.sc.qa.mb.ja)}Gc(){return this.nd(olympe.sc.qa.mb.C)}px(){return this.zb(olympe.sc.qa.mb.J)}Lx(){return this.zb(olympe.sc.qa.mb.ea)}Kx(){return this.zb(olympe.sc.qa.mb.Z)}Df(){return this.zb(olympe.sc.qa.mb.aa)}Ax(){return this.zb(olympe.sc.qa.mb.O)}Ww(){return this.zb(olympe.sc.qa.mb.F)}Jx(){return this.zb(olympe.sc.qa.mb.T)}nu(){return this.zb(olympe.sc.qa.mb.G)}};
1092
1094
  olympe.sc.qa.mb.P=olympe.dc.na.C('011203300000000adef5',olympe.sc.qa.mb);olympe.sc.qa.mb.Oh=olympe.sc.qa.mb.P.la('011203300000000adef6');olympe.sc.qa.mb.ja=olympe.sc.qa.mb.P.la('011203300000000adef7');olympe.sc.qa.mb.C=olympe.sc.qa.mb.P.la('011203300000000adef8');olympe.sc.qa.mb.J=olympe.sc.qa.mb.P.la('011203300000000adef9');olympe.sc.qa.mb.ea=olympe.sc.qa.mb.P.la('011203300000000adefa');olympe.sc.qa.mb.Z=olympe.sc.qa.mb.P.la('011203300000000adefb');olympe.sc.qa.mb.F=olympe.sc.qa.mb.P.la('011203300000000adefc');
1093
- olympe.sc.qa.mb.aa=olympe.sc.qa.mb.P.la('011203300000000adefd');olympe.sc.qa.mb.O=olympe.sc.qa.mb.P.la('011203300000000adefe');olympe.sc.qa.mb.T=olympe.sc.qa.mb.P.la('011203300000000adeff');olympe.sc.qa.mb.G=olympe.sc.qa.mb.P.la('011203300000000adee0');olympe.sc.qa.mb.Gb={INIT:0,Az:1,hk:2,gk:3,km:4,fC:5,xb:9};m=olympe.sc.qa.mb.prototype;m.ou.L=olympe.D.K.O;m.yy.L=olympe.D.K.O;m.Gc.L=olympe.D.K.G;m.px.L=olympe.D.K.F;m.Lx.L=olympe.D.K.F;m.Kx.L=olympe.D.K.F;m.Df.L=olympe.D.K.F;m.Ax.L=olympe.D.K.F;
1094
- m.Ww.L=olympe.D.K.F;m.Jx.L=olympe.D.K.F;m.nu.L=olympe.D.K.F;olympe.sc.qa.Bl=class extends olympe.sc.qa.hi{F(a){a.set(olympe.sc.xa.C.xn,!0);super.F(a)}ja(){return!0}};olympe.sc.qa.Bl.P=olympe.dc.na.C('0113032000000aca1102',olympe.sc.qa.Bl,olympe.sc.R.Ca);olympe.sc.qa.Se=class extends olympe.sc.qa.Rc{C(){return(new olympe.dc.Qj(this.X(),olympe.sc.qa.mb)).hb(olympe.sc.qa.Se.J).Bi().Fc()}};olympe.sc.qa.Se.P=olympe.dc.na.C('011203300000000adef3',olympe.sc.qa.Se);olympe.sc.qa.Se.J=olympe.sc.qa.Se.P.sa('011203300000000adef4');T(olympe.sc.qa.mb.P,olympe.sc.qa.Se.J);
1095
- olympe.sc.qa.Se.P.C=(a,b,c)=>{b=ll(a,b||'New Service Application model',olympe.sc.qa.Se,olympe.sc.qa.Bl);a.Ma(olympe.sc.qa.Rc.C,b,c);c=a.create(olympe.sc.qa.mb).X();a.Ma(olympe.sc.qa.Se.J,b,c);return b.X()};olympe.sc.qa.Se.prototype.C.L=new olympe.D.K(()=>olympe.sc.qa.mb,[]);olympe.sc.Lg=class extends olympe.dc.CloudObject{static get(){return olympe.dc.CloudObject.get('011203300000000adf0f')}};olympe.sc.Lg.P=olympe.dc.na.C('011203300000000adf00',olympe.sc.Lg);olympe.sc.Lg.F=olympe.sc.Lg.P.la('011203300000000adf01');olympe.sc.Lg.C=olympe.sc.Lg.P.la('011203300000000adf02');olympe.sc.Lg.G='011203300000000adf0f';olympe.sc.jg={};olympe.sc.jg.ny=a=>{var b=a.C;const c=olympe.dc.ia();var d=null;for(const e of b.ad())if((b=e.Vb())&&e.F()&&e.tb()===olympe.dc.Ra.SERVER&&bl(a,e.tag())&&c.Rb(b,olympe.sc.yc)){let f,g;null==d&&(d=null,null!==jn?d=jn:'string'===typeof hn&&(d=olympe.dc.gd.from(hn).hb(olympe.sc.qa.Rc.C).hb(olympe.sc.Wc.C.bc()).md()),d=null==(f=d)?void 0:f.X());d=null!=(g=d)?g:null;if(null===d)throw Error(`No business container for new instance of ${olympe.dc.ga(b)}`);a.Ma(olympe.sc.Wc.F.X(),d,e.tag())}};
1095
+ olympe.sc.qa.mb.aa=olympe.sc.qa.mb.P.la('011203300000000adefd');olympe.sc.qa.mb.O=olympe.sc.qa.mb.P.la('011203300000000adefe');olympe.sc.qa.mb.T=olympe.sc.qa.mb.P.la('011203300000000adeff');olympe.sc.qa.mb.G=olympe.sc.qa.mb.P.la('011203300000000adee0');olympe.sc.qa.mb.Hb={INIT:0,Az:1,hk:2,gk:3,km:4,fC:5,xb:9};m=olympe.sc.qa.mb.prototype;m.ou.L=olympe.D.K.O;m.yy.L=olympe.D.K.O;m.Gc.L=olympe.D.K.G;m.px.L=olympe.D.K.F;m.Lx.L=olympe.D.K.F;m.Kx.L=olympe.D.K.F;m.Df.L=olympe.D.K.F;m.Ax.L=olympe.D.K.F;
1096
+ m.Ww.L=olympe.D.K.F;m.Jx.L=olympe.D.K.F;m.nu.L=olympe.D.K.F;olympe.sc.qa.Bl=class extends olympe.sc.qa.hi{F(a){a.set(olympe.sc.xa.C.xn,!0);super.F(a)}ja(){return!0}};olympe.sc.qa.Bl.P=olympe.dc.na.C('0113032000000aca1102',olympe.sc.qa.Bl,olympe.sc.R.Ca);olympe.sc.qa.Se=class extends olympe.sc.qa.Rc{C(){return(new olympe.dc.Qj(this.X(),olympe.sc.qa.mb)).ib(olympe.sc.qa.Se.J).Bi().Fc()}};olympe.sc.qa.Se.P=olympe.dc.na.C('011203300000000adef3',olympe.sc.qa.Se);olympe.sc.qa.Se.J=olympe.sc.qa.Se.P.sa('011203300000000adef4');T(olympe.sc.qa.mb.P,olympe.sc.qa.Se.J);
1097
+ olympe.sc.qa.Se.P.C=(a,b,c)=>{b=kl(a,b||'New Service Application model',olympe.sc.qa.Se,olympe.sc.qa.Bl);a.Ma(olympe.sc.qa.Rc.C,b,c);c=a.create(olympe.sc.qa.mb).X();a.Ma(olympe.sc.qa.Se.J,b,c);return b.X()};olympe.sc.qa.Se.prototype.C.L=new olympe.D.K(()=>olympe.sc.qa.mb,[]);olympe.sc.Lg=class extends olympe.dc.CloudObject{static get(){return olympe.dc.CloudObject.get('011203300000000adf0f')}};olympe.sc.Lg.P=olympe.dc.na.C('011203300000000adf00',olympe.sc.Lg);olympe.sc.Lg.F=olympe.sc.Lg.P.la('011203300000000adf01');olympe.sc.Lg.C=olympe.sc.Lg.P.la('011203300000000adf02');olympe.sc.Lg.G='011203300000000adf0f';olympe.sc.jg={};olympe.sc.jg.ny=a=>{var b=a.C;const c=olympe.dc.ia();var d=null;for(const e of b.ad())if((b=e.Vb())&&e.F()&&e.tb()===olympe.dc.Sa.SERVER&&al(a,e.tag())&&c.Rb(b,olympe.sc.yc)){let f,g;null==d&&(d=null,null!==hn?d=hn:'string'===typeof gn&&(d=olympe.dc.gd.from(gn).ib(olympe.sc.qa.Rc.C).ib(olympe.sc.Wc.C.bc()).md()),d=null==(f=d)?void 0:f.X());d=null!=(g=d)?g:null;if(null===d)throw Error(`No business container for new instance of ${olympe.dc.ga(b)}`);a.Ma(olympe.sc.Wc.F.X(),d,e.tag())}};
1096
1098
  olympe.sc.jg.Ay=a=>{const b=a.C,c=olympe.dc.ia();for(const d of b.ad()){const e=d.Vb();e&&!d.zd()&&c.Rb(e,olympe.sc.yc)&&d.Cb().forEach((f,g)=>{if(f instanceof olympe.dc.uc){const l=b.Lc(f.X());if(null===l)throw Error(`Try to assign an instance as complex property which is not created within the same transaction: ${f.X()}`);var h;f=null!=(h=null==l?void 0:l.Vb())?h:null;h=l.tag();let n;if(f===olympe.dc.ga(olympe.sc.Kd)){h=l.Kb(olympe.sc.Kd.C);if(!h)throw Error('No object reference found for new ObjectRef');
1097
- var k;let p;f=null!=(p=null==(k=b.Lc(h))?void 0:k.Vb())?p:c.model(h)}if(c.If(f,olympe.dm.ye)){k=vm(f);let p;n=null!=(p=l.Sa(k.X()))?p:c.Sa(h,k)}if(void 0===n)throw Error(`Try to set a complex property to an instance of a DataType: ${c.name(e)} (${e})`);a.Qc(d.tag(),new Map([[g,n]]));fl(a,l.tag(),olympe.dc.Nb.Dc)}})}};
1099
+ var k;let p;f=null!=(p=null==(k=b.Lc(h))?void 0:k.Vb())?p:c.model(h)}if(c.If(f,olympe.dm.ye)){k=um(f);let p;n=null!=(p=l.Oa(k.X()))?p:c.Oa(h,k)}if(void 0===n)throw Error(`Try to set a complex property to an instance of a DataType: ${c.name(e)} (${e})`);a.Qc(d.tag(),new Map([[g,n]]));el(a,l.tag(),olympe.dc.Nb.Dc)}})}};
1098
1100
  olympe.sc.jg.ww=a=>{const b=a.C,c=olympe.dc.ia(),d=new Set;for(var e of b.C.values()){a=e.tag();let f;const g=null!=(f=e.Vb())?f:c.model(a);if(null!==g&&e.Tc()&&(d.has(g)||c.Rb(g,olympe.sc.yc))){d.add(g);const h=Array.from(e.ja()).flatMap(([k,,l,n])=>n&&k!==olympe.dc.nc.Yc?[l]:[]).find(k=>{let l,n;const p=null!=(n=null==(l=b.Lc(k))?void 0:l.Vb())?n:c.model(k);return!p||!(d.has(p)||c.Rb(p,olympe.sc.yc))});if(void 0!==h){let k,l,n;e=null!=(n=null!=(l=null==(k=b.Lc(h))?void 0:k.Vb())?l:c.model(h))?n:
1099
- 'unknown';throw Error(`Try to link an instance (${a}) of DataType ${c.name(g)} (${g}) to an instance which is not (${h}) a DataType: ${c.name(e)} (${e})`);}}}};olympe.sc.jg.Py=a=>{var b=a.C;const c=olympe.dc.ia();for(const d of b.ad()){b=d.tag();const e=d.Vb();if(e&&!c.Rb(e,olympe.sc.yc)&&bl(a,b))throw Error(`You are trying to persist an instance of : ${c.name(e)} (${e}), but only instances of DataType can be persisted`);}};
1100
- olympe.W.run([olympe.dc.transaction.R.Ea],a=>{rl(rl(rl(a,olympe.sc.jg.ww,'businessDataRelations'),olympe.sc.jg.ny),olympe.sc.jg.Ay)});olympe.sc.Cj=class extends olympe.dm.BrickMetadata{ne(){return olympe.sc.pe.De.ih}};olympe.sc.Cj.P=olympe.dc.na.C('01645fe6873aeea59e64',olympe.sc.Cj);olympe.sc.Cj.C=olympe.sc.Cj.P.sa('017ed8ac775f48d4d589');olympe.sc.eo=class extends olympe.dm.Lb{ne(){return olympe.sc.pe.De.ih}};olympe.sc.eo.P=olympe.dc.na.C('0163a68ce44f3d1fa95d',olympe.sc.eo);olympe.sc.gh=class extends olympe.dm.BrickMetadata{};olympe.sc.gh.P=olympe.dc.na.C('016324fde11a836f77d3',olympe.sc.gh);olympe.sc.gh.C=olympe.sc.yc.P.sa('016324fde11a836088d3');olympe.sc.gh.P.C=(a,b)=>ll(a,null!=b?b:'New config type',olympe.sc.gh).X();olympe.sc.Jz=class{};olympe.sc.Gj=class extends olympe.dm.BrickMetadata{ne(){return olympe.sc.pe.De.ih}};olympe.sc.Gj.P=olympe.dc.na.C('017dc8d6c8fd8c8bd2ff',olympe.sc.Gj);olympe.sc.Gj.P.C=(a,b)=>ll(a,null!=b?b:'New data connector',olympe.sc.Gj,olympe.dm.DataSource).X();olympe.sc.re=class extends olympe.sc.Runnable{Ga(){return this.bb(olympe.sc.re.G,olympe.sc.Runnable)}ua(){return this.bb(olympe.sc.re.F,olympe.dm.Property)}};olympe.sc.re.P=Hf(olympe.dc.na.C('016c2d996d9ca27fa9d8',olympe.sc.re));olympe.sc.re.G=olympe.sc.re.P.sa('016c3cb7742ec9309e0b');olympe.sc.re.F=olympe.sc.re.P.sa('016c42d3454636f90533');olympe.sc.re.prototype.Ga.L=new olympe.D.K(()=>olympe.dc.za,[]);olympe.sc.re.prototype.ua.L=new olympe.D.K(()=>olympe.dc.za,[]);olympe.sc.Ho=class extends olympe.dm.Lb{ne(){return olympe.sc.pe.De.ih}};olympe.sc.Ho.P=olympe.dc.na.C('017a7a9ff057958e5678',olympe.sc.Ho);olympe.sc.oi=class extends olympe.dm.Enum{static create(a,b,c,d,e){const f=olympe.dc.ia();e=void 0!==e?e:f.Ha(b)&&f.ad(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.sc.oi.create=olympe.sc.oi.create;olympe.sc.oi.P=olympe.dc.na.C('016cdd861b32d56c8208',olympe.sc.oi);olympe.sc.Hp=class extends olympe.dm.Lb{ne(){return olympe.sc.pe.De.Qv}};olympe.sc.Hp.P=olympe.dc.na.C('01644b6d4543b344b857',olympe.sc.Hp);olympe.sc.Ip=class extends olympe.dc.CloudObject{};olympe.sc.Ip.P=olympe.dc.na.C('0162f672366be5ca7a86',olympe.sc.Ip);const tn={Go:30};olympe.sc.fc=class extends olympe.dc.sources.fc{F(a){return a instanceof olympe.sc.logic.Error?Q(tn.Go,{c:a.code,m:a.message,s:a.ke()}):super.F(a)}C(a){return(null==a?void 0:a.t)===tn.Go?(a=a.v,Am(a.m,a.c,a.s)):super.C(a)}J(a){super.J(a);if(this.db.model(a)===olympe.sc.Kd.P.X()){const b=olympe.sc.Kd.C;this.G.get(a).r.push({r:b.X(),d:this.db.Kb(a,b)})}return a}};olympe.sc.Wq=class extends olympe.sc.re{};olympe.sc.Wq.P=olympe.dc.na.C('016d3f37610ae4fc3962',olympe.sc.Wq);olympe.sc.Text=class extends olympe.dm.String{};olympe.sc.Text.P=olympe.dc.na.C('016cfca73e63f9ab5ba4',olympe.sc.Text);olympe.sc.Wa=class{constructor(a=!0){a=jl(a);a.O=!0;a.T.push(olympe.sc.jg.Py);this.C=a;this.F=[];this.source=null}static from(a){const b=olympe.sc.xa.C.TRANSACTION;return a.has(b,!0)?a.get(b,!0):new olympe.sc.Wa}static process(a,b){return a.has(olympe.sc.xa.C.TRANSACTION,!0)?Promise.resolve(!1):b.ob().then(()=>!0)}U(){return this.C.U()}create(a,b=new Map,c=this.source,d){c='string'===typeof c?c:olympe.dc.Zd().fromModel(a);a=this.C.create(a,d).ci(c);for(const [e,f]of b)Z(a,e,f);b=a.X();this.F.push(b);
1101
- return b}update(a,b,c){this.C.update(a,b,c);return this}gs(a,b){a=this.C.update(a);for(const [c,d]of b)b=d,a.Dd.set(olympe.dc.ga(c),b);return this}delete(a){this.C.delete(a);return this}Ma(a,b,c){this.C.Ma(a,b,c);return this}ic(a,b,c){this.C.ic(a,b,c);return this}Mm(a,b){this.C.Mm(a,b);return this}persist(a,b=!0){this.C.persist(a,b);return this}Oy(a,b=!0){olympe.ka.ib('dc').warn('Transaction#persistInstance() has been deprecated. Please use Transaction#persist() instead.');return this.persist(a,b)}ci(a){this.source=
1102
- a;return this}model(a){return this.C.model(a)}merge(a){kl(this.C,a.C);return this}Fm(a){this.C.Fm(a);return this}ob(){return new Promise((a,b)=>{this.C.ob((c,d)=>{c?a(new olympe.sc.Si(this.F)):b(d)})})}Nm(){return new Promise((a,b)=>{this.C.Nm((c,d)=>{c?a(new olympe.sc.Si(this.F)):b(d)})})}};olympe.sc.Wa.prototype.executeAsLarge=olympe.sc.Wa.prototype.Nm;olympe.sc.Wa.prototype.execute=olympe.sc.Wa.prototype.ob;olympe.sc.Wa.prototype.afterExecution=olympe.sc.Wa.prototype.Fm;
1103
- olympe.sc.Wa.prototype.merge=olympe.sc.Wa.prototype.merge;olympe.sc.Wa.prototype.model=olympe.sc.Wa.prototype.model;olympe.sc.Wa.prototype.setSource=olympe.sc.Wa.prototype.ci;olympe.sc.Wa.prototype.persistInstance=olympe.sc.Wa.prototype.Oy;olympe.sc.Wa.prototype.persist=olympe.sc.Wa.prototype.persist;olympe.sc.Wa.prototype.deleteAllRelations=olympe.sc.Wa.prototype.Mm;olympe.sc.Wa.prototype.deleteRelation=olympe.sc.Wa.prototype.ic;olympe.sc.Wa.prototype.createRelation=olympe.sc.Wa.prototype.Ma;
1104
- olympe.sc.Wa.prototype['delete']=olympe.sc.Wa.prototype.delete;olympe.sc.Wa.prototype.multiUpdate=olympe.sc.Wa.prototype.gs;olympe.sc.Wa.prototype.update=olympe.sc.Wa.prototype.update;olympe.sc.Wa.prototype.create=olympe.sc.Wa.prototype.create;olympe.sc.Wa.prototype.getId=olympe.sc.Wa.prototype.U;olympe.sc.Wa.process=olympe.sc.Wa.process;olympe.sc.Wa.from=olympe.sc.Wa.from;olympe.sc.Si=class{constructor(a){this.C=a}gx(){return this.C.map(olympe.dc.CloudObject.get)}};olympe.sc.Si.prototype.getCreatedObjects=olympe.sc.Si.prototype.gx;olympe.wc={};olympe.wc.Es=class{run(){}};function un(a,b='default'){return a.C===b}
1101
+ 'unknown';throw Error(`Try to link an instance (${a}) of DataType ${c.name(g)} (${g}) to an instance which is not (${h}) a DataType: ${c.name(e)} (${e})`);}}}};olympe.sc.jg.Py=a=>{var b=a.C;const c=olympe.dc.ia();for(const d of b.ad()){b=d.tag();const e=d.Vb();if(e&&!c.Rb(e,olympe.sc.yc)&&al(a,b))throw Error(`You are trying to persist an instance of : ${c.name(e)} (${e}), but only instances of DataType can be persisted`);}};
1102
+ olympe.W.run([olympe.dc.transaction.R.Ea],a=>{ql(ql(ql(a,olympe.sc.jg.ww,'businessDataRelations'),olympe.sc.jg.ny),olympe.sc.jg.Ay)});olympe.sc.Cj=class extends olympe.dm.BrickMetadata{ne(){return olympe.sc.pe.De.ih}};olympe.sc.Cj.P=olympe.dc.na.C('01645fe6873aeea59e64',olympe.sc.Cj);olympe.sc.Cj.C=olympe.sc.Cj.P.sa('017ed8ac775f48d4d589');olympe.sc.eo=class extends olympe.dm.Lb{ne(){return olympe.sc.pe.De.ih}};olympe.sc.eo.P=olympe.dc.na.C('0163a68ce44f3d1fa95d',olympe.sc.eo);olympe.sc.gh=class extends olympe.dm.BrickMetadata{};olympe.sc.gh.P=olympe.dc.na.C('016324fde11a836f77d3',olympe.sc.gh);olympe.sc.gh.C=olympe.sc.yc.P.sa('016324fde11a836088d3');olympe.sc.gh.P.C=(a,b)=>kl(a,null!=b?b:'New config type',olympe.sc.gh).X();olympe.sc.Jz=class{};olympe.sc.Gj=class extends olympe.dm.BrickMetadata{ne(){return olympe.sc.pe.De.ih}};olympe.sc.Gj.P=olympe.dc.na.C('017dc8d6c8fd8c8bd2ff',olympe.sc.Gj);olympe.sc.Gj.P.C=(a,b)=>kl(a,null!=b?b:'New data connector',olympe.sc.Gj,olympe.dm.DataSource).X();olympe.sc.re=class extends olympe.sc.Runnable{Ga(){return this.cb(olympe.sc.re.G,olympe.sc.Runnable)}ua(){return this.cb(olympe.sc.re.F,olympe.dm.Property)}};olympe.sc.re.P=Hf(olympe.dc.na.C('016c2d996d9ca27fa9d8',olympe.sc.re));olympe.sc.re.G=olympe.sc.re.P.sa('016c3cb7742ec9309e0b');olympe.sc.re.F=olympe.sc.re.P.sa('016c42d3454636f90533');olympe.sc.re.prototype.Ga.L=new olympe.D.K(()=>olympe.dc.za,[]);olympe.sc.re.prototype.ua.L=new olympe.D.K(()=>olympe.dc.za,[]);olympe.sc.Ho=class extends olympe.dm.Lb{ne(){return olympe.sc.pe.De.ih}};olympe.sc.Ho.P=olympe.dc.na.C('017a7a9ff057958e5678',olympe.sc.Ho);olympe.sc.oi=class extends olympe.dm.Enum{static create(a,b,c,d,e){const f=olympe.dc.ia();e=void 0!==e?e:f.Ha(b)&&f.ad(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.sc.oi.create=olympe.sc.oi.create;olympe.sc.oi.P=olympe.dc.na.C('016cdd861b32d56c8208',olympe.sc.oi);olympe.sc.Hp=class extends olympe.dm.Lb{ne(){return olympe.sc.pe.De.Qv}};olympe.sc.Hp.P=olympe.dc.na.C('01644b6d4543b344b857',olympe.sc.Hp);olympe.sc.Ip=class extends olympe.dc.CloudObject{};olympe.sc.Ip.P=olympe.dc.na.C('0162f672366be5ca7a86',olympe.sc.Ip);const sn={Go:30};olympe.sc.fc=class extends olympe.dc.sources.fc{F(a){return a instanceof olympe.sc.logic.Error?Q(sn.Go,{c:a.code,m:a.message,s:a.ke()}):super.F(a)}C(a){return(null==a?void 0:a.t)===sn.Go?(a=a.v,zm(a.m,a.c,a.s)):super.C(a)}J(a){super.J(a);if(this.db.model(a)===olympe.sc.Kd.P.X()){const b=olympe.sc.Kd.C;this.G.get(a).r.push({r:b.X(),d:this.db.Kb(a,b)})}return a}};olympe.sc.Wq=class extends olympe.sc.re{};olympe.sc.Wq.P=olympe.dc.na.C('016d3f37610ae4fc3962',olympe.sc.Wq);olympe.sc.Text=class extends olympe.dm.String{};olympe.sc.Text.P=olympe.dc.na.C('016cfca73e63f9ab5ba4',olympe.sc.Text);olympe.sc.Xa=class{constructor(a=!0){a=il(a);a.O=!0;a.T.push(olympe.sc.jg.Py);this.C=a;this.F=[];this.source=null}static from(a){const b=olympe.sc.xa.C.TRANSACTION;return a.has(b,!0)?a.get(b,!0):new olympe.sc.Xa}static process(a,b){return a.has(olympe.sc.xa.C.TRANSACTION,!0)?Promise.resolve(!1):b.ob().then(()=>!0)}U(){return this.C.U()}create(a,b=new Map,c=this.source,d){c='string'===typeof c?c:olympe.dc.Zd().fromModel(a);a=this.C.create(a,d).ci(c);for(const [e,f]of b)Z(a,e,f);b=a.X();this.F.push(b);
1103
+ return b}update(a,b,c){this.C.update(a,b,c);return this}gs(a,b){a=this.C.update(a);for(const [c,d]of b)b=d,a.Dd.set(olympe.dc.ga(c),b);return this}delete(a){this.C.delete(a);return this}Ma(a,b,c){this.C.Ma(a,b,c);return this}ic(a,b,c){this.C.ic(a,b,c);return this}Mm(a,b){this.C.Mm(a,b);return this}persist(a,b=!0){this.C.persist(a,b);return this}Oy(a,b=!0){olympe.ka.ab('dc').warn('Transaction#persistInstance() has been deprecated. Please use Transaction#persist() instead.');return this.persist(a,b)}ci(a){this.source=
1104
+ a;return this}model(a){return this.C.model(a)}merge(a){jl(this.C,a.C);return this}Fm(a){this.C.Fm(a);return this}ob(){return new Promise((a,b)=>{this.C.ob((c,d)=>{c?a(new olympe.sc.Si(this.F)):b(d)})})}Nm(){return new Promise((a,b)=>{this.C.Nm((c,d)=>{c?a(new olympe.sc.Si(this.F)):b(d)})})}};olympe.sc.Xa.prototype.executeAsLarge=olympe.sc.Xa.prototype.Nm;olympe.sc.Xa.prototype.execute=olympe.sc.Xa.prototype.ob;olympe.sc.Xa.prototype.afterExecution=olympe.sc.Xa.prototype.Fm;
1105
+ olympe.sc.Xa.prototype.merge=olympe.sc.Xa.prototype.merge;olympe.sc.Xa.prototype.model=olympe.sc.Xa.prototype.model;olympe.sc.Xa.prototype.setSource=olympe.sc.Xa.prototype.ci;olympe.sc.Xa.prototype.persistInstance=olympe.sc.Xa.prototype.Oy;olympe.sc.Xa.prototype.persist=olympe.sc.Xa.prototype.persist;olympe.sc.Xa.prototype.deleteAllRelations=olympe.sc.Xa.prototype.Mm;olympe.sc.Xa.prototype.deleteRelation=olympe.sc.Xa.prototype.ic;olympe.sc.Xa.prototype.createRelation=olympe.sc.Xa.prototype.Ma;
1106
+ olympe.sc.Xa.prototype['delete']=olympe.sc.Xa.prototype.delete;olympe.sc.Xa.prototype.multiUpdate=olympe.sc.Xa.prototype.gs;olympe.sc.Xa.prototype.update=olympe.sc.Xa.prototype.update;olympe.sc.Xa.prototype.create=olympe.sc.Xa.prototype.create;olympe.sc.Xa.prototype.getId=olympe.sc.Xa.prototype.U;olympe.sc.Xa.process=olympe.sc.Xa.process;olympe.sc.Xa.from=olympe.sc.Xa.from;olympe.sc.Si=class{constructor(a){this.C=a}gx(){return this.C.map(olympe.dc.CloudObject.get)}};olympe.sc.Si.prototype.getCreatedObjects=olympe.sc.Si.prototype.gx;olympe.wc={};olympe.wc.Es=class{run(){}};function tn(a,b='default'){return a.C===b}
1105
1107
  olympe.wc.Ta=class{constructor(a,b){this.C=a;this.H=b;this.F=null;this.G='';this.H.info('HC Manager will execute application registered as:',this.C)}oj(a,b,c=''){b||(b='default');b===this.C?(null===this.F?this.H.log('Application',c,'designated to be launched'):this.H.log('OVERRIDE: Application',c,'designated to be launched'),this.F=a,this.G=c):this.H.debug('ignoring application:'+c+' as it is registered under name '+b+' and not '+this.C)}run(){null!==this.F?(this.H.info('Running application:',this.G),
1106
- this.F.run()):this.H.error('No app registered under name: '+this.C)}};olympe.wc.oj=function(a,b,c='default'){const d=a.ib();c?d.debug('Pre-registering application '+b+' under name '+c+' (use '+olympe.wc.V.Je+'='+c+' to start it)'):d.debug('Pre-registering application '+b+' as default one');a.vd(olympe.wc.R.Ea).config(c,[b],(e,f)=>f.oj(e,c,b),e=>un(e,c),'olympe.hc.registerApp')};olympe.wc.R={Ea:'hc.Manager',Ca:'hc.Logger'};olympe.wc.V={Je:'hc.app',Yo:'hc.globalToken'};olympe.W.config(function(a){F(a,olympe.wc.V.Je,'default');F(a,olympe.wc.V.Yo,!1);E(a,olympe.wc.R.Ca,[olympe.ka.R.Ea],b=>b.Vc('hc'));E(a,olympe.Db.R.Jg,[new olympe.W.oa(olympe.wc.V.Je)],b=>b);E(a,olympe.auth.R.Uk,[olympe.Db.R.Jg,new olympe.W.oa(olympe.wc.V.Yo)],(b,c)=>new olympe.auth.Gn(c?'':b));C(a,olympe.wc.R.Ea,olympe.wc.Ta,new olympe.W.oa(olympe.wc.V.Je),olympe.wc.R.Ca)},'olympe.hc');
1107
- olympe.W.run([olympe.wc.R.Ea],a=>a.run(),'olympe.hc');olympe.sc.Ib={};function vn(a,b){if(a.ea)a.H.debug('Sending getContext request'),$h(a.ja).then(()=>{a.H.debug('synchronisation request successful');hn=a.C;b()}).catch(c=>{a.H.error('failed to synchronise (authenticated) with server: '+c.message)});else{const c=ym(a.F);!c&&vk();a.H.debug((c?'PULLING':'SUBSCRIBING')+' application '+a.C);const d=a.F.F(),e=new olympe.async.Tq(d);e.add((f,g)=>{const h=olympe.dc.ia(),k=new olympe.D.Xb('Primordial Subscription Context',d);Qh(k,a.C,l=>{l=h.ai(l)?l:h.model(l);return null!==
1108
- l&&h.Rb(l,olympe.sc.gh)},{Pd:wn(c),qn:!0}).subscribe(rxjs.Subscriber.create(d.G(()=>{h.Rb(a.C,olympe.sc.qa.Rc)?(a.ua.Z(a.C,c),f()):ad(a.O)?g(`The specified application tag (${a.C}) is not an application or does not exist`):(k.destroy(),a.O.connect().catch(l=>{g(`Failed to load the app while offline, you might want to try again when online: ${l}`)}))}),l=>g(String(l))))});e.add(f=>{olympe.D.Nc([a.aa.me()],g=>{const h=wn(c,!1);olympe.dc.pa.Fe(g,olympe.dm.User).observe(olympe.D.$a(),{Pd:h,vk:'__code-as-data__'}).subscribe(()=>
1109
- d.run(f))})});e.add((f,g)=>{if(xn(a.C)){const h=olympe.sc.Wc.Gb.Ap,k=olympe.sc.Wc.Gb.Ei;kn(a.C,a.gb,l=>{l===h||l===k?d.run(f):d.run(()=>g('Error while loading the business container'))})}else f()});Tc(e,(f,g)=>{if(g)throw Error(g);b()});e.start()}}
1110
- function yn(a){a.H.info('Starting application '+a.C);const b=olympe.D.ec(olympe.D.fa).update(olympe.D.fa.C),c=olympe.dc.ia();if(0<a.C.length){const d=jf(c,a.C,a.F.F().G((g,h)=>{if(g)if(g=$m(h),g instanceof olympe.sc.qa.hi){a.H.debug('application retrieved: running');h=wm(a.F,g);const k=new olympe.sc.Ya.av(a.J);ab(a.J,()=>Im(a.F.C,k));bb(a.J,()=>{var l=k.U();return Km(a.F.C,l)});a.Ga&&a.J.start();g.run(h);'string'===typeof a.ab&&(new olympe.sc.Sd).ea(g.X(),h,a.H);h.vs(olympe.sc.xa.C.xn).then(()=>{let l;
1111
- null==(l=e)||l.cancel();b.update(olympe.D.fa.F);zn(a)})}else a.H.error('application retrieved: not an Application with a run() method');else An(a)}));olympe.D.$a().onDestroy(()=>{gf(c,a.C,d)});const e=mc(()=>{a.H.warn(`requested application ${a.C} may not be available (it may not exist or the logged user may not have the correct permissions)`)},3E4);let f;null==(f=a.yb)||f.start()}Bn(a);Cn(a,b)}
1112
- function zn(a){a.H.info(`Application ${olympe.dc.ia().name(a.C)} (${a.C}) started`);a=olympe.dc.sources.Xd();a.Jb=!0;a.Z+=0;a.Uc.next(0<a.Z);0===a.Z&&a.aa&&a.Jb&&(a.H.debug(`Cache: set code-as-data version in local storage: ${a.version}`),a.ab.set('__code-as-data-version__',a.version),a.yb||(a.aa=!1))}function wn(a,b=!0){return a?olympe.dc.pa.Zc.bm:b?olympe.dc.pa.Zc.Qf:olympe.dc.pa.Zc.am}function An(a){a.H.info('Stop the application');zn(a);a.F.F().ja();a.G.G(a.T);a.G.O(a.Z)}
1113
- function Bn(a){a.Z=a.G.F(()=>v(function*(){return An(a)}),'Stop application')}function Cn(a,b){a.T=a.G.C(()=>olympe.D.Na(b)===olympe.D.fa.F?Promise.resolve('The application is started'):Promise.reject('The application is not started'),'Application health check',olympe.host.ze.C.READINESS)}
1114
- olympe.sc.Ib.jm=class{constructor(a,b,c,d,e,f,g,h,k,l){this.H=a;this.aa=b;this.O=c;this.ja=d;this.G=e;this.Z=this.T='';this.F=f;this.ua=g;this.J=h;this.yb=l;this.C=k.get('appTag');this.ea=k.get('getContextMode');let n;this.ab=null!=(n=k.get('debuggerName'))?n:null;this.Ga=k.get('autostartProfiler');this.gb=k.get('loadBusinessContainer')}run(){this.H.debug('runtime starting for app #'+this.C);let a=!1;const b=olympe.N.rc.C.Ji,c=olympe.N.rc.C.ee,d=olympe.N.rc.C.Rd;olympe.D.Nc([this.O.getState()],e=>
1115
- {switch(e){case b:case c:this.H.debug('Server session opened or working offline, start the application');a||(a=!0,vn(this,()=>yn(this)));break;case d:this.H.debug('Impossible to open a connection to the orchestrator and offline mode is disabled.')}})}};olympe.sc.Ib.jm.C='app_instance';olympe.sc.Ib.jm.ya=[olympe.wc.Es];olympe.sc.Ib.nv=class{constructor(a,b,c,d){this.H=a;this.F=b;this.G=d.get('httpManifestPath');this.C=d.get('manifestCommon');if(!this.C)this.C={};else if('string'===typeof this.C)try{this.C=JSON.parse(this.C)}catch(e){this.H.warn('Invalid manifest common config'),this.C={}}}start(){const a=b=>{this.H.debug('Request URL',b.C());const c=(new URL(b.C())).searchParams.get('origin');if(c)return c;b=b.fj();this.H.debug('Request headers',JSON.stringify(b,null,2));return b.origin?b.origin:b.Ty?(new URL(b.Ty)).origin:
1108
+ this.F.run()):this.H.error('No app registered under name: '+this.C)}};olympe.wc.oj=function(a,b,c='default'){const d=a.ab();c?d.debug('Pre-registering application '+b+' under name '+c+' (use '+olympe.wc.V.Je+'='+c+' to start it)'):d.debug('Pre-registering application '+b+' as default one');a.vd(olympe.wc.R.Ea).config(c,[b],(e,f)=>f.oj(e,c,b),e=>tn(e,c),'olympe.hc.registerApp')};olympe.wc.R={Ea:'hc.Manager',Ca:'hc.Logger'};olympe.wc.V={Je:'hc.app',Yo:'hc.globalToken'};olympe.W.config(function(a){F(a,olympe.wc.V.Je,'default');F(a,olympe.wc.V.Yo,!1);E(a,olympe.wc.R.Ca,[olympe.ka.R.Ea],b=>b.Vc('hc'));E(a,olympe.Db.R.Jg,[new olympe.W.oa(olympe.wc.V.Je)],b=>b);E(a,olympe.auth.R.Uk,[olympe.Db.R.Jg,new olympe.W.oa(olympe.wc.V.Yo)],(b,c)=>new olympe.auth.Gn(c?'':b));C(a,olympe.wc.R.Ea,olympe.wc.Ta,new olympe.W.oa(olympe.wc.V.Je),olympe.wc.R.Ca)},'olympe.hc');
1109
+ olympe.W.run([olympe.wc.R.Ea],a=>a.run(),'olympe.hc');olympe.sc.Jb={};function un(a){a.Z=a.G.F(()=>v(function*(){return vn(a)}),'Stop application')}function wn(a){a.T=a.G.C(()=>olympe.D.Na(a.aa)===olympe.D.fa.F?Promise.resolve('The application is started'):Promise.reject('The application is not started'),'Application health check',olympe.host.ze.C.READINESS)}
1110
+ function xn(a,b){if(a.ja)a.H.debug('Sending getContext request'),$h(a.ua).then(()=>{a.H.debug('synchronisation request successful');gn=a.C;b()}).catch(c=>{a.H.error('failed to synchronise (authenticated) with server: '+c.message)});else{const c=xm(a.F);!c&&uk();a.H.debug((c?'PULLING':'SUBSCRIBING')+' application '+a.C);const d=a.F.F(),e=new olympe.async.Tq(d);e.add((f,g)=>{const h=olympe.dc.ia(),k=new olympe.D.Xb('Primordial Subscription Context',d);Qh(k,a.C,l=>{l=h.ai(l)?l:h.model(l);return null!==
1111
+ l&&h.Rb(l,olympe.sc.gh)},{Pd:yn(c),qn:!0}).subscribe(rxjs.Subscriber.create(d.G(()=>{h.Rb(a.C,olympe.sc.qa.Rc)?(a.Ga.Z(a.C,c),f()):ad(a.O)?g(`The specified application tag (${a.C}) is not an application or does not exist`):(k.destroy(),a.O.connect().catch(l=>{g(`Failed to load the app while offline, you might want to try again when online: ${l}`)}))}),l=>g(String(l))))});e.add(f=>{olympe.D.Nc([a.ea.me()],g=>{const h=yn(c,!1);olympe.dc.pa.Fe(g,olympe.dm.User).observe(olympe.D.Wa(),{Pd:h,vk:'__code-as-data__'}).subscribe(()=>
1112
+ d.run(f))})});e.add((f,g)=>{if(zn(a.C)){const h=olympe.sc.Wc.Hb.Ap,k=olympe.sc.Wc.Hb.Ei;jn(a.C,a.yb,l=>{l===h||l===k?d.run(f):d.run(()=>g('Error while loading the business container'))})}else f()});Tc(e,(f,g)=>{if(g)throw Error(g);b()});e.start()}}
1113
+ function An(a){a.H.info('Starting application '+a.C);const b=olympe.dc.ia();if(0<a.C.length){const c=jf(b,a.C,a.F.F().G((f,g)=>{if(f)if(f=Zm(g),f instanceof olympe.sc.qa.hi){a.H.debug('application retrieved: running');g=vm(a.F,f);const h=new olympe.sc.Za.av(a.J);ab(a.J,()=>Hm(a.F.C,h));bb(a.J,()=>{var k=h.U();return Jm(a.F.C,k)});a.bb&&a.J.start();f.run(g);'string'===typeof a.hb&&(new olympe.sc.Sd).ea(f.X(),g,a.H);g.vs(olympe.sc.xa.C.xn).then(()=>{var k;null==(k=d)||k.cancel();a.aa.update(olympe.D.fa.F);
1114
+ a.H.info(`Application ${olympe.dc.ia().name(a.C)} (${a.C}) started`);k=olympe.dc.sources.Xd();k.Fb=!0;k.Z+=0;k.Uc.next(0<k.Z);0===k.Z&&k.aa&&k.Fb&&(k.H.debug(`Cache: set code-as-data version in local storage: ${k.version}`),k.bb.set('__code-as-data-version__',k.version),k.yb||(k.aa=!1))})}else a.H.error('application retrieved: not an Application with a run() method');else vn(a)}));olympe.D.Wa().onDestroy(()=>{gf(b,a.C,c)});const d=mc(()=>{a.H.warn(`requested application ${a.C} may not be available (it may not exist or the logged user may not have the correct permissions)`)},
1115
+ 3E4);let e;null==(e=a.Fb)||e.start()}}function yn(a,b=!0){return a?olympe.dc.pa.Zc.bm:b?olympe.dc.pa.Zc.Qf:olympe.dc.pa.Zc.am}function vn(a){a.H.info('Stop the application');a.F.F().ja();a.G.G(a.T);a.G.O(a.Z)}
1116
+ olympe.sc.Jb.jm=class{constructor(a,b,c,d,e,f,g,h,k,l){this.H=a;this.ea=b;this.O=c;this.ua=d;this.G=e;this.Z=this.T='';this.F=f;this.Ga=g;this.J=h;this.Fb=l;this.C=k.get('appTag');this.ja=k.get('getContextMode');let n;this.hb=null!=(n=k.get('debuggerName'))?n:null;this.bb=k.get('autostartProfiler');this.yb=k.get('loadBusinessContainer');this.aa=olympe.D.ec(olympe.D.fa).update(olympe.D.fa.C)}run(){this.H.debug('runtime starting for app #'+this.C);let a=!1;un(this);wn(this);const b=olympe.N.rc.C.Ji,
1117
+ c=olympe.N.rc.C.ee,d=olympe.N.rc.C.Rd;olympe.D.Nc([this.O.getState()],e=>{switch(e){case b:case c:this.H.debug('Server session opened or working offline, start the application');a||(a=!0,xn(this,()=>An(this)));break;case d:this.H.debug('Impossible to open a connection to the orchestrator and offline mode is disabled.')}})}};olympe.sc.Jb.jm.C='app_instance';olympe.sc.Jb.jm.ya=[olympe.wc.Es];olympe.sc.Jb.nv=class{constructor(a,b,c,d){this.H=a;this.F=b;this.G=d.get('httpManifestPath');this.C=d.get('manifestCommon');if(!this.C)this.C={};else if('string'===typeof this.C)try{this.C=JSON.parse(this.C)}catch(e){this.H.warn('Invalid manifest common config'),this.C={}}}start(){const a=b=>{this.H.debug('Request URL',b.C());const c=(new URL(b.C())).searchParams.get('origin');if(c)return c;b=b.fj();this.H.debug('Request headers',JSON.stringify(b,null,2));return b.origin?b.origin:b.Ty?(new URL(b.Ty)).origin:
1116
1118
  b[olympe.net.Aa.Headers.Po]&&b[olympe.net.Aa.Headers.Qo]?b[olympe.net.Aa.Headers.Qo]+'://'+b[olympe.net.Aa.Headers.Po]:null};this.F.G('manifest',`${this.G}/:${'appTag'}`,[olympe.net.Aa.Id.GET],(b,c)=>{const d=this;return v(function*(){var e=c.get('appTag');d.H.debug('Processing request to serve manifest for app',e);if(20!==e.length)return new olympe.net.be('Invalid appTag',olympe.net.Aa.Yb.Xk);try{var f=yield olympe.dc.pa.Fe(e,olympe.sc.qa.Rc).ob()}catch(h){return new olympe.net.be(`Something went wrong: ${'string'===
1117
1119
  typeof h?h:h.message}`,olympe.net.Aa.Yb.Xk)}if(0===f.size())return new olympe.net.be('App not found',olympe.net.Aa.Yb.Ql);var g=a(b);f=f.Fc();g={name:f.name(),short_name:f.name(),id:e,start_url:g?`${g}?hc.app=sc.runtime&sc.app=${e}`:void 0,display:'standalone',backgroundColor:'#fff',icons:g?[{src:`${g}/images/logo.svg`,sizes:'150x150',type:'image/png'},{src:`${g}/images/logo.png`,sizes:'1024x1024',type:'image/png',purpose:'maskable any'}]:void 0};f=olympe.W.getParameter(`app.manifest.${e}`);if(!f)f=
1118
- {};else if('string'===typeof f)try{f=JSON.parse(f)}catch(h){d.H.warn(`Invalid manifest app config for app: ${e}`),f={}}e=Object.assign({},g,d.C,f);return new olympe.net.be(JSON.stringify(e),olympe.net.Aa.Yb.xh,void 0,{'content-type':'application/json'})})}).catch(()=>this.H.error('Error while starting the RuntimeHTTPService'));this.H.debug('Started RuntimeHTTPService')}};function xn(a){var b=olympe.dm.DataSource.SERVER;const c=olympe.dc.pa.from(a).hb(olympe.sc.qa.Rc.C).hb(olympe.dm.rd.G.bc()).hb(olympe.dm.rd.C).md();a=olympe.dc.pa.from(a).hb(olympe.sc.qa.Rc.C).hb(olympe.dm.kb.F).md();return c.concat(a).has(b)}
1119
- olympe.sc.Ib.lk=class extends olympe.dc.sources.lk{T(a){return this.db.Rb(a,olympe.sc.yc)}Z(a,b){if(!this.J){super.init();var c=olympe.dc.gd.from(a).hb(olympe.sc.qa.Rc.C).md();if(!(c instanceof olympe.dm.kb))throw Error(`Impossible to initialize the source solver for the application ${a}: no project is linked to it`);b=b?olympe.dc.pa.Zc.bm:olympe.dc.pa.Zc.Qf;mk(this,c,b);c=new olympe.D.Xb('deployed data sources');olympe.dc.pa.from(a).hb(olympe.sc.qa.Rc.ja).observe(c,{Pd:b}).subscribe(d=>{const e=
1120
- new olympe.dc.Wa;rf(d).forEach(f=>{e.Ma(olympe.dm.DataSource.nj,this.C,f)});qf(d).forEach(f=>{e.ic(olympe.dm.DataSource.nj,this.C,f)});e.ob()})}}};olympe.sc.Ib.R={Yf:'sc.runtime.Main',Re:'sc.runtime.SourceSolver',Aq:'sc.runtime.appConfig',Cq:'sc.runtime.runtimeHTTPServiceConfig',Bq:'sc.runtime.RuntimeHTTPService',Vp:'sc.runtime.OfflineAppConfig'};olympe.sc.Ib.V={ip:'app.httpManifestPath',Fp:'app.manifest.common',Bp:'sc.loadBusinessContainer'};
1121
- olympe.W.config(function(a){F(a,olympe.sc.Ib.V.ip,'/runtime/manifest');F(a,olympe.sc.Ib.V.Fp,null);F(a,olympe.sc.Ib.V.Bp,!0);E(a,olympe.Db.R.Jg,[new olympe.W.oa(olympe.wc.V.Je),new olympe.W.oa(olympe.sc.V.Je)],(b,c)=>`${b}${c?'-'+c:''}`);E(a,olympe.sc.Ib.R.Vp,[new olympe.W.oa(olympe.sc.V.Je),new olympe.W.oa(olympe.net.V.Ii),new olympe.W.oa(olympe.net.V.Sl)],(b,c,d)=>{let e;const f=null!=(e=a.getParameter(`offline.${b}.enabled`))?e:c;let g;b=null!=(g=a.getParameter(`offline.${b}.autoBackOnline`))?
1122
- g:d;return new Map([['offlineEnabled',f],['offlineAutoBackOnline',!f||b]])});Oa(a,olympe.net.R.Tl,olympe.sc.Ib.R.Vp);C(a,olympe.sc.Ib.R.Re,olympe.sc.Ib.lk,olympe.dc.R.jh,new olympe.W.oa(olympe.dc.V.Hg),new olympe.W.oa(olympe.dc.V.ol));Oa(a,olympe.dc.sources.R.Re,olympe.sc.Ib.R.Re);E(a,olympe.sc.Ib.R.Aq,[new olympe.W.oa(olympe.sc.V.Je),new olympe.W.oa(olympe.dc.V.Gh),new olympe.W.oa(olympe.sc.V.ro),new olympe.W.oa(olympe.sc.V.zn),new olympe.W.oa(olympe.sc.Ib.V.Bp)],(b,c,d,e,f)=>new Map([['appTag',
1123
- b],['getContextMode',c],['debuggerName',d],['autostartProfiler',e],['loadBusinessContainer',f]]));C(a,olympe.sc.Ib.R.Yf,olympe.sc.Ib.jm,olympe.sc.R.Ca,olympe.auth.R.Ea,olympe.N.R.ff,olympe.dc.query.R.Zj,olympe.host.R.Pe,olympe.sc.R.dk,olympe.sc.Ib.R.Re,olympe.Y.R.Xf,olympe.sc.Ib.R.Aq,olympe.sc.Ib.R.Bq);E(a,olympe.sc.Ib.R.Cq,[new olympe.W.oa(olympe.sc.Ib.V.ip),new olympe.W.oa(olympe.sc.Ib.V.Fp)],(b,c)=>new Map([['httpManifestPath',b],['manifestCommon',c]]));C(a,olympe.sc.Ib.R.Bq,olympe.sc.Ib.nv,olympe.sc.R.Ca,
1124
- olympe.net.R.Ui,olympe.sc.R.dk,olympe.sc.Ib.R.Cq);olympe.wc.oj(a,olympe.sc.Ib.R.Yf,'sc.runtime');olympe.wc.oj(a,olympe.sc.Ib.R.Yf,'sc.headless');olympe.wc.oj(a,olympe.sc.Ib.R.Yf)},'olympe.sc.runtime');olympe.public={};olympe.public.Ka=class a{static Uw(b,c){const d=new SRPClient,e=d.generateRandomSalt();return{username:b,login:b,salt:e,verifier:d.generateVerifier(e,b,c)}}static getState(){return Ne(olympe.public.Ka.get())}static Jk(b){return a.F(olympe.public.Ka.get().Jk(),b).pipe(rxjs.operators.map(c=>c.valueOf()))}static ix(){return olympe.D.Na(olympe.public.Ka.get().me())}static Jy(b){return a.F(olympe.public.Ka.get().me(),b)}static le(){var b=olympe.D,c=b.Na;var d=olympe.public.Ka.get().C.sb().wd();return c.call(b,
1120
+ {};else if('string'===typeof f)try{f=JSON.parse(f)}catch(h){d.H.warn(`Invalid manifest app config for app: ${e}`),f={}}e=Object.assign({},g,d.C,f);return new olympe.net.be(JSON.stringify(e),olympe.net.Aa.Yb.xh,void 0,{'content-type':'application/json'})})}).catch(()=>this.H.error('Error while starting the RuntimeHTTPService'));this.H.debug('Started RuntimeHTTPService')}};function zn(a){var b=olympe.dm.DataSource.SERVER;const c=olympe.dc.pa.from(a).ib(olympe.sc.qa.Rc.C).ib(olympe.dm.rd.G.bc()).ib(olympe.dm.rd.C).md();a=olympe.dc.pa.from(a).ib(olympe.sc.qa.Rc.C).ib(olympe.dm.kb.F).md();return c.concat(a).has(b)}
1121
+ olympe.sc.Jb.lk=class extends olympe.dc.sources.lk{T(a){return this.db.Rb(a,olympe.sc.yc)}Z(a,b){if(!this.J){super.init();var c=olympe.dc.gd.from(a).ib(olympe.sc.qa.Rc.C).md();if(!(c instanceof olympe.dm.kb))throw Error(`Impossible to initialize the source solver for the application ${a}: no project is linked to it`);b=b?olympe.dc.pa.Zc.bm:olympe.dc.pa.Zc.Qf;lk(this,c,b);c=new olympe.D.Xb('deployed data sources');olympe.dc.pa.from(a).ib(olympe.sc.qa.Rc.ja).observe(c,{Pd:b}).subscribe(d=>{const e=
1122
+ new olympe.dc.Xa;rf(d).forEach(f=>{e.Ma(olympe.dm.DataSource.nj,this.C,f)});qf(d).forEach(f=>{e.ic(olympe.dm.DataSource.nj,this.C,f)});e.ob()})}}};olympe.sc.Jb.R={Yf:'sc.runtime.Main',Re:'sc.runtime.SourceSolver',Aq:'sc.runtime.appConfig',Cq:'sc.runtime.runtimeHTTPServiceConfig',Bq:'sc.runtime.RuntimeHTTPService',Vp:'sc.runtime.OfflineAppConfig'};olympe.sc.Jb.V={ip:'app.httpManifestPath',Fp:'app.manifest.common',Bp:'sc.loadBusinessContainer'};
1123
+ olympe.W.config(function(a){F(a,olympe.sc.Jb.V.ip,'/runtime/manifest');F(a,olympe.sc.Jb.V.Fp,null);F(a,olympe.sc.Jb.V.Bp,!0);E(a,olympe.Db.R.Jg,[new olympe.W.oa(olympe.wc.V.Je),new olympe.W.oa(olympe.sc.V.Je)],(b,c)=>`${b}${c?'-'+c:''}`);E(a,olympe.sc.Jb.R.Vp,[new olympe.W.oa(olympe.sc.V.Je),new olympe.W.oa(olympe.net.V.Ii),new olympe.W.oa(olympe.net.V.Sl)],(b,c,d)=>{let e;const f=null!=(e=a.getParameter(`offline.${b}.enabled`))?e:c;let g;b=null!=(g=a.getParameter(`offline.${b}.autoBackOnline`))?
1124
+ g:d;return new Map([['offlineEnabled',f],['offlineAutoBackOnline',!f||b]])});Oa(a,olympe.net.R.Tl,olympe.sc.Jb.R.Vp);C(a,olympe.sc.Jb.R.Re,olympe.sc.Jb.lk,olympe.dc.R.jh,new olympe.W.oa(olympe.dc.V.Hg),new olympe.W.oa(olympe.dc.V.ol));Oa(a,olympe.dc.sources.R.Re,olympe.sc.Jb.R.Re);E(a,olympe.sc.Jb.R.Aq,[new olympe.W.oa(olympe.sc.V.Je),new olympe.W.oa(olympe.dc.V.Gh),new olympe.W.oa(olympe.sc.V.ro),new olympe.W.oa(olympe.sc.V.zn),new olympe.W.oa(olympe.sc.Jb.V.Bp)],(b,c,d,e,f)=>new Map([['appTag',
1125
+ b],['getContextMode',c],['debuggerName',d],['autostartProfiler',e],['loadBusinessContainer',f]]));C(a,olympe.sc.Jb.R.Yf,olympe.sc.Jb.jm,olympe.sc.R.Ca,olympe.auth.R.Ea,olympe.N.R.ff,olympe.dc.query.R.Zj,olympe.host.R.Pe,olympe.sc.R.dk,olympe.sc.Jb.R.Re,olympe.Y.R.Xf,olympe.sc.Jb.R.Aq,olympe.sc.Jb.R.Bq);E(a,olympe.sc.Jb.R.Cq,[new olympe.W.oa(olympe.sc.Jb.V.ip),new olympe.W.oa(olympe.sc.Jb.V.Fp)],(b,c)=>new Map([['httpManifestPath',b],['manifestCommon',c]]));C(a,olympe.sc.Jb.R.Bq,olympe.sc.Jb.nv,olympe.sc.R.Ca,
1126
+ olympe.net.R.Ui,olympe.sc.R.dk,olympe.sc.Jb.R.Cq);olympe.wc.oj(a,olympe.sc.Jb.R.Yf,'sc.runtime');olympe.wc.oj(a,olympe.sc.Jb.R.Yf,'sc.headless');olympe.wc.oj(a,olympe.sc.Jb.R.Yf)},'olympe.sc.runtime');olympe.public={};olympe.public.Ka=class a{static Uw(b,c){const d=new SRPClient,e=d.generateRandomSalt();return{username:b,login:b,salt:e,verifier:d.generateVerifier(e,b,c)}}static getState(){return Ne(olympe.public.Ka.get())}static Jk(b){return a.F(olympe.public.Ka.get().Jk(),b).pipe(rxjs.operators.map(c=>c.valueOf()))}static ix(){return olympe.D.Na(olympe.public.Ka.get().me())}static Jy(b){return a.F(olympe.public.Ka.get().me(),b)}static le(){var b=olympe.D,c=b.Na;var d=olympe.public.Ka.get().C.sb().wd();return c.call(b,
1125
1127
  d)}static hg(){return new Promise((b,c)=>{olympe.public.Ka.get().hg(d=>d?c(d):b())})}static vx(){return olympe.D.Na(olympe.public.Ka.get().Yh())||void 0}static Vx(){const b=jd(olympe.public.Ka.get());return{user:b.Bc(),userTag:b.me(),nonce:b.wd(),payload:b.zi(),idpName:b.nf(),protocol:b.wg()}}static ux(){return Array.from(Oe().keys())}static cf(){olympe.public.Ka.get().cf()}static Yg(b){return new Promise((c,d)=>{olympe.public.Ka.get().Yg(b,e=>e?d(e):c())})}static qy(b,c){return olympe.public.Ka.C((new Map).set('username',
1126
1128
  b).set('password',c),olympe.auth.Ec.C.SRP)}static sy(b){const c=Oe();if(0===c.size||b&&!c.has(b)){var d=0===c.size?'There are no available IDPs':`The IDP name ${b} is not valid, the valid names are ${Array.from(c.keys())}`;return Promise.reject(d)}b?(d=b,b=c.get(b)):(b=Array.from(c)[0],d=b[0],b=b[1]);return olympe.public.Ka.C((new Map).set('idpName',d),b)}static py(){return olympe.public.Ka.C(new Map,olympe.auth.Ec.C.SAML)}static ty(b,c){return olympe.public.Ka.C((new Map).set('username',b).set('nonce',
1127
1129
  c),olympe.auth.Ec.C.Ul)}static oy(){return olympe.public.Ka.C(new Map,olympe.auth.Ec.C.OAUTH2)}static bi(){return olympe.public.Ka.get().bi()}static C(b,c){const d=new olympe.auth.Request;for(const [e,f]of b)d.set(e,f);return new Promise(e=>{Me(olympe.public.Ka.get(),d,c,()=>{e()})})}static get(){return olympe.auth.je()}static F(b,c){return b.asObservable('function'===typeof c.F?c.F():c)}};olympe.public.Ka.logout=olympe.public.Ka.bi;olympe.public.Ka.loginOpenID=olympe.public.Ka.oy;
1128
1130
  olympe.public.Ka.loginToken=olympe.public.Ka.ty;olympe.public.Ka.loginSAML=olympe.public.Ka.py;olympe.public.Ka.loginSSO=olympe.public.Ka.sy;olympe.public.Ka.loginSRP=olympe.public.Ka.qy;olympe.public.Ka.getUserFromToken=olympe.public.Ka.Yg;olympe.public.Ka.sendKeepAlive=olympe.public.Ka.cf;olympe.public.Ka.getIDPNames=olympe.public.Ka.ux;olympe.public.Ka.getUserToken=olympe.public.Ka.Vx;olympe.public.Ka.getIDPToken=olympe.public.Ka.vx;olympe.public.Ka.refreshToken=olympe.public.Ka.hg;
1129
- olympe.public.Ka.getToken=olympe.public.Ka.le;olympe.public.Ka.observeUser=olympe.public.Ka.Jy;olympe.public.Ka.getCurrentUser=olympe.public.Ka.ix;olympe.public.Ka.isAuthenticated=olympe.public.Ka.Jk;olympe.public.Ka.getState=olympe.public.Ka.getState;olympe.public.Ka.generateSRPData=olympe.public.Ka.Uw;olympe.public.Ba=class{static create(a){return new class extends olympe.dc.$.kg{C(b,c){b=a(olympe.dc.CloudObject.get(c));if('boolean'===typeof b)return b;const d=olympe.D.ec(olympe.D.fa),e=b.subscribe(f=>d.update(olympe.D.Sb(f)));olympe.D.$a().Z(()=>e.unsubscribe());return d.sb()}}}};
1130
- olympe.public.gf=class{static create(a){return new class extends olympe.dc.vc.kg{G(b,c){return olympe.dc.CloudObject.get(c)}compare(b,c){b=a(b,c);if('number'===typeof b)return b;const d=olympe.D.ec(olympe.D.ba),e=b.subscribe(f=>d.update(olympe.D.ra(f)));olympe.D.$a().Z(()=>e.unsubscribe());return d.sb()}}}};olympe.public.Process=class{static Ky(a,b){if('string'===typeof b)throw Error('When registering a health check, the options parameter should be an object: string is not supported anymore.');const c=olympe.host.Dk(),d=c.C(a,void 0,null==b?void 0:b.type);return()=>c.G(d)}static Ly(a,b){const c=olympe.host.Dk(),d=c.F(a,b);return()=>c.O(d)}static connect(){return olympe.N.Qm().connect()}static disconnect(){return olympe.N.Qm().disconnect()}static Kf(a){a='function'===typeof a.F?a.F():a;return olympe.N.Qm().Kf().asObservable(a).pipe(rxjs.operators.map(b=>
1131
- b.valueOf()))}};olympe.public.Process.isOnline=olympe.public.Process.Kf;olympe.public.Process.disconnect=olympe.public.Process.disconnect;olympe.public.Process.connect=olympe.public.Process.connect;olympe.public.Process.onShutdown=olympe.public.Process.Ly;olympe.public.Process.onHealthCheck=olympe.public.Process.Ky;'object'===typeof exports&&(exports={CloudObject:olympe.dc.CloudObject,Relation:olympe.dc.Oa.Relation,Direction:olympe.dc.wa,generateTag:olympe.Y.Cf,tagToString:olympe.dc.ga,register:olympe.dc.register,defineProperty:olympe.dc.defineProperty,defineRelation:olympe.dc.Cr,defineInverseRelation:olympe.dc.Ew,BrickContext:olympe.sc.xa,Brick:olympe.sc.logic.Function,ActionBrick:olympe.sc.logic.Action,GlobalProperties:olympe.sc.xa.C,registerBrick:olympe.sc.logic.na.C,FunctionBrick:olympe.sc.logic.Function,
1132
- Context:olympe.sc.xa,Entry:olympe.dc.Oa.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.sc.File,User:olympe.dm.User,Enum:olympe.dm.Wf,EnumValue:olympe.sc.oi,DataSource:olympe.dm.DataSource,DataResult:olympe.dc.query.td,Workflow:olympe.sc.workflow.Workflow,WorkflowState:olympe.sc.workflow.Te,WorkflowTransition:olympe.sc.workflow.Transition,
1133
- WorkflowObjectState:olympe.sc.workflow.ObjectState,Transaction:olympe.sc.Wa,BurstTransaction:olympe.dc.ji,TransactionResult:olympe.sc.Si,PredefinedDataSource:olympe.dc.Ra,QueryResult:olympe.dc.Qa,Query:olympe.dc.pa,QuerySingle:olympe.dc.gd,Predicate:olympe.dc.query.Ba,Order:olympe.dc.query.Xj,Config:class{static getParameter(a){return olympe.W.getParameter(a)}},Process:olympe.public.Process,ProbeType:olympe.host.ze.C,Cache:{getCacheEntries:()=>olympe.dc.sources.Xd().O,clearCache:a=>Ck(olympe.dc.sources.Xd(),
1134
- a),getProcessingStatus:()=>olympe.dc.sources.Xd().Gc(),getProcessingErrors:()=>olympe.dc.sources.Xd().hc.asObservable(),hasPendingChanges:()=>olympe.dc.sources.Xd().ea.asObservable(),synchroniseChanges:()=>Ik(),getPendingChanges:()=>Lk(),clearPendingChanges:()=>Pk(),loadPendingChanges:a=>Nk(a)},Color:olympe.D.Color,ErrorFlow:olympe.sc.logic.Error,ServiceRequestType:olympe.N.cb.C,ServiceRequest:olympe.N.Sc,Service:olympe.N.wb,Auth:olympe.public.Ka,AuthState:{INIT:olympe.auth.Ta.C.INIT,AUTHENTICATING:olympe.auth.Ta.C.uj,
1131
+ olympe.public.Ka.getToken=olympe.public.Ka.le;olympe.public.Ka.observeUser=olympe.public.Ka.Jy;olympe.public.Ka.getCurrentUser=olympe.public.Ka.ix;olympe.public.Ka.isAuthenticated=olympe.public.Ka.Jk;olympe.public.Ka.getState=olympe.public.Ka.getState;olympe.public.Ka.generateSRPData=olympe.public.Ka.Uw;olympe.public.Ba=class{static create(a){return new class extends olympe.dc.$.kg{C(b,c){b=a(olympe.dc.CloudObject.get(c));if('boolean'===typeof b)return b;const d=olympe.D.ec(olympe.D.fa),e=b.subscribe(f=>d.update(olympe.D.Sb(f)));olympe.D.Wa().Z(()=>e.unsubscribe());return d.sb()}}}};
1132
+ olympe.public.gf=class{static create(a){return new class extends olympe.dc.vc.kg{G(b,c){return olympe.dc.CloudObject.get(c)}compare(b,c){b=a(b,c);if('number'===typeof b)return b;const d=olympe.D.ec(olympe.D.ba),e=b.subscribe(f=>d.update(olympe.D.ra(f)));olympe.D.Wa().Z(()=>e.unsubscribe());return d.sb()}}}};olympe.public.Process=class{static Ky(a,b){if('string'===typeof b)throw Error('When registering a health check, the options parameter should be an object: string is not supported anymore.');const c=olympe.host.Dk(),d=c.C(a,void 0,null==b?void 0:b.type);return()=>c.G(d)}static Ly(a,b){const c=olympe.host.Dk(),d=c.F(a,b);return()=>c.O(d)}static connect(){return olympe.N.Qm().connect()}static disconnect(){return olympe.N.Qm().disconnect()}static Kf(a){a='function'===typeof a.F?a.F():a;return olympe.N.Qm().Kf().asObservable(a).pipe(rxjs.operators.map(b=>
1133
+ b.valueOf()))}};olympe.public.Process.isOnline=olympe.public.Process.Kf;olympe.public.Process.disconnect=olympe.public.Process.disconnect;olympe.public.Process.connect=olympe.public.Process.connect;olympe.public.Process.onShutdown=olympe.public.Process.Ly;olympe.public.Process.onHealthCheck=olympe.public.Process.Ky;'object'===typeof exports&&(exports={CloudObject:olympe.dc.CloudObject,Relation:olympe.dc.Pa.Relation,Direction:olympe.dc.wa,generateTag:olympe.Y.Cf,tagToString:olympe.dc.ga,register:olympe.dc.register,defineProperty:olympe.dc.defineProperty,defineRelation:olympe.dc.Cr,defineInverseRelation:olympe.dc.Ew,BrickContext:olympe.sc.xa,Brick:olympe.sc.logic.Function,ActionBrick:olympe.sc.logic.Action,GlobalProperties:olympe.sc.xa.C,registerBrick:olympe.sc.logic.na.C,FunctionBrick:olympe.sc.logic.Function,
1134
+ Context:olympe.sc.xa,Entry:olympe.dc.Pa.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.sc.File,User:olympe.dm.User,Enum:olympe.dm.Wf,EnumValue:olympe.sc.oi,DataSource:olympe.dm.DataSource,DataResult:olympe.dc.query.td,Workflow:olympe.sc.workflow.Workflow,WorkflowState:olympe.sc.workflow.Te,WorkflowTransition:olympe.sc.workflow.Transition,
1135
+ WorkflowObjectState:olympe.sc.workflow.ObjectState,Transaction:olympe.sc.Xa,BurstTransaction:olympe.dc.ji,TransactionResult:olympe.sc.Si,PredefinedDataSource:olympe.dc.Sa,QueryResult:olympe.dc.Ra,Query:olympe.dc.pa,QuerySingle:olympe.dc.gd,Predicate:olympe.dc.query.Ba,Order:olympe.dc.query.Xj,Config:class{static getParameter(a){return olympe.W.getParameter(a)}},Process:olympe.public.Process,ProbeType:olympe.host.ze.C,Cache:{getCacheEntries:()=>olympe.dc.sources.Xd().O,clearCache:a=>Bk(olympe.dc.sources.Xd(),
1136
+ a),getProcessingStatus:()=>olympe.dc.sources.Xd().Gc(),getProcessingErrors:()=>olympe.dc.sources.Xd().hc.asObservable(),hasPendingChanges:()=>olympe.dc.sources.Xd().ea.asObservable(),synchroniseChanges:()=>Hk(),getPendingChanges:()=>Kk(),clearPendingChanges:()=>Ok(),loadPendingChanges:a=>Mk(a)},Color:olympe.D.Color,ErrorFlow:olympe.sc.logic.Error,ServiceRequestType:olympe.N.eb.C,ServiceRequest:olympe.N.Sc,Service:olympe.N.wb,Auth:olympe.public.Ka,AuthState:{INIT:olympe.auth.Ta.C.INIT,AUTHENTICATING:olympe.auth.Ta.C.uj,
1135
1137
  GUEST:olympe.auth.Ta.C.si,AUTHENTICATED:olympe.auth.Ta.C.df,ERROR:olympe.auth.Ta.C.xb},AuthProtocol:olympe.auth.Ec.C,Sync:olympe.dc.CloudObject,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.lb{static get(){return olympe.dc.ia()}},ListDef:olympe.dc.za,
1136
- instanceToTag:olympe.dc.ga,registerSync:olympe.dc.na.C,getUniqueTag:olympe.Y.Cf,onDestroy:a=>olympe.D.$a().onDestroy(a),offDestroy:a=>olympe.D.$a().Mf(a),FollowRules:olympe.dc.Nb,transformers:{Related:olympe.dc.da.Qe,RecursiveRelated:olympe.dc.da.Ae,Distinct:olympe.dc.da.mi,Filter:olympe.dc.da.jf,Limit:olympe.dc.da.uh,Sort:olympe.dc.da.Kg,Union:olympe.dc.da.xf},ListDefPredicate:olympe.public.Ba,predicates:{And:olympe.dc.$.Fd,Or:olympe.dc.$.xe,Not:olympe.dc.$.de,Equals:olympe.dc.$.se,Contains:olympe.dc.$.hf,
1137
- Greater:olympe.dc.$.Nj,Smaller:olympe.dc.$.kk,HasRelated:olympe.dc.$.vi,InstanceOf:olympe.dc.$.yi,Regex:olympe.dc.$.uf},Comparator:olympe.public.gf,comparators:{Number:olympe.dc.vc.Number,String:olympe.dc.vc.String,DateTime:olympe.dc.vc.DateTime},valuedefs:{BooleanProperty:olympe.dc.Za.yj,StringProperty:olympe.dc.Za.Oi,NumberProperty:olympe.dc.Za.Hi,DateTimeProperty:olympe.dc.Za.li,Constant:olympe.dc.Za.Le,Tag:olympe.dc.Za.Qi}});
1138
+ instanceToTag:olympe.dc.ga,registerSync:olympe.dc.na.C,getUniqueTag:olympe.Y.Cf,onDestroy:a=>olympe.D.Wa().onDestroy(a),offDestroy:a=>olympe.D.Wa().Mf(a),FollowRules:olympe.dc.Nb,transformers:{Related:olympe.dc.da.Qe,RecursiveRelated:olympe.dc.da.Ae,Distinct:olympe.dc.da.mi,Filter:olympe.dc.da.jf,Limit:olympe.dc.da.uh,Sort:olympe.dc.da.Kg,Union:olympe.dc.da.xf},ListDefPredicate:olympe.public.Ba,predicates:{And:olympe.dc.$.Fd,Or:olympe.dc.$.xe,Not:olympe.dc.$.de,Equals:olympe.dc.$.se,Contains:olympe.dc.$.hf,
1139
+ Greater:olympe.dc.$.Nj,Smaller:olympe.dc.$.kk,HasRelated:olympe.dc.$.vi,InstanceOf:olympe.dc.$.yi,Regex:olympe.dc.$.uf},Comparator:olympe.public.gf,comparators:{Number:olympe.dc.vc.Number,String:olympe.dc.vc.String,DateTime:olympe.dc.vc.DateTime},valuedefs:{BooleanProperty:olympe.dc.$a.yj,StringProperty:olympe.dc.$a.Oi,NumberProperty:olympe.dc.$a.Hi,DateTimeProperty:olympe.dc.$a.li,Constant:olympe.dc.$a.Le,Tag:olympe.dc.$a.Qi}});
1138
1140
 
1139
1141
 
1140
1142
  }.bind(this))();