pubuilder 0.4.0 → 0.5.0

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.
package/dist/index.js CHANGED
@@ -1,29 +1,31 @@
1
1
  "use client";
2
- import { jsxs as u, jsx as n, Fragment as te } from "react/jsx-runtime";
3
- import { createContext as ce, memo as ie, useRef as $, useState as _, useEffect as I, useMemo as G, useContext as oe, useLayoutEffect as se } from "react";
4
- import { createPortal as de } from "react-dom";
2
+ import { jsxs as d, jsx as n, Fragment as ee } from "react/jsx-runtime";
3
+ import { createContext as ae, memo as ce, useRef as D, useState as _, useEffect as R, useMemo as V, useContext as te, useLayoutEffect as ie } from "react";
4
+ import { createPortal as se } from "react-dom";
5
+ import { normalizeIA as de } from "./config.js";
6
+ import { defineIA as Xe } from "./config.js";
5
7
  import { create as ue } from "zustand";
6
8
  import { Handle as J, Position as j, ReactFlow as pe } from "@xyflow/react";
7
9
  const be = "http://localhost:4816";
8
- class re extends Error {
9
- constructor(t, o) {
10
- super(t), this.code = o, this.name = "ApiError";
10
+ class oe extends Error {
11
+ constructor(t, r) {
12
+ super(t), this.code = r, this.name = "ApiError";
11
13
  }
12
14
  }
13
- class ne {
15
+ class re {
14
16
  constructor(t = be) {
15
17
  this.baseUrl = t;
16
18
  }
17
- async request(t, o) {
18
- const r = await fetch(`${this.baseUrl}${t}`, {
19
- ...o,
20
- headers: { "content-type": "application/json", ...o?.headers }
19
+ async request(t, r) {
20
+ const o = await fetch(`${this.baseUrl}${t}`, {
21
+ ...r,
22
+ headers: { "content-type": "application/json", ...r?.headers }
21
23
  });
22
- if (!r.ok) {
23
- const a = await r.json().catch(() => ({}));
24
- throw new re(a.message ?? `요청 실패 (${r.status})`, a.code);
24
+ if (!o.ok) {
25
+ const l = await o.json().catch(() => ({}));
26
+ throw new oe(l.message ?? `요청 실패 (${o.status})`, l.code);
25
27
  }
26
- return r.status === 204 ? void 0 : await r.json();
28
+ return o.status === 204 ? void 0 : await o.json();
27
29
  }
28
30
  async isAlive() {
29
31
  try {
@@ -35,11 +37,11 @@ class ne {
35
37
  listSkills() {
36
38
  return this.request("/api/skills");
37
39
  }
38
- toggleSkill(t, o) {
39
- return this.request(`/api/skills/${encodeURIComponent(t)}`, { method: "PATCH", body: JSON.stringify({ enabled: o }) });
40
+ toggleSkill(t, r) {
41
+ return this.request(`/api/skills/${encodeURIComponent(t)}`, { method: "PATCH", body: JSON.stringify({ enabled: r }) });
40
42
  }
41
- uploadSkill(t, o) {
42
- return this.request("/api/skills", { method: "POST", body: JSON.stringify({ filename: t, content: o }) });
43
+ uploadSkill(t, r) {
44
+ return this.request("/api/skills", { method: "POST", body: JSON.stringify({ filename: t, content: r }) });
43
45
  }
44
46
  removeSkill(t) {
45
47
  return this.request(`/api/skills/${encodeURIComponent(t)}`, { method: "DELETE" });
@@ -60,72 +62,19 @@ class ne {
60
62
  return this.request(`/api/publish/${t}`, { method: "DELETE" });
61
63
  }
62
64
  /** SSE 구독 — 반환값 호출로 해제 */
63
- subscribePublish(t, o) {
64
- const r = new EventSource(`${this.baseUrl}/api/publish/${t}/events`);
65
- let a = !1;
66
- return r.onmessage = (c) => {
67
- const i = JSON.parse(c.data);
68
- (i.type === "done" || i.type === "error") && (a = !0), o(i);
69
- }, r.onerror = () => {
70
- r.close(), a || (a = !0, o({ type: "error", text: "서버 연결이 끊겼어요. pubuilder serve 상태를 확인해주세요" }));
71
- }, () => r.close();
65
+ subscribePublish(t, r) {
66
+ const o = new EventSource(`${this.baseUrl}/api/publish/${t}/events`);
67
+ let l = !1;
68
+ return o.onmessage = (a) => {
69
+ const i = JSON.parse(a.data);
70
+ (i.type === "done" || i.type === "error") && (l = !0), r(i);
71
+ }, o.onerror = () => {
72
+ o.close(), l || (l = !0, r({ type: "error", text: "서버 연결이 끊겼어요. pubuilder serve 상태를 확인해주세요" }));
73
+ }, () => o.close();
72
74
  }
73
75
  }
74
- const Y = ce(new ne());
75
- function Je(e) {
76
- return e;
77
- }
78
- const fe = { width: 1440, height: 900 };
79
- function X(e, t, o) {
80
- o != null && e.append(t, String(o));
81
- }
82
- function he(e, t) {
83
- const o = e.indexOf("#"), r = o >= 0 ? e.slice(o) : "", a = o >= 0 ? e.slice(0, o) : e, c = a.indexOf("?"), i = c >= 0 ? a.slice(0, c) : a, l = new URLSearchParams(c >= 0 ? a.slice(c + 1) : "");
84
- for (const [s, x] of Object.entries(t.query))
85
- if (l.delete(s), Array.isArray(x))
86
- for (const f of x) X(l, s, f);
87
- else
88
- X(l, s, x);
89
- const p = l.toString();
90
- return `${i}${p ? `?${p}` : ""}${r}`;
91
- }
92
- function ge(e) {
93
- const t = [], o = /* @__PURE__ */ new Set(), r = (a, c, i) => {
94
- for (const l of a) {
95
- if (!l.path) throw new Error("[pubuilder] page.path는 필수입니다");
96
- if (!l.title) throw new Error(`[pubuilder] "${l.path}"의 title이 없습니다`);
97
- if (o.has(l.path)) throw new Error(`[pubuilder] 중복 path: ${l.path}`);
98
- if (o.add(l.path), t.push({
99
- id: l.path,
100
- path: l.path,
101
- title: l.title,
102
- external: l.external ?? /^https?:\/\//.test(l.path),
103
- parentId: c,
104
- depth: i
105
- }), l.variants?.length) {
106
- if (l.external ?? /^https?:\/\//.test(l.path))
107
- throw new Error(`[pubuilder] 외부 페이지에는 variants를 사용할 수 없습니다: ${l.path}`);
108
- for (const p of l.variants) {
109
- if (!p.title) throw new Error(`[pubuilder] "${l.path}" variant의 title이 없습니다`);
110
- const s = he(l.path, p);
111
- if (o.has(s)) throw new Error(`[pubuilder] 중복 path: ${s}`);
112
- o.add(s), t.push({
113
- id: s,
114
- path: s,
115
- title: p.title,
116
- external: !1,
117
- parentId: l.path,
118
- depth: i + 1
119
- });
120
- }
121
- }
122
- l.children?.length && r(l.children, l.path, i + 1);
123
- }
124
- };
125
- if (r(e.pages, null, 0), t.length === 0) throw new Error("[pubuilder] pages가 비어 있습니다");
126
- return { nodes: t, viewport: e.viewport ?? fe };
127
- }
128
- function xe() {
76
+ const Y = ae(new re());
77
+ function fe() {
129
78
  return typeof process < "u" && process.env.NODE_ENV === "production";
130
79
  }
131
80
  const y = ue((e) => ({
@@ -142,9 +91,9 @@ const y = ue((e) => ({
142
91
  closeViewer: () => e({ viewerPath: null, selection: null, selectedOuterHTML: null }),
143
92
  setGranularity: (t) => e({ granularity: t }),
144
93
  setInspectEnabled: (t) => e({ inspectEnabled: t }),
145
- setSelectionWithHTML: (t, o) => e({ selection: t, selectedOuterHTML: o }),
94
+ setSelectionWithHTML: (t, r) => e({ selection: t, selectedOuterHTML: r }),
146
95
  toggleSkillDrawer: () => e((t) => ({ skillDrawerOpen: !t.skillDrawerOpen }))
147
- })), me = ".react-flow{direction:ltr;--xy-edge-stroke-default: #b1b1b7;--xy-edge-stroke-width-default: 1;--xy-edge-stroke-selected-default: #555;--xy-connectionline-stroke-default: #b1b1b7;--xy-connectionline-stroke-width-default: 1;--xy-attribution-background-color-default: rgba(255, 255, 255, .5);--xy-minimap-background-color-default: #fff;--xy-minimap-mask-background-color-default: rgba(240, 240, 240, .6);--xy-minimap-mask-stroke-color-default: transparent;--xy-minimap-mask-stroke-width-default: 1;--xy-minimap-node-background-color-default: #e2e2e2;--xy-minimap-node-stroke-color-default: transparent;--xy-minimap-node-stroke-width-default: 2;--xy-background-color-default: transparent;--xy-background-pattern-dots-color-default: #91919a;--xy-background-pattern-lines-color-default: #eee;--xy-background-pattern-cross-color-default: #e2e2e2;background-color:var(--xy-background-color, var(--xy-background-color-default));--xy-node-color-default: inherit;--xy-node-border-default: 1px solid #1a192b;--xy-node-background-color-default: #fff;--xy-node-group-background-color-default: rgba(240, 240, 240, .25);--xy-node-boxshadow-hover-default: 0 1px 4px 1px rgba(0, 0, 0, .08);--xy-node-boxshadow-selected-default: 0 0 0 .5px #1a192b;--xy-node-border-radius-default: 3px;--xy-handle-background-color-default: #1a192b;--xy-handle-border-color-default: #fff;--xy-selection-background-color-default: rgba(0, 89, 220, .08);--xy-selection-border-default: 1px dotted rgba(0, 89, 220, .8);--xy-controls-button-background-color-default: #fefefe;--xy-controls-button-background-color-hover-default: #f4f4f4;--xy-controls-button-color-default: inherit;--xy-controls-button-color-hover-default: inherit;--xy-controls-button-border-color-default: #eee;--xy-controls-box-shadow-default: 0 0 2px 1px rgba(0, 0, 0, .08);--xy-edge-label-background-color-default: #ffffff;--xy-edge-label-color-default: inherit;--xy-resize-background-color-default: #3367d9}.react-flow.dark{--xy-edge-stroke-default: #3e3e3e;--xy-edge-stroke-width-default: 1;--xy-edge-stroke-selected-default: #727272;--xy-connectionline-stroke-default: #b1b1b7;--xy-connectionline-stroke-width-default: 1;--xy-attribution-background-color-default: rgba(150, 150, 150, .25);--xy-minimap-background-color-default: #141414;--xy-minimap-mask-background-color-default: rgba(60, 60, 60, .6);--xy-minimap-mask-stroke-color-default: transparent;--xy-minimap-mask-stroke-width-default: 1;--xy-minimap-node-background-color-default: #2b2b2b;--xy-minimap-node-stroke-color-default: transparent;--xy-minimap-node-stroke-width-default: 2;--xy-background-color-default: #141414;--xy-background-pattern-dots-color-default: #555;--xy-background-pattern-lines-color-default: #333;--xy-background-pattern-cross-color-default: #333;--xy-node-color-default: #f8f8f8;--xy-node-border-default: 1px solid #3c3c3c;--xy-node-background-color-default: #1e1e1e;--xy-node-group-background-color-default: rgba(240, 240, 240, .25);--xy-node-boxshadow-hover-default: 0 1px 4px 1px rgba(255, 255, 255, .08);--xy-node-boxshadow-selected-default: 0 0 0 .5px #999;--xy-handle-background-color-default: #bebebe;--xy-handle-border-color-default: #1e1e1e;--xy-selection-background-color-default: rgba(200, 200, 220, .08);--xy-selection-border-default: 1px dotted rgba(200, 200, 220, .8);--xy-controls-button-background-color-default: #2b2b2b;--xy-controls-button-background-color-hover-default: #3e3e3e;--xy-controls-button-color-default: #f8f8f8;--xy-controls-button-color-hover-default: #fff;--xy-controls-button-border-color-default: #5b5b5b;--xy-controls-box-shadow-default: 0 0 2px 1px rgba(0, 0, 0, .08);--xy-edge-label-background-color-default: #141414;--xy-edge-label-color-default: #f8f8f8}.react-flow__background{background-color:var(--xy-background-color-props, var(--xy-background-color, var(--xy-background-color-default)));pointer-events:none;z-index:-1}.react-flow__container{position:absolute;width:100%;height:100%;top:0;left:0}.react-flow__pane{z-index:1;touch-action:none}.react-flow__pane.draggable{cursor:grab}.react-flow__pane.dragging{cursor:grabbing}.react-flow__pane.selection{cursor:pointer}.react-flow__viewport{transform-origin:0 0;z-index:2;pointer-events:none}.react-flow__renderer{z-index:4}.react-flow__selection{z-index:6}.react-flow__nodesselection-rect:focus,.react-flow__nodesselection-rect:focus-visible{outline:none}.react-flow__edge-path{stroke:var(--xy-edge-stroke, var(--xy-edge-stroke-default));stroke-width:var(--xy-edge-stroke-width, var(--xy-edge-stroke-width-default));fill:none}.react-flow__connection-path{stroke:var(--xy-connectionline-stroke, var(--xy-connectionline-stroke-default));stroke-width:var(--xy-connectionline-stroke-width, var(--xy-connectionline-stroke-width-default));fill:none}.react-flow .react-flow__edges{position:absolute}.react-flow .react-flow__edges svg{overflow:visible;position:absolute;pointer-events:none}.react-flow__edge{pointer-events:visibleStroke}.react-flow__edge.selectable{cursor:pointer}.react-flow__edge.animated path{stroke-dasharray:5;animation:dashdraw .5s linear infinite}.react-flow__edge.animated path.react-flow__edge-interaction{stroke-dasharray:none;animation:none}.react-flow__edge.inactive{pointer-events:none}.react-flow__edge.selected,.react-flow__edge:focus,.react-flow__edge:focus-visible{outline:none}.react-flow__edge.selected .react-flow__edge-path,.react-flow__edge.selectable:focus .react-flow__edge-path,.react-flow__edge.selectable:focus-visible .react-flow__edge-path{stroke:var(--xy-edge-stroke-selected, var(--xy-edge-stroke-selected-default))}.react-flow__edge-textwrapper{pointer-events:all}.react-flow__edge .react-flow__edge-text{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__arrowhead polyline{stroke:var(--xy-edge-stroke, var(--xy-edge-stroke-default))}.react-flow__arrowhead polyline.arrowclosed{fill:var(--xy-edge-stroke, var(--xy-edge-stroke-default))}.react-flow__connection{pointer-events:none}.react-flow__connection .animated{stroke-dasharray:5;animation:dashdraw .5s linear infinite}svg.react-flow__connectionline{z-index:1001;overflow:visible;position:absolute}.react-flow__nodes{pointer-events:none;transform-origin:0 0}.react-flow__node{position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:all;transform-origin:0 0;box-sizing:border-box;cursor:default}.react-flow__node.selectable{cursor:pointer}.react-flow__node.draggable{cursor:grab;pointer-events:all}.react-flow__node.draggable.dragging{cursor:grabbing}.react-flow__nodesselection{z-index:3;transform-origin:left top;pointer-events:none}.react-flow__nodesselection-rect{position:absolute;pointer-events:all;cursor:grab}.react-flow__handle{position:absolute;pointer-events:none;min-width:5px;min-height:5px;width:6px;height:6px;background-color:var(--xy-handle-background-color, var(--xy-handle-background-color-default));border:1px solid var(--xy-handle-border-color, var(--xy-handle-border-color-default));border-radius:100%}.react-flow__handle.connectingfrom{pointer-events:all}.react-flow__handle.connectionindicator{pointer-events:all;cursor:crosshair}.react-flow__handle-bottom{top:auto;left:50%;bottom:0;transform:translate(-50%,50%)}.react-flow__handle-top{top:0;left:50%;transform:translate(-50%,-50%)}.react-flow__handle-left{top:50%;left:0;transform:translate(-50%,-50%)}.react-flow__handle-right{top:50%;right:0;transform:translate(50%,-50%)}.react-flow__edgeupdater{cursor:move;pointer-events:all}.react-flow__pane.selection .react-flow__panel{pointer-events:none}.react-flow__panel{position:absolute;z-index:5;margin:15px}.react-flow__panel.top{top:0}.react-flow__panel.bottom{bottom:0}.react-flow__panel.top.center,.react-flow__panel.bottom.center{left:50%;transform:translate(-15px) translate(-50%)}.react-flow__panel.left{left:0}.react-flow__panel.right{right:0}.react-flow__panel.left.center,.react-flow__panel.right.center{top:50%;transform:translateY(-15px) translateY(-50%)}.react-flow__attribution{font-size:10px;background:var(--xy-attribution-background-color, var(--xy-attribution-background-color-default));padding:2px 3px;margin:0}.react-flow__attribution a{text-decoration:none;color:#999}@keyframes dashdraw{0%{stroke-dashoffset:10}}.react-flow__edgelabel-renderer{position:absolute;width:100%;height:100%;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;left:0;top:0}.react-flow__viewport-portal{position:absolute;width:100%;height:100%;left:0;top:0;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__minimap{background:var( --xy-minimap-background-color-props, var(--xy-minimap-background-color, var(--xy-minimap-background-color-default)) )}.react-flow__minimap-svg{display:block}.react-flow__minimap-mask{fill:var( --xy-minimap-mask-background-color-props, var(--xy-minimap-mask-background-color, var(--xy-minimap-mask-background-color-default)) );stroke:var( --xy-minimap-mask-stroke-color-props, var(--xy-minimap-mask-stroke-color, var(--xy-minimap-mask-stroke-color-default)) );stroke-width:var( --xy-minimap-mask-stroke-width-props, var(--xy-minimap-mask-stroke-width, var(--xy-minimap-mask-stroke-width-default)) )}.react-flow__minimap-node{fill:var( --xy-minimap-node-background-color-props, var(--xy-minimap-node-background-color, var(--xy-minimap-node-background-color-default)) );stroke:var( --xy-minimap-node-stroke-color-props, var(--xy-minimap-node-stroke-color, var(--xy-minimap-node-stroke-color-default)) );stroke-width:var( --xy-minimap-node-stroke-width-props, var(--xy-minimap-node-stroke-width, var(--xy-minimap-node-stroke-width-default)) )}.react-flow__background-pattern.dots{fill:var( --xy-background-pattern-color-props, var(--xy-background-pattern-color, var(--xy-background-pattern-dots-color-default)) )}.react-flow__background-pattern.lines{stroke:var( --xy-background-pattern-color-props, var(--xy-background-pattern-color, var(--xy-background-pattern-lines-color-default)) )}.react-flow__background-pattern.cross{stroke:var( --xy-background-pattern-color-props, var(--xy-background-pattern-color, var(--xy-background-pattern-cross-color-default)) )}.react-flow__controls{display:flex;flex-direction:column;box-shadow:var(--xy-controls-box-shadow, var(--xy-controls-box-shadow-default))}.react-flow__controls.horizontal{flex-direction:row}.react-flow__controls-button{display:flex;justify-content:center;align-items:center;height:26px;width:26px;padding:4px;border:none;background:var(--xy-controls-button-background-color, var(--xy-controls-button-background-color-default));border-bottom:1px solid var( --xy-controls-button-border-color-props, var(--xy-controls-button-border-color, var(--xy-controls-button-border-color-default)) );color:var( --xy-controls-button-color-props, var(--xy-controls-button-color, var(--xy-controls-button-color-default)) );cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__controls-button svg{width:100%;max-width:12px;max-height:12px;fill:currentColor}.react-flow__edge.updating .react-flow__edge-path{stroke:#777}.react-flow__edge-text{font-size:10px}.react-flow__node.selectable:focus,.react-flow__node.selectable:focus-visible{outline:none}.react-flow__node-input,.react-flow__node-default,.react-flow__node-output,.react-flow__node-group{padding:10px;border-radius:var(--xy-node-border-radius, var(--xy-node-border-radius-default));width:150px;font-size:12px;color:var(--xy-node-color, var(--xy-node-color-default));text-align:center;border:var(--xy-node-border, var(--xy-node-border-default));background-color:var(--xy-node-background-color, var(--xy-node-background-color-default))}.react-flow__node-input.selectable:hover,.react-flow__node-default.selectable:hover,.react-flow__node-output.selectable:hover,.react-flow__node-group.selectable:hover{box-shadow:var(--xy-node-boxshadow-hover, var(--xy-node-boxshadow-hover-default))}.react-flow__node-input.selectable.selected,.react-flow__node-input.selectable:focus,.react-flow__node-input.selectable:focus-visible,.react-flow__node-default.selectable.selected,.react-flow__node-default.selectable:focus,.react-flow__node-default.selectable:focus-visible,.react-flow__node-output.selectable.selected,.react-flow__node-output.selectable:focus,.react-flow__node-output.selectable:focus-visible,.react-flow__node-group.selectable.selected,.react-flow__node-group.selectable:focus,.react-flow__node-group.selectable:focus-visible{box-shadow:var(--xy-node-boxshadow-selected, var(--xy-node-boxshadow-selected-default))}.react-flow__node-group{background-color:var(--xy-node-group-background-color, var(--xy-node-group-background-color-default))}.react-flow__nodesselection-rect,.react-flow__selection{background:var(--xy-selection-background-color, var(--xy-selection-background-color-default));border:var(--xy-selection-border, var(--xy-selection-border-default))}.react-flow__nodesselection-rect:focus,.react-flow__nodesselection-rect:focus-visible,.react-flow__selection:focus,.react-flow__selection:focus-visible{outline:none}.react-flow__controls-button:hover{background:var( --xy-controls-button-background-color-hover-props, var(--xy-controls-button-background-color-hover, var(--xy-controls-button-background-color-hover-default)) );color:var( --xy-controls-button-color-hover-props, var(--xy-controls-button-color-hover, var(--xy-controls-button-color-hover-default)) )}.react-flow__controls-button:disabled{pointer-events:none}.react-flow__controls-button:disabled svg{fill-opacity:.4}.react-flow__controls-button:last-child{border-bottom:none}.react-flow__controls.horizontal .react-flow__controls-button{border-bottom:none;border-right:1px solid var( --xy-controls-button-border-color-props, var(--xy-controls-button-border-color, var(--xy-controls-button-border-color-default)) )}.react-flow__controls.horizontal .react-flow__controls-button:last-child{border-right:none}.react-flow__resize-control{position:absolute}.react-flow__resize-control.left,.react-flow__resize-control.right{cursor:ew-resize}.react-flow__resize-control.top,.react-flow__resize-control.bottom{cursor:ns-resize}.react-flow__resize-control.top.left,.react-flow__resize-control.bottom.right{cursor:nwse-resize}.react-flow__resize-control.bottom.left,.react-flow__resize-control.top.right{cursor:nesw-resize}.react-flow__resize-control.handle{width:5px;height:5px;border:1px solid #fff;border-radius:1px;background-color:var(--xy-resize-background-color, var(--xy-resize-background-color-default));translate:-50% -50%}.react-flow__resize-control.handle.left{left:0;top:50%}.react-flow__resize-control.handle.right{left:100%;top:50%}.react-flow__resize-control.handle.top{left:50%;top:0}.react-flow__resize-control.handle.bottom{left:50%;top:100%}.react-flow__resize-control.handle.top.left,.react-flow__resize-control.handle.bottom.left{left:0}.react-flow__resize-control.handle.top.right,.react-flow__resize-control.handle.bottom.right{left:100%}.react-flow__resize-control.line{border-color:var(--xy-resize-background-color, var(--xy-resize-background-color-default));border-width:0;border-style:solid}.react-flow__resize-control.line.left,.react-flow__resize-control.line.right{width:1px;transform:translate(-50%);top:0;height:100%}.react-flow__resize-control.line.left{left:0;border-left-width:1px}.react-flow__resize-control.line.right{left:100%;border-right-width:1px}.react-flow__resize-control.line.top,.react-flow__resize-control.line.bottom{height:1px;transform:translateY(-50%);left:0;width:100%}.react-flow__resize-control.line.top{top:0;border-top-width:1px}.react-flow__resize-control.line.bottom{border-bottom-width:1px;top:100%}.react-flow__edge-textbg{fill:var(--xy-edge-label-background-color, var(--xy-edge-label-background-color-default))}.react-flow__edge-text{fill:var(--xy-edge-label-color, var(--xy-edge-label-color-default))}", we = "pubuilder-styles", ye = "pubuilder-xyflow-styles", ve = (
96
+ })), ge = ".react-flow{direction:ltr;--xy-edge-stroke-default: #b1b1b7;--xy-edge-stroke-width-default: 1;--xy-edge-stroke-selected-default: #555;--xy-connectionline-stroke-default: #b1b1b7;--xy-connectionline-stroke-width-default: 1;--xy-attribution-background-color-default: rgba(255, 255, 255, .5);--xy-minimap-background-color-default: #fff;--xy-minimap-mask-background-color-default: rgba(240, 240, 240, .6);--xy-minimap-mask-stroke-color-default: transparent;--xy-minimap-mask-stroke-width-default: 1;--xy-minimap-node-background-color-default: #e2e2e2;--xy-minimap-node-stroke-color-default: transparent;--xy-minimap-node-stroke-width-default: 2;--xy-background-color-default: transparent;--xy-background-pattern-dots-color-default: #91919a;--xy-background-pattern-lines-color-default: #eee;--xy-background-pattern-cross-color-default: #e2e2e2;background-color:var(--xy-background-color, var(--xy-background-color-default));--xy-node-color-default: inherit;--xy-node-border-default: 1px solid #1a192b;--xy-node-background-color-default: #fff;--xy-node-group-background-color-default: rgba(240, 240, 240, .25);--xy-node-boxshadow-hover-default: 0 1px 4px 1px rgba(0, 0, 0, .08);--xy-node-boxshadow-selected-default: 0 0 0 .5px #1a192b;--xy-node-border-radius-default: 3px;--xy-handle-background-color-default: #1a192b;--xy-handle-border-color-default: #fff;--xy-selection-background-color-default: rgba(0, 89, 220, .08);--xy-selection-border-default: 1px dotted rgba(0, 89, 220, .8);--xy-controls-button-background-color-default: #fefefe;--xy-controls-button-background-color-hover-default: #f4f4f4;--xy-controls-button-color-default: inherit;--xy-controls-button-color-hover-default: inherit;--xy-controls-button-border-color-default: #eee;--xy-controls-box-shadow-default: 0 0 2px 1px rgba(0, 0, 0, .08);--xy-edge-label-background-color-default: #ffffff;--xy-edge-label-color-default: inherit;--xy-resize-background-color-default: #3367d9}.react-flow.dark{--xy-edge-stroke-default: #3e3e3e;--xy-edge-stroke-width-default: 1;--xy-edge-stroke-selected-default: #727272;--xy-connectionline-stroke-default: #b1b1b7;--xy-connectionline-stroke-width-default: 1;--xy-attribution-background-color-default: rgba(150, 150, 150, .25);--xy-minimap-background-color-default: #141414;--xy-minimap-mask-background-color-default: rgba(60, 60, 60, .6);--xy-minimap-mask-stroke-color-default: transparent;--xy-minimap-mask-stroke-width-default: 1;--xy-minimap-node-background-color-default: #2b2b2b;--xy-minimap-node-stroke-color-default: transparent;--xy-minimap-node-stroke-width-default: 2;--xy-background-color-default: #141414;--xy-background-pattern-dots-color-default: #555;--xy-background-pattern-lines-color-default: #333;--xy-background-pattern-cross-color-default: #333;--xy-node-color-default: #f8f8f8;--xy-node-border-default: 1px solid #3c3c3c;--xy-node-background-color-default: #1e1e1e;--xy-node-group-background-color-default: rgba(240, 240, 240, .25);--xy-node-boxshadow-hover-default: 0 1px 4px 1px rgba(255, 255, 255, .08);--xy-node-boxshadow-selected-default: 0 0 0 .5px #999;--xy-handle-background-color-default: #bebebe;--xy-handle-border-color-default: #1e1e1e;--xy-selection-background-color-default: rgba(200, 200, 220, .08);--xy-selection-border-default: 1px dotted rgba(200, 200, 220, .8);--xy-controls-button-background-color-default: #2b2b2b;--xy-controls-button-background-color-hover-default: #3e3e3e;--xy-controls-button-color-default: #f8f8f8;--xy-controls-button-color-hover-default: #fff;--xy-controls-button-border-color-default: #5b5b5b;--xy-controls-box-shadow-default: 0 0 2px 1px rgba(0, 0, 0, .08);--xy-edge-label-background-color-default: #141414;--xy-edge-label-color-default: #f8f8f8}.react-flow__background{background-color:var(--xy-background-color-props, var(--xy-background-color, var(--xy-background-color-default)));pointer-events:none;z-index:-1}.react-flow__container{position:absolute;width:100%;height:100%;top:0;left:0}.react-flow__pane{z-index:1;touch-action:none}.react-flow__pane.draggable{cursor:grab}.react-flow__pane.dragging{cursor:grabbing}.react-flow__pane.selection{cursor:pointer}.react-flow__viewport{transform-origin:0 0;z-index:2;pointer-events:none}.react-flow__renderer{z-index:4}.react-flow__selection{z-index:6}.react-flow__nodesselection-rect:focus,.react-flow__nodesselection-rect:focus-visible{outline:none}.react-flow__edge-path{stroke:var(--xy-edge-stroke, var(--xy-edge-stroke-default));stroke-width:var(--xy-edge-stroke-width, var(--xy-edge-stroke-width-default));fill:none}.react-flow__connection-path{stroke:var(--xy-connectionline-stroke, var(--xy-connectionline-stroke-default));stroke-width:var(--xy-connectionline-stroke-width, var(--xy-connectionline-stroke-width-default));fill:none}.react-flow .react-flow__edges{position:absolute}.react-flow .react-flow__edges svg{overflow:visible;position:absolute;pointer-events:none}.react-flow__edge{pointer-events:visibleStroke}.react-flow__edge.selectable{cursor:pointer}.react-flow__edge.animated path{stroke-dasharray:5;animation:dashdraw .5s linear infinite}.react-flow__edge.animated path.react-flow__edge-interaction{stroke-dasharray:none;animation:none}.react-flow__edge.inactive{pointer-events:none}.react-flow__edge.selected,.react-flow__edge:focus,.react-flow__edge:focus-visible{outline:none}.react-flow__edge.selected .react-flow__edge-path,.react-flow__edge.selectable:focus .react-flow__edge-path,.react-flow__edge.selectable:focus-visible .react-flow__edge-path{stroke:var(--xy-edge-stroke-selected, var(--xy-edge-stroke-selected-default))}.react-flow__edge-textwrapper{pointer-events:all}.react-flow__edge .react-flow__edge-text{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__arrowhead polyline{stroke:var(--xy-edge-stroke, var(--xy-edge-stroke-default))}.react-flow__arrowhead polyline.arrowclosed{fill:var(--xy-edge-stroke, var(--xy-edge-stroke-default))}.react-flow__connection{pointer-events:none}.react-flow__connection .animated{stroke-dasharray:5;animation:dashdraw .5s linear infinite}svg.react-flow__connectionline{z-index:1001;overflow:visible;position:absolute}.react-flow__nodes{pointer-events:none;transform-origin:0 0}.react-flow__node{position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none;pointer-events:all;transform-origin:0 0;box-sizing:border-box;cursor:default}.react-flow__node.selectable{cursor:pointer}.react-flow__node.draggable{cursor:grab;pointer-events:all}.react-flow__node.draggable.dragging{cursor:grabbing}.react-flow__nodesselection{z-index:3;transform-origin:left top;pointer-events:none}.react-flow__nodesselection-rect{position:absolute;pointer-events:all;cursor:grab}.react-flow__handle{position:absolute;pointer-events:none;min-width:5px;min-height:5px;width:6px;height:6px;background-color:var(--xy-handle-background-color, var(--xy-handle-background-color-default));border:1px solid var(--xy-handle-border-color, var(--xy-handle-border-color-default));border-radius:100%}.react-flow__handle.connectingfrom{pointer-events:all}.react-flow__handle.connectionindicator{pointer-events:all;cursor:crosshair}.react-flow__handle-bottom{top:auto;left:50%;bottom:0;transform:translate(-50%,50%)}.react-flow__handle-top{top:0;left:50%;transform:translate(-50%,-50%)}.react-flow__handle-left{top:50%;left:0;transform:translate(-50%,-50%)}.react-flow__handle-right{top:50%;right:0;transform:translate(50%,-50%)}.react-flow__edgeupdater{cursor:move;pointer-events:all}.react-flow__pane.selection .react-flow__panel{pointer-events:none}.react-flow__panel{position:absolute;z-index:5;margin:15px}.react-flow__panel.top{top:0}.react-flow__panel.bottom{bottom:0}.react-flow__panel.top.center,.react-flow__panel.bottom.center{left:50%;transform:translate(-15px) translate(-50%)}.react-flow__panel.left{left:0}.react-flow__panel.right{right:0}.react-flow__panel.left.center,.react-flow__panel.right.center{top:50%;transform:translateY(-15px) translateY(-50%)}.react-flow__attribution{font-size:10px;background:var(--xy-attribution-background-color, var(--xy-attribution-background-color-default));padding:2px 3px;margin:0}.react-flow__attribution a{text-decoration:none;color:#999}@keyframes dashdraw{0%{stroke-dashoffset:10}}.react-flow__edgelabel-renderer{position:absolute;width:100%;height:100%;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;left:0;top:0}.react-flow__viewport-portal{position:absolute;width:100%;height:100%;left:0;top:0;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__minimap{background:var( --xy-minimap-background-color-props, var(--xy-minimap-background-color, var(--xy-minimap-background-color-default)) )}.react-flow__minimap-svg{display:block}.react-flow__minimap-mask{fill:var( --xy-minimap-mask-background-color-props, var(--xy-minimap-mask-background-color, var(--xy-minimap-mask-background-color-default)) );stroke:var( --xy-minimap-mask-stroke-color-props, var(--xy-minimap-mask-stroke-color, var(--xy-minimap-mask-stroke-color-default)) );stroke-width:var( --xy-minimap-mask-stroke-width-props, var(--xy-minimap-mask-stroke-width, var(--xy-minimap-mask-stroke-width-default)) )}.react-flow__minimap-node{fill:var( --xy-minimap-node-background-color-props, var(--xy-minimap-node-background-color, var(--xy-minimap-node-background-color-default)) );stroke:var( --xy-minimap-node-stroke-color-props, var(--xy-minimap-node-stroke-color, var(--xy-minimap-node-stroke-color-default)) );stroke-width:var( --xy-minimap-node-stroke-width-props, var(--xy-minimap-node-stroke-width, var(--xy-minimap-node-stroke-width-default)) )}.react-flow__background-pattern.dots{fill:var( --xy-background-pattern-color-props, var(--xy-background-pattern-color, var(--xy-background-pattern-dots-color-default)) )}.react-flow__background-pattern.lines{stroke:var( --xy-background-pattern-color-props, var(--xy-background-pattern-color, var(--xy-background-pattern-lines-color-default)) )}.react-flow__background-pattern.cross{stroke:var( --xy-background-pattern-color-props, var(--xy-background-pattern-color, var(--xy-background-pattern-cross-color-default)) )}.react-flow__controls{display:flex;flex-direction:column;box-shadow:var(--xy-controls-box-shadow, var(--xy-controls-box-shadow-default))}.react-flow__controls.horizontal{flex-direction:row}.react-flow__controls-button{display:flex;justify-content:center;align-items:center;height:26px;width:26px;padding:4px;border:none;background:var(--xy-controls-button-background-color, var(--xy-controls-button-background-color-default));border-bottom:1px solid var( --xy-controls-button-border-color-props, var(--xy-controls-button-border-color, var(--xy-controls-button-border-color-default)) );color:var( --xy-controls-button-color-props, var(--xy-controls-button-color, var(--xy-controls-button-color-default)) );cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__controls-button svg{width:100%;max-width:12px;max-height:12px;fill:currentColor}.react-flow__edge.updating .react-flow__edge-path{stroke:#777}.react-flow__edge-text{font-size:10px}.react-flow__node.selectable:focus,.react-flow__node.selectable:focus-visible{outline:none}.react-flow__node-input,.react-flow__node-default,.react-flow__node-output,.react-flow__node-group{padding:10px;border-radius:var(--xy-node-border-radius, var(--xy-node-border-radius-default));width:150px;font-size:12px;color:var(--xy-node-color, var(--xy-node-color-default));text-align:center;border:var(--xy-node-border, var(--xy-node-border-default));background-color:var(--xy-node-background-color, var(--xy-node-background-color-default))}.react-flow__node-input.selectable:hover,.react-flow__node-default.selectable:hover,.react-flow__node-output.selectable:hover,.react-flow__node-group.selectable:hover{box-shadow:var(--xy-node-boxshadow-hover, var(--xy-node-boxshadow-hover-default))}.react-flow__node-input.selectable.selected,.react-flow__node-input.selectable:focus,.react-flow__node-input.selectable:focus-visible,.react-flow__node-default.selectable.selected,.react-flow__node-default.selectable:focus,.react-flow__node-default.selectable:focus-visible,.react-flow__node-output.selectable.selected,.react-flow__node-output.selectable:focus,.react-flow__node-output.selectable:focus-visible,.react-flow__node-group.selectable.selected,.react-flow__node-group.selectable:focus,.react-flow__node-group.selectable:focus-visible{box-shadow:var(--xy-node-boxshadow-selected, var(--xy-node-boxshadow-selected-default))}.react-flow__node-group{background-color:var(--xy-node-group-background-color, var(--xy-node-group-background-color-default))}.react-flow__nodesselection-rect,.react-flow__selection{background:var(--xy-selection-background-color, var(--xy-selection-background-color-default));border:var(--xy-selection-border, var(--xy-selection-border-default))}.react-flow__nodesselection-rect:focus,.react-flow__nodesselection-rect:focus-visible,.react-flow__selection:focus,.react-flow__selection:focus-visible{outline:none}.react-flow__controls-button:hover{background:var( --xy-controls-button-background-color-hover-props, var(--xy-controls-button-background-color-hover, var(--xy-controls-button-background-color-hover-default)) );color:var( --xy-controls-button-color-hover-props, var(--xy-controls-button-color-hover, var(--xy-controls-button-color-hover-default)) )}.react-flow__controls-button:disabled{pointer-events:none}.react-flow__controls-button:disabled svg{fill-opacity:.4}.react-flow__controls-button:last-child{border-bottom:none}.react-flow__controls.horizontal .react-flow__controls-button{border-bottom:none;border-right:1px solid var( --xy-controls-button-border-color-props, var(--xy-controls-button-border-color, var(--xy-controls-button-border-color-default)) )}.react-flow__controls.horizontal .react-flow__controls-button:last-child{border-right:none}.react-flow__resize-control{position:absolute}.react-flow__resize-control.left,.react-flow__resize-control.right{cursor:ew-resize}.react-flow__resize-control.top,.react-flow__resize-control.bottom{cursor:ns-resize}.react-flow__resize-control.top.left,.react-flow__resize-control.bottom.right{cursor:nwse-resize}.react-flow__resize-control.bottom.left,.react-flow__resize-control.top.right{cursor:nesw-resize}.react-flow__resize-control.handle{width:5px;height:5px;border:1px solid #fff;border-radius:1px;background-color:var(--xy-resize-background-color, var(--xy-resize-background-color-default));translate:-50% -50%}.react-flow__resize-control.handle.left{left:0;top:50%}.react-flow__resize-control.handle.right{left:100%;top:50%}.react-flow__resize-control.handle.top{left:50%;top:0}.react-flow__resize-control.handle.bottom{left:50%;top:100%}.react-flow__resize-control.handle.top.left,.react-flow__resize-control.handle.bottom.left{left:0}.react-flow__resize-control.handle.top.right,.react-flow__resize-control.handle.bottom.right{left:100%}.react-flow__resize-control.line{border-color:var(--xy-resize-background-color, var(--xy-resize-background-color-default));border-width:0;border-style:solid}.react-flow__resize-control.line.left,.react-flow__resize-control.line.right{width:1px;transform:translate(-50%);top:0;height:100%}.react-flow__resize-control.line.left{left:0;border-left-width:1px}.react-flow__resize-control.line.right{left:100%;border-right-width:1px}.react-flow__resize-control.line.top,.react-flow__resize-control.line.bottom{height:1px;transform:translateY(-50%);left:0;width:100%}.react-flow__resize-control.line.top{top:0;border-top-width:1px}.react-flow__resize-control.line.bottom{border-bottom-width:1px;top:100%}.react-flow__edge-textbg{fill:var(--xy-edge-label-background-color, var(--xy-edge-label-background-color-default))}.react-flow__edge-text{fill:var(--xy-edge-label-color, var(--xy-edge-label-color-default))}", he = "pubuilder-styles", me = "pubuilder-xyflow-styles", xe = (
148
97
  /* css */
149
98
  `
150
99
  .pbu-fab {
@@ -509,68 +458,68 @@ const y = ue((e) => ({
509
458
  }
510
459
  `
511
460
  );
512
- function K(e, t) {
461
+ function X(e, t) {
513
462
  if (document.getElementById(e)) return;
514
- const o = document.createElement("style");
515
- o.id = e, o.textContent = t, document.head.appendChild(o);
463
+ const r = document.createElement("style");
464
+ r.id = e, r.textContent = t, document.head.appendChild(r);
516
465
  }
517
- function ke() {
518
- typeof document > "u" || (K(ye, me), K(we, ve));
466
+ function we() {
467
+ typeof document > "u" || (X(me, ge), X(he, xe));
519
468
  }
520
- function _e(e, t, o, r = 140, a = 48) {
521
- const c = /* @__PURE__ */ new Map();
522
- for (const s of e) {
523
- const x = c.get(s.parentId) ?? [];
524
- x.push(s), c.set(s.parentId, x);
469
+ function ye(e, t, r, o = 140, l = 48) {
470
+ const a = /* @__PURE__ */ new Map();
471
+ for (const u of e) {
472
+ const w = a.get(u.parentId) ?? [];
473
+ w.push(u), a.set(u.parentId, w);
525
474
  }
526
475
  const i = /* @__PURE__ */ new Map();
527
- let l = 0;
528
- const p = (s) => {
529
- const x = c.get(s.id) ?? [], f = s.depth * (t + r);
476
+ let c = 0;
477
+ const h = (u) => {
478
+ const w = a.get(u.id) ?? [], f = u.depth * (t + o);
530
479
  let v;
531
- if (x.length === 0)
532
- v = l, l += o + a;
480
+ if (w.length === 0)
481
+ v = c, c += r + l;
533
482
  else {
534
- const N = x.map(p);
483
+ const N = w.map(h);
535
484
  v = (Math.min(...N) + Math.max(...N)) / 2;
536
485
  }
537
- return i.set(s.id, { x: f, y: v }), v;
486
+ return i.set(u.id, { x: f, y: v }), v;
538
487
  };
539
- for (const s of c.get(null) ?? []) p(s);
540
- return e.map((s) => ({ ...s, ...i.get(s.id) }));
541
- }
542
- const Ne = ie(function(t) {
543
- const { page: o, viewport: r, thumbWidth: a, bodyHeight: c } = t.data, i = y((v) => v.openViewer), l = $(null), [p, s] = _(!1);
544
- I(() => {
545
- const v = l.current;
546
- if (!v || o.external) return;
488
+ for (const u of a.get(null) ?? []) h(u);
489
+ return e.map((u) => ({ ...u, ...i.get(u.id) }));
490
+ }
491
+ const ve = ce(function(t) {
492
+ const { page: r, viewport: o, thumbWidth: l, bodyHeight: a } = t.data, i = y((v) => v.openViewer), c = D(null), [h, u] = _(!1);
493
+ R(() => {
494
+ const v = c.current;
495
+ if (!v || r.external) return;
547
496
  const N = new IntersectionObserver(([g]) => {
548
- g.isIntersecting && (s(!0), N.disconnect());
497
+ g.isIntersecting && (u(!0), N.disconnect());
549
498
  });
550
499
  return N.observe(v), () => N.disconnect();
551
- }, [o.external]);
552
- const x = a / r.width;
553
- return /* @__PURE__ */ u("div", { ref: l, className: "pbu-node", style: { width: a }, onClick: () => {
554
- o.external ? window.open(o.path, "_blank", "noopener") : i(o.path);
500
+ }, [r.external]);
501
+ const w = l / o.width;
502
+ return /* @__PURE__ */ d("div", { ref: c, className: "pbu-node", style: { width: l }, onClick: () => {
503
+ r.external ? window.open(r.path, "_blank", "noopener") : i(r.path);
555
504
  }, children: [
556
505
  /* @__PURE__ */ n(J, { type: "target", position: j.Left, className: "pbu-handle", isConnectable: !1 }),
557
- /* @__PURE__ */ u("div", { className: "pbu-node-header", children: [
558
- /* @__PURE__ */ n("span", { className: "pbu-node-title", children: o.title }),
559
- /* @__PURE__ */ n("span", { className: "pbu-node-path", children: o.external ? "외부 ↗" : o.path })
506
+ /* @__PURE__ */ d("div", { className: "pbu-node-header", children: [
507
+ /* @__PURE__ */ n("span", { className: "pbu-node-title", children: r.title }),
508
+ /* @__PURE__ */ n("span", { className: "pbu-node-path", children: r.external ? "외부 ↗" : r.path })
560
509
  ] }),
561
- /* @__PURE__ */ u("div", { className: "pbu-node-body", style: { height: c }, children: [
562
- o.external ? /* @__PURE__ */ n("div", { className: "pbu-node-placeholder", children: "↗ 외부 링크" }) : p ? /* @__PURE__ */ n(
510
+ /* @__PURE__ */ d("div", { className: "pbu-node-body", style: { height: a }, children: [
511
+ r.external ? /* @__PURE__ */ n("div", { className: "pbu-node-placeholder", children: "↗ 외부 링크" }) : h ? /* @__PURE__ */ n(
563
512
  "iframe",
564
513
  {
565
514
  className: "pbu-node-iframe",
566
- src: o.path,
567
- title: `${o.title} 미리보기`,
515
+ src: r.path,
516
+ title: `${r.title} 미리보기`,
568
517
  loading: "lazy",
569
518
  tabIndex: -1,
570
519
  style: {
571
- width: r.width,
572
- height: r.height,
573
- transform: `scale(${x})`
520
+ width: o.width,
521
+ height: o.height,
522
+ transform: `scale(${w})`
574
523
  }
575
524
  }
576
525
  ) : /* @__PURE__ */ n("div", { className: "pbu-node-placeholder", children: "…" }),
@@ -578,50 +527,50 @@ const Ne = ie(function(t) {
578
527
  ] }),
579
528
  /* @__PURE__ */ n(J, { type: "source", position: j.Right, className: "pbu-handle", isConnectable: !1 })
580
529
  ] });
581
- }), Ee = { page: Ne }, V = 260, ze = 30;
582
- function Se({ ia: e }) {
583
- const t = y((c) => c.closeMap), o = y((c) => c.toggleSkillDrawer), { nodes: r, edges: a } = G(() => {
584
- const c = V / e.viewport.width, i = Math.round(e.viewport.height * c), l = i + ze, p = _e(e.nodes, V, l), s = p.map((f) => ({
530
+ }), ke = { page: ve }, G = 260, _e = 30;
531
+ function Ne({ ia: e }) {
532
+ const t = y((a) => a.closeMap), r = y((a) => a.toggleSkillDrawer), { nodes: o, edges: l } = V(() => {
533
+ const a = G / e.viewport.width, i = Math.round(e.viewport.height * a), c = i + _e, h = ye(e.nodes, G, c), u = h.map((f) => ({
585
534
  id: f.id,
586
535
  type: "page",
587
536
  position: { x: f.x, y: f.y },
588
537
  data: {
589
538
  page: f,
590
539
  viewport: e.viewport,
591
- thumbWidth: V,
540
+ thumbWidth: G,
592
541
  bodyHeight: i
593
542
  },
594
543
  sourcePosition: j.Right,
595
544
  targetPosition: j.Left
596
- })), x = p.filter((f) => f.parentId).map((f) => ({
545
+ })), w = h.filter((f) => f.parentId).map((f) => ({
597
546
  id: `${f.parentId}->${f.id}`,
598
547
  source: f.parentId,
599
548
  target: f.id,
600
549
  type: "smoothstep"
601
550
  }));
602
- return { nodes: s, edges: x };
551
+ return { nodes: u, edges: w };
603
552
  }, [e]);
604
- return I(() => {
605
- const c = (i) => {
553
+ return R(() => {
554
+ const a = (i) => {
606
555
  if (i.key !== "Escape") return;
607
- const l = y.getState();
608
- l.viewerPath || l.skillDrawerOpen || t();
556
+ const c = y.getState();
557
+ c.viewerPath || c.skillDrawerOpen || t();
609
558
  };
610
- return window.addEventListener("keydown", c), () => window.removeEventListener("keydown", c);
611
- }, [t]), /* @__PURE__ */ u("div", { className: "pbu-overlay", children: [
612
- /* @__PURE__ */ u("div", { className: "pbu-bar", children: [
559
+ return window.addEventListener("keydown", a), () => window.removeEventListener("keydown", a);
560
+ }, [t]), /* @__PURE__ */ d("div", { className: "pbu-overlay", children: [
561
+ /* @__PURE__ */ d("div", { className: "pbu-bar", children: [
613
562
  /* @__PURE__ */ n("span", { className: "pbu-logo", children: "pubuilder" }),
614
563
  /* @__PURE__ */ n("span", { className: "pbu-hint", children: "노드 클릭 → 페이지 확대 · 스크롤 줌 · 드래그 팬 · Esc 닫기" }),
615
564
  /* @__PURE__ */ n("span", { className: "pbu-spacer" }),
616
- /* @__PURE__ */ n("button", { type: "button", className: "pbu-btn", onClick: o, children: "🧰 스킬함" }),
565
+ /* @__PURE__ */ n("button", { type: "button", className: "pbu-btn", onClick: r, children: "🧰 스킬함" }),
617
566
  /* @__PURE__ */ n("button", { type: "button", className: "pbu-icon-btn", onClick: t, "aria-label": "닫기", children: "✕" })
618
567
  ] }),
619
568
  /* @__PURE__ */ n("div", { className: "pbu-canvas", children: /* @__PURE__ */ n(
620
569
  pe,
621
570
  {
622
- nodes: r,
623
- edges: a,
624
- nodeTypes: Ee,
571
+ nodes: o,
572
+ edges: l,
573
+ nodeTypes: ke,
625
574
  fitView: !0,
626
575
  fitViewOptions: { padding: 0.15, maxZoom: 1 },
627
576
  minZoom: 0.05,
@@ -633,8 +582,8 @@ function Se({ ia: e }) {
633
582
  ) })
634
583
  ] });
635
584
  }
636
- function Ce() {
637
- const e = y((r) => r.isMapOpen), t = y((r) => r.openMap), o = y((r) => r.closeMap);
585
+ function ze() {
586
+ const e = y((o) => o.isMapOpen), t = y((o) => o.openMap), r = y((o) => o.closeMap);
638
587
  return /* @__PURE__ */ n(
639
588
  "button",
640
589
  {
@@ -642,8 +591,8 @@ function Ce() {
642
591
  className: "pbu-fab",
643
592
  title: "Page Map (pubuilder)",
644
593
  "aria-label": "페이지 맵 열기",
645
- onClick: () => e ? o() : t(),
646
- children: /* @__PURE__ */ u("svg", { width: "22", height: "22", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: [
594
+ onClick: () => e ? r() : t(),
595
+ children: /* @__PURE__ */ d("svg", { width: "22", height: "22", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: [
647
596
  /* @__PURE__ */ n("polygon", { points: "3 6 9 3 15 6 21 3 21 18 15 21 9 18 3 21" }),
648
597
  /* @__PURE__ */ n("line", { x1: "9", y1: "3", x2: "9", y2: "18" }),
649
598
  /* @__PURE__ */ n("line", { x1: "15", y1: "6", x2: "15", y2: "21" })
@@ -651,7 +600,7 @@ function Ce() {
651
600
  }
652
601
  );
653
602
  }
654
- const Te = /* @__PURE__ */ new Set([
603
+ const Ce = /* @__PURE__ */ new Set([
655
604
  "section",
656
605
  "header",
657
606
  "footer",
@@ -660,7 +609,7 @@ const Te = /* @__PURE__ */ new Set([
660
609
  "article",
661
610
  "aside",
662
611
  "form"
663
- ]), Le = /* @__PURE__ */ new Set([
612
+ ]), Ee = /* @__PURE__ */ new Set([
664
613
  "a",
665
614
  "button",
666
615
  "input",
@@ -680,90 +629,90 @@ const Te = /* @__PURE__ */ new Set([
680
629
  "p",
681
630
  "label"
682
631
  ]);
683
- function le(e, t) {
684
- const o = [];
685
- let r = e;
686
- for (; r && r !== t.body && r !== t.documentElement; )
687
- o.push(r), r = r.parentElement;
688
- return o;
689
- }
690
- function Me(e, t) {
691
- const o = le(e, t);
692
- if (o.length === 0) return null;
693
- const r = o.find((i) => {
694
- const l = i.tagName.toLowerCase();
695
- return Te.has(l) && l !== "main";
632
+ function ne(e, t) {
633
+ const r = [];
634
+ let o = e;
635
+ for (; o && o !== t.body && o !== t.documentElement; )
636
+ r.push(o), o = o.parentElement;
637
+ return r;
638
+ }
639
+ function Se(e, t) {
640
+ const r = ne(e, t);
641
+ if (r.length === 0) return null;
642
+ const o = r.find((i) => {
643
+ const c = i.tagName.toLowerCase();
644
+ return Ce.has(c) && c !== "main";
696
645
  });
697
- if (r) return r;
698
- const a = o.find((i) => i.tagName.toLowerCase() === "main");
699
- if (a) return a;
700
- const c = t.body.scrollHeight || 1;
701
- for (let i = o.length - 1; i >= 0; i--) {
702
- const l = o[i].getBoundingClientRect();
703
- if (l.height > 0 && l.height < c * 0.8) return o[i];
646
+ if (o) return o;
647
+ const l = r.find((i) => i.tagName.toLowerCase() === "main");
648
+ if (l) return l;
649
+ const a = t.body.scrollHeight || 1;
650
+ for (let i = r.length - 1; i >= 0; i--) {
651
+ const c = r[i].getBoundingClientRect();
652
+ if (c.height > 0 && c.height < a * 0.8) return r[i];
704
653
  }
705
- return o[o.length - 1];
706
- }
707
- function Pe(e, t) {
708
- const o = le(e, t);
709
- for (const r of o) {
710
- if (Le.has(r.tagName.toLowerCase())) return r;
711
- const a = r.getBoundingClientRect(), c = r.children.length > 0 || (r.textContent ?? "").trim().length > 0;
712
- if (a.width >= 40 && a.height >= 24 && c) return r;
654
+ return r[r.length - 1];
655
+ }
656
+ function Te(e, t) {
657
+ const r = ne(e, t);
658
+ for (const o of r) {
659
+ if (Ee.has(o.tagName.toLowerCase())) return o;
660
+ const l = o.getBoundingClientRect(), a = o.children.length > 0 || (o.textContent ?? "").trim().length > 0;
661
+ if (l.width >= 40 && l.height >= 24 && a) return o;
713
662
  }
714
- return o[0] ?? null;
663
+ return r[0] ?? null;
715
664
  }
716
- function Oe(e, t, o) {
717
- return o === "all" ? t.body : o === "section" ? Me(e, t) : Pe(e, t);
665
+ function Le(e, t, r) {
666
+ return r === "all" ? t.body : r === "section" ? Se(e, t) : Te(e, t);
718
667
  }
719
- function Ie(e) {
720
- const o = e.querySelector("h1, h2, h3, h4, h5, h6")?.textContent?.trim();
721
- if (o) return B(o);
722
- const r = e.getAttribute("aria-label");
668
+ function Me(e) {
669
+ const r = e.querySelector("h1, h2, h3, h4, h5, h6")?.textContent?.trim();
723
670
  if (r) return B(r);
724
- const a = e.getAttribute("alt");
725
- if (a) return B(a);
726
- const c = (e.textContent ?? "").trim().replace(/\s+/g, " ");
727
- return c ? B(c) : `<${e.tagName.toLowerCase()}>`;
671
+ const o = e.getAttribute("aria-label");
672
+ if (o) return B(o);
673
+ const l = e.getAttribute("alt");
674
+ if (l) return B(l);
675
+ const a = (e.textContent ?? "").trim().replace(/\s+/g, " ");
676
+ return a ? B(a) : `<${e.tagName.toLowerCase()}>`;
728
677
  }
729
678
  function B(e, t = 30) {
730
679
  return e.length > t ? `${e.slice(0, t)}…` : e;
731
680
  }
732
- function Re(e, t) {
681
+ function Pe(e, t) {
733
682
  if (e.id) return `#${CSS.escape(e.id)}`;
734
- const o = [];
735
- let r = e;
736
- for (; r && r !== t.body && o.length < 8; ) {
737
- if (r.id)
738
- return o.unshift(`#${CSS.escape(r.id)}`), o.join(" > ");
739
- const a = r.tagName.toLowerCase(), c = r.parentElement;
740
- let i = a;
741
- if (c) {
742
- const l = Array.from(c.children).filter(
743
- (p) => p.tagName === r.tagName
683
+ const r = [];
684
+ let o = e;
685
+ for (; o && o !== t.body && r.length < 8; ) {
686
+ if (o.id)
687
+ return r.unshift(`#${CSS.escape(o.id)}`), r.join(" > ");
688
+ const l = o.tagName.toLowerCase(), a = o.parentElement;
689
+ let i = l;
690
+ if (a) {
691
+ const c = Array.from(a.children).filter(
692
+ (h) => h.tagName === o.tagName
744
693
  );
745
- l.length > 1 && (i += `:nth-of-type(${l.indexOf(r) + 1})`);
694
+ c.length > 1 && (i += `:nth-of-type(${c.indexOf(o) + 1})`);
746
695
  }
747
- o.unshift(i), r = c;
696
+ r.unshift(i), o = a;
748
697
  }
749
- return o.join(" > ");
698
+ return r.join(" > ");
750
699
  }
751
- function Z(e, t, o) {
752
- const r = e.createElement("div");
753
- r.setAttribute("data-pubuilder", "highlight"), Object.assign(r.style, {
700
+ function K(e, t, r) {
701
+ const o = e.createElement("div");
702
+ o.setAttribute("data-pubuilder", "highlight"), Object.assign(o.style, {
754
703
  position: "fixed",
755
704
  top: "0",
756
705
  left: "0",
757
706
  display: "none",
758
707
  border: `1px solid ${t}`,
759
- background: o,
708
+ background: r,
760
709
  borderRadius: "0",
761
710
  pointerEvents: "none",
762
711
  zIndex: "2147483647",
763
712
  boxSizing: "border-box"
764
713
  });
765
- const a = e.createElement("div");
766
- return Object.assign(a.style, {
714
+ const l = e.createElement("div");
715
+ return Object.assign(l.style, {
767
716
  position: "absolute",
768
717
  left: "-1px",
769
718
  top: "-22px",
@@ -774,276 +723,276 @@ function Z(e, t, o) {
774
723
  borderRadius: "0",
775
724
  whiteSpace: "nowrap",
776
725
  pointerEvents: "none"
777
- }), r.appendChild(a), { root: r, label: a };
726
+ }), o.appendChild(l), { root: o, label: l };
778
727
  }
779
- function Q(e, t, o, r) {
780
- const a = t.getBoundingClientRect(), c = r ?? -1 / 0, i = Math.max(a.top, c), l = a.bottom - i;
781
- if (l <= 2) {
728
+ function Z(e, t, r, o) {
729
+ const l = t.getBoundingClientRect(), a = o ?? -1 / 0, i = Math.max(l.top, a), c = l.bottom - i;
730
+ if (c <= 2) {
782
731
  W(e);
783
732
  return;
784
733
  }
785
- e.root.style.display = "block", e.root.style.transform = `translate(${a.x}px, ${i}px)`, e.root.style.width = `${a.width}px`, e.root.style.height = `${l}px`, e.label.textContent = o, e.label.style.top = i < 30 || i - 24 < c ? "2px" : "-24px";
734
+ e.root.style.display = "block", e.root.style.transform = `translate(${l.x}px, ${i}px)`, e.root.style.width = `${l.width}px`, e.root.style.height = `${c}px`, e.label.textContent = r, e.label.style.top = i < 30 || i - 24 < a ? "2px" : "-24px";
786
735
  }
787
736
  function W(e) {
788
737
  e.root.style.display = "none";
789
738
  }
790
- function ee(e) {
739
+ function Q(e) {
791
740
  const t = e.getBoundingClientRect();
792
741
  return `${e.tagName.toLowerCase()} · ${Math.round(t.width)}×${Math.round(t.height)}`;
793
742
  }
794
- function $e(e, t) {
795
- let o = null;
743
+ function Oe(e, t) {
744
+ let r = null;
796
745
  try {
797
- o = e.contentDocument;
746
+ r = e.contentDocument;
798
747
  } catch {
799
748
  return null;
800
749
  }
801
- const r = e.contentWindow;
802
- if (!o || !o.body || !r) return null;
803
- const a = o;
804
- let c = t.granularity, i = t.enabled, l = null, p = null;
805
- const s = Z(a, "rgba(14,99,156,0.95)", "rgba(14,99,156,0.10)"), x = Z(a, "rgba(35,134,54,0.95)", "rgba(35,134,54,0.07)");
806
- a.body.appendChild(s.root), a.body.appendChild(x.root);
750
+ const o = e.contentWindow;
751
+ if (!r || !r.body || !o) return null;
752
+ const l = r;
753
+ let a = t.granularity, i = t.enabled, c = null, h = null;
754
+ const u = K(l, "rgba(14,99,156,0.95)", "rgba(14,99,156,0.10)"), w = K(l, "rgba(35,134,54,0.95)", "rgba(35,134,54,0.07)");
755
+ l.body.appendChild(u.root), l.body.appendChild(w.root);
807
756
  let f = [], v = 0;
808
757
  const N = () => {
809
758
  f = [];
810
- for (const b of Array.from(a.body.querySelectorAll("*"))) {
811
- if (b === s.root || b === x.root || s.root.contains(b) || x.root.contains(b)) continue;
812
- const k = r.getComputedStyle(b).position;
759
+ for (const p of Array.from(l.body.querySelectorAll("*"))) {
760
+ if (p === u.root || p === w.root || u.root.contains(p) || w.root.contains(p)) continue;
761
+ const k = o.getComputedStyle(p).position;
813
762
  if (k !== "fixed" && k !== "sticky") continue;
814
- const m = b.getBoundingClientRect();
815
- m.width === 0 || m.height === 0 || m.top <= 1 && m.height < r.innerHeight * 0.5 && f.push({ el: b, rect: m });
763
+ const m = p.getBoundingClientRect();
764
+ m.width === 0 || m.height === 0 || m.top <= 1 && m.height < o.innerHeight * 0.5 && f.push({ el: p, rect: m });
816
765
  }
817
766
  }, g = () => {
818
- const b = Date.now();
819
- b - v < 500 || (v = b, N());
820
- }, S = (b) => {
821
- const k = b.getBoundingClientRect();
767
+ const p = Date.now();
768
+ p - v < 500 || (v = p, N());
769
+ }, E = (p) => {
770
+ const k = p.getBoundingClientRect();
822
771
  let m = null;
823
- for (const E of f)
824
- E.el === b || E.el.contains(b) || b.contains(E.el) || !(k.left < E.rect.right && k.right > E.rect.left) || (m === null || E.rect.bottom > m) && (m = E.rect.bottom);
772
+ for (const z of f)
773
+ z.el === p || z.el.contains(p) || p.contains(z.el) || !(k.left < z.rect.right && k.right > z.rect.left) || (m === null || z.rect.bottom > m) && (m = z.rect.bottom);
825
774
  return m;
826
- }, C = () => {
827
- l && i && l.isConnected ? Q(s, l, ee(l), S(l)) : W(s), p && p.isConnected ? Q(x, p, `선택됨 · ${ee(p)}`, S(p)) : W(x);
828
- }, L = (b) => {
829
- if (c === "all") return a.body;
830
- if (p && p.isConnected && p.contains(b)) {
831
- if (p === b) return p;
832
- let k = b;
833
- for (; k.parentElement && k.parentElement !== p; )
775
+ }, S = () => {
776
+ c && i && c.isConnected ? Z(u, c, Q(c), E(c)) : W(u), h && h.isConnected ? Z(w, h, `선택됨 · ${Q(h)}`, E(h)) : W(w);
777
+ }, L = (p) => {
778
+ if (a === "all") return l.body;
779
+ if (h && h.isConnected && h.contains(p)) {
780
+ if (h === p) return h;
781
+ let k = p;
782
+ for (; k.parentElement && k.parentElement !== h; )
834
783
  k = k.parentElement;
835
784
  return k;
836
785
  }
837
- return Oe(b, a, c);
838
- }, R = (b) => {
786
+ return Le(p, l, a);
787
+ }, I = (p) => {
839
788
  if (!i) return;
840
789
  g();
841
- const k = b.target;
842
- if (!k || !a.body.contains(k)) return;
790
+ const k = p.target;
791
+ if (!k || !l.body.contains(k)) return;
843
792
  const m = L(k);
844
- m !== l && (l = m, C());
845
- }, M = (b) => {
793
+ m !== c && (c = m, S());
794
+ }, M = (p) => {
846
795
  if (!i) return;
847
- b.preventDefault(), b.stopPropagation(), N(), v = Date.now();
848
- const k = b.target;
796
+ p.preventDefault(), p.stopPropagation(), N(), v = Date.now();
797
+ const k = p.target;
849
798
  if (!k) return;
850
799
  const m = L(k);
851
800
  if (!m) return;
852
- p = m, C();
853
- const E = m.getBoundingClientRect();
801
+ h = m, S();
802
+ const z = m.getBoundingClientRect();
854
803
  t.onSelect(
855
804
  {
856
805
  pagePath: t.pagePath,
857
- selector: Re(m, a),
806
+ selector: Pe(m, l),
858
807
  tag: m.tagName.toLowerCase(),
859
- label: Ie(m),
808
+ label: Me(m),
860
809
  rect: {
861
- x: E.x + r.scrollX,
862
- y: E.y + r.scrollY,
863
- width: E.width,
864
- height: E.height
810
+ x: z.x + o.scrollX,
811
+ y: z.y + o.scrollY,
812
+ width: z.width,
813
+ height: z.height
865
814
  },
866
- granularity: c
815
+ granularity: a
867
816
  },
868
817
  m
869
818
  );
870
819
  }, T = () => {
871
- l = null, C();
872
- }, O = () => C(), P = () => {
873
- N(), C();
820
+ c = null, S();
821
+ }, O = () => S(), P = () => {
822
+ N(), S();
874
823
  };
875
- return N(), a.addEventListener("mousemove", R, !0), a.addEventListener("click", M, !0), a.documentElement.addEventListener("mouseleave", T), r.addEventListener("scroll", O, !0), r.addEventListener("resize", P), {
824
+ return N(), l.addEventListener("mousemove", I, !0), l.addEventListener("click", M, !0), l.documentElement.addEventListener("mouseleave", T), o.addEventListener("scroll", O, !0), o.addEventListener("resize", P), {
876
825
  destroy() {
877
826
  try {
878
- a.removeEventListener("mousemove", R, !0), a.removeEventListener("click", M, !0), a.documentElement.removeEventListener("mouseleave", T), r.removeEventListener("scroll", O, !0), r.removeEventListener("resize", P), s.root.remove(), x.root.remove();
827
+ l.removeEventListener("mousemove", I, !0), l.removeEventListener("click", M, !0), l.documentElement.removeEventListener("mouseleave", T), o.removeEventListener("scroll", O, !0), o.removeEventListener("resize", P), u.root.remove(), w.root.remove();
879
828
  } catch {
880
829
  }
881
830
  },
882
- setGranularity(b) {
883
- c = b, l = null, C();
831
+ setGranularity(p) {
832
+ a = p, c = null, S();
884
833
  },
885
- setEnabled(b) {
886
- i = b, b || (l = null), C();
834
+ setEnabled(p) {
835
+ i = p, p || (c = null), S();
887
836
  }
888
837
  };
889
838
  }
890
- const De = {
839
+ const Re = {
891
840
  log: "💬",
892
841
  tool: "🔧",
893
842
  error: "⛔",
894
843
  done: "✅"
895
844
  };
896
- function Ae() {
897
- const e = oe(Y), t = y((d) => d.selection), o = y((d) => d.selectedOuterHTML), r = y((d) => d.toggleSkillDrawer), [a, c] = _(""), [i, l] = _("idle"), [p, s] = _(null), [x, f] = _([]), [v, N] = _(!1), [g, S] = _(!1), [C, L] = _(null), [R, M] = _(null), [T, O] = _(!1), [P, b] = _(!1), k = $(null), m = $(null), E = $(0);
898
- I(() => {
899
- E.current++, m.current?.(), m.current = null, l("idle"), s(null), f([]), N(!1), S(!1), O(!1), L(null), M(null), c("");
900
- }, [t?.selector]), I(() => {
901
- const d = k.current;
902
- d && (d.scrollTop = d.scrollHeight);
903
- }, [x]), I(() => () => {
904
- E.current++, m.current?.(), m.current = null;
845
+ function Ie() {
846
+ const e = te(Y), t = y((s) => s.selection), r = y((s) => s.selectedOuterHTML), o = y((s) => s.toggleSkillDrawer), [l, a] = _(""), [i, c] = _("idle"), [h, u] = _(null), [w, f] = _([]), [v, N] = _(!1), [g, E] = _(!1), [S, L] = _(null), [I, M] = _(null), [T, O] = _(!1), [P, p] = _(!1), k = D(null), m = D(null), z = D(0);
847
+ R(() => {
848
+ z.current++, m.current?.(), m.current = null, c("idle"), u(null), f([]), N(!1), E(!1), O(!1), L(null), M(null), a("");
849
+ }, [t?.selector]), R(() => {
850
+ const s = k.current;
851
+ s && (s.scrollTop = s.scrollHeight);
852
+ }, [w]), R(() => () => {
853
+ z.current++, m.current?.(), m.current = null;
905
854
  }, []);
906
- const A = (d) => {
907
- m.current = e.subscribePublish(d, (z) => {
908
- f((D) => [...D, z]), z.type === "done" ? (l("done"), s(null), O(!1), m.current?.(), m.current = null) : z.type === "error" && (l("error"), L(z.text), s(null), O(!1), m.current?.(), m.current = null);
855
+ const A = (s) => {
856
+ m.current = e.subscribePublish(s, (C) => {
857
+ f(($) => [...$, C]), C.type === "done" ? (c("done"), u(null), O(!1), m.current?.(), m.current = null) : C.type === "error" && (c("error"), L(C.text), u(null), O(!1), m.current?.(), m.current = null);
909
858
  });
910
- }, U = async () => {
859
+ }, F = async () => {
911
860
  if (!t || i === "running" || g) return;
912
- const d = E.current;
913
- N(!1), L(null), M(null), S(!0);
861
+ const s = z.current;
862
+ N(!1), L(null), M(null), E(!0);
914
863
  try {
915
- const z = await e.isAlive();
916
- if (d !== E.current) return;
917
- if (!z) {
864
+ const C = await e.isAlive();
865
+ if (s !== z.current) return;
866
+ if (!C) {
918
867
  N(!0);
919
868
  return;
920
869
  }
921
- const { jobId: D } = await e.startPublish({
870
+ const { jobId: $ } = await e.startPublish({
922
871
  selection: t,
923
- outerHTML: o ?? "",
924
- figmaUrl: a
872
+ outerHTML: r ?? "",
873
+ figmaUrl: l
925
874
  });
926
- if (d !== E.current) {
927
- e.cancelPublish(D).catch(() => {
875
+ if (s !== z.current) {
876
+ e.cancelPublish($).catch(() => {
928
877
  });
929
878
  return;
930
879
  }
931
- s(D), f([]), l("running"), A(D);
932
- } catch (z) {
933
- if (d !== E.current) return;
934
- l("error"), L(z instanceof Error ? z.message : String(z)), M(z instanceof re ? z.code ?? null : null);
880
+ u($), f([]), c("running"), A($);
881
+ } catch (C) {
882
+ if (s !== z.current) return;
883
+ c("error"), L(C instanceof Error ? C.message : String(C)), M(C instanceof oe ? C.code ?? null : null);
935
884
  } finally {
936
- S(!1);
885
+ E(!1);
937
886
  }
938
- }, F = async () => {
939
- if (!(!p || T)) {
887
+ }, U = async () => {
888
+ if (!(!h || T)) {
940
889
  O(!0);
941
890
  try {
942
- await e.cancelPublish(p);
943
- } catch (d) {
944
- L(d instanceof Error ? d.message : String(d)), O(!1);
891
+ await e.cancelPublish(h);
892
+ } catch (s) {
893
+ L(s instanceof Error ? s.message : String(s)), O(!1);
945
894
  }
946
895
  }
947
896
  }, q = async () => {
948
- await navigator.clipboard.writeText("npx pubuilder serve"), b(!0), setTimeout(() => b(!1), 1200);
897
+ await navigator.clipboard.writeText("npx pubuilder serve"), p(!0), setTimeout(() => p(!1), 1200);
949
898
  }, H = async () => {
950
- S(!0);
899
+ E(!0);
951
900
  try {
952
- const d = await e.isAlive();
953
- N(!d);
901
+ const s = await e.isAlive();
902
+ N(!s);
954
903
  } finally {
955
- S(!1);
904
+ E(!1);
956
905
  }
957
- }, h = i === "running";
958
- return /* @__PURE__ */ u("div", { className: "pbu-publish", children: [
906
+ }, b = i === "running";
907
+ return /* @__PURE__ */ d("div", { className: "pbu-publish", children: [
959
908
  /* @__PURE__ */ n("label", { children: "Figma 노드 링크" }),
960
909
  /* @__PURE__ */ n(
961
910
  "input",
962
911
  {
963
- value: a,
964
- onChange: (d) => c(d.target.value),
965
- disabled: h,
912
+ value: l,
913
+ onChange: (s) => a(s.target.value),
914
+ disabled: b,
966
915
  placeholder: "https://www.figma.com/design/..."
967
916
  }
968
917
  ),
969
- v && /* @__PURE__ */ u("div", { className: "pbu-panel-empty", children: [
918
+ v && /* @__PURE__ */ d("div", { className: "pbu-panel-empty", children: [
970
919
  "컴패니언 서버가 꺼져 있어요",
971
- /* @__PURE__ */ u("div", { className: "pbu-drawer-code", children: [
920
+ /* @__PURE__ */ d("div", { className: "pbu-drawer-code", children: [
972
921
  /* @__PURE__ */ n("code", { children: "npx pubuilder serve" }),
973
922
  /* @__PURE__ */ n("button", { type: "button", className: "pbu-btn", onClick: q, children: P ? "복사됨 ✓" : "복사" })
974
923
  ] }),
975
924
  /* @__PURE__ */ n("div", { className: "pbu-hint", children: 'package.json의 dev 스크립트를 "pubuilder dev -- <기존 명령>"으로 감싸면 자동 실행돼요' }),
976
925
  /* @__PURE__ */ n("button", { type: "button", className: "pbu-btn", disabled: g, onClick: H, children: "다시 확인" })
977
926
  ] }),
978
- C && !v && /* @__PURE__ */ u("div", { className: "pbu-drawer-error", children: [
979
- /* @__PURE__ */ n("span", { children: C }),
980
- (R === "NO_FIGMA_TOKEN" || R === "FIGMA_API_ERROR") && /* @__PURE__ */ n("button", { type: "button", className: "pbu-btn", onClick: r, children: "스킬함 열기" })
927
+ S && !v && /* @__PURE__ */ d("div", { className: "pbu-drawer-error", children: [
928
+ /* @__PURE__ */ n("span", { children: S }),
929
+ (I === "NO_FIGMA_TOKEN" || I === "FIGMA_API_ERROR") && /* @__PURE__ */ n("button", { type: "button", className: "pbu-btn", onClick: o, children: "스킬함 열기" })
981
930
  ] }),
982
- h ? /* @__PURE__ */ n("button", { type: "button", className: "pbu-btn pbu-btn-primary", disabled: T, onClick: F, children: T ? "중단 중..." : "중단" }) : /* @__PURE__ */ n(
931
+ b ? /* @__PURE__ */ n("button", { type: "button", className: "pbu-btn pbu-btn-primary", disabled: T, onClick: U, children: T ? "중단 중..." : "중단" }) : /* @__PURE__ */ n(
983
932
  "button",
984
933
  {
985
934
  type: "button",
986
935
  className: "pbu-btn pbu-btn-primary",
987
936
  disabled: g || !t,
988
- onClick: U,
937
+ onClick: F,
989
938
  children: "이 블록 퍼블리싱"
990
939
  }
991
940
  ),
992
- (x.length > 0 || h) && /* @__PURE__ */ u("div", { className: "pbu-publish-log", ref: k, children: [
993
- h && x.length === 0 && /* @__PURE__ */ n("div", { className: "pbu-log-line pbu-log-tool", children: "실행 중..." }),
994
- x.map((d, z) => /* @__PURE__ */ u(
941
+ (w.length > 0 || b) && /* @__PURE__ */ d("div", { className: "pbu-publish-log", ref: k, children: [
942
+ b && w.length === 0 && /* @__PURE__ */ n("div", { className: "pbu-log-line pbu-log-tool", children: "실행 중..." }),
943
+ w.map((s, C) => /* @__PURE__ */ d(
995
944
  "div",
996
945
  {
997
- className: d.type === "error" ? "pbu-log-line pbu-log-error" : d.type === "done" ? "pbu-log-line pbu-log-done" : d.type === "tool" ? "pbu-log-line pbu-log-tool" : "pbu-log-line",
946
+ className: s.type === "error" ? "pbu-log-line pbu-log-error" : s.type === "done" ? "pbu-log-line pbu-log-done" : s.type === "tool" ? "pbu-log-line pbu-log-tool" : "pbu-log-line",
998
947
  children: [
999
- /* @__PURE__ */ n("span", { children: De[d.type] }),
948
+ /* @__PURE__ */ n("span", { children: Re[s.type] }),
1000
949
  " ",
1001
- /* @__PURE__ */ n("span", { children: d.text })
950
+ /* @__PURE__ */ n("span", { children: s.text })
1002
951
  ]
1003
952
  },
1004
- z
953
+ C
1005
954
  ))
1006
955
  ] })
1007
956
  ] });
1008
957
  }
1009
- function He() {
1010
- const e = y((a) => a.selection), [t, o] = _(!1), r = async () => {
1011
- e && (await navigator.clipboard.writeText(e.selector), o(!0), setTimeout(() => o(!1), 1200));
958
+ function De() {
959
+ const e = y((l) => l.selection), [t, r] = _(!1), o = async () => {
960
+ e && (await navigator.clipboard.writeText(e.selector), r(!0), setTimeout(() => r(!1), 1200));
1012
961
  };
1013
- return /* @__PURE__ */ u("aside", { className: "pbu-panel", children: [
962
+ return /* @__PURE__ */ d("aside", { className: "pbu-panel", children: [
1014
963
  /* @__PURE__ */ n("div", { className: "pbu-panel-title", children: "선택된 블록" }),
1015
- e ? /* @__PURE__ */ u(te, { children: [
1016
- /* @__PURE__ */ u("div", { className: "pbu-field", children: [
964
+ e ? /* @__PURE__ */ d(ee, { children: [
965
+ /* @__PURE__ */ d("div", { className: "pbu-field", children: [
1017
966
  /* @__PURE__ */ n("label", { children: "페이지" }),
1018
967
  /* @__PURE__ */ n("code", { children: e.pagePath })
1019
968
  ] }),
1020
- /* @__PURE__ */ u("div", { className: "pbu-field", children: [
969
+ /* @__PURE__ */ d("div", { className: "pbu-field", children: [
1021
970
  /* @__PURE__ */ n("label", { children: "블록" }),
1022
- /* @__PURE__ */ u("div", { children: [
971
+ /* @__PURE__ */ d("div", { children: [
1023
972
  /* @__PURE__ */ n("span", { className: "pbu-chip", children: e.tag }),
1024
973
  /* @__PURE__ */ n("span", { children: e.label })
1025
974
  ] })
1026
975
  ] }),
1027
- /* @__PURE__ */ u("div", { className: "pbu-field", children: [
976
+ /* @__PURE__ */ d("div", { className: "pbu-field", children: [
1028
977
  /* @__PURE__ */ n("label", { children: "Selector" }),
1029
978
  /* @__PURE__ */ n("code", { className: "pbu-selector", children: e.selector }),
1030
- /* @__PURE__ */ n("button", { type: "button", className: "pbu-btn", onClick: r, children: t ? "복사됨 ✓" : "Selector 복사" })
979
+ /* @__PURE__ */ n("button", { type: "button", className: "pbu-btn", onClick: o, children: t ? "복사됨 ✓" : "Selector 복사" })
1031
980
  ] }),
1032
- /* @__PURE__ */ u("div", { className: "pbu-field", children: [
981
+ /* @__PURE__ */ d("div", { className: "pbu-field", children: [
1033
982
  /* @__PURE__ */ n("label", { children: "크기" }),
1034
- /* @__PURE__ */ u("span", { children: [
983
+ /* @__PURE__ */ d("span", { children: [
1035
984
  Math.round(e.rect.width),
1036
985
  " × ",
1037
986
  Math.round(e.rect.height),
1038
987
  "px"
1039
988
  ] })
1040
989
  ] }),
1041
- /* @__PURE__ */ u("div", { className: "pbu-field", children: [
990
+ /* @__PURE__ */ d("div", { className: "pbu-field", children: [
1042
991
  /* @__PURE__ */ n("label", { children: "단위" }),
1043
992
  /* @__PURE__ */ n("span", { children: e.granularity === "all" ? "전체" : e.granularity === "section" ? "섹션" : "유닛" })
1044
993
  ] }),
1045
- /* @__PURE__ */ n(Ae, {})
1046
- ] }) : /* @__PURE__ */ u("div", { className: "pbu-panel-empty", children: [
994
+ /* @__PURE__ */ n(Ie, {})
995
+ ] }) : /* @__PURE__ */ d("div", { className: "pbu-panel-empty", children: [
1047
996
  "화면에서 블록에 마우스를 올리고 클릭해 선택하세요.",
1048
997
  /* @__PURE__ */ n("br", {}),
1049
998
  "상단 토글로 ",
@@ -1052,51 +1001,51 @@ function He() {
1052
1001
  ] })
1053
1002
  ] });
1054
1003
  }
1055
- function Be({ ia: e }) {
1056
- const t = y((g) => g.viewerPath), o = y((g) => g.closeViewer), r = y((g) => g.granularity), a = y((g) => g.setGranularity), c = y((g) => g.inspectEnabled), i = y((g) => g.setInspectEnabled), l = y((g) => g.toggleSkillDrawer), p = $(null), s = $(null), [x, f] = _(!1), v = e.nodes.find((g) => g.path === t), N = () => {
1057
- s.current?.destroy(), s.current = null;
1058
- const g = p.current;
1004
+ function $e({ ia: e }) {
1005
+ const t = y((g) => g.viewerPath), r = y((g) => g.closeViewer), o = y((g) => g.granularity), l = y((g) => g.setGranularity), a = y((g) => g.inspectEnabled), i = y((g) => g.setInspectEnabled), c = y((g) => g.toggleSkillDrawer), h = D(null), u = D(null), [w, f] = _(!1), v = e.nodes.find((g) => g.path === t), N = () => {
1006
+ u.current?.destroy(), u.current = null;
1007
+ const g = h.current;
1059
1008
  if (!g || !t) return;
1060
- const S = y.getState(), C = $e(g, {
1009
+ const E = y.getState(), S = Oe(g, {
1061
1010
  pagePath: t,
1062
- granularity: S.granularity,
1063
- enabled: S.inspectEnabled,
1064
- onSelect: (L, R) => (
1011
+ granularity: E.granularity,
1012
+ enabled: E.inspectEnabled,
1013
+ onSelect: (L, I) => (
1065
1014
  // 20K 상한 — 프롬프트 비대화 방지
1066
- y.getState().setSelectionWithHTML(L, R.outerHTML.slice(0, 2e4))
1015
+ y.getState().setSelectionWithHTML(L, I.outerHTML.slice(0, 2e4))
1067
1016
  )
1068
1017
  });
1069
- if (!C) {
1018
+ if (!S) {
1070
1019
  f(!0);
1071
1020
  return;
1072
1021
  }
1073
- f(!1), s.current = C;
1022
+ f(!1), u.current = S;
1074
1023
  };
1075
- return I(() => () => s.current?.destroy(), []), I(() => {
1076
- s.current?.setGranularity(r);
1077
- }, [r]), I(() => {
1078
- s.current?.setEnabled(c);
1079
- }, [c]), I(() => {
1080
- const g = (S) => {
1081
- S.key === "Escape" && (y.getState().skillDrawerOpen || o());
1024
+ return R(() => () => u.current?.destroy(), []), R(() => {
1025
+ u.current?.setGranularity(o);
1026
+ }, [o]), R(() => {
1027
+ u.current?.setEnabled(a);
1028
+ }, [a]), R(() => {
1029
+ const g = (E) => {
1030
+ E.key === "Escape" && (y.getState().skillDrawerOpen || r());
1082
1031
  };
1083
1032
  return window.addEventListener("keydown", g), () => window.removeEventListener("keydown", g);
1084
- }, [o]), v ? /* @__PURE__ */ u("div", { className: "pbu-viewer", children: [
1085
- /* @__PURE__ */ u("div", { className: "pbu-bar", children: [
1086
- /* @__PURE__ */ n("button", { type: "button", className: "pbu-btn", onClick: o, children: "← 맵으로" }),
1087
- /* @__PURE__ */ u("span", { className: "pbu-viewer-title", children: [
1033
+ }, [r]), v ? /* @__PURE__ */ d("div", { className: "pbu-viewer", children: [
1034
+ /* @__PURE__ */ d("div", { className: "pbu-bar", children: [
1035
+ /* @__PURE__ */ n("button", { type: "button", className: "pbu-btn", onClick: r, children: "← 맵으로" }),
1036
+ /* @__PURE__ */ d("span", { className: "pbu-viewer-title", children: [
1088
1037
  v.title,
1089
1038
  /* @__PURE__ */ n("code", { children: v.path })
1090
1039
  ] }),
1091
1040
  /* @__PURE__ */ n("span", { className: "pbu-spacer" }),
1092
- x && /* @__PURE__ */ n("span", { className: "pbu-hint", children: "⚠ 이 페이지는 검사할 수 없어요" }),
1093
- /* @__PURE__ */ u("div", { className: "pbu-seg", role: "group", "aria-label": "블록 단위", children: [
1041
+ w && /* @__PURE__ */ n("span", { className: "pbu-hint", children: "⚠ 이 페이지는 검사할 수 없어요" }),
1042
+ /* @__PURE__ */ d("div", { className: "pbu-seg", role: "group", "aria-label": "블록 단위", children: [
1094
1043
  /* @__PURE__ */ n(
1095
1044
  "button",
1096
1045
  {
1097
1046
  type: "button",
1098
- className: r === "all" ? "pbu-on" : "",
1099
- onClick: () => a("all"),
1047
+ className: o === "all" ? "pbu-on" : "",
1048
+ onClick: () => l("all"),
1100
1049
  children: "전체"
1101
1050
  }
1102
1051
  ),
@@ -1104,8 +1053,8 @@ function Be({ ia: e }) {
1104
1053
  "button",
1105
1054
  {
1106
1055
  type: "button",
1107
- className: r === "section" ? "pbu-on" : "",
1108
- onClick: () => a("section"),
1056
+ className: o === "section" ? "pbu-on" : "",
1057
+ onClick: () => l("section"),
1109
1058
  children: "섹션"
1110
1059
  }
1111
1060
  ),
@@ -1113,143 +1062,143 @@ function Be({ ia: e }) {
1113
1062
  "button",
1114
1063
  {
1115
1064
  type: "button",
1116
- className: r === "unit" ? "pbu-on" : "",
1117
- onClick: () => a("unit"),
1065
+ className: o === "unit" ? "pbu-on" : "",
1066
+ onClick: () => l("unit"),
1118
1067
  children: "유닛"
1119
1068
  }
1120
1069
  )
1121
1070
  ] }),
1122
- /* @__PURE__ */ u("label", { className: "pbu-toggle", children: [
1071
+ /* @__PURE__ */ d("label", { className: "pbu-toggle", children: [
1123
1072
  /* @__PURE__ */ n(
1124
1073
  "input",
1125
1074
  {
1126
1075
  type: "checkbox",
1127
- checked: c,
1076
+ checked: a,
1128
1077
  onChange: (g) => i(g.target.checked)
1129
1078
  }
1130
1079
  ),
1131
1080
  "검사 모드"
1132
1081
  ] }),
1133
- /* @__PURE__ */ n("button", { type: "button", className: "pbu-btn", onClick: l, children: "🧰 스킬함" }),
1134
- /* @__PURE__ */ n("button", { type: "button", className: "pbu-icon-btn", onClick: o, "aria-label": "닫기", children: "✕" })
1082
+ /* @__PURE__ */ n("button", { type: "button", className: "pbu-btn", onClick: c, children: "🧰 스킬함" }),
1083
+ /* @__PURE__ */ n("button", { type: "button", className: "pbu-icon-btn", onClick: r, "aria-label": "닫기", children: "✕" })
1135
1084
  ] }),
1136
- /* @__PURE__ */ u("div", { className: "pbu-viewer-body", children: [
1085
+ /* @__PURE__ */ d("div", { className: "pbu-viewer-body", children: [
1137
1086
  /* @__PURE__ */ n("div", { className: "pbu-viewer-frame-wrap", children: /* @__PURE__ */ n(
1138
1087
  "iframe",
1139
1088
  {
1140
- ref: p,
1089
+ ref: h,
1141
1090
  className: "pbu-viewer-iframe",
1142
1091
  src: v.path,
1143
1092
  title: v.title,
1144
1093
  onLoad: N
1145
1094
  }
1146
1095
  ) }),
1147
- /* @__PURE__ */ n(He, {})
1096
+ /* @__PURE__ */ n(De, {})
1148
1097
  ] })
1149
1098
  ] }) : null;
1150
1099
  }
1151
- const je = {
1100
+ const Ae = {
1152
1101
  project: "프로젝트",
1153
1102
  global: "글로벌",
1154
1103
  uploaded: "업로드"
1155
- }, Ue = ["project", "global", "uploaded"];
1156
- function Fe() {
1157
- const e = y((h) => h.toggleSkillDrawer), t = oe(Y), [o, r] = _(!0), [a, c] = _(!1), [i, l] = _([]), [p, s] = _(null), [x, f] = _(""), [v, N] = _(!1), [g, S] = _(null), [C, L] = _(!1), R = $(null), M = $(0), [T, O] = _(null), P = async () => {
1158
- const h = ++M.current;
1159
- r(!0), S(null);
1104
+ }, He = ["project", "global", "uploaded"];
1105
+ function Be() {
1106
+ const e = y((b) => b.toggleSkillDrawer), t = te(Y), [r, o] = _(!0), [l, a] = _(!1), [i, c] = _([]), [h, u] = _(null), [w, f] = _(""), [v, N] = _(!1), [g, E] = _(null), [S, L] = _(!1), I = D(null), M = D(0), [T, O] = _(null), P = async () => {
1107
+ const b = ++M.current;
1108
+ o(!0), E(null);
1160
1109
  try {
1161
- const w = await t.isAlive();
1162
- if (h !== M.current || (c(w), !w)) return;
1163
- const [d, z] = await Promise.all([t.listSkills(), t.tokenStatus()]);
1164
- if (h !== M.current) return;
1165
- l(d), s(z), N(!z.configured);
1166
- } catch (w) {
1167
- if (h !== M.current) return;
1168
- S(w instanceof Error ? w.message : String(w));
1110
+ const x = await t.isAlive();
1111
+ if (b !== M.current || (a(x), !x)) return;
1112
+ const [s, C] = await Promise.all([t.listSkills(), t.tokenStatus()]);
1113
+ if (b !== M.current) return;
1114
+ c(s), u(C), N(!C.configured);
1115
+ } catch (x) {
1116
+ if (b !== M.current) return;
1117
+ E(x instanceof Error ? x.message : String(x));
1169
1118
  } finally {
1170
- h === M.current && r(!1);
1119
+ b === M.current && o(!1);
1171
1120
  }
1172
1121
  };
1173
- I(() => {
1122
+ R(() => {
1174
1123
  P();
1175
- }, []), I(() => {
1176
- const h = (w) => {
1177
- w.key === "Escape" && e();
1124
+ }, []), R(() => {
1125
+ const b = (x) => {
1126
+ x.key === "Escape" && e();
1178
1127
  };
1179
- return window.addEventListener("keydown", h), () => window.removeEventListener("keydown", h);
1128
+ return window.addEventListener("keydown", b), () => window.removeEventListener("keydown", b);
1180
1129
  }, [e]);
1181
- const b = async (h, w) => {
1130
+ const p = async (b, x) => {
1182
1131
  if (!T) {
1183
- O(h);
1132
+ O(b);
1184
1133
  try {
1185
- await w();
1186
- } catch (d) {
1187
- S(d instanceof Error ? d.message : String(d));
1134
+ await x();
1135
+ } catch (s) {
1136
+ E(s instanceof Error ? s.message : String(s));
1188
1137
  } finally {
1189
1138
  O(null);
1190
1139
  }
1191
1140
  }
1192
- }, k = (h, w) => b(`toggle:${h}`, async () => {
1193
- await t.toggleSkill(h, w), await P();
1194
- }), m = (h, w) => {
1195
- window.confirm(`"${w}" 스킬을 삭제할까요?`) && b(`remove:${h}`, async () => {
1196
- await t.removeSkill(h), await P();
1141
+ }, k = (b, x) => p(`toggle:${b}`, async () => {
1142
+ await t.toggleSkill(b, x), await P();
1143
+ }), m = (b, x) => {
1144
+ window.confirm(`"${x}" 스킬을 삭제할까요?`) && p(`remove:${b}`, async () => {
1145
+ await t.removeSkill(b), await P();
1197
1146
  });
1198
- }, E = () => R.current?.click(), A = (h) => {
1199
- const w = h.target.files?.[0];
1200
- h.target.value = "", w && b("upload", async () => {
1201
- const d = new FileReader(), z = await new Promise((D, ae) => {
1202
- d.onload = () => D(String(d.result ?? "")), d.onerror = () => ae(d.error ?? new Error("파일을 읽을 수 없어요")), d.readAsText(w);
1147
+ }, z = () => I.current?.click(), A = (b) => {
1148
+ const x = b.target.files?.[0];
1149
+ b.target.value = "", x && p("upload", async () => {
1150
+ const s = new FileReader(), C = await new Promise(($, le) => {
1151
+ s.onload = () => $(String(s.result ?? "")), s.onerror = () => le(s.error ?? new Error("파일을 읽을 수 없어요")), s.readAsText(x);
1203
1152
  });
1204
- await t.uploadSkill(w.name, z), await P();
1153
+ await t.uploadSkill(x.name, C), await P();
1205
1154
  });
1206
- }, U = () => b("token:save", async () => {
1207
- x.trim() && (await t.saveToken(x.trim()), f(""), await P());
1208
- }), F = () => b("token:delete", async () => {
1155
+ }, F = () => p("token:save", async () => {
1156
+ w.trim() && (await t.saveToken(w.trim()), f(""), await P());
1157
+ }), U = () => p("token:delete", async () => {
1209
1158
  await t.deleteToken(), f(""), await P();
1210
1159
  }), q = async () => {
1211
1160
  await navigator.clipboard.writeText("npx pubuilder serve"), L(!0), setTimeout(() => L(!1), 1200);
1212
- }, H = Ue.map((h) => ({
1213
- source: h,
1214
- label: je[h],
1215
- items: i.filter((w) => w.source === h)
1216
- })).filter((h) => h.items.length > 0);
1217
- return /* @__PURE__ */ u("aside", { className: "pbu-drawer", children: [
1218
- /* @__PURE__ */ u("div", { className: "pbu-drawer-header", children: [
1161
+ }, H = He.map((b) => ({
1162
+ source: b,
1163
+ label: Ae[b],
1164
+ items: i.filter((x) => x.source === b)
1165
+ })).filter((b) => b.items.length > 0);
1166
+ return /* @__PURE__ */ d("aside", { className: "pbu-drawer", children: [
1167
+ /* @__PURE__ */ d("div", { className: "pbu-drawer-header", children: [
1219
1168
  /* @__PURE__ */ n("span", { className: "pbu-panel-title", children: "스킬함" }),
1220
1169
  /* @__PURE__ */ n("button", { type: "button", className: "pbu-icon-btn", onClick: e, "aria-label": "닫기", children: "✕" })
1221
1170
  ] }),
1222
- g && /* @__PURE__ */ u("div", { className: "pbu-drawer-error", children: [
1171
+ g && /* @__PURE__ */ d("div", { className: "pbu-drawer-error", children: [
1223
1172
  /* @__PURE__ */ n("span", { children: g }),
1224
- /* @__PURE__ */ n("button", { type: "button", className: "pbu-icon-btn", onClick: () => S(null), "aria-label": "닫기", children: "✕" })
1173
+ /* @__PURE__ */ n("button", { type: "button", className: "pbu-icon-btn", onClick: () => E(null), "aria-label": "닫기", children: "✕" })
1225
1174
  ] }),
1226
- o ? /* @__PURE__ */ n("div", { className: "pbu-panel-empty", children: "불러오는 중..." }) : a ? /* @__PURE__ */ u(te, { children: [
1175
+ r ? /* @__PURE__ */ n("div", { className: "pbu-panel-empty", children: "불러오는 중..." }) : l ? /* @__PURE__ */ d(ee, { children: [
1227
1176
  /* @__PURE__ */ n("div", { className: "pbu-drawer-group", children: "토큰" }),
1228
- p?.configured && !v ? /* @__PURE__ */ u("div", { className: "pbu-field", children: [
1229
- /* @__PURE__ */ n("span", { className: "pbu-token-masked", children: p.masked }),
1230
- /* @__PURE__ */ u("div", { children: [
1177
+ h?.configured && !v ? /* @__PURE__ */ d("div", { className: "pbu-field", children: [
1178
+ /* @__PURE__ */ n("span", { className: "pbu-token-masked", children: h.masked }),
1179
+ /* @__PURE__ */ d("div", { children: [
1231
1180
  /* @__PURE__ */ n("button", { type: "button", className: "pbu-btn", disabled: T !== null, onClick: () => N(!0), children: "재입력" }),
1232
- /* @__PURE__ */ n("button", { type: "button", className: "pbu-btn", disabled: T !== null, onClick: F, children: "삭제" })
1181
+ /* @__PURE__ */ n("button", { type: "button", className: "pbu-btn", disabled: T !== null, onClick: U, children: "삭제" })
1233
1182
  ] })
1234
- ] }) : /* @__PURE__ */ u("div", { className: "pbu-field", children: [
1183
+ ] }) : /* @__PURE__ */ d("div", { className: "pbu-field", children: [
1235
1184
  /* @__PURE__ */ n(
1236
1185
  "input",
1237
1186
  {
1238
1187
  type: "password",
1239
- value: x,
1240
- onChange: (h) => f(h.target.value),
1188
+ value: w,
1189
+ onChange: (b) => f(b.target.value),
1241
1190
  placeholder: "Figma 토큰"
1242
1191
  }
1243
1192
  ),
1244
- /* @__PURE__ */ n("button", { type: "button", className: "pbu-btn pbu-btn-primary", disabled: T !== null, onClick: U, children: "저장" })
1193
+ /* @__PURE__ */ n("button", { type: "button", className: "pbu-btn pbu-btn-primary", disabled: T !== null, onClick: F, children: "저장" })
1245
1194
  ] }),
1246
- /* @__PURE__ */ u("div", { className: "pbu-drawer-group", children: [
1195
+ /* @__PURE__ */ d("div", { className: "pbu-drawer-group", children: [
1247
1196
  "스킬 목록",
1248
- /* @__PURE__ */ n("button", { type: "button", className: "pbu-btn", disabled: T !== null, onClick: E, children: "업로드" }),
1197
+ /* @__PURE__ */ n("button", { type: "button", className: "pbu-btn", disabled: T !== null, onClick: z, children: "업로드" }),
1249
1198
  /* @__PURE__ */ n(
1250
1199
  "input",
1251
1200
  {
1252
- ref: R,
1201
+ ref: I,
1253
1202
  type: "file",
1254
1203
  accept: ".md",
1255
1204
  style: { display: "none" },
@@ -1257,63 +1206,63 @@ function Fe() {
1257
1206
  }
1258
1207
  )
1259
1208
  ] }),
1260
- H.length === 0 ? /* @__PURE__ */ n("div", { className: "pbu-panel-empty", children: "등록된 스킬이 없어요." }) : H.map((h) => /* @__PURE__ */ u("div", { children: [
1261
- /* @__PURE__ */ n("div", { className: "pbu-drawer-group", children: h.label }),
1262
- h.items.map((w) => /* @__PURE__ */ u("div", { className: "pbu-skill-row", children: [
1263
- /* @__PURE__ */ u("label", { className: "pbu-toggle", children: [
1209
+ H.length === 0 ? /* @__PURE__ */ n("div", { className: "pbu-panel-empty", children: "등록된 스킬이 없어요." }) : H.map((b) => /* @__PURE__ */ d("div", { children: [
1210
+ /* @__PURE__ */ n("div", { className: "pbu-drawer-group", children: b.label }),
1211
+ b.items.map((x) => /* @__PURE__ */ d("div", { className: "pbu-skill-row", children: [
1212
+ /* @__PURE__ */ d("label", { className: "pbu-toggle", children: [
1264
1213
  /* @__PURE__ */ n(
1265
1214
  "input",
1266
1215
  {
1267
1216
  type: "checkbox",
1268
- checked: w.enabled,
1217
+ checked: x.enabled,
1269
1218
  disabled: T !== null,
1270
- onChange: (d) => k(w.id, d.target.checked)
1219
+ onChange: (s) => k(x.id, s.target.checked)
1271
1220
  }
1272
1221
  ),
1273
- w.name
1222
+ x.name
1274
1223
  ] }),
1275
- /* @__PURE__ */ n("span", { className: "pbu-hint", title: w.description, children: w.description }),
1276
- w.source === "uploaded" && /* @__PURE__ */ n(
1224
+ /* @__PURE__ */ n("span", { className: "pbu-hint", title: x.description, children: x.description }),
1225
+ x.source === "uploaded" && /* @__PURE__ */ n(
1277
1226
  "button",
1278
1227
  {
1279
1228
  type: "button",
1280
1229
  className: "pbu-icon-btn",
1281
1230
  disabled: T !== null,
1282
- onClick: () => m(w.id, w.name),
1231
+ onClick: () => m(x.id, x.name),
1283
1232
  "aria-label": "삭제",
1284
1233
  children: "🗑"
1285
1234
  }
1286
1235
  )
1287
- ] }, w.id))
1288
- ] }, h.source))
1289
- ] }) : /* @__PURE__ */ u("div", { className: "pbu-panel-empty", children: [
1236
+ ] }, x.id))
1237
+ ] }, b.source))
1238
+ ] }) : /* @__PURE__ */ d("div", { className: "pbu-panel-empty", children: [
1290
1239
  "컴패니언 서버가 꺼져 있어요",
1291
- /* @__PURE__ */ u("div", { className: "pbu-drawer-code", children: [
1240
+ /* @__PURE__ */ d("div", { className: "pbu-drawer-code", children: [
1292
1241
  /* @__PURE__ */ n("code", { children: "npx pubuilder serve" }),
1293
- /* @__PURE__ */ n("button", { type: "button", className: "pbu-btn", onClick: q, children: C ? "복사됨 ✓" : "복사" })
1242
+ /* @__PURE__ */ n("button", { type: "button", className: "pbu-btn", onClick: q, children: S ? "복사됨 ✓" : "복사" })
1294
1243
  ] }),
1295
1244
  /* @__PURE__ */ n("div", { className: "pbu-hint", children: 'package.json의 dev 스크립트를 "pubuilder dev -- <기존 명령>"으로 감싸면 자동 실행돼요' }),
1296
1245
  /* @__PURE__ */ n("button", { type: "button", className: "pbu-btn", onClick: P, children: "다시 확인" })
1297
1246
  ] })
1298
1247
  ] });
1299
1248
  }
1300
- function Xe({ config: e, enabled: t = !0, serverUrl: o }) {
1301
- const r = t && !xe(), [a, c] = _(!1), i = y((f) => f.isMapOpen), l = y((f) => f.viewerPath), p = y((f) => f.skillDrawerOpen), s = G(() => ge(e), [e]), x = G(() => new ne(o), [o]);
1302
- return se(() => {
1303
- r && window.self === window.top && (ke(), c(!0));
1304
- }, [r]), !a || !r ? null : de(
1305
- /* @__PURE__ */ u(Y.Provider, { value: x, children: [
1306
- /* @__PURE__ */ n(Ce, {}),
1307
- i && /* @__PURE__ */ n(Se, { ia: s }),
1308
- l && /* @__PURE__ */ n(Be, { ia: s }),
1309
- p && /* @__PURE__ */ n(Fe, {})
1249
+ function We({ config: e, enabled: t = !0, serverUrl: r }) {
1250
+ const o = t && !fe(), [l, a] = _(!1), i = y((f) => f.isMapOpen), c = y((f) => f.viewerPath), h = y((f) => f.skillDrawerOpen), u = V(() => de(e), [e]), w = V(() => new re(r), [r]);
1251
+ return ie(() => {
1252
+ o && window.self === window.top && (we(), a(!0));
1253
+ }, [o]), !l || !o ? null : se(
1254
+ /* @__PURE__ */ d(Y.Provider, { value: w, children: [
1255
+ /* @__PURE__ */ n(ze, {}),
1256
+ i && /* @__PURE__ */ n(Ne, { ia: u }),
1257
+ c && /* @__PURE__ */ n($e, { ia: u }),
1258
+ h && /* @__PURE__ */ n(Be, {})
1310
1259
  ] }),
1311
1260
  document.body
1312
1261
  );
1313
1262
  }
1314
1263
  export {
1315
- Xe as PageMap,
1316
- Je as defineIA,
1317
- ge as normalizeIA
1264
+ We as PageMap,
1265
+ Xe as defineIA,
1266
+ de as normalizeIA
1318
1267
  };
1319
1268
  //# sourceMappingURL=index.js.map