@olympeio/runtime-node 9.11.1 → 9.11.2
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
|
@@ -252,16 +252,16 @@ function wa(a,b){a=void 0!==a?String(a):' ';return 0<b&&a?a.repeat(Math.ceil(b/a
|
|
|
252
252
|
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)}});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}});
|
|
253
253
|
ea('Array.prototype.flatMap',function(a){return a?a:function(b,c){for(var d=[],e=0;e<this.length;e++){var f=b.call(c,this[e],e,this);Array.isArray(f)?d.push.apply(d,f):d.push(f)}return d}});ea('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 xa=this||self;
|
|
254
254
|
function w(a,b){a=a.split('.');let c=xa;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={ee:()=>'object'===typeof window?window:'object'===typeof global?global:self};if('olympe'in olympe.ee())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.ee().olympe=olympe;olympe.XE=(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=require('util');function Aa(a){if('string'===typeof a)return a;let b=a;'function'===typeof(null==a?void 0:a.toJSON)&&(b=a.toJSON());let c,d;return'function'===typeof(null==(c=b)?void 0:c.toString)&&(null==(d=b)?void 0:d.toString)!==Object.prototype.toString?b.toString():za.inspect(b,{maxStringLength:1E4,depth:null,breakLength:Infinity})}function Ba(a,b){return JSON.stringify({level:a,message:b.map(Aa).join(' ')})}
|
|
255
|
-
const Ca=console.trace,Da=console.debug,Ea=console.log,Fa=console.info,Ga=console.warn,Ha=console.error;console.trace=(...a)=>Ca.call(console,Ba('TRACE',a));console.debug=(...a)=>Da.call(console,Ba('DEBUG',a));console.log=(...a)=>Ea.call(console,Ba('LOG',a));console.info=(...a)=>Fa.call(console,Ba('INFO',a));console.warn=(...a)=>Ga.call(console,Ba('WARN',a));console.error=(...a)=>Ha.call(console,Ba('ERROR',a));olympe.Va={};olympe.Va.node={};olympe.W={};olympe.W.Of={};olympe.W.Of.Oo=class{process(a){for(const b of Object.keys(a.De))if(a.xd(b).Mn())throw Error('Service "'+b+'" is defined as abstract and needs to be overridden');}};olympe.W.Of.Oo.za=[olympe.W.Of.er];olympe.W.Of.Po=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.xd(e);c(e.zj(),f);for(const g of Ia(e))c(g.zj(),f)}}function c(e,f){for(const g of e)g instanceof olympe.W.rb&&b(g.T(),f)}const d=new Set(Object.keys(a.De));for(const e of d)b(e,[])}};olympe.W.Of.Po.za=[olympe.W.Of.er];olympe.W.Of.er=class{process(){}};const Ja=[],Ka=[];function La(a){const b=a
|
|
255
|
+
const Ca=console.trace,Da=console.debug,Ea=console.log,Fa=console.info,Ga=console.warn,Ha=console.error;console.trace=(...a)=>Ca.call(console,Ba('TRACE',a));console.debug=(...a)=>Da.call(console,Ba('DEBUG',a));console.log=(...a)=>Ea.call(console,Ba('LOG',a));console.info=(...a)=>Fa.call(console,Ba('INFO',a));console.warn=(...a)=>Ga.call(console,Ba('WARN',a));console.error=(...a)=>Ha.call(console,Ba('ERROR',a));olympe.Va={};olympe.Va.node={};olympe.W={};olympe.W.Of={};olympe.W.Of.Oo=class{process(a){for(const b of Object.keys(a.De))if(a.xd(b).Mn())throw Error('Service "'+b+'" is defined as abstract and needs to be overridden');}};olympe.W.Of.Oo.za=[olympe.W.Of.er];olympe.W.Of.Po=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.xd(e);c(e.zj(),f);for(const g of Ia(e))c(g.zj(),f)}}function c(e,f){for(const g of e)g instanceof olympe.W.rb&&b(g.T(),f)}const d=new Set(Object.keys(a.De));for(const e of d)b(e,[])}};olympe.W.Of.Po.za=[olympe.W.Of.er];olympe.W.Of.er=class{process(){}};const Ja=[],Ka=[];function La(a){const b=a.Ya();b.debug('Registering configurations...');b.j++;Ja.forEach(c=>{B(a.G,'Registering configure callback '+(c.j?'for module '+c.j:''));a.H.push(c.D)});Ma(b);b.debug('done registering')}function Na(a){const b=a.Ya();b.debug('Running run callbacks of container...');b.j++;Ka.forEach(c=>{const d=Oa(a,c.zj());a.G.debug('Calling run callback '+`for module ${c.j}`);c.D.apply(null,d)});Ma(b);b.debug('done calling run callbacks. DI process completed!')}
|
|
256
256
|
olympe.W.Uo=class{constructor(){}static j(a,b){Ja.push(new olympe.W.Sl(a,b))}static D(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');});Ka.push(new olympe.W.Sl(b,c,a))}};olympe.W.config=olympe.W.Uo.j;olympe.W.run=olympe.W.Uo.D;olympe.W.Os=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.Uj=class{constructor(){}getValue(){}};function Pa(a,b){let c,d;return null!=(d=null==(c=a.F)?void 0:c.call(a,b))?d:!0}olympe.W.Sl=class{constructor(a,b,c){this.D=a;this.Wd=(null!=c?c:[]).map(d=>'string'===typeof d?new olympe.W.rb(d):d);this.j=null!=b?b:'no name di callback';this.F=null}zj(){return this.Wd}};function Ra(a,b){var c=olympe.W.P.Fg;if(void 0!==a.j[c])throw Error('Service "'+c+'" has already been instantiated');a.j[c]=b}function Sa(a,b,c){let d=a.j[b];if(void 0===d){const e=a.H[b];if(void 0===e){if(c===olympe.W.Bh.j.Cm)return null;throw Error('Service "'+b+'" not found');}try{d=e.instantiate(a)}catch(f){throw a.G.error('Error during instantiation of service '+b),f;}!e.F&&(a.j[b]=d)}return d}
|
|
257
257
|
function Ta(a,b,c){b=b.toLowerCase();let d;const e=null!=(d=a.D.get(b))?d:[];e.push(c);a.D.set(b,e)}function Oa(a,b){const c=b.length,d=Array(c);let e,f;for(e=0;e<c;e++)a.G.j++,f=b[e],d[e]=f instanceof olympe.W.Uj?f.getValue(a):f,Ma(a.G);return d}
|
|
258
|
-
olympe.W.Bh=class{constructor(a,b,c,d,e=2){this.H=a;this.F=b;this.parameters=c;this.j=Object.create(null);this.G=new olympe.W.tq(e);this.D=new Map;Ra(this,this);this.G.debug('Instantiate all computed parameters');d.forEach(f=>Sa(this,f).subscribe(this.Qj.bind(this,f)))}
|
|
258
|
+
olympe.W.Bh=class{constructor(a,b,c,d,e=2){this.H=a;this.F=b;this.parameters=c;this.j=Object.create(null);this.G=new olympe.W.tq(e);this.D=new Map;Ra(this,this);this.G.debug('Instantiate all computed parameters');d.forEach(f=>Sa(this,f).subscribe(this.Qj.bind(this,f)))}Ya(){return this.G}getParameter(a){a=a.toLowerCase();let b;return null!=(b=this.parameters[a])?b:this.F[a]}Qj(a,b){a=a.toLowerCase();if(this.parameters[a]!==b){var c,d;this.G.debug(`Updating parameter ${a} to ${b} and notify ${null!=
|
|
259
259
|
(d=null==(c=this.D.get(a))?void 0:c.length)?d:0} listeners.`);this.parameters[a]=b;var e;for(const f of null!=(e=this.D.get(a))?e:[])f(b)}}};olympe.W.Bh.j={iu:'exception',Cm:'null'};function Ua(a,b){b=olympe.W.Os(b);for(const [c,d]of b)Va(a,c,d)}function C(a,b,c,...d){B(a.G,'Defining service '+b);a.j(b,c,d,!1,!1)}function Wa(a,b,c,...d){B(a.G,'Defining service '+b);a.j(b,c,d,!1,!0)}function D(a,b,c,d,e=!1){B(a.G,'Defining service (as a factory) '+b);a.j(b,d,c,!0,e)}function Xa(a,b,c,d=!1){B(a.G,'Defining service alias '+b);a.j(b,e=>e,[c],!0,d)}function Ya(a,b){B(a.G,'Defining abstract service '+b);a.j(b).D=!0}function Va(a,b,c){a.parameters[b.toLowerCase()]=c}
|
|
260
260
|
function Za(a,b,c,d){a.F.push(b);Va(a,b,d(...c.map(e=>a.getParameter(e))));D(a,b,c.map(e=>new olympe.W.Eh(e)),(...e)=>rxjs.combineLatest(e).pipe(rxjs.operators.skip(1),rxjs.operators.map(f=>d(...f)),rxjs.operators.distinctUntilChanged()))}function E(a,b,c){a.D[b.toLowerCase()]=c}
|
|
261
|
-
olympe.W.Zt=class{constructor(a,b){this.De=Object.create(null);this.parameters=Object.create(null);this.D=Object.create(null);this.F=[];Ua(this,a);Ua(this,b);this.R=[new olympe.W.Of.Oo,new olympe.W.Of.Po];this.H=[];a=this.getParameter(olympe.W.U.pv);this.N=void 0!==a?a:3;this.G=new olympe.W.tq(this.N)}
|
|
261
|
+
olympe.W.Zt=class{constructor(a,b){this.De=Object.create(null);this.parameters=Object.create(null);this.D=Object.create(null);this.F=[];Ua(this,a);Ua(this,b);this.R=[new olympe.W.Of.Oo,new olympe.W.Of.Po];this.H=[];a=this.getParameter(olympe.W.U.pv);this.N=void 0!==a?a:3;this.G=new olympe.W.tq(this.N)}Ya(){return this.G}j(a,b,c,d,e){const f=a instanceof olympe.W.rb?a.T():a;if(3<=arguments.length&&c){const h=c.indexOf(f);if(-1!==h){if(void 0===this.De[f])throw Error(`ContainerBuilder.define: Service ${f} references itself and is not an override definition!`);
|
|
262
262
|
var g=this.De[f];g.id=g.id+'!!'+ ++olympe.W.cm.j;g.F=!0;g=g.id;c[h]=g;this.De[g]=this.De[f]}}this.De[f]=new olympe.W.cm(b,c,d||!1,f);return this.De[f]}xd(a){const b=this.De[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.D[a]}compile(){const a=this.H;this.G.debug('Calling '+a.length+' configure callbacks');this.G.j++;a.forEach(b=>{B(this.G,'Calling callback');this.G.j++;b(this);Ma(this.G)});
|
|
263
263
|
Ma(this.G);this.G.debug('Configuration summary: '+Object.keys(this.De).length+' definitions');this.G.debug('Compiling...');this.G.j++;this.R.forEach((b,c)=>{this.G.debug('running compilation pass '+(c+1)+': '+b.constructor.name);b.process(this)});Ma(this.G);this.G.debug('Compilation done, returning container');return new olympe.W.Bh(this.De,this.D,this.parameters,this.F,this.N)}};function Ia(a){let b,c;return null!=(c=null==(b=a.j)?void 0:b.values())?c:[]}
|
|
264
|
-
olympe.W.cm=class{constructor(a,b,c,d){this.H=a||null;this.N=!!c;this.Wd=(null!=b?b:[]).map(e=>'string'===typeof e?new olympe.W.rb(e):e);this.D=!1;this.j=null;this.id=null!=d?d:'';this.F=!1}T(){return this.id}instantiate(a){const b=a
|
|
264
|
+
olympe.W.cm=class{constructor(a,b,c,d){this.H=a||null;this.N=!!c;this.Wd=(null!=b?b:[]).map(e=>'string'===typeof e?new olympe.W.rb(e):e);this.D=!1;this.j=null;this.id=null!=d?d:'';this.F=!1}T(){return this.id}instantiate(a){const b=a.Ya();b.debug('Resolving arguments for '+this.id);const c=this.H;let d=Oa(a,this.Wd);const e=()=>{if(this.N)return c.apply(null,d);d.unshift(null);return new (c.bind.apply(c,d))};B(b,'Instantiating '+this.id);const f=olympe.C?olympe.C.lh().run(()=>e()):e();let g;if(0<
|
|
265
265
|
(null==(g=this.j)?void 0:g.size)){b.j++;B(b,'Calling configuration callbacks:');for(const h of this.j.values())b.j++,B(b,'Check if need to call additional configuration callback '+h.j),Pa(h,f)?(B(b,'Calling additional configuration callback '+h.j),d=Oa(a,h.zj()),d.push(f),h.D.apply(null,d)):B(b,'Will not call additional configuration callback '+h.j+'predicate has returned false'),Ma(b);Ma(b)}B(b,'Done instantiating '+this.id);return f}zj(){return this.Wd}Mn(){return this.D}config(a,b,c,d,e){null===
|
|
266
266
|
this.j&&(this.j=new Map);var f=this.j,g=f.set;b=new olympe.W.Sl(c,e,b);b.F=d;g.call(f,a,b)}};olympe.W.cm.j=0;olympe.W.Eh=class extends olympe.W.Uj{constructor(a){super();this.id=a}T(){return this.id}getValue(a){return new rxjs.Observable(b=>{b.next(a.getParameter(this.id));Ta(a,this.id,c=>b.next(c))})}};function Ma(a){0<a.j&&a.j--}function B(a,b){1>=a.D&&$a(a,'log','DI: '+b)}function $a(a,b,c){if(console&&console[b]){var d='';for(let e=0;e<a.j;e++)d+=' ';console[b](d+c)}}olympe.W.tq=class{constructor(a){this.D=a;this.j=0}debug(a){2>=this.D&&$a(this,'log','DI: '+a)}info(a){3>=this.D&&$a(this,'info','DI: '+a)}warn(a){4>=this.D&&$a(this,'warn','DI: '+a)}error(a){5>=this.D&&$a(this,'error','DI: '+a)}};olympe.W.pa=class extends olympe.W.Uj{constructor(a){super();this.id=a}T(){return this.id}getValue(a){return a.getParameter(this.id)}};olympe.W.rb=class extends olympe.W.Uj{constructor(a,b){super();this.id=a;this.j=b||olympe.W.Bh.j.iu}T(){return this.id}getValue(a){return Sa(a,this.id,this.j)}};olympe.W.P={Fg:'di.Container',FC:'di.PublicContainer'};olympe.W.U={pv:'logging.di'};olympe.W.run([olympe.W.P.Fg],a=>{olympe.W.getParameter=b=>a.getParameter(b);olympe.W.Qj=(b,c)=>a.Qj(b,c);olympe.ee().getConfig=b=>a.getParameter(b);olympe.ee().getConfigNames=()=>Object.keys(a.parameters);olympe.ee().updateConfig=(b,c)=>a.Qj(b,c)});olympe.V={};olympe.V.hq=class{constructor(a){this.id=a||olympe.V.hq.j++}Fa(a){return a?this.id===a.id:!1}toJSON(){return this.id.toString()}toString(){return this.id.toString()}print(){return('000000'+this.id).substr(-6)}};olympe.V.hq.j=0;olympe.V.iC=class{constructor(a,b,c,d,e,f){this.j=[a||0,b||0,0,c||0,d||0,0,e||0,f||0,1]}set(a,b,c){this.j[3*a+b]=c}get(a,b){return this.j[3*a+b]}};olympe.V.Oh=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.V.Oh.D=function(a){return new olympe.V.Oh(.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.V.Oh.j=function(){return new olympe.V.Oh(0,0,0,0,0,0,0,0,0,.2125,.7154,.0721,0)};olympe.V.Oh.prototype.set=function(a,b,c){this.values[5*a+b]=c};olympe.V.Oh.prototype.get=function(a,b){return this.values[5*a+b]};function ab(a){return(new TextEncoder).encode(a)}function bb(a,b){return a.j(ab(b))}function cb(a){return(new TextDecoder('utf8')).decode(a)}function eb(a){const b=new olympe.V.stream.mg;for(let c=0;c<a.length;c+=65536){const d=c+65536;b.write(a.subarray(c,d>a.length?a.length:d))}b.complete();return b}
|
|
267
267
|
olympe.V.Jl=class{D(){}j(){}H(a){return u(function*(){if(a instanceof ArrayBuffer)return new Uint8Array(a);if(a instanceof Uint8Array)return a;if('string'===typeof a)return ab(a);if(a instanceof Blob)return new Uint8Array(yield a.arrayBuffer());if(a instanceof olympe.V.stream.mg){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.');})}F(){}};
|
|
@@ -313,9 +313,9 @@ a.F}Fa(a){return this.j===a.j&&this.D===a.D&&this.F===a.F}toString(){return`${th
|
|
|
313
313
|
olympe.ia.yb.j={Gw:0,bg:1,ov:2,pk:3,ms:4,zb:5,lu:6,lC:7};olympe.ia.yb.D={0:'TRACE',1:'DEBUG',2:'LOG',3:'INFO',4:'WARN',5:'ERROR',6:'FATAL',7:'NOTHING'};olympe.ia.Ua=class{cd(){}};olympe.ia.we={};function Jb(a,b,c){a.Ha[b](`[OLYMPE.${a.Y}]:`,...c);if(0<a.R.size){var d=new Date;d=('00'+d.getHours()).substring(-2)+':'+('00'+d.getMinutes()).substring(-2)+':'+('00'+d.getSeconds()).substring(-2)+'.'+('00'+d.getMilliseconds()).substring(-3);for(const e of a.R.values())e(d,a.Y,b,...c)}}
|
|
314
314
|
olympe.ia.we.yb=class{constructor(a,b){this.name=a;const c=b instanceof rxjs.Observable;this.D=c?olympe.ia.yb.j.pk:b;c&&b.subscribe(d=>{this.D=d});this.Y=a.toUpperCase();this.R=new Map;this.Ha=console}la(){return this.name}H(){return this.D}F(){return this.D<=olympe.ia.yb.j.Gw}j(){return this.D<=olympe.ia.yb.j.bg}N(){return this.D<=olympe.ia.yb.j.ov}ja(){return this.D<=olympe.ia.yb.j.pk}ta(){return this.D<=olympe.ia.yb.j.ms}$(){return this.D<=olympe.ia.yb.j.zb}ea(){return this.D<=olympe.ia.yb.j.lu}trace(...a){this.F()&&
|
|
315
315
|
Jb(this,'trace',a)}debug(...a){this.j()&&Jb(this,'debug',a)}log(...a){this.N()&&Jb(this,'log',a)}info(...a){this.ja()&&Jb(this,'info',a)}warn(...a){this.ta()&&Jb(this,'warn',a)}error(...a){this.$()&&Jb(this,'error',a)}fatal(...a){this.ea()&&Jb(this,'error',a)}};olympe.ia.we.yb.za=[olympe.ia.yb];olympe.ia.we.Ua=class{constructor(a,b,c){this.j=a;this.D=parseInt(b,10);this.F=c;this.channels=new Map;this.G=this.cd('logging');this.G.log('Logging initialized, global log level is '+olympe.ia.yb.D[b])}cd(a){var b=this.channels.get(a);if(!b){b=`${olympe.ia.U.St}.${a}`;var c;const d=new rxjs.BehaviorSubject(null!=(c=this.j.getParameter(b))?c:this.D);Ta(this.j,b,e=>{d.next(e)});c=this.F;b=`${b}.${olympe.ia.U.rw}`;Object.prototype.hasOwnProperty.call(this.j.parameters,b.toLowerCase())&&(c=!0===this.j.getParameter(b));
|
|
316
|
-
b=new olympe.ia.we.yb(a,d.asObservable(),c);this.channels.set(a,b)}return b}};olympe.ia.we.Ua.za=[olympe.ia.Ua];olympe.ia.P={Ea:'logging.Manager'};olympe.ia.U={Gp:'logging',Hp:'logging.showLogLevel',St:'logging',rw:'showLogLevel'};olympe.W.config(function(a){E(a,olympe.ia.U.Gp,olympe.ia.yb.j.pk);E(a,olympe.ia.U.Hp,!0);Wa(a,olympe.ia.P.Ea,olympe.ia.we.Ua,olympe.W.P.Fg,new olympe.W.pa(olympe.ia.U.Gp),new olympe.W.pa(olympe.ia.U.Hp))},'olympe.logging');olympe.W.run([olympe.ia.P.Ea],a=>{olympe.ia
|
|
316
|
+
b=new olympe.ia.we.yb(a,d.asObservable(),c);this.channels.set(a,b)}return b}};olympe.ia.we.Ua.za=[olympe.ia.Ua];olympe.ia.P={Ea:'logging.Manager'};olympe.ia.U={Gp:'logging',Hp:'logging.showLogLevel',St:'logging',rw:'showLogLevel'};olympe.W.config(function(a){E(a,olympe.ia.U.Gp,olympe.ia.yb.j.pk);E(a,olympe.ia.U.Hp,!0);Wa(a,olympe.ia.P.Ea,olympe.ia.we.Ua,olympe.W.P.Fg,new olympe.W.pa(olympe.ia.U.Gp),new olympe.W.pa(olympe.ia.U.Hp))},'olympe.logging');olympe.W.run([olympe.ia.P.Ea],a=>{olympe.ia.Ya=b=>a.cd(b)},'Logging singleton getter initialization');olympe.C={};olympe.C.U={zq:'df.nodeCreationThreshold'};const Kb=[];function Lb(){}function Mb(){}olympe.C.J=class a{constructor(b,c,d){this.j=void 0===b?Lb:b;this.D=void 0===c?Kb:c;this.Y=d}static H(){var b=[];return void 0===b||0===b.length?olympe.C.J.$:new a(Mb,b)}H(){return this.j?this.j():void 0}F(){return this.D?this.D:Kb}N(){return null===this.j&&null===this.D}R(){return this.j===Mb}};olympe.C.J.Y=new olympe.C.J;olympe.C.J.j=new olympe.C.J(null,null);olympe.C.J.$=new olympe.C.J(Mb);olympe.C.J.F=new olympe.C.J(()=>olympe.C.aa);
|
|
317
317
|
olympe.C.J.D=new olympe.C.J(()=>olympe.C.Ta);olympe.C.J.N=new olympe.C.J(()=>olympe.C.da);olympe.C.J.R=new olympe.C.J(()=>olympe.C.Zb);olympe.C.Gh=class{T(){return''}Dn(){return''}destroy(){}gb(){return!1}jd(){return!1}run(a,...b){return a(...b)}tc(a){return a}getParent(){return null}tt(){}oe(){}detach(){}el(){}sg(){}onDestroy(){return''}Xf(){}Yd(){return''}it(){}};olympe.C.Gh.prototype.offDestroy=olympe.C.Gh.prototype.Xf;olympe.C.Gh.prototype.onDestroy=olympe.C.Gh.prototype.onDestroy;let Nb=0;olympe.W.run([new olympe.W.pa(olympe.C.U.zq)],()=>{});
|
|
318
|
-
olympe.C.Wb=class{constructor(a='SimpleContext',b){++Nb;this.ea=new Map;this.$=new Map;this.Y=new Map;this.Ha=0;this.name=a;this.id=String(Nb);this.F=this.ja=!1;(this.N=void 0===b?olympe.C
|
|
318
|
+
olympe.C.Wb=class{constructor(a='SimpleContext',b){++Nb;this.ea=new Map;this.$=new Map;this.Y=new Map;this.Ha=0;this.name=a;this.id=String(Nb);this.F=this.ja=!1;(this.N=void 0===b?olympe.C.$a():b)&&this.N.oe(this);this.debug=!1}T(){return this.id}Dn(){return this.name}run(a,...b){if(!this.ja){var c=olympe.C.st(this);a=a(...b);c&&olympe.C.st(c);return a}}tc(a){return(...b)=>this.run(a,...b)}destroy(){if(!this.ja&&!this.F){this.F=!0;this.sg();for(const a of this.$.keys())this.$.has(a)&&this.$.get(a)();
|
|
319
319
|
this.$.clear();this.Y.clear();this.N&&(this.N.detach(this,!1),this.N=null);this.ja=!0;this.F=!1;this.sg()}}gb(){return this.ja}jd(){return this.F}oe(a){if(!this.ja){var b;olympe.C.hb(a)?b=a.Ca:olympe.C.Pn(a)&&(b=a);b&&this.ea.set(b.T(),b)}}detach(a,b=!0){let c;olympe.C.hb(a)?c=a.Ca:olympe.C.Pn(a)&&(c=a);c&&this.ea.has(c.T())&&(b&&c.el(this),this.ea.delete(c.T()))}el(){this.N=null;this.destroy()}sg(){const a=this.ea;for(const b of a.keys())a.has(b)&&a.get(b).el(this);this.ea.clear();for(const b of this.Y.keys())this.Y.has(b)&&
|
|
320
320
|
this.Y.get(b)();this.Y.clear()}onDestroy(a,b){void 0===b&&(++this.Ha,b=String(this.Ha));this.$.set(b,a);return b}Xf(a){this.$.delete(a)}Yd(a){if(void 0===b){++this.Ha;var b=String(this.Ha)}this.Y.set(b,a);return b}it(a){this.Y.delete(a)}tt(a){this.N&&this.N.detach(this,!1);(this.N=a||null)&&this.N.oe(this)}getParent(){return this.N}};olympe.C.Dr=class extends olympe.C.Wb{constructor(){super('Root',null)}destroy(){}onDestroy(){return''}Xf(){}};olympe.C.Gh.za=[olympe.C.Gh];let Ob=0;
|
|
321
321
|
function Pb(a,b){a.R||(a.R=new Map);a.R.set(b.T(),b);switch(b.Jc()){case olympe.C.Node.j.Ph:break;case olympe.C.Node.j.bi:break;case olympe.C.Node.j.vk:case olympe.C.Node.j.dg:olympe.C.G.warn('Not bad as such but should not happen!');break;case olympe.C.Node.j.Hh:Qb(a,olympe.C.Node.j.Hh);break;case olympe.C.Node.j.OBSOLETE:a.mb=!0;a.j!==olympe.C.Node.j.Hh&&Qb(a,olympe.C.Node.j.OBSOLETE);break;case olympe.C.Node.j.$d:olympe.C.G.warn('Adding a destroyed node as upstream => should never happen!');break;
|
|
@@ -330,7 +330,7 @@ function cc(a,b){if(a.j!==olympe.C.Node.j.dg&&a.j!==olympe.C.Node.j.$d&&(a.j!==o
|
|
|
330
330
|
function Ub(a,b){b===a?olympe.C.G.error('Setting a node as provider of itself. Ignoring'):(a.D&&a.D!==b&&Xb(a),Rb(b,a),Tb(b)?L(a,b.Fb,!0):void 0!==a.defaultValue?L(a,a.defaultValue,!0):cc(a),a.D=b)}function dc(a,b){a.Lc&&(a.Lc=void 0);a.ad='Repeater';Ub(a,b)}function $b(a){a.D?Zb(a):null!==a.R&&0===Array.from(a.R.values()).filter(b=>!Tb(b)).length&&(a.mb&&(a.mb=!1,Sb(a)),Zb(a))}
|
|
331
331
|
function Rb(a,b){a.H||(a.H=new Map);a.H.set(b.T(),b);a.j===olympe.C.Node.j.$d&&olympe.C.G.warn('adding a downstream node on a deleted one (#'+a.T()+') !')}function Yb(a,b){a.H&&(b=b.T(),a.H.has(b)&&(a.H.delete(b),ec(a)))}function ec(a){if(null===a.getParent()){var b=a.H;b&&0<b.size||a.destroy()}}
|
|
332
332
|
olympe.C.Node=class extends olympe.C.Wb{constructor({valueType:a,Lc:b,Tz:c=!0,Yf:d,Ln:e,debug:f=!1,rg:g=null,ad:h='Node',qj:k}={}){++Ob;super(String(Ob));this.debug=!!f;this.ad=h;h&&'string'===typeof h||(b?this.ad=b.name?b.name:'anon()':this.ad='Node');this.Wd=e&&0<e.length?e:null;this.rg=g&&0<g.length?g:null;this.valueType=a;this.Fb=void 0;this.ta=!1;this.j=olympe.C.Node.j.Ph;this.mb=!1;this.H=this.R=null;this.Lc=b;this.Yf=d||null;this.defaultValue=this.Wa=this.D=void 0;this.qj=k;d&&d instanceof
|
|
333
|
-
olympe.C.Node&&Pb(this,d);if(g)for(b=0;b<g.length;b++)a=e[g[b]],Pb(this,a);c&&Sb(this)}xh(a){this.defaultValue=a;this.j===olympe.C.Node.j.Ph&&L(this,a,!0);return this}sj(a){this.valueType=a}Nb(){return this.valueType||Object}asObservable(a=olympe.C
|
|
333
|
+
olympe.C.Node&&Pb(this,d);if(g)for(b=0;b<g.length;b++)a=e[g[b]],Pb(this,a);c&&Sb(this)}xh(a){this.defaultValue=a;this.j===olympe.C.Node.j.Ph&&L(this,a,!0);return this}sj(a){this.valueType=a}Nb(){return this.valueType||Object}asObservable(a=olympe.C.$a()){return new rxjs.Observable(b=>{const c=a.run(()=>olympe.C.createNode(this.valueType,b.next.bind(b),null,[this],[0],`Observable of ${this.ad}`));c.onDestroy(()=>b.complete());return()=>c.destroy()})}Jc(){return this.j}gb(){return this.j===olympe.C.Node.j.$d}jd(){return this.j===
|
|
334
334
|
olympe.C.Node.j.dg}Eb(...a){if(this.qj instanceof Function)return this.qj(...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.Jc();a!==olympe.C.Node.j.dg&&a!==olympe.C.Node.j.$d||olympe.C.G.warn('Calling a function on a destroyed node!!!',this);a=d.F();b=[];if(1===a.length&&-1===a[0])for(var g of e)olympe.C.hb(g)&&b.push(g.Ca);else for(let h=0,k=a.length;h<k;h++)g=a[h],f=e[g],void 0!==f&&null!==f&&f.gh&&(e[g]=f.Ca,b.push(g));return M(new olympe.C.Node({valueType:d.H(),
|
|
335
335
|
Lc:c,Yf:this,Ln:e,debug:!1,rg:b,ad:'Proxy.'+c+'()'}))}el(a){if(null===this.getParent())olympe.C.G.warn('context is undefined, investigate');else if(this.getParent()!==a){olympe.C.G.warn('Investigate a potential issue in creator-createe link: create node mismatch',a,this.getParent());return}this.tt(null);ec(this)}destroy(){var a=this.j;if(a!==olympe.C.Node.j.dg&&a!==olympe.C.Node.j.$d){Qb(this,olympe.C.Node.j.dg);if(a=this.H){for(const c of a.values())if(a.has(c.T())){var b=c;b.R&&b.R.delete(this.T());
|
|
336
336
|
b.D&&b.D.T()===this.T()?b.D=void 0:b.destroy()}a.clear()}this.H=null;super.destroy();if(this.R){for(const c of this.R.values())this.R.has(c.T())&&Yb(c,this);this.R.clear()}this.R=null;this.D&&(Yb(this.D,this),this.D=void 0);this.Fb=void 0;this.Wd&&(this.Wd.length=0,this.Wd=null);this.rg&&(this.rg.length=0,this.rg=null);this.qj=this.Lc=void 0;this.defaultValue=this.Yf=null;this.ad=`** Destroyed ** ${this.ad}`;Qb(this,olympe.C.Node.j.$d)}}Dn(){return this.ad}print(){const a=this.Lc?this.Lc instanceof
|
|
@@ -345,7 +345,7 @@ g===c&&e()}});return d.tb()}he(a){return olympe.C.ua([this,a],(b,c)=>olympe.C.ra
|
|
|
345
345
|
c.valueOf()),olympe.C.aa,'ONumber.div')}vz(a){return olympe.C.ua([this,a],(b,c)=>olympe.C.ra(b.valueOf()%c.valueOf()),olympe.C.aa,'ONumber.div')}floor(){return olympe.C.ra(Math.floor(this.valueOf()))}ceil(){return olympe.C.ra(Math.ceil(this.valueOf()))}trunc(){return olympe.C.ra(Math.trunc(this.valueOf()))}log(){return olympe.C.ra(Math.log(this.valueOf()))}pow(a){return olympe.C.ua([this,a],(b,c)=>olympe.C.ra(Math.pow(b.valueOf(),c.valueOf())),olympe.C.aa,'ONumber.pow')}exp(){return olympe.C.ra(Math.exp(this.valueOf()))}Kd(a){return olympe.C.ua([this,
|
|
346
346
|
a],(b,c)=>olympe.C.Sb(b.Fa(c)),olympe.C.da,'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}Hy(){return this.valueOf()}On(a){return olympe.C.ua([this,a],(b,c)=>b.valueOf()>c.valueOf()?olympe.C.da.D:olympe.C.da.j,olympe.C.da,'ONumber.isBiggerThan')}Zz(a){return olympe.C.ua([this,a],(b,c)=>b.valueOf()>=c.valueOf()?b:olympe.C.ra(c),olympe.C.aa,'ONumber.returnsBiggest')}ot(a){return olympe.C.ua([this,
|
|
347
347
|
a],(b,c)=>b.valueOf()<=c.valueOf()?b:olympe.C.ra(c),olympe.C.aa,'ONumber.returnsSmallest')}lz(a){return olympe.C.ua([this,a],(b,c)=>b.valueOf()<c.valueOf()?olympe.C.da.D:olympe.C.da.j,olympe.C.da,'ONumber.isSmallerThan')}sin(){return olympe.C.ra(Math.sin(this.valueOf()))}cos(){return olympe.C.ra(Math.cos(this.valueOf()))}atan2(a){return olympe.C.hb(a)?olympe.C.ye([a],b=>olympe.C.ra(Math.atan2(this.valueOf(),b.valueOf())),olympe.C.aa):olympe.C.ra(Math.atan2(this.valueOf(),a.valueOf()))}abs(){return olympe.C.ra(Math.abs(this.valueOf()))}Ij(a,
|
|
348
|
-
b){return olympe.C.hb(a)||olympe.C.hb(b)?olympe.C.ye([a,b],(c,d)=>olympe.C.ra(this.valueOf()*d.valueOf()+c.valueOf()*(1-d.valueOf())),olympe.C.aa):olympe.C.ra(this.valueOf()*b.valueOf()+a.valueOf()*(1-b.valueOf()))}static Zw(a,b,c,d){'number'===typeof a&&(a=olympe.C.ge(a));'number'===typeof b&&(b=olympe.C.ge(b));'number'===typeof c&&(c=olympe.C.ge(c));let e=0;const f=olympe.C.ge(0);let g,h;void 0!==b&&void 0!==c&&olympe.C.Gj(b.On(c),()=>{olympe.ia
|
|
348
|
+
b){return olympe.C.hb(a)||olympe.C.hb(b)?olympe.C.ye([a,b],(c,d)=>olympe.C.ra(this.valueOf()*d.valueOf()+c.valueOf()*(1-d.valueOf())),olympe.C.aa):olympe.C.ra(this.valueOf()*b.valueOf()+a.valueOf()*(1-b.valueOf()))}static Zw(a,b,c,d){'number'===typeof a&&(a=olympe.C.ge(a));'number'===typeof b&&(b=olympe.C.ge(b));'number'===typeof c&&(c=olympe.C.ge(c));let e=0;const f=olympe.C.ge(0);let g,h;void 0!==b&&void 0!==c&&olympe.C.Gj(b.On(c),()=>{olympe.ia.Ya('df').warn('You have a min bigger than max, cap your inputs')});
|
|
349
349
|
const k=(l,n)=>{n=olympe.C.ge(n);const p=olympe.C.aa.animate(n,500);kc(f,p);ic(n,olympe.C.ra(l));e=l};olympe.C.ye([a],l=>{e+=l.valueOf();e>h?k(h,e):e<g?k(g,e):kc(f,olympe.C.ge(e))},olympe.C.aa);void 0!==b&&olympe.C.Rn(b.valueOf(),l=>{if(g!==l&&(g=l,g>e)){const n=olympe.C.ge(e),p=olympe.C.aa.animate(n,400,d);l=olympe.C.ra(g);L(n.Ca,l);e=g;kc(f,p)}});void 0!==c&&olympe.C.Rn(c.valueOf(),l=>{if(h!==l&&(h=l,h<e)){const n=olympe.C.ge(e),p=olympe.C.aa.animate(n,400,d);l=olympe.C.ra(h);L(n.Ca,l);e=h;kc(f,
|
|
350
350
|
p)}});return f}static offset(a){let b;return olympe.C.ye([a],c=>{void 0===b&&(b=c);return olympe.C.ra(c-b)},olympe.C.aa,'offset')}static Es(a){let b,c,d;return olympe.C.ua([a],e=>{if(void 0===b)return b=e,c=window.performance.now(),olympe.C.ra(0);d=window.performance.now();const f=olympe.C.ra((e.valueOf()-b.valueOf())/(d-c));b=e;c=d;return f},olympe.C.aa,'derivative')}static dz(a){let b=olympe.C.ra(0),c,d,e;return olympe.C.ua([a],f=>{if(void 0===c)return c=f,d=window.performance.now(),olympe.C.ra(0);
|
|
351
351
|
e=window.performance.now();b=b.he((f.valueOf()+c.valueOf())/2*(e-d));c=f;d=e;return b},olympe.C.aa,'integrate')}static Ix(a){let b;return olympe.C.ua([a],c=>{void 0===b&&(b=c.valueOf());const d=olympe.C.ra(c.valueOf()-b.valueOf());b=c;return d},olympe.C.aa,'diff')}static xx(a,b,c){return olympe.C.ye([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.C.ra(d>=e?d<=f?d:f:e)},olympe.C.aa)}static animate(a,b,c,d){let e;
|
|
@@ -376,7 +376,7 @@ olympe.C,b=a.xb;var c=this.sb.getDate();c=10>c?'0'+c:c;var d=this.sb.getMonth()+
|
|
|
376
376
|
olympe.C.Ta)}toLocaleTimeString(a){return void 0===a||'string'===typeof a?olympe.C.xb(this.sb.toLocaleTimeString(a)):olympe.C.ua([this,a],(b,c)=>olympe.C.xb(b.sb.toLocaleTimeString(c.valueOf())),olympe.C.Ta)}Wc(){return olympe.C.xb(this.sb.toISOString())}iA(){return new Date(this.getTime())}kA(){return this}mA(){return this}qg(a,b){return olympe.C.ua([b],c=>{const d=new olympe.C.eb(new Date(this.sb.getTime()));d.sb['set'+a](this.sb['get'+a]()+c.valueOf());return d},olympe.C.eb)}ax(a){return this.qg('Milliseconds',
|
|
377
377
|
a)}ix(a){return this.qg('Seconds',a)}bx(a){return this.qg('Minutes',a)}$w(a){return this.qg('Hours',a)}kn(a){return this.qg('Date',a)}jx(a){return'number'===typeof a?this.kn(7*a):this.kn(a.rl(7))}ex(a){return this.qg('Month',a)}kx(a){return this.qg('FullYear',a)}fA(){let a=this.sb.getDay();a=0===a?6:a-1;return new olympe.C.eb(new Date(this.sb.getFullYear(),this.sb.getMonth(),this.sb.getDate()-a))}gA(){return new olympe.C.eb(new Date(this.sb.getFullYear(),this.sb.getMonth()))}Kd(a){return olympe.C.ua([a],
|
|
378
378
|
b=>olympe.C.Sb(this.Fa(b)),olympe.C.da)}Fa(a){return a instanceof olympe.C.eb?this.getTime()===a.getTime()||isNaN(this.getTime())&&isNaN(a.getTime()):!1}zy(){let a=this.sb.getDay();0===a&&(a=7);return olympe.C.ra(a)}qy(a,b){return olympe.C.ua([a,b],(c,d)=>{d=d.valueOf();'years'===d?c=this.sb.getFullYear()-c.sb.getFullYear():'months'===d?c=12*(this.sb.getFullYear()-c.sb.getFullYear())+(this.sb.getMonth()-c.sb.getMonth()):(d={milliseconds:1,seconds:1E3,minutes:6E4,hours:36E5,days:864E5,weeks:6048E5}[d],
|
|
379
|
-
void 0===d&&(olympe.ia
|
|
379
|
+
void 0===d&&(olympe.ia.Ya('df').warn("[getDiff] '_unit' is not a valid unit! Defaulting to milliseconds"),d=1),c=Math.trunc((this.sb.getTime()-c.sb.getTime())/d));return olympe.C.ra(c)},olympe.C.aa)}gz(a){return olympe.C.ua([a],b=>olympe.C.Sb(this.getTime()<b.getTime()),olympe.C.da)}ez(a){return olympe.C.ua([a],b=>olympe.C.Sb(this.getTime()>b.getTime()),olympe.C.da)}hz(a,b){return olympe.C.ua([a,b],(c,d)=>olympe.C.Sb(this.getTime()>c.getTime()&&this.getTime()<d.getTime()),olympe.C.da)}valueOf(){return this.jq().valueOf()?
|
|
380
380
|
new Date(this.getTime()):new Date(0)}};olympe.C.eb.j=oc(0);olympe.C.eb.D=oc(Number.NaN);m=olympe.C.eb.prototype;m.jq.K=olympe.C.J.N;m.Ju.K=olympe.C.J.F;m.Lu.K=olympe.C.J.F;m.Ku.K=olympe.C.J.F;m.Iu.K=olympe.C.J.F;m.my.K=olympe.C.J.F;m.getMonth.K=olympe.C.J.F;m.Mu.K=olympe.C.J.F;m.getTime.K=olympe.C.J.j;m.eA.K=new olympe.C.J(()=>olympe.C.Ta,[0]);m.toLocaleString.K=olympe.C.J.D;m.toLocaleDateString.K=olympe.C.J.D;m.toLocaleTimeString.K=olympe.C.J.D;m.Wc.K=olympe.C.J.D;m.iA.K=olympe.C.J.j;
|
|
381
381
|
m.kA.K=new olympe.C.J(()=>olympe.C.eb,[]);m.mA.K=new olympe.C.J(()=>olympe.C.eb,[]);m.qg.K=new olympe.C.J(()=>olympe.C.eb,[]);m.ax.K=new olympe.C.J(()=>olympe.C.eb,[]);m.ix.K=new olympe.C.J(()=>olympe.C.eb,[]);m.bx.K=new olympe.C.J(()=>olympe.C.eb,[]);m.$w.K=new olympe.C.J(()=>olympe.C.eb,[]);m.kn.K=new olympe.C.J(()=>olympe.C.eb,[0]);m.jx.K=new olympe.C.J(()=>olympe.C.eb,[]);m.ex.K=new olympe.C.J(()=>olympe.C.eb,[]);m.kx.K=new olympe.C.J(()=>olympe.C.eb,[0]);
|
|
382
382
|
m.fA.K=new olympe.C.J(()=>olympe.C.eb,[]);m.gA.K=new olympe.C.J(()=>olympe.C.eb,[]);m.Kd.K=olympe.C.J.N;m.Fa.K=olympe.C.J.j;m.zy.K=olympe.C.J.F;m.qy.K=new olympe.C.J(()=>olympe.C.aa,[0,1]);m.gz.K=new olympe.C.J(()=>olympe.C.da,[0]);m.ez.K=new olympe.C.J(()=>olympe.C.da,[0]);m.hz.K=new olympe.C.J(()=>olympe.C.da,[0,1]);m.valueOf.K=olympe.C.J.j;const pc=new Map,qc=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})?$/i,rc=/^#?([a-f\d])([a-f\d])([a-f\d])([a-f\d])?$/i;function sc(a){const b=c=>{let d;c=c.valueOf();6>c.length?(d=17,c=rc.exec(c)):(d=1,c=qc.exec(c));c=c?c.slice(1).map(e=>parseInt(e,16)*d):[0,0,0];return olympe.C.Color.create(c[0],c[1],c[2],isNaN(c[3])?1:c[3]/255)};return olympe.C.qf(a)?olympe.C.ye([a],b,olympe.C.Color):b(a)}
|
|
@@ -390,16 +390,16 @@ olympe.C.Zb,'Vector2.plus')}vh(a){return olympe.C.ua([this,a],(b,c)=>new olympe.
|
|
|
390
390
|
a+b*b)),olympe.C.aa)}normalize(){return olympe.C.ua([this.x,this.y],(a,b)=>{const c=Math.sqrt(a*a+b*b);return new olympe.C.Zb(a/c,b/c)},olympe.C.Zb)}floor(){return olympe.C.ua([this.x,this.y],(a,b)=>new olympe.C.Zb(Math.floor(a),Math.floor(b)),olympe.C.Zb)}ceil(){return olympe.C.ua([this.x,this.y],(a,b)=>new olympe.C.Zb(Math.ceil(a),Math.ceil(b)),olympe.C.Zb)}round(){return olympe.C.ua([this.x,this.y],(a,b)=>new olympe.C.Zb(Math.round(a),Math.round(b)),olympe.C.Zb)}gx(a){return new olympe.C.Zb(this.x.he(a),
|
|
391
391
|
this.y.he(a))}hx(a,b){return new olympe.C.Zb(this.x.he(a),this.y.he(b))}Wc(){return olympe.C.ua([this.x,this.y],(a,b)=>olympe.C.xb(`Vector2[${a.valueOf()}, ${b.valueOf()}]`),olympe.C.Ta)}toString(){return`Vector2[${this.x.Ca.Fb}, ${this.y.Ca.Fb}]`}Fa(a){return this===a?!0:!1}};m=olympe.C.Zb.prototype;m.toJSON.K=olympe.C.J.j;m.Nu.K=olympe.C.J.F;m.cA.K=olympe.C.J.j;m.Ou.K=olympe.C.J.F;m.dA.K=olympe.C.J.j;m.Sy.K=olympe.C.J.F;m.he.K=new olympe.C.J(()=>olympe.C.Zb,[0]);
|
|
392
392
|
m.vh.K=new olympe.C.J(()=>olympe.C.Zb,[0]);m.xz.K=olympe.C.J.R;m.Kx.K=olympe.C.J.R;m.zz.K=olympe.C.J.R;m.Lx.K=new olympe.C.J(()=>olympe.C.aa,[0]);m.length.K=olympe.C.J.F;m.normalize.K=olympe.C.J.R;m.floor.K=olympe.C.J.R;m.ceil.K=olympe.C.J.R;m.round.K=olympe.C.J.R;m.gx.K=olympe.C.J.R;m.hx.K=olympe.C.J.R;m.Wc.K=olympe.C.J.D;m.toString.K=olympe.C.J.j;m.Fa.K=olympe.C.J.j;olympe.C.Jg=class{constructor(){}Nb(){}Rd(){}get(){}ri(){}has(){}sh(){}Ic(){}Sf(){}Cf(){}xg(){}forEach(){}pe(){}};olympe.C.Jg.prototype.forEachCurrentValue=olympe.C.Jg.prototype.pe;olympe.C.Jg.prototype.forEach=olympe.C.Jg.prototype.forEach;m=olympe.C.Jg.prototype;m.has.K=olympe.C.J.N;m.sh.K=olympe.C.J.j;m.Ic.K=new olympe.C.J(()=>Object,[]);m.Sf.K=new olympe.C.J(()=>String,[]);m.Cf.K=olympe.C.J.F;m.xg.K=olympe.C.J.j;m.forEach.K=new olympe.C.J(()=>{},[]);m.pe.K=olympe.C.J.j;olympe.C.vd=class extends olympe.C.Jg{Id(){}Rf(){}nf(){}Qf(){}qe(){}mf(){}wj(){}ti(){}};olympe.C.vd.prototype.getCurrentAt=olympe.C.vd.prototype.mf;olympe.C.vd.prototype.getAt=olympe.C.vd.prototype.qe;olympe.C.vd.prototype.getCurrentKeyAt=olympe.C.vd.prototype.Qf;olympe.C.vd.prototype.getKeyAt=olympe.C.vd.prototype.nf;olympe.C.vd.prototype.getCurrentRank=olympe.C.vd.prototype.Rf;olympe.C.vd.prototype.getRank=olympe.C.vd.prototype.Id;m=olympe.C.vd.prototype;m.Id.K=olympe.C.J.F;m.Rf.K=olympe.C.J.j;
|
|
393
|
-
m.nf.K=new olympe.C.J(()=>String,[]);m.Qf.K=olympe.C.J.j;m.qe.K=new olympe.C.J(()=>Object,[]);m.mf.K=olympe.C.J.j;m.wj.K=olympe.C.J.j;m.ti.K=new olympe.C.J(()=>Array,[]);olympe.C.Ci=class{constructor(a,b){this.H=b||olympe.C
|
|
393
|
+
m.nf.K=new olympe.C.J(()=>String,[]);m.Qf.K=olympe.C.J.j;m.qe.K=new olympe.C.J(()=>Object,[]);m.mf.K=olympe.C.J.j;m.wj.K=olympe.C.J.j;m.ti.K=new olympe.C.J(()=>Array,[]);olympe.C.Ci=class{constructor(a,b){this.H=b||olympe.C.$a();this.valueType=a||Object;this.values={};this.Wa=this.ja=null;this.Pe=0;this.R=Object.create(null);this.mb=Object.create(null);this.size=0;this.F=null;this.H.onDestroy(()=>{const c=this.R;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.H}Nb(){return this.valueType}Rd(a){this.valueType=a;const b=this.ja;if(null!==b)for(const c in b)Object.prototype.hasOwnProperty.call(b,
|
|
394
394
|
c)&&hc(b[c],a)}get(a){const b=c=>{null===this.ja&&(this.ja={});return this.Bj(this.ja,c,this.values[c],this.valueType,'Map.get('+c+')')};return olympe.C.ua([a],c=>b(c),this.valueType)}ri(a){a=this.values[a];return olympe.C.hb(a)?Tb(a.Ca)?a.Ca.Fb:void 0:a}has(a){const b=c=>{null===this.Wa&&(this.Wa={});return this.Bj(this.Wa,c,c in this.values?olympe.C.da.D:olympe.C.da.j,olympe.C.da,'Map.has('+c+')')};return olympe.C.ua([a],c=>b(c),olympe.C.da)}sh(a){return a in this.values}Bj(a,b,c,d,e){let f=a[b];
|
|
395
395
|
f||this.H.run(()=>{f=olympe.C.Xd(d,void 0,e);a[b]=f;f.Ca.onDestroy(()=>delete a[b]);olympe.C.hb(c)?kc(f,c):ic(f,c)});return f}Ic(){throw Error('Abstract method getFirstKey needs to be overridden');}Sf(){throw Error('Abstract method getFirstKey needs to be overridden');}Cf(){null===this.F&&this.H.run(()=>{this.F=olympe.C.Xd(olympe.C.aa,olympe.C.ra(this.size));this.F.Ca.onDestroy(()=>{this.F=null})});return this.F}xg(){return this.size}forEach(a,b){const c=this.fn();a=this.us(c,a,b);this.en(c,a)}fn(){return String(++this.Pe)}en(a,
|
|
396
|
-
b){this.mb[a]=b;olympe.C
|
|
396
|
+
b){this.mb[a]=b;olympe.C.$a().Yd(()=>{const c=this.R;for(const d in c)Object.prototype.hasOwnProperty.call(c,d)&&delete c[d][a];delete this.mb[a]});this.pe(b)}us(a,b,c){const d=olympe.C.$a();return(e,f)=>{d.run(()=>{const g=olympe.C.createNode(void 0,b,null,[e,f,this],null,`forEach-${a}-${f}`);if(void 0!==c)g.onDestroy(()=>{c(f)});this.jn(a,f,g)})}}jn(a,b,c){void 0===this.R[b]&&(this.R[b]={});this.R[b][a]=c}pe(a){const b=this.values;for(const c in b)if(Object.prototype.hasOwnProperty.call(b,c)&&!1===
|
|
397
397
|
a(b[c],c,this))break}al(a,b){void 0!==this.values[a]&&this.pj(a,!0);this.values[a]=b;var c=this.ja;null!==c&&void 0!==c[a]&&(b&&b instanceof olympe.C.Proxy?kc(c[a],b):ic(c[a],b));c=this.Wa;null!==c&&void 0!==c[a]&&lc(c[a],!0);this.size++;c=this.mb;for(const d in c)if(Object.prototype.hasOwnProperty.call(c,d))c[d](b,a,this)}pj(a,b){const c=this.values;if(Object.prototype.hasOwnProperty.call(c,a)){var d=(d=c[a])&&d.gh?d.Ca.Fb:d;var e=this.ja;null!==e&&void 0!==e[a]&&jc(e[a]);e=this.Wa;null!==e&&void 0!==
|
|
398
398
|
e[a]&&lc(e[a],!1);delete c[a];this.size--;b||this.Nf()}a=this.R[a];if(void 0!==a)for(const f in a)Object.prototype.hasOwnProperty.call(a,f)&&a[f].destroy();return d}Nf(){null!==this.F&&lc(this.F,this.size)}gi(){var a=this.ja;if(null!==a)for(const c in a)Object.prototype.hasOwnProperty.call(a,c)&&jc(a[c]);a=this.Wa;if(null!==a)for(var b in a)Object.prototype.hasOwnProperty.call(a,b)&&lc(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.R)if(Object.prototype.hasOwnProperty.call(this.R,
|
|
399
399
|
c)){b=this.R[c];for(const d in b)Object.prototype.hasOwnProperty.call(b,d)&&b[d].destroy()}this.size=0;null!==this.F&&lc(this.F,this.size)}Mg(){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.C.Ci.za=[olympe.C.Jg];m=olympe.C.Ci.prototype;m.getContext.K=olympe.C.J.j;m.Nb.K=olympe.C.J.j;m.Rd.K=olympe.C.J.j;m.get.K=new olympe.C.J(()=>Object,[],'valueType');m.ri.K=olympe.C.J.j;m.has.K=olympe.C.J.N;m.sh.K=olympe.C.J.j;m.Bj.K=olympe.C.J.j;
|
|
400
400
|
m.Cf.K=olympe.C.J.F;m.xg.K=olympe.C.J.j;m.forEach.K=new olympe.C.J(()=>{},[]);m.fn.K=olympe.C.J.j;m.en.K=olympe.C.J.j;m.us.K=olympe.C.J.j;m.jn.K=olympe.C.J.j;m.pe.K=olympe.C.J.j;m.al.K=olympe.C.J.j;m.pj.K=olympe.C.J.j;m.Nf.K=olympe.C.J.j;m.gi.K=olympe.C.J.j;m.Mg.K=olympe.C.J.j;olympe.C.Tj=class extends olympe.C.Ci{constructor(a,b){super(a,b);this.D=Object.create(null);this.j=[];this.ea=this.ta=this.Ha=this.$=null}Rd(a){super.Rd(a);if(null!==this.ea)for(let b of this.ea.values())hc(b,a)}Ic(){return this.qe(0)}Sf(){return this.nf(0)}Id(a){const b=c=>{null===this.Ha&&(this.Ha=Object.create(null));let d=this.Rf(a);d=void 0!==d?olympe.C.ra(d):void 0;return this.Bj(this.Ha,c,d,olympe.C.aa,`List.getRank(${c})`)};return olympe.C.hb(a)?M(olympe.C.createNode(olympe.C.aa,b,null,[a.Ca],
|
|
401
|
-
[0],'onResolved('+(b.name||'')+')')):b(a)}Rf(a){return this.D[a]}nf(a){const b=c=>{const d=c.valueOf(),e=this.Qf(d);null===this.ta&&(this.ta=Object.create(null));return this.Bj(this.ta,String(d),e,String,'List.getKeyAt('+c+')')};return olympe.C.ua([a],c=>b(c),String)}Qf(a){return this.j[a.valueOf()]}qe(a){if(olympe.C.hb(a))return this.get(olympe.C.ua([a],c=>{c=this.nf(c);if(!Tb(c.Ca)){const d=olympe.C
|
|
402
|
-
b||this.H.run(()=>{b=this.get(this.nf(a));this.ea.set(a,b);b.Ca.onDestroy(()=>this.ea.delete(a))});return b}mf(a){return this.ri(this.Qf(a))}wj(a,b,c,d){let e=this.fn();a=this.ft(e,a,b,c,d);this.en(e,a)}ft(a,b,c,d,e){return olympe.C
|
|
401
|
+
[0],'onResolved('+(b.name||'')+')')):b(a)}Rf(a){return this.D[a]}nf(a){const b=c=>{const d=c.valueOf(),e=this.Qf(d);null===this.ta&&(this.ta=Object.create(null));return this.Bj(this.ta,String(d),e,String,'List.getKeyAt('+c+')')};return olympe.C.ua([a],c=>b(c),String)}Qf(a){return this.j[a.valueOf()]}qe(a){if(olympe.C.hb(a))return this.get(olympe.C.ua([a],c=>{c=this.nf(c);if(!Tb(c.Ca)){const d=olympe.C.$a();olympe.C.Vf(d)&&cc(d)}return c},String));null===this.ea&&(this.ea=new Map);let b=this.ea.get(a);
|
|
402
|
+
b||this.H.run(()=>{b=this.get(this.nf(a));this.ea.set(a,b);b.Ca.onDestroy(()=>this.ea.delete(a))});return b}mf(a){return this.ri(this.Qf(a))}wj(a,b,c,d){let e=this.fn();a=this.ft(e,a,b,c,d);this.en(e,a)}ft(a,b,c,d,e){return olympe.C.$a().tc((f,g)=>{let h=!1,k=olympe.C.Ai([b,c,this.Id(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.jn(a,g,k)})}ti(){null===this.$&&this.H.run(()=>{this.$=olympe.C.Xd(Array,this.j.filter(a=>void 0!==a));this.$.Ca.onDestroy(()=>
|
|
403
403
|
{this.F=null})});return this.$}pe(a){if(this.j.length!==this.size)super.pe(a);else{var b=this.values;for(let c of this.j.filter(d=>void 0!==d))if(Object.prototype.hasOwnProperty.call(b,c)&&!1===a(b[c],c,this))break}}hn(a,b){const c=this.Ha,d=this.ta,e=this.D[a],f=b.valueOf();if(e!==f||this.j[e]!==a){var g=this.j[f];void 0!==g&&delete this.D[g];void 0!==e&&null!==e&&this.j[e]===a&&(this.j[e]=void 0);this.D[a]=f;this.j[f]=a;null!==c&&(void 0!==g&&void 0!==c[g]&&jc(c[g]),void 0!==c[a]&&ic(c[a],olympe.C.ra(f)));
|
|
404
404
|
null!==d&&(void 0!==e&&null!==e&&void 0!==d[e]&&jc(d[e]),void 0!==d[b]&&ic(d[b],a))}}gn(a){var b=this.ta,c=this.D[a];null!==c&&void 0!==c&&null!==b&&(b=b[c],void 0!==b&&b.Ca.Fb===a&&jc(b));delete this.D[a];this.j.splice(c,1);c=this.Ha;null!==c&&void 0!==c[a]&&jc(c[a])}vs(){if(null!==this.$){const a=this.j,b=this.$.Ca.Fb;b&&a.join(',')!==b.join(',')&&ic(this.$,a)}}Nf(){this.vs();super.Nf()}gi(){var a=this.D;for(b in a)delete a[b];this.j.length=0;a=this.Ha;if(null!==a)for(b in a)jc(a[b]);a=this.ta;
|
|
405
405
|
if(null!==a)for(b in a)jc(a[parseInt(b,10)]);var b=this.$;null!==b&&(ac(b.Ca),ic(b,this.j));return olympe.C.Ci.prototype.gi.call(this)}Mg(){const a=this.values,b=this.D;let c='[\n';for(let d in a)Object.prototype.hasOwnProperty.call(a,d)&&(c+=`${b[d]}. ${a[d]}\n`);return c+']'}};olympe.C.Tj.za=[olympe.C.vd];m=olympe.C.Tj.prototype;m.Rd.K=olympe.C.J.j;m.Ic.K=new olympe.C.J(()=>Object,[]);m.Sf.K=new olympe.C.J(()=>String,[]);m.Id.K=olympe.C.J.F;m.Rf.K=olympe.C.J.j;m.nf.K=new olympe.C.J(()=>String,[]);
|
|
@@ -410,23 +410,23 @@ olympe.C.Xd=function(a,b,c){a=olympe.C.createNode(a,void 0,void 0,void 0,void 0,
|
|
|
410
410
|
olympe.C.Rn=function(a,b){if(void 0!==a){olympe.C.th(a)&&(a=a.tb().Ca);if(!olympe.C.qf(a))return b(a);var c=[];olympe.C.hb(a)?c.push(a.Ca):c.push(a);return olympe.C.createNode(void 0,b,null,c,[0],'onResolved')}};olympe.C.Qa=function(a,b){let c=a;olympe.C.hb(a)?c=a.Ca.Fb:olympe.C.Vf(a)?c=a.Fb:olympe.C.th(a)&&(c=a.tb().Ca.Fb);return void 0===c?b:c};
|
|
411
411
|
olympe.C.xh=function(a,b){let c;olympe.C.hb(a)?c=a.Ca:olympe.C.Vf(a)?c=a:olympe.C.th(a)&&(c=a.tb().Ca);c&&olympe.C.Vc([b],d=>{c.xh(d)},'setDefaultValue');return a};olympe.C.Ai=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.rs?(h=h.Ca,g.push(k)):h instanceof olympe.C.Node?g.push(k):olympe.C.th(h)&&(h=h.tb().Ca,g.push(k))),f[k]=h;return olympe.C.createNode(c,b,null,f,g,d||'syncNodes')};
|
|
412
412
|
olympe.C.ye=function(a,b,c,d){return M(olympe.C.Ai(a,b,c,d||'syncProxies'))};const uc=a=>{for(const b of a)if(olympe.C.qf(b)||olympe.C.th(b))return!1;return!0};olympe.C.ua=function(a,b,c,d,e){if(uc(a))return b(...a);const f=olympe.C.Ai(a,b,c,d||'TransformFlows');e&&olympe.C.Vc([e],g=>{f.xh(g)},'setDefaultValue');return M(f)};olympe.C.Vc=function(a,b,c){uc(a)?b(...a):olympe.C.Ai(a,b,void 0,c||'processFlows')};
|
|
413
|
-
olympe.C.QE=function(a,b,c){const d=olympe.C.Vf(a)?a.Nb():olympe.C.th(a)?a.tb().ei:a.ei,e=olympe.C.cc(d,c),f=olympe.V.Promise.uj(g=>{e.getContext().gb()||e.update(g)},b);olympe.C.Vc([a],g=>f(g).then());return e.tb()};olympe.C.jt=function(a,b){if(uc(a))b(...a);else{const c=olympe.C
|
|
414
|
-
olympe.C.Sn=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.C.hb(g)?(g=g.Ca,f.push(h)):g instanceof olympe.C.Node?f.push(h):olympe.C.th(g)&&(g=g.tb().Ca,f.push(h))),e[h]=g;0!==f.length&&new olympe.C.Node({Lc:b,Ln:e,rg:f,Tz:!1,ad:c})};olympe.C.kt=function(a,b){const c=olympe.C
|
|
415
|
-
olympe.C.cc=function(a,b='flowSource'){return new olympe.C.lk(a,b)};olympe.C.wF=function(a,b,c,d){const e=olympe.C
|
|
416
|
-
olympe.C.YE=function(a,b,...c){return a?a.run(b,...c):b(...c)};olympe.C.AF=function(a){return olympe.C
|
|
413
|
+
olympe.C.QE=function(a,b,c){const d=olympe.C.Vf(a)?a.Nb():olympe.C.th(a)?a.tb().ei:a.ei,e=olympe.C.cc(d,c),f=olympe.V.Promise.uj(g=>{e.getContext().gb()||e.update(g)},b);olympe.C.Vc([a],g=>f(g).then());return e.tb()};olympe.C.jt=function(a,b){if(uc(a))b(...a);else{const c=olympe.C.$a();olympe.C.Ai(a,(...d)=>{olympe.C.$a().destroy();c.run(b,...d)},void 0,'processFlowsOnce')}};
|
|
414
|
+
olympe.C.Sn=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.C.hb(g)?(g=g.Ca,f.push(h)):g instanceof olympe.C.Node?f.push(h):olympe.C.th(g)&&(g=g.tb().Ca,f.push(h))),e[h]=g;0!==f.length&&new olympe.C.Node({Lc:b,Ln:e,rg:f,Tz:!1,ad:c})};olympe.C.kt=function(a,b){const c=olympe.C.$a();olympe.C.Sn(a,(...d)=>{olympe.C.$a().destroy();c.run(b,...d)},'processFutureFlowsOnce')};olympe.C.OE=function(a,b,c){a=new olympe.C.lk(a,c);b(a);return a.tb()};
|
|
415
|
+
olympe.C.cc=function(a,b='flowSource'){return new olympe.C.lk(a,b)};olympe.C.wF=function(a,b,c,d){const e=olympe.C.$a();olympe.C.Ai(a,(...f)=>{olympe.C.$a().destroy();e.run(b,...f)},c,d||'syncProxiesOnce')};olympe.C.Gj=function(a,b,c){olympe.C.ua([a],d=>d.valueOf()?b.apply(null,void 0):c&&c.apply(null,void 0),Object,'If')};olympe.C.aF=function(a,b,c='from observable'){const d=olympe.C.cc(b,c),e=a.subscribe(f=>d.update(f));d.getContext().onDestroy(()=>e.unsubscribe());return d.tb()};
|
|
416
|
+
olympe.C.YE=function(a,b,...c){return a?a.run(b,...c):b(...c)};olympe.C.AF=function(a){return olympe.C.$a().tc(a)};olympe.C.VE=function(a,b,c){olympe.C.Mx(a?a.Ca:a,b,c)};
|
|
417
417
|
olympe.C.Mx=function(a,b,c){if(a){var d=a.T();null===tc&&(tc={});if(tc[d])olympe.C.G.log(`Already started node #${d} dump`+(b?`: ${b}`:''));else{tc[d]=!0;var e=`Starting node #${d} dump`+(b?`: ${b}`:'');c?olympe.C.G.warn(e):olympe.C.G.log(e);var f=`#${d}`+(b?`: ${b}`:'')+':';c=olympe.C.createNode(null,g=>{void 0===g?olympe.C.G.log(f,'undefined'):null===g?olympe.C.G.log(f,'null'):olympe.C.G.log(f,String(g))},null,[a],[0],'DataFlowDump');a.onDestroy(()=>{olympe.C.G.log(`Node #${d} destroyed`+(b?`: ${b}`:
|
|
418
|
-
''))});c.onDestroy(()=>{delete tc[d]})}}else olympe.C.G.log('NOT starting node dump, node is '+String(a))};olympe.C.UE=function(){let a='',b=olympe.C
|
|
418
|
+
''))});c.onDestroy(()=>{delete tc[d]})}}else olympe.C.G.log('NOT starting node dump, node is '+String(a))};olympe.C.UE=function(){let a='',b=olympe.C.$a();for(;null!==b;)a+=b.Dn()+' --\x3e ',b=b.getParent();olympe.C.G.log(a)};
|
|
419
419
|
olympe.C.ra=function(a){if(void 0===a)return olympe.C.aa.ZERO;if(a instanceof olympe.C.aa)return a;a&&a.valueOf&&(a=a.valueOf());if('number'===typeof a){if(isNaN(a))return olympe.C.aa.yq;if(a===Math.PI)return olympe.C.aa.PI;if(Infinity===a)return olympe.C.aa.Cu;if(-Infinity===a)return olympe.C.aa.zv;if(isNaN(a))var b=!1;else b=parseFloat(a),b=(b|0)===b;return b&&-1<=a&&100>=a?(olympe.C.fi.has(a)||olympe.C.fi.set(a,new olympe.C.aa(a)),olympe.C.fi.get(a)):new olympe.C.aa(a)}return null};
|
|
420
420
|
olympe.C.ge=function(a){return void 0===a?olympe.C.Xd(olympe.C.aa):olympe.C.Xd(olympe.C.aa,olympe.C.qf(a)?a:olympe.C.ra(a))};olympe.C.Bz=olympe.C.aa.animate;olympe.C.lF=function(a,b){return new olympe.C.Gt(a,b)};olympe.C.xb=function(a){if(a instanceof olympe.C.Ta)return a;a instanceof Object&&(a=a.valueOf());const b=typeof a;if('string'===b||'number'===b||'boolean'===b)return a=String(a),olympe.C.$k.has(a)?olympe.C.$k.get(a):new olympe.C.Ta(a)};
|
|
421
421
|
olympe.C.qF=function(a){return void 0===a?olympe.C.Xd(olympe.C.Ta):olympe.C.Xd(olympe.C.Ta,olympe.C.qf(a)?a:olympe.C.xb(a))};olympe.C.Sb=function(a){return a instanceof olympe.C.da?a:void 0!==a&&null!==a&&a.valueOf()?olympe.C.da.D:olympe.C.da.j};olympe.C.nF=function(a){return void 0===a?olympe.C.Xd(olympe.C.da):olympe.C.Xd(olympe.C.da,olympe.C.qf(a)?a:olympe.C.Sb(a))};olympe.C.mF=function(a){if(a instanceof Date)return new olympe.C.eb(a)};
|
|
422
422
|
olympe.C.pF=function(a){return olympe.C.Xd(olympe.C.eb,void 0!==a?new olympe.C.eb(a):null)};olympe.C.$s=a=>a instanceof olympe.C.da||a instanceof olympe.C.aa||a instanceof olympe.C.Ta||a instanceof olympe.C.eb;olympe.C.rF=function(a,b){return olympe.C.Xd(olympe.C.Zb,void 0===a&&void 0===b?void 0:new olympe.C.Zb(a,b))};olympe.C.Nz=function(a,b,c,d){let e;void 0!==a&&(a instanceof olympe.C.Color?e=a:e=olympe.C.Color.create(a,b,c,d));return olympe.C.Xd(olympe.C.Color,e)};olympe.C.oF=olympe.C.Nz;
|
|
423
|
-
olympe.C.Dx=function(a){olympe.C.G=a;olympe.C.li=olympe.C.lh()};olympe.C.lh=function(){olympe.C.Un||(olympe.C.Un=new olympe.C.Dr);return olympe.C.Un};olympe.C
|
|
423
|
+
olympe.C.Dx=function(a){olympe.C.G=a;olympe.C.li=olympe.C.lh()};olympe.C.lh=function(){olympe.C.Un||(olympe.C.Un=new olympe.C.Dr);return olympe.C.Un};olympe.C.$a=function(){olympe.C.li||(olympe.C.li=olympe.C.lh());return olympe.C.li};olympe.C.st=function(a){const b=olympe.C.li;olympe.C.Pn(a)&&(olympe.C.li=a);return null!=b?b:null};
|
|
424
424
|
olympe.C.Qb=a=>{a='string'===typeof a?JSON.parse(a):a;if(a.type){let b=null;switch(a.type){case 'dateTime':b=olympe.C.eb.Qb(a);break;case 'number':b=olympe.C.aa.Qb(a);break;case 'string':b=olympe.C.Ta.Qb(a);break;case 'vector2':b=olympe.C.Zb.Qb(a);break;case 'color':b=olympe.C.Color.Qb(a);break;case 'boolean':b=olympe.C.da.Qb(a)}return b}return null};function vc(a){a.j.gb()||(a.F.forEach(b=>{b.destroy()}),a.F.clear(),a.D.clear(),a.size.clear(),a.N.clear(),a.R.length=0,a.H.length=0)}
|
|
425
425
|
olympe.C.lD=class{constructor(){this.j=new olympe.C.Wb('Slot Manager context');this.F=new Map;this.j.run(()=>{this.D=olympe.C.cc(wc,'Last slot manager entry');this.size=mc(olympe.C.cc(olympe.C.aa,'SlotManager size').repeat(this.D.tb().En()),olympe.C.aa.ZERO);this.N=mc(olympe.C.cc(olympe.C.aa,'last valid slots'),olympe.C.ra(-1))});this.R=[];this.H=[];this.j.onDestroy(()=>{vc(this)})}};
|
|
426
426
|
class wc{constructor(a,b,c,d){this.id=a;this.D=new olympe.C.Wb('Slot manager entry');this.H=c;this.N=d;this.D.run(()=>{const e=mc(olympe.C.cc(olympe.C.aa),olympe.C.aa.ZERO);olympe.C.hb(b)?e.repeat(b):e.update(b);this.j=olympe.C.cc(olympe.C.aa);this.F=this.j.tb().he(e.tb())});this.next=null}T(){return this.id}Wy(){return this.j.tb()}En(){return this.F}Id(){return this.H}fz(){return this.N}oA(a){this.H=a}bA(a){null===a?this.j.update(olympe.C.aa.ZERO):(this.j.repeat(a.En()),a.next=this)}Pu(){this.j.clear();
|
|
427
|
-
this.next=null}destroy(){this.D.destroy();this.F=this.j=this.next=null}}m=wc.prototype;m.T.K=olympe.C.J.j;m.Wy.K=new olympe.C.J(()=>olympe.C.aa);m.En.K=new olympe.C.J(()=>olympe.C.aa);m.Id.K=olympe.C.J.j;m.fz.K=olympe.C.J.j;m.oA.K=olympe.C.J.j;m.bA.K=olympe.C.J.j;m.Pu.K=olympe.C.J.j;m.destroy.K=olympe.C.J.j;olympe.C.P={Da:'df.Logger'};olympe.W.config(a=>{E(a,olympe.C.U.zq,Number.POSITIVE_INFINITY);D(a,olympe.C.P.Da,[olympe.ia.P.Ea],b=>b.cd('df'))},'olympe.df');olympe.W.run([olympe.C.P.Da],a=>{olympe.C.Dx(a)},'olympe.df');olympe.host={};const xc=new Map,yc=new Map;olympe.host.Gq=class{static register(a,b,...c){xc.set(a,b);0<c.length&&yc.set(a,c)}static create(a,b,c,d){const e=xc.get(a);if(void 0===e)throw Error('Undefined UI element type: '+a);a=yc.get(a);return void 0!==a?new e(b,c,...a.map(f=>Sa(d,f))):new e(b,c)}};function zc(a,b,c){a.G.debug('CREATE #',b,', type=',c);a.j.set(b,olympe.host.Gq.create(c,b,a.G,a.H))}function Ac(a,b,c,...d){const e=a.j.get(b);if(void 0!==e){a.G.H()<=olympe.ia.yb.j.bg&&a.G.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.C.hb(f))b.push(a.j.get(f.Yw)||null);else if('function'===typeof f){const g=f,h=olympe.C
|
|
427
|
+
this.next=null}destroy(){this.D.destroy();this.F=this.j=this.next=null}}m=wc.prototype;m.T.K=olympe.C.J.j;m.Wy.K=new olympe.C.J(()=>olympe.C.aa);m.En.K=new olympe.C.J(()=>olympe.C.aa);m.Id.K=olympe.C.J.j;m.fz.K=olympe.C.J.j;m.oA.K=olympe.C.J.j;m.bA.K=olympe.C.J.j;m.Pu.K=olympe.C.J.j;m.destroy.K=olympe.C.J.j;olympe.C.P={Da:'df.Logger'};olympe.W.config(a=>{E(a,olympe.C.U.zq,Number.POSITIVE_INFINITY);D(a,olympe.C.P.Da,[olympe.ia.P.Ea],b=>b.cd('df'))},'olympe.df');olympe.W.run([olympe.C.P.Da],a=>{olympe.C.Dx(a)},'olympe.df');olympe.host={};const xc=new Map,yc=new Map;olympe.host.Gq=class{static register(a,b,...c){xc.set(a,b);0<c.length&&yc.set(a,c)}static create(a,b,c,d){const e=xc.get(a);if(void 0===e)throw Error('Undefined UI element type: '+a);a=yc.get(a);return void 0!==a?new e(b,c,...a.map(f=>Sa(d,f))):new e(b,c)}};function zc(a,b,c){a.G.debug('CREATE #',b,', type=',c);a.j.set(b,olympe.host.Gq.create(c,b,a.G,a.H))}function Ac(a,b,c,...d){const e=a.j.get(b);if(void 0!==e){a.G.H()<=olympe.ia.yb.j.bg&&a.G.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.C.hb(f))b.push(a.j.get(f.Yw)||null);else if('function'===typeof f){const g=f,h=olympe.C.$a();b.push((...k)=>{h.gb()||g(...k)})}else b.push(f.valueOf());e[c].apply(e,b)}}
|
|
428
428
|
function Bc(a){var b=olympe.host.Oe.Fd,c=olympe.host.Oe.Fq.js;++a.F;const d=a.F;zc(a,d,c);const e=olympe.C.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.D.has(l)&&this.D.get(l).destroy();for(let n=0;n<f;n++){let p=arguments[n];olympe.C.hb(p)?(h.push(n),p=p.Ca):olympe.C.Vf(p)&&h.push(n);g[n]=p}0===h.length?e.run(()=>{Ac(this,d,k,...g)}):(f=olympe.C.createNode(void 0,(...n)=>{e.run(()=>
|
|
429
|
-
{Ac(this,d,k,...n)})},void 0,g,h,'Native('+d+').'+k),this.D.set(l,f),f.onDestroy(()=>this.D.delete(l)));return null}.bind(a));e.Yd(a.N.bind(a,d));a=M(e);a.Yw=d;L(e,a);return a}olympe.host.Ua=class{constructor(a,b){this.G=a;this.H=b;this.F=0;this.j=new Map;this.D=new Map;a.debug('Starting host manager')}
|
|
429
|
+
{Ac(this,d,k,...n)})},void 0,g,h,'Native('+d+').'+k),this.D.set(l,f),f.onDestroy(()=>this.D.delete(l)));return null}.bind(a));e.Yd(a.N.bind(a,d));a=M(e);a.Yw=d;L(e,a);return a}olympe.host.Ua=class{constructor(a,b){this.G=a;this.H=b;this.F=0;this.j=new Map;this.D=new Map;a.debug('Starting host manager')}Ya(){return this.G}N(a){this.G.debug('DESTROY #',a);const b=this.j.get(a);this.j.delete(a);b.destroy()}};olympe.host.Td=class{constructor(a){this.j=a;this.D=olympe.C.$a()}F(){return this.j}jd(){return this.j.Ca.jd()||this.D.jd()}gb(){return this.j.Ca.gb()}};olympe.host.Td.prototype.F.K=new olympe.C.J(()=>olympe.host.Oe.Td,[]);olympe.host.Uk=class{j(){}D(){}};olympe.host.wu=class{};function Cc(a,b){var c=olympe.host.Zf;const d=olympe.V.Kc(),e=new olympe.C.Wb('onTimeout context');c.j.Y(b,d,()=>{e.gb()||e.jd()||e.run(a);c.j.F(d)});return new olympe.host.Fd.D(c.j,d,e)}function Dc(a,b){var c=olympe.host.Zf;const d=olympe.V.Kc(),e=new olympe.C.Wb('onInterval context');c.j.R(b,d,()=>{e.gb()||e.jd()?c.j.D(d):e.run(a)})}olympe.host.Fd=class{constructor(a){this.j=Bc(a)}};olympe.host.Fd.j=class{constructor(a,b,c){this.Zf=a;this.id=b;this.j=null!=c?c:null}T(){return this.id}cancel(){}};
|
|
430
430
|
olympe.host.Fd.H=class extends olympe.host.Fd.j{cancel(){this.Zf.N(this.id);let a;null==(a=this.j)||a.destroy();this.j=null}};olympe.host.Fd.D=class extends olympe.host.Fd.j{cancel(){this.Zf.F(this.id);let a;null==(a=this.j)||a.destroy();this.j=null}};olympe.host.Fd.F=class extends olympe.host.Fd.j{cancel(){this.Zf.D(this.id);let a;null==(a=this.j)||a.destroy();this.j=null}};olympe.host.Je=class{H(a,b){return null!=b?b:''}ja(a,b){return null!=b?b:''}Ha(a,b){return null!=b?b:''}F(){}j(a,b){return null!=b?b:''}D(){}};olympe.host.Je.j={LIVENESS:'liveness',READINESS:'readiness',ALL:'all'};olympe.host.Oe={};olympe.host.Oe.Td=class{destroy(){}};olympe.host.Oe.Td.prototype.destroy=olympe.host.Oe.Td.prototype.destroy;olympe.host.Oe.Fq={wA:100,yA:101,xA:102,AA:103,zA:104,vA:105,cD:201,aD:202,YC:204,fD:205,XC:206,$C:207,dD:208,gD:209,hD:210,iD:211,ZC:212,eD:218,bD:219,jD:220,WC:221,VC:222,qD:300,rD:301,sD:302,wD:303,xD:304,yD:305,tD:310,uD:311,vD:312,wC:400,xC:401,yC:402,kC:450,dC:500,bC:501,gC:502,fC:503,cC:504,eC:505,RD:600,ID:601,MD:602,ED:603,FD:604,CD:605,HD:606,XD:607,PD:608,zD:609,DD:610,GD:611,OD:612,TD:613,AD:614,SD:615,ND:616,WD:617,JD:618,KD:619,LD:620,QD:630,BD:631,UD:632,VD:633,CE:700,fE:701,gE:702,
|
|
431
431
|
hE:703,jE:704,kE:705,lE:706,iE:707,nE:708,mE:709,oE:710,sE:711,AE:712,pE:713,qE:714,tE:715,uE:716,wE:717,xE:718,zE:719,vE:720,yE:721,BE:722,rE:723,DE:724,EE:725,js:800};olympe.host.Oe.Fd=class{N(){}Y(){}F(){}R(){}D(){}};olympe.host.P={Qk:'host.System',Op:'host.HistoryManager',Fr:'host.Scheduler',Da:'host.platform.Logger',Ea:'host.Manager',Ge:'host.ProcessManager'};olympe.host.U={Jk:'role',Pp:'host.currentHost',br:'host.processProbe',Lr:'host.gracefulShutdownTimeout'};olympe.host.Xg={Al:'active',Uh:'preview'};olympe.host.Zf=null;
|
|
432
432
|
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';Va(a,olympe.host.U.Pp,d);b=olympe.host.Xg.Al;c=olympe.host.Xg.Uh;E(a,olympe.host.U.Jk,d.startsWith(`${c}.`)?c:b);Ya(a,olympe.host.P.Qk);Ya(a,olympe.host.P.Op);C(a,olympe.host.P.Ge,olympe.host.Je);D(a,olympe.host.P.Da,[olympe.ia.P.Ea],e=>e.cd('host'));C(a,olympe.host.P.Ea,olympe.host.Ua,olympe.host.P.Da,olympe.W.P.Fg);D(a,olympe.host.P.Fr,[olympe.host.P.Ea],
|
|
@@ -437,7 +437,7 @@ olympe.error.Np=class extends olympe.error.Zm{};olympe.net={};olympe.net.wa={};o
|
|
|
437
437
|
olympe.net.wa.Ul={NB:'text/html',JSON:'application/json',Xw:'application/zip',ke:'application/octet-stream'};olympe.net.wa.Ub={Lo:0,Rh:200,No:201,Rj:202,Fl:400,Mw:401,kk:403,Zi:404,hC:405,gj:500,lw:503};function Ec(a){return a.host&&encodeURI(a.host)}function Fc(a){return encodeURI(a.path).replace(olympe.net.oj.j,(b,c)=>'%'+c)}olympe.net.oj=class{constructor(a,b,c,d){this.host='localhost';this.port=80;this.path='';this.yh=!1;void 0!==a&&(this.host=a);void 0!==b&&(this.port=b);void 0!==c&&(this.path=c.replace(/^\/+/,''));void 0!==d&&(this.yh=d)}j(){return`${(void 0===this.yh?443===this.port:this.yh)?'wss':'ws'}://${Ec(this)}:${this.port}/${Fc(this)}`}toString(){return`${Ec(this)}:${this.port}/${Fc(this)}`}};
|
|
438
438
|
olympe.net.oj.j=/%25([0-9a-f]{2})/i;olympe.net.WebSocket=class{send(){}close(){}ea(){}$(){}Y(){}D(){}};function N(a,b,c,d){a=olympe.V.Oz(a.valueOf());if(!a.host&&!a.path)return null;const e=a.scheme?a.scheme.includes('s'):!1;b=new olympe.net.Si(a.host,a.port||(e?443:80),a.path||'',e,b,c,d,a.query||void 0);a.yt&&(c=a.yt.split(':'),2===c.length&&(c=bb(olympe.V.kf(),`${c[0]}:${c[1]}`),Gc(b,{Authorization:`Basic ${c}`})));return b}function Hc(a){return void 0!==a.query?a.query.replace(/[^=&]+/g,b=>encodeURIComponent(b)):null}function Ic(a,b){a.D=b;return a}function Gc(a,b){Object.assign(a.headers,b)}
|
|
439
439
|
olympe.net.Si=class extends olympe.net.oj{constructor(a,b,c,d,e,f,g,h){super(a,b,c,d);this.method=null!=e?e:olympe.net.wa.Sd.GET;this.query=h;this.headers={};this.body=f;this.D=null!=g?g:olympe.net.wa.ResponseType.Xr}Cj(){return this.headers}j(){let a=Hc(this);a=a?`?${a}`:'';if(!Ec(this))return`${Fc(this)}${a}`;const b=Number.isInteger(this.port)?`:${this.port}`:'';return`${(void 0===this.yh?443===this.port:this.yh)?'https':'http'}://${Ec(this)}${b}/${Fc(this)}${a}`}toString(){return this.j()}};
|
|
440
|
-
olympe.net.Si.Sd={Th:'POST',GET:'GET',tu:'HEAD',cr:'PUT',Dc:'DELETE',Rq:'OPTIONS'};olympe.net.qd=class{constructor(a,b,c,d){this.data=a;this.status=null!=b?b:200;this.statusText=null!=c?c:'';this.headers=null!=d?d:{}}getData(){return this.data}Jc(){return this.status}Cj(){return this.headers}};function Jc(a,b){if(!b)throw Error('Try to send an invalid HTTP request: '+b);a.G.debug('SEND HTTP '+b.method+' to '+b.j());const c=a.F++,d=olympe.C
|
|
440
|
+
olympe.net.Si.Sd={Th:'POST',GET:'GET',tu:'HEAD',cr:'PUT',Dc:'DELETE',Rq:'OPTIONS'};olympe.net.qd=class{constructor(a,b,c,d){this.data=a;this.status=null!=b?b:200;this.statusText=null!=c?c:'';this.headers=null!=d?d:{}}getData(){return this.data}Jc(){return this.status}Cj(){return this.headers}};function Jc(a,b){if(!b)throw Error('Try to send an invalid HTTP request: '+b);a.G.debug('SEND HTTP '+b.method+' to '+b.j());const c=a.F++,d=olympe.C.$a(),e=d.onDestroy(()=>{var f=a.j;const g=f.j.get(c);f.j.delete(c);null==g||g()});return Kc(a.j,c,b).finally(()=>{d.Xf(e);a.j.j.delete(c)})}olympe.net.Ua=class{constructor(a){this.G=a;this.j=new olympe.net.we.xu(a);this.F=1;a='Initializing NET layer';this.G.j()&&(a+=' (implementation: '+this.R()+')');this.G.log(a);this.G.log('DONE initializing NET layer (ready to receive connection requests)')}D(){}N(){}H(){}Wf(){}R(){}};function Lc(a){const b=olympe.net.AMQPClient.j.ze,c=olympe.net.AMQPClient.j.CONNECTING,d=olympe.net.AMQPClient.j.vc,e=olympe.net.AMQPClient.j.zb;nb(a.state,b,a.ja.bind(a),[c]);nb(a.state,c,()=>{a.G.debug('Connecting to the AMQP Client..');a.F=!0;F(a.state,b)},[d]);nb(a.state,d,(f,g)=>u(function*(){a.F=null!=g?g:a.F;a.F||a.D.clear();yield Mc(a);if(a.F&&!a.Y&&null!==a.N){let h,k;setTimeout(()=>{a.G.debug('Reconnecting to the AMQPClient..');F(a.state,c)},null!=(k=null==(h=a.N)?void 0:h.lt)?k:5E3)}}),
|
|
441
441
|
[b,c,e]);ob(a.state,e,(f,g)=>{a.G.warn(`Error occurred with the AMQP Client, (was in state ${f}): ${g}`);F(a.state,d,a.F)});a.state.start(d,!1)}function Nc(a,b){lb(a.state,olympe.net.AMQPClient.j.ze,b)}function Oc(a,b){lb(a.state,olympe.net.AMQPClient.j.CONNECTING,b)}function Pc(a,b){lb(a.state,olympe.net.AMQPClient.j.vc,b)}
|
|
442
442
|
function Mc(a){return u(function*(){const b=a.j,c=a.H;a.j=a.H=null;!1===(null==b?void 0:b.closed)&&b.close().catch(d=>a.G.debug(`Issue while closing channel: ${d}`));!1===(null==c?void 0:c.closed)&&(yield olympe.V.Promise.$f(c.close(),500,'AMQPClient close timeout').catch(d=>{a.G.debug(`Error while closing client: ${d}`)}))})}function Qc(a){return null!==a.H&&!a.H.closed&&null!==a.j&&!a.j.closed&&a.F}function Rc(a,b){if(!Qc(a))throw new olympe.error.Tl(null!=b?b:'Not connected to the bus');}
|
|
443
443
|
function Sc(a){let b,c;return Number.parseInt(null!=(c=null==(b=/^.*\((\d+)\)$/.exec(a instanceof Error?a.message:a))?void 0:b[1])?c:'0',10)}
|
|
@@ -451,18 +451,18 @@ if(h===olympe.net.AMQPClient.D.Qm||h===olympe.net.AMQPClient.D.Wk)h=Math.round(5
|
|
|
451
451
|
function Zc(a,{id:b,Kz:c}={}){return u(function*(){const d=yield a.H.channel(b);d.onerror=null!=c?c:e=>{a.G.debug(`Error with channel (${d.id}): ${e}`)};return d})}
|
|
452
452
|
function $c(a,b,c){return u(function*(){Rc(a,'Cannot bind a queue without being connected to the bus');var d;if(null==(d=a.D.get(b))?0:d.yl.has(c))throw Error(`Queue ${b} already bound to topic ${c}`);d=yield Zc(a);try{a.G.debug(`Binding queue ${b} to topic ${c}`),yield d.queueBind(b,'amq.topic',c),a.D.get(b).yl.add(c)}finally{yield d.close()}})}
|
|
453
453
|
function ad(a,b,c){return u(function*(){Rc(a,'Cannot unbind a queue without being connected to the bus');const d=yield Zc(a);try{a.G.debug(`Unbinding queue ${b} to topic ${c}`);let e,f;null==(e=a.D.get(b))||null==(f=e.yl)||f.delete(c);yield d.queueUnbind(b,'amq.topic',c)}finally{try{yield d.close()}catch(e){}}})}
|
|
454
|
-
olympe.net.AMQPClient=class{constructor(a,b){this.G=olympe.ia
|
|
454
|
+
olympe.net.AMQPClient=class{constructor(a,b){this.G=olympe.ia.Ya('AMQP');this.Y=this.F=!1;this.N=null;this.name=b;this.j=this.H=null;this.state=new olympe.V.Aw(this.G);this.D=new Map;this.R=new Map;this.ta=new olympe.V.promise.Tk;const c=olympe.V.Promise.uj(()=>{this.state.getState()===olympe.net.AMQPClient.j.vc?this.F&&F(this.state,olympe.net.AMQPClient.j.CONNECTING):F(this.state,olympe.net.AMQPClient.j.vc,this.F)},0);a.subscribe(d=>{this.G.j()&&this.G.debug('New AMQP configuration received',d);
|
|
455
455
|
this.N=d;null!==d&&(this.Y=!1,c().then())});Lc(this)}connect(){const a=this;return u(function*(){if(Qc(a))return a;a.state.getState()===olympe.net.AMQPClient.j.vc&&F(a.state,olympe.net.AMQPClient.j.CONNECTING);yield mb(a.state,olympe.net.AMQPClient.j.ze);return a})}disconnect(){const a=this;return u(function*(){const b=olympe.net.AMQPClient.j.vc;a.state.getState()!==b&&(F(a.state,b,!1),yield mb(a.state,b))})}ld(a,b,c,d={mandatory:!1,xt:!1}){const e=this;return u(function*(){Rc(e,'Cannot publish a message without being connected to the bus');
|
|
456
|
-
const f=JSON.stringify(c);e.G.j()&&e.G.debug(`AMQP > [${b}]: ${f}`);return(new Promise((g,h)=>{e.R.set(a,
|
|
457
|
-
a.N)throw Error('Cannot connect to the bus without a configuration');a.H=a.$(a.N,a.name);try{let b;yield olympe.V.Promise.nt(a.
|
|
458
|
-
const f=olympe.error.mc.Eq,g=Sc(d);if(g===e||g===f){b.G.debug(`Connection closed by network: ${d}`);F(b.state,olympe.net.AMQPClient.j.vc,b.F);return}}else b.F=!1;e=b.state;F(e,e.j,d)};try{yield b.H.connect(),b.ea(b.H,d=>{b.G.debug(`AMQP connection closed ${d?'with error':'without error'}`);d||F(b.state,olympe.net.AMQPClient.j.vc,b.F)})}catch(d){if(d instanceof Error)switch(Sc(d)){case olympe.error.mc.Ql:case olympe.error.mc.Eq:throw new olympe.error.Tl(d);case olympe.error.mc.Cq:case olympe.error.mc.Dq:case olympe.error.mc.kk:throw b.Y=
|
|
456
|
+
const f=JSON.stringify(c);e.G.j()&&e.G.debug(`AMQP > [${b}]: ${f}`);return(new Promise((g,h)=>{e.R.set(a,l=>h(new olympe.error.Mq(`Impossible to deliver message to topic "${b}": ${l}`)));const k={messageId:String(a)};e.push(()=>e.j.basicPublish(d.xt?'amq.topic':'',b,f,k,d.mandatory)).then(()=>g()).catch(l=>{l=Sc(l)===olympe.net.AMQPClient.D.Qm?new olympe.error.Dm(`Topic ${b} not deployed.`):Error(`Failed to publish a message ${f} to topic ${b}: ${l}`);h(l)})})).finally(()=>e.R.delete(a))})}ja(){const a=
|
|
457
|
+
this;return u(function*(){if(null===a.N)throw Error('Cannot connect to the bus without a configuration');a.H=a.$(a.N,a.name);try{let b;yield olympe.V.Promise.nt(a.Ha.bind(a),(null!=(b=a.N.lt)?b:5E3)/2,[olympe.error.Tl]);a.G.debug('AMQP Client connected')}catch(b){if(b instanceof Event&&'close'===b.type)throw Error('Bus not ready, will try to reconnect..');throw b;}})}Ha(a){const b=this;return u(function*(){b.G.debug(`Connecting to the bus, tentative ${a+1}..`);b.H.onerror=d=>{if(d instanceof amqp.AMQPError){var e=
|
|
458
|
+
olympe.error.mc.Ql;const f=olympe.error.mc.Eq,g=Sc(d);if(g===e||g===f){b.G.debug(`Connection closed by network: ${d}`);F(b.state,olympe.net.AMQPClient.j.vc,b.F);return}}else b.F=!1;e=b.state;F(e,e.j,d)};try{yield b.H.connect(),b.ea(b.H,d=>{b.G.debug(`AMQP connection closed ${d?'with error':'without error'}`);d||F(b.state,olympe.net.AMQPClient.j.vc,b.F)})}catch(d){if(d instanceof Error)switch(Sc(d)){case olympe.error.mc.Ql:case olympe.error.mc.Eq:throw new olympe.error.Tl(d);case olympe.error.mc.Cq:case olympe.error.mc.Dq:case olympe.error.mc.kk:throw b.Y=
|
|
459
459
|
!0,new olympe.error.uk('Connection to the bus is not allowed: check your credentials');}throw new olympe.error.pd(`Connection to the bus failed: check your config and the availability of the bus: ${d}`);}const c=()=>u(function*(){b.j=yield Zc(b,{id:1,Kz:e=>{b.G.debug(`Error with channel 0: ${e}`);b.j=null;e=Sc(e);e!==olympe.net.AMQPClient.D.Qm&&e!==olympe.net.AMQPClient.D.ar||olympe.V.Promise.nt(f=>{b.G.warn(`Trying to recreate channel after being closed, tentative ${f+1}..`);return c()},500).catch(f=>
|
|
460
|
-
{var g=b.state;F(g,g.j,f)})}});yield b.j.confirmSelect();let d;yield b.j.prefetch(null!=(d=b.N.Vz)?d:20);b.j.onReturn=e=>{const f=`Message returned by the server: ${e.bodyToString()}`;let g;null==(g=b.R.get(parseInt(e.properties.kF,10)))||g(f)};b.D.forEach(({Kn:e,exclusive:f},g)=>{Tc(b,g,f,e)})});yield c()})}push(a){return wb(this.
|
|
461
|
-
olympe.net.AMQPClient.D={Wk:0,Qm:404,KC:405,ar:406,EA:504,cq:541};function bd(a){let b;return null!=(b=a.F)?b:{}}function cd(a){return!1===a.j.closed?a.j.basicNack(a.D,!1,void 0).catch(b=>{olympe.ia
|
|
462
|
-
olympe.net.AMQPMessage=class{constructor(a,b,c){this.H=a.redelivered;this.D=a.deliveryTag;this.N=a.routingKey;this.R=b;this.j=c;this.F=null;try{const d=a.bodyToString();this.F=JSON.parse(null!=d?d:'null')}catch(d){console.warn(`AMQPMessage: Failed to parse message payload: ${d}`)}}xi(){return this.H}ack(){return!1===this.j.closed?this.j.basicAck(this.D,!1).catch(a=>{olympe.ia
|
|
460
|
+
{var g=b.state;F(g,g.j,f)})}});yield b.j.confirmSelect();let d;yield b.j.prefetch(null!=(d=b.N.Vz)?d:20);b.j.onReturn=e=>{const f=`Message returned by the server: ${e.bodyToString()}`;let g;null==(g=b.R.get(parseInt(e.properties.kF,10)))||g(f)};b.D.forEach(({Kn:e,exclusive:f},g)=>{Tc(b,g,f,e)})});yield c()})}push(a){return wb(this.ta,a)}$(){}ea(){}};olympe.net.AMQPClient.j={CONNECTING:'CONNECTING',ze:'CONNECTED',vc:'DISCONNECTED',zb:'ERROR'};
|
|
461
|
+
olympe.net.AMQPClient.D={Wk:0,Qm:404,KC:405,ar:406,EA:504,cq:541};function bd(a){let b;return null!=(b=a.F)?b:{}}function cd(a){return!1===a.j.closed?a.j.basicNack(a.D,!1,void 0).catch(b=>{olympe.ia.Ya('amqp').error(`Failed to reject message ${a.D}: ${b}`)}):Promise.resolve()}
|
|
462
|
+
olympe.net.AMQPMessage=class{constructor(a,b,c){this.H=a.redelivered;this.D=a.deliveryTag;this.N=a.routingKey;this.R=b;this.j=c;this.F=null;try{const d=a.bodyToString();this.F=JSON.parse(null!=d?d:'null')}catch(d){console.warn(`AMQPMessage: Failed to parse message payload: ${d}`)}}xi(){return this.H}ack(){return!1===this.j.closed?this.j.basicAck(this.D,!1).catch(a=>{olympe.ia.Ya('amqp').error(`Failed to ack message ${this.D}: ${a}`)}):Promise.resolve()}};olympe.net.di=class{constructor(a){this.G=a}start(){return Promise.reject('Try to start web server with the browser implementation.')}F(){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.')}D(){return Promise.reject('Try to open a route on a web server using the browser implementation.')}R(){return Promise.reject('Try to close a route on a web server using the browser implementation.')}};
|
|
463
463
|
olympe.net.di.ALL='*';olympe.net.yw=class{register(){return u(function*(){throw Error('Service Worker Manager must be overridden by a native layer: called "register"');})}};olympe.net.P={Ea:'net.Manager',Da:'net.Logger',nj:'net.WebServer',qw:'net.ServiceWorkerManager',Fm:'net.OfflineConfig'};olympe.net.U={Bf:'net.httpPort',Sp:'net.httpBodyLimit',hs:'net.http2',Rp:'net.httpsCertificatesPath',xm:'net.localNetworkSuffix',bj:'offline.enabled',Em:'offline.autoBackOnline',Qq:'offline.downloadBatchSize'};
|
|
464
464
|
olympe.W.config(function(a){E(a,olympe.net.U.Bf,3141);E(a,olympe.net.U.Sp,100);E(a,olympe.net.U.hs,!1);E(a,olympe.net.U.Rp,null);E(a,olympe.net.U.xm,'frontend');E(a,olympe.net.U.bj,!1);E(a,olympe.net.U.Em,!1);E(a,olympe.net.U.Qq,20);Ya(a,olympe.net.P.Ea);D(a,olympe.net.P.Da,[olympe.ia.P.Ea],b=>b.cd('net'));C(a,olympe.net.P.nj,olympe.net.di,olympe.net.P.Da);C(a,olympe.net.P.qw,olympe.net.yw);D(a,olympe.net.P.Fm,[new olympe.W.pa(olympe.net.U.bj),new olympe.W.pa(olympe.net.U.Em)],(b,c)=>new Map([['offlineEnabled',
|
|
465
|
-
b],['offlineAutoBackOnline',!b||c]]))},'olympe.net');olympe.Va.node.host={};olympe.Va.node.host.Td=function(a,b){this.G=b};olympe.Va.node.host.Td.prototype.constructor=olympe.Va.node.host.Td;olympe.Va.node.host.Td.prototype.destroy=function(){};olympe.Va.node.host.Td.prototype.destroy=olympe.Va.node.host.Td.prototype.destroy;olympe.Va.node.host.Td.prototype
|
|
465
|
+
b],['offlineAutoBackOnline',!b||c]]))},'olympe.net');olympe.Va.node.host={};olympe.Va.node.host.Td=function(a,b){this.G=b};olympe.Va.node.host.Td.prototype.constructor=olympe.Va.node.host.Td;olympe.Va.node.host.Td.prototype.destroy=function(){};olympe.Va.node.host.Td.prototype.destroy=olympe.Va.node.host.Td.prototype.destroy;olympe.Va.node.host.Td.prototype.Ya=function(){return this.G};olympe.Va.node.host.Td.za=[olympe.host.Oe.Td];olympe.Va.node.host.Hq=class{constructor(a){this.G=a}};olympe.Va.node.host.Hq.za=[olympe.host.wu];olympe.Va.node.host.Fd=class{constructor(){this.j={};this.H={}}destroy(){}N(a){clearTimeout(this.j[a]);delete this.j[a]}Y(a,b,c){this.j[b]=setTimeout(c,a)}F(a){clearTimeout(this.j[a]);delete this.j[a]}R(a,b,c){this.H[b]=setInterval(c,a)}D(a){clearInterval(this.H[a]);delete this.H[a]}};olympe.host.Gq.register(olympe.host.Oe.Fq.js,olympe.Va.node.host.Fd);olympe.Va.node.host.Fd.za=[olympe.host.Oe.Fd];olympe.Va.node.host.Uk=class{constructor(a){this.G=a}j(){return olympe.C.da.D}D(){return!0}};olympe.Va.node.host.Uk.za=[olympe.host.Uk];function dd(a){a.ta.D('readinessProbe','/readiness',[olympe.net.wa.Sd.GET],()=>fd(a,a.ea)).catch(b=>a.G.error(`Failed to add readiness health check route ${b}`));a.ta.D('livenessProbe','/liveness',[olympe.net.wa.Sd.GET],()=>fd(a,a.$)).catch(b=>a.G.error(`Failed to add liveness health check route ${b}`));a.H(()=>a.ta.stop())}
|
|
466
466
|
function gd(a,b){b=Array.from(b.values()).map(c=>c());return Promise.allSettled(b).then(c=>{let d=!1;for(const e of c)'rejected'===e.status&&(d=!0,a.G.warn(`Failed to close some resource: ${e.reason}`));return d})}function hd(a){return u(function*(){try{const b=yield gd(a,a.N),c=yield gd(a,a.R),d=yield gd(a,a.Y);if(b||c||d)throw Error('Failed to gracefully close the backend');}finally{a.N.clear(),a.R.clear(),a.Y.clear()}})}
|
|
467
467
|
function fd(a,b){const c=olympe.net.wa.Ub.Rh,d=olympe.net.wa.Ub.gj;b=Array.from(b.values()).map(e=>e.apply(a));return 0===b.length?Promise.resolve(new olympe.net.qd('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.G.warn(`Health check detected a service which is DOWN: ${e}`)):g+=`\n${h.value}`;return new olympe.net.qd(g,f?d:c,f?'Some services are not working':'Everything is OK')})}
|
|
468
468
|
olympe.Va.node.host.Je=class extends olympe.host.Je{constructor(a,b,c,d=!0){super();this.G=a;this.ta=b;this.Wa=c;this.$=new Map;this.ea=new Map;this.R=new Map;this.N=new Map;this.Y=new Map;d&&dd(this)}j(a,b=olympe.V.jf(),c=olympe.host.Je.j.ALL){switch(c){case olympe.host.Je.j.LIVENESS:this.$.set(b,a);break;case olympe.host.Je.j.READINESS:this.ea.set(b,a);break;default:this.$.set(b,a),this.ea.set(b,a)}return b}D(a){this.ea.delete(a);this.$.delete(a)}H(a,b=olympe.V.jf()){this.R.set(b,this.$f(b,a,this.Wa));
|
|
@@ -482,7 +482,7 @@ ld.Ok;yield c.j.close();c.j=c.createServer();yield c.start()})})})}stop(){return
|
|
|
482
482
|
jd(a);a.addContentTypeParser('*',{parseAs:'buffer'},(c,d,e)=>{e(null,d)});return a}uj(a,b=1E3){this.timer&&clearTimeout(this.timer);this.timer=setTimeout(a,b)}};olympe.W.config(function(a){C(a,olympe.net.P.nj,olympe.Va.node.net.http.di,olympe.net.P.Da,new olympe.W.pa(olympe.net.U.Bf),new olympe.W.pa(olympe.net.U.Sp),new olympe.W.pa(olympe.net.U.hs),new olympe.W.pa(olympe.net.U.Rp))},'olympe.native.node.net.http');olympe.Va.node.V={};const sd=require('stream').Readable,td=require('buffer');
|
|
483
483
|
olympe.Va.node.V.Jl=class extends olympe.V.Jl{D(a){return new Uint8Array(Buffer.from(a,'base64'))}j(a){return a instanceof Uint8Array?Buffer.from(a,a.byteOffset,a.byteLength).toString('base64'):Buffer.from(a).toString('base64')}H(a){const b=this,c=()=>super.H;return u(function*(){if(a instanceof sd){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)})}F(a){return Promise.resolve().then(()=>td.resolveObjectURL(a)).catch(b=>
|
|
484
484
|
{throw Error(`Error while trying to fetch buffer from ObjectURL: ${b}`);})}};olympe.W.config(function(a){Wa(a,olympe.V.P.Eg,olympe.Va.node.V.Jl)},'olympe.native.node.utils');olympe.async={};function ud(a,b){a.H||a.Y.push(a.F.tc(b))}
|
|
485
|
-
olympe.async.rp=class{constructor(a,b=void 0===a){this.D=[];this.Y=[];this.F=a||new olympe.C.Wb('Async executor context');this.ja=b;this.j=null;this.env=new Map;this.env.set('Executor',this);this.H=this.N=!1;this.G=null;this.timer=this.timeout=0;this.$=olympe.V.Kc()}$f(a){0<=a&&(this.timeout=a);return this}
|
|
485
|
+
olympe.async.rp=class{constructor(a,b=void 0===a){this.D=[];this.Y=[];this.F=a||new olympe.C.Wb('Async executor context');this.ja=b;this.j=null;this.env=new Map;this.env.set('Executor',this);this.H=this.N=!1;this.G=null;this.timer=this.timeout=0;this.$=olympe.V.Kc()}$f(a){0<=a&&(this.timeout=a);return this}Ya(){return this.G}add(a){this.H||this.D.push(this.F.tc(a));return this}start(){this.N||(this.G&&this.G.log('Executor started.'),this.N=!0,this.F.onDestroy(()=>{this.j='Context destroyed.';this.complete(!1)},
|
|
486
486
|
this.$),0<this.timeout&&(this.timer=setTimeout(()=>{this.j='Timeout expired.';this.timer=0;this.complete(!1)},this.timeout)))}clear(){this.D=[];this.Y=[];this.env.clear();this.ja&&this.F.destroy()}complete(a){this.F.Xf(this.$);if(!this.H){this.H=!0;this.timer&&(clearTimeout(this.timer),this.timer=0);this.G&&this.G.log(a?'Executor completed successfully':`Executor completed with error: ${this.j}`);for(const b of this.Y)b(a,a?null:this.j,this.env);this.clear()}}getContext(){return this.F}};
|
|
487
487
|
function vd(a){if(0<a.D.length){const b=a.D.shift();a.G&&a.G.log(`Executing next task. ${a.D.length} tasks left in the pipeline.`);a.getContext().run(()=>{b(()=>{Promise.resolve().then(()=>{vd(a)})},c=>{c&&(a.j=c);a.complete(!1)},a.env)})}else a.complete(!0)}olympe.async.xw=class extends olympe.async.rp{static create(){return new olympe.async.xw(new olympe.C.Wb('SequencedExecutor'),!0)}start(){this.N||(super.start(),vd(this))}};
|
|
488
488
|
olympe.async.Dk=class extends olympe.async.rp{constructor(a,b){super(a,b);this.R=0;this.ea=!0}static create(){return new olympe.async.Dk(new olympe.C.Wb('ParallelExecutor'),!0)}run(a){this.G&&this.G.log('Starting a task');this.getContext().run(()=>{a(()=>{this.done()},b=>{this.ea=!1;b&&(this.j=this.j?`${this.j}. ${b}`:b);this.done()},this.env)})}add(a){super.add(a);this.N&&!this.H&&(this.R++,this.run(a));return this}done(){this.R--;0>=this.R&&this.complete(this.ea)}start(){if(!this.N)if(super.start(),
|
|
@@ -553,13 +553,13 @@ a:if(!this.Y)throw Error('No stream handler has been set, so cannot serialize th
|
|
|
553
553
|
typeof a:return a}if(Array.isArray(a))return a.map(d=>this.j(d));if('object'!==typeof a)throw new olympe.error.jp(`Impossible to deserialize the following value: ${a}`);const {t:b,v:c}=a;switch(b){case olympe.L.ec.j.Wl:return new Date(c);case olympe.L.ec.j.COLOR:return olympe.C.Color.Qb(c);case olympe.L.ec.j.vq:return new Map(Object.entries(c).map(([e,f])=>[e,this.j(f)]));case olympe.L.ec.j.Zg:return new Set(c.map(e=>this.j(e)));case olympe.L.ec.j.ARRAY_BUFFER:return olympe.V.kf().D(c).buffer;case olympe.L.ec.j.ai:return olympe.V.kf().D(c);
|
|
554
554
|
case olympe.L.ec.j.ke:if(!this.R)throw Error('No stream handler has been set, so cannot deserialize the stream.');let d;return null==(d=this.R)?void 0:d.call(this,c);case olympe.L.ec.j.Oq:return Object.entries(c).reduce((e,[f,g])=>{e[f]=this.j(g);return e},{});default:throw new olympe.error.jp(`Impossible to deserialize the following value: ${c}`);}}format(a,b){return{t:a,v:b}}};olympe.L.ec.j={Wl:1,COLOR:2,vq:3,Zg:4,ARRAY_BUFFER:5,ai:6,ke:7,Oq:8};const Me=olympe.L.xa.j.SEND,Ne=olympe.L.xa.j.GET,Oe=olympe.L.xa.j.PUBLISH,Pe=olympe.L.xa.j.SUBSCRIBE,Qe=olympe.L.xa.j.ig,Re=olympe.L.xa.j.cs,Se=olympe.L.xa.j.Gr,Te=olympe.L.xa.j.zb,Ue=olympe.L.xa.j.ks,Ve=olympe.L.xa.j.ng;function Id(a,b){a.j||(a.j=hb(new olympe.V.bn(a.D.ff+3E4),c=>{let d;null==(d=a.H)||d.call(a,c)}));a.j.add(b)}
|
|
555
555
|
function We(a){let b,c;const d=null!=(c=null==(b=a.j)?void 0:b.code)?c:olympe.error.mc.Wk;let e,f;a=null!=(f=null==(e=a.j)?void 0:e.reason)?f:'Unknown Error';return d===olympe.error.mc.TIMEOUT?new olympe.error.Vk(a):new olympe.error.pd(a,d)}function Xe(a,b){const c=olympe.L.xa.j.ng,d=olympe.L.xa.j.Zr;return b.getType()!==c?Promise.reject('Should only call `topicAck` on TOPIC responses'):a.send(b.j.seq,b.jb(),b.jb(),d)}
|
|
556
|
-
olympe.L.rb=class{constructor(a,b){this.D=olympe.L.jh();this.F=a;this.H=this.j=null;this.N=new olympe.C.Wb(`Service ${a}`,'function'===typeof b.Bb?b.Bb():b);this.G=olympe.ia
|
|
557
|
-
a,Oe,b,!1)})}static Ws(a){const b=olympe.L.jh(),c=new olympe.L.Ek(a,b);be(b,a).then(d=>Ye(c,d)).catch(d=>olympe.ia
|
|
558
|
-
d.j;if(null!==d)return d;throw Error('No payload after request to service: '+a);case Te:throw We(d);default:throw Error('Unsupported response type for a GET request');}})}static observe(a,b,c,d={}){const e='function'===typeof b.Bb?b.Bb():b,f=olympe.L.jh(),g=new olympe.L.Ek(a,f);return{observable:(new rxjs.Observable(h=>{let k=null,l=null,n=null;const p=()=>{h.complete();l&&n&&(ge(f,a,n,l),l=n=null);k&&(Wd(f,k).catch(q=>olympe.ia
|
|
559
|
-
e.Yd(p);f.request(a,a,Pe,c,!0,d.timeout).then(q=>{switch(q.getType()){case Ve:Ye(g,q.jb());const r=q.j;k=r.topic;Xd(f,k,t=>{t.getType()===Oe?h.next(t.j):(h.error('Unsupported notification message. It should be a publish'),p())}).then(()=>{l=r.id;n=q.jb();fe(f,a,n,l,r.refresh,t=>h.error(t));Xe(f,q).catch(t=>{h.error(`Was unable to ack the subscription: ${t}`);p()})}).catch(t=>{h.error(`Was not able to subscribe to notification topic ${k}: ${t}`);
|
|
560
|
-
h.error(q));return p})).pipe(tb(olympe.error.Qh,(h,k)=>{olympe.ia
|
|
561
|
-
b.F,Oe,a,!1,b.D.mb)})}R(a,b){var c=new olympe.L.Fc(b,this.D,this);switch(b.getType()){case Qe:var d=c.body().filter(f=>{let g;return!(null==(g=this.j)?0:gb(g,f))});c.dd(d).catch(f=>this.G.error('Not able to validate subscription keep alive',f));break;case Re:c=c.body();null==(d=this.j)||d.delete(c);let e;null==(e=this.H)||e.call(this,c);break;default:a.next(c)}}};
|
|
562
|
-
olympe.L.rb.observe=olympe.L.rb.observe;olympe.L.rb.get=olympe.L.rb.get;olympe.L.rb.send=olympe.L.rb.send;olympe.L.rb.getPublisher=olympe.L.rb.Ws;olympe.L.rb.publish=olympe.L.rb.ld;olympe.L.rb.prototype.stop=olympe.L.rb.prototype.stop;olympe.L.rb.prototype.setUnsubscriptionHandler=olympe.L.rb.prototype.ut;olympe.L.Yq=class{constructor(a){this.j=0;this.buffer=[];this.size=null;this.stream=new olympe.V.stream.mg;this.D=null!=a?a:()=>{}}write(a,b){const c=this;return u(function*(){if(b<c.j||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.j}`);for(c.buffer[b-c.j]=a;void 0!==c.buffer[0];){c.j++;const d=c.buffer.shift();yield c.stream.write(d)}c.j===c.size&&(c.D(),c.stream.complete())})}complete(a){if(null!==
|
|
556
|
+
olympe.L.rb=class{constructor(a,b){this.D=olympe.L.jh();this.F=a;this.H=this.j=null;this.N=new olympe.C.Wb(`Service ${a}`,'function'===typeof b.Bb?b.Bb():b);this.G=olympe.ia.Ya(`Service ${this.F}`)}ut(a){this.H=a;return this}stop(){this.N.destroy()}clear(){Wd(this.D,this.F).catch(b=>this.G.error('Failed to unsubscribe from '+this.F+', error: '+b));if(this.H){let b;null==(b=this.j)||b.forEach(c=>{let d;return null==(d=this.H)?void 0:d.call(this,c)})}let a;null==(a=this.j)||a.clear()}static ld(a,b){return u(function*(){yield olympe.L.jh().request(a,
|
|
557
|
+
a,Oe,b,!1)})}static Ws(a){const b=olympe.L.jh(),c=new olympe.L.Ek(a,b);be(b,a).then(d=>Ye(c,d)).catch(d=>olympe.ia.Ya('Publisher for service '+a).error('Failed to get session id for publisher',d));return c}static send(a,b,c={}){return olympe.L.jh().request(a,a,Me,b,!0,c.timeout).then(d=>{switch(d.getType()){case Se:break;case Te:throw We(d);default:throw Error('Unsupported response type for a SEND request');}})}static get(a,b,c={}){return olympe.L.jh().request(a,a,Ne,b,!0,c.timeout).then(d=>{switch(d.getType()){case Ue:d=
|
|
558
|
+
d.j;if(null!==d)return d;throw Error('No payload after request to service: '+a);case Te:throw We(d);default:throw Error('Unsupported response type for a GET request');}})}static observe(a,b,c,d={}){const e='function'===typeof b.Bb?b.Bb():b,f=olympe.L.jh(),g=new olympe.L.Ek(a,f);return{observable:(new rxjs.Observable(h=>{let k=null,l=null,n=null;const p=()=>{h.complete();l&&n&&(ge(f,a,n,l),l=n=null);k&&(Wd(f,k).catch(q=>olympe.ia.Ya('Service '+a).error('Failed to unsubscribe from a topic '+q)),k=null)};
|
|
559
|
+
e.Yd(p);f.request(a,a,Pe,c,!0,d.timeout).then(q=>{switch(q.getType()){case Ve:Ye(g,q.jb());const r=q.j;k=r.topic;q.ack().catch(()=>olympe.ia.Ya('Service '+a).error('Failed to ack the msg'));Xd(f,k,t=>{t.getType()===Oe?h.next(t.j):(h.error('Unsupported notification message. It should be a publish'),p())}).then(()=>{l=r.id;n=q.jb();fe(f,a,n,l,r.refresh,t=>h.error(t));Xe(f,q).catch(t=>{h.error(`Was unable to ack the subscription: ${t}`);p()})}).catch(t=>{h.error(`Was not able to subscribe to notification topic ${k}: ${t}`);
|
|
560
|
+
p()});break;case Te:h.error(We(q));break;default:h.error('Unsupported response type for a SUBSCRIBE request')}}).catch(q=>h.error(q));return p})).pipe(tb(olympe.error.Qh,(h,k)=>{olympe.ia.Ya(`Service ${a}`).debug(`Subscribed to topic ${h.T()} now that we are back online, after waiting for ${k}ms`);let l;null==(l=d.onRetry)||l.call(d)})),publisher:g}}listen(){return new rxjs.Observable(a=>{const b=()=>{a.complete();this.clear()};this.N.onDestroy(b);Xd(this.D,this.F,this.R.bind(this,a),!1).catch(c=>
|
|
561
|
+
{c='Failed to connect to the bus: '+c;this.G.error(c);a.error(Error(c))});return b})}yi(a){const b=this;return u(function*(){yield b.D.request(b.F,b.F,Oe,a,!1,b.D.mb)})}R(a,b){var c=new olympe.L.Fc(b,this.D,this);switch(b.getType()){case Qe:var d=c.body().filter(f=>{let g;return!(null==(g=this.j)?0:gb(g,f))});c.dd(d).catch(f=>this.G.error('Not able to validate subscription keep alive',f));break;case Re:c=c.body();null==(d=this.j)||d.delete(c);let e;null==(e=this.H)||e.call(this,c);break;default:a.next(c)}}};
|
|
562
|
+
olympe.L.rb.prototype.multicast=olympe.L.rb.prototype.yi;olympe.L.rb.prototype.listen=olympe.L.rb.prototype.listen;olympe.L.rb.observe=olympe.L.rb.observe;olympe.L.rb.get=olympe.L.rb.get;olympe.L.rb.send=olympe.L.rb.send;olympe.L.rb.getPublisher=olympe.L.rb.Ws;olympe.L.rb.publish=olympe.L.rb.ld;olympe.L.rb.prototype.stop=olympe.L.rb.prototype.stop;olympe.L.rb.prototype.setUnsubscriptionHandler=olympe.L.rb.prototype.ut;olympe.L.Yq=class{constructor(a){this.j=0;this.buffer=[];this.size=null;this.stream=new olympe.V.stream.mg;this.D=null!=a?a:()=>{}}write(a,b){const c=this;return u(function*(){if(b<c.j||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.j}`);for(c.buffer[b-c.j]=a;void 0!==c.buffer[0];){c.j++;const d=c.buffer.shift();yield c.stream.write(d)}c.j===c.size&&(c.D(),c.stream.complete())})}complete(a){if(null!==
|
|
563
563
|
this.size)throw Error('The stream has already been completed');if(a<this.j+this.buffer.length)throw Error(`The stream has already reached element n\u00b0${this.j+this.buffer.length}, specified index must be greater or equal to it.`);this.size=a;this.j===this.size&&(this.D(),this.stream.complete())}throw(a){this.D();this.stream.throw(a)}};function Ye(a,b){a.j=b;a.D.forEach(c=>c());a.D=[];return a}olympe.L.Ek=class{constructor(a,b){this.F=b;this.D=[];this.H=a;this.j=null}ld(a){const b=this;return u(function*(){b.j||(yield new Promise(c=>{b.D.push(()=>c())}));yield b.F.request(b.j,b.H,olympe.L.xa.j.PUBLISH,a,!0)})}};olympe.L.Ek.prototype.publish=olympe.L.Ek.prototype.ld;olympe.L.Ee={Hg:1,bg:2,zb:3,Og:4,FA:5,nk:6,pc:7};olympe.L.sk={nk:1,Ow:2,mu:3,ig:5,aw:1,cE:2};olympe.L.Me={Hg:0,Fh:1,zb:2};olympe.L.Oa.j={INIT:'initialize',CONNECTING:'connecting',vc:'disconnected',ep:'disconnecting',ze:'connected',Ug:'reconnecting',Zk:'waking',no:'awake',zb:'error'};olympe.L.Oa.F={Rh:1,pu:-1,Fu:-2,Fw:-3};olympe.L.Oa.D={ij:0,cq:23};
|
|
564
564
|
olympe.L.Oa.pc={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',
|
|
565
565
|
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.L.P={vf:'com.ConnectivityManager',Nk:'com.ServerManager',Ao:'com.BusManager',km:'com.HttpManager',Le:'com.Serializer',Da:'com.Logger',$g:'com.Source',ds:'com.Urls',AC:'com.peerFileSvcUrl'};
|
|
@@ -628,7 +628,7 @@ olympe.dc.Ig=class{constructor(a,b){this.id=a;this.Ga=this.j=this.D=null;this.dl
|
|
|
628
628
|
this.id),this.Ga=null,this.j):new olympe.dc.db.fc(this.id)}jl(){if(Array.isArray(this.Ga))return this.Ga;if(this.j instanceof olympe.dc.db.fc){const a=new olympe.dc.transaction.He;this.j.rc(a);return Xf(a)}return[]}ga(){return{p:this.jl(),t:this.dl,s:this.D,i:this.id}}};olympe.dc.Ig.za=[olympe.dc.fr];olympe.dc.Sa={};const Yf=olympe.dc.va.ORIGIN,Zf=olympe.dc.va.DESTINATION,$f=new Map,ag=new Map,bg=new Map,cg=new Map;function Qf(a){let b;return null!=(b=$f.get(a))?b:null}function dg(a,b,c){let d=a;'function'===typeof a&&(d=c.entry);a=[...(d.ao||[])];return olympe.dc.na.j(b,c,...a)}function eg(a,b){cg.set(a,b);return a}function fg(a){let b,c;return null!=(c=null==(b=$f.get(a))?void 0:b.D)?c:olympe.dc.CloudObject}
|
|
629
629
|
function gg(a,b,c){const d=a+'@'+(b===Zf?Yf:Zf);if(ag.has(d))throw Error(`Try to register the same relation (${b+a}) multiple times.`);ag.set(d,c)}function hg(a){a=a.X()+'@'+a.La();return ag.get(a)||olympe.dc.CloudObject}function P(a,b){b.NAME=a;bg.set(a,b)}function Q(a){let b;return null!=(b=a.NAME)?b:null}
|
|
630
630
|
olympe.dc.na=class{constructor(){}static j(a,b,...c){if($f.has(a))throw Error(`Tag: ${a} - overwriting already defined CloudObject class ${$f.get(a).D.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.rb(g):g}}b=new olympe.dc.Sa.Entry(a,b,d);$f.set(a,b);return b.D.entry=b}static ac(a){let b,c;return null!=(c=null==(b=a.entry)?void 0:b.X())?c:null}};function ig(a,b){a.j=b}function R(a,b){b=b.$b();gg(b.X(),b.La(),a.D);return b}function jg(a){a.F=!0;return a}
|
|
631
|
-
olympe.dc.Sa.Entry=class{constructor(a,b,c){this.tag=a;this.D=b;this.ao=c||null;this.j=null;this.F=!1}X(){return this.tag}instantiate(a,b){const c=this.D;if(this.Mn()&&b.getParameter(olympe.dc.U.op)){var d=olympe.dc.ha();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.ia
|
|
631
|
+
olympe.dc.Sa.Entry=class{constructor(a,b,c){this.tag=a;this.D=b;this.ao=c||null;this.j=null;this.F=!1}X(){return this.tag}instantiate(a,b){const c=this.D;if(this.Mn()&&b.getParameter(olympe.dc.U.op)){var d=olympe.dc.ha();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.ia.Ya('dc').error(d)}return this.ao?(a=[void 0,a].concat(Oa(b,this.ao)),new c(...a)):new c(void 0,
|
|
632
632
|
a)}ka(a){return new olympe.dc.Sa.Property(a)}sa(a,b=olympe.dc.va.DESTINATION){gg(a,b,this.D);return new olympe.dc.ba.af(a,b)}Mn(){return this.F}};w('olympe.dc.registry.Entry',olympe.dc.Sa.Entry);olympe.dc.Sa.Entry.prototype.addRelation=olympe.dc.Sa.Entry.prototype.sa;olympe.dc.Sa.Entry.prototype.addProperty=olympe.dc.Sa.Entry.prototype.ka;olympe.dc.Sa.Entry.za=[olympe.dc.Ze];olympe.dc.Sa.Property=class{constructor(a){this.tag=a}X(){return this.tag}toString(){return`Property: ${this.tag}`}};olympe.dc.Sa.Property.prototype.getTag=olympe.dc.Sa.Property.prototype.X;olympe.dc.Sa.Property.za=[olympe.dc.Ze];olympe.dc.Sa.Relation=class{constructor(a,b=olympe.dc.va.DESTINATION,c=olympe.dc.CloudObject,d=olympe.dc.CloudObject){this.tag=olympe.dc.fa(a);this.direction=b;this.origin=c;this.H=d}X(){return this.tag}La(){return this.direction}type(){return this.H}$b(){return new olympe.dc.Sa.Relation(this.tag,this.direction===olympe.dc.va.DESTINATION?olympe.dc.va.ORIGIN:olympe.dc.va.DESTINATION,this.H,this.origin)}Fa(a){return a instanceof olympe.dc.Sa.Relation?a.X()===this.X()&&a.La()===this.La():!1}toString(){return`${this.direction}${olympe.dc.ha().name(this.tag)} (${this.tag})`}};
|
|
633
633
|
olympe.dc.Sa.Relation.prototype.getInverse=olympe.dc.Sa.Relation.prototype.$b;olympe.dc.Sa.Relation.prototype.getDirection=olympe.dc.Sa.Relation.prototype.La;olympe.dc.Sa.Relation.prototype.getTag=olympe.dc.Sa.Relation.prototype.X;olympe.dc.Sa.Relation.za=[olympe.dc.Ze];olympe.dc.db={};function kg(a,b){const c=a.H,d=olympe.dc.ha(),e=olympe.dc.db.Database.D.ej,f=olympe.dc.db.Database.D.Ye,g=olympe.dc.db.Database.D.ORIGIN,h=olympe.dc.db.Database.D.DESTINATION,k=new olympe.dc.db.fc('rev-'+b.T());a.G.debug('Generate the reverse graphLayer of',b.T());b.Ab.forEach((l,n)=>{if(l.D()){k.D(n,olympe.dc.Mb.NONE);for(const [r,t]of l.Jd())k.ic(r,n,t)}else{var p=c.get(n);if(void 0!==p)if(l.zd())for(const r of lg(d,n,l.F())){l=c.get(r);const t=new Map;l.forEach((v,x)=>{const y=x[0],z=x.substring(1);
|
|
634
634
|
y===e?t.set(z,v):y===f?t.set(x,v):y===g?v.forEach((A,K)=>{k.Pa(z,K,r)}):y===h&&v.forEach((A,K)=>{k.Pa(z,r,K)})});l=l.source();k.Rc(r,l,t)}else{const r=new Map;for(const t of l.Cb().keys()){var q=t[0]===f;const v=q?t.substring(1):t;q=q?mg(p,v,!0):p.Ra(v,!0);let x;r.set(t,null!=(x=q)?x:null)}0<r.size&&k.Yc(n,r);for(const [t,v,x]of l.Jd())x?k.ic(t,n,v):k.Pa(t,n,v)}}});return k}
|
|
@@ -641,7 +641,7 @@ olympe.dc.db.Xt=class{constructor(a,b,c,d){this.G=a;this.H=b;this.ha=c;let e;thi
|
|
|
641
641
|
function wg(a,b,c,d){const e=olympe.dc.va.DESTINATION,f=c.tag(),g=a.j.Tc(f);b.Cb().forEach((h,k)=>{void 0!==c.Ra(k)&&(g.ka(k,h),b.$(k))});for(const [h,k,l]of b.Jd()){const n=c.mb(h,e,k);void 0!==n&&(d.N(h,f,k),n===l&&a.j.N(h,f,k))}}
|
|
642
642
|
class og extends ug{constructor(a,b){super();this.D=a;this.j=b;this.db=olympe.dc.ha()}T(){return this.D.T()}nd(a){for(const [b,c]of this.D.ea(a)){const d=b.tag();c.zd()?b.D()?a.j(d,b.F()):(this.D.j(d,c.F()),this.j.j(d,c.F())):b.zd()?(vg(this,c,b,a),a.j(d,b.F())):wg(this,c,b,a)}return a}}function xg(a){clearTimeout(a.F);a.F=setTimeout(()=>{a.buffer.splice(a.buffer.indexOf(a),1)},a.H)}
|
|
643
643
|
class qg extends ug{constructor(a,b,c,d){super();this.j=a;this.D=b;this.buffer=c;this.H=d;this.F=null;xg(this)}T(){return this.j.T()}nd(a){return a.R(this.j)}update(a,b){this.D=b;a.rc(this.j);xg(this);return this}};const yg=olympe.dc.hc.$c,zg=olympe.dc.hc.Li,Ag=olympe.dc.va.ORIGIN,Bg=olympe.dc.va.DESTINATION;let Cg=0;
|
|
644
|
-
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.Ia.SELF;this.G=b;this.wd=olympe.C
|
|
644
|
+
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.Ia.SELF;this.G=b;this.wd=olympe.C.$a();this.state=olympe.dc.db.Database.F.IDLE;this.ja=new Map;this.Yb=[];this.Y=new Map;this.H=null;this.ea=new Set;var f;b=null!=(f=d.get('garbageCollector'))?f:olympe.dc.db.Af.j.am;let g;f=null!=(g=d.get('garbageCollectorDelay'))?g:5E3;this.Gd=new olympe.dc.db.Af(c,this,b,f);d.get('debug')&&this.Xs()}T(){return this.id}getState(){return this.state}Ya(){return this.G}create(b,
|
|
645
645
|
c,d,e=!1){var f=this.N(b,!0);if(!f.e&&null!==c&&(null===f.H||f.H===c)){f.H=c;let g;(null==(g=f.model())?0:g.e)&&f.db.$(f,!0)}e&&f.persist();this.state===a.F.Gl&&Dg(f,!0);d&&this.Pc(f,d);this.D(a.j.$p,b)}update(b,c){c&&(b=this.N(b,!0),this.Pc(b,c))}ta(b){const c=this.get(b);void 0!==c&&(this.$(c,!1),this.D(a.j.aq,b))}link(b,c,d){c=this.N(c,!0);d=this.N(d,!0);switch(b){case yg:Eg(c,d);break;case zg:Fg(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!==
|
|
646
646
|
d)switch(b){case yg:Gg(c,d);break;case zg:Hg(c,d);break;default:c.unlink(b,d)}}tg(b,c){for(const d of b)this.N(d).oe(c)}ni(b,c){for(const d of b)(b=this.get(d))&&b.detach(c)}Zs(b){b.forEach(c=>{this.N(c).persist()})}Nd(b){const c=this.get(b);void 0!==c&&(c.clear(),super.delete(b),this.D(a.j.mp,b))}N(b,c=!1){let d;return null!=(d=this.get(b))?d:this.Rc(b,c)}Rc(b,c){const d=new olympe.dc.db.Instance(b,this);this.set(b,d);this.D(a.j.lp,b);c&&this.state!==a.F.Gl&&this.D(a.j.cn,b);return d}Eb(b){var c=
|
|
647
647
|
olympe.V.oi();this.H?Ig(this.H,c,b):b()}R(b){let c;null!=(c=this.H)&&c.j.delete(b)}Ha(b,...c){this.ja.has(b)&&this.ja.get(b).forEach(d=>{d(...c)})}D(b,c,...d){this.Ha(b,c,...d)}$(b,c){let d;null!=(d=this.H)&&d.H.set(b,c)}Pe(b,c,d,e){let f;null!=(f=this.H)&&Jg(f,b).ka(e?Kg+c:c,d)}ff(b,c,d,e,f){let g;null!=(g=this.H)&&(d===Lg?f?Jg(g,b).link(c,e):Jg(g,b).unlink(c,e):f?Jg(g,b).Eb(c,e):Jg(g,b).Gc(c,e))}Wa(b,c,d){let e;null!=(e=this.H)&&Jg(e,b).Nd(c,d)}addEventListener(b,c){let d=this.ja.get(b);void 0===
|
|
@@ -649,7 +649,7 @@ d&&(d=[],this.ja.set(b,d));d.push(c)}j(b,c){this.addEventListener(b,c)}mb(b){thi
|
|
|
649
649
|
null}le(b){this.state=a.F.uf;const c=this.Y.get(b);c&&(this.H=c,Mg(this.H),Ng(this.H),this.Y.delete(b),this.H=null);this.ea.delete(b);0===this.ea.size&&(this.state=a.F.IDLE,this.Yb.forEach(d=>{d()}),Og(this.Gd))}Pc(b,c){const d=a.D.Ye;for(const [e,f]of c)void 0!==f&&(e[0]===d?Pg(b,e.substring(1),f):b.update(e,f))}Gc(b,c,d=[]){const e=c.tag();if(!b.has(e)&&(b.add(e),d.push(c),c=c.get(Ag+yg)))for(const f of c.values())null!==f.source()&&this.Gc(b,f,d);return d}Xs(){const b=a.j.em,c=a.j.Ik,d=new Set,
|
|
650
650
|
e=new Map;this.j(a.j.$p,f=>{d.add(f)});this.j(b,f=>{d.delete(f);e.delete(f)});this.j(c,(f,...g)=>{if(g[0]===zg&&g[1]===Bg){const h=g[2];this.get(h).Ja()||(g=e.get(h)||new Set,0===g.size&&e.set(h,g),g.add(f))}});this.mb(()=>{d.forEach(f=>{const g=this.get(f);g&&null===g.model()&&this.G.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.G.error(`\n[DEBUG - DATABASE]\nThe model ${g} is extended by other models but does not exist !`+
|
|
651
651
|
`\nExtension models: ${Array.from(f.values()).join(', ')}`+`\n\n ${h.toString()}`)});e.clear()})}};olympe.dc.db.Database.D={ej:'$',Du:'~',Ye:'?',Bl:'=',Xp:'|',Hi:'@',ORIGIN:olympe.dc.va.ORIGIN,DESTINATION:olympe.dc.va.DESTINATION};olympe.dc.db.Database.j={lp:0,mp:1,es:2,cn:3,Jo:4,Ko:5,em:6,Dc:7,Ik:8,Sm:9,$p:10,aq:11,mr:12,HA:13,GA:14,Iw:15,Bp:16};olympe.dc.db.Database.F={IDLE:0,Al:1,Tv:2,Gl:3,uf:4};function Qg(a,b,c=[]){const d=b.T();ng(a.j,b,c);return e=>{if(null!==e)a.j.push(d,e);else{e=a.j;var f=e.F.get(d);if(void 0!==f){const g=e.D.indexOf(d);e.D.splice(g,1);f=rg(e,f.j,e.D.length);e.write(pg(e,f,Date.now()),!1);e.F.delete(d)}}}}function Rg(a,b,c={}){let d,e;return tg(a.j,b,null!=(d=c.persist)?d:!0,null!=(e=c.nn)?e:!1)}function Sg(a,b){a.D.mb(b)}
|
|
652
|
-
olympe.dc.db.gu=class{constructor(a,b,c,d,e){this.G=a;this.D=b;this.view=c;this.j=new olympe.dc.db.Xt(a,b,c,d);this.wz=new olympe.dc.db.Cv(a,c,b,e)}
|
|
652
|
+
olympe.dc.db.gu=class{constructor(a,b,c,d,e){this.G=a;this.D=b;this.view=c;this.j=new olympe.dc.db.Xt(a,b,c,d);this.wz=new olympe.dc.db.Cv(a,c,b,e)}Ya(){return this.G}nd(a,b={}){let c,d;this.j.nd(a,null!=(c=b.persist)?c:!0,null!=(d=b.nn)?d:!1)}oe(a,b){this.D.tg(a,b)}detach(a,b){this.D.ni(a,b);return this}};const Tg=olympe.dc.db.Database.D.ORIGIN,Ug=olympe.dc.db.Database.D.DESTINATION,Vg=olympe.dc.db.Database.D.ej,Wg=olympe.dc.db.Database.D.Ye,Xg=olympe.dc.db.Database.D.Bl,Yg=olympe.dc.db.Database.D.Xp,Zg=Tg+Ug,$g=Vg+Vg,ah=olympe.dc.db.Database.F;let bh=0;function Mf(a,b,c,d=!1){const e=S(a,b);if(null!==e){const f=ch(e,'',c);void 0!==f&&(a.j.getState()!==ah.uf||e.F()&&!d||a.j.R(c),d||!e.Ja()&&!e.F()||f(!1,b))}}
|
|
653
653
|
function Of(a,b,c,d){a=a.j.N(dh(b));d=null!=d?d:eh();fh(a,'',d,c)&&a.Ja()&&c(!0,b);return d}function lg(a,b,c){return{[Symbol.iterator]:function*(d,e,f){const g=(new Set).add(olympe.dc.fa(e));for(const h of g)yield h,d.il(h,f).forEach(([k,,,l])=>{l&&g.add(k)})}.bind(null,a,b,c)}}function eh(){++bh;return String(bh)}function dh(a){if(a)return olympe.dc.fa(a);throw Error('DBView: Impossible to transform tag to string, provided tag is empty, null or undefined.');}
|
|
654
654
|
function gh(a,b,c,d,e){a=a.j.N(dh(b));c=dh(c);b=Vg+c;e=null!=e?e:eh();if(fh(a,b,e,d)&&a.Ja()){let f=!1;b=a.get(b);void 0===b&&(f=!0,b=a.get(Xg+c));void 0!==b&&d(b,f)}return e}function S(a,b,c=!1){if(b)return a=a.j.get(olympe.dc.fa(b)),!a||c&&!a.Ja()?null:a;throw Error('DBView: Impossible to get instance, provided tag is empty, null or undefined.');}function hh(a,b,c,d){b=S(a,b);null!==b&&(c=olympe.dc.fa(c),ch(b,Vg+c,d),a.j.getState()===ah.uf&&a.j.R(d))}
|
|
655
655
|
function ih(a,b,c,d){a=a.j.N(dh(b));d=null!=d?d:eh();fh(a,$g,d,c)&&a.Ja()&&a.forEach((e,f)=>{const g=f[0];g!==Vg&&g!==Xg||c(f.substring(1),e,g===Xg)});return d}function jh(a,b,c){b=S(a,b);null!==b&&(ch(b,$g,c),a.j.getState()===ah.uf&&a.j.R(c))}function kh(a,b,c,d,e){let f;null==(f=a.get(b))||f.forEach((g,h)=>{if(g.Ja()||!c&&g.F())e?d(b.substring(1),b[0],c,h):d(c,h)})}function T(a,b,c,d,e){a=a.j.N(dh(b));c=c.La()+c.X();e=null!=e?e:eh();(d=lh(a,c,e,d))&&a.Ja()&&kh(a,c,!0,d,!1);return e}
|
|
@@ -684,7 +684,7 @@ function Eg(a,b){const c=a.model();if(null!==c){if(c===b)return;a.unlink(Oh,c)}a
|
|
|
684
684
|
function Gg(a,b){a.unlink(Oh,b);a.forEach((c,d)=>{c=d.substring(1);Sh(a,c,null)});a.db.$(a,!1)}function Hg(a,b){a.unlink(Ph,b);const c=new Map;a.forEach((d,e)=>{e[0]===Kh&&(a.delete(e),d=e.substring(1),c.set(d,null))});Th(a,c)}
|
|
685
685
|
function Pg(a,b,c){const d=Lh+b;var e=a.get(d);e=void 0===e?null:e;if(!Uh(e,c))if(Vh(a,b,e,c,!0),e=Kh+b,null===c){a.delete(d);let f;c=null==(f=a.gf())?void 0:mg(f,b);c=void 0===c?null:c;null!==c&&a.set(e,c);Th(a,(new Map).set(b,c))}else void 0!==a.get(e)&&a.delete(e),a.set(d,c),Th(a,(new Map).set(b,c))}function fh(a,b,c,d){const e=Wh(a,Nh+b);return e.has(c)?!1:(e.set(c,d),a.oe(olympe.dc.db.Instance.j.Hi+b),a.db.D(Ih.Jo,a.j,b,c),!0)}
|
|
686
686
|
function ch(a,b,c){const d=Xh(a,Nh+b,c);void 0!==d&&(a.detach(olympe.dc.db.Instance.j.Hi+b),a.db.D(Ih.Ko,a.j,b,c));return d}function lh(a,b,c,d){const e=(...f)=>{var g=f.length;const h=f[g-2];if(g=a.db.get(f[g-1])){const k=olympe.dc.db.Instance.j.dw+b;h?g.oe(k):g.detach(k)}d(...f)};return fh(a,b,c,e)?e:null}function Uh(a,b){return a instanceof Date?b instanceof Date&&a.getTime()===b.getTime():null!==a&&'function'===typeof a.Fa?a.Fa(b):a===b}
|
|
687
|
-
function Vh(a,b,c,d,e){c instanceof olympe.dc.wc&&(Yh(a.db.get(c.X())),a.db.ta(c.X()));d instanceof olympe.dc.wc&&(c=a.db.N(d.X(),!0),c.D&&c.D.tag!==a.j&&a.db
|
|
687
|
+
function Vh(a,b,c,d,e){c instanceof olympe.dc.wc&&(Yh(a.db.get(c.X())),a.db.ta(c.X()));d instanceof olympe.dc.wc&&(c=a.db.N(d.X(),!0),c.D&&c.D.tag!==a.j&&a.db.Ya().fatal('Instance',d.X(),'referenced multiple times!\nThis instance is currently property of',c.D.tag,'(for the property '+c.D.Ma+')','and is assigned as a property of',a.j,'(for the property '+b+')'),d=c,a=a.j,void 0===d.D&&(d.oe(olympe.dc.db.Instance.j.fj+a+':'+b),d.db.Wa(d.j,a,b)),d.D={tag:a,Ma:b,iz:e})}
|
|
688
688
|
function Zh(a,b,c,d){a.e&&a.db.Pe(a.j,b,c,d)}function Th(a,b,c=[]){const d=a.get(U+Oh);void 0!==d&&d.forEach(e=>{b.forEach((f,g)=>Sh(e,g,f))});a=a.get(U+Ph);void 0!==a&&a.forEach((e,f)=>{if(!c.includes(e.tag())){var g=new Map;b.forEach((h,k)=>{e.has(Lh+k)||(g.set(k,h),null!==h?e.set(Kh+k,h):e.delete(Kh+k))});Th(e,g,[...c,f])}})}function Wh(a,b){let c;return null!=(c=a.get(b))?c:a.create(b)}function $h(a,b,c,d,e){a.db.ff(a.j,b,c,d.j,e)}
|
|
689
689
|
function Xh(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 Sh(a,b,c){if(!a.has(Jh+b)){const d=Mh+b,e=a.get(d);Uh(c,void 0!==e?e:null)||(null===c?a.delete(d):a.set(d,c),Zh(a,b,c,null!==c))}}function Qh(a){a.forEach((b,c)=>{const d=c[0];if(d===U||d===V){const e=c.substring(1),f=d===U?V:U;b.forEach(g=>{g.e&&($h(a,e,d,g,!0),$h(g,e,f,a,!0))})}else if(d===Jh||d===Mh)c=c.substring(1),Zh(a,c,b,d===Mh)})}
|
|
690
690
|
function Rh(a){a.forEach((b,c)=>{const d=c[0];if(d!==Nh){var e=c.substring(1);d===U?b.forEach(f=>{f.unlink(e,a)}):d===V?b.forEach(f=>{a.unlink(e,f)}):d===Jh?a.update(e,null):d===Lh&&Pg(a,e,null);a.delete(c)}});if(void 0!==a.D){const b=a.db.get(a.D.tag),c=a.D.iz;let d,e;(null==(d=b.get(`${c?Lh:Jh}${a.D.Ma}`))?void 0:null==(e=d.X)?void 0:e.call(d))===a.j&&(c?Pg(b,a.D.Ma,null):b.update(a.D.Ma,null))}}
|
|
@@ -710,7 +710,7 @@ olympe.W.config(function(a){E(a,olympe.dc.db.U.Cp,olympe.dc.db.Af.j.io);E(a,olym
|
|
|
710
710
|
(b,c,d,e,f,g,h)=>{e=g?olympe.dc.db.Af.j.am: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.P.Xl,olympe.dc.kb,olympe.dc.db.P.Da,olympe.dc.db.P.bk);D(a,olympe.dc.db.P.Yi,[olympe.dc.db.P.Ea],b=>b.wz);D(a,olympe.dc.db.P.Ea,[olympe.dc.db.P.Da,olympe.dc.db.P.bk,olympe.dc.db.P.Xl,new olympe.W.pa(olympe.dc.U.bg),new olympe.W.pa(olympe.dc.db.U.Pl),new olympe.W.pa(olympe.dc.db.U.Yi),new olympe.W.pa(olympe.dc.db.U.Bv),
|
|
711
711
|
new olympe.W.pa(olympe.dc.db.U.Av)],(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.gu(b,c,d,e,g)})},'olympe.dc.db');olympe.W.run([olympe.dc.db.P.bk,olympe.dc.db.P.Yi],(a,b)=>{olympe.ee().db=a;olympe.ee().dbMonitor=b},'DC.DB debug service injection');olympe.dc.query={};function ei(a){return(b,c)=>{const d=null===b,e=null===c;return d||e?d&&e?0:d?1:-1:a(b,c)}}
|
|
712
712
|
olympe.dc.query.xf=class{constructor(a,b,c){this.db=olympe.dc.ha();this.j=a;this.Ma=b;this.Wi=c}ga(){return{p:this.Ma.X(),o:this.Wi}}toString(){return'sortByQueryPart-'+this.Wi+this.Ma.X()}kh(){const a=this.db.Jb(this.Ma,olympe.dm.Property.typeRel),b=olympe.dc.fa;if(this.db.Uf(a,olympe.dm.String))return ei((c,d)=>c.localeCompare(d));if(a===b(olympe.dm.Number)||a===b(olympe.dm.Boolean))return ei((c,d)=>c-d);if(a===b(olympe.dm.DateTime))return ei((c,d)=>c.getTime()-d.getTime());if(a===b(olympe.dm.Color))return ei((c,
|
|
713
|
-
d)=>c.compare(d));olympe.ia
|
|
713
|
+
d)=>c.compare(d));olympe.ia.Ya('dc.query').warn(`No comparator found for type with tag ${a}`);return ei(()=>-1)}Ra(){return this.Ma}};olympe.dc.Ze=class{X(){}};olympe.dc.Ze.prototype.getTag=olympe.dc.Ze.prototype.X;olympe.dc.PB=olympe.dc.Ze;function fi(a){let b;if(null==(b=a.j)?0:b.pf())if(a=a.H,!a.N){let c;null==(c=a.R)||c.call(a)}}function gi(a,b,c,d,e){fi(a);let f,g;b?null==(f=a.j)||f.Pa(c,d,e):null==(g=a.j)||g.ic(c,d,e)}
|
|
714
714
|
olympe.dc.query.Iv=class{constructor(a,b,c,d){this.G=a;this.source=b;this.D=c;this.H=d;this.j=this.F=null;this.db=olympe.dc.ha()}watch(a,b){if(this.db.source(a)===this.source){var c=`${this.D}:${a}:notif`;Of(this.db,a,(d,e)=>{if(d){fi(this);let f;null==(f=this.j)||f.$(e)}else if(b&&jh(this.db,e,c),!this.db.Ja(e)){fi(this);let f;null==(f=this.j)||f.D(e,olympe.dc.Mb.NONE)}},c);b&&ih(this.db,a,(d,e,f)=>{fi(this);let g;f||null!=(g=this.j)&&g.Yc(a,new Map([[d,e]]))},c)}}stop(a){Mf(this.db,a,`${this.D}:${a}:notif`)}};olympe.dc.query.Bk={ASC:'ASC',DESC:'DESC'};function hi(a){const b=ii(a.query),c=new Map;for(let e=b.length;0<=e;e--){const f=0<e?b[e-1].T():a.F,g=0<e?b[e-1].j:'root',h=0<e&&b[e-1].R(),k=a.j.get(f),l=new Set(k.Uc()),n=new Map,p=a.H.has(f);let q=p?';':'';if(c.has(f)){const [r,t,v]=c.get(f);c.delete(f);q+=v;r.forEach((x,y)=>{for(const z of k.j(y)){let A;n.set(z,Array.from(x).map(K=>p?`${y};${K}`:K).reduce((K,Y)=>K.add(Y),null!=(A=n.get(z))?A:new Set))}l.delete(y)});t&&l.forEach(x=>{const y=p?`${x};${v}`:v;for(const z of k.j(x)){let A;n.set(z,
|
|
715
715
|
(null!=(A=n.get(z))?A:new Set).add(y))}})}else l.forEach(r=>{const t=p?`${r};`:'';for(const v of k.j(r))n.has(v)?n.get(v).add(t):n.set(v,(new Set).add(t))});if(0<e&&c.has(g)){const [r,t,v]=c.get(g),x=new Map;n.forEach((y,z)=>{let A;null==(A=r.get(z))||A.forEach(K=>{let Y;const ya=null!=(Y=x.get(z))?Y:new Set;y.forEach(db=>ya.add(db+K));x.set(z,ya)});n.delete(z);r.delete(z)});t&&n.forEach((y,z)=>{x.set(z,new Set(Array.from(y).map(A=>A+v)))});b[e-1].R()&&r.forEach((y,z)=>{x.set(z,new Set(Array.from(y).map(A=>
|
|
716
716
|
q+A)))});c.set(g,[x,t&&h,q+v])}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 ji(a){if(null===a.D){const b={Hb:a.query.kh(),Md:a.Md,max:a.query.j.max,offset:a.query.j.offset};a.D=olympe.dc.Ka.from(a.Y,hi(a),b)}return a.D}function ki(a,b){a.R=b}function li(a){if(!a.N){null!==a.D&&(a.Y=a.D);a.D=null;a.N=!0;let b;null==(b=a.R)||b.call(a)}}
|
|
@@ -752,7 +752,7 @@ function Li(a,b,c){const d=[];for(const e of a.j.values())Mi(e,b,c)&&d.push(Ei(a
|
|
|
752
752
|
olympe.dc.query.$v=class{constructor(a,b,c,d,e){this.G=a;this.D=b;this.N=c;this.Kb=d;this.H=e;this.j=new Map;this.F=new Set;Sg(b,()=>Gi(this));Vf(d,olympe.dc.Request.j.ck,f=>{Ii(this,f.content,olympe.dc.ma.oc.wf).catch(g=>this.G.error(`Error while applying data notification on DB: ${g}`))})}executeQuery(a,b,c){const d=this;return u(function*(){const e='boolean'===typeof c.Bc?c.Bc:yield Ki(d,a);if(!e||(null==c?0:c.ji))try{const f=yield Ei(d,a,b,c);e||(yield Ii(d,f,b))}catch(f){return d.G.error(`Error while sending a query to data source ${a.jb()}: ${f}`),
|
|
753
753
|
null}return Ai(d,a)})}R(a,b,c,d,e,f){const g=c.jb();if(g===olympe.dc.Ia.SELF||b.Bc||this.H&&g===olympe.dc.Ia.SERVER)return e(),null;if(a!==olympe.dc.ma.oc.wf)return Ei(this,c,a,b).then(r=>{var t=r;r instanceof ReadableStream&&(t=(t=d())?r.pipeThrough(t):r);return Ii(this,t,a,b.rj)}).then(e).catch(f),null;let h,k=!1;const l=r=>{h=[];r&&this.G.debug(`Resend subscription ${c.T()} after detection of dead subscription in the remote service`);Ei(this,c,a,b).then(t=>{if(k)return this.G.warn(`Received data result after query subscription ${c.T()} has been destroyed. Could happen with queries observed multiple times successively quickly.`),
|
|
754
754
|
Promise.resolve();var v=t;t instanceof ReadableStream&&(v=(v=d())?t.pipeThrough(v):t);return Ii(this,v,a,b.rj).then(()=>{h.forEach(x=>Ii(this,x,a))}).finally(()=>{h=null})}).then(e).catch(f)},n=c.T();l(!1);const p=Sf(new olympe.dc.Request(olympe.dc.Request.j.Gk,g,c),olympe.dc.ma.j.Ml,null==b?void 0:b.ji),q=this.Kb.subscribe(p,l.bind(this,!0)).pipe(tb(olympe.error.Np,()=>{},0)).pipe(tb(olympe.error.Go,(r,t)=>{this.G.debug(`Data Provider: Subscribe to topic ${r.T()} now that we are back online, after waiting for ${t}ms`);
|
|
755
|
-
l(!0)},0)).subscribe(rxjs.Subscriber.create(r=>{Array.isArray(h)?h.push(r):Ii(this,r,a)},r=>{this.G.error(`An error occurred with the subscription ${n}: ${r}`);f(String(r))}));return()=>{k=!0;this.G.debug(`Unsubscribe to query ${n} from data source ${g}`);q.unsubscribe()}}};function Ni(a){const b=olympe.dc.ha();let c=!1;const d=a.k.map(e=>{const f=e.split('.').map(g=>b.Ja(g)?olympe.dc.CloudObject.get(g):(olympe.ia
|
|
755
|
+
l(!0)},0)).subscribe(rxjs.Subscriber.create(r=>{Array.isArray(h)?h.push(r):Ii(this,r,a)},r=>{this.G.error(`An error occurred with the subscription ${n}: ${r}`);f(String(r))}));return()=>{k=!0;this.G.debug(`Unsubscribe to query ${n} from data source ${g}`);q.unsubscribe()}}};function Ni(a){const b=olympe.dc.ha();let c=!1;const d=a.k.map(e=>{const f=e.split('.').map(g=>b.Ja(g)?olympe.dc.CloudObject.get(g):(olympe.ia.Ya('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.Ka.create(d,a.a,a.r)}
|
|
756
756
|
olympe.dc.Ka=class{constructor(){this.j=[];this.D=new Map;this.F=[];this.H=[];this.hash=''}static empty(){return new olympe.dc.Ka}[Symbol.iterator](){let a=0;return{next:()=>{var b={done:!0};a<this.j.length&&(b=this.j[a],b={value:[b,this.D.get(b)],done:!1},a++);return b}}}entries(){return this.j.map(a=>[a,this.D.get(a)])}values(){return this.D.values()}keys(){return this.j.values()}Ue(){return this.j.map(a=>this.D.get(a))}size(){return this.j.length}has(a){return this.D.has(a)||this.Ue().includes(a)}indexOf(a){return null===
|
|
757
757
|
a||void 0===a?-1:'string'===typeof a?this.j.indexOf(a):this.Ue().indexOf(a)}get(a){return(a=this.D.get(a))?a:null}Ic(){return this.qe(0)}qe(a){return a<this.j.length?this.D.get(this.j[a]):null}push(...a){const b=this.Ue();b.push(...a);return b}pop(){if(0===this.j.length)return[];const a=this.Ue();a.pop();return a}shift(){if(0<this.j.length){const a=this.Ue();a.shift();return a}return[]}filter(a){return this.Ue().filter(a)}find(a){return(a=this.Ue().find(a))?a:null}forEach(a){this.j.forEach((b,c)=>
|
|
758
758
|
a(this.D.get(b),c))}map(a){return this.Ue().map(a)}sort(a){const b=this.entries().sort((c,d)=>a(c[1],d[1]));return olympe.dc.Ka.create(b,Array.from(this.F),Array.from(this.H))}reduce(a,b){return this.Ue().reduce(a,b)}concat(...a){const b=[this.entries(),...a.map(d=>d.entries())].flat();let c=Array.from(this.F);for(const d of a)c=c.concat(d.F.map(e=>e+c.length));a=this.H.concat(...a.map(d=>d.H));return olympe.dc.Ka.create(b,c,a)}toString(){return`QueryResult: ${JSON.stringify(this)}`}toJSON(){return this.Ue()}yj(){return this.F.map(a=>
|
|
@@ -760,7 +760,7 @@ this.D.get(this.j[a]))}Ej(){return this.H.map(a=>{a=a.split('.');return 1===a.le
|
|
|
760
760
|
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?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.Ka.create(e,l,n,c)}static create(a,b,c,d){const e=new olympe.dc.Ka;e.j=a.map(f=>f[0]);e.D=new Map(a);e.hash=d||olympe.V.ub(e.j.join(''));e.F=b||e.j.map((f,g)=>g);e.H=c||[];return e}ga(a){a&&this.j.flatMap(b=>b.split('.')).forEach(a);
|
|
761
761
|
return{k:this.j,a:this.F,r:this.H}}};olympe.dc.Ka.prototype.getRemoved=olympe.dc.Ka.prototype.Ej;olympe.dc.Ka.prototype.getAdded=olympe.dc.Ka.prototype.yj;olympe.dc.Ka.prototype.concat=olympe.dc.Ka.prototype.concat;olympe.dc.Ka.prototype.reduce=olympe.dc.Ka.prototype.reduce;olympe.dc.Ka.prototype.sort=olympe.dc.Ka.prototype.sort;olympe.dc.Ka.prototype.map=olympe.dc.Ka.prototype.map;olympe.dc.Ka.prototype.forEach=olympe.dc.Ka.prototype.forEach;olympe.dc.Ka.prototype.find=olympe.dc.Ka.prototype.find;
|
|
762
762
|
olympe.dc.Ka.prototype.filter=olympe.dc.Ka.prototype.filter;olympe.dc.Ka.prototype.shift=olympe.dc.Ka.prototype.shift;olympe.dc.Ka.prototype.pop=olympe.dc.Ka.prototype.pop;olympe.dc.Ka.prototype.push=olympe.dc.Ka.prototype.push;olympe.dc.Ka.prototype.getAt=olympe.dc.Ka.prototype.qe;olympe.dc.Ka.prototype.getFirst=olympe.dc.Ka.prototype.Ic;olympe.dc.Ka.prototype.get=olympe.dc.Ka.prototype.get;olympe.dc.Ka.prototype.indexOf=olympe.dc.Ka.prototype.indexOf;olympe.dc.Ka.prototype.has=olympe.dc.Ka.prototype.has;
|
|
763
|
-
olympe.dc.Ka.prototype.size=olympe.dc.Ka.prototype.size;olympe.dc.Ka.prototype.toArray=olympe.dc.Ka.prototype.Ue;olympe.dc.Ka.prototype.keys=olympe.dc.Ka.prototype.keys;olympe.dc.Ka.prototype.values=olympe.dc.Ka.prototype.values;olympe.dc.Ka.prototype.entries=olympe.dc.Ka.prototype.entries;olympe.dc.Ka.empty=olympe.dc.Ka.empty;function Oi(a){return 1<a.size()?(olympe.ia
|
|
763
|
+
olympe.dc.Ka.prototype.size=olympe.dc.Ka.prototype.size;olympe.dc.Ka.prototype.toArray=olympe.dc.Ka.prototype.Ue;olympe.dc.Ka.prototype.keys=olympe.dc.Ka.prototype.keys;olympe.dc.Ka.prototype.values=olympe.dc.Ka.prototype.values;olympe.dc.Ka.prototype.entries=olympe.dc.Ka.prototype.entries;olympe.dc.Ka.empty=olympe.dc.Ka.empty;function Oi(a){return 1<a.size()?(olympe.ia.Ya('dc').warn(`a follow() on a QuerySingle has ${a.size()} results (0 or 1 expected) -> returns null`),null):a.Ic()||null}olympe.dc.sd=class{constructor(a){this.query=a}static from(a){return new olympe.dc.sd(olympe.dc.ma.from(a))}fb(a){return new olympe.dc.sd(this.query.fb(a))}sj(){return this}ob(a){return this.query.ob(a).then(b=>Oi(b))}Hc(){return Oi(this.query.Hc())}};olympe.dc.sd.prototype.executeFromCache=olympe.dc.sd.prototype.Hc;
|
|
764
764
|
olympe.dc.sd.prototype.execute=olympe.dc.sd.prototype.ob;olympe.dc.sd.prototype.cast=olympe.dc.sd.prototype.sj;olympe.dc.sd.prototype.follow=olympe.dc.sd.prototype.fb;const Pi=olympe.dc.va.ORIGIN,Qi=olympe.dc.va.DESTINATION;function Di(a,b){ki(a.j,()=>{a.gb()||null!==a.D||b(a.query.T())})}function Fi(a,b,c){const d=a.ea;a.ea++;a.H.set(d,c);b===olympe.dc.Ia.SELF?a.kd(e=>e?c.error(e):c.next(a.j)):(a.$++,1===a.$&&a.kd(()=>qi(a.j)));a.G.debug(`Add subscriber ${b} for query ${a.query.T()}, now have ${a.H.size} subscribers`);return d}
|
|
765
765
|
function Mi(a,b,c){if(a.query.jb()!==b)return!1;c.rc(a.ja);(b=a.ja.flush())&&a.G.debug(`Subscription ${a.query.T()} is considered as obsolete after the transaction ${c.T()} applied on DB`);return b}function Hi(a){si(a.j);a.H.forEach(b=>{b.next(a.j)})}
|
|
766
766
|
function Ri(a,b,c){const d=[];let e=!1;const f=new olympe.async.Dk(olympe.C.lh());for(const g of b)if(g.Qc(a.query)&&(e||(e=!0),f.add(h=>g.kd(k=>{!k&&d.push(g);h()}))),null!==g.D&&zi(a.query,g.query)){let h;null==(h=a.R)||h.push(g)}ud(f,g=>c(g?d:[]));f.start();return e}
|
|
@@ -792,7 +792,7 @@ bj(d,c)))return!1;return!0}filter(a){const b=this.N(),c=b.D;null===c?b.D=a:b.D=c
|
|
|
792
792
|
f,g)}))}Fa(){}};olympe.dc.query.oa.Xh=class extends olympe.dc.query.oa.Om{constructor(a,b,c){super(a,c);this.relation=b;this.ta=null}};olympe.dc.query.oa.Pm=class{has(){}H(){}j(){}Uc(){}D(){}remove(){}};olympe.dc.query.oa.Pd=class extends olympe.dc.query.oa.Om{constructor(a,b,c){super(a,!1);this.Pb=b;this.F=null!=c?c:null}N(){return new olympe.dc.query.oa.Pd(this.j,this.Pb,this.F)}Y(){return olympe.V.ub(this.j+'followRules')}ja(){return new olympe.dc.query.oa.gq(this.db,this.F)}$(a,b){return b instanceof olympe.dc.query.oa.Pd?[a]:[olympe.V.ub(a+'followRules')]}Qc(a){if(a instanceof olympe.dc.query.oa.Xh){const b=olympe.dc.va.ORIGIN,c=olympe.dc.va.DESTINATION,d=olympe.dc.hc.$c,e=olympe.dc.hc.Li,f=
|
|
793
793
|
olympe.dm.Relation.j.vr,g=olympe.dm.Relation.j.bs;a=a.relation;const h=a.La(),k=a.X();return h!==c||k!==d&&k!==e?!!(ph(this.db,a,this.Pb)&(a.La()===b?f:g)):!0}return a instanceof olympe.dc.query.oa.Pd?this.Pb===a.Pb:!1}ob(a){const b=this.T();for(const c of mi(a,this.j))for(const d of lg(this.db,c,this.Pb))oi(a,d,b,c)}observe(a,b){const c=this.T(),d=(e,f,g,h)=>{const k=`${h}:${g}`;f?qh(this.db,g,this.Pb,(l,n,p,q,r)=>{p&&(p=q?oi(a,r,c,g):a.remove(r,c,g),null!==n&&pi(a,q,l,n,g,r),p&&d(e,q,r,h))},k):
|
|
794
794
|
rh(this.db,g,this.Pb,k);b(f,g,e,k)};return(e,f,g,h)=>{(e?oi(a,f,c,f):a.remove(f,c,f))&&d(f,e,f,olympe.V.ub(h+f+this.toString()))}}ga(){return Object.assign(super.ga(),{f:this.Pb})}H(){return`followRulePart-${this.Pb}-${super.H()}`}Xc(){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.Pb)} (${this.Pb})`}Fa(a){return a instanceof olympe.dc.query.oa.Pd&&this.Pb===a.Pb}toJSON(){return{type:'follow rule',
|
|
795
|
-
rule:`${this.db.name(this.Pb)} (${this.Pb})`}}R(){return!1}filter(){olympe.ia
|
|
795
|
+
rule:`${this.db.name(this.Pb)} (${this.Pb})`}}R(){return!1}filter(){olympe.ia.Ya('dc.query').warn('Should never try to filter on queries with follow rules, ignore...');return this}sort(){olympe.ia.Ya('dc.query').warn('Should never try to sort queries with follow rules, ignore...');return this}};olympe.dc.query.oa.Pd.D='followRules';olympe.dc.query.oa.Ih=class extends olympe.dc.query.oa.Xh{constructor(a,b,c){super(a,olympe.dc.query.Relation.from(b,!1),c)}N(){const a=new olympe.dc.query.oa.Ih(this.j,this.relation,this.optional);a.D=this.D;a.Hb=this.Hb;return a}Y(){return olympe.V.ub(this.j+this.relation.T())}$(a,b){if(b instanceof olympe.dc.query.oa.Pd)return[a];const c=[a+this.relation.T(),a+Zi(this.relation).T()+!1,a+Zi(this.relation).T()+!0,a+'followRules'].map(d=>olympe.V.ub(d));b instanceof olympe.dc.query.oa.Ce&&b.relation.Fa(this.relation)&&
|
|
796
796
|
c.push(a);return c}ob(a){const b=this.T();for(const c of mi(a,this.j))this.db.cb(c,this.relation).forEach(d=>{oi(a,d,b,c)});super.ob(a)}observe(a,b){const c=super.observe(a,b),d=this.relation.X(),e=this.relation.La(),f=this.toString();return(g,h,k,l)=>{const n=olympe.V.ub(l+h+f);g?T(this.db,h,this.relation,(p,q)=>{pi(a,p,d,e,h,q);c(p,q,h,n)},n):this.db.D(h,this.relation,n)}}ga(){return Object.assign(super.ga(),{t:this.relation.X(),d:this.relation.La()})}H(){return`followPart-${this.relation.T()}-${super.H()}`}Xc(){const a=
|
|
797
797
|
{recursive:!1,relation:this.relation,filter:aj(this).map(b=>b.map(c=>c.Xc())),optional:this.R()};this.Hb&&(a.sort={property:this.Hb.Ra(),order:this.Hb.Wi});return a}toString(){return`Follow Part: ${this.relation}`}toJSON(){return{type:'follow',relation:`${this.db.name(this.relation)} (${this.relation.X()})`,direction:this.relation.La()}}Fa(a){return a instanceof olympe.dc.query.oa.Ih&&this.relation.Fa(a.relation)}};olympe.dc.query.oa.Ce=class extends olympe.dc.query.oa.Xh{constructor(a,b,c,d){super(a,olympe.dc.query.Relation.from(b,!0),d);this.F=c}ja(){return new olympe.dc.query.oa.zr}N(){const a=new olympe.dc.query.oa.Ce(this.j,this.relation,this.F,this.optional);a.D=this.D;a.Hb=this.Hb;return a}Y(){return olympe.V.ub(this.j+this.relation.T()+this.F)}$(a,b){if(b instanceof olympe.dc.query.oa.Pd)return[a];const c=[a+this.relation.T()+this.F,a+'followRules'].map(d=>olympe.V.ub(d));b instanceof olympe.dc.query.oa.Ce&&
|
|
798
798
|
b.relation.Fa(this.relation)&&c.push(a);return c}ob(a){const b=this.T();for(const c of mi(a,this.j))this.F&&oi(a,c,b,c),this.db.oh(c,this.relation).forEach(d=>{oi(a,d,b,c)});super.ob(a)}observe(a,b){const c=this.relation.X(),d=this.relation.La(),e=(f,g,h,k)=>{const l=olympe.V.ub(k+g);f?T(this.db,g,this.relation,(n,p)=>{pi(a,n,c,d,g,p);super.observe(a,(q,r,t,v)=>{b(q,r,t,v);e(q,r,t,k)})(n,p,h,l)},l):this.db.D(g,this.relation,l)};return(f,g,h,k)=>{h=k+this.toString();this.F&&super.observe(a,b)(f,g,
|
|
@@ -866,7 +866,7 @@ case Ek:return this.j.uploadFileContent(a);default:return Promise.reject(`Server
|
|
|
866
866
|
{this.G.warn(`Fail to unsubscribe to graphdef ${d}: ${e}`)}).finally(()=>{this.N.has(d)&&this.H.delete(d);this.N.delete(d)})}))}return rxjs.throwError(()=>Error(`Subscription of type ${a.getType()} is not supported`))}init(a){super.init(a);xe(this.F,olympe.L.Ee.Hg,this.ja.bind(this));return this}destroy(){return u(function*(){})}ja(a,b){const c=olympe.dc.Request.j.xo,d=olympe.dc.Request.j.Bm,e=a.c;if(e===olympe.dc.Request.j.ck)$k(this,a,b).then(f=>{Rk(this,e,f)});else if(e===c)b=this.R.j(a.p,a.i),
|
|
867
867
|
b=Nf(b,a.ct),Rk(this,e,{rollback:b,error:a.error});else if(e===Bk){const f=a.i;$k(this,a,b).then(g=>{let h;null==(h=this.H.get(f))||h.next(g)})}else e===d&&Rk(this,Fk,{id:a.i,finalize:olympe.dc.transaction.Jf.j.Bm,error:0<a.s?a.error:null})}ea(a,b){if(b instanceof olympe.dc.query.oa.Xh){const c=b.relation;let d;b=null!=(d=a.get(b.T()))?d:[];return{t:c.X(),d:c.La()===olympe.dc.va.ORIGIN?1:2,v:!0,r:c.recursive,q:b.map(this.ea.bind(this,a))}}return{}}};olympe.dc.sources.Qr.za=[olympe.dc.sources.fk];function al(a,b,c){const d=new olympe.C.Wb(`Source solver ${b.X()}`);b.fb(olympe.dm.Bd.F.$b()).fb(olympe.dm.Bd.D).ne().back().fb(olympe.dm.Bd.j).ne().observe(d,{md:c,Bc:!0}).subscribe(e=>{e.yj().forEach(([f,g])=>{a.D.set(f.X(),g.T())});e.Ej().forEach(([f])=>{a.D.delete(f)})});b.fb(olympe.dm.ib.D).observe(d,{md:c,Bc:!0}).subscribe(e=>{let f,g;a.F=null!=(g=null==(f=e.Ic())?void 0:f.T())?g:null});d.onDestroy(()=>{a.D.clear();a.F=null})}
|
|
868
868
|
olympe.dc.sources.Sk=class{constructor(a,b,c){this.db=a;this.j=b;this.N=c;this.D=new Map;this.F=null;this.H=!1}fromModel(a){a=olympe.dc.fa(a);return this.D.has(a)?this.D.get(a):this.F&&this.R(a)?this.F:this.N}Qe(a){let b;return null!=(b=this.db.source(a))?b:this.N}jb(a){return a===this.j?olympe.dc.CloudObject.get(this.j):a===olympe.dc.Ia.SERVER?olympe.dc.CloudObject.get(olympe.dm.DataSource.SERVER):this.db.Ja(a)&&this.db.Ob(a,olympe.dm.DataSource)?olympe.dc.CloudObject.get(a):null}R(){return!1}init(){if(!this.H){this.H=
|
|
869
|
-
!0;var a=new olympe.dc.
|
|
869
|
+
!0;var a=new olympe.dc.Za;X(a.create(olympe.dm.DataSource,this.j).zi(this.j),olympe.dm.DataSource.hi,!0);a.Pa(olympe.dm.DataSource.Lj,this.j,this.j);a.ob(()=>{olympe.dc.ma.from(this.j).observe(olympe.C.lh()).subscribe(()=>{})})}}};olympe.dc.sources.P={Da:'dc.sources.Logger',mm:'dc.sources.HTTPService',Gu:'dc.sources.IOService',rr:'dc.sources.RemoteProvider',Jr:'dc.sources.ServerProvider',oC:'dc.sources.OfflineProvider',bf:'dc.sources.SourceSolver',Le:'dc.sources.Serializer',Yo:'dc.sources.cache.Cache',Zo:'dc.sources.cache.DATABASE',Nl:'dc.sources.cache.Logger'};
|
|
870
870
|
olympe.dc.sources.U={Jh:'data.httpHost',Bf:'data.httpPort',Qi:'data.httpSSL',jm:'data.httpBasePath',Mm:'data.pollingFrequency',We:'data.communicationMode',Tm:'data.restrictedUse',VERSION:'version.version',Nr:'data.streamWorker',Tq:'data.queryConcurrencyLimit'};olympe.dc.sources.Lh={Sv:'olympe.internal.data.',Jh:'olympe.internal.data.httpHost',Bf:'olympe.internal.data.httpPort',Qi:'olympe.internal.data.httpSSL'};
|
|
871
871
|
olympe.W.config(function(a){const b=['localhost','127.0.0.1'],c=a.getParameter(olympe.net.U.xm),d=`-${olympe.host.Xg.Uh}`;E(a,olympe.dc.sources.U.Jh,null);E(a,olympe.dc.sources.U.Bf,null);E(a,olympe.dc.sources.U.Qi,null);E(a,olympe.dc.sources.U.jm,'runtime/data');E(a,olympe.dc.sources.U.Nr,!1);E(a,olympe.dc.sources.U.Tq,10);Za(a,olympe.dc.sources.Lh.Jh,[olympe.host.U.Jk,olympe.L.U.Yl,olympe.dc.sources.U.Jh],(e,f,g)=>{if(g)return g;e=e===olympe.host.Xg.Uh;return f.endsWith(c)&&e?f+d:f});Za(a,olympe.dc.sources.Lh.Bf,
|
|
872
872
|
[olympe.dc.sources.Lh.Jh,olympe.dc.sources.U.Bf],(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});Za(a,olympe.dc.sources.Lh.Qi,[olympe.dc.sources.Lh.Bf,olympe.dc.sources.U.Qi],(e,f)=>null!==f?f:443===e);E(a,olympe.dc.sources.U.Mm,null);E(a,olympe.dc.sources.U.We,null);E(a,olympe.dc.sources.U.Tm,null);D(a,olympe.dc.sources.P.Da,[olympe.ia.P.Ea],e=>e.cd('data'));C(a,olympe.dc.sources.P.Le,olympe.dc.sources.ec,olympe.dc.db.P.Ea);Xa(a,olympe.L.P.Le,
|
|
@@ -918,32 +918,32 @@ this.F||e.includes(this.F)||e.push(this.F);let g;b=new olympe.dc.sources.cache.Q
|
|
|
918
918
|
'unknown',{},[],[]);var f;d=null!=(f=this.j.get(c))?f:new olympe.dc.sources.cache.Qg(c,'unknown',{},[],[]);b=`${a}${olympe.dc.va.ORIGIN}${b}`;f=(g,h)=>{this.j.set(g.tag,g);const k=Ll(this,g.tag);k.has(h)||(g.pb.push(h),k.add(h));null===this.F||g.j.includes(this.F)||g.j.push(this.F)};f(e,`${a}${olympe.dc.va.DESTINATION}${c}`);f(d,b)}ic(a,b,c){const d=this.j.get(b),e=this.j.get(c);c=`${a}${olympe.dc.va.DESTINATION}${c}`;a=`${a}${olympe.dc.va.ORIGIN}${b}`;b=(f,g)=>{const h=Ll(this,f.tag);if(h.has(g)){const k=
|
|
919
919
|
f.pb.indexOf(g);f.pb.splice(k,1);h.delete(g)}};d&&b(d,c);e&&b(e,a)}};olympe.dc.sources.cache.zu.za=[olympe.dc.Writable];olympe.dc.transaction={};olympe.dc.Gi=class a{constructor(b,c){this.id=null!=b?b:olympe.V.Kc();this.D=new olympe.C.Wb('BurstTransaction#'+this.id,c);this.Eb=Ml(this);this.R=!1;this.D.onDestroy(()=>this.N());this.Y=new Set;this.F=new Map;this.H=new Set;this.j=null;let d;this.Wa=null!=(d=olympe.W.getParameter(olympe.dc.transaction.U.wo))?d:30;this.ja=[]}static j(b,c){return`${b},${c}`}Yb(b){for(const c of this.ja)c(b);this.stop()}Ha(){null!==this.j&&(clearTimeout(this.j),this.j=null);const b=this.ea(this.H);0<b.size&&Nl(this,
|
|
920
920
|
b,!1);this.H.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.F.get(d))});return c}$(b,c,d){this.ta(b,c,d);this.Eb(b,c,d);null===this.j&&(this.j=setTimeout(this.Ha.bind(this),this.Wa))}ta(b,c,d){b=a.j(b,c);this.F.set(b,d);this.H.add(b)}mb(b,c){return this.F.get(a.j(b,c))}push(b,c){const d=olympe.dc.fa(b);b=c.subscribe(e=>{for(const [f,g]of e)e=olympe.dc.fa(f),this.mb(d,e)!==g&&this.$(d,e,g.valueOf())});this.Y.add(b)}complete(){return new Promise((b,
|
|
921
|
-
c)=>{this.N((d,e)=>{for(const f of this.Y)f.unsubscribe();d?b():c(e)})})}update(b,c,d){const e=olympe.dc.fa(b),f=olympe.dc.fa(c);void 0===e||void 0===f?olympe.ia
|
|
921
|
+
c)=>{this.N((d,e)=>{for(const f of this.Y)f.unsubscribe();d?b():c(e)})})}update(b,c,d){const e=olympe.dc.fa(b),f=olympe.dc.fa(c);void 0===e||void 0===f?olympe.ia.Ya('dc').error('Burst transaction: instance tag or property tag is undefined'):(this.D.run(()=>{olympe.C.Sn([d],g=>{this.R=!0;if(g instanceof olympe.dc.wc)olympe.ia.Ya('dc').error('Cannot send complex property values in burst transactions');else{var h;this.$(e,f,null!=(h=null==g?void 0:g.valueOf())?h:null)}})}),this.D.Yd(()=>{this.N()}))}stop(){this.D.destroy();
|
|
922
922
|
this.ja.length=0}getContext(){return this.D}T(){return this.id}uh(){return!1}N(b){if(this.R){this.R=!1;null!==this.j&&(clearTimeout(this.j),this.j=null);this.H.clear();const c=this.ea(new Set(this.F.keys()));Nl(this,c,!0,b)}else null==b||b(!0)}toString(){return'Burst transaction #'+this.id}};olympe.dc.Gi.prototype.complete=olympe.dc.Gi.prototype.complete;olympe.dc.Gi.prototype.push=olympe.dc.Gi.prototype.push;olympe.dc.Nc=class{j(){}toString(){}};olympe.dc.Nc.j=1;olympe.dc.Nc.D=2;olympe.dc.Nc.H=3;olympe.dc.Nc.F=4;olympe.dc.Nc.N=5;olympe.dc.transaction.dj=class a{constructor(b){this.F=null!=b?b:olympe.dc.Ia.SERVER}static j(b){const c=new Map;for(const [d,e]of Object.entries(b)){b=d;let f=typeof e;20<b.length&&b.startsWith('fd')&&(b=olympe.dc.ie.Ye+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':case 'boolean':case 'number':c.set(b,e);break;case '4':c.set(b,new Date(Date.UTC(e.y,e.M-1,e.d,e.h,e.m,
|
|
923
923
|
e.s,e.S)));break;case '5':c.set(b,new Date(Date.UTC(e.y,e.M-1,e.d)));break;case '6':c.set(b,new Date(Date.UTC(e.y||1970,e.M&&e.M-1||0,e.d||1,e.h,e.m,e.s,e.S)));break;case '7':c.set(b,new olympe.C.Color(e.r,e.g,e.b,e.a));break;case '8':c.set(b,new olympe.dc.wc(e.t));break;case 'untyped':null===e&&c.set(b,null)}}return c}j(b,c){return this.D(b,new olympe.dc.db.fc(c))}D(b,c){for(const d of b)switch(d.o){case olympe.dc.Nc.j:b=a.j(d.p||{});let e;c.Rc(d.t,null!=(e=d.s)?e:this.F,b,d.m);break;case olympe.dc.Nc.D:c.Yc(d.t,
|
|
924
924
|
a.j(d.p),d.m);break;case olympe.dc.Nc.H:c.D(d.t,d.f,d.m);break;case olympe.dc.Nc.F:c.Pa(d.m,d.l,d.r,d.lm,d.rm);break;case olympe.dc.Nc.N:c.ic(d.m,d.l,d.r,d.lm,d.rm);break;default:throw Error('Undefined patch operation: '+d.o);}return c}};function Ol(a,b){let c;return null!=(c=a.sources.get(b))?c:a.H.Qe(b)}function Pl(a,b){let c,d,e;return null!=(e=null!=(d=null==(c=a.j.Tc(b))?void 0:c.Vb())?d:a.db.model(b))?e:null}function Z(a,b){let c;return null!=(c=a.F.get(b))?c:a.db.Re(b)||!a.db.Ja(b)}function Ql(a,b){0===a.F.size?a.F=b:b.forEach((c,d)=>a.F.set(d,c))}function Rl(a){return Array.from(a.j.Uc()).filter(b=>!b.zd()).map(b=>b.tag())}function Sl(a){return Array.from(a.j.Uc()).filter(b=>b.zd()).map(b=>b.tag())}
|
|
925
925
|
function Tl(a,b,c,d){d(a.j);c&&b!==olympe.dc.Ia.SELF&&(c=a.D.get(b),c||(c=new olympe.dc.db.fc(a.id),a.D.set(b,c)),d(c))}function Ul(a,b,c){const d=Ol(a,b),e=Z(a,b),f=Pl(a,b);Tl(a,d,e,g=>{g.D(b,c,f)})}
|
|
926
926
|
olympe.dc.transaction.Wv=class{constructor(a,b,c){this.id=null!=c?c:olympe.V.Kc();this.H=b;this.db=a;this.D=new Map;this.j=new olympe.dc.db.fc(this.id);this.sources=new Map;this.F=new Map}pf(){return 0===this.j.Ab.size}Rc(a,b,c,d){let e;const f=null!=(e=null!=c?c:this.sources.get(a))?e:this.H.fromModel(b);c=Z(this,a);this.sources.set(a,f);Tl(this,f,c,g=>{g.Rc(a,f,d,b)})}Yc(a,b){const c=Ol(this,a),d=Z(this,a),e=Pl(this,a);Tl(this,c,d,f=>{f.Yc(a,null!=b?b:new Map,e)})}Pa(a,b,c){const d=Ol(this,b),e=
|
|
927
|
-
Ol(this,c);var f=Z(this,b)&&Z(this,c)&&d!==olympe.dc.Ia.SELF&&e!==olympe.dc.Ia.SELF;f&&d!==e&&a!==olympe.dc.hc.$c&&(f=g=>{let h;return null!=(h=olympe.dc.ha().name(g))?h:g},olympe.ia
|
|
928
|
-
Z(this,c)&&d!==olympe.dc.Ia.SELF&&e!==olympe.dc.Ia.SELF;f&&d!==e&&a!==olympe.dc.hc.$c&&(olympe.ia
|
|
927
|
+
Ol(this,c);var f=Z(this,b)&&Z(this,c)&&d!==olympe.dc.Ia.SELF&&e!==olympe.dc.Ia.SELF;f&&d!==e&&a!==olympe.dc.hc.$c&&(f=g=>{let h;return null!=(h=olympe.dc.ha().name(g))?h:g},olympe.ia.Ya('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);Tl(this,d,f,g=>{g.Pa(a,b,c,Pl(this,b),Pl(this,c))})}ic(a,b,c){const d=Ol(this,b),e=Ol(this,c);let f=Z(this,b)&&
|
|
928
|
+
Z(this,c)&&d!==olympe.dc.Ia.SELF&&e!==olympe.dc.Ia.SELF;f&&d!==e&&a!==olympe.dc.hc.$c&&(olympe.ia.Ya('dc').warn(`Try to delete a relation between 2 objects that have different locations: ${b}-[${a}]->${c}`),f=!1);Tl(this,d,f,g=>{g.ic(a,b,c,Pl(this,b),Pl(this,c))})}};function Vl(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.iq.$g)if(e===olympe.dc.Ia.SELF)d[g]=olympe.dc.ha().T();else{if(e===olympe.dc.Ia.SERVER)continue}else g.startsWith(olympe.dc.ie.Ye)&&(g='fd'+g.substring(1));e=a.R(e);c&&e instanceof Object&&8===e.c?a.N.set(g,e):d[g]=e}return d}function Wl(a){if(0===a.N.size)return null;const b=Object.create(null);a.N.forEach((c,d)=>{b[d]=c});a.N.clear();return b}
|
|
929
929
|
class Xl{constructor(){this.N=new Map}R(a){return a instanceof olympe.C.Ta||a instanceof olympe.C.da||a instanceof olympe.C.aa?a.valueOf():a instanceof Date||a instanceof olympe.C.eb?(a=a instanceof olympe.C.eb?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.C.Color?{c:7,r:a.ph().valueOf(),g:a.mh().valueOf(),b:a.ih().valueOf(),a:a.hh().valueOf()}:a&&'function'===
|
|
930
930
|
typeof a.X?{c:8,t:a.X()}:a}}function Xf(a){const b=a.H.concat(a.F).concat(a.N).concat(a.j).concat(a.R);a.N=[];a.F=[];a.j=[];a.R=[];a.H=[];return b}
|
|
931
931
|
olympe.dc.transaction.He=class{constructor({wl:a=!1,ii:b=!0,me:c=!0}={}){this.N=[];this.F=[];this.j=[];this.R=[];this.H=[];this.wl=null!=a?a:!1;this.me=null!=c?c:!0;this.ii=null!=b?b:!0;this.Y=olympe.C?new Xl:new class extends Xl{R(d){return d&&'function'===typeof d.X?{c:8,t:d.X()}:d}}}flush(){return JSON.stringify(Xf(this))}Rc(a,b,c,d=null){c=Vl(this.Y,null!=c?c:null,this.wl);c={o:olympe.dc.Nc.j,t:a,p:c};this.ii&&(c.s=b);this.me&&d&&(c.m=d);this.N.push(c);this.wl&&(b=Wl(this.Y))&&this.j.push({o:olympe.dc.Nc.D,
|
|
932
932
|
t:a,p:b})}Yc(a,b,c=null){b=Vl(this.Y,b||null,!1);a={o:olympe.dc.Nc.D,t:a,p:b};this.me&&c&&(a.m=c);this.j.push(a)}D(a,b,c=null){a={o:olympe.dc.Nc.H,t:a,f:b};this.me&&c&&(a.m=c);this.F.push(a)}Pa(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:olympe.dc.Nc.F,m:a,l:b,r:c};this.me&&d&&(a.lm=d);this.me&&
|
|
933
|
-
e&&(a.rm=e);this.R.push(a)}ic(a,b,c,d=null,e=null){if(!a)throw Error('Cannot delete relation of undefined type');if(!b)throw Error('Cannot delete relation with undefined origin');if(!c)throw Error('Cannot delete relation with undefined destination');a={o:olympe.dc.Nc.N,m:a,l:b,r:c};this.me&&d&&(a.lm=d);this.me&&e&&(a.rm=e);this.H.push(a)}};olympe.dc.transaction.He.za=[olympe.dc.Writable];function Yl(a){var b=new olympe.dc.
|
|
933
|
+
e&&(a.rm=e);this.R.push(a)}ic(a,b,c,d=null,e=null){if(!a)throw Error('Cannot delete relation of undefined type');if(!b)throw Error('Cannot delete relation with undefined origin');if(!c)throw Error('Cannot delete relation with undefined destination');a={o:olympe.dc.Nc.N,m:a,l:b,r:c};this.me&&d&&(a.lm=d);this.me&&e&&(a.rm=e);this.H.push(a)}};olympe.dc.transaction.He.za=[olympe.dc.Writable];function Yl(a){var b=new olympe.dc.Za;b.Y=a;return b}function Zl(a,b){b instanceof olympe.dc.Za&&b.D.forEach((c,d)=>a.D.set(d,c));a.Ga.push(b);return b}
|
|
934
934
|
function $l(a,b,c,d){c=a.create(null!=c?c:olympe.dc.CloudObject,void 0);if('string'===typeof b)b=b||'',X(c,olympe.dc.CloudObject.nameProp.X(),b);else for(const [f,g]of Object.entries(b))X(c,f,g);b=c.X();d=null!=d?d:olympe.dc.CloudObject;const e=olympe.dc.CloudObject.extendRel.X();Zl(a,new olympe.dc.transaction.Ga.hp(e,b));Zl(a,new olympe.dc.transaction.Ga.Vl(e,b,d));return c}
|
|
935
935
|
function am(a,b){if(a.H)throw Error('Operation not permitted: this transaction has already been executed');a.H=!0;const c=[d=>{a.H=d},...a.$,null!=b?b:()=>{}];return(d,e)=>{c.forEach(f=>f(d,e))}}
|
|
936
|
-
olympe.dc.
|
|
936
|
+
olympe.dc.Za=class{constructor(a){this.id=null!=a?a:olympe.V.Kc();this.Ga=[];this.F=new Map;this.Y=!0;this.D=new Map;this.$=[];this.H=this.N=!1;this.R=[...olympe.dc.Fj().$]}T(){return this.id}model(a){let b;return null!=(b=this.F.get(olympe.dc.fa(a)))?b:olympe.dc.ha().model(a)}j(a){Ql(a,this.D);for(const b of this.Ga)b.j(a);try{this.R.forEach(b=>b(a))}catch(b){throw Error(`Transaction compilation error: ${b.message}`);}}create(a,b){b=Zl(this,new olympe.dc.transaction.Ga.Wo(a,b));const c=b.X();this.F.set(c,
|
|
937
937
|
olympe.dc.fa(a));let d;this.persist(c,null!=(d=this.D.get(c))?d:this.Y);return b}persist(a,b=!0){const c=olympe.dc.fa(a);var d=olympe.dc.ha();this.D.set(c,b);if(b){let f;b=null!=(f=this.F.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.fe().fromModel(b);Zl(this,new olympe.dc.transaction.Ga.Xv(c,d))}else{if((e=d.Ja(c))&&d.Re(c))throw Error(`Try to remove persistence of an instance already persisted: ${c}`);
|
|
938
938
|
if(!e&&!this.F.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.Mb.Dc){Zl(this,new olympe.dc.transaction.Ga.ip(a,b))}update(a,b,c){return Zl(this,new olympe.dc.transaction.Ga.Vw(a,b,c))}Pa(a,b,c){Zl(this,new olympe.dc.transaction.Ga.Vl(a,b,c))}ic(a,b,c){Zl(this,new olympe.dc.transaction.Ga.hu(a,b,c))}wn(a,b){Zl(this,new olympe.dc.transaction.Ga.hp(a,b))}defineProperty(a,b,c,d,e,f){d=this.create(olympe.dm.Property,
|
|
939
939
|
f);X(d,olympe.dc.CloudObject.nameProp,c||'');void 0!==e&&this.update(a,olympe.dc.ie.Ye+d.X(),e);this.Pa(olympe.dc.CloudObject.propertyRel,a,d);this.Pa(olympe.dm.Property.typeRel,d,b);this.Pa(olympe.dc.CloudObject.containsRel,a,d);return d}Ds(a,b,c='',{KE:d=olympe.dm.Relation.H.Jv,WE:e=olympe.dm.Relation.j.cw,RE:f=olympe.dm.Relation.j.Kt,uF:g=olympe.dm.Relation.j.Wp,HE:h=olympe.dm.Dl.NONE,tF:k=olympe.dm.Relation.N|h}={},l=olympe.V.Kc()){c=X(X(X(X(X(X(X(X(X(X(this.create(olympe.dm.Relation,l),olympe.dc.CloudObject.nameProp,
|
|
940
|
-
c||''),olympe.dm.Relation.D,d),olympe.dm.Relation.F,k),olympe.dm.Relation.ea,e),olympe.dm.Relation.ta,e),olympe.dm.Relation.$,e),olympe.dm.Relation.Y,f),olympe.dm.Relation.ja,g),olympe.dm.Relation.Ha,olympe.dm.Relation.j.Wp),olympe.dm.Relation.R,h);this.Pa(olympe.dc.CloudObject.Kj,a,c);this.Pa(olympe.dm.Relation.destinationModelRel,c,b);this.Pa(olympe.dc.CloudObject.containsRel,a,c);return c}uh(){return!1}mn(a){this.$.push(olympe.C
|
|
941
|
-
am(this,a);cm(olympe.dc.Fj(),this,a,!0)}toString(){return`Transaction #${this.id}`}};olympe.dc.
|
|
940
|
+
c||''),olympe.dm.Relation.D,d),olympe.dm.Relation.F,k),olympe.dm.Relation.ea,e),olympe.dm.Relation.ta,e),olympe.dm.Relation.$,e),olympe.dm.Relation.Y,f),olympe.dm.Relation.ja,g),olympe.dm.Relation.Ha,olympe.dm.Relation.j.Wp),olympe.dm.Relation.R,h);this.Pa(olympe.dc.CloudObject.Kj,a,c);this.Pa(olympe.dm.Relation.destinationModelRel,c,b);this.Pa(olympe.dc.CloudObject.containsRel,a,c);return c}uh(){return!1}mn(a){this.$.push(olympe.C.$a().tc(a))}ob(a,b){bm(olympe.dc.Fj(),this,am(this,a),b)}xn(a){a=
|
|
941
|
+
am(this,a);cm(olympe.dc.Fj(),this,a,!0)}toString(){return`Transaction #${this.id}`}};olympe.dc.Za.za=[olympe.dc.Nc];function Ml(a){var b=olympe.dc.Fj();const c=a.T();b.H.set(c,a);return(d,e,f)=>{const g=new olympe.dc.db.fc(c);g.Yc(d,(new Map).set(e,f),b.db.model(d));b.j.nd(Nf(g,Infinity))}}
|
|
942
942
|
function Nl(a,b,c,d){var e=olympe.dc.Fj();const f=olympe.dc.Request.j.Fi,g=olympe.dc.Request.j.zh,h=a.T();a=a.uh();const k=new Map;for(const l of b.keys()){const n=e.db.source(l);if(n===olympe.dc.Ia.SELF||!e.db.Re(l))continue;let p=k.get(n);p||(p=new olympe.dc.db.fc(h),k.set(n,p));p.Yc(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.lj(n,a)),b=e.Kb.request(b).catch(p=>null==d?void 0:d(!1,`${p}`)),c&&b.then(p=>{e.j.nd(Nf(n,p));null==d||d(!0)})}
|
|
943
943
|
function bm(a,b,c,d){if(d){const e=b.T();a.D.set(e,c);cm(a,b,(f,g)=>{f||(a.D.delete(e),c(f,g))},!1)}else cm(a,b,c,!1)}function dm(a){const b=olympe.dc.Request.j.jk;Vf(a.Kb,olympe.dc.Request.j.xo,c=>{var d=c.content;c=d.rollback;d=d.error;const e=c.T(),f=a.H.get(e);void 0!==f&&(a.H.delete(e),f.Yb(d));a.j.nd(c);a.G.warn(`Burst update (id=${e}) has been refused and is rolled back. Error: ${d}`)});Vf(a.Kb,b,c=>{c=c.content;em(a,c.id,c.finalize,c.error)})}
|
|
944
944
|
function fm(a,b,c){if(!c)throw Error('Transaction compiler id is required');a.ta.has(c)||a.$.push(b);return a}
|
|
945
945
|
function cm(a,b,c,d=!1){const e=b.T(),f=new olympe.dc.transaction.Wv(a.db,a.ja,e);try{b.j(f)}catch(q){if(q instanceof olympe.dc.Nq){q.j.then(()=>cm(a,b,c,d));return}c(!1,q.message);return}if(f.pf()){c(!0);var g;null==(g=a.D.get(e))||g(!0);a.D.delete(e)}else{a.F.set(e,[]);var h=Rl(f);a.j.oe(h,olympe.dc.db.Instance.j.TRANSACTION);g=h.filter(q=>Z(f,q));var k=Sl(f).filter(q=>a.db.Re(q)&&a.db.Ob(q,olympe.dm.File)&&a.db.source(q)!==olympe.dc.Ia.SERVER).map(q=>[q,a.db.model(q),a.db.source(q)]),l=Qg(a.j,
|
|
946
|
-
f.j,g),n=olympe.C
|
|
946
|
+
f.j,g),n=olympe.C.$a().tc((q,r)=>c(null!==q,r)),p=[l,n];gm(a,f,g).then(q=>{p.splice(1,0,q);hm(a,e,h,f.D.size+1);return im(a,f.D,d,b.uh(),b.N)}).then(q=>Promise.allSettled(k.map(([r,t,v])=>a.N.ta(r,t,v))).then(r=>{r.forEach(t=>{'rejected'===t.status&&a.G.warn('Some binary files have not been deleted after the transaction:',t.reason)});return q})).then(q=>{p.forEach(r=>r(q));em(a,e,olympe.dc.transaction.Jf.j.$i)}).catch(q=>{a.G.error(q);p.forEach(r=>r(null,`${q}`));jm(a,e)})}}
|
|
947
947
|
function gm(a,b,c){const d=b.j,e=olympe.dm.File.urlProp.X();c=c.filter(n=>{let p;return a.db.Ob(n,olympe.dm.File)&&void 0!==(null==(p=d.Tc(n))?void 0:p.Ra(e))}).map(olympe.dc.CloudObject.get);if(0===c.length)return Promise.resolve(()=>{});const f=olympe.dm.File.j.X(),g=olympe.dm.File.modificationDateProp.X(),h=Array.from(b.D.values()),k=[],l=olympe.V.kf();return Promise.all(c.map(n=>{const p=n.get(e);if(p.startsWith('blob:'))return l.F(p).then(q=>new Promise((r,t)=>{if(null===q)URL.revokeObjectURL(p),
|
|
948
948
|
r();else{var v=n.X(),x,y=null!=(x=n.get(olympe.dm.File.mimeTypeProp))?x:'application/data';a.N.ja(v,q,y,z=>{const A=h.reduce((K,Y)=>K||Y.Tc(v),null);null!==A&&(z=(new Map).set(e,z).set(f,!0).set(g,new Date),A.ln(z),k.push([v,z]));URL.revokeObjectURL(p);r()},t)}}));2048<p.length&&a.G.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.Yc(q,r);return p},
|
|
949
949
|
new olympe.dc.db.fc);return Qg(a.j,n)})}function hm(a,b,c,d){const e=olympe.C.lh(),f=new olympe.async.Dk(e);0<a.R&&f.$f(a.R);const g=olympe.dc.transaction.Jf.j.Ev;let h=!0;const k=a.F.get(b);for(let l=0;l<d;l++)f.add((n,p)=>{k.push(e.tc((q,r)=>{h&&(h=q!==g);r?p(r):n()}))});ud(f,(l,n)=>{l||a.G.warn(`An error occurred while processing the notification of transaction (${b}): ${n}.`);h&&a.j.detach(c,olympe.dc.db.Instance.j.TRANSACTION);jm(a,b)});f.start()}
|
|
@@ -957,13 +957,13 @@ olympe.dc.transaction.Ga.Wo.za=[olympe.dc.Ze];olympe.dc.transaction.Ga.Vl=class
|
|
|
957
957
|
if(!this.D)throw Error('OperationError: Cannot create relation, destination tag is undefined, null or empty string');this.relation.La()===olympe.dc.va.DESTINATION?a.Pa(b,olympe.dc.fa(this.origin),olympe.dc.fa(this.D)):a.Pa(b,olympe.dc.fa(this.D),olympe.dc.fa(this.origin))}toString(){return`CreateRelation('${this.relation.La()}${this.relation.X()}, ${olympe.dc.fa(this.origin)}, ${olympe.dc.fa(this.D)})`}};olympe.dc.transaction.Ga.ZA=class extends olympe.dc.transaction.Ga.Dg{constructor(a,b=olympe.dc.Mb.Dc){super();this.model=a instanceof olympe.dc.CloudObject?a:olympe.dc.CloudObject.get(a);this.Pb=b}j(a){for(const b of this.ha.Uc(this.model))b!==olympe.dc.fa(this.model)&&(new olympe.dc.transaction.Ga.ip(b,this.Pb)).j(a)}toString(){return`DeleteAllInstances(${this.model.X()}, ${this.Pb})`}};olympe.dc.transaction.Ga.hp=class extends olympe.dc.transaction.Ga.oo{j(a){const b=this.getType();if(void 0===b)throw Error('OperationError: Cannot delete relation, type is undefined');if(b===olympe.dc.hc.$c)throw Error('OperationError: Cannot delete the instance -> model relation');const c=olympe.dc.fa(this.origin);if(!this.origin)throw Error('OperationError: Cannot delete relation, left tag is undefined');const d=this.La(),e=this.ha.cb(c,this.relation);for(const f of e)d===olympe.dc.va.DESTINATION?
|
|
958
958
|
a.ic(b,c,f):a.ic(b,f,c)}toString(){return`DeleteAllRelations(${this.La()}${this.getType()})`}};olympe.dc.transaction.Ga.ip=class extends olympe.dc.transaction.Ga.Dg{constructor(a,b=olympe.dc.Mb.Dc){super();this.tag=this.ha.Ja(a)?olympe.dc.CloudObject.get(a):a;this.Pb=b}X(){return olympe.dc.fa(this.tag)}j(a){const b=this.X();if(void 0===b)throw Error('OperationError: Cannot delete instance, tag is undefined');this.ha.Ja(b)&&Ul(a,b,this.Pb)}toString(){return'DeleteInstance('+this.X()+', '+this.Pb+')'}};olympe.dc.transaction.Ga.hu=class extends olympe.dc.transaction.Ga.Vl{j(a){const b=this.relation.X();if(void 0===b)throw Error('OperationError: Cannot delete relation, type is undefined');if(b===olympe.dc.hc.$c)throw Error('OperationError: Cannot delete the instance -> model relation');const c=olympe.dc.fa(this.origin);if(void 0===c)throw Error('OperationError: Cannot delete relation, left tag is undefined');const d=olympe.dc.fa(this.D);if(void 0===d)throw Error('OperationError: Cannot delete relation, right tag is undefined');
|
|
959
959
|
this.relation.La()===olympe.dc.va.DESTINATION?a.ic(b,c,d):a.ic(b,d,c)}toString(){return'DeleteRelation('+this.relation.La()+this.relation.X()+', '+olympe.dc.fa(this.origin)+', '+olympe.dc.fa(this.D)+')'}};olympe.dc.transaction.Ga.Vw=class extends olympe.dc.transaction.Ga.Dg{constructor(a,b,c){super();this.tag=this.ha.Ja(a)?olympe.dc.CloudObject.get(a):a;this.Ld=new Map;void 0!==b&&this.Ld.set(olympe.dc.fa(b),c)}X(){return olympe.dc.fa(this.tag)}j(a){const b=this.X();if(void 0===b)throw Error('OperationError: Cannot update instance, tag is undefined');var c;if(!(null!=(c=a.j.Tc(b))&&c.D()||this.ha.Ja(b)))throw Error('OperationError: Instance #'+b+' not found so it cannot be updated');c=km(this,this.Ld);
|
|
960
|
-
for(const [e,f]of c){var d=this.ha.Ra(b,e,!0);d instanceof olympe.dc.wc&&Ul(a,d.X(),olympe.dc.Mb.Dc);f instanceof olympe.dc.wc&&!Z(a,f.X())&&(d=new olympe.dc.
|
|
960
|
+
for(const [e,f]of c){var d=this.ha.Ra(b,e,!0);d instanceof olympe.dc.wc&&Ul(a,d.X(),olympe.dc.Mb.Dc);f instanceof olympe.dc.wc&&!Z(a,f.X())&&(d=new olympe.dc.Za,d.persist(f.X()),d.j(a))}a.Yc(b,c)}toString(){return'UpdateInstance('+this.X()+', '+km(this,this.Ld)+')'}};olympe.dc.transaction.Ga.Xv=class a extends olympe.dc.transaction.Ga.Dg{constructor(b,c){super();this.tag=b;this.source=c}j(b){const c=olympe.dc.ha();if(Z(b,this.tag)&&c.Ja(this.tag)&&!c.Re(this.tag)){const e=c.Cb(this.tag,!0);var d;let f;null==(f=null==(d=b.j.Tc(this.tag))?void 0:d.Cb())||f.forEach((g,h)=>{e.set(h,g)});for(const g of e.values())g instanceof olympe.dc.wc&&c.Ja(g.X())&&(new a(g.X(),this.source)).j(b);d=c.model(this.tag);b.Rc(this.tag,d,this.source,e);for(const [g,h,k]of th(c,this.tag))Z(b,
|
|
961
961
|
k)&&(h===olympe.dc.va.ORIGIN?b.Pa(g,k,this.tag):b.Pa(g,this.tag,k))}}toString(){return`PersistOperation: tag - ${this.tag}, src - ${this.source}`}};olympe.dc.fa=function(a){let b=null;if('string'===typeof a)return a;if('function'===typeof(null==a?void 0:a.X)&&(null==a||!a.gh))b=a.X();else if('function'===typeof a){let d;b=null!=(d=olympe.dc.na.ac(a))?d:''}else if(olympe.C.qf(a)){let d;b=olympe.dc.fa(null==(d=olympe.C.Qa(a))?void 0:d.valueOf())}let c;return null!=(c=b)?c:''};w('olympe.dc.instanceToTag',olympe.dc.fa);olympe.dc.ha=function(){return olympe.dc.ly().view};olympe.dc.register=function(a,b){olympe.dc.na.j(a,b)};
|
|
962
962
|
olympe.dc.defineProperty=function(a){return new olympe.dc.Sa.Property(a)};olympe.dc.Ds=function(a,b=olympe.dc.va.DESTINATION,c=olympe.dc.CloudObject,d=olympe.dc.va.DESTINATION){const e=olympe.dc.va.DESTINATION;return b===olympe.dc.va.ORIGIN||b===e?new olympe.dc.Sa.Relation(a,b):new olympe.dc.Sa.Relation(a,d,b,c)};olympe.dc.Fx=function(a){return a.$b()};olympe.dc.nb={};olympe.dc.nb.tn=a=>'string'===typeof a||'number'===typeof a||'boolean'===typeof a||a instanceof String?olympe.C.xb(a):a instanceof olympe.C.Ta?a:null;olympe.dc.nb.qn=a=>'boolean'===typeof a||a instanceof Boolean?olympe.C.Sb(a):a instanceof olympe.C.da?a:null;olympe.dc.nb.sn=a=>'number'===typeof a||a instanceof Number?olympe.C.ra(a):'string'===typeof a||a instanceof String?olympe.C.ra(Number.parseFloat(a.valueOf())):a instanceof olympe.C.aa?a:null;
|
|
963
963
|
olympe.dc.nb.rn=a=>'number'===typeof a||a instanceof Number?oc(a.valueOf()):'string'===typeof a||a instanceof String?new olympe.C.eb(new Date(a.valueOf().valueOf())):a instanceof Date?new olympe.C.eb(a):a instanceof olympe.C.eb?a:null;olympe.dc.nb.ys=function(a){return a instanceof olympe.C.Color?a:'string'===typeof a||a instanceof String?sc(a.valueOf()):null};olympe.dc.nb.zs=a=>a instanceof olympe.dc.CloudObject?a:a instanceof olympe.dc.wc?olympe.dc.CloudObject.get(a.tag):null;
|
|
964
964
|
olympe.dc.nb.tj=a=>a instanceof olympe.dc.wc?olympe.dc.CloudObject.get(a.tag):a;olympe.dc.nb.Cc=a=>{a=a instanceof olympe.dc.wc?olympe.dc.CloudObject.get(a.tag):a;let b;return null!=(b=a instanceof olympe.dc.CloudObject?a.Cc():a)?b:null};
|
|
965
|
-
olympe.dc.nb.Zx=a=>{switch(a){case olympe.C.da:return olympe.dc.nb.qn;case olympe.C.Ta:return olympe.dc.nb.tn;case olympe.C.aa:return olympe.dc.nb.sn;case olympe.C.eb:return olympe.dc.nb.rn;case olympe.C.Color:return olympe.dc.nb.ys;case olympe.dc.CloudObject:return olympe.dc.nb.zs;default:return olympe.dc.nb.tj}};olympe.dc.kc={};olympe.dc.xf=class{la(){}F(){}compare(){}H(){}ga(){}toString(){}};function lm(a){let b=null;for(a=[...a.ba];null===b&&0<a.length;)b=a.pop().Nb();return b}function mm(a,b){a.N()||(a=`Calling "${b}" on subscription with id ${a.T()} 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.ia
|
|
966
|
-
olympe.dc.Aa=class{constructor(a,b,c){void 0===a||null===a?olympe.ia
|
|
965
|
+
olympe.dc.nb.Zx=a=>{switch(a){case olympe.C.da:return olympe.dc.nb.qn;case olympe.C.Ta:return olympe.dc.nb.tn;case olympe.C.aa:return olympe.dc.nb.sn;case olympe.C.eb:return olympe.dc.nb.rn;case olympe.C.Color:return olympe.dc.nb.ys;case olympe.dc.CloudObject:return olympe.dc.nb.zs;default:return olympe.dc.nb.tj}};olympe.dc.kc={};olympe.dc.xf=class{la(){}F(){}compare(){}H(){}ga(){}toString(){}};function lm(a){let b=null;for(a=[...a.ba];null===b&&0<a.length;)b=a.pop().Nb();return b}function mm(a,b){a.N()||(a=`Calling "${b}" on subscription with id ${a.T()} 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.ia.Ya('dc').warn(a))}
|
|
966
|
+
olympe.dc.Aa=class{constructor(a,b,c){void 0===a||null===a?olympe.ia.Ya('dc').warn('attempt to create a listdef with a null or undefind basetag. This listdef is thus without effect.'):(this.D=olympe.C.ua([a],olympe.dc.fa,String),this.ba=void 0!==b&&(Array.isArray(b)?b:[b])||[],this.valueType=c||lm(this),this.j=null,this.Bc=void 0)}re(){return olympe.dc.re()}ob(){if(null===this.j){const a=olympe.dc.kc.By();this.j=nm(a,this,this.Bc);null!==this.valueType&&this.j.Rd(this.valueType);olympe.C.$a().Yd(()=>
|
|
967
967
|
{var b=this.j.T();a.G.debug('QueryMGR: [ID:',b,'] - Unregistered');const c=a.j.get(b);if(null==c)var d=0;else 0<c.counter&&c.counter--,d=0===c.counter;d&&(c.j.release(),a.j.delete(b));this.j=null})}return this}nc(){null===this.j&&this.ob();return this.j}Rd(a){this.valueType=a;null!==this.j&&this.j.Rd(this.valueType)}Nb(){return null!==this.j?this.j.Nb():null===this.valueType?olympe.dc.CloudObject:this.valueType}ce(){return this.D}tm(){return this.ba}kd(a,b){return this.nc().kd(a,b)}tl(a){this.nc().tl(a)}Su(){return this.nc().Gd()}Ru(){return this.nc().N()}get(a){return this.nc().get(a)}ti(){return this.nc().ti()}ri(a){const b=
|
|
968
968
|
this.nc();mm(b,'getCurrent');return b.ri(a)}has(a){return this.nc().has(a)}sh(a){const b=this.nc();mm(b,'hasCurrent');return b.sh(a)}qe(a){return this.nc().qe(a)}Cz(a){return this.qe(a).asObservable()}mf(a){const b=this.nc();mm(b,'getCurrentAt');return b.mf(a)}nf(a){return this.nc().nf(a)}Qf(a){const b=this.nc();mm(b,'getCurrentKeyAt');return b.Qf(a)}Id(a){return this.nc().Id(a)}Hz(a){return this.Id(a).asObservable()}Rf(a){const b=this.nc();mm(b,'getCurrentRank');return b.Rf(a)}Ic(){return this.nc().Ic()}Dz(){return this.Ic().asObservable()}Sf(){return this.nc().Sf()}Cf(){return this.nc().Cf()}Iz(){return this.Cf().asObservable()}xg(){const a=
|
|
969
969
|
this.nc();mm(a,'getCurrentSize');return a.xg()}forEach(a,b){this.nc().forEach(a,b)}pe(a){const b=this.nc();mm(b,'forEachCurrentValue');return b.pe(a)}wj(a,b,c,d){a=new olympe.dc.ba.Nh(a,b);(new olympe.dc.Aa(this.D,[...this.ba,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.ba];for(const c of b){if(void 0===c)throw Error('ListDef.transform(): Trying to set an undefined transformer');
|
|
@@ -973,7 +973,7 @@ olympe.dc.Aa.prototype.transform=olympe.dc.Aa.prototype.transform;olympe.dc.Aa.p
|
|
|
973
973
|
olympe.dc.Aa.prototype.getCurrentAt=olympe.dc.Aa.prototype.mf;olympe.dc.Aa.prototype.observeAt=olympe.dc.Aa.prototype.Cz;olympe.dc.Aa.prototype.offReady=olympe.dc.Aa.prototype.tl;olympe.dc.Aa.prototype.onReady=olympe.dc.Aa.prototype.kd;olympe.dc.Aa.prototype.getBaseTag=olympe.dc.Aa.prototype.ce;olympe.dc.Aa.za=[olympe.C.vd];m=olympe.dc.Aa.prototype;m.re.K=olympe.C.J.j;m.ob.K=olympe.C.J.H();m.nc.K=new olympe.C.J(()=>olympe.dc.kc.Subscription,[]);m.Rd.K=new olympe.C.J(()=>{},[]);
|
|
974
974
|
m.ce.K=new olympe.C.J(()=>String,[]);m.tm.K=new olympe.C.J(()=>Array,[]);m.kd.K=new olympe.C.J(()=>String,[]);m.tl.K=new olympe.C.J(()=>{},[]);m.Su.K=olympe.C.J.N;m.Ru.K=olympe.C.J.j;m.get.K=new olympe.C.J(()=>olympe.dc.CloudObject,[],'valueType');m.ti.K=new olympe.C.J(()=>Array,[]);m.ri.K=olympe.C.J.j;m.has.K=olympe.C.J.N;m.sh.K=olympe.C.J.j;m.qe.K=new olympe.C.J(()=>olympe.dc.CloudObject,[],'valueType');m.mf.K=olympe.C.J.j;m.nf.K=new olympe.C.J(()=>String,[]);m.Qf.K=olympe.C.J.j;m.Id.K=olympe.C.J.F;
|
|
975
975
|
m.Rf.K=olympe.C.J.j;m.Ic.K=new olympe.C.J(()=>olympe.dc.CloudObject,[],'valueType');m.Sf.K=new olympe.C.J(()=>String,[]);m.Cf.K=olympe.C.J.F;m.xg.K=olympe.C.J.j;m.forEach.K=new olympe.C.J(()=>{},[]);m.pe.K=olympe.C.J.j;m.wj.K=new olympe.C.J(()=>{},[]);m.transform.K=new olympe.C.J(()=>olympe.dc.Aa,[]);m.zl.K=new olympe.C.J(()=>olympe.dc.Aa,[]);m.filter.K=new olympe.C.J(()=>olympe.dc.Aa,[]);m.bl.K=new olympe.C.J(()=>olympe.dc.rk,[]);m.toString.K=olympe.C.J.j;m.Qu.K=olympe.C.J.j;m.Wc.K=olympe.C.J.D;const om={qA:'append',gm:'filter_not',up:'filter_and',vp:'filter_or'};function pm(a,b){a=qm(a);a=olympe.dc.CloudObject.get(a);return(new olympe.dc.bb.po(a,b)).D}
|
|
976
|
-
olympe.dc.rk=class{constructor(a,b){this.j=qm(a);this.G=olympe.ia
|
|
976
|
+
olympe.dc.rk=class{constructor(a,b){this.j=qm(a);this.G=olympe.ia.Ya('dc.query');this.valueType=void 0===b?olympe.dc.CloudObject:b;this.ba=[];this.Ga=[];this.Bc=void 0}Xi(){const a=new olympe.dc.Aa(this.j,this.ba,this.valueType);'boolean'===typeof this.Bc&&(a.Bc=this.Bc);return a}transform(a){for(let b=0,c=a.length,d;b<c;b++){d=a[b];if(void 0===d)throw new rm('transform','Trying to set an undefined transformer');if(d instanceof olympe.dc.Sa.Property)throw new rm('transform','Properties cannot be used as transformer, unlike relations '+
|
|
977
977
|
d);if(!d||'function'!==typeof d.j)throw new rm('transform','one of the argument is not a Transformer '+d);const e=d.Nb();null!==e&&(this.valueType=e);this.ba.push(d)}return this}zl(a){this.ba.push(new olympe.dc.ba.Lf(a));return this}nA(a){this.ba.push(new olympe.dc.ba.Lf(qm(a)));return this}Uu(a){this.valueType=a;return this}fb(a){this.ba.push(a);this.valueType=a.Nb()||olympe.dc.CloudObject;return this}Tx(a){for(const b of a)this.ba.push(b),this.valueType=b.Nb()||olympe.dc.CloudObject;return this}Sx(a,
|
|
978
978
|
b,c){a=new olympe.dc.ba.Ke(a,a.La(),b,c);this.ba.push(a);this.valueType=a.Nb()||olympe.dc.CloudObject;return this}Rx(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.La())}a=new olympe.dc.ba.tk(b,c);this.ba.push(a);this.valueType=a.Nb()||olympe.dc.CloudObject;return this}Tu(){this.fb(olympe.dc.CloudObject.instancesRel);return this}hf(a){var b=this.Ga.pop();b===om.gm&&(a=new olympe.dc.Z.je(a),b=this.Ga.pop());switch(b){case om.up:b=this.ba.pop().D;b instanceof
|
|
979
979
|
olympe.dc.Z.Od?(b=b.Z,b.push(a),a=new olympe.dc.Z.Od(...b)):a=new olympe.dc.Z.Od(b,a);b=this.Ga.pop();break;case om.vp:b=this.ba.pop().D,b instanceof olympe.dc.Z.Fe?(b=b.Z,b.push(a),a=new olympe.dc.Z.Fe(...b)):a=new olympe.dc.Z.Fe(b,a),b=this.Ga.pop()}b===om.gm&&(a=new olympe.dc.Z.je(a),this.Ga.pop());this.ba.push(new olympe.dc.ba.zf(a));return this}Nx(a,b,c){return this.hf(new olympe.dc.Z.Be(pm(a,c),new olympe.dc.bb.Xe(b)))}contains(a,b,c=!1,d){return this.hf(new olympe.dc.Z.yf(pm(a,d),new olympe.dc.bb.Xe(b),
|
|
@@ -983,16 +983,16 @@ return this.hf(b)}Ad(){this.Ga.push(om.gm);return this}and(){this.ba[this.ba.len
|
|
|
983
983
|
new olympe.dc.xc.DateTime(new olympe.dc.bb.Ji(a,c))}c=d;null!==c&&this.ba.push(new olympe.dc.ba.bh(c,b));return this}sort(a,b,c){const d=new class extends olympe.dc.xc.Cg{F(e,f){return a(olympe.dc.CloudObject.get(f))}compare(e,f){return b(e,f).valueOf()}};this.ba.push(new olympe.dc.ba.bh(d,c));return this}Jx(){this.ba.push(new olympe.dc.ba.Ki);return this}Hj(a,b){this.ba.push(new olympe.dc.ba.Nh(a,b));return this}};class rm extends Error{constructor(a,b){super(`ListDefBuilder.${a}(): ${b}`)}}
|
|
984
984
|
function qm(a){return'string'===typeof a||a instanceof olympe.C.Ta?a:'function'===typeof a?olympe.dc.na.ac(a):olympe.C.hb(a)?a.ei===olympe.C.Ta?a:olympe.C.ua([a],b=>olympe.C.xb(olympe.dc.fa(b)),olympe.C.Ta):a.X()}m=olympe.dc.rk.prototype;m.Xi.K=new olympe.C.J(()=>olympe.dc.Aa,[]);m.transform.K=olympe.C.J.H();m.zl.K=olympe.C.J.H();m.nA.K=olympe.C.J.H();m.Uu.K=olympe.C.J.H();m.fb.K=olympe.C.J.H();m.Tx.K=olympe.C.J.H();m.Sx.K=olympe.C.J.H();m.Rx.K=olympe.C.J.H();m.Tu.K=olympe.C.J.H();m.hf.K=olympe.C.J.H();
|
|
985
985
|
m.Nx.K=olympe.C.J.H();m.contains.K=olympe.C.J.H();m.Ob.K=olympe.C.J.H();m.ol.K=olympe.C.J.H();m.Ox.K=olympe.C.J.H();m.az.K=olympe.C.J.H();m.nl.K=olympe.C.J.H();m.Oj.K=olympe.C.J.H();m.sz.K=olympe.C.J.H();m.filter.K=olympe.C.J.H();m.Ad.K=olympe.C.J.H();m.and.K=olympe.C.J.H();m.or.K=olympe.C.J.H();m.xl.K=olympe.C.J.H();m.sort.K=olympe.C.J.H();m.Jx.K=olympe.C.J.H();m.Hj.K=olympe.C.J.H();function nm(a,b,c){const d=b.ce();var e=new olympe.dc.query.Vv;let f;f=d;olympe.C.hb(f)&&(f=e.add(d));b=(b=b.tm())?Array.isArray(b)?b:[b]:null;e=olympe.dc.kc.Subscription.F(f,b,e);let g,h,k=null!=(h=null==(g=a.j.get(e))?void 0:g.j)?h:null;null===k&&(a.G.debug('QueryMGR: new',a.D?'local':'remote','subscription "',e,'": #',`${f},`,b),k=new olympe.dc.kc.Subscription(e,d,b,a.F));k.getContext().run(()=>a.process(k,c));return k}
|
|
986
|
-
function sm(a,b){if(b.N())a.G.debug('ListProcessor: [ID:',b.T(),'] - Subscription already booted, ignoring');else{a.G.debug('ListProcessor: [ID:',b.T(),'] - Booting subscription');var c=new olympe.dc.lc.Vr(a.db,a.G),d=b.T();olympe.C.Vc([b.ce()],e=>{const f=olympe.dc.fa(e);a.G.debug('ListProcessor: [ID:',b.T(),'] - Booting with baseTag',f);b.tg()||b.ni();Of(a.db,f,tm(a,b,c),d);olympe.C
|
|
986
|
+
function sm(a,b){if(b.N())a.G.debug('ListProcessor: [ID:',b.T(),'] - Subscription already booted, ignoring');else{a.G.debug('ListProcessor: [ID:',b.T(),'] - Booting subscription');var c=new olympe.dc.lc.Vr(a.db,a.G),d=b.T();olympe.C.Vc([b.ce()],e=>{const f=olympe.dc.fa(e);a.G.debug('ListProcessor: [ID:',b.T(),'] - Booting with baseTag',f);b.tg()||b.ni();Of(a.db,f,tm(a,b,c),d);olympe.C.$a().Yd(()=>Mf(a.db,f,d));a.db.Ja(f.valueOf())||um(c);b.N()||(um(c),b.Pc([]))})}}
|
|
987
987
|
function vm(a,b,c,d,e){const f=[b.ce()],g=l=>l instanceof olympe.dc.ba.Lf;let h;const k=(null!=(h=b.qh())?h:[]).filter(g);for(const l of k){f.push(l.ce());let n;k.push(...(null!=(n=l.qh())?n:[]).filter(g))}olympe.C.Vc(f,()=>{const l=b.le(c);wm(a,l,b.T(),d,e)})}
|
|
988
|
-
function wm(a,b,c,d,e){a.G.debug('CoverageProcessor: [ID:',c,'] - checking coverage of remote query over',b.length,'paths.');const f=olympe.C
|
|
989
|
-
function tm(a,b,c){const d=new olympe.dc.lc.Vj;let e=!1;const f=olympe.C
|
|
988
|
+
function wm(a,b,c,d,e){a.G.debug('CoverageProcessor: [ID:',c,'] - checking coverage of remote query over',b.length,'paths.');const f=olympe.C.$a(),g=new olympe.async.Dk(f);b.forEach(h=>{g.add((k,l)=>{let n=!1;Bi(a.H,h,f,olympe.dc.Ia.SELF,olympe.dc.ma.oc.wf,{Bc: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.T()} has encountered an error: ${p}`))))})});ud(g,(h,k)=>d(k));g.start()}
|
|
989
|
+
function tm(a,b,c){const d=new olympe.dc.lc.Vj;let e=!1;const f=olympe.C.$a(),g=b.qh(),h=[];h[g?g.length:0]=(k,l,n,p)=>{f.jd()||f.gb()||(k?b.sh(n)?a.G.warn('Adding the same index twice (should never happen) for sub #',b.T(),', index #',n,', tag #',l):(a.G.debug('ListProcessor: [ID:',b.T(),'] - Adding Instance',l,'to the subscription'),b.Nd(n,l)):(a.G.debug('ListProcessor: [ID:',b.T(),'] - Removing Instance',l,'from the subscription'),b.ug(n)),e||(xm(c,()=>{p.pg();um(c)}),f.run(()=>p.re().Ag(b.Pc.bind(b))),
|
|
990
990
|
e=!0),ym(c,n))};if(null!==g)for(let k=g.length-1;0<=k;k--)h[k]=g[k].j(f,c,h[k+1]);return(k,l)=>{const n=b.T();c.register(n,null);const p=d.j(k,l,n,null);if(null!==p)h[0](k,l,n,zm(p,k,l,n))}}
|
|
991
991
|
olympe.dc.kc.uv=class{constructor(a,b,c,d,e,f){this.G=a;this.db=b;this.D=f||e;this.H=d;this.j=new Map;this.F=new olympe.C.Wb('Legacy ListDef processor')}process(a,b){const c=a.T();var d=this.j.get(c);d||(d=new olympe.dc.kc.Cw(a),this.j.set(c,d));d.counter++;Am(d)?this.G.debug('ListProcessor: [ID:',c,'] - id already processed'):(this.G.debug('ListProcessor: [ID:',c,'] - NOT processed yet.'),d=a.ff(),b||this.D&&d===olympe.dc.Ia.SERVER||d===olympe.dc.Ia.SELF?(this.G.debug('QueryMGR: [ID:',c,'] - Local subscription, no need for coverage check, booting subscription '),
|
|
992
992
|
sm(this,a)):vm(this,a,d,e=>{e?this.G.error(e):sm(this,a)},b))}};function Bm(a){return olympe.C.hb(a)?'Node#'+a.Ca.T():String(a)}function Cm(a,b){return olympe.C.hb(b)?'{"c":"Parameter","v":"'+a.add(b)+'"}':JSON.stringify(b)}
|
|
993
993
|
olympe.dc.query.Vv=class{constructor(){this.j=0;this.values=null}add(a){let b;b=olympe.C.hb(a)?'n'+a.Ca.T():'p'+ ++this.j;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{la(){}j(){}D(){}ga(){}toString(){}};olympe.dc.kc.Subscription=class a extends olympe.C.Tj{constructor(b,c,d,e){super(olympe.dc.CloudObject,new olympe.C.Wb('context subscription '+b,e));this.id=b;this.wd=c;this.ba=d||null;this.state=this.H.run(()=>olympe.C.ge(olympe.dc.kc.Subscription.j.INIT));this.Gc=!1;this.Y=this.Yb=null}static F(b,c,d){let e;try{e=b;if(c)for(let f=0,g=c.length;f<g;f++)e+='|'+c[f].ga(d);else e+='|null';e=olympe.V.ub(e)}catch(f){e=olympe.V.Kc()}return e}T(){return this.id}ce(){return this.wd}qh(){return this.ba}ff(){const b=
|
|
994
994
|
olympe.dc.fe(),c=olympe.C.Qa(this.ce());let d;return olympe.dc.CloudObject.instancesRel.Fa(null==(d=this.ba)?void 0:d[0])?b.fromModel(c):b.Qe(c)}tg(){const b=olympe.C.Qa(this.state);return b&&b.valueOf()>=olympe.dc.kc.Subscription.j.Pr}ni(){if(this.state.Ca.gb())throw Error(`Cannot set destroyed subscription '${this.id}' as subscribed`);const b=this.Yb;this.Yb=null;for(let c in b)if(Object.prototype.hasOwnProperty.call(b,c))b[c](this);lc(this.state,olympe.C.ge(olympe.dc.kc.Subscription.j.Pr))}Gd(){return olympe.C.ua([this.state],
|
|
995
|
-
()=>{},olympe.C.da)}N(){const b=this.state.Ca.Fb;return b&&b.valueOf()>=olympe.dc.kc.Subscription.j.Wh}kd(b,c){this.N()?b(this):(null===this.Y&&(this.Y=new Map),void 0===c&&(c=olympe.V.Kc()),this.Y.set(c,olympe.C
|
|
995
|
+
()=>{},olympe.C.da)}N(){const b=this.state.Ca.Fb;return b&&b.valueOf()>=olympe.dc.kc.Subscription.j.Wh}kd(b,c){this.N()?b(this):(null===this.Y&&(this.Y=new Map),void 0===c&&(c=olympe.V.Kc()),this.Y.set(c,olympe.C.$a().tc(b)));return c||''}tl(b){null!==this.Y&&b&&this.Y.delete(b)}Eb(){const b=olympe.dc.kc.Subscription.j.Wh;if(!this.state.Ca.gb()&&olympe.C.Qa(this.state)!==b&&(this.Nf(),lc(this.state,b),null!==this.Y)){for(const c of this.Y.values())c(this);this.Y=null}}onDestroy(b){this.H.onDestroy(b)}release(){this.H.destroy()}Pc(b){if(!this.state.Ca.gb()){for(let c=
|
|
996
996
|
0,d=b.length;c<d;c++)this.hn(b[c],c);if(this.N())this.Nf();else{this.Gc=b=!0;for(let c in this.D)if(Object.prototype.hasOwnProperty.call(this.D,c)&&!Object.prototype.hasOwnProperty.call(this.values,c)){b=!1;break}b&&this.Eb()}}}Nd(b,c){if(!this.state.Ca.gb()&&(this.al(b,olympe.dc.CloudObject.get(c)),b=this.N(),this.Gc&&!b)){b=!0;for(let d in this.D)if(Object.prototype.hasOwnProperty.call(this.D,d)&&!Object.prototype.hasOwnProperty.call(this.values,d)){b=!1;break}b&&this.Eb()}}ug(b){this.state.Ca.gb()||
|
|
997
997
|
(this.gn(b),this.pj(b,!this.N()))}Mg(){return this.N()?super.Mg():'Subscription is not ready!'}le(b){const c=olympe.C.Qa(this.ce());return olympe.dc.kc.Subscription.D(c,b,this.qh())}static D(b,c,d){var e=olympe.dc.ma.from(b,c).ne();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.ba.af){const h=olympe.dc.query.Relation.from(e);b=b.map(k=>k.fb(h,!0))}else if(e instanceof olympe.dc.ba.Ke){const h=olympe.dc.query.Relation.from(e);b=b.map(k=>k.vg(h,
|
|
998
998
|
!0,!0))}else if(e instanceof olympe.dc.ba.Lf)e=a.D(olympe.C.Qa(e.ce()),c,e.qh()),b.push(...e);else if(e instanceof olympe.dc.ba.zf||e instanceof olympe.dc.ba.bh){const h=e.F();b=b.map(k=>{for(const l of h){for(const n of l)k=n.recursive?k.vg(n,!0,!0):k.fb(n,!0);k=k.back(l.length)}return k})}return b}};olympe.dc.kc.Subscription.j={INIT:0,Pr:1,Wh:2};olympe.dc.kc.Subscription.prototype.Mg.K=olympe.C.J.j;function Am(a){const b=a.D;a.D=!0;return b}olympe.dc.kc.Cw=class{constructor(a){this.counter=0;this.D=!1;this.j=a}};olympe.dc.Kf=class{la(){}Nb(){}j(){}ga(){}toString(){}};olympe.dc.gr=class{F(){}};olympe.dc.Yk=class{la(){}getValue(){}j(){}ga(){}toString(){}};olympe.dc.xc={};let Dm=0;olympe.dc.xc.Cg=class{constructor(){this.id=Dm++}la(){return'CustomLocalComparator#'+Dm}H(){return[]}F(){throw Error('GetComparedValue function was not implemented.');}compare(){throw Error('Compare function was not implemented.');}ga(){return`{"c":"${this.la()}"}`}toString(){return this.la()+'()'}};olympe.dc.xc.Cg.za=[olympe.dc.xf];olympe.dc.xc.DateTime=class{constructor(a){this.j=a}la(){return Q(olympe.dc.xc.DateTime)}H(){return this.j.j()}F(a,b){return this.j.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}ga(a){return'{"c":"'+this.la()+'",a:['+this.j.ga(a)+']}'}toString(){return'Number('+this.j.toString()+')'}};P('olympe.dc.comparators.DateTime',olympe.dc.xc.DateTime);olympe.dc.xc.DateTime.za=[olympe.dc.xf];olympe.dc.xc.Number=class{constructor(a){this.j=a}la(){return Q(olympe.dc.xc.Number)}H(){return this.j.j()}F(a,b){return this.j.getValue(a,b)}compare(a,b){return a!==b?a>b?1:-1:0}ga(a){return`{"c":"${this.la()}",a:[${this.j.ga(a)}]}`}toString(){return`Number(${this.j.toString()})`}};P('olympe.dc.comparators.Number',olympe.dc.xc.Number);olympe.dc.xc.Number.za=[olympe.dc.xf];olympe.dc.xc.String=class{constructor(a){this.j=a}la(){return Q(olympe.dc.xc.String)}H(){return this.j.j()}F(a,b){return olympe.C.ua([this.j.getValue(a,b)],c=>c.toLowerCase(),olympe.C.Ta)}compare(a,b){return void 0===a?void 0===b?0:1:a!==b?a>b?1:-1:0}ga(a){return`{"c":"${this.la()}",a:[${this.j.ga(a)}]}`}toString(){return`String(${this.j.toString()})`}};P('olympe.dc.comparators.String',olympe.dc.xc.String);olympe.dc.xc.String.za=[olympe.dc.xf];olympe.dc.Z={};let Em=0;olympe.dc.Z.Cg=class{constructor(){this.id=Em++}la(){return'CustomLocalPredicate#'+this.id}D(){return[]}j(){throw Error('Test function was not implemented.');}ga(){return`{"c":"${this.la()}"}`}toString(){return this.la()+'()'}};olympe.dc.Z.Cg.za=[olympe.dc.Ba];olympe.dc.Z.El=class{constructor(a,b){this.F=a;this.H=b}la(){}D(){return[this.F.j(),this.H.j()]}j(a,b){return a.run(()=>olympe.C.ua([this.F.getValue(a,b),this.H.getValue(a,b)],(c,d)=>{c=c.valueOf();d=d.valueOf();return olympe.C.Sb(this.N('string'===typeof c?c:Number(c),'string'===typeof d?d:Number(d)))},olympe.C.da))}N(){}ga(a){return'{"c":"'+this.la()+'","a":['+this.F.ga(a)+','+this.H.ga(a)+']}'}toString(){return this.la().replace(/^.+\./,'')+'('+this.F.toString()+','+this.H.toString()+')'}};
|
|
@@ -1013,7 +1013,7 @@ P('olympe.dc.predicates.InstanceOf',olympe.dc.Z.Ui);olympe.dc.Z.Ui.za=[olympe.dc
|
|
|
1013
1013
|
(0<=this.D?Km(Lm(this.H,this.D),a):a.push(this.R));this.$(a)}}Ag(a){this.$=a}};olympe.dc.lc.Vj.za=[olympe.dc.lc.Ua];function zm(a,b,c,d){b?a.N[d]=c:delete a.N[d];null===a.D&&(a.D=new olympe.dc.lc.gk(a.j,a));return a.D}function Lm(a,b){for(let c=0;c<b;c++)if(null!==a.D)a=a.D;else break;return a}function Km(a,b){a=a.N;if(null!==a)for(let c in a)Object.prototype.hasOwnProperty.call(a,c)&&b.push(c)}olympe.dc.lc.gk=class{constructor(a,b){this.j=a;this.depth=b?b.depth+1:0;this.N=Object.create(null);this.D=null}re(){return this.j}pg(){this.j.N()?this.j.F():this.j.Y(this.depth-1)}};class Mm extends olympe.dc.lc.gk{constructor(a,b,c){super(a);this.R=b;this.tag=c;this.$=this.Y=this.H=!1;this.F=null}}
|
|
1014
1014
|
function Nm(a,b,c,d,e){const f=Object.create(null),g=a.ja,h=a.H;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.H||(c.H=!0,e(!0,c.tag,c.R,c)));for(k in f)Object.prototype.hasOwnProperty.call(f,k)&&(c=h[k],c.H&&(c.H=!1,e(!1,c.tag,c.R,c)),c.Y&&(c.F=null,delete h[k]),delete f[k]);a.ea=!1;null!==a.D&&a.F()}
|
|
1015
1015
|
olympe.dc.lc.zm=class{constructor(){this.H={};this.ja=[];this.D=null;this.ea=!1;this.R=[];this.$=null}N(){return null!==this.D}Y(a){if(null!==this.D)throw Error('Manager already activated (depth='+this.D+')');this.D=a;this.F()}F(){if(null===this.D)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.H,d;for(d=this.R.length=0;d<b;d++){var e=c[a[d]];if(0>this.D)this.R.push(e.R);else{if(!e.$){var f=e,g=this.D;f.$=!0;f.F=Lm(f,g)}null!==
|
|
1016
|
-
e.F&&Km(e.F,this.R)}}this.$&&this.$(this.R)}}Ag(a){this.$=a}j(a,b,c){let d=this.H[c];a?void 0===d?(d=new Mm(this,c,b),this.H[c]=d):(d.tag=b,d.Y=!1):void 0!==d&&(d.Y=!0);return d}};olympe.dc.lc.zm.za=[olympe.dc.lc.Ua];olympe.dc.lc.Ua=class{constructor(){}j(){}N(){}Y(){}F(){}Ag(){}};function Om(a,b){olympe.C.qf(a.value)?(a.node=olympe.C.Rn(a.value,b),Tb(a.node)||b()):b()}function Pm(a,b){if(olympe.C.qf(a.value)){const c=olympe.C
|
|
1016
|
+
e.F&&Km(e.F,this.R)}}this.$&&this.$(this.R)}}Ag(a){this.$=a}j(a,b,c){let d=this.H[c];a?void 0===d?(d=new Mm(this,c,b),this.H[c]=d):(d.tag=b,d.Y=!1):void 0!==d&&(d.Y=!0);return d}};olympe.dc.lc.zm.za=[olympe.dc.lc.Ua];olympe.dc.lc.Ua=class{constructor(){}j(){}N(){}Y(){}F(){}Ag(){}};function Om(a,b){olympe.C.qf(a.value)?(a.node=olympe.C.Rn(a.value,b),Tb(a.node)||b()):b()}function Pm(a,b){if(olympe.C.qf(a.value)){const c=olympe.C.$a(),d=a.H;olympe.C.Vc([a.value],e=>{d!==e.valueOf()&&(c.run(()=>Om(a,b)),olympe.C.$a().destroy())})}}
|
|
1017
1017
|
class Qm extends olympe.dc.lc.gk{constructor(a,b,c){super(a);this.Y=b;this.value=c;this.H=this.Qa();this.position=this.node=null;this.R=!1;this.F=null}Qa(){const a=olympe.C.Qa(this.value);return a?a.valueOf():a}destroy(){this.node&&(this.node.destroy(),this.node=null);this.F=this.value=null}gb(){return null===this.value}}
|
|
1018
1018
|
function Rm(a,b){if(!b.gb()){var c=a.D;var d=a.ja,e=b.Qa(),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].H,e);if(0===k||2>g-f){0>k&&null!==b.position&&b.position<=h&&(k=d(c[g].H,e));h=0>k?g:h;break}0>k?f=h:g=h}c=h;b.H=b.Qa();if(c!==b.position){d=a.D;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.R&&a.F()}}}
|
|
1019
1019
|
function Sm(a){const b=a.ja;a.D.sort((c,d)=>b(c.Qa(),d.Qa()))}
|
|
@@ -1036,20 +1036,20 @@ olympe.dc.ba.tk=class{constructor(a,b){this.direction=b||olympe.dc.va.DESTINATIO
|
|
|
1036
1036
|
q,r,h,k||g);null===k&&b.register(y,q,r,h,f)}}},n=(p,q,r,t,v,x)=>{v&&!b.D&&l(p,t,x);p>=this.F?c(v,x,t,zm(r,v,x,t)):Wm(b,t,x,h,k);0<=this.D&&p>=this.D||(v?e[x]||(e[x]=!0,T(d,x,this,(y,z)=>{const A=p+1,K=olympe.V.ub(t+k+(h+'_'+A)+z,20);n(A,x,r,K,y,z)},t)):(d.D(x,this,t),delete e[x]))};return(p,q,r,t)=>n(0,null,t,r,p,q)}ga(){return'{"c":"'+this.la()+'","a":["'+this.X()+'","'+this.La()+'",'+this.F+','+this.D+']}'}toString(){return'RecursiveRelated('+this.La()+this.X()+'['+this.F+'..'+this.D+'])'}};
|
|
1037
1037
|
P('olympe.dc.transformers.RecursiveRelated',olympe.dc.ba.Ke);olympe.dc.ba.Ke.za=[olympe.dc.Kf];olympe.dc.ba.af=class extends olympe.dc.Sa.Relation{constructor(a,b){super(a,b||olympe.dc.va.DESTINATION)}Nb(){return hg(this)}la(){return Q(olympe.dc.ba.af)}$b(){return new olympe.dc.ba.af(this.tag,this.direction===olympe.dc.va.DESTINATION?olympe.dc.va.ORIGIN:olympe.dc.va.DESTINATION)}j(a,b,c){const d=olympe.dc.ha(),e=this.X(),f=this.La();return(g,h,k,l)=>{Wm(b,k,h,e,f);g?T(d,h,this,(n,p)=>{const q=olympe.V.ub(k+f+e+p,20),r=zm(l,n,p,q);n&&b.register(q,k,h,e,f);c(n,p,q,r)},k):d.D(h,this,k)}}ga(){return'{"c":"'+
|
|
1038
1038
|
this.la()+'","a":["'+this.X()+'","'+this.La()+'"]}'}toString(){return'Related('+this.La()+this.X()+')'}};P('olympe.dc.transformers.Related',olympe.dc.ba.af);olympe.dc.ba.af.za=[olympe.dc.Kf];olympe.dc.ba.bh=class{constructor(a,b){this.Hb=a;this.D=void 0===b?!0:!!b}Nb(){return null}la(){return Q(olympe.dc.ba.bh)}kh(){return this.Hb}F(){return[this.Hb.H()]}j(a,b,c){const d=new olympe.dc.lc.Tr(a.tc(this.D?this.Hb.compare.bind(this.Hb):(e,f)=>this.Hb.compare(f,e)));return(e,f,g)=>{var h=e?this.Hb.F(a,f):void 0;h=d.j(e,f,g,h);c(e,f,g,h)}}ga(a){return'{"c":"'+this.la()+'","a":['+this.Hb.ga(a)+','+JSON.stringify(this.D)+']}'}toString(){return'Sort('+this.Hb.toString()+','+JSON.stringify(this.D)+
|
|
1039
|
-
')'}};P('olympe.dc.transformers.Sort',olympe.dc.ba.bh);olympe.dc.ba.bh.za=[olympe.dc.Kf,olympe.dc.gr];function fn(a,b,c,d,e,f){function g(n,p){if(l)for(var q=l.length-1;0<=q;q--)f=l[q].j(b,e,f);e.register(h,null);q=d.j(n,p,c,null);f(n,p,h,zm(q,n,p,h))}const h=olympe.V.Kc(),k=olympe.dc.ha(),l=a.ba;b.run(()=>olympe.C.Vc([a.D],n=>{gn(k,n,g,h);void 0===k.model(n)&&um(e)}))}function gn(a,b,c,d){const e=b&&b.valueOf();e&&(Of(a,e,c,d),olympe.C
|
|
1040
|
-
olympe.dc.ba.Lf=class{constructor(a,b){this.ba=this.D=null;a instanceof olympe.dc.Aa?(this.D=a.ce(),this.ba=a.tm()):(this.D=a,b&&(this.ba=b))}Nb(){return null}la(){return Q(olympe.dc.ba.Lf)||''}qh(){return this.ba}ce(){return this.D}j(a,b,c){const d=new olympe.dc.lc.zm,e=new olympe.dc.lc.Vj;let f=[],g=[],h=!1,k=!1;const l=Ym(b),n=Ym(b);an(b,()=>{const p=f.concat(g);0<p.length?b.D||(b.j.j=p[p.length-1]):bn(b);Nm(d,p,0,p.length,c)});Xm(b,n);fn(this,a,this.D,e,b,(p,q,r,t)=>{const v=olympe.C
|
|
1039
|
+
')'}};P('olympe.dc.transformers.Sort',olympe.dc.ba.bh);olympe.dc.ba.bh.za=[olympe.dc.Kf,olympe.dc.gr];function fn(a,b,c,d,e,f){function g(n,p){if(l)for(var q=l.length-1;0<=q;q--)f=l[q].j(b,e,f);e.register(h,null);q=d.j(n,p,c,null);f(n,p,h,zm(q,n,p,h))}const h=olympe.V.Kc(),k=olympe.dc.ha(),l=a.ba;b.run(()=>olympe.C.Vc([a.D],n=>{gn(k,n,g,h);void 0===k.model(n)&&um(e)}))}function gn(a,b,c,d){const e=b&&b.valueOf();e&&(Of(a,e,c,d),olympe.C.$a().Yd(()=>Mf(a,e,d)))}
|
|
1040
|
+
olympe.dc.ba.Lf=class{constructor(a,b){this.ba=this.D=null;a instanceof olympe.dc.Aa?(this.D=a.ce(),this.ba=a.tm()):(this.D=a,b&&(this.ba=b))}Nb(){return null}la(){return Q(olympe.dc.ba.Lf)||''}qh(){return this.ba}ce(){return this.D}j(a,b,c){const d=new olympe.dc.lc.zm,e=new olympe.dc.lc.Vj;let f=[],g=[],h=!1,k=!1;const l=Ym(b),n=Ym(b);an(b,()=>{const p=f.concat(g);0<p.length?b.D||(b.j.j=p[p.length-1]):bn(b);Nm(d,p,0,p.length,c)});Xm(b,n);fn(this,a,this.D,e,b,(p,q,r,t)=>{const v=olympe.C.$a();v.jd()||
|
|
1041
1041
|
v.gb()||(k||(t.re().Ag(x=>{g=x;bn(b,n)}),xm(b,()=>t.pg(),n),k=!0),d.j(p,q,r),ym(b,r,n))});Xm(b,l);return(p,q,r,t)=>{h||(t.re().Ag(v=>{f=v;bn(b,l)}),xm(b,()=>t.pg(),l),h=!0);d.j(p,q,r,l);ym(b,r,l)}}ga(a){const b=this.ba?'['+this.ba.map(c=>c.ga(a)).join(',')+']':'null';return'{"c":"'+this.la()+'","a":['+Cm(a,this.D)+','+b+']}'}toString(){const a=olympe.C.hb(this.D)?'N:'+this.D.Ca.T():this.D.valueOf(),b=this.ba?','+this.ba.map(c=>c.toString()).join(','):'';return'Union('+a+b+')'}};
|
|
1042
1042
|
P('olympe.dc.transformers.Union',olympe.dc.ba.Lf);olympe.dc.ba.Lf.za=[olympe.dc.Kf];olympe.dc.ba.Ar={JB:1,Bu:-1,Au:0};olympe.dc.ba.mD={rA:!0,SA:!1};olympe.dc.kc.P={pq:'dc.legacy.listdefProcessor'};olympe.dc.kc.U={oq:'dc.legacy.listdefsCovered'};olympe.W.config(a=>{E(a,olympe.dc.kc.U.oq,!1);C(a,olympe.dc.kc.P.pq,olympe.dc.kc.uv,olympe.dc.query.P.Da,olympe.dc.P.Dh,olympe.dc.transaction.P.Ea,olympe.dc.query.P.Fk,new olympe.W.pa(olympe.dc.U.Zh),new olympe.W.pa(olympe.dc.kc.U.oq))});olympe.W.run([olympe.dc.kc.P.pq],a=>{olympe.dc.kc.By=()=>a});function hn(a){const b=olympe.dc.ha(),c=new Map;b.Ms(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}
|
|
1043
1043
|
olympe.dc.CloudObject=class{constructor(a,b){this.tag=b;this.db=olympe.dc.ha();Object.defineProperty(this,'db',{enumerable:!1});this.model=null;Object.defineProperties(this,{db:{enumerable:!1}})}static Rc(a,b,c,...d){b=olympe.dc.fa(b);var e=Qf(b);if(e=e&&e.j)return e(a,c,...d);a=a.create(b);void 0!==c&&null!==c&&X(a,olympe.dc.CloudObject.nameProp,c);return a.X()}static get(a){if(a instanceof olympe.dc.CloudObject)var b=a;else{b=olympe.dc.Ps();a=olympe.dc.fa(a);var c=b.db.model(a);c=Pf(b,c);if(null===
|
|
1044
|
-
c)throw new olympe.dc.Uq(a);c=c.instantiate(a,b.D);b.j.oe([a],olympe.dc.db.Instance.j.Zp);b.Sa.register(c,a);b=c}return b}static exists(a){return olympe.dc.ha().Ja(olympe.dc.fa(a))}static Ex(a,b,c){const d=olympe.dc.ha();let e=null;const f=k=>{null===e&&(e=hn(b||this));return e.has(k)?e.get(k):null},g=Yl(!1),h=g.create(null!=b?b:this);void 0!==c&&h.zi(c);a.forEach((k,l)=>{d.Ja(olympe.dc.fa(l))?X(h,l,k):(l=f(l))&&X(h,l,k)});g.ob((k,l)=>{k||olympe.ia
|
|
1044
|
+
c)throw new olympe.dc.Uq(a);c=c.instantiate(a,b.D);b.j.oe([a],olympe.dc.db.Instance.j.Zp);b.Sa.register(c,a);b=c}return b}static exists(a){return olympe.dc.ha().Ja(olympe.dc.fa(a))}static Ex(a,b,c){const d=olympe.dc.ha();let e=null;const f=k=>{null===e&&(e=hn(b||this));return e.has(k)?e.get(k):null},g=Yl(!1),h=g.create(null!=b?b:this);void 0!==c&&h.zi(c);a.forEach((k,l)=>{d.Ja(olympe.dc.fa(l))?X(h,l,k):(l=f(l))&&X(h,l,k)});g.ob((k,l)=>{k||olympe.ia.Ya('dc').error(`Error occurred for transaction executed by CloudObject.createWith: ${l}`)});
|
|
1045
1045
|
return this.get(h)}static nx(){return this.get(this)}static pl(a){return olympe.dc.ma.pl(a)}static Cb(){return olympe.dc.ha().cb(this,olympe.dc.CloudObject.propertyRel).map(a=>new olympe.dc.Sa.Property(a))}static Jd(){const a=olympe.dc.ha();return a.cb(this,olympe.dc.CloudObject.Kj).map(b=>new olympe.dc.Sa.Relation(b)).concat(a.cb(this,olympe.dc.CloudObject.Fs).map(b=>new olympe.dc.Sa.Relation(b,olympe.dc.va.ORIGIN)))}static Tc(a){return olympe.dc.CloudObject.get(a)}static Qs(a){var b=Pf(olympe.dc.Ps(),
|
|
1046
1046
|
olympe.dc.fa(a));b=b&&b.D;return new olympe.dc.Aa(olympe.dc.fa(a),olympe.dc.CloudObject.instancesRel,b)}X(){return this.tag}name(){return this.db.name(this)}la(){return this.wb(olympe.dc.CloudObject.nameProp)}Vb(){this.model||(this.model=olympe.dc.CloudObject.get(this.db.model(this)));return this.model}query(){return olympe.dc.ma.from(this)}Re(){return this.db.Re(this)}jb(){return this.db.source(this)}yy(){return this.db.wi(this)?olympe.dc.fe().fromModel(this):null}Ls(){return olympe.C.ua([this.la()],
|
|
1047
1047
|
a=>olympe.C.xb(a),olympe.C.Ta,'getDisplayName',olympe.C.xb('('+this.toString()+')'))}ac(){return this.model?this.model.X():this.db.model(this)}observe(a,b,c=!0){const d='function'===typeof a.Bb?a.Bb():a;return new rxjs.Observable(e=>{const f=olympe.dc.nb.Cc(this.db.Ra(this.tag,b));c||null!==f||e.next(f);const g=gh(this.db,this.tag,b,h=>{e.next(olympe.dc.nb.Cc(h))});d.Yd(()=>{e.complete();hh(this.db,this.tag,b,g)});return()=>hh(this.db,this.tag,b,g)})}Fz(a){const b='function'===typeof a.Bb?a.Bb():
|
|
1048
|
-
a;return new rxjs.Observable(c=>{const d=ih(this.db,this.tag,(e,f)=>{null===f||void 0===f?c.next([new olympe.dc.Sa.Property(e),null]):c.next([new olympe.dc.Sa.Property(e),f])});b.Yd(()=>{c.complete();jh(this.db,this.tag,d)});return()=>jh(this.db,this.tag,d)})}Gz(a){return this.observe(olympe.C
|
|
1049
|
-
olympe.dc.CloudObject)}Cn(){return this.cb(olympe.dc.CloudObject.containsRel,olympe.dc.CloudObject)}Tf(a,b,c){const d=olympe.C.cc(c,'Sync valueType'),e=gh(this.db,this.tag,a,olympe.C
|
|
1050
|
-
olympe.C.da))}Dj(a){return M(this.Tf(a,olympe.dc.nb.rn,olympe.C.eb))}Us(){return M(this.Tf(olympe.dm.Color.valueProp,olympe.dc.nb.ys,olympe.C.Color))}Vs(){return M(this.Tf(olympe.sc.workflow.Transition.processRefProp,olympe.dc.nb.zs,olympe.dc.CloudObject))}cb(a,b){a=a instanceof olympe.dc.ba.af?a:new olympe.dc.ba.af(a.X(),a.La());return new olympe.dc.Aa(this.X(),a,b)}Sc(a,b){return this.cb(a,b).Ic()}Is(a,b){const c=this.db,d=olympe.V.Kc(),e=olympe.C
|
|
1048
|
+
a;return new rxjs.Observable(c=>{const d=ih(this.db,this.tag,(e,f)=>{null===f||void 0===f?c.next([new olympe.dc.Sa.Property(e),null]):c.next([new olympe.dc.Sa.Property(e),f])});b.Yd(()=>{c.complete();jh(this.db,this.tag,d)});return()=>jh(this.db,this.tag,d)})}Gz(a){return this.observe(olympe.C.$a(),a)}get(a){return olympe.dc.nb.Cc(this.db.Ra(this.tag,a))}Ra(a){return this.get(a)}fb(a){return olympe.dc.ma.from(this).fb(a)}wg(a){return olympe.dc.sd.from(this).fb(a)}Cc(){return this}gy(){return this.Sc(olympe.dc.CloudObject.Ax,
|
|
1049
|
+
olympe.dc.CloudObject)}Cn(){return this.cb(olympe.dc.CloudObject.containsRel,olympe.dc.CloudObject)}Tf(a,b,c){const d=olympe.C.cc(c,'Sync valueType'),e=gh(this.db,this.tag,a,olympe.C.$a().tc(f=>{b&&null!==f&&void 0!==f&&(f=b(f));null===f||void 0===f?d.clear():d.update(f)}));d.getContext().onDestroy(()=>hh(this.db,this.tag,a,e));return d.getContext()}wb(a){return M(this.Tf(a,olympe.dc.nb.tn,olympe.C.Ta))}yd(a){return M(this.Tf(a,olympe.dc.nb.sn,olympe.C.aa))}nh(a){return M(this.Tf(a,olympe.dc.nb.qn,
|
|
1050
|
+
olympe.C.da))}Dj(a){return M(this.Tf(a,olympe.dc.nb.rn,olympe.C.eb))}Us(){return M(this.Tf(olympe.dm.Color.valueProp,olympe.dc.nb.ys,olympe.C.Color))}Vs(){return M(this.Tf(olympe.sc.workflow.Transition.processRefProp,olympe.dc.nb.zs,olympe.dc.CloudObject))}cb(a,b){a=a instanceof olympe.dc.ba.af?a:new olympe.dc.ba.af(a.X(),a.La());return new olympe.dc.Aa(this.X(),a,b)}Sc(a,b){return this.cb(a,b).Ic()}Is(a,b){const c=this.db,d=olympe.V.Kc(),e=olympe.C.$a(),f=new Map;T(c,this.tag,a,(g,h)=>{if(g)(g=e.run(b,
|
|
1051
1051
|
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.D(this.tag,a,d)})}jA(){return new olympe.dc.Aa(this.X(),[],fg(this.X()))}transform(...a){return(new olympe.dc.Aa(this.X(),[],this.constructor)).transform(...a)}Wc(){return this.Ls()}toString(){return`CloudObject: ${JSON.stringify(this)}`}toJSON(){return this.db.Ja(this.tag)?Object.assign({'#tag':this.X(),'#type':this.Vb().name()},this.Xc(!0,!0)):{'#tag':this.X(),'#error':'The object does not exist in the local database.'}}Xc(a=
|
|
1052
|
-
!1,b=!0){const c={};this.db.Cb(this,b).forEach((d,e)=>{this.db.Ja(e)&&(e=a?this.db.name(e):e,c[e]=olympe.dc.nb.Cc(d))});return c}Fa(a){return a instanceof olympe.dc.CloudObject?this.X()===a.X():'function'===typeof a?olympe.dc.na.ac(a)===this.X():!1}Kd(a){return olympe.C.ua([a],b=>olympe.C.Sb(this.Fa(b)),olympe.C.da)}Hx(a){const b=this.db;let c=!1;if(void 0===a||null===a)a=new olympe.dc.
|
|
1052
|
+
!1,b=!0){const c={};this.db.Cb(this,b).forEach((d,e)=>{this.db.Ja(e)&&(e=a?this.db.name(e):e,c[e]=olympe.dc.nb.Cc(d))});return c}Fa(a){return a instanceof olympe.dc.CloudObject?this.X()===a.X():'function'===typeof a?olympe.dc.na.ac(a)===this.X():!1}Kd(a){return olympe.C.ua([a],b=>olympe.C.Sb(this.Fa(b)),olympe.C.da)}Hx(a){const b=this.db;let c=!1;if(void 0===a||null===a)a=new olympe.dc.Za,c=!0;const d=olympe.dc.va.ORIGIN;for(const [e,f,g]of th(b,this))f===d?a.ic(e,g,this):e!==olympe.dc.CloudObject.modelRel.X()&&
|
|
1053
1053
|
a.ic(e,this,g);a.delete(this,olympe.dc.Mb.NONE);c&&a.ob()}};olympe.dc.CloudObject.prototype.equals=olympe.dc.CloudObject.prototype.Fa;olympe.dc.CloudObject.prototype.toObject=olympe.dc.CloudObject.prototype.Xc;olympe.dc.CloudObject.prototype.followSingle=olympe.dc.CloudObject.prototype.wg;olympe.dc.CloudObject.prototype.follow=olympe.dc.CloudObject.prototype.fb;olympe.dc.CloudObject.prototype.getProperty=olympe.dc.CloudObject.prototype.Ra;olympe.dc.CloudObject.prototype.get=olympe.dc.CloudObject.prototype.get;
|
|
1054
1054
|
olympe.dc.CloudObject.prototype.observeProperty=olympe.dc.CloudObject.prototype.Gz;olympe.dc.CloudObject.prototype.observeProperties=olympe.dc.CloudObject.prototype.Fz;olympe.dc.CloudObject.prototype.observe=olympe.dc.CloudObject.prototype.observe;olympe.dc.CloudObject.prototype.getModelTag=olympe.dc.CloudObject.prototype.ac;olympe.dc.CloudObject.prototype.getSource=olympe.dc.CloudObject.prototype.jb;olympe.dc.CloudObject.prototype.isPersisted=olympe.dc.CloudObject.prototype.Re;
|
|
1055
1055
|
olympe.dc.CloudObject.prototype.query=olympe.dc.CloudObject.prototype.query;olympe.dc.CloudObject.prototype.getModel=olympe.dc.CloudObject.prototype.Vb;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.Qs;olympe.dc.CloudObject.getInstance=olympe.dc.CloudObject.Tc;olympe.dc.CloudObject.getRelations=olympe.dc.CloudObject.Jd;
|
|
@@ -1072,7 +1072,7 @@ olympe.dm.BrickMetadata.Ub={dB:'experimental',UC:'stable',RA:'deprecated'};olymp
|
|
|
1072
1072
|
function Oj(a,b){const c=a.query().fb(olympe.dm.Bd.j.$b()).fb(olympe.dm.Bd.D);a=a.query().fb(olympe.dm.ib.D.$b()).vg(olympe.dm.ib.F,!0).fb(olympe.sc.Ac.j.$b());const d=e=>e.ne().vg(olympe.dc.CloudObject.extendRel,!0).fb(olympe.dc.CloudObject.Kj,!0).fb(olympe.dm.Relation.destinationModelRel).back(2).fb(olympe.dc.CloudObject.propertyRel,!0).fb(olympe.dm.Property.typeRel).observe(b);return rxjs.combineLatest([d(c),d(a)]).pipe(rxjs.operators.map(([e,...f])=>e.concat(...f)))}
|
|
1073
1073
|
function ok(a,b){return a.observe(b,olympe.dm.DataSource.As).pipe(rxjs.operators.map(()=>a.Pf(olympe.dc.sources.U.We)),rxjs.operators.distinctUntilChanged())}
|
|
1074
1074
|
olympe.dm.DataSource=class extends olympe.dc.CloudObject{constructor(a,b,c){super(a,b);this.Kb=c;this.Cs=new Map([[olympe.dc.sources.U.Mm,olympe.dm.DataSource.Sz],[olympe.dc.sources.U.We,olympe.dm.DataSource.As],[olympe.dc.sources.U.Tm,olympe.dm.DataSource.Yz]])}T(){return this.tag===olympe.dm.DataSource.SERVER?olympe.dc.Ia.SERVER:this.tag}Pf(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,
|
|
1075
|
-
'_')}.${b}`))?d:uj(this.X(),a))?e:this.Cs.has(c)?this.get(this.Cs.get(c)):null}Jc(){const a=this;return u(function*(){const b=olympe.dm.DataSource.pc.eu,c=olympe.dm.DataSource.pc.zb,d=new olympe.dc.Request(olympe.dc.Request.j.pc,a.T());return a.Kb.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.ia
|
|
1075
|
+
'_')}.${b}`))?d:uj(this.X(),a))?e:this.Cs.has(c)?this.get(this.Cs.get(c)):null}Jc(){const a=this;return u(function*(){const b=olympe.dm.DataSource.pc.eu,c=olympe.dm.DataSource.pc.zb,d=new olympe.dc.Request(olympe.dc.Request.j.pc,a.T());return a.Kb.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.ia.Ya('dc').warn(`Source ${a.name()} (${a.T()}) has encountered issues: ${e}`);return g}).catch(e=>e instanceof olympe.error.Vk||e instanceof olympe.error.Dm?
|
|
1076
1076
|
b:c)})}init(){const a=this;return u(function*(){if(a.constructor===olympe.dm.DataSource)throw Error(`Data source ${a.name()} (${a.tag}) has no implementation (is the file missing ?)`);})}destroy(){return u(function*(){})}healthCheck(){return u(function*(){})}executeQuery(a){return u(function*(){return olympe.dc.query.Ed.xj(a)})}applyTransaction(){return u(function*(){})}uploadFileContent(){return u(function*(){throw Error('Should not try to upload files with SELF source');})}downloadFileContent(){return u(function*(){throw Error('Should not try to download files with SELF source');
|
|
1077
1077
|
})}deleteFileContent(){return u(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;
|
|
1078
1078
|
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.Pf;olympe.dm.DataSource.prototype.getId=olympe.dm.DataSource.prototype.T;olympe.dm.DataSource.O=olympe.dc.na.j('ff021000000000000060',olympe.dm.DataSource,olympe.dc.P.Vg);
|
|
@@ -1082,10 +1082,10 @@ olympe.dm.Lb.H=olympe.dm.Lb.O.sa('016a697ef00ce7554692');R(olympe.dc.CloudObject
|
|
|
1082
1082
|
olympe.dm.Oc.Pc=eg('10000000000000000002','INTERNAL_FOLDER');olympe.dm.Oc.prototype.j.K=new olympe.C.J(()=>olympe.dc.Aa,[]);olympe.dm.Module=class extends olympe.dc.CloudObject{uy(){return this.wb(olympe.dm.Module.N)}Fy(){return this.yd(olympe.dm.Module.R)}Xu(){return this.wb(olympe.dm.Module.D)}Jy(){return this.wb(olympe.dm.Module.Y)}by(){return this.wb(olympe.dm.Module.F)}Gy(){return this.cb(olympe.dm.Module.H,olympe.dm.Module)}Ry(){return this.cb(olympe.dm.Module.j,olympe.dm.Qd)}};olympe.dm.Module.O=olympe.dc.na.j('ff021000000000000040',olympe.dm.Module);olympe.dm.Module.N=olympe.dm.Module.O.ka('ff023000000000000042');
|
|
1083
1083
|
olympe.dm.Module.R=olympe.dm.Module.O.ka('ff023000000000000043');olympe.dm.Module.D=olympe.dm.Module.O.ka('ff023000000000000044');olympe.dm.Module.Y=olympe.dm.Module.O.ka('ff023000000000000045');olympe.dm.Module.F=olympe.dm.Module.O.ka('ff023000000000000046');olympe.dm.Module.creationDateProp=olympe.dm.Module.O.ka('ff023000000000000049');olympe.dm.Module.j=olympe.dm.Module.O.sa('ff022000000000000013');olympe.dm.Module.H=olympe.dm.Module.O.sa('ff022000000000000014');
|
|
1084
1084
|
olympe.dm.Module.$=eg('016a69b9bceabd815b77','OLYMPE_SERVER_MODULE');m=olympe.dm.Module.prototype;m.uy.K=olympe.C.J.D;m.Fy.K=olympe.C.J.F;m.Xu.K=olympe.C.J.D;m.Jy.K=olympe.C.J.D;m.by.K=olympe.C.J.D;m.Gy.K=new olympe.C.J(()=>olympe.dc.Aa,[]);m.Ry.K=new olympe.C.J(()=>olympe.dc.Aa,[]);olympe.dm.File=class extends olympe.dc.CloudObject{static D(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.fe().fromModel(a);a=b.create(a,f).zi(g);b=olympe.C.eb.now();X(X(X(X(X(X(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.j,!1);return a.X()}constructor(a,b,c,d,e){super(a,
|
|
1085
|
-
b);this.j=c;this.F=d;this.D=e}Rs(){return this.wb(olympe.dm.File.mimeTypeProp)}gl(a,b){void 0===a&&void 0===b||olympe.ia
|
|
1086
|
-
void 0===b||olympe.ia
|
|
1087
|
-
olympe.C
|
|
1088
|
-
null==d||d(a);return Promise.reject(Error(a))}rename(a,b){const c=b&&olympe.C
|
|
1085
|
+
b);this.j=c;this.F=d;this.D=e}Rs(){return this.wb(olympe.dm.File.mimeTypeProp)}gl(a,b){void 0===a&&void 0===b||olympe.ia.Ya('File.getContentAsBinary').warn('"onSuccess" and "onFailure" callbacks are deprecated in favor of the returned promise');const c=a&&olympe.C.$a().tc(a),d=b&&olympe.C.$a().tc(e=>null==b?void 0:b(`${e}`));return this.j.H(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;})}Bn(a,b){void 0===a&&
|
|
1086
|
+
void 0===b||olympe.ia.Ya('File.getContentAsString').warn('"onSuccess" and "onFailure" callbacks are deprecated in favor of the returned promise');const c=a&&olympe.C.$a().tc(a),d=b&&olympe.C.$a().tc(e=>null==b?void 0:b(`${e}`));return this.gl().then(e=>{e=cb(e);null==c||c(e);return e}).catch(e=>{null==d||d(e.message);throw e;})}hl(a,b){void 0===a&&void 0===b||olympe.ia.Ya('File.getContentUrl').warn('"onSuccess" and "onFailure" callbacks are deprecated in favor of the returned promise');const c=a&&
|
|
1087
|
+
olympe.C.$a().tc(a),d=b&&olympe.C.$a().tc(g=>null==b?void 0:b(`${g}`));a=this.get(olympe.dm.File.j);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.j.H(this).then(g=>{g=`data:${f};base64,${this.D.j(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()}`;
|
|
1088
|
+
null==d||d(a);return Promise.reject(Error(a))}rename(a,b){const c=b&&olympe.C.$a().tc(b);olympe.C.jt([a],d=>{const e=new olympe.dc.Za;e.update(this,olympe.dc.CloudObject.nameProp,d);e.update(this,olympe.dm.File.fileNameProp,d);e.ob(f=>{c&&c(f)})})}pt(a){this.get(olympe.dm.File.urlProp).startsWith('stream:')?this.j.Y(this.tag).then(()=>this.pt(a)).catch(b=>this.G.error(`Error while getting the content of a streamed file: ${b}`)):this.F.H(this.get(olympe.dm.File.mimeTypeProp))}lq(){return this.wb(olympe.dm.File.urlProp)}kq(){return this.wb(olympe.dm.File.fileNameProp)}iy(){return this.Dj(olympe.dm.File.creationDateProp)}Ey(){return this.Dj(olympe.dm.File.modificationDateProp)}jz(){return this.nh(olympe.dm.File.j)}};
|
|
1089
1089
|
olympe.dm.File.prototype.saveAs=olympe.dm.File.prototype.pt;olympe.dm.File.prototype.getContentUrl=olympe.dm.File.prototype.hl;olympe.dm.File.prototype.getContentAsString=olympe.dm.File.prototype.Bn;olympe.dm.File.prototype.getContentAsBinary=olympe.dm.File.prototype.gl;olympe.dm.File.O=olympe.dc.na.j('ff021000000000000030',olympe.dm.File,olympe.dc.P.hk,olympe.net.P.Ea,olympe.V.P.Eg);olympe.dm.File.nameProp=olympe.dm.File.O.ka('ff023000000000000050');w('olympe.dm.File.nameProp',olympe.dm.File.nameProp);
|
|
1090
1090
|
olympe.dm.File.fileNameProp=olympe.dm.File.O.ka('ff023000000000000050');w('olympe.dm.File.fileNameProp',olympe.dm.File.fileNameProp);olympe.dm.File.creationDateProp=olympe.dm.File.O.ka('ff023000000000000051');w('olympe.dm.File.creationDateProp',olympe.dm.File.creationDateProp);olympe.dm.File.modificationDateProp=olympe.dm.File.O.ka('ff023000000000000055');w('olympe.dm.File.modificationDateProp',olympe.dm.File.modificationDateProp);olympe.dm.File.mimeTypeProp=olympe.dm.File.O.ka('ff023000000000000052');
|
|
1091
1091
|
w('olympe.dm.File.mimeTypeProp',olympe.dm.File.mimeTypeProp);olympe.dm.File.urlProp=olympe.dm.File.O.ka('ff023000000000000053');w('olympe.dm.File.urlProp',olympe.dm.File.urlProp);olympe.dm.File.j=olympe.dm.File.O.ka('ff023000000000000054');olympe.dm.File.O.j=olympe.dm.File.D.bind(null,olympe.dm.File);olympe.dm.File.N='application/data';olympe.dm.File.za=[olympe.C.File];m=olympe.dm.File.prototype;m.Rs.K=olympe.C.J.D;m.gl.K=olympe.C.J.j;m.Bn.K=olympe.C.J.j;m.hl.K=olympe.C.J.j;m.rename.K=olympe.C.J.j;
|
|
@@ -1101,10 +1101,10 @@ olympe.dm.Ie.O=olympe.dc.na.j('ff021000000000000019',olympe.dm.Ie);olympe.dm.Str
|
|
|
1101
1101
|
olympe.dm.String.prototype.toString.K=olympe.C.J.j;olympe.dm.Boolean=class extends olympe.dm.Ie{getValue(){return this.nh(olympe.dm.Boolean.valueProp)}Cc(){return this.get(olympe.dm.Boolean.valueProp)}};olympe.dm.Boolean.O=olympe.dc.na.j('ff021000000000000012',olympe.dm.Boolean);olympe.dm.Boolean.valueProp=olympe.dm.Boolean.O.ka('ff023000000000000027');w('olympe.dm.Boolean.valueProp',olympe.dm.Boolean.valueProp);olympe.dm.Boolean.prototype.getValue.K=olympe.C.J.N;olympe.dm.Color=class extends olympe.dm.Ie{getValue(){return this.Us()}Cc(){return this.get(olympe.dm.Color.valueProp)}};olympe.dm.Color.O=olympe.dc.na.j('ff021000000000000017',olympe.dm.Color);olympe.dm.Color.valueProp=olympe.dm.Color.O.ka('ff023000000000000032');w('olympe.dm.Color.valueProp',olympe.dm.Color.valueProp);olympe.dm.Color.prototype.getValue.K=new olympe.C.J(()=>olympe.C.Color,[]);olympe.dm.DateTime=class extends olympe.dm.Ie{getValue(){return this.Dj(olympe.dm.DateTime.valueProp)}Cc(){return this.get(olympe.dm.DateTime.valueProp)}};olympe.dm.DateTime.O=olympe.dc.na.j('ff021000000000000014',olympe.dm.DateTime);olympe.dm.DateTime.valueProp=olympe.dm.DateTime.O.ka('ff023000000000000029');w('olympe.dm.DateTime.valueProp',olympe.dm.DateTime.valueProp);olympe.dm.DateTime.prototype.getValue.K=new olympe.C.J(()=>olympe.C.eb,[]);olympe.dm.Enum=class extends olympe.dm.String{la(){return olympe.C.ua([super.la(),super.getValue()],(a,b)=>''!==a.valueOf()?a:b,olympe.C.Ta)}Id(){return this.yd(olympe.dm.Enum.rankProp)}};olympe.dm.Enum.O=olympe.dc.na.j('016cdd861b32d56c81f7',olympe.dm.Enum);olympe.dm.Enum.rankProp=olympe.dm.Enum.O.ka('017a7690c915975ea995');olympe.dm.Enum.prototype.Id.K=olympe.C.J.F;olympe.dm.gg=class extends olympe.dm.BrickMetadata{Yy(){return this.fb(olympe.dc.CloudObject.instancesRel).xl(olympe.dm.Enum.rankProp,olympe.dc.query.Bk.ASC).Hc()}static create(a,b){b=a.create(olympe.dm.gg,(new Map).set(olympe.dc.CloudObject.nameProp,b));a.Pa(olympe.dc.CloudObject.extendRel,b,olympe.dm.Enum);return b}};olympe.dm.gg.create=olympe.dm.gg.create;olympe.dm.gg.prototype.getValues=olympe.dm.gg.prototype.Yy;olympe.dm.gg.O=olympe.dc.na.j('017a768f966fc08ebb98',olympe.dm.gg);olympe.dm.Number=class extends olympe.dm.Ie{getValue(){return this.yd(olympe.dm.Number.valueProp)}Cc(){return this.get(olympe.dm.Number.valueProp)}};olympe.dm.Number.O=olympe.dc.na.j('ff021000000000000013',olympe.dm.Number);olympe.dm.Number.valueProp=olympe.dm.Number.O.ka('ff023000000000000028');w('olympe.dm.Number.valueProp',olympe.dm.Number.valueProp);olympe.dm.Number.prototype.getValue.K=olympe.C.J.F;olympe.sc={};olympe.sc.P={Da:'sc.Logger',Kk:'sc.RootContext',Le:'sc.Serializer'};olympe.sc.U={Ve:'sc.app',bg:'sc.debug',jo:'sc.autostartProfiler',bp:'sc.debugger',cu:'sc.disableTheme',PRODUCTION:'sc.production',Kv:'sc.onstartTimeout',qr:'sc.remoteActionTimeout'};
|
|
1102
1102
|
olympe.W.config(a=>{E(a,olympe.sc.U.Ve,'');E(a,olympe.sc.U.bg,!1);E(a,olympe.sc.U.cu,!0);E(a,olympe.sc.U.PRODUCTION,!1);E(a,olympe.sc.U.Kv,2E4);E(a,olympe.sc.U.qr,3E4);E(a,olympe.sc.U.jo,!1);D(a,olympe.sc.P.Da,[olympe.ia.P.Ea],b=>b.cd('sc'));C(a,olympe.sc.P.Le,olympe.sc.ec,olympe.dc.db.P.Ea);Xa(a,olympe.dc.sources.P.Le,olympe.sc.P.Le);D(a,olympe.sc.P.Kk,[new olympe.W.pa(olympe.sc.U.PRODUCTION)],b=>{const c=new olympe.sc.Gg('root','root',null);olympe.sc.Tn=c;c.set(olympe.sc.ya.j.PRODUCTION,b);return new olympe.sc.ya(c)})},
|
|
1103
1103
|
'olympe.sc');olympe.W.run([olympe.sc.P.Kk,new olympe.W.pa(olympe.L.U.Ol)],(a,b)=>{olympe.ee().ctx=a;olympe.ee().oVersion=()=>b});olympe.sc.Nn=()=>null!==olympe.dc.ha().Jb(void 0,olympe.sc.Runnable.j.$b());olympe.sc.NE=(a,b,c,d)=>{c=X(X(a.create(olympe.sc.hd),olympe.sc.hd.j,c||null),olympe.sc.hd.F,d||null);a.Pa(olympe.sc.hd.D,c,b);a.Pa(olympe.dc.CloudObject.containsRel,b,c);return c.X()};olympe.sc.tj=(a,b)=>{a=olympe.dc.nb.Zx(b)(a);return a instanceof olympe.sc.Ud?a.j():a};
|
|
1104
|
-
olympe.sc.eF=function(a){const b=olympe.dc.CloudObject.containsRel.$b();var c=olympe.dc.fa(a);if(void 0===c)return[];a=olympe.dc.ha();const d=[];let e=[];const f=new Set;for(;!a.Ob(c,olympe.dm.Lb);){f.add(c);const g=a.Jb(c,b);if(null===g)return olympe.ia
|
|
1104
|
+
olympe.sc.eF=function(a){const b=olympe.dc.CloudObject.containsRel.$b();var c=olympe.dc.fa(a);if(void 0===c)return[];a=olympe.dc.ha();const d=[];let e=[];const f=new Set;for(;!a.Ob(c,olympe.dm.Lb);){f.add(c);const g=a.Jb(c,b);if(null===g)return olympe.ia.Ya('sc').warn(`Object ${c} has no container`),[];a.Ob(c,olympe.sc.logic.qb)||g===a.Jb(c,olympe.sc.Runnable.j.$b())||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.oh(e[0],
|
|
1105
1105
|
olympe.dm.Lb.ja));e=e.concat(a.oh(e[e.length-1],olympe.dm.Oc.R.$b()));e=e.concat(a.oh(e[e.length-1],olympe.dm.Oc.N.$b()));return[...d,...e].reverse()};olympe.sc.fF=a=>{a=a&&a.valueOf()||'';return a.startsWith('image/')?olympe.sc.Lg:a.startsWith('video/')?olympe.sc.ci:a.startsWith('font/')||a.startsWith('application/font-woff')?olympe.sc.Mc:olympe.dm.File};
|
|
1106
1106
|
olympe.sc.dF=a=>a instanceof olympe.sc.Lg?'image/*':a instanceof olympe.sc.ci?'video/*':a instanceof olympe.sc.Mc?'font/*,application/font-woff':null;olympe.sc.ab={};function kn(a,b){var c=olympe.sc.ya,d=a.state;a=a.Bb();b=olympe.dc.fa(b);let e,f=null==(e=d.j)?void 0:e.get(b);if(!f){f=d.ki(a,void 0,b);for(d=f.getParent();d&&d.ja&&!d.id.startsWith('_');)d=d.getParent();let g;null==(g=d)||ln(g,b,f)}return new c(f)}function mn(a,b){let c,d;return(a=null!=(d=null==(c=a.state.j)?void 0:c.get(olympe.dc.fa(b)))?d:null)?new olympe.sc.ya(a):null}function nn(a){let b;return null!=(b=a.Qa(olympe.sc.ya.j.PRODUCTION))?b:!1}
|
|
1107
|
-
olympe.sc.ya=class{constructor(a=olympe.sc.Tn){this.state=a;this.G=olympe.ia
|
|
1107
|
+
olympe.sc.ya=class{constructor(a=olympe.sc.Tn){this.state=a;this.G=olympe.ia.Ya('sc');this.j=null}T(){return this.state.T()}getParent(){if(null===this.j){const a=this.state.getParent();this.j=null===a?null:new olympe.sc.ya(a)}return this.j}$x(a){const b=olympe.dc.ha();let c=this.getParent();if(!c)return this;const d=e=>{e=e.lf();if('string'!==typeof e)return!1;const f=b.model(e);return f&&b.Ra(f,olympe.sc.Xa.$)||a.modelTag&&!b.Ob(e,a.modelTag)?!1:!0};for(;c&&!d(c);){const e=c.getParent();if(!e)break;
|
|
1108
1108
|
c=e}return c}lf(){return this.state.lf()}Bb(){return this.state.Bb()}set(a,b){this.state.set(a,b);return this}co(a){return this.set(a,Date.now())}remove(a){this.set(a,null)}tb(a,b,c=!1){const d=olympe.dc.fa(a),e=olympe.C.cc(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.state.T():void 0));return e.tb()}get(a,b=!1){a=this.Qa(a,b);return void 0!==a?a:null}has(a,b=!1){return this.state.has(a,b)}observe(a,b=!0,c=
|
|
1109
1109
|
!1){return new rxjs.Observable(d=>{const e=this.get(a);b||null!==e||d.next(e);const f=this.on(a,d.next.bind(d),c?void 0:this.state.T(),!1);this.onDestroy(()=>{f();d.complete()});return f})}repeat(a,b){const c=on(this.state,a);a=b.subscribe(d=>{null!==d?this.set(c,d):this.remove(c)});this.wh(a.unsubscribe.bind(a));return this}$z(a){a=a instanceof olympe.sc.Runnable?a:this.get(a);if(!a)return null;const b=this.ki(`Runner ${a.name()}`);a.run(b);return b}zt(a,b=!0,c=!1){return new Promise((d,e)=>{this.observe(a,
|
|
1110
1110
|
b,c).pipe(rxjs.operators.first()).subscribe(rxjs.Subscriber.create(d,f=>{let g=`An error occurred while calling \`waitFor(${olympe.dc.fa(a)})\``+`on the context ${this.T()}:\nStack: ${this.se()}\n${f}`;f instanceof rxjs.EmptyError&&(g=`The context ${this.T()} has been destroyed while a Promise `+`created from a call to \`waitFor(${olympe.dc.fa(a)})\` `+`has never received any value:\nStack: ${this.se()}`);e(Error(g))}))})}throw(a){var b=a instanceof Error?a.message:String(a);if(a instanceof Error){var c;
|
|
@@ -1121,14 +1121,14 @@ function An(a){a.D.Yd(()=>{yn(a,c=>c.destroy())});a.D.onDestroy(()=>{void 0!==a.
|
|
|
1121
1121
|
function wn(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=wn(c.j,b)))return a;return null}function Cn(a,b,...c){if(null!==a.ab)for(const {vl:d,depth:e}of a.ab.values())d.process(a,b,e,...c)}function Dn(a,b){a.ea=olympe.dc.fa(b);a.ja=b.xd().Nn();b.H().forEach(c=>{a.id===c||a.R.has(c)||(a.R.add(c),ln(a,c,a))});a.$=b.D();Cn(a,olympe.sc.ab.qc.j.INIT)}function En(a){a.ta=!0;let b;null==(b=a.j)||b.forEach(c=>{En(c)})}
|
|
1122
1122
|
function Fn(a){a.ta=!1;let b;null==(b=a.j)||b.forEach(c=>{Fn(c)})}function vn(a,b){return['*',a.id,...a.R].map(c=>`${'@'}${c}.${b}`)}function Gn(a,b,c,d){c.forEach(f=>{let g,h;null==(g=a.F)||null==(h=g.get(f))||h.forEach(k=>{k(d)})});let e;null==(e=a.j)||e.forEach(f=>{!f.ta&&f.data.has(b)||Gn(f,b,c,d)})}function Hn(a,b,c){a.F||(a.F=new Map);let d=a.F.get(b);void 0===d&&(d=new Map,a.F.set(b,d));tn++;const e=tn;d.set(e,c);return()=>{const f=a.F.get(b);f&&(f.delete(e),0===f.size&&a.F.delete(b))}}
|
|
1123
1123
|
function ln(a,b,c){a.N.add(b);let d,e;null==(d=a.F)||null==(e=d.get('&'+b))||e.forEach(f=>{f(c)});yn(a,f=>{f.N.has(b)||ln(f,b,c)});a.N.delete(b)}function yn(a,b){let c;null==(c=a.j)||c.forEach(b)}function In(a,b){a.data.forEach((c,d)=>b(c,d.slice(1)))}function Jn(a){var b=olympe.sc.ab.qc.D.$e;const c=[];if(null!==a.ab)for(const {vl:d}of a.ab.values())d.getType()===b&&(c.push(d.T()),d.D(),zn(a,d.T()))}function Bn(a,b){null===a.j&&(a.j=new Map);a.j.set(b.id,b)}
|
|
1124
|
-
olympe.sc.Gg=class{constructor(a,b='no name',c=olympe.sc.Tn){this.id=a;this.ad=b;this.R=new Set;this.H=c;this.D=new olympe.C.Wb('SC Context');this.data=new Map;this.ea=this.Y=this.j=this.F=null;this.ja=!1;this.N=new Set;this.ta=!1;this.$=null;this.G=olympe.ia
|
|
1124
|
+
olympe.sc.Gg=class{constructor(a,b='no name',c=olympe.sc.Tn){this.id=a;this.ad=b;this.R=new Set;this.H=c;this.D=new olympe.C.Wb('SC Context');this.data=new Map;this.ea=this.Y=this.j=this.F=null;this.ja=!1;this.N=new Set;this.ta=!1;this.$=null;this.G=olympe.ia.Ya('sc');this.ab=null;An(this)}T(){return this.id}getParent(){return this.H}lf(){return this.ea}set(a,b){if(!this.D.jd()&&!this.D.gb()){const g=olympe.dc.fa(a);var c,d;let h,k;a=null!=(k=null!=(h=null==(c=this.$)?void 0:c.get('O#'+g))?h:null==
|
|
1125
1125
|
(d=this.$)?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.N.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.ab&&0<this.ab.size&&Cn(this,olympe.sc.ab.qc.j.Zg,a,b),f=vn(this,a),this.N.add(c),Gn(this,c,f,b),this.N.delete(c))}}on(a,b,c,d=!0){if(this.D.gb()||this.D.jd())return()=>{};const e=on(this,a),f=c?olympe.dc.fa(c):
|
|
1126
|
-
'*';a=Hn(this,'@'+f+'.'+e,b);c=c?(c=rn(this,f))?c.Qa(e,!1):void 0:this.Qa(e);void 0!==c&&b(c);if(d)olympe.C
|
|
1126
|
+
'*';a=Hn(this,'@'+f+'.'+e,b);c=c?(c=rn(this,f))?c.Qa(e,!1):void 0:this.Qa(e);void 0!==c&&b(c);if(d)olympe.C.$a().onDestroy(a);return a}has(a,b=!1){a='$'+on(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}ki(a,b,c){const d=null!=c?c:'_'+olympe.V.Kc();if(a.gb()||a.jd())throw Error(`Try to create new child context in a destroyed context ${a.T()}, probably because \`runner()\` is called on a destroyed context`);const e=a.run(()=>new olympe.sc.Gg(d,
|
|
1127
1127
|
b,this));null!==this.ab&&0<this.ab.size&&this.ab.forEach(({vl:f,depth:g})=>{(-1===f.F||g<f.F)&&xn(e,f,g+1)});return e}ul(a,b){const c=rn(this,a);if(c)return b(c),()=>{};const d=Hn(this,'&'+a,e=>{let f;null==(f=d)||f();b(e)});return d}Qa(a,b=!0){a='$'+on(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.D.jd()||this.D.gb()||(Cn(this,olympe.sc.ab.qc.j.dk),this.D.destroy(),Cn(this,olympe.sc.ab.qc.j.$d))}wh(a,b){if(this.D.gb())a();
|
|
1128
1128
|
else return tn++,b=null!=b?b:String(tn),null===this.Y&&(this.Y=new Map),this.Y.set(b,a),b;return b||'noId'}sl(a){null!==this.Y&&this.Y.delete(a)}onDestroy(a){return this.gb()?(a(),'noId'):this.D.onDestroy(a)}clear(){if(!this.D.gb()){Cn(this,olympe.sc.ab.qc.j.Xj);let a;null==(a=this.Y)||a.forEach(b=>b());Cn(this,olympe.sc.ab.qc.j.Yj)}}gb(){return this.D.gb()}Bb(){return this.D}};olympe.sc.Gg.prototype.getParent=olympe.sc.Gg.prototype.getParent;olympe.sc.Gg.j={pm:'I#',Hm:'O#',RB:'IO#'};function Kn(a,b,c){return(c=c.lf())?`${a}.${c}.${b}`:`${a}.${b}`}olympe.sc.ab.qc=class{constructor(a=-1){this.id=olympe.V.jf();this.active=!0;this.F=a}D(){this.active=!1}T(){return this.id}getType(){}process(){}};olympe.sc.ab.qc.j={INIT:'INIT',Zg:'SET',Xj:'CLEAR',Yj:'CLEARED',dk:'DESTROY',$d:'DESTROYED'};olympe.sc.ab.qc.D={$e:'REMOTE',nv:'LOCAL',jg:'PROFILER'};olympe.sc.ae=class a{constructor(){this.D=this.H=this.N=null;this.R=new Map;this.F=new Map;this.j=new olympe.V.bn(1E4);hb(this.j,b=>{Jn(b)})}$(b,c,d){const e=b.body(),f=e.c,g=this.R.get(f);switch(e.t){case olympe.sc.ae.j.Pv:c=this.F.get(e.f);b.dd(c).catch(l=>{d.error('Unable to reply with paths: ',l)});break;case olympe.sc.ae.j.Qv:const h=f+c,k=(l,n,p=0)=>{In(l,(q,r)=>{let t;q instanceof olympe.dc.CloudObject?t=a.F(q):t=q;let v;q=null!=(v=l.lf())?v:'';0<q.length&&(q+='.');n.push([`${p}.${q}${r}`,
|
|
1129
1129
|
t])})};b.Qn(h).then(()=>{const l=[];k(g,l,0);yn(g,p=>{k(p,l,1)});olympe.L.rb.ld(h,{t:olympe.sc.ae.j.Eu,v:l,ts:0}).catch(p=>{d.error('Error publishing on service : ',p)});const n=new olympe.sc.ab.fw(h);xn(g,n);this.j.has(g)?gb(this.j,g):this.j.add(g)}).catch(l=>{d.error('Error notifying on a contextId : ',l)});break;case olympe.sc.ae.j.Rv:void 0!==g&&this.j.has(g)&&gb(this.j,g);break;case olympe.sc.ae.j.Fh:void 0!==g&&(this.j.delete(g),Jn(g))}}ea(b,c,d){this.N=new olympe.L.rb('discovery_debug_id',
|
|
1130
1130
|
c);this.N.listen().subscribe(e=>{var f=e.body();if(f.t===olympe.sc.ae.j.du){e=f.i;f=f.f;if(!this.F.has(f)){const g=this.Y(f,c,b);if(0!==g.length)this.F.set(f,g);else return}null===this.D&&(this.D=olympe.V.jf(),f=new olympe.C.Wb(this.D,c.Bb()),this.H=new olympe.L.rb(this.D,f),this.H.listen().subscribe(g=>{this.$(g,b,d)}));olympe.L.rb.ld(e,{t:olympe.sc.ae.j.At,n:olympe.W.getParameter(olympe.sc.U.bp)||'no name',a:b,s:this.D}).catch(g=>{d.error('Error publishing on draw service : '+g)})}})}Y(b,c,d){const e=
|
|
1131
|
-
[],f=olympe.dc.ha(),g=(h,k)=>{yn(h,l=>{if(null!==l.lf()){const n=olympe.dc.CloudObject.get(l.lf()).wg(olympe.sc.Runnable.H).Hc();if(null!==n){const p=k+'/'+f.name(n);n.X()===b&&(e.push([p,l.T()]),this.R.set(l.T(),l));g(l,p)}}})};g(c.state,f.name(d));return e}static D(b,c,d){let e=d;d instanceof olympe.dc.CloudObject&&(e=a.F(d));olympe.L.rb.ld(b,{t:olympe.sc.ae.j.Xk,k:c,v:e,ts:Date.now()}).catch(f=>{olympe.ia
|
|
1131
|
+
[],f=olympe.dc.ha(),g=(h,k)=>{yn(h,l=>{if(null!==l.lf()){const n=olympe.dc.CloudObject.get(l.lf()).wg(olympe.sc.Runnable.H).Hc();if(null!==n){const p=k+'/'+f.name(n);n.X()===b&&(e.push([p,l.T()]),this.R.set(l.T(),l));g(l,p)}}})};g(c.state,f.name(d));return e}static D(b,c,d){let e=d;d instanceof olympe.dc.CloudObject&&(e=a.F(d));olympe.L.rb.ld(b,{t:olympe.sc.ae.j.Xk,k:c,v:e,ts:Date.now()}).catch(f=>{olympe.ia.Ya('Debugger').error('Error publishing on service : ',f)})}static F(b){if(null===b||void 0===
|
|
1132
1132
|
b)return'<null>';const c=olympe.dc.ha();if(b instanceof olympe.dc.CloudObject){var d=b.ac();if(!c.Ob(d,olympe.sc.Ac))return b.toString();let f=`${b.Vb().name()} (${b.X()})`;var e=olympe.dc.CloudObject.get(d);d=olympe.dc.ma.from(e).vg(olympe.dc.CloudObject.extendRel,!0).ne().fb(olympe.dc.CloudObject.propertyRel).ne().Hc();e=olympe.dc.ma.from(e).vg(olympe.dc.CloudObject.extendRel,!0).ne().fb(olympe.dc.CloudObject.Kj).ne().Hc();d=d.filter(([g])=>g instanceof olympe.sc.Ac);0!==d.length&&(f+='<br> ',
|
|
1133
1133
|
f+='Properties:<br>',d.forEach(([,g])=>{f+=' ';f+=' - '+c.name(g)+' : '+c.Ra(b.X(),g)+'<br>'}));d=e.filter(([g])=>g instanceof olympe.sc.Ac);0!==d.length&&(f+=' ',f+='Relations:<br>',d.forEach(([,g])=>{f+=' ';f+=' - '+c.name(g)+'<br>'}));return f}return b.toString()}};olympe.sc.ae.H='discovery_debug_id';olympe.sc.ae.j={du:0,At:1,Pv:2,Qv:3,Eu:4,Xk:5,Rv:6,Fh:7};olympe.sc.ab.ZB=class extends olympe.sc.ab.qc{constructor(a=-1){super(a);this.j=new Map}getType(){return olympe.sc.ab.qc.D.nv}process(a,b,c,...d){if(this.active&&b===olympe.sc.ab.qc.j.Zg){a=Kn(c,on(a,d[0]),a);d=d[1];let e;null==(e=this.j.get(a))||e(d)}}on(a,b){this.j.set(a,b)}};function Ln(a,b,c,d=new Map){for(var e=[];b;){const n=b.lf();if(!n)break;e.push(n);b=b.getParent()}sb(a.j,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.H.has(c)){e=a;f=c;e.ha||(e.ha=olympe.dc.ha());d=e.ha.name(f);e=(f=e.ha.model(f))?e.ha.name(f):'';var [h,k,l]=[d,f,e];d=a.j;e=(new Map).set(c,h).set(k,l);c=(new Map).set(c,k);for(const [p,q]of e.entries())d.N.set(p,q);for(const [p,q]of c.entries())d.H.set(p,
|
|
1134
1134
|
q)}}
|
|
@@ -1137,9 +1137,9 @@ Ln(this,a,b?e:d?f:c,new Map([['propId',q],['value',r],['type',g]]))):d&&(e=this.
|
|
|
1137
1137
|
const Mn={pm:'input',Hm:'output',Uv:'prop',INIT:'init',Xj:'clear',Yj:'cleared',dk:'destroy',$d:'destroyed',Mv:'other'};olympe.sc.ab.fw=class extends olympe.sc.ab.qc{constructor(a){super(1);this.H=a;this.j=new Map;this.db=olympe.dc.ha()}getType(){return olympe.sc.ab.qc.D.$e}D(){super.D();for(const a of this.j.values())a();this.j.clear()}process(a,b,c,...d){if(this.active&&b===olympe.sc.ab.qc.j.Zg&&void 0!==d[0]&&null!==d[0]){const e=Kn(c,on(a,d[0]),a),f=d[1];let g;null==(g=this.j.get(e))||g();this.j.delete(e);if(f instanceof olympe.dc.CloudObject&&f.Vb()instanceof olympe.sc.Ac){const h=ih(this.db,f,()=>{olympe.sc.ae.D(this.H,
|
|
1138
1138
|
e,f)});this.j.set(e,()=>{jh(this.db,f,h)})}olympe.sc.ae.D(this.H,e,f)}}};olympe.sc.Metadata=class extends olympe.dc.CloudObject{Yu(){return this.yd(this.In())}Zu(){return this.yd(this.Jn())}kl(){return new olympe.C.Zb(this.yd(this.In()),this.yd(this.Jn()))}In(){}Jn(){}};olympe.sc.Metadata.O=olympe.dc.na.j('0161ae936c62f9fcd131',olympe.sc.Metadata);m=olympe.sc.Metadata.prototype;m.Yu.K=olympe.C.J.F;m.Zu.K=olympe.C.J.F;m.kl.K=olympe.C.J.R;m.In.K=olympe.C.J.j;m.Jn.K=olympe.C.J.j;olympe.sc.hd=class extends olympe.dc.CloudObject{D(){return this.wb(olympe.sc.hd.F)}j(){return this.wb(olympe.sc.hd.j)}};olympe.sc.hd.O=olympe.dc.na.j('01703376c4a81c0e9d90',olympe.sc.hd);olympe.sc.hd.F=olympe.sc.hd.O.ka('01703376c4a81c0e9d91');olympe.sc.hd.j=olympe.sc.hd.O.ka('01703376c4a81c0e9d92');olympe.sc.hd.D=olympe.sc.hd.O.sa('01703376c4a81c0e9d93');R(olympe.dc.CloudObject.O,olympe.sc.hd.D);olympe.sc.hd.prototype.D.K=olympe.C.J.D;olympe.sc.hd.prototype.j.K=olympe.C.J.D;olympe.sc.xe={};olympe.sc.xe.Ne={nu:'folders',jw:'screenflow',Lw:'ui-design',Mr:'software-intelligence',Ch:'data-management',DC:'projects'};olympe.sc.Gf=class extends olympe.dc.CloudObject{constructor(a,b){super(a,b)}Id(){return this.yd(olympe.sc.Gf.D)}};olympe.sc.Gf.O=olympe.dc.na.j('019131fb930466a1ad79',olympe.sc.Gf);olympe.sc.Gf.D=olympe.sc.Gf.O.ka('016d1bb681929c2cc3f1');olympe.sc.Gf.j=olympe.sc.Gf.O.sa('019131fb930466a1ad7a');R(olympe.dc.CloudObject.O,olympe.sc.Gf.j);olympe.sc.Gf.prototype.Id.K=olympe.C.J.F;olympe.sc.td=class extends olympe.dm.BrickMetadata{ve(){return olympe.sc.xe.Ne.Mr}j(){return this.cb(olympe.sc.td.j,olympe.sc.logic.Vh)}D(){return this.cb(olympe.sc.td.D,olympe.sc.logic.Sg)}};olympe.sc.td.O=olympe.dc.na.j('011100000000000adef0',olympe.sc.td);olympe.sc.td.j=olympe.sc.td.O.sa('016ac4f59a2917fdef01');olympe.sc.td.D=olympe.sc.td.O.sa('016ac4f59a2917fdef02');olympe.sc.td.O.j=(a,b)=>$l(a,b||'New function signature',olympe.sc.td,olympe.sc.logic.Cd).X();
|
|
1139
1139
|
olympe.sc.td.prototype.j.K=new olympe.C.J(()=>olympe.dc.Aa,[]);olympe.sc.td.prototype.D.K=new olympe.C.J(()=>olympe.dc.Aa,[]);function Nn(a,b){[].forEach(c=>c.call(a,b,(d,e)=>{null===e?b.remove(d):b.set(d,e)}))}function On(a,b){b=b.filter(c=>'string'===typeof c&&a.db.Ob(c,olympe.sc.logic.Tb));b.sort((c,d)=>{let e;c=null!=(e=a.db.Ra(c,olympe.sc.logic.Tb.j,!0))?e:0;let f;d=null!=(f=a.db.Ra(d,olympe.sc.logic.Tb.j,!0))?f:0;return c-d});return b}function Pn(a){return On(a,a.db.cb(a.tag,olympe.sc.Xa.F))}function Qn(a){return On(a,a.db.cb(a.tag,olympe.sc.Xa.D))}
|
|
1140
|
-
olympe.sc.Xa=class extends olympe.dm.BrickMetadata{av(a,b,c,d,e=!0){e||olympe.ia
|
|
1140
|
+
olympe.sc.Xa=class extends olympe.dm.BrickMetadata{av(a,b,c,d,e=!0){e||olympe.ia.Ya('sc').error('parameter own= false ignored, investigate');return olympe.C.xh(M(this.Tf(a,olympe.dc.nb.tj,c)),d)}H(){return[]}F(){return rxjs.of([])}Py(){return this.cb(olympe.sc.Xa.N,olympe.sc.Runnable)}ey(){return this.cb(olympe.sc.Xa.R,olympe.sc.Runnable)}vi(){return this.db.Ra(this,olympe.sc.Xa.$)}Nn(){return null!==this.db.Jb(this.tag,olympe.sc.Runnable.j.$b())}$u(){return this.cb(olympe.sc.Xa.F,olympe.sc.logic.vb)}mq(){return this.cb(olympe.sc.Xa.D,
|
|
1141
1141
|
olympe.sc.logic.Gb)}N(){return[olympe.sc.Xa.Wa]}};olympe.sc.Xa.O=olympe.dc.na.j('0112000000000000def0',olympe.sc.Xa);olympe.sc.Xa.$=olympe.sc.Xa.O.ka('01692aa71f3108454479');olympe.sc.Xa.mb=olympe.sc.Xa.O.ka('0166446c1f128ebc903a');olympe.sc.Xa.Wa=olympe.sc.Xa.O.ka('0166446c1f128ebc904e');olympe.sc.Xa.N=olympe.sc.Xa.O.sa('01692a4af82e8984742c');olympe.sc.Xa.R=olympe.sc.Xa.O.sa('01692a4af82e8984742d');olympe.sc.Xa.Y=olympe.sc.Xa.O.sa('01692a4af82e8984742e');olympe.sc.Xa.F=olympe.sc.Xa.O.sa('01621fb84e320000f00a');
|
|
1142
|
-
olympe.sc.Xa.D=olympe.sc.Xa.O.sa('01621fb84e320000f00b');olympe.sc.Xa.Gd=olympe.sc.Xa.O.sa('0171838bcfed0000e00e');olympe.sc.Xa.wd=olympe.sc.Xa.O.sa('0171838bcfed0000a00a');m=olympe.sc.Xa.prototype;m.av.K=olympe.C.J.j;m.Py.K=new olympe.C.J(()=>olympe.dc.Aa,[]);m.ey.K=new olympe.C.J(()=>olympe.dc.Aa,[]);m.vi.K=olympe.C.J.j;m.Nn.K=olympe.C.J.j;m.$u.K=new olympe.C.J(()=>olympe.dc.Aa,[]);m.mq.K=new olympe.C.J(()=>olympe.dc.Aa,[]);function un(a){let b;return null!=(b=a.xd().N().map(olympe.dc.fa)[0])?b:null}function Rn(a){const b=new olympe.dc.
|
|
1142
|
+
olympe.sc.Xa.D=olympe.sc.Xa.O.sa('01621fb84e320000f00b');olympe.sc.Xa.Gd=olympe.sc.Xa.O.sa('0171838bcfed0000e00e');olympe.sc.Xa.wd=olympe.sc.Xa.O.sa('0171838bcfed0000a00a');m=olympe.sc.Xa.prototype;m.av.K=olympe.C.J.j;m.Py.K=new olympe.C.J(()=>olympe.dc.Aa,[]);m.ey.K=new olympe.C.J(()=>olympe.dc.Aa,[]);m.vi.K=olympe.C.J.j;m.Nn.K=olympe.C.J.j;m.$u.K=new olympe.C.J(()=>olympe.dc.Aa,[]);m.mq.K=new olympe.C.J(()=>olympe.dc.Aa,[]);function un(a){let b;return null!=(b=a.xd().N().map(olympe.dc.fa)[0])?b:null}function Rn(a){const b=new olympe.dc.Za;a=b.create(a);b.persist(a,!1);b.ob((d,e)=>{d||olympe.ia.Ya('sc').error(`Error occurred for transaction executed by createLocalRunnable: ${e}`)});const c=olympe.dc.CloudObject.get(a);olympe.C.$a().onDestroy(()=>{const d=new olympe.dc.Za;d.delete(c);d.ob()});return c}
|
|
1143
1143
|
function Sn(a,b){Dn(b.state,a);Nn(a.xd(),b);const c=a.R(),d=Tn(b,c),e=[];c.forEach((f,g)=>{f===a.ea?e[0]=g:f===a.$&&(e[1]=g)});void 0!==e[0]&&void 0!==e[1]&&(Un(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])})}
|
|
1144
1144
|
function Vn(a,b){let c,d,e;a.G.j()&&(e=a.db.name(a.ac()),c=`Brick ${e} successfully run`,d=`Brick ${e} successfully cleared`);const f=Wn(a,b),g=a.setupExecution(b).pipe(rxjs.operators.map(h=>{if(!b.gb()&&(b.clear(),null!==h)){const k=Array.isArray(h)?h:[h],l=new olympe.sc.Uw(b.state);l.Bb().run(()=>u(function*(){try{yield a.update(l,k,f)}catch(n){l.throw(n)}}));return!0}return!1})).subscribe(rxjs.Subscriber.create(h=>h?a.G.debug(c):a.G.debug(d),h=>b.throw(h),()=>a.G.debug(`Brick ${e} completed`)));
|
|
1145
1145
|
b.onDestroy(g.unsubscribe.bind(g))}function Xn(a,b,c,d){let e=[];const f=T(a.db,b,c,(g,h)=>{if(g){const k=kn(d,h),l=olympe.dc.CloudObject.get(h);l instanceof olympe.sc.logic.gd&&null!==e?e.push(()=>l.run(k)):l.run(k)}else{let k;null==(k=mn(d,h))||k.destroy()}});e.forEach(g=>g());e=null;d.Bb().onDestroy(a.db.D.bind(a.db,b,c,f))}function Wn(a,b){return a.xd().H(b)}
|
|
@@ -1150,8 +1150,8 @@ b,c,d){a=b.tb(a,c,!0);void 0!==d&&olympe.C.xh(a,d);return a}Wa(a,b,c,d,e){olympe
|
|
|
1150
1150
|
olympe.sc.Runnable.H=olympe.sc.Runnable.O.sa('01692a4af82e8984742b');olympe.sc.Runnable.j=olympe.sc.Runnable.O.sa('01756a18d4921c103111');olympe.sc.Runnable.N=R(olympe.sc.Runnable.O,olympe.sc.Xa.N);olympe.sc.Runnable.R=R(olympe.sc.Runnable.O,olympe.sc.Xa.R);olympe.sc.Runnable.Y=R(olympe.sc.Runnable.O,olympe.sc.Xa.Y);R(olympe.sc.Xa.O,olympe.sc.Runnable.H);R(olympe.sc.Xa.O,olympe.sc.Runnable.j);olympe.sc.Runnable.prototype.xd.K=new olympe.C.J(()=>olympe.sc.Xa,[]);
|
|
1151
1151
|
olympe.sc.Runnable.prototype.N.K=new olympe.C.J(()=>Object,[]);olympe.sc.Runnable.prototype.Wa.K=olympe.C.J.j;function Zn(a){if(a){if('string'===typeof a)return a;if(a instanceof olympe.sc.Ud)return(a=a.D())?a.valueOf():null;if('function'===typeof a.X)return a.X()}return null}olympe.sc.Ud=class extends olympe.dc.CloudObject{D(){return this.db.cb(this,olympe.sc.Ud.j)[0]}j(){const a=Zn(this);return olympe.dc.CloudObject.get(a)}Cc(){return this.j().Cc()}toString(){const a=Zn(this);let b;a&&(b=this.db.name(a));return b||super.toString()}};olympe.sc.Ud.O=olympe.dc.na.j('0163c9ae01f2d6e9ca49',olympe.sc.Ud);
|
|
1152
1152
|
olympe.sc.Ud.j=olympe.sc.Ud.O.sa('0169b5a8a33144fb0b49');R(olympe.dc.CloudObject.O,olympe.sc.Ud.j);olympe.sc.Ud.prototype.D.K=new olympe.C.J(()=>String,[]);olympe.sc.Ud.prototype.j.K=new olympe.C.J(()=>olympe.dc.CloudObject,[]);olympe.sc.gp=class extends olympe.dm.Lb{ve(){return olympe.sc.xe.Ne.Ch}};olympe.sc.gp.O=olympe.dc.na.j('0163a68ce44f3d1fa84c',olympe.sc.gp);olympe.sc.Ac=class extends olympe.dm.BrickMetadata{};olympe.sc.Ac.O=olympe.dc.na.j('016324fde11a836f76c2',olympe.sc.Ac);olympe.sc.Ac.j=olympe.sc.Ac.O.sa('016324fde11a836087c2');olympe.sc.Ac.O.j=function(a,b){return $l(a,null!=b?b:'New type',olympe.sc.Ac).X()};let $n=null,ao=null,bo=[];
|
|
1153
|
-
function co(a,b){$n=a;const c=olympe.C
|
|
1154
|
-
g()}))})}olympe.ia
|
|
1153
|
+
function co(a,b){$n=a;const c=olympe.C.$a();return olympe.dc.sd.from(a).fb(olympe.sc.qa.Zc.j).fb(olympe.sc.tf.j.$b()).ob({ji:'__code-as-data__'}).then(d=>{let e;null==(e=bo)||e.forEach(f=>f());bo=null;ao=d;if(null!==d){if(b){const f=olympe.dc.ha();return new Promise(g=>{xi(c,d,h=>{h=f.wi(h)?h:f.model(h);return null!==h&&f.Ob(h,olympe.sc.Ac)},{$n:!0}).subscribe(rxjs.Subscriber.create(()=>{g()},()=>{olympe.ia.Ya('sc').error('Impossible to load the business container for the application',a,'maybe are you offline?');
|
|
1154
|
+
g()}))})}olympe.ia.Ya('sc').debug("Found business container but won't load it's content according to configuration.")}else olympe.ia.Ya('sc').info(`No business container for application ${a}. You probably miss permissions.`);return Promise.resolve()}).catch(d=>{bo=null;throw d;})}function Lf(){return null===bo?Promise.resolve():new Promise(a=>{bo.push(()=>a())})}olympe.sc.tf=class extends olympe.dc.CloudObject{};olympe.sc.tf.O=olympe.dc.na.j('017b3aa8fae1e3d044dc',olympe.sc.tf);olympe.sc.tf.j=olympe.sc.tf.O.sa('017b3aa8fd1659291b92');
|
|
1155
1155
|
olympe.sc.tf.D=olympe.sc.tf.O.sa('017b3aa8fe7ec3fd52f2');olympe.sc.Map=class extends olympe.dc.CloudObject{};olympe.sc.Map.O=olympe.dc.na.j('018119241abce0e5696e',olympe.sc.Map);olympe.sc.Pg=class extends olympe.sc.Map{};olympe.sc.Pg.O=olympe.dc.na.j('01631aacd8276ea98490',olympe.sc.Pg);olympe.sc.File=class extends olympe.dm.File{static Bx(a,b,c,d,e,f){e=a.create(olympe.sc.File,new Map,e,f);olympe.sc.File.rt(a,e,b,c,d);return e}static Cx(a,b,c,d,e,f){e=a.create(olympe.sc.File,new Map,e,f);olympe.sc.File.Zn(a,e,b,c,d);return e}static rt(a,b,c,d,e){e=null!=e?e:'application/data';d=URL.createObjectURL(new Blob([d],{type:e}));olympe.sc.File.Zn(a,b,c,d,e)}static Zn(a,b,c,d,e){const f=olympe.dc.ha(),g=f.Ja(b);var h;const k=null!=(h=a.model(b))?h:olympe.sc.File;if(null===k||!f.Uf(k,olympe.dm.File))throw Error(`Try to set the content of an object which is not a file: ${b}`);
|
|
1156
1156
|
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.Ra(b,olympe.dm.File.urlProp)||c.set(olympe.dm.File.creationDateProp,h).set(olympe.dm.File.j,!1);a.ht(b,c)}};olympe.sc.File.setURLContent=olympe.sc.File.Zn;olympe.sc.File.setContent=olympe.sc.File.rt;olympe.sc.File.createFromURL=olympe.sc.File.Cx;olympe.sc.File.createFromContent=olympe.sc.File.Bx;
|
|
1157
1157
|
olympe.sc.File.O=dg(olympe.dm.File,'ff021000000000000031',olympe.sc.File);olympe.sc.Lg=class extends olympe.sc.File{H(){const a=olympe.C.cc(olympe.C.Ta);this.hl(b=>{a.update(olympe.C.xb(b))});return a.tb()}};olympe.sc.Lg.O=dg(olympe.sc.File,'01644b6297305d62fca2',olympe.sc.Lg);olympe.sc.Lg.O.j=olympe.sc.File.D.bind(null,olympe.sc.Lg);olympe.sc.Lg.prototype.H.K=olympe.C.J.D;olympe.sc.Mc=class extends olympe.sc.File{H(){return this.wb(olympe.sc.Mc.fontFamilyProp)}N(){return this.wb(olympe.sc.Mc.F)}R(){return this.yd(olympe.sc.Mc.H)}};olympe.sc.Mc.O=dg(olympe.sc.File,'01647e113043c637b541',olympe.sc.Mc);olympe.sc.Mc.fontFamilyProp=olympe.sc.Mc.O.ka('01647e35ecd24ef0b88d');olympe.sc.Mc.F=olympe.sc.Mc.O.ka('01647e677f5d1cfbdf42');olympe.sc.Mc.H=olympe.sc.Mc.O.ka('01647e6780999bf8bd25');
|
|
@@ -1197,27 +1197,27 @@ olympe.sc.Bg.Az=a=>{const b=a.j,c=olympe.dc.ha();for(const d of b.Uc()){const e=
|
|
|
1197
1197
|
let p;f=null!=(p=null==(k=b.Tc(h))?void 0:k.Vb())?p:c.model(h)}if(c.Uf(f,olympe.dm.Ie)){k=jn(f);let p;n=null!=(p=l.Ra(k.X()))?p:c.Ra(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.Yc(d.tag(),new Map([[g,n]]));Ul(a,l.tag(),olympe.dc.Mb.Dc)}})}};
|
|
1198
1198
|
olympe.sc.Bg.wx=a=>{const b=a.j,c=olympe.dc.ha(),d=new Set;for(var e of b.Ab.values()){a=e.tag();let f;const g=null!=(f=e.Vb())?f:c.model(a);if(null!==g&&e.Gd()&&(d.has(g)||c.Ob(g,olympe.sc.Ac))){d.add(g);const h=Array.from(e.ea()).flatMap(([k,,l,n])=>n&&k!==olympe.dc.hc.$c?[l]:[]).find(k=>{let l,n;const p=null!=(n=null==(l=b.Tc(k))?void 0:l.Vb())?n:c.model(k);return!p||!(d.has(p)||c.Ob(p,olympe.sc.Ac))});if(void 0!==h){let k,l,n;e=null!=(n=null!=(l=null==(k=b.Tc(h))?void 0:k.Vb())?l:c.model(h))?
|
|
1199
1199
|
n:'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.Bg.Qz=a=>{var b=a.j;const c=olympe.dc.ha();for(const d of b.Uc()){b=d.tag();const e=d.Vb();if(e&&!c.Ob(e,olympe.sc.Ac)&&Z(a,b))throw Error(`You are trying to persist an instance of : ${c.name(e)} (${e}), but only instances of DataType can be persisted`);}};
|
|
1200
|
-
olympe.W.run([olympe.dc.transaction.P.Ea],a=>{fm(fm(fm(a,olympe.sc.Bg.wx,'businessDataRelations'),olympe.sc.Bg.mz,'linkBusinessContainer'),olympe.sc.Bg.Az,'noBusinessComplexProperty')});olympe.sc.$j=class extends olympe.dm.BrickMetadata{ve(){return olympe.sc.xe.Ne.Ch}};olympe.sc.$j.O=olympe.dc.na.j('01645fe6873aeea59e64',olympe.sc.$j);olympe.sc.$j.j=olympe.sc.$j.O.sa('017ed8ac775f48d4d589');olympe.sc.So=class extends olympe.dm.Lb{ve(){return olympe.sc.xe.Ne.Ch}};olympe.sc.So.O=olympe.dc.na.j('0163a68ce44f3d1fa95d',olympe.sc.So);olympe.sc.Ah=class extends olympe.dm.BrickMetadata{};olympe.sc.Ah.O=olympe.dc.na.j('016324fde11a836f77d3',olympe.sc.Ah);olympe.sc.Ah.j=olympe.sc.Ac.O.sa('016324fde11a836088d3');olympe.sc.Ah.O.j=(a,b)=>$l(a,null!=b?b:'New config type',olympe.sc.Ah).X();olympe.sc.MA=class{};olympe.sc.ek=class extends olympe.dm.BrickMetadata{ve(){return olympe.sc.xe.Ne.Ch}};olympe.sc.ek.O=olympe.dc.na.j('017dc8d6c8fd8c8bd2ff',olympe.sc.ek);olympe.sc.ek.O.j=(a,b)=>$l(a,null!=b?b:'New data connector',olympe.sc.ek,olympe.dm.DataSource).X();olympe.sc.Ae=class extends olympe.sc.Runnable{ta(){return this.cb(olympe.sc.Ae.F,olympe.sc.Runnable)}j(){return this.cb(olympe.sc.Ae.D,olympe.dm.Property)}};olympe.sc.Ae.O=jg(olympe.dc.na.j('016c2d996d9ca27fa9d8',olympe.sc.Ae));olympe.sc.Ae.F=olympe.sc.Ae.O.sa('016c3cb7742ec9309e0b');olympe.sc.Ae.D=olympe.sc.Ae.O.sa('016c42d3454636f90533');olympe.sc.Ae.prototype.ta.K=new olympe.C.J(()=>olympe.dc.Aa,[]);olympe.sc.Ae.prototype.j.K=new olympe.C.J(()=>olympe.dc.Aa,[]);olympe.sc.qp=class extends olympe.dm.Lb{ve(){return olympe.sc.xe.Ne.Ch}};olympe.sc.qp.O=olympe.dc.na.j('017a7a9ff057958e5678',olympe.sc.qp);olympe.sc.Mi=class extends olympe.dm.Enum{static create(a,b,c,d,e){const f=olympe.dc.ha();e=void 0!==e?e:f.Ja(b)&&f.Uc(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.Mi.create=olympe.sc.Mi.create;olympe.sc.Mi.O=olympe.dc.na.j('016cdd861b32d56c8208',olympe.sc.Mi);olympe.sc.wq=class extends olympe.dm.Lb{ve(){return olympe.sc.xe.Ne.Lw}};olympe.sc.wq.O=olympe.dc.na.j('01644b6d4543b344b857',olympe.sc.wq);olympe.sc.xq=class extends olympe.dc.CloudObject{};olympe.sc.xq.O=olympe.dc.na.j('0162f672366be5ca7a86',olympe.sc.xq);const qo={pp:30};olympe.sc.ec=class extends olympe.dc.sources.ec{D(a){return a instanceof olympe.sc.logic.Error?this.format(qo.pp,{c:a.Aj(),m:a.message,s:a.se()}):super.D(a)}j(a){return(null==a?void 0:a.t)===qo.pp?(a=a.v,pn(a.m,a.c,a.s)):super.j(a)}H(a){super.H(a);if(this.db.model(a)===olympe.sc.Ud.O.X()){const b=olympe.sc.Ud.j;this.F.get(a).r.push({r:b.X(),o:a,d:this.db.Jb(a,b)})}return a}};olympe.sc.Sr=class extends olympe.sc.Ae{};olympe.sc.Sr.O=olympe.dc.na.j('016d3f37610ae4fc3962',olympe.sc.Sr);olympe.sc.Text=class extends olympe.dm.String{};olympe.sc.Text.O=olympe.dc.na.j('016cfca73e63f9ab5ba4',olympe.sc.Text);olympe.sc.
|
|
1201
|
-
typeof c?c:olympe.dc.fe().fromModel(a);a=this.j.create(a,d).zi(c);for(const [e,f]of b)X(a,e,f);b=a.X();this.D.push(b);return b}update(a,b,c){this.j.update(a,b,c);return this}ht(a,b){a=this.j.update(a);for(const [c,d]of b)b=d,a.Ld.set(olympe.dc.fa(c),b);return this}delete(a){this.j.delete(a);return this}Pa(a,b,c){this.j.Pa(a,b,c);return this}ic(a,b,c){this.j.ic(a,b,c);return this}wn(a,b){this.j.wn(a,b);return this}persist(a,b=!0){this.j.persist(a,b);return this}Pz(a,b=!0){olympe.ia
|
|
1202
|
-
return this.persist(a,b)}zi(a){this.source=a;return this}model(a){return this.j.model(a)}merge(a){Zl(this.j,a.j);return this}mn(a){this.j.mn(a);return this}ob(){return new Promise((a,b)=>{this.j.ob((c,d)=>{c?a(new olympe.sc.mj(this.D)):b(d)})})}xn(){return new Promise((a,b)=>{this.j.xn((c,d)=>{c?a(new olympe.sc.mj(this.D)):b(d)})})}};olympe.sc.
|
|
1203
|
-
olympe.sc.
|
|
1204
|
-
olympe.sc.
|
|
1200
|
+
olympe.W.run([olympe.dc.transaction.P.Ea],a=>{fm(fm(fm(a,olympe.sc.Bg.wx,'businessDataRelations'),olympe.sc.Bg.mz,'linkBusinessContainer'),olympe.sc.Bg.Az,'noBusinessComplexProperty')});olympe.sc.$j=class extends olympe.dm.BrickMetadata{ve(){return olympe.sc.xe.Ne.Ch}};olympe.sc.$j.O=olympe.dc.na.j('01645fe6873aeea59e64',olympe.sc.$j);olympe.sc.$j.j=olympe.sc.$j.O.sa('017ed8ac775f48d4d589');olympe.sc.So=class extends olympe.dm.Lb{ve(){return olympe.sc.xe.Ne.Ch}};olympe.sc.So.O=olympe.dc.na.j('0163a68ce44f3d1fa95d',olympe.sc.So);olympe.sc.Ah=class extends olympe.dm.BrickMetadata{};olympe.sc.Ah.O=olympe.dc.na.j('016324fde11a836f77d3',olympe.sc.Ah);olympe.sc.Ah.j=olympe.sc.Ac.O.sa('016324fde11a836088d3');olympe.sc.Ah.O.j=(a,b)=>$l(a,null!=b?b:'New config type',olympe.sc.Ah).X();olympe.sc.MA=class{};olympe.sc.ek=class extends olympe.dm.BrickMetadata{ve(){return olympe.sc.xe.Ne.Ch}};olympe.sc.ek.O=olympe.dc.na.j('017dc8d6c8fd8c8bd2ff',olympe.sc.ek);olympe.sc.ek.O.j=(a,b)=>$l(a,null!=b?b:'New data connector',olympe.sc.ek,olympe.dm.DataSource).X();olympe.sc.Ae=class extends olympe.sc.Runnable{ta(){return this.cb(olympe.sc.Ae.F,olympe.sc.Runnable)}j(){return this.cb(olympe.sc.Ae.D,olympe.dm.Property)}};olympe.sc.Ae.O=jg(olympe.dc.na.j('016c2d996d9ca27fa9d8',olympe.sc.Ae));olympe.sc.Ae.F=olympe.sc.Ae.O.sa('016c3cb7742ec9309e0b');olympe.sc.Ae.D=olympe.sc.Ae.O.sa('016c42d3454636f90533');olympe.sc.Ae.prototype.ta.K=new olympe.C.J(()=>olympe.dc.Aa,[]);olympe.sc.Ae.prototype.j.K=new olympe.C.J(()=>olympe.dc.Aa,[]);olympe.sc.qp=class extends olympe.dm.Lb{ve(){return olympe.sc.xe.Ne.Ch}};olympe.sc.qp.O=olympe.dc.na.j('017a7a9ff057958e5678',olympe.sc.qp);olympe.sc.Mi=class extends olympe.dm.Enum{static create(a,b,c,d,e){const f=olympe.dc.ha();e=void 0!==e?e:f.Ja(b)&&f.Uc(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.Mi.create=olympe.sc.Mi.create;olympe.sc.Mi.O=olympe.dc.na.j('016cdd861b32d56c8208',olympe.sc.Mi);olympe.sc.wq=class extends olympe.dm.Lb{ve(){return olympe.sc.xe.Ne.Lw}};olympe.sc.wq.O=olympe.dc.na.j('01644b6d4543b344b857',olympe.sc.wq);olympe.sc.xq=class extends olympe.dc.CloudObject{};olympe.sc.xq.O=olympe.dc.na.j('0162f672366be5ca7a86',olympe.sc.xq);const qo={pp:30};olympe.sc.ec=class extends olympe.dc.sources.ec{D(a){return a instanceof olympe.sc.logic.Error?this.format(qo.pp,{c:a.Aj(),m:a.message,s:a.se()}):super.D(a)}j(a){return(null==a?void 0:a.t)===qo.pp?(a=a.v,pn(a.m,a.c,a.s)):super.j(a)}H(a){super.H(a);if(this.db.model(a)===olympe.sc.Ud.O.X()){const b=olympe.sc.Ud.j;this.F.get(a).r.push({r:b.X(),o:a,d:this.db.Jb(a,b)})}return a}};olympe.sc.Sr=class extends olympe.sc.Ae{};olympe.sc.Sr.O=olympe.dc.na.j('016d3f37610ae4fc3962',olympe.sc.Sr);olympe.sc.Text=class extends olympe.dm.String{};olympe.sc.Text.O=olympe.dc.na.j('016cfca73e63f9ab5ba4',olympe.sc.Text);olympe.sc.Za=class{constructor(a=!0){a=Yl(a);a.N=!0;var b=olympe.sc.Bg.Qz;let c;(null==(c=olympe.W.getParameter(olympe.dc.transaction.U.bm))?0:c.includes('persistenceBusinessDataOnly'))||a.R.push(b);this.j=a;this.D=[];this.source=null}static from(a){const b=olympe.sc.ya.j.TRANSACTION;return a.has(b,!0)?a.get(b,!0):new olympe.sc.Za}static process(a,b){return a.has(olympe.sc.ya.j.TRANSACTION,!0)?Promise.resolve(!1):b.ob().then(()=>!0)}T(){return this.j.T()}create(a,b=new Map,c=this.source,d){c='string'===
|
|
1201
|
+
typeof c?c:olympe.dc.fe().fromModel(a);a=this.j.create(a,d).zi(c);for(const [e,f]of b)X(a,e,f);b=a.X();this.D.push(b);return b}update(a,b,c){this.j.update(a,b,c);return this}ht(a,b){a=this.j.update(a);for(const [c,d]of b)b=d,a.Ld.set(olympe.dc.fa(c),b);return this}delete(a){this.j.delete(a);return this}Pa(a,b,c){this.j.Pa(a,b,c);return this}ic(a,b,c){this.j.ic(a,b,c);return this}wn(a,b){this.j.wn(a,b);return this}persist(a,b=!0){this.j.persist(a,b);return this}Pz(a,b=!0){olympe.ia.Ya('dc').warn('Transaction#persistInstance() has been deprecated. Please use Transaction#persist() instead.');
|
|
1202
|
+
return this.persist(a,b)}zi(a){this.source=a;return this}model(a){return this.j.model(a)}merge(a){Zl(this.j,a.j);return this}mn(a){this.j.mn(a);return this}ob(){return new Promise((a,b)=>{this.j.ob((c,d)=>{c?a(new olympe.sc.mj(this.D)):b(d)})})}xn(){return new Promise((a,b)=>{this.j.xn((c,d)=>{c?a(new olympe.sc.mj(this.D)):b(d)})})}};olympe.sc.Za.prototype.executeAsLarge=olympe.sc.Za.prototype.xn;olympe.sc.Za.prototype.execute=olympe.sc.Za.prototype.ob;olympe.sc.Za.prototype.afterExecution=olympe.sc.Za.prototype.mn;
|
|
1203
|
+
olympe.sc.Za.prototype.merge=olympe.sc.Za.prototype.merge;olympe.sc.Za.prototype.model=olympe.sc.Za.prototype.model;olympe.sc.Za.prototype.setSource=olympe.sc.Za.prototype.zi;olympe.sc.Za.prototype.persistInstance=olympe.sc.Za.prototype.Pz;olympe.sc.Za.prototype.persist=olympe.sc.Za.prototype.persist;olympe.sc.Za.prototype.deleteAllRelations=olympe.sc.Za.prototype.wn;olympe.sc.Za.prototype.deleteRelation=olympe.sc.Za.prototype.ic;olympe.sc.Za.prototype.createRelation=olympe.sc.Za.prototype.Pa;
|
|
1204
|
+
olympe.sc.Za.prototype['delete']=olympe.sc.Za.prototype.delete;olympe.sc.Za.prototype.multiUpdate=olympe.sc.Za.prototype.ht;olympe.sc.Za.prototype.update=olympe.sc.Za.prototype.update;olympe.sc.Za.prototype.create=olympe.sc.Za.prototype.create;olympe.sc.Za.prototype.getId=olympe.sc.Za.prototype.T;olympe.sc.Za.process=olympe.sc.Za.process;olympe.sc.Za.from=olympe.sc.Za.from;olympe.sc.mj=class{constructor(a){this.j=a}hy(){return this.j.map(olympe.dc.CloudObject.get)}};olympe.sc.mj.prototype.getCreatedObjects=olympe.sc.mj.prototype.hy;olympe.zc={};olympe.zc.Ht=class{run(){}};function ro(a,b='default'){return a.j===b}
|
|
1205
1205
|
olympe.zc.Ua=class{constructor(a,b){this.j=a;this.G=b;this.D=null;this.F='';this.G.info('HC Manager will execute application registered as:',this.j)}Mj(a,b,c=''){b||(b='default');b===this.j?(null===this.D?this.G.log('Application',c,'designated to be launched'):this.G.log('OVERRIDE: Application',c,'designated to be launched'),this.D=a,this.F=c):this.G.debug('ignoring application:'+c+' as it is registered under name '+b+' and not '+this.j)}run(){null!==this.D?(this.G.info('Running application:',this.F),
|
|
1206
|
-
this.D.run()):this.G.error('No app registered under name: '+this.j)}};olympe.zc.Mj=function(a,b,c='default'){const d=a
|
|
1206
|
+
this.D.run()):this.G.error('No app registered under name: '+this.j)}};olympe.zc.Mj=function(a,b,c='default'){const d=a.Ya();c?d.debug('Pre-registering application '+b+' under name '+c+' (use '+olympe.zc.U.Ve+'='+c+' to start it)'):d.debug('Pre-registering application '+b+' as default one');a.xd(olympe.zc.P.Ea).config(c,[b],(e,f)=>f.Mj(e,c,b),e=>ro(e,c),'olympe.hc.registerApp')};olympe.zc.P={Ea:'hc.Manager',Da:'hc.Logger'};olympe.zc.U={Ve:'hc.app',Ip:'hc.globalToken'};olympe.W.config(function(a){E(a,olympe.zc.U.Ve,'default');E(a,olympe.zc.U.Ip,!1);D(a,olympe.zc.P.Da,[olympe.ia.P.Ea],b=>b.cd('hc'));D(a,olympe.Db.P.ah,[new olympe.W.pa(olympe.zc.U.Ve)],b=>b);D(a,olympe.auth.P.Cl,[olympe.Db.P.ah,new olympe.W.pa(olympe.zc.U.Ip)],(b,c)=>new olympe.auth.qo(c?'':b));C(a,olympe.zc.P.Ea,olympe.zc.Ua,new olympe.W.pa(olympe.zc.U.Ve),olympe.zc.P.Da)},'olympe.hc');
|
|
1207
1207
|
olympe.W.run([olympe.zc.P.Ea],a=>a.run(),'olympe.hc');olympe.sc.Ib={};function so(a){a.Y=a.F.H(()=>u(function*(){return to(a)}),'Stop application')}function uo(a){a.R=a.F.j(()=>olympe.C.Qa(a.$)===olympe.C.da.D?Promise.resolve('The application is started'):Promise.reject('The application is not started'),'Application health check',olympe.host.Je.j.READINESS)}
|
|
1208
1208
|
function vo(a){if(a.ta)return a.G.debug('Sending getContext request'),Ji(a.Ha).then(()=>{a.G.debug('synchronisation request successful');var f=a.j;bo=null;$n=f}).catch(f=>{a.G.error('failed to synchronise (authenticated) with server: '+f.message)});const b=nn(a.D);!b&&jl();a.G.debug((b?'PULLING':'SUBSCRIBING')+' application '+a.j);const c=a.D.Bb(),d=new Promise((f,g)=>{const h=olympe.dc.ha(),k=new olympe.C.Wb('Primordial Subscription Context',c);xi(k,a.j,l=>{l=h.wi(l)?l:h.model(l);return null!==l&&
|
|
1209
|
-
h.Ob(l,olympe.sc.Ah)},{md:
|
|
1210
|
-
{md:
|
|
1211
|
-
function
|
|
1212
|
-
a.G.info(`Application ${olympe.dc.ha().name(a.j)} (${a.j}) started`);k=olympe.dc.sources.de();k.Yb=!0;k.Y+=0;k.le.next(0<k.Y);0===k.Y&&k.$&&k.Yb&&(k.G.debug(`Cache: set code-as-data version in local storage: ${k.version}`),k.Wa.set('__code-as-data-version__',k.version),k.Eb||(k.$=!1))})}else a.G.error('application retrieved: not an Application with a run() method');else to(a)}));olympe.C
|
|
1213
|
-
3E4);let e;null==(e=a.Yb)||e.start()}}function wo(a
|
|
1209
|
+
h.Ob(l,olympe.sc.Ah)},{md:b?olympe.dc.ma.oc.Rg:olympe.dc.ma.oc.wf,$n:!0,at:!0}).subscribe(rxjs.Subscriber.create(c.tc(()=>{h.Ob(a.j,olympe.sc.qa.Zc)?(a.Wa.Y(a.j,b),f()):Rd(a.N)?g(Error(`The specified application tag (${a.j}) is not an application or does not exist`)):(k.destroy(),a.N.connect().catch(l=>{g(Error(`Failed to load the app while offline, you might want to try again when online: ${l}`))}))}),l=>g(l)))}),e=new Promise(f=>{olympe.C.Vc([a.ja.ue()],g=>{olympe.dc.ma.Qe(g,olympe.dm.User,olympe.dc.Ia.SERVER).observe(c,
|
|
1210
|
+
{md:olympe.dc.ma.oc.Ck,cl:'__code-as-data__'}).subscribe(()=>f())})});return Promise.all([d,e]).then(()=>{if(a.ea)return wo(a);wo(a).then(()=>{})})}
|
|
1211
|
+
function xo(a){a.G.info('Starting application '+a.j);const b=olympe.dc.ha();if(0<a.j.length){const c=Of(b,a.j,a.D.Bb().tc((f,g)=>{if(f)if(f=Rn(g),f instanceof olympe.sc.qa.Ei){a.G.debug('application retrieved: running');g=kn(a.D,f);const h=new olympe.sc.ab.Zv(a.H);pb(a.H,()=>xn(a.D.state,h));qb(a.H,()=>{var k=h.T();return zn(a.D.state,k)});a.mb&&a.H.start();f.run(g);'string'===typeof a.Eb&&(new olympe.sc.ae).ea(f.X(),g,a.G);g.zt(olympe.sc.ya.j.ho).then(()=>{var k;null==(k=d)||k.cancel();a.$.update(olympe.C.da.D);
|
|
1212
|
+
a.G.info(`Application ${olympe.dc.ha().name(a.j)} (${a.j}) started`);k=olympe.dc.sources.de();k.Yb=!0;k.Y+=0;k.le.next(0<k.Y);0===k.Y&&k.$&&k.Yb&&(k.G.debug(`Cache: set code-as-data version in local storage: ${k.version}`),k.Wa.set('__code-as-data-version__',k.version),k.Eb||(k.$=!1))})}else a.G.error('application retrieved: not an Application with a run() method');else to(a)}));olympe.C.$a().onDestroy(()=>{Mf(b,a.j,c)});const d=Cc(()=>{a.G.warn(`requested application ${a.j} may not be available (it may not exist or the logged user may not have the correct permissions)`)},
|
|
1213
|
+
3E4);let e;null==(e=a.Yb)||e.start()}}function wo(a){return u(function*(){yo(a.j)&&(yield co(a.j,a.ea).catch(b=>{throw Error(`Failed to load the business container for the application ${a.j}: ${b}`);}))})}function to(a){a.G.info('Stop the application');a.D.Bb().sg();a.F.D(a.R);a.F.F(a.Y)}
|
|
1214
1214
|
olympe.sc.Ib.Um=class{constructor(a,b,c,d,e,f,g,h,k,l){this.G=a;this.ja=b;this.N=c;this.Ha=d;this.F=e;this.Y=this.R='';this.D=f;this.Wa=g;this.H=h;this.Yb=l;this.j=k.get('appTag');this.ta=k.get('getContextMode');let n;this.Eb=null!=(n=k.get('debuggerName'))?n:null;this.mb=k.get('autostartProfiler');this.ea=k.get('requireBusinessContainer');this.$=olympe.C.cc(olympe.C.da).update(olympe.C.da.j)}run(){this.G.debug('runtime starting for app #'+this.j);let a=!1;so(this);uo(this);const b=olympe.L.uc.j.cj,
|
|
1215
|
-
c=olympe.L.uc.j.Ef,d=olympe.L.uc.j.vc;olympe.C.Vc([this.N.getState()],e=>{switch(e){case b:case c:this.G.debug('Server session opened or working offline, start the application');a||(a=!0,vo(this).then(olympe.C
|
|
1215
|
+
c=olympe.L.uc.j.Ef,d=olympe.L.uc.j.vc;olympe.C.Vc([this.N.getState()],e=>{switch(e){case b:case c:this.G.debug('Server session opened or working offline, start the application');a||(a=!0,vo(this).then(olympe.C.$a().tc(()=>xo(this))));break;case d:this.G.debug('Impossible to open a connection to the orchestrator and offline mode is disabled.')}})}};olympe.sc.Ib.Um.j='app_instance';olympe.sc.Ib.Um.za=[olympe.zc.Ht];olympe.sc.Ib.hw=class{constructor(a,b,c,d){this.G=a;this.D=b;this.F=d.get('httpManifestPath');this.j=d.get('manifestCommon');if(!this.j)this.j={};else if('string'===typeof this.j)try{this.j=JSON.parse(this.j)}catch(e){this.G.warn('Invalid manifest common config'),this.j={}}}start(){const a=b=>{this.G.debug('Request URL',b.j());const c=(new URL(b.j())).searchParams.get('origin');if(c)return c;b=b.Cj();this.G.debug('Request headers',b);return b.origin?b.origin:b.Wz?(new URL(b.Wz)).origin:b[olympe.net.wa.Headers.yp]&&
|
|
1216
1216
|
b[olympe.net.wa.Headers.zp]?b[olympe.net.wa.Headers.zp]+'://'+b[olympe.net.wa.Headers.yp]:null};this.D.D('manifest',`${this.F}/:${'appTag'}`,[olympe.net.wa.Sd.GET],(b,c)=>{const d=this;return u(function*(){var e=c.get('appTag');d.G.debug('Processing request to serve manifest for app',e);if(20!==e.length)return new olympe.net.qd('Invalid appTag',olympe.net.wa.Ub.Fl);try{var f=yield olympe.dc.ma.Qe(e,olympe.sc.qa.Zc).ob()}catch(h){return new olympe.net.qd(`Something went wrong: ${'string'===typeof h?
|
|
1217
1217
|
h:h.message}`,olympe.net.wa.Ub.Fl)}if(0===f.size())return new olympe.net.qd('App not found',olympe.net.wa.Ub.Zi);var g=a(b);f=f.Ic();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={};else if('string'===
|
|
1218
|
-
typeof f)try{f=JSON.parse(f)}catch(h){d.G.warn(`Invalid manifest app config for app: ${e}`),f={}}e=Object.assign({},g,d.j,f);return new olympe.net.qd(JSON.stringify(e),olympe.net.wa.Ub.Rh,void 0,{'content-type':'application/json'})})}).catch(()=>this.G.error('Error while starting the RuntimeHTTPService'));this.G.debug('Started RuntimeHTTPService')}};function
|
|
1218
|
+
typeof f)try{f=JSON.parse(f)}catch(h){d.G.warn(`Invalid manifest app config for app: ${e}`),f={}}e=Object.assign({},g,d.j,f);return new olympe.net.qd(JSON.stringify(e),olympe.net.wa.Ub.Rh,void 0,{'content-type':'application/json'})})}).catch(()=>this.G.error('Error while starting the RuntimeHTTPService'));this.G.debug('Started RuntimeHTTPService')}};function yo(a){var b=olympe.dm.DataSource.SERVER;const c=olympe.dc.ma.from(a).fb(olympe.sc.qa.Zc.j).fb(olympe.dm.Bd.F.$b()).fb(olympe.dm.Bd.j).Hc();a=olympe.dc.ma.from(a).fb(olympe.sc.qa.Zc.j).fb(olympe.dm.ib.D).Hc();return c.concat(a).has(b)}
|
|
1219
1219
|
olympe.sc.Ib.Sk=class extends olympe.dc.sources.Sk{R(a){return this.db.Ob(a,olympe.sc.Ac)}Y(a,b){if(!this.H){super.init();var c=olympe.dc.sd.from(a).fb(olympe.sc.qa.Zc.j).Hc();if(!(c instanceof olympe.dm.ib))throw Error(`Impossible to initialize the source solver for the application ${a}: no project is linked to it`);b=b?olympe.dc.ma.oc.Rg:olympe.dc.ma.oc.wf;al(this,c,b);c=new olympe.C.Wb('deployed data sources');olympe.dc.ma.from(a).fb(olympe.sc.qa.Zc.ja).observe(c,{md:b}).subscribe(d=>{const e=
|
|
1220
|
-
new olympe.dc.
|
|
1220
|
+
new olympe.dc.Za;d.yj().forEach(f=>{e.Pa(olympe.dm.DataSource.Lj,this.j,f)});d.Ej().forEach(f=>{e.ic(olympe.dm.DataSource.Lj,this.j,f)});e.ob()})}}};olympe.sc.Ib.P={kg:'sc.runtime.Main',bf:'sc.runtime.SourceSolver',wr:'sc.runtime.appConfig',yr:'sc.runtime.runtimeHTTPServiceConfig',xr:'sc.runtime.RuntimeHTTPService',Pq:'sc.runtime.OfflineAppConfig'};olympe.sc.Ib.U={Tp:'app.httpManifestPath',uq:'app.manifest.common',qq:'sc.loadBusinessContainer'};
|
|
1221
1221
|
olympe.W.config(function(a){E(a,olympe.sc.Ib.U.Tp,'/runtime/manifest');E(a,olympe.sc.Ib.U.uq,null);E(a,olympe.sc.Ib.U.qq,!1);D(a,olympe.Db.P.ah,[new olympe.W.pa(olympe.zc.U.Ve),new olympe.W.pa(olympe.sc.U.Ve)],(b,c)=>`${b}${c?'-'+c:''}`);D(a,olympe.sc.Ib.P.Pq,[new olympe.W.pa(olympe.sc.U.Ve),new olympe.W.pa(olympe.net.U.bj),new olympe.W.pa(olympe.net.U.Em)],(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`))?
|
|
1222
1222
|
g:d;return new Map([['offlineEnabled',f],['offlineAutoBackOnline',!f||b]])});Xa(a,olympe.net.P.Fm,olympe.sc.Ib.P.Pq);C(a,olympe.sc.Ib.P.bf,olympe.sc.Ib.Sk,olympe.dc.P.Dh,new olympe.W.pa(olympe.dc.U.Yg),new olympe.W.pa(olympe.dc.U.$l));Xa(a,olympe.dc.sources.P.bf,olympe.sc.Ib.P.bf);D(a,olympe.sc.Ib.P.wr,[new olympe.W.pa(olympe.sc.U.Ve),new olympe.W.pa(olympe.dc.U.Zh),new olympe.W.pa(olympe.sc.U.bp),new olympe.W.pa(olympe.sc.U.jo),new olympe.W.pa(olympe.sc.Ib.U.qq)],(b,c,d,e,f)=>new Map([['appTag',
|
|
1223
1223
|
b],['getContextMode',c],['debuggerName',d],['autostartProfiler',e],['requireBusinessContainer',f]]));C(a,olympe.sc.Ib.P.kg,olympe.sc.Ib.Um,olympe.sc.P.Da,olympe.auth.P.Ea,olympe.L.P.vf,olympe.dc.query.P.Fk,olympe.host.P.Ge,olympe.sc.P.Kk,olympe.sc.Ib.P.bf,olympe.V.P.jg,olympe.sc.Ib.P.wr,olympe.sc.Ib.P.xr);D(a,olympe.sc.Ib.P.yr,[new olympe.W.pa(olympe.sc.Ib.U.Tp),new olympe.W.pa(olympe.sc.Ib.U.uq)],(b,c)=>new Map([['httpManifestPath',b],['manifestCommon',c]]));C(a,olympe.sc.Ib.P.xr,olympe.sc.Ib.hw,
|
|
@@ -1226,14 +1226,14 @@ d)}static zg(){return new Promise((b,c)=>{olympe.public.Na.get().zg(d=>d?c(d):b(
|
|
|
1226
1226
|
b).set('password',c),olympe.auth.Ec.j.SRP)}static qz(b){const c=sf();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.Na.j((new Map).set('idpName',d),b)}static oz(){return olympe.public.Na.j(new Map,olympe.auth.Ec.j.SAML)}static rz(b,c){return olympe.public.Na.j((new Map).set('username',b).set('nonce',
|
|
1227
1227
|
c),olympe.auth.Ec.j.Gm)}static nz(){return olympe.public.Na.j(new Map,olympe.auth.Ec.j.OAUTH2)}static Jj(){return olympe.public.Na.get().Jj()}static j(b,c){const d=new olympe.auth.Request;for(const [e,f]of b)d.set(e,f);return new Promise(e=>{qf(olympe.public.Na.get(),d,c,()=>{e()})})}static get(){return olympe.auth.re()}static D(b,c){return b.asObservable('function'===typeof c.Bb?c.Bb():c)}};olympe.public.Na.logout=olympe.public.Na.Jj;olympe.public.Na.loginOpenID=olympe.public.Na.nz;
|
|
1228
1228
|
olympe.public.Na.loginToken=olympe.public.Na.rz;olympe.public.Na.loginSAML=olympe.public.Na.oz;olympe.public.Na.loginSSO=olympe.public.Na.qz;olympe.public.Na.loginSRP=olympe.public.Na.pz;olympe.public.Na.getUserFromToken=olympe.public.Na.rh;olympe.public.Na.sendKeepAlive=olympe.public.Na.rf;olympe.public.Na.getIDPNames=olympe.public.Na.wy;olympe.public.Na.getUserToken=olympe.public.Na.Xy;olympe.public.Na.getIDPToken=olympe.public.Na.xy;olympe.public.Na.refreshToken=olympe.public.Na.zg;
|
|
1229
|
-
olympe.public.Na.getToken=olympe.public.Na.te;olympe.public.Na.observeUser=olympe.public.Na.Jz;olympe.public.Na.getCurrentUser=olympe.public.Na.jy;olympe.public.Na.isAuthenticated=olympe.public.Na.ql;olympe.public.Na.getState=olympe.public.Na.getState;olympe.public.Na.generateSRPData=olympe.public.Na.Vx;olympe.public.Ba=class{static create(a){return new class extends olympe.dc.Z.Cg{j(b,c){b=a(olympe.dc.CloudObject.get(c));if('boolean'===typeof b)return b;const d=olympe.C.cc(olympe.C.da),e=b.subscribe(f=>d.update(olympe.C.Sb(f)));olympe.C
|
|
1230
|
-
olympe.public.xf=class{static create(a){return new class extends olympe.dc.xc.Cg{F(b,c){return olympe.dc.CloudObject.get(c)}compare(b,c){b=a(b,c);if('number'===typeof b)return b;const d=olympe.C.cc(olympe.C.aa),e=b.subscribe(f=>d.update(olympe.C.ra(f)));olympe.C
|
|
1229
|
+
olympe.public.Na.getToken=olympe.public.Na.te;olympe.public.Na.observeUser=olympe.public.Na.Jz;olympe.public.Na.getCurrentUser=olympe.public.Na.jy;olympe.public.Na.isAuthenticated=olympe.public.Na.ql;olympe.public.Na.getState=olympe.public.Na.getState;olympe.public.Na.generateSRPData=olympe.public.Na.Vx;olympe.public.Ba=class{static create(a){return new class extends olympe.dc.Z.Cg{j(b,c){b=a(olympe.dc.CloudObject.get(c));if('boolean'===typeof b)return b;const d=olympe.C.cc(olympe.C.da),e=b.subscribe(f=>d.update(olympe.C.Sb(f)));olympe.C.$a().Yd(()=>e.unsubscribe());return d.tb()}}}};
|
|
1230
|
+
olympe.public.xf=class{static create(a){return new class extends olympe.dc.xc.Cg{F(b,c){return olympe.dc.CloudObject.get(c)}compare(b,c){b=a(b,c);if('number'===typeof b)return b;const d=olympe.C.cc(olympe.C.aa),e=b.subscribe(f=>d.update(olympe.C.ra(f)));olympe.C.$a().Yd(()=>e.unsubscribe());return d.tb()}}}};olympe.public.Process=class{static Lz(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.ll(),d=c.j(a,void 0,null==b?void 0:b.type);return()=>c.D(d)}static Mz(a,b,c){const d=olympe.host.ll(),e=d.ja(a,b,c);return()=>d.F(e)}static connect(){return olympe.L.An().connect()}static disconnect(){return olympe.L.An().disconnect()}static Wf(a){a='function'===typeof a.Bb?a.Bb():a;return olympe.L.An().Wf().asObservable(a).pipe(rxjs.operators.map(b=>
|
|
1231
1231
|
b.valueOf()))}};olympe.public.Process.isOnline=olympe.public.Process.Wf;olympe.public.Process.disconnect=olympe.public.Process.disconnect;olympe.public.Process.connect=olympe.public.Process.connect;olympe.public.Process.onShutdown=olympe.public.Process.Mz;olympe.public.Process.onHealthCheck=olympe.public.Process.Lz;'object'===typeof exports&&(exports={CloudObject:olympe.dc.CloudObject,Relation:olympe.dc.Sa.Relation,Direction:olympe.dc.va,generateTag:olympe.V.jf,tagToString:olympe.dc.fa,register:olympe.dc.register,defineProperty:olympe.dc.defineProperty,defineRelation:olympe.dc.Ds,defineInverseRelation:olympe.dc.Fx,BrickContext:olympe.sc.ya,Brick:olympe.sc.logic.Function,ActionBrick:olympe.sc.logic.Function,GlobalProperties:olympe.sc.ya.j,registerBrick:olympe.sc.logic.na.j,FunctionBrick:olympe.sc.logic.Function,
|
|
1232
1232
|
Context:olympe.sc.ya,Entry:olympe.dc.Sa.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.gg,EnumValue:olympe.sc.Mi,DataSource:olympe.dm.DataSource,DataResult:olympe.dc.query.Ed,Workflow:olympe.sc.workflow.Workflow,WorkflowState:olympe.sc.workflow.df,WorkflowTransition:olympe.sc.workflow.Transition,
|
|
1233
|
-
WorkflowObjectState:olympe.sc.workflow.ObjectState,Transaction:olympe.sc.
|
|
1233
|
+
WorkflowObjectState:olympe.sc.workflow.ObjectState,Transaction:olympe.sc.Za,BurstTransaction:olympe.dc.Gi,TransactionResult:olympe.sc.mj,PredefinedDataSource:olympe.dc.Ia,QueryResult:olympe.dc.Ka,Query:olympe.dc.ma,QuerySingle:olympe.dc.sd,Predicate:olympe.dc.query.Ba,Order:olympe.dc.query.Bk,Config:class{static getParameter(a){return olympe.W.getParameter(a)}},Process:olympe.public.Process,ProbeType:olympe.host.Je.j,Cache:{getCacheEntries:()=>olympe.dc.sources.de().N,clearCache:a=>ql(olympe.dc.sources.de(),
|
|
1234
1234
|
a),getProcessingStatus:()=>olympe.dc.sources.de().Jc(),getProcessingErrors:()=>olympe.dc.sources.de().wd.asObservable(),hasPendingChanges:()=>olympe.dc.sources.de().ea.asObservable(),synchroniseChanges:()=>wl(),getPendingChanges:()=>zl(),clearPendingChanges:()=>Dl(),loadPendingChanges:a=>Bl(a)},Color:olympe.C.Color,ErrorFlow:olympe.sc.logic.Error,ServiceRequestType:olympe.L.xa.j,ServiceRequest:olympe.L.Fc,Service:olympe.L.rb,Auth:olympe.public.Na,AuthState:{INIT:olympe.auth.Ua.j.INIT,AUTHENTICATING:olympe.auth.Ua.j.Sj,
|
|
1235
1235
|
GUEST:olympe.auth.Ua.j.Pi,AUTHENTICATED:olympe.auth.Ua.j.sf,ERROR:olympe.auth.Ua.j.zb},AuthProtocol:olympe.auth.Ec.j,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.kb{static get(){return olympe.dc.ha()}},ListDef:olympe.dc.Aa,
|
|
1236
|
-
instanceToTag:olympe.dc.fa,registerSync:olympe.dc.na.j,getUniqueTag:olympe.V.jf,onDestroy:a=>olympe.C
|
|
1236
|
+
instanceToTag:olympe.dc.fa,registerSync:olympe.dc.na.j,getUniqueTag:olympe.V.jf,onDestroy:a=>olympe.C.$a().onDestroy(a),offDestroy:a=>olympe.C.$a().Xf(a),FollowRules:olympe.dc.Mb,transformers:{Related:olympe.dc.ba.af,RecursiveRelated:olympe.dc.ba.Ke,Distinct:olympe.dc.ba.Ki,Filter:olympe.dc.ba.zf,Limit:olympe.dc.ba.Nh,Sort:olympe.dc.ba.bh,Union:olympe.dc.ba.Lf},ListDefPredicate:olympe.public.Ba,predicates:{And:olympe.dc.Z.Od,Or:olympe.dc.Z.Fe,Not:olympe.dc.Z.je,Equals:olympe.dc.Z.Be,Contains:olympe.dc.Z.yf,
|
|
1237
1237
|
Greater:olympe.dc.Z.mk,Smaller:olympe.dc.Z.Rk,HasRelated:olympe.dc.Z.Ri,InstanceOf:olympe.dc.Z.Ui,Regex:olympe.dc.Z.Hf},Comparator:olympe.public.xf,comparators:{Number:olympe.dc.xc.Number,String:olympe.dc.xc.String,DateTime:olympe.dc.xc.DateTime},valuedefs:{BooleanProperty:olympe.dc.bb.Wj,StringProperty:olympe.dc.bb.jj,NumberProperty:olympe.dc.bb.aj,DateTimeProperty:olympe.dc.bb.Ji,Constant:olympe.dc.bb.Xe,Tag:olympe.dc.bb.kj}});
|
|
1238
1238
|
|
|
1239
1239
|
|