import{S as e,t,p as s,H as n,h as o,a as c}from"./index.js";const r=(()=>{let e;return(...t)=>{e&&clearTimeout(e),e=setTimeout((()=>{e=0,(e=>{for(let t of e.keys()){const s=e.get(t).filter((e=>{const t=e.deref();return t&&(!("isConnected"in(s=t))||s.isConnected);var s}));e.set(t,s)}})(...t)}),2e3)}})(),a=e.forceUpdate,i=e.getRenderingRef,u=(e,t)=>{const s=e.indexOf(t);s>=0&&(e[s]=e[e.length-1],e.length--)},{state:f}=(()=>{const e=((e,t=(e,t)=>e!==t)=>{const s=()=>{return("function"==typeof(t=e)?t():t)??{};var t},n=s();let o=new Map(Object.entries(n));const c="undefined"!=typeof Proxy,r=c?null:{},a={dispose:[],get:[],set:[],reset:[]},i=new Map,f=()=>{o=new Map(Object.entries(s())),c||b(),a.reset.forEach((e=>e()))},d=e=>(a.get.forEach((t=>t(e))),o.get(e)),l=(e,s)=>{const n=o.get(e);t(s,n,e)&&(o.set(e,s),c||g(e),a.set.forEach((t=>t(e,s,n))))},p=c?new Proxy(n,{get:(e,t)=>d(t),ownKeys:()=>Array.from(o.keys()),getOwnPropertyDescriptor:()=>({enumerable:!0,configurable:!0}),has:(e,t)=>o.has(t),set:(e,t,s)=>(l(t,s),!0)}):(b(),r),m=(e,t)=>(a[e].push(t),()=>{u(a[e],t)});function g(e){!c&&r&&(Object.prototype.hasOwnProperty.call(r,e)||Object.defineProperty(r,e,{configurable:!0,enumerable:!0,get:()=>d(e),set(t){l(e,t)}}))}function b(){if(c||!r)return;const e=new Set(o.keys());for(const t of Object.keys(r))e.has(t)||delete r[t];for(const t of e)g(t)}return{state:p,get:d,set:l,on:m,onChange:(e,t)=>{const n=(s,n)=>{s===e&&t(n)},o=()=>{const n=s();t(n[e])},c=m("set",n),r=m("reset",o);return i.set(t,{setHandler:n,resetHandler:o,propName:e}),()=>{c(),r(),i.delete(t)}},use:(...e)=>{const t=e.reduce(((e,t)=>(t.set&&e.push(m("set",t.set)),t.get&&e.push(m("get",t.get)),t.reset&&e.push(m("reset",t.reset)),t.dispose&&e.push(m("dispose",t.dispose)),e)),[]);return()=>t.forEach((e=>e()))},dispose:()=>{a.dispose.forEach((e=>e())),f()},reset:f,forceUpdate:e=>{const t=o.get(e);a.set.forEach((s=>s(e,t,t)))},removeListener:(e,t)=>{const s=i.get(t);s&&s.propName===e&&(u(a.set,s.setHandler),u(a.reset,s.resetHandler),i.delete(t))}}})({delete_svg_src:"",add_svg_src:"",edit_svg_src:""},void 0);return e.use((()=>{if("function"!=typeof i||"function"!=typeof a)return{};const e=a,t=i,s=new Map;return{dispose:()=>s.clear(),get:e=>{const n=t();n&&((e,t,s)=>{let n=e.get(t);n||(n=[],e.set(t,n)),n.some((e=>e.deref()===s))||n.push(new WeakRef(s))})(s,e,n)},set:t=>{const n=s.get(t);if(n){const o=n.filter((t=>{const s=t.deref();return!!s&&e(s)}));s.set(t,o)}r(s)},reset:()=>{s.forEach((t=>{t.forEach((t=>{const s=t.deref();s&&e(s)}))})),r(s)}}})()),e})(),d=s(class extends n{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow()}render(){const e={delete:{src:f.delete_svg_src,alt:"❌"},add:{src:f.add_svg_src,alt:"➕"},edit:{src:f.edit_svg_src,alt:"✏️"}}[this.type];return e?.src||console.error(`Icon type "${this.type}" src is missing`),o(c,{key:"c4557c84f018a2c2de824574dce1c85acd92b7f7"},o("img",{key:"2fc1959f1840931071c47b941c8a547eb8c0b2bc",src:e.src,alt:e.alt}))}},[1,"image-icon",{type:[1]}]);function l(){"undefined"!=typeof customElements&&["image-icon"].forEach((e=>{"image-icon"===e&&(customElements.get(t(e))||customElements.define(t(e),d))}))}l();export{d as I,l as d,f as s}