zen-wdg 2.2.0 → 2.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,15 +1,78 @@
1
- declare const _default: import("vue").DefineComponent<{}, {
1
+ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
2
+ theme: {
3
+ type: StringConstructor;
4
+ default: string;
5
+ };
6
+ small: {
7
+ type: BooleanConstructor;
8
+ default: boolean;
9
+ };
10
+ categories: {
11
+ type: ArrayConstructor;
12
+ default: () => string[];
13
+ };
14
+ open: {
15
+ type: StringConstructor;
16
+ default: string;
17
+ };
18
+ useStorage: {
19
+ type: BooleanConstructor;
20
+ default: boolean;
21
+ };
22
+ }>, {}, {
23
+ STORAGE_KEY: string;
24
+ bookmarks: any;
25
+ activeTab: string;
26
+ }, {
27
+ currentBookmarks(): any;
28
+ getIconStyle(): {
29
+ position: string;
30
+ width: string;
31
+ height: string;
32
+ marginBottom: string;
33
+ borderRadius: string;
34
+ display: string;
35
+ alignItems: string;
36
+ justifyContent: string;
37
+ fontWeight: string;
38
+ fontSize: string;
39
+ color: string;
40
+ userSelect: string;
41
+ };
42
+ }, {
43
+ saveState(): void;
44
+ setActiveTab(tab: any): void;
45
+ openLink(url: any): void;
46
+ deleteBookmark(index: any): void;
47
+ editBookmark(index: any): void;
48
+ addBookmarkPrompt(): void;
49
+ onImageError(event: any, title: any): void;
50
+ }, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
51
+ theme: {
52
+ type: StringConstructor;
53
+ default: string;
54
+ };
55
+ small: {
56
+ type: BooleanConstructor;
57
+ default: boolean;
58
+ };
59
+ categories: {
60
+ type: ArrayConstructor;
61
+ default: () => string[];
62
+ };
63
+ open: {
64
+ type: StringConstructor;
65
+ default: string;
66
+ };
67
+ useStorage: {
68
+ type: BooleanConstructor;
69
+ default: boolean;
70
+ };
71
+ }>> & Readonly<{}>, {
2
72
  small: boolean;
3
73
  theme: string;
4
74
  categories: unknown[];
5
75
  open: string;
6
76
  useStorage: boolean;
7
- $props: {
8
- readonly small?: boolean | undefined;
9
- readonly theme?: string | undefined;
10
- readonly categories?: unknown[] | undefined;
11
- readonly open?: string | undefined;
12
- readonly useStorage?: boolean | undefined;
13
- };
14
- }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
77
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
15
78
  export default _default;
package/dist/zen-wdg.css CHANGED
@@ -1 +1 @@
1
- .clock-container[data-v-e9445086]{display:flex;justify-content:center;align-items:center;height:100%;width:100%}.clock[data-v-e9445086]{text-align:center;font-family:Arial,sans-serif;color:#333;background-color:#14141466;backdrop-filter:blur(.2rem);border-radius:15px;padding:20px;width:100%}.time[data-v-e9445086]{font-size:4em;font-weight:700;color:#fff;display:flex;justify-content:center}.date[data-v-e9445086]{font-size:1.2em;color:#fff;margin-top:10px}@media (max-width: 500px){.time[data-v-e9445086]{font-size:3em}.date[data-v-e9445086]{font-size:1em}}input[data-v-2ad90286]{padding:.5rem 1rem;border:none}.full-width[data-v-2ad90286]{width:100%}input[data-v-2ad90286]:focus{outline:none}.round[data-v-2ad90286]{border-radius:.2rem}.rounded[data-v-2ad90286]{border-radius:10rem}button[data-v-10678914]{cursor:pointer;border:none;padding:.5rem;display:flex;align-items:center;justify-content:center;gap:.5rem;transition:.5s ease-in-out background}.w-full[data-v-10678914]{width:100%}.bound[data-v-10678914]{border-radius:.2rem}.bounded[data-v-10678914]{border-radius:50%}.flat[data-v-10678914]{padding:0;line-height:0;background-color:transparent}.search[data-v-50392e2c]{background-color:var(--bg-color);display:flex;align-items:center;padding:.2rem 1rem;border-radius:5rem;border:.01rem solid var(--orange);box-shadow:0 0 .4rem var(--border-color)}.search img[data-v-50392e2c]{width:20px}.todo-widget[data-v-edabf7fa]{width:100%;background-color:#14141466;backdrop-filter:blur(.2rem);border-radius:16px;padding:20px;color:#fff;box-shadow:0 4px 10px #0000004d;max-width:500px;margin:0 auto}.title[data-v-edabf7fa]{margin-bottom:16px;text-align:center}.todo-form[data-v-edabf7fa]{display:flex;gap:10px;margin-bottom:20px}.todo-form input[data-v-edabf7fa]{flex:1;padding:10px 12px;border:none;border-radius:8px;background-color:#2a2a2a;color:#fff}.todo-form button[data-v-edabf7fa]{background-color:#007bff;color:#fff;border:none;border-radius:8px;padding:10px 16px;cursor:pointer}.task-section[data-v-edabf7fa]{margin-bottom:20px}.task-section h3[data-v-edabf7fa]{margin-bottom:8px;font-size:1rem;color:#ccc}.task-section ul[data-v-edabf7fa]{list-style:none;padding:0}.task-section li[data-v-edabf7fa]{background-color:#292929;padding:10px 12px;border-radius:10px;margin-bottom:8px;display:flex;justify-content:space-between;align-items:center}.actions button[data-v-edabf7fa]{margin-left:8px;background:none;border:none;color:#bbb;cursor:pointer;font-size:1rem}.actions button[data-v-edabf7fa]:hover{color:#fff}.empty[data-v-edabf7fa]{font-size:.9rem;color:#666}.done[data-v-edabf7fa]{text-decoration:line-through;color:#777}.tabs[data-v-5fb970f5]{width:auto;display:flex;gap:10px;margin-bottom:20px;flex-wrap:wrap;background:#dcdcdc66;padding:.2rem;border-radius:.6rem;align-self:start}.container-tab[data-v-5fb970f5]{position:relative}.tab[data-v-5fb970f5]{padding:8px 2rem;border:none;cursor:pointer;transition:.3s;font-weight:600;background-color:transparent;color:#444}.tab.active[data-v-5fb970f5]{background-color:#066d5a;color:#fff;border-radius:.5rem}.grid[data-v-5fb970f5]{display:flex;flex-wrap:wrap;gap:1.4rem}.card[data-v-5fb970f5]{position:relative;flex:1 1 100px}.card.small[data-v-5fb970f5]{flex:1 1 25%;min-width:140px;max-width:170px}.card-link[data-v-5fb970f5]{height:106px;padding:16px;border-radius:1rem;box-shadow:0 2px 4px #0000004d;background-color:#c8c8c84d;backdrop-filter:blur(.2rem);text-align:center;cursor:pointer;text-decoration:none;color:#202020;display:flex;justify-content:center;flex-direction:column}.option-app[data-v-5fb970f5]{display:none;position:absolute;top:10px;right:10px;z-index:2;gap:.4rem}.card:hover .option-app[data-v-5fb970f5]{display:flex;justify-content:center;align-items:center}.delete-app[data-v-5fb970f5],.edit-app[data-v-5fb970f5]{cursor:pointer;border-radius:.2rem;width:23px;height:23px;border:none;font-size:.8rem}.edit-app[data-v-5fb970f5]{font-size:1rem}.card-link img[data-v-5fb970f5]{width:100%;max-width:40px;border-radius:.4rem;margin-bottom:8px}.card-link img.small[data-v-5fb970f5]{max-width:50px}.column[data-v-5fb970f5]{display:flex;flex-direction:column;align-items:center;gap:5px}.add[data-v-5fb970f5]{width:50px;height:50px;background:gray;border-radius:.5rem;display:flex;justify-content:center;font-size:2rem;line-height:50px;color:#fff;user-select:none}
1
+ .clock-container[data-v-e9445086]{display:flex;justify-content:center;align-items:center;height:100%;width:100%}.clock[data-v-e9445086]{text-align:center;font-family:Arial,sans-serif;color:#333;background-color:#14141466;backdrop-filter:blur(.2rem);border-radius:15px;padding:20px;width:100%}.time[data-v-e9445086]{font-size:4em;font-weight:700;color:#fff;display:flex;justify-content:center}.date[data-v-e9445086]{font-size:1.2em;color:#fff;margin-top:10px}@media (max-width: 500px){.time[data-v-e9445086]{font-size:3em}.date[data-v-e9445086]{font-size:1em}}input[data-v-2ad90286]{padding:.5rem 1rem;border:none}.full-width[data-v-2ad90286]{width:100%}input[data-v-2ad90286]:focus{outline:none}.round[data-v-2ad90286]{border-radius:.2rem}.rounded[data-v-2ad90286]{border-radius:10rem}button[data-v-10678914]{cursor:pointer;border:none;padding:.5rem;display:flex;align-items:center;justify-content:center;gap:.5rem;transition:.5s ease-in-out background}.w-full[data-v-10678914]{width:100%}.bound[data-v-10678914]{border-radius:.2rem}.bounded[data-v-10678914]{border-radius:50%}.flat[data-v-10678914]{padding:0;line-height:0;background-color:transparent}.search[data-v-50392e2c]{background-color:var(--bg-color);display:flex;align-items:center;padding:.2rem 1rem;border-radius:5rem;border:.01rem solid var(--orange);box-shadow:0 0 .4rem var(--border-color)}.search img[data-v-50392e2c]{width:20px}.todo-widget[data-v-3560194d]{width:100%;background-color:#14141466;backdrop-filter:blur(.2rem);border-radius:16px;padding:20px;color:#fff;box-shadow:0 4px 10px #0000004d;max-width:500px;margin:0 auto}.title[data-v-3560194d]{margin-bottom:16px;text-align:center}.todo-form[data-v-3560194d]{display:flex;gap:10px;margin-bottom:20px}.todo-form input[data-v-3560194d]{flex:1;padding:10px 12px;border:none;border-radius:8px;background-color:#2a2a2a;color:#fff}.todo-form button[data-v-3560194d]{background-color:#007bff;color:#fff;border:none;border-radius:8px;padding:10px 16px;cursor:pointer}.task-section[data-v-3560194d]{margin-bottom:20px}.task-section h3[data-v-3560194d]{margin-bottom:8px;font-size:1rem;color:#ccc}.task-section ul[data-v-3560194d]{list-style:none;padding:0}.task-section li[data-v-3560194d]{background-color:#292929;padding:10px 12px;border-radius:10px;margin-bottom:8px;display:flex;justify-content:space-between;align-items:center}.actions button[data-v-3560194d]{margin-left:8px;background:none;border:none;color:#bbb;cursor:pointer;font-size:1rem}.actions button[data-v-3560194d]:hover{color:#fff}.empty[data-v-3560194d]{font-size:.9rem;color:#666}.done[data-v-3560194d]{text-decoration:line-through;color:#777}.tabs[data-v-48fb9a13]{width:auto;display:flex;gap:10px;margin-bottom:20px;flex-wrap:wrap;background:#dcdcdc66;padding:.2rem;border-radius:.6rem;align-self:start}.container-tab[data-v-48fb9a13]{position:relative}.tab[data-v-48fb9a13]{padding:8px 2rem;border:none;cursor:pointer;transition:.3s;font-weight:600;background-color:transparent;color:#444}.tab.active[data-v-48fb9a13]{background-color:#066d5a;color:#fff;border-radius:.5rem}.grid[data-v-48fb9a13]{display:flex;flex-wrap:wrap;gap:1.4rem}.card[data-v-48fb9a13]{position:relative;flex:1 1 100px}.card.small[data-v-48fb9a13]{flex:1 1 25%;min-width:140px;max-width:170px}.card-link[data-v-48fb9a13]{height:106px;padding:16px;border-radius:1rem;box-shadow:0 2px 4px #0000004d;background-color:#c8c8c84d;backdrop-filter:blur(.2rem);text-align:center;cursor:pointer;text-decoration:none;color:#202020;display:flex;justify-content:center;flex-direction:column}.option-app[data-v-48fb9a13]{display:none;position:absolute;top:10px;right:10px;z-index:2;gap:.4rem}.card:hover .option-app[data-v-48fb9a13]{display:flex;justify-content:center;align-items:center}.delete-app[data-v-48fb9a13],.edit-app[data-v-48fb9a13]{cursor:pointer;border-radius:.2rem;width:23px;height:23px;border:none;font-size:.8rem}.edit-app[data-v-48fb9a13]{font-size:1rem}.card-link img[data-v-48fb9a13]{width:100%;max-width:40px;border-radius:.4rem;margin-bottom:8px}.card-link img.small[data-v-48fb9a13]{max-width:50px}.column[data-v-48fb9a13]{display:flex;flex-direction:column;align-items:center;gap:5px}.add[data-v-48fb9a13]{width:50px;height:50px;background:gray;border-radius:.5rem;display:flex;justify-content:center;font-size:2rem;line-height:50px;color:#fff;user-select:none}
@@ -17,27 +17,7 @@ var __spreadValues = (a, b) => {
17
17
  return a;
18
18
  };
19
19
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
- var __async = (__this, __arguments, generator) => {
21
- return new Promise((resolve, reject) => {
22
- var fulfilled = (value) => {
23
- try {
24
- step(generator.next(value));
25
- } catch (e) {
26
- reject(e);
27
- }
28
- };
29
- var rejected = (value) => {
30
- try {
31
- step(generator.throw(value));
32
- } catch (e) {
33
- reject(e);
34
- }
35
- };
36
- var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
37
- step((generator = generator.apply(__this, __arguments)).next());
38
- });
39
- };
40
- import { createElementBlock, openBlock, createElementVNode, createTextVNode, toDisplayString, normalizeClass, withKeys, defineComponent, ref, shallowRef, onMounted, watch, onUnmounted, h, nextTick, resolveComponent, normalizeStyle, createBlock, createCommentVNode, createVNode, withModifiers, withDirectives, vModelText, Fragment, renderList, reactive, unref, defineCustomElement } from "vue";
20
+ import { createElementBlock, openBlock, createElementVNode, createTextVNode, toDisplayString, normalizeClass, withKeys, defineComponent, ref, shallowRef, onMounted, watch, onUnmounted, h, nextTick, resolveComponent, normalizeStyle, createBlock, createCommentVNode, createVNode, withModifiers, withDirectives, vModelText, Fragment, renderList, defineCustomElement } from "vue";
41
21
  const _export_sfc = (sfc, props) => {
42
22
  const target = sfc.__vccOpts || sfc;
43
23
  for (const [key, val] of props) {
@@ -100,7 +80,7 @@ const _hoisted_1$4 = { class: "clock-container" };
100
80
  const _hoisted_2$3 = { class: "clock" };
101
81
  const _hoisted_3$2 = { class: "time" };
102
82
  const _hoisted_4$2 = { class: "date" };
103
- function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
83
+ function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) {
104
84
  return openBlock(), createElementBlock("div", _hoisted_1$4, [
105
85
  createElementVNode("div", _hoisted_2$3, [
106
86
  createElementVNode("div", _hoisted_3$2, [
@@ -114,7 +94,7 @@ function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
114
94
  ])
115
95
  ]);
116
96
  }
117
- const ZClockWidget = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["render", _sfc_render$4], ["__scopeId", "data-v-e9445086"]]);
97
+ const ZClockWidget = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["render", _sfc_render$5], ["__scopeId", "data-v-e9445086"]]);
118
98
  const _sfc_main$4 = {
119
99
  data() {
120
100
  return {};
@@ -147,7 +127,7 @@ const _sfc_main$4 = {
147
127
  }
148
128
  };
149
129
  const _hoisted_1$3 = ["placeholder", "value"];
150
- function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
130
+ function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
151
131
  return openBlock(), createElementBlock("input", {
152
132
  placeholder: $props.placeholder,
153
133
  value: $props.modelValue,
@@ -160,7 +140,7 @@ function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
160
140
  ])
161
141
  }, null, 42, _hoisted_1$3);
162
142
  }
163
- const Input = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["render", _sfc_render$3], ["__scopeId", "data-v-2ad90286"]]);
143
+ const Input = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["render", _sfc_render$4], ["__scopeId", "data-v-2ad90286"]]);
164
144
  const matchIconName = /^[a-z0-9]+(-[a-z0-9]+)*$/;
