UNPKG

universalviewer

Version:

The Universal Viewer is a community-developed open source project on a mission to help you share your 📚📜📰📽️📻🗿 with the 🌎

1 lines 112 kB
import{c as k,d as b}from"./chunk-L67DAW3A.js";var H=k(C=>{"use strict";Object.defineProperty(C,"__esModule",{value:!0});var ee;(function(o){o.BOOKMARKING="oa:bookmarking",o.CLASSIFYING="oa:classifying",o.COMMENTING="oa:commenting",o.DESCRIBING="oa:describing",o.EDITING="oa:editing",o.HIGHLIGHTING="oa:highlighting",o.IDENTIFYING="oa:identifying",o.LINKING="oa:linking",o.MODERATING="oa:moderating",o.PAINTING="sc:painting",o.QUESTIONING="oa:questioning",o.REPLYING="oa:replying",o.TAGGING="oa:tagging",o.TRANSCRIBING="oad:transcribing"})(ee=C.AnnotationMotivation||(C.AnnotationMotivation={}));var te;(function(o){o.AUTO_ADVANCE="auto-advance",o.CONTINUOUS="continuous",o.FACING_PAGES="facing-pages",o.HIDDEN="hidden",o.INDIVIDUALS="individuals",o.MULTI_PART="multi-part",o.NO_NAV="no-nav",o.NON_PAGED="non-paged",o.PAGED="paged",o.REPEAT="repeat",o.SEQUENCE="sequence",o.THUMBNAIL_NAV="thumbnail-nav",o.TOGETHER="together",o.UNORDERED="unordered"})(te=C.Behavior||(C.Behavior={}));var ne;(function(o){o.CANVAS="canvas",o.CHOICE="choice",o.OA_CHOICE="oa:choice",o.CONTENT_AS_TEXT="contentastext",o.DATASET="dataset",o.DOCUMENT="document",o.IMAGE="image",o.MODEL="model",o.MOVING_IMAGE="movingimage",o.PDF="pdf",o.PHYSICAL_OBJECT="physicalobject",o.SOUND="sound",o.TEXT="text",o.TEXTUALBODY="textualbody",o.VIDEO="video"})(ne=C.ExternalResourceType||(C.ExternalResourceType={}));var re;(function(o){o.ANNOTATION="annotation",o.CANVAS="canvas",o.COLLECTION="collection",o.MANIFEST="manifest",o.RANGE="range",o.SEQUENCE="sequence"})(re=C.IIIFResourceType||(C.IIIFResourceType={}));var ie;(function(o){o.AUDIO_MP4="audio/mp4",o.CORTO="application/corto",o.DICOM="application/dicom",o.DRACO="application/draco",o.EPUB="application/epub+zip",o.GIRDER="image/vnd.kitware.girder",o.GLB="model/gltf-binary",o.GLTF="model/gltf+json",o.IIIF_PRESENTATION_2='application/ld+json;profile="http://iiif.io/api/presentation/2/context.json"',o.IIIF_PRESENTATION_3='application/ld+json;profile="http://iiif.io/api/presentation/3/context.json"',o.JPG="image/jpeg",o.M3U8="application/vnd.apple.mpegurl",o.MP3="audio/mp3",o.MPEG_DASH="application/dash+xml",o.OBJ="text/plain",o.OPF="application/oebps-package+xml",o.PDF="application/pdf",o.PLY="application/ply",o.THREEJS="application/vnd.threejs+json",o.USDZ="model/vnd.usd+zip",o.VIDEO_MP4="video/mp4",o.WAV="audio/wav",o.WEBM="video/webm"})(ie=C.MediaType||(C.MediaType={}));var oe;(function(o){o.DOC="application/msword",o.DOCX="application/vnd.openxmlformats-officedocument.wordprocessingml.document",o.PDF="application/pdf"})(oe=C.RenderingFormat||(C.RenderingFormat={}));var ae;(function(o){o.IMAGE_0_COMPLIANCE_LEVEL_0="http://library.stanford.edu/iiif/image-api/compliance.html#level0",o.IMAGE_0_COMPLIANCE_LEVEL_1="http://library.stanford.edu/iiif/image-api/compliance.html#level1",o.IMAGE_0_COMPLIANCE_LEVEL_2="http://library.stanford.edu/iiif/image-api/compliance.html#level2",o.IMAGE_0_CONFORMANCE_LEVEL_0="http://library.stanford.edu/iiif/image-api/conformance.html#level0",o.IMAGE_0_CONFORMANCE_LEVEL_1="http://library.stanford.edu/iiif/image-api/conformance.html#level1",o.IMAGE_0_CONFORMANCE_LEVEL_2="http://library.stanford.edu/iiif/image-api/conformance.html#level2",o.IMAGE_1_COMPLIANCE_LEVEL_0="http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level0",o.IMAGE_1_COMPLIANCE_LEVEL_1="http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level1",o.IMAGE_1_COMPLIANCE_LEVEL_2="http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level2",o.IMAGE_1_CONFORMANCE_LEVEL_0="http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level0",o.IMAGE_1_CONFORMANCE_LEVEL_1="http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level1",o.IMAGE_1_CONFORMANCE_LEVEL_2="http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level2",o.IMAGE_1_LEVEL_0="http://iiif.io/api/image/1/level0.json",o.IMAGE_1_PROFILE_LEVEL_0="http://iiif.io/api/image/1/profiles/level0.json",o.IMAGE_1_LEVEL_1="http://iiif.io/api/image/1/level1.json",o.IMAGE_1_PROFILE_LEVEL_1="http://iiif.io/api/image/1/profiles/level1.json",o.IMAGE_1_LEVEL_2="http://iiif.io/api/image/1/level2.json",o.IMAGE_1_PROFILE_LEVEL_2="http://iiif.io/api/image/1/profiles/level2.json",o.IMAGE_2_LEVEL_0="http://iiif.io/api/image/2/level0.json",o.IMAGE_2_PROFILE_LEVEL_0="http://iiif.io/api/image/2/profiles/level0.json",o.IMAGE_2_LEVEL_1="http://iiif.io/api/image/2/level1.json",o.IMAGE_2_PROFILE_LEVEL_1="http://iiif.io/api/image/2/profiles/level1.json",o.IMAGE_2_LEVEL_2="http://iiif.io/api/image/2/level2.json",o.IMAGE_2_PROFILE_LEVEL_2="http://iiif.io/api/image/2/profiles/level2.json",o.AUTH_0_CLICK_THROUGH="http://iiif.io/api/auth/0/login/clickthrough",o.AUTH_0_LOGIN="http://iiif.io/api/auth/0/login",o.AUTH_0_LOGOUT="http://iiif.io/api/auth/0/logout",o.AUTH_0_RESTRICTED="http://iiif.io/api/auth/0/login/restricted",o.AUTH_0_TOKEN="http://iiif.io/api/auth/0/token",o.AUTH_1_CLICK_THROUGH="http://iiif.io/api/auth/1/clickthrough",o.AUTH_1_EXTERNAL="http://iiif.io/api/auth/1/external",o.AUTH_1_KIOSK="http://iiif.io/api/auth/1/kiosk",o.AUTH_1_LOGIN="http://iiif.io/api/auth/1/login",o.AUTH_1_LOGOUT="http://iiif.io/api/auth/1/logout",o.AUTH_1_PROBE="http://iiif.io/api/auth/1/probe",o.AUTH_1_TOKEN="http://iiif.io/api/auth/1/token",o.SEARCH_0="http://iiif.io/api/search/0/search",o.SEARCH_0_AUTO_COMPLETE="http://iiif.io/api/search/0/autocomplete",o.SEARCH_1="http://iiif.io/api/search/1/search",o.SEARCH_1_AUTO_COMPLETE="http://iiif.io/api/search/1/autocomplete",o.TRACKING_EXTENSIONS="http://universalviewer.io/tracking-extensions-profile",o.UI_EXTENSIONS="http://universalviewer.io/ui-extensions-profile",o.PRINT_EXTENSIONS="http://universalviewer.io/print-extensions-profile",o.SHARE_EXTENSIONS="http://universalviewer.io/share-extensions-profile",o.DOWNLOAD_EXTENSIONS="http://universalviewer.io/download-extensions-profile",o.OTHER_MANIFESTATIONS="http://iiif.io/api/otherManifestations.json",o.IXIF="http://wellcomelibrary.org/ld/ixif/0/alpha.json"})(ae=C.ServiceProfile||(C.ServiceProfile={}));var se;(function(o){o.IMAGE_SERVICE_2="ImageService2",o.IMAGE_SERVICE_3="ImageService3"})(se=C.ServiceType||(C.ServiceType={}));var ue;(function(o){o.BOTTOM_TO_TOP="bottom-to-top",o.LEFT_TO_RIGHT="left-to-right",o.RIGHT_TO_LEFT="right-to-left",o.TOP_TO_BOTTOM="top-to-bottom"})(ue=C.ViewingDirection||(C.ViewingDirection={}));var le;(function(o){o.CONTINUOUS="continuous",o.INDIVIDUALS="individuals",o.NON_PAGED="non-paged",o.PAGED="paged",o.TOP="top"})(le=C.ViewingHint||(C.ViewingHint={}))});var j=k((V,q)=>{(function(o,t){typeof V=="object"&&typeof q=="object"?q.exports=t():typeof define=="function"&&define.amd?define("manifesto",[],t):typeof V=="object"?V.manifesto=t():o.manifesto=t()})(typeof self<"u"?self:V,function(){return function(o){var t={};function i(r){if(t[r])return t[r].exports;var l=t[r]={i:r,l:!1,exports:{}};return o[r].call(l.exports,l,l.exports,i),l.l=!0,l.exports}return i.m=o,i.c=t,i.d=function(r,l,p){i.o(r,l)||Object.defineProperty(r,l,{enumerable:!0,get:p})},i.r=function(r){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(r,"__esModule",{value:!0})},i.t=function(r,l){if(1&l&&(r=i(r)),8&l||4&l&&typeof r=="object"&&r&&r.__esModule)return r;var p=Object.create(null);if(i.r(p),Object.defineProperty(p,"default",{enumerable:!0,value:r}),2&l&&typeof r!="string")for(var a in r)i.d(p,a,function(f){return r[f]}.bind(null,a));return p},i.n=function(r){var l=r&&r.__esModule?function(){return r.default}:function(){return r};return i.d(l,"a",l),l},i.o=function(r,l){return Object.prototype.hasOwnProperty.call(r,l)},i.p="",i(i.s=7)}([function(o,t,i){"use strict";var r=this&&this.__createBinding||(Object.create?function(p,a,f,c){c===void 0&&(c=f);var n=Object.getOwnPropertyDescriptor(a,f);n&&!("get"in n?!a.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return a[f]}}),Object.defineProperty(p,c,n)}:function(p,a,f,c){c===void 0&&(c=f),p[c]=a[f]}),l=this&&this.__exportStar||function(p,a){for(var f in p)f==="default"||Object.prototype.hasOwnProperty.call(a,f)||r(a,p,f)};Object.defineProperty(t,"__esModule",{value:!0}),l(i(9),t),l(i(10),t),l(i(11),t),l(i(12),t),l(i(13),t),l(i(14),t),l(i(15),t),l(i(16),t),l(i(17),t),l(i(31),t),l(i(32),t),l(i(33),t),l(i(34),t),l(i(35),t),l(i(36),t),l(i(37),t),l(i(38),t),l(i(39),t),l(i(40),t),l(i(41),t),l(i(42),t),l(i(45),t),l(i(46),t),l(i(47),t),l(i(48),t),l(i(49),t),l(i(50),t),l(i(51),t),l(i(52),t),l(i(53),t),l(i(54),t),l(i(55),t),l(i(56),t),l(i(57),t),l(i(3),t)},function(o,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(r){r.BOOKMARKING="oa:bookmarking",r.CLASSIFYING="oa:classifying",r.COMMENTING="oa:commenting",r.DESCRIBING="oa:describing",r.EDITING="oa:editing",r.HIGHLIGHTING="oa:highlighting",r.IDENTIFYING="oa:identifying",r.LINKING="oa:linking",r.MODERATING="oa:moderating",r.PAINTING="sc:painting",r.QUESTIONING="oa:questioning",r.REPLYING="oa:replying",r.TAGGING="oa:tagging",r.TRANSCRIBING="oad:transcribing"}(t.AnnotationMotivation||(t.AnnotationMotivation={})),function(r){r.AUTO_ADVANCE="auto-advance",r.CONTINUOUS="continuous",r.FACING_PAGES="facing-pages",r.HIDDEN="hidden",r.INDIVIDUALS="individuals",r.MULTI_PART="multi-part",r.NO_NAV="no-nav",r.NON_PAGED="non-paged",r.PAGED="paged",r.REPEAT="repeat",r.SEQUENCE="sequence",r.THUMBNAIL_NAV="thumbnail-nav",r.TOGETHER="together",r.UNORDERED="unordered"}(t.Behavior||(t.Behavior={})),function(r){r.CANVAS="canvas",r.CHOICE="choice",r.OA_CHOICE="oa:choice",r.CONTENT_AS_TEXT="contentastext",r.DATASET="dataset",r.DOCUMENT="document",r.IMAGE="image",r.MODEL="model",r.MOVING_IMAGE="movingimage",r.PDF="pdf",r.PHYSICAL_OBJECT="physicalobject",r.SOUND="sound",r.TEXT="text",r.TEXTUALBODY="textualbody",r.VIDEO="video"}(t.ExternalResourceType||(t.ExternalResourceType={})),function(r){r.ANNOTATION="annotation",r.CANVAS="canvas",r.COLLECTION="collection",r.MANIFEST="manifest",r.RANGE="range",r.SEQUENCE="sequence"}(t.IIIFResourceType||(t.IIIFResourceType={})),function(r){r.AUDIO_MP4="audio/mp4",r.CORTO="application/corto",r.DICOM="application/dicom",r.DRACO="application/draco",r.EPUB="application/epub+zip",r.GIRDER="image/vnd.kitware.girder",r.GLB="model/gltf-binary",r.GLTF="model/gltf+json",r.IIIF_PRESENTATION_2='application/ld+json;profile="http://iiif.io/api/presentation/2/context.json"',r.IIIF_PRESENTATION_3='application/ld+json;profile="http://iiif.io/api/presentation/3/context.json"',r.JPG="image/jpeg",r.M3U8="application/vnd.apple.mpegurl",r.MP3="audio/mp3",r.MPEG_DASH="application/dash+xml",r.OBJ="text/plain",r.OPF="application/oebps-package+xml",r.PDF="application/pdf",r.PLY="application/ply",r.THREEJS="application/vnd.threejs+json",r.USDZ="model/vnd.usd+zip",r.VIDEO_MP4="video/mp4",r.WAV="audio/wav",r.WEBM="video/webm"}(t.MediaType||(t.MediaType={})),function(r){r.DOC="application/msword",r.DOCX="application/vnd.openxmlformats-officedocument.wordprocessingml.document",r.PDF="application/pdf"}(t.RenderingFormat||(t.RenderingFormat={})),function(r){r.IMAGE_0_COMPLIANCE_LEVEL_0="http://library.stanford.edu/iiif/image-api/compliance.html#level0",r.IMAGE_0_COMPLIANCE_LEVEL_1="http://library.stanford.edu/iiif/image-api/compliance.html#level1",r.IMAGE_0_COMPLIANCE_LEVEL_2="http://library.stanford.edu/iiif/image-api/compliance.html#level2",r.IMAGE_0_CONFORMANCE_LEVEL_0="http://library.stanford.edu/iiif/image-api/conformance.html#level0",r.IMAGE_0_CONFORMANCE_LEVEL_1="http://library.stanford.edu/iiif/image-api/conformance.html#level1",r.IMAGE_0_CONFORMANCE_LEVEL_2="http://library.stanford.edu/iiif/image-api/conformance.html#level2",r.IMAGE_1_COMPLIANCE_LEVEL_0="http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level0",r.IMAGE_1_COMPLIANCE_LEVEL_1="http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level1",r.IMAGE_1_COMPLIANCE_LEVEL_2="http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level2",r.IMAGE_1_CONFORMANCE_LEVEL_0="http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level0",r.IMAGE_1_CONFORMANCE_LEVEL_1="http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level1",r.IMAGE_1_CONFORMANCE_LEVEL_2="http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level2",r.IMAGE_1_LEVEL_0="http://iiif.io/api/image/1/level0.json",r.IMAGE_1_PROFILE_LEVEL_0="http://iiif.io/api/image/1/profiles/level0.json",r.IMAGE_1_LEVEL_1="http://iiif.io/api/image/1/level1.json",r.IMAGE_1_PROFILE_LEVEL_1="http://iiif.io/api/image/1/profiles/level1.json",r.IMAGE_1_LEVEL_2="http://iiif.io/api/image/1/level2.json",r.IMAGE_1_PROFILE_LEVEL_2="http://iiif.io/api/image/1/profiles/level2.json",r.IMAGE_2_LEVEL_0="http://iiif.io/api/image/2/level0.json",r.IMAGE_2_PROFILE_LEVEL_0="http://iiif.io/api/image/2/profiles/level0.json",r.IMAGE_2_LEVEL_1="http://iiif.io/api/image/2/level1.json",r.IMAGE_2_PROFILE_LEVEL_1="http://iiif.io/api/image/2/profiles/level1.json",r.IMAGE_2_LEVEL_2="http://iiif.io/api/image/2/level2.json",r.IMAGE_2_PROFILE_LEVEL_2="http://iiif.io/api/image/2/profiles/level2.json",r.AUTH_0_CLICK_THROUGH="http://iiif.io/api/auth/0/login/clickthrough",r.AUTH_0_LOGIN="http://iiif.io/api/auth/0/login",r.AUTH_0_LOGOUT="http://iiif.io/api/auth/0/logout",r.AUTH_0_RESTRICTED="http://iiif.io/api/auth/0/login/restricted",r.AUTH_0_TOKEN="http://iiif.io/api/auth/0/token",r.AUTH_1_CLICK_THROUGH="http://iiif.io/api/auth/1/clickthrough",r.AUTH_1_EXTERNAL="http://iiif.io/api/auth/1/external",r.AUTH_1_KIOSK="http://iiif.io/api/auth/1/kiosk",r.AUTH_1_LOGIN="http://iiif.io/api/auth/1/login",r.AUTH_1_LOGOUT="http://iiif.io/api/auth/1/logout",r.AUTH_1_PROBE="http://iiif.io/api/auth/1/probe",r.AUTH_1_TOKEN="http://iiif.io/api/auth/1/token",r.SEARCH_0="http://iiif.io/api/search/0/search",r.SEARCH_0_AUTO_COMPLETE="http://iiif.io/api/search/0/autocomplete",r.SEARCH_1="http://iiif.io/api/search/1/search",r.SEARCH_1_AUTO_COMPLETE="http://iiif.io/api/search/1/autocomplete",r.TRACKING_EXTENSIONS="http://universalviewer.io/tracking-extensions-profile",r.UI_EXTENSIONS="http://universalviewer.io/ui-extensions-profile",r.PRINT_EXTENSIONS="http://universalviewer.io/print-extensions-profile",r.SHARE_EXTENSIONS="http://universalviewer.io/share-extensions-profile",r.DOWNLOAD_EXTENSIONS="http://universalviewer.io/download-extensions-profile",r.OTHER_MANIFESTATIONS="http://iiif.io/api/otherManifestations.json",r.IXIF="http://wellcomelibrary.org/ld/ixif/0/alpha.json"}(t.ServiceProfile||(t.ServiceProfile={})),function(r){r.IMAGE_SERVICE_2="ImageService2",r.IMAGE_SERVICE_3="ImageService3"}(t.ServiceType||(t.ServiceType={})),function(r){r.BOTTOM_TO_TOP="bottom-to-top",r.LEFT_TO_RIGHT="left-to-right",r.RIGHT_TO_LEFT="right-to-left",r.TOP_TO_BOTTOM="top-to-bottom"}(t.ViewingDirection||(t.ViewingDirection={})),function(r){r.CONTINUOUS="continuous",r.INDIVIDUALS="individuals",r.NON_PAGED="non-paged",r.PAGED="paged",r.TOP="top"}(t.ViewingHint||(t.ViewingHint={}))},function(o,t,i){var r=i(21).Symbol;o.exports=r},function(o,t,i){"use strict";var r=this&&this.__awaiter||function(n,e,s,u){return new(s||(s=Promise))(function(h,g){function d(y){try{E(u.next(y))}catch(_){g(_)}}function v(y){try{E(u.throw(y))}catch(_){g(_)}}function E(y){var _;y.done?h(y.value):(_=y.value,_ instanceof s?_:new s(function(O){O(_)})).then(d,v)}E((u=u.apply(n,e||[])).next())})},l=this&&this.__generator||function(n,e){var s,u,h,g={label:0,sent:function(){if(1&h[0])throw h[1];return h[1]},trys:[],ops:[]},d=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return d.next=v(0),d.throw=v(1),d.return=v(2),typeof Symbol=="function"&&(d[Symbol.iterator]=function(){return this}),d;function v(E){return function(y){return function(_){if(s)throw new TypeError("Generator is already executing.");for(;d&&(d=0,_[0]&&(g=0)),g;)try{if(s=1,u&&(h=2&_[0]?u.return:_[0]?u.throw||((h=u.return)&&h.call(u),0):u.next)&&!(h=h.call(u,_[1])).done)return h;switch(u=0,h&&(_=[2&_[0],h.value]),_[0]){case 0:case 1:h=_;break;case 4:return g.label++,{value:_[1],done:!1};case 5:g.label++,u=_[1],_=[0];continue;case 7:_=g.ops.pop(),g.trys.pop();continue;default:if(h=g.trys,!((h=h.length>0&&h[h.length-1])||_[0]!==6&&_[0]!==2)){g=0;continue}if(_[0]===3&&(!h||_[1]>h[0]&&_[1]<h[3])){g.label=_[1];break}if(_[0]===6&&g.label<h[1]){g.label=h[1],h=_;break}if(h&&g.label<h[2]){g.label=h[2],g.ops.push(_);break}h[2]&&g.ops.pop(),g.trys.pop();continue}_=e.call(n,g)}catch(O){_=[6,O],u=0}finally{s=h=0}if(5&_[0])throw _[1];return{value:_[0]?_[1]:void 0,done:!0}}([E,y])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.Utils=void 0;var p=i(0),a=i(1),f=i(43);i(44);var c=function(){function n(){}return n.getMediaType=function(e){return(e=(e=e.toLowerCase()).split(";")[0]).trim()},n.getImageQuality=function(e){return e===a.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_1||e===a.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_2||e===a.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_1||e===a.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_2||e===a.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_1||e===a.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_2||e===a.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_1||e===a.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_2||e===a.ServiceProfile.IMAGE_1_LEVEL_1||e===a.ServiceProfile.IMAGE_1_PROFILE_LEVEL_1||e===a.ServiceProfile.IMAGE_1_LEVEL_2||e===a.ServiceProfile.IMAGE_1_PROFILE_LEVEL_2?"native":"default"},n.getInexactLocale=function(e){return e.indexOf("-")!==-1?e.substr(0,e.indexOf("-")):e},n.getLocalisedValue=function(e,s){if(!Array.isArray(e))return e;for(var u=0;u<e.length;u++){var h=e[u];if(s===h["@language"])return h["@value"]}var g=s.substr(0,s.indexOf("-"));for(u=0;u<e.length;u++){var d=e[u];if(d["@language"]===g)return d["@value"]}return null},n.generateTreeNodeIds=function(e,s){var u;s===void 0&&(s=0),u=e.parentNode?e.parentNode.id+"-"+s:"0",e.id=u;for(var h=0;h<e.nodes.length;h++){var g=e.nodes[h];n.generateTreeNodeIds(g,h)}},n.normaliseType=function(e){return(e=(e||"").toLowerCase()).indexOf(":")!==-1?e.split(":")[1]:e},n.normaliseUrl=function(e){return(e=e.substr(e.indexOf("://"))).indexOf("#")!==-1&&(e=e.split("#")[0]),e},n.normalisedUrlsMatch=function(e,s){return n.normaliseUrl(e)===n.normaliseUrl(s)},n.isImageProfile=function(e){return!!(n.normalisedUrlsMatch(e,a.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_0)||n.normalisedUrlsMatch(e,a.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_1)||n.normalisedUrlsMatch(e,a.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_2)||n.normalisedUrlsMatch(e,a.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_0)||n.normalisedUrlsMatch(e,a.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_2)||n.normalisedUrlsMatch(e,a.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_0)||n.normalisedUrlsMatch(e,a.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_1)||n.normalisedUrlsMatch(e,a.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_2)||n.normalisedUrlsMatch(e,a.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_1)||n.normalisedUrlsMatch(e,a.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_2)||n.normalisedUrlsMatch(e,a.ServiceProfile.IMAGE_1_LEVEL_0)||n.normalisedUrlsMatch(e,a.ServiceProfile.IMAGE_1_PROFILE_LEVEL_0)||n.normalisedUrlsMatch(e,a.ServiceProfile.IMAGE_1_LEVEL_1)||n.normalisedUrlsMatch(e,a.ServiceProfile.IMAGE_1_PROFILE_LEVEL_1)||n.normalisedUrlsMatch(e,a.ServiceProfile.IMAGE_1_LEVEL_2)||n.normalisedUrlsMatch(e,a.ServiceProfile.IMAGE_1_PROFILE_LEVEL_2)||n.normalisedUrlsMatch(e,a.ServiceProfile.IMAGE_2_LEVEL_0)||n.normalisedUrlsMatch(e,a.ServiceProfile.IMAGE_2_PROFILE_LEVEL_0)||n.normalisedUrlsMatch(e,a.ServiceProfile.IMAGE_2_LEVEL_1)||n.normalisedUrlsMatch(e,a.ServiceProfile.IMAGE_2_PROFILE_LEVEL_1)||n.normalisedUrlsMatch(e,a.ServiceProfile.IMAGE_2_LEVEL_2)||n.normalisedUrlsMatch(e,a.ServiceProfile.IMAGE_2_PROFILE_LEVEL_2))},n.isImageServiceType=function(e){return e!==null&&e.toLowerCase()===a.ServiceType.IMAGE_SERVICE_2.toLowerCase()||e===a.ServiceType.IMAGE_SERVICE_3.toLowerCase()},n.isLevel0ImageProfile=function(e){return!!(n.normalisedUrlsMatch(e,a.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_0)||n.normalisedUrlsMatch(e,a.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_0)||n.normalisedUrlsMatch(e,a.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_0)||n.normalisedUrlsMatch(e,a.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_0)||n.normalisedUrlsMatch(e,a.ServiceProfile.IMAGE_1_LEVEL_0)||n.normalisedUrlsMatch(e,a.ServiceProfile.IMAGE_1_PROFILE_LEVEL_0)||n.normalisedUrlsMatch(e,a.ServiceProfile.IMAGE_2_LEVEL_0)||n.normalisedUrlsMatch(e,a.ServiceProfile.IMAGE_2_PROFILE_LEVEL_0))},n.isLevel1ImageProfile=function(e){return!!(n.normalisedUrlsMatch(e,a.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_1)||n.normalisedUrlsMatch(e,a.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_1)||n.normalisedUrlsMatch(e,a.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_1)||n.normalisedUrlsMatch(e,a.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_1)||n.normalisedUrlsMatch(e,a.ServiceProfile.IMAGE_1_LEVEL_1)||n.normalisedUrlsMatch(e,a.ServiceProfile.IMAGE_1_PROFILE_LEVEL_1)||n.normalisedUrlsMatch(e,a.ServiceProfile.IMAGE_2_LEVEL_1)||n.normalisedUrlsMatch(e,a.ServiceProfile.IMAGE_2_PROFILE_LEVEL_1))},n.isLevel2ImageProfile=function(e){return!!(n.normalisedUrlsMatch(e,a.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_2)||n.normalisedUrlsMatch(e,a.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_2)||n.normalisedUrlsMatch(e,a.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_2)||n.normalisedUrlsMatch(e,a.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_2)||n.normalisedUrlsMatch(e,a.ServiceProfile.IMAGE_1_LEVEL_2)||n.normalisedUrlsMatch(e,a.ServiceProfile.IMAGE_1_PROFILE_LEVEL_2)||n.normalisedUrlsMatch(e,a.ServiceProfile.IMAGE_2_LEVEL_2)||n.normalisedUrlsMatch(e,a.ServiceProfile.IMAGE_2_PROFILE_LEVEL_2))},n.parseManifest=function(e,s){return p.Deserialiser.parse(e,s)},n.checkStatus=function(e){if(e.ok)return e;var s=new Error(e.statusText);return s.response=e,Promise.reject(s)},n.loadManifest=function(e){return new Promise(function(s,u){fetch(e).then(n.checkStatus).then(function(h){return h.json()}).then(function(h){s(h)}).catch(function(h){u()})})},n.loadExternalResourcesAuth1=function(e,s,u,h,g,d,v,E){return new Promise(function(y,_){var O=e.map(function(I){return n.loadExternalResourceAuth1(I,s,u,h,g,d,v,E)});Promise.all(O).then(function(){y(e)}).catch(function(I){_(I)})})},n.loadExternalResourceAuth1=function(e,s,u,h,g,d,v,E){return r(this,void 0,void 0,function(){var y;return l(this,function(_){switch(_.label){case 0:return[4,h(e)];case 1:return(y=_.sent())?[4,e.getData(y)]:[3,6];case 2:return _.sent(),e.status!==f.OK?[3,3]:[2,e];case 3:return[4,n.doAuthChain(e,s,u,g,d,v,E)];case 4:_.sent(),_.label=5;case 5:if(e.status===f.OK||e.status===f.MOVED_TEMPORARILY)return[2,e];throw n.createAuthorizationFailedError();case 6:return[4,e.getData()];case 7:return _.sent(),e.status!==f.MOVED_TEMPORARILY&&e.status!==f.UNAUTHORIZED?[3,9]:[4,n.doAuthChain(e,s,u,g,d,v,E)];case 8:_.sent(),_.label=9;case 9:if(e.status===f.OK||e.status===f.MOVED_TEMPORARILY)return[2,e];throw n.createAuthorizationFailedError()}})})},n.doAuthChain=function(e,s,u,h,g,d,v){return r(this,void 0,void 0,function(){var E,y,_,O,I,T,S,M;return l(this,function(R){switch(R.label){case 0:return e.isAccessControlled()?((E=e.externalService)&&(E.options=e.options),(y=e.kioskService)&&(y.options=e.options),(_=e.clickThroughService)&&(_.options=e.options),(O=e.loginService)&&(O.options=e.options),e.isResponseHandled||e.status!==f.MOVED_TEMPORARILY?[3,2]:[4,d(e)]):[2,e];case 1:return R.sent(),[2,e];case 2:return I=null,T=null,(I=E)?(T=I,[4,n.attemptResourceWithToken(e,u,I)]):[3,4];case 3:return R.sent(),[2,e];case 4:return(I=y)?(T=I,(S=s(I))?[4,h(S)]:[3,7]):[3,7];case 5:return R.sent(),[4,n.attemptResourceWithToken(e,u,I)];case 6:return R.sent(),[2,e];case 7:return(I=_)?(T=I,[4,g(e,I)]):[3,11];case 8:return(M=R.sent())?[4,h(M)]:[3,11];case 9:return R.sent(),[4,n.attemptResourceWithToken(e,u,I)];case 10:return R.sent(),[2,e];case 11:return(I=O)?(T=I,[4,g(e,I)]):[3,15];case 12:return(M=R.sent())?[4,h(M)]:[3,15];case 13:return R.sent(),[4,n.attemptResourceWithToken(e,u,I)];case 14:return R.sent(),[2,e];case 15:return T&&v(e,T),[2]}})})},n.attemptResourceWithToken=function(e,s,u){return r(this,void 0,void 0,function(){var h,g;return l(this,function(d){switch(d.label){case 0:return(h=u.getService(a.ServiceProfile.AUTH_1_TOKEN))?[4,s(e,h)]:[3,3];case 1:return(g=d.sent())&&g.accessToken?[4,e.getData(g)]:[3,3];case 2:return d.sent(),[2,e];case 3:return[2]}})})},n.loadExternalResourcesAuth09=function(e,s,u,h,g,d,v,E,y,_){return new Promise(function(O,I){var T=e.map(function(S){return n.loadExternalResourceAuth09(S,s,u,h,g,d,v,E,y,_)});Promise.all(T).then(function(){O(e)}).catch(function(S){I(S)})})},n.loadExternalResourceAuth09=function(e,s,u,h,g,d,v,E,y,_){return new Promise(function(O,I){_&&_.pessimisticAccessControl?e.getData().then(function(){e.isAccessControlled()?e.clickThroughService?(O(u(e)),O(h(e))):g(e).then(function(){d(e,!0).then(function(T){e.getData(T).then(function(){O(y(e))}).catch(function(S){I(n.createInternalServerError(S))})}).catch(function(T){I(n.createInternalServerError(T))})}).catch(function(T){I(n.createInternalServerError(T))}):O(e)}).catch(function(T){I(n.createInternalServerError(T))}):E(e,s).then(function(T){T?e.getData(T).then(function(){e.status===f.OK?O(y(e)):n.authorize(e,s,u,h,g,d,v,E).then(function(){O(y(e))}).catch(function(S){I(n.createAuthorizationFailedError())})}).catch(function(S){I(n.createAuthorizationFailedError())}):n.authorize(e,s,u,h,g,d,v,E).then(function(){O(y(e))}).catch(function(S){I(n.createAuthorizationFailedError())})}).catch(function(T){I(n.createAuthorizationFailedError())})})},n.createError=function(e,s){var u=new Error;return u.message=s,u.name=String(e),u},n.createAuthorizationFailedError=function(){return n.createError(p.StatusCode.AUTHORIZATION_FAILED,"Authorization failed")},n.createRestrictedError=function(){return n.createError(p.StatusCode.RESTRICTED,"Restricted")},n.createInternalServerError=function(e){return n.createError(p.StatusCode.INTERNAL_SERVER_ERROR,e)},n.authorize=function(e,s,u,h,g,d,v,E){return new Promise(function(y,_){e.getData().then(function(){e.isAccessControlled()?E(e,s).then(function(O){O?e.getData(O).then(function(){e.status===f.OK?y(e):n.showAuthInteraction(e,s,u,h,g,d,v,y,_)}).catch(function(I){_(n.createInternalServerError(I))}):d(e,!1).then(function(I){I?v(e,I,s).then(function(){e.getData(I).then(function(){e.status===f.OK?y(e):n.showAuthInteraction(e,s,u,h,g,d,v,y,_)}).catch(function(T){_(n.createInternalServerError(T))})}).catch(function(T){_(n.createInternalServerError(T))}):n.showAuthInteraction(e,s,u,h,g,d,v,y,_)})}).catch(function(O){_(n.createInternalServerError(O))}):y(e)})})},n.showAuthInteraction=function(e,s,u,h,g,d,v,E,y){e.status!==f.MOVED_TEMPORARILY||e.isResponseHandled?e.clickThroughService&&!e.isResponseHandled?u(e).then(function(){d(e,!0).then(function(_){v(e,_,s).then(function(){e.getData(_).then(function(){E(e)}).catch(function(O){y(n.createInternalServerError(O))})}).catch(function(O){y(n.createInternalServerError(O))})}).catch(function(_){y(n.createInternalServerError(_))})}):g(e).then(function(){d(e,!0).then(function(_){v(e,_,s).then(function(){e.getData(_).then(function(){E(e)}).catch(function(O){y(n.createInternalServerError(O))})}).catch(function(O){y(n.createInternalServerError(O))})}).catch(function(_){y(n.createInternalServerError(_))})}):E(e)},n.getService=function(e,s){for(var u=this.getServices(e),h=0;h<u.length;h++){var g=u[h];if(g.getProfile()===s)return g}return null},n.getResourceById=function(e,s){return n.traverseAndFind(e.__jsonld,"@id",s)},n.traverseAndFind=function(e,s,u){if(e.hasOwnProperty(s)&&e[s]===u)return e;for(var h=0;h<Object.keys(e).length;h++)if(typeof e[Object.keys(e)[h]]=="object"){var g=n.traverseAndFind(e[Object.keys(e)[h]],s,u);if(g!=null)return g}},n.getServices=function(e,s){var u=s===void 0?{}:s,h=u.onlyService,g=h!==void 0&&h,d=u.onlyServices,v=d!==void 0&&d,E=u.skipParentResources,y=[];!(E!==void 0&&E)&&e&&e.options&&e.options.resource&&e.options.resource!==e&&y.push.apply(y,n.getServices(e.options.resource,{onlyServices:!0}));var _=v?[]:(e.__jsonld||e).service||[];if(Array.isArray(_)||(_=[_]),g||_.push.apply(_,(e.__jsonld||e).services||[]),_.length===0)return y;for(var O=0;O<_.length;O++){var I=_[O];if(typeof I=="string"){var T=this.getResourceById(e.options.resource,I);T&&y.push(new p.Service(T.__jsonld||T,e.options))}else y.push(new p.Service(I,e.options))}return y},n.getTemporalComponent=function(e){var s=/t=([^&]+)/g.exec(e),u=null;return s&&s[1]&&(u=s[1].split(",")),u},n}();t.Utils=c},function(o,t,i){var r=i(19),l=i(20);o.exports=function p(a,f,c,n,e){var s=-1,u=a.length;for(c||(c=l),e||(e=[]);++s<u;){var h=a[s];f>0&&c(h)?f>1?p(h,f-1,c,n,e):r(e,h):n||(e[e.length]=h)}return e}},function(o,t){o.exports=function(i){return i!=null&&typeof i=="object"}},function(o,t,i){"use strict";i.r(t),t.default=function(r,l){return l=l||{},new Promise(function(p,a){var f=new XMLHttpRequest,c=[],n=[],e={},s=function(){return{ok:(f.status/100|0)==2,statusText:f.statusText,status:f.status,url:f.responseURL,text:function(){return Promise.resolve(f.responseText)},json:function(){return Promise.resolve(JSON.parse(f.responseText))},blob:function(){return Promise.resolve(new Blob([f.response]))},clone:s,headers:{keys:function(){return c},entries:function(){return n},get:function(h){return e[h.toLowerCase()]},has:function(h){return h.toLowerCase()in e}}}};for(var u in f.open(l.method||"get",r,!0),f.onload=function(){f.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,function(h,g,d){c.push(g=g.toLowerCase()),n.push([g,d]),e[g]=e[g]?e[g]+","+d:d}),p(s())},f.onerror=a,f.withCredentials=l.credentials=="include",l.headers)f.setRequestHeader(u,l.headers[u]);f.send(l.body||null)})}},function(o,t,i){o.exports=i(8)},function(o,t,i){"use strict";var r=this&&this.__createBinding||(Object.create?function(a,f,c,n){n===void 0&&(n=c);var e=Object.getOwnPropertyDescriptor(f,c);e&&!("get"in e?!f.__esModule:e.writable||e.configurable)||(e={enumerable:!0,get:function(){return f[c]}}),Object.defineProperty(a,n,e)}:function(a,f,c,n){n===void 0&&(n=c),a[n]=f[c]}),l=this&&this.__exportStar||function(a,f){for(var c in a)c==="default"||Object.prototype.hasOwnProperty.call(f,c)||r(f,a,c)};Object.defineProperty(t,"__esModule",{value:!0}),t.parseManifest=t.loadManifest=void 0,l(i(0),t);var p=i(3);t.loadManifest=function(a){return p.Utils.loadManifest(a)},t.parseManifest=function(a,f){return p.Utils.parseManifest(a,f)}},function(o,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.JSONLDResource=void 0;var r=function(){function l(p){this.__jsonld=p,this.context=this.getProperty("context"),this.id=this.getProperty("id")}return l.prototype.getProperty=function(p){var a=null;return this.__jsonld&&((a=this.__jsonld[p])||(a=this.__jsonld["@"+p])),a},l}();t.JSONLDResource=r},function(o,t,i){"use strict";var r,l=this&&this.__extends||(r=function(c,n){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,s){e.__proto__=s}||function(e,s){for(var u in s)Object.prototype.hasOwnProperty.call(s,u)&&(e[u]=s[u])})(c,n)},function(c,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function e(){this.constructor=c}r(c,n),c.prototype=n===null?Object.create(n):(e.prototype=n.prototype,new e)});Object.defineProperty(t,"__esModule",{value:!0}),t.ManifestResource=void 0;var p=i(0),a=i(1),f=function(c){function n(e,s){var u=c.call(this,e)||this;return u.options=s,u}return l(n,c),n.prototype.getIIIFResourceType=function(){return p.Utils.normaliseType(this.getProperty("type"))},n.prototype.getLabel=function(){var e=this.getProperty("label");return e?p.PropertyValue.parse(e,this.options.locale):new p.PropertyValue([],this.options.locale)},n.prototype.getDefaultLabel=function(){return this.getLabel().getValue(this.options.locale)},n.prototype.getMetadata=function(){var e=this.getProperty("metadata"),s=[];if(!e)return s;for(var u=0;u<e.length;u++){var h=e[u],g=new p.LabelValuePair(this.options.locale);g.parse(h),s.push(g)}return s},n.prototype.getRendering=function(e){for(var s=this.getRenderings(),u=0;u<s.length;u++){var h=s[u];if(h.getFormat()===e)return h}return null},n.prototype.getRenderings=function(){var e,s=[];if(!(e=this.__jsonld?this.__jsonld.rendering:this.rendering))return s;Array.isArray(e)||(e=[e]);for(var u=0;u<e.length;u++){var h=e[u];s.push(new p.Rendering(h,this.options))}return s},n.prototype.getRequiredStatement=function(){var e=null,s=this.getProperty("requiredStatement");return s&&(e=new p.LabelValuePair(this.options.locale)).parse(s),e},n.prototype.getService=function(e){return p.Utils.getService(this,e)},n.prototype.getServices=function(){return p.Utils.getServices(this)},n.prototype.getThumbnail=function(){var e=this.getProperty("thumbnail");return Array.isArray(e)&&(e=e[0]),e?new p.Thumbnail(e,this.options):null},n.prototype.isAnnotation=function(){return this.getIIIFResourceType()===a.IIIFResourceType.ANNOTATION},n.prototype.isCanvas=function(){return this.getIIIFResourceType()===a.IIIFResourceType.CANVAS},n.prototype.isCollection=function(){return this.getIIIFResourceType()===a.IIIFResourceType.COLLECTION},n.prototype.isManifest=function(){return this.getIIIFResourceType()===a.IIIFResourceType.MANIFEST},n.prototype.isRange=function(){return this.getIIIFResourceType()===a.IIIFResourceType.RANGE},n.prototype.isSequence=function(){return this.getIIIFResourceType()===a.IIIFResourceType.SEQUENCE},n}(p.JSONLDResource);t.ManifestResource=f},function(o,t,i){"use strict";var r,l=this&&this.__extends||(r=function(f,c){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,e){n.__proto__=e}||function(n,e){for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(n[s]=e[s])})(f,c)},function(f,c){if(typeof c!="function"&&c!==null)throw new TypeError("Class extends value "+String(c)+" is not a constructor or null");function n(){this.constructor=f}r(f,c),f.prototype=c===null?Object.create(c):(n.prototype=c.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.Resource=void 0;var p=i(0),a=function(f){function c(n,e){return f.call(this,n,e)||this}return l(c,f),c.prototype.getFormat=function(){var n=this.getProperty("format");return n?n.toLowerCase():null},c.prototype.getResources=function(){var n=[];if(!this.__jsonld.resources)return n;for(var e=0;e<this.__jsonld.resources.length;e++){var s=this.__jsonld.resources[e],u=new p.Annotation(s,this.options);n.push(u)}return n},c.prototype.getType=function(){var n=this.getProperty("type");return n?p.Utils.normaliseType(n):null},c.prototype.getWidth=function(){return this.getProperty("width")},c.prototype.getHeight=function(){return this.getProperty("height")},c.prototype.getMaxWidth=function(){return this.getProperty("maxWidth")},c.prototype.getMaxHeight=function(){return this.getProperty("maxHeight")?null:this.getMaxWidth()},c}(p.ManifestResource);t.Resource=a},function(o,t,i){"use strict";var r,l=this&&this.__extends||(r=function(c,n){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,s){e.__proto__=s}||function(e,s){for(var u in s)Object.prototype.hasOwnProperty.call(s,u)&&(e[u]=s[u])})(c,n)},function(c,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function e(){this.constructor=c}r(c,n),c.prototype=n===null?Object.create(n):(e.prototype=n.prototype,new e)});Object.defineProperty(t,"__esModule",{value:!0}),t.IIIFResource=void 0;var p=i(0),a=i(1),f=function(c){function n(e,s){var u=c.call(this,e,s)||this;u.index=-1,u.isLoaded=!1;var h={defaultLabel:"-",locale:"en-GB",resource:u,pessimisticAccessControl:!1};return u.options=Object.assign(h,s),u}return l(n,c),n.prototype.getAttribution=function(){var e=this.getProperty("attribution");return e?p.PropertyValue.parse(e,this.options.locale):new p.PropertyValue([],this.options.locale)},n.prototype.getDescription=function(){var e=this.getProperty("description");return e?p.PropertyValue.parse(e,this.options.locale):new p.PropertyValue([],this.options.locale)},n.prototype.getHomepage=function(){var e=this.getProperty("homepage");return e?typeof e=="string"?e:(Array.isArray(e)&&e.length&&(e=e[0]),e["@id"]||e.id):null},n.prototype.getIIIFResourceType=function(){return p.Utils.normaliseType(this.getProperty("type"))},n.prototype.getLogo=function(){var e=this.getProperty("logo");if(!e){var s=this.getProperty("provider");if(!s)return null;var u=s.find(function(h){return h.logo!==void 0});e=u&&u.logo!==void 0?u.logo:null}return e?typeof e=="string"?e:(Array.isArray(e)&&e.length&&(e=e[0]),e["@id"]||e?.id):null},n.prototype.getLicense=function(){return p.Utils.getLocalisedValue(this.getProperty("license"),this.options.locale)},n.prototype.getRights=function(){var e=this.getProperty("rights");return e?typeof e=="string"?e:(Array.isArray(e)&&e.length&&(e=e[0]),e["@id"]||e.id):null},n.prototype.getNavDate=function(){return new Date(this.getProperty("navDate"))},n.prototype.getRelated=function(){return this.getProperty("related")},n.prototype.getSeeAlso=function(){return this.getProperty("seeAlso")},n.prototype.getTrackingLabel=function(){var e=this.getService(a.ServiceProfile.TRACKING_EXTENSIONS);return e?e.getProperty("trackingLabel"):""},n.prototype.getDefaultTree=function(){return this.defaultTree=new p.TreeNode("root"),this.defaultTree.data=this,this.defaultTree},n.prototype.getRequiredStatement=function(){var e=null,s=this.getProperty("requiredStatement");if(s)(e=new p.LabelValuePair(this.options.locale)).parse(s);else{var u=this.getAttribution();u&&u.length&&((e=new p.LabelValuePair(this.options.locale)).value=u)}return e},n.prototype.isCollection=function(){return this.getIIIFResourceType()===a.IIIFResourceType.COLLECTION},n.prototype.isManifest=function(){return this.getIIIFResourceType()===a.IIIFResourceType.MANIFEST},n.prototype.load=function(){var e=this;return new Promise(function(s){if(e.isLoaded)s(e);else{var u=e.options;u.navDate=e.getNavDate();var h=e.__jsonld.id;h||(h=e.__jsonld["@id"]),p.Utils.loadManifest(h).then(function(g){e.parentLabel=e.getLabel().getValue(u.locale);var d=p.Deserialiser.parse(g,u);(e=Object.assign(e,d)).index=u.index,s(e)})}})},n}(p.ManifestResource);t.IIIFResource=f},function(o,t,i){"use strict";var r,l=this&&this.__extends||(r=function(f,c){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,e){n.__proto__=e}||function(n,e){for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(n[s]=e[s])})(f,c)},function(f,c){if(typeof c!="function"&&c!==null)throw new TypeError("Class extends value "+String(c)+" is not a constructor or null");function n(){this.constructor=f}r(f,c),f.prototype=c===null?Object.create(c):(n.prototype=c.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.Annotation=void 0;var p=i(0),a=function(f){function c(n,e){return f.call(this,n,e)||this}return l(c,f),c.prototype.getBody=function(){var n=[],e=this.getProperty("body");if(e)if(Array.isArray(e))for(var s=0;s<e.length;s++)if((g=e[s]).items)for(var u=0;u<g.items.length;u++){var h=g.items[u];n.push(new p.AnnotationBody(h,this.options))}else n.push(new p.AnnotationBody(g,this.options));else if(e.items)for(s=0;s<e.items.length;s++){var g=e.items[s];n.push(new p.AnnotationBody(g,this.options))}else n.push(new p.AnnotationBody(e,this.options));return n},c.prototype.getMotivation=function(){var n=this.getProperty("motivation");return n||null},c.prototype.getOn=function(){return this.getProperty("on")},c.prototype.getTarget=function(){return this.getProperty("target")},c.prototype.getResource=function(){return new p.Resource(this.getProperty("resource"),this.options)},c}(p.ManifestResource);t.Annotation=a},function(o,t,i){"use strict";var r,l=this&&this.__extends||(r=function(f,c){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,e){n.__proto__=e}||function(n,e){for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(n[s]=e[s])})(f,c)},function(f,c){if(typeof c!="function"&&c!==null)throw new TypeError("Class extends value "+String(c)+" is not a constructor or null");function n(){this.constructor=f}r(f,c),f.prototype=c===null?Object.create(c):(n.prototype=c.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.AnnotationBody=void 0;var p=i(0),a=function(f){function c(n,e){return f.call(this,n,e)||this}return l(c,f),c.prototype.getFormat=function(){var n=this.getProperty("format");return n?p.Utils.getMediaType(n):null},c.prototype.getType=function(){return this.getProperty("type")?p.Utils.normaliseType(this.getProperty("type")):null},c.prototype.getWidth=function(){return this.getProperty("width")},c.prototype.getHeight=function(){return this.getProperty("height")},c}(p.ManifestResource);t.AnnotationBody=a},function(o,t,i){"use strict";var r,l=this&&this.__extends||(r=function(f,c){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,e){n.__proto__=e}||function(n,e){for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(n[s]=e[s])})(f,c)},function(f,c){if(typeof c!="function"&&c!==null)throw new TypeError("Class extends value "+String(c)+" is not a constructor or null");function n(){this.constructor=f}r(f,c),f.prototype=c===null?Object.create(c):(n.prototype=c.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.AnnotationList=void 0;var p=i(0),a=function(f){function c(n,e,s){var u=f.call(this,e)||this;return u.label=n,u.options=s,u}return l(c,f),c.prototype.getIIIFResourceType=function(){return p.Utils.normaliseType(this.getProperty("type"))},c.prototype.getLabel=function(){return this.label},c.prototype.getResources=function(){var n=this;return this.getProperty("resources").map(function(e){return new p.Annotation(e,n.options)})},c.prototype.load=function(){var n=this;return new Promise(function(e,s){if(n.isLoaded)e(n);else{var u=n.__jsonld.id;u||(u=n.__jsonld["@id"]),p.Utils.loadManifest(u).then(function(h){n.__jsonld=h,n.context=n.getProperty("context"),n.id=n.getProperty("id"),n.isLoaded=!0,e(n)}).catch(s)}})},c}(p.JSONLDResource);t.AnnotationList=a},function(o,t,i){"use strict";var r,l=this&&this.__extends||(r=function(a,f){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(c,n){c.__proto__=n}||function(c,n){for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(c[e]=n[e])})(a,f)},function(a,f){if(typeof f!="function"&&f!==null)throw new TypeError("Class extends value "+String(f)+" is not a constructor or null");function c(){this.constructor=a}r(a,f),a.prototype=f===null?Object.create(f):(c.prototype=f.prototype,new c)});Object.defineProperty(t,"__esModule",{value:!0}),t.AnnotationPage=void 0;var p=function(a){function f(c,n){return a.call(this,c,n)||this}return l(f,a),f.prototype.getItems=function(){return this.getProperty("items")},f}(i(0).ManifestResource);t.AnnotationPage=p},function(o,t,i){"use strict";var r,l=this&&this.__extends||(r=function(s,u){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,g){h.__proto__=g}||function(h,g){for(var d in g)Object.prototype.hasOwnProperty.call(g,d)&&(h[d]=g[d])})(s,u)},function(s,u){if(typeof u!="function"&&u!==null)throw new TypeError("Class extends value "+String(u)+" is not a constructor or null");function h(){this.constructor=s}r(s,u),s.prototype=u===null?Object.create(u):(h.prototype=u.prototype,new h)}),p=this&&this.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(t,"__esModule",{value:!0}),t.Canvas=void 0;var a=i(1),f=i(0),c=p(i(18)),n=p(i(30)),e=function(s){function u(h,g){return s.call(this,h,g)||this}return l(u,s),u.prototype.getCanonicalImageUri=function(h){var g,d=null,v="default",E=h;if(this.externalResource&&this.externalResource.data&&this.externalResource.data["@id"])d=this.externalResource.data["@id"],E||(E=this.externalResource.data.width),this.externalResource.data["@context"]&&(this.externalResource.data["@context"].indexOf("/1.0/context.json")>-1||this.externalResource.data["@context"].indexOf("/1.1/context.json")>-1||this.externalResource.data["@context"].indexOf("/1/context.json")>-1)&&(v="native");else{var y=void 0;if((y=this.getImages())&&y.length){var _=y[0].getResource(),O=_.getServices();if(E||(E=_.getWidth()),I=O?O.find(function(M){return f.Utils.isImageProfile(M.getProfile())||f.Utils.isImageServiceType(M.getIIIFResourceType())}):null)d=I.id,v=f.Utils.getImageQuality(I.getProfile());else if(E===_.getWidth())return _.id}if((y=this.getContent())&&y.length){var I,T=y[0].getBody()[0];if(O=T.getServices(),E||(E=T.getWidth()),I=O?O.find(function(M){return f.Utils.isImageServiceType(M.getIIIFResourceType())}):null)d=I.id,v=f.Utils.getImageQuality(I.getProfile());else if(E===T.getWidth())return T.id}if(!d){var S=this.getProperty("thumbnail");if(S){if(typeof S=="string")return S;if(S["@id"])return S["@id"];if(S.length)return S[0].id}}}return g=E+",",d&&d.endsWith("/")&&(d=d.substr(0,d.length-1)),[d,"full",g,0,v+".jpg"].join("/")},u.prototype.getMaxDimensions=function(){var h,g=null;return this.externalResource&&this.externalResource.data&&this.externalResource.data.profile&&(h=this.externalResource.data.profile,Array.isArray(h)&&(h=h.filter(function(d){var v;return(v=d.maxWidth)!==null&&v!==void 0?v:d.maxwidth})[0])&&(g=new f.Size(h.maxWidth,h.maxHeight?h.maxHeight:h.maxWidth))),g},u.prototype.getContent=function(){var h=[],g=this.__jsonld.items||this.__jsonld.content;if(!g)return h;var d=null;if(g.length&&(d=new f.AnnotationPage(g[0],this.options)),!d)return h;for(var v=d.getItems(),E=0;E<v.length;E++){var y=v[E],_=new f.Annotation(y,this.options);h.push(_)}return h},u.prototype.getDuration=function(){return this.getProperty("duration")},u.prototype.getImages=function(){var h=[];if(!this.__jsonld.images)return h;for(var g=0;g<this.__jsonld.images.length;g++){var d=this.__jsonld.images[g],v=new f.Annotation(d,this.options);h.push(v)}return h},u.prototype.getIndex=function(){return this.getProperty("index")},u.prototype.getOtherContent=function(){var h=this,g=Array.isArray(this.getProperty("otherContent"))?this.getProperty("otherContent"):[this.getProperty("otherContent")],d=g.filter(function(v){return v&&(E=v["@type"],y="sc:AnnotationList",typeof E=="string"&&typeof y=="string"&&E.toLowerCase()==E.toLowerCase());var E,y}).map(function(v,E){return new f.AnnotationList(v.label||"Annotation list ".concat(E),v,h.options)}).map(function(v){return v.load()});return Promise.all(d)},u.prototype.getWidth=function(){return this.getProperty("width")},u.prototype.getHeight=function(){return this.getProperty("height")},u.prototype.getViewingHint=function(){return this.getProperty("viewingHint")},Object.defineProperty(u.prototype,"imageResources",{get:function(){var h=this,g=(0,n.default)([this.getImages().map(function(d){return d.getResource()}),this.getContent().map(function(d){return d.getBody()})]);return(0,c.default)(g.map(function(d){switch(d.getProperty("type").toLowerCase()){case a.ExternalResourceType.CHOICE:case a.ExternalResourceType.OA_CHOICE:return new u({images:(0,c.default)([d.getProperty("default"),d.getProperty("item")]).map(function(v){return{resource:v}})},h.options).getImages().map(function(v){return v.getResource()});default:return d}}))},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"resourceAnnotations",{get:function(){return(0,n.default)([this.getImages(),this.getContent()])},enumerable:!1,configurable:!0}),u.prototype.resourceAnnotation=function(h){return this.resourceAnnotations.find(function(g){return g.getResource().id===h||(0,c.default)(new Array(g.getBody())).some(function(d){return d.id===h})})},u.prototype.onFragment=function(h){var g=this.resourceAnnotation(h);if(g){var d=g.getProperty("on"),v=g.getProperty("target");if(d&&v){var E=(d||v).match(/xywh=(.*)$/);if(E)return E[1].split(",").map(function(y){return parseInt(y,10)})}}},Object.defineProperty(u.prototype,"iiifImageResources",{get:function(){return this.imageResources.filter(function(h){return h&&h.getServices()[0]&&h.getServices()[0].id})},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"imageServiceIds",{get:function(){return this.iiifImageResources.map(function(h){return h.getServices()[0].id})},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"aspectRatio",{get:function(){return this.getWidth()/this.getHeight()},enumerable:!1,configurable:!0}),u}(f.Resource);t.Canvas=e},function(o,t,i){var r=i(4);o.exports=function(l){return l!=null&&l.length?r(l,1):[]}},function(o,t){o.exports=function(i,r){for(var l=-1,p=r.length,a=i.length;++l<p;)i[a+l]=r[l];return i}},function(o,t,i){var r=i(2),l=i(24),p=i(29),a=r?r.isConcatSpreadable:void 0;o.exports=function(f){return p(f)||l(f)||!!(a&&f&&f[a])}},function(o,t,i){var r=i(22),l=typeof self=="object"&&self&&self.Object===Object&&self,p=r||l||Function("return this")();o.exports=p},function(o,t,i){(function(r){var l=typeof r=="object"&&r&&r.Object===Object&&r;o.exports=l}).call(this,i(23))},function(o,t){var i;i=function(){return this}();try{i=i||new Function("return this")()}catch{typeof window=="object"&&(i=window)}o.exports=i},function(o,t,i){var r=i(25),l=i(5),p=Object.prototype,a=p.hasOwnProperty,f=p.propertyIsEnumerable,c=r(function(){return arguments}())?r:function(n){return l(n)&&a.call(n,"callee")&&!f.call(n,"callee")};o.exports=c},function(o,t,i){var r=i(26),l=i(5);o.exports=function(p){return l(p)&&r(p)=="[object Arguments]"}},function(o,t,i){var r=i(2),l=i(27),p=i(28),a=r?r.toStringTag:void 0;o.exports=function(f){return f==null?f===void 0?"[object Undefined]":"[object Null]":a&&a in Object(f)?l(f):p(f)}},function(o,t,i){var r=i(2),l=Object.prototype,p=l.hasOwnProperty,a=l.toString,f=r?r.toStringTag:void 0;o.exports=function(c){var n=p.call(c,f),e=c[f];try{c[f]=void 0;var s=!0}catch{}var u=a.call(c);return s&&(n?c[f]=e:delete c[f]),u}},function(o,t){var i=Object.prototype.toString;o.exports=function(r){return i.call(r)