@xtrable-ltd/nanoesis 0.1.11 → 0.1.13

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.
Files changed (29) hide show
  1. package/dist/adapter-azure-blob.js +1 -1
  2. package/dist/{chunk-XO3CT6GL.js → chunk-7TB5ANIS.js} +58 -4
  3. package/dist/chunk-LXNOLO66.js +1224 -0
  4. package/dist/editor-api.js +21 -1198
  5. package/dist/index.d.ts +50 -12
  6. package/dist/index.js +1 -1
  7. package/dist/mcp.d.ts +48 -0
  8. package/dist/mcp.js +76 -0
  9. package/editor/assets/{MigrationsPane-BYGqWBAA.js → MigrationsPane-BnVflp7I.js} +1 -1
  10. package/editor/assets/{TemplatesPane-B5hn_v0Z.js → TemplatesPane-DPcXg8ZA.js} +12 -8
  11. package/editor/assets/{cssMode-BbIf5k6I.js → cssMode-CA8TzUhD.js} +1 -1
  12. package/editor/assets/{freemarker2-DoW0pSYV.js → freemarker2-BVvYxc4P.js} +1 -1
  13. package/editor/assets/{handlebars-DLlET-qc.js → handlebars-mDJMZKVv.js} +1 -1
  14. package/editor/assets/{html-4khbqrhe.js → html-D6Gw0A_W.js} +1 -1
  15. package/editor/assets/{htmlMode-DblHkZ-k.js → htmlMode-BD8QBoPu.js} +1 -1
  16. package/editor/assets/index-DAuQQi22.js +138 -0
  17. package/editor/assets/{javascript-CgPO2Hmj.js → javascript-CT1GQ3oq.js} +1 -1
  18. package/editor/assets/{jsonMode-BrWh2436.js → jsonMode-CBS8chp_.js} +1 -1
  19. package/editor/assets/{liquid-BsQJXwPT.js → liquid-BywhH4Kg.js} +1 -1
  20. package/editor/assets/{mdx-AO8t67gx.js → mdx-VnQOs-88.js} +1 -1
  21. package/editor/assets/{python-3w4sZj5c.js → python-vRZdM7SD.js} +1 -1
  22. package/editor/assets/{razor-BFsvo06w.js → razor--qLVVNOO.js} +1 -1
  23. package/editor/assets/{tsMode-QrC4ERjp.js → tsMode-CLwp9V4R.js} +1 -1
  24. package/editor/assets/{typescript-BXJ3QLad.js → typescript-DUO5mANL.js} +1 -1
  25. package/editor/assets/{xml-CxKYn1FP.js → xml-CcxvqYR1.js} +1 -1
  26. package/editor/assets/{yaml-BmWLvF7Q.js → yaml-BpCmDgZz.js} +1 -1
  27. package/editor/index.html +1 -1
  28. package/package.json +7 -1
  29. package/editor/assets/index-Do1drqEQ.js +0 -138
package/dist/index.d.ts CHANGED
@@ -18,6 +18,38 @@ declare function humanize(name: string): string;
18
18
  /** Best-effort content type from a path's extension; defaults to octet-stream. */
19
19
  declare function contentTypeFor(path: string): string;
20
20
 
