From 991d6dbfd9fd9184b31c88704b191c801043c4dc Mon Sep 17 00:00:00 2001 From: Aiosa <469130@mail.muni.cz> Date: Sun, 5 Jan 2025 17:49:35 +0100 Subject: [PATCH 1/6] feat: winter school features + bugfixes: 1 --- CHANGELOG.md | 7 +- modules/annotations/annotations.js | 90 +++++----- modules/annotations/presets.js | 27 ++- modules/empaia-wsi-tile-source/tile-source.js | 6 +- modules/empation-api/empationapi.js | 4 +- plugins/annotations/annotationsGUI.js | 57 ++++-- plugins/annotations/include.json | 2 - plugins/empaia/empaia.js | 168 +++++++++++++----- server/php/init.php | 5 +- src/app.js | 10 +- src/external/scalebar.js | 20 ++- src/loader.js | 7 + src/parse-input.js | 19 +- 13 files changed, 289 insertions(+), 133 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0335ac12..cba157af 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,12 @@ The changelog file describes changes made since v2.0.0, which made significant c to the versions 1.x.x. ### Unreleased 2.1.1 -**Features:** standalone wsi tile source module. +**Features:** standalone wsi tile source module. Edge navigation optional. + +**Bugfixes:** OIDC module popup method - await login. +Use session storage to store xOpat sessions as well. +Fixed scalebar magnification estimates. Annotations IO bugfixes. +Extend await event support. ### 2.1.0 **Features:** new system for module/plugin building, improvements of annotation listing features, diff --git a/modules/annotations/annotations.js b/modules/annotations/annotations.js index 704ab0b7..268e9846 100644 --- a/modules/annotations/annotations.js +++ b/modules/annotations/annotations.js @@ -703,6 +703,13 @@ window.OSDAnnotations = class extends XOpatModuleSingleton { object.zooming(this.canvas.computeGraphicZoom(zoom), zoom); } + setCloseEdgeMouseNavigation(enable) { + window.removeEventListener("mousemove", this._edgesMouseNavigation); + if (enable) { + window.addEventListener("mousemove", this._edgesMouseNavigation); + } + } + /************************ Layers *******************************/ /** @@ -1047,6 +1054,19 @@ window.OSDAnnotations = class extends XOpatModuleSingleton { return o.hasOwnProperty("incrementId") && o.hasOwnProperty("sessionID"); } + /** + * Find annotations by a predicate + * @param callback + * @return {*} + */ + find(callback) { + return this.canvas._objects.find(callback); + } + + filter(callback) { + return this.canvas._objects.filter(callback); + } + /** * Delete object without knowledge of its identity (fully-fledged annotation or helper one) * @param {fabric.Object} o @@ -1540,49 +1560,9 @@ window.OSDAnnotations = class extends XOpatModuleSingleton { _this.mode.handleMouseMove(o.e, screenToPixelCoords(o.e.x, o.e.y)); } else { _this.mode.handleMouseHover(o.e, screenToPixelCoords(o.e.x, o.e.y)); - } }); - // Cached event that keeps moving the viewport is not useful since it keeps moving when user exist the window - // let _lastCalled = 0; - // let _cachedEvent = null; - const mouseNavigation = e => { - // const now = Date.now(); - if (this.mode !== this.Modes.AUTO /*|| now - _lastCalled > 30*/) { - //_cachedEvent = e || _cachedEvent; // keep reference to the most recent event - - const edgeThreshold = 20; - // const mouseX = _cachedEvent.clientX; - // const mouseY = _cachedEvent.clientY; - const mouseX = e.clientX; - const mouseY = e.clientY; - - const nearLeftEdge = mouseX >= 0 && edgeThreshold - mouseX; - const nearTopEdge = mouseY >= 0 && edgeThreshold / 2 - mouseY; //top edge near - const nearRightEdge = mouseX - window.innerWidth + edgeThreshold; - const nearBottomEdge = mouseY - window.innerHeight + edgeThreshold; - - if ( - (nearTopEdge < edgeThreshold && nearTopEdge > 0) || - (nearRightEdge < edgeThreshold && nearRightEdge > 0) || - (nearBottomEdge < edgeThreshold && nearBottomEdge > 0) || - (nearLeftEdge < edgeThreshold && nearLeftEdge > 0) - ) { - const center = VIEWER.viewport.getCenter(true); - //const current = VIEWER.viewport.windowToViewportCoordinates(new OpenSeadragon.Point(_cachedEvent.x, _cachedEvent.y)); - const current = VIEWER.viewport.windowToViewportCoordinates(new OpenSeadragon.Point(e.x, e.y)); - let direction = current.minus(center); - direction = direction.divide(Math.sqrt(Math.pow(direction.x, 2) + Math.pow(direction.y, 2))); - VIEWER.viewport.panTo(direction.times(0.004 / VIEWER.scalebar.imagePixelSizeOnScreen()).plus(center)); - //_lastCalled = now; - //setTimeout(mouseNavigation, 35); - } - } - }; - - window.addEventListener("mousemove", mouseNavigation); - this.canvas.on('mouse:wheel', function (o) { if (_this.disabledInteraction) return; @@ -1618,6 +1598,9 @@ window.OSDAnnotations = class extends XOpatModuleSingleton { // Wheel while viewer runs not enabled because this already performs zoom. // VIEWER.addHandler("canvas-scroll", function (e) { ... }); + + // Rewrite with bind this arg to use in events + this._edgesMouseNavigation = this._edgesMouseNavigation.bind(this); } static _registerAnnotationFactory(FactoryClass, atRuntime) { @@ -1798,6 +1781,33 @@ window.OSDAnnotations = class extends XOpatModuleSingleton { }); //todo rethrow? rewrite as async call with try finally } + _edgesMouseNavigation(e) { + if (this.mode !== this.Modes.AUTO) { + + const edgeThreshold = 20; + const mouseX = e.clientX; + const mouseY = e.clientY; + + const nearLeftEdge = mouseX >= 0 && edgeThreshold - mouseX; + const nearTopEdge = mouseY >= 0 && edgeThreshold / 2 - mouseY; //top edge near + const nearRightEdge = mouseX - window.innerWidth + edgeThreshold; + const nearBottomEdge = mouseY - window.innerHeight + edgeThreshold; + + if ( + (nearTopEdge < edgeThreshold && nearTopEdge > 0) || + (nearRightEdge < edgeThreshold && nearRightEdge > 0) || + (nearBottomEdge < edgeThreshold && nearBottomEdge > 0) || + (nearLeftEdge < edgeThreshold && nearLeftEdge > 0) + ) { + const center = VIEWER.viewport.getCenter(true); + const current = VIEWER.viewport.windowToViewportCoordinates(new OpenSeadragon.Point(e.x, e.y)); + let direction = current.minus(center); + direction = direction.divide(Math.sqrt(Math.pow(direction.x, 2) + Math.pow(direction.y, 2))); + VIEWER.viewport.panTo(direction.times(0.004 / VIEWER.scalebar.imagePixelSizeOnScreen()).plus(center)); + } + } + }; + // Copied out of OpenSeadragon private code scope to allow manual scroll navigation _fireMouseWheelNavigation(event) { // Simulate a 'wheel' event diff --git a/modules/annotations/presets.js b/modules/annotations/presets.js index e2728a88..9b730607 100644 --- a/modules/annotations/presets.js +++ b/modules/annotations/presets.js @@ -203,7 +203,7 @@ OSDAnnotations.PresetManager = class { */ isUnusedPreset(p) { return !p._used && p.objectFactory == this._context.polygonFactory - && p.meta.category?.value === "" + && !p.meta.category?.value && Object.keys(p.meta).length === 1; } @@ -416,13 +416,12 @@ OSDAnnotations.PresetManager = class { async import(presets, clear=false) { const _this = this; - if (clear) { - for (let pid in this._presets) { - const preset = this._presets[pid]; - if (this.isUnusedPreset(preset)) { - this._context.raiseEvent('preset-delete', {preset}); - delete this._presets[pid]; - } + for (let pid in this._presets) { + const preset = this._presets[pid]; + // TODO: clear might remove presets that are attached to existing annotations! + if (clear || this.isUnusedPreset(preset)) { + this._context.raiseEvent('preset-delete', {preset}); + delete this._presets[pid]; } } @@ -530,12 +529,12 @@ OSDAnnotations.PresetManager = class { let f = h * 6 - i; let q = 1 - f; switch(i % 6){ - case 0: r = 1; g = f; b = 0; break; - case 1: r = q; g = 1; b = 0; break; - case 2: r = 0; g = 1; b = f; break; - case 3: r = 0; g = q; b = 1; break; - case 4: r = f; g = 0; b = 1; break; - case 5: r = 1; g = 0; b = q; break; + case 0: r = 1; g = f; b = 0; break; + case 1: r = q; g = 1; b = 0; break; + case 2: r = 0; g = 1; b = f; break; + case 3: r = 0; g = q; b = 1; break; + case 4: r = f; g = 0; b = 1; break; + case 5: r = 1; g = 0; b = q; break; } let c = "#" + ("00" + (~ ~(r * 255)).toString(16)).slice(-2) + ("00" + (~ ~(g * 255)).toString(16)).slice(-2) diff --git a/modules/empaia-wsi-tile-source/tile-source.js b/modules/empaia-wsi-tile-source/tile-source.js index a2c0073b..62872495 100644 --- a/modules/empaia-wsi-tile-source/tile-source.js +++ b/modules/empaia-wsi-tile-source/tile-source.js @@ -25,11 +25,11 @@ OpenSeadragon.EmpaiaStandaloneV3TileSource = class extends OpenSeadragon.TileSou */ supports( data, url ) { if (url && Array.isArray(data)) { - //multi-tile or single tile access - let match = url.match(/^(\/?[^\/].*\/v3\/files)\/info/i); + //multi-tile or single tile access, batch is old name on the api + let match = url.match(/^(\/?[^\/].*\/v3\/)(files|batch)\/info/i); if (match) { data = data || [{}]; - data[0].tilesUrl = match[1]; + data[0].tilesUrl = match[1] + "batch"; return true; } } else if (url && typeof data === "object") { diff --git a/modules/empation-api/empationapi.js b/modules/empation-api/empationapi.js index 7b031b3e..1a7049e5 100644 --- a/modules/empation-api/empationapi.js +++ b/modules/empation-api/empationapi.js @@ -1,2 +1,2 @@ -var EmpationAPI;(()=>{"use strict";var t={d:(e,i)=>{for(var n in i)t.o(i,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:i[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{AbstractAPI:()=>c,EventSource:()=>n,HTTPError:()=>o,Logger:()=>l,RawAPI:()=>a,RootAPI:()=>p,RootContext:()=>f,STATUS_CODES:()=>s,ScopeAPI:()=>y,ScopeContext:()=>v,V3:()=>i,getJwtTokenExpiresTimeout:()=>u,parseJwtToken:()=>d,sleep:()=>h});var i={};t.r(i),t.d(i,{Apps:()=>g,Cases:()=>C,Examinations:()=>$,RationAI:()=>rt,Root:()=>ct,Scope:()=>J,Slides:()=>z,Storage:()=>k});class n{constructor(){this.events={}}addOnceHandler(t,e,i,n,s){const r=this;n=n||1;let o=0;const a=function(i){return o++,o===n&&r.removeHandler(t,a),e(i)};this.addHandler(t,a,i,s)}addHandler(t,e,i=null,s=0){let r=this.events[t];if(r||(this.events[t]=r=[]),e&&n.isFunction(e)){let t=r.length,n={handler:e,userData:i||null,priority:s||0};for(r[t]=n;t>0&&r[t-1].priority{const r=e.length;!function o(a){if(a>=r||!e[a])return s("Resolved!"),null;i.eventSource=t,i.userData=e[a].userData;let c=e[a].handler(i);return c=c&&"promise"===n.type(c)?c:Promise.resolve(),c.then((()=>o(a+1)))}(0)}))}):null}raiseEvent(t,e){const i=this.getHandler(t);if(i)return i(this,e||{})}raiseEventAwaiting(t,e){const i=this.getAwaitingHandler(t);return i?i(this,e||{}):Promise.resolve("No handler for this event registered.")}static isFunction(t){return"function"===this.type(t)}static type(t){return null==t?String(t):this.class2type[t.toString()]||("function"==typeof t?"function":"object")}}n.class2type={"[object Boolean]":"boolean","[object Number]":"number","[object String]":"string","[object Function]":"function","[object AsyncFunction]":"function","[object Promise]":"promise","[object Array]":"array","[object Date]":"date","[object RegExp]":"regexp","[object Object]":"object"};const s={100:"Continue",101:"Switching protocols",102:"Processing",103:"Early Hints",200:"Ok",201:"Created",202:"Accepted",203:"Non Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi Status",300:"Multiple Choices",301:"Moved Permanently",302:"Moved Temporarily",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Request Too Long",414:"Request Uri Too Long",415:"Unsupported Media Type",416:"Requested Range Not Satisfiable",417:"Expectation Failed",418:"Im A Teapot",419:"Insufficient Space On Resource",420:"Method Failure",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"Http Version Not Supported",507:"Insufficient Storage",511:"Network Authentication Required"};var r=function(t,e,i,n){return new(i||(i=Promise))((function(s,r){function o(t){try{c(n.next(t))}catch(t){r(t)}}function a(t){try{c(n.throw(t))}catch(t){r(t)}}function c(t){var e;t.done?s(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(o,a)}c((n=n.apply(t,e||[])).next())}))};class o extends Error{constructor(t,e,i){super(e||s[t]||`HTTP Code ${t}`),arguments.length>=3&&i&&Object.assign(this,i),this.name=function(t){const e=4==(t/100|0)||5==(t/100|0)?"error":"";return` ${String(s[t]||`HTTP Code ${t}`).replace(/error$/i,"")} ${e}`.split(" ").reduce(((t,e)=>t+(e?e.charAt(0).toUpperCase()+e.slice(1):"")))}(t),this.statusCode=t}}class a{constructor(t,e={}){this.url=t,this.options=e}_parseQueryParams(t){if(t){if("string"==typeof t)return t;if(t.constructor===Object||void 0===t.constructor)for(let e in t){null==t[e]&&delete t[e]}return`?${new URLSearchParams(t)}`}return""}_fetch(t,e){return r(this,void 0,void 0,(function*(){const i=yield fetch(t,{method:e.method,headers:e.headers,body:e.body});let n;try{n=yield i[e.responseType||"json"]()}catch(e){throw new o(500,`Failed to parse response data. Original status: ${i.status} | ${i.statusText}`,{url:t,error:e})}if(!i.ok)throw new o(i.status,i.statusText,n);return n}))}http(t,e){return r(this,void 0,void 0,(function*(){const i=!!e.body;return e.method=e.method||(i?"POST":"GET"),t.startsWith("/")||(t=`/${t}`),e.query=this._parseQueryParams(e.query),e.headers=e.headers||{},e.headers["Content-Type"]="application/json",e.body&&"string"!=typeof e.body?e.body=JSON.stringify(e.body):e.body=void 0,yield this._fetch(this.url+t+e.query,e)}))}}class c extends n{getCallerName(){const t=Error.prepareStackTrace;Error.prepareStackTrace=(t,e)=>e;const{stack:e}=new Error;Error.prepareStackTrace=t;return(null==e?void 0:e[2])||"unknown context"}requires(t,e){if(!e)throw`ArgumentError[${this.getCallerName()}] ${t} is missing - required property!`}}function u(t){return 1e3*t.exp-Date.now()||3e5}function d(t){return JSON.parse(atob(t.split(".")[1]))}function h(t){return new Promise((e=>setTimeout(e,t)))}class l{static error(...t){console.error("E:EmpationAPI",...t)}static warn(...t){console.warn("W:EmpationAPI",...t)}static info(...t){console.info("I:EmpationAPI",...t)}static debug(...t){console.debug("D:EmpationAPI",...t)}}class f{}class p extends c{constructor(t){if(super(),this.accessToken=null,this._tokenExpires=0,this._rawToken="",!t.workbenchApiUrl)throw"WB Api url is required!";let e;e=t.apiRootPath?t.apiRootPath.startsWith("/")?`${t.workbenchApiUrl}${t.apiRootPath}`:`${t.workbenchApiUrl}/${t.apiRootPath}`:t.workbenchApiUrl,e.endsWith("/")&&(e=e.slice(0,-1)),this.options={apiUrl:e,workbenchApiUrl:t.workbenchApiUrl,anonymousUserId:t.anonymousUserId||"anonymous",apiRootPath:t.apiRootPath||""},this._userId=this.options.anonymousUserId,this.cached={}}from(t,e=!0){if(!t)return this.reset();this._rawToken=t,e=e&&!this.accessToken,this.accessToken=d(t);const i=u(this.accessToken);this._tokenExpires=Date.now()+i/2;let n=this.accessToken.sub;if(!n)throw"Invalid User ID! Must be valid string shorter than 50 characters!";n.length>50&&(console.warn("User ID exceeded 50 characters! Using User ID shortened to first 50 characters!"),n=n.slice(0,50)),this.userId!==n&&(this._userId=n,e&&this.raiseEvent("init"))}use(t,e=!0){if(e=e&&!this._userId,this.reset(),!t||t.length>50)throw"Invalid User ID! Must be valid string shorter than 50 characters!";this._userId=t,e&&this.raiseEvent("init_no_token")}reset(){this._rawToken="",this._tokenExpires=0,this.accessToken=null,this._userId=this.options.anonymousUserId,this.defaultScopeKey="",this.scopes.forEach((t=>t.reset())),this.scopes.clear(),this.raiseEvent("reset")}get userId(){return this._userId}get rawToken(){return this._rawToken}rawQuery(t,e){return i=this,n=void 0,r=function*(){if(!this._userId)throw"User must be configured to access Empaia API: either provide a valid 'anonymous' user ID through env variables, or configure the Root API with a valid token.";if(this._tokenExpires>0&&Date.now()>this._tokenExpires){const t={newToken:""};yield this.raiseEventAwaiting("token-refresh",t),this.from(t.newToken)}},new((s=void 0)||(s=Promise))((function(t,e){function o(t){try{c(r.next(t))}catch(t){e(t)}}function a(t){try{c(r.throw(t))}catch(t){e(t)}}function c(e){var i;e.done?t(e.value):(i=e.value,i instanceof s?i:new s((function(t){t(i)}))).then(o,a)}c((r=r.apply(i,n||[])).next())}));var i,n,s,r}}class v{}class y extends c{}var m=function(t,e,i,n){return new(i||(i=Promise))((function(s,r){function o(t){try{c(n.next(t))}catch(t){r(t)}}function a(t){try{c(n.throw(t))}catch(t){r(t)}}function c(t){var e;t.done?s(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(o,a)}c((n=n.apply(t,e||[])).next())}))};class g extends f{constructor(t){super(),this.data=null,this._defaultApp=null,this.context=t}list(){return m(this,void 0,void 0,(function*(){return this.data=yield this.context.rawQuery("/apps/query",{method:"PUT",body:{apps:null,tissues:null,stains:null,job_modes:null}})}))}query(t){return m(this,void 0,void 0,(function*(){return this.data=yield this.context.rawQuery("/apps/query",{method:"PUT",body:t})}))}default(){return m(this,void 0,void 0,(function*(){this.data||(yield this.list());for(let t of this.data.items)if("MAP3"===t.name_short&&"rationai"===t.vendor_name){this._defaultApp=t;break}if(!this._defaultApp)throw"Default APP not present in the infrastructure! Was it imported?";return this._defaultApp}))}}const x=t=>("string"==typeof t&&(t=Number(t)),t),w=(t,e,i,n)=>{const s=new RegExp(e).exec(t);return!(!s||i<1||i>=s.length)&&s[i]===n};var b=function(t,e,i,n){return new(i||(i=Promise))((function(s,r){function o(t){try{c(n.next(t))}catch(t){r(t)}}function a(t){try{c(n.throw(t))}catch(t){r(t)}}function c(t){var e;t.done?s(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(o,a)}c((n=n.apply(t,e||[])).next())}))};class T{constructor(t){this.customCases=null,this.caseHierarchy=null,this.caseTissues=null,this.caseStains=null,this.identifierSeparator="",this.hierarchySpec=[],this.hierarchyNameOverrides={},this.context=t}use(t,e,i={}){this.hierarchySpec=e,this.identifierSeparator=t,this.hierarchyNameOverrides=i}getCustomCases(){return b(this,void 0,void 0,(function*(){return this.customCases||(this.customCases=(yield this.context.list()).items.map((t=>Object.assign(Object.assign({},t),{pathInHierarchy:this.getCaseHierarchyPath(t)})))),this.customCases}))}getCaseHierarchyPath(t){if(!this.identifierSeparator||!this.hierarchySpec)throw"ArgumentError[CaseExplorer] identifierSeparator or hierarchySpec is missing - required property!";let e=!1;return this.hierarchySpec.reduce(((i,n)=>{const s=this.getCaseValue(n,t),r=e?i:`${i}/${s}`;return"OTHER"===s&&(e=!0),r}),"")}getCase(t){return b(this,void 0,void 0,(function*(){let e;return this.customCases&&(e=this.customCases.find((e=>e.id===t))),e||(e=yield this.context.get(t)),Object.assign(Object.assign({},e),{pathInHierarchy:this.getCaseHierarchyPath(e)})}))}getCaseValue(t,e){switch(t){case"year":return this.getCaseYear(e);case"month":return this.getCaseMonth(e);case"day":return this.getCaseDay(e);case"description":return this.getCaseDescription(e);case"tissues":return this.getCaseTissues(e);case"stains":return this.getCaseStains(e);default:if("id_part_"===t.slice(0,8)&&!isNaN(Number(t.slice(8))))return this.getCaseIdentifierPart(e,Number(t.slice(8)));throw`KeyError[CaseExplorer] "${t}" is not supported!`}}evaluateCaseValue(t,e,i){const n=this.getCaseValue(t,i);switch(t){case"year":return this.evaulateCaseYear(n,e);case"month":return this.evaulateCaseMonth(n,e);case"day":return this.evaulateCaseDay(n,e);case"description":return this.evaluateCaseDescription(n,e);case"tissues":return this.evaluateCaseTissues(n,e);case"stains":return this.evaluateCaseStains(n,e);default:return this.evaulateCaseIdentifierPart(n,e)}}getCaseYear(t){return(e=t.created_at,new Date(1e3*x(e)).getFullYear()).toString();var e}getCaseMonth(t){return(e=t.created_at,new Date(1e3*x(e)).getMonth()).toString();var e}getCaseDay(t){return(e=t.created_at,new Date(1e3*x(e)).getDate()).toString();var e}getCaseIdentifierPart(t,e){if(!this.identifierSeparator)throw"ArgumentError[CaseExplorer] identifierSeparator is missing - required property!";const i=new RegExp(this.identifierSeparator).exec(t.local_id||"");if(!i)return"OTHER";if(e<1||e>=i.length)throw'KeyError[CaseExplorer] invalid key "id_part_", group index is not valid!';return i[e]}getCaseDescription(t){return t.description||""}getCaseTissues(t){return Object.keys(t.tissues)}getCaseStains(t){return Object.keys(t.stains)}evaulateCaseYear(t,e){return t===e}evaulateCaseMonth(t,e){return t===e}evaulateCaseDay(t,e){return t===e}evaulateCaseIdentifierPart(t,e){return t===e}evaluateCaseDescription(t,e){return((t,e)=>{const i=e.split(" ").filter(Boolean).map((t=>`(?=.*\\b${t}\\b)`)),n=new RegExp(i.join(""),"gim");return null!==t.match(n)})(t,e)}evaluateCaseTissues(t,e){return e instanceof Array||(e=[e]),e.every((e=>t.includes(e)))}evaluateCaseStains(t,e){return e instanceof Array||(e=[e]),e.every((e=>t.includes(e)))}hierarchyLevel(t,e,i,n,s){if(e>=t.length)return{levelName:s,lastLevel:!0,items:i.map((t=>Object.assign(Object.assign({},t),{pathInHierarchy:n})))};const r=(o=i=>{const n=this.getCaseValue(t[e],i);return Array.isArray(n)?n[0]||"":n},i.reduce(((t,e)=>{var i;return(t[i=o(e)]||(t[i]=[])).push(e),t}),{}));var o;const a=Object.keys(r).map((i=>{var s;const o=(null===(s=this.hierarchyNameOverrides[t[e]])||void 0===s?void 0:s[i])||i;return"OTHER"===i?this.hierarchyLevel(t,t.length,r[i],`${n}/${o}`,o):this.hierarchyLevel(t,e+1,r[i],`${n}/${o}`,o)}));return{levelName:s,lastLevel:!1,items:a}}hierarchy(){return b(this,void 0,void 0,(function*(){if(!this.caseHierarchy){const t=yield this.getCustomCases();this.caseHierarchy=this.hierarchyLevel(this.hierarchySpec,0,t,"")}return this.caseHierarchy}))}search(t){return b(this,void 0,void 0,(function*(){let e=yield this.getCustomCases();return t.forEach((({key:t,value:i})=>e=e.filter((e=>this.evaluateCaseValue(t,i,e))))),e}))}tissues(t="EN"){return b(this,void 0,void 0,(function*(){if(!this.caseTissues){const e=yield this.getCustomCases(),i=[];e.forEach((e=>Object.entries(e.tissues).map((([e,i])=>({name:e,locName:i[t]}))).forEach((t=>i.push(t))))),this.caseTissues=[...new Map(i.map((t=>[JSON.stringify([t.name,t.locName]),t]))).values()]}return this.caseTissues}))}stains(t="EN"){return b(this,void 0,void 0,(function*(){if(!this.caseStains){const e=yield this.getCustomCases(),i=[];e.forEach((e=>Object.entries(e.stains).map((([e,i])=>({name:e,locName:i[t]}))).forEach((t=>i.push(t))))),this.caseStains=[...new Map(i.map((t=>[JSON.stringify([t.name,t.locName]),t]))).values()]}return this.caseStains}))}}var I=function(t,e,i,n){return new(i||(i=Promise))((function(s,r){function o(t){try{c(n.next(t))}catch(t){r(t)}}function a(t){try{c(n.throw(t))}catch(t){r(t)}}function c(t){var e;t.done?s(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(o,a)}c((n=n.apply(t,e||[])).next())}))};class S{constructor(t){this.lastCaseId=null,this.data=null,this.slidesData=null,this.masksData=null,this.maskIdentifierSeparator="",this.maskIdentifierValue="",this.context=t}use(t,e){this.maskIdentifierSeparator=t,this.maskIdentifierValue=e}getAllSlides(t){return I(this,void 0,void 0,(function*(){return this.lastCaseId===t&&this.data||(this.data=(yield this.context.slides(t)).items),this.data}))}slides(t){return I(this,void 0,void 0,(function*(){return this.lastCaseId===t&&this.slidesData||(this.slidesData=(yield this.getAllSlides(t)).filter((t=>!w(t.local_id||"",this.maskIdentifierSeparator,1,this.maskIdentifierValue)))),this.slidesData}))}masks(t){return I(this,void 0,void 0,(function*(){return this.lastCaseId===t&&this.masksData||(this.masksData=(yield this.getAllSlides(t)).filter((t=>w(t.local_id||"",this.maskIdentifierSeparator,1,this.maskIdentifierValue)))),this.masksData}))}}var P=function(t,e,i,n){return new(i||(i=Promise))((function(s,r){function o(t){try{c(n.next(t))}catch(t){r(t)}}function a(t){try{c(n.throw(t))}catch(t){r(t)}}function c(t){var e;t.done?s(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(o,a)}c((n=n.apply(t,e||[])).next())}))};class C extends f{constructor(t){super(),this.data=null,this.context=t,this.caseExplorer=new T(this),this.wsiExplorer=new S(this)}list(){return P(this,void 0,void 0,(function*(){return this.data||(this.data=yield this.context.rawQuery("/cases")),this.data}))}get(t){return P(this,void 0,void 0,(function*(){return yield this.context.rawQuery(`/cases/${t}`)}))}slides(t){return P(this,void 0,void 0,(function*(){return yield this.context.rawQuery(`/cases/${t}/slides`)}))}}var E=function(t,e,i,n){return new(i||(i=Promise))((function(s,r){function o(t){try{c(n.next(t))}catch(t){r(t)}}function a(t){try{c(n.throw(t))}catch(t){r(t)}}function c(t){var e;t.done?s(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(o,a)}c((n=n.apply(t,e||[])).next())}))};class $ extends f{constructor(t){super(),this.data=null,this.context=t}create(t,e){return E(this,void 0,void 0,(function*(){const i=this.context;return i.requires("caseId",t),i.rawQuery("/examinations",{method:"PUT",body:{case_id:t,app_id:e}})}))}query(t,e,i){return E(this,void 0,void 0,(function*(){return this.context.rawQuery("/examinations/query",{method:"PUT",body:t,query:{skip:e,limit:i}})}))}get(t){return E(this,void 0,void 0,(function*(){const e=this.context;return e.requires("examinationId",t),e.rawQuery(`/examinations/${t}`)}))}scope(t){return E(this,void 0,void 0,(function*(){const e=this.context;return e.requires("examinationId",t),e.rawQuery(`/examinations/${t}/scope`,{method:"PUT"})}))}}var _=function(t,e,i,n){return new(i||(i=Promise))((function(s,r){function o(t){try{c(n.next(t))}catch(t){r(t)}}function a(t){try{c(n.throw(t))}catch(t){r(t)}}function c(t){var e;t.done?s(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(o,a)}c((n=n.apply(t,e||[])).next())}))};class k extends v{constructor(t){super(),this.data=null,this.context=t}getRaw(){return _(this,void 0,void 0,(function*(){return this.data||(this.data=yield this.context.rawQuery("/app-ui-storage/user")),this.data}))}flush(){return _(this,void 0,void 0,(function*(){return this.data?yield this.context.rawQuery("/app-ui-storage/user",{method:"PUT",body:this.data}):null}))}get(t){return _(this,void 0,void 0,(function*(){const e=yield this.getRaw();return"string"==typeof e.content[t]?JSON.parse(e.content[t]):e.content[t]}))}set(t,e,i){return _(this,void 0,void 0,(function*(){const n=JSON.stringify(e),s=yield this.getRaw();s.content[t]=n,this.data=s,i&&this.flush()}))}erase(){return _(this,void 0,void 0,(function*(){this.data={content:{}},this.flush()}))}}var O=function(t,e,i,n){return new(i||(i=Promise))((function(s,r){function o(t){try{c(n.next(t))}catch(t){r(t)}}function a(t){try{c(n.throw(t))}catch(t){r(t)}}function c(t){var e;t.done?s(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(o,a)}c((n=n.apply(t,e||[])).next())}))};class A extends v{constructor(t){super(),this.context=t}upload(t,e={}){return O(this,void 0,void 0,(function*(){return yield this.context.rawQuery("/annotations",{method:"POST",query:e,body:this.data})}))}create(t,e={}){return O(this,void 0,void 0,(function*(){return yield this.context.rawQuery("/annotations",{method:"POST",query:e,body:this.data})}))}delete(t){return O(this,void 0,void 0,(function*(){return yield this.context.rawQuery(`/annotations/${t}`,{method:"DELETE"})}))}update(t,e,i={}){return O(this,void 0,void 0,(function*(){return yield this.delete(t),!i.externalIds&&e.id&&(i.externalIds=!0),yield this.create(e,i)}))}}var R=function(t,e,i,n){return new(i||(i=Promise))((function(s,r){function o(t){try{c(n.next(t))}catch(t){r(t)}}function a(t){try{c(n.throw(t))}catch(t){r(t)}}function c(t){var e;t.done?s(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(o,a)}c((n=n.apply(t,e||[])).next())}))};class U extends v{constructor(t){super(),this.data=null,this.context=t}get(t){return R(this,void 0,void 0,(function*(){return yield this.context.rawQuery(`/collections/${t}`)}))}create(t){return R(this,void 0,void 0,(function*(){return yield this.context.rawQuery("/collections",{method:"POST",body:t})}))}delete(t){return R(this,void 0,void 0,(function*(){yield this.context.rawQuery(`/collections/${t}`,{method:"DELETE"})}))}queryItems(t,e){return R(this,void 0,void 0,(function*(){return yield this.context.rawQuery(`/collections/${t}/items/query`,{method:"PUT",body:e})}))}createItems(t,e){return R(this,void 0,void 0,(function*(){yield this.context.rawQuery(`/collections/${t}/items`,{method:"POST",body:Object.assign({},e)})}))}deleteItem(t,e){return R(this,void 0,void 0,(function*(){yield this.context.rawQuery(`/collections/${t}/items/${e}`,{method:"DELETE"})}))}}var j=function(t,e,i,n){return new(i||(i=Promise))((function(s,r){function o(t){try{c(n.next(t))}catch(t){r(t)}}function a(t){try{c(n.throw(t))}catch(t){r(t)}}function c(t){var e;t.done?s(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(o,a)}c((n=n.apply(t,e||[])).next())}))};class N extends v{constructor(t){super(),this.data=null,this.context=t}getJobs(){return j(this,void 0,void 0,(function*(){return(yield this.context.rawQuery("/jobs")).items}))}get(t){return j(this,void 0,void 0,(function*(){return yield this.context.rawQuery(`/jobs/${t}`)}))}}var D=function(t,e,i,n){return new(i||(i=Promise))((function(s,r){function o(t){try{c(n.next(t))}catch(t){r(t)}}function a(t){try{c(n.throw(t))}catch(t){r(t)}}function c(t){var e;t.done?s(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(o,a)}c((n=n.apply(t,e||[])).next())}))};class Q extends v{constructor(t){super(),this.data=null,this.context=t}get(t){return D(this,void 0,void 0,(function*(){return yield this.context.rawQuery(`/pixelmaps/${t}`)}))}post(t){return D(this,void 0,void 0,(function*(){return yield this.context.rawQuery("/pixelmaps",{method:"POST",body:t})}))}delete(t){return D(this,void 0,void 0,(function*(){return yield this.context.rawQuery(`/pixelmaps/${t}`,{method:"DELETE"})}))}query(t){return D(this,void 0,void 0,(function*(){return(yield this.context.rawQuery("/pixelmaps/query",{method:"PUT",body:t})).items}))}getTile(t,e,i,n){return D(this,void 0,void 0,(function*(){return yield this.context.rawQuery(`/pixelmaps/${t}/level/${e}/position/${i}/${n}/data`,{responseType:"blob"})}))}uploadTile(t,e,i,n,s){return D(this,void 0,void 0,(function*(){return yield this.context.rawQuery(`/pixelmaps/${t}/level/${e}/position/${i}/${n}/data`,{method:"PUT",body:s})}))}deleteTile(t,e,i,n){return D(this,void 0,void 0,(function*(){return yield this.context.rawQuery(`/pixelmaps/${t}/level/${e}/position/${i}/${n}/data`,{method:"DELETE"})}))}bulkGetTile(t,e,i,n,s,r){return D(this,void 0,void 0,(function*(){return yield this.context.rawQuery(`/pixelmaps/${t}/level/${e}/position/start/${i}/${n}/end/${s}/${r}/data`,{responseType:"blob"})}))}bulkUploadTile(t,e,i,n,s,r,o){return D(this,void 0,void 0,(function*(){return yield this.context.rawQuery(`/pixelmaps/${t}/level/${e}/position/start/${i}/${n}/end/${s}/${r}/data`,{method:"PUT",body:o})}))}}var q=function(t,e,i,n){return new(i||(i=Promise))((function(s,r){function o(t){try{c(n.next(t))}catch(t){r(t)}}function a(t){try{c(n.throw(t))}catch(t){r(t)}}function c(t){var e;t.done?s(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(o,a)}c((n=n.apply(t,e||[])).next())}))};class M extends y{constructor(t){super(),this.scopeContext=null,this._defaultExaminationId="",this._tokenRefetchInterval=null,this.activeExaminationId="",this.activeCaseId="",this.activeAppId="",this.context=t,this.raw=new a(this.context.options.apiUrl+M.apiPath),this.storage=new k(this),this.annotations=new A(this),this.collections=new U(this),this.jobs=new N(this),this.pixelmaps=new Q(this)}use(t,e=void 0){return q(this,void 0,void 0,(function*(){this.requires("root::userId",this.context.userId);const i=e=>q(this,void 0,void 0,(function*(){let i=yield this.context.examinations.query({apps:[e],creators:[this.context.userId]});if(i.item_count>0){let t=i.items.find((t=>"OPEN"===t.state));if(t)return t}return yield this.context.examinations.create(t,e)}));let n;if(e?n=yield i(e):this._defaultExaminationId&&(n=yield this.context.examinations.get(this._defaultExaminationId)),!n){let t=yield this.context.apps.default();n=yield i(t.app_id),this._defaultExaminationId=n.id}yield this.from(n)}))}get scopeToken(){var t;return null===(t=this.scopeContext)||void 0===t?void 0:t.access_token}from(t){return q(this,void 0,void 0,(function*(){this.reset(),this.scopeContext=yield this.context.examinations.scope(t.id),this.activeCaseId=t.case_id,this.activeAppId=t.app_id,this.activeExaminationId=t.id;const e=u(d(this.scopeContext.access_token));this._tokenRefetchInterval=setInterval((()=>q(this,void 0,void 0,(function*(){this.scopeContext=yield this.context.examinations.scope(t.id)}))),e),this.raiseEvent("init")}))}reset(){this.activeExaminationId="",this.scopeContext=null,this._tokenRefetchInterval&&(clearInterval(this._tokenRefetchInterval),this._tokenRefetchInterval=null,this.raiseEvent("reset"))}rawQuery(t,e){var i,n;return q(this,void 0,void 0,(function*(){this.requires("this.scopeContext",this.scopeContext),(e=e||{}).headers=e.headers||{},e.headers.Authorization=`Bearer ${null===(i=this.scopeContext)||void 0===i?void 0:i.access_token}`,t&&!t.startsWith("/")&&(t=`/${t}`);try{return yield this.raw.http(`/${null===(n=this.scopeContext)||void 0===n?void 0:n.scope_id}${t}`,e)}catch(i){if(401===i.statusCode)return this.scopeContext=yield this.context.examinations.scope(this.activeExaminationId),yield this.raw.http(`/${this.scopeContext.scope_id}${t}`,e);throw i}}))}}M.apiPath="/v3/scopes";const J=M;var H,L,V,F=function(t,e,i,n){return new(i||(i=Promise))((function(s,r){function o(t){try{c(n.next(t))}catch(t){r(t)}}function a(t){try{c(n.throw(t))}catch(t){r(t)}}function c(t){var e;t.done?s(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(o,a)}c((n=n.apply(t,e||[])).next())}))};class z extends f{constructor(t){super(),this.data=null,this.context=t}slideInfo(t){return F(this,void 0,void 0,(function*(){return yield this.context.rawQuery(`/slides/${t}/info`)}))}slideThumbnail(t,e,i,n){return F(this,void 0,void 0,(function*(){return yield this.context.rawQuery(`/slides/${t}/thumbnail/max_size/${e}/${i}`,{query:{image_format:n},responseType:"blob"})}))}slideLabel(t,e,i,n){return F(this,void 0,void 0,(function*(){return yield this.context.rawQuery(`/slides/${t}/label/max_size/${e}/${i}`,{query:{image_format:n},responseType:"blob"})}))}loadTile(t,e,i,n,s){return F(this,void 0,void 0,(function*(){return yield this.context.rawQuery(`/slides/${t}/tile/level/${e}/tile/${i}/${n}`,{query:{image_format:s},responseType:"blob"})}))}}!function(t){t.USER="user",t.SCOPE="scope",t.JOB="job"}(H||(H={})),function(t){t.ANNOTATION="annotation",t.COLLECTION="collection",t.CLASS="class",t.PRIMITIVE="primitive",t.WSI="wsi",t.CASE="case",t.USER="user",t.SCOPE="scope",t.JOB="job"}(L||(L={})),function(t){t.Background="background",t.Params="params",t.Shader="shader",t.Visualization="visualization"}(V||(V={}));var W=function(t,e,i,n){return new(i||(i=Promise))((function(s,r){function o(t){try{c(n.next(t))}catch(t){r(t)}}function a(t){try{c(n.throw(t))}catch(t){r(t)}}function c(t){var e;t.done?s(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(o,a)}c((n=n.apply(t,e||[])).next())}))};class B{constructor(t){this.data=null,this.defaultSlideMetadata={visualization:{}},this.defaultMaskMetadata={},this.context=t}getWsiMetadataItem(t,e=!0){return W(this,void 0,void 0,(function*(){let i=(yield this.context.query({references:[t]})).find((t=>t.data_type===(e?"slide":"mask")+"_metadata"));return i||(i=yield this.createWsiMetadataItem(t,e?this.defaultSlideMetadata:this.defaultMaskMetadata)),i}))}createWsiMetadataItem(t,e,i=!0){return W(this,void 0,void 0,(function*(){return yield this.context.createValue(e,`Metadata of ${i?"slide":"mask"} ${t}`,void 0,t,L.WSI,(i?"slide":"mask")+"_metadata")}))}getSlideMetadata(t){return W(this,void 0,void 0,(function*(){return JSON.parse((yield this.getWsiMetadataItem(t)).value)}))}updateSlideMetadata(t,e){return W(this,void 0,void 0,(function*(){const i=yield this.getWsiMetadataItem(t);try{const t=yield this.context.update(i.id,Object.assign(Object.assign({},i),{value:JSON.stringify(e)}));return JSON.parse(t.value)}catch(t){return!1}}))}getShadersConfig(t){return W(this,void 0,void 0,(function*(){const e={};for(let i=0;iW(this,void 0,void 0,(function*(){return Object.assign(Object.assign({},yield this.context.visTemplates.getTemplate(V.Visualization,t.visTemplate)),{name:t.name,shaders:yield this.getShadersConfig(t.shaders)})}))))))}}))}getMaskMetadata(t){return W(this,void 0,void 0,(function*(){return JSON.parse((yield this.getWsiMetadataItem(t,!1)).value)}))}}var K=function(t,e,i,n){return new(i||(i=Promise))((function(s,r){function o(t){try{c(n.next(t))}catch(t){r(t)}}function a(t){try{c(n.throw(t))}catch(t){r(t)}}function c(t){var e;t.done?s(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(o,a)}c((n=n.apply(t,e||[])).next())}))};const G="vis_templates";class Y{constructor(t){this.data=null,this.context=t}fetchTemplateItem(t,e){return K(this,void 0,void 0,(function*(){return(yield this.context.query({references:[null],data_types:[`${G}_${t}`]})).find((t=>t.name===e))}))}getTemplate(t,e){return K(this,void 0,void 0,(function*(){const i=yield this.fetchTemplateItem(t,e);return!!i&&JSON.parse(i.value)}))}createTemplate(t,e,i){return K(this,void 0,void 0,(function*(){return!(yield this.fetchTemplateItem(t,e))&&(yield this.context.createValue(i,`${e}`,void 0,void 0,void 0,`${G}_${t}`))}))}deleteTemplate(t,e){return K(this,void 0,void 0,(function*(){const i=yield this.fetchTemplateItem(t,e);return!!i&&(yield this.context.delete(i.id),!0)}))}}var X=function(t,e,i,n){return new(i||(i=Promise))((function(s,r){function o(t){try{c(n.next(t))}catch(t){r(t)}}function a(t){try{c(n.throw(t))}catch(t){r(t)}}function c(t){var e;t.done?s(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(o,a)}c((n=n.apply(t,e||[])).next())}))};class Z{constructor(t){this.data=null,this.presetDataType="annot_presets",this.context=t}use(t){this.presetDataType=t}getPresetsItem(t=!1){return X(this,void 0,void 0,(function*(){if(!this.data||t){let t=(yield this.context.query({references:[null],data_types:[this.presetDataType]})).find((t=>!0));t||(t=yield this.createPresetsItem({presets:[]})),this.data=t}return this.data}))}createPresetsItem(t){return X(this,void 0,void 0,(function*(){return yield this.context.createValue(t,"Global annotation presets",void 0,void 0,void 0,this.presetDataType)}))}getAnnotPresets(t=!1){return X(this,void 0,void 0,(function*(){const e=yield this.getPresetsItem(t);return{presets:JSON.parse(e.value).presets,lastModifiedAt:e.modified_at}}))}mergePresets(t,e,i){const n=[...t];return e.forEach((t=>n.some((e=>e.id===t.id))||!t.createdAt||t.createdAt<=i?null:n.push(t))),n}updateAnnotPresets(t,e,i=!1){return X(this,void 0,void 0,(function*(){const n=yield this.getPresetsItem(!0),s=JSON.parse(n.value).presets;let r=t,o=!0;if(n.modified_at!==e){if(i)return{presets:s,successfulUpdate:!1,lastModifiedAt:n.modified_at};r=this.mergePresets(s,r,e),o=!1}try{const t=yield this.context.update(n.id,Object.assign(Object.assign({},n),{value:JSON.stringify({presets:r})}));return{presets:JSON.parse(t.value).presets,successfulUpdate:o,lastModifiedAt:t.modified_at}}catch(t){if(409===t.statusCode){const t=yield this.updateAnnotPresets(r,n.modified_at);return Object.assign(Object.assign({},t),{successfulUpdate:o})}throw t}}))}deleteAnnotPresets(){return X(this,void 0,void 0,(function*(){const t=yield this.getPresetsItem(!0);yield this.context.delete(t.id),this.data=null}))}}var tt=function(t,e,i,n){return new(i||(i=Promise))((function(s,r){function o(t){try{c(n.next(t))}catch(t){r(t)}}function a(t){try{c(n.throw(t))}catch(t){r(t)}}function c(t){var e;t.done?s(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(o,a)}c((n=n.apply(t,e||[])).next())}))};class et{constructor(t){this.data=null,this.configDataType="app_job_config",this.context=t}use(t){this.configDataType=t}fetchJobConfigItem(t){return tt(this,void 0,void 0,(function*(){return(yield this.context.query({references:[t],data_types:[this.configDataType]})).find(Boolean)}))}getJobConfig(t){return tt(this,void 0,void 0,(function*(){const e=yield this.fetchJobConfigItem(t);return!!e&&JSON.parse(e.value)}))}createJobConfig(t,e){return tt(this,void 0,void 0,(function*(){return!(yield this.fetchJobConfigItem(t))&&(yield this.context.createValue(e,"Job config of App",void 0,t,L.JOB,this.configDataType))}))}deleteJobConfig(t){return tt(this,void 0,void 0,(function*(){const e=yield this.fetchJobConfigItem(t);return!!e&&(yield this.context.delete(e.id),!0)}))}}var it=function(t,e,i,n){return new(i||(i=Promise))((function(s,r){function o(t){try{c(n.next(t))}catch(t){r(t)}}function a(t){try{c(n.throw(t))}catch(t){r(t)}}function c(t){var e;t.done?s(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(o,a)}c((n=n.apply(t,e||[])).next())}))};class nt{constructor(t){this.data=null,this.context=t,this.wsiMetadata=new B(this),this.visTemplates=new Y(this),this.annotPresets=new Z(this),this.jobConfig=new et(this)}get(t){return it(this,void 0,void 0,(function*(){return yield this.context.rawQuery(`/global-storage/${t}`)}))}getValue(t){return it(this,void 0,void 0,(function*(){const e=yield this.get(t);if("string"===e.type)try{return JSON.parse(e.value)}catch(t){return e.value}return e.value}))}query(t){return it(this,void 0,void 0,(function*(){return(yield this.context.rawQuery("/global-storage/query",{method:"PUT",body:t})).items}))}create(t){return it(this,void 0,void 0,(function*(){return yield this.context.rawQuery("/global-storage",{method:"POST",body:t})}))}createValue(t,e,i,n,s,r){return it(this,void 0,void 0,(function*(){t=JSON.stringify(t);const o={name:e,description:i,creator_id:this.context.userId,creator_type:H.USER,reference_id:n,reference_type:s,type:"string",value:t,data_type:r};return yield this.create(o)}))}update(t,e){return it(this,void 0,void 0,(function*(){return yield this.context.rawQuery(`/global-storage/${t}`,{method:"PUT",body:e})}))}updateValue(t,e){return it(this,void 0,void 0,(function*(){const i=yield this.context.rawQuery(`/global-storage/${t}`);return i.value=JSON.stringify(e),yield this.context.rawQuery(`/global-storage/${t}`,{method:"PUT",body:i})}))}delete(t){return it(this,void 0,void 0,(function*(){yield this.context.rawQuery(`/global-storage/${t}`,{method:"DELETE"})}))}}class st{constructor(t){this.context=t,this.globalStorage=new nt(this)}get userId(){return this.context.userId}rawQuery(t,e={}){return i=this,n=void 0,r=function*(){return this.context.rawQuery(`${st.relativeApiPath}${t}`,e)},new((s=void 0)||(s=Promise))((function(t,e){function o(t){try{c(r.next(t))}catch(t){e(t)}}function a(t){try{c(r.throw(t))}catch(t){e(t)}}function c(e){var i;e.done?t(e.value):(i=e.value,i instanceof s?i:new s((function(t){t(i)}))).then(o,a)}c((r=r.apply(i,n||[])).next())}));var i,n,s,r}}st.relativeApiPath="/rationai";const rt=st;var ot=function(t,e,i,n){return new(i||(i=Promise))((function(s,r){function o(t){try{c(n.next(t))}catch(t){r(t)}}function a(t){try{c(n.throw(t))}catch(t){r(t)}}function c(t){var e;t.done?s(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(o,a)}c((n=n.apply(t,e||[])).next())}))};class at extends p{constructor(t){super(t),this.defaultScopeKey="",this.version="v3",this.rootURI=this.options.apiUrl+at.apiPath,this.raw=new a(this.rootURI),this.rationai=new rt(this),this.apps=new g(this),this.cases=new C(this),this.examinations=new $(this),this.slides=new z(this),this.scopes=new Map}get defaultScope(){return this.scopes.get(this.defaultScopeKey)}newScopeFrom(t){return ot(this,void 0,void 0,(function*(){const e=new J(this);return yield e.from(t),this.scopes.set(t.id,e),""===this.defaultScopeKey&&(this.defaultScopeKey=t.id),e}))}newScopeUse(t,e){return ot(this,void 0,void 0,(function*(){const i=new J(this);return yield i.use(t,e),this.scopes.set(i.activeExaminationId,i),""===this.defaultScopeKey&&(this.defaultScopeKey=i.activeExaminationId),i}))}getScopeFrom(t){return ot(this,void 0,void 0,(function*(){return this.scopes.get(t.id)||(yield this.newScopeFrom(t))}))}getScopeUse(t,e){return ot(this,void 0,void 0,(function*(){const i=[...this.scopes.values()].filter((i=>i.activeCaseId===t&&(!e||i.activeAppId===e)));return i.length>0?i[0]:yield this.newScopeUse(t,e)}))}rawQuery(t,e={}){const i=Object.create(null,{rawQuery:{get:()=>super.rawQuery}});return ot(this,void 0,void 0,(function*(){return yield i.rawQuery.call(this,t,e),(e=e||{}).headers=e.headers||{},e.headers["User-Id"]=this.userId,this.accessToken&&(e.headers.Authorization=e.headers.Authorization||`Bearer ${this.rawToken}`),this.raw.http(t,e)}))}}at.apiPath="/v3";const ct=at;EmpationAPI=e})(); -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZW1wYXRpb25hcGkuanMiLCJtYXBwaW5ncyI6Im1DQUNBLElBQUlBLEV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kXHJcbiAgICAgICAgOiB1bmRlZmluZWQsXHJcbiAgICAgIGRhdGE6IHNsaWRlVmlzLmRhdGEsXHJcbiAgICAgIGJhY2tncm91bmQ6IHtcclxuICAgICAgICAuLi4oc2xpZGVWaXMuYmFja2dyb3VuZFxyXG4gICAgICAgICAgPyBhd2FpdCB0aGlzLmNvbnRleHQudmlzVGVtcGxhdGVzLmdldFRlbXBsYXRlKFxyXG4gICAgICAgICAgICAgIFRlbXBsYXRlVHlwZS5CYWNrZ3JvdW5kLFxyXG4gICAgICAgICAgICAgIHNsaWRlVmlzLmJhY2tncm91bmQ/LnRlbXBsYXRlLFxyXG4gICAgICAgICAgICApXHJcbiAgICAgICAgICA6IHt9KSxcclxuICAgICAgICBkYXRhOiBzbGlkZVZpcy5iYWNrZ3JvdW5kICYmIHNsaWRlVmlzLmJhY2tncm91bmQuZGF0YVJlZixcclxuICAgICAgfSxcclxuICAgICAgdmlzdWFsaXphdGlvbnM6XHJcbiAgICAgICAgc2xpZGVWaXMudmlzdWFsaXphdGlvbnMgJiZcclxuICAgICAgICAoYXdhaXQgUHJvbWlzZS5hbGwoXHJcbiAgICAgICAgICBzbGlkZVZpcy52aXN1YWxpemF0aW9ucy5tYXAoYXN5bmMgKHZpcykgPT4ge1xyXG4gICAgICAgICAgICByZXR1cm4ge1xyXG4gICAgICAgICAgICAgIC4uLihhd2FpdCB0aGlzLmNvbnRleHQudmlzVGVtcGxhdGVzLmdldFRlbXBsYXRlKFxyXG4gICAgICAgICAgICAgICAgVGVtcGxhdGVUeXBlLlZpc3VhbGl6YXRpb24sXHJcbiAgICAgICAgICAgICAgICB2aXMudmlzVGVtcGxhdGUsXHJcbiAgICAgICAgICAgICAgKSksXHJcbiAgICAgICAgICAgICAgbmFtZTogdmlzLm5hbWUsXHJcbiAgICAgICAgICAgICAgc2hhZGVyczogYXdhaXQgdGhpcy5nZXRTaGFkZXJzQ29uZmlnKHZpcy5zaGFkZXJzKSxcclxuICAgICAgICAgICAgfTtcclx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>{function e(t){return Promise.resolve().then((()=>{var e=new Error("Cannot find module '"+t+"'");throw e.code="MODULE_NOT_FOUND",e}))}e.keys=()=>[],e.resolve=e,e.id=732,t.exports=e}},e={};function i(n){var s=e[n];if(void 0!==s)return s.exports;var r=e[n]={exports:{}};return t[n](r,r.exports,i),r.exports}i.d=(t,e)=>{for(var n in e)i.o(e,n)&&!i.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),i.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};(()=>{"use strict";i.r(n),i.d(n,{AbstractAPI:()=>u,EventSource:()=>e,HTTPError:()=>o,Logger:()=>l,RawAPI:()=>a,RootAPI:()=>p,RootContext:()=>f,STATUS_CODES:()=>s,ScopeAPI:()=>y,ScopeContext:()=>v,V3:()=>t,getJwtTokenExpiresTimeout:()=>c,parseJwtToken:()=>d,sleep:()=>h});var t={};i.r(t),i.d(t,{Apps:()=>g,Cases:()=>C,Examinations:()=>_,RationAI:()=>rt,Root:()=>lt,Scope:()=>J,Slides:()=>B,Storage:()=>O});class e{constructor(){this.events={}}addOnceHandler(t,e,i,n,s){const r=this;n=n||1;let o=0;const a=function(i){return o++,o===n&&r.removeHandler(t,a),e(i)};this.addHandler(t,a,i,s)}addHandler(t,i,n=null,s=0){let r=this.events[t];if(r||(this.events[t]=r=[]),i&&e.isFunction(i)){let t=r.length,e={handler:i,userData:n||null,priority:s||0};for(r[t]=e;t>0&&r[t-1].priority{const r=i.length;!function o(a){if(a>=r||!i[a])return s("Resolved!"),null;n.eventSource=t,n.userData=i[a].userData;let u=i[a].handler(n);return u=u&&"promise"===e.type(u)?u:Promise.resolve(),u.then((()=>o(a+1)))}(0)}))}):null}raiseEvent(t,e){const i=this.getHandler(t);if(i)return i(this,e||{})}raiseEventAwaiting(t,e){const i=this.getAwaitingHandler(t);return i?i(this,e||{}):Promise.resolve("No handler for this event registered.")}static isFunction(t){return"function"===this.type(t)}static type(t){return null==t?String(t):this.class2type[t.toString()]||("function"==typeof t?"function":"object")}}e.class2type={"[object Boolean]":"boolean","[object Number]":"number","[object String]":"string","[object Function]":"function","[object AsyncFunction]":"function","[object Promise]":"promise","[object Array]":"array","[object Date]":"date","[object RegExp]":"regexp","[object Object]":"object"};const s={100:"Continue",101:"Switching protocols",102:"Processing",103:"Early Hints",200:"Ok",201:"Created",202:"Accepted",203:"Non Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi Status",300:"Multiple Choices",301:"Moved Permanently",302:"Moved Temporarily",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Request Too Long",414:"Request Uri Too Long",415:"Unsupported Media Type",416:"Requested Range Not Satisfiable",417:"Expectation Failed",418:"Im A Teapot",419:"Insufficient Space On Resource",420:"Method Failure",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"Http Version Not Supported",507:"Insufficient Storage",511:"Network Authentication Required"};var r=function(t,e,i,n){return new(i||(i=Promise))((function(s,r){function o(t){try{u(n.next(t))}catch(t){r(t)}}function a(t){try{u(n.throw(t))}catch(t){r(t)}}function u(t){var e;t.done?s(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(o,a)}u((n=n.apply(t,e||[])).next())}))};class o extends Error{constructor(t,e,i){super(e||s[t]||`HTTP Code ${t}`),arguments.length>=3&&i&&Object.assign(this,i),this.name=function(t){const e=4==(t/100|0)||5==(t/100|0)?"error":"";return` ${String(s[t]||`HTTP Code ${t}`).replace(/error$/i,"")} ${e}`.split(" ").reduce(((t,e)=>t+(e?e.charAt(0).toUpperCase()+e.slice(1):"")))}(t),this.statusCode=t}}class a{constructor(t,e={}){this.url=t,this.options=e}_parseQueryParams(t){if(t){if("string"==typeof t)return t;if(t.constructor===Object||void 0===t.constructor)for(let e in t){null==t[e]&&delete t[e]}return`?${new URLSearchParams(t)}`}return""}_fetch(t,e){return r(this,void 0,void 0,(function*(){const i=yield fetch(t,{method:e.method,headers:e.headers,body:e.body});let n;try{n=yield i[e.responseType||"json"]()}catch(e){throw new o(500,`Failed to parse response data. Original status: ${i.status} | ${i.statusText}`,{url:t,error:e})}if(!i.ok)throw new o(i.status,i.statusText,{payload:n});return n}))}http(t,e){return r(this,void 0,void 0,(function*(){const i=!!e.body;return e.method=e.method||(i?"POST":"GET"),t.startsWith("/")||(t=`/${t}`),e.query=this._parseQueryParams(e.query),e.headers=e.headers||{},e.headers["Content-Type"]="application/json",e.body&&"string"!=typeof e.body?e.body=JSON.stringify(e.body):e.body=void 0,yield this._fetch(this.url+t+e.query,e)}))}}class u extends e{getCallerName(){const t=Error.prepareStackTrace;Error.prepareStackTrace=(t,e)=>e;const{stack:e}=new Error;Error.prepareStackTrace=t;return(null==e?void 0:e[2])||"unknown context"}requires(t,e){if(!e)throw`ArgumentError[${this.getCallerName()}] ${t} is missing - required property!`}}function c(t){return 1e3*t.exp-Date.now()||3e5}function d(t){return JSON.parse(atob(t.split(".")[1]))}function h(t){return new Promise((e=>setTimeout(e,t)))}class l{static error(...t){console.error("E:EmpationAPI",...t)}static warn(...t){console.warn("W:EmpationAPI",...t)}static info(...t){console.info("I:EmpationAPI",...t)}static debug(...t){console.debug("D:EmpationAPI",...t)}}class f{}class p extends u{constructor(t){if(super(),this.accessToken=null,this._tokenExpires=0,this._rawToken="",!t.workbenchApiUrl)throw"WB Api url is required!";let e;e=t.apiRootPath?t.apiRootPath.startsWith("/")?`${t.workbenchApiUrl}${t.apiRootPath}`:`${t.workbenchApiUrl}/${t.apiRootPath}`:t.workbenchApiUrl,e.endsWith("/")&&(e=e.slice(0,-1)),this.options={apiUrl:e,workbenchApiUrl:t.workbenchApiUrl,anonymousUserId:t.anonymousUserId||"anonymous",apiRootPath:t.apiRootPath||""},this._userId=this.options.anonymousUserId,this.cached={}}from(t,e=!0){if(!t)return this.reset();this._rawToken=t,e=e&&!this.accessToken,this.accessToken=d(t);const i=c(this.accessToken);this._tokenExpires=Date.now()+i/2;let n=this.accessToken.sub;if(!n)throw"Invalid User ID! Must be valid string shorter than 50 characters!";n.length>50&&(console.warn("User ID exceeded 50 characters! Using User ID shortened to first 50 characters!"),n=n.slice(0,50)),this.userId!==n&&(this._userId=n,e&&this.raiseEvent("init"))}use(t,e=!0){if(e=e&&!this._userId,this.reset(),!t||t.length>50)throw"Invalid User ID! Must be valid string shorter than 50 characters!";this._userId=t,e&&this.raiseEvent("init_no_token")}reset(){this._rawToken="",this._tokenExpires=0,this.accessToken=null,this._userId=this.options.anonymousUserId,this.defaultScopeKey="",this.scopes.forEach((t=>t.reset())),this.scopes.clear(),this.raiseEvent("reset")}get userId(){return this._userId}get rawToken(){return this._rawToken}rawQuery(t,e){return i=this,n=void 0,r=function*(){if(!this._userId)throw"User must be configured to access Empaia API: either provide a valid 'anonymous' user ID through env variables, or configure the Root API with a valid token.";if(this._tokenExpires>0&&Date.now()>this._tokenExpires){const t={newToken:""};yield this.raiseEventAwaiting("token-refresh",t),this.from(t.newToken)}},new((s=void 0)||(s=Promise))((function(t,e){function o(t){try{u(r.next(t))}catch(t){e(t)}}function a(t){try{u(r.throw(t))}catch(t){e(t)}}function u(e){var i;e.done?t(e.value):(i=e.value,i instanceof s?i:new s((function(t){t(i)}))).then(o,a)}u((r=r.apply(i,n||[])).next())}));var i,n,s,r}}class v{}class y extends u{}var m=function(t,e,i,n){return new(i||(i=Promise))((function(s,r){function o(t){try{u(n.next(t))}catch(t){r(t)}}function a(t){try{u(n.throw(t))}catch(t){r(t)}}function u(t){var e;t.done?s(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(o,a)}u((n=n.apply(t,e||[])).next())}))};class g extends f{constructor(t){super(),this.data=null,this._defaultApp=null,this.context=t}list(){return m(this,void 0,void 0,(function*(){return this.data=yield this.context.rawQuery("/apps/query",{method:"PUT",body:{apps:null,tissues:null,stains:null,job_modes:null}})}))}query(t){return m(this,void 0,void 0,(function*(){return this.data=yield this.context.rawQuery("/apps/query",{method:"PUT",body:t})}))}default(){return m(this,void 0,void 0,(function*(){this.data||(yield this.list());for(let t of this.data.items)if("MAP3"===t.name_short&&"rationai"===t.vendor_name){this._defaultApp=t;break}if(!this._defaultApp)throw"Default APP not present in the infrastructure! Was it imported?";return this._defaultApp}))}}const x=t=>("string"==typeof t&&(t=Number(t)),t),w=(t,e,i,n)=>{const s=new RegExp(e).exec(t);return!(!s||i<1||i>=s.length)&&s[i]===n};var b=function(t,e,i,n){return new(i||(i=Promise))((function(s,r){function o(t){try{u(n.next(t))}catch(t){r(t)}}function a(t){try{u(n.throw(t))}catch(t){r(t)}}function u(t){var e;t.done?s(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(o,a)}u((n=n.apply(t,e||[])).next())}))};class I{constructor(t,e){this.customCases=null,this.caseHierarchy=null,this.caseTissues=null,this.caseStains=null,this.identifierSeparator="",this.hierarchySpec=[],this.hierarchyNameOverrides={},this.context=t,this.integration=e}use(t,e,i={}){this.hierarchySpec=e,this.identifierSeparator=t,this.hierarchyNameOverrides=i}getCustomCases(){return b(this,void 0,void 0,(function*(){return this.customCases||(this.customCases=(yield this.context.list()).items.map((t=>Object.assign(Object.assign({},t),{pathInHierarchy:this.getCaseHierarchyPath(t)})))),this.customCases}))}getCaseHierarchyPath(t){if(!this.identifierSeparator||!this.hierarchySpec)throw"ArgumentError[CaseExplorer] identifierSeparator or hierarchySpec is missing - required property!";let e=!1;return this.hierarchySpec.reduce(((i,n)=>{const s=this.getCaseValue(n,t),r=e?i:`${i}/${s}`;return"OTHER"===s&&(e=!0),r}),"")}getCase(t){return b(this,void 0,void 0,(function*(){let e;return this.customCases&&(e=this.customCases.find((e=>e.id===t))),e||(e=yield this.context.get(t)),Object.assign(Object.assign({},e),{pathInHierarchy:this.getCaseHierarchyPath(e)})}))}getCaseValue(t,e){switch(t){case"year":return this.getCaseYear(e);case"month":return this.getCaseMonth(e);case"day":return this.getCaseDay(e);case"description":return this.getCaseDescription(e);case"tissues":return this.getCaseTissues(e);case"stains":return this.getCaseStains(e);default:if("id_part_"===t.slice(0,8)&&!isNaN(Number(t.slice(8))))return this.getCaseIdentifierPart(e,Number(t.slice(8)));throw`KeyError[CaseExplorer] "${t}" is not supported!`}}evaluateCaseValue(t,e,i){const n=this.getCaseValue(t,i);switch(t){case"year":return this.evaulateCaseYear(n,e);case"month":return this.evaulateCaseMonth(n,e);case"day":return this.evaulateCaseDay(n,e);case"description":return this.evaluateCaseDescription(n,e);case"tissues":return this.evaluateCaseTissues(n,e);case"stains":return this.evaluateCaseStains(n,e);default:return this.evaulateCaseIdentifierPart(n,e)}}getCaseYear(t){return(e=t.created_at,new Date(1e3*x(e)).getFullYear()).toString();var e}getCaseMonth(t){return(e=t.created_at,new Date(1e3*x(e)).getMonth()).toString();var e}getCaseDay(t){return(e=t.created_at,new Date(1e3*x(e)).getDate()).toString();var e}getCaseIdentifierPart(t,e){if(!this.identifierSeparator)throw"ArgumentError[CaseExplorer] identifierSeparator is missing - required property!";const i=new RegExp(this.identifierSeparator).exec(t.local_id||"");if(!i)return"OTHER";if(e<1||e>=i.length)throw'KeyError[CaseExplorer] invalid key "id_part_", group index is not valid!';return i[e]}getCaseDescription(t){return t.description||""}getCaseTissues(t){return Object.keys(t.tissues)}getCaseStains(t){return Object.keys(t.stains)}evaulateCaseYear(t,e){return t===e}evaulateCaseMonth(t,e){return t===e}evaulateCaseDay(t,e){return t===e}evaulateCaseIdentifierPart(t,e){return t===e}evaluateCaseDescription(t,e){return((t,e)=>{const i=e.split(" ").filter(Boolean).map((t=>`(?=.*\\b${t}\\b)`)),n=new RegExp(i.join(""),"gim");return null!==t.match(n)})(t,e)}evaluateCaseTissues(t,e){return e instanceof Array||(e=[e]),e.every((e=>t.includes(e)))}evaluateCaseStains(t,e){return e instanceof Array||(e=[e]),e.every((e=>t.includes(e)))}hierarchyLevel(t,e,i,n,s,r,o){return b(this,void 0,void 0,(function*(){if(e>=t.length)return{levelId:s,levelName:r,lastLevel:!0,parent:o,items:i.map((t=>Object.assign(Object.assign({},t),{pathInHierarchy:n})))};const a=(u=i=>{const n=this.getCaseValue(t[e],i);return Array.isArray(n)?n[0]||"":n},i.reduce(((t,e)=>{var i;return(t[i=u(e)]||(t[i]=[])).push(e),t}),{}));var u;const c={levelName:r,levelId:s,lastLevel:!1,items:[]};return c.items=yield Promise.all(Object.keys(a).map((i=>b(this,void 0,void 0,(function*(){var s;let r=(null===(s=this.hierarchyNameOverrides[t[e]])||void 0===s?void 0:s[i])||(yield this.integration.translatePathSpec(t[e],i))||i;if("OTHER"===i){const e=yield this.hierarchyLevel(t,t.length,a[i],`${n}/${r}`,i,r);return e.parent=c,e}const o=yield this.hierarchyLevel(t,e+1,a[i],`${n}/${r}`,i,r);return o.parent=c,o}))))),c}))}hierarchy(){return b(this,void 0,void 0,(function*(){if(!this.caseHierarchy){const t=yield this.getCustomCases();this.caseHierarchy=yield this.hierarchyLevel(this.hierarchySpec,0,t,"")}return this.caseHierarchy}))}search(t){return b(this,void 0,void 0,(function*(){let e=yield this.getCustomCases();return t.forEach((({key:t,value:i})=>e=e.filter((e=>this.evaluateCaseValue(t,i,e))))),e}))}tissues(t="EN"){return b(this,void 0,void 0,(function*(){if(!this.caseTissues){const e=yield this.getCustomCases(),i=[];e.forEach((e=>Object.entries(e.tissues).map((([e,i])=>({name:e,locName:i[t]}))).forEach((t=>i.push(t))))),this.caseTissues=[...new Map(i.map((t=>[JSON.stringify([t.name,t.locName]),t]))).values()]}return this.caseTissues}))}stains(t="EN"){return b(this,void 0,void 0,(function*(){if(!this.caseStains){const e=yield this.getCustomCases(),i=[];e.forEach((e=>Object.entries(e.stains).map((([e,i])=>({name:e,locName:i[t]}))).forEach((t=>i.push(t))))),this.caseStains=[...new Map(i.map((t=>[JSON.stringify([t.name,t.locName]),t]))).values()]}return this.caseStains}))}}var T=function(t,e,i,n){return new(i||(i=Promise))((function(s,r){function o(t){try{u(n.next(t))}catch(t){r(t)}}function a(t){try{u(n.throw(t))}catch(t){r(t)}}function u(t){var e;t.done?s(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(o,a)}u((n=n.apply(t,e||[])).next())}))};class P{constructor(t,e){this.lastCaseId=null,this.data=null,this.slidesData=null,this.masksData=null,this.maskIdentifierSeparator="",this.maskIdentifierValue="",this.context=t,this.integration=e}use(t,e){this.maskIdentifierSeparator=t,this.maskIdentifierValue=e}getAllSlides(t){return T(this,void 0,void 0,(function*(){return this.lastCaseId===t&&this.data||(this.data=(yield this.context.slides(t)).items),this.data}))}slides(t){return T(this,void 0,void 0,(function*(){return this.lastCaseId===t&&this.slidesData||(this.slidesData=(yield this.getAllSlides(t)).filter((t=>!w(t.local_id||"",this.maskIdentifierSeparator,1,this.maskIdentifierValue)))),this.slidesData}))}masks(t){return T(this,void 0,void 0,(function*(){return this.lastCaseId===t&&this.masksData||(this.masksData=(yield this.getAllSlides(t)).filter((t=>w(t.local_id||"",this.maskIdentifierSeparator,1,this.maskIdentifierValue)))),this.masksData}))}}var S=function(t,e,i,n){return new(i||(i=Promise))((function(s,r){function o(t){try{u(n.next(t))}catch(t){r(t)}}function a(t){try{u(n.throw(t))}catch(t){r(t)}}function u(t){var e;t.done?s(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(o,a)}u((n=n.apply(t,e||[])).next())}))};class C extends f{constructor(t){super(),this.data=null,this.context=t,this.caseExplorer=new I(this,t.integration),this.wsiExplorer=new P(this,t.integration)}list(){return S(this,void 0,void 0,(function*(){return this.data||(this.data=yield this.context.rawQuery("/cases")),this.data}))}get(t){return S(this,void 0,void 0,(function*(){return yield this.context.rawQuery(`/cases/${t}`)}))}slides(t){return S(this,void 0,void 0,(function*(){return yield this.context.rawQuery(`/cases/${t}/slides`)}))}}var E=function(t,e,i,n){return new(i||(i=Promise))((function(s,r){function o(t){try{u(n.next(t))}catch(t){r(t)}}function a(t){try{u(n.throw(t))}catch(t){r(t)}}function u(t){var e;t.done?s(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(o,a)}u((n=n.apply(t,e||[])).next())}))};class _ extends f{constructor(t){super(),this.data=null,this.context=t}create(t,e){return E(this,void 0,void 0,(function*(){const i=this.context;return i.requires("caseId",t),i.rawQuery("/examinations",{method:"PUT",body:{case_id:t,app_id:e}})}))}query(t,e,i){return E(this,void 0,void 0,(function*(){return this.context.rawQuery("/examinations/query",{method:"PUT",body:t,query:{skip:e,limit:i}})}))}get(t){return E(this,void 0,void 0,(function*(){const e=this.context;return e.requires("examinationId",t),e.rawQuery(`/examinations/${t}`)}))}scope(t){return E(this,void 0,void 0,(function*(){const e=this.context;return e.requires("examinationId",t),e.rawQuery(`/examinations/${t}/scope`,{method:"PUT"})}))}}var $=function(t,e,i,n){return new(i||(i=Promise))((function(s,r){function o(t){try{u(n.next(t))}catch(t){r(t)}}function a(t){try{u(n.throw(t))}catch(t){r(t)}}function u(t){var e;t.done?s(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(o,a)}u((n=n.apply(t,e||[])).next())}))};class O extends v{constructor(t){super(),this.data=null,this.context=t}getRaw(){return $(this,void 0,void 0,(function*(){return this.data||(this.data=yield this.context.rawQuery("/app-ui-storage/user")),this.data}))}flush(){return $(this,void 0,void 0,(function*(){return this.data?yield this.context.rawQuery("/app-ui-storage/user",{method:"PUT",body:this.data}):null}))}get(t){return $(this,void 0,void 0,(function*(){const e=yield this.getRaw();return"string"==typeof e.content[t]?JSON.parse(e.content[t]):e.content[t]}))}set(t,e,i){return $(this,void 0,void 0,(function*(){const n=JSON.stringify(e),s=yield this.getRaw();s.content[t]=n,this.data=s,i&&this.flush()}))}erase(){return $(this,void 0,void 0,(function*(){this.data={content:{}},this.flush()}))}}var k=function(t,e,i,n){return new(i||(i=Promise))((function(s,r){function o(t){try{u(n.next(t))}catch(t){r(t)}}function a(t){try{u(n.throw(t))}catch(t){r(t)}}function u(t){var e;t.done?s(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(o,a)}u((n=n.apply(t,e||[])).next())}))};class A extends v{constructor(t){super(),this.context=t}query(t,e=!0){return k(this,void 0,void 0,(function*(){return yield this.context.rawQuery("/annotations/query",{method:"PUT",query:{with_classes:e},body:t})}))}get(t,e=!0){return k(this,void 0,void 0,(function*(){return yield this.context.rawQuery(`/annotations/${t}`,{query:{with_classes:e}})}))}createMany(t,e={}){return k(this,void 0,void 0,(function*(){return yield this.context.rawQuery("/annotations",{method:"POST",query:e,body:t})}))}create(t,e={}){return k(this,void 0,void 0,(function*(){return yield this.context.rawQuery("/annotations",{method:"POST",query:e,body:t})}))}deleteById(t){return k(this,void 0,void 0,(function*(){return yield this.context.rawQuery(`/annotations/${t}`,{method:"DELETE"})}))}delete(t){return k(this,void 0,void 0,(function*(){if(!t.id)throw"Cannot delete annotation without ID property!";const e=yield this.deleteById(t.id);if(t.classes)for(let e of t.classes)e.id&&(yield this.deleteClass(e.id));return e}))}update(t,e,i={}){return k(this,void 0,void 0,(function*(){return yield this.deleteById(t),!i.externalIds&&e.id&&(i.externalIds=!0),yield this.create(e,i)}))}addClass(t){return k(this,void 0,void 0,(function*(){return yield this.context.rawQuery("/classes",{method:"POST",body:t})}))}addClassMany(t){return k(this,void 0,void 0,(function*(){return yield this.context.rawQuery("/classes",{method:"POST",body:t})}))}getClass(t){return k(this,void 0,void 0,(function*(){return yield this.context.rawQuery(`/classes/${t}`)}))}deleteClass(t){return k(this,void 0,void 0,(function*(){return yield this.context.rawQuery(`/classes/${t}`,{method:"DELETE"})}))}queryClasses(t){return k(this,void 0,void 0,(function*(){return yield this.context.rawQuery("/classes/query",{method:"PUT",body:t})}))}}var U=function(t,e,i,n){return new(i||(i=Promise))((function(s,r){function o(t){try{u(n.next(t))}catch(t){r(t)}}function a(t){try{u(n.throw(t))}catch(t){r(t)}}function u(t){var e;t.done?s(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(o,a)}u((n=n.apply(t,e||[])).next())}))};class N extends v{constructor(t){super(),this.data=null,this.context=t}get(t){return U(this,void 0,void 0,(function*(){return yield this.context.rawQuery(`/collections/${t}`)}))}create(t){return U(this,void 0,void 0,(function*(){return yield this.context.rawQuery("/collections",{method:"POST",body:t})}))}delete(t){return U(this,void 0,void 0,(function*(){yield this.context.rawQuery(`/collections/${t}`,{method:"DELETE"})}))}queryItems(t,e){return U(this,void 0,void 0,(function*(){return yield this.context.rawQuery(`/collections/${t}/items/query`,{method:"PUT",body:e})}))}createItems(t,e){return U(this,void 0,void 0,(function*(){yield this.context.rawQuery(`/collections/${t}/items`,{method:"POST",body:Object.assign({},e)})}))}deleteItem(t,e){return U(this,void 0,void 0,(function*(){yield this.context.rawQuery(`/collections/${t}/items/${e}`,{method:"DELETE"})}))}}var j=function(t,e,i,n){return new(i||(i=Promise))((function(s,r){function o(t){try{u(n.next(t))}catch(t){r(t)}}function a(t){try{u(n.throw(t))}catch(t){r(t)}}function u(t){var e;t.done?s(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(o,a)}u((n=n.apply(t,e||[])).next())}))};class D extends v{constructor(t){super(),this.data=null,this.context=t}getJobs(){return j(this,void 0,void 0,(function*(){return(yield this.context.rawQuery("/jobs")).items}))}get(t){return j(this,void 0,void 0,(function*(){return yield this.context.rawQuery(`/jobs/${t}`)}))}}var R=function(t,e,i,n){return new(i||(i=Promise))((function(s,r){function o(t){try{u(n.next(t))}catch(t){r(t)}}function a(t){try{u(n.throw(t))}catch(t){r(t)}}function u(t){var e;t.done?s(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(o,a)}u((n=n.apply(t,e||[])).next())}))};class Q extends v{constructor(t){super(),this.data=null,this.context=t}get(t){return R(this,void 0,void 0,(function*(){return yield this.context.rawQuery(`/pixelmaps/${t}`)}))}post(t){return R(this,void 0,void 0,(function*(){return yield this.context.rawQuery("/pixelmaps",{method:"POST",body:t})}))}delete(t){return R(this,void 0,void 0,(function*(){return yield this.context.rawQuery(`/pixelmaps/${t}`,{method:"DELETE"})}))}query(t){return R(this,void 0,void 0,(function*(){return(yield this.context.rawQuery("/pixelmaps/query",{method:"PUT",body:t})).items}))}getTile(t,e,i,n){return R(this,void 0,void 0,(function*(){return yield this.context.rawQuery(`/pixelmaps/${t}/level/${e}/position/${i}/${n}/data`,{responseType:"blob"})}))}uploadTile(t,e,i,n,s){return R(this,void 0,void 0,(function*(){return yield this.context.rawQuery(`/pixelmaps/${t}/level/${e}/position/${i}/${n}/data`,{method:"PUT",body:s})}))}deleteTile(t,e,i,n){return R(this,void 0,void 0,(function*(){return yield this.context.rawQuery(`/pixelmaps/${t}/level/${e}/position/${i}/${n}/data`,{method:"DELETE"})}))}bulkGetTile(t,e,i,n,s,r){return R(this,void 0,void 0,(function*(){return yield this.context.rawQuery(`/pixelmaps/${t}/level/${e}/position/start/${i}/${n}/end/${s}/${r}/data`,{responseType:"blob"})}))}bulkUploadTile(t,e,i,n,s,r,o){return R(this,void 0,void 0,(function*(){return yield this.context.rawQuery(`/pixelmaps/${t}/level/${e}/position/start/${i}/${n}/end/${s}/${r}/data`,{method:"PUT",body:o})}))}}var q=function(t,e,i,n){return new(i||(i=Promise))((function(s,r){function o(t){try{u(n.next(t))}catch(t){r(t)}}function a(t){try{u(n.throw(t))}catch(t){r(t)}}function u(t){var e;t.done?s(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(o,a)}u((n=n.apply(t,e||[])).next())}))};class M extends y{constructor(t){super(),this.scopeContext=null,this._defaultExaminationId="",this._tokenRefetchInterval=null,this.activeExaminationId="",this.activeCaseId="",this.activeAppId="",this.context=t,this.raw=new a(this.context.options.apiUrl+M.apiPath),this.storage=new O(this),this.annotations=new A(this),this.collections=new N(this),this.jobs=new D(this),this.pixelmaps=new Q(this)}use(t,e=void 0){return q(this,void 0,void 0,(function*(){this.requires("root::userId",this.context.userId);const i=e=>q(this,void 0,void 0,(function*(){let i=yield this.context.examinations.query({apps:[e],creators:[this.context.userId]});if(i.item_count>0){let t=i.items.find((t=>"OPEN"===t.state));if(t)return t}return yield this.context.examinations.create(t,e)}));let n;if(e?n=yield i(e):this._defaultExaminationId&&(n=yield this.context.examinations.get(this._defaultExaminationId)),!n){let t=yield this.context.apps.default();n=yield i(t.app_id),this._defaultExaminationId=n.id}yield this.from(n)}))}get scopeToken(){var t;return(null===(t=this.scopeContext)||void 0===t?void 0:t.access_token)||""}get id(){var t;return(null===(t=this.scopeContext)||void 0===t?void 0:t.scope_id)||""}from(t){return q(this,void 0,void 0,(function*(){this.reset(),this.scopeContext=yield this.context.examinations.scope(t.id),this.activeCaseId=t.case_id,this.activeAppId=t.app_id,this.activeExaminationId=t.id;const e=c(d(this.scopeContext.access_token));this._tokenRefetchInterval=setInterval((()=>q(this,void 0,void 0,(function*(){this.scopeContext=yield this.context.examinations.scope(t.id)}))),e),this.raiseEvent("init")}))}reset(){this.activeExaminationId="",this.scopeContext=null,this._tokenRefetchInterval&&(clearInterval(this._tokenRefetchInterval),this._tokenRefetchInterval=null,this.raiseEvent("reset"))}rawQuery(t,e){var i,n;return q(this,void 0,void 0,(function*(){this.requires("this.scopeContext",this.scopeContext),(e=e||{}).headers=e.headers||{},e.headers.Authorization=`Bearer ${null===(i=this.scopeContext)||void 0===i?void 0:i.access_token}`,t&&!t.startsWith("/")&&(t=`/${t}`);try{return yield this.raw.http(`/${null===(n=this.scopeContext)||void 0===n?void 0:n.scope_id}${t}`,e)}catch(i){if(401===i.statusCode)return this.scopeContext=yield this.context.examinations.scope(this.activeExaminationId),yield this.raw.http(`/${this.scopeContext.scope_id}${t}`,e);throw i}}))}}M.apiPath="/v3/scopes";const J=M;var H,L,V,F=function(t,e,i,n){return new(i||(i=Promise))((function(s,r){function o(t){try{u(n.next(t))}catch(t){r(t)}}function a(t){try{u(n.throw(t))}catch(t){r(t)}}function u(t){var e;t.done?s(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(o,a)}u((n=n.apply(t,e||[])).next())}))};class B extends f{constructor(t){super(),this.data=null,this.context=t}slideInfo(t){return F(this,void 0,void 0,(function*(){return yield this.context.rawQuery(`/slides/${t}/info`)}))}slideThumbnail(t,e,i,n){return F(this,void 0,void 0,(function*(){return yield this.context.rawQuery(`/slides/${t}/thumbnail/max_size/${e}/${i}`,{query:{image_format:n},responseType:"blob"})}))}slideLabel(t,e,i,n){return F(this,void 0,void 0,(function*(){return yield this.context.rawQuery(`/slides/${t}/label/max_size/${e}/${i}`,{query:{image_format:n},responseType:"blob"})}))}loadTile(t,e,i,n,s){return F(this,void 0,void 0,(function*(){return yield this.context.rawQuery(`/slides/${t}/tile/level/${e}/tile/${i}/${n}`,{query:{image_format:s},responseType:"blob"})}))}}!function(t){t.USER="user",t.SCOPE="scope",t.JOB="job"}(H||(H={})),function(t){t.ANNOTATION="annotation",t.COLLECTION="collection",t.CLASS="class",t.PRIMITIVE="primitive",t.WSI="wsi",t.CASE="case",t.USER="user",t.SCOPE="scope",t.JOB="job"}(L||(L={})),function(t){t.Background="background",t.Params="params",t.Shader="shader",t.Visualization="visualization"}(V||(V={}));var z=function(t,e,i,n){return new(i||(i=Promise))((function(s,r){function o(t){try{u(n.next(t))}catch(t){r(t)}}function a(t){try{u(n.throw(t))}catch(t){r(t)}}function u(t){var e;t.done?s(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(o,a)}u((n=n.apply(t,e||[])).next())}))};class W{constructor(t){this.data=null,this.defaultSlideMetadata={visualization:{}},this.defaultMaskMetadata={},this.context=t}getWsiMetadataItem(t,e=!0){return z(this,void 0,void 0,(function*(){let i=(yield this.context.query({references:[t]})).find((t=>t.data_type===(e?"slide":"mask")+"_metadata"));return i||(i=yield this.createWsiMetadataItem(t,e?this.defaultSlideMetadata:this.defaultMaskMetadata)),i}))}createWsiMetadataItem(t,e,i=!0){return z(this,void 0,void 0,(function*(){return yield this.context.createValue(e,`Metadata of ${i?"slide":"mask"} ${t}`,void 0,t,L.WSI,(i?"slide":"mask")+"_metadata")}))}getSlideMetadata(t){return z(this,void 0,void 0,(function*(){return JSON.parse((yield this.getWsiMetadataItem(t)).value)}))}updateSlideMetadata(t,e){return z(this,void 0,void 0,(function*(){const i=yield this.getWsiMetadataItem(t);try{const t=yield this.context.update(i.id,Object.assign(Object.assign({},i),{value:JSON.stringify(e)}));return JSON.parse(t.value)}catch(t){return!1}}))}getShadersConfig(t){return z(this,void 0,void 0,(function*(){const e={};for(let i=0;iz(this,void 0,void 0,(function*(){return Object.assign(Object.assign({},yield this.context.visTemplates.getTemplate(V.Visualization,t.visTemplate)),{name:t.name,shaders:yield this.getShadersConfig(t.shaders)})}))))))}}))}getMaskMetadata(t){return z(this,void 0,void 0,(function*(){return JSON.parse((yield this.getWsiMetadataItem(t,!1)).value)}))}}var G=function(t,e,i,n){return new(i||(i=Promise))((function(s,r){function o(t){try{u(n.next(t))}catch(t){r(t)}}function a(t){try{u(n.throw(t))}catch(t){r(t)}}function u(t){var e;t.done?s(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(o,a)}u((n=n.apply(t,e||[])).next())}))};const K="vis_templates";class Y{constructor(t){this.data=null,this.context=t}fetchTemplateItem(t,e){return G(this,void 0,void 0,(function*(){return(yield this.context.query({references:[null],data_types:[`${K}_${t}`]})).find((t=>t.name===e))}))}getTemplate(t,e){return G(this,void 0,void 0,(function*(){const i=yield this.fetchTemplateItem(t,e);return!!i&&JSON.parse(i.value)}))}createTemplate(t,e,i){return G(this,void 0,void 0,(function*(){return!(yield this.fetchTemplateItem(t,e))&&(yield this.context.createValue(i,`${e}`,void 0,void 0,void 0,`${K}_${t}`))}))}deleteTemplate(t,e){return G(this,void 0,void 0,(function*(){const i=yield this.fetchTemplateItem(t,e);return!!i&&(yield this.context.delete(i.id),!0)}))}}var X=function(t,e,i,n){return new(i||(i=Promise))((function(s,r){function o(t){try{u(n.next(t))}catch(t){r(t)}}function a(t){try{u(n.throw(t))}catch(t){r(t)}}function u(t){var e;t.done?s(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(o,a)}u((n=n.apply(t,e||[])).next())}))};class Z{constructor(t){this.data=null,this.presetDataType="annot_presets",this.context=t}use(t){this.presetDataType=t}getPresetsItem(t=!1){return X(this,void 0,void 0,(function*(){if(!this.data||t){let t=(yield this.context.query({references:[null],data_types:[this.presetDataType]})).find((t=>!0));t||(t=yield this.createPresetsItem({presets:[]})),this.data=t}return this.data}))}createPresetsItem(t){return X(this,void 0,void 0,(function*(){return yield this.context.createValue(t,"Global annotation presets",void 0,void 0,void 0,this.presetDataType)}))}getAnnotPresets(t=!1){return X(this,void 0,void 0,(function*(){const e=yield this.getPresetsItem(t);return{presets:JSON.parse(e.value).presets,lastModifiedAt:e.modified_at}}))}mergePresets(t,e,i){const n=[...t];return e.forEach((t=>n.some((e=>e.id===t.id))||!t.createdAt||t.createdAt<=i?null:n.push(t))),n}updateAnnotPresets(t,e,i=!1){return X(this,void 0,void 0,(function*(){const n=yield this.getPresetsItem(!0),s=JSON.parse(n.value).presets;let r=t,o=!0;if(n.modified_at!==e){if(i)return{presets:s,successfulUpdate:!1,lastModifiedAt:n.modified_at};r=this.mergePresets(s,r,e),o=!1}try{const t=yield this.context.update(n.id,Object.assign(Object.assign({},n),{value:JSON.stringify({presets:r})}));return{presets:JSON.parse(t.value).presets,successfulUpdate:o,lastModifiedAt:t.modified_at}}catch(t){if(409===t.statusCode){const t=yield this.updateAnnotPresets(r,n.modified_at);return Object.assign(Object.assign({},t),{successfulUpdate:o})}throw t}}))}deleteAnnotPresets(){return X(this,void 0,void 0,(function*(){const t=yield this.getPresetsItem(!0);yield this.context.delete(t.id),this.data=null}))}}var tt=function(t,e,i,n){return new(i||(i=Promise))((function(s,r){function o(t){try{u(n.next(t))}catch(t){r(t)}}function a(t){try{u(n.throw(t))}catch(t){r(t)}}function u(t){var e;t.done?s(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(o,a)}u((n=n.apply(t,e||[])).next())}))};class et{constructor(t){this.data=null,this.configDataType="app_job_config",this.context=t}use(t){this.configDataType=t}fetchJobConfigItem(t){return tt(this,void 0,void 0,(function*(){return(yield this.context.query({references:[t],data_types:[this.configDataType]})).find(Boolean)}))}getJobConfig(t){return tt(this,void 0,void 0,(function*(){const e=yield this.fetchJobConfigItem(t);return!!e&&JSON.parse(e.value)}))}createJobConfig(t,e){return tt(this,void 0,void 0,(function*(){return!(yield this.fetchJobConfigItem(t))&&(yield this.context.createValue(e,"Job config of App",void 0,t,L.JOB,this.configDataType))}))}deleteJobConfig(t){return tt(this,void 0,void 0,(function*(){const e=yield this.fetchJobConfigItem(t);return!!e&&(yield this.context.delete(e.id),!0)}))}}var it=function(t,e,i,n){return new(i||(i=Promise))((function(s,r){function o(t){try{u(n.next(t))}catch(t){r(t)}}function a(t){try{u(n.throw(t))}catch(t){r(t)}}function u(t){var e;t.done?s(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(o,a)}u((n=n.apply(t,e||[])).next())}))};class nt{constructor(t){this.data=null,this.context=t,this.wsiMetadata=new W(this),this.visTemplates=new Y(this),this.annotPresets=new Z(this),this.jobConfig=new et(this)}get(t){return it(this,void 0,void 0,(function*(){return yield this.context.rawQuery(`/global-storage/${t}`)}))}getValue(t){return it(this,void 0,void 0,(function*(){const e=yield this.get(t);if("string"===e.type)try{return JSON.parse(e.value)}catch(t){return e.value}return e.value}))}query(t){return it(this,void 0,void 0,(function*(){return(yield this.context.rawQuery("/global-storage/query",{method:"PUT",body:t})).items}))}create(t){return it(this,void 0,void 0,(function*(){return yield this.context.rawQuery("/global-storage",{method:"POST",body:t})}))}createValue(t,e,i,n,s,r){return it(this,void 0,void 0,(function*(){t=JSON.stringify(t);const o={name:e,description:i,creator_id:this.context.userId,creator_type:H.USER,reference_id:n,reference_type:s,type:"string",value:t,data_type:r};return yield this.create(o)}))}update(t,e){return it(this,void 0,void 0,(function*(){return yield this.context.rawQuery(`/global-storage/${t}`,{method:"PUT",body:e})}))}updateValue(t,e){return it(this,void 0,void 0,(function*(){const i=yield this.context.rawQuery(`/global-storage/${t}`);return i.value=JSON.stringify(e),yield this.context.rawQuery(`/global-storage/${t}`,{method:"PUT",body:i})}))}delete(t){return it(this,void 0,void 0,(function*(){yield this.context.rawQuery(`/global-storage/${t}`,{method:"DELETE"})}))}}class st{constructor(t){this.context=t,this.globalStorage=new nt(this)}get userId(){return this.context.userId}rawQuery(t,e={}){return i=this,n=void 0,r=function*(){return this.context.rawQuery(`${st.relativeApiPath}${t}`,e)},new((s=void 0)||(s=Promise))((function(t,e){function o(t){try{u(r.next(t))}catch(t){e(t)}}function a(t){try{u(r.throw(t))}catch(t){e(t)}}function u(e){var i;e.done?t(e.value):(i=e.value,i instanceof s?i:new s((function(t){t(i)}))).then(o,a)}u((r=r.apply(i,n||[])).next())}));var i,n,s,r}}st.relativeApiPath="/rationai";const rt=st;class ot{constructor(t){if(void 0===t._context)throw Error("Private property not configured.");this.context=t._context,this.props=t}translatePathSpec(t,e){return i=this,n=void 0,r=function*(){return e},new((s=void 0)||(s=Promise))((function(t,e){function o(t){try{u(r.next(t))}catch(t){e(t)}}function a(t){try{u(r.throw(t))}catch(t){e(t)}}function u(e){var i;e.done?t(e.value):(i=e.value,i instanceof s?i:new s((function(t){t(i)}))).then(o,a)}u((r=r.apply(i,n||[])).next())}));var i,n,s,r}}var at=function(t,e,i,n){return new(i||(i=Promise))((function(s,r){function o(t){try{u(n.next(t))}catch(t){r(t)}}function a(t){try{u(n.throw(t))}catch(t){r(t)}}function u(t){var e;t.done?s(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(o,a)}u((n=n.apply(t,e||[])).next())}))};class ut{constructor(){throw Error("Not instantiable.")}static register(t,e){return this.items.set(t,e),e}static get(t){return this.items.get(t)}}ut.items=new Map;const ct=ut;ct.register("default",ot),ct.register("lsaai",class extends ot{translatePathSpec(t,e){return at(this,void 0,void 0,(function*(){return this.context.accessToken&&this.props.userinfo?(this.userData||(yield this.parseUserInstitutionsAndProjects()),"id_part_1"===t?this.userData.institutions[e]||e:"id_part_2"===t&&this.userData.projects[e]||e):e}))}parseGroupName(t){if(!t)return{name:t,slug:t};const e=(t=decodeURIComponent(t).trim()).match(/^(.+)\.\s*([^.\s]{1,5})$/);return e&&3===e.length?{name:e[1].trim(),slug:e[2].trim()}:t.length>5?(console.warn("Invalid group name",t),{}):{name:t,slug:t}}parseUserInstitutionsAndProjects(){var t;return at(this,void 0,void 0,(function*(){const e=yield fetch(this.props.userinfo,{headers:{Authorization:`Bearer ${this.context.accessToken}`}}),i=yield e.text();if(!e.ok)throw new Error(`Failed to fetch user info! ${e.statusText}. ${i}`);const n=JSON.parse(i),s=this.userData={projects:{"":{label:"NO PROJECT",value:"",rights:["write"]}},institutions:{"":{label:"PUBLIC DATA",value:""}}};try{const e=n.eduperson_entitlement;if(e)for(const i of e){const e=i.match(/^.*?:group:ration_ai:([^#\n]*)/);if(e&&e.length>1){const i=null===(t=e[1])||void 0===t?void 0:t.split(":");if(i){const t=i.length,e=this.parseGroupName(i[0]),n=this.parseGroupName(t>1?i[1]:""),r=this.parseGroupName(t>2?i[2]:null);n.slug&&!s.institutions[n.slug]&&(s.institutions[n.slug]={label:n.name,value:n.slug}),e.slug&&!s.projects[e.slug]?s.projects[e.slug]={label:e.name,value:e.slug,rights:r?[r]:[]}:r&&e.slug&&s.projects[e.slug].rights.push(r.slug)}}else console.warn("Ignored entitlement",i)}else console.warn("User info data does not contain access information! Is OAUTH scope set correctly?")}catch(t){console.warn("Could not decide user authorization capabilities!",t)}}))}});var dt=function(t,e,i,n){return new(i||(i=Promise))((function(s,r){function o(t){try{u(n.next(t))}catch(t){r(t)}}function a(t){try{u(n.throw(t))}catch(t){r(t)}}function u(t){var e;t.done?s(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(o,a)}u((n=n.apply(t,e||[])).next())}))};class ht extends p{constructor(t){super(t),this.defaultScopeKey="",this.version="v3",this.rootURI=this.options.apiUrl+ht.apiPath,this.raw=new a(this.rootURI),t.integrationOptions||(t.integrationOptions={}),t.integrationOptions._context=this;const e=t.integrationOptions.implementation||"default",i=ct.get(e);if(!i)throw new Error(`Could not instantiate integration provider ${e} - is it a valid name?`);this.integration=new i(t.integrationOptions),this.apps=new g(this),this.cases=new C(this),this.examinations=new _(this),this.slides=new B(this),this.rationai=new rt(this),this.scopes=new Map}get defaultScope(){return this.scopes.get(this.defaultScopeKey)}newScopeFrom(t){return dt(this,void 0,void 0,(function*(){const e=new J(this);return yield e.from(t),this.scopes.set(t.id,e),""===this.defaultScopeKey&&(this.defaultScopeKey=t.id),e}))}newScopeUse(t,e){return dt(this,void 0,void 0,(function*(){const i=new J(this);return yield i.use(t,e),this.scopes.set(i.activeExaminationId,i),""===this.defaultScopeKey&&(this.defaultScopeKey=i.activeExaminationId),i}))}getScopeFrom(t){return dt(this,void 0,void 0,(function*(){return this.scopes.get(t.id)||(yield this.newScopeFrom(t))}))}getScopeUse(t,e){return dt(this,void 0,void 0,(function*(){const i=[...this.scopes.values()].filter((i=>i.activeCaseId===t&&(!e||i.activeAppId===e)));return i.length>0?i[0]:yield this.newScopeUse(t,e)}))}rawQuery(t,e={}){const i=Object.create(null,{rawQuery:{get:()=>super.rawQuery}});return dt(this,void 0,void 0,(function*(){return yield i.rawQuery.call(this,t,e),(e=e||{}).headers=e.headers||{},e.headers["User-Id"]=this.userId,this.accessToken&&(e.headers.Authorization=e.headers.Authorization||`Bearer ${this.rawToken}`),this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SxcclxuICAgICAgICBkYXRhOiBzbGlkZVZpcy5iYWNrZ3JvdW5kICYmIHNsaWRlVmlzLmJhY2tncm91bmQuZGF0YVJlZixcclxuICAgICAgfSxcclxuICAgICAgdmlzdWFsaXphdGlvbnM6XHJcbiAgICAgICAgc2xpZGVWaXMudmlzdWFsaXphdGlvbnMgJiZcclxuICAgICAgICAoYXdhaXQgUHJvbWlzZS5hbGwoXHJcbiAgICAgICAgICBzbGlkZVZpcy52aXN1YWxpemF0aW9ucy5tYXAoYXN5bmMgKHZpcykgPT4ge1xyXG4gICAgICAgICAgICByZXR1cm4ge1xyXG4gICAgICAgICAgICAgIC4uLihhd2FpdCB0aGlzLmNvbnRleHQudmlzVGVtcGxhdGVzLmdldFRlbXBsYXRlKFxyXG4gICAgICAgICAgICAgICAgVGVtcGxhdGVUeXBlLlZpc3VhbGl6YXRpb24sXHJcbiAgICAgICAgICAgICAgICB2aXMudmlzVGVtcGxhdGUsXHJcbiAgICAgICAgICAgICAgKSksXHJcbiAgICAgICAgICAgICAgbmFtZTogdmlzLm5hbWUsXHJcbiAgICAgICAgICAgICAgc2hhZGVyczogYXdhaXQgdGhpcy5nZXRTaGFkZXJzQ29uZmlnKHZpcy5zaGFkZXJzKSxcclxuICAgICAgICAgICAgfTtcclxuICAgICAgICAgIH0pLFxyXG4gICAgICAgICkpLFxyXG4gICAgfTtcclxuICAgIHJldHVybiB2aXN1YWxpemF0aW9ucztcclxuICB9XHJcblxyXG4gIC8vIE1BU0tcclxuXHJcbiAgLyoqXHJcbiAgICogR2V0IG1ldGFkYXRhIG9mIG1hc2sgV1NJLlxyXG4gICAqIEBwYXJhbSBzbGlkZUlkIElEIG9mIG1hc2sgV1NJXHJcbiAgICovXHJcbiAgYXN5bmMgZ2V0TWFza01ldGFkYXRhKG1hc2tJZDogc3RyaW5nKTogUHJvbWlzZTxNYXNrTWV0YWRhdGE+IHtcclxuICAgIHJldHVybiBKU09OLnBhcnNlKFxyXG4gICAgICAoYXdhaXQgd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WU6IG5hbWUsIHNsdWc6IG5hbWUgfVxyXG4gICAgICAgIG5hbWUgPSBkZWNvZGVVUklDb21wb25lbnQobmFtZSkudHJpbSgpXHJcbiAgICAgICAgY29uc3QgbWF0Y2ggPSBuYW1lLm1hdGNoKC9eKC4rKVxcLlxccyooW14uXFxzXXsxLDV9KSQvKVxyXG4gICAgICAgIGlmIChtYXRjaCAmJiBtYXRjaC5sZW5ndGggPT09IDMpIHtcclxuICAgICAgICAgICAgcmV0dXJuIHsgbmFtZTogbWF0Y2hbMV0udHJpbSgpLCBzbHVnOiBtYXRjaFsyXS50cmltKCkgfVxyXG4gICAgICAgIH1cclxuICAgICAgICBpZiAobmFtZS5sZW5ndGggPiA1KSB7XHJcbiAgICAgICAgICAgIGNvbnNvbGUud2FybignSW52YWxpZCBncm91cCBuYW1lJywgbmFtZSlcclxuICAgICAgICAgICAgcmV0dXJuIHt9XHJcbiAgICAgICAgfVxyXG4gICAgICAgIHJldHVybiB7IG5hbWU6IG5hbWUsIHNsdWc6IG5hbWUgfVxyXG4gICAgfVxyXG5cclxuICAgIHByaXZhdGUgYXN5bmMgcGFyc2VVc2VySW5zdGl0dXRpb25zQW5kUHJvamVjdHMgKCkge1xyXG4gICAgICAgIGNvbnN0IHJlc3BvbnNlID0gYXdhaXQgZmV0Y2godGhpcy5wcm9wcy51c2VyaW5mbywge1xyXG4gICAgICAgICAgICBoZWFkZXJzOiB7XHJcbiAgICAgICAgICAgICAgICAnQXV0aG9yaXphdGlvbic6IGBCZWFyZXIgJHt0aGlzLmNvbnRleHQuYWNjZXNzVG9rZW59YFxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfSk7XHJcblxyXG4gICAgICAgIGNvbnN0IGRhdGEgPSBhd2FpdCByZXNwb25zZS50ZXh0KCk7XHJcbiAgICAgICAgaWYgKCFyZXNwb25zZS5vaykge1xyXG4gICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoYEZhaWxlZCB0byBmZXRjaCB1c2VyIGluZm8hICR7cmVzcG9uc2Uuc3RhdHVzVGV4dH0uICR7ZGF0YX1gKTtcclxuICAgICAgICB9XHJcbiAgICAgICAgY29uc3QgcGFyc2VkRGF0YSA9IEpTT04ucGFyc2UoZGF0YSk7XHJcblxyXG5cclxuICAgICAgICBjb25zdCByZXN1bHQgPSB0aGlzLnVzZXJEYXRhID0ge1xyXG4gICAgICAgICAgICBwcm9qZWN0czoge1xyXG4gICAgICAgICAgICAgICAgJyc6IHsgbGFiZWw6ICdOTyBQUk9KRUNUJywgdmFsdWU6ICcnLCByaWdodHM6IFsnd3JpdGUnXSB9XHJcbiAgICAgICAgICAgIH0sXHJcbiAgICAgICAgICAgIGluc3RpdHV0aW9uczoge1xyXG4gICAgICAgICAgICAgICAgJyc6IHsgbGFiZWw6ICdQVUJMSUMgREFUQScsIHZhbHVlOiAnJ31cclxuXHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9O1xyXG5cclxuICAgICAgICB0cnkge1xyXG4gICAgICAgICAgICBjb25zdCBlbnRpdGxlbWVudHMgPSBwYXJzZWREYXRhLmVkdXBlcnNvbl9lbnRpdGxlbWVudFxyXG4gICAgICAgICAgICBpZiAoZW50aXRsZW1lbnRzKSB7XHJcbiAgICAgICAgICAgICAgICAvLyBQYXJzZSBBQVJDRzA2OSBmb3IgZ3JvdXBzXHJcbiAgICAgICAgICAgICAgICBmb3IgKGNvbnN0IHJ1bGUgb2YgZW50aXRsZW1lbnRzKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgLy8gcGFyc2UgZ3JvdXAgKGluc3RpdHV0aW9uKSBoaWVyYXJjaHkgKHRvZG8gaGFyZGNvZGVkIC0gZW52ID8pXHJcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgbWF0Y2ggPSBydWxlLm1hdGNoKC9eLio/Omdyb3VwOnJhdGlvbl9haTooW14jXFxuXSopLylcclxuICAgICAgICAgICAgICAgICAgICBpZiAobWF0Y2ggJiYgbWF0Y2gubGVuZ3RoID4gMSkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBncm91cHMgPSBtYXRjaFsxXT8uc3BsaXQoJzonKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoZ3JvdXBzKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBsZW5ndGggPSBncm91cHMubGVuZ3RoLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHByb2plY3QgPSB0aGlzLnBhcnNlR3JvdXBOYW1lKGdyb3Vwc1swXSksXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb3JnYW5pemF0aW9uID0gdGhpcy5wYXJzZUdyb3VwTmFtZShsZW5ndGggPiAxID8gZ3JvdXBzWzFdIDogJycpLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJpZ2h0cyA9IHRoaXMucGFyc2VHcm91cE5hbWUobGVuZ3RoID4gMiA/IGdyb3Vwc1syXSA6IG51bGwpXHJcblxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG9yZ2FuaXphdGlvbi5zbHVnICYmICFyZXN1bHQuaW5zdGl0dXRpb25zW29yZ2FuaXphdGlvbi5zbHVnXSkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlc3VsdC5pbnN0aXR1dGlvbnNbb3JnYW5pemF0aW9uLnNsdWddID0ge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsYWJlbDogb3JnYW5pemF0aW9uLm5hbWUsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlOiBvcmdhbml6YXRpb24uc2x1Z1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChwcm9qZWN0LnNsdWcgJiYgIXJlc3VsdC5wcm9qZWN0c1twcm9qZWN0LnNsdWddKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVzdWx0LnByb2plY3RzW3Byb2plY3Quc2x1Z10gPSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxhYmVsOiBwcm9qZWN0Lm5hbWUsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlOiBwcm9qZWN0LnNsdWcsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJpZ2h0czogcmlnaHRzID8gW3JpZ2h0c10gOiBbXVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH07XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHJpZ2h0cyAmJiBwcm9qZWN0LnNsdWcpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXN1bHQucHJvamVjdHNbcHJvamVjdC5zbHVnXS5yaWdodHMucHVzaChyaWdodHMuc2x1Zyk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBjb25zb2xlLndhcm4oJ0lnbm9yZWQgZW50aXRsZW1lbnQnLCBydWxlKVxyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIH1cclxuXHJcbiAgICAgICAgICAgIH0gZWxzZSB7XHJcbiAgICAgICAgICAgICAgICBjb25zb2xlLndhcm4oJ1VzZXIgaW5mbyBkYXRhIGRvZXMgbm90IGNvbnRhaW4gYWNjZXNzIGluZm9ybWF0aW9uISBJcyBPQVVUSCBzY29wZSBzZXQgY29ycmVjdGx5PycpXHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9IGNhdGNoIChlKSB7XHJcbiAgICAgICAgICAgIGNvbnNvbGUud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x1ZyIsImRlY29kZVVSSUNvbXBvbmVudCIsInRyaW0iLCJ0ZXh0IiwicGFyc2VkRGF0YSIsImxhYmVsIiwicmlnaHRzIiwiZW50aXRsZW1lbnRzIiwiZWR1cGVyc29uX2VudGl0bGVtZW50IiwicnVsZSIsInByb2plY3QiLCJvcmdhbml6YXRpb24iLCJSb290IiwidmVyc2lvbiIsInJvb3RVUkkiLCJpbnRlZ3JhdGlvbk9wdGlvbnMiLCJwcm92aWRlciIsImltcGxlbWVudGF0aW9uIiwiSW50ZWdyYXRpb25DbGFzcyIsInJhdGlvbmFpIiwiZGVmYXVsdFNjb3BlIiwibmV3U2NvcGVGcm9tIiwibmV3U2NvcGVVc2UiLCJnZXRTY29wZUZyb20iLCJnZXRTY29wZVVzZSIsIm1hdGNoaW5nU2NvcGVzIl0sInNvdXJjZVJvb3QiOiIifQ== diff --git a/plugins/annotations/annotationsGUI.js b/plugins/annotations/annotationsGUI.js index 176f7602..ad74565a 100644 --- a/plugins/annotations/annotationsGUI.js +++ b/plugins/annotations/annotationsGUI.js @@ -3,8 +3,6 @@ class AnnotationsGUI extends XOpatPlugin { //todo test with multiple swap bgimages constructor(id) { super(id); - - this._server = this.getStaticMeta("server"); this._ioArgs = this.getStaticMeta("convertors") || {}; this._defaultFormat = this._ioArgs.format || "native"; this.registerAsEventSource(); @@ -86,6 +84,9 @@ class AnnotationsGUI extends XOpatPlugin { } this.enablePresetModify = this.getOptionOrConfiguration('enablePresetModify', 'enablePresetModify', true); + if (this.getOption("edgeCursorNavigate", true)) { + this.context.setCloseEdgeMouseNavigation(true); + } } setupActiveTissue(bgImageConfigObject) { @@ -104,8 +105,13 @@ class AnnotationsGUI extends XOpatPlugin { *****************************************************************************************************************/ - setDrawOutline(drawOutline) { - this.context.setAnnotationCommonVisualProperty('modeOutline', drawOutline); + setDrawOutline(enable) { + this.context.setAnnotationCommonVisualProperty('modeOutline', enable); + } + + setEdgeCursorNavigate(enable) { + this.setOption("edgeCursorNavigate", enable); + this.context.setCloseEdgeMouseNavigation(enable); } initHTML() { @@ -123,7 +129,7 @@ onclick="${this.THIS}._toggleEnabled(this)">visibility //
`, `
-
Border
+
Border
${UIComponents.Elements.checkBox({ label: this.t('outlineOnly'), classes: "pl-2", @@ -131,7 +137,13 @@ ${UIComponents.Elements.checkBox({ default: this.context.getAnnotationCommonVisualProperty('modeOutline')})}
-
Opacity
+
Opacity +${UIComponents.Elements.checkBox({ + label: 'Enable edge navigation', + classes: "pl-2", + onchange: `${this.THIS}.setEdgeCursorNavigate(!!this.checked)`, + default: this.getOption("edgeCursorNavigate", true)})} +
@@ -838,17 +850,27 @@ style="height: 22px; width: 60px;" onchange="${this.THIS}.context.freeFormTool.s }); } + /** + * Export annotations for one-time state save + * @param preferredFormat + * @param withObjects + * @param withPresets + * @return {Promise<*>} + */ + async getExportData(preferredFormat = null, withObjects=true, withPresets=true) { + this._ioArgs.format = preferredFormat || this._defaultFormat; + return this.context.export(this._ioArgs, withObjects, withPresets); + } + /** * Export annotations and download them */ exportToFile(withObjects=true, withPresets=true) { - const toFormat = this.exportOptions.format || this._defaultFormat; - this._ioArgs.format = toFormat; - + const toFormat = this.exportOptions.format; const name = APPLICATION_CONTEXT.referencedName(true) + "-" + UTILITIES.todayISOReversed() + "-" + (withPresets && withObjects ? "all" : (withObjects ? "annotations" : "presets")) - this.context.export(this._ioArgs, withObjects, withPresets).then(result => { + this.getExportData(toFormat, withObjects, withPresets).then(result => { UTILITIES.downloadAsFile(name + this.context.getFormatSuffix(toFormat), result); }).catch(e => { Dialogs.show("Could not export annotations in the selected format.", 5000, Dialogs.MSG_WARN); @@ -1164,13 +1186,18 @@ class="btn m-2">Set for left click
`: '
Stored on a server${error}
`; } - saveDefault() { - if (!this._server) { + async saveDefault() { + this.needsSave = false; + await this.raiseAwaitEvent('save-annotations', { + getData: this.getExportData.bind(this), + setNeedsDownload: (needsDownload) => { + this.needsSave = needsDownload; + } + }) + + if (this.needsSave) { this.exportToFile(); - return; } - Dialogs.show("Server-side storage is in the process of implementation. Please, save the data locally for now."); - //todo server upload!!! } } diff --git a/plugins/annotations/include.json b/plugins/annotations/include.json index 6babeec9..9db4825f 100644 --- a/plugins/annotations/include.json +++ b/plugins/annotations/include.json @@ -8,8 +8,6 @@ "includes" : ["annotationsGUI.js", "preview.js"], "modules": ["annotations", "human-readable-ids"], "permaLoad": false, - //Annotation server API endpoint to store annotations at - "server": null, //Available annotation object types "factories": ["polygon", "rect", "ellipse", "ruler", "text"], //Windowed history + annotation list diff --git a/plugins/empaia/empaia.js b/plugins/empaia/empaia.js index cd3bb6eb..0f1ac1fb 100644 --- a/plugins/empaia/empaia.js +++ b/plugins/empaia/empaia.js @@ -1,13 +1,62 @@ addPlugin('empaia', class extends XOpatPlugin { constructor(id) { super(id); + + //known cases will be the only ones supported this.cases = this.getOption('cases', {}); this.defaultAppId = this.getOption('appId', null); + this.api = EmpationAPI.V3.get(); this._currentCaseId = this._currentAppId = this.scopeAPI = null; this.api.__scope_def = [null, null]; + this.integrateWithPlugin('gui_annotations', async plugin => { + plugin.addHandler('save-annotations', async e => { + const Convertor = OSDAnnotations.Convertor.get("empaia"); + const convertor = new Convertor(plugin.context, {}); + const empaiaTiledImage = VIEWER.scalebar.getReferencedTiledImage(); + + const promises = []; + try { + const slideId = VIEWER.scalebar.getReferencedTiledImage()?.source?.getEmpaiaId(); + const annotations = await this.scopeAPI.annotations.query({creators: [this.scopeAPI.id], references: [slideId]}); + + const currentAnnotations = plugin.context.filter(_ => true); + for (let annotation of annotations.items) { + const match = currentAnnotations.findIndex(e => e.id === annotation.id); + if (match >= 0) { + currentAnnotations.splice(match, 1); + //todo try to replace if not equal + } else { + //todo what if sent for saving before hit save? remember annotations in processing + promises.push(this.scopeAPI.annotations.delete(annotation)); + } + } + + await Promise.all(promises); + + for (let annotation of currentAnnotations) { + //todo what if sent for saving before hit save? remember annotations in processing + console.warn("Found annotations that are not uploaded properly by the event routine!"); + if (!annotation.npp_created) { + //todo when testing some annotation did not have npp_created property + annotation.npp_created = 1e6; + } + const toUpload = convertor.encodeSingleObject(annotation, empaiaTiledImage.source); + const annot = await this.scopeAPI.annotations.create(toUpload); + annotation.id = annot.id; + } + + e.setNeedsDownload(false); + Dialogs.show("Saved."); + } catch (ex) { + this.alertSaveFailed(); + e.setNeedsDownload(true); + console.error(ex); + } + }); + }); this.integrateWithSingletonModule('annotations', async module => { EmpationAPI.integrateWithAnnotations(module); @@ -25,48 +74,67 @@ addPlugin('empaia', class extends XOpatPlugin { //todo some queue that performs updates one by one? - // module.addHandler('annotation-create', async ev => { - // const empaiaTiledImage = VIEWER.scalebar.getReferencedTiledImage(); - // const annotation = convertor.encodeSingleObject(ev.object, empaiaTiledImage.source); - // const annot = await this.scopeAPI.annotations.create(annotation); - // ev.object.id = annot.id; - // }); - // module.addHandler('annotation-delete', ev => { - // if (!ev.object.id) { - // console.warn("NO ID!") - // } - // this.scopeAPI.annotations.deleteById(ev.object.id); - // }); - // module.addHandler('annotation-replace', async ev => { - // if (ev.previous) { - // if (!ev.previous.id) { - // console.warn("NO ID!") - // } - // this.scopeAPI.annotations.deleteById(ev.previous.id); - // } - // if (ev.next) { - // ev.next.npp_created = ev.previous.npp_created; - // const empaiaTiledImage = VIEWER.scalebar.getReferencedTiledImage(); - // const annotation = convertor.encodeSingleObject(ev.next, empaiaTiledImage.source); - // const annot = await this.scopeAPI.annotations.create(annotation); - // ev.object.id = annot.id; - // } - // }); - // module.addHandler('annotation-edit', ev => { - // if (!ev.object.id) { - // console.warn("NO ID!") - // } - // const empaiaTiledImage = VIEWER.scalebar.getReferencedTiledImage(); - // const annotation = convertor.encodeSingleObject(ev.object, empaiaTiledImage.source); - // this.scopeAPI.annotations.update(annotation); - // }); + module.addHandler('annotation-create', async ev => { + try { + const empaiaTiledImage = VIEWER.scalebar.getReferencedTiledImage(); + const annotation = convertor.encodeSingleObject(ev.object, empaiaTiledImage.source); + const annot = await this.scopeAPI.annotations.create(annotation); + ev.object.id = annot.id; + } catch (e) { + console.error(e); + } + }); + module.addHandler('annotation-delete', ev => { + if (!ev.object.id) { + console.warn("NO ID!") + return; + } + + try { + this.scopeAPI.annotations.deleteById(ev.object.id); + } catch (e) { + console.error(e); + } + }); + module.addHandler('annotation-replace', async ev => { + try { + if (ev.previous) { + if (!ev.previous.id) { + console.warn("NO ID!") + return; + } + this.scopeAPI.annotations.deleteById(ev.previous.id); + } + if (ev.next) { + ev.next.npp_created = ev.previous.npp_created; + const empaiaTiledImage = VIEWER.scalebar.getReferencedTiledImage(); + const annotation = convertor.encodeSingleObject(ev.next, empaiaTiledImage.source); + const annot = await this.scopeAPI.annotations.create(annotation); + ev.next.id = annot.id; + } + } catch (e) { + console.error(e); + } + }); + module.addHandler('annotation-edit', ev => { + try { + if (!ev.object.id) { + console.warn("NO ID!"); + } + const empaiaTiledImage = VIEWER.scalebar.getReferencedTiledImage(); + const annotation = convertor.encodeSingleObject(ev.object, empaiaTiledImage.source); + this.scopeAPI.annotations.update(annotation); + } catch (e) { + console.error(e); + } + }); }); } async refreshScope(module) { const bgId = APPLICATION_CONTEXT.referencedId(); if (!this.setActiveScope(bgId)) { - //todo warn! + this.alertLoadFailed(); } else { this.scopeAPI = await this.api.newScopeUse(this._currentCaseId, this._currentAppId); @@ -79,25 +147,43 @@ addPlugin('empaia', class extends XOpatPlugin { async stateChanged(module) { if (!this.scopeAPI) { + this.alertLoadFailed(); return; } - //todo clear? - //todo loading screen? const slideId = VIEWER.scalebar.getReferencedTiledImage()?.source?.getEmpaiaId(); if (!slideId) { - //todo error message + this.alertLoadFailed(); return; } + + let dialogTimeout = setTimeout(() => { + dialogTimeout = null; + Dialogs.show("", 5000, Dialogs.MSG_WARN); + }, 1000); try { const annotations = await this.scopeAPI.annotations.query({creators: [this.scopeAPI.id], references: [slideId]}); + // todo clear annotations from possibly previous state? module.import(annotations, {format: "empaia"}, true); } catch (e) { - //todo err - throw e; + this.alertLoadFailed(); + console.error(e); + } + if (dialogTimeout) { + clearTimeout(dialogTimeout); + } else { + Dialogs.hide(); } } + alertLoadFailed() { + Dialogs.show(`Failed to load annotations from the server! Please, try to reload the page."`) + } + + alertSaveFailed() { + Dialogs.show(`Failed to load annotations from the server! Please, keep the local file with your annotations. It can be used to import them manually.`) + } + setActiveScope(wsiID) { if (!wsiID) { return false; diff --git a/server/php/init.php b/server/php/init.php index cc241208..7b3ac2b7 100644 --- a/server/php/init.php +++ b/server/php/init.php @@ -37,7 +37,10 @@ function safeReadPostValue($val) { if (!is_string($val)) return $val; try { - return json_decode($val); + $parsed = json_decode($val); + if ((bool)$val && $parsed != null) { + return $parsed; + } } catch (Exception $e) { return $val; } diff --git a/src/app.js b/src/app.js index 466e5416..1d2840bd 100644 --- a/src/app.js +++ b/src/app.js @@ -570,7 +570,7 @@ function initXopat(PLUGINS, MODULES, ENV, POST_DATA, PLUGINS_FOLDER, MODULES_FOL const magMicrons = microns || (micronsX + micronsY) / 2; // todo try read metadata about magnification and warn if we try to guess - const values = [70, 2, 15, 5, 7, 10, 0.5, 20, 0.25, 40]; + const values = [2.4, 2, 1.2, 4, 0.6, 10, 0.3, 20, 0.15, 40]; let index = 0, best = Infinity, mag; if (magMicrons) { while (index < values.length) { @@ -1241,8 +1241,14 @@ function initXopat(PLUGINS, MODULES, ENV, POST_DATA, PLUGINS_FOLDER, MODULES_FOL // Make sure the reference is really there POST_DATA.visualization = CONFIG; + // Clean up instance references before serialization + const plugins = {...PLUGINS}; + const modules = {...MODULES}; + for (let id in plugins) delete plugins[id].instance; + for (let id in modules) delete modules[id].instance; sessionStorage.setItem('__xopat_session__', JSON.stringify({ - PLUGINS, MODULES, ENV, POST_DATA, PLUGINS_FOLDER, MODULES_FOLDER, VERSION, I18NCONFIG + PLUGINS: plugins, MODULES: modules, + ENV, POST_DATA, PLUGINS_FOLDER, MODULES_FOLDER, VERSION, I18NCONFIG })); } catch (e) { diff --git a/src/external/scalebar.js b/src/external/scalebar.js index 247a5a7b..80fbf946 100644 --- a/src/external/scalebar.js +++ b/src/external/scalebar.js @@ -233,21 +233,25 @@ this.magnificationContainer.style.borderRadius = "7px"; - const steps = Math.round(Math.sqrt(this.magnification)) - 1; + let steps = 0; + let testMag = this.magnification; + while (testMag > 4) { + testMag = Math.round(testMag / 2); + steps++; + } + const minValue = 0; const sliderContainer = document.createElement("span"); const range = {max: [this.magnification], min: [1]}, values = [this.magnification]; - let mag = this.magnification, stepPerc = Math.round(89 / (steps-1)), stepPercIter = 100 - stepPerc; - while (mag > 5) { - mag = Math.round(mag / 2); + let mag = this.magnification, stepPerc = Math.round(100 / (steps+1)), stepPercIter = 100; + while (mag > 4) { + mag = Math.floor(mag / 2); + stepPercIter -= stepPerc; range[`${stepPercIter}%`] = [mag]; values.push(mag); - stepPercIter -= stepPerc; } - //few last step manually, make 2 more distant from home - range[`${stepPercIter+stepPerc*0.3}%`] = [2]; - values.push(2, 1); + values.push(1); values.reverse(); const updateZoom = (mag) => { diff --git a/src/loader.js b/src/loader.js index 5ae1e888..a20cb385 100644 --- a/src/loader.js +++ b/src/loader.js @@ -607,6 +607,7 @@ function initXOpatLoader(PLUGINS, MODULES, PLUGINS_FOLDER, MODULES_FOLDER, POST_ this.getHandler = events.getHandler.bind(events); this.numberOfHandlers = events.numberOfHandlers.bind(events); this.raiseEvent = events.raiseEvent.bind(events); + this.raiseAwaitEvent = VIEWER.tools.raiseAwaitEvent.bind(this, events); this.removeAllHandlers = events.removeAllHandlers.bind(events); this.removeHandler = events.removeHandler.bind(events); this.__errorBindingOnViewer = errorBindingOnViewer; @@ -673,6 +674,12 @@ function initXOpatLoader(PLUGINS, MODULES, PLUGINS_FOLDER, MODULES_FOLDER, POST_ * Note: noop if registerAsEventSource() not called. */ raiseEvent () {} + /** + * Trigger an event, optionally passing additional information. See OpenSeadragon.EventSource::raiseAwaitEvent. + * Awaits async handlers. + * Note: noop if registerAsEventSource() not called. + */ + raiseAwaitEvent() {} /** * Remove all event handlers for a given event type. See OpenSeadragon.EventSource::removeAllHandlers * Note: noop if registerAsEventSource() not called. diff --git a/src/parse-input.js b/src/parse-input.js index 1b1c127c..7cf5d3cf 100644 --- a/src/parse-input.js +++ b/src/parse-input.js @@ -159,9 +159,9 @@ function xOpatParseConfiguration(postData, i18n, supportsPost) { if (!session) { // Try to restore past state - const strData = window.localStorage.getItem("xoSessionCache"); - if (strData) { - const data = JSON.parse(strData); + let strData = window.localStorage.getItem("xoSessionCache"); + if (strData && strData !== "undefined") { + let data = JSON.parse(strData); // consider the session alive for at most 30 minutes const viz = data.visualization; if (viz && viz.__age && Date.now() - viz.__age < 1800e3) { @@ -169,6 +169,12 @@ function xOpatParseConfiguration(postData, i18n, supportsPost) { delete viz.__age; session = _parse(viz); session.__fromLocalStorage = true; + } else { + strData = window.sessionStorage.getItem("xoSessionCache"); + data = strData && strData !== "undefined" && JSON.parse(strData); + postData = data; + session = data.visualization && _parse(data.visualization); + session.__fromLocalStorage = true; } //window.localStorage.removeItem("xoSessionCache"); } @@ -177,7 +183,12 @@ function xOpatParseConfiguration(postData, i18n, supportsPost) { const data = postData || {}; session.__age = Date.now(); data.visualization = session; - window.localStorage.setItem("xoSessionCache", JSON.stringify(data)); + + const sessionData = JSON.stringify(data); + // Local Storage is meant for 'last session', available accross windows, session storage is to prevent + // losing context at any cost + window.localStorage.setItem("xoSessionCache", sessionData); + window.sessionStorage.setItem("xoSessionCache", sessionData); } // Todo this will make the viewer to not show any error - handled by the default screen... any better solution? From a10332ccb61cccc8ced59a95eabba7f487d1bc03 Mon Sep 17 00:00:00 2001 From: Aiosa <469130@mail.muni.cz> Date: Tue, 7 Jan 2025 11:08:18 +0100 Subject: [PATCH 2/6] chore: winrter school hot fix store preset IDs as classes too --- plugins/annotations/annotationsGUI.js | 3 +-- plugins/empaia/annotationConvertor.js | 26 ++++++++++++++++++++++---- plugins/empaia/empaia.js | 8 ++++++++ 3 files changed, 31 insertions(+), 6 deletions(-) diff --git a/plugins/annotations/annotationsGUI.js b/plugins/annotations/annotationsGUI.js index ad74565a..bb522a82 100644 --- a/plugins/annotations/annotationsGUI.js +++ b/plugins/annotations/annotationsGUI.js @@ -137,14 +137,13 @@ ${UIComponents.Elements.checkBox({ default: this.context.getAnnotationCommonVisualProperty('modeOutline')})}
-
Opacity +
Opacity
${UIComponents.Elements.checkBox({ label: 'Enable edge navigation', classes: "pl-2", onchange: `${this.THIS}.setEdgeCursorNavigate(!!this.checked)`, default: this.getOption("edgeCursorNavigate", true)})}
-
diff --git a/plugins/empaia/annotationConvertor.js b/plugins/empaia/annotationConvertor.js index 6e72b0ee..f3e621f1 100644 --- a/plugins/empaia/annotationConvertor.js +++ b/plugins/empaia/annotationConvertor.js @@ -101,7 +101,8 @@ EmpationAPI.integrateWithAnnotations = function (annotationsModule) { factoryID: "polygon", type: "polygon", npp_created: object.npp_created, - points: [object.head, object.tail] + points: [object.head, object.tail], + presetID: object.classes && object.classes.length && object.classes[0].value }), "rectangle": (object) => ({ id: object.id, @@ -112,6 +113,7 @@ EmpationAPI.integrateWithAnnotations = function (annotationsModule) { npp_created: object.npp_created, left: object.upper_left[0], top: object.upper_left[1], + presetID: object.classes && object.classes.length && object.classes[0].value }), "circle": (object) => ({ id: object.id, @@ -122,20 +124,23 @@ EmpationAPI.integrateWithAnnotations = function (annotationsModule) { npp_created: object.npp_created, left: object.center[0] - object.rx, top: object.center[1] - object.ry, + presetID: object.classes && object.classes.length && object.classes[0].value }), "polygon": (object) => ({ id: object.id, factoryID: "polygon", type: "polygon", npp_created: object.npp_created, - points: object.coordinates.map(p => ({x: p[0], y: p[1]})) + points: object.coordinates.map(p => ({x: p[0], y: p[1]})), + presetID: object.classes && object.classes.length && object.classes[0].value }), "line": (object) => ({ id: object.id, factoryID: "polygon", type: "polygon", npp_created: object.npp_created, - points: object.coordinates.map(p => ({x: p[0], y: p[1]})) + points: object.coordinates.map(p => ({x: p[0], y: p[1]})), + presetID: object.classes && object.classes.length && object.classes[0].value }), "point": (object) => ({ id: object.id, @@ -143,10 +148,23 @@ EmpationAPI.integrateWithAnnotations = function (annotationsModule) { type: "ellipse", npp_created: object.npp_created, left: object.coordinates[0], - top: object.coordinates[1] + top: object.coordinates[1], + presetID: object.classes && object.classes.length && object.classes[0].value }), } + getPreset(annotId, presetID) { + return { + creator_id: this.empaia.defaultScope.id, + creator_type: "scope", + reference_id: annotId, + reference_type: "annotation", + type: "class", + value: presetID + } + } + + _encodeAsEmpaiaObject(object, preset, tileSource, props) { //todo encode type and try to recover? ruler, text... return { diff --git a/plugins/empaia/empaia.js b/plugins/empaia/empaia.js index 0f1ac1fb..83dce728 100644 --- a/plugins/empaia/empaia.js +++ b/plugins/empaia/empaia.js @@ -46,6 +46,9 @@ addPlugin('empaia', class extends XOpatPlugin { const toUpload = convertor.encodeSingleObject(annotation, empaiaTiledImage.source); const annot = await this.scopeAPI.annotations.create(toUpload); annotation.id = annot.id; + + const preset = convertor.getPreset(annotation.id, annotation.presetID); + await this.scopeAPI.annotations.addClass(preset); } e.setNeedsDownload(false); @@ -80,6 +83,8 @@ addPlugin('empaia', class extends XOpatPlugin { const annotation = convertor.encodeSingleObject(ev.object, empaiaTiledImage.source); const annot = await this.scopeAPI.annotations.create(annotation); ev.object.id = annot.id; + const preset = convertor.getPreset(ev.object.id, ev.object.presetID); + await this.scopeAPI.annotations.addClass(preset); } catch (e) { console.error(e); } @@ -110,7 +115,10 @@ addPlugin('empaia', class extends XOpatPlugin { const empaiaTiledImage = VIEWER.scalebar.getReferencedTiledImage(); const annotation = convertor.encodeSingleObject(ev.next, empaiaTiledImage.source); const annot = await this.scopeAPI.annotations.create(annotation); + ev.next.id = annot.id; + const preset = convertor.getPreset(ev.next.id, ev.next.presetID); + await this.scopeAPI.annotations.addClass(preset); } } catch (e) { console.error(e); From 987cae9cf4e81c80bd142379715bd435a18f34fd Mon Sep 17 00:00:00 2001 From: Aiosa <469130@mail.muni.cz> Date: Tue, 7 Jan 2025 11:08:42 +0100 Subject: [PATCH 3/6] chore: bump version --- src/config.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/config.json b/src/config.json index 6083bef3..7b145605 100644 --- a/src/config.json +++ b/src/config.json @@ -5,7 +5,7 @@ { /**@lends xoEnv */ /* General xOpat Metadata */ "name": "xOpat", - "version": "2.1.0", + "version": "2.1.1-dev", /* Where xOpat redirects the user in case of error */ "gateway": "../", /* Active configuration in the "client" */ From 93515f9a9a4a0b84cfd8850a45a6a3c17b48e847 Mon Sep 17 00:00:00 2001 From: Aiosa <469130@mail.muni.cz> Date: Thu, 9 Jan 2025 11:58:46 +0100 Subject: [PATCH 4/6] fix: add missing export props, fix cache in getOption --- modules/annotations/annotations.js | 20 ++++---------------- modules/annotations/objects.js | 6 ++++-- plugins/annotations/include.json | 2 +- src/loader.js | 3 ++- 4 files changed, 11 insertions(+), 20 deletions(-) diff --git a/modules/annotations/annotations.js b/modules/annotations/annotations.js index 268e9846..4f0c7f76 100644 --- a/modules/annotations/annotations.js +++ b/modules/annotations/annotations.js @@ -898,7 +898,7 @@ window.OSDAnnotations = class extends XOpatModuleSingleton { * @param {boolean} defaultIfUnknown if false, empty string is returned in case no property was found * @return {string|*} annotation description */ - getAnnotationDescription(annotation, desiredKey="category", defaultIfUnknown=true) { + getAnnotationDescription(annotation, desiredKey="category", defaultIfUnknown=true, withCoordinates=true) { let preset = this.presets.get(annotation.presetID); if (preset) { for (let key in preset.meta) { @@ -906,11 +906,11 @@ window.OSDAnnotations = class extends XOpatModuleSingleton { let metaElement = preset.meta[key]; if (key === desiredKey) { return overridingValue || metaElement.value || - (defaultIfUnknown ? this.getDefaultAnnotationName(annotation) : ""); + (defaultIfUnknown ? this.getDefaultAnnotationName(annotation, withCoordinates) : ""); } } } - return defaultIfUnknown ? this.getDefaultAnnotationName(annotation) : ""; + return defaultIfUnknown ? this.getDefaultAnnotationName(annotation, withCoordinates) : ""; } /** @@ -1731,15 +1731,6 @@ window.OSDAnnotations = class extends XOpatModuleSingleton { } _loadObjects(input, clear, reviver, inheritSession) { - const originalToObject = fabric.Object.prototype.toObject; - const inclusionProps = this._exportedPropertiesGlobal(); - - //we ignore incoming props as we later reset the override - fabric.Object.prototype.toObject = function (_) { - return originalToObject.call(this, inclusionProps); - } - const resetToObjectCall = () => fabric.Object.prototype.toObject = originalToObject; - //from loadFromJSON implementation in fabricJS const _this = this.canvas, self = this; return new Promise((resolve, reject) => { @@ -1775,10 +1766,7 @@ window.OSDAnnotations = class extends XOpatModuleSingleton { return resolve(); }); }, reviver); - }).then(resetToObjectCall).catch(e => { - resetToObjectCall(); - throw e; - }); //todo rethrow? rewrite as async call with try finally + }); } _edgesMouseNavigation(e) { diff --git a/modules/annotations/objects.js b/modules/annotations/objects.js index 07a8fe7e..76e519a6 100644 --- a/modules/annotations/objects.js +++ b/modules/annotations/objects.js @@ -57,11 +57,13 @@ OSDAnnotations.AnnotationObjectFactory = class { "sessionID", "presetID", "layerID", - "id" + "id", + "author", + "created", ]; /** - * Properties copied with 'necessary' (+exports()) + * Properties copied with 'necessary' (+exports()), subset of copiedProperties * @type {string[]} */ static necessaryProperties = [ diff --git a/plugins/annotations/include.json b/plugins/annotations/include.json index 9db4825f..d8f45db3 100644 --- a/plugins/annotations/include.json +++ b/plugins/annotations/include.json @@ -5,7 +5,7 @@ "version": "1.0.0", "description": "A plugin for annotations creation, management and sharing.", "icon": null, - "includes" : ["annotationsGUI.js", "preview.js"], + "includes": ["annotationsGUI.js", "preview.js"], "modules": ["annotations", "human-readable-ids"], "permaLoad": false, //Available annotation object types diff --git a/src/loader.js b/src/loader.js index a20cb385..cfb43163 100644 --- a/src/loader.js +++ b/src/loader.js @@ -867,7 +867,7 @@ function initXOpatLoader(PLUGINS, MODULES, PLUGINS_FOLDER, MODULES_FOLDER, POST_ //todo allow APPLICATION_CONTEXT.getOption(...cache...) to disable cache globally //options are stored only for plugins, so we store them at the lowest level - let value = cache ? localStorage.getItem(`${this.id}.${key}`) : null; + let value = cache ? this.cache.get(key, null) : null; if (value === null) { // read default value from static context if exists if (defaultValue === undefined && key !== "instance") { @@ -885,6 +885,7 @@ function initXOpatLoader(PLUGINS, MODULES, PLUGINS_FOLDER, MODULES_FOLDER, POST_ /** * Ability to cache a value locally into the browser, * the value can be retrieved using this.getOption(...) + * todo rename to setCacheOption * @param key * @param value */ From c3f0967137110a767019e6f46ce19ed6129d1207 Mon Sep 17 00:00:00 2001 From: Aiosa <469130@mail.muni.cz> Date: Thu, 9 Jan 2025 12:06:49 +0100 Subject: [PATCH 5/6] fix: rely on session storage to allow multiple side tabs refresh --- src/parse-input.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/parse-input.js b/src/parse-input.js index 7cf5d3cf..4cf782bf 100644 --- a/src/parse-input.js +++ b/src/parse-input.js @@ -161,7 +161,7 @@ function xOpatParseConfiguration(postData, i18n, supportsPost) { // Try to restore past state let strData = window.localStorage.getItem("xoSessionCache"); if (strData && strData !== "undefined") { - let data = JSON.parse(strData); + const data = JSON.parse(strData); // consider the session alive for at most 30 minutes const viz = data.visualization; if (viz && viz.__age && Date.now() - viz.__age < 1800e3) { @@ -169,14 +169,14 @@ function xOpatParseConfiguration(postData, i18n, supportsPost) { delete viz.__age; session = _parse(viz); session.__fromLocalStorage = true; - } else { - strData = window.sessionStorage.getItem("xoSessionCache"); - data = strData && strData !== "undefined" && JSON.parse(strData); - postData = data; - session = data.visualization && _parse(data.visualization); - session.__fromLocalStorage = true; } - //window.localStorage.removeItem("xoSessionCache"); + window.localStorage.removeItem("xoSessionCache"); + } else { + strData = window.sessionStorage.getItem("xoSessionCache"); + const data = strData && strData !== "undefined" && JSON.parse(strData); + postData = data; + session = data.visualization && _parse(data.visualization); + session.__fromLocalStorage = true; } } else if (!session.error) { // Save current state (including post) in case we loose it and need to restore it (e.g. auth redirect) From a7cfe8894af8b59c56d80286b3201414b31d2e07 Mon Sep 17 00:00:00 2001 From: Aiosa <469130@mail.muni.cz> Date: Tue, 21 Jan 2025 16:04:22 +0100 Subject: [PATCH 6/6] fix: empaia standalone protocol correct query --- docs/web/xopat_deployment.md | 7 ++++--- modules/empaia-wsi-tile-source/tile-source.js | 8 +++++--- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/docs/web/xopat_deployment.md b/docs/web/xopat_deployment.md index 8fd682e9..63db4e7a 100644 --- a/docs/web/xopat_deployment.md +++ b/docs/web/xopat_deployment.md @@ -25,10 +25,11 @@ To deploy xOpat, we need to configure it statically, "path": "/", // The default image server used. Configures an OpenSeadragon protocol using here URL of the service "image_group_server": "http://localhost:8080", - "image_group_protocol": "`${path}/v3/batch/info?slides=${data}`", - "image_group_preview": "`${path}/v3/batch/thumbnail/max_size/250/250?slides=${data}`", + "image_group_protocol": "`${path}/v3/slides/info?slide_id=${data}`", + "image_group_preview": "`${path}/v3/slides/thumbnail/max_size/250/250?slide_id=${data}`", "data_group_server": "http://localhost:8080", - "data_group_protocol": "`${path}/v3/batch/info?slides=${data.join(\",\")}`", + // This endpoint needs to ask for array of data items (get me tile level 5 x3 y0 for this slide list) + "data_group_protocol": "`${path}/v3/files/info?paths=${data.join(\",\")}`", "headers": {}, "js_cookie_expire": 365, "js_cookie_path": "/", diff --git a/modules/empaia-wsi-tile-source/tile-source.js b/modules/empaia-wsi-tile-source/tile-source.js index 62872495..5683c0fd 100644 --- a/modules/empaia-wsi-tile-source/tile-source.js +++ b/modules/empaia-wsi-tile-source/tile-source.js @@ -29,7 +29,7 @@ OpenSeadragon.EmpaiaStandaloneV3TileSource = class extends OpenSeadragon.TileSou let match = url.match(/^(\/?[^\/].*\/v3\/)(files|batch)\/info/i); if (match) { data = data || [{}]; - data[0].tilesUrl = match[1] + "batch"; + data[0].tilesUrl = match[1] + match[2]; return true; } } else if (url && typeof data === "object") { @@ -211,10 +211,12 @@ OpenSeadragon.EmpaiaStandaloneV3TileSource = class extends OpenSeadragon.TileSou if (this.multifetch) { //endpoint files/tile/level/[L]/tile/[X]/[Y]/?paths=path,list,separated,by,commas - return `${tiles}/tile/level/${level}/tile/${x}/${y}?slides=${this.fileId}` + const query_name = tiles.endsWith("batch") ? "slides" : "paths"; + return `${tiles}/tile/level/${level}/tile/${x}/${y}?${query_name}=${this.fileId}` } //endpoint slides/[SLIDE]/tile/level/[L]/tile/[X]/[Y]/ - return `${tiles}/tile/level/${level}/tile/${x}/${y}?slide=${this.fileId}` + const query_name = tiles.endsWith("batch") ? "slides" : "slide_id"; + return `${tiles}/tile/level/${level}/tile/${x}/${y}?${query_name}=${this.fileId}` } _setDownloadHandler(isMultiplex) {