@tindtechnologies/universalviewer
Version:
The Universal Viewer is a community-developed open source project on a mission to help you share your 📚📜📰📽️📻🗿 with the 🌎
1 lines • 92.1 kB
JavaScript
"use strict";(self.webpackChunkUV=self.webpackChunkUV||[]).push([[429],{9594:(t,e,i)=>{i.d(e,{M:()=>l});var n,o=i(4194),s=i(9323),a=(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},n(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 i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}),r=window.$,l=function(t){function e(e){return t.call(this,e)||this}return a(e,t),e.prototype.create=function(){var e,i=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,i.open()})),this.extensionHost.subscribe(this.closeCommand,(function(){e&&e.focus(),i.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.0.26-alpha.2")},e.prototype._createLocalesMenu=function(){var t=this,e=this.extension.data.locales;if(e&&e.length>1){for(var i=0;i<e.length;i++){var n=e[i];this.$localeDropDown.append('<option value="'+n.name+'">'+n.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),this.$reducedAnimationCheckbox.change((function(){var e={};t.$reducedAnimationCheckbox.is(":checked")?e.reducedAnimation=!0:e.reducedAnimation=!1,t.updateSettings(e)}))},e}(s.X)},4792:(t,e,i)=>{i.d(e,{C:()=>h});var n,o=i(4194),s=i(9323),a=i(4342),r=(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},n(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 i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}),l=window.$,h=function(t){function e(e){var i=t.call(this,e)||this;return i.aspectRatio=.75,i.isEmbedViewVisible=!1,i.isShareViewVisible=!1,i.maxWidth=8e3,i.maxHeight=i.maxWidth*i.aspectRatio,i.minWidth=200,i.minHeight=i.minWidth*i.aspectRatio,i.shareManifestsEnabled=!1,i}return r(e,t),e.prototype.create=function(){var e,i=this;this.setConfig("shareDialogue"),t.prototype.create.call(this),this.openCommand=o.b.SHOW_SHARE_DIALOGUE,this.closeCommand=o.b.HIDE_SHARE_DIALOGUE,this.shareManifestsEnabled=this.options.shareManifestsEnabled||!1,this.extensionHost.subscribe(this.openCommand,(function(t){e=t,i.open(t),i.isShareAvailable()?i.openShareView():i.openEmbedView()})),this.extensionHost.subscribe(this.closeCommand,(function(){e&&e.focus(),i.close()})),this.extensionHost.subscribe(o.b.SHOW_EMBED_DIALOGUE,(function(t){i.open(t),i.openEmbedView()})),this.$tabs=l('<div class="tabs"></div>'),this.$content.append(this.$tabs),this.$shareButton=l('<a class="share tab default" tabindex="0">'+this.content.share+"</a>"),a.YA.getBool(this.config.options.shareEnabled,!0)&&this.$tabs.append(this.$shareButton),this.$embedButton=l('<a class="embed tab" tabindex="0">'+this.content.embed+"</a>"),a.YA.getBool(this.config.options.embedEnabled,!1)&&this.$tabs.append(this.$embedButton),this.$tabsContent=l('<div class="tabsContent"></div>'),this.$content.append(this.$tabsContent),this.$footer=l('<div class="footer"></div>'),this.$content.append(this.$footer),this.$shareView=l('<div class="shareView view"></div>'),this.$tabsContent.append(this.$shareView),this.$shareHeader=l('<div class="header"></div>'),this.$shareView.append(this.$shareHeader),this.$shareLink=l('<a class="shareLink" onclick="return false;"></a>'),this.$shareView.append(this.$shareLink),this.$shareInput=l('<input class="shareInput" type="text" readonly="readonly" aria-label="'.concat(this.content.shareUrl,'"/>')),this.$shareView.append(this.$shareInput),this.$shareFrame=l('<iframe class="shareFrame"></iframe>'),this.$shareView.append(this.$shareFrame),this.$embedView=l('<div class="embedView view"></div>'),this.$tabsContent.append(this.$embedView),this.$embedHeader=l('<div class="header"></div>'),this.$embedView.append(this.$embedHeader),this.$code=l('<input class="code" type="text" readonly="readonly" aria-label="'.concat(this.content.embed,'"/>')),this.$embedView.append(this.$code),this.$customSize=l('<div class="customSize"></div>'),this.$embedView.append(this.$customSize),this.$size=l('<span class="size">'+this.content.size+"</span>"),this.$customSize.append(this.$size),this.$customSizeDropDown=l('<select id="size" aria-label="'+this.content.size+'"></select>'),this.$customSize.append(this.$customSizeDropDown),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">'+this.content.customSize+"</option>"),this.$widthInput=l('<input class="width" type="text" maxlength="10" aria-label="'+this.content.width+'"/>'),this.$customSize.append(this.$widthInput),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="'+this.content.height+'"/>'),this.$customSize.append(this.$heightInput);var n=this.extension.getIIIFShareUrl(this.shareManifestsEnabled);this.shareManifestsEnabled&&(this.$iiifButton=l('<a class="imageBtn iiif" href="'+n+'" title="'+this.content.iiif+'" target="_blank"></a>'),this.$footer.append(this.$iiifButton)),this.$termsOfUseButton=l('<a href="#">'+this.extension.data.config.content.termsOfUse+"</a>"),this.$footer.append(this.$termsOfUseButton),this.$widthInput.on("keydown",(function(t){return a.FQ.numericalInput(t)})),this.$heightInput.on("keydown",(function(t){return a.FQ.numericalInput(t)})),this.$shareInput.focus((function(){l(this).select()})),this.$code.focus((function(){l(this).select()})),this.onAccessibleClick(this.$shareButton,(function(){i.openShareView()})),this.onAccessibleClick(this.$embedButton,(function(){i.openEmbedView()})),this.$customSizeDropDown.change((function(){i.update()})),this.$widthInput.change((function(){i.updateHeightRatio(),i.update()})),this.$heightInput.change((function(){i.updateWidthRatio(),i.update()})),this.onAccessibleClick(this.$termsOfUseButton,(function(){i.extensionHost.publish(o.b.SHOW_TERMS_OF_USE)})),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.update=function(){this.isShareAvailable()?this.$shareButton.show():this.$shareButton.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.updateInstructions(),this.updateShareOptions(),this.updateShareFrame(),this.updateTermsOfUseButton()},e.prototype.updateShareOptions=function(){var t=this.getShareUrl();t&&(this.$shareInput.val(t),this.$shareLink.prop("href",t),this.$shareLink.text(t)),this.extension.isMobile()?(this.$shareInput.hide(),this.$shareLink.show()):(this.$shareInput.show(),this.$shareLink.hide())},e.prototype.updateInstructions=function(){a.YA.getBool(this.options.instructionsEnabled,!1)?(this.$shareHeader.show(),this.$embedHeader.show(),this.$shareHeader.text(this.content.shareInstructions),this.$embedHeader.text(this.content.embedInstructions)):(this.$shareHeader.hide(),this.$embedHeader.hide())},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.updateShareFrame=function(){var t=this.extension.helper.getShareServiceUrl();t&&(a.YA.getBool(this.config.options.shareFrameEnabled,!0)&&t?(this.$shareFrame.prop("src",t),this.$shareFrame.show()):this.$shareFrame.hide())},e.prototype.updateTermsOfUseButton=function(){var t=this.extension.helper.getRequiredStatement();a.YA.getBool(this.extension.data.config.options.termsOfUseEnabled,!1)&&t&&t.value?this.$termsOfUseButton.show():this.$termsOfUseButton.hide()},e.prototype.openShareView=function(){this.isShareViewVisible=!0,this.isEmbedViewVisible=!1,this.$embedView.hide(),this.$shareView.show(),this.$shareButton.addClass("on default"),this.$embedButton.removeClass("on default"),this.resize()},e.prototype.openEmbedView=function(){this.isShareViewVisible=!1,this.isEmbedViewVisible=!0,this.$embedView.show(),this.$shareView.hide(),this.$shareButton.removeClass("on default"),this.$embedButton.addClass("on default"),this.resize()},e.prototype.close=function(){t.prototype.close.call(this)},e.prototype.getViews=function(){return this.$tabsContent.find(".view")},e.prototype.equaliseViewHeights=function(){this.getViews().equaliseHeight(!0)},e.prototype.resize=function(){this.equaliseViewHeights(),this.setDockedPosition()},e}(s.X)},6192:(t,e,i)=>{i.d(e,{Q:()=>f});var n,o=i(4194),s=i(8719),a=i(4342),r=(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},n(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 i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}),l=function(t){function e(e){return t.call(this,e)||this}return r(e,t),e.prototype.create=function(){t.prototype.create.call(this),this.$element.width(this.options.panelCollapsedWidth)},e.prototype.init=function(){var e=this;t.prototype.init.call(this),a.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()}))},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(){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})},e.prototype.resize=function(){t.prototype.resize.call(this),this.$element.css({left:Math.floor(this.$element.parent().width()-this.$element.outerWidth())})},e}(s.k),h=i(41),c=i(1539),u=i(4995),p=function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),d=window.$,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('<div class="iiif-metadata-component"></div>'),this.$main.append(this.$metadata),this.metadataComponent=new u.MetadataComponent({target:this.$metadata[0],data:this._getData()}),this.metadataComponent.on("iiifViewerLinkClicked",(function(t){var i=a.f.getHashParameterFromString("rid",t),n=a.f.getHashParameterFromString("t",t);if(i&&null===n&&(s=e.extension.helper.getRangeById(i))&&e.extensionHost.publish(o.b.RANGE_CHANGE,s),null!==n){var s,r=Number(n);Number.isNaN(r)||(i?(s=e.extension.helper.getRangeById(i))&&e.extensionHost.publish(o.b.RANGE_TIME_CHANGE,{rangeId:s.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:a.YA.getBool(this.config.options.copyToClipboardEnabled,!1),helper:this.extension.helper,licenseFormatter:new c.k9(this.content.license?this.content.license:{}),limit:this.config.options.textLimit||4,limitType:u.LimitType.LINES,limitToRange:a.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,h.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())},e}(l)},8719:(t,e,i)=>{i.d(e,{k:()=>h});var n,o=i(4598),s=i(4342),a=i(4194),r=(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},n(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 i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}),l=window.$,h=function(t){function e(e){var i=t.call(this,e,!1,!0)||this;return i.isExpanded=!1,i.isFullyExpanded=!1,i.isUnopened=!0,i.autoToggled=!1,i.expandFullEnabled=!0,i.reducedAnimation=!1,i}return r(e,t),e.prototype.create=function(){var e=this;t.prototype.create.call(this),this.$top=l('<div class="top"></div>'),this.$element.append(this.$top),this.$title=l('<h2 class="title"></h2>'),this.$top.append(this.$title),this.$expandFullButton=l('<a class="expandFullButton" tabindex="0"></a>'),this.$top.append(this.$expandFullButton),s.YA.getBool(this.config.options.expandFullEnabled,!0)||this.$expandFullButton.hide(),this.$collapseButton=l('<div role="button" class="collapseButton" tabindex="0"></div>'),this.$collapseButton.prop("title",this.content.collapse),this.$top.append(this.$collapseButton),this.$closed=l('<div class="closed"></div>'),this.$element.append(this.$closed),this.$expandButton=l('<a role="button" class="expandButton" tabindex="0"></a>'),this.$expandButton.prop("title",this.content.expand),this.$closed.append(this.$expandButton),this.$closedTitle=l('<a class="title"></a>'),this.$closed.append(this.$closedTitle),this.$main=l('<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()})),this.$top.hide(),this.$main.hide(),this.extensionHost.subscribe(a.b.SETTINGS_CHANGE,(function(t){e.reducedAnimation=t.reducedAnimation||!1}))},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=this;this.autoToggled=!!t,this.isExpanded&&(this.$top.attr("aria-hidden","true"),this.$main.attr("aria-hidden","true"),this.$closed.attr("aria-hidden","false"),this.$top.hide(),this.$main.hide(),this.$closed.show()),this.reducedAnimation?(this.$element.css("width",this.getTargetWidth()),this.$element.css("left",this.getTargetLeft()),this.toggled()):this.$element.stop().animate({width:this.getTargetWidth(),left:this.getTargetLeft()},this.options.panelAnimationDuration,(function(){e.toggled()}))},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.$closed.hide(),this.$top.show(),this.$main.show()),this.toggleFinish(),this.isUnopened=!1},e.prototype.expandFull=function(){var t=this;this.isExpanded||this.toggled();var e=this.getFullTargetWidth(),i=this.getFullTargetLeft();this.expandFullStart(),this.$element.stop().animate({width:e,left:i},this.options.panelAnimationDuration,(function(){t.expandFullFinish()}))},e.prototype.collapseFull=function(){var t=this,e=this.getTargetWidth(),i=this.getTargetLeft();this.collapseFullStart(),this.$element.stop().animate({width:e,left:i},this.options.panelAnimationDuration,(function(){t.collapseFullFinish()}))},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(),this.focusCollapseButton()},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.parent().height()-this.$top.outerHeight(!0))},e}(o.P)},8566:(t,e,i)=>{i.d(e,{H:()=>z});var n,o=i(4194),s=function(t,e){this.informationType=t,this.param=e},a=i(3115),r=function(){function t(){}return t.FORBIDDEN="forbiddenResourceMessage",t}(),l=i(6346),h=i(4342),c=i(2325),u=i(1123),p=window.$,d=function(){function t(){}return t.loadExternalResources=function(e,i){return new Promise((function(n){l.Utils.loadExternalResourcesAuth09(e,i,t.clickThrough,t.restricted,t.login,t.getAccessToken,t.storeAccessToken,t.getStoredAccessToken,t.handleExternalResourceResponse).then((function(t){n(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(i){t.publish(o.b.SHOW_CLICKTHROUGH_DIALOGUE,[{resource:e,acceptCallback:function(){if(e.clickThroughService)var n=window.open(e.clickThroughService.id),s=window.setInterval((function(){n&&n.closed&&(window.clearInterval(s),t.publish(o.b.CLICKTHROUGH),i())}),500)}}])}))},t.restricted=function(e){return new Promise((function(i,n){t.publish(o.b.SHOW_RESTRICTED_DIALOGUE,[{resource:e,acceptCallback:function(){t.publish(u.s.LOAD_FAILED),n(e)}}])}))},t.login=function(e){return new Promise((function(i){var n={};e.status===c.FORBIDDEN&&(n.warningMessage=r.FORBIDDEN,n.showCancelButton=!0),console.log("login"),t.publish(o.b.SHOW_LOGIN_DIALOGUE,[{resource:e,loginCallback:function(){if(e.loginService)var n=window.open(e.loginService.id+"?t="+(new Date).getTime()),s=window.setInterval((function(){n&&n.closed&&(window.clearInterval(s),t.publish(o.b.LOGIN),i())}),500)},logoutCallback:function(){if(e.logoutService)var n=window.open(e.logoutService.id+"?t="+(new Date).getTime()),s=window.setInterval((function(){n&&n.closed&&(window.clearInterval(s),t.publish(o.b.LOGOUT),i())}),500)},options:n}])}))},t.getAccessToken=function(t,e){return new Promise((function(i,n){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?n(e?o.errorDescription:void 0):i(o)};window.addEventListener("message",a,!1);var r=o+"?messageId="+s;p("#commsFrame").prop("src",r)}else n("Token service not found")}))},t.storeAccessToken=function(t,e,i){return new Promise((function(n,o){t.tokenService?(h.wc.set(t.tokenService.id,e,e.expiresIn,i),n()):o("Token service not found")}))},t.getStoredAccessToken=function(t,e){return new Promise((function(i,n){var o=[],s=null;if(t.tokenService&&(s=h.wc.get(t.tokenService.id,e)),s)o.push(s);else for(var a=h.f.getUrlParts(t.dataUri).hostname,r=h.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&&i(o[o.length-1].value)}))},t.handleExternalResourceResponse=function(e){return new Promise((function(i,n){if(e.isResponseHandled=!0,e.status===c.OK)i(e);else if(e.status===c.MOVED_TEMPORARILY)i(e),t.publish(o.b.RESOURCE_DEGRADED,[e]);else if(e.error.status===c.UNAUTHORIZED||e.error.status===c.INTERNAL_SERVER_ERROR)n(e.error.statusText);else if(e.error.status===c.FORBIDDEN){var s=new Error;s.message="Forbidden",s.name=l.StatusCode.FORBIDDEN.toString(),n(s)}else n(e.error.statusText)}))},t.handleDegraded=function(e){var i=new s(a.J.DEGRADED_RESOURCE,e);t.publish(o.b.SHOW_INFORMATION,[i])},t}(),f=i(41),g=window.$,b=function(){function t(){}return t.loadExternalResources=function(e,i,n){return new Promise((function(s){t.storageStrategy=i,e=e.map((function(t){return t.authAPIVersion=1,t.options=n,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 i=t.getCookieServiceUrl(e);return window.open(i)},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 i=window.setInterval((function(){t.closed&&(window.clearInterval(i),e(!0))}),500)}))},t.handleMovedTemporarily=function(e){return new Promise((function(i){t.showDegradedMessage(e),e.isResponseHandled=!0,i()}))},t.showDegradedMessage=function(e){if(e.kioskService)t.publish(o.b.OPEN_EXTERNAL_RESOURCE,[[e]]);else{var i=new s(a.J.DEGRADED_RESOURCE,e);t.publish(o.b.SHOW_INFORMATION,[i])}},t.storeAccessToken=function(e,i){return new Promise((function(n,o){e.tokenService?(h.wc.set(e.tokenService.id,i,i.expiresIn||3600,t.storageStrategy),n()):o("Token service not found")}))},t.getStoredAccessToken=function(e){return new Promise((function(i,n){var o=[],s=null;if(e.tokenService&&(s=h.wc.get(e.tokenService.id,t.storageStrategy)),s)o.push(s);else for(var a=h.f.getUrlParts(e.dataUri).hostname,r=h.wc.getItems(t.storageStrategy),l=0;l<r.length;l++)(s=r[l]).key.includes(a)&&o.push(s);var c=null;(o=o.sort((function(t,e){return t.expiresAt-e.expiresAt}))).length&&(c=o[o.length-1].value),i(c)}))},t.getContentProviderInteraction=function(e,i){return new Promise((function(n){e.isResponseHandled&&!e.authHoldingPage?(t.showDegradedMessage(e),n(null)):e.authHoldingPage?(e.authHoldingPage.location.href=t.getCookieServiceUrl(i),n(e.authHoldingPage)):t.publish(o.b.SHOW_AUTH_DIALOGUE,[{service:i,closeCallback:function(){n(null)},confirmCallback:function(){var e=t.openContentProviderInteraction(i);n(e)},cancelCallback:function(){n(null)}}])}))},t.openTokenService=function(e,i){return new Promise((function(n,o){var s=t.getOrigin(i.id),a=(new Date).getTime();t.messages[a]={resolve:n,reject:o,serviceOrigin:s,resource:e},window.addEventListener("message",t.receiveToken,!1);var r=i.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 i=t.messages[e.data.messageId];i&&e.origin==i.serviceOrigin&&t.storeAccessToken(i.resource,e.data).then((function(){i.resolve(e.data),delete t.messages[e.data.messageId]}))}},t.showOutOfOptionsMessages=function(e,i){if(e.status!=c.MOVED_TEMPORARILY){var n="";i.getFailureHeader()&&(n+="<p>"+i.getFailureHeader()+"</p>"),i.getFailureDescription()&&(n+=i.getFailureDescription()),t.publish(o.b.SHOW_MESSAGE,[(0,f.aj)(n)])}},t.messages={},t}(),m=i(9323),$=(n=function(t,e){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},n(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 i(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}),v=window.$,y=function(t){function e(e){return t.call(this,e)||this}return $(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 i=Array.isArray(t)?t[0]:t;e.closeCallback=i.closeCallback,e.confirmCallback=i.confirmCallback,e.cancelCallback=i.cancelCallback,e.service=i.service,e.open()})),this.extensionHost.subscribe(this.closeCommand,(function(){e.close()})),this.$title=v('<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(),i=this.service.getDescription(),n=this.service.getConfirmLabel();e&&this.$title.text((0,f.aj)(e)),i&&(this.$message.html((0,f.aj)(i)),this.$message.targetBlank(),this.$message.find("a").on("click",(function(){var t=v(this).attr("href");this.extensionHost.publish(o.b.EXTERNAL_LINK_CLICKED,t)}))),n&&this.$confirmButton.text((0,f.aj)(n)),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,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),w=window.$,x=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=w('<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=w(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,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),_=window.$,O=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=_('<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=_(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,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),A=window.$,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=i(4598),B=function(){var t=function(e,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),H=window.$,k=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,i){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])},t(e,i)};return function(e,i){if("function"!=typeof i&&null!==i)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),R=window.$,L=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=R('<div class="headerPanel"></div>'),this.$element.append(this.$headerPanel),this.$mainPanel=R('<div class="mainPanel"></div>'),this.$element.append(this.$mainPanel),this.$centerPanel=R('<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=R('<div class="leftPanel"></div>'),this.$mainPanel.append(this.$leftPanel),this.$rightPanel=R('<div class="rightPanel"></div>'),this.$mainPanel.append(this.$rightPanel),this.$footerPanel=R('<div class="footerPanel"></div>'),this.$element.append(this.$footerPanel),this.$mobileFooterPanel=R('<div class="mobileFooterPanel"></div>'),this.$element.append(this.$mobileFooterPanel),this.$overlays=R('<div class="overlays"></div>'),this.$element.append(this.$overlays),this.$overlays.hide(),this.$genericDialogue=R('<div class="overlay genericDialogue" aria-hidden="true"></div>'),this.$overlays.append(this.$genericDialogue),this.$overlays.on("click",(function(t){R(t.target).hasClass("overlays")&&(t.preventDefault(),e.extensionHost.publish(o.b.CLOSE_ACTIVE_DIALOGUE))})),new k(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 i=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(i)},e}(T.P),P=i(1539),N=i(3957),F=i(8847),G=function(t,e,i,n){return new(i||(i=Promise))((function(o,s){function a(t){try{l(n.next(t))}catch(t){s(t)}}function r(t){try{l(n.throw(t))}catch(t){s(t)}}function l(t){var e;t.done?o(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(a,r)}l((n=n.apply(t,e||[])).next())}))},U=function(t,e){var i,n,o,s,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return s={next:r(0),throw:r(1),return:r(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function r(s){return function(r){return function(s){if(i)throw new TypeError("Generator is already executing.");for(;a;)try{if(i=1,n&&(o=2&s[0]?n.return:s[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,s[1])).done)return o;switch(n=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],n=0}finally{i=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,r])}}},M=window.$,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 i.e(3708).then(i.t.bind(i,3708,19))},"cy-GB":function(){return i.e(4429).then(i.t.bind(i,4429,19))},"fr-FR":function(){return i.e(9044).then(i.t.bind(i,9044,19))},"pl-PL":function(){return i.e(8136).then(i.t.bind(i,8136,19))},"sv-SE":function(){return i.e(1831).then(i.t.bind(i,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._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.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"),h.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 i=h.jj.getHiddenProp();if(i){var n=i.replace(/[H|h]idden/,"")+"visibilitychange";document.addEventListener(n,(function(){h.jj.isHidden()||t.resize()}))}h.YA.getBool(this.data.config.options.dropEnabled,!0)&&this.$element.on("drop",(function(e){e.preventDefault();var i=e.originalEvent.dataTransfer.getData("URL"),n=h.f.getUrlParts(i),o=h.f.getQuerystringParameterFromString("manifest",n.search);if(o||(o=h.f.getQuerystringParameterFromString("collection",n.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(i){var n=null,s=!0;i.ctrlKey||i.altKey||i.shiftKey||(i.keyCode===F.G.Enter&&(n=o.b.RETURN,s=!1),i.keyCode===F.G.Escape&&(n=o.b.ESCAPE),i.keyCode===F.G.PageUp&&(n=o.b.PAGE_UP),i.keyCode===F.G.PageDown&&(n=o.b.PAGE_DOWN),i.keyCode===F.G.End&&(n=o.b.END),i.keyCode===F.G.Home&&(n=o.b.HOME),i.keyCode!==F.G.NumpadPlus&&171!==i.keyCode&&i.keyCode!==F.G.Equals||(n=o.b.PLUS,s=!1),i.keyCode!==F.G.NumpadMinus&&173!==i.keyCode&&i.keyCode!==F.G.Dash||(n=o.b.MINUS,s=!1),e.useArrowKeysToNavigate()&&(i.keyCode===F.G.LeftArrow&&(n=o.b.LEFT_ARROW),i.keyCode===F.G.UpArrow&&(n=o.b.UP_ARROW),i.keyCode===F.G.RightArrow&&(n=o.b.RIGHT_ARROW),i.keyCode===F.G.DownArrow&&(n=o.b.DOWN_ARROW))),n&&(s&&i.preventDefault(),t.extensionHost.publish(n))}))}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" style="display:none"></iframe>'),this.extensionHost.subscribeAll((function(e,i){[u.s.LOAD,u.s.DROP,u.s.TOGGLE_FULLSCREEN,u.s.EXTERNAL_RESOURCE_OPENED,u.s.RELOAD].includes(e)||t.fire(e,i)})),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.extensionHost.subscribe(o.b.CLOSE_RIGHT_PANEL,(function(){t.resize()})),this.extensionHost.subscribe(o.b.COLLECTION_INDEX_CHANGE,(function(e){t.data.collectionIndex=e})),this.extensionHost.subscribe(u.s.CREATED,(function(){t.isCreated=!0})),this.extensionHost.subscribe(o.b.ESCAPE,(function(){t.isFullScreen()&&!t.isOverlayActive()&&t.extensionHost.publish(u.s.TOGGLE_FULLSCREEN)})),this.extensionHost.subscribe(u.s.LOAD,(function(){setTimeout((function(){t.extensionHost.publish(u.s.RESIZE),t.fire(u.s.LOAD,t.helper.getCurrentCanvas().id),t.$element.removeClass("loading")}),100)})),this.extensionHost.subscribe(o.b.FEEDBACK,(function(){t.feedback()})),this.extensionHost.subscribe(o.b.FORBIDDEN,(function(){t.extensionHost.publish(o.b.OPEN_EXTERNAL_RESOURCE)})),this.extensionHost.subscribe(u.s.LOAD_FAILED,(function(){null==!e.lastCanvasIndex&&e.lastCanvasIndex!==e.helper.canvasIndex&&t.extensionHost.publish(o.b.CANVAS_INDEX_CHANGE,e.lastCanvasIndex)})),this.extensionHost.subscribe(o.b.MANIFEST_INDEX_CHANGE,(function(e){t.data.manifestIndex=e})),this.extensionHost.subscribe(o.b.OPEN,(function(){var e=h.DH.format(t.data.config.options.openTemplate,t.helper.manifestUri);window.open(e)})),thi