21
+ /** Thrown when raw content JSON cannot be coerced into a {@link ContentItem}. */
22
+ declare class ContentParseError extends Error {
23
+ constructor(message: string);
24
+ }
25
+ /**
26
+ * Parse-time diagnostics that survive into the validation gate. Distinct from
27
+ * {@link ContentParseError} (which signals a *malformed* file) — diagnostics describe
28
+ * a successfully parsed item that nonetheless carried something the parser dropped.
29
+ */
30
+ interface ContentParseDiagnostics {
31
+ /**
32
+ * Top-level keys present in the JSON but not recognised by the parser. Sorted for
33
+ * deterministic message ordering. Empty when the file is clean. Typical cause: an
34
+ * author (especially an LLM) wrote a content field (`body`, `tagline`, ...) at the
35
+ * top level instead of nesting it under `fields`, or typo'd a system key
36
+ * (`IsPublished` instead of `isPublished`).
37
+ */
38
+ readonly unknownTopLevelKeys: readonly string[];
39
+ }
40
+ /**
41
+ * Validate untrusted content JSON into a typed {@link ContentItem}, the single
42
+ * boundary where content data is checked (CLAUDE.md §4). Tolerant of drift
43
+ * (unknown keys ignored, missing isPublished/fields defaulted; DESIGN §5.4) but
44
+ * strict on the system keys that carry meaning.
45
+ *
46
+ * The thin wrapper around {@link parseContentItemWithDiagnostics} for the call
47
+ * sites that don't need to know what the parser dropped (the editor, tests, …).
48
+ * The validation gate uses the diagnostics-returning variant so it can warn about
49
+ * silent drops (e.g. `body` written at the top level instead of under `fields`).
50
+ */
51
+ declare function parseContentItem(raw: unknown): ContentItem;
52
+
21
53
  /**
22
54
  * The content model (DESIGN §5). Content JSON is *pure data*: a value's type
23
55
  * comes from the template, never from the file, so these types model only the
@@ -75,6 +107,14 @@ interface ItemNode {
75
107
  /** Content path from the root, e.g. "blog/going-static". */
76
108
  readonly path: string;
77
109
  readonly item: ContentItem;
110
+ /**
111
+ * What the parser dropped while reading this item (DESIGN §5.4 tolerance). Optional
112
+ * because not every ItemNode goes through the diagnostics-returning parser (compile
113
+ * tests construct nodes directly). The validation gate uses this to surface
114
+ * `content.unknown-top-level-key` warnings rather than letting `body`-outside-`fields`
115
+ * silently ship an empty page.
116
+ */
117
+ readonly parseDiagnostics?: ContentParseDiagnostics;
78
118
  }
79
119
  /** A directory in the tree; the file/folder layout *is* the site structure. */
80
120
  interface DirNode {
@@ -92,18 +132,6 @@ interface DirNode {
92
132
  }
93
133
  type TreeNode = DirNode | ItemNode;
94
134
 
95
- /** Thrown when raw content JSON cannot be coerced into a {@link ContentItem}. */
96
- declare class ContentParseError extends Error {
97
- constructor(message: string);
98
- }
99
- /**
100
- * Validate untrusted content JSON into a typed {@link ContentItem}, the single
101
- * boundary where content data is checked (CLAUDE.md §4). Tolerant of drift
102
- * (unknown keys ignored, missing isPublished/fields defaulted; DESIGN §5.4) but
103
- * strict on the system keys that carry meaning.
104
- */
105
- declare function parseContentItem(raw: unknown): ContentItem;
106
-
107
135
  /**
108
136
  * Parse a directory's sort file (DESIGN §5.2). Deliberately tolerant: a stale or
109
137
  * malformed sort file never blocks a publish, it just falls back to defaults.
@@ -653,6 +681,16 @@ interface WriteResult {
653
681
  * stamp banner.
654
682
  */
655
683
  readonly schemaDelta?: SchemaDelta;
684
+ /**
685
+ * Parse diagnostics for content writes (smoke test 2026-05-29 silent-drop fix).
686
+ * Present only for `content/*.json` writes whose JSON parsed successfully but
687
+ * carried top-level keys the parser dropped (e.g. `body` written outside
688
+ * `fields`). Undefined when the write is not a content item, parsing threw, or
689
+ * everything was recognised. MCP `write_file` surfaces this immediately so an
690
+ * LLM author sees the silent-drop the moment it happens rather than discovering
691
+ * empty rendered pages later.
692
+ */
693
+ readonly parseDiagnostics?: ContentParseDiagnostics;
656
694
  }
