!function(e){function t(l){if(n[l])return n[l].exports;var i=n[l]={i:l,l:!1,exports:{}};return e[l].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var n={};t.m=e,t.c=n,t.d=function(e,n,l){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:l})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=0)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});n(1)},function(e,t,n){"use strict";var l=n(2),i=(n.n(l),n(3)),r=(n.n(i),wp.components),a=r.IconButton,o=r.PanelBody,c=r.TextControl,m=r.Toolbar,s=r.withNotices,u=r.Notice,d=wp.element.Fragment,p=wp.i18n.__,g=wp.blocks.registerBlockType,w=wp.editor,h=w.BlockControls,f=w.InspectorControls,b=w.BlockAlignmentToolbar,y=w.MediaPlaceholder,E=w.MediaUpload,v=w.MediaUploadCheck,k=(w.AlignmentToolbar,w.RichText,["image"]),x={title:{type:"array",source:"children",selector:"p"},url:{type:"string"},align:{type:"string"},widthBeforeWideFullAlignments:{type:"number",default:600},width:{type:"number",default:600},height:{type:"number",default:300},contentAlign:{type:"string",default:"center"},id:{type:"number"}};g("cgb/block-algori-360-image",{title:p("360\xb0 Image"),description:p("If an image is worth 1,000 words, imagine how many more words an interactive 360\xb0 image is worth! Insert a single 360\xb0 image."),icon:"format-image",category:"common",keywords:[p("algori panorama image - three sixty degree photo"),p("spherical photo - full-sphere 3D image"),p("equirectangular image - VR (Virtual Reality) photography")],attributes:x,edit:s(function(e){var t=e.attributes,n=e.setAttributes,l=(e.isSelected,e.className),i=e.noticeOperations,r=e.noticeUI,s=t.url,g=(t.title,t.align),w=t.widthBeforeWideFullAlignments,x=t.width,I=t.height,N=(t.contentAlign,t.id),O=function(e){return n({width:parseInt(e,10),widthBeforeWideFullAlignments:parseInt(e,10)})},A=function(e){return n({height:parseInt(e,10)})},T=function(e){if(!e||!e.url)return void n({url:void 0,id:void 0});n({url:e.url,id:e.id})},B=function(e){e!==s&&n({url:e,id:void 0})},C=function(e){var t=-1!==["wide","full"].indexOf(e)?{width:void 0}:{width:w};n(Object.assign({},t,{align:e}))},_=wp.element.createElement(d,null,wp.element.createElement(h,null,wp.element.createElement(b,{value:g,onChange:C}),wp.element.createElement(m,null,wp.element.createElement(v,null,wp.element.createElement(E,{onSelect:T,allowedTypes:k,value:N,render:function(e){var t=e.open;return wp.element.createElement(a,{className:"components-toolbar__control",label:p("Edit image"),icon:"edit",onClick:t})}})))),!!s&&wp.element.createElement(f,null,wp.element.createElement(o,{title:p("360\xb0 Image Settings")},wp.element.createElement("div",null,wp.element.createElement("p",null,p("Image Dimensions")),wp.element.createElement("div",null,-1!==["wide","full"].indexOf(g)?wp.element.createElement(u,{status:"informational",isDismissible:"false"},p("The")," \xa0",wp.element.createElement("strong",null,p("Width"))," \xa0",p("setting has been disabled because you have chosen either")," \xa0",wp.element.createElement("strong",null,p("Full"))," \xa0",p("or")," \xa0",wp.element.createElement("strong",null,p("Wide"))," \xa0",p("width alignment from the block toolbar.")):wp.element.createElement(c,{type:"number",label:p("Width"),value:void 0!==x?x:"",placeholder:600,min:1,onChange:O}),wp.element.createElement(c,{type:"number",label:p("Height"),value:void 0!==I?I:"",placeholder:300,min:1,onChange:A}))))));return s?wp.element.createElement(d,null,_,wp.element.createElement("figure",{style:-1!==["wide","full"].indexOf(g)?{height:I}:{width:x,height:I},className:"wp-block-cgb-block-algori-360-image align"+g},wp.element.createElement("a-scene",{embedded:!0},wp.element.createElement("a-sky",{src:s})))):wp.element.createElement(d,null,_,wp.element.createElement(y,{icon:"format-image",className:l,labels:{title:p("360 Image"),instructions:p("Drag a 360\xb0 image, upload a new one, insert from URL or select a file from your library.")},onSelect:T,onSelectURL:B,accept:"image/*",allowedTypes:k,notices:r,onError:i.createErrorNotice}))}),save:function(e){var t=e.attributes,n=(e.className,t.url),l=(t.title,t.align),i=t.width,r=t.height;t.contentAlign,t.id;return wp.element.createElement("figure",{style:-1!==["wide","full"].indexOf(l)?{height:r}:{width:i,height:r},className:"align"+l},wp.element.createElement("a-scene",{embedded:""},wp.element.createElement("a-sky",{src:n})))},deprecated:[{attributes:Object.assign({},x),save:function(e){var t=e.attributes,n=(e.className,t.url),l=(t.title,t.align,t.width),i=t.height;t.contentAlign,t.id;return wp.element.createElement("figure",{style:{width:l,height:i}},wp.element.createElement("a-scene",{embedded:""},wp.element.createElement("a-sky",{src:n})))}},{attributes:Object.assign({},x),save:function(e){var t=e.attributes,n=(e.className,t.url),l=(t.title,t.align,t.width),i=t.height;t.contentAlign,t.id;return wp.element.createElement("div",null,wp.element.createElement("a-scene",{className:"wp-block-cgb-block-algori-360-image-embedded-scene",style:{width:l,height:i},embedded:""},wp.element.createElement("a-sky",{src:n})))}}]})},function(e,t){},function(e,t){}]);