165
145
  const stringToIcon = (value, validate, allowSimpleName, provider = "") => {
166
146
  const colonSeparated = value.split(":");
@@ -1862,7 +1842,7 @@ const _sfc_main$3 = {
1862
1842
  },
1863
1843
  methods: {}
1864
1844
  };
1865
- function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
1845
+ function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
1866
1846
  const _component_Icon = resolveComponent("Icon");
1867
1847
  return openBlock(), createElementBlock("button", {
1868
1848
  class: normalizeClass(
@@ -1893,7 +1873,7 @@ function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
1893
1873
  }, null, 8, ["icon", "width", "height"])) : createCommentVNode("", true)
1894
1874
  ], 6);
1895
1875
  }
1896
- const Button = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["render", _sfc_render$2], ["__scopeId", "data-v-10678914"]]);
1876
+ const Button = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["render", _sfc_render$3], ["__scopeId", "data-v-10678914"]]);
1897
1877
  const _sfc_main$2 = {
1898
1878
  name: "ZSearchWidget",
1899
1879
  data() {
@@ -1930,7 +1910,7 @@ const _sfc_main$2 = {
1930
1910
  };
1931
1911
  const _hoisted_1$2 = { class: "search" };
1932
1912
  const _hoisted_2$2 = ["src"];
1933
- function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
1913
+ function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
1934
1914
  const _component_Input = resolveComponent("Input");
1935
1915
  const _component_Button = resolveComponent("Button");
1936
1916
  return openBlock(), createElementBlock("div", _hoisted_1$2, [
@@ -1955,9 +1935,9 @@ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
1955
1935
  })
1956
1936
  ]);
1957
1937
  }
