@olympeio/runtime-node 9.5.1 → 9.5.3-test.0
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/import/olympe.dm/datamodel/05_permission_schema.updateInst.json +1 -1
- package/import/olympe.dm/datamodel/06_structure.newInst.json +1 -1
- package/import/olympe.sc/datamodel/01_language.newInst.json +1 -1
- package/index.js +812 -807
- package/package.json +3 -3
- package/types/utils.d.ts +4 -2
- package/import/dcInitConfig.json +0 -10
package/index.js
CHANGED
|
@@ -209,18 +209,18 @@ da('Object.fromEntries',function(a){return a?a:function(b){var c={};if(!(Symbol.
|
|
|
209
209
|
function ia(a,b){a=void 0!==a?String(a):' ';return 0<b&&a?a.repeat(Math.ceil(b/a.length)).substring(0,b):''}da('String.prototype.padStart',function(a){return a?a:function(b,c){var d=ha(this);return ia(c,b-d.length)+d}});da('String.prototype.padEnd',function(a){return a?a:function(b,c){var d=ha(this);return d+ia(c,b-d.length)}});
|
|
210
210
|
da('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)}});da('Object.entries',function(a){return a?a:function(b){var c=[],d;for(d in b)Object.prototype.hasOwnProperty.call(b,d)&&c.push([d,b[d]]);return c}});
|
|
211
211
|
da('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}});da('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}});
|
|
212
|
-
da('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 ja=this||self;function x(a,b){a=a.split('.');let c=ja;a[0]in c||'undefined'==typeof c.execScript||c.execScript('var '+a[0]);for(let d;a.length&&(d=a.shift());)a.length||void 0===b?c[d]&&c[d]!==Object.prototype[d]?c=c[d]:c=c[d]={}:c[d]=b};const olympe={
|
|
213
|
-
(()=>{const a=console.trace,b=console.debug,c=console.log,d=console.info,e=console.warn,f=console.error;console.trace=(...g)=>a(ka('TRACE',g));console.debug=(...g)=>b(ka('DEBUG',g));console.log=(...g)=>c(ka('LOG',g));console.info=(...g)=>d(ka('INFO',g));console.warn=(...g)=>e(ka('WARN',g));console.error=(...g)=>f(ka('ERROR',g))})();olympe.Ra={};olympe.Ra.node={};olympe.W={};olympe.W.pf={};olympe.W.pf.
|
|
214
|
-
olympe.W.
|
|
215
|
-
olympe.W.Rg=class{constructor(a,b,c=2){this.F=a;this.parameters=b;this.C=Object.create(null);this.H=new olympe.W.
|
|
212
|
+
da('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 ja=this||self;function x(a,b){a=a.split('.');let c=ja;a[0]in c||'undefined'==typeof c.execScript||c.execScript('var '+a[0]);for(let d;a.length&&(d=a.shift());)a.length||void 0===b?c[d]&&c[d]!==Object.prototype[d]?c=c[d]:c=c[d]={}:c[d]=b};const olympe={fe:()=>'object'===typeof window?window:'object'===typeof global?global:self};if('olympe'in olympe.fe())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.fe().olympe=olympe;olympe.sC=(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 ka=(a,b)=>{a={level:a,message:b.map(c=>String(c)).join(' ')};for(const c of b){let d;if(null==(d=c)?0:d.stack)a.stackTrace||(a.stackTrace=''),a.stackTrace+=c.stack}return JSON.stringify(a)};
|
|
213
|
+
(()=>{const a=console.trace,b=console.debug,c=console.log,d=console.info,e=console.warn,f=console.error;console.trace=(...g)=>a(ka('TRACE',g));console.debug=(...g)=>b(ka('DEBUG',g));console.log=(...g)=>c(ka('LOG',g));console.info=(...g)=>d(ka('INFO',g));console.warn=(...g)=>e(ka('WARN',g));console.error=(...g)=>f(ka('ERROR',g))})();olympe.Ra={};olympe.Ra.node={};olympe.W={};olympe.W.pf={};olympe.W.pf.Nn=class{process(a){for(const b of Object.keys(a.pe))if(a.qd(b).Km())throw Error('Service "'+b+'" is defined as abstract and needs to be overridden');}};olympe.W.pf.Nn.xa=[olympe.W.pf.Mp];olympe.W.pf.On=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.qd(e);c(e.Ai(),f);for(const g of la(e))c(g.Ai(),f)}}function c(e,f){for(const g of e)g instanceof olympe.W.tb&&b(g.V(),f)}const d=new Set(Object.keys(a.pe));for(const e of d)b(e,[])}};olympe.W.pf.On.xa=[olympe.W.pf.Mp];olympe.W.pf.Mp=class{process(){}};const ma=[],na=[];function oa(a){const b=a.eb();b.debug('Registering configurations...');b.C++;ma.forEach(c=>{B(a.H,'Registering configure callback '+(c.C?'for module '+c.C:''));a.F.push(c.F)});pa(b);b.debug('done registering')}function qa(a){const b=a.eb();b.debug('Running run callbacks of container...');b.C++;na.forEach(c=>{const d=ra(a,c.Ai());a.H.debug('Calling run callback '+`for module ${c.C}`);c.F.apply(null,d)});pa(b);b.debug('done calling run callbacks. DI process completed!')}
|
|
214
|
+
olympe.W.Tn=class{constructor(){}static C(a,b){ma.push(new olympe.W.Mk(a,b))}static F(a,b,c){a.forEach(d=>{if(null===d||void 0===d)throw Error('Cannot proceed - DI configuration error. '+(c?`Run callback "${c}"`:'A run callback')+' cannot have a null or undefined dependency');});na.push(new olympe.W.Mk(b,c,a))}};olympe.W.config=olympe.W.Tn.C;olympe.W.run=olympe.W.Tn.F;olympe.W.Ak=class{constructor(){}getValue(){}};function sa(a,b){let c,d;return null!=(d=null==(c=a.G)?void 0:c.call(a,b))?d:!0}olympe.W.Mk=class{constructor(a,b,c){this.F=a;this.K=(null!=c?c:[]).map(d=>'string'===typeof d?new olympe.W.tb(d):d);this.C=null!=b?b:'no name di callback';this.G=null}Ai(){return this.K}};function ua(a,b,c){let d=a.C[b];if(void 0===d){const e=a.F[b];if(void 0===e){if(c===olympe.W.Rg.C.wl)return null;throw Error('Service "'+b+'" not found');}try{d=e.instantiate(a)}catch(f){throw a.H.error('Error during instantiation of service '+b),f;}!e.K&&(a.C[b]=d)}return d}function ra(a,b){const c=b.length,d=Array(c);let e,f;for(e=0;e<c;e++)a.H.C++,f=b[e],d[e]=f instanceof olympe.W.Ak?f.getValue(a):f,pa(a.H);return d}
|
|
215
|
+
olympe.W.Rg=class{constructor(a,b,c=2){this.F=a;this.parameters=b;this.C=Object.create(null);this.H=new olympe.W.jp(c);a=olympe.W.R.ag;if(void 0!==this.C[a])throw Error('Service "'+a+'" has already been instantiated');this.C[a]=this}eb(){return this.H}getParameter(a){return this.parameters[a.toLowerCase()]}};olympe.W.Rg.C={ws:'exception',wl:'null'};function va(a,b,c){function d(f,g){let h,k,l;for(h in f)Object.prototype.hasOwnProperty.call(f,h)&&(k=f[h],l=g.concat((h.startsWith('#')?h.substring(1):h).toLowerCase()),'object'!==typeof k||null===k||h.startsWith('#')?e[l.join('.')]=k:d(k,l))}const e=a.parameters;d(b,c?[c]:[])}function D(a,b,c,...d){B(a.H,'Defining service '+b);a.C(b,c,d,!1,!1)}function wa(a,b,c,...d){B(a.H,'Defining service '+b);a.C(b,c,d,!1,!0)}
|
|
216
216
|
function E(a,b,c,d,e=!1){B(a.H,'Defining service (as a factory) '+b);a.C(b,d,c,!0,e)}function xa(a,b,c,d=!1){B(a.H,'Defining service alias '+b);a.C(b,e=>e,[c],!0,d)}function ya(a,b){B(a.H,'Defining abstract service '+b);a.C(b).G=!0}function za(a,b,c){a.parameters[b.toLowerCase()]=c}function F(a,b,c){b=b.toLowerCase();Object.prototype.hasOwnProperty.call(a.parameters,b)||(a.parameters[b]=c)}
|
|
217
|
-
olympe.W.
|
|
218
|
-
var g=this.
|
|
219
|
-
Object.keys(this.
|
|
220
|
-
olympe.W.
|
|
221
|
-
(g=this.C)?void 0:g.size)){b.C++;B(b,'Calling configuration callbacks:');for(const h of this.C.values())b.C++,B(b,'Check if need to call additional configuration callback '+h.C),
|
|
222
|
-
(this.C=new Map);var f=this.C,g=f.set;b=new olympe.W.
|
|
223
|
-
olympe.Y.promise.
|
|
217
|
+
olympe.W.ls=class{constructor(a){var b=Aa,c=Ba;this.pe=Object.create(null);this.parameters=Object.create(null);this.K=[new olympe.W.pf.Nn,new olympe.W.pf.On];this.F=[];b&&va(this,b);c&&va(this,c,'version');a&&va(this,a);a=this.getParameter(olympe.W.U.xt);this.G=void 0!==a?a:3;this.H=new olympe.W.jp(this.G)}eb(){return this.H}C(a,b,c,d,e){const f=a instanceof olympe.W.tb?a.V():a;if(3<=arguments.length&&c){const h=c.indexOf(f);if(-1!==h){if(void 0===this.pe[f])throw Error(`ContainerBuilder.define: Service ${f} references itself and is not an override definition!`);
|
|
218
|
+
var g=this.pe[f];g.id=g.id+'!!'+ ++olympe.W.Vk.C;g.K=!0;g=g.id;c[h]=g;this.pe[g]=this.pe[f]}}this.pe[f]=new olympe.W.Vk(b,c,d||!1,f);return this.pe[f]}qd(a){const b=this.pe[a];if(void 0===b)throw Error(`DI Error: Definition ${a} was not found`);return b}getParameter(a){return this.parameters[a.toLowerCase()]}compile(){const a=this.F;this.H.debug('Calling '+a.length+' configure callbacks');this.H.C++;a.forEach(b=>{B(this.H,'Calling callback');this.H.C++;b(this);pa(this.H)});pa(this.H);this.H.debug('Configuration summary: '+
|
|
219
|
+
Object.keys(this.pe).length+' definitions');this.H.debug('Compiling...');this.H.C++;this.K.forEach((b,c)=>{this.H.debug('running compilation pass '+(c+1)+': '+b.constructor.name);b.process(this)});pa(this.H);this.H.debug('Compilation done, returning container');return new olympe.W.Rg(this.pe,this.parameters,this.G)}};function la(a){let b,c;return null!=(c=null==(b=a.C)?void 0:b.values())?c:[]}
|
|
220
|
+
olympe.W.Vk=class{constructor(a,b,c,d){this.O=a||null;this.T=!!c;this.F=(null!=b?b:[]).map(e=>'string'===typeof e?new olympe.W.tb(e):e);this.G=!1;this.C=null;this.id=null!=d?d:'';this.K=!1}V(){return this.id}instantiate(a){const b=a.eb();b.debug('Resolving arguments for '+this.id);const c=this.O;let d=ra(a,this.F);const e=()=>{if(this.T)return c.apply(null,d);d.unshift(null);return new (c.bind.apply(c,d))};B(b,'Instantiating '+this.id);const f=olympe.D?olympe.D.Dg().run(()=>e()):e();let g;if(0<(null==
|
|
221
|
+
(g=this.C)?void 0:g.size)){b.C++;B(b,'Calling configuration callbacks:');for(const h of this.C.values())b.C++,B(b,'Check if need to call additional configuration callback '+h.C),sa(h,f)?(B(b,'Calling additional configuration callback '+h.C),d=ra(a,h.Ai()),d.push(f),h.F.apply(null,d)):B(b,'Will not call additional configuration callback '+h.C+'predicate has returned false'),pa(b);pa(b)}B(b,'Done instantiating '+this.id);return f}Ai(){return this.F}Km(){return this.G}config(a,b,c,d,e){null===this.C&&
|
|
222
|
+
(this.C=new Map);var f=this.C,g=f.set;b=new olympe.W.Mk(c,e,b);b.G=d;g.call(f,a,b)}};olympe.W.Vk.C=0;function pa(a){0<a.C&&a.C--}function B(a,b){1>=a.F&&Ca(a,'log','DI: '+b)}function Ca(a,b,c){if(console&&console[b]){var d='';for(let e=0;e<a.C;e++)d+=' ';console[b](d+c)}}olympe.W.jp=class{constructor(a){this.F=a;this.C=0}debug(a){2>=this.F&&Ca(this,'log','DI: '+a)}info(a){3>=this.F&&Ca(this,'info','DI: '+a)}warn(a){4>=this.F&&Ca(this,'warn','DI: '+a)}error(a){5>=this.F&&Ca(this,'error','DI: '+a)}};olympe.W.ka=class extends olympe.W.Ak{constructor(a){super();this.id=a}V(){return this.id}getValue(a){return a.getParameter(this.id)}};olympe.W.tb=class extends olympe.W.Ak{constructor(a,b){super();this.id=a;this.C=b||olympe.W.Rg.C.ws}V(){return this.id}getValue(a){return ua(a,this.id,this.C)}};olympe.W.R={ag:'di.Container',gA:'di.PublicContainer'};olympe.W.U={xt:'logging.di'};olympe.W.run([olympe.W.R.ag],a=>{olympe.W.getParameter=b=>a.getParameter(b);olympe.fe().getConfig=b=>a.getParameter(b);olympe.fe().getConfigNames=()=>Object.keys(a.parameters)});olympe.Y={};olympe.Y.Yo=class{constructor(a){this.id=a||olympe.Y.Yo.C++}Ka(a){return a?this.id===a.id:!1}toJSON(){return this.id.toString()}toString(){return this.id.toString()}};olympe.Y.Yo.C=0;olympe.Y.Nz=class{constructor(a,b,c,d,e,f){this.C=[a||0,b||0,0,c||0,d||0,0,e||0,f||0,1]}set(a,b,c){this.C[3*a+b]=c}get(a,b){return this.C[3*a+b]}};olympe.Y.Yg=function(a,b,c,d,e,f,g,h,k,l,n,p,q){this.values=[a,b,c,0,0,d,e,f,0,0,g,h,k,0,0,l,n,p,q,0]};olympe.Y.Yg.F=function(a){return new olympe.Y.Yg(.213+.787*a,.715-.715*a,.072-.072*a,.213-.213*a,.715+.285*a,.072-.072*a,.213-.213*a,.715-.715*a,.072+.928*a,0,0,0,1)};olympe.Y.Yg.C=function(){return new olympe.Y.Yg(0,0,0,0,0,0,0,0,0,.2125,.7154,.0721,0)};olympe.Y.Yg.prototype.set=function(a,b,c){this.values[5*a+b]=c};olympe.Y.Yg.prototype.get=function(a,b){return this.values[5*a+b]};olympe.Y.Promise={};olympe.Y.Promise.pm=function(a,b){let c=null;return(...d)=>new Promise((e,f)=>{clearTimeout(c);c=setTimeout(()=>v(function*(){try{const g=yield a(...d);e(g)}catch(g){f(g)}}),b)})};olympe.Y.Promise.cn=function(a,b,c='Promise timeout'){return new Promise((d,e)=>{const f=setTimeout(()=>{e(Error(c))},b);a.then(g=>{clearTimeout(f);d(g)}).catch(g=>{clearTimeout(f);e(g)})})};olympe.Y.promise={};function Da(a){if(0===a.size())a.F.next(!1);else if(a.G()){a.C++;var b=Ea(a);b&&b.F.call(a).then(c=>{b.resolve(c)}).catch(c=>{b.C(c)}).finally(()=>{a.C--;0===a.size()&&a.F.next(!1);Da(a)})}}function Fa(a,b){return new Promise((c,d)=>{a.Ya.push(new olympe.Y.promise.yu(c,d,b));Da(a)})}function Ea(a){a.F.next(!0);let b;return null!=(b=a.Ya.shift())?b:null}
|
|
223
|
+
olympe.Y.promise.yq=class{constructor(){this.Ya=[];this.F=new rxjs.BehaviorSubject(!1);this.C=0}G(){return 0===this.C}clear(){for(;0<this.Ya.length;)this.Ya.shift().C(Error('Canceled by a clearStack'));Da(this)}size(){return this.Ya.length}};olympe.Y.promise.yu=class{constructor(a,b,c){this.resolve=a;this.C=b;this.F=c}};olympe.Y.promise.zu=class extends olympe.Y.promise.yq{constructor(a){super();if('number'!==typeof a||0>=a)throw Error('StackWindow with an invalid concurrentLimit. It must be a number > 0 for the stack to work properly');this.Ji=a}G(){return this.C<this.Ji}};olympe.Y.promise.yB=class{constructor(a,...b){this.G=a;this.parameters=b;this.C=this.F=null;this.promise=new Promise((c,d)=>{this.F=c;this.C=d});this.start()}then(a){return this.promise.then(a)}catch(a){return this.promise.catch(a)}finally(a){return this.promise.finally(a)}start(){'undefined'!==typeof Worker?setTimeout(()=>{const a=URL.createObjectURL(new Blob([`
|
|
224
224
|
function onFullfilledCallback(data) {
|
|
225
225
|
self.postMessage({ type: "done", data, });
|
|
226
226
|
self.close();
|
|
@@ -231,854 +231,859 @@ olympe.Y.promise.tu=class{constructor(){this.Ya=[];this.F=new rxjs.BehaviorSubje
|
|
|
231
231
|
}
|
|
232
232
|
self.onmessage = ({ data: { params } }) => {
|
|
233
233
|
(${this.G.toString()})(onFullfilledCallback, onRejectedCallback, ...(params ?? []));
|
|
234
|
-
};`])),b=new Worker(a);b.addEventListener('message',c=>{const {data:d,type:e}=c.data;URL.revokeObjectURL(a);if('done'===e){let f;null==(f=this.F)||f.call(this,d)}else{let f;null==(f=this.C)||f.call(this,d)}});b.postMessage({params:this.parameters})},0):this.G(this.F,this.C,...this.parameters)}};function Ga(a,b){var c=a.C;b=(new TextEncoder).encode(b);return c.call(a,b)}function Ha(a){return(new TextDecoder('utf8')).decode(a)}olympe.Y.
|
|
235
|
-
olympe.Y.
|
|
236
|
-
olympe.Y.
|
|
237
|
-
olympe.Y.
|
|
234
|
+
};`])),b=new Worker(a);b.addEventListener('message',c=>{const {data:d,type:e}=c.data;URL.revokeObjectURL(a);if('done'===e){let f;null==(f=this.F)||f.call(this,d)}else{let f;null==(f=this.C)||f.call(this,d)}});b.postMessage({params:this.parameters})},0):this.G(this.F,this.C,...this.parameters)}};function Ga(a,b){var c=a.C;b=(new TextEncoder).encode(b);return c.call(a,b)}function Ha(a){return(new TextDecoder('utf8')).decode(a)}olympe.Y.Gk=class{G(){}C(){}F(){}};olympe.Y.Vq=a=>a.replace('+','-').replace('/','_');olympe.Y.kv=a=>a.replace('-','+').replace('_','/');function Ia(a){a.C=setTimeout(()=>{const b=Date.now(),c=a.timeout;for(const [d,e]of a.values)b-e>c&&(a.delete(d),a.F&&a.F(d));if(0<a.values.size)Ia(a);else{let d;null==(d=a.G)||d.call(a)}},a.K)}function Ka(a,b){return a.values.has(b)?(a.values.set(b,Date.now()),!0):!1}function La(a,b){a.F=b;return a}
|
|
235
|
+
olympe.Y.Wl=class{constructor(a,b=a/2){this.timeout=a;this.K=b;this.values=new Map;this.G=this.F=this.C=null}add(a){this.values.set(a,Date.now());null===this.C&&Ia(this)}has(a){return this.values.has(a)}forEach(a){this.values.forEach((b,c)=>a(c))}delete(a){a=this.values.delete(a);if(0===this.values.size){this.C&&clearTimeout(this.C);this.C=null;let b;null==(b=this.G)||b.call(this)}return a}clear(){this.C&&clearTimeout(this.C);this.C=null;this.values.clear();return this}};function Ma(a,b){a.F=b;return a}function Na(a,b){a.C.G=b}
|
|
236
|
+
olympe.Y.Vl=class{constructor(a){this.C=La(new olympe.Y.Wl(a,void 0),b=>{const c=this.values.get(b);this.values.delete(b);let d;null==(d=this.F)||d.call(this,b,c)});this.values=new Map;this.F=null}set(a,b){this.values.set(a,b);this.C.add(a);return this}has(a){return this.values.has(a)}get(a){return this.values.get(a)}forEach(a){this.values.forEach((b,c)=>a(b,c))}delete(a){this.values.delete(a);return this.C.delete(a)}clear(){this.C.clear();this.values.clear();return this}};function Oa(a,b){a.T.push(b)}function Pa(a,b){a.Z.push(b)}function Qa(a,b){let c;'object'!==typeof b&&'function'!==typeof b?c=b:b instanceof olympe.dc.CloudObject?c=b.toJSON():Array.isArray(b)?c=b.map(d=>Qa(a,d)):c='N/A';return c}function Ra(a,b,c,d){b={cat:b,epoch:null!=d?d:performance.now()-a.F};let e;for(const [f,g]of null!=(e=c)?e:[])b[f]=Qa(a,g);a.G.push(b)}
|
|
237
|
+
olympe.Y.au=class{constructor(){this.G=[];this.T=[];this.Z=[];this.O=new Map;this.K=new Map;this.C=!1;this.F=null}start(){this.C||(this.F||(this.F=performance.now()),this.C=!0,this.T.forEach(a=>a()))}stop(){this.C&&(this.Z.forEach(a=>a()),this.C=!1)}};function Sa(a,b){return a+b&4294967295}
|
|
238
238
|
function Ta(a,b){let c=a[0],d=a[1],e=a[2],f=a[3];c=G(c,d,e,f,b[0],7,-680876936);f=G(f,c,d,e,b[1],12,-389564586);e=G(e,f,c,d,b[2],17,606105819);d=G(d,e,f,c,b[3],22,-1044525330);c=G(c,d,e,f,b[4],7,-176418897);f=G(f,c,d,e,b[5],12,1200080426);e=G(e,f,c,d,b[6],17,-1473231341);d=G(d,e,f,c,b[7],22,-45705983);c=G(c,d,e,f,b[8],7,1770035416);f=G(f,c,d,e,b[9],12,-1958414417);e=G(e,f,c,d,b[10],17,-42063);d=G(d,e,f,c,b[11],22,-1990404162);c=G(c,d,e,f,b[12],7,1804603682);f=G(f,c,d,e,b[13],12,-40341101);e=G(e,f,
|
|
239
239
|
c,d,b[14],17,-1502002290);d=G(d,e,f,c,b[15],22,1236535329);c=H(c,d,e,f,b[1],5,-165796510);f=H(f,c,d,e,b[6],9,-1069501632);e=H(e,f,c,d,b[11],14,643717713);d=H(d,e,f,c,b[0],20,-373897302);c=H(c,d,e,f,b[5],5,-701558691);f=H(f,c,d,e,b[10],9,38016083);e=H(e,f,c,d,b[15],14,-660478335);d=H(d,e,f,c,b[4],20,-405537848);c=H(c,d,e,f,b[9],5,568446438);f=H(f,c,d,e,b[14],9,-1019803690);e=H(e,f,c,d,b[3],14,-187363961);d=H(d,e,f,c,b[8],20,1163531501);c=H(c,d,e,f,b[13],5,-1444681467);f=H(f,c,d,e,b[2],9,-51403784);
|
|
240
240
|
e=H(e,f,c,d,b[7],14,1735328473);d=H(d,e,f,c,b[12],20,-1926607734);c=I(d^e^f,c,d,b[5],4,-378558);f=I(c^d^e,f,c,b[8],11,-2022574463);e=I(f^c^d,e,f,b[11],16,1839030562);d=I(e^f^c,d,e,b[14],23,-35309556);c=I(d^e^f,c,d,b[1],4,-1530992060);f=I(c^d^e,f,c,b[4],11,1272893353);e=I(f^c^d,e,f,b[7],16,-155497632);d=I(e^f^c,d,e,b[10],23,-1094730640);c=I(d^e^f,c,d,b[13],4,681279174);f=I(c^d^e,f,c,b[0],11,-358537222);e=I(f^c^d,e,f,b[3],16,-722521979);d=I(e^f^c,d,e,b[6],23,76029189);c=I(d^e^f,c,d,b[9],4,-640364487);
|
|
241
241
|
f=I(c^d^e,f,c,b[12],11,-421815835);e=I(f^c^d,e,f,b[15],16,530742520);d=I(e^f^c,d,e,b[2],23,-995338651);c=J(c,d,e,f,b[0],6,-198630844);f=J(f,c,d,e,b[7],10,1126891415);e=J(e,f,c,d,b[14],15,-1416354905);d=J(d,e,f,c,b[5],21,-57434055);c=J(c,d,e,f,b[12],6,1700485571);f=J(f,c,d,e,b[3],10,-1894986606);e=J(e,f,c,d,b[10],15,-1051523);d=J(d,e,f,c,b[1],21,-2054922799);c=J(c,d,e,f,b[8],6,1873313359);f=J(f,c,d,e,b[15],10,-30611744);e=J(e,f,c,d,b[6],15,-1560198380);d=J(d,e,f,c,b[13],21,1309151649);c=J(c,d,e,f,
|
|
242
242
|
b[4],6,-145523070);f=J(f,c,d,e,b[11],10,-1120210379);e=J(e,f,c,d,b[2],15,718787259);d=J(d,e,f,c,b[9],21,-343485551);a[0]=Sa(c,a[0]);a[1]=Sa(d,a[1]);a[2]=Sa(e,a[2]);a[3]=Sa(f,a[3])}function I(a,b,c,d,e,f){b=Sa(Sa(b,a),Sa(d,f));return Sa(b<<e|b>>>32-e,c)}function G(a,b,c,d,e,f,g){return I(b&c|~b&d,a,b,e,f,g)}function H(a,b,c,d,e,f,g){return I(b&d|c&~d,a,b,e,f,g)}function J(a,b,c,d,e,f,g){return I(c^(b|~d),a,b,e,f,g)}
|
|
243
243
|
function Ua(a,b=32){const c='0123456789abcdef'.split('');var d=a,e=d.length;a=[1732584193,-271733879,-1732584194,271733878];var f;for(f=64;f<=d.length;f+=64){var g=d.substring(f-64,f),h=[];for(let k=0;64>k;k+=4)h[k>>2]=g.charCodeAt(k)+(g.charCodeAt(k+1)<<8)+(g.charCodeAt(k+2)<<16)+(g.charCodeAt(k+3)<<24);Ta(a,h)}d=d.substring(f-64);g=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(f=0;f<d.length;f++)g[f>>2]|=d.charCodeAt(f)<<(f%4<<3);g[f>>2]|=128<<(f%4<<3);if(55<f)for(Ta(a,g),f=0;16>f;f++)g[f]=0;g[14]=8*e;
|
|
244
|
-
Ta(a,g);d='';e=0;b=0<=b?b:32;for(f=0;4>f;f++)for(h=a[f],g=0;4>g;g++){if(++e>b)return d;d+=c[h>>8*g+4&15];if(++e>b)return d;d+=c[h>>8*g&15]}return d}'5d41402abc4b2a76b9719d911017c592'!==Ua('hello')&&(Sa=(a,b)=>{const c=(a&65535)+(b&65535);return(a>>16)+(b>>16)+(c>>16)<<16|c&65535});olympe.Y.
|
|
245
|
-
olympe.Y.
|
|
246
|
-
olympe.Y.th=function(){let a='';for(let b=0;19>b;b++)a+='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'.charAt(Math.floor(62*Math.random()));return'@'+a};olympe.Y.
|
|
247
|
-
olympe.Y.
|
|
248
|
-
r=decodeURIComponent(r);b[q[1]]=r}return{scheme:a||null,
|
|
249
|
-
olympe.Y.
|
|
250
|
-
olympe.Y.mf=class{constructor(a,b,c,d){this.C=a;this.F=b;this.G=c;this.K=d||null}static parse(a){a=/([0-9]*)\.([0-9]*)\.([0-9]*)-?([A-z\-_0-9]*)/.exec(a);if(null===a||4>a.length)return olympe.Y.mf.C;const b=Number.parseInt(a[1],10),c=Number.parseInt(a[2],10),d=Number.parseInt(a[3],10);return isNaN(b)||isNaN(c)||isNaN(d)?olympe.Y.mf.C:new olympe.Y.mf(b,c,d,a[4])}
|
|
251
|
-
a.G}Ka(a){return this.C===a.C&&this.F===a.F&&this.G===a.G}toString(){return`${this.C}.${this.F}.${this.G}`+(null!==this.K?`-${this.K}`:'')}};olympe.Y.mf.C=new olympe.Y.mf(Number.NaN,Number.NaN,Number.NaN);olympe.Y.R={
|
|
252
|
-
olympe.
|
|
253
|
-
olympe.
|
|
254
|
-
this.G,a)}log(...a){this.O()&&ab(this,'log',this.G,a)}info(...a){this.
|
|
255
|
-
(d=!0===this.C.getParameter(c));b=new olympe.
|
|
256
|
-
olympe.D.J.F=new olympe.D.J(()=>olympe.D.Na);olympe.D.J.O=new olympe.D.J(()=>olympe.D.ea);olympe.D.J.T=new olympe.D.J(()=>olympe.D.Sb);olympe.D.Tg=class{V(){return''}Fd(){return''}destroy(){}
|
|
257
|
-
olympe.D.Yb=class{constructor(a='SimpleContext',b){++eb;this.
|
|
258
|
-
this.
|
|
259
|
-
this.Ta.get(b)();this.Ta.clear()}onDestroy(a,b){void 0===b&&(++this.Tb,b=String(this.Tb));this.
|
|
260
|
-
function gb(a,b){a.fa||(a.fa=new Map);a.fa.set(b.V(),b);switch(b.
|
|
261
|
-
default:olympe.D.H.warn('Unknown state, investigate: ',b.
|
|
262
|
-
function jb(a){if(a.wd){var b=[],c=[];if(a.
|
|
263
|
-
lb(a,e.Da):e instanceof olympe.D.Node?lb(a,e):(L(a,e),void 0===e&&void 0===a.valueType&&hb(a,olympe.D.Node.C.jh))}else mb(a)})}}function N(a){void 0===a.ac&&(a.ac=a.valueType===olympe.D.Proxy?nb(void 0,a.
|
|
264
|
-
function sb(a){if(a.C!==olympe.D.Node.C.OBSOLETE&&a.C!==olympe.D.Node.C.
|
|
265
|
-
function L(a,b,c){b instanceof olympe.D.Node&&(olympe.D.H.warn('We are setting the value of a node as a node, that should never happen?'),b=b.Db);a.
|
|
266
|
-
a.V()+') value to get updated !');else{a.C===olympe.D.Node.C.
|
|
267
|
-
Object?d=!0:b.toLowerCase()!==e.toLowerCase()&&a.valueType!==Object&&(d=!0),d&&('string'===b.toLowerCase()&&a.valueType===olympe.D.Na?(c=olympe.D.wb(c),d=!1):'number'===b.toLowerCase()&&a.valueType===olympe.D.aa?(c=olympe.D.
|
|
268
|
-
function ub(a,b){if(a.C!==olympe.D.Node.C.
|
|
269
|
-
function lb(a,b){b===a?olympe.D.H.error('Setting a node as provider of itself. Ignoring'):(a.O&&a.O!==b&&ob(a),ib(b,a),kb(b)?L(a,b.Db,!0):void 0!==a.defaultValue?L(a,a.defaultValue,!0):ub(a),a.O=b)}function vb(a,b){a.wd&&(a.wd=void 0);a.
|
|
270
|
-
function ib(a,b){a.T||(a.T=new Map);a.T.set(b.V(),b);a.C===olympe.D.Node.C.
|
|
271
|
-
olympe.D.Node=class extends olympe.D.Yb{constructor({valueType:a,wd:b,
|
|
272
|
-
olympe.D.Node&&gb(this,d);if(g)for(b=0;b<g.length;b++)a=e[g[b]],gb(this,a);c&&jb(this)}Mg(a){this.defaultValue=a;this.C===olympe.D.Node.C.Zg&&L(this,a,!0);return this}
|
|
273
|
-
olympe.D.Node.C.
|
|
274
|
-
wd:c,
|
|
275
|
-
b.O&&b.O.V()===this.V()?b.O=void 0:b.destroy()}a.clear()}this.T=null;super.destroy();if(this.fa){for(const c of this.fa.values())this.fa.has(c.V())&&pb(c,this);this.fa.clear()}this.fa=null;this.O&&(pb(this.O,this),this.O=void 0);this.Db=void 0;this.za&&(this.za.length=0,this.za=null);this.Pf&&(this.Pf.length=0,this.Pf=null);this.
|
|
276
|
-
olympe.D.Node.C={Zg:0,jh:1,Ug:3,
|
|
277
|
-
function zb(a,b){if(a.
|
|
278
|
-
function yb(a,b){let c={};if(b.prototype)olympe.D.H.error('first level of prototyping, investigate');else if(b.__proto__)c=Object.create(xb(a,b.__proto__));else return olympe.D.Proxy.prototype;Object.getOwnPropertyNames(b).forEach(d=>{if('function'===typeof b[d]&&'__getReplacementFunction'!==d){var e=b[d].L;null===e||e&&e.O()?c[d]=function(...f){var g=this.Da;if(g&&kb(g)&&(g=g.Db)&&g[d]&&'function'===typeof g[d])return g[d].apply(g,f)}:(e=e||b[d].__oSig__||olympe.D.J.Z,c[d]=function(...f){f=this.
|
|
279
|
-
...f,e,d);const g=e.Z;if(g){const h=this.Da.Db;h&&h[g]&&zb(f,h[g])}return e.T()?this:f})}});return c}function Ab(a,b){L(a.Da,b)}function Bb(a){ub(a.Da)}function Cb(a,b){vb(a.Da,olympe.D.Sf(b)?b:b.Da)}function Db(a,b){olympe.D.
|
|
280
|
-
olympe.D.Proxy=class{constructor(a,b){this.Da=null;this.
|
|
281
|
-
olympe.D.aa=class{constructor(a){this.value=void 0===a||null===a?0:a}toJSON(){return'{ "type": "number", "value": '+JSON.stringify(this.value)+' }'}static Ub(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return olympe.D.
|
|
282
|
-
this.value&&null!==this.value?'number'===typeof a?this.value.toString(a):'number'===typeof b?this.value.toFixed(b):this.value.toString():'-'}toFixed(a){return this.
|
|
283
|
-
g===c&&e()}});return d.ub()}
|
|
284
|
-
c.valueOf()),olympe.D.aa,'ONumber.div')}
|
|
285
|
-
a],(b,c)=>olympe.D.Qb(b.Ka(c)),olympe.D.ea,'ONumber.oEquals')}Ka(a){return this.valueOf()===(void 0!==a&&null!==a?a.valueOf():void 0)}valueOf(){return void 0!==this.value?this.value.valueOf():void 0}
|
|
286
|
-
a],(b,c)=>b.valueOf()<=c.valueOf()?b:olympe.D.
|
|
287
|
-
b){return olympe.D.
|
|
288
|
-
const k=(l,n)=>{n=olympe.D.
|
|
289
|
-
p)}});return f}static offset(a){let b;return olympe.D.
|
|
290
|
-
e=window.performance.now();b=b.
|
|
291
|
-
return e=olympe.D.ta([a],f=>{const g=olympe.D.Qa(b,1E3),h=olympe.D.Qa(e);return void 0===h?olympe.D.
|
|
292
|
-
olympe.D.ta([a],b=>olympe.D.wb(b.valueOf().toString()),olympe.D.Na):olympe.D.wb(a)}static
|
|
293
|
-
'minus'):olympe.D.
|
|
294
|
-
olympe.D.aa.
|
|
295
|
-
olympe.D.aa.
|
|
296
|
-
olympe.D.aa.
|
|
297
|
-
|
|
298
|
-
10*(a/d-1))+b},
|
|
299
|
-
c*(2*d*d+2*d*a+-3*d)},
|
|
300
|
-
b,c,d){return(a/=d)<1/2.75?7.5625*c*a*a+b:a<2/2.75?c*(7.5625*(a-=1.5/2.75)*a+.75)+b:a<2.5/2.75?c*(7.5625*(a-=2.25/2.75)*a+.9375)+b:c*(7.5625*(a-=2.625/2.75)*a+.984375)+b},
|
|
301
|
-
m.toString.L=new olympe.D.J(()=>String,[]);m.toFixed.L=new olympe.D.J(()=>String,[]);m.
|
|
302
|
-
m.ud.L=new olympe.D.J(()=>olympe.D.ea,[0]);m.Ka.L=olympe.D.J.C;m.valueOf.L=olympe.D.J.C;m.
|
|
303
|
-
a))}
|
|
304
|
-
olympe.D.ea,'OString.contains')}startsWith(a,b){return olympe.D.ta([this,a,b||0],(c,d,e)=>olympe.D.Qb(c.valueOf().startsWith(d.valueOf(),e.valueOf())),olympe.D.ea,'OString.startsWith')}endsWith(a,b){return olympe.D.ta([this,a,b||-1],(c,d,e)=>{e=0<=e.valueOf()?e.valueOf():this.
|
|
305
|
-
olympe.D.aa,'OString.indexOf')}lastIndexOf(a,b){return olympe.D.ta([this,a,b||Infinity],(c,d,e)=>olympe.D.
|
|
306
|
-
b){return olympe.D.ta([this,a,b],(c,d,e)=>olympe.D.wb(c.valueOf().padStart(d.valueOf(),e.valueOf())),olympe.D.Na,'OString.padStart')}padEnd(a,b){return olympe.D.ta([this,a,b],(c,d,e)=>olympe.D.wb(c.valueOf().padEnd(d.valueOf(),e.valueOf())),olympe.D.Na,'OString.padEnd')}replace(a,b){return olympe.D.ta([this,a,b],(c,d,e)=>olympe.D.wb(c.valueOf().replace(d.valueOf(),e.valueOf())),olympe.D.Na,'OString.replace')}
|
|
307
|
-
e.valueOf())),olympe.D.Na,'OString.subOStr')}static concat(...a){return olympe.D.wb('').concat(...a)}};olympe.D.Na.EMPTY=new olympe.D.Na('');olympe.D.Na.
|
|
308
|
-
m.contains.L=new olympe.D.J(()=>olympe.D.ea,[0]);m.startsWith.L=new olympe.D.J(()=>olympe.D.ea,[0,1]);m.endsWith.L=new olympe.D.J(()=>olympe.D.ea,[0,1]);m.indexOf.L=new olympe.D.J(()=>olympe.D.aa,[0,1]);m.lastIndexOf.L=new olympe.D.J(()=>olympe.D.aa,[0,1]);m.slice.L=new olympe.D.J(()=>olympe.D.Na,[0,1]);m.
|
|
309
|
-
m.replace.L=olympe.D.J.F;m.
|
|
310
|
-
olympe.D.
|
|
311
|
-
olympe.D.ea.F:olympe.D.ea.C}xor(a){return olympe.D.ta([this,a],(b,c)=>{b=b.valueOf();c=c.valueOf();return olympe.D.Qb(b&&!c||!b&&c)},olympe.D.ea,'OBoolean.xor')}
|
|
312
|
-
m.and.L=new olympe.D.J(()=>olympe.D.ea,[0]);m.Ka.L=olympe.D.J.C;m.ud.L=new olympe.D.J(()=>olympe.D.ea,[0]);m.
|
|
313
|
-
olympe.D.
|
|
244
|
+
Ta(a,g);d='';e=0;b=0<=b?b:32;for(f=0;4>f;f++)for(h=a[f],g=0;4>g;g++){if(++e>b)return d;d+=c[h>>8*g+4&15];if(++e>b)return d;d+=c[h>>8*g&15]}return d}'5d41402abc4b2a76b9719d911017c592'!==Ua('hello')&&(Sa=(a,b)=>{const c=(a&65535)+(b&65535);return(a>>16)+(b>>16)+(c>>16)<<16|c&65535});olympe.Y.sb=Ua;function Va(a){a='0'.repeat(12)+a.toString(16);return a.substring(a.length-12,a.length)}function Wa(){var a=Math.random();return Va((new Date).getTime())+(a.toString(16)+'0'.repeat(8)).substr(2,8)}const Xa=Math.pow(2,32)-1;olympe.Y.Fc=function(){return Wa()};olympe.Y.sf=function(){return Wa()};olympe.Y.GC=function(a,b=1){const c=a.substr(12,a.length-12);return Va(parseInt(a.substr(0,12),16)+b)+c};
|
|
245
|
+
olympe.Y.EC=function(a){return Va(parseInt(a.substr(0,12),16)+1)+(Math.random().toString(16)+'00000000').substr(2,8)};let Ya=0,Za=0;olympe.Y.Iv=function(){var a=(new Date).getTime();a<=Ya?4294967295===Za?(Za=Math.floor(Math.random()/4*Xa),Ya+=1):Za=Math.floor(Za+(4294967295-Za)/2):(Za=Math.floor(Math.random()/4*Xa),Ya=a);a='00000000'+Za.toString(16);return Va(Ya)+a.substr(a.length-8,8)};olympe.Y.TC=function(){for(let a=0;1E4>a;a++)console.log(olympe.Y.Iv())};
|
|
246
|
+
olympe.Y.th=function(){let a='';for(let b=0;19>b;b++)a+='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'.charAt(Math.floor(62*Math.random()));return'@'+a};olympe.Y.yC=function(a){let b='';for(let c=0;5>c;c++)b+='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'.charAt(Math.floor(62*Math.random()));return(a?a:'UI')+'-'+b};olympe.Y.uC=function(a,b){return(b?b:'UI')+'-'+a};
|
|
247
|
+
olympe.Y.vx=function(a){var b=/^(?:(\S*)@)?([^:]+)(?::(\d{2,5}))?$/;const c=/([^&=]+)=([^&=]+)/g,d=/^true|false$/i,e=/^\d+(\.\d+)?$/;var f=a.match(/^(?:([^:/?#]+):)?(?:\/\/([^/?#]*))?\/?([^?#]*)(?:\?([^#]*))?(?:#(.*))?$/);a=f[1];const g=f[2],h=f[3],k=f[4];f=f[5];let l=null,n=null;var p=null;g&&(p=g.match(b),l=p[1],n=p[2],p=p[3]);b={};let q;for(;q=c.exec(k);){let r=q[2];void 0===r?r=!0:r.startsWith('"')&&r.endsWith('"')?r=r.substring(1,r.length-1):d.test(r)?r='true'===r.toLowerCase():e.test(r)?r=parseFloat(r):
|
|
248
|
+
r=decodeURIComponent(r);b[q[1]]=r}return{scheme:a||null,cC:g||null,Er:l||null,host:n||null,port:p&&parseInt(p,10)||null,path:h&&'/'!==h?h:null,query:k||null,vC:f||null,parameters:b}};olympe.Y.OC=function(a){a=a.substring(1);return''===a?new Map:new Map(a.split('&').map(b=>b.split('=')))};olympe.Y.RC=function(a){let b='';for(let c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b+=(b?'&':'?')+c+'='+encodeURIComponent(a[c]));return b};
|
|
249
|
+
olympe.Y.jw=a=>{var b=olympe.N.qe;const c=Object.keys(b).find(d=>b[d]===a);return void 0===c?null:c};olympe.Y.Pm=(a,b)=>{if(b instanceof Object)for(const c of Object.keys(b)){const d=b[c];d instanceof Object&&void 0!==a[c]?olympe.Y.Pm(a[c],d):a[c]=d}};olympe.Y.xe=(a,b,c)=>{const d=Object.create(null);b(a,e=>{olympe.Y.Pm(d,e);b(`conf.d/${a}`,f=>{olympe.Y.Pm(d,f);c(d)})})};olympe.Y.bC=class a{constructor(b,c){this.x=b;this.y=c}add(b){return new a(this.x+b.x,this.y+b.y)}Bm(){return Math.sqrt(this.x*this.x+this.y*this.y)}toString(){return`Vector(${this.x}, ${this.y})`}};olympe.Y.At=class{constructor(a,b){this.start=a;this.end=b}};olympe.Y.At.C={Bz:'left',oA:'right',iy:'bottom',xB:'top'};function $a(a){return`${a.C}.${a.F}.${a.G}`}
|
|
250
|
+
olympe.Y.mf=class{constructor(a,b,c,d){this.C=a;this.F=b;this.G=c;this.K=d||null}static parse(a){a=/([0-9]*)\.([0-9]*)\.([0-9]*)-?([A-z\-_0-9]*)/.exec(a);if(null===a||4>a.length)return olympe.Y.mf.C;const b=Number.parseInt(a[1],10),c=Number.parseInt(a[2],10),d=Number.parseInt(a[3],10);return isNaN(b)||isNaN(c)||isNaN(d)?olympe.Y.mf.C:new olympe.Y.mf(b,c,d,a[4])}ik(a){return this.C!==a.C?this.C>a.C:this.F!==a.F?this.F>a.F:this.G>a.G}Ri(a){return this.C!==a.C?this.C<a.C:this.F!==a.F?this.F<a.F:this.G<
|
|
251
|
+
a.G}Ka(a){return this.C===a.C&&this.F===a.F&&this.G===a.G}toString(){return`${this.C}.${this.F}.${this.G}`+(null!==this.K?`-${this.K}`:'')}};olympe.Y.mf.C=new olympe.Y.mf(Number.NaN,Number.NaN,Number.NaN);olympe.Y.R={$f:'utils.binaryConverter',Qr:'utils.base64Converter',Jf:'utils.Profiler'};olympe.W.config(a=>{ya(a,olympe.Y.R.$f);xa(a,olympe.Y.R.Qr,olympe.Y.R.$f,!0);D(a,olympe.Y.R.Jf,olympe.Y.au)},'Utils services');olympe.W.run([olympe.Y.R.$f,olympe.Y.R.Jf],(a,b)=>{olympe.Y.Qe=()=>a;olympe.fe().isProfilerEnabled=()=>b.C;olympe.fe().startProfiler=()=>b.start();olympe.fe().stopProfiler=()=>b.stop();olympe.fe().getProfilerEvents=()=>({events:b.G,names:Object.fromEntries(b.O.entries()),models:Object.fromEntries(b.K.entries())})});olympe.ma={};olympe.ma.Gb=class{ia(){}Z(){}K(){}C(){}oa(){}O(){}za(){}ba(){}fa(){}trace(){}debug(){}log(){}info(){}warn(){}error(){}fatal(){}};olympe.ma.Gb.prototype.fatal=olympe.ma.Gb.prototype.fatal;olympe.ma.Gb.prototype.error=olympe.ma.Gb.prototype.error;olympe.ma.Gb.prototype.warn=olympe.ma.Gb.prototype.warn;olympe.ma.Gb.prototype.info=olympe.ma.Gb.prototype.info;olympe.ma.Gb.prototype.log=olympe.ma.Gb.prototype.log;olympe.ma.Gb.prototype.debug=olympe.ma.Gb.prototype.debug;olympe.ma.Gb.prototype.trace=olympe.ma.Gb.prototype.trace;
|
|
252
|
+
olympe.ma.Gb.C={Fu:0,Df:1,wt:2,So:3,Tu:4,Eb:5,zs:6,rj:7};olympe.ma.Gb.F={0:'TRACE',1:'DEBUG',2:'LOG',3:'INFO',4:'WARN',5:'ERROR',6:'FATAL',7:'NOTHING'};olympe.ma.Sa=class{Mc(){}};olympe.ma.le={};function ab(a,b,c,d){a.Ta[b](`[OLYMPE.${c}]:`,d.join(' '));if(0<a.T.size){var e=new Date;e=('00'+e.getHours()).substring(-2)+':'+('00'+e.getMinutes()).substring(-2)+':'+('00'+e.getSeconds()).substring(-2)+'.'+('00'+e.getMilliseconds()).substring(-3);for(const f of a.T.values())f(e,c,b,...d)}}
|
|
253
|
+
olympe.ma.le.Gb=class{constructor(a,b){this.name=a;this.F=b;this.G=a.toUpperCase();this.T=new Map;this.Ta=console}ia(){return this.name}Z(){return this.F}K(){return this.F<=olympe.ma.Gb.C.Fu}C(){return this.F<=olympe.ma.Gb.C.Df}O(){return this.F<=olympe.ma.Gb.C.wt}oa(){return this.F<=olympe.ma.Gb.C.So}za(){return this.F<=olympe.ma.Gb.C.Tu}ba(){return this.F<=olympe.ma.Gb.C.Eb}fa(){return this.F<=olympe.ma.Gb.C.zs}trace(...a){this.K()&&ab(this,'trace',this.G,a)}debug(...a){this.C()&&ab(this,'debug',
|
|
254
|
+
this.G,a)}log(...a){this.O()&&ab(this,'log',this.G,a)}info(...a){this.oa()&&ab(this,'info',this.G,a)}warn(...a){this.za()&&ab(this,'warn',this.G,a)}error(...a){this.ba()&&ab(this,'error',this.G,a)}fatal(...a){this.fa()&&ab(this,'error',this.G,a)}};olympe.ma.le.Gb.xa=[olympe.ma.Gb];olympe.ma.le.Sa=class{constructor(a,b,c){this.C=a;this.F=parseInt(b,10);this.G=c;this.channels=new Map;this.H=this.Mc('logging');this.H.info('Logging initialized, global log level is '+olympe.ma.Gb.F[b])}Mc(a){var b=this.channels.get(a);if(!b){b=this.F;var c=`${olympe.ma.U.Wr}.${a}`;Object.prototype.hasOwnProperty.call(this.C.parameters,c.toLowerCase())&&(b=parseInt(this.C.getParameter(c),10));let d=this.G;c=`${c}.${olympe.ma.U.ru}`;Object.prototype.hasOwnProperty.call(this.C.parameters,c.toLowerCase())&&
|
|
255
|
+
(d=!0===this.C.getParameter(c));b=new olympe.ma.le.Gb(a,b,d);this.channels.set(a,b)}return b}};olympe.ma.le.Sa.xa=[olympe.ma.Sa];olympe.ma.R={Ha:'logging.Manager'};olympe.ma.U={Do:'logging',Eo:'logging.showLogLevel',Wr:'logging',ru:'showLogLevel'};olympe.W.config(function(a){F(a,olympe.ma.U.Do,olympe.ma.Gb.C.So);F(a,olympe.ma.U.Eo,!0);wa(a,olympe.ma.R.Ha,olympe.ma.le.Sa,olympe.W.R.ag,new olympe.W.ka(olympe.ma.U.Do),new olympe.W.ka(olympe.ma.U.Eo))},'olympe.logging');olympe.W.run([olympe.ma.R.Ha],a=>{olympe.ma.eb=b=>a.Mc(b)},'Logging singleton getter initialization');olympe.D={};olympe.D.U={op:'df.nodeCreationThreshold'};const bb=[];function cb(){}function db(){}olympe.D.J=class a{constructor(b,c,d){this.C=void 0===b?cb:b;this.F=void 0===c?bb:c;this.Z=d}static K(){var b=[];return void 0===b||0===b.length?olympe.D.J.ba:new a(db,b)}K(){return this.C?this.C():void 0}G(){return this.F?this.F:bb}O(){return null===this.C&&null===this.F}T(){return this.C===db}};olympe.D.J.Z=new olympe.D.J;olympe.D.J.C=new olympe.D.J(null,null);olympe.D.J.ba=new olympe.D.J(db);olympe.D.J.G=new olympe.D.J(()=>olympe.D.aa);
|
|
256
|
+
olympe.D.J.F=new olympe.D.J(()=>olympe.D.Na);olympe.D.J.O=new olympe.D.J(()=>olympe.D.ea);olympe.D.J.T=new olympe.D.J(()=>olympe.D.Sb);olympe.D.Tg=class{V(){return''}Fd(){return''}destroy(){}hb(){return!1}Tc(){return!1}run(a,...b){return a(...b)}G(a){return a}getParent(){return null}rf(){}Oc(){}ed(){}$j(){}oa(){}onDestroy(){return''}xf(){}Z(){return''}qf(){}};olympe.D.Tg.prototype.offDestroy=olympe.D.Tg.prototype.xf;olympe.D.Tg.prototype.onDestroy=olympe.D.Tg.prototype.onDestroy;let eb=0;olympe.W.run([new olympe.W.ka(olympe.D.U.op)],()=>{});
|
|
257
|
+
olympe.D.Yb=class{constructor(a='SimpleContext',b){++eb;this.nb=new Map;this.bb=new Map;this.Ta=new Map;this.Tb=0;this.name=a;this.id=String(eb);this.K=this.Ab=!1;(this.ba=void 0===b?olympe.D.Xa():b)&&this.ba.Oc(this);this.debug=!1}V(){return this.id}Fd(){return this.name}run(a,...b){if(!this.Ab){var c=olympe.D.Ar(this);a=a(...b);c&&olympe.D.Ar(c);return a}}G(a){return(...b)=>this.run(a,...b)}destroy(){if(!this.Ab&&!this.K){this.K=!0;this.oa();for(const a of this.bb.keys())this.bb.has(a)&&this.bb.get(a)();
|
|
258
|
+
this.bb.clear();this.Ta.clear();this.ba&&(this.ba.ed(this,!1),this.ba=null);this.Ab=!0;this.K=!1;this.oa()}}hb(){return this.Ab}Tc(){return this.K}Oc(a){if(!this.Ab){var b;olympe.D.fb(a)?b=a.Da:olympe.D.Nm(a)&&(b=a);b&&this.nb.set(b.V(),b)}}ed(a,b=!0){let c;olympe.D.fb(a)?c=a.Da:olympe.D.Nm(a)&&(c=a);c&&this.nb.has(c.V())&&(b&&c.$j(this),this.nb.delete(c.V()))}$j(){this.ba=null;this.destroy()}oa(){const a=this.nb;for(const b of a.keys())a.has(b)&&a.get(b).$j(this);this.nb.clear();for(const b of this.Ta.keys())this.Ta.has(b)&&
|
|
259
|
+
this.Ta.get(b)();this.Ta.clear()}onDestroy(a,b){void 0===b&&(++this.Tb,b=String(this.Tb));this.bb.set(b,a);return b}xf(a){this.bb.delete(a)}Z(a){if(void 0===b){++this.Tb;var b=String(this.Tb)}this.Ta.set(b,a);return b}qf(a){this.Ta.delete(a)}rf(a){this.ba&&this.ba.ed(this,!1);(this.ba=a||null)&&this.ba.Oc(this)}getParent(){return this.ba}};olympe.D.hq=class extends olympe.D.Yb{constructor(){super('Root',null)}destroy(){}onDestroy(){return''}xf(){}};olympe.D.Tg.xa=[olympe.D.Tg];let fb=0;
|
|
260
|
+
function gb(a,b){a.fa||(a.fa=new Map);a.fa.set(b.V(),b);switch(b.yc()){case olympe.D.Node.C.Zg:break;case olympe.D.Node.C.jh:break;case olympe.D.Node.C.tj:case olympe.D.Node.C.Ef:olympe.D.H.warn('Not bad as such but should not happen!');break;case olympe.D.Node.C.Ug:hb(a,olympe.D.Node.C.Ug);break;case olympe.D.Node.C.OBSOLETE:a.ec=!0;a.C!==olympe.D.Node.C.Ug&&hb(a,olympe.D.Node.C.OBSOLETE);break;case olympe.D.Node.C.Ld:olympe.D.H.warn('Adding a destroyed node as upstream => should never happen!');break;
|
|
261
|
+
default:olympe.D.H.warn('Unknown state, investigate: ',b.yc())}ib(b,a)}
|
|
262
|
+
function jb(a){if(a.wd){var b=[],c=[];if(a.yf)if(a.yf instanceof olympe.D.Node)if(kb(a.yf))b=a.yf.Db;else return;else b=a.yf;else b=null;if(null!==a.za){const e=a.Pf;for(let f=0,g=a.za.length;f<g;f++)if(null!==e&&-1<e.indexOf(f)){const h=a.za[f];if(kb(h))c.push(h.Db);else return}else c.push(a.za[f])}if(a.wd instanceof Function)var d=a.wd;else b&&(b[a.wd]||olympe.D.H.warn('looks like you forget a cast somewhere around '+a.wd),d=b[a.wd]);a.run(()=>{a.oa();if(void 0!==d){const e=d.apply(b,c);e&&e.Qq?
|
|
263
|
+
lb(a,e.Da):e instanceof olympe.D.Node?lb(a,e):(L(a,e),void 0===e&&void 0===a.valueType&&hb(a,olympe.D.Node.C.jh))}else mb(a)})}}function N(a){void 0===a.ac&&(a.ac=a.valueType===olympe.D.Proxy?nb(void 0,a.Ne):nb(a.valueType,a.Ne),a.ac.Da=a);return a.ac}function ob(a){void 0!==a.O&&(pb(a.O,a),a.O=void 0)}function qb(a){if(a.C===olympe.D.Node.C.OBSOLETE&&(a.C=olympe.D.Node.C.jh,null!==a.T))for(const b of a.T.values())rb(b)}function hb(a,b){b!==a.C&&(a.C=b)}
|
|
264
|
+
function sb(a){if(a.C!==olympe.D.Node.C.OBSOLETE&&a.C!==olympe.D.Node.C.tj&&a.C!==olympe.D.Node.C.Zg&&a.C!==olympe.D.Node.C.Ug){hb(a,olympe.D.Node.C.tj);var b=a.T;if(b)for(const c of b.values())b.has(c.V())&&sb(c);hb(a,olympe.D.Node.C.OBSOLETE)}}function tb(a,b,c){if(a.C!==olympe.D.Node.C.Ef)if(b===a.O)L(a,c,!0);else{if(a.C===olympe.D.Node.C.OBSOLETE||a.C===olympe.D.Node.C.tj)a.ec=!0;jb(a)}}
|
|
265
|
+
function L(a,b,c){b instanceof olympe.D.Node&&(olympe.D.H.warn('We are setting the value of a node as a node, that should never happen?'),b=b.Db);a.Nb||c||void 0===a.O||ob(a);if(void 0!==b){if((a.Nb||a.C===olympe.D.Node.C.jh||a.C===olympe.D.Node.C.OBSOLETE)&&!olympe.D.fb(b)&&void 0!==a.Db){if(null===b&&null===a.Db){qb(a);return}if(null!==b&&null!==a.Db&&(b.valueOf()===a.Db.valueOf()||a.Db.Ka&&a.Db.Ka(b))){qb(a);return}}if(!0===a.Nb)olympe.D.H.error("Circular dependency detected: updating a downstream node caused this node's (#"+
|
|
266
|
+
a.V()+') value to get updated !');else{a.C===olympe.D.Node.C.Ld&&olympe.D.H.warn(`trying to set a value on a destroyed node (#${a.V()} ${a.gd?', '+a.gd:''})`);a.C===olympe.D.Node.C.Ef&&olympe.D.H.warn(`trying to set a value on a node being destroyed (#${a.V()} ${a.gd?', '+a.gd:''})`);a.Nb=!0;c=b;var d=!1,e=(f,g)=>f instanceof g?!0:!1;void 0===a.valueType||null===c||e(c,a.valueType)||(e=a.valueType&&a.valueType.name?a.valueType.name:'undefined',b='object'===typeof c?b.constructor.name:typeof c,c instanceof
|
|
267
|
+
Object?d=!0:b.toLowerCase()!==e.toLowerCase()&&a.valueType!==Object&&(d=!0),d&&('string'===b.toLowerCase()&&a.valueType===olympe.D.Na?(c=olympe.D.wb(c),d=!1):'number'===b.toLowerCase()&&a.valueType===olympe.D.aa?(c=olympe.D.ra(c),d=!1):'boolean'===b.toLowerCase()&&a.valueType===olympe.D.ea&&(c=olympe.D.Qb(c),d=!1)));a.Db=c;hb(a,olympe.D.Node.C.jh);if(b=a.T){d=0;for(const f of b.values())0<d&&sb(f),d++;for(const f of b.values())tb(f,a,c)}a.Nb=!1}}}
|
|
268
|
+
function ub(a,b){if(a.C!==olympe.D.Node.C.Ef&&a.C!==olympe.D.Node.C.Ld&&(a.C!==olympe.D.Node.C.Zg||a.wd)){var c=void 0!==a.defaultValue;a.wd&&b!==a.O&&a.oa();if(c)L(a,a.defaultValue,!0);else if(a.Db=void 0,hb(a,olympe.D.Node.C.Zg),b=a.T)for(const d of b.values())ub(d,a)}}function mb(a){if(a.C!==olympe.D.Node.C.Ug){hb(a,olympe.D.Node.C.Ug);var b=a.T;if(b)for(const c of b.values())mb(c);a.oa();void 0!==a.O&&ob(a);a.Db=a.defaultValue}}function kb(a){return a.C===olympe.D.Node.C.jh}
|
|
269
|
+
function lb(a,b){b===a?olympe.D.H.error('Setting a node as provider of itself. Ignoring'):(a.O&&a.O!==b&&ob(a),ib(b,a),kb(b)?L(a,b.Db,!0):void 0!==a.defaultValue?L(a,a.defaultValue,!0):ub(a),a.O=b)}function vb(a,b){a.wd&&(a.wd=void 0);a.gd='Repeater';lb(a,b)}function rb(a){a.O?qb(a):null!==a.fa&&0===Array.from(a.fa.values()).filter(b=>!kb(b)).length&&(a.ec&&(a.ec=!1,jb(a)),qb(a))}
|
|
270
|
+
function ib(a,b){a.T||(a.T=new Map);a.T.set(b.V(),b);a.C===olympe.D.Node.C.Ld&&olympe.D.H.warn('adding a downstream node on a deleted one (#'+a.V()+') !')}function pb(a,b){a.T&&(b=b.V(),a.T.has(b)&&(a.T.delete(b),wb(a)))}function wb(a){if(null===a.getParent()){var b=a.T;b&&0<b.size||a.destroy()}}
|
|
271
|
+
olympe.D.Node=class extends olympe.D.Yb{constructor({valueType:a,wd:b,zx:c=!0,yf:d,Jm:e,debug:f=!1,Pf:g=null,gd:h='Node',ti:k}={}){++fb;super(String(fb));this.debug=!!f;this.gd=h;h&&'string'===typeof h||(b?this.gd=b.name?b.name:'anon()':this.gd='Node');this.za=e&&0<e.length?e:null;this.Pf=g&&0<g.length?g:null;this.valueType=a;this.Db=void 0;this.Nb=!1;this.C=olympe.D.Node.C.Zg;this.ec=!1;this.T=this.fa=null;this.wd=b;this.yf=d||null;this.defaultValue=this.ac=this.O=void 0;this.ti=k;d&&d instanceof
|
|
272
|
+
olympe.D.Node&&gb(this,d);if(g)for(b=0;b<g.length;b++)a=e[g[b]],gb(this,a);c&&jb(this)}Mg(a){this.defaultValue=a;this.C===olympe.D.Node.C.Zg&&L(this,a,!0);return this}vi(a){this.valueType=a}Pb(){return this.valueType||Object}asObservable(a=olympe.D.Xa()){return new rxjs.Observable(b=>{const c=a.run(()=>olympe.D.createNode(this.valueType,b.next.bind(b),null,[this],[0],`Observable of ${this.gd}`));c.onDestroy(()=>b.complete());return()=>c.destroy()})}yc(){return this.C}hb(){return this.C===olympe.D.Node.C.Ld}Tc(){return this.C===
|
|
273
|
+
olympe.D.Node.C.Ef}Ne(...a){if(this.ti instanceof Function)return this.ti(...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.yc();a!==olympe.D.Node.C.Ef&&a!==olympe.D.Node.C.Ld||olympe.D.H.warn('Calling a function on a destroyed node!!!',this);a=d.G();b=[];if(1===a.length&&-1===a[0])for(var g of e)olympe.D.fb(g)&&b.push(g.Da);else for(let h=0,k=a.length;h<k;h++)g=a[h],f=e[g],void 0!==f&&null!==f&&f.zg&&(e[g]=f.Da,b.push(g));return N(new olympe.D.Node({valueType:d.K(),
|
|
274
|
+
wd:c,yf:this,Jm:e,debug:!1,Pf:b,gd:'Proxy.'+c+'()'}))}$j(a){if(null===this.getParent())olympe.D.H.warn('context is undefined, investigate');else if(this.getParent()!==a){olympe.D.H.warn('Investigate a potential issue in creator-createe link: create node mismatch',a,this.getParent());return}this.rf(null);wb(this)}destroy(){var a=this.C;if(a!==olympe.D.Node.C.Ef&&a!==olympe.D.Node.C.Ld){hb(this,olympe.D.Node.C.Ef);if(a=this.T){for(const c of a.values())if(a.has(c.V())){var b=c;b.fa&&b.fa.delete(this.V());
|
|
275
|
+
b.O&&b.O.V()===this.V()?b.O=void 0:b.destroy()}a.clear()}this.T=null;super.destroy();if(this.fa){for(const c of this.fa.values())this.fa.has(c.V())&&pb(c,this);this.fa.clear()}this.fa=null;this.O&&(pb(this.O,this),this.O=void 0);this.Db=void 0;this.za&&(this.za.length=0,this.za=null);this.Pf&&(this.Pf.length=0,this.Pf=null);this.ti=this.wd=void 0;this.defaultValue=this.yf=null;this.gd=`** Destroyed ** ${this.gd}`;hb(this,olympe.D.Node.C.Ld)}}Fd(){return this.gd}};olympe.D.Node.F='rootNode';
|
|
276
|
+
olympe.D.Node.C={Zg:0,jh:1,Ug:3,tj:4,OBSOLETE:5,Ef:6,Ld:7};function nb(a,b){if('function'!==typeof a)return new olympe.D.Proxy(a,b);var c=olympe.D.Proxy.prototype;void 0===a.prototype&&olympe.D.H.error('investigate');c=Object.create(xb(c,a.prototype));c.Vj=a;c.Rq=b;return c}function xb(a,b){Object.prototype.hasOwnProperty.call(b,olympe.D.Proxy.Fl)||Object.defineProperty(b,olympe.D.Proxy.Fl,{enumerable:!1,configurable:!1,writable:!1,value:yb(a,b)});return b[olympe.D.Proxy.Fl]}
|
|
277
|
+
function zb(a,b){if(a.Vj!==b){a.Vj=b;b.prototype||olympe.D.H.error('Cast not possible, provided type is not a valid type!');var c=xb(a,b.prototype);Object.setPrototypeOf?Object.setPrototypeOf(a,c):a.__proto__=c;a.Da&&a.Da.vi(b)}}
|
|
278
|
+
function yb(a,b){let c={};if(b.prototype)olympe.D.H.error('first level of prototyping, investigate');else if(b.__proto__)c=Object.create(xb(a,b.__proto__));else return olympe.D.Proxy.prototype;Object.getOwnPropertyNames(b).forEach(d=>{if('function'===typeof b[d]&&'__getReplacementFunction'!==d){var e=b[d].L;null===e||e&&e.O()?c[d]=function(...f){var g=this.Da;if(g&&kb(g)&&(g=g.Db)&&g[d]&&'function'===typeof g[d])return g[d].apply(g,f)}:(e=e||b[d].__oSig__||olympe.D.J.Z,c[d]=function(...f){f=this.Rq.call(this.Da,
|
|
279
|
+
...f,e,d);const g=e.Z;if(g){const h=this.Da.Db;h&&h[g]&&zb(f,h[g])}return e.T()?this:f})}});return c}function Ab(a,b){L(a.Da,b)}function Bb(a){ub(a.Da)}function Cb(a,b){vb(a.Da,olympe.D.Sf(b)?b:b.Da)}function Db(a,b){olympe.D.fb(b)||olympe.D.Sf(b)?Cb(a,b):Ab(a,b)}
|
|
280
|
+
olympe.D.Proxy=class{constructor(a,b){this.Da=null;this.Vj=a;this.Rq=b}static fb(a){return!(!a||!a.zg)}Ka(a){return olympe.D.ta([this,a],(b,c)=>b===c,Boolean)}ud(a){return olympe.D.ta([this,a],(b,c)=>null===b||null===c?b===c?olympe.D.ea.F:olympe.D.ea.C:b.valueOf()===c.valueOf()?olympe.D.ea.F:olympe.D.ea.C,olympe.D.ea)}asObservable(a){return this.Da.asObservable(a)}Qq(){return this.Da}};olympe.D.Proxy.Fl='__opp__';olympe.D.Proxy.prototype.zg=!0;function Eb(a,b){a.node.Mg(b);return a}olympe.D.jj=class{constructor(a,b='FlowSource'){this.node=olympe.D.createNode(a,void 0,void 0,void 0,void 0,b)}update(a){olympe.D.fb(a)?L(this.node,olympe.D.Qa(a)):L(this.node,a);return this}repeat(a){vb(this.node,olympe.D.fb(a)?a.Da:a);return this}clear(){ub(this.node);return this}ub(){return N(this.node)}getContext(){return this.node}};function Fb(a,b,c=1E3,d,e){const f=olympe.D.ic(olympe.D.aa),g=d||olympe.D.aa.ko.hp;let h,k,l,n;f.update(olympe.D.ra(a));const p=window.performance.now(),q=b.valueOf();l=q-a.valueOf();if(0!==l&&void 0===n){const r=()=>{f.getContext().hb()||(l=q-a.valueOf(),k=(window.performance.now()-p)/c,1<=k&&(k=1,n=void 0),h=a.valueOf()+l*g(k,0,1,1),f.update(olympe.D.ra(h)),1===k&&void 0!==e&&e(h),1>k&&(n=window.requestAnimationFrame(r)))};n=window.requestAnimationFrame(r)}return f.ub()}
|
|
281
|
+
olympe.D.aa=class{constructor(a){this.value=void 0===a||null===a?0:a}toJSON(){return'{ "type": "number", "value": '+JSON.stringify(this.value)+' }'}static Ub(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return olympe.D.ra(b.value)}bn(){return'number'===typeof this.value&&!isNaN(this.value)}isNaN(){return olympe.D.Qb(!this.bn())}Hc(){return null===this.value||void 0===this.value||void 0===this.value.toString||isNaN(this.value)?olympe.D.wb(''):olympe.D.wb(this.value.toString())}toString(a,b){return void 0!==
|
|
282
|
+
this.value&&null!==this.value?'number'===typeof a?this.value.toString(a):'number'===typeof b?this.value.toFixed(b):this.value.toString():'-'}toFixed(a){return this.bn()?this.valueOf().toFixed(a):''}static max(a){const b=new Map;let c=-Infinity;const d=olympe.D.ic(olympe.D.aa,'ONumber.max result'),e=()=>{c=-Infinity;for(const f of b.values())f>c&&(c=f);d.update(olympe.D.ra(c))};a.forEach((f,g)=>{olympe.D.Nc([f],h=>{b.set(g,h.valueOf());e()})},f=>{if(!d.getContext().hb()){var g=b.get(f);b.delete(f);
|
|
283
|
+
g===c&&e()}});return d.ub()}Ud(a){return olympe.D.ta([this,a],(b,c)=>olympe.D.ra(b.valueOf()+c.valueOf()),olympe.D.aa,'ONumber.plus')}Kg(a){return olympe.D.ta([this,a],(b,c)=>olympe.D.ra(b.valueOf()-c.valueOf()),olympe.D.aa,'ONumber.minus')}round(){return olympe.D.ra(Math.round(this.valueOf()))}Si(){return olympe.D.ra(-this.valueOf())}mk(a){return olympe.D.ta([this,a],(b,c)=>olympe.D.ra(b.valueOf()*c.valueOf()),olympe.D.aa,'ONumber.mul')}wi(a){return olympe.D.ta([this,a],(b,c)=>olympe.D.ra(b.valueOf()/
|
|
284
|
+
c.valueOf()),olympe.D.aa,'ONumber.div')}$w(a){return olympe.D.ta([this,a],(b,c)=>olympe.D.ra(b.valueOf()%c.valueOf()),olympe.D.aa,'ONumber.div')}floor(){return olympe.D.ra(Math.floor(this.valueOf()))}ceil(){return olympe.D.ra(Math.ceil(this.valueOf()))}trunc(){return olympe.D.ra(Math.trunc(this.valueOf()))}log(){return olympe.D.ra(Math.log(this.valueOf()))}pow(a){return olympe.D.ta([this,a],(b,c)=>olympe.D.ra(Math.pow(b.valueOf(),c.valueOf())),olympe.D.aa,'ONumber.pow')}exp(){return olympe.D.ra(Math.exp(this.valueOf()))}ud(a){return olympe.D.ta([this,
|
|
285
|
+
a],(b,c)=>olympe.D.Qb(b.Ka(c)),olympe.D.ea,'ONumber.oEquals')}Ka(a){return this.valueOf()===(void 0!==a&&null!==a?a.valueOf():void 0)}valueOf(){return void 0!==this.value?this.value.valueOf():void 0}rw(){return this.valueOf()}Mm(a){return olympe.D.ta([this,a],(b,c)=>b.valueOf()>c.valueOf()?olympe.D.ea.F:olympe.D.ea.C,olympe.D.ea,'ONumber.isBiggerThan')}Dx(a){return olympe.D.ta([this,a],(b,c)=>b.valueOf()>=c.valueOf()?b:olympe.D.ra(c),olympe.D.aa,'ONumber.returnsBiggest')}yr(a){return olympe.D.ta([this,
|
|
286
|
+
a],(b,c)=>b.valueOf()<=c.valueOf()?b:olympe.D.ra(c),olympe.D.aa,'ONumber.returnsSmallest')}Tw(a){return olympe.D.ta([this,a],(b,c)=>b.valueOf()<c.valueOf()?olympe.D.ea.F:olympe.D.ea.C,olympe.D.ea,'ONumber.isSmallerThan')}sin(){return olympe.D.ra(Math.sin(this.valueOf()))}cos(){return olympe.D.ra(Math.cos(this.valueOf()))}atan2(a){return olympe.D.fb(a)?olympe.D.me([a],b=>olympe.D.ra(Math.atan2(this.valueOf(),b.valueOf())),olympe.D.aa):olympe.D.ra(Math.atan2(this.valueOf(),a.valueOf()))}abs(){return olympe.D.ra(Math.abs(this.valueOf()))}Ki(a,
|
|
287
|
+
b){return olympe.D.fb(a)||olympe.D.fb(b)?olympe.D.me([a,b],(c,d)=>olympe.D.ra(this.valueOf()*d.valueOf()+c.valueOf()*(1-d.valueOf())),olympe.D.aa):olympe.D.ra(this.valueOf()*b.valueOf()+a.valueOf()*(1-b.valueOf()))}static Wu(a,b,c,d){'number'===typeof a&&(a=olympe.D.Td(a));'number'===typeof b&&(b=olympe.D.Td(b));'number'===typeof c&&(c=olympe.D.Td(c));let e=0;const f=olympe.D.Td(0);let g,h;void 0!==b&&void 0!==c&&olympe.D.Hi(b.Mm(c),()=>{olympe.ma.eb('df').warn('You have a min bigger than max, cap your inputs')});
|
|
288
|
+
const k=(l,n)=>{n=olympe.D.Td(n);const p=olympe.D.aa.animate(n,500);Cb(f,p);Ab(n,olympe.D.ra(l));e=l};olympe.D.me([a],l=>{e+=l.valueOf();e>h?k(h,e):e<g?k(g,e):Cb(f,olympe.D.Td(e))},olympe.D.aa);void 0!==b&&olympe.D.Rm(b.valueOf(),l=>{if(g!==l&&(g=l,g>e)){const n=olympe.D.Td(e),p=olympe.D.aa.animate(n,400,d);l=olympe.D.ra(g);L(n.Da,l);e=g;Cb(f,p)}});void 0!==c&&olympe.D.Rm(c.valueOf(),l=>{if(h!==l&&(h=l,h<e)){const n=olympe.D.Td(e),p=olympe.D.aa.animate(n,400,d);l=olympe.D.ra(h);L(n.Da,l);e=h;Cb(f,
|
|
289
|
+
p)}});return f}static offset(a){let b;return olympe.D.me([a],c=>{void 0===b&&(b=c);return olympe.D.ra(c-b)},olympe.D.aa,'offset')}static br(a){let b,c,d;return olympe.D.ta([a],e=>{if(void 0===b)return b=e,c=window.performance.now(),olympe.D.ra(0);d=window.performance.now();const f=olympe.D.ra((e.valueOf()-b.valueOf())/(d-c));b=e;c=d;return f},olympe.D.aa,'derivative')}static Ow(a){let b=olympe.D.ra(0),c,d,e;return olympe.D.ta([a],f=>{if(void 0===c)return c=f,d=window.performance.now(),olympe.D.ra(0);
|
|
290
|
+
e=window.performance.now();b=b.Ud((f.valueOf()+c.valueOf())/2*(e-d));c=f;d=e;return b},olympe.D.aa,'integrate')}static wv(a){let b;return olympe.D.ta([a],c=>{void 0===b&&(b=c.valueOf());const d=olympe.D.ra(c.valueOf()-b.valueOf());b=c;return d},olympe.D.aa,'diff')}static mv(a,b,c){return olympe.D.me([a,b,c],(d,e,f)=>{d='number'===typeof d?d:d.valueOf();e='number'===typeof e?e:e.valueOf();f='number'===typeof f?f:f.valueOf();return olympe.D.ra(d>=e?d<=f?d:f:e)},olympe.D.aa)}static animate(a,b,c,d){let e;
|
|
291
|
+
return e=olympe.D.ta([a],f=>{const g=olympe.D.Qa(b,1E3),h=olympe.D.Qa(e);return void 0===h?olympe.D.ra(f):Fb(h,f,g,c,k=>{d&&d(k)})},olympe.D.aa)}static hv(a,b,c){let d,e,f,g,h,k,l=olympe.D.Td(),n;olympe.D.Nc([a],p=>{void 0===d?g=d=p.valueOf():d=g;f=window.performance.now();e=p.valueOf();k=e-d;0!==k&&void 0===n&&(n=setInterval(()=>{k=e-d;h=(window.performance.now()-f)/b;1<=h&&(h=1);g=d+k*c(h,0,1,1);Ab(l,olympe.D.ra(g));1===h&&(clearTimeout(n),n=void 0)},0))});return l}static Hc(a){return olympe.D.fb(a)?
|
|
292
|
+
olympe.D.ta([a],b=>olympe.D.wb(b.valueOf().toString()),olympe.D.Na):olympe.D.wb(a)}static Si(a){return olympe.D.fb(a)?olympe.D.ta([a],b=>olympe.D.ra(-b.valueOf()),olympe.D.aa):olympe.D.ra(-a.valueOf())}static Ud(a,b){return olympe.D.fb(a)||olympe.D.fb(b)?olympe.D.ta([a,b],(c,d)=>olympe.D.ra(c.valueOf()+d.valueOf()),olympe.D.aa,'plus'):olympe.D.ra(a.valueOf()+b.valueOf())}static Kg(a,b){return olympe.D.fb(a)||olympe.D.fb(b)?olympe.D.me([a,b],(c,d)=>olympe.D.ra(c.valueOf()-d.valueOf()),olympe.D.aa,
|
|
293
|
+
'minus'):olympe.D.ra(a.valueOf()-b.valueOf())}static wi(a,b){return olympe.D.fb(a)||olympe.D.fb(b)?olympe.D.me([a,b],(c,d)=>olympe.D.ra(c.valueOf()/d.valueOf()),olympe.D.aa,'div'):olympe.D.ra(a.valueOf()/b.valueOf())}static xx(a,b){if(void 0===b)return a;olympe.D.Nc([b],c=>{c=olympe.D.ra(a.Da.Db.valueOf()+c.valueOf());L(a.Da,c)},'plusEqual');return a}};olympe.D.aa.ZERO=new olympe.D.aa(0);olympe.D.aa.ONE=new olympe.D.aa(1);olympe.D.aa.Hu=new olympe.D.aa(2);olympe.D.aa.PI=new olympe.D.aa(Math.PI);
|
|
294
|
+
olympe.D.aa.Os=new olympe.D.aa(Infinity);olympe.D.aa.Ht=new olympe.D.aa(-Infinity);olympe.D.aa.np=new olympe.D.aa(NaN);olympe.D.aa.iA=olympe.D.aa.xx;olympe.D.aa.Xx=olympe.D.aa.Wu;olympe.D.aa.Yz=olympe.D.aa.offset;olympe.D.aa.Fy=olympe.D.aa.br;olympe.D.aa.nC=olympe.D.aa.br;olympe.D.aa.Az=olympe.D.aa.Ow;olympe.D.aa.Gy=olympe.D.aa.wv;olympe.D.aa.my=olympe.D.aa.mv;olympe.D.aa.Yx=olympe.D.aa.animate;olympe.D.aa.Zx=olympe.D.aa.hv;olympe.D.aa.zB=olympe.D.aa.Hc;olympe.D.aa.AB=olympe.D.aa.Si;
|
|
295
|
+
olympe.D.aa.hA=olympe.D.aa.Ud;olympe.D.aa.Oz=olympe.D.aa.Kg;olympe.D.aa.Hy=olympe.D.aa.wi;
|
|
296
|
+
olympe.D.aa.ko={hp:function(a,b,c,d){return c*a/d+b},az:function(a,b,c,d){a/=d;return c*a*a+b},kz:function(a,b,c,d){a/=d;return-c*a*(a-2)+b},Xy:function(a,b,c,d){a/=d/2;if(1>a)return c/2*a*a+b;a--;return-c/2*(a*(a-2)-1)+b},Qy:function(a,b,c,d){a/=d;return c*a*a*a+b},gz:function(a,b,c,d){a/=d;a--;return c*(a*a*a+1)+b},Vy:function(a,b,c,d){a/=d/2;if(1>a)return c/2*a*a*a+b;a-=2;return c/2*(a*a*a+2)+b},bz:function(a,b,c,d){a/=d;return c*a*a*a*a+b},lz:function(a,b,c,d){a/=d;a--;return-c*(a*a*a*a-1)+b},
|
|
297
|
+
Yy:function(a,b,c,d){a/=d/2;if(1>a)return c/2*a*a*a*a+b;a-=2;return-c/2*(a*a*a*a-2)+b},cz:function(a,b,c,d){a/=d;return c*a*a*a*a*a+b},mz:function(a,b,c,d){a/=d;a--;return c*(a*a*a*a*a+1)+b},Zy:function(a,b,c,d){a/=d/2;if(1>a)return c/2*a*a*a*a*a+b;a-=2;return c/2*(a*a*a*a*a+2)+b},dz:function(a,b,c,d){return-c*Math.cos(a/d*(Math.PI/2))+c+b},nz:function(a,b,c,d){return c*Math.sin(a/d*(Math.PI/2))+b},$y:function(a,b,c,d){return-c/2*(Math.cos(Math.PI*a/d)-1)+b},Ty:function(a,b,c,d){return c*Math.pow(2,
|
|
298
|
+
10*(a/d-1))+b},jz:function(a,b,c,d){return c*(-Math.pow(2,-10*a/d)+1)+b},Wy:function(a,b,c,d){a/=d/2;if(1>a)return c/2*Math.pow(2,10*(a-1))+b;a--;return c/2*(-Math.pow(2,-10*a)+2)+b},Py:function(a,b,c,d){a/=d;return-c*(Math.sqrt(1-a*a)-1)+b},fz:function(a,b,c,d){a/=d;a--;return c*Math.sqrt(1-a*a)+b},Uy:function(a,b,c,d){a/=d/2;if(1>a)return-c/2*(Math.sqrt(1-a*a)-1)+b;a-=2;return c/2*(Math.sqrt(1-a*a)+1)+b},Ky:function(a,b,c,d){d=(a/=d)*a;return b+c*(4*d*a+-3*d)},Ly:function(a,b,c,d){d=(a/=d)*a;return b+
|
|
299
|
+
c*(2*d*d+2*d*a+-3*d)},My:function(a,b,c,d){d=(a/=d)*a;return b+c*(4*d*a+-9*d+6*a)},Ny:function(a,b,c,d){d=(a/=d)*a;return b+c*(-2*d*d+10*d*a+-15*d+8*a)},iz:function(a,b,c,d){d=(a/=d)*a;const e=d*a;return b+c*(33*e*d+-106*d*d+126*e+-67*d+15*a)},hz:function(a,b,c,d){d=(a/=d)*a;const e=d*a;return b+c*(56*e*d+-175*d*d+200*e+-100*d+20*a)},Sy:function(a,b,c,d){d=(a/=d)*a;a*=d;return b+c*(33*a*d+-59*d*d+32*a+-5*d)},Ry:function(a,b,c,d){d=(a/=d)*a;a*=d;return b+c*(56*a*d+-105*d*d+60*a+-10*d)},ez:function(a,
|
|
300
|
+
b,c,d){return(a/=d)<1/2.75?7.5625*c*a*a+b:a<2/2.75?c*(7.5625*(a-=1.5/2.75)*a+.75)+b:a<2.5/2.75?c*(7.5625*(a-=2.25/2.75)*a+.9375)+b:c*(7.5625*(a-=2.625/2.75)*a+.984375)+b},Oy:function(a,b,c,d){a=d-a;d=(a/=d)<1/2.75?7.5625*c*a*a:a<2/2.75?c*(7.5625*(a-=1.5/2.75)*a+.75):a<2.5/2.75?c*(7.5625*(a-=2.25/2.75)*a+.9375):c*(7.5625*(a-=2.625/2.75)*a+.984375);return c-d+b}};m=olympe.D.aa.prototype;m.toJSON.L=olympe.D.J.C;m.bn.L=olympe.D.J.C;m.isNaN.L=olympe.D.J.O;m.Hc.L=olympe.D.J.F;
|
|
301
|
+
m.toString.L=new olympe.D.J(()=>String,[]);m.toFixed.L=new olympe.D.J(()=>String,[]);m.Ud.L=new olympe.D.J(()=>olympe.D.aa,[0]);m.Kg.L=new olympe.D.J(()=>olympe.D.aa,[0]);m.round.L=olympe.D.J.G;m.Si.L=olympe.D.J.G;m.mk.L=new olympe.D.J(()=>olympe.D.aa,[0]);m.wi.L=new olympe.D.J(()=>olympe.D.aa,[0]);m.$w.L=new olympe.D.J(()=>olympe.D.aa,[0]);m.floor.L=olympe.D.J.G;m.ceil.L=olympe.D.J.G;m.trunc.L=olympe.D.J.G;m.log.L=olympe.D.J.G;m.pow.L=new olympe.D.J(()=>olympe.D.aa,[0]);m.exp.L=olympe.D.J.G;
|
|
302
|
+
m.ud.L=new olympe.D.J(()=>olympe.D.ea,[0]);m.Ka.L=olympe.D.J.C;m.valueOf.L=olympe.D.J.C;m.rw.L=olympe.D.J.C;m.Mm.L=new olympe.D.J(()=>olympe.D.ea,[0]);m.Dx.L=new olympe.D.J(()=>olympe.D.aa,[0]);m.yr.L=new olympe.D.J(()=>olympe.D.aa,[0]);m.Tw.L=new olympe.D.J(()=>olympe.D.ea,[0]);m.sin.L=olympe.D.J.G;m.cos.L=olympe.D.J.G;m.atan2.L=new olympe.D.J(()=>olympe.D.aa,[0]);m.abs.L=olympe.D.J.G;m.Ki.L=new olympe.D.J(()=>olympe.D.aa,[0,1]);olympe.D.Na=class{constructor(a){this.value=a}toJSON(){return'{ "type": "string", "value": '+JSON.stringify(this.value)+' }'}static Ub(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return olympe.D.wb(b.value)}Zq(a){return olympe.D.Na.concat(this,'.',a)}concat(...a){let b;Array.isArray(a[0])?b=a[0]:b=a;return olympe.D.ta([this,...b],(...c)=>{let d='';for(let e=0,f=c.length;e<f;e++)d=c[e]?d+c[e].valueOf():d+c[e];return olympe.D.wb(d)},olympe.D.Na,'OString.concat')}Hc(){return this}Rx(a){return olympe.D.ra(parseInt(this.value,
|
|
303
|
+
a))}Cr(){return olympe.D.ra(parseFloat(this.value))}toString(){return this.value}valueOf(){return this.value.valueOf()}Ka(a){return this.value===(void 0===a||null===a?void 0:a.valueOf())}ud(a){return olympe.D.ta([this,a],(b,c)=>olympe.D.Qb(c&&b.valueOf()===c.valueOf()),olympe.D.ea,'OString.oEquals')}zh(){return olympe.D.Qb(!this.value||0===this.value.length)}contains(a){return olympe.D.ta([this,a],(b,c)=>olympe.D.Qb((c instanceof olympe.D.Na||'string'===typeof c)&&b.valueOf().includes(c.valueOf())),
|
|
304
|
+
olympe.D.ea,'OString.contains')}startsWith(a,b){return olympe.D.ta([this,a,b||0],(c,d,e)=>olympe.D.Qb(c.valueOf().startsWith(d.valueOf(),e.valueOf())),olympe.D.ea,'OString.startsWith')}endsWith(a,b){return olympe.D.ta([this,a,b||-1],(c,d,e)=>{e=0<=e.valueOf()?e.valueOf():this.Bm().valueOf()+e.valueOf()+1;return olympe.D.Qb(c.valueOf().endsWith(d.valueOf(),e))},olympe.D.ea,'OString.endsWith')}indexOf(a,b){return olympe.D.ta([this,a,b||0],(c,d,e)=>olympe.D.ra(c.valueOf().indexOf(d.valueOf(),e.valueOf())),
|
|
305
|
+
olympe.D.aa,'OString.indexOf')}lastIndexOf(a,b){return olympe.D.ta([this,a,b||Infinity],(c,d,e)=>olympe.D.ra(c.valueOf().lastIndexOf(d.valueOf(),e.valueOf())),olympe.D.aa,'OString.lastIndexOf')}slice(a,b){return olympe.D.ta([this,a,b],(c,d,e)=>olympe.D.wb(c.valueOf().slice(d.valueOf(),e?e.valueOf():void 0)),olympe.D.Na,'OString.slice')}Bm(){return olympe.D.ra(this.value.length)}threshold(a){return olympe.D.ta([this,a],(b,c)=>b.valueOf().length>=c.valueOf()?b:olympe.D.Na.EMPTY,olympe.D.Na,'OString.threshold')}toLowerCase(){return olympe.D.wb(this.value.toLowerCase())}toUpperCase(){return olympe.D.wb(this.value.toUpperCase())}trim(){return olympe.D.wb(this.value.trim())}padStart(a,
|
|
306
|
+
b){return olympe.D.ta([this,a,b],(c,d,e)=>olympe.D.wb(c.valueOf().padStart(d.valueOf(),e.valueOf())),olympe.D.Na,'OString.padStart')}padEnd(a,b){return olympe.D.ta([this,a,b],(c,d,e)=>olympe.D.wb(c.valueOf().padEnd(d.valueOf(),e.valueOf())),olympe.D.Na,'OString.padEnd')}replace(a,b){return olympe.D.ta([this,a,b],(c,d,e)=>olympe.D.wb(c.valueOf().replace(d.valueOf(),e.valueOf())),olympe.D.Na,'OString.replace')}Nx(a,b){return olympe.D.ta([this,a,b],(c,d,e)=>olympe.D.wb(c.valueOf().substr(d.valueOf(),
|
|
307
|
+
e.valueOf())),olympe.D.Na,'OString.subOStr')}static concat(...a){return olympe.D.wb('').concat(...a)}};olympe.D.Na.EMPTY=new olympe.D.Na('');olympe.D.Na.tu=new olympe.D.Na(' ');m=olympe.D.Na.prototype;m.toJSON.L=olympe.D.J.C;m.Zq.L=new olympe.D.J(()=>olympe.D.Na,[0,1]);m.concat.L=olympe.D.J.F;m.Hc.L=olympe.D.J.F;m.Rx.L=olympe.D.J.G;m.Cr.L=olympe.D.J.G;m.toString.L=olympe.D.J.C;m.valueOf.L=olympe.D.J.C;m.Ka.L=olympe.D.J.C;m.ud.L=new olympe.D.J(()=>olympe.D.ea,[0]);m.zh.L=olympe.D.J.O;
|
|
308
|
+
m.contains.L=new olympe.D.J(()=>olympe.D.ea,[0]);m.startsWith.L=new olympe.D.J(()=>olympe.D.ea,[0,1]);m.endsWith.L=new olympe.D.J(()=>olympe.D.ea,[0,1]);m.indexOf.L=new olympe.D.J(()=>olympe.D.aa,[0,1]);m.lastIndexOf.L=new olympe.D.J(()=>olympe.D.aa,[0,1]);m.slice.L=new olympe.D.J(()=>olympe.D.Na,[0,1]);m.Bm.L=olympe.D.J.G;m.threshold.L=new olympe.D.J(()=>olympe.D.Na,[0]);m.toLowerCase.L=olympe.D.J.F;m.toUpperCase.L=olympe.D.J.F;m.trim.L=olympe.D.J.F;m.padStart.L=olympe.D.J.F;m.padEnd.L=olympe.D.J.F;
|
|
309
|
+
m.replace.L=olympe.D.J.F;m.Nx.L=olympe.D.J.F;olympe.D.ea=class{constructor(a){this.value=a}toJSON(){return`{ "type": "boolean", "value": ${this.value.valueOf()}}`}static Ub(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return b.value?olympe.D.ea.F:olympe.D.ea.C}and(a){if(void 0!==a)return olympe.D.fb(a)?olympe.D.me([a],b=>new olympe.D.ea(this.valueOf()&&b.valueOf()),olympe.D.ea,'and'):this.value&&a.valueOf()?olympe.D.ea.F:olympe.D.ea.C}Ka(a){return this.valueOf()===(void 0!==a?a.valueOf():void 0)}ud(a){if(void 0!==a)return olympe.D.fb(a)?
|
|
310
|
+
olympe.D.me([a],b=>new olympe.D.ea(this.valueOf()===b.valueOf()),olympe.D.ea,'oEquals'):this.Ka(a)?olympe.D.ea.F:olympe.D.ea.C}jd(){return this.value?olympe.D.ea.C:olympe.D.ea.F}gv(a){if(void 0!==a)return olympe.D.fb(a)?olympe.D.me([a],b=>new olympe.D.ea(!(this.valueOf()&&b.valueOf())),olympe.D.ea,'andNot'):this.value&&!a.valueOf()?olympe.D.ea.F:olympe.D.ea.C}or(a){if(void 0!==a)return olympe.D.fb(a)?olympe.D.me([a],b=>new olympe.D.ea(this.valueOf()||b.valueOf()),olympe.D.ea,'or'):this.value||a.valueOf()?
|
|
311
|
+
olympe.D.ea.F:olympe.D.ea.C}xor(a){return olympe.D.ta([this,a],(b,c)=>{b=b.valueOf();c=c.valueOf();return olympe.D.Qb(b&&!c||!b&&c)},olympe.D.ea,'OBoolean.xor')}Kv(){return this.value}lr(){return!0===this.value?olympe.D.aa.ONE:olympe.D.aa.ZERO}Hc(){return olympe.D.wb(this.toString())}toString(){return this.value?'true':'false'}valueOf(){return this.value}};olympe.D.ea.F=new olympe.D.ea(!0);olympe.D.ea.C=new olympe.D.ea(!1);m=olympe.D.ea.prototype;m.toJSON.L=olympe.D.J.C;
|
|
312
|
+
m.and.L=new olympe.D.J(()=>olympe.D.ea,[0]);m.Ka.L=olympe.D.J.C;m.ud.L=new olympe.D.J(()=>olympe.D.ea,[0]);m.jd.L=olympe.D.J.O;m.gv.L=new olympe.D.J(()=>olympe.D.ea,[0]);m.or.L=new olympe.D.J(()=>olympe.D.ea,[0]);m.xor.L=new olympe.D.J(()=>olympe.D.ea,[0]);m.Kv.L=new olympe.D.J(()=>Boolean,[]);m.lr.L=olympe.D.J.G;m.Hc.L=olympe.D.J.F;m.toString.L=olympe.D.J.C;m.valueOf.L=olympe.D.J.C;function Gb(a){return new olympe.D.gb(new Date(a))}
|
|
313
|
+
olympe.D.gb=class{constructor(a){this.pb=a}toJSON(){return'{ "type": "dateTime", "value": "'+this.pb.toJSON()+'" }'}static Ub(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return new olympe.D.gb(new Date(b.value.valueOf()))}static now(){return new olympe.D.gb(new Date)}Ii(){return this.pb&&!isNaN(this.pb.getTime())?olympe.D.ea.F:olympe.D.ea.C}Vs(){return olympe.D.ra(this.pb.getMilliseconds())}Xs(){return olympe.D.ra(this.pb.getSeconds())}Ws(){return olympe.D.ra(this.pb.getMinutes())}Us(){return olympe.D.ra(this.pb.getHours())}Wv(){return olympe.D.ra(this.pb.getDate())}getMonth(){return olympe.D.ra(this.pb.getMonth()+1)}Ys(){return olympe.D.ra(this.pb.getFullYear())}getTime(){return this.pb.getTime()}Kx(){var a=
|
|
314
314
|
olympe.D,b=a.wb;var c=this.pb.getDate();c=10>c?'0'+c:c;var d=this.pb.getMonth()+1;return b.call(a,`${c}.${10>d?'0'+d:d}.${this.pb.getFullYear()}`)}toLocaleString(a){return void 0===a||'string'===typeof a?olympe.D.wb(this.pb.toLocaleString(a)):olympe.D.ta([this,a],(b,c)=>olympe.D.wb(b.pb.toLocaleString(c.valueOf())),olympe.D.Na)}toLocaleDateString(a){return void 0===a||'string'===typeof a?olympe.D.wb(this.pb.toLocaleDateString(a)):olympe.D.ta([this,a],(b,c)=>olympe.D.wb(b.pb.toLocaleDateString(c.valueOf())),
|
|
315
|
-
olympe.D.Na)}toLocaleTimeString(a){return void 0===a||'string'===typeof a?olympe.D.wb(this.pb.toLocaleTimeString(a)):olympe.D.ta([this,a],(b,c)=>olympe.D.wb(b.pb.toLocaleTimeString(c.valueOf())),olympe.D.Na)}
|
|
316
|
-
a)}
|
|
317
|
-
b=>olympe.D.Qb(this.Ka(b)),olympe.D.ea)}Ka(a){return a instanceof olympe.D.
|
|
318
|
-
void 0===d&&(olympe.
|
|
319
|
-
new Date(this.getTime()):new Date(0)}};olympe.D.
|
|
320
|
-
m.
|
|
321
|
-
m.
|
|
322
|
-
olympe.D.Color=class{constructor(a,b,c,d){this.C=olympe.D.
|
|
323
|
-
b.g,b.b,b.a)}static create(a,b,c,d=1){return olympe.D.ta([a,b,c,d],(e,f,g,h)=>{e=olympe.D.
|
|
324
|
-
b){return olympe.D.Color.create(this.C.
|
|
325
|
-
this.F.valueOf()===a.F.valueOf()&&this.b.valueOf()===a.b.valueOf()&&this.a.valueOf()===a.a.valueOf():!1}};olympe.D.Color.prototype.equals=olympe.D.Color.prototype.Ka;olympe.D.Color.prototype.toHexString=olympe.D.Color.prototype
|
|
326
|
-
olympe.D.Color.prototype.getRed=olympe.D.Color.prototype.
|
|
327
|
-
olympe.D.Sb,'Vector2.plus')}Kg(a){return olympe.D.ta([this,a],(b,c)=>new olympe.D.Sb(b.x.Kg(c.x),b.y.Kg(c.y)),olympe.D.Sb,'Vector2.minus')}
|
|
328
|
-
a+b*b)),olympe.D.aa)}normalize(){return olympe.D.ta([this.x,this.y],(a,b)=>{const c=Math.sqrt(a*a+b*b);return new olympe.D.Sb(a/c,b/c)},olympe.D.Sb)}floor(){return olympe.D.ta([this.x,this.y],(a,b)=>new olympe.D.Sb(Math.floor(a),Math.floor(b)),olympe.D.Sb)}ceil(){return olympe.D.ta([this.x,this.y],(a,b)=>new olympe.D.Sb(Math.ceil(a),Math.ceil(b)),olympe.D.Sb)}round(){return olympe.D.ta([this.x,this.y],(a,b)=>new olympe.D.Sb(Math.round(a),Math.round(b)),olympe.D.Sb)}
|
|
329
|
-
this.y.
|
|
330
|
-
m.Kg.L=new olympe.D.J(()=>olympe.D.Sb,[0]);m.
|
|
331
|
-
m.
|
|
332
|
-
c)&&zb(b[c],a)}get(a){const b=c=>{null===this.za&&(this.za={});return this.
|
|
333
|
-
f||this.O.run(()=>{f=olympe.D.Gd(d,void 0,e);a[b]=f;f.Da.onDestroy(()=>delete a[b]);olympe.D.
|
|
334
|
-
b){this.
|
|
335
|
-
a(b[c],c,this))break}
|
|
336
|
-
e[a]&&Db(e[a],!1);delete c[a];this.size--;b||this.nf()}a=this.Z[a];if(void 0!==a)for(const f in a)Object.prototype.hasOwnProperty.call(a,f)&&a[f].destroy();return d}nf(){null!==this.K&&Db(this.K,this.size)}mh(){var a=this.za;if(null!==a)for(const c in a)Object.prototype.hasOwnProperty.call(a,c)&&Bb(a[c]);a=this.
|
|
337
|
-
c)){b=this.Z[c];for(const d in b)Object.prototype.hasOwnProperty.call(b,d)&&b[d].destroy()}this.size=0;null!==this.K&&Db(this.K,this.size)}
|
|
338
|
-
m.
|
|
339
|
-
[a.Da],[0],'onResolved('+(b.name||'')+')')):b(a)}uf(a){return this.F[a]}
|
|
340
|
-
b||this.O.run(()=>{b=this.get(this.
|
|
341
|
-
this.fa.Da.onDestroy(()=>{this.K=null})});return this.fa}
|
|
342
|
-
c[a]&&Ab(c[a],olympe.D.
|
|
343
|
-
a)for(b in a)Bb(a[b]);a=this.Ta;if(null!==a)for(b in a)Bb(a[parseInt(b,10)]);var b=this.fa;null!==b&&(sb(b.Da),Ab(b,this.C));return olympe.D.Gh.prototype.mh.call(this)}
|
|
344
|
-
m.
|
|
345
|
-
a){const b=this.values[a];b&&b instanceof olympe.D.Proxy?Cb(this.F,b):Ab(this.F,b);Ab(this.C,a)}else void 0!==this.F.Da.Db&&(Bb(this.F),Bb(this.C))}set(a,b){this.
|
|
346
|
-
m.
|
|
347
|
-
olympe.D.Gd=function(a,b,c){a=olympe.D.createNode(a,void 0,void 0,void 0,void 0,c);olympe.D.Sf(b)?vb(a,b):olympe.D.
|
|
348
|
-
olympe.D.
|
|
349
|
-
olympe.D.Mg=function(a,b){let c;olympe.D.
|
|
350
|
-
olympe.D.
|
|
351
|
-
olympe.D.
|
|
352
|
-
olympe.D.
|
|
353
|
-
olympe.D.
|
|
354
|
-
olympe.D.
|
|
355
|
-
''))});c.onDestroy(()=>{delete Lb[d]})}}else olympe.D.H.log('NOT starting node dump, node is '+String(a))};olympe.D.
|
|
356
|
-
olympe.D.
|
|
357
|
-
olympe.D.
|
|
358
|
-
olympe.D.
|
|
359
|
-
olympe.D.
|
|
360
|
-
olympe.D.
|
|
361
|
-
olympe.D.Ub=a=>{a='string'===typeof a?JSON.parse(a):a;if(a.type){let b=null;switch(a.type){case 'dateTime':b=olympe.D.
|
|
362
|
-
olympe.D.
|
|
363
|
-
class Ob{constructor(a,b,c,d){this.id=a;this.F=new olympe.D.Yb('Slot manager entry');this.K=c;this.O=d;this.F.run(()=>{const e=Eb(olympe.D.ic(olympe.D.aa),olympe.D.aa.ZERO);olympe.D.
|
|
364
|
-
this.next=null}destroy(){this.F.destroy();this.G=this.C=this.next=null}}m=Ob.prototype;m.V.L=olympe.D.J.C;m.
|
|
365
|
-
function Tb(a){var b=olympe.host.
|
|
366
|
-
{Sb(this,d,k,...n)})},void 0,g,h,'Native('+d+').'+k),this.F.set(l,f),f.onDestroy(()=>this.F.delete(l)));return null}.bind(a));e.Z(a.O.bind(a,d));a=N(e);a.
|
|
367
|
-
olympe.host.Uh.C=class{constructor(a){this.parameters=a}merge(a){const b=new Map(this.parameters.map((c,d)=>[c.ia(),d]));a.parameters.forEach(c=>{b.has(c.ia())?this.parameters[b.get(c.ia())]=c:this.parameters.push(c)})}};function Wb(a,b){var c=olympe.host.
|
|
368
|
-
olympe.host.
|
|
369
|
-
|
|
370
|
-
olympe.W.config(function(a){ya(a,olympe.host.R.
|
|
371
|
-
olympe.W.run([olympe.host.R.
|
|
372
|
-
olympe.net.Ba.Zb={
|
|
373
|
-
olympe.net.
|
|
374
|
-
olympe.net.Vh=class extends olympe.net.
|
|
375
|
-
olympe.net.Vh.
|
|
315
|
+
olympe.D.Na)}toLocaleTimeString(a){return void 0===a||'string'===typeof a?olympe.D.wb(this.pb.toLocaleTimeString(a)):olympe.D.ta([this,a],(b,c)=>olympe.D.wb(b.pb.toLocaleTimeString(c.valueOf())),olympe.D.Na)}Hc(){return olympe.D.wb(this.pb.toISOString())}Ox(){return new Date(this.getTime())}Qx(){return this}Sx(){return this}Of(a,b){return olympe.D.ta([b],c=>{const d=new olympe.D.gb(new Date(this.pb.getTime()));d.pb['set'+a](this.pb['get'+a]()+c.valueOf());return d},olympe.D.gb)}Yu(a){return this.Of('Milliseconds',
|
|
316
|
+
a)}dv(a){return this.Of('Seconds',a)}Zu(a){return this.Of('Minutes',a)}Xu(a){return this.Of('Hours',a)}fm(a){return this.Of('Date',a)}ev(a){return'number'===typeof a?this.fm(7*a):this.fm(a.mk(7))}$u(a){return this.Of('Month',a)}fv(a){return this.Of('FullYear',a)}Lx(){let a=this.pb.getDay();a=0===a?6:a-1;return new olympe.D.gb(new Date(this.pb.getFullYear(),this.pb.getMonth(),this.pb.getDate()-a))}Mx(){return new olympe.D.gb(new Date(this.pb.getFullYear(),this.pb.getMonth()))}ud(a){return olympe.D.ta([a],
|
|
317
|
+
b=>olympe.D.Qb(this.Ka(b)),olympe.D.ea)}Ka(a){return a instanceof olympe.D.gb?this.getTime()===a.getTime()||isNaN(this.getTime())&&isNaN(a.getTime()):!1}iw(){let a=this.pb.getDay();0===a&&(a=7);return olympe.D.ra(a)}$v(a,b){return olympe.D.ta([a,b],(c,d)=>{d=d.valueOf();'years'===d?c=this.pb.getFullYear()-c.pb.getFullYear():'months'===d?c=12*(this.pb.getFullYear()-c.pb.getFullYear())+(this.pb.getMonth()-c.pb.getMonth()):(d={milliseconds:1,seconds:1E3,minutes:6E4,hours:36E5,days:864E5,weeks:6048E5}[d],
|
|
318
|
+
void 0===d&&(olympe.ma.eb('df').warn("[getDiff] '_unit' is not a valid unit! Defaulting to milliseconds"),d=1),c=Math.trunc((this.pb.getTime()-c.pb.getTime())/d));return olympe.D.ra(c)},olympe.D.aa)}Rw(a){return olympe.D.ta([a],b=>olympe.D.Qb(this.getTime()<b.getTime()),olympe.D.ea)}Pw(a){return olympe.D.ta([a],b=>olympe.D.Qb(this.getTime()>b.getTime()),olympe.D.ea)}Sw(a,b){return olympe.D.ta([a,b],(c,d)=>olympe.D.Qb(this.getTime()>c.getTime()&&this.getTime()<d.getTime()),olympe.D.ea)}valueOf(){return this.Ii().valueOf()?
|
|
319
|
+
new Date(this.getTime()):new Date(0)}};olympe.D.gb.C=Gb(0);olympe.D.gb.F=Gb(Number.NaN);m=olympe.D.gb.prototype;m.Ii.L=olympe.D.J.O;m.Vs.L=olympe.D.J.G;m.Xs.L=olympe.D.J.G;m.Ws.L=olympe.D.J.G;m.Us.L=olympe.D.J.G;m.Wv.L=olympe.D.J.G;m.getMonth.L=olympe.D.J.G;m.Ys.L=olympe.D.J.G;m.getTime.L=olympe.D.J.C;m.Kx.L=new olympe.D.J(()=>olympe.D.Na,[0]);m.toLocaleString.L=olympe.D.J.F;m.toLocaleDateString.L=olympe.D.J.F;m.toLocaleTimeString.L=olympe.D.J.F;m.Hc.L=olympe.D.J.F;m.Ox.L=olympe.D.J.C;
|
|
320
|
+
m.Qx.L=new olympe.D.J(()=>olympe.D.gb,[]);m.Sx.L=new olympe.D.J(()=>olympe.D.gb,[]);m.Of.L=new olympe.D.J(()=>olympe.D.gb,[]);m.Yu.L=new olympe.D.J(()=>olympe.D.gb,[]);m.dv.L=new olympe.D.J(()=>olympe.D.gb,[]);m.Zu.L=new olympe.D.J(()=>olympe.D.gb,[]);m.Xu.L=new olympe.D.J(()=>olympe.D.gb,[]);m.fm.L=new olympe.D.J(()=>olympe.D.gb,[0]);m.ev.L=new olympe.D.J(()=>olympe.D.gb,[]);m.$u.L=new olympe.D.J(()=>olympe.D.gb,[]);m.fv.L=new olympe.D.J(()=>olympe.D.gb,[0]);
|
|
321
|
+
m.Lx.L=new olympe.D.J(()=>olympe.D.gb,[]);m.Mx.L=new olympe.D.J(()=>olympe.D.gb,[]);m.ud.L=olympe.D.J.O;m.Ka.L=olympe.D.J.C;m.iw.L=olympe.D.J.G;m.$v.L=new olympe.D.J(()=>olympe.D.aa,[0,1]);m.Rw.L=new olympe.D.J(()=>olympe.D.ea,[0]);m.Pw.L=new olympe.D.J(()=>olympe.D.ea,[0]);m.Sw.L=new olympe.D.J(()=>olympe.D.ea,[0,1]);m.valueOf.L=olympe.D.J.C;const Hb=new Map,Ib=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})?$/i,Jb=/^#?([a-f\d])([a-f\d])([a-f\d])([a-f\d])?$/i;function Kb(a){const b=c=>{let d;c=c.valueOf();6>c.length?(d=17,c=Jb.exec(c)):(d=1,c=Ib.exec(c));c=c?c.slice(1).map(e=>parseInt(e,16)*d):[0,0,0];return olympe.D.Color.create(c[0],c[1],c[2],isNaN(c[3])?1:c[3]/255)};return olympe.D.Ue(a)?olympe.D.me([a],b,olympe.D.Color):b(a)}
|
|
322
|
+
olympe.D.Color=class{constructor(a,b,c,d){this.C=olympe.D.ra(void 0!==a?Math.min(255,Math.max(0,Math.round(a))):0);this.F=olympe.D.ra(void 0!==b?Math.min(255,Math.max(0,Math.round(b))):0);this.b=olympe.D.ra(void 0!==c?Math.min(255,Math.max(0,Math.round(c))):0);this.a=olympe.D.ra(void 0!==d?Math.min(1,Math.max(0,d)):1)}toJSON(){return{r:this.C.valueOf(),g:this.F.valueOf(),b:this.b.valueOf(),a:this.a.valueOf()}}static Ub(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return olympe.D.Color.create(b.r,
|
|
323
|
+
b.g,b.b,b.a)}static create(a,b,c,d=1){return olympe.D.ta([a,b,c,d],(e,f,g,h)=>{e=olympe.D.ra(void 0!==e?Math.min(255,Math.max(0,Math.round(e.valueOf()))):0);f=olympe.D.ra(void 0!==f?Math.min(255,Math.max(0,Math.round(f.valueOf()))):0);g=olympe.D.ra(void 0!==g?Math.min(255,Math.max(0,Math.round(g.valueOf()))):0);h=olympe.D.ra(void 0!==h?Math.min(1,Math.max(0,h.valueOf())):1);for(let k of Hb.values())if(k&&k.C.Ka(e)&&k.F.Ka(f)&&k.b.Ka(g)&&k.a.Ka(h))return k;return new olympe.D.Color(e,f,g,h)},olympe.D.Color)}Gi(){return this.C}Bi(){return this.b}Di(){return this.F}zi(){return this.a}lv(a,
|
|
324
|
+
b){return olympe.D.Color.create(this.C.Ki(a.Gi(),b),this.F.Ki(a.Di(),b),this.b.Ki(a.Bi(),b),this.a.Ki(a.zi(),b))}Dv(a){return olympe.D.Color.create(this.C,this.F,this.b,a)}Dr(){return`rgba(${this.C},${this.F},${this.b},${this.a})`}$m(){const a=(16777216|this.b|this.F<<8|this.C<<16).toString(16).slice(1),b=1===this.a.valueOf()?'':(256|255*this.a).toString(16).slice(1);return'#'+(a+b).toUpperCase()}toString(){return this.$m()}Ka(a){return a instanceof olympe.D.Color?this.C.valueOf()===a.C.valueOf()&&
|
|
325
|
+
this.F.valueOf()===a.F.valueOf()&&this.b.valueOf()===a.b.valueOf()&&this.a.valueOf()===a.a.valueOf():!1}};olympe.D.Color.prototype.equals=olympe.D.Color.prototype.Ka;olympe.D.Color.prototype.toHexString=olympe.D.Color.prototype.$m;olympe.D.Color.prototype.toRGBString=olympe.D.Color.prototype.Dr;olympe.D.Color.prototype.getAlpha=olympe.D.Color.prototype.zi;olympe.D.Color.prototype.getGreen=olympe.D.Color.prototype.Di;olympe.D.Color.prototype.getBlue=olympe.D.Color.prototype.Bi;
|
|
326
|
+
olympe.D.Color.prototype.getRed=olympe.D.Color.prototype.Gi;olympe.D.Color.create=olympe.D.Color.create;m=olympe.D.Color.prototype;m.toJSON.L=olympe.D.J.C;m.Gi.L=olympe.D.J.G;m.Bi.L=olympe.D.J.G;m.Di.L=olympe.D.J.G;m.zi.L=olympe.D.J.G;m.lv.L=new olympe.D.J(()=>olympe.D.Color,[]);m.Dv.L=new olympe.D.J(()=>olympe.D.Color,[]);m.Dr.L=new olympe.D.J(()=>String,[]);m.$m.L=new olympe.D.J(()=>String,[]);m.Ka.L=olympe.D.J.C;olympe.D.File=class{ia(){}$o(){}ml(){}Dm(){}ck(){}xm(){}dk(){}rename(){}};olympe.D.Sb=class{constructor(a,b){this.x=olympe.D.Td(a);this.y=olympe.D.Td(b)}toJSON(){return'{ "type": "vector2", "x": '+JSON.stringify(olympe.D.Qa(this.x).valueOf())+', "y": '+JSON.stringify(olympe.D.Qa(this.y).valueOf())+' }'}static Ub(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return new olympe.D.Sb(b.x,b.y)}ap(){return this.x}Ix(a){Db(this.x,a)}bp(){return this.y}Jx(a){Db(this.y,a)}Cw(){return this.x.yr(this.y)}Ud(a){return olympe.D.ta([this,a],(b,c)=>new olympe.D.Sb(b.x.Ud(c.x),b.y.Ud(c.y)),
|
|
327
|
+
olympe.D.Sb,'Vector2.plus')}Kg(a){return olympe.D.ta([this,a],(b,c)=>new olympe.D.Sb(b.x.Kg(c.x),b.y.Kg(c.y)),olympe.D.Sb,'Vector2.minus')}bx(a){return new olympe.D.Sb(this.x.mk(a),this.y.mk(a))}yv(a){return new olympe.D.Sb(this.x.wi(a),this.y.wi(a))}gx(){return new olympe.D.Sb(this.x.Si(),this.y.Si())}zv(a){return olympe.D.ta([this,a],(b,c)=>olympe.D.ta([b.x,b.y,c.x,c.y],(d,e,f,g)=>olympe.D.ra(d*f+e*g),olympe.D.aa),olympe.D.aa)}length(){return olympe.D.ta([this.x,this.y],(a,b)=>olympe.D.ra(Math.sqrt(a*
|
|
328
|
+
a+b*b)),olympe.D.aa)}normalize(){return olympe.D.ta([this.x,this.y],(a,b)=>{const c=Math.sqrt(a*a+b*b);return new olympe.D.Sb(a/c,b/c)},olympe.D.Sb)}floor(){return olympe.D.ta([this.x,this.y],(a,b)=>new olympe.D.Sb(Math.floor(a),Math.floor(b)),olympe.D.Sb)}ceil(){return olympe.D.ta([this.x,this.y],(a,b)=>new olympe.D.Sb(Math.ceil(a),Math.ceil(b)),olympe.D.Sb)}round(){return olympe.D.ta([this.x,this.y],(a,b)=>new olympe.D.Sb(Math.round(a),Math.round(b)),olympe.D.Sb)}av(a){return new olympe.D.Sb(this.x.Ud(a),
|
|
329
|
+
this.y.Ud(a))}bv(a,b){return new olympe.D.Sb(this.x.Ud(a),this.y.Ud(b))}Hc(){return olympe.D.ta([this.x,this.y],(a,b)=>olympe.D.wb(`Vector2[${a.valueOf()}, ${b.valueOf()}]`),olympe.D.Na)}toString(){return`Vector2[${this.x.Da.Db}, ${this.y.Da.Db}]`}Ka(a){return this===a?!0:!1}};m=olympe.D.Sb.prototype;m.toJSON.L=olympe.D.J.C;m.ap.L=olympe.D.J.G;m.Ix.L=olympe.D.J.C;m.bp.L=olympe.D.J.G;m.Jx.L=olympe.D.J.C;m.Cw.L=olympe.D.J.G;m.Ud.L=new olympe.D.J(()=>olympe.D.Sb,[0]);
|
|
330
|
+
m.Kg.L=new olympe.D.J(()=>olympe.D.Sb,[0]);m.bx.L=olympe.D.J.T;m.yv.L=olympe.D.J.T;m.gx.L=olympe.D.J.T;m.zv.L=new olympe.D.J(()=>olympe.D.aa,[0]);m.length.L=olympe.D.J.G;m.normalize.L=olympe.D.J.T;m.floor.L=olympe.D.J.T;m.ceil.L=olympe.D.J.T;m.round.L=olympe.D.J.T;m.av.L=olympe.D.J.T;m.bv.L=olympe.D.J.T;m.Hc.L=olympe.D.J.F;m.toString.L=olympe.D.J.C;m.Ka.L=olympe.D.J.C;olympe.D.dg=class{constructor(){}Pb(){}Bd(){}get(){}uh(){}has(){}Hg(){}xc(){}vf(){}cf(){}Rf(){}forEach(){}ce(){}};olympe.D.dg.prototype.forEachCurrentValue=olympe.D.dg.prototype.ce;olympe.D.dg.prototype.forEach=olympe.D.dg.prototype.forEach;m=olympe.D.dg.prototype;m.has.L=olympe.D.J.O;m.Hg.L=olympe.D.J.C;m.xc.L=new olympe.D.J(()=>Object,[]);m.vf.L=new olympe.D.J(()=>String,[]);m.cf.L=olympe.D.J.G;m.Rf.L=olympe.D.J.C;m.forEach.L=new olympe.D.J(()=>{},[]);m.ce.L=olympe.D.J.C;olympe.D.dd=class extends olympe.D.dg{Qd(){}uf(){}Se(){}tf(){}de(){}Re(){}xi(){}wh(){}};olympe.D.dd.prototype.getCurrentAt=olympe.D.dd.prototype.Re;olympe.D.dd.prototype.getAt=olympe.D.dd.prototype.de;olympe.D.dd.prototype.getCurrentKeyAt=olympe.D.dd.prototype.tf;olympe.D.dd.prototype.getKeyAt=olympe.D.dd.prototype.Se;olympe.D.dd.prototype.getCurrentRank=olympe.D.dd.prototype.uf;olympe.D.dd.prototype.getRank=olympe.D.dd.prototype.Qd;m=olympe.D.dd.prototype;m.Qd.L=olympe.D.J.G;m.uf.L=olympe.D.J.C;
|
|
331
|
+
m.Se.L=new olympe.D.J(()=>String,[]);m.tf.L=olympe.D.J.C;m.de.L=new olympe.D.J(()=>Object,[]);m.Re.L=olympe.D.J.C;m.xi.L=olympe.D.J.C;m.wh.L=new olympe.D.J(()=>Array,[]);olympe.D.Gh=class{constructor(a,b){this.O=b||olympe.D.Xa();this.valueType=a||Object;this.values={};this.nb=this.za=null;this.qf=0;this.Z=Object.create(null);this.Ab=Object.create(null);this.size=0;this.K=null;this.O.onDestroy(()=>{const c=this.Z;if(c){const d=Object.keys(c),e=d.length;for(let f=0;f<e;f++){const g=c[d[f]],h=Object.keys(g);for(let k=h.length,l=0;l<k;l++)g[h[l]].destroy()}}})}getContext(){return this.O}Pb(){return this.valueType}Bd(a){this.valueType=a;const b=this.za;if(null!==b)for(const c in b)Object.prototype.hasOwnProperty.call(b,
|
|
332
|
+
c)&&zb(b[c],a)}get(a){const b=c=>{null===this.za&&(this.za={});return this.Ci(this.za,c,this.values[c],this.valueType,'Map.get('+c+')')};return olympe.D.ta([a],c=>b(c),this.valueType)}uh(a){a=this.values[a];return olympe.D.fb(a)?kb(a.Da)?a.Da.Db:void 0:a}has(a){const b=c=>{null===this.nb&&(this.nb={});return this.Ci(this.nb,c,c in this.values?olympe.D.ea.F:olympe.D.ea.C,olympe.D.ea,'Map.has('+c+')')};return olympe.D.ta([a],c=>b(c),olympe.D.ea)}Hg(a){return a in this.values}Ci(a,b,c,d,e){let f=a[b];
|
|
333
|
+
f||this.O.run(()=>{f=olympe.D.Gd(d,void 0,e);a[b]=f;f.Da.onDestroy(()=>delete a[b]);olympe.D.fb(c)?Cb(f,c):Ab(f,c)});return f}xc(){throw Error('Abstract method getFirstKey needs to be overridden');}vf(){throw Error('Abstract method getFirstKey needs to be overridden');}cf(){null===this.K&&this.O.run(()=>{this.K=olympe.D.Gd(olympe.D.aa,olympe.D.ra(this.size));this.K.Da.onDestroy(()=>{this.K=null})});return this.K}Rf(){return this.size}forEach(a,b){const c=this.am();a=this.Sq(c,a,b);this.$l(c,a)}am(){return String(++this.qf)}$l(a,
|
|
334
|
+
b){this.Ab[a]=b;olympe.D.Xa().Z(()=>{const c=this.Z;for(const d in c)Object.prototype.hasOwnProperty.call(c,d)&&delete c[d][a];delete this.Ab[a]});this.ce(b)}Sq(a,b,c){const d=olympe.D.Xa();return(e,f)=>{d.run(()=>{const g=olympe.D.createNode(void 0,b,null,[e,f,this],null,`forEach-${a}-${f}`);if(void 0!==c)g.onDestroy(()=>{c(f)});this.em(a,f,g)})}}em(a,b,c){void 0===this.Z[b]&&(this.Z[b]={});this.Z[b][a]=c}ce(a){const b=this.values;for(const c in b)if(Object.prototype.hasOwnProperty.call(b,c)&&!1===
|
|
335
|
+
a(b[c],c,this))break}Xj(a,b){void 0!==this.values[a]&&this.si(a,!0);this.values[a]=b;var c=this.za;null!==c&&void 0!==c[a]&&(b&&b instanceof olympe.D.Proxy?Cb(c[a],b):Ab(c[a],b));c=this.nb;null!==c&&void 0!==c[a]&&Db(c[a],!0);this.size++;c=this.Ab;for(const d in c)if(Object.prototype.hasOwnProperty.call(c,d))c[d](b,a,this)}si(a,b){const c=this.values;if(Object.prototype.hasOwnProperty.call(c,a)){var d=(d=c[a])&&d.zg?d.Da.Db:d;var e=this.za;null!==e&&void 0!==e[a]&&Bb(e[a]);e=this.nb;null!==e&&void 0!==
|
|
336
|
+
e[a]&&Db(e[a],!1);delete c[a];this.size--;b||this.nf()}a=this.Z[a];if(void 0!==a)for(const f in a)Object.prototype.hasOwnProperty.call(a,f)&&a[f].destroy();return d}nf(){null!==this.K&&Db(this.K,this.size)}mh(){var a=this.za;if(null!==a)for(const c in a)Object.prototype.hasOwnProperty.call(a,c)&&Bb(a[c]);a=this.nb;if(null!==a)for(var b in a)Object.prototype.hasOwnProperty.call(a,b)&&Db(a[b],!1);for(const c in this.values)Object.prototype.hasOwnProperty.call(this.values,c)&&delete this.values[c];for(const c in this.Z)if(Object.prototype.hasOwnProperty.call(this.Z,
|
|
337
|
+
c)){b=this.Z[c];for(const d in b)Object.prototype.hasOwnProperty.call(b,d)&&b[d].destroy()}this.size=0;null!==this.K&&Db(this.K,this.size)}gg(){const a=this.values;let b='\n';for(const c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b+=a[c]+'\n');return b}};olympe.D.Gh.xa=[olympe.D.dg];m=olympe.D.Gh.prototype;m.getContext.L=olympe.D.J.C;m.Pb.L=olympe.D.J.C;m.Bd.L=olympe.D.J.C;m.get.L=new olympe.D.J(()=>Object,[],'valueType');m.uh.L=olympe.D.J.C;m.has.L=olympe.D.J.O;m.Hg.L=olympe.D.J.C;m.Ci.L=olympe.D.J.C;
|
|
338
|
+
m.cf.L=olympe.D.J.G;m.Rf.L=olympe.D.J.C;m.forEach.L=new olympe.D.J(()=>{},[]);m.am.L=olympe.D.J.C;m.$l.L=olympe.D.J.C;m.Sq.L=olympe.D.J.C;m.em.L=olympe.D.J.C;m.ce.L=olympe.D.J.C;m.Xj.L=olympe.D.J.C;m.si.L=olympe.D.J.C;m.nf.L=olympe.D.J.C;m.mh.L=olympe.D.J.C;m.gg.L=olympe.D.J.C;olympe.D.Vi=class extends olympe.D.Gh{constructor(a,b){super(a,b);this.F=Object.create(null);this.C=[];this.oa=this.Ta=this.bb=this.fa=null}Bd(a){super.Bd(a);if(null!==this.oa)for(let b of this.oa.values())zb(b,a)}xc(){return this.de(0)}vf(){return this.Se(0)}Qd(a){const b=c=>{null===this.bb&&(this.bb=Object.create(null));let d=this.uf(a);d=void 0!==d?olympe.D.ra(d):void 0;return this.Ci(this.bb,c,d,olympe.D.aa,`List.getRank(${c})`)};return olympe.D.fb(a)?N(olympe.D.createNode(olympe.D.aa,b,null,
|
|
339
|
+
[a.Da],[0],'onResolved('+(b.name||'')+')')):b(a)}uf(a){return this.F[a]}Se(a){const b=c=>{const d=c.valueOf(),e=this.tf(d);null===this.Ta&&(this.Ta=Object.create(null));return this.Ci(this.Ta,String(d),e,String,'List.getKeyAt('+c+')')};return olympe.D.ta([a],c=>b(c),String)}tf(a){return this.C[a.valueOf()]}de(a){if(olympe.D.fb(a))return this.get(olympe.D.ta([a],c=>{c=this.Se(c);if(!kb(c.Da)){const d=olympe.D.Xa();olympe.D.Sf(d)&&ub(d)}return c},String));null===this.oa&&(this.oa=new Map);let b=this.oa.get(a);
|
|
340
|
+
b||this.O.run(()=>{b=this.get(this.Se(a));this.oa.set(a,b);b.Da.onDestroy(()=>this.oa.delete(a))});return b}Re(a){return this.uh(this.tf(a))}xi(a,b,c,d){let e=this.am();a=this.vr(e,a,b,c,d);this.$l(e,a)}vr(a,b,c,d,e){return olympe.D.Xa().G((f,g)=>{let h=!1,k=olympe.D.Eh([b,c,this.Qd(g)],(l,n,p)=>{p>=l&&p<l+n?h||(d(f,g,this),h=!0):h&&(e(g),h=!1)});if(void 0!==e)k.onDestroy(e.bind(null,g));this.em(a,g,k)})}wh(){null===this.fa&&this.O.run(()=>{this.fa=olympe.D.Gd(Array,this.C.filter(a=>void 0!==a));
|
|
341
|
+
this.fa.Da.onDestroy(()=>{this.K=null})});return this.fa}ce(a){if(this.C.length!==this.size)super.ce(a);else{var b=this.values;for(let c of this.C.filter(d=>void 0!==d))if(Object.prototype.hasOwnProperty.call(b,c)&&!1===a(b[c],c,this))break}}cm(a,b){const c=this.bb,d=this.Ta,e=this.F[a],f=b.valueOf();if(e!==f||this.C[e]!==a){var g=this.C[f];void 0!==g&&delete this.F[g];void 0!==e&&null!==e&&this.C[e]===a&&(this.C[e]=void 0);this.F[a]=f;this.C[f]=a;null!==c&&(void 0!==g&&void 0!==c[g]&&Bb(c[g]),void 0!==
|
|
342
|
+
c[a]&&Ab(c[a],olympe.D.ra(f)));null!==d&&(void 0!==e&&null!==e&&void 0!==d[e]&&Bb(d[e]),void 0!==d[b]&&Ab(d[b],a))}}bm(a){var b=this.Ta,c=this.F[a];null!==c&&void 0!==c&&null!==b&&(b=b[c],void 0!==b&&b.Da.Db===a&&Bb(b));delete this.F[a];this.C.splice(c,1);c=this.bb;null!==c&&void 0!==c[a]&&Bb(c[a])}Tq(){if(null!==this.fa){const a=this.C,b=this.fa.Da.Db;b&&a.join(',')!==b.join(',')&&Ab(this.fa,a)}}nf(){this.Tq();super.nf()}mh(){var a=this.F;for(b in a)delete a[b];this.C.length=0;a=this.bb;if(null!==
|
|
343
|
+
a)for(b in a)Bb(a[b]);a=this.Ta;if(null!==a)for(b in a)Bb(a[parseInt(b,10)]);var b=this.fa;null!==b&&(sb(b.Da),Ab(b,this.C));return olympe.D.Gh.prototype.mh.call(this)}gg(){const a=this.values,b=this.F;let c='[\n';for(let d in a)Object.prototype.hasOwnProperty.call(a,d)&&(c+=`${b[d]}. ${a[d]}\n`);return c+']'}};olympe.D.Vi.xa=[olympe.D.dd];m=olympe.D.Vi.prototype;m.Bd.L=olympe.D.J.C;m.xc.L=new olympe.D.J(()=>Object,[]);m.vf.L=new olympe.D.J(()=>String,[]);m.Qd.L=olympe.D.J.G;m.uf.L=olympe.D.J.C;
|
|
344
|
+
m.Se.L=new olympe.D.J(()=>String,[]);m.tf.L=olympe.D.J.C;m.de.L=new olympe.D.J(()=>Object,[]);m.Re.L=olympe.D.J.C;m.xi.L=new olympe.D.J(()=>{},[]);m.vr.L=olympe.D.J.C;m.wh.L=new olympe.D.J(()=>Array,[]);m.ce.L=olympe.D.J.C;m.cm.L=olympe.D.J.C;m.bm.L=olympe.D.J.C;m.Tq.L=olympe.D.J.C;m.nf.L=olympe.D.J.C;m.mh.L=olympe.D.J.C;m.gg.L=olympe.D.J.C;olympe.D.Map=class extends olympe.D.Gh{constructor(a){a===olympe.D.Proxy&&(a=Object);super(a);this.C=this.F=null}Bd(a){a===olympe.D.Proxy&&(a=Object);null!==this.F&&zb(this.F,a);super.Bd(a)}xc(){null===this.F&&this.om();return this.F}vf(){null===this.C&&this.om();return this.C}om(){this.getContext().run(()=>{this.F=olympe.D.Gd(this.Pb());this.C=olympe.D.Gd(String);this.Pi(this.tm())})}tm(){const a=this.values;let b,c;for(b in a)if(Object.prototype.hasOwnProperty.call(a,b)){c=b;break}return c}Pi(a){if(void 0!==
|
|
345
|
+
a){const b=this.values[a];b&&b instanceof olympe.D.Proxy?Cb(this.F,b):Ab(this.F,b);Ab(this.C,a)}else void 0!==this.F.Da.Db&&(Bb(this.F),Bb(this.C))}set(a,b){this.Xj(a,b);1===this.size&&null!==this.C&&this.Pi(a);this.nf()}remove(a){const b=this.si(a);null!==this.C&&this.C.Da.Db===a&&this.Pi(this.tm());return b}clear(){this.mh();null!==this.C&&this.Pi()}};m=olympe.D.Map.prototype;m.Bd.L=olympe.D.J.C;m.xc.L=new olympe.D.J(()=>Object,[]);m.vf.L=new olympe.D.J(()=>String,[]);m.om.L=olympe.D.J.C;
|
|
346
|
+
m.tm.L=olympe.D.J.C;m.Pi.L=olympe.D.J.C;m.set.L=olympe.D.J.C;m.remove.L=new olympe.D.J(()=>Object,[]);m.clear.L=olympe.D.J.C;olympe.D.jg=class extends olympe.D.Vi{constructor(a){super(a)}set(a,b,c){this.Xj(a,b);void 0!==c&&olympe.D.Nc([c],d=>{this.cm(a,d)});this.nf()}remove(a){this.bm(a);return this.si(a)}clear(){this.mh()}};olympe.D.jg.prototype.remove.L=olympe.D.J.C;olympe.D.jg.prototype.clear.L=olympe.D.J.C;olympe.D.Mr=class extends olympe.D.jj{constructor(a,b){super(olympe.D.aa,'animatedFlowSource');this.duration=a;this.C=b||olympe.D.aa.ko.hp}ub(){return olympe.D.hx(this.node,this.duration,this.C,void 0)}};let Lb=null;olympe.D.H=void 0;olympe.D.Vm=void 0;olympe.D.rh=void 0;olympe.D.lh=new Map;olympe.D.lh.set(0,olympe.D.aa.ZERO);olympe.D.lh.set(1,olympe.D.aa.ONE);olympe.D.lh.set(2,olympe.D.aa.Hu);olympe.D.Wj=new Map;olympe.D.Wj.set('',olympe.D.Na.EMPTY);olympe.D.Wj.set(' ',olympe.D.Na.tu);olympe.D.createNode=function(a,b,c,d,e,f,g,h){return new olympe.D.Node({valueType:a,wd:b,yf:c,Jm:d,debug:g,Pf:e,gd:f,ti:h})};olympe.D.Sf=function(a){return a instanceof olympe.D.Node};
|
|
347
|
+
olympe.D.Gd=function(a,b,c){a=olympe.D.createNode(a,void 0,void 0,void 0,void 0,c);olympe.D.Sf(b)?vb(a,b):olympe.D.fb(b)?vb(a,b.Da):L(a,b);return N(a)};olympe.D.fb=function(a){return!(!a||!a.zg)};olympe.D.Ue=function(a){return!(!a||!(a instanceof olympe.D.Node||a.zg))};olympe.D.Nm=function(a){return a instanceof olympe.D.Yb||a instanceof olympe.D.hq||a instanceof olympe.D.Node};olympe.D.Ah=function(a){return a instanceof olympe.D.jj};
|
|
348
|
+
olympe.D.Rm=function(a,b){if(void 0!==a){olympe.D.Ah(a)&&(a=a.ub().Da);if(!olympe.D.Ue(a))return b(a);var c=[];olympe.D.fb(a)?c.push(a.Da):c.push(a);return olympe.D.createNode(void 0,b,null,c,[0],'onResolved')}};olympe.D.Qa=function(a,b){let c=a;olympe.D.fb(a)?c=a.Da.Db:olympe.D.Sf(a)?c=a.Db:olympe.D.Ah(a)&&(c=a.ub().Da.Db);return void 0===c?b:c};
|
|
349
|
+
olympe.D.Mg=function(a,b){let c;olympe.D.fb(a)?c=a.Da:olympe.D.Sf(a)?c=a:olympe.D.Ah(a)&&(c=a.ub().Da);c&&olympe.D.Nc([b],d=>{c.Mg(d)},'setDefaultValue');return a};olympe.D.Eh=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.Qq?(h=h.Da,g.push(k)):h instanceof olympe.D.Node?g.push(k):olympe.D.Ah(h)&&(h=h.ub().Da,g.push(k))),f[k]=h;return olympe.D.createNode(c,b,null,f,g,d||'syncNodes')};
|
|
350
|
+
olympe.D.me=function(a,b,c,d){return N(olympe.D.Eh(a,b,c,d||'syncProxies'))};const Mb=a=>{for(const b of a)if(olympe.D.Ue(b)||olympe.D.Ah(b))return!1;return!0};olympe.D.ta=function(a,b,c,d,e){if(Mb(a))return b(...a);const f=olympe.D.Eh(a,b,c,d||'TransformFlows');e&&olympe.D.Nc([e],g=>{f.Mg(g)},'setDefaultValue');return N(f)};olympe.D.Nc=function(a,b,c){Mb(a)?b(...a):olympe.D.Eh(a,b,void 0,c||'processFlows')};
|
|
351
|
+
olympe.D.Sm=function(a,b){if(Mb(a))b(...a);else{const c=olympe.D.Xa();olympe.D.Eh(a,(...d)=>{olympe.D.Xa().destroy();c.run(b,...d)},void 0,'processFlowsOnce')}};olympe.D.Tm=function(a,b,c){const d=a.length,e=Array(d),f=[];let g;for(let h=0;h<d;h++)g=a[h],void 0!==g&&null!==g&&(olympe.D.fb(g)?(g=g.Da,f.push(h)):g instanceof olympe.D.Node?f.push(h):olympe.D.Ah(g)&&(g=g.ub().Da,f.push(h))),e[h]=g;0!==f.length&&new olympe.D.Node({wd:b,Jm:e,Pf:f,zx:!1,gd:c})};
|
|
352
|
+
olympe.D.xr=function(a,b){const c=olympe.D.Xa();olympe.D.Tm(a,(...d)=>{olympe.D.Xa().destroy();c.run(b,...d)},'processFutureFlowsOnce')};olympe.D.kC=function(a,b,c){a=new olympe.D.jj(a,c);b(a);return a.ub()};olympe.D.ic=function(a,b='flowSource'){return new olympe.D.jj(a,b)};olympe.D.SC=function(a,b,c,d){const e=olympe.D.Xa();olympe.D.Eh(a,(...f)=>{olympe.D.Xa().destroy();e.run(b,...f)},c,d||'syncProxiesOnce')};
|
|
353
|
+
olympe.D.Hi=function(a,b,c){olympe.D.ta([a],d=>d.valueOf()?b.apply(null,void 0):c&&c.apply(null,void 0),Object,'If')};olympe.D.wC=function(a,b,c='from observable'){const d=olympe.D.ic(b,c),e=a.subscribe(f=>d.update(f));d.getContext().onDestroy(()=>e.unsubscribe());return d.ub()};olympe.D.tC=function(a,b,...c){return a?a.run(b,...c):b(...c)};olympe.D.VC=function(a){return olympe.D.Xa().G(a)};olympe.D.qC=function(a,b,c){olympe.D.Av(a?a.Da:a,b,c)};
|
|
354
|
+
olympe.D.Av=function(a,b,c){if(a){var d=a.V();null===Lb&&(Lb={});if(Lb[d])olympe.D.H.log(`Already started node #${d} dump`+(b?`: ${b}`:''));else{Lb[d]=!0;var e=`Starting node #${d} dump`+(b?`: ${b}`:'');c?olympe.D.H.warn(e):olympe.D.H.log(e);var f=`#${d}`+(b?`: ${b}`:'')+':';c=olympe.D.createNode(null,g=>{void 0===g?olympe.D.H.log(f,'undefined'):null===g?olympe.D.H.log(f,'null'):olympe.D.H.log(f,String(g))},null,[a],[0],'DataFlowDump');a.onDestroy(()=>{olympe.D.H.log(`Node #${d} destroyed`+(b?`: ${b}`:
|
|
355
|
+
''))});c.onDestroy(()=>{delete Lb[d]})}}else olympe.D.H.log('NOT starting node dump, node is '+String(a))};olympe.D.pC=function(){let a='',b=olympe.D.Xa();for(;null!==b;)a+=b.Fd()+' --\x3e ',b=b.getParent();olympe.D.H.log(a)};
|
|
356
|
+
olympe.D.ra=function(a){if(void 0===a)return olympe.D.aa.ZERO;if(a instanceof olympe.D.aa)return a;a&&a.valueOf&&(a=a.valueOf());if('number'===typeof a){if(isNaN(a))return olympe.D.aa.np;if(a===Math.PI)return olympe.D.aa.PI;if(Infinity===a)return olympe.D.aa.Os;if(-Infinity===a)return olympe.D.aa.Ht;if(isNaN(a))var b=!1;else b=parseFloat(a),b=(b|0)===b;return b&&-1<=a&&100>=a?(olympe.D.lh.has(a)||olympe.D.lh.set(a,new olympe.D.aa(a)),olympe.D.lh.get(a)):new olympe.D.aa(a)}return null};
|
|
357
|
+
olympe.D.Td=function(a){return void 0===a?olympe.D.Gd(olympe.D.aa):olympe.D.Gd(olympe.D.aa,olympe.D.Ue(a)?a:olympe.D.ra(a))};olympe.D.hx=olympe.D.aa.animate;olympe.D.IC=function(a,b){return new olympe.D.Mr(a,b)};olympe.D.wb=function(a){if(a instanceof olympe.D.Na)return a;a instanceof Object&&(a=a.valueOf());const b=typeof a;if('string'===b||'number'===b||'boolean'===b)return a=String(a),olympe.D.Wj.has(a)?olympe.D.Wj.get(a):new olympe.D.Na(a)};
|
|
358
|
+
olympe.D.MC=function(a){return void 0===a?olympe.D.Gd(olympe.D.Na):olympe.D.Gd(olympe.D.Na,olympe.D.Ue(a)?a:olympe.D.wb(a))};olympe.D.Qb=function(a){return a instanceof olympe.D.ea?a:void 0!==a&&null!==a&&a.valueOf()?olympe.D.ea.F:olympe.D.ea.C};olympe.D.JC=function(a){return void 0===a?olympe.D.Gd(olympe.D.ea):olympe.D.Gd(olympe.D.ea,olympe.D.Ue(a)?a:olympe.D.Qb(a))};olympe.D.ix=function(a){if(a instanceof Date)return new olympe.D.gb(a)};
|
|
359
|
+
olympe.D.LC=function(a){return olympe.D.Gd(olympe.D.gb,void 0!==a?new olympe.D.gb(a):null)};olympe.D.tr=a=>a instanceof olympe.D.ea||a instanceof olympe.D.aa||a instanceof olympe.D.Na||a instanceof olympe.D.gb;olympe.D.NC=function(a,b){return olympe.D.Gd(olympe.D.Sb,void 0===a&&void 0===b?void 0:new olympe.D.Sb(a,b))};olympe.D.ux=function(a,b,c,d){let e;void 0!==a&&(a instanceof olympe.D.Color?e=a:e=olympe.D.Color.create(a,b,c,d));return olympe.D.Gd(olympe.D.Color,e)};olympe.D.KC=olympe.D.ux;
|
|
360
|
+
olympe.D.qv=function(a){olympe.D.H=a;olympe.D.rh=olympe.D.Dg()};olympe.D.Dg=function(){olympe.D.Vm||(olympe.D.Vm=new olympe.D.hq);return olympe.D.Vm};olympe.D.Xa=function(){olympe.D.rh||(olympe.D.rh=olympe.D.Dg());return olympe.D.rh};olympe.D.Ar=function(a){const b=olympe.D.rh;olympe.D.Nm(a)&&(olympe.D.rh=a);return null!=b?b:null};
|
|
361
|
+
olympe.D.Ub=a=>{a='string'===typeof a?JSON.parse(a):a;if(a.type){let b=null;switch(a.type){case 'dateTime':b=olympe.D.gb.Ub(a);break;case 'number':b=olympe.D.aa.Ub(a);break;case 'string':b=olympe.D.Na.Ub(a);break;case 'vector2':b=olympe.D.Sb.Ub(a);break;case 'color':b=olympe.D.Color.Ub(a);break;case 'boolean':b=olympe.D.ea.Ub(a)}return b}return null};function Nb(a){a.C.hb()||(a.G.forEach(b=>{b.destroy()}),a.G.clear(),a.F.clear(),a.size.clear(),a.O.clear(),a.T.length=0,a.K.length=0)}
|
|
362
|
+
olympe.D.LA=class{constructor(){this.C=new olympe.D.Yb('Slot Manager context');this.G=new Map;this.C.run(()=>{this.F=olympe.D.ic(Ob,'Last slot manager entry');this.size=Eb(olympe.D.ic(olympe.D.aa,'SlotManager size').repeat(this.F.ub().Am()),olympe.D.aa.ZERO);this.O=Eb(olympe.D.ic(olympe.D.aa,'last valid slots'),olympe.D.ra(-1))});this.T=[];this.K=[];this.C.onDestroy(()=>{Nb(this)})}};
|
|
363
|
+
class Ob{constructor(a,b,c,d){this.id=a;this.F=new olympe.D.Yb('Slot manager entry');this.K=c;this.O=d;this.F.run(()=>{const e=Eb(olympe.D.ic(olympe.D.aa),olympe.D.aa.ZERO);olympe.D.fb(b)?e.repeat(b):e.update(b);this.C=olympe.D.ic(olympe.D.aa);this.G=this.C.ub().Ud(e.ub())});this.next=null}V(){return this.id}Gw(){return this.C.ub()}Am(){return this.G}Qd(){return this.K}Qw(){return this.O}Ux(a){this.K=a}Hx(a){null===a?this.C.update(olympe.D.aa.ZERO):(this.C.repeat(a.Am()),a.next=this)}Zs(){this.C.clear();
|
|
364
|
+
this.next=null}destroy(){this.F.destroy();this.G=this.C=this.next=null}}m=Ob.prototype;m.V.L=olympe.D.J.C;m.Gw.L=new olympe.D.J(()=>olympe.D.aa);m.Am.L=new olympe.D.J(()=>olympe.D.aa);m.Qd.L=olympe.D.J.C;m.Qw.L=olympe.D.J.C;m.Ux.L=olympe.D.J.C;m.Hx.L=olympe.D.J.C;m.Zs.L=olympe.D.J.C;m.destroy.L=olympe.D.J.C;olympe.D.R={Ca:'df.Logger'};olympe.W.config(a=>{F(a,olympe.D.U.op,Number.POSITIVE_INFINITY);E(a,olympe.D.R.Ca,[olympe.ma.R.Ha],b=>b.Mc('df'))},'olympe.df');olympe.W.run([olympe.D.R.Ca],a=>{olympe.D.qv(a)},'olympe.df');olympe.host={};const Pb=new Map,Qb=new Map;olympe.host.rp=class{static register(a,b,...c){Pb.set(a,b);0<c.length&&Qb.set(a,c)}static create(a,b,c,d){const e=Pb.get(a);if(void 0===e)throw Error('Undefined UI element type: '+a);a=Qb.get(a);return void 0!==a?new e(b,c,...a.map(f=>ua(d,f))):new e(b,c)}};function Rb(a,b,c){a.H.debug('CREATE #',b,', type=',c);a.C.set(b,olympe.host.rp.create(c,b,a.H,a.K))}function Sb(a,b,c,...d){const e=a.C.get(b);if(void 0!==e){a.H.Z()<=olympe.ma.Gb.C.Df&&a.H.debug('CALL #'+b+', '+c+'('+Array.prototype.slice.call(d,0)+')');b=[];for(const f of d)if(void 0===f||null===f)b.push(f);else if(olympe.D.fb(f))b.push(a.C.get(f.Vu)||null);else if('function'===typeof f){const g=f,h=olympe.D.Xa();b.push((...k)=>{h.hb()||g(...k)})}else b.push(f.valueOf());e[c].apply(e,b)}}
|
|
365
|
+
function Tb(a){var b=olympe.host.ve.od,c=olympe.host.ve.qp.Jq;++a.G;const d=a.G;Rb(a,d,c);const e=olympe.D.createNode(b,void 0,void 0,void 0,void 0,'Native('+d+')',!1,function(){var f=arguments.length-2;const g=Array.from({length:f}),h=[],k=arguments[f+1],l=d+'_'+k;this.F.has(l)&&this.F.get(l).destroy();for(let n=0;n<f;n++){let p=arguments[n];olympe.D.fb(p)?(h.push(n),p=p.Da):olympe.D.Sf(p)&&h.push(n);g[n]=p}0===h.length?e.run(()=>{Sb(this,d,k,...g)}):(f=olympe.D.createNode(void 0,(...n)=>{e.run(()=>
|
|
366
|
+
{Sb(this,d,k,...n)})},void 0,g,h,'Native('+d+').'+k),this.F.set(l,f),f.onDestroy(()=>this.F.delete(l)));return null}.bind(a));e.Z(a.O.bind(a,d));a=N(e);a.Vu=d;L(e,a);return a}olympe.host.Sa=class{constructor(a,b){this.H=a;this.K=b;this.G=0;this.C=new Map;this.F=new Map;a.debug('Starting host manager')}eb(){return this.H}O(a){this.H.debug('DESTROY #',a);const b=this.C.get(a);this.C.delete(a);b.destroy()}};olympe.host.Cd=class{constructor(a){this.C=a;this.F=olympe.D.Xa()}G(){return this.C}Tc(){return this.C.Da.Tc()||this.F.Tc()}hb(){return this.C.Da.hb()}};olympe.host.Cd.prototype.G.L=new olympe.D.J(()=>olympe.host.ve.Cd,[]);olympe.host.Rj=class{C(){}F(){}};olympe.host.Uh=class{constructor(){}C(){}F(){}back(){}Ii(){}};function Ub(a){return(a=a.find(b=>'authToken'===b.ia()))?a.getValue():null}olympe.host.Uh.F=class{constructor(a,b,c=!1){this.name=a;this.value=b;this.C=c}ia(){return this.name}getValue(){return this.value}Ka(a){return this.ia()===a.ia()&&this.getValue()===a.getValue()&&this.C===a.C}};function Vb(){const a={}.parameters;return new olympe.host.Uh.C(a?a.map(b=>new olympe.host.Uh.F(b.name,b.value,b.hidden)):[])}
|
|
367
|
+
olympe.host.Uh.C=class{constructor(a){this.parameters=a}merge(a){const b=new Map(this.parameters.map((c,d)=>[c.ia(),d]));a.parameters.forEach(c=>{b.has(c.ia())?this.parameters[b.get(c.ia())]=c:this.parameters.push(c)})}};function Wb(a,b){var c=olympe.host.zf;const d=olympe.Y.Fc(),e=new olympe.D.Yb('onTimeout context');c.C.Z(b,d,()=>{e.hb()||e.Tc()||e.run(a);c.C.G(d)});return new olympe.host.od.F(c.C,d,e)}function Xb(a,b){var c=olympe.host.zf;const d=olympe.Y.Fc(),e=new olympe.D.Yb('onInterval context');c.C.T(b,d,()=>{e.hb()||e.Tc()?c.C.F(d):e.run(a)})}olympe.host.od=class{constructor(a){this.C=Tb(a)}};olympe.host.od.C=class{constructor(a,b,c){this.zf=a;this.id=b;this.C=null!=c?c:null}V(){return this.id}cancel(){}};
|
|
368
|
+
olympe.host.od.K=class extends olympe.host.od.C{cancel(){this.zf.O(this.id);let a;null==(a=this.C)||a.destroy();this.C=null}};olympe.host.od.F=class extends olympe.host.od.C{cancel(){this.zf.G(this.id);let a;null==(a=this.C)||a.destroy();this.C=null}};olympe.host.od.G=class extends olympe.host.od.C{cancel(){this.zf.F(this.id);let a;null==(a=this.C)||a.destroy();this.C=null}};olympe.host.Bj=class{F(a,b){return null!=b?b:''}ba(a,b){return null!=b?b:''}O(){}C(a,b){return null!=b?b:''}G(){}};olympe.host.ve={};olympe.host.ve.Cd=class{destroy(){}};olympe.host.ve.Cd.prototype.destroy=olympe.host.ve.Cd.prototype.destroy;olympe.host.ve.qp={ay:100,ey:101,by:102,hy:103,gy:104,$x:105,CA:201,AA:202,xA:204,FA:205,wA:206,zA:207,DA:208,GA:209,HA:210,IA:211,yA:212,EA:218,BA:219,JA:220,vA:221,uA:222,PA:300,QA:301,RA:302,VA:303,WA:304,XA:305,SA:310,TA:311,UA:312,Zz:400,$z:401,aA:402,Pz:450,Iz:500,Gz:501,Lz:502,Kz:503,Hz:504,Jz:505,pB:600,gB:601,kB:602,cB:603,dB:604,aB:605,fB:606,vB:607,nB:608,YA:609,bB:610,eB:611,mB:612,rB:613,ZA:614,qB:615,lB:616,uB:617,hB:618,iB:619,jB:620,oB:630,$A:631,sB:632,tB:633,ZB:700,CB:701,DB:702,
|
|
369
|
+
EB:703,GB:704,HB:705,IB:706,FB:707,KB:708,JB:709,LB:710,PB:711,XB:712,MB:713,NB:714,QB:715,RB:716,TB:717,UB:718,WB:719,SB:720,VB:721,YB:722,OB:723,$B:724,aC:725,Jq:800};olympe.host.ve.od=class{O(){}Z(){}G(){}T(){}F(){}};olympe.host.R={Oj:'host.System',bl:'host.HistoryManager',jq:'host.Scheduler',Ca:'host.platform.Logger',Ha:'host.Manager',He:'host.ProcessManager'};olympe.host.U={Ip:'host.processProbe',pq:'host.gracefulShutdownTimeout'};olympe.host.zf=null;
|
|
370
|
+
olympe.W.config(function(a){ya(a,olympe.host.R.Oj);ya(a,olympe.host.R.bl);D(a,olympe.host.R.He,olympe.host.Bj);E(a,olympe.host.R.Ca,[olympe.ma.R.Ha],function(b){return b.Mc('host')});D(a,olympe.host.R.Ha,olympe.host.Sa,olympe.host.R.Ca,olympe.W.R.ag);E(a,olympe.host.R.jq,[olympe.host.R.Ha],b=>{null===olympe.host.zf&&(olympe.host.zf=new olympe.host.od(b));return olympe.host.zf},!0)},'olympe.host');olympe.W.run([olympe.host.R.jq],a=>a,'olympe.host.scheduler');olympe.W.run([olympe.host.R.Ha],a=>a,'olympe.host');
|
|
371
|
+
olympe.W.run([olympe.host.R.He],a=>{olympe.host.gk=()=>a});olympe.net={};olympe.net.Ba={};olympe.net.Ba.Nd={bh:'POST',GET:'GET',Gs:'HEAD',Jp:'PUT',zc:'DELETE',zp:'OPTIONS',bA:'PATCH'};olympe.net.Ba.ResponseType={Sl:'text',Dk:'blob',Dq:'arraybuffer'};olympe.net.Ba.Headers={Lh:'content-type',py:'content-length',rn:'authorization',Lr:'access-control-allow-origin',Jr:'access-control-allow-headers',Kr:'access-control-allow-methods',xo:'x-forwarded-host',yo:'x-forwarded-proto'};olympe.net.Ba.Ok={sz:'text/html',JSON:'application/json',Uu:'application/zip',uu:'application/octet-stream'};
|
|
372
|
+
olympe.net.Ba.Zb={Vr:0,$g:200,Mn:201,Ti:202,Bk:400,Ku:401,vo:403,vl:404,Mz:405,gi:500,ou:503};function Yb(a){return a.host&&encodeURI(a.host)}function Zb(a){return encodeURI(a.path).replace(olympe.net.ri.C,(b,c)=>'%'+c)}function $b(a){return void 0===a.G?443===a.port:a.G}olympe.net.ri=class{constructor(a,b,c,d){this.host='localhost';this.port=80;this.path='';this.G=!1;void 0!==a&&(this.host=a);void 0!==b&&(this.port=b);void 0!==c&&(this.path=c.replace(/^\/+/,''));void 0!==d&&(this.G=d)}C(){return`${$b(this)?'wss':'ws'}://${Yb(this)}:${this.port}/${Zb(this)}`}toString(){return`${Yb(this)}:${this.port}/${Zb(this)}`}};
|
|
373
|
+
olympe.net.ri.C=/%25([0-9a-f]{2})/i;olympe.net.WebSocket=class{send(){}close(){}fa(){}ba(){}Z(){}F(){}};function O(a,b,c,d){a=olympe.Y.vx(a.valueOf());if(!a.host&&!a.path)return null;const e=a.scheme?a.scheme.includes('s'):!1;b=new olympe.net.Vh(a.host,a.port||(e?443:80),a.path||'',e,b,c,d,a.query||void 0);a.Er&&(c=a.Er.split(':'),2===c.length&&(c=Ga(olympe.Y.Qe(),`${c[0]}:${c[1]}`),P(b,{Authorization:`Basic ${c}`})));return b}function ac(a){return void 0!==a.query?a.query.replace(/[^=&]+/g,b=>encodeURIComponent(b)):null}function P(a,b){Object.assign(a.headers,b)}
|
|
374
|
+
olympe.net.Vh=class extends olympe.net.ri{constructor(a,b,c,d,e,f,g,h){super(a,b,c,d);this.method=void 0!==e?e:olympe.net.Ba.Nd.GET;this.query=h;this.headers={};this.body=f;this.F=void 0!==g?g:olympe.net.Ba.ResponseType.Sl;this.ca=this.cert=this.key=null;this.rejectUnauthorized=!1}Ei(){return this.headers}C(){let a=ac(this);a=a?`?${a}`:'';return Yb(this)?`${$b(this)?'https':'http'}://${Yb(this)}:${this.port}/${Zb(this)}${a}`:`${Zb(this)}${a}`}toString(){return this.C()}};
|
|
375
|
+
olympe.net.Vh.Nd={bh:'POST',GET:'GET',Gs:'HEAD',Jp:'PUT',zc:'DELETE',zp:'OPTIONS'};olympe.net.Xd=class{constructor(a,b,c,d){this.data=a;this.status=void 0===b?200:b;this.statusText=void 0===c?'':c;this.headers=void 0===d?{}:d}getData(){return this.data}yc(){return this.status}Ei(){return this.headers}};function bc(a,b,c){const d=olympe.D.Xa(),e=d.onDestroy(()=>{var f=a.F();const g=f.C.get(b);g&&(f.C.delete(b),g())});return d.G(f=>{d.xf(e);a.F().C.delete(b);c(f)})}function cc(a,b){return new olympe.net.ef(a,b)}olympe.net.Sa=class{constructor(a){this.H=a;this.K=1;a='Initializing NET layer';this.H.C()&&(a+=' (implementation: '+this.T()+')');this.H.info(a);this.H.log('DONE initializing NET layer (ready to receive connection requests)')}F(){}G(){}C(){}O(){}Tf(){}T(){}};function dc(a){let b;return!(null==(b=a.C)||!b.connected)}function ec(a,b){const c=()=>{const d=b(),e=d.rd();return{username:`${a.T.vhost}:${d.uc()}`,password:e}};return Object.assign({},a.T,c(),{transformWsUrl:(d,e,f)=>{Object.assign(f.options,c());return d}})}
|
|
376
376
|
function fc(a,b,c){if(!dc(a))return Promise.reject(Error('Cannot subscribe because the MQTT client is disconnected'));a.H.C()&&a.H.debug(`MQTT subscribe to topic ${b}`);return new Promise((d,e)=>{a.C.subscribe(b,void 0,f=>{f?e(Error(`Failed to subscribe to topic ${b}: ${f}`)):(a.F.set(b,c),d())})})}
|
|
377
377
|
function gc(a,b){if(!dc(a))return Promise.reject(Error('Cannot unsubscribe because the MQTT client is disconnected'));a.H.C()&&a.H.debug(`MQTT unsubscribe topic ${b}`);return new Promise((c,d)=>{a.C.unsubscribe(b,void 0,e=>{a.F.delete(b);e?d(e):c()})})}function hc(a,b){a.K.push(b)}function ic(a,b){a.G.push(b)}function jc(a,b){a.O.push(b)}
|
|
378
|
-
olympe.net.
|
|
379
|
-
()=>{this.H.info('Mqtt client is connected to bus');this.G.forEach(c=>c())}),this.C.on(olympe.net.
|
|
378
|
+
olympe.net.ef=class{constructor(a,b){this.url=a;this.T=b||null;this.C=null;this.G=[];this.O=[];this.ba=[];this.Z=[];this.K=[];this.F=new Map;this.H=olympe.ma.eb('MQTT')}connect(a,b){if(dc(this))return b&&b(),this;b&&this.G.push(b);null===this.C&&(this.C=mqtt.connect(this.url,ec(this,a)),this.C.on(olympe.net.ef.C.Gt,(c,d)=>{this.H.C()&&this.H.debug(`MQTT < ${d}`);this.F.has(c)?this.F.get(c)(JSON.parse(d.toString())):this.H.warn('There is no subscriber for topic '+c)}),this.C.on(olympe.net.ef.C.cs,
|
|
379
|
+
()=>{this.H.info('Mqtt client is connected to bus');this.G.forEach(c=>c())}),this.C.on(olympe.net.ef.C.eu,()=>{this.H.info('Mqtt client is reconnecting to bus ... ');this.O.forEach(c=>c())}),this.C.on(olympe.net.ef.C.Eb,c=>{this.H.error('Mqtt client error ',c);this.Z.forEach(d=>d(c))}),this.C.on(olympe.net.ef.C.Zd,()=>{this.H.info('Mqtt client is offline');this.ba.forEach(c=>c())}),this.C.on(olympe.net.ef.C.$r,()=>{this.H.info('Mqtt client is closed');this.K.forEach(c=>c())}),this.C.on(olympe.net.ef.C.Wk,
|
|
380
380
|
()=>{this.H.info('Mqtt client has ended')}));return this}publish(a,b,c){if(!dc(this))return Promise.reject(Error('Cannot publish message because the MQTT client is disconnected'));const d=JSON.stringify(b);this.H.C()&&this.H.debug(`MQTT > ${d}`);return new Promise((e,f)=>{this.C.publish(a,d,c,g=>{g?f(Error('Failed to publish a message '+d)):e()})})}end(a,b){this.F.clear();this.C?this.C.end(a,{},()=>{b&&b();this.C=null}):null==b||b();return this}};
|
|
381
|
-
olympe.net.
|
|
382
|
-
olympe.net.
|
|
383
|
-
olympe.W.config(function(a){F(a,olympe.net.U.Sh,3141);F(a,olympe.net.U.
|
|
384
|
-
b],['offlineAutoBackOnline',!b||c]]))},'olympe.net');olympe.Ra.node.host={};olympe.Ra.node.host.Cd=function(a,b){this.H=b};olympe.Ra.node.host.Cd.prototype.constructor=olympe.Ra.node.host.Cd;olympe.Ra.node.host.Cd.prototype.destroy=function(){};olympe.Ra.node.host.Cd.prototype.destroy=olympe.Ra.node.host.Cd.prototype.destroy;olympe.Ra.node.host.Cd.prototype.
|
|
385
|
-
f?c:b,f?'Some services are not working':'Everything is OK')})}).catch(d=>a.H.error(`Failed to add health check route ${d}`));a.F(()=>a.fa.stop())}function mc(a,b){b=Array.from(b.
|
|
381
|
+
olympe.net.ef.C={cs:'connect',eu:'reconnect',Gt:'message',$r:'close',Wk:'end',Eb:'error',Zd:'offline'};olympe.net.pi=class{constructor(a){this.H=a}start(){return Promise.reject('Try to start web server with the browser implementation.')}G(){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.')}K(){return Promise.reject('Try to open a route on a web server using the browser implementation.')}Z(){return Promise.reject('Try to close a route on a web server using the browser implementation.')}};
|
|
382
|
+
olympe.net.pi.C='*';olympe.net.xu=class{register(){return v(function*(){throw Error('Service Worker Manager must be overridden by a native layer: called "register"');})}};olympe.net.R={Ha:'net.Manager',Ca:'net.Logger',oi:'net.WebServer',qu:'net.ServiceWorkerManager',yl:'net.OfflineConfig'};olympe.net.U={Sh:'net.httpPort',Mo:'net.httpBodyLimit',Iq:'net.http2',Lo:'net.httpsCertificatesPath',oj:'net.localNetworkSuffix',di:'offline.enabled',xl:'offline.autoBackOnline',yp:'offline.downloadBatchSize'};
|
|
383
|
+
olympe.W.config(function(a){F(a,olympe.net.U.Sh,3141);F(a,olympe.net.U.Mo,100);F(a,olympe.net.U.Iq,!1);F(a,olympe.net.U.Lo,null);F(a,olympe.net.U.oj,'frontend');F(a,olympe.net.U.di,!1);F(a,olympe.net.U.xl,!1);F(a,olympe.net.U.yp,20);ya(a,olympe.net.R.Ha);E(a,olympe.net.R.Ca,[olympe.ma.R.Ha],b=>b.Mc('net'));D(a,olympe.net.R.oi,olympe.net.pi,olympe.net.R.Ca);D(a,olympe.net.R.qu,olympe.net.xu);E(a,olympe.net.R.yl,[new olympe.W.ka(olympe.net.U.di),new olympe.W.ka(olympe.net.U.xl)],(b,c)=>new Map([['offlineEnabled',
|
|
384
|
+
b],['offlineAutoBackOnline',!b||c]]))},'olympe.net');olympe.Ra.node.host={};olympe.Ra.node.host.Cd=function(a,b){this.H=b};olympe.Ra.node.host.Cd.prototype.constructor=olympe.Ra.node.host.Cd;olympe.Ra.node.host.Cd.prototype.destroy=function(){};olympe.Ra.node.host.Cd.prototype.destroy=olympe.Ra.node.host.Cd.prototype.destroy;olympe.Ra.node.host.Cd.prototype.eb=function(){return this.H};olympe.Ra.node.host.Cd.xa=[olympe.host.ve.Cd];function kc(a){a.H.error('No history manager implemented in Node')}olympe.Ra.node.host.sp=class{constructor(a){this.H=a}Ii(){return!1}C(){kc(this);return Vb()}F(){kc(this)}back(){kc(this)}};olympe.Ra.node.host.sp.xa=[olympe.host.Uh];olympe.Ra.node.host.od=class{constructor(){this.C={};this.K={}}destroy(){}O(a){clearTimeout(this.C[a]);delete this.C[a]}Z(a,b,c){this.C[b]=setTimeout(c,a)}G(a){clearTimeout(this.C[a]);delete this.C[a]}T(a,b,c){this.K[b]=setInterval(c,a)}F(a){clearInterval(this.K[a]);delete this.K[a]}};olympe.host.rp.register(olympe.host.ve.qp.Jq,olympe.Ra.node.host.od);olympe.Ra.node.host.od.xa=[olympe.host.ve.od];olympe.Ra.node.host.Rj=class{constructor(a){this.H=a}C(){return olympe.D.ea.F}F(){return!0}};olympe.Ra.node.host.Rj.xa=[olympe.host.Rj];function lc(a){const b=olympe.net.Ba.Zb.$g,c=olympe.net.Ba.Zb.gi;a.fa.K('healthcheck','/readiness',[olympe.net.Ba.Nd.GET],()=>{const d=Array.from(a.Z.values()).map(e=>e.apply(a));return 0===d.length?Promise.resolve(new olympe.net.Xd('No healthCheck is set',b,'Nothing to check')):Promise.allSettled(d).then(e=>{let f=!1,g='Health check result: ';for(const h of e)'rejected'===h.status?(f=!0,e=h.reason,g+=`\n${e}`,a.H.warn(`Health check detected a service which is DOWN: ${e}`)):g+=`\n${h.value}`;return new olympe.net.Xd(g,
|
|
385
|
+
f?c:b,f?'Some services are not working':'Everything is OK')})}).catch(d=>a.H.error(`Failed to add health check route ${d}`));a.F(()=>a.fa.stop())}function mc(a,b){b=Array.from(b.entries()).map(([c,d])=>olympe.Y.Promise.cn(d(),a.oa,`Shutdown hook ${c} has timeout`));return Promise.allSettled(b).then(c=>{let d=!1;for(const e of c)'rejected'===e.status&&(d=!0,a.H.warn(`Failed to close some resource: ${e.reason}`));return d})}
|
|
386
386
|
function nc(a){return v(function*(){try{const b=yield mc(a,a.K),c=yield mc(a,a.T);if(b||c)throw Error('Failed to gracefully close the backend');}finally{a.K.clear(),a.T.clear()}})}
|
|
387
|
-
olympe.Ra.node.host.
|
|
387
|
+
olympe.Ra.node.host.Bj=class extends olympe.host.Bj{constructor(a,b,c,d=!0){super();this.H=a;this.fa=b;this.oa=c;this.Z=new Map;this.K=new Map;this.T=new Map;d&&lc(this)}C(a,b=olympe.Y.sf()){this.Z.set(b,a);return b}G(a){this.Z.delete(a)}F(a,b=olympe.Y.sf()){this.K.set(b,a);return b}ba(a,b=olympe.Y.sf()){this.T.set(b,a);return b}O(a){this.K.has(a)?this.K.delete(a):this.T.delete(a)}};olympe.W.config(function(a){F(a,olympe.host.U.Ip,!0);F(a,olympe.host.U.pq,1E4);wa(a,olympe.host.R.bl,olympe.Ra.node.host.sp,olympe.host.R.Ca);wa(a,olympe.host.R.Oj,olympe.Ra.node.host.Rj,olympe.host.R.Ca);D(a,olympe.host.R.He,olympe.Ra.node.host.Bj,olympe.host.R.Ca,olympe.net.R.oi,new olympe.W.ka(olympe.host.U.pq),new olympe.W.ka(olympe.host.U.Ip))},'olympe.native.node.host');olympe.W.run([olympe.host.R.He],a=>{olympe.Ra.node.host.gk=()=>a});olympe.net.le={};olympe.net.le.il=class{constructor(a){this.H=a;this.C=new Map}G(){}F(){}};olympe.net.le.WebSocket=class{constructor(a,b){this.H=b;this.id=a;this.C=null;this.buffer=[];this.O=this.G=this.K=this.T=null}V(){return this.id}open(a){const b=`#${this.id}`,c=this.oa(a);c.binaryType='arraybuffer';c.addEventListener('open',()=>{this.H.info('Websocket OPENED');this.T?(this.H.debug('Notifying upper layer for WebSocket',b),this.T()):this.H.warn('Nothing to notify for WebSocket',b);this.H.debug(b,`Send all buffered messages (n=${this.buffer.length}).`);this.buffer.forEach(c.send.bind(c));
|
|
388
388
|
this.buffer.length=0});c.addEventListener('message',d=>{d='string'===typeof d.data?String(d.data):Ha(d.data);(this.H.K()||this.H.C()&&!d.startsWith('pong'))&&this.H.debug(b,'<',d);this.G&&this.G(d)});c.addEventListener('close',()=>{this.H.debug(`WebSocket ${b} CLOSED`);this.K&&this.K()});c.addEventListener('error',()=>{this.H.debug(`WebSocket ${b} ERROR`);this.O&&this.O()});this.C=c}send(a){const b=`#${this.id}`;if(null!==this.C){const c=this.C.constructor;switch(this.C.readyState){case c.OPEN:(this.H.K()||
|
|
389
389
|
this.H.C()&&!a.startsWith('ping'))&&this.H.debug(b,'>',a);this.C.send(a);break;case c.CONNECTING:this.H.debug(b,'- Connecting: BUFFER','>',a);this.buffer.push(a);break;default:return this.H.debug(b,'- Closed','>',a),!1}}else this.H.debug(b,'- Not opened yet: BUFFER','>',a),this.buffer.push(a);return!0}close(){if(null!==this.C){const a=this.C.constructor,b=this.C.readyState;if(b===a.OPEN||b===a.CONNECTING){this.H.debug(`Force closing native websocket ${`#${this.id}`}`);this.C.close(1E3);return}}this.H.debug('Try to force close native websocket, but not open nor connecting')}fa(a){this.T=
|
|
390
|
-
a||null}ba(a){this.G=a||null}F(a){this.O=a||null}Z(a){this.K=a||null}
|
|
390
|
+
a||null}ba(a){this.G=a||null}F(a){this.O=a||null}Z(a){this.K=a||null}oa(){}};olympe.net.le.WebSocket.xa=[olympe.net.WebSocket];olympe.Ra.node.net={};olympe.Ra.node.net.Kt=class extends olympe.net.Sa{constructor(a,b){super(a,b);this.Z=new olympe.Ra.node.net.il(a)}T(){return'NodeJS'}Tf(){return olympe.D.ea.F}G(a){var b=this.K++;a=a.C();this.H.debug('CREATE Websocket #'+b+' to '+a);b=new olympe.Ra.node.net.Lt(b,this.H);b.open(a);return b}C(a,b){this.H.debug('SEND HTTP '+a.method+' to '+a.C());const c=this.K++;b=bc(this,c,b);this.Z.G(c,{u:a.C(),s:$b(a),h:Yb(a),p:a.port,z:Zb(a),q:ac(a),m:a.method,v:a.Ei(),k:a.key,c:a.cert,a:a.ca,j:a.rejectUnauthorized,
|
|
391
391
|
b:a.body,r:a.F},b)}O(){this.H.warn('DOWNLOAD FILE not available with node native implementation. URL:')}F(){return this.Z}};const oc=require('fs'),pc=require('http'),qc=require('https');
|
|
392
|
-
olympe.Ra.node.net.
|
|
393
|
-
new Uint8Array(Buffer.from(M,'binary'));K=w===olympe.net.Ba.ResponseType.
|
|
394
|
-
ArrayBuffer?Buffer.from(C):C);A.end()})};d&&(h||k||l)?h&&k&&l?(b.rejectUnauthorized=n,g(h,'key',b).then(g.bind(null,k,'cert')).then(g.bind(null,l,'ca')).then(p).catch(y=>{this.H.log('Error loading self signed files:',y)})):this.H.warn('All three self signed files must be specified!'):p(b)}F(a,b,c,d){this.H.debug('Received HTTP response',a,c);return new olympe.net.
|
|
395
|
-
function zc(a,b){const c=b.methods,d=b.
|
|
396
|
-
u]of Object.entries(g.headers))k.headers[t]=u;a.H.debug('< HTTP:',k.toString());n=new Map(Object.entries(g.params));g=new Map(Object.entries(g.query));return d(k,n,g).then(t=>{const u=t.
|
|
397
|
-
t.
|
|
398
|
-
olympe.Ra.node.net.http.
|
|
399
|
-
host:'0.0.0.0'}).then(a=>{this.C=tc.
|
|
400
|
-
yield c.start()})})})}stop(){return this.C===tc.
|
|
401
|
-
this.timer=setTimeout(a,b)}};olympe.W.config(function(a){D(a,olympe.net.R.
|
|
402
|
-
olympe.async.
|
|
403
|
-
this.ba),0<this.timeout&&(this.timer=setTimeout(()=>{this.C='Timeout expired.';this.timer=0;this.complete(!1)},this.timeout)))}clear(){this.F=[];this.Z=[];this.env.clear();this.
|
|
404
|
-
function Cc(a){if(0<a.F.length){const b=a.F.shift();a.H&&a.H.log(`Executing next task. ${a.F.length} tasks left in the pipeline.`);a.getContext().run(()=>{b(()=>{Promise.resolve().then(()=>{Cc(a)})},c=>{c&&(a.C=c);a.complete(!1)},a.env)})}else a.complete(!0)}olympe.async.
|
|
405
|
-
olympe.async.
|
|
406
|
-
0<this.F.length){this.T=this.F.length;for(const a of this.F)this.run(a)}else this.complete(!0)}};olympe.
|
|
407
|
-
olympe.N.errors.
|
|
408
|
-
olympe.W.config(a=>{F(a,olympe.N.$b.
|
|
392
|
+
olympe.Ra.node.net.il=class extends olympe.net.le.il{G(a,b,c){const d=b.s,e=b.b,f=b.m;var g=b.v;const h=b.k,k=b.c,l=b.a,n=b.j;var p=b.h;const q=b.p;let r=b.z;r.startsWith('/')||(r=`/${r}`);const t=b.q,u=b.u,w=b.r;b={host:p,port:q,path:t?r+'?'+t:r,method:f,timeout:6E4};g&&(b.headers=g);g=(y,z,A)=>new Promise((C,M)=>{oc.readFile(y,(K,ta)=>{K?M(K):(A[z]=ta,C(A))})});p=y=>{const z=C=>{C.setEncoding(w===olympe.net.Ba.ResponseType.Sl?'utf-8':'binary');let M='';C.on('data',K=>{M+=K});C.on('end',()=>{if(w!==
|
|
393
|
+
olympe.net.Ba.ResponseType.Sl){var K=new Uint8Array(Buffer.from(M,'binary'));K=w===olympe.net.Ba.ResponseType.Dk?new Blob(K):K}else K=M;c(this.F(C.statusCode,C.statusMessage,K,C.headers))})},A=d?new qc.request(y,z):new pc.request(y,z);this.C.set(a,()=>{A.destroy()});A.on('error',C=>{c(this.F(olympe.net.Ba.Zb.gi,'Connection refused','Error connecting to '+u+' with method '+f+', code = '+C.code+', message = '+C.message,''))});!e||'POST'!==f&&'PUT'!==f?A.end():(e instanceof Blob?e.arrayBuffer():Promise.resolve(e)).then(C=>
|
|
394
|
+
{A.write(C instanceof ArrayBuffer?Buffer.from(C):C);A.end()})};d&&(h||k||l)?h&&k&&l?(b.rejectUnauthorized=n,g(h,'key',b).then(g.bind(null,k,'cert')).then(g.bind(null,l,'ca')).then(p).catch(y=>{this.H.log('Error loading self signed files:',y)})):this.H.warn('All three self signed files must be specified!'):p(b)}F(a,b,c,d){this.H.debug('Received HTTP response',a,c);return new olympe.net.Xd(c,a,b,d)}};olympe.Ra.node.net.Lt=class extends olympe.net.le.WebSocket{oa(a){return new (require('ws'))(a)}};olympe.Ra.node.net.U={BB:'native.html.net.useWorkers'};olympe.W.config(function(a){a.getParameter(olympe.net.U.di)&&za(a,olympe.net.U.di,!1);wa(a,olympe.net.R.Ha,olympe.Ra.node.net.Kt,olympe.net.R.Ca,olympe.host.R.Ha)},'olympe.native.node.net');olympe.Ra.node.net.http={};const rc=require('fastify'),{Readable:sc}=require('stream'),tc={Nj:0,Mj:1,Ol:2},uc=olympe.net.Ba.Nd.zp,vc=olympe.net.Ba.Headers.Lr,wc=olympe.net.Ba.Headers.Jr,xc=olympe.net.Ba.Headers.Kr,yc=olympe.net.Ba.Zb.$g;
|
|
395
|
+
function zc(a,b){const c=b.methods,d=b.Lw,e=b.headers,f=b.origin;a.F.route({bodyLimit:a.ba<<20,url:b.path,method:[...c,uc],handler:(g,h)=>{var k=g.method;const l={[vc]:f,[xc]:c,[wc]:e};if(k===uc)return a.H.debug('< HTTP: OPTIONS'),h.code(yc).headers(l).send();var n=g.body;if(n instanceof Buffer){var p=new Uint8Array(n.length);n.copy(p)}else if('string'===typeof n||n instanceof Object)p=n;const [q,r]=g.hostname.split(':');k=new olympe.net.Vh(q,parseInt(r,10),g.url,'https'===g.protocol,k,p);for(const [t,
|
|
396
|
+
u]of Object.entries(g.headers))k.headers[t]=u;a.H.debug('< HTTP:',k.toString());n=new Map(Object.entries(g.params));g=new Map(Object.entries(g.query));return d(k,n,g).then(t=>{const u=t.yc(),w=t.getData();(w instanceof Uint8Array||w instanceof ArrayBuffer||w instanceof sc)&&h.type(olympe.net.Ba.Ok.uu);if(u>=olympe.net.Ba.Zb.gi)throw Error(w);u>=olympe.net.Ba.Zb.Bk?a.H.warn('> HTTP: client bad request: reply with error:',w):a.H.debug('> HTTP: reply with body:',Buffer.isBuffer(w)?'binary':w);return h.code(u).headers(Object.assign(l,
|
|
397
|
+
t.Ei())).send(w)}).catch(t=>{a.H.error('> HTTP: reply with internal server error:',t);return h.code(olympe.net.Ba.Zb.gi).headers(Object.assign(l,{[olympe.net.Ba.Headers.Lh]:'text/plain'})).send('Internal server error')})}})}
|
|
398
|
+
olympe.Ra.node.net.http.pi=class extends olympe.net.pi{constructor(a,b,c,d,e){super(a);this.ba=c;this.port=b;this.fa=d;this.T=e;this.F=this.createServer();this.O=new Map;this.C=tc.Nj;this.vd=new Set;this.timer=null}K(a,b,c,d){this.O.set(a,{path:b,methods:c,Lw:d,headers:'*',origin:'*'});return this.G()}Z(a){const b=this;return v(function*(){b.O.delete(a);return 0<b.O.size?b.G():b.stop()})}start(){if(this.C===tc.Nj)return this.G();if(this.C===tc.Mj){for(const a of this.O.values())zc(this,a);return this.F.listen({port:this.port,
|
|
399
|
+
host:'0.0.0.0'}).then(a=>{this.C=tc.Ol;this.H.debug('Web server listening on '+a);this.vd.forEach(b=>b(null))}).catch(a=>{this.stop().then();this.vd.forEach(b=>b(a))}).finally(()=>this.vd.clear())}return Promise.reject('Try to start a webservice already started')}G(){return this.C===tc.Mj?(new Promise((a,b)=>{this.vd.add(c=>c?b(c):a())})).then(()=>this.G()):new Promise((a,b)=>{this.vd.add(c=>c?b(c):a());this.pm(()=>{const c=this;return v(function*(){c.C=tc.Mj;yield c.F.close();c.F=c.createServer();
|
|
400
|
+
yield c.start()})})})}stop(){return this.C===tc.Ol?this.F.close().then(()=>{this.C=tc.Nj}):Promise.resolve()}createServer(){var a={logger:{level:'warn'},http2:this.fa};if('string'===typeof this.T){const b=require('fs'),c=require('path');Object.assign(a,{https:{allowHTTP1:!0,key:b.readFileSync(c.join(this.T,'key.pem')),cert:b.readFileSync(c.join(this.T,'cert.pem'))}})}a=rc(a);a.addContentTypeParser('*',{parseAs:'buffer'},(b,c,d)=>{d(null,c)});return a}pm(a,b=1E3){this.timer&&clearTimeout(this.timer);
|
|
401
|
+
this.timer=setTimeout(a,b)}};olympe.W.config(function(a){D(a,olympe.net.R.oi,olympe.Ra.node.net.http.pi,olympe.net.R.Ca,new olympe.W.ka(olympe.net.U.Sh),new olympe.W.ka(olympe.net.U.Mo),new olympe.W.ka(olympe.net.U.Iq),new olympe.W.ka(olympe.net.U.Lo))},'olympe.native.node.net.http');olympe.Ra.node.Y={};const Ac=require('buffer');olympe.Ra.node.Y.Gk=class extends olympe.Y.Gk{G(a){return new Uint8Array(Buffer.from(a,'base64'))}C(a){return a instanceof Uint8Array?Buffer.from(a,a.byteOffset,a.byteLength).toString('base64'):Buffer.from(a).toString('base64')}F(a,b,c){try{b(Ac.resolveObjectURL(a))}catch(d){c(`Error while trying to fetch buffer from ObjectURL: ${d}`)}}};olympe.W.config(function(a){wa(a,olympe.Y.R.$f,olympe.Ra.node.Y.Gk)},'olympe.native.node.utils');olympe.async={};function Bc(a,b){a.K||a.Z.push(a.G.G(b))}
|
|
402
|
+
olympe.async.qo=class{constructor(a,b=void 0===a){this.F=[];this.Z=[];this.G=a||new olympe.D.Yb('Async executor context');this.oa=b;this.C=null;this.env=new Map;this.env.set('Executor',this);this.K=this.O=!1;this.H=null;this.timer=this.timeout=0;this.ba=olympe.Y.Fc()}cn(a){0<=a&&(this.timeout=a);return this}eb(){return this.H}add(a){this.K||this.F.push(this.G.G(a));return this}start(){this.O||(this.H&&this.H.log('Executor started.'),this.O=!0,this.G.onDestroy(()=>{this.C='Context destroyed.';this.complete(!1)},
|
|
403
|
+
this.ba),0<this.timeout&&(this.timer=setTimeout(()=>{this.C='Timeout expired.';this.timer=0;this.complete(!1)},this.timeout)))}clear(){this.F=[];this.Z=[];this.env.clear();this.oa&&this.G.destroy()}complete(a){this.G.xf(this.ba);if(!this.K){this.K=!0;this.timer&&(clearTimeout(this.timer),this.timer=0);this.H&&this.H.log(a?'Executor completed successfully':`Executor completed with error: ${this.C}`);for(const b of this.Z)b(a,a?null:this.C,this.env);this.clear()}}getContext(){return this.G}};
|
|
404
|
+
function Cc(a){if(0<a.F.length){const b=a.F.shift();a.H&&a.H.log(`Executing next task. ${a.F.length} tasks left in the pipeline.`);a.getContext().run(()=>{b(()=>{Promise.resolve().then(()=>{Cc(a)})},c=>{c&&(a.C=c);a.complete(!1)},a.env)})}else a.complete(!0)}olympe.async.tq=class extends olympe.async.qo{static create(){return new olympe.async.tq(new olympe.D.Yb('SequencedExecutor'),!0)}start(){this.O||(super.start(),Cc(this))}};
|
|
405
|
+
olympe.async.Aj=class extends olympe.async.qo{constructor(a,b){super(a,b);this.T=0;this.fa=!0}static create(){return new olympe.async.Aj(new olympe.D.Yb('ParallelExecutor'),!0)}run(a){this.H&&this.H.log('Starting a task');this.getContext().run(()=>{a(()=>{this.done()},b=>{this.fa=!1;b&&(this.C=this.C?`${this.C}. ${b}`:b);this.done()},this.env)})}add(a){super.add(a);this.O&&!this.K&&(this.T++,this.run(a));return this}done(){this.T--;0>=this.T&&this.complete(this.fa)}start(){if(!this.O)if(super.start(),
|
|
406
|
+
0<this.F.length){this.T=this.F.length;for(const a of this.F)this.run(a)}else this.complete(!0)}};olympe.Bb={};olympe.Bb.tt=class{F(){return v(function*(){})}Z(){}O(){}G(){}T(){}forEach(){}has(){}get(){}set(){}remove(){}fa(){}ba(){}clear(){}K(){}};olympe.Bb.ut=class{F(){}};olympe.Bb.Storage=class{open(){}write(){}close(){}};olympe.Bb.Dt=class{get(){return null}set(){return this}delete(){}};olympe.Bb.R={nj:'localStorage.KeyValueDatabaseManager',hi:'localStorage.Storage',uy:'localStorage.DatacloudStorage',rl:'localStorage.LocalStorage',Ca:'localStorage.Logger',sg:'localStorage.prefix'};olympe.W.config(function(a){ya(a,olympe.Bb.R.nj);E(a,olympe.Bb.R.sg,[],()=>'olympe');E(a,olympe.Bb.R.Ca,[olympe.ma.R.Ha],b=>b.Mc('localstorage'));D(a,olympe.Bb.R.rl,olympe.Bb.Dt)},'olympe.localstorage');olympe.N={};olympe.N.errors={};olympe.N.errors.Dp=class extends Error{};olympe.N.errors.wp=class extends Error{};olympe.N.errors.Sj=class extends Error{};olympe.N.errors.Sn=class extends Error{};olympe.N.errors.eq=class extends Error{};olympe.N.errors.Gp=class extends Error{};olympe.N.errors.Qu=class extends Error{};olympe.N.errors.Ql=class extends Error{constructor(a,b){super(a);this.id=b}V(){return this.id}};olympe.N.errors.sj=class extends olympe.N.errors.Ql{};olympe.N.errors.Fn=class extends olympe.N.errors.Ql{};
|
|
407
|
+
olympe.N.errors.Jo=class extends olympe.N.errors.Ql{};olympe.N.$b={hj:'urls.FileSvc',sn:'urls.BackupSvc',Xp:'urls.RestoreBackupSvc',eg:'urls.GetContext',Go:'urls.GraphDef',Hn:'urls.StaticGraphDef',TRANSACTION:'urls.Transaction',Hq:'urls.UserTagFromToken',Pu:'urls.UserNameFromTag',Ou:'urls.UserRoles',iu:'urls.RoleMembers',uj:'urls.OpenIDSvc'};
|
|
408
|
+
olympe.W.config(a=>{F(a,olympe.N.$b.hj,'rest/filesvc');F(a,olympe.N.$b.sn,'rest/backupsvc');F(a,olympe.N.$b.Xp,'rest/backupsvc/restore');F(a,olympe.N.$b.uj,'rest/openid');F(a,olympe.N.$b.eg,'rest/initialData');F(a,olympe.N.$b.Go,'rest/querysvc/graphDef');F(a,olympe.N.$b.Hn,'rest/querysvc/graphDef/static');F(a,olympe.N.$b.TRANSACTION,'rest/transaction');F(a,olympe.N.$b.Hq,'rest/token');F(a,olympe.N.$b.Pu,'rest/authorization/getUserTag');F(a,olympe.N.$b.Ou,'rest/authorization/getUserRoles');F(a,olympe.N.$b.iu,
|
|
409
409
|
'rest/authorization/roleMembers')});function Dc(a){a.H.info('Disconnected from bus');let b;null==(b=a.C)||b.forEach((c,d)=>{null!==c.F&&(a.H.info(`Disconnected from bus: pause keep alive of ${c.C.size} subscriptions for ${d} service.`),Ec(c))})}
|
|
410
|
-
function Fc(a){a.H.debug('Connection to bus established. Listening to responses on topic',a.K);return fc(a.F,a.K,b=>{a.H.C()&&a.H.debug('BUS <',JSON.stringify(b));Gc(a,b.seq,'consumed');b=new olympe.N.Response(b.dest,b.src,b.seq,b.type,a.za.F(b.content));Gc(a,b.
|
|
411
|
-
function Hc(a){a.ba.forEach(c=>c(null));a.ba=[];a.H.debug(`Reconnected to bus: resubscribe to ${a.
|
|
412
|
-
function Gc(a,b,c,d=new Map){a.
|
|
413
|
-
function
|
|
414
|
-
c(e)})})}function Oc(a,b,c,d,e){b=new olympe.N.Response(c,a.K,b,d,e);return a.publish(b)}function Pc(a,b,c,d){const e=Qc(a.O).rd();a.Z++;return new olympe.N.Request(b,a.K,e,a.Z,c,d)}function Rc(a,b,c,d){const e=b.
|
|
415
|
-
function Sc(a,b){const c=a.G.get(b);a.G.delete(b);null==c||c(new olympe.N.Response(a.K,a.K,b,olympe.N.Response.ob.Eb,{reason:'Timeout'}))}function Tc(a,b){a.Z++;const c=a.Z,d=setTimeout(()=>Sc(a,c),a.ac);a.G.set(c,e=>{a.G.delete(c);clearTimeout(d);b(e)});return a.Z}function Uc(a,b){return v(function*(){let c;const d=null==(c=a.C)?void 0:c.get(b);d&&(Ec(d),a.C.delete(b));a.
|
|
416
|
-
function Vc(a,b,c,d,e){null===a.C&&(a.C=new Map);let f=a.C.get(b);f?(a=f,a.G!==d&&(a.G=d,null!==a.F&&(Ec(a),
|
|
417
|
-
function Yc(a,b){return new Promise((c,d)=>{a.O.Gg(b.
|
|
418
|
-
olympe.N.
|
|
419
|
-
{this.T=!1;Hc(this)}).catch(k=>{this.H.error(`An error occurred while trying to subscribe to "response topic" on the bus. Close connection: ${k}`);this.F.end()})})}connect(){return new Promise((a,b)=>{const c=d=>{b(d);this.ba.forEach(e=>e(d));this.ba=[]};
|
|
420
|
-
a()),this.Tb=this.fa.ba(()=>this.disconnect())):c(Error('Guest user is not allowed to connect to RabbitMQ, you can allow guest with the bus.allowGuest oConfig parameter!'))})):c(Error('Cannot connect to the bus if working offline'))})}disconnect(){return new Promise(a=>{this.H.debug('Disconnecting from bus');this.O.
|
|
421
|
-
(yield b.connect());var c=a.
|
|
422
|
-
new olympe.N.Response(a,this.K,e.
|
|
423
|
-
function kd(a,b,c){if(null===b)return Promise.reject('No http request to send');P(b,{[$c]:c});const d=b.C();return rxjs.firstValueFrom(rxjs.defer(()=>new Promise((e,f)=>{a.F++;const g=a.F;if(a.H.C()){const h=b.body;a.H.debug('HTTP >',d,`body: ${'string'===typeof h?h:typeof h}`)}jd(a,g,'request',(new Map).set('destination',b.C()).set('messageType',b.method.toString()));a.G.C(b,h=>{jd(a,g,'reply');switch(h.
|
|
424
|
-
typeof k?k:typeof k}`);e(k);break;case dd:h=`HTTP < Service provider for http request to ${b.C()} is overloaded, retry later`;a.H.warn(h);f(new olympe.N.errors.
|
|
425
|
-
a.H.error(k),500===h.
|
|
426
|
-
()=>{let d=!1;olympe.D.
|
|
427
|
-
function
|
|
410
|
+
function Fc(a){a.H.debug('Connection to bus established. Listening to responses on topic',a.K);return fc(a.F,a.K,b=>{a.H.C()&&a.H.debug('BUS <',JSON.stringify(b));Gc(a,b.seq,'consumed');b=new olympe.N.Response(b.dest,b.src,b.seq,b.type,a.za.F(b.content));Gc(a,b.Te().toString(),'deserialized',(new Map).set('source',b.xb()).set('messageType',b.getType().toString()));let c;null==(c=a.G.get(b.Te()))||c(b)})}
|
|
411
|
+
function Hc(a){a.ba.forEach(c=>c(null));a.ba=[];a.H.debug(`Reconnected to bus: resubscribe to ${a.oa.size} active topics.`);a.oa.forEach((c,d)=>{Ic(a,d,c).then(()=>{})});let b;null==(b=a.C)||b.forEach((c,d)=>{null===c.F&&(a.H.debug(`Reconnected to bus: restart keep alive of ${c.C.size} subscriptions for ${d} service.`),Jc(c,!0))})}function Kc(a){return Lc(a.nb)&&dc(a.F)}function Nc(a){a.Ab=a.fa.C(()=>Kc(a)?Promise.resolve('Bus connection OK'):Promise.reject('Bus is disconnected'))}
|
|
412
|
+
function Gc(a,b,c,d=new Map){a.Nb.C&&Ra(a.Nb,'com',d.set('id',`${b}`).set('channel','bus').set('eventType',c))}
|
|
413
|
+
function Ic(a,b,c){return v(function*(){Kc(a)||(yield a.connect());a.H.debug(`Bus: Subscribe to ${b}`);a.oa.set(b,c);yield fc(a.F,b,d=>{a.H.C()&&a.H.debug(`BUS < #${b}: ${JSON.stringify(d)}`);let e=null;try{Gc(a,d.seq,'consumed'),e=new olympe.N.Request(d.dest,d.src,d.auth,d.seq,d.type,a.za.F(d.content)),Gc(a,e.Te().toString(),'deserialized',(new Map).set('source',e.xb()).set('messageType',e.getType().toString()))}catch(f){a.H.error(`An error occurred while trying to deserialize the request: ${JSON.stringify(d)}`)}null!==
|
|
414
|
+
e&&c(e)})})}function Oc(a,b,c,d,e){b=new olympe.N.Response(c,a.K,b,d,e);return a.publish(b)}function Pc(a,b,c,d){const e=Qc(a.O).rd();a.Z++;return new olympe.N.Request(b,a.K,e,a.Z,c,d)}function Rc(a,b,c,d){const e=b.Te(),f=olympe.N.Response.ob.vk;let g=null;g=setTimeout(()=>Sc(a,e),a.ac);a.G.set(e,h=>{g&&clearTimeout(g);h.getType()===f?g=setTimeout(()=>Sc(a,e),d):(a.G.delete(e),c(h))})}
|
|
415
|
+
function Sc(a,b){const c=a.G.get(b);a.G.delete(b);null==c||c(new olympe.N.Response(a.K,a.K,b,olympe.N.Response.ob.Eb,{reason:'Timeout'}))}function Tc(a,b){a.Z++;const c=a.Z,d=setTimeout(()=>Sc(a,c),a.ac);a.G.set(c,e=>{a.G.delete(c);clearTimeout(d);b(e)});return a.Z}function Uc(a,b){return v(function*(){let c;const d=null==(c=a.C)?void 0:c.get(b);d&&(Ec(d),a.C.delete(b));a.oa.delete(b);a.H.debug(`Bus: Unsubscribe to ${b}`);if(Kc(a))return gc(a.F,b)})}
|
|
416
|
+
function Vc(a,b,c,d,e){null===a.C&&(a.C=new Map);let f=a.C.get(b);f?(a=f,a.G!==d&&(a.G=d,null!==a.F&&(Ec(a),Jc(a,!1)))):(f=new olympe.N.Cu(a.H,a,b,d),a.C.set(b,f));d=f;d.C.set(c,e);1===d.C.size&&Jc(d,!1)}function Wc(a,b,c){var d;const e=null==(d=a.C)?void 0:d.get(b);if(null==e?0:Xc(e,c))d=olympe.N.Request.ob.Eq,Kc(a)&&a.publish(Pc(a,b,d,c)).catch(f=>a.H.error(`Impossible to keep alive subscriptions: ${f}`)),0===e.C.size&&(a.C.delete(b),0===a.C.size&&(a.C=null))}
|
|
417
|
+
function Yc(a,b){return new Promise((c,d)=>{a.O.Gg(b.ie(),(e,f)=>{e?d(e):c(f)})})}
|
|
418
|
+
olympe.N.Gn=class{constructor(a,b,c,d,e,f,g,h){b=h.get('connectionOptions');this.H=a;this.nb=c;this.O=d;this.fa=e;this.za=f;this.Nb=g;this.ac=h.get('shortTimeout');this.Oc=h.get('requestTimeout');this.ec=h.get('subscriptionsRefreshRate');this.G=new Map;this.F=cc(h.get('url'),b);this.bb=h.get('allowGuest');this.Z=0;this.K=olympe.Y.Fc();this.C=null;this.T=!1;this.ba=[];this.oa=new Map;this.Tb=this.Ab='';this.Ta=!1;hc(this.F,()=>{Dc(this)});jc(this.F,()=>{this.T=!0});ic(this.F,()=>{this.T&&Fc(this).then(()=>
|
|
419
|
+
{this.T=!1;Hc(this)}).catch(k=>{this.H.error(`An error occurred while trying to subscribe to "response topic" on the bus. Close connection: ${k}`);this.F.end()})})}connect(){return new Promise((a,b)=>{const c=d=>{b(d);this.ba.forEach(e=>e(d));this.ba=[]};Kc(this)?a():this.T||this.Ta?this.ba.push(d=>d?b(d):a()):Lc(this.nb)?(this.Ta=!0,olympe.D.Sm([this.O.lk()],d=>{Nc(this);this.Ta=!1;d.valueOf()||this.bb?(this.bb||Zc(this.O,()=>this.disconnect().then()),this.T=!0,this.F.connect(()=>Qc(this.O),()=>
|
|
420
|
+
a()),this.Tb=this.fa.ba(()=>this.disconnect(),'Bus websocket')):c(Error('Guest user is not allowed to connect to RabbitMQ, you can allow guest with the bus.allowGuest oConfig parameter!'))})):c(Error('Cannot connect to the bus if working offline'))})}disconnect(){return new Promise(a=>{this.H.debug('Disconnecting from bus');this.O.oa.delete('busLogoutCallback');this.F.end(!1,()=>a());this.fa.G(this.Ab);this.fa.O(this.Tb)})}publish(a){const b=this;return v(function*(){if(!b.T||a.getType()!==olympe.N.Request.ob.Ge){Kc(b)||
|
|
421
|
+
(yield b.connect());var c=a.nc();try{Gc(b,a.Te().toString(),'serialize');var d=a.ha(b.za);b.H.C()&&b.H.debug(`BUS > #${c}: ${JSON.stringify(d)}`)}catch(e){throw Error(`An error occurred while serializing the message (seqId=${a.Te()}): ${e}`);}yield b.F.publish(c,d);Gc(b,a.Te().toString(),'publish',(new Map).set('destination',a.nc()).set('messageType',a.getType().toString()))}})}kd(a,b,c){return Oc(this,a.Te(),a.xb(),b,c)}request(a,b,c,d){const e=Pc(this,a,b,c);if(b===olympe.N.Request.ob.PUBLISH){const f=
|
|
422
|
+
new olympe.N.Response(a,this.K,e.Te(),olympe.N.Response.ob.vk);return this.publish(e).then(()=>f)}return new Promise((f,g)=>{Rc(this,e,f,null!=d?d:this.Oc);this.publish(e).catch(g)})}};olympe.N.Gn.C='Timeout';const $c=olympe.net.Ba.Headers.rn,ad=olympe.net.Ba.Zb.$g,bd=olympe.net.Ba.Zb.Mn,cd=olympe.net.Ba.Zb.Ti,dd=olympe.net.Ba.Zb.ou,ed=olympe.net.Ba.Zb.Vr,fd=olympe.net.Ba.Zb.vo,gd=olympe.net.Ba.Zb.Ku,hd=olympe.net.Ba.Zb.vl;function id(a,b){let c;return null!=(c=a.K.get(b))?c:''}function jd(a,b,c,d=new Map){a.C.C&&Ra(a.C,'com',d.set('id',`${b}`).set('channel','http').set('eventType',c))}
|
|
423
|
+
function kd(a,b,c){if(null===b)return Promise.reject('No http request to send');P(b,{[$c]:c});const d=b.C();return rxjs.firstValueFrom(rxjs.defer(()=>new Promise((e,f)=>{a.F++;const g=a.F;if(a.H.C()){const h=b.body;a.H.debug('HTTP >',d,`body: ${'string'===typeof h?h:typeof h}`)}jd(a,g,'request',(new Map).set('destination',b.C()).set('messageType',b.method.toString()));a.G.C(b,h=>{jd(a,g,'reply');switch(h.yc()){case ad:case bd:case cd:var k=h.getData();a.H.C()&&a.H.debug('HTTP <',h.yc(),`content: ${'string'===
|
|
424
|
+
typeof k?k:typeof k}`);e(k);break;case dd:h=`HTTP < Service provider for http request to ${b.C()} is overloaded, retry later`;a.H.warn(h);f(new olympe.N.errors.Gp(h));break;case ed:a.H.debug(`HTTP < request canceled (${b.C()}).`);e();break;case fd:case gd:h=`HTTP < request authorization denied: ${b.C()}`;a.H.error(h);f(new olympe.N.errors.Qu(h));break;case hd:h=`HTTP < requested resource not found: ${b.C()}`;a.H.error(h);f(new olympe.N.errors.wp(h));break;default:k=`HTTP < Error: ${h.yc()}, ${h.statusText}`,
|
|
425
|
+
a.H.error(k),500===h.yc()&&'Connection refused'===h.statusText?f(new olympe.N.errors.Sn(k)):f(Error(k))}})})).pipe(olympe.N.operators.Oi(olympe.N.errors.Gp,(e,f)=>{a.H.warn(`Service overloaded (${d}), retry sending http request after ${f}ms.`)},4E3)))}olympe.N.Hs=class{constructor(a,b,c,d){this.H=a;this.G=b;this.C=c;this.K=d;this.F=0}};function ld(a,b,c){a.H.info('Initializing COMMUNICATION layer');if(a.H.C()){const d=['Server layer parameters:'];b.forEach((e,f)=>{d.push(f+'="'+e+'"')});a.H.debug(d.join('\n\t'))}md(a,olympe.N.qe.Eb,d=>{switch(d.c){case olympe.N.ob.Mu:a.H.error('Unknown message sent to the server:',olympe.N.Va.Mb[d.s]);break;case olympe.N.ob.As:a.H.error('Fatal error, the last message is probably too big according to the websocket config.'),a.G.forEach((e,f)=>{null!==e.Wm&&nd(a,f,d.i)})}});olympe.D.Hi(a.connected,
|
|
426
|
+
()=>{let d=!1;olympe.D.Hi(a.za.C(),()=>{d&&(a.ac(),a.bb(),d=!1);Xb(a.ac.bind(a),a.ed);Xb(a.bb.bind(a),a.nb)},()=>{a.K=[0,0,a.K[2]];d=!0})},()=>{a.O=null;Wb(a.bb.bind(a),a.nb)});c.C(()=>od(a)?Promise.resolve('WebSocket connection to Orchestrator OK'):Promise.reject(`WebSocket connection to Orchestrator is ${a.C}`));c.ba(()=>a.disconnect(),'Orchestrator websocket');a.H.log('DONE initializing SERVER layer (waiting for NET layer connection to be opened)')}
|
|
427
|
+
function od(a){return a.C===olympe.N.Va.C.Og}
|
|
428
|
+
function Q(a,b){if(a.C!==b)switch(a.H.debug('State change '+a.C+' --\x3e '+b),a.C=b,a.Ab.forEach(c=>c(b)),b){case olympe.N.Va.C.Zl:case olympe.N.Va.C.CONNECTING:case olympe.N.Va.C.eo:break;case olympe.N.Va.C.Og:a.connected.update(olympe.D.ea.F);break;case olympe.N.Va.C.og:a.K=[0,0,a.K[2]];pd(a);break;case olympe.N.Va.C.Eb:a.H.error('Connection to server',a.Z.C(),'aborted due to error');a.connected.update(olympe.D.ea.C);break;case olympe.N.Va.C.ln:pd(a);break;case olympe.N.Va.C.Vd:a.connected.update(olympe.D.ea.C);
|
|
428
429
|
break;default:throw Error('State machine error in server manager. Should not get in state '+b);}}
|
|
429
|
-
function qd(a){const b=olympe.N.Va.C.
|
|
430
|
-
Q(a,d)}});f.F(()=>{a.H.warn(`Communication with ${e} failed.`);f.close();Q(a,d)});f.fa(()=>{a.H.info(`Checking orchestrator status with ${e}`);f.send('{"action": "status"}')})}function rd(a,b,c,d=!1){const e=f=>{if(0===b.length||b.includes(f))d&&a.
|
|
431
|
-
function pd(a){const b=olympe.N.Va.C.INIT,c=olympe.N.Va.C.CONNECTING,d=olympe.N.Va.C.Og,e=olympe.N.Va.C.
|
|
432
|
-
function td(a,b,c,d){const e=a.
|
|
433
|
-
function ud(a,b){const c=olympe.N.Va.G.
|
|
434
|
-
(f=olympe.N.errors.
|
|
435
|
-
function md(a,b,c,d){void 0===d&&(d=olympe.Y.
|
|
436
|
-
function zd(a,b,c){a.ec=c?1E3*c:-1;a.H.info(`Connected to ${a.Z.C()}`,'|',b?`server version: ${b}`:'','|',null!==c?`activity timeout: ${c}s`:'');b=Array.from(a.G).sort(([d],[e])=>d-e);for(const [d,e]of b)if(!vd(a,d,e))return;Q(a,olympe.N.Va.C.Og)}function wd(a){return`${olympe.Y.
|
|
437
|
-
olympe.N.Va=class{constructor(a,b,c,d,e,f,g,h){this.H=a;this.Tb=b;this.Z=e;this.F=null;this.Ta=f;this.ba=g;this.
|
|
438
|
-
new Map;this.
|
|
439
|
-
{g===d?a():b(Error('Was not able to disconnect'))},!0),this.C!==c&&(Q(this,c),this.F.close())):(Q(this,d),a())})}Fd(){this.H.debug('Websocket connected, sending handshake. Client version:',$a(this.T),'subscribeEverything:',this.
|
|
440
|
-
b.sv||'undefined';var d=b.activityTimeout?Math.max(b.activityTimeout-60,5):null;switch(b.status){case c.
|
|
441
|
-
a,'is invalid. Cannot check against it');else try{var e=olympe.Y.mf.parse(a);if(e.
|
|
442
|
-
Q(this,e);else{if(e=b.identityProviders)for(const [f,g]of Object.entries(e))this.
|
|
443
|
-
var b=0;this.ba.C&&(b=performance.now()-this.ba.F);try{var c=JSON.parse(a)}catch(e){return this.H.error('Unable to parse response from server: '+e.toString()),Error('Unable to parse response from server')}this.H.C()&&this.H.debug('WS <',wd(c));a=c.seqId;const d=c.messageFamily;c=c.payload;sd(this,a,'consumed',new Map,b);sd(this,a,'deserialized',(new Map).set('family',d));this.G.has(a)&&({
|
|
444
|
-
Date.now();for(const [b,{
|
|
445
|
-
function Ad(a,b){const c=olympe.N.
|
|
446
|
-
function Bd(a){return null===a.storage.get(a.K+'olympe_manual_offline')}
|
|
447
|
-
olympe.N.
|
|
448
|
-
olympe.N.
|
|
449
|
-
yield a.G.disconnect())})}};olympe.N.
|
|
450
|
-
olympe.N.Response.ob={
|
|
451
|
-
olympe.N.
|
|
452
|
-
Ld)return Promise.reject('Should only call `notifyOn` on SUBSCRIBE requests');const b=olympe.Y.
|
|
453
|
-
olympe.N.
|
|
454
|
-
olympe.N.
|
|
455
|
-
return{t:3,m:b};case Array.isArray(a):return a.map(this.C.bind(this));case a instanceof ArrayBuffer:return{t:4,v:olympe.Y.
|
|
456
|
-
this.F(b));switch(a.t){case 1:return new Date(a.d);case 2:return olympe.D.Color.Ub(a);case 3:return new Map(Object.entries(a.m).map(([b,c])=>[b,this.F(c)]));case 4:return olympe.Y.
|
|
457
|
-
function $d(a){let b,c;a=null!=(c=null==(b=a.C)?void 0:b.reason)?c:'Unknown reason';return'Timeout'===a?new olympe.N.errors.
|
|
458
|
-
olympe.N.tb=class{constructor(a,b){this.F=olympe.N.Bg();this.K=a;this.G=this.C=null;this.O=new olympe.D.Yb(`Service ${a}`,'function'===typeof b.F?b.F():b);this.H=olympe.
|
|
459
|
-
g));break;case Zd:c=d.body();null==(e=this.C)||e.delete(c);let f;null==(f=this.G)||f.call(this,c);break;case Wd:a.next(d);break;default:this.F.
|
|
430
|
+
function qd(a){const b=olympe.N.Va.C.ln,c=olympe.N.Va.C.Zl,d=olympe.N.Va.C.Vd,e=Zb(a.Ta);a.H.info(`Trying to wakeup orchestrator with ${e}`);Q(a,c);const f=a.Tb.G(a.Ta);f.ba(g=>{const h=JSON.parse(g);a.H.info(`${e}: ${null==h?void 0:h.status}`);switch(null==h?void 0:h.status){case 'ready':Q(a,b);f.close();break;case 'asleep':a.H.info(`Trying to wakeup orchestrator with ${e}`);f.send('{"action": "wakeup"}');Q(a,c);break;case 'waking-up':break;default:a.H.warn(`Invalid message from ${e}: ${g}`),f.close(),
|
|
431
|
+
Q(a,d)}});f.F(()=>{a.H.warn(`Communication with ${e} failed.`);f.close();Q(a,d)});f.fa(()=>{a.H.info(`Checking orchestrator status with ${e}`);f.send('{"action": "status"}')})}function rd(a,b,c,d=!1){const e=f=>{if(0===b.length||b.includes(f))d&&a.Ab.delete(e),c(f)};a.Ab.add(e);e(a.C)}function sd(a,b,c,d,e){a.ba.C&&Ra(a.ba,'com',d.set('id',`${b}`).set('channel','ws').set('eventType',c),e)}
|
|
432
|
+
function pd(a){const b=olympe.N.Va.C.INIT,c=olympe.N.Va.C.CONNECTING,d=olympe.N.Va.C.Og,e=olympe.N.Va.C.Vd,f=olympe.N.Va.C.og,g=olympe.N.Va.C.Zl,h=olympe.N.Va.C.Eb;null!==a.F&&(a.F.Z(null),a.F.close());a.H.log(`Asking NET layer for a connection to ${Yb(a.Z)}:${a.Z.port}...`);a.F=a.Tb.G(a.Z);a.F.fa(a.Fd.bind(a));a.F.ba(a.qf.bind(a));a.F.Z(()=>{a.F=null;a.C===d?Q(a,f):a.C!==h&&a.C!==g&&Q(a,e)});a.Ta&&a.C===b&&a.F.F(()=>{a.F.F(null);a.C===c&&qd(a);a.Ta=null});a.C!==f&&Q(a,c)}
|
|
433
|
+
function td(a,b,c,d){const e=a.Ne;a.Ne++;c={message:{seqId:e,messageFamily:b,payload:c},im:d?ud(a,d):null,Wm:null};a.G.set(e,c);sd(a,e,'publish',(new Map).set('family',b));d=[olympe.N.Va.C.CONNECTING,olympe.N.Va.C.og];(od(a)||b===olympe.N.qe.lj&&d.includes(a.C))&&vd(a,e,c)}
|
|
434
|
+
function ud(a,b){const c=olympe.N.Va.G.ii;return d=>{if(null!==d&&void 0!==d){var e=null,f,g=null==(f=d.info)?void 0:f.warn;f=d.s;if('string'===typeof g)a.H.debug(`A message has raised a warning in the orchestrator: ${g}. Investigate.`);else if(void 0!==f&&f!==c){e=void 0!==olympe.N.Va.Mb[f]?`Status code = ${f} [${olympe.N.Va.Mb[f]}]`:`Status code = ${f}`;g=d.info;f=olympe.N.errors.eq;if(void 0!==g&&void 0!==g.error){var h=g.error.reason;'string'===typeof h&&0<h.length&&(h.includes('Message timeout')&&
|
|
435
|
+
(f=olympe.N.errors.Sj),e+=`\nReason:\n${g.error.reason}`);h=g.error.detailedReason;'string'===typeof h&&0<h.length&&(e+=`\nDetails:\n${g.error.detailedReason}`)}e=new f('Rejected by orchestrator:\n'+e)}b(e,d)}}}function vd(a,b,c){var d=c.message;a.H.C()&&a.H.debug('WS >',wd(d));(d=a.F.send(JSON.stringify(d)))?null===c.im?a.G.delete(b):c.Wm=Date.now():olympe.D.Qa(a.za.C()).valueOf()&&Q(a,olympe.N.Va.C.og);return d}
|
|
436
|
+
function md(a,b,c,d){void 0===d&&(d=olympe.Y.Fc());let e=a.fa.get(b);void 0===e&&(e=new Map,a.fa.set(b,e));e.set(d,c)}function xd(a){a=a.fa.get(olympe.N.qe.ig);void 0!==a&&a.delete('logoutHandler')}function nd(a,b,c){if(a.G.has(b)){const {im:d}=a.G.get(b);a.G.delete(b);d&&d({s:23,info:c})}}function yd(a,b){a.H.error(b);Q(a,olympe.N.Va.C.Eb)}
|
|
437
|
+
function zd(a,b,c){a.ec=c?1E3*c:-1;a.H.info(`Connected to ${a.Z.C()}`,'|',b?`server version: ${b}`:'','|',null!==c?`activity timeout: ${c}s`:'');b=Array.from(a.G).sort(([d],[e])=>d-e);for(const [d,e]of b)if(!vd(a,d,e))return;Q(a,olympe.N.Va.C.Og)}function wd(a){return`${olympe.Y.jw(a.messageFamily)}: ${JSON.stringify(a.payload)}`}
|
|
438
|
+
olympe.N.Va=class{constructor(a,b,c,d,e,f,g,h){this.H=a;this.Tb=b;this.Z=e;this.F=null;this.Ta=f;this.ba=g;this.ed=h.get('pingInterval');h.get('retryHttpOverload');this.nb=h.get('messageTimeout');this.T=olympe.Y.mf.parse(h.get('clientVersion'));this.oa=olympe.Y.mf.parse(h.get('serverVersion'));this.C=olympe.N.Va.C.INIT;this.za=d;this.Nb=h.get('getContextMode');this.Ne=1;this.O=null;this.K=[0,0,0];this.fa=new Map;this.connected=olympe.D.ic(olympe.D.ea,'Server is connected');this.Ab=new Set;this.G=
|
|
439
|
+
new Map;this.Oc=new Map;this.ec=-1;ld(this,h,c)}connect(){const a=olympe.N.Va.C.Og,b=olympe.N.Va.C.Vd,c=olympe.N.Va.C.Eb,d=olympe.N.Va.C.INIT;return new Promise((e,f)=>{this.C!==d&&this.C!==b||pd(this);rd(this,[a,b,c],g=>{g===a?e():f(Error('Was not able to open a connection to the orchestrator'))},!0)})}disconnect(){return new Promise((a,b)=>{const c=olympe.N.Va.C.eo,d=olympe.N.Va.C.Vd,e=olympe.N.Va.C.CONNECTING,f=olympe.N.Va.C.Eb;this.C===olympe.N.Va.C.Og||this.C===e||this.C===c?(rd(this,[d,f],g=>
|
|
440
|
+
{g===d?a():b(Error('Was not able to disconnect'))},!0),this.C!==c&&(Q(this,c),this.F.close())):(Q(this,d),a())})}Fd(){this.H.debug('Websocket connected, sending handshake. Client version:',$a(this.T),'subscribeEverything:',this.Nb?'NO':'YES');td(this,olympe.N.qe.lj,{c:olympe.N.ob.lj,cv:$a(this.T),m:this.Nb?0:1,s:this.O,b:this.za.F()},this.rf.bind(this))}rf(a,b){if(a)yd(this,'Error in receiving handshake response: '+a.message);else{this.H.debug('Handshake response received');var c=olympe.N.Va.F;a=
|
|
441
|
+
b.sv||'undefined';var d=b.activityTimeout?Math.max(b.activityTimeout-60,5):null;switch(b.status){case c.Rs:yd(this,`Framework version (${$a(this.T)}) provided to the orchestrator was not valid. See orchestrator logs for more info.`);return;case c.Eu:yd(this,`Framework version (${$a(this.T)}) is not compatible with the orchestrator in use. See orchestrator logs for more info.`);return;case c.Cs:yd(this,'Handshake failed. See orchestrator logs for more info.');return}if(this.oa.Ka(olympe.Y.mf.C))this.H.warn('Handshake successful but received server version',
|
|
442
|
+
a,'is invalid. Cannot check against it');else try{var e=olympe.Y.mf.parse(a);if(e.Ri(this.oa)){yd(this,`Framework v${$a(this.T)} is expecting Orchestrator to be at least in v${$a(this.oa)}`);return}this.H.log('Handshake successful. Orchestrator version: ',e,'required:',$a(this.oa))}catch(f){yd(this,f);return}e=olympe.N.Va.C.Vd;if(this.C===olympe.N.Va.C.og&&null!==this.O&&this.O!==b.sessionId)this.H.warn('Trying to do a session recovering, but got another session id so retry from disconnected state'),
|
|
443
|
+
Q(this,e);else{if(e=b.identityProviders)for(const [f,g]of Object.entries(e))this.Oc.set(f,g);this.O=b.sessionId||null;zd(this,a,d)}}}ac(){this.K[0]-this.K[1]>this.ed/2?(this.H.debug('Ping did not get answer, try to reconnect'),Q(this,olympe.N.Va.C.og)):(this.K[0]=Date.now(),this.F.send('ping')||(this.H.debug('Impossible to send ping, try to reconnect'),Q(this,olympe.N.Va.C.og)))}qf(a){this.K[2]=Date.now();if(a.startsWith('pong'))return olympe.D.Qa(this.za.C()).valueOf()&&(this.K[1]=this.K[2]),null;
|
|
444
|
+
var b=0;this.ba.C&&(b=performance.now()-this.ba.F);try{var c=JSON.parse(a)}catch(e){return this.H.error('Unable to parse response from server: '+e.toString()),Error('Unable to parse response from server')}this.H.C()&&this.H.debug('WS <',wd(c));a=c.seqId;const d=c.messageFamily;c=c.payload;sd(this,a,'consumed',new Map,b);sd(this,a,'deserialized',(new Map).set('family',d));this.G.has(a)&&({im:b}=this.G.get(a),this.G.delete(a),b&&b(c));b=this.fa.get(d);if(void 0!==b)for(const e of b.values())e(c);return null}bb(){const a=
|
|
445
|
+
Date.now();for(const [b,{Wm:c}]of this.G)null!==c&&a-c>this.nb&&(this.H.warn(`No response was received from the server for the seqId = ${b}`),nd(this,b,{error:{reason:'Message timeout: never receive acknowledge'}}))}};function Lc(a){return olympe.D.Qa(a.C)===olympe.N.kc.C.ei}
|
|
446
|
+
function Ad(a,b){const c=olympe.N.kc.C.Dl,d=olympe.N.kc.C.Zd,e=olympe.N.kc.C.Vd,f=olympe.N.kc.C.oq,g=b.get('reconnectionDelay');rd(a.G,[olympe.N.Va.C.INIT],()=>{Bd(a)?(a.C.update(c),a.connect().catch(h=>a.H.error(h))):a.G.disconnect().catch(h=>a.H.error(h))},!0);rd(a.G,[olympe.N.Va.C.Vd],()=>{a.C.update(a.F?d:e);if(Bd(a)&&a.O){const h=`Disconnected, will try to auto reconnect in ${g} ms`;a.F?a.H.log(h):a.H.error(h);setTimeout(()=>a.connect().catch(k=>a.H.error(k)),g)}else a.H.info('Disconnected, stay offline.')});
|
|
447
|
+
a.T.F(()=>{a.C.update(f);return Promise.resolve()},'Connectivity manager: shutdown state')}function Bd(a){return olympe.D.Qa(a.C)!==olympe.N.kc.C.oq&&null===a.storage.get(a.K+'olympe_manual_offline')}
|
|
448
|
+
olympe.N.kc=class{constructor(a,b,c,d,e,f){this.H=a;this.G=b;this.T=d;this.storage=e;this.C=olympe.D.ic(Number).update(olympe.N.kc.C.INIT);this.F=f.get('offlineEnabled');this.O=f.get('offlineAutoBackOnline');this.K=f.get('storagePrefix');Ad(this,f)}Tf(){const a=olympe.N.kc.C.ei,b=olympe.N.kc.C.Zd,c=olympe.N.kc.C.Vd;let d=olympe.D.ea.C;return olympe.D.ta([this.C],e=>{if(e===a)d=olympe.D.ea.F;else if(e===b||e===c)d=olympe.D.ea.C;return d},olympe.D.ea)}getState(){return this.C.ub()}connect(){const a=
|
|
449
|
+
this;return v(function*(){const b=olympe.N.kc.C.ei,c=olympe.N.kc.C.Dl;olympe.D.Qa(a.C)!==b&&(a.C.update(c),a.storage.delete(a.K+'olympe_manual_offline'),yield a.G.connect(),yield Cd(),a.C.update(b))})}disconnect(){const a=this;return v(function*(){const b=olympe.N.kc.C.Zd,c=olympe.N.kc.C.Dl;if(!a.F)throw Error('Try to go offline manually while the process does not support it. Please add `offline.enabled=true` in the config');a.storage.set(a.K+'olympe_manual_offline','true');olympe.D.Qa(a.C)!==b&&
|
|
450
|
+
(a.C.update(c),yield olympe.N.Bg().disconnect(),yield a.G.disconnect())})}};olympe.N.kc.C={INIT:0,Dl:1,ei:2,Zd:3,Vd:4,oq:5};olympe.N.kc.F='olympe_manual_offline';olympe.N.Request=class{constructor(a,b,c,d,e,f){this.G=d;this.C=a;this.source=b;this.K=c;this.Dh=e;this.F=f||null}nc(){return this.C}xb(){return this.source}Te(){return this.G}getType(){return this.Dh}ie(){return this.K}ha(a){return{dest:this.C,src:this.source,seq:this.G,auth:this.K,type:this.Dh,content:a.ha(this.F)}}toString(){return`Request(dest: ${this.C}, src: ${this.source}, seqId: ${this.G}, type: ${this.Dh})`}};olympe.N.Request.ob={SEND:0,GET:1,PUBLISH:2,SUBSCRIBE:3,Ge:4,Eq:5};function Dd(a){const b=olympe.N.Response.ob.Cq;return a.F!==olympe.N.Response.ob.Tl?Promise.reject('Should only call `topicAck` on TOPIC responses'):Oc(olympe.N.Bg(),a.C.seq,a.source,b)}olympe.N.Response=class{constructor(a,b,c,d,e){this.K=c;this.G=a;this.source=b;this.F=d;this.C=null!=e?e:null}nc(){return this.G}xb(){return this.source}Te(){return this.K}getType(){return this.F}ha(a){return{dest:this.G,src:this.source,seq:this.K,type:this.F,content:a.ha(this.C)}}toString(){return JSON.stringify(this)}};
|
|
451
|
+
olympe.N.Response.ob={vk:0,kq:1,Lq:2,Tl:3,Cq:4,Eb:5};const Ed=olympe.N.Response.ob.kq,Fd=olympe.N.Response.ob.Eb,Gd=olympe.N.Response.ob.Lq,Hd=olympe.N.Response.ob.Tl,Id=olympe.N.Response.ob.Cq,Jd=olympe.N.Request.ob.SEND,Kd=olympe.N.Request.ob.GET,Ld=olympe.N.Request.ob.SUBSCRIBE,Md=olympe.N.Request.ob.Ge;
|
|
452
|
+
olympe.N.Kc=class{constructor(a,b,c){this.request=a;this.C=b;this.G=c;this.F=null}Fh(){return null!==this.F?Promise.resolve(this.F):Yc(this.C,this.request).then(a=>this.F=a)}Dh(){return this.request.getType()}source(){return this.request.xb()}body(){return this.request.F}Uq(){return this.request.getType()===Jd?this.C.kd(this.request,Ed):Promise.reject('Should only call `ack` on SEND requests')}kd(a){const b=this.request.getType();return b===Kd||b===Md?this.C.kd(this.request,Gd,a):Promise.reject('Should only call `reply` on GET requests')}Qm(a){if(this.request.getType()!==
|
|
453
|
+
Ld)return Promise.reject('Should only call `notifyOn` on SUBSCRIBE requests');const b=olympe.Y.Fc();return new Promise((c,d)=>{const e={seq:Tc(this.C,f=>{switch(f.getType()){case Id:Nd(this.G,b);c(b);break;case Fd:d(f.C.reason);break;default:d('Unsupported response type for a SUBSCRIBE request')}}),topic:a,id:b,refresh:this.C.ec};this.C.kd(this.request,Hd,e).catch(d)})}sh(a){return this.C.kd(this.request,Fd,{reason:a.message})}};olympe.N.Kc.prototype.fail=olympe.N.Kc.prototype.sh;
|
|
454
|
+
olympe.N.Kc.prototype.notifyOn=olympe.N.Kc.prototype.Qm;olympe.N.Kc.prototype.reply=olympe.N.Kc.prototype.kd;olympe.N.Kc.prototype.ack=olympe.N.Kc.prototype.Uq;olympe.N.Kc.prototype.body=olympe.N.Kc.prototype.body;olympe.N.Kc.prototype.source=olympe.N.Kc.prototype.source;olympe.N.Kc.prototype.requestType=olympe.N.Kc.prototype.Dh;olympe.N.Kc.prototype.userTag=olympe.N.Kc.prototype.Fh;function Ec(a){if(null!==a.F){var b=a.F;a.F=null;clearInterval(b)}}function Jc(a,b){b&&a.Ve();null===a.F&&(a.F=setInterval(a.Ve.bind(a),a.G))}function Xc(a,b){b=a.C.delete(b);0===a.C.size&&Ec(a);return b}function Od(a,b){a.C.forEach((c,d)=>{Xc(a,d);c(b)})}
|
|
455
|
+
olympe.N.Cu=class{constructor(a,b,c,d){this.H=a;this.K=b;this.O=c;this.G=d;this.C=new Map;this.F=null}Ve(){const a=olympe.N.errors.sj;Kc(this.K)?this.K.request(this.O,olympe.N.Request.ob.Ge,Array.from(this.C.keys())).then(b=>{b=b.C;0<b.length&&b.forEach(c=>{const d=this.C.get(c);Xc(this,c);null==d||d(new a('Subscription does not exist in the service.',c))})}).catch(b=>{b=`Impossible to keep alive subscriptions: ${b}`;this.H.error(b);Od(this,Error(b))}):Ec(this)}};olympe.N.tg=class{ha(a){return this.C(a)}F(a){return this.G(a)}C(a){switch(!0){case null===a:case void 0===a:return null;case 'string'===typeof a:case 'boolean'===typeof a:case 'number'===typeof a:return a;case a instanceof olympe.D.gb:return{t:1,d:a.valueOf().toISOString()};case a instanceof Date:return{t:1,d:a.toISOString()};case a instanceof olympe.D.Color:return Object.assign({t:2},a.toJSON());case a instanceof Map:const b=Object.create(null);for(const [c,d]of a)'string'===typeof c&&(b[c]=this.C(d));
|
|
456
|
+
return{t:3,m:b};case Array.isArray(a):return a.map(this.C.bind(this));case a instanceof ArrayBuffer:return{t:4,v:olympe.Y.Qe().C(a)};case a instanceof Uint8Array:return{t:5,v:olympe.Y.Qe().C(a)};case 'object'===typeof a:return Object.entries(a).reduce((c,[d,e])=>{c[d]=this.C(e);return c},{});default:throw Error(`Impossible to serialize the following value: ${a}`);}}G(a){switch(!0){case null===a:case void 0===a:return null;case 'string'===typeof a:case 'boolean'===typeof a:case 'number'===typeof a:return a}if(Array.isArray(a))return a.map(b=>
|
|
457
|
+
this.F(b));switch(a.t){case 1:return new Date(a.d);case 2:return olympe.D.Color.Ub(a);case 3:return new Map(Object.entries(a.m).map(([b,c])=>[b,this.F(c)]));case 4:return olympe.Y.Qe().G(a.v).buffer;case 5:return olympe.Y.Qe().G(a.v);default:return Object.entries(a).reduce((b,[c,d])=>{b[c]=this.F(d);return b},{})}}};const Pd=olympe.N.Response.ob.kq,Qd=olympe.N.Response.ob.vk,Rd=olympe.N.Response.ob.Eb,Sd=olympe.N.Response.ob.Lq,Td=olympe.N.Response.ob.Tl,Ud=olympe.N.Request.ob.SEND,Vd=olympe.N.Request.ob.GET,Wd=olympe.N.Request.ob.PUBLISH,Xd=olympe.N.Request.ob.SUBSCRIBE,Yd=olympe.N.Request.ob.Ge,Zd=olympe.N.Request.ob.Eq;function Nd(a,b){a.C||(a.C=La(new olympe.Y.Wl(a.F.ec+3E4),c=>{let d;null==(d=a.G)||d.call(a,c)}));a.C.add(b)}
|
|
458
|
+
function $d(a){let b,c;a=null!=(c=null==(b=a.C)?void 0:b.reason)?c:'Unknown reason';return'Timeout'===a?new olympe.N.errors.Sj(a):Error(a)}
|
|
459
|
+
olympe.N.tb=class{constructor(a,b){this.F=olympe.N.Bg();this.K=a;this.G=this.C=null;this.O=new olympe.D.Yb(`Service ${a}`,'function'===typeof b.F?b.F():b);this.H=olympe.ma.eb(`Service ${this.K}`)}listen(){return new rxjs.Observable(a=>{const b=()=>{a.complete();this.clear()};this.O.onDestroy(b);Ic(this.F,this.K,c=>{const d=new olympe.N.Kc(c,this.F,this);switch(c.getType()){case Yd:var e=d.body().filter(g=>{let h;return!(null==(h=this.C)?0:Ka(h,g))});d.kd(e).catch(g=>this.H.error('Not able to validate subscription keep alive',
|
|
460
|
+
g));break;case Zd:c=d.body();null==(e=this.C)||e.delete(c);let f;null==(f=this.G)||f.call(this,c);break;case Wd:a.next(d);break;default:this.F.kd(c,Qd).then(()=>a.next(d))}}).catch(c=>{c='Failed to connect to the bus: '+c;this.H.error(c);a.error(Error(c))});return b})}Br(a){this.G=a;return this}stop(){this.O.destroy()}clear(){Uc(this.F,this.K).catch(b=>this.H.error('Failed to unsubscribe from '+this.K+', error: '+b));if(this.G){let b;null==(b=this.C)||b.forEach(c=>{let d;return null==(d=this.G)?void 0:
|
|
460
461
|
d.call(this,c)})}let a;null==(a=this.C)||a.clear()}static publish(a,b){return olympe.N.Bg().request(a,Wd,b).then(()=>{})}static send(a,b,c={}){return olympe.N.Bg().request(a,Ud,b,c.timeout).then(d=>{switch(d.getType()){case Pd:break;case Rd:throw $d(d);default:throw Error('Unsupported response type for a SEND request');}})}static get(a,b,c={}){return olympe.N.Bg().request(a,Vd,b,c.timeout).then(d=>{switch(d.getType()){case Sd:d=d.C;if(null!==d)return d;throw Error('No payload after request to service: '+
|
|
461
|
-
a);case Rd:throw $d(d);default:throw Error('Unsupported response type for a GET request');}})}static observe(a,b,c,d={}){const e='function'===typeof b.F?b.F():b,f=olympe.N.Bg();return(new rxjs.Observable(g=>{let h=null,k=null;const l=()=>{g.complete();k&&Wc(f,a,k);h&&Uc(f,h).catch(n=>olympe.
|
|
462
|
-
l())}).then(()=>{k=p.id;Vc(f,a,k,p.refresh,q=>g.error(q));Dd(n).catch(q=>{g.error(`Was unable to ack the subscription: ${q}`);l()})}).catch(q=>{g.error(`Was not able to subscribe to notification topic ${h}: ${q}`);l()});break;case Rd:g.error($d(n));break;default:g.error('Unsupported response type for a SUBSCRIBE request')}}).catch(n=>g.error(n));return l})).pipe(olympe.N.operators.
|
|
463
|
-
let k;null==(k=d.onRetry)||k.call(d)}))}};olympe.N.tb.observe=olympe.N.tb.observe;olympe.N.tb.get=olympe.N.tb.get;olympe.N.tb.send=olympe.N.tb.send;olympe.N.tb.publish=olympe.N.tb.publish;olympe.N.tb.prototype.stop=olympe.N.tb.prototype.stop;olympe.N.tb.prototype.setUnsubscriptionHandler=olympe.N.tb.prototype.
|
|
464
|
-
olympe.N.Va.
|
|
465
|
-
18:'Try to unsubscribe multiple times',21:'GraphDef Query Failed',22:'Client Request Invalid',23:'Internal Server Error',24:'File Retrieval Error',25:'File Does Not Exists',26:'Restore Failed',27:'Permission Error',14:'Handshake Failed',28:'Client Version Too Old',29:'Client Version Invalid Format',34:'Server overloaded, retry later',35:'Add token error',36:'Keep token alive error',37:'Unknown client message',39:'Fetch data while concurrency transaction'};olympe.N.R={
|
|
466
|
-
olympe.N.U={
|
|
467
|
-
|
|
468
|
-
olympe.W.config(function(a){var b=['localhost','127.0.0.1'];F(a,olympe.N.U.
|
|
469
|
-
15E3);F(a,olympe.N.U.
|
|
470
|
-
E(a,olympe.N.R.Ca,[olympe.
|
|
471
|
-
l||void 0===l)return null;l=l.replace(/\/+/g,'/').replace(/\/$/,'');return new olympe.net.
|
|
472
|
-
olympe.N.R
|
|
473
|
-
D(a,olympe.N.R.
|
|
474
|
-
new olympe.W.
|
|
475
|
-
h],['connectionOptions',w],['allowGuest',q],['shortTimeout',r],['requestTimeout',t],['subscriptionsRefreshRate',u]])});D(a,olympe.N.R.
|
|
476
|
-
olympe.N.R.
|
|
477
|
-
function be(a,b,c){const d=null==b?void 0:b.
|
|
478
|
-
olympe.N.
|
|
479
|
-
function ee(a,b,c){if(b.
|
|
480
|
-
olympe.auth.
|
|
481
|
-
a=O(`${d}/${a}`);kd(this.Wg,a,b).then(e=>c(null,e)).catch(e=>c(Error(e)))}};olympe.auth.
|
|
482
|
-
function Cd(){var a=olympe.auth.
|
|
483
|
-
function je(a){a.H.info('Initializing AUTH layer');let b=a.ec;if(a.fa){const c=a.fa.C(),d=Ub(c.parameters);b=d||b;d&&a.fa.F(c.parameters.filter(e=>'authToken'!==e.ia()))}b&&a.storage&&ke(a.storage,b
|
|
484
|
-
olympe.D.Qa(a.C).
|
|
485
|
-
a.
|
|
486
|
-
function oe(a,b){let c=null;olympe.D.
|
|
487
|
-
function ie(a){null!==a.storage?(a.H.debug('Retrieving token from local storage'),a.storage.
|
|
488
|
-
function le(a,b,c=!1){a.C.update(a.ba);ge(a,olympe.auth.Sa.C.Rh);b=`Authenticated as guest (${b})`;c?a.H.error(b):a.H.info(b)}function ne(a){const b=[olympe.auth.Sa.C.
|
|
489
|
-
function he(a){if(a.Z){const b=new olympe.auth.Request;b.set('username',a.Z);b.set('password',a.
|
|
490
|
-
function ue(a,b,c,d=!1){b=b+c?':'+c.message:'';a.H.error(b);a.error.update(olympe.D.wb(b));ge(a,olympe.auth.Sa.C.Eb);if(d)throw Error(b);}function re(a,b,c,d){void 0===c&&(c=a.Tb);void 0===c&&ue(a,'No authentication provider specified',null,!0);const e=a.Jd.get(c);e||ue(a,'Undefined authentication provider "'+c+'"',null,!0);d&&a.O.set('login',d);a.H.log('Sending authentication request using "'+c+'" for '+b);e.
|
|
462
|
+
a);case Rd:throw $d(d);default:throw Error('Unsupported response type for a GET request');}})}static observe(a,b,c,d={}){const e='function'===typeof b.F?b.F():b,f=olympe.N.Bg();return(new rxjs.Observable(g=>{let h=null,k=null;const l=()=>{g.complete();k&&Wc(f,a,k);h&&Uc(f,h).catch(n=>olympe.ma.eb('Service '+a).error('Failed to unsubscribe from a topic '+n))};e.Z(l);f.request(a,Xd,c,d.timeout).then(n=>{switch(n.getType()){case Td:const p=n.C;h=p.topic;Ic(f,h,q=>{q.getType()===Wd?g.next(q.F):(g.error('Unsupported notification message. It should be a publish'),
|
|
463
|
+
l())}).then(()=>{k=p.id;Vc(f,a,k,p.refresh,q=>g.error(q));Dd(n).catch(q=>{g.error(`Was unable to ack the subscription: ${q}`);l()})}).catch(q=>{g.error(`Was not able to subscribe to notification topic ${h}: ${q}`);l()});break;case Rd:g.error($d(n));break;default:g.error('Unsupported response type for a SUBSCRIBE request')}}).catch(n=>g.error(n));return l})).pipe(olympe.N.operators.Oi(olympe.N.errors.sj,(g,h)=>{olympe.ma.eb(`Service ${a}`).debug(`Subscribed to topic ${g.V()} now that we are back online, after waiting for ${h}ms`);
|
|
464
|
+
let k;null==(k=d.onRetry)||k.call(d)}))}};olympe.N.tb.observe=olympe.N.tb.observe;olympe.N.tb.get=olympe.N.tb.get;olympe.N.tb.send=olympe.N.tb.send;olympe.N.tb.publish=olympe.N.tb.publish;olympe.N.tb.prototype.stop=olympe.N.tb.prototype.stop;olympe.N.tb.prototype.setUnsubscriptionHandler=olympe.N.tb.prototype.Br;olympe.N.tb.prototype.listen=olympe.N.tb.prototype.listen;olympe.N.qe={Xn:1,Df:2,Eb:3,ig:4,ly:5,lj:6};olympe.N.ob={lj:1,Mu:2,As:3,Ge:5};olympe.N.Va.C={INIT:'initialize',CONNECTING:'connecting',Vd:'disconnected',eo:'disconnecting',Og:'connected',og:'reconnecting',Zl:'waking',ln:'awake',Eb:'error'};olympe.N.Va.F={$g:1,Cs:-1,Rs:-2,Eu:-3};olympe.N.Va.G={ii:0,yz:23};
|
|
465
|
+
olympe.N.Va.Mb={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',
|
|
466
|
+
18:'Try to unsubscribe multiple times',21:'GraphDef Query Failed',22:'Client Request Invalid',23:'Internal Server Error',24:'File Retrieval Error',25:'File Does Not Exists',26:'Restore Failed',27:'Permission Error',14:'Handshake Failed',28:'Client Version Too Old',29:'Client Version Invalid Format',34:'Server overloaded, retry later',35:'Add token error',36:'Keep token alive error',37:'Unknown client message',39:'Fetch data while concurrency transaction'};olympe.N.R={Xe:'com.ConnectivityManager',Ij:'com.ServerManager',xn:'com.BusManager',el:'com.HttpManager',$d:'com.Serializer',Ca:'com.Logger',rq:'com.Source',Fq:'com.Urls',cA:'com.peerFileSvcUrl'};
|
|
467
|
+
olympe.N.U={Rk:'defaultHost',hh:'server.host',Jj:'server.port',Kj:'server.ssl',Ck:'server.basePath',Oq:'server.wsPath',Jl:'server.reconnectionDelay',Hp:'server.pingInterval',Nq:'server.messageTimeout',Zp:'server.retryHttpOnOverload',Kk:'server.clientVersion',nq:'server.serverVersion',pu:'server.wakeUpService',Fk:'bus.host',yn:'bus.path',zn:'bus.port',En:'bus.vhost',Cn:'bus.ssl',Ge:'bus.keepalive',gu:'bus.reschedulePings',Zr:'bus.clientId',Xr:'bus.clean',ds:'bus.connectTimeout',Bn:'bus.shortTimeout',
|
|
468
|
+
An:'bus.requestTimeout',Dn:'bus.subscriptionRefreshRate',cu:'bus.queueQoSZero',Ek:'bus.allowGuest'};
|
|
469
|
+
olympe.W.config(function(a){var b=['localhost','127.0.0.1'];F(a,olympe.N.U.Rk,'object'===typeof window&&window.location&&window.location.hostname||b[1]);var c=a.getParameter(olympe.N.U.Rk);F(a,olympe.N.U.hh,c);var d=a.getParameter(olympe.N.U.hh);const e=b.includes(d);d=e||d.endsWith(a.getParameter(olympe.net.U.oj));F(a,olympe.N.U.Jj,e?8080:d?80:443);F(a,olympe.N.U.Kj,!d);F(a,olympe.N.U.Ck,'OlympeServer');F(a,olympe.N.U.Oq,'websocket');F(a,olympe.N.U.Jl,5E3);F(a,olympe.N.U.Hp,5E3);F(a,olympe.N.U.Nq,
|
|
470
|
+
15E3);F(a,olympe.N.U.Zp,5E3);F(a,olympe.N.U.nq,'7.1.4');F(a,olympe.N.U.Fk,c);c=a.getParameter(olympe.N.U.Fk);c=(b=b.includes(c))||c.endsWith(a.getParameter(olympe.net.U.oj));F(a,olympe.N.U.yn,b?'':'/mqtt');F(a,olympe.N.U.zn,b?15675:c?80:443);F(a,olympe.N.U.Cn,!c);F(a,olympe.N.U.En,b?'/':'');F(a,olympe.N.U.Ge,30);F(a,olympe.N.U.Bn,5E3);F(a,olympe.N.U.An,3E4);F(a,olympe.N.U.Dn,6E4);F(a,olympe.N.U.Ek,!1);b=a.getParameter(olympe.Vf.U.wo);if(void 0!==b)za(a,olympe.N.U.Kk,b);else throw Error('Framework version could not be found! Is field "olympe-framework" present in version.json?');
|
|
471
|
+
E(a,olympe.N.R.Ca,[olympe.ma.R.Ha],g=>g.Mc('communication'));E(a,'server.WebSocketRequest',[new olympe.W.ka(olympe.N.U.hh),new olympe.W.ka(olympe.N.U.Jj),new olympe.W.ka(olympe.N.U.Kj),new olympe.W.ka(olympe.N.U.Ck),new olympe.W.ka(olympe.N.U.Oq)],(g,h,k,l,n)=>new olympe.net.ri(g,h,(l+'/'+n).replace(/\/+/g,'/').replace(/\/$/,''),k));E(a,'server.wakeUpRequest',[new olympe.W.ka(olympe.N.U.hh),new olympe.W.ka(olympe.N.U.Jj),new olympe.W.ka(olympe.N.U.Kj),new olympe.W.ka(olympe.N.U.pu)],(g,h,k,l)=>{if(null===
|
|
472
|
+
l||void 0===l)return null;l=l.replace(/\/+/g,'/').replace(/\/$/,'');return new olympe.net.ri(g,h,l,k)});const f=Array.from(Object.values(olympe.N.$b));E(a,olympe.N.R.Fq,[new olympe.W.ka(olympe.N.U.hh),new olympe.W.ka(olympe.N.U.Jj),new olympe.W.ka(olympe.N.U.Kj),new olympe.W.ka(olympe.N.U.Ck),...f.map(g=>new olympe.W.ka(g))],(g,h,k,l,...n)=>{const p=f.map((q,r)=>{r=n[r];r=(new olympe.net.Vh(g,h,`${l}${r?'/'+r:''}`.replace(/\/+/g,'/').replace(/\/$/,''),k)).C();return[q,r]});return new Map(p)});D(a,
|
|
473
|
+
olympe.N.R.$d,olympe.N.tg);D(a,olympe.N.R.el,olympe.N.Hs,olympe.N.R.Ca,olympe.net.R.Ha,olympe.Y.R.Jf,olympe.N.R.Fq);E(a,'com.server.ManagerConfig',[new olympe.W.ka(olympe.N.U.Hp),new olympe.W.ka(olympe.N.U.Nq),new olympe.W.ka(olympe.N.U.Kk),new olympe.W.ka(olympe.N.U.nq),new olympe.W.ka(olympe.dc.U.ih),new olympe.W.ka(olympe.N.U.Zp)],(...g)=>{const h='pingInterval messageTimeout clientVersion serverVersion getContextMode retryHttpOverload'.split(' '),k=new Map;g.forEach((l,n)=>k.set(h[n],l));return k});
|
|
474
|
+
D(a,olympe.N.R.Ij,olympe.N.Va,olympe.N.R.Ca,olympe.net.R.Ha,olympe.host.R.He,olympe.host.R.Oj,'server.WebSocketRequest','server.wakeUpRequest',olympe.Y.R.Jf,'com.server.ManagerConfig');E(a,'com.bus.ManagerConfig',[new olympe.W.ka(olympe.N.U.hh),new olympe.W.ka(olympe.N.U.Fk),new olympe.W.ka(olympe.N.U.yn),new olympe.W.ka(olympe.N.U.zn),new olympe.W.ka(olympe.N.U.En),new olympe.W.ka(olympe.N.U.Cn),new olympe.W.ka(olympe.N.U.Ek),new olympe.W.ka(olympe.N.U.Bn),new olympe.W.ka(olympe.N.U.An),new olympe.W.ka(olympe.N.U.Dn),
|
|
475
|
+
new olympe.W.ka(olympe.N.U.Ge),new olympe.W.ka(olympe.N.U.gu),new olympe.W.ka(olympe.N.U.Zr),new olympe.W.ka(olympe.N.U.Xr),new olympe.W.ka(olympe.N.U.Jl),new olympe.W.ka(olympe.N.U.ds),new olympe.W.ka(olympe.N.U.cu)],(g,h,k,l,n,p,q,r,t,u,...w)=>{h=`${p?'wss://':'ws://'}${h}:${l}${k}/ws`;const y='keepalive reschedulePings clientId clean reconnectPeriod connectTimeout queueQoSZero shortTimeout requestTimeout'.split(' ');w=w.reduce((z,A,C)=>{z[y[C]]=A;return z},{});w.vhost=`${n||g.split('.')[0]}`;return new Map([['url',
|
|
476
|
+
h],['connectionOptions',w],['allowGuest',q],['shortTimeout',r],['requestTimeout',t],['subscriptionsRefreshRate',u]])});D(a,olympe.N.R.xn,olympe.N.Gn,olympe.N.R.Ca,olympe.net.R.Ha,olympe.N.R.Xe,olympe.auth.R.Ha,olympe.host.R.He,olympe.N.R.$d,olympe.Y.R.Jf,'com.bus.ManagerConfig');E(a,'com.connectivity.ManagerConfig',[olympe.net.R.yl,olympe.Bb.R.sg,new olympe.W.ka(olympe.N.U.Jl)],(g,...h)=>['storagePrefix','reconnectionDelay'].reduce((k,l,n)=>k.set(l,h[n]),g));D(a,olympe.N.R.Xe,olympe.N.kc,olympe.N.R.Ca,
|
|
477
|
+
olympe.N.R.Ij,olympe.net.R.Ha,olympe.host.R.He,olympe.Bb.R.rl,'com.connectivity.ManagerConfig')},'olympe.communication');olympe.W.run([olympe.N.R.xn,olympe.N.R.Xe],(a,b)=>{olympe.N.Bg=()=>a;olympe.N.wm=()=>b});olympe.N.operators={};olympe.N.operators.Oi=(a,b,c=5E3)=>rxjs.operators.retry({resetOnSuccess:!0,delay:(d,e)=>{if(d instanceof a){const f=Math.round(Math.random()*(e+1)*c);return rxjs.timer(f).pipe(rxjs.operators.tap(()=>null==b?void 0:b(d,f)))}return rxjs.throwError(()=>d)}});olympe.auth={};function ae(a,b){xd(a.C);md(a.C,olympe.N.qe.ig,c=>{const d=c.c;d===olympe.auth.cd.C.yt?(a.C.Fd(),b(olympe.auth.Sa.F.Ti,c)):d===olympe.auth.cd.C.mu&&b(olympe.auth.Sa.F.Po,c)},'logoutHandler')}
|
|
478
|
+
function be(a,b,c){const d=null==b?void 0:b.df();if(b instanceof olympe.auth.xj){const e=g=>{const h=Object.create(null);h.url=g;h.olympe_token=b.rd();h.access_token=ce(b);g=`${id(a.Wg,olympe.N.$b.uj)}/logout${d?`?idpName=${d}`:''}`;a.F.redirect(g,h)};c=a.F.C();const f=new URL(c);0!==f.hash.length||0!==f.search.length?(f.hash='',f.search='',a.G.db.set('main',c,'redirectTo').then(()=>{e(f.toString())}).catch(g=>{a.H.error(`Error when trying to set the redirectKey in Auth store: ${g}`)})):e(c)}else td(a.C,
|
|
479
|
+
olympe.N.qe.ig,Object.assign({},{c:olympe.auth.cd.C.zt},d&&{idpName:d}),c)}function de(a,b,c,d){olympe.D.Qa(a.K.getState())===olympe.N.kc.C.Zd?d(new olympe.N.errors.Dp('Working offline'),'Working offline'):(c.c=b,td(a.C,olympe.N.qe.ig,c,d))}
|
|
480
|
+
function ee(a,b,c){if(b.hg()!==olympe.auth.wc.C.OAUTH2)c(Error('Only oAuth2 tokens can be refreshed'),null);else{var d=`?idpName=${b.df()}&access_token=${ce(b)}`;d=`${id(a.Wg,olympe.N.$b.uj)}/refresh${d}`;kd(a.Wg,O(d),b.rd()).then(e=>{'string'===typeof e?(e=JSON.parse(e),e=new olympe.auth.xj(b.uc(),b.je(),b.rd(),e,b.df()),c(null,e)):c(null,b)}).catch(e=>c(Error(e),null))}}
|
|
481
|
+
olympe.auth.cd=class{constructor(a,b,c,d,e,f){this.H=a;this.C=b;this.Wg=c;this.K=d;this.F=e;this.G=f;fe(this.G).then(g=>{g&&this.G.db.remove('main','redirectTo').then(()=>{this.F.redirect(g,null,olympe.auth.Hj.C.GET)}).catch(h=>{this.H.error(`Error when trying to remove redirect key from AUTH storage: ${h}`)})}).catch(g=>{this.H.error(`Error when trying to get redirect key from AUTH storage: ${g}`)})}Ve(a){td(this.C,olympe.N.qe.ig,{c:olympe.auth.cd.C.Ge},b=>a(b))}Gg(a,b,c){const d=id(this.Wg,olympe.N.$b.Hq);
|
|
482
|
+
a=O(`${d}/${a}`);kd(this.Wg,a,b).then(e=>c(null,e)).catch(e=>c(Error(e)))}};olympe.auth.cd.C={ig:1,zt:2,Eb:3,Ge:5,ii:6,Js:10,wu:11,Ir:12,SAML:13,mu:14,yt:20};function Zc(a,b){var c='busLogoutCallback';void 0===c&&(c=olympe.Y.th());a.oa.set(c,b)}function Qc(a){return olympe.D.Qa(a.C.ub())}
|
|
483
|
+
function Cd(){var a=olympe.auth.ge();const b=olympe.auth.Sa.C.Ui,c=olympe.auth.Sa.C.INIT;ge(a,b);a.bb?(a.G=olympe.auth.Sa.G.Hr,a.H.log('Connector online, parameter auth.autoLogin=true --\x3e attempting to log with parameters'),he(a)):(a.G=olympe.auth.Sa.G.ki,a.H.log('Connector online, attempting to log with token'),ie(a));return rxjs.firstValueFrom(a.F.ub().asObservable().pipe(rxjs.operators.filter(d=>!(d===b||d===c)))).catch(()=>{})}
|
|
484
|
+
function je(a){a.H.info('Initializing AUTH layer');let b=a.ec;if(a.fa){const c=a.fa.C(),d=Ub(c.parameters);b=d||b;d&&a.fa.F(c.parameters.filter(e=>'authToken'!==e.ia()))}b&&a.storage&&ke(a.storage,b).catch(c=>a.H.error(c));a.H.debug('Asking to be notified when auth connector gets online');olympe.D.Nc([a.nb.getState()],c=>{switch(c){case olympe.N.kc.C.Zd:a.G=olympe.auth.Sa.G.ki;a.H.log('Connector offline, attempting to recover sessions from current token');ie(a);break;case olympe.N.kc.C.Vd:switch(olympe.D.Qa(a.F)){case olympe.auth.Sa.C.Af:c=
|
|
485
|
+
olympe.D.Qa(a.C).uc();le(a,`Disconnected from server - session of user ${c} lost`);break;case olympe.auth.Sa.C.Rh:a.H.info('Disconnected from server - guest session lost');break;case olympe.auth.Sa.C.Ui:le(a,'Disconnected from server - authentication aborted');break;case olympe.auth.Sa.C.INIT:le(a,'Cannot open auth session - no server connection');break;default:le(a,'Should not get there, investigate',!0)}}});ae(a.K,(c,d)=>{if(c===olympe.auth.Sa.F.Ti)le(a,'authentication revoked'),a.storage&&me(a.storage),
|
|
486
|
+
a.oa.forEach(e=>{e(c,d)});else if(c===olympe.auth.Sa.F.Po)a.H.info('Redirection to IDP to invalidate token (SAML)'),Qc(a),a.storage&&me(a.storage),a.Ab.F();else throw Error(`Unknown logout step coming from server : ${c}`);});a.Ta=ne(a);a.T.F(()=>a.Ch().catch(c=>a.H.error(`Failed to logout ${c}`)),'Logout');a.H.log('DONE initializing AUTH layer (waiting for connector to be online)')}
|
|
487
|
+
function oe(a,b){let c=null;olympe.D.Hi(a.F.ub().ud(olympe.auth.Sa.C.Af).and(b),()=>{const d=Qc(a);!pe(a)&&d&&(c=a.Jd.get(d.hg()).K(d,(e,f)=>{e?(a.H.error('Failed to refresh token, error message: ',e.message),a.Ch().catch(g=>a.H.error(`Failed to logout after wrong refresh ${g}`))):f&&qe(a,f)}))},()=>{let d;null==(d=c)||d()})}
|
|
488
|
+
function ie(a){null!==a.storage?(a.H.debug('Retrieving token from local storage'),a.storage.ie().then(b=>{if(b){const e=new olympe.auth.Request;var c=b.uc();e.set('username',c);c=e;var d=b.rd();c.set('nonce',d);'string'===typeof b.df()&&e.set('idpName',b.df());a.H.debug('Token found, trying login with',e);re(a,e,olympe.auth.wc.C.zl)}else le(a,'No token found, cannot perform auto login')}).catch(b=>{le(a,b.message,!0)})):le(a,'Cannot retrieve token: no storage configured, cannot perform auto login',
|
|
489
|
+
!0)}function le(a,b,c=!1){a.C.update(a.ba);ge(a,olympe.auth.Sa.C.Rh);b=`Authenticated as guest (${b})`;c?a.H.error(b):a.H.info(b)}function ne(a){const b=[olympe.auth.Sa.C.Af];a.bb||b.push(olympe.auth.Sa.C.Rh);return a.T.C(()=>{const c=se(a);return b.includes(c)?Promise.resolve('The auth manager is OK'):Promise.reject(`The auth manager is not in valid state, the current state is: ${c}`)})}function ge(a,b){a.H.log('State change: ',se(a),'--\x3e',b);a.F.update(b)}
|
|
490
|
+
function he(a){if(a.Z){const b=new olympe.auth.Request;b.set('username',a.Z);b.set('password',a.Nb);a.H.log('Autologin with user "'+a.Z+'"');re(a,b)}else le(a,'No user specified for auto login',!0)}function pe(a){return olympe.D.Qa(a.C)===a.ba}function qe(a,b){if(b){a.C.update(b);let c;null==(c=a.storage)||ke(c,b).catch(d=>a.H.error(d));a.H.debug('Token updated')}}function se(a){return olympe.D.Qa(a.F.ub())}function te(){var a=olympe.public.Ia.get();return new Map(a.K.C.Oc)}
|
|
491
|
+
function ue(a,b,c,d=!1){b=b+c?':'+c.message:'';a.H.error(b);a.error.update(olympe.D.wb(b));ge(a,olympe.auth.Sa.C.Eb);if(d)throw Error(b);}function re(a,b,c,d){void 0===c&&(c=a.Tb);void 0===c&&ue(a,'No authentication provider specified',null,!0);const e=a.Jd.get(c);e||ue(a,'Undefined authentication provider "'+c+'"',null,!0);d&&a.O.set('login',d);a.H.log('Sending authentication request using "'+c+'" for '+b);e.ie(b,a.ac.bind(a));ge(a,olympe.auth.Sa.C.Ui)}
|
|
491
492
|
function ve(a,b,c){a.O.forEach(d=>{d(b,c)})}
|
|
492
|
-
olympe.auth.Sa=class{constructor(a,b,c,d,e,f,g,h,k,l){this.H=a;this.
|
|
493
|
-
olympe.D.ic(olympe.auth.yg).update(this.ba);this.O=new Map;this.
|
|
494
|
-
d.update(olympe.D.ea.C)):d.clear()});return d.ub()}
|
|
495
|
-
else{var c,d=null==(c=olympe.D.Qa(this.C.ub()))?void 0:c.rd();this.K.Gg(a,d,(e,f)=>{'string'===typeof f&&this.za.set(a,f);b(e,f)})}}Ch(){return pe(this)?(this.H.warn('Logout called for Guest user so it will be ignored'),Promise.resolve()):new Promise((a,b)=>{this.H.debug('Sending logout');me(this.storage);be(this.K,Qc(this),c=>{c?(ue(this,'Logout request rejected:',c),b(c)):(this.H.debug('Logout request acknowledged'),a())});this.T.G(this.Ta)})}
|
|
496
|
-
this.H.error('Was not able to send the auth keep alive message:',b.message);null==a||a(b)})}ac(a,b){const c=null===this.G?olympe.auth.Sa.G.
|
|
497
|
-
le(this,'authentication rejected: '+a.message);ve(this,a,c)}this.O.has('login')&&this.O.delete('login')}};olympe.auth.Sa.C={INIT:'init',
|
|
498
|
-
m.
|
|
499
|
-
olympe.auth.
|
|
500
|
-
g.payload.id_token?h=new olympe.auth.
|
|
501
|
-
olympe.auth.Jd.
|
|
502
|
-
olympe.auth.Jd.
|
|
503
|
-
function Ce(a,b,c){const d=olympe.auth.
|
|
504
|
-
null)}})}olympe.auth.Jd.SRP=class extends olympe.auth.
|
|
505
|
-
olympe.W.config(function(a){F(a,olympe.auth.U.
|
|
506
|
-
olympe.auth.R.
|
|
507
|
-
k,l,n,p,q,r,t)=>{const u=[new olympe.auth.Jd.
|
|
508
|
-
olympe.W.run([olympe.auth.R.Ha],a=>{olympe.auth.
|
|
509
|
-
olympe.Ra.node.
|
|
493
|
+
olympe.auth.Sa=class{constructor(a,b,c,d,e,f,g,h,k,l){this.H=a;this.nb=b;this.K=c;this.storage=d;this.Ab=e;this.fa=f;this.Tb=l.get('defaultProvider');this.bb=!!l.get('autoLogin');this.Z=l.get('autoUser');this.Nb=l.get('autoPassword');this.ec=l.get('autoToken');this.Jd=new Map;this.T=g;this.Ta='';this.F=olympe.D.ic(String).update(olympe.auth.Sa.C.INIT);this.error=olympe.D.ic(olympe.D.Na);this.G=null;this.ba=new olympe.auth.yg('guest','0163d9653067b6237f62','e96e099c-55bb-4004-b0e8-bd76b6209218');this.C=
|
|
494
|
+
olympe.D.ic(olympe.auth.yg).update(this.ba);this.O=new Map;this.oa=new Map;this.za=new olympe.Y.Vl(l.get('cacheTokenTimeout'));k.forEach(n=>{const p=n.G();if(this.Jd.has(p))throw Error('Provider "'+p+'" has already been registered !');this.Jd.set(p,n)});je(this);oe(this,h.C())}lk(){const a=olympe.auth.Sa.C.Af,b=olympe.auth.Sa.C.Rh,c=olympe.auth.Sa.C.Eb,d=olympe.D.ic(olympe.D.ea);olympe.D.Nc([this.F],e=>{e===a?d.update(olympe.D.ea.F):e===b?d.update(olympe.D.ea.C):e===c?(this.H.error('Authentication failed.'),
|
|
495
|
+
d.update(olympe.D.ea.C)):d.clear()});return d.ub()}Wf(a){if(olympe.D.Qa(this.F)===olympe.auth.Sa.C.Af){var b=Qc(this);!pe(this)&&b&&this.Jd.get(b.hg()).Wf(b,(c,d)=>{c?(this.H.error('Failed to refresh token, error message: ',c.message),this.Ch().catch(e=>this.H.error(`Failed to logout after wrong refresh ${e}`))):d&&qe(this,d);a(c)})}}getState(){return this.F.ub()}uc(){return this.C.ub().uc()}je(){return this.C.ub().je()}vh(){return this.C.ub().vh()}Gg(a,b){if(Ka(this.za.C,a))b(null,this.za.get(a));
|
|
496
|
+
else{var c,d=null==(c=olympe.D.Qa(this.C.ub()))?void 0:c.rd();this.K.Gg(a,d,(e,f)=>{'string'===typeof f&&this.za.set(a,f);b(e,f)})}}Ch(){return pe(this)?(this.H.warn('Logout called for Guest user so it will be ignored'),Promise.resolve()):new Promise((a,b)=>{this.H.debug('Sending logout');me(this.storage);be(this.K,Qc(this),c=>{c?(ue(this,'Logout request rejected:',c),b(c)):(this.H.debug('Logout request acknowledged'),a())});this.T.G(this.Ta)})}Ve(a){se(this)===olympe.auth.Sa.C.Af&&this.K.Ve(b=>{b&&
|
|
497
|
+
this.H.error('Was not able to send the auth keep alive message:',b.message);null==a||a(b)})}ac(a,b){const c=null===this.G?olympe.auth.Sa.G.Ft:this.G;this.G=null;if(!a||a instanceof olympe.N.errors.Dp){null===a?this.H.info(`User ${b.uc()} (#${b.je()}) successfully authenticated`):this.H.info(`User ${b.uc()} (#${b.je()}) recovered from token, while offline`);this.C.update(b);ge(this,olympe.auth.Sa.C.Af);ve(this,a,c);let d;null==(d=this.storage)||ke(d,b).catch(e=>this.H.error(e))}else{let d;null==(d=
|
|
498
|
+
this.storage)||me(d).catch(e=>this.H.error(e));this.error.update(olympe.D.wb(a.message));le(this,'authentication rejected: '+a.message);ve(this,a,c)}this.O.has('login')&&this.O.delete('login')}};olympe.auth.Sa.C={INIT:'init',Ui:'authenticating',Rh:'guest',Af:'authenticated',Eb:'error'};olympe.auth.Sa.G={Ft:'manual',Hr:'auto',ki:'tokenOnFirstConnection'};olympe.auth.Sa.F={Ti:'accepted',Po:'redirect'};olympe.auth.wc=class{constructor(a,b){this.H=a;this.F=b;this.C=null}G(){}ie(){}K(a,b){const c=()=>{this.C=setTimeout(()=>this.F.Ve(d=>{d?b(d,null):(b(null,null),c())}),this.F.C.ec)};c();return()=>{this.C&&clearTimeout(this.C);this.C=null}}Wf(a,b){this.F.Ve(c=>{b(c,null)})}};olympe.auth.wc.C={SAML:'saml',OAUTH2:'openID',SRP:'srp',zl:'olympeToken'};function we(a){return a.get('idpName')}olympe.auth.Request=class{constructor(){this.C=new Map}set(a,b){olympe.D.Nc([b],c=>{this.C.set(a.toLocaleLowerCase(),c.toString())})}get(a){(a=this.C.get(a.toLowerCase()))&&a.zg&&(a=a.Da.Db);return a?a.valueOf():a}uc(){return this.get('username')}rd(){return this.get('nonce')}toString(){return this.uc()+(this.rd()?' with nonce':'')+(this.get('password')?' with password':'')+(we(this)?` with idp name ${we(this)}`:'')}};olympe.auth.yg=class{constructor(a,b,c,d={},e=null){this.K=a;this.Fh=b;this.F=c;this.C=e;this.G=d}uc(){return this.K}je(){return this.Fh}rd(){return this.F}Yh(){return this.G}vh(){return null}df(){return this.C}ha(){const a=olympe.Y.Qe(),b=Object.assign({},{user:this.K,userTag:this.Fh,nonce:this.F},this.C&&{idpName:this.C},{payload:this.G});return olympe.Y.Vq(Ga(a,JSON.stringify(b)))}hg(){return olympe.auth.wc.C.SRP}};m=olympe.auth.yg.prototype;m.uc.L=new olympe.D.J(()=>String,[]);
|
|
499
|
+
m.je.L=new olympe.D.J(()=>String,[]);m.rd.L=new olympe.D.J(()=>String,[]);m.Yh.L=new olympe.D.J(()=>Object,[]);m.vh.L=new olympe.D.J(()=>String,[]);m.df.L=new olympe.D.J(()=>String,[]);m.ha.L=new olympe.D.J(()=>String,[]);m.hg.L=new olympe.D.J(()=>String,[]);function ce(a){return a.Yh().access_token||null}function xe(a){return 1E3*parseInt(a.Yh().access_token_exp||'0',10)}olympe.auth.xj=class extends olympe.auth.yg{constructor(a,b,c,d,e){super(a,b,c,d,e);this.O=Date.now()}vh(){return ce(this)}hg(){return olympe.auth.wc.C.OAUTH2}};olympe.auth.iq=class extends olympe.auth.yg{constructor(a,b,c,d,e,f){super(a,b,c,e,f);this.O=d}vh(){return this.O}hg(){return olympe.auth.wc.C.SAML}ha(){const a=olympe.Y.Qe(),b=Object.assign({},{user:this.uc(),userTag:this.je(),nonce:this.rd()},this.df()&&{idpName:this.df()},{payload:this.Yh(),fullToken:this.O});return olympe.Y.Vq(Ga(a,JSON.stringify(b)))}};function fe(a){let b;return null!=(b=a.db.get('main','redirectTo'))?b:null}function ke(a,b){return Fa(a.F,()=>a.db.set('main','string'===typeof b?b:b.ha(),a.C).catch(c=>{throw Error(`Error when trying to set the token from the auth store: ${c}`);}))}function me(a){return Fa(a.F,()=>a.db.remove('main',a.C).catch(b=>{a.H.error(`Error when trying to remove the token from the auth store: ${b}`)}))}
|
|
500
|
+
olympe.auth.Pr=class{constructor(a,b,c){this.G=a;this.H=b;this.C='OlympeToken-'+c.C;this.F=new olympe.Y.promise.yq;this.db=this.G.F('AUTH')}ie(){this.H.debug(`olympe.auth.AuthStorage: retrieve token with key ${this.C}`);return Fa(this.F,()=>{const a=this;return v(function*(){let b;try{b=yield a.db.get('main',a.C)}catch(g){throw Error(`Error when trying to get the token from the auth store: ${g}`);}let c=null;if(b)try{a.H.debug('olympe.auth.AuthStorage: Token retrieved successfully');var d=JSON,e=
|
|
501
|
+
d.parse;var f=Ha(olympe.Y.Qe().G(olympe.Y.kv(b)));const g=e.call(d,f);let h;g.fullToken?h=new olympe.auth.iq(g.user,g.userTag,g.nonce,g.fullToken,g.payload,g.idpName):g.payload&&g.payload.id_token?h=new olympe.auth.xj(g.user,g.userTag,g.nonce,g.payload,g.idpName):h=new olympe.auth.yg(g.user,g.userTag,g.nonce,g.payload,g.idpName);c=h}catch(g){throw Error(`Error while unserializing token: ${g}`);}else a.H.debug('olympe.auth.AuthStorage: No token found');return c})})}};olympe.auth.Hj=class{redirect(){}F(){}C(){}};olympe.auth.Hj.C={GET:'GET',bh:'POST'};olympe.auth.pn=class{constructor(a){this.C=a||'default'}};olympe.auth.Jd={};function ye(a,b,c){de(a.F,olympe.auth.cd.C.ig,{token:b.rd()},(d,e)=>{if(null!==d)c(d,null);else switch(e.c){case olympe.auth.cd.C.Eb:c(Error('Invalid token'),null);break;case olympe.auth.cd.C.ii:d=null;if(e=e.payload){const f=e.userName,g=e.userTag,h=e.rndCook,k=e.payload,l=e.protocol;'SAML'===l?d=new olympe.auth.iq(f,g,h,e.samlToken,k,we(b)):'openid'===l&&(d=new olympe.auth.xj(f,g,h,k,we(b)))}c(null,d);break;default:c(Error('Unknown response from server'),null)}})}
|
|
502
|
+
olympe.auth.Jd.Et=class extends olympe.auth.wc{constructor(a,b,c){super(a,b);this.storage=c}G(){return olympe.auth.wc.C.zl}ie(a,b){this.storage.ie().then(c=>{ye(this,a,(d,e)=>{b(d,null!=e?e:c)})}).catch(c=>{b(c,null)})}};function ze(a,b,c){var d=xe(b);const e=Math.max(d-b.O,0),f=olympe.W.getParameter(olympe.auth.U.Bq);d=Math.max(Math.round(d-e*(1-Math.max(Math.min((f||50)/100,.95),0))-Date.now()),0);if(0<d)return setTimeout(()=>{a.Wf(b,c)},d);a.Wf(b,c);return null}
|
|
503
|
+
olympe.auth.Jd.St=class extends olympe.auth.wc{constructor(a,b,c,d){super(a,b);this.O=c;this.T=d}G(){return olympe.auth.wc.C.OAUTH2}ie(a){const b=encodeURIComponent(this.O.C());a=we(a)?`idpName=${we(a)}&`:'';this.O.redirect(`${this.T}/auth?${a}url=${b}`,null,olympe.auth.Hj.C.GET)}K(a,b){0<xe(a)?this.C=ze(this,a,b):b(null,a);return this.Z.bind(this)}Wf(a,b){ee(this.F,a,(c,d)=>{c?b(c,null):d&&(b(null,d),this.C&&(this.C=ze(this,d,b)))})}Z(){this.C&&clearTimeout(this.C);this.C=null}};function Ae(a,b){de(a.F,olympe.auth.cd.C.SAML,{},(c,d)=>{null!==c?b(c):d.url&&d.request?b(null,d.url,d.request.replace(/\s/g,''),d.id):b(Error('Missing parameters from server response'))})}olympe.auth.Jd.SAML=class extends olympe.auth.wc{constructor(a,b,c){super(a,b);this.O=c}G(){return olympe.auth.wc.C.SAML}ie(a,b){Ae(this,c=>{c?b(c,null):this.O.F(we(a))})}};function Be(a,b,c){const d=olympe.auth.cd.C.Js,e=olympe.auth.cd.C.Eb,f=olympe.auth.cd.C.wu,g={I:b.uc()};de(a.F,d,g,(h,k)=>{if(null!==h)c(h);else switch(k.c){case e:c(Error(`Username '${b.uc()}' invalid, or password does not match`));break;case f:h=k.payload;c(null,h.S,h.B);break;default:c(Error('Unknown response from server'))}})}
|
|
504
|
+
function Ce(a,b,c){const d=olympe.auth.cd.C.Ir,e=olympe.auth.cd.C.Eb,f=olympe.auth.cd.C.ii;b={A:b.get('a'),M:b.get('m1'),I:b.uc()};de(a.F,d,b,(g,h)=>{if(null!==g)c(g,null);else switch(h.c){case e:a.H.debug('Login failed, invalid username or password');c(Error('Invalid username or password'),null);break;case f:g=h.payload;a.H.debug('Login successful, creating token');h=g.payload?JSON.parse(g.payload):void 0;c(null,new olympe.auth.yg(g.userName,g.userTag,g.rndCook,h));break;default:c(Error(`Unknown response from server (type ${h.c})`),
|
|
505
|
+
null)}})}olympe.auth.Jd.SRP=class extends olympe.auth.wc{G(){return olympe.auth.wc.C.SRP}ie(a,b){const c=a.get('password');a.C.delete('password');this.H.debug('Sending SRP request');Be(this,a,(d,e,f)=>{this.H.debug('Received Salt+B message');if(d)b(d,null);else{try{const g=new SRPClient;g.step1(a.uc(),c);const h=g.step2(e,f);a.set('a',h.A);a.set('m1',h.M1)}catch(g){b(g,null);return}this.H.debug('Sending SRP A+M (proof) message');Ce(this,a,b)}})}};olympe.auth.R={Ha:'auth.Manager',Ca:'auth.Logger',hi:'auth.Storage',xk:'auth.appNameToken',Ej:'auth.Redirector',lq:'auth.ServerConnector'};olympe.auth.U={Sk:'auth.defaultProvider',hn:'auth.autoLogin',kn:'auth.autoUser',jn:'auth.autoPassword',ki:'auth.token',In:'auth.cacheTokenTimeout',Bq:'auth.tokenDurationPercentage'};
|
|
506
|
+
olympe.W.config(function(a){F(a,olympe.auth.U.Sk,olympe.auth.wc.C.SRP);F(a,olympe.auth.U.hn,!1);F(a,olympe.auth.U.kn,'');F(a,olympe.auth.U.jn,'');F(a,olympe.auth.U.ki,'');F(a,olympe.auth.U.Bq,50);F(a,olympe.auth.U.In,3E5);E(a,olympe.auth.R.Ca,[olympe.ma.R.Ha],b=>b.Mc('auth'));D(a,olympe.auth.R.xk,olympe.auth.pn,olympe.Bb.R.sg);D(a,olympe.auth.R.hi,olympe.auth.Pr,olympe.Bb.R.nj,olympe.auth.R.Ca,olympe.auth.R.xk);D(a,olympe.auth.R.lq,olympe.auth.cd,olympe.auth.R.Ca,olympe.N.R.Ij,olympe.N.R.el,olympe.N.R.Xe,
|
|
507
|
+
olympe.auth.R.Ej,olympe.auth.R.hi);ya(a,olympe.auth.R.Ej);E(a,olympe.auth.R.Ha,[olympe.auth.R.Ca,olympe.N.R.Xe,olympe.auth.R.lq,olympe.host.R.bl,olympe.host.R.He,olympe.host.R.Oj,new olympe.W.tb(olympe.auth.R.hi,olympe.W.Rg.C.wl),new olympe.W.tb(olympe.auth.R.Ej,olympe.W.Rg.C.wl),new olympe.W.ka(olympe.auth.U.Sk),new olympe.W.ka(olympe.auth.U.hn),new olympe.W.ka(olympe.auth.U.kn),new olympe.W.ka(olympe.auth.U.jn),new olympe.W.ka(olympe.auth.U.ki),new olympe.W.ka(olympe.auth.U.In)],(b,c,d,e,f,g,h,
|
|
508
|
+
k,l,n,p,q,r,t)=>{const u=[new olympe.auth.Jd.Et(b,d,h),new olympe.auth.Jd.SRP(b,d),new olympe.auth.Jd.SAML(b,d,k),new olympe.auth.Jd.St(b,d,k,id(d.Wg,olympe.N.$b.uj))];if(!u.map(w=>w.G()).includes(l))throw Error(`Default provider name ${l} given by parameter ${olympe.auth.U.Sk} cannot be found`);return new olympe.auth.Sa(b,c,d,h,k,e.Ii()?e:null,f,g,u,new Map([['defaultProvider',l],['autoLogin',n],['autoUser',p],['autoPassword',q],['autoToken',r],['cacheTokenTimeout',t]]))},!0)},'olympe.auth');
|
|
509
|
+
olympe.W.run([olympe.auth.R.Ha],a=>{olympe.auth.ge=()=>a});olympe.Ra.node.auth={};olympe.Ra.node.auth.vp=class{redirect(){console.warn('Redirection n/a in Node.JS')}F(){console.warn('Redirection n/a in Node.JS')}C(){console.warn('Redirection n/a in Node.JS');return''}};olympe.Ra.node.auth.vp.xa=[olympe.auth.Hj];olympe.W.config(a=>{D(a,olympe.auth.R.Ej,olympe.Ra.node.auth.vp)},'olympe.native.node.auth');olympe.Ra.node.Bb={};function De(){throw Error('Key-Value Database does not implement this in NodeJS');}
|
|
510
|
+
olympe.Ra.node.Bb.tp=class{constructor(a){this.H=a;this.C=new Map}Z(){return 0}O(a){const b=this;return v(function*(){let c,d;return null!=(d=null==(c=b.C.get(a))?void 0:c.size)?d:0})}G(a){const b=this;return v(function*(){const c=b.C.get(a);return c?Array.from(c.values()):[]})}T(a){const b=this;return v(function*(){const c=b.C.get(a);return c?Array.from(c.keys()):[]})}forEach(a,b){const c=this;return v(function*(){let d;for(const [e,f]of null!=(d=c.C.get(a))?d:new Map)b(f,e)})}has(a,b){const c=this;
|
|
510
511
|
return v(function*(){let d,e;return null!=(e=null==(d=c.C.get(a))?void 0:d.has(b))?e:!1})}get(a,b){const c=this;return v(function*(){let d;return null==(d=c.C.get(a))?void 0:d.get(b)})}set(a,b,c){const d=this;return v(function*(){let e;return null==(e=d.C.get(a))?void 0:e.set(c,b)})}remove(a,b){const c=this;return v(function*(){let d;yield null==(d=c.C.get(a))?void 0:d.delete(b)})}fa(){De();return Promise.resolve()}ba(){De();return Promise.resolve()}clear(a){const b=this;return v(function*(){let c;
|
|
511
|
-
null==(c=b.C.get(a))||c.clear()})}K(){De();return Promise.resolve([])}F(){return v(function*(){De()})}};olympe.Ra.node.
|
|
512
|
+
null==(c=b.C.get(a))||c.clear()})}K(){De();return Promise.resolve([])}F(){return v(function*(){De()})}};olympe.Ra.node.Bb.tp.xa=[olympe.Bb.tt];olympe.Ra.node.Bb.up=class{constructor(a){this.C=new Map;this.H=a}F(a){this.C.has(a)||this.C.set(a,new olympe.Ra.node.Bb.tp(this.H));return this.C.get(a)}};olympe.Ra.node.Bb.up.xa=[olympe.Bb.ut];olympe.W.config(function(a){D(a,olympe.Bb.R.nj,olympe.Ra.node.Bb.up,olympe.Bb.R.Ca)},'olympe.native.node.localstorage');olympe.Ra.node.storage={};olympe.Ra.node.storage.Storage=class{constructor(a){this.H=a}write(a,b,c,d,e){e&&e('Not Implemented.')}open(a){a(null)}close(a){a(null)}};olympe.Ra.node.storage.Storage.xa=[olympe.Bb.Storage];olympe.W.config(function(a){wa(a,olympe.Bb.R.hi,olympe.Ra.node.storage.Storage,olympe.host.R.Ca)},'olympe.native.html.storage');olympe.Vf={};olympe.Vf.U={VERSION:'version.version',Tr:'version.branch',We:'version.commit',Du:'version.tag',wo:'version.olympe-framework',Ur:'version.build'};olympe.W.config(function(a){F(a,olympe.Vf.U.VERSION,'');F(a,olympe.Vf.U.Tr,'');F(a,olympe.Vf.U.We,'');F(a,olympe.Vf.U.Du,'');F(a,olympe.Vf.U.wo,'');F(a,olympe.Vf.U.Ur,'')},'olympe.main');const Ee=require('fs');let Ba,Aa;function Fe(a,b){Ee.readFile(a,(c,d)=>{c?b(Object.create(null)):(d=JSON.parse(d),b(d))})}
|
|
512
513
|
function Ge(){if(void 0!==Ba&&void 0!==Aa){0===Object.keys(Aa).length&&console.warn('No configuration found. Check presence of oConfig.json');0===Object.keys(Ba).length&&console.warn('No version found. Check presence of version.json');var a=Object.create(null);const b=process.argv;for(let c=2;c<b.length;c++){const d=/^true|false$/i,e=/^\d+(\.\d+)?$/;let f;const g=/([^?&=]+)(=?([^?&=]+))?/g.exec(b[c]);!Array.isArray(g)||4>g.length?console.warn(`Malformed config parameter "${b[c]}" ignored. It should of the form 'a=b'`):
|
|
513
|
-
(f=g[3],void 0===f?f=!0:f.startsWith('"')&&f.endsWith('"')?f=f.substring(1,f.length-1):d.test(f)?f='true'===f.toLowerCase():e.test(f)&&(f=parseFloat(f)),a[g[1]]=f)}a=new olympe.W.
|
|
514
|
-
olympe.Y.
|
|
515
|
-
e,f);else{var n=p=>{p=p instanceof Uint8Array?new Blob([p],{type:l}):p;this.G&&this.K(h,p);e(p)};g.valueOf()?(g=this.db.model(b),k=new olympe.dc.Request(olympe.dc.Request.C.
|
|
516
|
-
h=new olympe.dc.Request(olympe.dc.Request.C.Mf,olympe.dc.
|
|
517
|
-
b);const e=a.C(d);Ke(this.db,d,f=>{f||(this.C.delete(d),Je(this.db,d,e))},e)}static C(b){return`cacheBinary${b}`}};function Le(a,b){let c=Me(b),d=null;for(;!c&&b&&b!==d;){d=b;b=a.db.
|
|
518
|
-
olympe.dc.Request.C={
|
|
519
|
-
p.X(),!a.sources.has(h)){const q=new olympe.dc.sources.
|
|
520
|
-
olympe.dc.
|
|
514
|
+
(f=g[3],void 0===f?f=!0:f.startsWith('"')&&f.endsWith('"')?f=f.substring(1,f.length-1):d.test(f)?f='true'===f.toLowerCase():e.test(f)&&(f=parseFloat(f)),a[g[1]]=f)}a=new olympe.W.ls(a);oa(a);qa(a.compile())}}function He(){console.log('The node process received a signal for graceful shutdown');let a,b;null==(b=(a=olympe.Ra.node.host).gk)||nc(b.call(a)).then(()=>console.log('The node backend has stopped successfully')).catch(c=>console.warn(c)).finally(()=>process.exit(0))}
|
|
515
|
+
olympe.Y.xe('oConfig.json',Fe,function(a){Aa=a;Ge()});Fe('version.json',function(a){Ba=a;Ge()});process.on('SIGTERM',He);process.on('SIGINT',He);process.on('SIGBREAK',He);process.on('SIGHUP',He);process.on('uncaughtException',a=>{console.error('Uncaught Exception:',a);He()});olympe.dc={};olympe.dc.ua={ORIGIN:'<',DESTINATION:'>'};x('olympe.dc.Direction',olympe.dc.ua);olympe.dc.pc={Zc:'ff022000000000000000',Oh:'ff02200000000000000e',$i:'ff02200000000000000f'};olympe.dc.Zo={VERSION:'@v',rq:'@s'};olympe.dc.mj={Ee:'?'};olympe.dc.NA={ei:'online',Zd:'offline',zz:'invalidate'};olympe.dc.Pa={SELF:'self',SERVER:'server',gf:'remote',Zd:'offline'};olympe.dc.cc={NONE:null,fo:'ff023000000000000037',zc:'ff023000000000000137',Kf:'ff023000000000000237',su:'ff023000000000000337'};olympe.dc.Bp=class extends Error{constructor(a){var b=olympe.dc.ja(),c=olympe.dc.Rd(),d=b.model(a);d=`\n- model: ${d} (${d?b.name(d):'no name'})`;b=b.source(a);c=`\n- source: ${b} (${b?c.xb(b).name():'no name'})`;super(`Trying to use an CloudObject that does not exist:\n- tag: ${a}${d}${c}${''}`)}};olympe.dc.Writable=class{Lc(){}Uc(){}F(){}Ea(){}fc(){}};olympe.dc.Yt=class{pd(){}V(){}K(){}};function Ie(a){return olympe.dc.CloudObject.get(a.tag)}olympe.dc.Bc=class{constructor(a){this.tag='string'===typeof a?a:a.X()}X(){return this.tag}Ka(a){return a instanceof olympe.dc.Bc&&this.tag===a.tag}};olympe.dc.Bc.xa=[olympe.dc.Fe];olympe.dc.Bc.prototype.Ka.L=olympe.D.J.C;olympe.dc.Bs=class a{constructor(b,c,d,e,f,g){this.H=b;this.db=c;this.T=d;this.Xb=e;this.O=f;this.G=g;this.C=Ma(new olympe.Y.Vl(6E5),(h,k)=>{URL.revokeObjectURL(k);Je(this.db,h,a.C(h))})}Z(b,c,d,e,f){this.ba(c).then(g=>{this.fa(b,g,d,!!this.G,e,f)}).catch(g=>this.H.error(g))}F(b,c,d){const e=olympe.D.Xa().G(c),f=olympe.D.Xa().G(g=>{g=`Failed to download file ${b.X()}: ${g}`;this.H.error(g);null==d||d(g)});olympe.D.Sm([b.sr(),b.X(),b.ml(),b.Dm()],(g,h,k,l)=>{if(Ka(this.C.C,h))k=this.C.get(h),this.O.F(k,
|
|
516
|
+
e,f);else{var n=p=>{p=p instanceof Uint8Array?new Blob([p],{type:l}):p;this.G&&this.K(h,p);e(p)};g.valueOf()?(g=this.db.model(b),k=new olympe.dc.Request(olympe.dc.Request.C.Ff,olympe.dc.Rd().we(b),{tag:h,model:g,url:k.valueOf()}),this.Xb.request(k).then(n).catch(f)):(k=O(k),k.F=olympe.net.Ba.ResponseType.Dk,this.T.C(k,p=>{const q=p.yc();200<=q&&300>q?n(p.getData()):f(`Failed to download file ${b}. Response code ${q}`)}))}})}fa(b,c,d,e,f,g){e=e?k=>{this.K(b,new Blob([c],{type:d}));f(k)}:f;var h=this.db.model(b);
|
|
517
|
+
h=new olympe.dc.Request(olympe.dc.Request.C.Mf,olympe.dc.Rd().we(b),{tag:b,model:h,content:c,mimeType:d});this.Xb.request(h).then(e).catch(null!=g?g:this.H.error.bind(this.H))}ba(b){return v(function*(){var c=b instanceof olympe.D.Na?b.valueOf():b;return'string'===typeof c?(new TextEncoder).encode(c):c instanceof ArrayBuffer?new Uint8Array(c,0,c.byteLength):c instanceof Blob?(c=yield c.arrayBuffer(),new Uint8Array(c,0,c.byteLength)):c})}K(b,c){const d=olympe.dc.ga(b);b=URL.createObjectURL(c);this.C.set(d,
|
|
518
|
+
b);const e=a.C(d);Ke(this.db,d,f=>{f||(this.C.delete(d),Je(this.db,d,e))},e)}static C(b){return`cacheBinary${b}`}};function Le(a,b){let c=Me(b),d=null;for(;!c&&b&&b!==d;){d=b;b=a.db.Oe(b);if(null===b)break;c=Me(b)}let e;return null!=(e=c)?e:null}olympe.dc.Ts=class{constructor(a,b,c){this.H=a;this.C=b;this.db=b.view;this.F=c;this.Ma=new FinalizationRegistry(d=>{this.H.K()&&this.H.debug(`Collect instance ${d} (${this.db.name(d)||'no name'})`);this.C.C.Ab([d])})}};function Ne(a,b){a.origin=b;return a}function Oe(a,b,c){a.F.set(b,c);return a}function Pe(a){let b;return null!=(b=a.F)?b:new Map}olympe.dc.Request=class{constructor(a,b,c,d){this.type=a;this.origin=olympe.dc.Pa.SELF;this.C=b;this.content=null!=c?c:null;this.G=null!=d?d:Qc(olympe.auth.ge()).je();this.F=new Map}getType(){return this.type}uc(){return this.G}nc(){return this.C}toString(){return`Request of type ${this.type}, from ${this.origin} to ${this.C}; content: ${this.content}`}};
|
|
519
|
+
olympe.dc.Request.C={Mb:1,eg:10,Ds:24,Ho:25,Es:28,ng:30,Dj:31,kA:32,wg:40,xg:41,tn:42,Yp:43,Jh:45,vn:46,ij:47,Mf:50,Ff:51,cg:52,Lu:60,fu:61,Co:62,qz:63,Yr:64,Ng:65,Zn:91,Fs:93,ul:95,QUERY_RESULT:97};function Qe(a,b,c,d,e){const f=olympe.D.Dg();a.sources.set(olympe.dc.Pa.SERVER,e.init(a));a.G?a.sources.set(olympe.dc.Pa.gf,d.init(a)):Ke(b,a.C,()=>{a.sources.set(olympe.dc.Pa.gf,d.init(a));const g=new Map;olympe.dc.pa.from(a.C,a.C).cb(olympe.dm.DataSource.Mi).filter(olympe.dc.query.Aa.Ka(olympe.dm.DataSource.nh,!0)).observe(f).subscribe(h=>{var k=Re(h);for(var l of k){const [p,q]=g.get(l);c.G(p);c.O(q);k=a.sources.get(l);a.sources.delete(l);var n=void 0;null==(n=k)||n.destroy()}h=Se(h);for(const p of h)if(h=
|
|
520
|
+
p.X(),!a.sources.has(h)){const q=new olympe.dc.sources.ip(a.H,p);a.sources.set(h,q);l=c.C(()=>q.healthCheck());n=c.F(()=>q.destroy(),`Datasource ${h}`);g.set(h,[l,n]);q.init(a)}});Je(b,a.C,'router',!0)},'router')}function Te(a,b,c){a.H.debug('Router: subscribes',b);return a.xb(b.nc()).fa(b,c)}function Ue(a,b,c){let d=a.F.get(b);void 0===d&&(d=[],a.F.set(b,d));d.push(c)}
|
|
521
|
+
olympe.dc.ku=class{constructor(a,b,c,d,e,f,g){this.H=a;this.C=f;this.G=g;this.sources=new Map;this.F=new Map;Qe(this,d,e,b,c)}request(a){this.H.debug('Router: sends',a);return this.xb(a.nc()).request(a)}kd(a){const b=a.nc();if(b===this.C){let c;null==(c=this.F.get(a.getType()))||c.forEach(d=>d(a))}else olympe.N.tb.publish(b,a).catch(c=>{this.H.error(`Error while publishing the message ${a} to remote router: ${c}`)})}xb(a){let b;return null!=(b=this.sources.get(a))?b:this.sources.get(olympe.dc.Pa.gf)}};olympe.dc.Ma={};const Ve=olympe.dc.ua.ORIGIN,We=olympe.dc.ua.DESTINATION,Xe=new Map,Ye=new Map,Ze=new Map,$e=new Map;function Me(a){let b;return null!=(b=Xe.get(a))?b:null}function af(a,b,c){let d=a;'function'===typeof a&&(d=c.entry);a=[...(d.Zm||[])];return olympe.dc.na.C(b,c,...a)}function R(a,b){$e.set(a,b);return a}function bf(a){let b,c;return null!=(c=null==(b=Xe.get(a))?void 0:b.F)?c:olympe.dc.CloudObject}
|
|
521
522
|
function cf(a,b,c){const d=a+'@'+(b===We?Ve:We);if(Ye.has(d))throw Error(`Try to register the same relation (${b+a}) multiple times.`);Ye.set(d,c)}function df(a){a=a.X()+'@'+a.Ga();return Ye.get(a)||olympe.dc.CloudObject}function S(a,b){b.NAME=a;Ze.set(a,b)}function T(a){let b;return null!=(b=a.NAME)?b:null}
|
|
522
|
-
olympe.dc.
|
|
523
|
-
olympe.dc.Ma.Entry=class{constructor(a,b,c){this.tag=a;this.F=b;this.
|
|
524
|
-
a)}
|
|
525
|
-
this.tag}};olympe.dc.Ma.Relation.prototype.getInverse=olympe.dc.Ma.Relation.prototype.Vb;olympe.dc.Ma.Relation.prototype.getDirection=olympe.dc.Ma.Relation.prototype.Ga;olympe.dc.Ma.Relation.prototype.getTag=olympe.dc.Ma.Relation.prototype.X;olympe.dc.Ma.Relation.xa=[olympe.dc.
|
|
526
|
-
y===e?t.set(z,u):y===f?t.set(w,u):y===g?u.forEach((A,C)=>{k.Ea(z,C,r)}):y===h&&u.forEach((A,C)=>{k.Ea(z,r,C)})});l=l.source();k.
|
|
527
|
-
function kf(a,b,c){const d=b.V();if(a.F.has(d))throw Error(`You try to execute the patch ${d} a second times whereas the first execution has not been validated yet.`);const e=new lf(b,gf(a,b));a.C.push(d);a.F.set(d,e);a.G.
|
|
528
|
-
olympe.dc.db.
|
|
529
|
-
function nf(a,b,c,d){const e=olympe.dc.ua.DESTINATION;c=c.tag();const f=a.C.Hd(c);b.Cb().forEach((g,h)=>{f.
|
|
530
|
-
class lf{constructor(a,b){this.F=a;this.C=b;this.db=olympe.dc.
|
|
531
|
-
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.Pa.SELF;this.H=b;this.ec=olympe.D.Xa();this.T=olympe.dc.db.Database.G.IDLE;this.ba=new Map;this.
|
|
532
|
-
c,d,e=!1){var f=this.F(b,!0);if(!f.e&&null!==c&&(null===f.G||f.G===c)){f.G=c;let g;(null==(g=f.model())?0:g.e)&&f.db.Z(f,!0)}e&&f.persist();d&&this.ac(f,d);this.C(a.F.
|
|
533
|
-
case qf:wf(c,d);break;default:c.unlink(b,d)}}
|
|
534
|
-
{e(c,...d)})}Z(b,c){this.fa.set(b,c)}qf(b,c,d,e){let f;null!=(f=this.G[0])&&Af(f,b).
|
|
535
|
-
this.ec))}Fd(){this.T=a.G.
|
|
536
|
-
this.G[0];for(const [c,d]of this.fa)this.Tb(new Set,c).filter(e=>{var f=d;const g=e.e!==f;g&&(f?(e.e=f,If(e)):(Jf(e),e.e=f),e.db.C(f?Kf.
|
|
523
|
+
olympe.dc.na=class{constructor(){}static C(a,b,...c){if(Xe.has(a))throw Error(`Tag: ${a} - overwriting already defined CloudObject class ${Xe.get(a).F.name} with ${b.name}`);let d=null;const e=c.length;if(0<e){d=Array(e);for(let f=0;f<e;f++){let g=c[f];d[f]='string'===typeof g?new olympe.W.tb(g):g}}b=new olympe.dc.Ma.Entry(a,b,d);Xe.set(a,b);return b.F.entry=b}static bc(a){let b,c;return null!=(c=null==(b=a.entry)?void 0:b.X())?c:null}};function ef(a,b){a.C=b}function U(a,b){b=b.Vb();cf(b.X(),b.Ga(),a.F);return b}function ff(a){a.G=!0;return a}
|
|
524
|
+
olympe.dc.Ma.Entry=class{constructor(a,b,c){this.tag=a;this.F=b;this.Zm=c||null;this.C=null;this.G=!1}X(){return this.tag}instantiate(a,b){const c=this.F;if(this.Km()&&b.getParameter(olympe.dc.U.oo)){var d=olympe.dc.ja();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.ma.eb('dc').error(d)}return this.Zm?(a=[void 0,a].concat(ra(b,this.Zm)),new c(...a)):new c(void 0,
|
|
525
|
+
a)}la(a){return new olympe.dc.Ma.Property(a)}sa(a,b=olympe.dc.ua.DESTINATION){cf(a,b,this.F);return new olympe.dc.da.Je(a,b)}Km(){return this.G}};x('olympe.dc.registry.Entry',olympe.dc.Ma.Entry);olympe.dc.Ma.Entry.prototype.addRelation=olympe.dc.Ma.Entry.prototype.sa;olympe.dc.Ma.Entry.prototype.addProperty=olympe.dc.Ma.Entry.prototype.la;olympe.dc.Ma.Entry.xa=[olympe.dc.Fe];olympe.dc.Ma.Property=class{constructor(a){this.tag=a}X(){return this.tag}toString(){return`Property: ${this.tag}`}};olympe.dc.Ma.Property.prototype.getTag=olympe.dc.Ma.Property.prototype.X;olympe.dc.Ma.Property.xa=[olympe.dc.Fe];olympe.dc.Ma.Relation=class{constructor(a,b=olympe.dc.ua.DESTINATION,c=olympe.dc.CloudObject,d=olympe.dc.CloudObject){this.tag=olympe.dc.ga(a);this.direction=b;this.origin=c;this.K=d}X(){return this.tag}Ga(){return this.direction}type(){return this.K}Vb(){return new olympe.dc.Ma.Relation(this.tag,this.direction===olympe.dc.ua.DESTINATION?olympe.dc.ua.ORIGIN:olympe.dc.ua.DESTINATION,this.K,this.origin)}Ka(a){return a instanceof olympe.dc.Ma.Relation?a.X()===this.X()&&a.Ga()===this.Ga():!1}toString(){return this.direction+
|
|
526
|
+
this.tag}};olympe.dc.Ma.Relation.prototype.getInverse=olympe.dc.Ma.Relation.prototype.Vb;olympe.dc.Ma.Relation.prototype.getDirection=olympe.dc.Ma.Relation.prototype.Ga;olympe.dc.Ma.Relation.prototype.getTag=olympe.dc.Ma.Relation.prototype.X;olympe.dc.Ma.Relation.xa=[olympe.dc.Fe];olympe.dc.db={};function gf(a,b){const c=a.G,d=olympe.dc.ja(),e=olympe.dc.db.Database.C.fi,f=olympe.dc.db.Database.C.Ee,g=olympe.dc.db.Database.C.ORIGIN,h=olympe.dc.db.Database.C.DESTINATION,k=new olympe.dc.db.Qc('rev-'+b.V());a.H.debug('Generate the reverse graphLayer of',b.V());b.yb.forEach((l,n)=>{if(l.G()){k.F(n,olympe.dc.cc.NONE);for(const [r,t]of l.sd())k.fc(r,n,t)}else{var p=c.get(n);if(void 0!==p)if(l.Sd())for(const r of hf(d,n,l.O())){l=c.get(r);const t=new Map;l.forEach((u,w)=>{const y=w[0],z=w.substring(1);
|
|
527
|
+
y===e?t.set(z,u):y===f?t.set(w,u):y===g?u.forEach((A,C)=>{k.Ea(z,C,r)}):y===h&&u.forEach((A,C)=>{k.Ea(z,r,C)})});l=l.source();k.Lc(r,l,t)}else{const r=new Map;for(const t of l.Cb().keys()){var q=t[0]===f;const u=q?t.substring(1):t;q=q?jf(p,u,!0):p.Ja(u,!0);let w;r.set(t,null!=(w=q)?w:null)}0<r.size&&k.Uc(n,r);for(const [t,u,w]of l.sd())w?k.fc(t,n,u):k.Ea(t,n,u)}}});return k}
|
|
528
|
+
function kf(a,b,c){const d=b.V();if(a.F.has(d))throw Error(`You try to execute the patch ${d} a second times whereas the first execution has not been validated yet.`);const e=new lf(b,gf(a,b));a.C.push(d);a.F.set(d,e);a.G.Hm(c);a.write(b,!1)}function mf(a,b,c){return a.C.slice(0,c).map(d=>a.F.get(d)).reduce((d,e)=>e?e.Gc(d):d,b)}
|
|
529
|
+
olympe.dc.db.js=class{constructor(a,b,c,d){this.H=a;this.G=b;this.ja=c;this.K=d;this.C=[];this.F=new Map}Gc(a){const b=a.V();this.C.includes(b)?this.push(b):this.write(mf(this,a,this.C.length),!0)}push(a){const b=this.C.indexOf(a);if(-1<b){const c=this.F.get(a);this.C.splice(b,1);mf(this,c.F,b);this.F.delete(a)}}write(a,b){(new olympe.dc.db.Pq(this.H,this.G,this.ja,this.K,b)).write(a)}};
|
|
530
|
+
function nf(a,b,c,d){const e=olympe.dc.ua.DESTINATION;c=c.tag();const f=a.C.Hd(c);b.Cb().forEach((g,h)=>{f.la(h,g);b.fa(h)});for(const [g,h,k,l]of b.bb()){if(!l)continue;const n=h===e?c:k,p=h===e?k:c;a.C.Ea(g,n,p);d.O(g,n,p)}}function of(a,b,c,d){const e=olympe.dc.ua.DESTINATION,f=c.tag(),g=a.C.Hd(f);b.Cb().forEach((h,k)=>{void 0!==c.Ja(k)&&(g.la(k,h),b.fa(k))});for(const [h,k,l]of b.sd()){const n=c.Ab(h,e,k);void 0!==n&&(d.O(h,f,k),n===l&&a.C.O(h,f,k))}}
|
|
531
|
+
class lf{constructor(a,b){this.F=a;this.C=b;this.db=olympe.dc.ja()}V(){return this.F.V()}Gc(a){var b=this.F.yb,c=a.yb;const d=b.size>c.size,e=d?b:c;b=d?c:b;for(const [g,h]of b){b=g;var f=e.get(b);void 0!==f&&(c=d?f:h,f=d?h:f,f.Sd()?c.G()||this.C.G(b,f.O()):c.Sd()?(nf(this,f,c,a),a.G(b,c.O())):of(this,f,c,a))}return a}};const pf=olympe.dc.pc.Zc,qf=olympe.dc.pc.Oh,rf=olympe.dc.ua.ORIGIN,sf=olympe.dc.ua.DESTINATION;
|
|
532
|
+
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.Pa.SELF;this.H=b;this.ec=olympe.D.Xa();this.T=olympe.dc.db.Database.G.IDLE;this.ba=new Map;this.oa=[];this.G=[];this.fa=new Map;var f;b=null!=(f=d.get('garbageCollector'))?f:olympe.dc.db.bf.C.Uk;let g;f=null!=(g=d.get('garbageCollectorDelay'))?g:5E3;this.Oc=new olympe.dc.db.bf(c,this,b,f);d.get('debug')&&this.vm()}V(){return this.id}getState(){return this.T}eb(){return this.H}create(b,
|
|
533
|
+
c,d,e=!1){var f=this.F(b,!0);if(!f.e&&null!==c&&(null===f.G||f.G===c)){f.G=c;let g;(null==(g=f.model())?0:g.e)&&f.db.Z(f,!0)}e&&f.persist();d&&this.ac(f,d);this.C(a.F.To,b)}update(b,c){c&&(b=this.F(b,!0),this.ac(b,c))}za(b){const c=this.get(b);void 0!==c&&(this.Z(c,!1),this.C(a.F.Uo,b))}link(b,c,d){c=this.F(c,!0);d=this.F(d,!0);switch(b){case pf:tf(c,d);break;case qf:uf(c,d);break;default:c.link(b,d)}}unlink(b,c,d){c=this.get(c);d=this.get(d);if(void 0!==c&&void 0!==d)switch(b){case pf:vf(c,d);break;
|
|
534
|
+
case qf:wf(c,d);break;default:c.unlink(b,d)}}bb(b){for(const c of b)xf(this.F(c))}Ab(b){for(const c of b)(b=this.get(c))&&yf(b)}Hm(b){b.forEach(c=>{this.F(c).persist()})}ed(b){const c=this.get(b);void 0!==c&&(c.clear(),super.delete(b),this.C(a.F.mo,b))}F(b,c=!1){let d=this.get(b);void 0===d&&(d=new olympe.dc.db.Instance(b,this),this.set(b,d),this.C(a.F.lo,b),c&&this.C(a.F.Yl,b));return d}nb(b){zf(this.G[0],olympe.Y.th(),b)}O(b){this.G[0].C.delete(b)}C(b,c,...d){this.ba.has(b)&&this.ba.get(b).forEach(e=>
|
|
535
|
+
{e(c,...d)})}Z(b,c){this.fa.set(b,c)}qf(b,c,d,e){let f;null!=(f=this.G[0])&&Af(f,b).la(e?Bf+c:c,d)}rf(b,c,d,e,f){let g;null!=(g=this.G[0])&&(d===Cf?f?Af(g,b).link(c,e):Af(g,b).unlink(c,e):f?Af(g,b).Nb(c,e):Af(g,b).ac(c,e))}Nb(b,c,d){let e;null!=(e=this.G[0])&&Af(e,b).ed(c,d)}addEventListener(b,c){let d=this.ba.get(b);void 0===d&&(d=[],this.ba.set(b,d));d.push(c)}Ta(b){this.oa.push(b)}K(b){return this.G.reduce((c,d)=>d.O.has(b)||c,!1)}Ne(){this.T===a.G.IDLE&&(this.T=a.G.Rr);this.G.unshift(new olympe.dc.db.ys(this,
|
|
536
|
+
this.ec))}Fd(){this.T=a.G.We;this.Im();Df(this.G[0]);this.G.shift();0===this.G.length&&(this.T=a.G.IDLE,this.oa.forEach(b=>{b()}),Ef(this.Oc))}ac(b,c){const d=a.C.Ee;for(const [h,k]of c)if(void 0!==k)if(h[0]===d){c=b;var e=h.substring(1),f=k;const l=Ff+e;var g=c.get(l);(void 0===g?null:g)!==f&&(g=Gf+e,null===f?(c.delete(l),f=(f=c.Oe())&&jf(f,e),f=void 0===f?null:f,null!==f&&c.set(g,f),Hf(c,(new Map).set(e,f))):(void 0!==c.get(g)&&c.delete(g),c.set(l,f),Hf(c,(new Map).set(e,f))))}else b.update(h,k)}Im(){const b=
|
|
537
|
+
this.G[0];for(const [c,d]of this.fa)this.Tb(new Set,c).filter(e=>{var f=d;const g=e.e!==f;g&&(f?(e.e=f,If(e)):(Jf(e),e.e=f),e.db.C(f?Kf.Xk:Kf.zc,e.C));return g}).forEach(e=>{e=e.tag();d?Af(b,e).create():Af(b,e).delete()});this.fa.clear()}Tb(b,c,d=[]){const e=c.tag();if(!b.has(e)&&(b.add(e),d.push(c),c=c.get(rf+pf)))for(const f of c.values())null!==f.source()&&this.Tb(b,f,d);return d}vm(){const b=a.F.Xk,c=a.F.Fj,d=new Set,e=new Map;this.addEventListener(a.F.To,f=>{d.add(f)});this.addEventListener(b,
|
|
537
538
|
f=>{d.delete(f);e.delete(f)});this.addEventListener(c,(f,...g)=>{if(g[0]===qf&&g[1]===sf){const h=g[2];this.get(h).Fa()||(g=e.get(h)||new Set,0===g.size&&e.set(h,g),g.add(f))}});this.Ta(()=>{d.forEach(f=>{const g=this.get(f);g&&null===g.model()&&this.H.error(`\n[DEBUG - DATABASE]\nInstance ${f} created but does not exist !\n${g.toString()}`)});d.clear();e.forEach((f,g)=>{const h=this.get(g);h&&this.H.error(`\n[DEBUG - DATABASE]\nThe model ${g} is extended by other models but does not exist !`+`\nExtension models: ${Array.from(f.values()).join(', ')}`+
|
|
538
|
-
`\n\n ${h.toString()}`)});e.clear()})}};olympe.dc.db.Database.C={
|
|
539
|
-
function Ke(a,b,c,d){a=a.C.F(olympe.dc.ga(b));d=null!=d?d:Yf();Zf(a,'',d,c)&&a.Fa()&&c(!0,b);return d}function hf(a,b,c){return{[Symbol.iterator]:function*(d,e,f){const g=(new Set).add(e);for(const h of g)yield h,d.
|
|
540
|
-
function $f(a,b,c,d,e){a=a.C.F(olympe.dc.ga(b));c=olympe.dc.ga(c);b=Pf+c;e=null!=e?e:Yf();if(Zf(a,b,e,d)&&a.Fa()){let f=!1;b=a.get(b);void 0===b&&(f=!0,b=a.get(Rf+c));void 0!==b&&d(b,f)}return e}function V(a,b,c=!1){if(b)return a=a.C.get(olympe.dc.ga(b)),!a||c&&!a.Fa()?null:a;throw Error('DBView: Impossible to get instance, provided tag is null or undefined.');}function ag(a,b,c,d){b=V(a,b);null!==b&&(c=olympe.dc.ga(c),Xf(b,Pf+c,d),a.C.getState()===Vf.
|
|
541
|
-
function bg(a,b,c,d){a=a.C.F(olympe.dc.ga(b));d=null!=d?d:Yf();Zf(a,Uf,d,c)&&a.Fa()&&a.forEach((e,f)=>{const g=f[0];g!==Pf&&g!==Rf||c(f.substring(1),e,g===Rf)});return d}function cg(a,b,c){b=V(a,b);null!==b&&(Xf(b,Uf,c),a.C.getState()===Vf.
|
|
542
|
-
function W(a,b,c,d,e){a=a.C.F(olympe.dc.ga(b));c=c.Ga()+c.X();e=null!=e?e:Yf();(d=eg(a,c,e,d))&&a.Fa()&&dg(a,c,!0,d,!1);return e}function fg(a,b,c,d){const e=a.C.F(olympe.dc.ga(b));a=null!=d?d:Yf();const f=eg(e,Tf,a,c);f&&e.Fa()&&e.forEach((g,h)=>{g=h[0];g!==Nf&&g!==Of||dg(e,h,!0,f,!0)})}function gg(a,b,c){const d=V(a,b);if(null!==d){const e=Xf(d,Tf,c);void 0!==e&&(a.C.getState()!==Vf.
|
|
543
|
-
function hg(a,b,c){b=V(a,b,!1);if(!b)return[];const d=olympe.dm.Relation.C.
|
|
544
|
-
null!=(t=null==(r=a.C.get(q))?void 0:r.get(h))?t:0;(f|g)&u&&l.forEach(w=>{k.push([w,q,p,!!(f&u)])})}});return k}function ig(a,b,c,d,e){const f=a.C.F(olympe.dc.ga(b));e=null!=e?e:Yf();const g=eg(f,Sf+c,e,d);g&&f.Fa()&&hg(a,b,c).forEach(([h,...k])=>{h.Fa()&&g(...k,!0,h.tag())})}function jg(a,b,c,d){const e=V(a,b);if(null!==e){const f=Xf(e,Sf+c,d);void 0!==f&&(a.C.getState()!==Vf.
|
|
539
|
+
`\n\n ${h.toString()}`)});e.clear()})}};olympe.dc.db.Database.C={fi:'$',Ps:'~',Ee:'?',wk:'=',Qo:'|',Jn:'@',ORIGIN:olympe.dc.ua.ORIGIN,DESTINATION:olympe.dc.ua.DESTINATION};olympe.dc.db.Database.F={lo:0,mo:1,Gq:2,Yl:3,Kn:4,Ln:5,Xk:6,zc:7,Fj:8,Kl:9,To:10,Uo:11,Sp:12};olympe.dc.db.Database.G={IDLE:0,Rr:1,We:2};function Lf(a,b,c=[]){const d=b.V();kf(a.F,b,c);return e=>{if(e)a.F.push(d);else{e=a.F;const f=e.F.get(d);if(void 0!==f){const g=e.C.indexOf(d);e.C.splice(g,1);e.write(mf(e,f.C,e.C.length),!1);e.F.delete(d)}}}}function Mf(a,b){a.C.Ta(b)}olympe.dc.db.us=class{constructor(a,b,c,d,e){this.H=a;this.C=b;this.view=c;this.F=new olympe.dc.db.js(a,b,c,d);this.ax=new olympe.dc.db.It(a,c,b,e)}eb(){return this.H}Gc(a){this.F.Gc(a)}};const Nf=olympe.dc.db.Database.C.ORIGIN,Of=olympe.dc.db.Database.C.DESTINATION,Pf=olympe.dc.db.Database.C.fi,Qf=olympe.dc.db.Database.C.Ee,Rf=olympe.dc.db.Database.C.wk,Sf=olympe.dc.db.Database.C.Qo,Tf=Nf+Of,Uf=Pf+Pf,Vf=olympe.dc.db.Database.G;let Wf=0;function Je(a,b,c,d=!1){const e=V(a,b);if(null!==e){const f=Xf(e,'',c);void 0!==f&&(a.C.getState()!==Vf.We||e.K()&&!d||a.C.O(c),d||!e.Fa()&&!e.K()||f(!1,b))}}
|
|
540
|
+
function Ke(a,b,c,d){a=a.C.F(olympe.dc.ga(b));d=null!=d?d:Yf();Zf(a,'',d,c)&&a.Fa()&&c(!0,b);return d}function hf(a,b,c){return{[Symbol.iterator]:function*(d,e,f){const g=(new Set).add(e);for(const h of g)yield h,d.ek(h,f).forEach(([k,,,l])=>{l&&g.add(k)})}.bind(null,a,b,c)}}function Yf(){++Wf;return String(Wf)}
|
|
541
|
+
function $f(a,b,c,d,e){a=a.C.F(olympe.dc.ga(b));c=olympe.dc.ga(c);b=Pf+c;e=null!=e?e:Yf();if(Zf(a,b,e,d)&&a.Fa()){let f=!1;b=a.get(b);void 0===b&&(f=!0,b=a.get(Rf+c));void 0!==b&&d(b,f)}return e}function V(a,b,c=!1){if(b)return a=a.C.get(olympe.dc.ga(b)),!a||c&&!a.Fa()?null:a;throw Error('DBView: Impossible to get instance, provided tag is null or undefined.');}function ag(a,b,c,d){b=V(a,b);null!==b&&(c=olympe.dc.ga(c),Xf(b,Pf+c,d),a.C.getState()===Vf.We&&a.C.O(d))}
|
|
542
|
+
function bg(a,b,c,d){a=a.C.F(olympe.dc.ga(b));d=null!=d?d:Yf();Zf(a,Uf,d,c)&&a.Fa()&&a.forEach((e,f)=>{const g=f[0];g!==Pf&&g!==Rf||c(f.substring(1),e,g===Rf)});return d}function cg(a,b,c){b=V(a,b);null!==b&&(Xf(b,Uf,c),a.C.getState()===Vf.We&&a.C.O(c))}function dg(a,b,c,d,e){let f;null==(f=a.get(b))||f.forEach((g,h)=>{if(g.Fa()||!c&&g.K())e?d(b.substring(1),b[0],c,h):d(c,h)})}
|
|
543
|
+
function W(a,b,c,d,e){a=a.C.F(olympe.dc.ga(b));c=c.Ga()+c.X();e=null!=e?e:Yf();(d=eg(a,c,e,d))&&a.Fa()&&dg(a,c,!0,d,!1);return e}function fg(a,b,c,d){const e=a.C.F(olympe.dc.ga(b));a=null!=d?d:Yf();const f=eg(e,Tf,a,c);f&&e.Fa()&&e.forEach((g,h)=>{g=h[0];g!==Nf&&g!==Of||dg(e,h,!0,f,!0)})}function gg(a,b,c){const d=V(a,b);if(null!==d){const e=Xf(d,Tf,c);void 0!==e&&(a.C.getState()!==Vf.We||d.K()||a.C.O(c),!d.Fa()&&!d.K()||d.forEach((f,g)=>{f=g[0];(f===Nf||f===Of)&&e&&dg(d,g,!1,e,!0)}))}}
|
|
544
|
+
function hg(a,b,c){b=V(a,b,!1);if(!b)return[];const d=olympe.dm.Relation.C.Ml,e=olympe.dm.Relation.C.hu,f=olympe.dm.Relation.C.Xl,g=olympe.dm.Relation.C.Tp,h=Pf+c,k=[];b.forEach((l,n)=>{const p=n[0];if(l instanceof olympe.dc.Bc&&p===Pf)(l=a.C.get(l.X()))&&k.push([l,n.substring(1),null,!0]);else if(p===Nf){const q=n.substring(1);let r,t;const u=null!=(t=null==(r=a.C.get(q))?void 0:r.get(h))?t:0;(d|e)&u&&l.forEach(w=>{k.push([w,q,p,!!(d&u)])})}else if(p===Of){const q=n.substring(1);let r,t;const u=
|
|
545
|
+
null!=(t=null==(r=a.C.get(q))?void 0:r.get(h))?t:0;(f|g)&u&&l.forEach(w=>{k.push([w,q,p,!!(f&u)])})}});return k}function ig(a,b,c,d,e){const f=a.C.F(olympe.dc.ga(b));e=null!=e?e:Yf();const g=eg(f,Sf+c,e,d);g&&f.Fa()&&hg(a,b,c).forEach(([h,...k])=>{h.Fa()&&g(...k,!0,h.tag())})}function jg(a,b,c,d){const e=V(a,b);if(null!==e){const f=Xf(e,Sf+c,d);void 0!==f&&(a.C.getState()!==Vf.We||e.K()||a.C.O(d),!e.Fa()&&!e.K()||hg(a,b,c).forEach(([g,...h])=>{(g.Fa()||g.K())&&f(...h,!1,g.tag())}))}}
|
|
545
546
|
function kg(a,b){a=V(a,b,!0);b=new Map;if(a)for(const [c,d]of a)c[0]===Qf&&b.set(c.substring(1),d);return b}function lg(a,b,c){return c===olympe.dc.cc.NONE?0:a.Ja(b,c,!0)||0}function mg(a,b){return function*(c){if(c)for(const [d,e]of c)if(c=d[0],c===Nf||c===Of){const f=d.substring(1);for(const g of e.keys())yield[f,c,g]}}(V(a,b,!0))}
|
|
546
|
-
function ng(a,b,c){if(!a.Fa(b))return a.H.warn(`No instance found with tag ${b}`),new Map;const d=new Map,e=[olympe.dc.ga(b)];for(const f of e){const g=a
|
|
547
|
-
olympe.dc.
|
|
548
|
-
a,!0))&&a.
|
|
549
|
-
...d])=>[c.tag(),...d])}
|
|
550
|
-
V(this,a,!0);const d=b.Ga()+b.X();c=null==c?void 0:c.get(d);if(1<(null==c?void 0:c.size))return this.H.warn(`Relation ${b.X()} to instance ${a} is not unique: found ${c.size} related items`),null;a=null==c?void 0:c.values().next().value;return(null==a?0:a.Fa())?a.tag():null}Eg(a,b,c){a=olympe.dc.ga(a);const d=ng(this,a,b);d.delete(a);return c?(c=olympe.dc.ga(c),d.has(c)?Array.from(ng(this,c,b.Vb()).keys()).filter(e=>d.has(e)):[]):Array.from(d.keys())}
|
|
551
|
-
a,b);const d=[olympe.dc.ga(a)];for(const e of d){if(c(e))return e;if(a=b.get(e))for(const f of a.filter(g=>!d.includes(g)))d.push(f)}return null}
|
|
552
|
-
Error(a);null!==c&&e.push(c)}c=V(this,olympe.dc.CloudObject,!0);if(d!==c&&e[e.length-1]===c)throw Error(`The model "${this.name(a)}" (tag = ${a}) does not extend the expected model "${this.name(b)}" (tag = ${b}).`);return e.map(f=>f.tag())}Ig(a,b){const c=olympe.dc.ga(b);return!!this.
|
|
553
|
-
olympe.dc.
|
|
554
|
-
olympe.dc.
|
|
555
|
-
olympe.dc.
|
|
556
|
-
function Df(a){const b=a.K;a.F.forEach((c,d)=>{var e=b.get(d);if(c.G()||c.
|
|
547
|
+
function ng(a,b,c){if(!a.Fa(b))return a.H.warn(`No instance found with tag ${b}`),new Map;const d=new Map,e=[olympe.dc.ga(b)];for(const f of e){const g=a.ab(f,c);d.set(f,g);for(const h of g.filter(k=>!d.has(k)))e.push(h)}a.H.debug(`Found ${d.size} instances in sub-tree rooted at ${olympe.dc.ga(b)}`);return d}function og(a,b,c,d){return(c=(a=V(a,b,!0))&&a.get(d+c))?Array.from(c.values()).filter(e=>e.Fa()).length:0}
|
|
548
|
+
olympe.dc.ib=class{constructor(a,b){this.H=a;this.C=b}V(){return this.C.V()}F(a,b,c,d=!1){a=V(this,a);if(null!==a){b=b.Ga()+b.X();const e=Xf(a,b,c);void 0!==e&&(this.C.getState()!==Vf.We||a.K()&&!d||this.C.O(c),d||!a.Fa()&&!a.K()||dg(a,b,!1,e,!1))}}Fa(a){a=this.C.get(olympe.dc.ga(a));return!(null==a||!a.Fa())}name(a){let b,c;return null!=(c=null==(b=V(this,a))?void 0:b.Ja(olympe.dc.CloudObject.nameProp.X()))?c:''}model(a){return(a=(a=V(this,a,!0))?a.model():null)?a.tag():null}Oe(a){return(a=(a=V(this,
|
|
549
|
+
a,!0))&&a.Oe())?a.tag():null}Bh(a){a=V(this,a,!0);return!(!a||!a.Oe())}tc(a,b){a=(a=V(this,a,!0))&&a.model();return!(!a||!this.Ig(a.tag(),b))}source(a){return(a=V(this,a,!0))&&a.source()}Uf(a){a=V(this,a,!1);return!a||a.O}Ja(a,b,c){let d;a=null==(d=V(this,a,!0))?void 0:d.Ja(olympe.dc.ga(b),c);return void 0!==a?a:null}Cb(a,b=!1){var c=V(this,a,!0);a=new Map;if(c)for(const [d,e]of c)c=d[0],(c===Pf||!b&&c===Rf)&&a.set(d.substring(1),e);return a}ek(a,b){return hg(this,a,b).filter(([c])=>c.Fa()).map(([c,
|
|
550
|
+
...d])=>[c.tag(),...d])}ab(a,b){a=V(this,a,!0);b=b.Ga()+b.X();b=null==a?void 0:a.get(b);a=[];if(b)for(const c of b.values())c.Fa()&&a.push(c.tag());return a}ur(a,b,c){let d,e;a=null==(d=V(this,a,!0))?void 0:null==(e=d.get(b.Ga()+b.X()))?void 0:e.get(olympe.dc.ga(c));return!(null==a||!a.Fa())}Em(a,b){a=V(this,a,!0);if(!a)return[];a=[a.tag()];for(const c of b){b=[];for(const d of a)if(a=V(this,d,!0).get(c.Ga()+c.X()),void 0!==a)for(const e of a.values())e.Fa()&&b.push(e.tag());a=b}return a}Ib(a,b){var c=
|
|
551
|
+
V(this,a,!0);const d=b.Ga()+b.X();c=null==c?void 0:c.get(d);if(1<(null==c?void 0:c.size))return this.H.warn(`Relation ${b.X()} to instance ${a} is not unique: found ${c.size} related items`),null;a=null==c?void 0:c.values().next().value;return(null==a?0:a.Fa())?a.tag():null}Eg(a,b,c){a=olympe.dc.ga(a);const d=ng(this,a,b);d.delete(a);return c?(c=olympe.dc.ga(c),d.has(c)?Array.from(ng(this,c,b.Vb()).keys()).filter(e=>d.has(e)):[]):Array.from(d.keys())}er(a,b,c){if(!this.Fa(a))return null;b=ng(this,
|
|
552
|
+
a,b);const d=[olympe.dc.ga(a)];for(const e of d){if(c(e))return e;if(a=b.get(e))for(const f of a.filter(g=>!d.includes(g)))d.push(f)}return null}um(a,b,c){return this.Em(a,b).find(c)||null}Ev(a,b,c){return this.Em(a,b).filter(c)}jr(a,b=olympe.dc.CloudObject){var c=V(this,a,!0);const d=b&&V(this,b,!0),e=[c];for(;c&&c!==d;){c=c.Oe();if(e.includes(c))throw Error(`Cycle detected when following recursively extend relations from base model instance "${a}".`);if(c&&!c.Fa())throw a=`Try to get all extensions of the model ${olympe.dc.ga(a)} but one of them does not exists (${c.tag()})`,
|
|
553
|
+
Error(a);null!==c&&e.push(c)}c=V(this,olympe.dc.CloudObject,!0);if(d!==c&&e[e.length-1]===c)throw Error(`The model "${this.name(a)}" (tag = ${a}) does not extend the expected model "${this.name(b)}" (tag = ${b}).`);return e.map(f=>f.tag())}Ig(a,b){const c=olympe.dc.ga(b);return!!this.er(a,olympe.dc.CloudObject.extendRel,d=>d===c)}Id(a){return this.ab(a,olympe.dc.CloudObject.instancesRel)}};olympe.dc.ib.prototype.getInstances=olympe.dc.ib.prototype.Id;olympe.dc.ib.prototype.isExtending=olympe.dc.ib.prototype.Ig;
|
|
554
|
+
olympe.dc.ib.prototype.getExtendedModels=olympe.dc.ib.prototype.jr;olympe.dc.ib.prototype.findAllRelated=olympe.dc.ib.prototype.Ev;olympe.dc.ib.prototype.findRelated=olympe.dc.ib.prototype.um;olympe.dc.ib.prototype.findRecursive=olympe.dc.ib.prototype.er;olympe.dc.ib.prototype.getRecursiveRelated=olympe.dc.ib.prototype.Eg;olympe.dc.ib.prototype.getUniqueRelated=olympe.dc.ib.prototype.Ib;olympe.dc.ib.prototype.getMultiRelated=olympe.dc.ib.prototype.Em;olympe.dc.ib.prototype.isRelated=olympe.dc.ib.prototype.ur;
|
|
555
|
+
olympe.dc.ib.prototype.getRelated=olympe.dc.ib.prototype.ab;olympe.dc.ib.prototype.getProperties=olympe.dc.ib.prototype.Cb;olympe.dc.ib.prototype.getProperty=olympe.dc.ib.prototype.Ja;olympe.dc.ib.prototype.isPersisted=olympe.dc.ib.prototype.Uf;olympe.dc.ib.prototype.instanceOf=olympe.dc.ib.prototype.tc;olympe.dc.ib.prototype.isModel=olympe.dc.ib.prototype.Bh;olympe.dc.ib.prototype.extension=olympe.dc.ib.prototype.Oe;olympe.dc.ib.prototype.model=olympe.dc.ib.prototype.model;
|
|
556
|
+
olympe.dc.ib.prototype.name=olympe.dc.ib.prototype.name;olympe.dc.ib.prototype.exist=olympe.dc.ib.prototype.Fa;const pg=olympe.dc.db.Database.C.ORIGIN,Cf=olympe.dc.db.Database.C.DESTINATION,Bf=olympe.dc.db.Database.C.wk,qg=olympe.dc.db.Database.C.fi,rg=olympe.dc.db.Database.C.Qo,sg=olympe.dc.db.Database.C.Jn,tg=pg+Cf,ug=qg+qg,vg=Array.from(Object.values(olympe.dc.cc)).filter(a=>null!==a);function zf(a,b,c){let d=a.C.get(b);void 0===d&&(d=[],a.C.set(b,d));a.buffer.push([b,d.length]);d.push(c)}
|
|
557
|
+
function Df(a){const b=a.K;a.F.forEach((c,d)=>{var e=b.get(d);if(c.G()||c.Sd()){var f=e.get(sg);f&&wg(a,f,c.G(),d);c.Sd()&&a.O.add(d)}for(const [n,p]of c.Cb()){var g=n[0]===Bf,h=g?n.substring(1):n;f=a;var k=e,l=p;const q=k.get(sg+qg+h);q&&wg(f,q,l,g);(k=k.get(sg+ug))&&wg(f,k,h,l,g)}for(const n of c.bb())xg(a,e,...n);(e=c.ba)&&yg(a,b.get(e),c.Tb,!c.Sd(),d)});a.F.clear();a.G.clear();zg(a)}function Af(a,b){let c=a.F.get(b);void 0===c&&(c=new olympe.dc.db.Vg(b),a.F.set(b,c));return c}
|
|
557
558
|
function wg(a,b,...c){b.forEach((d,e)=>{zf(a,e,d.bind(null,...c))})}function xg(a,b,c,d,e,f){var g=b.get(sg+d+c);g&&wg(a,g,f,e);(g=b.get(sg+tg))&&wg(a,g,c,d,f,e);Ag(a,c,d).forEach((h,k)=>{(k=b.get(sg+rg+k))&&wg(a,k,c,d,h,f,e)})}function yg(a,b,c,d,e){vg.forEach(f=>{(f=b.get(sg+rg+f))&&wg(a,f,c,null,!0,d,e)})}function zg(a){a.T.run(()=>{const b=a.C;for(const [c,d]of a.buffer){let e,f,g;null==(e=b.get(c))||null==(g=(f=e)[d])||g.call(f)}});a.C.clear();a.buffer.length=0}
|
|
558
|
-
function Ag(a,b,c){const d=b+c;let e=a.G.get(d);if(!e){const f=a.K.get(b);e=new Map;vg.forEach(g=>{let h;const k=null!=(h=null==f?void 0:f.get(qg+g))?h:0;(c===pg?12:3)&k&&e.set(g,!!((c===pg?8:2)&k))});a.G.set(d,e)}return e}olympe.dc.db.
|
|
559
|
-
olympe.dc.db.
|
|
560
|
-
e=f=>{this.F.add(f);this.C.getState()===d&&Ef(this)};this.C.addEventListener(olympe.dc.db.Database.F.
|
|
561
|
-
l?a.Ea(h,f,k,g,e.
|
|
562
|
-
e).
|
|
563
|
-
this.
|
|
564
|
-
d=olympe.dc.ua.DESTINATION,e=this.yb.get(a);for(const [g,h,k]of e.sd())if(k||!b){e.K(g,d,h);var f=this.yb.get(h);f&&f.K(g,c,a)}for(const [g,h,k]of e.
|
|
565
|
-
lg(g,n,b)&d?a.add(p):c||q||h.add(`${p}.${n}.${l}`)}for(const [n,p,q]of mg(g,l))k=p===f?d:e,!h.has(p===f?`${q}.${n}.${l}`:`${l}.${n}.${q}`)&&lg(g,n,b)&k&&a.add(q)}return Array.from(a).filter(l=>this.yb.has(l))}C(a,b){let c=this.yb.get(a);void 0===c&&(c=new olympe.dc.db.Vg(a),this.yb.set(a,c));return b?c.za(b):c}T(a){const b=olympe.dc.ua.DESTINATION;var c=this.yb;const d=a.yb,e=(a=a.K()>this.K())?d:c;c=a?c:d;for(const [f,g]of c){c=e.get(f);if(void 0===c)continue;const h=a?g:c,k=a?c:g;if(k.
|
|
566
|
-
k.O());else if(!h.
|
|
567
|
-
function tf(a,b){const c=a.model();if(null!==c){if(c===b)return;a.unlink(Eg,c)}a.link(Eg,b);b.forEach((d,e)=>{if(e[0]===Ff||e[0]===Gf)e=e.substring(1),Gg(a,e,d)});null===a.G||!b.e&&b!==a||a.db.Z(a,!0)}function uf(a,b){const c=a.
|
|
568
|
-
function vf(a,b){a.unlink(Eg,b);a.forEach((c,d)=>{c=d.substring(1);Gg(a,c,null)});a.db.Z(a,!1)}function wf(a,b){a.unlink(Fg,b);const c=new Map;a.forEach((d,e)=>{e[0]===Gf&&(a.delete(e),d=e.substring(1),c.set(d,null))});Hf(a,c)}function xf(a){a.c++;1===a.c&&a.db.C(Kf.
|
|
569
|
-
function yf(a){0<a.c?--a.c:a.db.C(Kf.
|
|
570
|
-
function Xf(a,b,c){const d=Ig(a,Dg+b,c);void 0!==d&&(yf(a),a.db.C(Kf.
|
|
559
|
+
function Ag(a,b,c){const d=b+c;let e=a.G.get(d);if(!e){const f=a.K.get(b);e=new Map;vg.forEach(g=>{let h;const k=null!=(h=null==f?void 0:f.get(qg+g))?h:0;(c===pg?12:3)&k&&e.set(g,!!((c===pg?8:2)&k))});a.G.set(d,e)}return e}olympe.dc.db.ys=class{constructor(a,b){this.K=a;this.T=b;this.F=new Map;this.O=new Set;this.C=new Map;this.G=new Map;this.buffer=[]}};function Ef(a){if(!a.G&&0<a.F.size)switch(a.mode){case olympe.dc.db.bf.C.fn:a.G=!0;setTimeout(()=>a.run(),a.delay);break;case olympe.dc.db.bf.C.vu:a.G=!0,a.run()}}
|
|
560
|
+
olympe.dc.db.bf=class{constructor(a,b,c,d){this.H=a;this.C=b;this.F=new Set;this.mode=c;this.delay=d;this.G=!1;c!==olympe.dc.db.bf.C.Uk&&this.init()}run(){const a=this.C;this.H.debug('Start garbage collector with',this.F.size,'instances to check');for(const b of this.F){const c=a.get(b);!c||0<c.c||(this.H.debug('Remove unused instance',b,'from database'),a.ed(b))}this.F.clear();this.G=!1}init(){const a=olympe.dc.db.Database.F.Gq,b=olympe.dc.db.Database.F.Uo,c=olympe.dc.db.Database.F.Sp,d=olympe.dc.db.Database.G.IDLE,
|
|
561
|
+
e=f=>{this.F.add(f);this.C.getState()===d&&Ef(this)};this.C.addEventListener(olympe.dc.db.Database.F.Yl,e.bind(this));this.C.addEventListener(b,e.bind(this));this.C.addEventListener(a,f=>{this.F.delete(f)});this.C.addEventListener(c,(f,...g)=>{this.H.error(g[0])})}};olympe.dc.db.bf.C={Uk:0,vu:1,fn:2};olympe.dc.db.bf.F=5E3;olympe.dc.db.Qc=class{constructor(a){this.id=null!=a?a:olympe.Y.sf();this.yb=new Map}V(){return this.id}pd(a){const b=olympe.dc.db.Vg.C.tl,c=olympe.dc.db.Vg.C.zc,d=olympe.dc.db.Vg.C.Tj;this.yb.forEach((e,f)=>{const g=e.Ec();switch(e.getState()){case b:const h=e.xb();if(null===h)throw Error(`GraphPatch: try to create the instance ${f} with no source`);const k=e.T()?e.Cb():void 0;a.Lc(f,h,k,g);break;case d:e.T()&&a.Uc(f,e.Cb(),g);break;case c:a.F(f,e.O(),g)}for(const [h,k,l]of e.sd())e=this.yb.get(k),
|
|
562
|
+
l?a.Ea(h,f,k,g,e.Ec()):a.fc(h,f,k,g,e.Ec())})}zh(){return 0===this.yb.size}K(){let a=0;this.yb.forEach(b=>{a+=b.Oc()});return a}Lc(a,b,c,d=null){b=this.C(a).create(b);'string'===typeof d&&this.Ea(olympe.dc.pc.Zc,a,d,d,null);c&&b.gm(c)}Uc(a,b,c=null){b&&this.C(a,c).gm(b)}F(a,b=olympe.dc.cc.NONE,c=null){const d=this.yb.get(a);if(d&&d.G())this.G(a,b);else{this.C(a,c).delete(b);for(const e of this.ek(a,b,!1))this.yb.get(e).Cb().clear(),this.Z(e,!0)}}Ea(a,b,c,d=null,e=null){this.C(b,d).link(a,c);this.C(c,
|
|
563
|
+
e).Nb(a,b)}fc(a,b,c,d=null,e=null){this.C(b,d).unlink(a,c);this.C(c,e).ac(a,b)}ba(a){var b=olympe.dc.ja();if(b.Fa(a)){const c=b.model(a),d=b.source(a),e=b.Cb(a,!0);kg(b,a).forEach((f,g)=>{e.set(`${olympe.dc.mj.Ee}${g}`,f)});this.Lc(a,d,e,c);(b=b.Oe(a))&&this.Ea(olympe.dc.pc.Oh,a,b);e.forEach(f=>{f instanceof olympe.dc.Bc&&this.ba(f.X())})}}Id(){return function*(a){for(const b of a.values())if(b.G()||b.Sd()||b.T())yield b}(this.yb)}Hd(a){return this.yb.get(olympe.dc.ga(a))||null}G(a,b=olympe.dc.cc.NONE){a=
|
|
564
|
+
this.ek(a,b);for(const c of a)this.Z(c,!1),this.yb.delete(c)}sd(){return function*(a){for(var b=a.next();!b.done;){b=b.value;const c=b.tag();yield*b.sd((d,e,f)=>[d,c,e,f]);b=a.next()}}(this.yb.values())}Eg(a,b,c=(d,e)=>[d,e]){return this.fa(a,b,c)}*fa(a,b,c,d=[]){d.push(a);a=this.Hd(a);for(const [e,f]of a.ab(b))d.includes(e)||(yield*this.fa(e,b,c,d),yield c(e,f))}O(a,b,c){const d=this.yb.get(b),e=this.yb.get(c);d&&d.K(a,olympe.dc.ua.DESTINATION,c);e&&e.K(a,olympe.dc.ua.ORIGIN,b)}Z(a,b){const c=olympe.dc.ua.ORIGIN,
|
|
565
|
+
d=olympe.dc.ua.DESTINATION,e=this.yb.get(a);for(const [g,h,k]of e.sd())if(k||!b){e.K(g,d,h);var f=this.yb.get(h);f&&f.K(g,c,a)}for(const [g,h,k]of e.nb())if(k||!b)e.K(g,c,h),(f=this.yb.get(h))&&f.K(g,d,a)}ek(a,b,c=!0){const d=olympe.dm.Relation.C.Ml,e=olympe.dm.Relation.C.Xl,f=olympe.dc.ua.ORIGIN,g=olympe.dc.ja();a=new Set([a]);const h=new Set;for(const l of a){var k=this.yb.get(l);if(void 0!==k){for(const [n,p,q]of k.sd())q&&lg(g,n,b)&e?a.add(p):c||q||h.add(`${l}.${n}.${p}`);for(const [n,p,q]of k.nb())q&&
|
|
566
|
+
lg(g,n,b)&d?a.add(p):c||q||h.add(`${p}.${n}.${l}`)}for(const [n,p,q]of mg(g,l))k=p===f?d:e,!h.has(p===f?`${q}.${n}.${l}`:`${l}.${n}.${q}`)&&lg(g,n,b)&k&&a.add(q)}return Array.from(a).filter(l=>this.yb.has(l))}C(a,b){let c=this.yb.get(a);void 0===c&&(c=new olympe.dc.db.Vg(a),this.yb.set(a,c));return b?c.za(b):c}T(a){const b=olympe.dc.ua.DESTINATION;var c=this.yb;const d=a.yb,e=(a=a.K()>this.K())?d:c;c=a?c:d;for(const [f,g]of c){c=e.get(f);if(void 0===c)continue;const h=a?g:c,k=a?c:g;if(k.Sd())this.G(f,
|
|
567
|
+
k.O());else if(!h.Sd()){h.Cb().forEach((l,n)=>{void 0!==k.Ja(n)&&h.fa(n)});for(const [l,n,p]of h.sd())c=k.Ab(l,b,n),void 0!==c&&p!==c&&this.O(l,f,n)}}}};olympe.dc.db.Qc.xa=[olympe.dc.Writable,olympe.dc.Yt];const Kf=olympe.dc.db.Database.F,Bg=olympe.dc.db.Database.C.fi,Gf=olympe.dc.db.Database.C.Ps,Ff=olympe.dc.db.Database.C.Ee,Cg=olympe.dc.db.Database.C.wk,Dg=olympe.dc.db.Database.C.Jn,X=olympe.dc.ua.ORIGIN,Y=olympe.dc.ua.DESTINATION,Eg=olympe.dc.pc.Zc,Fg=olympe.dc.pc.Oh;function jf(a,b,c=!1){const d=a.get(Ff+b);return c||void 0!==d?d:a.get(Gf+b)}
|
|
568
|
+
function tf(a,b){const c=a.model();if(null!==c){if(c===b)return;a.unlink(Eg,c)}a.link(Eg,b);b.forEach((d,e)=>{if(e[0]===Ff||e[0]===Gf)e=e.substring(1),Gg(a,e,d)});null===a.G||!b.e&&b!==a||a.db.Z(a,!0)}function uf(a,b){const c=a.Oe();if(null!==c){if(c===b)return;a.unlink(Fg,c)}a.link(Fg,b);const d=new Map;b.forEach((e,f)=>{if(f[0]===Ff||f[0]===Gf)f=f.substring(1),a.has(Ff+f)||(a.set(Gf+f,e),d.set(f,e))});Hf(a,d)}
|
|
569
|
+
function vf(a,b){a.unlink(Eg,b);a.forEach((c,d)=>{c=d.substring(1);Gg(a,c,null)});a.db.Z(a,!1)}function wf(a,b){a.unlink(Fg,b);const c=new Map;a.forEach((d,e)=>{e[0]===Gf&&(a.delete(e),d=e.substring(1),c.set(d,null))});Hf(a,c)}function xf(a){a.c++;1===a.c&&a.db.C(Kf.Gq,a.C)}
|
|
570
|
+
function yf(a){0<a.c?--a.c:a.db.C(Kf.Sp,a.C,`Try to decrease references on instance ${a.C} but the reference counter is already 0.\n`+'It happens when you try to remove a callback from an instance multiple times.\nThis counter reference is used for garbage collection of instances in the database.');0===a.c&&a.db.C(Kf.Yl,a.C)}function Zf(a,b,c,d){const e=Hg(a,Dg+b);return e.has(c)?!1:(e.set(c,d),xf(a),a.db.C(Kf.Kn,a.C,b,c),!0)}
|
|
571
|
+
function Xf(a,b,c){const d=Ig(a,Dg+b,c);void 0!==d&&(yf(a),a.db.C(Kf.Ln,a.C,b,c));return d}function eg(a,b,c,d){const e=(...f)=>{var g=f.length;const h=f[g-2];(g=a.db.get(f[g-1]))&&(h?xf(g):yf(g));d(...f)};return Zf(a,b,c,e)?e:null}function Jg(a){void 0!==a.F&&(yf(a),a.db.Nb(a.C,a.F.tag,a.F.La),a.F=void 0)}function Kg(a,b,c,d){a.e&&a.db.qf(a.C,b,c,d)}
|
|
571
572
|
function Hf(a,b,c=[]){const d=a.get(X+Eg);void 0!==d&&d.forEach(e=>{b.forEach((f,g)=>Gg(e,g,f))});a=a.get(X+Fg);void 0!==a&&a.forEach((e,f)=>{if(!c.includes(e.tag())){var g=new Map;b.forEach((h,k)=>{e.has(Ff+k)||(g.set(k,h),null!==h?e.set(Gf+k,h):e.delete(Gf+k))});Hf(e,g,[...c,f])}})}function Hg(a,b){let c=a.get(b);void 0===c&&(c=new Map,a.set(b,c));return c}function Lg(a,b,c,d,e){a.db.rf(a.C,b,c,d.C,e)}
|
|
572
573
|
function Ig(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 Gg(a,b,c){if(!a.has(Bg+b)){const d=Cg+b,e=a.get(d);c!==(void 0!==e?e:null)&&(null===c?a.delete(d):a.set(d,c),Kg(a,b,c,null!==c))}}function If(a){a.forEach((b,c)=>{const d=c[0];if(d===X||d===Y){const e=c.substring(1),f=d===X?Y:X;b.forEach(g=>{g.e&&(Lg(a,e,d,g,!0),Lg(g,e,f,a,!0))})}else if(d===Bg||d===Cg)c=c.substring(1),Kg(a,c,b,d===Cg)})}
|
|
573
574
|
function Jf(a){a.forEach((b,c)=>{const d=c[0];if(d!==Dg){var e=c.substring(1);d===X?b.forEach(f=>{f.unlink(e,a)}):d===Y?b.forEach(f=>{a.unlink(e,f)}):d===Bg&&a.update(e,null);a.delete(c)}});if(void 0!==a.F){const b=a.db.get(a.F.tag);let c,d;(null==(c=b.get(Bg+a.F.La))?void 0:null==(d=c.X)?void 0:d.call(c))===a.C&&b.update(a.F.La,null)}}
|
|
574
|
-
olympe.dc.db.Instance=class extends Map{constructor(a,b){super();this.C=a;this.G=null;this.e=!1;this.F=void 0;this.c=0;this.O=!1;this.db=b}tag(){return this.C}Fa(){return this.e}K(){return this.db.K(this.C)}source(){return this.G}model(){const a=this.get(Y+Eg);let b;return null!=(b=a&&Array.from(a.values())[0])?b:null}
|
|
575
|
-
var b=this.model();if(b){var c=b.Ja(olympe.dc.CloudObject.nameProp.X())||'No model name';a+=`\nModel: ${b.C}, Exist: ${b.e}, Model name: ${c}`}else a+='\nModel: no model';(b=this.
|
|
576
|
-
Date?b instanceof Date&&e.getTime()===b.getTime():null!==e&&'function'===typeof e.Ka?e.Ka(b):e===b)||(d instanceof olympe.dc.
|
|
577
|
-
e,a)),d.F={tag:e,La:a}),d=Cg+a,null===b?(this.delete(c),b=(b=this.model())&&jf(b,a),void 0!==b?(this.set(d,b),Kg(this,a,b,!0)):Kg(this,a,null,!1)):(this.set(c,b),this.delete(d),Kg(this,a,b,!1)))}link(a,b){var c=X+a;const d=Hg(this,Y+a);c=Hg(b,c);d.has(b.C)||(d.set(b.C,b),c.set(this.C,this),this.db.C(Kf.
|
|
578
|
-
b.C),this.db.C(Kf.
|
|
579
|
-
b?b:null;return this}delete(b=olympe.dc.cc.NONE){this.F=a.C.
|
|
580
|
-
(c=this.properties)||c.delete(b);0===this.properties.size&&(this.properties=null)}link(b,c){null===this.
|
|
581
|
-
b.get(d)}K(b,c,d){const e=(c=c===olympe.dc.ua.ORIGIN?this.C:this.
|
|
582
|
-
f)}(b.Ga()===olympe.dc.ua.ORIGIN?this.C:this.
|
|
583
|
-
!e){var f=b.get(c);if(void 0===f)f=new Map,b.set(c,f);else if(b=f.get(d),void 0!==b&&b!==e){f.delete(d);return}f.set(d,e)}}*
|
|
584
|
-
d.join(' --M--\x3e ')}this.H.info(a)}else this.H.info('[DATABASE] Instance',b,'has never been created or referred by the database')}init(){const a=olympe.dc.db.Database.F.
|
|
585
|
-
k,h,`monitorRelations${k}`)})});this.C.addEventListener(c,k=>{this.C.
|
|
586
|
-
function Ng(a,b,c){if(!b)return'';let d='';if(c&&1<c)return'...';for(const [e,f]of b)if(d+=(d?', "':'"')+e+'":',!f)d+=JSON.stringify(f);else if(f instanceof olympe.dc.
|
|
587
|
-
(null!=(g=c)?g:0)+1)}return'{'+(d?d:'')+'}'}function Og(a,b){let c;return'string'===typeof b?null!=(c=a.db.name(b))?c:b:''}function Pg(a,b){let c;return b===olympe.dc.
|
|
588
|
-
class Mg{constructor(a){this.db=a;this.output='Applying patch on the local database'}flush(){const a=this.output;this.output='';return a}log(a,b){this.output+=`\ndb.${a};${b?`// ${b}`:''}`}
|
|
589
|
-
Pg(this,a))}}olympe.dc.db.
|
|
590
|
-
olympe.W.config(function(a){F(a,olympe.dc.db.U.
|
|
591
|
-
h)=>{e=g?olympe.dc.db.
|
|
592
|
-
olympe.W.run([olympe.dc.db.R.
|
|
593
|
-
olympe.dc.query.
|
|
594
|
-
return Qg(()=>-1)}Ja(){return this.La}};function Rg(a,b){return new olympe.dc.query.
|
|
595
|
-
olympe.dc.query.
|
|
596
|
-
olympe.dc.query.
|
|
597
|
-
(null!=(A=n.get(z))?A:new Set).add(y))}})}else l.forEach(r=>{const t=p?`${r};`:'';for(const u of k.F(r))n.has(u)?n.get(u).add(t):n.set(u,(new Set).add(t))});if(0<e&&c.has(g)){const [r,t,u]=c.get(g),w=new Map;n.forEach((y,z)=>{let A;null==(A=r.get(z))||A.forEach(C=>{let M;const K=null!=(M=w.get(z))?M:new Set;y.forEach(
|
|
575
|
+
olympe.dc.db.Instance=class extends Map{constructor(a,b){super();this.C=a;this.G=null;this.e=!1;this.F=void 0;this.c=0;this.O=!1;this.db=b}tag(){return this.C}Fa(){return this.e}K(){return this.db.K(this.C)}source(){return this.G}model(){const a=this.get(Y+Eg);let b;return null!=(b=a&&Array.from(a.values())[0])?b:null}Oe(){const a=this.get(Y+Fg);let b;return null!=(b=a&&Array.from(a.values())[0])?b:null}toString(){var a=this.Ja(olympe.dc.CloudObject.nameProp.X());a=`Instance: ${this.C}, Exist: ${this.e}, Name: ${a}`;
|
|
576
|
+
var b=this.model();if(b){var c=b.Ja(olympe.dc.CloudObject.nameProp.X())||'No model name';a+=`\nModel: ${b.C}, Exist: ${b.e}, Model name: ${c}`}else a+='\nModel: no model';(b=this.Oe())?(c=b.Ja(olympe.dc.CloudObject.nameProp.X())||'No extension name',a+=`\nExtension: ${b.C}, Exist: ${b.e}, Extension name: ${c}`):a+='\nExtension: no extension';return a}Ja(a,b=!1){const c=this.get(Bg+a);return b||void 0!==c?c:this.get(Cg+a)}update(a,b){const c=Bg+a;var d=this.get(c),e=d=void 0===d?null:d;(e instanceof
|
|
577
|
+
Date?b instanceof Date&&e.getTime()===b.getTime():null!==e&&'function'===typeof e.Ka?e.Ka(b):e===b)||(d instanceof olympe.dc.Bc&&(Jg(this.db.get(d.X())),this.db.za(d.X())),b instanceof olympe.dc.Bc&&(d=this.db.F(b.X(),!0),d.F&&d.F.tag!==this.C&&this.db.eb().fatal('Instance',b.X(),'referenced multiple times!\nThis instance is currently property of',d.F.tag,'(for the property '+d.F.La+')','and is assigned as a property of',this.C,'(for the property '+a+')'),e=this.C,void 0===d.F&&(xf(d),d.db.Nb(d.C,
|
|
578
|
+
e,a)),d.F={tag:e,La:a}),d=Cg+a,null===b?(this.delete(c),b=(b=this.model())&&jf(b,a),void 0!==b?(this.set(d,b),Kg(this,a,b,!0)):Kg(this,a,null,!1)):(this.set(c,b),this.delete(d),Kg(this,a,b,!1)))}link(a,b){var c=X+a;const d=Hg(this,Y+a);c=Hg(b,c);d.has(b.C)||(d.set(b.C,b),c.set(this.C,this),this.db.C(Kf.Fj,this.C,a,Y,b.C),this.db.C(Kf.Fj,b.C,a,X,this.C),this.e&&b.e&&(Lg(this,a,Y,b,!0),Lg(b,a,X,this,!0)))}unlink(a,b){const c=X+a;void 0!==Ig(this,Y+a,b.C)&&(Ig(b,c,this.C),this.db.C(Kf.Kl,this.C,a,Y,
|
|
579
|
+
b.C),this.db.C(Kf.Kl,b.C,a,X,this.C),this.e&&b.e&&(Lg(this,a,Y,b,!1),Lg(b,a,X,this,!1)))}persist(){this.O=!0;return this}clear(){this.forEach((a,b)=>{const c=b[0];if(c===X||c===Y){const d=b.substring(1),e=c===X?Y:X;a.forEach(f=>{const g=f.get(e+d);g.delete(this.C);0===g.size&&f.delete(e+d)})}c===Bg&&a instanceof olympe.dc.Bc&&Jg(this.db.get(a.X()))});void 0!==this.F&&this.db.get(this.F.tag).delete(Bg+this.F.La)}};olympe.dc.db.Vg=class a{constructor(b){this.ec=b;this.Z=this.Ta=null;this.hc=olympe.dc.cc.NONE;this.F=a.C.Tj;this.C=this.lb=this.Tb=this.ba=this.properties=null}tag(){return this.ec}Ec(){return this.Z}xb(){return this.Ta}getState(){return this.F}za(b){if(null===this.Z)this.Z=b;else if(this.Z!==b)throw Error(`Try to set a model relation with another model ${b} than the one set initially ${this.Z}`);return this}O(){return this.F===a.C.zc?this.hc:olympe.dc.cc.NONE}create(b){this.F=a.C.tl;this.Ta=null!=
|
|
580
|
+
b?b:null;return this}delete(b=olympe.dc.cc.NONE){this.F=a.C.zc;this.hc=b;this.properties=null;return this}la(b,c){if(this.F===a.C.zc)return this;this.properties||(this.properties=new Map);this.properties.set(b,c);return this}gm(b){this.F!==a.C.zc&&(this.properties||(this.properties=new Map),b.forEach((c,d)=>{this.properties.set(d,c)}))}ed(b,c){if(null!==this.ba&&this.ba!==b)throw Error('An instance should never be set as complex property of multiple instances');this.ba=b;this.Tb=c}fa(b){let c;null==
|
|
581
|
+
(c=this.properties)||c.delete(b);0===this.properties.size&&(this.properties=null)}link(b,c){null===this.lb&&(this.lb=new Map);b===olympe.dc.pc.Zc&&this.za(c);this.sa(this.lb,b,c,!0);return this}unlink(b,c){null===this.lb&&(this.lb=new Map);b===olympe.dc.pc.Zc&&this.za(c);this.sa(this.lb,b,c,!1);return this}Nb(b,c){null===this.C&&(this.C=new Map);this.sa(this.C,b,c,!0)}ac(b,c){null===this.C&&(this.C=new Map);this.sa(this.C,b,c,!1)}Ab(b,c,d){if(c=c===olympe.dc.ua.ORIGIN?this.C:this.lb)return(b=c.get(b))&&
|
|
582
|
+
b.get(d)}K(b,c,d){const e=(c=c===olympe.dc.ua.ORIGIN?this.C:this.lb)&&c.get(b);e&&e.delete(d);e&&0===e.size&&c.delete(b)}G(){return this.F===a.C.tl}Sd(){return this.F===a.C.zc}Oc(){let b=this.properties?this.properties.size:0;this.lb&&this.lb.forEach(c=>{b+=c.size});return b}T(){return null!==this.properties}Cb(){let b;return null!=(b=this.properties)?b:new Map}Ja(b){if(this.properties)return this.properties.get(b)}ab(b,c=(d,e)=>[d,e]){return function*(d){if(d=d&&d.get(b.X()))for(const [e,f]of d)yield c(e,
|
|
583
|
+
f)}(b.Ga()===olympe.dc.ua.ORIGIN?this.C:this.lb)}Ib(b){const c=b.Ga()===olympe.dc.ua.ORIGIN?this.C:this.lb;return(b=c&&c.get(b.X()))&&0!==b.size?Array.from(b.keys())[0]:null}sd(b=(c,d,e)=>[c,d,e]){return this.oa(this.lb,b)}nb(b=(c,d,e)=>[c,d,e]){return this.oa(this.C,b)}bb(b=(c,d,e,f)=>[c,d,e,f]){const c=olympe.dc.ua.ORIGIN,d=olympe.dc.ua.DESTINATION;return function*(e,f,g){yield*e(f,(h,k,l)=>b(h,d,k,l));yield*e(g,(h,k,l)=>b(h,c,k,l))}(this.oa.bind(this),this.lb,this.C)}sa(b,c,d,e){if(this.F!==a.C.zc||
|
|
584
|
+
!e){var f=b.get(c);if(void 0===f)f=new Map,b.set(c,f);else if(b=f.get(d),void 0!==b&&b!==e){f.delete(d);return}f.set(d,e)}}*oa(b,c){if(null!==b)for(const [d,e]of b){b=e.entries();for(const [f,g]of b)yield c(d,f,g)}}};olympe.dc.db.Vg.C={tl:0,Tj:1,zc:2};olympe.dc.db.It=class{constructor(a,b,c,d){this.H=a;this.view=b;this.C=c;d&&this.init()}debug(a){const b=olympe.dc.ga(a);if(this.C.has(b)){var c=this.C.get(a);a='\n[DEBUG - DATABASE]\n'+c.toString();if(!c.Fa()){const d=[];for(;null!==c&&!d.includes(c.tag());)d.push(c.tag()),c=c.model();c=this.C.get(d[d.length-1]);const e=olympe.dc.db.Database.C.fi+olympe.dc.CloudObject.nameProp.X();d.push('???');a+='\n\nThe instance <<'+b+'>> does not exists because the instance '+c.tag()+' (name: '+c.get(e)+') has no model.\nList: '+
|
|
585
|
+
d.join(' --M--\x3e ')}this.H.info(a)}else this.H.info('[DATABASE] Instance',b,'has never been created or referred by the database')}init(){const a=olympe.dc.db.Database.F.mo,b=olympe.dc.db.Database.F.Xk,c=olympe.dc.db.Database.F.zc,d=olympe.dc.db.Database.F.Fj,e=olympe.dc.db.Database.F.Kl,f=olympe.dc.db.Database.F.Kn,g=olympe.dc.db.Database.F.Ln,h=()=>{};this.C.addEventListener(olympe.dc.db.Database.F.lo,()=>{});this.C.addEventListener(a,()=>{});this.C.addEventListener(b,k=>{this.C.nb(()=>{fg(this.view,
|
|
586
|
+
k,h,`monitorRelations${k}`)})});this.C.addEventListener(c,k=>{this.C.nb(()=>{gg(this.view,k,`monitorRelations${k}`)})});this.C.addEventListener(d,()=>{});this.C.addEventListener(e,()=>{});this.C.addEventListener(f,()=>{});this.C.addEventListener(g,()=>{})}};olympe.dc.db.Pq=class{constructor(a,b,c,d,e){this.H=a;this.C=b;this.ja=c;this.G=d;this.K=e}write(a){if(this.G){const b=new Mg(this.ja);a.pd(b);this.H.info(b.flush())}this.C.Ne();a.pd(this);this.C.Fd()}Lc(a,b,c){this.C.create(a,b,c,this.K)}Uc(a,b){this.C.update(a,b)}F(a,b=olympe.dc.cc.NONE){for(const c of hf(this.ja,a,b))this.C.za(c)}Ea(a,b,c){this.C.link(a,b,c)}fc(a,b,c){this.C.unlink(a,b,c)}};
|
|
587
|
+
function Ng(a,b,c){if(!b)return'';let d='';if(c&&1<c)return'...';for(const [e,f]of b)if(d+=(d?', "':'"')+e+'":',!f)d+=JSON.stringify(f);else if(f instanceof olympe.dc.Bc||f instanceof olympe.dc.CloudObject)d+='Reference("'+f.X()+'")';else if(f instanceof olympe.D.Color)d+='Color("'+f.Gi()+','+f.Di()+','+f.Bi()+','+f.zi()+'")';else if(f.constructor&&Object.prototype.hasOwnProperty.call(f.constructor.prototype,'toString'))d+=JSON.stringify(f.toString());else if('object'===typeof f){let g;d+=Ng(a,f,
|
|
588
|
+
(null!=(g=c)?g:0)+1)}return'{'+(d?d:'')+'}'}function Og(a,b){let c;return'string'===typeof b?null!=(c=a.db.name(b))?c:b:''}function Pg(a,b){let c;return b===olympe.dc.pc.Zc?'Model':null!=(c=a.db.name(b))?c:b}
|
|
589
|
+
class Mg{constructor(a){this.db=a;this.output='Applying patch on the local database'}flush(){const a=this.output;this.output='';return a}log(a,b){this.output+=`\ndb.${a};${b?`// ${b}`:''}`}Lc(a,b,c,d){this.log(`createInstance(tag: ${a}, source: ${b}, ${Ng(this,c)})`,Og(this,d))}Uc(a,b,c){this.log(`updateInstance(tag: ${a}, ${Ng(this,b)})`,Og(this,c))}F(a,b,c){this.log(`deleteInstance("${a}", rule: ${b})`,Og(this,c))}Ea(a,b,c){this.log(`createRelation("${a}", "${b}", "${c}")`,Pg(this,a))}fc(a,b,c){this.log(`deleteRelation("${a}", "${b}", "${c}")`,
|
|
590
|
+
Pg(this,a))}}olympe.dc.db.Pq.xa=[olympe.dc.Writable,olympe.dc.Writable];olympe.dc.db.R={Ca:'dc.db.Logger',al:'dc.db.gc.Logger',Ha:'dc.db.DatabaseManager',bj:'dc.db.Database',Qk:'dc.db.DBView',rz:'dc.db.Graph',ty:'dc.db.DatabaseWriter',dA:'dc.db.PermissionProcessor',ai:'dc.db.GraphMonitor'};olympe.dc.db.U={Ao:'db.garbageCollector',Bo:'db.garbageCollectorDelay',ai:'db.monitor',co:'db.debug'};
|
|
591
|
+
olympe.W.config(function(a){F(a,olympe.dc.db.U.Ao,olympe.dc.db.bf.C.fn);F(a,olympe.dc.db.U.Bo,5E3);F(a,olympe.dc.db.U.ai,!1);F(a,olympe.dc.db.U.co,!1);E(a,olympe.dc.db.R.Ca,[olympe.ma.R.Ha],b=>b.Mc('db'));E(a,olympe.dc.db.R.al,[olympe.ma.R.Ha],b=>b.Mc('gc'));E(a,olympe.dc.db.R.bj,[olympe.dc.db.R.Ca,olympe.dc.db.R.al,new olympe.W.ka(olympe.dc.U.rg),new olympe.W.ka(olympe.dc.db.U.Ao),new olympe.W.ka(olympe.dc.db.U.Bo),new olympe.W.ka(olympe.dc.U.ih),new olympe.W.ka(olympe.dc.db.U.co)],(b,c,d,e,f,g,
|
|
592
|
+
h)=>{e=g?olympe.dc.db.bf.C.Uk: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)});D(a,olympe.dc.db.R.Qk,olympe.dc.ib,olympe.dc.db.R.Ca,olympe.dc.db.R.bj);E(a,olympe.dc.db.R.ai,[olympe.dc.db.R.Ha],b=>b.ax);D(a,olympe.dc.db.R.Ha,olympe.dc.db.us,olympe.dc.db.R.Ca,olympe.dc.db.R.bj,olympe.dc.db.R.Qk,new olympe.W.ka(olympe.dc.U.Df),new olympe.W.ka(olympe.dc.db.U.ai))},'olympe.dc.db');
|
|
593
|
+
olympe.W.run([olympe.dc.db.R.bj,olympe.dc.db.R.ai],(a,b)=>{olympe.fe().db=a;olympe.fe().dbMonitor=b},'DC.DB debug service injection');olympe.dc.query={};function Qg(a){return(b,c)=>{const d=null===b,e=null===c;return d||e?d&&e?0:d?1:-1:a(b,c)}}
|
|
594
|
+
olympe.dc.query.Ye=class{constructor(a,b,c){this.db=olympe.dc.ja();this.C=a;this.La=b;this.Zh=c}ha(){return{p:this.La.X(),o:this.Zh}}toString(){return'sortByQueryPart-'+this.Zh+this.La.X()}Cg(){const a=this.db.Ib(this.La,olympe.dm.Property.typeRel),b=olympe.dc.ga;if(a===b(olympe.dm.String))return Qg((c,d)=>c.localeCompare(d));if(a===b(olympe.dm.Number)||a===b(olympe.dm.Boolean))return Qg((c,d)=>c-d);if(a===b(olympe.dm.DateTime))return Qg((c,d)=>c.getTime()-d.getTime());olympe.ma.eb('dc.query').warn(`No comparator found for type with tag ${a}`);
|
|
595
|
+
return Qg(()=>-1)}Ja(){return this.La}};function Rg(a,b){return new olympe.dc.query.ld((new olympe.dc.transaction.yj(b)).C(a),b)}olympe.dc.query.ld=class{constructor(a,b){this.C=a;this.source=b}static yi(a){return new olympe.dc.query.ld(new olympe.dc.db.Qc(`DataResult_${a.V()}`),a.xb())}create(a,b,c){this.C.Lc(a,this.source,c,b);return this}Ea(a,b,c){this.C.Ea(a,b,c,null,null);return this}Wb(){return this.C}ha(){const a=new olympe.dc.transaction.lg;this.C.pd(a);return{s:this.source,p:Sg(a)}}};
|
|
596
|
+
olympe.dc.query.ld.prototype.createRelation=olympe.dc.query.ld.prototype.Ea;olympe.dc.query.ld.prototype.create=olympe.dc.query.ld.prototype.create;olympe.dc.query.ld.fromQuery=olympe.dc.query.ld.yi;olympe.dc.Fe=class{X(){}};olympe.dc.Fe.prototype.getTag=olympe.dc.Fe.prototype.X;olympe.dc.vz=olympe.dc.Fe;function Tg(a){let b;if(null==(b=a.C)?0:b.zh())if(a=a.K,!a.O){let c;null==(c=a.T)||c.call(a)}}function Ug(a,b,c,d,e){Tg(a);let f,g;b?null==(f=a.C)||f.Ea(c,d,e):null==(g=a.C)||g.fc(c,d,e)}
|
|
597
|
+
olympe.dc.query.Mt=class{constructor(a,b,c,d){this.H=a;this.source=b;this.F=c;this.K=d;this.C=this.G=null;this.db=olympe.dc.ja()}watch(a,b){if(this.db.source(a)===this.source){var c=`${this.F}:${a}:notif`;Ke(this.db,a,(d,e)=>{if(d){Tg(this);let f;null==(f=this.C)||f.ba(e)}else if(b&&cg(this.db,e,c),!this.db.Fa(e)){Tg(this);let f;null==(f=this.C)||f.F(e,olympe.dc.cc.NONE)}},c);b&&bg(this.db,a,(d,e,f)=>{Tg(this);let g;f||null!=(g=this.C)&&g.Uc(a,new Map([[d,e]]))},c)}}stop(a){Je(this.db,a,`${this.F}:${a}:notif`)}};olympe.dc.query.zj={ASC:'ASC',DESC:'DESC'};function Vg(a){const b=Wg(a.query),c=new Map;for(let e=b.length;0<=e;e--){const f=0<e?b[e-1].V():a.G,g=0<e?b[e-1].C:'root',h=0<e&&b[e-1].O(),k=a.C.get(f),l=new Set(k.Id()),n=new Map,p=a.K.has(f);let q=p?';':'';if(c.has(f)){const [r,t,u]=c.get(f);c.delete(f);q+=u;r.forEach((w,y)=>{for(const z of k.F(y)){let A;n.set(z,Array.from(w).map(C=>p?`${y};${C}`:C).reduce((C,M)=>C.add(M),null!=(A=n.get(z))?A:new Set))}l.delete(y)});t&&l.forEach(w=>{const y=p?`${w};${u}`:u;for(const z of k.F(w)){let A;n.set(z,
|
|
598
|
+
(null!=(A=n.get(z))?A:new Set).add(y))}})}else l.forEach(r=>{const t=p?`${r};`:'';for(const u of k.F(r))n.has(u)?n.get(u).add(t):n.set(u,(new Set).add(t))});if(0<e&&c.has(g)){const [r,t,u]=c.get(g),w=new Map;n.forEach((y,z)=>{let A;null==(A=r.get(z))||A.forEach(C=>{let M;const K=null!=(M=w.get(z))?M:new Set;y.forEach(ta=>K.add(ta+C));w.set(z,K)});n.delete(z);r.delete(z)});t&&n.forEach((y,z)=>{w.set(z,new Set(Array.from(y).map(A=>A+u)))});b[e-1].O()&&r.forEach((y,z)=>{w.set(z,new Set(Array.from(y).map(A=>
|
|
598
599
|
q+A)))});c.set(g,[w,t&&h,q+u])}else c.set(g,[n,h,q])}let d;a=null==(d=c.get('root'))?void 0:d[0].get('root');return Array.from(null!=a?a:[]).map(e=>e.slice(0,-1).split(';'))}function Xg(a){if(null===a.F){const b={Fb:a.query.Cg(),yd:a.yd,max:a.query.C.max,offset:a.query.C.offset};a.F=olympe.dc.Oa.from(a.Z,Vg(a),b)}return a.F}function Yg(a,b){a.T=b}function Zg(a){if(!a.O){null!==a.F&&(a.Z=a.F);a.F=null;a.O=!0;let b;null==(b=a.T)||b.call(a)}}
|
|
599
|
-
function $g(a,b){let c;return null!=(c=a.C.get(b).Id())?c:[]}function ah(a,b,c){let d,e;return null!=(e=null==(d=a.C.get(c))?void 0:d.has(b))?e:!1}function bh(a,b,c=a.G,d='root'){const e=a.C.get(c);if(!e)return a.H.error('Try to insert result entry to a higher level than possible'),null;const f=!e.has(b);e.G(b,d)&&Zg(a);let g;f&&(null==(g=a.
|
|
600
|
-
function dh(a){a.H.C()&&a.H.debug(`Start sending notifications for query ${a.query.V()}`);const b=new olympe.dc.query.
|
|
601
|
-
function fh(a){a.O=!1;if(null!=(a=a.
|
|
602
|
-
olympe.dc.query.
|
|
603
|
-
this.C.get(b);if(null==b||!b.has(a))return!0;b.remove(a,c)&&Zg(this);if(!b.has(a)){let d;null==(d=this.
|
|
604
|
-
function hh(a){var b=olympe.dc.query.Aa.C.
|
|
605
|
-
a.s,olympe.dc.
|
|
606
|
-
olympe.dc.query.Aa=class{observe(){}
|
|
607
|
-
a,b,!1,c)}static
|
|
608
|
-
return new olympe.dc.query.$.
|
|
609
|
-
olympe.dc.query.Aa.regex=olympe.dc.query.Aa.
|
|
610
|
-
function ih(a,b){var c=b.relation,d=olympe.dm.Relation.originModelRel,e=olympe.dm.Relation.destinationModelRel;d=a.db.
|
|
611
|
-
b.V();for(c=a.G+1;c<a.va.length&&a.va[c].V()!==d;)c++;b=c<a.va.length?a.va:a.va.concat(b);return new olympe.dc.
|
|
612
|
-
function lh(a){const b=0===a.K.size?a.
|
|
613
|
-
olympe.dc.
|
|
614
|
-
b,c){if(!olympe.dc.CloudObject.exists(b))throw new olympe.dc.query.Dd(`Try to create a query from an instance (${a}) with an explicit datatype that does not exist (${b})`);a=olympe.dc.ga(a);c=null!=c?c:olympe.dc.
|
|
615
|
-
a=new olympe.dc.
|
|
616
|
-
b=!1){if(!(a instanceof olympe.dc.Ma.Relation))throw new olympe.dc.query.Dd(`The relation given to follow() is invalid: ${a}`);return ih(this,new olympe.dc.query.va.Qh(jh(this),a,b))}Qf(a,b=!1,c=!1){if(!(a instanceof olympe.dc.Ma.Relation))throw new olympe.dc.query.Dd(`The relation given to followRecursively() is invalid: ${a}`);return ih(this,new olympe.dc.query.va.
|
|
617
|
-
olympe.dc.query.Aa))throw new olympe.dc.query.Dd(`The specified predicate while trying to filter a query is invalid: ${a}`);const b=Array.from(this.va);b[this.G]=b[this.G].filter(a);return new olympe.dc.
|
|
618
|
-
if(!olympe.dc.
|
|
619
|
-
this.va[b].C;for(b--;-1<b&&jh(this,b)!==d;)b--}return new olympe.dc.
|
|
620
|
-
this.C.yd!==e&&delete g.sort;if(1>=e&&d instanceof olympe.dc.query.va.Qh&&d.relation.Ka(olympe.dc.CloudObject.instancesRel))Object.assign(c,g);else if(0===e&&d instanceof olympe.dc.query.va.
|
|
621
|
-
a.cacheId}).then(d=>{let e;return null!=(e=null==d?void 0:Xg(d))?e:olympe.dc.Oa.empty()})}
|
|
622
|
-
a.toString()).join()+Array.from(new Set(this.K)).sort().toString()+this.C.yd+this.C.max+this.C.offset));return this.id}xb(){return this.source}ha(){let a;return{b:this.F,p:this.va.map(b=>b.ha()),r:Array.from(this.K),s:this.source,e:{m:this.C.max,o:this.C.offset,s:this.C.yd,rm:null!=(a=this.C.
|
|
623
|
-
olympe.dc.
|
|
624
|
-
olympe.dc.
|
|
625
|
-
function nh(a,b,c,d,e,f){const g=b.V();let h=a.F.get(g);if(!h){var k=b.xb();a.H.debug(`Create new subscription for query ${g} for subscriber ${d}, to be executed by the data source ${k}`);k=a.K&&k===olympe.dc.Pa.SERVER?[]:Array.from(a.F.values());h=new olympe.dc.query.
|
|
600
|
+
function $g(a,b){let c;return null!=(c=a.C.get(b).Id())?c:[]}function ah(a,b,c){let d,e;return null!=(e=null==(d=a.C.get(c))?void 0:d.has(b))?e:!1}function bh(a,b,c=a.G,d='root'){const e=a.C.get(c);if(!e)return a.H.error('Try to insert result entry to a higher level than possible'),null;const f=!e.has(b);e.G(b,d)&&Zg(a);let g;f&&(null==(g=a.ye)||g.watch(b,a.K.has(c)));return f}function ch(a,b,c,d,e,f){null!==a.ye&&(d===olympe.dc.ua.ORIGIN?Ug(a.ye,b,c,f,e):Ug(a.ye,b,c,e,f))}
|
|
601
|
+
function dh(a){a.H.C()&&a.H.debug(`Start sending notifications for query ${a.query.V()}`);const b=new olympe.dc.query.Mt(a.H,a.query.xb(),a.query.V(),a);a.C.forEach((c,d)=>{for(const e of c.Id())b.watch(e,a.K.has(d))});null!=b.C||(b.C=new olympe.dc.db.Qc);a.ye=b}function eh(a){null!==a.ye&&(a.H.C()&&a.H.debug(`Stop sending notifications for query ${a.query.V()}`),a.C.forEach(b=>{for(const c of b.Id())a.ye.stop(c)}),a.ye=null)}
|
|
602
|
+
function fh(a){a.O=!1;if(null!=(a=a.ye)){let b;const c=!(null==(b=a.C)?0:b.zh());a.G=c?a.C:null;c&&(a.C=new olympe.dc.db.Qc,a.H.C()&&a.H.debug(`Commit notification with ${a.G.K()} operations for query ${a.F}`))}}
|
|
603
|
+
olympe.dc.query.Lp=class{constructor(a,b){this.H=a;this.query=b;this.G=olympe.Y.sb(b.F);this.va=new Map;this.C=(new Map).set(this.G,new olympe.dc.query.va.Pl);this.K=new Set(b.K);this.yd=-1;this.O=!1;this.T=null;this.Z=olympe.dc.Oa.empty();this.ye=this.F=null;a=Wg(b);a.forEach(c=>{const d=c.V();this.va.set(d,c.K());this.C.set(d,c.oa())});b=b.Cg();if(null!==b){b=b.C;let c=-1;for(const d of[this.G].concat(a.map(e=>e.V())))if(c+=this.K.has(d)?1:0,b===d){this.yd=c;break}}}remove(a,b=this.G,c='root'){b=
|
|
604
|
+
this.C.get(b);if(null==b||!b.has(a))return!0;b.remove(a,c)&&Zg(this);if(!b.has(a)){let d;null==(d=this.ye)||d.stop(a);return!0}return!1}Dc(a){const b=a.F,c=olympe.Y.sb(b);a=Wg(a);const d=[];for(const [f,g]of this.C){if(g.O(b))return!0;g.has(b)&&d.push(f)}const e=(new Map).set(c,d);return 0<d.length&&a.every(f=>{let g;const h=(null!=(g=e.get(f.C))?g:[]).flatMap(k=>f.Z(k,this.va.get(k))).filter(k=>{let l,n;return null!=(n=null==(l=this.va.get(k))?void 0:l.Dc(f))?n:!1});e.set(f.V(),h);return 0<h.length})}};function gh(a){if(!olympe.dc.ja().tc(a,olympe.dm.Property))throw new olympe.dc.query.Dd(`The specified property while trying to build a query predicate is invalid: ${a}`);}
|
|
605
|
+
function hh(a){var b=olympe.dc.query.Aa.C.Aq;const c=olympe.dc.query.Aa.C.no,d=olympe.dc.query.Aa.C.$i,e=olympe.dc.query.Aa.C.Ro,f=olympe.dc.query.Aa.C.pp,g=olympe.dc.query.Aa.C.Up,h=olympe.dc.query.Aa.C.dn,k=olympe.dc.query.Aa.C.Ap;switch(a.pr){case b:return new olympe.dc.query.$.Ul(a.t);case c:b=a.v;switch(a.t){case 2:b=new Date(b);break;case 3:b=olympe.dc.CloudObject.get(b);break;case 4:b=olympe.D.Color.create(b.r,b.g,b.b,b.a)}return new olympe.dc.query.$.oe(a.p,b,olympe.dc.ja());case d:return new olympe.dc.query.$.Ze(a.p,
|
|
606
|
+
a.s,olympe.dc.ja(),a.c);case e:return new olympe.dc.query.$.Wh(olympe.dc.ja(),a.p,a.b,a.l,a.s);case f:return new olympe.dc.query.$.Yd(hh(a.v));case g:return new olympe.dc.query.$.hf(a.p,new RegExp(a.r),olympe.dc.ja(),a.c);case k:return new olympe.dc.query.$.se(...a.p.map(l=>hh(l)));case h:return new olympe.dc.query.$.zd(...a.p.map(l=>hh(l)));default:return null}}
|
|
607
|
+
olympe.dc.query.Aa=class{observe(){}kb(){}compile(){return[[this]]}jd(){return new olympe.dc.query.$.Yd(this)}Cb(){}Dc(){}clear(){}ha(){}Ic(){}toString(){}Ka(a){return this===a}static Nw(...a){return new olympe.dc.query.$.Ul(a)}static Ka(a,b){gh(a);return new olympe.dc.query.$.oe(a,b,olympe.dc.ja())}static contains(a,b,c=!0){gh(a);return new olympe.dc.query.$.Ze(a,b,olympe.dc.ja(),c)}static Bx(a,b,c=!0){gh(a);return new olympe.dc.query.$.hf(a,b,olympe.dc.ja(),c)}static ik(a,b,c=!0){gh(a);return new olympe.dc.query.$.Wh(olympe.dc.ja(),
|
|
608
|
+
a,b,!1,c)}static Ri(a,b,c=!0){gh(a);return new olympe.dc.query.$.Wh(olympe.dc.ja(),a,b,!0,c)}static and(...a){if(!a.every(b=>b instanceof olympe.dc.query.Aa))throw new olympe.dc.query.Dd(`Some specified predicates, while trying to build an AND query predicate are invalid: ${a}`);return new olympe.dc.query.$.zd(...a)}static or(...a){if(!a.every(b=>b instanceof olympe.dc.query.Aa))throw new olympe.dc.query.Dd(`Some specified predicates, while trying to build an OR query predicate are invalid: ${a}`);
|
|
609
|
+
return new olympe.dc.query.$.se(...a)}static jd(a){if(!(a instanceof olympe.dc.query.Aa))throw new olympe.dc.query.Dd(`The specified predicate, while trying to build a NOT query predicate is invalid: ${a}`);return new olympe.dc.query.$.Yd(a)}};olympe.dc.query.Aa.not=olympe.dc.query.Aa.jd;olympe.dc.query.Aa.or=olympe.dc.query.Aa.or;olympe.dc.query.Aa.and=olympe.dc.query.Aa.and;olympe.dc.query.Aa.smallerThan=olympe.dc.query.Aa.Ri;olympe.dc.query.Aa.greaterThan=olympe.dc.query.Aa.ik;
|
|
610
|
+
olympe.dc.query.Aa.regex=olympe.dc.query.Aa.Bx;olympe.dc.query.Aa.contains=olympe.dc.query.Aa.contains;olympe.dc.query.Aa.equals=olympe.dc.query.Aa.Ka;olympe.dc.query.Aa['in']=olympe.dc.query.Aa.Nw;olympe.dc.query.Aa.C={Aq:0,no:1,$i:2,Ro:3,pp:4,Up:5,Ap:6,dn:7};function Wg(a){return Array.from(a.va)}
|
|
611
|
+
function ih(a,b){var c=b.relation,d=olympe.dm.Relation.originModelRel,e=olympe.dm.Relation.destinationModelRel;d=a.db.Ib(c,c.Ga()===olympe.dc.ua.ORIGIN?e:d);if(0>a.G)e=a.C.ze;else if(e=a.va[a.G],null!==e.fa)e=e.fa;else{var f=olympe.dc.ua.ORIGIN;e=olympe.dc.ja().Ib(e.relation,e.relation.Ga()===f?olympe.dm.Relation.originModelRel:olympe.dm.Relation.destinationModelRel)}if(null===d||!a.db.Ig(d,e)&&!a.db.Ig(e,d))throw new olympe.dc.query.Dd(`The specified relation (${c}) is invalid at the current level (type: ${e}) of the Query you are building. Please make sure you did not forget a .back() or another relation.`);d=
|
|
612
|
+
b.V();for(c=a.G+1;c<a.va.length&&a.va[c].V()!==d;)c++;b=c<a.va.length?a.va:a.va.concat(b);return new olympe.dc.pa(a.F,a.source,b,c,a.K,a.C)}function jh(a,b=a.G){return 0<=b?a.va[b].V():olympe.Y.sb(a.F)}function kh(a,b,c,d={}){var e=olympe.dc.cc.Kf;const f=(null==d?0:d.Kd)?d.Kd:olympe.dc.pa.Rc.Cf;d=(null==d?0:d.Ym)?'__code-as-data__':void 0;b=olympe.dc.ga(b);const g=olympe.dc.Rd().we(b);b=(new olympe.dc.pa(b,g)).be();b.va=[new olympe.dc.query.va.Wd(jh(b),e,c)];return b.observe(a,{Kd:f,Zj:d})}
|
|
613
|
+
function lh(a){const b=0===a.K.size?a.be():a;if(null!==b.C.yd&&!b.K.has(jh(a,b.C.yd)))throw new olympe.dc.query.Dd('AndReturn was not called for the current level before sortBy operator');return b}
|
|
614
|
+
olympe.dc.pa=class{constructor(a,b,c=[],d=-1,e=new Set,f={max:-1,offset:0,yd:null,ze:null}){this.db=olympe.dc.ja();this.F=a;this.source=b;this.va=c;this.G=d;this.K=e;this.C=f;this.id=null}static from(a,b){a=olympe.dc.ga(a);if(!olympe.dc.CloudObject.exists(a))throw new olympe.dc.query.Dd(`Try to create a query from an instance that does not exist (${a}). Please try to use \`Query.fromTag()\` instead.`);b=null!=b?b:olympe.dc.Rd().we(a);b=new olympe.dc.pa(a,b);b.C.ze=olympe.dc.ja().model(a);return b}static we(a,
|
|
615
|
+
b,c){if(!olympe.dc.CloudObject.exists(b))throw new olympe.dc.query.Dd(`Try to create a query from an instance (${a}) with an explicit datatype that does not exist (${b})`);a=olympe.dc.ga(a);c=null!=c?c:olympe.dc.Rd().fromModel(b);c=new olympe.dc.pa(a,c);c.C.ze=olympe.dc.ga(b);return c}static kk(a,b=!0,c){const d=olympe.dc.ga(a);var e=olympe.dc.ja();if(!e.Bh(d))throw new olympe.dc.query.Dd(`Try to create a query to get instances of ${a}, which is not a data type or does not exist.`);a=null!=c?c:olympe.dc.Rd().fromModel(d);
|
|
616
|
+
a=new olympe.dc.pa(d,a);a.C.ze=e.model(d);b&&(a=ih(a,new olympe.dc.query.va.If(jh(a),olympe.dc.CloudObject.extendedByRel,!0,!1)));b=a;e=new olympe.dc.query.va.Qh(jh(a),olympe.dc.CloudObject.instancesRel,!1);e.fa=d;return ih(b,e)}static hc(a,b,c,d,e){const f=(null==e?0:e.Kd)?e.Kd:olympe.dc.pa.Rc.Cf;e=(null==e?0:e.Ym)?'__code-as-data__':void 0;b=olympe.dc.ga(b);d=null!=d?d:olympe.dc.Rd().we(b);d=(new olympe.dc.pa(b,d)).be();d.va=[new olympe.dc.query.va.Wd(jh(d),c)];return d.observe(a,{Kd:f,Zj:e})}cb(a,
|
|
617
|
+
b=!1){if(!(a instanceof olympe.dc.Ma.Relation))throw new olympe.dc.query.Dd(`The relation given to follow() is invalid: ${a}`);return ih(this,new olympe.dc.query.va.Qh(jh(this),a,b))}Qf(a,b=!1,c=!1){if(!(a instanceof olympe.dc.Ma.Relation))throw new olympe.dc.query.Dd(`The relation given to followRecursively() is invalid: ${a}`);return ih(this,new olympe.dc.query.va.If(jh(this),a,b,c))}be(){const a=(new Set(this.K)).add(jh(this));return new olympe.dc.pa(this.F,this.source,this.va,this.G,a,this.C)}filter(a){if(!(a instanceof
|
|
618
|
+
olympe.dc.query.Aa))throw new olympe.dc.query.Dd(`The specified predicate while trying to filter a query is invalid: ${a}`);const b=Array.from(this.va);b[this.G]=b[this.G].filter(a);return new olympe.dc.pa(this.F,this.source,b,this.G,this.K,this.C)}vi(){return this}Ji(a,b=0){return new olympe.dc.pa(this.F,this.source,this.va,this.G,this.K,{yd:this.C.yd,max:a,offset:b,ze:this.C.ze})}tk(a,b=olympe.dc.query.zj.ASC){if(0>this.G)throw new olympe.dc.query.Dd('You are trying to sort an empty query. Please first follow at least one relation to sort a query.');
|
|
619
|
+
if(!olympe.dc.ja().tc(a,olympe.dm.Property))throw new olympe.dc.query.Dd(`The specified property while trying to sort a query is invalid: ${a}`);const c=this.va[this.G],d={yd:this.G,max:this.C.max,offset:this.C.offset,ze:this.C.ze},e=Array.from(this.va);e[this.G]=c.sort(a,b);return new olympe.dc.pa(this.F,this.source,e,this.G,this.K,d)}Cg(){const a=this.C.yd;let b;return null!==a?null==(b=this.va[a])?void 0:b.Cg():null}back(a=1){if(0>this.G||1>a)return this;let b=this.G;for(let c=0;c<a;c++){const d=
|
|
620
|
+
this.va[b].C;for(b--;-1<b&&jh(this,b)!==d;)b--}return new olympe.dc.pa(this.F,this.source,Array.from(this.va),b,this.K,this.C)}parse(){const a=new Map,b=jh(this,-1),c={limit:this.C.max,offset:this.C.offset,returned:this.K.has(b),filter:[],optional:!1,inheritance:!1,next:[]};a.set(b,c);this.db.Bh(this.F)?c.dataType=olympe.dc.ga(this.F):(c.root=olympe.dc.ga(this.F),c.dataType=this.C.ze);this.va.forEach((d,e)=>{const f=d.V(),g=d.Ic();Object.assign(g,{returned:this.K.has(f),next:[]});a.set(f,g);g.sort&&
|
|
621
|
+
this.C.yd!==e&&delete g.sort;if(1>=e&&d instanceof olympe.dc.query.va.Qh&&d.relation.Ka(olympe.dc.CloudObject.instancesRel))Object.assign(c,g);else if(0===e&&d instanceof olympe.dc.query.va.If&&d.relation.Ka(olympe.dc.CloudObject.extendedByRel))Object.assign(c,g),c.inheritance=!0;else{let h;null==(h=a.get(d.C))||h.next.push(g)}});return c}kb(a){const b=(null==a?0:a.Kd)?a.Kd:olympe.dc.pa.Rc.Gl;let c;return olympe.dc.query.hk().executeQuery(lh(this),b,{ph:null!=(c=null==a?void 0:a.Zj)?c:null==a?void 0:
|
|
622
|
+
a.cacheId}).then(d=>{let e;return null!=(e=null==d?void 0:Xg(d))?e:olympe.dc.Oa.empty()})}hd(){return Xg(mh(olympe.dc.query.hk(),lh(this)))}observe(a,b){const c=(null==b?0:b.Kd)?b.Kd:olympe.dc.pa.Rc.Cf;a='function'===typeof a.F?a.F():a;let d;return nh(olympe.dc.query.hk(),lh(this),a,olympe.dc.Pa.SELF,c,{ph:null!=(d=null==b?void 0:b.Zj)?d:null==b?void 0:b.cacheId}).pipe(rxjs.operators.map(e=>Xg(e)),rxjs.operators.distinctUntilChanged())}V(){null===this.id&&(this.id=olympe.Y.sb(this.F+Wg(this).map(a=>
|
|
623
|
+
a.toString()).join()+Array.from(new Set(this.K)).sort().toString()+this.C.yd+this.C.max+this.C.offset));return this.id}xb(){return this.source}ha(){let a;return{b:this.F,p:this.va.map(b=>b.ha()),r:Array.from(this.K),s:this.source,e:{m:this.C.max,o:this.C.offset,s:this.C.yd,rm:null!=(a=this.C.ze)?a:this.db.model(this.F)}}}toString(){return`Query: ${JSON.stringify(this)}`}toJSON(){return{origin:this.db.Fa(this.F)?olympe.dc.CloudObject.get(this.F):this.F,relations:this.va.map(a=>a.toJSON())}}};
|
|
624
|
+
olympe.dc.pa.prototype.observe=olympe.dc.pa.prototype.observe;olympe.dc.pa.prototype.executeFromCache=olympe.dc.pa.prototype.hd;olympe.dc.pa.prototype.execute=olympe.dc.pa.prototype.kb;olympe.dc.pa.prototype.parse=olympe.dc.pa.prototype.parse;olympe.dc.pa.prototype.back=olympe.dc.pa.prototype.back;olympe.dc.pa.prototype.sortBy=olympe.dc.pa.prototype.tk;olympe.dc.pa.prototype.limit=olympe.dc.pa.prototype.Ji;olympe.dc.pa.prototype.cast=olympe.dc.pa.prototype.vi;olympe.dc.pa.prototype.filter=olympe.dc.pa.prototype.filter;
|
|
625
|
+
olympe.dc.pa.prototype.andReturn=olympe.dc.pa.prototype.be;olympe.dc.pa.prototype.followRecursively=olympe.dc.pa.prototype.Qf;olympe.dc.pa.prototype.follow=olympe.dc.pa.prototype.cb;olympe.dc.pa.followRule=olympe.dc.pa.hc;olympe.dc.pa.instancesOf=olympe.dc.pa.kk;olympe.dc.pa.fromTag=olympe.dc.pa.we;olympe.dc.pa.from=olympe.dc.pa.from;olympe.dc.pa.Rc={Cf:1,Gl:2,Hl:3};olympe.dc.pa.C={Ik:'cacheBucketName',Xo:'isCacheable'};function mh(a,b){const c=new olympe.dc.query.Lp(a.H,b);if(a.C.view.Fa(b.F)){bh(c,b.F);for(const d of Wg(b))d.kb(c)}return c}
|
|
626
|
+
function nh(a,b,c,d,e,f){const g=b.V();let h=a.F.get(g);if(!h){var k=b.xb();a.H.debug(`Create new subscription for query ${g} for subscriber ${d}, to be executed by the data source ${k}`);k=a.K&&k===olympe.dc.Pa.SERVER?[]:Array.from(a.F.values());h=new olympe.dc.query.Rp(a.H,a.C,b,a.O.bind(a,e,null!=f?f:{}));a.F.set(g,h);oh(h,l=>a.G.add(l));h.start(k)&&(null==f?0:f.ph)&&ph(a,b,e,f).catch(l=>{a.H.error(`Was not able to get the result of the subscribed query ${g} to add it to the cache: ${l}`)})}return new rxjs.Observable(l=>
|
|
626
627
|
{const n=()=>{p&&c.qf(p);l.complete();if(q){var r=q;const u=a.F.get(g);a.H.debug(`${d} unsubscribed from ${g}`);if(null==u)r=0;else{var t=u;t.G.delete(r)&&t.H.debug(`Remove subscriber ${d} for query ${t.query.V()}, now have ${t.G.size} subscribers`);d!==olympe.dc.Pa.SELF&&(t.Z--,0===t.Z&&eh(t.C));r=0===t.G.size}r&&(a.H.debug(`No more subscriber to ${g}, remove the subscription`),a.G.delete(g),a.F.delete(g),u.destroy())}},p=c.Z(n),q=qh(h,d,l);return n})}
|
|
627
|
-
function rh(a){a.G.forEach(b=>{let c;null==(c=a.F.get(b))||sh(c)});a.G.clear()}function th(a){a.H.debug('Send GetContext request to the orchestrator');const b=new olympe.dc.Request(olympe.dc.Request.C.
|
|
628
|
-
function uh(a,b){const c=b.xb();if(c===olympe.dc.Pa.SELF||a.K&&c===olympe.dc.Pa.SERVER)return Promise.resolve(!0);a=Array.from(a.F.values()).filter(d=>d.
|
|
629
|
-
function vh(a,b,c){const d=[];for(const e of a.F.values())wh(e,b,c)&&d.push(ph(a,e.query,olympe.dc.
|
|
630
|
-
olympe.dc.query.
|
|
631
|
-
f===olympe.dc.Pa.SERVER)return d(),null;if(a!==olympe.dc.
|
|
632
|
-
t.forEach(u=>this.C.
|
|
633
|
-
q=>{this.H.error(`An error occurred with the subscription ${l}: ${q}`);e(String(q))}));return()=>{h=!0;this.H.debug(`Unsubscribe to query ${l} from data source ${f}`);p.unsubscribe()}}};function Re(a){return a.K.map(b=>{b=b.split('.');return 1===b.length?b[0]:b})}function Se(a){return a.G.map(b=>a.F.get(a.C[b]))}function xh(a){const b=olympe.dc.
|
|
634
|
-
olympe.dc.Oa=class{constructor(){this.C=[];this.F=new Map;this.G=[];this.K=[];this.hash=''}static empty(){return new olympe.dc.Oa}[Symbol.iterator](){let a=0;return{next:()=>{var b={done:!0};a<this.C.length&&(b=this.C[a],b={value:[b,this.F.get(b)],done:!1},a++);return b}}}entries(){return this.C.map(a=>[a,this.F.get(a)])}values(){return this.F.values()}keys(){return this.C.values()}
|
|
635
|
-
a||void 0===a?-1:'string'===typeof a?this.C.indexOf(a):this.
|
|
636
|
-
a(this.F.get(b),c))}map(a){return this.
|
|
637
|
-
b,{Fb:c,yd:d,offset:e,max:f}={}){if(null!==c&&-1<d){const p=olympe.dc.
|
|
638
|
-
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.Oa.create(e,l,n,c)}static create(a,b,c,d){const e=new olympe.dc.Oa;e.C=a.map(f=>f[0]);e.F=new Map(a);e.hash=d||olympe.Y.
|
|
639
|
-
olympe.dc.Oa.prototype.sort=olympe.dc.Oa.prototype.sort;olympe.dc.Oa.prototype.map=olympe.dc.Oa.prototype.map;olympe.dc.Oa.prototype.forEach=olympe.dc.Oa.prototype.forEach;olympe.dc.Oa.prototype.find=olympe.dc.Oa.prototype.find;olympe.dc.Oa.prototype.filter=olympe.dc.Oa.prototype.filter;olympe.dc.Oa.prototype.shift=olympe.dc.Oa.prototype.shift;olympe.dc.Oa.prototype.pop=olympe.dc.Oa.prototype.pop;olympe.dc.Oa.prototype.push=olympe.dc.Oa.prototype.push;olympe.dc.Oa.prototype.getAt=olympe.dc.Oa.prototype.
|
|
640
|
-
olympe.dc.Oa.prototype.getFirst=olympe.dc.Oa.prototype.
|
|
641
|
-
olympe.dc.Oa.empty=olympe.dc.Oa.empty;function yh(a){return 1<a.size()?(olympe.
|
|
642
|
-
olympe.dc
|
|
643
|
-
function wh(a,b,c){if(a.query.xb()!==b)return!1;c.pd(a.fa);(b=a.fa.flush())&&a.H.debug(`Subscription ${a.query.V()} is considered as obsolete after the transaction ${c.V()} applied on DB`);return b}function sh(a){fh(a.C);a.G.forEach(b=>{b.next(a.C)})}function Bh(a,b,c){const d=[];let e=!1;const f=new olympe.async.
|
|
644
|
-
function Ch(a){const b=a.query.V(),c=new Map,d=q=>{const r=c.get(q);return r?1===r.size?Array.from(r)[0]:(t,u,w,y)=>r.forEach(z=>z(t,u,w,y)):()=>{}},e=Wg(a.query),f=a.C;for(let q=e.length-1;0<=q;q--){var g=e[q];const r=g.V(),t=g.C;g=g.observe(f,d(r));let u;c.set(t,(null!=(u=c.get(t))?u:new Set).add(g))}const h=a.db,k=a.query.F,l=olympe.Y.
|
|
645
|
-
function Eh(a){const b=a.
|
|
646
|
-
olympe.dc.query.
|
|
647
|
-
a.F)&&this.C.
|
|
628
|
+
function rh(a){a.G.forEach(b=>{let c;null==(c=a.F.get(b))||sh(c)});a.G.clear()}function th(a){a.H.debug('Send GetContext request to the orchestrator');const b=new olympe.dc.Request(olympe.dc.Request.C.eg,olympe.dc.Pa.SERVER);return a.Xb.request(b).then(c=>{a.C.Gc(c.Wb())})}
|
|
629
|
+
function uh(a,b){const c=b.xb();if(c===olympe.dc.Pa.SELF||a.K&&c===olympe.dc.Pa.SERVER)return Promise.resolve(!0);a=Array.from(a.F.values()).filter(d=>d.Dc(b)).map(d=>new Promise(e=>d.vd(f=>e(!f))));return Promise.all(a).then(d=>d.some(e=>e))}function ph(a,b,c,d){return v(function*(){var e=b.xb();e=Oe(Oe(new olympe.dc.Request(olympe.dc.Request.C.ng,e,b),olympe.dc.pa.C.Xo,c===olympe.dc.pa.Rc.Hl),olympe.dc.pa.C.Ik,null==d?void 0:d.ph);return a.Xb.request(e)})}
|
|
630
|
+
function vh(a,b,c){const d=[];for(const e of a.F.values())wh(e,b,c)&&d.push(ph(a,e.query,olympe.dc.pa.Rc.Gl).then(f=>{a.C.Gc(f.Wb())}));return Promise.all(d).then()}
|
|
631
|
+
olympe.dc.query.du=class{constructor(a,b,c,d){this.H=a;this.C=b;this.Xb=c;this.K=d;this.F=new Map;this.G=new Set;Mf(b,()=>rh(this));Ue(c,olympe.dc.Request.C.Zn,e=>{this.C.Gc(e.content)})}executeQuery(a,b,c){const d=this;return v(function*(){const e=yield uh(d,a);if(!e||(null==c?0:c.ph))try{const f=yield ph(d,a,b,c);e||d.C.Gc(f.Wb())}catch(f){return d.H.error(`Error while sending a query to data source ${a.xb()}: ${f}`),null}return mh(d,a)})}O(a,b,c,d,e){const f=c.xb();if(f===olympe.dc.Pa.SELF||this.K&&
|
|
632
|
+
f===olympe.dc.Pa.SERVER)return d(),null;if(a!==olympe.dc.pa.Rc.Cf)return ph(this,c,a,b).then(q=>{this.C.Gc(q.Wb());d()}).catch(e),null;let g,h=!1;const k=q=>{g=[];q&&this.H.debug(`Resend subscription ${c.V()} after detection of dead subscription in the remote service`);ph(this,c,a,b).then(r=>{if(h)this.H.warn(`Received data result after query subscription ${c.V()} has been destroyed. Could happen with queries observed multiple times successively quickly.`);else{this.C.Gc(r.Wb());let t;null==(t=g)||
|
|
633
|
+
t.forEach(u=>this.C.Gc(u));g=null}d()}).catch(e)},l=c.V();k(!1);const n=Oe(new olympe.dc.Request(olympe.dc.Request.C.Dj,f,c),olympe.dc.pa.C.Ik,null==b?void 0:b.ph),p=Te(this.Xb,n,k.bind(this,!0)).pipe(olympe.N.operators.Oi(olympe.N.errors.Jo,()=>{},0)).pipe(olympe.N.operators.Oi(olympe.N.errors.Fn,(q,r)=>{this.H.debug(`Data Provider: Subscribe to topic ${q.V()} now that we are back online, after waiting for ${r}ms`);k(!0)},0)).subscribe(rxjs.Subscriber.create(q=>{Array.isArray(g)?g.push(q):this.C.Gc(q)},
|
|
634
|
+
q=>{this.H.error(`An error occurred with the subscription ${l}: ${q}`);e(String(q))}));return()=>{h=!0;this.H.debug(`Unsubscribe to query ${l} from data source ${f}`);p.unsubscribe()}}};function Re(a){return a.K.map(b=>{b=b.split('.');return 1===b.length?b[0]:b})}function Se(a){return a.G.map(b=>a.F.get(a.C[b]))}function xh(a){const b=olympe.dc.ja();let c=!1;const d=a.k.map(e=>{const f=e.split('.').map(g=>b.Fa(g)?olympe.dc.CloudObject.get(g):(olympe.ma.eb('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.Oa.create(d,a.a,a.r)}
|
|
635
|
+
olympe.dc.Oa=class{constructor(){this.C=[];this.F=new Map;this.G=[];this.K=[];this.hash=''}static empty(){return new olympe.dc.Oa}[Symbol.iterator](){let a=0;return{next:()=>{var b={done:!0};a<this.C.length&&(b=this.C[a],b={value:[b,this.F.get(b)],done:!1},a++);return b}}}entries(){return this.C.map(a=>[a,this.F.get(a)])}values(){return this.F.values()}keys(){return this.C.values()}Ae(){return this.C.map(a=>this.F.get(a))}size(){return this.C.length}has(a){return this.F.has(a)||this.Ae().includes(a)}indexOf(a){return null===
|
|
636
|
+
a||void 0===a?-1:'string'===typeof a?this.C.indexOf(a):this.Ae().indexOf(a)}get(a){return(a=this.F.get(a))?a:null}xc(){return this.de(0)}de(a){return a<this.C.length?this.F.get(this.C[a]):null}push(...a){const b=this.Ae();b.push(...a);return b}pop(){if(0===this.C.length)return[];const a=this.Ae();a.pop();return a}shift(){if(0<this.C.length){const a=this.Ae();a.shift();return a}return[]}filter(a){return this.Ae().filter(a)}find(a){return(a=this.Ae().find(a))?a:null}forEach(a){this.C.forEach((b,c)=>
|
|
637
|
+
a(this.F.get(b),c))}map(a){return this.Ae().map(a)}sort(a){const b=this.entries().sort((c,d)=>a(c[1],d[1]));return olympe.dc.Oa.create(b,Array.from(this.G),Array.from(this.K))}reduce(a,b){return this.Ae().reduce(a,b)}concat(...a){const b=[this.entries(),...a.map(d=>d.entries())].flat();let c=Array.from(this.G);for(const d of a)c=c.concat(d.G.map(e=>e+c.length));a=this.K.concat(...a.map(d=>d.K));return olympe.dc.Oa.create(b,c,a)}toString(){return`QueryResult: ${JSON.stringify(this)}`}toJSON(){return this.Ae()}static from(a,
|
|
638
|
+
b,{Fb:c,yd:d,offset:e,max:f}={}){if(null!==c&&-1<d){const p=olympe.dc.ja(),q=c.Zh===olympe.dc.query.zj.ASC?1:-1,r=c.Cg(),t=c.Ja();b.sort((u,w)=>{w=w[d];u=p.Ja(u[d],t);w=p.Ja(w,t);return null===u?-q:null===w?q:q*r(u,w)})}else b.sort((p,q)=>p.reduce((r,t,u)=>r||t.localeCompare(q[u]),0));if(0<e||-1<f)b=b.slice(e,-1<f?e+f:void 0);c=olympe.Y.sb(b.flat().join(''));if(c===a.hash)return a;const g=p=>''===p?null:olympe.dc.CloudObject.get(p);e=b.map(p=>[p.join('.'),1===p.length?g(p[0]):p.map(g)]);const h=new Set(e.map(p=>
|
|
639
|
+
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.Oa.create(e,l,n,c)}static create(a,b,c,d){const e=new olympe.dc.Oa;e.C=a.map(f=>f[0]);e.F=new Map(a);e.hash=d||olympe.Y.sb(e.C.join(''));e.G=b||e.C.map((f,g)=>g);e.K=c||[];return e}ha(a){a&&this.C.flatMap(b=>b.split('.')).forEach(a);return{k:this.C,a:this.G,r:this.K}}};olympe.dc.Oa.prototype.concat=olympe.dc.Oa.prototype.concat;olympe.dc.Oa.prototype.reduce=olympe.dc.Oa.prototype.reduce;
|
|
640
|
+
olympe.dc.Oa.prototype.sort=olympe.dc.Oa.prototype.sort;olympe.dc.Oa.prototype.map=olympe.dc.Oa.prototype.map;olympe.dc.Oa.prototype.forEach=olympe.dc.Oa.prototype.forEach;olympe.dc.Oa.prototype.find=olympe.dc.Oa.prototype.find;olympe.dc.Oa.prototype.filter=olympe.dc.Oa.prototype.filter;olympe.dc.Oa.prototype.shift=olympe.dc.Oa.prototype.shift;olympe.dc.Oa.prototype.pop=olympe.dc.Oa.prototype.pop;olympe.dc.Oa.prototype.push=olympe.dc.Oa.prototype.push;olympe.dc.Oa.prototype.getAt=olympe.dc.Oa.prototype.de;
|
|
641
|
+
olympe.dc.Oa.prototype.getFirst=olympe.dc.Oa.prototype.xc;olympe.dc.Oa.prototype.get=olympe.dc.Oa.prototype.get;olympe.dc.Oa.prototype.indexOf=olympe.dc.Oa.prototype.indexOf;olympe.dc.Oa.prototype.has=olympe.dc.Oa.prototype.has;olympe.dc.Oa.prototype.size=olympe.dc.Oa.prototype.size;olympe.dc.Oa.prototype.toArray=olympe.dc.Oa.prototype.Ae;olympe.dc.Oa.prototype.keys=olympe.dc.Oa.prototype.keys;olympe.dc.Oa.prototype.values=olympe.dc.Oa.prototype.values;olympe.dc.Oa.prototype.entries=olympe.dc.Oa.prototype.entries;
|
|
642
|
+
olympe.dc.Oa.empty=olympe.dc.Oa.empty;function yh(a){return 1<a.size()?(olympe.ma.eb('dc').warn(`a follow() on a QuerySingle has ${a.size()} results (0 or 1 expected) -> returns null`),null):a.xc()||null}olympe.dc.ad=class{constructor(a){this.query=a}static from(a){return new olympe.dc.ad(olympe.dc.pa.from(a))}cb(a){return new olympe.dc.ad(this.query.cb(a))}vi(){return this}kb(a){return this.query.kb(a).then(b=>yh(b))}hd(){return yh(this.query.hd())}};olympe.dc.ad.prototype.executeFromCache=olympe.dc.ad.prototype.hd;
|
|
643
|
+
olympe.dc.ad.prototype.execute=olympe.dc.ad.prototype.kb;olympe.dc.ad.prototype.cast=olympe.dc.ad.prototype.vi;olympe.dc.ad.prototype.follow=olympe.dc.ad.prototype.cb;const zh=olympe.dc.ua.ORIGIN,Ah=olympe.dc.ua.DESTINATION;function oh(a,b){Yg(a.C,()=>b(a.query.V()))}function qh(a,b,c){const d=a.ba;a.ba++;a.G.set(d,c);b===olympe.dc.Pa.SELF?a.vd(e=>e?c.error(e):c.next(a.C)):(a.Z++,1===a.Z&&a.vd(()=>dh(a.C)));a.H.debug(`Add subscriber ${b} for query ${a.query.V()}, now have ${a.G.size} subscribers`);return d}
|
|
644
|
+
function wh(a,b,c){if(a.query.xb()!==b)return!1;c.pd(a.fa);(b=a.fa.flush())&&a.H.debug(`Subscription ${a.query.V()} is considered as obsolete after the transaction ${c.V()} applied on DB`);return b}function sh(a){fh(a.C);a.G.forEach(b=>{b.next(a.C)})}function Bh(a,b,c){const d=[];let e=!1;const f=new olympe.async.Aj(olympe.D.Dg());for(const g of b)g.Dc(a.query)&&(e||(e=!0),f.add(h=>g.vd(k=>{!k&&d.push(g);h()})));Bc(f,g=>c(g?d:[]));f.start();return e}
|
|
645
|
+
function Ch(a){const b=a.query.V(),c=new Map,d=q=>{const r=c.get(q);return r?1===r.size?Array.from(r)[0]:(t,u,w,y)=>r.forEach(z=>z(t,u,w,y)):()=>{}},e=Wg(a.query),f=a.C;for(let q=e.length-1;0<=q;q--){var g=e[q];const r=g.V(),t=g.C;g=g.observe(f,d(r));let u;c.set(t,(null!=(u=c.get(t))?u:new Set).add(g))}const h=a.db,k=a.query.F,l=olympe.Y.sb(k),n=Ke(h,k,(q,r)=>{q?bh(f,r):f.remove(r);d(l)(q,r,null,b)});let p;null==(p=a.T)||p.push(()=>{Je(h,k,n)});Dh(a)}
|
|
646
|
+
function Eh(a){const b=a.oa(a.query,()=>{null===a.O||a.hb()||Ch(a)},d=>{a.hb()||(a.H.error(`Error while getting data from data source (${a.query.xb()}) to ensure coverage of the query ${a.query.V()}: ${d}`),Dh(a))});let c;b&&(null==(c=a.T)||c.push(b))}function Fh(a,b){a.K.delete(b);0===a.K.size&&(a.K=null,Promise.resolve().then(()=>{!a.hb()&&Eh(a)}))}function Dh(a){const b=a.O;a.O=null;null==b||b.forEach(c=>c())}
|
|
647
|
+
olympe.dc.query.Rp=class{constructor(a,b,c,d){this.H=a;this.db=b.view;this.query=c;this.C=new olympe.dc.query.Lp(this.H,c);this.Z=0;this.ba=1;this.T=[];this.G=new Map;this.O=[()=>fh(this.C)];this.oa=d;this.fa=new Gh(a,this.db,c,this.C);this.F=this.K=null}start(a){return Bh(this,a,b=>{0<b.length?(this.K=new Set(b),this.K.forEach(c=>{null===c.F&&(c.F=new Set);c.F.add(this)}),Ch(this)):Eh(this)})}Dc(a){return!this.hb()&&this.query.xb()===a.xb()&&(this.query.V()===a.V()||(null===this.O||this.query.F===
|
|
648
|
+
a.F)&&this.C.Dc(a))}vd(a){null!==this.O?this.O.push(a):a();return this}destroy(a){a?this.H.error(`Destroy subscription ${this.query.V()} after error: ${a}`):this.H.debug(`Destroy subscription ${this.query.V()}`);const b=this.T;this.T=null;this.G.forEach(e=>a?e.error(a):e.complete());let c;null==(c=this.F)||c.forEach(e=>Fh(e,this));let d;null==(d=this.K)||d.forEach(e=>{e.F.delete(this);0===e.F.size&&(e.F=null)});b.forEach(e=>e())}hb(){return null===this.T}};
|
|
648
649
|
function Hh(a,b){return a.G.has(Ah+b)||a.G.has(zh+b)}
|
|
649
|
-
class Gh{constructor(a,b,c,d){this.H=a;this.db=b;this.K=d;this.T=[];this.O=-1<c.C.max||0<c.C.offset;this.G=new Map;this.C=!1;const e=new Map;for(const f of Wg(c)){a=f.V();this.T.push(a);if(f instanceof olympe.dc.query.va.fh){a=f.relation;a=`${a.Ga()}${a.X()}`;let g;b=null!=(g=this.G.get(a))?g:[];b.push(f);this.G.set(a,b)}Ih(f).forEach(g=>{let h;const k=null!=(h=e.get(g))?h:[];k.push(f.V());e.set(g,k)})}this.properties=Array.from(e.entries())}flush(){const a=this.C;this.C=!1;return a}
|
|
650
|
-
!this.O&&this.db.Fa(a))){var c;this.C||(this.C=null==(c=this.properties)?void 0:c.some(([d,e])=>b.has(d)&&ah(this.K,a,e)))}}F(a){this.C||this.db.Fa(a)&&!this.O||this.C||(this.C=this.T.some(b=>ah(this.K,a,b)))}Ea(a,b,c){if(!this.C&&Hh(this,a)){var d=this.db.Fa(b),e=this.db.Fa(c);if(d&&!e||!d&&e){const f=this.G.get(Ah+a);a=this.G.get(zh+a);this.C||(this.C=d&&(null==f?void 0:f.some(g=>ah(this.K,b,g.C)))||e&&(null==a?void 0:a.some(g=>ah(this.K,c,g.C))))}}}fc(a,b,c){if(!this.C&&this.O&&Hh(this,a)&&this.db.
|
|
651
|
-
new olympe.dc.Ma.Relation(a),c)){const d=this.G.get(Ah+a);a=this.G.get(zh+a);const e=this.K;this.C||(this.C=(null==d?void 0:d.some(f=>ah(e,b,f.C)&&ah(e,c,f.V())))||(null==a?void 0:a.some(f=>ah(e,c,f.C)&&ah(e,b,f.V()))))}}}olympe.dc.query.
|
|
652
|
-
olympe.dc.query.Relation=class extends olympe.dc.Ma.Relation{constructor(a,b,c){super(a,b);this.recursive=c}toJSON(){let a='{ "tag": '+JSON.stringify(this.X())+', ';a+='"direction": '+JSON.stringify(this.Ga())+', ';a+='"recursive": '+JSON.stringify(this.recursive);return a+'}'}static Ub(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return new olympe.dc.query.Relation(b.tag,b.direction,b.recursive)}static from(a,b){return new olympe.dc.query.Relation(a.X(),a.Ga(),null!=b?b:a instanceof olympe.dc.da.
|
|
653
|
-
olympe.dc.ua.DESTINATION,b=olympe.dc.ua.ORIGIN;return new olympe.dc.query.Relation(this.tag,this.direction===a?b:a,this.recursive)}toString(){return`${this.direction}${this.tag}${this.recursive?'-r':''}`}};olympe.dc.query.R={Ca:'dc.query.Logger',
|
|
654
|
-
Array(this.$.length).fill(!1);let e=null;const f=(g,h)=>{d[g]=h;g=d.every(k=>k);e!==g&&(e=g,c(g))};this.$.forEach((g,h)=>{g.observe(a,olympe.Y.
|
|
655
|
-
this.La))}observe(a,b,c){$f(this.db,a,this.La,d=>{c(this.apply(d))},olympe.Y.
|
|
656
|
-
c:this.C}}};olympe.dc.query.$.
|
|
657
|
-
this.La))}observe(a,b,c){$f(this.db,a,this.La,d=>{c(this.apply(d))},olympe.Y.
|
|
658
|
-
b:'null';return'Equals-'+this.La+'-'+c}
|
|
659
|
-
olympe.dc.query.$.Wh=class extends olympe.dc.query.Aa{constructor(a,b,c,d=!0,e=!0){super();this.db=a;this.La=olympe.dc.ga(b);this.C='number'===typeof c?c:olympe.dc.ga(c);this.F=d;this.G=e}
|
|
660
|
-
this.F&&this.C>=a.C||!this.F&&this.C<=a.C:this.C===a.C:!1}Ja(){return this.La}
|
|
661
|
-
property:this.Ja(),operator:this.F?'<':'>',strict:this.G,value:this.C}}ha(){return{pr:olympe.dc.query.Aa.C.
|
|
662
|
-
b){this.C.clear(a,olympe.Y.
|
|
663
|
-
k);e!==g&&(e=g,c(g))};this.$.forEach((g,h)=>{g.observe(a,olympe.Y.
|
|
664
|
-
typeof a?this.C.test(this.F?a:a.toLowerCase()):!1}toString(){return'Regex'+this.La+'-'+this.C.toString()+'-'+this.F}
|
|
665
|
-
function Ph(a,b){if(null===a.F)return b;let c=!1;const d=a.toString();return(e,f,g,h)=>{const k=olympe.Y.
|
|
666
|
-
olympe.dc.query.va.
|
|
667
|
-
b,c,d;return`${this.C}-${this.optional}${null!=(c=null==(a=this.F)?void 0:a.toString())?c:''}${null!=(d=null==(b=this.Fb)?void 0:b.toString())?d:''}`}
|
|
668
|
-
Oh(d,c)))return!1;return!0}filter(a){const b=this.K(),c=b.F;null===c?b.F=a:b.F=c instanceof olympe.dc.query.$.zd?new olympe.dc.query.$.zd(...Array.from(c.$),a):new olympe.dc.query.$.zd(b.F,a);return b}sort(a,b){const c=this.K();c.Fb=new olympe.dc.query.
|
|
669
|
-
f,g)}))}};olympe.dc.query.va.fh=class extends olympe.dc.query.va.
|
|
670
|
-
c:0;this.content.set(a,b+1);return 0===b}remove(a,b){if(null===b)return this.content.delete(a);b=this.content.get(a);1<b?this.content.set(a,b-1):this.content.delete(a);return 1===b}};olympe.dc.query.va.
|
|
671
|
-
d,b,c)});super.
|
|
672
|
-
return a}toString(){return`followPart-${this.relation}-${super.toString()}`}toJSON(){return{type:'follow',relation:`${this.db.name(this.relation)} (${this.relation.X()})`,direction:this.relation.Ga()}}};olympe.dc.query.va.
|
|
673
|
-
{bh(a,d,b,c)});super.
|
|
674
|
-
'EXCLUDE_SELF',relation:this.relation,filter:Nh(this).map(b=>b.map(c=>c.
|
|
675
|
-
g=olympe.dm.Relation.C.
|
|
676
|
-
b(f,g,e,k)};return(e,f,g,h)=>{g=olympe.Y.
|
|
677
|
-
return this}sort(){olympe.
|
|
678
|
-
function bi(a){const b=`/${olympe.W.getParameter(olympe.dc.sources.U.
|
|
679
|
-
k[Wh])}catch(r){return new olympe.net.
|
|
680
|
-
(M.content=p);break;default:throw Error(`Data Http request type not supported ${n}`);}let K;const
|
|
681
|
-
Zh,'Forbidden'):new olympe.net.
|
|
682
|
-
function fi(a,b,c){c=b.
|
|
683
|
-
function gi(a,b,c){if(b===olympe.dc.Pa.SERVER){var d;return null!=(d=id(a.K,a.fa.get(c)))?d:null}var e=a.O.get(b);if(!e){d=a.ba.xb(b);if(null===d)return null;e=olympe.dc.sources.U
|
|
684
|
-
function hi(a,b){return b instanceof olympe.net.Vh?kd(a.K,b,Qc(a.Z).rd()):Promise.reject('No http request to send')}function ii(a,b){var c=gi(a,b.
|
|
685
|
-
function ji(a,b){var c=gi(a,b.
|
|
686
|
-
olympe.dc.sources.
|
|
687
|
-
[olympe.dc.Request.C.ng,olympe.N.$b.
|
|
688
|
-
`${f}/${b}`:`${f}?tag=${b}&model=${c}`,Uh,d);P(g,{[Vh]:'application/octet-stream'});e!==olympe.dc.Pa.SERVER&&P(g,{['X-Source-Origin']:a.origin});return hi(this,g).then(()=>(new URL(g.C())).pathname)}deleteFileContent(a){const {tag:b,model:c}=a.content,d=a.
|
|
689
|
-
e).then()}downloadFileContent(a){const {tag:b,model:c}=a.content,d=a.
|
|
690
|
-
{const k=h instanceof ArrayBuffer?new Uint8Array(h,0,h.byteLength):h;let l;null==(l=this.C.get(b))||l.forEach(n=>n.done(k))}).catch(h=>{let k;null==(k=this.C.get(b))||k.forEach(l=>l.sh(`${h}`))}).finally(()=>{this.C.delete(b)});return f}};olympe.dc.sources.
|
|
691
|
-
function ui(a,b){const c=b.V();null===a.F&&(a.F=new olympe.Y.
|
|
692
|
-
function vi(a,b){const c=b.V();let d,e;const f=null!=(e=null==(d=a.F)?void 0:d.get(c))?e:new olympe.dc.db.
|
|
693
|
-
olympe.dc.sources.
|
|
694
|
-
for(const [f,g]of e)this.H.debug(`=> DataType: ${g.name()} (${f})`)}d&&(d=!1,b())},c))})).then(()=>this.C.init(this.G)).catch(b=>{this.H.error(`Error while initialization of DataSource ${this.C.name()} (${this.V()}): ${b}`)});return this}healthCheck(){return this.C.healthCheck().then(()=>`Data source ${this.C.name()} (${this.C.V()}) OK`)}destroy(){this.G.destroy();return this.C.destroy()}request(a){var b=a.content;const c=a.getType();switch(c){case ki:const d=olympe.dm.DataSource.
|
|
695
|
-
return this.C.healthCheck().then(()=>({s:e})).catch(g=>({s:d,r:String(g)}));case li:return this.C.executeQuery(b);case qi:return b=b.Wb(),ui(this,b),this.K.
|
|
696
|
-
b.Wb());case ni:return b.content instanceof Uint8Array?this.C.uploadFileContent(b.tag,b.model,b.content):Promise.reject('File content is undefined');case oi:return this.C.downloadFileContent(b.tag,b.model);case pi:return this.C.deleteFileContent(b.tag,b.model);default:return Promise.reject(`Request of type ${a.getType()} is not supported by the data source`)}}fa(a){if(a.getType()===mi){const b=a.content;a=a.origin;return a===olympe.dc.Pa.SELF?wi(this,b):nh(this.O,b,this.G,a,olympe.dc.
|
|
697
|
-
{let d,e;return null!=(e=null==(d=c.
|
|
650
|
+
class Gh{constructor(a,b,c,d){this.H=a;this.db=b;this.K=d;this.T=[];this.O=-1<c.C.max||0<c.C.offset;this.G=new Map;this.C=!1;const e=new Map;for(const f of Wg(c)){a=f.V();this.T.push(a);if(f instanceof olympe.dc.query.va.fh){a=f.relation;a=`${a.Ga()}${a.X()}`;let g;b=null!=(g=this.G.get(a))?g:[];b.push(f);this.G.set(a,b)}Ih(f).forEach(g=>{let h;const k=null!=(h=e.get(g))?h:[];k.push(f.V());e.set(g,k)})}this.properties=Array.from(e.entries())}flush(){const a=this.C;this.C=!1;return a}Lc(){}Uc(a,b){if(!(this.C||
|
|
651
|
+
!this.O&&this.db.Fa(a))){var c;this.C||(this.C=null==(c=this.properties)?void 0:c.some(([d,e])=>b.has(d)&&ah(this.K,a,e)))}}F(a){this.C||this.db.Fa(a)&&!this.O||this.C||(this.C=this.T.some(b=>ah(this.K,a,b)))}Ea(a,b,c){if(!this.C&&Hh(this,a)){var d=this.db.Fa(b),e=this.db.Fa(c);if(d&&!e||!d&&e){const f=this.G.get(Ah+a);a=this.G.get(zh+a);this.C||(this.C=d&&(null==f?void 0:f.some(g=>ah(this.K,b,g.C)))||e&&(null==a?void 0:a.some(g=>ah(this.K,c,g.C))))}}}fc(a,b,c){if(!this.C&&this.O&&Hh(this,a)&&this.db.ur(b,
|
|
652
|
+
new olympe.dc.Ma.Relation(a),c)){const d=this.G.get(Ah+a);a=this.G.get(zh+a);const e=this.K;this.C||(this.C=(null==d?void 0:d.some(f=>ah(e,b,f.C)&&ah(e,c,f.V())))||(null==a?void 0:a.some(f=>ah(e,c,f.C)&&ah(e,b,f.V()))))}}}olympe.dc.query.Rp.xa=[olympe.dc.Writable];function Jh(a){return new olympe.dc.query.Relation(a.tag,a.direction,!0)}
|
|
653
|
+
olympe.dc.query.Relation=class extends olympe.dc.Ma.Relation{constructor(a,b,c){super(a,b);this.recursive=c}toJSON(){let a='{ "tag": '+JSON.stringify(this.X())+', ';a+='"direction": '+JSON.stringify(this.Ga())+', ';a+='"recursive": '+JSON.stringify(this.recursive);return a+'}'}static Ub(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return new olympe.dc.query.Relation(b.tag,b.direction,b.recursive)}static from(a,b){return new olympe.dc.query.Relation(a.X(),a.Ga(),null!=b?b:a instanceof olympe.dc.da.te)}Vb(){const a=
|
|
654
|
+
olympe.dc.ua.DESTINATION,b=olympe.dc.ua.ORIGIN;return new olympe.dc.query.Relation(this.tag,this.direction===a?b:a,this.recursive)}toString(){return`${this.direction}${this.tag}${this.recursive?'-r':''}`}};olympe.dc.query.R={Ca:'dc.query.Logger',Cj:'dc.query.QueryProcessor'};olympe.W.config(function(a){E(a,olympe.dc.query.R.Ca,[olympe.ma.R.Ha],b=>b.Mc('query'));D(a,olympe.dc.query.R.Cj,olympe.dc.query.du,olympe.dc.query.R.Ca,olympe.dc.db.R.Ha,olympe.dc.R.pg,new olympe.W.ka(olympe.dc.U.ih))});olympe.W.run([olympe.dc.query.R.Cj],a=>{olympe.dc.query.hk=()=>a});olympe.dc.query.Dd=class extends Error{};olympe.dc.query.$={};olympe.dc.query.$.zd=class extends olympe.dc.query.Aa{constructor(...a){super();this.$=a}compile(){return this.$.reduce((a,b)=>{const c=[];for(const d of b.compile()){for(const e of a)d.push(...e);c.push(d)}return c},[])}jd(){return new olympe.dc.query.$.se(...this.$.map(a=>a.jd()))}Cb(){return this.$.flatMap(a=>a.Cb())}Dc(){throw Error('Should not try to check predicate coverage on And (should be removed by compiling predicates');}kb(a){return this.$.reduce((b,c)=>b&&c.kb(a),!0)}observe(a,b,c){const d=
|
|
655
|
+
Array(this.$.length).fill(!1);let e=null;const f=(g,h)=>{d[g]=h;g=d.every(k=>k);e!==g&&(e=g,c(g))};this.$.forEach((g,h)=>{g.observe(a,olympe.Y.sb('AND-'+b+a+h),f.bind(null,h))})}ha(){return{pr:olympe.dc.query.Aa.C.dn,p:this.$.map(a=>a.ha())}}Ic(){throw Error('toObject for AND predicate should not be called');}toString(){return'And-'+this.$.reduce((a,b)=>a+'-'+b.toString(),'')}clear(a,b){this.$.forEach((c,d)=>{c.clear(a,olympe.Y.sb('AND-'+b+a+d))})}};olympe.dc.query.$.Ze=class extends olympe.dc.query.Aa{constructor(a,b,c,d=!1){super();this.La=olympe.dc.ga(a);this.substring=b;this.db=c;this.C=d}Cb(){return[this.La]}Dc(a,b){return a instanceof olympe.dc.query.$.Ze&&a.La===this.La?b?a.C?a.substring.toLowerCase().includes(this.substring.toLowerCase()):a.substring.includes(this.substring):this.C?this.substring.toLowerCase().includes(a.substring.toLowerCase()):this.substring.includes(a.substring):!1}Ja(){return this.La}kb(a){return this.apply(this.db.Ja(a,
|
|
656
|
+
this.La))}observe(a,b,c){$f(this.db,a,this.La,d=>{c(this.apply(d))},olympe.Y.sb(b+a+this.toString()))}apply(a){return'string'===typeof a?this.C?a.includes(this.substring):a.toLowerCase().includes(this.substring.toLowerCase()):!1}toString(){return'Contains'+this.La+'-'+this.substring+'-'+this.C}clear(a,b){ag(this.db,a,this.La,olympe.Y.sb(b+a+this.toString()))}Ic(){return{name:'CONTAINS',property:this.Ja(),value:this.substring,caseSensitive:this.C}}ha(){return{pr:olympe.dc.query.Aa.C.$i,p:this.La,s:this.substring,
|
|
657
|
+
c:this.C}}};olympe.dc.query.$.oe=class extends olympe.dc.query.Aa{constructor(a,b,c){super();this.La=olympe.dc.ga(a);this.C=null!=b?b:null;this.db=c}Cb(){return[this.La]}Dc(a){if(a instanceof olympe.dc.query.$.oe&&this.La===a.La)if('object'===typeof this.C&&null!==this.C){if(this.C instanceof olympe.dc.CloudObject)return this.C.Ka(a.C);if(this.C instanceof Date)return a.C instanceof Date&&this.C.getTime()===a.C.getTime();if(this.C instanceof olympe.D.Color)return this.C.Ka(a.C)}else return this.C===a.C;return!1}kb(a){return this.apply(this.db.Ja(a,
|
|
658
|
+
this.La))}observe(a,b,c){$f(this.db,a,this.La,d=>{c(this.apply(d))},olympe.Y.sb(b+a+this.toString()));null===this.C&&null===this.db.Ja(a,this.La)&&c(!0)}clear(a,b){ag(this.db,a,this.La,olympe.Y.sb(b+a+this.toString()))}apply(a){return'object'===typeof a&&null!==a?a instanceof olympe.dc.CloudObject?a.Ka(this.C):a instanceof Date?this.C instanceof Date&&this.C.getTime()===a.getTime():a instanceof olympe.D.Color?a.Ka(this.C):!1:a===this.C}toString(){let a,b;const c=null!=(b=null==(a=this.C)?void 0:a.toString())?
|
|
659
|
+
b:'null';return'Equals-'+this.La+'-'+c}Ic(){return{name:'EQUALS',property:this.La,value:this.C}}ha(){let a=1,b=this.C;switch(!0){case this.C instanceof Date:a=2;b=this.C.toJSON();break;case this.C instanceof olympe.dc.CloudObject:a=3;b=this.C.X();break;case this.C instanceof olympe.D.Color:a=4,b=this.C.toJSON()}return{pr:olympe.dc.query.Aa.C.no,p:this.La,t:a,v:b}}};function Kh(a,b,c){return null===b?!1:null===c?!0:a.G?a.F?b<c:b>c:a.F?b<=c:b>=c}function Lh(a,b){return'number'===typeof a.C?a.C:a.db.Ja(b,a.C)}function Mh(a,b,c){return olympe.Y.sb(c+b+a.C+a.La)}
|
|
660
|
+
olympe.dc.query.$.Wh=class extends olympe.dc.query.Aa{constructor(a,b,c,d=!0,e=!0){super();this.db=a;this.La=olympe.dc.ga(b);this.C='number'===typeof c?c:olympe.dc.ga(c);this.F=d;this.G=e}jd(){return new olympe.dc.query.$.Wh(this.db,this.La,this.C,!this.F,!this.G)}Cb(){return[this.La]}Dc(a,b){if(b)throw Error('Check coverage of inequality should not happen with opposite = true');return a instanceof olympe.dc.query.$.Wh&&this.La===a.La?typeof this.C!==typeof a.C||this.F!==a.F?!1:'number'===typeof this.C?
|
|
661
|
+
this.F&&this.C>=a.C||!this.F&&this.C<=a.C:this.C===a.C:!1}Ja(){return this.La}kb(a){return Kh(this,this.db.Ja(a,this.La),Lh(this,a))}observe(a,b,c){'string'===typeof this.C&&$f(this.db,a,this.C,d=>{const e=this.db.Ja(a,this.La);null!==e&&c(Kh(this,e,d))},Mh(this,a,b));$f(this.db,a,this.La,d=>{const e=Lh(this,a);c(null!==e?Kh(this,d,e):!0)},Mh(this,a,b))}clear(a,b){ag(this.db,a,this.La,Mh(this,a,b));'string'===typeof this.C&&ag(this.db,a,this.C,Mh(this,a,b))}Ic(){return{name:'INEQUALITY_OPERATOR',
|
|
662
|
+
property:this.Ja(),operator:this.F?'<':'>',strict:this.G,value:this.C}}ha(){return{pr:olympe.dc.query.Aa.C.Ro,p:this.La,b:this.C,l:this.F,s:this.G}}toString(){return'GreaterThan-'+this.La+'-'+this.G+'-'+this.C}};olympe.dc.query.$.Yd=class extends olympe.dc.query.Aa{constructor(a){super();this.C=a}compile(){const a=this.C.jd();return this.Ka(a)?super.compile():a.compile()}jd(){return this.C}Cb(){return this.C.Cb()}Dc(a,b){return a instanceof olympe.dc.query.$.Yd?this.C.Dc(a.C,b):this.C.Dc(a,!b)}kb(a){return!this.C.kb(a)}observe(a,b,c){let d=null;this.C.observe(a,olympe.Y.sb('NOT'+b+a),e=>{!e!==d&&(d=!e,c(d))})}Ic(){return{name:'NOT',predicate:this.C.Ic()}}ha(){return{pr:olympe.dc.query.Aa.C.pp,v:this.C.ha()}}toString(){return`NOT-${this.C.toString()}`}clear(a,
|
|
663
|
+
b){this.C.clear(a,olympe.Y.sb('NOT'+b+a))}Ka(a){return a instanceof olympe.dc.query.$.Yd?this.C.Ka(a.C):!1}};olympe.dc.query.$.se=class extends olympe.dc.query.Aa{constructor(...a){super();this.$=a}compile(){return this.$.map(a=>a.compile()).flat()}jd(){return new olympe.dc.query.$.zd(...this.$.map(a=>a.jd()))}Cb(){return this.$.flatMap(a=>a.Cb())}Dc(){throw Error('Should not try to check predicate coverage on And (should be removed by compiling predicates');}kb(a){return this.$.reduce((b,c)=>b||c.kb(a),!1)}observe(a,b,c){const d=Array(this.$.length).fill(!1);let e=null;const f=(g,h)=>{d[g]=h;g=d.some(k=>
|
|
664
|
+
k);e!==g&&(e=g,c(g))};this.$.forEach((g,h)=>{g.observe(a,olympe.Y.sb('OR-'+b+a+h),f.bind(null,h))})}Ic(){throw Error('toObject for OR predicate should not be called');}ha(){return{pr:olympe.dc.query.Aa.C.Ap,p:this.$.map(a=>a.ha())}}toString(){return'And-'+this.$.reduce((a,b)=>a.toString()+'-'+b.toString(),'')}clear(a,b){this.$.forEach((c,d)=>{c.clear(a,olympe.Y.sb('OR-'+b+a+d))})}};olympe.dc.query.$.hf=class extends olympe.dc.query.Aa{constructor(a,b,c,d=!0){super();this.La=olympe.dc.ga(a);this.C='string'===typeof b?new RegExp(d?b:b.toLowerCase()):d?b:new RegExp(b.source.toLowerCase());this.db=c;this.F=d}Cb(){return[this.La]}Dc(a){return a instanceof olympe.dc.query.$.hf&&this.La===a.La&&this.C.toString()===a.C.toString()}kb(a){return this.apply(this.db.Ja(a,this.La))}observe(a,b,c){$f(this.db,a,this.La,d=>{c(this.apply(d))},olympe.Y.sb(b+a+this.toString()))}apply(a){return'string'===
|
|
665
|
+
typeof a?this.C.test(this.F?a:a.toLowerCase()):!1}toString(){return'Regex'+this.La+'-'+this.C.toString()+'-'+this.F}Ic(){return{name:'REGEX',property:this.La,pattern:this.C,caseSensitive:this.F}}ha(){return{pr:olympe.dc.query.Aa.C.Up,p:this.La,r:this.C.source,c:this.F}}clear(a,b){ag(this.db,a,this.La,olympe.Y.sb(b+a+this.toString()))}};olympe.dc.query.$.Ul=class extends olympe.dc.query.Aa{constructor(a){super();this.C=new Set(a.map(olympe.dc.ga))}Cb(){return[]}Dc(a){return a instanceof olympe.dc.query.$.Ul&&Array.from(a.C).every(b=>this.C.has(b))}kb(a){return this.C.has(a)}observe(a,b,c){c(this.C.has(a))}clear(){}toString(){return'Tags-'+Array.from(this.C)}Ic(){return{name:'IS',tags:Array.from(this.C)}}ha(){return{pr:olympe.dc.query.Aa.C.Aq,t:Array.from(this.C)}}};olympe.dc.query.va={};function Ih(a){let b,c;const d=new Set(null!=(c=null==(b=a.F)?void 0:b.Cb())?c:[]);let e;a.Fb&&d.add(null==(e=a.Fb)?void 0:e.Ja().X());return d}function Nh(a){if(!a.ba){let b,c;a.ba=null!=(c=null==(b=a.F)?void 0:b.compile())?c:[]}return a.ba}function Oh(a,b){for(const c of b)if(a.some(d=>d.Dc(c,!1)))return!0;return!1}
|
|
666
|
+
function Ph(a,b){if(null===a.F)return b;let c=!1;const d=a.toString();return(e,f,g,h)=>{const k=olympe.Y.sb(h+f+d);e?a.F.observe(f,k,l=>{c||b(l,f,g,k)}):(c=!0,a.F.clear(f,k),c=!1,b(!1,f,g,k))}}function Qh(a,b,c){if(null===a.Fb)return c;const d=a.toString();return(e,f,g,h)=>{const k=a.Fb.Ja();h=olympe.Y.sb(h+d);e?$f(a.db,f,k,()=>{Zg(b)},h):ag(a.db,f,k,h);c(e,f,g,h)}}
|
|
667
|
+
olympe.dc.query.va.Il=class{constructor(a,b){this.db=olympe.dc.ja();this.C=a;this.optional=b;this.ba=this.Fb=this.F=this.id=null}static C(a){var b=a.i;if('string'===typeof a.f)return new olympe.dc.query.va.Wd(b,a.f);var c=a.o;const d=new olympe.dc.Ma.Relation(a.t,a.d);b='boolean'===typeof a.s?new olympe.dc.query.va.If(b,d,a.s,c):new olympe.dc.query.va.Qh(b,d,c);void 0!==a.p&&(b.F=hh(a.p));void 0!==a.c&&(c=b.V(),a=a.c,a=new olympe.dc.query.Ye(c,new olympe.dc.Ma.Property(a.p),a.o),b.Fb=a);return b}K(){}toString(){let a,
|
|
668
|
+
b,c,d;return`${this.C}-${this.optional}${null!=(c=null==(a=this.F)?void 0:a.toString())?c:''}${null!=(d=null==(b=this.Fb)?void 0:b.toString())?d:''}`}Ic(){}toJSON(){}ha(){const a={i:this.C,o:this.optional};null!==this.F&&(a.p=this.F.ha());null!==this.Fb&&(a.c=this.Fb.ha());return a}T(){}oa(){return new olympe.dc.query.va.Pl}Z(){}V(){null===this.id&&(this.id=this.T());return this.id}O(){return this.optional}Dc(a){const b=Nh(this);if(0===b.length)return!0;a=Nh(a);if(0===a.length)return!1;for(const c of a)if(!b.some(d=>
|
|
669
|
+
Oh(d,c)))return!1;return!0}filter(a){const b=this.K(),c=b.F;null===c?b.F=a:b.F=c instanceof olympe.dc.query.$.zd?new olympe.dc.query.$.zd(...Array.from(c.$),a):new olympe.dc.query.$.zd(b.F,a);return b}sort(a,b){const c=this.K();c.Fb=new olympe.dc.query.Ye(this.V(),a,b);return c}Cg(){return this.Fb}kb(a){if(null!==this.F){var b=this.V();for(const c of $g(a,b))this.F.kb(c)||a.remove(c,b,null)}}observe(a,b){const c=this.V();return Ph(this,Qh(this,a,(d,e,f,g)=>{(d?bh(a,e,c,f):a.remove(e,c,f))&&b(d,e,
|
|
670
|
+
f,g)}))}};olympe.dc.query.va.fh=class extends olympe.dc.query.va.Il{constructor(a,b,c){super(a,c);this.relation=b;this.fa=null}};olympe.dc.query.va.Kp=class{has(){}O(){}F(){}Id(){}G(){}remove(){}};olympe.dc.query.va.Vn=class{constructor(a){this.C=null;this.content=new Map;this.K=null!=a?a:null}Id(){return this.content.keys()}F(a){return this.content.has(a)&&null!==this.C?[this.C].values():[].values()}has(a){return this.content.has(a)}O(a){let b;return(null==(b=this.K)?void 0:b.call(this,a))||!1}G(a,b){if(null===this.C)this.C=b;else if(b!==this.C)throw Error('Should never try to insert multi parent in the same counter part result. To be used with FollowRulePart only');let c;b=null!=(c=this.content.get(a))?
|
|
671
|
+
c:0;this.content.set(a,b+1);return 0===b}remove(a,b){if(null===b)return this.content.delete(a);b=this.content.get(a);1<b?this.content.set(a,b-1):this.content.delete(a);return 1===b}};olympe.dc.query.va.Vn.xa=[olympe.dc.query.va.Kp];olympe.dc.query.va.Qh=class extends olympe.dc.query.va.fh{constructor(a,b,c){super(a,olympe.dc.query.Relation.from(b,!1),c)}K(){const a=new olympe.dc.query.va.Qh(this.C,this.relation,this.optional);a.F=this.F;a.Fb=this.Fb;return a}T(){return olympe.Y.sb(this.C+this.relation)}Z(a,b){return b instanceof olympe.dc.query.va.Wd?[a]:[a+this.relation,a+Jh(this.relation),a+'followRules'].map(c=>olympe.Y.sb(c))}kb(a){const b=this.V();for(const c of $g(a,this.C))this.db.ab(c,this.relation).forEach(d=>{bh(a,
|
|
672
|
+
d,b,c)});super.kb(a)}observe(a,b){const c=super.observe(a,b),d=this.relation.X(),e=this.relation.Ga();return(f,g,h,k)=>{const l=olympe.Y.sb(k+g+this.toString());f?W(this.db,g,this.relation,(n,p)=>{ch(a,n,d,e,g,p);c(n,p,g,l)},l):this.db.F(g,this.relation,l)}}ha(){return Object.assign(super.ha(),{t:this.relation.X(),d:this.relation.Ga()})}Ic(){const a={recursive:!1,relation:this.relation,filter:Nh(this).map(b=>b.map(c=>c.Ic())),optional:this.O()};this.Fb&&(a.sort={property:this.Fb.Ja(),order:this.Fb.Zh});
|
|
673
|
+
return a}toString(){return`followPart-${this.relation}-${super.toString()}`}toJSON(){return{type:'follow',relation:`${this.db.name(this.relation)} (${this.relation.X()})`,direction:this.relation.Ga()}}};olympe.dc.query.va.If=class extends olympe.dc.query.va.fh{constructor(a,b,c,d){super(a,olympe.dc.query.Relation.from(b,!0),d);this.G=c}K(){const a=new olympe.dc.query.va.If(this.C,this.relation,this.G,this.optional);a.F=this.F;a.Fb=this.Fb;return a}T(){return olympe.Y.sb(this.C+this.relation+this.G)}Z(a,b){return b instanceof olympe.dc.query.va.Wd?[a]:[a+this.relation,a+'followRules'].map(c=>olympe.Y.sb(c))}kb(a){const b=this.V();for(const c of $g(a,this.C))this.G&&bh(a,c,b,c),this.db.Eg(c,this.relation).forEach(d=>
|
|
674
|
+
{bh(a,d,b,c)});super.kb(a)}observe(a,b){const c=super.observe(a,b),d=this.relation.X(),e=this.relation.Ga(),f=new Set,g=(h,k,l,n,p)=>{k=olympe.Y.sb(k+h+p+l);if(this.G||0<l)0<l&&ch(a,n,d,e,h,p),c(n,p,h,k);n?f.has(p)||(f.add(p),W(this.db,p,this.relation,g.bind(this,h,k,l+1),k)):(f.delete(p),this.db.F(p,this.relation,k))};return(h,k,l,n)=>g(k,n+this.toString(),0,h,k)}ha(){return Object.assign(super.ha(),{s:this.G,t:this.relation.X(),d:this.relation.Ga()})}Ic(){const a={recursive:this.G?'INCLUDE_SELF':
|
|
675
|
+
'EXCLUDE_SELF',relation:this.relation,filter:Nh(this).map(b=>b.map(c=>c.Ic())),optional:this.O()};this.Fb&&(a.sort={property:this.Fb.Ja(),order:this.Fb.Zh});return a}toString(){return`followRecursivelyPart-${this.relation}-${this.G}-${super.toString()}`}toJSON(){return{type:'follow recursively',relation:`${this.db.name(this.relation)} (${this.relation.X()})`,direction:this.relation.Ga()}}};olympe.dc.query.va.Wd=class extends olympe.dc.query.va.Il{constructor(a,b,c){super(a,!1);this.hc=b;this.G=null!=c?c:null}K(){return new olympe.dc.query.va.Wd(this.C,this.hc,this.G)}T(){return olympe.Y.sb(this.C+'followRules')}oa(){return new olympe.dc.query.va.Vn(this.G)}Z(a,b){return b instanceof olympe.dc.query.va.Wd?[a]:[olympe.Y.sb(a+'followRules')]}Dc(a){if(a instanceof olympe.dc.query.va.fh){const b=olympe.dc.ua.ORIGIN,c=olympe.dc.ua.DESTINATION,d=olympe.dc.pc.Zc,e=olympe.dc.pc.Oh,f=olympe.dm.Relation.C.Ml,
|
|
676
|
+
g=olympe.dm.Relation.C.Xl;a=a.relation;const h=a.Ga(),k=a.X();return h!==c||k!==d&&k!==e?!!(lg(this.db,a,this.hc)&(a.Ga()===b?f:g)):!0}return a instanceof olympe.dc.query.va.Wd?this.hc===a.hc:!1}kb(a){const b=this.V();for(const c of $g(a,this.C))for(const d of hf(this.db,c,this.hc))bh(a,d,b,c)}observe(a,b){const c=this.V(),d=(e,f,g,h)=>{const k=`${h}:${g}`;f?ig(this.db,g,this.hc,(l,n,p,q,r)=>{p&&(p=q?bh(a,r,c,e):a.remove(r,c,e),null!==n&&ch(a,q,l,n,g,r),p&&d(e,q,r,h))},k):jg(this.db,g,this.hc,k);
|
|
677
|
+
b(f,g,e,k)};return(e,f,g,h)=>{g=olympe.Y.sb(h+f+this.toString());(e?bh(a,f,c,f):a.remove(f,c,f))&&d(f,e,f,g)}}ha(){return Object.assign(super.ha(),{f:this.hc})}Ic(){throw Error('Try to parse a part of an implicit query. Data connectors do not support those queries.');}toString(){return`followRulePart-${this.hc}-${super.toString()}`}toJSON(){return{type:'follow rule',rule:`${this.db.name(this.hc)} (${this.hc})`}}O(){return!1}filter(){olympe.ma.eb('dc.query').warn('Should never try to filter on queries with follow rules, ignore...');
|
|
678
|
+
return this}sort(){olympe.ma.eb('dc.query').warn('Should never try to sort queries with follow rules, ignore...');return this}};olympe.dc.query.va.Wd.F='followRules';olympe.dc.query.va.Pl=class{constructor(){this.content=new Map}Id(){return this.content.keys()}F(a){let b,c;return null!=(c=null==(b=this.content.get(a))?void 0:b.values())?c:[]}has(a){return this.content.has(a)}O(){return!1}G(a,b){let c=this.content.get(a);c||(c=new Set,this.content.set(a,c));a=c.size;c.add(b);return a<c.size}remove(a,b){if(null===b)return this.content.delete(a);const c=this.content.get(a);b=c.delete(b);0===c.size&&this.content.delete(a);return b}};olympe.dc.query.va.Pl.xa=[olympe.dc.query.va.Kp];olympe.dc.sources={};olympe.dc.sources.gq=class extends Error{};olympe.dc.sources.ej=class{V(){}init(){}destroy(){}request(){return v(function*(){})}fa(){}};const Rh=olympe.net.Ba.Nd.GET,Sh=olympe.net.Ba.Nd.bh,Th=olympe.net.Ba.Nd.zc,Uh=olympe.net.Ba.Nd.Jp,Vh=olympe.net.Ba.Headers.Lh,Wh=olympe.net.Ba.Headers.rn,Xh=olympe.net.Ba.Zb.$g,Yh=olympe.net.Ba.Zb.Mn,Zh=olympe.net.Ba.Zb.vo,$h=olympe.net.Ba.Zb.gi,ai=olympe.net.Ba.Zb.vl;
|
|
679
|
+
function bi(a){const b=`/${olympe.W.getParameter(olympe.dc.sources.U.cl)}/:${'sourceId'}/:${'requestType'}`.replace(/\/+/g,'/').replace(/\/$/,'');a.T.K('_DataSourcesHTTPService',b,[Rh,Sh,Th,Uh],(c,d,e)=>v(function*(){const f=d.get('sourceId');var g=a.G.get(d.get('sourceId'));if(!g){var h;g=null!=(h=olympe.dc.ja().name(f))?h:'name unknown';return Promise.resolve(new olympe.net.Xd(`No handler found for datasource ${f} called '${g}'`,ai,'Invalid source id'))}h=c.method;const k=c.Ei();try{var l=yield ci(a,
|
|
680
|
+
k[Wh])}catch(r){return new olympe.net.Xd(`Invalid token ${r}`,Zh,'Access denied')}try{var n=Number(d.get('requestType')),p=c.body;const r=olympe.dc.Request.C.Mb,t=olympe.dc.Request.C.ng,u=olympe.dc.Request.C.wg,w=olympe.dc.Request.C.xg,y=olympe.dc.Request.C.Ng,z=olympe.dc.Request.C.cg,A=olympe.dc.Request.C.Ff,C=olympe.dc.Request.C.Mf;let M;switch(n){case r:break;case t:case u:case y:case w:M=a.F.F(p);break;case C:case z:case A:M={tag:e.get('tag'),model:e.get('model'),mimeType:k[Vh]};p instanceof Uint8Array&&
|
|
681
|
+
(M.content=p);break;default:throw Error(`Data Http request type not supported ${n}`);}let K;const ta=null!=(K=k['X-Source-Origin'])?K:olympe.dc.Pa.gf;var q=Ne(new olympe.dc.Request(n,f,M,l),ta);const Ja=yield g(q);let Mc;void 0===Ja?Mc='':Ja instanceof Blob||Ja instanceof Uint8Array||Ja instanceof ArrayBuffer||'function'===typeof(null==Ja?void 0:Ja.pipe)?Mc=Ja:Mc=JSON.stringify(a.F.ha(Ja));return new olympe.net.Xd(Mc,h===Uh?Yh:Xh)}catch(r){return r instanceof olympe.dc.sources.gq?new olympe.net.Xd(`Authorization error: ${r}`,
|
|
682
|
+
Zh,'Forbidden'):new olympe.net.Xd(`Internal server error: ${r}`,$h,'Internal server error')}})).catch(c=>a.H.error(`Error while starting the HTTP Service: ${c}`));a.H.debug(`Started HTTP service with path: ${b}`)}function di(a){a.T.Z('_DataSourcesHTTPService').catch(b=>{a.H.error(`An error occurred while stopping the data sources http service: ${b}`)})}function ei(a,b,c){0===a.G.size&&bi(a);a.G.set(b,c);return()=>{a.G.delete(b);0===a.G.size&&di(a)}}
|
|
683
|
+
function fi(a,b,c){c=b.xe(c);null===c&&a.H.error(`Impossible to build URL for data source ${b}`);return c}
|
|
684
|
+
function gi(a,b,c){if(b===olympe.dc.Pa.SERVER){var d;return null!=(d=id(a.K,a.fa.get(c)))?d:null}var e=a.O.get(b);if(!e){d=a.ba.xb(b);if(null===d)return null;e=olympe.dc.sources.U.dl;const f=olympe.dc.sources.U.Sh,g=olympe.dc.sources.U.Oo,h=olympe.dc.sources.U.cl;let k;e=`${fi(a,d,g)?'https':'http'}://${fi(a,d,e)}:${null!=(k=fi(a,d,f))?k:fi(a,d,g)?443:80}`+`/${fi(a,d,h)}/${b}`.replace(/\/+/g,'/').replace(/\/$/,'');a.O.set(b,e)}return`${e}/${c}`}
|
|
685
|
+
function hi(a,b){return b instanceof olympe.net.Vh?kd(a.K,b,Qc(a.Z).rd()):Promise.reject('No http request to send')}function ii(a,b){var c=gi(a,b.nc(),b.getType());if(!c)return Promise.reject(`No destination URL to send the query to destination: ${b.nc()}`);const d=b.content,e=JSON.stringify(a.F.ha(d));c=O(c,Sh,e);P(c,{['X-Source-Origin']:b.origin,[Vh]:'application/json'});return hi(a,c).then(f=>'string'===typeof f?a.F.F(JSON.parse(f)):olympe.dc.query.ld.yi(d))}
|
|
686
|
+
function ji(a,b){var c=gi(a,b.nc(),b.getType());if(!c)return Promise.reject(`No destination URL to send the transaction to destination: ${b.nc()}`);const d=JSON.stringify(a.F.ha(b.content));c=O(c,Sh,d);P(c,{['X-Source-Origin']:b.origin,[Vh]:'application/json'});return hi(a,c).then()}function ci(a,b){return'string'!==typeof b?Promise.reject('Please provide an authorization token.'):new Promise((c,d)=>{a.Z.Gg(b,(e,f)=>{e?d(e):c(f)})})}
|
|
687
|
+
olympe.dc.sources.Is=class{constructor(a,b,c,d,e,f){this.H=a;this.T=b;this.K=c;this.Z=d;this.ba=e;this.F=f;this.G=new Map;new olympe.D.Yb('Http service of remote data provider');this.O=new Map;this.C=new Map;this.fa=new Map([[olympe.dc.Request.C.eg,olympe.N.$b.eg],[olympe.dc.Request.C.Ff,olympe.N.$b.hj],[olympe.dc.Request.C.Mf,olympe.N.$b.hj],[olympe.dc.Request.C.cg,olympe.N.$b.hj],[olympe.dc.Request.C.tn,olympe.N.$b.sn],[olympe.dc.Request.C.Yp,olympe.N.$b.Xp],[olympe.dc.Request.C.Ho,olympe.N.$b.Go],
|
|
688
|
+
[olympe.dc.Request.C.ng,olympe.N.$b.Hn],[olympe.dc.Request.C.xg,olympe.N.$b.TRANSACTION]])}yc(a){var b=gi(this,a.nc(),a.getType());if(!b)return Promise.reject(`No destination URL to send the status request to destination: ${a.nc()}`);b=O(b,Rh);P(b,{['X-Source-Origin']:a.origin});return hi(this,b)}uploadFileContent(a){const {tag:b,model:c,content:d}=a.content,e=a.nc(),f=gi(this,e,a.getType());if(!f)return Promise.reject(`No destination URL to upload the file. ${b}`);const g=O(e===olympe.dc.Pa.SERVER?
|
|
689
|
+
`${f}/${b}`:`${f}?tag=${b}&model=${c}`,Uh,d);P(g,{[Vh]:'application/octet-stream'});e!==olympe.dc.Pa.SERVER&&P(g,{['X-Source-Origin']:a.origin});return hi(this,g).then(()=>(new URL(g.C())).pathname)}deleteFileContent(a){const {tag:b,model:c}=a.content,d=a.nc();var e=gi(this,d,a.getType());if(!e)return Promise.reject(`No destination URL to delete the file. ${b}`);e=O(d===olympe.dc.Pa.SERVER?`${e}/${b}`:`${e}?tag=${b}&model=${c}`,Th,b);d!==olympe.dc.Pa.SERVER&&P(e,{['X-Source-Origin']:a.origin});return hi(this,
|
|
690
|
+
e).then()}downloadFileContent(a){const {tag:b,model:c}=a.content,d=a.nc();var e=gi(this,d,a.getType());if(!e)return Promise.reject(Error(`No destination URL to download the file. ${b}`));var f;const g=null!=(f=this.C.get(b))?f:[];f=new Promise((h,k)=>{g.push({done:h,sh:k})});if(this.C.has(b))return f;this.C.set(b,g);e=O(d===olympe.dc.Pa.SERVER?`${e}/${b}`:`${e}?tag=${b}&model=${c}`,Rh,b,olympe.net.Ba.ResponseType.Dq);d!==olympe.dc.Pa.SERVER&&P(e,{['X-Source-Origin']:a.origin});hi(this,e).then(h=>
|
|
691
|
+
{const k=h instanceof ArrayBuffer?new Uint8Array(h,0,h.byteLength):h;let l;null==(l=this.C.get(b))||l.forEach(n=>n.done(k))}).catch(h=>{let k;null==(k=this.C.get(b))||k.forEach(l=>l.sh(`${h}`))}).finally(()=>{this.C.delete(b)});return f}};olympe.dc.sources.Wo=class{constructor(a,b){this.H=a;this.Xb=b}};olympe.dc.sources.Wo.Zb={ii:0,rA:1,sA:3,Qz:4};const ki=olympe.dc.Request.C.Mb,li=olympe.dc.Request.C.ng,mi=olympe.dc.Request.C.Dj,ni=olympe.dc.Request.C.Mf,oi=olympe.dc.Request.C.Ff,pi=olympe.dc.Request.C.cg,qi=olympe.dc.Request.C.Jh,ri=olympe.dc.Request.C.Ng,si=olympe.dc.Request.C.wg,ti=olympe.dc.Request.C.xg;
|
|
692
|
+
function ui(a,b){const c=b.V();null===a.F&&(a.F=new olympe.Y.Vl(6E4),Ma(a.F,(f,g)=>{a.applyTransaction(g,!1).catch(h=>{a.H.error(`Error occurred when applying burst transaction ${f} to the data source: ${h}`)})}),Na(a.F,()=>{a.F=null}));let d;const e=null!=(d=a.F.get(c))?d:new olympe.dc.db.Qc(c);b.pd(e);Ka(a.F.C,c)||a.F.set(c,e)}
|
|
693
|
+
function vi(a,b){const c=b.V();let d,e;const f=null!=(e=null==(d=a.F)?void 0:d.get(c))?e:new olympe.dc.db.Qc(c);let g;null==(g=a.F)||g.delete(c);b.pd(f);return a.applyTransaction(f,!1).catch(h=>{a.H.error(`Error occurred when applying burst transaction ${c} to the data source: ${h}`)})}function wi(a,b){const c=rxjs.defer(()=>a.C.executeQuery(b).then(d=>d.Wb()));return 0<a.T?rxjs.interval(a.T).pipe(rxjs.operators.switchMap(()=>c)):c}
|
|
694
|
+
olympe.dc.sources.ip=class{constructor(a,b){this.H=a;this.C=b;this.Xb=null;this.O=olympe.dc.query.hk();this.K=olympe.dc.zm();this.G=new olympe.D.Yb('Context of source '+this.V());let c;this.T=null!=(c=b.xe(olympe.dc.sources.U.El))?c:-1;this.F=null}V(){return this.C.V()}init(a){this.Xb=a;if(this.V()===olympe.dc.Pa.SELF)return this;(new Promise((b,c)=>{let d=!0;xi(this.C,this.G).subscribe(rxjs.Subscriber.create(e=>{if(this.H.C()){this.H.debug(`Data source ${this.C.name()} has loaded ${e.size()} data types in its cache:`);
|
|
695
|
+
for(const [f,g]of e)this.H.debug(`=> DataType: ${g.name()} (${f})`)}d&&(d=!1,b())},c))})).then(()=>this.C.init(this.G)).catch(b=>{this.H.error(`Error while initialization of DataSource ${this.C.name()} (${this.V()}): ${b}`)});return this}healthCheck(){return this.C.healthCheck().then(()=>`Data source ${this.C.name()} (${this.C.V()}) OK`)}destroy(){this.G.destroy();return this.C.destroy()}request(a){var b=a.content;const c=a.getType();switch(c){case ki:const d=olympe.dm.DataSource.Mb.Eb,e=olympe.dm.DataSource.Mb.eh;
|
|
696
|
+
return this.C.healthCheck().then(()=>({s:e})).catch(g=>({s:d,r:String(g)}));case li:return this.C.executeQuery(b);case qi:return b=b.Wb(),ui(this,b),this.K.Gc(b),Promise.resolve();case si:case ti:const f=b.Wb();return this.applyTransaction(f,c===ti).finally(()=>{if(a.origin===olympe.dc.Pa.SELF){var g=f.V();g=Ne(new olympe.dc.Request(olympe.dc.Request.C.ij,olympe.dc.Pa.SELF,{id:g,finalize:olympe.dc.transaction.jf.C.bi,error:null}),this.V());let h;null==(h=this.Xb)||h.kd(g)}});case ri:return vi(this,
|
|
697
|
+
b.Wb());case ni:return b.content instanceof Uint8Array?this.C.uploadFileContent(b.tag,b.model,b.content):Promise.reject('File content is undefined');case oi:return this.C.downloadFileContent(b.tag,b.model);case pi:return this.C.deleteFileContent(b.tag,b.model);default:return Promise.reject(`Request of type ${a.getType()} is not supported by the data source`)}}fa(a){if(a.getType()===mi){const b=a.content;a=a.origin;return a===olympe.dc.Pa.SELF?wi(this,b):nh(this.O,b,this.G,a,olympe.dc.pa.Rc.Cf).pipe(rxjs.operators.map(c=>
|
|
698
|
+
{let d,e;return null!=(e=null==(d=c.ye)?void 0:d.G)?e:null}),rxjs.operators.filter(c=>null!==c))}return rxjs.throwError(()=>Error('Subscription request not supported'))}applyTransaction(a,b){const c=this;return v(function*(){const d=yi(a);yield c.C.applyTransaction(d,{batch:b});yield vh(c.O,c.V(),a);c.K.Gc(a)})}};olympe.dc.sources.ip.xa=[olympe.dc.sources.ej];function yi(a){const b=olympe.dc.sources.Lf.C.es,c=olympe.dc.sources.Lf.C.Nu,d=olympe.dc.sources.Lf.C.ms,e=olympe.dc.sources.Lf.C.gs,f=olympe.dc.sources.Lf.C.ns,g=[],h=[],k=[],l=[],n=[];a.yb.forEach((p,q)=>{const r=p.Ec();p.G()?g.push(zi(b,q,r,p.T()?p.Cb():null)):p.Sd()?k.push(zi(d,q,r,null,p.O())):p.T()&&h.push(zi(c,q,r,p.Cb()));for(const [t,u,w]of p.sd())p=a.Hd(u),w?l.push(new Ai(e,t,q,u,r,p.Ec())):n.push(new Ai(f,t,q,u,r,p.Ec()))});return n.concat(k,g,h,l)}
|
|
698
699
|
function zi(a,b,c,d,e){if('string'!==typeof c)throw Error(`Patch: model of instance ${b} is missing. It is invalid transaction.`);return new Bi(a,b,c,d,e)}olympe.dc.sources.Lf=class{constructor(a){this.type=a}};class Bi extends olympe.dc.sources.Lf{constructor(a,b,c,d,e){super(a);this.object=b;this.model=c;this.properties=null!=d?d:null;this.deleteRules=null!=e?e:olympe.dc.cc.NONE}}
|
|
699
|
-
class Ai extends olympe.dc.sources.Lf{constructor(a,b,c,d,e,f){super(a);this.relation=b;this.from=c;this.to=d;this.fromModel=e;this.toModel=f}}olympe.dc.sources.Lf.C={
|
|
700
|
-
olympe.dc.sources.
|
|
701
|
-
q=a.getType();var r=a.
|
|
702
|
-
Array.from(l.Wb().sd()).length,'relations');else if(q===e||q===f||q===h)b.H.debug('Data Provider: Persisting graph patch in offline cache after successful transaction'),yield Ei(p,null,r,a.content.Wb(),!1);return l}b.H.debug(`Data Provider: Request (type: ${q}) will be sent to the cache data provider: ${a.content}`);switch(q){case c:return{s:olympe.dm.DataSource.
|
|
703
|
-
Ci(b,t));case g:return Promise.resolve();case k:return r=a.content,p.uploadFileContent(r.tag,r.content,r.mimeType);case l:return p.downloadFileContent(a.content.tag);case n:return p.deleteFileContent(a.content.tag);default:return Promise.reject(`Messages of type ${a.getType()} is not supported by the source ${b.V()}`)}})}fa(a,b){if(!this.F.F)return this.Z(a,b);const c=olympe.dc.sources.
|
|
704
|
-
{olympe.D.
|
|
705
|
-
function Ri(a,b){b=b.
|
|
706
|
-
function Si(a,b,c,d,e){return v(function*(){var f=olympe.N.Request.ob.SEND,g=olympe.N.Request.ob.GET;const h=olympe.N.Request.ob.PUBLISH,k=olympe.N.Request.ob.SUBSCRIBE,l=d.Dh();var n=d.body();if(e!==n.
|
|
707
|
-
g=yield d.
|
|
708
|
-
olympe.dc.sources
|
|
709
|
-
c)?b.get(c,a):Promise.resolve({s:f});a=Qi(this,c)?this.C.
|
|
700
|
+
class Ai extends olympe.dc.sources.Lf{constructor(a,b,c,d,e,f){super(a);this.relation=b;this.from=c;this.to=d;this.fromModel=e;this.toModel=f}}olympe.dc.sources.Lf.C={es:'CREATE',Nu:'UPDATE',ms:'DELETE',gs:'CREATE_RELATION',ns:'DELETE_RELATION'};function Ci(a,b){b=Ne(new olympe.dc.Request(olympe.dc.Request.C.ij,olympe.dc.Pa.SELF,{id:b,finalize:olympe.dc.transaction.jf.C.bi,error:null}),a.V());let c;null==(c=a.Xb)||c.kd(b)}
|
|
701
|
+
olympe.dc.sources.Lk=class{constructor(a,b){this.H=a;this.F=b;this.Xb=null}V(){}T(){}Z(){}init(a){this.Xb=a;return this}destroy(){return Promise.resolve()}request(a){const b=this;return v(function*(){if(!b.F.F)return b.T(a);var c=olympe.dc.Request.C.Mb,d=olympe.dc.Request.C.ng;const e=olympe.dc.Request.C.wg,f=olympe.dc.Request.C.xg;var g=olympe.dc.Request.C.Jh;const h=olympe.dc.Request.C.Ng,k=olympe.dc.Request.C.Mf;var l=olympe.dc.Request.C.Ff;const n=olympe.dc.Request.C.cg,p=olympe.dc.sources.Pd(),
|
|
702
|
+
q=a.getType();var r=a.nc();if(Lc(b.F)){q===d&&(c=a.content,(g=Pe(a).get(olympe.dc.pa.C.Ik))&&(yield Di(p,c.V(),g)),b.H.debug(`Data Provider: Query ${c.V()} will be executed with its default Remote or Server provider`));if(q===l&&(l=a.content,'string'===typeof(null==l?void 0:l.url)&&l.url.startsWith('offline://')))return p.downloadFileContent(l.tag);l=yield b.T(a);if(q===d)d=a.content,yield Ei(p,d.V(),r,l.Wb(),!0),b.H.C()&&b.H.debug(`Data Provider: Data result for query ${d.V()}`,l.Wb().yb.size,'instances',
|
|
703
|
+
Array.from(l.Wb().sd()).length,'relations');else if(q===e||q===f||q===h)b.H.debug('Data Provider: Persisting graph patch in offline cache after successful transaction'),yield Ei(p,null,r,a.content.Wb(),!1);return l}b.H.debug(`Data Provider: Request (type: ${q}) will be sent to the cache data provider: ${a.content}`);switch(q){case c:return{s:olympe.dm.DataSource.Mb.Zd};case d:return p.executeQuery(a.content);case e:case f:case h:d=a.content;const t=d.Wb().V();return p.applyTransaction(d,r).finally(()=>
|
|
704
|
+
Ci(b,t));case g:return Promise.resolve();case k:return r=a.content,p.uploadFileContent(r.tag,r.content,r.mimeType);case l:return p.downloadFileContent(a.content.tag);case n:return p.deleteFileContent(a.content.tag);default:return Promise.reject(`Messages of type ${a.getType()} is not supported by the source ${b.V()}`)}})}fa(a,b){if(!this.F.F)return this.Z(a,b);const c=olympe.dc.sources.Pd(),d=a.content,e=a.nc();return rxjs.of(null).pipe(rxjs.operators.switchMap(()=>{if(Lc(this.F)){const f=new rxjs.Observable(h=>
|
|
705
|
+
{olympe.D.xr([this.F.Tf()],()=>{h.error(new olympe.N.errors.Jo('Go Offline',d.V()))})}),g=this.Z(a,b);return rxjs.merge(f,g)}return new rxjs.Observable(f=>{olympe.D.xr([this.F.Tf()],()=>{f.error(new olympe.N.errors.Fn('Back Online',d.V()))})})})).pipe(rxjs.operators.switchMap(f=>rxjs.from(Ei(c,d.V(),e,f).then(()=>f).catch(g=>{this.H.error(`Data Provider: Cache database failed to handle the data result with message: ${g}`);throw g;}))))}};olympe.dc.sources.Lk.xa=[olympe.dc.sources.ej];const Fi=olympe.dc.Request.C.Mb,Gi=olympe.dc.Request.C.ng,Hi=olympe.dc.Request.C.Dj,Ii=olympe.dc.Request.C.wg,Ji=olympe.dc.Request.C.xg,Ki=olympe.dc.Request.C.Jh,Li=olympe.dc.Request.C.Ng,Mi=olympe.dc.Request.C.Mf,Ni=olympe.dc.Request.C.Ff,Oi=olympe.dc.Request.C.cg;function Pi(a,b){let c;return(null==(c=a.za.xb(b))?void 0:c.xe(olympe.dc.sources.U.Ce))!==olympe.dm.DataSource.Ce.Ko}function Qi(a,b){let c;return(null==(c=a.za.xb(b))?void 0:c.xe(olympe.dc.sources.U.Ce))!==olympe.dm.DataSource.Ce.wn}
|
|
706
|
+
function Ri(a,b){b=b.uc();if(b!==olympe.dm.User.C&&a.xe(olympe.dc.sources.U.Ll))throw a=`User ${b} has no right to access the restricted data source ${a.name()} (${a.V()}). Please use an admin account instead.`,new olympe.dc.sources.gq(a);}
|
|
707
|
+
function Si(a,b,c,d,e){return v(function*(){var f=olympe.N.Request.ob.SEND,g=olympe.N.Request.ob.GET;const h=olympe.N.Request.ob.PUBLISH,k=olympe.N.Request.ob.SUBSCRIBE,l=d.Dh();var n=d.body();if(e!==n.uc())throw Error('Access denied: try to impersonate a user');Ri(c,n);let p;if(null==(p=a.Xb)||!p.sources.has(n.nc()))throw Error(`Try to process a message with destination data source ${n.nc()} coming from remote but not started here`);if(l===k){if(n.getType()===Hi)f=n.content.V();else throw Error('Not supported type of subscription');
|
|
708
|
+
g=yield d.Qm(f);a.ba.set(g,f);g=a.O.get(f);g||(g=new Ti(a.H,f,b,Ne(n,olympe.dc.Pa.gf)),a.O.set(f,g));n=g;n.C++;n.H.debug(`Data subscription ${n.F} has ${n.C} subscribers`)}else l===g?(n=yield b.request(n),void 0!==n?yield d.kd(n):a.H.warn(`Request from ${d.source()} requires an output value, but got undefined instead.`)):l===f?(yield b.request(n),yield d.Uq()):l===h&&(yield b.request(n))})}
|
|
709
|
+
olympe.dc.sources.fq=class extends olympe.dc.sources.Lk{constructor(a,b,c,d,e,f){super(a,d);this.K=b;this.C=c;this.db=e;this.G=new olympe.D.Yb('Remote Provider Context');this.oa=new Map;this.O=new Map;this.ba=new Map;this.za=f}V(){return olympe.dc.Pa.gf}T(a){var b=olympe.N.tb;const c=a.nc(),d=a.getType();this.H.C()&&this.H.debug(`Request (type: ${d}) will be sent to remote data provider ${c}: ${a.content}`);switch(d){case Fi:const e=olympe.dm.DataSource.Mb.Eb,f=olympe.dm.DataSource.Mb.eh;b=Pi(this,
|
|
710
|
+
c)?b.get(c,a):Promise.resolve({s:f});a=Qi(this,c)?this.C.yc(a):Promise.resolve({s:f});return Promise.all([b,a]).then(([k,l])=>{if((null==k?void 0:k.s)===e||(null==l?void 0:l.s)===e){let n,p;return{s:e,r:`${null!=(n=null==k?void 0:k.r)?n:''} ${null!=(p=null==l?void 0:l.r)?p:''}`}}return{s:f}});case Gi:return Qi(this,c)?ii(this.C,a):b.get(c,a);case Ii:const g=a.content.Wb().V();return(Pi(this,c)?b.send(c,a):ji(this.C,a)).finally(()=>Ci(this,g));case Ji:const h=a.content.Wb().V();return(Qi(this,c)?ji(this.C,
|
|
710
711
|
a):b.send(c,a)).finally(()=>Ci(this,h));case Ki:return Pi(this,c)?b.publish(c,a).catch(k=>{this.H.error(`An error occurred while sending "burst transaction" to the data source ${c}: ${k}`)}):Promise.resolve();case Li:return Pi(this,c)?b.publish(c,a).catch(k=>{this.H.error(`An error occurred while sending "burst transaction done" to the data source ${c}: ${k}`)}):ji(this.C,a);case Mi:return Qi(this,c)?this.C.uploadFileContent(a):b.get(c,a);case Ni:return Qi(this,c)?this.C.downloadFileContent(a):b.get(c,
|
|
711
|
-
a);case Oi:return Qi(this,c)?this.C.deleteFileContent(a):b.send(c,a);default:return Promise.reject(`Messages of type ${a.getType()} is not supported by the source ${this.V()}`)}}Z(a,b){const c=a.
|
|
712
|
-
this.G,a,{onRetry:b}):rxjs.throwError(()=>Error(`Do not handle subscription request of type ${d}`))}init(a){super.init(a);if(a.G)return this;olympe.dc.
|
|
713
|
-
(new olympe.N.tb(this.K,this.G)).listen().subscribe(b=>{b=b.body();b instanceof olympe.dc.Request?a.
|
|
714
|
-
d.onDestroy(()=>{let l;return null==(l=e)?void 0:l()}));g!==olympe.dm.DataSource.
|
|
715
|
-
a.G.unsubscribe(),a=!0):(a.H.debug(`Data subscription ${a.F} has ${a.C} subscribers`),a=!1));a&&this.O.delete(b)}};class Ti{constructor(a,b,c,d){this.H=a;this.F=b;this.C=0;this.G=Te(c,d).subscribe({next:e=>{olympe.N.tb.publish(b,e).catch(f=>a.error(`Error occurred while publishing a data notification: ${f}`))},error:e=>a.error(`Error occurred while trying to subscribe to topic ${b} for a datasource: ${e}`)})}}olympe.dc.sources
|
|
716
|
-
olympe.dc.CloudObject:return a=a.X(),this.O(a),{t:10,v:a};case a instanceof olympe.dc.
|
|
717
|
-
v:a.ha()};case a instanceof olympe.dc.
|
|
718
|
-
b:void 0,Ne(new olympe.dc.Request(a.r,a.d,c,a.u),a.o);case 15:return b=this.G(a.p),new olympe.dc.transaction.
|
|
719
|
-
a)){const g=this.K.get(f);void 0!==g&&(e===olympe.dc.ua.DESTINATION?c.r.push({r:d,d:f}):g.r.push({r:d,d:a}))}}}};const Vi=olympe.dc.Request.C.
|
|
720
|
-
olympe.dc.Request.C.Ng,oj=olympe.dc.Request.C.
|
|
721
|
-
function uj(a,b){const c=new olympe.dc.transaction.lg({
|
|
722
|
-
function zj(a,b){const c=b.V();a.H.C()&&a.H.debug(`Query (${c}) sent to orchestrator: ${b}`);b=xj(a,b);return rj(a,cj,b).then(d=>yj(a,d))}function vj(a,b,c,d=!0){const e=olympe.N.
|
|
723
|
-
function xj(a,b){const c=Wg(b);b={i:b.V(),b:[b.F],m:!0,v:!0};if(c[0]instanceof olympe.dc.query.va.
|
|
724
|
-
function tj(a,b,c){b=Ne(new olympe.dc.Request(b,olympe.dc.Pa.SELF,c),a.V());let d;null==(d=a.Xb)||d.
|
|
712
|
+
a);case Oi:return Qi(this,c)?this.C.deleteFileContent(a):b.send(c,a);default:return Promise.reject(`Messages of type ${a.getType()} is not supported by the source ${this.V()}`)}}Z(a,b){const c=a.nc(),d=a.getType();if(!Pi(this,c))return rxjs.throwError(()=>Error(`Subscription request not supported for data source ${this.db.name(c)} (${c}) which uses HTTP only.`));this.H.C()&&this.H.debug(`Subscription (type: ${d}) will be sent to remote data provider ${c}: ${a.content}`);return d===Hi?olympe.N.tb.observe(c,
|
|
713
|
+
this.G,a,{onRetry:b}):rxjs.throwError(()=>Error(`Do not handle subscription request of type ${d}`))}init(a){super.init(a);if(a.G)return this;olympe.dc.pa.from(this.K,this.K).cb(olympe.dm.DataSource.Mi).filter(olympe.dc.query.Aa.Ka(olympe.dm.DataSource.nh,!0)).filter(olympe.dc.query.Aa.Ka(olympe.dm.DataSource.dr,!0)).observe(this.G).subscribe(b=>{Se(b).forEach(this.bb.bind(this,a));Re(b).forEach(c=>{let d;null==(d=this.oa.get(c))||d.destroy();this.oa.delete(c)})});this.db.Ja(this.K,olympe.dm.DataSource.dr)&&
|
|
714
|
+
(new olympe.N.tb(this.K,this.G)).listen().subscribe(b=>{b=b.body();b instanceof olympe.dc.Request?a.kd(b):this.H.error('Self source received something else than a data request, ignore it.')});return this}destroy(){return v(function*(){})}bb(a,b){const c=b.X(),d=new olympe.D.Yb(`Published data provider context ${c}`,this.G);this.oa.set(c,d);let e,f;Ui(b,d).subscribe(g=>{let h;null==(h=e)||h();let k;null==(k=f)||k.stop();g!==olympe.dm.DataSource.Ce.wn&&(e=ei(this.C,c,l=>{Ri(b,l);return a.request(l)}),
|
|
715
|
+
d.onDestroy(()=>{let l;return null==(l=e)?void 0:l()}));g!==olympe.dm.DataSource.Ce.Ko&&(g=new olympe.D.Yb(`Bus Service of data source ${c}`,d),f=(new olympe.N.tb(c,g)).Br(this.Ta.bind(this)),f.listen().subscribe(l=>{l.Fh().then(n=>Si(this,a,b,l,n)).catch(n=>{this.H.warn(`Error occurred while processing request from ${l.source()}: ${n}`);return l.sh(n instanceof Error?n:Error(n))})}))})}Ta(a){const b=this.ba.get(a);this.ba.delete(a);if(a=b)null==(a=this.O.get(b))?a=0:(0<a.C&&--a.C,0===a.C?(a.H.debug(`Data subscription ${a.F} has more subscriber: unsubscribe`),
|
|
716
|
+
a.G.unsubscribe(),a=!0):(a.H.debug(`Data subscription ${a.F} has ${a.C} subscribers`),a=!1));a&&this.O.delete(b)}};class Ti{constructor(a,b,c,d){this.H=a;this.F=b;this.C=0;this.G=Te(c,d).subscribe({next:e=>{olympe.N.tb.publish(b,e).catch(f=>a.error(`Error occurred while publishing a data notification: ${f}`))},error:e=>a.error(`Error occurred while trying to subscribe to topic ${b} for a datasource: ${e}`)})}}olympe.dc.sources.fq.xa=[olympe.dc.sources.ej];olympe.dc.sources.tg=class extends olympe.N.tg{constructor(a){super();this.db=a;this.K=new Map}ha(a){a=this.C(a);if(0<this.K.size){const b=Array.from(this.K.values());this.K.clear();return{t:0,i:b,v:a}}return a}F(a){if(0===(null==a?void 0:a.t)){const b=a.i.reduce((c,d)=>{const e=new Map(Array.from(Object.entries(d.p).map(([f,g])=>[f,this.G(g)])));c.Lc(d.t,d.s,e,d.m);d.r.forEach(f=>c.Ea(f.r,d.t,f.d));return c},new olympe.dc.db.Qc);olympe.dc.zm().Gc(b);return this.G(a.v)}return this.G(a)}C(a){switch(!0){case a instanceof
|
|
717
|
+
olympe.dc.CloudObject:return a=a.X(),this.O(a),{t:10,v:a};case a instanceof olympe.dc.pa:return{t:11,v:a.ha()};case a instanceof olympe.dc.Oa:return{t:12,v:a.ha(this.O.bind(this))};case a instanceof olympe.dc.db.Qc:const b=new olympe.dc.transaction.lg;a.pd(b);return{t:13,i:a.V(),v:Sg(b)};case a instanceof olympe.dc.Request:return{t:14,r:a.getType(),o:a.origin,d:a.nc(),u:a.uc(),c:this.C(a.content)};case a instanceof olympe.dc.transaction.mi:return{t:15,r:a.Jg(),p:this.C(a.Wb())};case a instanceof olympe.dc.query.ld:return{t:16,
|
|
718
|
+
v:a.ha()};case a instanceof olympe.dc.Bc:return{t:17,v:a.X()};default:return super.C(a)}}G(a){if('object'!==typeof a||'number'!==typeof(null==a?void 0:a.t))return super.G(a);switch(a.t){case 10:return olympe.dc.CloudObject.get(a.v);case 11:a=a.v;var b=a.p.map(olympe.dc.query.va.Il.C),c=a.e;return new olympe.dc.pa(a.b,a.s,b,b.length-1,new Set(a.r),{max:c.m,offset:c.o,yd:c.s,ze:c.rm});case 12:return xh(a.v);case 13:return(new olympe.dc.transaction.yj).C(a.v,a.i);case 14:return c=null!=(b=this.G(a.c))?
|
|
719
|
+
b:void 0,Ne(new olympe.dc.Request(a.r,a.d,c,a.u),a.o);case 15:return b=this.G(a.p),new olympe.dc.transaction.mi(b,a.r);case 16:return a=a.v,new olympe.dc.query.ld((new olympe.dc.transaction.yj).C(a.p),a.s);case 17:return new olympe.dc.Bc(a.v);default:return super.G(a)}}O(a){if(!this.K.has(a)){if(!this.db.Fa(a))throw new olympe.dc.Bp(a);var b={};this.db.Cb(a).forEach((d,e)=>{b[e]=this.C(d)});var c={t:a,m:this.db.model(a),s:this.db.source(a),p:b,r:[]};this.K.set(a,c);for(const [d,e,f]of mg(this.db,
|
|
720
|
+
a)){const g=this.K.get(f);void 0!==g&&(e===olympe.dc.ua.DESTINATION?c.r.push({r:d,d:f}):g.r.push({r:d,d:a}))}}}};const Vi=olympe.dc.Request.C.eg,Wi=olympe.dc.Request.C.wg,Xi=olympe.dc.Request.C.xg,Yi=olympe.dc.Request.C.Jh,Zi=olympe.dc.Request.C.tn,$i=olympe.dc.Request.C.Yp,aj=olympe.dc.Request.C.ng,bj=olympe.dc.Request.C.Dj,cj=olympe.dc.Request.C.Ho,dj=olympe.dc.Request.C.Ds,ej=olympe.dc.Request.C.Es,fj=olympe.dc.Request.C.Fs,gj=olympe.dc.Request.C.cg,hj=olympe.dc.Request.C.Ff,ij=olympe.dc.Request.C.Mf,jj=olympe.dc.Request.C.ij,kj=olympe.dc.Request.C.Lu,lj=olympe.dc.Request.C.fu,mj=olympe.dc.Request.C.Co,nj=
|
|
721
|
+
olympe.dc.Request.C.Ng,oj=olympe.dc.Request.C.Yr,pj=olympe.dc.Request.C.Mb;function qj(a){return rj(a,olympe.dc.Request.C.eg).then(b=>{b=b.p;const c=Rg(b,a.V());a.H.C()&&a.H.debug('< Get Context result',b);a.H.O()&&a.H.log('< Get Context result has',b.length,'operations');return c})}function sj(a,b){const c=b.Wb();b=new olympe.dc.transaction.lg({sk:!0,ae:!1,oh:!1});c.pd(b);return rj(a,Xi,Sg(b)).finally(()=>{tj(a,jj,{id:c.V(),finalize:olympe.dc.transaction.jf.C.bi})}).then()}
|
|
722
|
+
function uj(a,b){const c=new olympe.dc.transaction.lg({ae:!1,oh:!1}),d=b.Wb();d.pd(c);return vj(a,Yi,{i:d.V(),r:b.Jg(),p:Sg(c)},!1).catch(e=>a.H.error(`Error while publishing burst transaction: ${e}`))}function wj(a,b){const c=encodeURI(Ga(olympe.Y.Qe(),JSON.stringify(xj(a,b))));a.H.C()&&a.H.debug(`Static GraphDef query ${b} sent to orchestrator`);return rj(a,aj,void 0,`query=${c}&v=${a.version}`).then(d=>yj(a,d))}
|
|
723
|
+
function zj(a,b){const c=b.V();a.H.C()&&a.H.debug(`Query (${c}) sent to orchestrator: ${b}`);b=xj(a,b);return rj(a,cj,b).then(d=>yj(a,d))}function vj(a,b,c,d=!0){const e=olympe.N.qe.Xn,f={c:b};Object.assign(f,c);if(d)return new Promise((g,h)=>{td(a.G,e,f,(k,l)=>{k?h(k):g(l)})});td(a.G,e,f);return Promise.resolve()}
|
|
724
|
+
function xj(a,b){const c=Wg(b);b={i:b.V(),b:[b.F],m:!0,v:!0};if(c[0]instanceof olympe.dc.query.va.Wd)Object.assign(b,{f:c[0].hc,q:[]});else{const d=new Map;for(let e=c.length-1;0<=e;e--){const f=c[e],g=f.C;let h;const k=(null!=(h=d.get(g))?h:new Set).add(f);if(f instanceof olympe.dc.query.va.If&&f.G){let l;null==(l=d.get(f.V()))||l.forEach(n=>k.add(n))}d.set(g,k)}Object.assign(b,{f:olympe.dc.cc.NONE,q:c.map(a.ba.bind(a,d))})}return b}
|
|
725
|
+
function tj(a,b,c){b=Ne(new olympe.dc.Request(b,olympe.dc.Pa.SELF,c),a.V());let d;null==(d=a.Xb)||d.kd(b)}function rj(a,b,c,d){const e=gi(a.C,a.V(),b);if('string'!==typeof e)return Promise.reject(`ServerProvider: no url for type ${b}`);b=O(`${e}${'string'===typeof d&&0<d.length?`?${d}`:''}`,void 0!==c?olympe.net.Ba.Nd.bh:olympe.net.Ba.Nd.GET,c&&JSON.stringify(c));P(b,{[olympe.net.Ba.Headers.Lh]:'application/json'});return hi(a.C,b).then(f=>'string'===typeof f&&0<f.length?JSON.parse(f):f)}
|
|
725
726
|
function yj(a,b){if(b&&'object'===typeof b){if(0<b.s)throw Error(b.info.error.reason);return Rg(b.p,a.V())}throw Error('Data result can be created only from Object');}
|
|
726
|
-
olympe.dc.sources.
|
|
727
|
-
{s:a}:{s:c,r:'Disconnected'});case Vi:return qj(this);case Wi:return a=new olympe.dc.transaction.lg({
|
|
728
|
-
Zi),olympe.net.Ba.
|
|
729
|
-
c=Promise.reject('Server is disconnected')),c;case kj:case lj:case mj:case oj:return vj(this,b,{});case hj:return this.C.downloadFileContent(a);case gj:return this.C.deleteFileContent(a);case ij:return this.C.uploadFileContent(a);default:return Promise.reject(`ServerProvider: Message of type ${b} not supported yet`)}}Z(a,b){if(a.getType()===bj){const c=a.content,d=c.V();return(new rxjs.Observable(e=>{const f=xj(this,c);this.K.set(d,e);vj(this,dj,f).catch(g=>e.error(g))})).pipe(olympe.N.operators.
|
|
730
|
-
(e,f)=>{this.H.debug(`Subscribe to topic ${e.V()} now that we are back online, after waiting for ${f}ms`);b()}),rxjs.operators.finalize(()=>{vj(this,ej,{i:d}).catch(e=>{this.H.warn(`Fail to unsubscribe to graphdef ${d}: ${e}`)}).finally(()=>{this.K.delete(d)})}))}return rxjs.throwError(()=>Error(`Subscription of type ${a.getType()} is not supported`))}init(a){super.init(a);md(this.G,olympe.N.
|
|
731
|
-
const c=olympe.dc.Request.C.
|
|
732
|
-
olympe.dc.ua.ORIGIN?1:2,v:!0,r:c.recursive,q:b.map(this.ba.bind(this,a))}}return{}}};olympe.dc.sources.
|
|
733
|
-
olympe.dc.sources.
|
|
734
|
-
!0;var a=new olympe.dc.Wa;Z(a.create(olympe.dm.DataSource,this.C).
|
|
735
|
-
olympe.dc.sources.U={
|
|
736
|
-
olympe.W.config(function(a){var b=a.getParameter(olympe.N.U.
|
|
737
|
-
D(a,olympe.dc.sources.R
|
|
738
|
-
olympe.dc.sources.R.
|
|
739
|
-
olympe.dc.R.pg,olympe.dc.sources.R.
|
|
740
|
-
function Ei(a,b,c,d,e=!1){return v(function*(){yield a.init();a.H.debug(`Cache: handle query ${b} graph patch: ${d.V()}`);d.T(a.G);(()=>v(function*(){try{const f=null===b?[]:Array.from(a.F.entries()).filter(([,h])=>h.has(b)).map(([h])=>h),g=1===f.length&&'__code-as-data__'===f[0];if(null===b||!g||a.ba)a.H.debug('Cache: persist graph patch',d.V()),e&&b&&(Array.from(d.Id()).filter(h=>!h.
|
|
741
|
-
a.ec.next(f)}finally{b&&Hj(a,'queries',b)}}))().then(()=>{})})}function Ij(){var a=olympe.dc.sources.
|
|
742
|
-
function Hj(a,b,c){const d=a.status.getValue();let e,f;null!=(f=null==(e=d[b])?void 0:e.values)&&f.delete(c)&&(d[b].processed+=1,0===d[b].values.size&&(delete d[b],('queries'===b?'files':'queries')in d||(d.processing=!1)),a.status.next(d))}function Jj(a){return v(function*(){a.G=new olympe.dc.db.
|
|
743
|
-
function Gj(a,b,c){return v(function*(){const d=Lj(b),e=[];for(const g of d){const h=g.tag();if(!(yield Mj(a.C,h)))if(Bj(a,'files',h),!1===g.Ja(olympe.dm.File.C.X())&&g.Ja(olympe.dm.File.urlProp.X())){var f=g.Ja(olympe.dm.File.urlProp.X());const k=O(f);k.F=olympe.net.Ba.ResponseType.
|
|
744
|
-
f={tag:h,model:g.
|
|
745
|
-
function Lj(a){const b=[olympe.dc.ga(olympe.dm.File)];if(olympe.dc.CloudObject.exists(olympe.dm.File))b.push(...olympe.dc.
|
|
727
|
+
olympe.dc.sources.uq=class extends olympe.dc.sources.Lk{constructor(a,b,c,d,e){super(a,c);this.G=b;this.C=d;this.O=new olympe.dc.transaction.yj(this.V());this.K=new Map;this.version=e||'unknown';olympe.D.Hi(this.F.Tf(),()=>{this.K.forEach((f,g)=>{f.error(new olympe.N.errors.sj('Connection to server has been recovered',g))})})}V(){return olympe.dc.Pa.SERVER}T(a){var b=a.getType(),c=a.content,d=Pe(a);switch(b){case pj:return c=olympe.dm.DataSource.Mb.Eb,a=olympe.dm.DataSource.Mb.eh,Promise.resolve(od(this.G)?
|
|
728
|
+
{s:a}:{s:c,r:'Disconnected'});case Vi:return qj(this);case Wi:return a=new olympe.dc.transaction.lg({ae:!1,oh:!1}),b=c.Wb(),b.pd(a),vj(this,Wi,{i:b.V(),r:c.Jg(),p:Sg(a)}).then();case Xi:return sj(this,c);case Yi:return uj(this,c);case nj:return a=new olympe.dc.transaction.lg({ae:!1,oh:!1}),c=c.Wb(),c.pd(a),vj(this,nj,{i:c.V(),p:Sg(a)}).then();case aj:return d.get(olympe.dc.pa.C.Xo)?wj(this,c):zj(this,c);case Zi:return od(this.G)?(c=xj(this,olympe.dc.pa.from(c)),c.f=olympe.dc.cc.fo,c=O(gi(this.C,olympe.dc.Pa.SERVER,
|
|
729
|
+
Zi),olympe.net.Ba.Nd.bh,JSON.stringify(c),olympe.net.Ba.ResponseType.Dq),P(c,{[olympe.net.Ba.Headers.Lh]:olympe.net.Ba.Ok.JSON}),c=hi(this.C,c)):(this.H.error(`Server is disconnected, backup of instance ${c} is canceled.`),c=Promise.reject('Server is disconnected')),c;case $i:return a=c.YC,b=c.debug,c=c.optional,od(this.G)?(d=gi(this.C,olympe.dc.Pa.SERVER,$i),c=O(d+`?debug=${b}&optional=${c}`,olympe.net.Ba.Nd.bh,a),P(c,{[olympe.net.Ba.Headers.Lh]:olympe.net.Ba.Ok.Uu}),c=hi(this.C,c)):(this.H.error('Server is disconnected, restore of instance is canceled.'),
|
|
730
|
+
c=Promise.reject('Server is disconnected')),c;case kj:case lj:case mj:case oj:return vj(this,b,{});case hj:return this.C.downloadFileContent(a);case gj:return this.C.deleteFileContent(a);case ij:return this.C.uploadFileContent(a);default:return Promise.reject(`ServerProvider: Message of type ${b} not supported yet`)}}Z(a,b){if(a.getType()===bj){const c=a.content,d=c.V();return(new rxjs.Observable(e=>{const f=xj(this,c);this.K.set(d,e);vj(this,dj,f).catch(g=>e.error(g))})).pipe(olympe.N.operators.Oi(olympe.N.errors.sj,
|
|
731
|
+
(e,f)=>{this.H.debug(`Subscribe to topic ${e.V()} now that we are back online, after waiting for ${f}ms`);b()}),rxjs.operators.finalize(()=>{vj(this,ej,{i:d}).catch(e=>{this.H.warn(`Fail to unsubscribe to graphdef ${d}: ${e}`)}).finally(()=>{this.K.delete(d)})}))}return rxjs.throwError(()=>Error(`Subscription of type ${a.getType()} is not supported`))}init(a){super.init(a);md(this.G,olympe.N.qe.Xn,this.oa.bind(this));return this}destroy(){return v(function*(){})}oa(a){var b=olympe.dc.Request.C.vn;
|
|
732
|
+
const c=olympe.dc.Request.C.ul;var d=a.c;if(d===olympe.dc.Request.C.Zn)a=this.O.C(a.p),tj(this,d,a);else if(d===b){var e=a.error.reason;b=this.O.C(a.p);tj(this,d,{id:a.i,rollback:b,error:e})}else d===fj?(d=a.i,a=this.O.C(a.p),null==(e=this.K.get(d))||e.next(a)):d===c&&tj(this,jj,{id:a.i,finalize:olympe.dc.transaction.jf.C.ul,error:0<a.s?a.info.error.reason:null})}ba(a,b){if(b instanceof olympe.dc.query.va.fh){const c=b.relation;let d;b=Array.from(null!=(d=a.get(b.V()))?d:[]);return{t:c.X(),d:c.Ga()===
|
|
733
|
+
olympe.dc.ua.ORIGIN?1:2,v:!0,r:c.recursive,q:b.map(this.ba.bind(this,a))}}return{}}};olympe.dc.sources.uq.xa=[olympe.dc.sources.ej];function Aj(a,b,c){const d=new olympe.D.Yb(`Source solver ${b.X()}`);b.cb(olympe.dm.md.G.Vb()).cb(olympe.dm.md.F).be().back().cb(olympe.dm.md.C).be().observe(d,{Kd:c}).subscribe(e=>{Se(e).forEach(([f,g])=>{a.F.set(f.X(),g.V())});Re(e).forEach(([f])=>{a.F.delete(f)})});b.cb(olympe.dm.rb.G).observe(d,{Kd:c}).subscribe(e=>{let f,g;a.G=null!=(g=null==(f=e.xc())?void 0:f.V())?g:null});d.onDestroy(()=>{a.F.clear();a.G=null})}
|
|
734
|
+
olympe.dc.sources.Qj=class{constructor(a,b,c){this.db=a;this.C=b;this.O=c;this.F=new Map;this.G=null;this.K=!1}fromModel(a){a=olympe.dc.ga(a);return this.F.has(a)?this.F.get(a):this.G&&this.T(a)?this.G:this.O}we(a){let b;return null!=(b=this.db.source(a))?b:this.O}xb(a){return a===this.C?olympe.dc.CloudObject.get(this.C):a===olympe.dc.Pa.SERVER?olympe.dc.CloudObject.get(olympe.dm.DataSource.SERVER):this.db.Fa(a)&&this.db.tc(a,olympe.dm.DataSource)?olympe.dc.CloudObject.get(a):null}T(){return!1}init(){if(!this.K){this.K=
|
|
735
|
+
!0;var a=new olympe.dc.Wa;Z(a.create(olympe.dm.DataSource,this.C).Qi(this.C),olympe.dm.DataSource.nh,!0);a.Ea(olympe.dm.DataSource.Mi,this.C,this.C);a.kb(()=>{olympe.dc.pa.from(this.C).observe(olympe.D.Dg()).subscribe(()=>{})})}}};olympe.dc.sources.R={Ca:'dc.sources.Logger',fl:'dc.sources.HTTPService',Ss:'dc.sources.IOService',Wp:'dc.sources.RemoteProvider',mq:'dc.sources.ServerProvider',Rz:'dc.sources.OfflineProvider',Ke:'dc.sources.SourceSolver',$d:'dc.sources.Serializer',$n:'dc.sources.cache.Cache',ao:'dc.sources.cache.DATABASE',Jk:'dc.sources.cache.Logger'};
|
|
736
|
+
olympe.dc.sources.U={dl:'data.httpHost',Sh:'data.httpPort',Oo:'data.httpSSL',cl:'data.httpBasePath',El:'data.pollingFrequency',Ce:'data.communicationMode',Ll:'data.restrictedUse',VERSION:'version.version'};
|
|
737
|
+
olympe.W.config(function(a){var b=a.getParameter(olympe.N.U.Rk);F(a,olympe.dc.sources.U.dl,b);var c=a.getParameter(olympe.dc.sources.U.dl);c=(b=['localhost','127.0.0.1'].includes(c))||c.endsWith(a.getParameter(olympe.net.U.oj));F(a,olympe.dc.sources.U.Sh,b?3141:c?80:443);F(a,olympe.dc.sources.U.Oo,!c);F(a,olympe.dc.sources.U.cl,'runtime/data');F(a,olympe.dc.sources.U.El,null);F(a,olympe.dc.sources.U.Ce,null);F(a,olympe.dc.sources.U.Ll,null);E(a,olympe.dc.sources.R.Ca,[olympe.ma.R.Ha],d=>d.Mc('data'));
|
|
738
|
+
D(a,olympe.dc.sources.R.$d,olympe.dc.sources.tg,olympe.dc.R.$e);xa(a,olympe.N.R.$d,olympe.dc.sources.R.$d);D(a,olympe.dc.sources.R.fl,olympe.dc.sources.Is,olympe.dc.sources.R.Ca,olympe.net.R.oi,olympe.N.R.el,olympe.auth.R.Ha,olympe.dc.sources.R.Ke,olympe.N.R.$d,new olympe.W.ka(olympe.N.U.Ek));D(a,olympe.dc.sources.R.Ss,olympe.dc.sources.Wo,olympe.dc.sources.R.Ca,olympe.dc.R.pg,olympe.net.R.Ha,olympe.auth.R.Ha);D(a,olympe.dc.sources.R.Wp,olympe.dc.sources.fq,olympe.dc.sources.R.Ca,new olympe.W.ka(olympe.dc.U.rg),
|
|
739
|
+
olympe.dc.sources.R.fl,olympe.N.R.Xe,olympe.dc.R.$e,olympe.dc.sources.R.Ke);D(a,olympe.dc.sources.R.mq,olympe.dc.sources.uq,olympe.dc.sources.R.Ca,olympe.N.R.Ij,olympe.N.R.Xe,olympe.dc.sources.R.fl,new olympe.W.ka(olympe.dc.sources.U.VERSION));D(a,olympe.dc.sources.R.Ke,olympe.dc.sources.Qj,olympe.dc.R.$e,new olympe.W.ka(olympe.dc.U.rg),new olympe.W.ka(olympe.dc.U.Tk));E(a,olympe.dc.sources.R.Jk,[olympe.ma.R.Ha],d=>d.Mc('datacache'));D(a,olympe.dc.sources.R.$n,olympe.dc.sources.cache.Cache,olympe.dc.sources.R.Jk,
|
|
740
|
+
olympe.dc.R.pg,olympe.dc.sources.R.ao,olympe.dc.db.R.Ha,olympe.net.R.Ha,olympe.N.R.Xe,olympe.Bb.R.rl,olympe.Y.R.$f,new olympe.W.ka(olympe.net.U.yp),new olympe.W.ka(olympe.dc.sources.U.VERSION));D(a,olympe.dc.sources.R.ao,olympe.dc.sources.cache.wj,olympe.Bb.R.sg,olympe.dc.sources.R.Jk,olympe.dc.sources.R.$d,olympe.Bb.R.nj)},'olympe.dc.sources');olympe.W.run([olympe.dc.sources.R.Ke,olympe.dc.sources.R.$n],(a,b)=>{olympe.dc.Rd=()=>a;olympe.dc.sources.Pd=()=>b});olympe.dc.sources.cache={};olympe.dc.sources.cache.errors={};olympe.dc.sources.cache.errors.Rl=class extends Error{constructor(a){super(a)}};olympe.dc.sources.cache.errors.ks=class extends olympe.dc.sources.cache.errors.Rl{};olympe.dc.sources.cache.errors.Iu=class extends olympe.dc.sources.cache.errors.Rl{};olympe.dc.sources.cache.errors.Ru=class extends olympe.dc.sources.cache.errors.Rl{};function Di(a,b,c){return v(function*(){Bj(a,'queries',b);yield a.init();const d=a.F.has(c)?a.F.get(c):new Set;d.has(b)||(d.add(b),a.F.set(c,d),a.O.next(Cj(a)));return Dj(a.C,b,c)})}
|
|
741
|
+
function Ei(a,b,c,d,e=!1){return v(function*(){yield a.init();a.H.debug(`Cache: handle query ${b} graph patch: ${d.V()}`);d.T(a.G);(()=>v(function*(){try{const f=null===b?[]:Array.from(a.F.entries()).filter(([,h])=>h.has(b)).map(([h])=>h),g=1===f.length&&'__code-as-data__'===f[0];if(null===b||!g||a.ba)a.H.debug('Cache: persist graph patch',d.V()),e&&b&&(Array.from(d.Id()).filter(h=>!h.Sd()).map(h=>h.tag()),yield Ej(a.C)),yield Fj(a.C,d,0<f.length?b:null),Gj(a,d,c).catch(h=>{a.H.error(`Cache: Failed to download files of a graph patch: ${h}`)})}catch(f){a.H.error(`Cache: Failed to handle graph patch ${d.V()} with message: ${f}`),
|
|
742
|
+
a.ec.next(f)}finally{b&&Hj(a,'queries',b)}}))().then(()=>{})})}function Ij(){var a=olympe.dc.sources.Pd();a.ba=!0;a.Ab=!0}function Bj(a,b,c){const d=a.status.getValue();b in d||(d[b]={total:0,processed:0,values:new Set});d[b].total+=1;d[b].values.add(c);d.processing=!0;a.status.next(d)}
|
|
743
|
+
function Hj(a,b,c){const d=a.status.getValue();let e,f;null!=(f=null==(e=d[b])?void 0:e.values)&&f.delete(c)&&(d[b].processed+=1,0===d[b].values.size&&(delete d[b],('queries'===b?'files':'queries')in d||(d.processing=!1)),a.status.next(d))}function Jj(a){return v(function*(){a.G=new olympe.dc.db.Qc;const b=yield Kj(a.C);for(const c of b)c.pd(a.G);a.fa.next(0<b.length)})}
|
|
744
|
+
function Gj(a,b,c){return v(function*(){const d=Lj(b),e=[];for(const g of d){const h=g.tag();if(!(yield Mj(a.C,h)))if(Bj(a,'files',h),!1===g.Ja(olympe.dm.File.C.X())&&g.Ja(olympe.dm.File.urlProp.X())){var f=g.Ja(olympe.dm.File.urlProp.X());const k=O(f);k.F=olympe.net.Ba.ResponseType.Dk;e.push(new Promise((l,n)=>{a.Oc.C(k,p=>{p=p.yc();200<=p&&300>p?l():n(`Failed to download file ${g}. Response code ${p}`);Hj(a,'files',h)})}))}else{let k;const l=null!=(k=g.Ja(olympe.dm.File.mimeTypeProp.X()))?k:'application/octet-stream';
|
|
745
|
+
f={tag:h,model:g.Ec(),mimeType:l};const n=new olympe.dc.Request(olympe.dc.Request.C.Ff,c,f);f=Fa(a.ed,()=>a.Xb.request(n).then(p=>Nj(a.C,h,p,l))).finally(()=>Hj(a,'files',h));e.push(f)}}yield Promise.allSettled(e).then(g=>{g.forEach((h,k)=>{if('rejected'===h.status){let l;a.H.warn(`Cache: File content for ${null==(l=d[k])?void 0:l.tag()} was not found`)}})})})}
|
|
746
|
+
function Lj(a){const b=[olympe.dc.ga(olympe.dm.File)];if(olympe.dc.CloudObject.exists(olympe.dm.File))b.push(...olympe.dc.pa.from(olympe.dm.File).Qf(olympe.dc.CloudObject.extendedByRel).hd().keys());else for(const c of b){let d,e;b.push(...(null!=(e=null==(d=a.Hd(c))?void 0:d.ab(olympe.dc.CloudObject.extendedByRel,f=>f))?e:[]))}return b.reduce((c,d)=>{let e,f;d=Array.from(null!=(f=null==(e=a.Hd(d))?void 0:e.ab(olympe.dc.CloudObject.instancesRel,g=>g))?f:[]).map(g=>a.Hd(g));return c.concat(d)},[])}
|
|
746
747
|
function Oj(a,b){return Array.from(a.F.values()).some(c=>c.has(b))}function Cj(a){return Array.from(a.F.keys()).filter(b=>'__code-as-data__'!==b)}function Pj(a,b){return v(function*(){yield a.init();if(b){var c,d=Array.from(null!=(c=a.F.get(b))?c:[]);a.F.delete(b);var e=Array.from(a.F.values()).reduce((f,g)=>{g.forEach(h=>f.add(h));return f},new Set);yield Qj(a.C,b);a.O.next(Cj(a));d.filter(f=>!e.has(f));yield Ej(a.C)}else yield Promise.all(Cj(a).map(f=>Pj(a,f)))})}
|
|
747
748
|
function Rj(a){if(!(2>a.length))for(let b=a.length-1;0<b;b--)for(let c=b-1;0<=c;c--)a[c].T(a[b])}
|
|
748
|
-
function Sj(a,b,c){return v(function*(){var d=olympe.dc.Request.C.wg;const e=olympe.dc.Request.C.
|
|
749
|
-
l=yield a.Xb.request(l);b.
|
|
750
|
-
function Uj(a,b,c){return c instanceof olympe.N.errors.
|
|
751
|
-
c.message)):new olympe.dc.sources.cache.errors.
|
|
752
|
-
function Vj(){var a=olympe.dc.sources.
|
|
749
|
+
function Sj(a,b,c){return v(function*(){var d=olympe.dc.Request.C.wg;const e=olympe.dc.Request.C.cg,f=olympe.dc.Request.C.Mf;a.H.debug('Sync Cache: Applying transaction patch to destination',c,b.V());const g=Lj(b);a.H.debug(`Sync Cache: Found ${g.length} files to send`);yield Promise.all(g.map(h=>v(function*(){const k=h.tag();var l=h.Ec();if(h.Sd())l=new olympe.dc.Request(e,c,{tag:k,model:l});else{const n=yield Tj(a.C,k);l=new olympe.dc.Request(f,c,{tag:k,model:l,content:n.content,mimeType:n.C})}if(!Lc(a.nb))throw Error('Lost connection, stop syncing');
|
|
750
|
+
l=yield a.Xb.request(l);b.Uc(k,new Map([[olympe.dm.File.urlProp.X(),l]]))})));d=new olympe.dc.Request(d,c,new olympe.dc.transaction.mi(b,!1));if(!Lc(a.nb))throw Error('Lost connection, stop syncing');yield a.Xb.request(d)})}
|
|
751
|
+
function Uj(a,b,c){return c instanceof olympe.N.errors.Sj||c instanceof olympe.N.errors.Sn?(a.H.error('Sync Cache: Timeout or Connection error',c),new olympe.dc.sources.cache.errors.ks('The connection has been lost. It can happen when the application loose connectivity or when the remote server is not responding correctly',c.message)):c instanceof olympe.N.errors.eq?(a.H.error(`Sync Cache: transaction has been rejected by ${b} data source`,c),new olympe.dc.sources.cache.errors.Iu('The transaction has been rejected by the datasource',
|
|
752
|
+
c.message)):new olympe.dc.sources.cache.errors.Ru('Synchronisation error',c.message)}
|
|
753
|
+
function Vj(){var a=olympe.dc.sources.Pd();if(a.T)return rxjs.throwError(()=>Error('Another synchronisation is in progress'));a.T=!0;a.H.info('Sync Cache: Start synchronising transactions');const b=new rxjs.BehaviorSubject([null,null]);(()=>v(function*(){yield a.init();const c=yield Wj(a.C);let d=0;const e=Array.from(c.values()).reduce((f,g)=>f+g.length,0);0<e&&b.next([e,d]);for(const [f,g]of c){Rj(g);for(const h of g){a.H.debug(`Sync Cache: Processing patch ${d+1}/${e} (${h.V()})`);try{yield Sj(a,
|
|
753
754
|
h,f),yield Xj(a.C,h)}catch(k){throw Uj(a,f,k);}d+=1;b.next([e,d])}}a.K=null}))().then(()=>{a.T=!1;b.complete()}).catch(c=>{b.error(c.message)}).finally(()=>{Jj(a).finally(()=>{a.T=!1})});return b.asObservable()}
|
|
754
|
-
function Yj(){const a=olympe.dc.sources.
|
|
755
|
-
function ak(a){const b=olympe.dc.sources.
|
|
756
|
-
function ck(){const a=olympe.dc.sources.
|
|
757
|
-
olympe.dc.sources.cache.Cache=class{constructor(a,b,c,d,e,f,g,h,k,l){this.H=a;this.Xb=b;this.C=c;this.Ta=d;this.
|
|
758
|
-
this.T=!1;this.ec=new rxjs.Subject;this.
|
|
759
|
-
a):b.C.executeQuery(a)})}applyTransaction(a,b){const c=this;return v(function*(){c.H.debug('Cache: apply transaction',a,b);yield c.init();const d=a.Wb(),e=Array.from(d.yb.keys());let f,g;const h=Array.from(null!=(g=null==(f=c.K)?void 0:f.C.yb.keys())?g:[]);let k;b!==(null==(k=c.K)?void 0:k.F)||e.some(l=>!h.includes(l))?(yield gk(c.C,d,b),c.K=new olympe.dc.sources.cache.
|
|
760
|
-
c){const d=this;return v(function*(){yield d.init();yield Nj(d.C,a,b,c);return`offline://${a}`})}downloadFileContent(a){const b=this;return v(function*(){yield b.init();return Tj(b.C,a).then(c=>c.content)})}deleteFileContent(a){const b=this;return v(function*(){yield b.init();yield hk(b.C,[a])})}};olympe.dc.sources.cache.
|
|
755
|
+
function Yj(){const a=olympe.dc.sources.Pd();return v(function*(){var b=new Set;const c={files:[],patches:[],version:a.version};var d=Lj(a.G);for(const e of d)b.has(e.tag())||(d=yield Tj(a.C,e.tag()),c.files.push({t:e.tag(),m:d.C,c:a.za.C(d.content)}),b.add(e.tag()));b=yield Zj(a.C);c.patches.push(...b);return JSON.stringify(c)})}
|
|
756
|
+
function ak(a){const b=olympe.dc.sources.Pd();return v(function*(){let c;try{c=JSON.parse(a)}catch(e){throw Error('Invalid pending changes, must be a JSON string');}var d=c.files;if(!Array.isArray(c.patches)||!Array.isArray(d))throw Error('Invalid pending changes, must contain a `patches` array and a `files` array');for(const e of c.files)d=b.za.G(e.c),yield Nj(b.C,e.t,d,e.m);yield bk(b.C,c.patches);yield Jj(b);b.Ta.Gc(b.G)})}
|
|
757
|
+
function ck(){const a=olympe.dc.sources.Pd();return v(function*(){yield dk(a.C);yield Jj(a)})}
|
|
758
|
+
olympe.dc.sources.cache.Cache=class{constructor(a,b,c,d,e,f,g,h,k,l){this.H=a;this.Xb=b;this.C=c;this.Ta=d;this.Oc=e;this.nb=f;this.bb=g;this.za=h;this.version=l;this.ba=this.version!==this.bb.get('__code-as-data-version__');this.Nb=this.Ab=!1;this.F=new Map;this.O=new rxjs.BehaviorSubject([]);this.K=null;this.fa=new rxjs.BehaviorSubject(!1);this.G=new olympe.dc.db.Qc;this.ac=this.Tb=!1;this.oa=[];this.Z=0;this.Fd=new rxjs.BehaviorSubject(!1);this.status=new rxjs.BehaviorSubject({processing:!1});
|
|
759
|
+
this.T=!1;this.ec=new rxjs.Subject;this.ed=new olympe.Y.promise.zu(k)}yc(){return this.status.asObservable()}init(){const a=this;return v(function*(){if(!a.Tb)if(a.ac)yield new Promise(b=>{a.oa.push(b)});else{a.ac=!0;(yield ek(a.C)).forEach(b=>{a.F.set(b.name,new Set(b.C))});a.O.next(Cj(a));yield Jj(a);a.Ta.Gc(a.G);for(const b of a.oa)b();a.Tb=!0;a.oa=[]}})}executeQuery(a){const b=this;return v(function*(){yield b.init();return Oj(b,a.V())&&Wg(a).some(c=>c instanceof olympe.dc.query.va.Wd)?fk(b.C,
|
|
760
|
+
a):b.C.executeQuery(a)})}applyTransaction(a,b){const c=this;return v(function*(){c.H.debug('Cache: apply transaction',a,b);yield c.init();const d=a.Wb(),e=Array.from(d.yb.keys());let f,g;const h=Array.from(null!=(g=null==(f=c.K)?void 0:f.C.yb.keys())?g:[]);let k;b!==(null==(k=c.K)?void 0:k.F)||e.some(l=>!h.includes(l))?(yield gk(c.C,d,b),c.K=new olympe.dc.sources.cache.hs(d,b),c.fa.next(!0)):(d.pd(c.K.C),yield gk(c.C,c.K.C,b));d.pd(c.G);yield Fj(c.C,d,'local-transaction')})}uploadFileContent(a,b,
|
|
761
|
+
c){const d=this;return v(function*(){yield d.init();yield Nj(d.C,a,b,c);return`offline://${a}`})}downloadFileContent(a){const b=this;return v(function*(){yield b.init();return Tj(b.C,a).then(c=>c.content)})}deleteFileContent(a){const b=this;return v(function*(){yield b.init();yield hk(b.C,[a])})}};olympe.dc.sources.cache.hs=class{constructor(a,b){this.C=a;this.F=b}};olympe.dc.sources.cache.Cache.F='__code-as-data-version__';olympe.dc.sources.cache.Cache.C='__code-as-data__';function ek(a){return v(function*(){return(yield a.db.G('buckets')).map(b=>olympe.dc.sources.cache.Cp.Ub(b))})}function Kj(a){return v(function*(){return(yield a.db.G('pending-transactions')).map(b=>{b=olympe.dc.sources.cache.ah.Ub(b);return a.C.F(b.C)})})}function Dj(a,b,c){return v(function*(){a.H.debug(`Offline DB: Adding query ${b} in bucket ${c}`);return a.db.F()})}function Ej(a){return v(function*(){return a.db.F()})}
|
|
761
762
|
function Fj(a,b,c){a.H.debug(`Offline DB: Apply patch ${b.V()} on local offline db`);Array.from(b.yb.keys());return a.db.F().then(()=>{null===c&&(b.yb.forEach((d,e)=>a.G.add(e)),a.K().then(()=>{}))})}function Mj(a,b){return new Promise((c,d)=>{null!==a.files?c(a.files.has(b)):a.F.push(e=>{let f;return e?d(e):c(!(null==(f=a.files)||!f.has(b)))})})}
|
|
762
|
-
function Nj(a,b,c,d){c=new olympe.dc.sources.cache.
|
|
763
|
-
function Xj(a,b){return v(function*(){return a.db.remove('pending-transactions',b.V()).then(()=>{})})}function Tj(a,b){return v(function*(){const c=yield a.db.get('files',b);if(!c)throw Error(`File ${b} not found in offline cache database`);return olympe.dc.sources.cache.
|
|
763
|
+
function Nj(a,b,c,d){c=new olympe.dc.sources.cache.Cl(b,c,d);a.files.add(b);return a.db.set('files',c.toJSON()).then(()=>{}).catch(e=>{a.files.delete(b);throw e;})}function Qj(a,b){return v(function*(){return a.db.remove('buckets',b).then(()=>{})})}function Wj(a){return v(function*(){return(yield a.db.G('pending-transactions')).reduce((b,c)=>{c=olympe.dc.sources.cache.ah.Ub(c);const d=c.F;let e;const f=null!=(e=b.get(d))?e:[];f.push(a.C.F(c.C));b.set(d,f);return b},new Map)})}
|
|
764
|
+
function Xj(a,b){return v(function*(){return a.db.remove('pending-transactions',b.V()).then(()=>{})})}function Tj(a,b){return v(function*(){const c=yield a.db.get('files',b);if(!c)throw Error(`File ${b} not found in offline cache database`);return olympe.dc.sources.cache.Cl.Ub(c)})}function Zj(a){return v(function*(){return a.db.G('pending-transactions')})}
|
|
764
765
|
function bk(a,b){return v(function*(){const c=new Map;for(const d of b){const e=olympe.dc.sources.cache.ah.Ub(d);e&&c.set(e.C.i,d)}yield a.db.fa()})}function dk(a){return v(function*(){return a.db.clear('pending-transactions').then(()=>{})})}
|
|
765
|
-
function fk(a,b){return v(function*(){const c=b.xb();a.H.debug(`Offline DB: Executing query ${b.V()} by ID with source ${c}`);const d=olympe.dc.query.
|
|
766
|
+
function fk(a,b){return v(function*(){const c=b.xb();a.H.debug(`Offline DB: Executing query ${b.V()} by ID with source ${c}`);const d=olympe.dc.query.ld.yi(b);var e=(yield a.db.K(b.V())).map(f=>olympe.dc.sources.cache.kg.Ub(f));for(const f of e){if(f.source!==c)continue;e=olympe.dc.sources.cache.wj.bc(f);const g=ik(a,f.xd);d.create(f.tag,e,g);for(const h of f.lb)if(e=h.match(/^([a-z0-9]*)(<|>)([a-z0-9]*)$/)){const [,k,l,n]=e;e='<'===l;k===olympe.dc.pc.Zc&&!0===e||d.Ea(k,e?n:f.tag,e?f.tag:n)}}a.H.C()&&
|
|
766
767
|
a.H.debug(`Offline DB: Data result for query ${b.V()}`,d.Wb().yb.size,'instances',Array.from(d.Wb().sd()).length,'relations');return d})}function gk(a,b,c){b=a.C.ha(b);a.H.debug(`save transaction in destination '${c}'`,JSON.stringify(b));return a.db.set('pending-transactions',(new olympe.dc.sources.cache.ah(c,b,Date.now())).toJSON())}function jk(a){return v(function*(){return a.db.O('pending-transactions')})}function hk(a,b){return v(function*(){b.forEach(c=>a.files.delete(c));yield a.db.ba()})}
|
|
767
768
|
function ik(a,b){return Object.entries(b).reduce((c,[d,e])=>c.set(d,a.C.F(e)),new Map)}
|
|
768
|
-
olympe.dc.sources.cache.
|
|
769
|
-
var f=Date.now();yield e.db.F().then(()=>{});e.H.debug(`Offline DB GC: has taken ${Date.now()-f}ms to run`)}})},5E3)}static bc(a){const b=new RegExp(`^(${olympe.dc.
|
|
770
|
-
if(!g)return d;f=new Map;const h=new Set([g.tag]);d.create(g.tag,olympe.dc.sources.cache.
|
|
771
|
-
Promise.resolve([]);r.X();return b.db.K().then(z=>z.map(A=>olympe.dc.sources.cache.
|
|
772
|
-
olympe.dc.query.va.
|
|
773
|
-
olympe.dc.sources.cache.
|
|
774
|
-
olympe.dc.sources.cache.
|
|
769
|
+
olympe.dc.sources.cache.wj=class{constructor(a,b,c,d){this.O=`Olympe_Cache_${a}`;this.H=b;this.C=c;this.db=d.F(this.O);this.G=new Set;this.F=[];this.files=null;this.db.T('files').then(e=>{this.files=new Set(e);this.F.forEach(f=>f(null))}).catch(e=>{this.F.forEach(f=>f(e))});this.K=olympe.Y.Promise.pm(()=>{const e=this;return v(function*(){if(!(0===e.G.size||0<(yield jk(e))))if(0<e.db.Z())e.K().then(()=>{}),e.H.debug('Offline DB GC: Postponing round while the stack is busy');else{e.H.debug(`Offline DB GC: Round with ${e.G.size} candidates`);
|
|
770
|
+
var f=Date.now();yield e.db.F().then(()=>{});e.H.debug(`Offline DB GC: has taken ${Date.now()-f}ms to run`)}})},5E3)}static bc(a){const b=new RegExp(`^(${olympe.dc.pc.Zc})>([a-z0-9]*)$`);for(const c of a.lb)if(a=c.match(b))return a[2];return null}executeQuery(a){const b=this;return v(function*(){const c=Date.now();b.H.debug(`Offline DB: Executing query ${a.V()} with source ${a.xb()}`);const d=olympe.dc.query.ld.yi(a),e=a.xb();var f=yield b.db.get('instances',a.F),g=olympe.dc.sources.cache.kg.Ub(f);
|
|
771
|
+
if(!g)return d;f=new Map;const h=new Set([g.tag]);d.create(g.tag,olympe.dc.sources.cache.wj.bc(g),ik(b,g.xd));for(const p of Wg(a))if(p instanceof olympe.dc.query.va.fh){var k=p.relation;g=k.Ga()===olympe.dc.ua.ORIGIN;const q=k.X(),r=k.Vb();k=new Set;f.set(p.V(),k);const t=[f.has(p.C)?new Set(f.get(p.C)):new Set([a.F])];for(const u of t){const w=new Map;var l=yield Promise.all(Array.from(u).map(y=>{if(!h.has(y))return b.H.warn(`Offline DB: Instance ${y} not found while processing query part, this should not happen`),
|
|
772
|
+
Promise.resolve([]);r.X();return b.db.K().then(z=>z.map(A=>olympe.dc.sources.cache.kg.Ub(A))).then(z=>{w.set(y,z)})})).then(()=>w);for(const [y,z]of l){p instanceof olympe.dc.query.va.If&&p.G&&k.add(y);for(const A of z)if(l=A.tag,A.source===e){if(p instanceof olympe.dc.query.va.If&&!k.has(l)){var n=t[t.length-1];n||(n=new Set,t.push(n));n.add(l)}k.add(l);h.has(l)||(h.add(l),n=olympe.dc.sources.cache.wj.bc(A),d.create(l,n,ik(b,A.xd)));q===olympe.dc.pc.Zc&&!0===g||d.Ea(q,g?l:y,g?y:l)}}}}else p instanceof
|
|
773
|
+
olympe.dc.query.va.Wd&&b.H.warn(`Offline DB: Trying to execute a query ${a.V()} on the Cache DB that contains a FollowRule part. This is not supported and designed not to happen.`);b.H.C()&&(b.H.debug(`Offline DB: Data result for query ${a.V()}`,d.Wb().yb.size,'instances',Array.from(d.Wb().sd()).length,'relations'),b.H.debug(`Offline DB: Data result for query ${a.V()} took ${Date.now()-c}ms to be executed`));return d})}};
|
|
774
|
+
olympe.dc.sources.cache.Cp=class{constructor(a,b){this.name=a;this.C=b}static Ub(a){return a?new olympe.dc.sources.cache.Cp(a.name,a.queryIds):null}toJSON(){return{name:this.name,queryIds:this.C}}};
|
|
775
|
+
olympe.dc.sources.cache.kg=class{constructor(a,b,c,d,e){this.tag=a;this.source=b;this.xd=null!=c?c:{};this.lb=null!=d?d:[];this.C=null!=e?e:[]}static Ub(a){return a?new olympe.dc.sources.cache.kg(a.tag,a.source,a.props,a.relations,a.queryIds):null}toJSON(){return{tag:this.tag,source:this.source,props:this.xd,relations:this.lb,queryIds:this.C}}};
|
|
775
776
|
olympe.dc.sources.cache.ah=class{constructor(a,b,c){this.F=a;this.C=b;this.timestamp=c}static Ub(a){return a?new olympe.dc.sources.cache.ah(a.destination,a.patch,a.timestamp):null}toJSON(){return{destination:this.F,patch:this.C,timestamp:this.timestamp}}};
|
|
776
|
-
olympe.dc.sources.cache.
|
|
777
|
-
olympe.dc.sources.cache.
|
|
778
|
-
olympe.dc.sources.cache.
|
|
779
|
-
e.push(this.G);let g;b=new olympe.dc.sources.cache.
|
|
780
|
-
d=null!=(f=this.C.get(c))?f:new olympe.dc.sources.cache.
|
|
781
|
-
f.
|
|
782
|
-
b,!1);this.K.clear()}fa(b){const c=new Map;b.forEach(d=>{const e=d.split(',');let f=c.get(e[0]);void 0===f&&(f=new Map,c.set(e[0],f));f.set(e[1],this.G.get(d))});return c}ba(b,c,d){this.za(b,c,d);this.
|
|
783
|
-
c)=>{this.O((d,e)=>{for(const f of this.Z)f.unsubscribe();d?b():c(e)})})}update(b,c,d){const e=olympe.dc.ga(b),f=olympe.dc.ga(c);void 0===e||void 0===f?olympe.dc.yh().
|
|
784
|
-
this.
|
|
785
|
-
e]of Object.entries(b)){b=d;let f=typeof e;20<b.length&&b.startsWith('fd')&&(b=olympe.dc.
|
|
786
|
-
case '6':c.set(b,new Date(Date.UTC(e.y||1970,e.M&&e.M-1||0,e.d||1,e.h,e.m,e.s,e.S)));break;case '7':c.set(b,new olympe.D.Color(e.r,e.g,e.b,e.a));break;case '8':c.set(b,new olympe.dc.
|
|
787
|
-
function sk(a,b,c,d){d(a.C);c&&b!==olympe.dc.Pa.SELF&&(c=a.F.get(b),c||(c=new olympe.dc.db.
|
|
788
|
-
olympe.dc.transaction.
|
|
789
|
-
e=nk(this,c);let f=pk(this,b)&&pk(this,c)&&d!==olympe.dc.Pa.SELF&&e!==olympe.dc.Pa.SELF;f&&d!==e&&a!==olympe.dc.
|
|
790
|
-
f=!1);sk(this,d,f,g=>{g.fc(a,b,c,ok(this,b),ok(this,c))})}};function uk(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.
|
|
791
|
-
class wk{constructor(){this.T=new Map}Z(a){return a instanceof olympe.D.Na||a instanceof olympe.D.ea||a instanceof olympe.D.aa?a.valueOf():a instanceof Date||a instanceof olympe.D.
|
|
777
|
+
olympe.dc.sources.cache.Rt=class extends olympe.dc.sources.cache.ah{constructor(a,b,c,d){super(a,b,c);this.error=d}static Ub(a){return a?new olympe.dc.sources.cache.Rt(a.destination,a.patch,a.timestamp,a.error):null}toJSON(){return{destination:this.F,patch:this.C,timestamp:this.timestamp,error:this.error}}};
|
|
778
|
+
olympe.dc.sources.cache.Cl=class{constructor(a,b,c){this.tag=a;this.content=b;this.C=c}static Ub(a){return a?new olympe.dc.sources.cache.Cl(a.tag,a.content,a.mimetype):null}toJSON(){return{tag:this.tag,content:this.content,mimetype:this.C}}};function kk(a,b){let c=a.O.get(b);c||(c=new Set(a.C.get(b).lb),a.O.set(b,c));return c}
|
|
779
|
+
olympe.dc.sources.cache.Ks=class{constructor(a,b,c){this.H=a;this.G=c;this.C=new Map;this.T=new Set;this.Z=new Set;this.K=b;this.O=new Map}Id(){this.T.forEach(a=>this.C.delete(a));Array.from(this.C.entries()).forEach(([a,b])=>{b||this.C.delete(a)});return this.C}Lc(a,b,c){const d=this.C.get(a);d||this.Z.add(a);var e;c=Array.from(null!=c?c:[]).reduce((h,k)=>{h[k[0]]=this.K.ha(k[1]);return h},null!=(e=null==d?void 0:d.xd)?e:{});let f;e=null!=(f=null==d?void 0:d.C)?f:[];null===this.G||e.includes(this.G)||
|
|
780
|
+
e.push(this.G);let g;b=new olympe.dc.sources.cache.kg(a,b,c,null!=(g=null==d?void 0:d.lb)?g:[],e);this.C.set(a,b)}Uc(a,b){const c=this.C.get(a);if(c){var d;c.xd=Array.from(b).reduce((e,[f,g])=>{null===g?delete e[f]:e[f]=this.K.ha(g);return e},null!=(d=c.xd)?d:{})}else this.H.warn(`Trying to update an instance (${a}) which do not exists in the cache database: ignoring.`)}F(a){this.T.add(a)}Ea(a,b,c){var d;const e=null!=(d=this.C.get(b))?d:new olympe.dc.sources.cache.kg(b,'unknown',{},[],[]);var f;
|
|
781
|
+
d=null!=(f=this.C.get(c))?f:new olympe.dc.sources.cache.kg(c,'unknown',{},[],[]);b=`${a}${olympe.dc.ua.ORIGIN}${b}`;f=(g,h)=>{this.C.set(g.tag,g);const k=kk(this,g.tag);k.has(h)||(g.lb.push(h),k.add(h));null===this.G||g.C.includes(this.G)||g.C.push(this.G)};f(e,`${a}${olympe.dc.ua.DESTINATION}${c}`);f(d,b)}fc(a,b,c){const d=this.C.get(b),e=this.C.get(c);c=`${a}${olympe.dc.ua.DESTINATION}${c}`;a=`${a}${olympe.dc.ua.ORIGIN}${b}`;b=(f,g)=>{const h=kk(this,f.tag);if(h.has(g)){const k=f.lb.indexOf(g);
|
|
782
|
+
f.lb.splice(k,1);h.delete(g)}};d&&b(d,c);e&&b(e,a)}};olympe.dc.sources.cache.Ks.xa=[olympe.dc.Writable];olympe.dc.transaction={};olympe.dc.Kh=class a{constructor(b,c){this.id=null!=b?b:olympe.Y.Fc();this.F=new olympe.D.Yb('BurstTransaction#'+this.id,c);this.Ab=lk(this);this.T=!1;this.F.onDestroy(()=>this.O());this.Z=new Set;this.G=new Map;this.K=new Set;this.C=null;let d;this.bb=null!=(d=olympe.W.getParameter(olympe.dc.transaction.U.un))?d:30;this.oa=[]}static C(b,c){return`${b},${c}`}Nb(b){for(const c of this.oa)c(b);this.stop()}Ta(){null!==this.C&&(clearTimeout(this.C),this.C=null);const b=this.fa(this.K);0<b.size&&mk(this,
|
|
783
|
+
b,!1);this.K.clear()}fa(b){const c=new Map;b.forEach(d=>{const e=d.split(',');let f=c.get(e[0]);void 0===f&&(f=new Map,c.set(e[0],f));f.set(e[1],this.G.get(d))});return c}ba(b,c,d){this.za(b,c,d);this.Ab(b,c,d);null===this.C&&(this.C=setTimeout(this.Ta.bind(this),this.bb))}za(b,c,d){b=a.C(b,c);this.G.set(b,d);this.K.add(b)}nb(b,c){return this.G.get(a.C(b,c))}push(b,c){const d=olympe.dc.ga(b);b=c.subscribe(e=>{for(const [f,g]of e)e=olympe.dc.ga(f),this.nb(d,e)!==g&&this.ba(d,e,g.valueOf())});this.Z.add(b)}complete(){return new Promise((b,
|
|
784
|
+
c)=>{this.O((d,e)=>{for(const f of this.Z)f.unsubscribe();d?b():c(e)})})}update(b,c,d){const e=olympe.dc.ga(b),f=olympe.dc.ga(c);void 0===e||void 0===f?olympe.dc.yh().eb().error('Burst transaction: instance tag or property tag is undefined'):(this.F.run(()=>{olympe.D.Tm([d],g=>{this.T=!0;if(g instanceof olympe.dc.Bc)olympe.dc.yh().eb().error('Cannot send complex property values in burst transactions');else{var h;this.ba(e,f,null!=(h=null==g?void 0:g.valueOf())?h:null)}})}),this.F.Z(()=>{this.O()}))}stop(){this.F.destroy();
|
|
785
|
+
this.oa.length=0}getContext(){return this.F}V(){return this.id}Jg(){return!1}O(b){if(this.T){this.T=!1;null!==this.C&&(clearTimeout(this.C),this.C=null);this.K.clear();const c=this.fa(new Set(this.G.keys()));mk(this,c,!0,b)}else null==b||b(!0)}toString(){return'Burst transaction #'+this.id}};olympe.dc.Kh.prototype.complete=olympe.dc.Kh.prototype.complete;olympe.dc.Kh.prototype.push=olympe.dc.Kh.prototype.push;olympe.dc.Ep=class{C(){}toString(){}};olympe.dc.transaction.yj=class a{constructor(b){this.F=null!=b?b:olympe.dc.Pa.SERVER}C(b,c){c=new olympe.dc.db.Qc(c);this.G(b,c);return c}G(b,c){for(const d of b)switch(d.o){case 1:b=a.C(d.p||{});let e;c.Lc(d.t,null!=(e=d.s)?e:this.F,b,d.m);break;case 2:c.Uc(d.t,a.C(d.p),d.m);break;case 3:c.F(d.t,d.f,d.m);break;case 4:c.Ea(d.m,d.l,d.r,d.lm,d.rm);break;case 5:c.fc(d.m,d.l,d.r,d.lm,d.rm);break;case 6:break;default:throw Error('Undefined patch operation: '+d.o);}}static C(b){const c=new Map;for(const [d,
|
|
786
|
+
e]of Object.entries(b)){b=d;let f=typeof e;20<b.length&&b.startsWith('fd')&&(b=olympe.dc.mj.Ee+b.substring(2));'object'===f&&(f=e&&e.c?String(e.c):'untyped');switch(f){case '1':case '2':case '3':throw Error('Complex format for primitive types not supported.');case 'string':c.set(b,String(e));break;case 'boolean':c.set(b,!!e);break;case 'number':c.set(b,Number(e));break;case '4':c.set(b,new Date(Date.UTC(e.y,e.M-1,e.d,e.h,e.m,e.s,e.S)));break;case '5':c.set(b,new Date(Date.UTC(e.y,e.M-1,e.d)));break;
|
|
787
|
+
case '6':c.set(b,new Date(Date.UTC(e.y||1970,e.M&&e.M-1||0,e.d||1,e.h,e.m,e.s,e.S)));break;case '7':c.set(b,new olympe.D.Color(e.r,e.g,e.b,e.a));break;case '8':c.set(b,new olympe.dc.Bc(e.t));break;case 'untyped':null===e&&c.set(b,null)}}return c}};function nk(a,b){let c;return null!=(c=a.sources.get(b))?c:a.K.we(b)}function ok(a,b){let c,d,e;return null!=(e=null!=(d=null==(c=a.C.Hd(b))?void 0:c.Ec())?d:a.db.model(b))?e:null}function pk(a,b){let c;return null!=(c=a.G.get(b))?c:a.db.Uf(b)||!a.db.Fa(b)}function qk(a,b){0===a.G.size?a.G=b:b.forEach((c,d)=>a.G.set(d,c))}function rk(a){return Array.from(a.C.Id()).filter(b=>!b.Sd()).map(b=>b.tag())}
|
|
788
|
+
function sk(a,b,c,d){d(a.C);c&&b!==olympe.dc.Pa.SELF&&(c=a.F.get(b),c||(c=new olympe.dc.db.Qc(a.id),a.F.set(b,c)),d(c))}function tk(a,b,c){const d=nk(a,b),e=pk(a,b),f=ok(a,b);sk(a,d,e,g=>{g.F(b,c,f)})}
|
|
789
|
+
olympe.dc.transaction.Zt=class{constructor(a,b,c){this.id=null!=c?c:olympe.Y.Fc();this.K=b;this.db=a;this.F=new Map;this.C=new olympe.dc.db.Qc(this.id);this.sources=new Map;this.G=new Map}zh(){return 0===this.C.yb.size}Lc(a,b,c,d){let e;const f=null!=(e=null!=c?c:this.sources.get(a))?e:this.K.fromModel(b);c=pk(this,a);this.sources.set(a,f);sk(this,f,c,g=>{g.Lc(a,f,d,b)})}Uc(a,b){const c=nk(this,a),d=pk(this,a),e=ok(this,a);sk(this,c,d,f=>{f.Uc(a,null!=b?b:new Map,e)})}Ea(a,b,c){const d=nk(this,b),
|
|
790
|
+
e=nk(this,c);let f=pk(this,b)&&pk(this,c)&&d!==olympe.dc.Pa.SELF&&e!==olympe.dc.Pa.SELF;f&&d!==e&&a!==olympe.dc.pc.Zc&&(olympe.ma.eb('dc').warn(`Try to create a relation between 2 objects that have different locations: ${b}-[${a}]->${c}, originSrc: ${d}, destinationSrc: ${e}`),f=!1);sk(this,d,f,g=>{g.Ea(a,b,c,ok(this,b),ok(this,c))})}fc(a,b,c){const d=nk(this,b),e=nk(this,c);let f=pk(this,b)&&pk(this,c)&&d!==olympe.dc.Pa.SELF&&e!==olympe.dc.Pa.SELF;f&&d!==e&&a!==olympe.dc.pc.Zc&&(olympe.ma.eb('dc').warn(`Try to delete a relation between 2 objects that have different locations: ${b}-[${a}]->${c}`),
|
|
791
|
+
f=!1);sk(this,d,f,g=>{g.fc(a,b,c,ok(this,b),ok(this,c))})}};function uk(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.Zo.rq)if(e===olympe.dc.Pa.SELF)d[g]=olympe.dc.ja().V();else{if(e===olympe.dc.Pa.SERVER)continue}else g.startsWith(olympe.dc.mj.Ee)&&(g='fd'+g.substring(1));e=a.Z(e);c&&e instanceof Object&&8===e.c?a.T.set(g,e):d[g]=e}return d}function vk(a){if(0===a.T.size)return null;const b=Object.create(null);a.T.forEach((c,d)=>{b[d]=c});a.T.clear();return b}
|
|
792
|
+
class wk{constructor(){this.T=new Map}Z(a){return a instanceof olympe.D.Na||a instanceof olympe.D.ea||a instanceof olympe.D.aa?a.valueOf():a instanceof Date||a instanceof olympe.D.gb?(a=a instanceof olympe.D.gb?a.valueOf():a,{c:4,y:a.getUTCFullYear(),M:a.getUTCMonth()+1,d:a.getUTCDate(),h:a.getUTCHours(),m:a.getUTCMinutes(),s:a.getUTCSeconds(),S:a.getUTCMilliseconds(),z:0}):a instanceof olympe.D.Color?{c:7,r:a.Gi().valueOf(),g:a.Di().valueOf(),b:a.Bi().valueOf(),a:a.zi().valueOf()}:a&&'function'===
|
|
792
793
|
typeof a.X?{c:8,t:a.X()}:a}}function Sg(a){const b=a.K.concat(a.G).concat(a.O).concat(a.C).concat(a.T);a.O=[];a.G=[];a.C=[];a.T=[];a.K=[];return b}
|
|
793
|
-
olympe.dc.transaction.lg=class{constructor({
|
|
794
|
-
b,c=null){b=uk(this.Z,b||null,!1);a={o:2,t:a,p:b};this
|
|
795
|
-
if(!b)throw Error('Cannot delete relation with undefined origin');if(!c)throw Error('Cannot delete relation with undefined destination');a={o:5,m:a,l:b,r:c};this
|
|
794
|
+
olympe.dc.transaction.lg=class{constructor({sk:a=!1,oh:b=!0,ae:c=!0}={}){this.O=[];this.G=[];this.C=[];this.T=[];this.K=[];this.sk=null!=a?a:!1;this.ae=null!=c?c:!0;this.oh=null!=b?b:!0;this.Z=olympe.D?new wk:new class extends wk{Z(d){return d&&'function'===typeof d.X?{c:8,t:d.X()}:d}}}flush(){return JSON.stringify(Sg(this))}Lc(a,b,c,d=null){c=uk(this.Z,null!=c?c:null,this.sk);c={o:1,t:a,p:c};this.oh&&(c.s=b);this.ae&&d&&(c.m=d);this.O.push(c);this.sk&&(b=vk(this.Z))&&this.C.push({o:2,t:a,p:b})}Uc(a,
|
|
795
|
+
b,c=null){b=uk(this.Z,b||null,!1);a={o:2,t:a,p:b};this.ae&&c&&(a.m=c);this.C.push(a)}F(a,b,c=null){a={o:3,t:a,f:b};this.ae&&c&&(a.m=c);this.G.push(a)}Ea(a,b,c,d=null,e=null){if(!a)throw Error('Cannot create relation of undefined type');if(!b)throw Error(`Cannot create relation ${a} from undefined origin to ${c}`);if(!c)throw Error(`Cannot create relation ${a} from ${b} to undefined destination`);a={o:4,m:a,l:b,r:c};this.ae&&d&&(a.lm=d);this.ae&&e&&(a.rm=e);this.T.push(a)}fc(a,b,c,d=null,e=null){if(!a)throw Error('Cannot delete relation of undefined type');
|
|
796
|
+
if(!b)throw Error('Cannot delete relation with undefined origin');if(!c)throw Error('Cannot delete relation with undefined destination');a={o:5,m:a,l:b,r:c};this.ae&&d&&(a.lm=d);this.ae&&e&&(a.rm=e);this.K.push(a)}};olympe.dc.transaction.lg.xa=[olympe.dc.Writable];function xk(a,b){b instanceof olympe.dc.Wa&&b.F.forEach((c,d)=>a.F.set(d,c));a.Ya.push(b);return b}function yk(a,b,c,d){c=a.create(null!=c?c:olympe.dc.CloudObject,void 0);if('string'===typeof b)b=b||'',Z(c,olympe.dc.CloudObject.nameProp.X(),b);else for(const [f,g]of Object.entries(b))Z(c,f,g);b=c.X();d=null!=d?d:olympe.dc.CloudObject;const e=olympe.dc.CloudObject.extendRel.X();xk(a,new olympe.dc.transaction.Ya.io(e,b));xk(a,new olympe.dc.transaction.Ya.Pk(e,b,d));return c}
|
|
796
797
|
function zk(a){return 0<a.length?(b,c)=>{a.forEach(d=>null==d?void 0:d(b,c))}:void 0}
|
|
797
|
-
olympe.dc.Wa=class{constructor(a){this.id=null!=a?a:olympe.Y.
|
|
798
|
-
this.F.set(c,b);if(b){let f;b=null!=(f=this.G.get(c))?f:d.model(c);if(null===b)throw Error(`Try to persist an instance that does not exist: ${c}`);var e;d=null!=(e=d.source(a))?e:olympe.dc.
|
|
799
|
-
}return this}delete(a,b=olympe.dc.cc.
|
|
800
|
-
a,d);this.Ea(olympe.dm.Property.typeRel,d,b);this.Ea(olympe.dc.CloudObject.containsRel,a,d);return d}
|
|
801
|
-
f),olympe.dm.Relation.fa,g),olympe.dm.Relation.T,h);this.Ea(olympe.dc.CloudObject.
|
|
802
|
-
function mk(a,b,c,d){var e=olympe.dc.yh();const f=olympe.dc.Request.C.Jh,g=olympe.dc.Request.C.Ng,h=a.V();a=a.Jg();const k=new Map;for(const l of b.keys()){const n=e.db.source(l);if(n===olympe.dc.Pa.SELF||!e.db.
|
|
803
|
-
function Ak(a,b,c){var d=olympe.dc.yh();if(c&&'function'===typeof b){const e=a.V();d.C.set(e,b);Bk(d,a,(f,g)=>{f||(d.C.delete(e),b(f,g))},!1)}else Bk(d,a,b,!1)}function Ck(a){const b=olympe.dc.Request.C.
|
|
804
|
-
function Bk(a,b,c,d=!1){c=c?olympe.D.Xa().G(c):void 0;const e=b.V(),f=new olympe.dc.transaction.
|
|
798
|
+
olympe.dc.Wa=class{constructor(a){this.id=null!=a?a:olympe.Y.Fc();this.Ya=[];this.G=new Map;this.O=!0;this.F=new Map;this.K=[]}V(){return this.id}model(a){let b;return null!=(b=this.G.get(olympe.dc.ga(a)))?b:olympe.dc.ja().model(a)}C(a){qk(a,this.F);for(const b of this.Ya)b.C(a)}create(a,b){b=xk(this,new olympe.dc.transaction.Ya.Wn(a,b));const c=b.X();this.G.set(c,olympe.dc.ga(a));let d;this.persist(c,null!=(d=this.F.get(c))?d:this.O);return b}persist(a,b=!0){const c=olympe.dc.ga(a);var d=olympe.dc.ja();
|
|
799
|
+
this.F.set(c,b);if(b){let f;b=null!=(f=this.G.get(c))?f:d.model(c);if(null===b)throw Error(`Try to persist an instance that does not exist: ${c}`);var e;d=null!=(e=d.source(a))?e:olympe.dc.Rd().fromModel(b);xk(this,new olympe.dc.transaction.Ya.$t(c,d))}else{if((e=d.Fa(c))&&d.Uf(c))throw Error(`Try to remove persistence of an instance already persisted: ${c}`);if(!e&&!this.G.has(c))throw Error(`Try to remove persistence of an instance that does not exist and is not part of the transaction: ${c}`);
|
|
800
|
+
}return this}delete(a,b=olympe.dc.cc.zc){xk(this,new olympe.dc.transaction.Ya.jo(a,b))}update(a,b,c){return xk(this,new olympe.dc.transaction.Ya.Su(a,b,c))}Ea(a,b,c){xk(this,new olympe.dc.transaction.Ya.Pk(a,b,c))}fc(a,b,c){xk(this,new olympe.dc.transaction.Ya.vs(a,b,c))}qm(a,b){xk(this,new olympe.dc.transaction.Ya.io(a,b))}defineProperty(a,b,c,d,e,f){d=this.create(olympe.dm.Property,f);Z(d,olympe.dc.CloudObject.nameProp,c||'');void 0!==e&&this.update(a,olympe.dc.mj.Ee+d.X(),e);this.Ea(olympe.dc.CloudObject.propertyRel,
|
|
801
|
+
a,d);this.Ea(olympe.dm.Property.typeRel,d,b);this.Ea(olympe.dc.CloudObject.containsRel,a,d);return d}ar(a,b,c='',{gC:d=olympe.dm.Relation.K.Nt,rC:e=olympe.dm.Relation.C.Tp,mC:f=olympe.dm.Relation.C.Sr,QC:g=olympe.dm.Relation.C.Ls,dC:h=olympe.dm.yk.NONE,PC:k=olympe.dm.Relation.O|h}={},l=olympe.Y.Fc()){c=Z(Z(Z(Z(Z(Z(Z(Z(this.create(olympe.dm.Relation,l),olympe.dc.CloudObject.nameProp,c||''),olympe.dm.Relation.F,d),olympe.dm.Relation.G,k),olympe.dm.Relation.ba,e),olympe.dm.Relation.oa,e),olympe.dm.Relation.Z,
|
|
802
|
+
f),olympe.dm.Relation.fa,g),olympe.dm.Relation.T,h);this.Ea(olympe.dc.CloudObject.Li,a,c);this.Ea(olympe.dm.Relation.destinationModelRel,c,b);this.Ea(olympe.dc.CloudObject.containsRel,a,c);return c}Jg(){return!1}hm(a){this.K.push(olympe.D.Xa().G(a))}kb(a,b){a=zk([...this.K,a].filter(c=>'function'===typeof c));Ak(this,a,b)}sm(a){a=zk([...this.K,a]);Bk(olympe.dc.yh(),this,a,!0)}toString(){return`Transaction #${this.id}`}};olympe.dc.Wa.xa=[olympe.dc.Ep];function lk(a){var b=olympe.dc.yh();const c=a.V();b.K.set(c,a);a.getContext().onDestroy(()=>{b.K.delete(c)});return(d,e,f)=>{const g=new olympe.dc.db.Qc(c);g.Uc(d,(new Map).set(e,f),b.db.model(d));b.G.Gc(g)}}
|
|
803
|
+
function mk(a,b,c,d){var e=olympe.dc.yh();const f=olympe.dc.Request.C.Jh,g=olympe.dc.Request.C.Ng,h=a.V();a=a.Jg();const k=new Map;for(const l of b.keys()){const n=e.db.source(l);if(n===olympe.dc.Pa.SELF||!e.db.Uf(l))continue;let p=k.get(n);p||(p=new olympe.dc.db.Qc(h),k.set(n,p));p.Uc(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.mi(n,a)),b=e.Xb.request(b).catch(p=>null==d?void 0:d(!1,`${p}`)),c&&b.then(()=>null==d?void 0:d(!0))}
|
|
804
|
+
function Ak(a,b,c){var d=olympe.dc.yh();if(c&&'function'===typeof b){const e=a.V();d.C.set(e,b);Bk(d,a,(f,g)=>{f||(d.C.delete(e),b(f,g))},!1)}else Bk(d,a,b,!1)}function Ck(a){const b=olympe.dc.Request.C.ij;Ue(a.Xb,olympe.dc.Request.C.vn,c=>{var d=c.content;c=d.id;var e=d.rollback;d=d.error;const f=a.K.get(c);void 0!==f&&(a.K.delete(c),f.Nb(d));a.G.Gc(e);a.H.warn(`Fast update (id=${c}) has been refused and is rolled back. Error: ${d}`)});Ue(a.Xb,b,c=>{c=c.content;Dk(a,c.id,c.finalize,c.error)})}
|
|
805
|
+
function Bk(a,b,c,d=!1){c=c?olympe.D.Xa().G(c):void 0;const e=b.V(),f=new olympe.dc.transaction.Zt(a.db,a.T,e);b.C(f);if(f.zh()){null==c||c(!0);var g;null==(g=a.C.get(e))||g(!0);a.C.delete(e)}else{a.F.set(e,[]);var h=rk(f);a.G.C.bb(h);g=h.filter(l=>pk(f,l));var k=[Lf(a.G,f.C,g),c];Ek(a,f,g).then(l=>{k.splice(1,0,l);Fk(a,e,h,f.F.size+1);return Gk(a,f.F,d,b.Jg())}).then(()=>{k.forEach(l=>null==l?void 0:l(!0,null));Dk(a,e,olympe.dc.transaction.jf.C.bi,null)}).catch(l=>{a.H.error(l);k.forEach(n=>null==
|
|
805
806
|
n?void 0:n(!1,l));Hk(a,e)})}}
|
|
806
|
-
function Ek(a,b,c){const d=b.C,e=olympe.dm.File.urlProp.X();c=c.filter(n=>{let p;return a.db.
|
|
807
|
-
else{var u=n.X(),w,y=null!=(w=n.get(olympe.dm.File.mimeTypeProp))?w:'application/data';a.Z.Z(u,t,y,z=>{const A=h.reduce((C,M)=>C||M.Hd(u),null);null!==A&&(z=(new Map).set(e,z).set(f,!0).set(g,new Date),A.
|
|
808
|
-
new olympe.dc.db.
|
|
809
|
-
function Gk(a,b,c,d){const e=c?olympe.dc.Request.C.xg:olympe.dc.Request.C.wg;return Promise.all(Array.from(b).map(([f,g])=>a.Xb.request(new olympe.dc.Request(e,f,new olympe.dc.transaction.
|
|
810
|
-
function Ik(a,b){if(0<a.F.size){const c=olympe.D.Xa();a.O.push(()=>{!c.
|
|
811
|
-
olympe.dc.transaction.jf=class{constructor(a,b,c,d,e,f){this.H=a;this.G=b;this.db=b.view;this.Xb=c;this.T=d;this.Z=e;this.timeout=f;this.K=new Map;this.F=new Map;this.O=[];this.C=new Map;Ck(this)}
|
|
812
|
-
olympe.W.config(function(a){F(a,olympe.dc.transaction.U.TIMEOUT,6E4);F(a,olympe.dc.transaction.U.
|
|
813
|
-
olympe.dc.transaction.Ya.
|
|
814
|
-
if(!this.F)throw Error('OperationError: Cannot create relation, destination tag is undefined, null or empty string');this.relation.Ga()===olympe.dc.ua.DESTINATION?a.Ea(b,olympe.dc.ga(this.origin),olympe.dc.ga(this.F)):a.Ea(b,olympe.dc.ga(this.F),olympe.dc.ga(this.origin))}toString(){return`CreateRelation('${this.relation.Ga()}${this.relation.X()}, ${olympe.dc.ga(this.origin)}, ${olympe.dc.ga(this.F)})`}};olympe.dc.transaction.Ya.
|
|
815
|
-
a.fc(b,c,f):a.fc(b,f,c)}toString(){return`DeleteAllRelations(${this.Ga()}${this.getType()})`}};olympe.dc.transaction.Ya.
|
|
816
|
-
this.relation.Ga()===olympe.dc.ua.DESTINATION?a.fc(b,c,d):a.fc(b,d,c)}toString(){return'DeleteRelation('+this.relation.Ga()+this.relation.X()+', '+olympe.dc.ga(this.origin)+', '+olympe.dc.ga(this.F)+')'}};olympe.dc.transaction.Ya.
|
|
817
|
-
for(const [e,f]of c){var d=this.
|
|
818
|
-
k)&&(h===olympe.dc.ua.ORIGIN?b.Ea(g,k,this.tag):b.Ea(g,this.tag,k))}}toString(){return`PersistOperation: tag - ${this.tag}, src - ${this.source}`}};olympe.dc.ga=function(a){let b=null;if('string'===typeof a)return a;if('function'===typeof(null==a?void 0:a.X)&&(null==a||!a.zg))b=a.X();else if('function'===typeof a){let d;b=null!=(d=olympe.dc.
|
|
819
|
-
olympe.dc.defineProperty=function(a){return new olympe.dc.Ma.Property(a)};olympe.dc.
|
|
820
|
-
olympe.dc.
|
|
821
|
-
olympe.dc.
|
|
822
|
-
olympe.dc.
|
|
823
|
-
olympe.dc.ya=class{constructor(a,b,c){void 0===a||null===a?olympe.
|
|
824
|
-
b,'] - Unregistered');const c=a.C.get(b);if(null==c)var d=0;else 0<c.counter&&c.counter--,d=0===c.counter;d&&(c.C.release(),a.C.delete(b));this.C=null})}return this}
|
|
825
|
-
this.
|
|
826
|
-
this.
|
|
827
|
-
if(c instanceof olympe.dc.Ma.Property)throw Error(`ListDef.transform(): Properties cannot be used as transformer, unlike relations ${c}`);if(!c||'function'!==typeof c.C)break;a.push(c)}b=new olympe.dc.ya(this.F,a);b.Bd(Kk(b)||this.valueType||Object);return b}
|
|
828
|
-
return a}toString(){let a=this.da;a=a?', '+(a.join?a.join(', '):a.toString()):'';return'ListDef(#'+olympe.D.Qa(this.F)+a+')'}
|
|
829
|
-
olympe.dc.ya.prototype.forEachCurrentValue=olympe.dc.ya.prototype.
|
|
830
|
-
olympe.dc.ya.prototype.observeAt=olympe.dc.ya.prototype.
|
|
831
|
-
m.vd.L=new olympe.D.J(()=>String,[]);m.
|
|
832
|
-
m.
|
|
833
|
-
olympe.dc.
|
|
834
|
-
'one of the argument is not a Transformer '+d);const e=d.Pb();null!==e&&(this.valueType=e);this.da.push(d)}return this}
|
|
835
|
-
this.valueType=a.Pb()||olympe.dc.CloudObject;return this}
|
|
836
|
-
a=new olympe.dc.$.zd(b,a);b=this.Ya.pop();break;case Nk.
|
|
837
|
-
'Provided argument "models" must be an array.');const b=[];for(let c=0;c<a.length;c++)b.push(Pk(a[c]));return this.
|
|
838
|
-
const c=[],d=[];a.forEach(e=>{c.push(e);d.push(e.Ga())});return this.
|
|
839
|
-
1]instanceof olympe.dc.da
|
|
840
|
-
c&&this.da.push(new olympe.dc.da.ug(c,b));return this}sort(a,b,c){const d=new class extends olympe.dc.
|
|
841
|
-
function Pk(a){return'string'===typeof a||a instanceof olympe.D.Na?a:'function'===typeof a?olympe.dc.
|
|
842
|
-
m.
|
|
843
|
-
function Rk(a,b){if(b.T())a.H.debug('ListProcessor: [ID:',b.V(),'] - Subscription already booted, ignoring');else{a.H.debug('ListProcessor: [ID:',b.V(),'] - Booting subscription');var c=new olympe.dc.jc.
|
|
844
|
-
function Uk(a,b,c,d){const e=[b.
|
|
845
|
-
function Vk(a,b,c,d){a.H.debug('CoverageProcessor: [ID:',c,'] - checking coverage of remote query over',b.length,'paths.');const e=olympe.D.Xa(),f=new olympe.async.
|
|
846
|
-
function Sk(a,b,c){const d=new olympe.dc.jc.
|
|
807
|
+
function Ek(a,b,c){const d=b.C,e=olympe.dm.File.urlProp.X();c=c.filter(n=>{let p;return a.db.tc(n,olympe.dm.File)&&void 0!==(null==(p=d.Hd(n))?void 0:p.Ja(e))}).map(olympe.dc.CloudObject.get);if(0===c.length)return Promise.resolve(null);const f=olympe.dm.File.C.X(),g=olympe.dm.File.modificationDateProp.X(),h=Array.from(b.F.values()),k=[],l=olympe.Y.Qe();return Promise.all(c.map(n=>{const p=n.get(e);if(p.startsWith('blob:'))return new Promise((q,r)=>{l.F(p,t=>{if(null===t)URL.revokeObjectURL(p),q();
|
|
808
|
+
else{var u=n.X(),w,y=null!=(w=n.get(olympe.dm.File.mimeTypeProp))?w:'application/data';a.Z.Z(u,t,y,z=>{const A=h.reduce((C,M)=>C||M.Hd(u),null);null!==A&&(z=(new Map).set(e,z).set(f,!0).set(g,new Date),A.gm(z),k.push([u,z]));URL.revokeObjectURL(p);q()},r)}},r)});2048<p.length&&a.H.error('Trying to create a file with an URL longer than 2048. It likely is a data url and should be an object url. File tag:',n.X());return Promise.resolve([])})).then(()=>{const n=k.reduce((p,[q,r])=>{p.Uc(q,r);return p},
|
|
809
|
+
new olympe.dc.db.Qc);return Lf(a.G,n)})}function Fk(a,b,c,d){const e=olympe.D.Dg(),f=new olympe.async.Aj(e);0<a.timeout&&f.cn(a.timeout);const g=olympe.dc.transaction.jf.C.Jt;let h=!0;const k=a.F.get(b);for(let l=0;l<d;l++)f.add((n,p)=>{k.push(e.G((q,r)=>{h&&(h=q!==g);r?p(r):n()}))});Bc(f,(l,n)=>{l||a.H.warn(`An error occurred while processing the notification of transaction (${b}): ${n}.`);h&&a.G.C.Ab(c);Hk(a,b)});f.start()}
|
|
810
|
+
function Gk(a,b,c,d){const e=c?olympe.dc.Request.C.xg:olympe.dc.Request.C.wg;return Promise.all(Array.from(b).map(([f,g])=>a.Xb.request(new olympe.dc.Request(e,f,new olympe.dc.transaction.mi(g,d))))).then()}function Dk(a,b,c,d){(a=(a=a.F.get(b))&&a.pop())&&a(c,d)}function Hk(a,b){var c;null==(c=a.F.get(b))||c.forEach(d=>{d(olympe.dc.transaction.jf.C.bi,null)});a.F.delete(b);if(0===a.F.size){for(const d of a.O)d();a.O=[]}a.C.has(b)&&(c=a.C.get(b),a.C.delete(b),c(!0))}
|
|
811
|
+
function Ik(a,b){if(0<a.F.size){const c=olympe.D.Xa();a.O.push(()=>{!c.hb()&&c.run(b)})}else b()}
|
|
812
|
+
olympe.dc.transaction.jf=class{constructor(a,b,c,d,e,f){this.H=a;this.G=b;this.db=b.view;this.Xb=c;this.T=d;this.Z=e;this.timeout=f;this.K=new Map;this.F=new Map;this.O=[];this.C=new Map;Ck(this)}eb(){return this.H}he(a){this.Xb.request(new olympe.dc.Request(olympe.dc.Request.C.Co,olympe.dc.Pa.SERVER)).then(b=>{a(b.ids,b.undo_stack_size,b.redo_stack_size)}).catch(b=>this.H.error('Failed to process get stack request',b))}};olympe.dc.transaction.jf.C={ul:0,bi:1,Jt:2};olympe.dc.transaction.mi=class{constructor(a,b=!1){this.C=a;this.F=b}Jg(){return this.F}Wb(){return this.C}};olympe.dc.transaction.R={Ca:'dc.transaction.Logger',Ha:'dc.transaction.Manager'};olympe.dc.transaction.U={TIMEOUT:'dc.transaction.timeout',un:'dc.transaction.burstInterval'};
|
|
813
|
+
olympe.W.config(function(a){F(a,olympe.dc.transaction.U.TIMEOUT,6E4);F(a,olympe.dc.transaction.U.un,30);E(a,olympe.dc.transaction.R.Ca,[olympe.ma.R.Ha],b=>b.Mc('dc'));D(a,olympe.dc.transaction.R.Ha,olympe.dc.transaction.jf,olympe.dc.transaction.R.Ca,olympe.dc.db.R.Ha,olympe.dc.R.pg,olympe.dc.sources.R.Ke,olympe.dc.R.gj,new olympe.W.ka(olympe.dc.transaction.U.TIMEOUT))},'olympe.dc.transaction');olympe.dc.transaction.Ya={};function Jk(a,b){const c=new Map;for(const [d,e]of b)c.set(d,a.Qa(e));return c}olympe.dc.transaction.Ya.Zf=class{constructor(){this.ja=olympe.dc.ja()}C(){throw Error('Abstract method build() not override !');}toString(){throw Error('Abstract method toString() not override !');}Qa(a){a=olympe.D.Qa(a);return void 0===a||null===a?null:olympe.D.tr(a)?a.valueOf():a}};olympe.dc.transaction.Ya.Zf.xa=[olympe.dc.Ep];olympe.dc.transaction.Ya.mn=class extends olympe.dc.transaction.Ya.Zf{constructor(a,b){super();this.relation=a instanceof olympe.dc.Ma.Relation?a:new olympe.dc.Ma.Relation(olympe.dc.ga(a));this.origin=this.ja.Fa(b)?olympe.dc.CloudObject.get(b):b}getType(){return this.relation.X()}Ga(){return this.relation.Ga()}C(){throw Error('Abstract method build() not override !');}toString(){throw Error('Abstract method toString() not override !');}};function Z(a,b,c){a.xd.set(olympe.dc.ga(b),c);return a}olympe.dc.transaction.Ya.Wn=class extends olympe.dc.transaction.Ya.Zf{constructor(a,b){super();let c;this.tag=null!=(c=b&&olympe.dc.ga(b))?c:olympe.Y.sf();this.model=olympe.dc.ga(a);this.source=null;this.xd=new Map}X(){return this.tag}bc(){return this.model}Qi(a){this.source=a;return this}C(a){const b=this.bc(),c=this.X();if(!b)throw Error('OperationError: Cannot create instance, model tag is undefined');a.Lc(c,b,this.source,Jk(this,this.xd))}toString(){return`CreateInstance(${this.bc()}, ${this.X()})`}};
|
|
814
|
+
olympe.dc.transaction.Ya.Wn.xa=[olympe.dc.Fe];olympe.dc.transaction.Ya.Pk=class extends olympe.dc.transaction.Ya.mn{constructor(a,b,c){super(a,b);this.F=this.ja.Fa(c)?olympe.dc.CloudObject.get(c):c}C(a){const b=this.getType();if(''===b)throw Error('OperationError: Cannot create relation, type is undefined, null or empty string');if(b===olympe.dc.pc.Zc)throw Error('OperationError: Cannot create the instance -> model relation');if(!this.origin)throw Error('OperationError: Cannot create relation, origin tag is undefined, null or empty string');
|
|
815
|
+
if(!this.F)throw Error('OperationError: Cannot create relation, destination tag is undefined, null or empty string');this.relation.Ga()===olympe.dc.ua.DESTINATION?a.Ea(b,olympe.dc.ga(this.origin),olympe.dc.ga(this.F)):a.Ea(b,olympe.dc.ga(this.F),olympe.dc.ga(this.origin))}toString(){return`CreateRelation('${this.relation.Ga()}${this.relation.X()}, ${olympe.dc.ga(this.origin)}, ${olympe.dc.ga(this.F)})`}};olympe.dc.transaction.Ya.Ey=class extends olympe.dc.transaction.Ya.Zf{constructor(a,b=olympe.dc.cc.zc){super();this.model=a instanceof olympe.dc.CloudObject?a:olympe.dc.CloudObject.get(a);this.hc=b}C(a){for(const b of this.ja.Id(this.model))b!==olympe.dc.ga(this.model)&&(new olympe.dc.transaction.Ya.jo(b,this.hc)).C(a)}toString(){return`DeleteAllInstances(${this.model.X()}, ${this.hc})`}};olympe.dc.transaction.Ya.io=class extends olympe.dc.transaction.Ya.mn{C(a){const b=this.getType();if(void 0===b)throw Error('OperationError: Cannot delete relation, type is undefined');if(b===olympe.dc.pc.Zc)throw Error('OperationError: Cannot delete the instance -> model relation');const c=olympe.dc.ga(this.origin);if(!this.origin)throw Error('OperationError: Cannot delete relation, left tag is undefined');const d=this.Ga(),e=this.ja.ab(c,this.relation);for(const f of e)d===olympe.dc.ua.DESTINATION?
|
|
816
|
+
a.fc(b,c,f):a.fc(b,f,c)}toString(){return`DeleteAllRelations(${this.Ga()}${this.getType()})`}};olympe.dc.transaction.Ya.jo=class extends olympe.dc.transaction.Ya.Zf{constructor(a,b=olympe.dc.cc.zc){super();this.tag=this.ja.Fa(a)?olympe.dc.CloudObject.get(a):a;this.hc=b}X(){return olympe.dc.ga(this.tag)}C(a){const b=this.X();if(void 0===b)throw Error('OperationError: Cannot delete instance, tag is undefined');this.ja.Fa(b)&&tk(a,b,this.hc)}toString(){return'DeleteInstance('+this.X()+', '+this.hc+')'}};olympe.dc.transaction.Ya.vs=class extends olympe.dc.transaction.Ya.Pk{C(a){const b=this.relation.X();if(void 0===b)throw Error('OperationError: Cannot delete relation, type is undefined');if(b===olympe.dc.pc.Zc)throw Error('OperationError: Cannot delete the instance -> model relation');const c=olympe.dc.ga(this.origin);if(void 0===c)throw Error('OperationError: Cannot delete relation, left tag is undefined');const d=olympe.dc.ga(this.F);if(void 0===d)throw Error('OperationError: Cannot delete relation, right tag is undefined');
|
|
817
|
+
this.relation.Ga()===olympe.dc.ua.DESTINATION?a.fc(b,c,d):a.fc(b,d,c)}toString(){return'DeleteRelation('+this.relation.Ga()+this.relation.X()+', '+olympe.dc.ga(this.origin)+', '+olympe.dc.ga(this.F)+')'}};olympe.dc.transaction.Ya.Su=class extends olympe.dc.transaction.Ya.Zf{constructor(a,b,c){super();this.tag=this.ja.Fa(a)?olympe.dc.CloudObject.get(a):a;this.xd=new Map;void 0!==b&&this.xd.set(olympe.dc.ga(b),c)}X(){return olympe.dc.ga(this.tag)}C(a){const b=this.X();if(void 0===b)throw Error('OperationError: Cannot update instance, tag is undefined');var c;if(!(null!=(c=a.C.Hd(b))&&c.G()||this.ja.Fa(b)))throw Error('OperationError: Instance #'+b+' not found so it cannot be updated');c=Jk(this,this.xd);
|
|
818
|
+
for(const [e,f]of c){var d=this.ja.Ja(b,e);d instanceof olympe.dc.Bc&&tk(a,d.X(),olympe.dc.cc.zc);f instanceof olympe.dc.Bc&&!pk(a,f.X())&&(d=new olympe.dc.Wa,d.persist(f.X()),d.C(a))}a.Uc(b,c)}toString(){return'UpdateInstance('+this.X()+', '+Jk(this,this.xd)+')'}};olympe.dc.transaction.Ya.$t=class a extends olympe.dc.transaction.Ya.Zf{constructor(b,c){super();this.tag=b;this.source=c}C(b){const c=olympe.dc.ja();if(pk(b,this.tag)&&c.Fa(this.tag)&&!c.Uf(this.tag)){const e=c.Cb(this.tag,!0);var d;let f;null==(f=null==(d=b.C.Hd(this.tag))?void 0:d.Cb())||f.forEach((g,h)=>{e.set(h,g)});for(const g of e.values())g instanceof olympe.dc.Bc&&c.Fa(g.X())&&(new a(g.X(),this.source)).C(b);d=c.model(this.tag);b.Lc(this.tag,d,this.source,e);for(const [g,h,k]of mg(c,this.tag))pk(b,
|
|
819
|
+
k)&&(h===olympe.dc.ua.ORIGIN?b.Ea(g,k,this.tag):b.Ea(g,this.tag,k))}}toString(){return`PersistOperation: tag - ${this.tag}, src - ${this.source}`}};olympe.dc.ga=function(a){let b=null;if('string'===typeof a)return a;if('function'===typeof(null==a?void 0:a.X)&&(null==a||!a.zg))b=a.X();else if('function'===typeof a){let d;b=null!=(d=olympe.dc.na.bc(a))?d:''}else if(olympe.D.Ue(a)){let d;b=olympe.dc.ga(null==(d=olympe.D.Qa(a))?void 0:d.valueOf())}let c;return null!=(c=b)?c:''};x('olympe.dc.instanceToTag',olympe.dc.ga);olympe.dc.ja=function(){return olympe.dc.zm().view};olympe.dc.register=function(a,b){olympe.dc.na.C(a,b)};
|
|
820
|
+
olympe.dc.defineProperty=function(a){return new olympe.dc.Ma.Property(a)};olympe.dc.ar=function(a,b=olympe.dc.ua.DESTINATION,c=olympe.dc.CloudObject,d=olympe.dc.ua.DESTINATION){const e=olympe.dc.ua.DESTINATION;return b===olympe.dc.ua.ORIGIN||b===e?new olympe.dc.Ma.Relation(a,b):new olympe.dc.Ma.Relation(a,d,b,c)};olympe.dc.tv=function(a){return a.Vb()};olympe.dc.Jb={};olympe.dc.Jb.nm=a=>'string'===typeof a||'number'===typeof a||'boolean'===typeof a||a instanceof String?olympe.D.wb(a):a instanceof olympe.D.Na?a:null;olympe.dc.Jb.jm=a=>'boolean'===typeof a||a instanceof Boolean?olympe.D.Qb(a):a instanceof olympe.D.ea?a:null;olympe.dc.Jb.mm=a=>'number'===typeof a||a instanceof Number?olympe.D.ra(a):'string'===typeof a||a instanceof String?olympe.D.ra(Number.parseFloat(a.valueOf())):a instanceof olympe.D.aa?a:null;
|
|
821
|
+
olympe.dc.Jb.km=function(a){return'number'===typeof a||a instanceof Number?Gb(a.valueOf()):'string'===typeof a||a instanceof String?new olympe.D.gb(new Date(a.valueOf().valueOf())):a instanceof Date?new olympe.D.gb(a):a instanceof olympe.D.gb?a:null};olympe.dc.Jb.Wq=function(a){return a instanceof olympe.D.Color?a:'string'===typeof a||a instanceof String?Kb(a.valueOf()):null};olympe.dc.Jb.Xq=a=>a instanceof olympe.dc.CloudObject?a:a instanceof olympe.dc.Bc?Ie(a):null;
|
|
822
|
+
olympe.dc.Jb.Ag=a=>a instanceof olympe.dc.Bc?Ie(a):a;olympe.dc.Jb.iC=a=>{switch(typeof a){case 'boolean':return olympe.D.Qb(a);case 'number':return olympe.D.ra(a);case 'string':return olympe.D.wb(a);case 'object':if(a instanceof Date)return olympe.D.ix(a)}return a};
|
|
823
|
+
olympe.dc.Jb.AC=a=>{switch(a){case olympe.D.ea:return olympe.dc.Jb.jm;case olympe.D.Na:return olympe.dc.Jb.nm;case olympe.D.aa:return olympe.dc.Jb.mm;case olympe.D.gb:return olympe.dc.Jb.km;case olympe.D.Color:return olympe.dc.Jb.Wq;case olympe.dc.CloudObject:return olympe.dc.Jb.Xq;default:return olympe.dc.Jb.Ag}};olympe.dc.vc={};olympe.dc.Ye=class{ia(){}K(){}G(){}O(){}ha(){}toString(){}};function Kk(a){let b=null;for(a=[...a.da];null===b&&0<a.length;)b=a.pop().Pb();return b}function Lk(a,b){a.T()||(a=`Calling "${b}" on subscription with id ${a.V()} 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.ma.eb('dc').warn(a))}
|
|
824
|
+
olympe.dc.ya=class{constructor(a,b,c){void 0===a||null===a?olympe.ma.eb('dc').warn('attempt to create a listdef with a null or undefind basetag. This listdef is thus without effect.'):(this.F=olympe.D.ta([a],olympe.dc.ga,String),this.da=void 0!==b&&(Array.isArray(b)?b:[b])||[],this.valueType=c||Kk(this),this.C=null)}ge(){return olympe.dc.ge()}kb(){if(null===this.C){const a=olympe.dc.vc.lw();this.C=Mk(a,this);null!==this.valueType&&this.C.Bd(this.valueType);olympe.D.Xa().Z(()=>{var b=this.C.V();a.H.debug('QueryMGR: [ID:',
|
|
825
|
+
b,'] - Unregistered');const c=a.C.get(b);if(null==c)var d=0;else 0<c.counter&&c.counter--,d=0===c.counter;d&&(c.C.release(),a.C.delete(b));this.C=null})}return this}lc(){null===this.C&&this.kb();return this.C}Bd(a){this.valueType=a;null!==this.C&&this.C.Bd(this.valueType)}Pb(){return null!==this.C?this.C.Pb():null===this.valueType?olympe.dc.CloudObject:this.valueType}Od(){return this.F}nl(){return this.da}vd(a,b){return this.lc().vd(a,b)}pk(a){this.lc().pk(a)}bt(){return this.lc().ed()}at(){return this.lc().T()}get(a){return this.lc().get(a)}wh(){return this.lc().wh()}uh(a){const b=
|
|
826
|
+
this.lc();Lk(b,'getCurrent');return b.uh(a)}has(a){return this.lc().has(a)}Hg(a){const b=this.lc();Lk(b,'hasCurrent');return b.Hg(a)}de(a){return this.lc().de(a)}jx(a){return this.de(a).asObservable()}Re(a){const b=this.lc();Lk(b,'getCurrentAt');return b.Re(a)}Se(a){return this.lc().Se(a)}tf(a){const b=this.lc();Lk(b,'getCurrentKeyAt');return b.tf(a)}Qd(a){return this.lc().Qd(a)}ox(a){return this.Qd(a).asObservable()}uf(a){const b=this.lc();Lk(b,'getCurrentRank');return b.uf(a)}xc(){return this.lc().xc()}kx(){return this.xc().asObservable()}vf(){return this.lc().vf()}cf(){return this.lc().cf()}px(){return this.cf().asObservable()}Rf(){const a=
|
|
827
|
+
this.lc();Lk(a,'getCurrentSize');return a.Rf()}forEach(a,b){this.lc().forEach(a,b)}ce(a){const b=this.lc();Lk(b,'forEachCurrentValue');return b.ce(a)}xi(a,b,c,d){a=new olympe.dc.da.Xg(a,b);(new olympe.dc.ya(this.F,[...this.da,a],this.valueType)).forEach(c,d)}transform(...a){var b=a;if(Array.isArray(a[0])){if(1<a.length)throw Error('ListDef.transform() should be called either with one array argument, or with ... arguments, but not both');b=a[0]}a=[...this.da];for(const c of b){if(void 0===c)throw Error('ListDef.transform(): Trying to set an undefined transformer');
|
|
828
|
+
if(c instanceof olympe.dc.Ma.Property)throw Error(`ListDef.transform(): Properties cannot be used as transformer, unlike relations ${c}`);if(!c||'function'!==typeof c.C)break;a.push(c)}b=new olympe.dc.ya(this.F,a);b.Bd(Kk(b)||this.valueType||Object);return b}uk(a){return this.transform(new olympe.dc.da.lf(a))}filter(a){return this.transform(new olympe.dc.da.af(a))}Yj(){const a=new olympe.dc.pj(this.F,null===this.valueType?void 0:this.valueType);let b=this.da;b instanceof Array||(b=b?[b]:[]);a.transform(b);
|
|
829
|
+
return a}toString(){let a=this.da;a=a?', '+(a.join?a.join(', '):a.toString()):'';return'ListDef(#'+olympe.D.Qa(this.F)+a+')'}$s(){return this.lc().gg()}Hc(){return olympe.D.ta([this.cf()],a=>{let b='[';for(let c=0;c<a;c++){const d=this.Re(c).toString();b=0<c&&c<a?b+(', '+d):b+d}return olympe.D.wb(b+']')},olympe.D.Na)}};olympe.dc.ya.prototype.filter=olympe.dc.ya.prototype.filter;olympe.dc.ya.prototype.union=olympe.dc.ya.prototype.uk;olympe.dc.ya.prototype.transform=olympe.dc.ya.prototype.transform;
|
|
830
|
+
olympe.dc.ya.prototype.forEachCurrentValue=olympe.dc.ya.prototype.ce;olympe.dc.ya.prototype.forEach=olympe.dc.ya.prototype.forEach;olympe.dc.ya.prototype.getCurrentSize=olympe.dc.ya.prototype.Rf;olympe.dc.ya.prototype.observeSize=olympe.dc.ya.prototype.px;olympe.dc.ya.prototype.observeFirst=olympe.dc.ya.prototype.kx;olympe.dc.ya.prototype.getCurrentRank=olympe.dc.ya.prototype.uf;olympe.dc.ya.prototype.observeRank=olympe.dc.ya.prototype.ox;olympe.dc.ya.prototype.getCurrentAt=olympe.dc.ya.prototype.Re;
|
|
831
|
+
olympe.dc.ya.prototype.observeAt=olympe.dc.ya.prototype.jx;olympe.dc.ya.prototype.offReady=olympe.dc.ya.prototype.pk;olympe.dc.ya.prototype.onReady=olympe.dc.ya.prototype.vd;olympe.dc.ya.prototype.getBaseTag=olympe.dc.ya.prototype.Od;olympe.dc.ya.xa=[olympe.D.dd];m=olympe.dc.ya.prototype;m.ge.L=olympe.D.J.C;m.kb.L=olympe.D.J.K();m.lc.L=new olympe.D.J(()=>olympe.dc.vc.Subscription,[]);m.Bd.L=new olympe.D.J(()=>{},[]);m.Od.L=new olympe.D.J(()=>String,[]);m.nl.L=new olympe.D.J(()=>Array,[]);
|
|
832
|
+
m.vd.L=new olympe.D.J(()=>String,[]);m.pk.L=new olympe.D.J(()=>{},[]);m.bt.L=olympe.D.J.O;m.at.L=olympe.D.J.C;m.get.L=new olympe.D.J(()=>olympe.dc.CloudObject,[],'valueType');m.wh.L=new olympe.D.J(()=>Array,[]);m.uh.L=olympe.D.J.C;m.has.L=olympe.D.J.O;m.Hg.L=olympe.D.J.C;m.de.L=new olympe.D.J(()=>olympe.dc.CloudObject,[],'valueType');m.Re.L=olympe.D.J.C;m.Se.L=new olympe.D.J(()=>String,[]);m.tf.L=olympe.D.J.C;m.Qd.L=olympe.D.J.G;m.uf.L=olympe.D.J.C;
|
|
833
|
+
m.xc.L=new olympe.D.J(()=>olympe.dc.CloudObject,[],'valueType');m.vf.L=new olympe.D.J(()=>String,[]);m.cf.L=olympe.D.J.G;m.Rf.L=olympe.D.J.C;m.forEach.L=new olympe.D.J(()=>{},[]);m.ce.L=olympe.D.J.C;m.xi.L=new olympe.D.J(()=>{},[]);m.transform.L=new olympe.D.J(()=>olympe.dc.ya,[]);m.uk.L=new olympe.D.J(()=>olympe.dc.ya,[]);m.filter.L=new olympe.D.J(()=>olympe.dc.ya,[]);m.Yj.L=new olympe.D.J(()=>olympe.dc.pj,[]);m.toString.L=olympe.D.J.C;m.$s.L=olympe.D.J.C;m.Hc.L=olympe.D.J.F;const Nk={Vx:'append',Zk:'filter_not',so:'filter_and',uo:'filter_or'};function Ok(a,b){a=Pk(a);a=olympe.dc.CloudObject.get(a);return(new olympe.dc.$a.nn(a,b)).F}
|
|
834
|
+
olympe.dc.pj=class{constructor(a,b){this.C=Pk(a);this.H=olympe.ma.eb('dc.query');this.valueType=void 0===b?olympe.dc.CloudObject:b;this.da=[];this.Ya=[]}$h(){return new olympe.dc.ya(this.C,this.da,this.valueType)}transform(a){for(let b=0,c=a.length,d;b<c;b++){d=a[b];if(void 0===d)throw new Qk('transform','Trying to set an undefined transformer');if(d instanceof olympe.dc.Ma.Property)throw new Qk('transform','Properties cannot be used as transformer, unlike relations '+d);if(!d||'function'!==typeof d.C)throw new Qk('transform',
|
|
835
|
+
'one of the argument is not a Transformer '+d);const e=d.Pb();null!==e&&(this.valueType=e);this.da.push(d)}return this}uk(a){this.da.push(new olympe.dc.da.lf(a));return this}Tx(a){this.da.push(new olympe.dc.da.lf(Pk(a)));return this}dt(a){this.valueType=a;return this}cb(a){this.da.push(a);this.valueType=a.Pb()||olympe.dc.CloudObject;return this}Hv(a){for(const b of a)this.da.push(b),this.valueType=b.Pb()||olympe.dc.CloudObject;return this}Gv(a,b,c){a=new olympe.dc.da.te(a,a.Ga(),b,c);this.da.push(a);
|
|
836
|
+
this.valueType=a.Pb()||olympe.dc.CloudObject;return this}Fv(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.Ga())}a=new olympe.dc.da.qj(b,c);this.da.push(a);this.valueType=a.Pb()||olympe.dc.CloudObject;return this}ct(){this.cb(olympe.dc.CloudObject.instancesRel);return this}Pe(a){var b=this.Ya.pop();b===Nk.Zk&&(a=new olympe.dc.$.Yd(a),b=this.Ya.pop());switch(b){case Nk.so:b=this.da.pop().F;b instanceof olympe.dc.$.zd?(b=b.$,b.push(a),a=new olympe.dc.$.zd(...b)):
|
|
837
|
+
a=new olympe.dc.$.zd(b,a);b=this.Ya.pop();break;case Nk.uo:b=this.da.pop().F,b instanceof olympe.dc.$.se?(b=b.$,b.push(a),a=new olympe.dc.$.se(...b)):a=new olympe.dc.$.se(b,a),b=this.Ya.pop()}b===Nk.Zk&&(a=new olympe.dc.$.Yd(a),this.Ya.pop());this.da.push(new olympe.dc.da.af(a));return this}Bv(a,b,c){return this.Pe(new olympe.dc.$.oe(Ok(a,c),new olympe.dc.$a.De(b)))}contains(a,b,c=!1,d){return this.Pe(new olympe.dc.$.Ze(Ok(a,d),new olympe.dc.$a.De(b),c))}tc(a){if(!(a instanceof Array))throw new Qk('instanceOf',
|
|
838
|
+
'Provided argument "models" must be an array.');const b=[];for(let c=0;c<a.length;c++)b.push(Pk(a[c]));return this.Pe(new olympe.dc.$.Xh(b))}jk(a){return this.Pe(new olympe.dc.$.oe(new olympe.dc.$a.li,new olympe.dc.$a.De(Pk(a))))}Cv(a){if(!Array.isArray(a))throw Error('ExcludeInstances should be called with an array');if(0<a.length){this.jd().jk(a[0]);for(let b=1,c=a.length;b<c;b++)this.and().jd().jk(a[b])}return this}Mw(a,b){if(!(a instanceof Array))throw new Qk('hasRelated','Provided argument "relations" must be an array.');
|
|
839
|
+
const c=[],d=[];a.forEach(e=>{c.push(e);d.push(e.Ga())});return this.Pe(new olympe.dc.$.Th(c,d,b))}ik(a,b,c){a=Ok(a,c);return this.Pe(new olympe.dc.$.kj(a,new olympe.dc.$a.De(b)))}Ri(a,b,c){a=Ok(a,c);return this.Pe(new olympe.dc.$.Pj(a,new olympe.dc.$a.De(b)))}Zw(a,b,c,d){a=Ok(a,d);return this.Pe(new olympe.dc.$.hf(a,b,c))}filter(a){const b=new class extends olympe.dc.$.Yf{C(c,d){return a(olympe.dc.CloudObject.get(d))}};return this.Pe(b)}jd(){this.Ya.push(Nk.Zk);return this}and(){this.da[this.da.length-
|
|
840
|
+
1]instanceof olympe.dc.da.af&&this.Ya.push(Nk.so);return this}or(){this.da[this.da.length-1]instanceof olympe.dc.da.af&&this.Ya.push(Nk.uo);return this}tk(a,b,c){a=Pk(a);let d=null;switch(olympe.dc.ja().Ib(a,olympe.dm.Property.typeRel)){case olympe.dm.String.P.X():d=new olympe.dc.qc.String(new olympe.dc.$a.ji(a,c));break;case olympe.dm.Number.P.X():d=new olympe.dc.qc.Number(new olympe.dc.$a.ci(a,c));break;case olympe.dm.DateTime.P.X():d=new olympe.dc.qc.DateTime(new olympe.dc.$a.Mh(a,c))}c=d;null!==
|
|
841
|
+
c&&this.da.push(new olympe.dc.da.ug(c,b));return this}sort(a,b,c){const d=new class extends olympe.dc.qc.Yf{K(e,f){return a(olympe.dc.CloudObject.get(f))}G(e,f){return b(e,f).valueOf()}};this.da.push(new olympe.dc.da.ug(d,c));return this}xv(){this.da.push(new olympe.dc.da.Nh);return this}Ji(a,b){this.da.push(new olympe.dc.da.Xg(a,b));return this}};class Qk extends Error{constructor(a,b){super(`ListDefBuilder.${a}(): ${b}`)}}
|
|
842
|
+
function Pk(a){return'string'===typeof a||a instanceof olympe.D.Na?a:'function'===typeof a?olympe.dc.na.bc(a):olympe.D.fb(a)?a.Vj===olympe.D.Na?a:olympe.D.ta([a],b=>olympe.D.wb(olympe.dc.ga(b)),olympe.D.Na):a.X()}m=olympe.dc.pj.prototype;m.$h.L=new olympe.D.J(()=>olympe.dc.ya,[]);m.transform.L=olympe.D.J.K();m.uk.L=olympe.D.J.K();m.Tx.L=olympe.D.J.K();m.dt.L=olympe.D.J.K();m.cb.L=olympe.D.J.K();m.Hv.L=olympe.D.J.K();m.Gv.L=olympe.D.J.K();m.Fv.L=olympe.D.J.K();m.ct.L=olympe.D.J.K();m.Pe.L=olympe.D.J.K();
|
|
843
|
+
m.Bv.L=olympe.D.J.K();m.contains.L=olympe.D.J.K();m.tc.L=olympe.D.J.K();m.jk.L=olympe.D.J.K();m.Cv.L=olympe.D.J.K();m.Mw.L=olympe.D.J.K();m.ik.L=olympe.D.J.K();m.Ri.L=olympe.D.J.K();m.Zw.L=olympe.D.J.K();m.filter.L=olympe.D.J.K();m.jd.L=olympe.D.J.K();m.and.L=olympe.D.J.K();m.or.L=olympe.D.J.K();m.tk.L=olympe.D.J.K();m.sort.L=olympe.D.J.K();m.xv.L=olympe.D.J.K();m.Ji.L=olympe.D.J.K();function Mk(a,b){const c=b.Od();var d=new olympe.dc.query.Xt;let e;e=c;olympe.D.fb(e)&&(e=d.add(c));b=(b=b.nl())?Array.isArray(b)?b:[b]:null;d=olympe.dc.vc.Subscription.G(e,b,d);let f,g,h=null!=(g=null==(f=a.C.get(d))?void 0:f.C)?g:null;null===h&&(a.H.debug('QueryMGR: new',a.F?'local':'remote','subscription "',d,'": #',`${e},`,b),h=new olympe.dc.vc.Subscription(d,c,b,a.G));h.getContext().run(()=>a.process(h));return h}
|
|
844
|
+
function Rk(a,b){if(b.T())a.H.debug('ListProcessor: [ID:',b.V(),'] - Subscription already booted, ignoring');else{a.H.debug('ListProcessor: [ID:',b.V(),'] - Booting subscription');var c=new olympe.dc.jc.zq(a.db,a.H),d=b.V();olympe.D.Nc([b.Od()],e=>{const f=olympe.dc.ga(e);a.H.debug('ListProcessor: [ID:',b.V(),'] - Booting with baseTag',f);b.vm()||b.Im();Ke(a.db,f,Sk(a,b,c),d);olympe.D.Xa().Z(()=>Je(a.db,f,d));a.db.Fa(f.valueOf())||Tk(c);b.T()||(Tk(c),b.ec([]))})}}
|
|
845
|
+
function Uk(a,b,c,d){const e=[b.Od()],f=k=>k instanceof olympe.dc.da.lf;let g;const h=(null!=(g=b.Fg())?g:[]).filter(f);for(const k of h){e.push(k.Od());let l;h.push(...(null!=(l=k.Fg())?l:[]).filter(f))}Ik(a.O,()=>{olympe.D.Nc(e,()=>{const k=b.Ne(c);Vk(a,k,b.V(),d)})})}
|
|
846
|
+
function Vk(a,b,c,d){a.H.debug('CoverageProcessor: [ID:',c,'] - checking coverage of remote query over',b.length,'paths.');const e=olympe.D.Xa(),f=new olympe.async.Aj(e);b.forEach(g=>{f.add((h,k)=>{let l=!1;nh(a.K,g,e,olympe.dc.Pa.SELF,olympe.dc.pa.Rc.Cf).subscribe(rxjs.Subscriber.create(()=>{l||(l=!0,e.run(h))},n=>e.run(()=>k(`The query ${c} is not covered by an existing graphdef, `+`and the specific graphdef id ${g.V()} has encountered an error: ${n}`))))})});Bc(f,(g,h)=>d(h));f.start()}
|
|
847
|
+
function Sk(a,b,c){const d=new olympe.dc.jc.Wi;let e=!1;const f=olympe.D.Xa(),g=b.Fg(),h=[];h[g?g.length:0]=(k,l,n,p)=>{f.Tc()||f.hb()||(k?b.Hg(n)?a.H.warn('Adding the same index twice (should never happen) for sub #',b.V(),', index #',n,', tag #',l):(a.H.debug('ListProcessor: [ID:',b.V(),'] - Adding Instance',l,'to the subscription'),b.Fd(n,l)):(a.H.debug('ListProcessor: [ID:',b.V(),'] - Removing Instance',l,'from the subscription'),b.Hm(n)),e||(Wk(c,()=>{p.Nf();Tk(c)}),f.run(()=>p.ge().Xf(b.ec.bind(b))),
|
|
847
848
|
e=!0),Xk(c,n))};if(null!==g)for(let k=g.length-1;0<=k;k--)h[k]=g[k].C(f,c,h[k+1]);return(k,l)=>{const n=b.V();c.register(n,null);const p=d.C(k,l,n,null);if(null!==p)h[0](k,l,n,Yk(p,k,l,n))}}
|
|
848
|
-
olympe.dc.
|
|
849
|
-
Rk(this,a)):Uk(this,a,c,d=>{d?this.H.error(d):Rk(this,a)}))}};function $k(a){return olympe.D.
|
|
850
|
-
olympe.dc.query.
|
|
851
|
-
olympe.dc.
|
|
852
|
-
()=>{},olympe.D.ea)}T(){const b=this.G.Da.Db;return b&&b.valueOf()>=olympe.dc.
|
|
853
|
-
0,d=b.length;c<d;c++)this.
|
|
854
|
-
this.
|
|
855
|
-
olympe.dc.da.lf)e=a.F(olympe.D.Qa(e.
|
|
856
|
-
olympe.dc.$.
|
|
857
|
-
a.toString()).join(',')+')'}};S('olympe.dc.predicates.And',olympe.dc.$.zd);olympe.dc.$.zd.xa=[olympe.dc.Aa];olympe.dc.$.
|
|
858
|
-
return this.ia().replace(/^.+\./,'')+'('+a.toString()+','+this.value.toString()+')'}};S('olympe.dc.predicates.BitMask',olympe.dc.$.
|
|
859
|
-
return'{"c":"'+this.ia()+'","a":['+b+','+c+','+a+']}'}toString(){const a=$k(this.G);return'Contains('+this.source.toString()+','+this.value.toString()+','+a+')'}};S('olympe.dc.predicates.Contains',olympe.dc.$.
|
|
860
|
-
')'}};S('olympe.dc.predicates.Equals',olympe.dc.$.
|
|
861
|
-
c.getContext().
|
|
862
|
-
function el(a,b,c,d){const e=Object.create(null);d+=olympe.Y.th();const f=(g,h,k)=>{k>=a.F&&c(g,h);if(!(0<=a.C&&k>=a.C)){var l=d+k;g?e[h]||(e[h]=!0,W(b,h,a,(n,p)=>{f(n,p,k+1)},l)):(delete e[h],b.F(h,a,l))}};return(g,h)=>f(g,h,0)}class dl extends olympe.dc.query.Relation{constructor(a,b,c,d){super(a,b,1!==c||1!==d);this.F=c;this.C=d}ha(){return`${this.X()}, ${this.Ga()}, ${this.F}, ${this.C}`}}olympe.dc.$.Th.xa=[olympe.dc.Aa];olympe.dc.$.
|
|
863
|
-
const g=this.
|
|
849
|
+
olympe.dc.vc.Bt=class{constructor(a,b,c,d,e){this.H=a;this.db=b;this.F=e;this.O=c;this.K=d;this.C=new Map;this.G=new olympe.D.Yb('Legacy ListDef processor')}process(a){const b=a.V();var c=this.C.get(b);c||(c=new olympe.dc.vc.Bu(a),this.C.set(b,c));c.counter++;Zk(c)?this.H.debug('ListProcessor: [ID:',b,'] - id already processed'):(this.H.debug('ListProcessor: [ID:',b,'] - NOT processed yet.'),c=a.rf(),this.F&&c===olympe.dc.Pa.SERVER||c===olympe.dc.Pa.SELF?(this.H.debug('QueryMGR: [ID:',b,'] - Local subscription, no need for coverage check, booting subscription '),
|
|
850
|
+
Rk(this,a)):Uk(this,a,c,d=>{d?this.H.error(d):Rk(this,a)}))}};function $k(a){return olympe.D.fb(a)?'Node#'+a.Da.V():String(a)}function al(a,b){return olympe.D.fb(b)?'{"c":"Parameter","v":"'+a.add(b)+'"}':JSON.stringify(b)}
|
|
851
|
+
olympe.dc.query.Xt=class{constructor(){this.C=0;this.values=null}add(a){let b;b=olympe.D.fb(a)?'n'+a.Da.V():'p'+ ++this.C;null===this.values&&(this.values={});this.values[b]=a;return b}get(a){return this.values[a]}clear(){const a=this.values;if(null!==a)for(let b=Object.keys(a),c=b.length,d=0;d<c;d++)delete a[b[d]]}forEach(a){const b=this.values;if(null!==b)for(let c=Object.keys(b),d=c.length,e=0;e<d;e++)a(b[c[e]],c[e])}};olympe.dc.Aa=class{ia(){}C(){}F(){}ha(){}toString(){}};olympe.dc.vc.Subscription=class a extends olympe.D.Vi{constructor(b,c,d,e){super(olympe.dc.CloudObject,new olympe.D.Yb('context subscription '+b,e));this.id=b;this.Oc=c;this.da=d||null;this.G=this.O.run(()=>olympe.D.Td(olympe.dc.vc.Subscription.C.INIT));this.ac=!1;this.ba=this.Tb=null}static G(b,c,d){let e;try{e=b;if(c)for(let f=0,g=c.length;f<g;f++)e+='|'+c[f].ha(d);else e+='|null';e=olympe.Y.sb(e)}catch(f){e=olympe.Y.Fc()}return e}V(){return this.id}Od(){return this.Oc}Fg(){return this.da}rf(){const b=
|
|
852
|
+
olympe.dc.Rd(),c=olympe.D.Qa(this.Od());let d;return olympe.dc.CloudObject.instancesRel.Ka(null==(d=this.da)?void 0:d[0])?b.fromModel(c):b.we(c)}vm(){const b=olympe.D.Qa(this.G);return b&&b.valueOf()>=olympe.dc.vc.Subscription.C.sq}Im(){if(this.G.Da.hb())throw Error(`Cannot set destroyed subscription '${this.id}' as subscribed`);const b=this.Tb;this.Tb=null;for(let c in b)if(Object.prototype.hasOwnProperty.call(b,c))b[c](this);Db(this.G,olympe.D.Td(olympe.dc.vc.Subscription.C.sq))}ed(){return olympe.D.ta([this.G],
|
|
853
|
+
()=>{},olympe.D.ea)}T(){const b=this.G.Da.Db;return b&&b.valueOf()>=olympe.dc.vc.Subscription.C.eh}vd(b,c){this.T()?b(this):(null===this.ba&&(this.ba=new Map),void 0===c&&(c=olympe.Y.Fc()),this.ba.set(c,olympe.D.Xa().G(b)));return c||''}pk(b){null!==this.ba&&b&&this.ba.delete(b)}Nb(){const b=olympe.dc.vc.Subscription.C.eh;if(!this.G.Da.hb()&&olympe.D.Qa(this.G)!==b&&(this.nf(),Db(this.G,b),null!==this.ba)){for(const c of this.ba.values())c(this);this.ba=null}}onDestroy(b){this.O.onDestroy(b)}release(){this.O.destroy()}ec(b){if(!this.G.Da.hb()){for(let c=
|
|
854
|
+
0,d=b.length;c<d;c++)this.cm(b[c],c);if(this.T())this.nf();else{this.ac=b=!0;for(let c in this.F)if(Object.prototype.hasOwnProperty.call(this.F,c)&&!Object.prototype.hasOwnProperty.call(this.values,c)){b=!1;break}b&&this.Nb()}}}Fd(b,c){if(!this.G.Da.hb()&&(this.Xj(b,olympe.dc.CloudObject.get(c)),b=this.T(),this.ac&&!b)){b=!0;for(let d in this.F)if(Object.prototype.hasOwnProperty.call(this.F,d)&&!Object.prototype.hasOwnProperty.call(this.values,d)){b=!1;break}b&&this.Nb()}}Hm(b){this.G.Da.hb()||(this.bm(b),
|
|
855
|
+
this.si(b,!this.T()))}gg(){return this.T()?super.gg():'Subscription is not ready!'}Ne(b){const c=olympe.D.Qa(this.Od());return olympe.dc.vc.Subscription.F(c,b,this.Fg())}static F(b,c,d){var e=olympe.dc.pa.from(b,c).be();if(null===d)return[e];b=[];b.push(e);for(let f=0,g=d.length;f<g;f++)if(e=d[f],e instanceof olympe.dc.da.Je){const h=olympe.dc.query.Relation.from(e);b=b.map(k=>k.cb(h,!0))}else if(e instanceof olympe.dc.da.te){const h=olympe.dc.query.Relation.from(e);b=b.map(k=>k.Qf(h,!0,!0))}else if(e instanceof
|
|
856
|
+
olympe.dc.da.lf)e=a.F(olympe.D.Qa(e.Od()),c,e.Fg()),b.push(...e);else if(e instanceof olympe.dc.da.af||e instanceof olympe.dc.da.ug){const h=e.G();b=b.map(k=>{for(const l of h){for(const n of l)k=n.recursive?k.Qf(n,!0,!0):k.cb(n,!0);k=k.back(l.length)}return k})}return b}};olympe.dc.vc.Subscription.C={INIT:0,sq:1,eh:2};olympe.dc.vc.Subscription.prototype.gg.L=olympe.D.J.C;function Zk(a){const b=a.F;a.F=!0;return b}olympe.dc.vc.Bu=class{constructor(a){this.counter=0;this.F=!1;this.C=a}};olympe.dc.kf=class{ia(){}Pb(){}C(){}ha(){}toString(){}};olympe.dc.Np=class{G(){}};olympe.dc.Uj=class{ia(){}getValue(){}C(){}ha(){}toString(){}};olympe.dc.qc={};let bl=0;olympe.dc.qc.Yf=class{constructor(){this.id=bl++}ia(){return'CustomLocalComparator#'+bl}O(){return[]}K(){throw Error('GetComparedValue function was not implemented.');}G(){throw Error('Compare function was not implemented.');}ha(){return`{"c":"${this.ia()}"}`}toString(){return this.ia()+'()'}};olympe.dc.qc.Yf.xa=[olympe.dc.Ye];olympe.dc.qc.DateTime=class{constructor(a){this.C=a}ia(){return T(olympe.dc.qc.DateTime)}O(){return this.C.C()}K(a,b){return this.C.getValue(a,b)}G(a,b){if(!a)return b?-1:0;if(!b)return 1;a=a.getTime();b=b.getTime();return a!==b?a>b?1:-1:0}ha(a){return'{"c":"'+this.ia()+'",a:['+this.C.ha(a)+']}'}toString(){return'Number('+this.C.toString()+')'}};S('olympe.dc.comparators.DateTime',olympe.dc.qc.DateTime);olympe.dc.qc.DateTime.xa=[olympe.dc.Ye];olympe.dc.qc.Number=class{constructor(a){this.C=a}ia(){return T(olympe.dc.qc.Number)}O(){return this.C.C()}K(a,b){return this.C.getValue(a,b)}G(a,b){return a!==b?a>b?1:-1:0}ha(a){return`{"c":"${this.ia()}",a:[${this.C.ha(a)}]}`}toString(){return`Number(${this.C.toString()})`}};S('olympe.dc.comparators.Number',olympe.dc.qc.Number);olympe.dc.qc.Number.xa=[olympe.dc.Ye];olympe.dc.qc.String=class{constructor(a){this.C=a}ia(){return T(olympe.dc.qc.String)}O(){return this.C.C()}K(a,b){return olympe.D.ta([this.C.getValue(a,b)],c=>c.toLowerCase(),olympe.D.Na)}G(a,b){return void 0===a?void 0===b?0:1:a!==b?a>b?1:-1:0}ha(a){return`{"c":"${this.ia()}",a:[${this.C.ha(a)}]}`}toString(){return`String(${this.C.toString()})`}};S('olympe.dc.comparators.String',olympe.dc.qc.String);olympe.dc.qc.String.xa=[olympe.dc.Ye];olympe.dc.$={};let cl=0;olympe.dc.$.Yf=class{constructor(){this.id=cl++}ia(){return'CustomLocalPredicate#'+this.id}F(){return[]}C(){throw Error('Test function was not implemented.');}ha(){return`{"c":"${this.ia()}"}`}toString(){return this.ia()+'()'}};olympe.dc.$.Yf.xa=[olympe.dc.Aa];olympe.dc.$.zk=class{constructor(a,b){this.G=a;this.K=b}ia(){}F(){return[this.G.C(),this.K.C()]}C(a,b){return a.run(()=>olympe.D.ta([this.G.getValue(a,b),this.K.getValue(a,b)],(c,d)=>{c=c.valueOf();d=d.valueOf();return olympe.D.Qb(this.O('string'===typeof c?c:Number(c),'string'===typeof d?d:Number(d)))},olympe.D.ea))}O(){}ha(a){return'{"c":"'+this.ia()+'","a":['+this.G.ha(a)+','+this.K.ha(a)+']}'}toString(){return this.ia().replace(/^.+\./,'')+'('+this.G.toString()+','+this.K.toString()+')'}};
|
|
857
|
+
olympe.dc.$.zk.xa=[olympe.dc.Aa];olympe.dc.$.zd=class{constructor(a){this.$=[];for(let b=arguments.length,c=0;c<b;c++)Array.isArray(arguments[c])?this.$=this.$.concat(arguments[c]):this.$.push(arguments[c])}ia(){return T(olympe.dc.$.zd)}F(){return this.$.reduce((a,b)=>a.concat(b.F()),[])}C(a,b){return a.run(()=>olympe.D.ta(this.$.map(c=>c.C(a,b)),(...c)=>olympe.D.Qb(c.every(d=>d.valueOf())),olympe.D.ea))}ha(a){const b=this.$.map(c=>c.ha(a));return'{"c":"'+this.ia()+'","a":['+b.join(',')+']}'}toString(){return'And('+this.$.map(a=>
|
|
858
|
+
a.toString()).join(',')+')'}};S('olympe.dc.predicates.And',olympe.dc.$.zd);olympe.dc.$.zd.xa=[olympe.dc.Aa];olympe.dc.$.Hk=class{constructor(a,b){this.G=a;this.value=b}C(a,b){return a.run(()=>olympe.D.ta([this.G,this.value.getValue(a,b)],(c,d)=>{c=c.valueOf();return olympe.D.Qb((Number(c)&Number(d.valueOf()))===Number(c))},olympe.D.ea))}ia(){return T(olympe.dc.$.Hk)}F(){return[this.value.C()]}ha(a){const b=olympe.D.fb(this.G)?this.G.Da.Db.valueOf():this.G.valueOf();return'{"c":"'+this.ia()+'","a":['+b+','+this.value.ha(a)+']}'}toString(){const a=olympe.D.fb(this.G)?this.G.Da.Db.valueOf():this.G.valueOf();
|
|
859
|
+
return this.ia().replace(/^.+\./,'')+'('+a.toString()+','+this.value.toString()+')'}};S('olympe.dc.predicates.BitMask',olympe.dc.$.Hk);olympe.dc.$.Hk.xa=[olympe.dc.Aa];olympe.dc.$.Ze=class{constructor(a,b,c){this.source=a;this.value=b;this.G=c?c:!1}ia(){return T(olympe.dc.$.Ze)}F(){return[this.source.C(),this.value.C()]}xb(){return this.source}getValue(){return this.value}C(a,b){return a.run(()=>olympe.D.ta([this.source.getValue(a,b),this.value.getValue(a,b),this.G],(c,d,e)=>{c=String(c);d=String(d);e.valueOf()||(c=c.toLowerCase(),d=d.toLowerCase());return olympe.D.Qb(c.includes(d))},olympe.D.ea))}ha(a){const b=this.source.ha(a),c=this.value.ha(a);a=al(a,this.G);
|
|
860
|
+
return'{"c":"'+this.ia()+'","a":['+b+','+c+','+a+']}'}toString(){const a=$k(this.G);return'Contains('+this.source.toString()+','+this.value.toString()+','+a+')'}};S('olympe.dc.predicates.Contains',olympe.dc.$.Ze);olympe.dc.$.Ze.xa=[olympe.dc.Aa];olympe.dc.$.oe=class{constructor(a,b){this.G=a;this.K=b}ia(){return T(olympe.dc.$.oe)}F(){return[this.G.C(),this.K.C()]}C(a,b){return a.run(()=>olympe.D.ta([this.G.getValue(a,b),this.K.getValue(a,b)],(c,d)=>'object'===typeof c&&void 0!==c.ud?c.ud(d):'object'===typeof d&&void 0!==d.ud?d.ud(c):olympe.D.Qb(c.valueOf()===d.valueOf()),olympe.D.ea,'Test equal predicate'))}ha(a){return'{"c":"'+this.ia()+'","a":['+this.G.ha(a)+','+this.K.ha(a)+']}'}toString(){return'Equals('+this.G.toString()+','+this.K.toString()+
|
|
861
|
+
')'}};S('olympe.dc.predicates.Equals',olympe.dc.$.oe);olympe.dc.$.oe.xa=[olympe.dc.Aa];olympe.dc.$.xs=class extends olympe.dc.$.oe{constructor(a,b){super(a,new olympe.dc.$a.De(b))}};olympe.dc.$.xs.xa=[olympe.dc.Aa];olympe.dc.$.kj=class extends olympe.dc.$.zk{constructor(a,b){super(a,b)}ia(){return T(olympe.dc.$.kj)}O(a,b){return a>b}};S('olympe.dc.predicates.Greater',olympe.dc.$.kj);olympe.dc.$.Th=class{constructor(a,b,c){this.lb=[];this.G=c instanceof Array?c:void 0!==c?[olympe.dc.ga(c)]:[];a=Array.isArray(a)?a:[a];for(let d=0,e=a.length;d<e;d++)c=a[d],c instanceof olympe.dc.da.te?this.lb.push(new dl(c.X(),c.Ga(),c.G,c.F)):this.lb.push(new dl(olympe.dc.ga(c),b[d],1,1))}ia(){return T(olympe.dc.$.Th)}F(){return[this.lb.reduce((a,b)=>a.concat(b),[])]}C(a,b){const c=a.run(()=>Eb(olympe.D.ic(Boolean),!1)),d=olympe.Y.Fc(),e=olympe.dc.ja();let f=0;a=(h,k)=>{0!==this.G.length&&!this.G.includes(k)||
|
|
862
|
+
c.getContext().hb()||c.getContext().Tc()||(f+=h?1:-1,c.update(0<f))};const g=this.lb;for(let h=g.length-1;0<=h;h--)a=el(g[h],e,a,d+h);Ke(e,b,a,d);c.getContext().onDestroy(()=>{Je(e,b,d)});return c.ub()}ha(){return'{"c":"'+this.ia()+'","a":['+JSON.stringify(this.lb.map(a=>a.ha()))+(0!==this.G.length?',"'+this.G.toString():'')+'"]}'}toString(){return'HasRelated('+(0!==this.G.length?'#'+this.G.toString()+', ':'')+this.lb.map(a=>a.ha())+')'}};S('olympe.dc.predicates.HasRelated',olympe.dc.$.Th);
|
|
863
|
+
function el(a,b,c,d){const e=Object.create(null);d+=olympe.Y.th();const f=(g,h,k)=>{k>=a.F&&c(g,h);if(!(0<=a.C&&k>=a.C)){var l=d+k;g?e[h]||(e[h]=!0,W(b,h,a,(n,p)=>{f(n,p,k+1)},l)):(delete e[h],b.F(h,a,l))}};return(g,h)=>f(g,h,0)}class dl extends olympe.dc.query.Relation{constructor(a,b,c,d){super(a,b,1!==c||1!==d);this.F=c;this.C=d}ha(){return`${this.X()}, ${this.Ga()}, ${this.F}, ${this.C}`}}olympe.dc.$.Th.xa=[olympe.dc.Aa];olympe.dc.$.gl=class{constructor(a,b,c){this.lb=[];this.G=void 0!==c?c.map(olympe.dc.ga):null;a=Array.isArray(a)?a:[a];for(let d=0,e=a.length;d<e;d++)c=a[d],c instanceof olympe.dc.da.te?this.lb.push(new fl(c.X(),c.Ga(),c.G,c.F)):this.lb.push(new fl(olympe.dc.ga(c),b[d],1,1))}ia(){return T(olympe.dc.$.gl)}F(){return[this.lb.reduce((a,b)=>a.concat(b),[])]}C(a,b){const c=a.run(()=>Eb(olympe.D.ic(Boolean),!1)),d=olympe.dc.ja(),e=olympe.Y.th();let f=(k,l,n)=>{l&&(null===this.G||this.G.includes(n))&&k(1)};
|
|
864
|
+
const g=this.lb;for(let k=g.length-1;0<=k;k--)f=gl(g[k],d,f,e+k);let h=0;Ke(d,b,f.bind(null,k=>{c.getContext().Tc()||c.getContext().hb()||(h+=k,c.update(0<h))}),e);a.onDestroy(()=>Je(d,b,e));return c.ub()}ha(){return'{"c":"'+this.ia()+'","a":['+JSON.stringify(this.lb.map(a=>a.ha()))+(null!==this.G?',"'+this.G.toString():'')+'"]}'}toString(){return'HasRelatedTree('+(null!==this.G?'#['+this.G.toString()+'], ':'')+this.lb.map(a=>a.ha())+')'}};S('olympe.dc.predicates.HasRelatedTree',olympe.dc.$.gl);
|
|
864
865
|
function gl(a,b,c,d){const e=a.G,f=a.O,g=new Set,h=(l,n,p)=>{f.has(n)?f.get(n).set(d+p,l):f.set(n,(new Map).set(d+p,l))},k=(l,n,p,q,r)=>{const t=olympe.Y.th();if(q){const u=p+r,w=y=>{const z=f.get(r);if(g.has(u))throw Error(`Try to use the predicate HasRelatedTree with recursion in a graph cluster containing a loop around instances ${p} and ${r}`);void 0!==z&&null!==z&&(g.add(u),e.set(r,(e.get(r)||0)+y),Array.from(z.values()).forEach(A=>A(y)));g.delete(u)};h(l,r,p);e.has(r)?l(e.get(r)):(n>=a.F&&c(y=>
|
|
865
|
-
{e.set(r,(e.get(r)||0)+y);l(y)},q,r),(0>a.C||n<=a.C)&&r!==p&&W(b,r,a,k.bind(a,w,n+1,r),t))}else l(-e.get(r)),f.get(r).delete(d+p),0===f.get(r).size&&(e.delete(r),f.delete(r),b.F(r,a,t))};return(l,n,p)=>k(l,0,'origin',n,p)}class fl extends olympe.dc.query.Relation{constructor(a,b,c,d){super(a,b,1!==c||1!==d);this.F=c;this.C=d;this.O=new Map;this.G=new Map}ha(){return`${this.X()}, ${this.Ga()}, ${this.F}, ${this.C}`}}olympe.dc.$.
|
|
866
|
+
{e.set(r,(e.get(r)||0)+y);l(y)},q,r),(0>a.C||n<=a.C)&&r!==p&&W(b,r,a,k.bind(a,w,n+1,r),t))}else l(-e.get(r)),f.get(r).delete(d+p),0===f.get(r).size&&(e.delete(r),f.delete(r),b.F(r,a,t))};return(l,n,p)=>k(l,0,'origin',n,p)}class fl extends olympe.dc.query.Relation{constructor(a,b,c,d){super(a,b,1!==c||1!==d);this.F=c;this.C=d;this.O=new Map;this.G=new Map}ha(){return`${this.X()}, ${this.Ga()}, ${this.F}, ${this.C}`}}olympe.dc.$.gl.xa=[olympe.dc.Aa];olympe.dc.$.Xh=class{constructor(a){this.G=new Set;a instanceof Array?a.forEach(b=>{this.G.add(olympe.dc.ga(b))}):this.G.add(olympe.dc.ga(a))}ia(){return T(olympe.dc.$.Xh)}F(){return[]}C(a,b){const c=a.run(()=>Eb(olympe.D.ic(olympe.D.ea),olympe.D.ea.C)),d=olympe.dc.ja();let e=[];const f=()=>{e.forEach(h=>{d.F(h.tag,h.relation,h.id)});e=[]},g=(h,k)=>{if(h)if(k===olympe.dc.ga(olympe.dc.CloudObject))c.update(olympe.D.Qb(this.G.has(k))),f();else{for(const l of e)if(l.tag===k)throw Error(`You should never extend a model to itself (${k})`);
|
|
866
867
|
this.G.has(k)?(c.update(olympe.D.ea.F),f()):(h=new hl(k,olympe.dc.CloudObject.extendRel),e.push(h),W(d,h.tag,h.relation,g,h.id))}};a=new hl(b,olympe.dc.CloudObject.modelRel);e.push(a);W(d,a.tag,a.relation,g,a.id);c.getContext().onDestroy(f);return c.ub()}ha(){return'{"c":"'+this.ia()+'","a":['+JSON.stringify(Array.from(this.G))+']}'}toString(){return'InstanceOf('+Array.from(this.G).join(', ')+')'}};class hl{constructor(a,b){this.tag=a;this.relation=b;this.id=olympe.Y.th()}}
|
|
867
|
-
S('olympe.dc.predicates.InstanceOf',olympe.dc.$.Xh);olympe.dc.$.Xh.xa=[olympe.dc.Aa];olympe.dc.$.
|
|
868
|
-
')'}};S('olympe.dc.predicates.Or',olympe.dc.$.
|
|
869
|
-
']}'}toString(){const a=$k(this.G);return'Regex('+this.source.toString()+','+this.K+','+a+')'}};S('olympe.dc.predicates.Regex',olympe.dc.$.hf);olympe.dc.$.hf.xa=[olympe.dc.Aa];olympe.dc.$.
|
|
870
|
-
[];null!==this.K&&(0<=this.F?il(jl(this.K,this.F),a):a.push(this.index));this.T(a)}}
|
|
871
|
-
function ll(a,b,c,d,e){const f=Object.create(null),g=a.
|
|
872
|
-
olympe.dc.jc.
|
|
873
|
-
g)}null!==e.G&&il(e.G,this.T)}}this.ba&&this.ba(this.T)}}
|
|
874
|
-
class ol extends olympe.dc.jc.
|
|
875
|
-
function pl(a,b){if(!b.
|
|
876
|
-
function ql(a){const b=a.
|
|
877
|
-
olympe.dc.jc.
|
|
878
|
-
this.K+')');this.K=a;ql(this);for(let b=0,c=this.F.length;b<c;b++){const d=this.F[b];d.position=b;nl(d,()=>pl(this,d))}this.G()}G(){if(null===this.K)throw Error('Manager not activated, need to set a depth before updating ranks');const a=this.F.length;this.T.length=0;for(let d=0;d<a;d++){let e=this.F[d];if(!e.T){var b=e,c=this.K;b.T=!0;b.G=jl(b,c)}0>this.K?this.T.push(e.index):e.G&&il(e.G,this.T)}this.ba&&this.ba(this.T)}
|
|
879
|
-
a.position;a<c;a++)b[a]=b[a+1],b[a].position=a;b.length=c}}};olympe.dc.jc.
|
|
868
|
+
S('olympe.dc.predicates.InstanceOf',olympe.dc.$.Xh);olympe.dc.$.Xh.xa=[olympe.dc.Aa];olympe.dc.$.Yd=class{constructor(a){this.G=a}ia(){return T(olympe.dc.$.Yd)}F(){return this.G.F()}C(a,b){return a.run(()=>olympe.D.ta([this.G.C(a,b)],c=>olympe.D.Qb(!c.valueOf()),olympe.D.ea))}ha(a){return`{"c":"${this.ia()}","a":[${this.G.ha(a)}]}`}toString(){return'Not('+this.G.toString()+')'}};S('olympe.dc.predicates.Not',olympe.dc.$.Yd);olympe.dc.$.Yd.xa=[olympe.dc.Aa];olympe.dc.$.se=class{constructor(a){this.$=[];for(let b=arguments.length,c=0;c<b;c++)Array.isArray(arguments[c])?this.$=this.$.concat(arguments[c]):this.$.push(arguments[c])}ia(){return T(olympe.dc.$.se)}F(){return this.$.reduce((a,b)=>a.concat(b.F()),[])}C(a,b){return a.run(()=>olympe.D.ta(this.$.map(c=>c.C(a,b)),(...c)=>olympe.D.Qb(c.some(d=>d.valueOf())),olympe.D.ea))}ha(a){const b=this.$.map(c=>c.ha(a));return'{"c":"'+this.ia()+'","a":['+b.join(',')+']}'}toString(){return'Or('+this.$.map(a=>a.toString()).join(',')+
|
|
869
|
+
')'}};S('olympe.dc.predicates.Or',olympe.dc.$.se);olympe.dc.$.se.xa=[olympe.dc.Aa];olympe.dc.$.hf=class{constructor(a,b,c){this.source=a;this.K=b;this.G=void 0===c?!0:c}ia(){return T(olympe.dc.$.hf)}F(){return[this.source.C()]}xb(){return this.source}C(a,b){return a.run(()=>olympe.D.ta([this.source.getValue(a,b),this.K,this.G],(c,d,e)=>{c=String(c);d=String(d);e.valueOf()||(c=c.toLowerCase(),d=d.toLowerCase());return olympe.D.Qb((new RegExp(d)).test(c))},olympe.D.ea))}ha(a){const b=this.source.ha(a),c=al(a,this.K);a=al(a,this.G);return'{"c":"'+this.ia()+'","a":['+b+','+c+','+a+
|
|
870
|
+
']}'}toString(){const a=$k(this.G);return'Regex('+this.source.toString()+','+this.K+','+a+')'}};S('olympe.dc.predicates.Regex',olympe.dc.$.hf);olympe.dc.$.hf.xa=[olympe.dc.Aa];olympe.dc.$.Pj=class extends olympe.dc.$.zk{constructor(a,b){super(a,b)}ia(){return T(olympe.dc.$.Pj)}O(a,b){return a<b}};S('olympe.dc.predicates.Smaller',olympe.dc.$.Pj);olympe.dc.jc={};olympe.dc.jc.Wi=class{constructor(){this.T=this.K=this.index=this.F=null}O(){return null!==this.F}Z(a){if(null!==this.F)throw Error('Manager already activated (depth='+this.F+')');this.F=a;this.G()}C(a,b,c){b=this.K;if(a&&null!==b)throw Error('The AutoManger handles only a single item.');a?(b=new olympe.dc.jc.fj(this),this.index=c,this.K=b):this.K=this.index=null;return b}G(){if(null===this.F)throw Error('Manager not activated, need to set a depth before updating ranks');if(null!==this.T){const a=
|
|
871
|
+
[];null!==this.K&&(0<=this.F?il(jl(this.K,this.F),a):a.push(this.index));this.T(a)}}Xf(a){this.T=a}};olympe.dc.jc.Wi.xa=[olympe.dc.jc.Sa];function Yk(a,b,c,d){b?a.O[d]=c:delete a.O[d];null===a.F&&(a.F=new olympe.dc.jc.fj(a.C,a));return a.F}function jl(a,b){for(let c=0;c<b;c++)if(null!==a.F)a=a.F;else break;return a}function il(a,b){a=a.O;if(null!==a)for(let c in a)Object.prototype.hasOwnProperty.call(a,c)&&b.push(c)}olympe.dc.jc.fj=class{constructor(a,b){this.C=a;this.depth=b?b.depth+1:0;this.O=Object.create(null);this.F=null}ge(){return this.C}Nf(){this.C.O()?this.C.G():this.C.Z(this.depth-1)}};class kl extends olympe.dc.jc.fj{constructor(a,b,c){super(a);this.index=b;this.tag=c;this.Z=this.T=this.K=!1;this.G=null}}
|
|
872
|
+
function ll(a,b,c,d,e){const f=Object.create(null),g=a.oa,h=a.K;let k,l,n;a.fa=!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.K||(c.K=!0,e(!0,c.tag,c.index,c)));for(k in f)Object.prototype.hasOwnProperty.call(f,k)&&(c=h[k],c.K&&(c.K=!1,e(!1,c.tag,c.index,c)),c.T&&(c.G=null,delete h[k]),delete f[k]);a.fa=!1;null!==a.F&&a.G()}
|
|
873
|
+
olympe.dc.jc.sl=class{constructor(){this.K={};this.oa=[];this.F=null;this.fa=!1;this.T=[];this.ba=null}O(){return null!==this.F}Z(a){if(null!==this.F)throw Error('Manager already activated (depth='+this.F+')');this.F=a;this.G()}G(){if(null===this.F)throw Error('Manager not activated, need to set a depth before updating ranks');if(!this.fa){var a=this.oa,b=a.length,c=this.K,d;for(d=this.T.length=0;d<b;d++){var e=c[a[d]];if(0>this.F)this.T.push(e.index);else{if(!e.Z){var f=e,g=this.F;f.Z=!0;f.G=jl(f,
|
|
874
|
+
g)}null!==e.G&&il(e.G,this.T)}}this.ba&&this.ba(this.T)}}Xf(a){this.ba=a}C(a,b,c){let d=this.K[c];a?void 0===d?(d=new kl(this,c,b),this.K[c]=d):(d.tag=b,d.T=!1):void 0!==d&&(d.T=!0);return d}};olympe.dc.jc.sl.xa=[olympe.dc.jc.Sa];olympe.dc.jc.Sa=class{constructor(){}C(){}O(){}Z(){}G(){}Xf(){}};function ml(a,b){olympe.D.Ue(a.value)?(a.node=olympe.D.Rm(a.value,b),kb(a.node)||b()):b()}function nl(a,b){if(olympe.D.Ue(a.value)){const c=olympe.D.Xa(),d=a.K;olympe.D.Nc([a.value],e=>{d!==e.valueOf()&&(c.run(()=>ml(a,b)),olympe.D.Xa().destroy())})}}
|
|
875
|
+
class ol extends olympe.dc.jc.fj{constructor(a,b,c){super(a);this.index=b;this.value=c;this.K=this.Qa();this.position=this.node=null;this.T=!1;this.G=null}Qa(){const a=olympe.D.Qa(this.value);return a?a.valueOf():a}destroy(){this.node&&(this.node.destroy(),this.node=null);this.G=this.value=null}hb(){return null===this.value}}
|
|
876
|
+
function pl(a,b){if(!b.hb()){var c=a.F;var d=a.oa,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].K,e);if(0===k||2>g-f){0>k&&null!==b.position&&b.position<=h&&(k=d(c[g].K,e));h=0>k?g:h;break}0>k?f=h:g=h}c=h;b.K=b.Qa();if(c!==b.position){d=a.F;e=d.length;f=b.position;null===f&&(f=e);if(c<f)for(e=f;e>c;e--)d[e]=d[e-1],d[e].position=e;else for(e=f;e<c;e++)d[e]=d[e+1],d[e].position=e;d[c]=b;d[c].position=c;b.T&&a.G()}}}
|
|
877
|
+
function ql(a){const b=a.oa;a.F.sort((c,d)=>b(c.Qa(),d.Qa()))}
|
|
878
|
+
olympe.dc.jc.xq=class{constructor(a){this.oa=a;this.K=null;this.F=[];this.T=[];this.ba=null;this.fa=new Map}C(a,b,c,d){b='$'+c;const e=this.F;let f;if(a)f=new ol(this,c,d),this.fa.set(b,f),this.O()?ml(f,()=>pl(this,f)):(f.position=e.length,e.push(f));else{f=this.fa.get(b);if(void 0===f)throw Error('Trying to remove an non-registered item: "'+c+'"');this.fa.delete(b);null!==f.position&&(this.O()?this.remove(f):delete e[f.position]);f.destroy()}return f}O(){return null!==this.K}Z(a){if(null!==this.K)throw Error('Manager already activated (depth='+
|
|
879
|
+
this.K+')');this.K=a;ql(this);for(let b=0,c=this.F.length;b<c;b++){const d=this.F[b];d.position=b;nl(d,()=>pl(this,d))}this.G()}G(){if(null===this.K)throw Error('Manager not activated, need to set a depth before updating ranks');const a=this.F.length;this.T.length=0;for(let d=0;d<a;d++){let e=this.F[d];if(!e.T){var b=e,c=this.K;b.T=!0;b.G=jl(b,c)}0>this.K?this.T.push(e.index):e.G&&il(e.G,this.T)}this.ba&&this.ba(this.T)}Xf(a){this.ba=a}remove(a){const b=this.F,c=b.length-1;if(null!==a.position){for(a=
|
|
880
|
+
a.position;a<c;a++)b[a]=b[a+1],b[a].position=a;b.length=c}}};olympe.dc.jc.xq.xa=[olympe.dc.jc.Sa];function Tk(a){if(!a.F){for(let b in a.G)rl(a.G[b]);a.F=!0}a.K=null;a.O=null}function Wk(a,b,c){a.G[c||'root'].T=b}function Xk(a,b,c){a.G[c||'root'].Nf(b)}function sl(a,b,c,d){const e=a.O,f=b+d+c;let g=e[f];void 0===g&&(g=og(a.db,b,c,d),e[f]=g);return g}function tl(a,b){a.F||a.C.Nf(b)}function ul(a,b,c,d,e){if(!a.F){let f=sl(a,c,d,e||olympe.dc.ua.DESTINATION);e||(f+=sl(a,c,d,olympe.dc.ua.ORIGIN));0===f&&tl(a,b)}}
|
|
880
881
|
function vl(a,b){const c=a.G[b];void 0!==c?(a.H&&a.H.debug('Set current block to',b,null!==c.G?'parent = '+c.G.V():''),a.C=c):a.H&&a.H.error('Try to set a block that does not exists:',b)}function wl(a){const b=String(++a.T),c=a.C;a.G[b]=new xl(b,c);yl(c,b);c.K||(c.K=()=>vl(a,c.V()));return b}function zl(a,b){const c=a.C;a.C.K=()=>{vl(a,c.V());b()}}function Al(a,b){rl(b?a.G[b]:a.C)}
|
|
881
|
-
olympe.dc.jc.
|
|
882
|
-
class xl{constructor(a,b){this.id=a;this.G=b||null;this.C=this.T=this.K=this.F=null;this.O=!1}V(){return this.id}Nf(a){const b=this.T;if(this.O||this.C===a||null===a)b&&b(),!b&&rl(this)}notify(a){const b=this.K,c=this.F;if(this.O)b&&b();else if(!c[a]){a=c[a]=!0;for(let d in c)if(!c[d]){a=!1;break}a&&b&&b()}}};olympe.dc
|
|
883
|
-
function Cl(a,b,c){const d=c.getContext(),e=olympe.dc.
|
|
884
|
-
olympe.dc.
|
|
885
|
-
b=this.F||b;null!==this.da?Bl(a,b,this.da,d=>{Cl(this,d,c)}):Cl(this,b,c);return c.ub()}ha(a){const b=al(a,this.K),c=al(a,this.F);let d='null';this.da&&(d=this.da.map(function(e){return e.ha(a)}).join(','));return`{"c":"${this.ia()}","a":["${b}",${d},${c}]}`}toString(){const a=$k(this.K),b=this.F?','+$k(this.F):'';let c='';this.da&&(c=','+this.da.join(','));return this.ia().replace(/^.+\./,'')+'('+a+c+b+')'}};olympe.dc.
|
|
886
|
-
b);break;case olympe.dm.Boolean.P.X():d=new olympe.dc.
|
|
887
|
-
d(g,h,k,!1),delete e[h]}}ha(a){return'{"c":"'+this.ia()+'","a":['+this.F.ha(a)+']}'}toString(){return'Filter('+this.F.toString()+')'}};S('olympe.dc.transformers.Filter',olympe.dc.da
|
|
888
|
-
u,w,f,g);c(!0,z,A,C)},y.
|
|
889
|
-
'","'+this.G.toString()+'"]}'}toString(){return'FirstRelated('+this.F.toString()+', '+this.G.toString()+')'}};S('olympe.dc.transformers.FirstRelated',olympe.dc.da
|
|
890
|
-
this.ia()+'","a":['+al(a,this.start)+','+al(a,this.F)+']}'}toString(){return`Limit(${olympe.D.Qa(this.start)},${olympe.D.Qa(this.F)})`}};S('olympe.dc.transformers.Limit',olympe.dc.da.Xg);olympe.dc.da.Xg.xa=[olympe.dc.kf];function Dl(a){return a.
|
|
891
|
-
olympe.dc.da.
|
|
892
|
-
{d.F(g,l,h)})}}ha(){return'{"c":"'+this.ia()+'","a":['+JSON.stringify(Dl(this))+',"'+this.direction+'"]}'}toString(){return'MultiRelated('+this.Ga()+'['+Dl(this).join(',')+'])'}};S('olympe.dc.transformers.MultiRelated',olympe.dc.da.
|
|
893
|
-
q,r,h,k||g);null===k&&b.register(y,q,r,h,f)}}},n=(p,q,r,t,u,w)=>{u&&!b.F&&l(p,t,w);p>=this.G?c(u,w,t,Yk(r,u,w,t)):ul(b,t,w,h,k);0<=this.F&&p>=this.F||(u?e[w]||(e[w]=!0,W(d,w,this,(y,z)=>{const A=p+1,C=olympe.Y.
|
|
894
|
-
S('olympe.dc.transformers.RecursiveRelated',olympe.dc.da.
|
|
895
|
-
this.ia()+'","a":["'+this.X()+'","'+this.Ga()+'"]}'}toString(){return'Related('+this.Ga()+this.X()+')'}};S('olympe.dc.transformers.Related',olympe.dc.da.
|
|
896
|
-
S('olympe.dc.transformers.Sort',olympe.dc.da.ug);olympe.dc.da.ug.xa=[olympe.dc.kf,olympe.dc.
|
|
897
|
-
olympe.dc.da.lf=class{constructor(a,b){this.da=this.F=null;a instanceof olympe.dc.ya?(this.F=a.
|
|
898
|
-
u.
|
|
899
|
-
S('olympe.dc.transformers.Union',olympe.dc.da.lf);olympe.dc.da.lf.xa=[olympe.dc.kf];olympe.dc.da.
|
|
900
|
-
olympe.dc.CloudObject=class{constructor(a,b){this.tag=b;this.db=olympe.dc.
|
|
901
|
-
b,c){if('undefined'===typeof olympe.sc)throw Error('Method CloudObject.createWith should only be used at runtime, when sc package exists');const d=olympe.dc.
|
|
902
|
-
olympe.dc.CloudObject.propertyRel).map(a=>new olympe.dc.Ma.Property(a))}static sd(){const a=olympe.dc.
|
|
903
|
-
(this.model=olympe.dc.CloudObject.get(this.db.model(this)));return this.model}query(){return olympe.dc.
|
|
904
|
-
{const f=this.db.Ja(this.tag,b);c||null!==f||e.next(f);const g=$f(this.db,this.tag,b,h=>{null===h||void 0===h?e.next(null):e.next(h)});d.Z(()=>{e.complete();ag(this.db,this.tag,b,g)});return()=>ag(this.db,this.tag,b,g)})}
|
|
905
|
-
this.tag,d)})}
|
|
906
|
-
d.update(f)}));d.getContext().onDestroy(()=>ag(this.db,this.tag,a,e));return d.getContext()}vb(a){return N(this.wf(a,olympe.dc.
|
|
907
|
-
b){a=a instanceof olympe.dc.da.
|
|
908
|
-
'NULL_TAG'}`;const a=this.db.model(this.tag);var b=this.db.name(this);b=b?` instanceName: '${b}'`:'';return a?`${this.db.name(a)}#${this.tag}${b}`:`orphan object (no model) #${this.tag}${b}`}toJSON(){return Object.assign({'#tag':this.X(),'#type':this.
|
|
909
|
-
typeof a?olympe.dc.
|
|
910
|
-
olympe.dc.CloudObject.prototype.followSingle=olympe.dc.CloudObject.prototype.
|
|
911
|
-
olympe.dc.CloudObject.prototype.observe=olympe.dc.CloudObject.prototype.observe;olympe.dc.CloudObject.prototype.getModelTag=olympe.dc.CloudObject.prototype.bc;olympe.dc.CloudObject.prototype.getSource=olympe.dc.CloudObject.prototype.xb;olympe.dc.CloudObject.prototype.isPersisted=olympe.dc.CloudObject.prototype.
|
|
912
|
-
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.
|
|
913
|
-
olympe.dc.CloudObject.createWith=olympe.dc.CloudObject.
|
|
914
|
-
olympe.dc.CloudObject.
|
|
915
|
-
x('olympe.dc.CloudObject.propertyRel',olympe.dc.CloudObject.propertyRel);olympe.dc.CloudObject.typeRel=olympe.dc.CloudObject.P.sa('ff02200000000000000d',olympe.dc.ua.ORIGIN);olympe.dc.CloudObject.modelRel=olympe.dc.CloudObject.P.sa(olympe.dc.
|
|
916
|
-
olympe.dc.CloudObject.extendRel=olympe.dc.CloudObject.P.sa(olympe.dc.
|
|
917
|
-
olympe.dc.CloudObject.
|
|
918
|
-
m.xb.L=new olympe.D.J(()=>String,[]);m.
|
|
919
|
-
m
|
|
920
|
-
olympe.W.config(function(a){const b='object'===typeof window;F(a,olympe.dc.U.
|
|
921
|
-
D(a,olympe.dc.R.pg,olympe.dc.
|
|
922
|
-
olympe.W.run([olympe.dc.db.R.Ha,olympe.dc.transaction.R.Ha,olympe.dc.R.
|
|
923
|
-
olympe.dm.Ed.F=R('014831d95f83635090ea','ADMIN_USERS_ROLE');olympe.dm.Ed.prototype.ia.L=olympe.D.J.F;olympe.dm.Ed.prototype.C.L=olympe.D.J.F;olympe.dm.Ed.prototype.F.L=olympe.D.J.O;olympe.dm.User=class extends olympe.dc.CloudObject{
|
|
924
|
-
x('olympe.dm.User.loginProp',olympe.dm.User.loginProp);olympe.dm.User.F=olympe.dm.User.P.
|
|
925
|
-
olympe.dm.User.SAMLnameIdProp=olympe.dm.User.P.
|
|
926
|
-
m.
|
|
927
|
-
olympe.dm.BrickMetadata.fa=olympe.dm.BrickMetadata.P.sa('0161ae97622bb21f335b');olympe.dm.BrickMetadata.
|
|
928
|
-
function Ui(a,b){return a.observe(b,olympe.dm.DataSource.
|
|
929
|
-
olympe.dm.DataSource=class extends olympe.dc.CloudObject{constructor(a,b,c){super(a,b);this.Xb=c;this
|
|
930
|
-
'_')}.${a}`))?c:olympe.W.getParameter(`${'data.'}${this.X()}.${a}`))?d:olympe.W.getParameter(b))?e:this.
|
|
931
|
-
{const f=olympe.N.errors.
|
|
882
|
+
olympe.dc.jc.zq=class{constructor(a,b){this.db=a;this.H=b||null;this.K=Object.create(null);this.O=Object.create(null);this.F=!1;this.T=0;this.C=new xl('root');this.G=Object.create(null);this.G.root=this.C}register(a,b,c,d,e){this.F||(null!==b&&c&&d&&e?(c=sl(this,c,d,e),d=this.K[b]||0,this.K[b]=++d,this.C.C===b&&c<=d&&(this.C.C=a)):this.C.C=a)}};function yl(a,b){null===a.F&&(a.F=Object.create(null));a.F[b]=!1}function rl(a){a.O=!0;null!==a.G&&a.G.notify(a.id)}
|
|
883
|
+
class xl{constructor(a,b){this.id=a;this.G=b||null;this.C=this.T=this.K=this.F=null;this.O=!1}V(){return this.id}Nf(a){const b=this.T;if(this.O||this.C===a||null===a)b&&b(),!b&&rl(this)}notify(a){const b=this.K,c=this.F;if(this.O)b&&b();else if(!c[a]){a=c[a]=!0;for(let d in c)if(!c[d]){a=!1;break}a&&b&&b()}}};olympe.dc.$a={};function Bl(a,b,c,d){const e=olympe.dc.ja(),f=new olympe.dc.jc.Wi,g=new olympe.dc.jc.zq(e);let h=!1;const k=Object.create(null),l=q=>{if(0<q.length)for(const r in k)q[0]===r&&d(k[r])};let n=(q,r,t,u)=>{a.Tc()||a.hb()||(h||(Wk(g,()=>{u.Nf();Tk(g)}),u.ge().Xf(l),h=!0),q?k[t]=r:delete k[t],Xk(g,t))};if(null!==c)for(let q=c.length-1;0<=q;q--)n=c[q].C(a,g,n);const p=olympe.Y.Fc();Ke(e,b,(q,r)=>{g.register(p,null);const t=f.C(q,b,p,null);n(q,r,p,Yk(t,q,b,p))},p);a.onDestroy(()=>{Je(e,b,p)});e.Fa(b)||Tk(g)}
|
|
884
|
+
function Cl(a,b,c){const d=c.getContext(),e=olympe.dc.ja(),f=a.G(),g=$f(e,b,a.K,d.G(h=>{null!==h&&(h=f(h));null===h?c.clear():c.update(h)}));d.onDestroy(()=>ag(e,b,a.K,g))}
|
|
885
|
+
olympe.dc.$a.Hh=class{constructor(a,b,c){this.K=a&&a.X?a.X():a;this.da=b&&b.filter(d=>d instanceof olympe.dc.da.Je||d instanceof olympe.dc.da.te)||null;this.F=c||null;this.defaultValue=null}ia(){}Pb(){}G(){}C(){return(this.da||[]).reduce((a,b)=>a.concat(olympe.dc.query.Relation.from(b)),[])}Mg(a){this.defaultValue=a;return this}Fg(){return this.da}Od(){return this.F}getValue(a,b){const c=a.run(()=>olympe.D.ic(this.Pb()||Object,'AbstractProperty valueType'));null!==this.defaultValue&&Eb(c,this.defaultValue);
|
|
886
|
+
b=this.F||b;null!==this.da?Bl(a,b,this.da,d=>{Cl(this,d,c)}):Cl(this,b,c);return c.ub()}ha(a){const b=al(a,this.K),c=al(a,this.F);let d='null';this.da&&(d=this.da.map(function(e){return e.ha(a)}).join(','));return`{"c":"${this.ia()}","a":["${b}",${d},${c}]}`}toString(){const a=$k(this.K),b=this.F?','+$k(this.F):'';let c='';this.da&&(c=','+this.da.join(','));return this.ia().replace(/^.+\./,'')+'('+a+c+b+')'}};olympe.dc.$a.Hh.xa=[olympe.dc.Uj];olympe.dc.$a.nn=class{constructor(a,b){if(olympe.D.Ue(a))throw Error('Dataflows of Property not supported by AnyProperty');const c=a.X();var d=olympe.dc.ja();const e=d.Ib(a,olympe.dm.Property.typeRel);if(!e)throw Error('Type of property '+a+'unavailable locally, cannot proceed with AnyProperty');a=d.Eg(e,olympe.dc.CloudObject.extendRel,olympe.dm.Ie);d=null;switch(1<a.length?a[a.length-2]:e){case olympe.dm.String.P.X():d=new olympe.dc.$a.ji(c,b);break;case olympe.dm.Number.P.X():d=new olympe.dc.$a.ci(c,
|
|
887
|
+
b);break;case olympe.dm.Boolean.P.X():d=new olympe.dc.$a.Xi(c,b);break;case olympe.dm.DateTime.P.X():d=new olympe.dc.$a.Mh(c,b)}this.F=d}ia(){return this.F.ia()}C(){return this.F.C()}getValue(a,b){return this.F.getValue(a,b)}ha(a){return this.F.ha(a)}toString(){return this.F.toString()}};olympe.dc.$a.nn.xa=[olympe.dc.Uj];olympe.dc.$a.Xi=class extends olympe.dc.$a.Hh{constructor(a,b,c){super(a,b,c)}ia(){return T(olympe.dc.$a.Xi)}G(){return olympe.dc.Jb.jm}Pb(){return olympe.D.ea}};S('olympe.dc.valuedefs.BooleanProperty',olympe.dc.$a.Xi);olympe.dc.$a.De=class{constructor(a){this.value=a}ia(){return T(olympe.dc.$a.De)}C(){return[]}getValue(){return this.value}ha(a){a=al(a,this.value);return`{"c":"${this.ia()}","a":[${a}]}`}toString(){return`Constant(${$k(this.value)})`}};S('olympe.dc.valuedefs.Constant',olympe.dc.$a.De);olympe.dc.$a.De.xa=[olympe.dc.Uj];olympe.dc.$a.Mh=class extends olympe.dc.$a.Hh{constructor(a,b,c){super(a,b,c)}ia(){return T(olympe.dc.$a.Mh)}G(){return olympe.dc.Jb.km}Pb(){return olympe.D.gb}};S('olympe.dc.valuedefs.DateTimeProperty',olympe.dc.$a.Mh);olympe.dc.$a.ci=class extends olympe.dc.$a.Hh{constructor(a,b,c){super(a,b,c)}ia(){return T(olympe.dc.$a.ci)}G(){return olympe.dc.Jb.mm}Pb(){return olympe.D.aa}};S('olympe.dc.valuedefs.NumberProperty',olympe.dc.$a.ci);olympe.dc.$a.ji=class extends olympe.dc.$a.Hh{constructor(a,b,c){super(a,b,c)}ia(){return T(olympe.dc.$a.ji)}G(){return olympe.dc.Jb.nm}Pb(){return olympe.D.Na}};S('olympe.dc.valuedefs.StringProperty',olympe.dc.$a.ji);olympe.dc.$a.li=class{ia(){return T(olympe.dc.$a.li)}C(){return[]}getValue(a,b){return b}ha(){return'{"c":"'+this.ia()+'","a":[]}'}toString(){return'Tag()'}};S('olympe.dc.valuedefs.Tag',olympe.dc.$a.li);olympe.dc.$a.li.xa=[olympe.dc.Uj];olympe.dc.da={};olympe.dc.da.Nh=class{Pb(){return null}ia(){return T(olympe.dc.da.Nh)}C(a,b,c){const d={};return function(e,f,g,h){e?void 0===d[f]?(d[f]=1,b.C.C!==g||b.F||(b.C.C=f),c(!0,f,f,Yk(h,!0,f,f))):(d[f]++,tl(b,g)):void 0!==d[f]&&0>=--d[f]&&(delete d[f],c(!1,f,f,Yk(h,!1,f,f)))}}ha(){return'{"c":"'+this.ia()+'"}'}toString(){return'Distinct()'}};S('olympe.dc.transformers.Distinct',olympe.dc.da.Nh);olympe.dc.da.Nh.xa=[olympe.dc.kf];olympe.dc.da.af=class{constructor(a){this.F=a}Pb(){return null}ia(){return T(olympe.dc.da.af)}G(){return this.F.F()}C(a,b,c){function d(f,g,h,k){k=k.valueOf();!1===k&&tl(b,g);k!==!!e[g]&&(e[g]=k,c(k,f,g,Yk(h,k,f,g)))}const e={};return(f,g,h,k)=>{const l='@'+h;if(f){let n=this.F.C(a,g);olympe.D.fb(n)&&(n=n.Da);olympe.D.Sf(n)?(b.F||void 0!==olympe.D.Qa(n)||tl(b,h),e[l]=n,a.run(()=>{olympe.D.Nc([n],p=>{d(g,h,k,p)},'filterResultHandler')})):d(g,h,k,n)}else void 0!==e[l]&&(e[l].destroy(),delete e[l]),
|
|
888
|
+
d(g,h,k,!1),delete e[h]}}ha(a){return'{"c":"'+this.ia()+'","a":['+this.F.ha(a)+']}'}toString(){return'Filter('+this.F.toString()+')'}};S('olympe.dc.transformers.Filter',olympe.dc.da.af);olympe.dc.da.af.xa=[olympe.dc.kf,olympe.dc.Np];olympe.dc.da.$k=class{constructor(a,b,c,d){this.F=new olympe.dc.Ma.Relation(olympe.dc.ga(a),c||olympe.dc.ua.DESTINATION);this.G=new olympe.dc.Ma.Relation(olympe.dc.ga(b),d||olympe.dc.ua.DESTINATION)}Pb(){return df(this.F)}ia(){return T(olympe.dc.da.$k)}C(a,b,c){const d=olympe.dc.ja(),e={},f=this.F.X(),g=this.F.Ga(),h=this.G.X(),k=this.G.Ga();let l=null,n=null;const p=(r,t,u,w,y,z)=>{if(y){if(y=()=>{const A=olympe.Y.sb(u+g+(f+'_'+r)+z,20),C=Yk(t,!0,z,A);l=r;n=()=>{c(!1,z,A,Yk(t,!1,z,A))};b.register(A,
|
|
889
|
+
u,w,f,g);c(!0,z,A,C)},y.rr=r,e[w]=y,null===l||r<l)n&&n(),y()}else if(l===r){n();e[w]=!0;y=Infinity;let A=null;for(let C=Object.keys(e),M=C.length,K=0;K<M;K++){let ta=e[C[K]];ta.rr<y&&(y=ta.rr,A=ta)}A&&A()}},q=(r,t,u,w,y)=>{w?e[y]||(e[y]=!0,ul(b,u,y,f,g),ul(b,u,y,h,k),W(d,y,this.F,p.bind(this,r,t,u,y),u+'_val'),W(d,y,this.G,q.bind(this,r+1,t,u),u+'_follow')):(d.F(y,this.G,u+'_follow'),d.F(y,this.F,u+'_val'),delete e[y])};return(r,t,u,w)=>q(0,w,u,r,t)}ha(){return'{"c":"'+this.ia()+'","a":["'+this.F.toString()+
|
|
890
|
+
'","'+this.G.toString()+'"]}'}toString(){return'FirstRelated('+this.F.toString()+', '+this.G.toString()+')'}};S('olympe.dc.transformers.FirstRelated',olympe.dc.da.$k);olympe.dc.da.$k.xa=[olympe.dc.kf];olympe.dc.da.Xg=class{constructor(a,b){this.start=a;this.F=b}Pb(){return null}ia(){return T(olympe.dc.da.Xg)}C(a,b,c){const d=new olympe.dc.jc.sl;let e,f,g,h=!1;const k=()=>{if(void 0!==f&&void 0!==g&&void 0!==e){var n=f+g;b.F||(b.C.C=e[0>n-1?0:Math.min(e.length,n)-1]);ll(d,e,f,n,c)}};a.run(()=>olympe.D.Nc([this.start,this.F],(n,p)=>{f=n.valueOf();g=p.valueOf();k()}));zl(b,k);const l=wl(b);vl(b,l);return(n,p,q,r)=>{h||(r.ge().Xf(t=>{e=t;Al(b,l)}),Wk(b,()=>r.Nf(),l),h=!0);d.C(n,p,q,null);Xk(b,q,l)}}ha(a){return'{"c":"'+
|
|
891
|
+
this.ia()+'","a":['+al(a,this.start)+','+al(a,this.F)+']}'}toString(){return`Limit(${olympe.D.Qa(this.start)},${olympe.D.Qa(this.F)})`}};S('olympe.dc.transformers.Limit',olympe.dc.da.Xg);olympe.dc.da.Xg.xa=[olympe.dc.kf];function Dl(a){return a.lb.map(b=>b.X())}
|
|
892
|
+
olympe.dc.da.qj=class{constructor(a,b){this.direction=b||olympe.dc.ua.DESTINATION;this.lb=a.map(c=>new olympe.dc.Ma.Relation(c,this.direction))}Pb(){return olympe.dc.CloudObject}ia(){return T(olympe.dc.da.qj)}Ga(){return this.direction}C(a,b,c){const d=olympe.dc.ja(),e=(f,g,h,k)=>W(d,f,k,(l,n)=>{var p=k.X();p=olympe.Y.sb(g+k.Ga()+p+n,20);const q=Yk(h,l,n,p);l&&b.register(p,g,f,k.X(),k.Ga());c(l,n,p,q)},g);return(f,g,h,k)=>{f?this.lb.forEach(l=>{ul(b,h,g,l.X(),l.Ga());e(g,h,k,l)}):this.lb.forEach(l=>
|
|
893
|
+
{d.F(g,l,h)})}}ha(){return'{"c":"'+this.ia()+'","a":['+JSON.stringify(Dl(this))+',"'+this.direction+'"]}'}toString(){return'MultiRelated('+this.Ga()+'['+Dl(this).join(',')+'])'}};S('olympe.dc.transformers.MultiRelated',olympe.dc.da.qj);olympe.dc.da.qj.xa=[olympe.dc.kf];olympe.dc.da.te=class extends olympe.dc.Ma.Relation{constructor(a,b=olympe.dc.ua.DESTINATION,c=1,d=-1){super(a,b);this.G=c;this.F=d}Pb(){return df(this)}ia(){return T(olympe.dc.da.te)}C(a,b,c){const d=olympe.dc.ja(),e=Object.create(null),f=olympe.dc.ua.ORIGIN,g=olympe.dc.ua.DESTINATION,h=this.X(),k=this.Ga(),l=(p,q,r)=>{if(!(0<=this.F&&p>=this.F)){var t=d.ab(r,this);p+=1;for(let u=0,w=t.length;u<w;u++){if(void 0!==e[t[u]]||r===t[u])continue;const y=olympe.Y.sb(q+k+(h+'_'+p)+t[u],20);b.register(y,
|
|
894
|
+
q,r,h,k||g);null===k&&b.register(y,q,r,h,f)}}},n=(p,q,r,t,u,w)=>{u&&!b.F&&l(p,t,w);p>=this.G?c(u,w,t,Yk(r,u,w,t)):ul(b,t,w,h,k);0<=this.F&&p>=this.F||(u?e[w]||(e[w]=!0,W(d,w,this,(y,z)=>{const A=p+1,C=olympe.Y.sb(t+k+(h+'_'+A)+z,20);n(A,w,r,C,y,z)},t)):(d.F(w,this,t),delete e[w]))};return(p,q,r,t)=>n(0,null,t,r,p,q)}ha(){return'{"c":"'+this.ia()+'","a":["'+this.X()+'","'+this.Ga()+'",'+this.G+','+this.F+']}'}toString(){return'RecursiveRelated('+this.Ga()+this.X()+'['+this.G+'..'+this.F+'])'}};
|
|
895
|
+
S('olympe.dc.transformers.RecursiveRelated',olympe.dc.da.te);olympe.dc.da.te.xa=[olympe.dc.kf];olympe.dc.da.Je=class extends olympe.dc.Ma.Relation{constructor(a,b){super(a,b||olympe.dc.ua.DESTINATION)}Pb(){return df(this)}ia(){return T(olympe.dc.da.Je)}Vb(){return new olympe.dc.da.Je(this.tag,this.direction===olympe.dc.ua.DESTINATION?olympe.dc.ua.ORIGIN:olympe.dc.ua.DESTINATION)}C(a,b,c){const d=olympe.dc.ja(),e=this.X(),f=this.Ga();return(g,h,k,l)=>{ul(b,k,h,e,f);g?W(d,h,this,(n,p)=>{const q=olympe.Y.sb(k+f+e+p,20),r=Yk(l,n,p,q);n&&b.register(q,k,h,e,f);c(n,p,q,r)},k):d.F(h,this,k)}}ha(){return'{"c":"'+
|
|
896
|
+
this.ia()+'","a":["'+this.X()+'","'+this.Ga()+'"]}'}toString(){return'Related('+this.Ga()+this.X()+')'}};S('olympe.dc.transformers.Related',olympe.dc.da.Je);olympe.dc.da.Je.xa=[olympe.dc.kf];olympe.dc.da.ug=class{constructor(a,b){this.Fb=a;this.F=void 0===b?!0:!!b}Pb(){return null}ia(){return T(olympe.dc.da.ug)}Cg(){return this.Fb}G(){return[this.Fb.O()]}C(a,b,c){const d=new olympe.dc.jc.xq(a.G(this.F?this.Fb.G.bind(this.Fb):(e,f)=>this.Fb.G(f,e)));return(e,f,g)=>{var h=e?this.Fb.K(a,f):void 0;h=d.C(e,f,g,h);c(e,f,g,h)}}ha(a){return'{"c":"'+this.ia()+'","a":['+this.Fb.ha(a)+','+JSON.stringify(this.F)+']}'}toString(){return'Sort('+this.Fb.toString()+','+JSON.stringify(this.F)+')'}};
|
|
897
|
+
S('olympe.dc.transformers.Sort',olympe.dc.da.ug);olympe.dc.da.ug.xa=[olympe.dc.kf,olympe.dc.Np];function El(a,b,c,d,e,f){function g(n,p){if(l)for(var q=l.length-1;0<=q;q--)f=l[q].C(b,e,f);e.register(h,null);q=d.C(n,p,c,null);f(n,p,h,Yk(q,n,p,h))}const h=olympe.Y.Fc(),k=olympe.dc.ja(),l=a.da;b.run(()=>olympe.D.Nc([a.F],n=>{Fl(k,n,g,h);void 0===k.model(n)&&Tk(e)}))}function Fl(a,b,c,d){const e=b&&b.valueOf();e&&(Ke(a,e,c,d),olympe.D.Xa().Z(()=>Je(a,e,d)))}
|
|
898
|
+
olympe.dc.da.lf=class{constructor(a,b){this.da=this.F=null;a instanceof olympe.dc.ya?(this.F=a.Od(),this.da=a.nl()):(this.F=a,b&&(this.da=b))}Pb(){return null}ia(){return T(olympe.dc.da.lf)||''}Fg(){return this.da}Od(){return this.F}C(a,b,c){const d=new olympe.dc.jc.sl,e=new olympe.dc.jc.Wi;let f=[],g=[],h=!1,k=!1;const l=wl(b),n=wl(b);zl(b,()=>{const p=f.concat(g);0<p.length?b.F||(b.C.C=p[p.length-1]):Al(b);ll(d,p,0,p.length,c)});vl(b,n);El(this,a,this.F,e,b,(p,q,r,t)=>{const u=olympe.D.Xa();u.Tc()||
|
|
899
|
+
u.hb()||(k||(t.ge().Xf(w=>{g=w;Al(b,n)}),Wk(b,()=>t.Nf(),n),k=!0),d.C(p,q,r),Xk(b,r,n))});vl(b,l);return(p,q,r,t)=>{h||(t.ge().Xf(u=>{f=u;Al(b,l)}),Wk(b,()=>t.Nf(),l),h=!0);d.C(p,q,r,l);Xk(b,r,l)}}ha(a){const b=this.da?'['+this.da.map(c=>c.ha(a)).join(',')+']':'null';return'{"c":"'+this.ia()+'","a":['+al(a,this.F)+','+b+']}'}toString(){const a=olympe.D.fb(this.F)?'N:'+this.F.Da.V():this.F.valueOf(),b=this.da?','+this.da.map(c=>c.toString()).join(','):'';return'Union('+a+b+')'}};
|
|
900
|
+
S('olympe.dc.transformers.Union',olympe.dc.da.lf);olympe.dc.da.lf.xa=[olympe.dc.kf];olympe.dc.da.cq={oz:1,Ns:-1,Ms:0};olympe.dc.da.MA={Wx:!0,xy:!1};olympe.dc.vc.R={fp:'dc.legacy.listdefProcessor'};olympe.W.config(a=>{D(a,olympe.dc.vc.R.fp,olympe.dc.vc.Bt,olympe.dc.query.R.Ca,olympe.dc.R.$e,olympe.dc.transaction.R.Ha,olympe.dc.query.R.Cj,new olympe.W.ka(olympe.dc.U.ih))});olympe.W.run([olympe.dc.vc.R.fp],a=>{olympe.dc.vc.lw=()=>a});function Gl(a){const b=olympe.dc.ja(),c=new Map;b.jr(a).forEach(d=>{b.ab(d,olympe.dc.CloudObject.propertyRel).forEach(e=>{const f=b.name(e);c.has(f)||c.set(f,e)})});return c}
|
|
901
|
+
olympe.dc.CloudObject=class{constructor(a,b){this.tag=b;this.db=olympe.dc.ja();this.model=null}static Lc(a,b,c,...d){b=olympe.dc.ga(b);var e=Me(b);(e=e&&e.C)?e(a,c,...d):(a=a.create(b),void 0!==c&&null!==c&&Z(a,olympe.dc.CloudObject.nameProp,c),a.X())}static get(a){if(a instanceof olympe.dc.CloudObject)var b=a;else{b=olympe.dc.kr();a=olympe.dc.ga(a);var c=b.db.model(a);c=Le(b,c);if(null===c)throw new olympe.dc.Bp(a);c=c.instantiate(a,b.F);b.C.C.bb([a]);b.Ma.register(c,a);b=c}return b}static exists(a){return olympe.dc.ja().Fa(olympe.dc.ga(a))}static rv(a,
|
|
902
|
+
b,c){if('undefined'===typeof olympe.sc)throw Error('Method CloudObject.createWith should only be used at runtime, when sc package exists');const d=olympe.dc.ja();let e=null;const f=h=>{null===e&&(e=Gl(b||this));return e.has(h)?e.get(h):null},g=new Map;a.forEach((h,k)=>{d.Fa(olympe.dc.ga(k))?g.set(k,h):(k=f(k))&&g.set(k,h)});a=new olympe.sc.Wa(!1);c=a.create(null!=b?b:this,g,c);a.kb().catch(h=>olympe.ma.eb('dc').error(`Error occurred for transaction executed by CloudObject.createWith: ${h}`));return this.get(c)}static jv(){return this.get(this)}static kk(a){return olympe.dc.pa.kk(a)}static Cb(){return olympe.dc.ja().ab(this,
|
|
903
|
+
olympe.dc.CloudObject.propertyRel).map(a=>new olympe.dc.Ma.Property(a))}static sd(){const a=olympe.dc.ja();return a.ab(this,olympe.dc.CloudObject.Li).map(b=>new olympe.dc.Ma.Relation(b)).concat(a.ab(this,olympe.dc.CloudObject.cr).map(b=>new olympe.dc.Ma.Relation(b,olympe.dc.ua.ORIGIN)))}static Hd(a){return olympe.dc.CloudObject.get(a)}static gw(a){var b=Le(olympe.dc.kr(),olympe.dc.ga(a));b=b&&b.F;return new olympe.dc.ya(olympe.dc.ga(a),olympe.dc.CloudObject.instancesRel,b)}X(){return this.tag}name(){return this.db.name(this)}ia(){return this.vb(olympe.dc.CloudObject.nameProp)}Ec(){this.model||
|
|
904
|
+
(this.model=olympe.dc.CloudObject.get(this.db.model(this)));return this.model}query(){return olympe.dc.pa.from(this)}Uf(){return this.db.Uf(this)}xb(){return this.db.source(this)}hw(){return this.db.Bh(this)?olympe.dc.Rd().fromModel(this):null}ir(){return olympe.D.ta([this.ia()],a=>olympe.D.wb(a),olympe.D.Na,'getDisplayName',olympe.D.wb('('+this.toString()+')'))}bc(){return this.model?this.model.X():this.db.model(this)}observe(a,b,c=!0){const d='function'===typeof a.F?a.F():a;return new rxjs.Observable(e=>
|
|
905
|
+
{const f=this.db.Ja(this.tag,b);c||null!==f||e.next(f);const g=$f(this.db,this.tag,b,h=>{null===h||void 0===h?e.next(null):e.next(h)});d.Z(()=>{e.complete();ag(this.db,this.tag,b,g)});return()=>ag(this.db,this.tag,b,g)})}mx(a){const b='function'===typeof a.F?a.F():a;return new rxjs.Observable(c=>{const d=bg(this.db,this.tag,(e,f)=>{null===f||void 0===f?c.next([new olympe.dc.Ma.Property(e),null]):c.next([new olympe.dc.Ma.Property(e),f])});b.Z(()=>{c.complete();cg(this.db,this.tag,d)});return()=>cg(this.db,
|
|
906
|
+
this.tag,d)})}nx(a){return this.observe(olympe.D.Xa(),a)}get(a){return this.db.Ja(this.tag,a)}Ja(a){return this.get(a)}cb(a){return olympe.dc.pa.from(this).cb(a)}ak(a){return olympe.dc.ad.from(this).cb(a)}Rv(){return this.oc(olympe.dc.CloudObject.nv,olympe.dc.CloudObject)}ym(){return this.ab(olympe.dc.CloudObject.containsRel,olympe.dc.CloudObject)}wf(a,b,c){const d=olympe.D.ic(c,'Sync valueType'),e=$f(this.db,this.tag,a,olympe.D.Xa().G(f=>{b&&null!==f&&void 0!==f&&(f=b(f));null===f||void 0===f?d.clear():
|
|
907
|
+
d.update(f)}));d.getContext().onDestroy(()=>ag(this.db,this.tag,a,e));return d.getContext()}vb(a){return N(this.wf(a,olympe.dc.Jb.nm,olympe.D.Na))}Sc(a){return N(this.wf(a,olympe.dc.Jb.mm,olympe.D.aa))}xh(a){return N(this.wf(a,olympe.dc.Jb.jm,olympe.D.ea))}Fi(a){return N(this.wf(a,olympe.dc.Jb.km,olympe.D.gb))}nr(){return N(this.wf(olympe.dm.Color.valueProp,olympe.dc.Jb.Wq,olympe.D.Color))}qr(){return N(this.wf(olympe.sc.workflow.Transition.processRefProp,olympe.dc.Jb.Xq,olympe.dc.CloudObject))}ab(a,
|
|
908
|
+
b){a=a instanceof olympe.dc.da.Je?a:new olympe.dc.da.Je(a.X(),a.Ga());return new olympe.dc.ya(this.X(),a,b)}oc(a,b){return this.ab(a,b).xc()}fr(a,b){const c=this.db,d=olympe.Y.Fc(),e=olympe.D.Xa(),f=new Map;W(c,this.tag,a,(g,h)=>{if(g)(g=e.run(b,olympe.dc.CloudObject.get(h)))&&f.set(h,g);else{let k;null==(k=f.get(h))||k();f.delete(h)}},d);e.onDestroy(()=>{c.F(this.tag,a,d)})}Px(){return new olympe.dc.ya(this.X(),[],bf(this.X()))}transform(...a){return(new olympe.dc.ya(this.X(),[],this.constructor)).transform(...a)}Hc(){return this.ir()}toString(){if(!this.db.Fa(this.tag))return`unknown object #${this.tag||
|
|
909
|
+
'NULL_TAG'}`;const a=this.db.model(this.tag);var b=this.db.name(this);b=b?` instanceName: '${b}'`:'';return a?`${this.db.name(a)}#${this.tag}${b}`:`orphan object (no model) #${this.tag}${b}`}toJSON(){return Object.assign({'#tag':this.X(),'#type':this.Ec().name()},this.Ic(!0,!0))}Ic(a=!1,b=!0){const c={};this.db.Cb(this,b).forEach((d,e)=>{this.db.Fa(e)&&(e=a?this.db.name(e):e,c[e]=d instanceof olympe.dc.Bc?Ie(d):d)});return c}Ka(a){return a instanceof olympe.dc.CloudObject?this.X()===a.X():'function'===
|
|
910
|
+
typeof a?olympe.dc.na.bc(a)===this.X():!1}ud(a){return olympe.D.ta([a],b=>olympe.D.Qb(this.Ka(b)),olympe.D.ea)}vv(a){const b=this.db;let c=!1;if(void 0===a||null===a)a=new olympe.dc.Wa,c=!0;const d=olympe.dc.ua.ORIGIN;for(const [e,f,g]of mg(b,this))f===d?a.fc(e,g,this):e!==olympe.dc.CloudObject.modelRel.X()&&a.fc(e,this,g);a.delete(this,olympe.dc.cc.NONE);c&&a.kb()}};olympe.dc.CloudObject.prototype.equals=olympe.dc.CloudObject.prototype.Ka;olympe.dc.CloudObject.prototype.toObject=olympe.dc.CloudObject.prototype.Ic;
|
|
911
|
+
olympe.dc.CloudObject.prototype.followSingle=olympe.dc.CloudObject.prototype.ak;olympe.dc.CloudObject.prototype.follow=olympe.dc.CloudObject.prototype.cb;olympe.dc.CloudObject.prototype.getProperty=olympe.dc.CloudObject.prototype.Ja;olympe.dc.CloudObject.prototype.get=olympe.dc.CloudObject.prototype.get;olympe.dc.CloudObject.prototype.observeProperty=olympe.dc.CloudObject.prototype.nx;olympe.dc.CloudObject.prototype.observeProperties=olympe.dc.CloudObject.prototype.mx;
|
|
912
|
+
olympe.dc.CloudObject.prototype.observe=olympe.dc.CloudObject.prototype.observe;olympe.dc.CloudObject.prototype.getModelTag=olympe.dc.CloudObject.prototype.bc;olympe.dc.CloudObject.prototype.getSource=olympe.dc.CloudObject.prototype.xb;olympe.dc.CloudObject.prototype.isPersisted=olympe.dc.CloudObject.prototype.Uf;olympe.dc.CloudObject.prototype.query=olympe.dc.CloudObject.prototype.query;olympe.dc.CloudObject.prototype.getModel=olympe.dc.CloudObject.prototype.Ec;
|
|
913
|
+
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.gw;olympe.dc.CloudObject.getInstance=olympe.dc.CloudObject.Hd;olympe.dc.CloudObject.getRelations=olympe.dc.CloudObject.sd;olympe.dc.CloudObject.getProperties=olympe.dc.CloudObject.Cb;olympe.dc.CloudObject.instancesOf=olympe.dc.CloudObject.kk;olympe.dc.CloudObject.asInstance=olympe.dc.CloudObject.jv;
|
|
914
|
+
olympe.dc.CloudObject.createWith=olympe.dc.CloudObject.rv;olympe.dc.CloudObject.exists=olympe.dc.CloudObject.exists;olympe.dc.CloudObject.get=olympe.dc.CloudObject.get;olympe.dc.CloudObject.P=olympe.dc.na.C('ff021000000000000001',olympe.dc.CloudObject);olympe.dc.CloudObject.UC=olympe.dc.CloudObject.P.la(olympe.dc.Zo.VERSION);olympe.dc.CloudObject.nameProp=olympe.dc.CloudObject.P.la('ff023000000000000011');x('olympe.dc.CloudObject.nameProp',olympe.dc.CloudObject.nameProp);
|
|
915
|
+
olympe.dc.CloudObject.HC=olympe.dc.CloudObject.P.la('ff023000000000000012');olympe.dc.CloudObject.Li=olympe.dc.CloudObject.P.sa('ff02200000000000000a');olympe.dc.CloudObject.cr=olympe.dc.CloudObject.P.sa('ff02200000000000000b',olympe.dc.ua.ORIGIN);olympe.dc.CloudObject.oC=olympe.dc.CloudObject.P.sa('017e9c4ba4c847d71cbf');olympe.dc.CloudObject.fC=olympe.dc.CloudObject.P.sa('017ea013caf8e89cedb2');olympe.dc.CloudObject.propertyRel=olympe.dc.CloudObject.P.sa('ff02200000000000000c');
|
|
916
|
+
x('olympe.dc.CloudObject.propertyRel',olympe.dc.CloudObject.propertyRel);olympe.dc.CloudObject.typeRel=olympe.dc.CloudObject.P.sa('ff02200000000000000d',olympe.dc.ua.ORIGIN);olympe.dc.CloudObject.modelRel=olympe.dc.CloudObject.P.sa(olympe.dc.pc.Zc);x('olympe.dc.CloudObject.modelRel',olympe.dc.CloudObject.modelRel);olympe.dc.CloudObject.instancesRel=U(olympe.dc.CloudObject.P,olympe.dc.CloudObject.modelRel);x('olympe.dc.CloudObject.instancesRel',olympe.dc.CloudObject.instancesRel);
|
|
917
|
+
olympe.dc.CloudObject.extendRel=olympe.dc.CloudObject.P.sa(olympe.dc.pc.Oh);x('olympe.dc.CloudObject.extendRel',olympe.dc.CloudObject.extendRel);olympe.dc.CloudObject.extendedByRel=U(olympe.dc.CloudObject.P,olympe.dc.CloudObject.extendRel);x('olympe.dc.CloudObject.extendedByRel',olympe.dc.CloudObject.extendedByRel);olympe.dc.CloudObject.containsRel=olympe.dc.CloudObject.P.sa(olympe.dc.pc.$i);x('olympe.dc.CloudObject.containsRel',olympe.dc.CloudObject.containsRel);
|
|
918
|
+
olympe.dc.CloudObject.nv=U(olympe.dc.CloudObject.P,olympe.dc.CloudObject.containsRel);olympe.dc.CloudObject.uv=olympe.dc.CloudObject.P.sa('018282d3ac0a474a0bf4');x('olympe.dc.CloudObject.deleteAlsoRel',olympe.dc.CloudObject.uv);olympe.dc.OA=olympe.dc.CloudObject;olympe.dc.CloudObject.xa=[olympe.dc.Fe];m=olympe.dc.CloudObject.prototype;m.X.L=new olympe.D.J(()=>String,[]);m.name.L=new olympe.D.J(()=>String,[]);m.ia.L=olympe.D.J.F;m.Ec.L=new olympe.D.J(()=>olympe.dc.CloudObject,[]);
|
|
919
|
+
m.xb.L=new olympe.D.J(()=>String,[]);m.hw.L=new olympe.D.J(()=>String,[]);m.ir.L=olympe.D.J.F;m.bc.L=new olympe.D.J(()=>String,[]);m.Rv.L=new olympe.D.J(()=>olympe.dc.CloudObject,[]);m.ym.L=new olympe.D.J(()=>olympe.dc.ya,[]);m.wf.L=new olympe.D.J(()=>olympe.D.Node,[]);m.vb.L=olympe.D.J.F;m.Sc.L=olympe.D.J.G;m.xh.L=olympe.D.J.O;m.Fi.L=new olympe.D.J(()=>olympe.D.gb,[]);m.nr.L=new olympe.D.J(()=>olympe.D.Color,[]);m.qr.L=new olympe.D.J(()=>olympe.dc.CloudObject,[]);
|
|
920
|
+
m.ab.L=new olympe.D.J(()=>olympe.dc.ya,[]);m.oc.L=new olympe.D.J(()=>olympe.dc.CloudObject,[]);m.fr.L=new olympe.D.J(()=>Function,[]);m.Px.L=new olympe.D.J(()=>olympe.dc.ya,[]);m.transform.L=new olympe.D.J(()=>olympe.dc.ya,[]);m.Hc.L=olympe.D.J.F;m.toString.L=olympe.D.J.C;m.Ka.L=olympe.D.J.C;m.ud.L=olympe.D.J.O;m.vv.L=new olympe.D.J(()=>{},[]);olympe.dc.R={$e:'dc.DBView',Vo:'dc.InstanceManager',Ca:'dc.Logger',Gu:'dc.TransactionLogger',gj:'dc.FileServiceManager',pg:'dc.Router'};olympe.dc.U={rg:'dc.tag',Df:'dc.debug',ih:'dc.subscribeAll',Tk:'dc.defaultSource',ro:'dc.fileCache',Yn:'dc.dataConsumerOnly',oo:'dc.errorOnAbstractInstantiation'};
|
|
921
|
+
olympe.W.config(function(a){const b='object'===typeof window;F(a,olympe.dc.U.Df,!1);F(a,olympe.dc.U.ih,!1);F(a,olympe.dc.U.Tk,olympe.dc.Pa.SERVER);F(a,olympe.dc.U.Yn,b);F(a,olympe.dc.U.ro,b);F(a,olympe.dc.U.oo,!0);F(a,olympe.dc.U.rg,olympe.Y.Fc());E(a,olympe.dc.R.Ca,[olympe.ma.R.Ha],c=>c.Mc('dc'));xa(a,olympe.dc.R.Gu,olympe.dc.transaction.R.Ca);xa(a,olympe.dc.R.$e,olympe.dc.db.R.Qk);D(a,olympe.dc.R.gj,olympe.dc.Bs,olympe.dc.R.Ca,olympe.dc.R.$e,olympe.net.R.Ha,olympe.dc.R.pg,olympe.Y.R.$f,new olympe.W.ka(olympe.dc.U.ro));
|
|
922
|
+
D(a,olympe.dc.R.pg,olympe.dc.ku,olympe.dc.R.Ca,olympe.dc.sources.R.Wp,olympe.dc.sources.R.mq,olympe.dc.R.$e,olympe.host.R.He,new olympe.W.ka(olympe.dc.U.rg),new olympe.W.ka(olympe.dc.U.Yn));D(a,olympe.dc.R.Vo,olympe.dc.Ts,olympe.dc.db.R.al,olympe.dc.db.R.Ha,olympe.W.R.ag)},'olympe.dc');
|
|
923
|
+
olympe.W.run([olympe.dc.db.R.Ha,olympe.dc.transaction.R.Ha,olympe.dc.R.Vo,olympe.dc.R.gj,new olympe.W.ka(olympe.dc.U.rg)],(a,b,c,d,e)=>{olympe.dc.zm=()=>a;olympe.dc.yh=()=>b;olympe.dc.kr=()=>c;olympe.dc.CC=()=>d;olympe.dc.Pa.SELF=e},'DC singleton getter initialization');olympe.dm={};olympe.dm.yk={NONE:0,By:1,ps:2,Cy:4,yy:8,Ay:16,zy:31,Wz:32,Tz:64,Xz:128,Uz:256,Pt:512,Vz:992,pz:1023};olympe.dm.Ed=class extends olympe.dc.CloudObject{ia(){return this.vb(olympe.dc.CloudObject.nameProp)}C(){return olympe.D.Na.EMPTY}F(){return olympe.D.ea.C}};olympe.dm.Ed.P=olympe.dc.na.C('ff021000000000000002',olympe.dm.Ed);olympe.dm.Ed.O=olympe.dm.Ed.P.la('ff023000000000000035');olympe.dm.Ed.C=olympe.dm.Ed.P.sa('ff022000000000000005');olympe.dm.Ed.G=R('ff011000000000000001','AUTHENTICATED_USERS');olympe.dm.Ed.K=R('ff011000000000000002','PROJECT_RUNNER_USERS_ROLE');
|
|
924
|
+
olympe.dm.Ed.F=R('014831d95f83635090ea','ADMIN_USERS_ROLE');olympe.dm.Ed.prototype.ia.L=olympe.D.J.F;olympe.dm.Ed.prototype.C.L=olympe.D.J.F;olympe.dm.Ed.prototype.F.L=olympe.D.J.O;olympe.dm.User=class extends olympe.dc.CloudObject{dw(){return this.Cm()}ia(){return this.Cm()}Cm(){return this.vb(olympe.dm.User.loginProp)}ft(){return this.vb(olympe.dm.User.F)}et(){return olympe.D.Na.EMPTY}Aw(){return this.vb(olympe.dm.User.saltProp)}Jw(){return this.vb(olympe.dm.User.verifierProp)}yw(){return this.ab(olympe.dm.User.G,olympe.dm.Ed)}};olympe.dm.User.P=olympe.dc.na.C('ff021000000000000003',olympe.dm.User);olympe.dm.User.loginProp=olympe.dm.User.P.la('ff023000000000000001');
|
|
925
|
+
x('olympe.dm.User.loginProp',olympe.dm.User.loginProp);olympe.dm.User.F=olympe.dm.User.P.la('ff023000000000000002');olympe.dm.User.T=olympe.dm.User.P.la('ff023000000000000003');olympe.dm.User.saltProp=olympe.dm.User.P.la('ff023000000000000004');x('olympe.dm.User.saltProp',olympe.dm.User.saltProp);olympe.dm.User.verifierProp=olympe.dm.User.P.la('ff023000000000000005');x('olympe.dm.User.verifierProp',olympe.dm.User.verifierProp);olympe.dm.User.O=olympe.dm.User.P.la('ff023000000000000020');
|
|
926
|
+
olympe.dm.User.SAMLnameIdProp=olympe.dm.User.P.la('ff023000000000000036');x('olympe.dm.User.SAMLnameIdProp',olympe.dm.User.SAMLnameIdProp);olympe.dm.User.G=U(olympe.dm.User.P,olympe.dm.Ed.C);olympe.dm.User.Z=olympe.dm.User.P.sa('ff022000000000000002');olympe.dm.User.C=R('014831d95fd7d12b8568','ADMIN_USER');olympe.dm.User.K=R('0163d9653067b6237f62','GUEST_USER');m=olympe.dm.User.prototype;m.dw.L=olympe.D.J.F;m.ia.L=olympe.D.J.F;m.Cm.L=olympe.D.J.F;m.ft.L=olympe.D.J.F;m.et.L=olympe.D.J.F;m.Aw.L=olympe.D.J.F;
|
|
927
|
+
m.Jw.L=olympe.D.J.F;m.yw.L=new olympe.D.J(()=>olympe.dc.ya,[]);olympe.dm.Gf=class extends olympe.dc.CloudObject{Z(){return this.ym()}bb(){return this.vb(olympe.dm.Gf.Ta)}};olympe.dm.Gf.P=olympe.dc.na.C('01621fb84e3300000000',olympe.dm.Gf);olympe.dm.Gf.Ta=olympe.dm.Gf.P.la('01609de3f292e3c2c6ff');olympe.dm.Gf.prototype.Z.L=new olympe.D.J(()=>olympe.D.dd,[]);olympe.dm.Gf.prototype.bb.L=olympe.D.J.F;olympe.dm.BrickMetadata=class extends olympe.dm.Gf{Kw(){return this.vb(olympe.dm.BrickMetadata.Ab)}yc(){return this.vb(olympe.dm.BrickMetadata.oa)}ke(){return null}Ov(){return this.ab(olympe.sc.Kb.Comment.C.Vb(),olympe.sc.Kb.Comment)}fk(){return this.ak(olympe.dm.BrickMetadata.fa).hd().fk()}};olympe.dm.BrickMetadata.P=ff(olympe.dc.na.C('01621fb84e3500000000',olympe.dm.BrickMetadata));olympe.dm.BrickMetadata.Ab=olympe.dm.BrickMetadata.P.la('01621fb84e320000f001');olympe.dm.BrickMetadata.oa=olympe.dm.BrickMetadata.P.la('01703376c4a81c0e9d94');
|
|
928
|
+
olympe.dm.BrickMetadata.fa=olympe.dm.BrickMetadata.P.sa('0161ae97622bb21f335b');olympe.dm.BrickMetadata.Oc={eA:'private',fA:'public'};olympe.dm.BrickMetadata.Nb=R('01703376c4a81c0e9d95','BRICK_STATUS');olympe.dm.BrickMetadata.Zb={Jy:'experimental',tA:'stable',wy:'deprecated'};m=olympe.dm.BrickMetadata.prototype;m.Kw.L=olympe.D.J.F;m.yc.L=olympe.D.J.F;m.ke.L=new olympe.D.J(()=>String,[]);m.Ov.L=new olympe.D.J(()=>olympe.dc.ya,[]);m.fk.L=olympe.D.J.T;function xi(a,b){const c=a.query().cb(olympe.dm.md.C.Vb()).cb(olympe.dm.md.F);a=a.query().cb(olympe.dm.rb.G.Vb()).Qf(olympe.dm.rb.K,!0).cb(olympe.sc.Xc.C.Vb());const d=e=>e.be().Qf(olympe.dc.CloudObject.extendRel,!0).cb(olympe.dc.CloudObject.Li,!0).cb(olympe.dm.Relation.destinationModelRel).back(2).cb(olympe.dc.CloudObject.propertyRel,!0).cb(olympe.dm.Property.typeRel).observe(b);return rxjs.combineLatest([d(c),d(a)]).pipe(rxjs.operators.map(([e,...f])=>e.concat(...f)))}
|
|
929
|
+
function Ui(a,b){return a.observe(b,olympe.dm.DataSource.Yq).pipe(rxjs.operators.map(()=>a.xe(olympe.dc.sources.U.Ce)),rxjs.operators.distinctUntilChanged())}
|
|
930
|
+
olympe.dm.DataSource=class extends olympe.dc.CloudObject{constructor(a,b,c){super(a,b);this.Xb=c;this.$q=new Map([[olympe.dc.sources.U.El,olympe.dm.DataSource.yx],[olympe.dc.sources.U.Ce,olympe.dm.DataSource.Yq],[olympe.dc.sources.U.Ll,olympe.dm.DataSource.Cx]])}V(){return this.tag===olympe.dm.DataSource.SERVER?olympe.dc.Pa.SERVER:this.tag}xe(a){a=a.startsWith('data.')?a.split('.')[1]:a;const b=`${'data.'}${a}`;let c,d,e;return null!=(e=null!=(d=null!=(c=olympe.W.getParameter(`${'data.'}${this.name().toLowerCase().replace(/\W/g,
|
|
931
|
+
'_')}.${a}`))?c:olympe.W.getParameter(`${'data.'}${this.X()}.${a}`))?d:olympe.W.getParameter(b))?e:this.$q.has(b)?this.get(this.$q.get(b)):null}yc(){const a=this;return v(function*(){const b=olympe.dm.DataSource.Mb.ss,c=olympe.dm.DataSource.Mb.Eb,d=new olympe.dc.Request(olympe.dc.Request.C.Mb,a.V());return a.Xb.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.ma.eb('dc').warn(`Source ${a.name()} (${a.V()}) has encountered issues: ${e}`);return g}).catch(e=>
|
|
932
|
+
{const f=olympe.N.errors.wp;return e instanceof olympe.N.errors.Sj||e instanceof f?b:c})})}init(){const a=this;return v(function*(){if(a.constructor===olympe.dm.DataSource)throw Error(`Data source ${a.name()} (${a.tag}) has no implementation (is the file missing ?)`);})}destroy(){return v(function*(){})}healthCheck(){return v(function*(){})}executeQuery(a){return v(function*(){return olympe.dc.query.ld.yi(a)})}applyTransaction(){return v(function*(){})}uploadFileContent(){return v(function*(){throw Error('Should not try to upload files with SELF source');
|
|
932
933
|
})}downloadFileContent(){return v(function*(){throw Error('Should not try to download files with SELF source');})}deleteFileContent(){return v(function*(){})}};olympe.dm.DataSource.prototype.deleteFileContent=olympe.dm.DataSource.prototype.deleteFileContent;olympe.dm.DataSource.prototype.downloadFileContent=olympe.dm.DataSource.prototype.downloadFileContent;olympe.dm.DataSource.prototype.uploadFileContent=olympe.dm.DataSource.prototype.uploadFileContent;
|
|
933
|
-
olympe.dm.DataSource.prototype.applyTransaction=olympe.dm.DataSource.prototype.applyTransaction;olympe.dm.DataSource.prototype.executeQuery=olympe.dm.DataSource.prototype.executeQuery;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.
|
|
934
|
-
olympe.dm.DataSource.prototype.getId=olympe.dm.DataSource.prototype.V;olympe.dm.DataSource.P=olympe.dc.
|
|
935
|
-
olympe.dm.DataSource.
|
|
936
|
-
olympe.dm.Hb.C=olympe.dm.Hb.P.sa('016a697ef00ce7554692');U(olympe.dc.CloudObject.P,olympe.dm.Hb.C);olympe.dm.Hb.prototype.K.L=new olympe.D.J(()=>olympe.dc.ya,[]);olympe.dm.Hb.prototype.C.L=new olympe.D.J(()=>olympe.dc.ya,[]);olympe.dm.Hb.prototype.O.L=new olympe.D.J(()=>olympe.dc.ya,[]);olympe.dm.
|
|
937
|
-
olympe.dm.
|
|
938
|
-
olympe.dm.Module.T=olympe.dm.Module.P.
|
|
939
|
-
olympe.dm.Module.ba=R('016a69b9bceabd815b77','OLYMPE_SERVER_MODULE');m=olympe.dm.Module.prototype;m.
|
|
940
|
-
b);this.F=c;this.G=d;this.C=e}
|
|
941
|
-
f=this.db.Ja(this,olympe.dm.File.urlProp),g=h=>{const k=this.db.Ja(this,olympe.dm.File.mimeTypeProp);h.arrayBuffer().then(l=>{c(`data:${k};base64,${this.C.C(l)}`)}).catch(d)};e&&e.valueOf()?this.F.F(this,g.bind(this),d):f&&f.startsWith('blob:')?this.C.F(f,g.bind(this),d):'string'===typeof f?a(f):b(`No content nor URL associated to the file ${this.X()}`)}rename(a,b){const c=b&&olympe.D.Xa().G(b);olympe.D.
|
|
942
|
-
olympe.dm.File.fileNameProp,d);e.
|
|
943
|
-
olympe.dm.File.prototype.getContentAsString=olympe.dm.File.prototype.
|
|
944
|
-
olympe.dm.File.creationDateProp=olympe.dm.File.P.
|
|
945
|
-
x('olympe.dm.File.urlProp',olympe.dm.File.urlProp);olympe.dm.File.C=olympe.dm.File.P.
|
|
946
|
-
m.
|
|
947
|
-
olympe.dm.Ad.prototype.F.L=new olympe.D.J(()=>olympe.dc.ya,[]);olympe.dm.
|
|
948
|
-
olympe.dm.
|
|
949
|
-
olympe.dm.
|
|
950
|
-
x('olympe.dm.Property.definingModelRel',olympe.dm.Property.definingModelRel);olympe.dm.Property.typeRel=U(olympe.dm.Property.P,olympe.dc.CloudObject.typeRel);x('olympe.dm.Property.typeRel',olympe.dm.Property.typeRel);olympe.dm.Property.prototype.C.L=new olympe.D.J(()=>olympe.dc.CloudObject,[]);olympe.dm.Property.prototype.getType.L=new olympe.D.J(()=>olympe.dc.CloudObject,[]);olympe.dm.Property.prototype.F.L=olympe.D.J.C;olympe.dm.Relation=class extends olympe.dc.CloudObject{constructor(a,b){super(a,b)}
|
|
951
|
-
olympe.dm.Relation.G=olympe.dm.Relation.P.
|
|
952
|
-
olympe.dm.Relation.originModelRel=U(olympe.dm.Relation.P,olympe.dc.CloudObject.
|
|
953
|
-
m=olympe.dm.Relation.prototype;m.
|
|
954
|
-
olympe.dm.Enum.P=olympe.dc.
|
|
955
|
-
olympe.W.config(a=>{F(a,olympe.sc.U.
|
|
956
|
-
'olympe.sc');olympe.W.run([olympe.sc.R.
|
|
957
|
-
olympe.sc.
|
|
958
|
-
}g.push(d);h.push(a.
|
|
959
|
-
olympe.sc.
|
|
960
|
-
olympe.sc.wa=class{constructor(a=olympe.sc.
|
|
961
|
-
b){this.C.set(a,b);return this}
|
|
962
|
-
d.next.bind(d),c?void 0:this.C.V(),!1);this.onDestroy(()=>{f();d.complete()});return f})}repeat(a,b){const c=Kl(this.C,a);a=b.subscribe(d=>{null!==d?this.set(c,d):this.remove(c)});this.Lg(a.unsubscribe.bind(a));return this}
|
|
963
|
-
`on the context ${this.V()}:\nStack: ${this.
|
|
964
|
-
Ll(b,0,this.
|
|
965
|
-
Ol(this.C,a);return null!==a?new olympe.sc.ui.
|
|
966
|
-
f?(e=a.model(f),`${a.name(f)||e&&a.name(e)||f} (${e})`):e.V()}).join('\n> ')}catch(c){b=`No stack available for context ${this.V()}: ${c}`,this.H.warn(b)}return b}};olympe.sc.wa.prototype.observeMany=olympe.sc.wa.prototype.
|
|
967
|
-
olympe.sc.wa.prototype.onDestroy=olympe.sc.wa.prototype.onDestroy;olympe.sc.wa.prototype.offClear=olympe.sc.wa.prototype.
|
|
968
|
-
olympe.sc.wa.prototype['throw']=olympe.sc.wa.prototype.throw;olympe.sc.wa.prototype.waitFor=olympe.sc.wa.prototype.
|
|
969
|
-
olympe.sc.wa.prototype.set=olympe.sc.wa.prototype.set;olympe.sc.wa.prototype.getClosest=olympe.sc.wa.prototype.
|
|
970
|
-
function Ml(a,b){if(null===a.K)a.H.error(`An error occurred in a brick: ${b.message}\nError found in:\n${b.
|
|
971
|
-
function Nl(a,b){if(b===a.id||a.T.has(b)||!b)return a;for(a=a.K;a;){if(b===a.V()||a.T.has(b))return a;const c=Sl(a.F,b);if(c)return c;a=a.getParent()}return null}function Tl(a,b,c=0){null===a.
|
|
972
|
-
function Vl(a,b){if(null===a.
|
|
934
|
+
olympe.dm.DataSource.prototype.applyTransaction=olympe.dm.DataSource.prototype.applyTransaction;olympe.dm.DataSource.prototype.executeQuery=olympe.dm.DataSource.prototype.executeQuery;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.xe;
|
|
935
|
+
olympe.dm.DataSource.prototype.getId=olympe.dm.DataSource.prototype.V;olympe.dm.DataSource.P=olympe.dc.na.C('ff021000000000000060',olympe.dm.DataSource,olympe.dc.R.pg);olympe.dm.DataSource.nh=olympe.dm.DataSource.P.la('ff023000000000000060');x('olympe.dm.DataSource.activatedProp',olympe.dm.DataSource.nh);olympe.dm.DataSource.lC=olympe.dm.DataSource.P.la('ff023000000000000061');olympe.dm.DataSource.yx=olympe.dm.DataSource.P.la('ff023000000000000062');olympe.dm.DataSource.Yq=olympe.dm.DataSource.P.la('ff023000000000000063');
|
|
936
|
+
olympe.dm.DataSource.dr=olympe.dm.DataSource.P.la('ff023000000000000064');olympe.dm.DataSource.Cx=olympe.dm.DataSource.P.la('ff023000000000000065');olympe.dm.DataSource.Mi=olympe.dm.DataSource.P.sa('ff022000000000000060');olympe.dm.DataSource.SERVER=R('00000000000000000060','Server source');olympe.dm.DataSource.Ce={uz:'hybrid',wn:'bus',Ko:'http'};olympe.dm.DataSource.Mb={eh:'ready',Eb:'error',ss:'down',Zd:'offline'};olympe.dm.md=class extends olympe.dc.CloudObject{};olympe.dm.md.P=olympe.dc.na.C('ff021000000000000070',olympe.dm.md);olympe.dm.md.C=olympe.dm.md.P.sa('ff023000000000000071');olympe.dm.md.F=olympe.dm.md.P.sa('ff023000000000000072');olympe.dm.md.G=olympe.dm.md.P.sa('ff023000000000000073');olympe.dm.Hb=class extends olympe.dm.BrickMetadata{K(){return new olympe.dc.ya(this.X(),[new olympe.dc.da.te(olympe.dm.Hb.F.X(),olympe.dc.ua.DESTINATION,olympe.dc.da.cq.Ms,olympe.dc.da.cq.Ns),olympe.dm.Hb.C])}ke(){return olympe.sc.td.ue.bs}C(){return this.ab(olympe.dm.Hb.F,olympe.dm.Hb)}O(){return this.ab(olympe.dm.Hb.C)}};olympe.dm.Hb.P=olympe.dc.na.C('01612df1db9749227626',olympe.dm.Hb);olympe.dm.Hb.F=olympe.dm.Hb.P.sa('016a697ef00ce7554691');olympe.dm.Hb.za=U(olympe.dm.Hb.P,olympe.dm.Hb.F);
|
|
937
|
+
olympe.dm.Hb.C=olympe.dm.Hb.P.sa('016a697ef00ce7554692');U(olympe.dc.CloudObject.P,olympe.dm.Hb.C);olympe.dm.Hb.prototype.K.L=new olympe.D.J(()=>olympe.dc.ya,[]);olympe.dm.Hb.prototype.C.L=new olympe.D.J(()=>olympe.dc.ya,[]);olympe.dm.Hb.prototype.O.L=new olympe.D.J(()=>olympe.dc.ya,[]);olympe.dm.Cc=class extends olympe.dm.Hb{C(){return this.X()===olympe.dm.Cc.ba?this.ab(olympe.dm.Cc.O,olympe.dm.Hb):this.ab(olympe.dm.Cc.T,olympe.dm.Hb)}};olympe.dm.Cc.P=olympe.dc.na.C('ff021000000000000020',olympe.dm.Cc);olympe.dm.Cc.T=olympe.dm.Cc.P.sa('017e9c34cf48bd6965c1');olympe.dm.Cc.O=olympe.dm.Cc.P.sa('017e9c2e013e06bfffd9');olympe.dm.Cc.Ne=olympe.dm.Cc.P.sa('01811f12ad77673770d4');olympe.dm.Cc.ba=R('10000000000000000000','ROOT_OF_ROOTS');olympe.dm.Cc.ac=R('10000000000000000001','OLYMPE_FOLDER');
|
|
938
|
+
olympe.dm.Cc.Tb=R('10000000000000000002','INTERNAL_FOLDER');olympe.dm.Cc.prototype.C.L=new olympe.D.J(()=>olympe.dc.ya,[]);olympe.dm.Module=class extends olympe.dc.CloudObject{cw(){return this.vb(olympe.dm.Module.O)}pw(){return this.Sc(olympe.dm.Module.T)}gt(){return this.vb(olympe.dm.Module.F)}tw(){return this.vb(olympe.dm.Module.Z)}Pv(){return this.vb(olympe.dm.Module.G)}qw(){return this.ab(olympe.dm.Module.K,olympe.dm.Module)}Bw(){return this.ab(olympe.dm.Module.C,olympe.dm.Ad)}};olympe.dm.Module.P=olympe.dc.na.C('ff021000000000000040',olympe.dm.Module);olympe.dm.Module.O=olympe.dm.Module.P.la('ff023000000000000042');
|
|
939
|
+
olympe.dm.Module.T=olympe.dm.Module.P.la('ff023000000000000043');olympe.dm.Module.F=olympe.dm.Module.P.la('ff023000000000000044');olympe.dm.Module.Z=olympe.dm.Module.P.la('ff023000000000000045');olympe.dm.Module.G=olympe.dm.Module.P.la('ff023000000000000046');olympe.dm.Module.creationDateProp=olympe.dm.Module.P.la('ff023000000000000049');olympe.dm.Module.C=olympe.dm.Module.P.sa('ff022000000000000013');olympe.dm.Module.K=olympe.dm.Module.P.sa('ff022000000000000014');
|
|
940
|
+
olympe.dm.Module.ba=R('016a69b9bceabd815b77','OLYMPE_SERVER_MODULE');m=olympe.dm.Module.prototype;m.cw.L=olympe.D.J.F;m.pw.L=olympe.D.J.G;m.gt.L=olympe.D.J.F;m.tw.L=olympe.D.J.F;m.Pv.L=olympe.D.J.F;m.qw.L=new olympe.D.J(()=>olympe.dc.ya,[]);m.Bw.L=new olympe.D.J(()=>olympe.dc.ya,[]);olympe.dm.File=class extends olympe.dc.CloudObject{static F(a,b,c,d,e,f,g){e=e||'application/data';d=URL.createObjectURL(new Blob([d],{type:e}));g=null!=g?g:olympe.dc.Rd().fromModel(a);a=b.create(a,f).Qi(g);b=olympe.D.gb.now();Z(Z(Z(Z(Z(Z(a,olympe.dm.File.fileNameProp,null!=c?c:'file'),olympe.dm.File.urlProp,d),olympe.dm.File.creationDateProp,b),olympe.dm.File.modificationDateProp,b),olympe.dm.File.mimeTypeProp,e||'application/data'),olympe.dm.File.C,!1);return a.X()}constructor(a,b,c,d,e){super(a,
|
|
941
|
+
b);this.F=c;this.G=d;this.C=e}Dm(){return this.vb(olympe.dm.File.mimeTypeProp)}ck(a,b){const c=olympe.D.Xa().G(a),d=olympe.D.Xa().G(e=>null==b?void 0:b(`${e}`));(a=this.db.Ja(this,olympe.dm.File.urlProp,!0))&&a.startsWith('blob:')?this.C.F(a,e=>{e.arrayBuffer().then(c).catch(d)},d):this.F.F(this,e=>{e.arrayBuffer().then(c).catch(d)},e=>{null==d||d(e)})}xm(a,b){this.ck(c=>{a(Ha(c))},b)}dk(a,b){const c=olympe.D.Xa().G(a),d=olympe.D.Xa().G(h=>null==b?void 0:b(`${h}`)),e=this.db.Ja(this,olympe.dm.File.C),
|
|
942
|
+
f=this.db.Ja(this,olympe.dm.File.urlProp),g=h=>{const k=this.db.Ja(this,olympe.dm.File.mimeTypeProp);h.arrayBuffer().then(l=>{c(`data:${k};base64,${this.C.C(l)}`)}).catch(d)};e&&e.valueOf()?this.F.F(this,g.bind(this),d):f&&f.startsWith('blob:')?this.C.F(f,g.bind(this),d):'string'===typeof f?a(f):b(`No content nor URL associated to the file ${this.X()}`)}rename(a,b){const c=b&&olympe.D.Xa().G(b);olympe.D.Sm([a],d=>{const e=new olympe.dc.Wa;e.update(this,olympe.dc.CloudObject.nameProp,d);e.update(this,
|
|
943
|
+
olympe.dm.File.fileNameProp,d);e.kb(f=>{c&&c(f)})})}Fx(){this.G.O(this.get(olympe.dm.File.mimeTypeProp))}ml(){return this.vb(olympe.dm.File.urlProp)}$o(){return this.vb(olympe.dm.File.fileNameProp)}Tv(){return this.Fi(olympe.dm.File.creationDateProp)}ow(){return this.Fi(olympe.dm.File.modificationDateProp)}sr(){return this.xh(olympe.dm.File.C)}};olympe.dm.File.prototype.saveAs=olympe.dm.File.prototype.Fx;olympe.dm.File.prototype.getContentUrl=olympe.dm.File.prototype.dk;
|
|
944
|
+
olympe.dm.File.prototype.getContentAsString=olympe.dm.File.prototype.xm;olympe.dm.File.prototype.getContentAsBinary=olympe.dm.File.prototype.ck;olympe.dm.File.P=olympe.dc.na.C('ff021000000000000030',olympe.dm.File,olympe.dc.R.gj,olympe.net.R.Ha,olympe.Y.R.$f);olympe.dm.File.nameProp=olympe.dm.File.P.la('ff023000000000000050');x('olympe.dm.File.nameProp',olympe.dm.File.nameProp);olympe.dm.File.fileNameProp=olympe.dm.File.P.la('ff023000000000000050');x('olympe.dm.File.fileNameProp',olympe.dm.File.fileNameProp);
|
|
945
|
+
olympe.dm.File.creationDateProp=olympe.dm.File.P.la('ff023000000000000051');x('olympe.dm.File.creationDateProp',olympe.dm.File.creationDateProp);olympe.dm.File.modificationDateProp=olympe.dm.File.P.la('ff023000000000000055');x('olympe.dm.File.modificationDateProp',olympe.dm.File.modificationDateProp);olympe.dm.File.mimeTypeProp=olympe.dm.File.P.la('ff023000000000000052');x('olympe.dm.File.mimeTypeProp',olympe.dm.File.mimeTypeProp);olympe.dm.File.urlProp=olympe.dm.File.P.la('ff023000000000000053');
|
|
946
|
+
x('olympe.dm.File.urlProp',olympe.dm.File.urlProp);olympe.dm.File.C=olympe.dm.File.P.la('ff023000000000000054');olympe.dm.File.P.C=olympe.dm.File.F.bind(null,olympe.dm.File);olympe.dm.File.O='application/data';olympe.dm.File.xa=[olympe.D.File];m=olympe.dm.File.prototype;m.Dm.L=olympe.D.J.F;m.ck.L=new olympe.D.J(()=>{},[]);m.xm.L=new olympe.D.J(()=>{},[]);m.dk.L=new olympe.D.J(()=>{},[]);m.rename.L=olympe.D.J.C;m.ml.L=olympe.D.J.F;m.$o.L=olympe.D.J.F;m.Tv.L=new olympe.D.J(()=>olympe.D.gb,[]);
|
|
947
|
+
m.ow.L=new olympe.D.J(()=>olympe.D.gb,[]);m.sr.L=olympe.D.J.O;olympe.dm.Ad=class extends olympe.dc.CloudObject{C(){return this.vb(olympe.dm.Ad.F)}G(){return this.Sc(olympe.dm.Ad.G)}F(){return this.ab(olympe.dm.Ad.C,olympe.dm.Module)}};olympe.dm.Ad.P=olympe.dc.na.C('ff021000000000000041',olympe.dm.Ad);olympe.dm.Ad.F=olympe.dm.Ad.P.la('ff023000000000000047');olympe.dm.Ad.G=olympe.dm.Ad.P.la('ff023000000000000048');olympe.dm.Ad.C=olympe.dm.Module.C.Vb();olympe.dm.Ad.prototype.C.L=olympe.D.J.F;olympe.dm.Ad.prototype.G.L=olympe.D.J.G;
|
|
948
|
+
olympe.dm.Ad.prototype.F.L=new olympe.D.J(()=>olympe.dc.ya,[]);olympe.dm.rb=class extends olympe.dm.Cc{C(){return this.ab(olympe.dm.Hb.F,olympe.dm.Hb)}G(){return this.vb(olympe.dm.rb.Z)}T(){return this.vb(olympe.dm.rb.nb)}F(){return this.ab(olympe.dm.rb.K,olympe.dm.rb)}};olympe.dm.rb.P=olympe.dc.na.C('0163d9594700fcf61e54',olympe.dm.rb);olympe.dm.rb.Z=olympe.dm.rb.P.la('017869c7d2833c9492c1');olympe.dm.rb.nb=olympe.dm.rb.P.la('017869c80bb9929c76d0');olympe.dm.rb.bb=olympe.dm.rb.P.sa('ff02200000000000002a');olympe.dm.rb.K=olympe.dm.rb.P.sa('ff02200000000000002b');
|
|
949
|
+
olympe.dm.rb.Fd=U(olympe.dm.rb.P,olympe.dm.rb.K);olympe.dm.rb.G=olympe.dm.rb.P.sa('ff02200000000000002c');olympe.dm.rb.ed=olympe.dm.rb.P.sa('017e9c412e2b944bd590');olympe.dm.rb.rf=olympe.dm.rb.P.sa('017e9c416872a89d3415');olympe.dm.rb.qf=olympe.dm.rb.P.sa('017ebf8fe5c506662098');U(olympe.dc.CloudObject.P,olympe.dm.rb.bb);olympe.dm.rb.ec=R('100000000000000000dd','PRIMORDIAL');olympe.dm.rb.prototype.C.L=new olympe.D.J(()=>olympe.dc.ya,[]);olympe.dm.rb.prototype.G.L=olympe.D.J.F;
|
|
950
|
+
olympe.dm.rb.prototype.T.L=olympe.D.J.F;olympe.dm.rb.prototype.F.L=new olympe.D.J(()=>olympe.dc.ya,[]);olympe.dm.Property=class extends olympe.dc.CloudObject{C(){return this.oc(olympe.dm.Property.definingModelRel,olympe.dc.CloudObject)}getType(){return this.oc(olympe.dm.Property.typeRel,olympe.dc.CloudObject)}F(){return this.ak(olympe.dm.Property.typeRel).hd()}Hc(){return this.C().ia().Zq(this.ia())}};olympe.dm.Property.P=olympe.dc.na.C('ff021000000000000005',olympe.dm.Property);olympe.dm.Property.definingModelRel=U(olympe.dm.Property.P,olympe.dc.CloudObject.propertyRel);
|
|
951
|
+
x('olympe.dm.Property.definingModelRel',olympe.dm.Property.definingModelRel);olympe.dm.Property.typeRel=U(olympe.dm.Property.P,olympe.dc.CloudObject.typeRel);x('olympe.dm.Property.typeRel',olympe.dm.Property.typeRel);olympe.dm.Property.prototype.C.L=new olympe.D.J(()=>olympe.dc.CloudObject,[]);olympe.dm.Property.prototype.getType.L=new olympe.D.J(()=>olympe.dc.CloudObject,[]);olympe.dm.Property.prototype.F.L=olympe.D.J.C;olympe.dm.Relation=class extends olympe.dc.CloudObject{constructor(a,b){super(a,b)}kw(){return olympe.D.Na.EMPTY}Mv(){return this.Sc(olympe.dm.Relation.F)}uw(){return this.Sc(olympe.dm.Relation.G)}hr(){return this.ab(olympe.dm.Relation.destinationModelRel,olympe.dc.CloudObject).xc()}mr(){return this.ab(olympe.dm.Relation.originModelRel,olympe.dc.CloudObject).xc()}Hc(){return this.mr().ia().concat(['-',this.ia(),'->',this.hr().ia()])}};olympe.dm.Relation.P=olympe.dc.na.C('ff021000000000000006',olympe.dm.Relation);
|
|
952
|
+
olympe.dm.Relation.G=olympe.dm.Relation.P.la('ff023000000000000030');olympe.dm.Relation.F=olympe.dm.Relation.P.la('ff023000000000000034');olympe.dm.Relation.ba=olympe.dm.Relation.P.la(olympe.dc.cc.fo);olympe.dm.Relation.Z=olympe.dm.Relation.P.la(olympe.dc.cc.zc);olympe.dm.Relation.fa=olympe.dm.Relation.P.la(olympe.dc.cc.Kf);olympe.dm.Relation.oa=olympe.dm.Relation.P.la(olympe.dc.cc.su);olympe.dm.Relation.T=olympe.dm.Relation.P.la('ff023000000000000031');
|
|
953
|
+
olympe.dm.Relation.originModelRel=U(olympe.dm.Relation.P,olympe.dc.CloudObject.Li);x('olympe.dm.Relation.originModelRel',olympe.dm.Relation.originModelRel);olympe.dm.Relation.destinationModelRel=U(olympe.dm.Relation.P,olympe.dc.CloudObject.cr);x('olympe.dm.Relation.destinationModelRel',olympe.dm.Relation.destinationModelRel);olympe.dm.Relation.C={Ls:0,Sr:5,Tp:1,hu:4,Xl:2,Ml:8,Iy:10,lA:6,mA:9,Ee:6,nA:9};olympe.dm.Relation.K={Sz:3,Nt:4,Fz:5,Ez:6};olympe.dm.Relation.O=olympe.dm.yk.Pt+olympe.dm.yk.ps;
|
|
954
|
+
m=olympe.dm.Relation.prototype;m.kw.L=olympe.D.J.F;m.Mv.L=olympe.D.J.G;m.uw.L=olympe.D.J.G;m.hr.L=new olympe.D.J(()=>olympe.dc.CloudObject,[]);m.mr.L=new olympe.D.J(()=>olympe.dc.CloudObject,[]);olympe.dm.Ie=class extends olympe.dc.CloudObject{getValue(){}};olympe.dm.Ie.P=olympe.dc.na.C('ff021000000000000019',olympe.dm.Ie);olympe.dm.String=class extends olympe.dm.Ie{getValue(){return this.vb(olympe.dm.String.valueProp)}toString(){return this.get(olympe.dm.String.valueProp)}};olympe.dm.String.P=olympe.dc.na.C('ff021000000000000011',olympe.dm.String);olympe.dm.String.valueProp=olympe.dm.String.P.la('ff023000000000000026');x('olympe.dm.String.valueProp',olympe.dm.String.valueProp);olympe.dm.String.prototype.getValue.L=olympe.D.J.F;olympe.dm.String.prototype.toString.L=olympe.D.J.C;olympe.dm.Boolean=class extends olympe.dm.Ie{getValue(){return this.xh(olympe.dm.Boolean.valueProp)}};olympe.dm.Boolean.P=olympe.dc.na.C('ff021000000000000012',olympe.dm.Boolean);olympe.dm.Boolean.valueProp=olympe.dm.Boolean.P.la('ff023000000000000027');x('olympe.dm.Boolean.valueProp',olympe.dm.Boolean.valueProp);olympe.dm.Boolean.prototype.getValue.L=olympe.D.J.O;olympe.dm.Color=class extends olympe.dm.Ie{getValue(){return this.nr()}};olympe.dm.Color.P=olympe.dc.na.C('ff021000000000000017',olympe.dm.Color);olympe.dm.Color.valueProp=olympe.dm.Color.P.la('ff023000000000000032');x('olympe.dm.Color.valueProp',olympe.dm.Color.valueProp);olympe.dm.Color.prototype.getValue.L=new olympe.D.J(()=>olympe.D.Color,[]);olympe.dm.DateTime=class extends olympe.dm.Ie{getValue(){return this.Fi(olympe.dm.DateTime.valueProp)}};olympe.dm.DateTime.P=olympe.dc.na.C('ff021000000000000014',olympe.dm.DateTime);olympe.dm.DateTime.valueProp=olympe.dm.DateTime.P.la('ff023000000000000029');x('olympe.dm.DateTime.valueProp',olympe.dm.DateTime.valueProp);olympe.dm.DateTime.prototype.getValue.L=new olympe.D.J(()=>olympe.D.gb,[]);olympe.dm.Enum=class extends olympe.dm.String{ia(){return olympe.D.ta([super.ia(),super.getValue()],(a,b)=>''!==a.valueOf()?a:b,olympe.D.Na)}Qd(){return this.Sc(olympe.dm.Enum.rankProp)}static create(a,b,c,d,e){const f=olympe.dc.ja();e=void 0!==e?e:f.Fa(b)&&f.Id(b).length||0;c=(new Map).set(olympe.dm.String.valueProp,c).set(olympe.dc.CloudObject.nameProp,d||c).set(olympe.dm.Enum.rankProp,e);return a.create(b,c)}};olympe.dm.Enum.create=olympe.dm.Enum.create;
|
|
955
|
+
olympe.dm.Enum.P=olympe.dc.na.C('016cdd861b32d56c81f7',olympe.dm.Enum);olympe.dm.Enum.rankProp=olympe.dm.Enum.P.la('017a7690c915975ea995');olympe.dm.Enum.prototype.Qd.L=olympe.D.J.G;olympe.dm.Hf=class extends olympe.dm.BrickMetadata{Iw(){return this.cb(olympe.dc.CloudObject.instancesRel).tk(olympe.dm.Enum.rankProp,olympe.dc.query.zj.ASC).hd()}static create(a,b){b=a.create(olympe.dm.Hf,(new Map).set(olympe.dc.CloudObject.nameProp,b));a.Ea(olympe.dc.CloudObject.extendRel,b,olympe.dm.Enum);return b}};olympe.dm.Hf.create=olympe.dm.Hf.create;olympe.dm.Hf.prototype.getValues=olympe.dm.Hf.prototype.Iw;olympe.dm.Hf.P=olympe.dc.na.C('017a768f966fc08ebb98',olympe.dm.Hf);olympe.dm.Number=class extends olympe.dm.Ie{getValue(){return this.Sc(olympe.dm.Number.valueProp)}};olympe.dm.Number.P=olympe.dc.na.C('ff021000000000000013',olympe.dm.Number);olympe.dm.Number.valueProp=olympe.dm.Number.P.la('ff023000000000000028');x('olympe.dm.Number.valueProp',olympe.dm.Number.valueProp);olympe.dm.Number.prototype.getValue.L=olympe.D.J.G;olympe.sc={};olympe.sc.R={Ca:'sc.Logger',Gj:'sc.RootContext',$d:'sc.Serializer'};olympe.sc.U={Be:'sc.app',Df:'sc.debug',gn:'sc.autostartProfiler',bo:'sc.debugger',qs:'sc.disableTheme',PRODUCTION:'sc.production',Ot:'sc.onstartTimeout',Vp:'sc.remoteActionTimeout'};
|
|
956
|
+
olympe.W.config(a=>{F(a,olympe.sc.U.Be,'');F(a,olympe.sc.U.Df,!1);F(a,olympe.sc.U.qs,!0);F(a,olympe.sc.U.PRODUCTION,!1);F(a,olympe.sc.U.Ot,2E4);F(a,olympe.sc.U.Vp,3E4);F(a,olympe.sc.U.gn,!1);E(a,olympe.sc.R.Ca,[olympe.ma.R.Ha],b=>b.Mc('sc'));D(a,olympe.sc.R.$d,olympe.sc.tg,olympe.dc.R.$e);xa(a,olympe.dc.sources.R.$d,olympe.sc.R.$d);E(a,olympe.sc.R.Gj,[new olympe.W.ka(olympe.sc.U.PRODUCTION)],b=>{const c=new olympe.sc.bg('root','root',null);olympe.sc.Um=c;c.set(olympe.sc.wa.C.PRODUCTION,b);return new olympe.sc.wa(c)})},
|
|
957
|
+
'olympe.sc');olympe.W.run([olympe.sc.R.Gj,new olympe.W.ka(olympe.N.U.Kk)],(a,b)=>{olympe.fe().ctx=a;olympe.fe().oVersion=()=>b});olympe.sc.Lm=()=>null!==olympe.dc.ja().Ib(void 0,olympe.sc.Runnable.C.Vb());olympe.sc.jC=(a,b,c,d)=>{c=Z(Z(a.create(olympe.sc.Pc),olympe.sc.Pc.C,c||null),olympe.sc.Pc.G,d||null);a.Ea(olympe.sc.Pc.F,c,b);a.Ea(olympe.dc.CloudObject.containsRel,b,c);return c.X()};olympe.sc.Ag=a=>{a=olympe.dc.Jb.Ag(a);return a instanceof olympe.sc.re?a.C():a};olympe.sc.FC=a=>{a=Ie(a);return a instanceof olympe.sc.re?a.C():a};
|
|
958
|
+
olympe.sc.BC=function(a){const b=olympe.dm.Hb.C.Vb(),c=olympe.dc.CloudObject.containsRel.Vb();var d=olympe.dc.ga(a);if(void 0===d)return[];a=olympe.dc.ja();var e=a.model(d);const f=[],g=[];let h=[];if(a.Ig(e,olympe.dm.Hb))h.push(d);else{for(e=[];null===a.Ib(d,b);){e.push(d);const k=a.Ib(d,c);if(null===k)return olympe.ma.eb('sc').warn(`Object ${d} has no container`),[];a.tc(d,olympe.sc.logic.mb)||k===a.Ib(d,olympe.sc.Runnable.C.Vb())||f.push(d);d=k;if(e.includes(d))throw Error(`Instance ${d} (${a.name(d)}) is part of a cyclic contain pattern`);
|
|
959
|
+
}g.push(d);h.push(a.Ib(g[0],b))}h=h.concat(a.Eg(h[0],olympe.dm.Hb.za));h=h.concat(a.Eg(h[h.length-1],olympe.dm.Cc.T.Vb()));h=h.concat(a.Eg(h[h.length-1],olympe.dm.Cc.O.Vb()));return[...f,...g,...h].reverse()};olympe.sc.DC=a=>{a=a&&a.valueOf()||'';return a.startsWith('image/')?olympe.sc.fg:a.startsWith('video/')?olympe.sc.kh:a.startsWith('font/')||a.startsWith('application/font-woff')?olympe.sc.Ac:olympe.dm.File};
|
|
960
|
+
olympe.sc.zC=a=>a instanceof olympe.sc.fg?'image/*':a instanceof olympe.sc.kh?'video/*':a instanceof olympe.sc.Ac?'font/*,application/font-woff':null;olympe.sc.Za={};function Hl(a,b){var c=olympe.sc.wa,d=a.C;a=a.F();b=olympe.dc.ga(b);let e,f=null==(e=d.F)?void 0:e.get(b);if(!f){f=d.qh(a,void 0,b);for(d=f.getParent();d&&d.oa&&!d.id.startsWith('_');)d=d.getParent();let g;null==(g=d)||Il(g,b,f)}return new c(f)}function Jl(a){let b;return null!=(b=a.Qa(olympe.sc.wa.C.PRODUCTION))?b:!1}
|
|
961
|
+
olympe.sc.wa=class{constructor(a=olympe.sc.Um){this.C=a;this.H=olympe.ma.eb('sc');this.G=null}V(){return this.C.V()}getParent(){if(null===this.G){const a=this.C.getParent();this.G=null===a?null:new olympe.sc.wa(a)}return this.G}Nv(a){const b=olympe.dc.ja();let c=this.getParent();const d=e=>{if(e.ee()){const f=b.model(e.ee());if(f&&b.Ja(f,olympe.sc.Ua.ba)||a.modelTag&&!b.tc(e.ee(),a.modelTag))return!1}return!0};for(;c&&!d(c);)c=c.getParent();return c}ee(){return this.C.ee()}F(){return this.C.C}set(a,
|
|
962
|
+
b){this.C.set(a,b);return this}an(a){return this.set(a,Date.now())}remove(a){this.set(a,null)}ub(a,b,c=!1){const d=olympe.dc.ga(a),e=olympe.D.ic(b||Object,`Get context value flow source of ${d}`);e.getContext().onDestroy(this.on(a,f=>{null===f?e.clear():e.update(f)},c?this.C.V():void 0));return e.ub()}get(a,b=!1){a=this.Qa(a,b);return void 0!==a?a:null}has(a,b=!1){return this.C.has(a,b)}observe(a,b=!0,c=!1){return new rxjs.Observable(d=>{const e=this.get(a);b||null!==e||d.next(e);const f=this.on(a,
|
|
963
|
+
d.next.bind(d),c?void 0:this.C.V(),!1);this.onDestroy(()=>{f();d.complete()});return f})}repeat(a,b){const c=Kl(this.C,a);a=b.subscribe(d=>{null!==d?this.set(c,d):this.remove(c)});this.Lg(a.unsubscribe.bind(a));return this}Ex(a){a=a instanceof olympe.sc.Runnable?a:this.get(a);if(!a)return null;const b=this.qh(`Runner ${a.name()}`);a.run(b);return b}Fr(a,b=!0,c=!1){return new Promise((d,e)=>{this.observe(a,b,c).pipe(rxjs.operators.first()).subscribe(rxjs.Subscriber.create(d,f=>{let g=`An error occurred while calling \`waitFor(${olympe.dc.ga(a)})\``+
|
|
964
|
+
`on the context ${this.V()}:\nStack: ${this.he()}\n${f}`;f instanceof rxjs.EmptyError&&(g=`The context ${this.V()} has been destroyed while a Promise `+`created from a call to \`waitFor(${olympe.dc.ga(a)})\` `+`has never received any value:\nStack: ${this.he()}`);e(Error(g))}))})}throw(a){var b=a instanceof Error?a.message:String(a);if(a instanceof Error){var c;const d=(null==(c=a.he)?void 0:c.call(a))||this.he();let e,f;c=null!=(f=null==(e=a.gr)?void 0:e.call(a))?f:0;b=Ll(b,c,d);b.stack=a.stack}else b=
|
|
965
|
+
Ll(b,0,this.he());Ml(this.C,b);return this}Gx(a){this.set(olympe.sc.wa.C.ag,a);return this}Qa(a,b=!0){return this.C.Qa(a,b)}on(a,b,c,d=!0){return this.C.on(a,b,c,d)}qh(a){return new olympe.sc.wa(this.C.qh(this.F(),a))}qk(a,b){return this.C.qk(a,c=>{b(new olympe.sc.wa(c))})}sw(a){a=Nl(this.C,a);return a===this.C?this:a&&new olympe.sc.wa(a)}destroy(){this.C.destroy()}Lg(a,b){return this.C.Lg(a,b)}nk(a){this.C.nk(a)}onDestroy(a){return this.hb()?(a(),'noId'):this.F().onDestroy(a)}xf(a){this.hb()||this.F().xf(a)}clear(){this.C.clear()}hb(){return this.F().hb()}Ja(a){a=
|
|
966
|
+
Ol(this.C,a);return null!==a?new olympe.sc.ui.oy(a,this):null}bw(a){a=Ol(this.C,a);return null!==a?new olympe.sc.ui.ny(a,this):null}lx(...a){return rxjs.combineLatest(a.map(b=>{b=Ol(this.C,b);return null!==b?this.observe(b):rxjs.of(null)}))}Ka(a){return(null==a?void 0:a.constructor)!==this.constructor?!1:this.C===a.C}he(){const a=olympe.dc.ja();let b;try{const c=[this];let d=this.getParent();for(;null!==d&&d.C!==olympe.sc.Um;)c.push(d),d=d.getParent();b='> '+c.map(e=>{const f=e.ee();return null!==
|
|
967
|
+
f?(e=a.model(f),`${a.name(f)||e&&a.name(e)||f} (${e})`):e.V()}).join('\n> ')}catch(c){b=`No stack available for context ${this.V()}: ${c}`,this.H.warn(b)}return b}};olympe.sc.wa.prototype.observeMany=olympe.sc.wa.prototype.lx;olympe.sc.wa.prototype.getEvent=olympe.sc.wa.prototype.bw;olympe.sc.wa.prototype.getProperty=olympe.sc.wa.prototype.Ja;olympe.sc.wa.prototype.isDestroyed=olympe.sc.wa.prototype.hb;olympe.sc.wa.prototype.clear=olympe.sc.wa.prototype.clear;olympe.sc.wa.prototype.offDestroy=olympe.sc.wa.prototype.xf;
|
|
968
|
+
olympe.sc.wa.prototype.onDestroy=olympe.sc.wa.prototype.onDestroy;olympe.sc.wa.prototype.offClear=olympe.sc.wa.prototype.nk;olympe.sc.wa.prototype.onClear=olympe.sc.wa.prototype.Lg;olympe.sc.wa.prototype.destroy=olympe.sc.wa.prototype.destroy;olympe.sc.wa.prototype.getOtherContext=olympe.sc.wa.prototype.sw;olympe.sc.wa.prototype.onContext=olympe.sc.wa.prototype.qk;olympe.sc.wa.prototype.createChild=olympe.sc.wa.prototype.qh;olympe.sc.wa.prototype.setParentElement=olympe.sc.wa.prototype.Gx;
|
|
969
|
+
olympe.sc.wa.prototype['throw']=olympe.sc.wa.prototype.throw;olympe.sc.wa.prototype.waitFor=olympe.sc.wa.prototype.Fr;olympe.sc.wa.prototype.runner=olympe.sc.wa.prototype.Ex;olympe.sc.wa.prototype.repeat=olympe.sc.wa.prototype.repeat;olympe.sc.wa.prototype.observe=olympe.sc.wa.prototype.observe;olympe.sc.wa.prototype.has=olympe.sc.wa.prototype.has;olympe.sc.wa.prototype.get=olympe.sc.wa.prototype.get;olympe.sc.wa.prototype.remove=olympe.sc.wa.prototype.remove;olympe.sc.wa.prototype.trigger=olympe.sc.wa.prototype.an;
|
|
970
|
+
olympe.sc.wa.prototype.set=olympe.sc.wa.prototype.set;olympe.sc.wa.prototype.getClosest=olympe.sc.wa.prototype.Nv;olympe.sc.wa.prototype.getParent=olympe.sc.wa.prototype.getParent;olympe.sc.wa.C={PRODUCTION:'__production',EDITION:'__editionMode',TRANSACTION:'__transaction',ag:'__htmlContainer',Dy:'__dockableElement',en:'__appHasStarted'};olympe.sc.Kq=class extends olympe.sc.wa{constructor(a){super(a);this.K=new olympe.D.Yb('SC Update Context',super.F());const b=a.Lg(()=>{b&&a.nk(b);this.K.destroy()})}F(){return this.K}Lg(a,b){return this.F().onDestroy(a,null!=b?b:olympe.Y.Fc())}};let Pl=0;function Kl(a,b){b=olympe.dc.ga(b);let c,d,e,f;return null!=(f=null!=(e=null==(c=a.ba)?void 0:c.get('I#'+b))?e:null==(d=a.ba)?void 0:d.get('IO#'+b))?f:b}
|
|
971
|
+
function Ml(a,b){if(null===a.K)a.H.error(`An error occurred in a brick: ${b.message}\nError found in:\n${b.he()}\n\n${b.stack}`);else if(a.fa){var c=Ql(olympe.dc.CloudObject.get(a.fa));null!==c&&Rl(a,c).some(d=>{let e,f;return 0<(null==(e=a.G)?void 0:null==(f=e.get(d))?void 0:f.size)})&&!a.O.has('$'+c)?a.set(c,b):Ml(a.K,b)}else Ml(a.K,b)}
|
|
972
|
+
function Nl(a,b){if(b===a.id||a.T.has(b)||!b)return a;for(a=a.K;a;){if(b===a.V()||a.T.has(b))return a;const c=Sl(a.F,b);if(c)return c;a=a.getParent()}return null}function Tl(a,b,c=0){null===a.Za&&(a.Za=new Map);a.Za.has(b.V())||(a.Za.set(b.V(),{rk:b,depth:c}),Ul(a,d=>{(-1===b.G||c<b.G)&&Tl(d,b,c+1)}),a.onDestroy(()=>{Vl(a,b.V())}));return b.V()}
|
|
973
|
+
function Vl(a,b){if(null===a.Za||!a.Za.has(b))return!1;const {rk:c,depth:d}=a.Za.get(b);Ul(a,f=>{Vl(f,b)});0===d&&c.F();const e=a.Za.delete(b);0===a.Za.size&&(a.Za=null);return e}function Ol(a,b){let c;return(null==(c=a.ba)?void 0:c.get('IO#'+b))||null}
|
|
973
974
|
function Wl(a){a.C.Z(()=>{Ul(a,c=>c.destroy())});a.C.onDestroy(()=>{void 0!==a.Qa(olympe.sc.wa.C.TRANSACTION,!1)&&a.H.warn(`The context ${a.V()} is being destroyed but still has unreleased transactions. You probably forgot to end a transaction.`);let c;if(null!=(c=a.K)){let d;null==(d=c.F)||d.delete(a.V());let e;0===(null==(e=c.F)?void 0:e.size)&&(c.F=null)}a.T.clear()});let b;null==(b=a.K)||Xl(b,a)}
|
|
974
|
-
function Sl(a,b){if(null===a)return null;if(a.has(b))return a.get(b);for(const c of a.values())if(c.
|
|
975
|
+
function Sl(a,b){if(null===a)return null;if(a.has(b))return a.get(b);for(const c of a.values())if(c.oa&&!c.id.startsWith('_')&&(a=Sl(c.F,b)))return a;return null}function Yl(a,b,...c){if(null!==a.Za)for(const {rk:d,depth:e}of a.Za.values())d.process(a,b,e,...c)}function Zl(a,b){a.fa=olympe.dc.ga(b);a.oa=b.qd().Lm();b.G().forEach(c=>{a.id===c||a.T.has(c)||(a.T.add(c),Il(a,c,a))});a.ba=b.T();Yl(a,olympe.sc.Za.mc.C.INIT)}function $l(a){a.za=!0;let b;null==(b=a.F)||b.forEach(c=>{$l(c)})}
|
|
975
976
|
function am(a){a.za=!1;let b;null==(b=a.F)||b.forEach(c=>{am(c)})}function Rl(a,b){return['*',a.id,...a.T].map(c=>`${'@'}${c}.${b}`)}function bm(a,b,c,d){c.forEach(f=>{let g,h;null==(g=a.G)||null==(h=g.get(f))||h.forEach(k=>{k(d)})});let e;null==(e=a.F)||e.forEach(f=>{!f.za&&f.data.has(b)||bm(f,b,c,d)})}function cm(a,b,c){a.G||(a.G=new Map);let d=a.G.get(b);void 0===d&&(d=new Map,a.G.set(b,d));Pl++;const e=Pl;d.set(e,c);return()=>{const f=a.G.get(b);f&&(f.delete(e),0===f.size&&a.G.delete(b))}}
|
|
976
|
-
function Il(a,b,c){a.O.add(b);let d,e;null==(d=a.G)||null==(e=d.get('&'+b))||e.forEach(f=>{f(c)});Ul(a,f=>{f.O.has(b)||Il(f,b,c)});a.O.delete(b)}function Ul(a,b){let c;null==(c=a.F)||c.forEach(b)}function dm(a,b){a.data.forEach((c,d)=>b(c,d.slice(1)))}function em(a){var b=olympe.sc.
|
|
977
|
-
olympe.sc.
|
|
978
|
-
(d=this.ba)?void 0:d.get('IO#'+g))?k:g;c='$'+a;var e;d=null!=(e=this.data.get(c))?e:null;b=null!=b?b:null;if(e=!this.O.has(c)){a:{if('function'===typeof(null==b?void 0:b.Ka))try{var f=b.Ka(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.
|
|
979
|
-
'*';a=cm(this,'@'+f+'.'+e,b);c=c?(c=Nl(this,f))?c.Qa(e,!1):void 0:this.Qa(e);void 0!==c&&b(c);if(d)olympe.D.Xa().onDestroy(a);return a}has(a,b=!1){a='$'+Kl(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}qh(a,b,c){const d=null!=c?c:'_'+olympe.Y.
|
|
980
|
-
b,this));null!==this.
|
|
981
|
-
else return Pl++,b=null!=b?b:String(Pl),null===this.Z&&(this.Z=new Map),this.Z.set(b,a),b;return b||'noId'}
|
|
982
|
-
t])})};b.
|
|
983
|
-
c);this.O.listen().subscribe(e=>{var f=e.body();if(f.t===olympe.sc.
|
|
984
|
-
d){const e=[],f=olympe.dc.
|
|
985
|
-
b||void 0===b)return'<null>';const c=olympe.dc.
|
|
986
|
-
'<br> ',f+='Properties:<br>',d.forEach(([,g])=>{f+=' ';f+=' - '+c.name(g)+' : '+c.Ja(b.X(),g)+'<br>'}));d=e.filter(([g])=>g instanceof olympe.sc.
|
|
987
|
-
|
|
988
|
-
olympe.sc.
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
olympe.sc.
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
{
|
|
1004
|
-
|
|
1005
|
-
olympe.
|
|
1006
|
-
|
|
1007
|
-
olympe.sc.
|
|
1008
|
-
|
|
1009
|
-
olympe.sc.
|
|
1010
|
-
olympe.sc.
|
|
1011
|
-
olympe.sc.logic.
|
|
1012
|
-
|
|
1013
|
-
olympe.sc.logic.
|
|
1014
|
-
|
|
1015
|
-
olympe.sc.logic.
|
|
1016
|
-
|
|
1017
|
-
olympe.sc.logic.
|
|
1018
|
-
|
|
1019
|
-
olympe.sc.logic.
|
|
1020
|
-
function
|
|
1021
|
-
olympe.sc.logic.
|
|
1022
|
-
olympe.sc.logic.
|
|
1023
|
-
olympe.sc.logic.
|
|
1024
|
-
|
|
977
|
+
function Il(a,b,c){a.O.add(b);let d,e;null==(d=a.G)||null==(e=d.get('&'+b))||e.forEach(f=>{f(c)});Ul(a,f=>{f.O.has(b)||Il(f,b,c)});a.O.delete(b)}function Ul(a,b){let c;null==(c=a.F)||c.forEach(b)}function dm(a,b){a.data.forEach((c,d)=>b(c,d.slice(1)))}function em(a){var b=olympe.sc.Za.mc.F.gf;const c=[];if(null!==a.Za)for(const {rk:d}of a.Za.values())d.getType()===b&&(c.push(d.V()),d.F(),Vl(a,d.V()))}function Xl(a,b){null===a.F&&(a.F=new Map);a.F.set(b.id,b)}
|
|
978
|
+
olympe.sc.bg=class{constructor(a,b='no name',c=olympe.sc.Um){this.id=a;this.gd=b;this.T=new Set;this.K=c;this.C=new olympe.D.Yb('SC Context');this.data=new Map;this.fa=this.Z=this.F=this.G=null;this.oa=!1;this.O=new Set;this.za=!1;this.ba=null;this.H=olympe.ma.eb('sc');this.Za=null;Wl(this)}V(){return this.id}getParent(){return this.K}ee(){return this.fa}set(a,b){if(!this.C.Tc()&&!this.C.hb()){const g=olympe.dc.ga(a);var c,d;let h,k;a=null!=(k=null!=(h=null==(c=this.ba)?void 0:c.get('O#'+g))?h:null==
|
|
979
|
+
(d=this.ba)?void 0:d.get('IO#'+g))?k:g;c='$'+a;var e;d=null!=(e=this.data.get(c))?e:null;b=null!=b?b:null;if(e=!this.O.has(c)){a:{if('function'===typeof(null==b?void 0:b.Ka))try{var f=b.Ka(d);break a}catch(l){f=!1;break a}f=b===d}e=!f}e&&(null===b?this.data.delete(c):this.data.set(c,b),null!==this.Za&&0<this.Za.size&&Yl(this,olympe.sc.Za.mc.C.Lj,a,b),f=Rl(this,a),this.O.add(c),bm(this,c,f,b),this.O.delete(c))}}on(a,b,c,d=!0){if(this.C.hb()||this.C.Tc())return()=>{};const e=Kl(this,a),f=c?olympe.dc.ga(c):
|
|
980
|
+
'*';a=cm(this,'@'+f+'.'+e,b);c=c?(c=Nl(this,f))?c.Qa(e,!1):void 0:this.Qa(e);void 0!==c&&b(c);if(d)olympe.D.Xa().onDestroy(a);return a}has(a,b=!1){a='$'+Kl(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}qh(a,b,c){const d=null!=c?c:'_'+olympe.Y.Fc();if(a.hb()||a.Tc())throw Error(`Try to create new child context in a destroyed context ${a.V()}, probably because \`runner()\` is called on a destroyed context`);const e=a.run(()=>new olympe.sc.bg(d,
|
|
981
|
+
b,this));null!==this.Za&&0<this.Za.size&&this.Za.forEach(({rk:f,depth:g})=>{(-1===f.G||g<f.G)&&Tl(e,f,g+1)});return e}qk(a,b){const c=Nl(this,a);if(c)return b(c),()=>{};const d=cm(this,'&'+a,e=>{let f;null==(f=d)||f();b(e)});return d}Qa(a,b=!0){a='$'+Kl(this,a);let c=this.data.get(a),d=this.getParent();if(b)for(;void 0===c&&null!==d;)c=d.data.get(a),d=d.getParent();return c}destroy(){this.C.Tc()||this.C.hb()||(Yl(this,olympe.sc.Za.mc.C.cj),this.C.destroy(),Yl(this,olympe.sc.Za.mc.C.Ld))}Lg(a,b){if(this.C.hb())a();
|
|
982
|
+
else return Pl++,b=null!=b?b:String(Pl),null===this.Z&&(this.Z=new Map),this.Z.set(b,a),b;return b||'noId'}nk(a){null!==this.Z&&this.Z.delete(a)}onDestroy(a){return this.hb()?(a(),'noId'):this.C.onDestroy(a)}clear(){if(!this.C.Tc()&&!this.C.hb()){Yl(this,olympe.sc.Za.mc.C.Yi);let a;null==(a=this.Z)||a.forEach(b=>b());Yl(this,olympe.sc.Za.mc.C.Zi)}}hb(){return this.C.hb()}};olympe.sc.bg.prototype.getParent=olympe.sc.bg.prototype.getParent;olympe.sc.bg.C={jl:'I#',Al:'O#',xz:'IO#'};function fm(a,b,c){return(c=c.ee())?`${a}.${c}.${b}`:`${a}.${b}`}olympe.sc.Za.mc=class{constructor(a=-1){this.id=olympe.Y.sf();this.active=!0;this.G=a}F(){this.active=!1}V(){return this.id}getType(){}process(){}};olympe.sc.Za.mc.C={INIT:'INIT',Lj:'SET',Yi:'CLEAR',Zi:'CLEARED',cj:'DESTROY',Ld:'DESTROYED'};olympe.sc.Za.mc.F={gf:'REMOTE',vt:'LOCAL',Jf:'PROFILER'};olympe.sc.Md=class a{constructor(){this.F=this.K=this.O=null;this.T=new Map;this.G=new Map;this.C=new olympe.Y.Wl(1E4);La(this.C,b=>{em(b)})}ba(b,c,d){const e=b.body(),f=e.c,g=this.T.get(f);switch(e.t){case olympe.sc.Md.C.Tt:c=this.G.get(e.f);b.kd(c).catch(l=>{d.error('Unable to reply with paths: ',l)});break;case olympe.sc.Md.C.Ut:const h=f+c,k=(l,n,p=0)=>{dm(l,(q,r)=>{let t;q instanceof olympe.dc.CloudObject?t=a.G(q):t=q;let u;q=null!=(u=l.ee())?u:'';0<q.length&&(q+='.');n.push([`${p}.${q}${r}`,
|
|
983
|
+
t])})};b.Qm(h).then(()=>{const l=[];k(g,l,0);Ul(g,p=>{k(p,l,1)});olympe.N.tb.publish(h,{t:olympe.sc.Md.C.Qs,v:l,ts:0}).catch(p=>{d.error('Error publishing on service : ',p)});const n=new olympe.sc.Za.ju(h);Tl(g,n);this.C.has(g)?Ka(this.C,g):this.C.add(g)}).catch(l=>{d.error('Error notifying on a contextId : ',l)});break;case olympe.sc.Md.C.Vt:void 0!==g&&this.C.has(g)&&Ka(this.C,g);break;case olympe.sc.Md.C.Wk:void 0!==g&&(this.C.delete(g),em(g))}}fa(b,c,d){this.O=new olympe.N.tb('discovery_debug_id',
|
|
984
|
+
c);this.O.listen().subscribe(e=>{var f=e.body();if(f.t===olympe.sc.Md.C.rs){e=f.i;f=f.f;if(!this.G.has(f)){const g=this.Z(f,c,b);if(0!==g.length)this.G.set(f,g);else return}null===this.F&&(this.F=olympe.Y.sf(),f=new olympe.D.Yb(this.F,c.F()),this.K=new olympe.N.tb(this.F,f),this.K.listen().subscribe(g=>{this.ba(g,b,d)}));olympe.N.tb.publish(e,{t:olympe.sc.Md.C.Gr,n:olympe.W.getParameter(olympe.sc.U.bo)||'no name',a:b,s:this.F}).catch(g=>{d.error('Error publishing on draw service : '+g)})}})}Z(b,c,
|
|
985
|
+
d){const e=[],f=olympe.dc.ja(),g=(h,k)=>{Ul(h,l=>{if(null!==l.ee()){const n=olympe.dc.CloudObject.get(l.ee()).ak(olympe.sc.Runnable.K).hd();if(null!==n){const p=k+'/'+f.name(n);n.X()===b&&(e.push([p,l.V()]),this.T.set(l.V(),l));g(l,p)}}})};g(c.C,f.name(d));return e}static F(b,c,d){let e=d;d instanceof olympe.dc.CloudObject&&(e=a.G(d));olympe.N.tb.publish(b,{t:olympe.sc.Md.C.Tj,k:c,v:e,ts:Date.now()}).catch(f=>{olympe.ma.eb('Debugger').error('Error publishing on service : ',f)})}static G(b){if(null===
|
|
986
|
+
b||void 0===b)return'<null>';const c=olympe.dc.ja();if(b instanceof olympe.dc.CloudObject){var d=b.bc();if(!c.tc(d,olympe.sc.Xc))return b.toString();let f=`${b.Ec().name()} (${b.X()})`;var e=olympe.dc.CloudObject.get(d);d=olympe.dc.pa.from(e).Qf(olympe.dc.CloudObject.extendRel,!0).be().cb(olympe.dc.CloudObject.propertyRel).be().hd();e=olympe.dc.pa.from(e).Qf(olympe.dc.CloudObject.extendRel,!0).be().cb(olympe.dc.CloudObject.Li).be().hd();d=d.filter(([g])=>g instanceof olympe.sc.Xc);0!==d.length&&(f+=
|
|
987
|
+
'<br> ',f+='Properties:<br>',d.forEach(([,g])=>{f+=' ';f+=' - '+c.name(g)+' : '+c.Ja(b.X(),g)+'<br>'}));d=e.filter(([g])=>g instanceof olympe.sc.Xc);0!==d.length&&(f+=' ',f+='Relations:<br>',d.forEach(([,g])=>{f+=' ';f+=' - '+c.name(g)+'<br>'}));return f}return b.toString()}};olympe.sc.Md.K='discovery_debug_id';olympe.sc.Md.C={rs:0,Gr:1,Tt:2,Ut:3,Qs:4,Tj:5,Vt:6,Wk:7};olympe.sc.Za.Dz=class extends olympe.sc.Za.mc{constructor(a=-1){super(a);this.C=new Map}getType(){return olympe.sc.Za.mc.F.vt}process(a,b,c,...d){if(this.active&&b===olympe.sc.Za.mc.C.Lj){a=fm(c,Kl(a,d[0]),a);d=d[1];let e;null==(e=this.C.get(a))||e(d)}}on(a,b){this.C.set(a,b)}};function gm(a,b,c,d=new Map){for(var e=[];b;){const n=b.ee();if(!n)break;e.push(n);b=b.getParent()}Ra(a.C,c,d.set('context',e));var f;let g;for(const n of[...e,null==(f=d)?void 0:f.get('propId'),null==(g=d)?void 0:g.get('type')])if(c=n,'string'===typeof c&&!a.K.has(c)){e=a;f=c;e.ja||(e.ja=olympe.dc.ja());d=e.ja.name(f);e=(f=e.ja.model(f))?e.ja.name(f):'';var [h,k,l]=[d,f,e];d=a.C;e=(new Map).set(c,h).set(k,l);c=(new Map).set(c,k);for(const [p,q]of e.entries())d.O.set(p,q);for(const [p,q]of c.entries())d.K.set(p,
|
|
988
|
+
q)}}
|
|
989
|
+
olympe.sc.Za.bu=class extends olympe.sc.Za.mc{constructor(a){super();this.C=a;this.ja=olympe.dc.ja();this.K=new Set}getType(){return olympe.sc.Za.mc.F.Jf}process(a,b,c,...d){var e=hm.jl,f=hm.Al,g=hm.Wt;const h=hm.INIT,k=hm.Yi,l=hm.Zi,n=hm.cj,p=hm.Ld;c=hm.Qt;if(b===olympe.sc.Za.mc.C.Lj){const [q,r]=d;b=(d=a.ee())?olympe.dc.ja().tc(d,olympe.sc.logic.Function):!1;d=d?olympe.dc.ja().tc(d,olympe.sc.ui.pA):!1;b?(g=this.ja.Ib(q,olympe.dm.Property.typeRel),b=this.ja.tc(q,olympe.sc.logic.qb),d=this.ja.tc(q,olympe.sc.logic.zb),
|
|
990
|
+
gm(this,a,b?e:d?f:c,new Map([['propId',q],['value',r],['type',g]]))):d&&(e=this.ja.tc(q,olympe.dm.Property),f=this.ja.Ib(q,olympe.dm.Property.typeRel),gm(this,a,e?g:c,new Map([['propId',q],['value',r],['type',f]])))}else b===olympe.sc.Za.mc.C.INIT?gm(this,a,h):b===olympe.sc.Za.mc.C.Yi?gm(this,a,k):b===olympe.sc.Za.mc.C.Zi?gm(this,a,l):b===olympe.sc.Za.mc.C.cj?gm(this,a,n):b===olympe.sc.Za.mc.C.Ld&&gm(this,a,p)}};
|
|
991
|
+
const hm={jl:'input',Al:'output',Wt:'prop',INIT:'init',Yi:'clear',Zi:'cleared',cj:'destroy',Ld:'destroyed',Qt:'other'};olympe.sc.Za.ju=class extends olympe.sc.Za.mc{constructor(a){super(1);this.K=a;this.C=new Map;this.db=olympe.dc.ja()}getType(){return olympe.sc.Za.mc.F.gf}F(){super.F();for(const a of this.C.values())a();this.C.clear()}process(a,b,c,...d){if(this.active&&b===olympe.sc.Za.mc.C.Lj&&void 0!==d[0]&&null!==d[0]){const e=fm(c,Kl(a,d[0]),a),f=d[1];let g;null==(g=this.C.get(e))||g();this.C.delete(e);if(f instanceof olympe.dc.CloudObject&&f.Ec()instanceof olympe.sc.Xc){const h=bg(this.db,f,()=>{olympe.sc.Md.F(this.K,
|
|
992
|
+
e,f)});this.C.set(e,()=>{cg(this.db,f,h)})}olympe.sc.Md.F(this.K,e,f)}}};olympe.sc.Metadata=class extends olympe.dc.CloudObject{ht(){return this.Sc(this.Fm())}it(){return this.Sc(this.Gm())}fk(){return new olympe.D.Sb(this.Sc(this.Fm()),this.Sc(this.Gm()))}Fm(){}Gm(){}};olympe.sc.Metadata.P=olympe.dc.na.C('0161ae936c62f9fcd131',olympe.sc.Metadata);m=olympe.sc.Metadata.prototype;m.ht.L=olympe.D.J.G;m.it.L=olympe.D.J.G;m.fk.L=olympe.D.J.T;m.Fm.L=olympe.D.J.C;m.Gm.L=olympe.D.J.C;olympe.sc.Pc=class extends olympe.dc.CloudObject{F(){return this.vb(olympe.sc.Pc.G)}C(){return this.vb(olympe.sc.Pc.C)}};olympe.sc.Pc.P=olympe.dc.na.C('01703376c4a81c0e9d90',olympe.sc.Pc);olympe.sc.Pc.G=olympe.sc.Pc.P.la('01703376c4a81c0e9d91');olympe.sc.Pc.C=olympe.sc.Pc.P.la('01703376c4a81c0e9d92');olympe.sc.Pc.F=olympe.sc.Pc.P.sa('01703376c4a81c0e9d93');U(olympe.dc.CloudObject.P,olympe.sc.Pc.F);olympe.sc.Pc.prototype.F.L=olympe.D.J.F;olympe.sc.Pc.prototype.C.L=olympe.D.J.F;olympe.sc.td={};olympe.sc.td.ue={bs:null,nu:'screenflow',Ju:'ui-design',qq:'software-intelligence',Sg:'data-management'};olympe.sc.bd=class extends olympe.dm.BrickMetadata{ke(){return olympe.sc.td.ue.qq}C(){return this.ab(olympe.sc.bd.C,olympe.sc.logic.dh)}F(){return this.ab(olympe.sc.bd.F,olympe.sc.logic.mg)}};olympe.sc.bd.P=olympe.dc.na.C('011100000000000adef0',olympe.sc.bd);olympe.sc.bd.C=olympe.sc.bd.P.sa('016ac4f59a2917fdef01');olympe.sc.bd.F=olympe.sc.bd.P.sa('016ac4f59a2917fdef02');olympe.sc.bd.P.C=(a,b)=>yk(a,b||'New function signature',olympe.sc.bd,olympe.sc.logic.nd).X();
|
|
993
|
+
olympe.sc.bd.prototype.C.L=new olympe.D.J(()=>olympe.dc.ya,[]);olympe.sc.bd.prototype.F.L=new olympe.D.J(()=>olympe.dc.ya,[]);function im(a,b){[].forEach(c=>c.call(a,b,(d,e)=>{null===e?b.remove(d):b.set(d,e)}))}function jm(a,b){b=b.filter(c=>'string'===typeof c&&a.db.tc(c,olympe.sc.logic.Rb));b.sort((c,d)=>{let e;c=null!=(e=a.db.Ja(c,olympe.sc.logic.Rb.C,!0))?e:0;let f;d=null!=(f=a.db.Ja(d,olympe.sc.logic.Rb.C,!0))?f:0;return c-d});return b}
|
|
994
|
+
olympe.sc.Ua=class extends olympe.dm.BrickMetadata{kt(a,b,c,d,e=!0){e||olympe.ma.eb('sc').error('parameter own= false ignored, investigate');return olympe.D.Mg(N(this.wf(a,olympe.dc.Jb.Ag,c)),d)}zw(){return this.ab(olympe.sc.Ua.O,olympe.sc.Runnable)}Qv(){return this.ab(olympe.sc.Ua.T,olympe.sc.Runnable)}Om(){return this.db.Ja(this,olympe.sc.Ua.ba)}Lm(){return null!==this.db.Ib(this.tag,olympe.sc.Runnable.C.Vb())}jt(){return this.ab(olympe.sc.Ua.G,olympe.sc.logic.qb)}cp(){return this.ab(olympe.sc.Ua.F,
|
|
995
|
+
olympe.sc.logic.zb)}G(){return[olympe.sc.Ua.bb]}};olympe.sc.Ua.P=olympe.dc.na.C('0112000000000000def0',olympe.sc.Ua);olympe.sc.Ua.ba=olympe.sc.Ua.P.la('01692aa71f3108454479');olympe.sc.Ua.nb=olympe.sc.Ua.P.la('0166446c1f128ebc903a');olympe.sc.Ua.bb=olympe.sc.Ua.P.la('0166446c1f128ebc904e');olympe.sc.Ua.O=olympe.sc.Ua.P.sa('01692a4af82e8984742c');olympe.sc.Ua.T=olympe.sc.Ua.P.sa('01692a4af82e8984742d');olympe.sc.Ua.Z=olympe.sc.Ua.P.sa('01692a4af82e8984742e');olympe.sc.Ua.G=olympe.sc.Ua.P.sa('01621fb84e320000f00a');
|
|
996
|
+
olympe.sc.Ua.F=olympe.sc.Ua.P.sa('01621fb84e320000f00b');olympe.sc.Ua.ec=olympe.sc.Ua.P.sa('0171838bcfed0000e00e');olympe.sc.Ua.ac=olympe.sc.Ua.P.sa('0171838bcfed0000a00a');m=olympe.sc.Ua.prototype;m.kt.L=olympe.D.J.C;m.zw.L=new olympe.D.J(()=>olympe.dc.ya,[]);m.Qv.L=new olympe.D.J(()=>olympe.dc.ya,[]);m.Om.L=olympe.D.J.C;m.Lm.L=olympe.D.J.C;m.jt.L=new olympe.D.J(()=>olympe.dc.ya,[]);m.cp.L=new olympe.D.J(()=>olympe.dc.ya,[]);function Ql(a){let b;return null!=(b=a.qd().G().map(olympe.dc.ga)[0])?b:null}function km(a){const b=new olympe.dc.Wa;a=b.create(a);b.persist(a,!1);b.kb((d,e)=>{d||olympe.ma.eb('sc').error(`Error occurred for transaction executed by createLocalRunnable: ${e}`)});const c=olympe.dc.CloudObject.get(a);olympe.D.Xa().onDestroy(()=>{const d=new olympe.dc.Wa;d.delete(c);d.kb()});return c}
|
|
997
|
+
function lm(a,b){Zl(b.C,a);im(a.qd(),b);const c=a.O(),d=mm(b,c),e=[];c.forEach((f,g)=>{f===a.fa?e[0]=g:f===a.ba&&(e[1]=g)});void 0!==e[0]&&void 0!==e[1]&&(nm(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])})}
|
|
998
|
+
function om(a,b){var c=a.bc();const d=a.db.name(c),e=`Brick ${d} successfully run`,f=`Brick ${d} successfully cleared`,g=a.C(b);c=a.setupExecution(b).pipe(rxjs.operators.map(h=>{if(!b.hb()&&(b.clear(),null!==h)){const k=Array.isArray(h)?h:[h],l=new olympe.sc.Kq(b.C);l.F().run(()=>v(function*(){try{yield a.update(l,k,g)}catch(n){l.throw(n)}}));return!0}return!1})).subscribe(rxjs.Subscriber.create(h=>h?a.H.debug(e):a.H.debug(f),h=>b.throw(h),()=>a.H.debug(`Brick ${d} completed`)));b.onDestroy(c.unsubscribe.bind(c))}
|
|
999
|
+
function pm(a,b,c,d){const e=W(a.db,b,c,(f,g)=>{const h=Hl(d,g);f?olympe.dc.CloudObject.get(g).run(h):h.destroy()});d.F().onDestroy(a.db.F.bind(a.db,b,c,e,!0))}function mm(a,b){if(1===b.length)return[(d,e)=>{null!==e?a.set(d,e):a.remove(d)}];const c=b.map(()=>new Map);return c.map(d=>(e,f)=>{null!==f?d.set(e,f):d.delete(e);a:{for(const g of c)if(f=g.get(e),void 0!==f){a.set(e,f);break a}a.remove(e)}})}
|
|
1000
|
+
function nm(a,b,c,d){b=b.F();const e=bg(a.db,a.tag,b.G((f,g,h)=>{const k=h?d:c;null!==k&&(null===g||void 0===g?k(f,null):k(f,olympe.sc.Ag(g)),h&&c&&c(f,null))}));b.onDestroy(()=>{cg(a.db,a.tag,e)})}
|
|
1001
|
+
olympe.sc.Runnable=class extends olympe.dm.BrickMetadata{constructor(a,b,c){super(a,b);this.H=c}run(a){a.F().run(()=>{lm(this,a);this.init(a);a.Lg(this.clear.bind(this,a));a.onDestroy(this.destroy.bind(this,a));if(this.qd().Om())om(this,a);else{const b=new olympe.sc.Kq(a.C);this.update(b,[],[])}this.F(a)})}qd(){return this.Ec()}init(a){this.onInit(a)}update(a,b,c){const d=this.qd();if(d.Om())this.onUpdate(a,b,c);else this.H.debug(`Softcoded runnable ${this.db.name(this)} with tag ${this.tag} running in context ${a.V()}`),
|
|
1002
|
+
pm(this,d,olympe.sc.Ua.O,a),this.oa()&&pm(this,d,olympe.sc.Ua.Z,a)}F(a){a.an(olympe.sc.Ua.nb)}clear(){}destroy(a){this.onDestroy(a)}setupExecution(){return rxjs.of([])}C(){return[]}onInit(){}onUpdate(){const a=this.bc(),b=this.db.name(a),c=this.db.name(this.db.model(a));this.H.error(`No code was found for the following brick: ${b}: ${c} (${a})\n\n`+'This is probably because the code has not yet been deployed to the environment, or because the package.json does not import the required dependencies.')}onDestroy(){}getInputs(){var a=
|
|
1003
|
+
this.qd();return jm(a,a.db.ab(a.tag,olympe.sc.Ua.G))}getOutputs(){var a=this.qd();return jm(a,a.db.ab(a.tag,olympe.sc.Ua.F))}G(){return[]}T(){return new Map}oa(){return!1}K(a,b,c,d){a=b.ub(a,c,!0);void 0!==d&&olympe.D.Mg(a,d);return a}nb(a,b,c,d,e){olympe.D.Tm([d],f=>{b.set(a,olympe.D.tr(f)?f.valueOf():f)});return this.K(a,b,c,e)}O(){return[this.fa,this.ba]}fa(a,b){nm(this,a,b,null)}ba(a,b){nm(this,a,null,b)}Ab(a,b){const c=this.db,d=olympe.sc.logic.mb.G.Vb(),e=olympe.sc.logic.mb.F,f=olympe.sc.logic.mb.C;
|
|
1004
|
+
this.fr(d,g=>{var h=g.X();if(h=c.Ib(h,e)||c.Ib(h,f))return qm(g,a,b.bind(null,h))})}};olympe.sc.Runnable.P=ff(olympe.dc.na.C('01130000000000ca1100',olympe.sc.Runnable));olympe.sc.Runnable.K=olympe.sc.Runnable.P.sa('01692a4af82e8984742b');olympe.sc.Runnable.C=olympe.sc.Runnable.P.sa('01756a18d4921c103111');olympe.sc.Runnable.O=U(olympe.sc.Runnable.P,olympe.sc.Ua.O);olympe.sc.Runnable.T=U(olympe.sc.Runnable.P,olympe.sc.Ua.T);olympe.sc.Runnable.Z=U(olympe.sc.Runnable.P,olympe.sc.Ua.Z);
|
|
1005
|
+
U(olympe.sc.Ua.P,olympe.sc.Runnable.K);U(olympe.sc.Ua.P,olympe.sc.Runnable.C);olympe.sc.Runnable.prototype.qd.L=new olympe.D.J(()=>olympe.sc.Ua,[]);olympe.sc.Runnable.prototype.K.L=new olympe.D.J(()=>Object,[]);olympe.sc.Runnable.prototype.nb.L=olympe.D.J.C;function rm(a){if(a){if('string'===typeof a)return a;if(a instanceof olympe.sc.re)return(a=a.F())?a.valueOf():null;if('function'===typeof a.X)return a.X()}return null}olympe.sc.re=class extends olympe.dc.CloudObject{F(){return this.db.ab(this,olympe.sc.re.C)[0]}C(){return olympe.dc.CloudObject.get(rm(this))}toString(){const a=rm(this);let b;a&&(b=this.db.name(a));return b||super.toString()}};olympe.sc.re.P=olympe.dc.na.C('0163c9ae01f2d6e9ca49',olympe.sc.re);olympe.sc.re.C=olympe.sc.re.P.sa('0169b5a8a33144fb0b49');
|
|
1006
|
+
U(olympe.dc.CloudObject.P,olympe.sc.re.C);olympe.sc.re.prototype.F.L=new olympe.D.J(()=>String,[]);olympe.sc.re.prototype.C.L=new olympe.D.J(()=>olympe.dc.CloudObject,[]);olympe.sc.ho=class extends olympe.dm.Hb{ke(){return olympe.sc.td.ue.Sg}};olympe.sc.ho.P=olympe.dc.na.C('0163a68ce44f3d1fa84c',olympe.sc.ho);olympe.sc.Xc=class extends olympe.dm.BrickMetadata{};olympe.sc.Xc.P=olympe.dc.na.C('016324fde11a836f76c2',olympe.sc.Xc);olympe.sc.Xc.C=olympe.sc.Xc.P.sa('016324fde11a836087c2');olympe.sc.Xc.P.C=function(a,b){return yk(a,null!=b?b:'New type',olympe.sc.Xc).X()};let sm=null;
|
|
1007
|
+
function tm(a,b){sm=a;const c=olympe.D.Xa(),d=c.G(b);olympe.dc.ad.from(a).cb(olympe.sc.qa.Jc.C).cb(olympe.sc.Wc.C.Vb()).kb({ph:'__code-as-data__'}).then(e=>{if(null!==e){const f=olympe.dc.ja();kh(c,e,g=>{g=f.Bh(g)?g:f.model(g);return null!==g&&f.tc(g,olympe.sc.Xc)},{Ym:!0}).subscribe(rxjs.Subscriber.create(()=>{d(olympe.sc.Wc.Mb.gp)},()=>{olympe.ma.eb('sc').error('Impossible to load the business container for the application',a,'maybe are you offline?');d(olympe.sc.Wc.Mb.rj)}))}else olympe.ma.eb('sc').info(`No business container for application ${a}. You probably miss permissions.`),d(olympe.sc.Wc.Mb.rj)}).catch(e=>
|
|
1008
|
+
{olympe.ma.eb('sc').error('Error while loading business container:',e.message);d(olympe.sc.Wc.Mb.Eb)})}olympe.sc.Wc=class extends olympe.dc.CloudObject{};olympe.sc.Wc.Mb={gp:0,rj:1,Eb:2};olympe.sc.Wc.P=olympe.dc.na.C('017b3aa8fae1e3d044dc',olympe.sc.Wc);olympe.sc.Wc.C=olympe.sc.Wc.P.sa('017b3aa8fd1659291b92');olympe.sc.Wc.F=olympe.sc.Wc.P.sa('017b3aa8fe7ec3fd52f2');olympe.sc.Map=class extends olympe.dc.CloudObject{};olympe.sc.Map.P=olympe.dc.na.C('018119241abce0e5696e',olympe.sc.Map);olympe.sc.jg=class extends olympe.sc.Map{};olympe.sc.jg.P=olympe.dc.na.C('01631aacd8276ea98490',olympe.sc.jg);olympe.sc.File=class extends olympe.dm.File{static ov(a,b,c,d,e,f){e=a.create(olympe.sc.File,new Map,e,f);olympe.sc.File.zr(a,e,b,c,d);return e}static pv(a,b,c,d,e,f){e=a.create(olympe.sc.File,new Map,e,f);olympe.sc.File.Xm(a,e,b,c,d);return e}static zr(a,b,c,d,e){e=null!=e?e:'application/data';d=URL.createObjectURL(new Blob([d],{type:e}));olympe.sc.File.Xm(a,b,c,d,e)}static Xm(a,b,c,d,e){const f=olympe.dc.ja(),g=f.Fa(b);var h;const k=null!=(h=a.model(b))?h:olympe.sc.File;if(null===k||!f.Ig(k,olympe.dm.File))throw Error(`Try to set the content of an object which is not a file: ${b}`);
|
|
1009
|
+
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.Ja(b,olympe.dm.File.urlProp)||c.set(olympe.dm.File.creationDateProp,h).set(olympe.dm.File.C,!1);a.wr(b,c)}};olympe.sc.File.setURLContent=olympe.sc.File.Xm;olympe.sc.File.setContent=olympe.sc.File.zr;olympe.sc.File.createFromURL=olympe.sc.File.pv;olympe.sc.File.createFromContent=olympe.sc.File.ov;
|
|
1010
|
+
olympe.sc.File.P=af(olympe.dm.File,'ff021000000000000031',olympe.sc.File);olympe.sc.fg=class extends olympe.sc.File{K(){const a=olympe.D.ic(olympe.D.Na);this.dk(b=>{a.update(olympe.D.wb(b))});return a.ub()}};olympe.sc.fg.P=af(olympe.sc.File,'01644b6297305d62fca2',olympe.sc.fg);olympe.sc.fg.P.C=olympe.sc.File.F.bind(null,olympe.sc.fg);olympe.sc.fg.prototype.K.L=olympe.D.J.F;olympe.sc.Ac=class extends olympe.sc.File{K(){return this.vb(olympe.sc.Ac.fontFamilyProp)}O(){return this.vb(olympe.sc.Ac.G)}T(){return this.Sc(olympe.sc.Ac.K)}};olympe.sc.Ac.P=af(olympe.sc.File,'01647e113043c637b541',olympe.sc.Ac);olympe.sc.Ac.fontFamilyProp=olympe.sc.Ac.P.la('01647e35ecd24ef0b88d');olympe.sc.Ac.G=olympe.sc.Ac.P.la('01647e677f5d1cfbdf42');olympe.sc.Ac.K=olympe.sc.Ac.P.la('01647e6780999bf8bd25');
|
|
1011
|
+
olympe.sc.Ac.P.C=(a,b,c,d)=>{c=olympe.sc.File.F(olympe.sc.Ac,a,b,c,d);a.update(c,olympe.sc.Ac.fontFamilyProp,b.split('.')[0]);return c};olympe.sc.Ac.prototype.K.L=olympe.D.J.F;olympe.sc.Ac.prototype.O.L=olympe.D.J.F;olympe.sc.Ac.prototype.T.L=olympe.D.J.G;olympe.sc.kh=class extends olympe.sc.File{};olympe.sc.kh.P=af(olympe.sc.File,'0164643c432146a71d5c',olympe.sc.kh);olympe.sc.kh.P.C=olympe.sc.File.F.bind(null,olympe.sc.kh);olympe.sc.Mq=class extends olympe.dc.CloudObject{};olympe.sc.Mq.P=olympe.dc.na.C('016421bb3797e22d1c4e',olympe.sc.Mq);olympe.sc.logic={};olympe.sc.logic.Io=(a,b)=>a===b?0:a>b?1:-1;
|
|
1012
|
+
olympe.sc.logic.Cz=(a,b,c,d,e,f,g)=>{const h=b.X();b=olympe.D.Qa(b.getType().X());let k,l;if(b===olympe.dc.ga(olympe.dm.String))k=c.valueOf().toLowerCase(),l=p=>p.vb(h).toLowerCase();else if(b===olympe.dc.ga(olympe.dm.Number))k=c.valueOf(),l=p=>p.Sc(h);else if(b===olympe.dc.ga(olympe.dm.DateTime))k=c.getTime(),l=p=>olympe.D.ta([p.Fi(h)],q=>q.getTime(),Number,'FilterList Date&DateTime TransformFlows');else{c=olympe.dc.ja().name(b);g.warn(`Properties of type ${c} are not supported. List will not be filtered.`);e(a);
|
|
1013
|
+
return}let n;if('<'===f)n=(p,q)=>olympe.sc.logic.Io(q,p);else if('>'===f)n=(p,q)=>olympe.sc.logic.Io(p,q);else{g.error(`Unknown inequality ${f}. Please use '<' or '>'`);return}e(a.Yj().filter(p=>olympe.D.ta([l(p)],q=>{q=n(q.valueOf(),k);return olympe.D.Qb(d.valueOf()?1===q:0<=q)},olympe.D.ea,'FilterList ListDefBuilder Filter TransformFlows')).$h())};
|
|
1014
|
+
olympe.sc.logic.hC=(a,b)=>{if(a instanceof olympe.D.aa)return a;if(a instanceof olympe.D.Na)return a.Cr();if(a instanceof olympe.D.ea)return a.lr();if('string'===typeof a||'number'===typeof a)return olympe.D.ra(Number(a));b.error(`Could not parse provided value ${a} into a number`);return olympe.D.aa.np};olympe.sc.logic.Ma={};function um(a){ef(a.P,(b,c)=>{b=b.create(a.P.F);Z(b,olympe.dc.CloudObject.nameProp,c);return b.X()})}olympe.sc.logic.Ma.zo=class{constructor(a,b,c){this.P=olympe.dc.na.C(a,b,...c);um(this)}X(){return this.P.X()}};olympe.sc.logic.Ma.zo.xa=[olympe.dc.Fe];const vm=Object.create(null),wm=new Map;function xm(a){if(void 0===vm[a])throw Error(`Tag: ${a} - does not correspond to a registered function`);return bf(a)}function ym(a,b,c=olympe.sc.logic.Function){if(wm.has(a))throw c=xm(a),Error(`Tag: ${a} - overwriting existing function definition "${c.name}" with "${b.name}"`);const d=olympe.dc.na.C(a,b,...[]);wm.set(a,{P:d,xC:b,eC:c});return d}
|
|
1015
|
+
olympe.sc.logic.na=class{constructor(){}static C(a,b,...c){if(vm[a])throw c=xm(a),Error(`Tag: ${a} - overwriting already defined function "${c.name}" with "${b.name}"`);b=new olympe.sc.logic.Ma.zo(a,b,[olympe.sc.R.Ca].concat(c));return vm[a]=b}};olympe.sc.logic.sy=class{};olympe.sc.logic.aj=class extends olympe.dc.CloudObject{};olympe.sc.logic.aj.P=olympe.dc.na.C('01621fb84e320000cf00',olympe.sc.logic.aj);function Ll(a,b,c){return new olympe.sc.logic.Error(a,b,c)}olympe.sc.logic.Error=class extends Error{constructor(a,b,c){super(a);this.code=b;this.C=null!=c?c:null}static create(a,b){return new olympe.sc.logic.Error(a,b)}nw(){return this.message}gr(){return this.code}he(){let a;return null!=(a=this.C)?a:''}};olympe.sc.logic.Error.prototype.getStack=olympe.sc.logic.Error.prototype.he;olympe.sc.logic.Error.prototype.getCode=olympe.sc.logic.Error.prototype.gr;
|
|
1016
|
+
olympe.sc.logic.Error.prototype.getMessage=olympe.sc.logic.Error.prototype.nw;olympe.sc.logic.Error.create=olympe.sc.logic.Error.create;olympe.sc.logic.Ph=class extends olympe.sc.logic.aj{};olympe.sc.logic.Ph.P=olympe.dc.na.C('016eeb5ede9f3094d8f0',olympe.sc.logic.Ph);olympe.sc.logic.$c=class extends olympe.dc.CloudObject{C(){return this.oc(olympe.sc.logic.$c.C,olympe.dc.CloudObject)}};olympe.sc.logic.$c.P=olympe.dc.na.C('016ac4f59ee8ea2081ba',olympe.sc.logic.$c);olympe.sc.logic.$c.F=olympe.sc.logic.$c.P.la('017bc044aeacce7ffc8f');olympe.sc.logic.$c.C=olympe.sc.logic.$c.P.sa('016ac4f5a0091c4790e2');U(olympe.dc.CloudObject.P,olympe.sc.logic.$c.C);olympe.sc.logic.$c.prototype.C.L=new olympe.D.J(()=>olympe.dc.CloudObject,[]);olympe.sc.logic.dh=class extends olympe.sc.logic.$c{};olympe.sc.logic.dh.P=olympe.dc.na.C('016ac4f59c592b862457',olympe.sc.logic.dh);olympe.sc.logic.dh.G=olympe.sc.bd.C.Vb();olympe.sc.logic.dh.P.C=(a,b,c,d,e)=>{b=yk(a,b||'New Predefined Input',olympe.sc.logic.dh,olympe.sc.logic.qb);Z(b,olympe.sc.logic.$c.F,e);a.Ea(olympe.sc.logic.$c.C,b,c);a.Ea(olympe.sc.bd.C,d,b);return b.X()};olympe.sc.logic.mg=class extends olympe.sc.logic.$c{};olympe.sc.logic.mg.P=olympe.dc.na.C('016ac4f59dd99f5df3e1',olympe.sc.logic.mg);olympe.sc.logic.mg.G=U(olympe.sc.logic.mg.P,olympe.sc.bd.F);olympe.sc.logic.mg.P.C=(a,b,c,d,e)=>{b=yk(a,b||'New Predefined Output',olympe.sc.logic.mg,olympe.sc.logic.zb);Z(b,olympe.sc.logic.$c.F,e);a.Ea(olympe.sc.logic.$c.C,b,c);a.Ea(olympe.sc.bd.F,d,b);return b.X()};olympe.sc.logic.nd=class extends olympe.sc.Ua{ke(){return olympe.sc.td.ue.qq}Z(){return this.ym().Yj().tc([olympe.sc.logic.Function]).and().jd().tc([olympe.sc.logic.Vc,olympe.sc.logic.Yc]).$h()}G(){const a=olympe.dc.ga(olympe.sc.logic.Ph);return this.db.ab(this,olympe.sc.logic.nd.F).filter(b=>this.db.Ib(b,olympe.sc.logic.Rb.typeRel)===a)}C(a){const b=this.db.um(this,[olympe.sc.Ua.G],c=>this.db.model(c)===olympe.dc.ga(a));return b?olympe.dc.CloudObject.get(b):null}F(a){const b=this.db.um(this,[olympe.sc.Ua.F],
|
|
1017
|
+
c=>this.db.model(c)===olympe.dc.ga(a));return b?olympe.dc.CloudObject.get(b):null}};olympe.sc.logic.nd.P=ym('01621fb84e320000f000',olympe.sc.logic.nd,olympe.sc.logic.Function);olympe.sc.logic.nd.prototype.C.L=new olympe.D.J(()=>olympe.sc.logic.qb,[]);olympe.sc.logic.nd.prototype.F.L=new olympe.D.J(()=>olympe.sc.logic.zb,[]);olympe.sc.logic.Bf=class extends olympe.sc.logic.nd{K(){return this.C('016ac63229782039429f')}O(){return this.F('016ac6322acf67eebfe7')}T(){return this.cp().Yj().cb(olympe.sc.logic.Rb.typeRel).jk(olympe.sc.logic.Ph).$h().cf().Mm(olympe.D.aa.ZERO)}};olympe.sc.logic.Bf.C='016ac63229782039429f';olympe.sc.logic.Bf.K='016ac6322acf67eebfe7';olympe.sc.logic.Bf.P=ym('01621fb84e320000a000',olympe.sc.logic.Bf,olympe.sc.logic.Action);olympe.sc.logic.Bf.prototype.K.L=new olympe.D.J(()=>olympe.sc.logic.qb,[]);
|
|
1018
|
+
olympe.sc.logic.Bf.prototype.O.L=new olympe.D.J(()=>olympe.sc.logic.zb,[]);olympe.sc.logic.Bf.prototype.T.L=olympe.D.J.O;olympe.sc.logic.Qn=class extends olympe.sc.logic.nd{};olympe.sc.logic.Qn.P=ym('01621fb84e320000f011',olympe.sc.logic.Qn);olympe.sc.logic.Pn=class extends olympe.sc.logic.Bf{};olympe.sc.logic.Pn.P=ym('01621fb84e320000f012',olympe.sc.logic.Pn);olympe.sc.logic.Function=class extends olympe.sc.Runnable{O(){return[this.Ab]}T(){const a=olympe.sc.bg.C.jl,b=olympe.sc.bg.C.Al,c=this.db,d=new Map,e=this.bc();c.ab(e,olympe.sc.Ua.G).forEach(f=>{d.set(a+c.name(f),f)});c.ab(e,olympe.sc.Ua.F).forEach(f=>{d.set(b+c.name(f),f)});return d}C(a){const b=olympe.dc.ga(olympe.sc.logic.aj),c=olympe.dc.ga(olympe.sc.logic.Ph);return this.getOutputs().map(d=>{switch(this.db.Ib(d,olympe.sc.logic.Rb.typeRel)){case b:return a.an.bind(a,d);case c:return a.throw.bind(a);
|
|
1019
|
+
default:return a.set.bind(a,d)}})}setupExecution(a){const b=this.getInputs();return 0<b.length?rxjs.combineLatest(b.map(c=>a.observe(c))).pipe(rxjs.operators.map(c=>c.includes(null)?null:c)):rxjs.of([])}};olympe.sc.logic.Function.P=olympe.dc.na.C('0168c6f020f2a96f0000',olympe.sc.logic.Function,olympe.sc.R.Ca);olympe.sc.logic.Rb=class extends olympe.dc.CloudObject{getType(){return this.oc(olympe.sc.logic.Rb.typeRel,olympe.dc.CloudObject)}C(){return this.Sc(olympe.sc.logic.Rb.C)}};olympe.sc.logic.Rb.P=olympe.dc.na.C('0168a431d25001540000',olympe.sc.logic.Rb);olympe.sc.logic.Rb.C=olympe.sc.logic.Rb.P.la('01740c5d4ae4b520dd01');olympe.sc.logic.Rb.typeRel=olympe.sc.logic.Rb.P.sa('0168a431d3b9b7438424');U(olympe.dc.CloudObject.P,olympe.sc.logic.Rb.typeRel);
|
|
1020
|
+
olympe.sc.logic.Rb.prototype.getType.L=new olympe.D.J(()=>olympe.dc.CloudObject,[]);olympe.sc.logic.Rb.prototype.C.L=olympe.D.J.G;olympe.sc.logic.qb=class extends olympe.sc.logic.Rb{};olympe.sc.logic.qb.P=olympe.dc.na.C('0168a431d25001540001',olympe.sc.logic.qb);olympe.sc.logic.qb.T=olympe.sc.logic.Rb.P.la('01740c5d4ae4b520dd02');olympe.sc.logic.qb.O=U(olympe.sc.logic.qb.P,olympe.sc.Ua.G);olympe.sc.logic.qb.F=olympe.sc.logic.qb.P.sa('0168a431d91f2578000b',olympe.dc.ua.ORIGIN);olympe.sc.logic.qb.G=olympe.sc.logic.qb.P.sa('01621fb84e32000000a1',olympe.dc.ua.ORIGIN);
|
|
1021
|
+
olympe.sc.logic.qb.K=olympe.sc.logic.qb.P.sa('01621fb84e32000000d1',olympe.dc.ua.ORIGIN);olympe.sc.logic.qb.P.C=function(a,b,c,d,e,f=olympe.sc.logic.qb){f=a.create(f);Z(f,olympe.dc.CloudObject.nameProp,b||'New input');a.Ea(olympe.sc.logic.Rb.typeRel,f,c);void 0!==e&&Z(f,olympe.sc.logic.Rb.C,e);d&&a.Ea(olympe.sc.Ua.G,d,f);return f.X()};olympe.sc.logic.zb=class extends olympe.sc.logic.Rb{};olympe.sc.logic.zb.P=olympe.dc.na.C('0168a431d25001540002',olympe.sc.logic.zb);olympe.sc.logic.zb.O=U(olympe.sc.logic.zb.P,olympe.sc.Ua.F);olympe.sc.logic.zb.F=olympe.sc.logic.zb.P.sa('0168a431d91f25780003',olympe.dc.ua.ORIGIN);olympe.sc.logic.zb.K=olympe.sc.logic.zb.P.sa('01621fb84e32000000a2',olympe.dc.ua.ORIGIN);olympe.sc.logic.zb.G=olympe.sc.logic.zb.P.sa('01621fb84e32000000d2',olympe.dc.ua.ORIGIN);
|
|
1022
|
+
olympe.sc.logic.zb.P.C=function(a,b,c,d,e,f=olympe.sc.logic.zb){f=a.create(f);Z(f,olympe.dc.CloudObject.nameProp,b||'New output');a.Ea(olympe.sc.logic.Rb.typeRel,f,c);void 0!==e&&Z(f,olympe.sc.logic.Rb.C,e);d&&a.Ea(olympe.sc.Ua.F,d,f);return f.X()};olympe.sc.logic.Action=class extends olympe.sc.logic.Function{setupExecution(a){const b=this.qd().K().X();return a.observe(b).pipe(rxjs.operators.map(c=>null===c?null:this.getInputs().filter(d=>d!==b).map(d=>a.get(d))))}};olympe.sc.logic.Action.P=olympe.dc.na.C('0168c6f020f2a96a0000',olympe.sc.logic.Action,olympe.sc.R.Ca);olympe.sc.logic.Vc=class extends olympe.sc.logic.Function{run(a){lm(this,a);const b=a.getParent(),c=this.db.Ib(this,olympe.sc.logic.Vc.G),d=this.db.Ib(this,olympe.sc.logic.Vc.F);a.on(c,e=>b.set(d,e),this.tag)}za(){return this.oc(olympe.sc.logic.Vc.G,olympe.sc.logic.qb)}Ta(){return this.oc(olympe.sc.logic.Vc.F,olympe.sc.logic.zb)}};olympe.sc.logic.Vc.P=olympe.dc.na.C('01621fb84e32000000a0',olympe.sc.logic.Vc,olympe.sc.R.Ca);olympe.sc.logic.Vc.G=U(olympe.sc.logic.Vc.P,olympe.sc.logic.qb.G);
|
|
1023
|
+
olympe.sc.logic.Vc.F=U(olympe.sc.logic.Vc.P,olympe.sc.logic.zb.K);olympe.sc.logic.Vc.P.C=function(a,b,c){b=a.create(olympe.sc.logic.Vc);a.Ea(olympe.sc.logic.Vc.F,b,c);return b.X()};olympe.sc.logic.Vc.prototype.za.L=new olympe.D.J(()=>olympe.sc.logic.qb,[]);olympe.sc.logic.Vc.prototype.Ta.L=new olympe.D.J(()=>olympe.sc.logic.zb,[]);olympe.sc.logic.Yc=class extends olympe.sc.logic.Function{run(a){const b=a.getParent(),c=this.db.Ib(this,olympe.sc.logic.Yc.F),d=this.db.Ib(this,olympe.sc.logic.Yc.G);b.on(c,e=>a.set(d,e),b.V())}Ta(){return this.oc(olympe.sc.logic.Yc.F,olympe.sc.logic.qb)}za(){return this.oc(olympe.sc.logic.Yc.G,olympe.sc.logic.zb)}};olympe.sc.logic.Yc.P=olympe.dc.na.C('01621fb84e32000000d0',olympe.sc.logic.Yc,olympe.sc.R.Ca);olympe.sc.logic.Yc.F=U(olympe.sc.logic.Yc.P,olympe.sc.logic.qb.K);
|
|
1024
|
+
olympe.sc.logic.Yc.G=U(olympe.sc.logic.Yc.P,olympe.sc.logic.zb.G);olympe.sc.logic.Yc.P.C=function(a,b,c){b=a.create(olympe.sc.logic.Yc);a.Ea(olympe.sc.logic.Yc.F,b,c);return b.X()};olympe.sc.logic.Yc.prototype.Ta.L=new olympe.D.J(()=>olympe.sc.logic.qb,[]);olympe.sc.logic.Yc.prototype.za.L=new olympe.D.J(()=>olympe.sc.logic.zb,[]);function qm(a,b,c){const d=a.db.Ib(a,olympe.sc.logic.mb.T)||a.db.Ib(a,olympe.sc.logic.mb.K),e=a.db.Ib(a,olympe.sc.logic.mb.O),f=a.db.Ig(zm(a),olympe.dm.Ie)?new olympe.D.Yb('Pipe Context'):null,g=a.C.bind(a,c,f);if(null!==d&&null!==e){let k;const l=b.qk(e,n=>{k&&k();k=n.on(d,g,e)});return()=>{g(null);l();k&&k()}}const h=$f(a.db,a,olympe.sc.logic.mb.valueProp,g);return()=>{g(null);ag(a.db,a,olympe.sc.logic.mb.valueProp,h)}}
|
|
1025
|
+
function zm(a){let b=null,c=a.db.Ib(a,olympe.sc.logic.mb.F);c?b=a.db.Ib(c,olympe.dm.Property.typeRel):(c=a.db.Ib(a,olympe.sc.logic.mb.C))&&(b=a.db.Ib(c,olympe.sc.logic.Rb.typeRel));return b||olympe.dc.ga(olympe.dc.CloudObject)}
|
|
1026
|
+
olympe.sc.logic.mb=class extends olympe.dc.CloudObject{constructor(a,b,c){super(a,b);this.H=c}C(a,b,c){const d=olympe.sc.Ag(c);null==b||b.oa();b&&d instanceof olympe.dm.Ie?null==b||b.run(()=>{olympe.D.Nc([d.getValue()],e=>{a(e.valueOf())})}):a(d)}getValue(a){return this.wf(olympe.sc.logic.mb.valueProp,a||olympe.dc.Jb.Ag,Object)}getType(){const a=this.transform(olympe.sc.logic.mb.C,olympe.sc.logic.Rb.typeRel);a.Bd(olympe.dc.CloudObject);return a.xc()}Fw(){return this.oc(olympe.sc.logic.mb.O,olympe.dc.CloudObject)}Dw(){return this.oc(olympe.sc.logic.mb.T,
|
|
1027
|
+
olympe.sc.logic.zb)}Ew(){return this.oc(olympe.sc.logic.mb.K,olympe.dm.Property)}Zv(){return this.oc(olympe.sc.logic.mb.G,olympe.dc.CloudObject)}Xv(){return this.oc(olympe.sc.logic.mb.C,olympe.sc.logic.qb)}Yv(){return this.oc(olympe.sc.logic.mb.F,olympe.dm.Property)}};olympe.sc.logic.mb.P=olympe.dc.na.C('0168a431d91f25780000',olympe.sc.logic.mb,olympe.sc.R.Ca);olympe.sc.logic.mb.valueProp=olympe.sc.logic.mb.P.la('0168a431d91f25780001');olympe.sc.logic.mb.O=olympe.sc.logic.mb.P.sa('0168a431d91f25780002');
|
|
1028
|
+
olympe.sc.logic.mb.T=U(olympe.sc.logic.mb.P,olympe.sc.logic.zb.F);olympe.sc.logic.mb.K=olympe.sc.logic.mb.P.sa('0168a431d91f25780004');olympe.sc.logic.mb.G=olympe.sc.logic.mb.P.sa('0168a431d91f2578000a');olympe.sc.logic.mb.C=U(olympe.sc.logic.mb.P,olympe.sc.logic.qb.F);olympe.sc.logic.mb.F=olympe.sc.logic.mb.P.sa('0168a431d91f2578000c');U(olympe.dc.CloudObject.P,olympe.sc.logic.mb.O);U(olympe.dm.Property.P,olympe.sc.logic.mb.K);U(olympe.dc.CloudObject.P,olympe.sc.logic.mb.G);
|
|
1029
|
+
U(olympe.dm.Property.P,olympe.sc.logic.mb.F);m=olympe.sc.logic.mb.prototype;m.getType.L=new olympe.D.J(()=>olympe.dc.CloudObject,[]);m.Fw.L=new olympe.D.J(()=>olympe.dc.CloudObject,[]);m.Dw.L=new olympe.D.J(()=>olympe.sc.logic.zb,[]);m.Ew.L=new olympe.D.J(()=>olympe.dm.Property,[]);m.Zv.L=new olympe.D.J(()=>olympe.dc.CloudObject,[]);m.Xv.L=new olympe.D.J(()=>olympe.sc.logic.qb,[]);m.Yv.L=new olympe.D.J(()=>olympe.dm.Property,[]);function Am(a,b){const c=a.qd(),d=c.ol().X(),e=c.pl().X(),f=c.ql().X();b.on(d,g=>{if(g){g=new Map(a.getInputs().map(k=>[k,b.get(k)]));const h={timeout:a.timeout};olympe.N.tb.get(a.bc(),g,h).then(k=>{for(const [l,n]of k)l!==e&&l!==f&&b.set(l,n);b.set(e,k.get(e));k=k.get(f);k instanceof olympe.sc.logic.Error&&(k=Ll(k.message,k.code,k.he()+'\n===== Remote Call =====\n'+b.he()),b.throw(k))}).catch(k=>{k=`RemoteAction "${a.Ec().name()}" (${a.tag}) encountered an error:\n${k}`;a.H.error(k);b.throw(olympe.sc.logic.Error.create(k,
|
|
1025
1030
|
400))})}},b.V())}
|
|
1026
|
-
function
|
|
1027
|
-
olympe.sc.logic.gh=class extends olympe.sc.logic.Function{constructor(a,b,c,d){super(a,b,c);this.timeout=d}run(a){let b;null!=(b=a.Qa(olympe.sc.wa.C.EDITION))&&b||(this.db.Ja(this,olympe.sc.logic.gh.F)?this.za(a):(
|
|
1028
|
-
k.destroy()},this.timeout);
|
|
1029
|
-
1))})},h=>{const k=this.bc();this.H.error(`Error while listening on remote action ${this.db.name(k)} (${k}): ${h.message}`)}))}};olympe.sc.logic.gh.P=olympe.dc.
|
|
1030
|
-
olympe.sc.logic.
|
|
1031
|
-
olympe.sc.logic.
|
|
1032
|
-
b,c);a.Ea(olympe.dc.CloudObject.containsRel,b,c)}};olympe.sc.
|
|
1033
|
-
olympe.sc.
|
|
1034
|
-
olympe.sc.workflow.ObjectState.dateTimeProp=olympe.sc.workflow.ObjectState.P.
|
|
1035
|
-
olympe.sc.workflow.ff.Fd='017ffe02381f9fac5062';olympe.sc.workflow.ff.za='017ffe02381f9fac5065';olympe.sc.workflow.ff.K='017ffe02381f9fac5063';olympe.sc.workflow.ff.Tb='017ffe02381f9fac5064';m=olympe.sc.workflow.ff.prototype;m.
|
|
1036
|
-
olympe.sc.workflow.Transition.P=olympe.dc.
|
|
1037
|
-
olympe.sc.workflow.Transition.prototype.C.L=new olympe.D.J(()=>olympe.sc.workflow.
|
|
1038
|
-
olympe.sc.workflow.Workflow.dataTypeRel=olympe.sc.workflow.Workflow.P.sa('017ffdc010e5bcc9c973');olympe.sc.workflow.Workflow.statesRel=olympe.sc.workflow.Workflow.P.sa('017ffdc010e5bcc9c974');olympe.sc.workflow.Workflow.initialStateRel=olympe.sc.workflow.Workflow.P.sa('017ffdc010e5bcc9c975');olympe.sc.workflow.Workflow.prototype.G.L=olympe.D.J.O;olympe.sc.workflow.Workflow.prototype.C.L=new olympe.D.J(()=>olympe.sc.
|
|
1039
|
-
olympe.sc.workflow.Workflow.prototype.F.L=new olympe.D.J(()=>olympe.sc.workflow.
|
|
1040
|
-
olympe.sc.
|
|
1041
|
-
olympe.sc.
|
|
1042
|
-
m.
|
|
1043
|
-
olympe.sc.
|
|
1044
|
-
typeof
|
|
1045
|
-
b,c);return this}fc(a,b,c){this.C.fc(a,b,c);return this}
|
|
1046
|
-
b(d)})})}
|
|
1047
|
-
olympe.sc.Wa.prototype.persist=olympe.sc.Wa.prototype.persist;olympe.sc.Wa.prototype.deleteAllRelations=olympe.sc.Wa.prototype.
|
|
1048
|
-
olympe.sc.Wa.prototype.getId=olympe.sc.Wa.prototype.V;olympe.sc.Wa.process=olympe.sc.Wa.process;olympe.sc.Wa.from=olympe.sc.Wa.from;olympe.sc.
|
|
1049
|
-
olympe.
|
|
1050
|
-
this.F.run()):this.H.error('No app registered under name: '+this.C)}};olympe.
|
|
1051
|
-
olympe.W.run([olympe.
|
|
1052
|
-
l&&h.
|
|
1053
|
-
d.run(f))})});e.add((f,g)=>{if(
|
|
1054
|
-
function
|
|
1055
|
-
null==(l=e)||l.cancel();b.update(olympe.D.ea.F);
|
|
1056
|
-
function
|
|
1057
|
-
function
|
|
1058
|
-
olympe.sc.
|
|
1059
|
-
a||(a=!0,
|
|
1060
|
-
b[olympe.net.Ba.Headers.
|
|
1061
|
-
h:h.message}`,olympe.net.Ba.Zb.
|
|
1062
|
-
typeof f)try{f=JSON.parse(f)}catch(h){d.H.warn(`Invalid manifest app config for app: ${e}`),f={}}e=Object.assign({},g,d.C,f);return new olympe.net.
|
|
1063
|
-
olympe.sc.
|
|
1064
|
-
new olympe.dc.Wa;Se(d).forEach(f=>{e.Ea(olympe.dm.DataSource.
|
|
1065
|
-
olympe.W.config(function(a){E(a,olympe.
|
|
1066
|
-
olympe.sc.
|
|
1067
|
-
olympe.N.R.
|
|
1068
|
-
olympe.
|
|
1069
|
-
d)}static
|
|
1070
|
-
b).set('password',c),olympe.auth.
|
|
1071
|
-
c),olympe.auth.
|
|
1072
|
-
olympe.public.Ia.loginToken=olympe.public.Ia.
|
|
1073
|
-
olympe.public.Ia.getToken=olympe.public.Ia.
|
|
1074
|
-
olympe.public.
|
|
1075
|
-
olympe.public.Process.connect=olympe.public.Process.connect;olympe.public.Process.onShutdown=olympe.public.Process.
|
|
1076
|
-
Context:olympe.sc.wa,Entry:olympe.dc.Ma.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.
|
|
1077
|
-
WorkflowObjectState:olympe.sc.workflow.ObjectState,Transaction:olympe.sc.Wa,BurstTransaction:olympe.dc.Kh,TransactionResult:olympe.sc.
|
|
1078
|
-
olympe.dc.sources.
|
|
1079
|
-
GUEST:olympe.auth.Sa.C.Rh,AUTHENTICATED:olympe.auth.Sa.C.
|
|
1080
|
-
instanceToTag:olympe.dc.ga,registerSync:olympe.dc.
|
|
1081
|
-
Greater:olympe.dc.$.
|
|
1031
|
+
function Bm(a,b,c,d,e,f){const g=n=>v(function*(){if(null!==n){e.cancel();let p;null==(p=k)||p();let q;null==(q=l)||q();try{const r=new Map(a.getOutputs().map(t=>[t,b.get(t)]));yield f.kd(r)}catch(r){const t=Error(`Error while trying to send the response of remote action ${a.Ec().name()} (${a.bc()}): ${r}`);f.sh(t).catch(u=>{a.H.error(`Cannot reply with an error to a remote action call ${a.Ec().name()} (${a.bc()}): ${u}`)})}finally{b.destroy()}}}),h=b.V(),k=b.on(c,g,h),l=b.on(d,g,h)}
|
|
1032
|
+
olympe.sc.logic.gh=class extends olympe.sc.logic.Function{constructor(a,b,c,d){super(a,b,c);this.timeout=d}run(a){let b;null!=(b=a.Qa(olympe.sc.wa.C.EDITION))&&b||(this.db.Ja(this,olympe.sc.logic.gh.F)?this.za(a):(lm(this,a),Am(this,a)))}za(a){const b=this.bc(),c=this.qd(),d=c.ep().X(),e=c.ol().X(),f=c.pl().X(),g=c.ql().X();(new olympe.N.tb(b,a)).listen().subscribe(rxjs.Subscriber.create(h=>{const k=a.qh('remote call'),l=h.body(),n=Wb(()=>{h.sh(Error(`Timeout reached on remote action ${this.db.name(this)} (${this.tag})`));
|
|
1033
|
+
k.destroy()},this.timeout);Bm(this,k,f,g,n,h);super.run(k);for(const [p,q]of l)p!==e&&k.set(p,q);h.Fh().then(p=>{var q=k.get(d);null!==q&&olympe.dc.ga(q)!==p&&(q=this.bc(),this.H.warn(`Remote action ${this.db.name(q)} ${q}: try to run it with an input user that is not the real authenticated user.`));k.set(d,p);k.set(e,l.get(e))}).catch(p=>{const q=this.bc();this.H.warn(`Remote action ${this.db.name(q)} ${q} Triggered by unrecognized user: ${p}.`);k.set(g,olympe.sc.logic.Error.create('Unrecognized User',
|
|
1034
|
+
1))})},h=>{const k=this.bc();this.H.error(`Error while listening on remote action ${this.db.name(k)} (${k}): ${h.message}`)}))}};olympe.sc.logic.gh.P=olympe.dc.na.C('017a7b0c5dcbd8964c5d',olympe.sc.logic.gh,olympe.sc.R.Ca,new olympe.W.ka(olympe.sc.U.Vp));olympe.sc.logic.gh.F=olympe.sc.logic.gh.P.la('017a7b0c62a02a89444f');olympe.sc.logic.controllers={};olympe.sc.logic.controllers.kl=class{constructor(a){this.db=olympe.dc.ja();this.typeRel=a}};olympe.sc.logic.controllers.kl.C={vy:-1,wz:1};olympe.sc.logic.controllers.jA=class extends olympe.sc.logic.controllers.kl{constructor(){super(olympe.sc.logic.$c.C)}};olympe.sc.logic.controllers.qA=class extends olympe.sc.logic.controllers.kl{constructor(){super(olympe.sc.logic.Rb.typeRel)}};olympe.sc.logic.bk={};olympe.sc.logic.bk.Au=class extends olympe.sc.logic.Function{update(a,[b],[c]){const d=olympe.dc.ga(b);d?olympe.dc.pa.hc(a,d,olympe.dc.cc.Kf).subscribe(()=>{c(olympe.dc.CloudObject.get(d))}):this.H.warn('Cannot subscribe to an instance with no tag: '+d)}};olympe.sc.logic.na.C('0174bf4b7e006e4b788a',olympe.sc.logic.bk.Au);olympe.sc.logic.actions={};olympe.sc.logic.bk.Ct=class extends olympe.sc.logic.Function{run(a){lm(this,a);const [b,c,d]=this.C(a);let e,f=null,g=null;const h=a.getParent(),k=()=>{null===g||0===e?(this.H.warn('No list to iter upon'),this.H.info(a.V())):f<e?(b(g.Re(f)),f++,c(Date.now())):(am(h.C),d(Date.now()))};this.getInputs().forEach((l,n)=>a.on(l,p=>{if(p)switch(n){case 0:g=p;break;case 1:e=g.Rf();f=0;$l(h.C);k();break;case 2:k();break;default:this.H.error('Unhandled input')}},this.tag))}};
|
|
1035
|
+
olympe.sc.logic.na.C('0171889b060b6cd54300',olympe.sc.logic.bk.Ct);olympe.sc.logic.Ob={};olympe.sc.logic.Ob.Yk=class extends olympe.sc.logic.nd{K(){return this.C('016ac638085357047a2d')}};olympe.sc.logic.Ob.Yk.P=ym('0169b6876a03f14ae61b',olympe.sc.logic.Ob.Yk);olympe.sc.logic.Ob.Yk.prototype.K.L=new olympe.D.J(()=>olympe.sc.logic.qb,[]);olympe.sc.logic.Ob.ll=class extends olympe.sc.logic.nd{K(){return this.C('016ac63808535703691c')}};olympe.sc.logic.Ob.ll.P=ym('0169b6876a03f139d50a',olympe.sc.logic.Ob.ll);olympe.sc.logic.Ob.ll.prototype.K.L=new olympe.D.J(()=>olympe.sc.logic.qb,[]);olympe.sc.logic.Ob.Bl=class extends olympe.sc.logic.nd{K(){return this.C('016ac63809a9a8e6db96')}O(){return this.F('016ac6380ab003363b3e')}};ym('01646ad602f933b8caaf',olympe.sc.logic.Ob.Bl);olympe.sc.logic.Ob.Bl.prototype.K.L=new olympe.D.J(()=>olympe.sc.logic.qb,[]);olympe.sc.logic.Ob.Bl.prototype.O.L=new olympe.D.J(()=>olympe.sc.logic.zb,[]);olympe.sc.logic.Ob.vj=class extends olympe.sc.logic.nd{K(){return this.C('016ac6380bd98f1d91a0')}T(){return this.F('016ac63c589ae38ca3ae')}O(){return this.F('016ac63c5a377fceabaa')}};ym('0168ec42fc01747a98b6',olympe.sc.logic.Ob.vj);olympe.sc.logic.Ob.vj.prototype.K.L=new olympe.D.J(()=>olympe.sc.logic.qb,[]);olympe.sc.logic.Ob.vj.prototype.T.L=new olympe.D.J(()=>olympe.sc.logic.zb,[]);olympe.sc.logic.Ob.vj.prototype.O.L=new olympe.D.J(()=>olympe.sc.logic.zb,[]);olympe.sc.logic.Ob.qg=class extends olympe.sc.logic.nd{ol(){return this.C('017a7b07b09e3b22c8b4')}ep(){return this.C('017a7b07ba05807a74b0')}pl(){return this.F('017a7b0818c12388d731')}ql(){return this.F('017a7b085146d5e69aec')}lt(){return olympe.D.ea.F}};olympe.sc.logic.Ob.qg.K='017a7b07b09e3b22c8b4';olympe.sc.logic.Ob.qg.Tb='017a7b07ba05807a74b0';olympe.sc.logic.Ob.qg.za='017a7b0818c12388d731';olympe.sc.logic.Ob.qg.C='017a7b085146d5e69aec';
|
|
1036
|
+
olympe.sc.logic.Ob.qg.P=ym('017a7b07a948e30508fa',olympe.sc.logic.Ob.qg,olympe.sc.logic.gh);m=olympe.sc.logic.Ob.qg.prototype;m.ol.L=new olympe.D.J(()=>olympe.sc.logic.qb,[]);m.ep.L=new olympe.D.J(()=>olympe.sc.logic.qb,[]);m.pl.L=new olympe.D.J(()=>olympe.sc.logic.zb,[]);m.ql.L=new olympe.D.J(()=>olympe.sc.logic.zb,[]);m.lt.L=olympe.D.J.O;olympe.sc.logic.Ob.vq=class extends olympe.sc.logic.nd{K(){return this.C('016ac63c5b3ed0562740')}};ym('016a9766c230916ea5ec',olympe.sc.logic.Ob.vq);olympe.sc.logic.Ob.vq.prototype.K.L=new olympe.D.J(()=>olympe.sc.logic.qb,[]);olympe.sc.query={};olympe.sc.query.qn=class extends olympe.sc.jg{};olympe.sc.query.qn.P=olympe.dc.na.C('01631aacd8276ea98491',olympe.sc.query.qn);olympe.sc.query.Fp=class extends olympe.dm.Enum{};olympe.sc.query.Fp.P=olympe.dc.na.C('01631aacd8276ea98495',olympe.sc.query.Fp);olympe.sc.query.Pp=class extends olympe.dm.Enum{};olympe.sc.query.Pp.P=olympe.dc.na.C('01631aacd8276ea98494',olympe.sc.query.Pp);olympe.sc.query.Qp=class extends olympe.sc.jg{};olympe.sc.query.Qp.P=olympe.dc.na.C('01631aacd8276ea98492',olympe.sc.query.Qp);olympe.sc.query.Rc=class extends olympe.dc.CloudObject{};olympe.sc.query.Rc.P=olympe.dc.na.C('01631aacd8276ea98493',olympe.sc.query.Rc);olympe.sc.Un=class extends olympe.dc.CloudObject{};olympe.sc.Un.P=olympe.dc.na.C('018312ceeb3e93618a85',olympe.sc.Un);olympe.sc.Kb={};olympe.sc.Kb.Comment=class extends olympe.dm.BrickMetadata{getType(){return this.vb(olympe.sc.Kb.Comment.K)}F(){return this.vb(olympe.sc.Kb.Comment.G)}C(){return new olympe.D.Sb(this.Sc(olympe.sc.Kb.Comment.O),this.Sc(olympe.sc.Kb.Comment.F))}static Lc(a,b,c,...d){c=d[0];d=d[1];b=a.create(b);b.X();a.Ea(olympe.dc.CloudObject.containsRel,c,b);a.Ea(olympe.sc.Kb.Comment.C,b,c);c=a.create(olympe.sc.ui.td.Op);Z(c,olympe.sc.ui.td.Op.WC,d.ap());Z(c,olympe.sc.ui.td.Op.XC,d.bp());a.Ea(olympe.dm.BrickMetadata.fa,
|
|
1037
|
+
b,c);a.Ea(olympe.dc.CloudObject.containsRel,b,c)}};olympe.sc.Kb.Comment.Z=100;olympe.sc.Kb.Comment.T=66;olympe.sc.Kb.Comment.P=olympe.dc.na.C('0184bd886ee1c7adfe09',olympe.sc.Kb.Comment);olympe.sc.Kb.Comment.K=olympe.sc.Kb.Comment.P.la('0184c80e29ed08a16c5e');olympe.sc.Kb.Comment.G=olympe.sc.Kb.Comment.P.la('0184bd889f33359cfe75');olympe.sc.Kb.Comment.O=olympe.sc.Kb.Comment.P.la('0184c3f9406e25a41512');olympe.sc.Kb.Comment.F=olympe.sc.Kb.Comment.P.la('0184c3f942e4cc136ce8');
|
|
1038
|
+
olympe.sc.Kb.Comment.C=olympe.sc.Kb.Comment.P.sa('0184be3f135a83fd6cc3');olympe.sc.Kb.Comment.prototype.getType.L=olympe.D.J.F;olympe.sc.Kb.Comment.prototype.F.L=olympe.D.J.F;olympe.sc.Kb.Comment.prototype.C.L=olympe.D.J.T;olympe.sc.Kb.Nk=class extends olympe.dm.Enum{};olympe.sc.Kb.Nk.C={ky:'Comment',wB:'Todo'};olympe.sc.Kb.Nk.P=olympe.dc.na.C('0184cc42e06205501bc7',olympe.sc.Kb.Nk);olympe.sc.workflow={};olympe.sc.workflow.ObjectState=class extends olympe.dc.CloudObject{};olympe.sc.workflow.ObjectState.P=olympe.dc.na.C('017ffdd8f0b1e31fe138',olympe.sc.workflow.ObjectState);olympe.sc.workflow.ObjectState.workflowProp=olympe.sc.workflow.ObjectState.P.la('017ffdd8f0b1e31fe13e');olympe.sc.workflow.ObjectState.stateProp=olympe.sc.workflow.ObjectState.P.la('017ffdd8f0b1e31fe139');olympe.sc.workflow.ObjectState.assigneeProp=olympe.sc.workflow.ObjectState.P.la('017ffdd8f0b1e31fe13a');
|
|
1039
|
+
olympe.sc.workflow.ObjectState.dateTimeProp=olympe.sc.workflow.ObjectState.P.la('017ffdd8f0b1e31fe13b');olympe.sc.workflow.ObjectState.serializedObjectProp=olympe.sc.workflow.ObjectState.P.la('017ffdd8f0b1e31fe13d');olympe.sc.workflow.ObjectState.objectRel=olympe.sc.workflow.ObjectState.P.sa('017ffdd8f0b1e31fe13c');olympe.sc.workflow.ObjectState.currentObjectRel=olympe.sc.workflow.ObjectState.P.sa('017ffdd8f0b1e31fe13f');olympe.sc.workflow.ff=class extends olympe.sc.logic.nd{mt(){return this.C('017ffe02381f9fac5060')}pt(){return this.C('017ffe02381f9fac5061')}qt(){return this.C('017ffe02381f9fac5062')}Vv(){return this.C('017ffe02381f9fac5065')}nt(){return this.F('017ffe02381f9fac5063')}ot(){return this.F('017ffe02381f9fac5064')}};olympe.sc.workflow.ff.P=ym('017ffde21f5fe0f704ce',olympe.sc.workflow.ff);olympe.sc.workflow.ff.C='017ffe02381f9fac5060';olympe.sc.workflow.ff.ed='017ffe02381f9fac5061';
|
|
1040
|
+
olympe.sc.workflow.ff.Fd='017ffe02381f9fac5062';olympe.sc.workflow.ff.za='017ffe02381f9fac5065';olympe.sc.workflow.ff.K='017ffe02381f9fac5063';olympe.sc.workflow.ff.Tb='017ffe02381f9fac5064';m=olympe.sc.workflow.ff.prototype;m.mt.L=new olympe.D.J(()=>olympe.sc.logic.qb,[]);m.pt.L=new olympe.D.J(()=>olympe.sc.logic.qb,[]);m.qt.L=new olympe.D.J(()=>olympe.sc.logic.qb,[]);m.Vv.L=new olympe.D.J(()=>Map,[]);m.nt.L=new olympe.D.J(()=>olympe.sc.logic.zb,[]);m.ot.L=new olympe.D.J(()=>olympe.sc.logic.zb,[]);olympe.sc.workflow.Me=class extends olympe.dm.BrickMetadata{Hc(){return this.oc(olympe.sc.workflow.Workflow.statesRel.Vb(),olympe.sc.workflow.Workflow).ia().concat(['.',this.ia()])}};olympe.sc.workflow.Me.P=olympe.dc.na.C('017ffdc2dda51d46b430',olympe.sc.workflow.Me);olympe.sc.workflow.Transition=class extends olympe.dc.CloudObject{F(){return this.qr()}C(){return this.oc(olympe.sc.workflow.Transition.fromStateRel,olympe.sc.workflow.Me)}G(){return this.oc(olympe.sc.workflow.Transition.toStateRel,olympe.sc.workflow.Me)}Hc(){const a=this.oc(olympe.sc.workflow.Transition.fromStateRel,olympe.sc.workflow.Me);return a.oc(olympe.sc.workflow.Workflow.statesRel.Vb(),olympe.sc.workflow.Workflow).ia().concat(['.',a.ia(),'->',this.ia()])}};
|
|
1041
|
+
olympe.sc.workflow.Transition.P=olympe.dc.na.C('017ffdc633219f16beea',olympe.sc.workflow.Transition);olympe.sc.workflow.Transition.processRefProp=olympe.sc.workflow.Transition.P.la('017ffdc633219f16beec');olympe.sc.workflow.Transition.fromStateRel=olympe.sc.workflow.Transition.P.sa('017ffdc2dda51d46b431');olympe.sc.workflow.Transition.toStateRel=olympe.sc.workflow.Transition.P.sa('017ffdc633219f16beeb');olympe.sc.workflow.Transition.prototype.F.L=new olympe.D.J(()=>olympe.dc.CloudObject,[]);
|
|
1042
|
+
olympe.sc.workflow.Transition.prototype.C.L=new olympe.D.J(()=>olympe.sc.workflow.Me,[]);olympe.sc.workflow.Transition.prototype.G.L=new olympe.D.J(()=>olympe.sc.workflow.Me,[]);olympe.sc.workflow.Workflow=class extends olympe.dm.BrickMetadata{ke(){return olympe.sc.td.ue.Sg}G(){return this.xh(olympe.sc.workflow.Workflow.serializationEnabledProp)}C(){return this.oc(olympe.sc.workflow.Workflow.dataTypeRel,olympe.sc.Xc)}F(){return this.oc(olympe.sc.workflow.Workflow.initialStateRel,olympe.sc.workflow.Me)}};olympe.sc.workflow.Workflow.P=olympe.dc.na.C('017ffdc010e5bcc9c971',olympe.sc.workflow.Workflow);olympe.sc.workflow.Workflow.serializationEnabledProp=olympe.sc.workflow.Workflow.P.la('017ffdc010e5bcc9c972');
|
|
1043
|
+
olympe.sc.workflow.Workflow.dataTypeRel=olympe.sc.workflow.Workflow.P.sa('017ffdc010e5bcc9c973');olympe.sc.workflow.Workflow.statesRel=olympe.sc.workflow.Workflow.P.sa('017ffdc010e5bcc9c974');olympe.sc.workflow.Workflow.initialStateRel=olympe.sc.workflow.Workflow.P.sa('017ffdc010e5bcc9c975');olympe.sc.workflow.Workflow.prototype.G.L=olympe.D.J.O;olympe.sc.workflow.Workflow.prototype.C.L=new olympe.D.J(()=>olympe.sc.Xc,[]);
|
|
1044
|
+
olympe.sc.workflow.Workflow.prototype.F.L=new olympe.D.J(()=>olympe.sc.workflow.Me,[]);olympe.sc.qa={};olympe.sc.qa.Jc=class extends olympe.sc.Ua{ke(){return olympe.sc.td.ue.nu}};olympe.sc.qa.Jc.P=olympe.dc.na.C('01120300000000adef00',olympe.sc.qa.Jc);olympe.sc.qa.Jc.C=olympe.sc.qa.Jc.P.sa('0171bc1f15da96dfdb89');olympe.sc.qa.Jc.za=olympe.sc.qa.Jc.P.sa('0171bc1f15da96dfdb90');U(olympe.dm.Cc.P,olympe.sc.qa.Jc.C);olympe.sc.qa.Ih=class extends olympe.sc.Runnable{G(){return[this.bc()]}za(){return olympe.dc.ad.from(this.bc()).cb(olympe.sc.qa.Jc.C).hd()}};olympe.sc.qa.Ih.P=ff(olympe.dc.na.C('0113030000000aca1100',olympe.sc.qa.Ih));olympe.sc.qa.Ih.prototype.za.L=new olympe.D.J(()=>olympe.dm.rb,[]);olympe.sc.qa.jb=class extends olympe.dc.CloudObject{st(){return this.xh(olympe.sc.qa.jb.nh)}ex(){return this.xh(olympe.sc.qa.jb.oa)}yc(){return this.Sc(olympe.sc.qa.jb.C)}aw(){return this.vb(olympe.sc.qa.jb.K)}xw(){return this.vb(olympe.sc.qa.jb.fa)}ww(){return this.vb(olympe.sc.qa.jb.Z)}xe(){return this.vb(olympe.sc.qa.jb.ba)}mw(){return this.vb(olympe.sc.qa.jb.O)}Lv(){return this.vb(olympe.sc.qa.jb.F)}vw(){return this.vb(olympe.sc.qa.jb.T)}rt(){return this.vb(olympe.sc.qa.jb.G)}};
|
|
1045
|
+
olympe.sc.qa.jb.P=olympe.dc.na.C('011203300000000adef5',olympe.sc.qa.jb);olympe.sc.qa.jb.nh=olympe.sc.qa.jb.P.la('011203300000000adef6');olympe.sc.qa.jb.oa=olympe.sc.qa.jb.P.la('011203300000000adef7');olympe.sc.qa.jb.C=olympe.sc.qa.jb.P.la('011203300000000adef8');olympe.sc.qa.jb.K=olympe.sc.qa.jb.P.la('011203300000000adef9');olympe.sc.qa.jb.fa=olympe.sc.qa.jb.P.la('011203300000000adefa');olympe.sc.qa.jb.Z=olympe.sc.qa.jb.P.la('011203300000000adefb');olympe.sc.qa.jb.F=olympe.sc.qa.jb.P.la('011203300000000adefc');
|
|
1046
|
+
olympe.sc.qa.jb.ba=olympe.sc.qa.jb.P.la('011203300000000adefd');olympe.sc.qa.jb.O=olympe.sc.qa.jb.P.la('011203300000000adefe');olympe.sc.qa.jb.T=olympe.sc.qa.jb.P.la('011203300000000adeff');olympe.sc.qa.jb.G=olympe.sc.qa.jb.P.la('011203300000000adee0');olympe.sc.qa.jb.Mb={INIT:0,jy:1,Nj:2,Mj:3,Ol:4,KA:5,Eb:9};m=olympe.sc.qa.jb.prototype;m.st.L=olympe.D.J.O;m.ex.L=olympe.D.J.O;m.yc.L=olympe.D.J.G;m.aw.L=olympe.D.J.F;m.xw.L=olympe.D.J.F;m.ww.L=olympe.D.J.F;m.xe.L=olympe.D.J.F;m.mw.L=olympe.D.J.F;
|
|
1047
|
+
m.Lv.L=olympe.D.J.F;m.vw.L=olympe.D.J.F;m.rt.L=olympe.D.J.F;olympe.sc.qa.hl=class extends olympe.sc.qa.Ih{F(a){a.set(olympe.sc.wa.C.en,!0);super.F(a)}oa(){return!0}};olympe.sc.qa.hl.P=olympe.dc.na.C('0113032000000aca1102',olympe.sc.qa.hl,olympe.sc.R.Ca);olympe.sc.qa.Le=class extends olympe.sc.qa.Jc{C(){return(new olympe.dc.pj(this.X(),olympe.sc.qa.jb)).cb(olympe.sc.qa.Le.K).$h().xc()}};olympe.sc.qa.Le.P=olympe.dc.na.C('011203300000000adef3',olympe.sc.qa.Le);olympe.sc.qa.Le.K=olympe.sc.qa.Le.P.sa('011203300000000adef4');U(olympe.sc.qa.jb.P,olympe.sc.qa.Le.K);
|
|
1048
|
+
olympe.sc.qa.Le.P.C=(a,b,c)=>{b=yk(a,b||'New Service Application model',olympe.sc.qa.Le,olympe.sc.qa.hl);a.Ea(olympe.sc.qa.Jc.C,b,c);c=a.create(olympe.sc.qa.jb).X();a.Ea(olympe.sc.qa.Le.K,b,c);return b.X()};olympe.sc.qa.Le.prototype.C.L=new olympe.D.J(()=>olympe.sc.qa.jb,[]);olympe.sc.vg=class extends olympe.dc.CloudObject{static get(){return olympe.dc.CloudObject.get('011203300000000adf0f')}};olympe.sc.vg.P=olympe.dc.na.C('011203300000000adf00',olympe.sc.vg);olympe.sc.vg.F=olympe.sc.vg.P.la('011203300000000adf01');olympe.sc.vg.C=olympe.sc.vg.P.la('011203300000000adf02');olympe.sc.vg.G='011203300000000adf0f';olympe.sc.Pg=class extends olympe.dm.BrickMetadata{ke(){return olympe.sc.td.ue.Sg}};olympe.sc.Pg.P=olympe.dc.na.C('01645fe6873aeea59e64',olympe.sc.Pg);olympe.sc.Pg.C=olympe.sc.Pg.P.sa('017ed8ac775f48d4d589');olympe.sc.Pg.F=olympe.sc.Pg.P.sa('017ed8ac775f48d4d590');olympe.sc.Rn=class extends olympe.dm.Hb{ke(){return olympe.sc.td.ue.Sg}};olympe.sc.Rn.P=olympe.dc.na.C('0163a68ce44f3d1fa95d',olympe.sc.Rn);olympe.sc.Qg=class extends olympe.dm.BrickMetadata{};olympe.sc.Qg.P=olympe.dc.na.C('016324fde11a836f77d3',olympe.sc.Qg);olympe.sc.Qg.C=olympe.sc.Xc.P.sa('016324fde11a836088d3');olympe.sc.Qg.P.C=(a,b)=>yk(a,null!=b?b:'New config type',olympe.sc.Qg).X();olympe.sc.qy=class{};olympe.sc.dj=class extends olympe.dm.BrickMetadata{ke(){return olympe.sc.td.ue.Sg}};olympe.sc.dj.P=olympe.dc.na.C('017dc8d6c8fd8c8bd2ff',olympe.sc.dj);olympe.sc.dj.P.C=(a,b)=>yk(a,null!=b?b:'New data connector',olympe.sc.dj,olympe.dm.DataSource).X();olympe.sc.ne=class extends olympe.sc.Runnable{Ta(){return this.ab(olympe.sc.ne.G,olympe.sc.Runnable)}za(){return this.ab(olympe.sc.ne.F,olympe.dm.Property)}};olympe.sc.ne.P=ff(olympe.dc.na.C('016c2d996d9ca27fa9d8',olympe.sc.ne));olympe.sc.ne.G=olympe.sc.ne.P.sa('016c3cb7742ec9309e0b');olympe.sc.ne.F=olympe.sc.ne.P.sa('016c42d3454636f90533');olympe.sc.ne.prototype.Ta.L=new olympe.D.J(()=>olympe.dc.ya,[]);olympe.sc.ne.prototype.za.L=new olympe.D.J(()=>olympe.dc.ya,[]);olympe.sc.po=class extends olympe.dm.Hb{ke(){return olympe.sc.td.ue.Sg}};olympe.sc.po.P=olympe.dc.na.C('017a7a9ff057958e5678',olympe.sc.po);olympe.sc.lp=class extends olympe.dm.Hb{ke(){return olympe.sc.td.ue.Ju}};olympe.sc.lp.P=olympe.dc.na.C('01644b6d4543b344b857',olympe.sc.lp);olympe.sc.mp=class extends olympe.dc.CloudObject{};olympe.sc.mp.P=olympe.dc.na.C('0162f672366be5ca7a86',olympe.sc.mp);olympe.sc.tg=class extends olympe.dc.sources.tg{C(a){return a instanceof olympe.sc.logic.Error?{t:20,c:a.code,m:a.message,s:a.he()}:super.C(a)}G(a){return 20===(null==a?void 0:a.t)?Ll(a.m,a.c,a.s):super.G(a)}};olympe.sc.wq=class extends olympe.sc.ne{};olympe.sc.wq.P=olympe.dc.na.C('016d3f37610ae4fc3962',olympe.sc.wq);olympe.sc.Text=class extends olympe.dm.String{};olympe.sc.Text.P=olympe.dc.na.C('016cfca73e63f9ab5ba4',olympe.sc.Text);olympe.sc.Wa=class{constructor(a=!0){var b=new olympe.dc.Wa;b.O=a;this.C=b;this.F=[];this.source=null}static from(a){const b=olympe.sc.wa.C.TRANSACTION;return a.has(b,!0)?a.get(b,!0):new olympe.sc.Wa}static process(a,b){return a.has(olympe.sc.wa.C.TRANSACTION,!0)?Promise.resolve(!1):b.kb().then(()=>!0)}V(){return this.C.V()}create(a,b=new Map,c=this.source,d){c='string'===typeof c?c:olympe.dc.Rd().fromModel(a);d=this.C.create(a,d).Qi(c);for(const [f,g]of b)Z(d,f,g);if(c===olympe.dc.Pa.SERVER){if('string'===
|
|
1049
|
+
typeof sm){var e;let f;b=null!=(f=null==(e=olympe.dc.ad.from(sm).cb(olympe.sc.qa.Jc.C).cb(olympe.sc.Wc.C.Vb()).hd())?void 0:e.X())?f:null}else b=null;e=b;if(null!==e)this.Ea(olympe.sc.Wc.F,e,d);else throw Error('No business container for new instance of',olympe.dc.ga(a));}a=d.X();this.F.push(a);return a}update(a,b,c){this.C.update(a,b,c);return this}wr(a,b){a=this.C.update(a);for(const [c,d]of b)b=d,a.xd.set(olympe.dc.ga(c),b);return this}delete(a){this.C.delete(a);return this}Ea(a,b,c){this.C.Ea(a,
|
|
1050
|
+
b,c);return this}fc(a,b,c){this.C.fc(a,b,c);return this}qm(a,b){this.C.qm(a,b);return this}persist(a,b=!0){this.C.persist(a,b);return this}wx(a,b=!0){olympe.ma.eb('dc').warn('Transaction#persistInstance() has been deprecated. Please use Transaction#persist() instead.');return this.persist(a,b)}Qi(a){this.source=a;return this}model(a){return this.C.model(a)}merge(a){xk(this.C,a.C);return this}hm(a){this.C.hm(a);return this}kb(){return new Promise((a,b)=>{this.C.kb((c,d)=>{c?a(new olympe.sc.ni(this.F)):
|
|
1051
|
+
b(d)})})}sm(){return new Promise((a,b)=>{this.C.sm((c,d)=>{c?a(new olympe.sc.ni(this.F)):b(d)})})}};olympe.sc.Wa.prototype.executeAsLarge=olympe.sc.Wa.prototype.sm;olympe.sc.Wa.prototype.execute=olympe.sc.Wa.prototype.kb;olympe.sc.Wa.prototype.afterExecution=olympe.sc.Wa.prototype.hm;olympe.sc.Wa.prototype.merge=olympe.sc.Wa.prototype.merge;olympe.sc.Wa.prototype.model=olympe.sc.Wa.prototype.model;olympe.sc.Wa.prototype.setSource=olympe.sc.Wa.prototype.Qi;olympe.sc.Wa.prototype.persistInstance=olympe.sc.Wa.prototype.wx;
|
|
1052
|
+
olympe.sc.Wa.prototype.persist=olympe.sc.Wa.prototype.persist;olympe.sc.Wa.prototype.deleteAllRelations=olympe.sc.Wa.prototype.qm;olympe.sc.Wa.prototype.deleteRelation=olympe.sc.Wa.prototype.fc;olympe.sc.Wa.prototype.createRelation=olympe.sc.Wa.prototype.Ea;olympe.sc.Wa.prototype['delete']=olympe.sc.Wa.prototype.delete;olympe.sc.Wa.prototype.multiUpdate=olympe.sc.Wa.prototype.wr;olympe.sc.Wa.prototype.update=olympe.sc.Wa.prototype.update;olympe.sc.Wa.prototype.create=olympe.sc.Wa.prototype.create;
|
|
1053
|
+
olympe.sc.Wa.prototype.getId=olympe.sc.Wa.prototype.V;olympe.sc.Wa.process=olympe.sc.Wa.process;olympe.sc.Wa.from=olympe.sc.Wa.from;olympe.sc.ni=class{constructor(a){this.C=a}Sv(){return this.C.map(olympe.dc.CloudObject.get)}};olympe.sc.ni.prototype.getCreatedObjects=olympe.sc.ni.prototype.Sv;olympe.rc={};olympe.rc.Nr=class{run(){}};function Cm(a,b='default'){return a.C===b}
|
|
1054
|
+
olympe.rc.Sa=class{constructor(a,b){this.C=a;this.H=b;this.F=null;this.G='';this.H.info('HC Manager will execute application registered as:',this.C)}Ni(a,b,c=''){b||(b='default');b===this.C?(null===this.F?this.H.log('Application',c,'designated to be launched'):this.H.log('OVERRIDE: Application',c,'designated to be launched'),this.F=a,this.G=c):this.H.debug('ignoring application:'+c+' as it is registered under name '+b+' and not '+this.C)}run(){null!==this.F?(this.H.info('Running application:',this.G),
|
|
1055
|
+
this.F.run()):this.H.error('No app registered under name: '+this.C)}};olympe.rc.Ni=function(a,b,c='default'){const d=a.eb();c?d.debug('Pre-registering application '+b+' under name '+c+' (use '+olympe.rc.U.Be+'='+c+' to start it)'):d.debug('Pre-registering application '+b+' as default one');a.qd(olympe.rc.R.Ha).config(c,[b],(e,f)=>f.Ni(e,c,b),e=>Cm(e,c),'olympe.hc.registerApp')};olympe.rc.R={Ha:'hc.Manager',Ca:'hc.Logger'};olympe.rc.U={Be:'hc.app',Fo:'hc.globalToken'};olympe.W.config(function(a){F(a,olympe.rc.U.Be,'default');F(a,olympe.rc.U.Fo,!1);E(a,olympe.rc.R.Ca,[olympe.ma.R.Ha],b=>b.Mc('hc'));E(a,olympe.Bb.R.sg,[new olympe.W.ka(olympe.rc.U.Be)],b=>b);E(a,olympe.auth.R.xk,[olympe.Bb.R.sg,new olympe.W.ka(olympe.rc.U.Fo)],(b,c)=>new olympe.auth.pn(c?'':b));D(a,olympe.rc.R.Ha,olympe.rc.Sa,new olympe.W.ka(olympe.rc.U.Be),olympe.rc.R.Ca)},'olympe.hc');
|
|
1056
|
+
olympe.W.run([olympe.rc.R.Ha],a=>a.run(),'olympe.hc');olympe.sc.Lb={};function Dm(a,b){if(a.fa)a.H.debug('Sending getContext request'),th(a.oa).then(()=>{a.H.debug('synchronisation request successful');sm=a.C;b()}).catch(c=>{a.H.error('failed to synchronise (authenticated) with server: '+c.message)});else{const c=Jl(a.F);!c&&Ij();a.H.debug((c?'PULLING':'SUBSCRIBING')+' application '+a.C);const d=a.F.F(),e=new olympe.async.tq(d);e.add((f,g)=>{const h=olympe.dc.ja(),k=new olympe.D.Yb('Primordial Subscription Context',d);kh(k,a.C,l=>{l=h.Bh(l)?l:h.model(l);return null!==
|
|
1057
|
+
l&&h.tc(l,olympe.sc.Qg)},{Kd:Em(c),Ym:!0}).subscribe(rxjs.Subscriber.create(d.G(()=>{h.tc(a.C,olympe.sc.qa.Jc)?(a.za.Z(a.C,c),f()):Lc(a.O)?g(`The specified application tag (${a.C}) is not an application or does not exist`):(k.destroy(),a.O.connect().catch(l=>{g(`Failed to load the app while offline, you might want to try again when online: ${l}`)}))}),l=>g(String(l))))});e.add(f=>{olympe.D.Nc([a.ba.je()],g=>{const h=Em(c,!1);olympe.dc.pa.we(g,olympe.dm.User).observe(olympe.D.Xa(),{Kd:h,Zj:'__code-as-data__'}).subscribe(()=>
|
|
1058
|
+
d.run(f))})});e.add((f,g)=>{if(Fm(a.C)){const h=olympe.sc.Wc.Mb.gp,k=olympe.sc.Wc.Mb.rj;tm(a.C,l=>{l===h||l===k?d.run(f):d.run(()=>g('Error while loading the business container'))})}else f()});Bc(e,(f,g)=>{if(g)throw Error(g);b()});e.start()}}
|
|
1059
|
+
function Gm(a){a.H.info('Starting application '+a.C);const b=olympe.D.ic(olympe.D.ea).update(olympe.D.ea.C),c=olympe.dc.ja();if(0<a.C.length){const d=Ke(c,a.C,a.F.F().G((g,h)=>{if(g)if(g=km(h),g instanceof olympe.sc.qa.Ih){a.H.debug('application retrieved: running');h=Hl(a.F,g);const k=new olympe.sc.Za.bu(a.K);Oa(a.K,()=>Tl(a.F.C,k));Pa(a.K,()=>{var l=k.V();return Vl(a.F.C,l)});a.Ta&&a.K.start();g.run(h);'string'===typeof a.bb&&(new olympe.sc.Md).fa(g.X(),h,a.H);h.Fr(olympe.sc.wa.C.en).then(()=>{let l;
|
|
1060
|
+
null==(l=e)||l.cancel();b.update(olympe.D.ea.F);Hm(a)})}else a.H.error('application retrieved: not an Application with a run() method');else Im(a)}));olympe.D.Xa().onDestroy(()=>{Je(c,a.C,d)});const e=Wb(()=>{a.H.warn(`requested application ${a.C} may not be available (it may not exist or the logged user may not have the correct permissions)`)},3E4);let f;null==(f=a.nb)||f.start()}Jm(a);Km(a,b)}
|
|
1061
|
+
function Hm(a){a.H.info(`Application ${olympe.dc.ja().name(a.C)} (${a.C}) started`);a=olympe.dc.sources.Pd();a.Nb=!0;a.Z+=0;a.Fd.next(0<a.Z);0===a.Z&&a.ba&&a.Nb&&(a.H.debug(`Cache: set code-as-data version in local storage: ${a.version}`),a.bb.set('__code-as-data-version__',a.version),a.Ab||(a.ba=!1))}function Em(a,b=!0){return a?olympe.dc.pa.Rc.Hl:b?olympe.dc.pa.Rc.Cf:olympe.dc.pa.Rc.Gl}function Im(a){a.H.info('Stop the application');Hm(a);a.F.F().oa();a.G.G(a.T);a.G.O(a.Z)}
|
|
1062
|
+
function Jm(a){a.Z=a.G.F(()=>v(function*(){return Im(a)}),'Stop application')}function Km(a,b){a.T=a.G.C(()=>olympe.D.Qa(b)===olympe.D.ea.F?Promise.resolve('The application is started'):Promise.reject('The application is not started'))}
|
|
1063
|
+
olympe.sc.Lb.Nl=class{constructor(a,b,c,d,e,f,g,h,k,l){this.H=a;this.ba=b;this.O=c;this.oa=d;this.G=e;this.Z=this.T='';this.F=f;this.za=g;this.K=h;this.nb=l;this.C=k.get('appTag');this.fa=k.get('getContextMode');let n;this.bb=null!=(n=k.get('debuggerName'))?n:null;this.Ta=k.get('autostartProfiler')}run(){this.H.debug('runtime starting for app #'+this.C);let a=!1;const b=olympe.N.kc.C.ei,c=olympe.N.kc.C.Zd,d=olympe.N.kc.C.Vd;olympe.D.Nc([this.O.getState()],e=>{switch(e){case b:case c:this.H.debug('Server session opened or working offline, start the application');
|
|
1064
|
+
a||(a=!0,Dm(this,()=>Gm(this)));break;case d:this.H.debug('Impossible to open a connection to the orchestrator and offline mode is disabled.')}})}};olympe.sc.Lb.Nl.C='app_instance';olympe.sc.Lb.Nl.xa=[olympe.rc.Nr];olympe.sc.Lb.lu=class{constructor(a,b,c,d){this.H=a;this.G=b;this.F=c;this.K=d.get('httpManifestPath');this.C=d.get('manifestCommon');if(!this.C)this.C={};else if('string'===typeof this.C)try{this.C=JSON.parse(this.C)}catch(e){this.H.warn('Invalid manifest common config'),this.C={}}}start(){const a=b=>{const c=(new URL(b.C())).searchParams.get('origin');if(c)return c;b=b.Ei();this.H.debug('Request headers',JSON.stringify(b,null,2));return b.origin?b.origin:b.Ax?(new URL(b.Ax)).origin:b[olympe.net.Ba.Headers.xo]&&
|
|
1065
|
+
b[olympe.net.Ba.Headers.yo]?b[olympe.net.Ba.Headers.yo]+'://'+b[olympe.net.Ba.Headers.xo]:null};this.G.K('manifest',`${this.K}/:${'appTag'}`,[olympe.net.Ba.Nd.GET],(b,c)=>{const d=this;return v(function*(){var e=c.get('appTag');d.H.debug('Processing request to serve manifest for app',e);if(20!==e.length)return new olympe.net.Xd('Invalid appTag',olympe.net.Ba.Zb.Bk);try{var f=yield olympe.dc.pa.we(e,olympe.sc.qa.Jc).kb(d.F)}catch(h){return new olympe.net.Xd(`Something went wrong: ${'string'===typeof h?
|
|
1066
|
+
h:h.message}`,olympe.net.Ba.Zb.Bk)}if(0===f.size())return new olympe.net.Xd('App not found',olympe.net.Ba.Zb.vl);var g=a(b);f=f.xc();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'===
|
|
1067
|
+
typeof f)try{f=JSON.parse(f)}catch(h){d.H.warn(`Invalid manifest app config for app: ${e}`),f={}}e=Object.assign({},g,d.C,f);return new olympe.net.Xd(JSON.stringify(e),olympe.net.Ba.Zb.$g,void 0,{'content-type':'application/json'})})}).catch(()=>this.H.error('Error while starting the RuntimeHTTPService'));this.H.debug('Started RuntimeHTTPService')}};function Fm(a){var b=olympe.dm.DataSource.SERVER;const c=olympe.dc.pa.from(a).cb(olympe.sc.qa.Jc.C).cb(olympe.dm.md.G.Vb()).cb(olympe.dm.md.C).hd();a=olympe.dc.pa.from(a).cb(olympe.sc.qa.Jc.C).cb(olympe.dm.rb.G).hd();return c.concat(a).has(b)}
|
|
1068
|
+
olympe.sc.Lb.Qj=class extends olympe.dc.sources.Qj{T(a){return this.db.tc(a,olympe.sc.Xc)}Z(a,b){if(!this.K){super.init();var c=olympe.dc.ad.from(a).cb(olympe.sc.qa.Jc.C).hd();if(!(c instanceof olympe.dm.rb))throw Error(`Impossible to initialize the source solver for the application ${a}: no project is linked to it`);b=b?olympe.dc.pa.Rc.Hl:olympe.dc.pa.Rc.Cf;Aj(this,c,b);c=new olympe.D.Yb('deployed data sources');olympe.dc.pa.from(a).cb(olympe.sc.qa.Jc.za).observe(c,{Kd:b}).subscribe(d=>{const e=
|
|
1069
|
+
new olympe.dc.Wa;Se(d).forEach(f=>{e.Ea(olympe.dm.DataSource.Mi,this.C,f)});Re(d).forEach(f=>{e.fc(olympe.dm.DataSource.Mi,this.C,f)});e.kb()})}}};olympe.sc.Lb.R={Kf:'sc.runtime.Main',Ke:'sc.runtime.SourceSolver',$p:'sc.runtime.appConfig',bq:'sc.runtime.runtimeHTTPServiceConfig',aq:'sc.runtime.RuntimeHTTPService',xp:'sc.runtime.OfflineAppConfig'};olympe.sc.Lb.U={No:'app.httpManifestPath',kp:'app.manifest.common'};
|
|
1070
|
+
olympe.W.config(function(a){E(a,olympe.Bb.R.sg,[new olympe.W.ka(olympe.rc.U.Be),new olympe.W.ka(olympe.sc.U.Be)],(b,c)=>`${b}${c?'-'+c:''}`);E(a,olympe.sc.Lb.R.xp,[new olympe.W.ka(olympe.sc.U.Be),new olympe.W.ka(olympe.net.U.di),new olympe.W.ka(olympe.net.U.xl)],(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`))?g:d;return new Map([['offlineEnabled',f],['offlineAutoBackOnline',!f||b]])});xa(a,olympe.net.R.yl,
|
|
1071
|
+
olympe.sc.Lb.R.xp);D(a,olympe.sc.Lb.R.Ke,olympe.sc.Lb.Qj,olympe.dc.R.$e,new olympe.W.ka(olympe.dc.U.rg),new olympe.W.ka(olympe.dc.U.Tk));xa(a,olympe.dc.sources.R.Ke,olympe.sc.Lb.R.Ke);E(a,olympe.sc.Lb.R.$p,[new olympe.W.ka(olympe.sc.U.Be),new olympe.W.ka(olympe.dc.U.ih),new olympe.W.ka(olympe.sc.U.bo),new olympe.W.ka(olympe.sc.U.gn)],(b,c,d,e)=>new Map([['appTag',b],['getContextMode',c],['debuggerName',d],['autostartProfiler',e]]));D(a,olympe.sc.Lb.R.Kf,olympe.sc.Lb.Nl,olympe.sc.R.Ca,olympe.auth.R.Ha,
|
|
1072
|
+
olympe.N.R.Xe,olympe.dc.query.R.Cj,olympe.host.R.He,olympe.sc.R.Gj,olympe.sc.Lb.R.Ke,olympe.Y.R.Jf,olympe.sc.Lb.R.$p,olympe.sc.Lb.R.aq);F(a,olympe.sc.Lb.U.No,'/runtime/manifest');F(a,olympe.sc.Lb.U.kp,null);E(a,olympe.sc.Lb.R.bq,[new olympe.W.ka(olympe.sc.Lb.U.No),new olympe.W.ka(olympe.sc.Lb.U.kp)],(b,c)=>new Map([['httpManifestPath',b],['manifestCommon',c]]));D(a,olympe.sc.Lb.R.aq,olympe.sc.Lb.lu,olympe.sc.R.Ca,olympe.net.R.oi,olympe.sc.R.Gj,olympe.sc.Lb.R.bq);olympe.rc.Ni(a,olympe.sc.Lb.R.Kf,'sc.runtime');
|
|
1073
|
+
olympe.rc.Ni(a,olympe.sc.Lb.R.Kf,'sc.headless');olympe.rc.Ni(a,olympe.sc.Lb.R.Kf)},'olympe.sc.runtime');olympe.public={};olympe.public.Ia=class a{static Jv(b,c){const d=new SRPClient,e=d.generateRandomSalt();return{username:b,login:b,salt:e,verifier:d.generateVerifier(e,b,c)}}static getState(){return se(olympe.public.Ia.get())}static lk(b){return a.F(olympe.public.Ia.get().lk(),b).pipe(rxjs.operators.map(c=>c.valueOf()))}static Uv(){return olympe.D.Qa(olympe.public.Ia.get().je())}static qx(b){return a.F(olympe.public.Ia.get().je(),b)}static ie(){var b=olympe.D,c=b.Qa;var d=olympe.public.Ia.get().C.ub().rd();return c.call(b,
|
|
1074
|
+
d)}static Wf(){return new Promise((b,c)=>{olympe.public.Ia.get().Wf(d=>d?c(d):b())})}static fw(){return olympe.D.Qa(olympe.public.Ia.get().vh())||void 0}static Hw(){const b=Qc(olympe.public.Ia.get());return{user:b.uc(),userTag:b.je(),nonce:b.rd(),payload:b.Yh(),idpName:b.df(),protocol:b.hg()}}static ew(){return Array.from(te().keys())}static Ve(){olympe.public.Ia.get().Ve()}static Gg(b){return new Promise((c,d)=>{olympe.public.Ia.get().Gg(b,e=>e?d(e):c())})}static Ww(b,c){return olympe.public.Ia.C((new Map).set('username',
|
|
1075
|
+
b).set('password',c),olympe.auth.wc.C.SRP)}static Xw(b){const c=te();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.Ia.C((new Map).set('idpName',d),b)}static Vw(){return olympe.public.Ia.C(new Map,olympe.auth.wc.C.SAML)}static Yw(b,c){return olympe.public.Ia.C((new Map).set('username',b).set('nonce',
|
|
1076
|
+
c),olympe.auth.wc.C.zl)}static Uw(){return olympe.public.Ia.C(new Map,olympe.auth.wc.C.OAUTH2)}static Ch(){return olympe.public.Ia.get().Ch()}static C(b,c){const d=new olympe.auth.Request;for(const [e,f]of b)d.set(e,f);return new Promise(e=>{re(olympe.public.Ia.get(),d,c,()=>{e()})})}static get(){return olympe.auth.ge()}static F(b,c){return b.asObservable('function'===typeof c.F?c.F():c)}};olympe.public.Ia.logout=olympe.public.Ia.Ch;olympe.public.Ia.loginOpenID=olympe.public.Ia.Uw;
|
|
1077
|
+
olympe.public.Ia.loginToken=olympe.public.Ia.Yw;olympe.public.Ia.loginSAML=olympe.public.Ia.Vw;olympe.public.Ia.loginSSO=olympe.public.Ia.Xw;olympe.public.Ia.loginSRP=olympe.public.Ia.Ww;olympe.public.Ia.getUserFromToken=olympe.public.Ia.Gg;olympe.public.Ia.sendKeepAlive=olympe.public.Ia.Ve;olympe.public.Ia.getIDPNames=olympe.public.Ia.ew;olympe.public.Ia.getUserToken=olympe.public.Ia.Hw;olympe.public.Ia.getIDPToken=olympe.public.Ia.fw;olympe.public.Ia.refreshToken=olympe.public.Ia.Wf;
|
|
1078
|
+
olympe.public.Ia.getToken=olympe.public.Ia.ie;olympe.public.Ia.observeUser=olympe.public.Ia.qx;olympe.public.Ia.getCurrentUser=olympe.public.Ia.Uv;olympe.public.Ia.isAuthenticated=olympe.public.Ia.lk;olympe.public.Ia.getState=olympe.public.Ia.getState;olympe.public.Ia.generateSRPData=olympe.public.Ia.Jv;olympe.public.Aa=class{static create(a){return new class extends olympe.dc.$.Yf{C(b,c){b=a(olympe.dc.CloudObject.get(c));if('boolean'===typeof b)return b;const d=olympe.D.ic(olympe.D.ea),e=b.subscribe(f=>d.update(olympe.D.Qb(f)));olympe.D.Xa().Z(()=>e.unsubscribe());return d.ub()}}}};
|
|
1079
|
+
olympe.public.Ye=class{static create(a){return new class extends olympe.dc.qc.Yf{K(b,c){return olympe.dc.CloudObject.get(c)}G(b,c){b=a(b,c);if('number'===typeof b)return b;const d=olympe.D.ic(olympe.D.aa),e=b.subscribe(f=>d.update(olympe.D.ra(f)));olympe.D.Xa().Z(()=>e.unsubscribe());return d.ub()}}}};olympe.public.Process=class{static sx(a,b){const c=olympe.host.gk(),d=c.C(a,b);return()=>c.G(d)}static tx(a,b){const c=olympe.host.gk(),d=c.F(a,b);return()=>c.O(d)}static connect(){return olympe.N.wm().connect()}static disconnect(){return olympe.N.wm().disconnect()}static Tf(a){a='function'===typeof a.F?a.F():a;return olympe.N.wm().Tf().asObservable(a).pipe(rxjs.operators.map(b=>b.valueOf()))}};olympe.public.Process.isOnline=olympe.public.Process.Tf;olympe.public.Process.disconnect=olympe.public.Process.disconnect;
|
|
1080
|
+
olympe.public.Process.connect=olympe.public.Process.connect;olympe.public.Process.onShutdown=olympe.public.Process.tx;olympe.public.Process.onHealthCheck=olympe.public.Process.sx;'object'===typeof exports&&(exports={CloudObject:olympe.dc.CloudObject,Relation:olympe.dc.Ma.Relation,Direction:olympe.dc.ua,generateTag:olympe.Y.sf,tagToString:olympe.dc.ga,register:olympe.dc.register,defineProperty:olympe.dc.defineProperty,defineRelation:olympe.dc.ar,defineInverseRelation:olympe.dc.tv,BrickContext:olympe.sc.wa,Brick:olympe.sc.logic.Function,ActionBrick:olympe.sc.logic.Action,GlobalProperties:olympe.sc.wa.C,registerBrick:olympe.sc.logic.na.C,FunctionBrick:olympe.sc.logic.Function,
|
|
1081
|
+
Context:olympe.sc.wa,Entry:olympe.dc.Ma.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.Hf,EnumValue:olympe.dm.Enum,DataSource:olympe.dm.DataSource,DataResult:olympe.dc.query.ld,Workflow:olympe.sc.workflow.Workflow,WorkflowState:olympe.sc.workflow.Me,WorkflowTransition:olympe.sc.workflow.Transition,
|
|
1082
|
+
WorkflowObjectState:olympe.sc.workflow.ObjectState,Transaction:olympe.sc.Wa,BurstTransaction:olympe.dc.Kh,TransactionResult:olympe.sc.ni,PredefinedDataSource:olympe.dc.Pa,QueryResult:olympe.dc.Oa,Query:olympe.dc.pa,QuerySingle:olympe.dc.ad,Predicate:olympe.dc.query.Aa,Order:olympe.dc.query.zj,Config:class{static getParameter(a){return olympe.W.getParameter(a)}},Process:olympe.public.Process,Cache:{getCacheEntries:()=>olympe.dc.sources.Pd().O,clearCache:a=>Pj(olympe.dc.sources.Pd(),a),getProcessingStatus:()=>
|
|
1083
|
+
olympe.dc.sources.Pd().yc(),getProcessingErrors:()=>olympe.dc.sources.Pd().ec.asObservable(),hasPendingChanges:()=>olympe.dc.sources.Pd().fa.asObservable(),synchroniseChanges:()=>Vj(),getPendingChanges:()=>Yj(),clearPendingChanges:()=>ck(),loadPendingChanges:a=>ak(a)},Color:olympe.D.Color,ErrorFlow:olympe.sc.logic.Error,ServiceRequestType:olympe.N.Request.ob,ServiceRequest:olympe.N.Kc,Service:olympe.N.tb,Auth:olympe.public.Ia,AuthState:{INIT:olympe.auth.Sa.C.INIT,AUTHENTICATING:olympe.auth.Sa.C.Ui,
|
|
1084
|
+
GUEST:olympe.auth.Sa.C.Rh,AUTHENTICATED:olympe.auth.Sa.C.Af,ERROR:olympe.auth.Sa.C.Eb},AuthProtocol:olympe.auth.wc.C,Sync:olympe.dc.CloudObject,BusinessObject:olympe.dc.CloudObject,StringPrimitive:olympe.dm.String,NumberPrimitive:olympe.dm.Number,BooleanPrimitive:olympe.dm.Boolean,DatetimePrimitive:olympe.dm.DateTime,ColorPrimitive:olympe.dm.Color,PropertyPrimitive:olympe.dm.Property,RelationPrimitive:olympe.dm.Relation,DBView:class extends olympe.dc.ib{static get(){return olympe.dc.ja()}},ListDef:olympe.dc.ya,
|
|
1085
|
+
instanceToTag:olympe.dc.ga,registerSync:olympe.dc.na.C,getUniqueTag:olympe.Y.sf,onDestroy:a=>olympe.D.Xa().onDestroy(a),offDestroy:a=>olympe.D.Xa().xf(a),FollowRules:olympe.dc.cc,transformers:{Related:olympe.dc.da.Je,RecursiveRelated:olympe.dc.da.te,Distinct:olympe.dc.da.Nh,Filter:olympe.dc.da.af,Limit:olympe.dc.da.Xg,Sort:olympe.dc.da.ug,Union:olympe.dc.da.lf},ListDefPredicate:olympe.public.Aa,predicates:{And:olympe.dc.$.zd,Or:olympe.dc.$.se,Not:olympe.dc.$.Yd,Equals:olympe.dc.$.oe,Contains:olympe.dc.$.Ze,
|
|
1086
|
+
Greater:olympe.dc.$.kj,Smaller:olympe.dc.$.Pj,HasRelated:olympe.dc.$.Th,InstanceOf:olympe.dc.$.Xh,Regex:olympe.dc.$.hf},Comparator:olympe.public.Ye,comparators:{Number:olympe.dc.qc.Number,String:olympe.dc.qc.String,DateTime:olympe.dc.qc.DateTime},valuedefs:{BooleanProperty:olympe.dc.$a.Xi,StringProperty:olympe.dc.$a.ji,NumberProperty:olympe.dc.$a.ci,DateTimeProperty:olympe.dc.$a.Mh,Constant:olympe.dc.$a.De,Tag:olympe.dc.$a.li}});
|
|
1082
1087
|
|
|
1083
1088
|
|
|
1084
1089
|
}.bind(this))();
|