(()=>{"use strict";const e=window.wp.blocks,l=window.React,t=window.wp.i18n,a=window.wp.blockEditor,o=window.wp.components,n=JSON.parse('{"UU":"lazy-load-videos-and-sticky-control/llvasc"}');(0,e.registerBlockType)(n.UU,{edit:function({attributes:e,setAttributes:n}){const{videoType:i,videoID:s,videoURL:d}=e;return(0,l.createElement)("div",{...(0,a.useBlockProps)()},(0,l.createElement)(a.InspectorControls,{key:"setting"},(0,l.createElement)(o.SelectControl,{label:(0,t.__)("Select a video platform","text-domain"),value:i,options:[{label:(0,t.__)("YouTube","text-domain"),value:"youtube"},{label:(0,t.__)("Wistia","text-domain"),value:"wistia"},{label:(0,t.__)("Vimeo","text-domain"),value:"vimeo"},{label:(0,t.__)("Dailymotion","text-domain"),value:"dailymotion"},{label:(0,t.__)("JW Player","text-domain"),value:"jwplayer"},{label:(0,t.__)("HTML5","text-domain"),value:"html5"}],onChange:e=>{n("html5"===e?{videoType:e,videoID:"",videoURL:""}:{videoType:e,videoID:""})}}),"uninstalled"===llvascEssentials["llvasc-addon"]&&"youtube"!==i&&(0,l.createElement)(l.Fragment,null,(0,l.createElement)("p",{style:{backgroundColor:"yellow"}},"This feature is only available with the addon plugin. Contact the author.")),"uninstalled"===llvascEssentials["llvasc-addon"]&&"youtube"===i&&(0,l.createElement)(o.TextControl,{className:"blocks-base-control__input",label:(0,t.__)("Video ID","text-domain"),value:s,onChange:e=>n({videoID:e})}),"activated"===llvascEssentials["llvasc-addon"]&&(0,l.createElement)(l.Fragment,null,"html5"!==i&&(0,l.createElement)(o.TextControl,{className:"blocks-base-control__input",label:(0,t.__)("Video ID","text-domain"),value:s,onChange:e=>n({videoID:e})}),"html5"===i&&(0,l.createElement)(a.MediaUpload,{onSelect:e=>n({videoURL:e.url}),type:"video",value:d,render:({open:e})=>(0,l.createElement)(o.Button,{isPrimary:!0,onClick:e},(0,t.__)("Select Video")),allowedTypes:["video"]}))),"uninstalled"===llvascEssentials["llvasc-addon"]&&"youtube"!==i&&(0,l.createElement)(l.Fragment,null,(0,l.createElement)("p",null,"This feature is only available with the addon plugin. Contact the author.")),"uninstalled"===llvascEssentials["llvasc-addon"]&&"youtube"===i&&(0,l.createElement)(l.Fragment,null,`[lazy-load-videos-and-sticky-control type="${i}" id="${s}"]`),"activated"===llvascEssentials["llvasc-addon"]&&(0,l.createElement)(l.Fragment,null,`[lazy-load-videos-and-sticky-control type="${i}" ${"html5"===i?`url="${d}"`:`id="${s}"`}]`))},save:function({attributes:e}){const{videoType:t,videoID:o,videoURL:n}=e;return(0,l.createElement)("div",{...a.useBlockProps.save()},"html5"!==t&&(0,l.createElement)(l.Fragment,null,`[lazy-load-videos-and-sticky-control type="${t}" id="${o}"]`),"html5"===t&&(0,l.createElement)(l.Fragment,null,`[lazy-load-videos-and-sticky-control type="${t}" url="${n}"]`))}})})();