File: /home/zeusxp5/chuair.org/wp-content/plugins/wd-framework/build/panorama.js
!function(){var e,t={4690:function(e,t,r){"use strict";var a=window.wp.element,n=window.wp.blocks,o=(r(4184),window.wp.i18n);const{useBlockProps:i,InspectorControls:l,MediaUpload:c,MediaUploadCheck:s}=wp.blockEditor,{PanelBody:u,SelectControl:d,RangeControl:p,TextControl:m,ToggleControl:v,Button:w}=wp.components,{useState:f,useEffect:_}=wp.element,{useBlockProps:g}=wp.blockEditor;var h=JSON.parse('{"apiVersion":2,"name":"webdevia/panorama","version":"0.1.0","title":"Panorama 360","category":"webdevia","description":"The panorama block allows you to display an immersive 360-degree view using an equirectangular image. This block is ideal for showcasing scenic views, real estate properties, or any other immersive experience where a panoramic view is desired.","attributes":{"mediaId":{"type":"number","default":0},"mediaUrl":{"type":"string","default":"https://via.placeholder.com/1200x350"},"blockHeight":{"type":"number","default":350},"autoRotate":{"type":"boolean","default":false},"autoRotateSpeed":{"type":"number","default":0.5}},"supports":{"__experimentalSettings":true,"anchor":true,"html":false,"align":["wide","full"],"className":true,"spacing":{"margin":true}},"keywords":["wd","webdevia","panorama"],"textdomain":"webdevia-blocks","editorScript":"file:./index.js","editorStyle":"file:./index.css","viewScript":"file:./view.js","style":"file:./style-index.css"}');const{name:b,...k}=h,{withSelect:y}=wp.data;wp.element.createElement,(0,n.registerBlockType)(b,{...k,icon:()=>(0,a.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg","clip-rule":"evenodd",class:"wd-blocks-icon","fill-rule":"evenodd","stroke-linejoin":"round","stroke-miterlimit":"2",viewBox:"0 0 24 24"},(0,a.createElement)("path",{d:"m2 19v-14c0-.552.447-1 1-1 .542 0 4.418 2.028 9 2.028 4.593 0 8.456-2.028 9-2.028.55 0 1 .447 1 1v14c0 .553-.45 1-1 1-.544 0-4.407-2.028-9-2.028-4.582 0-8.458 2.028-9 2.028-.553 0-1-.448-1-1zm1.5-.791 6.449-7.691c.289-.344.879-.338 1.16.012 0 0 1.954 2.434 1.954 2.434l1.704-1.283c.319-.24.816-.168 1.054.154l4.679 6.335v-12.44c-1.58.58-4.819 1.798-8.5 1.798-3.672 0-6.918-1.218-8.5-1.799zm2.657-.834c1.623-.471 3.657-.903 5.843-.903 2.309 0 4.444.479 6.105.98l-3.041-4.117-1.065.802.275.344c.259.323.206.796-.117 1.054-.323.259-.795.207-1.054-.117l-2.591-3.236zm.698-9.534c-1.051 0-1.905.854-1.905 1.905s.854 1.904 1.905 1.904 1.904-.853 1.904-1.904-.853-1.905-1.904-1.905zm0 1.3c.333 0 .604.271.604.605 0 .333-.271.604-.604.604-.334 0-.605-.271-.605-.604 0-.334.271-.605.605-.605z","fill-rule":"nonzero"})),edit:y(((e,t)=>({media:t.attributes.mediaId?e("core").getMedia(t.attributes.mediaId):void 0})))((function(e){let{media:t,attributes:r,setAttributes:n}=e;const{rel:d,mediaId:m,mediaUrl:f,autoRotate:g,autoRotateSpeed:h,blockHeight:b}=r,k="wp-block-webdevia-panorama",y=i({"data-PANOLENS_URL":`${devia.home_url}/js/panolens.min.js`,style:{backgroundImage:`url(${f})`,height:`${b}px`}}),E=e=>{n({mediaId:e.id,mediaUrl:e.url})};return _((()=>{f.includes("placeholder")&&n({mediaUrl:`https://via.placeholder.com/1200x${b}`})}),[b]),_((()=>{}),[]),[(0,a.createElement)(l,null,(0,a.createElement)(u,{title:(0,o.__)("Settings","wd-framework"),initialOpen:!0},(0,a.createElement)("fieldset",{className:`${k}__inspector-controls__picture`},(0,a.createElement)("legend",null,(0,o.__)("Picture","wd-framework")),(0,a.createElement)("div",{className:`${k}__inspector-controls__picture__btns`},(0,a.createElement)(s,null,(0,a.createElement)(c,{onSelect:E,value:m,allowedTypes:["image"],render:e=>{let{open:t}=e;return(0,a.createElement)(w,{className:0==m?`${k}__inspector-controls__picture__toggle`:`${k}__inspector-controls__picture__preview`,onClick:t},0==m&&(0,o.__)("Choose picture","wd-framework"))}})),0!=m&&(0,a.createElement)(s,null,(0,a.createElement)(c,{text:(0,o.__)("Replace picture","wd-framework"),value:m,onSelect:E,allowedTypes:["image"],render:e=>{let{open:t}=e;return(0,a.createElement)(w,{onClick:t,variant:"secondary",isLarge:!0},(0,o.__)("Replace picture","wd-framework"))}})),0!=m&&(0,a.createElement)(s,null,(0,a.createElement)(w,{onClick:()=>{n({mediaId:0,mediaUrl:`https://via.placeholder.com/1200x${b}`})},isLink:!0,isDestructive:!0},(0,o.__)("Remove image","wd-framework")))),(0,a.createElement)("p",{className:`${k}__inspector-controls__picture__help`},(0,o.__)("To create an image panorama, an equirectangular image (2 to 1 ratio e.g. width and height is 1024 x 512) is required.","wd-framework"))),(0,a.createElement)(p,{label:(0,o.__)("Block height","wd-framework"),value:b,onChange:e=>n({blockHeight:e}),min:10,max:1e3,help:(0,o.__)("The value is in pixels.","wd-framework")}),(0,a.createElement)(v,{label:(0,o.__)("Auto rotate","wd-framework"),help:g?"Has auto rotate":"No auto rotate",checked:g,onChange:e=>{n({autoRotate:e})}}),!!g&&(0,a.createElement)(p,{label:(0,o.__)("Auto rotate speed","wd-framework"),value:h,onChange:e=>n({autoRotateSpeed:e}),min:0,max:5,step:.5}))),(0,a.createElement)(l,{__experimentalGroup:"advanced"}),(0,a.createElement)("div",y)]})),save:function(e){let{attributes:t}=e;const{mediaUrl:r,autoRotate:n,autoRotateSpeed:o,blockHeight:i}=t;let l={autoRotate:n,autoRotateSpeed:o};const c=g.save({"data-options":JSON.stringify(l),style:{height:`${i}px`}});return(0,a.createElement)("div",c,(0,a.createElement)("script",{src:`${devia.plugin_uri}js/three.min.js`}),(0,a.createElement)("script",{src:`${devia.plugin_uri}js/panolens.min.js`}),(0,a.createElement)("div",{id:"container","data-url":r}))}})},4184:function(e,t){var r;!function(){"use strict";var a={}.hasOwnProperty;function n(){for(var e=[],t=0;t<arguments.length;t++){var r=arguments[t];if(r){var o=typeof r;if("string"===o||"number"===o)e.push(r);else if(Array.isArray(r)){if(r.length){var i=n.apply(null,r);i&&e.push(i)}}else if("object"===o){if(r.toString!==Object.prototype.toString&&!r.toString.toString().includes("[native code]")){e.push(r.toString());continue}for(var l in r)a.call(r,l)&&r[l]&&e.push(l)}}}return e.join(" ")}e.exports?(n.default=n,e.exports=n):void 0===(r=function(){return n}.apply(t,[]))||(e.exports=r)}()}},r={};function a(e){var n=r[e];if(void 0!==n)return n.exports;var o=r[e]={exports:{}};return t[e](o,o.exports,a),o.exports}a.m=t,e=[],a.O=function(t,r,n,o){if(!r){var i=1/0;for(u=0;u<e.length;u++){r=e[u][0],n=e[u][1],o=e[u][2];for(var l=!0,c=0;c<r.length;c++)(!1&o||i>=o)&&Object.keys(a.O).every((function(e){return a.O[e](r[c])}))?r.splice(c--,1):(l=!1,o<i&&(i=o));if(l){e.splice(u--,1);var s=n();void 0!==s&&(t=s)}}return t}o=o||0;for(var u=e.length;u>0&&e[u-1][2]>o;u--)e[u]=e[u-1];e[u]=[r,n,o]},a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},function(){var e={6144:0,8273:0,2972:0};a.O.j=function(t){return 0===e[t]};var t=function(t,r){var n,o,i=r[0],l=r[1],c=r[2],s=0;if(i.some((function(t){return 0!==e[t]}))){for(n in l)a.o(l,n)&&(a.m[n]=l[n]);if(c)var u=c(a)}for(t&&t(r);s<i.length;s++)o=i[s],a.o(e,o)&&e[o]&&e[o][0](),e[o]=0;return a.O(u)},r=self.webpackChunkwebdevia_blocks=self.webpackChunkwebdevia_blocks||[];r.forEach(t.bind(null,0)),r.push=t.bind(null,r.push.bind(r))}();var n=a.O(void 0,[2972],(function(){return a(4690)}));n=a.O(n)}();