!function(){"use strict";var e={n:function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,{a:n}),n},d:function(t,n){for(var o in n)e.o(n,o)&&!e.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:n[o]})},o:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}},t=window.wp.blocks,n=window.wp.element,o=window.wp.serverSideRender,a=e.n(o),r=window.wp.i18n,l=window.wp.blockEditor,s=window.wp.data,c=window.wp.components,i=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","name":"terms-block/terms","title":"Terms","apiVersion":3,"icon":"tag","description":"Displays a list of all terms in the selected taxonomy.","textdomain":"terms-block","attributes":{"className":{"type":"string","default":""},"taxonomy":{"type":"string","default":"category"}},"category":"widgets","editorScript":"file:./index.js"}');const{name:m}=i;(0,t.registerBlockType)(m,{...i,edit:function({className:e,attributes:o,setAttributes:m}){const{taxonomy:u}=o,d=(0,s.useSelect)((e=>e("core").getTaxonomies({per_page:-1})||[]),[]),p=(0,s.useSelect)((e=>e("core").getEntityRecords("taxonomy",u,{})||[]),[u]),w=(0,n.createElement)(l.InspectorControls,null,(0,n.createElement)(c.PanelBody,{title:"Settings"},(0,n.createElement)(c.SelectControl,{label:"Taxonomy",onChange:e=>{m({taxonomy:e})},value:u,options:[...d.map((({name:e,slug:t})=>({value:t,label:e})))]}))),y=(0,t.getBlockDefaultClassName)(i.name),b=((e,t=[])=>{const n=(e=>e.flatMap((e=>e?e.split(" "):[])))(t),{className:o}=e,a=o?o.split(" "):[];return{...e,className:a.filter((e=>!n.includes(e))).join(" ")}})((0,l.useBlockProps)(),[y,e]);return Array.isArray(p)&&p.length?(0,n.createElement)(n.Fragment,null,w,(0,n.createElement)("div",{...b},(0,n.createElement)(c.Disabled,null,(0,n.createElement)(a(),{className:e,block:i.name,attributes:o,emptyResponseLabel:(0,r.__)("Term Not Found.","terms-block")})))):(0,n.createElement)(n.Fragment,null,w,(0,n.createElement)(c.Placeholder,{icon:i.icon,label:(0,r.__)("Terms")},(0,r.__)("No terms found.")))},save:()=>null})}();