import{F as W,S as A,i as k,s as w,n as p,d as G,G as z,H as O,t as u,a as v,b as R,r as d,l as N,I as y,e as _,J,v as K,c as E,o as M,K as T}from"./index-BRw4aYKO.js";function q(o){return o&&typeof o.subscribe=="function"}function I(o){const e={};for(const t in o){const l=o[t];if(t==="nodes"&&typeof l=="object"&&typeof l.getAll=="function"){const a=l.getAll();e[t]=a.map(i=>I(i))}else if(q(l)){const a=W(l);e[t]=typeof a=="object"&&a!==null?I(a):a}else typeof l=="object"&&l!==null?e[t]=I(l):e[t]=l}return e}function D(o,e){return e instanceof DOMRectReadOnly?{x:e.x,y:e.y,width:e.width,height:e.height}:e}function F(o){console.log("graph state object:",o);const e=I(o),t=JSON.stringify(e,D);return localStorage.setItem("state",t),t}function H(o){let e,t,l,a=(o[6]===o[0]?o[2]:o[1])+"",i,f,m,g,h;return{c(){e=_("div"),t=_("button"),l=_("span"),i=J(a),f=K(),m=_("button"),m.textContent="Save",E(l,"class","material-symbols-outlined svelte-izjv92"),E(t,"class","svelte-izjv92"),E(m,"class","save-button NW svelte-izjv92"),E(e,"class","controls-wrapper svelte-izjv92"),u(e,"SW",o[3]==="SW"),u(e,"NE",o[3]==="NE"),u(e,"SE",o[3]==="SE"),u(e,"NW",o[3]==="NW"),v(e,"--prop-theme-toggle-color",o[4]),v(e,"--prop-theme-toggle-text-color",o[5])},m(s,r){R(s,e,r),d(e,t),d(t,l),d(l,i),d(e,f),d(e,m),g||(h=[N(t,"mousedown",y(o[8])),N(t,"touchstart",y(o[8]),{passive:!0}),N(m,"click",o[10])],g=!0)},p(s,[r]){r&71&&a!==(a=(s[6]===s[0]?s[2]:s[1])+"")&&O(i,a),r&8&&u(e,"SW",s[3]==="SW"),r&8&&u(e,"NE",s[3]==="NE"),r&8&&u(e,"SE",s[3]==="SE"),r&8&&u(e,"NW",s[3]==="NW"),r&16&&v(e,"--prop-theme-toggle-color",s[4]),r&32&&v(e,"--prop-theme-toggle-text-color",s[5])},i:p,o:p,d(s){s&&G(e),g=!1,z(h)}}}function V(o,e,t){console.log("Componente ThemeToggle.svelte");let{main:l="light"}=e,{alt:a="dark"}=e,{mainIcon:i="light_mode"}=e,{altIcon:f="dark_mode"}=e,{corner:m="NE"}=e,{bgColor:g=null}=e,{iconColor:h=null}=e,s=l;function r(){const n=document.documentElement.getAttribute("svelvet-theme");let c;!n||n===l?c=a:c=l,t(6,s=c),document.documentElement.setAttribute("svelvet-theme",c),localStorage.setItem("currentTheme",c)}M(()=>{const n=localStorage.getItem("currentTheme");n?(document.documentElement.setAttribute("svelvet-theme",n),t(6,s=n)):(document.documentElement.setAttribute("svelvet-theme",l),t(6,s=l));const c=localStorage.getItem("state");if(c){console.log("Al renderizar la aplicacion este componente se ejecuta en este orden");const b=JSON.parse(c);if(b&&b.nodes){const C=W(T);console.log(C),C.set("G-1",b),console.log("Restaurando nodos:",b.nodes)}}});let S;T.subscribe(n=>{t(7,S=n.get("G-1")),console.log("Graph from store:",S)});const j=()=>{F(S)};return o.$$set=n=>{"main"in n&&t(0,l=n.main),"alt"in n&&t(9,a=n.alt),"mainIcon"in n&&t(1,i=n.mainIcon),"altIcon"in n&&t(2,f=n.altIcon),"corner"in n&&t(3,m=n.corner),"bgColor"in n&&t(4,g=n.bgColor),"iconColor"in n&&t(5,h=n.iconColor)},[l,i,f,m,g,h,s,S,r,a,j]}class L extends A{constructor(e){super(),k(this,e,V,H,w,{main:0,alt:9,mainIcon:1,altIcon:2,corner:3,bgColor:4,iconColor:5})}}export{L as default};