1958
- const ZSearchWidget = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["render", _sfc_render$1], ["__scopeId", "data-v-50392e2c"]]);
1938
+ const ZSearchWidget = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["render", _sfc_render$2], ["__scopeId", "data-v-50392e2c"]]);
1959
1939
  const _sfc_main$1 = {
1960
- name: "TodoWidget",
1940
+ name: "ZTodoWidget",
1961
1941
  data() {
1962
1942
  return {
1963
1943
  newTask: "",
@@ -2000,7 +1980,7 @@ const _hoisted_8$1 = {
2000
1980
  };
2001
1981
  const _hoisted_9$1 = { class: "done" };
2002
1982
  const _hoisted_10 = ["onClick"];
2003
- function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
1983
+ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
2004
1984
  return openBlock(), createElementBlock("div", _hoisted_1$1, [
2005
1985
  _cache[5] || (_cache[5] = createElementVNode("h2", { class: "title" }, "📝 Mis Tareas", -1)),
2006
1986
  createElementVNode("form", {
@@ -2053,28 +2033,33 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
2053
2033
  ])
2054
2034
  ]);
2055
2035
  }
2056
- const ZTodoWidget = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render], ["__scopeId", "data-v-edabf7fa"]]);
2057
- const _hoisted_1 = { class: "tabs" };
2058
- const _hoisted_2 = ["onClick"];
2059
- const _hoisted_3 = { class: "grid" };
2060
- const _hoisted_4 = { class: "option-app" };
2061
- const _hoisted_5 = ["onClick"];
2062
- const _hoisted_6 = ["onClick"];
2063
- const _hoisted_7 = ["onClick"];
2064
- const _hoisted_8 = { class: "column" };
2065
- const _hoisted_9 = ["src", "alt", "onError"];
2066
- const STORAGE_KEY = "bookmark_manager_state";
2036
+ const ZTodoWidget = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1], ["__scopeId", "data-v-3560194d"]]);
2067
2037
  const _sfc_main = {
2068
- __name: "z-marked-widget",
2038
+ name: "ZMarkedWidget",
2069
2039
  props: {
2070
- theme: { type: String, default: "light" },
2071
- small: { type: Boolean, default: false },
2072
- categories: { type: Array, default: () => ["Personal", "Work", "Study"] },
2073
- open: { type: String, default: "self" },
2074
- useStorage: { type: Boolean, default: false }
2040
+ theme: {
2041
+ type: String,
2042
+ default: "light"
2043
+ },
2044
+ small: {
2045
+ type: Boolean,
2046
+ default: false
2047
+ },
2048
+ categories: {
2049
+ type: Array,
2050
+ default: () => ["Personal", "Work", "Study"]
2051
+ },
2052
+ open: {
2053
+ type: String,
2054
+ default: "self"
2055
+ },
2056
+ useStorage: {
2057
+ type: Boolean,
2058
+ default: false
2059
+ }
2075
2060
  },
2076
- setup(__props) {
2077
- const props = __props;
2061
+ data() {
2062
+ const STORAGE_KEY = "bookmark_manager_state";
2078
2063
  const defaultBookmarks = {
2079
2064
  Personal: [
2080
2065
  { title: "Reddit", url: "https://reddit.com", logo: "https://www.google.com/s2/favicons?domain=reddit.com&sz=64" },
@@ -2095,162 +2080,175 @@ const _sfc_main = {
2095
2080
  { title: "FreeCodeCamp", url: "https://freecodecamp.org", logo: "https://www.google.com/s2/favicons?domain=freecodecamp.org&sz=64" }
2096
2081
  ]
2097
2082
  };
2098
- const state = reactive({
2099
- bookmarks: props.useStorage ? JSON.parse(localStorage.getItem(STORAGE_KEY)) || defaultBookmarks : defaultBookmarks,
2083
+ const bookmarks = this.useStorage ? JSON.parse(localStorage.getItem(STORAGE_KEY)) || defaultBookmarks : defaultBookmarks;
2084
+ return {
2085
+ STORAGE_KEY,
2086
+ bookmarks,
2100
2087
  activeTab: "Personal"
2101
- });
2102
- const categories = ref([...props.categories]);
2103
- const small = ref(props.small);
2104
- const theme = ref(props.theme);
2105
- const open = ref(props.open);
2106
- const useStorage = ref(props.useStorage);
2107
- const currentBookmarks = computed(() => state.bookmarks[state.activeTab] || []);
2108
- function saveState() {
2109
- if (useStorage.value) {
2110
- localStorage.setItem(STORAGE_KEY, JSON.stringify(state.bookmarks));
2111
- }
2112
- }
2113
- function setActiveTab(tab) {
2114
- state.activeTab = tab;
2088
+ };
2089
+ },
2090
+ computed: {
2091
+ currentBookmarks() {
2092
+ return this.bookmarks[this.activeTab] || [];
2093
+ },
2094
+ getIconStyle() {
2095
+ return {
2096
+ position: "relative",
2097
+ width: this.small ? "50px" : "40px",
2098
+ height: this.small ? "50px" : "40px",
2099
+ marginBottom: "8px",
2100
+ borderRadius: ".4rem",
2101
+ display: "flex",
2102
+ alignItems: "center",
2103
+ justifyContent: "center",
2104
+ fontWeight: "bold",
2105
+ fontSize: "1.8rem",
2106
+ color: this.theme === "light" ? "#555" : "#eee",
2107
+ userSelect: "none"
2108
+ };
2115
2109
  }
2116
- function openLink(url) {
2117
- if (open.value === "self") {
2110
+ },
2111
+ methods: {
2112
+ saveState() {
2113
+ if (this.useStorage) {
2114
+ localStorage.setItem(this.STORAGE_KEY, JSON.stringify(this.bookmarks));
2115
+ }
2116
+ },
2117
+ setActiveTab(tab) {
2118
+ this.activeTab = tab;
2119
+ },
2120
+ openLink(url) {
2121
+ if (this.open === "self") {
2118
2122
  window.location.href = url;
2119
2123
  } else {
2120
2124
  window.open(url, "_blank");
2121
2125
  }
2122
- }
2123
- function deleteBookmark(index) {
2124
- return __async(this, null, function* () {
2125
- if (confirm(`¿Estás seguro de eliminar ${state.bookmarks[state.activeTab][index].title}?`)) {
2126
- state.bookmarks[state.activeTab].splice(index, 1);
2127
- saveState();
2128
- }
2129
- });
2130
- }
2131
- function editBookmark(index) {
2132
- return __async(this, null, function* () {
2133
- const item = state.bookmarks[state.activeTab][index];
2134
- const newTitle = prompt("Nuevo título:", item.title);
2135
- if (newTitle === null) return;
2136
- const newUrl = prompt("Nueva URL:", item.url);
2137
- if (newUrl === null) return;
2138
- item.title = newTitle;
2139
- item.url = newUrl;
2140
- item.logo = `https://www.google.com/s2/favicons?domain=${new URL(newUrl).hostname}&sz=64`;
2141
- saveState();
2142
- });
2143
- }
2144
- function addBookmarkPrompt() {
2126
+ },
2127
+ deleteBookmark(index) {
2128
+ const item = this.bookmarks[this.activeTab][index];
2129
+ if (confirm(`¿Estás seguro de eliminar ${item.title}?`)) {
2130
+ this.bookmarks[this.activeTab].splice(index, 1);
2131
+ this.saveState();
2132
+ }
2133
+ },
2134
+ editBookmark(index) {
2135
+ const item = this.bookmarks[this.activeTab][index];
2136
+ const newTitle = prompt("Nuevo título:", item.title);
2137
+ if (newTitle === null) return;
2138
+ const newUrl = prompt("Nueva URL:", item.url);
2139
+ if (newUrl === null) return;
2140
+ item.title = newTitle;
2141
+ item.url = newUrl;
2142
+ item.logo = `https://www.google.com/s2/favicons?domain=${new URL(newUrl).hostname}&sz=64`;
2143
+ this.saveState();
2144
+ },
2145
+ addBookmarkPrompt() {
2145
2146
  const title = prompt("Nombre del marcador:");
2146
2147
  if (!title) return;
2147
2148
  const url = prompt("URL del marcador:");
2148
2149
  if (!url) return;
2149
2150
  const logo = `https://www.google.com/s2/favicons?domain=${new URL(url).hostname}&sz=64`;
2150
- if (!state.bookmarks[state.activeTab]) {
2151
- state.bookmarks[state.activeTab] = [];
2152
- }
2153
- state.bookmarks[state.activeTab].push({ title, url, logo });
2154
- saveState();
2155
- }
2156
- function onImageError(event, title) {
2151
+ this.bookmarks[this.activeTab].push({ title, url, logo });
2152
+ this.saveState();
2153
+ },
2154
+ onImageError(event, title) {
2157
2155
  const img = event.target;
2158
2156
  img.style.display = "none";
2159
2157
  const iconContainer = img.parentNode;
2160
2158
  iconContainer.style.backgroundColor = "#066D5A";
2161
2159
  iconContainer.textContent = title.charAt(0).toUpperCase();
2162
2160
  }
2163
- const iconContainerStyle = computed(() => ({
2164
- position: "relative",
2165
- width: small.value ? "50px" : "40px",
2166
- height: small.value ? "50px" : "40px",
2167
- marginBottom: "8px",
2168
- borderRadius: ".4rem",
2169
- display: "flex",
2170
- alignItems: "center",
2171
- justifyContent: "center",
2172
- fontWeight: "bold",
2173
- fontSize: "1.8rem",
2174
- color: theme.value === "light" ? "#555" : "#eee",
2175
- userSelect: "none"
2176
- }));
2177
- watch(() => state.bookmarks, () => saveState(), { deep: true });
2178
- return (_ctx, _cache) => {
2179
- return openBlock(), createElementBlock("div", null, [
2180
- createElementVNode("div", _hoisted_1, [
2181
- (openBlock(true), createElementBlock(Fragment, null, renderList(categories.value, (tab) => {
2182
- return openBlock(), createElementBlock("div", {
2183
- key: tab,
2184
- class: "container-tab"
2185
- }, [
2186
- createElementVNode("button", {
2187
- class: normalizeClass(["tab", { active: tab === state.activeTab }]),
2188
- onClick: ($event) => setActiveTab(tab)
2189
- }, toDisplayString(tab), 11, _hoisted_2)
2190
- ]);
2191
- }), 128))
2192
- ]),
2193
- createElementVNode("div", _hoisted_3, [
2194
- (openBlock(true), createElementBlock(Fragment, null, renderList(unref(currentBookmarks), (item, index) => {
2195
- return openBlock(), createElementBlock("div", {
2196
- key: index,
2197
- class: normalizeClass(["card", small.value ? "small" : ""])
2198
- }, [
2199
- createElementVNode("div", _hoisted_4, [
2200
- createElementVNode("button", {
2201
- class: "edit-app",
2202
- onClick: withModifiers(($event) => editBookmark(index), ["prevent"])
2203
- }, "✏️", 8, _hoisted_5),
2204
- createElementVNode("button", {
2205
- class: "delete-app",
2206
- onClick: withModifiers(($event) => deleteBookmark(index), ["prevent"])
2207
- }, "🗑️", 8, _hoisted_6)
2208
- ]),
2209
- createElementVNode("a", {
2210
- href: "#",
2211
- class: "card-link",
2212
- onClick: withModifiers(($event) => openLink(item.url), ["prevent"])
2213
- }, [
2214
- createElementVNode("div", _hoisted_8, [
2215
- createElementVNode("div", {
2216
- class: "icon-container",
2217
- style: normalizeStyle(unref(iconContainerStyle)),
2218
- ref_for: true,
2219
- ref: "iconContainers"
2220
- }, [
2221
- createElementVNode("img", {
2222
- src: item.logo,
2223
- alt: item.title + " logo",
2224
- class: normalizeClass({ small: small.value }),
2225
- onError: ($event) => onImageError($event, item.title)
2226
- }, null, 42, _hoisted_9)
2227
- ], 4),
2228
- createTextVNode(" " + toDisplayString(item.title), 1)
2229
- ])
2230
- ], 8, _hoisted_7)
2231
- ], 2);
2232
- }), 128)),
2233
- unref(currentBookmarks).length < 8 ? (openBlock(), createElementBlock("div", {
2234
- key: 0,
2235
- class: normalizeClass(["card", small.value ? "small" : ""])
2236
- }, [
2237
- createElementVNode("a", {
2238
- href: "#",
2239
- class: "card-link",
2240
- onClick: withModifiers(addBookmarkPrompt, ["prevent"])
2241
- }, _cache[0] || (_cache[0] = [
2242
- createElementVNode("div", { class: "column" }, [
2243
- createElementVNode("span", { class: "add" }, "+"),
2244
- createTextVNode(" Add ")
2245
- ], -1)
2246
- ]))
2247
- ], 2)) : createCommentVNode("", true)
2248
- ])
2249
- ]);
2250
- };
2161
+ },
2162
+ watch: {
2163
+ bookmarks: {
2164
+ handler() {
2165
+ this.saveState();
2166
+ },
2167
+ deep: true
2168
+ }
2251
2169
  }
2252
2170
  };
2253
- const ZMarkedWidget = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-5fb970f5"]]);
2171
+ const _hoisted_1 = { class: "tabs" };
2172
+ const _hoisted_2 = ["onClick"];
2173
+ const _hoisted_3 = { class: "grid" };
2174
+ const _hoisted_4 = { class: "option-app" };
2175
+ const _hoisted_5 = ["onClick"];
2176
+ const _hoisted_6 = ["onClick"];
2177
+ const _hoisted_7 = ["onClick"];
2178
+ const _hoisted_8 = { class: "column" };
2179
+ const _hoisted_9 = ["src", "alt", "onError"];
2180
+ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
2181
+ return openBlock(), createElementBlock("div", null, [
2182
+ createElementVNode("div", _hoisted_1, [
2183
+ (openBlock(true), createElementBlock(Fragment, null, renderList($props.categories, (tab) => {
2184
+ return openBlock(), createElementBlock("div", {
2185
+ key: tab,
2186
+ class: "container-tab"
2187
+ }, [
2188
+ createElementVNode("button", {
2189
+ class: normalizeClass(["tab", { active: tab === $data.activeTab }]),
2190
+ onClick: ($event) => $options.setActiveTab(tab)
2191
+ }, toDisplayString(tab), 11, _hoisted_2)
2192
+ ]);
2193
+ }), 128))
2194
+ ]),
2195
+ createElementVNode("div", _hoisted_3, [
2196
+ (openBlock(true), createElementBlock(Fragment, null, renderList($options.currentBookmarks, (item, index) => {
2197
+ return openBlock(), createElementBlock("div", {
2198
+ key: index,
2199
+ class: normalizeClass(["card", $props.small ? "small" : ""])
2200
+ }, [
2201
+ createElementVNode("div", _hoisted_4, [
2202
+ createElementVNode("button", {
2203
+ class: "edit-app",
2204
+ onClick: withModifiers(($event) => $options.editBookmark(index), ["prevent"])
2205
+ }, "✏️", 8, _hoisted_5),
2206
+ createElementVNode("button", {
2207
+ class: "delete-app",
2208
+ onClick: withModifiers(($event) => $options.deleteBookmark(index), ["prevent"])
2209
+ }, "🗑️", 8, _hoisted_6)
2210
+ ]),
2211
+ createElementVNode("a", {
2212
+ href: "#",
2213
+ class: "card-link",
2214
+ onClick: withModifiers(($event) => $options.openLink(item.url), ["prevent"])
2215
+ }, [
2216
+ createElementVNode("div", _hoisted_8, [
2217
+ createElementVNode("div", {
2218
+ class: "icon-container",
2219
+ style: normalizeStyle($options.getIconStyle)
2220
+ }, [
2221
+ createElementVNode("img", {
2222
+ src: item.logo,
2223
+ alt: item.title + " logo",
2224
+ class: normalizeClass({ small: $props.small }),
2225
+ onError: ($event) => $options.onImageError($event, item.title)
2226
+ }, null, 42, _hoisted_9)
2227
+ ], 4),
2228
+ createTextVNode(" " + toDisplayString(item.title), 1)
2229
+ ])
2230
+ ], 8, _hoisted_7)
2231
+ ], 2);
2232
+ }), 128)),
2233
+ $options.currentBookmarks.length < 8 ? (openBlock(), createElementBlock("div", {
2234
+ key: 0,
2235
+ class: normalizeClass(["card", $props.small ? "small" : ""])
2236
+ }, [
2237
+ createElementVNode("a", {
2238
+ href: "#",
2239
+ class: "card-link",
2240
+ onClick: _cache[0] || (_cache[0] = withModifiers((...args) => $options.addBookmarkPrompt && $options.addBookmarkPrompt(...args), ["prevent"]))
2241
+ }, _cache[1] || (_cache[1] = [
2242
+ createElementVNode("div", { class: "column" }, [
2243
+ createElementVNode("span", { class: "add" }, "+"),
2244
+ createTextVNode(" Add ")
2245
+ ], -1)
2246
+ ]))
2247
+ ], 2)) : createCommentVNode("", true)
2248
+ ])
2249
+ ]);
2250
+ }
2251
+ const ZMarkedWidget = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-48fb9a13"]]);
2254
2252
  const ZClockElement = defineCustomElement(ZClockWidget);
2255
2253
  const ZSearchElement = defineCustomElement(ZSearchWidget);
2256
2254
  const ZTodoElement = defineCustomElement(ZTodoWidget);
@@ -2265,7 +2263,7 @@ if (!customElements.get("z-todo-widget")) {
2265
2263
  customElements.define("z-todo-widget", ZTodoElement);
2266
2264
  }
2267
2265
  if (!customElements.get("z-marked-widget")) {
2268
- customElements.define("z-search-widget", ZMarkedElement);
2266
+ customElements.define("z-marked-widget", ZMarkedElement);
2269
2267
  }
2270
2268
  export {
2271
2269
  ZClockWidget,
@@ -1 +1 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("vue")):"function"==typeof define&&define.amd?define(["exports","vue"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).ZenWdg={},e.Vue)}(this,function(e,t){"use strict";var n=Object.defineProperty,o=Object.defineProperties,r=Object.getOwnPropertyDescriptors,i=Object.getOwnPropertySymbols,s=Object.prototype.hasOwnProperty,l=Object.prototype.propertyIsEnumerable,c=(e,t,o)=>t in e?n(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o,a=(e,t)=>{for(var n in t||(t={}))s.call(t,n)&&c(e,n,t[n]);if(i)for(var n of i(t))l.call(t,n)&&c(e,n,t[n]);return e},u=(e,t)=>o(e,r(t)),d=(e,t,n)=>new Promise((o,r)=>{var i=e=>{try{l(n.next(e))}catch(t){r(t)}},s=e=>{try{l(n.throw(e))}catch(t){r(t)}},l=e=>e.done?o(e.value):Promise.resolve(e.value).then(i,s);l((n=n.apply(e,t)).next())});const f=(e,t)=>{const n=e.__vccOpts||e;for(const[o,r]of t)n[o]=r;return n},p={class:"clock-container"},m={class:"clock"},h={class:"time"},g={class:"date"};const v=f({name:"ZClockWidget",data:()=>({hours:"00",minutes:"00",seconds:"00",dayOfWeek:"",day:"",month:"",year:""}),mounted(){this.updateClock(),setInterval(this.updateClock,1e3)},methods:{updateClock(){const e=new Date;this.hours=e.getHours().toString().padStart(2,"0"),this.minutes=e.getMinutes().toString().padStart(2,"0"),this.seconds=e.getSeconds().toString().padStart(2,"0"),this.dayOfWeek=this.getDayOfWeek(e.getDay()),this.day=e.getDate(),this.month=this.getMonthName(e.getMonth()),this.year=e.getFullYear()},getDayOfWeek:e=>["Domingo","Lunes","Martes","Miércoles","Jueves","Viernes","Sábado"][e],getMonthName:e=>["Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"][e]}},[["render",function(e,n,o,r,i,s){return t.openBlock(),t.createElementBlock("div",p,[t.createElementVNode("div",m,[t.createElementVNode("div",h,[t.createElementVNode("span",null,t.toDisplayString(i.hours),1),n[0]||(n[0]=t.createTextVNode(":",-1)),t.createElementVNode("span",null,t.toDisplayString(i.minutes),1)]),t.createElementVNode("div",g,[t.createElementVNode("span",null,t.toDisplayString(i.dayOfWeek)+", "+t.toDisplayString(i.day)+" "+t.toDisplayString(i.month)+" "+t.toDisplayString(i.year),1)])])])}],["__scopeId","data-v-e9445086"]]),y={data:()=>({}),props:{placeholder:String,modelValue:{type:String,default:""},round:{type:Boolean,default:!1},full:{type:Boolean},rounded:{type:Boolean,default:!1}},methods:{onInput(e){this.$emit("update:modelValue",e.target.value)},onEnter(){this.$emit("enter-pressed",this.modelValue)}}},b=["placeholder","value"];const k=f(y,[["render",function(e,n,o,r,i,s){return t.openBlock(),t.createElementBlock("input",{placeholder:o.placeholder,value:o.modelValue,onInput:n[0]||(n[0]=(...e)=>s.onInput&&s.onInput(...e)),onKeydown:n[1]||(n[1]=t.withKeys((...e)=>s.onEnter&&s.onEnter(...e),["enter"])),class:t.normalizeClass([{"full-width":o.full},{round:o.round},{rounded:o.rounded}])},null,42,b)}],["__scopeId","data-v-2ad90286"]]),w=/^[a-z0-9]+(-[a-z0-9]+)*$/,x=(e,t,n,o="")=>{const r=e.split(":");if("@"===e.slice(0,1)){if(r.length<2||r.length>3)return null;o=r.shift().slice(1)}if(r.length>3||!r.length)return null;if(r.length>1){const e=r.pop(),n=r.pop(),i={provider:r.length>0?r[0]:o,prefix:n,name:e};return t&&!E(i)?null:i}const i=r[0],s=i.split("-");if(s.length>1){const e={provider:o,prefix:s.shift(),name:s.join("-")};return t&&!E(e)?null:e}if(n&&""===o){const e={provider:o,prefix:"",name:i};return t&&!E(e,n)?null:e}return null},E=(e,t)=>!!e&&!(!(t&&""===e.prefix||e.prefix)||!e.name),S=Object.freeze({left:0,top:0,width:16,height:16}),T=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),C=Object.freeze(a(a({},S),T)),N=Object.freeze(u(a({},C),{body:"",hidden:!1}));function B(e,t){const n=function(e,t){const n={};!e.hFlip!=!t.hFlip&&(n.hFlip=!0),!e.vFlip!=!t.vFlip&&(n.vFlip=!0);const o=((e.rotate||0)+(t.rotate||0))%4;return o&&(n.rotate=o),n}(e,t);for(const o in N)o in T?o in e&&!(o in n)&&(n[o]=T[o]):o in t?n[o]=t[o]:o in e&&(n[o]=e[o]);return n}function z(e,t,n){const o=e.icons,r=e.aliases||Object.create(null);let i={};function s(e){i=B(o[e]||r[e],i)}return s(t),n.forEach(s),B(e,i)}function V(e,t){const n=[];if("object"!=typeof e||"object"!=typeof e.icons)return n;e.not_found instanceof Array&&e.not_found.forEach(e=>{t(e,null),n.push(e)});const o=function(e){const t=e.icons,n=e.aliases||Object.create(null),o=Object.create(null);return Object.keys(t).concat(Object.keys(n)).forEach(function e(r){if(t[r])return o[r]=[];if(!(r in o)){o[r]=null;const t=n[r]&&n[r].parent,i=t&&e(t);i&&(o[r]=[t].concat(i))}return o[r]}),o}(e);for(const r in o){const i=o[r];i&&(t(r,z(e,r,i)),n.push(r))}return n}const j=a({provider:"",aliases:{},not_found:{}},S);function O(e,t){for(const n in t)if(n in e&&typeof e[n]!=typeof t[n])return!1;return!0}function F(e){if("object"!=typeof e||null===e)return null;const t=e;if("string"!=typeof t.prefix||!e.icons||"object"!=typeof e.icons)return null;if(!O(e,j))return null;const n=t.icons;for(const r in n){const e=n[r];if(!r||"string"!=typeof e.body||!O(e,N))return null}const o=t.aliases||Object.create(null);for(const r in o){const e=o[r],t=e.parent;if(!r||"string"!=typeof t||!n[t]&&!o[t]||!O(e,N))return null}return t}const I=Object.create(null);function M(e,t){const n=I[e]||(I[e]=Object.create(null));return n[t]||(n[t]=function(e,t){return{provider:e,prefix:t,icons:Object.create(null),missing:new Set}}(e,t))}function L(e,t){return F(t)?V(t,(t,n)=>{n?e.icons[t]=n:e.missing.add(t)}):[]}let D=!1;function _(e){return"boolean"==typeof e&&(D=e),D}function P(e,t){const n=x(e,!0,D);if(!n)return!1;const o=M(n.provider,n.prefix);return t?function(e,t,n){try{if("string"==typeof n.body)return e.icons[t]=a({},n),!0}catch(o){}return!1}(o,n.name,t):(o.missing.add(n.name),!0)}const A=Object.freeze({width:null,height:null}),W=Object.freeze(a(a({},A),T)),R=/(-?[0-9.]*[0-9]+[0-9.]*)/g,U=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function $(e,t,n){if(1===t)return e;if(n=n||100,"number"==typeof e)return Math.ceil(e*t*n)/n;if("string"!=typeof e)return e;const o=e.split(R);if(null===o||!o.length)return e;const r=[];let i=o.shift(),s=U.test(i);for(;;){if(s){const e=parseFloat(i);isNaN(e)?r.push(i):r.push(Math.ceil(e*t*n)/n)}else r.push(i);if(i=o.shift(),void 0===i)return r.join("");s=!s}}const q=/\sid="(\S+)"/g,Z="IconifyId"+Date.now().toString(16)+(16777216*Math.random()|0).toString(16);let H=0;const J=Object.create(null);function Q(e){return J[e]||J[""]}function K(e){let t;if("string"==typeof e.resources)t=[e.resources];else if(t=e.resources,!(t instanceof Array&&t.length))return null;return{resources:t,path:e.path||"/",maxURL:e.maxURL||500,rotate:e.rotate||750,timeout:e.timeout||5e3,random:!0===e.random,index:e.index||0,dataAfterTimeout:!1!==e.dataAfterTimeout}}const Y=Object.create(null),G=["https://api.simplesvg.com","https://api.unisvg.com"],X=[];for(;G.length>0;)1===G.length||Math.random()>.5?X.push(G.shift()):X.push(G.pop());function ee(e,t){const n=K(t);return null!==n&&(Y[e]=n,!0)}function te(e){return Y[e]}Y[""]=K({resources:["https://api.iconify.design"].concat(X)});let ne=(()=>{let e;try{if(e=fetch,"function"==typeof e)return e}catch(t){}})();const oe={prepare:(e,t,n)=>{const o=[],r=function(e,t){const n=te(e);if(!n)return 0;let o;if(n.maxURL){let e=0;n.resources.forEach(t=>{const n=t;e=Math.max(e,n.length)});const r=t+".json?icons=";o=n.maxURL-e-n.path.length-r.length}else o=0;return o}(e,t),i="icons";let s={type:i,provider:e,prefix:t,icons:[]},l=0;return n.forEach((n,c)=>{l+=n.length+1,l>=r&&c>0&&(o.push(s),s={type:i,provider:e,prefix:t,icons:[]},l=n.length),s.icons.push(n)}),o.push(s),o},send:(e,t,n)=>{if(!ne)return void n("abort",424);let o=function(e){if("string"==typeof e){const t=te(e);if(t)return t.path}return"/"}(t.provider);switch(t.type){case"icons":{const e=t.prefix,n=t.icons.join(",");o+=e+".json?"+new URLSearchParams({icons:n}).toString();break}case"custom":{const e=t.uri;o+="/"===e.slice(0,1)?e.slice(1):e;break}default:return void n("abort",400)}let r=503;ne(e+o).then(e=>{const t=e.status;if(200===t)return r=501,e.json();setTimeout(()=>{n(function(e){return 404===e}(t)?"abort":"next",t)})}).then(e=>{"object"==typeof e&&null!==e?setTimeout(()=>{n("success",e)}):setTimeout(()=>{404===e?n("abort",e):n("next",r)})}).catch(()=>{n("next",r)})}};function re(e,t){e.forEach(e=>{const n=e.loaderCallbacks;n&&(e.loaderCallbacks=n.filter(e=>e.id!==t))})}let ie=0;var se={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function le(e,t,n,o){const r=e.resources.length,i=e.random?Math.floor(Math.random()*r):e.index;let s;if(e.random){let t=e.resources.slice(0);for(s=[];t.length>1;){const e=Math.floor(Math.random()*t.length);s.push(t[e]),t=t.slice(0,e).concat(t.slice(e+1))}s=s.concat(t)}else s=e.resources.slice(i).concat(e.resources.slice(0,i));const l=Date.now();let c,a="pending",u=0,d=null,f=[],p=[];function m(){d&&(clearTimeout(d),d=null)}function h(){"pending"===a&&(a="aborted"),m(),f.forEach(e=>{"pending"===e.status&&(e.status="aborted")}),f=[]}function g(e,t){t&&(p=[]),"function"==typeof e&&p.push(e)}function v(){a="failed",p.forEach(e=>{e(void 0,c)})}function y(){f.forEach(e=>{"pending"===e.status&&(e.status="aborted")}),f=[]}function b(){if("pending"!==a)return;m();const o=s.shift();if(void 0===o)return f.length?void(d=setTimeout(()=>{m(),"pending"===a&&(y(),v())},e.timeout)):void v();const r={status:"pending",resource:o,callback:(t,n)=>{!function(t,n,o){const r="success"!==n;switch(f=f.filter(e=>e!==t),a){case"pending":break;case"failed":if(r||!e.dataAfterTimeout)return;break;default:return}if("abort"===n)return c=o,void v();if(r)return c=o,void(f.length||(s.length?b():v()));if(m(),y(),!e.random){const n=e.resources.indexOf(t.resource);-1!==n&&n!==e.index&&(e.index=n)}a="completed",p.forEach(e=>{e(o)})}(r,t,n)}};f.push(r),u++,d=setTimeout(b,e.rotate),n(o,t,r.callback)}return"function"==typeof o&&p.push(o),setTimeout(b),function(){return{startTime:l,payload:t,status:a,queriesSent:u,queriesPending:f.length,subscribe:g,abort:h}}}function ce(e){const t=a(a({},se),e);let n=[];function o(){n=n.filter(e=>"pending"===e().status)}return{query:function(e,r,i){const s=le(t,e,r,(e,t)=>{o(),i&&i(e,t)});return n.push(s),s},find:function(e){return n.find(t=>e(t))||null},setIndex:e=>{t.index=e},getIndex:()=>t.index,cleanup:o}}function ae(){}const ue=Object.create(null);function de(e,t,n){let o,r;if("string"==typeof e){const t=Q(e);if(!t)return n(void 0,424),ae;r=t.send;const i=function(e){if(!ue[e]){const t=te(e);if(!t)return;const n={config:t,redundancy:ce(t)};ue[e]=n}return ue[e]}(e);i&&(o=i.redundancy)}else{const t=K(e);if(t){o=ce(t);const n=Q(e.resources?e.resources[0]:"");n&&(r=n.send)}}return o&&r?o.query(t,r,n)().abort:(n(void 0,424),ae)}function fe(){}function pe(e){e.iconsLoaderFlag||(e.iconsLoaderFlag=!0,setTimeout(()=>{e.iconsLoaderFlag=!1,function(e){e.pendingCallbacksFlag||(e.pendingCallbacksFlag=!0,setTimeout(()=>{e.pendingCallbacksFlag=!1;const t=e.loaderCallbacks?e.loaderCallbacks.slice(0):[];if(!t.length)return;let n=!1;const o=e.provider,r=e.prefix;t.forEach(t=>{const i=t.icons,s=i.pending.length;i.pending=i.pending.filter(t=>{if(t.prefix!==r)return!0;const s=t.name;if(e.icons[s])i.loaded.push({provider:o,prefix:r,name:s});else{if(!e.missing.has(s))return n=!0,!0;i.missing.push({provider:o,prefix:r,name:s})}return!1}),i.pending.length!==s&&(n||re([e],t.id),t.callback(i.loaded.slice(0),i.missing.slice(0),i.pending.slice(0),t.abort))})}))}(e)}))}function me(e,t,n){function o(){const n=e.pendingIcons;t.forEach(t=>{n&&n.delete(t),e.icons[t]||e.missing.add(t)})}if(n&&"object"==typeof n)try{if(!L(e,n).length)return void o()}catch(r){console.error(r)}o(),pe(e)}function he(e,t){e instanceof Promise?e.then(e=>{t(e)}).catch(()=>{t(null)}):t(e)}function ge(e,t){e.iconsToLoad?e.iconsToLoad=e.iconsToLoad.concat(t).sort():e.iconsToLoad=t,e.iconsQueueFlag||(e.iconsQueueFlag=!0,setTimeout(()=>{e.iconsQueueFlag=!1;const{provider:t,prefix:n}=e,o=e.iconsToLoad;if(delete e.iconsToLoad,!o||!o.length)return;const r=e.loadIcon;if(e.loadIcons&&(o.length>1||!r))return void he(e.loadIcons(o,n,t),t=>{me(e,o,t)});if(r)return void o.forEach(o=>{he(r(o,n,t),t=>{me(e,[o],t?{prefix:n,icons:{[o]:t}}:null)})});const{valid:i,invalid:s}=function(e){const t=[],n=[];return e.forEach(e=>{(e.match(w)?t:n).push(e)}),{valid:t,invalid:n}}(o);if(s.length&&me(e,s,null),!i.length)return;const l=n.match(w)?Q(t):null;if(!l)return void me(e,i,null);l.prepare(t,n,i).forEach(n=>{de(t,n,t=>{me(e,n.icons,t)})})}))}const ve=(e,t)=>{const n=function(e){const t={loaded:[],missing:[],pending:[]},n=Object.create(null);e.sort((e,t)=>e.provider!==t.provider?e.provider.localeCompare(t.provider):e.prefix!==t.prefix?e.prefix.localeCompare(t.prefix):e.name.localeCompare(t.name));let o={provider:"",prefix:"",name:""};return e.forEach(e=>{if(o.name===e.name&&o.prefix===e.prefix&&o.provider===e.provider)return;o=e;const r=e.provider,i=e.prefix,s=e.name,l=n[r]||(n[r]=Object.create(null)),c=l[i]||(l[i]=M(r,i));let a;a=s in c.icons?t.loaded:""===i||c.missing.has(s)?t.missing:t.pending;const u={provider:r,prefix:i,name:s};a.push(u)}),t}(function(e,t=!0,n=!1){const o=[];return e.forEach(e=>{const r="string"==typeof e?x(e,t,n):e;r&&o.push(r)}),o}(e,!0,_()));if(!n.pending.length){let e=!0;return t&&setTimeout(()=>{e&&t(n.loaded,n.missing,n.pending,fe)}),()=>{e=!1}}const o=Object.create(null),r=[];let i,s;return n.pending.forEach(e=>{const{provider:t,prefix:n}=e;if(n===s&&t===i)return;i=t,s=n,r.push(M(t,n));const l=o[t]||(o[t]=Object.create(null));l[n]||(l[n]=[])}),n.pending.forEach(e=>{const{provider:t,prefix:n,name:r}=e,i=M(t,n),s=i.pendingIcons||(i.pendingIcons=new Set);s.has(r)||(s.add(r),o[t][n].push(r))}),r.forEach(e=>{const t=o[e.provider][e.prefix];t.length&&ge(e,t)}),t?function(e,t,n){const o=ie++,r=re.bind(null,n,o);if(!t.pending.length)return r;const i={id:o,icons:t,callback:e,abort:r};return n.forEach(e=>{(e.loaderCallbacks||(e.loaderCallbacks=[])).push(i)}),r}(t,n,r):fe};const ye=/[\s,]+/;function be(e,t){t.split(ye).forEach(t=>{switch(t.trim()){case"horizontal":e.hFlip=!0;break;case"vertical":e.vFlip=!0}})}function ke(e,t=0){const n=e.replace(/^-?[0-9.]*/,"");function o(e){for(;e<0;)e+=4;return e%4}if(""===n){const t=parseInt(e);return isNaN(t)?0:o(t)}if(n!==e){let t=0;switch(n){case"%":t=25;break;case"deg":t=90}if(t){let r=parseFloat(e.slice(0,e.length-n.length));return isNaN(r)?0:(r/=t,r%1==0?o(r):0)}}return t}const we=u(a({},W),{inline:!1}),xe={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":!0,role:"img"},Ee={display:"inline-block"},Se={backgroundColor:"currentColor"},Te={backgroundColor:"transparent"},Ce={Image:"var(--svg)",Repeat:"no-repeat",Size:"100% 100%"},Ne={webkitMask:Se,mask:Se,background:Te};for(const dt in Ne){const e=Ne[dt];for(const t in Ce)e[dt+t]=Ce[t]}const Be={};function ze(e){return e+(e.match(/^[-0-9.]+$/)?"px":"")}["horizontal","vertical"].forEach(e=>{const t=e.slice(0,1)+"Flip";Be[e+"-flip"]=t,Be[e.slice(0,1)+"-flip"]=t,Be[e+"Flip"]=t});const Ve=(e,n)=>{const o=function(e,t){const n=a({},e);for(const o in t){const e=t[o],r=typeof e;o in A?(null===e||e&&("string"===r||"number"===r))&&(n[o]=e):r===typeof n[o]&&(n[o]="rotate"===o?e%4:e)}return n}(we,n),r=a({},xe),i=n.mode||"svg",s={},l=n.style,c="object"!=typeof l||l instanceof Array?{}:l;for(let t in n){const e=n[t];if(void 0!==e)switch(t){case"icon":case"style":case"onLoad":case"mode":case"ssr":break;case"inline":case"hFlip":case"vFlip":o[t]=!0===e||"true"===e||1===e;break;case"flip":"string"==typeof e&&be(o,e);break;case"color":s.color=e;break;case"rotate":"string"==typeof e?o[t]=ke(e):"number"==typeof e&&(o[t]=e);break;case"ariaHidden":case"aria-hidden":!0!==e&&"true"!==e&&delete r["aria-hidden"];break;default:{const n=Be[t];n?!0!==e&&"true"!==e&&1!==e||(o[n]=!0):void 0===we[t]&&(r[t]=e)}}}const d=function(e,t){const n=a(a({},C),e),o=a(a({},W),t),r={left:n.left,top:n.top,width:n.width,height:n.height};let i=n.body;[n,o].forEach(e=>{const t=[],n=e.hFlip,o=e.vFlip;let s,l=e.rotate;switch(n?o?l+=2:(t.push("translate("+(r.width+r.left).toString()+" "+(0-r.top).toString()+")"),t.push("scale(-1 1)"),r.top=r.left=0):o&&(t.push("translate("+(0-r.left).toString()+" "+(r.height+r.top).toString()+")"),t.push("scale(1 -1)"),r.top=r.left=0),l<0&&(l-=4*Math.floor(l/4)),l%=4,l){case 1:s=r.height/2+r.top,t.unshift("rotate(90 "+s.toString()+" "+s.toString()+")");break;case 2:t.unshift("rotate(180 "+(r.width/2+r.left).toString()+" "+(r.height/2+r.top).toString()+")");break;case 3:s=r.width/2+r.left,t.unshift("rotate(-90 "+s.toString()+" "+s.toString()+")")}l%2==1&&(r.left!==r.top&&(s=r.left,r.left=r.top,r.top=s),r.width!==r.height&&(s=r.width,r.width=r.height,r.height=s)),t.length&&(i=function(e,t,n){const o=function(e,t="defs"){let n="";const o=e.indexOf("<"+t);for(;o>=0;){const r=e.indexOf(">",o),i=e.indexOf("</"+t);if(-1===r||-1===i)break;const s=e.indexOf(">",i);if(-1===s)break;n+=e.slice(r+1,i).trim(),e=e.slice(0,o).trim()+e.slice(s+1)}return{defs:n,content:e}}(e);return r=o.defs,i=t+o.content+n,r?"<defs>"+r+"</defs>"+i:i;var r,i}(i,'<g transform="'+t.join(" ")+'">',"</g>"))});const s=o.width,l=o.height,c=r.width,u=r.height;let d,f;null===s?(f=null===l?"1em":"auto"===l?u:l,d=$(f,c/u)):(d="auto"===s?c:s,f=null===l?$(d,u/c):"auto"===l?u:l);const p={},m=(e,t)=>{(e=>"unset"===e||"undefined"===e||"none"===e)(t)||(p[e]=t.toString())};m("width",d),m("height",f);const h=[r.left,r.top,c,u];return p.viewBox=h.join(" "),{attributes:p,viewBox:h,body:i}}(e,o),f=d.attributes;if(o.inline&&(s.verticalAlign="-0.125em"),"svg"===i){r.style=a(a({},s),c),Object.assign(r,f);let e=0,o=n.id;return"string"==typeof o&&(o=o.replace(/-/g,"_")),r.innerHTML=function(e,t=Z){const n=[];let o;for(;o=q.exec(e);)n.push(o[1]);if(!n.length)return e;const r="suffix"+(16777216*Math.random()|Date.now()).toString(16);return n.forEach(n=>{const o="function"==typeof t?t(n):t+(H++).toString(),i=n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");e=e.replace(new RegExp('([#;"])('+i+')([")]|\\.[a-z])',"g"),"$1"+o+r+"$3")}),e=e.replace(new RegExp(r,"g"),"")}(d.body,o?()=>o+"ID"+e++:"iconifyVue"),t.h("svg",r)}const{body:p,width:m,height:h}=e,g="mask"===i||"bg"!==i&&-1!==p.indexOf("currentColor"),v=function(e,t){let n=-1===e.indexOf("xlink:")?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const o in t)n+=" "+o+'="'+t[o]+'"';return'<svg xmlns="http://www.w3.org/2000/svg"'+n+">"+e+"</svg>"}(p,u(a({},f),{width:m+"",height:h+""}));var y;return r.style=a(a(a(u(a({},s),{"--svg":(y=v,'url("'+function(e){return"data:image/svg+xml,"+function(e){return e.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(/</g,"%3C").replace(/>/g,"%3E").replace(/\s+/g," ")}(e)}(y)+'")'),width:ze(f.width),height:ze(f.height)}),Ee),g?Se:Te),c),t.h("span",r)};var je;if(_(!0),je=oe,J[""]=je,"undefined"!=typeof document&&"undefined"!=typeof window){const e=window;if(void 0!==e.IconifyPreload){const t=e.IconifyPreload,n="Invalid IconifyPreload syntax.";"object"==typeof t&&null!==t&&(t instanceof Array?t:[t]).forEach(e=>{try{("object"!=typeof e||null===e||e instanceof Array||"object"!=typeof e.icons||"string"!=typeof e.prefix||!function(e,t){if("object"!=typeof e)return!1;if("string"!=typeof t&&(t=e.provider||""),D&&!t&&!e.prefix){let t=!1;return F(e)&&(e.prefix="",V(e,(e,n)=>{P(e,n)&&(t=!0)})),t}const n=e.prefix;return!!E({prefix:n,name:"a"})&&!!L(M(t,n),e)}(e))&&console.error(n)}catch(t){console.error(n)}})}if(void 0!==e.IconifyProviders){const t=e.IconifyProviders;if("object"==typeof t&&null!==t)for(let e in t){const n="IconifyProviders["+e+"] is invalid.";try{const o=t[e];if("object"!=typeof o||!o||void 0===o.resources)continue;ee(e,o)||console.error(n)}catch(ut){console.error(n)}}}}const Oe=u(a({},C),{body:""}),Fe={data:()=>({}),components:{Icon:t.defineComponent((e,{emit:n})=>{const o=t.ref(null);function r(){var e,t;o.value&&(null==(t=(e=o.value).abort)||t.call(e),o.value=null)}const i=t.ref(!!e.ssr),s=t.ref(""),l=t.shallowRef(null);function c(){const i=e.icon;if("object"==typeof i&&null!==i&&"string"==typeof i.body)return s.value="",{data:i};let l;if("string"!=typeof i||null===(l=x(i,!1,!0)))return null;let c=function(e){const t="string"==typeof e?x(e,!0,D):e;if(t){const e=M(t.provider,t.prefix),n=t.name;return e.icons[n]||(e.missing.has(n)?null:void 0)}}(l);if(!c){const e=o.value;return e&&e.name===i||(o.value=null===c?{name:i}:{name:i,abort:ve([l],d)}),null}r(),s.value!==i&&(s.value=i,t.nextTick(()=>{n("load",i)}));const a=e.customise;if(a){c=Object.assign({},c);const e=a(c.body,l.name,l.prefix,l.provider);"string"==typeof e&&(c.body=e)}const u=["iconify"];return""!==l.prefix&&u.push("iconify--"+l.prefix),""!==l.provider&&u.push("iconify--"+l.provider),{data:c,classes:u}}function d(){var e;const t=c();t?t.data!==(null==(e=l.value)?void 0:e.data)&&(l.value=t):l.value=null}return i.value?d():t.onMounted(()=>{i.value=!0,d()}),t.watch(()=>e.icon,d),t.onUnmounted(r),()=>{const t=l.value;if(!t)return Ve(Oe,e);let n=e;return t.classes&&(n=u(a({},e),{class:t.classes.join(" ")})),Ve(a(a({},C),t.data),n)}},{props:["icon","mode","ssr","width","height","style","color","inline","rotate","hFlip","horizontalFlip","vFlip","verticalFlip","flip","id","ariaHidden","customise","title"],emits:["load"]})},props:{title:{type:String,required:!1},bound:{type:Boolean,default:!1},bounded:{type:Boolean,default:!1},flat:{type:Boolean,default:!1},iconLeft:{type:Boolean,required:!1,default:!1},iconRight:{type:Boolean,default:!1},icon:{type:String},size:{type:String},iconSize:{type:String},wFull:{type:Boolean,default:!1},noBg:{type:Boolean,default:!1},color:String},methods:{}};const Ie={class:"search"},Me=["src"];const Le=f({name:"ZSearchWidget",data:()=>({text:""}),props:{searchTarget:{type:String,require:!1,default:"same"},logo:{type:String,require:!1}},components:{Input:k,Button:f(Fe,[["render",function(e,n,o,r,i,s){const l=t.resolveComponent("Icon");return t.openBlock(),t.createElementBlock("button",{class:t.normalizeClass([{flat:o.flat},{bound:o.bound},{bounded:o.bounded},{"w-full":o.wFull},{transparent:o.noBg}]),style:t.normalizeStyle([{"font-size":o.size},{color:o.color}])},[o.iconLeft?(t.openBlock(),t.createBlock(l,{key:0,icon:o.icon,style:t.normalizeStyle({"font-size":o.iconSize})},null,8,["icon","style"])):t.createCommentVNode("",!0),t.createTextVNode(" "+t.toDisplayString(o.title)+" ",1),o.icon&&!o.iconLeft?(t.openBlock(),t.createBlock(l,{key:1,icon:o.icon,width:o.iconSize,height:o.iconSize},null,8,["icon","width","height"])):t.createCommentVNode("",!0)],6)}],["__scopeId","data-v-10678914"]])},methods:{search(){const e=`https://astiango.co/?q=${encodeURIComponent(this.text)}`;"new"==this.searchTarget?chrome.tabs.create({url:e}):"same"==this.searchTarget&&chrome.tabs.update({url:e})}}},[["render",function(e,n,o,r,i,s){const l=t.resolveComponent("Input"),c=t.resolveComponent("Button");return t.openBlock(),t.createElementBlock("div",Ie,[o.logo?(t.openBlock(),t.createElementBlock("img",{key:0,src:o.logo},null,8,Me)):t.createCommentVNode("",!0),t.createVNode(l,{placeholder:"Search something",full:"",class:"bg",modelValue:i.text,"onUpdate:modelValue":n[0]||(n[0]=e=>i.text=e),onEnterPressed:n[1]||(n[1]=e=>s.search())},null,8,["modelValue"]),t.createVNode(c,{icon:"material-symbols-light:search-rounded",size:"25px",flat:"",class:"text-color",onClick:n[2]||(n[2]=e=>s.search())})])}],["__scopeId","data-v-50392e2c"]]),De={class:"todo-widget"},_e={class:"task-section"},Pe={key:0,class:"empty"},Ae={class:"actions"},We=["onClick"],Re=["onClick"],Ue={class:"task-section completed"},$e={key:0,class:"empty"},qe={class:"done"},Ze=["onClick"];const He=f({name:"TodoWidget",data:()=>({newTask:"",pendingTasks:[],completedTasks:[]}),methods:{addTask(){this.newTask.trim()&&(this.pendingTasks.push({text:this.newTask.trim()}),this.newTask="")},completeTask(e){const t=this.pendingTasks.splice(e,1)[0];this.completedTasks.push(t)},deleteTask(e){this.pendingTasks.splice(e,1)},deleteCompleted(e){this.completedTasks.splice(e,1)}}},[["render",function(e,n,o,r,i,s){return t.openBlock(),t.createElementBlock("div",De,[n[5]||(n[5]=t.createElementVNode("h2",{class:"title"},"📝 Mis Tareas",-1)),t.createElementVNode("form",{onSubmit:n[1]||(n[1]=t.withModifiers((...e)=>s.addTask&&s.addTask(...e),["prevent"])),class:"todo-form"},[t.withDirectives(t.createElementVNode("input",{"onUpdate:modelValue":n[0]||(n[0]=e=>i.newTask=e),type:"text",placeholder:"Escribe una nueva tarea..."},null,512),[[t.vModelText,i.newTask]]),n[2]||(n[2]=t.createElementVNode("button",{type:"submit"},"Agregar",-1))],32),t.createElementVNode("div",_e,[n[3]||(n[3]=t.createElementVNode("h3",null,"Tareas Pendientes",-1)),0===i.pendingTasks.length?(t.openBlock(),t.createElementBlock("div",Pe,"Sin tareas.")):t.createCommentVNode("",!0),t.createElementVNode("ul",null,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(i.pendingTasks,(e,n)=>(t.openBlock(),t.createElementBlock("li",{key:n},[t.createElementVNode("span",null,t.toDisplayString(e.text),1),t.createElementVNode("div",Ae,[t.createElementVNode("button",{onClick:e=>s.completeTask(n)},"✔️",8,We),t.createElementVNode("button",{onClick:e=>s.deleteTask(n)},"🗑️",8,Re)])]))),128))])]),t.createElementVNode("div",Ue,[n[4]||(n[4]=t.createElementVNode("h3",null,"Completadas",-1)),0===i.completedTasks.length?(t.openBlock(),t.createElementBlock("div",$e,"Ninguna aún.")):t.createCommentVNode("",!0),t.createElementVNode("ul",null,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(i.completedTasks,(e,n)=>(t.openBlock(),t.createElementBlock("li",{key:"c"+n},[t.createElementVNode("span",qe,t.toDisplayString(e.text),1),t.createElementVNode("button",{onClick:e=>s.deleteCompleted(n)},"❌",8,Ze)]))),128))])])])}],["__scopeId","data-v-edabf7fa"]]),Je={class:"tabs"},Qe=["onClick"],Ke={class:"grid"},Ye={class:"option-app"},Ge=["onClick"],Xe=["onClick"],et=["onClick"],tt={class:"column"},nt=["src","alt","onError"],ot="bookmark_manager_state",rt={__name:"z-marked-widget",props:{theme:{type:String,default:"light"},small:{type:Boolean,default:!1},categories:{type:Array,default:()=>["Personal","Work","Study"]},open:{type:String,default:"self"},useStorage:{type:Boolean,default:!1}},setup(e){const n=e,o={Personal:[{title:"Reddit",url:"https://reddit.com",logo:"https://www.google.com/s2/favicons?domain=reddit.com&sz=64"},{title:"Spotify",url:"https://spotify.com",logo:"https://www.google.com/s2/favicons?domain=spotify.com&sz=64"},{title:"Youtube",url:"https://youtube.com",logo:"https://www.google.com/s2/favicons?domain=youtube.com&sz=64"},{title:"Instagram",url:"https://instagram.com",logo:"https://www.google.com/s2/favicons?domain=instagram.com&sz=64"},{title:"Facebook",url:"https://facebook.com",logo:"https://www.google.com/s2/favicons?domain=facebook.com&sz=64"},{title:"WhatsApp",url:"https://whatsapp.com",logo:"https://www.google.com/s2/favicons?domain=whatsapp.com&sz=64"},{title:"Telegram",url:"https://web.telegram.org/",logo:"https://www.google.com/s2/favicons?domain=web.telegram.org&sz=64"},{title:"Spotify",url:"https://spotify.com",logo:"https://www.google.com/s2/favicons?domain=spotify.com&sz=64"}],Work:[{title:"GitHub",url:"https://github.com",logo:"https://www.google.com/s2/favicons?domain=github.com&sz=64"},{title:"Notion",url:"https://notion.so",logo:"https://www.google.com/s2/favicons?domain=notion.so&sz=64"}],Study:[{title:"MDN Web Docs",url:"https://developer.mozilla.org",logo:"https://www.google.com/s2/favicons?domain=mozilla.org&sz=64"},{title:"FreeCodeCamp",url:"https://freecodecamp.org",logo:"https://www.google.com/s2/favicons?domain=freecodecamp.org&sz=64"}]},r=t.reactive({bookmarks:n.useStorage&&JSON.parse(localStorage.getItem(ot))||o,activeTab:"Personal"}),i=t.ref([...n.categories]),s=t.ref(n.small),l=t.ref(n.theme),c=t.ref(n.open),a=t.ref(n.useStorage),u=computed(()=>r.bookmarks[r.activeTab]||[]);function f(){a.value&&localStorage.setItem(ot,JSON.stringify(r.bookmarks))}function p(){const e=prompt("Nombre del marcador:");if(!e)return;const t=prompt("URL del marcador:");if(!t)return;const n=`https://www.google.com/s2/favicons?domain=${new URL(t).hostname}&sz=64`;r.bookmarks[r.activeTab]||(r.bookmarks[r.activeTab]=[]),r.bookmarks[r.activeTab].push({title:e,url:t,logo:n}),f()}const m=computed(()=>({position:"relative",width:s.value?"50px":"40px",height:s.value?"50px":"40px",marginBottom:"8px",borderRadius:".4rem",display:"flex",alignItems:"center",justifyContent:"center",fontWeight:"bold",fontSize:"1.8rem",color:"light"===l.value?"#555":"#eee",userSelect:"none"}));return t.watch(()=>r.bookmarks,()=>f(),{deep:!0}),(e,n)=>(t.openBlock(),t.createElementBlock("div",null,[t.createElementVNode("div",Je,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(i.value,e=>(t.openBlock(),t.createElementBlock("div",{key:e,class:"container-tab"},[t.createElementVNode("button",{class:t.normalizeClass(["tab",{active:e===r.activeTab}]),onClick:t=>function(e){r.activeTab=e}(e)},t.toDisplayString(e),11,Qe)]))),128))]),t.createElementVNode("div",Ke,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(t.unref(u),(e,n)=>(t.openBlock(),t.createElementBlock("div",{key:n,class:t.normalizeClass(["card",s.value?"small":""])},[t.createElementVNode("div",Ye,[t.createElementVNode("button",{class:"edit-app",onClick:t.withModifiers(e=>function(e){return d(this,null,function*(){const t=r.bookmarks[r.activeTab][e],n=prompt("Nuevo título:",t.title);if(null===n)return;const o=prompt("Nueva URL:",t.url);null!==o&&(t.title=n,t.url=o,t.logo=`https://www.google.com/s2/favicons?domain=${new URL(o).hostname}&sz=64`,f())})}(n),["prevent"])},"✏️",8,Ge),t.createElementVNode("button",{class:"delete-app",onClick:t.withModifiers(e=>function(e){return d(this,null,function*(){confirm(`¿Estás seguro de eliminar ${r.bookmarks[r.activeTab][e].title}?`)&&(r.bookmarks[r.activeTab].splice(e,1),f())})}(n),["prevent"])},"🗑️",8,Xe)]),t.createElementVNode("a",{href:"#",class:"card-link",onClick:t.withModifiers(t=>{return n=e.url,void("self"===c.value?window.location.href=n:window.open(n,"_blank"));var n},["prevent"])},[t.createElementVNode("div",tt,[t.createElementVNode("div",{class:"icon-container",style:t.normalizeStyle(t.unref(m)),ref_for:!0,ref:"iconContainers"},[t.createElementVNode("img",{src:e.logo,alt:e.title+" logo",class:t.normalizeClass({small:s.value}),onError:t=>function(e,t){const n=e.target;n.style.display="none";const o=n.parentNode;o.style.backgroundColor="#066D5A",o.textContent=t.charAt(0).toUpperCase()}(t,e.title)},null,42,nt)],4),t.createTextVNode(" "+t.toDisplayString(e.title),1)])],8,et)],2))),128)),t.unref(u).length<8?(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(["card",s.value?"small":""])},[t.createElementVNode("a",{href:"#",class:"card-link",onClick:t.withModifiers(p,["prevent"])},n[0]||(n[0]=[t.createElementVNode("div",{class:"column"},[t.createElementVNode("span",{class:"add"},"+"),t.createTextVNode(" Add ")],-1)]))],2)):t.createCommentVNode("",!0)])]))}},it=f(rt,[["__scopeId","data-v-5fb970f5"]]),st=t.defineCustomElement(v),lt=t.defineCustomElement(Le),ct=t.defineCustomElement(He),at=t.defineCustomElement(it);customElements.get("z-clock-widget")||customElements.define("z-clock-widget",st),customElements.get("z-search-widget")||customElements.define("z-search-widget",lt),customElements.get("z-todo-widget")||customElements.define("z-todo-widget",ct),customElements.get("z-marked-widget")||customElements.define("z-search-widget",at),e.ZClockWidget=v,e.ZMarkedWidget=it,e.ZSearchWidget=Le,e.ZTodoWidget=He,Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})});
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("vue")):"function"==typeof define&&define.amd?define(["exports","vue"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).ZenWdg={},e.Vue)}(this,function(e,t){"use strict";var o=Object.defineProperty,n=Object.defineProperties,r=Object.getOwnPropertyDescriptors,i=Object.getOwnPropertySymbols,s=Object.prototype.hasOwnProperty,l=Object.prototype.propertyIsEnumerable,a=(e,t,n)=>t in e?o(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,c=(e,t)=>{for(var o in t||(t={}))s.call(t,o)&&a(e,o,t[o]);if(i)for(var o of i(t))l.call(t,o)&&a(e,o,t[o]);return e},u=(e,t)=>n(e,r(t));const d=(e,t)=>{const o=e.__vccOpts||e;for(const[n,r]of t)o[n]=r;return o},p={class:"clock-container"},f={class:"clock"},m={class:"time"},h={class:"date"};const g=d({name:"ZClockWidget",data:()=>({hours:"00",minutes:"00",seconds:"00",dayOfWeek:"",day:"",month:"",year:""}),mounted(){this.updateClock(),setInterval(this.updateClock,1e3)},methods:{updateClock(){const e=new Date;this.hours=e.getHours().toString().padStart(2,"0"),this.minutes=e.getMinutes().toString().padStart(2,"0"),this.seconds=e.getSeconds().toString().padStart(2,"0"),this.dayOfWeek=this.getDayOfWeek(e.getDay()),this.day=e.getDate(),this.month=this.getMonthName(e.getMonth()),this.year=e.getFullYear()},getDayOfWeek:e=>["Domingo","Lunes","Martes","Miércoles","Jueves","Viernes","Sábado"][e],getMonthName:e=>["Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"][e]}},[["render",function(e,o,n,r,i,s){return t.openBlock(),t.createElementBlock("div",p,[t.createElementVNode("div",f,[t.createElementVNode("div",m,[t.createElementVNode("span",null,t.toDisplayString(i.hours),1),o[0]||(o[0]=t.createTextVNode(":",-1)),t.createElementVNode("span",null,t.toDisplayString(i.minutes),1)]),t.createElementVNode("div",h,[t.createElementVNode("span",null,t.toDisplayString(i.dayOfWeek)+", "+t.toDisplayString(i.day)+" "+t.toDisplayString(i.month)+" "+t.toDisplayString(i.year),1)])])])}],["__scopeId","data-v-e9445086"]]),k={data:()=>({}),props:{placeholder:String,modelValue:{type:String,default:""},round:{type:Boolean,default:!1},full:{type:Boolean},rounded:{type:Boolean,default:!1}},methods:{onInput(e){this.$emit("update:modelValue",e.target.value)},onEnter(){this.$emit("enter-pressed",this.modelValue)}}},y=["placeholder","value"];const v=d(k,[["render",function(e,o,n,r,i,s){return t.openBlock(),t.createElementBlock("input",{placeholder:n.placeholder,value:n.modelValue,onInput:o[0]||(o[0]=(...e)=>s.onInput&&s.onInput(...e)),onKeydown:o[1]||(o[1]=t.withKeys((...e)=>s.onEnter&&s.onEnter(...e),["enter"])),class:t.normalizeClass([{"full-width":n.full},{round:n.round},{rounded:n.rounded}])},null,42,y)}],["__scopeId","data-v-2ad90286"]]),b=/^[a-z0-9]+(-[a-z0-9]+)*$/,w=(e,t,o,n="")=>{const r=e.split(":");if("@"===e.slice(0,1)){if(r.length<2||r.length>3)return null;n=r.shift().slice(1)}if(r.length>3||!r.length)return null;if(r.length>1){const e=r.pop(),o=r.pop(),i={provider:r.length>0?r[0]:n,prefix:o,name:e};return t&&!E(i)?null:i}const i=r[0],s=i.split("-");if(s.length>1){const e={provider:n,prefix:s.shift(),name:s.join("-")};return t&&!E(e)?null:e}if(o&&""===n){const e={provider:n,prefix:"",name:i};return t&&!E(e,o)?null:e}return null},E=(e,t)=>!!e&&!(!(t&&""===e.prefix||e.prefix)||!e.name),x=Object.freeze({left:0,top:0,width:16,height:16}),S=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),T=Object.freeze(c(c({},x),S)),B=Object.freeze(u(c({},T),{body:"",hidden:!1}));function C(e,t){const o=function(e,t){const o={};!e.hFlip!=!t.hFlip&&(o.hFlip=!0),!e.vFlip!=!t.vFlip&&(o.vFlip=!0);const n=((e.rotate||0)+(t.rotate||0))%4;return n&&(o.rotate=n),o}(e,t);for(const n in B)n in S?n in e&&!(n in o)&&(o[n]=S[n]):n in t?o[n]=t[n]:n in e&&(o[n]=e[n]);return o}function N(e,t,o){const n=e.icons,r=e.aliases||Object.create(null);let i={};function s(e){i=C(n[e]||r[e],i)}return s(t),o.forEach(s),C(e,i)}function V(e,t){const o=[];if("object"!=typeof e||"object"!=typeof e.icons)return o;e.not_found instanceof Array&&e.not_found.forEach(e=>{t(e,null),o.push(e)});const n=function(e){const t=e.icons,o=e.aliases||Object.create(null),n=Object.create(null);return Object.keys(t).concat(Object.keys(o)).forEach(function e(r){if(t[r])return n[r]=[];if(!(r in n)){n[r]=null;const t=o[r]&&o[r].parent,i=t&&e(t);i&&(n[r]=[t].concat(i))}return n[r]}),n}(e);for(const r in n){const i=n[r];i&&(t(r,N(e,r,i)),o.push(r))}return o}const z=c({provider:"",aliases:{},not_found:{}},x);function j(e,t){for(const o in t)if(o in e&&typeof e[o]!=typeof t[o])return!1;return!0}function O(e){if("object"!=typeof e||null===e)return null;const t=e;if("string"!=typeof t.prefix||!e.icons||"object"!=typeof e.icons)return null;if(!j(e,z))return null;const o=t.icons;for(const r in o){const e=o[r];if(!r||"string"!=typeof e.body||!j(e,B))return null}const n=t.aliases||Object.create(null);for(const r in n){const e=n[r],t=e.parent;if(!r||"string"!=typeof t||!o[t]&&!n[t]||!j(e,B))return null}return t}const I=Object.create(null);function F(e,t){const o=I[e]||(I[e]=Object.create(null));return o[t]||(o[t]=function(e,t){return{provider:e,prefix:t,icons:Object.create(null),missing:new Set}}(e,t))}function M(e,t){return O(t)?V(t,(t,o)=>{o?e.icons[t]=o:e.missing.add(t)}):[]}let L=!1;function D(e){return"boolean"==typeof e&&(L=e),L}function P(e,t){const o=w(e,!0,L);if(!o)return!1;const n=F(o.provider,o.prefix);return t?function(e,t,o){try{if("string"==typeof o.body)return e.icons[t]=c({},o),!0}catch(n){}return!1}(n,o.name,t):(n.missing.add(o.name),!0)}const _=Object.freeze({width:null,height:null}),A=Object.freeze(c(c({},_),S)),R=/(-?[0-9.]*[0-9]+[0-9.]*)/g,W=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function U(e,t,o){if(1===t)return e;if(o=o||100,"number"==typeof e)return Math.ceil(e*t*o)/o;if("string"!=typeof e)return e;const n=e.split(R);if(null===n||!n.length)return e;const r=[];let i=n.shift(),s=W.test(i);for(;;){if(s){const e=parseFloat(i);isNaN(e)?r.push(i):r.push(Math.ceil(e*t*o)/o)}else r.push(i);if(i=n.shift(),void 0===i)return r.join("");s=!s}}const $=/\sid="(\S+)"/g,q="IconifyId"+Date.now().toString(16)+(16777216*Math.random()|0).toString(16);let Z=0;const H=Object.create(null);function J(e){return H[e]||H[""]}function K(e){let t;if("string"==typeof e.resources)t=[e.resources];else if(t=e.resources,!(t instanceof Array&&t.length))return null;return{resources:t,path:e.path||"/",maxURL:e.maxURL||500,rotate:e.rotate||750,timeout:e.timeout||5e3,random:!0===e.random,index:e.index||0,dataAfterTimeout:!1!==e.dataAfterTimeout}}const Y=Object.create(null),G=["https://api.simplesvg.com","https://api.unisvg.com"],Q=[];for(;G.length>0;)1===G.length||Math.random()>.5?Q.push(G.shift()):Q.push(G.pop());function X(e,t){const o=K(t);return null!==o&&(Y[e]=o,!0)}function ee(e){return Y[e]}Y[""]=K({resources:["https://api.iconify.design"].concat(Q)});let te=(()=>{let e;try{if(e=fetch,"function"==typeof e)return e}catch(t){}})();const oe={prepare:(e,t,o)=>{const n=[],r=function(e,t){const o=ee(e);if(!o)return 0;let n;if(o.maxURL){let e=0;o.resources.forEach(t=>{const o=t;e=Math.max(e,o.length)});const r=t+".json?icons=";n=o.maxURL-e-o.path.length-r.length}else n=0;return n}(e,t),i="icons";let s={type:i,provider:e,prefix:t,icons:[]},l=0;return o.forEach((o,a)=>{l+=o.length+1,l>=r&&a>0&&(n.push(s),s={type:i,provider:e,prefix:t,icons:[]},l=o.length),s.icons.push(o)}),n.push(s),n},send:(e,t,o)=>{if(!te)return void o("abort",424);let n=function(e){if("string"==typeof e){const t=ee(e);if(t)return t.path}return"/"}(t.provider);switch(t.type){case"icons":{const e=t.prefix,o=t.icons.join(",");n+=e+".json?"+new URLSearchParams({icons:o}).toString();break}case"custom":{const e=t.uri;n+="/"===e.slice(0,1)?e.slice(1):e;break}default:return void o("abort",400)}let r=503;te(e+n).then(e=>{const t=e.status;if(200===t)return r=501,e.json();setTimeout(()=>{o(function(e){return 404===e}(t)?"abort":"next",t)})}).then(e=>{"object"==typeof e&&null!==e?setTimeout(()=>{o("success",e)}):setTimeout(()=>{404===e?o("abort",e):o("next",r)})}).catch(()=>{o("next",r)})}};function ne(e,t){e.forEach(e=>{const o=e.loaderCallbacks;o&&(e.loaderCallbacks=o.filter(e=>e.id!==t))})}let re=0;var ie={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function se(e,t,o,n){const r=e.resources.length,i=e.random?Math.floor(Math.random()*r):e.index;let s;if(e.random){let t=e.resources.slice(0);for(s=[];t.length>1;){const e=Math.floor(Math.random()*t.length);s.push(t[e]),t=t.slice(0,e).concat(t.slice(e+1))}s=s.concat(t)}else s=e.resources.slice(i).concat(e.resources.slice(0,i));const l=Date.now();let a,c="pending",u=0,d=null,p=[],f=[];function m(){d&&(clearTimeout(d),d=null)}function h(){"pending"===c&&(c="aborted"),m(),p.forEach(e=>{"pending"===e.status&&(e.status="aborted")}),p=[]}function g(e,t){t&&(f=[]),"function"==typeof e&&f.push(e)}function k(){c="failed",f.forEach(e=>{e(void 0,a)})}function y(){p.forEach(e=>{"pending"===e.status&&(e.status="aborted")}),p=[]}function v(){if("pending"!==c)return;m();const n=s.shift();if(void 0===n)return p.length?void(d=setTimeout(()=>{m(),"pending"===c&&(y(),k())},e.timeout)):void k();const r={status:"pending",resource:n,callback:(t,o)=>{!function(t,o,n){const r="success"!==o;switch(p=p.filter(e=>e!==t),c){case"pending":break;case"failed":if(r||!e.dataAfterTimeout)return;break;default:return}if("abort"===o)return a=n,void k();if(r)return a=n,void(p.length||(s.length?v():k()));if(m(),y(),!e.random){const o=e.resources.indexOf(t.resource);-1!==o&&o!==e.index&&(e.index=o)}c="completed",f.forEach(e=>{e(n)})}(r,t,o)}};p.push(r),u++,d=setTimeout(v,e.rotate),o(n,t,r.callback)}return"function"==typeof n&&f.push(n),setTimeout(v),function(){return{startTime:l,payload:t,status:c,queriesSent:u,queriesPending:p.length,subscribe:g,abort:h}}}function le(e){const t=c(c({},ie),e);let o=[];function n(){o=o.filter(e=>"pending"===e().status)}return{query:function(e,r,i){const s=se(t,e,r,(e,t)=>{n(),i&&i(e,t)});return o.push(s),s},find:function(e){return o.find(t=>e(t))||null},setIndex:e=>{t.index=e},getIndex:()=>t.index,cleanup:n}}function ae(){}const ce=Object.create(null);function ue(e,t,o){let n,r;if("string"==typeof e){const t=J(e);if(!t)return o(void 0,424),ae;r=t.send;const i=function(e){if(!ce[e]){const t=ee(e);if(!t)return;const o={config:t,redundancy:le(t)};ce[e]=o}return ce[e]}(e);i&&(n=i.redundancy)}else{const t=K(e);if(t){n=le(t);const o=J(e.resources?e.resources[0]:"");o&&(r=o.send)}}return n&&r?n.query(t,r,o)().abort:(o(void 0,424),ae)}function de(){}function pe(e){e.iconsLoaderFlag||(e.iconsLoaderFlag=!0,setTimeout(()=>{e.iconsLoaderFlag=!1,function(e){e.pendingCallbacksFlag||(e.pendingCallbacksFlag=!0,setTimeout(()=>{e.pendingCallbacksFlag=!1;const t=e.loaderCallbacks?e.loaderCallbacks.slice(0):[];if(!t.length)return;let o=!1;const n=e.provider,r=e.prefix;t.forEach(t=>{const i=t.icons,s=i.pending.length;i.pending=i.pending.filter(t=>{if(t.prefix!==r)return!0;const s=t.name;if(e.icons[s])i.loaded.push({provider:n,prefix:r,name:s});else{if(!e.missing.has(s))return o=!0,!0;i.missing.push({provider:n,prefix:r,name:s})}return!1}),i.pending.length!==s&&(o||ne([e],t.id),t.callback(i.loaded.slice(0),i.missing.slice(0),i.pending.slice(0),t.abort))})}))}(e)}))}function fe(e,t,o){function n(){const o=e.pendingIcons;t.forEach(t=>{o&&o.delete(t),e.icons[t]||e.missing.add(t)})}if(o&&"object"==typeof o)try{if(!M(e,o).length)return void n()}catch(r){console.error(r)}n(),pe(e)}function me(e,t){e instanceof Promise?e.then(e=>{t(e)}).catch(()=>{t(null)}):t(e)}function he(e,t){e.iconsToLoad?e.iconsToLoad=e.iconsToLoad.concat(t).sort():e.iconsToLoad=t,e.iconsQueueFlag||(e.iconsQueueFlag=!0,setTimeout(()=>{e.iconsQueueFlag=!1;const{provider:t,prefix:o}=e,n=e.iconsToLoad;if(delete e.iconsToLoad,!n||!n.length)return;const r=e.loadIcon;if(e.loadIcons&&(n.length>1||!r))return void me(e.loadIcons(n,o,t),t=>{fe(e,n,t)});if(r)return void n.forEach(n=>{me(r(n,o,t),t=>{fe(e,[n],t?{prefix:o,icons:{[n]:t}}:null)})});const{valid:i,invalid:s}=function(e){const t=[],o=[];return e.forEach(e=>{(e.match(b)?t:o).push(e)}),{valid:t,invalid:o}}(n);if(s.length&&fe(e,s,null),!i.length)return;const l=o.match(b)?J(t):null;if(!l)return void fe(e,i,null);l.prepare(t,o,i).forEach(o=>{ue(t,o,t=>{fe(e,o.icons,t)})})}))}const ge=(e,t)=>{const o=function(e){const t={loaded:[],missing:[],pending:[]},o=Object.create(null);e.sort((e,t)=>e.provider!==t.provider?e.provider.localeCompare(t.provider):e.prefix!==t.prefix?e.prefix.localeCompare(t.prefix):e.name.localeCompare(t.name));let n={provider:"",prefix:"",name:""};return e.forEach(e=>{if(n.name===e.name&&n.prefix===e.prefix&&n.provider===e.provider)return;n=e;const r=e.provider,i=e.prefix,s=e.name,l=o[r]||(o[r]=Object.create(null)),a=l[i]||(l[i]=F(r,i));let c;c=s in a.icons?t.loaded:""===i||a.missing.has(s)?t.missing:t.pending;const u={provider:r,prefix:i,name:s};c.push(u)}),t}(function(e,t=!0,o=!1){const n=[];return e.forEach(e=>{const r="string"==typeof e?w(e,t,o):e;r&&n.push(r)}),n}(e,!0,D()));if(!o.pending.length){let e=!0;return t&&setTimeout(()=>{e&&t(o.loaded,o.missing,o.pending,de)}),()=>{e=!1}}const n=Object.create(null),r=[];let i,s;return o.pending.forEach(e=>{const{provider:t,prefix:o}=e;if(o===s&&t===i)return;i=t,s=o,r.push(F(t,o));const l=n[t]||(n[t]=Object.create(null));l[o]||(l[o]=[])}),o.pending.forEach(e=>{const{provider:t,prefix:o,name:r}=e,i=F(t,o),s=i.pendingIcons||(i.pendingIcons=new Set);s.has(r)||(s.add(r),n[t][o].push(r))}),r.forEach(e=>{const t=n[e.provider][e.prefix];t.length&&he(e,t)}),t?function(e,t,o){const n=re++,r=ne.bind(null,o,n);if(!t.pending.length)return r;const i={id:n,icons:t,callback:e,abort:r};return o.forEach(e=>{(e.loaderCallbacks||(e.loaderCallbacks=[])).push(i)}),r}(t,o,r):de};const ke=/[\s,]+/;function ye(e,t){t.split(ke).forEach(t=>{switch(t.trim()){case"horizontal":e.hFlip=!0;break;case"vertical":e.vFlip=!0}})}function ve(e,t=0){const o=e.replace(/^-?[0-9.]*/,"");function n(e){for(;e<0;)e+=4;return e%4}if(""===o){const t=parseInt(e);return isNaN(t)?0:n(t)}if(o!==e){let t=0;switch(o){case"%":t=25;break;case"deg":t=90}if(t){let r=parseFloat(e.slice(0,e.length-o.length));return isNaN(r)?0:(r/=t,r%1==0?n(r):0)}}return t}const be=u(c({},A),{inline:!1}),we={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":!0,role:"img"},Ee={display:"inline-block"},xe={backgroundColor:"currentColor"},Se={backgroundColor:"transparent"},Te={Image:"var(--svg)",Repeat:"no-repeat",Size:"100% 100%"},Be={webkitMask:xe,mask:xe,background:Se};for(const ct in Be){const e=Be[ct];for(const t in Te)e[ct+t]=Te[t]}const Ce={};function Ne(e){return e+(e.match(/^[-0-9.]+$/)?"px":"")}["horizontal","vertical"].forEach(e=>{const t=e.slice(0,1)+"Flip";Ce[e+"-flip"]=t,Ce[e.slice(0,1)+"-flip"]=t,Ce[e+"Flip"]=t});const Ve=(e,o)=>{const n=function(e,t){const o=c({},e);for(const n in t){const e=t[n],r=typeof e;n in _?(null===e||e&&("string"===r||"number"===r))&&(o[n]=e):r===typeof o[n]&&(o[n]="rotate"===n?e%4:e)}return o}(be,o),r=c({},we),i=o.mode||"svg",s={},l=o.style,a="object"!=typeof l||l instanceof Array?{}:l;for(let t in o){const e=o[t];if(void 0!==e)switch(t){case"icon":case"style":case"onLoad":case"mode":case"ssr":break;case"inline":case"hFlip":case"vFlip":n[t]=!0===e||"true"===e||1===e;break;case"flip":"string"==typeof e&&ye(n,e);break;case"color":s.color=e;break;case"rotate":"string"==typeof e?n[t]=ve(e):"number"==typeof e&&(n[t]=e);break;case"ariaHidden":case"aria-hidden":!0!==e&&"true"!==e&&delete r["aria-hidden"];break;default:{const o=Ce[t];o?!0!==e&&"true"!==e&&1!==e||(n[o]=!0):void 0===be[t]&&(r[t]=e)}}}const d=function(e,t){const o=c(c({},T),e),n=c(c({},A),t),r={left:o.left,top:o.top,width:o.width,height:o.height};let i=o.body;[o,n].forEach(e=>{const t=[],o=e.hFlip,n=e.vFlip;let s,l=e.rotate;switch(o?n?l+=2:(t.push("translate("+(r.width+r.left).toString()+" "+(0-r.top).toString()+")"),t.push("scale(-1 1)"),r.top=r.left=0):n&&(t.push("translate("+(0-r.left).toString()+" "+(r.height+r.top).toString()+")"),t.push("scale(1 -1)"),r.top=r.left=0),l<0&&(l-=4*Math.floor(l/4)),l%=4,l){case 1:s=r.height/2+r.top,t.unshift("rotate(90 "+s.toString()+" "+s.toString()+")");break;case 2:t.unshift("rotate(180 "+(r.width/2+r.left).toString()+" "+(r.height/2+r.top).toString()+")");break;case 3:s=r.width/2+r.left,t.unshift("rotate(-90 "+s.toString()+" "+s.toString()+")")}l%2==1&&(r.left!==r.top&&(s=r.left,r.left=r.top,r.top=s),r.width!==r.height&&(s=r.width,r.width=r.height,r.height=s)),t.length&&(i=function(e,t,o){const n=function(e,t="defs"){let o="";const n=e.indexOf("<"+t);for(;n>=0;){const r=e.indexOf(">",n),i=e.indexOf("</"+t);if(-1===r||-1===i)break;const s=e.indexOf(">",i);if(-1===s)break;o+=e.slice(r+1,i).trim(),e=e.slice(0,n).trim()+e.slice(s+1)}return{defs:o,content:e}}(e);return r=n.defs,i=t+n.content+o,r?"<defs>"+r+"</defs>"+i:i;var r,i}(i,'<g transform="'+t.join(" ")+'">',"</g>"))});const s=n.width,l=n.height,a=r.width,u=r.height;let d,p;null===s?(p=null===l?"1em":"auto"===l?u:l,d=U(p,a/u)):(d="auto"===s?a:s,p=null===l?U(d,u/a):"auto"===l?u:l);const f={},m=(e,t)=>{(e=>"unset"===e||"undefined"===e||"none"===e)(t)||(f[e]=t.toString())};m("width",d),m("height",p);const h=[r.left,r.top,a,u];return f.viewBox=h.join(" "),{attributes:f,viewBox:h,body:i}}(e,n),p=d.attributes;if(n.inline&&(s.verticalAlign="-0.125em"),"svg"===i){r.style=c(c({},s),a),Object.assign(r,p);let e=0,n=o.id;return"string"==typeof n&&(n=n.replace(/-/g,"_")),r.innerHTML=function(e,t=q){const o=[];let n;for(;n=$.exec(e);)o.push(n[1]);if(!o.length)return e;const r="suffix"+(16777216*Math.random()|Date.now()).toString(16);return o.forEach(o=>{const n="function"==typeof t?t(o):t+(Z++).toString(),i=o.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");e=e.replace(new RegExp('([#;"])('+i+')([")]|\\.[a-z])',"g"),"$1"+n+r+"$3")}),e=e.replace(new RegExp(r,"g"),"")}(d.body,n?()=>n+"ID"+e++:"iconifyVue"),t.h("svg",r)}const{body:f,width:m,height:h}=e,g="mask"===i||"bg"!==i&&-1!==f.indexOf("currentColor"),k=function(e,t){let o=-1===e.indexOf("xlink:")?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const n in t)o+=" "+n+'="'+t[n]+'"';return'<svg xmlns="http://www.w3.org/2000/svg"'+o+">"+e+"</svg>"}(f,u(c({},p),{width:m+"",height:h+""}));var y;return r.style=c(c(c(u(c({},s),{"--svg":(y=k,'url("'+function(e){return"data:image/svg+xml,"+function(e){return e.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(/</g,"%3C").replace(/>/g,"%3E").replace(/\s+/g," ")}(e)}(y)+'")'),width:Ne(p.width),height:Ne(p.height)}),Ee),g?xe:Se),a),t.h("span",r)};var ze;if(D(!0),ze=oe,H[""]=ze,"undefined"!=typeof document&&"undefined"!=typeof window){const e=window;if(void 0!==e.IconifyPreload){const t=e.IconifyPreload,o="Invalid IconifyPreload syntax.";"object"==typeof t&&null!==t&&(t instanceof Array?t:[t]).forEach(e=>{try{("object"!=typeof e||null===e||e instanceof Array||"object"!=typeof e.icons||"string"!=typeof e.prefix||!function(e,t){if("object"!=typeof e)return!1;if("string"!=typeof t&&(t=e.provider||""),L&&!t&&!e.prefix){let t=!1;return O(e)&&(e.prefix="",V(e,(e,o)=>{P(e,o)&&(t=!0)})),t}const o=e.prefix;return!!E({prefix:o,name:"a"})&&!!M(F(t,o),e)}(e))&&console.error(o)}catch(t){console.error(o)}})}if(void 0!==e.IconifyProviders){const t=e.IconifyProviders;if("object"==typeof t&&null!==t)for(let e in t){const o="IconifyProviders["+e+"] is invalid.";try{const n=t[e];if("object"!=typeof n||!n||void 0===n.resources)continue;X(e,n)||console.error(o)}catch(at){console.error(o)}}}}const je=u(c({},T),{body:""}),Oe={data:()=>({}),components:{Icon:t.defineComponent((e,{emit:o})=>{const n=t.ref(null);function r(){var e,t;n.value&&(null==(t=(e=n.value).abort)||t.call(e),n.value=null)}const i=t.ref(!!e.ssr),s=t.ref(""),l=t.shallowRef(null);function a(){const i=e.icon;if("object"==typeof i&&null!==i&&"string"==typeof i.body)return s.value="",{data:i};let l;if("string"!=typeof i||null===(l=w(i,!1,!0)))return null;let a=function(e){const t="string"==typeof e?w(e,!0,L):e;if(t){const e=F(t.provider,t.prefix),o=t.name;return e.icons[o]||(e.missing.has(o)?null:void 0)}}(l);if(!a){const e=n.value;return e&&e.name===i||(n.value=null===a?{name:i}:{name:i,abort:ge([l],d)}),null}r(),s.value!==i&&(s.value=i,t.nextTick(()=>{o("load",i)}));const c=e.customise;if(c){a=Object.assign({},a);const e=c(a.body,l.name,l.prefix,l.provider);"string"==typeof e&&(a.body=e)}const u=["iconify"];return""!==l.prefix&&u.push("iconify--"+l.prefix),""!==l.provider&&u.push("iconify--"+l.provider),{data:a,classes:u}}function d(){var e;const t=a();t?t.data!==(null==(e=l.value)?void 0:e.data)&&(l.value=t):l.value=null}return i.value?d():t.onMounted(()=>{i.value=!0,d()}),t.watch(()=>e.icon,d),t.onUnmounted(r),()=>{const t=l.value;if(!t)return Ve(je,e);let o=e;return t.classes&&(o=u(c({},e),{class:t.classes.join(" ")})),Ve(c(c({},T),t.data),o)}},{props:["icon","mode","ssr","width","height","style","color","inline","rotate","hFlip","horizontalFlip","vFlip","verticalFlip","flip","id","ariaHidden","customise","title"],emits:["load"]})},props:{title:{type:String,required:!1},bound:{type:Boolean,default:!1},bounded:{type:Boolean,default:!1},flat:{type:Boolean,default:!1},iconLeft:{type:Boolean,required:!1,default:!1},iconRight:{type:Boolean,default:!1},icon:{type:String},size:{type:String},iconSize:{type:String},wFull:{type:Boolean,default:!1},noBg:{type:Boolean,default:!1},color:String},methods:{}};const Ie={class:"search"},Fe=["src"];const Me=d({name:"ZSearchWidget",data:()=>({text:""}),props:{searchTarget:{type:String,require:!1,default:"same"},logo:{type:String,require:!1}},components:{Input:v,Button:d(Oe,[["render",function(e,o,n,r,i,s){const l=t.resolveComponent("Icon");return t.openBlock(),t.createElementBlock("button",{class:t.normalizeClass([{flat:n.flat},{bound:n.bound},{bounded:n.bounded},{"w-full":n.wFull},{transparent:n.noBg}]),style:t.normalizeStyle([{"font-size":n.size},{color:n.color}])},[n.iconLeft?(t.openBlock(),t.createBlock(l,{key:0,icon:n.icon,style:t.normalizeStyle({"font-size":n.iconSize})},null,8,["icon","style"])):t.createCommentVNode("",!0),t.createTextVNode(" "+t.toDisplayString(n.title)+" ",1),n.icon&&!n.iconLeft?(t.openBlock(),t.createBlock(l,{key:1,icon:n.icon,width:n.iconSize,height:n.iconSize},null,8,["icon","width","height"])):t.createCommentVNode("",!0)],6)}],["__scopeId","data-v-10678914"]])},methods:{search(){const e=`https://astiango.co/?q=${encodeURIComponent(this.text)}`;"new"==this.searchTarget?chrome.tabs.create({url:e}):"same"==this.searchTarget&&chrome.tabs.update({url:e})}}},[["render",function(e,o,n,r,i,s){const l=t.resolveComponent("Input"),a=t.resolveComponent("Button");return t.openBlock(),t.createElementBlock("div",Ie,[n.logo?(t.openBlock(),t.createElementBlock("img",{key:0,src:n.logo},null,8,Fe)):t.createCommentVNode("",!0),t.createVNode(l,{placeholder:"Search something",full:"",class:"bg",modelValue:i.text,"onUpdate:modelValue":o[0]||(o[0]=e=>i.text=e),onEnterPressed:o[1]||(o[1]=e=>s.search())},null,8,["modelValue"]),t.createVNode(a,{icon:"material-symbols-light:search-rounded",size:"25px",flat:"",class:"text-color",onClick:o[2]||(o[2]=e=>s.search())})])}],["__scopeId","data-v-50392e2c"]]),Le={class:"todo-widget"},De={class:"task-section"},Pe={key:0,class:"empty"},_e={class:"actions"},Ae=["onClick"],Re=["onClick"],We={class:"task-section completed"},Ue={key:0,class:"empty"},$e={class:"done"},qe=["onClick"];const Ze=d({name:"ZTodoWidget",data:()=>({newTask:"",pendingTasks:[],completedTasks:[]}),methods:{addTask(){this.newTask.trim()&&(this.pendingTasks.push({text:this.newTask.trim()}),this.newTask="")},completeTask(e){const t=this.pendingTasks.splice(e,1)[0];this.completedTasks.push(t)},deleteTask(e){this.pendingTasks.splice(e,1)},deleteCompleted(e){this.completedTasks.splice(e,1)}}},[["render",function(e,o,n,r,i,s){return t.openBlock(),t.createElementBlock("div",Le,[o[5]||(o[5]=t.createElementVNode("h2",{class:"title"},"📝 Mis Tareas",-1)),t.createElementVNode("form",{onSubmit:o[1]||(o[1]=t.withModifiers((...e)=>s.addTask&&s.addTask(...e),["prevent"])),class:"todo-form"},[t.withDirectives(t.createElementVNode("input",{"onUpdate:modelValue":o[0]||(o[0]=e=>i.newTask=e),type:"text",placeholder:"Escribe una nueva tarea..."},null,512),[[t.vModelText,i.newTask]]),o[2]||(o[2]=t.createElementVNode("button",{type:"submit"},"Agregar",-1))],32),t.createElementVNode("div",De,[o[3]||(o[3]=t.createElementVNode("h3",null,"Tareas Pendientes",-1)),0===i.pendingTasks.length?(t.openBlock(),t.createElementBlock("div",Pe,"Sin tareas.")):t.createCommentVNode("",!0),t.createElementVNode("ul",null,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(i.pendingTasks,(e,o)=>(t.openBlock(),t.createElementBlock("li",{key:o},[t.createElementVNode("span",null,t.toDisplayString(e.text),1),t.createElementVNode("div",_e,[t.createElementVNode("button",{onClick:e=>s.completeTask(o)},"✔️",8,Ae),t.createElementVNode("button",{onClick:e=>s.deleteTask(o)},"🗑️",8,Re)])]))),128))])]),t.createElementVNode("div",We,[o[4]||(o[4]=t.createElementVNode("h3",null,"Completadas",-1)),0===i.completedTasks.length?(t.openBlock(),t.createElementBlock("div",Ue,"Ninguna aún.")):t.createCommentVNode("",!0),t.createElementVNode("ul",null,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(i.completedTasks,(e,o)=>(t.openBlock(),t.createElementBlock("li",{key:"c"+o},[t.createElementVNode("span",$e,t.toDisplayString(e.text),1),t.createElementVNode("button",{onClick:e=>s.deleteCompleted(o)},"❌",8,qe)]))),128))])])])}],["__scopeId","data-v-3560194d"]]),He={name:"ZMarkedWidget",props:{theme:{type:String,default:"light"},small:{type:Boolean,default:!1},categories:{type:Array,default:()=>["Personal","Work","Study"]},open:{type:String,default:"self"},useStorage:{type:Boolean,default:!1}},data(){const e="bookmark_manager_state",t={Personal:[{title:"Reddit",url:"https://reddit.com",logo:"https://www.google.com/s2/favicons?domain=reddit.com&sz=64"},{title:"Spotify",url:"https://spotify.com",logo:"https://www.google.com/s2/favicons?domain=spotify.com&sz=64"},{title:"Youtube",url:"https://youtube.com",logo:"https://www.google.com/s2/favicons?domain=youtube.com&sz=64"},{title:"Instagram",url:"https://instagram.com",logo:"https://www.google.com/s2/favicons?domain=instagram.com&sz=64"},{title:"Facebook",url:"https://facebook.com",logo:"https://www.google.com/s2/favicons?domain=facebook.com&sz=64"},{title:"WhatsApp",url:"https://whatsapp.com",logo:"https://www.google.com/s2/favicons?domain=whatsapp.com&sz=64"},{title:"Telegram",url:"https://web.telegram.org/",logo:"https://www.google.com/s2/favicons?domain=web.telegram.org&sz=64"},{title:"Spotify",url:"https://spotify.com",logo:"https://www.google.com/s2/favicons?domain=spotify.com&sz=64"}],Work:[{title:"GitHub",url:"https://github.com",logo:"https://www.google.com/s2/favicons?domain=github.com&sz=64"},{title:"Notion",url:"https://notion.so",logo:"https://www.google.com/s2/favicons?domain=notion.so&sz=64"}],Study:[{title:"MDN Web Docs",url:"https://developer.mozilla.org",logo:"https://www.google.com/s2/favicons?domain=mozilla.org&sz=64"},{title:"FreeCodeCamp",url:"https://freecodecamp.org",logo:"https://www.google.com/s2/favicons?domain=freecodecamp.org&sz=64"}]};return{STORAGE_KEY:e,bookmarks:this.useStorage&&JSON.parse(localStorage.getItem(e))||t,activeTab:"Personal"}},computed:{currentBookmarks(){return this.bookmarks[this.activeTab]||[]},getIconStyle(){return{position:"relative",width:this.small?"50px":"40px",height:this.small?"50px":"40px",marginBottom:"8px",borderRadius:".4rem",display:"flex",alignItems:"center",justifyContent:"center",fontWeight:"bold",fontSize:"1.8rem",color:"light"===this.theme?"#555":"#eee",userSelect:"none"}}},methods:{saveState(){this.useStorage&&localStorage.setItem(this.STORAGE_KEY,JSON.stringify(this.bookmarks))},setActiveTab(e){this.activeTab=e},openLink(e){"self"===this.open?window.location.href=e:window.open(e,"_blank")},deleteBookmark(e){const t=this.bookmarks[this.activeTab][e];confirm(`¿Estás seguro de eliminar ${t.title}?`)&&(this.bookmarks[this.activeTab].splice(e,1),this.saveState())},editBookmark(e){const t=this.bookmarks[this.activeTab][e],o=prompt("Nuevo título:",t.title);if(null===o)return;const n=prompt("Nueva URL:",t.url);null!==n&&(t.title=o,t.url=n,t.logo=`https://www.google.com/s2/favicons?domain=${new URL(n).hostname}&sz=64`,this.saveState())},addBookmarkPrompt(){const e=prompt("Nombre del marcador:");if(!e)return;const t=prompt("URL del marcador:");if(!t)return;const o=`https://www.google.com/s2/favicons?domain=${new URL(t).hostname}&sz=64`;this.bookmarks[this.activeTab].push({title:e,url:t,logo:o}),this.saveState()},onImageError(e,t){const o=e.target;o.style.display="none";const n=o.parentNode;n.style.backgroundColor="#066D5A",n.textContent=t.charAt(0).toUpperCase()}},watch:{bookmarks:{handler(){this.saveState()},deep:!0}}},Je={class:"tabs"},Ke=["onClick"],Ye={class:"grid"},Ge={class:"option-app"},Qe=["onClick"],Xe=["onClick"],et=["onClick"],tt={class:"column"},ot=["src","alt","onError"];const nt=d(He,[["render",function(e,o,n,r,i,s){return t.openBlock(),t.createElementBlock("div",null,[t.createElementVNode("div",Je,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(n.categories,e=>(t.openBlock(),t.createElementBlock("div",{key:e,class:"container-tab"},[t.createElementVNode("button",{class:t.normalizeClass(["tab",{active:e===i.activeTab}]),onClick:t=>s.setActiveTab(e)},t.toDisplayString(e),11,Ke)]))),128))]),t.createElementVNode("div",Ye,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(s.currentBookmarks,(e,o)=>(t.openBlock(),t.createElementBlock("div",{key:o,class:t.normalizeClass(["card",n.small?"small":""])},[t.createElementVNode("div",Ge,[t.createElementVNode("button",{class:"edit-app",onClick:t.withModifiers(e=>s.editBookmark(o),["prevent"])},"✏️",8,Qe),t.createElementVNode("button",{class:"delete-app",onClick:t.withModifiers(e=>s.deleteBookmark(o),["prevent"])},"🗑️",8,Xe)]),t.createElementVNode("a",{href:"#",class:"card-link",onClick:t.withModifiers(t=>s.openLink(e.url),["prevent"])},[t.createElementVNode("div",tt,[t.createElementVNode("div",{class:"icon-container",style:t.normalizeStyle(s.getIconStyle)},[t.createElementVNode("img",{src:e.logo,alt:e.title+" logo",class:t.normalizeClass({small:n.small}),onError:t=>s.onImageError(t,e.title)},null,42,ot)],4),t.createTextVNode(" "+t.toDisplayString(e.title),1)])],8,et)],2))),128)),s.currentBookmarks.length<8?(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(["card",n.small?"small":""])},[t.createElementVNode("a",{href:"#",class:"card-link",onClick:o[0]||(o[0]=t.withModifiers((...e)=>s.addBookmarkPrompt&&s.addBookmarkPrompt(...e),["prevent"]))},o[1]||(o[1]=[t.createElementVNode("div",{class:"column"},[t.createElementVNode("span",{class:"add"},"+"),t.createTextVNode(" Add ")],-1)]))],2)):t.createCommentVNode("",!0)])])}],["__scopeId","data-v-48fb9a13"]]),rt=t.defineCustomElement(g),it=t.defineCustomElement(Me),st=t.defineCustomElement(Ze),lt=t.defineCustomElement(nt);customElements.get("z-clock-widget")||customElements.define("z-clock-widget",rt),customElements.get("z-search-widget")||customElements.define("z-search-widget",it),customElements.get("z-todo-widget")||customElements.define("z-todo-widget",st),customElements.get("z-marked-widget")||customElements.define("z-marked-widget",lt),e.ZClockWidget=g,e.ZMarkedWidget=nt,e.ZSearchWidget=Me,e.ZTodoWidget=Ze,Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zen-wdg",
3
- "version": "2.2.0",
3
+ "version": "2.2.2",
4
4
  "description": "Minimal widget library for Gridstack-based newtab extensions",
