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 97.2 kB
"use strict";(self.webpackChunkUV=self.webpackChunkUV||[]).push([[429],{9594:(t,e,n)=>{n.d(e,{M:()=>l});var i,o=n(4194),s=n(9323),a=(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),r=n(4692),l=function(t){function e(e){return t.call(this,e)||this}return a(e,t),e.prototype.create=function(){var e,n=this;this.setConfig("settingsDialogue"),t.prototype.create.call(this),this.openCommand=o.b.SHOW_SETTINGS_DIALOGUE,this.closeCommand=o.b.HIDE_SETTINGS_DIALOGUE,this.extensionHost.subscribe(this.openCommand,(function(t){e=t,n.open()})),this.extensionHost.subscribe(this.closeCommand,(function(){e&&e.focus(),n.close()})),this.$title=r('<div role="heading" class="heading"></div>'),this.$content.append(this.$title),this.$scroll=r('<div class="scroll"></div>'),this.$content.append(this.$scroll),this.$version=r('<div class="version"></div>'),this.$content.append(this.$version),this.$website=r('<div class="website"></div>'),this.$content.append(this.$website),this.$locale=r('<div class="setting locale"></div>'),this.$scroll.append(this.$locale),this.$localeLabel=r('<label for="locale">'+this.content.locale+"</label>"),this.$locale.append(this.$localeLabel),this.$localeDropDown=r('<select id="locale"></select>'),this.$locale.append(this.$localeDropDown),this.$title.text(this.content.title),this.$website.html(this.content.website),this.$website.targetBlank(),this._createLocalesMenu(),this._createAccessibilityMenu(),this.$element.hide()},e.prototype.getSettings=function(){return this.extension.getSettings()},e.prototype.updateSettings=function(t){this.extension.updateSettings(t),this.extensionHost.publish(o.b.UPDATE_SETTINGS,t)},e.prototype.open=function(){t.prototype.open.call(this),this.$version.text("v4.2.0-rc2")},e.prototype._createLocalesMenu=function(){var t=this,e=this.extension.data.locales;if(e&&e.length>1){for(var n=0;n<e.length;n++){var i=e[n];this.$localeDropDown.append('<option value="'+i.name+'">'+i.label+"</option>")}this.$localeDropDown.val(e[0].name)}else this.$locale.hide();this.$localeDropDown.change((function(){t.extension.changeLocale(t.$localeDropDown.val())}))},e.prototype.resize=function(){t.prototype.resize.call(this)},e.prototype._createAccessibilityMenu=function(){var t=this;this.$reducedAnimation=r('<div class="setting reducedAnimation"></div>'),this.$scroll.append(this.$reducedAnimation),this.$reducedAnimationCheckbox=r('<input id="reducedAnimation" type="checkbox" tabindex="0" />'),this.$reducedAnimation.append(this.$reducedAnimationCheckbox),this.$reducedAnimationLabel=r('<label for="reducedAnimation">'+this.content.reducedMotion+"</label>"),this.$reducedAnimation.append(this.$reducedAnimationLabel);var e=this.getSettings();e.animationDuration&&document.documentElement.style.setProperty("--uv-animation-duration","".concat(e.animationDuration,"ms")),e.reducedAnimation?(document.documentElement.style.setProperty("--uv-animation","0"),this.$reducedAnimationCheckbox.prop("checked",!0)):(document.documentElement.style.setProperty("--uv-animation","1"),this.$reducedAnimationCheckbox.removeAttr("checked")),this.$reducedAnimationCheckbox.change((function(){var e={};t.$reducedAnimationCheckbox.is(":checked")?(e.reducedAnimation=!0,document.documentElement.style.setProperty("--uv-animation","0")):(e.reducedAnimation=!1,document.documentElement.style.setProperty("--uv-animation","1")),t.updateSettings(e)}))},e}(s.X)},4792:(t,e,n)=>{n.d(e,{C:()=>c});var i,o=n(4342),s=n(4194),a=n(9323),r=(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),l=n(4692),c=function(t){function e(e){var n=t.call(this,e)||this;return n.copyToClipboardEnabled=!0,n.isShareViewVisible=!1,n.shareManifestsEnabled=!1,n.isEmbedViewVisible=!1,n.aspectRatio=.75,n.maxWidth=8e3,n.maxHeight=n.maxWidth*n.aspectRatio,n.minWidth=200,n.minHeight=n.minWidth*n.aspectRatio,n}return r(e,t),e.prototype.create=function(){var e,n,i=this;this.setConfig("shareDialogue"),t.prototype.create.call(this),this.$element.attr("role","region"),this.$element.attr("aria-label",this.content.share),this.openCommand=s.b.SHOW_SHARE_DIALOGUE,this.closeCommand=s.b.HIDE_SHARE_DIALOGUE,this.shareManifestsEnabled=this.options.shareManifestsEnabled||!1,this.extensionHost.subscribe(this.openCommand,(function(t){n=t,i.open(t)})),this.extensionHost.subscribe(this.closeCommand,(function(){n&&n.focus(),i.close()})),this.extensionHost.subscribe(s.b.SHOW_EMBED_DIALOGUE,(function(t){i.open(t),t&&l(t).is(".embed.btn")&&setTimeout((function(){i.$embedCode.focus()}),2)}));var a=l('<div role="heading" class="heading">'.concat(this.content.share,"</div>"));this.$content.append(a),this.$urlSection=l('<div class="share__section"><label class="share__label" for="embedCode">'.concat(this.content.shareLink,"</label></div>"));var r=this.getShareUrl();this.$urlInput=l('<input class="copy-input" id="urlInput" type="text" value="'.concat(r,'" readonly/>')),this.$urlInput.focus((function(){l(this).select()})),this.$urlSection.append(this.$urlInput),this.$content.append(this.$urlSection),this.$manifestSection=l('<div class="share__section"><label class="share__label" for="manifestCode">'.concat(this.content.iiif,"</label></div>"));var c=this.extension.getIIIFShareUrl(this.shareManifestsEnabled);this.$manifestInput=l('<input class="copy-input" id="manifestInput" type="text" value="'.concat(c,'" readonly/>')),this.$manifestInput.focus((function(){l(this).select()})),this.$manifestSection.append(this.$manifestInput),this.$content.append(this.$manifestSection),this.$embedSection=l('<div class="share__section"><label class="share__label" for="embedCode">'.concat(this.content.embed,"</label></div>")),this.$embedCode=l('<input class="copy-input" id="embedCode" type="text" readonly/>'),this.$embedCode.focus((function(){l(this).select()})),this.$embedSection.append(this.$embedCode),this.$content.append(this.$embedSection),this.$customSize=l('<div class="customSize"></div>'),this.$size=l('<label for="size" class="size">'.concat(this.content.size,"</label>")),this.$customSize.append(this.$size),this.$customSizeDropDown=l('<select class="embed-size-select" id="size" aria-label="'.concat(this.content.size,'"></select>')),this.$customSizeDropDown.append('<option value="small" data-width="560" data-height="420">560 x 420</option>'),this.$customSizeDropDown.append('<option value="medium" data-width="640" data-height="480">640 x 480</option>'),this.$customSizeDropDown.append('<option value="large" data-width="800" data-height="600">800 x 600</option>'),this.$customSizeDropDown.append('<option value="custom">'.concat(this.content.customSize,"</option>")),this.$customSizeDropDown.change((function(){i.update()})),this.$customSize.append(this.$customSizeDropDown),this.$widthInput=l('<input class="width" type="text" maxlength="10" aria-label="'.concat(this.content.width,'"/>')),this.$widthInput.on("keydown",(function(t){return o.FQ.numericalInput(t)})),this.$widthInput.change((function(){i.updateHeightRatio(),i.update()})),this.$customSize.append(this.$widthInput),this.$embedSection.append(this.$customSize),this.$x=l('<span class="x">x</span>'),this.$customSize.append(this.$x),this.$heightInput=l('<input class="height" type="text" maxlength="10" aria-label="'.concat(this.content.height,'"/>')),this.$heightInput.on("keydown",(function(t){return o.FQ.numericalInput(t)})),this.$heightInput.change((function(){i.updateWidthRatio(),i.update()})),this.$customSize.append(this.$heightInput);var h=l('<div class="iiif-section"></div>');this.$iiifButton=l('<a class="imageBtn iiif" href="'.concat(c,'" title="').concat(this.content.iiif,'" target="_blank"></a>')),h.append(this.$iiifButton),this.$content.append(h),this.$termsOfUseButton=l('<a href="#">'.concat(null===(e=this.extension.data.config)||void 0===e?void 0:e.content.termsOfUse,"</a>")),h.append(this.$termsOfUseButton),this.shareManifestsEnabled?this.$manifestSection.show():this.$manifestSection.hide(),o.YA.getBool(this.config.options.embedEnabled,!1)?this.$embedSection.show():this.$embedSection.hide(),this.onAccessibleClick(this.$termsOfUseButton,(function(){i.extensionHost.publish(s.b.SHOW_TERMS_OF_USE)})),o.YA.getBool(this.config.options.copyToClipboardEnabled,!0)&&(this.addCopyButton(this.$urlInput),this.addCopyButton(this.$embedCode),this.addCopyButton(this.$manifestInput)),this.$element.hide(),this.update()},e.prototype.open=function(e){t.prototype.open.call(this,e),this.update()},e.prototype.getShareUrl=function(){return this.extension.getShareUrl()},e.prototype.isShareAvailable=function(){return!!this.getShareUrl()},e.prototype.addCopyButton=function(t){var e=l('<button class="copyBtn" aria-label="'.concat(this.content.copyToClipboard,'">').concat(this.content.copyBtn,"</button>"));this.onAccessibleClick(e,(function(){o.B0.copy(t.val()),t.focus()}),!0,!0);var n=l('<div class="copy-group"></div>');n.append(e),n.insertBefore(t),t.insertBefore(e)},e.prototype.update=function(){this.isShareAvailable()?this.$urlSection.show():this.$urlSection.hide();var t=this.getSelectedSize();"custom"===t.val()?(this.$widthInput.show(),this.$x.show(),this.$heightInput.show()):(this.$widthInput.hide(),this.$x.hide(),this.$heightInput.hide(),this.currentWidth=Number(t.data("width")),this.currentHeight=Number(t.data("height")),this.$widthInput.val(String(this.currentWidth)),this.$heightInput.val(String(this.currentHeight))),this.updateShareOptions(),this.updateTermsOfUseButton()},e.prototype.updateShareOptions=function(){var t=this.getShareUrl();t&&this.$urlInput.val(t)},e.prototype.getSelectedSize=function(){return this.$customSizeDropDown.find(":selected")},e.prototype.updateWidthRatio=function(){this.currentHeight=Number(this.$heightInput.val()),this.currentHeight<this.minHeight?(this.currentHeight=this.minHeight,this.$heightInput.val(String(this.currentHeight))):this.currentHeight>this.maxHeight&&(this.currentHeight=this.maxHeight,this.$heightInput.val(String(this.currentHeight))),this.currentWidth=Math.floor(this.currentHeight/this.aspectRatio),this.$widthInput.val(String(this.currentWidth))},e.prototype.updateHeightRatio=function(){this.currentWidth=Number(this.$widthInput.val()),this.currentWidth<this.minWidth?(this.currentWidth=this.minWidth,this.$widthInput.val(String(this.currentWidth))):this.currentWidth>this.maxWidth&&(this.currentWidth=this.maxWidth,this.$widthInput.val(String(this.currentWidth))),this.currentHeight=Math.floor(this.currentWidth*this.aspectRatio),this.$heightInput.val(String(this.currentHeight))},e.prototype.updateTermsOfUseButton=function(){var t,e=this.extension.helper.getRequiredStatement();o.YA.getBool(null===(t=this.extension.data.config)||void 0===t?void 0:t.options.termsOfUseEnabled,!0)&&e&&e.value?this.$termsOfUseButton.show():this.$termsOfUseButton.hide()},e.prototype.close=function(){t.prototype.close.call(this)},e.prototype.resize=function(){this.setDockedPosition()},e}(a.X)},6192:(t,e,n)=>{n.d(e,{Q:()=>f});var i,o=n(4194),s=n(4342),a=n(8719),r=(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),l=function(t){function e(e){return t.call(this,e,!1,!1)||this}return r(e,t),e.prototype.create=function(){t.prototype.create.call(this)},e.prototype.init=function(){var e=this;t.prototype.init.call(this),s.YA.getBool(this.extension.getSettings().rightPanelOpen,this.options.panelOpen)&&this.toggle(!0),this.extensionHost.subscribe(o.b.TOGGLE_EXPAND_RIGHT_PANEL,(function(){e.isFullyExpanded?e.collapseFull():e.expandFull()})),this.extensionHost.subscribe(o.b.TOGGLE_RIGHT_PANEL,(function(){e.toggle()})),this.extensionHost.subscribe(o.b.TOGGLE_LEFT_PANEL,(function(){e.extension.isMetric("sm")&&e.isExpanded&&e.toggle(!0)}))},e.prototype.getTargetWidth=function(){return this.isExpanded?this.options.panelCollapsedWidth:this.options.panelExpandedWidth},e.prototype.getTargetLeft=function(){return this.isExpanded?this.$element.parent().width()-this.options.panelCollapsedWidth:this.$element.parent().width()-this.options.panelExpandedWidth},e.prototype.toggleFinish=function(){var e=this;t.prototype.toggleFinish.call(this),this.isExpanded?this.extensionHost.publish(o.b.OPEN_RIGHT_PANEL):this.extensionHost.publish(o.b.CLOSE_RIGHT_PANEL),this.extension.updateSettings({rightPanelOpen:this.isExpanded}),setTimeout((function(){e.$element.toggleClass("open-finished")}),100)},e.prototype.resize=function(){t.prototype.resize.call(this)},e.prototype.toggle=function(e){this.isExpanded?this.$element.parent().removeClass("rightPanelOpen"):this.$element.parent().addClass("rightPanelOpen"),t.prototype.toggle.call(this,e)},e.prototype.expandFull=function(){t.prototype.expandFull.call(this)},e}(a.k),c=n(41),h=n(1539),u=n(4995),p=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),d=n(4692),f=function(t){function e(e){return t.call(this,e)||this}return p(e,t),e.prototype.create=function(){var e=this;this.setConfig("moreInfoRightPanel"),t.prototype.create.call(this),this.extensionHost.subscribe(o.b.CANVAS_INDEX_CHANGE,(function(){e.databind()})),this.extensionHost.subscribe(o.b.RANGE_CHANGE,(function(){e.databind()})),this.setTitle(this.config.content.title),this.$metadata=d('<article class="iiif-metadata-component"></article>'),this.$main.append(this.$metadata),this.metadataComponent=new u.MetadataComponent({target:this.$metadata[0],data:this._getData()}),this.metadataComponent.on("iiifViewerLinkClicked",(function(t){var n=s.f.getHashParameterFromString("rid",t),i=s.f.getHashParameterFromString("t",t);if(n&&null===i&&(a=e.extension.helper.getRangeById(n))&&e.extensionHost.publish(o.b.RANGE_CHANGE,a),null!==i){var a,r=Number(i);Number.isNaN(r)||(n?(a=e.extension.helper.getRangeById(n))&&e.extensionHost.publish(o.b.RANGE_TIME_CHANGE,{rangeId:a.id,time:r}):e.extensionHost.publish(o.b.CURRENT_TIME_CHANGE,r))}}),!1)},e.prototype.toggleFinish=function(){t.prototype.toggleFinish.call(this),this.databind()},e.prototype.databind=function(){this.metadataComponent.set(this._getData())},e.prototype._getCurrentRange=function(){return this.extension.helper.getCurrentRange()},e.prototype._getData=function(){var t=this.extension.getCurrentCanvases();return{canvasDisplayOrder:this.config.options.canvasDisplayOrder,canvases:t,canvasExclude:this.config.options.canvasExclude,canvasLabels:this.extension.getCanvasLabels(this.content.page),content:this.config.content,copiedMessageDuration:2e3,copyToClipboardEnabled:s.YA.getBool(this.config.options.copyToClipboardEnabled,!1),helper:this.extension.helper,licenseFormatter:new h.k9(this.content.license?this.content.license:{}),limit:this.config.options.textLimit||4,limitType:u.LimitType.LINES,limitToRange:s.YA.getBool(this.config.options.limitToRange,!1),manifestDisplayOrder:this.config.options.manifestDisplayOrder,manifestExclude:this.config.options.manifestExclude,range:this._getCurrentRange(),rtlLanguageCodes:this.config.options.rtlLanguageCodes,sanitizer:function(t){return(0,c.aj)(t)},showAllLanguages:this.config.options.showAllLanguages}},e.prototype.resize=function(){t.prototype.resize.call(this),this.$main.height(this.$element.height()-this.$top.height()-this.$main.verticalMargins()),this.$main.attr("tabindex",0),this.$main.attr("aria-label",this.config.content.title),this.$metadata.height()<=this.$main.height()&&(this.$main.removeAttr("tabindex"),this.$main.removeAttr("aria-label"))},e}(l)},8719:(t,e,n)=>{n.d(e,{k:()=>l});var i,o=n(4342),s=n(4598),a=(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),r=n(4692),l=function(t){function e(e,n,i){void 0===n&&(n=!1),void 0===i&&(i=!0);var o=t.call(this,e,n,i)||this;return o.isExpanded=!1,o.isFullyExpanded=!1,o.isUnopened=!0,o.autoToggled=!1,o.expandFullEnabled=!0,o}return a(e,t),e.prototype.create=function(){var e=this;t.prototype.create.call(this),this.$top=r('<div class="top"></div>'),this.$element.append(this.$top),this.$title=r('<h2 class="title"></h2>'),this.$top.append(this.$title),this.$expandFullButton=r('<a class="expandFullButton" tabindex="0"></a>'),this.$top.append(this.$expandFullButton),o.YA.getBool(this.config.options.expandFullEnabled,!0)||this.$expandFullButton.hide(),this.$collapseButton=r('<button role="button" class="collapseButton" tabindex="0"></button>'),this.$top.append(this.$collapseButton),this.$closed=r('<div class="closed"></div>'),this.$element.append(this.$closed),this.$expandButton=r('<button role="button" class="expandButton" tabindex="0"></button>'),this.$expandButton.prop("title",this.content.expand),this.$closed.append(this.$expandButton),this.$closedTitle=r('<a class="title"></a>'),this.$closed.append(this.$closedTitle),this.$main=r('<div class="main"></div>'),this.$element.append(this.$main),this.onAccessibleClick(this.$expandButton,(function(){e.toggle()})),this.$expandFullButton.on("click",(function(){e.expandFull()})),this.$closedTitle.on("click",(function(){e.toggle()})),this.$title.on("click",(function(){e.isFullyExpanded?e.collapseFull():e.toggle()})),this.onAccessibleClick(this.$collapseButton,(function(){e.isFullyExpanded?e.collapseFull():e.toggle()}))},e.prototype.init=function(){t.prototype.init.call(this)},e.prototype.setTitle=function(t){this.$title.text(t),this.$closedTitle.text(t)},e.prototype.toggle=function(t){var e,n,i=this,o=this.extension.getSettings(),s=o.reducedAnimation,a=document.documentElement.style.getPropertyValue("--uv-animation-duration");this.options.panelAnimationDuration&&document.documentElement.style.setProperty("--uv-animation-duration","".concat(this.options.panelAnimationDuration,"ms")),this.autoToggled=!!t,this.$element.toggleClass("open"),this.isExpanded&&(this.$top.attr("aria-hidden","true"),this.$main.attr("aria-hidden","true"),this.$closed.attr("aria-hidden","false"));var r=0;s||(r=(null!==(n=null!==(e=this.options.panelAnimationDuration)&&void 0!==e?e:o.animationDuration)&&void 0!==n?n:250)+50),setTimeout((function(){i.toggled(),a&&document.documentElement.style.setProperty("--uv-animation-duration","".concat(a))}),r)},e.prototype.toggled=function(){this.toggleStart(),this.isExpanded=!this.isExpanded,this.isExpanded&&(this.$top.attr("aria-hidden","false"),this.$main.attr("aria-hidden","false"),this.$closed.attr("aria-hidden","true")),this.toggleFinish(),this.isUnopened=!1},e.prototype.expandFull=function(){var t,e,n=this,i=this.extension.getSettings(),o=i.reducedAnimation,s=document.documentElement.style.getPropertyValue("--uv-animation-duration");this.options.panelAnimationDuration&&document.documentElement.style.setProperty("--uv-animation-duration","".concat(2*this.options.panelAnimationDuration,"ms")),this.expandFullStart();var a=0;o||(a=(null!==(e=null!==(t=this.options.panelAnimationDuration)&&void 0!==t?t:i.animationDuration)&&void 0!==e?e:250)+50,a*=2),setTimeout((function(){n.isExpanded||n.toggled(),n.expandFullFinish(),s&&document.documentElement.style.setProperty("--uv-animation-duration","".concat(s))}),a)},e.prototype.collapseFull=function(){var t,e,n=this,i=this.extension.getSettings(),o=i.reducedAnimation,s=document.documentElement.style.getPropertyValue("--uv-animation-duration");this.options.panelAnimationDuration&&document.documentElement.style.setProperty("--uv-animation-duration","".concat(2*this.options.panelAnimationDuration,"ms")),this.collapseFullStart();var a=0;o||(a=(null!==(e=null!==(t=this.options.panelAnimationDuration)&&void 0!==t?t:i.animationDuration)&&void 0!==e?e:250)+50,a*=2),setTimeout((function(){n.collapseFullFinish(),s&&document.documentElement.style.setProperty("--uv-animation-duration","".concat(s))}),a)},e.prototype.getTargetWidth=function(){return 0},e.prototype.getTargetLeft=function(){return 0},e.prototype.getFullTargetWidth=function(){return 0},e.prototype.getFullTargetLeft=function(){return 0},e.prototype.toggleStart=function(){},e.prototype.toggleFinish=function(){this.isExpanded&&!this.autoToggled?this.focusCollapseButton():this.focusExpandButton()},e.prototype.expandFullStart=function(){},e.prototype.expandFullFinish=function(){this.isFullyExpanded=!0,this.$expandFullButton.hide()},e.prototype.collapseFullStart=function(){},e.prototype.collapseFullFinish=function(){this.isFullyExpanded=!1,this.expandFullEnabled&&this.$expandFullButton.show(),this.focusExpandFullButton()},e.prototype.focusExpandButton=function(){var t=this;setTimeout((function(){t.$expandButton.focus()}),1)},e.prototype.focusExpandFullButton=function(){var t=this;setTimeout((function(){t.$expandFullButton.focus()}),1)},e.prototype.focusCollapseButton=function(){var t=this;setTimeout((function(){t.$collapseButton.focus()}),1)},e.prototype.resize=function(){t.prototype.resize.call(this),this.$main.height(this.$element.height()-this.$top.outerHeight(!0))},e}(s.P)},8566:(t,e,n)=>{n.d(e,{H:()=>z});var i,o=n(4194),s=function(t,e){this.informationType=t,this.param=e},a=n(3115),r=function(){function t(){}return t.FORBIDDEN="forbiddenResourceMessage",t}(),l=n(6346),c=n(4342),h=n(2325),u=n(1123),p=n(4692),d=function(){function t(){}return t.loadExternalResources=function(e,n){return new Promise((function(i){l.Utils.loadExternalResourcesAuth09(e,n,t.clickThrough,t.restricted,t.login,t.getAccessToken,t.storeAccessToken,t.getStoredAccessToken,t.handleExternalResourceResponse).then((function(t){i(t)})).catch((function(e){switch(e.name){case l.StatusCode.AUTHORIZATION_FAILED.toString():t.publish(o.b.LOGIN_FAILED);break;case l.StatusCode.FORBIDDEN.toString():t.publish(o.b.FORBIDDEN);break;case l.StatusCode.RESTRICTED.toString():break;default:t.publish(o.b.SHOW_MESSAGE,[e.message||e])}}))}))},t.clickThrough=function(e){return new Promise((function(n){t.publish(o.b.SHOW_CLICKTHROUGH_DIALOGUE,[{resource:e,acceptCallback:function(){if(e.clickThroughService)var i=window.open(e.clickThroughService.id),s=window.setInterval((function(){i&&i.closed&&(window.clearInterval(s),t.publish(o.b.CLICKTHROUGH),n())}),500)}}])}))},t.restricted=function(e){return new Promise((function(n,i){t.publish(o.b.SHOW_RESTRICTED_DIALOGUE,[{resource:e,acceptCallback:function(){t.publish(u.s.LOAD_FAILED),i(e)}}])}))},t.login=function(e){return new Promise((function(n){var i={};e.status===h.FORBIDDEN&&(i.warningMessage=r.FORBIDDEN,i.showCancelButton=!0),console.log("login"),t.publish(o.b.SHOW_LOGIN_DIALOGUE,[{resource:e,loginCallback:function(){if(e.loginService)var i=window.open(e.loginService.id+"?t="+(new Date).getTime()),s=window.setInterval((function(){i&&i.closed&&(window.clearInterval(s),t.publish(o.b.LOGIN),n())}),500)},logoutCallback:function(){if(e.logoutService)var i=window.open(e.logoutService.id+"?t="+(new Date).getTime()),s=window.setInterval((function(){i&&i.closed&&(window.clearInterval(s),t.publish(o.b.LOGOUT),n())}),500)},options:i}])}))},t.getAccessToken=function(t,e){return new Promise((function(n,i){if(t.tokenService){var o=t.tokenService.id,s=o+"|"+(new Date).getTime(),a=function(t){window.removeEventListener("message",a);var o=t.data;o.error?i(e?o.errorDescription:void 0):n(o)};window.addEventListener("message",a,!1);var r=o+"?messageId="+s;p("#commsFrame").prop("src",r)}else i("Token service not found")}))},t.storeAccessToken=function(t,e,n){return new Promise((function(i,o){t.tokenService?(c.wc.set(t.tokenService.id,e,e.expiresIn,n),i()):o("Token service not found")}))},t.getStoredAccessToken=function(t,e){return new Promise((function(n,i){var o=[],s=null;if(t.tokenService&&(s=c.wc.get(t.tokenService.id,e)),s)o.push(s);else for(var a=c.f.getUrlParts(t.dataUri).hostname,r=c.wc.getItems(e),l=0;l<r.length;l++)(s=r[l]).key.includes(a)&&o.push(s);(o=o.sort((function(t,e){return t.expiresAt-e.expiresAt}))).length&&n(o[o.length-1].value)}))},t.handleExternalResourceResponse=function(e){return new Promise((function(n,i){if(e.isResponseHandled=!0,e.status===h.OK)n(e);else if(e.status===h.MOVED_TEMPORARILY)n(e),t.publish(o.b.RESOURCE_DEGRADED,[e]);else if(e.error.status===h.UNAUTHORIZED||e.error.status===h.INTERNAL_SERVER_ERROR)i(e.error.statusText);else if(e.error.status===h.FORBIDDEN){var s=new Error;s.message="Forbidden",s.name=l.StatusCode.FORBIDDEN.toString(),i(s)}else i(e.error.statusText)}))},t.handleDegraded=function(e){var n=new s(a.J.DEGRADED_RESOURCE,e);t.publish(o.b.SHOW_INFORMATION,[n])},t}(),f=n(41),g=n(4692),b=function(){function t(){}return t.loadExternalResources=function(e,n,i){return new Promise((function(s){t.storageStrategy=n,e=e.map((function(t){return t.authAPIVersion=1,t.options=i,t})),l.Utils.loadExternalResourcesAuth1(e,t.openContentProviderInteraction,t.openTokenService,t.getStoredAccessToken,t.userInteractedWithContentProvider,t.getContentProviderInteraction,t.handleMovedTemporarily,t.showOutOfOptionsMessages).then((function(t){s(t)})).catch((function(e){switch(e.name){case l.StatusCode.AUTHORIZATION_FAILED.toString():t.publish(o.b.LOGIN_FAILED);break;case l.StatusCode.FORBIDDEN.toString():t.publish(o.b.FORBIDDEN);break;case l.StatusCode.RESTRICTED.toString():break;default:t.publish(o.b.SHOW_MESSAGE,[e.message||e])}}))}))},t.getCookieServiceUrl=function(e){return e.id+"?origin="+t.getOrigin()},t.openContentProviderInteraction=function(e){var n=t.getCookieServiceUrl(e);return window.open(n)},t.getOrigin=function(t){var e=window.location;return t&&((e=document.createElement("a")).href=t),e.protocol+"//"+e.hostname+(e.port?":"+e.port:"")},t.userInteractedWithContentProvider=function(t){return new Promise((function(e){var n=window.setInterval((function(){t.closed&&(window.clearInterval(n),e(!0))}),500)}))},t.handleMovedTemporarily=function(e){return new Promise((function(n){t.showDegradedMessage(e),e.isResponseHandled=!0,n()}))},t.showDegradedMessage=function(e){if(e.kioskService)t.publish(o.b.OPEN_EXTERNAL_RESOURCE,[[e]]);else{var n=new s(a.J.DEGRADED_RESOURCE,e);t.publish(o.b.SHOW_INFORMATION,[n])}},t.storeAccessToken=function(e,n){return new Promise((function(i,o){e.tokenService?(c.wc.set(e.tokenService.id,n,n.expiresIn||3600,t.storageStrategy),i()):o("Token service not found")}))},t.getStoredAccessToken=function(e){return new Promise((function(n,i){var o=[],s=null;if(e.tokenService&&(s=c.wc.get(e.tokenService.id,t.storageStrategy)),s)o.push(s);else for(var a=c.f.getUrlParts(e.dataUri).hostname,r=c.wc.getItems(t.storageStrategy),l=0;l<r.length;l++)(s=r[l]).key.includes(a)&&o.push(s);var h=null;(o=o.sort((function(t,e){return t.expiresAt-e.expiresAt}))).length&&(h=o[o.length-1].value),n(h)}))},t.getContentProviderInteraction=function(e,n){return new Promise((function(i){e.isResponseHandled&&!e.authHoldingPage?(t.showDegradedMessage(e),i(null)):e.authHoldingPage?(e.authHoldingPage.location.href=t.getCookieServiceUrl(n),i(e.authHoldingPage)):t.publish(o.b.SHOW_AUTH_DIALOGUE,[{service:n,closeCallback:function(){i(null)},confirmCallback:function(){var e=t.openContentProviderInteraction(n);i(e)},cancelCallback:function(){i(null)}}])}))},t.openTokenService=function(e,n){return new Promise((function(i,o){var s=t.getOrigin(n.id),a=(new Date).getTime();t.messages[a]={resolve:i,reject:o,serviceOrigin:s,resource:e},window.addEventListener("message",t.receiveToken,!1);var r=n.id+"?messageId="+a+"&origin="+t.getOrigin();g("#commsFrame").prop("src",r),setTimeout((function(){t.messages[a]&&(t.messages[a].reject("Message unhandled after 5000ms, rejecting"),delete t.messages[a])}),5e3)}))},t.receiveToken=function(e){if(e.data.hasOwnProperty("messageId")){var n=t.messages[e.data.messageId];n&&e.origin==n.serviceOrigin&&t.storeAccessToken(n.resource,e.data).then((function(){n.resolve(e.data),delete t.messages[e.data.messageId]}))}},t.showOutOfOptionsMessages=function(e,n){if(e.status!=h.MOVED_TEMPORARILY){var i="";n.getFailureHeader()&&(i+="<p>"+n.getFailureHeader()+"</p>"),n.getFailureDescription()&&(i+=n.getFailureDescription()),t.publish(o.b.SHOW_MESSAGE,[(0,f.aj)(i)])}},t.messages={},t}(),m=n(9323),v=(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),$=n(4692),y=function(t){function e(e){return t.call(this,e)||this}return v(e,t),e.prototype.create=function(){var e=this;this.setConfig("authDialogue"),t.prototype.create.call(this),this.openCommand=o.b.SHOW_AUTH_DIALOGUE,this.closeCommand=o.b.HIDE_AUTH_DIALOGUE,this.extensionHost.subscribe(this.openCommand,(function(t){var n=Array.isArray(t)?t[0]:t;e.closeCallback=n.closeCallback,e.confirmCallback=n.confirmCallback,e.cancelCallback=n.cancelCallback,e.service=n.service,e.open()})),this.extensionHost.subscribe(this.closeCommand,(function(){e.close()})),this.$title=$('<div role="heading" class="heading"></div>'),this.$content.append(this.$title),this.$content.append(' <div> <p class="message scroll"></p> </div>'),this.$buttons.prepend(this._buttonsToAdd()),this.$message=this.$content.find(".message"),this.$confirmButton=this.$buttons.find(".confirm"),this.$confirmButton.text(this.content.confirm),this.$cancelButton=this.$buttons.find(".close"),this.$cancelButton.text(this.content.cancel),this.$element.hide(),this.$confirmButton.on("click",(function(t){t.preventDefault(),e.confirmCallback&&e.confirmCallback(),e.close()})),this.$cancelButton.on("click",(function(t){t.preventDefault(),e.cancelCallback&&e.cancelCallback(),e.close()}))},e.prototype.open=function(){if(this.service){t.prototype.open.call(this);var e=this.service.getHeader(),n=this.service.getDescription(),i=this.service.getConfirmLabel();e&&this.$title.text((0,f.aj)(e)),n&&(this.$message.html((0,f.aj)(n)),this.$message.targetBlank(),this.$message.find("a").on("click",(function(){var t=$(this).attr("href");this.extensionHost.publish(o.b.EXTERNAL_LINK_CLICKED,t)}))),i&&this.$confirmButton.text((0,f.aj)(i)),this.resize()}else console.error("NO SERVICE")},e.prototype.resize=function(){t.prototype.resize.call(this)},e.prototype._buttonsToAdd=function(){var t='<a class="confirm btn btn-primary" href="#" target="_parent"></a>';return this.options.topCloseButtonEnabled&&(t+='<button class="close btn btn-default"></button>'),t},e}(m.X),E=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),x=n(4692),w=function(t){function e(e){return t.call(this,e)||this}return E(e,t),e.prototype.create=function(){var e=this;this.setConfig("clickThroughDialogue"),t.prototype.create.call(this),this.openCommand=o.b.SHOW_CLICKTHROUGH_DIALOGUE,this.closeCommand=o.b.HIDE_CLICKTHROUGH_DIALOGUE,this.extensionHost.subscribe(this.openCommand,(function(t){e.acceptCallback=t.acceptCallback,e.resource=t.resource,e.open()})),this.extensionHost.subscribe(this.closeCommand,(function(){e.close()})),this.$title=x('<div role="heading" class="heading"></div>'),this.$content.append(this.$title),this.$content.append(' <div> <p class="message scroll"></p> <div class="buttons"> <a class="acceptTerms btn btn-primary" href="#" target="_parent"></a> </div> </div>'),this.$message=this.$content.find(".message"),this.$acceptTermsButton=this.$content.find(".acceptTerms"),this.$acceptTermsButton.text("Accept Terms and Open"),this.$element.hide(),this.$acceptTermsButton.on("click",(function(t){t.preventDefault(),e.close(),e.extensionHost.publish(o.b.ACCEPT_TERMS),e.acceptCallback&&e.acceptCallback()}))},e.prototype.open=function(){t.prototype.open.call(this),this.resource.clickThroughService&&(this.$title.text(this.resource.clickThroughService.getProperty("label")),this.$message.html(this.resource.clickThroughService.getProperty("description")),this.$message.targetBlank()),this.$message.find("a").on("click",(function(){var t=x(this).attr("href");this.extensionHost.publish(o.b.EXTERNAL_LINK_CLICKED,t)})),this.resize()},e.prototype.resize=function(){t.prototype.resize.call(this)},e}(m.X),C=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),O=n(4692),_=function(t){function e(e){return t.call(this,e)||this}return C(e,t),e.prototype.create=function(){var e=this;this.setConfig("loginDialogue"),t.prototype.create.call(this),this.openCommand=o.b.SHOW_LOGIN_DIALOGUE,this.closeCommand=o.b.HIDE_LOGIN_DIALOGUE,this.extensionHost.subscribe(this.openCommand,(function(t){e.loginCallback=t.loginCallback,e.logoutCallback=t.logoutCallback,e.options=t.options,e.resource=t.resource,e.open()})),this.extensionHost.subscribe(this.closeCommand,(function(){e.close()})),this.$title=O('<div role="heading" class="heading"></div>'),this.$content.append(this.$title),this.$content.append(' <div> <p class="message scroll"></p> <div class="buttons"> <a class="logout btn btn-primary" href="#" target="_parent"></a> <a class="login btn btn-primary" href="#" target="_parent"></a> <a class="cancel btn btn-primary" href="#"></a> </div> </div>'),this.$message=this.$content.find(".message"),this.$loginButton=this.$content.find(".login"),this.$loginButton.text(this.content.login),this.$logoutButton=this.$content.find(".logout"),this.$logoutButton.text(this.content.logout),this.$cancelButton=this.$content.find(".cancel"),this.$cancelButton.text(this.content.cancel),this.$element.hide(),this.$loginButton.on("click",(function(t){t.preventDefault(),e.close(),e.loginCallback&&e.loginCallback()})),this.$logoutButton.on("click",(function(t){t.preventDefault(),e.close(),e.logoutCallback&&e.logoutCallback()})),this.$cancelButton.on("click",(function(t){t.preventDefault(),e.close()})),this.updateLogoutButton()},e.prototype.open=function(){t.prototype.open.call(this);var e="";this.resource.loginService&&(this.$title.text(this.resource.loginService.getProperty("label")),e=this.resource.loginService.getProperty("description")),this.options.warningMessage&&(e='<span class="warning">'+this.extension.data.config.content[this.options.warningMessage]+'</span><span class="description">'+e+"</span>"),this.updateLogoutButton(),this.$message.html(e),this.$message.targetBlank(),this.$message.find("a").on("click",(function(){var t=O(this).attr("href");this.extensionHost.publish(o.b.EXTERNAL_LINK_CLICKED,t)})),this.options.showCancelButton?this.$cancelButton.show():this.$cancelButton.hide(),this.resize()},e.prototype.updateLogoutButton=function(){this.extension.isLoggedIn?this.$logoutButton.show():this.$logoutButton.hide()},e.prototype.resize=function(){t.prototype.resize.call(this)},e}(m.X),S=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),A=n(4692),I=function(t){function e(e){return t.call(this,e)||this}return S(e,t),e.prototype.create=function(){var e=this;this.setConfig("restrictedDialogue"),t.prototype.create.call(this),this.openCommand=o.b.SHOW_RESTRICTED_DIALOGUE,this.closeCommand=o.b.HIDE_RESTRICTED_DIALOGUE,this.extensionHost.subscribe(this.openCommand,(function(t){e.acceptCallback=t.acceptCallback,e.options=t.options,e.resource=t.resource,e.open()})),this.extensionHost.subscribe(this.closeCommand,(function(){e.close()})),this.$title=A('<div role="heading" class="heading"></div>'),this.$content.append(this.$title),this.$content.append(' <div> <p class="message scroll"></p> <div class="buttons"> <a class="cancel btn btn-primary" href="#" target="_parent"></a> </div> </div>'),this.$message=this.$content.find(".message"),this.$message.targetBlank(),this.$cancelButton=this.$content.find(".cancel"),this.$cancelButton.text(this.content.cancel),this.$element.hide(),this.$cancelButton.on("click",(function(t){t.preventDefault(),e.close()}))},e.prototype.open=function(){t.prototype.open.call(this),this.isAccepted=!1;var e="";this.resource.restrictedService&&(this.$title.text(this.resource.restrictedService.getProperty("label")),e=this.resource.restrictedService.getProperty("description")),this.$message.html(e),this.$message.targetBlank(),this.$message.find("a").on("click",(function(){var t=A(this).attr("href");this.extensionHost.publish(o.b.EXTERNAL_LINK_CLICKED,t)})),this.resize()},e.prototype.close=function(){t.prototype.close.call(this),!this.isAccepted&&this.acceptCallback&&(this.isAccepted=!0,this.acceptCallback())},e.prototype.resize=function(){t.prototype.resize.call(this)},e}(m.X),T=n(4598),B=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),H=n(4692),P=function(t){function e(e){return t.call(this,e)||this}return B(e,t),e.prototype.create=function(){var e=this;this.setConfig("genericDialogue"),t.prototype.create.call(this),this.openCommand=o.b.SHOW_GENERIC_DIALOGUE,this.closeCommand=o.b.HIDE_GENERIC_DIALOGUE,this.extensionHost.subscribe(this.openCommand,(function(t){e.acceptCallback=t.acceptCallback,e.showMessage(t)})),this.extensionHost.subscribe(this.closeCommand,(function(){e.close()})),this.$message=H("<p></p>"),this.$content.append(this.$message),this.$acceptButton=H('\n <button class="btn btn-primary accept default">\n '.concat(this.content.ok,"\n </button>\n ")),this.$buttons.append(this.$acceptButton),this.$buttons.find(".close").hide(),this.$acceptButton.onPressed((function(){e.accept()})),this.returnFunc=function(){e.isActive&&e.accept()},this.$element.hide()},e.prototype.accept=function(){this.extensionHost.publish(o.b.CLOSE_ACTIVE_DIALOGUE),this.acceptCallback&&this.acceptCallback()},e.prototype.showMessage=function(t){this.$message.html(t.message),t.buttonText?this.$acceptButton.text(t.buttonText):this.$acceptButton.text(this.content.ok),!1===t.allowClose&&this.disableClose(),this.open()},e.prototype.resize=function(){t.prototype.resize.call(this)},e}(m.X),D=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),k=n(4692),R=function(t){function e(e){return t.call(this,e,!0,!0)||this}return D(e,t),e.prototype.create=function(){var e=this;t.prototype.create.call(this),this.extensionHost.subscribe(o.b.SHOW_OVERLAY,(function(){e.$overlays.show()})),this.extensionHost.subscribe(o.b.HIDE_OVERLAY,(function(){e.$overlays.hide()})),this.$element.append('<a class="sr-only" href="#download-btn">'+this.extension.data.config.content.skipToDownload+"</a>"),this.$headerPanel=k('<div class="headerPanel"></div>'),this.$element.append(this.$headerPanel),this.$mainPanel=k('<div class="mainPanel"></div>'),this.$element.append(this.$mainPanel),this.$centerPanel=k('<div class="centerPanel"></div>'),this.$centerPanel.append('<h2 class="sr-only">'+this.extension.data.config.content.mediaViewer+"</h2>"),this.$mainPanel.append(this.$centerPanel),this.$leftPanel=k('<div class="leftPanel"></div>'),this.$mainPanel.append(this.$leftPanel),this.$rightPanel=k('<div class="rightPanel"></div>'),this.$mainPanel.append(this.$rightPanel),this.$footerPanel=k('<div class="footerPanel"></div>'),this.$element.append(this.$footerPanel),this.$mobileFooterPanel=k('<div class="mobileFooterPanel"></div>'),this.$element.append(this.$mobileFooterPanel),this.$overlays=k('<div class="overlays"></div>'),this.$element.append(this.$overlays),this.$overlays.hide(),this.$genericDialogue=k('<div class="overlay genericDialogue" aria-hidden="true"></div>'),this.$overlays.append(this.$genericDialogue),this.$overlays.on("click",(function(t){k(t.target).hasClass("overlays")&&(t.preventDefault(),e.extensionHost.publish(o.b.CLOSE_ACTIVE_DIALOGUE))})),new P(this.$genericDialogue)},e.prototype.resize=function(){var e=this;t.prototype.resize.call(this),setTimeout((function(){e.$overlays.width(e.extension.width()),e.$overlays.height(e.extension.height())}),1);var n=this.$element.height()-parseInt(this.$mainPanel.css("paddingTop"))-((0,f.zN)(this.$headerPanel)?this.$headerPanel.height():0)-((0,f.zN)(this.$footerPanel)?this.$footerPanel.height():0)-((0,f.zN)(this.$mobileFooterPanel)?this.$mobileFooterPanel.height():0);this.$mainPanel.height(n)},e}(T.P),L=n(1539),N=n(3957),F=n(8847),G=function(t,e,n,i){return new(n||(n=Promise))((function(o,s){function a(t){try{l(i.next(t))}catch(t){s(t)}}function r(t){try{l(i.throw(t))}catch(t){s(t)}}function l(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,r)}l((i=i.apply(t,e||[])).next())}))},U=function(t,e){var n,i,o,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=r(0),a.throw=r(1),a.return=r(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function r(r){return function(l){return function(r){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,r[0]&&(s=0)),s;)try{if(n=1,i&&(o=2&r[0]?i.return:r[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,r[1])).done)return o;switch(i=0,o&&(r=[2&r[0],o.value]),r[0]){case 0:case 1:o=r;break;case 4:return s.label++,{value:r[1],done:!1};case 5:s.label++,i=r[1],r=[0];continue;case 7:r=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==r[0]&&2!==r[0])){s=0;continue}if(3===r[0]&&(!o||r[1]>o[0]&&r[1]<o[3])){s.label=r[1];break}if(6===r[0]&&s.label<o[1]){s.label=o[1],o=r;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(r);break}o[2]&&s.ops.pop(),s.trys.pop();continue}r=e.call(t,s)}catch(t){r=[6,t],i=0}finally{n=o=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,l])}}},M=n(4692),z=function(){function t(){this.annotations=[],this.isCreated=!1,this.isLoggedIn=!1,this.metrics=[],this.shifted=!1,this.tabbing=!1,this.locales={},this.defaultConfig={},this.localeLoaders={"en-GB":function(){return n.e(3708).then(n.t.bind(n,3708,19))},"cy-GB":function(){return n.e(4429).then(n.t.bind(n,4429,19))},"fr-FR":function(){return n.e(9044).then(n.t.bind(n,9044,19))},"pl-PL":function(){return n.e(8136).then(n.t.bind(n,8136,19))},"sv-SE":function(){return n.e(1831).then(n.t.bind(n,1831,19))}}}return t.prototype.create=function(){var t=this,e=this;if(this.browserDetect=new W,this.browserDetect.init(),d.publish=this.extensionHost.publish.bind(this.extensionHost),b.publish=this.extensionHost.publish.bind(this.extensionHost),this.$element=M(this.extensionHost.options.target),this.$element.data("component",this.extensionHost),this._parseMetrics(),this._updateMetric(),this._initLocales(),this.$element.empty(),this.$element.removeClass(),this.$element.addClass("uv-iiif-extension-host"),this.$element.addClass("loading"),this.data.locales?(this.$element.addClass(this.data.locales[0].name.toLowerCase()),this.$element.prop("lang",this.data.locales[0].name.substring(0,2))):this.$element.prop("lang",f.q[0].name.substring(0,2)),this.isRightPanelEnabled()&&this.$element.addClass("right-panel-enabled"),this.isLeftPanelEnabled()&&this.$element.addClass("left-panel-enabled"),this.isFooterPanelEnabled()&&this.$element.addClass("footer-panel-enabled"),this.$element.addClass(this.type.name),this.$element.addClass("browser-"+this.browserDetect.browser),this.$element.addClass("browser-version-"+this.browserDetect.version),this.$element.prop("tabindex",-1),this.data.embedded&&this.$element.addClass("embedded"),this.isMobile()&&this.$element.addClass("mobile"),c.jj.supportsFullscreen()&&this.$element.addClass("fullscreen-supported"),this.isFullScreen()&&this.$element.addClass("fullscreen"),this.$element.on("mousemove",(function(e){t.mouseX=e.pageX,t.mouseY=e.pageY})),!this.data.isReload){var n=c.jj.getHiddenProp();if(n){var i=n.replace(/[H|h]idden/,"")+"visibilitychange";document.addEventListener(i,(function(){c.jj.isHidden()||t.resize()}))}c.YA.getBool(this.data.config.options.dropEnabled,!0)&&this.$element.on("drop",(function(e){e.preventDefault();var n=e.originalEvent.dataTransfer.getData("URL"),i=c.f.getUrlParts(n),o=c.f.getQuerystringParameterFromString("manifest",i.search);if(o||(o=c.f.getQuerystringParameterFromString("collection",i.search)),o){t.fire(u.s.DROP,o);var s={};s.iiifManifestId=o,t.reload(s)}})),this.$element.on("dragover",(function(t){t.preventDefault()})),this.$element.on("keyup keydown",(function(e){t.shifted=e.shiftKey,t.tabbing=e.keyCode===F.G.Tab})),this.$element.on("keydown",(function(n){var i=null,s=!0;n.ctrlKey||n.altKey||n.shiftKey||(n.keyCode===F.G.Enter&&(i=o.b.RETURN,s=!1),n.keyCode===F.G.Escape&&(i=o.b.ESCAPE),n.keyCode===F.G.PageUp&&(i=o.b.PAGE_UP),n.keyCode===F.G.PageDown&&(i=o.b.PAGE_DOWN),n.keyCode===F.G.End&&(i=o.b.END),n.keyCode===F.G.Home&&(i=o.b.HOME),n.keyCode!==F.G.NumpadPlus&&171!==n.keyCode&&n.keyCode!==F.G.Equals||(i=o.b.PLUS,s=!1),n.keyCode!==F.G.NumpadMinus&&173!==n.keyCode&&n.keyCode!==F.G.Dash||(i=o.b.MINUS,s=!1),e.useArrowKeysToNavigate()&&(n.keyCode===F.G.LeftArrow&&(i=o.b.LEFT_ARROW),n.keyCode===F.G.UpArrow&&(i=o.b.UP_ARROW),n.keyCode===F.G.RightArrow&&(i=o.b.RIGHT_ARROW),n.keyCode===F.G.DownArrow&&(i=o.b.DOWN_ARROW))),i&&(s&&n.preventDefault(),t.extensionHost.publish(i))}))}this.extensionHost.subscribe(u.s.EXIT_FULLSCREEN,(function(){t.isOverlayActive()&&t.extensionHost.publish(o.b.ESCAPE),t.extensionHost.publish(o.b.ESCAPE),t.extensionHost.publish(u.s.RESIZE)})),this.$element.append('<iframe id="commsFrame"></iframe>'),this.extensionHost.subscribeAll((function(e,n){[u.s.LOAD,u.s.DROP,u.s.TOGGLE_FULLSCREEN,u.s.EXTERNAL_RESOURCE_OPENED,u.s.RELOAD].includes(e)||t.fire(e,n)})),this.extensionHost.subscribe(u.s.EXTERNAL_RESOURCE_OPENED,(function(){t.fire(u.s.EXTERNAL_RESOURCE_OPENED)})),this.extensionHost.subscribe(o.b.LOGIN_FAILED,(function(){t.showMessage(t.data.config.content.authorisationFailedMessage)})),this.extensionHost.subscribe(o.b.LOGIN,(function(){t.isLoggedIn=!0})),this.extensionHost.subscribe(o.b.LOGOUT,(function(){t.isLoggedIn=!1})),this.extensionHost.subscribe(o.b.BOOKMARK,(function(){t.bookmark()})),this.extensionHost.subscribe(o.b.CANVAS_INDEX_CHANGE,(function(e){t.data.canvasIndex=e,t.lastCanvasIndex=t.helper.canvasIndex,t.helper.canvasIndex=e})),this.extensionHost.subscribe(o.b.CLOSE_LEFT_PANEL,(function(){e.$element.hasClass("loading")&&e.$element.removeClass("loading"),t.resize()})),this