(()=>{"use strict";const e={n:o=>{const a=o&&o.__esModule?()=>o.default:()=>o;return e.d(a,{a}),a},d:(o,a)=>{if(Array.isArray(a))for(var t=0;t<a.length;){var n=a[t++],l=a[t++];e.o(o,n)?0===l&&t++:0===l?Object.defineProperty(o,n,{enumerable:!0,value:a[t++]}):Object.defineProperty(o,n,{enumerable:!0,get:l})}else for(var n in a)e.o(a,n)&&!e.o(o,n)&&Object.defineProperty(o,n,{enumerable:!0,get:a[n]})},o:(e,o)=>Object.hasOwn(e,o)},o=window.wp.blocks,a=window.wp.primitives,t=window.ReactJSXRuntime;var n=(0,t.jsx)(a.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,t.jsx)(a.Path,{d:"M4.75 4a.75.75 0 0 0-.75.75v7.826c0 .2.08.39.22.53l6.72 6.716a2.313 2.313 0 0 0 3.276-.001l5.61-5.611-.531-.53.532.528a2.315 2.315 0 0 0 0-3.264L13.104 4.22a.75.75 0 0 0-.53-.22H4.75ZM19 12.576a.815.815 0 0 1-.236.574l-5.61 5.611a.814.814 0 0 1-1.153 0L5.5 12.264V5.5h6.763l6.5 6.502a.816.816 0 0 1 .237.574ZM8.75 9.75a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z"})});const l=window.wp.serverSideRender;var r=e.n(l);const s=window.wp.components,i=window.wp.blockEditor,c=window.wp.element,d=window.wp.hooks,p=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"aiopod/tags","version":"1.0.0","title":"AIOPOD - Tags","category":"aio-podcast-studio","keywords":["podcast","episode","tag","aio-podcast-studio","aiopod"],"description":"Display a list of your episode tags.","textdomain":"aio-podcast-studio","editorScript":"file:./index.js"}');function u(e){var o="string";return"categories"==e||"tags"==e||"participants"==e?o="array":"number"==e?o="number":"checkbox"==e&&(o="boolean"),o}(0,o.registerBlockType)(p,{attributes:function(e){var o={};for(var a in e){var t=e[a].fields;for(var n in t)o[t[n].name]={type:u(t[n].type),default:t[n].value}}return o}(aiopod_blocks.tags),icon:n,edit:function({attributes:e,setAttributes:o}){const a=aiopod_blocks.tags,n=e=>a=>{o({[e]:a})},l=(0,c.useRef)();return(0,c.useEffect)(()=>{l.current?(0,d.applyFilters)("aiopod_block_init",e):l.current=!0}),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(i.InspectorControls,{children:Object.keys(a).map((l,r)=>{return c=l,(0,d.applyFilters)("aiopod_block_toggle_panels",!0,c,e)&&(0,t.jsx)(s.PanelBody,{title:a[l].title,initialOpen:0==r,className:"aiopod-block-panel",children:Object.keys(a[l].fields).map((r,c)=>((a,l)=>{if(!(o=>{let a=!0;switch(o){case"orderby":case"order":case"hide_empty":"cloud"==e.layout&&(a=!1)}return(0,d.applyFilters)("aiopod_block_toggle_controls",a,o,e)})(a.name))return"";const r=a.placeholder?a.placeholder:"",c=a.description?a.description:"";switch(a.type){case"header":return(0,t.jsx)(s.PanelRow,{children:(0,t.jsx)("h3",{className:"aiopod-no-margin",children:a.label})},l);case"number":return(0,t.jsx)(s.PanelRow,{children:(0,t.jsx)(s.RangeControl,{label:a.label,help:c,placeholder:r,value:e[a.name],min:a.min,max:a.max,onChange:n(a.name),__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0})},l);case"textarea":return(0,t.jsx)(s.PanelRow,{children:(0,t.jsx)(s.TextareaControl,{label:a.label,help:c,placeholder:r,value:e[a.name],onChange:n(a.name),__nextHasNoMarginBottom:!0})},l);case"select":case"radio":let d=[];for(let e in a.options)d.push({label:a.options[e],value:e});return(0,t.jsx)(s.PanelRow,{children:(0,t.jsx)(s.SelectControl,{label:a.label,help:c,options:d,value:e[a.name],onChange:n(a.name),__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0})},l);case"checkbox":return(0,t.jsx)(s.PanelRow,{children:(0,t.jsx)(s.ToggleControl,{label:a.label,help:c,checked:e[a.name],onChange:(p=a.name,e=>{o({[p]:e})}),__nextHasNoMarginBottom:!0})},l);case"color":return(0,t.jsx)(s.PanelRow,{children:(0,t.jsx)(i.PanelColorSettings,{title:a.label,colorSettings:[{label:aiopod_blocks.i18n.select_color,value:e[a.name],onChange:n(a.name)}]})},l);default:return(0,t.jsx)(s.PanelRow,{children:(0,t.jsx)(s.TextControl,{label:a.label,help:c,placeholder:r,value:e[a.name],onChange:n(a.name),__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0})},l)}var p})(a[l].fields[r],"aiopod-block-control-"+c))},"aiopod-block-panel-"+r);var c})}),(0,t.jsx)("div",{...(0,i.useBlockProps)(),children:(0,t.jsx)(s.Disabled,{children:(0,t.jsx)(r(),{block:"aiopod/tags",attributes:e})})})]})}})})();