!function(){"use strict";var e,t=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,r=window.ReactJSXRuntime,i=(0,r.jsxs)(n.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,r.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,r.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,r.jsx)(n.Path,{d:"M12.009 12H12",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),s=window.wp.blockEditor,l=window.wp.components,c=window.wp.i18n,d=window.wp.element;const{icons:a=[],assetsUrl:p=""}=null!==(e=window.atomicWindIcons)&&void 0!==e?e:{};function u({name:e,size:t,isSelected:o,onClick:n}){const[i,s]=(0,d.useState)("");return(0,d.useEffect)((()=>{e&&fetch(p+e+".svg").then((e=>e.text())).then((e=>{const t=e.match(/<svg[^>]*>([\s\S]*?)<\/svg>/i);s(t?t[1]:"")})).catch((()=>{}))}),[e]),(0,r.jsx)("button",{type:"button",title:e,onClick:n,style:{background:o?"var(--wp-admin-theme-color, #007cba)":"transparent",border:"1px solid",borderColor:o?"transparent":"#ddd",borderRadius:"4px",cursor:"pointer",padding:"6px",color:o?"#fff":"currentColor",display:"flex",alignItems:"center",justifyContent:"center"},children:i&&(0,r.jsx)("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",dangerouslySetInnerHTML:{__html:i}})})}const{name:h,...f}=o;(0,t.registerBlockType)(h,{...f,icon:i,edit:function({attributes:e,setAttributes:t}){const{icon:o}=e,[n,i]=(0,d.useState)(""),[h,f]=(0,d.useState)(""),w=(0,s.useBlockProps)(),x=(0,d.useMemo)((()=>{const e=n.trim().toLowerCase();return e?a.filter((t=>t.includes(e))):a}),[n]);return(0,d.useEffect)((()=>{o?fetch(p+o+".svg").then((e=>e.text())).then((e=>{const t=e.match(/<svg[^>]*>([\s\S]*?)<\/svg>/i);f(t?t[1]:"")})).catch((()=>{})):f("")}),[o]),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(s.InspectorControls,{children:(0,r.jsxs)(l.PanelBody,{title:(0,c.__)("Icon","otter-blocks"),children:[(0,r.jsxs)("p",{style:{margin:"0 0 8px",fontSize:"12px",color:"#757575"},children:[(0,c.__)("Icons by","otter-blocks"),(0,r.jsx)("a",{href:"https://lucide.dev",target:"_blank",rel:"noopener noreferrer",children:"Lucide"})]}),(0,r.jsx)(l.SearchControl,{label:(0,c.__)("Search icons","otter-blocks"),value:n,onChange:i}),(0,r.jsx)("div",{style:{display:"grid",gridTemplateColumns:"repeat(6, 1fr)",gap:"4px",maxHeight:"300px",overflowY:"auto",marginTop:"8px"},children:x.slice(0,120).map((e=>(0,r.jsx)(u,{name:e,size:"20",isSelected:e===o,onClick:()=>t({icon:e})},e)))}),n&&x.length>120&&(0,r.jsx)("p",{style:{fontSize:"11px",color:"#757575",marginTop:"4px"},children:(0,c.__)("Showing first 120 results — refine your search.","otter-blocks")})]})}),o&&h?(0,r.jsx)("svg",{...w,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",dangerouslySetInnerHTML:{__html:h}}):(0,r.jsx)("div",{...w,style:{...w.style,opacity:.4,fontSize:"12px"},children:(0,c.__)("Select an icon in the sidebar.","otter-blocks")})]})},save:()=>null})}();