UNPKG

@knora/viewer

Version:
16 lines 59.7 kB
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@knora/api"),require("@knora/core"),require("@angular/router"),require("@angular/material"),require("@angular/common"),require("@angular/flex-layout"),require("@angular/forms"),require("@angular/material/autocomplete"),require("@angular/material/button"),require("@angular/material/card"),require("@angular/material/checkbox"),require("@angular/material/core"),require("@angular/material/datepicker"),require("@angular/material/expansion"),require("@angular/material/form-field"),require("@angular/material/icon"),require("@angular/material/input"),require("@angular/material/list"),require("@angular/material/paginator"),require("@angular/material/slide-toggle"),require("@angular/material/tabs"),require("@angular/material/toolbar"),require("@angular/material/tooltip"),require("@knora/action")):"function"==typeof define&&define.amd?define("@knora/viewer",["exports","@angular/core","@knora/api","@knora/core","@angular/router","@angular/material","@angular/common","@angular/flex-layout","@angular/forms","@angular/material/autocomplete","@angular/material/button","@angular/material/card","@angular/material/checkbox","@angular/material/core","@angular/material/datepicker","@angular/material/expansion","@angular/material/form-field","@angular/material/icon","@angular/material/input","@angular/material/list","@angular/material/paginator","@angular/material/slide-toggle","@angular/material/tabs","@angular/material/toolbar","@angular/material/tooltip","@knora/action"],t):t(((e=e||self).knora=e.knora||{},e.knora.viewer={}),e.ng.core,e.api,e["@knora/core"],e.ng.router,e.ng.material,e.ng.common,e.ng["flex-layout"],e.ng.forms,e.ng.material.autocomplete,e.ng.material.button,e.ng.material.card,e.ng.material.checkbox,e.ng.material.core,e.ng.material.datepicker,e.ng.material.expansion,e.ng.material["form-field"],e.ng.material.icon,e.ng.material.input,e.ng.material.list,e.ng.material.paginator,e.ng.material["slide-toggle"],e.ng.material.tabs,e.ng.material.toolbar,e.ng.material.tooltip,e["@knora/action"])}(this,(function(e,t,n,i,o,r,a,l,s,p,c,u,d,g,m,v,f,h,b,y,x,k,w,O,I,C){"use strict";
/*! *****************************************************************************
    Copyright (c) Microsoft Corporation. All rights reserved.
    Licensed under the Apache License, Version 2.0 (the "License"); you may not use
    this file except in compliance with the License. You may obtain a copy of the
    License at http://www.apache.org/licenses/LICENSE-2.0

    THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
    WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
    MERCHANTABLITY OR NON-INFRINGEMENT.

    See the Apache Version 2.0 License for specific language governing permissions
    and limitations under the License.
    ***************************************************************************** */var j=function(e,t){return(j=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function R(e,t,n,i){var o,r=arguments.length,a=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,i);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(a=(r<3?o(a):r>3?o(t,n,a):o(t,n))||a);return r>3&&a&&Object.defineProperty(t,n,a),a}function V(e,t){return function(n,i){t(n,i,e)}}function S(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function _(e){var t="function"==typeof Symbol&&e[Symbol.iterator],n=0;return t?t.call(e):{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}}var P=function(){function e(){}return e.prototype.ngOnInit=function(){},e=R([t.Component({selector:"kui-moving-image",template:'\x3c!-- video container --\x3e\n<div class="moving-image-viewer">\n\n  \x3c!-- video source --\x3e\n  <video></video>\n\n  \x3c!-- timeline incl. preview --\x3e\n  <div class="kui-mi-timeline">\n\n  </div>\n  <div class="kui-mi-navigation">\n\n\n  </div>\n\n</div>\n',styles:[""]}),S("design:paramtypes",[])],e)}(),A=function(){function e(e){this.regionResource=e}return e.prototype.getGeometries=function(){return this.regionResource.properties[n.Constants.HasGeometry]},e}(),M=function(e,t){this.stillImageFileValue=e,this.regions=t},E=function(e,t){this.geometry=e,this.region=t},D=function(){function e(e){this.elementRef=e,this.currentImageIndex=new t.EventEmitter,this.regionHovered=new t.EventEmitter,this.regions={}}var i;return i=e,e.surfaceOfRectangularRegion=function(e){return"rectangle"!==e.type?(console.log("expected rectangular region, but "+e.type+" given"),0):(Math.max(e.points[0].x,e.points[1].x)-Math.min(e.points[0].x,e.points[1].x))*(Math.max(e.points[0].y,e.points[1].y)-Math.min(e.points[0].y,e.points[1].y))},e.prepareTileSourcesFromFileValues=function(e){var t,n,i=0,o=[];try{for(var r=_(e),a=r.next();!a.done;a=r.next()){var l=a.value,s=l.iiifBaseUrl+"/"+l.filename,p=l.dimX,c=l.dimY;o.push({tileSource:{"@context":"http://iiif.io/api/image/2/context.json","@id":s,height:c,width:p,profile:["http://iiif.io/api/image/2/level2.json"],protocol:"http://iiif.io/api/image",tiles:[{scaleFactors:[1,2,4,8,16,32],width:1024}]},x:i,y:0}),i++}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}return o},e.prototype.ngOnChanges=function(e){e.images&&e.images.isFirstChange()&&this.setupViewer(),e.images?(this.openImages(),this.renderRegions(),this.unhighlightAllRegions(),void 0!==this.activateRegion&&this.highlightRegion(this.activateRegion)):e.activateRegion&&(this.unhighlightAllRegions(),void 0!==this.activateRegion&&this.highlightRegion(this.activateRegion)),this.viewer},e.prototype.ngOnInit=function(){},e.prototype.ngOnDestroy=function(){this.viewer&&(this.viewer.destroy(),this.viewer=void 0)},e.prototype.updateImages=function(){this.viewer||this.setupViewer(),this.openImages()},e.prototype.updateRegions=function(){this.viewer||this.setupViewer(),this.renderRegions()},e.prototype.highlightRegion=function(e){var t,n,i=this.regions[e];if(void 0!==i)try{for(var o=_(i),r=o.next();!r.done;r=o.next()){r.value.setAttribute("class","roi-svgoverlay active")}}catch(e){t={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}},e.prototype.unhighlightAllRegions=function(){var e,t;for(var n in this.regions)if(this.regions.hasOwnProperty(n))try{for(var i=_(this.regions[n]),o=i.next();!o.done;o=i.next()){o.value.setAttribute("class","roi-svgoverlay")}}catch(t){e={error:t}}finally{try{o&&!o.done&&(t=i.return)&&t.call(i)}finally{if(e)throw e.error}}},e.prototype.setupViewer=function(){var e=this.elementRef.nativeElement.getElementsByClassName("osd-container")[0],t={element:e,sequenceMode:!0,showReferenceStrip:!0,showNavigator:!0,zoomInButton:"KUI_OSD_ZOOM_IN",zoomOutButton:"KUI_OSD_ZOOM_OUT",previousButton:"KUI_OSD_PREV_PAGE",nextButton:"KUI_OSD_NEXT_PAGE",homeButton:"KUI_OSD_HOME",fullPageButton:"KUI_OSD_FULL_PAGE",rotateLeftButton:"KUI_OSD_ROTATE_LEFT",rotateRightButton:"KUI_OSD_ROTATE_RIGHT"};this.viewer=new OpenSeadragon.Viewer(t),this.viewer.addHandler("full-screen",(function(t){t.fullScreen?e.classList.add("fullscreen"):e.classList.remove("fullscreen")})),this.viewer.addHandler("resize",(function(e){e.eventSource.svgOverlay().resize()}));var n=this.images.map((function(e){return e}));this.viewer.addHandler("page",(function(e){console.log("event on page",e),console.log("Now on page",e.page);var t=e.page;console.log("= id",n[t].id);n[t].id}))},e.prototype.openImages=function(){var e=this.images.map((function(e){return e})),t=i.prepareTileSourcesFromFileValues(e);this.removeOverlays(),this.viewer.open(t)},e.prototype.removeOverlays=function(){var e,t;for(var n in this.regions)if(this.regions.hasOwnProperty(n))try{for(var i=_(this.regions[n]),o=i.next();!o.done;o=i.next()){var r=o.value;r instanceof SVGPolygonElement&&r.remove()}}catch(t){e={error:t}}finally{try{o&&!o.done&&(t=i.return)&&t.call(i)}finally{if(e)throw e.error}}this.regions={},this.viewer.clearOverlays()},e.prototype.renderRegions=function(){var e,t;this.removeOverlays();try{for(var n=_(this.images),i=n.next();!i.done;i=n.next()){var o=i.value;o.dimY,o.dimX;0}}catch(t){e={error:t}}finally{try{i&&!i.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}},e.prototype.createSVGOverlay=function(e,t,n,i,o){var r,a=this,l=t.lineColor,s=t.lineWidth;switch(t.type){case"rectangle":r=document.createElementNS("http://www.w3.org/2000/svg","polygon"),this.addSVGAttributesRectangle(r,t,n,i);break;case"polygon":r=document.createElementNS("http://www.w3.org/2000/svg","polygon"),this.addSVGAttributesPolygon(r,t,n,i);break;case"circle":r=document.createElementNS("http://www.w3.org/2000/svg","circle"),this.addSVGAttributesCircle(r,t,n,i);break;default:return void console.log("ERROR: StillImageOSDViewerComponent.createSVGOverlay: unknown geometryType: "+t.type)}r.id="roi-svgoverlay-"+1e4*Math.random(),r.setAttribute("class","roi-svgoverlay"),r.setAttribute("style","stroke: "+l+"; stroke-width: "+s+"px;"),r.addEventListener("click",(function(){a.regionHovered.emit(e)}),!1);var p=document.createElementNS("http://www.w3.org/2000/svg","title");p.textContent=o;var c=document.createElementNS("http://www.w3.org/2000/svg","g");c.appendChild(p),c.appendChild(r),this.viewer.svgOverlay().node().appendChild(c),this.regions[e].push(r)},e.prototype.addSVGAttributesRectangle=function(e,t,i,o){var r=t.points[0],a=t.points[1],l=new n.Point2D(Math.min(r.x,a.x),Math.min(r.y,a.y)),s=new n.Point2D(Math.max(r.x,a.x),Math.max(r.y,a.y)),p=[l,new n.Point2D(Math.max(r.x,a.x),Math.min(r.y,a.y)),s,new n.Point2D(Math.min(r.x,a.x),Math.max(r.y,a.y))],c=this.image2ViewPortCoords(p,i,o),u=this.createSVGPolygonPointsAttribute(c);e.setAttribute("points",u)},e.prototype.addSVGAttributesPolygon=function(e,t,n,i){var o=this.image2ViewPortCoords(t.points,n,i),r=this.createSVGPolygonPointsAttribute(o);e.setAttribute("points",r)},e.prototype.addSVGAttributesCircle=function(e,t,n,i){var o=this.image2ViewPortCoords(t.points,n,i),r=String(o[0].x),a=String(o[0].y),l=String(Math.sqrt(t.radius.x*t.radius.x+n*n*t.radius.y*t.radius.y));e.setAttribute("cx",r),e.setAttribute("cy",a),e.setAttribute("r",l)},e.prototype.image2ViewPortCoords=function(e,t,i){return e.map((function(e){return new n.Point2D(e.x+i,e.y*t)}))},e.prototype.createSVGPolygonPointsAttribute=function(e){var t="";for(var n in e)e.hasOwnProperty(n)&&(t+=e[n].x,t+=",",t+=e[n].y,t+=" ");return t},e.prototype.getCurrentImage=function(){},e.ctorParameters=function(){return[{type:t.ElementRef}]},R([t.Input(),S("design:type",Array)],e.prototype,"images",void 0),R([t.Input(),S("design:type",String)],e.prototype,"imageCaption",void 0),R([t.Input(),S("design:type",String)],e.prototype,"activateRegion",void 0),R([t.Output(),S("design:type",t.EventEmitter)],e.prototype,"currentImageIndex",void 0),R([t.Output(),S("design:type",Object)],e.prototype,"regionHovered",void 0),e=i=R([t.Component({selector:"kui-still-image",template:'<div class="still-image-viewer">\n    <div class="navigation left">\n        <button mat-button class="full-size" id="KUI_OSD_PREV_PAGE">\n            <mat-icon>keyboard_arrow_left</mat-icon>\n        </button>\n    </div>\n\n    \x3c!-- main content with navigation and osd viewer --\x3e\n    <div class="content">\n\n        \x3c!-- openseadragon (osd) viewer --\x3e\n        <div class="osd-container"></div>\n        \x3c!-- /openseadragon (osd) --\x3e\n\n        \x3c!-- footer with image caption e.g. copyright information --\x3e\n        <div class="footer">\n            <p class="mat-caption" [innerHtml]="imageCaption"></p>\n        </div>\n\n        \x3c!-- action panel with tools for image --\x3e\n        <mat-toolbar class="action">\n            <mat-toolbar-row>\n                \x3c!-- home button --\x3e\n                <span>\n                    <button mat-icon-button id="KUI_OSD_HOME">\n                        <mat-icon>home</mat-icon>\n                    </button>\n                </span>\n                \x3c!-- zoom buttons --\x3e\n                <span class="fill-remaining-space"></span>\n                <span>\n                    <button mat-icon-button id="KUI_OSD_ZOOM_IN">\n                        <mat-icon>add</mat-icon>\n                    </button>\n                    <button mat-icon-button id="KUI_OSD_ZOOM_OUT">\n                        <mat-icon>remove</mat-icon>\n                    </button>\n                </span>\n                \x3c!-- window button --\x3e\n                <span class="fill-remaining-space"></span>\n                <span>\n                    <button mat-icon-button id="KUI_OSD_FULL_PAGE">\n                        <mat-icon>fullscreen</mat-icon>\n                    </button>\n                </span>\n            </mat-toolbar-row>\n        </mat-toolbar>\n\n    </div>\n\n    <div class="navigation">\n        <button mat-button class="full-size" id="KUI_OSD_NEXT_PAGE" (click)="getCurrentImage()">\n            <mat-icon>keyboard_arrow_right</mat-icon>\n        </button>\n    </div>\n\n</div>\n\n\x3c!-- simple image viewer e.g. as a preview --\x3e\n\x3c!-- TODO: handle images array --\x3e\n\x3c!--<img *ngIf="simple && images?.length === 1; else osdViewer" [src]="simpleImageExample">--\x3e\n\n\n\x3c!--\n    <div>\n        <span *ngIf="images.length > 1" (click)="gotoLeft()">&lt;&lt;</span>\n        <span *ngIf="images.length > 1" (click)="gotoRight()">&gt;&gt;</span>\n    </div>\n--\x3e\n',styles:[".still-image-viewer{display:-webkit-inline-box;display:inline-flex;height:400px;max-width:960px;width:100%}@media (max-height:636px){.still-image-viewer{height:300px}}.still-image-viewer .navigation{height:calc(400px + 64px + 24px);width:36px}.still-image-viewer .navigation .mat-button.full-size{height:100%!important;width:36px!important;padding:0!important;min-width:36px!important}.still-image-viewer .content{height:calc(400px + 64px + 24px);max-width:calc(960px - (2 * 36px));width:calc(100% - (2 * 36px))}.still-image-viewer .content .osd-container{color:#ccc;background-color:#000;height:400px}.still-image-viewer .content .osd-container.fullscreen{max-width:100vw}.still-image-viewer .content .footer p{color:#ccc;background-color:#000;height:24px;margin:0;padding:0 16px}::ng-deep .roi-svgoverlay{opacity:.4;fill:transparent;stroke:#00695c;stroke-width:2px;vector-effect:non-scaling-stroke}.roi-svgoverlay:focus,::ng-deep .roi-svgoverlay:hover{opacity:1}::ng-deep .roi-svgoverlay.active{opacity:1}"]}),S("design:paramtypes",[t.ElementRef])],e)}(),T=function(){function e(){}return Object.defineProperty(e.prototype,"valueObject",{get:function(){return this._booleanValueObj},set:function(e){this._booleanValueObj=e},enumerable:!0,configurable:!0}),R([t.Input(),S("design:type",n.ReadBooleanValue),S("design:paramtypes",[n.ReadBooleanValue])],e.prototype,"valueObject",null),e=R([t.Component({selector:"kui-boolean-value",template:'<mat-checkbox [checked]="valueObject.bool" readonly="true"></mat-checkbox>\n',styles:[".mat-form-field{width:320px}.fill-remaining-space{-webkit-box-flex:1;flex:1 1 auto}.center{text-align:center}a{text-decoration:none;color:inherit}.kui-link{cursor:pointer;border-bottom:2px solid rgba(0,105,92,.25)}.lv-prop-label{color:rgba(0,0,0,.54)}.lv-html-text{position:relative;overflow:hidden}"]}),S("design:paramtypes",[])],e)}(),K=function(){function e(){}return Object.defineProperty(e.prototype,"valueObject",{get:function(){return this._colorValueObj},set:function(e){this._colorValueObj=e},enumerable:!0,configurable:!0}),R([t.Input(),S("design:type",n.ReadColorValue),S("design:paramtypes",[n.ReadColorValue])],e.prototype,"valueObject",null),e=R([t.Component({selector:"kui-color-value",template:'<span [style.background-color]="valueObject.color">{{valueObject.color}}</span>\n',styles:[".fill-remaining-space{-webkit-box-flex:1;flex:1 1 auto}.center{text-align:center}a{text-decoration:none;color:inherit}.kui-link{cursor:pointer;border-bottom:2px solid rgba(0,105,92,.25)}.lv-prop-label{color:rgba(0,0,0,.54)}.lv-html-text{position:relative;overflow:hidden}.mat-form-field{width:36px;overflow-x:visible}"]}),S("design:paramtypes",[])],e)}(),L=function(){function e(){}return Object.defineProperty(e.prototype,"calendar",{get:function(){return this._calendar},set:function(e){this._calendar=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"era",{get:function(){return this._era},set:function(e){this._era=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"valueObject",{get:function(){return this._dateValueObj},set:function(e){this._dateValueObj=e;var t=this.valueObject.date;t instanceof n.KnoraPeriod?(this.period=!0,this.dates=[this.getJSDate(t.start),this.getJSDate(t.end)]):(this.period=!1,this.dates=[this.getJSDate(t)])},enumerable:!0,configurable:!0}),e.prototype.getJSDate=function(e){return e.precision===n.Precision.yearPrecision?{format:"yyyy",date:new Date(e.year.toString()),era:e.era,calendar:e.calendar}:e.precision===n.Precision.monthPrecision?{format:"MMMM yyyy",date:new Date(e.year,e.month-1,1),era:e.era,calendar:e.calendar}:e.precision===n.Precision.dayPrecision?{format:"longDate",date:new Date(e.year,e.month-1,e.day),era:e.era,calendar:e.calendar}:void console.error("Error: incorrect precision for date")},R([t.Input(),S("design:type",Boolean),S("design:paramtypes",[Boolean])],e.prototype,"calendar",null),R([t.Input(),S("design:type",Boolean),S("design:paramtypes",[Boolean])],e.prototype,"era",null),R([t.Input(),S("design:type",n.ReadDateValue),S("design:paramtypes",[n.ReadDateValue])],e.prototype,"valueObject",null),e=R([t.Component({selector:"kui-date-value",template:'<span *ngIf="period; else preciseDate">\n    {{dates[0].date | date: dates[0].format}}\n    <span *ngIf="era">\n        {{dates[0].era}}\n    </span>\n    - {{dates[1].date | date: dates[1].format}}\n    <span *ngIf="era">\n        {{dates[1].era}}\n    </span>\n\n    <span *ngIf="calendar">\n        ({{dates[0].calendar}})\n    </span>\n</span>\n\n<ng-template #preciseDate>\n\n    <span>\n        {{dates[0].date | date: dates[0].format}}\n        <span *ngIf="era">\n            {{dates[0].era}}\n        </span>\n        <span *ngIf="calendar">\n            ({{dates[0].calendar}})\n        </span>\n    </span>\n\n</ng-template>\n',styles:[".mat-form-field{width:320px}.fill-remaining-space{-webkit-box-flex:1;flex:1 1 auto}.center{text-align:center}a{text-decoration:none;color:inherit}.kui-link{cursor:pointer;border-bottom:2px solid rgba(0,105,92,.25)}.lv-prop-label{color:rgba(0,0,0,.54)}.lv-html-text{position:relative;overflow:hidden}"]}),S("design:paramtypes",[])],e)}(),F=function(){function e(){}return Object.defineProperty(e.prototype,"valueObject",{get:function(){return this._decimalValueObj},set:function(e){this._decimalValueObj=e},enumerable:!0,configurable:!0}),R([t.Input(),S("design:type",n.ReadDecimalValue),S("design:paramtypes",[n.ReadDecimalValue])],e.prototype,"valueObject",null),e=R([t.Component({selector:"kui-decimal-value",template:"<span>{{valueObject.decimal}}</span>",styles:[".mat-form-field{width:320px}.fill-remaining-space{-webkit-box-flex:1;flex:1 1 auto}.center{text-align:center}a{text-decoration:none;color:inherit}.kui-link{cursor:pointer;border-bottom:2px solid rgba(0,105,92,.25)}.lv-prop-label{color:rgba(0,0,0,.54)}.lv-html-text{position:relative;overflow:hidden}"]}),S("design:paramtypes",[])],e)}(),q=function(){function e(){}return Object.defineProperty(e.prototype,"valueObject",{get:function(){return this._geomValueObj},set:function(e){this._geomValueObj=e},enumerable:!0,configurable:!0}),R([t.Input(),S("design:type",n.ReadGeomValue),S("design:paramtypes",[n.ReadGeomValue])],e.prototype,"valueObject",null),e=R([t.Component({selector:"kui-geometry-value",template:"<span>{{valueObject.geometry}}</span>\n",styles:[".mat-form-field{width:320px}.fill-remaining-space{-webkit-box-flex:1;flex:1 1 auto}.center{text-align:center}a{text-decoration:none;color:inherit}.kui-link{cursor:pointer;border-bottom:2px solid rgba(0,105,92,.25)}.lv-prop-label{color:rgba(0,0,0,.54)}.lv-html-text{position:relative;overflow:hidden}"]}),S("design:paramtypes",[])],e)}(),G=function(){function e(){}return e.prototype.ngOnInit=function(){},e=R([t.Component({selector:"kui-geoname-value",template:"<p>\n  geoname-value works!\n</p>",styles:[".mat-form-field{width:320px}.fill-remaining-space{-webkit-box-flex:1;flex:1 1 auto}.center{text-align:center}a{text-decoration:none;color:inherit}.kui-link{cursor:pointer;border-bottom:2px solid rgba(0,105,92,.25)}.lv-prop-label{color:rgba(0,0,0,.54)}.lv-html-text{position:relative;overflow:hidden}"]}),S("design:paramtypes",[])],e)}(),U=function(){function e(){}return Object.defineProperty(e.prototype,"valueObject",{get:function(){return this._integerValueObj},set:function(e){this._integerValueObj=e},enumerable:!0,configurable:!0}),R([t.Input(),S("design:type",n.ReadIntValue),S("design:paramtypes",[n.ReadIntValue])],e.prototype,"valueObject",null),e=R([t.Component({selector:"kui-integer-value",template:"<span>{{valueObject.int}}</span>\n",styles:[".mat-form-field{width:320px}.fill-remaining-space{-webkit-box-flex:1;flex:1 1 auto}.center{text-align:center}a{text-decoration:none;color:inherit}.kui-link{cursor:pointer;border-bottom:2px solid rgba(0,105,92,.25)}.lv-prop-label{color:rgba(0,0,0,.54)}.lv-html-text{position:relative;overflow:hidden}"]}),S("design:paramtypes",[])],e)}(),B=function(){function e(){}return Object.defineProperty(e.prototype,"valueObject",{get:function(){return this._intervalValueObj},set:function(e){this._intervalValueObj=e},enumerable:!0,configurable:!0}),R([t.Input(),S("design:type",n.ReadIntervalValue),S("design:paramtypes",[n.ReadIntervalValue])],e.prototype,"valueObject",null),e=R([t.Component({selector:"kui-interval-value",template:"<span>{{valueObject.start}} - {{valueObject.end}}</span>\n",styles:[".mat-form-field{width:320px}.fill-remaining-space{-webkit-box-flex:1;flex:1 1 auto}.center{text-align:center}a{text-decoration:none;color:inherit}.kui-link{cursor:pointer;border-bottom:2px solid rgba(0,105,92,.25)}.lv-prop-label{color:rgba(0,0,0,.54)}.lv-html-text{position:relative;overflow:hidden}"]}),S("design:paramtypes",[])],e)}(),z=function(){function e(){this.referredResourceClicked=new t.EventEmitter}return Object.defineProperty(e.prototype,"valueObject",{get:function(){return this._linkValueObj},set:function(e){this._linkValueObj=e,void 0!==this.valueObject.linkedResource?this.referredResource=this.valueObject.linkedResource.label:this.referredResource=this.valueObject.linkedResourceIri},enumerable:!0,configurable:!0}),e.prototype.refResClicked=function(){this.referredResourceClicked.emit(this._linkValueObj)},R([t.Input(),S("design:type",n.ReadLinkValue),S("design:paramtypes",[n.ReadLinkValue])],e.prototype,"valueObject",null),R([t.Output(),S("design:type",t.EventEmitter)],e.prototype,"referredResourceClicked",void 0),e=R([t.Component({selector:"kui-link-value",template:'<a class="kui-link" (click)="refResClicked()">{{referredResource}}</a>\n',styles:[".mat-form-field{width:320px}.fill-remaining-space{-webkit-box-flex:1;flex:1 1 auto}.center{text-align:center}a{text-decoration:none;color:inherit}.kui-link{cursor:pointer;border-bottom:2px solid rgba(0,105,92,.25)}.lv-prop-label{color:rgba(0,0,0,.54)}.lv-html-text{position:relative;overflow:hidden}"]}),S("design:paramtypes",[])],e)}(),N=function(){function e(){}return Object.defineProperty(e.prototype,"valueObject",{get:function(){return this._listValueObj},set:function(e){this._listValueObj=e},enumerable:!0,configurable:!0}),R([t.Input(),S("design:type",n.ReadListValue),S("design:paramtypes",[n.ReadListValue])],e.prototype,"valueObject",null),e=R([t.Component({selector:"kui-list-value",template:"<span>{{valueObject.listNodeLabel}}</span>\n",styles:[".mat-form-field{width:320px}.fill-remaining-space{-webkit-box-flex:1;flex:1 1 auto}.center{text-align:center}a{text-decoration:none;color:inherit}.kui-link{cursor:pointer;border-bottom:2px solid rgba(0,105,92,.25)}.lv-prop-label{color:rgba(0,0,0,.54)}.lv-html-text{position:relative;overflow:hidden}"]}),S("design:paramtypes",[])],e)}(),Q=function(){function e(e){this.el=e,this.referredResourceClicked=new t.EventEmitter}return Object.defineProperty(e.prototype,"ontologyInfo",{get:function(){return this._ontoInfo},set:function(e){this._ontoInfo=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"bindEvents",{get:function(){return this._bindEvents},set:function(e){this._bindEvents=e},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"valueObject",{get:function(){return this._htmlValueObj},set:function(e){this._htmlValueObj=e,this.el.nativeElement.innerHTML&&(this.el.nativeElement.innerHTML=this.valueObject.html)},enumerable:!0,configurable:!0}),e.prototype.refResClicked=function(e){this.referredResourceClicked.emit(e)},e.prototype.onClick=function(e){return this._bindEvents&&"a"===e.nodeName.toLowerCase()&&e.className.toLowerCase().indexOf("salsah-link")>=0&&void 0!==e.href?(this.refResClicked(e.href),!1):!(!this.bindEvents||"a"!==e.nodeName.toLowerCase()||void 0===e.href)&&(window.open(e.href,"_blank"),!1)},e.ctorParameters=function(){return[{type:t.ElementRef}]},R([t.Output(),S("design:type",t.EventEmitter)],e.prototype,"referredResourceClicked",void 0),R([t.Input(),S("design:type",Object),S("design:paramtypes",[Object])],e.prototype,"ontologyInfo",null),R([t.Input(),S("design:type",Boolean),S("design:paramtypes",[Boolean])],e.prototype,"bindEvents",null),R([t.Input(),S("design:type",n.ReadTextValueAsHtml),S("design:paramtypes",[n.ReadTextValueAsHtml])],e.prototype,"valueObject",null),R([t.HostListener("click",["$event.target"]),S("design:type",Function),S("design:paramtypes",[Object]),S("design:returntype",void 0)],e.prototype,"onClick",null),e=R([t.Component({selector:"kui-text-value-as-html",template:"<div>{{valueObject.html}}</div>",styles:[""]}),S("design:paramtypes",[t.ElementRef])],e)}(),H=function(){function e(){this.regexUrl=/(http|https|ftp|ftps)\:\/\/[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,3}(\/\S*)?/}return Object.defineProperty(e.prototype,"valueObject",{get:function(){return this._textStringValueObj},set:function(e){var t=e.text;if(this.regexUrl.exec(t)){var n=this.regexUrl.exec(t)[0],i=t.replace(this.regexUrl,'<a class="kui-link" href="'+n+'">'+n+"</a>");e.text=i,this._textStringValueObj=e}else this._textStringValueObj=e},enumerable:!0,configurable:!0}),R([t.Input(),S("design:type",n.ReadTextValueAsString),S("design:paramtypes",[n.ReadTextValueAsString])],e.prototype,"valueObject",null),e=R([t.Component({selector:"kui-text-value-as-string",template:'<span [innerHTML]="valueObject.text"></span>\n',styles:[".mat-form-field{width:320px}.fill-remaining-space{-webkit-box-flex:1;flex:1 1 auto}.center{text-align:center}a{text-decoration:none;color:inherit}.lv-prop-label{color:rgba(0,0,0,.54)}.lv-html-text{position:relative;overflow:hidden}.kui-link{cursor:pointer;border-bottom:2px solid rgba(0,105,92,.25)}.kui-link:hover{box-shadow:0 -10px 0 rgba(0,105,92,.25) inset}"]}),S("design:paramtypes",[])],e)}(),X=function(){function e(){}return Object.defineProperty(e.prototype,"valueObject",{get:function(){return this._xmlValueObj},set:function(e){this._xmlValueObj=e},enumerable:!0,configurable:!0}),R([t.Input(),S("design:type",n.ReadTextValueAsXml),S("design:paramtypes",[n.ReadTextValueAsXml])],e.prototype,"valueObject",null),e=R([t.Component({selector:"kui-text-value-as-xml",template:"<span>{{valueObject.xml}}</span>",styles:[""]}),S("design:paramtypes",[])],e)}(),Z=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return function(e,t){function n(){this.constructor=e}j(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e),t}(n.ReadFileValue),J=function(){function e(){}return Object.defineProperty(e.prototype,"valueObject",{get:function(){return this._textfileValueObj},set:function(e){this._textfileValueObj=e},enumerable:!0,configurable:!0}),R([t.Input(),S("design:type",Z),S("design:paramtypes",[Z])],e.prototype,"valueObject",null),e=R([t.Component({selector:"kui-textfile-value",template:'<a target="_blank" href="{{valueObject.fileUrl}}">{{valueObject.filename}}</a>\n',styles:[""]}),S("design:paramtypes",[])],e)}(),$=function(){function e(){}return Object.defineProperty(e.prototype,"valueObject",{get:function(){return this.__uriValueObj},set:function(e){this.__uriValueObj=e},enumerable:!0,configurable:!0}),e.prototype.ngOnChanges=function(){void 0===this.label?this.displayString=this.__uriValueObj.uri:this.displayString=this.label},R([t.Input(),S("design:type",n.ReadUriValue),S("design:paramtypes",[n.ReadUriValue])],e.prototype,"valueObject",null),R([t.Input(),S("design:type",String)],e.prototype,"label",void 0),e=R([t.Component({selector:"   kui-uri-value",template:'<a href="{{valueObject.uri}}" target="_blank" class="kui-link">{{displayString}}</a>\n',styles:[".mat-form-field{width:320px}.fill-remaining-space{-webkit-box-flex:1;flex:1 1 auto}.center{text-align:center}a{text-decoration:none;color:inherit}.kui-link{cursor:pointer;border-bottom:2px solid rgba(0,105,92,.25)}.lv-prop-label{color:rgba(0,0,0,.54)}.lv-html-text{position:relative;overflow:hidden}"]}),S("design:paramtypes",[])],e)}(),W=function(){function e(e){this._router=e}return e.prototype.ngOnInit=function(){},e.prototype.openResource=function(e){var t="/resource/"+encodeURIComponent(e);this._router.navigate([t])},e.ctorParameters=function(){return[{type:o.Router}]},R([t.Input(),S("design:type",Object)],e.prototype,"result",void 0),R([t.Input(),S("design:type",i.OntologyInformation)],e.prototype,"ontologyInfo",void 0),e=R([t.Component({selector:"kui-grid-view",template:'<div>\n    \x3c!-- <kui-progress-indicator *ngIf="isLoading" [color]="\'#D88958\'"></kui-progress-indicator> --\x3e\n\n    <div fxLayout="row wrap" fxLayout.xs="column" fxLayoutGap="grid">\n\n        <div fxFlex.xs="100" fxFlex.sm="50" fxFlex.md="33.3" fxFlex.lg="25" fxFlex.xl="20" *ngFor="let res of result"\n            class="gv-preview">\n            <mat-card class="link" (click)="openResource(res.id)">\n\n                <mat-card-subtitle>{{res.entityInfo.classes[res.type].label}}</mat-card-subtitle>\n                <mat-card-title>{{res.label}}</mat-card-title>\n\n\n                <mat-card-content *ngFor="let prop of res.properties | kuiKey">\n                    <div *ngFor="let val of prop.value | kuiKey">\n                        <span class="lv-prop-label">\n                            {{res.entityInfo.properties[val.value.property].label}}:&nbsp;\n                        </span>\n\n                        <div class="lv-html-text">\n                            {{val.value.strval | kuiTruncate:[\'200\', \'...\']}}\n                        </div>\n                    </div>\n                </mat-card-content>\n\n            </mat-card>\n        </div>\n    </div>\n\n\n</div>\n',styles:[".mat-form-field{width:320px}.fill-remaining-space{-webkit-box-flex:1;flex:1 1 auto}.center{text-align:center}a{text-decoration:none;color:inherit}.kui-link{cursor:pointer;border-bottom:2px solid rgba(0,105,92,.25)}.lv-prop-label{color:rgba(0,0,0,.54)}.lv-html-text{position:relative;overflow:hidden}.gv-preview{margin:6px 0;padding:24px;word-wrap:break-word;border-radius:5px}.gv-preview .mat-card{height:180px;color:rgba(0,0,0,.81);overflow:hidden;padding-bottom:25px}.gv-preview .mat-card:hover{background:rgba(0,105,92,.39);color:#000}.gv-preview .mat-card:active{background:rgba(0,105,92,.61)}.gv-preview .mat-card .mat-card-title{font-size:12pt;font-weight:600}"]}),S("design:paramtypes",[o.Router])],e)}(),Y=function(){function e(e){this._router=e}return e.prototype.openResource=function(e){var t="/resource/"+encodeURIComponent(e);this._router.navigate([t])},e.ctorParameters=function(){return[{type:o.Router}]},R([t.Input(),S("design:type",Array)],e.prototype,"result",void 0),R([t.Input(),S("design:type",Object)],e.prototype,"ontologyInfo",void 0),e=R([t.Component({selector:"kui-list-view",template:'<div>\n    \x3c!-- <kui-progress-indicator *ngIf="isLoading" [color]="\'#D88958\'"></kui-progress-indicator> --\x3e\n\n    <mat-list class="list-view lv-items" *ngFor="let res of result; let i = index; let last = last;">\n        <mat-list-item class="link" (click)="openResource(res.id)">\n            <mat-icon matListIcon>image_search</mat-icon>\n            <p matLine class="lv-res-label">{{res.entityInfo.classes[res.type].label}}</p>\n            <h3 matLine class="lv-label">{{res.label}}</h3>\n\n            <div matLine *ngFor="let prop of res.properties | kuiKey">\n\n                <div matLine *ngFor="let val of prop.value | kuiKey">\n\n                    <span class="lv-prop-label">\n                        {{res.entityInfo.properties[val.value.property].label}}:&nbsp;\n                    </span>\n\n                    <div class="lv-html-text">\n                        {{val.value.strval | kuiTruncate:[\'256\', \'...\']}}\n                    </div>\n\n                </div>\n\n            </div>\n\n        </mat-list-item>\n\n        <mat-divider *ngIf="!last"></mat-divider>\n\n    </mat-list>\n</div>\n',styles:[".mat-form-field{width:320px}.fill-remaining-space{-webkit-box-flex:1;flex:1 1 auto}.center{text-align:center}a{text-decoration:none;color:inherit}.kui-link{cursor:pointer;border-bottom:2px solid rgba(0,105,92,.25)}.lv-prop-label{color:rgba(0,0,0,.54);font-style:italic}.lv-html-text{position:relative;overflow:hidden}.mat-list .mat-list-item .mat-line{white-space:normal!important}.list-view .mat-list-item{height:auto;min-height:40px;padding:8px 0}.lv-label{font-weight:700!important;font-size:16px!important;line-height:1.5}.lv-res-label{color:rgba(0,0,0,.54);font-size:14px!important}"]}),S("design:paramtypes",[o.Router])],e)}(),ee=function(){function e(e){this._router=e,this.allProps=!1,this.toolbar=!1,this.loading=!1}return e.prototype.ngOnInit=function(){},e.prototype.openLink=function(e){this.loading=!0,this._router.navigate(["/resource/"+encodeURIComponent(e)])},e.ctorParameters=function(){return[{type:o.Router}]},R([t.Input(),S("design:type",Object)],e.prototype,"propArray",void 0),R([t.Input(),S("design:type",Boolean)],e.prototype,"allProps",void 0),R([t.Input(),S("design:type",Boolean)],e.prototype,"toolbar",void 0),e=R([t.Component({selector:"kui-properties-view",template:'\x3c!-- properties --\x3e\n<div class="properties-container">\n    <div class="properties" *ngIf="!loading">\n\n        \x3c!-- list of properties --\x3e\n        <div *ngFor="let prop of propArray; let last = last">\n            \x3c!-- show property; all in case of showAll === true or only the ones with prop.values --\x3e\n            <div class="property" *ngIf="allProps || prop.values">\n                <div class="property-label">\n                    \x3c!-- label of the property --\x3e\n                    <h3 class="label mat-subheading-1">\n                        {{prop.propDef.label}}\n                    </h3>\n                </div>\n                <div class="property-value">\n\n                    \x3c!-- the value(s) of the property --\x3e\n                    <div class="property-value-item" *ngFor="let val of prop.values; let lastItem = last">\n\n                        <span *ngIf="prop.values" [class.list]="prop.values.length > 1"\n                              [class.lastItem]="lastItem">{{val.strval}}</span>\n\n                        \x3c!-- TODO: reactivate switch by value type as soon the new viewer elements are ready --\x3e\n                        \x3c!--\n                        <span [ngSwitch]="val.type" [class.list]="prop.values.length > 1" [class.lastItem]="lastItem">\n                            <kui-text-value-as-string *ngSwitchCase="KnoraConstants.TextValue" [valueObject]="val">\n                            </kui-text-value-as-string>\n                            <kui-text-value-as-xml *ngSwitchCase="KnoraConstants.TextValueAsXml" [valueObject]="val">\n                            </kui-text-value-as-xml>\n                            <kui-date-value *ngSwitchCase="KnoraConstants.ReadDateValue" [valueObject]="val"\n                                            [calendar]="true" [era]="true">\n                            </kui-date-value>\n                            <kui-link-value class="app-link" *ngSwitchCase="KnoraConstants.ReadLinkValue"\n                                            [valueObject]="val"\n                                            (referredResourceClicked)="openLink(val.referredResourceIri)">\n                            </kui-link-value>\n                            <kui-integer-value *ngSwitchCase="KnoraConstants.IntValue" [valueObject]="val">\n                            </kui-integer-value>\n                            <kui-decimal-value *ngSwitchCase="KnoraConstants.DecimalValue" [valueObject]="val">\n                            </kui-decimal-value>\n                            <kui-geometry-value *ngSwitchCase="KnoraConstants.GeomValue" [valueObject]="val">\n                            </kui-geometry-value>\n                            <kui-color-value *ngSwitchCase="KnoraConstants.ColorValue" [valueObject]="val">\n                            </kui-color-value>\n                            <kui-uri-value *ngSwitchCase="KnoraConstants.UriValue" [valueObject]="val">\n                            </kui-uri-value>\n                            <kui-boolean-value *ngSwitchCase="KnoraConstants.BooleanValue" [valueObject]="val">\n                            </kui-boolean-value>\n                            <kui-interval-value *ngSwitchCase="KnoraConstants.IntervalValue" [valueObject]="val">\n                            </kui-interval-value>\n                            <kui-list-value *ngSwitchCase="KnoraConstants.ReadListValue" [valueObject]="val">\n                            </kui-list-value>\n                            <kui-textfile-value *ngSwitchCase="KnoraConstants.FileValueHasFilename" [valueObject]="val">\n                            </kui-textfile-value>\n                            <span *ngSwitchDefault>Not supported {{val.type}}</span>\n                            <br>\n                        </span>\n                        --\x3e\n                    </div>\n                </div>\n            </div>\n        </div>\n\n\n        \x3c!-- TODO / QUESTION: What happend to incoming links and annotations? --\x3e\n        <div class="incoming">\n\n            \x3c!-- annotations are resources like region, sequence etc. --\x3e\n            \x3c!-- TODO: we can\'t display incoming annotations as expected\n            <div class="annotations">\n                \x3c!-- *ngIf="annotations?.length > 0"> --\n                <h3 class="label mat-subheading-1">\n                    Annotations\n                </h3>\n                <mat-list *ngFor="let annotation of annotations">\n                    <mat-list-item class="kui-link" (click)="openLink(annotation.id)">\n                        <span>{{annotation.label}}</span>\n                    </mat-list-item>\n                </mat-list>\n            </div>\n            --\x3e\n\n            \x3c!-- incoming links --\x3e\n            \x3c!-- <div class="links" *ngIf="incomingLinks?.length > 0">\n                <h3 class="label mat-subheading-1">\n                    Links\n                </h3>\n                <ul>\n                    <li *ngFor="let incoming of incomingLinks" class="kui-link" (click)="openLink(incoming.id)">\n                        {{incoming.label}}\n                    </li>\n                </ul>\n            </div> --\x3e\n        </div>\n    </div>\n</div>\n',styles:['.mat-form-field{width:320px}.fill-remaining-space{-webkit-box-flex:1;flex:1 1 auto}.center{text-align:center}a{text-decoration:none;color:inherit}.kui-link{cursor:pointer;border-bottom:2px solid rgba(0,105,92,.25)}.lv-prop-label{color:rgba(0,0,0,.54)}.lv-html-text{position:relative;overflow:hidden}.properties-container{display:-ms-grid;display:grid;-ms-grid-columns:(1fr)[6];grid-template-columns:repeat(6,1fr);gap:16px}.properties-container .incoming,.properties-container .properties{margin-top:16px}.properties-container .properties{-ms-grid-column:1;-ms-grid-column-span:4;grid-column:1/span 4}.properties-container .properties .property{-ms-grid-row:1;grid-row:1/1;display:-ms-grid;display:grid;-ms-grid-columns:(1fr)[4];grid-template-columns:repeat(4,1fr);gap:16px}.properties-container .properties .property .property-label,.properties-container .properties .property .property-value{padding:2px;overflow-wrap:break-word}.properties-container .properties .property .property-label{-ms-grid-column:1;-ms-grid-column-span:1;grid-column:1/span 1}.properties-container .properties .property .property-label .label{text-align:right}.properties-container .properties .property .property-value{padding-top:5px;-ms-grid-column:2;-ms-grid-column-span:3;grid-column:2/span 3}.properties-container .incoming{-ms-grid-column:5;-ms-grid-column-span:2;grid-column:5/span 2;display:-ms-grid;display:grid;gap:16px;-ms-grid-columns:1fr 1fr;grid-template-columns:1fr 1fr;-ms-grid-rows:(minmax(60px,auto))[6];grid-template-rows:repeat(6,minmax(60px,auto))}.properties-container .incoming .annotations,.properties-container .incoming .links{padding:16px;-ms-grid-column:1;-ms-grid-column-span:2;grid-column:1/span 2;border-radius:6px}.properties-container .incoming .annotations ul,.properties-container .incoming .links ul{-webkit-padding-start:5px;padding-inline-start:5px;list-style-type:none}.properties-container .incoming .annotations ul li,.properties-container .incoming .links ul li{margin-bottom:10px;text-indent:-8px}.properties-container .incoming .annotations ul li:before,.properties-container .incoming .links ul li:before{content:"- "}.properties-container .incoming .annotations{background:rgba(245,222,179,.39)}.properties-container .incoming .links{background:rgba(222,184,135,.39)}.label{color:rgba(0,0,0,.54)}@media screen and (max-width:768px){.incoming,.properties{-ms-grid-column:1!important;-ms-grid-column-span:6!important;grid-column:1/span 6!important;gap:0!important}.incoming .property,.properties .property{gap:0!important}.incoming .annotations,.incoming .links,.incoming .property-label,.incoming .property-value,.properties .annotations,.properties .links,.properties .property-label,.properties .property-value{-ms-grid-column:1!important;-ms-grid-column-span:4!important;grid-column:1/span 4!important}h3.label{text-align:left!important;margin:16px 0 0!important}}']}),S("design:paramtypes",[o.Router])],e)}(),te=function(){function e(){}return e.list=[n.Constants.KnoraApiV2+n.Constants.Delimiter+"hasAudioFileValue",n.Constants.KnoraApiV2+n.Constants.Delimiter+"hasDDDFileValue",n.Constants.KnoraApiV2+n.Constants.Delimiter+"hasMovingImageFileValue",n.Constants.KnoraApiV2+n.Constants.Delimiter+"hasStillImageFileValue",n.Constants.KnoraApiV2+n.Constants.Delimiter+"hasTextFileValue"],e}(),ne=(require("jsonld"),function(){function e(e,t,i){this.knoraApiConnection=e,this._route=t,this._router=i,this.allProps=!1,this.toolbar=!1,this.propArray=[],this.Constants=n.Constants}return e.prototype.ngOnInit=function(){},e.prototype.ngOnChanges=function(){this.getResource(this.iri)},e.prototype.getResource=function(e){var t=this;this.loading=!0,this.error=void 0,this.knoraApiConnection.v2.res.getResource(e).subscribe((function(e){var i,o;t.resource=e;var r=t.resource.entityInfo.classes[t.resource.type].propertiesList;try{for(var a=_(r),l=a.next();!l.done;l=a.next()){var s=l.value,p=s.propertyIndex;if(te.list.includes(p))t.fileRepresentation=t.resource.properties[p];else if(t.resource.entityInfo.properties[p]&&t.resource.entityInfo.properties[p]instanceof n.ResourcePropertyDefinition){var c={guiDef:s,propDef:t.resource.entityInfo.properties[p],values:t.resource.properties[p]};t.propArray.push(c)}0}}catch(e){i={error:e}}finally{try{l&&!l.done&&(o=a.return)&&o.call(a)}finally{if(i)throw i.error}}t.propArray.sort((function(e,t){return e.guiDef.guiOrder>t.guiDef.guiOrder?1:-1})),t.loading=!1}),(function(e){console.error(e),t.loading=!1}))},e.prototype.openLink=function(e){this.loading=!0,this._router.navigate(["/resource/"+encodeURIComponent(e)])},e.prototype.refreshProperties=function(e){},e.prototype.toggleProps=function(e){this.allProps=!this.allProps},e.ctorParameters=function(){return[{type:n.KnoraApiConnection,decorators:[{type:t.Inject,args:[i.KnoraApiConnectionToken]}]},{type:o.ActivatedRoute},{type:o.Router}]},R([t.Input(),S("design:type",String)],e.prototype,"iri",void 0),R([t.Input(),S("design:type",Boolean)],e.prototype,"allProps",void 0),R([t.Input(),S("design:type",Boolean)],e.prototype,"toolbar",void 0),R([t.ViewChild("kuiStillImage",{static:!1}),S("design:type",D)],e.prototype,"kuiStillImage",void 0),e=R([t.Component({selector:"kui-resource-view",template:'<kui-progress-indicator *ngIf="loading"></kui-progress-indicator>\n<div class="resource-view" *ngIf="!error && !loading && resource">\n\n    \x3c!-- media: show file representation --\x3e\n    <div *ngIf="fileRepresentation">\n        <div [ngSwitch]="fileRepresentation[0].type" class="media">\n\n            <kui-still-image *ngSwitchCase="Constants.StillImageFileValue" #kuiStillImage class="osd-viewer"\n                             [images]="fileRepresentation">\n            </kui-still-image>\n\n            \x3c!-- TODO: switch through all other media type --\n            <kui-moving-image></kui-moving-image>\n            <kui-audio></kui-audio>\n            <kui-ddd></kui-ddd>\n            <kui-document></kui-document>\n\n            <kui-collection></kui-collection>\n\n            <kui-annotation></kui-annotation>\n            <kui-link-obj></kui-link-obj>\n            <kui-object></kui-object>\n            <kui-region></kui-region>\n            <kui-text></kui-text>\n            --\x3e\n\n            <kui-message *ngSwitchDefault [medium]="true"\n                         [message]="{status: 501, statusMsg: \'Not yet implemented\', statusText: fileRepresentation[0].type + \' is not yet implemented\'}">\n            </kui-message>\n\n        </div>\n    </div>\n\n    \x3c!-- properties / meta data --\x3e\n    \x3c!-- tabs with header toolbar and properties --\x3e\n    <mat-tab-group animationDuration="0ms" class="full-width data">\n        \x3c!-- first tab for the main resource e.g. book --\x3e\n        <mat-tab [label]="resource.entityInfo?.classes[resource.type].label">\n            \x3c!-- header with project / ontology / resource class info / ark url --\x3e\n            <kui-properties-toolbar *ngIf="toolbar" [projectiri]="resource.attachedToProject" [allProps]="allProps"\n                                    (toggleProps)="toggleProps($event)">\n            </kui-properties-toolbar>\n\n            <kui-properties-view [propArray]="propArray" [toolbar]="toolbar" [allProps]="allProps">\n            </kui-properties-view>\n\n        </mat-tab>\n\n        \x3c!-- TODO: second tab for a "part-of"-resource e.g. book page --\x3e\n        \x3c!-- TODO: knora-api-js-lib: incoming file representations is empty; can\'t test it --\x3e\n        \x3c!-- <mat-tab *ngIf="resource.incomingReferences.length > 0 && activeResource"\n                 [label]="sequence.ontologyInformation.getLabelForResourceClass(activeResource.type)">\n        </mat-tab> --\x3e\n\n        \x3c!-- TODO: third tab for a "region"-resource e.g. region on book page --\x3e\n        \x3c!-- <mat-tab></mat-tab> --\x3e\n    </mat-tab-group>\n</div>\n\n\x3c!-- in case of an error show the following message --\x3e\n<div class="resource-view error content large middle" *ngIf="error">\n    <kui-message *ngIf="error" [message]="error" [medium]="true"></kui-message>\n</div>\n',styles:['.mat-form-field{width:320px}.fill-remaining-space{-webkit-box-flex:1;flex:1 1 auto}.center{text-align:center}a{text-decoration:none;color:inherit}.kui-link{cursor:pointer;border-bottom:2px solid rgba(0,105,92,.25)}.lv-prop-label{color:rgba(0,0,0,.54)}.lv-html-text{position:relative;overflow:hidden}.resource-view{max-width:960px;margin:0 auto}.resource-view .media{height:500px;display:block;margin:0 auto}.resource-view .data{min-height:700px;padding:24px 36px}.hidden{display:none}.property{margin-bottom:12px}.property .property-value-item{min-height:48px;height:auto}.property .property-value-item li{list-style-type:none}.property .property-value-item li.list:before{content:"-    "}.property .property-value-item li.lastItem{margin-bottom:12px}@media (max-width:576px){.resource-view .resource .media{width:auto}}']}),V(0,t.Inject(i.KnoraApiConnectionToken)),S("design:paramtypes",[n.KnoraApiConnection,o.ActivatedRoute,o.Router])],e)}()),ie=function(){function e(){}return e.prototype.ngOnInit=function(){},R([t.Input(),S("design:type",Object)],e.prototype,"result",void 0),R([t.Input(),S("design:type",Object)],e.prototype,"ontologyInfo",void 0),e=R([t.Component({selector:"kui-table-view",template:"<p>\n  table-view works!\n</p>\n",styles:[""]}),S("design:paramtypes",[])],e)}(),oe=function(){function e(e,t,n,i){this.knoraApiConnection=e,this._route=t,this._searchParamsService=n,this._router=i,this.complexView=!1,this.viewAs="list",this.result=[],this.badRequest=!1,this.loading=!0,this.pagingLimit=25}return e.prototype.ngOnInit=function(){},e.prototype.ngOnChanges=function(){var e=this;this._route.paramMap.subscribe((function(t){e.searchMode||(e.searchMode=t.get("mode")),t.get("project")&&e.projectIri!==decodeURIComponent(t.get("project"))&&(e.projectIri=decodeURIComponent(t.get("project"))),e.initSearch=e.searchQuery!==t.get("q")||e.searchQuery!==e.gravSearchQuery,e.pageEvent&&!e.initSearch||e.resetPage(),"fulltext"===e.searchMode?(e.searchQuery=t.get("q"),e.badRequest=e.searchQuery.length<3):"extended"===e.searchMode&&(e.gravsearchGenerator=e._searchParamsService.getSearchParams(),e.searchQuery?e.gravSearchQuery=e.searchQuery:e.generateGravsearchQuery()),e.getResult()}))},e.prototype.resetPage=function(){this.pageEvent=new r.PageEvent,this.pageEvent.pageIndex=0,this.result=[]},e.prototype.generateGravsearchQuery=function(){var e=this.gravsearchGenerator.generateGravsearch(this.pageEvent.pageIndex);!1!==e?this.gravSearchQuery=e:this._router.navigate([""],{relativeTo:this._route})},e.prototype.getResult=function(){var e=this;if(this.loading=!0,this.errorMessage=void 0,"fulltext"===this.searchMode)if(this.badRequest)this.errorMessage=void 0,this.loading=!1;else{var t=void 0;void 0!==this.projectIri&&(t={limitToProject:this.projectIri}),0===this.pageEvent.pageIndex&&this.knoraApiConnection.v2.search.doFulltextSearchCountQuery(this.searchQuery,this.pageEvent.pageIndex,t).subscribe((function(t){e.numberOfAllResults=t.numberOfResults}),(function(t){e.errorMessage=t})),this.knoraApiConnection.v2.search.doFulltextSearch(this.searchQuery,this.pageEvent.pageIndex,t).subscribe((function(t){e.result=t,e.loading=!1}),(function(t){e.errorMessage=t,console.error(t),e.loading=!1}))}else"extended"===this.searchMode&&(0===this.pageEvent.pageIndex&&this.knoraApiConnection.v2.search.doExtendedSearchCountQuery(this.gravSearchQuery).subscribe((function(t){e.numberOfAllResults=t.numberOfResults}),(function(t){e.errorMessage=t})),this.knoraApiConnection.v2.search.doExtendedSearch(this.gravSearchQuery).subscribe((function(t){e.result=t,e.loading=!1}),(function(t){e.errorMessage=t,e.loading=!1})))},e.prototype.processSearchResults=function(e){void 0===this.ontologyInfo&&(this.ontologyInfo=e[0].entityInfo),this.result=this.result.concat(e),this.loading=!1},e.prototype.loadMore=function(e){this.pageEvent=e,"extended"===this.searchMode&&this.generateGravsearchQuery(),this.getResult()},e.ctorParameters=function(){return[{type:n.KnoraApiConnection,decorators:[{type:t.Inject,args:[i.KnoraApiConnectionToken]}]},{type:o.ActivatedRoute},{type:i.SearchParamsService},{type:o.Router}]},R([t.Input(),S("design:type",Boolean)],e.prototype,"complexView",void 0),R([t.Input(),S("design:type",String)],e.prototype,"viewAs",void 0),R([t.Input(),S("design:type",String)],e.prototype,"searchQuery",void 0),R([t.Input(),S("design:type",String)],e.prototype,"searchMode",void 0),R([t.Input(),S("design:type",String)],e.prototype,"projectIri",void 0),e=R([t.Component({selector:"kui-search-results",template:'\x3c!-- header / toolbar to select view and pagination --\x3e\n<div class="search-results-header">\n    <span class="switch-view" *ngIf="complexView">\n        <span class="switch-view-label">Show as</span>\n        <button mat-button (click)="viewAs = \'list\'" [class.active]="viewAs === \'list\'">\n            <mat-icon>view_list</mat-icon> List\n        </button>\n        <button mat-button (click)="viewAs = \'grid\'" [class.active]="viewAs === \'grid\'">\n            <mat-icon>view_module</mat-icon> Grid\n        </button>\n        \x3c!-- TODO: add button to show as table, if possible (filter by same resource class) --\x3e\n    </span>\n    <span class="fill-remaining-space"></span>\n    <span class="page-navigation">\n        <mat-paginator [length]="numberOfAllResults" [pageSize]="25" [hidePageSize]="true"\n            [pageIndex]="pageEvent.pageIndex" (page)="loadMore($event)">\n        </mat-paginator>\n    </span>\n</div>\n\n\x3c!-- container with search results --\x3e\n<div class="search-results-container">\n    <kui-progress-indicator *ngIf="loading"></kui-progress-indicator>\n\n    <div class="search-results" *ngIf="!loading && numberOfAllResults > 0 && result">\n        <div [ngSwitch]="viewAs">\n            <kui-list-view *ngSwitchCase="\'list\'" [result]="result"></kui-list-view>\n            <kui-grid-view *ngSwitchCase="\'grid\'" [result]="result"></kui-grid-view>\n            \x3c!-- TODO: implement table view --\x3e\n            \x3c!-- <kui-table-view *ngSwitchCase="\'table\'" [result]="result"></kui-table-view> --\x3e\n        </div>\n\n    </div>\n\n    \x3c!-- In case of 0 result --\x3e\n    <div class="search-results zero" *ngIf="!loading && numberOfAllResults === 0">\n        <kui-message\n            [message]="{status: 404, statusMsg: \'No results\', statusText: \'Sorry, but we couldn\\\'t find any results matching your search\'}"\n            [medium]="true">\n        </kui-message>\n    </div>\n\n</div>\n\n\x3c!-- footer with pagination --\x3e\n<div class="search-results-footer" *ngIf="numberOfAllResults > 25 && !loading">\n    <span class="fill-remaining-space"></span>\n    <span class="page-navigation">\n        <mat-paginator [length]="numberOfAllResults" [pageSize]="25" [hidePageSize]="true"\n            [pageIndex]="pageEvent.pageIndex" (page)="loadMore($event)">\n        </mat-paginator>\n    </span>\n</div>\n',styles:[".search-results-footer,.search-results-header{display:-webkit-box;display:flex;box-sizing:border-box;-webkit-box-orient:horizontal;-webkit-box-direction:normal;flex-direction:row;-webkit-box-align:center;align-items:center;white-space:nowrap;padding:0 16px;height:58px;width:100%;z-index:1;background:#fff}.search-results-header{border-bottom:1px solid rgba(0,0,0,.12);position:-webkit-sticky!important;position:sticky!important;top:64px}.search-results-header .switch-view-label{margin-right:16px}button.active{background-color:#e0e0e0}.load-panel{width:100%}.load-panel .center{display:block;line-height:24px;margin:12px auto}.tab-icon{margin-right:8px}"]}),V(0,t.Inject(i.KnoraApiConnectionToken)),S("design:paramtypes",[n.KnoraApiConnection,o.ActivatedRoute,i.SearchParamsService,o.Router])],e)}(),re=function(){function e(e){this.knoraApiConnection=e,this.toggleProps=new t.EventEmitter}return e.prototype.ngOnInit=function(){var e=this;this.knoraApiConnection.admin.projectsEndpoint.getProjectByIri(this.projectiri).subscribe((function(t){e.project=t.body.project}),(function(e){console.error(e)}))},e.ctorParameters=function(){return[{type:n.KnoraApiConnection,decorators:[{type:t.Inject,args:[i.KnoraApiConnectionToken]}]}]},R([t.Input(),S("design:type",String)],e.prototype,"projectiri",void 0),R([t.Input(),S("design:type",String)],e.prototype,"ontologyiri",void 0),R([t.Input(),S("design:type",String)],e.prototype,"arkurl",void 0),R([t.Input(),S("design:type",Boolean)],e.prototype,"allProps",void 0),R([t.Output(),S("design:type",t.EventEmitter)],e.prototype,"toggleProps",void 0),e=R([t.Component({selector:"kui-properties-toolbar",template:'<div class="toolbar" *ngIf="project">\n    \x3c!-- project info --\x3e\n    <h3 class="label mat-subheading-1">This source belongs to\n        <a [href]="\'/project/\' + project.shortcode">\n            {{project.shortname}}\n            <mat-icon inline>open_in_new</mat-icon>\n        </a>\n    </h3>\n    \x3c!-- open_in_new icon --\x3e\n    <span class="fill-remaining-space"></span>\n\n    \x3c!-- tools: share, add to favorites, edit, delete etc. --\x3e\n    <span>\n        <button mat-button>\n            <mat-icon>star_border</mat-icon>\n        </button>\n\n        <button mat-button (click)="toggleProps.emit(!allProps)">\n            <mat-icon>edit</mat-icon>\n        </button>\n\n        <button mat-button>\n            <mat-icon>delete</mat-icon>\n        </button>\n\n        <button mat-button>\n            <mat-icon>share</mat-icon>\n        </button>\n    </span>\n\n</div>\n',styles:[".toolbar{display:-webkit-box;display:flex;box-sizing:border-box;-webkit-box-orient:horizontal;-webkit-box-direction:normal;flex-direction:row;-webkit-box-align:center;align-items:center;white-space:nowrap;padding:0 16px;width:100%;background:#f5f5f5;color:rgba(0,0,0,.87)}.toolbar .label{margin:0!important}"]}),V(0,t.Inject(i.KnoraApiConnectionToken)),S("design:paramtypes",[n.KnoraApiConnection])],e)}(),ae=function(){function e(){}return e=R([t.NgModule({imports:[a.CommonModule,i.KuiCoreModule,C.KuiActionModule,p.MatAutocompleteModule,c.MatButtonModule,u.MatCardModule,d.MatCheckboxModule,m.MatDatepickerModule,v.MatExpansionModule,f.MatFormFieldModule,b.MatInputModule,h.MatIconModule,y.MatListModule,r.MatMenuModule,g.MatNativeDateModule,x.MatPaginatorModule,k.MatSlideToggleModule,w.MatTabsModule,O.MatToolbarModule,I.MatTooltipModule,s.ReactiveFormsModule,l.FlexLayoutModule],declarations:[P,D,Q,H,X,J,L,U,K,F,$,T,q,G,B,N,z,Y,W,ie,ne,ee,oe,re],exports:[P,D,Q,H,X,J,L,U,K,F,$,T,q,G,B,N,z,Y,W,ie,ne,ee,oe]})],e)}();e.BooleanValueComponent=T,e.ColorValueComponent=K,e.DateValueComponent=L,e.DecimalValueComponent=F,e.FileRepresentation=te,e.GeometryForRegion=E,e.GeometryValueComponent=q,e.GeonameValueComponent=G,e.GridViewComponent=W,e.ImageRegion=A,e.IntegerValueComponent=U,e.IntervalValueComponent=B,e.KuiViewerModule=ae,e.LinkValueComponent=z,e.ListValueComponent=N,e.ListViewComponent=Y,e.MovingImageComponent=P,e.PropertiesViewComponent=ee,e.ReadTextFileValue=Z,e.ResourceViewComponent=ne,e.SearchResultsComponent=oe,e.StillImageComponent=D,e.StillImageRepresentation=M,e.TableViewComponent=ie,e.TextValueAsHtmlComponent=Q,e.TextValueAsStringComponent=H,e.TextValueAsXmlComponent=X,e.TextfileValueComponent=J,e.UriValueComponent=$,e.ɵa=P,e.ɵb=D,e.ɵc=Q,e.ɵd=H,e.ɵe=X,e.ɵf=J,e.ɵg=L,e.ɵh=U,e.ɵi=K,e.ɵj=F,e.ɵk=$,e.ɵl=T,e.ɵm=q,e.ɵn=G,e.ɵo=B,e.ɵp=N,e.ɵq=z,e.ɵr=Y,e.ɵs=W,e.ɵt=ie,e.ɵu=ne,e.ɵv=ee,e.ɵw=oe,e.ɵx=re,Object.defineProperty(e,"__esModule",{value:!0})}));
//# sourceMappingURL=knora-viewer.umd.min.js.map