js-cloudimage-360-view 4.2.0 → 4.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +62 -0
- package/dist/js-cloudimage-360-view.min.js +46 -16
- package/dist/react/ci360-C-RVZ3Va.js +65 -0
- package/dist/react/ci360-C-RVZ3Va.js.map +1 -0
- package/dist/react/{ci360-CILBSFAa.mjs → ci360-CzKohD8_.mjs} +1116 -824
- package/dist/react/ci360-CzKohD8_.mjs.map +1 -0
- package/dist/react/index.cjs +1 -1
- package/dist/react/index.d.ts +6 -0
- package/dist/react/index.js +1 -1
- package/dist/react/style.css +1 -1
- package/package.json +1 -1
- package/src/react/types.d.ts +6 -0
- package/src/types/ci360.d.ts +1 -0
- package/dist/react/ci360-CILBSFAa.mjs.map +0 -1
- package/dist/react/ci360-TSs45Yhc.js +0 -35
- package/dist/react/ci360-TSs45Yhc.js.map +0 -1
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
"use strict";var ti=Object.defineProperty;var ei=(e,t,i)=>t in e?ti(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i;var le=(e,t,i)=>ei(e,typeof t!="symbol"?t+"":t,i);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var Mt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ii(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ze="Expected a function",ce=NaN,si="[object Symbol]",oi=/^\s+|\s+$/g,ni=/^[-+]0x[0-9a-f]+$/i,ri=/^0b[01]+$/i,ai=/^0o[0-7]+$/i,li=parseInt,ci=typeof Mt=="object"&&Mt&&Mt.Object===Object&&Mt,hi=typeof self=="object"&&self&&self.Object===Object&&self,di=ci||hi||Function("return this")(),ui=Object.prototype,pi=ui.toString,fi=Math.max,mi=Math.min,Kt=function(){return di.Date.now()};function vi(e,t,i){var s,o,n,l,r,a,c=0,h=!1,p=!1,f=!0;if(typeof e!="function")throw new TypeError(Ze);t=he(t)||0,Bt(i)&&(h=!!i.leading,p="maxWait"in i,n=p?fi(he(i.maxWait)||0,t):n,f="trailing"in i?!!i.trailing:f);function u(y){var O=s,S=o;return s=o=void 0,c=y,l=e.apply(S,O),l}function I(y){return c=y,r=setTimeout(m,t),h?u(y):l}function g(y){var O=y-a,S=y-c,E=t-O;return p?mi(E,n-S):E}function v(y){var O=y-a,S=y-c;return a===void 0||O>=t||O<0||p&&S>=n}function m(){var y=Kt();if(v(y))return b(y);r=setTimeout(m,g(y))}function b(y){return r=void 0,f&&s?u(y):(s=o=void 0,l)}function x(){r!==void 0&&clearTimeout(r),c=0,s=a=o=r=void 0}function w(){return r===void 0?l:b(Kt())}function C(){var y=Kt(),O=v(y);if(s=arguments,o=this,a=y,O){if(r===void 0)return I(a);if(p)return r=setTimeout(m,t),u(a)}return r===void 0&&(r=setTimeout(m,t)),l}return C.cancel=x,C.flush=w,C}function gi(e,t,i){var s=!0,o=!0;if(typeof e!="function")throw new TypeError(Ze);return Bt(i)&&(s="leading"in i?!!i.leading:s,o="trailing"in i?!!i.trailing:o),vi(e,t,{leading:s,maxWait:t,trailing:o})}function Bt(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function yi(e){return!!e&&typeof e=="object"}function bi(e){return typeof e=="symbol"||yi(e)&&pi.call(e)==si}function he(e){if(typeof e=="number")return e;if(bi(e))return ce;if(Bt(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Bt(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=e.replace(oi,"");var i=ri.test(e);return i||ai.test(e)?li(e.slice(2),i?2:8):ni.test(e)?ce:+e}var wi=gi;const de=ii(wi),M={SPIN_X:"spin-x",SPIN_Y:"spin-y",SPIN_XY:"spin-xy",SPIN_YX:"spin-yx"},Ii=[!1,0,null,void 0,"false","0","null","undefined"],P={X:"x-axis",Y:"y-axis"},xi=[37,39],Ci=[38,40],ue=10,Oi=150,pe=800,Ei=150,Si=200,fe=50,Ai=50,Li=5,me=5,ki="https://scaleflex.cloudimg.io/v7/filerobot/js-cloudimage-360-view/360_view.svg",d={folder:"/",apiVersion:"v7",filenameX:"image-{index}.jpg",filenameY:null,imageListX:null,imageListY:null,indexZeroBase:0,amountX:0,amountY:0,speed:80,dragSpeed:150,draggable:!0,swipeable:!0,keys:!1,keysReverse:!1,autoplay:!1,autoplayBehavior:M.SPIN_X,playOnce:!1,autoplayReverse:!1,pointerZoom:0,fullscreen:!1,magnifier:null,bottomCircle:!0,bottomCircleOffset:5,ciToken:null,ciFilters:null,ciTransformation:null,lazyload:!0,dragReverse:!1,stopAtEdges:!1,imageInfo:!1,initialIconShown:!0,hotspots:null,hide360Logo:!1,logoSrc:ki,inertia:!1,pinchZoom:!0,hints:!0,theme:null,hotspotTimelineOnClick:!0,aspectRatio:null,onReady:null,onLoad:null,onSpin:null,onAutoplayStart:null,onAutoplayStop:null,onFullscreenOpen:null,onFullscreenClose:null,onZoomIn:null,onZoomOut:null,onDragStart:null,onDragEnd:null},Ti=e=>({folder:L(e,"folder",d.folder),apiVersion:L(e,"api-version",d.apiVersion),filenameX:L(e,"filename")||L(e,"filename-x")||d.filenameX,filenameY:L(e,"filename-y",d.filenameY),imageListX:L(e,"image-list-x",d.imageListX),imageListY:L(e,"image-list-y",d.imageListY),indexZeroBase:parseInt(L(e,"index-zero-base",d.indexZeroBase),10),amountX:parseInt(L(e,"amount-x",d.amountX),10),amountY:parseInt(L(e,"amount-y",d.amountY),10),speed:parseInt(L(e,"speed",d.speed),10),dragSpeed:parseInt(L(e,"drag-speed",d.dragSpeed),10),draggable:X(e,"draggable",d.draggable),swipeable:X(e,"swipeable",d.swipeable),keys:X(e,"keys",d.keys),keysReverse:X(e,"keys-reverse",d.keysReverse),autoplay:X(e,"autoplay",d.autoplay),autoplayBehavior:L(e,"autoplay-behavior",d.autoplayBehavior),playOnce:X(e,"play-once",d.playOnce),autoplayReverse:X(e,"autoplay-reverse",d.autoplayReverse),pointerZoom:parseFloat(L(e,"pointer-zoom",d.pointerZoom)),fullscreen:X(e,"fullscreen")||X(e,"full-screen",d.fullscreen),magnifier:parseFloat(L(e,"magnifier",d.magnifier)),bottomCircleOffset:parseInt(L(e,"bottom-circle-offset",d.bottomCircleOffset),10),ciToken:L(e,"responsive",d.ciToken),ciFilters:L(e,"filters",d.ciFilters),ciTransformation:L(e,"transformation",d.ciTransformation),lazyload:X(e,"lazyload",d.lazyload),dragReverse:X(e,"drag-reverse",d.dragReverse),stopAtEdges:X(e,"stop-at-edges",d.stopAtEdges),imageInfo:X(e,"info",d.imageInfo),initialIconShown:!Ht(e,"initial-icon"),bottomCircle:!Ht(e,"bottom-circle"),hide360Logo:X(e,"hide-360-logo",d.hide360Logo),logoSrc:L(e,"logo-src",d.logoSrc),inertia:X(e,"inertia",d.inertia),pinchZoom:X(e,"pinch-zoom",d.pinchZoom),hints:!Ht(e,"hints"),theme:L(e,"theme",d.theme),hotspotTimelineOnClick:!Ht(e,"hotspot-timeline-on-click"),aspectRatio:L(e,"aspect-ratio",d.aspectRatio)}),Yi=e=>{const t=[];e.amountX!==void 0&&e.amountX<0&&t.push("amountX should be a positive number"),e.amountY!==void 0&&e.amountY<0&&t.push("amountY should be a positive number"),e.speed!==void 0&&e.speed<=0&&t.push("speed should be a positive number"),e.dragSpeed!==void 0&&e.dragSpeed<=0&&t.push("dragSpeed should be a positive number"),e.pointerZoom!==void 0&&e.pointerZoom!==0&&(e.pointerZoom<1||e.pointerZoom>5)&&t.push("pointerZoom should be between 1 and 5 (or 0 to disable)"),e.magnifier!==void 0&&e.magnifier!==null&&e.magnifier!==0&&(e.magnifier<1||e.magnifier>5)&&t.push("magnifier should be between 1 and 5 (or 0/null to disable)"),!e.folder&&!e.imageListX&&!e.imageListY&&t.push("Either folder or imageListX/imageListY is required"),e.folder&&!e.amountX&&!e.imageListX&&t.push("amountX is required when using folder (unless imageListX is provided)");const i=["spin-x","spin-y","spin-xy","spin-yx"];return e.autoplayBehavior&&!i.includes(e.autoplayBehavior)&&t.push(`autoplayBehavior should be one of: ${i.join(", ")}`),t.forEach(s=>{console.warn(`CloudImage 360: ${s}`)}),t.length===0},Xi=e=>(Yi(e),{folder:e.folder||d.folder,apiVersion:e.apiVersion||d.apiVersion,filenameX:e.filenameX||e.filename||d.filenameX,filenameY:e.filenameY||d.filenameY,imageListX:e.imageListX||d.imageListX,imageListY:e.imageListY||d.imageListY,indexZeroBase:parseInt(e.indexZeroBase??d.indexZeroBase,10),amountX:parseInt(e.amountX??d.amountX,10),amountY:parseInt(e.amountY??d.amountY,10),speed:parseInt(e.speed??d.speed,10),draggable:e.draggable??d.draggable,swipeable:e.swipeable??d.swipeable,dragSpeed:parseInt(e.dragSpeed??d.dragSpeed,10),keys:e.keys??d.keys,keysReverse:e.keysReverse??d.keysReverse,autoplay:e.autoplay??d.autoplay,autoplayBehavior:e.autoplayBehavior||d.autoplayBehavior,playOnce:e.playOnce??d.playOnce,autoplayReverse:e.autoplayReverse??d.autoplayReverse,pointerZoom:parseFloat(e.pointerZoom??d.pointerZoom),fullscreen:e.fullscreen??d.fullscreen,magnifier:parseFloat(e.magnifier??d.magnifier),bottomCircleOffset:parseInt(e.bottomCircleOffset??d.bottomCircleOffset,10),ciToken:e.ciToken||d.ciToken,ciFilters:e.ciFilters||d.ciFilters,ciTransformation:e.ciTransformation||d.ciTransformation,lazyload:e.lazyload??d.lazyload,dragReverse:e.dragReverse??d.dragReverse,stopAtEdges:e.stopAtEdges??d.stopAtEdges,imageInfo:e.imageInfo??d.imageInfo,initialIconShown:e.initialIconShown??d.initialIconShown,bottomCircle:e.bottomCircle??d.bottomCircle,hotspots:e.hotspots??d.hotspots,hide360Logo:e.hide360Logo??d.hide360Logo,logoSrc:e.logoSrc||d.logoSrc,inertia:e.inertia??d.inertia,pinchZoom:e.pinchZoom??d.pinchZoom,hints:e.hints??d.hints,theme:e.theme||d.theme,hotspotTimelineOnClick:e.hotspotTimelineOnClick??d.hotspotTimelineOnClick,aspectRatio:e.aspectRatio||d.aspectRatio,onReady:e.onReady??d.onReady,onLoad:e.onLoad??d.onLoad,onSpin:e.onSpin??d.onSpin,onAutoplayStart:e.onAutoplayStart??d.onAutoplayStart,onAutoplayStop:e.onAutoplayStop??d.onAutoplayStop,onFullscreenOpen:e.onFullscreenOpen??d.onFullscreenOpen,onFullscreenClose:e.onFullscreenClose??d.onFullscreenClose,onZoomIn:e.onZoomIn??d.onZoomIn,onZoomOut:e.onZoomOut??d.onZoomOut,onDragStart:e.onDragStart??d.onDragStart,onDragEnd:e.onDragEnd??d.onDragEnd}),L=(e,t,i)=>e.getAttribute(t)||e.getAttribute(`data-${t}`)||i,X=(e,t,i)=>{if(!(e.hasAttribute(t)||e.hasAttribute(`data-${t}`)))return i;const o=L(e,t,null);return o!=="false"&&o!=="0"},Ht=(e,t)=>L(e,t,null)==="false",Pi=(e=1)=>{const t=Math.round(window.devicePixelRatio||1);return parseInt(e)*t},Ri=(e,t,i)=>new URL(e).origin.includes("cloudimg")?e:`https://${t}.cloudimg.io/${i}${e}`,Mi=({ciTransformation:e,responsiveWidth:t,ciFilters:i})=>{const s=`width=${t}`,o=e||s,n=i?`&f=${i}`:"";return`${o}${n}`},Et=(e,t)=>{const{folder:i,apiVersion:s,filename:o="",ciParams:n}=e,{ciToken:l,ciFilters:r,ciTransformation:a}=n||{},c=`${i}${o}`;if(!l)return c;const h=Ii.includes(s)?null:s,p=h?`${h}/`:"",f=Pi(t),u=Ri(c,l,p),I=Mi({ciTransformation:a,responsiveWidth:f,ciFilters:r});return`${u}${I?"?":""}${I}`},Hi=(e,t,i)=>{const[s,o]=e.split("?"),n=`${t}=${encodeURIComponent(i)}`;if(!o)return`${s}?${n}`;const l=new URLSearchParams(o);return l.set(t,i),`${s}?${l.toString()}`},Di=(e,t)=>Hi(e,"width",t),Be=(e,t=0)=>(e+="",e.length>=t?e:new Array(t-e.length+1).join("0")+e),Zi=(e,{amount:t=0,indexZeroBase:i=0}={})=>Array.from({length:t},(s,o)=>e.replace("{index}",Be(o+1,i))),Bi=({imagesUrls:e,onFirstImageLoad:t,onImageLoad:i,onAllImagesLoad:s,onError:o,autoplayReverse:n})=>{let l=0,r=0;const a=e.length,c=[],h=[],p=(m,b,x=!1)=>{const w={message:`Failed to load image: ${m}`,url:m,index:b,isFirstImage:x};h.push(w),r++,o==null||o({error:w,errorCount:r,totalImages:a,errors:h})},f=()=>{l===a&&(s==null||s(c,{errorCount:r,errors:h}))},u=(m,b)=>{const x=new Image;x.crossOrigin="anonymous",x.src=m,x.onload=async()=>{try{const w=await createImageBitmap(x),C={src:m,bitmapImage:w,naturalWidth:x.naturalWidth,naturalHeight:x.naturalHeight};l++,c[b]=C,i==null||i(C,b),f()}catch{l++,p(m,b),f()}},x.onerror=()=>{l++,p(m,b),f()}},I=new Image,g=n?e.length-1:0,v=e[g];I.crossOrigin="anonymous",I.src=v,I.onload=async()=>{try{const m=await createImageBitmap(I),b={src:v,bitmapImage:m,naturalWidth:I.naturalWidth,naturalHeight:I.naturalHeight};c[g]=b,l++,t==null||t(b),i==null||i(b,g);for(let x=0;x<e.length;x++)x!==g&&u(e[x],x);f()}catch{l++,p(v,g,!0);for(let b=0;b<e.length;b++)b!==g&&u(e[b],b);f()}},I.onerror=()=>{l++,p(v,g,!0);for(let m=0;m<e.length;m++)m!==g&&u(e[m],m);f()}},ve=({cdnPathX:e,cdnPathY:t,configX:i,configY:s,onFirstImageLoad:o,onImageLoad:n,onAllImagesLoad:l,onError:r})=>{let a={x:!1,y:!1},c=[],h=[],p={errorCount:0,errors:[]},f={errorCount:0,errors:[]};const u=e||i.imageList.length,I=t||s.imageList.length,g=()=>{if(a.x&&a.y){const m={errorCount:p.errorCount+f.errorCount,errors:[...p.errors,...f.errors]};l==null||l(c,h,m)}},v=({cdnPath:m,config:b,orientation:x,loadedImages:w,loadStats:C,onFirstImageLoad:y})=>{const O=x===P.X,S=b.imageList.length?b.imageList:Zi(m,b);Bi({imagesUrls:S,onFirstImageLoad:y,onImageLoad:(E,A)=>{n==null||n(E,A,x),w[A]=E},onError:E=>{r==null||r({...E,orientation:x})},onAllImagesLoad:(E,A)=>{w.length=0,E.forEach((k,R)=>{k&&(w[R]=k)}),C.errorCount=A.errorCount,C.errors=A.errors.map(k=>({...k,orientation:x})),a[O?"x":"y"]=!0,g()},autoplayReverse:b.autoplayReverse})};u?v({cdnPath:e,config:i,orientation:P.X,loadedImages:c,loadStats:p,onFirstImageLoad:o}):a.x=!0,I?v({cdnPath:t,config:s,orientation:P.Y,loadedImages:h,loadStats:f,onFirstImageLoad:u?void 0:o}):a.y=!0,!u&&!I&&g()},Wi=`
|
|
2
|
-
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1052 156" aria-hidden="true">
|
|
3
|
-
<path fill="currentColor" d="M409.9,145.6c-42.7-1.7-85.5-4.4-128.1-8.4c-21.3-2-42.6-4.3-63.8-7.1c-21.2-2.8-42.4-5.9-63.4-9.7c-21.1-3.8-42-8.2-62.7-13.7c-10.3-2.8-20.6-5.8-30.7-9.4c-10.1-3.5-20.1-7.6-29.5-12.7c-4.7-2.6-9.3-5.4-13.5-8.8c-2.1-1.7-4-3.6-5.8-5.6c-1.8-2-3.3-4.3-4.3-6.8c-1.1-2.5-1.6-5.3-1.4-8c0.2-2.7,1.1-5.4,2.4-7.7c2.7-4.8,6.7-8.5,11-11.7c8.6-6.4,18.4-10.9,28.3-15c9.9-4,20.1-7.3,30.4-10.3c-10.2,3.1-20.4,6.5-30.3,10.5c-9.8,4.1-19.6,8.7-28.1,15.1c-4.2,3.2-8.2,6.9-10.7,11.6c-1.2,2.3-2.1,4.8-2.3,7.5c-0.1,2.6,0.4,5.2,1.4,7.6c2.1,4.8,5.9,8.7,10,12.1c4.1,3.3,8.7,6.1,13.4,8.6c9.4,5,19.4,8.9,29.4,12.4c10.1,3.5,20.4,6.4,30.7,9.1c20.7,5.3,41.6,9.5,62.7,13.2c21,3.6,42.2,6.6,63.4,9.2c21.2,2.6,42.5,4.8,63.7,6.6c42.6,3.7,85.2,6,127.9,7.4L409.9,145.6z"/>
|
|
4
|
-
<path fill="currentColor" d="M977.1,11.6c13.8,4.1,27.4,8.8,40.4,15.2c6.4,3.2,12.7,6.9,18.3,11.5c2.7,2.4,5.3,5,7.3,8c2,3,3.3,6.6,3.3,10.3c0,3.7-1.4,7.2-3.3,10.3c-2,3.1-4.5,5.7-7.3,8.1c-2.7,2.4-5.7,4.4-8.8,6.3c-1.6,0.9-3.1,1.9-4.7,2.7l-2.4,1.3l-2.4,1.2C1004.5,93,990.8,97.8,977,102c-6.9,2.1-13.8,4-20.8,5.8c-7,1.8-14,3.5-21,5c-14.1,3.1-28.2,5.9-42.4,8.3c-28.4,4.9-57,8.8-85.6,12c-57.3,6.4-114.8,10.2-172.4,12.2c-57.6,2-115.2,2.3-172.9,0.8l0.1-4c57.5,1.8,115.1,1.9,172.6,0.2c57.5-1.7,115-5.2,172.3-11.2c28.6-3.1,57.2-6.7,85.6-11.5c14.2-2.4,28.3-5,42.4-8.1c7-1.5,14-3.1,21-4.9c7-1.7,13.9-3.6,20.8-5.7c13.8-4.1,27.4-8.8,40.3-15.2l2.4-1.2l2.4-1.3c1.6-0.8,3.1-1.8,4.7-2.7c3-1.9,6-3.9,8.7-6.2c2.7-2.3,5.2-4.9,7.2-7.9c1.9-3,3.2-6.4,3.3-10c0-3.6-1.2-7-3.1-10c-1.9-3-4.4-5.6-7.1-8c-5.5-4.7-11.7-8.3-18.1-11.6C1004.5,20.6,990.8,15.8,977.1,11.6z"/>
|
|
5
|
-
<g transform="translate(415, 136)">
|
|
6
|
-
<path fill="currentColor" d="M18.1,11.2c-1.8,0-2.8-1.2-2.8-3V8c0.8-0.4,1.7-0.6,2.8-0.6c1.5,0,2.5,0.6,2.5,1.7C20.6,10.2,19.8,11.2,18.1,11.2L18.1,11.2z M18.3,5.7c-1.1,0-2,0.3-2.8,0.7c0.3-1.6,1.5-2.6,3.7-2.6c1.1,0,2.3,0.3,3.1,0.5V2.6c-0.8-0.3-1.9-0.5-3.1-0.5c-4.2,0-6.2,2.1-6.2,5.8c0,3.2,1.8,4.9,5.1,4.9c3.3,0,5-1.7,5-3.6C23,7,21.3,5.7,18.3,5.7L18.3,5.7z"/>
|
|
7
|
-
<path fill="currentColor" d="M39.3,1.8c0.9,0,1.6,0.7,1.6,1.5c0,0.8-0.7,1.6-1.6,1.6c-0.8,0-1.6-0.7-1.6-1.6C37.8,2.5,38.5,1.8,39.3,1.8L39.3,1.8z M39.3,6.3c1.7,0,3.1-1.3,3.1-3c0-1.6-1.4-3-3.1-3c-1.7,0-3.1,1.3-3.1,3C36.2,5,37.6,6.3,39.3,6.3L39.3,6.3z"/>
|
|
8
|
-
<path fill="currentColor" d="M30.3,3.8c2.1,0,2.9,1.4,2.9,3.6c0,2.2-0.8,3.6-2.9,3.6c-2.1,0-2.9-1.5-2.9-3.6C27.4,5.3,28.1,3.8,30.3,3.8L30.3,3.8z M30.2,12.8c3.9,0,5.2-2.6,5.2-5.4c0-2.8-1.3-5.3-5.2-5.3c-3.9,0-5.3,2.6-5.3,5.4C25,10.3,26.3,12.8,30.2,12.8L30.2,12.8z"/>
|
|
9
|
-
<path fill="currentColor" d="M10.9,9.7c0-1.1-0.8-2-2.5-2.5c1.3-0.5,1.9-1.3,1.9-2.3c0-1.7-1.7-2.8-4.6-2.8c-1.5,0-2.7,0.3-3.6,0.8v1.7c0.9-0.4,2.3-0.7,3.4-0.7C7,3.9,8,4.4,8,5.1c0,0.8-0.7,1.3-2.4,1.3H4.3v1.6h1.3c2,0,2.9,0.8,2.9,1.6c0,0.8-1,1.5-2.8,1.5c-1.5,0-2.8-0.3-3.7-0.6v1.7c0.9,0.3,2.1,0.6,3.8,0.6C9.2,12.8,10.9,11.4,10.9,9.7"/>
|
|
10
|
-
</g>
|
|
11
|
-
</svg>
|
|
12
|
-
`,Fi=e=>{const t=document.createElement("div");return t.innerHTML=Wi,t.style.bottom=`${e}%`,t.className="cloudimage-360-view-360-circle",t},Ni=`
|
|
13
|
-
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" fill="none" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
|
|
14
|
-
<!-- Circular arrows -->
|
|
15
|
-
<path d="M 75 50 A 25 25 0 1 1 50 25" stroke="currentColor" stroke-width="3"/>
|
|
16
|
-
<path d="M 25 50 A 25 25 0 1 1 50 75" stroke="currentColor" stroke-width="3"/>
|
|
17
|
-
<!-- Arrow heads -->
|
|
18
|
-
<path d="M 50 25 L 56 31 M 50 25 L 56 19" stroke="currentColor" stroke-width="3"/>
|
|
19
|
-
<path d="M 50 75 L 44 69 M 50 75 L 44 81" stroke="currentColor" stroke-width="3"/>
|
|
20
|
-
<!-- 360 text -->
|
|
21
|
-
<text x="50" y="54" text-anchor="middle" font-size="16" font-weight="600" fill="currentColor" stroke="none" font-family="system-ui, -apple-system, sans-serif">360°</text>
|
|
22
|
-
</svg>
|
|
23
|
-
`,Vi=e=>{const t=document.createElement("div");return t.className="cloudimage-initial-icon",t.setAttribute("aria-label","360 degree view - drag to rotate"),e?(t.style.backgroundImage=`url('${e}')`,t.style.backgroundPosition="50% 50%",t.style.backgroundSize="contain",t.style.backgroundRepeat="no-repeat"):t.innerHTML=Ni,t},ji=(e,t)=>{const{width:i,height:s}=t,o=document.createElement("canvas");return o.width=i,o.height=s,o.style.width="100%",o.style.height="auto",e.appendChild(o),o},$i=()=>{const e=document.createElement("button");return e.className="cloudimage-360-button cloudimage-360-close-icon",e.setAttribute("aria-label","Close fullscreen"),e.setAttribute("type","button"),e.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M18 6 6 18"/><path d="m6 6 12 12"/></svg>',e},zi=()=>{const e=document.createElement("button");return e.className="cloudimage-360-button cloudimage-360-fullscreen-button",e.setAttribute("aria-label","View fullscreen"),e.setAttribute("type","button"),e.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><polyline points="15 3 21 3 21 9"/><polyline points="9 21 3 21 3 15"/><line x1="21" x2="14" y1="3" y2="10"/><line x1="3" x2="10" y1="21" y2="14"/></svg>',e},ge=e=>{const t=document.createElement("div");return t.className="cloudimage-360-icons-container",e.appendChild(t),t},Gi=e=>{const t=document.createElement("div");return t.className="cloudimage-360-inner-box",t.setAttribute("role","img"),t.setAttribute("aria-label","360 degree product view. Use mouse drag or arrow keys to rotate."),e.appendChild(t),t},Ui=()=>{const e=document.createElement("button");return e.className="cloudimage-360-button cloudimage-360-magnifier-button",e.setAttribute("aria-label","Magnify image"),e.setAttribute("type","button"),e.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="11" cy="11" r="8"/><path d="m21 21-4.3-4.3"/><path d="M11 8v6"/><path d="M8 11h6"/></svg>',e},Ki=e=>{const t=document.createElement("div");t.className="cloudimage-initial-icon";const i=document.createElement("span");return i.className="percentage",i.innerText="0%",t.appendChild(i),e.appendChild(t),t},_i=e=>{const t=document.createElement("div");t.className="cloudimage-360-fullscreen-modal";const i=e.cloneNode();return i.style.width="100%",i.style.maxWidth="100%",i.style.height="100vh",i.style.maxHeight="100%",t.appendChild(i),window.document.body.appendChild(t),i},Jt=(e,t)=>{const i=e.querySelector(t);i&&i.parentNode.removeChild(i)},Ji=()=>{const e=document.createElement("div");return e.className="cloudimage-loading-spinner",e},qi=()=>{const e=document.createElement("div");return e.className="cloudimage-360-transition-overlay",e},Qi=e=>{const t=document.createElement("div");return t.className="cloudimage-360-hotspot-container",e.appendChild(t),t},ts=e=>{const t=document.createElement("div");return t.className="cloudimage-360-sr-only",t.setAttribute("role","status"),t.setAttribute("aria-live","polite"),t.setAttribute("aria-atomic","true"),e.appendChild(t),t},es=(e,t)=>{e&&(e.textContent="",setTimeout(()=>{e.textContent=t},50))},We={drag:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M18 11V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2"/><path d="M14 10V4a2 2 0 0 0-2-2a2 2 0 0 0-2 2v2"/><path d="M10 10.5V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2v8"/><path d="M18 8a2 2 0 1 1 4 0v6a8 8 0 0 1-8 8h-2c-2.8 0-4.5-.86-5.99-2.34l-3.6-3.6a2 2 0 0 1 2.83-2.82L7 15"/></svg>',swipe:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m18 16 4-4-4-4"/><path d="m6 8-4 4 4 4"/><path d="M8 12h8"/></svg>',click:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m9 9 5 12 1.8-5.2L21 14Z"/><path d="M7.2 2.2 8 5.1"/><path d="m5.1 8-2.9-.8"/><path d="M14 4.1 12 6"/><path d="m6 12-1.9 2"/></svg>',pinch:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M6 6l4 4"/><path d="M18 6l-4 4"/><path d="M6 18l4-4"/><path d="M18 18l-4-4"/><circle cx="12" cy="12" r="2"/></svg>',keys:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect width="20" height="16" x="2" y="4" rx="2"/><path d="m9 10 3 3 3-3"/></svg>',fullscreen:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><polyline points="15 3 21 3 21 9"/><polyline points="9 21 3 21 3 15"/><line x1="21" x2="14" y1="3" y2="10"/><line x1="3" x2="10" y1="21" y2="14"/></svg>'},is={drag:"Drag to rotate",swipe:"Swipe to rotate",click:"Click to zoom",pinch:"Pinch to zoom",keys:"Use arrow keys",fullscreen:"Click for fullscreen"},ss=e=>{const t=document.createElement("div");return t.className="cloudimage-360-hint-item",t.innerHTML=`
|
|
24
|
-
${We[e]}
|
|
25
|
-
<span>${is[e]}</span>
|
|
26
|
-
`,t},ye=(e,t=[])=>{if(!t||t.length===0)return null;const i=document.createElement("div");i.className="cloudimage-360-hints-overlay",i.setAttribute("role","tooltip"),i.setAttribute("aria-label","Interaction hints");const s=document.createElement("div");return s.className="cloudimage-360-hints-container",t.forEach(o=>{We[o]&&s.appendChild(ss(o))}),i.appendChild(s),e.appendChild(i),i},be=(e,t)=>t?["swipe"]:["drag","click"],we=e=>{e&&e.classList.add("visible")},os=e=>{e&&(e.classList.remove("visible"),e.classList.add("hiding"),setTimeout(()=>{e.classList.remove("hiding")},300))},ns=e=>{if(!e||typeof e!="object")return null;const t=Object.keys(e).map(s=>parseInt(s,10)).filter(s=>!isNaN(s)).sort((s,o)=>s-o);if(t.length===0)return null;const i=Math.floor(t.length/2);return t[i]},rs=e=>{const t=[];return!e||!Array.isArray(e)||e.forEach((i,s)=>{const o=ns(i.positions);o!==null&&t.push({id:i.id||`hotspot-${s}`,frame:o,label:i.label||null})}),t},as=400,ls=(e,t,i,s)=>{const o=document.createElement("button");o.className="cloudimage-360-hotspot-timeline-dot",o.setAttribute("type","button"),o.setAttribute("aria-label",s||`Go to hotspot at frame ${t+1}`),o.setAttribute("data-frame",t.toString()),o.setAttribute("data-hotspot-id",e);const n=i>1?t/(i-1)*100:0;if(o.style.left=`${n}%`,s){const l=document.createElement("span");l.className="cloudimage-360-hotspot-timeline-tooltip",l.textContent=s,o.appendChild(l);let r=null;o.addEventListener("mouseenter",()=>{r=setTimeout(()=>{l.classList.add("visible")},as)}),o.addEventListener("mouseleave",()=>{r&&(clearTimeout(r),r=null),l.classList.remove("visible")}),o.addEventListener("click",()=>{r&&(clearTimeout(r),r=null),l.classList.remove("visible")})}return o},cs=(e,t,i)=>{const s=rs(i);if(s.length===0)return null;const o=document.createElement("div");o.className="cloudimage-360-hotspot-timeline",o.setAttribute("role","navigation"),o.setAttribute("aria-label","Hotspot timeline navigation");const n=document.createElement("div");n.className="cloudimage-360-hotspot-timeline-track";const l=document.createElement("div");return l.className="cloudimage-360-hotspot-timeline-indicator",s.forEach(({id:r,frame:a,label:c})=>{const h=ls(r,a,t,c);n.appendChild(h)}),n.appendChild(l),o.appendChild(n),e.appendChild(o),{element:o,indicator:l,hotspotFrames:s}},hs=(e,t,i)=>{if(!e)return;const s=i>1?t/(i-1)*100:0;e.style.left=`${s}%`},ds=e=>{e&&e.classList.add("visible")},us=e=>{e&&e.classList.remove("visible")},qt=(e,t=[])=>{if(!e)return t;try{return JSON.parse(e)}catch(i){return console.warn("CloudImage 360: Failed to parse JSON:",i.message),t}},ps=(e,t)=>{const[i,s]=e.split("?");if(!s)return e;const o=new RegExp(`^${t}=|&${t}=`),n=s.split("&").filter(l=>!o.test(l)).join("&");return n?`${i}?${n}`:i},fs=e=>{const t=ps(e,"width"),i=t.includes("?")?"&":"?";return`${t}${i}width=${150*devicePixelRatio}`},ms=e=>{const t={root:null,rootMargin:"0px",threshold:.1},i=o=>{const n=o.getAttribute("data-src");n&&(o.src=n)};new IntersectionObserver((o,n)=>{o.forEach(l=>{l.isIntersecting&&(i(l.target),n.unobserve(l.target))})},t).observe(e)},vs=(e,t)=>{const i=Be(1,t);return e.replace("{index}",i)},gs=(e,t)=>{const[i]=e,s=/(https?):\/\//i.test(i);return Et({...t,folder:s?"":t.folder,filename:i})},ys=(e,t)=>{const{imageList:i,indexZeroBase:s}=t;if(i.length){const o=qt(i,null);if(o)return gs(o,t)}return vs(e,s)},Ie=(e,t,i)=>{const s=new Image;return s.setAttribute(t?"data-src":"src",e),s.className=i,s.style.cssText=`
|
|
27
|
-
position: ${t?"absolute":"static"};
|
|
28
|
-
width: 100%;
|
|
29
|
-
inset: 0;
|
|
30
|
-
height: 100%;
|
|
31
|
-
object-fit: contain;
|
|
32
|
-
object-position: center;
|
|
33
|
-
filter: blur(10px);
|
|
34
|
-
`,s},xe=(e,t,i)=>{const{innerBox:s,imageList:o,lazyload:n}=t||{},[l]=o,r=l||ys(e,t),a=fs(r),c=Ie(a,n,"cloudimage-lazy"),h=Ie(a,!1,"cloudimage-360-placeholder"),p=f=>{Jt(s,".cloudimage-lazy"),i&&i({event:f,width:c.width,height:c.height,naturalWidth:c.naturalWidth,naturalHeight:c.naturalHeight,src:a})};c.onload=p,s.appendChild(c),s.appendChild(h),ms(c)},bs=(e,t,i)=>{const s=new Image;s.src=e,s.onload=o=>{t&&t({event:o,width:s.width,height:s.height,naturalWidth:s.naturalWidth,naturalHeight:s.naturalHeight,src:e})},s.onerror=o=>{const n=new Error(`Failed to load image: ${e}`);n.url=e,n.event=o,i?i(n):console.error(n.message)}},ws=(e,t)=>{const i=t.getBoundingClientRect(),s=e.touches?e.touches[0].clientX:e.clientX,o=e.touches?e.touches[0].clientY:e.clientY;return{x:s-i.left,y:o-i.top}},_t=(e,t,i)=>{const{container:s,w:o,h:n,zoom:l,bw:r,offsetX:a,offsetY:c}=t,h=ws(e,s);let p=h.x,f=h.y;p=Math.max(o/l,Math.min(p,s.offsetWidth-o/l)),f=Math.max(n/l,Math.min(f,s.offsetHeight-n/l)),i.style.left=`${p-o}px`,i.style.top=`${f-n}px`;const u=(p-a)*l-o+r,I=(f-c)*l-n+r;i.style.backgroundPosition=`-${u}px -${I}px`},Is=(e,t,i,s,o,n)=>{const{x:l=0,y:r=0}=i||{},a=(t.offsetWidth-l*2)*n,c=(t.offsetHeight-r*2)*n;if(!o)return;o.setAttribute("class","cloudimage-360-img-magnifier-glass"),t.prepend(o),o.style.backgroundImage=`url('${s.src}')`,o.style.backgroundSize=`${a}px ${c}px`;const h=3,p=o.offsetWidth/2,f=o.offsetHeight/2,u={container:t,w:p,h:f,zoom:n,bw:h,offsetX:l,offsetY:r};_t(e,u,o);const I=v=>{_t(v,u,o)},g=v=>{v.preventDefault(),_t(v,u,o)};o.addEventListener("mousemove",I),t.addEventListener("mousemove",I),t.addEventListener("touchmove",g)},xs=(e,t,i)=>{const{clientX:s,clientY:o}=e,n=t.getBoundingClientRect(),l=t.width/(n.width*i),r=t.height/(n.height*i),a=(s-n.left)*l,c=(o-n.top)*r;return{offsetX:a,offsetY:c}},Ce=(e,{bottom:t,top:i})=>{e?t():i()},Oe=(e,{left:t,right:i})=>{e?t():i()},Cs=({autoplayBehavior:e,spinY:t,reversed:i,loopTriggers:s})=>{switch(e){case M.SPIN_XY:case M.SPIN_YX:t?Ce(i,s):Oe(i,s);break;case M.SPIN_Y:Ce(i,s);break;case M.SPIN_X:default:Oe(i,s)}},Os=({autoplayBehavior:e,activeImageX:t,activeImageY:i,amountX:s,amountY:o,autoplayReverse:n})=>{const l=(r,a)=>{const c=a-1;return n?r===0:r===c};switch(e){case M.SPIN_XY:case M.SPIN_Y:return l(i,o);case M.SPIN_X:case M.SPIN_YX:default:return l(t,s)}},Es=({autoplayBehavior:e,activeImageX:t,activeImageY:i,amountX:s,amountY:o,autoplayReverse:n,spinDirection:l})=>{const r=t===(n?0:s-1),a=i===(n?0:o-1);return e===M.SPIN_XY||e===M.SPIN_YX?l==="x"&&r||l==="y"&&a:!1},Ss=(e,t,i)=>{if(!i)return"x";if(!t)return"y";switch(e){case M.SPIN_XY:return"x";case M.SPIN_YX:return"y";case M.SPIN_Y:return"y";case M.SPIN_X:default:return"x"}},As=e=>e==="x"?"y":"x",Ee=(e,t)=>{const i=[...xi];return t?[...i,...Ci].includes(e):i.includes(e)},Se=({deltaX:e,deltaY:t,reversed:i,allowSpinX:s,allowSpinY:o,threshold:n=0})=>{const l=s&&!o||o&&!s?0:n,r=Math.abs(e),a=Math.abs(t);return s&&r-l>a?i?e>0?"left":"right":e>0?"right":"left":o&&a-l>r?i?t>0?"up":"down":t>0?"down":"up":null},Ls=()=>"ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0,ks=(e,t=150)=>{let i;return function(...s){clearTimeout(i),i=setTimeout(()=>{e.apply(this,s)},t)}},Fe="KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO2NvbnN0IHY9KHQsYSxlKT0+e2NvbnN0IHM9dC9lLG49YS9lO3JldHVybnt6b29tZWRXaWR0aDpzLHpvb21lZEhlaWdodDpufX0sej0oe3BvaW50ZXJYOnQscG9pbnRlclk6YSxpbWFnZURhdGE6ZSx6b29tZWRXaWR0aDpzLHpvb21lZEhlaWdodDpuLGRyYXdXaWR0aDppLGRyYXdIZWlnaHQ6Y30pPT57Y29uc3R7bmF0dXJhbFdpZHRoOmcsbmF0dXJhbEhlaWdodDp1fT1lO2xldCBmPXQvaSpnLXMvMixtPWEvYyp1LW4vMjtjb25zdCB4PU1hdGgubWF4KDAsZy1zKSxPPU1hdGgubWF4KDAsdS1uKTtyZXR1cm4gZj1NYXRoLm1heCgwLE1hdGgubWluKGYseCkpLG09TWF0aC5tYXgoMCxNYXRoLm1pbihtLE8pKSx7em9vbU9mZnNldFg6Zix6b29tT2Zmc2V0WTptfX07bGV0IG8saCxyLGQsbCx3O3NlbGYub25tZXNzYWdlPWFzeW5jIHQ9Pntjb25zdHthY3Rpb246YSxvZmZzY3JlZW46ZSxkZXZpY2VQaXhlbFJhdGlvOnMsaW1hZ2VEYXRhOm4sem9vbVNjYWxlOmkscG9pbnRlclg6Yyxwb2ludGVyWTpnLGltYWdlQXNwZWN0UmF0aW86dSxjb250YWluZXJXaWR0aDpmLGNvbnRhaW5lckhlaWdodDptfT10LmRhdGE7c3dpdGNoKGEpe2Nhc2UiaW5pdENhbnZhcyI6QyhlLHMpO2JyZWFrO2Nhc2UiYWRhcHRDYW52YXNTaXplIjpwKHUsZixtKTticmVhaztjYXNlImRyYXdJbWFnZU9uQ2FudmFzIjpJKG4saSxjLGcpO2JyZWFrfX07Y29uc3QgQz0odCxhKT0+e289dCxoPW8uZ2V0Q29udGV4dCgiMmQiKSxyPWF9LHA9KHQsYSxlKT0+e2NvbnN0IHM9YS9lO3c9dD5zLG8ud2lkdGg9YSpyLG8uaGVpZ2h0PWUqcixoLnNjYWxlKHIsciksdz8oZD1hLGw9YS90KToobD1lLGQ9ZSp0KSxoLmltYWdlU21vb3RoaW5nRW5hYmxlZD0hMCxoLmltYWdlU21vb3RoaW5nUXVhbGl0eT0iaGlnaCJ9LEk9KHQ9e30sYT0xLGU9MCxzPTApPT57Y29uc3R7Yml0bWFwSW1hZ2U6bn09dDtpZighb3x8IW4pcmV0dXJuO2xldCBpLGM7aWYodz8oaT0wLGM9KG8uaGVpZ2h0L3ItbCkvMik6KGk9KG8ud2lkdGgvci1kKS8yLGM9MCksaC5jbGVhclJlY3QoMCwwLG8ud2lkdGgsby5oZWlnaHQpLGEhPT0xKXtjb25zdHtuYXR1cmFsV2lkdGg6ZyxuYXR1cmFsSGVpZ2h0OnV9PXQse3pvb21lZFdpZHRoOmYsem9vbWVkSGVpZ2h0Om19PXYoZyx1LGEpLHt6b29tT2Zmc2V0WDp4LHpvb21PZmZzZXRZOk99PXooe3BvaW50ZXJYOmUscG9pbnRlclk6cyxpbWFnZURhdGE6dCx6b29tZWRXaWR0aDpmLHpvb21lZEhlaWdodDptLGRyYXdXaWR0aDpkLGRyYXdIZWlnaHQ6bH0pO2guZHJhd0ltYWdlKG4seCxPLGYsbSxpLGMsZCxsKX1lbHNlIGguZHJhd0ltYWdlKG4saSxjLGQsbCl9fSkoKTsKLy8jIHNvdXJjZU1hcHBpbmdVUkw9Y2FudmFzLndvcmtlci1DZzBma3BEMS5qcy5tYXAK",Ts=e=>Uint8Array.from(atob(e),t=>t.charCodeAt(0)),Ae=typeof self<"u"&&self.Blob&&new Blob([Ts(Fe)],{type:"text/javascript;charset=utf-8"});function Ys(e){let t;try{if(t=Ae&&(self.URL||self.webkitURL).createObjectURL(Ae),!t)throw"";const i=new Worker(t,{name:e==null?void 0:e.name});return i.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(t)}),i}catch{return new Worker("data:text/javascript;base64,"+Fe,{name:e==null?void 0:e.name})}finally{t&&(self.URL||self.webkitURL).revokeObjectURL(t)}}const Xs=new Set(["p","span","div","br","hr","strong","em","b","i","u","s","h1","h2","h3","h4","h5","h6","ul","ol","li","a","img","button","table","thead","tbody","tr","th","td","blockquote","pre","code","label","input","select","option","textarea","svg","path","circle","rect","line","polyline","polygon","ellipse","g","text","tspan","defs","use","symbol","clippath","mask","lineargradient","radialgradient","stop"]),Le={a:["href","title","target","rel"],img:["src","alt","title","width","height"],button:["type","disabled","name","value"],input:["type","name","value","placeholder","disabled","readonly","checked","min","max","step"],select:["name","disabled","multiple"],option:["value","disabled","selected"],textarea:["name","placeholder","disabled","readonly","rows","cols"],label:["for"],svg:["viewbox","width","height","fill","stroke","xmlns","preserveaspectratio"],path:["d","fill","stroke","stroke-width","stroke-linecap","stroke-linejoin","transform"],circle:["cx","cy","r","fill","stroke","stroke-width"],rect:["x","y","width","height","rx","ry","fill","stroke","stroke-width"],line:["x1","y1","x2","y2","stroke","stroke-width"],polyline:["points","fill","stroke","stroke-width"],polygon:["points","fill","stroke","stroke-width"],ellipse:["cx","cy","rx","ry","fill","stroke","stroke-width"],g:["transform","fill","stroke"],text:["x","y","dx","dy","text-anchor","fill","font-size","font-family","font-weight"],tspan:["x","y","dx","dy"],use:["href","xlink:href","x","y","width","height"],lineargradient:["id","x1","y1","x2","y2","gradientunits"],radialgradient:["id","cx","cy","r","fx","fy","gradientunits"],stop:["offset","stop-color","stop-opacity"],clippath:["id"],mask:["id"],"*":["class","id","style"]},Ps=[/javascript:/gi,/vbscript:/gi,/data:/gi,/on\w+\s*=/gi],Rs=e=>{if(typeof e!="string")return"";const t=document.createElement("template");t.innerHTML=e;const i=s=>{if(Array.from(s.childNodes).forEach(i),s.nodeType===Node.ELEMENT_NODE){const n=s.tagName.toLowerCase();if(!Xs.has(n)){if(n==="script"||n==="style"){s.remove();return}const a=document.createTextNode(s.textContent);s.parentNode.replaceChild(a,s);return}const l=[...Le[n]||[],...Le["*"]||[]];if(Array.from(s.attributes).forEach(a=>{const c=a.name.toLowerCase();if(c.startsWith("on")){s.removeAttribute(a.name);return}if(!l.includes(c)){s.removeAttribute(a.name);return}let h=a.value;Ps.forEach(p=>{p.test(h)&&s.removeAttribute(a.name)})}),n==="a"){const a=s.getAttribute("href");a&&(/^(https?:|mailto:|tel:|#|\/)/i.test(a.trim())||s.removeAttribute("href")),s.getAttribute("target")==="_blank"&&s.setAttribute("rel","noopener noreferrer")}if(n==="img"){const a=s.getAttribute("src");a&&(/^(https?:|\/|data:image\/)/i.test(a.trim())||s.removeAttribute("src"))}}};return i(t.content),t.innerHTML},Ms=e=>e==="x"?P.X:P.Y,Hs=(e,t,i)=>e.filter(s=>Ms(s.orientation)===i&&t in s.positions),Ds=(e,t)=>{const i=document.createElement("button");return i.id=e,i.className="cloudimage-360-hotspot",i.dataset.hotspotId=e,i.setAttribute("type","button"),i.setAttribute("aria-label",t||`Hotspot ${e}`),i.setAttribute("aria-haspopup","true"),i.setAttribute("aria-expanded","false"),i},Zs=e=>{const t=Object.entries(e).sort(([n],[l])=>Number(n)-Number(l));let i=null,s=null;const o={};for(const[n,l]of t)if(!l)o[n]={x:i,y:s};else{const{x:r,y:a}=l;r!=null&&(i=r),a!=null&&(s=a),o[n]={x:r||i,y:a||s}}return o},Bs=e=>[{name:"offset",options:{offset:[0,10]}},{name:"preventOverflow",options:{boundary:e}}],Ws=(e,t)=>{const i=document.createElement("div");return i.className="cloudimage-360-popper",i.id=`cloudimage-360-popper-${t}`,i.dataset.popperId=t,i.setAttribute("role","tooltip"),i.setAttribute("aria-hidden","false"),typeof e=="string"&&/<\/?[a-z][\s\S]*>/i.test(e)?i.innerHTML=Rs(e):i.textContent=e,document.body.appendChild(i),i},Fs=e=>{const t=[...e];return t.forEach((i,s)=>{const o={...Zs(i.positions)};t[s].initialPositions=o,t[s].positions=o}),t},Ns=({newWidth:e,newHeight:t,initialContainerSize:i,imageAspectRatio:s,hotspotsConfig:o})=>{const[n,l]=i;let r=e,a=t,c=0,h=0;const p=e/t;s>p?(a=e/s,h=(t-a)/2):(r=t*s,c=(e-r)/2);const u=r/n,I=a/l;return o.map(g=>{const v={};return Object.entries(g.initialPositions).forEach(([m,b])=>{v[m]={x:b.x*u+c,y:b.y*I+h}}),{...g,positions:v}})};var H="top",F="bottom",N="right",D="left",ee="auto",Tt=[H,F,N,D],ut="start",Lt="end",Vs="clippingParents",Ne="viewport",Ot="popper",js="reference",ke=Tt.reduce(function(e,t){return e.concat([t+"-"+ut,t+"-"+Lt])},[]),Ve=[].concat(Tt,[ee]).reduce(function(e,t){return e.concat([t,t+"-"+ut,t+"-"+Lt])},[]),$s="beforeRead",zs="read",Gs="afterRead",Us="beforeMain",Ks="main",_s="afterMain",Js="beforeWrite",qs="write",Qs="afterWrite",to=[$s,zs,Gs,Us,Ks,_s,Js,qs,Qs];function $(e){return e?(e.nodeName||"").toLowerCase():null}function B(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function nt(e){var t=B(e).Element;return e instanceof t||e instanceof Element}function W(e){var t=B(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function ie(e){if(typeof ShadowRoot>"u")return!1;var t=B(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function eo(e){var t=e.state;Object.keys(t.elements).forEach(function(i){var s=t.styles[i]||{},o=t.attributes[i]||{},n=t.elements[i];!W(n)||!$(n)||(Object.assign(n.style,s),Object.keys(o).forEach(function(l){var r=o[l];r===!1?n.removeAttribute(l):n.setAttribute(l,r===!0?"":r)}))})}function io(e){var t=e.state,i={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,i.popper),t.styles=i,t.elements.arrow&&Object.assign(t.elements.arrow.style,i.arrow),function(){Object.keys(t.elements).forEach(function(s){var o=t.elements[s],n=t.attributes[s]||{},l=Object.keys(t.styles.hasOwnProperty(s)?t.styles[s]:i[s]),r=l.reduce(function(a,c){return a[c]="",a},{});!W(o)||!$(o)||(Object.assign(o.style,r),Object.keys(n).forEach(function(a){o.removeAttribute(a)}))})}}const so={name:"applyStyles",enabled:!0,phase:"write",fn:eo,effect:io,requires:["computeStyles"]};function j(e){return e.split("-")[0]}var ot=Math.max,Wt=Math.min,pt=Math.round;function Qt(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function je(){return!/^((?!chrome|android).)*safari/i.test(Qt())}function ft(e,t,i){t===void 0&&(t=!1),i===void 0&&(i=!1);var s=e.getBoundingClientRect(),o=1,n=1;t&&W(e)&&(o=e.offsetWidth>0&&pt(s.width)/e.offsetWidth||1,n=e.offsetHeight>0&&pt(s.height)/e.offsetHeight||1);var l=nt(e)?B(e):window,r=l.visualViewport,a=!je()&&i,c=(s.left+(a&&r?r.offsetLeft:0))/o,h=(s.top+(a&&r?r.offsetTop:0))/n,p=s.width/o,f=s.height/n;return{width:p,height:f,top:h,right:c+p,bottom:h+f,left:c,x:c,y:h}}function se(e){var t=ft(e),i=e.offsetWidth,s=e.offsetHeight;return Math.abs(t.width-i)<=1&&(i=t.width),Math.abs(t.height-s)<=1&&(s=t.height),{x:e.offsetLeft,y:e.offsetTop,width:i,height:s}}function $e(e,t){var i=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(i&&ie(i)){var s=t;do{if(s&&e.isSameNode(s))return!0;s=s.parentNode||s.host}while(s)}return!1}function J(e){return B(e).getComputedStyle(e)}function oo(e){return["table","td","th"].indexOf($(e))>=0}function Q(e){return((nt(e)?e.ownerDocument:e.document)||window.document).documentElement}function Nt(e){return $(e)==="html"?e:e.assignedSlot||e.parentNode||(ie(e)?e.host:null)||Q(e)}function Te(e){return!W(e)||J(e).position==="fixed"?null:e.offsetParent}function no(e){var t=/firefox/i.test(Qt()),i=/Trident/i.test(Qt());if(i&&W(e)){var s=J(e);if(s.position==="fixed")return null}var o=Nt(e);for(ie(o)&&(o=o.host);W(o)&&["html","body"].indexOf($(o))<0;){var n=J(o);if(n.transform!=="none"||n.perspective!=="none"||n.contain==="paint"||["transform","perspective"].indexOf(n.willChange)!==-1||t&&n.willChange==="filter"||t&&n.filter&&n.filter!=="none")return o;o=o.parentNode}return null}function Yt(e){for(var t=B(e),i=Te(e);i&&oo(i)&&J(i).position==="static";)i=Te(i);return i&&($(i)==="html"||$(i)==="body"&&J(i).position==="static")?t:i||no(e)||t}function oe(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function St(e,t,i){return ot(e,Wt(t,i))}function ro(e,t,i){var s=St(e,t,i);return s>i?i:s}function ze(){return{top:0,right:0,bottom:0,left:0}}function Ge(e){return Object.assign({},ze(),e)}function Ue(e,t){return t.reduce(function(i,s){return i[s]=e,i},{})}var ao=function(t,i){return t=typeof t=="function"?t(Object.assign({},i.rects,{placement:i.placement})):t,Ge(typeof t!="number"?t:Ue(t,Tt))};function lo(e){var t,i=e.state,s=e.name,o=e.options,n=i.elements.arrow,l=i.modifiersData.popperOffsets,r=j(i.placement),a=oe(r),c=[D,N].indexOf(r)>=0,h=c?"height":"width";if(!(!n||!l)){var p=ao(o.padding,i),f=se(n),u=a==="y"?H:D,I=a==="y"?F:N,g=i.rects.reference[h]+i.rects.reference[a]-l[a]-i.rects.popper[h],v=l[a]-i.rects.reference[a],m=Yt(n),b=m?a==="y"?m.clientHeight||0:m.clientWidth||0:0,x=g/2-v/2,w=p[u],C=b-f[h]-p[I],y=b/2-f[h]/2+x,O=St(w,y,C),S=a;i.modifiersData[s]=(t={},t[S]=O,t.centerOffset=O-y,t)}}function co(e){var t=e.state,i=e.options,s=i.element,o=s===void 0?"[data-popper-arrow]":s;o!=null&&(typeof o=="string"&&(o=t.elements.popper.querySelector(o),!o)||$e(t.elements.popper,o)&&(t.elements.arrow=o))}const ho={name:"arrow",enabled:!0,phase:"main",fn:lo,effect:co,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function mt(e){return e.split("-")[1]}var uo={top:"auto",right:"auto",bottom:"auto",left:"auto"};function po(e,t){var i=e.x,s=e.y,o=t.devicePixelRatio||1;return{x:pt(i*o)/o||0,y:pt(s*o)/o||0}}function Ye(e){var t,i=e.popper,s=e.popperRect,o=e.placement,n=e.variation,l=e.offsets,r=e.position,a=e.gpuAcceleration,c=e.adaptive,h=e.roundOffsets,p=e.isFixed,f=l.x,u=f===void 0?0:f,I=l.y,g=I===void 0?0:I,v=typeof h=="function"?h({x:u,y:g}):{x:u,y:g};u=v.x,g=v.y;var m=l.hasOwnProperty("x"),b=l.hasOwnProperty("y"),x=D,w=H,C=window;if(c){var y=Yt(i),O="clientHeight",S="clientWidth";if(y===B(i)&&(y=Q(i),J(y).position!=="static"&&r==="absolute"&&(O="scrollHeight",S="scrollWidth")),y=y,o===H||(o===D||o===N)&&n===Lt){w=F;var E=p&&y===C&&C.visualViewport?C.visualViewport.height:y[O];g-=E-s.height,g*=a?1:-1}if(o===D||(o===H||o===F)&&n===Lt){x=N;var A=p&&y===C&&C.visualViewport?C.visualViewport.width:y[S];u-=A-s.width,u*=a?1:-1}}var k=Object.assign({position:r},c&&uo),R=h===!0?po({x:u,y:g},B(i)):{x:u,y:g};if(u=R.x,g=R.y,a){var T;return Object.assign({},k,(T={},T[w]=b?"0":"",T[x]=m?"0":"",T.transform=(C.devicePixelRatio||1)<=1?"translate("+u+"px, "+g+"px)":"translate3d("+u+"px, "+g+"px, 0)",T))}return Object.assign({},k,(t={},t[w]=b?g+"px":"",t[x]=m?u+"px":"",t.transform="",t))}function fo(e){var t=e.state,i=e.options,s=i.gpuAcceleration,o=s===void 0?!0:s,n=i.adaptive,l=n===void 0?!0:n,r=i.roundOffsets,a=r===void 0?!0:r,c={placement:j(t.placement),variation:mt(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:o,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,Ye(Object.assign({},c,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:l,roundOffsets:a})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,Ye(Object.assign({},c,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:a})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const mo={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:fo,data:{}};var Dt={passive:!0};function vo(e){var t=e.state,i=e.instance,s=e.options,o=s.scroll,n=o===void 0?!0:o,l=s.resize,r=l===void 0?!0:l,a=B(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return n&&c.forEach(function(h){h.addEventListener("scroll",i.update,Dt)}),r&&a.addEventListener("resize",i.update,Dt),function(){n&&c.forEach(function(h){h.removeEventListener("scroll",i.update,Dt)}),r&&a.removeEventListener("resize",i.update,Dt)}}const go={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:vo,data:{}};var yo={left:"right",right:"left",bottom:"top",top:"bottom"};function Zt(e){return e.replace(/left|right|bottom|top/g,function(t){return yo[t]})}var bo={start:"end",end:"start"};function Xe(e){return e.replace(/start|end/g,function(t){return bo[t]})}function ne(e){var t=B(e),i=t.pageXOffset,s=t.pageYOffset;return{scrollLeft:i,scrollTop:s}}function re(e){return ft(Q(e)).left+ne(e).scrollLeft}function wo(e,t){var i=B(e),s=Q(e),o=i.visualViewport,n=s.clientWidth,l=s.clientHeight,r=0,a=0;if(o){n=o.width,l=o.height;var c=je();(c||!c&&t==="fixed")&&(r=o.offsetLeft,a=o.offsetTop)}return{width:n,height:l,x:r+re(e),y:a}}function Io(e){var t,i=Q(e),s=ne(e),o=(t=e.ownerDocument)==null?void 0:t.body,n=ot(i.scrollWidth,i.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),l=ot(i.scrollHeight,i.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),r=-s.scrollLeft+re(e),a=-s.scrollTop;return J(o||i).direction==="rtl"&&(r+=ot(i.clientWidth,o?o.clientWidth:0)-n),{width:n,height:l,x:r,y:a}}function ae(e){var t=J(e),i=t.overflow,s=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(i+o+s)}function Ke(e){return["html","body","#document"].indexOf($(e))>=0?e.ownerDocument.body:W(e)&&ae(e)?e:Ke(Nt(e))}function At(e,t){var i;t===void 0&&(t=[]);var s=Ke(e),o=s===((i=e.ownerDocument)==null?void 0:i.body),n=B(s),l=o?[n].concat(n.visualViewport||[],ae(s)?s:[]):s,r=t.concat(l);return o?r:r.concat(At(Nt(l)))}function te(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function xo(e,t){var i=ft(e,!1,t==="fixed");return i.top=i.top+e.clientTop,i.left=i.left+e.clientLeft,i.bottom=i.top+e.clientHeight,i.right=i.left+e.clientWidth,i.width=e.clientWidth,i.height=e.clientHeight,i.x=i.left,i.y=i.top,i}function Pe(e,t,i){return t===Ne?te(wo(e,i)):nt(t)?xo(t,i):te(Io(Q(e)))}function Co(e){var t=At(Nt(e)),i=["absolute","fixed"].indexOf(J(e).position)>=0,s=i&&W(e)?Yt(e):e;return nt(s)?t.filter(function(o){return nt(o)&&$e(o,s)&&$(o)!=="body"}):[]}function Oo(e,t,i,s){var o=t==="clippingParents"?Co(e):[].concat(t),n=[].concat(o,[i]),l=n[0],r=n.reduce(function(a,c){var h=Pe(e,c,s);return a.top=ot(h.top,a.top),a.right=Wt(h.right,a.right),a.bottom=Wt(h.bottom,a.bottom),a.left=ot(h.left,a.left),a},Pe(e,l,s));return r.width=r.right-r.left,r.height=r.bottom-r.top,r.x=r.left,r.y=r.top,r}function _e(e){var t=e.reference,i=e.element,s=e.placement,o=s?j(s):null,n=s?mt(s):null,l=t.x+t.width/2-i.width/2,r=t.y+t.height/2-i.height/2,a;switch(o){case H:a={x:l,y:t.y-i.height};break;case F:a={x:l,y:t.y+t.height};break;case N:a={x:t.x+t.width,y:r};break;case D:a={x:t.x-i.width,y:r};break;default:a={x:t.x,y:t.y}}var c=o?oe(o):null;if(c!=null){var h=c==="y"?"height":"width";switch(n){case ut:a[c]=a[c]-(t[h]/2-i[h]/2);break;case Lt:a[c]=a[c]+(t[h]/2-i[h]/2);break}}return a}function kt(e,t){t===void 0&&(t={});var i=t,s=i.placement,o=s===void 0?e.placement:s,n=i.strategy,l=n===void 0?e.strategy:n,r=i.boundary,a=r===void 0?Vs:r,c=i.rootBoundary,h=c===void 0?Ne:c,p=i.elementContext,f=p===void 0?Ot:p,u=i.altBoundary,I=u===void 0?!1:u,g=i.padding,v=g===void 0?0:g,m=Ge(typeof v!="number"?v:Ue(v,Tt)),b=f===Ot?js:Ot,x=e.rects.popper,w=e.elements[I?b:f],C=Oo(nt(w)?w:w.contextElement||Q(e.elements.popper),a,h,l),y=ft(e.elements.reference),O=_e({reference:y,element:x,placement:o}),S=te(Object.assign({},x,O)),E=f===Ot?S:y,A={top:C.top-E.top+m.top,bottom:E.bottom-C.bottom+m.bottom,left:C.left-E.left+m.left,right:E.right-C.right+m.right},k=e.modifiersData.offset;if(f===Ot&&k){var R=k[o];Object.keys(A).forEach(function(T){var z=[N,F].indexOf(T)>=0?1:-1,G=[H,F].indexOf(T)>=0?"y":"x";A[T]+=R[G]*z})}return A}function Eo(e,t){t===void 0&&(t={});var i=t,s=i.placement,o=i.boundary,n=i.rootBoundary,l=i.padding,r=i.flipVariations,a=i.allowedAutoPlacements,c=a===void 0?Ve:a,h=mt(s),p=h?r?ke:ke.filter(function(I){return mt(I)===h}):Tt,f=p.filter(function(I){return c.indexOf(I)>=0});f.length===0&&(f=p);var u=f.reduce(function(I,g){return I[g]=kt(e,{placement:g,boundary:o,rootBoundary:n,padding:l})[j(g)],I},{});return Object.keys(u).sort(function(I,g){return u[I]-u[g]})}function So(e){if(j(e)===ee)return[];var t=Zt(e);return[Xe(e),t,Xe(t)]}function Ao(e){var t=e.state,i=e.options,s=e.name;if(!t.modifiersData[s]._skip){for(var o=i.mainAxis,n=o===void 0?!0:o,l=i.altAxis,r=l===void 0?!0:l,a=i.fallbackPlacements,c=i.padding,h=i.boundary,p=i.rootBoundary,f=i.altBoundary,u=i.flipVariations,I=u===void 0?!0:u,g=i.allowedAutoPlacements,v=t.options.placement,m=j(v),b=m===v,x=a||(b||!I?[Zt(v)]:So(v)),w=[v].concat(x).reduce(function(q,V){return q.concat(j(V)===ee?Eo(t,{placement:V,boundary:h,rootBoundary:p,padding:c,flipVariations:I,allowedAutoPlacements:g}):V)},[]),C=t.rects.reference,y=t.rects.popper,O=new Map,S=!0,E=w[0],A=0;A<w.length;A++){var k=w[A],R=j(k),T=mt(k)===ut,z=[H,F].indexOf(R)>=0,G=z?"width":"height",Y=kt(t,{placement:k,boundary:h,rootBoundary:p,altBoundary:f,padding:c}),Z=z?T?N:D:T?F:H;C[G]>y[G]&&(Z=Zt(Z));var rt=Zt(Z),U=[];if(n&&U.push(Y[R]<=0),r&&U.push(Y[Z]<=0,Y[rt]<=0),U.every(function(q){return q})){E=k,S=!1;break}O.set(k,U)}if(S)for(var at=I?3:1,vt=function(V){var et=w.find(function(it){var K=O.get(it);if(K)return K.slice(0,V).every(function(ct){return ct})});if(et)return E=et,"break"},tt=at;tt>0;tt--){var lt=vt(tt);if(lt==="break")break}t.placement!==E&&(t.modifiersData[s]._skip=!0,t.placement=E,t.reset=!0)}}const Lo={name:"flip",enabled:!0,phase:"main",fn:Ao,requiresIfExists:["offset"],data:{_skip:!1}};function Re(e,t,i){return i===void 0&&(i={x:0,y:0}),{top:e.top-t.height-i.y,right:e.right-t.width+i.x,bottom:e.bottom-t.height+i.y,left:e.left-t.width-i.x}}function Me(e){return[H,N,F,D].some(function(t){return e[t]>=0})}function ko(e){var t=e.state,i=e.name,s=t.rects.reference,o=t.rects.popper,n=t.modifiersData.preventOverflow,l=kt(t,{elementContext:"reference"}),r=kt(t,{altBoundary:!0}),a=Re(l,s),c=Re(r,o,n),h=Me(a),p=Me(c);t.modifiersData[i]={referenceClippingOffsets:a,popperEscapeOffsets:c,isReferenceHidden:h,hasPopperEscaped:p},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":h,"data-popper-escaped":p})}const To={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:ko};function Yo(e,t,i){var s=j(e),o=[D,H].indexOf(s)>=0?-1:1,n=typeof i=="function"?i(Object.assign({},t,{placement:e})):i,l=n[0],r=n[1];return l=l||0,r=(r||0)*o,[D,N].indexOf(s)>=0?{x:r,y:l}:{x:l,y:r}}function Xo(e){var t=e.state,i=e.options,s=e.name,o=i.offset,n=o===void 0?[0,0]:o,l=Ve.reduce(function(h,p){return h[p]=Yo(p,t.rects,n),h},{}),r=l[t.placement],a=r.x,c=r.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=a,t.modifiersData.popperOffsets.y+=c),t.modifiersData[s]=l}const Po={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Xo};function Ro(e){var t=e.state,i=e.name;t.modifiersData[i]=_e({reference:t.rects.reference,element:t.rects.popper,placement:t.placement})}const Mo={name:"popperOffsets",enabled:!0,phase:"read",fn:Ro,data:{}};function Ho(e){return e==="x"?"y":"x"}function Do(e){var t=e.state,i=e.options,s=e.name,o=i.mainAxis,n=o===void 0?!0:o,l=i.altAxis,r=l===void 0?!1:l,a=i.boundary,c=i.rootBoundary,h=i.altBoundary,p=i.padding,f=i.tether,u=f===void 0?!0:f,I=i.tetherOffset,g=I===void 0?0:I,v=kt(t,{boundary:a,rootBoundary:c,padding:p,altBoundary:h}),m=j(t.placement),b=mt(t.placement),x=!b,w=oe(m),C=Ho(w),y=t.modifiersData.popperOffsets,O=t.rects.reference,S=t.rects.popper,E=typeof g=="function"?g(Object.assign({},t.rects,{placement:t.placement})):g,A=typeof E=="number"?{mainAxis:E,altAxis:E}:Object.assign({mainAxis:0,altAxis:0},E),k=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,R={x:0,y:0};if(y){if(n){var T,z=w==="y"?H:D,G=w==="y"?F:N,Y=w==="y"?"height":"width",Z=y[w],rt=Z+v[z],U=Z-v[G],at=u?-S[Y]/2:0,vt=b===ut?O[Y]:S[Y],tt=b===ut?-S[Y]:-O[Y],lt=t.elements.arrow,q=u&<?se(lt):{width:0,height:0},V=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:ze(),et=V[z],it=V[G],K=St(0,O[Y],q[Y]),ct=x?O[Y]/2-at-K-et-A.mainAxis:vt-K-et-A.mainAxis,Vt=x?-O[Y]/2+at+K+it+A.mainAxis:tt+K+it+A.mainAxis,gt=t.elements.arrow&&Yt(t.elements.arrow),jt=gt?w==="y"?gt.clientTop||0:gt.clientLeft||0:0,Xt=(T=k==null?void 0:k[w])!=null?T:0,$t=Z+ct-Xt-jt,zt=Z+Vt-Xt,Pt=St(u?Wt(rt,$t):rt,Z,u?ot(U,zt):U);y[w]=Pt,R[w]=Pt-Z}if(r){var Rt,Gt=w==="x"?H:D,Ut=w==="x"?F:N,_=y[C],ht=C==="y"?"height":"width",yt=_+v[Gt],dt=_-v[Ut],st=[H,D].indexOf(m)!==-1,bt=(Rt=k==null?void 0:k[C])!=null?Rt:0,wt=st?yt:_-O[ht]-S[ht]-bt+A.altAxis,It=st?_+O[ht]+S[ht]-bt-A.altAxis:dt,xt=u&&st?ro(wt,_,It):St(u?wt:yt,_,u?It:dt);y[C]=xt,R[C]=xt-_}t.modifiersData[s]=R}}const Zo={name:"preventOverflow",enabled:!0,phase:"main",fn:Do,requiresIfExists:["offset"]};function Bo(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function Wo(e){return e===B(e)||!W(e)?ne(e):Bo(e)}function Fo(e){var t=e.getBoundingClientRect(),i=pt(t.width)/e.offsetWidth||1,s=pt(t.height)/e.offsetHeight||1;return i!==1||s!==1}function No(e,t,i){i===void 0&&(i=!1);var s=W(t),o=W(t)&&Fo(t),n=Q(t),l=ft(e,o,i),r={scrollLeft:0,scrollTop:0},a={x:0,y:0};return(s||!s&&!i)&&(($(t)!=="body"||ae(n))&&(r=Wo(t)),W(t)?(a=ft(t,!0),a.x+=t.clientLeft,a.y+=t.clientTop):n&&(a.x=re(n))),{x:l.left+r.scrollLeft-a.x,y:l.top+r.scrollTop-a.y,width:l.width,height:l.height}}function Vo(e){var t=new Map,i=new Set,s=[];e.forEach(function(n){t.set(n.name,n)});function o(n){i.add(n.name);var l=[].concat(n.requires||[],n.requiresIfExists||[]);l.forEach(function(r){if(!i.has(r)){var a=t.get(r);a&&o(a)}}),s.push(n)}return e.forEach(function(n){i.has(n.name)||o(n)}),s}function jo(e){var t=Vo(e);return to.reduce(function(i,s){return i.concat(t.filter(function(o){return o.phase===s}))},[])}function $o(e){var t;return function(){return t||(t=new Promise(function(i){Promise.resolve().then(function(){t=void 0,i(e())})})),t}}function zo(e){var t=e.reduce(function(i,s){var o=i[s.name];return i[s.name]=o?Object.assign({},o,s,{options:Object.assign({},o.options,s.options),data:Object.assign({},o.data,s.data)}):s,i},{});return Object.keys(t).map(function(i){return t[i]})}var He={placement:"bottom",modifiers:[],strategy:"absolute"};function De(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return!t.some(function(s){return!(s&&typeof s.getBoundingClientRect=="function")})}function Go(e){e===void 0&&(e={});var t=e,i=t.defaultModifiers,s=i===void 0?[]:i,o=t.defaultOptions,n=o===void 0?He:o;return function(r,a,c){c===void 0&&(c=n);var h={placement:"bottom",orderedModifiers:[],options:Object.assign({},He,n),modifiersData:{},elements:{reference:r,popper:a},attributes:{},styles:{}},p=[],f=!1,u={state:h,setOptions:function(m){var b=typeof m=="function"?m(h.options):m;g(),h.options=Object.assign({},n,h.options,b),h.scrollParents={reference:nt(r)?At(r):r.contextElement?At(r.contextElement):[],popper:At(a)};var x=jo(zo([].concat(s,h.options.modifiers)));return h.orderedModifiers=x.filter(function(w){return w.enabled}),I(),u.update()},forceUpdate:function(){if(!f){var m=h.elements,b=m.reference,x=m.popper;if(De(b,x)){h.rects={reference:No(b,Yt(x),h.options.strategy==="fixed"),popper:se(x)},h.reset=!1,h.placement=h.options.placement,h.orderedModifiers.forEach(function(A){return h.modifiersData[A.name]=Object.assign({},A.data)});for(var w=0;w<h.orderedModifiers.length;w++){if(h.reset===!0){h.reset=!1,w=-1;continue}var C=h.orderedModifiers[w],y=C.fn,O=C.options,S=O===void 0?{}:O,E=C.name;typeof y=="function"&&(h=y({state:h,options:S,name:E,instance:u})||h)}}}},update:$o(function(){return new Promise(function(v){u.forceUpdate(),v(h)})}),destroy:function(){g(),f=!0}};if(!De(r,a))return u;u.setOptions(c).then(function(v){!f&&c.onFirstUpdate&&c.onFirstUpdate(v)});function I(){h.orderedModifiers.forEach(function(v){var m=v.name,b=v.options,x=b===void 0?{}:b,w=v.effect;if(typeof w=="function"){var C=w({state:h,name:m,instance:u,options:x}),y=function(){};p.push(C||y)}})}function g(){p.forEach(function(v){return v()}),p=[]}return u}}var Uo=[go,Mo,mo,so,Po,Lo,Zo,ho,To],Ko=Go({defaultModifiers:Uo});class _o{constructor(t,i,s){le(this,"updateHotspotPosition",(t,i)=>{this.currentActiveIndex=t,this.currentOrientation=i;const s=Hs(this.hotspotsConfig,t,i);this.hideHotspots(),s.forEach(o=>this.updateAndShowHotspot(o,t))});this.container=i,this.popper=null,this.popperInstance=null,this.hotspotsContainer=Qi(this.container),this.hotspotsConfig=Fs(t),this.shouldHidePopper=!0,this.hidePopper=this.hidePopper.bind(this),this.imageAspectRatio=s,this.hotspotElements=new Map,this.popperListeners=[];const{containerSize:o}=t[0];this.initialContainerSize=o||[i.offsetWidth,i.offsetHeight],this.initHotspots(),this.observeContainerResize()}observeContainerResize(){this.resizeObserver=new ResizeObserver(()=>{const t=this.container.offsetWidth,i=this.container.offsetHeight;this.updateHotspotsForResize(t,i)}),this.resizeObserver.observe(this.container)}updateHotspotsForResize(t,i){this.hotspotsConfig=Ns({newWidth:t,newHeight:i,initialContainerSize:this.initialContainerSize,imageAspectRatio:this.imageAspectRatio,hotspotsConfig:this.hotspotsConfig}),this.updateHotspotPosition(this.currentActiveIndex,this.currentOrientation)}cleanupPopperListeners(){this.popperListeners.forEach(({element:t,event:i,handler:s})=>{t.removeEventListener(i,s)}),this.popperListeners=[]}showPopper({hotspotElement:t,content:i,id:s,keepOpen:o}){this.popperInstance&&this.popperInstance.instanceId!==s&&this.hidePopper();const n={placement:"top",modifiers:Bs(this.container)};this.popper=Ws(i,s),this.popper.setAttribute("data-show",""),this.currentHotspotElement=t,t.setAttribute("aria-expanded","true"),t.setAttribute("aria-describedby",`cloudimage-360-popper-${s}`);const l=()=>{this.shouldHidePopper=!1},r=()=>{this.shouldHidePopper=!0,this.checkAndHidePopper()},a=()=>{this.shouldHidePopper=!0,this.checkAndHidePopper()},c=()=>{this.shouldHidePopper=!1,this.hidePopperTimeout&&clearTimeout(this.hidePopperTimeout)};this.popper.addEventListener("mouseenter",l),this.popper.addEventListener("mouseleave",r),t.addEventListener("mouseleave",a),t.addEventListener("mouseenter",c),this.popperListeners.push({element:this.popper,event:"mouseenter",handler:l},{element:this.popper,event:"mouseleave",handler:r},{element:t,event:"mouseleave",handler:a},{element:t,event:"mouseenter",handler:c}),this.popperInstance={...Ko(t,this.popper,n),keepOpen:o,instanceId:s}}checkAndHidePopper(){var t;this.shouldHidePopper&&!((t=this.popperInstance)!=null&&t.keepOpen)&&(this.hidePopperTimeout=setTimeout(()=>{this.shouldHidePopper&&this.hidePopper()},Ei))}hidePopper(){if(this.cleanupPopperListeners(),this.currentHotspotElement&&(this.currentHotspotElement.setAttribute("aria-expanded","false"),this.currentHotspotElement.removeAttribute("aria-describedby"),this.currentHotspotElement=null),this.popperInstance&&(this.popperInstance.destroy(),this.popperInstance=null),this.popper){this.popper.removeAttribute("data-show"),this.popper.setAttribute("aria-hidden","true");const t=this.popper;this.popper=null,setTimeout(()=>{t.remove()},Si)}}createHotspot(t){const{id:i,content:s,keepOpen:o,onClick:n,label:l}=t,r=Ds(i,l);n&&(r.style.cursor="pointer"),r.onclick=a=>{a.stopPropagation(),n==null||n(a,this.popperInstance,i)},s&&(r.addEventListener("mouseenter",()=>this.showPopper({hotspotElement:r,content:s,id:i,keepOpen:o})),r.addEventListener("focus",()=>this.showPopper({hotspotElement:r,content:s,id:i,keepOpen:o})),r.addEventListener("blur",()=>{this.shouldHidePopper=!0,this.checkAndHidePopper()})),this.hotspotsContainer.appendChild(r)}hideHotspots(){this.hotspotsContainer.querySelectorAll(".cloudimage-360-hotspot").forEach(t=>{t.style.opacity=0,t.style.pointerEvents="none"})}updateAndShowHotspot(t,i){const{positions:s,id:o}=t,{x:n,y:l}=s[i]??{},r=this.hotspotsContainer.querySelector(`[data-hotspot-id="${o}"]`);r&&(r.style.translate=`${n}px ${l}px`,r.style.opacity=1,r.style.pointerEvents="all")}showHotspotById(t){const i=this.hotspotsConfig.find(o=>o.id===t);if(!i||!i.content)return;const s=this.hotspotsContainer.querySelector(`[data-hotspot-id="${t}"]`);s&&s.style.opacity==="1"&&this.showPopper({hotspotElement:s,content:i.content,id:t,keepOpen:i.keepOpen})}createAllHotspots(){this.hotspotsConfig.forEach(t=>this.createHotspot(t))}initHotspots(){this.createAllHotspots()}destroy(){this.hidePopperTimeout&&clearTimeout(this.hidePopperTimeout),this.resizeObserver.disconnect(),this.hidePopper(),this.hotspotElements.clear(),this.hotspotsContainer.innerHTML=""}}class Ft{constructor(t,i,s){this.container=t,this.isClicked=!1,this.fullscreenView=!!s,this.imagesX=[],this.imagesY=[],this.devicePixelRatio=Math.round(window.devicePixelRatio||1),this.id=t.id,this.movementStart={x:0,y:0},this.draggingDirection=null,this.isReady=!1,this.velocityX=0,this.velocityY=0,this.lastDragTime=0,this.lastDragX=0,this.lastDragY=0,this.inertiaAnimationId=null,this.hasInteracted=!1,this.currentZoomScale=1,this.touchDevice=Ls(),this.dragJustEnded=!1,this.isPinching=!1,this.initialPinchDistance=0,this.pinchZoomLevel=1,this.pinchZoomEmitted=!1,this.lastEmittedZoom=1,this.panOffsetX=0,this.panOffsetY=0,this.canvasWorker=new Ys,this.hotspotTimeline=null,this.hotspotTimelineIndicator=null,this.isAnimatingToFrame=!1,this.onMoveHandler=this.onMoveHandler.bind(this),this.destroy=this.destroy.bind(this),this.init(this.container,i)}emit(t,i={}){const s=this[t];typeof s=="function"&&s({...i,viewerId:this.id})}announce(t){es(this.ariaLiveRegion,t)}mouseDown(t){if(!this.isReady||this.glass)return;const{pageX:i,pageY:s}=t;this.hideHints(),this.hideHotspotPopper(),this.inertiaAnimationId&&(cancelAnimationFrame(this.inertiaAnimationId),this.inertiaAnimationId=null),this.autoplayJustStopped=!1,(this.autoplay||this.loopTimeoutId)&&(this.stopAutoplay(),this.autoplay=!1,this.autoplayJustStopped=!0),this.movementStart={x:i,y:s},this.isClicked=!0,this.isDragging=!1,this.inertia&&(this.velocityX=0,this.velocityY=0,this.lastDragTime=performance.now(),this.lastDragX=i,this.lastDragY=s)}mouseUp(){this.isReady&&(!this.isZoomed&&!this.autoplayJustStopped&&this.showAllIcons(),this.inertia&&this.isDragging&&(Math.abs(this.velocityX)>.1||Math.abs(this.velocityY)>.1)&&this.startInertia(),this.isDragging&&(this.emit("onDragEnd"),this.dragJustEnded=!0),this.movementStart={x:0,y:0},this.isClicked=!1,this.isDragging=!1,this.innerBox.style.cursor="grab")}startInertia(){const s=this.fullscreenView?document.body:this.container,o=this.dragSpeed/fe,n=o*(this.amountX/s.offsetWidth),l=o*(this.amountY/s.offsetHeight),r=()=>{if(this.velocityX*=.95,this.velocityY*=.95,Math.abs(this.velocityX)<.01&&Math.abs(this.velocityY)<.01){this.inertiaAnimationId=null;return}const a=this.velocityX*16,c=this.velocityY*16,h=Se({deltaX:a,deltaY:c,reversed:this.dragReverse,allowSpinX:this.allowSpinX,allowSpinY:this.allowSpinY});if(h){const p=this.allowSpinX?Math.max(1,Math.abs(Math.round(a*n))):0,f=this.allowSpinY?Math.max(1,Math.abs(Math.round(c*l))):0;(p>0||f>0)&&this.onMoveHandler(h,p,f)}this.inertiaAnimationId=requestAnimationFrame(r)};this.inertiaAnimationId=requestAnimationFrame(r)}drag(t,i){if(!this.isReady||!this.isClicked)return;const s=t-this.movementStart.x,o=i-this.movementStart.y;if(this.inertia){const f=performance.now(),u=f-this.lastDragTime;u>0&&u<100&&(this.velocityX=(t-this.lastDragX)/u,this.velocityY=(i-this.lastDragY)/u),this.lastDragTime=f,this.lastDragX=t,this.lastDragY=i}this.draggingDirection=Se({deltaX:s,deltaY:o,reversed:this.dragReverse,allowSpinX:this.allowSpinX,allowSpinY:this.allowSpinY})||this.draggingDirection;const n=this.fullscreenView?document.body:this.container,l=this.dragSpeed/fe,r=l*(this.amountX/n.offsetWidth),a=l*(this.amountY/n.offsetHeight),c=this.allowSpinX?Math.abs(Math.round(s*r)):0,h=this.allowSpinY?Math.abs(Math.round(o*a)):0;(this.allowSpinX&&c!==0||this.allowSpinY&&h!==0)&&(this.hasInteracted=!0,this.hideHotspotPopper(),this.onMoveHandler(this.draggingDirection,c,h),this.movementStart={x:t,y:i},setTimeout(()=>{this.isDragging||(this.isDragging=!0,this.emit("onDragStart"))},Oi))}mouseMove(t){!this.isReady||!this.isClicked&&!this.isZoomed||this.glass||(this.hideAllIcons(),this.drag(t.pageX,t.pageY),this.isZoomed&&this.applyZoom(t))}mouseClick(t){if(!(!this.isReady||this.isDragging)){if(this.dragJustEnded){this.dragJustEnded=!1;return}if(this.autoplayJustStopped){this.autoplayJustStopped=!1;return}if(this.glass&&this.magnified){this.removeGlass();return}this.pointerZoom&&!this.glass&&!this.touchDevice&&this.toggleZoom(t)}}loadHigherQualityImages(t,i){const s=Et(this.srcXConfig,t),o=this.allowSpinY?Et(this.srcYConfig,t):null;ve({cdnPathX:s,cdnPathY:o,configX:this.srcXConfig,configY:this.srcYConfig,onAllImagesLoad:(n,l)=>{this.imagesX=n,this.imagesY=l,i()},onError:n=>this.emit("onError",n)})}hideHotspots(){this.hotspotsInstance&&this.hotspotsInstance.hideHotspots()}hideHotspotPopper(){this.hotspotsInstance&&this.hotspotsInstance.hidePopper()}toggleZoom(t){if(this.isZoomed)this.showTransitionOverlay(),setTimeout(()=>{this.removeZoom()},pe);else{let i=(this.fullscreenView||this.pointerZoom?document.body:this.container).offsetWidth;this.hideHotspots(),this.showLoadingSpinner(),this.loadHigherQualityImages(i,()=>{this.showTransitionOverlay(),setTimeout(()=>{this.applyZoom(t)},pe)})}}removeZoom(){this.isZoomed=!1,this.updateView(),this.showAllIcons(),this.hideTransitionOverlay(),this.emit("onZoomOut"),this.announce("Zoomed out")}mouseLeave(){this.isZoomed&&this.removeZoom()}applyZoom(t){const{offsetX:i,offsetY:s}=xs(t,this.canvas,this.devicePixelRatio);this.isZoomed=!0,this.hideAllIcons(),this.hideLoadingSpinner(),this.hideTransitionOverlay(),this.updateView(this.pointerZoom,i,s),this.emit("onZoomIn",{zoomLevel:this.pointerZoom}),this.announce("Zoomed in. Move mouse to pan. Click to zoom out.")}touchOutside(t){if(!this.glass)return;!this.canvas.contains(t.target)&&this.removeGlass()}touchStart(t){if(!this.isReady||this.glass||!t.touches||!t.touches.length)return;const i=t.target;if(i&&i.closest&&i.closest(".cloudimage-360-button"))return;if(this.hideHints(),t.touches.length===2&&this.pinchZoom&&!this.isDragging){t.preventDefault(),this.isPinching=!0,this.isClicked=!1,this.inertiaAnimationId&&(cancelAnimationFrame(this.inertiaAnimationId),this.inertiaAnimationId=null);const n=t.touches[0],l=t.touches[1];if(this.initialPinchDistance=this.getPinchDistance(n,l),(this.autoplay||this.loopTimeoutId)&&(this.stopAutoplay(),this.autoplay=!1),!this.isZoomed&&this.pinchZoomLevel===1){const r=(this.fullscreenView?document.body:this.container).offsetWidth;this.hideHotspots(),this.loadHigherQualityImages(r,()=>{})}return}if(t.touches.length>1)return;const{pageX:s,pageY:o}=t.touches[0];this.inertiaAnimationId&&(cancelAnimationFrame(this.inertiaAnimationId),this.inertiaAnimationId=null),(this.autoplay||this.loopTimeoutId)&&(this.stopAutoplay(),this.autoplay=!1),this.hideAllIcons(),this.hideHotspotPopper(),this.movementStart={x:s,y:o},this.isClicked=!0,this.isDragging=!1,this.inertia&&(this.velocityX=0,this.velocityY=0,this.lastDragTime=performance.now(),this.lastDragX=s,this.lastDragY=o)}getPinchDistance(t,i){const s=t.pageX-i.pageX,o=t.pageY-i.pageY;return Math.sqrt(s*s+o*o)}getPinchCenter(t,i){return{x:(t.pageX+i.pageX)/2,y:(t.pageY+i.pageY)/2}}touchEnd(t){if(this.isReady){if(this.isPinching){if(!t.touches||t.touches.length<2){if(this.isPinching=!1,this.initialPinchDistance=0,this.pinchZoomLevel<=1){const i=this.pinchZoomEmitted;this.pinchZoomLevel=1,this.pinchZoomEmitted=!1,this.lastEmittedZoom=1,this.isZoomed=!1,this.panOffsetX=0,this.panOffsetY=0,this.showAllIcons(),this.updateView(),i&&this.emit("onZoomOut")}else if(this.canvas){const i=this.canvas.getBoundingClientRect();this.panOffsetX=i.width/2*this.devicePixelRatio,this.panOffsetY=i.height/2*this.devicePixelRatio}}return}this.showAllIcons(),this.inertia&&this.isDragging&&(Math.abs(this.velocityX)>.1||Math.abs(this.velocityY)>.1)&&this.startInertia(),this.movementStart={x:0,y:0},this.isClicked=!1,this.isDragging=!1}}touchMove(t){if(!this.isReady||this.glass)return;if(this.isPinching&&t.touches.length===2){t.preventDefault();const o=t.touches[0],n=t.touches[1],l=this.getPinchDistance(o,n);if(this.initialPinchDistance===0){this.initialPinchDistance=l;return}const r=l/this.initialPinchDistance,a=Math.max(1,Math.min(this.pinchZoomLevel*r,me));if(this.initialPinchDistance=l,this.pinchZoomLevel=a,!this.canvas)return;const c=this.canvas.getBoundingClientRect(),h=c.width/2*this.devicePixelRatio,p=c.height/2*this.devicePixelRatio;a>1?(this.isZoomed=!0,this.hideAllIcons(),this.updateView(a,h,p),(!this.pinchZoomEmitted||a>this.lastEmittedZoom)&&(this.emit("onZoomIn",{zoomLevel:a}),this.pinchZoomEmitted=!0,this.lastEmittedZoom=a)):(this.isZoomed=!1,this.panOffsetX=0,this.panOffsetY=0,this.updateView());return}if(!this.isClicked||!t.touches||!t.touches[0])return;const{pageX:i,pageY:s}=t.touches[0];if(t.preventDefault(),this.isZoomed&&this.pinchZoomLevel>1){const o=i-this.movementStart.x,n=s-this.movementStart.y;this.panOffsetX-=o*this.devicePixelRatio,this.panOffsetY-=n*this.devicePixelRatio,this.movementStart={x:i,y:s},this.updateView(this.pinchZoomLevel,this.panOffsetX,this.panOffsetY);return}this.drag(i,s)}keyDown(t){if(!this.isReady)return;const{keyCode:i}=t,s=this.keysReverse;switch(this.autoplay&&this.stopAutoplay(),Ee(i,this.allowSpinY)&&(this.hasInteracted=!0,this.hideAllIcons(),this.hideHints()),i){case 37:s?this.moveLeft():this.moveRight();break;case 39:s?this.moveRight():this.moveLeft();break;case 38:this.allowSpinY&&(t.preventDefault(),s?this.moveTop():this.moveBottom());break;case 40:this.allowSpinY&&(t.preventDefault(),s?this.moveBottom():this.moveTop());break}}keyUp(t){const{keyCode:i}=t;Ee(i,this.allowSpinY)&&this.showAllIcons()}moveActiveXIndexUp(t){this.orientation=P.X,this.activeImageX=(this.activeImageX+t)%this.amountX}moveActiveXIndexDown(t){this.orientation=P.X,this.activeImageX=(this.activeImageX-t+this.amountX)%this.amountX}moveActiveYIndexUp(t){this.orientation=P.Y,this.activeImageY=(this.activeImageY+t)%this.amountY}moveActiveYIndexDown(t){this.orientation=P.Y,this.activeImageY=(this.activeImageY-t+this.amountY)%this.amountY}moveRight(t,i=1){t&&this.activeImageX>=this.imagesX.length-1||(this.moveActiveXIndexUp(i),this.isZoomed||this.updateView())}moveLeft(t,i=1){t&&this.activeImageX<=0||(this.moveActiveXIndexDown(i),this.isZoomed||this.updateView())}moveTop(t,i=1){t&&this.activeImageY>=this.imagesY.length-1||(this.moveActiveYIndexUp(i),this.isZoomed||this.updateView())}moveBottom(t,i=1){t&&this.activeImageY<=0||(this.moveActiveYIndexDown(i),this.isZoomed||this.updateView())}onMoveHandler(t,i=1,s=1){t==="right"?this.moveRight(this.stopAtEdges,i):t==="left"?this.moveLeft(this.stopAtEdges,i):t==="up"?this.moveTop(this.stopAtEdges,s):t==="down"&&this.moveBottom(this.stopAtEdges,s),this.emit("onSpin",{direction:t,activeImageX:this.activeImageX,activeImageY:this.activeImageY,amountX:this.amountX,amountY:this.amountY})}updateView(t,i,s){const o=this.orientation===P.X?this.activeImageX:this.activeImageY,n=this.orientation===P.X?this.imagesX[this.activeImageX]:this.imagesY[this.activeImageY];this.hotspotsInstance&&!this.isZoomed&&!this.autoplay&&this.hotspotsInstance.updateHotspotPosition(o,this.orientation),this.hotspotTimelineIndicator&&this.orientation===P.X&&this.updateHotspotTimelinePosition(),this.drawImageOnCanvas(n,t,i,s)}updatePercentageInLoader(t=0){this.loader&&(this.loader.innerText=t+"%")}adaptCanvasSize(t){const{naturalWidth:i,naturalHeight:s}=t;this.imageAspectRatio=i/s;const o=this.fullscreenView?window.innerWidth:this.canvas.clientWidth,n=this.fullscreenView?window.innerHeight:this.canvas.clientHeight;this.canvasWorker.postMessage({action:"adaptCanvasSize",devicePixelRatio:this.devicePixelRatio,imageAspectRatio:this.imageAspectRatio,containerWidth:o,containerHeight:n})}drawImageOnCanvas(t,i=1,s=0,o=0){this.canvasWorker.postMessage({action:"drawImageOnCanvas",imageData:t,zoomScale:i,pointerX:s,pointerY:o})}pushImageToSet(t,i,s){s===P.X?this.imagesX[i]=t:this.imagesY[i]=t}calculatePercentage(){const t=this.amountX+this.amountY,i=this.imagesX.length+this.imagesY.length;return Math.round(i/t*100)}onImageLoad(t,i,s){this.pushImageToSet(t,i,s),this.updatePercentageInLoader(this.calculatePercentage())}onFirstImageLoaded(t,i){this.createContainers(t),this.adaptCanvasSize(i),this.drawImageOnCanvas(i)}onAllImagesLoaded(){if(this.addAllIcons(),this.isReady=!0,this.amountX=this.imagesX.length,this.amountY=this.imagesY.length,this.activeImageX=this.autoplayReverse?this.amountX-1:0,this.activeImageY=this.autoplayReverse?this.amountY-1:0,this.hotspots&&(this.hotspotsInstance=new _o(this.hotspots,this.innerBox,this.imageAspectRatio),this.addHotspotTimeline(),this.showHotspotTimeline()),this.emit("onLoad",{imagesX:this.imagesX.length,imagesY:this.imagesY.length}),this.emit("onReady"),this.announce("360 degree view loaded. Use mouse drag or arrow keys to rotate."),this.hints!==!1&&!this.autoplay){const t=this.hints===!0||this.hints===void 0?be(this.viewerConfig,this.touchDevice):this.hints;t&&t.length>0&&(this.hintsOverlay=ye(this.innerBox,t),we(this.hintsOverlay))}this.autoplay&&(this.hideAllIcons(),ks(this.play.bind(this))())}magnify(t){t.stopPropagation();const{src:i}=this.orientation===P.Y?this.imagesY[this.activeImageY]:this.imagesX[this.activeImageX],o=(this.fullscreenView?document.body:this.container).offsetWidth*this.magnifier,n=Di(i,o);this.showLoadingSpinner(),this.createGlass(),bs(n,a=>{this.hideLoadingSpinner(),this.magnified=!0,Is(t,this.innerBox,this.offset,a,this.glass,this.magnifier)},a=>{this.hideLoadingSpinner(),this.removeGlass(),this.emit("onError",{error:{message:a.message,url:a.url},errorCount:1,totalImages:1,errors:[{message:a.message,url:a.url}]})})}openFullscreenModal(t){t.stopPropagation(),window.document.body.style.overflow="hidden";const i=_i(this.container);new Ft(i,this.viewerConfig,!0),this.emit("onFullscreenOpen"),this.announce("Opened fullscreen mode. Press Escape to exit.")}closeFullscreenModal(t){t.stopPropagation(),document.body.removeChild(this.container.parentNode),window.document.body.style.overflow="visible",this.emit("onFullscreenClose"),this.announce("Exited fullscreen mode")}play(){if(this.isClicked)return;this.hide360ViewCircleIcon(),this.emit("onAutoplayStart");const t=this.speed*36/(this.amountX+this.amountY),i={left:this.moveLeft.bind(this),right:this.moveRight.bind(this),top:this.moveTop.bind(this),bottom:this.moveBottom.bind(this)};this.loopTimeoutId=window.setInterval(()=>{if(this.playOnce&&Os({autoplayBehavior:this.autoplayBehavior,activeImageX:this.activeImageX,activeImageY:this.activeImageY,amountX:this.amountX,amountY:this.amountY,autoplayReverse:this.autoplayReverse})){this.stopAutoplay();return}Es({autoplayBehavior:this.autoplayBehavior,activeImageX:this.activeImageX,activeImageY:this.activeImageY,amountX:this.amountX,amountY:this.amountY,autoplayReverse:this.autoplayReverse,spinDirection:this.spinDirection})&&(this.spinDirection=As(this.spinDirection));const n=this.spinDirection==="y";Cs({autoplayBehavior:this.autoplayBehavior,spinY:n,reversed:this.autoplayReverse,loopTriggers:i})},t)}stopAutoplay(){if(this.showAllIcons(),this.autoplay=!1,window.clearTimeout(this.loopTimeoutId),this.loopTimeoutId=null,this.emit("onAutoplayStop"),this.hints!==!1&&!this.hintsOverlay&&!this.hintsHidden){const t=this.hints===!0?be(this.viewerConfig,this.touchDevice):this.hints;t&&t.length>0&&(this.hintsOverlay=ye(this.innerBox,t),we(this.hintsOverlay))}}destroy(){this.stopAutoplay(),this.inertiaAnimationId&&(cancelAnimationFrame(this.inertiaAnimationId),this.inertiaAnimationId=null),this.removeEvents(),this.canvasWorker&&(this.canvasWorker.terminate(),this.canvasWorker=null),this.hotspotsInstance&&this.hotspotsInstance.destroy(),this.hintsOverlay&&this.hintsOverlay.parentNode&&(this.hintsOverlay.parentNode.removeChild(this.hintsOverlay),this.hintsOverlay=null),this.hotspotTimeline&&this.hotspotTimeline.parentNode&&(this.hotspotTimeline.parentNode.removeChild(this.hotspotTimeline),this.hotspotTimeline=null,this.hotspotTimelineIndicator=null),this.container&&(this.container.classList.remove("ci360-theme-dark"),this.container.innerHTML="")}addInitialIcon(){this.initialIcon||this.hide360Logo||(this.initialIcon=Vi(this.logoSrc),this.innerBox.appendChild(this.initialIcon))}showInitialIcon(){!this.initialIcon||this.hasInteracted||(this.initialIcon.style.opacity=1)}hideInitialIcon(){this.initialIcon&&(this.initialIcon.style.opacity=0)}createGlass(){this.hideAllIcons(),this.glass=document.createElement("div"),this.innerBox.appendChild(this.glass),this.innerBox.style.cursor="default"}removeGlass(){this.showAllIcons(),this.innerBox.removeChild(this.glass),this.glass=null,this.magnified=!1}addMagnifierIcon(){this.magnifier&&(this.magnifierIcon=Ui(),this.magnifierIcon.onclick=this.magnify.bind(this),this.iconsContainer.appendChild(this.magnifierIcon))}showMagnifierIcon(){this.magnifierIcon&&(this.magnifierIcon.style.visibility="visible",this.magnifierIcon.style.opacity=1)}hideMagnifierIcon(){this.magnifierIcon&&(this.magnifierIcon.style.visibility="hidden",this.magnifierIcon.style.opacity=0)}addFullscreenIcon(){this.fullscreen&&(this.fullscreenIcon=zi(),this.fullscreenIcon.onclick=this.openFullscreenModal.bind(this),this.iconsContainer.appendChild(this.fullscreenIcon))}addCloseFullscreenIcon(){this.fullscreenCloseIcon=$i(),this.fullscreenCloseIcon.onclick=this.closeFullscreenModal.bind(this),this.iconsContainer.appendChild(this.fullscreenCloseIcon)}showFullscreenIcon(){this.fullscreenIcon&&(this.fullscreenIcon.style.opacity=1)}hideFullscreenIcon(){this.fullscreenIcon&&(this.fullscreenIcon.style.opacity=0)}add360ViewCircleIcon(){this.view360CircleIcon||(this.view360CircleIcon=Fi(this.bottomCircleOffset),this.innerBox.appendChild(this.view360CircleIcon))}show360ViewCircleIcon(){this.view360CircleIcon&&(this.view360CircleIcon.style.opacity=1)}hide360ViewCircleIcon(){this.view360CircleIcon&&(this.view360CircleIcon.style.opacity=0)}addLoadingSpinner(){this.loadingSpinner=Ji(),this.innerBox.appendChild(this.loadingSpinner)}showLoadingSpinner(){this.loadingSpinner&&(this.hideAllIcons(),this.loadingSpinner.style.opacity=1)}createTransitionOverlay(){this.transitionOverlay=qi(),this.innerBox.appendChild(this.transitionOverlay)}showTransitionOverlay(){this.transitionOverlay&&(this.hideAllIcons(),this.transitionOverlay.style.opacity=1)}hideTransitionOverlay(){this.transitionOverlay&&(this.transitionOverlay.style.opacity=0)}hideLoadingSpinner(){this.loadingSpinner&&(this.loadingSpinner.style.opacity=0)}hideHints(){!this.hintsOverlay||this.hintsHidden||(this.hintsHidden=!0,os(this.hintsOverlay))}addHotspotTimeline(){if(!this.hotspots||this.hotspotTimeline)return;const t=cs(this.container,this.amountX,this.hotspots);if(!t)return;this.hotspotTimeline=t.element,this.hotspotTimelineIndicator=t.indicator,this.hotspotTimeline.querySelectorAll(".cloudimage-360-hotspot-timeline-dot").forEach(s=>{s.addEventListener("click",o=>{o.stopPropagation();const n=parseInt(s.getAttribute("data-frame"),10),l=s.getAttribute("data-hotspot-id");isNaN(n)||this.animateToFrame(n,l)})}),this.updateHotspotTimelinePosition()}showHotspotTimeline(){ds(this.hotspotTimeline)}hideHotspotTimeline(){us(this.hotspotTimeline)}updateHotspotTimelinePosition(){hs(this.hotspotTimelineIndicator,this.activeImageX,this.amountX)}animateToFrame(t,i){if(this.hotspotsInstance&&this.hotspotsInstance.hidePopper(),this.isAnimatingToFrame||t===this.activeImageX){t===this.activeImageX&&i&&this.hotspotsInstance&&this.hotspotTimelineOnClick&&this.hotspotsInstance.showHotspotById(i);return}this.isAnimatingToFrame=!0,this.hasInteracted=!0,(this.autoplay||this.loopTimeoutId)&&(this.stopAutoplay(),this.autoplay=!1),this.inertiaAnimationId&&(cancelAnimationFrame(this.inertiaAnimationId),this.inertiaAnimationId=null);const s=this.activeImageX,o=(t-s+this.amountX)%this.amountX,n=(s-t+this.amountX)%this.amountX,l=o<=n,r=l?o:n;if(r===0){this.isAnimatingToFrame=!1;return}const a=30;let c=r;const h=()=>{if(c<=0){this.isAnimatingToFrame=!1,i&&this.hotspotsInstance&&this.hotspotTimelineOnClick&&setTimeout(()=>{this.hotspotsInstance.showHotspotById(i)},50);return}l?this.moveRight():this.moveLeft(),c--,c>0?setTimeout(h,a):(this.isAnimatingToFrame=!1,i&&this.hotspotsInstance&&this.hotspotTimelineOnClick&&setTimeout(()=>{this.hotspotsInstance.showHotspotById(i)},50))};h()}remove360ViewCircleIcon(){this.view360CircleIcon&&(this.innerBox.removeChild(this.view360CircleIcon),this.view360CircleIcon=null)}addAllIcons(){this.removeLoader(),this.innerBox.style.cursor="grab",this.pointerZoom&&(this.createTransitionOverlay(),this.addLoadingSpinner()),!this.fullscreenView&&!this.touchDevice&&this.addMagnifierIcon(),this.fullscreenView||this.addFullscreenIcon(),this.initialIconShown&&this.addInitialIcon(),this.bottomCircle&&this.add360ViewCircleIcon()}showAllIcons(){this.showInitialIcon(),this.show360ViewCircleIcon(),this.showMagnifierIcon(),this.showFullscreenIcon(),this.showHotspotTimeline()}hideAllIcons(){this.hideInitialIcon(),this.hide360ViewCircleIcon(),this.hideMagnifierIcon(),this.hideFullscreenIcon(),this.hideHotspotTimeline()}removeLoader(){this.loader&&(this.innerBox.removeChild(this.loader),this.loader=null)}attachEvents(t,i,s){t&&this.addMouseEvents(),i&&this.addTouchEvents(),s&&this.addKeyboardEvents(),this.addEscKeyHandler()}removeEvents(){this.removeMouseEvents(),this.removeTouchEvents(),this.removeKeyboardEvents(),this.removeEscKeyHandler()}addMouseEvents(){this.boundMouseClick=this.mouseClick.bind(this),this.boundMouseDown=this.mouseDown.bind(this),this.boundMouseMove=de(this.mouseMove.bind(this),ue),this.boundMouseUp=this.mouseUp.bind(this),this.boundMouseLeave=this.mouseLeave.bind(this),this.innerBox.addEventListener("click",this.boundMouseClick),this.innerBox.addEventListener("mousedown",this.boundMouseDown),this.innerBox.addEventListener("mouseleave",this.boundMouseLeave),document.addEventListener("mousemove",this.boundMouseMove),document.addEventListener("mouseup",this.boundMouseUp)}addTouchEvents(){this.boundTouchOutside=this.touchOutside.bind(this),this.boundTouchStart=this.touchStart.bind(this),this.boundTouchEnd=this.touchEnd.bind(this),this.boundTouchMove=de(this.touchMove.bind(this),ue),document.addEventListener("touchstart",this.boundTouchOutside),this.container.addEventListener("touchstart",this.boundTouchStart),this.container.addEventListener("touchend",this.boundTouchEnd),this.container.addEventListener("touchmove",this.boundTouchMove)}addKeyboardEvents(){this.boundKeyDown=this.keyDown.bind(this),this.boundKeyUp=this.keyUp.bind(this),document.addEventListener("keydown",this.boundKeyDown),document.addEventListener("keyup",this.boundKeyUp)}addEscKeyHandler(){this.boundEscHandler=t=>{t.keyCode===27&&(this.fullscreenView?this.closeFullscreenModal(t):this.isZoomed?this.removeZoom():this.glass&&this.removeGlass())},document.addEventListener("keydown",this.boundEscHandler)}removeEscKeyHandler(){document.removeEventListener("keydown",this.boundEscHandler)}removeMouseEvents(){this.innerBox.removeEventListener("click",this.boundMouseClick),this.innerBox.removeEventListener("mousedown",this.boundMouseDown),this.innerBox.removeEventListener("mouseleave",this.boundMouseLeave),document.removeEventListener("mousemove",this.boundMouseMove),document.removeEventListener("mouseup",this.boundMouseUp)}removeTouchEvents(){document.removeEventListener("touchstart",this.boundTouchOutside),this.container.removeEventListener("touchstart",this.boundTouchStart),this.container.removeEventListener("touchend",this.boundTouchEnd),this.container.removeEventListener("touchmove",this.boundTouchMove)}removeKeyboardEvents(){document.removeEventListener("keydown",this.boundKeyDown),document.removeEventListener("keyup",this.boundKeyUp)}createContainers(t){this.iconsContainer=ge(this.innerBox),this.canvas=ji(this.innerBox,t),this.loader=Ki(this.innerBox),this.ariaLiveRegion=ts(this.innerBox);const i=this.canvas.transferControlToOffscreen();this.canvasWorker.postMessage({action:"initCanvas",offscreen:i,devicePixelRatio:this.devicePixelRatio},[i]),this.fullscreenView&&this.addCloseFullscreenIcon(),Jt(this.innerBox,".cloudimage-360-placeholder")}update(t){this.isReady&&(this.stopAutoplay(),Jt(this.innerBox,".cloudimage-360-icons-container"),this.init(this.container,t,!0),this.iconsContainer=ge(this.innerBox),this.onAllImagesLoaded())}init(t,i,s){const o=i?Xi(i):Ti(t),{folder:n,apiVersion:l,filenameX:r,filenameY:a,imageListX:c,imageListY:h,indexZeroBase:p,amountX:f,amountY:u,draggable:I=!0,swipeable:g=!0,keys:v,keysReverse:m,bottomCircleOffset:b,autoplay:x,autoplayBehavior:w,playOnce:C,speed:y,autoplayReverse:O,fullscreen:S,magnifier:E,ciToken:A,ciFilters:k,ciTransformation:R,lazyload:T,dragSpeed:z,stopAtEdges:G,pointerZoom:Y,imageInfo:Z="black",initialIconShown:rt,bottomCircle:U,hotspots:at,dragReverse:vt,hide360Logo:tt,logoSrc:lt,inertia:q,pinchZoom:V,hints:et,theme:it,hotspotTimelineOnClick:K=!0,aspectRatio:ct,onReady:Vt,onLoad:gt,onSpin:jt,onAutoplayStart:Xt,onAutoplayStop:$t,onFullscreenOpen:zt,onFullscreenClose:Pt,onZoomIn:Rt,onZoomOut:Gt,onDragStart:Ut,onDragEnd:_,onError:ht}=o,yt={ciToken:A,ciFilters:k,ciTransformation:R},dt=qt(c,[]),st=qt(h,[]);if(this.viewerConfig=o,this.amountX=dt.length||f,this.amountY=st.length||u,this.allowSpinX=!!this.amountX,this.allowSpinY=!!this.amountY,this.activeImageX=O?this.amountX-1:0,this.activeImageY=O?this.amountY-1:0,this.bottomCircleOffset=b,this.autoplay=x,this.autoplayBehavior=w,this.playOnce=C,this.speed=y,this.autoplayReverse=O,this.fullscreen=S,this.magnifier=E>1?Math.min(E,Li):0,this.dragSpeed=Math.max(z,Ai),this.stopAtEdges=G,this.ciParams=yt,this.apiVersion=l,this.pointerZoom=Y>1?Math.min(Y,me):null,this.keysReverse=m,this.info=Z,this.keys=v,this.innerBox=this.innerBox??Gi(this.container),ct&&(this.container.style.aspectRatio=ct),this.initialIconShown=rt,this.bottomCircle=U,this.spinDirection=Ss(this.autoplayBehavior,this.allowSpinX,this.allowSpinY),this.dragReverse=vt,this.hotspots=at,this.hide360Logo=tt,this.logoSrc=lt,this.inertia=q,this.pinchZoom=V,this.hints=et,this.hotspotTimelineOnClick=K,it==="dark"?this.container.classList.add("ci360-theme-dark"):it==="light"&&this.container.classList.remove("ci360-theme-dark"),this.onReady=Vt,this.onLoad=gt,this.onSpin=jt,this.onAutoplayStart=Xt,this.onAutoplayStop=$t,this.onFullscreenOpen=zt,this.onFullscreenClose=Pt,this.onZoomIn=Rt,this.onZoomOut=Gt,this.onDragStart=Ut,this.onDragEnd=_,this.onError=ht,this.srcXConfig={folder:n,filename:r,imageList:dt,container:t,innerBox:this.innerBox,apiVersion:l,ciParams:yt,lazyload:T,amount:this.amountX,indexZeroBase:p,autoplayReverse:O,orientation:P.X},this.srcYConfig={...this.srcXConfig,filename:a,imageList:st,orientation:P.Y,amount:this.amountY},s&&this.removeEvents(),this.attachEvents(I,g,v),s)return;const bt=(this.fullscreenView?document.body:this.container).offsetWidth,wt=this.allowSpinX&&!dt.length?Et(this.srcXConfig,bt):null,It=this.allowSpinY&&!st.length?Et(this.srcYConfig,bt):null,xt=Je=>{ve({cdnPathX:wt,cdnPathY:It,configX:this.srcXConfig,configY:this.srcYConfig,onImageLoad:(Ct,qe,Qe)=>this.onImageLoad(Ct,qe,Qe),onFirstImageLoad:Ct=>this.onFirstImageLoaded(Je,Ct),onAllImagesLoad:this.onAllImagesLoaded.bind(this),onError:Ct=>this.emit("onError",Ct)})};this.allowSpinX?xe(wt,this.srcXConfig,xt):this.allowSpinY&&xe(It,this.srcYConfig,xt)}}class Jo{constructor(){this.views=new Map,this.initAll=this.initAll.bind(this),this.getViews=this.getViews.bind(this)}generateId(){return`ci360-${Math.random().toString(36).slice(2,11)}`}init(t,i,s){if(!t)return;const o=t.id||this.generateId();t.id||(t.id=o);const n=new Ft(t,i,s);return this.views.set(o,n),n}initAll(t="cloudimage-360"){[...document.querySelectorAll(`.${t}`)].filter(Boolean).forEach(s=>{const o=s.id||this.generateId();s.id||(s.id=o);const n=new Ft(s);this.views.set(o,n)})}destroy(t){const i=this.getViewById(t);i&&(i.destroy(),this.views.delete(t))}destroyAll(){this.views.forEach(t=>{t.destroy()}),this.views.clear()}getViewById(t){return this.views.get(t)}getViews(){return Array.from(this.views.values())}updateView(t,i){const s=this.getViewById(t);if(!s)return null;const o={...s.viewerConfig,...i};s.destroy();const n=document.getElementById(t);return this.init(n,o)}}exports.default=Jo;
|
|
35
|
-
//# sourceMappingURL=ci360-TSs45Yhc.js.map
|