"use strict";function DeviceOrientationControlMethod(){this._dynamics={yaw:new Marzipano.Dynamics,pitch:new Marzipano.Dynamics},this._deviceOrientationHandler=this._handleData.bind(this),window.DeviceOrientationEvent&&window.addEventListener("deviceorientation",this._deviceOrientationHandler),this._previous={},this._current={},this._tmp={},this._getPitchCallbacks=[]}function rotateEuler(t,e){var n,o,i,a=Math.cos(t.yaw),r=Math.sin(t.yaw),c=Math.cos(t.pitch),s=Math.sin(t.pitch),l=Math.cos(t.roll),d=Math.sin(t.roll),u=[r*d-a*s*l,-a*c,a*s*d+r*l,c*l,-s,-c*d,r*s*l+a*d,r*c,-r*s*d+a*l];u[3]>.9999?(n=Math.atan2(u[2],u[8]),i=Math.PI/2,o=0):u[3]<-.9999?(n=Math.atan2(u[2],u[8]),i=-Math.PI/2,o=0):(n=Math.atan2(-u[6],u[0]),o=Math.atan2(-u[5],u[4]),i=Math.asin(u[3])),e.yaw=n,e.pitch=i,e.roll=o}Marzipano.dependencies.eventEmitter(DeviceOrientationControlMethod),DeviceOrientationControlMethod.prototype.destroy=function(){this._dynamics=null,window.DeviceOrientationEvent&&window.removeEventListener("deviceorientation",this._deviceOrientationHandler),this._deviceOrientationHandler=null,this._previous=null,this._current=null,this._tmp=null,this._getPitchCallbacks=null},DeviceOrientationControlMethod.prototype.getPitch=function(t){this._getPitchCallbacks.push(t)},DeviceOrientationControlMethod.prototype._handleData=function(t){var e=this._previous,n=this._current,o=this._tmp;o.yaw=Marzipano.util.degToRad(t.alpha),o.pitch=Marzipano.util.degToRad(t.beta),o.roll=Marzipano.util.degToRad(t.gamma),rotateEuler(o,n),this._getPitchCallbacks.forEach(function(t){t(null,n.pitch)}),this._getPitchCallbacks.length=0,null!=e.yaw&&null!=e.pitch&&null!=e.roll&&(this._dynamics.yaw.offset=-(n.yaw-e.yaw),this._dynamics.pitch.offset=n.pitch-e.pitch,this.emit("parameterDynamics","yaw",this._dynamics.yaw),this.emit("parameterDynamics","pitch",this._dynamics.pitch)),e.yaw=n.yaw,e.pitch=n.pitch,e.roll=n.roll},window.url=function(){function t(){}function e(t){return decodeURIComponent(t.replace(/\+/g," "))}function n(t,e){var n=t.charAt(0),o=e.split(n);return n===t?o:(t=parseInt(t.substring(1),10),o[0>t?o.length+t:t-1])}function o(t,n){for(var o=t.charAt(0),i=n.split("&"),a=[],r={},c=[],s=t.substring(1),l=0,d=i.length;d>l;l++)if(a=i[l].match(/(.*?)=(.*)/),a||(a=[i[l],i[l],""]),""!==a[1].replace(/\s/g,"")){if(a[2]=e(a[2]||""),s===a[1])return a[2];c=a[1].match(/(.*)\[([0-9]+)\]/),c?(r[c[1]]=r[c[1]]||[],r[c[1]][c[2]]=a[2]):r[a[1]]=a[2]}return o===t?r:r[s]}return function(e,i){var a,r={};if("tld?"===e)return t();if(i=i||window.location.toString(),!e)return i;if(e=e.toString(),a=i.match(/^mailto:([^\/].+)/))r.protocol="mailto",r.email=a[1];else{if((a=i.match(/(.*?)\/#\!(.*)/))&&(i=a[1]+a[2]),(a=i.match(/(.*?)#(.*)/))&&(r.hash=a[2],i=a[1]),r.hash&&e.match(/^#/))return o(e,r.hash);if((a=i.match(/(.*?)\?(.*)/))&&(r.query=a[2],i=a[1]),r.query&&e.match(/^\?/))return o(e,r.query);if((a=i.match(/(.*?)\:?\/\/(.*)/))&&(r.protocol=a[1].toLowerCase(),i=a[2]),(a=i.match(/(.*?)(\/.*)/))&&(r.path=a[2],i=a[1]),r.path=(r.path||"").replace(/^([^\/])/,"/$1").replace(/\/$/,""),e.match(/^[\-0-9]+$/)&&(e=e.replace(/^([^\/])/,"/$1")),e.match(/^\//))return n(e,r.path.substring(1));if(a=n("/-1",r.path.substring(1)),a&&(a=a.match(/(.*?)\.(.*)/))&&(r.file=a[0],r.filename=a[1],r.fileext=a[2]),(a=i.match(/(.*)\:([0-9]+)$/))&&(r.port=a[2],i=a[1]),(a=i.match(/(.*?)@(.*)/))&&(r.auth=a[1],i=a[2]),r.auth&&(a=r.auth.match(/(.*)\:(.*)/),r.user=a?a[1]:r.auth,r.pass=a?a[2]:void 0),r.hostname=i.toLowerCase(),"."===e.charAt(0))return n(e,r.hostname);t()&&(a=r.hostname.match(t()),a&&(r.tld=a[3],r.domain=a[2]?a[2]+"."+a[3]:void 0,r.sub=a[1]||void 0)),r.port=r.port||("https"===r.protocol?"443":"80"),r.protocol=r.protocol||("443"===r.port?"https":"http")}return e in r?r[e]:"{}"===e?r:void 0}}(),"undefined"!=typeof jQuery&&jQuery.extend({url:function(t,e){return window.url(t,e)}});var actionBar=function(){function t(){$("#actionBar").removeClass("loading").removeClass("active").one("webkitTransitionEnd otransitionend oTransitionEnd msTransitionEnd transitionend",function(t){var e=new CustomEvent("actionbarclosed",{});window.dispatchEvent(e)})}function e(){i()?a():r()}function n(t,e,n){l.classList.add("contentOpen"),l.querySelector(".headerContentOpenContent .contentTitle").textContent=t,$("#actionBar > .container > .body > .bodyContainer > .content > .active").removeClass("active");var o=document.querySelector("#"+e),i=l.querySelector(".bodyContainer > .content");o.parentElement!==i&&(i.appendChild(o),$(o).find("[data-defer]").toArray().map(function(t,e){DeferSource.activate(t)})),o.classList.add("active"),$("#actionBar > .container > .body > .bodyContainer > .menuContainer .menu li.active").removeClass("active"),n&&n.classList.add("active")}function o(){$("#actionBar > .container > .body > .bodyContainer > .content > .active").removeClass("active"),$("#actionBar > .container > .body > .bodyContainer > .menuContainer .menu li.active").removeClass("active"),l.classList.remove("contentOpen")}function i(){return l.classList.contains("active")}function a(){o(),l.classList.remove("active")}function r(){l.querySelector(".menuContainer").scrollTop=0,l.classList.add("active")}function c(){l.classList.add("down")}function s(){l.classList.remove("down")}var l=document.getElementById("actionBar");return function(){document.getElementById("activeToggle").addEventListener("click",function(t){t.stopPropagation(),t.preventDefault(),e()});var t=document.getElementById("shareToggle");"true"===url("?apponly")||"muzej.crvenazvezdafk.com"===window.location.hostname?t.style.visibility="hidden":t.href="javascript:window.open('https://www.facebook.com/sharer/sharer.php?u="+window.location.href+"', 'pop', 'width=600, height=400, scrollbars=no')",document.querySelector("#actionBar > .container > .body > .bodyContainer > .menuContainer").addEventListener("transitionend",function(t){t.target===this&&this.querySelector("li.active")&&this.querySelector("li.active").scrollIntoView({behavior:"smooth",block:"nearest"})}),document.querySelector("#actionBar .header .headerContentOpenContent").addEventListener("click",function(t){t.stopPropagation(),t.preventDefault(),actionBar.content.close()})}(),{status:i,close:a,open:r,toggle:e,triggerLoaded:t,hide:c,show:s,content:{open:n,close:o}}}();!function(){function t(t,e){return t===e?0:t>e?-1:1}function e(e,n){return function(o,i,a,r){function c(){a(s);var n=t(s,i);s+=d;var o=t(s,i);n!==o&&0!==o?r&&r():setTimeout(function(){c()},e)}var s=o,l=t(o,i),d=l*n;c()}}function n(){this.stepSize=1,this.animationDelay=50}var o={from:"from",to:"to",everyStep:"onEveryStep",then:"whenDone",withStepSize:"stepSize",withAnimationDelay:"animationDelay"};Object.keys(o).forEach(function(t){n.prototype[t]=function(e){return this[o[t]]=e,this}}),n.prototype.start=function(){["from","to","onEveryStep"].forEach(function(t){if(null===this[t]||"undefined"==typeof this[t])throw t+" must be defined"}.bind(this)),e(this.animationDelay,this.stepSize)(this.from,this.to,this.onEveryStep,this.whenDone)},window.animate=function(){return new n},window.chainAnimations=function(){function t(){if(0!==e.length){var n=e.shift(),o=n.whenDone;n.then(function(){t(),o&&o()}).start()}}var e=Array.prototype.slice.call(arguments);t()}}(),function(){function t(t){var e=0,n=0;if(!t)var t=window.event;return t.pageX||t.pageY?(e=t.pageX,n=t.pageY):(t.clientX||t.clientY)&&(e=t.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,n=t.clientY+document.body.scrollTop+document.documentElement.scrollTop),{x:e,y:n}}function e(){n(),o(),i(),a()}function n(){document.addEventListener("contextmenu",function(t){t.preventDefault(),r(),s(t)})}function o(){addListenerMulti(document,"click touchstart",function(t){0!==w&&c()})}function i(){window.onkeyup=function(t){27===t.keyCode&&c()}}function a(){window.onresize=function(t){c()}}function r(){1!==w&&(w=1,y.classList.add(v))}function c(){0!==w&&(w=0,y.classList.remove(v))}function s(e){l=t(e),d=l.x,u=l.y,h=y.offsetWidth+4,f=y.offsetHeight+4,m=window.innerWidth,p=window.innerHeight,m-d1){var r=!0,c=0,s=1;X=setInterval(function(){c=r?c+.01:c-.01,r===!1&&c<0?1===s?r=!0:(s--,c=1):r===!0&&c>1&&(s===o-1?r=!1:(s++,c=0)),e.marzipanoObject.listLayers()[s].setEffects({opacity:c})},30)}e.marzipanoObject.hotspotContainer().listHotspots().map(function(e){var n=e._domElement;if(void 0!==n.dataset.element){var o=document.querySelector("#"+n.dataset.element);t(function(){var t=$(o).find("[data-defer]").toArray();$(o).find("[data-speechbubble]").each(function(e,n){t=t.concat.apply([],$("#"+n.dataset.speechbubble).find("[data-defer]:NOT([data-loadonshow])"))}),t.map(function(t,e){DeferSource.activate(t)});var e=new Event("DeferLoaded");o.dispatchEvent(e),$(o).find("[data-speechbubble]").each(function(t,n){document.querySelector("#"+n.dataset.speechbubble).dispatchEvent(e)})}),n.appendChild(o)}}),"function"==typeof setInfoSceneWindow&&setInfoSceneWindow(e.data.infoWindow),i?d(e):t(function(){d(e)}),n&&n()}),L(e.data.id)}function d(t){var e=Array.prototype.slice.call(document.querySelectorAll("ul.menu a[href^='#']"));e.forEach(function(t){var e=t.hash.substring(1);u(e)}),t.marzipanoObject.hotspotContainer().listHotspots().map(function(t){if(t._domElement.classList.contains("link-hotspot")){var e=t._domElement.dataset.target;z(e).marzipanoObject.layer().pinFirstLevel()}else if(t._domElement.classList.contains("hotspotContainer")){var n=g(t._domElement.dataset.element).scene;z(n).marzipanoObject.layer().pinFirstLevel();var o=Array.prototype.slice.call(t._domElement.querySelectorAll("[href^='#']")).map(function(t){return t.hash.substring(1)}),i=Array.prototype.slice.call(t._domElement.querySelectorAll("[data-scene]")).map(function(t){return t.dataset.scene});o.concat(i).forEach(function(t){u(t)})}})}function u(t){var n;if("scene"===e(t))n=t;else{if("hotspot"!==e(t))return;n=g(t).scene}z(n).marzipanoObject.layer().pinFirstLevel()}function h(){A.classList.contains("active")?(W.disableMethod("deviceOrientation"),A.classList.remove("active")):(N.getPitch(function(t,e){R.scene().view().setPitch(e)}),W.enableMethod("deviceOrientation"),A.classList.add("active"))}function f(t){var e=document.createElement("div");e.classList.add("hotspot"),e.classList.add("link-hotspot"),e.dataset.target=t.target,e.addEventListener("click",function(){var e={};void 0!==t.look_to&&(e.lookTo=t.look_to),l(z(t.target),null,e)}),stopTouchAndScrollEventPropagation(e);var n=document.createElement("i");if(""===t.icon?n.className="icon fa fa-circle":n.className="icon "+t.icon,e.appendChild(n),""!==t.description){var o=document.createElement("div");o.classList.add("title"),e.appendChild(o),o.textContent=t.description}return e}function m(t){var e=g(t),n=document.getElementById(t);if(!n)throw new Error("Element "+t+" was not found in HTML, so width and height not added!");n.style.width=e.dimension.width+"px",n.style.height=e.dimension.height+"px",0===e.without_zoom&&n.classList.add("zoomable")}function p(t,e){var n=document.createElement("div");n.style.width=e.width+"px",n.style.height=e.height+"px",n.dataset.element=t,n.classList.add("hotspotContainer");var o=g(t);if(0===o.over_panorama){n.classList.add("behind");var i=$("#elementLoading").clone(!0).get()[0];$(n).append(i),stopTouchAndScrollEventPropagation(n)}else n.classList.add("hotspot");return n}function v(t){var e=document.createElement("div");return e.classList.add("hotspot"),e.classList.add("infoHotspot"),e.dataset.element=t.id,stopTouchAndScrollEventPropagation(e),e}function y(t){t||(t=s());var e=tileSize*Math.pow(2,t.levels)*.5;return T.RectilinearView.limit.traditional(e,100*Math.PI/180,120*Math.PI/180)}function w(t,e){return t.hotspotContainer().listHotspots().find(function(t){if(t._domElement.dataset.element===e)return!0})._domElement}function b(t,e){var n=R.listScenes().indexOf(t),o=H.scenes[n],i=o.elementHotspots;i.concat(o.infoHotspots).concat(o.linkHotspots);for(var a in i)if(i[a].id===e||i[a].elementId===e)return i[a]}function g(t){return H.elementHotspots[t]}function E(t,e,n){e||(e=function(){}),n||(n={});var o=g(t),i=z(o.scene),a=b(R.scene(),t),r={yaw:a.location.x,pitch:a.location.y};if(0===o.without_zoom){r.fov=0,W.disable(),R.view().setLimiter(T.util.compose(T.RectilinearView.limit.hfov(o.zoom.horizontal,2.5),T.RectilinearView.limit.vfov(o.zoom.vertical,2.5)));var c=w(R.scene(),a.id);c.className+=" enabled",document.body.classList.add("hotspotFocused"),_(i.marzipanoObject.layer(),-.5),L(t)}R.lookTo(r,n,e)}function L(t){history.pushState(null,null,"#"+t)}function S(t,e,n){if(n||(n={}),void 0!==n.guide&&void 0!==n.guide.video&&GuidePosition.findByValue("id",t).changeGuide(Guide.findByValue("id",n.guide.video)),!document.body.classList.contains("hotspotFocused")){e||(e=function(){});var o=g(t),i=z(o.scene),a=b(i.marzipanoObject,t);if(i.marzipanoObject!==R.scene())return void l(i,function(){S(t,e)},{lookTo:{yaw:a.location.x,pitch:a.location.y}});E(t,e,n)}}function C(){W.enable(),R.scene().hotspotContainer().listHotspots().forEach(function(t){t.domElement().classList.contains("enabled")&&t.domElement().classList.remove("enabled")}),R.view().setLimiter(y()),R.lookTo({fov:5}),document.body.classList.remove("hotspotFocused"),_(R.scene().layer(),0),L(s().id)}function _(t,e){if("undefined"==typeof animate)t.setEffects({opacity:1,colorOffset:[e,e,e,0]});else{var n=0;t.effects().hasOwnProperty("colorOffset")&&(n=t.effects().colorOffset[0]),animate().from(n).to(e).withStepSize(.05).everyStep(function(e){t.setEffects({opacity:1,colorOffset:[e,e,e,0]})}).start()}}function z(t){for(var e=0;e