5
5
  "main": "dist/zen-wdg.umd.js",
6
6
  "module": "dist/zen-wdg.es.js",
package/src/index.js CHANGED
@@ -24,7 +24,7 @@ if (!customElements.get('z-todo-widget')) {
24
24
  }
25
25
 
26
26
  if (!customElements.get('z-marked-widget')) {
27
- customElements.define('z-search-widget', ZMarkedElement)
27
+ customElements.define('z-marked-widget', ZMarkedElement)
28
28
  }
29
29
 
30
30
  // Exportar el componente para uso tradicional Vue
@@ -4,7 +4,7 @@
4
4
  <div v-for="tab in categories" :key="tab" class="container-tab">
5
5
  <button
6
6
  class="tab"
7
- :class="{ active: tab === state.activeTab }"
7
+ :class="{ active: tab === activeTab }"
8
8
  @click="setActiveTab(tab)"
9
9
  >
10
10
  {{ tab }}
@@ -26,8 +26,7 @@
26
26
  <div class="column">
27
27
  <div
28
28
  class="icon-container"
29
- :style="iconContainerStyle"
30
- ref="iconContainers"
29
+ :style="getIconStyle"
31
30
  >
32
31
  <img
33
32
  :src="item.logo"
@@ -41,6 +40,7 @@
41
40
  </a>
