(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d0bdd57"],{"2e4b":function(e,t,o){"use strict";o.r(t),o.d(t,"default",(function(){return f}));o("8e6e"),o("c5f6");var a=o("ade3"),n=(o("7f7f"),o("456d"),o("ac6a"),o("d4ec")),r=o("bee2"),s=o("c7b2"),i=o("6860"),c=o("80c5"),p=o("c75e"),l=o("d9c2"),u=o("eb02"),d=o("b235");function m(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,a)}return o}function y(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:null;g&&console.log("%c----postMessage----","color: #43bb88;font-size: 12px;",e,JSON.stringify(t)),parent.postMessage({source:"4dage",module:this.module,event:e,params:t},"*")}},{key:"sendAction",value:function(e,t){this.send("action",{type:e,data:y({},t)}),this.started&&"map"==e&&this.send("sync",{action:{type:e,data:y({},t)}})}},{key:"sendTouches",value:function(e,t){if(this.sendTouchEvents){var o=[];t.changedTouches.length?Object.keys(t.changedTouches).forEach((function(e){o.push({clientX:t.changedTouches[e].clientX,clientY:t.changedTouches[e].clientY})})):Object.keys(t.touches).forEach((function(e){o.push({clientX:t.touches[e].clientX,clientY:t.touches[e].clientY})})),this.sendAction(e,{touches:o})}}},{key:"init",value:function(){var e=this;s["app"].player.cameraControls.on("vr_freedom",(function(){e.started&&!s["app"].play.control.onUpdate&&(e.send("sync",{content:{onUpdate:!1}}),s["app"].play.control.onUpdate=!0)})),s["app"].player.on("vr_Rotate",(function(t){if(e.started){var o={};o.qua=t.quaternion,o.mode=t.mode,o.pos=t.position,t.cameraControls.activeControl&&t.cameraControls.activeControl.currentScale&&(o.zoom=t.cameraControls.activeControl.currentScale/($("#player").width()/$("#player").height())),o.type="Rotate",v(o)||(t.mode==c["a"].PANORAMA?(o.pano=t.currentPano.id,o.zoomLevel=t.zoomLevel):t.mode==c["a"].FLOORPLAN&&(o.pos=(new THREE.Vector3).set(t.position.x,t.position.y,t.position.z)),t.cameraControls.activeControl.target&&(o.pos=t.position,o.target=t.cameraControls.activeControl.target),s["app"].play.control.onUpdate&&e.send("sync",{content:{item:o}}))}})),s["app"].player.on("vr_ToZoom",(function(t,o){e.started&&e.send("sync",{content:{scale:{zoomLevel:t,flag:o}}})})),s["app"].player.on("vr_FlyToPano",(function(t){e.started&&(t.socketed=!0,e.send("sync",{content:{toPano:t}}))})),s["app"].player.on("vr_FlyToNewMode",(function(t){e.started&&(t.socketed=!0,e.send("sync",{content:{newModeInfo:t,onUpdate:!1}}),s["app"].play.control.onUpdate=!1)}))}},{key:"initGuide",value:function(){var e,t,o=this,a=function a(n,r){if(!n)return e&&d["a"].cancel(e),t=0,r&&(o.guide.index=0),void o.send("guide-progress",{index:o.guide.index,progress:t});var s=u["a"].getters["guide/roomLabels"][o.guide.index];if(s){var i=parseInt(1e3*Number(s.cTime).toFixed(3));e=d["a"].start((function(e){1==e?(t=0,o.guide.index++,a(n)):(t=100*e,o.send("guide-progress",{index:o.guide.index,progress:t}))}),i)}};s["play"].on("guide/play/start",(function(e){o.send("guide-start",{status:!0}),a(!0,!1),u["a"].commit("guide/SetStatus",{isPlaying:!0})})),s["play"].on("guide/play/pause",(function(e){a(!1),u["a"].commit("guide/SetStatus",{isPlaying:!1}),o.send("guide-pause",{status:!0})})),s["play"].on("guide/play/stop",(function(){a(!1,!0),u["a"].commit("guide/SetStatus",{isPlaying:!1}),o.send("guide-stop",{status:!0})})),s["play"].on("guide/play/playing",(function(e){u["a"].commit("guide/SetIndex",e)})),s["play"].on("guide/play/flyToStart",(function(e){u["a"].commit("guide/SetIndex",e)}))}},{key:"setGuideStart",value:function(){var e=u["a"].getters["guide/roomLabels"][this.guide.index];s["play"].chooseFragment(e.index,0,(function(){s["play"].control.flyToSingleCap&&(s["play"].control.flyToSingleCap=!1),s["play"].start()}))}},{key:"setGuideRoomIndex",value:function(e){this.guide.index=e;var t=u["a"].getters["guide/roomLabels"][this.guide.index];s["play"].chooseFragment(t.index,0,(function(){s["play"].control.flyToSingleCap&&(s["play"].control.flyToSingleCap=!1)}))}},{key:"getPanoId",value:function(){return s["app"].player.currentPano.id}},{key:"gyroStart",value:function(){}}]),e}(),h=null;function v(e){if(null==h)return w(e),!1;if(h.mode!=e.mode)return w(e),!1;if(h.mode==c["a"].PANORAMA)return!(!h.qua.equals(e.qua)||h.zoomLevel!=e.zoomLevel)||(w(e),!1);if(h.mode==c["a"].DOLLHOUSE){var t=!0;return e.qua&&h.qua&&(h.qua.equals(e.qua)||(t=!1)),e.pos&&h.pos&&(h.pos.equals(e.pos)||(t=!1)),e.target&&h.target&&(h.target.equals(e.target)||(t=!1)),h.zoom&&(h.zoom.equals(e.zoom)||(t=!1)),t||w(e),t}var o=!0;return h.qua.equals(e.qua)?(h.pos&&(h.pos.equals(e.pos)||(o=!1)),h.zoom&&h.zoom!=e.zoom&&(o=!1)):o=!1,o||w(e),o}function w(e){h={},h.mode=e.mode,e.pos&&(h.pos=new THREE.Vector3,h.pos.set(e.pos.x,e.pos.y,e.pos.z)),e.qua&&(h.qua=new THREE.Quaternion,h.qua.set(e.qua._x,e.qua._y,e.qua._z,e.qua._w)),e.target&&(h.target=new THREE.Vector3,h.target.set(e.target.x,e.target.y,e.target.z)),e.zoom&&(h.zoom=e.zoom)}function b(){var e=u["a"].getters["scene/metadata"],t=0;e.entry&&(t=e.entry.pano);var o=new THREE.Quaternion;e.entry&&e.entry.camera&&(o=e.entry.camera.quaternion),console.log("初始化InitialPoint"),console.log(o),T(t,o,!0)}function T(e,t,o){if((s["app"].player.mode!=c["a"].PANORAMA||e!=s["app"].player.currentPano.id||o)&&e){var a;a=t instanceof Array?(new THREE.Quaternion).fromArray(t):(new THREE.Quaternion).set(t._x,t._y,t._z,t._w);var n={mode:c["a"].PANORAMA,pano:e,qua:a};isNaN(n.qua.x)&&console.error("toSync[item.qua.x] is NaN",n.qua.x),s["app"].player.cameraControls.activeControl&&s["app"].player.copyCameraProp(s["app"].player.cameraControls.activeControl,{qua:a}),s["app"].player.flyToItem(n,null)}}function P(e,t,o,a,n,r){var i;i=t instanceof Array?(new THREE.Quaternion).fromArray(t):(new THREE.Quaternion).set(t._x,t._y,t._z,t._w);var c={mode:o,pano:e,qua:i,pos:a,target:n,zoom:r};isNaN(c.qua.x)&&console.log("NaN??????"),s["app"].player.flyToItem(c,(function(){}))}}}]);