ode-explorer 1.0.0-develop-pedago.202307281229 → 1.0.0-develop-pedago.202307311112
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1 -1
- package/dist/version.txt +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -61,7 +61,7 @@ PERFORMANCE OF THIS SOFTWARE.
|
|
|
61
61
|
***************************************************************************** */var extendStatics=function(_e,et){return extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(tt,rt){tt.__proto__=rt}||function(tt,rt){for(var nt in rt)Object.prototype.hasOwnProperty.call(rt,nt)&&(tt[nt]=rt[nt])},extendStatics(_e,et)};function __extends$1(_e,et){if(typeof et!="function"&&et!==null)throw new TypeError("Class extends value "+String(et)+" is not a constructor or null");extendStatics(_e,et);function tt(){this.constructor=_e}_e.prototype=et===null?Object.create(et):(tt.prototype=et.prototype,new tt)}function __values(_e){var et=typeof Symbol=="function"&&Symbol.iterator,tt=et&&_e[et],rt=0;if(tt)return tt.call(_e);if(_e&&typeof _e.length=="number")return{next:function(){return _e&&rt>=_e.length&&(_e=void 0),{value:_e&&_e[rt++],done:!_e}}};throw new TypeError(et?"Object is not iterable.":"Symbol.iterator is not defined.")}function __read(_e,et){var tt=typeof Symbol=="function"&&_e[Symbol.iterator];if(!tt)return _e;var rt=tt.call(_e),nt,st=[],ot;try{for(;(et===void 0||et-- >0)&&!(nt=rt.next()).done;)st.push(nt.value)}catch(at){ot={error:at}}finally{try{nt&&!nt.done&&(tt=rt.return)&&tt.call(rt)}finally{if(ot)throw ot.error}}return st}function __spreadArray(_e,et){for(var tt=0,rt=et.length,nt=_e.length;tt<rt;tt++,nt++)_e[nt]=et[tt];return _e}function isFunction$1(_e){return typeof _e=="function"}function createErrorClass(_e){var et=function(rt){Error.call(rt),rt.stack=new Error().stack},tt=_e(et);return tt.prototype=Object.create(Error.prototype),tt.prototype.constructor=tt,tt}var UnsubscriptionError=createErrorClass(function(_e){return function(et){_e(this),this.message=et?et.length+` errors occurred during unsubscription:
|
|
62
62
|
`+et.map(function(tt,rt){return rt+1+") "+tt.toString()}).join(`
|
|
63
63
|
`):"",this.name="UnsubscriptionError",this.errors=et}});function arrRemove(_e,et){if(_e){var tt=_e.indexOf(et);0<=tt&&_e.splice(tt,1)}}var Subscription=function(){function _e(et){this.initialTeardown=et,this.closed=!1,this._parentage=null,this._teardowns=null}return _e.prototype.unsubscribe=function(){var et,tt,rt,nt,st;if(!this.closed){this.closed=!0;var ot=this._parentage;if(ot)if(this._parentage=null,Array.isArray(ot))try{for(var at=__values(ot),ut=at.next();!ut.done;ut=at.next()){var lt=ut.value;lt.remove(this)}}catch(vt){et={error:vt}}finally{try{ut&&!ut.done&&(tt=at.return)&&tt.call(at)}finally{if(et)throw et.error}}else ot.remove(this);var dt=this.initialTeardown;if(isFunction$1(dt))try{dt()}catch(vt){st=vt instanceof UnsubscriptionError?vt.errors:[vt]}var ct=this._teardowns;if(ct){this._teardowns=null;try{for(var ft=__values(ct),ht=ft.next();!ht.done;ht=ft.next()){var mt=ht.value;try{execTeardown(mt)}catch(vt){st=st??[],vt instanceof UnsubscriptionError?st=__spreadArray(__spreadArray([],__read(st)),__read(vt.errors)):st.push(vt)}}}catch(vt){rt={error:vt}}finally{try{ht&&!ht.done&&(nt=ft.return)&&nt.call(ft)}finally{if(rt)throw rt.error}}}if(st)throw new UnsubscriptionError(st)}},_e.prototype.add=function(et){var tt;if(et&&et!==this)if(this.closed)execTeardown(et);else{if(et instanceof _e){if(et.closed||et._hasParent(this))return;et._addParent(this)}(this._teardowns=(tt=this._teardowns)!==null&&tt!==void 0?tt:[]).push(et)}},_e.prototype._hasParent=function(et){var tt=this._parentage;return tt===et||Array.isArray(tt)&&tt.includes(et)},_e.prototype._addParent=function(et){var tt=this._parentage;this._parentage=Array.isArray(tt)?(tt.push(et),tt):tt?[tt,et]:et},_e.prototype._removeParent=function(et){var tt=this._parentage;tt===et?this._parentage=null:Array.isArray(tt)&&arrRemove(tt,et)},_e.prototype.remove=function(et){var tt=this._teardowns;tt&&arrRemove(tt,et),et instanceof _e&&et._removeParent(this)},_e.EMPTY=function(){var et=new _e;return et.closed=!0,et}(),_e}(),EMPTY_SUBSCRIPTION=Subscription.EMPTY;function isSubscription(_e){return _e instanceof Subscription||_e&&"closed"in _e&&isFunction$1(_e.remove)&&isFunction$1(_e.add)&&isFunction$1(_e.unsubscribe)}function execTeardown(_e){isFunction$1(_e)?_e():_e.unsubscribe()}var config$1={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},timeoutProvider={setTimeout:function(){for(var _e=[],et=0;et<arguments.length;et++)_e[et]=arguments[et];return setTimeout.apply(void 0,__spreadArray([],__read(_e)))},clearTimeout:function(_e){return clearTimeout(_e)},delegate:void 0};function reportUnhandledError(_e){timeoutProvider.setTimeout(function(){var et=config$1.onUnhandledError;if(et)et(_e);else throw _e})}function noop$1(){}var COMPLETE_NOTIFICATION=function(){return createNotification("C",void 0,void 0)}();function errorNotification(_e){return createNotification("E",void 0,_e)}function nextNotification(_e){return createNotification("N",_e,void 0)}function createNotification(_e,et,tt){return{kind:_e,value:et,error:tt}}var context=null;function errorContext(_e){if(config$1.useDeprecatedSynchronousErrorHandling){var et=!context;if(et&&(context={errorThrown:!1,error:null}),_e(),et){var tt=context,rt=tt.errorThrown,nt=tt.error;if(context=null,rt)throw nt}}else _e()}function captureError(_e){config$1.useDeprecatedSynchronousErrorHandling&&context&&(context.errorThrown=!0,context.error=_e)}var Subscriber=function(_e){__extends$1(et,_e);function et(tt){var rt=_e.call(this)||this;return rt.isStopped=!1,tt?(rt.destination=tt,isSubscription(tt)&&tt.add(rt)):rt.destination=EMPTY_OBSERVER,rt}return et.create=function(tt,rt,nt){return new SafeSubscriber(tt,rt,nt)},et.prototype.next=function(tt){this.isStopped?handleStoppedNotification(nextNotification(tt),this):this._next(tt)},et.prototype.error=function(tt){this.isStopped?handleStoppedNotification(errorNotification(tt),this):(this.isStopped=!0,this._error(tt))},et.prototype.complete=function(){this.isStopped?handleStoppedNotification(COMPLETE_NOTIFICATION,this):(this.isStopped=!0,this._complete())},et.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,_e.prototype.unsubscribe.call(this),this.destination=null)},et.prototype._next=function(tt){this.destination.next(tt)},et.prototype._error=function(tt){try{this.destination.error(tt)}finally{this.unsubscribe()}},et.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},et}(Subscription),SafeSubscriber=function(_e){__extends$1(et,_e);function et(tt,rt,nt){var st=_e.call(this)||this,ot;if(isFunction$1(tt))ot=tt;else if(tt){ot=tt.next,rt=tt.error,nt=tt.complete;var at;st&&config$1.useDeprecatedNextContext?(at=Object.create(tt),at.unsubscribe=function(){return st.unsubscribe()}):at=tt,ot=ot==null?void 0:ot.bind(at),rt=rt==null?void 0:rt.bind(at),nt=nt==null?void 0:nt.bind(at)}return st.destination={next:ot?wrapForErrorHandling(ot):noop$1,error:wrapForErrorHandling(rt??defaultErrorHandler),complete:nt?wrapForErrorHandling(nt):noop$1},st}return et}(Subscriber);function wrapForErrorHandling(_e,et){return function(){for(var tt=[],rt=0;rt<arguments.length;rt++)tt[rt]=arguments[rt];try{_e.apply(void 0,__spreadArray([],__read(tt)))}catch(nt){config$1.useDeprecatedSynchronousErrorHandling?captureError(nt):reportUnhandledError(nt)}}}function defaultErrorHandler(_e){throw _e}function handleStoppedNotification(_e,et){var tt=config$1.onStoppedNotification;tt&&timeoutProvider.setTimeout(function(){return tt(_e,et)})}var EMPTY_OBSERVER={closed:!0,next:noop$1,error:defaultErrorHandler,complete:noop$1},observable=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function identity(_e){return _e}function pipeFromArray(_e){return _e.length===0?identity:_e.length===1?_e[0]:function(et){return _e.reduce(function(tt,rt){return rt(tt)},et)}}var Observable=function(){function _e(et){et&&(this._subscribe=et)}return _e.prototype.lift=function(et){var tt=new _e;return tt.source=this,tt.operator=et,tt},_e.prototype.subscribe=function(et,tt,rt){var nt=this,st=isSubscriber(et)?et:new SafeSubscriber(et,tt,rt);return errorContext(function(){var ot=nt,at=ot.operator,ut=ot.source;st.add(at?at.call(st,ut):ut?nt._subscribe(st):nt._trySubscribe(st))}),st},_e.prototype._trySubscribe=function(et){try{return this._subscribe(et)}catch(tt){et.error(tt)}},_e.prototype.forEach=function(et,tt){var rt=this;return tt=getPromiseCtor(tt),new tt(function(nt,st){var ot;ot=rt.subscribe(function(at){try{et(at)}catch(ut){st(ut),ot==null||ot.unsubscribe()}},st,nt)})},_e.prototype._subscribe=function(et){var tt;return(tt=this.source)===null||tt===void 0?void 0:tt.subscribe(et)},_e.prototype[observable]=function(){return this},_e.prototype.pipe=function(){for(var et=[],tt=0;tt<arguments.length;tt++)et[tt]=arguments[tt];return pipeFromArray(et)(this)},_e.prototype.toPromise=function(et){var tt=this;return et=getPromiseCtor(et),new et(function(rt,nt){var st;tt.subscribe(function(ot){return st=ot},function(ot){return nt(ot)},function(){return rt(st)})})},_e.create=function(et){return new _e(et)},_e}();function getPromiseCtor(_e){var et;return(et=_e??config$1.Promise)!==null&&et!==void 0?et:Promise}function isObserver(_e){return _e&&isFunction$1(_e.next)&&isFunction$1(_e.error)&&isFunction$1(_e.complete)}function isSubscriber(_e){return _e&&_e instanceof Subscriber||isObserver(_e)&&isSubscription(_e)}function hasLift(_e){return isFunction$1(_e==null?void 0:_e.lift)}function operate(_e){return function(et){if(hasLift(et))return et.lift(function(tt){try{return _e(tt,this)}catch(rt){this.error(rt)}});throw new TypeError("Unable to lift unknown Observable type")}}var OperatorSubscriber=function(_e){__extends$1(et,_e);function et(tt,rt,nt,st,ot){var at=_e.call(this,tt)||this;return at.onFinalize=ot,at._next=rt?function(ut){try{rt(ut)}catch(lt){tt.error(lt)}}:_e.prototype._next,at._error=st?function(ut){try{st(ut)}catch(lt){tt.error(lt)}finally{this.unsubscribe()}}:_e.prototype._error,at._complete=nt?function(){try{nt()}catch(ut){tt.error(ut)}finally{this.unsubscribe()}}:_e.prototype._complete,at}return et.prototype.unsubscribe=function(){var tt,rt=this.closed;_e.prototype.unsubscribe.call(this),!rt&&((tt=this.onFinalize)===null||tt===void 0||tt.call(this))},et}(Subscriber);function refCount(){return operate(function(_e,et){var tt=null;_e._refCount++;var rt=new OperatorSubscriber(et,void 0,void 0,void 0,function(){if(!_e||_e._refCount<=0||0<--_e._refCount){tt=null;return}var nt=_e._connection,st=tt;tt=null,nt&&(!st||nt===st)&&nt.unsubscribe(),et.unsubscribe()});_e.subscribe(rt),rt.closed||(tt=_e.connect())})}(function(_e){__extends$1(et,_e);function et(tt,rt){var nt=_e.call(this)||this;return nt.source=tt,nt.subjectFactory=rt,nt._subject=null,nt._refCount=0,nt._connection=null,hasLift(tt)&&(nt.lift=tt.lift),nt}return et.prototype._subscribe=function(tt){return this.getSubject().subscribe(tt)},et.prototype.getSubject=function(){var tt=this._subject;return(!tt||tt.isStopped)&&(this._subject=this.subjectFactory()),this._subject},et.prototype._teardown=function(){this._refCount=0;var tt=this._connection;this._subject=this._connection=null,tt==null||tt.unsubscribe()},et.prototype.connect=function(){var tt=this,rt=this._connection;if(!rt){rt=this._connection=new Subscription;var nt=this.getSubject();rt.add(this.source.subscribe(new OperatorSubscriber(nt,void 0,function(){tt._teardown(),nt.complete()},function(st){tt._teardown(),nt.error(st)},function(){return tt._teardown()}))),rt.closed&&(this._connection=null,rt=Subscription.EMPTY)}return rt},et.prototype.refCount=function(){return refCount()(this)},et})(Observable);var animationFrameProvider={schedule:function(_e){var et=requestAnimationFrame,tt=cancelAnimationFrame,rt=et(function(nt){tt=void 0,_e(nt)});return new Subscription(function(){return tt==null?void 0:tt(rt)})},requestAnimationFrame:function(){for(var _e=[],et=0;et<arguments.length;et++)_e[et]=arguments[et];var tt=animationFrameProvider.delegate;return((tt==null?void 0:tt.requestAnimationFrame)||requestAnimationFrame).apply(void 0,__spreadArray([],__read(_e)))},cancelAnimationFrame:function(){for(var _e=[],et=0;et<arguments.length;et++)_e[et]=arguments[et];return cancelAnimationFrame.apply(void 0,__spreadArray([],__read(_e)))},delegate:void 0},ObjectUnsubscribedError=createErrorClass(function(_e){return function(){_e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),Subject=function(_e){__extends$1(et,_e);function et(){var tt=_e.call(this)||this;return tt.closed=!1,tt.observers=[],tt.isStopped=!1,tt.hasError=!1,tt.thrownError=null,tt}return et.prototype.lift=function(tt){var rt=new AnonymousSubject(this,this);return rt.operator=tt,rt},et.prototype._throwIfClosed=function(){if(this.closed)throw new ObjectUnsubscribedError},et.prototype.next=function(tt){var rt=this;errorContext(function(){var nt,st;if(rt._throwIfClosed(),!rt.isStopped){var ot=rt.observers.slice();try{for(var at=__values(ot),ut=at.next();!ut.done;ut=at.next()){var lt=ut.value;lt.next(tt)}}catch(dt){nt={error:dt}}finally{try{ut&&!ut.done&&(st=at.return)&&st.call(at)}finally{if(nt)throw nt.error}}}})},et.prototype.error=function(tt){var rt=this;errorContext(function(){if(rt._throwIfClosed(),!rt.isStopped){rt.hasError=rt.isStopped=!0,rt.thrownError=tt;for(var nt=rt.observers;nt.length;)nt.shift().error(tt)}})},et.prototype.complete=function(){var tt=this;errorContext(function(){if(tt._throwIfClosed(),!tt.isStopped){tt.isStopped=!0;for(var rt=tt.observers;rt.length;)rt.shift().complete()}})},et.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=null},Object.defineProperty(et.prototype,"observed",{get:function(){var tt;return((tt=this.observers)===null||tt===void 0?void 0:tt.length)>0},enumerable:!1,configurable:!0}),et.prototype._trySubscribe=function(tt){return this._throwIfClosed(),_e.prototype._trySubscribe.call(this,tt)},et.prototype._subscribe=function(tt){return this._throwIfClosed(),this._checkFinalizedStatuses(tt),this._innerSubscribe(tt)},et.prototype._innerSubscribe=function(tt){var rt=this,nt=rt.hasError,st=rt.isStopped,ot=rt.observers;return nt||st?EMPTY_SUBSCRIPTION:(ot.push(tt),new Subscription(function(){return arrRemove(ot,tt)}))},et.prototype._checkFinalizedStatuses=function(tt){var rt=this,nt=rt.hasError,st=rt.thrownError,ot=rt.isStopped;nt?tt.error(st):ot&&tt.complete()},et.prototype.asObservable=function(){var tt=new Observable;return tt.source=this,tt},et.create=function(tt,rt){return new AnonymousSubject(tt,rt)},et}(Observable),AnonymousSubject=function(_e){__extends$1(et,_e);function et(tt,rt){var nt=_e.call(this)||this;return nt.destination=tt,nt.source=rt,nt}return et.prototype.next=function(tt){var rt,nt;(nt=(rt=this.destination)===null||rt===void 0?void 0:rt.next)===null||nt===void 0||nt.call(rt,tt)},et.prototype.error=function(tt){var rt,nt;(nt=(rt=this.destination)===null||rt===void 0?void 0:rt.error)===null||nt===void 0||nt.call(rt,tt)},et.prototype.complete=function(){var tt,rt;(rt=(tt=this.destination)===null||tt===void 0?void 0:tt.complete)===null||rt===void 0||rt.call(tt)},et.prototype._subscribe=function(tt){var rt,nt;return(nt=(rt=this.source)===null||rt===void 0?void 0:rt.subscribe(tt))!==null&&nt!==void 0?nt:EMPTY_SUBSCRIPTION},et}(Subject);(function(_e){__extends$1(et,_e);function et(tt){var rt=_e.call(this)||this;return rt._value=tt,rt}return Object.defineProperty(et.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),et.prototype._subscribe=function(tt){var rt=_e.prototype._subscribe.call(this,tt);return!rt.closed&&tt.next(this._value),rt},et.prototype.getValue=function(){var tt=this,rt=tt.hasError,nt=tt.thrownError,st=tt._value;if(rt)throw nt;return this._throwIfClosed(),st},et.prototype.next=function(tt){_e.prototype.next.call(this,this._value=tt)},et})(Subject);var dateTimestampProvider={now:function(){return(dateTimestampProvider.delegate||Date).now()},delegate:void 0};(function(_e){__extends$1(et,_e);function et(tt,rt,nt){tt===void 0&&(tt=1/0),rt===void 0&&(rt=1/0),nt===void 0&&(nt=dateTimestampProvider);var st=_e.call(this)||this;return st._bufferSize=tt,st._windowTime=rt,st._timestampProvider=nt,st._buffer=[],st._infiniteTimeWindow=!0,st._infiniteTimeWindow=rt===1/0,st._bufferSize=Math.max(1,tt),st._windowTime=Math.max(1,rt),st}return et.prototype.next=function(tt){var rt=this,nt=rt.isStopped,st=rt._buffer,ot=rt._infiniteTimeWindow,at=rt._timestampProvider,ut=rt._windowTime;nt||(st.push(tt),!ot&&st.push(at.now()+ut)),this._trimBuffer(),_e.prototype.next.call(this,tt)},et.prototype._subscribe=function(tt){this._throwIfClosed(),this._trimBuffer();for(var rt=this._innerSubscribe(tt),nt=this,st=nt._infiniteTimeWindow,ot=nt._buffer,at=ot.slice(),ut=0;ut<at.length&&!tt.closed;ut+=st?1:2)tt.next(at[ut]);return this._checkFinalizedStatuses(tt),rt},et.prototype._trimBuffer=function(){var tt=this,rt=tt._bufferSize,nt=tt._timestampProvider,st=tt._buffer,ot=tt._infiniteTimeWindow,at=(ot?1:2)*rt;if(rt<1/0&&at<st.length&&st.splice(0,st.length-at),!ot){for(var ut=nt.now(),lt=0,dt=1;dt<st.length&&st[dt]<=ut;dt+=2)lt=dt;lt&&st.splice(0,lt+1)}},et})(Subject);(function(_e){__extends$1(et,_e);function et(){var tt=_e!==null&&_e.apply(this,arguments)||this;return tt._value=null,tt._hasValue=!1,tt._isComplete=!1,tt}return et.prototype._checkFinalizedStatuses=function(tt){var rt=this,nt=rt.hasError,st=rt._hasValue,ot=rt._value,at=rt.thrownError,ut=rt.isStopped,lt=rt._isComplete;nt?tt.error(at):(ut||lt)&&(st&&tt.next(ot),tt.complete())},et.prototype.next=function(tt){this.isStopped||(this._value=tt,this._hasValue=!0)},et.prototype.complete=function(){var tt=this,rt=tt._hasValue,nt=tt._value,st=tt._isComplete;st||(this._isComplete=!0,rt&&_e.prototype.next.call(this,nt),_e.prototype.complete.call(this))},et})(Subject);var Action=function(_e){__extends$1(et,_e);function et(tt,rt){return _e.call(this)||this}return et.prototype.schedule=function(tt,rt){return this},et}(Subscription),intervalProvider={setInterval:function(){for(var _e=[],et=0;et<arguments.length;et++)_e[et]=arguments[et];var tt=intervalProvider.delegate;return((tt==null?void 0:tt.setInterval)||setInterval).apply(void 0,__spreadArray([],__read(_e)))},clearInterval:function(_e){return clearInterval(_e)},delegate:void 0},AsyncAction=function(_e){__extends$1(et,_e);function et(tt,rt){var nt=_e.call(this,tt,rt)||this;return nt.scheduler=tt,nt.work=rt,nt.pending=!1,nt}return et.prototype.schedule=function(tt,rt){if(rt===void 0&&(rt=0),this.closed)return this;this.state=tt;var nt=this.id,st=this.scheduler;return nt!=null&&(this.id=this.recycleAsyncId(st,nt,rt)),this.pending=!0,this.delay=rt,this.id=this.id||this.requestAsyncId(st,this.id,rt),this},et.prototype.requestAsyncId=function(tt,rt,nt){return nt===void 0&&(nt=0),intervalProvider.setInterval(tt.flush.bind(tt,this),nt)},et.prototype.recycleAsyncId=function(tt,rt,nt){if(nt===void 0&&(nt=0),nt!=null&&this.delay===nt&&this.pending===!1)return rt;intervalProvider.clearInterval(rt)},et.prototype.execute=function(tt,rt){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var nt=this._execute(tt,rt);if(nt)return nt;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},et.prototype._execute=function(tt,rt){var nt=!1,st;try{this.work(tt)}catch(ot){nt=!0,st=!!ot&&ot||new Error(ot)}if(nt)return this.unsubscribe(),st},et.prototype.unsubscribe=function(){if(!this.closed){var tt=this,rt=tt.id,nt=tt.scheduler,st=nt.actions;this.work=this.state=this.scheduler=null,this.pending=!1,arrRemove(st,this),rt!=null&&(this.id=this.recycleAsyncId(nt,rt,null)),this.delay=null,_e.prototype.unsubscribe.call(this)}},et}(Action),nextHandle=1,resolved,activeHandles={};function findAndClearHandle(_e){return _e in activeHandles?(delete activeHandles[_e],!0):!1}var Immediate={setImmediate:function(_e){var et=nextHandle++;return activeHandles[et]=!0,resolved||(resolved=Promise.resolve()),resolved.then(function(){return findAndClearHandle(et)&&_e()}),et},clearImmediate:function(_e){findAndClearHandle(_e)}},setImmediate$1=Immediate.setImmediate,clearImmediate=Immediate.clearImmediate,immediateProvider={setImmediate:function(){for(var _e=[],et=0;et<arguments.length;et++)_e[et]=arguments[et];var tt=immediateProvider.delegate;return((tt==null?void 0:tt.setImmediate)||setImmediate$1).apply(void 0,__spreadArray([],__read(_e)))},clearImmediate:function(_e){return clearImmediate(_e)},delegate:void 0},AsapAction=function(_e){__extends$1(et,_e);function et(tt,rt){var nt=_e.call(this,tt,rt)||this;return nt.scheduler=tt,nt.work=rt,nt}return et.prototype.requestAsyncId=function(tt,rt,nt){return nt===void 0&&(nt=0),nt!==null&&nt>0?_e.prototype.requestAsyncId.call(this,tt,rt,nt):(tt.actions.push(this),tt._scheduled||(tt._scheduled=immediateProvider.setImmediate(tt.flush.bind(tt,void 0))))},et.prototype.recycleAsyncId=function(tt,rt,nt){if(nt===void 0&&(nt=0),nt!=null&&nt>0||nt==null&&this.delay>0)return _e.prototype.recycleAsyncId.call(this,tt,rt,nt);tt.actions.length===0&&(immediateProvider.clearImmediate(rt),tt._scheduled=void 0)},et}(AsyncAction),Scheduler=function(){function _e(et,tt){tt===void 0&&(tt=_e.now),this.schedulerActionCtor=et,this.now=tt}return _e.prototype.schedule=function(et,tt,rt){return tt===void 0&&(tt=0),new this.schedulerActionCtor(this,et).schedule(rt,tt)},_e.now=dateTimestampProvider.now,_e}(),AsyncScheduler=function(_e){__extends$1(et,_e);function et(tt,rt){rt===void 0&&(rt=Scheduler.now);var nt=_e.call(this,tt,rt)||this;return nt.actions=[],nt._active=!1,nt._scheduled=void 0,nt}return et.prototype.flush=function(tt){var rt=this.actions;if(this._active){rt.push(tt);return}var nt;this._active=!0;do if(nt=tt.execute(tt.state,tt.delay))break;while(tt=rt.shift());if(this._active=!1,nt){for(;tt=rt.shift();)tt.unsubscribe();throw nt}},et}(Scheduler),AsapScheduler=function(_e){__extends$1(et,_e);function et(){return _e!==null&&_e.apply(this,arguments)||this}return et.prototype.flush=function(tt){this._active=!0,this._scheduled=void 0;var rt=this.actions,nt,st=-1;tt=tt||rt.shift();var ot=rt.length;do if(nt=tt.execute(tt.state,tt.delay))break;while(++st<ot&&(tt=rt.shift()));if(this._active=!1,nt){for(;++st<ot&&(tt=rt.shift());)tt.unsubscribe();throw nt}},et}(AsyncScheduler);new AsapScheduler(AsapAction);new AsyncScheduler(AsyncAction);var QueueAction=function(_e){__extends$1(et,_e);function et(tt,rt){var nt=_e.call(this,tt,rt)||this;return nt.scheduler=tt,nt.work=rt,nt}return et.prototype.schedule=function(tt,rt){return rt===void 0&&(rt=0),rt>0?_e.prototype.schedule.call(this,tt,rt):(this.delay=rt,this.state=tt,this.scheduler.flush(this),this)},et.prototype.execute=function(tt,rt){return rt>0||this.closed?_e.prototype.execute.call(this,tt,rt):this._execute(tt,rt)},et.prototype.requestAsyncId=function(tt,rt,nt){return nt===void 0&&(nt=0),nt!=null&&nt>0||nt==null&&this.delay>0?_e.prototype.requestAsyncId.call(this,tt,rt,nt):tt.flush(this)},et}(AsyncAction),QueueScheduler=function(_e){__extends$1(et,_e);function et(){return _e!==null&&_e.apply(this,arguments)||this}return et}(AsyncScheduler);new QueueScheduler(QueueAction);var AnimationFrameAction=function(_e){__extends$1(et,_e);function et(tt,rt){var nt=_e.call(this,tt,rt)||this;return nt.scheduler=tt,nt.work=rt,nt}return et.prototype.requestAsyncId=function(tt,rt,nt){return nt===void 0&&(nt=0),nt!==null&&nt>0?_e.prototype.requestAsyncId.call(this,tt,rt,nt):(tt.actions.push(this),tt._scheduled||(tt._scheduled=animationFrameProvider.requestAnimationFrame(function(){return tt.flush(void 0)})))},et.prototype.recycleAsyncId=function(tt,rt,nt){if(nt===void 0&&(nt=0),nt!=null&&nt>0||nt==null&&this.delay>0)return _e.prototype.recycleAsyncId.call(this,tt,rt,nt);tt.actions.length===0&&(animationFrameProvider.cancelAnimationFrame(rt),tt._scheduled=void 0)},et}(AsyncAction),AnimationFrameScheduler=function(_e){__extends$1(et,_e);function et(){return _e!==null&&_e.apply(this,arguments)||this}return et.prototype.flush=function(tt){this._active=!0,this._scheduled=void 0;var rt=this.actions,nt,st=-1;tt=tt||rt.shift();var ot=rt.length;do if(nt=tt.execute(tt.state,tt.delay))break;while(++st<ot&&(tt=rt.shift()));if(this._active=!1,nt){for(;++st<ot&&(tt=rt.shift());)tt.unsubscribe();throw nt}},et}(AsyncScheduler);new AnimationFrameScheduler(AnimationFrameAction);(function(_e){__extends$1(et,_e);function et(tt,rt){tt===void 0&&(tt=VirtualAction),rt===void 0&&(rt=1/0);var nt=_e.call(this,tt,function(){return nt.frame})||this;return nt.maxFrames=rt,nt.frame=0,nt.index=-1,nt}return et.prototype.flush=function(){for(var tt=this,rt=tt.actions,nt=tt.maxFrames,st,ot;(ot=rt[0])&&ot.delay<=nt&&(rt.shift(),this.frame=ot.delay,!(st=ot.execute(ot.state,ot.delay))););if(st){for(;ot=rt.shift();)ot.unsubscribe();throw st}},et.frameTimeFactor=10,et})(AsyncScheduler);var VirtualAction=function(_e){__extends$1(et,_e);function et(tt,rt,nt){nt===void 0&&(nt=tt.index+=1);var st=_e.call(this,tt,rt)||this;return st.scheduler=tt,st.work=rt,st.index=nt,st.active=!0,st.index=tt.index=nt,st}return et.prototype.schedule=function(tt,rt){if(rt===void 0&&(rt=0),Number.isFinite(rt)){if(!this.id)return _e.prototype.schedule.call(this,tt,rt);this.active=!1;var nt=new et(this.scheduler,this.work);return this.add(nt),nt.schedule(tt,rt)}else return Subscription.EMPTY},et.prototype.requestAsyncId=function(tt,rt,nt){nt===void 0&&(nt=0),this.delay=tt.frame+nt;var st=tt.actions;return st.push(this),st.sort(et.sortActions),!0},et.prototype.recycleAsyncId=function(tt,rt,nt){},et.prototype._execute=function(tt,rt){if(this.active===!0)return _e.prototype._execute.call(this,tt,rt)},et.sortActions=function(tt,rt){return tt.delay===rt.delay?tt.index===rt.index?0:tt.index>rt.index?1:-1:tt.delay>rt.delay?1:-1},et}(AsyncAction),EMPTY=new Observable(function(_e){return _e.complete()});function scheduleArray(_e,et){return new Observable(function(tt){var rt=0;return et.schedule(function(){rt===_e.length?tt.complete():(tt.next(_e[rt++]),tt.closed||this.schedule())})})}function fromArrayLike(_e){return new Observable(function(et){for(var tt=0;tt<_e.length&&!et.closed;tt++)et.next(_e[tt]);et.complete()})}function internalFromArray(_e,et){return et?scheduleArray(_e,et):fromArrayLike(_e)}function isScheduler(_e){return _e&&isFunction$1(_e.schedule)}function last$1(_e){return _e[_e.length-1]}function popScheduler(_e){return isScheduler(last$1(_e))?_e.pop():void 0}function of(){for(var _e=[],et=0;et<arguments.length;et++)_e[et]=arguments[et];var tt=popScheduler(_e);return tt?scheduleArray(_e,tt):internalFromArray(_e)}function throwError(_e,et){var tt=isFunction$1(_e)?_e:function(){return _e},rt=function(nt){return nt.error(tt())};return new Observable(et?function(nt){return et.schedule(rt,0,nt)}:rt)}var NotificationKind;(function(_e){_e.NEXT="N",_e.ERROR="E",_e.COMPLETE="C"})(NotificationKind||(NotificationKind={}));(function(){function _e(et,tt,rt){this.kind=et,this.value=tt,this.error=rt,this.hasValue=et==="N"}return _e.prototype.observe=function(et){return observeNotification(this,et)},_e.prototype.do=function(et,tt,rt){var nt=this,st=nt.kind,ot=nt.value,at=nt.error;return st==="N"?et==null?void 0:et(ot):st==="E"?tt==null?void 0:tt(at):rt==null?void 0:rt()},_e.prototype.accept=function(et,tt,rt){var nt;return isFunction$1((nt=et)===null||nt===void 0?void 0:nt.next)?this.observe(et):this.do(et,tt,rt)},_e.prototype.toObservable=function(){var et=this,tt=et.kind,rt=et.value,nt=et.error,st=tt==="N"?of(rt):tt==="E"?throwError(function(){return nt}):tt==="C"?EMPTY:0;if(!st)throw new TypeError("Unexpected notification kind "+tt);return st},_e.createNext=function(et){return new _e("N",et)},_e.createError=function(et){return new _e("E",void 0,et)},_e.createComplete=function(){return _e.completeNotification},_e.completeNotification=new _e("C"),_e})();function observeNotification(_e,et){var tt,rt,nt,st=_e,ot=st.kind,at=st.value,ut=st.error;if(typeof ot!="string")throw new TypeError('Invalid notification, missing "kind"');ot==="N"?(tt=et.next)===null||tt===void 0||tt.call(et,at):ot==="E"?(rt=et.error)===null||rt===void 0||rt.call(et,ut):(nt=et.complete)===null||nt===void 0||nt.call(et)}createErrorClass(function(_e){return function(){_e(this),this.name="EmptyError",this.message="no elements in sequence"}});createErrorClass(function(_e){return function(){_e(this),this.name="ArgumentOutOfRangeError",this.message="argument out of range"}});createErrorClass(function(_e){return function(et){_e(this),this.name="NotFoundError",this.message=et}});createErrorClass(function(_e){return function(et){_e(this),this.name="SequenceError",this.message=et}});createErrorClass(function(_e){return function(et){et===void 0&&(et=null),_e(this),this.message="Timeout has occurred",this.name="TimeoutError",this.info=et}});function filter(_e,et){return operate(function(tt,rt){var nt=0;tt.subscribe(new OperatorSubscriber(rt,function(st){return _e.call(et,st,nt++)&&rt.next(st)}))})}(function(_e){__extends$1(et,_e);function et(){var tt=_e!==null&&_e.apply(this,arguments)||this;return tt.activeGroups=0,tt.teardownAttempted=!1,tt}return et.prototype.unsubscribe=function(){this.teardownAttempted=!0,this.activeGroups===0&&_e.prototype.unsubscribe.call(this)},et})(OperatorSubscriber);class Bus{constructor(){m$2(this,"agents",{}),m$2(this,"comm",new Subject)}setAgentFor(et,tt,rt){let nt=this.getActionMapping(et);nt[tt]=rt}getAgentFor(et,tt){return this.getActionMapping(et)[tt]}publish(et,tt,rt){return Promise.resolve().then(()=>{var nt;return(nt=this.getAgentFor(et,tt))!=null?nt:explorer.requestAgentFor(et,tt)}).then(nt=>{const st=nt.activate(et,tt,rt);return this.comm.next({res:et,action:tt,input:rt,output:st}),st})}subscribe(et,tt){return this.comm.asObservable().pipe(filter(rt=>rt.res===et&&rt.action===tt))}getActionMapping(et){let tt=this.agents[et];if(typeof tt>"u"){tt={};for(let rt of Object.values(ACTION))tt[rt]=null;this.agents[et]=tt}return tt}}class BusFactory{static get instance(){return this._instance=this._instance||new Bus}}m$2(BusFactory,"_instance");const y$1=class{constructor(et){m$2(this,"managedResource"),m$2(this,"handlerFor",{comment:y$1.defaultHandler,copy:y$1.defaultHandler,create:y$1.defaultHandler,delete:y$1.defaultHandler,export:y$1.defaultHandler,initialize:y$1.defaultHandler,manage:y$1.defaultHandler,properties:y$1.defaultHandler,move:y$1.defaultHandler,open:y$1.defaultHandler,print:y$1.defaultHandler,publish:y$1.defaultHandler,search:y$1.defaultHandler,share:y$1.defaultHandler,distribute:y$1.defaultHandler,pages_list:y$1.defaultHandler,register:y$1.defaultHandler,trash:y$1.defaultHandler,publish_moodle:y$1.defaultHandler,restore:y$1.defaultHandler}),this.managedResource=et,this.initialize()}initialize(){for(let et in Object.values(ACTION))this.handlerFor[et]=y$1.defaultHandler;this.registerHandlers()}setHandler(et,tt){BusFactory.instance.setAgentFor(this.managedResource,et,this),this.handlerFor[et]=tt}getHandler(et){return this.handlerFor[et]}activate(et,tt,rt){return Promise.resolve().then(()=>this.getHandler(tt).bind(this)(rt))}};let AbstractBusAgent=y$1;m$2(AbstractBusAgent,"defaultHandler",function(_e){throw new Error(ERROR_CODE.NOT_SUPPORTED)});console.log("Blog agent loading....");class BlogAgent extends AbstractBusAgent{constructor(){super(RESOURCE.BLOG),m$2(this,"ctx",null),m$2(this,"http",TransportFrameworkFactory.instance().newHttpInstance()),m$2(this,"checkHttpResponse",et=>{if(this.http.latestResponse.status>=300)throw this.http.latestResponse.statusText;return et}),this.registerHandlers(),console.log("Blog agent initialized!")}registerHandlers(){this.setHandler(ACTION.OPEN,this.openBlog),this.setHandler(ACTION.CREATE,this.createBlog),this.setHandler(ACTION.MANAGE,this.onManage),this.setHandler(ACTION.UPD_PROPS,this.onUpdateProps),this.setHandler(ACTION.PRINT,this.onPrint),this.setHandler(ACTION.PUBLISH,this.onPublish)}onPrint(et){window.open(`/blog/print/blog#/print/${et.resourceId}?comments=${et.withComments||!0}`,"_blank")}openBlog(et){window.open(`/blog#/view/${et.resourceId}`,"_self")}createBlog(et){window.open("/blog#/edit/new","_self")}onManage(et){const tt={genericProps:[{key:PROP_KEY.TITLE},{key:PROP_KEY.IMAGE},{key:PROP_KEY.URL}]};return Promise.resolve().then(()=>tt)}onUpdateProps(et){const tt={resources:et.resources};return alert("TODO: update properties"),Promise.resolve().then(()=>tt)}async onPublish(et){const tt=new FormData;return tt.append("title",et.title),tt.append("cover",et.cover),tt.append("coverName",et.cover.name),tt.append("coverType",et.cover.type),tt.append("teacherAvatar",et.teacherAvatar),tt.append("teacherAvatarName",et.teacherAvatar.name||`teacherAvatar_${et.userId}`),tt.append("teacherAvatarType",et.teacherAvatar.type),tt.append("language",et.language),et.activityType.forEach(rt=>{tt.append("activityType[]",rt)}),et.subjectArea.forEach(rt=>{tt.append("subjectArea[]",rt)}),et.age.forEach(rt=>{tt.append("age[]",rt.toString())}),tt.append("description",et.description),et.keyWords.split(",").forEach(rt=>{tt.append("keyWords[]",rt.trim())}),tt.append("licence",et.licence),tt.append("pdfUri",`${window.location.origin}/blog/print/blog#/print/${et.resourceId}`),tt.append("application",et.application?et.application:""),tt.append("resourceId",et.resourceId),tt.append("teacherSchool",et.userStructureName),this.http.post("/appregistry/library/resource",tt,{headers:{"Content-Type":"multipart/form-data"}}).then(this.checkHttpResponse)}}const factory$2=()=>new BlogAgent;class FolderAgent extends AbstractBusAgent{constructor(){super(RESOURCE.FOLDER),m$2(this,"ctx",null),m$2(this,"http",TransportFrameworkFactory.instance().newHttpInstance({paramsSerializer:function(et){return Object.entries(et).map(tt=>tt[1]instanceof Array?tt[1].map(rt=>`${tt[0]}=${encodeURIComponent(rt)}`).join("&"):["string","number","boolean"].indexOf(typeof tt[1])>=0?`${tt[0]}=${encodeURIComponent(tt[1])}`:"").join("&")}})),m$2(this,"checkHttpResponse",et=>{if(this.http.latestResponse.status>=300)throw this.http.latestResponse.statusText;return et}),this.registerHandlers()}registerHandlers(){this.setHandler(ACTION.INITIALIZE,this.createContext),this.setHandler(ACTION.SEARCH,this.searchContext),this.setHandler(ACTION.CREATE,this.createFolder),this.setHandler(ACTION.OPEN,this.listSubfolders),this.setHandler(ACTION.MOVE,this.moveToFolder),this.setHandler(ACTION.DELETE,this.deleteFolders),this.setHandler(ACTION.TRASH,this.trashFolders),this.setHandler(ACTION.MANAGE,this.onManage),this.setHandler(ACTION.UPD_PROPS,this.updateFolder)}createContext(et){return this.http.get("/explorer/context",{queryParams:this.toQueryParams(et)}).then(this.checkHttpResponse)}searchContext(et){return this.http.get("/explorer/resources",{queryParams:this.toQueryParams(et)}).then(this.checkHttpResponse)}createFolder(et){return this.http.post("/explorer/folders",this.createFolderToBodyParams(et)).then(this.checkHttpResponse)}updateFolder(et){return this.http.put(`/explorer/folders/${et.folderId}`,this.createFolderToBodyParams(et)).then(this.checkHttpResponse)}moveToFolder(et){return this.http.post(`/explorer/folders/${et.folderId}/move`,this.moveToBodyParams(et)).then(this.checkHttpResponse)}listSubfolders(et){return this.http.get(`/explorer/folders/${et}/move`).then(this.checkHttpResponse)}deleteFolders(et){return this.http.deleteJson("/explorer",et).then(this.checkHttpResponse)}trashFolders({trash:et,resourceType:tt,...rt}){return this.http.putJson(`/explorer/${et?"trash":"restore"}`,rt).then(this.checkHttpResponse)}onManage(et){const tt={genericProps:[{key:PROP_KEY.TITLE},{key:PROP_KEY.IMAGE},{key:PROP_KEY.URL}]};return Promise.resolve().then(()=>tt)}toQueryParams(et){let tt={application:et.app,start_idx:et.pagination.startIdx,page_size:et.pagination.pageSize,resource_type:et.types};return et.orders&&(tt.order_by=Object.entries(et.orders).map(rt=>`${rt[0]}:${rt[1]}`)),et.filters&&Object.assign(tt,et.filters),typeof et.search=="string"&&(tt.search=et.search),tt}createFolderToBodyParams(et){return{application:et.app,resourceType:et.type,parentId:et.parentId,name:et.name}}moveToBodyParams(et){return{application:et.application,resourceType:this.managedResource,resourceIds:et.resourceIds,folderIds:et.folderIds}}}const factory$1=()=>new FolderAgent;console.log("Mindmap agent loading....");class MindmapAgent extends AbstractBusAgent{constructor(){super(RESOURCE.MINDMAP),m$2(this,"ctx",null),m$2(this,"http",TransportFrameworkFactory.instance().newHttpInstance()),m$2(this,"checkHttpResponse",et=>{if(this.http.latestResponse.status>=300)throw this.http.latestResponse.statusText;return et}),this.registerHandlers(),console.log("Mindmap agent initialized!")}registerHandlers(){this.setHandler(ACTION.OPEN,this.openMindmap),this.setHandler(ACTION.CREATE,this.createMindmap),this.setHandler(ACTION.MANAGE,this.onManage),this.setHandler(ACTION.UPD_PROPS,this.onUpdateProps),this.setHandler(ACTION.PRINT,this.onPrint),this.setHandler(ACTION.PUBLISH,this.onPublish)}onPrint(et){window.open(`/blog/print/blog#/print/${et.resourceId}?comments=${et.withComments||!0}`,"_blank")}openMindmap(et){window.open(`/mindmap/id/${et.resourceId}`,"_self")}createMindmap(et){window.open("/blog#/edit/new","_self")}onManage(et){const tt={genericProps:[{key:PROP_KEY.TITLE},{key:PROP_KEY.IMAGE},{key:PROP_KEY.URL}]};return Promise.resolve().then(()=>tt)}onUpdateProps(et){const tt={resources:et.resources};return alert("TODO: update properties"),Promise.resolve().then(()=>tt)}async onPublish(et){const tt=new FormData;return tt.append("title",et.title),tt.append("cover",et.cover),tt.append("coverName",et.cover.name),tt.append("coverType",et.cover.type),tt.append("teacherAvatar",et.teacherAvatar),tt.append("teacherAvatarName",et.teacherAvatar.name||`teacherAvatar_${et.userId}`),tt.append("teacherAvatarType",et.teacherAvatar.type),tt.append("language",et.language),et.activityType.forEach(rt=>{tt.append("activityType[]",rt)}),et.subjectArea.forEach(rt=>{tt.append("subjectArea[]",rt)}),et.age.forEach(rt=>{tt.append("age[]",rt.toString())}),tt.append("description",et.description),et.keyWords.split(",").forEach(rt=>{tt.append("keyWords[]",rt.trim())}),tt.append("licence",et.licence),tt.append("pdfUri",`${window.location.origin}/blog/print/blog#/print/${et.resourceId}`),tt.append("application",et.application?et.application:""),tt.append("resourceId",et.resourceId),tt.append("teacherSchool",et.userStructureName),this.http.post("/appregistry/library/resource",tt,{headers:{"Content-Type":"multipart/form-data"}}).then(this.checkHttpResponse)}}const factory=()=>new MindmapAgent;class AgentLoader{load(et){let tt=appNameForResource[et];if(typeof tt!="string")throw new Error(`The resource type ${et} is not supported yet.`);switch(tt){case APP.EXPLORER:factory$1();break;case APP.BLOG:factory$2();break;case APP.MINDMAP:factory();break;default:throw new Error(`The resource type ${et} is not supported yet.`)}return Promise.resolve()}}class ExplorerContext{constructor(et,tt){m$2(this,"searchParameters"),m$2(this,"context"),m$2(this,"bus"),m$2(this,"latestResults",new Subject),this.context=null,this.bus=ExplorerFrameworkFactory.instance().getBus(),this.searchParameters={types:et,app:tt,filters:{},pagination:{startIdx:0,pageSize:20}}}clear(){this.searchParameters.filters={owner:!0,shared:!0,public:!0},this.searchParameters.pagination.startIdx=0,this.searchParameters.pagination.pageSize=20,this.context=null}isInitialized(){return this.context!==null}getContext(){if(this.context!==null)return this.context}getSearchParameters(){return this.searchParameters}duplicateSearchParameters(){return JSON.parse(JSON.stringify(this.searchParameters))}latestResources(){return this.latestResults.asObservable()}initialize(){const et=this.duplicateSearchParameters();return Promise.resolve().then(()=>this.bus.publish(RESOURCE.FOLDER,ACTION.INITIALIZE,et)).then(tt=>{if(this.context=tt,!this.context)throw new Error(ERROR_CODE.UNKNOWN);return this.latestResults.next({input:et,output:this.context}),this.context})}getResources(){const et=this.duplicateSearchParameters();return this.bus.publish(RESOURCE.FOLDER,ACTION.SEARCH,et).then(tt=>{let rt=tt;if(!rt)throw new Error(ERROR_CODE.UNKNOWN);return this.latestResults.next({input:et,output:rt}),rt})}getSubFolders(et){throw new Error("Method not implemented.")}createFolder(et,tt,rt){const nt={app:this.searchParameters.app,name:rt,parentId:tt,type:et};return this.bus.publish(RESOURCE.FOLDER,ACTION.CREATE,nt).then(st=>{let ot=st;if(!ot)throw new Error(ERROR_CODE.UNKNOWN);return ot})}updateFolder(et,tt,rt,nt){const st={folderId:et,app:this.searchParameters.app,name:nt,parentId:rt,type:tt};return this.bus.publish(RESOURCE.FOLDER,ACTION.UPD_PROPS,st).then(ot=>{let at=ot;if(!at)throw new Error(ERROR_CODE.UNKNOWN);return at})}copy(et,tt,rt){const nt={application:this.searchParameters.app,folderId:et,resourceIds:tt,folderIds:rt};return this.bus.publish(RESOURCE.FOLDER,ACTION.COPY,nt).then(st=>{})}move(et,tt,rt){const nt={application:this.searchParameters.app,folderId:et,resourceIds:tt,folderIds:rt};return this.bus.publish(RESOURCE.FOLDER,ACTION.MOVE,nt).then(st=>{})}delete(et,tt){const rt={application:this.searchParameters.app,resourceType:this.searchParameters.types[0],resourceIds:et,folderIds:tt};return this.bus.publish(RESOURCE.FOLDER,ACTION.DELETE,rt).then(nt=>{})}trash(et,tt,rt){const nt={trash:et,application:this.searchParameters.app,resourceType:this.searchParameters.types[0],resourceIds:tt,folderIds:rt};return this.bus.publish(RESOURCE.FOLDER,ACTION.TRASH,nt).then(st=>{})}manageProperties(et,tt){const rt={resources:tt};return this.bus.publish(et,ACTION.MANAGE,rt).then(nt=>{let st=nt;if(!st)throw new Error(ERROR_CODE.UNKNOWN);return st})}updateProperties(et,tt,rt){const nt={resources:tt,props:rt};return this.bus.publish(et,ACTION.UPD_PROPS,nt).then(st=>{let ot=st;if(!ot)throw new Error(ERROR_CODE.UNKNOWN);return ot})}publish(et,tt){return this.bus.publish(et,ACTION.PUBLISH,tt).then(rt=>{let nt=rt;if(!nt)throw new Error(ERROR_CODE.UNKNOWN);return nt})}}class ExplorerFramework{constructor(){m$2(this,"_agentLoader")}get agentLoader(){return this._agentLoader||(this._agentLoader=new AgentLoader),this._agentLoader}setAgentLoader(et){et&&(this._agentLoader=et)}requestAgentFor(et,tt){return this.agentLoader.load(et).then(()=>{let rt=this.getBus().getAgentFor(et,tt);if(!rt)throw new Error(ERROR_CODE.AGENT_NOT_FOUND);return rt})}createContext(et,tt){return new ExplorerContext(et,tt)}getBus(){return BusFactory.instance}}const explorer=new ExplorerFramework;class ExplorerFrameworkFactory{static instance(){return explorer}}const RESOURCE={FOLDER:"folder",BLOG:"blog",EXERCISE:"exercise",MINDMAP:"mindmap"},appNameForResource={folder:APP.EXPLORER,blog:APP.BLOG,exercise:APP.EXERCIZER,mindmap:APP.MINDMAP},ACTION={INITIALIZE:"initialize",SEARCH:"search",CREATE:"create",OPEN:"open",MANAGE:"manage",UPD_PROPS:"properties",COMMENT:"comment",DELETE:"delete",TRASH:"trash",RESTORE:"restore",MOVE:"move",COPY:"copy",EXPORT:"export",SHARE:"share",PRINT:"print",PAGES_LIST:"pages_list",DISTRIBUTE:"distribute",REGISTER:"register",PUBLISH:"publish",PUBLISH_MOODLE:"publish_moodle"},FOLDER={BIN:"bin",DEFAULT:"default"},PROP_KEY={TITLE:"title",IMAGE:"image",COLOR:"color",DESCRIPTION:"description",URL:"url"},ASYNC_DATA_NAME={SESSION_READY:"sessionReady",LANG_READY:"langReady",SKIN_READY:"skinReady",OVERRIDE_READY:"overrideReady"};class Promisified{constructor(){m$2(this,"_resolution"),m$2(this,"_rejection"),m$2(this,"_promise",new Promise((et,tt)=>{this._resolution=et,this._rejection=tt}))}get promise(){return this._promise}resolve(et){this._resolution&&this._resolution(et)}reject(et){this._rejection&&this._rejection(et)}}class NotifyFramework{constructor(){m$2(this,"promises",{}),m$2(this,"subject",new Subject)}asyncData(et){return typeof this.promises[et]>"u"&&(this.promises[et]=new Promisified),this.promises[et]}onSessionReady(){return this.asyncData(ASYNC_DATA_NAME.SESSION_READY)}onLangReady(){return this.asyncData(ASYNC_DATA_NAME.LANG_READY)}onSkinReady(){return this.asyncData(ASYNC_DATA_NAME.SKIN_READY)}onOverridesReady(){return this.asyncData(ASYNC_DATA_NAME.OVERRIDE_READY)}promisify(){return new Promisified}events(){return this.subject}}const notify=new NotifyFramework,LAYER_NAME={WIDGETS:"widgets",EXPLORER:"explorer"},EVENT_NAME={USERPREF_CHANGED:"userprefChanged",SEARCH_RESULTED:"searchResulted"};function getDefaultExportFromCjs(_e){return _e&&_e.__esModule&&Object.prototype.hasOwnProperty.call(_e,"default")?_e.default:_e}var axios$3={exports:{}},axios$2={exports:{}},bind$2=function(_e,et){return function(){for(var tt=new Array(arguments.length),rt=0;rt<tt.length;rt++)tt[rt]=arguments[rt];return _e.apply(et,tt)}},bind$1=bind$2,toString=Object.prototype.toString;function isArray(_e){return toString.call(_e)==="[object Array]"}function isUndefined(_e){return typeof _e>"u"}function isBuffer(_e){return _e!==null&&!isUndefined(_e)&&_e.constructor!==null&&!isUndefined(_e.constructor)&&typeof _e.constructor.isBuffer=="function"&&_e.constructor.isBuffer(_e)}function isArrayBuffer(_e){return toString.call(_e)==="[object ArrayBuffer]"}function isFormData(_e){return typeof FormData<"u"&&_e instanceof FormData}function isArrayBufferView(_e){var et;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?et=ArrayBuffer.isView(_e):et=_e&&_e.buffer&&_e.buffer instanceof ArrayBuffer,et}function isString(_e){return typeof _e=="string"}function isNumber(_e){return typeof _e=="number"}function isObject(_e){return _e!==null&&typeof _e=="object"}function isPlainObject(_e){if(toString.call(_e)!=="[object Object]")return!1;var et=Object.getPrototypeOf(_e);return et===null||et===Object.prototype}function isDate(_e){return toString.call(_e)==="[object Date]"}function isFile(_e){return toString.call(_e)==="[object File]"}function isBlob(_e){return toString.call(_e)==="[object Blob]"}function isFunction(_e){return toString.call(_e)==="[object Function]"}function isStream(_e){return isObject(_e)&&isFunction(_e.pipe)}function isURLSearchParams(_e){return typeof URLSearchParams<"u"&&_e instanceof URLSearchParams}function trim$1(_e){return _e.replace(/^\s*/,"").replace(/\s*$/,"")}function isStandardBrowserEnv(){return typeof navigator<"u"&&(navigator.product==="ReactNative"||navigator.product==="NativeScript"||navigator.product==="NS")?!1:typeof window<"u"&&typeof document<"u"}function forEach(_e,et){if(!(_e===null||typeof _e>"u"))if(typeof _e!="object"&&(_e=[_e]),isArray(_e))for(var tt=0,rt=_e.length;tt<rt;tt++)et.call(null,_e[tt],tt,_e);else for(var nt in _e)Object.prototype.hasOwnProperty.call(_e,nt)&&et.call(null,_e[nt],nt,_e)}function merge(){var _e={};function et(nt,st){isPlainObject(_e[st])&&isPlainObject(nt)?_e[st]=merge(_e[st],nt):isPlainObject(nt)?_e[st]=merge({},nt):isArray(nt)?_e[st]=nt.slice():_e[st]=nt}for(var tt=0,rt=arguments.length;tt<rt;tt++)forEach(arguments[tt],et);return _e}function extend(_e,et,tt){return forEach(et,function(rt,nt){tt&&typeof rt=="function"?_e[nt]=bind$1(rt,tt):_e[nt]=rt}),_e}function stripBOM(_e){return _e.charCodeAt(0)===65279&&(_e=_e.slice(1)),_e}var utils$9={isArray,isArrayBuffer,isBuffer,isFormData,isArrayBufferView,isString,isNumber,isObject,isPlainObject,isUndefined,isDate,isFile,isBlob,isFunction,isStream,isURLSearchParams,isStandardBrowserEnv,forEach,merge,extend,trim:trim$1,stripBOM},utils$8=utils$9;function encode(_e){return encodeURIComponent(_e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var buildURL$1=function(_e,et,tt){if(!et)return _e;var rt;if(tt)rt=tt(et);else if(utils$8.isURLSearchParams(et))rt=et.toString();else{var nt=[];utils$8.forEach(et,function(ot,at){ot===null||typeof ot>"u"||(utils$8.isArray(ot)?at=at+"[]":ot=[ot],utils$8.forEach(ot,function(ut){utils$8.isDate(ut)?ut=ut.toISOString():utils$8.isObject(ut)&&(ut=JSON.stringify(ut)),nt.push(encode(at)+"="+encode(ut))}))}),rt=nt.join("&")}if(rt){var st=_e.indexOf("#");st!==-1&&(_e=_e.slice(0,st)),_e+=(_e.indexOf("?")===-1?"?":"&")+rt}return _e},utils$7=utils$9;function InterceptorManager$1(){this.handlers=[]}InterceptorManager$1.prototype.use=function(_e,et){return this.handlers.push({fulfilled:_e,rejected:et}),this.handlers.length-1};InterceptorManager$1.prototype.eject=function(_e){this.handlers[_e]&&(this.handlers[_e]=null)};InterceptorManager$1.prototype.forEach=function(_e){utils$7.forEach(this.handlers,function(et){et!==null&&_e(et)})};var InterceptorManager_1=InterceptorManager$1,utils$6=utils$9,transformData$1=function(_e,et,tt){return utils$6.forEach(tt,function(rt){_e=rt(_e,et)}),_e},isCancel$1,hasRequiredIsCancel;function requireIsCancel(){return hasRequiredIsCancel||(hasRequiredIsCancel=1,isCancel$1=function(_e){return!!(_e&&_e.__CANCEL__)}),isCancel$1}var utils$5=utils$9,normalizeHeaderName$1=function(_e,et){utils$5.forEach(_e,function(tt,rt){rt!==et&&rt.toUpperCase()===et.toUpperCase()&&(_e[et]=tt,delete _e[rt])})},enhanceError,hasRequiredEnhanceError;function requireEnhanceError(){return hasRequiredEnhanceError||(hasRequiredEnhanceError=1,enhanceError=function(_e,et,tt,rt,nt){return _e.config=et,tt&&(_e.code=tt),_e.request=rt,_e.response=nt,_e.isAxiosError=!0,_e.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code}},_e}),enhanceError}var createError,hasRequiredCreateError;function requireCreateError(){if(hasRequiredCreateError)return createError;hasRequiredCreateError=1;var _e=requireEnhanceError();return createError=function(et,tt,rt,nt,st){var ot=new Error(et);return _e(ot,tt,rt,nt,st)},createError}var settle,hasRequiredSettle;function requireSettle(){if(hasRequiredSettle)return settle;hasRequiredSettle=1;var _e=requireCreateError();return settle=function(et,tt,rt){var nt=rt.config.validateStatus;!rt.status||!nt||nt(rt.status)?et(rt):tt(_e("Request failed with status code "+rt.status,rt.config,null,rt.request,rt))},settle}var cookies,hasRequiredCookies;function requireCookies(){if(hasRequiredCookies)return cookies;hasRequiredCookies=1;var _e=utils$9;return cookies=_e.isStandardBrowserEnv()?function(){return{write:function(et,tt,rt,nt,st,ot){var at=[];at.push(et+"="+encodeURIComponent(tt)),_e.isNumber(rt)&&at.push("expires="+new Date(rt).toGMTString()),_e.isString(nt)&&at.push("path="+nt),_e.isString(st)&&at.push("domain="+st),ot===!0&&at.push("secure"),document.cookie=at.join("; ")},read:function(et){var tt=document.cookie.match(new RegExp("(^|;\\s*)("+et+")=([^;]*)"));return tt?decodeURIComponent(tt[3]):null},remove:function(et){this.write(et,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}(),cookies}var isAbsoluteURL,hasRequiredIsAbsoluteURL;function requireIsAbsoluteURL(){return hasRequiredIsAbsoluteURL||(hasRequiredIsAbsoluteURL=1,isAbsoluteURL=function(_e){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(_e)}),isAbsoluteURL}var combineURLs,hasRequiredCombineURLs;function requireCombineURLs(){return hasRequiredCombineURLs||(hasRequiredCombineURLs=1,combineURLs=function(_e,et){return et?_e.replace(/\/+$/,"")+"/"+et.replace(/^\/+/,""):_e}),combineURLs}var buildFullPath,hasRequiredBuildFullPath;function requireBuildFullPath(){if(hasRequiredBuildFullPath)return buildFullPath;hasRequiredBuildFullPath=1;var _e=requireIsAbsoluteURL(),et=requireCombineURLs();return buildFullPath=function(tt,rt){return tt&&!_e(rt)?et(tt,rt):rt},buildFullPath}var parseHeaders,hasRequiredParseHeaders;function requireParseHeaders(){if(hasRequiredParseHeaders)return parseHeaders;hasRequiredParseHeaders=1;var _e=utils$9,et=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];return parseHeaders=function(tt){var rt={},nt,st,ot;return tt&&_e.forEach(tt.split(`
|
|
64
|
-
`),function(at){if(ot=at.indexOf(":"),nt=_e.trim(at.substr(0,ot)).toLowerCase(),st=_e.trim(at.substr(ot+1)),nt){if(rt[nt]&&et.indexOf(nt)>=0)return;nt==="set-cookie"?rt[nt]=(rt[nt]?rt[nt]:[]).concat([st]):rt[nt]=rt[nt]?rt[nt]+", "+st:st}}),rt},parseHeaders}var isURLSameOrigin,hasRequiredIsURLSameOrigin;function requireIsURLSameOrigin(){if(hasRequiredIsURLSameOrigin)return isURLSameOrigin;hasRequiredIsURLSameOrigin=1;var _e=utils$9;return isURLSameOrigin=_e.isStandardBrowserEnv()?function(){var et=/(msie|trident)/i.test(navigator.userAgent),tt=document.createElement("a"),rt;function nt(st){var ot=st;return et&&(tt.setAttribute("href",ot),ot=tt.href),tt.setAttribute("href",ot),{href:tt.href,protocol:tt.protocol?tt.protocol.replace(/:$/,""):"",host:tt.host,search:tt.search?tt.search.replace(/^\?/,""):"",hash:tt.hash?tt.hash.replace(/^#/,""):"",hostname:tt.hostname,port:tt.port,pathname:tt.pathname.charAt(0)==="/"?tt.pathname:"/"+tt.pathname}}return rt=nt(window.location.href),function(st){var ot=_e.isString(st)?nt(st):st;return ot.protocol===rt.protocol&&ot.host===rt.host}}():function(){return function(){return!0}}(),isURLSameOrigin}var xhr,hasRequiredXhr;function requireXhr(){if(hasRequiredXhr)return xhr;hasRequiredXhr=1;var _e=utils$9,et=requireSettle(),tt=requireCookies(),rt=buildURL$1,nt=requireBuildFullPath(),st=requireParseHeaders(),ot=requireIsURLSameOrigin(),at=requireCreateError();return xhr=function(ut){return new Promise(function(lt,dt){var ct=ut.data,ft=ut.headers;_e.isFormData(ct)&&delete ft["Content-Type"];var ht=new XMLHttpRequest;if(ut.auth){var mt=ut.auth.username||"",vt=ut.auth.password?unescape(encodeURIComponent(ut.auth.password)):"";ft.Authorization="Basic "+btoa(mt+":"+vt)}var wt=nt(ut.baseURL,ut.url);if(ht.open(ut.method.toUpperCase(),rt(wt,ut.params,ut.paramsSerializer),!0),ht.timeout=ut.timeout,ht.onreadystatechange=function(){if(!(!ht||ht.readyState!==4)&&!(ht.status===0&&!(ht.responseURL&&ht.responseURL.indexOf("file:")===0))){var yt="getAllResponseHeaders"in ht?st(ht.getAllResponseHeaders()):null,xt=!ut.responseType||ut.responseType==="text"?ht.responseText:ht.response,St={data:xt,status:ht.status,statusText:ht.statusText,headers:yt,config:ut,request:ht};et(lt,dt,St),ht=null}},ht.onabort=function(){!ht||(dt(at("Request aborted",ut,"ECONNABORTED",ht)),ht=null)},ht.onerror=function(){dt(at("Network Error",ut,null,ht)),ht=null},ht.ontimeout=function(){var yt="timeout of "+ut.timeout+"ms exceeded";ut.timeoutErrorMessage&&(yt=ut.timeoutErrorMessage),dt(at(yt,ut,"ECONNABORTED",ht)),ht=null},_e.isStandardBrowserEnv()){var gt=(ut.withCredentials||ot(wt))&&ut.xsrfCookieName?tt.read(ut.xsrfCookieName):void 0;gt&&(ft[ut.xsrfHeaderName]=gt)}if("setRequestHeader"in ht&&_e.forEach(ft,function(yt,xt){typeof ct>"u"&&xt.toLowerCase()==="content-type"?delete ft[xt]:ht.setRequestHeader(xt,yt)}),_e.isUndefined(ut.withCredentials)||(ht.withCredentials=!!ut.withCredentials),ut.responseType)try{ht.responseType=ut.responseType}catch(yt){if(ut.responseType!=="json")throw yt}typeof ut.onDownloadProgress=="function"&&ht.addEventListener("progress",ut.onDownloadProgress),typeof ut.onUploadProgress=="function"&&ht.upload&&ht.upload.addEventListener("progress",ut.onUploadProgress),ut.cancelToken&&ut.cancelToken.promise.then(function(yt){!ht||(ht.abort(),dt(yt),ht=null)}),ct||(ct=null),ht.send(ct)})},xhr}var utils$4=utils$9,normalizeHeaderName=normalizeHeaderName$1,DEFAULT_CONTENT_TYPE={"Content-Type":"application/x-www-form-urlencoded"};function setContentTypeIfUnset(_e,et){!utils$4.isUndefined(_e)&&utils$4.isUndefined(_e["Content-Type"])&&(_e["Content-Type"]=et)}function getDefaultAdapter(){var _e;return(typeof XMLHttpRequest<"u"||typeof process<"u"&&Object.prototype.toString.call(process)==="[object process]")&&(_e=requireXhr()),_e}var defaults$2={adapter:getDefaultAdapter(),transformRequest:[function(_e,et){return normalizeHeaderName(et,"Accept"),normalizeHeaderName(et,"Content-Type"),utils$4.isFormData(_e)||utils$4.isArrayBuffer(_e)||utils$4.isBuffer(_e)||utils$4.isStream(_e)||utils$4.isFile(_e)||utils$4.isBlob(_e)?_e:utils$4.isArrayBufferView(_e)?_e.buffer:utils$4.isURLSearchParams(_e)?(setContentTypeIfUnset(et,"application/x-www-form-urlencoded;charset=utf-8"),_e.toString()):utils$4.isObject(_e)?(setContentTypeIfUnset(et,"application/json;charset=utf-8"),JSON.stringify(_e)):_e}],transformResponse:[function(_e){if(typeof _e=="string")try{_e=JSON.parse(_e)}catch{}return _e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(_e){return _e>=200&&_e<300}};defaults$2.headers={common:{Accept:"application/json, text/plain, */*"}};utils$4.forEach(["delete","get","head"],function(_e){defaults$2.headers[_e]={}});utils$4.forEach(["post","put","patch"],function(_e){defaults$2.headers[_e]=utils$4.merge(DEFAULT_CONTENT_TYPE)});var defaults_1=defaults$2,utils$3=utils$9,transformData=transformData$1,isCancel=requireIsCancel(),defaults$1=defaults_1;function throwIfCancellationRequested(_e){_e.cancelToken&&_e.cancelToken.throwIfRequested()}var dispatchRequest$1=function(_e){throwIfCancellationRequested(_e),_e.headers=_e.headers||{},_e.data=transformData(_e.data,_e.headers,_e.transformRequest),_e.headers=utils$3.merge(_e.headers.common||{},_e.headers[_e.method]||{},_e.headers),utils$3.forEach(["delete","get","head","post","put","patch","common"],function(tt){delete _e.headers[tt]});var et=_e.adapter||defaults$1.adapter;return et(_e).then(function(tt){return throwIfCancellationRequested(_e),tt.data=transformData(tt.data,tt.headers,_e.transformResponse),tt},function(tt){return isCancel(tt)||(throwIfCancellationRequested(_e),tt&&tt.response&&(tt.response.data=transformData(tt.response.data,tt.response.headers,_e.transformResponse))),Promise.reject(tt)})},utils$2=utils$9,mergeConfig$2=function(_e,et){et=et||{};var tt={},rt=["url","method","data"],nt=["headers","auth","proxy","params"],st=["baseURL","transformRequest","transformResponse","paramsSerializer","timeout","timeoutMessage","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","decompress","maxContentLength","maxBodyLength","maxRedirects","transport","httpAgent","httpsAgent","cancelToken","socketPath","responseEncoding"],ot=["validateStatus"];function at(ct,ft){return utils$2.isPlainObject(ct)&&utils$2.isPlainObject(ft)?utils$2.merge(ct,ft):utils$2.isPlainObject(ft)?utils$2.merge({},ft):utils$2.isArray(ft)?ft.slice():ft}function ut(ct){utils$2.isUndefined(et[ct])?utils$2.isUndefined(_e[ct])||(tt[ct]=at(void 0,_e[ct])):tt[ct]=at(_e[ct],et[ct])}utils$2.forEach(rt,function(ct){utils$2.isUndefined(et[ct])||(tt[ct]=at(void 0,et[ct]))}),utils$2.forEach(nt,ut),utils$2.forEach(st,function(ct){utils$2.isUndefined(et[ct])?utils$2.isUndefined(_e[ct])||(tt[ct]=at(void 0,_e[ct])):tt[ct]=at(void 0,et[ct])}),utils$2.forEach(ot,function(ct){ct in et?tt[ct]=at(_e[ct],et[ct]):ct in _e&&(tt[ct]=at(void 0,_e[ct]))});var lt=rt.concat(nt).concat(st).concat(ot),dt=Object.keys(_e).concat(Object.keys(et)).filter(function(ct){return lt.indexOf(ct)===-1});return utils$2.forEach(dt,ut),tt},utils$1=utils$9,buildURL=buildURL$1,InterceptorManager=InterceptorManager_1,dispatchRequest=dispatchRequest$1,mergeConfig$1=mergeConfig$2;function Axios$1(_e){this.defaults=_e,this.interceptors={request:new InterceptorManager,response:new InterceptorManager}}Axios$1.prototype.request=function(_e){typeof _e=="string"?(_e=arguments[1]||{},_e.url=arguments[0]):_e=_e||{},_e=mergeConfig$1(this.defaults,_e),_e.method?_e.method=_e.method.toLowerCase():this.defaults.method?_e.method=this.defaults.method.toLowerCase():_e.method="get";var et=[dispatchRequest,void 0],tt=Promise.resolve(_e);for(this.interceptors.request.forEach(function(rt){et.unshift(rt.fulfilled,rt.rejected)}),this.interceptors.response.forEach(function(rt){et.push(rt.fulfilled,rt.rejected)});et.length;)tt=tt.then(et.shift(),et.shift());return tt};Axios$1.prototype.getUri=function(_e){return _e=mergeConfig$1(this.defaults,_e),buildURL(_e.url,_e.params,_e.paramsSerializer).replace(/^\?/,"")};utils$1.forEach(["delete","get","head","options"],function(_e){Axios$1.prototype[_e]=function(et,tt){return this.request(mergeConfig$1(tt||{},{method:_e,url:et,data:(tt||{}).data}))}});utils$1.forEach(["post","put","patch"],function(_e){Axios$1.prototype[_e]=function(et,tt,rt){return this.request(mergeConfig$1(rt||{},{method:_e,url:et,data:tt}))}});var Axios_1=Axios$1,Cancel_1,hasRequiredCancel;function requireCancel(){if(hasRequiredCancel)return Cancel_1;hasRequiredCancel=1;function _e(et){this.message=et}return _e.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},_e.prototype.__CANCEL__=!0,Cancel_1=_e,Cancel_1}var CancelToken_1,hasRequiredCancelToken;function requireCancelToken(){if(hasRequiredCancelToken)return CancelToken_1;hasRequiredCancelToken=1;var _e=requireCancel();function et(tt){if(typeof tt!="function")throw new TypeError("executor must be a function.");var rt;this.promise=new Promise(function(st){rt=st});var nt=this;tt(function(st){nt.reason||(nt.reason=new _e(st),rt(nt.reason))})}return et.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},et.source=function(){var tt,rt=new et(function(nt){tt=nt});return{token:rt,cancel:tt}},CancelToken_1=et,CancelToken_1}var spread,hasRequiredSpread;function requireSpread(){return hasRequiredSpread||(hasRequiredSpread=1,spread=function(_e){return function(et){return _e.apply(null,et)}}),spread}var isAxiosError,hasRequiredIsAxiosError;function requireIsAxiosError(){return hasRequiredIsAxiosError||(hasRequiredIsAxiosError=1,isAxiosError=function(_e){return typeof _e=="object"&&_e.isAxiosError===!0}),isAxiosError}var utils=utils$9,bind=bind$2,Axios=Axios_1,mergeConfig$3=mergeConfig$2,defaults$3=defaults_1;function createInstance(_e){var et=new Axios(_e),tt=bind(Axios.prototype.request,et);return utils.extend(tt,Axios.prototype,et),utils.extend(tt,et),tt}var axios$1=createInstance(defaults$3);axios$1.Axios=Axios;axios$1.create=function(_e){return createInstance(mergeConfig$3(axios$1.defaults,_e))};axios$1.Cancel=requireCancel();axios$1.CancelToken=requireCancelToken();axios$1.isCancel=requireIsCancel();axios$1.all=function(_e){return Promise.all(_e)};axios$1.spread=requireSpread();axios$1.isAxiosError=requireIsAxiosError();axios$2.exports=axios$1;axios$2.exports.default=axios$1;(function(_e){_e.exports=axios$2.exports})(axios$3);const axios=getDefaultExportFromCjs(axios$3.exports),loadedScripts$1={};class Http{constructor(et){m$2(this,"axios"),m$2(this,"_latestResponse"),this.axios=axios.create(et)}setCdn(et){et&&XMLHttpRequest&&!XMLHttpRequest.prototype.cdnUrl&&(XMLHttpRequest.prototype.cdnUrl=et,XMLHttpRequest.prototype.baseOpen=XMLHttpRequest.prototype.open,XMLHttpRequest.prototype.open=function(){const tt=arguments[1];return tt.startsWith("/infra/public")&&(arguments[1]=et+tt),/^\/([^\/]*)\/public/.test(tt)&&(arguments[1]=et+tt),tt.startsWith("/assets")&&(arguments[1]=et+tt),tt=="/conf/public"&&(arguments[1]=tt),tt.startsWith("http")&&(arguments[1]=tt),this.baseOpen.apply(this,arguments)})}toAxiosConfig(et){if(et){const tt=Object.assign({},this.axios.defaults);return et.headers&&(tt.headers&&(tt.headers=Object.assign({},this.axios.defaults.headers)),Object.assign(tt.headers,et.headers)),et.responseType&&(tt.responseType=et.responseType),et.queryParams&&(tt.params=Object.assign({},et.queryParams)),tt}else return this.axios.defaults}toCdnUrl(et){const tt=ConfigurationFrameworkFactory.instance().Platform.cdnDomain;if((tt==null?void 0:tt.length)>0&&et!=="/conf/public"){const rt=""+et;(rt.startsWith("/infra/public")||rt.startsWith("/assets")||/^\/([^\/]*)\/public/.test(rt))&&(et=tt+rt)}return et}mapAxiosError(et,tt){return et.response?this._latestResponse=et.response:et.request?this._latestResponse={status:408,statusText:ERROR_CODE.TIME_OUT}:this._latestResponse={status:500,statusText:ERROR_CODE.UNKNOWN},!tt||tt.disableNotifications,this._latestResponse}mapAxiosResponse(et,tt){return this._latestResponse=et,et.data}get latestResponse(){return this._latestResponse}get(et,tt){return this.axios.get(this.toCdnUrl(et),this.toAxiosConfig(tt)).then(rt=>this.mapAxiosResponse(rt,tt)).catch(rt=>this.mapAxiosError(rt,tt))}post(et,tt,rt){return this.axios.post(et,tt,this.toAxiosConfig(rt)).then(nt=>this.mapAxiosResponse(nt,rt)).catch(nt=>this.mapAxiosError(nt,rt))}postFile(et,tt,rt){const nt=this.toAxiosConfig(rt);return nt.headers&&nt.headers["Content-Type"]&&delete nt.headers["Content-Type"],this.axios.post(et,tt,nt).then(st=>this.mapAxiosResponse(st,rt)).catch(st=>this.mapAxiosError(st,rt))}postJson(et,tt,rt){const nt=this.toAxiosConfig();return nt.headers&&(nt.headers["Content-Type"]="application/json"),this.axios.post(et,tt,this.toAxiosConfig(rt)).then(st=>this.mapAxiosResponse(st,rt)).catch(st=>this.mapAxiosError(st,rt))}put(et,tt,rt){return this.axios.put(et,tt,this.toAxiosConfig(rt)).then(nt=>this.mapAxiosResponse(nt,rt)).catch(nt=>this.mapAxiosError(nt,rt))}putJson(et,tt,rt){const nt=this.toAxiosConfig(rt);return nt.headers&&(nt.headers["Content-Type"]="application/json"),this.axios.put(et,tt,nt).then(st=>this.mapAxiosResponse(st,rt)).catch(st=>this.mapAxiosError(st,rt))}delete(et,tt){return this.axios.delete(et,this.toAxiosConfig(tt)).then(rt=>this.mapAxiosResponse(rt,tt)).catch(rt=>this.mapAxiosError(rt,tt))}deleteJson(et,tt){return this.axios.delete(et,{data:tt}).then(rt=>this.mapAxiosResponse(rt)).catch(rt=>this.mapAxiosError(rt))}getScript(et,tt,rt){const nt=rt??"exports",st=this.toAxiosConfig(tt);return st.headers&&(st.headers.Accept="application/javascript"),this.axios.get(this.toCdnUrl(et),st).then(ot=>this.mapAxiosResponse(ot,tt)).then(ot=>{try{const at=`"use strict";var ${nt.split(".")[0]}={};${ot};return ${nt};`;return Function(at)()}catch{return ot}}).catch(ot=>{throw this.mapAxiosError(ot,tt),ot})}loadScript(et,tt){return loadedScripts$1[et]?Promise.resolve():this.getScript(et,tt).then(rt=>{loadedScripts$1[et]=!0})}}class TransportFramework{constructor(){m$2(this,"_http",new Http)}get http(){return this._http}newHttpInstance(et){return new Http(et)}}const transport=new TransportFramework;class TransportFrameworkFactory{static instance(){return transport}}const http$2=transport.http;class Session{constructor(){m$2(this,"_me",null),m$2(this,"_currentLanguage",""),m$2(this,"_notLoggedIn",!0),m$2(this,"_description"),m$2(this,"_profile")}get currentLanguage(){return this._currentLanguage}get notLoggedIn(){return this._notLoggedIn}get description(){return this._description}get avatarUrl(){let et=this.description.photo;return(!et||et==="no-avatar.jpg"||et==="no-avatar.svg")&&(et=ConfigurationFrameworkFactory.instance().Platform.theme.basePath+"/img/illustrations/no-avatar.svg"),et}get user(){return this._me}get currentApp(){return configure.Platform.apps.currentApp}async initialize(){return http$2.get("/auth/oauth2/userinfo").then(et=>{if(http$2.latestResponse.status<200||http$2.latestResponse.status>=300)throw ERROR_CODE.NOT_LOGGED_IN;return this.setCurrentModel(et),this._notLoggedIn?this.loadDefaultLanguage():this.loadUserLanguage()}).then(et=>(this.setCurrentLanguage(et),this.loadDescription())).then(()=>this.getUserProfile()).then(()=>{notify.onSessionReady().resolve(this._me)}).catch(et=>{if(et===ERROR_CODE.NOT_LOGGED_IN)return Promise.resolve();notify.onSessionReady().reject(et)})}setCurrentModel(et){this._me=et,this._notLoggedIn=!(et&&et.sessionMetadata&&et.sessionMetadata.userId)}hasWorkflow(et){var tt;return et===void 0||((tt=this._me)==null?void 0:tt.authorizedActions.findIndex(rt=>rt.name===et))!==-1}hasRight(et,tt){if(tt==="owner")return et.owner&&et.owner.userId===this._me.userId;const rt=tt.right||tt,nt=et.shared.filter(ot=>(this._me.groupsIds||[]).indexOf(ot.groupId)!==-1||ot.userId===this._me.userId).find(ot=>ot[rt]||ot.manager)!==void 0,st=tt.workflow?this.hasWorkflow(tt.workflow):!0;return nt&&st}get latestQuotaAndUsage(){return http$2.get(`/workspace/quota/user/${this._me.userId}`).then(et=>(this._description&&(this._description.quota=et.quota,this._description.storage=et.storage),et)).catch(()=>({quota:0,storage:0}))}setCurrentLanguage(et){this._currentLanguage=et,notify.onLangReady().resolve(et)}loadDefaultLanguage(){return http$2.get("/locale").then(et=>et.locale).catch(()=>this._currentLanguage)}loadDescription(){return Promise.all([http$2.get("/userbook/api/person",{requestName:"refreshAvatar"}),http$2.get("/directory/userbook/"+this._me.userId)]).then(et=>(et[0].status==="ok"&&et[0].result&&et[0].result.length>0?this._description=et[0].result[0]:this._description={},this._description.type&&!this._description.profiles&&(this._description.profiles=this._description.type),Object.assign(this._description,et[1]),this._description))}get profile(){return this._profile}getUserProfile(){return http$2.get("/userbook/api/person").then(et=>et.result).then(et=>this._profile=et[0].type)}loadUserLanguage(){return http$2.get("/userbook/preference/language").then(et=>{try{return JSON.parse(et.preference)["default-domain"]}catch{return this.loadDefaultLanguage()}}).catch(()=>this.loadDefaultLanguage())}getEmailValidationInfos(){return http$2.get("/directory/user/mailstate")}checkEmail(et){return http$2.put("/directory/user/mailstate",{email:et})}tryEmailValidation(et){return http$2.post("/directory/user/mailstate",{key:et})}getMobileValidationInfos(){return http$2.get("/directory/user/mobilestate")}checkMobile(et){return http$2.put("/directory/user/mobilestate",{mobile:et})}tryMobileValidation(et){return http$2.post("/directory/user/mobilestate",{key:et})}getMfaInfos(){return http$2.get("/auth/user/mfa/code")}tryMfaCode(et){return http$2.post("/auth/user/mfa/code",{key:et})}}class SessionFramework{constructor(){m$2(this,"session",new Session)}initialize(){return this.session.initialize()}login(et,tt,rt,nt){const st=new FormData;return st.append("email",et),st.append("password",tt),typeof rt<"u"&&st.append("rememberMe",""+rt),typeof nt<"u"&&st.append("secureLocation",""+nt),transport.http.post("/auth/login",st,{headers:{"content-type":"application/x-www-form-urlencoded"}}).finally(()=>{switch(transport.http.latestResponse.status){case 200:throw ERROR_CODE.MALFORMED_DATA}})}logout(){return transport.http.get("/auth/logout").finally(()=>{})}}const session=new SessionFramework;class Theme{constructor(){m$2(this,"_conf"),m$2(this,"_loaded"),m$2(this,"skinName",""),m$2(this,"themeName",""),m$2(this,"skin","raw"),m$2(this,"themeUrl","/assets/themes/raw/default/"),m$2(this,"templateOverrides",{}),m$2(this,"portalTemplate","/assets/themes/raw/portal.html"),m$2(this,"basePath",""),m$2(this,"logoutCallback","/"),m$2(this,"skins",[]),m$2(this,"is1D",!1),m$2(this,"is2D",!1),m$2(this,"_onSkinReady",notify.onSkinReady()),m$2(this,"_onOverrideReady",notify.onOverridesReady())}initialize(et){return notify.onSessionReady().promise.then(()=>this.load(et))}get version(){return configure.Platform.deploymentTag}get cdnDomain(){return configure.Platform.cdnDomain}async onFullyReady(){return await this._loaded,this}onSkinReady(){return this._onSkinReady.promise}onOverrideReady(){return this._onOverrideReady.promise}async getConf(et){var tt;return this._conf=(tt=this._conf)!=null?tt:await transport.http.getScript("/assets/theme-conf.js",{queryParams:{v:et??this.version}},"exports.conf"),this._conf}load(et){return et=et??this.version,this._loaded||(this._loaded=(session.session.notLoggedIn?this.loadDisconnected(et):this.loadConnected(et)).then(async()=>{var tt,rt;const nt=await this.listSkins();this.is1D=((tt=nt.find(st=>st.child===this.skin))==null?void 0:tt.parent)==="panda",this.is2D=((rt=nt.find(st=>st.child===this.skin))==null?void 0:rt.parent)==="theme-open-ent"})),this._loaded}loadDisconnected(et){return new Promise((tt,rt)=>{transport.http.get("/skin",{queryParams:{v:this.version}}).then(nt=>{this.skin=nt.skin,this.themeUrl=`${this.cdnDomain}/assets/themes/${nt.skin}/skins/default/`,this.basePath=this.themeUrl+"../../",this._onSkinReady.resolve(this),transport.http.get(`/assets/themes/${nt.skin}/template/override.json`,{disableNotifications:!0,queryParams:{v:et}}).then(st=>{this.templateOverrides=st,this._onOverrideReady.resolve(st),tt()}).catch(st=>{if(transport.http.latestResponse.status===404)tt();else throw st})}).catch(nt=>{this._onSkinReady.reject(nt),this._onOverrideReady.reject(nt),rt()})})}loadConnected(et){return new Promise((tt,rt)=>{this.loadDefaultTheme(et).then(()=>{this._onSkinReady.resolve(this),transport.http.get(`/assets/themes/${this.skin}/template/override.json`,{disableNotifications:!0,queryParams:{v:et}}).then(nt=>{this.templateOverrides=nt,this._onOverrideReady.resolve(nt),tt()}).catch(nt=>{if(transport.http.latestResponse.status===404)tt(),this._onSkinReady.reject(nt),this._onOverrideReady.reject(nt);else throw nt})})})}async loadDefaultTheme(et){return session.session.notLoggedIn?Promise.reject():transport.http.get("/theme",{queryParams:{_:et}}).then(tt=>{this.skinName=tt.skinName,this.themeName=tt.themeName,this.themeUrl=tt.skin,this.basePath=`${this.cdnDomain}${this.themeUrl}../../`,this.skin=this.themeUrl.split("/assets/themes/")[1].split("/")[0],this.portalTemplate=`${this.cdnDomain}/assets/themes/${this.skin}/portal.html`,this.logoutCallback=tt.logoutCallback})}listThemes(){return transport.http.get("/themes")}async setDefaultTheme(et){await transport.http.get("/userbook/api/edit-userbook-info?prop=theme-"+this.skin+"&value="+et._id),await this.loadDefaultTheme(this.version)}listSkins(){return this.skins.length>0?Promise.resolve(this.skins):this.getConf().then(et=>{const tt=et.overriding.find(rt=>rt.child===this.skin);return tt!=null&&tt.group?this.skins=this.skins.concat(et.overriding.filter(rt=>rt.group===tt.group)):this.skins=this.skins.concat(et.overriding),this.skins})}async getHelpPath(){var et;const tt=(await this.listSkins()).find(rt=>rt.child===this.skin);return(et=tt==null?void 0:tt.help)!=null?et:"/help"}}const bundle$1={},promises$1={},defaultDiacriticsRemovalMap$1=[{base:"A",letters:/[\u0041\u24B6\uFF21\u00C0\u00C1\u00C2\u1EA6\u1EA4\u1EAA\u1EA8\u00C3\u0100\u0102\u1EB0\u1EAE\u1EB4\u1EB2\u0226\u01E0\u00C4\u01DE\u1EA2\u00C5\u01FA\u01CD\u0200\u0202\u1EA0\u1EAC\u1EB6\u1E00\u0104\u023A\u2C6F]/g},{base:"AA",letters:/[\uA732]/g},{base:"AE",letters:/[\u00C6\u01FC\u01E2]/g},{base:"AO",letters:/[\uA734]/g},{base:"AU",letters:/[\uA736]/g},{base:"AV",letters:/[\uA738\uA73A]/g},{base:"AY",letters:/[\uA73C]/g},{base:"B",letters:/[\u0042\u24B7\uFF22\u1E02\u1E04\u1E06\u0243\u0182\u0181]/g},{base:"C",letters:/[\u0043\u24B8\uFF23\u0106\u0108\u010A\u010C\u00C7\u1E08\u0187\u023B\uA73E]/g},{base:"D",letters:/[\u0044\u24B9\uFF24\u1E0A\u010E\u1E0C\u1E10\u1E12\u1E0E\u0110\u018B\u018A\u0189\uA779]/g},{base:"DZ",letters:/[\u01F1\u01C4]/g},{base:"Dz",letters:/[\u01F2\u01C5]/g},{base:"E",letters:/[\u0045\u24BA\uFF25\u00C8\u00C9\u00CA\u1EC0\u1EBE\u1EC4\u1EC2\u1EBC\u0112\u1E14\u1E16\u0114\u0116\u00CB\u1EBA\u011A\u0204\u0206\u1EB8\u1EC6\u0228\u1E1C\u0118\u1E18\u1E1A\u0190\u018E]/g},{base:"F",letters:/[\u0046\u24BB\uFF26\u1E1E\u0191\uA77B]/g},{base:"G",letters:/[\u0047\u24BC\uFF27\u01F4\u011C\u1E20\u011E\u0120\u01E6\u0122\u01E4\u0193\uA7A0\uA77D\uA77E]/g},{base:"H",letters:/[\u0048\u24BD\uFF28\u0124\u1E22\u1E26\u021E\u1E24\u1E28\u1E2A\u0126\u2C67\u2C75\uA78D]/g},{base:"I",letters:/[\u0049\u24BE\uFF29\u00CC\u00CD\u00CE\u0128\u012A\u012C\u0130\u00CF\u1E2E\u1EC8\u01CF\u0208\u020A\u1ECA\u012E\u1E2C\u0197]/g},{base:"J",letters:/[\u004A\u24BF\uFF2A\u0134\u0248]/g},{base:"K",letters:/[\u004B\u24C0\uFF2B\u1E30\u01E8\u1E32\u0136\u1E34\u0198\u2C69\uA740\uA742\uA744\uA7A2]/g},{base:"L",letters:/[\u004C\u24C1\uFF2C\u013F\u0139\u013D\u1E36\u1E38\u013B\u1E3C\u1E3A\u0141\u023D\u2C62\u2C60\uA748\uA746\uA780]/g},{base:"LJ",letters:/[\u01C7]/g},{base:"Lj",letters:/[\u01C8]/g},{base:"M",letters:/[\u004D\u24C2\uFF2D\u1E3E\u1E40\u1E42\u2C6E\u019C]/g},{base:"N",letters:/[\u004E\u24C3\uFF2E\u01F8\u0143\u00D1\u1E44\u0147\u1E46\u0145\u1E4A\u1E48\u0220\u019D\uA790\uA7A4]/g},{base:"NJ",letters:/[\u01CA]/g},{base:"Nj",letters:/[\u01CB]/g},{base:"O",letters:/[\u004F\u24C4\uFF2F\u00D2\u00D3\u00D4\u1ED2\u1ED0\u1ED6\u1ED4\u00D5\u1E4C\u022C\u1E4E\u014C\u1E50\u1E52\u014E\u022E\u0230\u00D6\u022A\u1ECE\u0150\u01D1\u020C\u020E\u01A0\u1EDC\u1EDA\u1EE0\u1EDE\u1EE2\u1ECC\u1ED8\u01EA\u01EC\u00D8\u01FE\u0186\u019F\uA74A\uA74C]/g},{base:"OI",letters:/[\u01A2]/g},{base:"OO",letters:/[\uA74E]/g},{base:"OU",letters:/[\u0222]/g},{base:"P",letters:/[\u0050\u24C5\uFF30\u1E54\u1E56\u01A4\u2C63\uA750\uA752\uA754]/g},{base:"Q",letters:/[\u0051\u24C6\uFF31\uA756\uA758\u024A]/g},{base:"R",letters:/[\u0052\u24C7\uFF32\u0154\u1E58\u0158\u0210\u0212\u1E5A\u1E5C\u0156\u1E5E\u024C\u2C64\uA75A\uA7A6\uA782]/g},{base:"S",letters:/[\u0053\u24C8\uFF33\u1E9E\u015A\u1E64\u015C\u1E60\u0160\u1E66\u1E62\u1E68\u0218\u015E\u2C7E\uA7A8\uA784]/g},{base:"T",letters:/[\u0054\u24C9\uFF34\u1E6A\u0164\u1E6C\u021A\u0162\u1E70\u1E6E\u0166\u01AC\u01AE\u023E\uA786]/g},{base:"TZ",letters:/[\uA728]/g},{base:"U",letters:/[\u0055\u24CA\uFF35\u00D9\u00DA\u00DB\u0168\u1E78\u016A\u1E7A\u016C\u00DC\u01DB\u01D7\u01D5\u01D9\u1EE6\u016E\u0170\u01D3\u0214\u0216\u01AF\u1EEA\u1EE8\u1EEE\u1EEC\u1EF0\u1EE4\u1E72\u0172\u1E76\u1E74\u0244]/g},{base:"V",letters:/[\u0056\u24CB\uFF36\u1E7C\u1E7E\u01B2\uA75E\u0245]/g},{base:"VY",letters:/[\uA760]/g},{base:"W",letters:/[\u0057\u24CC\uFF37\u1E80\u1E82\u0174\u1E86\u1E84\u1E88\u2C72]/g},{base:"X",letters:/[\u0058\u24CD\uFF38\u1E8A\u1E8C]/g},{base:"Y",letters:/[\u0059\u24CE\uFF39\u1EF2\u00DD\u0176\u1EF8\u0232\u1E8E\u0178\u1EF6\u1EF4\u01B3\u024E\u1EFE]/g},{base:"Z",letters:/[\u005A\u24CF\uFF3A\u0179\u1E90\u017B\u017D\u1E92\u1E94\u01B5\u0224\u2C7F\u2C6B\uA762]/g},{base:"a",letters:/[\u0061\u24D0\uFF41\u1E9A\u00E0\u00E1\u00E2\u1EA7\u1EA5\u1EAB\u1EA9\u00E3\u0101\u0103\u1EB1\u1EAF\u1EB5\u1EB3\u0227\u01E1\u00E4\u01DF\u1EA3\u00E5\u01FB\u01CE\u0201\u0203\u1EA1\u1EAD\u1EB7\u1E01\u0105\u2C65\u0250]/g},{base:"aa",letters:/[\uA733]/g},{base:"ae",letters:/[\u00E6\u01FD\u01E3]/g},{base:"ao",letters:/[\uA735]/g},{base:"au",letters:/[\uA737]/g},{base:"av",letters:/[\uA739\uA73B]/g},{base:"ay",letters:/[\uA73D]/g},{base:"b",letters:/[\u0062\u24D1\uFF42\u1E03\u1E05\u1E07\u0180\u0183\u0253]/g},{base:"c",letters:/[\u0063\u24D2\uFF43\u0107\u0109\u010B\u010D\u00E7\u1E09\u0188\u023C\uA73F\u2184]/g},{base:"d",letters:/[\u0064\u24D3\uFF44\u1E0B\u010F\u1E0D\u1E11\u1E13\u1E0F\u0111\u018C\u0256\u0257\uA77A]/g},{base:"dz",letters:/[\u01F3\u01C6]/g},{base:"e",letters:/[\u0065\u24D4\uFF45\u00E8\u00E9\u00EA\u1EC1\u1EBF\u1EC5\u1EC3\u1EBD\u0113\u1E15\u1E17\u0115\u0117\u00EB\u1EBB\u011B\u0205\u0207\u1EB9\u1EC7\u0229\u1E1D\u0119\u1E19\u1E1B\u0247\u025B\u01DD]/g},{base:"f",letters:/[\u0066\u24D5\uFF46\u1E1F\u0192\uA77C]/g},{base:"g",letters:/[\u0067\u24D6\uFF47\u01F5\u011D\u1E21\u011F\u0121\u01E7\u0123\u01E5\u0260\uA7A1\u1D79\uA77F]/g},{base:"h",letters:/[\u0068\u24D7\uFF48\u0125\u1E23\u1E27\u021F\u1E25\u1E29\u1E2B\u1E96\u0127\u2C68\u2C76\u0265]/g},{base:"hv",letters:/[\u0195]/g},{base:"i",letters:/[\u0069\u24D8\uFF49\u00EC\u00ED\u00EE\u0129\u012B\u012D\u00EF\u1E2F\u1EC9\u01D0\u0209\u020B\u1ECB\u012F\u1E2D\u0268\u0131]/g},{base:"j",letters:/[\u006A\u24D9\uFF4A\u0135\u01F0\u0249]/g},{base:"k",letters:/[\u006B\u24DA\uFF4B\u1E31\u01E9\u1E33\u0137\u1E35\u0199\u2C6A\uA741\uA743\uA745\uA7A3]/g},{base:"l",letters:/[\u006C\u24DB\uFF4C\u0140\u013A\u013E\u1E37\u1E39\u013C\u1E3D\u1E3B\u017F\u0142\u019A\u026B\u2C61\uA749\uA781\uA747]/g},{base:"lj",letters:/[\u01C9]/g},{base:"m",letters:/[\u006D\u24DC\uFF4D\u1E3F\u1E41\u1E43\u0271\u026F]/g},{base:"n",letters:/[\u006E\u24DD\uFF4E\u01F9\u0144\u00F1\u1E45\u0148\u1E47\u0146\u1E4B\u1E49\u019E\u0272\u0149\uA791\uA7A5]/g},{base:"nj",letters:/[\u01CC]/g},{base:"o",letters:/[\u006F\u24DE\uFF4F\u00F2\u00F3\u00F4\u1ED3\u1ED1\u1ED7\u1ED5\u00F5\u1E4D\u022D\u1E4F\u014D\u1E51\u1E53\u014F\u022F\u0231\u00F6\u022B\u1ECF\u0151\u01D2\u020D\u020F\u01A1\u1EDD\u1EDB\u1EE1\u1EDF\u1EE3\u1ECD\u1ED9\u01EB\u01ED\u00F8\u01FF\u0254\uA74B\uA74D\u0275]/g},{base:"oi",letters:/[\u01A3]/g},{base:"ou",letters:/[\u0223]/g},{base:"oo",letters:/[\uA74F]/g},{base:"p",letters:/[\u0070\u24DF\uFF50\u1E55\u1E57\u01A5\u1D7D\uA751\uA753\uA755]/g},{base:"q",letters:/[\u0071\u24E0\uFF51\u024B\uA757\uA759]/g},{base:"r",letters:/[\u0072\u24E1\uFF52\u0155\u1E59\u0159\u0211\u0213\u1E5B\u1E5D\u0157\u1E5F\u024D\u027D\uA75B\uA7A7\uA783]/g},{base:"s",letters:/[\u0073\u24E2\uFF53\u00DF\u015B\u1E65\u015D\u1E61\u0161\u1E67\u1E63\u1E69\u0219\u015F\u023F\uA7A9\uA785\u1E9B]/g},{base:"t",letters:/[\u0074\u24E3\uFF54\u1E6B\u1E97\u0165\u1E6D\u021B\u0163\u1E71\u1E6F\u0167\u01AD\u0288\u2C66\uA787]/g},{base:"tz",letters:/[\uA729]/g},{base:"u",letters:/[\u0075\u24E4\uFF55\u00F9\u00FA\u00FB\u0169\u1E79\u016B\u1E7B\u016D\u00FC\u01DC\u01D8\u01D6\u01DA\u1EE7\u016F\u0171\u01D4\u0215\u0217\u01B0\u1EEB\u1EE9\u1EEF\u1EED\u1EF1\u1EE5\u1E73\u0173\u1E77\u1E75\u0289]/g},{base:"v",letters:/[\u0076\u24E5\uFF56\u1E7D\u1E7F\u028B\uA75F\u028C]/g},{base:"vy",letters:/[\uA761]/g},{base:"w",letters:/[\u0077\u24E6\uFF57\u1E81\u1E83\u0175\u1E87\u1E85\u1E98\u1E89\u2C73]/g},{base:"x",letters:/[\u0078\u24E7\uFF58\u1E8B\u1E8D]/g},{base:"y",letters:/[\u0079\u24E8\uFF59\u1EF3\u00FD\u0177\u1EF9\u0233\u1E8F\u00FF\u1EF7\u1E99\u1EF5\u01B4\u024F\u1EFF]/g},{base:"z",letters:/[\u007A\u24E9\uFF5A\u017A\u1E91\u017C\u017E\u1E93\u1E95\u01B6\u0225\u0240\u2C6C\uA763]/g}];class Idiom{translate(et,tt){et=et??"";let rt=bundle$1[et]===void 0?et:bundle$1[et];if(tt&&typeof tt=="object")for(let nt in tt)typeof tt[nt]<"u"&&(rt=rt.replace(new RegExp("\\${"+nt+"}","g"),""+tt[nt]));return rt}addBundlePromise(et){return this.loadBundlePromise(session.session.currentLanguage,et)}addBundle(et,tt){this.loadBundle(session.session.currentLanguage,et,tt)}loadBundlePromise(et,tt){return this.loadBundle(et,tt),promises$1[tt]}loadBundle(et,tt,rt){const nt=promises$1[tt];if(nt)rt&&nt.then(rt).catch(rt);else{const st=new Promisified;promises$1[tt]=st.promise;const ot={};et&&(ot["Accept-Language"]=et),transport.http.get(tt,{headers:ot}).then(at=>{Object.assign(bundle$1,at),typeof rt=="function"&&rt(),st.resolve()}).catch(at=>{typeof rt=="function"&&rt(),st.reject()})}}addTranslations(et,tt){notify.onLangReady().promise.then(rt=>{this.loadBundle(rt,et+"/"+rt+".json",tt)})}addAllTranslations(et){return et&&et.length>0?notify.onLangReady().promise.then(tt=>Promise.all(et.map(rt=>this.loadBundlePromise(tt,rt+"/"+tt+".json")))).then(()=>{}):Promise.reject()}addKeys(et){for(var tt in et)typeof bundle$1[tt]!="string"&&(bundle$1[tt]=et[tt])}removeAccents(et){for(var tt=0;tt<defaultDiacriticsRemovalMap$1.length;tt++)et=et.replace(defaultDiacriticsRemovalMap$1[tt].letters,defaultDiacriticsRemovalMap$1[tt].base);return et}}class UserPreferences{constructor(){m$2(this,"data",{})}get(et){return this.data[et]}load(et,tt){return transport.http.get("/userbook/preference/"+et).then(rt=>{try{return JSON.parse(rt.preference)}catch{return tt??{}}}).then(rt=>(this.data[et]=rt??{},rt))}update(et,tt){return tt!==void 0&&(this.data[et]=tt),this}save(et){return transport.http.putJson("/userbook/preference/"+et,this.data[et])}}class User{constructor(){m$2(this,"_me",null),m$2(this,"_keepOpenOnLogout",!1),m$2(this,"_preferences",new UserPreferences),m$2(this,"_bookmarkedApps",[])}get keepOpenOnLogout(){return this._keepOpenOnLogout}get preferences(){return this._preferences}get bookmarkedApps(){return this._bookmarkedApps}initialize(et){return this.loadPublicConf(),notify.onSessionReady().promise.then(tt=>{tt&&this.setCurrentModel(tt)})}setCurrentModel(et){this._me=et,this._preferences=new UserPreferences,this.loadBookmarks()}loadPublicConf(){return transport.http.get("/conf/public").then(et=>(this._keepOpenOnLogout=(et==null?void 0:et.keepOpenOnLogout)||!1,et))}async loadBookmarks(){await transport.http.get("/userbook/preference/apps").then(et=>{et.preference||(et.preference=null);const tt=JSON.parse(et.preference);let rt;if(tt&&tt.length&&typeof tt.concat=="function"){this._bookmarkedApps=tt,rt={bookmarks:tt.map(ot=>ot.name),applications:[]},transport.http.putJson("/userbook/preference/apps",rt);return}else rt=tt;rt||(rt={bookmarks:[],applications:[]});let nt=!0;const st=[];rt.bookmarks.forEach((ot,at)=>{const ut=this._me.apps.find(lt=>lt.name===ot);if(ut){let lt=Object.assign({},ut);this._bookmarkedApps.push(lt)}else st.push(ot),nt=!1}),st.forEach(ot=>{let at=rt.bookmarks.indexOf(ot);at!==-1&&rt.bookmarks.splice(at,1)}),nt||transport.http.putJson("/userbook/preference/apps",rt)})}loadAppPrefs(et){return this.preferences.load(et,{})}saveAppPrefs(et){return this.preferences.save(et)}loadLanguage(){return this.preferences.load("language",{"default-domain":session.session.currentLanguage}).then(et=>et["default-domain"])}saveLanguage(et){return this.preferences.update("language",{"default-domain":et}).save("language")}}const http$1=transport==null?void 0:transport.http;class AppConf{constructor(){m$2(this,"_publicConf",{}),m$2(this,"_currentApp"),m$2(this,"_appConf",{})}get currentApp(){var et;return(et=this._currentApp)!=null?et:null}setCurrentApp(et){return this._currentApp=et,this}async initialize(et,tt=!1){tt||this.setCurrentApp(et),await Promise.all([this.getPublicConf(et),this.loadI18n(et)])}async getPublicConf(et){return this._publicConf[et]||(this._publicConf[et]=await http$1.get(`/${et}/conf/public`,{queryParams:{_:configure.Platform.deploymentTag}})),this._publicConf[et]}async getWebAppConf(et){var tt;let rt;return this._appConf[et]||(await http$1.get("/applications-list")).apps.forEach(nt=>{if(nt!=null&&nt.prefix){const st=nt.prefix.replace("/","");this._appConf[st]=nt}else nt!=null&&nt.name&&nt.name.toLowerCase()==et&&(rt=nt)}),(tt=this._appConf[et])!=null?tt:rt}async loadI18n(et){return await notify.onLangReady().promise,configure.Platform.idiom.addBundlePromise(`/${et}/i18n`)}}class Analytics{constructor(){m$2(this,"_status","void"),m$2(this,"_params")}get status(){return this._status}xiti(){return this.parametersWithCheck("xiti",!1)}parameters(et){return this.parametersWithCheck(et,!0)}async parametersWithCheck(et,tt){return this.initialize().promise.then(rt=>!tt||rt.type===et||rt.type==="multiple"?rt[et]:void 0)}initialize(){return this._params||(this._params=notify.promisify(),this._status="pending",Promise.all([transport.http.get("/analyticsConf"),transport.http.get("/xiti/config")]).then(async et=>{var tt;if(!et||!et[0]||!et[0].type)throw ERROR_CODE.MALFORMED_DATA;et[1]&&et[1].active&&(et[0].xiti=await this.initializeXiti(et[1])),(tt=this._params)==null||tt.resolve(et[0]),this._status="ready"}).catch(et=>{var tt;throw this._status="failed",(tt=this._params)==null||tt.reject(),et})),this._params}async initializeXiti(et){var tt;if(!et.structureMap||!configure.Platform.apps.currentApp)return;const rt=await notify.onSessionReady().promise,nt=session.session.description;let st;for(let dt of rt.structures){const ct=et.structureMap[dt];if(ct&&ct.collectiviteId&&ct.UAI){st=ct;break}}if(!st||!st.active)return;const ot=await configure.Platform.apps.getPublicConf(configure.Platform.apps.currentApp);if(!ot)return;const at=ot.xiti;if(!at||!at.LIBELLE_SERVICE||!st.UAI)return;function ut(dt){let ct="";for(let ft=0;ft<dt.length;ft++)ct+=dt.charCodeAt(ft);return ct}const lt={Student:"ELEVE",Teacher:"ENSEIGNANT",Relative:"PARENT",Personnel:"ADMIN_VIE_SCOL_TECH",Guest:"AUTRE"};return{LIBELLE_SERVICE:at.LIBELLE_SERVICE,TYPE:at.OUTIL?"TIERS":"NATIF",OUTIL:at.OUTIL?at.OUTIL:"",STRUCT_ID:st.collectiviteId,STRUCT_UAI:st.UAI,PROJET:st.projetId?st.projetId:et.ID_PROJET,EXPLOITANT:et.ID_EXPLOITANT,PLATFORME:st.plateformeId?st.plateformeId:et.ID_PLATEFORME,ID_PERSO:ut(rt.userId),PROFILE:nt.profiles&&nt.profiles.length>0&&(tt=lt[nt.profiles[0]])!=null?tt:""}}}class ConfigurationFramework{constructor(){m$2(this,"Platform",{deploymentTag:"",cdnDomain:"",apps:new AppConf,theme:new Theme,analytics:new Analytics,idiom:new Idiom,listLanguages:()=>transport.http.get("/languages")}),m$2(this,"School",{}),m$2(this,"User",new User)}async initialize(et,tt){if(!et){const nt=lt=>(lt<10?"0":"")+lt.toFixed(0),st=new Date,ot=st.getFullYear(),at=st.getMonth()+1,ut=st.getDate();et=`${ot}${nt(at)}${nt(ut)}`}const rt=et;this.Platform.deploymentTag=et,typeof tt=="string"&&tt.length>0&&(this.Platform.cdnDomain=tt),transport.http.setCdn(this.Platform.cdnDomain),await Promise.all([this.Platform.theme.initialize(rt),notify.onSessionReady().promise.then(nt=>this.Platform.idiom.addBundlePromise("/i18n")),this.User.initialize(rt)])}}const configure=new ConfigurationFramework;class ConfigurationFrameworkFactory{static instance(){return configure}}const WIDGET_POSITION={LEFT:"left",RIGHT:"right"},firstLevelWidgets=["birthday","mood","calendar-widget","notes"],secondLevelWidgets=["agenda-widget","carnet-de-bord","my-apps","rss-widget","bookmark-widget","cursus-widget","maxicours-widget","school-widget"],defaultWidgetPosition={"last-infos-widget":WIDGET_POSITION.LEFT,birthday:WIDGET_POSITION.LEFT,"calendar-widget":WIDGET_POSITION.RIGHT,"carnet-de-bord":WIDGET_POSITION.LEFT,"record-me":WIDGET_POSITION.RIGHT,mood:WIDGET_POSITION.LEFT,"my-apps":WIDGET_POSITION.RIGHT,notes:WIDGET_POSITION.RIGHT,"rss-widget":WIDGET_POSITION.LEFT,"bookmark-widget":WIDGET_POSITION.RIGHT,qwant:WIDGET_POSITION.RIGHT,"qwant-junior":WIDGET_POSITION.LEFT,"agenda-widget":WIDGET_POSITION.LEFT,"cursus-widget":WIDGET_POSITION.LEFT,"maxicours-widget":WIDGET_POSITION.RIGHT,"universalis-widget":WIDGET_POSITION.RIGHT,"briefme-widget":WIDGET_POSITION.LEFT,"school-widget":WIDGET_POSITION.LEFT},defaultWidgetOrder={"school-widget":0,"my-apps":10,"record-me":15,"last-infos-widget":20,qwant:30,"qwant-junior":30,"universalis-widget":35,"agenda-widget":40,"bookmark-widget":50,"carnet-de-bord":60,"maxicours-widget":70,"cursus-widget":80,"briefme-widget":90,"rss-widget":100,mood:110,birthday:120,"calendar-widget":130,notes:140};class WidgetFramework{constructor(){m$2(this,"_initialized"),m$2(this,"_widgets",[]),m$2(this,"_userPrefs",{})}initialize(et,tt){return this._initialized||(this._initialized=new Promisified,notify.onSessionReady().promise.then(rt=>{var nt;rt&&rt.widgets?(rt.widgets.forEach(st=>{this._widgets.push(new Widget(st))}),this.loadUserPrefs().then(()=>{var st;(st=this._initialized)==null||st.resolve()}).catch(st=>{var ot;(ot=this._initialized)==null||ot.reject()})):(nt=this._initialized)==null||nt.reject()})),this._initialized.promise}get list(){return this._widgets}lookup(et){return this._widgets.find(tt=>tt.platformConf.name===et)}lookupDefaultPosition(et){return defaultWidgetPosition[et]}get userPrefs(){return this._userPrefs}async loadUserPrefs(){await configure.User.preferences.load("widgets",{}).then(et=>this.applyUserPrefs(et))}saveUserPrefs(){return configure.User.preferences.update("widgets",this._userPrefs).save("widgets").then(()=>{notify.events().next({name:EVENT_NAME.USERPREF_CHANGED,layer:LAYER_NAME.WIDGETS})})}async applyUserPrefs(et){this._userPrefs=et??this._userPrefs;const tt=configure.Platform.theme,rt=[];tt.listSkins().then(nt=>{var st;const ot=((st=nt.find(ut=>ut.child===tt.skin))==null?void 0:st.parent)==="panda"?secondLevelWidgets:firstLevelWidgets;this._widgets=this._widgets.filter((ut,lt)=>{var dt,ct;const ft=ut.platformConf.name;return ot.indexOf(ft)!==-1?!1:(this._userPrefs[ft]||(this._userPrefs[ft]={index:(dt=defaultWidgetOrder[ft])!=null?dt:999,show:!0,position:ut.platformConf.position}),ut.platformConf.mandatory&&(this._userPrefs[ft].show=!0,this._userPrefs[ft].index=(ct=defaultWidgetOrder[ft])!=null?ct:999),ut.platformConf.i18n&&rt.push(ut.platformConf.i18n),ut.applyUserPref(this._userPrefs[ft]),!0)});const at=new Idiom;this._widgets=this._widgets.sort((ut,lt)=>{const dt=at.translate(`timeline.settings.${ut.platformConf.name}`).toLowerCase(),ct=at.translate(`timeline.settings.${lt.platformConf.name}`).toLowerCase();return dt<ct?-1:dt>ct?1:0})})}}class Widget{constructor(et){m$2(this,"_schoolConf",{}),m$2(this,"_userPref"),this._platformConf=et,this._userPref=null}get platformConf(){return this._platformConf}get schoolConf(){return this._schoolConf}get userPref(){return this._userPref}applyUserPref(et){var tt,rt;this._userPref=et,this._userPref.position=(rt=(tt=this._userPref.position)!=null?tt:widgets.lookupDefaultPosition(this._platformConf.name))!=null?rt:"left"}}const widgets=new WidgetFramework;transport==null||transport.http;var O$1;(O$1=session==null?void 0:session.session)==null||O$1.user;const x$1=class{constructor(et){m$2(this,"checkHttpResponse",tt=>{if(this.http.latestResponse.status>=300)throw this.http.latestResponse.statusText;return tt}),this.context=et}static register({application:et,resourceType:tt},rt){x$1.registry.set(`${et}:main`,rt),x$1.registry.set(`${et}:${tt}`,rt)}static findService({application:et,resourceType:tt},rt){const nt=x$1.registry.get(`${et}:${tt}`);if(nt===void 0)throw`Service not found: ${et}:${tt}`;return nt(rt)}static findMainService({application:et},tt){const rt=x$1.registry.get(`${et}:main`);if(rt===void 0)throw`Service not found: ${et}`;return rt(tt)}get http(){return this.context.http()}getShareReadUrl(et){return`/${this.getApplication()}/share/json/${et}?search=`}getSaveShareUrl(et){return`/${this.getApplication()}/share/resource/${et}`}gotoPrint(et,tt){window.open(this.getPrintUrl(et,tt),"_blank")}gotoView(et){window.open(this.getViewUrl(et),"_self")}gotoForm(et){window.open(this.getFormUrl(et),"_self")}async publish(et){const tt=new FormData;tt.append("title",et.title),tt.append("cover",et.cover),tt.append("coverName",et.cover.name),tt.append("coverType",et.cover.type),tt.append("teacherAvatar",et.teacherAvatar),tt.append("teacherAvatarName",et.teacherAvatar.name||`teacherAvatar_${et.userId}`),tt.append("teacherAvatarType",et.teacherAvatar.type),tt.append("language",et.language),et.activityType.forEach(nt=>{tt.append("activityType[]",nt)}),et.subjectArea.forEach(nt=>{tt.append("subjectArea[]",nt)}),et.age.forEach(nt=>{tt.append("age[]",nt.toString())}),tt.append("description",et.description),et.keyWords.split(",").forEach(nt=>{tt.append("keyWords[]",nt.trim())}),tt.append("licence",et.licence),tt.append("pdfUri",`${window.location.origin}${this.getPrintUrl(et.resourceEntId)}`),tt.append("application",et.application?et.application:""),tt.append("resourceId",et.resourceId),tt.append("teacherSchool",et.userStructureName);const rt=await this.http.post("/appregistry/library/resource",tt,{headers:{"Content-Type":"multipart/form-data"}});return this.checkHttpResponse(rt)}async createContext(et){const tt=await this.http.get("/explorer/context",{queryParams:this.toQueryParams(et)});return this.checkHttpResponse(tt)}async searchContext(et){const tt=await this.http.get("/explorer/resources",{queryParams:this.toQueryParams(et)});return this.checkHttpResponse(tt)}async createFolder(et){const tt=await this.http.post("/explorer/folders",this.createFolderToBodyParams(et));return this.checkHttpResponse(tt)}async updateFolder(et){const tt=await this.http.put(`/explorer/folders/${et.folderId}`,this.createFolderToBodyParams(et));return this.checkHttpResponse(tt)}async moveToFolder(et){const tt=await this.http.post(`/explorer/folders/${et.folderId}/move`,this.moveToBodyParams(et));return this.checkHttpResponse(tt)}async listSubfolders(et){const tt=await this.http.get(`/explorer/folders/${et}`);return this.checkHttpResponse(tt)}async deleteAll(et){const tt=await this.http.deleteJson("/explorer",et);return this.checkHttpResponse(tt)}async trashAll({resourceType:et,...tt}){const rt=await this.http.putJson("/explorer/trash",tt);return this.checkHttpResponse(rt)}async restoreAll({resourceType:et,...tt}){const rt=await this.http.putJson("/explorer/restore",tt);return this.checkHttpResponse(rt)}async getThumbnailPath(et){if(typeof et>"u")return et;if(typeof et=="string")if(et.startsWith("blob:")){const tt=await fetch(et).then(rt=>rt.blob());return`/workspace/document/${(await this.context.workspace().saveFile(tt,{visibility:"protected",application:this.getApplication()}))._id}`}else return et;else return`/workspace/document/${(await this.context.workspace().saveFile(et,{visibility:"protected",application:this.getApplication()}))._id}`}toQueryParams(et){let tt={application:et.app,start_idx:et.pagination.startIdx,page_size:et.pagination.pageSize,resource_type:et.types[0],trashed:et.trashed};if(et.orders&&Object.entries(et.orders).length){const[[rt,nt]]=Object.entries(et.orders);tt.order_by=`${rt}:${nt}`}return et.filters&&Object.assign(tt,et.filters),typeof et.search=="string"&&(tt.search=et.search),tt}createFolderToBodyParams(et){return{application:et.app,resourceType:et.type,parentId:et.parentId,name:et.name}}moveToBodyParams(et){return{application:et.application,resourceType:this.getResourceType(),resourceIds:et.resourceIds,folderIds:et.folderIds}}};let ResourceService=x$1;m$2(ResourceService,"registry",new Map);class BlogResourceService extends ResourceService{async update(et){const tt=await this.getThumbnailPath(et.thumbnail),rt=await this.http.put(`/blog/${et.entId}`,{trashed:et.trashed,_id:et.entId,title:et.name,thumbnail:tt,description:et.description,visibility:et.public?"PUBLIC":"OWNER",slug:et.public?et.slug:"","publish-type":et["publish-type"]||"RESTRAINT","comment-type":"IMMEDIATE"});return this.checkHttpResponse(rt),{thumbnail:tt,entId:et.entId}}getResourceType(){return RESOURCE.BLOG}getApplication(){return APP.BLOG}getFormUrl(et){return et?`/blog?folderid=${et}#/edit/new`:"/blog#/edit/new"}getViewUrl(et){return`/blog#/view/${et}`}getPrintUrl(et,tt){return`/blog/print/blog#/print/${et}?comments=${tt||!0}`}}ResourceService.register({application:RESOURCE.BLOG,resourceType:RESOURCE.BLOG},_e=>new BlogResourceService(_e));class MindmapResourceService extends ResourceService{async update(et){const tt=et.thumbnail?await this.getThumbnailPath(et.thumbnail):"",rt=await this.http.put(`/mindmap/${et.entId}`,{trashed:et.trashed,_id:et.entId,name:et.name,thumbnail:tt,description:et.description,visibility:et.public?"PUBLIC":"OWNER"});return this.checkHttpResponse(rt),{thumbnail:tt,entId:et.entId}}getResourceType(){return RESOURCE.MINDMAP}getApplication(){return APP.MINDMAP}getFormUrl(et){return et?`/mindmap?folderid=${et}/new`:"/mindmap/new"}getViewUrl(et){return`/mindmap/id/${et}`}getPrintUrl(et,tt){return`/mindmap/print/id/${et}?comments=${tt||!0}`}}ResourceService.register({application:RESOURCE.MINDMAP,resourceType:RESOURCE.MINDMAP},_e=>new MindmapResourceService(_e));const globalCache={},mutexPromise={};class CacheService{constructor(et){this.context=et}get http(){return this.context.http()}async fromCacheIfPossible(et,tt,rt){if(mutexPromise[et]&&await mutexPromise[et],globalCache[et])return globalCache[et];try{const nt=tt();mutexPromise[et]=nt;const st=await nt;return rt(st)&&(globalCache[et]=st),st}catch(nt){throw console.error(`Failed to retrieve value for: ${et}`,nt),nt}}clearCache(et){if(et)delete globalCache[et];else for(const tt in globalCache)globalCache.hasOwnProperty(tt)&&delete globalCache[tt]}async httpGet(et,tt){return this.fromCacheIfPossible(et,async()=>{const rt=await this.http.get(et,tt),nt={...this.http.latestResponse};return{value:rt,response:nt}},({response:rt})=>!(rt.status<200||rt.status>=300))}async httpGetJson(et,tt){const{response:rt,value:nt}=await this.httpGet(et,tt);if(rt.status<200||rt.status>=300)throw`Bad http status (${rt.status}) for url: ${et}`;return nt}}class ConfService{constructor(et){this.context=et}get http(){return this.context.http()}get cdnDomain(){return configure.Platform.cdnDomain}async getConf(et){const[tt,rt]=await Promise.all([this.getThemeConf(),this.getApplicationsList()]),[nt,st,ot]=await Promise.all([this.getTheme({conf:tt}),this.getWebAppConf({app:et,applications:rt}),this.getExtendedTheme()]);return{applications:rt,conf:tt,currentApp:st,theme:nt,extendedTheme:ot}}getCdnUrl(){console.warn("[getCdnUrl] Not implemented yet")}async savePreference(et,tt){this.http.putJson(`/userbook/preference/${et}`,tt)}async getPreference(et){const tt=await this.http.get(`/userbook/preference/${et}`);return JSON.parse(tt.preference)}async getThemeConf(et){return await this.http.getScript("/assets/theme-conf.js",{queryParams:{v:et}},"exports.conf")}async getExtendedTheme(){return await this.http.get("/assets/extended-theme.json")}async getApplicationsList(){return(await this.http.get("/applications-list")).apps}async getWebAppConf({app:et,applications:tt}){return tt.find(rt=>{if(rt!=null&&rt.prefix)return(rt==null?void 0:rt.prefix.replace("/",""))===et})}async getTheme({version:et,conf:tt}){const rt=await this.http.get("/theme",{queryParams:{_:et}}),nt=rt.themeName,st=tt==null?void 0:tt.overriding.find(ct=>ct.child===nt).skins,ot="/assets/themes/ode-bootstrap",at=tt==null?void 0:tt.overriding.find(ct=>ct.child===nt).bootstrapVersion,ut=`${this.cdnDomain}/assets/themes/${at}`,lt=`${ut}/skins/${rt.skinName}`,dt=(tt==null?void 0:tt.overriding.find(ct=>ct.child===nt).parent)==="panda";return{basePath:`${this.cdnDomain}${rt.skin}../../`,bootstrap:ot,bootstrapPath:ut,bootstrapUrl:lt,bootstrapVersion:at,is1d:dt,logoutCallback:rt.logoutCallback,skin:rt.skin.split("/assets/themes/")[1].split("/")[0],skinName:rt.skinName,skins:st,themeName:rt.themeName,themeUrl:rt.skin}}}class DirectoryService{constructor(et){this.odeServices=et}get http(){return this.odeServices.http()}get cache(){return this.odeServices.cache()}getAvatarUrl(et,tt,rt="100x100"){return tt==="user"?`/userbook/avatar/${et}?thumbnail=${rt}`:"/assets/img/illustrations/group-avatar.svg"}getDirectoryUrl(et,tt){return tt==="user"?`/userbook/annuaire#/${et}`:`/userbook/annuaire#/group-view/${et}`}async getBookMarks(){return(await this.cache.httpGetJson("/directory/sharebookmark/all")).map(({id:et,name:tt})=>({id:et,displayName:tt,members:[]}))}async getBookMarkById(et){const{groups:tt,id:rt,name:nt,users:st}=await this.http.get(`/directory/sharebookmark/${et}`);return{id:rt,displayName:nt,groups:tt.map(({name:ot,id:at})=>({displayName:ot,id:at})),users:st.map(({displayName:ot,id:at,profile:ut})=>({profile:ut,displayName:ot,firstName:"",lastName:"",login:"",id:at}))}}async saveBookmarks(et,{bookmarks:tt,groups:rt,users:nt}){this.cache.clearCache("/directory/sharebookmark/all");const st=nt.map(ct=>typeof ct=="string"?ct:ct.id),ot=rt.map(ct=>typeof ct=="string"?ct:ct.id),at=tt.map(async ct=>{if(typeof ct=="string"){const{displayName:ft,groups:ht,id:mt,users:vt}=await this.getBookMarkById(ct),wt=vt.map(yt=>yt.id),gt=ht.map(yt=>yt.id);return{displayName:ft,id:mt,members:[...gt,...wt]}}else return Promise.resolve(ct)}),ut=(await Promise.all(at)).map(ct=>ct.members).reduce((ct,ft)=>[...ct,...ft],[]),lt={name:et,members:[...st,...ot,...ut]},{id:dt}=await this.http.postJson("/directory/sharebookmark",lt);return{id:dt,displayName:et,members:lt.members}}}const loadedScripts={};class HttpService{constructor(et,tt){m$2(this,"axios"),m$2(this,"_latestResponse"),this.context=et,this.axios=axios.create(tt)}setCdn(et){et&&XMLHttpRequest&&!XMLHttpRequest.prototype.cdnUrl&&(XMLHttpRequest.prototype.cdnUrl=et,XMLHttpRequest.prototype.baseOpen=XMLHttpRequest.prototype.open,XMLHttpRequest.prototype.open=function(){const tt=arguments[1];return tt.startsWith("/infra/public")&&(arguments[1]=et+tt),/^\/([^\/]*)\/public/.test(tt)&&(arguments[1]=et+tt),tt.startsWith("/assets")&&(arguments[1]=et+tt),tt=="/conf/public"&&(arguments[1]=tt),tt.startsWith("http")&&(arguments[1]=tt),this.baseOpen.apply(this,arguments)})}toAxiosConfig(et){if(et){const tt=Object.assign({},this.axios.defaults);return et.headers&&(tt.headers=Object.assign({},this.axios.defaults.headers),Object.assign(tt.headers,et.headers)),et.responseType&&(tt.responseType=et.responseType),et.queryParams&&(tt.params=Object.assign({},et.queryParams)),tt}else return this.axios.defaults}toCdnUrl(et){const tt=this.context.conf().getCdnUrl()||"";if(tt.length>0&&et!=="/conf/public"){const rt=""+et;(rt.startsWith("/infra/public")||rt.startsWith("/assets")||/^\/([^\/]*)\/public/.test(rt))&&(et=tt+rt)}return et}mapAxiosError(et,tt){return console.error("[HttpService]",et),et.response?this._latestResponse=et.response:et.request?this._latestResponse={status:408,statusText:ERROR_CODE.TIME_OUT}:this._latestResponse={status:500,statusText:ERROR_CODE.UNKNOWN},!tt||tt.disableNotifications,this._latestResponse}mapAxiosResponse(et,tt){return this._latestResponse=et,et.data}get latestResponse(){return this._latestResponse}async get(et,tt){try{const rt=await this.axios.get(this.toCdnUrl(et),this.toAxiosConfig(tt));return this.mapAxiosResponse(rt,tt)}catch(rt){return this.mapAxiosError(rt,tt)}}async post(et,tt,rt){try{const nt=await this.axios.post(et,tt,this.toAxiosConfig(rt));return this.mapAxiosResponse(nt,rt)}catch(nt){return this.mapAxiosError(nt,rt)}}async postFile(et,tt,rt){const nt=this.toAxiosConfig(rt);nt.headers&&nt.headers["Content-Type"]&&delete nt.headers["Content-Type"];try{const st=await this.axios.post(et,tt,{...nt,headers:{"Content-Type":"multipart/form-data"}});return this.mapAxiosResponse(st,rt)}catch(st){return this.mapAxiosError(st,rt)}}async postJson(et,tt,rt){const nt=this.toAxiosConfig();nt.headers&&(nt.headers["Content-Type"]="application/json");try{const st=await this.axios.post(et,tt,this.toAxiosConfig(rt));return this.mapAxiosResponse(st,rt)}catch(st){return this.mapAxiosError(st,rt)}}async put(et,tt,rt){try{const nt=await this.axios.put(et,tt,this.toAxiosConfig(rt));return this.mapAxiosResponse(nt,rt)}catch(nt){return this.mapAxiosError(nt,rt)}}async putFile(et,tt,rt){try{const nt=this.toAxiosConfig(rt);nt.headers&&nt.headers["Content-Type"]&&delete nt.headers["Content-Type"];const st=await this.axios.put(et,tt,{...nt,headers:{"Content-Type":"multipart/form-data"}});return this.mapAxiosResponse(st,rt)}catch(nt){return this.mapAxiosError(nt,rt)}}async putJson(et,tt,rt){const nt=this.toAxiosConfig(rt);nt.headers&&(nt.headers["Content-Type"]="application/json");try{const st=await this.axios.put(et,tt,nt);return this.mapAxiosResponse(st,rt)}catch(st){return this.mapAxiosError(st,rt)}}async delete(et,tt){try{const rt=await this.axios.delete(et,this.toAxiosConfig(tt));return this.mapAxiosResponse(rt,tt)}catch(rt){return this.mapAxiosError(rt,tt)}}async deleteJson(et,tt){try{const rt=await this.axios.delete(et,{data:tt});return this.mapAxiosResponse(rt)}catch(rt){return this.mapAxiosError(rt)}}getScript(et,tt,rt){const nt=rt??"exports",st=this.toAxiosConfig(tt);return st.headers&&(st.headers.Accept="application/javascript"),this.axios.get(this.toCdnUrl(et),st).then(ot=>this.mapAxiosResponse(ot,tt)).then(ot=>{try{const at=`"use strict";var ${nt.split(".")[0]}={};${ot};return ${nt};`;return Function(at)()}catch{return ot}}).catch(ot=>{throw this.mapAxiosError(ot,tt),ot})}loadScript(et,tt){return loadedScripts[et]?Promise.resolve():this.getScript(et,tt).then(rt=>{loadedScripts[et]=!0})}}class RightService{constructor(et){this.context=et}get session(){return this.context.session()}parseResourceRight(et){const tt=et.split(":");if(tt.length===2){if(tt[0]==="creator")return{id:tt[1],right:"creator",type:"creator"}}else return tt.length===3?{id:tt[1],right:tt[2],type:tt[0]}:void 0}parseResourceRights(et){return et.map(tt=>this.parseResourceRight(tt)).filter(tt=>tt!==void 0)}hasResourceRight({id:et,groupIds:tt},rt,nt){const st=nt.map(ot=>typeof ot=="string"?this.parseResourceRight(ot):ot).filter(ot=>ot!==void 0);for(const ot of st)if(ot.id===et&&ot.type==="creator"||ot.id===et&&ot.type==="user"&&ot.right===rt||tt.includes(ot.id)&&ot.type==="group"&&ot.right===rt)return!0;return!1}async sessionHasResourceRight(et,tt){try{const rt=await this.session.getUser();return!!rt&&this.hasResourceRight({groupIds:rt.groupsIds,id:rt.userId},et,tt)}catch(rt){return console.error(rt),!1}}async sessionHasAtLeastOneResourceRight(et,tt){for(const rt of et)if(await this.sessionHasResourceRight(rt,tt))return!0;return!1}async sessionHasResourceRightForEachList(et,tt){let rt=0;for(const nt of tt)await this.sessionHasResourceRight(et,nt)&&rt++;return rt===tt.length}async sessionHasAtLeastOneResourceRightForEachList(et,tt){for(const rt of et){let nt=0;for(const st of tt)await this.sessionHasResourceRight(rt,st)&&nt++;if(nt===tt.length)return!0}return!1}hasWorkflowRight(et,tt){return tt.findIndex(rt=>rt===et)!==-1}async sessionHasWorkflowRight(et){try{const tt=await this.session.getUser();return!!tt&&this.hasWorkflowRight(et,tt.authorizedActions.map(rt=>rt.name))}catch(tt){return console.error(tt),!1}}async sessionHasWorkflowRights(et){const tt={};try{const rt=await this.session.getUser();for(const nt of et)tt[nt]=!!rt&&this.hasWorkflowRight(nt,rt.authorizedActions.map(st=>st.name))}catch(rt){console.error(rt);for(const nt of et)tt[nt]=!1}return tt}}class SessionService{constructor(et){this.context=et}get http(){return this.context.http()}get cache(){return this.context.cache()}onLogout(){this.cache.clearCache()}onRefreshSession(){this.cache.clearCache()}async getSession(){const et=await this.getUser(),[tt,rt,nt,st,ot]=await Promise.all([this.getCurrentLanguage(et),this.latestQuotaAndUsage(et),this.loadDescription(et),this.getUserProfile(),this.getBookmarks(et)]);return{user:et,quotaAndUsage:rt,currentLanguage:tt,userDescription:nt,userProfile:st,bookmarkedApps:ot}}login(et,tt,rt,nt){const st=new FormData;return st.append("email",et),st.append("password",tt),typeof rt<"u"&&st.append("rememberMe",""+rt),typeof nt<"u"&&st.append("secureLocation",""+nt),this.http.post("/auth/login",st,{headers:{"content-type":"application/x-www-form-urlencoded"}}).finally(()=>{switch(this.http.latestResponse.status){case 200:throw ERROR_CODE.MALFORMED_DATA}})}logout(){return this.http.get("/auth/logout").finally(()=>{})}async latestQuotaAndUsage(et){try{return await this.http.get(`/workspace/quota/user/${et==null?void 0:et.userId}`)}catch(tt){return console.error(tt),{quota:0,storage:0}}}async getCurrentLanguage(et){const tt=(et==null?void 0:et.sessionMetadata)&&(et==null?void 0:et.sessionMetadata.userId);try{let rt;return tt?rt=await this.loadUserLanguage():rt=await this.loadDefaultLanguage(),rt}catch(rt){console.error(rt)}}async loadUserLanguage(){try{const et=await this.http.get("/userbook/preference/language");return JSON.parse(et.preference)["default-domain"]}catch{return await this.loadDefaultLanguage()}}async loadDefaultLanguage(){return(await this.cache.httpGetJson("/locale")).locale}async getUser(){const{response:et,value:tt}=await this.cache.httpGet("/auth/oauth2/userinfo");if(et.status<200||et.status>=300)throw ERROR_CODE.NOT_LOGGED_IN;return tt}hasWorkflow({workflowName:et,user:tt}){return et===void 0||(tt==null?void 0:tt.authorizedActions.findIndex(rt=>rt.name===et))!==-1}async loadDescription(et){try{const[tt,rt]=await Promise.all([this.getUserProfile({requestName:"refreshAvatar"}),this.http.get("/directory/userbook/"+(et==null?void 0:et.userId))]);return{...tt,...rt}}catch(tt){return console.error(tt),{}}}async getBookmarks(et){const tt=await this.http.get("/userbook/preference/apps");tt.preference||(tt.preference=null);const rt=JSON.parse(tt.preference);let nt;nt=rt,nt||(nt={bookmarks:[],applications:[]});let st=[];return nt.bookmarks.forEach((ot,at)=>{const ut=et==null?void 0:et.apps.find(lt=>lt.name===ot);if(ut){let lt=Object.assign({},ut);st.push(lt)}}),st}async getUserProfile(et){const{response:tt,value:rt}=await this.cache.httpGet("/userbook/api/person",et);if(tt.status<200||tt.status>=300)throw ERROR_CODE.NOT_LOGGED_IN;return rt.result[0].type}async isAdml(){const et=await this.getUser();return(et==null?void 0:et.functions.ADMIN_LOCAL)!==void 0}}class StringUtils{static removeAccents(et){for(var tt=0;tt<defaultDiacriticsRemovalMap$1.length;tt++)et=et.replace(defaultDiacriticsRemovalMap$1[tt].letters,defaultDiacriticsRemovalMap$1[tt].base);return et}}class ShareService{constructor(et){this.context=et}get directory(){return this.context.directory()}get http(){return this.context.http()}get cache(){return this.context.cache()}async searchShareSubjects(et,tt,rt){const nt=StringUtils.removeAccents(rt).toLowerCase(),st=await this.cache.httpGetJson(`/${et}/share/json/${tt}?search=${rt}`),ot=st.users.visibles.filter(({username:ut,firstName:lt,lastName:dt,login:ct})=>{const ft=StringUtils.removeAccents(dt||"").toLowerCase(),ht=StringUtils.removeAccents(lt||"").toLowerCase(),mt=StringUtils.removeAccents(ut||"").toLowerCase(),vt=StringUtils.removeAccents(ct||"").toLowerCase();return mt.includes(nt)||ht.includes(nt)||ft.includes(nt)||vt.includes(nt)}).map(ut=>({avatarUrl:this.directory.getAvatarUrl(ut.id,"user"),directoryUrl:this.directory.getDirectoryUrl(ut.id,"user"),displayName:ut.username,id:ut.id,profile:ut.profile,type:"user"})),at=st.groups.visibles.filter(({name:ut})=>StringUtils.removeAccents(ut||"").toLowerCase().includes(nt)).map(ut=>({avatarUrl:this.directory.getAvatarUrl(ut.id,"group"),directoryUrl:this.directory.getDirectoryUrl(ut.id,"group"),displayName:ut.name,id:ut.id,type:"group"}));return[...(await this.directory.getBookMarks()).filter(({displayName:ut})=>StringUtils.removeAccents(ut||"").toLowerCase().includes(nt)).map(ut=>({avatarUrl:"",directoryUrl:"",profile:"",displayName:ut.displayName,id:ut.id,type:"sharebookmark"})),...ot,...at]}async getShareMapping(et){const tt=await this.cache.httpGetJson(`/${et}/rights/sharing`);for(const rt of Object.keys(tt))if(rt.includes(".")){const nt=rt.split(".")[1],st=tt[rt];delete tt[rt],tt[nt]=st}return tt}getActionsAvailableFor({id:et,type:tt},rt,nt){const st=(tt==="user"?rt.users.checked[et]:rt.groups.checked[et])||[],ot=Object.keys(nt),at=[];for(const ut of ot)nt[ut].filter(lt=>st.includes(lt)).length>0&&at.push(ut);return at}async getRightsForResource(et,tt){const rt=await this.directory.getBookMarks(),nt=this.context.resource(et,et).getShareReadUrl(tt),st=await this.cache.httpGetJson(nt),ot=await this.getShareMapping(et),at=await this.cache.httpGetJson("/infra/public/json/sharing-rights.json"),ut=Object.keys(st.users.checked).map(ht=>st.users.visibles.find(mt=>mt.id===ht)).filter(ht=>ht!==void 0).map(ht=>{const mt=this.getActionsAvailableFor({id:ht.id,type:"user"},st,ot);return{id:ht.id,type:"user",displayName:ht.username,profile:ht.profile,avatarUrl:this.directory.getAvatarUrl(ht.id,"user"),directoryUrl:this.directory.getDirectoryUrl(ht.id,"user"),actions:mt.map(vt=>{const wt=at[vt];return{displayName:vt,id:vt,priority:wt.priority}})}}).sort((ht,mt)=>(ht.displayName||"").localeCompare(mt.displayName)),lt=Object.keys(st.groups.checked).map(ht=>st.groups.visibles.find(mt=>mt.id===ht)).filter(ht=>ht!==void 0).map(ht=>{const mt=this.getActionsAvailableFor({id:ht.id,type:"group"},st,ot);return{id:ht.id,type:"group",displayName:ht.name,profile:void 0,avatarUrl:this.directory.getAvatarUrl(ht.id,"group"),directoryUrl:this.directory.getDirectoryUrl(ht.id,"group"),actions:mt.map(vt=>{const wt=at[vt];return{displayName:vt,id:vt,priority:wt.priority}})}}).sort((ht,mt)=>(ht.displayName||"").localeCompare(mt.displayName)),dt=[...ut,...lt],ct=st.groups.visibles.map(({groupDisplayName:ht,id:mt,name:vt})=>({displayName:ht||vt,id:mt})),ft=st.users.visibles.map(({id:ht,profile:mt,username:vt,firstName:wt,lastName:gt,login:yt})=>({displayName:vt,firstName:wt,lastName:gt,login:yt,profile:mt,id:ht}));return{rights:dt,visibleBookmarks:rt,visibleGroups:ct,visibleUsers:ft}}async saveRights(et,tt,rt){const nt=await this.getShareMapping(et),st={bookmarks:{},groups:{},users:{}};for(const ut of rt){const lt=ut.actions.map(ct=>nt[ct.id]).reduce((ct,ft)=>[...ct,...ft],[]),dt=[...new Set(lt)];dt.length>0&&(ut.type==="user"?st.users[ut.id]=dt:ut.type==="group"?st.groups[ut.id]=dt:st.bookmarks[ut.id]=dt)}const ot=this.context.resource(et,et),at=ot.getSaveShareUrl(tt);return this.cache.clearCache(ot.getShareReadUrl(tt)),await this.http.putJson(at,st)}async getActionsForApp(et){const tt=await this.cache.httpGetJson("/infra/public/json/sharing-rights.json"),rt=await this.getShareMapping(et);return Object.keys(tt).map(nt=>{const st=tt[nt];return{displayName:nt,id:nt,priority:st.priority,requires:st.requires}}).filter(nt=>{var st;return((st=rt[nt.id])==null?void 0:st.length)>0}).sort((nt,st)=>nt.priority-st.priority)}}const S$1=class{constructor(){m$2(this,"wordExtensions",new Set),m$2(this,"excelExtensions",new Set),m$2(this,"pptExtensions",new Set),m$2(this,"fileExtensionMap",new Map),m$2(this,"csvContentType",new Set),m$2(this,"csvExtensions",new Set),m$2(this,"txtExtensions",new Set),m$2(this,"PDF","application/pdf"),m$2(this,"OCTET_STREAM","application/octet-stream"),this.txtExtensions.add("txt"),this.wordExtensions.add("doc"),this.wordExtensions.add("dot"),this.wordExtensions.add("docx"),this.wordExtensions.add("dotx"),this.wordExtensions.add("docm"),this.wordExtensions.add("dotm"),this.wordExtensions.add("odt"),this.wordExtensions.add("ott"),this.wordExtensions.add("oth"),this.wordExtensions.add("odm"),this.excelExtensions.add("xls"),this.excelExtensions.add("xlt"),this.excelExtensions.add("xla"),this.excelExtensions.add("xlsx"),this.excelExtensions.add("xltx"),this.excelExtensions.add("xlsm"),this.excelExtensions.add("xltm"),this.excelExtensions.add("xlam"),this.excelExtensions.add("xlsb"),this.excelExtensions.add("ods"),this.excelExtensions.add("ots"),this.pptExtensions.add("ppt"),this.pptExtensions.add("pot"),this.pptExtensions.add("pps"),this.pptExtensions.add("ppa"),this.pptExtensions.add("pptx"),this.pptExtensions.add("potx"),this.pptExtensions.add("ppsx"),this.pptExtensions.add("ppam"),this.pptExtensions.add("pptm"),this.pptExtensions.add("potm"),this.pptExtensions.add("ppsm"),this.pptExtensions.add("odp"),this.pptExtensions.add("otp"),this.csvExtensions.add("csv"),this.fileExtensionMap.set("doc","application/msword"),this.fileExtensionMap.set("dot","application/msword"),this.fileExtensionMap.set("docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"),this.fileExtensionMap.set("dotx","application/vnd.openxmlformats-officedocument.wordprocessingml.template"),this.fileExtensionMap.set("docm","application/vnd.ms-word.document.macroEnabled.12"),this.fileExtensionMap.set("dotm","application/vnd.ms-word.template.macroEnabled.12"),this.fileExtensionMap.set("xls","application/vnd.ms-excel"),this.fileExtensionMap.set("xlt","application/vnd.ms-excel"),this.fileExtensionMap.set("xla","application/vnd.ms-excel"),this.fileExtensionMap.set("xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"),this.fileExtensionMap.set("xltx","application/vnd.openxmlformats-officedocument.spreadsheetml.template"),this.fileExtensionMap.set("xlsm","application/vnd.ms-excel.sheet.macroEnabled.12"),this.fileExtensionMap.set("xltm","application/vnd.ms-excel.template.macroEnabled.12"),this.fileExtensionMap.set("xlam","application/vnd.ms-excel.addin.macroEnabled.12"),this.fileExtensionMap.set("xlsb","application/vnd.ms-excel.sheet.binary.macroEnabled.12"),this.fileExtensionMap.set("ppt","application/vnd.ms-powerpoint"),this.fileExtensionMap.set("pot","application/vnd.ms-powerpoint"),this.fileExtensionMap.set("pps","application/vnd.ms-powerpoint"),this.fileExtensionMap.set("ppa","application/vnd.ms-powerpoint"),this.fileExtensionMap.set("pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"),this.fileExtensionMap.set("potx","application/vnd.openxmlformats-officedocument.presentationml.template"),this.fileExtensionMap.set("ppsx","application/vnd.openxmlformats-officedocument.presentationml.slideshow"),this.fileExtensionMap.set("ppam","application/vnd.ms-powerpoint.addin.macroEnabled.12"),this.fileExtensionMap.set("pptm","application/vnd.ms-powerpoint.presentation.macroEnabled.12"),this.fileExtensionMap.set("potm","application/vnd.ms-powerpoint.presentation.macroEnabled.12"),this.fileExtensionMap.set("ppsm","application/vnd.ms-powerpoint.slideshow.macroEnabled.12"),this.fileExtensionMap.set("odt","application/vnd.oasis.opendocument.text"),this.fileExtensionMap.set("ott","application/vnd.oasis.opendocument.text-template"),this.fileExtensionMap.set("oth","application/vnd.oasis.opendocument.text-web"),this.fileExtensionMap.set("odm","application/vnd.oasis.opendocument.text-master"),this.fileExtensionMap.set("odg","application/vnd.oasis.opendocument.graphics"),this.fileExtensionMap.set("otg","application/vnd.oasis.opendocument.graphics-template"),this.fileExtensionMap.set("odp","application/vnd.oasis.opendocument.presentation"),this.fileExtensionMap.set("otp","application/vnd.oasis.opendocument.presentation-template"),this.fileExtensionMap.set("ods","application/vnd.oasis.opendocument.spreadsheet"),this.fileExtensionMap.set("ots","application/vnd.oasis.opendocument.spreadsheet-template"),this.fileExtensionMap.set("odc","application/vnd.oasis.opendocument.chart"),this.fileExtensionMap.set("odf","application/vnd.oasis.opendocument.formula"),this.fileExtensionMap.set("odb","application/vnd.oasis.opendocument.database"),this.fileExtensionMap.set("odi","application/vnd.oasis.opendocument.image"),this.fileExtensionMap.set("oxt","application/vnd.openofficeorg.extension"),this.fileExtensionMap.set("txt","text/plain"),this.csvContentType.add("text/comma-separated-values"),this.csvContentType.add("text/csv"),this.csvContentType.add("application/csv")}getContentTypeForExtension(et){if(this.fileExtensionMap.has(et))return this.fileExtensionMap.get(et)}getExtensionForContentType(et){for(const tt of Array.from(this.fileExtensionMap.keys()))if((this.fileExtensionMap.get(tt)||"").toLowerCase()==(et||"").toLowerCase())return tt;return null}isWordLike(et,tt){const rt=this.getExtensionForContentType(et);return rt?this.wordExtensions.has(rt):et==this.OCTET_STREAM&&tt?this.wordExtensions.has(tt):!1}isExcelLike(et,tt){const rt=this.getExtensionForContentType(et);return rt?this.excelExtensions.has(rt):et==this.OCTET_STREAM&&tt?this.excelExtensions.has(tt):!1}isCsvLike(et,tt){return this.csvContentType.has(et)?!0:et==this.OCTET_STREAM&&tt?this.csvExtensions.has(tt):!1}isPowerpointLike(et,tt){const rt=this.getExtensionForContentType(et);return rt?this.pptExtensions.has(rt):et==this.OCTET_STREAM&&tt?this.pptExtensions.has(tt):!1}isTxtLike(et,tt){const rt=this.getExtensionForContentType(et);return rt?this.txtExtensions.has(rt):et==this.OCTET_STREAM&&tt?this.txtExtensions.has(tt):!1}};let MimeTypeUtils=S$1;m$2(MimeTypeUtils,"INSTANCE",new S$1);class FileTypeUtils{static registerContentTypeToFileType(et){this.fileTypes.push(et)}static getFileType(et,tt=!1,rt){if(rt&&(rt=rt.trim()),!et)return"unknown";this.fileTypes||console.warn("[Element.role] should not have emptyRoles",this);for(let st of this.fileTypes||[]){const ot=st(et,tt);if(ot)return ot}const nt={csv:function(st){return!!MimeTypeUtils.INSTANCE.isCsvLike(st,rt)},doc:function(st){return MimeTypeUtils.INSTANCE.isWordLike(st,rt)?!0:st.indexOf("document")!==-1&&st.indexOf("wordprocessing")!==-1},xls:function(st){return MimeTypeUtils.INSTANCE.isExcelLike(st,rt)?!0:st.indexOf("document")!==-1&&st.indexOf("spreadsheet")!==-1||st.indexOf("ms-excel")!==-1},img:function(st){return st.indexOf("image")!==-1},pdf:function(st){return st.indexOf("pdf")!==-1||st==="application/x-download"},ppt:function(st){return MimeTypeUtils.INSTANCE.isPowerpointLike(st,rt)?!0:st.indexOf("document")!==-1&&st.indexOf("presentation")!==-1||st.indexOf("powerpoint")!==-1},txt:function(st){return MimeTypeUtils.INSTANCE.isTxtLike(st,rt)},video:function(st){return st.indexOf("video")!==-1},audio:function(st){return st.indexOf("audio")!==-1},zip:function(st){return st.indexOf("zip")!==-1||st.indexOf("rar")!==-1||st.indexOf("tar")!==-1||st.indexOf("7z")!==-1}};for(let st in nt)if(nt[st](et))return st;return"unknown"}}m$2(FileTypeUtils,"fileTypes",[]);class WorkspaceService{constructor(et){this.context=et}get http(){return this.context.http()}async saveFile(et,tt){const rt=et.name||"",nt=rt.split("."),st=et.type||"application/octet-stream",ot=nt.length>1?nt[nt.length-1]:"",at={"content-type":st,filename:rt,size:et.size,extension:ot,role:FileTypeUtils.getFileType(st,!1,ot)},ut=rt.replace("."+at.extension,""),lt=at.extension?ut+"."+at.extension:ut,dt=new FormData;dt.append("file",et,lt);const ct=[];return((tt==null?void 0:tt.visibility)==="public"||(tt==null?void 0:tt.visibility)==="protected")&&ct.push(`${tt.visibility}=true`),tt!=null&&tt.application&&ct.push(`application=${tt.application}`),at.role==="img"&&ct.push("quality=1"),tt!=null&&tt.parentId&&ct.push(`parentId=${tt.parentId}`),await this.http.postFile(`/workspace/document?${ct.join("&")}`,dt)}}const bundle={},promises={},defaultDiacriticsRemovalMap=[{base:"A",letters:/[\u0041\u24B6\uFF21\u00C0\u00C1\u00C2\u1EA6\u1EA4\u1EAA\u1EA8\u00C3\u0100\u0102\u1EB0\u1EAE\u1EB4\u1EB2\u0226\u01E0\u00C4\u01DE\u1EA2\u00C5\u01FA\u01CD\u0200\u0202\u1EA0\u1EAC\u1EB6\u1E00\u0104\u023A\u2C6F]/g},{base:"AA",letters:/[\uA732]/g},{base:"AE",letters:/[\u00C6\u01FC\u01E2]/g},{base:"AO",letters:/[\uA734]/g},{base:"AU",letters:/[\uA736]/g},{base:"AV",letters:/[\uA738\uA73A]/g},{base:"AY",letters:/[\uA73C]/g},{base:"B",letters:/[\u0042\u24B7\uFF22\u1E02\u1E04\u1E06\u0243\u0182\u0181]/g},{base:"C",letters:/[\u0043\u24B8\uFF23\u0106\u0108\u010A\u010C\u00C7\u1E08\u0187\u023B\uA73E]/g},{base:"D",letters:/[\u0044\u24B9\uFF24\u1E0A\u010E\u1E0C\u1E10\u1E12\u1E0E\u0110\u018B\u018A\u0189\uA779]/g},{base:"DZ",letters:/[\u01F1\u01C4]/g},{base:"Dz",letters:/[\u01F2\u01C5]/g},{base:"E",letters:/[\u0045\u24BA\uFF25\u00C8\u00C9\u00CA\u1EC0\u1EBE\u1EC4\u1EC2\u1EBC\u0112\u1E14\u1E16\u0114\u0116\u00CB\u1EBA\u011A\u0204\u0206\u1EB8\u1EC6\u0228\u1E1C\u0118\u1E18\u1E1A\u0190\u018E]/g},{base:"F",letters:/[\u0046\u24BB\uFF26\u1E1E\u0191\uA77B]/g},{base:"G",letters:/[\u0047\u24BC\uFF27\u01F4\u011C\u1E20\u011E\u0120\u01E6\u0122\u01E4\u0193\uA7A0\uA77D\uA77E]/g},{base:"H",letters:/[\u0048\u24BD\uFF28\u0124\u1E22\u1E26\u021E\u1E24\u1E28\u1E2A\u0126\u2C67\u2C75\uA78D]/g},{base:"I",letters:/[\u0049\u24BE\uFF29\u00CC\u00CD\u00CE\u0128\u012A\u012C\u0130\u00CF\u1E2E\u1EC8\u01CF\u0208\u020A\u1ECA\u012E\u1E2C\u0197]/g},{base:"J",letters:/[\u004A\u24BF\uFF2A\u0134\u0248]/g},{base:"K",letters:/[\u004B\u24C0\uFF2B\u1E30\u01E8\u1E32\u0136\u1E34\u0198\u2C69\uA740\uA742\uA744\uA7A2]/g},{base:"L",letters:/[\u004C\u24C1\uFF2C\u013F\u0139\u013D\u1E36\u1E38\u013B\u1E3C\u1E3A\u0141\u023D\u2C62\u2C60\uA748\uA746\uA780]/g},{base:"LJ",letters:/[\u01C7]/g},{base:"Lj",letters:/[\u01C8]/g},{base:"M",letters:/[\u004D\u24C2\uFF2D\u1E3E\u1E40\u1E42\u2C6E\u019C]/g},{base:"N",letters:/[\u004E\u24C3\uFF2E\u01F8\u0143\u00D1\u1E44\u0147\u1E46\u0145\u1E4A\u1E48\u0220\u019D\uA790\uA7A4]/g},{base:"NJ",letters:/[\u01CA]/g},{base:"Nj",letters:/[\u01CB]/g},{base:"O",letters:/[\u004F\u24C4\uFF2F\u00D2\u00D3\u00D4\u1ED2\u1ED0\u1ED6\u1ED4\u00D5\u1E4C\u022C\u1E4E\u014C\u1E50\u1E52\u014E\u022E\u0230\u00D6\u022A\u1ECE\u0150\u01D1\u020C\u020E\u01A0\u1EDC\u1EDA\u1EE0\u1EDE\u1EE2\u1ECC\u1ED8\u01EA\u01EC\u00D8\u01FE\u0186\u019F\uA74A\uA74C]/g},{base:"OI",letters:/[\u01A2]/g},{base:"OO",letters:/[\uA74E]/g},{base:"OU",letters:/[\u0222]/g},{base:"P",letters:/[\u0050\u24C5\uFF30\u1E54\u1E56\u01A4\u2C63\uA750\uA752\uA754]/g},{base:"Q",letters:/[\u0051\u24C6\uFF31\uA756\uA758\u024A]/g},{base:"R",letters:/[\u0052\u24C7\uFF32\u0154\u1E58\u0158\u0210\u0212\u1E5A\u1E5C\u0156\u1E5E\u024C\u2C64\uA75A\uA7A6\uA782]/g},{base:"S",letters:/[\u0053\u24C8\uFF33\u1E9E\u015A\u1E64\u015C\u1E60\u0160\u1E66\u1E62\u1E68\u0218\u015E\u2C7E\uA7A8\uA784]/g},{base:"T",letters:/[\u0054\u24C9\uFF34\u1E6A\u0164\u1E6C\u021A\u0162\u1E70\u1E6E\u0166\u01AC\u01AE\u023E\uA786]/g},{base:"TZ",letters:/[\uA728]/g},{base:"U",letters:/[\u0055\u24CA\uFF35\u00D9\u00DA\u00DB\u0168\u1E78\u016A\u1E7A\u016C\u00DC\u01DB\u01D7\u01D5\u01D9\u1EE6\u016E\u0170\u01D3\u0214\u0216\u01AF\u1EEA\u1EE8\u1EEE\u1EEC\u1EF0\u1EE4\u1E72\u0172\u1E76\u1E74\u0244]/g},{base:"V",letters:/[\u0056\u24CB\uFF36\u1E7C\u1E7E\u01B2\uA75E\u0245]/g},{base:"VY",letters:/[\uA760]/g},{base:"W",letters:/[\u0057\u24CC\uFF37\u1E80\u1E82\u0174\u1E86\u1E84\u1E88\u2C72]/g},{base:"X",letters:/[\u0058\u24CD\uFF38\u1E8A\u1E8C]/g},{base:"Y",letters:/[\u0059\u24CE\uFF39\u1EF2\u00DD\u0176\u1EF8\u0232\u1E8E\u0178\u1EF6\u1EF4\u01B3\u024E\u1EFE]/g},{base:"Z",letters:/[\u005A\u24CF\uFF3A\u0179\u1E90\u017B\u017D\u1E92\u1E94\u01B5\u0224\u2C7F\u2C6B\uA762]/g},{base:"a",letters:/[\u0061\u24D0\uFF41\u1E9A\u00E0\u00E1\u00E2\u1EA7\u1EA5\u1EAB\u1EA9\u00E3\u0101\u0103\u1EB1\u1EAF\u1EB5\u1EB3\u0227\u01E1\u00E4\u01DF\u1EA3\u00E5\u01FB\u01CE\u0201\u0203\u1EA1\u1EAD\u1EB7\u1E01\u0105\u2C65\u0250]/g},{base:"aa",letters:/[\uA733]/g},{base:"ae",letters:/[\u00E6\u01FD\u01E3]/g},{base:"ao",letters:/[\uA735]/g},{base:"au",letters:/[\uA737]/g},{base:"av",letters:/[\uA739\uA73B]/g},{base:"ay",letters:/[\uA73D]/g},{base:"b",letters:/[\u0062\u24D1\uFF42\u1E03\u1E05\u1E07\u0180\u0183\u0253]/g},{base:"c",letters:/[\u0063\u24D2\uFF43\u0107\u0109\u010B\u010D\u00E7\u1E09\u0188\u023C\uA73F\u2184]/g},{base:"d",letters:/[\u0064\u24D3\uFF44\u1E0B\u010F\u1E0D\u1E11\u1E13\u1E0F\u0111\u018C\u0256\u0257\uA77A]/g},{base:"dz",letters:/[\u01F3\u01C6]/g},{base:"e",letters:/[\u0065\u24D4\uFF45\u00E8\u00E9\u00EA\u1EC1\u1EBF\u1EC5\u1EC3\u1EBD\u0113\u1E15\u1E17\u0115\u0117\u00EB\u1EBB\u011B\u0205\u0207\u1EB9\u1EC7\u0229\u1E1D\u0119\u1E19\u1E1B\u0247\u025B\u01DD]/g},{base:"f",letters:/[\u0066\u24D5\uFF46\u1E1F\u0192\uA77C]/g},{base:"g",letters:/[\u0067\u24D6\uFF47\u01F5\u011D\u1E21\u011F\u0121\u01E7\u0123\u01E5\u0260\uA7A1\u1D79\uA77F]/g},{base:"h",letters:/[\u0068\u24D7\uFF48\u0125\u1E23\u1E27\u021F\u1E25\u1E29\u1E2B\u1E96\u0127\u2C68\u2C76\u0265]/g},{base:"hv",letters:/[\u0195]/g},{base:"i",letters:/[\u0069\u24D8\uFF49\u00EC\u00ED\u00EE\u0129\u012B\u012D\u00EF\u1E2F\u1EC9\u01D0\u0209\u020B\u1ECB\u012F\u1E2D\u0268\u0131]/g},{base:"j",letters:/[\u006A\u24D9\uFF4A\u0135\u01F0\u0249]/g},{base:"k",letters:/[\u006B\u24DA\uFF4B\u1E31\u01E9\u1E33\u0137\u1E35\u0199\u2C6A\uA741\uA743\uA745\uA7A3]/g},{base:"l",letters:/[\u006C\u24DB\uFF4C\u0140\u013A\u013E\u1E37\u1E39\u013C\u1E3D\u1E3B\u017F\u0142\u019A\u026B\u2C61\uA749\uA781\uA747]/g},{base:"lj",letters:/[\u01C9]/g},{base:"m",letters:/[\u006D\u24DC\uFF4D\u1E3F\u1E41\u1E43\u0271\u026F]/g},{base:"n",letters:/[\u006E\u24DD\uFF4E\u01F9\u0144\u00F1\u1E45\u0148\u1E47\u0146\u1E4B\u1E49\u019E\u0272\u0149\uA791\uA7A5]/g},{base:"nj",letters:/[\u01CC]/g},{base:"o",letters:/[\u006F\u24DE\uFF4F\u00F2\u00F3\u00F4\u1ED3\u1ED1\u1ED7\u1ED5\u00F5\u1E4D\u022D\u1E4F\u014D\u1E51\u1E53\u014F\u022F\u0231\u00F6\u022B\u1ECF\u0151\u01D2\u020D\u020F\u01A1\u1EDD\u1EDB\u1EE1\u1EDF\u1EE3\u1ECD\u1ED9\u01EB\u01ED\u00F8\u01FF\u0254\uA74B\uA74D\u0275]/g},{base:"oi",letters:/[\u01A3]/g},{base:"ou",letters:/[\u0223]/g},{base:"oo",letters:/[\uA74F]/g},{base:"p",letters:/[\u0070\u24DF\uFF50\u1E55\u1E57\u01A5\u1D7D\uA751\uA753\uA755]/g},{base:"q",letters:/[\u0071\u24E0\uFF51\u024B\uA757\uA759]/g},{base:"r",letters:/[\u0072\u24E1\uFF52\u0155\u1E59\u0159\u0211\u0213\u1E5B\u1E5D\u0157\u1E5F\u024D\u027D\uA75B\uA7A7\uA783]/g},{base:"s",letters:/[\u0073\u24E2\uFF53\u00DF\u015B\u1E65\u015D\u1E61\u0161\u1E67\u1E63\u1E69\u0219\u015F\u023F\uA7A9\uA785\u1E9B]/g},{base:"t",letters:/[\u0074\u24E3\uFF54\u1E6B\u1E97\u0165\u1E6D\u021B\u0163\u1E71\u1E6F\u0167\u01AD\u0288\u2C66\uA787]/g},{base:"tz",letters:/[\uA729]/g},{base:"u",letters:/[\u0075\u24E4\uFF55\u00F9\u00FA\u00FB\u0169\u1E79\u016B\u1E7B\u016D\u00FC\u01DC\u01D8\u01D6\u01DA\u1EE7\u016F\u0171\u01D4\u0215\u0217\u01B0\u1EEB\u1EE9\u1EEF\u1EED\u1EF1\u1EE5\u1E73\u0173\u1E77\u1E75\u0289]/g},{base:"v",letters:/[\u0076\u24E5\uFF56\u1E7D\u1E7F\u028B\uA75F\u028C]/g},{base:"vy",letters:/[\uA761]/g},{base:"w",letters:/[\u0077\u24E6\uFF57\u1E81\u1E83\u0175\u1E87\u1E85\u1E98\u1E89\u2C73]/g},{base:"x",letters:/[\u0078\u24E7\uFF58\u1E8B\u1E8D]/g},{base:"y",letters:/[\u0079\u24E8\uFF59\u1EF3\u00FD\u0177\u1EF9\u0233\u1E8F\u00FF\u1EF7\u1E99\u1EF5\u01B4\u024F\u1EFF]/g},{base:"z",letters:/[\u007A\u24E9\uFF5A\u017A\u1E91\u017C\u017E\u1E93\u1E95\u01B6\u0225\u0240\u2C6C\uA763]/g}];class IdiomService{constructor(et){this.context=et}get http(){return this.context.http()}async getIdiom(et,tt){await Promise.all([this.addBundlePromise(et,"/i18n"),this.addBundlePromise(et,`/${tt}/i18n`)])}translate(et,tt){et=et??"";let rt=bundle[et]===void 0?et:bundle[et];if(tt&&typeof tt=="object")for(let nt in tt)typeof tt[nt]<"u"&&(rt=rt.replace(new RegExp("\\${"+nt+"}","g"),""+tt[nt]));return rt}addBundlePromise(et,tt){return this.loadBundlePromise(et,tt)}addBundle(et,tt,rt){this.loadBundle(et,tt,rt)}loadBundlePromise(et,tt){return this.loadBundle(et,tt),promises[tt]}loadBundle(et,tt,rt){const nt=promises[tt];if(nt)rt&&nt.then(rt).catch(rt);else{const st=new Promisified;promises[tt]=st.promise;const ot={};et&&(ot["Accept-Language"]=et),this.http.get(tt,{headers:ot}).then(at=>{Object.assign(bundle,at),typeof rt=="function"&&rt(),st.resolve()}).catch(at=>{typeof rt=="function"&&rt(),st.reject()})}}addTranslations(et,tt){notify.onLangReady().promise.then(rt=>{this.loadBundle(rt,et+"/"+rt+".json",tt)})}addAllTranslations(et){return et&&et.length>0?notify.onLangReady().promise.then(tt=>Promise.all(et.map(rt=>this.loadBundlePromise(tt,rt+"/"+tt+".json")))).then(()=>{}):Promise.reject()}addKeys(et){for(var tt in et)typeof bundle[tt]!="string"&&(bundle[tt]=et[tt])}removeAccents(et){for(var tt=0;tt<defaultDiacriticsRemovalMap.length;tt++)et=et.replace(defaultDiacriticsRemovalMap[tt].letters,defaultDiacriticsRemovalMap[tt].base);return et}}let ATTag;class AnalyticsService{constructor(_e){this.context=_e}get http(){return this.context.http()}get session(){return this.context.session()}async trackPageLoad(_e,et){const[tt]=await Promise.all([this.getXitiConfig(et.name.toLowerCase()),this.loadXitiScript()]);if(!tt||!ATInternet)return;let rt=tt.LIBELLE_SERVICE.default||null;for(let nt in tt.LIBELLE_SERVICE)if(nt!=="default"&&_e.indexOf(nt)>=0){rt=tt.LIBELLE_SERVICE[nt];break}ATTag=new ATInternet.Tracker.Tag({site:tt.STRUCT_ID}),ATTag.setProps({SERVICE:rt,TYPE:tt.TYPE,OUTIL:tt.OUTIL,UAI:tt.STRUCT_UAI,PROJET:tt.PROJET,EXPLOITANT:tt.EXPLOITANT,PLATEFORME:tt.PLATFORME,PROFIL:tt.PROFILE},!0),ATTag.identifiedVisitor.set({id:tt.ID_PERSO,category:tt.PROFILE}),ATTag.page.set({name:(et==null?void 0:et.prefix)==="userbook"?"directory":et==null?void 0:et.prefix,chapter1:"",chapter2:"",chapter3:"",level2:tt.STRUCT_UAI}),ATTag.dispatch()}async getXitiConfig(_e){const[et,tt]=await Promise.all([this.http.get("/analyticsConf"),this.http.get("/xiti/config")]);if(!(et!=null&&et.type))throw ERROR_CODE.MALFORMED_DATA;return tt!=null&&tt.active&&(et.xiti=await this.getXitiTrackingParams(tt,_e)),et.xiti}async loadXitiScript(){if(typeof ATInternet>"u"){const scriptPath="/xiti/public/js/lib/smarttag_ENT.js",response=await this.http.get(scriptPath,{headers:{Accept:"application/javascript"}});if(this.http.latestResponse.status!=200)throw"Error while loading XiTi script";eval(response)}}async getXitiTrackingParams(_e,et){var tt;if(!_e.structureMap||!et)return;const rt=await this.session.getUser(),nt=await this.session.getUserProfile();let st;if(!(rt!=null&&rt.structures))return;for(let dt of rt.structures){const ct=_e.structureMap[dt];if(ct&&ct.collectiviteId&&ct.UAI){st=ct;break}}if(!st||!st.active)return;const ot=await configure.Platform.apps.getPublicConf(et);if(!ot)return;const at=ot.xiti;if(!at||!at.LIBELLE_SERVICE||!st.UAI)return;function ut(dt){let ct="";for(let ft=0;ft<dt.length;ft++)ct+=dt.charCodeAt(ft);return ct}const lt={Student:"ELEVE",Teacher:"ENSEIGNANT",Relative:"PARENT",Personnel:"ADMIN_VIE_SCOL_TECH",Guest:"AUTRE"};return{LIBELLE_SERVICE:at.LIBELLE_SERVICE,TYPE:at.OUTIL?"TIERS":"NATIF",OUTIL:at.OUTIL?at.OUTIL:"",STRUCT_ID:st.collectiviteId,STRUCT_UAI:st.UAI,PROJET:st.projetId?st.projetId:_e.ID_PROJET,EXPLOITANT:_e.ID_EXPLOITANT,PLATFORME:st.plateformeId?st.plateformeId:_e.ID_PLATEFORME,ID_PERSO:ut(rt.userId),PROFILE:nt&&nt.length>0&&(tt=lt[nt[0]])!=null?tt:""}}}class OdeServices{constructor(){m$2(this,"_analytics"),m$2(this,"_cache"),m$2(this,"_conf"),m$2(this,"_directory"),m$2(this,"_http"),m$2(this,"_idiom"),m$2(this,"_rights"),m$2(this,"_session"),m$2(this,"_share"),m$2(this,"_workspace"),this._analytics=new AnalyticsService(this),this._cache=new CacheService(this),this._conf=new ConfService(this),this._directory=new DirectoryService(this),this._http=new HttpService(this),this._idiom=new IdiomService(this),this._rights=new RightService(this),this._session=new SessionService(this),this._share=new ShareService(this),this._workspace=new WorkspaceService(this)}analytics(){return this._analytics}cache(){return this._cache}conf(){return this._conf}directory(){return this._directory}http(){return this._http}idiom(){return this._idiom}resource(et,tt){return tt?ResourceService.findService({application:et,resourceType:tt},this):ResourceService.findMainService({application:et},this)}rights(){return this._rights}session(){return this._session}share(){return this._share}workspace(){return this._workspace}}const odeServices=new OdeServices;function useSession(){return useQuery({queryKey:["session"],queryFn:async()=>await odeServices.session().getSession(),suspense:!0})}function useConf({appCode:_e}){return useQuery({queryKey:["conf"],queryFn:async()=>await odeServices.conf().getConf(_e),suspense:!0})}const OdeClientContext=reactExports.createContext(null);function OdeClientProvider({children:_e,params:et}){const tt=et.app,rt=useSession(),nt=useConf({appCode:tt}),st=(nt==null?void 0:nt.isSuccess)&&(rt==null?void 0:rt.isSuccess);reactExports.useEffect(()=>{var lt,dt,ct,ft,ht,mt,vt,wt,gt,yt;const at=document.getElementById("theme"),ut=document.getElementById("favicon");at.href=`${(dt=(lt=nt==null?void 0:nt.data)==null?void 0:lt.theme)==null?void 0:dt.bootstrapUrl}/theme.css`,ut.href=`${(ft=(ct=nt==null?void 0:nt.data)==null?void 0:ct.theme)==null?void 0:ft.basePath}/img/illustrations/favicon.ico`,[{data:"data-skin",value:(mt=(ht=nt==null?void 0:nt.data)==null?void 0:ht.theme)==null?void 0:mt.skinName},{data:"data-theme",value:(wt=(vt=nt==null?void 0:nt.data)==null?void 0:vt.theme)==null?void 0:wt.themeName},{data:"data-bootstrap",value:(yt=(gt=nt==null?void 0:nt.data)==null?void 0:gt.theme)==null?void 0:yt.bootstrapVersion.split("-").at(-1)}].forEach(xt=>{var St;return(St=document.querySelector("html"))==null?void 0:St.setAttribute(xt.data,xt.value)})},[nt==null?void 0:nt.data]),reactExports.useEffect(()=>{var at,ut;(ut=document.querySelector("html"))==null||ut.setAttribute("lang",((at=rt==null?void 0:rt.data)==null?void 0:at.currentLanguage)||"fr")},[rt==null?void 0:rt.data]);const ot=reactExports.useMemo(()=>{var at,ut,lt,dt,ct,ft,ht;return{appCode:tt,applications:(at=nt==null?void 0:nt.data)==null?void 0:at.applications,confQuery:nt,currentApp:(ut=nt==null?void 0:nt.data)==null?void 0:ut.currentApp,currentLanguage:(lt=rt==null?void 0:rt.data)==null?void 0:lt.currentLanguage,init:st,sessionQuery:rt,theme:(dt=nt==null?void 0:nt.data)==null?void 0:dt.theme,user:(ct=rt==null?void 0:rt.data)==null?void 0:ct.user,userDescription:(ft=rt==null?void 0:rt.data)==null?void 0:ft.userDescription,userProfile:(ht=rt==null?void 0:rt.data)==null?void 0:ht.userProfile}},[tt,nt,st,rt]);return jsxRuntimeExports.jsx(OdeClientContext.Provider,{value:ot,children:_e})}function useOdeClient(){const _e=reactExports.useContext(OdeClientContext);if(!_e)throw new Error("Cannot be used outside of OdeClientProvider");return _e}function useBookmark(){var tt;const{sessionQuery:_e}=useOdeClient(),et=new Set;return(tt=_e==null?void 0:_e.data)==null?void 0:tt.bookmarkedApps.filter(rt=>{const nt=et.has(rt.displayName);return et.add(rt.displayName),!nt})}function useTheme(){const{theme:_e}=useOdeClient();return{theme:_e}}function useUser(){const{user:_e,userDescription:et,userProfile:tt}=useOdeClient(),{theme:rt}=useTheme();function nt(){let st=et==null?void 0:et.picture;return(!st||st==="no-avatar.jpg"||st==="no-avatar.svg")&&(st=`${rt==null?void 0:rt.basePath}/img/illustrations/no-avatar.svg`),st}return{user:{..._e,type:tt},avatar:nt(),userDescription:et}}function useHasWorkflow(){const{user:_e}=useUser();return{workflows:{conversation:{view:odeServices.session().hasWorkflow({workflowName:"org.entcore.conversation.controllers.ConversationController|view",user:_e})},community:{view:odeServices.session().hasWorkflow({workflowName:"net.atos.entng.community.controllers.CommunityController|view",user:_e})},search:{view:odeServices.session().hasWorkflow({workflowName:"fr.openent.searchengine.controllers.SearchEngineController|view",user:_e})},zimbra:{view:odeServices.session().hasWorkflow({workflowName:"fr.openent.zimbra.controllers.ZimbraController|view",user:_e}),preauth:odeServices.session().hasWorkflow({workflowName:"fr.openent.zimbra.controllers.ZimbraController|preauth",user:_e})}}}}const DEFAULT_EVENTS=["mousedown","touchstart"];function useClickOutside(_e,et,tt){const rt=reactExports.useRef();return reactExports.useEffect(()=>{const nt=st=>{const{target:ot}=st??{};if(Array.isArray(tt)){const at=(ot==null?void 0:ot.hasAttribute("data-ignore-outside-clicks"))||!document.body.contains(ot)&&ot.tagName!=="HTML";tt.every(ut=>!!ut&&!st.composedPath().includes(ut))&&!at&&_e()}else rt.current&&!rt.current.contains(ot)&&_e()};return(et||DEFAULT_EVENTS).forEach(st=>{document.addEventListener(st,nt)}),()=>{(et||DEFAULT_EVENTS).forEach(st=>{document.removeEventListener(st,nt)})}},[rt,_e,tt,et]),rt}let e={data:""},t$1=_e=>typeof window=="object"?((_e?_e.querySelector("#_goober"):window._goober)||Object.assign((_e||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:_e||e,l=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,a=/\/\*[^]*?\*\/| +/g,n$2=/\n+/g,o=(_e,et)=>{let tt="",rt="",nt="";for(let st in _e){let ot=_e[st];st[0]=="@"?st[1]=="i"?tt=st+" "+ot+";":rt+=st[1]=="f"?o(ot,st):st+"{"+o(ot,st[1]=="k"?"":et)+"}":typeof ot=="object"?rt+=o(ot,et?et.replace(/([^,])+/g,at=>st.replace(/(^:.*)|([^,])+/g,ut=>/&/.test(ut)?ut.replace(/&/g,at):at?at+" "+ut:ut)):st):ot!=null&&(st=/^--/.test(st)?st:st.replace(/[A-Z]/g,"-$&").toLowerCase(),nt+=o.p?o.p(st,ot):st+":"+ot+";")}return tt+(et&&nt?et+"{"+nt+"}":nt)+rt},c$1={},s=_e=>{if(typeof _e=="object"){let et="";for(let tt in _e)et+=tt+s(_e[tt]);return et}return _e},i$1=(_e,et,tt,rt,nt)=>{let st=s(_e),ot=c$1[st]||(c$1[st]=(ut=>{let lt=0,dt=11;for(;lt<ut.length;)dt=101*dt+ut.charCodeAt(lt++)>>>0;return"go"+dt})(st));if(!c$1[ot]){let ut=st!==_e?_e:(lt=>{let dt,ct,ft=[{}];for(;dt=l.exec(lt.replace(a,""));)dt[4]?ft.shift():dt[3]?(ct=dt[3].replace(n$2," ").trim(),ft.unshift(ft[0][ct]=ft[0][ct]||{})):ft[0][dt[1]]=dt[2].replace(n$2," ").trim();return ft[0]})(_e);c$1[ot]=o(nt?{["@keyframes "+ot]:ut}:ut,tt?"":"."+ot)}let at=tt&&c$1.g?c$1.g:null;return tt&&(c$1.g=c$1[ot]),((ut,lt,dt,ct)=>{ct?lt.data=lt.data.replace(ct,ut):lt.data.indexOf(ut)===-1&&(lt.data=dt?ut+lt.data:lt.data+ut)})(c$1[ot],et,rt,at),ot},p$1=(_e,et,tt)=>_e.reduce((rt,nt,st)=>{let ot=et[st];if(ot&&ot.call){let at=ot(tt),ut=at&&at.props&&at.props.className||/^go/.test(at)&&at;ot=ut?"."+ut:at&&typeof at=="object"?at.props?"":o(at,""):at===!1?"":at}return rt+nt+(ot??"")},"");function u$2(_e){let et=this||{},tt=_e.call?_e(et.p):_e;return i$1(tt.unshift?tt.raw?p$1(tt,[].slice.call(arguments,1),et.p):tt.reduce((rt,nt)=>Object.assign(rt,nt&&nt.call?nt(et.p):nt),{}):tt,t$1(et.target),et.g,et.o,et.k)}let d,f,g$1;u$2.bind({g:1});let h$3=u$2.bind({k:1});function m$1(_e,et,tt,rt){o.p=et,d=_e,f=tt,g$1=rt}function j(_e,et){let tt=this||{};return function(){let rt=arguments;function nt(st,ot){let at=Object.assign({},st),ut=at.className||nt.className;tt.p=Object.assign({theme:f&&f()},at),tt.o=/ *go\d+/.test(ut),at.className=u$2.apply(tt,rt)+(ut?" "+ut:""),et&&(at.ref=ot);let lt=_e;return _e[0]&&(lt=at.as||_e,delete at.as),g$1&<[0]&&g$1(at),d(lt,at)}return et?et(nt):nt}}var W=_e=>typeof _e=="function",T=(_e,et)=>W(_e)?_e(et):_e,U=(()=>{let _e=0;return()=>(++_e).toString()})(),b=(()=>{let _e;return()=>{if(_e===void 0&&typeof window<"u"){let et=matchMedia("(prefers-reduced-motion: reduce)");_e=!et||et.matches}return _e}})(),Q=20,S=new Map,X=1e3,$$1=_e=>{if(S.has(_e))return;let et=setTimeout(()=>{S.delete(_e),u$1({type:4,toastId:_e})},X);S.set(_e,et)},J=_e=>{let et=S.get(_e);et&&clearTimeout(et)},v$2=(_e,et)=>{switch(et.type){case 0:return{..._e,toasts:[et.toast,..._e.toasts].slice(0,Q)};case 1:return et.toast.id&&J(et.toast.id),{..._e,toasts:_e.toasts.map(st=>st.id===et.toast.id?{...st,...et.toast}:st)};case 2:let{toast:tt}=et;return _e.toasts.find(st=>st.id===tt.id)?v$2(_e,{type:1,toast:tt}):v$2(_e,{type:0,toast:tt});case 3:let{toastId:rt}=et;return rt?$$1(rt):_e.toasts.forEach(st=>{$$1(st.id)}),{..._e,toasts:_e.toasts.map(st=>st.id===rt||rt===void 0?{...st,visible:!1}:st)};case 4:return et.toastId===void 0?{..._e,toasts:[]}:{..._e,toasts:_e.toasts.filter(st=>st.id!==et.toastId)};case 5:return{..._e,pausedAt:et.time};case 6:let nt=et.time-(_e.pausedAt||0);return{..._e,pausedAt:void 0,toasts:_e.toasts.map(st=>({...st,pauseDuration:st.pauseDuration+nt}))}}},A=[],P={toasts:[],pausedAt:void 0},u$1=_e=>{P=v$2(P,_e),A.forEach(et=>{et(P)})},Y={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},I$1=(_e={})=>{let[et,tt]=reactExports.useState(P);reactExports.useEffect(()=>(A.push(tt),()=>{let nt=A.indexOf(tt);nt>-1&&A.splice(nt,1)}),[et]);let rt=et.toasts.map(nt=>{var st,ot;return{..._e,..._e[nt.type],...nt,duration:nt.duration||((st=_e[nt.type])==null?void 0:st.duration)||(_e==null?void 0:_e.duration)||Y[nt.type],style:{..._e.style,...(ot=_e[nt.type])==null?void 0:ot.style,...nt.style}}});return{...et,toasts:rt}},G$1=(_e,et="blank",tt)=>({createdAt:Date.now(),visible:!0,type:et,ariaProps:{role:"status","aria-live":"polite"},message:_e,pauseDuration:0,...tt,id:(tt==null?void 0:tt.id)||U()}),h$2=_e=>(et,tt)=>{let rt=G$1(et,_e,tt);return u$1({type:2,toast:rt}),rt.id},n$1=(_e,et)=>h$2("blank")(_e,et);n$1.error=h$2("error");n$1.success=h$2("success");n$1.loading=h$2("loading");n$1.custom=h$2("custom");n$1.dismiss=_e=>{u$1({type:3,toastId:_e})};n$1.remove=_e=>u$1({type:4,toastId:_e});n$1.promise=(_e,et,tt)=>{let rt=n$1.loading(et.loading,{...tt,...tt==null?void 0:tt.loading});return _e.then(nt=>(n$1.success(T(et.success,nt),{id:rt,...tt,...tt==null?void 0:tt.success}),nt)).catch(nt=>{n$1.error(T(et.error,nt),{id:rt,...tt,...tt==null?void 0:tt.error})}),_e};var Z=(_e,et)=>{u$1({type:1,toast:{id:_e,height:et}})},ee=()=>{u$1({type:5,time:Date.now()})},D=_e=>{let{toasts:et,pausedAt:tt}=I$1(_e);reactExports.useEffect(()=>{if(tt)return;let st=Date.now(),ot=et.map(at=>{if(at.duration===1/0)return;let ut=(at.duration||0)+at.pauseDuration-(st-at.createdAt);if(ut<0){at.visible&&n$1.dismiss(at.id);return}return setTimeout(()=>n$1.dismiss(at.id),ut)});return()=>{ot.forEach(at=>at&&clearTimeout(at))}},[et,tt]);let rt=reactExports.useCallback(()=>{tt&&u$1({type:6,time:Date.now()})},[tt]),nt=reactExports.useCallback((st,ot)=>{let{reverseOrder:at=!1,gutter:ut=8,defaultPosition:lt}=ot||{},dt=et.filter(ht=>(ht.position||lt)===(st.position||lt)&&ht.height),ct=dt.findIndex(ht=>ht.id===st.id),ft=dt.filter((ht,mt)=>mt<ct&&ht.visible).length;return dt.filter(ht=>ht.visible).slice(...at?[ft+1]:[0,ft]).reduce((ht,mt)=>ht+(mt.height||0)+ut,0)},[et]);return{toasts:et,handlers:{updateHeight:Z,startPause:ee,endPause:rt,calculateOffset:nt}}},oe=h$3`
|
|
64
|
+
`),function(at){if(ot=at.indexOf(":"),nt=_e.trim(at.substr(0,ot)).toLowerCase(),st=_e.trim(at.substr(ot+1)),nt){if(rt[nt]&&et.indexOf(nt)>=0)return;nt==="set-cookie"?rt[nt]=(rt[nt]?rt[nt]:[]).concat([st]):rt[nt]=rt[nt]?rt[nt]+", "+st:st}}),rt},parseHeaders}var isURLSameOrigin,hasRequiredIsURLSameOrigin;function requireIsURLSameOrigin(){if(hasRequiredIsURLSameOrigin)return isURLSameOrigin;hasRequiredIsURLSameOrigin=1;var _e=utils$9;return isURLSameOrigin=_e.isStandardBrowserEnv()?function(){var et=/(msie|trident)/i.test(navigator.userAgent),tt=document.createElement("a"),rt;function nt(st){var ot=st;return et&&(tt.setAttribute("href",ot),ot=tt.href),tt.setAttribute("href",ot),{href:tt.href,protocol:tt.protocol?tt.protocol.replace(/:$/,""):"",host:tt.host,search:tt.search?tt.search.replace(/^\?/,""):"",hash:tt.hash?tt.hash.replace(/^#/,""):"",hostname:tt.hostname,port:tt.port,pathname:tt.pathname.charAt(0)==="/"?tt.pathname:"/"+tt.pathname}}return rt=nt(window.location.href),function(st){var ot=_e.isString(st)?nt(st):st;return ot.protocol===rt.protocol&&ot.host===rt.host}}():function(){return function(){return!0}}(),isURLSameOrigin}var xhr,hasRequiredXhr;function requireXhr(){if(hasRequiredXhr)return xhr;hasRequiredXhr=1;var _e=utils$9,et=requireSettle(),tt=requireCookies(),rt=buildURL$1,nt=requireBuildFullPath(),st=requireParseHeaders(),ot=requireIsURLSameOrigin(),at=requireCreateError();return xhr=function(ut){return new Promise(function(lt,dt){var ct=ut.data,ft=ut.headers;_e.isFormData(ct)&&delete ft["Content-Type"];var ht=new XMLHttpRequest;if(ut.auth){var mt=ut.auth.username||"",vt=ut.auth.password?unescape(encodeURIComponent(ut.auth.password)):"";ft.Authorization="Basic "+btoa(mt+":"+vt)}var wt=nt(ut.baseURL,ut.url);if(ht.open(ut.method.toUpperCase(),rt(wt,ut.params,ut.paramsSerializer),!0),ht.timeout=ut.timeout,ht.onreadystatechange=function(){if(!(!ht||ht.readyState!==4)&&!(ht.status===0&&!(ht.responseURL&&ht.responseURL.indexOf("file:")===0))){var yt="getAllResponseHeaders"in ht?st(ht.getAllResponseHeaders()):null,xt=!ut.responseType||ut.responseType==="text"?ht.responseText:ht.response,St={data:xt,status:ht.status,statusText:ht.statusText,headers:yt,config:ut,request:ht};et(lt,dt,St),ht=null}},ht.onabort=function(){!ht||(dt(at("Request aborted",ut,"ECONNABORTED",ht)),ht=null)},ht.onerror=function(){dt(at("Network Error",ut,null,ht)),ht=null},ht.ontimeout=function(){var yt="timeout of "+ut.timeout+"ms exceeded";ut.timeoutErrorMessage&&(yt=ut.timeoutErrorMessage),dt(at(yt,ut,"ECONNABORTED",ht)),ht=null},_e.isStandardBrowserEnv()){var gt=(ut.withCredentials||ot(wt))&&ut.xsrfCookieName?tt.read(ut.xsrfCookieName):void 0;gt&&(ft[ut.xsrfHeaderName]=gt)}if("setRequestHeader"in ht&&_e.forEach(ft,function(yt,xt){typeof ct>"u"&&xt.toLowerCase()==="content-type"?delete ft[xt]:ht.setRequestHeader(xt,yt)}),_e.isUndefined(ut.withCredentials)||(ht.withCredentials=!!ut.withCredentials),ut.responseType)try{ht.responseType=ut.responseType}catch(yt){if(ut.responseType!=="json")throw yt}typeof ut.onDownloadProgress=="function"&&ht.addEventListener("progress",ut.onDownloadProgress),typeof ut.onUploadProgress=="function"&&ht.upload&&ht.upload.addEventListener("progress",ut.onUploadProgress),ut.cancelToken&&ut.cancelToken.promise.then(function(yt){!ht||(ht.abort(),dt(yt),ht=null)}),ct||(ct=null),ht.send(ct)})},xhr}var utils$4=utils$9,normalizeHeaderName=normalizeHeaderName$1,DEFAULT_CONTENT_TYPE={"Content-Type":"application/x-www-form-urlencoded"};function setContentTypeIfUnset(_e,et){!utils$4.isUndefined(_e)&&utils$4.isUndefined(_e["Content-Type"])&&(_e["Content-Type"]=et)}function getDefaultAdapter(){var _e;return(typeof XMLHttpRequest<"u"||typeof process<"u"&&Object.prototype.toString.call(process)==="[object process]")&&(_e=requireXhr()),_e}var defaults$2={adapter:getDefaultAdapter(),transformRequest:[function(_e,et){return normalizeHeaderName(et,"Accept"),normalizeHeaderName(et,"Content-Type"),utils$4.isFormData(_e)||utils$4.isArrayBuffer(_e)||utils$4.isBuffer(_e)||utils$4.isStream(_e)||utils$4.isFile(_e)||utils$4.isBlob(_e)?_e:utils$4.isArrayBufferView(_e)?_e.buffer:utils$4.isURLSearchParams(_e)?(setContentTypeIfUnset(et,"application/x-www-form-urlencoded;charset=utf-8"),_e.toString()):utils$4.isObject(_e)?(setContentTypeIfUnset(et,"application/json;charset=utf-8"),JSON.stringify(_e)):_e}],transformResponse:[function(_e){if(typeof _e=="string")try{_e=JSON.parse(_e)}catch{}return _e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(_e){return _e>=200&&_e<300}};defaults$2.headers={common:{Accept:"application/json, text/plain, */*"}};utils$4.forEach(["delete","get","head"],function(_e){defaults$2.headers[_e]={}});utils$4.forEach(["post","put","patch"],function(_e){defaults$2.headers[_e]=utils$4.merge(DEFAULT_CONTENT_TYPE)});var defaults_1=defaults$2,utils$3=utils$9,transformData=transformData$1,isCancel=requireIsCancel(),defaults$1=defaults_1;function throwIfCancellationRequested(_e){_e.cancelToken&&_e.cancelToken.throwIfRequested()}var dispatchRequest$1=function(_e){throwIfCancellationRequested(_e),_e.headers=_e.headers||{},_e.data=transformData(_e.data,_e.headers,_e.transformRequest),_e.headers=utils$3.merge(_e.headers.common||{},_e.headers[_e.method]||{},_e.headers),utils$3.forEach(["delete","get","head","post","put","patch","common"],function(tt){delete _e.headers[tt]});var et=_e.adapter||defaults$1.adapter;return et(_e).then(function(tt){return throwIfCancellationRequested(_e),tt.data=transformData(tt.data,tt.headers,_e.transformResponse),tt},function(tt){return isCancel(tt)||(throwIfCancellationRequested(_e),tt&&tt.response&&(tt.response.data=transformData(tt.response.data,tt.response.headers,_e.transformResponse))),Promise.reject(tt)})},utils$2=utils$9,mergeConfig$2=function(_e,et){et=et||{};var tt={},rt=["url","method","data"],nt=["headers","auth","proxy","params"],st=["baseURL","transformRequest","transformResponse","paramsSerializer","timeout","timeoutMessage","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","decompress","maxContentLength","maxBodyLength","maxRedirects","transport","httpAgent","httpsAgent","cancelToken","socketPath","responseEncoding"],ot=["validateStatus"];function at(ct,ft){return utils$2.isPlainObject(ct)&&utils$2.isPlainObject(ft)?utils$2.merge(ct,ft):utils$2.isPlainObject(ft)?utils$2.merge({},ft):utils$2.isArray(ft)?ft.slice():ft}function ut(ct){utils$2.isUndefined(et[ct])?utils$2.isUndefined(_e[ct])||(tt[ct]=at(void 0,_e[ct])):tt[ct]=at(_e[ct],et[ct])}utils$2.forEach(rt,function(ct){utils$2.isUndefined(et[ct])||(tt[ct]=at(void 0,et[ct]))}),utils$2.forEach(nt,ut),utils$2.forEach(st,function(ct){utils$2.isUndefined(et[ct])?utils$2.isUndefined(_e[ct])||(tt[ct]=at(void 0,_e[ct])):tt[ct]=at(void 0,et[ct])}),utils$2.forEach(ot,function(ct){ct in et?tt[ct]=at(_e[ct],et[ct]):ct in _e&&(tt[ct]=at(void 0,_e[ct]))});var lt=rt.concat(nt).concat(st).concat(ot),dt=Object.keys(_e).concat(Object.keys(et)).filter(function(ct){return lt.indexOf(ct)===-1});return utils$2.forEach(dt,ut),tt},utils$1=utils$9,buildURL=buildURL$1,InterceptorManager=InterceptorManager_1,dispatchRequest=dispatchRequest$1,mergeConfig$1=mergeConfig$2;function Axios$1(_e){this.defaults=_e,this.interceptors={request:new InterceptorManager,response:new InterceptorManager}}Axios$1.prototype.request=function(_e){typeof _e=="string"?(_e=arguments[1]||{},_e.url=arguments[0]):_e=_e||{},_e=mergeConfig$1(this.defaults,_e),_e.method?_e.method=_e.method.toLowerCase():this.defaults.method?_e.method=this.defaults.method.toLowerCase():_e.method="get";var et=[dispatchRequest,void 0],tt=Promise.resolve(_e);for(this.interceptors.request.forEach(function(rt){et.unshift(rt.fulfilled,rt.rejected)}),this.interceptors.response.forEach(function(rt){et.push(rt.fulfilled,rt.rejected)});et.length;)tt=tt.then(et.shift(),et.shift());return tt};Axios$1.prototype.getUri=function(_e){return _e=mergeConfig$1(this.defaults,_e),buildURL(_e.url,_e.params,_e.paramsSerializer).replace(/^\?/,"")};utils$1.forEach(["delete","get","head","options"],function(_e){Axios$1.prototype[_e]=function(et,tt){return this.request(mergeConfig$1(tt||{},{method:_e,url:et,data:(tt||{}).data}))}});utils$1.forEach(["post","put","patch"],function(_e){Axios$1.prototype[_e]=function(et,tt,rt){return this.request(mergeConfig$1(rt||{},{method:_e,url:et,data:tt}))}});var Axios_1=Axios$1,Cancel_1,hasRequiredCancel;function requireCancel(){if(hasRequiredCancel)return Cancel_1;hasRequiredCancel=1;function _e(et){this.message=et}return _e.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},_e.prototype.__CANCEL__=!0,Cancel_1=_e,Cancel_1}var CancelToken_1,hasRequiredCancelToken;function requireCancelToken(){if(hasRequiredCancelToken)return CancelToken_1;hasRequiredCancelToken=1;var _e=requireCancel();function et(tt){if(typeof tt!="function")throw new TypeError("executor must be a function.");var rt;this.promise=new Promise(function(st){rt=st});var nt=this;tt(function(st){nt.reason||(nt.reason=new _e(st),rt(nt.reason))})}return et.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},et.source=function(){var tt,rt=new et(function(nt){tt=nt});return{token:rt,cancel:tt}},CancelToken_1=et,CancelToken_1}var spread,hasRequiredSpread;function requireSpread(){return hasRequiredSpread||(hasRequiredSpread=1,spread=function(_e){return function(et){return _e.apply(null,et)}}),spread}var isAxiosError,hasRequiredIsAxiosError;function requireIsAxiosError(){return hasRequiredIsAxiosError||(hasRequiredIsAxiosError=1,isAxiosError=function(_e){return typeof _e=="object"&&_e.isAxiosError===!0}),isAxiosError}var utils=utils$9,bind=bind$2,Axios=Axios_1,mergeConfig$3=mergeConfig$2,defaults$3=defaults_1;function createInstance(_e){var et=new Axios(_e),tt=bind(Axios.prototype.request,et);return utils.extend(tt,Axios.prototype,et),utils.extend(tt,et),tt}var axios$1=createInstance(defaults$3);axios$1.Axios=Axios;axios$1.create=function(_e){return createInstance(mergeConfig$3(axios$1.defaults,_e))};axios$1.Cancel=requireCancel();axios$1.CancelToken=requireCancelToken();axios$1.isCancel=requireIsCancel();axios$1.all=function(_e){return Promise.all(_e)};axios$1.spread=requireSpread();axios$1.isAxiosError=requireIsAxiosError();axios$2.exports=axios$1;axios$2.exports.default=axios$1;(function(_e){_e.exports=axios$2.exports})(axios$3);const axios=getDefaultExportFromCjs(axios$3.exports),loadedScripts$1={};class Http{constructor(et){m$2(this,"axios"),m$2(this,"_latestResponse"),this.axios=axios.create(et)}setCdn(et){et&&XMLHttpRequest&&!XMLHttpRequest.prototype.cdnUrl&&(XMLHttpRequest.prototype.cdnUrl=et,XMLHttpRequest.prototype.baseOpen=XMLHttpRequest.prototype.open,XMLHttpRequest.prototype.open=function(){const tt=arguments[1];return tt.startsWith("/infra/public")&&(arguments[1]=et+tt),/^\/([^\/]*)\/public/.test(tt)&&(arguments[1]=et+tt),tt.startsWith("/assets")&&(arguments[1]=et+tt),tt=="/conf/public"&&(arguments[1]=tt),tt.startsWith("http")&&(arguments[1]=tt),this.baseOpen.apply(this,arguments)})}toAxiosConfig(et){if(et){const tt=Object.assign({},this.axios.defaults);return et.headers&&(tt.headers&&(tt.headers=Object.assign({},this.axios.defaults.headers)),Object.assign(tt.headers,et.headers)),et.responseType&&(tt.responseType=et.responseType),et.queryParams&&(tt.params=Object.assign({},et.queryParams)),tt}else return this.axios.defaults}toCdnUrl(et){const tt=ConfigurationFrameworkFactory.instance().Platform.cdnDomain;if((tt==null?void 0:tt.length)>0&&et!=="/conf/public"){const rt=""+et;(rt.startsWith("/infra/public")||rt.startsWith("/assets")||/^\/([^\/]*)\/public/.test(rt))&&(et=tt+rt)}return et}mapAxiosError(et,tt){return et.response?this._latestResponse=et.response:et.request?this._latestResponse={status:408,statusText:ERROR_CODE.TIME_OUT}:this._latestResponse={status:500,statusText:ERROR_CODE.UNKNOWN},!tt||tt.disableNotifications,this._latestResponse}mapAxiosResponse(et,tt){return this._latestResponse=et,et.data}get latestResponse(){return this._latestResponse}get(et,tt){return this.axios.get(this.toCdnUrl(et),this.toAxiosConfig(tt)).then(rt=>this.mapAxiosResponse(rt,tt)).catch(rt=>this.mapAxiosError(rt,tt))}post(et,tt,rt){return this.axios.post(et,tt,this.toAxiosConfig(rt)).then(nt=>this.mapAxiosResponse(nt,rt)).catch(nt=>this.mapAxiosError(nt,rt))}postFile(et,tt,rt){const nt=this.toAxiosConfig(rt);return nt.headers&&nt.headers["Content-Type"]&&delete nt.headers["Content-Type"],this.axios.post(et,tt,nt).then(st=>this.mapAxiosResponse(st,rt)).catch(st=>this.mapAxiosError(st,rt))}postJson(et,tt,rt){const nt=this.toAxiosConfig();return nt.headers&&(nt.headers["Content-Type"]="application/json"),this.axios.post(et,tt,this.toAxiosConfig(rt)).then(st=>this.mapAxiosResponse(st,rt)).catch(st=>this.mapAxiosError(st,rt))}put(et,tt,rt){return this.axios.put(et,tt,this.toAxiosConfig(rt)).then(nt=>this.mapAxiosResponse(nt,rt)).catch(nt=>this.mapAxiosError(nt,rt))}putJson(et,tt,rt){const nt=this.toAxiosConfig(rt);return nt.headers&&(nt.headers["Content-Type"]="application/json"),this.axios.put(et,tt,nt).then(st=>this.mapAxiosResponse(st,rt)).catch(st=>this.mapAxiosError(st,rt))}delete(et,tt){return this.axios.delete(et,this.toAxiosConfig(tt)).then(rt=>this.mapAxiosResponse(rt,tt)).catch(rt=>this.mapAxiosError(rt,tt))}deleteJson(et,tt){return this.axios.delete(et,{data:tt}).then(rt=>this.mapAxiosResponse(rt)).catch(rt=>this.mapAxiosError(rt))}getScript(et,tt,rt){const nt=rt??"exports",st=this.toAxiosConfig(tt);return st.headers&&(st.headers.Accept="application/javascript"),this.axios.get(this.toCdnUrl(et),st).then(ot=>this.mapAxiosResponse(ot,tt)).then(ot=>{try{const at=`"use strict";var ${nt.split(".")[0]}={};${ot};return ${nt};`;return Function(at)()}catch{return ot}}).catch(ot=>{throw this.mapAxiosError(ot,tt),ot})}loadScript(et,tt){return loadedScripts$1[et]?Promise.resolve():this.getScript(et,tt).then(rt=>{loadedScripts$1[et]=!0})}}class TransportFramework{constructor(){m$2(this,"_http",new Http)}get http(){return this._http}newHttpInstance(et){return new Http(et)}}const transport=new TransportFramework;class TransportFrameworkFactory{static instance(){return transport}}const http$2=transport.http;class Session{constructor(){m$2(this,"_me",null),m$2(this,"_currentLanguage",""),m$2(this,"_notLoggedIn",!0),m$2(this,"_description"),m$2(this,"_profile")}get currentLanguage(){return this._currentLanguage}get notLoggedIn(){return this._notLoggedIn}get description(){return this._description}get avatarUrl(){let et=this.description.photo;return(!et||et==="no-avatar.jpg"||et==="no-avatar.svg")&&(et=ConfigurationFrameworkFactory.instance().Platform.theme.basePath+"/img/illustrations/no-avatar.svg"),et}get user(){return this._me}get currentApp(){return configure.Platform.apps.currentApp}async initialize(){return http$2.get("/auth/oauth2/userinfo").then(et=>{if(http$2.latestResponse.status<200||http$2.latestResponse.status>=300)throw ERROR_CODE.NOT_LOGGED_IN;return this.setCurrentModel(et),this._notLoggedIn?this.loadDefaultLanguage():this.loadUserLanguage()}).then(et=>(this.setCurrentLanguage(et),this.loadDescription())).then(()=>this.getUserProfile()).then(()=>{notify.onSessionReady().resolve(this._me)}).catch(et=>{if(et===ERROR_CODE.NOT_LOGGED_IN)return Promise.resolve();notify.onSessionReady().reject(et)})}setCurrentModel(et){this._me=et,this._notLoggedIn=!(et&&et.sessionMetadata&&et.sessionMetadata.userId)}hasWorkflow(et){var tt;return et===void 0||((tt=this._me)==null?void 0:tt.authorizedActions.findIndex(rt=>rt.name===et))!==-1}hasRight(et,tt){if(tt==="owner")return et.owner&&et.owner.userId===this._me.userId;const rt=tt.right||tt,nt=et.shared.filter(ot=>(this._me.groupsIds||[]).indexOf(ot.groupId)!==-1||ot.userId===this._me.userId).find(ot=>ot[rt]||ot.manager)!==void 0,st=tt.workflow?this.hasWorkflow(tt.workflow):!0;return nt&&st}get latestQuotaAndUsage(){return http$2.get(`/workspace/quota/user/${this._me.userId}`).then(et=>(this._description&&(this._description.quota=et.quota,this._description.storage=et.storage),et)).catch(()=>({quota:0,storage:0}))}setCurrentLanguage(et){this._currentLanguage=et,notify.onLangReady().resolve(et)}loadDefaultLanguage(){return http$2.get("/locale").then(et=>et.locale).catch(()=>this._currentLanguage)}loadDescription(){return Promise.all([http$2.get("/userbook/api/person",{requestName:"refreshAvatar"}),http$2.get("/directory/userbook/"+this._me.userId)]).then(et=>(et[0].status==="ok"&&et[0].result&&et[0].result.length>0?this._description=et[0].result[0]:this._description={},this._description.type&&!this._description.profiles&&(this._description.profiles=this._description.type),Object.assign(this._description,et[1]),this._description))}get profile(){return this._profile}getUserProfile(){return http$2.get("/userbook/api/person").then(et=>et.result).then(et=>this._profile=et[0].type)}loadUserLanguage(){return http$2.get("/userbook/preference/language").then(et=>{try{return JSON.parse(et.preference)["default-domain"]}catch{return this.loadDefaultLanguage()}}).catch(()=>this.loadDefaultLanguage())}getEmailValidationInfos(){return http$2.get("/directory/user/mailstate")}checkEmail(et){return http$2.put("/directory/user/mailstate",{email:et})}tryEmailValidation(et){return http$2.post("/directory/user/mailstate",{key:et})}getMobileValidationInfos(){return http$2.get("/directory/user/mobilestate")}checkMobile(et){return http$2.put("/directory/user/mobilestate",{mobile:et})}tryMobileValidation(et){return http$2.post("/directory/user/mobilestate",{key:et})}getMfaInfos(){return http$2.get("/auth/user/mfa/code")}tryMfaCode(et){return http$2.post("/auth/user/mfa/code",{key:et})}}class SessionFramework{constructor(){m$2(this,"session",new Session)}initialize(){return this.session.initialize()}login(et,tt,rt,nt){const st=new FormData;return st.append("email",et),st.append("password",tt),typeof rt<"u"&&st.append("rememberMe",""+rt),typeof nt<"u"&&st.append("secureLocation",""+nt),transport.http.post("/auth/login",st,{headers:{"content-type":"application/x-www-form-urlencoded"}}).finally(()=>{switch(transport.http.latestResponse.status){case 200:throw ERROR_CODE.MALFORMED_DATA}})}logout(){return transport.http.get("/auth/logout").finally(()=>{})}}const session=new SessionFramework;class Theme{constructor(){m$2(this,"_conf"),m$2(this,"_loaded"),m$2(this,"skinName",""),m$2(this,"themeName",""),m$2(this,"skin","raw"),m$2(this,"themeUrl","/assets/themes/raw/default/"),m$2(this,"templateOverrides",{}),m$2(this,"portalTemplate","/assets/themes/raw/portal.html"),m$2(this,"basePath",""),m$2(this,"logoutCallback","/"),m$2(this,"skins",[]),m$2(this,"is1D",!1),m$2(this,"is2D",!1),m$2(this,"_onSkinReady",notify.onSkinReady()),m$2(this,"_onOverrideReady",notify.onOverridesReady())}initialize(et){return notify.onSessionReady().promise.then(()=>this.load(et))}get version(){return configure.Platform.deploymentTag}get cdnDomain(){return configure.Platform.cdnDomain}async onFullyReady(){return await this._loaded,this}onSkinReady(){return this._onSkinReady.promise}onOverrideReady(){return this._onOverrideReady.promise}async getConf(et){var tt;return this._conf=(tt=this._conf)!=null?tt:await transport.http.getScript("/assets/theme-conf.js",{queryParams:{v:et??this.version}},"exports.conf"),this._conf}load(et){return et=et??this.version,this._loaded||(this._loaded=(session.session.notLoggedIn?this.loadDisconnected(et):this.loadConnected(et)).then(async()=>{var tt,rt;const nt=await this.listSkins();this.is1D=((tt=nt.find(st=>st.child===this.skin))==null?void 0:tt.parent)==="panda",this.is2D=((rt=nt.find(st=>st.child===this.skin))==null?void 0:rt.parent)==="theme-open-ent"})),this._loaded}loadDisconnected(et){return new Promise((tt,rt)=>{transport.http.get("/skin",{queryParams:{v:this.version}}).then(nt=>{this.skin=nt.skin,this.themeUrl=`${this.cdnDomain}/assets/themes/${nt.skin}/skins/default/`,this.basePath=this.themeUrl+"../../",this._onSkinReady.resolve(this),transport.http.get(`/assets/themes/${nt.skin}/template/override.json`,{disableNotifications:!0,queryParams:{v:et}}).then(st=>{this.templateOverrides=st,this._onOverrideReady.resolve(st),tt()}).catch(st=>{if(transport.http.latestResponse.status===404)tt();else throw st})}).catch(nt=>{this._onSkinReady.reject(nt),this._onOverrideReady.reject(nt),rt()})})}loadConnected(et){return new Promise((tt,rt)=>{this.loadDefaultTheme(et).then(()=>{this._onSkinReady.resolve(this),transport.http.get(`/assets/themes/${this.skin}/template/override.json`,{disableNotifications:!0,queryParams:{v:et}}).then(nt=>{this.templateOverrides=nt,this._onOverrideReady.resolve(nt),tt()}).catch(nt=>{if(transport.http.latestResponse.status===404)tt(),this._onSkinReady.reject(nt),this._onOverrideReady.reject(nt);else throw nt})})})}async loadDefaultTheme(et){return session.session.notLoggedIn?Promise.reject():transport.http.get("/theme",{queryParams:{_:et}}).then(tt=>{this.skinName=tt.skinName,this.themeName=tt.themeName,this.themeUrl=tt.skin,this.basePath=`${this.cdnDomain}${this.themeUrl}../../`,this.skin=this.themeUrl.split("/assets/themes/")[1].split("/")[0],this.portalTemplate=`${this.cdnDomain}/assets/themes/${this.skin}/portal.html`,this.logoutCallback=tt.logoutCallback})}listThemes(){return transport.http.get("/themes")}async setDefaultTheme(et){await transport.http.get("/userbook/api/edit-userbook-info?prop=theme-"+this.skin+"&value="+et._id),await this.loadDefaultTheme(this.version)}listSkins(){return this.skins.length>0?Promise.resolve(this.skins):this.getConf().then(et=>{const tt=et.overriding.find(rt=>rt.child===this.skin);return tt!=null&&tt.group?this.skins=this.skins.concat(et.overriding.filter(rt=>rt.group===tt.group)):this.skins=this.skins.concat(et.overriding),this.skins})}async getHelpPath(){var et;const tt=(await this.listSkins()).find(rt=>rt.child===this.skin);return(et=tt==null?void 0:tt.help)!=null?et:"/help"}}const bundle$1={},promises$1={},defaultDiacriticsRemovalMap$1=[{base:"A",letters:/[\u0041\u24B6\uFF21\u00C0\u00C1\u00C2\u1EA6\u1EA4\u1EAA\u1EA8\u00C3\u0100\u0102\u1EB0\u1EAE\u1EB4\u1EB2\u0226\u01E0\u00C4\u01DE\u1EA2\u00C5\u01FA\u01CD\u0200\u0202\u1EA0\u1EAC\u1EB6\u1E00\u0104\u023A\u2C6F]/g},{base:"AA",letters:/[\uA732]/g},{base:"AE",letters:/[\u00C6\u01FC\u01E2]/g},{base:"AO",letters:/[\uA734]/g},{base:"AU",letters:/[\uA736]/g},{base:"AV",letters:/[\uA738\uA73A]/g},{base:"AY",letters:/[\uA73C]/g},{base:"B",letters:/[\u0042\u24B7\uFF22\u1E02\u1E04\u1E06\u0243\u0182\u0181]/g},{base:"C",letters:/[\u0043\u24B8\uFF23\u0106\u0108\u010A\u010C\u00C7\u1E08\u0187\u023B\uA73E]/g},{base:"D",letters:/[\u0044\u24B9\uFF24\u1E0A\u010E\u1E0C\u1E10\u1E12\u1E0E\u0110\u018B\u018A\u0189\uA779]/g},{base:"DZ",letters:/[\u01F1\u01C4]/g},{base:"Dz",letters:/[\u01F2\u01C5]/g},{base:"E",letters:/[\u0045\u24BA\uFF25\u00C8\u00C9\u00CA\u1EC0\u1EBE\u1EC4\u1EC2\u1EBC\u0112\u1E14\u1E16\u0114\u0116\u00CB\u1EBA\u011A\u0204\u0206\u1EB8\u1EC6\u0228\u1E1C\u0118\u1E18\u1E1A\u0190\u018E]/g},{base:"F",letters:/[\u0046\u24BB\uFF26\u1E1E\u0191\uA77B]/g},{base:"G",letters:/[\u0047\u24BC\uFF27\u01F4\u011C\u1E20\u011E\u0120\u01E6\u0122\u01E4\u0193\uA7A0\uA77D\uA77E]/g},{base:"H",letters:/[\u0048\u24BD\uFF28\u0124\u1E22\u1E26\u021E\u1E24\u1E28\u1E2A\u0126\u2C67\u2C75\uA78D]/g},{base:"I",letters:/[\u0049\u24BE\uFF29\u00CC\u00CD\u00CE\u0128\u012A\u012C\u0130\u00CF\u1E2E\u1EC8\u01CF\u0208\u020A\u1ECA\u012E\u1E2C\u0197]/g},{base:"J",letters:/[\u004A\u24BF\uFF2A\u0134\u0248]/g},{base:"K",letters:/[\u004B\u24C0\uFF2B\u1E30\u01E8\u1E32\u0136\u1E34\u0198\u2C69\uA740\uA742\uA744\uA7A2]/g},{base:"L",letters:/[\u004C\u24C1\uFF2C\u013F\u0139\u013D\u1E36\u1E38\u013B\u1E3C\u1E3A\u0141\u023D\u2C62\u2C60\uA748\uA746\uA780]/g},{base:"LJ",letters:/[\u01C7]/g},{base:"Lj",letters:/[\u01C8]/g},{base:"M",letters:/[\u004D\u24C2\uFF2D\u1E3E\u1E40\u1E42\u2C6E\u019C]/g},{base:"N",letters:/[\u004E\u24C3\uFF2E\u01F8\u0143\u00D1\u1E44\u0147\u1E46\u0145\u1E4A\u1E48\u0220\u019D\uA790\uA7A4]/g},{base:"NJ",letters:/[\u01CA]/g},{base:"Nj",letters:/[\u01CB]/g},{base:"O",letters:/[\u004F\u24C4\uFF2F\u00D2\u00D3\u00D4\u1ED2\u1ED0\u1ED6\u1ED4\u00D5\u1E4C\u022C\u1E4E\u014C\u1E50\u1E52\u014E\u022E\u0230\u00D6\u022A\u1ECE\u0150\u01D1\u020C\u020E\u01A0\u1EDC\u1EDA\u1EE0\u1EDE\u1EE2\u1ECC\u1ED8\u01EA\u01EC\u00D8\u01FE\u0186\u019F\uA74A\uA74C]/g},{base:"OI",letters:/[\u01A2]/g},{base:"OO",letters:/[\uA74E]/g},{base:"OU",letters:/[\u0222]/g},{base:"P",letters:/[\u0050\u24C5\uFF30\u1E54\u1E56\u01A4\u2C63\uA750\uA752\uA754]/g},{base:"Q",letters:/[\u0051\u24C6\uFF31\uA756\uA758\u024A]/g},{base:"R",letters:/[\u0052\u24C7\uFF32\u0154\u1E58\u0158\u0210\u0212\u1E5A\u1E5C\u0156\u1E5E\u024C\u2C64\uA75A\uA7A6\uA782]/g},{base:"S",letters:/[\u0053\u24C8\uFF33\u1E9E\u015A\u1E64\u015C\u1E60\u0160\u1E66\u1E62\u1E68\u0218\u015E\u2C7E\uA7A8\uA784]/g},{base:"T",letters:/[\u0054\u24C9\uFF34\u1E6A\u0164\u1E6C\u021A\u0162\u1E70\u1E6E\u0166\u01AC\u01AE\u023E\uA786]/g},{base:"TZ",letters:/[\uA728]/g},{base:"U",letters:/[\u0055\u24CA\uFF35\u00D9\u00DA\u00DB\u0168\u1E78\u016A\u1E7A\u016C\u00DC\u01DB\u01D7\u01D5\u01D9\u1EE6\u016E\u0170\u01D3\u0214\u0216\u01AF\u1EEA\u1EE8\u1EEE\u1EEC\u1EF0\u1EE4\u1E72\u0172\u1E76\u1E74\u0244]/g},{base:"V",letters:/[\u0056\u24CB\uFF36\u1E7C\u1E7E\u01B2\uA75E\u0245]/g},{base:"VY",letters:/[\uA760]/g},{base:"W",letters:/[\u0057\u24CC\uFF37\u1E80\u1E82\u0174\u1E86\u1E84\u1E88\u2C72]/g},{base:"X",letters:/[\u0058\u24CD\uFF38\u1E8A\u1E8C]/g},{base:"Y",letters:/[\u0059\u24CE\uFF39\u1EF2\u00DD\u0176\u1EF8\u0232\u1E8E\u0178\u1EF6\u1EF4\u01B3\u024E\u1EFE]/g},{base:"Z",letters:/[\u005A\u24CF\uFF3A\u0179\u1E90\u017B\u017D\u1E92\u1E94\u01B5\u0224\u2C7F\u2C6B\uA762]/g},{base:"a",letters:/[\u0061\u24D0\uFF41\u1E9A\u00E0\u00E1\u00E2\u1EA7\u1EA5\u1EAB\u1EA9\u00E3\u0101\u0103\u1EB1\u1EAF\u1EB5\u1EB3\u0227\u01E1\u00E4\u01DF\u1EA3\u00E5\u01FB\u01CE\u0201\u0203\u1EA1\u1EAD\u1EB7\u1E01\u0105\u2C65\u0250]/g},{base:"aa",letters:/[\uA733]/g},{base:"ae",letters:/[\u00E6\u01FD\u01E3]/g},{base:"ao",letters:/[\uA735]/g},{base:"au",letters:/[\uA737]/g},{base:"av",letters:/[\uA739\uA73B]/g},{base:"ay",letters:/[\uA73D]/g},{base:"b",letters:/[\u0062\u24D1\uFF42\u1E03\u1E05\u1E07\u0180\u0183\u0253]/g},{base:"c",letters:/[\u0063\u24D2\uFF43\u0107\u0109\u010B\u010D\u00E7\u1E09\u0188\u023C\uA73F\u2184]/g},{base:"d",letters:/[\u0064\u24D3\uFF44\u1E0B\u010F\u1E0D\u1E11\u1E13\u1E0F\u0111\u018C\u0256\u0257\uA77A]/g},{base:"dz",letters:/[\u01F3\u01C6]/g},{base:"e",letters:/[\u0065\u24D4\uFF45\u00E8\u00E9\u00EA\u1EC1\u1EBF\u1EC5\u1EC3\u1EBD\u0113\u1E15\u1E17\u0115\u0117\u00EB\u1EBB\u011B\u0205\u0207\u1EB9\u1EC7\u0229\u1E1D\u0119\u1E19\u1E1B\u0247\u025B\u01DD]/g},{base:"f",letters:/[\u0066\u24D5\uFF46\u1E1F\u0192\uA77C]/g},{base:"g",letters:/[\u0067\u24D6\uFF47\u01F5\u011D\u1E21\u011F\u0121\u01E7\u0123\u01E5\u0260\uA7A1\u1D79\uA77F]/g},{base:"h",letters:/[\u0068\u24D7\uFF48\u0125\u1E23\u1E27\u021F\u1E25\u1E29\u1E2B\u1E96\u0127\u2C68\u2C76\u0265]/g},{base:"hv",letters:/[\u0195]/g},{base:"i",letters:/[\u0069\u24D8\uFF49\u00EC\u00ED\u00EE\u0129\u012B\u012D\u00EF\u1E2F\u1EC9\u01D0\u0209\u020B\u1ECB\u012F\u1E2D\u0268\u0131]/g},{base:"j",letters:/[\u006A\u24D9\uFF4A\u0135\u01F0\u0249]/g},{base:"k",letters:/[\u006B\u24DA\uFF4B\u1E31\u01E9\u1E33\u0137\u1E35\u0199\u2C6A\uA741\uA743\uA745\uA7A3]/g},{base:"l",letters:/[\u006C\u24DB\uFF4C\u0140\u013A\u013E\u1E37\u1E39\u013C\u1E3D\u1E3B\u017F\u0142\u019A\u026B\u2C61\uA749\uA781\uA747]/g},{base:"lj",letters:/[\u01C9]/g},{base:"m",letters:/[\u006D\u24DC\uFF4D\u1E3F\u1E41\u1E43\u0271\u026F]/g},{base:"n",letters:/[\u006E\u24DD\uFF4E\u01F9\u0144\u00F1\u1E45\u0148\u1E47\u0146\u1E4B\u1E49\u019E\u0272\u0149\uA791\uA7A5]/g},{base:"nj",letters:/[\u01CC]/g},{base:"o",letters:/[\u006F\u24DE\uFF4F\u00F2\u00F3\u00F4\u1ED3\u1ED1\u1ED7\u1ED5\u00F5\u1E4D\u022D\u1E4F\u014D\u1E51\u1E53\u014F\u022F\u0231\u00F6\u022B\u1ECF\u0151\u01D2\u020D\u020F\u01A1\u1EDD\u1EDB\u1EE1\u1EDF\u1EE3\u1ECD\u1ED9\u01EB\u01ED\u00F8\u01FF\u0254\uA74B\uA74D\u0275]/g},{base:"oi",letters:/[\u01A3]/g},{base:"ou",letters:/[\u0223]/g},{base:"oo",letters:/[\uA74F]/g},{base:"p",letters:/[\u0070\u24DF\uFF50\u1E55\u1E57\u01A5\u1D7D\uA751\uA753\uA755]/g},{base:"q",letters:/[\u0071\u24E0\uFF51\u024B\uA757\uA759]/g},{base:"r",letters:/[\u0072\u24E1\uFF52\u0155\u1E59\u0159\u0211\u0213\u1E5B\u1E5D\u0157\u1E5F\u024D\u027D\uA75B\uA7A7\uA783]/g},{base:"s",letters:/[\u0073\u24E2\uFF53\u00DF\u015B\u1E65\u015D\u1E61\u0161\u1E67\u1E63\u1E69\u0219\u015F\u023F\uA7A9\uA785\u1E9B]/g},{base:"t",letters:/[\u0074\u24E3\uFF54\u1E6B\u1E97\u0165\u1E6D\u021B\u0163\u1E71\u1E6F\u0167\u01AD\u0288\u2C66\uA787]/g},{base:"tz",letters:/[\uA729]/g},{base:"u",letters:/[\u0075\u24E4\uFF55\u00F9\u00FA\u00FB\u0169\u1E79\u016B\u1E7B\u016D\u00FC\u01DC\u01D8\u01D6\u01DA\u1EE7\u016F\u0171\u01D4\u0215\u0217\u01B0\u1EEB\u1EE9\u1EEF\u1EED\u1EF1\u1EE5\u1E73\u0173\u1E77\u1E75\u0289]/g},{base:"v",letters:/[\u0076\u24E5\uFF56\u1E7D\u1E7F\u028B\uA75F\u028C]/g},{base:"vy",letters:/[\uA761]/g},{base:"w",letters:/[\u0077\u24E6\uFF57\u1E81\u1E83\u0175\u1E87\u1E85\u1E98\u1E89\u2C73]/g},{base:"x",letters:/[\u0078\u24E7\uFF58\u1E8B\u1E8D]/g},{base:"y",letters:/[\u0079\u24E8\uFF59\u1EF3\u00FD\u0177\u1EF9\u0233\u1E8F\u00FF\u1EF7\u1E99\u1EF5\u01B4\u024F\u1EFF]/g},{base:"z",letters:/[\u007A\u24E9\uFF5A\u017A\u1E91\u017C\u017E\u1E93\u1E95\u01B6\u0225\u0240\u2C6C\uA763]/g}];class Idiom{translate(et,tt){et=et??"";let rt=bundle$1[et]===void 0?et:bundle$1[et];if(tt&&typeof tt=="object")for(let nt in tt)typeof tt[nt]<"u"&&(rt=rt.replace(new RegExp("\\${"+nt+"}","g"),""+tt[nt]));return rt}addBundlePromise(et){return this.loadBundlePromise(session.session.currentLanguage,et)}addBundle(et,tt){this.loadBundle(session.session.currentLanguage,et,tt)}loadBundlePromise(et,tt){return this.loadBundle(et,tt),promises$1[tt]}loadBundle(et,tt,rt){const nt=promises$1[tt];if(nt)rt&&nt.then(rt).catch(rt);else{const st=new Promisified;promises$1[tt]=st.promise;const ot={};et&&(ot["Accept-Language"]=et),transport.http.get(tt,{headers:ot}).then(at=>{Object.assign(bundle$1,at),typeof rt=="function"&&rt(),st.resolve()}).catch(at=>{typeof rt=="function"&&rt(),st.reject()})}}addTranslations(et,tt){notify.onLangReady().promise.then(rt=>{this.loadBundle(rt,et+"/"+rt+".json",tt)})}addAllTranslations(et){return et&&et.length>0?notify.onLangReady().promise.then(tt=>Promise.all(et.map(rt=>this.loadBundlePromise(tt,rt+"/"+tt+".json")))).then(()=>{}):Promise.reject()}addKeys(et){for(var tt in et)typeof bundle$1[tt]!="string"&&(bundle$1[tt]=et[tt])}removeAccents(et){for(var tt=0;tt<defaultDiacriticsRemovalMap$1.length;tt++)et=et.replace(defaultDiacriticsRemovalMap$1[tt].letters,defaultDiacriticsRemovalMap$1[tt].base);return et}}class UserPreferences{constructor(){m$2(this,"data",{})}get(et){return this.data[et]}load(et,tt){return transport.http.get("/userbook/preference/"+et).then(rt=>{try{return JSON.parse(rt.preference)}catch{return tt??{}}}).then(rt=>(this.data[et]=rt??{},rt))}update(et,tt){return tt!==void 0&&(this.data[et]=tt),this}save(et){return transport.http.putJson("/userbook/preference/"+et,this.data[et])}}class User{constructor(){m$2(this,"_me",null),m$2(this,"_keepOpenOnLogout",!1),m$2(this,"_preferences",new UserPreferences),m$2(this,"_bookmarkedApps",[])}get keepOpenOnLogout(){return this._keepOpenOnLogout}get preferences(){return this._preferences}get bookmarkedApps(){return this._bookmarkedApps}initialize(et){return this.loadPublicConf(),notify.onSessionReady().promise.then(tt=>{tt&&this.setCurrentModel(tt)})}setCurrentModel(et){this._me=et,this._preferences=new UserPreferences,this.loadBookmarks()}loadPublicConf(){return transport.http.get("/conf/public").then(et=>(this._keepOpenOnLogout=(et==null?void 0:et.keepOpenOnLogout)||!1,et))}async loadBookmarks(){await transport.http.get("/userbook/preference/apps").then(et=>{et.preference||(et.preference=null);const tt=JSON.parse(et.preference);let rt;if(tt&&tt.length&&typeof tt.concat=="function"){this._bookmarkedApps=tt,rt={bookmarks:tt.map(ot=>ot.name),applications:[]},transport.http.putJson("/userbook/preference/apps",rt);return}else rt=tt;rt||(rt={bookmarks:[],applications:[]});let nt=!0;const st=[];rt.bookmarks.forEach((ot,at)=>{const ut=this._me.apps.find(lt=>lt.name===ot);if(ut){let lt=Object.assign({},ut);this._bookmarkedApps.push(lt)}else st.push(ot),nt=!1}),st.forEach(ot=>{let at=rt.bookmarks.indexOf(ot);at!==-1&&rt.bookmarks.splice(at,1)}),nt||transport.http.putJson("/userbook/preference/apps",rt)})}loadAppPrefs(et){return this.preferences.load(et,{})}saveAppPrefs(et){return this.preferences.save(et)}loadLanguage(){return this.preferences.load("language",{"default-domain":session.session.currentLanguage}).then(et=>et["default-domain"])}saveLanguage(et){return this.preferences.update("language",{"default-domain":et}).save("language")}}const http$1=transport==null?void 0:transport.http;class AppConf{constructor(){m$2(this,"_publicConf",{}),m$2(this,"_currentApp"),m$2(this,"_appConf",{})}get currentApp(){var et;return(et=this._currentApp)!=null?et:null}setCurrentApp(et){return this._currentApp=et,this}async initialize(et,tt=!1){tt||this.setCurrentApp(et),await Promise.all([this.getPublicConf(et),this.loadI18n(et)])}async getPublicConf(et){return this._publicConf[et]||(this._publicConf[et]=await http$1.get(`/${et}/conf/public`,{queryParams:{_:configure.Platform.deploymentTag}})),this._publicConf[et]}async getWebAppConf(et){var tt;let rt;return this._appConf[et]||(await http$1.get("/applications-list")).apps.forEach(nt=>{if(nt!=null&&nt.prefix){const st=nt.prefix.replace("/","");this._appConf[st]=nt}else nt!=null&&nt.name&&nt.name.toLowerCase()==et&&(rt=nt)}),(tt=this._appConf[et])!=null?tt:rt}async loadI18n(et){return await notify.onLangReady().promise,configure.Platform.idiom.addBundlePromise(`/${et}/i18n`)}}class Analytics{constructor(){m$2(this,"_status","void"),m$2(this,"_params")}get status(){return this._status}xiti(){return this.parametersWithCheck("xiti",!1)}parameters(et){return this.parametersWithCheck(et,!0)}async parametersWithCheck(et,tt){return this.initialize().promise.then(rt=>!tt||rt.type===et||rt.type==="multiple"?rt[et]:void 0)}initialize(){return this._params||(this._params=notify.promisify(),this._status="pending",Promise.all([transport.http.get("/analyticsConf"),transport.http.get("/xiti/config")]).then(async et=>{var tt;if(!et||!et[0]||!et[0].type)throw ERROR_CODE.MALFORMED_DATA;et[1]&&et[1].active&&(et[0].xiti=await this.initializeXiti(et[1])),(tt=this._params)==null||tt.resolve(et[0]),this._status="ready"}).catch(et=>{var tt;throw this._status="failed",(tt=this._params)==null||tt.reject(),et})),this._params}async initializeXiti(et){var tt;if(!et.structureMap||!configure.Platform.apps.currentApp)return;const rt=await notify.onSessionReady().promise,nt=session.session.description;let st;for(let dt of rt.structures){const ct=et.structureMap[dt];if(ct&&ct.collectiviteId&&ct.UAI){st=ct;break}}if(!st||!st.active)return;const ot=await configure.Platform.apps.getPublicConf(configure.Platform.apps.currentApp);if(!ot)return;const at=ot.xiti;if(!at||!at.LIBELLE_SERVICE||!st.UAI)return;function ut(dt){let ct="";for(let ft=0;ft<dt.length;ft++)ct+=dt.charCodeAt(ft);return ct}const lt={Student:"ELEVE",Teacher:"ENSEIGNANT",Relative:"PARENT",Personnel:"ADMIN_VIE_SCOL_TECH",Guest:"AUTRE"};return{LIBELLE_SERVICE:at.LIBELLE_SERVICE,TYPE:at.OUTIL?"TIERS":"NATIF",OUTIL:at.OUTIL?at.OUTIL:"",STRUCT_ID:st.collectiviteId,STRUCT_UAI:st.UAI,PROJET:st.projetId?st.projetId:et.ID_PROJET,EXPLOITANT:et.ID_EXPLOITANT,PLATFORME:st.plateformeId?st.plateformeId:et.ID_PLATEFORME,ID_PERSO:ut(rt.userId),PROFILE:nt.profiles&&nt.profiles.length>0&&(tt=lt[nt.profiles[0]])!=null?tt:""}}}class ConfigurationFramework{constructor(){m$2(this,"Platform",{deploymentTag:"",cdnDomain:"",apps:new AppConf,theme:new Theme,analytics:new Analytics,idiom:new Idiom,listLanguages:()=>transport.http.get("/languages")}),m$2(this,"School",{}),m$2(this,"User",new User)}async initialize(et,tt){if(!et){const nt=lt=>(lt<10?"0":"")+lt.toFixed(0),st=new Date,ot=st.getFullYear(),at=st.getMonth()+1,ut=st.getDate();et=`${ot}${nt(at)}${nt(ut)}`}const rt=et;this.Platform.deploymentTag=et,typeof tt=="string"&&tt.length>0&&(this.Platform.cdnDomain=tt),transport.http.setCdn(this.Platform.cdnDomain),await Promise.all([this.Platform.theme.initialize(rt),notify.onSessionReady().promise.then(nt=>this.Platform.idiom.addBundlePromise("/i18n")),this.User.initialize(rt)])}}const configure=new ConfigurationFramework;class ConfigurationFrameworkFactory{static instance(){return configure}}const WIDGET_POSITION={LEFT:"left",RIGHT:"right"},firstLevelWidgets=["birthday","mood","calendar-widget","notes"],secondLevelWidgets=["agenda-widget","carnet-de-bord","my-apps","rss-widget","bookmark-widget","cursus-widget","maxicours-widget","school-widget"],defaultWidgetPosition={"last-infos-widget":WIDGET_POSITION.LEFT,birthday:WIDGET_POSITION.LEFT,"calendar-widget":WIDGET_POSITION.RIGHT,"carnet-de-bord":WIDGET_POSITION.LEFT,"record-me":WIDGET_POSITION.RIGHT,mood:WIDGET_POSITION.LEFT,"my-apps":WIDGET_POSITION.RIGHT,notes:WIDGET_POSITION.RIGHT,"rss-widget":WIDGET_POSITION.LEFT,"bookmark-widget":WIDGET_POSITION.RIGHT,qwant:WIDGET_POSITION.RIGHT,"qwant-junior":WIDGET_POSITION.LEFT,"agenda-widget":WIDGET_POSITION.LEFT,"cursus-widget":WIDGET_POSITION.LEFT,"maxicours-widget":WIDGET_POSITION.RIGHT,"universalis-widget":WIDGET_POSITION.RIGHT,"briefme-widget":WIDGET_POSITION.LEFT,"school-widget":WIDGET_POSITION.LEFT},defaultWidgetOrder={"school-widget":0,"my-apps":10,"record-me":15,"last-infos-widget":20,qwant:30,"qwant-junior":30,"universalis-widget":35,"agenda-widget":40,"bookmark-widget":50,"carnet-de-bord":60,"maxicours-widget":70,"cursus-widget":80,"briefme-widget":90,"rss-widget":100,mood:110,birthday:120,"calendar-widget":130,notes:140};class WidgetFramework{constructor(){m$2(this,"_initialized"),m$2(this,"_widgets",[]),m$2(this,"_userPrefs",{})}initialize(et,tt){return this._initialized||(this._initialized=new Promisified,notify.onSessionReady().promise.then(rt=>{var nt;rt&&rt.widgets?(rt.widgets.forEach(st=>{this._widgets.push(new Widget(st))}),this.loadUserPrefs().then(()=>{var st;(st=this._initialized)==null||st.resolve()}).catch(st=>{var ot;(ot=this._initialized)==null||ot.reject()})):(nt=this._initialized)==null||nt.reject()})),this._initialized.promise}get list(){return this._widgets}lookup(et){return this._widgets.find(tt=>tt.platformConf.name===et)}lookupDefaultPosition(et){return defaultWidgetPosition[et]}get userPrefs(){return this._userPrefs}async loadUserPrefs(){await configure.User.preferences.load("widgets",{}).then(et=>this.applyUserPrefs(et))}saveUserPrefs(){return configure.User.preferences.update("widgets",this._userPrefs).save("widgets").then(()=>{notify.events().next({name:EVENT_NAME.USERPREF_CHANGED,layer:LAYER_NAME.WIDGETS})})}async applyUserPrefs(et){this._userPrefs=et??this._userPrefs;const tt=configure.Platform.theme,rt=[];tt.listSkins().then(nt=>{var st;const ot=((st=nt.find(ut=>ut.child===tt.skin))==null?void 0:st.parent)==="panda"?secondLevelWidgets:firstLevelWidgets;this._widgets=this._widgets.filter((ut,lt)=>{var dt,ct;const ft=ut.platformConf.name;return ot.indexOf(ft)!==-1?!1:(this._userPrefs[ft]||(this._userPrefs[ft]={index:(dt=defaultWidgetOrder[ft])!=null?dt:999,show:!0,position:ut.platformConf.position}),ut.platformConf.mandatory&&(this._userPrefs[ft].show=!0,this._userPrefs[ft].index=(ct=defaultWidgetOrder[ft])!=null?ct:999),ut.platformConf.i18n&&rt.push(ut.platformConf.i18n),ut.applyUserPref(this._userPrefs[ft]),!0)});const at=new Idiom;this._widgets=this._widgets.sort((ut,lt)=>{const dt=at.translate(`timeline.settings.${ut.platformConf.name}`).toLowerCase(),ct=at.translate(`timeline.settings.${lt.platformConf.name}`).toLowerCase();return dt<ct?-1:dt>ct?1:0})})}}class Widget{constructor(et){m$2(this,"_schoolConf",{}),m$2(this,"_userPref"),this._platformConf=et,this._userPref=null}get platformConf(){return this._platformConf}get schoolConf(){return this._schoolConf}get userPref(){return this._userPref}applyUserPref(et){var tt,rt;this._userPref=et,this._userPref.position=(rt=(tt=this._userPref.position)!=null?tt:widgets.lookupDefaultPosition(this._platformConf.name))!=null?rt:"left"}}const widgets=new WidgetFramework;transport==null||transport.http;var O$1;(O$1=session==null?void 0:session.session)==null||O$1.user;const x$1=class{constructor(et){m$2(this,"checkHttpResponse",tt=>{if(this.http.latestResponse.status>=300)throw this.http.latestResponse.statusText;return tt}),this.context=et}static register({application:et,resourceType:tt},rt){x$1.registry.set(`${et}:main`,rt),x$1.registry.set(`${et}:${tt}`,rt)}static findService({application:et,resourceType:tt},rt){const nt=x$1.registry.get(`${et}:${tt}`);if(nt===void 0)throw`Service not found: ${et}:${tt}`;return nt(rt)}static findMainService({application:et},tt){const rt=x$1.registry.get(`${et}:main`);if(rt===void 0)throw`Service not found: ${et}`;return rt(tt)}get http(){return this.context.http()}getShareReadUrl(et){return`/${this.getApplication()}/share/json/${et}?search=`}getSaveShareUrl(et){return`/${this.getApplication()}/share/resource/${et}`}gotoPrint(et,tt){window.open(this.getPrintUrl(et,tt),"_blank")}gotoView(et){window.open(this.getViewUrl(et),"_self")}gotoForm(et){window.open(this.getFormUrl(et),"_self")}async publish(et){const tt=new FormData;tt.append("title",et.title),tt.append("cover",et.cover),tt.append("coverName",et.cover.name),tt.append("coverType",et.cover.type),tt.append("teacherAvatar",et.teacherAvatar),tt.append("teacherAvatarName",et.teacherAvatar.name||`teacherAvatar_${et.userId}`),tt.append("teacherAvatarType",et.teacherAvatar.type),tt.append("language",et.language),et.activityType.forEach(nt=>{tt.append("activityType[]",nt)}),et.subjectArea.forEach(nt=>{tt.append("subjectArea[]",nt)}),et.age.forEach(nt=>{tt.append("age[]",nt.toString())}),tt.append("description",et.description),et.keyWords.split(",").forEach(nt=>{tt.append("keyWords[]",nt.trim())}),tt.append("licence",et.licence),tt.append("pdfUri",`${window.location.origin}${this.getPrintUrl(et.resourceEntId)}`),tt.append("application",et.application?et.application:""),tt.append("resourceId",et.resourceId),tt.append("teacherSchool",et.userStructureName);const rt=await this.http.post("/appregistry/library/resource",tt,{headers:{"Content-Type":"multipart/form-data"}});return this.checkHttpResponse(rt)}async createContext(et){const tt=await this.http.get("/explorer/context",{queryParams:this.toQueryParams(et)});return this.checkHttpResponse(tt)}async searchContext(et){const tt=await this.http.get("/explorer/resources",{queryParams:this.toQueryParams(et)});return this.checkHttpResponse(tt)}async createFolder(et){const tt=await this.http.post("/explorer/folders",this.createFolderToBodyParams(et));return this.checkHttpResponse(tt)}async updateFolder(et){const tt=await this.http.put(`/explorer/folders/${et.folderId}`,this.createFolderToBodyParams(et));return this.checkHttpResponse(tt)}async moveToFolder(et){const tt=await this.http.post(`/explorer/folders/${et.folderId}/move`,this.moveToBodyParams(et));return this.checkHttpResponse(tt)}async listSubfolders(et){const tt=await this.http.get(`/explorer/folders/${et}`);return this.checkHttpResponse(tt)}async deleteAll(et){const tt=await this.http.deleteJson("/explorer",et);return this.checkHttpResponse(tt)}async trashAll({resourceType:et,...tt}){const rt=await this.http.putJson("/explorer/trash",tt);return this.checkHttpResponse(rt)}async restoreAll({resourceType:et,...tt}){const rt=await this.http.putJson("/explorer/restore",tt);return this.checkHttpResponse(rt)}async getThumbnailPath(et){if(typeof et>"u")return et;if(typeof et=="string")if(et.startsWith("blob:")){const tt=await fetch(et).then(rt=>rt.blob());return`/workspace/document/${(await this.context.workspace().saveFile(tt,{visibility:"protected",application:this.getApplication()}))._id}`}else return et;else return`/workspace/document/${(await this.context.workspace().saveFile(et,{visibility:"protected",application:this.getApplication()}))._id}`}toQueryParams(et){let tt={application:et.app,start_idx:et.pagination.startIdx,page_size:et.pagination.pageSize,resource_type:et.types[0],trashed:et.trashed};if(et.orders&&Object.entries(et.orders).length){const[[rt,nt]]=Object.entries(et.orders);tt.order_by=`${rt}:${nt}`}return et.filters&&Object.assign(tt,et.filters),typeof et.search=="string"&&(tt.search=et.search),tt}createFolderToBodyParams(et){return{application:et.app,resourceType:et.type,parentId:et.parentId,name:et.name}}moveToBodyParams(et){return{application:et.application,resourceType:this.getResourceType(),resourceIds:et.resourceIds,folderIds:et.folderIds}}};let ResourceService=x$1;m$2(ResourceService,"registry",new Map);class BlogResourceService extends ResourceService{async update(et){const tt=await this.getThumbnailPath(et.thumbnail),rt=await this.http.put(`/blog/${et.entId}`,{trashed:et.trashed,_id:et.entId,title:et.name,thumbnail:tt,description:et.description,visibility:et.public?"PUBLIC":"OWNER",slug:et.public?et.slug:"","publish-type":et["publish-type"]||"RESTRAINT","comment-type":"IMMEDIATE"});return this.checkHttpResponse(rt),{thumbnail:tt,entId:et.entId}}getResourceType(){return RESOURCE.BLOG}getApplication(){return APP.BLOG}getFormUrl(et){return et?`/blog?folderid=${et}#/edit/new`:"/blog#/edit/new"}getViewUrl(et){return`/blog#/view/${et}`}getPrintUrl(et,tt){return`/blog/print/blog#/print/${et}?comments=${tt||!0}`}}ResourceService.register({application:RESOURCE.BLOG,resourceType:RESOURCE.BLOG},_e=>new BlogResourceService(_e));class MindmapResourceService extends ResourceService{async update(et){const tt=et.thumbnail?await this.getThumbnailPath(et.thumbnail):"",rt=await this.http.put(`/mindmap/${et.entId}`,{trashed:et.trashed,_id:et.entId,name:et.name,thumbnail:tt,description:et.description,visibility:et.public?"PUBLIC":"OWNER"});return this.checkHttpResponse(rt),{thumbnail:tt,entId:et.entId}}getResourceType(){return RESOURCE.MINDMAP}getApplication(){return APP.MINDMAP}getFormUrl(et){return et?`/mindmap?folderid=${et}/new`:"/mindmap/new"}getViewUrl(et){return`/mindmap/id/${et}`}getPrintUrl(et,tt){return`/mindmap/print/id/${et}?comments=${tt||!0}`}}ResourceService.register({application:RESOURCE.MINDMAP,resourceType:RESOURCE.MINDMAP},_e=>new MindmapResourceService(_e));const globalCache={},mutexPromise={};class CacheService{constructor(et){this.context=et}get http(){return this.context.http()}async fromCacheIfPossible(et,tt,rt){if(mutexPromise[et]&&await mutexPromise[et],globalCache[et])return globalCache[et];try{const nt=tt();mutexPromise[et]=nt;const st=await nt;return rt(st)&&(globalCache[et]=st),st}catch(nt){throw console.error(`Failed to retrieve value for: ${et}`,nt),nt}}clearCache(et){if(et)delete globalCache[et];else for(const tt in globalCache)globalCache.hasOwnProperty(tt)&&delete globalCache[tt]}async httpGet(et,tt){return this.fromCacheIfPossible(et,async()=>{const rt=await this.http.get(et,tt),nt={...this.http.latestResponse};return{value:rt,response:nt}},({response:rt})=>!(rt.status<200||rt.status>=300))}async httpGetJson(et,tt){const{response:rt,value:nt}=await this.httpGet(et,tt);if(rt.status<200||rt.status>=300)throw`Bad http status (${rt.status}) for url: ${et}`;return nt}}class ConfService{constructor(et){this.context=et}get http(){return this.context.http()}get cdnDomain(){return configure.Platform.cdnDomain}async getConf(et){const[tt,rt]=await Promise.all([this.getThemeConf(),this.getApplicationsList()]),[nt,st,ot]=await Promise.all([this.getTheme({conf:tt}),this.getWebAppConf({app:et,applications:rt}),this.getExtendedTheme()]);return{applications:rt,conf:tt,currentApp:st,theme:nt,extendedTheme:ot}}getCdnUrl(){console.warn("[getCdnUrl] Not implemented yet")}async savePreference(et,tt){this.http.putJson(`/userbook/preference/${et}`,tt)}async getPreference(et){const tt=await this.http.get(`/userbook/preference/${et}`);return JSON.parse(tt.preference)}async getThemeConf(et){return await this.http.getScript("/assets/theme-conf.js",{queryParams:{v:et}},"exports.conf")}async getExtendedTheme(){try{return await this.http.get("/assets/extended-theme.json")}catch{return console.error("[getExtendedTheme] could not found /assets/extended-theme.json"),{}}}async getApplicationsList(){return(await this.http.get("/applications-list")).apps}async getWebAppConf({app:et,applications:tt}){return tt.find(rt=>{if(rt!=null&&rt.prefix)return(rt==null?void 0:rt.prefix.replace("/",""))===et})}async getTheme({version:et,conf:tt}){const rt=await this.http.get("/theme",{queryParams:{_:et}}),nt=rt.themeName,st=tt==null?void 0:tt.overriding.find(ct=>ct.child===nt).skins,ot="/assets/themes/ode-bootstrap",at=tt==null?void 0:tt.overriding.find(ct=>ct.child===nt).bootstrapVersion,ut=`${this.cdnDomain}/assets/themes/${at}`,lt=`${ut}/skins/${rt.skinName}`,dt=(tt==null?void 0:tt.overriding.find(ct=>ct.child===nt).parent)==="panda";return{basePath:`${this.cdnDomain}${rt.skin}../../`,bootstrap:ot,bootstrapPath:ut,bootstrapUrl:lt,bootstrapVersion:at,is1d:dt,logoutCallback:rt.logoutCallback,skin:rt.skin.split("/assets/themes/")[1].split("/")[0],skinName:rt.skinName,skins:st,themeName:rt.themeName,themeUrl:rt.skin}}}class DirectoryService{constructor(et){this.odeServices=et}get http(){return this.odeServices.http()}get cache(){return this.odeServices.cache()}getAvatarUrl(et,tt,rt="100x100"){return tt==="user"?`/userbook/avatar/${et}?thumbnail=${rt}`:"/assets/img/illustrations/group-avatar.svg"}getDirectoryUrl(et,tt){return tt==="user"?`/userbook/annuaire#/${et}`:`/userbook/annuaire#/group-view/${et}`}async getBookMarks(){return(await this.cache.httpGetJson("/directory/sharebookmark/all")).map(({id:et,name:tt})=>({id:et,displayName:tt,members:[]}))}async getBookMarkById(et){const{groups:tt,id:rt,name:nt,users:st}=await this.http.get(`/directory/sharebookmark/${et}`);return{id:rt,displayName:nt,groups:tt.map(({name:ot,id:at})=>({displayName:ot,id:at})),users:st.map(({displayName:ot,id:at,profile:ut})=>({profile:ut,displayName:ot,firstName:"",lastName:"",login:"",id:at}))}}async saveBookmarks(et,{bookmarks:tt,groups:rt,users:nt}){this.cache.clearCache("/directory/sharebookmark/all");const st=nt.map(ct=>typeof ct=="string"?ct:ct.id),ot=rt.map(ct=>typeof ct=="string"?ct:ct.id),at=tt.map(async ct=>{if(typeof ct=="string"){const{displayName:ft,groups:ht,id:mt,users:vt}=await this.getBookMarkById(ct),wt=vt.map(yt=>yt.id),gt=ht.map(yt=>yt.id);return{displayName:ft,id:mt,members:[...gt,...wt]}}else return Promise.resolve(ct)}),ut=(await Promise.all(at)).map(ct=>ct.members).reduce((ct,ft)=>[...ct,...ft],[]),lt={name:et,members:[...st,...ot,...ut]},{id:dt}=await this.http.postJson("/directory/sharebookmark",lt);return{id:dt,displayName:et,members:lt.members}}}const loadedScripts={};class HttpService{constructor(et,tt){m$2(this,"axios"),m$2(this,"_latestResponse"),this.context=et,this.axios=axios.create(tt)}setCdn(et){et&&XMLHttpRequest&&!XMLHttpRequest.prototype.cdnUrl&&(XMLHttpRequest.prototype.cdnUrl=et,XMLHttpRequest.prototype.baseOpen=XMLHttpRequest.prototype.open,XMLHttpRequest.prototype.open=function(){const tt=arguments[1];return tt.startsWith("/infra/public")&&(arguments[1]=et+tt),/^\/([^\/]*)\/public/.test(tt)&&(arguments[1]=et+tt),tt.startsWith("/assets")&&(arguments[1]=et+tt),tt=="/conf/public"&&(arguments[1]=tt),tt.startsWith("http")&&(arguments[1]=tt),this.baseOpen.apply(this,arguments)})}toAxiosConfig(et){if(et){const tt=Object.assign({},this.axios.defaults);return et.headers&&(tt.headers=Object.assign({},this.axios.defaults.headers),Object.assign(tt.headers,et.headers)),et.responseType&&(tt.responseType=et.responseType),et.queryParams&&(tt.params=Object.assign({},et.queryParams)),tt}else return this.axios.defaults}toCdnUrl(et){const tt=this.context.conf().getCdnUrl()||"";if(tt.length>0&&et!=="/conf/public"){const rt=""+et;(rt.startsWith("/infra/public")||rt.startsWith("/assets")||/^\/([^\/]*)\/public/.test(rt))&&(et=tt+rt)}return et}mapAxiosError(et,tt){return console.error("[HttpService]",et),et.response?this._latestResponse=et.response:et.request?this._latestResponse={status:408,statusText:ERROR_CODE.TIME_OUT}:this._latestResponse={status:500,statusText:ERROR_CODE.UNKNOWN},!tt||tt.disableNotifications,this._latestResponse}mapAxiosResponse(et,tt){return this._latestResponse=et,et.data}get latestResponse(){return this._latestResponse}async get(et,tt){try{const rt=await this.axios.get(this.toCdnUrl(et),this.toAxiosConfig(tt));return this.mapAxiosResponse(rt,tt)}catch(rt){return this.mapAxiosError(rt,tt)}}async post(et,tt,rt){try{const nt=await this.axios.post(et,tt,this.toAxiosConfig(rt));return this.mapAxiosResponse(nt,rt)}catch(nt){return this.mapAxiosError(nt,rt)}}async postFile(et,tt,rt){const nt=this.toAxiosConfig(rt);nt.headers&&nt.headers["Content-Type"]&&delete nt.headers["Content-Type"];try{const st=await this.axios.post(et,tt,{...nt,headers:{"Content-Type":"multipart/form-data"}});return this.mapAxiosResponse(st,rt)}catch(st){return this.mapAxiosError(st,rt)}}async postJson(et,tt,rt){const nt=this.toAxiosConfig();nt.headers&&(nt.headers["Content-Type"]="application/json");try{const st=await this.axios.post(et,tt,this.toAxiosConfig(rt));return this.mapAxiosResponse(st,rt)}catch(st){return this.mapAxiosError(st,rt)}}async put(et,tt,rt){try{const nt=await this.axios.put(et,tt,this.toAxiosConfig(rt));return this.mapAxiosResponse(nt,rt)}catch(nt){return this.mapAxiosError(nt,rt)}}async putFile(et,tt,rt){try{const nt=this.toAxiosConfig(rt);nt.headers&&nt.headers["Content-Type"]&&delete nt.headers["Content-Type"];const st=await this.axios.put(et,tt,{...nt,headers:{"Content-Type":"multipart/form-data"}});return this.mapAxiosResponse(st,rt)}catch(nt){return this.mapAxiosError(nt,rt)}}async putJson(et,tt,rt){const nt=this.toAxiosConfig(rt);nt.headers&&(nt.headers["Content-Type"]="application/json");try{const st=await this.axios.put(et,tt,nt);return this.mapAxiosResponse(st,rt)}catch(st){return this.mapAxiosError(st,rt)}}async delete(et,tt){try{const rt=await this.axios.delete(et,this.toAxiosConfig(tt));return this.mapAxiosResponse(rt,tt)}catch(rt){return this.mapAxiosError(rt,tt)}}async deleteJson(et,tt){try{const rt=await this.axios.delete(et,{data:tt});return this.mapAxiosResponse(rt)}catch(rt){return this.mapAxiosError(rt)}}getScript(et,tt,rt){const nt=rt??"exports",st=this.toAxiosConfig(tt);return st.headers&&(st.headers.Accept="application/javascript"),this.axios.get(this.toCdnUrl(et),st).then(ot=>this.mapAxiosResponse(ot,tt)).then(ot=>{try{const at=`"use strict";var ${nt.split(".")[0]}={};${ot};return ${nt};`;return Function(at)()}catch{return ot}}).catch(ot=>{throw this.mapAxiosError(ot,tt),ot})}loadScript(et,tt){return loadedScripts[et]?Promise.resolve():this.getScript(et,tt).then(rt=>{loadedScripts[et]=!0})}}class RightService{constructor(et){this.context=et}get session(){return this.context.session()}parseResourceRight(et){const tt=et.split(":");if(tt.length===2){if(tt[0]==="creator")return{id:tt[1],right:"creator",type:"creator"}}else return tt.length===3?{id:tt[1],right:tt[2],type:tt[0]}:void 0}parseResourceRights(et){return et.map(tt=>this.parseResourceRight(tt)).filter(tt=>tt!==void 0)}hasResourceRight({id:et,groupIds:tt},rt,nt){const st=nt.map(ot=>typeof ot=="string"?this.parseResourceRight(ot):ot).filter(ot=>ot!==void 0);for(const ot of st)if(ot.id===et&&ot.type==="creator"||ot.id===et&&ot.type==="user"&&ot.right===rt||tt.includes(ot.id)&&ot.type==="group"&&ot.right===rt)return!0;return!1}async sessionHasResourceRight(et,tt){try{const rt=await this.session.getUser();return!!rt&&this.hasResourceRight({groupIds:rt.groupsIds,id:rt.userId},et,tt)}catch(rt){return console.error(rt),!1}}async sessionHasAtLeastOneResourceRight(et,tt){for(const rt of et)if(await this.sessionHasResourceRight(rt,tt))return!0;return!1}async sessionHasResourceRightForEachList(et,tt){let rt=0;for(const nt of tt)await this.sessionHasResourceRight(et,nt)&&rt++;return rt===tt.length}async sessionHasAtLeastOneResourceRightForEachList(et,tt){for(const rt of et){let nt=0;for(const st of tt)await this.sessionHasResourceRight(rt,st)&&nt++;if(nt===tt.length)return!0}return!1}hasWorkflowRight(et,tt){return tt.findIndex(rt=>rt===et)!==-1}async sessionHasWorkflowRight(et){try{const tt=await this.session.getUser();return!!tt&&this.hasWorkflowRight(et,tt.authorizedActions.map(rt=>rt.name))}catch(tt){return console.error(tt),!1}}async sessionHasWorkflowRights(et){const tt={};try{const rt=await this.session.getUser();for(const nt of et)tt[nt]=!!rt&&this.hasWorkflowRight(nt,rt.authorizedActions.map(st=>st.name))}catch(rt){console.error(rt);for(const nt of et)tt[nt]=!1}return tt}}class SessionService{constructor(et){this.context=et}get http(){return this.context.http()}get cache(){return this.context.cache()}onLogout(){this.cache.clearCache()}onRefreshSession(){this.cache.clearCache()}async getSession(){const et=await this.getUser(),[tt,rt,nt,st,ot]=await Promise.all([this.getCurrentLanguage(et),this.latestQuotaAndUsage(et),this.loadDescription(et),this.getUserProfile(),this.getBookmarks(et)]);return{user:et,quotaAndUsage:rt,currentLanguage:tt,userDescription:nt,userProfile:st,bookmarkedApps:ot}}login(et,tt,rt,nt){const st=new FormData;return st.append("email",et),st.append("password",tt),typeof rt<"u"&&st.append("rememberMe",""+rt),typeof nt<"u"&&st.append("secureLocation",""+nt),this.http.post("/auth/login",st,{headers:{"content-type":"application/x-www-form-urlencoded"}}).finally(()=>{switch(this.http.latestResponse.status){case 200:throw ERROR_CODE.MALFORMED_DATA}})}logout(){return this.http.get("/auth/logout").finally(()=>{})}async latestQuotaAndUsage(et){try{return await this.http.get(`/workspace/quota/user/${et==null?void 0:et.userId}`)}catch(tt){return console.error(tt),{quota:0,storage:0}}}async getCurrentLanguage(et){const tt=(et==null?void 0:et.sessionMetadata)&&(et==null?void 0:et.sessionMetadata.userId);try{let rt;return tt?rt=await this.loadUserLanguage():rt=await this.loadDefaultLanguage(),rt}catch(rt){console.error(rt)}}async loadUserLanguage(){try{const et=await this.http.get("/userbook/preference/language");return JSON.parse(et.preference)["default-domain"]}catch{return await this.loadDefaultLanguage()}}async loadDefaultLanguage(){return(await this.cache.httpGetJson("/locale")).locale}async getUser(){const{response:et,value:tt}=await this.cache.httpGet("/auth/oauth2/userinfo");if(et.status<200||et.status>=300)throw ERROR_CODE.NOT_LOGGED_IN;return tt}hasWorkflow({workflowName:et,user:tt}){return et===void 0||(tt==null?void 0:tt.authorizedActions.findIndex(rt=>rt.name===et))!==-1}async loadDescription(et){try{const[tt,rt]=await Promise.all([this.getUserProfile({requestName:"refreshAvatar"}),this.http.get("/directory/userbook/"+(et==null?void 0:et.userId))]);return{...tt,...rt}}catch(tt){return console.error(tt),{}}}async getBookmarks(et){const tt=await this.http.get("/userbook/preference/apps");tt.preference||(tt.preference=null);const rt=JSON.parse(tt.preference);let nt;nt=rt,nt||(nt={bookmarks:[],applications:[]});let st=[];return nt.bookmarks.forEach((ot,at)=>{const ut=et==null?void 0:et.apps.find(lt=>lt.name===ot);if(ut){let lt=Object.assign({},ut);st.push(lt)}}),st}async getUserProfile(et){const{response:tt,value:rt}=await this.cache.httpGet("/userbook/api/person",et);if(tt.status<200||tt.status>=300)throw ERROR_CODE.NOT_LOGGED_IN;return rt.result[0].type}async isAdml(){const et=await this.getUser();return(et==null?void 0:et.functions.ADMIN_LOCAL)!==void 0}}class StringUtils{static removeAccents(et){for(var tt=0;tt<defaultDiacriticsRemovalMap$1.length;tt++)et=et.replace(defaultDiacriticsRemovalMap$1[tt].letters,defaultDiacriticsRemovalMap$1[tt].base);return et}}class ShareService{constructor(et){this.context=et}get directory(){return this.context.directory()}get http(){return this.context.http()}get cache(){return this.context.cache()}async searchShareSubjects(et,tt,rt){const nt=StringUtils.removeAccents(rt).toLowerCase(),st=await this.cache.httpGetJson(`/${et}/share/json/${tt}?search=${rt}`),ot=st.users.visibles.filter(({username:ut,firstName:lt,lastName:dt,login:ct})=>{const ft=StringUtils.removeAccents(dt||"").toLowerCase(),ht=StringUtils.removeAccents(lt||"").toLowerCase(),mt=StringUtils.removeAccents(ut||"").toLowerCase(),vt=StringUtils.removeAccents(ct||"").toLowerCase();return mt.includes(nt)||ht.includes(nt)||ft.includes(nt)||vt.includes(nt)}).map(ut=>({avatarUrl:this.directory.getAvatarUrl(ut.id,"user"),directoryUrl:this.directory.getDirectoryUrl(ut.id,"user"),displayName:ut.username,id:ut.id,profile:ut.profile,type:"user"})),at=st.groups.visibles.filter(({name:ut})=>StringUtils.removeAccents(ut||"").toLowerCase().includes(nt)).map(ut=>({avatarUrl:this.directory.getAvatarUrl(ut.id,"group"),directoryUrl:this.directory.getDirectoryUrl(ut.id,"group"),displayName:ut.name,id:ut.id,type:"group"}));return[...(await this.directory.getBookMarks()).filter(({displayName:ut})=>StringUtils.removeAccents(ut||"").toLowerCase().includes(nt)).map(ut=>({avatarUrl:"",directoryUrl:"",profile:"",displayName:ut.displayName,id:ut.id,type:"sharebookmark"})),...ot,...at]}async getShareMapping(et){const tt=await this.cache.httpGetJson(`/${et}/rights/sharing`);for(const rt of Object.keys(tt))if(rt.includes(".")){const nt=rt.split(".")[1],st=tt[rt];delete tt[rt],tt[nt]=st}return tt}getActionsAvailableFor({id:et,type:tt},rt,nt){const st=(tt==="user"?rt.users.checked[et]:rt.groups.checked[et])||[],ot=Object.keys(nt),at=[];for(const ut of ot)nt[ut].filter(lt=>st.includes(lt)).length>0&&at.push(ut);return at}async getRightsForResource(et,tt){const rt=await this.directory.getBookMarks(),nt=this.context.resource(et,et).getShareReadUrl(tt),st=await this.cache.httpGetJson(nt),ot=await this.getShareMapping(et),at=await this.cache.httpGetJson("/infra/public/json/sharing-rights.json"),ut=Object.keys(st.users.checked).map(ht=>st.users.visibles.find(mt=>mt.id===ht)).filter(ht=>ht!==void 0).map(ht=>{const mt=this.getActionsAvailableFor({id:ht.id,type:"user"},st,ot);return{id:ht.id,type:"user",displayName:ht.username,profile:ht.profile,avatarUrl:this.directory.getAvatarUrl(ht.id,"user"),directoryUrl:this.directory.getDirectoryUrl(ht.id,"user"),actions:mt.map(vt=>{const wt=at[vt];return{displayName:vt,id:vt,priority:wt.priority}})}}).sort((ht,mt)=>(ht.displayName||"").localeCompare(mt.displayName)),lt=Object.keys(st.groups.checked).map(ht=>st.groups.visibles.find(mt=>mt.id===ht)).filter(ht=>ht!==void 0).map(ht=>{const mt=this.getActionsAvailableFor({id:ht.id,type:"group"},st,ot);return{id:ht.id,type:"group",displayName:ht.name,profile:void 0,avatarUrl:this.directory.getAvatarUrl(ht.id,"group"),directoryUrl:this.directory.getDirectoryUrl(ht.id,"group"),actions:mt.map(vt=>{const wt=at[vt];return{displayName:vt,id:vt,priority:wt.priority}})}}).sort((ht,mt)=>(ht.displayName||"").localeCompare(mt.displayName)),dt=[...ut,...lt],ct=st.groups.visibles.map(({groupDisplayName:ht,id:mt,name:vt})=>({displayName:ht||vt,id:mt})),ft=st.users.visibles.map(({id:ht,profile:mt,username:vt,firstName:wt,lastName:gt,login:yt})=>({displayName:vt,firstName:wt,lastName:gt,login:yt,profile:mt,id:ht}));return{rights:dt,visibleBookmarks:rt,visibleGroups:ct,visibleUsers:ft}}async saveRights(et,tt,rt){const nt=await this.getShareMapping(et),st={bookmarks:{},groups:{},users:{}};for(const ut of rt){const lt=ut.actions.map(ct=>nt[ct.id]).reduce((ct,ft)=>[...ct,...ft],[]),dt=[...new Set(lt)];dt.length>0&&(ut.type==="user"?st.users[ut.id]=dt:ut.type==="group"?st.groups[ut.id]=dt:st.bookmarks[ut.id]=dt)}const ot=this.context.resource(et,et),at=ot.getSaveShareUrl(tt);return this.cache.clearCache(ot.getShareReadUrl(tt)),await this.http.putJson(at,st)}async getActionsForApp(et){const tt=await this.cache.httpGetJson("/infra/public/json/sharing-rights.json"),rt=await this.getShareMapping(et);return Object.keys(tt).map(nt=>{const st=tt[nt];return{displayName:nt,id:nt,priority:st.priority,requires:st.requires}}).filter(nt=>{var st;return((st=rt[nt.id])==null?void 0:st.length)>0}).sort((nt,st)=>nt.priority-st.priority)}}const S$1=class{constructor(){m$2(this,"wordExtensions",new Set),m$2(this,"excelExtensions",new Set),m$2(this,"pptExtensions",new Set),m$2(this,"fileExtensionMap",new Map),m$2(this,"csvContentType",new Set),m$2(this,"csvExtensions",new Set),m$2(this,"txtExtensions",new Set),m$2(this,"PDF","application/pdf"),m$2(this,"OCTET_STREAM","application/octet-stream"),this.txtExtensions.add("txt"),this.wordExtensions.add("doc"),this.wordExtensions.add("dot"),this.wordExtensions.add("docx"),this.wordExtensions.add("dotx"),this.wordExtensions.add("docm"),this.wordExtensions.add("dotm"),this.wordExtensions.add("odt"),this.wordExtensions.add("ott"),this.wordExtensions.add("oth"),this.wordExtensions.add("odm"),this.excelExtensions.add("xls"),this.excelExtensions.add("xlt"),this.excelExtensions.add("xla"),this.excelExtensions.add("xlsx"),this.excelExtensions.add("xltx"),this.excelExtensions.add("xlsm"),this.excelExtensions.add("xltm"),this.excelExtensions.add("xlam"),this.excelExtensions.add("xlsb"),this.excelExtensions.add("ods"),this.excelExtensions.add("ots"),this.pptExtensions.add("ppt"),this.pptExtensions.add("pot"),this.pptExtensions.add("pps"),this.pptExtensions.add("ppa"),this.pptExtensions.add("pptx"),this.pptExtensions.add("potx"),this.pptExtensions.add("ppsx"),this.pptExtensions.add("ppam"),this.pptExtensions.add("pptm"),this.pptExtensions.add("potm"),this.pptExtensions.add("ppsm"),this.pptExtensions.add("odp"),this.pptExtensions.add("otp"),this.csvExtensions.add("csv"),this.fileExtensionMap.set("doc","application/msword"),this.fileExtensionMap.set("dot","application/msword"),this.fileExtensionMap.set("docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"),this.fileExtensionMap.set("dotx","application/vnd.openxmlformats-officedocument.wordprocessingml.template"),this.fileExtensionMap.set("docm","application/vnd.ms-word.document.macroEnabled.12"),this.fileExtensionMap.set("dotm","application/vnd.ms-word.template.macroEnabled.12"),this.fileExtensionMap.set("xls","application/vnd.ms-excel"),this.fileExtensionMap.set("xlt","application/vnd.ms-excel"),this.fileExtensionMap.set("xla","application/vnd.ms-excel"),this.fileExtensionMap.set("xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"),this.fileExtensionMap.set("xltx","application/vnd.openxmlformats-officedocument.spreadsheetml.template"),this.fileExtensionMap.set("xlsm","application/vnd.ms-excel.sheet.macroEnabled.12"),this.fileExtensionMap.set("xltm","application/vnd.ms-excel.template.macroEnabled.12"),this.fileExtensionMap.set("xlam","application/vnd.ms-excel.addin.macroEnabled.12"),this.fileExtensionMap.set("xlsb","application/vnd.ms-excel.sheet.binary.macroEnabled.12"),this.fileExtensionMap.set("ppt","application/vnd.ms-powerpoint"),this.fileExtensionMap.set("pot","application/vnd.ms-powerpoint"),this.fileExtensionMap.set("pps","application/vnd.ms-powerpoint"),this.fileExtensionMap.set("ppa","application/vnd.ms-powerpoint"),this.fileExtensionMap.set("pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"),this.fileExtensionMap.set("potx","application/vnd.openxmlformats-officedocument.presentationml.template"),this.fileExtensionMap.set("ppsx","application/vnd.openxmlformats-officedocument.presentationml.slideshow"),this.fileExtensionMap.set("ppam","application/vnd.ms-powerpoint.addin.macroEnabled.12"),this.fileExtensionMap.set("pptm","application/vnd.ms-powerpoint.presentation.macroEnabled.12"),this.fileExtensionMap.set("potm","application/vnd.ms-powerpoint.presentation.macroEnabled.12"),this.fileExtensionMap.set("ppsm","application/vnd.ms-powerpoint.slideshow.macroEnabled.12"),this.fileExtensionMap.set("odt","application/vnd.oasis.opendocument.text"),this.fileExtensionMap.set("ott","application/vnd.oasis.opendocument.text-template"),this.fileExtensionMap.set("oth","application/vnd.oasis.opendocument.text-web"),this.fileExtensionMap.set("odm","application/vnd.oasis.opendocument.text-master"),this.fileExtensionMap.set("odg","application/vnd.oasis.opendocument.graphics"),this.fileExtensionMap.set("otg","application/vnd.oasis.opendocument.graphics-template"),this.fileExtensionMap.set("odp","application/vnd.oasis.opendocument.presentation"),this.fileExtensionMap.set("otp","application/vnd.oasis.opendocument.presentation-template"),this.fileExtensionMap.set("ods","application/vnd.oasis.opendocument.spreadsheet"),this.fileExtensionMap.set("ots","application/vnd.oasis.opendocument.spreadsheet-template"),this.fileExtensionMap.set("odc","application/vnd.oasis.opendocument.chart"),this.fileExtensionMap.set("odf","application/vnd.oasis.opendocument.formula"),this.fileExtensionMap.set("odb","application/vnd.oasis.opendocument.database"),this.fileExtensionMap.set("odi","application/vnd.oasis.opendocument.image"),this.fileExtensionMap.set("oxt","application/vnd.openofficeorg.extension"),this.fileExtensionMap.set("txt","text/plain"),this.csvContentType.add("text/comma-separated-values"),this.csvContentType.add("text/csv"),this.csvContentType.add("application/csv")}getContentTypeForExtension(et){if(this.fileExtensionMap.has(et))return this.fileExtensionMap.get(et)}getExtensionForContentType(et){for(const tt of Array.from(this.fileExtensionMap.keys()))if((this.fileExtensionMap.get(tt)||"").toLowerCase()==(et||"").toLowerCase())return tt;return null}isWordLike(et,tt){const rt=this.getExtensionForContentType(et);return rt?this.wordExtensions.has(rt):et==this.OCTET_STREAM&&tt?this.wordExtensions.has(tt):!1}isExcelLike(et,tt){const rt=this.getExtensionForContentType(et);return rt?this.excelExtensions.has(rt):et==this.OCTET_STREAM&&tt?this.excelExtensions.has(tt):!1}isCsvLike(et,tt){return this.csvContentType.has(et)?!0:et==this.OCTET_STREAM&&tt?this.csvExtensions.has(tt):!1}isPowerpointLike(et,tt){const rt=this.getExtensionForContentType(et);return rt?this.pptExtensions.has(rt):et==this.OCTET_STREAM&&tt?this.pptExtensions.has(tt):!1}isTxtLike(et,tt){const rt=this.getExtensionForContentType(et);return rt?this.txtExtensions.has(rt):et==this.OCTET_STREAM&&tt?this.txtExtensions.has(tt):!1}};let MimeTypeUtils=S$1;m$2(MimeTypeUtils,"INSTANCE",new S$1);class FileTypeUtils{static registerContentTypeToFileType(et){this.fileTypes.push(et)}static getFileType(et,tt=!1,rt){if(rt&&(rt=rt.trim()),!et)return"unknown";this.fileTypes||console.warn("[Element.role] should not have emptyRoles",this);for(let st of this.fileTypes||[]){const ot=st(et,tt);if(ot)return ot}const nt={csv:function(st){return!!MimeTypeUtils.INSTANCE.isCsvLike(st,rt)},doc:function(st){return MimeTypeUtils.INSTANCE.isWordLike(st,rt)?!0:st.indexOf("document")!==-1&&st.indexOf("wordprocessing")!==-1},xls:function(st){return MimeTypeUtils.INSTANCE.isExcelLike(st,rt)?!0:st.indexOf("document")!==-1&&st.indexOf("spreadsheet")!==-1||st.indexOf("ms-excel")!==-1},img:function(st){return st.indexOf("image")!==-1},pdf:function(st){return st.indexOf("pdf")!==-1||st==="application/x-download"},ppt:function(st){return MimeTypeUtils.INSTANCE.isPowerpointLike(st,rt)?!0:st.indexOf("document")!==-1&&st.indexOf("presentation")!==-1||st.indexOf("powerpoint")!==-1},txt:function(st){return MimeTypeUtils.INSTANCE.isTxtLike(st,rt)},video:function(st){return st.indexOf("video")!==-1},audio:function(st){return st.indexOf("audio")!==-1},zip:function(st){return st.indexOf("zip")!==-1||st.indexOf("rar")!==-1||st.indexOf("tar")!==-1||st.indexOf("7z")!==-1}};for(let st in nt)if(nt[st](et))return st;return"unknown"}}m$2(FileTypeUtils,"fileTypes",[]);class WorkspaceService{constructor(et){this.context=et}get http(){return this.context.http()}async saveFile(et,tt){const rt=et.name||"",nt=rt.split("."),st=et.type||"application/octet-stream",ot=nt.length>1?nt[nt.length-1]:"",at={"content-type":st,filename:rt,size:et.size,extension:ot,role:FileTypeUtils.getFileType(st,!1,ot)},ut=rt.replace("."+at.extension,""),lt=at.extension?ut+"."+at.extension:ut,dt=new FormData;dt.append("file",et,lt);const ct=[];return((tt==null?void 0:tt.visibility)==="public"||(tt==null?void 0:tt.visibility)==="protected")&&ct.push(`${tt.visibility}=true`),tt!=null&&tt.application&&ct.push(`application=${tt.application}`),at.role==="img"&&ct.push("quality=1"),tt!=null&&tt.parentId&&ct.push(`parentId=${tt.parentId}`),await this.http.postFile(`/workspace/document?${ct.join("&")}`,dt)}}const bundle={},promises={},defaultDiacriticsRemovalMap=[{base:"A",letters:/[\u0041\u24B6\uFF21\u00C0\u00C1\u00C2\u1EA6\u1EA4\u1EAA\u1EA8\u00C3\u0100\u0102\u1EB0\u1EAE\u1EB4\u1EB2\u0226\u01E0\u00C4\u01DE\u1EA2\u00C5\u01FA\u01CD\u0200\u0202\u1EA0\u1EAC\u1EB6\u1E00\u0104\u023A\u2C6F]/g},{base:"AA",letters:/[\uA732]/g},{base:"AE",letters:/[\u00C6\u01FC\u01E2]/g},{base:"AO",letters:/[\uA734]/g},{base:"AU",letters:/[\uA736]/g},{base:"AV",letters:/[\uA738\uA73A]/g},{base:"AY",letters:/[\uA73C]/g},{base:"B",letters:/[\u0042\u24B7\uFF22\u1E02\u1E04\u1E06\u0243\u0182\u0181]/g},{base:"C",letters:/[\u0043\u24B8\uFF23\u0106\u0108\u010A\u010C\u00C7\u1E08\u0187\u023B\uA73E]/g},{base:"D",letters:/[\u0044\u24B9\uFF24\u1E0A\u010E\u1E0C\u1E10\u1E12\u1E0E\u0110\u018B\u018A\u0189\uA779]/g},{base:"DZ",letters:/[\u01F1\u01C4]/g},{base:"Dz",letters:/[\u01F2\u01C5]/g},{base:"E",letters:/[\u0045\u24BA\uFF25\u00C8\u00C9\u00CA\u1EC0\u1EBE\u1EC4\u1EC2\u1EBC\u0112\u1E14\u1E16\u0114\u0116\u00CB\u1EBA\u011A\u0204\u0206\u1EB8\u1EC6\u0228\u1E1C\u0118\u1E18\u1E1A\u0190\u018E]/g},{base:"F",letters:/[\u0046\u24BB\uFF26\u1E1E\u0191\uA77B]/g},{base:"G",letters:/[\u0047\u24BC\uFF27\u01F4\u011C\u1E20\u011E\u0120\u01E6\u0122\u01E4\u0193\uA7A0\uA77D\uA77E]/g},{base:"H",letters:/[\u0048\u24BD\uFF28\u0124\u1E22\u1E26\u021E\u1E24\u1E28\u1E2A\u0126\u2C67\u2C75\uA78D]/g},{base:"I",letters:/[\u0049\u24BE\uFF29\u00CC\u00CD\u00CE\u0128\u012A\u012C\u0130\u00CF\u1E2E\u1EC8\u01CF\u0208\u020A\u1ECA\u012E\u1E2C\u0197]/g},{base:"J",letters:/[\u004A\u24BF\uFF2A\u0134\u0248]/g},{base:"K",letters:/[\u004B\u24C0\uFF2B\u1E30\u01E8\u1E32\u0136\u1E34\u0198\u2C69\uA740\uA742\uA744\uA7A2]/g},{base:"L",letters:/[\u004C\u24C1\uFF2C\u013F\u0139\u013D\u1E36\u1E38\u013B\u1E3C\u1E3A\u0141\u023D\u2C62\u2C60\uA748\uA746\uA780]/g},{base:"LJ",letters:/[\u01C7]/g},{base:"Lj",letters:/[\u01C8]/g},{base:"M",letters:/[\u004D\u24C2\uFF2D\u1E3E\u1E40\u1E42\u2C6E\u019C]/g},{base:"N",letters:/[\u004E\u24C3\uFF2E\u01F8\u0143\u00D1\u1E44\u0147\u1E46\u0145\u1E4A\u1E48\u0220\u019D\uA790\uA7A4]/g},{base:"NJ",letters:/[\u01CA]/g},{base:"Nj",letters:/[\u01CB]/g},{base:"O",letters:/[\u004F\u24C4\uFF2F\u00D2\u00D3\u00D4\u1ED2\u1ED0\u1ED6\u1ED4\u00D5\u1E4C\u022C\u1E4E\u014C\u1E50\u1E52\u014E\u022E\u0230\u00D6\u022A\u1ECE\u0150\u01D1\u020C\u020E\u01A0\u1EDC\u1EDA\u1EE0\u1EDE\u1EE2\u1ECC\u1ED8\u01EA\u01EC\u00D8\u01FE\u0186\u019F\uA74A\uA74C]/g},{base:"OI",letters:/[\u01A2]/g},{base:"OO",letters:/[\uA74E]/g},{base:"OU",letters:/[\u0222]/g},{base:"P",letters:/[\u0050\u24C5\uFF30\u1E54\u1E56\u01A4\u2C63\uA750\uA752\uA754]/g},{base:"Q",letters:/[\u0051\u24C6\uFF31\uA756\uA758\u024A]/g},{base:"R",letters:/[\u0052\u24C7\uFF32\u0154\u1E58\u0158\u0210\u0212\u1E5A\u1E5C\u0156\u1E5E\u024C\u2C64\uA75A\uA7A6\uA782]/g},{base:"S",letters:/[\u0053\u24C8\uFF33\u1E9E\u015A\u1E64\u015C\u1E60\u0160\u1E66\u1E62\u1E68\u0218\u015E\u2C7E\uA7A8\uA784]/g},{base:"T",letters:/[\u0054\u24C9\uFF34\u1E6A\u0164\u1E6C\u021A\u0162\u1E70\u1E6E\u0166\u01AC\u01AE\u023E\uA786]/g},{base:"TZ",letters:/[\uA728]/g},{base:"U",letters:/[\u0055\u24CA\uFF35\u00D9\u00DA\u00DB\u0168\u1E78\u016A\u1E7A\u016C\u00DC\u01DB\u01D7\u01D5\u01D9\u1EE6\u016E\u0170\u01D3\u0214\u0216\u01AF\u1EEA\u1EE8\u1EEE\u1EEC\u1EF0\u1EE4\u1E72\u0172\u1E76\u1E74\u0244]/g},{base:"V",letters:/[\u0056\u24CB\uFF36\u1E7C\u1E7E\u01B2\uA75E\u0245]/g},{base:"VY",letters:/[\uA760]/g},{base:"W",letters:/[\u0057\u24CC\uFF37\u1E80\u1E82\u0174\u1E86\u1E84\u1E88\u2C72]/g},{base:"X",letters:/[\u0058\u24CD\uFF38\u1E8A\u1E8C]/g},{base:"Y",letters:/[\u0059\u24CE\uFF39\u1EF2\u00DD\u0176\u1EF8\u0232\u1E8E\u0178\u1EF6\u1EF4\u01B3\u024E\u1EFE]/g},{base:"Z",letters:/[\u005A\u24CF\uFF3A\u0179\u1E90\u017B\u017D\u1E92\u1E94\u01B5\u0224\u2C7F\u2C6B\uA762]/g},{base:"a",letters:/[\u0061\u24D0\uFF41\u1E9A\u00E0\u00E1\u00E2\u1EA7\u1EA5\u1EAB\u1EA9\u00E3\u0101\u0103\u1EB1\u1EAF\u1EB5\u1EB3\u0227\u01E1\u00E4\u01DF\u1EA3\u00E5\u01FB\u01CE\u0201\u0203\u1EA1\u1EAD\u1EB7\u1E01\u0105\u2C65\u0250]/g},{base:"aa",letters:/[\uA733]/g},{base:"ae",letters:/[\u00E6\u01FD\u01E3]/g},{base:"ao",letters:/[\uA735]/g},{base:"au",letters:/[\uA737]/g},{base:"av",letters:/[\uA739\uA73B]/g},{base:"ay",letters:/[\uA73D]/g},{base:"b",letters:/[\u0062\u24D1\uFF42\u1E03\u1E05\u1E07\u0180\u0183\u0253]/g},{base:"c",letters:/[\u0063\u24D2\uFF43\u0107\u0109\u010B\u010D\u00E7\u1E09\u0188\u023C\uA73F\u2184]/g},{base:"d",letters:/[\u0064\u24D3\uFF44\u1E0B\u010F\u1E0D\u1E11\u1E13\u1E0F\u0111\u018C\u0256\u0257\uA77A]/g},{base:"dz",letters:/[\u01F3\u01C6]/g},{base:"e",letters:/[\u0065\u24D4\uFF45\u00E8\u00E9\u00EA\u1EC1\u1EBF\u1EC5\u1EC3\u1EBD\u0113\u1E15\u1E17\u0115\u0117\u00EB\u1EBB\u011B\u0205\u0207\u1EB9\u1EC7\u0229\u1E1D\u0119\u1E19\u1E1B\u0247\u025B\u01DD]/g},{base:"f",letters:/[\u0066\u24D5\uFF46\u1E1F\u0192\uA77C]/g},{base:"g",letters:/[\u0067\u24D6\uFF47\u01F5\u011D\u1E21\u011F\u0121\u01E7\u0123\u01E5\u0260\uA7A1\u1D79\uA77F]/g},{base:"h",letters:/[\u0068\u24D7\uFF48\u0125\u1E23\u1E27\u021F\u1E25\u1E29\u1E2B\u1E96\u0127\u2C68\u2C76\u0265]/g},{base:"hv",letters:/[\u0195]/g},{base:"i",letters:/[\u0069\u24D8\uFF49\u00EC\u00ED\u00EE\u0129\u012B\u012D\u00EF\u1E2F\u1EC9\u01D0\u0209\u020B\u1ECB\u012F\u1E2D\u0268\u0131]/g},{base:"j",letters:/[\u006A\u24D9\uFF4A\u0135\u01F0\u0249]/g},{base:"k",letters:/[\u006B\u24DA\uFF4B\u1E31\u01E9\u1E33\u0137\u1E35\u0199\u2C6A\uA741\uA743\uA745\uA7A3]/g},{base:"l",letters:/[\u006C\u24DB\uFF4C\u0140\u013A\u013E\u1E37\u1E39\u013C\u1E3D\u1E3B\u017F\u0142\u019A\u026B\u2C61\uA749\uA781\uA747]/g},{base:"lj",letters:/[\u01C9]/g},{base:"m",letters:/[\u006D\u24DC\uFF4D\u1E3F\u1E41\u1E43\u0271\u026F]/g},{base:"n",letters:/[\u006E\u24DD\uFF4E\u01F9\u0144\u00F1\u1E45\u0148\u1E47\u0146\u1E4B\u1E49\u019E\u0272\u0149\uA791\uA7A5]/g},{base:"nj",letters:/[\u01CC]/g},{base:"o",letters:/[\u006F\u24DE\uFF4F\u00F2\u00F3\u00F4\u1ED3\u1ED1\u1ED7\u1ED5\u00F5\u1E4D\u022D\u1E4F\u014D\u1E51\u1E53\u014F\u022F\u0231\u00F6\u022B\u1ECF\u0151\u01D2\u020D\u020F\u01A1\u1EDD\u1EDB\u1EE1\u1EDF\u1EE3\u1ECD\u1ED9\u01EB\u01ED\u00F8\u01FF\u0254\uA74B\uA74D\u0275]/g},{base:"oi",letters:/[\u01A3]/g},{base:"ou",letters:/[\u0223]/g},{base:"oo",letters:/[\uA74F]/g},{base:"p",letters:/[\u0070\u24DF\uFF50\u1E55\u1E57\u01A5\u1D7D\uA751\uA753\uA755]/g},{base:"q",letters:/[\u0071\u24E0\uFF51\u024B\uA757\uA759]/g},{base:"r",letters:/[\u0072\u24E1\uFF52\u0155\u1E59\u0159\u0211\u0213\u1E5B\u1E5D\u0157\u1E5F\u024D\u027D\uA75B\uA7A7\uA783]/g},{base:"s",letters:/[\u0073\u24E2\uFF53\u00DF\u015B\u1E65\u015D\u1E61\u0161\u1E67\u1E63\u1E69\u0219\u015F\u023F\uA7A9\uA785\u1E9B]/g},{base:"t",letters:/[\u0074\u24E3\uFF54\u1E6B\u1E97\u0165\u1E6D\u021B\u0163\u1E71\u1E6F\u0167\u01AD\u0288\u2C66\uA787]/g},{base:"tz",letters:/[\uA729]/g},{base:"u",letters:/[\u0075\u24E4\uFF55\u00F9\u00FA\u00FB\u0169\u1E79\u016B\u1E7B\u016D\u00FC\u01DC\u01D8\u01D6\u01DA\u1EE7\u016F\u0171\u01D4\u0215\u0217\u01B0\u1EEB\u1EE9\u1EEF\u1EED\u1EF1\u1EE5\u1E73\u0173\u1E77\u1E75\u0289]/g},{base:"v",letters:/[\u0076\u24E5\uFF56\u1E7D\u1E7F\u028B\uA75F\u028C]/g},{base:"vy",letters:/[\uA761]/g},{base:"w",letters:/[\u0077\u24E6\uFF57\u1E81\u1E83\u0175\u1E87\u1E85\u1E98\u1E89\u2C73]/g},{base:"x",letters:/[\u0078\u24E7\uFF58\u1E8B\u1E8D]/g},{base:"y",letters:/[\u0079\u24E8\uFF59\u1EF3\u00FD\u0177\u1EF9\u0233\u1E8F\u00FF\u1EF7\u1E99\u1EF5\u01B4\u024F\u1EFF]/g},{base:"z",letters:/[\u007A\u24E9\uFF5A\u017A\u1E91\u017C\u017E\u1E93\u1E95\u01B6\u0225\u0240\u2C6C\uA763]/g}];class IdiomService{constructor(et){this.context=et}get http(){return this.context.http()}async getIdiom(et,tt){await Promise.all([this.addBundlePromise(et,"/i18n"),this.addBundlePromise(et,`/${tt}/i18n`)])}translate(et,tt){et=et??"";let rt=bundle[et]===void 0?et:bundle[et];if(tt&&typeof tt=="object")for(let nt in tt)typeof tt[nt]<"u"&&(rt=rt.replace(new RegExp("\\${"+nt+"}","g"),""+tt[nt]));return rt}addBundlePromise(et,tt){return this.loadBundlePromise(et,tt)}addBundle(et,tt,rt){this.loadBundle(et,tt,rt)}loadBundlePromise(et,tt){return this.loadBundle(et,tt),promises[tt]}loadBundle(et,tt,rt){const nt=promises[tt];if(nt)rt&&nt.then(rt).catch(rt);else{const st=new Promisified;promises[tt]=st.promise;const ot={};et&&(ot["Accept-Language"]=et),this.http.get(tt,{headers:ot}).then(at=>{Object.assign(bundle,at),typeof rt=="function"&&rt(),st.resolve()}).catch(at=>{typeof rt=="function"&&rt(),st.reject()})}}addTranslations(et,tt){notify.onLangReady().promise.then(rt=>{this.loadBundle(rt,et+"/"+rt+".json",tt)})}addAllTranslations(et){return et&&et.length>0?notify.onLangReady().promise.then(tt=>Promise.all(et.map(rt=>this.loadBundlePromise(tt,rt+"/"+tt+".json")))).then(()=>{}):Promise.reject()}addKeys(et){for(var tt in et)typeof bundle[tt]!="string"&&(bundle[tt]=et[tt])}removeAccents(et){for(var tt=0;tt<defaultDiacriticsRemovalMap.length;tt++)et=et.replace(defaultDiacriticsRemovalMap[tt].letters,defaultDiacriticsRemovalMap[tt].base);return et}}let ATTag;class AnalyticsService{constructor(_e){this.context=_e}get http(){return this.context.http()}get session(){return this.context.session()}async trackPageLoad(_e,et){const[tt]=await Promise.all([this.getXitiConfig(et.name.toLowerCase()),this.loadXitiScript()]);if(!tt||!ATInternet)return;let rt=tt.LIBELLE_SERVICE.default||null;for(let nt in tt.LIBELLE_SERVICE)if(nt!=="default"&&_e.indexOf(nt)>=0){rt=tt.LIBELLE_SERVICE[nt];break}ATTag=new ATInternet.Tracker.Tag({site:tt.STRUCT_ID}),ATTag.setProps({SERVICE:rt,TYPE:tt.TYPE,OUTIL:tt.OUTIL,UAI:tt.STRUCT_UAI,PROJET:tt.PROJET,EXPLOITANT:tt.EXPLOITANT,PLATEFORME:tt.PLATFORME,PROFIL:tt.PROFILE},!0),ATTag.identifiedVisitor.set({id:tt.ID_PERSO,category:tt.PROFILE}),ATTag.page.set({name:(et==null?void 0:et.prefix)==="userbook"?"directory":et==null?void 0:et.prefix,chapter1:"",chapter2:"",chapter3:"",level2:tt.STRUCT_UAI}),ATTag.dispatch()}async getXitiConfig(_e){const[et,tt]=await Promise.all([this.http.get("/analyticsConf"),this.http.get("/xiti/config")]);if(!(et!=null&&et.type))throw ERROR_CODE.MALFORMED_DATA;return tt!=null&&tt.active&&(et.xiti=await this.getXitiTrackingParams(tt,_e)),et.xiti}async loadXitiScript(){if(typeof ATInternet>"u"){const scriptPath="/xiti/public/js/lib/smarttag_ENT.js",response=await this.http.get(scriptPath,{headers:{Accept:"application/javascript"}});if(this.http.latestResponse.status!=200)throw"Error while loading XiTi script";eval(response)}}async getXitiTrackingParams(_e,et){var tt;if(!_e.structureMap||!et)return;const rt=await this.session.getUser(),nt=await this.session.getUserProfile();let st;if(!(rt!=null&&rt.structures))return;for(let dt of rt.structures){const ct=_e.structureMap[dt];if(ct&&ct.collectiviteId&&ct.UAI){st=ct;break}}if(!st||!st.active)return;const ot=await configure.Platform.apps.getPublicConf(et);if(!ot)return;const at=ot.xiti;if(!at||!at.LIBELLE_SERVICE||!st.UAI)return;function ut(dt){let ct="";for(let ft=0;ft<dt.length;ft++)ct+=dt.charCodeAt(ft);return ct}const lt={Student:"ELEVE",Teacher:"ENSEIGNANT",Relative:"PARENT",Personnel:"ADMIN_VIE_SCOL_TECH",Guest:"AUTRE"};return{LIBELLE_SERVICE:at.LIBELLE_SERVICE,TYPE:at.OUTIL?"TIERS":"NATIF",OUTIL:at.OUTIL?at.OUTIL:"",STRUCT_ID:st.collectiviteId,STRUCT_UAI:st.UAI,PROJET:st.projetId?st.projetId:_e.ID_PROJET,EXPLOITANT:_e.ID_EXPLOITANT,PLATFORME:st.plateformeId?st.plateformeId:_e.ID_PLATEFORME,ID_PERSO:ut(rt.userId),PROFILE:nt&&nt.length>0&&(tt=lt[nt[0]])!=null?tt:""}}}class OdeServices{constructor(){m$2(this,"_analytics"),m$2(this,"_cache"),m$2(this,"_conf"),m$2(this,"_directory"),m$2(this,"_http"),m$2(this,"_idiom"),m$2(this,"_rights"),m$2(this,"_session"),m$2(this,"_share"),m$2(this,"_workspace"),this._analytics=new AnalyticsService(this),this._cache=new CacheService(this),this._conf=new ConfService(this),this._directory=new DirectoryService(this),this._http=new HttpService(this),this._idiom=new IdiomService(this),this._rights=new RightService(this),this._session=new SessionService(this),this._share=new ShareService(this),this._workspace=new WorkspaceService(this)}analytics(){return this._analytics}cache(){return this._cache}conf(){return this._conf}directory(){return this._directory}http(){return this._http}idiom(){return this._idiom}resource(et,tt){return tt?ResourceService.findService({application:et,resourceType:tt},this):ResourceService.findMainService({application:et},this)}rights(){return this._rights}session(){return this._session}share(){return this._share}workspace(){return this._workspace}}const odeServices=new OdeServices;function useSession(){return useQuery({queryKey:["session"],queryFn:async()=>await odeServices.session().getSession(),suspense:!0})}function useConf({appCode:_e}){return useQuery({queryKey:["conf"],queryFn:async()=>await odeServices.conf().getConf(_e),suspense:!0})}const OdeClientContext=reactExports.createContext(null);function OdeClientProvider({children:_e,params:et}){const tt=et.app,rt=useSession(),nt=useConf({appCode:tt}),st=(nt==null?void 0:nt.isSuccess)&&(rt==null?void 0:rt.isSuccess);reactExports.useEffect(()=>{var lt,dt,ct,ft,ht,mt,vt,wt,gt,yt;const at=document.getElementById("theme"),ut=document.getElementById("favicon");at.href=`${(dt=(lt=nt==null?void 0:nt.data)==null?void 0:lt.theme)==null?void 0:dt.bootstrapUrl}/theme.css`,ut.href=`${(ft=(ct=nt==null?void 0:nt.data)==null?void 0:ct.theme)==null?void 0:ft.basePath}/img/illustrations/favicon.ico`,[{data:"data-skin",value:(mt=(ht=nt==null?void 0:nt.data)==null?void 0:ht.theme)==null?void 0:mt.skinName},{data:"data-theme",value:(wt=(vt=nt==null?void 0:nt.data)==null?void 0:vt.theme)==null?void 0:wt.themeName},{data:"data-bootstrap",value:(yt=(gt=nt==null?void 0:nt.data)==null?void 0:gt.theme)==null?void 0:yt.bootstrapVersion.split("-").at(-1)}].forEach(xt=>{var St;return(St=document.querySelector("html"))==null?void 0:St.setAttribute(xt.data,xt.value)})},[nt==null?void 0:nt.data]),reactExports.useEffect(()=>{var at,ut;(ut=document.querySelector("html"))==null||ut.setAttribute("lang",((at=rt==null?void 0:rt.data)==null?void 0:at.currentLanguage)||"fr")},[rt==null?void 0:rt.data]);const ot=reactExports.useMemo(()=>{var at,ut,lt,dt,ct,ft,ht;return{appCode:tt,applications:(at=nt==null?void 0:nt.data)==null?void 0:at.applications,confQuery:nt,currentApp:(ut=nt==null?void 0:nt.data)==null?void 0:ut.currentApp,currentLanguage:(lt=rt==null?void 0:rt.data)==null?void 0:lt.currentLanguage,init:st,sessionQuery:rt,theme:(dt=nt==null?void 0:nt.data)==null?void 0:dt.theme,user:(ct=rt==null?void 0:rt.data)==null?void 0:ct.user,userDescription:(ft=rt==null?void 0:rt.data)==null?void 0:ft.userDescription,userProfile:(ht=rt==null?void 0:rt.data)==null?void 0:ht.userProfile}},[tt,nt,st,rt]);return jsxRuntimeExports.jsx(OdeClientContext.Provider,{value:ot,children:_e})}function useOdeClient(){const _e=reactExports.useContext(OdeClientContext);if(!_e)throw new Error("Cannot be used outside of OdeClientProvider");return _e}function useBookmark(){var tt;const{sessionQuery:_e}=useOdeClient(),et=new Set;return(tt=_e==null?void 0:_e.data)==null?void 0:tt.bookmarkedApps.filter(rt=>{const nt=et.has(rt.displayName);return et.add(rt.displayName),!nt})}function useTheme(){const{theme:_e}=useOdeClient();return{theme:_e}}function useUser(){const{user:_e,userDescription:et,userProfile:tt}=useOdeClient(),{theme:rt}=useTheme();function nt(){let st=et==null?void 0:et.picture;return(!st||st==="no-avatar.jpg"||st==="no-avatar.svg")&&(st=`${rt==null?void 0:rt.basePath}/img/illustrations/no-avatar.svg`),st}return{user:{..._e,type:tt},avatar:nt(),userDescription:et}}function useHasWorkflow(){const{user:_e}=useUser();return{workflows:{conversation:{view:odeServices.session().hasWorkflow({workflowName:"org.entcore.conversation.controllers.ConversationController|view",user:_e})},community:{view:odeServices.session().hasWorkflow({workflowName:"net.atos.entng.community.controllers.CommunityController|view",user:_e})},search:{view:odeServices.session().hasWorkflow({workflowName:"fr.openent.searchengine.controllers.SearchEngineController|view",user:_e})},zimbra:{view:odeServices.session().hasWorkflow({workflowName:"fr.openent.zimbra.controllers.ZimbraController|view",user:_e}),preauth:odeServices.session().hasWorkflow({workflowName:"fr.openent.zimbra.controllers.ZimbraController|preauth",user:_e})}}}}const DEFAULT_EVENTS=["mousedown","touchstart"];function useClickOutside(_e,et,tt){const rt=reactExports.useRef();return reactExports.useEffect(()=>{const nt=st=>{const{target:ot}=st??{};if(Array.isArray(tt)){const at=(ot==null?void 0:ot.hasAttribute("data-ignore-outside-clicks"))||!document.body.contains(ot)&&ot.tagName!=="HTML";tt.every(ut=>!!ut&&!st.composedPath().includes(ut))&&!at&&_e()}else rt.current&&!rt.current.contains(ot)&&_e()};return(et||DEFAULT_EVENTS).forEach(st=>{document.addEventListener(st,nt)}),()=>{(et||DEFAULT_EVENTS).forEach(st=>{document.removeEventListener(st,nt)})}},[rt,_e,tt,et]),rt}let e={data:""},t$1=_e=>typeof window=="object"?((_e?_e.querySelector("#_goober"):window._goober)||Object.assign((_e||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:_e||e,l=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,a=/\/\*[^]*?\*\/| +/g,n$2=/\n+/g,o=(_e,et)=>{let tt="",rt="",nt="";for(let st in _e){let ot=_e[st];st[0]=="@"?st[1]=="i"?tt=st+" "+ot+";":rt+=st[1]=="f"?o(ot,st):st+"{"+o(ot,st[1]=="k"?"":et)+"}":typeof ot=="object"?rt+=o(ot,et?et.replace(/([^,])+/g,at=>st.replace(/(^:.*)|([^,])+/g,ut=>/&/.test(ut)?ut.replace(/&/g,at):at?at+" "+ut:ut)):st):ot!=null&&(st=/^--/.test(st)?st:st.replace(/[A-Z]/g,"-$&").toLowerCase(),nt+=o.p?o.p(st,ot):st+":"+ot+";")}return tt+(et&&nt?et+"{"+nt+"}":nt)+rt},c$1={},s=_e=>{if(typeof _e=="object"){let et="";for(let tt in _e)et+=tt+s(_e[tt]);return et}return _e},i$1=(_e,et,tt,rt,nt)=>{let st=s(_e),ot=c$1[st]||(c$1[st]=(ut=>{let lt=0,dt=11;for(;lt<ut.length;)dt=101*dt+ut.charCodeAt(lt++)>>>0;return"go"+dt})(st));if(!c$1[ot]){let ut=st!==_e?_e:(lt=>{let dt,ct,ft=[{}];for(;dt=l.exec(lt.replace(a,""));)dt[4]?ft.shift():dt[3]?(ct=dt[3].replace(n$2," ").trim(),ft.unshift(ft[0][ct]=ft[0][ct]||{})):ft[0][dt[1]]=dt[2].replace(n$2," ").trim();return ft[0]})(_e);c$1[ot]=o(nt?{["@keyframes "+ot]:ut}:ut,tt?"":"."+ot)}let at=tt&&c$1.g?c$1.g:null;return tt&&(c$1.g=c$1[ot]),((ut,lt,dt,ct)=>{ct?lt.data=lt.data.replace(ct,ut):lt.data.indexOf(ut)===-1&&(lt.data=dt?ut+lt.data:lt.data+ut)})(c$1[ot],et,rt,at),ot},p$1=(_e,et,tt)=>_e.reduce((rt,nt,st)=>{let ot=et[st];if(ot&&ot.call){let at=ot(tt),ut=at&&at.props&&at.props.className||/^go/.test(at)&&at;ot=ut?"."+ut:at&&typeof at=="object"?at.props?"":o(at,""):at===!1?"":at}return rt+nt+(ot??"")},"");function u$2(_e){let et=this||{},tt=_e.call?_e(et.p):_e;return i$1(tt.unshift?tt.raw?p$1(tt,[].slice.call(arguments,1),et.p):tt.reduce((rt,nt)=>Object.assign(rt,nt&&nt.call?nt(et.p):nt),{}):tt,t$1(et.target),et.g,et.o,et.k)}let d,f,g$1;u$2.bind({g:1});let h$3=u$2.bind({k:1});function m$1(_e,et,tt,rt){o.p=et,d=_e,f=tt,g$1=rt}function j(_e,et){let tt=this||{};return function(){let rt=arguments;function nt(st,ot){let at=Object.assign({},st),ut=at.className||nt.className;tt.p=Object.assign({theme:f&&f()},at),tt.o=/ *go\d+/.test(ut),at.className=u$2.apply(tt,rt)+(ut?" "+ut:""),et&&(at.ref=ot);let lt=_e;return _e[0]&&(lt=at.as||_e,delete at.as),g$1&<[0]&&g$1(at),d(lt,at)}return et?et(nt):nt}}var W=_e=>typeof _e=="function",T=(_e,et)=>W(_e)?_e(et):_e,U=(()=>{let _e=0;return()=>(++_e).toString()})(),b=(()=>{let _e;return()=>{if(_e===void 0&&typeof window<"u"){let et=matchMedia("(prefers-reduced-motion: reduce)");_e=!et||et.matches}return _e}})(),Q=20,S=new Map,X=1e3,$$1=_e=>{if(S.has(_e))return;let et=setTimeout(()=>{S.delete(_e),u$1({type:4,toastId:_e})},X);S.set(_e,et)},J=_e=>{let et=S.get(_e);et&&clearTimeout(et)},v$2=(_e,et)=>{switch(et.type){case 0:return{..._e,toasts:[et.toast,..._e.toasts].slice(0,Q)};case 1:return et.toast.id&&J(et.toast.id),{..._e,toasts:_e.toasts.map(st=>st.id===et.toast.id?{...st,...et.toast}:st)};case 2:let{toast:tt}=et;return _e.toasts.find(st=>st.id===tt.id)?v$2(_e,{type:1,toast:tt}):v$2(_e,{type:0,toast:tt});case 3:let{toastId:rt}=et;return rt?$$1(rt):_e.toasts.forEach(st=>{$$1(st.id)}),{..._e,toasts:_e.toasts.map(st=>st.id===rt||rt===void 0?{...st,visible:!1}:st)};case 4:return et.toastId===void 0?{..._e,toasts:[]}:{..._e,toasts:_e.toasts.filter(st=>st.id!==et.toastId)};case 5:return{..._e,pausedAt:et.time};case 6:let nt=et.time-(_e.pausedAt||0);return{..._e,pausedAt:void 0,toasts:_e.toasts.map(st=>({...st,pauseDuration:st.pauseDuration+nt}))}}},A=[],P={toasts:[],pausedAt:void 0},u$1=_e=>{P=v$2(P,_e),A.forEach(et=>{et(P)})},Y={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},I$1=(_e={})=>{let[et,tt]=reactExports.useState(P);reactExports.useEffect(()=>(A.push(tt),()=>{let nt=A.indexOf(tt);nt>-1&&A.splice(nt,1)}),[et]);let rt=et.toasts.map(nt=>{var st,ot;return{..._e,..._e[nt.type],...nt,duration:nt.duration||((st=_e[nt.type])==null?void 0:st.duration)||(_e==null?void 0:_e.duration)||Y[nt.type],style:{..._e.style,...(ot=_e[nt.type])==null?void 0:ot.style,...nt.style}}});return{...et,toasts:rt}},G$1=(_e,et="blank",tt)=>({createdAt:Date.now(),visible:!0,type:et,ariaProps:{role:"status","aria-live":"polite"},message:_e,pauseDuration:0,...tt,id:(tt==null?void 0:tt.id)||U()}),h$2=_e=>(et,tt)=>{let rt=G$1(et,_e,tt);return u$1({type:2,toast:rt}),rt.id},n$1=(_e,et)=>h$2("blank")(_e,et);n$1.error=h$2("error");n$1.success=h$2("success");n$1.loading=h$2("loading");n$1.custom=h$2("custom");n$1.dismiss=_e=>{u$1({type:3,toastId:_e})};n$1.remove=_e=>u$1({type:4,toastId:_e});n$1.promise=(_e,et,tt)=>{let rt=n$1.loading(et.loading,{...tt,...tt==null?void 0:tt.loading});return _e.then(nt=>(n$1.success(T(et.success,nt),{id:rt,...tt,...tt==null?void 0:tt.success}),nt)).catch(nt=>{n$1.error(T(et.error,nt),{id:rt,...tt,...tt==null?void 0:tt.error})}),_e};var Z=(_e,et)=>{u$1({type:1,toast:{id:_e,height:et}})},ee=()=>{u$1({type:5,time:Date.now()})},D=_e=>{let{toasts:et,pausedAt:tt}=I$1(_e);reactExports.useEffect(()=>{if(tt)return;let st=Date.now(),ot=et.map(at=>{if(at.duration===1/0)return;let ut=(at.duration||0)+at.pauseDuration-(st-at.createdAt);if(ut<0){at.visible&&n$1.dismiss(at.id);return}return setTimeout(()=>n$1.dismiss(at.id),ut)});return()=>{ot.forEach(at=>at&&clearTimeout(at))}},[et,tt]);let rt=reactExports.useCallback(()=>{tt&&u$1({type:6,time:Date.now()})},[tt]),nt=reactExports.useCallback((st,ot)=>{let{reverseOrder:at=!1,gutter:ut=8,defaultPosition:lt}=ot||{},dt=et.filter(ht=>(ht.position||lt)===(st.position||lt)&&ht.height),ct=dt.findIndex(ht=>ht.id===st.id),ft=dt.filter((ht,mt)=>mt<ct&&ht.visible).length;return dt.filter(ht=>ht.visible).slice(...at?[ft+1]:[0,ft]).reduce((ht,mt)=>ht+(mt.height||0)+ut,0)},[et]);return{toasts:et,handlers:{updateHeight:Z,startPause:ee,endPause:rt,calculateOffset:nt}}},oe=h$3`
|
|
65
65
|
from {
|
|
66
66
|
transform: scale(0) rotate(45deg);
|
|
67
67
|
opacity: 0;
|
package/dist/version.txt
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
ode-explorer=1.0-feat-explorer-SNAPSHOT
|
|
1
|
+
ode-explorer=1.0-feat-explorer-SNAPSHOT 31/07/2023 11:13:17
|
package/package.json
CHANGED