42
41
  </div>
43
42
 
43
+ <!-- Add Button -->
44
44
  <div v-if="currentBookmarks.length < 8" :class="['card', small ? 'small' : '']">
45
45
  <a href="#" class="card-link" @click.prevent="addBookmarkPrompt">
46
46
  <div class="column">
@@ -53,133 +53,146 @@
53
53
  </div>
54
54
  </template>
55
55
 
56
- <script setup>
57
- import { reactive, ref, watch, onMounted } from 'vue';
58
-
59
- // Opciones (podrían venir como props)
60
- const props = defineProps({
61
- theme: { type: String, default: 'light' },
62
- small: { type: Boolean, default: false },
63
- categories: { type: Array, default: () => ['Personal', 'Work', 'Study'] },
64
- open: { type: String, default: 'self' },
65
- useStorage: { type: Boolean, default: false }
66
- });
67
-
68
- const STORAGE_KEY = 'bookmark_manager_state';
69
-
70
- const defaultBookmarks = {
71
- Personal: [
72
- { title: 'Reddit', url: 'https://reddit.com', logo: 'https://www.google.com/s2/favicons?domain=reddit.com&sz=64' },
73
- { title: 'Spotify', url: 'https://spotify.com', logo: 'https://www.google.com/s2/favicons?domain=spotify.com&sz=64' },
74
- { title: 'Youtube', url: 'https://youtube.com', logo: 'https://www.google.com/s2/favicons?domain=youtube.com&sz=64' },
75
- { title: 'Instagram', url: 'https://instagram.com', logo: 'https://www.google.com/s2/favicons?domain=instagram.com&sz=64' },
76
- { title: 'Facebook', url: 'https://facebook.com', logo: 'https://www.google.com/s2/favicons?domain=facebook.com&sz=64' },
77
- { title: 'WhatsApp', url: 'https://whatsapp.com', logo: 'https://www.google.com/s2/favicons?domain=whatsapp.com&sz=64' },
78
- { title: 'Telegram', url: 'https://web.telegram.org/', logo: 'https://www.google.com/s2/favicons?domain=web.telegram.org&sz=64' },
79
- { title: 'Spotify', url: 'https://spotify.com', logo: 'https://www.google.com/s2/favicons?domain=spotify.com&sz=64' }
80
- ],
81
- Work: [
82
- { title: 'GitHub', url: 'https://github.com', logo: 'https://www.google.com/s2/favicons?domain=github.com&sz=64' },
83
- { title: 'Notion', url: 'https://notion.so', logo: 'https://www.google.com/s2/favicons?domain=notion.so&sz=64' }
84
- ],
85
- Study: [
86
- { title: 'MDN Web Docs', url: 'https://developer.mozilla.org', logo: 'https://www.google.com/s2/favicons?domain=mozilla.org&sz=64' },
87
- { title: 'FreeCodeCamp', url: 'https://freecodecamp.org', logo: 'https://www.google.com/s2/favicons?domain=freecodecamp.org&sz=64' }
88
- ]
89
- };
90
-
91
- const state = reactive({
92
- bookmarks: props.useStorage
93
- ? JSON.parse(localStorage.getItem(STORAGE_KEY)) || defaultBookmarks
94
- : defaultBookmarks,
95
- activeTab: 'Personal'
96
- });
97
-
98
- const categories = ref([...props.categories]);
99
- const small = ref(props.small);
100
- const theme = ref(props.theme);
101
- const open = ref(props.open);
102
- const useStorage = ref(props.useStorage);
103
-
104
- const currentBookmarks = computed(() => state.bookmarks[state.activeTab] || []);
105
-
106
- function saveState() {
107
- if (useStorage.value) {
108
- localStorage.setItem(STORAGE_KEY, JSON.stringify(state.bookmarks));
109
- }
110
- }
111
-
112
- function setActiveTab(tab) {
113
- state.activeTab = tab;
114
- }
115
-
116
- function openLink(url) {
117
- if (open.value === 'self') {
118
- window.location.href = url;
119
- } else {
120
- window.open(url, '_blank');
121
- }
122
- }
123
-
124
- async function deleteBookmark(index) {
125
- if (confirm(`¿Estás seguro de eliminar ${state.bookmarks[state.activeTab][index].title}?`)) {
126
- state.bookmarks[state.activeTab].splice(index, 1);
127
- saveState();
128
- }
129
- }
130
-
131
- async function editBookmark(index) {
132
- const item = state.bookmarks[state.activeTab][index];
133
- const newTitle = prompt('Nuevo título:', item.title);
134
- if (newTitle === null) return;
135
- const newUrl = prompt('Nueva URL:', item.url);
136
- if (newUrl === null) return;
137
- item.title = newTitle;
138
- item.url = newUrl;
139
- item.logo = `https://www.google.com/s2/favicons?domain=${new URL(newUrl).hostname}&sz=64`;
140
- saveState();
141
- }
142
-
143
- function addBookmarkPrompt() {
144
- const title = prompt('Nombre del marcador:');
145
- if (!title) return;
146
- const url = prompt('URL del marcador:');
147
- if (!url) return;
148
- const logo = `https://www.google.com/s2/favicons?domain=${new URL(url).hostname}&sz=64`;
149
- if (!state.bookmarks[state.activeTab]) {
150
- state.bookmarks[state.activeTab] = [];
56
+ <script>
57
+ export default {
58
+ name: 'ZMarkedWidget',
59
+ props: {
60
+ theme: {
61
+ type: String,
62
+ default: 'light'
63
+ },
64
+ small: {
65
+ type: Boolean,
66
+ default: false
67
+ },
68
+ categories: {
69
+ type: Array,
70
+ default: () => ['Personal', 'Work', 'Study']
71
+ },
72
+ open: {
73
+ type: String,
74
+ default: 'self'
75
+ },
76
+ useStorage: {
77
+ type: Boolean,
78
+ default: false
79
+ }
80
+ },
81
+ data() {
82
+ const STORAGE_KEY = 'bookmark_manager_state';
83
+
84
+ const defaultBookmarks = {
85
+ Personal: [
86
+ { title: 'Reddit', url: 'https://reddit.com', logo: 'https://www.google.com/s2/favicons?domain=reddit.com&sz=64' },
87
+ { title: 'Spotify', url: 'https://spotify.com', logo: 'https://www.google.com/s2/favicons?domain=spotify.com&sz=64' },
88
+ { title: 'Youtube', url: 'https://youtube.com', logo: 'https://www.google.com/s2/favicons?domain=youtube.com&sz=64' },
89
+ { title: 'Instagram', url: 'https://instagram.com', logo: 'https://www.google.com/s2/favicons?domain=instagram.com&sz=64' },
90
+ { title: 'Facebook', url: 'https://facebook.com', logo: 'https://www.google.com/s2/favicons?domain=facebook.com&sz=64' },
91
+ { title: 'WhatsApp', url: 'https://whatsapp.com', logo: 'https://www.google.com/s2/favicons?domain=whatsapp.com&sz=64' },
92
+ { title: 'Telegram', url: 'https://web.telegram.org/', logo: 'https://www.google.com/s2/favicons?domain=web.telegram.org&sz=64' },
93
+ { title: 'Spotify', url: 'https://spotify.com', logo: 'https://www.google.com/s2/favicons?domain=spotify.com&sz=64' }
94
+ ],
95
+ Work: [
96
+ { title: 'GitHub', url: 'https://github.com', logo: 'https://www.google.com/s2/favicons?domain=github.com&sz=64' },
97
+ { title: 'Notion', url: 'https://notion.so', logo: 'https://www.google.com/s2/favicons?domain=notion.so&sz=64' }
98
+ ],
99
+ Study: [
100
+ { title: 'MDN Web Docs', url: 'https://developer.mozilla.org', logo: 'https://www.google.com/s2/favicons?domain=mozilla.org&sz=64' },
101
+ { title: 'FreeCodeCamp', url: 'https://freecodecamp.org', logo: 'https://www.google.com/s2/favicons?domain=freecodecamp.org&sz=64' }
102
+ ]
103
+ };
104
+
105
+ const bookmarks = this.useStorage
106
+ ? JSON.parse(localStorage.getItem(STORAGE_KEY)) || defaultBookmarks
107
+ : defaultBookmarks;
108
+
109
+ return {
110
+ STORAGE_KEY,
111
+ bookmarks,
112
+ activeTab: 'Personal'
113
+ };
114
+ },
115
+ computed: {
116
+ currentBookmarks() {
117
+ return this.bookmarks[this.activeTab] || [];
118
+ },
119
+ getIconStyle() {
120
+ return {
121
+ position: 'relative',
122
+ width: this.small ? '50px' : '40px',
123
+ height: this.small ? '50px' : '40px',
124
+ marginBottom: '8px',
125
+ borderRadius: '.4rem',
126
+ display: 'flex',
127
+ alignItems: 'center',
128
+ justifyContent: 'center',
129
+ fontWeight: 'bold',
130
+ fontSize: '1.8rem',
131
+ color: this.theme === 'light' ? '#555' : '#eee',
132
+ userSelect: 'none'
133
+ };
134
+ }
135
+ },
136
+ methods: {
137
+ saveState() {
138
+ if (this.useStorage) {
139
+ localStorage.setItem(this.STORAGE_KEY, JSON.stringify(this.bookmarks));
140
+ }
141
+ },
142
+ setActiveTab(tab) {
143
+ this.activeTab = tab;
144
+ },
145
+ openLink(url) {
146
+ if (this.open === 'self') {
147
+ window.location.href = url;
148
+ } else {
149
+ window.open(url, '_blank');
150
+ }
151
+ },
152
+ deleteBookmark(index) {
153
+ const item = this.bookmarks[this.activeTab][index];
154
+ if (confirm(`¿Estás seguro de eliminar ${item.title}?`)) {
155
+ this.bookmarks[this.activeTab].splice(index, 1);
156
+ this.saveState();
157
+ }
158
+ },
159
+ editBookmark(index) {
160
+ const item = this.bookmarks[this.activeTab][index];
161
+ const newTitle = prompt('Nuevo título:', item.title);
162
+ if (newTitle === null) return;
163
+ const newUrl = prompt('Nueva URL:', item.url);
164
+ if (newUrl === null) return;
165
+ item.title = newTitle;
166
+ item.url = newUrl;
167
+ item.logo = `https://www.google.com/s2/favicons?domain=${new URL(newUrl).hostname}&sz=64`;
168
+ this.saveState();
169
+ },
170
+ addBookmarkPrompt() {
171
+ const title = prompt('Nombre del marcador:');
172
+ if (!title) return;
173
+ const url = prompt('URL del marcador:');
174
+ if (!url) return;
175
+ const logo = `https://www.google.com/s2/favicons?domain=${new URL(url).hostname}&sz=64`;
176
+ this.bookmarks[this.activeTab].push({ title, url, logo });
177
+ this.saveState();
178
+ },
179
+ onImageError(event, title) {
180
+ const img = event.target;
181
+ img.style.display = 'none';
182
+ const iconContainer = img.parentNode;
183
+ iconContainer.style.backgroundColor = '#066D5A';
184
+ iconContainer.textContent = title.charAt(0).toUpperCase();
185
+ }
186
+ },
187
+ watch: {
188
+ bookmarks: {
189
+ handler() {
190
+ this.saveState();
191
+ },
192
+ deep: true
193
+ }
151
194
  }
152
- state.bookmarks[state.activeTab].push({ title, url, logo });
153
- saveState();
154
- }
155
-
156
- function onImageError(event, title) {
157
- const img = event.target;
158
- img.style.display = 'none';
159
- const iconContainer = img.parentNode;
160
- iconContainer.style.backgroundColor = '#066D5A';
161
- iconContainer.textContent = title.charAt(0).toUpperCase();
162
- }
163
-
164
- // Estilos dinámicos en JS para iconContainer, podrían pasarse como clase también
165
- const iconContainerStyle = computed(() => ({
166
- position: 'relative',
167
- width: small.value ? '50px' : '40px',
168
- height: small.value ? '50px' : '40px',
169
- marginBottom: '8px',
170
- borderRadius: '.4rem',
171
- display: 'flex',
172
- alignItems: 'center',
173
- justifyContent: 'center',
174
- fontWeight: 'bold',
175
- fontSize: '1.8rem',
176
- color: theme.value === 'light' ? '#555' : '#eee',
177
- userSelect: 'none'
178
- }));
179
-
180
- // Guardar en localStorage si cambia bookmarks
181
- watch(() => state.bookmarks, () => saveState(), { deep: true });
182
-
195
+ };
183
196
  </script>
184
197
 
185
198
  <style scoped>
@@ -307,4 +320,4 @@ watch(() => state.bookmarks, () => saveState(), { deep: true });
307
320
  color: white;
308
321
  user-select: none;
309
322
  }
310
- </style>
323
+ </style>
@@ -36,7 +36,7 @@
36
36
 
37
37
  <script>
38
38
  export default {
39
- name: 'TodoWidget',
39
+ name: 'ZTodoWidget',
40
40
  data() {
41
41
  return {
42
42
  newTask: '',