import{g as n,r as o,l as e,i as t,a as r,b as i,m as s,t as c,T as a,c as d}from"./p-fiRXhuXK.js";const f=Symbol.for("effect/Brand/Refined"),u=function(...c){const a=2===c.length?n=>c[0](n)?o(n):e(c[1](n)):n=>s(c[0](n),{onNone:()=>o(n),onSome:e});return Object.assign((o=>n(a(o),t)),{[f]:f,option:n=>i(a(n)),either:a,is:n=>r(a(n))})}(g,(()=>[{message:"SVG data is malformed",meta:undefined}]));class l extends(a("BrandValidationError")){constructor(n,o){super(new Error(`Brand validation failed for type ${o}.`,{cause:n}))}}function g(n){if("string"!=typeof n)return!1;try{return"svg"===(new DOMParser).parseFromString(n,"image/svg+xml").documentElement.nodeName}catch{return!1}}const v=Symbol.for("LMVZ__iconProviderRegistry"),w={};function m(){return"undefined"==typeof window?w:window[v]??(window[v]={})}function p(n,o){const e=m(),t=n;Object.prototype.hasOwnProperty.call(e,t)&&console.warn(`Icon provider with name "${t}" is already registered. Overwriting existing provider.`),e[t]=o}function y(n){const o=m();if(n)return o[n];const e=Object.keys(o);if(0===e.length)return;e.length>1&&console.warn(`Multiple icon providers registered (${e.join(", ")}). Using the first one: "${e[0]}".`);const t=e[0];return t?o[t]:void 0}const $=()=>u('<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"></svg>');async function h(n){const{icon:o,iconset:e}=n;return await(async()=>{const n=y(e);if(n)try{const t=await Promise.resolve(n.resolve(o));if(!t?.svg)return void console.warn(`Icon "${o}"${e?` from set "${e}"`:""} not found in provider. Using default icon.`);const r=await async function(n){try{return await d((o=n,c({try:()=>u(o),catch:n=>new l(n,"SVGString")})))}catch{return console.error("Invalid SVG string:",n),$()}var o}(t.svg);if(r)return r}catch(n){return void console.error(`Error resolving icon "${o}" with provider:`,n)}else console.warn(`No icon provider registered. Unable to resolve icon "${o}"${e?` from set "${e}"`:""}. Using default icon.`)})()||(console.error(`Icon "${o}" not found${e?` in set "${e}"`:""}. Using default icon.`),$())}function b(n,o){return{iconset:n,icon:o}}export{h as a,y as g,g as i,p as r,b as t}