657
695
  /**
658
696
  * The editor's working store (DESIGN §11c): a read {@link ContentSource} for
package/dist/index.js CHANGED
@@ -75,7 +75,7 @@ import {
75
75
  versionNumber,
76
76
  wholeValueToken,
77
77
  workingStoreRoundTripDiagnostic
78
- } from "./chunk-XO3CT6GL.js";
78
+ } from "./chunk-7TB5ANIS.js";
79
79
  export {
80
80
  ContentParseError,
81
81
  DEFAULT_DIRS,
package/dist/mcp.d.ts ADDED
@@ -0,0 +1,48 @@
1
+ import { ApiDeps } from '@nanoesis/editor-api';
2
+
3
+ /**
4
+ * Identity reported to MCP clients on `initialize`. Defaults: `{ name: 'nanoesis', version:
5
+ * '0.0.0' }`. Adopters embedding the HTTP route in their own host typically override `name`
6
+ * with their site identifier and `version` with their app version so client UIs identify
7
+ * the deployment, not the framework.
8
+ */
9
+ interface McpServerIdentity {
10
+ readonly name?: string;
11
+ readonly version?: string;
12
+ }
13
+
14
+ /**
15
+ * Options for {@link handleMcpRequest}. Both fields are passed straight through to the
16
+ * MCP `Server`'s `initialize` response so client UIs (Claude Desktop, Cursor, …) identify
17
+ * the deployment rather than the framework.
18
+ */
19
+ type HandleMcpRequestOptions = McpServerIdentity;
20
+ /**
21
+ * Handle a single MCP HTTP request over the SDK's web-standard Streamable HTTP transport
22
+ * (DESIGN §11c/§14). Stateless: each call builds a fresh `Server` + `Transport` pair, so
23
+ * the caller's per-request `Authorization: Bearer …` header — propagated by the SDK into
24
+ * the request handlers as `extra.requestInfo.headers` — drives the editor's per-user role
25
+ * gate exactly as `/api/*` does.
26
+ *
27
+ * The signature is Fetch-API neutral: any runtime that hands a handler a standard
28
+ * `Request` (Azure Functions v4, Cloudflare Workers, plain Node 18+, Bun, Deno, Hono)
29
+ * wires it the same way:
30
+ *
31
+ * ```ts
32
+ * import { handleMcpRequest } from '@xtrable-ltd/nanoesis/mcp';
33
+ * // ... build `deps` once at startup
34
+ * app.http('mcp', {
35
+ * methods: ['POST', 'GET', 'DELETE'],
36
+ * handler: (req) => handleMcpRequest(deps, req, { name: 'my-site', version: pkg.version }),
37
+ * });
38
+ * ```
39
+ *
40
+ * Runtimes whose request shape is not a standard `Request` (e.g. Azure Functions' enhanced
41
+ * HttpRequest, Express' IncomingMessage) translate to/from `Request`/`Response` at the
42
+ * boundary — that translation is adopter-side because it depends on the host runtime; the
43
+ * MCP server construction and transport handling, which used to be ~120 lines of inlined
44
+ * boilerplate per adopter, is now this one call.
45
+ */
46
+ declare function handleMcpRequest(deps: ApiDeps, request: Request, opts?: HandleMcpRequestOptions): Promise<Response>;
47
+
48
+ export { type HandleMcpRequestOptions, handleMcpRequest };
package/dist/mcp.js ADDED
@@ -0,0 +1,76 @@
1
+ import {
2
+ MCP_RESOURCES,
3
+ MCP_TOOLS,
4
+ callMcpTool,
5
+ readMcpResource
6
+ } from "./chunk-LXNOLO66.js";
7
+ import "./chunk-7TB5ANIS.js";
8
+
9
+ // ../../hosts/host-mcp/src/http.ts
10
+ import { WebStandardStreamableHTTPServerTransport } from "@modelcontextprotocol/sdk/server/webStandardStreamableHttp.js";
11
+
12
+ // ../../hosts/host-mcp/src/server.ts
13
+ import { Server } from "@modelcontextprotocol/sdk/server/index.js";
14
+ import {
15
+ CallToolRequestSchema,
16
+ ListResourcesRequestSchema,
17
+ ListToolsRequestSchema,
18
+ ReadResourceRequestSchema
19
+ } from "@modelcontextprotocol/sdk/types.js";
20
+ var BEARER_PREFIX = /^Bearer\s+/i;
21
+ function bearerFrom(headers) {
22
+ if (headers === void 0) return void 0;
23
+ const raw = headers["authorization"] ?? headers["Authorization"];
24
+ const value = Array.isArray(raw) ? raw[0] : raw;
25
+ if (value === void 0) return void 0;
26
+ const match = BEARER_PREFIX.exec(value);
27
+ return match ? value.slice(match[0].length).trim() : void 0;
28
+ }
29
+ function createMcpServer(deps, identity) {
30
+ const server = new Server(
31
+ { name: identity?.name ?? "nanoesis", version: identity?.version ?? "0.0.0" },
32
+ { capabilities: { tools: {}, resources: {} } }
33
+ );
34
+ server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: [...MCP_TOOLS] }));
35
+ server.setRequestHandler(CallToolRequestSchema, async (req, extra) => {
36
+ const args = req.params.arguments ?? {};
37
+ const token = bearerFrom(extra.requestInfo?.headers);
38
+ const result = await callMcpTool(
39
+ deps,
40
+ req.params.name,
41
+ args,
42
+ token !== void 0 ? { token } : {}
43
+ );
44
+ return { content: [{ type: "text", text: result.text }], isError: result.isError };
45
+ });
46
+ server.setRequestHandler(ListResourcesRequestSchema, async () => ({
47
+ resources: [...MCP_RESOURCES]
48
+ }));
49
+ server.setRequestHandler(ReadResourceRequestSchema, async (req) => {
50
+ const { uri } = req.params;
51
+ const resource = readMcpResource(uri);
52
+ if (resource === void 0) throw new Error(`Unknown resource: ${uri}`);
53
+ return { contents: [{ uri, mimeType: resource.mimeType, text: resource.text }] };
54
+ });
55
+ return server;
56
+ }
57
+
58
+ // ../../hosts/host-mcp/src/http.ts
59
+ var DEFAULT_VERSION = true ? "0.1.13" : "0.0.0-workspace";
60
+ async function handleMcpRequest(deps, request, opts) {
61
+ const server = createMcpServer(deps, {
62
+ name: opts?.name ?? "nanoesis",
63
+ version: opts?.version ?? DEFAULT_VERSION
64
+ });
65
+ const transport = new WebStandardStreamableHTTPServerTransport({ enableJsonResponse: true });
66
+ await server.connect(transport);
67
+ try {
68
+ return await transport.handleRequest(request);
69
+ } finally {
70
+ await transport.close();
71
+ await server.close();
72
+ }
73
+ }
74
+ export {
75
+ handleMcpRequest
76
+ };
@@ -1,4 +1,4 @@
1
- import{a3 as Ie,ao as F,a1 as Te,V as g,J as k,G as e,f as n,W as Ye,l as a,B as Q,ap as h,t as j,ak as o,E as _,ad as v,m as ze,y as U,s as He,g as Qe,au as Ue,ai as c,aq as W,ae as X,af as _e,K as Xe,ac as Ze,Y as ea}from"./index-Do1drqEQ.js";var aa=_('<p class="placeholder svelte-1lpfi31">Loading preview…</p>'),ta=_('<p class="error svelte-1lpfi31" role="alert"> </p>'),la=_("<option> </option>"),sa=_('<select class="svelte-1lpfi31"></select>'),ra=_('<li class="orphan svelte-1lpfi31"><div class="orphan-head svelte-1lpfi31"><code class="orphan-name svelte-1lpfi31"> </code> <span class="orphan-value svelte-1lpfi31"> </span></div> <div class="orphan-actions svelte-1lpfi31" role="radiogroup"><label class="svelte-1lpfi31"><input type="radio" value="drop"/> Drop</label> <label class="svelte-1lpfi31"><input type="radio" value="keep"/> Keep (unrendered)</label> <label class="svelte-1lpfi31"><input type="radio" value="rename"/> Rename to</label> <!></div></li>'),ia=_(`<section class="resolutions svelte-1lpfi31" aria-label="Orphan field resolutions"><h3 class="svelte-1lpfi31">Orphan fields</h3> <p class="hint svelte-1lpfi31">These fields exist in this item's JSON but the current template doesn't render them.
1
+ import{a3 as Ie,ao as F,a1 as Te,V as g,J as k,G as e,f as n,W as Ye,l as a,B as Q,ap as h,t as j,ak as o,E as _,ad as v,m as ze,y as U,s as He,g as Qe,au as Ue,ai as c,aq as W,ae as X,af as _e,K as Xe,ac as Ze,Y as ea}from"./index-DAuQQi22.js";var aa=_('<p class="placeholder svelte-1lpfi31">Loading preview…</p>'),ta=_('<p class="error svelte-1lpfi31" role="alert"> </p>'),la=_("<option> </option>"),sa=_('<select class="svelte-1lpfi31"></select>'),ra=_('<li class="orphan svelte-1lpfi31"><div class="orphan-head svelte-1lpfi31"><code class="orphan-name svelte-1lpfi31"> </code> <span class="orphan-value svelte-1lpfi31"> </span></div> <div class="orphan-actions svelte-1lpfi31" role="radiogroup"><label class="svelte-1lpfi31"><input type="radio" value="drop"/> Drop</label> <label class="svelte-1lpfi31"><input type="radio" value="keep"/> Keep (unrendered)</label> <label class="svelte-1lpfi31"><input type="radio" value="rename"/> Rename to</label> <!></div></li>'),ia=_(`<section class="resolutions svelte-1lpfi31" aria-label="Orphan field resolutions"><h3 class="svelte-1lpfi31">Orphan fields</h3> <p class="hint svelte-1lpfi31">These fields exist in this item's JSON but the current template doesn't render them.
2
2
  Pick what to do with each.</p> <ul class="orphans svelte-1lpfi31"></ul></section>`),na=_('<p class="error svelte-1lpfi31" role="alert"> </p>'),oa=_('<div class="diff svelte-1lpfi31"><section class="pane svelte-1lpfi31" aria-label="Previous version (left)"><header class="pane-head svelte-1lpfi31"><!></header> <pre class="source svelte-1lpfi31"> </pre></section> <section class="pane svelte-1lpfi31" aria-label="Current template (right)"><header class="pane-head svelte-1lpfi31"> </header> <pre class="source svelte-1lpfi31"> </pre></section></div> <!> <!> <div class="commit-bar svelte-1lpfi31"><button type="button" class="primary svelte-1lpfi31"> </button></div>',1),va=_('<header class="detail-head svelte-1lpfi31"><button type="button" class="back svelte-1lpfi31">← Back</button> <h2 class="svelte-1lpfi31"> </h2></header> <!>',1),pa=_('<p class="error svelte-1lpfi31" role="alert"> </p>'),ca=_('<p class="placeholder svelte-1lpfi31">Loading…</p>'),fa=_(`<div class="empty svelte-1lpfi31"><h3 class="svelte-1lpfi31">All caught up</h3> <p>Every content item's fields match its bound template. Migrations show up here when a
3
3
  destructive template edit (or a manual hand-edit) leaves an item with orphan fields.</p></div>`),da=_('<li class="item"><button class="item-row svelte-1lpfi31" type="button"><span class="item-path svelte-1lpfi31"><code> </code></span> <span class="item-summary svelte-1lpfi31"><!> <!> <!></span> <span class="open-icon svelte-1lpfi31">→</span></button></li>'),ua=_('<section class="group svelte-1lpfi31"><h3 class="group-title svelte-1lpfi31"><code class="svelte-1lpfi31"> </code> <span class="count svelte-1lpfi31"> </span></h3> <ul class="items svelte-1lpfi31"></ul></section>'),ma=_('<header class="list-head svelte-1lpfi31"><h2>Migrations</h2> <button type="button" class="svelte-1lpfi31"> </button></header> <!>',1),_a=_('<div class="migrations svelte-1lpfi31"><!> <!></div>');function ga(Ee,Le){Ie(Le,!0);let M=F(null),d=F(null),Z=F(!1),R=F(null),r=F(Te({})),he=F(Te({})),A=F(!1),K=F(null);g.ensureLoaded();async function Re(s){v(M,s,!0),v(r,{},!0),v(he,{},!0),v(d,null),v(R,null),v(Z,!0);try{v(d,await ea(s),!0);const f={};for(const l of e(d).orphans){const u=Se(l.name,e(d).currentTemplateFields);f[l.name]=u?{rename:u}:"keep"}v(r,f,!0)}catch(f){v(R,f instanceof Error?f.message:String(f),!0)}finally{v(Z,!1)}}function ge(){v(M,null),v(d,null),v(R,null)}function Se(s,f){const l=s.toLowerCase();for(const u of f)if(u.toLowerCase().startsWith(l)||u.toLowerCase().endsWith(l))return u;return null}async function Ce(){if(!(e(M)===null||e(d)===null)){v(A,!0),v(K,null);try{const s={drop:Object.entries(e(r)).filter(([,l])=>l==="drop").map(([l])=>l),keep:Object.entries(e(r)).filter(([,l])=>l==="keep").map(([l])=>l),rename:Object.fromEntries(Object.entries(e(r)).filter(([,l])=>typeof l=="object"&&l!==null&&"rename"in l).map(([l,u])=>[l,u.rename])),fill:{...e(he)}},f=await Qe(e(M),s);g.refresh().catch(()=>{}),ge()}catch(s){v(K,s instanceof Error?s.message:String(s),!0)}finally{v(A,!1)}}}function Pe(s){return typeof s=="string"?s:JSON.stringify(s)}const qe=Ue(()=>g.list===null?[]:Object.entries(g.list.byTemplate).map(([s,f])=>({template:s,items:[...f].sort((l,u)=>l.path.localeCompare(u.path))})));var be=_a(),ye=a(be);{var Be=s=>{var f=va(),l=Q(f),u=a(l),ee=o(u,2),ae=a(ee),te=o(l,2);{var le=i=>{var m=aa();n(i,m)},se=i=>{var m=ta(),w=a(m);h(()=>c(w,e(R))),n(i,m)},re=i=>{var m=oa(),w=Q(m),E=a(w),O=a(E),N=a(O);{var V=p=>{var y=W();h(()=>c(y,`Before — ${e(d).left.template??""}`)),n(p,y)},$=p=>{var y=W("Before — no snapshot available");n(p,y)};k(N,p=>{e(d).left?p(V):p($,-1)})}var ie=o(O,2),ne=a(ie),oe=o(E,2),D=a(oe),S=a(D),b=o(D,2),G=a(b),C=o(w,2);{var I=p=>{var y=ia(),P=o(a(y),4);U(P,21,()=>e(d).orphans,q=>q.name,(q,t)=>{var x=ra(),z=a(x),xe=a(z),Ke=a(xe),Ne=o(xe,2),Ve=a(Ne),ke=o(z,2),we=a(ke),fe=a(we),Fe=o(we,2),de=a(Fe),je=o(Fe,2),ue=a(je),$e=o(je,2);{var De=B=>{var T=sa();U(T,20,()=>e(d).currentTemplateFields,J=>J,(J,me)=>{var H=la(),Ge=a(H),Oe={};h(()=>{c(Ge,me),Oe!==(Oe=me)&&(H.value=(H.__value=me)??"")}),n(J,H)});var Me;Xe(T),h(()=>{Me!==(Me=e(r)[e(t).name].rename)&&(T.value=(T.__value=e(r)[e(t).name].rename)??"",Ze(T,e(r)[e(t).name].rename))}),j("change",T,J=>v(r,{...e(r),[e(t).name]:{rename:J.currentTarget.value}},!0)),n(B,T)};k($e,B=>{typeof e(r)[e(t).name]=="object"&&e(r)[e(t).name]!==null&&"rename"in e(r)[e(t).name]&&B(De)})}h(B=>{c(Ke,e(t).name),c(Ve,B),X(ke,"aria-label",`Resolution for ${e(t).name}`),X(fe,"name",`d-${e(t).name}`),_e(fe,e(r)[e(t).name]==="drop"),X(de,"name",`d-${e(t).name}`),_e(de,e(r)[e(t).name]==="keep"),X(ue,"name",`d-${e(t).name}`),_e(ue,typeof e(r)[e(t).name]=="object"&&e(r)[e(t).name]!==null&&"rename"in e(r)[e(t).name])},[()=>Pe(e(t).value)]),j("change",fe,()=>v(r,{...e(r),[e(t).name]:"drop"},!0)),j("change",de,()=>v(r,{...e(r),[e(t).name]:"keep"},!0)),j("change",ue,()=>v(r,{...e(r),[e(t).name]:{rename:e(d).currentTemplateFields[0]??""}},!0)),n(q,x)}),n(p,y)};k(C,p=>{e(d).orphans.length>0&&p(I)})}var Y=o(C,2);{var ve=p=>{var y=na(),P=a(y);h(()=>c(P,e(K))),n(p,y)};k(Y,p=>{e(K)&&p(ve)})}var pe=o(Y,2),L=a(pe),ce=a(L);h(()=>{var p;c(ne,((p=e(d).left)==null?void 0:p.html)??"(no snapshot covers this item)"),c(S,`After — ${e(d).right.template??""}`),c(G,e(d).right.html),L.disabled=e(A)||e(d).orphans.length===0,c(ce,e(A)?"Migrating…":"Migrate item")}),j("click",L,Ce),n(i,m)};k(te,i=>{e(Z)?i(le):e(R)?i(se,1):e(d)&&i(re,2)})}h(()=>c(ae,e(M))),j("click",u,ge),n(s,f)},Je=s=>{var f=ma(),l=Q(f),u=o(a(l),2),ee=a(u),ae=o(l,2);{var te=i=>{var m=pa(),w=a(m);h(()=>c(w,g.error)),n(i,m)},le=i=>{var m=ca();n(i,m)},se=i=>{var m=fa();n(i,m)},re=i=>{var m=ze(),w=Q(m);U(w,17,()=>e(qe),E=>E.template,(E,O)=>{var N=ua(),V=a(N),$=a(V),ie=a($),ne=o($,2),oe=a(ne),D=o(V,2);U(D,21,()=>e(O).items,S=>S.path,(S,b)=>{var G=da(),C=a(G),I=a(C),Y=a(I),ve=a(Y),pe=o(I,2),L=a(pe);{var ce=t=>{var x=W();h(z=>c(x,`${e(b).orphanFields.length??""} orphan field${e(b).orphanFields.length===1?"":"s"}:
4
4
  ${z??""}`),[()=>e(b).orphanFields.join(", ")]),n(t,x)};k(L,t=>{e(b).orphanFields.length>0&&t(ce)})}var p=o(L,2);{var y=t=>{var x=W();h(()=>c(x,`· ${e(b).missingRequiredFields.length??""} missing required`)),n(t,x)};k(p,t=>{e(b).missingRequiredFields.length>0&&t(y)})}var P=o(p,2);{var q=t=>{var x=W();h(()=>c(x,`· best-fit: ${e(b).bestFitSnapshot??""}`)),n(t,x)};k(P,t=>{e(b).bestFitSnapshot&&t(q)})}h(()=>c(ve,e(b).path)),j("click",C,()=>Re(e(b).path)),n(S,G)}),h(()=>{c(ie,e(O).template),c(oe,`${e(O).items.length??""} item${e(O).items.length===1?"":"s"}`)}),n(E,N)}),n(i,m)};k(ae,i=>{g.error?i(te):g.loading&&g.list===null?i(le,1):g.count===0?i(se,2):i(re,-1)})}h(()=>{u.disabled=g.loading,c(ee,g.loading?"Refreshing…":"Refresh")}),j("click",u,()=>g.refresh()),n(s,f)};k(ye,s=>{e(M)!==null?s(Be):s(Je,-1)})}var We=o(ye,2);{var Ae=s=>{};k(We,s=>{!e(M)&&g.list===null&&s(Ae)})}n(Ee,be),Ye()}He(["click","change"]);export{ga as default};