UNPKG

@thms-rmb/universalviewer

Version:

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

2 lines 160 kB
import{a as Qt,c as Lt,e as Rt,f as Mt,g as wt}from"./chunk-UYLDA6E6.js";import{a as yt,b as R,d as Y,g as Ot,j as ft,k as St,l as D,m as lt,n as At,o as G,p as b}from"./chunk-2YE6NNA6.js";import{b as V,e as F,g as w}from"./chunk-MP7EINQY.js";import{b as jt,c as et}from"./chunk-YAXTLTJC.js";var Vt=jt((at,Tt)=>{(function(s,i){typeof at=="object"&&typeof Tt=="object"?Tt.exports=i():typeof define=="function"&&define.amd?define("IIIFMetadataComponent",[],i):typeof at=="object"?at.IIIFMetadataComponent=i():s.IIIFMetadataComponent=i()})(typeof self!="undefined"?self:at,function(){return function(s){var i={};function l(c){if(i[c])return i[c].exports;var u=i[c]={i:c,l:!1,exports:{}};return s[c].call(u.exports,u,u.exports,l),u.l=!0,u.exports}return l.m=s,l.c=i,l.d=function(c,u,g){l.o(c,u)||Object.defineProperty(c,u,{enumerable:!0,get:g})},l.r=function(c){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(c,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(c,"__esModule",{value:!0})},l.t=function(c,u){if(1&u&&(c=l(c)),8&u||4&u&&typeof c=="object"&&c&&c.__esModule)return c;var g=Object.create(null);if(l.r(g),Object.defineProperty(g,"default",{enumerable:!0,value:c}),2&u&&typeof c!="string")for(var o in c)l.d(g,o,function(v){return c[v]}.bind(null,o));return g},l.n=function(c){var u=c&&c.__esModule?function(){return c.default}:function(){return c};return l.d(u,"a",u),u},l.o=function(c,u){return Object.prototype.hasOwnProperty.call(c,u)},l.p="",l(l.s=0)}([function(s,i,l){s.exports=l(1)},function(s,i,l){"use strict";var c,u=this&&this.__extends||(c=function(h,e){return(c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var r in n)n.hasOwnProperty(r)&&(t[r]=n[r])})(h,e)},function(h,e){function t(){this.constructor=h}c(h,e),h.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)});Object.defineProperty(i,"__esModule",{value:!0});var g,o=l(2),v=l(3),m=l(4);(function(h){h.LINES="lines",h.CHARS="chars"})(g=i.LimitType||(i.LimitType={}));var a=function(h){function e(t){var n=h.call(this,t)||this;return n._data=n.data(),n._data=n.options.data,n._init(),n._resize(),n}return u(e,h),e.prototype._init=function(){return h.prototype._init.call(this),this._$element=$(this.el),this._$metadataGroupTemplate=$('<div class="group"> <div class="header"></div> <div class="items"></div> </div>'),this._$metadataItemTemplate=$('<div class="item"> <div class="label"></div> <div class="values"></div> </div>'),this._$metadataItemValueTemplate=$('<div class="value"></div>'),this._$metadataItemURIValueTemplate=$('<a class="value" href="" target="_blank"></a>'),this._$copyTextTemplate=$('<div class="copyText" alt="'+this.options.data.content.copyToClipboard+'" title="'+this.options.data.content.copyToClipboard+'"> <div class="copiedText">'+this.options.data.content.copiedToClipboard+" </div> </div>"),this._$metadataGroups=$('<div class="groups"></div>'),this._$element.append(this._$metadataGroups),this._$noData=$('<div class="noData">'+this.options.data.content.noData+"</div>"),this._$element.append(this._$noData),!0},e.prototype.data=function(){return{aggregateValues:"",canvases:null,canvasDisplayOrder:"",metadataGroupOrder:"",canvasExclude:"",canvasLabels:"",content:{attribution:"Attribution",canvasHeader:"About the canvas",copiedToClipboard:"Copied to clipboard",copyToClipboard:"Copy to clipboard",description:"Description",imageHeader:"About the image",less:"less",license:"License",logo:"Logo",manifestHeader:"About the item",more:"more",noData:"No data to display",rangeHeader:"About the range",sequenceHeader:"About the sequence"},copiedMessageDuration:2e3,copyToClipboardEnabled:!1,helper:null,licenseFormatter:null,limit:4,limitType:g.LINES,limitToRange:!1,manifestDisplayOrder:"",manifestExclude:"",range:null,rtlLanguageCodes:"ar, ara, dv, div, he, heb, ur, urd",sanitizer:function(t){return t},showAllLanguages:!1}},e.prototype._getManifestGroup=function(){return this._metadataGroups.filter(function(t){return t.resource.isManifest()})[0]},e.prototype._getCanvasGroups=function(){return this._metadataGroups.filter(function(t){return t.resource.isCanvas()})},e.prototype.set=function(t){var n=this;if(this._data=Object.assign(this._data,t),this._data&&this._data.helper){var r,d={canvases:this._data.canvases,licenseFormatter:this._data.licenseFormatter,range:this._data.range};if(this._metadataGroups=this._data.helper.getMetadata(d),this._data.manifestDisplayOrder&&((r=this._getManifestGroup()).items=this._sortItems(r.items,this._readCSV(this._data.manifestDisplayOrder))),this._data.canvasDisplayOrder&&this._getCanvasGroups().forEach(function(x,y){x.items=n._sortItems(x.items,n._readCSV(n._data.canvasDisplayOrder))}),this._data.metadataGroupOrder&&(this._metadataGroups=this._sortGroups(this._metadataGroups,this._readCSV(this._data.metadataGroupOrder))),this._data.canvasLabels&&this._label(this._getCanvasGroups(),this._readCSV(this._data.canvasLabels,!1)),this._data.manifestExclude&&((r=this._getManifestGroup()).items=this._exclude(r.items,this._readCSV(this._data.manifestExclude))),this._data.canvasExclude&&this._getCanvasGroups().forEach(function(x,y){x.items=n._exclude(x.items,n._readCSV(n._data.canvasExclude))}),this._data.limitToRange){var E=[];this._metadataGroups.forEach(function(x,y){x.resource.isRange()&&E.push(x)}),E.length&&(this._metadataGroups=E)}this._render()}},e.prototype._sortItems=function(t,n){var r=this,d=[],E=t.slice(0);return n.forEach(function(x,y){var A=E.filter(function(T){return r._normalise(T.getLabel())===x})[0];if(A){d.push(A);var O=E.indexOf(A);O>-1&&E.splice(O,1)}}),E.forEach(function(x,y){d.push(x)}),d},e.prototype._sortGroups=function(t,n){var r=[],d=t.slice(0);return n.forEach(function(E,x){var y=d.filter(function(O){return O.resource.getIIIFResourceType().toLowerCase()==E.toLowerCase()})[0];if(y){r.push(y);var A=d.indexOf(y);A>-1&&d.splice(A,1)}}),r},e.prototype._label=function(t,n){t.forEach(function(r,d){r.label=n[d]})},e.prototype._exclude=function(t,n){var r=this;return n.forEach(function(d,E){var x=t.filter(function(A){return r._normalise(A.getLabel())===d})[0];if(x){var y=t.indexOf(x);y>-1&&t.splice(y,1)}}),t},e.prototype._normalise=function(t){return t?t.toLowerCase().replace(/ /g,""):null},e.prototype._render=function(){var t=this;this._metadataGroups.length?(this._$noData.hide(),this._$metadataGroups.empty(),this._metadataGroups.forEach(function(n,r){var d=t._buildMetadataGroup(n);t._$metadataGroups.append(d);var E=d.find(".value");t._data.limit&&t._data.content&&(t._data.limitType===g.LINES?E.toggleExpandTextByLines(t._data.limit,t._data.content.less,t._data.content.more,function(){}):t._data.limitType===g.CHARS&&E.ellipsisHtmlFixed(t._data.limit,function(){}))})):this._$noData.show()},e.prototype._buildMetadataGroup=function(t){var n=this._$metadataGroupTemplate.clone(),r=n.find(">.header");if(this._data.content){if(t.resource.isManifest()&&this._data.content.manifestHeader)(E=this._sanitize(this._data.content.manifestHeader))&&r.html(E);else if(t.resource.isSequence()&&this._data.content.sequenceHeader)(E=this._sanitize(this._data.content.sequenceHeader))&&r.html(E);else if(t.resource.isRange()&&this._data.content.rangeHeader)(E=this._sanitize(this._data.content.rangeHeader))&&r.html(E);else if(t.resource.isCanvas()&&(t.label||this._data.content.canvasHeader)){var d=t.label||this._data.content.canvasHeader;r.html(this._sanitize(d))}else if(t.resource.isAnnotation()&&this._data.content.imageHeader){var E;(E=this._sanitize(this._data.content.imageHeader))&&r.html(E)}}r.text()||r.hide();for(var x=n.find(".items"),y=0;y<t.items.length;y++){var A=t.items[y],O=this._buildMetadataItem(A);x.append(O)}return n},e.prototype._buildMetadataItem=function(t){var n,r=this._$metadataItemTemplate.clone(),d=r.find(".label"),E=r.find(".values"),x=t.getLabel(),y=x,A=new RegExp("/w+:(/?/?)[^s]+/gm","i");if(this._data.content&&y&&t.isRootLevel)switch(y.toLowerCase()){case"attribution":y=this._data.content.attribution;break;case"description":y=this._data.content.description;break;case"license":y=this._data.content.license;break;case"logo":y=this._data.content.logo}if(y=this._sanitize(y),d.html(y),this._addReadingDirection(d,this._getLabelLocale(t)),r.addClass(m.Strings.toCssClass(y)),x&&x.toLowerCase()==="license"&&A.exec(t.value[0].value)!==null)n=this._buildMetadataItemURIValue(t.value[0].value),E.append(n);else if(this._data.showAllLanguages&&t.value&&t.value.length>1)for(var O=0;O<t.value.length;O++){var T=t.value[O];n=this._buildMetadataItemValue(T.value,T.locale),E.append(n)}else{var I=this._getValueLocale(t),f=!1;for(O=0;O<t.value.length;O++){var T=t.value[O];I.toLowerCase()===T.locale.toLowerCase()&&(f=!0,n=this._buildMetadataItemValue(T.value,T.locale),E.append(n))}f||(T=t.value[0])&&(n=this._buildMetadataItemValue(T.value,T.locale),E.append(n))}this._data.copyToClipboardEnabled&&m.Clipboard.supportsCopy()&&d.text()&&this._addCopyButton(r,d,E);var _=this;return r.on("click","a.iiif-viewer-link",function(C){C.preventDefault();var S=$(C.target),L=S.attr("data-uv-navigate")||S.prop("href");_.fire(p.IIIF_VIEWER_LINK_CLICKED,L)}),r.on("click","[data-uv-navigate]",function(C){C.preventDefault();var S=$(C.target).attr("data-uv-navigate")||null;S&&_.fire(p.IIIF_VIEWER_LINK_CLICKED,S)}),r},e.prototype._getLabelLocale=function(t){if(!this._data||!this._data.helper)return"";var n=this._data.helper.options.locale;if(t.label.length){var r=t.label[0].locale;if(r.toLowerCase()!==n.toLowerCase())return r}return n},e.prototype._getValueLocale=function(t){return this._data&&this._data.helper?this._data.helper.options.locale:""},e.prototype._buildMetadataItemValue=function(t,n){t=(t=this._sanitize(t)).replace(` `,"<br>");var r=this._$metadataItemValueTemplate.clone();return r.html(t),r.find("a").each(function(){var d=$(this);d.hasClass("iiif-viewer-link")||d.prop("target","_blank")}),n&&this._addReadingDirection(r,n),r},e.prototype._buildMetadataItemURIValue=function(t){t=this._sanitize(t);var n=this._$metadataItemURIValueTemplate.clone();return n.prop("href",t),n.text(t),n},e.prototype._addReadingDirection=function(t,n){n=o.Utils.getInexactLocale(n),this._readCSV(this._data.rtlLanguageCodes).filter(function(r){return r===n}).length>0&&(t.prop("dir","rtl"),t.addClass("rtl"))},e.prototype._addCopyButton=function(t,n,r){var d=this._$copyTextTemplate.clone(),E=d.children();n.append(d),m.Device.isTouch()?d.show():(t.on("mouseenter",function(){d.show()}),t.on("mouseleave",function(){d.hide()}),d.on("mouseleave",function(){E.hide()}));var x=this,y=r.text();d.on("click",function(A){x._copyItemValues(d,y)})},e.prototype._copyItemValues=function(t,n){m.Clipboard.copy(n);var r=t.find(".copiedText");r.show(),setTimeout(function(){r.hide()},this._data.copiedMessageDuration)},e.prototype._readCSV=function(t,n){n===void 0&&(n=!0);var r=[];if(t&&(r=t.split(","),n))for(var d=0;d<r.length;d++)r[d]=this._normalise(r[d]);return r},e.prototype._sanitize=function(t){return this._data.sanitizer?this._data.sanitizer(t):null},e.prototype._resize=function(){},e}(v.BaseComponent);i.MetadataComponent=a;var p=function(){function h(){}return h.IIIF_VIEWER_LINK_CLICKED="iiifViewerLinkClicked",h}();i.Events=p},function(s,i,l){s.exports=function(c){var u={};function g(o){if(u[o])return u[o].exports;var v=u[o]={i:o,l:!1,exports:{}};return c[o].call(v.exports,v,v.exports,g),v.l=!0,v.exports}return g.m=c,g.c=u,g.d=function(o,v,m){g.o(o,v)||Object.defineProperty(o,v,{enumerable:!0,get:m})},g.r=function(o){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(o,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(o,"__esModule",{value:!0})},g.t=function(o,v){if(1&v&&(o=g(o)),8&v||4&v&&typeof o=="object"&&o&&o.__esModule)return o;var m=Object.create(null);if(g.r(m),Object.defineProperty(m,"default",{enumerable:!0,value:o}),2&v&&typeof o!="string")for(var a in o)g.d(m,a,function(p){return o[p]}.bind(null,a));return m},g.n=function(o){var v=o&&o.__esModule?function(){return o.default}:function(){return o};return g.d(v,"a",v),v},g.o=function(o,v){return Object.prototype.hasOwnProperty.call(o,v)},g.p="",g(g.s=4)}([function(c,u,g){"use strict";function o(v){for(var m in v)u.hasOwnProperty(m)||(u[m]=v[m])}Object.defineProperty(u,"__esModule",{value:!0}),o(g(6)),o(g(7)),o(g(8)),o(g(9)),o(g(10)),o(g(11)),o(g(12)),o(g(13)),o(g(14)),o(g(15)),o(g(16)),o(g(17)),o(g(18)),o(g(19)),o(g(20)),o(g(21)),o(g(22)),o(g(23)),o(g(24)),o(g(25)),o(g(26)),o(g(27)),o(g(28)),o(g(29)),o(g(30)),o(g(31)),o(g(32)),o(g(2))},function(c,u,g){"use strict";Object.defineProperty(u,"__esModule",{value:!0}),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"}(u.AnnotationMotivation||(u.AnnotationMotivation={})),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"}(u.Behavior||(u.Behavior={})),function(o){o.CANVAS="canvas",o.CHOICE="choice",o.CONTENT_AS_TEXT="contentastext",o.DOCUMENT="document",o.IMAGE="image",o.MOVING_IMAGE="movingimage",o.PDF="pdf",o.PHYSICAL_OBJECT="physicalobject",o.SOUND="sound",o.TEXTUALBODY="textualbody",o.VIDEO="video"}(u.ExternalResourceType||(u.ExternalResourceType={})),function(o){o.ANNOTATION="annotation",o.CANVAS="canvas",o.COLLECTION="collection",o.MANIFEST="manifest",o.RANGE="range",o.SEQUENCE="sequence"}(u.IIIFResourceType||(u.IIIFResourceType={})),function(o){o.AUDIO_MP4="audio/mp4",o.CORTO="application/corto",o.DRACO="application/draco",o.GLTF="model/gltf+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.PDF="application/pdf",o.PLY="application/ply",o.THREEJS="application/vnd.threejs+json",o.VIDEO_MP4="video/mp4",o.WEBM="video/webm"}(u.MediaType||(u.MediaType={})),function(o){o.DOC="application/msword",o.DOCX="application/vnd.openxmlformats-officedocument.wordprocessingml.document",o.PDF="application/pdf"}(u.RenderingFormat||(u.RenderingFormat={})),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.OTHER_MANIFESTATIONS="http://iiif.io/api/otherManifestations.json",o.IXIF="http://wellcomelibrary.org/ld/ixif/0/alpha.json"}(u.ServiceProfile||(u.ServiceProfile={})),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"}(u.ViewingDirection||(u.ViewingDirection={})),function(o){o.CONTINUOUS="continuous",o.INDIVIDUALS="individuals",o.NON_PAGED="non-paged",o.PAGED="paged",o.TOP="top"}(u.ViewingHint||(u.ViewingHint={}))},function(c,u,g){"use strict";var o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(d,E){function x(O){try{A(r.next(O))}catch(T){E(T)}}function y(O){try{A(r.throw(O))}catch(T){E(T)}}function A(O){var T;O.done?d(O.value):(T=O.value,T instanceof n?T:new n(function(I){I(T)})).then(x,y)}A((r=r.apply(e,t||[])).next())})},v=this&&this.__generator||function(e,t){var n,r,d,E,x={label:0,sent:function(){if(1&d[0])throw d[1];return d[1]},trys:[],ops:[]};return E={next:y(0),throw:y(1),return:y(2)},typeof Symbol=="function"&&(E[Symbol.iterator]=function(){return this}),E;function y(A){return function(O){return function(T){if(n)throw new TypeError("Generator is already executing.");for(;x;)try{if(n=1,r&&(d=2&T[0]?r.return:T[0]?r.throw||((d=r.return)&&d.call(r),0):r.next)&&!(d=d.call(r,T[1])).done)return d;switch(r=0,d&&(T=[2&T[0],d.value]),T[0]){case 0:case 1:d=T;break;case 4:return x.label++,{value:T[1],done:!1};case 5:x.label++,r=T[1],T=[0];continue;case 7:T=x.ops.pop(),x.trys.pop();continue;default:if(!(d=(d=x.trys).length>0&&d[d.length-1])&&(T[0]===6||T[0]===2)){x=0;continue}if(T[0]===3&&(!d||T[1]>d[0]&&T[1]<d[3])){x.label=T[1];break}if(T[0]===6&&x.label<d[1]){x.label=d[1],d=T;break}if(d&&x.label<d[2]){x.label=d[2],x.ops.push(T);break}d[2]&&x.ops.pop(),x.trys.pop();continue}T=t.call(e,x)}catch(I){T=[6,I],r=0}finally{n=d=0}if(5&T[0])throw T[1];return{value:T[0]?T[1]:void 0,done:!0}}([A,O])}}};Object.defineProperty(u,"__esModule",{value:!0});var m=g(0),a=g(1),p=g(33);g(34);var h=function(){function e(){}return e.getMediaType=function(t){return(t=(t=t.toLowerCase()).split(";")[0]).trim()},e.getImageQuality=function(t){return t===a.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_1||t===a.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_2||t===a.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_1||t===a.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_2||t===a.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_1||t===a.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_2||t===a.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_1||t===a.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_2||t===a.ServiceProfile.IMAGE_1_LEVEL_1||t===a.ServiceProfile.IMAGE_1_PROFILE_LEVEL_1||t===a.ServiceProfile.IMAGE_1_LEVEL_2||t===a.ServiceProfile.IMAGE_1_PROFILE_LEVEL_2?"native":"default"},e.getInexactLocale=function(t){return t.indexOf("-")!==-1?t.substr(0,t.indexOf("-")):t},e.getLocalisedValue=function(t,n){if(!Array.isArray(t))return t;for(var r=0;r<t.length;r++){var d=t[r];if(n===d["@language"])return d["@value"]}var E=n.substr(0,n.indexOf("-"));for(r=0;r<t.length;r++){var x=t[r];if(x["@language"]===E)return x["@value"]}return null},e.generateTreeNodeIds=function(t,n){var r;n===void 0&&(n=0),r=t.parentNode?t.parentNode.id+"-"+n:"0",t.id=r;for(var d=0;d<t.nodes.length;d++){var E=t.nodes[d];e.generateTreeNodeIds(E,d)}},e.normaliseType=function(t){return(t=t.toLowerCase()).indexOf(":")!==-1?t.split(":")[1]:t},e.normaliseUrl=function(t){return(t=t.substr(t.indexOf("://"))).indexOf("#")!==-1&&(t=t.split("#")[0]),t},e.normalisedUrlsMatch=function(t,n){return e.normaliseUrl(t)===e.normaliseUrl(n)},e.isImageProfile=function(t){return!!(e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_0)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_1)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_2)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_0)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_2)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_0)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_1)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_2)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_1)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_2)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_1_LEVEL_0)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_1_PROFILE_LEVEL_0)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_1_LEVEL_1)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_1_PROFILE_LEVEL_1)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_1_LEVEL_2)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_1_PROFILE_LEVEL_2)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_2_LEVEL_0)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_2_PROFILE_LEVEL_0)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_2_LEVEL_1)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_2_PROFILE_LEVEL_1)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_2_LEVEL_2)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_2_PROFILE_LEVEL_2))},e.isLevel0ImageProfile=function(t){return!!(e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_0)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_0)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_0)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_0)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_1_LEVEL_0)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_1_PROFILE_LEVEL_0)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_2_LEVEL_0)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_2_PROFILE_LEVEL_0))},e.isLevel1ImageProfile=function(t){return!!(e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_1)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_1)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_1)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_1)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_1_LEVEL_1)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_1_PROFILE_LEVEL_1)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_2_LEVEL_1)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_2_PROFILE_LEVEL_1))},e.isLevel2ImageProfile=function(t){return!!(e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_2)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_2)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_2)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_2)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_1_LEVEL_2)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_1_PROFILE_LEVEL_2)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_2_LEVEL_2)||e.normalisedUrlsMatch(t,a.ServiceProfile.IMAGE_2_PROFILE_LEVEL_2))},e.parseManifest=function(t,n){return m.Deserialiser.parse(t,n)},e.checkStatus=function(t){if(t.ok)return t;var n=new Error(t.statusText);return n.response=t,Promise.reject(n)},e.loadManifest=function(t){return new Promise(function(n){fetch(t).then(e.checkStatus).then(function(r){return r.json()}).then(function(r){n(r)})})},e.loadExternalResourcesAuth1=function(t,n,r,d,E,x,y,A){return new Promise(function(O,T){var I=t.map(function(f){return e.loadExternalResourceAuth1(f,n,r,d,E,x,y,A)});Promise.all(I).then(function(){O(t)}).catch(function(f){T(f)})})},e.loadExternalResourceAuth1=function(t,n,r,d,E,x,y,A){return o(this,void 0,void 0,function(){var O;return v(this,function(T){switch(T.label){case 0:return[4,d(t)];case 1:return(O=T.sent())?[4,t.getData(O)]:[3,6];case 2:return T.sent(),t.status!==p.OK?[3,3]:[2,t];case 3:return[4,e.doAuthChain(t,n,r,E,x,y,A)];case 4:T.sent(),T.label=5;case 5:if(t.status===p.OK||t.status===p.MOVED_TEMPORARILY)return[2,t];throw e.createAuthorizationFailedError();case 6:return[4,t.getData()];case 7:return T.sent(),t.status!==p.MOVED_TEMPORARILY&&t.status!==p.UNAUTHORIZED?[3,9]:[4,e.doAuthChain(t,n,r,E,x,y,A)];case 8:T.sent(),T.label=9;case 9:if(t.status===p.OK||t.status===p.MOVED_TEMPORARILY)return[2,t];throw e.createAuthorizationFailedError()}})})},e.doAuthChain=function(t,n,r,d,E,x,y){return o(this,void 0,void 0,function(){var A,O,T,I,f,_,C,S;return v(this,function(L){switch(L.label){case 0:return t.isAccessControlled()?((A=t.externalService)&&(A.options=t.options),(O=t.kioskService)&&(O.options=t.options),(T=t.clickThroughService)&&(T.options=t.options),(I=t.loginService)&&(I.options=t.options),t.isResponseHandled||t.status!==p.MOVED_TEMPORARILY?[3,2]:[4,x(t)]):[2,t];case 1:return L.sent(),[2,t];case 2:return f=null,_=null,(f=A)?(_=f,[4,e.attemptResourceWithToken(t,r,f)]):[3,4];case 3:return L.sent(),[2,t];case 4:return(f=O)?(_=f,(C=n(f))?[4,d(C)]:[3,7]):[3,7];case 5:return L.sent(),[4,e.attemptResourceWithToken(t,r,f)];case 6:return L.sent(),[2,t];case 7:return(f=T)?(_=f,[4,E(t,f)]):[3,11];case 8:return(S=L.sent())?[4,d(S)]:[3,11];case 9:return L.sent(),[4,e.attemptResourceWithToken(t,r,f)];case 10:return L.sent(),[2,t];case 11:return(f=I)?(_=f,[4,E(t,f)]):[3,15];case 12:return(S=L.sent())?[4,d(S)]:[3,15];case 13:return L.sent(),[4,e.attemptResourceWithToken(t,r,f)];case 14:return L.sent(),[2,t];case 15:return _&&y(t,_),[2]}})})},e.attemptResourceWithToken=function(t,n,r){return o(this,void 0,void 0,function(){var d,E;return v(this,function(x){switch(x.label){case 0:return(d=r.getService(a.ServiceProfile.AUTH_1_TOKEN))?[4,n(t,d)]:[3,3];case 1:return(E=x.sent())&&E.accessToken?[4,t.getData(E)]:[3,3];case 2:return x.sent(),[2,t];case 3:return[2]}})})},e.loadExternalResourcesAuth09=function(t,n,r,d,E,x,y,A,O,T){return new Promise(function(I,f){var _=t.map(function(C){return e.loadExternalResourceAuth09(C,n,r,d,E,x,y,A,O,T)});Promise.all(_).then(function(){I(t)}).catch(function(C){f(C)})})},e.loadExternalResourceAuth09=function(t,n,r,d,E,x,y,A,O,T){return new Promise(function(I,f){T&&T.pessimisticAccessControl?t.getData().then(function(){t.isAccessControlled()?t.clickThroughService?(I(r(t)),I(d(t))):E(t).then(function(){x(t,!0).then(function(_){t.getData(_).then(function(){I(O(t))}).catch(function(C){f(e.createInternalServerError(C))})}).catch(function(_){f(e.createInternalServerError(_))})}).catch(function(_){f(e.createInternalServerError(_))}):I(t)}).catch(function(_){f(e.createInternalServerError(_))}):A(t,n).then(function(_){_?t.getData(_).then(function(){t.status===p.OK?I(O(t)):e.authorize(t,n,r,d,E,x,y,A).then(function(){I(O(t))}).catch(function(C){f(e.createAuthorizationFailedError())})}).catch(function(C){f(e.createAuthorizationFailedError())}):e.authorize(t,n,r,d,E,x,y,A).then(function(){I(O(t))}).catch(function(C){f(e.createAuthorizationFailedError())})}).catch(function(_){f(e.createAuthorizationFailedError())})})},e.createError=function(t,n){var r=new Error;return r.message=n,r.name=String(t),r},e.createAuthorizationFailedError=function(){return e.createError(m.StatusCode.AUTHORIZATION_FAILED,"Authorization failed")},e.createRestrictedError=function(){return e.createError(m.StatusCode.RESTRICTED,"Restricted")},e.createInternalServerError=function(t){return e.createError(m.StatusCode.INTERNAL_SERVER_ERROR,t)},e.authorize=function(t,n,r,d,E,x,y,A){return new Promise(function(O,T){t.getData().then(function(){t.isAccessControlled()?A(t,n).then(function(I){I?t.getData(I).then(function(){t.status===p.OK?O(t):e.showAuthInteraction(t,n,r,d,E,x,y,O,T)}).catch(function(f){T(e.createInternalServerError(f))}):x(t,!1).then(function(f){f?y(t,f,n).then(function(){t.getData(f).then(function(){t.status===p.OK?O(t):e.showAuthInteraction(t,n,r,d,E,x,y,O,T)}).catch(function(_){T(e.createInternalServerError(_))})}).catch(function(_){T(e.createInternalServerError(_))}):e.showAuthInteraction(t,n,r,d,E,x,y,O,T)})}).catch(function(I){T(e.createInternalServerError(I))}):O(t)})})},e.showAuthInteraction=function(t,n,r,d,E,x,y,A,O){t.status!==p.MOVED_TEMPORARILY||t.isResponseHandled?t.clickThroughService&&!t.isResponseHandled?r(t).then(function(){x(t,!0).then(function(T){y(t,T,n).then(function(){t.getData(T).then(function(){A(t)}).catch(function(I){O(e.createInternalServerError(I))})}).catch(function(I){O(e.createInternalServerError(I))})}).catch(function(T){O(e.createInternalServerError(T))})}):E(t).then(function(){x(t,!0).then(function(T){y(t,T,n).then(function(){t.getData(T).then(function(){A(t)}).catch(function(I){O(e.createInternalServerError(I))})}).catch(function(I){O(e.createInternalServerError(I))})}).catch(function(T){O(e.createInternalServerError(T))})}):A(t)},e.getService=function(t,n){for(var r=this.getServices(t),d=0;d<r.length;d++){var E=r[d];if(E.getProfile()===n)return E}return null},e.getResourceById=function(t,n){return e.traverseAndFind(t.__jsonld,"@id",n)},e.traverseAndFind=function(t,n,r){if(t.hasOwnProperty(n)&&t[n]===r)return t;for(var d=0;d<Object.keys(t).length;d++)if(typeof t[Object.keys(t)[d]]=="object"){var E=e.traverseAndFind(t[Object.keys(t)[d]],n,r);if(E!=null)return E}},e.getServices=function(t){var n,r=[];if(!(n=t.__jsonld?t.__jsonld.service:t.service))return r;Array.isArray(n)||(n=[n]);for(var d=0;d<n.length;d++){var E=n[d];if(typeof E=="string"){var x=this.getResourceById(t.options.resource,E);x&&r.push(new m.Service(x.__jsonld||x,t.options))}else r.push(new m.Service(E,t.options))}return r},e.getTemporalComponent=function(t){var n=/t=([^&]+)/g.exec(t),r=null;return n&&n[1]&&(r=n[1].split(",")),r},e}();u.Utils=h},function(c,u,g){"use strict";g.r(u),u.default=function(o,v){return v=v||{},new Promise(function(m,a){var p=new XMLHttpRequest,h=[],e=[],t={},n=function(){return{ok:(p.status/100|0)==2,statusText:p.statusText,status:p.status,url:p.responseURL,text:function(){return Promise.resolve(p.responseText)},json:function(){return Promise.resolve(JSON.parse(p.responseText))},blob:function(){return Promise.resolve(new Blob([p.response]))},clone:n,headers:{keys:function(){return h},entries:function(){return e},get:function(d){return t[d.toLowerCase()]},has:function(d){return d.toLowerCase()in t}}}};for(var r in p.open(v.method||"get",o,!0),p.onload=function(){p.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,function(d,E,x){h.push(E=E.toLowerCase()),e.push([E,x]),t[E]=t[E]?t[E]+","+x:x}),m(n())},p.onerror=a,p.withCredentials=v.credentials=="include",v.headers)p.setRequestHeader(r,v.headers[r]);p.send(v.body||null)})}},function(c,u,g){c.exports=g(5)},function(c,u,g){"use strict";Object.defineProperty(u,"__esModule",{value:!0}),function(v){for(var m in v)u.hasOwnProperty(m)||(u[m]=v[m])}(g(0));var o=g(2);u.loadManifest=function(v){return o.Utils.loadManifest(v)},u.parseManifest=function(v,m){return o.Utils.parseManifest(v,m)}},function(c,u,g){"use strict";Object.defineProperty(u,"__esModule",{value:!0});var o=function(){function v(m){this.__jsonld=m,this.context=this.getProperty("context"),this.id=this.getProperty("id")}return v.prototype.getProperty=function(m){var a=null;return this.__jsonld&&((a=this.__jsonld[m])||(a=this.__jsonld["@"+m])),a},v}();u.JSONLDResource=o},function(c,u,g){"use strict";var o,v=this&&this.__extends||(o=function(h,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var r in n)n.hasOwnProperty(r)&&(t[r]=n[r])})(h,e)},function(h,e){function t(){this.constructor=h}o(h,e),h.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)});Object.defineProperty(u,"__esModule",{value:!0});var m=g(0),a=g(1),p=function(h){function e(t,n){var r=h.call(this,t)||this;return r.options=n,r}return v(e,h),e.prototype.getIIIFResourceType=function(){return m.Utils.normaliseType(this.getProperty("type"))},e.prototype.getLabel=function(){var t=this.getProperty("label");return t?m.LanguageMap.parse(t,this.options.locale):[]},e.prototype.getDefaultLabel=function(){return m.LanguageMap.getValue(this.getLabel())},e.prototype.getMetadata=function(){var t=this.getProperty("metadata"),n=[];if(!t)return n;for(var r=0;r<t.length;r++){var d=t[r],E=new m.LabelValuePair(this.options.locale);E.parse(d),n.push(E)}return n},e.prototype.getRendering=function(t){for(var n=this.getRenderings(),r=0;r<n.length;r++){var d=n[r];if(d.getFormat()===t)return d}return null},e.prototype.getRenderings=function(){var t,n=[];if(!(t=this.__jsonld?this.__jsonld.rendering:this.rendering))return n;Array.isArray(t)||(t=[t]);for(var r=0;r<t.length;r++){var d=t[r];n.push(new m.Rendering(d,this.options))}return n},e.prototype.getService=function(t){return m.Utils.getService(this,t)},e.prototype.getServices=function(){return m.Utils.getServices(this)},e.prototype.getThumbnail=function(){var t=this.getProperty("thumbnail");return Array.isArray(t)&&(t=t[0]),t?new m.Thumbnail(t,this.options):null},e.prototype.isAnnotation=function(){return this.getIIIFResourceType()===a.IIIFResourceType.ANNOTATION},e.prototype.isCanvas=function(){return this.getIIIFResourceType()===a.IIIFResourceType.CANVAS},e.prototype.isCollection=function(){return this.getIIIFResourceType()===a.IIIFResourceType.COLLECTION},e.prototype.isManifest=function(){return this.getIIIFResourceType()===a.IIIFResourceType.MANIFEST},e.prototype.isRange=function(){return this.getIIIFResourceType()===a.IIIFResourceType.RANGE},e.prototype.isSequence=function(){return this.getIIIFResourceType()===a.IIIFResourceType.SEQUENCE},e}(m.JSONLDResource);u.ManifestResource=p},function(c,u,g){"use strict";var o,v=this&&this.__extends||(o=function(p,h){return(o=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])})(p,h)},function(p,h){function e(){this.constructor=p}o(p,h),p.prototype=h===null?Object.create(h):(e.prototype=h.prototype,new e)});Object.defineProperty(u,"__esModule",{value:!0});var m=g(0),a=function(p){function h(e,t){return p.call(this,e,t)||this}return v(h,p),h.prototype.getFormat=function(){var e=this.getProperty("format");return e?e.toLowerCase():null},h.prototype.getResources=function(){var e=[];if(!this.__jsonld.resources)return e;for(var t=0;t<this.__jsonld.resources.length;t++){var n=this.__jsonld.resources[t],r=new m.Annotation(n,this.options);e.push(r)}return e},h.prototype.getType=function(){var e=this.getProperty("type");return e?m.Utils.normaliseType(e):null},h.prototype.getWidth=function(){return this.getProperty("width")},h.prototype.getHeight=function(){return this.getProperty("height")},h.prototype.getMaxWidth=function(){return this.getProperty("maxWidth")},h.prototype.getMaxHeight=function(){return this.getProperty("maxHeight")?null:this.getMaxWidth()},h}(m.ManifestResource);u.Resource=a},function(c,u,g){"use strict";var o,v=this&&this.__extends||(o=function(h,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var r in n)n.hasOwnProperty(r)&&(t[r]=n[r])})(h,e)},function(h,e){function t(){this.constructor=h}o(h,e),h.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)});Object.defineProperty(u,"__esModule",{value:!0});var m=g(0),a=g(1),p=function(h){function e(t,n){var r=h.call(this,t,n)||this;r.index=-1,r.isLoaded=!1;var d={defaultLabel:"-",locale:"en-GB",resource:r,pessimisticAccessControl:!1};return r.options=Object.assign(d,n),r}return v(e,h),e.prototype.getAttribution=function(){var t=this.getProperty("attribution");return t?m.LanguageMap.parse(t,this.options.locale):[]},e.prototype.getDescription=function(){var t=this.getProperty("description");return t?m.LanguageMap.parse(t,this.options.locale):[]},e.prototype.getIIIFResourceType=function(){return m.Utils.normaliseType(this.getProperty("type"))},e.prototype.getLogo=function(){var t=this.getProperty("logo");return t?typeof t=="string"?t:(Array.isArray(t)&&t.length&&(t=t[0]),t["@id"]||t.id):null},e.prototype.getLicense=function(){return m.Utils.getLocalisedValue(this.getProperty("license"),this.options.locale)},e.prototype.getNavDate=function(){return new Date(this.getProperty("navDate"))},e.prototype.getRelated=function(){return this.getProperty("related")},e.prototype.getSeeAlso=function(){return this.getProperty("seeAlso")},e.prototype.getTrackingLabel=function(){var t=this.getService(a.ServiceProfile.TRACKING_EXTENSIONS);return t?t.getProperty("trackingLabel"):""},e.prototype.getDefaultTree=function(){return this.defaultTree=new m.TreeNode("root"),this.defaultTree.data=this,this.defaultTree},e.prototype.getRequiredStatement=function(){var t=null,n=this.getProperty("requiredStatement");if(n)(t=new m.LabelValuePair(this.options.locale)).parse(n);else{var r=this.getAttribution();r&&((t=new m.LabelValuePair(this.options.locale)).value=r)}return t},e.prototype.isCollection=function(){return this.getIIIFResourceType()===a.IIIFResourceType.COLLECTION},e.prototype.isManifest=function(){return this.getIIIFResourceType()===a.IIIFResourceType.MANIFEST},e.prototype.load=function(){var t=this;return new Promise(function(n){if(t.isLoaded)n(t);else{var r=t.options;r.navDate=t.getNavDate();var d=t.__jsonld.id;d||(d=t.__jsonld["@id"]),m.Utils.loadManifest(d).then(function(E){t.parentLabel=m.LanguageMap.getValue(t.getLabel(),r.locale);var x=m.Deserialiser.parse(E,r);(t=Object.assign(t,x)).index=r.index,n(t)})}})},e}(m.ManifestResource);u.IIIFResource=p},function(c,u,g){"use strict";var o,v=this&&this.__extends||(o=function(p,h){return(o=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])})(p,h)},function(p,h){function e(){this.constructor=p}o(p,h),p.prototype=h===null?Object.create(h):(e.prototype=h.prototype,new e)});Object.defineProperty(u,"__esModule",{value:!0});var m=g(0),a=function(p){function h(e,t){return p.call(this,e,t)||this}return v(h,p),h.prototype.getBody=function(){var e=[],t=this.getProperty("body");if(t)if(Array.isArray(t))for(var n=0;n<t.length;n++)if((E=t[n]).items)for(var r=0;r<E.items.length;r++){var d=E.items[r];e.push(new m.AnnotationBody(d,this.options))}else e.push(new m.AnnotationBody(E,this.options));else if(t.items)for(n=0;n<t.items.length;n++){var E=t.items[n];e.push(new m.AnnotationBody(E,this.options))}else e.push(new m.AnnotationBody(t,this.options));return e},h.prototype.getMotivation=function(){return this.getProperty("motivation")||null},h.prototype.getOn=function(){return this.getProperty("on")},h.prototype.getTarget=function(){return this.getProperty("target")},h.prototype.getResource=function(){return new m.Resource(this.getProperty("resource"),this.options)},h}(m.ManifestResource);u.Annotation=a},function(c,u,g){"use strict";var o,v=this&&this.__extends||(o=function(p,h){return(o=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])})(p,h)},function(p,h){function e(){this.constructor=p}o(p,h),p.prototype=h===null?Object.create(h):(e.prototype=h.prototype,new e)});Object.defineProperty(u,"__esModule",{value:!0});var m=g(0),a=function(p){function h(e,t){return p.call(this,e,t)||this}return v(h,p),h.prototype.getFormat=function(){var e=this.getProperty("format");return e?m.Utils.getMediaType(e):null},h.prototype.getType=function(){return this.getProperty("type")?m.Utils.normaliseType(this.getProperty("type")):null},h.prototype.getWidth=function(){return this.getProperty("width")},h.prototype.getHeight=function(){return this.getProperty("height")},h}(m.ManifestResource);u.AnnotationBody=a},function(c,u,g){"use strict";var o,v=this&&this.__extends||(o=function(p,h){return(o=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])})(p,h)},function(p,h){function e(){this.constructor=p}o(p,h),p.prototype=h===null?Object.create(h):(e.prototype=h.prototype,new e)});Object.defineProperty(u,"__esModule",{value:!0});var m=g(0),a=function(p){function h(e,t,n){var r=p.call(this,t)||this;return r.label=e,r.options=n,r}return v(h,p),h.prototype.getIIIFResourceType=function(){return m.Utils.normaliseType(this.getProperty("type"))},h.prototype.getLabel=function(){return this.label},h.prototype.getResources=function(){var e=this;return this.getProperty("resources").map(function(t){return new m.Annotation(t,e.options)})},h.prototype.load=function(){var e=this;return new Promise(function(t,n){if(e.isLoaded)t(e);else{var r=e.__jsonld.id;r||(r=e.__jsonld["@id"]),m.Utils.loadManifest(r).then(function(d){e.__jsonld=d,e.context=e.getProperty("context"),e.id=e.getProperty("id"),e.isLoaded=!0,t(e)}).catch(n)}})},h}(m.JSONLDResource);u.AnnotationList=a},function(c,u,g){"use strict";var o,v=this&&this.__extends||(o=function(a,p){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,e){h.__proto__=e}||function(h,e){for(var t in e)e.hasOwnProperty(t)&&(h[t]=e[t])})(a,p)},function(a,p){function h(){this.constructor=a}o(a,p),a.prototype=p===null?Object.create(p):(h.prototype=p.prototype,new h)});Object.defineProperty(u,"__esModule",{value:!0});var m=function(a){function p(h,e){return a.call(this,h,e)||this}return v(p,a),p.prototype.getItems=function(){return this.getProperty("items")},p}(g(0).ManifestResource);u.AnnotationPage=m},function(c,u,g){"use strict";var o,v=this&&this.__extends||(o=function(p,h){return(o=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])})(p,h)},function(p,h){function e(){this.constructor=p}o(p,h),p.prototype=h===null?Object.create(h):(e.prototype=h.prototype,new e)});Object.defineProperty(u,"__esModule",{value:!0});var m=g(0),a=function(p){function h(e,t){return p.call(this,e,t)||this}return v(h,p),h.prototype.getCanonicalImageUri=function(e){var t,n=null,r="default",d=e;if(this.externalResource&&this.externalResource.data&&this.externalResource.data["@id"])n=this.externalResource.data["@id"],d||(d=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)&&(r="native");else{var E=this.getImages();if(E&&E.length){var x=E[0].getResource(),y=x.getServices();if(d||(d=x.getWidth()),y.length){var A=y[0];n=A.id,r=m.Utils.getImageQuality(A.getProfile())}else if(d===x.getWidth())return x.id}if(!n){var O=this.getProperty("thumbnail");if(O){if(typeof O=="string")return O;if(O["@id"])return O["@id"];if(O.length)return O[0].id}}}return t=d+",",n&&n.endsWith("/")&&(n=n.substr(0,n.length-1)),[n,"full",t,0,r+".jpg"].join("/")},h.prototype.getMaxDimensions=function(){var e,t=null;return this.externalResource&&this.externalResource.data&&this.externalResource.data.profile&&(e=this.externalResource.data.profile,Array.isArray(e)&&(e=e.filter(function(n){return n.maxWidth})[0])&&(t=new m.Size(e.maxWidth,e.maxHeight?e.maxHeight:e.maxWidth))),t},h.prototype.getContent=function(){var e=[],t=this.__jsonld.items||this.__jsonld.content;if(!t)return e;var n=null;if(t.length&&(n=new m.AnnotationPage(t[0],this.options)),!n)return e;for(var r=n.getItems(),d=0;d<r.length;d++){var E=r[d],x=new m.Annotation(E,this.options);e.push(x)}return e},h.prototype.getDuration=function(){return this.getProperty("duration")},h.prototype.getImages=function(){var e=[];if(!this.__jsonld.images)return e;for(var t=0;t<this.__jsonld.images.length;t++){var n=this.__jsonld.images[t],r=new m.Annotation(n,this.options);e.push(r)}return e},h.prototype.getIndex=function(){return this.getProperty("index")},h.prototype.getOtherContent=function(){var e=this,t=(Array.isArray(this.getProperty("otherContent"))?this.getProperty("otherContent"):[this.getProperty("otherContent")]).filter(function(n){return n&&typeof(r=n["@type"])=="string"&&r.toLowerCase()==r.toLowerCase();var r}).map(function(n,r){return new m.AnnotationList(n.label||"Annotation list "+r,n,e.options)}).map(function(n){return n.load()});return Promise.all(t)},h.prototype.getWidth=function(){return this.getProperty("width")},h.prototype.getHeight=function(){return this.getProperty("height")},h}(m.Resource);u.Canvas=a},function(c,u,g){"use strict";var o,v=this&&this.__extends||(o=function(h,e){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var r in n)n.hasOwnProperty(r)&&(t[r]=n[r])})(h,e)},function(h,e){function t(){this.constructor=h}o(h,e),h.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)});Object.defineProperty(u,"__esModule",{value:!0});var m=g(1),a=g(0),p=function(h){function e(t,n){var r=h.call(this,t,n)||this;return r.items=[],r._collections=null,r._manifests=null,t.__collection=r,r}return v(e,h),e.prototype.getCollections=function(){return this._collections?this._collections:this._collections=this.items.filter(function(t){return t.isCollection()})},e.prototype.getManifests=function(){return this._manifests?this._manifests:this._manifests=this.items.filter(function(t){return t.isManifest()})},e.prototype.getCollectionByIndex=function(t){for(var n,r=this.getCollections(),d=0;d<r.length;d++){var E=r[d];E.index===t&&(n=E)}if(n)return n.options.index=t,n.load();throw new Error("Collection index not found")},e.prototype.getManifestByIndex=function(t){for(var n,r=this.getManifests(),d=0;d<r.length;d++){var E=r[d];E.index===t&&(n=E)}if(n)return n.options.index=t,n.load();throw new Error("Manifest index not found")},e.prototype.getTotalCollections=function(){return this.getCollections().length},e.prototype.getTotalManifests=function(){return this.getManifests().length},e.prototype.getTotalItems=function(){return this.items.length},e.prototype.getViewingDirection=function(){return this.getProperty("viewingDirection")?this.getProperty("viewingDirection"):m.ViewingDirection.LEFT_TO_RIGHT},e.prototype.getDefaultTree=function(){return h.prototype.getDefaultTree.call(this),this.defaultTree.data.type=a.Utils.normaliseType(a.TreeNodeType.COLLECTION),this._parseManifests(this),this._parseCollections(this),a.Utils.generateTreeNodeIds(this.defaultTree),this.defaultTree},e.prototype._parseManifests=function(t){if(t.getManifests()&&t.getManifests().length)for(var n=0;n<t.getManifests().length;n++){var r=t.getManifests()[n],d=r.getDefaultTree();d.label=r.parentLabel||a.LanguageMap.getValue(r.getLabel(),this.options.locale)||"manifest "+(n+1),d.navDate=r.getNavDate(),d.data.id=r.id,d.data.type=a.Utils.normaliseType(a.TreeNodeType.MANIFEST),t.defaultTree.addNode(d)}},e.prototype._parseCollections=function(t){if(t.getCollections()&&t.getCollections().length)for(var n=0;n<t.getCollections().length;n++){var r=t.getCollections()[n],d=r.getDefaultTree();d.label=r.parentLabel||a.LanguageMap.getValue(r.getLabel(),this.options.locale)||"collection "+(n+1),d.navDate=r.getNavDate(),d.data.id=r.id,d.data.type=a.Utils.normaliseType(a.TreeNodeType.COLLECTION),t.defaultTree.addNode(d)}},e}(a.IIIFResource);u.Collection=p},function(c,u,g){"use strict";Object.defineProperty(u,"__esModule",{value:!0});var o=function(){function v(m,a){this.start=m,this.end=a}return v.prototype.getLength=function(){return this.end-this.start},v}();u.Duration=o},function(c,u,g){"use strict";Object.defineProperty(u,"__esModule",{value:!0});var o=g(0),v=function(){function m(a){this.defaultLocale=a}return m.prototype.parse=function(a){this.resource=a,this.label=o.LanguageMap.parse(this.resource.label,this.defaultLocale),this.value=o.LanguageMap.parse(this.resource.value,this.defaultLocale)},m.prototype.getLabel=function(){return this.label?o.LanguageMap.getValue(this.label,this.defaultLocale):null},m.prototype.setLabel=function(a){var p=this;if(this.label&&this.label.length){var h=this.label.filter(function(e){return e.locale===p.defaultLocale||e.locale===o.Utils.getInexactLocale(p.defaultLocale)})[0];h&&(h.value=a)}},m.prototype.getValue=function(){if(this.value){var a=this.defaultLocale;return this.label&&this.label.length&&this.label[0].locale&&(a=this.label[0].locale),o.LanguageMap.getValue(this.value,a)}return null},m.prototype.setValue=function(a){var p=this;if(this.value&&this.value.length){var h=this.va