!function(){"use strict";var e=window.wp.blocks,o=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"atomic-wind/icon","title":"Icon","category":"atomic-wind","description":"An inline SVG icon from the Lucide icon set.","keywords":["icon","svg","lucide"],"textdomain":"atomic-wind","attributes":{"icon":{"type":"string","default":""}},"supports":{"anchor":true,"html":false,"color":false,"typography":false,"spacing":false},"render":"file:./render.php","editorScript":"file:./index.js"}'),n=window.wp.primitives,t=window.ReactJSXRuntime,r=(0,t.jsxs)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,t.jsx)(n.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M20.3541 3.64593C18.5085 1.8004 13.2722 4.04455 8.65837 8.65837C4.04455 13.2722 1.8004 18.5085 3.64593 20.3541C5.49146 22.1996 10.7278 19.9555 15.3416 15.3416C19.9555 10.7278 22.1996 5.49146 20.3541 3.64593Z",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),(0,t.jsx)(n.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M3.64593 3.64593C1.8004 5.49146 4.04455 10.7278 8.65837 15.3416C13.2722 19.9555 18.5085 22.1996 20.3541 20.3541C22.1996 18.5085 19.9555 13.2722 15.3416 8.65837C10.7278 4.04455 5.49146 1.8004 3.64593 3.64593Z",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),(0,t.jsx)(n.Path,{d:"M12.009 12H12",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),i=window.wp.blockEditor,s=window.wp.components,l=window.wp.i18n,c=window.wp.element;const{icons:d=[],iconsMap:a={}}=window.atomicWindIcons??{};function p({name:e,size:o,isSelected:n,onClick:r}){const i=a[e]||"";return(0,t.jsx)("button",{type:"button",title:e,onClick:r,style:{background:n?"var(--wp-admin-theme-color, #007cba)":"transparent",border:"1px solid",borderColor:n?"transparent":"#ddd",borderRadius:"4px",cursor:"pointer",padding:"6px",color:n?"#fff":"currentColor",display:"flex",alignItems:"center",justifyContent:"center"},children:i&&(0,t.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",dangerouslySetInnerHTML:{__html:i}})})}const{name:u,...h}=o;(0,e.registerBlockType)(u,{...h,icon:r,edit:function({attributes:e,setAttributes:o}){const{icon:n}=e,[r,u]=(0,c.useState)(""),h=(0,i.useBlockProps)(),w=a[n]||"",k=(0,c.useMemo)((()=>{const e=r.trim().toLowerCase();return e?d.filter((o=>o.includes(e))):d}),[r]);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(i.InspectorControls,{children:(0,t.jsxs)(s.PanelBody,{title:(0,l.__)("Icon","otter-blocks"),children:[(0,t.jsx)(s.SearchControl,{label:(0,l.__)("Search icons","otter-blocks"),value:r,onChange:u}),(0,t.jsx)("div",{style:{display:"grid",gridTemplateColumns:"repeat(6, 1fr)",gap:"4px",maxHeight:"300px",overflowY:"auto",marginTop:"8px"},children:k.slice(0,120).map((e=>(0,t.jsx)(p,{name:e,size:"20",isSelected:e===n,onClick:()=>o({icon:e})},e)))}),r&&k.length>120&&(0,t.jsx)("p",{style:{fontSize:"11px",color:"#757575",marginTop:"4px"},children:(0,l.__)("Showing first 120 results — refine your search.","otter-blocks")}),(0,t.jsxs)("p",{style:{margin:"12px 0 0",fontSize:"11px",color:"#757575",lineHeight:"1.4"},children:[(0,l.__)("Icons by","otter-blocks")," ",(0,t.jsx)("a",{href:"https://lucide.dev",target:"_blank",rel:"noopener noreferrer",children:"Lucide"})," - ",(0,l.__)("open-source icon library.","otter-blocks")]})]})}),n&&w?(0,t.jsx)("svg",{...h,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",dangerouslySetInnerHTML:{__html:w}}):(0,t.jsx)("div",{...h,style:{...h.style,opacity:.4,fontSize:"12px"},children:(0,l.__)("Select an icon in the sidebar.","otter-blocks")})]})},save:()=>null})}();