!function(){"use strict";var e=window.wp.blocks,t=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":""},"metadata":{"type":"object"}},"supports":{"anchor":true,"html":false,"color":false,"typography":false,"spacing":false},"render":"file:./render.php","editorScript":"file:./index.js"}'),o=window.wp.primitives,r=window.ReactJSXRuntime,n=(0,r.jsxs)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,r.jsx)(o.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)(o.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)(o.Path,{d:"M12.009 12H12",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),i=window.wp.blockEditor,s=window.wp.components,c=window.wp.i18n,l=window.wp.element;const{icons:a=[],iconsMap:d={}}=window.atomicWindIcons??{};function u({name:e,size:t,isSelected:o,onClick:n}){const i=d[e]||"";return(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 p=["list-view","breadcrumb"],k=e=>e?("string"==typeof e?e.replace(/<[^>]+>/g," "):e.toPlainText?.()??"").replace(/\s+/g," ").trim():"",h=e=>(t,{context:o}={})=>{if(!p.includes(o))return;const r=t?.metadata?.name;return r||(e?e(t):void 0)},m=(h((({tagName:e})=>(e=>{switch(e){case"section":return(0,c.__)("Section","otter-blocks");case"article":return(0,c.__)("Article","otter-blocks");case"main":return(0,c.__)("Main","otter-blocks");case"aside":return(0,c.__)("Aside","otter-blocks");case"header":return(0,c.__)("Header","otter-blocks");case"footer":return(0,c.__)("Footer","otter-blocks");case"nav":return(0,c.__)("Navigation","otter-blocks");case"details":return(0,c.__)("Details","otter-blocks");case"summary":return(0,c.__)("Summary","otter-blocks");default:return}})(e))),h((({content:e})=>k(e)?e:void 0)),h((({mode:e,text:t})=>{if("inner-blocks"!==e)return k(t)?t:void 0})),h((({alt:e})=>k(e)||void 0)),h()),{name:w,...x}=t;(0,e.registerBlockType)(w,{...x,icon:n,edit:function({attributes:e,setAttributes:t}){const{icon:o}=e,[n,p]=(0,l.useState)(""),k=(0,i.useBlockProps)(),h=d[o]||"",m=(0,l.useMemo)((()=>{const e=n.trim().toLowerCase();return e?a.filter((t=>t.includes(e))):a}),[n]);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(i.InspectorControls,{children:(0,r.jsxs)(s.PanelBody,{title:(0,c.__)("Icon","otter-blocks"),children:[(0,r.jsx)(s.SearchControl,{label:(0,c.__)("Search icons","otter-blocks"),value:n,onChange:p}),(0,r.jsx)("div",{style:{display:"grid",gridTemplateColumns:"repeat(6, 1fr)",gap:"4px",maxHeight:"300px",overflowY:"auto",marginTop:"8px"},children:m.slice(0,120).map((e=>(0,r.jsx)(u,{name:e,size:"20",isSelected:e===o,onClick:()=>t({icon:e})},e)))}),n&&m.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")}),(0,r.jsxs)("p",{style:{margin:"12px 0 0",fontSize:"11px",color:"#757575",lineHeight:"1.4"},children:[(0,c.__)("Icons by","otter-blocks")," ",(0,r.jsx)("a",{href:"https://lucide.dev",target:"_blank",rel:"noopener noreferrer",children:"Lucide"})," - ",(0,c.__)("open-source icon library.","otter-blocks")]})]})}),o&&h?(0,r.jsx)("svg",{...k,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",dangerouslySetInnerHTML:{__html:h}}):(0,r.jsx)("div",{...k,style:{...k.style,opacity:.4,fontSize:"12px"},children:(0,c.__)("Select an icon in the sidebar.","otter-blocks")})]})},save:()=>null,__experimentalLabel:m})}();