aub-workspace 0.3.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/LICENSE +201 -0
- package/README.md +23 -0
- package/bin/aub-workspace.mjs +246 -0
- package/package.json +32 -0
- package/vendor/aub/apps/editor/dist/assets/_commonjs-dynamic-modules-TDtrdbi3.js +1 -0
- package/vendor/aub/apps/editor/dist/assets/angular-importer.lib-dB_jK4mR.js +32 -0
- package/vendor/aub/apps/editor/dist/assets/canvas-tools-CuYC7cA2.js +364 -0
- package/vendor/aub/apps/editor/dist/assets/design-bridge.lib-DJvaK6AX.js +1 -0
- package/vendor/aub/apps/editor/dist/assets/export-agent-prompt.lib-BsP0KNqo.js +2 -0
- package/vendor/aub/apps/editor/dist/assets/export-md.lib-DdmdeWgO.js +3 -0
- package/vendor/aub/apps/editor/dist/assets/handoff-package.lib-DDYpcEma.js +20 -0
- package/vendor/aub/apps/editor/dist/assets/implementation-report.lib-CmsSB_8s.js +1 -0
- package/vendor/aub/apps/editor/dist/assets/index-BCH-ek3h.js +2 -0
- package/vendor/aub/apps/editor/dist/assets/index-lAnc928Q.css +1 -0
- package/vendor/aub/apps/editor/dist/assets/index-vt1nM1M4.js +507 -0
- package/vendor/aub/apps/editor/dist/assets/jszip.min-CRfXyL92.js +12 -0
- package/vendor/aub/apps/editor/dist/assets/react-vendor-ByX9Pqse.js +40 -0
- package/vendor/aub/apps/editor/dist/brand/android-chrome-192x192.png +0 -0
- package/vendor/aub/apps/editor/dist/brand/android-chrome-512x512.png +0 -0
- package/vendor/aub/apps/editor/dist/brand/app-icon-1024.png +0 -0
- package/vendor/aub/apps/editor/dist/brand/app-icon-192.png +0 -0
- package/vendor/aub/apps/editor/dist/brand/app-icon-512.png +0 -0
- package/vendor/aub/apps/editor/dist/brand/apple-touch-icon.png +0 -0
- package/vendor/aub/apps/editor/dist/brand/aub-logo-mark.svg +28 -0
- package/vendor/aub/apps/editor/dist/brand/favicon-16x16.png +0 -0
- package/vendor/aub/apps/editor/dist/brand/favicon-32x32.png +0 -0
- package/vendor/aub/apps/editor/dist/brand/favicon-48x48.png +0 -0
- package/vendor/aub/apps/editor/dist/brand/favicon.ico +0 -0
- package/vendor/aub/apps/editor/dist/brand/favicon.svg +9 -0
- package/vendor/aub/apps/editor/dist/brand/maskable-icon-512.png +0 -0
- package/vendor/aub/apps/editor/dist/brand/mstile-150x150.png +0 -0
- package/vendor/aub/apps/editor/dist/brand/safari-pinned-tab.svg +8 -0
- package/vendor/aub/apps/editor/dist/browserconfig.xml +9 -0
- package/vendor/aub/apps/editor/dist/index.html +22 -0
- package/vendor/aub/apps/editor/dist/manifest.webmanifest +28 -0
- package/vendor/aub/apps/editor/dist/template-previews/admin-table.png +0 -0
- package/vendor/aub/apps/editor/dist/template-previews/booking.png +0 -0
- package/vendor/aub/apps/editor/dist/template-previews/calendar.png +0 -0
- package/vendor/aub/apps/editor/dist/template-previews/catalog.png +0 -0
- package/vendor/aub/apps/editor/dist/template-previews/chat.png +0 -0
- package/vendor/aub/apps/editor/dist/template-previews/checkout.png +0 -0
- package/vendor/aub/apps/editor/dist/template-previews/crm.png +0 -0
- package/vendor/aub/apps/editor/dist/template-previews/dashboard.png +0 -0
- package/vendor/aub/apps/editor/dist/template-previews/feed.png +0 -0
- package/vendor/aub/apps/editor/dist/template-previews/files.png +0 -0
- package/vendor/aub/apps/editor/dist/template-previews/kanban.png +0 -0
- package/vendor/aub/apps/editor/dist/template-previews/landing.png +0 -0
- package/vendor/aub/apps/editor/dist/template-previews/mail.png +0 -0
- package/vendor/aub/apps/editor/dist/template-previews/onboarding.png +0 -0
- package/vendor/aub/apps/editor/dist/template-previews/pricing.png +0 -0
- package/vendor/aub/apps/editor/dist/template-previews/product-detail.png +0 -0
- package/vendor/aub/apps/editor/dist/template-previews/settings.png +0 -0
- package/vendor/aub/apps/editor/dist/template-previews/wiki.png +0 -0
- package/vendor/aub/apps/mcp-server/dist/aub.js +15 -0
- package/vendor/aub/apps/mcp-server/dist/context.js +1 -0
- package/vendor/aub/apps/mcp-server/dist/http.js +123 -0
- package/vendor/aub/apps/mcp-server/dist/index.js +23 -0
- package/vendor/aub/apps/mcp-server/dist/repo.js +17 -0
- package/vendor/aub/apps/mcp-server/dist/schema.js +42 -0
- package/vendor/aub/apps/mcp-server/dist/server.js +80 -0
- package/vendor/aub/apps/mcp-server/dist/tools/approve-component-candidate.js +27 -0
- package/vendor/aub/apps/mcp-server/dist/tools/diff-blueprints.js +27 -0
- package/vendor/aub/apps/mcp-server/dist/tools/export-handoff.js +87 -0
- package/vendor/aub/apps/mcp-server/dist/tools/export-prompt.js +35 -0
- package/vendor/aub/apps/mcp-server/dist/tools/export-template-authoring-prompt.js +13 -0
- package/vendor/aub/apps/mcp-server/dist/tools/generate-template-from-source.js +25 -0
- package/vendor/aub/apps/mcp-server/dist/tools/get-aub-session.js +13 -0
- package/vendor/aub/apps/mcp-server/dist/tools/get-blueprint.js +28 -0
- package/vendor/aub/apps/mcp-server/dist/tools/get-project.js +45 -0
- package/vendor/aub/apps/mcp-server/dist/tools/get-workspace-status.js +10 -0
- package/vendor/aub/apps/mcp-server/dist/tools/import-design-bridge.js +62 -0
- package/vendor/aub/apps/mcp-server/dist/tools/list-blueprints.js +11 -0
- package/vendor/aub/apps/mcp-server/dist/tools/list-projects.js +11 -0
- package/vendor/aub/apps/mcp-server/dist/tools/lock-blueprint.js +33 -0
- package/vendor/aub/apps/mcp-server/dist/tools/migrate-blueprint.js +38 -0
- package/vendor/aub/apps/mcp-server/dist/tools/resolve-component.js +51 -0
- package/vendor/aub/apps/mcp-server/dist/tools/scaffold-blueprint.js +53 -0
- package/vendor/aub/apps/mcp-server/dist/tools/scan-project-ui.js +18 -0
- package/vendor/aub/apps/mcp-server/dist/tools/submit-report.js +48 -0
- package/vendor/aub/apps/mcp-server/dist/tools/update-aub-session.js +14 -0
- package/vendor/aub/apps/mcp-server/dist/tools/validate-blueprint.js +67 -0
- package/vendor/aub/apps/mcp-server/dist/tools/validate-project.js +74 -0
- package/vendor/aub/apps/mcp-server/dist/tools/write-blueprint.js +72 -0
- package/vendor/aub/apps/mcp-server/dist/workspace.js +138 -0
- package/vendor/aub/docs/agent-handoff.md +85 -0
- package/vendor/aub/docs/agent-handoff.zh-Hant.md +85 -0
- package/vendor/aub/docs/template-authoring-agent.md +86 -0
- package/vendor/aub/schema/aub-ci.schema.json +34 -0
- package/vendor/aub/schema/aub.registry.schema.json +118 -0
- package/vendor/aub/schema/design-bridge.schema.json +44 -0
- package/vendor/aub/schema/implementation-report.schema.json +93 -0
- package/vendor/aub/schema/project-types.ts +72 -0
- package/vendor/aub/schema/registry/components.json +118 -0
- package/vendor/aub/schema/types.js +13 -0
- package/vendor/aub/schema/types.ts +348 -0
- package/vendor/aub/schema/ui-blueprint-lock.schema.json +61 -0
- package/vendor/aub/schema/ui-blueprint.schema.json +1339 -0
- package/vendor/aub/schema/ui-project.schema.json +139 -0
- package/vendor/aub/scripts/agent-implementation-benchmark.lib.mjs +125 -0
- package/vendor/aub/scripts/angular-importer.lib.mjs +982 -0
- package/vendor/aub/scripts/check-editor-bundle-budget.mjs +36 -0
- package/vendor/aub/scripts/ci-verify.lib.mjs +256 -0
- package/vendor/aub/scripts/ci-verify.mjs +45 -0
- package/vendor/aub/scripts/create-authoring-kit.mjs +84 -0
- package/vendor/aub/scripts/create-implementation-report.mjs +24 -0
- package/vendor/aub/scripts/design-bridge.lib.d.mts +32 -0
- package/vendor/aub/scripts/design-bridge.lib.mjs +69 -0
- package/vendor/aub/scripts/diff-blueprint.lib.d.mts +18 -0
- package/vendor/aub/scripts/diff-blueprint.lib.mjs +148 -0
- package/vendor/aub/scripts/diff-blueprint.mjs +25 -0
- package/vendor/aub/scripts/export-agent-prompt.lib.d.mts +10 -0
- package/vendor/aub/scripts/export-agent-prompt.lib.mjs +160 -0
- package/vendor/aub/scripts/export-agent-prompt.mjs +79 -0
- package/vendor/aub/scripts/export-md.lib.d.mts +3 -0
- package/vendor/aub/scripts/export-md.lib.mjs +302 -0
- package/vendor/aub/scripts/export-md.mjs +43 -0
- package/vendor/aub/scripts/generate-registry-artifacts.lib.mjs +118 -0
- package/vendor/aub/scripts/generate-registry-artifacts.mjs +65 -0
- package/vendor/aub/scripts/generate-site-locales.mjs +545 -0
- package/vendor/aub/scripts/handoff-package.lib.d.mts +20 -0
- package/vendor/aub/scripts/handoff-package.lib.mjs +111 -0
- package/vendor/aub/scripts/implementation-report.lib.d.mts +21 -0
- package/vendor/aub/scripts/implementation-report.lib.mjs +97 -0
- package/vendor/aub/scripts/import-angular-component.mjs +72 -0
- package/vendor/aub/scripts/import-design-bridge.mjs +59 -0
- package/vendor/aub/scripts/lock-blueprint.lib.d.mts +23 -0
- package/vendor/aub/scripts/lock-blueprint.lib.mjs +58 -0
- package/vendor/aub/scripts/lock-blueprint.mjs +36 -0
- package/vendor/aub/scripts/migrate-blueprint-cli.mjs +28 -0
- package/vendor/aub/scripts/migrate-blueprint.d.mts +5 -0
- package/vendor/aub/scripts/migrate-blueprint.mjs +95 -0
- package/vendor/aub/scripts/package-workspace-cli.mjs +34 -0
- package/vendor/aub/scripts/project.lib.d.mts +44 -0
- package/vendor/aub/scripts/project.lib.mjs +175 -0
- package/vendor/aub/scripts/project.mjs +332 -0
- package/vendor/aub/scripts/registry.lib.d.mts +52 -0
- package/vendor/aub/scripts/registry.lib.mjs +222 -0
- package/vendor/aub/scripts/run-agent-implementation.mjs +423 -0
- package/vendor/aub/scripts/run-agent-readability.mjs +145 -0
- package/vendor/aub/scripts/run-ollama-prompt.mjs +30 -0
- package/vendor/aub/scripts/scaffold-blueprint.lib.d.mts +38 -0
- package/vendor/aub/scripts/scaffold-blueprint.lib.mjs +316 -0
- package/vendor/aub/scripts/scaffold-blueprint.mjs +86 -0
- package/vendor/aub/scripts/score-agent-implementation.mjs +27 -0
- package/vendor/aub/scripts/score-agent-readability.mjs +54 -0
- package/vendor/aub/scripts/sync-brand-assets.mjs +33 -0
- package/vendor/aub/scripts/validate-blueprint.lib.d.mts +14 -0
- package/vendor/aub/scripts/validate-blueprint.lib.mjs +136 -0
- package/vendor/aub/scripts/validate.mjs +128 -0
- package/vendor/aub/scripts/verify-implementation-report.mjs +36 -0
- package/vendor/aub/scripts/workspace-loop.lib.d.mts +17 -0
- package/vendor/aub/scripts/workspace-loop.lib.mjs +674 -0
|
@@ -0,0 +1,507 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/handoff-package.lib-DDYpcEma.js","assets/react-vendor-ByX9Pqse.js","assets/_commonjs-dynamic-modules-TDtrdbi3.js","assets/jszip.min-CRfXyL92.js","assets/angular-importer.lib-dB_jK4mR.js","assets/canvas-tools-CuYC7cA2.js","assets/export-agent-prompt.lib-BsP0KNqo.js","assets/export-md.lib-DdmdeWgO.js","assets/implementation-report.lib-CmsSB_8s.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{g as as,r as G,j as o,a as os,R as is,b as ss}from"./react-vendor-ByX9Pqse.js";import{S as cs,M as ls}from"./canvas-tools-CuYC7cA2.js";(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const a of i)if(a.type==="childList")for(const s of a.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerPolicy&&(a.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?a.credentials="include":i.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function r(i){if(i.ep)return;i.ep=!0;const a=n(i);fetch(i.href,a)}})();const ds="modulepreload",us=function(t){return"/"+t},ia={},Ke=function(e,n,r){let i=Promise.resolve();if(n&&n.length>0){let s=function(d){return Promise.all(d.map(l=>Promise.resolve(l).then(m=>({status:"fulfilled",value:m}),m=>({status:"rejected",reason:m}))))};document.getElementsByTagName("link");const c=document.querySelector("meta[property=csp-nonce]"),u=(c==null?void 0:c.nonce)||(c==null?void 0:c.getAttribute("nonce"));i=s(n.map(d=>{if(d=us(d),d in ia)return;ia[d]=!0;const l=d.endsWith(".css"),m=l?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${d}"]${m}`))return;const g=document.createElement("link");if(g.rel=l?"stylesheet":ds,l||(g.as="script"),g.crossOrigin="",g.href=d,u&&g.setAttribute("nonce",u),document.head.appendChild(g),l)return new Promise(($,k)=>{g.addEventListener("load",$),g.addEventListener("error",()=>k(new Error(`Unable to preload CSS for ${d}`)))})}))}function a(s){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=s,window.dispatchEvent(c),!c.defaultPrevented)throw s}return i.then(s=>{for(const c of s||[])c.status==="rejected"&&a(c.reason);return e().catch(a)})};var rn={exports:{}},yr={},vt={},Pt={},gr={},_r={},vr={},sa;function nr(){return sa||(sa=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.regexpCode=t.getEsmExportName=t.getProperty=t.safeStringify=t.stringify=t.strConcat=t.addCodeArg=t.str=t._=t.nil=t._Code=t.Name=t.IDENTIFIER=t._CodeOrName=void 0;class e{}t._CodeOrName=e,t.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class n extends e{constructor(f){if(super(),!t.IDENTIFIER.test(f))throw new Error("CodeGen: name must be a valid identifier");this.str=f}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}t.Name=n;class r extends e{constructor(f){super(),this._items=typeof f=="string"?[f]:f}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const f=this._items[0];return f===""||f==='""'}get str(){var f;return(f=this._str)!==null&&f!==void 0?f:this._str=this._items.reduce((x,C)=>`${x}${C}`,"")}get names(){var f;return(f=this._names)!==null&&f!==void 0?f:this._names=this._items.reduce((x,C)=>(C instanceof n&&(x[C.str]=(x[C.str]||0)+1),x),{})}}t._Code=r,t.nil=new r("");function i(b,...f){const x=[b[0]];let C=0;for(;C<f.length;)c(x,f[C]),x.push(b[++C]);return new r(x)}t._=i;const a=new r("+");function s(b,...f){const x=[$(b[0])];let C=0;for(;C<f.length;)x.push(a),c(x,f[C]),x.push(a,$(b[++C]));return u(x),new r(x)}t.str=s;function c(b,f){f instanceof r?b.push(...f._items):f instanceof n?b.push(f):b.push(m(f))}t.addCodeArg=c;function u(b){let f=1;for(;f<b.length-1;){if(b[f]===a){const x=d(b[f-1],b[f+1]);if(x!==void 0){b.splice(f-1,3,x);continue}b[f++]="+"}f++}}function d(b,f){if(f==='""')return b;if(b==='""')return f;if(typeof b=="string")return f instanceof n||b[b.length-1]!=='"'?void 0:typeof f!="string"?`${b.slice(0,-1)}${f}"`:f[0]==='"'?b.slice(0,-1)+f.slice(1):void 0;if(typeof f=="string"&&f[0]==='"'&&!(b instanceof n))return`"${b}${f.slice(1)}`}function l(b,f){return f.emptyStr()?b:b.emptyStr()?f:s`${b}${f}`}t.strConcat=l;function m(b){return typeof b=="number"||typeof b=="boolean"||b===null?b:$(Array.isArray(b)?b.join(","):b)}function g(b){return new r($(b))}t.stringify=g;function $(b){return JSON.stringify(b).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}t.safeStringify=$;function k(b){return typeof b=="string"&&t.IDENTIFIER.test(b)?new r(`.${b}`):i`[${b}]`}t.getProperty=k;function j(b){if(typeof b=="string"&&t.IDENTIFIER.test(b))return new r(`${b}`);throw new Error(`CodeGen: invalid export name: ${b}, use explicit $id name mapping`)}t.getEsmExportName=j;function _(b){return new r(b.toString())}t.regexpCode=_})(vr)),vr}var br={},ca;function la(){return ca||(ca=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ValueScope=t.ValueScopeName=t.Scope=t.varKinds=t.UsedValueState=void 0;const e=nr();class n extends Error{constructor(d){super(`CodeGen: "code" for ${d} not defined`),this.value=d.value}}var r;(function(u){u[u.Started=0]="Started",u[u.Completed=1]="Completed"})(r||(t.UsedValueState=r={})),t.varKinds={const:new e.Name("const"),let:new e.Name("let"),var:new e.Name("var")};class i{constructor({prefixes:d,parent:l}={}){this._names={},this._prefixes=d,this._parent=l}toName(d){return d instanceof e.Name?d:this.name(d)}name(d){return new e.Name(this._newName(d))}_newName(d){const l=this._names[d]||this._nameGroup(d);return`${d}${l.index++}`}_nameGroup(d){var l,m;if(!((m=(l=this._parent)===null||l===void 0?void 0:l._prefixes)===null||m===void 0)&&m.has(d)||this._prefixes&&!this._prefixes.has(d))throw new Error(`CodeGen: prefix "${d}" is not allowed in this scope`);return this._names[d]={prefix:d,index:0}}}t.Scope=i;class a extends e.Name{constructor(d,l){super(l),this.prefix=d}setValue(d,{property:l,itemIndex:m}){this.value=d,this.scopePath=(0,e._)`.${new e.Name(l)}[${m}]`}}t.ValueScopeName=a;const s=(0,e._)`\n`;class c extends i{constructor(d){super(d),this._values={},this._scope=d.scope,this.opts={...d,_n:d.lines?s:e.nil}}get(){return this._scope}name(d){return new a(d,this._newName(d))}value(d,l){var m;if(l.ref===void 0)throw new Error("CodeGen: ref must be passed in value");const g=this.toName(d),{prefix:$}=g,k=(m=l.key)!==null&&m!==void 0?m:l.ref;let j=this._values[$];if(j){const f=j.get(k);if(f)return f}else j=this._values[$]=new Map;j.set(k,g);const _=this._scope[$]||(this._scope[$]=[]),b=_.length;return _[b]=l.ref,g.setValue(l,{property:$,itemIndex:b}),g}getValue(d,l){const m=this._values[d];if(m)return m.get(l)}scopeRefs(d,l=this._values){return this._reduceValues(l,m=>{if(m.scopePath===void 0)throw new Error(`CodeGen: name "${m}" has no value`);return(0,e._)`${d}${m.scopePath}`})}scopeCode(d=this._values,l,m){return this._reduceValues(d,g=>{if(g.value===void 0)throw new Error(`CodeGen: name "${g}" has no value`);return g.value.code},l,m)}_reduceValues(d,l,m={},g){let $=e.nil;for(const k in d){const j=d[k];if(!j)continue;const _=m[k]=m[k]||new Map;j.forEach(b=>{if(_.has(b))return;_.set(b,r.Started);let f=l(b);if(f){const x=this.opts.es5?t.varKinds.var:t.varKinds.const;$=(0,e._)`${$}${x} ${b} = ${f};${this.opts._n}`}else if(f=g==null?void 0:g(b))$=(0,e._)`${$}${f}${this.opts._n}`;else throw new n(b);_.set(b,r.Completed)})}return $}}t.ValueScope=c})(br)),br}var da;function me(){return da||(da=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.or=t.and=t.not=t.CodeGen=t.operators=t.varKinds=t.ValueScopeName=t.ValueScope=t.Scope=t.Name=t.regexpCode=t.stringify=t.getProperty=t.nil=t.strConcat=t.str=t._=void 0;const e=nr(),n=la();var r=nr();Object.defineProperty(t,"_",{enumerable:!0,get:function(){return r._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return r.str}}),Object.defineProperty(t,"strConcat",{enumerable:!0,get:function(){return r.strConcat}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return r.nil}}),Object.defineProperty(t,"getProperty",{enumerable:!0,get:function(){return r.getProperty}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return r.stringify}}),Object.defineProperty(t,"regexpCode",{enumerable:!0,get:function(){return r.regexpCode}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return r.Name}});var i=la();Object.defineProperty(t,"Scope",{enumerable:!0,get:function(){return i.Scope}}),Object.defineProperty(t,"ValueScope",{enumerable:!0,get:function(){return i.ValueScope}}),Object.defineProperty(t,"ValueScopeName",{enumerable:!0,get:function(){return i.ValueScopeName}}),Object.defineProperty(t,"varKinds",{enumerable:!0,get:function(){return i.varKinds}}),t.operators={GT:new e._Code(">"),GTE:new e._Code(">="),LT:new e._Code("<"),LTE:new e._Code("<="),EQ:new e._Code("==="),NEQ:new e._Code("!=="),NOT:new e._Code("!"),OR:new e._Code("||"),AND:new e._Code("&&"),ADD:new e._Code("+")};class a{optimizeNodes(){return this}optimizeNames(v,N){return this}}class s extends a{constructor(v,N,E){super(),this.varKind=v,this.name=N,this.rhs=E}render({es5:v,_n:N}){const E=v?n.varKinds.var:this.varKind,te=this.rhs===void 0?"":` = ${this.rhs}`;return`${E} ${this.name}${te};`+N}optimizeNames(v,N){if(v[this.name.str])return this.rhs&&(this.rhs=W(this.rhs,v,N)),this}get names(){return this.rhs instanceof e._CodeOrName?this.rhs.names:{}}}class c extends a{constructor(v,N,E){super(),this.lhs=v,this.rhs=N,this.sideEffects=E}render({_n:v}){return`${this.lhs} = ${this.rhs};`+v}optimizeNames(v,N){if(!(this.lhs instanceof e.Name&&!v[this.lhs.str]&&!this.sideEffects))return this.rhs=W(this.rhs,v,N),this}get names(){const v=this.lhs instanceof e.Name?{}:{...this.lhs.names};return B(v,this.rhs)}}class u extends c{constructor(v,N,E,te){super(v,E,te),this.op=N}render({_n:v}){return`${this.lhs} ${this.op}= ${this.rhs};`+v}}class d extends a{constructor(v){super(),this.label=v,this.names={}}render({_n:v}){return`${this.label}:`+v}}class l extends a{constructor(v){super(),this.label=v,this.names={}}render({_n:v}){return`break${this.label?` ${this.label}`:""};`+v}}class m extends a{constructor(v){super(),this.error=v}render({_n:v}){return`throw ${this.error};`+v}get names(){return this.error.names}}class g extends a{constructor(v){super(),this.code=v}render({_n:v}){return`${this.code};`+v}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(v,N){return this.code=W(this.code,v,N),this}get names(){return this.code instanceof e._CodeOrName?this.code.names:{}}}class $ extends a{constructor(v=[]){super(),this.nodes=v}render(v){return this.nodes.reduce((N,E)=>N+E.render(v),"")}optimizeNodes(){const{nodes:v}=this;let N=v.length;for(;N--;){const E=v[N].optimizeNodes();Array.isArray(E)?v.splice(N,1,...E):E?v[N]=E:v.splice(N,1)}return v.length>0?this:void 0}optimizeNames(v,N){const{nodes:E}=this;let te=E.length;for(;te--;){const ee=E[te];ee.optimizeNames(v,N)||(ae(v,ee.names),E.splice(te,1))}return E.length>0?this:void 0}get names(){return this.nodes.reduce((v,N)=>H(v,N.names),{})}}class k extends ${render(v){return"{"+v._n+super.render(v)+"}"+v._n}}class j extends ${}class _ extends k{}_.kind="else";class b extends k{constructor(v,N){super(N),this.condition=v}render(v){let N=`if(${this.condition})`+super.render(v);return this.else&&(N+="else "+this.else.render(v)),N}optimizeNodes(){super.optimizeNodes();const v=this.condition;if(v===!0)return this.nodes;let N=this.else;if(N){const E=N.optimizeNodes();N=this.else=Array.isArray(E)?new _(E):E}if(N)return v===!1?N instanceof b?N:N.nodes:this.nodes.length?this:new b(oe(v),N instanceof b?[N]:N.nodes);if(!(v===!1||!this.nodes.length))return this}optimizeNames(v,N){var E;if(this.else=(E=this.else)===null||E===void 0?void 0:E.optimizeNames(v,N),!!(super.optimizeNames(v,N)||this.else))return this.condition=W(this.condition,v,N),this}get names(){const v=super.names;return B(v,this.condition),this.else&&H(v,this.else.names),v}}b.kind="if";class f extends k{}f.kind="for";class x extends f{constructor(v){super(),this.iteration=v}render(v){return`for(${this.iteration})`+super.render(v)}optimizeNames(v,N){if(super.optimizeNames(v,N))return this.iteration=W(this.iteration,v,N),this}get names(){return H(super.names,this.iteration.names)}}class C extends f{constructor(v,N,E,te){super(),this.varKind=v,this.name=N,this.from=E,this.to=te}render(v){const N=v.es5?n.varKinds.var:this.varKind,{name:E,from:te,to:ee}=this;return`for(${N} ${E}=${te}; ${E}<${ee}; ${E}++)`+super.render(v)}get names(){const v=B(super.names,this.from);return B(v,this.to)}}class p extends f{constructor(v,N,E,te){super(),this.loop=v,this.varKind=N,this.name=E,this.iterable=te}render(v){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(v)}optimizeNames(v,N){if(super.optimizeNames(v,N))return this.iterable=W(this.iterable,v,N),this}get names(){return H(super.names,this.iterable.names)}}class h extends k{constructor(v,N,E){super(),this.name=v,this.args=N,this.async=E}render(v){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(v)}}h.kind="func";class y extends ${render(v){return"return "+super.render(v)}}y.kind="return";class w extends k{render(v){let N="try"+super.render(v);return this.catch&&(N+=this.catch.render(v)),this.finally&&(N+=this.finally.render(v)),N}optimizeNodes(){var v,N;return super.optimizeNodes(),(v=this.catch)===null||v===void 0||v.optimizeNodes(),(N=this.finally)===null||N===void 0||N.optimizeNodes(),this}optimizeNames(v,N){var E,te;return super.optimizeNames(v,N),(E=this.catch)===null||E===void 0||E.optimizeNames(v,N),(te=this.finally)===null||te===void 0||te.optimizeNames(v,N),this}get names(){const v=super.names;return this.catch&&H(v,this.catch.names),this.finally&&H(v,this.finally.names),v}}class A extends k{constructor(v){super(),this.error=v}render(v){return`catch(${this.error})`+super.render(v)}}A.kind="catch";class S extends k{render(v){return"finally"+super.render(v)}}S.kind="finally";class O{constructor(v,N={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...N,_n:N.lines?`
|
|
3
|
+
`:""},this._extScope=v,this._scope=new n.Scope({parent:v}),this._nodes=[new j]}toString(){return this._root.render(this.opts)}name(v){return this._scope.name(v)}scopeName(v){return this._extScope.name(v)}scopeValue(v,N){const E=this._extScope.value(v,N);return(this._values[E.prefix]||(this._values[E.prefix]=new Set)).add(E),E}getScopeValue(v,N){return this._extScope.getValue(v,N)}scopeRefs(v){return this._extScope.scopeRefs(v,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(v,N,E,te){const ee=this._scope.toName(N);return E!==void 0&&te&&(this._constants[ee.str]=E),this._leafNode(new s(v,ee,E)),ee}const(v,N,E){return this._def(n.varKinds.const,v,N,E)}let(v,N,E){return this._def(n.varKinds.let,v,N,E)}var(v,N,E){return this._def(n.varKinds.var,v,N,E)}assign(v,N,E){return this._leafNode(new c(v,N,E))}add(v,N){return this._leafNode(new u(v,t.operators.ADD,N))}code(v){return typeof v=="function"?v():v!==e.nil&&this._leafNode(new g(v)),this}object(...v){const N=["{"];for(const[E,te]of v)N.length>1&&N.push(","),N.push(E),(E!==te||this.opts.es5)&&(N.push(":"),(0,e.addCodeArg)(N,te));return N.push("}"),new e._Code(N)}if(v,N,E){if(this._blockNode(new b(v)),N&&E)this.code(N).else().code(E).endIf();else if(N)this.code(N).endIf();else if(E)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(v){return this._elseNode(new b(v))}else(){return this._elseNode(new _)}endIf(){return this._endBlockNode(b,_)}_for(v,N){return this._blockNode(v),N&&this.code(N).endFor(),this}for(v,N){return this._for(new x(v),N)}forRange(v,N,E,te,ee=this.opts.es5?n.varKinds.var:n.varKinds.let){const se=this._scope.toName(v);return this._for(new C(ee,se,N,E),()=>te(se))}forOf(v,N,E,te=n.varKinds.const){const ee=this._scope.toName(v);if(this.opts.es5){const se=N instanceof e.Name?N:this.var("_arr",N);return this.forRange("_i",0,(0,e._)`${se}.length`,pe=>{this.var(ee,(0,e._)`${se}[${pe}]`),E(ee)})}return this._for(new p("of",te,ee,N),()=>E(ee))}forIn(v,N,E,te=this.opts.es5?n.varKinds.var:n.varKinds.const){if(this.opts.ownProperties)return this.forOf(v,(0,e._)`Object.keys(${N})`,E);const ee=this._scope.toName(v);return this._for(new p("in",te,ee,N),()=>E(ee))}endFor(){return this._endBlockNode(f)}label(v){return this._leafNode(new d(v))}break(v){return this._leafNode(new l(v))}return(v){const N=new y;if(this._blockNode(N),this.code(v),N.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(y)}try(v,N,E){if(!N&&!E)throw new Error('CodeGen: "try" without "catch" and "finally"');const te=new w;if(this._blockNode(te),this.code(v),N){const ee=this.name("e");this._currNode=te.catch=new A(ee),N(ee)}return E&&(this._currNode=te.finally=new S,this.code(E)),this._endBlockNode(A,S)}throw(v){return this._leafNode(new m(v))}block(v,N){return this._blockStarts.push(this._nodes.length),v&&this.code(v).endBlock(N),this}endBlock(v){const N=this._blockStarts.pop();if(N===void 0)throw new Error("CodeGen: not in self-balancing block");const E=this._nodes.length-N;if(E<0||v!==void 0&&E!==v)throw new Error(`CodeGen: wrong number of nodes: ${E} vs ${v} expected`);return this._nodes.length=N,this}func(v,N=e.nil,E,te){return this._blockNode(new h(v,N,E)),te&&this.code(te).endFunc(),this}endFunc(){return this._endBlockNode(h)}optimize(v=1){for(;v-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(v){return this._currNode.nodes.push(v),this}_blockNode(v){this._currNode.nodes.push(v),this._nodes.push(v)}_endBlockNode(v,N){const E=this._currNode;if(E instanceof v||N&&E instanceof N)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${N?`${v.kind}/${N.kind}`:v.kind}"`)}_elseNode(v){const N=this._currNode;if(!(N instanceof b))throw new Error('CodeGen: "else" without "if"');return this._currNode=N.else=v,this}get _root(){return this._nodes[0]}get _currNode(){const v=this._nodes;return v[v.length-1]}set _currNode(v){const N=this._nodes;N[N.length-1]=v}}t.CodeGen=O;function H(z,v){for(const N in v)z[N]=(z[N]||0)+(v[N]||0);return z}function B(z,v){return v instanceof e._CodeOrName?H(z,v.names):z}function W(z,v,N){if(z instanceof e.Name)return E(z);if(!te(z))return z;return new e._Code(z._items.reduce((ee,se)=>(se instanceof e.Name&&(se=E(se)),se instanceof e._Code?ee.push(...se._items):ee.push(se),ee),[]));function E(ee){const se=N[ee.str];return se===void 0||v[ee.str]!==1?ee:(delete v[ee.str],se)}function te(ee){return ee instanceof e._Code&&ee._items.some(se=>se instanceof e.Name&&v[se.str]===1&&N[se.str]!==void 0)}}function ae(z,v){for(const N in v)z[N]=(z[N]||0)-(v[N]||0)}function oe(z){return typeof z=="boolean"||typeof z=="number"||z===null?!z:(0,e._)`!${U(z)}`}t.not=oe;const we=M(t.operators.AND);function he(...z){return z.reduce(we)}t.and=he;const Q=M(t.operators.OR);function Y(...z){return z.reduce(Q)}t.or=Y;function M(z){return(v,N)=>v===e.nil?N:N===e.nil?v:(0,e._)`${U(v)} ${z} ${U(N)}`}function U(z){return z instanceof e.Name?z:(0,e._)`(${z})`}})(_r)),_r}var fe={},ua;function ye(){if(ua)return fe;ua=1,Object.defineProperty(fe,"__esModule",{value:!0}),fe.checkStrictMode=fe.getErrorPath=fe.Type=fe.useFunc=fe.setEvaluated=fe.evaluatedPropsToName=fe.mergeEvaluated=fe.eachItem=fe.unescapeJsonPointer=fe.escapeJsonPointer=fe.escapeFragment=fe.unescapeFragment=fe.schemaRefOrVal=fe.schemaHasRulesButRef=fe.schemaHasRules=fe.checkUnknownRules=fe.alwaysValidSchema=fe.toHash=void 0;const t=me(),e=nr();function n(p){const h={};for(const y of p)h[y]=!0;return h}fe.toHash=n;function r(p,h){return typeof h=="boolean"?h:Object.keys(h).length===0?!0:(i(p,h),!a(h,p.self.RULES.all))}fe.alwaysValidSchema=r;function i(p,h=p.schema){const{opts:y,self:w}=p;if(!y.strictSchema||typeof h=="boolean")return;const A=w.RULES.keywords;for(const S in h)A[S]||C(p,`unknown keyword: "${S}"`)}fe.checkUnknownRules=i;function a(p,h){if(typeof p=="boolean")return!p;for(const y in p)if(h[y])return!0;return!1}fe.schemaHasRules=a;function s(p,h){if(typeof p=="boolean")return!p;for(const y in p)if(y!=="$ref"&&h.all[y])return!0;return!1}fe.schemaHasRulesButRef=s;function c({topSchemaRef:p,schemaPath:h},y,w,A){if(!A){if(typeof y=="number"||typeof y=="boolean")return y;if(typeof y=="string")return(0,t._)`${y}`}return(0,t._)`${p}${h}${(0,t.getProperty)(w)}`}fe.schemaRefOrVal=c;function u(p){return m(decodeURIComponent(p))}fe.unescapeFragment=u;function d(p){return encodeURIComponent(l(p))}fe.escapeFragment=d;function l(p){return typeof p=="number"?`${p}`:p.replace(/~/g,"~0").replace(/\//g,"~1")}fe.escapeJsonPointer=l;function m(p){return p.replace(/~1/g,"/").replace(/~0/g,"~")}fe.unescapeJsonPointer=m;function g(p,h){if(Array.isArray(p))for(const y of p)h(y);else h(p)}fe.eachItem=g;function $({mergeNames:p,mergeToName:h,mergeValues:y,resultToName:w}){return(A,S,O,H)=>{const B=O===void 0?S:O instanceof t.Name?(S instanceof t.Name?p(A,S,O):h(A,S,O),O):S instanceof t.Name?(h(A,O,S),S):y(S,O);return H===t.Name&&!(B instanceof t.Name)?w(A,B):B}}fe.mergeEvaluated={props:$({mergeNames:(p,h,y)=>p.if((0,t._)`${y} !== true && ${h} !== undefined`,()=>{p.if((0,t._)`${h} === true`,()=>p.assign(y,!0),()=>p.assign(y,(0,t._)`${y} || {}`).code((0,t._)`Object.assign(${y}, ${h})`))}),mergeToName:(p,h,y)=>p.if((0,t._)`${y} !== true`,()=>{h===!0?p.assign(y,!0):(p.assign(y,(0,t._)`${y} || {}`),j(p,y,h))}),mergeValues:(p,h)=>p===!0?!0:{...p,...h},resultToName:k}),items:$({mergeNames:(p,h,y)=>p.if((0,t._)`${y} !== true && ${h} !== undefined`,()=>p.assign(y,(0,t._)`${h} === true ? true : ${y} > ${h} ? ${y} : ${h}`)),mergeToName:(p,h,y)=>p.if((0,t._)`${y} !== true`,()=>p.assign(y,h===!0?!0:(0,t._)`${y} > ${h} ? ${y} : ${h}`)),mergeValues:(p,h)=>p===!0?!0:Math.max(p,h),resultToName:(p,h)=>p.var("items",h)})};function k(p,h){if(h===!0)return p.var("props",!0);const y=p.var("props",(0,t._)`{}`);return h!==void 0&&j(p,y,h),y}fe.evaluatedPropsToName=k;function j(p,h,y){Object.keys(y).forEach(w=>p.assign((0,t._)`${h}${(0,t.getProperty)(w)}`,!0))}fe.setEvaluated=j;const _={};function b(p,h){return p.scopeValue("func",{ref:h,code:_[h.code]||(_[h.code]=new e._Code(h.code))})}fe.useFunc=b;var f;(function(p){p[p.Num=0]="Num",p[p.Str=1]="Str"})(f||(fe.Type=f={}));function x(p,h,y){if(p instanceof t.Name){const w=h===f.Num;return y?w?(0,t._)`"[" + ${p} + "]"`:(0,t._)`"['" + ${p} + "']"`:w?(0,t._)`"/" + ${p}`:(0,t._)`"/" + ${p}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return y?(0,t.getProperty)(p).toString():"/"+l(p)}fe.getErrorPath=x;function C(p,h,y=p.opts.strictSchema){if(y){if(h=`strict mode: ${h}`,y===!0)throw new Error(h);p.self.logger.warn(h)}}return fe.checkStrictMode=C,fe}var an={},pa;function ct(){if(pa)return an;pa=1,Object.defineProperty(an,"__esModule",{value:!0});const t=me(),e={data:new t.Name("data"),valCxt:new t.Name("valCxt"),instancePath:new t.Name("instancePath"),parentData:new t.Name("parentData"),parentDataProperty:new t.Name("parentDataProperty"),rootData:new t.Name("rootData"),dynamicAnchors:new t.Name("dynamicAnchors"),vErrors:new t.Name("vErrors"),errors:new t.Name("errors"),this:new t.Name("this"),self:new t.Name("self"),scope:new t.Name("scope"),json:new t.Name("json"),jsonPos:new t.Name("jsonPos"),jsonLen:new t.Name("jsonLen"),jsonPart:new t.Name("jsonPart")};return an.default=e,an}var ha;function ir(){return ha||(ha=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.extendErrors=t.resetErrorsCount=t.reportExtraError=t.reportError=t.keyword$DataError=t.keywordError=void 0;const e=me(),n=ye(),r=ct();t.keywordError={message:({keyword:_})=>(0,e.str)`must pass "${_}" keyword validation`},t.keyword$DataError={message:({keyword:_,schemaType:b})=>b?(0,e.str)`"${_}" keyword must be ${b} ($data)`:(0,e.str)`"${_}" keyword is invalid ($data)`};function i(_,b=t.keywordError,f,x){const{it:C}=_,{gen:p,compositeRule:h,allErrors:y}=C,w=m(_,b,f);x??(h||y)?u(p,w):d(C,(0,e._)`[${w}]`)}t.reportError=i;function a(_,b=t.keywordError,f){const{it:x}=_,{gen:C,compositeRule:p,allErrors:h}=x,y=m(_,b,f);u(C,y),p||h||d(x,r.default.vErrors)}t.reportExtraError=a;function s(_,b){_.assign(r.default.errors,b),_.if((0,e._)`${r.default.vErrors} !== null`,()=>_.if(b,()=>_.assign((0,e._)`${r.default.vErrors}.length`,b),()=>_.assign(r.default.vErrors,null)))}t.resetErrorsCount=s;function c({gen:_,keyword:b,schemaValue:f,data:x,errsCount:C,it:p}){if(C===void 0)throw new Error("ajv implementation error");const h=_.name("err");_.forRange("i",C,r.default.errors,y=>{_.const(h,(0,e._)`${r.default.vErrors}[${y}]`),_.if((0,e._)`${h}.instancePath === undefined`,()=>_.assign((0,e._)`${h}.instancePath`,(0,e.strConcat)(r.default.instancePath,p.errorPath))),_.assign((0,e._)`${h}.schemaPath`,(0,e.str)`${p.errSchemaPath}/${b}`),p.opts.verbose&&(_.assign((0,e._)`${h}.schema`,f),_.assign((0,e._)`${h}.data`,x))})}t.extendErrors=c;function u(_,b){const f=_.const("err",b);_.if((0,e._)`${r.default.vErrors} === null`,()=>_.assign(r.default.vErrors,(0,e._)`[${f}]`),(0,e._)`${r.default.vErrors}.push(${f})`),_.code((0,e._)`${r.default.errors}++`)}function d(_,b){const{gen:f,validateName:x,schemaEnv:C}=_;C.$async?f.throw((0,e._)`new ${_.ValidationError}(${b})`):(f.assign((0,e._)`${x}.errors`,b),f.return(!1))}const l={keyword:new e.Name("keyword"),schemaPath:new e.Name("schemaPath"),params:new e.Name("params"),propertyName:new e.Name("propertyName"),message:new e.Name("message"),schema:new e.Name("schema"),parentSchema:new e.Name("parentSchema")};function m(_,b,f){const{createErrors:x}=_.it;return x===!1?(0,e._)`{}`:g(_,b,f)}function g(_,b,f={}){const{gen:x,it:C}=_,p=[$(C,f),k(_,f)];return j(_,b,p),x.object(...p)}function $({errorPath:_},{instancePath:b}){const f=b?(0,e.str)`${_}${(0,n.getErrorPath)(b,n.Type.Str)}`:_;return[r.default.instancePath,(0,e.strConcat)(r.default.instancePath,f)]}function k({keyword:_,it:{errSchemaPath:b}},{schemaPath:f,parentSchema:x}){let C=x?b:(0,e.str)`${b}/${_}`;return f&&(C=(0,e.str)`${C}${(0,n.getErrorPath)(f,n.Type.Str)}`),[l.schemaPath,C]}function j(_,{params:b,message:f},x){const{keyword:C,data:p,schemaValue:h,it:y}=_,{opts:w,propertyName:A,topSchemaRef:S,schemaPath:O}=y;x.push([l.keyword,C],[l.params,typeof b=="function"?b(_):b||(0,e._)`{}`]),w.messages&&x.push([l.message,typeof f=="function"?f(_):f]),w.verbose&&x.push([l.schema,h],[l.parentSchema,(0,e._)`${S}${O}`],[r.default.data,p]),A&&x.push([l.propertyName,A])}})(gr)),gr}var ma;function ps(){if(ma)return Pt;ma=1,Object.defineProperty(Pt,"__esModule",{value:!0}),Pt.boolOrEmptySchema=Pt.topBoolOrEmptySchema=void 0;const t=ir(),e=me(),n=ct(),r={message:"boolean schema is false"};function i(c){const{gen:u,schema:d,validateName:l}=c;d===!1?s(c,!1):typeof d=="object"&&d.$async===!0?u.return(n.default.data):(u.assign((0,e._)`${l}.errors`,null),u.return(!0))}Pt.topBoolOrEmptySchema=i;function a(c,u){const{gen:d,schema:l}=c;l===!1?(d.var(u,!1),s(c)):d.var(u,!0)}Pt.boolOrEmptySchema=a;function s(c,u){const{gen:d,data:l}=c,m={gen:d,keyword:"false schema",data:l,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:c};(0,t.reportError)(m,r,void 0,u)}return Pt}var De={},Et={},fa;function di(){if(fa)return Et;fa=1,Object.defineProperty(Et,"__esModule",{value:!0}),Et.getRules=Et.isJSONType=void 0;const t=["string","number","integer","boolean","null","object","array"],e=new Set(t);function n(i){return typeof i=="string"&&e.has(i)}Et.isJSONType=n;function r(){const i={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...i,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},i.number,i.string,i.array,i.object],post:{rules:[]},all:{},keywords:{}}}return Et.getRules=r,Et}var bt={},ya;function ui(){if(ya)return bt;ya=1,Object.defineProperty(bt,"__esModule",{value:!0}),bt.shouldUseRule=bt.shouldUseGroup=bt.schemaHasRulesForType=void 0;function t({schema:r,self:i},a){const s=i.RULES.types[a];return s&&s!==!0&&e(r,s)}bt.schemaHasRulesForType=t;function e(r,i){return i.rules.some(a=>n(r,a))}bt.shouldUseGroup=e;function n(r,i){var a;return r[i.keyword]!==void 0||((a=i.definition.implements)===null||a===void 0?void 0:a.some(s=>r[s]!==void 0))}return bt.shouldUseRule=n,bt}var ga;function rr(){if(ga)return De;ga=1,Object.defineProperty(De,"__esModule",{value:!0}),De.reportTypeError=De.checkDataTypes=De.checkDataType=De.coerceAndCheckDataType=De.getJSONTypes=De.getSchemaTypes=De.DataType=void 0;const t=di(),e=ui(),n=ir(),r=me(),i=ye();var a;(function(f){f[f.Correct=0]="Correct",f[f.Wrong=1]="Wrong"})(a||(De.DataType=a={}));function s(f){const x=c(f.type);if(x.includes("null")){if(f.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!x.length&&f.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');f.nullable===!0&&x.push("null")}return x}De.getSchemaTypes=s;function c(f){const x=Array.isArray(f)?f:f?[f]:[];if(x.every(t.isJSONType))return x;throw new Error("type must be JSONType or JSONType[]: "+x.join(","))}De.getJSONTypes=c;function u(f,x){const{gen:C,data:p,opts:h}=f,y=l(x,h.coerceTypes),w=x.length>0&&!(y.length===0&&x.length===1&&(0,e.schemaHasRulesForType)(f,x[0]));if(w){const A=k(x,p,h.strictNumbers,a.Wrong);C.if(A,()=>{y.length?m(f,x,y):_(f)})}return w}De.coerceAndCheckDataType=u;const d=new Set(["string","number","integer","boolean","null"]);function l(f,x){return x?f.filter(C=>d.has(C)||x==="array"&&C==="array"):[]}function m(f,x,C){const{gen:p,data:h,opts:y}=f,w=p.let("dataType",(0,r._)`typeof ${h}`),A=p.let("coerced",(0,r._)`undefined`);y.coerceTypes==="array"&&p.if((0,r._)`${w} == 'object' && Array.isArray(${h}) && ${h}.length == 1`,()=>p.assign(h,(0,r._)`${h}[0]`).assign(w,(0,r._)`typeof ${h}`).if(k(x,h,y.strictNumbers),()=>p.assign(A,h))),p.if((0,r._)`${A} !== undefined`);for(const O of C)(d.has(O)||O==="array"&&y.coerceTypes==="array")&&S(O);p.else(),_(f),p.endIf(),p.if((0,r._)`${A} !== undefined`,()=>{p.assign(h,A),g(f,A)});function S(O){switch(O){case"string":p.elseIf((0,r._)`${w} == "number" || ${w} == "boolean"`).assign(A,(0,r._)`"" + ${h}`).elseIf((0,r._)`${h} === null`).assign(A,(0,r._)`""`);return;case"number":p.elseIf((0,r._)`${w} == "boolean" || ${h} === null
|
|
4
|
+
|| (${w} == "string" && ${h} && ${h} == +${h})`).assign(A,(0,r._)`+${h}`);return;case"integer":p.elseIf((0,r._)`${w} === "boolean" || ${h} === null
|
|
5
|
+
|| (${w} === "string" && ${h} && ${h} == +${h} && !(${h} % 1))`).assign(A,(0,r._)`+${h}`);return;case"boolean":p.elseIf((0,r._)`${h} === "false" || ${h} === 0 || ${h} === null`).assign(A,!1).elseIf((0,r._)`${h} === "true" || ${h} === 1`).assign(A,!0);return;case"null":p.elseIf((0,r._)`${h} === "" || ${h} === 0 || ${h} === false`),p.assign(A,null);return;case"array":p.elseIf((0,r._)`${w} === "string" || ${w} === "number"
|
|
6
|
+
|| ${w} === "boolean" || ${h} === null`).assign(A,(0,r._)`[${h}]`)}}}function g({gen:f,parentData:x,parentDataProperty:C},p){f.if((0,r._)`${x} !== undefined`,()=>f.assign((0,r._)`${x}[${C}]`,p))}function $(f,x,C,p=a.Correct){const h=p===a.Correct?r.operators.EQ:r.operators.NEQ;let y;switch(f){case"null":return(0,r._)`${x} ${h} null`;case"array":y=(0,r._)`Array.isArray(${x})`;break;case"object":y=(0,r._)`${x} && typeof ${x} == "object" && !Array.isArray(${x})`;break;case"integer":y=w((0,r._)`!(${x} % 1) && !isNaN(${x})`);break;case"number":y=w();break;default:return(0,r._)`typeof ${x} ${h} ${f}`}return p===a.Correct?y:(0,r.not)(y);function w(A=r.nil){return(0,r.and)((0,r._)`typeof ${x} == "number"`,A,C?(0,r._)`isFinite(${x})`:r.nil)}}De.checkDataType=$;function k(f,x,C,p){if(f.length===1)return $(f[0],x,C,p);let h;const y=(0,i.toHash)(f);if(y.array&&y.object){const w=(0,r._)`typeof ${x} != "object"`;h=y.null?w:(0,r._)`!${x} || ${w}`,delete y.null,delete y.array,delete y.object}else h=r.nil;y.number&&delete y.integer;for(const w in y)h=(0,r.and)(h,$(w,x,C,p));return h}De.checkDataTypes=k;const j={message:({schema:f})=>`must be ${f}`,params:({schema:f,schemaValue:x})=>typeof f=="string"?(0,r._)`{type: ${f}}`:(0,r._)`{type: ${x}}`};function _(f){const x=b(f);(0,n.reportError)(x,j)}De.reportTypeError=_;function b(f){const{gen:x,data:C,schema:p}=f,h=(0,i.schemaRefOrVal)(f,p,"type");return{gen:x,keyword:"type",data:C,schema:p.type,schemaCode:h,schemaValue:h,parentSchema:p,params:{},it:f}}return De}var Gt={},_a;function hs(){if(_a)return Gt;_a=1,Object.defineProperty(Gt,"__esModule",{value:!0}),Gt.assignDefaults=void 0;const t=me(),e=ye();function n(i,a){const{properties:s,items:c}=i.schema;if(a==="object"&&s)for(const u in s)r(i,u,s[u].default);else a==="array"&&Array.isArray(c)&&c.forEach((u,d)=>r(i,d,u.default))}Gt.assignDefaults=n;function r(i,a,s){const{gen:c,compositeRule:u,data:d,opts:l}=i;if(s===void 0)return;const m=(0,t._)`${d}${(0,t.getProperty)(a)}`;if(u){(0,e.checkStrictMode)(i,`default is ignored for: ${m}`);return}let g=(0,t._)`${m} === undefined`;l.useDefaults==="empty"&&(g=(0,t._)`${g} || ${m} === null || ${m} === ""`),c.if(g,(0,t._)`${m} = ${(0,t.stringify)(s)}`)}return Gt}var it={},be={},va;function lt(){if(va)return be;va=1,Object.defineProperty(be,"__esModule",{value:!0}),be.validateUnion=be.validateArray=be.usePattern=be.callValidateCode=be.schemaProperties=be.allSchemaProperties=be.noPropertyInData=be.propertyInData=be.isOwnProperty=be.hasPropFunc=be.reportMissingProp=be.checkMissingProp=be.checkReportMissingProp=void 0;const t=me(),e=ye(),n=ct(),r=ye();function i(f,x){const{gen:C,data:p,it:h}=f;C.if(l(C,p,x,h.opts.ownProperties),()=>{f.setParams({missingProperty:(0,t._)`${x}`},!0),f.error()})}be.checkReportMissingProp=i;function a({gen:f,data:x,it:{opts:C}},p,h){return(0,t.or)(...p.map(y=>(0,t.and)(l(f,x,y,C.ownProperties),(0,t._)`${h} = ${y}`)))}be.checkMissingProp=a;function s(f,x){f.setParams({missingProperty:x},!0),f.error()}be.reportMissingProp=s;function c(f){return f.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,t._)`Object.prototype.hasOwnProperty`})}be.hasPropFunc=c;function u(f,x,C){return(0,t._)`${c(f)}.call(${x}, ${C})`}be.isOwnProperty=u;function d(f,x,C,p){const h=(0,t._)`${x}${(0,t.getProperty)(C)} !== undefined`;return p?(0,t._)`${h} && ${u(f,x,C)}`:h}be.propertyInData=d;function l(f,x,C,p){const h=(0,t._)`${x}${(0,t.getProperty)(C)} === undefined`;return p?(0,t.or)(h,(0,t.not)(u(f,x,C))):h}be.noPropertyInData=l;function m(f){return f?Object.keys(f).filter(x=>x!=="__proto__"):[]}be.allSchemaProperties=m;function g(f,x){return m(x).filter(C=>!(0,e.alwaysValidSchema)(f,x[C]))}be.schemaProperties=g;function $({schemaCode:f,data:x,it:{gen:C,topSchemaRef:p,schemaPath:h,errorPath:y},it:w},A,S,O){const H=O?(0,t._)`${f}, ${x}, ${p}${h}`:x,B=[[n.default.instancePath,(0,t.strConcat)(n.default.instancePath,y)],[n.default.parentData,w.parentData],[n.default.parentDataProperty,w.parentDataProperty],[n.default.rootData,n.default.rootData]];w.opts.dynamicRef&&B.push([n.default.dynamicAnchors,n.default.dynamicAnchors]);const W=(0,t._)`${H}, ${C.object(...B)}`;return S!==t.nil?(0,t._)`${A}.call(${S}, ${W})`:(0,t._)`${A}(${W})`}be.callValidateCode=$;const k=(0,t._)`new RegExp`;function j({gen:f,it:{opts:x}},C){const p=x.unicodeRegExp?"u":"",{regExp:h}=x.code,y=h(C,p);return f.scopeValue("pattern",{key:y.toString(),ref:y,code:(0,t._)`${h.code==="new RegExp"?k:(0,r.useFunc)(f,h)}(${C}, ${p})`})}be.usePattern=j;function _(f){const{gen:x,data:C,keyword:p,it:h}=f,y=x.name("valid");if(h.allErrors){const A=x.let("valid",!0);return w(()=>x.assign(A,!1)),A}return x.var(y,!0),w(()=>x.break()),y;function w(A){const S=x.const("len",(0,t._)`${C}.length`);x.forRange("i",0,S,O=>{f.subschema({keyword:p,dataProp:O,dataPropType:e.Type.Num},y),x.if((0,t.not)(y),A)})}}be.validateArray=_;function b(f){const{gen:x,schema:C,keyword:p,it:h}=f;if(!Array.isArray(C))throw new Error("ajv implementation error");if(C.some(S=>(0,e.alwaysValidSchema)(h,S))&&!h.opts.unevaluated)return;const w=x.let("valid",!1),A=x.name("_valid");x.block(()=>C.forEach((S,O)=>{const H=f.subschema({keyword:p,schemaProp:O,compositeRule:!0},A);x.assign(w,(0,t._)`${w} || ${A}`),f.mergeValidEvaluated(H,A)||x.if((0,t.not)(w))})),f.result(w,()=>f.reset(),()=>f.error(!0))}return be.validateUnion=b,be}var ba;function ms(){if(ba)return it;ba=1,Object.defineProperty(it,"__esModule",{value:!0}),it.validateKeywordUsage=it.validSchemaType=it.funcKeywordCode=it.macroKeywordCode=void 0;const t=me(),e=ct(),n=lt(),r=ir();function i(g,$){const{gen:k,keyword:j,schema:_,parentSchema:b,it:f}=g,x=$.macro.call(f.self,_,b,f),C=d(k,j,x);f.opts.validateSchema!==!1&&f.self.validateSchema(x,!0);const p=k.name("valid");g.subschema({schema:x,schemaPath:t.nil,errSchemaPath:`${f.errSchemaPath}/${j}`,topSchemaRef:C,compositeRule:!0},p),g.pass(p,()=>g.error(!0))}it.macroKeywordCode=i;function a(g,$){var k;const{gen:j,keyword:_,schema:b,parentSchema:f,$data:x,it:C}=g;u(C,$);const p=!x&&$.compile?$.compile.call(C.self,b,f,C):$.validate,h=d(j,_,p),y=j.let("valid");g.block$data(y,w),g.ok((k=$.valid)!==null&&k!==void 0?k:y);function w(){if($.errors===!1)O(),$.modifying&&s(g),H(()=>g.error());else{const B=$.async?A():S();$.modifying&&s(g),H(()=>c(g,B))}}function A(){const B=j.let("ruleErrs",null);return j.try(()=>O((0,t._)`await `),W=>j.assign(y,!1).if((0,t._)`${W} instanceof ${C.ValidationError}`,()=>j.assign(B,(0,t._)`${W}.errors`),()=>j.throw(W))),B}function S(){const B=(0,t._)`${h}.errors`;return j.assign(B,null),O(t.nil),B}function O(B=$.async?(0,t._)`await `:t.nil){const W=C.opts.passContext?e.default.this:e.default.self,ae=!("compile"in $&&!x||$.schema===!1);j.assign(y,(0,t._)`${B}${(0,n.callValidateCode)(g,h,W,ae)}`,$.modifying)}function H(B){var W;j.if((0,t.not)((W=$.valid)!==null&&W!==void 0?W:y),B)}}it.funcKeywordCode=a;function s(g){const{gen:$,data:k,it:j}=g;$.if(j.parentData,()=>$.assign(k,(0,t._)`${j.parentData}[${j.parentDataProperty}]`))}function c(g,$){const{gen:k}=g;k.if((0,t._)`Array.isArray(${$})`,()=>{k.assign(e.default.vErrors,(0,t._)`${e.default.vErrors} === null ? ${$} : ${e.default.vErrors}.concat(${$})`).assign(e.default.errors,(0,t._)`${e.default.vErrors}.length`),(0,r.extendErrors)(g)},()=>g.error())}function u({schemaEnv:g},$){if($.async&&!g.$async)throw new Error("async keyword in sync schema")}function d(g,$,k){if(k===void 0)throw new Error(`keyword "${$}" failed to compile`);return g.scopeValue("keyword",typeof k=="function"?{ref:k}:{ref:k,code:(0,t.stringify)(k)})}function l(g,$,k=!1){return!$.length||$.some(j=>j==="array"?Array.isArray(g):j==="object"?g&&typeof g=="object"&&!Array.isArray(g):typeof g==j||k&&typeof g>"u")}it.validSchemaType=l;function m({schema:g,opts:$,self:k,errSchemaPath:j},_,b){if(Array.isArray(_.keyword)?!_.keyword.includes(b):_.keyword!==b)throw new Error("ajv implementation error");const f=_.dependencies;if(f!=null&&f.some(x=>!Object.prototype.hasOwnProperty.call(g,x)))throw new Error(`parent schema must have dependencies of ${b}: ${f.join(",")}`);if(_.validateSchema&&!_.validateSchema(g[b])){const C=`keyword "${b}" value is invalid at path "${j}": `+k.errorsText(_.validateSchema.errors);if($.validateSchema==="log")k.logger.error(C);else throw new Error(C)}}return it.validateKeywordUsage=m,it}var wt={},wa;function fs(){if(wa)return wt;wa=1,Object.defineProperty(wt,"__esModule",{value:!0}),wt.extendSubschemaMode=wt.extendSubschemaData=wt.getSubschema=void 0;const t=me(),e=ye();function n(a,{keyword:s,schemaProp:c,schema:u,schemaPath:d,errSchemaPath:l,topSchemaRef:m}){if(s!==void 0&&u!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(s!==void 0){const g=a.schema[s];return c===void 0?{schema:g,schemaPath:(0,t._)`${a.schemaPath}${(0,t.getProperty)(s)}`,errSchemaPath:`${a.errSchemaPath}/${s}`}:{schema:g[c],schemaPath:(0,t._)`${a.schemaPath}${(0,t.getProperty)(s)}${(0,t.getProperty)(c)}`,errSchemaPath:`${a.errSchemaPath}/${s}/${(0,e.escapeFragment)(c)}`}}if(u!==void 0){if(d===void 0||l===void 0||m===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:u,schemaPath:d,topSchemaRef:m,errSchemaPath:l}}throw new Error('either "keyword" or "schema" must be passed')}wt.getSubschema=n;function r(a,s,{dataProp:c,dataPropType:u,data:d,dataTypes:l,propertyName:m}){if(d!==void 0&&c!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:g}=s;if(c!==void 0){const{errorPath:k,dataPathArr:j,opts:_}=s,b=g.let("data",(0,t._)`${s.data}${(0,t.getProperty)(c)}`,!0);$(b),a.errorPath=(0,t.str)`${k}${(0,e.getErrorPath)(c,u,_.jsPropertySyntax)}`,a.parentDataProperty=(0,t._)`${c}`,a.dataPathArr=[...j,a.parentDataProperty]}if(d!==void 0){const k=d instanceof t.Name?d:g.let("data",d,!0);$(k),m!==void 0&&(a.propertyName=m)}l&&(a.dataTypes=l);function $(k){a.data=k,a.dataLevel=s.dataLevel+1,a.dataTypes=[],s.definedProperties=new Set,a.parentData=s.data,a.dataNames=[...s.dataNames,k]}}wt.extendSubschemaData=r;function i(a,{jtdDiscriminator:s,jtdMetadata:c,compositeRule:u,createErrors:d,allErrors:l}){u!==void 0&&(a.compositeRule=u),d!==void 0&&(a.createErrors=d),l!==void 0&&(a.allErrors=l),a.jtdDiscriminator=s,a.jtdMetadata=c}return wt.extendSubschemaMode=i,wt}var Be={},wr,$a;function pi(){return $a||($a=1,wr=function t(e,n){if(e===n)return!0;if(e&&n&&typeof e=="object"&&typeof n=="object"){if(e.constructor!==n.constructor)return!1;var r,i,a;if(Array.isArray(e)){if(r=e.length,r!=n.length)return!1;for(i=r;i--!==0;)if(!t(e[i],n[i]))return!1;return!0}if(e.constructor===RegExp)return e.source===n.source&&e.flags===n.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===n.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===n.toString();if(a=Object.keys(e),r=a.length,r!==Object.keys(n).length)return!1;for(i=r;i--!==0;)if(!Object.prototype.hasOwnProperty.call(n,a[i]))return!1;for(i=r;i--!==0;){var s=a[i];if(!t(e[s],n[s]))return!1}return!0}return e!==e&&n!==n}),wr}var $r={exports:{}},xa;function ys(){if(xa)return $r.exports;xa=1;var t=$r.exports=function(r,i,a){typeof i=="function"&&(a=i,i={}),a=i.cb||a;var s=typeof a=="function"?a:a.pre||function(){},c=a.post||function(){};e(i,s,c,r,"",r)};t.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},t.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},t.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},t.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function e(r,i,a,s,c,u,d,l,m,g){if(s&&typeof s=="object"&&!Array.isArray(s)){i(s,c,u,d,l,m,g);for(var $ in s){var k=s[$];if(Array.isArray(k)){if($ in t.arrayKeywords)for(var j=0;j<k.length;j++)e(r,i,a,k[j],c+"/"+$+"/"+j,u,c,$,s,j)}else if($ in t.propsKeywords){if(k&&typeof k=="object")for(var _ in k)e(r,i,a,k[_],c+"/"+$+"/"+n(_),u,c,$,s,_)}else($ in t.keywords||r.allKeys&&!($ in t.skipKeywords))&&e(r,i,a,k,c+"/"+$,u,c,$,s)}a(s,c,u,d,l,m,g)}}function n(r){return r.replace(/~/g,"~0").replace(/\//g,"~1")}return $r.exports}var ja;function sr(){if(ja)return Be;ja=1,Object.defineProperty(Be,"__esModule",{value:!0}),Be.getSchemaRefs=Be.resolveUrl=Be.normalizeId=Be._getFullPath=Be.getFullPath=Be.inlineRef=void 0;const t=ye(),e=pi(),n=ys(),r=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function i(j,_=!0){return typeof j=="boolean"?!0:_===!0?!s(j):_?c(j)<=_:!1}Be.inlineRef=i;const a=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function s(j){for(const _ in j){if(a.has(_))return!0;const b=j[_];if(Array.isArray(b)&&b.some(s)||typeof b=="object"&&s(b))return!0}return!1}function c(j){let _=0;for(const b in j){if(b==="$ref")return 1/0;if(_++,!r.has(b)&&(typeof j[b]=="object"&&(0,t.eachItem)(j[b],f=>_+=c(f)),_===1/0))return 1/0}return _}function u(j,_="",b){b!==!1&&(_=m(_));const f=j.parse(_);return d(j,f)}Be.getFullPath=u;function d(j,_){return j.serialize(_).split("#")[0]+"#"}Be._getFullPath=d;const l=/#\/?$/;function m(j){return j?j.replace(l,""):""}Be.normalizeId=m;function g(j,_,b){return b=m(b),j.resolve(_,b)}Be.resolveUrl=g;const $=/^[a-z_][-a-z0-9._]*$/i;function k(j,_){if(typeof j=="boolean")return{};const{schemaId:b,uriResolver:f}=this.opts,x=m(j[b]||_),C={"":x},p=u(f,x,!1),h={},y=new Set;return n(j,{allKeys:!0},(S,O,H,B)=>{if(B===void 0)return;const W=p+O;let ae=C[B];typeof S[b]=="string"&&(ae=oe.call(this,S[b])),we.call(this,S.$anchor),we.call(this,S.$dynamicAnchor),C[O]=ae;function oe(he){const Q=this.opts.uriResolver.resolve;if(he=m(ae?Q(ae,he):he),y.has(he))throw A(he);y.add(he);let Y=this.refs[he];return typeof Y=="string"&&(Y=this.refs[Y]),typeof Y=="object"?w(S,Y.schema,he):he!==m(W)&&(he[0]==="#"?(w(S,h[he],he),h[he]=S):this.refs[he]=W),he}function we(he){if(typeof he=="string"){if(!$.test(he))throw new Error(`invalid anchor "${he}"`);oe.call(this,`#${he}`)}}}),h;function w(S,O,H){if(O!==void 0&&!e(S,O))throw A(H)}function A(S){return new Error(`reference "${S}" resolves to more than one schema`)}}return Be.getSchemaRefs=k,Be}var ka;function cr(){if(ka)return vt;ka=1,Object.defineProperty(vt,"__esModule",{value:!0}),vt.getData=vt.KeywordCxt=vt.validateFunctionCode=void 0;const t=ps(),e=rr(),n=ui(),r=rr(),i=hs(),a=ms(),s=fs(),c=me(),u=ct(),d=sr(),l=ye(),m=ir();function g(R){if(p(R)&&(y(R),C(R))){_(R);return}$(R,()=>(0,t.topBoolOrEmptySchema)(R))}vt.validateFunctionCode=g;function $({gen:R,validateName:q,schema:J,schemaEnv:X,opts:V},ce){V.code.es5?R.func(q,(0,c._)`${u.default.data}, ${u.default.valCxt}`,X.$async,()=>{R.code((0,c._)`"use strict"; ${f(J,V)}`),j(R,V),R.code(ce)}):R.func(q,(0,c._)`${u.default.data}, ${k(V)}`,X.$async,()=>R.code(f(J,V)).code(ce))}function k(R){return(0,c._)`{${u.default.instancePath}="", ${u.default.parentData}, ${u.default.parentDataProperty}, ${u.default.rootData}=${u.default.data}${R.dynamicRef?(0,c._)`, ${u.default.dynamicAnchors}={}`:c.nil}}={}`}function j(R,q){R.if(u.default.valCxt,()=>{R.var(u.default.instancePath,(0,c._)`${u.default.valCxt}.${u.default.instancePath}`),R.var(u.default.parentData,(0,c._)`${u.default.valCxt}.${u.default.parentData}`),R.var(u.default.parentDataProperty,(0,c._)`${u.default.valCxt}.${u.default.parentDataProperty}`),R.var(u.default.rootData,(0,c._)`${u.default.valCxt}.${u.default.rootData}`),q.dynamicRef&&R.var(u.default.dynamicAnchors,(0,c._)`${u.default.valCxt}.${u.default.dynamicAnchors}`)},()=>{R.var(u.default.instancePath,(0,c._)`""`),R.var(u.default.parentData,(0,c._)`undefined`),R.var(u.default.parentDataProperty,(0,c._)`undefined`),R.var(u.default.rootData,u.default.data),q.dynamicRef&&R.var(u.default.dynamicAnchors,(0,c._)`{}`)})}function _(R){const{schema:q,opts:J,gen:X}=R;$(R,()=>{J.$comment&&q.$comment&&B(R),S(R),X.let(u.default.vErrors,null),X.let(u.default.errors,0),J.unevaluated&&b(R),w(R),W(R)})}function b(R){const{gen:q,validateName:J}=R;R.evaluated=q.const("evaluated",(0,c._)`${J}.evaluated`),q.if((0,c._)`${R.evaluated}.dynamicProps`,()=>q.assign((0,c._)`${R.evaluated}.props`,(0,c._)`undefined`)),q.if((0,c._)`${R.evaluated}.dynamicItems`,()=>q.assign((0,c._)`${R.evaluated}.items`,(0,c._)`undefined`))}function f(R,q){const J=typeof R=="object"&&R[q.schemaId];return J&&(q.code.source||q.code.process)?(0,c._)`/*# sourceURL=${J} */`:c.nil}function x(R,q){if(p(R)&&(y(R),C(R))){h(R,q);return}(0,t.boolOrEmptySchema)(R,q)}function C({schema:R,self:q}){if(typeof R=="boolean")return!R;for(const J in R)if(q.RULES.all[J])return!0;return!1}function p(R){return typeof R.schema!="boolean"}function h(R,q){const{schema:J,gen:X,opts:V}=R;V.$comment&&J.$comment&&B(R),O(R),H(R);const ce=X.const("_errs",u.default.errors);w(R,ce),X.var(q,(0,c._)`${ce} === ${u.default.errors}`)}function y(R){(0,l.checkUnknownRules)(R),A(R)}function w(R,q){if(R.opts.jtd)return oe(R,[],!1,q);const J=(0,e.getSchemaTypes)(R.schema),X=(0,e.coerceAndCheckDataType)(R,J);oe(R,J,!X,q)}function A(R){const{schema:q,errSchemaPath:J,opts:X,self:V}=R;q.$ref&&X.ignoreKeywordsWithRef&&(0,l.schemaHasRulesButRef)(q,V.RULES)&&V.logger.warn(`$ref: keywords ignored in schema at path "${J}"`)}function S(R){const{schema:q,opts:J}=R;q.default!==void 0&&J.useDefaults&&J.strictSchema&&(0,l.checkStrictMode)(R,"default is ignored in the schema root")}function O(R){const q=R.schema[R.opts.schemaId];q&&(R.baseId=(0,d.resolveUrl)(R.opts.uriResolver,R.baseId,q))}function H(R){if(R.schema.$async&&!R.schemaEnv.$async)throw new Error("async schema in sync schema")}function B({gen:R,schemaEnv:q,schema:J,errSchemaPath:X,opts:V}){const ce=J.$comment;if(V.$comment===!0)R.code((0,c._)`${u.default.self}.logger.log(${ce})`);else if(typeof V.$comment=="function"){const $e=(0,c.str)`${X}/$comment`,ve=R.scopeValue("root",{ref:q.root});R.code((0,c._)`${u.default.self}.opts.$comment(${ce}, ${$e}, ${ve}.schema)`)}}function W(R){const{gen:q,schemaEnv:J,validateName:X,ValidationError:V,opts:ce}=R;J.$async?q.if((0,c._)`${u.default.errors} === 0`,()=>q.return(u.default.data),()=>q.throw((0,c._)`new ${V}(${u.default.vErrors})`)):(q.assign((0,c._)`${X}.errors`,u.default.vErrors),ce.unevaluated&&ae(R),q.return((0,c._)`${u.default.errors} === 0`))}function ae({gen:R,evaluated:q,props:J,items:X}){J instanceof c.Name&&R.assign((0,c._)`${q}.props`,J),X instanceof c.Name&&R.assign((0,c._)`${q}.items`,X)}function oe(R,q,J,X){const{gen:V,schema:ce,data:$e,allErrors:ve,opts:xe,self:Te}=R,{RULES:Pe}=Te;if(ce.$ref&&(xe.ignoreKeywordsWithRef||!(0,l.schemaHasRulesButRef)(ce,Pe))){V.block(()=>te(R,"$ref",Pe.all.$ref.definition));return}xe.jtd||he(R,q),V.block(()=>{for(const Oe of Pe.rules)Qe(Oe);Qe(Pe.post)});function Qe(Oe){(0,n.shouldUseGroup)(ce,Oe)&&(Oe.type?(V.if((0,r.checkDataType)(Oe.type,$e,xe.strictNumbers)),we(R,Oe),q.length===1&&q[0]===Oe.type&&J&&(V.else(),(0,r.reportTypeError)(R)),V.endIf()):we(R,Oe),ve||V.if((0,c._)`${u.default.errors} === ${X||0}`))}}function we(R,q){const{gen:J,schema:X,opts:{useDefaults:V}}=R;V&&(0,i.assignDefaults)(R,q.type),J.block(()=>{for(const ce of q.rules)(0,n.shouldUseRule)(X,ce)&&te(R,ce.keyword,ce.definition,q.type)})}function he(R,q){R.schemaEnv.meta||!R.opts.strictTypes||(Q(R,q),R.opts.allowUnionTypes||Y(R,q),M(R,R.dataTypes))}function Q(R,q){if(q.length){if(!R.dataTypes.length){R.dataTypes=q;return}q.forEach(J=>{z(R.dataTypes,J)||N(R,`type "${J}" not allowed by context "${R.dataTypes.join(",")}"`)}),v(R,q)}}function Y(R,q){q.length>1&&!(q.length===2&&q.includes("null"))&&N(R,"use allowUnionTypes to allow union type keyword")}function M(R,q){const J=R.self.RULES.all;for(const X in J){const V=J[X];if(typeof V=="object"&&(0,n.shouldUseRule)(R.schema,V)){const{type:ce}=V.definition;ce.length&&!ce.some($e=>U(q,$e))&&N(R,`missing type "${ce.join(",")}" for keyword "${X}"`)}}}function U(R,q){return R.includes(q)||q==="number"&&R.includes("integer")}function z(R,q){return R.includes(q)||q==="integer"&&R.includes("number")}function v(R,q){const J=[];for(const X of R.dataTypes)z(q,X)?J.push(X):q.includes("integer")&&X==="number"&&J.push("integer");R.dataTypes=J}function N(R,q){const J=R.schemaEnv.baseId+R.errSchemaPath;q+=` at "${J}" (strictTypes)`,(0,l.checkStrictMode)(R,q,R.opts.strictTypes)}class E{constructor(q,J,X){if((0,a.validateKeywordUsage)(q,J,X),this.gen=q.gen,this.allErrors=q.allErrors,this.keyword=X,this.data=q.data,this.schema=q.schema[X],this.$data=J.$data&&q.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,l.schemaRefOrVal)(q,this.schema,X,this.$data),this.schemaType=J.schemaType,this.parentSchema=q.schema,this.params={},this.it=q,this.def=J,this.$data)this.schemaCode=q.gen.const("vSchema",pe(this.$data,q));else if(this.schemaCode=this.schemaValue,!(0,a.validSchemaType)(this.schema,J.schemaType,J.allowUndefined))throw new Error(`${X} value must be ${JSON.stringify(J.schemaType)}`);("code"in J?J.trackErrors:J.errors!==!1)&&(this.errsCount=q.gen.const("_errs",u.default.errors))}result(q,J,X){this.failResult((0,c.not)(q),J,X)}failResult(q,J,X){this.gen.if(q),X?X():this.error(),J?(this.gen.else(),J(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(q,J){this.failResult((0,c.not)(q),void 0,J)}fail(q){if(q===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(q),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(q){if(!this.$data)return this.fail(q);const{schemaCode:J}=this;this.fail((0,c._)`${J} !== undefined && (${(0,c.or)(this.invalid$data(),q)})`)}error(q,J,X){if(J){this.setParams(J),this._error(q,X),this.setParams({});return}this._error(q,X)}_error(q,J){(q?m.reportExtraError:m.reportError)(this,this.def.error,J)}$dataError(){(0,m.reportError)(this,this.def.$dataError||m.keyword$DataError)}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0,m.resetErrorsCount)(this.gen,this.errsCount)}ok(q){this.allErrors||this.gen.if(q)}setParams(q,J){J?Object.assign(this.params,q):this.params=q}block$data(q,J,X=c.nil){this.gen.block(()=>{this.check$data(q,X),J()})}check$data(q=c.nil,J=c.nil){if(!this.$data)return;const{gen:X,schemaCode:V,schemaType:ce,def:$e}=this;X.if((0,c.or)((0,c._)`${V} === undefined`,J)),q!==c.nil&&X.assign(q,!0),(ce.length||$e.validateSchema)&&(X.elseIf(this.invalid$data()),this.$dataError(),q!==c.nil&&X.assign(q,!1)),X.else()}invalid$data(){const{gen:q,schemaCode:J,schemaType:X,def:V,it:ce}=this;return(0,c.or)($e(),ve());function $e(){if(X.length){if(!(J instanceof c.Name))throw new Error("ajv implementation error");const xe=Array.isArray(X)?X:[X];return(0,c._)`${(0,r.checkDataTypes)(xe,J,ce.opts.strictNumbers,r.DataType.Wrong)}`}return c.nil}function ve(){if(V.validateSchema){const xe=q.scopeValue("validate$data",{ref:V.validateSchema});return(0,c._)`!${xe}(${J})`}return c.nil}}subschema(q,J){const X=(0,s.getSubschema)(this.it,q);(0,s.extendSubschemaData)(X,this.it,q),(0,s.extendSubschemaMode)(X,q);const V={...this.it,...X,items:void 0,props:void 0};return x(V,J),V}mergeEvaluated(q,J){const{it:X,gen:V}=this;X.opts.unevaluated&&(X.props!==!0&&q.props!==void 0&&(X.props=l.mergeEvaluated.props(V,q.props,X.props,J)),X.items!==!0&&q.items!==void 0&&(X.items=l.mergeEvaluated.items(V,q.items,X.items,J)))}mergeValidEvaluated(q,J){const{it:X,gen:V}=this;if(X.opts.unevaluated&&(X.props!==!0||X.items!==!0))return V.if(J,()=>this.mergeEvaluated(q,c.Name)),!0}}vt.KeywordCxt=E;function te(R,q,J,X){const V=new E(R,J,q);"code"in J?J.code(V,X):V.$data&&J.validate?(0,a.funcKeywordCode)(V,J):"macro"in J?(0,a.macroKeywordCode)(V,J):(J.compile||J.validate)&&(0,a.funcKeywordCode)(V,J)}const ee=/^\/(?:[^~]|~0|~1)*$/,se=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function pe(R,{dataLevel:q,dataNames:J,dataPathArr:X}){let V,ce;if(R==="")return u.default.rootData;if(R[0]==="/"){if(!ee.test(R))throw new Error(`Invalid JSON-pointer: ${R}`);V=R,ce=u.default.rootData}else{const Te=se.exec(R);if(!Te)throw new Error(`Invalid JSON-pointer: ${R}`);const Pe=+Te[1];if(V=Te[2],V==="#"){if(Pe>=q)throw new Error(xe("property/index",Pe));return X[q-Pe]}if(Pe>q)throw new Error(xe("data",Pe));if(ce=J[q-Pe],!V)return ce}let $e=ce;const ve=V.split("/");for(const Te of ve)Te&&(ce=(0,c._)`${ce}${(0,c.getProperty)((0,l.unescapeJsonPointer)(Te))}`,$e=(0,c._)`${$e} && ${ce}`);return $e;function xe(Te,Pe){return`Cannot access ${Te} ${Pe} levels up, current level is ${q}`}}return vt.getData=pe,vt}var on={},Sa;function Lr(){if(Sa)return on;Sa=1,Object.defineProperty(on,"__esModule",{value:!0});class t extends Error{constructor(n){super("validation failed"),this.errors=n,this.ajv=this.validation=!0}}return on.default=t,on}var sn={},Na;function lr(){if(Na)return sn;Na=1,Object.defineProperty(sn,"__esModule",{value:!0});const t=sr();class e extends Error{constructor(r,i,a,s){super(s||`can't resolve reference ${a} from id ${i}`),this.missingRef=(0,t.resolveUrl)(r,i,a),this.missingSchema=(0,t.normalizeId)((0,t.getFullPath)(r,this.missingRef))}}return sn.default=e,sn}var Ze={},Ca;function dr(){if(Ca)return Ze;Ca=1,Object.defineProperty(Ze,"__esModule",{value:!0}),Ze.resolveSchema=Ze.getCompilingSchema=Ze.resolveRef=Ze.compileSchema=Ze.SchemaEnv=void 0;const t=me(),e=Lr(),n=ct(),r=sr(),i=ye(),a=cr();class s{constructor(b){var f;this.refs={},this.dynamicAnchors={};let x;typeof b.schema=="object"&&(x=b.schema),this.schema=b.schema,this.schemaId=b.schemaId,this.root=b.root||this,this.baseId=(f=b.baseId)!==null&&f!==void 0?f:(0,r.normalizeId)(x==null?void 0:x[b.schemaId||"$id"]),this.schemaPath=b.schemaPath,this.localRefs=b.localRefs,this.meta=b.meta,this.$async=x==null?void 0:x.$async,this.refs={}}}Ze.SchemaEnv=s;function c(_){const b=l.call(this,_);if(b)return b;const f=(0,r.getFullPath)(this.opts.uriResolver,_.root.baseId),{es5:x,lines:C}=this.opts.code,{ownProperties:p}=this.opts,h=new t.CodeGen(this.scope,{es5:x,lines:C,ownProperties:p});let y;_.$async&&(y=h.scopeValue("Error",{ref:e.default,code:(0,t._)`require("ajv/dist/runtime/validation_error").default`}));const w=h.scopeName("validate");_.validateName=w;const A={gen:h,allErrors:this.opts.allErrors,data:n.default.data,parentData:n.default.parentData,parentDataProperty:n.default.parentDataProperty,dataNames:[n.default.data],dataPathArr:[t.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:h.scopeValue("schema",this.opts.code.source===!0?{ref:_.schema,code:(0,t.stringify)(_.schema)}:{ref:_.schema}),validateName:w,ValidationError:y,schema:_.schema,schemaEnv:_,rootId:f,baseId:_.baseId||f,schemaPath:t.nil,errSchemaPath:_.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,t._)`""`,opts:this.opts,self:this};let S;try{this._compilations.add(_),(0,a.validateFunctionCode)(A),h.optimize(this.opts.code.optimize);const O=h.toString();S=`${h.scopeRefs(n.default.scope)}return ${O}`,this.opts.code.process&&(S=this.opts.code.process(S,_));const B=new Function(`${n.default.self}`,`${n.default.scope}`,S)(this,this.scope.get());if(this.scope.value(w,{ref:B}),B.errors=null,B.schema=_.schema,B.schemaEnv=_,_.$async&&(B.$async=!0),this.opts.code.source===!0&&(B.source={validateName:w,validateCode:O,scopeValues:h._values}),this.opts.unevaluated){const{props:W,items:ae}=A;B.evaluated={props:W instanceof t.Name?void 0:W,items:ae instanceof t.Name?void 0:ae,dynamicProps:W instanceof t.Name,dynamicItems:ae instanceof t.Name},B.source&&(B.source.evaluated=(0,t.stringify)(B.evaluated))}return _.validate=B,_}catch(O){throw delete _.validate,delete _.validateName,S&&this.logger.error("Error compiling schema, function code:",S),O}finally{this._compilations.delete(_)}}Ze.compileSchema=c;function u(_,b,f){var x;f=(0,r.resolveUrl)(this.opts.uriResolver,b,f);const C=_.refs[f];if(C)return C;let p=g.call(this,_,f);if(p===void 0){const h=(x=_.localRefs)===null||x===void 0?void 0:x[f],{schemaId:y}=this.opts;h&&(p=new s({schema:h,schemaId:y,root:_,baseId:b}))}if(p!==void 0)return _.refs[f]=d.call(this,p)}Ze.resolveRef=u;function d(_){return(0,r.inlineRef)(_.schema,this.opts.inlineRefs)?_.schema:_.validate?_:c.call(this,_)}function l(_){for(const b of this._compilations)if(m(b,_))return b}Ze.getCompilingSchema=l;function m(_,b){return _.schema===b.schema&&_.root===b.root&&_.baseId===b.baseId}function g(_,b){let f;for(;typeof(f=this.refs[b])=="string";)b=f;return f||this.schemas[b]||$.call(this,_,b)}function $(_,b){const f=this.opts.uriResolver.parse(b),x=(0,r._getFullPath)(this.opts.uriResolver,f);let C=(0,r.getFullPath)(this.opts.uriResolver,_.baseId,void 0);if(Object.keys(_.schema).length>0&&x===C)return j.call(this,f,_);const p=(0,r.normalizeId)(x),h=this.refs[p]||this.schemas[p];if(typeof h=="string"){const y=$.call(this,_,h);return typeof(y==null?void 0:y.schema)!="object"?void 0:j.call(this,f,y)}if(typeof(h==null?void 0:h.schema)=="object"){if(h.validate||c.call(this,h),p===(0,r.normalizeId)(b)){const{schema:y}=h,{schemaId:w}=this.opts,A=y[w];return A&&(C=(0,r.resolveUrl)(this.opts.uriResolver,C,A)),new s({schema:y,schemaId:w,root:_,baseId:C})}return j.call(this,f,h)}}Ze.resolveSchema=$;const k=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function j(_,{baseId:b,schema:f,root:x}){var C;if(((C=_.fragment)===null||C===void 0?void 0:C[0])!=="/")return;for(const y of _.fragment.slice(1).split("/")){if(typeof f=="boolean")return;const w=f[(0,i.unescapeFragment)(y)];if(w===void 0)return;f=w;const A=typeof f=="object"&&f[this.opts.schemaId];!k.has(y)&&A&&(b=(0,r.resolveUrl)(this.opts.uriResolver,b,A))}let p;if(typeof f!="boolean"&&f.$ref&&!(0,i.schemaHasRulesButRef)(f,this.RULES)){const y=(0,r.resolveUrl)(this.opts.uriResolver,b,f.$ref);p=$.call(this,x,y)}const{schemaId:h}=this.opts;if(p=p||new s({schema:f,schemaId:h,root:x,baseId:b}),p.schema!==p.root.schema)return p}return Ze}const gs="https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",_s="Meta-schema for $data reference (JSON AnySchema extension proposal)",vs="object",bs=["$data"],ws={$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},$s=!1,xs={$id:gs,description:_s,type:vs,required:bs,properties:ws,additionalProperties:$s};var cn={},Yt={exports:{}},xr,Pa;function hi(){if(Pa)return xr;Pa=1;const t=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),e=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u),n=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),r=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),i=RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);function a(p){let h="",y=0,w=0;for(w=0;w<p.length;w++)if(y=p[w].charCodeAt(0),y!==48){if(!(y>=48&&y<=57||y>=65&&y<=70||y>=97&&y<=102))return"";h+=p[w];break}for(w+=1;w<p.length;w++){if(y=p[w].charCodeAt(0),!(y>=48&&y<=57||y>=65&&y<=70||y>=97&&y<=102))return"";h+=p[w]}return h}const s=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function c(p){return p.length=0,!0}function u(p,h,y){if(p.length){const w=a(p);if(w!=="")h.push(w);else return y.error=!0,!1;p.length=0}return!0}function d(p){let h=0;const y={error:!1,address:"",zone:""},w=[],A=[];let S=!1,O=!1,H=u;for(let B=0;B<p.length;B++){const W=p[B];if(!(W==="["||W==="]"))if(W===":"){if(S===!0&&(O=!0),!H(A,w,y))break;if(++h>7){y.error=!0;break}B>0&&p[B-1]===":"&&(S=!0),w.push(":");continue}else if(W==="%"){if(!H(A,w,y))break;H=c}else{A.push(W);continue}}return A.length&&(H===c?y.zone=A.join(""):O?w.push(A.join("")):w.push(a(A))),y.address=w.join(""),y}function l(p){if(m(p,":")<2)return{host:p,isIPV6:!1};const h=d(p);if(h.error)return{host:p,isIPV6:!1};{let y=h.address,w=h.address;return h.zone&&(y+="%"+h.zone,w+="%25"+h.zone),{host:y,isIPV6:!0,escapedHost:w}}}function m(p,h){let y=0;for(let w=0;w<p.length;w++)p[w]===h&&y++;return y}function g(p){let h=p;const y=[];let w=-1,A=0;for(;A=h.length;){if(A===1){if(h===".")break;if(h==="/"){y.push("/");break}else{y.push(h);break}}else if(A===2){if(h[0]==="."){if(h[1]===".")break;if(h[1]==="/"){h=h.slice(2);continue}}else if(h[0]==="/"&&(h[1]==="."||h[1]==="/")){y.push("/");break}}else if(A===3&&h==="/.."){y.length!==0&&y.pop(),y.push("/");break}if(h[0]==="."){if(h[1]==="."){if(h[2]==="/"){h=h.slice(3);continue}}else if(h[1]==="/"){h=h.slice(2);continue}}else if(h[0]==="/"&&h[1]==="."){if(h[2]==="/"){h=h.slice(2);continue}else if(h[2]==="."&&h[3]==="/"){h=h.slice(3),y.length!==0&&y.pop();continue}}if((w=h.indexOf("/",1))===-1){y.push(h);break}else y.push(h.slice(0,w)),h=h.slice(w)}return y.join("")}const $={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},k=/[@/?#:]/g,j=/[@/?#]/g;function _(p,h){const y=h?j:k;return y.lastIndex=0,p.replace(y,w=>$[w])}function b(p,h=!1){if(p.indexOf("%")===-1)return p;let y="";for(let w=0;w<p.length;w++){if(p[w]==="%"&&w+2<p.length){const A=p.slice(w+1,w+3);if(n(A)){const S=A.toUpperCase(),O=String.fromCharCode(parseInt(S,16));h&&r(O)?y+=O:y+="%"+S,w+=2;continue}}y+=p[w]}return y}function f(p){let h="";for(let y=0;y<p.length;y++){if(p[y]==="%"&&y+2<p.length){const w=p.slice(y+1,y+3);if(n(w)){const A=w.toUpperCase(),S=String.fromCharCode(parseInt(A,16));S!=="."&&r(S)?h+=S:h+="%"+A,y+=2;continue}}i(p[y])?h+=p[y]:h+=escape(p[y])}return h}function x(p){let h="";for(let y=0;y<p.length;y++){if(p[y]==="%"&&y+2<p.length){const w=p.slice(y+1,y+3);if(n(w)){h+="%"+w.toUpperCase(),y+=2;continue}}h+=escape(p[y])}return h}function C(p){const h=[];if(p.userinfo!==void 0&&(h.push(p.userinfo),h.push("@")),p.host!==void 0){let y=unescape(p.host);if(!e(y)){const w=l(y);w.isIPV6===!0?y=`[${w.escapedHost}]`:y=_(y,!1)}h.push(y)}return(typeof p.port=="number"||typeof p.port=="string")&&(h.push(":"),h.push(String(p.port))),h.length?h.join(""):void 0}return xr={nonSimpleDomain:s,recomposeAuthority:C,reescapeHostDelimiters:_,normalizePercentEncoding:b,normalizePathEncoding:f,escapePreservingEscapes:x,removeDotSegments:g,isIPv4:e,isUUID:t,normalizeIPv6:l,stringArrayToHexStripped:a},xr}var jr,Ea;function js(){if(Ea)return jr;Ea=1;const{isUUID:t}=hi(),e=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,n=["http","https","ws","wss","urn","urn:uuid"];function r(p){return n.indexOf(p)!==-1}function i(p){return p.secure===!0?!0:p.secure===!1?!1:p.scheme?p.scheme.length===3&&(p.scheme[0]==="w"||p.scheme[0]==="W")&&(p.scheme[1]==="s"||p.scheme[1]==="S")&&(p.scheme[2]==="s"||p.scheme[2]==="S"):!1}function a(p){return p.host||(p.error=p.error||"HTTP URIs must have a host."),p}function s(p){const h=String(p.scheme).toLowerCase()==="https";return(p.port===(h?443:80)||p.port==="")&&(p.port=void 0),p.path||(p.path="/"),p}function c(p){return p.secure=i(p),p.resourceName=(p.path||"/")+(p.query?"?"+p.query:""),p.path=void 0,p.query=void 0,p}function u(p){if((p.port===(i(p)?443:80)||p.port==="")&&(p.port=void 0),typeof p.secure=="boolean"&&(p.scheme=p.secure?"wss":"ws",p.secure=void 0),p.resourceName){const[h,y]=p.resourceName.split("?");p.path=h&&h!=="/"?h:void 0,p.query=y,p.resourceName=void 0}return p.fragment=void 0,p}function d(p,h){if(!p.path)return p.error="URN can not be parsed",p;const y=p.path.match(e);if(y){const w=h.scheme||p.scheme||"urn";p.nid=y[1].toLowerCase(),p.nss=y[2];const A=`${w}:${h.nid||p.nid}`,S=C(A);p.path=void 0,S&&(p=S.parse(p,h))}else p.error=p.error||"URN can not be parsed.";return p}function l(p,h){if(p.nid===void 0)throw new Error("URN without nid cannot be serialized");const y=h.scheme||p.scheme||"urn",w=p.nid.toLowerCase(),A=`${y}:${h.nid||w}`,S=C(A);S&&(p=S.serialize(p,h));const O=p,H=p.nss;return O.path=`${w||h.nid}:${H}`,h.skipEscape=!0,O}function m(p,h){const y=p;return y.uuid=y.nss,y.nss=void 0,!h.tolerant&&(!y.uuid||!t(y.uuid))&&(y.error=y.error||"UUID is not valid."),y}function g(p){const h=p;return h.nss=(p.uuid||"").toLowerCase(),h}const $={scheme:"http",domainHost:!0,parse:a,serialize:s},k={scheme:"https",domainHost:$.domainHost,parse:a,serialize:s},j={scheme:"ws",domainHost:!0,parse:c,serialize:u},_={scheme:"wss",domainHost:j.domainHost,parse:j.parse,serialize:j.serialize},x={http:$,https:k,ws:j,wss:_,urn:{scheme:"urn",parse:d,serialize:l,skipNormalize:!0},"urn:uuid":{scheme:"urn:uuid",parse:m,serialize:g,skipNormalize:!0}};Object.setPrototypeOf(x,null);function C(p){return p&&(x[p]||x[p.toLowerCase()])||void 0}return jr={wsIsSecure:i,SCHEMES:x,isValidSchemeName:r,getSchemeHandler:C},jr}var Aa;function ks(){if(Aa)return Yt.exports;Aa=1;const{normalizeIPv6:t,removeDotSegments:e,recomposeAuthority:n,normalizePercentEncoding:r,normalizePathEncoding:i,escapePreservingEscapes:a,reescapeHostDelimiters:s,isIPv4:c,nonSimpleDomain:u}=hi(),{SCHEMES:d,getSchemeHandler:l}=js();function m(w,A){return typeof w=="string"?w=C(w,A):typeof w=="object"&&(w=x(j(w,A),A)),w}function g(w,A,S){const O=S?Object.assign({scheme:"null"},S):{scheme:"null"},H=$(x(w,O),x(A,O),O,!0);return O.skipEscape=!0,j(H,O)}function $(w,A,S,O){const H={};return O||(w=x(j(w,S),S),A=x(j(A,S),S)),S=S||{},!S.tolerant&&A.scheme?(H.scheme=A.scheme,H.userinfo=A.userinfo,H.host=A.host,H.port=A.port,H.path=e(A.path||""),H.query=A.query):(A.userinfo!==void 0||A.host!==void 0||A.port!==void 0?(H.userinfo=A.userinfo,H.host=A.host,H.port=A.port,H.path=e(A.path||""),H.query=A.query):(A.path?(A.path[0]==="/"?H.path=e(A.path):((w.userinfo!==void 0||w.host!==void 0||w.port!==void 0)&&!w.path?H.path="/"+A.path:w.path?H.path=w.path.slice(0,w.path.lastIndexOf("/")+1)+A.path:H.path=A.path,H.path=e(H.path)),H.query=A.query):(H.path=w.path,A.query!==void 0?H.query=A.query:H.query=w.query),H.userinfo=w.userinfo,H.host=w.host,H.port=w.port),H.scheme=w.scheme),H.fragment=A.fragment,H}function k(w,A,S){const O=h(w,S),H=h(A,S);return O!==void 0&&H!==void 0&&O.toLowerCase()===H.toLowerCase()}function j(w,A){const S={host:w.host,scheme:w.scheme,userinfo:w.userinfo,port:w.port,path:w.path,query:w.query,nid:w.nid,nss:w.nss,uuid:w.uuid,fragment:w.fragment,reference:w.reference,resourceName:w.resourceName,secure:w.secure,error:""},O=Object.assign({},A),H=[],B=l(O.scheme||S.scheme);B&&B.serialize&&B.serialize(S,O),S.path!==void 0&&(O.skipEscape?S.path=r(S.path):(S.path=a(S.path),S.scheme!==void 0&&(S.path=S.path.split("%3A").join(":")))),O.reference!=="suffix"&&S.scheme&&H.push(S.scheme,":");const W=n(S);if(W!==void 0&&(O.reference!=="suffix"&&H.push("//"),H.push(W),S.path&&S.path[0]!=="/"&&H.push("/")),S.path!==void 0){let ae=S.path;!O.absolutePath&&(!B||!B.absolutePath)&&(ae=e(ae)),W===void 0&&ae[0]==="/"&&ae[1]==="/"&&(ae="/%2F"+ae.slice(2)),H.push(ae)}return S.query!==void 0&&H.push("?",S.query),S.fragment!==void 0&&H.push("#",S.fragment),H.join("")}const _=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function b(w,A){if(A[2]!==void 0&&w.path&&w.path[0]!=="/")return'URI path must start with "/" when authority is present.';if(typeof w.port=="number"&&(w.port<0||w.port>65535))return"URI port is malformed."}function f(w,A){const S=Object.assign({},A),O={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0};let H=!1,B=!1;S.reference==="suffix"&&(S.scheme?w=S.scheme+":"+w:w="//"+w);const W=w.match(_);if(W){O.scheme=W[1],O.userinfo=W[3],O.host=W[4],O.port=parseInt(W[5],10),O.path=W[6]||"",O.query=W[7],O.fragment=W[8],isNaN(O.port)&&(O.port=W[5]);const ae=b(O,W);if(ae!==void 0&&(O.error=O.error||ae,H=!0),O.host)if(c(O.host)===!1){const he=t(O.host);O.host=he.host.toLowerCase(),B=he.isIPV6}else B=!0;O.scheme===void 0&&O.userinfo===void 0&&O.host===void 0&&O.port===void 0&&O.query===void 0&&!O.path?O.reference="same-document":O.scheme===void 0?O.reference="relative":O.fragment===void 0?O.reference="absolute":O.reference="uri",S.reference&&S.reference!=="suffix"&&S.reference!==O.reference&&(O.error=O.error||"URI is not a "+S.reference+" reference.");const oe=l(S.scheme||O.scheme);if(!S.unicodeSupport&&(!oe||!oe.unicodeSupport)&&O.host&&(S.domainHost||oe&&oe.domainHost)&&B===!1&&u(O.host))try{O.host=URL.domainToASCII(O.host.toLowerCase())}catch(we){O.error=O.error||"Host's domain name can not be converted to ASCII: "+we}if((!oe||oe&&!oe.skipNormalize)&&(w.indexOf("%")!==-1&&(O.scheme!==void 0&&(O.scheme=unescape(O.scheme)),O.host!==void 0&&(O.host=s(unescape(O.host),B))),O.path&&(O.path=i(O.path)),O.fragment))try{O.fragment=encodeURI(decodeURIComponent(O.fragment))}catch{O.error=O.error||"URI malformed"}oe&&oe.parse&&oe.parse(O,S)}else O.error=O.error||"URI can not be parsed.";return{parsed:O,malformedAuthorityOrPort:H}}function x(w,A){return f(w,A).parsed}function C(w,A){return p(w,A).normalized}function p(w,A){const{parsed:S,malformedAuthorityOrPort:O}=f(w,A);return{normalized:O?w:j(S,A),malformedAuthorityOrPort:O}}function h(w,A){if(typeof w=="string"){const{normalized:S,malformedAuthorityOrPort:O}=p(w,A);return O?void 0:S}if(typeof w=="object")return j(w,A)}const y={SCHEMES:d,normalize:m,resolve:g,resolveComponent:$,equal:k,serialize:j,parse:x};return Yt.exports=y,Yt.exports.default=y,Yt.exports.fastUri=y,Yt.exports}var Ra;function Ss(){if(Ra)return cn;Ra=1,Object.defineProperty(cn,"__esModule",{value:!0});const t=ks();return t.code='require("ajv/dist/runtime/uri").default',cn.default=t,cn}var Ta;function Ns(){return Ta||(Ta=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=void 0;var e=cr();Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return e.KeywordCxt}});var n=me();Object.defineProperty(t,"_",{enumerable:!0,get:function(){return n._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return n.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return n.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return n.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return n.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return n.CodeGen}});const r=Lr(),i=lr(),a=di(),s=dr(),c=me(),u=sr(),d=rr(),l=ye(),m=xs,g=Ss(),$=(Y,M)=>new RegExp(Y,M);$.code="new RegExp";const k=["removeAdditional","useDefaults","coerceTypes"],j=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),_={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},b={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},f=200;function x(Y){var M,U,z,v,N,E,te,ee,se,pe,R,q,J,X,V,ce,$e,ve,xe,Te,Pe,Qe,Oe,jt,gt;const ut=Y.strict,L=(M=Y.code)===null||M===void 0?void 0:M.optimize,F=L===!0||L===void 0?1:L||0,Z=(z=(U=Y.code)===null||U===void 0?void 0:U.regExp)!==null&&z!==void 0?z:$,ie=(v=Y.uriResolver)!==null&&v!==void 0?v:g.default;return{strictSchema:(E=(N=Y.strictSchema)!==null&&N!==void 0?N:ut)!==null&&E!==void 0?E:!0,strictNumbers:(ee=(te=Y.strictNumbers)!==null&&te!==void 0?te:ut)!==null&&ee!==void 0?ee:!0,strictTypes:(pe=(se=Y.strictTypes)!==null&&se!==void 0?se:ut)!==null&&pe!==void 0?pe:"log",strictTuples:(q=(R=Y.strictTuples)!==null&&R!==void 0?R:ut)!==null&&q!==void 0?q:"log",strictRequired:(X=(J=Y.strictRequired)!==null&&J!==void 0?J:ut)!==null&&X!==void 0?X:!1,code:Y.code?{...Y.code,optimize:F,regExp:Z}:{optimize:F,regExp:Z},loopRequired:(V=Y.loopRequired)!==null&&V!==void 0?V:f,loopEnum:(ce=Y.loopEnum)!==null&&ce!==void 0?ce:f,meta:($e=Y.meta)!==null&&$e!==void 0?$e:!0,messages:(ve=Y.messages)!==null&&ve!==void 0?ve:!0,inlineRefs:(xe=Y.inlineRefs)!==null&&xe!==void 0?xe:!0,schemaId:(Te=Y.schemaId)!==null&&Te!==void 0?Te:"$id",addUsedSchema:(Pe=Y.addUsedSchema)!==null&&Pe!==void 0?Pe:!0,validateSchema:(Qe=Y.validateSchema)!==null&&Qe!==void 0?Qe:!0,validateFormats:(Oe=Y.validateFormats)!==null&&Oe!==void 0?Oe:!0,unicodeRegExp:(jt=Y.unicodeRegExp)!==null&&jt!==void 0?jt:!0,int32range:(gt=Y.int32range)!==null&>!==void 0?gt:!0,uriResolver:ie}}class C{constructor(M={}){this.schemas={},this.refs={},this.formats=Object.create(null),this._compilations=new Set,this._loading={},this._cache=new Map,M=this.opts={...M,...x(M)};const{es5:U,lines:z}=this.opts.code;this.scope=new c.ValueScope({scope:{},prefixes:j,es5:U,lines:z}),this.logger=H(M.logger);const v=M.validateFormats;M.validateFormats=!1,this.RULES=(0,a.getRules)(),p.call(this,_,M,"NOT SUPPORTED"),p.call(this,b,M,"DEPRECATED","warn"),this._metaOpts=S.call(this),M.formats&&w.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),M.keywords&&A.call(this,M.keywords),typeof M.meta=="object"&&this.addMetaSchema(M.meta),y.call(this),M.validateFormats=v}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:M,meta:U,schemaId:z}=this.opts;let v=m;z==="id"&&(v={...m},v.id=v.$id,delete v.$id),U&&M&&this.addMetaSchema(v,v[z],!1)}defaultMeta(){const{meta:M,schemaId:U}=this.opts;return this.opts.defaultMeta=typeof M=="object"?M[U]||M:void 0}validate(M,U){let z;if(typeof M=="string"){if(z=this.getSchema(M),!z)throw new Error(`no schema with key or ref "${M}"`)}else z=this.compile(M);const v=z(U);return"$async"in z||(this.errors=z.errors),v}compile(M,U){const z=this._addSchema(M,U);return z.validate||this._compileSchemaEnv(z)}compileAsync(M,U){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");const{loadSchema:z}=this.opts;return v.call(this,M,U);async function v(pe,R){await N.call(this,pe.$schema);const q=this._addSchema(pe,R);return q.validate||E.call(this,q)}async function N(pe){pe&&!this.getSchema(pe)&&await v.call(this,{$ref:pe},!0)}async function E(pe){try{return this._compileSchemaEnv(pe)}catch(R){if(!(R instanceof i.default))throw R;return te.call(this,R),await ee.call(this,R.missingSchema),E.call(this,pe)}}function te({missingSchema:pe,missingRef:R}){if(this.refs[pe])throw new Error(`AnySchema ${pe} is loaded but ${R} cannot be resolved`)}async function ee(pe){const R=await se.call(this,pe);this.refs[pe]||await N.call(this,R.$schema),this.refs[pe]||this.addSchema(R,pe,U)}async function se(pe){const R=this._loading[pe];if(R)return R;try{return await(this._loading[pe]=z(pe))}finally{delete this._loading[pe]}}}addSchema(M,U,z,v=this.opts.validateSchema){if(Array.isArray(M)){for(const E of M)this.addSchema(E,void 0,z,v);return this}let N;if(typeof M=="object"){const{schemaId:E}=this.opts;if(N=M[E],N!==void 0&&typeof N!="string")throw new Error(`schema ${E} must be string`)}return U=(0,u.normalizeId)(U||N),this._checkUnique(U),this.schemas[U]=this._addSchema(M,z,U,v,!0),this}addMetaSchema(M,U,z=this.opts.validateSchema){return this.addSchema(M,U,!0,z),this}validateSchema(M,U){if(typeof M=="boolean")return!0;let z;if(z=M.$schema,z!==void 0&&typeof z!="string")throw new Error("$schema must be a string");if(z=z||this.opts.defaultMeta||this.defaultMeta(),!z)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const v=this.validate(z,M);if(!v&&U){const N="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(N);else throw new Error(N)}return v}getSchema(M){let U;for(;typeof(U=h.call(this,M))=="string";)M=U;if(U===void 0){const{schemaId:z}=this.opts,v=new s.SchemaEnv({schema:{},schemaId:z});if(U=s.resolveSchema.call(this,v,M),!U)return;this.refs[M]=U}return U.validate||this._compileSchemaEnv(U)}removeSchema(M){if(M instanceof RegExp)return this._removeAllSchemas(this.schemas,M),this._removeAllSchemas(this.refs,M),this;switch(typeof M){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const U=h.call(this,M);return typeof U=="object"&&this._cache.delete(U.schema),delete this.schemas[M],delete this.refs[M],this}case"object":{const U=M;this._cache.delete(U);let z=M[this.opts.schemaId];return z&&(z=(0,u.normalizeId)(z),delete this.schemas[z],delete this.refs[z]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(M){for(const U of M)this.addKeyword(U);return this}addKeyword(M,U){let z;if(typeof M=="string")z=M,typeof U=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),U.keyword=z);else if(typeof M=="object"&&U===void 0){if(U=M,z=U.keyword,Array.isArray(z)&&!z.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(W.call(this,z,U),!U)return(0,l.eachItem)(z,N=>ae.call(this,N)),this;we.call(this,U);const v={...U,type:(0,d.getJSONTypes)(U.type),schemaType:(0,d.getJSONTypes)(U.schemaType)};return(0,l.eachItem)(z,v.type.length===0?N=>ae.call(this,N,v):N=>v.type.forEach(E=>ae.call(this,N,v,E))),this}getKeyword(M){const U=this.RULES.all[M];return typeof U=="object"?U.definition:!!U}removeKeyword(M){const{RULES:U}=this;delete U.keywords[M],delete U.all[M];for(const z of U.rules){const v=z.rules.findIndex(N=>N.keyword===M);v>=0&&z.rules.splice(v,1)}return this}addFormat(M,U){return typeof U=="string"&&(U=new RegExp(U)),this.formats[M]=U,this}errorsText(M=this.errors,{separator:U=", ",dataVar:z="data"}={}){return!M||M.length===0?"No errors":M.map(v=>`${z}${v.instancePath} ${v.message}`).reduce((v,N)=>v+U+N)}$dataMetaSchema(M,U){const z=this.RULES.all;M=JSON.parse(JSON.stringify(M));for(const v of U){const N=v.split("/").slice(1);let E=M;for(const te of N)E=E[te];for(const te in z){const ee=z[te];if(typeof ee!="object")continue;const{$data:se}=ee.definition,pe=E[te];se&&pe&&(E[te]=Q(pe))}}return M}_removeAllSchemas(M,U){for(const z in M){const v=M[z];(!U||U.test(z))&&(typeof v=="string"?delete M[z]:v&&!v.meta&&(this._cache.delete(v.schema),delete M[z]))}}_addSchema(M,U,z,v=this.opts.validateSchema,N=this.opts.addUsedSchema){let E;const{schemaId:te}=this.opts;if(typeof M=="object")E=M[te];else{if(this.opts.jtd)throw new Error("schema must be object");if(typeof M!="boolean")throw new Error("schema must be object or boolean")}let ee=this._cache.get(M);if(ee!==void 0)return ee;z=(0,u.normalizeId)(E||z);const se=u.getSchemaRefs.call(this,M,z);return ee=new s.SchemaEnv({schema:M,schemaId:te,meta:U,baseId:z,localRefs:se}),this._cache.set(ee.schema,ee),N&&!z.startsWith("#")&&(z&&this._checkUnique(z),this.refs[z]=ee),v&&this.validateSchema(M,!0),ee}_checkUnique(M){if(this.schemas[M]||this.refs[M])throw new Error(`schema with key or id "${M}" already exists`)}_compileSchemaEnv(M){if(M.meta?this._compileMetaSchema(M):s.compileSchema.call(this,M),!M.validate)throw new Error("ajv implementation error");return M.validate}_compileMetaSchema(M){const U=this.opts;this.opts=this._metaOpts;try{s.compileSchema.call(this,M)}finally{this.opts=U}}}C.ValidationError=r.default,C.MissingRefError=i.default,t.default=C;function p(Y,M,U,z="error"){for(const v in Y){const N=v;N in M&&this.logger[z](`${U}: option ${v}. ${Y[N]}`)}}function h(Y){return Y=(0,u.normalizeId)(Y),this.schemas[Y]||this.refs[Y]}function y(){const Y=this.opts.schemas;if(Y)if(Array.isArray(Y))this.addSchema(Y);else for(const M in Y)this.addSchema(Y[M],M)}function w(){for(const Y in this.opts.formats){const M=this.opts.formats[Y];M&&this.addFormat(Y,M)}}function A(Y){if(Array.isArray(Y)){this.addVocabulary(Y);return}this.logger.warn("keywords option as map is deprecated, pass array");for(const M in Y){const U=Y[M];U.keyword||(U.keyword=M),this.addKeyword(U)}}function S(){const Y={...this.opts};for(const M of k)delete Y[M];return Y}const O={log(){},warn(){},error(){}};function H(Y){if(Y===!1)return O;if(Y===void 0)return console;if(Y.log&&Y.warn&&Y.error)return Y;throw new Error("logger must implement log, warn and error methods")}const B=/^[a-z_$][a-z0-9_$:-]*$/i;function W(Y,M){const{RULES:U}=this;if((0,l.eachItem)(Y,z=>{if(U.keywords[z])throw new Error(`Keyword ${z} is already defined`);if(!B.test(z))throw new Error(`Keyword ${z} has invalid name`)}),!!M&&M.$data&&!("code"in M||"validate"in M))throw new Error('$data keyword must have "code" or "validate" function')}function ae(Y,M,U){var z;const v=M==null?void 0:M.post;if(U&&v)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:N}=this;let E=v?N.post:N.rules.find(({type:ee})=>ee===U);if(E||(E={type:U,rules:[]},N.rules.push(E)),N.keywords[Y]=!0,!M)return;const te={keyword:Y,definition:{...M,type:(0,d.getJSONTypes)(M.type),schemaType:(0,d.getJSONTypes)(M.schemaType)}};M.before?oe.call(this,E,te,M.before):E.rules.push(te),N.all[Y]=te,(z=M.implements)===null||z===void 0||z.forEach(ee=>this.addKeyword(ee))}function oe(Y,M,U){const z=Y.rules.findIndex(v=>v.keyword===U);z>=0?Y.rules.splice(z,0,M):(Y.rules.push(M),this.logger.warn(`rule ${U} is not defined`))}function we(Y){let{metaSchema:M}=Y;M!==void 0&&(Y.$data&&this.opts.$data&&(M=Q(M)),Y.validateSchema=this.compile(M,!0))}const he={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function Q(Y){return{anyOf:[Y,he]}}})(yr)),yr}var ln={},dn={},un={},Ia;function Cs(){if(Ia)return un;Ia=1,Object.defineProperty(un,"__esModule",{value:!0});const t={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};return un.default=t,un}var kt={},Ma;function Hr(){if(Ma)return kt;Ma=1,Object.defineProperty(kt,"__esModule",{value:!0}),kt.callRef=kt.getValidate=void 0;const t=lr(),e=lt(),n=me(),r=ct(),i=dr(),a=ye(),s={keyword:"$ref",schemaType:"string",code(d){const{gen:l,schema:m,it:g}=d,{baseId:$,schemaEnv:k,validateName:j,opts:_,self:b}=g,{root:f}=k;if((m==="#"||m==="#/")&&$===f.baseId)return C();const x=i.resolveRef.call(b,f,$,m);if(x===void 0)throw new t.default(g.opts.uriResolver,$,m);if(x instanceof i.SchemaEnv)return p(x);return h(x);function C(){if(k===f)return u(d,j,k,k.$async);const y=l.scopeValue("root",{ref:f});return u(d,(0,n._)`${y}.validate`,f,f.$async)}function p(y){const w=c(d,y);u(d,w,y,y.$async)}function h(y){const w=l.scopeValue("schema",_.code.source===!0?{ref:y,code:(0,n.stringify)(y)}:{ref:y}),A=l.name("valid"),S=d.subschema({schema:y,dataTypes:[],schemaPath:n.nil,topSchemaRef:w,errSchemaPath:m},A);d.mergeEvaluated(S),d.ok(A)}}};function c(d,l){const{gen:m}=d;return l.validate?m.scopeValue("validate",{ref:l.validate}):(0,n._)`${m.scopeValue("wrapper",{ref:l})}.validate`}kt.getValidate=c;function u(d,l,m,g){const{gen:$,it:k}=d,{allErrors:j,schemaEnv:_,opts:b}=k,f=b.passContext?r.default.this:n.nil;g?x():C();function x(){if(!_.$async)throw new Error("async schema referenced by sync schema");const y=$.let("valid");$.try(()=>{$.code((0,n._)`await ${(0,e.callValidateCode)(d,l,f)}`),h(l),j||$.assign(y,!0)},w=>{$.if((0,n._)`!(${w} instanceof ${k.ValidationError})`,()=>$.throw(w)),p(w),j||$.assign(y,!1)}),d.ok(y)}function C(){d.result((0,e.callValidateCode)(d,l,f),()=>h(l),()=>p(l))}function p(y){const w=(0,n._)`${y}.errors`;$.assign(r.default.vErrors,(0,n._)`${r.default.vErrors} === null ? ${w} : ${r.default.vErrors}.concat(${w})`),$.assign(r.default.errors,(0,n._)`${r.default.vErrors}.length`)}function h(y){var w;if(!k.opts.unevaluated)return;const A=(w=m==null?void 0:m.validate)===null||w===void 0?void 0:w.evaluated;if(k.props!==!0)if(A&&!A.dynamicProps)A.props!==void 0&&(k.props=a.mergeEvaluated.props($,A.props,k.props));else{const S=$.var("props",(0,n._)`${y}.evaluated.props`);k.props=a.mergeEvaluated.props($,S,k.props,n.Name)}if(k.items!==!0)if(A&&!A.dynamicItems)A.items!==void 0&&(k.items=a.mergeEvaluated.items($,A.items,k.items));else{const S=$.var("items",(0,n._)`${y}.evaluated.items`);k.items=a.mergeEvaluated.items($,S,k.items,n.Name)}}}return kt.callRef=u,kt.default=s,kt}var Oa;function Ps(){if(Oa)return dn;Oa=1,Object.defineProperty(dn,"__esModule",{value:!0});const t=Cs(),e=Hr(),n=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",t.default,e.default];return dn.default=n,dn}var pn={},hn={},za;function Es(){if(za)return hn;za=1,Object.defineProperty(hn,"__esModule",{value:!0});const t=me(),e=t.operators,n={maximum:{okStr:"<=",ok:e.LTE,fail:e.GT},minimum:{okStr:">=",ok:e.GTE,fail:e.LT},exclusiveMaximum:{okStr:"<",ok:e.LT,fail:e.GTE},exclusiveMinimum:{okStr:">",ok:e.GT,fail:e.LTE}},r={message:({keyword:a,schemaCode:s})=>(0,t.str)`must be ${n[a].okStr} ${s}`,params:({keyword:a,schemaCode:s})=>(0,t._)`{comparison: ${n[a].okStr}, limit: ${s}}`},i={keyword:Object.keys(n),type:"number",schemaType:"number",$data:!0,error:r,code(a){const{keyword:s,data:c,schemaCode:u}=a;a.fail$data((0,t._)`${c} ${n[s].fail} ${u} || isNaN(${c})`)}};return hn.default=i,hn}var mn={},Da;function As(){if(Da)return mn;Da=1,Object.defineProperty(mn,"__esModule",{value:!0});const t=me(),n={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:r})=>(0,t.str)`must be multiple of ${r}`,params:({schemaCode:r})=>(0,t._)`{multipleOf: ${r}}`},code(r){const{gen:i,data:a,schemaCode:s,it:c}=r,u=c.opts.multipleOfPrecision,d=i.let("res"),l=u?(0,t._)`Math.abs(Math.round(${d}) - ${d}) > 1e-${u}`:(0,t._)`${d} !== parseInt(${d})`;r.fail$data((0,t._)`(${s} === 0 || (${d} = ${a}/${s}, ${l}))`)}};return mn.default=n,mn}var fn={},yn={},qa;function Rs(){if(qa)return yn;qa=1,Object.defineProperty(yn,"__esModule",{value:!0});function t(e){const n=e.length;let r=0,i=0,a;for(;i<n;)r++,a=e.charCodeAt(i++),a>=55296&&a<=56319&&i<n&&(a=e.charCodeAt(i),(a&64512)===56320&&i++);return r}return yn.default=t,t.code='require("ajv/dist/runtime/ucs2length").default',yn}var La;function Ts(){if(La)return fn;La=1,Object.defineProperty(fn,"__esModule",{value:!0});const t=me(),e=ye(),n=Rs(),i={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:{message({keyword:a,schemaCode:s}){const c=a==="maxLength"?"more":"fewer";return(0,t.str)`must NOT have ${c} than ${s} characters`},params:({schemaCode:a})=>(0,t._)`{limit: ${a}}`},code(a){const{keyword:s,data:c,schemaCode:u,it:d}=a,l=s==="maxLength"?t.operators.GT:t.operators.LT,m=d.opts.unicode===!1?(0,t._)`${c}.length`:(0,t._)`${(0,e.useFunc)(a.gen,n.default)}(${c})`;a.fail$data((0,t._)`${m} ${l} ${u}`)}};return fn.default=i,fn}var gn={},Ha;function Is(){if(Ha)return gn;Ha=1,Object.defineProperty(gn,"__esModule",{value:!0});const t=lt(),e=ye(),n=me(),i={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:a})=>(0,n.str)`must match pattern "${a}"`,params:({schemaCode:a})=>(0,n._)`{pattern: ${a}}`},code(a){const{gen:s,data:c,$data:u,schema:d,schemaCode:l,it:m}=a,g=m.opts.unicodeRegExp?"u":"";if(u){const{regExp:$}=m.opts.code,k=$.code==="new RegExp"?(0,n._)`new RegExp`:(0,e.useFunc)(s,$),j=s.let("valid");s.try(()=>s.assign(j,(0,n._)`${k}(${l}, ${g}).test(${c})`),()=>s.assign(j,!1)),a.fail$data((0,n._)`!${j}`)}else{const $=(0,t.usePattern)(a,d);a.fail$data((0,n._)`!${$}.test(${c})`)}}};return gn.default=i,gn}var _n={},Ba;function Ms(){if(Ba)return _n;Ba=1,Object.defineProperty(_n,"__esModule",{value:!0});const t=me(),n={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:{message({keyword:r,schemaCode:i}){const a=r==="maxProperties"?"more":"fewer";return(0,t.str)`must NOT have ${a} than ${i} properties`},params:({schemaCode:r})=>(0,t._)`{limit: ${r}}`},code(r){const{keyword:i,data:a,schemaCode:s}=r,c=i==="maxProperties"?t.operators.GT:t.operators.LT;r.fail$data((0,t._)`Object.keys(${a}).length ${c} ${s}`)}};return _n.default=n,_n}var vn={},Va;function Os(){if(Va)return vn;Va=1,Object.defineProperty(vn,"__esModule",{value:!0});const t=lt(),e=me(),n=ye(),i={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:a}})=>(0,e.str)`must have required property '${a}'`,params:({params:{missingProperty:a}})=>(0,e._)`{missingProperty: ${a}}`},code(a){const{gen:s,schema:c,schemaCode:u,data:d,$data:l,it:m}=a,{opts:g}=m;if(!l&&c.length===0)return;const $=c.length>=g.loopRequired;if(m.allErrors?k():j(),g.strictRequired){const f=a.parentSchema.properties,{definedProperties:x}=a.it;for(const C of c)if((f==null?void 0:f[C])===void 0&&!x.has(C)){const p=m.schemaEnv.baseId+m.errSchemaPath,h=`required property "${C}" is not defined at "${p}" (strictRequired)`;(0,n.checkStrictMode)(m,h,m.opts.strictRequired)}}function k(){if($||l)a.block$data(e.nil,_);else for(const f of c)(0,t.checkReportMissingProp)(a,f)}function j(){const f=s.let("missing");if($||l){const x=s.let("valid",!0);a.block$data(x,()=>b(f,x)),a.ok(x)}else s.if((0,t.checkMissingProp)(a,c,f)),(0,t.reportMissingProp)(a,f),s.else()}function _(){s.forOf("prop",u,f=>{a.setParams({missingProperty:f}),s.if((0,t.noPropertyInData)(s,d,f,g.ownProperties),()=>a.error())})}function b(f,x){a.setParams({missingProperty:f}),s.forOf(f,u,()=>{s.assign(x,(0,t.propertyInData)(s,d,f,g.ownProperties)),s.if((0,e.not)(x),()=>{a.error(),s.break()})},e.nil)}}};return vn.default=i,vn}var bn={},Fa;function zs(){if(Fa)return bn;Fa=1,Object.defineProperty(bn,"__esModule",{value:!0});const t=me(),n={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:{message({keyword:r,schemaCode:i}){const a=r==="maxItems"?"more":"fewer";return(0,t.str)`must NOT have ${a} than ${i} items`},params:({schemaCode:r})=>(0,t._)`{limit: ${r}}`},code(r){const{keyword:i,data:a,schemaCode:s}=r,c=i==="maxItems"?t.operators.GT:t.operators.LT;r.fail$data((0,t._)`${a}.length ${c} ${s}`)}};return bn.default=n,bn}var wn={},$n={},Ua;function Br(){if(Ua)return $n;Ua=1,Object.defineProperty($n,"__esModule",{value:!0});const t=pi();return t.code='require("ajv/dist/runtime/equal").default',$n.default=t,$n}var Ja;function Ds(){if(Ja)return wn;Ja=1,Object.defineProperty(wn,"__esModule",{value:!0});const t=rr(),e=me(),n=ye(),r=Br(),a={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i:s,j:c}})=>(0,e.str)`must NOT have duplicate items (items ## ${c} and ${s} are identical)`,params:({params:{i:s,j:c}})=>(0,e._)`{i: ${s}, j: ${c}}`},code(s){const{gen:c,data:u,$data:d,schema:l,parentSchema:m,schemaCode:g,it:$}=s;if(!d&&!l)return;const k=c.let("valid"),j=m.items?(0,t.getSchemaTypes)(m.items):[];s.block$data(k,_,(0,e._)`${g} === false`),s.ok(k);function _(){const C=c.let("i",(0,e._)`${u}.length`),p=c.let("j");s.setParams({i:C,j:p}),c.assign(k,!0),c.if((0,e._)`${C} > 1`,()=>(b()?f:x)(C,p))}function b(){return j.length>0&&!j.some(C=>C==="object"||C==="array")}function f(C,p){const h=c.name("item"),y=(0,t.checkDataTypes)(j,h,$.opts.strictNumbers,t.DataType.Wrong),w=c.const("indices",(0,e._)`{}`);c.for((0,e._)`;${C}--;`,()=>{c.let(h,(0,e._)`${u}[${C}]`),c.if(y,(0,e._)`continue`),j.length>1&&c.if((0,e._)`typeof ${h} == "string"`,(0,e._)`${h} += "_"`),c.if((0,e._)`typeof ${w}[${h}] == "number"`,()=>{c.assign(p,(0,e._)`${w}[${h}]`),s.error(),c.assign(k,!1).break()}).code((0,e._)`${w}[${h}] = ${C}`)})}function x(C,p){const h=(0,n.useFunc)(c,r.default),y=c.name("outer");c.label(y).for((0,e._)`;${C}--;`,()=>c.for((0,e._)`${p} = ${C}; ${p}--;`,()=>c.if((0,e._)`${h}(${u}[${C}], ${u}[${p}])`,()=>{s.error(),c.assign(k,!1).break(y)})))}}};return wn.default=a,wn}var xn={},Ka;function qs(){if(Ka)return xn;Ka=1,Object.defineProperty(xn,"__esModule",{value:!0});const t=me(),e=ye(),n=Br(),i={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:a})=>(0,t._)`{allowedValue: ${a}}`},code(a){const{gen:s,data:c,$data:u,schemaCode:d,schema:l}=a;u||l&&typeof l=="object"?a.fail$data((0,t._)`!${(0,e.useFunc)(s,n.default)}(${c}, ${d})`):a.fail((0,t._)`${l} !== ${c}`)}};return xn.default=i,xn}var jn={},Wa;function Ls(){if(Wa)return jn;Wa=1,Object.defineProperty(jn,"__esModule",{value:!0});const t=me(),e=ye(),n=Br(),i={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:a})=>(0,t._)`{allowedValues: ${a}}`},code(a){const{gen:s,data:c,$data:u,schema:d,schemaCode:l,it:m}=a;if(!u&&d.length===0)throw new Error("enum must have non-empty array");const g=d.length>=m.opts.loopEnum;let $;const k=()=>$??($=(0,e.useFunc)(s,n.default));let j;if(g||u)j=s.let("valid"),a.block$data(j,_);else{if(!Array.isArray(d))throw new Error("ajv implementation error");const f=s.const("vSchema",l);j=(0,t.or)(...d.map((x,C)=>b(f,C)))}a.pass(j);function _(){s.assign(j,!1),s.forOf("v",l,f=>s.if((0,t._)`${k()}(${c}, ${f})`,()=>s.assign(j,!0).break()))}function b(f,x){const C=d[x];return typeof C=="object"&&C!==null?(0,t._)`${k()}(${c}, ${f}[${x}])`:(0,t._)`${c} === ${C}`}}};return jn.default=i,jn}var Ga;function Hs(){if(Ga)return pn;Ga=1,Object.defineProperty(pn,"__esModule",{value:!0});const t=Es(),e=As(),n=Ts(),r=Is(),i=Ms(),a=Os(),s=zs(),c=Ds(),u=qs(),d=Ls(),l=[t.default,e.default,n.default,r.default,i.default,a.default,s.default,c.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},u.default,d.default];return pn.default=l,pn}var kn={},qt={},Ya;function mi(){if(Ya)return qt;Ya=1,Object.defineProperty(qt,"__esModule",{value:!0}),qt.validateAdditionalItems=void 0;const t=me(),e=ye(),r={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:a}})=>(0,t.str)`must NOT have more than ${a} items`,params:({params:{len:a}})=>(0,t._)`{limit: ${a}}`},code(a){const{parentSchema:s,it:c}=a,{items:u}=s;if(!Array.isArray(u)){(0,e.checkStrictMode)(c,'"additionalItems" is ignored when "items" is not an array of schemas');return}i(a,u)}};function i(a,s){const{gen:c,schema:u,data:d,keyword:l,it:m}=a;m.items=!0;const g=c.const("len",(0,t._)`${d}.length`);if(u===!1)a.setParams({len:s.length}),a.pass((0,t._)`${g} <= ${s.length}`);else if(typeof u=="object"&&!(0,e.alwaysValidSchema)(m,u)){const k=c.var("valid",(0,t._)`${g} <= ${s.length}`);c.if((0,t.not)(k),()=>$(k)),a.ok(k)}function $(k){c.forRange("i",s.length,g,j=>{a.subschema({keyword:l,dataProp:j,dataPropType:e.Type.Num},k),m.allErrors||c.if((0,t.not)(k),()=>c.break())})}}return qt.validateAdditionalItems=i,qt.default=r,qt}var Sn={},Lt={},Za;function fi(){if(Za)return Lt;Za=1,Object.defineProperty(Lt,"__esModule",{value:!0}),Lt.validateTuple=void 0;const t=me(),e=ye(),n=lt(),r={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(a){const{schema:s,it:c}=a;if(Array.isArray(s))return i(a,"additionalItems",s);c.items=!0,!(0,e.alwaysValidSchema)(c,s)&&a.ok((0,n.validateArray)(a))}};function i(a,s,c=a.schema){const{gen:u,parentSchema:d,data:l,keyword:m,it:g}=a;j(d),g.opts.unevaluated&&c.length&&g.items!==!0&&(g.items=e.mergeEvaluated.items(u,c.length,g.items));const $=u.name("valid"),k=u.const("len",(0,t._)`${l}.length`);c.forEach((_,b)=>{(0,e.alwaysValidSchema)(g,_)||(u.if((0,t._)`${k} > ${b}`,()=>a.subschema({keyword:m,schemaProp:b,dataProp:b},$)),a.ok($))});function j(_){const{opts:b,errSchemaPath:f}=g,x=c.length,C=x===_.minItems&&(x===_.maxItems||_[s]===!1);if(b.strictTuples&&!C){const p=`"${m}" is ${x}-tuple, but minItems or maxItems/${s} are not specified or different at path "${f}"`;(0,e.checkStrictMode)(g,p,b.strictTuples)}}}return Lt.validateTuple=i,Lt.default=r,Lt}var Xa;function Bs(){if(Xa)return Sn;Xa=1,Object.defineProperty(Sn,"__esModule",{value:!0});const t=fi(),e={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:n=>(0,t.validateTuple)(n,"items")};return Sn.default=e,Sn}var Nn={},Qa;function Vs(){if(Qa)return Nn;Qa=1,Object.defineProperty(Nn,"__esModule",{value:!0});const t=me(),e=ye(),n=lt(),r=mi(),a={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:s}})=>(0,t.str)`must NOT have more than ${s} items`,params:({params:{len:s}})=>(0,t._)`{limit: ${s}}`},code(s){const{schema:c,parentSchema:u,it:d}=s,{prefixItems:l}=u;d.items=!0,!(0,e.alwaysValidSchema)(d,c)&&(l?(0,r.validateAdditionalItems)(s,l):s.ok((0,n.validateArray)(s)))}};return Nn.default=a,Nn}var Cn={},eo;function Fs(){if(eo)return Cn;eo=1,Object.defineProperty(Cn,"__esModule",{value:!0});const t=me(),e=ye(),r={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:i,max:a}})=>a===void 0?(0,t.str)`must contain at least ${i} valid item(s)`:(0,t.str)`must contain at least ${i} and no more than ${a} valid item(s)`,params:({params:{min:i,max:a}})=>a===void 0?(0,t._)`{minContains: ${i}}`:(0,t._)`{minContains: ${i}, maxContains: ${a}}`},code(i){const{gen:a,schema:s,parentSchema:c,data:u,it:d}=i;let l,m;const{minContains:g,maxContains:$}=c;d.opts.next?(l=g===void 0?1:g,m=$):l=1;const k=a.const("len",(0,t._)`${u}.length`);if(i.setParams({min:l,max:m}),m===void 0&&l===0){(0,e.checkStrictMode)(d,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(m!==void 0&&l>m){(0,e.checkStrictMode)(d,'"minContains" > "maxContains" is always invalid'),i.fail();return}if((0,e.alwaysValidSchema)(d,s)){let x=(0,t._)`${k} >= ${l}`;m!==void 0&&(x=(0,t._)`${x} && ${k} <= ${m}`),i.pass(x);return}d.items=!0;const j=a.name("valid");m===void 0&&l===1?b(j,()=>a.if(j,()=>a.break())):l===0?(a.let(j,!0),m!==void 0&&a.if((0,t._)`${u}.length > 0`,_)):(a.let(j,!1),_()),i.result(j,()=>i.reset());function _(){const x=a.name("_valid"),C=a.let("count",0);b(x,()=>a.if(x,()=>f(C)))}function b(x,C){a.forRange("i",0,k,p=>{i.subschema({keyword:"contains",dataProp:p,dataPropType:e.Type.Num,compositeRule:!0},x),C()})}function f(x){a.code((0,t._)`${x}++`),m===void 0?a.if((0,t._)`${x} >= ${l}`,()=>a.assign(j,!0).break()):(a.if((0,t._)`${x} > ${m}`,()=>a.assign(j,!1).break()),l===1?a.assign(j,!0):a.if((0,t._)`${x} >= ${l}`,()=>a.assign(j,!0)))}}};return Cn.default=r,Cn}var kr={},to;function Vr(){return to||(to=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.validateSchemaDeps=t.validatePropertyDeps=t.error=void 0;const e=me(),n=ye(),r=lt();t.error={message:({params:{property:u,depsCount:d,deps:l}})=>{const m=d===1?"property":"properties";return(0,e.str)`must have ${m} ${l} when property ${u} is present`},params:({params:{property:u,depsCount:d,deps:l,missingProperty:m}})=>(0,e._)`{property: ${u},
|
|
7
|
+
missingProperty: ${m},
|
|
8
|
+
depsCount: ${d},
|
|
9
|
+
deps: ${l}}`};const i={keyword:"dependencies",type:"object",schemaType:"object",error:t.error,code(u){const[d,l]=a(u);s(u,d),c(u,l)}};function a({schema:u}){const d={},l={};for(const m in u){if(m==="__proto__")continue;const g=Array.isArray(u[m])?d:l;g[m]=u[m]}return[d,l]}function s(u,d=u.schema){const{gen:l,data:m,it:g}=u;if(Object.keys(d).length===0)return;const $=l.let("missing");for(const k in d){const j=d[k];if(j.length===0)continue;const _=(0,r.propertyInData)(l,m,k,g.opts.ownProperties);u.setParams({property:k,depsCount:j.length,deps:j.join(", ")}),g.allErrors?l.if(_,()=>{for(const b of j)(0,r.checkReportMissingProp)(u,b)}):(l.if((0,e._)`${_} && (${(0,r.checkMissingProp)(u,j,$)})`),(0,r.reportMissingProp)(u,$),l.else())}}t.validatePropertyDeps=s;function c(u,d=u.schema){const{gen:l,data:m,keyword:g,it:$}=u,k=l.name("valid");for(const j in d)(0,n.alwaysValidSchema)($,d[j])||(l.if((0,r.propertyInData)(l,m,j,$.opts.ownProperties),()=>{const _=u.subschema({keyword:g,schemaProp:j},k);u.mergeValidEvaluated(_,k)},()=>l.var(k,!0)),u.ok(k))}t.validateSchemaDeps=c,t.default=i})(kr)),kr}var Pn={},no;function Us(){if(no)return Pn;no=1,Object.defineProperty(Pn,"__esModule",{value:!0});const t=me(),e=ye(),r={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:i})=>(0,t._)`{propertyName: ${i.propertyName}}`},code(i){const{gen:a,schema:s,data:c,it:u}=i;if((0,e.alwaysValidSchema)(u,s))return;const d=a.name("valid");a.forIn("key",c,l=>{i.setParams({propertyName:l}),i.subschema({keyword:"propertyNames",data:l,dataTypes:["string"],propertyName:l,compositeRule:!0},d),a.if((0,t.not)(d),()=>{i.error(!0),u.allErrors||a.break()})}),i.ok(d)}};return Pn.default=r,Pn}var En={},ro;function yi(){if(ro)return En;ro=1,Object.defineProperty(En,"__esModule",{value:!0});const t=lt(),e=me(),n=ct(),r=ye(),a={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:s})=>(0,e._)`{additionalProperty: ${s.additionalProperty}}`},code(s){const{gen:c,schema:u,parentSchema:d,data:l,errsCount:m,it:g}=s;if(!m)throw new Error("ajv implementation error");const{allErrors:$,opts:k}=g;if(g.props=!0,k.removeAdditional!=="all"&&(0,r.alwaysValidSchema)(g,u))return;const j=(0,t.allSchemaProperties)(d.properties),_=(0,t.allSchemaProperties)(d.patternProperties);b(),s.ok((0,e._)`${m} === ${n.default.errors}`);function b(){c.forIn("key",l,h=>{!j.length&&!_.length?C(h):c.if(f(h),()=>C(h))})}function f(h){let y;if(j.length>8){const w=(0,r.schemaRefOrVal)(g,d.properties,"properties");y=(0,t.isOwnProperty)(c,w,h)}else j.length?y=(0,e.or)(...j.map(w=>(0,e._)`${h} === ${w}`)):y=e.nil;return _.length&&(y=(0,e.or)(y,..._.map(w=>(0,e._)`${(0,t.usePattern)(s,w)}.test(${h})`))),(0,e.not)(y)}function x(h){c.code((0,e._)`delete ${l}[${h}]`)}function C(h){if(k.removeAdditional==="all"||k.removeAdditional&&u===!1){x(h);return}if(u===!1){s.setParams({additionalProperty:h}),s.error(),$||c.break();return}if(typeof u=="object"&&!(0,r.alwaysValidSchema)(g,u)){const y=c.name("valid");k.removeAdditional==="failing"?(p(h,y,!1),c.if((0,e.not)(y),()=>{s.reset(),x(h)})):(p(h,y),$||c.if((0,e.not)(y),()=>c.break()))}}function p(h,y,w){const A={keyword:"additionalProperties",dataProp:h,dataPropType:r.Type.Str};w===!1&&Object.assign(A,{compositeRule:!0,createErrors:!1,allErrors:!1}),s.subschema(A,y)}}};return En.default=a,En}var An={},ao;function Js(){if(ao)return An;ao=1,Object.defineProperty(An,"__esModule",{value:!0});const t=cr(),e=lt(),n=ye(),r=yi(),i={keyword:"properties",type:"object",schemaType:"object",code(a){const{gen:s,schema:c,parentSchema:u,data:d,it:l}=a;l.opts.removeAdditional==="all"&&u.additionalProperties===void 0&&r.default.code(new t.KeywordCxt(l,r.default,"additionalProperties"));const m=(0,e.allSchemaProperties)(c);for(const _ of m)l.definedProperties.add(_);l.opts.unevaluated&&m.length&&l.props!==!0&&(l.props=n.mergeEvaluated.props(s,(0,n.toHash)(m),l.props));const g=m.filter(_=>!(0,n.alwaysValidSchema)(l,c[_]));if(g.length===0)return;const $=s.name("valid");for(const _ of g)k(_)?j(_):(s.if((0,e.propertyInData)(s,d,_,l.opts.ownProperties)),j(_),l.allErrors||s.else().var($,!0),s.endIf()),a.it.definedProperties.add(_),a.ok($);function k(_){return l.opts.useDefaults&&!l.compositeRule&&c[_].default!==void 0}function j(_){a.subschema({keyword:"properties",schemaProp:_,dataProp:_},$)}}};return An.default=i,An}var Rn={},oo;function Ks(){if(oo)return Rn;oo=1,Object.defineProperty(Rn,"__esModule",{value:!0});const t=lt(),e=me(),n=ye(),r=ye(),i={keyword:"patternProperties",type:"object",schemaType:"object",code(a){const{gen:s,schema:c,data:u,parentSchema:d,it:l}=a,{opts:m}=l,g=(0,t.allSchemaProperties)(c),$=g.filter(C=>(0,n.alwaysValidSchema)(l,c[C]));if(g.length===0||$.length===g.length&&(!l.opts.unevaluated||l.props===!0))return;const k=m.strictSchema&&!m.allowMatchingProperties&&d.properties,j=s.name("valid");l.props!==!0&&!(l.props instanceof e.Name)&&(l.props=(0,r.evaluatedPropsToName)(s,l.props));const{props:_}=l;b();function b(){for(const C of g)k&&f(C),l.allErrors?x(C):(s.var(j,!0),x(C),s.if(j))}function f(C){for(const p in k)new RegExp(C).test(p)&&(0,n.checkStrictMode)(l,`property ${p} matches pattern ${C} (use allowMatchingProperties)`)}function x(C){s.forIn("key",u,p=>{s.if((0,e._)`${(0,t.usePattern)(a,C)}.test(${p})`,()=>{const h=$.includes(C);h||a.subschema({keyword:"patternProperties",schemaProp:C,dataProp:p,dataPropType:r.Type.Str},j),l.opts.unevaluated&&_!==!0?s.assign((0,e._)`${_}[${p}]`,!0):!h&&!l.allErrors&&s.if((0,e.not)(j),()=>s.break())})})}}};return Rn.default=i,Rn}var Tn={},io;function Ws(){if(io)return Tn;io=1,Object.defineProperty(Tn,"__esModule",{value:!0});const t=ye(),e={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(n){const{gen:r,schema:i,it:a}=n;if((0,t.alwaysValidSchema)(a,i)){n.fail();return}const s=r.name("valid");n.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},s),n.failResult(s,()=>n.reset(),()=>n.error())},error:{message:"must NOT be valid"}};return Tn.default=e,Tn}var In={},so;function Gs(){if(so)return In;so=1,Object.defineProperty(In,"__esModule",{value:!0});const e={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:lt().validateUnion,error:{message:"must match a schema in anyOf"}};return In.default=e,In}var Mn={},co;function Ys(){if(co)return Mn;co=1,Object.defineProperty(Mn,"__esModule",{value:!0});const t=me(),e=ye(),r={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:i})=>(0,t._)`{passingSchemas: ${i.passing}}`},code(i){const{gen:a,schema:s,parentSchema:c,it:u}=i;if(!Array.isArray(s))throw new Error("ajv implementation error");if(u.opts.discriminator&&c.discriminator)return;const d=s,l=a.let("valid",!1),m=a.let("passing",null),g=a.name("_valid");i.setParams({passing:m}),a.block($),i.result(l,()=>i.reset(),()=>i.error(!0));function $(){d.forEach((k,j)=>{let _;(0,e.alwaysValidSchema)(u,k)?a.var(g,!0):_=i.subschema({keyword:"oneOf",schemaProp:j,compositeRule:!0},g),j>0&&a.if((0,t._)`${g} && ${l}`).assign(l,!1).assign(m,(0,t._)`[${m}, ${j}]`).else(),a.if(g,()=>{a.assign(l,!0),a.assign(m,j),_&&i.mergeEvaluated(_,t.Name)})})}}};return Mn.default=r,Mn}var On={},lo;function Zs(){if(lo)return On;lo=1,Object.defineProperty(On,"__esModule",{value:!0});const t=ye(),e={keyword:"allOf",schemaType:"array",code(n){const{gen:r,schema:i,it:a}=n;if(!Array.isArray(i))throw new Error("ajv implementation error");const s=r.name("valid");i.forEach((c,u)=>{if((0,t.alwaysValidSchema)(a,c))return;const d=n.subschema({keyword:"allOf",schemaProp:u},s);n.ok(s),n.mergeEvaluated(d)})}};return On.default=e,On}var zn={},uo;function Xs(){if(uo)return zn;uo=1,Object.defineProperty(zn,"__esModule",{value:!0});const t=me(),e=ye(),r={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:a})=>(0,t.str)`must match "${a.ifClause}" schema`,params:({params:a})=>(0,t._)`{failingKeyword: ${a.ifClause}}`},code(a){const{gen:s,parentSchema:c,it:u}=a;c.then===void 0&&c.else===void 0&&(0,e.checkStrictMode)(u,'"if" without "then" and "else" is ignored');const d=i(u,"then"),l=i(u,"else");if(!d&&!l)return;const m=s.let("valid",!0),g=s.name("_valid");if($(),a.reset(),d&&l){const j=s.let("ifClause");a.setParams({ifClause:j}),s.if(g,k("then",j),k("else",j))}else d?s.if(g,k("then")):s.if((0,t.not)(g),k("else"));a.pass(m,()=>a.error(!0));function $(){const j=a.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},g);a.mergeEvaluated(j)}function k(j,_){return()=>{const b=a.subschema({keyword:j},g);s.assign(m,g),a.mergeValidEvaluated(b,m),_?s.assign(_,(0,t._)`${j}`):a.setParams({ifClause:j})}}}};function i(a,s){const c=a.schema[s];return c!==void 0&&!(0,e.alwaysValidSchema)(a,c)}return zn.default=r,zn}var Dn={},po;function Qs(){if(po)return Dn;po=1,Object.defineProperty(Dn,"__esModule",{value:!0});const t=ye(),e={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:n,parentSchema:r,it:i}){r.if===void 0&&(0,t.checkStrictMode)(i,`"${n}" without "if" is ignored`)}};return Dn.default=e,Dn}var ho;function ec(){if(ho)return kn;ho=1,Object.defineProperty(kn,"__esModule",{value:!0});const t=mi(),e=Bs(),n=fi(),r=Vs(),i=Fs(),a=Vr(),s=Us(),c=yi(),u=Js(),d=Ks(),l=Ws(),m=Gs(),g=Ys(),$=Zs(),k=Xs(),j=Qs();function _(b=!1){const f=[l.default,m.default,g.default,$.default,k.default,j.default,s.default,c.default,a.default,u.default,d.default];return b?f.push(e.default,r.default):f.push(t.default,n.default),f.push(i.default),f}return kn.default=_,kn}var qn={},Ht={},mo;function gi(){if(mo)return Ht;mo=1,Object.defineProperty(Ht,"__esModule",{value:!0}),Ht.dynamicAnchor=void 0;const t=me(),e=ct(),n=dr(),r=Hr(),i={keyword:"$dynamicAnchor",schemaType:"string",code:c=>a(c,c.schema)};function a(c,u){const{gen:d,it:l}=c;l.schemaEnv.root.dynamicAnchors[u]=!0;const m=(0,t._)`${e.default.dynamicAnchors}${(0,t.getProperty)(u)}`,g=l.errSchemaPath==="#"?l.validateName:s(c);d.if((0,t._)`!${m}`,()=>d.assign(m,g))}Ht.dynamicAnchor=a;function s(c){const{schemaEnv:u,schema:d,self:l}=c.it,{root:m,baseId:g,localRefs:$,meta:k}=u.root,{schemaId:j}=l.opts,_=new n.SchemaEnv({schema:d,schemaId:j,root:m,baseId:g,localRefs:$,meta:k});return n.compileSchema.call(l,_),(0,r.getValidate)(c,_)}return Ht.default=i,Ht}var Bt={},fo;function _i(){if(fo)return Bt;fo=1,Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.dynamicRef=void 0;const t=me(),e=ct(),n=Hr(),r={keyword:"$dynamicRef",schemaType:"string",code:a=>i(a,a.schema)};function i(a,s){const{gen:c,keyword:u,it:d}=a;if(s[0]!=="#")throw new Error(`"${u}" only supports hash fragment reference`);const l=s.slice(1);if(d.allErrors)m();else{const $=c.let("valid",!1);m($),a.ok($)}function m($){if(d.schemaEnv.root.dynamicAnchors[l]){const k=c.let("_v",(0,t._)`${e.default.dynamicAnchors}${(0,t.getProperty)(l)}`);c.if(k,g(k,$),g(d.validateName,$))}else g(d.validateName,$)()}function g($,k){return k?()=>c.block(()=>{(0,n.callRef)(a,$),c.let(k,!0)}):()=>(0,n.callRef)(a,$)}}return Bt.dynamicRef=i,Bt.default=r,Bt}var Ln={},yo;function tc(){if(yo)return Ln;yo=1,Object.defineProperty(Ln,"__esModule",{value:!0});const t=gi(),e=ye(),n={keyword:"$recursiveAnchor",schemaType:"boolean",code(r){r.schema?(0,t.dynamicAnchor)(r,""):(0,e.checkStrictMode)(r.it,"$recursiveAnchor: false is ignored")}};return Ln.default=n,Ln}var Hn={},go;function nc(){if(go)return Hn;go=1,Object.defineProperty(Hn,"__esModule",{value:!0});const t=_i(),e={keyword:"$recursiveRef",schemaType:"string",code:n=>(0,t.dynamicRef)(n,n.schema)};return Hn.default=e,Hn}var _o;function rc(){if(_o)return qn;_o=1,Object.defineProperty(qn,"__esModule",{value:!0});const t=gi(),e=_i(),n=tc(),r=nc(),i=[t.default,e.default,n.default,r.default];return qn.default=i,qn}var Bn={},Vn={},vo;function ac(){if(vo)return Vn;vo=1,Object.defineProperty(Vn,"__esModule",{value:!0});const t=Vr(),e={keyword:"dependentRequired",type:"object",schemaType:"object",error:t.error,code:n=>(0,t.validatePropertyDeps)(n)};return Vn.default=e,Vn}var Fn={},bo;function oc(){if(bo)return Fn;bo=1,Object.defineProperty(Fn,"__esModule",{value:!0});const t=Vr(),e={keyword:"dependentSchemas",type:"object",schemaType:"object",code:n=>(0,t.validateSchemaDeps)(n)};return Fn.default=e,Fn}var Un={},wo;function ic(){if(wo)return Un;wo=1,Object.defineProperty(Un,"__esModule",{value:!0});const t=ye(),e={keyword:["maxContains","minContains"],type:"array",schemaType:"number",code({keyword:n,parentSchema:r,it:i}){r.contains===void 0&&(0,t.checkStrictMode)(i,`"${n}" without "contains" is ignored`)}};return Un.default=e,Un}var $o;function sc(){if($o)return Bn;$o=1,Object.defineProperty(Bn,"__esModule",{value:!0});const t=ac(),e=oc(),n=ic(),r=[t.default,e.default,n.default];return Bn.default=r,Bn}var Jn={},Kn={},xo;function cc(){if(xo)return Kn;xo=1,Object.defineProperty(Kn,"__esModule",{value:!0});const t=me(),e=ye(),n=ct(),i={keyword:"unevaluatedProperties",type:"object",schemaType:["boolean","object"],trackErrors:!0,error:{message:"must NOT have unevaluated properties",params:({params:a})=>(0,t._)`{unevaluatedProperty: ${a.unevaluatedProperty}}`},code(a){const{gen:s,schema:c,data:u,errsCount:d,it:l}=a;if(!d)throw new Error("ajv implementation error");const{allErrors:m,props:g}=l;g instanceof t.Name?s.if((0,t._)`${g} !== true`,()=>s.forIn("key",u,_=>s.if(k(g,_),()=>$(_)))):g!==!0&&s.forIn("key",u,_=>g===void 0?$(_):s.if(j(g,_),()=>$(_))),l.props=!0,a.ok((0,t._)`${d} === ${n.default.errors}`);function $(_){if(c===!1){a.setParams({unevaluatedProperty:_}),a.error(),m||s.break();return}if(!(0,e.alwaysValidSchema)(l,c)){const b=s.name("valid");a.subschema({keyword:"unevaluatedProperties",dataProp:_,dataPropType:e.Type.Str},b),m||s.if((0,t.not)(b),()=>s.break())}}function k(_,b){return(0,t._)`!${_} || !${_}[${b}]`}function j(_,b){const f=[];for(const x in _)_[x]===!0&&f.push((0,t._)`${b} !== ${x}`);return(0,t.and)(...f)}}};return Kn.default=i,Kn}var Wn={},jo;function lc(){if(jo)return Wn;jo=1,Object.defineProperty(Wn,"__esModule",{value:!0});const t=me(),e=ye(),r={keyword:"unevaluatedItems",type:"array",schemaType:["boolean","object"],error:{message:({params:{len:i}})=>(0,t.str)`must NOT have more than ${i} items`,params:({params:{len:i}})=>(0,t._)`{limit: ${i}}`},code(i){const{gen:a,schema:s,data:c,it:u}=i,d=u.items||0;if(d===!0)return;const l=a.const("len",(0,t._)`${c}.length`);if(s===!1)i.setParams({len:d}),i.fail((0,t._)`${l} > ${d}`);else if(typeof s=="object"&&!(0,e.alwaysValidSchema)(u,s)){const g=a.var("valid",(0,t._)`${l} <= ${d}`);a.if((0,t.not)(g),()=>m(g,d)),i.ok(g)}u.items=!0;function m(g,$){a.forRange("i",$,l,k=>{i.subschema({keyword:"unevaluatedItems",dataProp:k,dataPropType:e.Type.Num},g),u.allErrors||a.if((0,t.not)(g),()=>a.break())})}}};return Wn.default=r,Wn}var ko;function dc(){if(ko)return Jn;ko=1,Object.defineProperty(Jn,"__esModule",{value:!0});const t=cc(),e=lc(),n=[t.default,e.default];return Jn.default=n,Jn}var Gn={},Yn={},So;function uc(){if(So)return Yn;So=1,Object.defineProperty(Yn,"__esModule",{value:!0});const t=me(),n={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:r})=>(0,t.str)`must match format "${r}"`,params:({schemaCode:r})=>(0,t._)`{format: ${r}}`},code(r,i){const{gen:a,data:s,$data:c,schema:u,schemaCode:d,it:l}=r,{opts:m,errSchemaPath:g,schemaEnv:$,self:k}=l;if(!m.validateFormats)return;c?j():_();function j(){const b=a.scopeValue("formats",{ref:k.formats,code:m.code.formats}),f=a.const("fDef",(0,t._)`${b}[${d}]`),x=a.let("fType"),C=a.let("format");a.if((0,t._)`typeof ${f} == "object" && !(${f} instanceof RegExp)`,()=>a.assign(x,(0,t._)`${f}.type || "string"`).assign(C,(0,t._)`${f}.validate`),()=>a.assign(x,(0,t._)`"string"`).assign(C,f)),r.fail$data((0,t.or)(p(),h()));function p(){return m.strictSchema===!1?t.nil:(0,t._)`${d} && !${C}`}function h(){const y=$.$async?(0,t._)`(${f}.async ? await ${C}(${s}) : ${C}(${s}))`:(0,t._)`${C}(${s})`,w=(0,t._)`(typeof ${C} == "function" ? ${y} : ${C}.test(${s}))`;return(0,t._)`${C} && ${C} !== true && ${x} === ${i} && !${w}`}}function _(){const b=k.formats[u];if(!b){p();return}if(b===!0)return;const[f,x,C]=h(b);f===i&&r.pass(y());function p(){if(m.strictSchema===!1){k.logger.warn(w());return}throw new Error(w());function w(){return`unknown format "${u}" ignored in schema at path "${g}"`}}function h(w){const A=w instanceof RegExp?(0,t.regexpCode)(w):m.code.formats?(0,t._)`${m.code.formats}${(0,t.getProperty)(u)}`:void 0,S=a.scopeValue("formats",{key:u,ref:w,code:A});return typeof w=="object"&&!(w instanceof RegExp)?[w.type||"string",w.validate,(0,t._)`${S}.validate`]:["string",w,S]}function y(){if(typeof b=="object"&&!(b instanceof RegExp)&&b.async){if(!$.$async)throw new Error("async format in sync schema");return(0,t._)`await ${C}(${s})`}return typeof x=="function"?(0,t._)`${C}(${s})`:(0,t._)`${C}.test(${s})`}}}};return Yn.default=n,Yn}var No;function pc(){if(No)return Gn;No=1,Object.defineProperty(Gn,"__esModule",{value:!0});const e=[uc().default];return Gn.default=e,Gn}var At={},Co;function hc(){return Co||(Co=1,Object.defineProperty(At,"__esModule",{value:!0}),At.contentVocabulary=At.metadataVocabulary=void 0,At.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],At.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]),At}var Po;function mc(){if(Po)return ln;Po=1,Object.defineProperty(ln,"__esModule",{value:!0});const t=Ps(),e=Hs(),n=ec(),r=rc(),i=sc(),a=dc(),s=pc(),c=hc(),u=[r.default,t.default,e.default,(0,n.default)(!0),s.default,c.metadataVocabulary,c.contentVocabulary,i.default,a.default];return ln.default=u,ln}var Zn={},Zt={},Eo;function fc(){if(Eo)return Zt;Eo=1,Object.defineProperty(Zt,"__esModule",{value:!0}),Zt.DiscrError=void 0;var t;return(function(e){e.Tag="tag",e.Mapping="mapping"})(t||(Zt.DiscrError=t={})),Zt}var Ao;function yc(){if(Ao)return Zn;Ao=1,Object.defineProperty(Zn,"__esModule",{value:!0});const t=me(),e=fc(),n=dr(),r=lr(),i=ye(),s={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:c,tagName:u}})=>c===e.DiscrError.Tag?`tag "${u}" must be string`:`value of tag "${u}" must be in oneOf`,params:({params:{discrError:c,tag:u,tagName:d}})=>(0,t._)`{error: ${c}, tag: ${d}, tagValue: ${u}}`},code(c){const{gen:u,data:d,schema:l,parentSchema:m,it:g}=c,{oneOf:$}=m;if(!g.opts.discriminator)throw new Error("discriminator: requires discriminator option");const k=l.propertyName;if(typeof k!="string")throw new Error("discriminator: requires propertyName");if(l.mapping)throw new Error("discriminator: mapping is not supported");if(!$)throw new Error("discriminator: requires oneOf keyword");const j=u.let("valid",!1),_=u.const("tag",(0,t._)`${d}${(0,t.getProperty)(k)}`);u.if((0,t._)`typeof ${_} == "string"`,()=>b(),()=>c.error(!1,{discrError:e.DiscrError.Tag,tag:_,tagName:k})),c.ok(j);function b(){const C=x();u.if(!1);for(const p in C)u.elseIf((0,t._)`${_} === ${p}`),u.assign(j,f(C[p]));u.else(),c.error(!1,{discrError:e.DiscrError.Mapping,tag:_,tagName:k}),u.endIf()}function f(C){const p=u.name("valid"),h=c.subschema({keyword:"oneOf",schemaProp:C},p);return c.mergeEvaluated(h,t.Name),p}function x(){var C;const p={},h=w(m);let y=!0;for(let O=0;O<$.length;O++){let H=$[O];if(H!=null&&H.$ref&&!(0,i.schemaHasRulesButRef)(H,g.self.RULES)){const W=H.$ref;if(H=n.resolveRef.call(g.self,g.schemaEnv.root,g.baseId,W),H instanceof n.SchemaEnv&&(H=H.schema),H===void 0)throw new r.default(g.opts.uriResolver,g.baseId,W)}const B=(C=H==null?void 0:H.properties)===null||C===void 0?void 0:C[k];if(typeof B!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${k}"`);y=y&&(h||w(H)),A(B,O)}if(!y)throw new Error(`discriminator: "${k}" must be required`);return p;function w({required:O}){return Array.isArray(O)&&O.includes(k)}function A(O,H){if(O.const)S(O.const,H);else if(O.enum)for(const B of O.enum)S(B,H);else throw new Error(`discriminator: "properties/${k}" must have "const" or "enum"`)}function S(O,H){if(typeof O!="string"||O in p)throw new Error(`discriminator: "${k}" values must be unique strings`);p[O]=H}}}};return Zn.default=s,Zn}var Xn={};const gc="https://json-schema.org/draft/2020-12/schema",_c="https://json-schema.org/draft/2020-12/schema",vc={"https://json-schema.org/draft/2020-12/vocab/core":!0,"https://json-schema.org/draft/2020-12/vocab/applicator":!0,"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0,"https://json-schema.org/draft/2020-12/vocab/validation":!0,"https://json-schema.org/draft/2020-12/vocab/meta-data":!0,"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0,"https://json-schema.org/draft/2020-12/vocab/content":!0},bc="meta",wc="Core and Validation specifications meta-schema",$c=[{$ref:"meta/core"},{$ref:"meta/applicator"},{$ref:"meta/unevaluated"},{$ref:"meta/validation"},{$ref:"meta/meta-data"},{$ref:"meta/format-annotation"},{$ref:"meta/content"}],xc=["object","boolean"],jc="This meta-schema also defines keywords that have appeared in previous drafts in order to prevent incompatible extensions as they remain in common use.",kc={definitions:{$comment:'"definitions" has been replaced by "$defs".',type:"object",additionalProperties:{$dynamicRef:"#meta"},deprecated:!0,default:{}},dependencies:{$comment:'"dependencies" has been split and replaced by "dependentSchemas" and "dependentRequired" in order to serve their differing semantics.',type:"object",additionalProperties:{anyOf:[{$dynamicRef:"#meta"},{$ref:"meta/validation#/$defs/stringArray"}]},deprecated:!0,default:{}},$recursiveAnchor:{$comment:'"$recursiveAnchor" has been replaced by "$dynamicAnchor".',$ref:"meta/core#/$defs/anchorString",deprecated:!0},$recursiveRef:{$comment:'"$recursiveRef" has been replaced by "$dynamicRef".',$ref:"meta/core#/$defs/uriReferenceString",deprecated:!0}},Sc={$schema:gc,$id:_c,$vocabulary:vc,$dynamicAnchor:bc,title:wc,allOf:$c,type:xc,$comment:jc,properties:kc},Nc="https://json-schema.org/draft/2020-12/schema",Cc="https://json-schema.org/draft/2020-12/meta/applicator",Pc={"https://json-schema.org/draft/2020-12/vocab/applicator":!0},Ec="meta",Ac="Applicator vocabulary meta-schema",Rc=["object","boolean"],Tc={prefixItems:{$ref:"#/$defs/schemaArray"},items:{$dynamicRef:"#meta"},contains:{$dynamicRef:"#meta"},additionalProperties:{$dynamicRef:"#meta"},properties:{type:"object",additionalProperties:{$dynamicRef:"#meta"},default:{}},patternProperties:{type:"object",additionalProperties:{$dynamicRef:"#meta"},propertyNames:{format:"regex"},default:{}},dependentSchemas:{type:"object",additionalProperties:{$dynamicRef:"#meta"},default:{}},propertyNames:{$dynamicRef:"#meta"},if:{$dynamicRef:"#meta"},then:{$dynamicRef:"#meta"},else:{$dynamicRef:"#meta"},allOf:{$ref:"#/$defs/schemaArray"},anyOf:{$ref:"#/$defs/schemaArray"},oneOf:{$ref:"#/$defs/schemaArray"},not:{$dynamicRef:"#meta"}},Ic={schemaArray:{type:"array",minItems:1,items:{$dynamicRef:"#meta"}}},Mc={$schema:Nc,$id:Cc,$vocabulary:Pc,$dynamicAnchor:Ec,title:Ac,type:Rc,properties:Tc,$defs:Ic},Oc="https://json-schema.org/draft/2020-12/schema",zc="https://json-schema.org/draft/2020-12/meta/unevaluated",Dc={"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0},qc="meta",Lc="Unevaluated applicator vocabulary meta-schema",Hc=["object","boolean"],Bc={unevaluatedItems:{$dynamicRef:"#meta"},unevaluatedProperties:{$dynamicRef:"#meta"}},Vc={$schema:Oc,$id:zc,$vocabulary:Dc,$dynamicAnchor:qc,title:Lc,type:Hc,properties:Bc},Fc="https://json-schema.org/draft/2020-12/schema",Uc="https://json-schema.org/draft/2020-12/meta/content",Jc={"https://json-schema.org/draft/2020-12/vocab/content":!0},Kc="meta",Wc="Content vocabulary meta-schema",Gc=["object","boolean"],Yc={contentEncoding:{type:"string"},contentMediaType:{type:"string"},contentSchema:{$dynamicRef:"#meta"}},Zc={$schema:Fc,$id:Uc,$vocabulary:Jc,$dynamicAnchor:Kc,title:Wc,type:Gc,properties:Yc},Xc="https://json-schema.org/draft/2020-12/schema",Qc="https://json-schema.org/draft/2020-12/meta/core",el={"https://json-schema.org/draft/2020-12/vocab/core":!0},tl="meta",nl="Core vocabulary meta-schema",rl=["object","boolean"],al={$id:{$ref:"#/$defs/uriReferenceString",$comment:"Non-empty fragments not allowed.",pattern:"^[^#]*#?$"},$schema:{$ref:"#/$defs/uriString"},$ref:{$ref:"#/$defs/uriReferenceString"},$anchor:{$ref:"#/$defs/anchorString"},$dynamicRef:{$ref:"#/$defs/uriReferenceString"},$dynamicAnchor:{$ref:"#/$defs/anchorString"},$vocabulary:{type:"object",propertyNames:{$ref:"#/$defs/uriString"},additionalProperties:{type:"boolean"}},$comment:{type:"string"},$defs:{type:"object",additionalProperties:{$dynamicRef:"#meta"}}},ol={anchorString:{type:"string",pattern:"^[A-Za-z_][-A-Za-z0-9._]*$"},uriString:{type:"string",format:"uri"},uriReferenceString:{type:"string",format:"uri-reference"}},il={$schema:Xc,$id:Qc,$vocabulary:el,$dynamicAnchor:tl,title:nl,type:rl,properties:al,$defs:ol},sl="https://json-schema.org/draft/2020-12/schema",cl="https://json-schema.org/draft/2020-12/meta/format-annotation",ll={"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0},dl="meta",ul="Format vocabulary meta-schema for annotation results",pl=["object","boolean"],hl={format:{type:"string"}},ml={$schema:sl,$id:cl,$vocabulary:ll,$dynamicAnchor:dl,title:ul,type:pl,properties:hl},fl="https://json-schema.org/draft/2020-12/schema",yl="https://json-schema.org/draft/2020-12/meta/meta-data",gl={"https://json-schema.org/draft/2020-12/vocab/meta-data":!0},_l="meta",vl="Meta-data vocabulary meta-schema",bl=["object","boolean"],wl={title:{type:"string"},description:{type:"string"},default:!0,deprecated:{type:"boolean",default:!1},readOnly:{type:"boolean",default:!1},writeOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0}},$l={$schema:fl,$id:yl,$vocabulary:gl,$dynamicAnchor:_l,title:vl,type:bl,properties:wl},xl="https://json-schema.org/draft/2020-12/schema",jl="https://json-schema.org/draft/2020-12/meta/validation",kl={"https://json-schema.org/draft/2020-12/vocab/validation":!0},Sl="meta",Nl="Validation vocabulary meta-schema",Cl=["object","boolean"],Pl={type:{anyOf:[{$ref:"#/$defs/simpleTypes"},{type:"array",items:{$ref:"#/$defs/simpleTypes"},minItems:1,uniqueItems:!0}]},const:!0,enum:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/$defs/nonNegativeInteger"},minLength:{$ref:"#/$defs/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},maxItems:{$ref:"#/$defs/nonNegativeInteger"},minItems:{$ref:"#/$defs/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},maxContains:{$ref:"#/$defs/nonNegativeInteger"},minContains:{$ref:"#/$defs/nonNegativeInteger",default:1},maxProperties:{$ref:"#/$defs/nonNegativeInteger"},minProperties:{$ref:"#/$defs/nonNegativeIntegerDefault0"},required:{$ref:"#/$defs/stringArray"},dependentRequired:{type:"object",additionalProperties:{$ref:"#/$defs/stringArray"}}},El={nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{$ref:"#/$defs/nonNegativeInteger",default:0},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},Al={$schema:xl,$id:jl,$vocabulary:kl,$dynamicAnchor:Sl,title:Nl,type:Cl,properties:Pl,$defs:El};var Ro;function Rl(){if(Ro)return Xn;Ro=1,Object.defineProperty(Xn,"__esModule",{value:!0});const t=Sc,e=Mc,n=Vc,r=Zc,i=il,a=ml,s=$l,c=Al,u=["/properties"];function d(l){return[t,e,n,r,i,m(this,a),s,m(this,c)].forEach(g=>this.addMetaSchema(g,void 0,!1)),this;function m(g,$){return l?g.$dataMetaSchema($,u):$}}return Xn.default=d,Xn}var To;function Tl(){return To||(To=1,(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.MissingRefError=e.ValidationError=e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=e.Ajv2020=void 0;const n=Ns(),r=mc(),i=yc(),a=Rl(),s="https://json-schema.org/draft/2020-12/schema";class c extends n.default{constructor($={}){super({...$,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){super._addVocabularies(),r.default.forEach($=>this.addVocabulary($)),this.opts.discriminator&&this.addKeyword(i.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();const{$data:$,meta:k}=this.opts;k&&(a.default.call(this,$),this.refs["http://json-schema.org/schema"]=s)}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(s)?s:void 0)}}e.Ajv2020=c,t.exports=e=c,t.exports.Ajv2020=c,Object.defineProperty(e,"__esModule",{value:!0}),e.default=c;var u=cr();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return u.KeywordCxt}});var d=me();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return d._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return d.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return d.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return d.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return d.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return d.CodeGen}});var l=Lr();Object.defineProperty(e,"ValidationError",{enumerable:!0,get:function(){return l.default}});var m=lr();Object.defineProperty(e,"MissingRefError",{enumerable:!0,get:function(){return m.default}})})(rn,rn.exports)),rn.exports}var Il=Tl();const Ml=as(Il);/**
|
|
10
|
+
* @license lucide-react v1.17.0 - ISC
|
|
11
|
+
*
|
|
12
|
+
* This source code is licensed under the ISC license.
|
|
13
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
14
|
+
*/const vi=(...t)=>t.filter((e,n,r)=>!!e&&e.trim()!==""&&r.indexOf(e)===n).join(" ").trim();/**
|
|
15
|
+
* @license lucide-react v1.17.0 - ISC
|
|
16
|
+
*
|
|
17
|
+
* This source code is licensed under the ISC license.
|
|
18
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
19
|
+
*/const Ol=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
|
|
20
|
+
* @license lucide-react v1.17.0 - ISC
|
|
21
|
+
*
|
|
22
|
+
* This source code is licensed under the ISC license.
|
|
23
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
24
|
+
*/const zl=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,n,r)=>r?r.toUpperCase():n.toLowerCase());/**
|
|
25
|
+
* @license lucide-react v1.17.0 - ISC
|
|
26
|
+
*
|
|
27
|
+
* This source code is licensed under the ISC license.
|
|
28
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
29
|
+
*/const Io=t=>{const e=zl(t);return e.charAt(0).toUpperCase()+e.slice(1)};/**
|
|
30
|
+
* @license lucide-react v1.17.0 - ISC
|
|
31
|
+
*
|
|
32
|
+
* This source code is licensed under the ISC license.
|
|
33
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
34
|
+
*/var Sr={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
|
35
|
+
* @license lucide-react v1.17.0 - ISC
|
|
36
|
+
*
|
|
37
|
+
* This source code is licensed under the ISC license.
|
|
38
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
39
|
+
*/const Dl=t=>{for(const e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0;return!1},ql=G.createContext({}),Ll=()=>G.useContext(ql),Hl=G.forwardRef(({color:t,size:e,strokeWidth:n,absoluteStrokeWidth:r,className:i="",children:a,iconNode:s,...c},u)=>{const{size:d=24,strokeWidth:l=2,absoluteStrokeWidth:m=!1,color:g="currentColor",className:$=""}=Ll()??{},k=r??m?Number(n??l)*24/Number(e??d):n??l;return G.createElement("svg",{ref:u,...Sr,width:e??d??Sr.width,height:e??d??Sr.height,stroke:t??g,strokeWidth:k,className:vi("lucide",$,i),...!a&&!Dl(c)&&{"aria-hidden":"true"},...c},[...s.map(([j,_])=>G.createElement(j,_)),...Array.isArray(a)?a:[a]])});/**
|
|
40
|
+
* @license lucide-react v1.17.0 - ISC
|
|
41
|
+
*
|
|
42
|
+
* This source code is licensed under the ISC license.
|
|
43
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
44
|
+
*/const de=(t,e)=>{const n=G.forwardRef(({className:r,...i},a)=>G.createElement(Hl,{ref:a,iconNode:e,className:vi(`lucide-${Ol(Io(t))}`,`lucide-${t}`,r),...i}));return n.displayName=Io(t),n};/**
|
|
45
|
+
* @license lucide-react v1.17.0 - ISC
|
|
46
|
+
*
|
|
47
|
+
* This source code is licensed under the ISC license.
|
|
48
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
49
|
+
*/const Bl=[["path",{d:"M2 12h20",key:"9i4pu4"}],["path",{d:"M10 16v4a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2v-4",key:"11f1s0"}],["path",{d:"M10 8V4a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v4",key:"t14dx9"}],["path",{d:"M20 16v1a2 2 0 0 1-2 2h-2a2 2 0 0 1-2-2v-1",key:"1w07xs"}],["path",{d:"M14 8V7c0-1.1.9-2 2-2h2a2 2 0 0 1 2 2v1",key:"1apec2"}]],Vl=de("align-center-horizontal",Bl);/**
|
|
50
|
+
* @license lucide-react v1.17.0 - ISC
|
|
51
|
+
*
|
|
52
|
+
* This source code is licensed under the ISC license.
|
|
53
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
54
|
+
*/const Fl=[["path",{d:"M12 2v20",key:"t6zp3m"}],["path",{d:"M8 10H4a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2h4",key:"14d6g8"}],["path",{d:"M16 10h4a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2h-4",key:"1e2lrw"}],["path",{d:"M8 20H7a2 2 0 0 1-2-2v-2c0-1.1.9-2 2-2h1",key:"1fkdwx"}],["path",{d:"M16 14h1a2 2 0 0 1 2 2v2a2 2 0 0 1-2 2h-1",key:"1euafb"}]],Ul=de("align-center-vertical",Fl);/**
|
|
55
|
+
* @license lucide-react v1.17.0 - ISC
|
|
56
|
+
*
|
|
57
|
+
* This source code is licensed under the ISC license.
|
|
58
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
59
|
+
*/const Jl=[["rect",{width:"6",height:"16",x:"4",y:"2",rx:"2",key:"z5wdxg"}],["rect",{width:"6",height:"9",x:"14",y:"9",rx:"2",key:"um7a8w"}],["path",{d:"M22 22H2",key:"19qnx5"}]],Kl=de("align-end-horizontal",Jl);/**
|
|
60
|
+
* @license lucide-react v1.17.0 - ISC
|
|
61
|
+
*
|
|
62
|
+
* This source code is licensed under the ISC license.
|
|
63
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
64
|
+
*/const Wl=[["rect",{width:"16",height:"6",x:"2",y:"4",rx:"2",key:"10wcwx"}],["rect",{width:"9",height:"6",x:"9",y:"14",rx:"2",key:"4p5bwg"}],["path",{d:"M22 22V2",key:"12ipfv"}]],Gl=de("align-end-vertical",Wl);/**
|
|
65
|
+
* @license lucide-react v1.17.0 - ISC
|
|
66
|
+
*
|
|
67
|
+
* This source code is licensed under the ISC license.
|
|
68
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
69
|
+
*/const Yl=[["rect",{width:"6",height:"14",x:"4",y:"5",rx:"2",key:"1wwnby"}],["rect",{width:"6",height:"10",x:"14",y:"7",rx:"2",key:"1fe6j6"}],["path",{d:"M17 22v-5",key:"4b6g73"}],["path",{d:"M17 7V2",key:"hnrr36"}],["path",{d:"M7 22v-3",key:"1r4jpn"}],["path",{d:"M7 5V2",key:"liy1u9"}]],Zl=de("align-horizontal-distribute-center",Yl);/**
|
|
70
|
+
* @license lucide-react v1.17.0 - ISC
|
|
71
|
+
*
|
|
72
|
+
* This source code is licensed under the ISC license.
|
|
73
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
74
|
+
*/const Xl=[["rect",{width:"6",height:"16",x:"4",y:"6",rx:"2",key:"1n4dg1"}],["rect",{width:"6",height:"9",x:"14",y:"6",rx:"2",key:"17khns"}],["path",{d:"M22 2H2",key:"fhrpnj"}]],Ql=de("align-start-horizontal",Xl);/**
|
|
75
|
+
* @license lucide-react v1.17.0 - ISC
|
|
76
|
+
*
|
|
77
|
+
* This source code is licensed under the ISC license.
|
|
78
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
79
|
+
*/const ed=[["rect",{width:"9",height:"6",x:"6",y:"14",rx:"2",key:"lpm2y7"}],["rect",{width:"16",height:"6",x:"6",y:"4",rx:"2",key:"rdj6ps"}],["path",{d:"M2 2v20",key:"1ivd8o"}]],td=de("align-start-vertical",ed);/**
|
|
80
|
+
* @license lucide-react v1.17.0 - ISC
|
|
81
|
+
*
|
|
82
|
+
* This source code is licensed under the ISC license.
|
|
83
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
84
|
+
*/const nd=[["path",{d:"M22 17h-3",key:"1lwga1"}],["path",{d:"M22 7h-5",key:"o2endc"}],["path",{d:"M5 17H2",key:"1gx9xc"}],["path",{d:"M7 7H2",key:"6bq26l"}],["rect",{x:"5",y:"14",width:"14",height:"6",rx:"2",key:"1qrzuf"}],["rect",{x:"7",y:"4",width:"10",height:"6",rx:"2",key:"we8e9z"}]],rd=de("align-vertical-distribute-center",nd);/**
|
|
85
|
+
* @license lucide-react v1.17.0 - ISC
|
|
86
|
+
*
|
|
87
|
+
* This source code is licensed under the ISC license.
|
|
88
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
89
|
+
*/const ad=[["path",{d:"M12 21V7",key:"gj6g52"}],["path",{d:"m16 12 2 2 4-4",key:"mdajum"}],["path",{d:"M22 6V4a1 1 0 0 0-1-1h-5a4 4 0 0 0-4 4 4 4 0 0 0-4-4H3a1 1 0 0 0-1 1v13a1 1 0 0 0 1 1h6a3 3 0 0 1 3 3 3 3 0 0 1 3-3h6a1 1 0 0 0 1-1v-1.3",key:"8arnkb"}]],od=de("book-open-check",ad);/**
|
|
90
|
+
* @license lucide-react v1.17.0 - ISC
|
|
91
|
+
*
|
|
92
|
+
* This source code is licensed under the ISC license.
|
|
93
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
94
|
+
*/const id=[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]],Mo=de("bot",id);/**
|
|
95
|
+
* @license lucide-react v1.17.0 - ISC
|
|
96
|
+
*
|
|
97
|
+
* This source code is licensed under the ISC license.
|
|
98
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
99
|
+
*/const sd=[["path",{d:"M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z",key:"lc1i9w"}],["path",{d:"m7 16.5-4.74-2.85",key:"1o9zyk"}],["path",{d:"m7 16.5 5-3",key:"va8pkn"}],["path",{d:"M7 16.5v5.17",key:"jnp8gn"}],["path",{d:"M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z",key:"8zsnat"}],["path",{d:"m17 16.5-5-3",key:"8arw3v"}],["path",{d:"m17 16.5 4.74-2.85",key:"8rfmw"}],["path",{d:"M17 16.5v5.17",key:"k6z78m"}],["path",{d:"M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z",key:"1xygjf"}],["path",{d:"M12 8 7.26 5.15",key:"1vbdud"}],["path",{d:"m12 8 4.74-2.85",key:"3rx089"}],["path",{d:"M12 13.5V8",key:"1io7kd"}]],bi=de("boxes",sd);/**
|
|
100
|
+
* @license lucide-react v1.17.0 - ISC
|
|
101
|
+
*
|
|
102
|
+
* This source code is licensed under the ISC license.
|
|
103
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
104
|
+
*/const cd=[["path",{d:"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1",key:"ezmyqa"}],["path",{d:"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1",key:"e1hn23"}]],ld=de("braces",cd);/**
|
|
105
|
+
* @license lucide-react v1.17.0 - ISC
|
|
106
|
+
*
|
|
107
|
+
* This source code is licensed under the ISC license.
|
|
108
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
109
|
+
*/const dd=[["rect",{x:"8",y:"8",width:"8",height:"8",rx:"2",key:"yj20xf"}],["path",{d:"M4 10a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2",key:"1ltk23"}],["path",{d:"M14 20a2 2 0 0 0 2 2h4a2 2 0 0 0 2-2v-4a2 2 0 0 0-2-2",key:"1q24h9"}]],ud=de("bring-to-front",dd);/**
|
|
110
|
+
* @license lucide-react v1.17.0 - ISC
|
|
111
|
+
*
|
|
112
|
+
* This source code is licensed under the ISC license.
|
|
113
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
114
|
+
*/const pd=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],hd=de("check",pd);/**
|
|
115
|
+
* @license lucide-react v1.17.0 - ISC
|
|
116
|
+
*
|
|
117
|
+
* This source code is licensed under the ISC license.
|
|
118
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
119
|
+
*/const md=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],fd=de("chevron-down",md);/**
|
|
120
|
+
* @license lucide-react v1.17.0 - ISC
|
|
121
|
+
*
|
|
122
|
+
* This source code is licensed under the ISC license.
|
|
123
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
124
|
+
*/const yd=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],gd=de("chevron-left",yd);/**
|
|
125
|
+
* @license lucide-react v1.17.0 - ISC
|
|
126
|
+
*
|
|
127
|
+
* This source code is licensed under the ISC license.
|
|
128
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
129
|
+
*/const _d=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],vd=de("chevron-up",_d);/**
|
|
130
|
+
* @license lucide-react v1.17.0 - ISC
|
|
131
|
+
*
|
|
132
|
+
* This source code is licensed under the ISC license.
|
|
133
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
134
|
+
*/const bd=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],wd=de("copy",bd);/**
|
|
135
|
+
* @license lucide-react v1.17.0 - ISC
|
|
136
|
+
*
|
|
137
|
+
* This source code is licensed under the ISC license.
|
|
138
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
139
|
+
*/const $d=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],wi=de("download",$d);/**
|
|
140
|
+
* @license lucide-react v1.17.0 - ISC
|
|
141
|
+
*
|
|
142
|
+
* This source code is licensed under the ISC license.
|
|
143
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
144
|
+
*/const xd=[["path",{d:"M13.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v11.5",key:"4pqfef"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M8 12v-1",key:"1ej8lb"}],["path",{d:"M8 18v-2",key:"qcmpov"}],["path",{d:"M8 7V6",key:"1nbb54"}],["circle",{cx:"8",cy:"20",r:"2",key:"ckkr5m"}]],jd=de("file-archive",xd);/**
|
|
145
|
+
* @license lucide-react v1.17.0 - ISC
|
|
146
|
+
*
|
|
147
|
+
* This source code is licensed under the ISC license.
|
|
148
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
149
|
+
*/const kd=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1",key:"1oajmo"}],["path",{d:"M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1",key:"mpwhp6"}]],Sd=de("file-braces",kd);/**
|
|
150
|
+
* @license lucide-react v1.17.0 - ISC
|
|
151
|
+
*
|
|
152
|
+
* This source code is licensed under the ISC license.
|
|
153
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
154
|
+
*/const Nd=[["path",{d:"M10.5 22H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v6",key:"g5mvt7"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"m14 20 2 2 4-4",key:"15kota"}]],Cd=de("file-check-corner",Nd);/**
|
|
155
|
+
* @license lucide-react v1.17.0 - ISC
|
|
156
|
+
*
|
|
157
|
+
* This source code is licensed under the ISC license.
|
|
158
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
159
|
+
*/const Pd=[["path",{d:"M4 12.15V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2h-3.35",key:"1wthlu"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"m5 16-3 3 3 3",key:"331omg"}],["path",{d:"m9 22 3-3-3-3",key:"lsp7cz"}]],$i=de("file-code-corner",Pd);/**
|
|
160
|
+
* @license lucide-react v1.17.0 - ISC
|
|
161
|
+
*
|
|
162
|
+
* This source code is licensed under the ISC license.
|
|
163
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
164
|
+
*/const Ed=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],Ad=de("file-text",Ed);/**
|
|
165
|
+
* @license lucide-react v1.17.0 - ISC
|
|
166
|
+
*
|
|
167
|
+
* This source code is licensed under the ISC license.
|
|
168
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
169
|
+
*/const Rd=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],Td=de("folder-open",Rd);/**
|
|
170
|
+
* @license lucide-react v1.17.0 - ISC
|
|
171
|
+
*
|
|
172
|
+
* This source code is licensed under the ISC license.
|
|
173
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
174
|
+
*/const Id=[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],Md=de("folder-plus",Id);/**
|
|
175
|
+
* @license lucide-react v1.17.0 - ISC
|
|
176
|
+
*
|
|
177
|
+
* This source code is licensed under the ISC license.
|
|
178
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
179
|
+
*/const Od=[["path",{d:"M12 13V2l8 4-8 4",key:"5wlwwj"}],["path",{d:"M20.561 10.222a9 9 0 1 1-12.55-5.29",key:"1c0wjv"}],["path",{d:"M8.002 9.997a5 5 0 1 0 8.9 2.02",key:"gb1g7m"}]],zd=de("goal",Od);/**
|
|
180
|
+
* @license lucide-react v1.17.0 - ISC
|
|
181
|
+
*
|
|
182
|
+
* This source code is licensed under the ISC license.
|
|
183
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
184
|
+
*/const Dd=[["path",{d:"M12 3v18",key:"108xh3"}],["path",{d:"M3 12h18",key:"1i2n21"}],["rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",key:"h1oib"}]],qd=de("grid-2x2",Dd);/**
|
|
185
|
+
* @license lucide-react v1.17.0 - ISC
|
|
186
|
+
*
|
|
187
|
+
* This source code is licensed under the ISC license.
|
|
188
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
189
|
+
*/const Ld=[["circle",{cx:"12",cy:"9",r:"1",key:"124mty"}],["circle",{cx:"19",cy:"9",r:"1",key:"1ruzo2"}],["circle",{cx:"5",cy:"9",r:"1",key:"1a8b28"}],["circle",{cx:"12",cy:"15",r:"1",key:"1e56xg"}],["circle",{cx:"19",cy:"15",r:"1",key:"1a92ep"}],["circle",{cx:"5",cy:"15",r:"1",key:"5r1jwy"}]],Hd=de("grip-horizontal",Ld);/**
|
|
190
|
+
* @license lucide-react v1.17.0 - ISC
|
|
191
|
+
*
|
|
192
|
+
* This source code is licensed under the ISC license.
|
|
193
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
194
|
+
*/const Bd=[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],xi=de("layers",Bd);/**
|
|
195
|
+
* @license lucide-react v1.17.0 - ISC
|
|
196
|
+
*
|
|
197
|
+
* This source code is licensed under the ISC license.
|
|
198
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
199
|
+
*/const Vd=[["rect",{width:"18",height:"7",x:"3",y:"3",rx:"1",key:"f1a2em"}],["rect",{width:"9",height:"7",x:"3",y:"14",rx:"1",key:"jqznyg"}],["rect",{width:"5",height:"7",x:"16",y:"14",rx:"1",key:"q5h2i8"}]],Nr=de("layout-template",Vd);/**
|
|
200
|
+
* @license lucide-react v1.17.0 - ISC
|
|
201
|
+
*
|
|
202
|
+
* This source code is licensed under the ISC license.
|
|
203
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
204
|
+
*/const Fd=[["rect",{width:"8",height:"18",x:"3",y:"3",rx:"1",key:"oynpb5"}],["path",{d:"M7 3v18",key:"bbkbws"}],["path",{d:"M20.4 18.9c.2.5-.1 1.1-.6 1.3l-1.9.7c-.5.2-1.1-.1-1.3-.6L11.1 5.1c-.2-.5.1-1.1.6-1.3l1.9-.7c.5-.2 1.1.1 1.3.6Z",key:"1qboyk"}]],Ud=de("library-big",Fd);/**
|
|
205
|
+
* @license lucide-react v1.17.0 - ISC
|
|
206
|
+
*
|
|
207
|
+
* This source code is licensed under the ISC license.
|
|
208
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
209
|
+
*/const Jd=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Oo=de("loader-circle",Jd);/**
|
|
210
|
+
* @license lucide-react v1.17.0 - ISC
|
|
211
|
+
*
|
|
212
|
+
* This source code is licensed under the ISC license.
|
|
213
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
214
|
+
*/const Kd=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]],Wd=de("maximize-2",Kd);/**
|
|
215
|
+
* @license lucide-react v1.17.0 - ISC
|
|
216
|
+
*
|
|
217
|
+
* This source code is licensed under the ISC license.
|
|
218
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
219
|
+
*/const Gd=[["path",{d:"M14 4.1 12 6",key:"ita8i4"}],["path",{d:"m5.1 8-2.9-.8",key:"1go3kf"}],["path",{d:"m6 12-1.9 2",key:"mnht97"}],["path",{d:"M7.2 2.2 8 5.1",key:"1cfko1"}],["path",{d:"M9.037 9.69a.498.498 0 0 1 .653-.653l11 4.5a.5.5 0 0 1-.074.949l-4.349 1.041a1 1 0 0 0-.74.739l-1.04 4.35a.5.5 0 0 1-.95.074z",key:"s0h3yz"}]],Yd=de("mouse-pointer-click",Gd);/**
|
|
220
|
+
* @license lucide-react v1.17.0 - ISC
|
|
221
|
+
*
|
|
222
|
+
* This source code is licensed under the ISC license.
|
|
223
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
224
|
+
*/const Zd=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],zr=de("plus",Zd);/**
|
|
225
|
+
* @license lucide-react v1.17.0 - ISC
|
|
226
|
+
*
|
|
227
|
+
* This source code is licensed under the ISC license.
|
|
228
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
229
|
+
*/const Xd=[["path",{d:"m15 14 5-5-5-5",key:"12vg1m"}],["path",{d:"M20 9H9.5A5.5 5.5 0 0 0 4 14.5A5.5 5.5 0 0 0 9.5 20H13",key:"6uklza"}]],Qd=de("redo-2",Xd);/**
|
|
230
|
+
* @license lucide-react v1.17.0 - ISC
|
|
231
|
+
*
|
|
232
|
+
* This source code is licensed under the ISC license.
|
|
233
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
234
|
+
*/const eu=[["path",{d:"M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"14sxne"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16",key:"1hlbsb"}],["path",{d:"M16 16h5v5",key:"ccwih5"}]],tu=de("refresh-ccw",eu);/**
|
|
235
|
+
* @license lucide-react v1.17.0 - ISC
|
|
236
|
+
*
|
|
237
|
+
* This source code is licensed under the ISC license.
|
|
238
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
239
|
+
*/const nu=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],Fr=de("save",nu);/**
|
|
240
|
+
* @license lucide-react v1.17.0 - ISC
|
|
241
|
+
*
|
|
242
|
+
* This source code is licensed under the ISC license.
|
|
243
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
244
|
+
*/const ru=[["rect",{x:"14",y:"14",width:"8",height:"8",rx:"2",key:"1b0bso"}],["rect",{x:"2",y:"2",width:"8",height:"8",rx:"2",key:"1x09vl"}],["path",{d:"M7 14v1a2 2 0 0 0 2 2h1",key:"pao6x6"}],["path",{d:"M14 7h1a2 2 0 0 1 2 2v1",key:"19tdru"}]],au=de("send-to-back",ru);/**
|
|
245
|
+
* @license lucide-react v1.17.0 - ISC
|
|
246
|
+
*
|
|
247
|
+
* This source code is licensed under the ISC license.
|
|
248
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
249
|
+
*/const ou=[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]],iu=de("smartphone",ou);/**
|
|
250
|
+
* @license lucide-react v1.17.0 - ISC
|
|
251
|
+
*
|
|
252
|
+
* This source code is licensed under the ISC license.
|
|
253
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
254
|
+
*/const su=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],cu=de("sparkles",su);/**
|
|
255
|
+
* @license lucide-react v1.17.0 - ISC
|
|
256
|
+
*
|
|
257
|
+
* This source code is licensed under the ISC license.
|
|
258
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
259
|
+
*/const lu=[["path",{d:"M21 10.656V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.344",key:"2acyp4"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],du=de("square-check-big",lu);/**
|
|
260
|
+
* @license lucide-react v1.17.0 - ISC
|
|
261
|
+
*
|
|
262
|
+
* This source code is licensed under the ISC license.
|
|
263
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
264
|
+
*/const uu=[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]],zo=de("star",uu);/**
|
|
265
|
+
* @license lucide-react v1.17.0 - ISC
|
|
266
|
+
*
|
|
267
|
+
* This source code is licensed under the ISC license.
|
|
268
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
269
|
+
*/const pu=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],ur=de("trash-2",pu);/**
|
|
270
|
+
* @license lucide-react v1.17.0 - ISC
|
|
271
|
+
*
|
|
272
|
+
* This source code is licensed under the ISC license.
|
|
273
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
274
|
+
*/const hu=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Do=de("triangle-alert",hu);/**
|
|
275
|
+
* @license lucide-react v1.17.0 - ISC
|
|
276
|
+
*
|
|
277
|
+
* This source code is licensed under the ISC license.
|
|
278
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
279
|
+
*/const mu=[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]],fu=de("undo-2",mu);/**
|
|
280
|
+
* @license lucide-react v1.17.0 - ISC
|
|
281
|
+
*
|
|
282
|
+
* This source code is licensed under the ISC license.
|
|
283
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
284
|
+
*/const yu=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],gu=de("upload",yu);/**
|
|
285
|
+
* @license lucide-react v1.17.0 - ISC
|
|
286
|
+
*
|
|
287
|
+
* This source code is licensed under the ISC license.
|
|
288
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
289
|
+
*/const _u=[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]],vu=de("wifi",_u);/**
|
|
290
|
+
* @license lucide-react v1.17.0 - ISC
|
|
291
|
+
*
|
|
292
|
+
* This source code is licensed under the ISC license.
|
|
293
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
294
|
+
*/const bu=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],pr=de("x",bu);/**
|
|
295
|
+
* @license lucide-react v1.17.0 - ISC
|
|
296
|
+
*
|
|
297
|
+
* This source code is licensed under the ISC license.
|
|
298
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
299
|
+
*/const wu=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"11",x2:"11",y1:"8",y2:"14",key:"1vmskp"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]],$u=de("zoom-in",wu);/**
|
|
300
|
+
* @license lucide-react v1.17.0 - ISC
|
|
301
|
+
*
|
|
302
|
+
* This source code is licensed under the ISC license.
|
|
303
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
304
|
+
*/const xu=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]],ju=de("zoom-out",xu),ku="https://json-schema.org/draft/2020-12/schema",Su="https://aub.dev/schema/implementation-report/1.0.0",Nu="AUB Implementation Report",Cu="object",Pu=!1,Eu=["format","format_version","blueprint","implementation","node_mappings","acceptance_results","unresolved"],Au={format:{const:"aub-implementation-report"},format_version:{const:"1.0.0"},blueprint:{type:"object",additionalProperties:!1,required:["screen_id","version"],properties:{screen_id:{type:"string",minLength:1},version:{type:"string",minLength:1}}},implementation:{type:"object",additionalProperties:!1,required:["framework","route","files"],properties:{framework:{type:"string"},route:{type:"string"},files:{type:"array",items:{type:"string",minLength:1},uniqueItems:!0}}},node_mappings:{type:"array",items:{$ref:"#/$defs/nodeMapping"}},acceptance_results:{type:"array",items:{$ref:"#/$defs/acceptanceResult"}},unresolved:{type:"array",items:{type:"string",minLength:1}}},Ru={nodeMapping:{type:"object",additionalProperties:!1,required:["node_id","status","component"],properties:{node_id:{type:"string",minLength:1},status:{enum:["mapped","unmapped"]},component:{type:"string"},file:{type:"string"},selector:{type:"string"},notes:{type:"string"}}},acceptanceResult:{type:"object",additionalProperties:!1,required:["acceptance_id","status","evidence"],properties:{acceptance_id:{type:"string",minLength:1},status:{enum:["pass","fail","needs-review"]},evidence:{type:"array",items:{$ref:"#/$defs/evidence"}},notes:{type:"string"}}},evidence:{type:"object",additionalProperties:!1,required:["type","reference"],properties:{type:{enum:["screenshot","file","dom","command","interaction","note"]},reference:{type:"string",minLength:1}}}},Tu={$schema:ku,$id:Su,title:Nu,type:Cu,additionalProperties:Pu,required:Eu,properties:Au,$defs:Ru},Iu="https://json-schema.org/draft/2020-12/schema",Mu="https://github.com/HenryLau1103/AUB/schema/0.3.0/ui-blueprint.schema.json",Ou="UI Blueprint",zu="Structured specification of a UI screen for AI coding agents. Source of truth for layout, semantics, interactions, responsive rules, and acceptance criteria.",Du="object",qu=!1,Lu=["version","screen","viewports","nodes","interactions","responsive","acceptance"],Hu={$schema:{type:"string",description:"Optional path or URL to this JSON Schema. Lets editors (e.g. VS Code) provide validation and autocomplete for standalone .ui.json files. Ignored by AUB tooling."},version:{type:"string",description:"Semantic version of the schema this document conforms to.",pattern:"^[0-9]+\\.[0-9]+\\.[0-9]+$",enum:["0.1.0","0.2.0","0.3.0"],examples:["0.1.0","0.2.0","0.3.0"]},screen:{description:"Metadata about the screen this Blueprint describes.",$ref:"#/$defs/screen"},viewports:{type:"array",description:"Named viewport sizes the responsive rules reference. At least one required.",minItems:1,items:{$ref:"#/$defs/viewport"}},nodes:{type:"array",description:"Tree of semantic UI nodes composing the screen. The first node MUST be the root.",items:{$ref:"#/$defs/node"}},interactions:{type:"array",description:"User-driven interactions (click, hover, change, submit).",items:{$ref:"#/$defs/interaction"}},responsive:{type:"array",description:"Per-viewport rules that override or transform node layout/content.",items:{$ref:"#/$defs/responsive"}},acceptance:{type:"array",description:"Verifiable acceptance items. MUST be ≥5 per screen, must include layout, interaction, responsive, a11y categories.",minItems:5,items:{$ref:"#/$defs/acceptance"}},design_system:{$ref:"#/$defs/designSystem"},provenance:{$ref:"#/$defs/provenance"}},Bu=JSON.parse(`{"screen":{"type":"object","additionalProperties":false,"required":["id","name","type","platform","primary_user_goal"],"properties":{"id":{"type":"string","description":"Unique screen identifier (kebab or dot notation, e.g. 'dashboard.overview').","pattern":"^[a-z0-9][a-z0-9._-]*$","minLength":1,"maxLength":128},"name":{"type":"string","description":"Human-readable name shown in editors and exports.","minLength":1,"maxLength":128},"type":{"$ref":"#/$defs/screenType"},"platform":{"type":"string","enum":["web","mobile-web","ios","android","desktop"],"description":"Target platform. Drives default responsive rules and component variant."},"primary_user_goal":{"type":"string","description":"One-sentence description of what the user accomplishes on this screen. Used by agents to prioritize layout decisions.","minLength":1,"maxLength":280},"notes":{"type":"string","description":"Optional free-form notes for the implementing agent. Avoid putting layout intent here — use nodes and acceptance items."}}},"screenType":{"type":"string","enum":["dashboard","form","landing","settings","admin_table","detail","auth","error","empty","workspace","communication","content","commerce","calendar","files","onboarding"]},"viewport":{"type":"object","additionalProperties":false,"required":["id","width","height"],"properties":{"id":{"type":"string","description":"Viewport identifier used by responsive rules.","enum":["desktop","tablet","mobile","wide"]},"width":{"type":"integer","minimum":320,"maximum":7680},"height":{"type":"integer","minimum":320,"maximum":4320}}},"node":{"type":"object","description":"A single UI element. Tree structure is encoded via parent_id + children.","additionalProperties":false,"required":["id","type","name","role"],"properties":{"id":{"type":"string","description":"Globally unique node identifier within this Blueprint.","pattern":"^[a-z0-9][a-z0-9._-]*$","minLength":1,"maxLength":128},"type":{"$ref":"#/$defs/componentType"},"name":{"type":"string","description":"Display name shown in editor tree.","minLength":1,"maxLength":128},"role":{"type":"string","description":"Agent-facing role/intent. WHY this node exists, not WHAT it looks like.","minLength":1,"maxLength":280},"parent_id":{"type":["string","null"],"description":"Parent node id. null only for the root node.","pattern":"^[a-z0-9][a-z0-9._-]*$"},"children":{"type":"array","description":"Ordered list of child node ids. Container nodes only.","items":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]*$"}},"layout":{"$ref":"#/$defs/layout"},"placements":{"type":"object","description":"Exact geometry keyed by viewport. Coordinates are relative to the parent content box.","additionalProperties":false,"properties":{"desktop":{"$ref":"#/$defs/placement"},"tablet":{"$ref":"#/$defs/placement"},"mobile":{"$ref":"#/$defs/placement"},"wide":{"$ref":"#/$defs/placement"}}},"content":{"$ref":"#/$defs/content"},"style":{"$ref":"#/$defs/style"},"states":{"type":"array","description":"Visual/behavioral states this node can be in (e.g. default, hover, disabled, loading).","items":{"type":"string","enum":["default","hover","focus","active","disabled","loading","empty","error","selected"]},"uniqueItems":true},"constraints":{"type":"object","additionalProperties":false,"description":"Non-violable constraints the implementation must honor.","properties":{"min_width":{"type":"integer","minimum":0},"max_width":{"type":"integer","minimum":0},"min_height":{"type":"integer","minimum":0},"max_height":{"type":"integer","minimum":0},"touch_target_min":{"type":"integer","minimum":24,"description":"Minimum interactive area in pixels (Apple HIG 44, Material 48)."}}},"source":{"$ref":"#/$defs/sourceReference"},"bindings":{"$ref":"#/$defs/bindings"},"validation":{"$ref":"#/$defs/validation"},"initial_state":{"$ref":"#/$defs/initialState"}},"allOf":[{"description":"Leaf nodes must not declare children.","if":{"properties":{"type":{"$ref":"#/$defs/coreLeafComponentType"}},"required":["type"]},"then":{"properties":{"children":{"type":"array","maxItems":0}}}},{"description":"Container nodes must have at least one child when declared.","if":{"properties":{"type":{"$ref":"#/$defs/coreContainerComponentType"}},"required":["type"]},"then":{"anyOf":[{"required":["children"]},{"not":{"required":["children"]}}]}}]},"componentType":{"description":"Registered semantic component type. Agents read this to know WHAT a node is. Either a core type or a namespaced project-extension type declared in aub.registry.json.","anyOf":[{"$ref":"#/$defs/coreComponentType"},{"$ref":"#/$defs/extensionComponentType"}]},"extensionComponentType":{"type":"string","description":"Namespaced custom component type (team:component), declared in a project aub.registry.json and resolved by AUB validation. Lets teams extend the vocabulary without editing the core registry.","pattern":"^[a-z][a-z0-9]*:[a-z][a-z0-9_]*$"},"coreComponentType":{"type":"string","enum":["app_shell","page","section","header","sidebar","top_bar","bottom_nav","stack","grid","split_pane","scroll_area","heading","text","card","image","icon","avatar","badge","tag","divider","link","metric_card","data_table","list","detail_panel","chart_placeholder","timeline","activity_feed","calendar","kanban_board","kanban_column","form","field_group","text_input","select","checkbox","radio_group","toggle","slider","date_picker","file_upload","textarea","search_input","rich_text_editor","button","icon_button","button_group","menu","toolbar","command_palette","modal","drawer","toast","alert","empty_state","loading_state","error_state","tabs","breadcrumb","pagination","stepper","nav_item"],"description":"Core (built-in) semantic component types. Generated from schema/registry/components.json — do not edit by hand; run \`pnpm gen\`."},"coreContainerComponentType":{"type":"string","enum":["app_shell","page","section","header","sidebar","top_bar","bottom_nav","stack","grid","split_pane","scroll_area","card","list","detail_panel","timeline","activity_feed","kanban_board","kanban_column","form","field_group","rich_text_editor","button_group","menu","toolbar","command_palette","modal","drawer","tabs","stepper"],"description":"Core component types that may contain children. Generated — run \`pnpm gen\`."},"coreLeafComponentType":{"type":"string","enum":["heading","text","image","icon","avatar","badge","tag","divider","link","metric_card","data_table","chart_placeholder","calendar","text_input","select","checkbox","radio_group","toggle","slider","date_picker","file_upload","textarea","search_input","button","icon_button","toast","alert","empty_state","loading_state","error_state","breadcrumb","pagination","nav_item"],"description":"Core component types that must not contain children. Generated — run \`pnpm gen\`."},"layout":{"type":"object","description":"Container layout contract. Exact child geometry belongs in node.placements, not here.","additionalProperties":false,"properties":{"mode":{"type":"string","enum":["auto","freeform"],"description":"auto uses flex/grid flow; freeform uses child placements for the active viewport."},"display":{"type":"string","enum":["flex","grid","block","inline","none"]},"direction":{"type":"string","enum":["row","column","row-reverse","column-reverse"]},"wrap":{"type":"boolean"},"grid":{"type":"object","additionalProperties":false,"properties":{"columns":{"type":"integer","minimum":1,"maximum":24,"description":"Number of grid columns."},"rows":{"type":"integer","minimum":1},"template":{"type":"string","description":"Optional explicit CSS grid-template-areas value."}}},"align":{"type":"string","enum":["start","center","end","stretch","baseline"]},"justify":{"type":"string","enum":["start","center","end","space-between","space-around","space-evenly"]},"gap":{"type":"object","additionalProperties":false,"properties":{"x":{"type":"integer","minimum":0},"y":{"type":"integer","minimum":0}}},"padding":{"type":"object","additionalProperties":false,"properties":{"top":{"type":"integer"},"right":{"type":"integer"},"bottom":{"type":"integer"},"left":{"type":"integer"}}},"width":{"type":"object","additionalProperties":false,"properties":{"value":{"type":"number","minimum":0},"unit":{"type":"string","enum":["px","%","rem","vw"]}}},"height":{"type":"object","additionalProperties":false,"properties":{"value":{"type":"number","minimum":0},"unit":{"type":"string","enum":["px","%","rem","vh"]}}},"min_width":{"type":"object","additionalProperties":false,"properties":{"value":{"type":"number","minimum":0},"unit":{"type":"string","enum":["px","%","rem","vw"]}}},"max_width":{"type":"object","additionalProperties":false,"properties":{"value":{"type":"number","minimum":0},"unit":{"type":"string","enum":["px","%","rem","vw"]}}}}},"placement":{"type":"object","description":"Pixel geometry relative to the parent content box for one viewport.","additionalProperties":false,"required":["x","y","width","height"],"properties":{"x":{"type":"number","minimum":0},"y":{"type":"number","minimum":0},"width":{"type":"number","exclusiveMinimum":0},"height":{"type":"number","exclusiveMinimum":0},"z_index":{"type":"integer","minimum":-1000,"maximum":1000},"order":{"type":"integer"},"grow":{"type":"number","minimum":0},"basis":{"type":"number","minimum":0},"grid_column":{"type":"integer","minimum":1},"grid_row":{"type":"integer","minimum":1},"column_span":{"type":"integer","minimum":1,"maximum":24},"row_span":{"type":"integer","minimum":1,"maximum":24}}},"content":{"type":"object","description":"Component-specific content. Required fields depend on node.type — see if/then rules below.","additionalProperties":false,"properties":{"text":{"type":"string","description":"Visible text content (label, button caption, heading)."},"placeholder":{"type":"string","description":"Placeholder text for inputs."},"data_binding":{"type":"string","description":"Symbolic reference to a data source, e.g. 'metrics.revenue.current'."},"columns":{"type":"array","description":"Table column definitions.","items":{"$ref":"#/$defs/tableColumn"},"minItems":1},"items":{"type":"array","description":"List/menu items (when not data-driven).","items":{"$ref":"#/$defs/listItem"}},"action":{"type":"string","description":"Symbolic action intent, e.g. 'submit', 'navigate:/settings', 'open:detail_panel'."},"label":{"type":"string","description":"Accessible label for form inputs and icon buttons."},"empty_state":{"type":"string","description":"Symbolic id of an empty_state node to render when collection is empty."},"loading_state":{"type":"string","description":"Symbolic id of a loading_state node to render while data loads."},"error_state":{"type":"string","description":"Symbolic id of an error_state node to render on fetch failure."},"src":{"type":"string","description":"Image or media source URL."},"alt":{"type":"string","description":"Alternative text for visual media."},"icon":{"type":"string","description":"Symbolic icon name."},"value":{"type":"string","description":"Representative value shown by the component."},"helper_text":{"type":"string","description":"Supporting or validation text."},"variant":{"type":"string","description":"Semantic component variant such as primary, subtle, or destructive."}}},"tableColumn":{"type":"object","additionalProperties":false,"required":["id","header"],"properties":{"id":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]*$"},"header":{"type":"string","minLength":1},"data_binding":{"type":"string"},"sortable":{"type":"boolean"},"filterable":{"type":"boolean"},"cell_kind":{"type":"string","enum":["text","number","date","link","icon","action","status","checkbox"]},"icon":{"type":"string"},"action":{"type":"string"},"sticky":{"type":"boolean"},"align":{"type":"string","enum":["start","center","end"]},"visible_when":{"type":"string"},"width":{"type":"object","additionalProperties":false,"properties":{"value":{"type":"number","minimum":0},"unit":{"type":"string","enum":["px","%","rem"]}}}}},"listItem":{"type":"object","additionalProperties":false,"required":["id"],"properties":{"id":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]*$"},"label":{"type":"string"},"icon":{"type":"string"},"action":{"type":"string"}}},"style":{"type":"object","description":"Design tokens and visual constraints. Use token names, not raw values.","additionalProperties":false,"properties":{"tokens":{"type":"object","description":"Design tokens applied to this node (color.surface.primary, typography.heading.h2, etc).","additionalProperties":{"type":"string"}},"elevation":{"type":"integer","minimum":0,"maximum":24},"background":{"type":"string"},"foreground":{"type":"string"},"border":{"type":"string"},"typography":{"type":"string"},"radius":{"type":"string"},"shadow":{"type":"string"},"opacity":{"type":"number","minimum":0,"maximum":1},"variant":{"type":"string"}}},"provenance":{"type":"object","additionalProperties":false,"required":["source_kind","importer_version","source_files"],"properties":{"source_kind":{"type":"string","enum":["native","angular-component","html","figma","penpot","image","other"]},"framework":{"type":"string"},"importer_version":{"type":"string"},"entry_file":{"type":"string"},"source_files":{"type":"array","items":{"type":"string"},"uniqueItems":true}}},"sourceReference":{"type":"object","additionalProperties":false,"required":["file"],"properties":{"file":{"type":"string"},"line":{"type":"integer","minimum":1},"column":{"type":"integer","minimum":1},"selector":{"type":"string"}}},"bindings":{"type":"object","additionalProperties":false,"properties":{"value":{"type":"string"},"options":{"type":"string"},"visibility":{"type":"string"},"enabled":{"type":"string"},"repeat":{"type":"string"},"selected":{"type":"string"}}},"validation":{"type":"object","additionalProperties":false,"properties":{"required":{"type":"boolean"},"pattern":{"type":"string"},"min_length":{"type":"number","minimum":0},"max_length":{"type":"number","minimum":0},"min":{"type":"number"},"max":{"type":"number"}}},"initialState":{"type":"object","additionalProperties":false,"properties":{"visibility":{"type":"string","enum":["visible","hidden"]},"expanded":{"type":"boolean"},"selected":{"type":"boolean"}}},"designSystem":{"type":"object","description":"Named design tokens shared by all nodes in a Blueprint.","additionalProperties":false,"required":["name"],"properties":{"name":{"type":"string","minLength":1,"maxLength":128},"colors":{"$ref":"#/$defs/tokenMap"},"typography":{"$ref":"#/$defs/tokenMap"},"spacing":{"$ref":"#/$defs/tokenMap"},"radii":{"$ref":"#/$defs/tokenMap"},"shadows":{"$ref":"#/$defs/tokenMap"}}},"tokenMap":{"type":"object","additionalProperties":{"type":"string"}},"interaction":{"type":"object","additionalProperties":false,"required":["id","trigger","source_node_id","action","result_state"],"properties":{"id":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]*$"},"trigger":{"type":"string","enum":["click","double_click","hover","focus","blur","change","submit","key_enter","key_escape","swipe_left","swipe_right","load","scroll"]},"source_node_id":{"type":"string","description":"Node id that emits the trigger.","pattern":"^[a-z0-9][a-z0-9._-]*$"},"action":{"type":"string","description":"Action intent. Use verb-noun form: 'navigate:/foo', 'open:bar', 'submit:form_x'."},"target":{"type":"string","description":"Optional target node id or route.","pattern":"^[a-z0-9./:_\\\\-]*$"},"result_state":{"type":"string","description":"What changes as a result. Must be observable and verifiable, not 'looks nice'."}}},"responsive":{"type":"object","additionalProperties":false,"required":["viewport","rule","target_node_id","changes"],"properties":{"viewport":{"type":"string","enum":["desktop","tablet","mobile","wide"]},"rule":{"type":"string","enum":["keep","hide","drawer","bottom_nav","stack","scroll","card_list","col_reduce","collapse","expand","icon_only","label_only"]},"target_node_id":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]*$"},"changes":{"type":"object","description":"Specific property overrides. Empty object means no change beyond the rule.","additionalProperties":true}}},"acceptance":{"type":"object","additionalProperties":false,"required":["id","type","statement","target","priority","verification_method"],"properties":{"id":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]*$"},"type":{"type":"string","enum":["layout","interaction","responsive","a11y","content","performance"],"description":"Acceptance category. Every screen must include at least one of: layout, interaction, responsive, a11y."},"statement":{"type":"string","description":"Verifiable assertion. Must be testable, not subjective.","minLength":1,"maxLength":280},"target":{"type":"string","description":"Node id, viewport id, or selector pattern this acceptance applies to. Comma-separated lists are allowed for multi-target acceptance.","pattern":"^[A-Za-z0-9.#*\\\\[\\\\] ,|>_\\\\-=()\\"']*$"},"priority":{"type":"string","enum":["blocker","must","should","nice"]},"verification_method":{"type":"string","enum":["manual_visual","manual_ia_review","dom_query","computed_style","axe_audit","screenshot_diff","interaction_replay","code_diff"]}}}}`),ji={$schema:Iu,$id:Mu,title:Ou,description:zu,type:Du,additionalProperties:qu,required:Lu,properties:Hu,$defs:Bu},Vu="../ui-blueprint.schema.json",Fu="0.3.0",Uu="Canonical registry of UI Blueprint component types. This file is the source of truth — the JSON Schema enum in ui-blueprint.schema.json must stay in sync. The editor (Phase 2) reads this file to render the component palette.",Ju=[{id:"layout",name:"Layout",description:"Containers and structural primitives. Arrange children in flex/grid. Never hold business content directly.",types:[{name:"app_shell",displayName:"App Shell",isContainer:!0,description:"Top-level layout container."},{name:"page",displayName:"Page",isContainer:!0,description:"A full-screen scrollable content area."},{name:"section",displayName:"Section",isContainer:!0,description:"Logical grouping of related nodes."},{name:"header",displayName:"Header",isContainer:!0,description:"Top region of a screen, usually with title and actions."},{name:"sidebar",displayName:"Sidebar",isContainer:!0,description:"Vertical navigation column."},{name:"top_bar",displayName:"Top Bar",isContainer:!0,description:"Horizontal header with logo, search, and user actions."},{name:"bottom_nav",displayName:"Bottom Nav",isContainer:!0,description:"Mobile-first horizontal nav at screen bottom."},{name:"stack",displayName:"Stack",isContainer:!0,description:"Generic flex container, defaults to column."},{name:"grid",displayName:"Grid",isContainer:!0,description:"CSS-grid container with declared columns."},{name:"split_pane",displayName:"Split Pane",isContainer:!0,description:"Master/detail two-pane layout."},{name:"scroll_area",displayName:"Scroll Area",isContainer:!0,description:"Scrollable region with fixed dimensions."}]},{id:"visual",name:"Visual",description:"Common visual building blocks used to reproduce hierarchy, branding, and content density.",types:[{name:"heading",displayName:"Heading",isContainer:!1,description:"Semantic heading with declared typography.",typicalContent:["text"]},{name:"text",displayName:"Text",isContainer:!1,description:"Paragraph, caption, or helper text.",typicalContent:["text"]},{name:"card",displayName:"Card",isContainer:!0,description:"Framed group of related content and actions."},{name:"image",displayName:"Image",isContainer:!1,description:"Image with source and alternative text.",typicalContent:["src","alt"]},{name:"icon",displayName:"Icon",isContainer:!1,description:"Named interface icon.",typicalContent:["icon","label"]},{name:"avatar",displayName:"Avatar",isContainer:!1,description:"User or entity avatar.",typicalContent:["src","alt"]},{name:"badge",displayName:"Badge",isContainer:!1,description:"Status or count badge.",typicalContent:["text","variant"]},{name:"tag",displayName:"Tag",isContainer:!1,description:"Compact categorical label.",typicalContent:["text"]},{name:"divider",displayName:"Divider",isContainer:!1,description:"Visual separator between content groups."},{name:"link",displayName:"Link",isContainer:!1,description:"Inline navigation action.",typicalContent:["text","action"]}]},{id:"data",name:"Data",description:"Data display primitives. Bind to data sources, render collections and aggregates.",types:[{name:"metric_card",displayName:"Metric Card",isContainer:!1,description:"Single KPI with label, value, and delta.",typicalContent:["label","data_binding"]},{name:"data_table",displayName:"Data Table",isContainer:!1,description:"Tabular data with declared columns, sort, filter.",typicalContent:["columns","data_binding"]},{name:"list",displayName:"List",isContainer:!0,description:"Vertical collection of items."},{name:"detail_panel",displayName:"Detail Panel",isContainer:!0,description:"Right-side drawer or modal for row/record detail."},{name:"chart_placeholder",displayName:"Chart Placeholder",isContainer:!1,description:"Render slot for a chart library (recharts, visx, etc.)."},{name:"timeline",displayName:"Timeline",isContainer:!0,description:"Chronological event list."},{name:"activity_feed",displayName:"Activity Feed",isContainer:!0,description:"Reverse-chronological event stream."},{name:"calendar",displayName:"Calendar",isContainer:!1,description:"Month, week, or agenda calendar."},{name:"kanban_board",displayName:"Kanban Board",isContainer:!0,description:"Horizontal workflow board containing columns."},{name:"kanban_column",displayName:"Kanban Column",isContainer:!0,description:"Workflow stage containing task cards."}]},{id:"form",name:"Form",description:"Form containers and inputs. Every input has a label and a value-binding path.",types:[{name:"form",displayName:"Form",isContainer:!0,description:"Form container with declared submit action.",typicalContent:["action"]},{name:"field_group",displayName:"Field Group",isContainer:!0,description:"Visually grouped fields with shared label/legend."},{name:"text_input",displayName:"Text Input",isContainer:!1,description:"Single-line text input.",typicalContent:["label","placeholder"]},{name:"select",displayName:"Select",isContainer:!1,description:"Dropdown selector.",typicalContent:["label","items"]},{name:"checkbox",displayName:"Checkbox",isContainer:!1,description:"Boolean toggle with label.",typicalContent:["label"]},{name:"radio_group",displayName:"Radio Group",isContainer:!1,description:"Single-choice from a set of options.",typicalContent:["label","items"]},{name:"toggle",displayName:"Toggle",isContainer:!1,description:"On/off switch with label.",typicalContent:["label"]},{name:"slider",displayName:"Slider",isContainer:!1,description:"Numeric range input.",typicalContent:["label"]},{name:"date_picker",displayName:"Date Picker",isContainer:!1,description:"Calendar-based date input.",typicalContent:["label"]},{name:"file_upload",displayName:"File Upload",isContainer:!1,description:"Drag/drop or browse file input.",typicalContent:["label"]},{name:"textarea",displayName:"Textarea",isContainer:!1,description:"Multi-line text input.",typicalContent:["label","placeholder"]},{name:"search_input",displayName:"Search Input",isContainer:!1,description:"Search field with query intent.",typicalContent:["label","placeholder","action"]},{name:"rich_text_editor",displayName:"Rich Text Editor",isContainer:!0,description:"Document editing surface with toolbar and body."}]},{id:"action",name:"Action",description:"Triggers and actions. Always have an action intent and a target.",types:[{name:"button",displayName:"Button",isContainer:!1,description:"Primary action button. Must declare action intent.",typicalContent:["text","action"]},{name:"icon_button",displayName:"Icon Button",isContainer:!1,description:"Icon-only button. Must have an accessible label.",typicalContent:["label","action"]},{name:"button_group",displayName:"Button Group",isContainer:!0,description:"Cluster of related buttons."},{name:"menu",displayName:"Menu",isContainer:!0,description:"Dropdown menu of actions.",typicalContent:["label","items"]},{name:"toolbar",displayName:"Toolbar",isContainer:!0,description:"Horizontal action bar."},{name:"command_palette",displayName:"Command Palette",isContainer:!0,description:"Cmd-K style searchable action list."}]},{id:"feedback",name:"Feedback",description:"User feedback surfaces — modals, toasts, alerts, and explicit state placeholders.",types:[{name:"modal",displayName:"Modal",isContainer:!0,description:"Centered blocking dialog."},{name:"drawer",displayName:"Drawer",isContainer:!0,description:"Side-sliding panel."},{name:"toast",displayName:"Toast",isContainer:!1,description:"Transient feedback message."},{name:"alert",displayName:"Alert",isContainer:!1,description:"Inline message (info/warn/error)."},{name:"empty_state",displayName:"Empty State",isContainer:!1,description:"Placeholder for empty collections. Must be wired via content.empty_state.",typicalContent:["text","action"]},{name:"loading_state",displayName:"Loading State",isContainer:!1,description:"Placeholder for in-flight data."},{name:"error_state",displayName:"Error State",isContainer:!1,description:"Placeholder for fetch failure."}]},{id:"navigation",name:"Navigation",description:"Navigation primitives. Always link to a target screen or anchor.",types:[{name:"tabs",displayName:"Tabs",isContainer:!0,description:"Tabbed view selector."},{name:"breadcrumb",displayName:"Breadcrumb",isContainer:!1,description:"Hierarchical location indicator."},{name:"pagination",displayName:"Pagination",isContainer:!1,description:"Page navigation for collections."},{name:"stepper",displayName:"Stepper",isContainer:!0,description:"Multi-step flow indicator."},{name:"nav_item",displayName:"Nav Item",isContainer:!1,description:"Single link in a sidebar/top_nav. Must declare action.",typicalContent:["label","action"]}]}],ki={$schema:Vu,version:Fu,description:Uu,categories:Ju},Ku="../schema/ui-blueprint.schema.json",Wu="0.3.0",Gu={id:"dashboard.overview",name:"Dashboard Overview",type:"dashboard",platform:"web",primary_user_goal:"Let the user see high-level business metrics and drill into a specific data table row for detail.",notes:"Reference example used to validate the schema, types, and exporters."},Yu=[{id:"desktop",width:1440,height:900},{id:"tablet",width:1024,height:768},{id:"mobile",width:390,height:844}],Zu=[{id:"app_shell",type:"app_shell",name:"App Shell",role:"Top-level layout container: holds sidebar, top bar, and main content area.",parent_id:null,children:["sidebar","top_bar","main"],layout:{mode:"auto",display:"grid",grid:{columns:1,rows:1}}},{id:"sidebar",type:"sidebar",name:"Primary Sidebar",role:"Primary navigation. Groups links by section. Collapses to drawer on tablet/mobile.",parent_id:"app_shell",children:["nav_item_overview","nav_item_orders","nav_item_customers","nav_item_reports","nav_item_settings"],layout:{mode:"auto",display:"flex",direction:"column",gap:{y:4},padding:{top:24,bottom:24,left:16,right:16},width:{value:240,unit:"px"}}},{id:"nav_item_overview",type:"nav_item",name:"Overview",role:"Link to the Overview screen (current).",parent_id:"sidebar",content:{label:"Overview",action:"navigate:/dashboard"}},{id:"nav_item_orders",type:"nav_item",name:"Orders",role:"Link to the Orders screen.",parent_id:"sidebar",content:{label:"Orders",action:"navigate:/orders"}},{id:"nav_item_customers",type:"nav_item",name:"Customers",role:"Link to the Customers screen.",parent_id:"sidebar",content:{label:"Customers",action:"navigate:/customers"}},{id:"nav_item_reports",type:"nav_item",name:"Reports",role:"Link to the Reports screen.",parent_id:"sidebar",content:{label:"Reports",action:"navigate:/reports"}},{id:"nav_item_settings",type:"nav_item",name:"Settings",role:"Link to the Settings screen.",parent_id:"sidebar",content:{label:"Settings",action:"navigate:/settings"}},{id:"top_bar",type:"top_bar",name:"Top Bar",role:"Header containing page title, search, and user menu.",parent_id:"app_shell",children:["search_input","user_menu"],layout:{mode:"auto",display:"flex",direction:"row",align:"center",justify:"space-between",padding:{top:16,bottom:16,left:24,right:24},gap:{x:16}}},{id:"search_input",type:"text_input",name:"Global Search",role:"Search across orders, customers, and reports.",parent_id:"top_bar",content:{label:"Search",placeholder:"Search orders, customers...",action:"submit:global_search"},constraints:{touch_target_min:44}},{id:"user_menu",type:"menu",name:"User Menu",role:"Account menu containing profile, settings link, and logout.",parent_id:"top_bar",content:{label:"Account",items:[{id:"menu_profile",label:"Profile",action:"navigate:/profile"},{id:"menu_logout",label:"Sign out",action:"submit:logout"}]}},{id:"main",type:"page",name:"Main Content",role:"Scrollable area holding the dashboard panels.",parent_id:"app_shell",children:["page_title","metric_row","chart_panel","recent_orders_table"],layout:{mode:"auto",display:"flex",direction:"column",gap:{y:24},padding:{top:24,bottom:32,left:32,right:32}}},{id:"page_title",type:"section",name:"Page Title",role:"Heading for the dashboard view.",parent_id:"main",content:{text:"Overview"}},{id:"metric_row",type:"section",name:"Metric Row",role:"Top-level KPI summary. 4 cards on desktop, 2 on tablet, 1 on mobile.",parent_id:"main",children:["metric_revenue","metric_orders","metric_customers","metric_conversion"],layout:{mode:"auto",display:"grid",grid:{columns:4,template:"1fr 1fr 1fr 1fr"},gap:{x:16,y:16}}},{id:"metric_revenue",type:"metric_card",name:"Revenue",role:"Total revenue this month with delta vs last month.",parent_id:"metric_row",content:{label:"Revenue",data_binding:"metrics.revenue.current"}},{id:"metric_orders",type:"metric_card",name:"Orders",role:"Number of orders this month with delta.",parent_id:"metric_row",content:{label:"Orders",data_binding:"metrics.orders.current"}},{id:"metric_customers",type:"metric_card",name:"New Customers",role:"Number of new customers acquired this month.",parent_id:"metric_row",content:{label:"New Customers",data_binding:"metrics.customers.current"}},{id:"metric_conversion",type:"metric_card",name:"Conversion Rate",role:"Conversion rate percentage for this month.",parent_id:"metric_row",content:{label:"Conversion",data_binding:"metrics.conversion.current"}},{id:"chart_panel",type:"section",name:"Revenue Chart",role:"Time-series chart of revenue over the last 30 days.",parent_id:"main",children:["chart_placeholder"],content:{label:"Revenue trend (last 30 days)",data_binding:"metrics.revenue.series_30d"},layout:{mode:"auto",display:"block",padding:{top:16,bottom:16,left:16,right:16}}},{id:"chart_placeholder",type:"chart_placeholder",name:"Revenue Chart Placeholder",role:"Chart rendering surface; replaced by a real chart implementation in code.",parent_id:"chart_panel"},{id:"recent_orders_table",type:"section",name:"Recent Orders",role:"Sortable, filterable table of the most recent orders. Click row to open detail.",parent_id:"main",children:["orders_table","table_empty_state","table_loading_state","table_error_state"],layout:{mode:"auto",display:"flex",direction:"column",gap:{y:8}}},{id:"orders_table",type:"data_table",name:"Recent Orders Table",role:"The table itself. Renders the order list with declared columns.",parent_id:"recent_orders_table",content:{label:"Recent orders",data_binding:"orders.recent",empty_state:"table_empty_state",loading_state:"table_loading_state",error_state:"table_error_state",columns:[{id:"order_id",header:"Order ID",sortable:!0,filterable:!0},{id:"customer",header:"Customer",sortable:!0,filterable:!0},{id:"amount",header:"Amount",sortable:!0},{id:"status",header:"Status",filterable:!0},{id:"created_at",header:"Created",sortable:!0}]}},{id:"table_empty_state",type:"empty_state",name:"No Orders Empty State",role:"Shown when the orders list is empty.",parent_id:"recent_orders_table",content:{text:"No orders yet",action:"navigate:/orders/new"}},{id:"table_loading_state",type:"loading_state",name:"Table Loading",role:"Shown while the orders list is fetching.",parent_id:"recent_orders_table"},{id:"table_error_state",type:"error_state",name:"Table Error",role:"Shown when the orders list fails to load.",parent_id:"recent_orders_table",content:{text:"Could not load orders. Try again."}}],Xu=[{id:"int_search_submit",trigger:"submit",source_node_id:"search_input",action:"navigate:/search",result_state:"User is routed to /search with the query string in the URL."},{id:"int_user_menu_open",trigger:"click",source_node_id:"user_menu",action:"open:user_menu_dropdown",result_state:"Dropdown menu appears below the user menu with Profile and Sign out options."},{id:"int_user_logout",trigger:"click",source_node_id:"menu_logout",action:"submit:logout",result_state:"User is signed out and redirected to /auth/login."},{id:"int_orders_row_click",trigger:"click",source_node_id:"orders_table",action:"open:order_detail",target:"order_detail",result_state:"A side drawer slides in from the right within 200ms showing the order detail panel."},{id:"int_nav_overview",trigger:"click",source_node_id:"nav_item_overview",action:"navigate:/dashboard",result_state:"User is routed to the dashboard overview screen."},{id:"int_nav_settings",trigger:"click",source_node_id:"nav_item_settings",action:"navigate:/settings",result_state:"User is routed to the settings screen."}],Qu=[{viewport:"tablet",rule:"drawer",target_node_id:"sidebar",changes:{defaultVisible:!1,trigger:"hamburger"}},{viewport:"mobile",rule:"drawer",target_node_id:"sidebar",changes:{defaultVisible:!1,trigger:"hamburger"}},{viewport:"tablet",rule:"stack",target_node_id:"metric_row",changes:{"grid.columns":2}},{viewport:"mobile",rule:"stack",target_node_id:"metric_row",changes:{"grid.columns":1}},{viewport:"mobile",rule:"card_list",target_node_id:"orders_table",changes:{view:"stacked",primary_field:"order_id"}}],ep=[{id:"acc_layout_shell",type:"layout",statement:"App shell uses a grid layout with sidebar (240px), top bar, and main content area.",target:"app_shell",priority:"blocker",verification_method:"computed_style"},{id:"acc_layout_metric_row",type:"layout",statement:"Metric row displays 4 cards in a 4-column grid on desktop with 16px gap.",target:"metric_row",priority:"must",verification_method:"computed_style"},{id:"acc_interaction_row_click",type:"interaction",statement:"Clicking an order row opens a detail drawer within 200ms.",target:"orders_table",priority:"must",verification_method:"interaction_replay"},{id:"acc_interaction_logout",type:"interaction",statement:"Clicking Sign out terminates the session and routes to /auth/login.",target:"menu_logout",priority:"must",verification_method:"interaction_replay"},{id:"acc_responsive_sidebar",type:"responsive",statement:"Sidebar converts to a drawer triggered by a hamburger icon below 1024px viewport width.",target:"sidebar",priority:"must",verification_method:"manual_visual"},{id:"acc_responsive_metric_row",type:"responsive",statement:"Metric row collapses to 2 columns at tablet (1024px) and 1 column at mobile (390px).",target:"metric_row",priority:"must",verification_method:"screenshot_diff"},{id:"acc_responsive_table",type:"responsive",statement:"Orders table converts to a card list on mobile (390px) instead of horizontal scroll.",target:"orders_table",priority:"must",verification_method:"screenshot_diff"},{id:"acc_a11y_keyboard",type:"a11y",statement:"All interactive elements are reachable by keyboard tab order and show a visible focus ring.",target:"*[role=button], *[role=link], text_input, button",priority:"must",verification_method:"axe_audit"},{id:"acc_a11y_labels",type:"a11y",statement:"All form inputs have an associated label or aria-label.",target:"search_input, text_input",priority:"must",verification_method:"axe_audit"},{id:"acc_a11y_touch_targets",type:"a11y",statement:"All interactive elements have a minimum touch target of 44x44 pixels on mobile.",target:"*[interactive]",priority:"should",verification_method:"computed_style"},{id:"acc_content_empty",type:"content",statement:"When the orders list is empty, the empty_state node is rendered instead of an empty table.",target:"table_empty_state",priority:"should",verification_method:"dom_query"}],tp={name:"AUB Neutral",colors:{"surface.canvas":"#f8fafc","surface.panel":"#ffffff","surface.subtle":"#f1f5f9","text.primary":"#0f172a","text.secondary":"#64748b","border.default":"#cbd5e1","action.primary":"#2563eb","action.primary.text":"#ffffff","status.success":"#047857","status.warning":"#b45309","status.danger":"#b91c1c"},typography:{"heading.page":"700 28px/1.2 system-ui","heading.section":"650 18px/1.3 system-ui","body.default":"400 14px/1.5 system-ui","body.small":"400 12px/1.4 system-ui","label.default":"600 12px/1.3 system-ui"},spacing:{"space.1":"4px","space.2":"8px","space.3":"12px","space.4":"16px","space.5":"24px","space.6":"32px"},radii:{"radius.control":"6px","radius.panel":"8px","radius.round":"999px"},shadows:{"shadow.panel":"0 8px 24px rgba(15, 23, 42, 0.12)","shadow.overlay":"0 18px 48px rgba(15, 23, 42, 0.22)"}},np={$schema:Ku,version:Wu,screen:Gu,viewports:Yu,nodes:Zu,interactions:Xu,responsive:Qu,acceptance:ep,design_system:tp},qo="0.3.0";function tr(t){if(!t||typeof t!="object"||Array.isArray(t))throw new TypeError("Blueprint must be an object.");const e=typeof t.version=="string"?t.version:"0.1.0";if(!["0.1.0","0.2.0",qo].includes(e))throw new Error(`Unsupported Blueprint version: ${e}`);const n=structuredClone(t);return n.version=qo,n.design_system??(n.design_system=Ur()),n.nodes=Array.isArray(n.nodes)?n.nodes.map(r=>rp(r)):[],n}function Ur(){return{name:"AUB Neutral",colors:{"surface.canvas":"#f8fafc","surface.panel":"#ffffff","surface.subtle":"#f1f5f9","text.primary":"#0f172a","text.secondary":"#64748b","border.default":"#cbd5e1","action.primary":"#2563eb","action.primary.text":"#ffffff","status.success":"#047857","status.warning":"#b45309","status.danger":"#b91c1c"},typography:{"heading.page":"700 28px/1.2 system-ui","heading.section":"650 18px/1.3 system-ui","body.default":"400 14px/1.5 system-ui","body.small":"400 12px/1.4 system-ui","label.default":"600 12px/1.3 system-ui"},spacing:{"space.1":"4px","space.2":"8px","space.3":"12px","space.4":"16px","space.5":"24px","space.6":"32px"},radii:{"radius.control":"6px","radius.panel":"8px","radius.round":"999px"},shadows:{"shadow.panel":"0 8px 24px rgba(15, 23, 42, 0.12)","shadow.overlay":"0 18px 48px rgba(15, 23, 42, 0.22)"}}}function rp(t){const e={...t};return e.layout&&(e.layout={mode:e.layout.mode??"auto",...e.layout}),e.placements&&typeof e.placements=="object"&&(e.placements=Object.fromEntries(Object.entries(e.placements).map(([n,r])=>[n,ap(r)]))),e}function ap(t){const e={...t};for(const n of["x","y","width","height"])if(typeof e[n]!="number"||!Number.isFinite(e[n]))throw new Error(`Invalid placement.${n}`);return e}const op=`# AUB Agent Handoff Guide
|
|
305
|
+
|
|
306
|
+
This guide is for coding agents that receive an AUB UI Blueprint or an \`.aub.zip\` handoff package.
|
|
307
|
+
|
|
308
|
+
> 繁體中文版:[\`agent-handoff.zh-Hant.md\`](./agent-handoff.zh-Hant.md)
|
|
309
|
+
|
|
310
|
+
## Explain AUB to the user
|
|
311
|
+
|
|
312
|
+
AUB is a visual UI contract between a person and a coding agent. The user arranges a screen in the AUB editor, then exports structured layout, component semantics, interactions, responsive behavior, screenshots, and verifiable acceptance criteria.
|
|
313
|
+
|
|
314
|
+
In your first response:
|
|
315
|
+
|
|
316
|
+
1. Reply in the user's language.
|
|
317
|
+
2. Explain that AUB describes what the interface must do and how it will be verified.
|
|
318
|
+
3. List the AUB files and supporting evidence you found.
|
|
319
|
+
4. State whether you will author, plan, implement, or review.
|
|
320
|
+
5. Identify unresolved product decisions. Ask only when the repository and supplied evidence cannot resolve them.
|
|
321
|
+
|
|
322
|
+
## Recognize the inputs
|
|
323
|
+
|
|
324
|
+
An AUB handoff package can contain:
|
|
325
|
+
|
|
326
|
+
| File | Purpose | Authority |
|
|
327
|
+
|---|---|---|
|
|
328
|
+
| \`*.ui.json\` | Complete machine-readable UI contract | **Source of truth** |
|
|
329
|
+
| \`*.ui.md\` | Human- and agent-readable rendering of the Blueprint | Derived reference |
|
|
330
|
+
| \`screenshots/*.png\` | Visual evidence for each viewport | Supporting reference |
|
|
331
|
+
| \`*.agent.md\` | Agent-neutral task prompt | Execution instructions |
|
|
332
|
+
| \`*.codex.md\` | Codex-specific task prompt | Execution instructions |
|
|
333
|
+
| \`implementation-report.template.json\` | Required node and acceptance report | Completion contract |
|
|
334
|
+
| \`implementation-report.schema.json\` | Schema for the completed report | Validation contract |
|
|
335
|
+
| \`manifest.json\` | Package metadata, hashes, and entrypoint | Integrity metadata |
|
|
336
|
+
|
|
337
|
+
If files conflict, follow this precedence:
|
|
338
|
+
|
|
339
|
+
1. Valid \`*.ui.json\`
|
|
340
|
+
2. Explicit repository constraints
|
|
341
|
+
3. Acceptance criteria and responsive rules in the Blueprint
|
|
342
|
+
4. Generated \`*.ui.md\`
|
|
343
|
+
5. Screenshots
|
|
344
|
+
6. Prose outside the package
|
|
345
|
+
|
|
346
|
+
Do not silently resolve a conflict. Explain it and propose a concrete resolution.
|
|
347
|
+
|
|
348
|
+
## Choose the task
|
|
349
|
+
|
|
350
|
+
- **Author**: Convert product requirements or an existing screen into one schema-valid Blueprint.
|
|
351
|
+
- **Plan**: Map Blueprint nodes and acceptance ids to the target repository without editing files.
|
|
352
|
+
- **Implement**: Change the target repository until the Blueprint and every acceptance item are satisfied.
|
|
353
|
+
- **Review**: Compare an existing implementation with the Blueprint and report mismatches by severity.
|
|
354
|
+
|
|
355
|
+
## Required workflow
|
|
356
|
+
|
|
357
|
+
1. Read the target repository's instructions, including applicable \`AGENTS.md\`, \`CLAUDE.md\`, and \`.github/copilot-instructions.md\`.
|
|
358
|
+
2. Inspect existing routes, components, design tokens, dependencies, tests, and implementation patterns.
|
|
359
|
+
3. Validate the Blueprint before relying on it.
|
|
360
|
+
4. Map every Blueprint node id to an existing or new implementation component.
|
|
361
|
+
When \`aub.registry.json\` declares a matching production implementation, reuse its module,
|
|
362
|
+
export, source, and prop mappings before considering a new component.
|
|
363
|
+
5. Preserve hierarchy, semantic component type, layout mode, viewport geometry, interactions, responsive rules, states, and constraints.
|
|
364
|
+
6. Use repository-native components and tokens when they satisfy the contract.
|
|
365
|
+
7. Run checks that cover every changed surface.
|
|
366
|
+
8. Complete the implementation report with a file mapping and evidence for every acceptance id.
|
|
367
|
+
|
|
368
|
+
## Non-negotiable rules
|
|
369
|
+
|
|
370
|
+
- Treat \`*.ui.json\` as the source of truth. Markdown and screenshots do not override it.
|
|
371
|
+
- Do not redesign the screen, weaken acceptance criteria, or replace declared behavior with a preferred pattern.
|
|
372
|
+
- Do not invent missing product behavior. Record uncertainty and ask the user when it materially affects the result.
|
|
373
|
+
- Do not change \`auto\` layout to \`freeform\`, or the reverse, unless the Blueprint or an approved conflict resolution requires it.
|
|
374
|
+
- Preserve accessible names, focus behavior, minimum target sizes, and responsive overflow constraints.
|
|
375
|
+
- Report blockers explicitly. Partial completion must not be presented as complete.
|
|
376
|
+
|
|
377
|
+
## Completion response
|
|
378
|
+
|
|
379
|
+
Reply in the user's language and include:
|
|
380
|
+
|
|
381
|
+
1. What was implemented or reviewed.
|
|
382
|
+
2. Files changed or inspected.
|
|
383
|
+
3. Validation commands and exact results.
|
|
384
|
+
4. Every acceptance id with \`pass\`, \`fail\`, or \`needs-review\` and concrete evidence.
|
|
385
|
+
5. Unresolved decisions, conflicts, or blockers.
|
|
386
|
+
6. The completed \`implementation-report.json\` when the task is implementation or review.
|
|
387
|
+
|
|
388
|
+
An implementation is complete only when the report maps every node, every required acceptance item passes with evidence, and no unresolved blocker remains.
|
|
389
|
+
`,ip=`# AUB Agent 交付指南
|
|
390
|
+
|
|
391
|
+
本指南提供給收到 AUB UI Blueprint 或 \`.aub.zip\` 交付包的編碼 Agent。
|
|
392
|
+
|
|
393
|
+
> English version: [\`agent-handoff.md\`](./agent-handoff.md)
|
|
394
|
+
|
|
395
|
+
## 先向使用者說明 AUB
|
|
396
|
+
|
|
397
|
+
AUB 是使用者與編碼 Agent 之間的視覺 UI 合約。使用者在 AUB 編輯器中安排畫面,再匯出結構化的版面、元件語意、互動、響應式行為、畫面截圖與可驗證的驗收條件。
|
|
398
|
+
|
|
399
|
+
第一次回覆時:
|
|
400
|
+
|
|
401
|
+
1. 使用使用者目前使用的語言。
|
|
402
|
+
2. 說明 AUB 定義了介面應該做什麼,以及最後如何驗收。
|
|
403
|
+
3. 列出找到的 AUB 檔案與輔助證據。
|
|
404
|
+
4. 說明這次要執行生成、規劃、實作或審查。
|
|
405
|
+
5. 指出尚未決定的產品問題。只有 repository 與既有證據都無法回答時才詢問使用者。
|
|
406
|
+
|
|
407
|
+
## 辨識輸入內容
|
|
408
|
+
|
|
409
|
+
AUB 交付包可能包含:
|
|
410
|
+
|
|
411
|
+
| 檔案 | 用途 | 權威性 |
|
|
412
|
+
|---|---|---|
|
|
413
|
+
| \`*.ui.json\` | 完整且可由機器讀取的 UI 合約 | **唯一真實來源** |
|
|
414
|
+
| \`*.ui.md\` | Blueprint 的人類與 Agent 可讀版本 | 衍生參考 |
|
|
415
|
+
| \`screenshots/*.png\` | 各 viewport 的視覺證據 | 輔助參考 |
|
|
416
|
+
| \`*.agent.md\` | Agent 中立的任務提示 | 執行指示 |
|
|
417
|
+
| \`*.codex.md\` | Codex 專用任務提示 | 執行指示 |
|
|
418
|
+
| \`implementation-report.template.json\` | 必填的節點與驗收報告 | 完成契約 |
|
|
419
|
+
| \`implementation-report.schema.json\` | 完成報告使用的 schema | 驗證契約 |
|
|
420
|
+
| \`manifest.json\` | 交付包 metadata、雜湊與入口 | 完整性資料 |
|
|
421
|
+
|
|
422
|
+
若檔案彼此衝突,依以下順序判定:
|
|
423
|
+
|
|
424
|
+
1. 通過驗證的 \`*.ui.json\`
|
|
425
|
+
2. Repository 的明確限制
|
|
426
|
+
3. Blueprint 內的驗收條件與響應式規則
|
|
427
|
+
4. 自動產生的 \`*.ui.md\`
|
|
428
|
+
5. 截圖
|
|
429
|
+
6. 交付包外的文字描述
|
|
430
|
+
|
|
431
|
+
不得默默自行處理衝突。必須向使用者說明,並提出具體解法。
|
|
432
|
+
|
|
433
|
+
## 選擇任務
|
|
434
|
+
|
|
435
|
+
- **生成**:把產品需求或既有畫面轉成一份通過 schema 驗證的 Blueprint。
|
|
436
|
+
- **規劃**:把 Blueprint 節點與 acceptance id 對應到目標 repository,不修改檔案。
|
|
437
|
+
- **實作**:修改目標 repository,直到符合 Blueprint 與所有驗收條件。
|
|
438
|
+
- **審查**:比較既有實作與 Blueprint,依嚴重程度回報不一致之處。
|
|
439
|
+
|
|
440
|
+
## 必須遵守的流程
|
|
441
|
+
|
|
442
|
+
1. 讀取目標 repository 的規則,包括適用的 \`AGENTS.md\`、\`CLAUDE.md\` 與 \`.github/copilot-instructions.md\`。
|
|
443
|
+
2. 檢查既有 route、元件、design token、依賴、測試與實作慣例。
|
|
444
|
+
3. 驗證 Blueprint 後才能依賴其內容。
|
|
445
|
+
4. 將每個 Blueprint node id 對應到既有或新建的實作元件。
|
|
446
|
+
若 \`aub.registry.json\` 宣告了符合的 production implementation,必須先重用其中的
|
|
447
|
+
module、export、source 與 prop mapping,再考慮新建元件。
|
|
448
|
+
5. 保留階層、語意元件類型、layout mode、各 viewport 幾何、互動、響應式規則、狀態與限制。
|
|
449
|
+
6. 只要符合合約,應優先使用 repository 既有元件與 token。
|
|
450
|
+
7. 執行涵蓋所有修改面的檢查。
|
|
451
|
+
8. 完成 implementation report,提供每個節點的檔案對應,以及每個 acceptance id 的證據。
|
|
452
|
+
|
|
453
|
+
## 不可妥協的規則
|
|
454
|
+
|
|
455
|
+
- \`*.ui.json\` 是唯一真實來源;Markdown 與截圖不得覆蓋它。
|
|
456
|
+
- 不得自行重新設計、降低驗收條件,或用偏好的模式取代已宣告的行為。
|
|
457
|
+
- 不得猜測缺少的產品行為。應記錄不確定性;若會實質影響結果,再詢問使用者。
|
|
458
|
+
- 除非 Blueprint 或使用者核准的衝突解法要求,不得任意互換 \`auto\` 與 \`freeform\` layout。
|
|
459
|
+
- 必須保留 accessible name、focus 行為、最小操作尺寸與響應式 overflow 限制。
|
|
460
|
+
- 必須明確回報阻塞。部分完成不得宣稱為全部完成。
|
|
461
|
+
|
|
462
|
+
## 完成時的回覆
|
|
463
|
+
|
|
464
|
+
使用使用者的語言回覆,並包含:
|
|
465
|
+
|
|
466
|
+
1. 已實作或已審查的內容。
|
|
467
|
+
2. 修改或檢查過的檔案。
|
|
468
|
+
3. 驗證命令與精確結果。
|
|
469
|
+
4. 每個 acceptance id 的 \`pass\`、\`fail\` 或 \`needs-review\`,以及具體證據。
|
|
470
|
+
5. 尚未解決的決策、衝突或阻塞。
|
|
471
|
+
6. 若任務是實作或審查,附上完成的 \`implementation-report.json\`。
|
|
472
|
+
|
|
473
|
+
只有在報告已對應所有節點、所有必要驗收條件都有通過證據,且沒有未解決阻塞時,才能視為完成。
|
|
474
|
+
`;function Tt(t,e,n){const r=e instanceof Blob?e:new Blob([e],{type:n}),i=URL.createObjectURL(r),a=document.createElement("a");a.href=i,a.download=t,document.body.appendChild(a),a.click(),document.body.removeChild(a),URL.revokeObjectURL(i)}function Dr(t){return new Promise((e,n)=>{const r=new FileReader;r.onload=()=>e(String(r.result??"")),r.onerror=()=>n(r.error??new Error("FileReader error")),r.readAsText(t)})}async function sp(t,e,n,r,i,a,s){const{createHandoffArchive:c}=await Ke(async()=>{const{createHandoffArchive:l}=await import("./handoff-package.lib-DDYpcEma.js");return{createHandoffArchive:l}},__vite__mapDeps([0,1,2])),{bytes:u}=await c({blueprint:t,markdown:e,genericPrompt:n,codexPrompt:r,agentGuide:op,agentGuideZhHant:ip,reportTemplate:i,reportSchema:Tu,viewportImages:a,extensionRegistry:s??void 0}),d=new Uint8Array(u.byteLength);d.set(u),Tt(`${t.screen.id}.aub.zip`,d.buffer,"application/zip")}async function cp(t,e){const{default:n}=await Ke(async()=>{const{default:i}=await import("./jszip.min-CRfXyL92.js").then(a=>a.j);return{default:i}},__vite__mapDeps([3,1,2])),r=new n;for(const[i,a]of Object.entries(e))r.file(i,a);Tt(t,await r.generateAsync({type:"blob",compression:"DEFLATE"}),"application/zip")}async function lp(){const{default:t}=await Ke(async()=>{const{default:i}=await import("./jszip.min-CRfXyL92.js").then(a=>a.j);return{default:i}},__vite__mapDeps([3,1,2])),e=new t,n={"AUTHORING.md":pp(),"ui-blueprint.schema.json":`${JSON.stringify(ji,null,2)}
|
|
475
|
+
`,"components.json":`${JSON.stringify(ki,null,2)}
|
|
476
|
+
`,"examples/canonical.ui.json":`${JSON.stringify(tr(np),null,2)}
|
|
477
|
+
`,"prompts/author.md":hp(),"VALIDATE.md":`# Validation
|
|
478
|
+
|
|
479
|
+
Run \`pnpm validate path/to/screen.ui.json\` from the AUB repository. The command must exit with status 0.
|
|
480
|
+
`},r={};for(const[i,a]of Object.entries(n)){const s=new TextEncoder().encode(a);r[i]={sha256:await Si(s),bytes:s.byteLength},e.file(i,a)}e.file("manifest.json",`${JSON.stringify({format:"aub-authoring-kit",format_version:"1.0.0",blueprint_version:"0.3.0",files:r},null,2)}
|
|
481
|
+
`),Tt("aub-authoring-kit.zip",await e.generateAsync({type:"blob",compression:"DEFLATE"}),"application/zip")}async function dp(t){const{default:e}=await Ke(async()=>{const{default:i}=await import("./jszip.min-CRfXyL92.js").then(a=>a.j);return{default:i}},__vite__mapDeps([3,1,2])),n=new e,r=`${JSON.stringify({format:"aub-personal-template",format_version:"1.0.0",template:t},null,2)}
|
|
482
|
+
`;n.file("template.json",r),t.preview&&n.file("preview.png",up(t.preview)),n.file("manifest.json",`${JSON.stringify({format:"aub-personal-template",format_version:"1.0.0",template_id:t.id,files:{"template.json":{sha256:await Si(new TextEncoder().encode(r)),bytes:new TextEncoder().encode(r).byteLength}}},null,2)}
|
|
483
|
+
`),Tt(`${mp(t.name)}.aub-template.zip`,await n.generateAsync({type:"blob",compression:"DEFLATE"}),"application/zip")}function up(t){const e=t.split(",")[1]??"",n=atob(e);return Uint8Array.from(n,r=>r.charCodeAt(0))}async function Si(t){const e=new Uint8Array(t.byteLength);e.set(t);const n=await crypto.subtle.digest("SHA-256",e);return Array.from(new Uint8Array(n),r=>r.toString(16).padStart(2,"0")).join("")}function pp(){return`# AUB Blueprint Authoring
|
|
484
|
+
|
|
485
|
+
1. Use only component types declared in components.json.
|
|
486
|
+
2. Create exactly one root node with parent_id set to null.
|
|
487
|
+
3. Keep parent_id and children links bidirectionally consistent.
|
|
488
|
+
4. Use auto layout unless exact per-viewport geometry is known.
|
|
489
|
+
5. Declare interactions, responsive rules, and at least five acceptance items.
|
|
490
|
+
6. Include layout, interaction, responsive, and accessibility acceptance categories.
|
|
491
|
+
7. Record unresolved decisions in screen.notes instead of guessing.
|
|
492
|
+
8. Return JSON only when a machine-readable Blueprint is requested.
|
|
493
|
+
`}function hp(){return`Create an AUB UI Blueprint from the supplied screen requirements.
|
|
494
|
+
|
|
495
|
+
Read AUTHORING.md, components.json, ui-blueprint.schema.json, and the canonical example.
|
|
496
|
+
Return one complete JSON object using only registered component types.
|
|
497
|
+
Do not omit hierarchy, layout, interactions, responsive rules, or acceptance criteria.
|
|
498
|
+
If evidence is incomplete, record the uncertainty in screen.notes instead of inventing behavior.
|
|
499
|
+
Validate the result before returning it.
|
|
500
|
+
`}function mp(t){return t.trim().replace(/[^\p{L}\p{N}._-]+/gu,"-").replace(/^-+|-+$/g,"")||"template"}const fp=[{id:"en",label:"English"},{id:"zh-Hant",label:"繁體中文"}],Lo={en:{appTitle:"AUB Editor",noBlueprintLoaded:"no blueprint loaded",importJson:"Import Blueprint or Design Bridge",importAngular:"Import Angular component files",importPersonalTemplate:"Import personal template",importRegistry:"Import component registry",registryImported:"Component registry imported with {count} custom type(s).",registryInvalid:"Invalid component registry: {message}",downloadAuthoringKit:"Download AI authoring kit",exportJson:"Export JSON",exportMarkdown:"Export Markdown",exportPackage:"Export AI handoff package",valid:"valid",schemaValid:"schema valid",schemaError:"schema error",schemaErrors:"schema errors",parseJsonFailed:"Failed to parse JSON: {message}",language:"Language",componentPalette:"Component Palette",paletteHint:"Click or drag to add. Move existing components from the handle centered on their top border.",kindContainer:"Container",kindLeaf:"Leaf",properties:"Properties",selectNode:"Select a node to edit.",delete:"Delete",deleteComponent:"Delete component",dragComponent:"Drag {component}",dragComponentHint:"Drag to move {component}. Hold Alt/Option to place it inside another container.",rootCannotDelete:"Root node cannot be deleted",selectParent:"Parent",hideProperties:"Hide",showProperties:"Show properties",releaseToAdd:"Release to add {component}",id:"id",name:"name",type:"type",role:"role",layoutJson:"layout (JSON)",contentJson:"content (JSON)",layoutControls:"Layout",layoutVertical:"Vertical",layoutHorizontal:"Horizontal",layoutGrid:"Grid",layoutAlign:"Cross-axis alignment",layoutJustify:"Distribution",layoutStart:"Start",layoutCenter:"Center",layoutEnd:"End",layoutStretch:"Stretch",layoutBaseline:"Baseline",layoutSpaceBetween:"Space between",layoutSpaceAround:"Space around",layoutSpaceEvenly:"Space evenly",layoutHorizontalGap:"Horizontal gap",layoutVerticalGap:"Vertical gap",layoutColumns:"Columns",layoutWrap:"Wrap onto multiple lines",layoutHelp:"This controls how every direct child is arranged inside the selected container.",layoutFixed:"Fixed app layout",layoutAppShellHelp:"App Shell places Sidebar, Top Bar, Page, and Bottom Nav into semantic slots. Use containers inside the Page for flexible layout.",canvas:"Canvas",emptyCanvas:"Drag a component here or click one in the palette to start.",navigationItems:"Drop navigation items here",pageSidebarItems:"Drop filters, a table of contents, or tools here",appSidebarLabel:"App navigation",pageSidebarLabel:"Page sidebar",toolbarItems:"Toolbar items",dropComponents:"Drop components",enterValue:"Enter value",chooseOption:"Choose option",home:"Home",row:"Row",defaultColumnName:"Name",defaultColumnStatus:"Status",defaultColumnAmount:"Amount",nodes:"nodes",node:"node",interactions:"interactions",interaction:"interaction",acceptance:"acceptance",startHint:"Click any component in the palette to start. Drag-and-drop also works.",startTitle:"Start a new UI",startPrompt:"Choose the structure that matches the screen you are building.",startPage:"Single page",startPagePath:"Page → Section / Stack / Grid → Components",startApp:"Application",startAppPath:"App Shell → Sidebar + Top Bar + Page → Components",startFromTemplate:"Or start from a template",addedByEditor:"{type} added by editor",starterScreenName:"New Screen",starterPrimaryGoal:"Describe what the user accomplishes here.",starterRootName:"Page",starterRootRole:"Root container. Children added from the palette appear here.",starterAppScreenName:"New Application",starterAppGoal:"Build an application screen with navigation, a top bar, and a main content page.",starterAppShellName:"App Shell",starterAppShellRole:"Fixed application layout containing navigation, top bar, and the main page.",starterSidebarName:"Sidebar",starterSidebarRole:"Primary application navigation.",starterTopBarName:"Top Bar",starterTopBarRole:"Application-level search and actions.",starterMainPageName:"Main Page",starterMainPageRole:"Main content area. Add sections, stacks, grids, and components here.",starterPageCreated:"Created a single-page UI. Add a container or component to the Page.",starterAppCreated:"Created an application structure. The Main Page is selected.",addedToContainer:"Added {component} to {container}.",placedFreely:"Placed {component} freely in {container}. Existing components kept their positions.",movedToContainer:"Moved {component} into {container}.",createdRoot:"Created {component} as the root container.",shellSlotPlaced:"Created an App Shell and placed {component} in its semantic slot. The original page remains as main content.",pageSidebarPlaced:"Added a page sidebar to {container} and switched the container to horizontal layout.",mainDropArea:"Main drop area",template:"Template",chooseTemplate:"Choose template...",templateDashboard:"Dashboard app",templateLanding:"Product landing page",templateSettings:"Settings form",templateLoaded:"Loaded template: {template}.",zoom:"Zoom",fitArtboard:"Fit artboard",zoomOut:"Zoom out",zoomIn:"Zoom in",resolution:"Resolution",resolutionPreset:"Resolution preset",customResolution:"Custom…",viewportWidth:"Width",viewportHeight:"Height",applyResolution:"Apply resolution",undo:"Undo",redo:"Redo",duplicate:"Duplicate",duplicateName:"{name} Copy",bringFront:"Bring to front",sendBack:"Send to back",alignLeft:"Align left",alignCenter:"Align horizontal center",alignRight:"Align right",alignTop:"Align top",alignMiddle:"Align vertical center",alignBottom:"Align bottom",distributeHorizontal:"Distribute horizontally",distributeVertical:"Distribute vertically",toggleLayoutMode:"Switch auto/freeform layout",freeform:"Freeform",autoLayout:"Auto",importMigrated:"Imported and migrated the Blueprint to v0.3.",imported:"Blueprint imported.",preparingPackage:"Preparing AI handoff package...",packageReady:"AI handoff package exported.",viewportQualityBlocked:"AI handoff blocked by {count} viewport layout issue(s).",selected:"selected",components:"Components",templates:"Templates",layers:"Layers",searchComponents:"Search components",container:"Container",leaf:"Element",noLayers:"Create or import a Blueprint to see layers.",multipleSelected:"{count} components selected.","propertyTab.content":"Content","propertyTab.layout":"Layout","propertyTab.appearance":"Appearance","propertyTab.interaction":"Interaction",parentContainer:"Parent container",zIndex:"Layer",contentText:"Text",contentLabel:"Label",placeholder:"Placeholder",sourceUrl:"Source URL",altText:"Alternative text",advancedJson:"Advanced JSON",backgroundToken:"Background token",foregroundToken:"Foreground token",typographyToken:"Typography token",radiusToken:"Radius token",shadowToken:"Shadow token",variant:"Variant",opacity:"Opacity",actionIntent:"Action intent",supportedStates:"Supported states",declaredInteractions:"Declared interactions",noDeclaredInteractions:"No interaction record uses this component as its source.",openProject:"Open project",newProject:"New project from current screen",saveProject:"Save project (.zip)",closeProject:"Close project",addScreen:"Add screen",removeScreen:"Remove screen",renameScreen:"Rename screen",setEntryScreen:"Set as entry screen",entryScreen:"Entry screen",navigation:"Navigation",navFrom:"From",navTo:"To",navTrigger:"Trigger",navLabel:"Label",addNavEdge:"Add edge",noNavEdges:"No navigation edges yet.",projectName:"Project name",projectDescription:"Description",projectScreens:"Screens",showNavigation:"Show navigation",hideNavigation:"Hide navigation",navTriggerNone:"(none)",projectOpened:'Opened project "{name}".',projectSaved:"Saved project archive.",projectCreated:'Created project "{name}".',projectClosed:"Closed project.",projectMissingScreens:"Project opened, but some screens could not be resolved: {paths}",projectNoDocument:"No .aub.project.json document was found in the selected files.",screenAdded:'Added screen "{name}".',screenRemoved:'Removed screen "{name}".',cannotRemoveLastScreen:"A project must keep at least one screen."},"zh-Hant":{appTitle:"AUB 編輯器",noBlueprintLoaded:"尚未載入藍圖",importJson:"匯入 Blueprint 或 Design Bridge",importAngular:"匯入 Angular 元件檔案",importPersonalTemplate:"匯入個人範本",importRegistry:"匯入元件 registry",registryImported:"已匯入元件 registry,共 {count} 個自訂類型。",registryInvalid:"元件 registry 無效:{message}",downloadAuthoringKit:"下載 AI 建圖規格包",exportJson:"匯出 JSON",exportMarkdown:"匯出 Markdown",exportPackage:"匯出 AI 交付包",valid:"有效",schemaValid:"結構有效",schemaError:"個結構錯誤",schemaErrors:"個結構錯誤",parseJsonFailed:"JSON 解析失敗:{message}",language:"語言",componentPalette:"元件面板",paletteHint:"點擊或拖曳可新增元件;既有元件請從上方邊框中央的把手移動。",kindContainer:"容器",kindLeaf:"單一元件",properties:"屬性",selectNode:"選取一個元件來編輯。",delete:"刪除",deleteComponent:"刪除元件",dragComponent:"拖曳「{component}」",dragComponentHint:"拖曳以移動「{component}」;按住 Option/Alt 可將它放入另一個容器。",rootCannotDelete:"根節點不能刪除",selectParent:"選取父容器",hideProperties:"隱藏",showProperties:"顯示屬性",releaseToAdd:"放開以新增「{component}」",id:"識別碼",name:"名稱",type:"類型",role:"用途",layoutJson:"版面設定(JSON)",contentJson:"內容設定(JSON)",layoutControls:"容器排列",layoutVertical:"垂直",layoutHorizontal:"水平",layoutGrid:"格線",layoutAlign:"交叉軸對齊",layoutJustify:"主軸分布",layoutStart:"起點",layoutCenter:"置中",layoutEnd:"終點",layoutStretch:"撐滿",layoutBaseline:"文字基線",layoutSpaceBetween:"兩端對齊",layoutSpaceAround:"等距環繞",layoutSpaceEvenly:"平均分布",layoutHorizontalGap:"水平間距",layoutVerticalGap:"垂直間距",layoutColumns:"欄數",layoutWrap:"空間不足時換行",layoutHelp:"這些設定會控制目前容器內所有第一層子元件的排列方式。",layoutFixed:"固定應用版面",layoutAppShellHelp:"應用框架會把側邊欄、頂部列、頁面與底部導覽放入固定語意槽位;需要自由排列時,請在頁面內加入容器。",canvas:"畫布",emptyCanvas:"把元件拖到這裡,或點擊元件面板開始。",navigationItems:"將「導覽項目」拖到這裡",pageSidebarItems:"將篩選、目錄或工具元件拖到這裡",appSidebarLabel:"應用主導覽",pageSidebarLabel:"頁面側欄",toolbarItems:"工具列項目",dropComponents:"拖放元件",enterValue:"輸入內容",chooseOption:"選擇選項",home:"首頁",row:"列",defaultColumnName:"名稱",defaultColumnStatus:"狀態",defaultColumnAmount:"金額",nodes:"個節點",node:"個節點",interactions:"個互動",interaction:"個互動",acceptance:"個驗收項目",startHint:"點擊元件面板中的元件開始,也可以拖曳新增。",startTitle:"建立新的 UI",startPrompt:"先選擇符合這個畫面的基本結構。",startPage:"單一頁面",startPagePath:"頁面 → 區段/堆疊/格線 → 元件",startApp:"應用程式",startAppPath:"應用框架 → 側邊欄+頂部列+頁面 → 元件",startFromTemplate:"或直接使用範本",addedByEditor:"由編輯器新增的{type}",starterScreenName:"新畫面",starterPrimaryGoal:"描述使用者在這個畫面要完成的目標。",starterRootName:"頁面",starterRootRole:"根容器。從元件面板新增的子元件會放在這裡。",starterAppScreenName:"新應用程式",starterAppGoal:"建立包含導覽、頂部列與主內容頁面的應用程式畫面。",starterAppShellName:"應用框架",starterAppShellRole:"固定的應用版面,包含導覽、頂部列與主頁面。",starterSidebarName:"側邊欄",starterSidebarRole:"應用程式的主要導覽。",starterTopBarName:"頂部列",starterTopBarRole:"放置應用層級的搜尋與操作。",starterMainPageName:"主頁面",starterMainPageRole:"主要內容區。請在這裡加入區段、堆疊、格線與其他元件。",starterPageCreated:"已建立單一頁面,可在「頁面」內加入容器或元件。",starterAppCreated:"已建立應用程式骨架,並選取「主頁面」。",addedToContainer:"已將「{component}」新增到「{container}」。",placedFreely:"已將「{component}」自由放置於「{container}」,並保留既有元件位置。",movedToContainer:"已將「{component}」移入「{container}」。",createdRoot:"已建立「{component}」作為根容器。",shellSlotPlaced:"已建立應用框架,並將「{component}」放入固定位置;原頁面保留為主內容。",pageSidebarPlaced:"已將頁面側欄加入「{container}」,並切換為水平排列。",mainDropArea:"主內容暫放區",template:"範本",chooseTemplate:"選擇範本...",templateDashboard:"後台儀表板",templateLanding:"產品 Landing 頁",templateSettings:"設定表單",templateLoaded:"已載入範本:「{template}」。",zoom:"縮放",fitArtboard:"適應畫板",zoomOut:"縮小",zoomIn:"放大",resolution:"解析度",resolutionPreset:"解析度預設",customResolution:"自訂…",viewportWidth:"寬度",viewportHeight:"高度",applyResolution:"套用解析度",undo:"復原",redo:"重做",duplicate:"複製",duplicateName:"{name} 副本",bringFront:"移到最上層",sendBack:"移到最下層",alignLeft:"靠左對齊",alignCenter:"水平置中",alignRight:"靠右對齊",alignTop:"靠上對齊",alignMiddle:"垂直置中",alignBottom:"靠下對齊",distributeHorizontal:"水平平均分布",distributeVertical:"垂直平均分布",toggleLayoutMode:"切換自動/自由佈局",freeform:"自由",autoLayout:"自動",importMigrated:"已匯入並升級為 v0.3 藍圖。",imported:"已匯入藍圖。",preparingPackage:"正在準備 AI 交付包...",packageReady:"已匯出 AI 交付包。",viewportQualityBlocked:"偵測到 {count} 個裝置版面問題,已停止 AI 交付。",selected:"個已選取",components:"元件",templates:"範本",layers:"圖層",searchComponents:"搜尋元件",container:"容器",leaf:"元件",noLayers:"建立或匯入藍圖後即可查看圖層。",multipleSelected:"已選取 {count} 個元件。","propertyTab.content":"內容","propertyTab.layout":"佈局","propertyTab.appearance":"外觀","propertyTab.interaction":"互動",parentContainer:"父容器",zIndex:"圖層順序",contentText:"文字內容",contentLabel:"標籤",placeholder:"提示文字",sourceUrl:"來源網址",altText:"替代文字",advancedJson:"進階 JSON",backgroundToken:"背景 token",foregroundToken:"前景 token",typographyToken:"字體 token",radiusToken:"圓角 token",shadowToken:"陰影 token",variant:"樣式變體",opacity:"透明度",actionIntent:"動作意圖",supportedStates:"支援狀態",declaredInteractions:"已宣告互動",noDeclaredInteractions:"目前沒有互動紀錄以這個元件作為來源。",openProject:"開啟專案",newProject:"以目前畫面建立專案",saveProject:"儲存專案(.zip)",closeProject:"關閉專案",addScreen:"新增畫面",removeScreen:"移除畫面",renameScreen:"重新命名畫面",setEntryScreen:"設為起始畫面",entryScreen:"起始畫面",navigation:"導覽",navFrom:"來源",navTo:"目標",navTrigger:"觸發",navLabel:"標籤",addNavEdge:"新增連線",noNavEdges:"尚無導覽連線。",projectName:"專案名稱",projectDescription:"描述",projectScreens:"畫面",showNavigation:"顯示導覽",hideNavigation:"隱藏導覽",navTriggerNone:"(無)",projectOpened:"已開啟專案「{name}」。",projectSaved:"已儲存專案壓縮檔。",projectCreated:"已建立專案「{name}」。",projectClosed:"已關閉專案。",projectMissingScreens:"已開啟專案,但部分畫面無法解析:{paths}",projectNoDocument:"所選檔案中找不到 .aub.project.json 文件。",screenAdded:"已新增畫面「{name}」。",screenRemoved:"已移除畫面「{name}」。",cannotRemoveLastScreen:"專案至少需保留一個畫面。"}},yp={en:{en:"English","zh-Hant":"Traditional Chinese"},"zh-Hant":{en:"英文","zh-Hant":"繁體中文"}},gp={en:{},"zh-Hant":{layout:"版面",visual:"視覺",data:"資料",form:"表單",action:"操作",feedback:"回饋",navigation:"導覽"}},_p={en:{},"zh-Hant":{layout:"容器與結構元件,用 flex/grid 排列子元件。",visual:"標題、文字、圖片、卡片與其他視覺內容元件。",data:"資料顯示元件,用於集合、彙總與資料來源綁定。",form:"表單容器與輸入元件。",action:"觸發操作的元件,需具備動作意圖。",feedback:"訊息、對話框、提示與狀態佔位。",navigation:"導覽元件,連到目標畫面或錨點。"}},vp={en:{},"zh-Hant":{app_shell:"應用框架",page:"頁面",section:"區段",header:"頁首",sidebar:"側邊欄",top_bar:"頂部列",bottom_nav:"底部導覽",stack:"堆疊容器",grid:"格線",split_pane:"分割窗格",scroll_area:"捲動區域",metric_card:"指標卡片",data_table:"資料表格",list:"清單",detail_panel:"詳細面板",chart_placeholder:"圖表佔位",timeline:"時間軸",activity_feed:"活動動態",form:"表單",field_group:"欄位群組",text_input:"文字輸入",select:"下拉選單",checkbox:"核取方塊",radio_group:"單選群組",toggle:"切換開關",slider:"滑桿",date_picker:"日期選擇器",file_upload:"檔案上傳",button:"按鈕",icon_button:"圖示按鈕",button_group:"按鈕群組",menu:"選單",toolbar:"工具列",command_palette:"命令面板",modal:"彈出視窗",drawer:"抽屜面板",toast:"提示訊息",alert:"警示訊息",empty_state:"空狀態",loading_state:"載入狀態",error_state:"錯誤狀態",tabs:"分頁",breadcrumb:"麵包屑",pagination:"分頁控制",stepper:"步驟器",nav_item:"導覽項目",heading:"標題",text:"文字",card:"卡片",image:"圖片",icon:"圖示",avatar:"頭像",badge:"徽章",tag:"標籤",divider:"分隔線",link:"連結",textarea:"多行文字",search_input:"搜尋輸入",calendar:"行事曆",kanban_board:"看板",kanban_column:"看板欄",rich_text_editor:"富文字編輯器"}},bp={en:{},"zh-Hant":{app_shell:"最上層的應用版面容器。",page:"完整畫面的可捲動內容區。",section:"把相關元件分組的區塊。",header:"畫面上方區域,通常包含標題與操作。",sidebar:"側欄容器;放在應用框架中是主導覽,放在頁面或區段中則是篩選、目錄或工具側欄。",top_bar:"水平頂部列,包含標誌、搜尋與使用者操作。",bottom_nav:"行動優先的底部水平導覽。",stack:"通用 flex 容器,預設直向排列。",grid:"以 CSS grid 排列的容器。",split_pane:"主從或列表詳細的雙窗格版面。",scroll_area:"具固定尺寸的可捲動區域。",metric_card:"顯示單一 KPI、標籤、數值與變化。",data_table:"具欄位、排序與篩選的表格資料。",list:"垂直排列的項目集合。",detail_panel:"顯示資料列或紀錄細節的面板。",chart_placeholder:"提供圖表函式庫替換的顯示位置。",timeline:"依時間排序的事件清單。",activity_feed:"反向時間排序的活動串流。",form:"具提交動作的表單容器。",field_group:"具共同標籤或圖例的欄位群組。",text_input:"單行文字輸入欄位。",select:"下拉式選擇器。",checkbox:"具標籤的布林勾選元件。",radio_group:"從一組選項中單選。",toggle:"具標籤的開關元件。",slider:"數值範圍輸入元件。",date_picker:"以月曆選擇日期的輸入元件。",file_upload:"拖放或瀏覽檔案的上傳元件。",button:"主要操作按鈕,需要宣告動作意圖。",icon_button:"只有圖示的按鈕,需要無障礙標籤。",button_group:"一組相關按鈕。",menu:"動作下拉選單。",toolbar:"水平操作工具列。",command_palette:"類似 Cmd-K 的可搜尋命令清單。",modal:"置中的阻塞式對話框。",drawer:"從側邊滑出的面板。",toast:"短暫顯示的回饋訊息。",alert:"頁面內訊息,例如資訊、警告或錯誤。",empty_state:"集合沒有資料時的佔位狀態。",loading_state:"資料載入中的佔位狀態。",error_state:"資料取得失敗時的佔位狀態。",tabs:"分頁檢視選擇器。",breadcrumb:"階層式位置指示。",pagination:"集合資料的頁碼導覽。",stepper:"多步驟流程指示器。",nav_item:"側邊欄或頂部導覽中的單一連結。",heading:"具語意層級與字體 token 的標題。",text:"段落、說明或輔助文字。",card:"框住一組相關內容與操作的容器。",image:"具來源與替代文字的圖片。",icon:"以名稱指定的介面圖示。",avatar:"使用者或實體的頭像。",badge:"顯示狀態或數量的徽章。",tag:"精簡的分類標籤。",divider:"分隔內容群組的線條。",link:"行內導覽操作。",textarea:"多行文字輸入欄位。",search_input:"具搜尋意圖的輸入欄位。",calendar:"月、週或議程行事曆。",kanban_board:"包含工作流程欄的橫向看板。",kanban_column:"包含任務卡的工作流程階段。",rich_text_editor:"包含工具列與文件內容的編輯器。"}},wp={en:{desktop:"desktop",tablet:"tablet",mobile:"mobile",wide:"wide"},"zh-Hant":{desktop:"桌面",tablet:"平板",mobile:"手機",wide:"寬螢幕"}},$p={en:{default:"Default",hover:"Hover",focus:"Focus",active:"Active",disabled:"Disabled",loading:"Loading",empty:"Empty",error:"Error",selected:"Selected"},"zh-Hant":{default:"預設",hover:"游標停留",focus:"聚焦",active:"作用中",disabled:"停用",loading:"載入中",empty:"空狀態",error:"錯誤",selected:"已選取"}};function T(t,e,n={}){let r=Lo[t][e]??Lo.en[e];for(const[i,a]of Object.entries(n))r=r.replaceAll(`{${i}}`,String(a));return r}function xp(t,e){return yp[t][e]}function jp(t,e,n){return gp[t][e]??n}function kp(t,e,n){return _p[t][e]??n}function ft(t,e,n=e){return vp[t][e]??n}function Ho(t,e,n){return bp[t][e]??n}function Ni(t,e){return wp[t][e]??e}function Sp(t,e){return $p[t][e]??e}const Ci=ki;function Pi(){return Ci.categories}function Ei(t){for(const e of Ci.categories){const n=e.types.find(r=>r.name===t);if(n)return n}}function qe(t){var e;return((e=Ei(t))==null?void 0:e.isContainer)??!1}const Bo=320,Np=7680,Vo=320,Cp=4320,Cr=[{id:"desktop-1440",group:"desktop",width:1440,height:900},{id:"desktop-fhd",group:"desktop",width:1920,height:1080},{id:"desktop-1366",group:"desktop",width:1366,height:768},{id:"desktop-1280",group:"desktop",width:1280,height:800},{id:"desktop-macbook",group:"desktop",width:1512,height:982},{id:"tablet-ipad",group:"tablet",width:1024,height:768},{id:"tablet-ipad-portrait",group:"tablet",width:834,height:1112},{id:"tablet-surface",group:"tablet",width:1368,height:912},{id:"mobile-iphone",group:"mobile",width:390,height:844},{id:"mobile-iphone-max",group:"mobile",width:430,height:932},{id:"mobile-android",group:"mobile",width:360,height:800},{id:"mobile-pixel",group:"mobile",width:412,height:915}];function Ai(t){return Number.isFinite(t)?Math.round(Math.max(Bo,Math.min(Np,t))):Bo}function Ri(t){return Number.isFinite(t)?Math.round(Math.max(Vo,Math.min(Cp,t))):Vo}let Fo=0;function Ti(t){return Fo+=1,`${t}_${Date.now().toString(36)}_${Fo.toString(36)}`}function Uo(t,e,n){const r=Ti(t),i=Pp(t);return{id:r,type:t,name:n??t.replace(/_/g," ").replace(/\b\w/g,s=>s.toUpperCase()),role:e??`${t} added by editor`,parent_id:null,children:[],...i?{layout:i}:{},...Dp(t)}}function Pp(t){return t==="page"||t==="section"||t==="card"?{mode:"freeform"}:St(t)}function St(t){switch(t){case"grid":return{mode:"auto",display:"grid",grid:{columns:3},align:"stretch",gap:{x:12,y:12}};case"split_pane":return{mode:"auto",display:"grid",grid:{columns:2},align:"stretch",gap:{x:16,y:16}};case"header":case"top_bar":case"bottom_nav":case"toolbar":case"button_group":case"tabs":case"stepper":return{mode:"auto",display:"flex",direction:"row",wrap:!0,align:"center",gap:{x:8,y:8}};case"app_shell":return{mode:"freeform"};case"page":case"section":case"sidebar":case"stack":case"scroll_area":case"list":case"detail_panel":case"timeline":case"activity_feed":case"form":case"field_group":case"menu":case"command_palette":case"modal":case"drawer":case"card":case"kanban_board":case"kanban_column":case"rich_text_editor":return{mode:"auto",display:"flex",direction:"column",align:"stretch",gap:{x:12,y:12}};default:return}}function Ft(t,e={x:32,y:32}){const r={sidebar:{width:240,height:640},top_bar:{width:720,height:64},bottom_nav:{width:390,height:64},section:{width:520,height:240},card:{width:280,height:180},metric_card:{width:220,height:120},data_table:{width:560,height:300},chart_placeholder:{width:420,height:240},form:{width:420,height:440},text_input:{width:240,height:64},search_input:{width:280,height:44},textarea:{width:280,height:120},button:{width:120,height:44},icon_button:{width:44,height:44},heading:{width:360,height:48},text:{width:360,height:72},image:{width:320,height:200},avatar:{width:48,height:48},badge:{width:80,height:28},tag:{width:88,height:30},divider:{width:320,height:1},calendar:{width:560,height:420},kanban_board:{width:840,height:520},kanban_column:{width:260,height:460},rich_text_editor:{width:620,height:480}}[t]??{width:240,height:120};return{...e,...r,z_index:1}}function st(t,e){return t.nodes.find(n=>n.id===e)}function Ii(t){return t.nodes.find(e=>e.parent_id===null)}function Jo(t,e,n=null){var c;const r=Ii(t);if(!r)return{...t,nodes:[{...e,parent_id:null}]};const i=n??r.id,a={...t,nodes:[...t.nodes,{...e,parent_id:i}]},s=t.nodes.find(u=>u.id===i);if(s&&!((c=s.children)!=null&&c.includes(e.id))){const u={...s,children:[...s.children??[],e.id]};a.nodes=a.nodes.map(d=>d.id===i?u:d)}return a}function Ep(t,e,n){const r=Ii(t);return r?{...t,nodes:[{...e,parent_id:null,children:[n.id,r.id]},...t.nodes.map(i=>i.id===r.id?{...i,parent_id:e.id}:i),{...n,parent_id:e.id}]}:{...t,nodes:[{...e,parent_id:null,children:[n.id]},{...n,parent_id:e.id}]}}function Ap(t,e){const n=new Set,r=a=>{n.add(a);const s=t.nodes.find(c=>c.id===a);if(s!=null&&s.children)for(const c of s.children)r(c)};r(e);const i=t.nodes.filter(a=>!n.has(a.id)).map(a=>a.children?{...a,children:a.children.filter(s=>!n.has(s))}:a);return{...t,nodes:i}}function ar(t,e,n){return{...t,nodes:t.nodes.map(r=>r.id===e?{...r,...n,id:r.id}:r)}}function or(t,e,n,r){var m,g;const i=st(t,e);if(!i)return t;const a=((m=i.placements)==null?void 0:m[n])??((g=i.placements)==null?void 0:g.desktop)??Ft(i.type),s=t.viewports.find($=>$.id===n),c=Math.max(1,Math.min(r.width??a.width,(s==null?void 0:s.width)??Number.POSITIVE_INFINITY)),u=Math.max(1,r.height??a.height),d=Math.max(0,Math.min(r.x??a.x,s?Math.max(0,s.width-c):Number.POSITIVE_INFINITY)),l=Math.max(0,r.y??a.y);return ar(t,e,{placements:{...i.placements,[n]:{...a,...r,x:d,y:l,width:c,height:u}}})}function Ko(t,e){return e.reduce((n,r)=>or(n,r.id,r.viewportId,r.patch),t)}function Rp(t,e,n){const r=t.viewports.find(l=>l.id===e);if(!r)return t;const i=n.width!=null?Ai(n.width):r.width,a=n.height!=null?Ri(n.height):r.height;if(i===r.width&&a===r.height)return t;const s=t.viewports.map(l=>l.id===e?{...l,width:i,height:a}:l),c=i/r.width,u=a/r.height,d=t.nodes.map(l=>{var _;const m=(_=l.placements)==null?void 0:_[e];if(!m)return l;const g=Math.max(1,Math.min(Math.round(m.width*c),i)),$=Math.max(1,Math.min(Math.round(m.height*u),a)),k=Math.max(0,Math.min(Math.round(m.x*c),Math.max(0,i-g))),j=Math.max(0,Math.min(Math.round(m.y*u),Math.max(0,a-$)));return{...l,placements:{...l.placements,[e]:{...m,x:k,y:j,width:g,height:$}}}});return{...t,viewports:s,nodes:d}}function Wo(t,e,n,r){const i=st(t,e),a=st(t,n);if(!i||!a||!qe(a.type)||i.parent_id===null||e===n||Mp(t,n,e))return t;const s=t.nodes.map(c=>{var u;if(c.id===i.parent_id)return{...c,children:(c.children??[]).filter(d=>d!==e)};if(c.id===n){const d=(c.children??[]).filter(l=>l!==e);return d.splice(Math.max(0,Math.min(d.length,d.length)),0,e),{...c,children:d}}return c.id===e?{...c,parent_id:n,...((u=a.layout)==null?void 0:u.mode)==="freeform"?{placements:zp(t,c)}:{}}:c});return{...t,nodes:s}}function Tp(t,e,n=r=>`${r} Copy`){const r=e.filter(l=>{var m;return((m=st(t,l))==null?void 0:m.parent_id)!==null}),i=new Set(r),a=r.filter(l=>{const m=st(t,l);return m&&!i.has(m.parent_id??"")}),s=new Map,c=[];function u(l,m){const g=st(t,l);if(!g)return;const $=Ti(g.type);s.set(l,$);const k=g.children??[],j={...structuredClone(g),id:$,name:n(g.name),parent_id:m??g.parent_id,children:[],placements:Op(g.placements)};c.push(j);for(const _ of k)u(_,$);j.children=k.map(_=>s.get(_)).filter(_=>!!_)}for(const l of a)u(l);let d={...t,nodes:[...t.nodes,...c]};for(const l of a){const m=st(t,l),g=s.get(l);if(!(m!=null&&m.parent_id)||!g)continue;const $=st(d,m.parent_id);d=ar(d,m.parent_id,{children:[...($==null?void 0:$.children)??[],g]})}return{blueprint:d,ids:a.map(l=>s.get(l)).filter(l=>!!l)}}function Ip(t,e,n,r){const i=e.map(c=>st(t,c)).filter(c=>!!c),a=new Map;for(const c of i){const u=a.get(c.parent_id)??[];u.push(c),a.set(c.parent_id,u)}let s=t;for(const[c,u]of a){const l=t.nodes.filter($=>$.parent_id===c).map($=>{var k,j;return((j=(k=$.placements)==null?void 0:k[n])==null?void 0:j.z_index)??0}),m=[...u].sort(($,k)=>{var j,_,b,f;return(((_=(j=$.placements)==null?void 0:j[n])==null?void 0:_.z_index)??0)-(((f=(b=k.placements)==null?void 0:b[n])==null?void 0:f.z_index)??0)}),g=r==="front"?Math.max(0,...l)+1:Math.min(0,...l)-m.length;s=m.reduce(($,k,j)=>or($,k.id,n,{z_index:g+j}),s)}return s}function Mp(t,e,n){let r=st(t,e);for(;r!=null&&r.parent_id;){if(r.parent_id===n)return!0;r=st(t,r.parent_id)}return!1}function Op(t){if(t)return Object.fromEntries(Object.entries(t).map(([e,n])=>[e,{...n,x:n.x+16,y:n.y+16}]))}function zp(t,e){var r,i,a,s;const n=((r=e.placements)==null?void 0:r.desktop)??((i=e.placements)==null?void 0:i.tablet)??((a=e.placements)==null?void 0:a.mobile)??((s=e.placements)==null?void 0:s.wide)??Ft(e.type);return Object.fromEntries(t.viewports.map(c=>{var m;const u=((m=e.placements)==null?void 0:m[c.id])??n,d=Math.max(1,Math.min(u.width,c.width)),l=Math.max(1,Math.min(u.height,c.height));return[c.id,{...u,width:d,height:l,x:Math.max(0,Math.min(u.x,c.width-d)),y:Math.max(0,Math.min(u.y,c.height-l))}]}))}function Dp(t){const e={heading:{text:"Heading"},text:{text:"Text content"},image:{src:"",alt:"Image"},icon:{icon:"circle",label:"Icon"},avatar:{alt:"Avatar"},badge:{text:"Status",variant:"success"},tag:{text:"Tag"},link:{text:"Link",action:"navigate:/"},textarea:{label:"Notes",placeholder:"Enter details"},search_input:{label:"Search",placeholder:"Search...",action:"search"},button:{label:"Button",action:"click"}},n={heading:{typography:"heading.section",foreground:"text.primary"},text:{typography:"body.default",foreground:"text.secondary"},card:{background:"surface.panel",border:"border.default",radius:"radius.panel",shadow:"shadow.panel"},button:{background:"action.primary",foreground:"action.primary.text",radius:"radius.control",variant:"primary"}};return{...e[t]?{content:e[t]}:{},...n[t]?{style:n[t]}:{}}}const qp=12,Lp=new Set(["button","icon_button","button_group","nav_item","link","menu","command_palette","form","search_input","text_input","textarea","select","checkbox","radio_group","toggle","slider","date_picker","file_upload","tabs","stepper"]),Mi=new Set(["select","checkbox","radio_group","toggle","slider","date_picker","file_upload","text_input","textarea"]),Oi=new Set(["form","search_input"]);function Vt(t,e,n){return t==="zh-Hant"?n:e}function zi(t,e){const n=new Set(e);let r=e.length+1,i=`${t}_${r}`;for(;n.has(i);)r+=1,i=`${t}_${r}`;return i}function Jr(t){return Array.isArray(t==null?void 0:t.nodes)?t.nodes:[]}function Hp(t){return Oi.has(t)?"submit":Mi.has(t)?"change":"click"}function Bp(t){var r;const e=(r=t==null?void 0:t.content)==null?void 0:r.action;if(typeof e=="string"&&e.trim())return e.trim();const n=t.type;return Oi.has(n)?`submit:${t.id}`:Mi.has(n)?`change:${t.id}`:n==="link"||n==="nav_item"?`navigate:${t.id}`:`activate:${t.id}`}function Di(t,{language:e="en"}={}){const n=Array.isArray(t==null?void 0:t.interactions)?t.interactions:[],r=new Set(n.map(s=>s==null?void 0:s.source_node_id).filter(Boolean)),i=n.map(s=>s==null?void 0:s.id).filter(Boolean),a=[];for(const s of Jr(t)){if(a.length>=qp)break;if(!(s!=null&&s.id)||!Lp.has(s.type)||r.has(s.id))continue;r.add(s.id);const c=Hp(s.type),u=zi("interaction",[...i,...a.map(l=>l.id)]),d=s.name??s.id;a.push({id:u,trigger:c,source_node_id:s.id,action:Bp(s),result_state:Vt(e,`The result of ${d} is visibly presented to the user.`,`${d} 的操作結果清楚呈現給使用者。`)})}return{interactions:[...n,...a],added:a}}const qi=new Set(["tablet","mobile"]);function Vp(t){var r;const e=t==null?void 0:t.layout;if(!e)return!1;const n=((r=e.grid)==null?void 0:r.columns)??e.columns;return(e.display==="grid"||e.mode==="grid")&&Number(n)>1}function Fp(t,e){const n=Jr(t),r=[],i=new Set,a=(s,c,u)=>{!s||i.has(s)||(i.add(s),r.push({target_node_id:s,rule:c,changes:u}))};for(const s of n)s.type==="sidebar"&&a(s.id,"drawer",{});for(const s of n)(s.type==="top_bar"||s.type==="bottom_nav"||s.type==="toolbar")&&a(s.id,e==="mobile"?"bottom_nav":"icon_only",{});for(const s of n)Vp(s)&&a(s.id,"col_reduce",{columns:e==="mobile"?1:2});if(r.length===0){const s=n.find(c=>c.parent_id==null)??n[0];s&&a(s.id,"stack",{})}return r}function Up(t){const e=Array.isArray(t==null?void 0:t.responsive)?t.responsive:[],n=new Set(e.map(a=>`${a==null?void 0:a.viewport}::${a==null?void 0:a.target_node_id}`)),r=Array.isArray(t==null?void 0:t.viewports)?t.viewports:[],i=[];for(const a of r){const s=a==null?void 0:a.id;if(qi.has(s))for(const c of Fp(t,s)){const u=`${s}::${c.target_node_id}`;n.has(u)||(n.add(u),i.push({viewport:s,rule:c.rule,target_node_id:c.target_node_id,changes:c.changes}))}}return{responsive:[...e,...i],added:i}}const Jp=["layout","interaction","responsive","a11y"],Kp=5;function Wp(t,e,n){const r=Jr(e),i=r.find(s=>s.parent_id==null)??r[0],a=((e==null?void 0:e.viewports)??[]).map(s=>s==null?void 0:s.id).find(s=>qi.has(s))??"mobile";switch(t){case"layout":return{type:"layout",statement:Vt(n,"All major regions match their declared placements on desktop.","桌面版所有主要區域的位置與尺寸符合 placement。"),target:"desktop",priority:"blocker",verification_method:"screenshot_diff"};case"interaction":return{type:"interaction",statement:Vt(n,"Primary buttons and navigation controls declare and perform their actions.","所有主要按鈕與導覽操作都有明確 action 並可執行。"),target:"*",priority:"must",verification_method:"interaction_replay"};case"responsive":return{type:"responsive",statement:Vt(n,`The ${a} layout adapts without horizontal overflow.`,`${a} 版面自適應且不水平溢出。`),target:a,priority:"must",verification_method:"screenshot_diff"};case"a11y":return{type:"a11y",statement:Vt(n,"Interactive controls have understandable labels and visible focus states.","互動元件具備可理解的文字標籤與可見的 focus 狀態。"),target:"*",priority:"must",verification_method:"axe_audit"};case"content":default:return{type:"content",statement:Vt(n,`Names and content explain the purpose of each major region${i?` starting at ${i.name??i.id}`:""}.`,"每個主要區域的名稱與內容能說明其用途。"),target:"*",priority:"should",verification_method:"manual_ia_review"}}}function Gp(t,{language:e="en"}={}){const n=Array.isArray(t==null?void 0:t.acceptance)?t.acceptance:[],r=new Set(n.map(d=>d==null?void 0:d.type).filter(Boolean)),i=n.map(d=>d==null?void 0:d.id).filter(Boolean),a=[],s=d=>{const l=Wp(d,t,e),m=zi("acc",[...i,...a.map(g=>g.id)]);a.push({id:m,...l})};for(const d of Jp)r.has(d)||(r.add(d),s(d));const c=["content","responsive","a11y","interaction","layout"];let u=0;for(;n.length+a.length<Kp;)s(c[u%c.length]),u+=1;return{acceptance:[...n,...a],added:a}}const Li=["dashboard","admin-table","crm","kanban","chat","mail","wiki","files","calendar","settings","catalog","product-detail","checkout","feed","booking","landing","pricing","onboarding"],Hi=[{id:"business",labelZh:"商務軟體",labelEn:"Business software",ids:["dashboard","admin-table","crm","kanban","settings"]},{id:"productivity",labelZh:"協作與生產力",labelEn:"Collaboration & productivity",ids:["chat","mail","wiki","files","calendar"]},{id:"commerce",labelZh:"商務與服務",labelEn:"Commerce & services",ids:["catalog","product-detail","checkout","booking"]},{id:"consumer",labelZh:"內容與成長",labelEn:"Content & growth",ids:["feed","landing","pricing","onboarding"]}],Yp={dashboard:["分析儀表板","Analytics Dashboard"],"admin-table":["管理資料表","Admin Data Table"],crm:["CRM 列表詳情","CRM List Detail"],kanban:["專案看板","Project Kanban"],chat:["團隊聊天","Team Chat"],mail:["郵件收件匣","Mail Inbox"],wiki:["文件 Wiki","Docs Wiki"],files:["檔案管理","File Manager"],calendar:["行事曆規劃","Calendar Planner"],settings:["帳號設定","Account Settings"],catalog:["商品目錄","Product Catalog"],"product-detail":["商品詳情","Product Detail"],checkout:["結帳流程","Checkout"],feed:["內容動態","Content Feed"],booking:["預約搜尋","Booking Search"],landing:["SaaS Landing","SaaS Landing"],pricing:["價格方案","Pricing"],onboarding:["註冊與導覽","Signup & Onboarding"]},Zp={dashboard:["側邊導覽、KPI、趨勢圖與近期資料。","Sidebar, KPIs, trend chart, and recent data."],"admin-table":["篩選工具列、批次操作、資料表與分頁。","Filters, bulk actions, data table, and pagination."],crm:["客戶列表、聯絡人摘要、交易與活動紀錄。","Customer list, contact summary, deals, and activity."],kanban:["可橫向瀏覽的工作流程欄與任務卡。","Horizontal workflow columns with task cards."],chat:["頻道、對話訊息、成員資訊與輸入區。","Channels, messages, member details, and composer."],mail:["信箱分類、郵件列表與閱讀窗格。","Mailbox folders, message list, and reading pane."],wiki:["文件樹、編輯器、目錄與協作狀態。","Document tree, editor, outline, and collaboration status."],files:["資料夾樹、檔案格線、搜尋與詳細資料。","Folder tree, file grid, search, and details."],calendar:["迷你月曆、週行程與待辦議程。","Mini calendar, week schedule, and agenda."],settings:["設定分類、個人資料、安全與通知。","Settings navigation, profile, security, and notifications."],catalog:["商品篩選、排序、商品卡與分頁。","Product filters, sorting, cards, and pagination."],"product-detail":["商品圖片、資訊、選項、行動與說明分頁。","Gallery, product info, options, actions, and tabs."],checkout:["步驟、地址付款表單與訂單摘要。","Steps, address/payment forms, and order summary."],feed:["導覽、發文工具、動態串與熱門話題。","Navigation, composer, feed, and trending topics."],booking:["搜尋條件、結果列表、地圖與篩選。","Search criteria, results, map, and filters."],landing:["產品導覽、主視覺、功能、證明與 CTA。","Product navigation, hero, features, proof, and CTA."],pricing:["方案切換、價格卡、比較與常見問題。","Billing toggle, pricing cards, comparison, and FAQ."],onboarding:["註冊表單、步驟指示、說明與完成行動。","Signup form, progress, guidance, and completion action."]};function mt(t,e){return Yp[e][t==="zh-Hant"?0:1]}function Bi(t,e){return Zp[e][t==="zh-Hant"?0:1]}function Xp(t,e){switch(t){case"dashboard":return Qp(e);case"admin-table":return eh(e);case"crm":return th(e);case"kanban":return nh(e);case"chat":return rh(e);case"mail":return ah(e);case"wiki":return oh(e);case"files":return ih(e);case"calendar":return sh(e);case"settings":return ch(e);case"catalog":return lh(e);case"product-detail":return dh(e);case"checkout":return uh(e);case"feed":return ph(e);case"booking":return hh(e);case"landing":return mh(e);case"pricing":return fh(e);case"onboarding":return yh(e)}}function Qp(t){const e=t==="zh-Hant";return yt("dashboard","dashboard",t,[Ce("title","heading",e?"營運總覽":"Operations overview",re(280,92,520,46,244,88,460,44,16,76,358,44)),Ce("subtitle","text",e?"追蹤本月銷售與客戶成長。":"Track monthly sales and customer growth.",re(280,144,620,38,244,138,520,38,16,126,358,42)),..._h(t),Ce("revenue_chart","chart_placeholder",e?"營收趨勢":"Revenue trend",re(280,330,690,280,244,400,520,170,16,452,358,230),{label:e?"近 30 天營收":"Revenue, last 30 days"}),le("summary_card","card",e?"通路摘要":"Channel summary",["summary_metric","summary_text"],re(990,330,410,280,780,400,228,170,16,694,358,150)),I("summary_metric","metric_card","summary_card",e?"轉換率":"Conversion",{label:e?"轉換率":"Conversion",value:"4.8%"}),I("summary_text","text","summary_card",e?"自然搜尋仍是成長最快的通路。":"Organic search remains the fastest-growing channel.",{text:e?"自然搜尋仍是成長最快的通路。":"Organic search remains the fastest-growing channel."}),Ce("orders_table","data_table",e?"近期訂單":"Recent orders",re(280,630,1120,240,244,590,764,150,16,860,358,260),wh(t))])}function eh(t){const e=t==="zh-Hant";return yt("admin-table","admin_table",t,[Ce("title","heading",e?"使用者管理":"User management",re(280,92,460,46,244,88,420,44,16,76,358,44)),le("filters","toolbar",e?"篩選與批次操作":"Filters and bulk actions",["user_search","role_filter","status_filter","invite_button"],re(280,154,1120,68,244,146,764,68,16,130,358,180),void 0,dt()),I("user_search","search_input","filters",e?"搜尋使用者":"Search users",{label:e?"搜尋":"Search",placeholder:e?"姓名或電子郵件":"Name or email"}),I("role_filter","select","filters",e?"角色":"Role",{label:e?"角色":"Role",placeholder:e?"全部角色":"All roles"}),I("status_filter","select","filters",e?"狀態":"Status",{label:e?"狀態":"Status",placeholder:e?"全部狀態":"All statuses"}),I("invite_button","button","filters",e?"邀請使用者":"Invite user",{label:e?"邀請使用者":"Invite user",action:"open:invite_user"}),Ce("users_table","data_table",e?"使用者資料表":"Users table",re(280,242,1120,520,244,234,764,430,16,326,358,430),{label:e?"所有使用者":"All users",data_binding:"users.all",columns:[{id:"user",header:e?"使用者":"User",sortable:!0},{id:"role",header:e?"角色":"Role",filterable:!0},{id:"status",header:e?"狀態":"Status",filterable:!0},{id:"last_active",header:e?"最後活動":"Last active",sortable:!0}]}),Ce("pagination","pagination",e?"分頁":"Pagination",re(1040,782,360,52,648,682,360,52,16,776,358,52))])}function th(t){const e=t==="zh-Hant";return yt("crm","detail",t,[Ce("title","heading",e?"客戶關係管理":"Customer relationships",re(280,92,560,46,244,88,500,44,16,76,358,44)),le("customer_list","list",e?"客戶列表":"Customer list",["customer_a","customer_b","customer_c"],re(280,158,320,700,244,146,270,600,16,136,358,190)),I("customer_a","nav_item","customer_list",e?"陳怡君 · Arc Studio":"Avery Chen · Arc Studio",{label:e?"陳怡君 · Arc Studio":"Avery Chen · Arc Studio",action:"select:customer_a"}),I("customer_b","nav_item","customer_list",e?"王偉哲 · Northstar":"Noah Wang · Northstar",{label:e?"王偉哲 · Northstar":"Noah Wang · Northstar",action:"select:customer_b"}),I("customer_c","nav_item","customer_list",e?"林雅婷 · Bridge Co.":"Mia Lin · Bridge Co.",{label:e?"林雅婷 · Bridge Co.":"Mia Lin · Bridge Co.",action:"select:customer_c"}),le("contact_card","card",e?"客戶摘要":"Contact summary",["contact_avatar","contact_name","contact_meta","contact_actions"],re(620,158,780,220,530,146,478,210,16,344,358,240)),I("contact_avatar","avatar","contact_card",e?"陳怡君":"Avery Chen",{alt:e?"陳怡君":"Avery Chen"}),I("contact_name","heading","contact_card",e?"陳怡君":"Avery Chen",{text:e?"陳怡君":"Avery Chen"}),I("contact_meta","text","contact_card",e?"Arc Studio · 產品總監 · 台北":"Arc Studio · Product director · Taipei",{text:e?"Arc Studio · 產品總監 · 台北":"Arc Studio · Product director · Taipei"}),I("contact_actions","button_group","contact_card",e?"聯絡操作":"Contact actions",void 0,["email_action","call_action"]),I("email_action","button","contact_actions",e?"寄送郵件":"Email",{label:e?"寄送郵件":"Email",action:"compose:email"}),I("call_action","button","contact_actions",e?"安排通話":"Schedule call",{label:e?"安排通話":"Schedule call",action:"open:schedule"}),le("deal_panel","detail_panel",e?"交易與活動":"Deals and activity",["deal_metric","activity_feed"],re(620,398,780,460,530,374,478,372,16,604,358,420)),I("deal_metric","metric_card","deal_panel",e?"商機價值":"Pipeline value",{label:e?"商機價值":"Pipeline value",value:"$84,000"}),I("activity_feed","activity_feed","deal_panel",e?"近期活動":"Recent activity",void 0,["activity_1","activity_2"]),I("activity_1","text","activity_feed",e?"今天 10:40 更新採購時程。":"Updated purchase timeline today at 10:40.",{text:e?"今天 10:40 更新採購時程。":"Updated purchase timeline today at 10:40."}),I("activity_2","text","activity_feed",e?"昨天寄出產品方案。":"Sent product proposal yesterday.",{text:e?"昨天寄出產品方案。":"Sent product proposal yesterday."})])}function nh(t){const e=t==="zh-Hant",n=[["todo",e?"待處理":"To do"],["progress",e?"進行中":"In progress"],["review",e?"審查中":"Review"],["done",e?"已完成":"Done"]],r=n.map(([a])=>`column_${a}`),i=[];for(const[a,s]of n)i.push(I(`column_${a}`,"kanban_column","project_board",s,{label:s},[`task_${a}_1`,`task_${a}_2`])),i.push(I(`task_${a}_1`,"card",`column_${a}`,`${s} 1`,{label:e?"改善登入流程":"Improve sign-in flow"},[`task_${a}_1_title`,`task_${a}_1_tag`])),i.push(I(`task_${a}_1_title`,"text",`task_${a}_1`,e?"改善登入流程":"Improve sign-in flow",{text:e?"改善登入流程":"Improve sign-in flow"})),i.push(I(`task_${a}_1_tag`,"tag",`task_${a}_1`,"Design",{text:"Design"})),i.push(I(`task_${a}_2`,"card",`column_${a}`,`${s} 2`,{label:e?"更新分析事件":"Update analytics events"},[`task_${a}_2_title`])),i.push(I(`task_${a}_2_title`,"text",`task_${a}_2`,e?"更新分析事件":"Update analytics events",{text:e?"更新分析事件":"Update analytics events"}));return yt("kanban","workspace",t,[Ce("title","heading",e?"產品開發看板":"Product development",re(280,92,520,46,244,88,270,44,16,76,358,44)),le("board_toolbar","toolbar",e?"看板工具":"Board tools",["board_search","filter_button","add_task"],re(820,84,580,60,530,80,478,60,16,126,358,128),void 0,dt()),I("board_search","search_input","board_toolbar",e?"搜尋任務":"Search tasks",{placeholder:e?"搜尋任務":"Search tasks"}),I("filter_button","button","board_toolbar",e?"篩選":"Filter",{label:e?"篩選":"Filter",action:"open:filters"}),I("add_task","button","board_toolbar",e?"新增任務":"Add task",{label:e?"新增任務":"Add task",action:"open:new_task"}),le("project_board","kanban_board",e?"工作流程":"Workflow",r,re(280,166,1120,690,244,160,764,586,16,276,358,540),void 0,{mode:"auto",display:"flex",direction:"row",gap:{x:14,y:14}}),...i])}function rh(t){const e=t==="zh-Hant";return yt("chat","communication",t,[le("channels","list",e?"頻道與私訊":"Channels and messages",["channel_general","channel_product","dm_alex"],re(280,82,260,776,244,76,230,670,16,76,358,180)),I("channel_general","nav_item","channels","# general",{label:"# general",action:"select:general"}),I("channel_product","nav_item","channels","# product",{label:"# product",action:"select:product"}),I("dm_alex","nav_item","channels",e?"● 子晴":"● Alex",{label:e?"● 子晴":"● Alex",action:"select:alex"}),le("conversation","card","# product",["conversation_title","messages","composer"],re(560,82,610,776,490,76,518,670,16,276,358,520)),I("conversation_title","heading","conversation","# product",{text:"# product"}),I("messages","activity_feed","conversation",e?"對話訊息":"Messages",void 0,["message_1","message_2","message_3"]),I("message_1","text","messages",e?"子晴:新版畫布今天可以測試。":"Alex: The new canvas is ready to test today.",{text:e?"子晴:新版畫布今天可以測試。":"Alex: The new canvas is ready to test today."}),I("message_2","text","messages",e?"承恩:我會先檢查行動版。":"Jordan: I will check mobile first.",{text:e?"承恩:我會先檢查行動版。":"Jordan: I will check mobile first."}),I("message_3","text","messages",e?"你:收到,截圖放在線程。":"You: Got it, post screenshots in the thread.",{text:e?"你:收到,截圖放在線程。":"You: Got it, post screenshots in the thread."}),I("composer","textarea","conversation",e?"訊息輸入":"Message composer",{placeholder:e?"傳送訊息到 #product":"Message #product",action:"submit:message"}),le("members","detail_panel",e?"頻道資訊":"Channel details",["member_count","member_list"],re(1190,82,210,776,16,766,992,260,16,816,358,260)),I("member_count","badge","members",e?"12 位成員":"12 members",{text:e?"12 位成員":"12 members"}),I("member_list","list","members",e?"成員":"Members",{label:e?"成員":"Members"})])}function ah(t){const e=t==="zh-Hant";return yt("mail","communication",t,[le("mail_folders","list",e?"信箱分類":"Mailbox folders",["inbox","starred","sent","drafts"],re(280,82,210,776,244,76,190,670,16,76,358,160)),...[["inbox",e?"收件匣 24":"Inbox 24"],["starred",e?"已加星號":"Starred"],["sent",e?"寄件備份":"Sent"],["drafts",e?"草稿 3":"Drafts 3"]].map(([n,r])=>I(n,"nav_item","mail_folders",r,{label:r,action:`select:${n}`})),le("message_list","list",e?"郵件列表":"Message list",["mail_1","mail_2","mail_3","mail_4"],re(510,82,380,776,450,76,330,670,16,256,358,260)),...["產品更新與下週排程","六月帳單已開立","設計審查摘要","歡迎加入工作區"].map((n,r)=>{const i=["Product update and next week","June invoice available","Design review summary","Welcome to the workspace"][r]??n;return I(`mail_${r+1}`,"card","message_list",e?n:i,{label:e?n:i})}),le("message_reader","detail_panel",e?"郵件內容":"Message reader",["mail_subject","mail_sender","mail_body","reply_button"],re(910,82,490,776,800,76,208,670,16,536,358,420)),I("mail_subject","heading","message_reader",e?"產品更新與下週排程":"Product update and next week",{text:e?"產品更新與下週排程":"Product update and next week"}),I("mail_sender","text","message_reader",e?"來自:產品團隊 · 今天 09:14":"From: Product team · Today 09:14",{text:e?"來自:產品團隊 · 今天 09:14":"From: Product team · Today 09:14"}),I("mail_body","text","message_reader",e?"新版編輯器已進入測試階段,請依清單確認自由拖曳、範本和匯出結果。":"The new editor is ready for testing. Please verify freeform layout, templates, and exports.",{text:e?"新版編輯器已進入測試階段,請依清單確認自由拖曳、範本和匯出結果。":"The new editor is ready for testing. Please verify freeform layout, templates, and exports."}),I("reply_button","button","message_reader",e?"回覆":"Reply",{label:e?"回覆":"Reply",action:"open:reply"})])}function oh(t){const e=t==="zh-Hant";return yt("wiki","content",t,[le("doc_tree","list",e?"文件樹":"Document tree",["doc_home","doc_product","doc_api","doc_release"],re(280,82,250,776,244,76,220,670,16,76,358,170)),...[["doc_home",e?"首頁":"Home"],["doc_product",e?"產品規格":"Product specs"],["doc_api","API"],["doc_release",e?"版本紀錄":"Release notes"]].map(([n,r])=>I(n,"nav_item","doc_tree",r,{label:r,action:`open:${n}`})),le("editor","rich_text_editor",e?"文件編輯器":"Document editor",["editor_toolbar","doc_title","doc_intro","doc_section","doc_body"],re(550,82,650,776,480,76,528,670,16,266,358,540)),I("editor_toolbar","toolbar","editor",e?"文字工具列":"Formatting toolbar",void 0,["bold","italic","link"]),I("bold","icon_button","editor_toolbar",e?"粗體":"Bold",{label:e?"粗體":"Bold",icon:"bold",action:"format:bold"}),I("italic","icon_button","editor_toolbar",e?"斜體":"Italic",{label:e?"斜體":"Italic",icon:"italic",action:"format:italic"}),I("link","icon_button","editor_toolbar",e?"連結":"Link",{label:e?"連結":"Link",icon:"link",action:"format:link"}),I("doc_title","heading","editor","UI Blueprint 0.2",{text:"UI Blueprint 0.2"}),I("doc_intro","text","editor",e?"這份文件說明自由畫布與精確幾何資料的使用方式。":"This document explains the freeform canvas and exact geometry data.",{text:e?"這份文件說明自由畫布與精確幾何資料的使用方式。":"This document explains the freeform canvas and exact geometry data."}),I("doc_section","heading","editor",e?"自由與自動佈局":"Freeform and auto layout",{text:e?"自由與自動佈局":"Freeform and auto layout"}),I("doc_body","text","editor",e?"容器可自由切換模式,且每個 viewport 都能保存獨立位置。":"Containers can switch modes and preserve geometry per viewport.",{text:e?"容器可自由切換模式,且每個 viewport 都能保存獨立位置。":"Containers can switch modes and preserve geometry per viewport."}),le("outline","detail_panel",e?"頁面目錄":"Page outline",["outline_1","outline_2"],re(1220,82,180,776,16,766,992,180,16,826,358,170)),I("outline_1","link","outline",e?"概觀":"Overview",{text:e?"概觀":"Overview",action:"navigate:#overview"}),I("outline_2","link","outline",e?"自由與自動佈局":"Freeform and auto layout",{text:e?"自由與自動佈局":"Freeform and auto layout",action:"navigate:#layout"})])}function ih(t){const e=t==="zh-Hant",n=["design","research","roadmap","assets"].map((r,i)=>{const a=e?["設計稿","研究資料","產品路線圖","品牌素材"][i]??r:["Design","Research","Roadmap","Brand assets"][i]??r;return I(`file_${r}`,"card","file_grid",a,{label:a})});return yt("files","files",t,[le("folder_tree","list",e?"資料夾":"Folders",["folder_home","folder_shared","folder_recent"],re(280,82,230,776,244,76,210,670,16,76,358,150)),I("folder_home","nav_item","folder_tree",e?"我的檔案":"My files",{label:e?"我的檔案":"My files",action:"open:my_files"}),I("folder_shared","nav_item","folder_tree",e?"共用項目":"Shared",{label:e?"共用項目":"Shared",action:"open:shared"}),I("folder_recent","nav_item","folder_tree",e?"最近使用":"Recent",{label:e?"最近使用":"Recent",action:"open:recent"}),le("file_toolbar","toolbar",e?"檔案工具":"File tools",["file_search","upload_file","new_folder"],re(530,82,870,66,470,76,538,66,16,246,358,150),void 0,dt()),I("file_search","search_input","file_toolbar",e?"搜尋檔案":"Search files",{placeholder:e?"搜尋檔案":"Search files"}),I("upload_file","button","file_toolbar",e?"上傳":"Upload",{label:e?"上傳":"Upload",action:"open:file_upload"}),I("new_folder","button","file_toolbar",e?"新增資料夾":"New folder",{label:e?"新增資料夾":"New folder",action:"create:folder"}),le("file_grid","grid",e?"檔案格線":"File grid",n.map(r=>r.id),re(530,168,640,690,470,158,538,588,16,416,358,420),void 0,{mode:"auto",display:"grid",grid:{columns:2},gap:{x:14,y:14}}),...n,le("file_details","detail_panel",e?"檔案詳細資料":"File details",["file_preview","file_name","file_meta"],re(1190,168,210,690,16,766,992,180,16,856,358,180)),I("file_preview","image","file_details",e?"預覽":"Preview",{alt:e?"檔案預覽":"File preview"}),I("file_name","heading","file_details",e?"產品路線圖":"Product roadmap",{text:e?"產品路線圖":"Product roadmap"}),I("file_meta","text","file_details",e?"PDF · 4.2 MB · 2 小時前更新":"PDF · 4.2 MB · Updated 2h ago",{text:e?"PDF · 4.2 MB · 2 小時前更新":"PDF · 4.2 MB · Updated 2h ago"})])}function sh(t){const e=t==="zh-Hant";return yt("calendar","calendar",t,[le("calendar_sidebar","card",e?"日期與行事曆":"Date and calendars",["mini_calendar","calendar_list"],re(280,82,260,776,244,76,230,670,16,76,358,260)),I("mini_calendar","calendar","calendar_sidebar",e?"迷你月曆":"Mini calendar"),I("calendar_list","list","calendar_sidebar",e?"我的行事曆":"My calendars",{label:e?"工作、個人、提醒":"Work, personal, reminders"}),Ce("week_calendar","calendar",e?"週行程":"Week schedule",re(560,82,600,776,490,76,518,670,16,356,358,460)),le("agenda","detail_panel",e?"今天議程":"Today agenda",["agenda_1","agenda_2","agenda_3"],re(1180,82,220,776,16,766,992,380,16,836,358,340)),I("agenda_1","card","agenda",e?"09:30 產品同步":"09:30 Product sync",{label:e?"09:30 產品同步":"09:30 Product sync"}),I("agenda_2","card","agenda",e?"13:00 設計審查":"13:00 Design review",{label:e?"13:00 設計審查":"13:00 Design review"}),I("agenda_3","card","agenda",e?"16:30 客戶訪談":"16:30 Customer interview",{label:e?"16:30 客戶訪談":"16:30 Customer interview"})])}function ch(t){const e=t==="zh-Hant";return yt("settings","settings",t,[le("settings_nav","list",e?"設定分類":"Settings navigation",["profile_link","security_link","notifications_link","billing_link"],re(280,82,250,776,244,76,220,670,16,76,358,180)),...[["profile_link",e?"個人資料":"Profile"],["security_link",e?"安全性":"Security"],["notifications_link",e?"通知":"Notifications"],["billing_link",e?"帳務":"Billing"]].map(([n,r])=>I(n,"nav_item","settings_nav",r,{label:r,action:`navigate:/settings/${n.replace("_link","")}`})),le("profile_form","form",e?"個人資料":"Profile",["form_title","name_input","email_input","timezone_select","bio_input","notification_toggle","form_actions"],re(560,82,620,776,490,76,518,670,16,276,358,620)),I("form_title","heading","profile_form",e?"個人資料":"Profile",{text:e?"個人資料":"Profile"}),I("name_input","text_input","profile_form",e?"姓名":"Name",{label:e?"姓名":"Name",placeholder:e?"輸入姓名":"Enter name"}),I("email_input","text_input","profile_form",e?"電子郵件":"Email",{label:e?"電子郵件":"Email",placeholder:"name@example.com"}),I("timezone_select","select","profile_form",e?"時區":"Timezone",{label:e?"時區":"Timezone",placeholder:"Asia/Taipei"}),I("bio_input","textarea","profile_form",e?"個人簡介":"Bio",{label:e?"個人簡介":"Bio",placeholder:e?"介紹你的工作內容":"Tell people what you work on"}),I("notification_toggle","toggle","profile_form",e?"產品更新通知":"Product updates",{label:e?"產品更新通知":"Product updates"}),I("form_actions","button_group","profile_form",e?"表單操作":"Form actions",void 0,["cancel_button","save_button"]),I("cancel_button","button","form_actions",e?"取消":"Cancel",{label:e?"取消":"Cancel",action:"reset:profile"}),I("save_button","button","form_actions",e?"儲存變更":"Save changes",{label:e?"儲存變更":"Save changes",action:"submit:profile"}),le("security_summary","card",e?"安全摘要":"Security summary",["security_badge","security_text"],re(1200,82,200,300,16,766,992,180,16,916,358,160)),I("security_badge","badge","security_summary",e?"已啟用 2FA":"2FA enabled",{text:e?"已啟用 2FA":"2FA enabled",variant:"success"}),I("security_text","text","security_summary",e?"上次登入:今天 08:42":"Last sign-in: Today 08:42",{text:e?"上次登入:今天 08:42":"Last sign-in: Today 08:42"})])}function lh(t){const e=t==="zh-Hant",n=[];return["chair","lamp","desk","shelf","sofa","table"].forEach((r,i)=>{const a=e?["扶手椅","桌燈","工作桌","層架","雙人沙發","餐桌"][i]??r:["Lounge chair","Desk lamp","Work desk","Shelf","Two-seat sofa","Dining table"][i]??r;n.push(I(`product_${r}`,"card","product_grid",a,{label:a},[`product_${r}_image`,`product_${r}_name`,`product_${r}_price`])),n.push(I(`product_${r}_image`,"image",`product_${r}`,`${a} image`,{alt:a})),n.push(I(`product_${r}_name`,"heading",`product_${r}`,a,{text:a})),n.push(I(`product_${r}_price`,"text",`product_${r}`,`$${[129,89,499,219,749,599][i]}`,{text:`$${[129,89,499,219,749,599][i]}`}))}),Nt("catalog","commerce",t,[Ce("catalog_title","heading",e?"為日常打造的家具":"Furniture for everyday living",re(48,96,760,60,36,88,700,56,16,86,358,84)),le("catalog_filters","sidebar",e?"商品篩選":"Product filters",["category_filter","price_filter","availability_filter"],re(48,188,250,650,36,172,220,560,16,190,358,190)),I("category_filter","select","catalog_filters",e?"分類":"Category",{label:e?"分類":"Category",placeholder:e?"全部分類":"All categories"}),I("price_filter","slider","catalog_filters",e?"價格":"Price",{label:e?"價格範圍":"Price range"}),I("availability_filter","checkbox","catalog_filters",e?"僅顯示有庫存":"In stock only",{label:e?"僅顯示有庫存":"In stock only"}),le("catalog_toolbar","toolbar",e?"目錄工具":"Catalog tools",["catalog_search","sort_select"],re(320,188,1072,64,276,172,732,64,16,396,358,120),void 0,dt()),I("catalog_search","search_input","catalog_toolbar",e?"搜尋商品":"Search products",{placeholder:e?"搜尋商品":"Search products"}),I("sort_select","select","catalog_toolbar",e?"排序":"Sort",{label:e?"排序":"Sort",placeholder:e?"熱門商品":"Popular"}),le("product_grid","grid",e?"商品格線":"Product grid",n.filter(r=>r.parent_id==="product_grid").map(r=>r.id),re(320,270,1072,568,276,252,732,480,16,536,358,620),void 0,{mode:"auto",display:"grid",grid:{columns:3},gap:{x:18,y:18}}),...n])}function dh(t){const e=t==="zh-Hant";return Nt("product-detail","commerce",t,[le("gallery","grid",e?"商品圖片":"Product gallery",["main_image","thumb_1","thumb_2"],re(48,100,720,620,36,94,480,520,16,86,358,360),void 0,{mode:"auto",display:"grid",grid:{columns:2},gap:{x:12,y:12}}),I("main_image","image","gallery",e?"主商品圖片":"Main product image",{alt:e?"胡桃木工作桌":"Walnut work desk"}),I("thumb_1","image","gallery",e?"側面圖片":"Side view",{alt:e?"工作桌側面":"Desk side view"}),I("thumb_2","image","gallery",e?"情境圖片":"Room view",{alt:e?"工作空間情境":"Workspace scene"}),le("product_info","detail_panel",e?"商品資訊":"Product information",["product_name","product_rating","product_price","product_description","finish_select","quantity","buy_actions"],re(800,100,592,620,536,94,472,520,16,466,358,520)),I("product_name","heading","product_info",e?"胡桃木工作桌":"Walnut work desk",{text:e?"胡桃木工作桌":"Walnut work desk"}),I("product_rating","badge","product_info","4.8 · 126 reviews",{text:e?"4.8 · 126 則評價":"4.8 · 126 reviews",variant:"success"}),I("product_price","heading","product_info","$499",{text:"$499"}),I("product_description","text","product_info",e?"實木桌面搭配可調整桌腳,適合居家與工作室。":"Solid wood surface with adjustable legs for home offices and studios.",{text:e?"實木桌面搭配可調整桌腳,適合居家與工作室。":"Solid wood surface with adjustable legs for home offices and studios."}),I("finish_select","select","product_info",e?"表面處理":"Finish",{label:e?"表面處理":"Finish",placeholder:e?"自然胡桃木":"Natural walnut"}),I("quantity","slider","product_info",e?"數量":"Quantity",{label:e?"數量":"Quantity",value:"1"}),I("buy_actions","button_group","product_info",e?"購買操作":"Purchase actions",void 0,["cart_button","buy_button"]),I("cart_button","button","buy_actions",e?"加入購物車":"Add to cart",{label:e?"加入購物車":"Add to cart",action:"add:cart",variant:"secondary"}),I("buy_button","button","buy_actions",e?"立即購買":"Buy now",{label:e?"立即購買":"Buy now",action:"navigate:/checkout",variant:"primary"}),le("product_tabs","tabs",e?"商品說明":"Product details",["details_tab","shipping_tab","reviews_tab"],re(48,744,1344,110,36,634,972,110,16,1006,358,140)),I("details_tab","nav_item","product_tabs",e?"詳細規格":"Details",{label:e?"詳細規格":"Details",action:"select:details"}),I("shipping_tab","nav_item","product_tabs",e?"配送":"Shipping",{label:e?"配送":"Shipping",action:"select:shipping"}),I("reviews_tab","nav_item","product_tabs",e?"評價":"Reviews",{label:e?"評價":"Reviews",action:"select:reviews"})])}function uh(t){const e=t==="zh-Hant";return Nt("checkout","form",t,[le("checkout_steps","stepper",e?"結帳步驟":"Checkout steps",["step_cart","step_delivery","step_payment"],re(160,84,1120,72,80,80,864,72,16,76,358,120),void 0,dt()),I("step_cart","nav_item","checkout_steps",e?"1 購物車":"1 Cart",{label:e?"1 購物車":"1 Cart"}),I("step_delivery","nav_item","checkout_steps",e?"2 配送":"2 Delivery",{label:e?"2 配送":"2 Delivery"}),I("step_payment","nav_item","checkout_steps",e?"3 付款":"3 Payment",{label:e?"3 付款":"3 Payment"}),le("checkout_form","form",e?"配送與付款":"Delivery and payment",["checkout_title","email","address","city","country","card_number","expiry","save_payment"],re(160,180,720,650,80,170,560,570,16,216,358,600)),I("checkout_title","heading","checkout_form",e?"配送與付款":"Delivery and payment",{text:e?"配送與付款":"Delivery and payment"}),I("email","text_input","checkout_form",e?"電子郵件":"Email",{label:e?"電子郵件":"Email",placeholder:"name@example.com"}),I("address","text_input","checkout_form",e?"地址":"Address",{label:e?"地址":"Address",placeholder:e?"街道與門牌":"Street address"}),I("city","text_input","checkout_form",e?"城市":"City",{label:e?"城市":"City"}),I("country","select","checkout_form",e?"國家/地區":"Country or region",{label:e?"國家/地區":"Country or region",placeholder:e?"台灣":"Taiwan"}),I("card_number","text_input","checkout_form",e?"卡號":"Card number",{label:e?"卡號":"Card number",placeholder:"4242 4242 4242 4242"}),I("expiry","text_input","checkout_form",e?"到期日與安全碼":"Expiry and CVC",{label:e?"到期日與安全碼":"Expiry and CVC",placeholder:"MM/YY · CVC"}),I("save_payment","checkbox","checkout_form",e?"儲存付款方式":"Save payment method",{label:e?"儲存付款方式":"Save payment method"}),le("order_summary","card",e?"訂單摘要":"Order summary",["summary_title","summary_item","summary_total","place_order"],re(920,180,360,500,670,170,274,430,16,836,358,300)),I("summary_title","heading","order_summary",e?"訂單摘要":"Order summary",{text:e?"訂單摘要":"Order summary"}),I("summary_item","text","order_summary",e?"胡桃木工作桌 × 1":"Walnut work desk × 1",{text:e?"胡桃木工作桌 × 1":"Walnut work desk × 1"}),I("summary_total","heading","order_summary",e?"總計 $548":"Total $548",{text:e?"總計 $548":"Total $548"}),I("place_order","button","order_summary",e?"確認下單":"Place order",{label:e?"確認下單":"Place order",action:"submit:checkout"})])}function ph(t){const e=t==="zh-Hant";return Nt("feed","content",t,[le("feed_nav","sidebar",e?"主要導覽":"Primary navigation",["feed_home","feed_explore","feed_saved"],re(48,92,220,760,36,86,190,650,16,76,358,150)),I("feed_home","nav_item","feed_nav",e?"首頁":"Home",{label:e?"首頁":"Home",action:"navigate:/home"}),I("feed_explore","nav_item","feed_nav",e?"探索":"Explore",{label:e?"探索":"Explore",action:"navigate:/explore"}),I("feed_saved","nav_item","feed_nav",e?"已儲存":"Saved",{label:e?"已儲存":"Saved",action:"navigate:/saved"}),le("composer","card",e?"建立貼文":"Create post",["composer_avatar","composer_input","publish_button"],re(300,92,720,160,246,86,540,160,16,246,358,180)),I("composer_avatar","avatar","composer",e?"你的頭像":"Your avatar",{alt:e?"你的頭像":"Your avatar"}),I("composer_input","textarea","composer",e?"分享近況":"Share an update",{placeholder:e?"分享你的近況...":"Share an update..."}),I("publish_button","button","composer",e?"發布":"Publish",{label:e?"發布":"Publish",action:"submit:post"}),le("feed_list","activity_feed",e?"動態串":"Feed",["post_1","post_2"],re(300,272,720,580,246,266,540,470,16,446,358,520)),I("post_1","card","feed_list",e?"設計團隊更新":"Design team update",{label:e?"設計團隊更新":"Design team update"},["post_1_author","post_1_text","post_1_image"]),I("post_1_author","heading","post_1",e?"林子晴":"Alex Lin",{text:e?"林子晴":"Alex Lin"}),I("post_1_text","text","post_1",e?"新的元件庫已經完成,歡迎留言回饋。":"The new component library is ready. Feedback is welcome.",{text:e?"新的元件庫已經完成,歡迎留言回饋。":"The new component library is ready. Feedback is welcome."}),I("post_1_image","image","post_1",e?"元件庫預覽":"Component library preview",{alt:e?"元件庫預覽":"Component library preview"}),I("post_2","card","feed_list",e?"產品里程碑":"Product milestone",{label:e?"產品里程碑":"Product milestone"},["post_2_text"]),I("post_2_text","text","post_2",e?"本週完成自由畫布第一輪測試。":"Completed the first freeform canvas test this week.",{text:e?"本週完成自由畫布第一輪測試。":"Completed the first freeform canvas test this week."}),le("trending","detail_panel",e?"熱門話題":"Trending",["trend_1","trend_2","trend_3"],re(1050,92,342,420,806,86,202,420,16,986,358,180)),...["#ui-design","#product","#build-in-public"].map((n,r)=>I(`trend_${r+1}`,"tag","trending",n,{text:n}))])}function hh(t){const e=t==="zh-Hant";return Nt("booking","commerce",t,[Ce("booking_title","heading",e?"尋找下一段旅程":"Find your next stay",re(48,90,720,60,36,84,660,56,16,82,358,70)),le("search_form","form",e?"搜尋住宿":"Search stays",["destination","dates","guests","search_button"],re(48,170,1344,118,36,160,972,118,16,168,358,280),void 0,dt()),I("destination","search_input","search_form",e?"目的地":"Destination",{label:e?"目的地":"Destination",placeholder:e?"城市或景點":"City or landmark"}),I("dates","date_picker","search_form",e?"日期":"Dates",{label:e?"日期":"Dates",placeholder:e?"選擇日期":"Choose dates"}),I("guests","select","search_form",e?"旅客":"Guests",{label:e?"旅客":"Guests",placeholder:e?"2 位旅客":"2 guests"}),I("search_button","button","search_form",e?"搜尋":"Search",{label:e?"搜尋":"Search",action:"submit:booking_search"}),le("booking_filters","sidebar",e?"篩選條件":"Filters",["price_slider","type_select","rating_filter"],re(48,316,250,530,36,296,220,440,16,468,358,180)),I("price_slider","slider","booking_filters",e?"每晚價格":"Price per night",{label:e?"每晚價格":"Price per night"}),I("type_select","select","booking_filters",e?"住宿類型":"Property type",{label:e?"住宿類型":"Property type",placeholder:e?"全部類型":"All types"}),I("rating_filter","checkbox","booking_filters",e?"評分 4.5 以上":"Rating 4.5+",{label:e?"評分 4.5 以上":"Rating 4.5+"}),le("booking_results","list",e?"搜尋結果":"Search results",["stay_1","stay_2","stay_3"],re(320,316,560,530,276,296,450,440,16,668,358,480)),...["河畔設計旅店","山景木屋","市中心公寓"].map((n,r)=>{const i=e?n:["Riverside design hotel","Mountain cabin","City center apartment"][r]??n;return I(`stay_${r+1}`,"card","booking_results",i,{label:i})}),Ce("booking_map","image",e?"地圖":"Map",re(900,316,492,530,746,296,262,440,16,1168,358,260),{alt:e?"住宿位置地圖":"Map of available stays"})])}function mh(t){const e=t==="zh-Hant";return Nt("landing","landing",t,[Ce("hero_eyebrow","badge",e?"為產品團隊打造":"Built for product teams",re(88,128,190,30,56,116,190,30,16,96,190,30),{text:e?"為產品團隊打造":"Built for product teams",variant:"success"}),Ce("hero_title","heading",e?"把 UI 想法變成可交付的藍圖":"Turn UI ideas into implementation-ready blueprints",re(88,180,660,150,56,166,580,140,16,146,358,170)),Ce("hero_copy","text",e?"自由拖曳、精確佈局,並輸出 coding agent 能理解與驗證的 JSON。":"Compose freely, preserve exact layout, and export JSON coding agents can understand and verify.",re(88,346,600,86,56,318,540,86,16,330,358,110)),le("hero_actions","button_group",e?"主行動":"Hero actions",["start_button","demo_button"],re(88,452,390,56,56,420,390,56,16,458,358,56),void 0,dt()),I("start_button","button","hero_actions",e?"開始建立":"Start building",{label:e?"開始建立":"Start building",action:"navigate:/new"}),I("demo_button","button","hero_actions",e?"查看範例":"View examples",{label:e?"查看範例":"View examples",action:"navigate:#examples",variant:"secondary"}),Ce("hero_image","image",e?"編輯器預覽":"Editor preview",re(790,112,560,430,650,106,358,390,16,540,358,250),{alt:e?"自由畫布編輯器預覽":"Freeform editor preview"}),...vh(t),Ce("proof_text","text",e?"讓設計意圖、響應式規則與驗收條件一起交付。":"Ship design intent, responsive rules, and acceptance criteria together.",re(320,792,800,54,160,706,704,54,16,1340,358,80))])}function fh(t){const e=t==="zh-Hant";return Nt("pricing","landing",t,[Ce("pricing_title","heading",e?"選擇適合團隊的方案":"Choose the right plan for your team",re(320,92,800,70,160,88,704,68,16,82,358,90)),Ce("pricing_copy","text",e?"所有方案都包含自由畫布、JSON 匯出和版本紀錄。":"Every plan includes freeform canvas, JSON export, and version history.",re(380,170,680,48,190,166,644,48,16,182,358,70)),le("billing_toggle","button_group",e?"計費週期":"Billing cycle",["monthly","yearly"],re(560,234,320,48,352,228,320,48,54,270,282,48),void 0,dt()),I("monthly","button","billing_toggle",e?"月繳":"Monthly",{label:e?"月繳":"Monthly",action:"select:monthly"}),I("yearly","button","billing_toggle",e?"年繳省 20%":"Yearly · Save 20%",{label:e?"年繳省 20%":"Yearly · Save 20%",action:"select:yearly"}),...bh(t),le("pricing_faq","list",e?"常見問題":"Frequently asked questions",["faq_1","faq_2","faq_3"],re(220,720,1e3,160,110,670,804,160,16,1120,358,260)),I("faq_1","text","pricing_faq",e?"可以隨時更換方案嗎?可以,變更會在下個週期生效。":"Can I change plans? Yes, changes apply next cycle.",{text:e?"可以隨時更換方案嗎?可以,變更會在下個週期生效。":"Can I change plans? Yes, changes apply next cycle."}),I("faq_2","text","pricing_faq",e?"是否支援私有部署?企業方案提供。":"Is private deployment available? It is included with Enterprise.",{text:e?"是否支援私有部署?企業方案提供。":"Is private deployment available? It is included with Enterprise."}),I("faq_3","text","pricing_faq",e?"匯出的 JSON 有限制嗎?沒有。":"Are JSON exports limited? No.",{text:e?"匯出的 JSON 有限制嗎?沒有。":"Are JSON exports limited? No."})])}function yh(t){const e=t==="zh-Hant";return Nt("onboarding","onboarding",t,[le("onboarding_steps","stepper",e?"設定進度":"Setup progress",["account_step","workspace_step","invite_step"],re(280,70,880,64,120,66,784,64,16,60,358,110),void 0,dt()),I("account_step","nav_item","onboarding_steps",e?"1 帳號":"1 Account",{label:e?"1 帳號":"1 Account"}),I("workspace_step","nav_item","onboarding_steps",e?"2 工作區":"2 Workspace",{label:e?"2 工作區":"2 Workspace"}),I("invite_step","nav_item","onboarding_steps",e?"3 邀請成員":"3 Invite team",{label:e?"3 邀請成員":"3 Invite team"}),le("signup_form","form",e?"建立工作區":"Create your workspace",["signup_title","workspace_name","workspace_type","team_size","invite_emails","finish_button"],re(220,170,560,620,90,160,500,560,16,190,358,580)),I("signup_title","heading","signup_form",e?"建立你的工作區":"Create your workspace",{text:e?"建立你的工作區":"Create your workspace"}),I("workspace_name","text_input","signup_form",e?"工作區名稱":"Workspace name",{label:e?"工作區名稱":"Workspace name",placeholder:e?"例如:產品團隊":"Example: Product team"}),I("workspace_type","select","signup_form",e?"使用情境":"Primary use",{label:e?"使用情境":"Primary use",placeholder:e?"產品設計與開發":"Product design and development"}),I("team_size","radio_group","signup_form",e?"團隊人數":"Team size",{label:e?"團隊人數":"Team size",items:[{id:"small",label:"1–10"},{id:"medium",label:"11–50"},{id:"large",label:"51+"}]}),I("invite_emails","textarea","signup_form",e?"邀請成員":"Invite teammates",{label:e?"邀請成員":"Invite teammates",placeholder:e?"每行輸入一個電子郵件":"One email per line"}),I("finish_button","button","signup_form",e?"完成設定":"Finish setup",{label:e?"完成設定":"Finish setup",action:"submit:onboarding"}),le("onboarding_help","card",e?"設定說明":"Setup guidance",["help_image","help_title","help_text","help_checklist"],re(820,170,400,500,620,160,284,500,16,790,358,300)),I("help_image","image","onboarding_help",e?"工作區預覽":"Workspace preview",{alt:e?"工作區預覽":"Workspace preview"}),I("help_title","heading","onboarding_help",e?"三分鐘完成設定":"Set up in three minutes",{text:e?"三分鐘完成設定":"Set up in three minutes"}),I("help_text","text","onboarding_help",e?"你之後仍可在設定頁調整名稱、成員和權限。":"You can change the name, members, and permissions later.",{text:e?"你之後仍可在設定頁調整名稱、成員和權限。":"You can change the name, members, and permissions later."}),I("help_checklist","list","onboarding_help",e?"設定清單":"Setup checklist",{items:[{id:"profile",label:e?"完成個人資料":"Complete profile"},{id:"workspace",label:e?"建立工作區":"Create workspace"},{id:"invite",label:e?"邀請成員":"Invite team"}]})])}function yt(t,e,n,r){const i=n==="zh-Hant",a=[I("nav_home","nav_item","sidebar",i?"首頁":"Home",{label:i?"首頁":"Home",action:"navigate:/home"}),I("nav_workspace","nav_item","sidebar",i?"工作區":"Workspace",{label:i?"工作區":"Workspace",action:"navigate:/workspace"}),I("nav_reports","nav_item","sidebar",i?"報表":"Reports",{label:i?"報表":"Reports",action:"navigate:/reports"}),I("nav_settings","nav_item","sidebar",i?"設定":"Settings",{label:i?"設定":"Settings",action:"navigate:/settings"})],s=[le("sidebar","sidebar",i?"應用主導覽":"App navigation",a.map(c=>c.id),gh(re(0,0,240,900,0,0,220,768,0,780,390,64),10),{label:mt(n,t)}),...a,le("top_bar","top_bar",i?"頂部工具列":"Top toolbar",["global_search","account_avatar"],re(240,0,1200,64,220,0,804,64,0,0,390,60),void 0,dt()),I("global_search","search_input","top_bar",i?"全域搜尋":"Global search",{label:i?"搜尋":"Search",placeholder:i?"搜尋...":"Search...",action:"search:global"}),I("account_avatar","avatar","top_bar",i?"目前使用者":"Current user",{alt:i?"目前使用者":"Current user"})];return Vi(t,e,n,"app_shell",[...s,...r])}function Nt(t,e,n,r){const i=n==="zh-Hant",s=[le("site_header","top_bar",i?"網站導覽":"Site navigation",["brand","nav_product","nav_resources","nav_login"],re(0,0,1440,64,0,0,1024,64,0,0,390,60),void 0,dt()),I("brand","heading","site_header",mt(n,t),{text:"AUB"}),I("nav_product","link","site_header",i?"產品":"Product",{text:i?"產品":"Product",action:"navigate:#product"}),I("nav_resources","link","site_header",i?"資源":"Resources",{text:i?"資源":"Resources",action:"navigate:#resources"}),I("nav_login","button","site_header",i?"登入":"Log in",{label:i?"登入":"Log in",action:"navigate:/login",variant:"secondary"})];return Vi(t,e,n,"page",[...s,...r])}function Vi(t,e,n,r,i){const a=i.filter(c=>c.parent_id==="root").map(c=>c.id),s=Ur();return s.name="AUB Product Neutral",s.colors={...s.colors,"surface.canvas":"#f8fafc","surface.panel":"#ffffff","action.primary":["#2563eb","#0f766e","#7c3aed"][Li.indexOf(t)%3]??"#2563eb"},{version:"0.3.0",screen:{id:`template.${t}`,name:mt(n,t),type:e,platform:"web",primary_user_goal:Bi(n,t),notes:n==="zh-Hant"?"版型參考常見產品資訊架構,不使用任何第三方品牌資產。":"The template references common product information architecture without third-party brand assets."},viewports:[{id:"desktop",width:1440,height:900},{id:"tablet",width:1024,height:768},{id:"mobile",width:390,height:844}],design_system:s,nodes:[{id:"root",type:r,name:mt(n,t),role:n==="zh-Hant"?"畫面的自由佈局根容器。":"Freeform root container for the screen.",parent_id:null,children:a,layout:{mode:"freeform"},style:{background:"surface.canvas",foreground:"text.primary"}},...i],interactions:$h(i,n),responsive:[{viewport:"tablet",rule:"keep",target_node_id:"root",changes:{geometry:"placements.tablet"}},{viewport:"mobile",rule:"stack",target_node_id:"root",changes:{geometry:"placements.mobile"}}],acceptance:xh(n)}}function Ce(t,e,n,r,i,a,s){return{id:t,type:e,name:n,role:`Render ${n} as the ${e.replaceAll("_"," ")} region.`,parent_id:"root",...s?{children:s}:{},...a??St(e)?{layout:a??St(e)}:{},placements:r,...i?{content:i}:{},style:Fi(e)}}function le(t,e,n,r,i,a,s){return Ce(t,e,n,i,a,s??St(e),r)}function I(t,e,n,r,i,a){return{id:t,type:e,name:r,role:`Use ${r} within ${n}.`,parent_id:n,...a?{children:a}:{},...St(e)?{layout:St(e)}:{},...i?{content:i}:{},style:Fi(e)}}function Fi(t){if(t==="heading")return{typography:"heading.section",foreground:"text.primary"};if(t==="text")return{typography:"body.default",foreground:"text.secondary"};if(t==="button")return{background:"action.primary",foreground:"action.primary.text",radius:"radius.control"};if(["card","detail_panel","form"].includes(t))return{background:"surface.panel",border:"border.default",radius:"radius.panel",shadow:"shadow.panel"}}function re(t,e,n,r,i,a,s,c,u,d,l,m){return{desktop:{x:t,y:e,width:n,height:r,z_index:1},tablet:{x:i,y:a,width:s,height:c,z_index:1},mobile:{x:u,y:d,width:l,height:m,z_index:1}}}function gh(t,e){return t!=null&&t.mobile?{...t,mobile:{...t.mobile,z_index:e}}:t}function dt(){return{mode:"auto",display:"flex",direction:"row",wrap:!0,align:"center",gap:{x:10,y:10}}}function _h(t){const n=t==="zh-Hant"?["營收","訂單","新客戶","轉換率"]:["Revenue","Orders","New customers","Conversion"],r=["$128k","1,284","326","4.8%"];return n.map((i,a)=>Ce(`metric_${a+1}`,"metric_card",i,re(280+a*280,196,260,116,244+a%2*382,194+Math.floor(a/2)*102,366,90,16+a%2*187,188+Math.floor(a/2)*122,171,106),{label:i,value:r[a],data_binding:`metrics.${a}`}))}function vh(t){const e=t==="zh-Hant";return[[e?"自由畫布":"Freeform canvas",e?"拖曳、縮放、吸附與多選。":"Drag, resize, snap, and multi-select."],[e?"結構化輸出":"Structured output",e?"幾何、語意和互動都保存在 JSON。":"Geometry, semantics, and interactions in JSON."],[e?"可驗證交付":"Verifiable handoff",e?"截圖、驗收條件和雜湊一起封裝。":"Screenshots, acceptance criteria, and hashes included."]].flatMap(([r,i],a)=>[le(`feature_${a}`,"card",r,[`feature_${a}_title`,`feature_${a}_copy`],re(88+a*430,590,400,170,56+a*316,540,292,150,16,810+a*176,358,156)),I(`feature_${a}_title`,"heading",`feature_${a}`,r,{text:r}),I(`feature_${a}_copy`,"text",`feature_${a}`,i,{text:i})])}function bh(t){const e=t==="zh-Hant";return[[e?"個人":"Solo","$0",e?"1 個專案":"1 project"],[e?"團隊":"Team","$19",e?"無限專案與協作":"Unlimited projects and collaboration"],[e?"企業":"Enterprise",e?"洽詢":"Contact",e?"私有部署與治理":"Private deployment and governance"]].flatMap(([r,i,a],s)=>[le(`plan_${s}`,"card",r,[`plan_${s}_name`,`plan_${s}_price`,`plan_${s}_copy`,`plan_${s}_button`],re(180+s*370,320,340,350,60+s*318,310,296,330,16,338+s*250,358,230)),I(`plan_${s}_name`,"heading",`plan_${s}`,r,{text:r}),I(`plan_${s}_price`,"heading",`plan_${s}`,i,{text:i}),I(`plan_${s}_copy`,"text",`plan_${s}`,a,{text:a}),I(`plan_${s}_button`,"button",`plan_${s}`,e?"選擇方案":"Choose plan",{label:e?"選擇方案":"Choose plan",action:`select:plan_${s}`})])}function wh(t){const e=t==="zh-Hant";return{label:e?"近期訂單":"Recent orders",data_binding:"orders.recent",columns:[{id:"order",header:e?"訂單":"Order",sortable:!0},{id:"customer",header:e?"客戶":"Customer"},{id:"amount",header:e?"金額":"Amount",sortable:!0},{id:"status",header:e?"狀態":"Status",filterable:!0}]}}function $h(t,e){return Di({nodes:t,interactions:[]},{language:e}).interactions}function xh(t){const e=t==="zh-Hant";return[{id:"acc_layout",type:"layout",statement:e?"桌面版所有主要區域的位置與尺寸符合 placement。":"All major desktop regions match their placements.",target:"desktop",priority:"blocker",verification_method:"screenshot_diff"},{id:"acc_interaction",type:"interaction",statement:e?"所有主要按鈕與導覽操作都有明確 action。":"Primary buttons and navigation items declare actions.",target:"*",priority:"must",verification_method:"interaction_replay"},{id:"acc_tablet",type:"responsive",statement:e?"平板版使用獨立 placement 且不水平溢出。":"Tablet uses dedicated placements without horizontal overflow.",target:"tablet",priority:"must",verification_method:"screenshot_diff"},{id:"acc_mobile",type:"responsive",statement:e?"手機版內容以單欄順序閱讀。":"Mobile content reads in a single-column sequence.",target:"mobile",priority:"must",verification_method:"screenshot_diff"},{id:"acc_a11y",type:"a11y",statement:e?"互動元件具備可理解的文字標籤。":"Interactive controls have understandable text labels.",target:"*",priority:"must",verification_method:"axe_audit"},{id:"acc_content",type:"content",statement:e?"每個主要區域的名稱與內容能說明用途。":"Names and content explain the purpose of each major region.",target:"*",priority:"should",verification_method:"manual_ia_review"}]}function xt({label:t,align:e="center",children:n}){const r=G.useRef(null),[i,a]=G.useState(null),s=()=>{var u;const c=(u=r.current)==null?void 0:u.getBoundingClientRect();c&&a({x:e==="end"?c.right:c.left+c.width/2,y:c.bottom+7})};return o.jsxs(o.Fragment,{children:[o.jsx("span",{ref:r,className:"tooltip-anchor",onMouseEnter:s,onMouseLeave:()=>a(null),onFocusCapture:s,onBlurCapture:()=>a(null),children:n}),i&&os.createPortal(o.jsx("span",{className:`floating-tooltip ${e}`,style:{left:i.x,top:i.y},role:"tooltip",children:t}),document.body)]})}function jh({blueprint:t,onImport:e,onAngularFiles:n,onPersonalTemplateFile:r,onRegistryFile:i,onDownloadAuthoringKit:a,onOpenProject:s,onNewProject:c,onSaveProject:u,onCloseProject:d,projectActive:l,onExportJson:m,onExportMarkdown:g,onExportPackage:$,packageBlocked:k,errorCount:j,fileInputRef:_,language:b,onLanguageChange:f,onTemplateSelect:x,canUndo:C,canRedo:p,onUndo:h,onRedo:y}){const w=G.useRef(null),A=G.useRef(null),S=G.useRef(null),O=G.useRef(null);async function H(B){var ae;const W=(ae=B.target.files)==null?void 0:ae[0];if(W){try{const oe=JSON.parse(await Dr(W));if("format"in oe&&oe.format==="aub-design-bridge"){const{importDesignBridge:we}=await Ke(async()=>{const{importDesignBridge:he}=await import("./design-bridge.lib-DJvaK6AX.js");return{importDesignBridge:he}},[]);e(we(oe).blueprint)}else e(oe)}catch(oe){window.alert(T(b,"parseJsonFailed",{message:oe.message}))}B.target.value=""}}return o.jsxs("header",{className:"topbar",children:[o.jsxs("div",{className:"brand-block",children:[o.jsxs("div",{className:"brand-title",children:[o.jsx("img",{src:"/brand/aub-logo-mark.svg",alt:""}),o.jsx("strong",{children:T(b,"appTitle")})]}),o.jsx("span",{children:(t==null?void 0:t.screen.name)??T(b,"noBlueprintLoaded")})]}),o.jsxs("div",{className:"topbar-actions",children:[o.jsx("input",{ref:_,type:"file",accept:"application/json,.json",onChange:H,hidden:!0}),o.jsx("input",{ref:w,type:"file",accept:".html,.scss,.css,.ts,.zip,application/zip",multiple:!0,onChange:B=>{var W;(W=B.target.files)!=null&&W.length&&n(B.target.files),B.target.value=""},hidden:!0}),o.jsx("input",{ref:O,type:"file",accept:".json,application/json",onChange:B=>{var ae;const W=(ae=B.target.files)==null?void 0:ae[0];W&&i(W),B.target.value=""},hidden:!0}),o.jsx("input",{ref:A,type:"file",accept:".json,.zip,application/json,application/zip",onChange:B=>{var ae;const W=(ae=B.target.files)==null?void 0:ae[0];W&&r(W),B.target.value=""},hidden:!0}),o.jsx("input",{ref:S,type:"file",accept:".json,application/json",multiple:!0,onChange:B=>{var W;(W=B.target.files)!=null&&W.length&&s(B.target.files),B.target.value=""},hidden:!0}),o.jsxs("label",{className:"language-select",children:[o.jsx("span",{children:T(b,"language")}),o.jsx("select",{value:b,onChange:B=>f(B.target.value),children:fp.map(B=>o.jsx("option",{value:B.id,children:xp(b,B.id)},B.id))})]}),o.jsxs("label",{className:"template-select",children:[o.jsx("span",{children:T(b,"template")}),o.jsxs("select",{defaultValue:"",onChange:B=>{const W=B.target.value;W&&x(W),B.target.value=""},children:[o.jsx("option",{value:"",disabled:!0,children:T(b,"chooseTemplate")}),Hi.map(B=>o.jsx("optgroup",{label:b==="zh-Hant"?B.labelZh:B.labelEn,children:B.ids.map(W=>o.jsx("option",{value:W,children:mt(b,W)},W))},B.id))]})]}),o.jsxs("div",{className:"topbar-icon-group",children:[o.jsx(Ue,{icon:o.jsx(fu,{}),label:T(b,"undo"),disabled:!C,onClick:h}),o.jsx(Ue,{icon:o.jsx(Qd,{}),label:T(b,"redo"),disabled:!p,onClick:y}),o.jsx(Ue,{icon:o.jsx(gu,{}),label:T(b,"importJson"),onClick:()=>{var B;return(B=_.current)==null?void 0:B.click()}}),o.jsx(Ue,{icon:o.jsx($i,{}),label:T(b,"importAngular"),onClick:()=>{var B;return(B=w.current)==null?void 0:B.click()}}),o.jsx(Ue,{icon:o.jsx(Ud,{}),label:T(b,"importPersonalTemplate"),onClick:()=>{var B;return(B=A.current)==null?void 0:B.click()}}),o.jsx(Ue,{icon:o.jsx(ld,{}),label:T(b,"importRegistry"),onClick:()=>{var B;return(B=O.current)==null?void 0:B.click()}}),o.jsx(Ue,{icon:o.jsx(od,{}),label:T(b,"downloadAuthoringKit"),onClick:a}),o.jsx(Ue,{icon:o.jsx(Td,{}),label:T(b,"openProject"),onClick:()=>{var B;return(B=S.current)==null?void 0:B.click()}}),o.jsx(Ue,{icon:o.jsx(Md,{}),label:T(b,"newProject"),disabled:!t,onClick:c}),o.jsx(Ue,{icon:o.jsx(Fr,{}),label:T(b,"saveProject"),disabled:!l,onClick:u}),l&&o.jsx(Ue,{icon:o.jsx(pr,{}),label:T(b,"closeProject"),onClick:d})]}),o.jsxs("div",{className:"export-menu",children:[o.jsx(wi,{}),o.jsx(Ue,{icon:o.jsx(Sd,{}),label:T(b,"exportJson"),disabled:!t,onClick:m}),o.jsx(Ue,{icon:o.jsx(Ad,{}),label:T(b,"exportMarkdown"),disabled:!t,onClick:g}),o.jsx(Ue,{icon:o.jsx(jd,{}),label:T(b,"exportPackage"),tooltipAlign:"end",disabled:!t||j>0||k,onClick:$})]}),o.jsx("span",{className:`validation-pill ${j?"invalid":"valid"}`,children:j?`${j} ${T(b,"schemaErrors")}`:T(b,"valid")})]})]})}function Ue({icon:t,label:e,tooltipAlign:n,disabled:r,onClick:i}){return o.jsx(xt,{label:e,align:n,children:o.jsx("button",{type:"button",className:"icon-button","aria-label":e,title:e,disabled:r,onClick:i,children:t})})}function kh({blueprint:t,selectedIds:e,language:n,onAdd:r,onSelect:i,onReparent:a,onTemplateSelect:s,draggingType:c,onDraggingTypeChange:u,personalTemplates:d,onSavePersonalTemplate:l,onLoadPersonalTemplate:m,onExportPersonalTemplate:g,onDeletePersonalTemplate:$,workspaceTemplates:k,onLoadWorkspaceTemplate:j}){const[_,b]=G.useState("components"),[f,x]=G.useState(""),[C,p]=G.useState("");return o.jsxs("aside",{className:"panel palette",children:[o.jsxs("div",{className:"side-tabs",children:[o.jsx(Pr,{active:_==="components",icon:o.jsx(bi,{}),label:T(n,"components"),onClick:()=>b("components")}),o.jsx(Pr,{active:_==="templates",icon:o.jsx(Nr,{}),label:T(n,"templates"),onClick:()=>b("templates")}),o.jsx(Pr,{active:_==="layers",icon:o.jsx(xi,{}),label:T(n,"layers"),onClick:()=>b("layers")})]}),_==="components"&&o.jsxs(o.Fragment,{children:[o.jsx("input",{className:"palette-search",value:f,onChange:h=>x(h.target.value),placeholder:T(n,"searchComponents")}),o.jsx("p",{className:"palette-hint",children:T(n,"paletteHint")}),Pi().map(h=>{const y=h.types.filter(w=>`${w.name} ${ft(n,w.name)} ${Ho(n,w.name,w.description)}`.toLowerCase().includes(f.toLowerCase()));return y.length?o.jsxs("section",{className:"palette-category",children:[o.jsx("h3",{title:kp(n,h.id,h.description),children:jp(n,h.id,h.name)}),y.map(w=>o.jsxs("div",{className:`palette-item${c===w.name?" dragging":""}`,draggable:!0,title:Ho(n,w.name,w.description),onClick:()=>r(w.name),onPointerDown:()=>u(w.name),onDragStart:A=>{A.dataTransfer.effectAllowed="copy",A.dataTransfer.setData("application/aub-component-type",w.name),A.dataTransfer.setData("text/plain",w.name),u(w.name)},onDragEnd:()=>u(null),children:[o.jsx("span",{children:ft(n,w.name,w.displayName)}),o.jsx("span",{className:"kind",children:w.isContainer?T(n,"container"):T(n,"leaf")})]},w.name))]},h.id):null})]}),_==="templates"&&o.jsxs("div",{className:"template-browser",children:[o.jsxs("section",{className:"personal-template-section",children:[o.jsx("h3",{children:n==="zh-Hant"?"個人範本":"Personal templates"}),o.jsxs("div",{className:"personal-template-save",children:[o.jsx("input",{value:C,onChange:h=>p(h.target.value),placeholder:n==="zh-Hant"?"範本名稱":"Template name"}),o.jsxs("button",{type:"button",title:n==="zh-Hant"?"儲存目前畫面為個人範本":"Save current screen as a personal template",disabled:!t,onClick:()=>{l(C),p("")},children:[o.jsx(Fr,{}),n==="zh-Hant"?"儲存":"Save"]})]}),d.length===0&&o.jsx("p",{className:"empty",children:n==="zh-Hant"?"尚未儲存個人範本。":"No personal templates saved."}),d.map(h=>o.jsxs("div",{className:"personal-template-item",children:[o.jsxs("button",{type:"button",className:"personal-template-load",onClick:()=>m(h),children:[h.preview?o.jsx("img",{src:h.preview,alt:n==="zh-Hant"?`${h.name} 預覽`:`${h.name} preview`}):o.jsx("div",{className:"template-preview-empty",children:o.jsx(Nr,{})}),o.jsxs("span",{children:[o.jsx("strong",{children:h.name}),o.jsx("small",{children:new Date(h.updatedAt).toLocaleDateString(n==="zh-Hant"?"zh-TW":"en-US")})]})]}),o.jsxs("div",{className:"personal-template-actions",children:[o.jsx("button",{type:"button","aria-label":n==="zh-Hant"?`匯出範本「${h.name}」`:`Export template "${h.name}"`,title:n==="zh-Hant"?"匯出範本":"Export template",onClick:()=>g(h),children:o.jsx(wi,{})}),o.jsx("button",{type:"button","aria-label":n==="zh-Hant"?`刪除範本「${h.name}」`:`Delete template "${h.name}"`,title:n==="zh-Hant"?"刪除範本":"Delete template",onClick:()=>$(h),children:o.jsx(ur,{})})]})]},h.id))]}),k.length>0&&o.jsxs("section",{className:"workspace-template-section",children:[o.jsx("h3",{children:n==="zh-Hant"?"Workspace 範本":"Workspace templates"}),k.map(h=>{var y;return o.jsxs("button",{type:"button",onClick:()=>j(h),children:[o.jsx("div",{className:"template-preview-empty",children:o.jsx(Nr,{})}),o.jsxs("span",{className:"template-browser-copy",children:[o.jsx("strong",{children:h.name}),o.jsxs("span",{children:[h.framework," · ",h.status,typeof h.confidence=="number"?` · ${Math.round(h.confidence*100)}%`:""]}),o.jsx("span",{children:((y=h.source)==null?void 0:y.path)??h.path})]})]},h.path)})]}),Hi.map(h=>o.jsxs("section",{children:[o.jsx("h3",{children:n==="zh-Hant"?h.labelZh:h.labelEn}),h.ids.map(y=>o.jsxs("button",{type:"button",onClick:()=>s(y),children:[o.jsx("img",{src:`/template-previews/${y}.png`,alt:n==="zh-Hant"?`${mt(n,y)}範本預覽`:`${mt(n,y)} template preview`,loading:"lazy"}),o.jsxs("span",{className:"template-browser-copy",children:[o.jsx("strong",{children:mt(n,y)}),o.jsx("span",{children:Bi(n,y)})]})]},y))]},h.id))]}),_==="layers"&&o.jsx(Sh,{blueprint:t,selectedIds:e,language:n,onSelect:i,onReparent:a})]})}function Sh({blueprint:t,selectedIds:e,language:n,onSelect:r,onReparent:i}){const a=G.useMemo(()=>Nh(t),[t]),[s,c]=G.useState(null);if(!a.root)return o.jsx("p",{className:"empty",children:T(n,"noLayers")});function u(d,l=0){const m=a.children.get(d.id)??[];return o.jsxs("div",{children:[o.jsxs("button",{type:"button",className:`layer-row${e.includes(d.id)?" selected":""}`,style:{paddingLeft:8+l*14},draggable:d.parent_id!==null,onDragStart:()=>c(d.id),onDragEnd:()=>c(null),onDragOver:g=>{s&&qe(d.type)&&s!==d.id&&g.preventDefault()},onDrop:g=>{g.preventDefault(),s&&qe(d.type)&&i(s,d.id),c(null)},onClick:g=>r(g.shiftKey?[...e,d.id]:[d.id]),children:[o.jsx("span",{children:qe(d.type)?"▾":"•"}),o.jsx("span",{children:d.name}),o.jsx("small",{children:ft(n,d.type)})]}),m.map(g=>u(g,l+1))]},d.id)}return o.jsx("div",{className:"layer-tree",children:u(a.root)})}function Nh(t){const e=(t==null?void 0:t.nodes.find(r=>r.parent_id===null))??null,n=new Map;for(const r of(t==null?void 0:t.nodes)??[]){if(!r.parent_id)continue;const i=n.get(r.parent_id)??[];i.push(r),n.set(r.parent_id,i)}return{root:e,children:n}}function Pr({active:t,icon:e,label:n,onClick:r}){return o.jsxs("button",{type:"button",className:t?"active":"",onClick:r,title:n,children:[e,o.jsx("span",{children:n})]})}function Ch({altKey:t,currentParentId:e,destinationId:n}){return t&&n&&n!==e?"reparent":"move"}function $t(t,e){var n,r,i,a,s;return((n=t.placements)==null?void 0:n[e])??((r=t.placements)==null?void 0:r.desktop)??((i=t.placements)==null?void 0:i.tablet)??((a=t.placements)==null?void 0:a.mobile)??((s=t.placements)==null?void 0:s.wide)??Ft(t.type)}function Ph(t,e,n){if(t.length<2)return[];const r=t.map(l=>({node:l,placement:$t(l,e)})),i=Math.min(...r.map(({placement:l})=>l.x)),a=Math.max(...r.map(({placement:l})=>l.x+l.width)),s=Math.min(...r.map(({placement:l})=>l.y)),c=Math.max(...r.map(({placement:l})=>l.y+l.height)),u=(i+a)/2,d=(s+c)/2;return r.map(({node:l,placement:m})=>{switch(n){case"left":return{id:l.id,patch:{x:i}};case"center":return{id:l.id,patch:{x:u-m.width/2}};case"right":return{id:l.id,patch:{x:a-m.width}};case"top":return{id:l.id,patch:{y:s}};case"middle":return{id:l.id,patch:{y:d-m.height/2}};case"bottom":return{id:l.id,patch:{y:c-m.height}}}})}function Eh(t,e,n){var l;if(t.length<3)return[];const r=t.map(m=>({node:m,placement:$t(m,e)})).sort((m,g)=>n==="horizontal"?m.placement.x-g.placement.x:m.placement.y-g.placement.y),i=r[0].placement,a=((l=r.at(-1))==null?void 0:l.placement)??i,s=r.reduce((m,g)=>m+(n==="horizontal"?g.placement.width:g.placement.height),0),c=n==="horizontal"?a.x+a.width-i.x:a.y+a.height-i.y,u=Math.max(0,(c-s)/(r.length-1));let d=n==="horizontal"?i.x:i.y;return r.map(({node:m,placement:g})=>{const $=n==="horizontal"?{x:d}:{y:d};return d+=(n==="horizontal"?g.width:g.height)+u,{id:m.id,patch:$}})}const Go={id:"desktop",width:1440,height:900},Er=.05,Ar=1.5,Rr=.1;function Ah({language:t,viewport:e,onSetViewportSize:n}){const[r,i]=G.useState(String(e.width)),[a,s]=G.useState(String(e.height));G.useEffect(()=>{i(String(e.width)),s(String(e.height))},[e.id,e.width,e.height]);const c=G.useMemo(()=>{const l=Cr.find(m=>m.width===e.width&&m.height===e.height);return(l==null?void 0:l.id)??"custom"},[e.width,e.height]),u=()=>{const l=Ai(Number(r));i(String(l)),l!==e.width&&n(e.id,{width:l})},d=()=>{const l=Ri(Number(a));s(String(l)),l!==e.height&&n(e.id,{height:l})};return o.jsxs("div",{className:"resolution-control",title:T(t,"resolution"),children:[o.jsxs("select",{"aria-label":T(t,"resolutionPreset"),value:c,onChange:l=>{const m=Cr.find(g=>g.id===l.target.value);m&&n(e.id,{width:m.width,height:m.height})},children:[Cr.map(l=>o.jsxs("option",{value:l.id,children:[l.width," × ",l.height]},l.id)),c==="custom"&&o.jsx("option",{value:"custom",children:T(t,"customResolution")})]}),o.jsx("input",{type:"number",className:"resolution-input","aria-label":T(t,"viewportWidth"),value:r,min:320,max:7680,onChange:l=>i(l.target.value),onBlur:u,onKeyDown:l=>{l.key==="Enter"&&l.target.blur()}}),o.jsx("span",{className:"resolution-times",children:"×"}),o.jsx("input",{type:"number",className:"resolution-input","aria-label":T(t,"viewportHeight"),value:a,min:320,max:4320,onChange:l=>s(l.target.value),onBlur:d,onKeyDown:l=>{l.key==="Enter"&&l.target.blur()}})]})}const Rh=G.forwardRef(function({blueprint:e,selectedIds:n,language:r,onSelectionChange:i,onAddNode:a,onDeleteNodes:s,onUpdateNode:c,onUpdatePlacements:u,onMoveNode:d,onDuplicateNodes:l,onSetZIndex:m,onSetViewportSize:g,onCreateStarter:$,onTemplateSelect:k,draggingType:j,onDragComplete:_,resetKey:b,propertiesOpen:f,onPropertiesOpen:x},C){var Oe,jt,gt,ut;const[p,h]=G.useState("desktop"),y=G.useRef("desktop"),[w,A]=G.useState(null),[S,O]=G.useState(.85),[H,B]=G.useState([]),W=G.useRef(!1),ae=G.useRef(new Map),oe=G.useRef(null),we=G.useRef(null),he=G.useRef(null),Q=G.useMemo(()=>e?Th(e):null,[e]),Y=e!=null&&e.viewports.length?e.viewports:[Go],M=Y.find(L=>L.id===p)??Y[0]??Go,U=Q!=null&&Q.root?Math.max(M.height,...(Q.childrenById.get(Q.root.id)??[]).map(L=>{const F=$t(L,M.id);return F.y+F.height+16})):M.height,z=Ih(M,U),v=z.width/M.width,N=n.map(L=>Q==null?void 0:Q.byId.get(L)).filter(L=>!!L),E=N.some(L=>L.parent_id!==null),te=N.map(L=>{var F;return`${L.id}:${JSON.stringify(((F=L.placements)==null?void 0:F[p])??null)}`}).join("|"),ee=N.length===1&&N[0]&&qe(N[0].type)?N[0]:null;G.useEffect(()=>{y.current=p},[p]),G.useEffect(()=>{const L=requestAnimationFrame(()=>pe());return()=>cancelAnimationFrame(L)},[b]),G.useEffect(()=>{const L=requestAnimationFrame(()=>pe());return()=>cancelAnimationFrame(L)},[p,M.width,M.height]),G.useEffect(()=>{const L=we.current;if(!L)return;let F=requestAnimationFrame(()=>pe());const Z=new ResizeObserver(()=>{cancelAnimationFrame(F),F=requestAnimationFrame(()=>pe())});return Z.observe(L),()=>{cancelAnimationFrame(F),Z.disconnect()}},[p,M.width,M.height,b]),G.useEffect(()=>{j&&(W.current=!1)},[j]),G.useEffect(()=>{if(!j)return;const L=j;function F(Z){var Le;if(W.current){_();return}const ie=document.elementFromPoint(Z.clientX,Z.clientY);if(!(ie instanceof HTMLElement?ie.closest(".artboard"):null)||!((Le=oe.current)!=null&&Le.contains(ie))){_();return}const je=ie instanceof HTMLElement?ie.closest("[data-node-id]"):null,ge=je?Q==null?void 0:Q.byId.get(je.dataset.nodeId??""):null,Ee=ge&&qe(ge.type)?ge:ge!=null&&ge.parent_id?(Q==null?void 0:Q.byId.get(ge.parent_id))??null:ee??(Q==null?void 0:Q.root)??null,We=Ee?ve(Ee,Z.clientX,Z.clientY):{position:void 0,options:{}};W.current=!0,a(L,(Ee==null?void 0:Ee.id)??null,We.position,p,We.options),_()}return window.addEventListener("pointerup",F),()=>window.removeEventListener("pointerup",F)},[j,v,a,_,ee,Q,p,S]),G.useEffect(()=>{const L=requestAnimationFrame(()=>{const F=oe.current;if(!F){B([]);return}B(n.map(Z=>F.querySelector(`.freeform-node[data-node-id="${CSS.escape(Z)}"]`)).filter(Z=>!!Z))});return()=>cancelAnimationFrame(L)},[n,e,p,S]),G.useEffect(()=>{const L=requestAnimationFrame(()=>{var F;(F=he.current)==null||F.updateRect(),R()});return()=>cancelAnimationFrame(L)},[te,H,p,S]),G.useEffect(()=>{function L(F){if(!e||n.length===0||Xh(F.target))return;if(F.key==="Backspace"||F.key==="Delete"){F.preventDefault(),s(n);return}if((F.metaKey||F.ctrlKey)&&F.key.toLowerCase()==="d"){F.preventDefault(),l(n);return}if(!["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(F.key))return;const Z=F.shiftKey?10:1;F.preventDefault(),u(N.map(ie=>{const ue=$t(ie,p);return{id:ie.id,viewportId:p,patch:{x:ue.x+(F.key==="ArrowLeft"?-Z:F.key==="ArrowRight"?Z:0),y:ue.y+(F.key==="ArrowUp"?-Z:F.key==="ArrowDown"?Z:0)}}}))}return window.addEventListener("keydown",L),()=>window.removeEventListener("keydown",L)},[e,s,l,u,n,N,p]),G.useImperativeHandle(C,()=>({focusNode(L){var Z;const F=(Z=oe.current)==null?void 0:Z.querySelector(`.preview-node[data-node-id="${CSS.escape(L)}"]`);return F?(F.scrollIntoView({behavior:"smooth",block:"center",inline:"center"}),!0):!1},addComponent(L){var je,ge;const F=N[0],Z=F&&qe(F.type)?F:F!=null&&F.parent_id?(Q==null?void 0:Q.byId.get(F.parent_id))??(Q==null?void 0:Q.root)??null:(Q==null?void 0:Q.root)??null;if(!Z)return!1;const ie=((je=Z.layout)==null?void 0:je.mode)==="freeform"?[]:Te(Z),ue=Pe(Z,L,ie);return a(L,Z.id,ue,p,{...((ge=Z.layout)==null?void 0:ge.mode)==="freeform"?{}:{makeParentFreeform:!0,existingPlacements:ie}}),!0},async captureViewports(){const{toPng:L}=await Ke(async()=>{const{toPng:ie}=await import("./index-BCH-ek3h.js");return{toPng:ie}},[]),F={},Z=y.current;for(const ie of Y)if(h(ie.id),y.current=ie.id,await er(),oe.current){oe.current.classList.add("capture-clean");try{F[ie.id]=await L(oe.current,{cacheBust:!0,pixelRatio:1,backgroundColor:"#ffffff"})}finally{oe.current.classList.remove("capture-clean")}}return h(Z),y.current=Z,await er(),F},async auditViewports(){const L=y.current,F=[];for(const Z of Y)if(h(Z.id),y.current=Z.id,await er(),oe.current&&e){oe.current.classList.add("capture-clean");try{F.push(...zh(oe.current,e,Z.id))}finally{oe.current.classList.remove("capture-clean")}}return h(L),y.current=L,await er(),{checkedViewportIds:Y.map(Z=>Z.id),issues:F}}}),[M,e,v,a,N,Q,p,Y,S]);function se(L){O(Math.min(Ar,Math.max(Er,Number(L.toFixed(2)))))}function pe(){const L=we.current;if(!L)return;const F=L.clientWidth-56,Z=L.clientHeight-56;if(F<=0||Z<=0)return;const ie=F/z.width,ue=Z/z.height;se(Math.min(1,ie,ue)),L.scrollTo({left:0,top:0})}function R(){var Z;const L=we.current,F=(Z=L==null?void 0:L.parentElement)==null?void 0:Z.querySelector(".moveable-control-box");!L||!F||(F.style.marginLeft=`${-L.scrollLeft}px`,F.style.marginTop=`${-L.scrollTop}px`)}function q(L){L.preventDefault();const F=Zo(L,j);if(!F||W.current){_();return}W.current=!0;const Z=L.target instanceof HTMLElement?L.target:null,ie=Z==null?void 0:Z.closest("[data-node-id]"),ue=ie?Q==null?void 0:Q.byId.get(ie.dataset.nodeId??""):null,je=ue&&qe(ue.type)?ue:ue!=null&&ue.parent_id?(Q==null?void 0:Q.byId.get(ue.parent_id))??null:ee??(Q==null?void 0:Q.root)??null,ge=je?ve(je,L.clientX,L.clientY):{position:void 0,options:{}};a(F,(je==null?void 0:je.id)??null,ge.position,p,ge.options),A(null),_()}function J(L){u(Ph(N,p,L).map(F=>({...F,viewportId:p})))}function X(L){u(Eh(N,p,L).map(F=>({...F,viewportId:p})))}function V(L,F){if(F.button!==0||F.shiftKey||F.metaKey||F.ctrlKey)return;const Z=Q==null?void 0:Q.byId.get(L),ie=F.currentTarget.closest("[data-node-id]"),ue=Z!=null&&Z.parent_id?xe(Z.parent_id):null,je=Z?$t(Z,p):null;if(!Z||!ie||!je||!ue)return;const ge=Z,Ee=ie,We=je;F.preventDefault(),F.stopPropagation(),i([L]),Ee.classList.add("is-handle-dragging");const Le=F.clientX,et=F.clientY,ke=Ee.getBoundingClientRect(),ze=ue.getBoundingClientRect(),Ae=F.clientX-ke.left,Ve=F.clientY-ke.top;let tt=0,Mt=0,Qt=!1,Ge=null;function en(nt){tt=nt.clientX-Le,Mt=nt.clientY-et,Qt||(Qt=Math.abs(tt)>2||Math.abs(Mt)>2),Ee.style.transform=`translate(${tt/S}px, ${Mt/S}px)`,Ge=nt.altKey?ce(nt.clientX,nt.clientY,L):null,A(Ge&&Ge.id!==ge.parent_id?Ge.id:null)}function Ot(nt){var Ut,Jt,tn,Kt;if(window.removeEventListener("pointermove",en),window.removeEventListener("pointerup",Ot),window.removeEventListener("pointercancel",Ot),Ee.style.transform="",Ee.classList.remove("is-handle-dragging"),A(null),!Qt)return;if(Ch({altKey:nt.altKey,currentParentId:ge.parent_id,destinationId:(Ge==null?void 0:Ge.id)??null})==="reparent"&&Ge){const Ct=(Ut=xe(Ge.id))==null?void 0:Ut.getBoundingClientRect(),nn=((Jt=Ge.layout)==null?void 0:Jt.mode)==="freeform"&&Ct?{x:Math.max(0,Math.min((nt.clientX-Ct.left-Ae)/S/v,Math.max(0,(Ct.width-ke.width)/S/v))),y:Math.max(0,Math.min((nt.clientY-Ct.top-Ve)/S/v,Math.max(0,(Ct.height-ke.height)/S/v)))}:void 0;d(L,Ge.id,nn,p);return}if(ge.parent_id&&((Kt=(tn=Q==null?void 0:Q.byId.get(ge.parent_id))==null?void 0:tn.layout)==null?void 0:Kt.mode)!=="freeform")return;const hr=Math.min(ze.right-ke.right,Math.max(ze.left-ke.left,tt)),mr=Math.min(ze.bottom-ke.bottom,Math.max(ze.top-ke.top,Mt));u([{id:L,viewportId:p,patch:{x:We.x+hr/S/v,y:We.y+mr/S/v}}])}window.addEventListener("pointermove",en),window.addEventListener("pointerup",Ot),window.addEventListener("pointercancel",Ot)}function ce(L,F,Z){if(!Q)return null;for(const ie of document.elementsFromPoint(L,F)){const ue=ie instanceof HTMLElement?ie.closest("[data-node-id]"):null,je=ue==null?void 0:ue.dataset.nodeId;if(!je||Yo(je,Z,Q))continue;let ge=Q.byId.get(je)??null;for(;ge&&!qe(ge.type);)ge=ge.parent_id?Q.byId.get(ge.parent_id)??null:null;if(ge&&!Yo(ge.id,Z,Q))return ge}return null}function $e(){var Z,ie,ue;if(!ee||!Q)return;if((((Z=ee.layout)==null?void 0:Z.mode)==="freeform"?"auto":"freeform")==="auto"){c(ee.id,{layout:{...ee.layout,mode:"auto",display:((ie=ee.layout)==null?void 0:ie.display)??"flex",direction:((ue=ee.layout)==null?void 0:ue.direction)??"column"}});return}const F=Te(ee);F.length&&u(F),c(ee.id,{layout:{...ee.layout,mode:"freeform"}})}function ve(L,F,Z){var ue;const ie=xe(L.id);return{position:Mh(F,Z,ie??oe.current,S,v),options:((ue=L.layout)==null?void 0:ue.mode)==="freeform"?{}:{makeParentFreeform:!0,existingPlacements:Te(L)}}}function xe(L){var F;return((F=oe.current)==null?void 0:F.querySelector(`[data-node-id="${CSS.escape(L)}"] > .preview-children`))??null}function Te(L){var ge;const F=xe(L.id),Z=F==null?void 0:F.getBoundingClientRect(),ie=(Q==null?void 0:Q.childrenById.get(L.id))??[],ue=[];if(!Z)return ue;const je={width:Z.width/S/v,height:Z.height/S/v};for(const Ee of ie){const We=(ge=oe.current)==null?void 0:ge.querySelector(`[data-node-id="${CSS.escape(Ee.id)}"]`),Le=We==null?void 0:We.getBoundingClientRect();if(!Le)continue;const et={x:Math.round((Le.left-Z.left)/S/v),y:Math.round((Le.top-Z.top)/S/v),width:Math.round(Le.width/S/v),height:Math.round(Le.height/S/v)};for(const ke of Y){const ze=L.parent_id?$t(L,ke.id):{width:ke.width,height:ke.height},Ae=Math.min(ke.width/M.width,ke.height/M.height),Ve=ze.width>0?ze.width/je.width:Ae,tt=ze.height>0?ze.height/je.height:Ae;ue.push({id:Ee.id,viewportId:ke.id,patch:{x:Math.max(0,Math.round(et.x*Ve)),y:Math.max(0,Math.round(et.y*tt)),width:Math.max(1,Math.round(et.width*Ve)),height:Math.max(1,Math.round(et.height*tt))}})}}return ue}function Pe(L,F,Z){var ze;const ie=xe(L.id),ue=ie==null?void 0:ie.getBoundingClientRect(),je=ue?ue.width/S/v:M.width,ge=ue?ue.height/S/v:M.height,Ee=Ft(F),We=(Q==null?void 0:Q.childrenById.get(L.id))??[],Le=((ze=L.layout)==null?void 0:ze.mode)==="freeform"?We.map(Ae=>$t(Ae,p)):Z.filter(Ae=>Ae.viewportId===p).map(Ae=>{var Ve;return{...Ft(((Ve=Q==null?void 0:Q.byId.get(Ae.id))==null?void 0:Ve.type)??"text"),...Ae.patch}}),et=Math.max(0,je-Math.min(Ee.width,je)),ke=Math.max(0,ge-Math.min(Ee.height,ge));for(let Ae=16;Ae<=ke;Ae+=32)for(let Ve=16;Ve<=et;Ve+=32)if(!Le.some(tt=>Oh({x:Ve,y:Ae,width:Ee.width,height:Ee.height},tt,8)))return{x:Ve,y:Ae};return{x:Math.min(16,et),y:Math.min(Math.max(0,...Le.map(Ae=>Ae.y+Ae.height+16)),ke)}}if(!e||!(Q!=null&&Q.root))return o.jsxs("section",{className:`panel canvas canvas-empty${j?" drag-active":""}`,onDragOver:L=>L.preventDefault(),onDrop:L=>{L.preventDefault();const F=Zo(L,j);F&&a(F,null,void 0,p),_()},children:[!f&&o.jsx("button",{className:"properties-reopen-button",onClick:x,children:T(r,"showProperties")}),o.jsxs("div",{className:"empty-artboard start-artboard",children:[o.jsxs("div",{className:"start-heading",children:[o.jsx("h2",{children:T(r,"startTitle")}),o.jsx("p",{children:T(r,"startPrompt")})]}),o.jsxs("div",{className:"start-options",children:[o.jsxs("button",{className:"start-option",onClick:()=>$("page"),children:[o.jsx("strong",{children:T(r,"startPage")}),o.jsx("span",{children:T(r,"startPagePath")})]}),o.jsxs("button",{className:"start-option",onClick:()=>$("app"),children:[o.jsx("strong",{children:T(r,"startApp")}),o.jsx("span",{children:T(r,"startAppPath")})]})]}),o.jsxs("div",{className:"start-templates",children:[o.jsx("span",{children:T(r,"startFromTemplate")}),o.jsx("div",{children:Li.map(L=>o.jsx("button",{onClick:()=>k(L),children:mt(r,L)},L))})]})]})]});return o.jsxs("section",{className:`panel canvas${j?" drag-active":""}`,onClick:()=>i([]),onDragOver:L=>{L.preventDefault(),L.dataTransfer.dropEffect="copy"},onDrop:q,children:[o.jsxs("div",{className:"canvas-toolbar",onClick:L=>L.stopPropagation(),children:[o.jsxs("div",{className:"canvas-title",children:[o.jsx("strong",{children:e.screen.name}),o.jsxs("span",{children:[M.width," × ",M.height]})]}),o.jsx("div",{className:"viewport-tabs",children:Y.map(L=>o.jsx("button",{className:L.id===p?"active":"",onClick:()=>h(L.id),children:Ni(r,L.id)},L.id))}),o.jsx(Ah,{language:r,viewport:M,onSetViewportSize:g}),o.jsxs("div",{className:"canvas-tool-group selection-tools",children:[o.jsx(Je,{icon:o.jsx(wd,{}),label:T(r,"duplicate"),disabled:!E,onClick:()=>l(n)}),o.jsx(Je,{icon:o.jsx(ud,{}),label:T(r,"bringFront"),disabled:!H.length,onClick:()=>m(n,p,"front")}),o.jsx(Je,{icon:o.jsx(au,{}),label:T(r,"sendBack"),disabled:!H.length,onClick:()=>m(n,p,"back")})]}),o.jsxs("div",{className:"canvas-tool-group align-tools",children:[o.jsx(Je,{icon:o.jsx(td,{}),label:T(r,"alignLeft"),disabled:H.length<2,onClick:()=>J("left")}),o.jsx(Je,{icon:o.jsx(Ul,{}),label:T(r,"alignCenter"),disabled:H.length<2,onClick:()=>J("center")}),o.jsx(Je,{icon:o.jsx(Gl,{}),label:T(r,"alignRight"),disabled:H.length<2,onClick:()=>J("right")}),o.jsx(Je,{icon:o.jsx(Ql,{}),label:T(r,"alignTop"),disabled:H.length<2,onClick:()=>J("top")}),o.jsx(Je,{icon:o.jsx(Vl,{}),label:T(r,"alignMiddle"),disabled:H.length<2,onClick:()=>J("middle")}),o.jsx(Je,{icon:o.jsx(Kl,{}),label:T(r,"alignBottom"),disabled:H.length<2,onClick:()=>J("bottom")}),o.jsx(Je,{icon:o.jsx(Zl,{}),label:T(r,"distributeHorizontal"),disabled:H.length<3,onClick:()=>X("horizontal")}),o.jsx(Je,{icon:o.jsx(rd,{}),label:T(r,"distributeVertical"),disabled:H.length<3,onClick:()=>X("vertical")})]}),o.jsxs("button",{className:`layout-mode-toggle${((Oe=ee==null?void 0:ee.layout)==null?void 0:Oe.mode)==="freeform"?" active":""}`,disabled:!ee,onClick:$e,title:T(r,"toggleLayoutMode"),children:[((jt=ee==null?void 0:ee.layout)==null?void 0:jt.mode)==="freeform"?o.jsx(xi,{}):o.jsx(qd,{}),o.jsx("span",{children:((gt=ee==null?void 0:ee.layout)==null?void 0:gt.mode)==="freeform"?T(r,"freeform"):T(r,"autoLayout")})]}),o.jsxs("div",{className:"zoom-controls",children:[o.jsx(Je,{icon:o.jsx(Wd,{}),label:T(r,"fitArtboard"),onClick:pe}),o.jsx(Je,{icon:o.jsx(ju,{}),label:T(r,"zoomOut"),disabled:S<=Er,onClick:()=>se(S-Rr)}),o.jsx("input",{"aria-label":T(r,"zoom"),type:"range",min:Er,max:Ar,step:Rr,value:S,onChange:L=>se(Number(L.target.value))}),o.jsx(Je,{icon:o.jsx($u,{}),label:T(r,"zoomIn"),disabled:S>=Ar,onClick:()=>se(S+Rr)}),o.jsxs("span",{children:[Math.round(S*100),"%"]})]}),!f&&o.jsx("button",{className:"properties-toolbar-button",onClick:x,children:T(r,"showProperties")})]}),j&&o.jsx("div",{className:"canvas-drop-hint",children:T(r,"releaseToAdd",{component:ft(r,j)})}),o.jsx("div",{className:"artboard-stage",ref:we,onScroll:()=>requestAnimationFrame(()=>{var L;(L=he.current)==null||L.updateRect(),R()}),children:o.jsx("div",{className:"artboard-zoom-shell",style:{width:z.width*S,height:z.height*S},children:o.jsx("div",{ref:oe,className:`artboard artboard-${M.id}`,"data-viewport-id":p,style:{width:z.width,height:z.height,transform:`scale(${S})`},children:o.jsx(Ui,{node:Q.root,tree:Q,selectedIds:n,dropTargetId:w,viewportId:p,isRoot:!0,language:r,designSystem:e.design_system,onSelect:(L,F)=>{i(F?n.includes(L)?n.filter(Z=>Z!==L):[...n,L]:[L])},onDelete:L=>s([L]),onDropTargetChange:A,onDirectDragStart:V,zoom:S,geometryScale:v})})})}),o.jsx(cs,{container:oe.current,dragContainer:we.current,selectableTargets:[".freeform-node"],selectByClick:!1,selectFromInside:!1,continueSelectWithoutDeselect:!0,toggleContinueSelect:["shift"],hitRate:20,onSelect:L=>{const F=L.selected.map(Z=>Z.dataset.nodeId).filter(Z=>!!Z);i(F)}}),o.jsx(ls,{ref:he,target:H,draggable:!1,resizable:!0,renderDirections:["nw","ne","e","se","s","sw","w"],snappable:!0,snapThreshold:6,elementGuidelines:Array.from(((ut=oe.current)==null?void 0:ut.querySelectorAll(".freeform-node"))??[]),verticalGuidelines:[0,z.width/2,z.width],horizontalGuidelines:[0,z.height/2,z.height],bounds:{left:0,top:0,right:z.width,bottom:z.height},origin:!1,keepRatio:!1,throttleResize:1,onResizeStart:L=>{L.setOrigin(["%","%"]),L.dragStart&&L.dragStart.set([0,0])},onResize:L=>{const F=L.target.dataset.nodeId;if(!F)return;const[Z,ie]=L.drag.beforeTranslate;ae.current.set(F,{width:L.width,height:L.height,x:Z,y:ie}),L.target.style.width=`${L.width}px`,L.target.style.height=`${L.height}px`,L.target.style.transform=`translate(${Z}px, ${ie}px)`},onResizeEnd:()=>Qe(),onResizeGroupStart:L=>L.events.forEach(F=>{F.setOrigin(["%","%"]),F.dragStart&&F.dragStart.set([0,0])}),onResizeGroup:L=>L.events.forEach(F=>{const Z=F.target.dataset.nodeId;if(!Z)return;const[ie,ue]=F.drag.beforeTranslate;ae.current.set(Z,{width:F.width,height:F.height,x:ie,y:ue}),F.target.style.width=`${F.width}px`,F.target.style.height=`${F.height}px`,F.target.style.transform=`translate(${ie}px, ${ue}px)`}),onResizeGroupEnd:()=>Qe()},`${p}:${te}`)]});function Qe(){const L=[];for(const[F,Z]of ae.current.entries()){const ie=Q==null?void 0:Q.byId.get(F),ue=ie?$t(ie,p):null;ue&&L.push({id:F,viewportId:p,patch:{width:(Z.width??ue.width)/v,height:(Z.height??ue.height)/v,x:ue.x+(Z.x??0)/v,y:ue.y+(Z.y??0)/v}})}H.forEach(F=>{F.style.transform=""}),ae.current.clear(),L.length&&u(L)}});function Ui({node:t,tree:e,selectedIds:n,dropTargetId:r,viewportId:i,language:a,designSystem:s,isRoot:c=!1,onSelect:u,onDelete:d,onDropTargetChange:l,onDirectDragStart:m,zoom:g,geometryScale:$}){var y,w,A;const k=e.childrenById.get(t.id)??[],j=qe(t.type),_=n.includes(t.id),b=t.parent_id?e.byId.get(t.parent_id):null,f=((y=b==null?void 0:b.layout)==null?void 0:y.mode)==="freeform",x=f?$t(t,i):null,C=t.type==="sidebar"&&(b==null?void 0:b.type)==="app_shell",p={...Bh(t),...Uh(t,s),...x?Hh(x,$):{}},h=((w=t.layout)==null?void 0:w.mode)==="freeform"?{position:"relative",width:"100%",height:"100%"}:Vh(t,k.length>0);return o.jsxs("div",{className:["preview-node",`preview-${t.type}`,_?"selected":"",c?"is-root":"",j?"can-contain":"is-leaf",r===t.id?"drop-target":"",f?"freeform-node":"",t.type==="sidebar"?C?"app-sidebar":"page-sidebar":""].filter(Boolean).join(" "),"data-node-id":t.id,"data-parent-id":t.parent_id??"","data-type":t.type,"data-name":t.name,style:p,onClick:S=>{S.stopPropagation(),u(t.id,S.shiftKey||S.metaKey||S.ctrlKey)},onDragOver:S=>{j&&(S.preventDefault(),S.stopPropagation(),l(t.id))},onDragLeave:S=>{S.target===S.currentTarget&&l(null)},children:[!c&&t.parent_id!==null&&o.jsx("button",{type:"button",className:"preview-drag-handle","aria-label":T(a,"dragComponent",{component:t.name}),title:T(a,"dragComponentHint",{component:t.name}),onPointerDown:S=>m(t.id,S),onClick:S=>S.stopPropagation(),children:o.jsx(Hd,{})}),!c&&t.parent_id!==null&&o.jsx("button",{className:"preview-delete-button","aria-label":`${T(a,"delete")} ${t.name}`,onClick:S=>{S.stopPropagation(),d(t.id)},children:T(a,"delete")}),j?o.jsxs(o.Fragment,{children:[Jh(t,a,C),o.jsx("div",{className:`preview-children${((A=t.layout)==null?void 0:A.mode)==="freeform"?" freeform-surface":""}`,style:h,children:k.length?k.map(S=>o.jsx(Ui,{node:S,tree:e,selectedIds:n,dropTargetId:r,viewportId:i,language:a,designSystem:s,onSelect:u,onDelete:d,onDropTargetChange:l,onDirectDragStart:m,zoom:g,geometryScale:$},S.id)):Kh(t,a,C)})]}):Wh(t,a)]})}function Th(t){const e=new Map(t.nodes.map(i=>[i.id,i])),n=t.nodes.find(i=>i.parent_id===null)??null,r=new Map;for(const i of t.nodes){const a=(i.children??[]).map(c=>e.get(c)).filter(c=>!!c),s=t.nodes.filter(c=>c.parent_id===i.id&&!a.some(u=>u.id===c.id));r.set(i.id,[...a,...s])}return{byId:e,childrenById:r,root:n}}function Yo(t,e,n){let r=n.byId.get(t);for(;r;){if(r.id===e)return!0;r=r.parent_id?n.byId.get(r.parent_id):void 0}return!1}function Zo(t,e){const n=t.dataTransfer.getData("application/aub-component-type")||t.dataTransfer.getData("text/plain")||e||"";return Ei(n)?n:null}function Ih(t,e=t.height){return{width:t.width,height:Math.max(t.height,Math.round(e))}}function Mh(t,e,n,r,i){const a=n==null?void 0:n.getBoundingClientRect();return a?{x:Math.max(0,Math.round((t-a.left)/r/i)),y:Math.max(0,Math.round((e-a.top)/r/i))}:{x:32,y:32}}function Oh(t,e,n=0){return!(t.x+t.width+n<=e.x||e.x+e.width+n<=t.x||t.y+t.height+n<=e.y||e.y+e.height+n<=t.y)}function zh(t,e,n){const i=[],a=t.getBoundingClientRect(),s=new Map(e.nodes.map(m=>[m.id,m])),c=new Set(e.responsive.filter(m=>m.viewport===n&&m.rule==="scroll").map(m=>m.target_node_id)),u=Array.from(t.querySelectorAll(".preview-node[data-node-id]:not(.is-root)")).filter(m=>{const g=m.getBoundingClientRect();return g.width>0&&g.height>0});for(const m of u){const g=m.dataset.nodeId;if(!g)continue;const $=m.getBoundingClientRect();!Dh(m,t)&&($.left<a.left-2||$.right>a.right+2||$.top<a.top-2||$.bottom>a.bottom+2)&&i.push({viewportId:n,type:"viewport-overflow",nodeIds:[g]});const k=s.get(g),j=m.querySelector(":scope > .preview-children");j&&(k==null?void 0:k.type)!=="scroll_area"&&!c.has(g)&&j.scrollWidth>j.clientWidth+2&&i.push({viewportId:n,type:"horizontal-overflow",nodeIds:[g]});const _=qh(k==null?void 0:k.type,n);_>0&&m.clientWidth<_&&i.push({viewportId:n,type:"undersized",nodeIds:[g]})}const d=new Map;for(const m of u.filter(g=>g.classList.contains("freeform-node"))){const g=m.dataset.parentId;g&&d.set(g,[...d.get(g)??[],m])}const l=new Set(["modal","drawer","toast"]);for(const m of d.values())for(let g=0;g<m.length;g+=1){const $=m[g],k=s.get($.dataset.nodeId??""),j=$.getBoundingClientRect();for(let _=g+1;_<m.length;_+=1){const b=m[_],f=s.get(b.dataset.nodeId??"");if(!k||!f||l.has(k.type)||l.has(f.type))continue;const x=b.getBoundingClientRect(),C=Math.max(0,Math.min(j.right,x.right)-Math.max(j.left,x.left)),p=Math.max(0,Math.min(j.bottom,x.bottom)-Math.max(j.top,x.top)),h=C*p,y=Math.min(j.width*j.height,x.width*x.height),w=Number.parseInt(getComputedStyle($).zIndex||"1",10),A=Number.parseInt(getComputedStyle(b).zIndex||"1",10);y>0&&h/y>=.15&&w===A&&i.push({viewportId:n,type:"overlap",nodeIds:[k.id,f.id]})}}return Lh(i)}function Dh(t,e){let n=t.parentElement;for(;n&&n!==e;){const r=getComputedStyle(n);if((["auto","scroll"].includes(r.overflowX)||["auto","scroll"].includes(r.overflowY))&&(n.scrollWidth>n.clientWidth+2||n.scrollHeight>n.clientHeight+2))return!0;n=n.parentElement}return!1}function qh(t,e){return e!=="mobile"?0:t==="kanban_column"?160:t==="data_table"?300:t==="split_pane"?280:0}function Lh(t){const e=new Set;return t.filter(n=>{const r=`${n.viewportId}:${n.type}:${n.nodeIds.slice().sort().join(",")}`;return e.has(r)?!1:(e.add(r),!0)})}function Hh(t,e){return{position:"absolute",left:t.x*e,top:t.y*e,width:t.width*e,height:t.height*e,zIndex:t.z_index??1,minWidth:0,minHeight:0}}function Bh(t){var n,r,i,a;const e={};return(n=t.layout)!=null&&n.width&&(e.width=Qn(t.layout.width)),(r=t.layout)!=null&&r.height&&(e.height=Qn(t.layout.height)),(i=t.layout)!=null&&i.min_width&&(e.minWidth=Qn(t.layout.min_width)),(a=t.layout)!=null&&a.max_width&&(e.maxWidth=Qn(t.layout.max_width)),e}function Vh(t,e){var n;return t.type==="app_shell"&&((n=t.layout)==null?void 0:n.mode)!=="auto"?{}:Fh(t.layout,t.type,e)}function Fh(t,e,n){var i,a;const r={};return(t==null?void 0:t.display)==="grid"||e==="grid"?(r.display="grid",r.gridTemplateColumns=((i=t==null?void 0:t.grid)==null?void 0:i.template)??`repeat(${((a=t==null?void 0:t.grid)==null?void 0:a.columns)??3}, minmax(0, 1fr))`):((t==null?void 0:t.display)==="flex"||n)&&(r.display="flex",r.flexDirection=(t==null?void 0:t.direction)??"column",r.flexWrap=t!=null&&t.wrap?"wrap":void 0),t!=null&&t.align&&(r.alignItems={start:"flex-start",center:"center",end:"flex-end",stretch:"stretch",baseline:"baseline"}[t.align]),t!=null&&t.justify&&(r.justifyContent={start:"flex-start",center:"center",end:"flex-end","space-between":"space-between","space-around":"space-around","space-evenly":"space-evenly"}[t.justify]),t!=null&&t.gap&&(r.gap=`${t.gap.y??t.gap.x??12}px ${t.gap.x??t.gap.y??12}px`),t!=null&&t.padding&&(r.padding=`${t.padding.top??0}px ${t.padding.right??0}px ${t.padding.bottom??0}px ${t.padding.left??0}px`),r}function Uh(t,e){var r,i,a,s,c,u,d;const n=(l,m)=>{const g=e==null?void 0:e[l];return m&&g&&typeof g=="object"?g[m]:void 0};return{background:n("colors",(r=t.style)==null?void 0:r.background),color:n("colors",(i=t.style)==null?void 0:i.foreground),borderColor:n("colors",(a=t.style)==null?void 0:a.border),font:n("typography",(s=t.style)==null?void 0:s.typography),borderRadius:n("radii",(c=t.style)==null?void 0:c.radius),boxShadow:n("shadows",(u=t.style)==null?void 0:u.shadow),opacity:(d=t.style)==null?void 0:d.opacity}}function Qn(t){return`${t.value}${t.unit}`}function Jh(t,e,n){var r,i;return["page","app_shell","stack","grid","card"].includes(t.type)?null:o.jsxs("div",{className:"preview-container-title",children:[o.jsx("span",{children:((r=t.content)==null?void 0:r.label)??((i=t.content)==null?void 0:i.text)??t.name}),t.type==="sidebar"&&o.jsx("small",{children:T(e,n?"appSidebarLabel":"pageSidebarLabel")})]})}function Kh(t,e,n){const r=t.type==="sidebar"?T(e,n?"navigationItems":"pageSidebarItems"):T(e,"dropComponents");return o.jsx("div",{className:"preview-empty-slot",children:r})}function Wh(t,e){var r;const n=t.content??{};switch(t.type){case"heading":return o.jsx("h2",{className:"mock heading",children:n.text??t.name});case"text":return o.jsx("p",{className:"mock text",children:n.text??t.name});case"image":return n.src?o.jsx("img",{className:"mock image",src:n.src,alt:n.alt??t.name}):o.jsx("div",{className:"mock image-placeholder",children:n.alt??t.name});case"avatar":return o.jsx("div",{className:"mock avatar",children:(n.alt??t.name).slice(0,2).toUpperCase()});case"icon":return o.jsx("div",{className:"mock icon",children:n.icon??"●"});case"badge":case"tag":return o.jsx("span",{className:`mock ${t.type} ${n.variant??""}`,children:n.text??t.name});case"divider":return o.jsx("hr",{className:"mock divider"});case"link":return o.jsx("span",{className:"mock link",children:n.text??t.name});case"metric_card":return o.jsxs("div",{className:"mock metric-card",children:[o.jsx("span",{children:n.label??t.name}),o.jsx("strong",{children:n.value??Zh(n.data_binding)??"42.8k"}),o.jsx("small",{children:"+12.4%"})]});case"data_table":return o.jsx(Gh,{node:t,language:e});case"chart_placeholder":return o.jsxs("div",{className:"mock chart",children:[o.jsx("span",{children:n.label??t.name}),o.jsx("div",{className:"chart-bars",children:[42,64,48,78,58,86,68,92].map((i,a)=>o.jsx("i",{style:{height:`${i}%`}},a))})]});case"calendar":return o.jsx(Yh,{language:e});case"text_input":case"search_input":case"textarea":case"date_picker":case"file_upload":return o.jsxs("label",{className:`mock input ${t.type}`,children:[o.jsx("span",{children:n.label??t.name}),o.jsx("em",{children:n.placeholder??T(e,"enterValue")}),n.helper_text&&o.jsx("small",{children:n.helper_text})]});case"select":return o.jsxs("label",{className:"mock input select",children:[o.jsx("span",{children:n.label??t.name}),o.jsx("em",{children:n.placeholder??T(e,"chooseOption")})]});case"checkbox":case"toggle":case"radio_group":return o.jsxs("div",{className:`mock choice ${t.type}`,children:[o.jsx("i",{}),o.jsx("span",{children:n.label??t.name})]});case"button":case"icon_button":return o.jsx("div",{className:`mock button ${n.variant??((r=t.style)==null?void 0:r.variant)??""}`,children:n.label??n.text??t.name});case"menu":return o.jsxs("div",{className:"mock menu-button",children:[n.label??t.name,o.jsx("span",{children:"⌄"})]});case"nav_item":return o.jsx("div",{className:"mock nav-item",children:n.label??t.name});case"breadcrumb":return o.jsxs("div",{className:"mock breadcrumb",children:[T(e,"home")," / ",n.label??t.name]});case"pagination":return o.jsxs("div",{className:"mock pagination",children:[o.jsx("span",{children:"1"}),o.jsx("span",{children:"2"}),o.jsx("span",{children:"3"})]});default:return o.jsx("div",{className:`mock generic ${t.type}`,children:n.text??n.label??t.name})}}function Gh({node:t,language:e}){var r,i,a;const n=(i=(r=t.content)==null?void 0:r.columns)!=null&&i.length?t.content.columns:[{id:"name",header:T(e,"defaultColumnName")},{id:"status",header:T(e,"defaultColumnStatus")},{id:"amount",header:T(e,"defaultColumnAmount")}];return o.jsxs("div",{className:"mock data-table",children:[o.jsx("div",{className:"table-title",children:((a=t.content)==null?void 0:a.label)??t.name}),o.jsxs("div",{className:"table-grid",style:{gridTemplateColumns:`repeat(${n.length}, minmax(72px, 1fr))`},children:[n.map(s=>o.jsx("strong",{children:s.header},s.id)),Array.from({length:n.length*4},(s,c)=>o.jsx("span",{children:c%n.length===0?`${T(e,"row")} ${Math.floor(c/n.length)+1}`:"—"},c))]})]})}function Yh({language:t}){const e=t==="zh-Hant"?["一","二","三","四","五","六","日"]:["M","T","W","T","F","S","S"];return o.jsxs("div",{className:"mock calendar",children:[e.map(n=>o.jsx("strong",{children:n},n)),Array.from({length:35},(n,r)=>o.jsx("span",{children:r<30?r+1:""},r))]})}function Zh(t){return t?(t.split(".").at(-1)??t).replace(/_/g," "):null}function Je({icon:t,label:e,disabled:n,onClick:r}){return o.jsx(xt,{label:e,children:o.jsx("button",{type:"button",className:"icon-button","aria-label":e,title:e,disabled:n,onClick:r,children:t})})}function Xh(t){return t instanceof HTMLElement?["input","textarea","select"].includes(t.tagName.toLowerCase())||t.isContentEditable:!1}function er(){return new Promise(t=>requestAnimationFrame(()=>requestAnimationFrame(()=>t())))}function Qh({blueprint:t,node:e,selectedCount:n,language:r,onUpdate:i,onUpdatePlacement:a,onDelete:s,onSelectParent:c,onReparent:u,onCollapse:d}){var f,x,C,p,h,y,w,A,S,O,H,B,W,ae,oe,we,he,Q,Y,M,U,z,v,N;const[l,m]=G.useState("content"),[g,$]=G.useState("desktop");if(!e)return o.jsxs("aside",{className:"panel properties",children:[o.jsx(Xo,{language:r,onCollapse:d}),o.jsx("p",{className:"empty",children:n>1?T(r,"multipleSelected",{count:n}):T(r,"selectNode")})]});const k=e.parent_id!==null,j=((f=e.placements)==null?void 0:f[g])??((x=e.placements)==null?void 0:x.desktop)??((C=e.placements)==null?void 0:C.tablet)??((p=e.placements)==null?void 0:p.mobile)??((h=e.placements)==null?void 0:h.wide),_=t?nm(t,e.id):new Set,b=(t==null?void 0:t.nodes.filter(E=>qe(E.type)&&E.id!==e.id&&!_.has(E.id)))??[];return o.jsxs("aside",{className:"panel properties",children:[o.jsx(Xo,{language:r,onCollapse:d}),o.jsxs("div",{className:"selected-summary",children:[o.jsxs("div",{children:[o.jsx("strong",{children:e.name}),o.jsx("span",{children:ft(r,e.type)})]}),o.jsx(xt,{label:T(r,"deleteComponent"),align:"end",children:o.jsx("button",{type:"button",className:"danger-icon","aria-label":T(r,"deleteComponent"),disabled:!k,onClick:s,children:o.jsx(ur,{})})})]}),o.jsx("div",{className:"property-tabs",children:["content","layout","appearance","interaction"].map(E=>o.jsx("button",{type:"button",className:l===E?"active":"",onClick:()=>m(E),children:T(r,`propertyTab.${E}`)},E))}),l==="content"&&o.jsxs("div",{className:"property-section",children:[o.jsx(Xe,{label:T(r,"name"),children:o.jsx("input",{value:e.name,onChange:E=>i({name:E.target.value})})}),o.jsx(Xe,{label:T(r,"type"),children:o.jsx(em,{language:r,value:e.type,hasChildren:(((y=e.children)==null?void 0:y.length)??0)>0,onChange:E=>i({type:E,children:qe(E)?e.children??[]:[],layout:qe(E)?St(E):void 0})})}),o.jsx(Xe,{label:T(r,"role"),children:o.jsx("textarea",{value:e.role,onChange:E=>i({role:E.target.value})})}),o.jsx(Rt,{label:T(r,"contentText"),value:(w=e.content)==null?void 0:w.text,onChange:E=>i({content:{...e.content,text:E}})}),o.jsx(Rt,{label:T(r,"contentLabel"),value:(A=e.content)==null?void 0:A.label,onChange:E=>i({content:{...e.content,label:E}})}),o.jsx(Rt,{label:T(r,"placeholder"),value:(S=e.content)==null?void 0:S.placeholder,onChange:E=>i({content:{...e.content,placeholder:E}})}),(e.type==="image"||e.type==="avatar")&&o.jsxs(o.Fragment,{children:[o.jsx(Rt,{label:T(r,"sourceUrl"),value:(O=e.content)==null?void 0:O.src,onChange:E=>i({content:{...e.content,src:E}})}),o.jsx(Rt,{label:T(r,"altText"),value:(H=e.content)==null?void 0:H.alt,onChange:E=>i({content:{...e.content,alt:E}})})]}),o.jsxs("details",{className:"advanced-json",children:[o.jsx("summary",{children:T(r,"advancedJson")}),o.jsx(Tr,{value:e.content??null,onChange:E=>i({content:E})})]})]}),l==="layout"&&o.jsxs("div",{className:"property-section",children:[e.parent_id&&o.jsx("button",{type:"button",className:"select-parent-button",onClick:c,children:T(r,"selectParent")}),e.parent_id&&o.jsx(Xe,{label:T(r,"parentContainer"),children:o.jsx("select",{value:e.parent_id,onChange:E=>u(E.target.value),children:b.map(E=>o.jsxs("option",{value:E.id,children:[E.name," · ",ft(r,E.type)]},E.id))})}),qe(e.type)&&o.jsx(tm,{layout:e.layout,language:r,onChange:E=>i({layout:E})}),j&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"viewport-property-tabs",children:((t==null?void 0:t.viewports)??[]).map(E=>o.jsx("button",{className:g===E.id?"active":"",onClick:()=>$(E.id),children:Ni(r,E.id)},E.id))}),o.jsxs("div",{className:"geometry-grid",children:[["x","y","width","height"].map(E=>o.jsx(Xe,{label:E.toUpperCase(),children:o.jsx("input",{type:"number",value:Math.round(j[E]),onChange:te=>a(g,{[E]:Number(te.target.value)})})},E)),o.jsx(Xe,{label:T(r,"zIndex"),children:o.jsx("input",{type:"number",value:j.z_index??1,onChange:E=>a(g,{z_index:Number(E.target.value)})})})]})]}),o.jsxs("details",{className:"advanced-json",children:[o.jsx("summary",{children:T(r,"advancedJson")}),o.jsx(Tr,{value:e.layout??null,onChange:E=>i({layout:E})})]})]}),l==="appearance"&&o.jsxs("div",{className:"property-section",children:[o.jsx(Xt,{label:T(r,"backgroundToken"),value:(B=e.style)==null?void 0:B.background,options:(W=t==null?void 0:t.design_system)==null?void 0:W.colors,onChange:E=>i({style:{...e.style,background:E}})}),o.jsx(Xt,{label:T(r,"foregroundToken"),value:(ae=e.style)==null?void 0:ae.foreground,options:(oe=t==null?void 0:t.design_system)==null?void 0:oe.colors,onChange:E=>i({style:{...e.style,foreground:E}})}),o.jsx(Xt,{label:T(r,"typographyToken"),value:(we=e.style)==null?void 0:we.typography,options:(he=t==null?void 0:t.design_system)==null?void 0:he.typography,onChange:E=>i({style:{...e.style,typography:E}})}),o.jsx(Xt,{label:T(r,"radiusToken"),value:(Q=e.style)==null?void 0:Q.radius,options:(Y=t==null?void 0:t.design_system)==null?void 0:Y.radii,onChange:E=>i({style:{...e.style,radius:E}})}),o.jsx(Xt,{label:T(r,"shadowToken"),value:(M=e.style)==null?void 0:M.shadow,options:(U=t==null?void 0:t.design_system)==null?void 0:U.shadows,onChange:E=>i({style:{...e.style,shadow:E}})}),o.jsx(Rt,{label:T(r,"variant"),value:(z=e.style)==null?void 0:z.variant,onChange:E=>i({style:{...e.style,variant:E}})}),o.jsx(Xe,{label:T(r,"opacity"),children:o.jsx("input",{type:"range",min:"0",max:"1",step:"0.05",value:((v=e.style)==null?void 0:v.opacity)??1,onChange:E=>i({style:{...e.style,opacity:Number(E.target.value)}})})}),o.jsxs("details",{className:"advanced-json",children:[o.jsx("summary",{children:T(r,"advancedJson")}),o.jsx(Tr,{value:e.style??null,onChange:E=>i({style:E})})]})]}),l==="interaction"&&o.jsxs("div",{className:"property-section",children:[o.jsx(Rt,{label:T(r,"actionIntent"),value:(N=e.content)==null?void 0:N.action,onChange:E=>i({content:{...e.content,action:E}})}),o.jsx(Xe,{label:T(r,"supportedStates"),children:o.jsx("div",{className:"state-options",children:["default","hover","focus","active","disabled","loading","empty","error","selected"].map(E=>{var te;return o.jsxs("label",{children:[o.jsx("input",{type:"checkbox",checked:((te=e.states)==null?void 0:te.includes(E))??!1,onChange:ee=>i({states:ee.target.checked?[...e.states??[],E]:(e.states??[]).filter(se=>se!==E)})}),Sp(r,E)]},E)})})}),o.jsxs("div",{className:"interaction-list",children:[o.jsx("strong",{children:T(r,"declaredInteractions")}),((t==null?void 0:t.interactions.filter(E=>E.source_node_id===e.id))??[]).map(E=>o.jsxs("div",{children:[o.jsx("span",{children:E.trigger}),o.jsx("code",{children:E.action}),o.jsx("small",{children:E.result_state})]},E.id)),!(t!=null&&t.interactions.some(E=>E.source_node_id===e.id))&&o.jsx("p",{className:"empty",children:T(r,"noDeclaredInteractions")})]})]})]})}function Xo({language:t,onCollapse:e}){const n=T(t,"hideProperties");return o.jsxs("div",{className:"properties-header",children:[o.jsx("h2",{children:T(t,"properties")}),o.jsx(xt,{label:n,align:"end",children:o.jsx("button",{type:"button",className:"icon-button","aria-label":n,title:n,onClick:e,children:o.jsx(gd,{})})})]})}function Xe({label:t,children:e}){return o.jsxs("label",{className:"field",children:[o.jsx("span",{children:t}),e]})}function Rt({label:t,value:e,onChange:n}){return o.jsx(Xe,{label:t,children:o.jsx("input",{value:e??"",onChange:r=>n(r.target.value)})})}function Xt({label:t,value:e,options:n,onChange:r}){return o.jsx(Xe,{label:t,children:o.jsxs("select",{value:e??"",onChange:i=>r(i.target.value||void 0),children:[o.jsx("option",{value:"",children:"—"}),Object.entries(n??{}).map(([i,a])=>o.jsxs("option",{value:i,children:[i," · ",a]},i))]})})}function em({language:t,value:e,hasChildren:n,onChange:r}){const i=[["app_shell","page","section","header","sidebar","top_bar","bottom_nav","stack","grid","split_pane","scroll_area"],["heading","text","card","image","icon","avatar","badge","tag","divider","link"],["metric_card","data_table","list","detail_panel","chart_placeholder","timeline","activity_feed","calendar","kanban_board","kanban_column"],["form","field_group","text_input","textarea","search_input","select","checkbox","radio_group","toggle","slider","date_picker","file_upload","rich_text_editor"],["button","icon_button","button_group","menu","toolbar","command_palette"],["modal","drawer","toast","alert","empty_state","loading_state","error_state"],["tabs","breadcrumb","pagination","stepper","nav_item"]];return o.jsx("select",{value:e,onChange:a=>r(a.target.value),children:i.flat().map(a=>o.jsx("option",{value:a,disabled:n&&!qe(a),children:ft(t,a)},a))})}function tm({layout:t,language:e,onChange:n}){var a,s,c;const r=(t==null?void 0:t.display)==="grid"?"grid":(t==null?void 0:t.direction)==="row"?"row":"column",i=u=>n({...t,...u,mode:(t==null?void 0:t.mode)??"auto"});return o.jsxs("fieldset",{className:"layout-controls",children:[o.jsx("legend",{children:T(e,"layoutControls")}),o.jsx("div",{className:"layout-mode-buttons",children:["column","row","grid"].map(u=>o.jsx("button",{type:"button",className:r===u?"active":"",onClick:()=>i(u==="grid"?{display:"grid",direction:void 0,grid:(t==null?void 0:t.grid)??{columns:2}}:{display:"flex",direction:u,grid:void 0}),children:T(e,u==="column"?"layoutVertical":u==="row"?"layoutHorizontal":"layoutGrid")},u))}),o.jsxs("div",{className:"layout-control-grid",children:[o.jsx(Xe,{label:T(e,"layoutHorizontalGap"),children:o.jsx("input",{type:"number",min:"0",value:((a=t==null?void 0:t.gap)==null?void 0:a.x)??12,onChange:u=>i({gap:{...t==null?void 0:t.gap,x:Number(u.target.value)}})})}),o.jsx(Xe,{label:T(e,"layoutVerticalGap"),children:o.jsx("input",{type:"number",min:"0",value:((s=t==null?void 0:t.gap)==null?void 0:s.y)??12,onChange:u=>i({gap:{...t==null?void 0:t.gap,y:Number(u.target.value)}})})}),r==="grid"&&o.jsx(Xe,{label:T(e,"layoutColumns"),children:o.jsx("input",{type:"number",min:"1",max:"24",value:((c=t==null?void 0:t.grid)==null?void 0:c.columns)??2,onChange:u=>i({grid:{...t==null?void 0:t.grid,columns:Number(u.target.value)}})})})]})]})}function Tr({value:t,onChange:e}){const[n,r]=G.useState(JSON.stringify(t,null,2)),[i,a]=G.useState("");return o.jsxs(o.Fragment,{children:[o.jsx("textarea",{value:n,onChange:s=>{r(s.target.value);try{e(JSON.parse(s.target.value)),a("")}catch(c){a(c.message)}}}),i&&o.jsx("small",{className:"json-error",children:i})]})}function nm(t,e){const n=new Set,r=i=>{const a=t.nodes.find(s=>s.id===i);for(const s of(a==null?void 0:a.children)??[])n.has(s)||(n.add(s),r(s))};return r(e),n}const rm=[{id:"brief",icon:o.jsx(zd,{}),en:"Goal",zh:"畫面目標"},{id:"layout",icon:o.jsx(bi,{}),en:"Layout",zh:"畫面佈局"},{id:"interactions",icon:o.jsx(Yd,{}),en:"Interactions",zh:"互動行為"},{id:"responsive",icon:o.jsx(iu,{}),en:"Responsive",zh:"響應式"},{id:"acceptance",icon:o.jsx(du,{}),en:"Acceptance",zh:"驗收條件"},{id:"handoff",icon:o.jsx(Cd,{}),en:"Handoff",zh:"AI 交付"}];function am({blueprint:t,language:e,stage:n,savedAt:r,errorCount:i,viewportQuality:a,onChange:s}){const c=t?Ji(t,a):null,u=r?e==="zh-Hant"?`已自動儲存 ${new Date(r).toLocaleTimeString("zh-TW",{hour:"2-digit",minute:"2-digit"})}`:`Autosaved ${new Date(r).toLocaleTimeString("en",{hour:"2-digit",minute:"2-digit"})}`:e==="zh-Hant"?"尚未建立草稿":"No draft yet";return o.jsxs("nav",{className:"workflow-bar","aria-label":e==="zh-Hant"?"UI 藍圖工作流程":"UI Blueprint workflow",children:[o.jsx("div",{className:"workflow-steps",children:rm.map((d,l)=>{const m=(c==null?void 0:c[d.id])??!1;return o.jsxs("button",{type:"button",className:`${n===d.id?"active":""}${m?" complete":""}`,disabled:!t&&d.id!=="layout",onClick:()=>s(d.id),children:[o.jsx("span",{className:"workflow-index",children:m?"✓":l+1}),d.icon,o.jsx("span",{children:e==="zh-Hant"?d.zh:d.en})]},d.id)})}),o.jsxs("div",{className:`autosave-status${i?" has-errors":""}`,children:[o.jsx("span",{className:"autosave-dot"}),o.jsx("span",{children:i?e==="zh-Hant"?`${i} 個問題待修正`:`${i} issues`:u})]})]})}function Ji(t,e=void 0){const n=new Set(t.acceptance.map(d=>d.type)),r=!!(t.screen.name.trim()&&t.screen.primary_user_goal.trim()&&!t.screen.primary_user_goal.toLowerCase().startsWith("describe ")&&!t.screen.primary_user_goal.startsWith("描述")),i=t.nodes.length>1,a=t.interactions.length>0,s=e===void 0?!0:e!==null&&e.issues.length===0,c=t.responsive.length>0&&s,u=t.acceptance.length>=5&&["layout","interaction","responsive","a11y"].every(d=>n.has(d));return{brief:r,layout:i,interactions:a,responsive:c,acceptance:u,handoff:r&&i&&a&&c&&u}}function om({blueprint:t,language:e,stage:n,errorCount:r,viewportQuality:i,onChange:a,onExportJson:s,onExportMarkdown:c,onExportAgentPrompt:u,onExportPackage:d}){const l=It[e];return o.jsxs("aside",{className:"blueprint-panel",children:[o.jsxs("header",{children:[o.jsxs("div",{children:[o.jsx("span",{children:l.workflow}),o.jsx("h2",{children:l.stageTitles[n]})]}),o.jsx("small",{children:l.stageDescriptions[n]})]}),o.jsxs("div",{className:"blueprint-panel-content",children:[n==="brief"&&o.jsx(im,{blueprint:t,language:e,onChange:a}),n==="interactions"&&o.jsx(sm,{blueprint:t,language:e,onChange:a}),n==="responsive"&&o.jsx(cm,{blueprint:t,language:e,viewportQuality:i,onChange:a}),n==="acceptance"&&o.jsx(lm,{blueprint:t,language:e,onChange:a}),n==="handoff"&&o.jsx(dm,{blueprint:t,language:e,errorCount:r,viewportQuality:i,onExportJson:s,onExportMarkdown:c,onExportAgentPrompt:u,onExportPackage:d})]})]})}function im({blueprint:t,language:e,onChange:n}){const r=It[e],i=a=>n({screen:{...t.screen,...a}});return o.jsxs("div",{className:"spec-form",children:[o.jsx(Ie,{label:r.screenName,children:o.jsx("input",{value:t.screen.name,onChange:a=>i({name:a.target.value})})}),o.jsx(Ie,{label:r.screenId,children:o.jsx("input",{value:t.screen.id,onChange:a=>i({id:hm(a.target.value)})})}),o.jsxs("div",{className:"spec-two-columns",children:[o.jsx(Ie,{label:r.screenType,children:o.jsx("select",{value:t.screen.type,onChange:a=>i({type:a.target.value}),children:mm.map(a=>o.jsx("option",{value:a,children:wm(e,a)},a))})}),o.jsx(Ie,{label:r.platform,children:o.jsx("select",{value:t.screen.platform,onChange:a=>i({platform:a.target.value}),children:fm.map(a=>o.jsx("option",{value:a,children:$m(e,a)},a))})})]}),o.jsx(Ie,{label:r.primaryGoal,hint:r.primaryGoalHint,children:o.jsx("textarea",{value:t.screen.primary_user_goal,onChange:a=>i({primary_user_goal:a.target.value})})}),o.jsx(Ie,{label:r.agentNotes,hint:r.agentNotesHint,children:o.jsx("textarea",{value:t.screen.notes??"",onChange:a=>i({notes:a.target.value||void 0})})})]})}function sm({blueprint:t,language:e,onChange:n}){const r=It[e],i=(u,d)=>{const l=t.interactions.map((m,g)=>g===u?{...m,...d}:m);n({interactions:l})},a=u=>n({interactions:t.interactions.filter((d,l)=>l!==u)}),s=()=>{const u=t.nodes.find(d=>d.parent_id!==null)??t.nodes[0];n({interactions:[...t.interactions,{id:Wi("interaction",t.interactions.map(d=>d.id)),trigger:"click",source_node_id:(u==null?void 0:u.id)??"root",action:"navigate:/",target:"/",result_state:r.defaultResult}]})},c=()=>{const{interactions:u}=Di(t,{language:e});n({interactions:u})};return o.jsx(Kr,{title:r.interactionsTitle,empty:r.noInteractions,addLabel:r.addInteraction,count:t.interactions.length,suggestLabel:r.suggestFromLayout,onSuggest:c,onAdd:s,children:t.interactions.map((u,d)=>o.jsxs(Wr,{title:`${d+1}. ${u.id}`,deleteLabel:r.deleteItem,onDelete:()=>a(d),children:[o.jsxs("div",{className:"spec-two-columns",children:[o.jsx(Ie,{label:r.trigger,children:o.jsx("select",{value:u.trigger,onChange:l=>i(d,{trigger:l.target.value}),children:ym.map(l=>o.jsx("option",{value:l,children:xm(e,l)},l))})}),o.jsx(Ie,{label:r.sourceComponent,children:o.jsx("select",{value:u.source_node_id,onChange:l=>i(d,{source_node_id:l.target.value}),children:t.nodes.map(l=>o.jsxs("option",{value:l.id,children:[l.name," · ",ft(e,l.type)]},l.id))})})]}),o.jsx(Ie,{label:r.actionIntent,children:o.jsx("input",{value:u.action,onChange:l=>i(d,{action:l.target.value})})}),o.jsx(Ie,{label:r.target,children:o.jsx("input",{value:u.target??"",onChange:l=>i(d,{target:l.target.value||void 0})})}),o.jsx(Ie,{label:r.resultState,hint:r.resultStateHint,children:o.jsx("textarea",{value:u.result_state,onChange:l=>i(d,{result_state:l.target.value})})})]},u.id))})}function cm({blueprint:t,language:e,viewportQuality:n,onChange:r}){const i=It[e],a=(u,d)=>r({responsive:t.responsive.map((l,m)=>m===u?{...l,...d}:l)}),s=()=>{var u;return r({responsive:[...t.responsive,{viewport:"mobile",rule:"stack",target_node_id:((u=t.nodes[0])==null?void 0:u.id)??"root",changes:{}}]})},c=()=>{const{responsive:u}=Up(t);r({responsive:u})};return o.jsxs("div",{className:"responsive-editor",children:[o.jsx(Ki,{blueprint:t,language:e,report:n}),o.jsx(Kr,{title:i.responsiveTitle,empty:i.noResponsive,addLabel:i.addResponsive,count:t.responsive.length,suggestLabel:i.suggestFromLayout,onSuggest:c,onAdd:s,children:t.responsive.map((u,d)=>o.jsxs(Wr,{title:`${d+1}. ${qr(e,u.viewport)} · ${Qo(e,u.rule)}`,deleteLabel:i.deleteItem,onDelete:()=>r({responsive:t.responsive.filter((l,m)=>m!==d)}),children:[o.jsxs("div",{className:"spec-two-columns",children:[o.jsx(Ie,{label:i.viewport,children:o.jsx("select",{value:u.viewport,onChange:l=>a(d,{viewport:l.target.value}),children:t.viewports.map(l=>o.jsx("option",{value:l.id,children:qr(e,l.id)},l.id))})}),o.jsx(Ie,{label:i.rule,children:o.jsx("select",{value:u.rule,onChange:l=>a(d,{rule:l.target.value}),children:gm.map(l=>o.jsx("option",{value:l,children:Qo(e,l)},l))})})]}),o.jsx(Ie,{label:i.targetComponent,children:o.jsx("select",{value:u.target_node_id,onChange:l=>a(d,{target_node_id:l.target.value}),children:t.nodes.map(l=>o.jsxs("option",{value:l.id,children:[l.name," · ",ft(e,l.type)]},l.id))})}),o.jsx(pm,{label:i.specificChanges,invalidLabel:i.invalidJson,value:u.changes,onChange:l=>a(d,{changes:l})})]},`${u.viewport}-${u.target_node_id}-${d}`))})]})}function lm({blueprint:t,language:e,onChange:n}){const r=It[e],i=(c,u)=>n({acceptance:t.acceptance.map((d,l)=>l===c?{...d,...u}:d)}),a=()=>{var c;return n({acceptance:[...t.acceptance,{id:Wi("acc",t.acceptance.map(u=>u.id)),type:"layout",statement:r.defaultAcceptance,target:((c=t.nodes[0])==null?void 0:c.id)??"root",priority:"must",verification_method:"screenshot_diff"}]})},s=()=>{const{acceptance:c}=Gp(t,{language:e});n({acceptance:c})};return o.jsx(Kr,{title:r.acceptanceTitle,empty:r.noAcceptance,addLabel:r.addAcceptance,count:t.acceptance.length,meta:r.acceptanceMinimum,suggestLabel:r.suggestFromLayout,onSuggest:s,onAdd:a,children:t.acceptance.map((c,u)=>o.jsxs(Wr,{title:`${u+1}. ${ei(e,c.type)}`,deleteLabel:r.deleteItem,onDelete:t.acceptance.length>5?()=>n({acceptance:t.acceptance.filter((d,l)=>l!==u)}):void 0,children:[o.jsxs("div",{className:"spec-two-columns",children:[o.jsx(Ie,{label:r.acceptanceType,children:o.jsx("select",{value:c.type,onChange:d=>i(u,{type:d.target.value}),children:_m.map(d=>o.jsx("option",{value:d,children:ei(e,d)},d))})}),o.jsx(Ie,{label:r.priority,children:o.jsx("select",{value:c.priority,onChange:d=>i(u,{priority:d.target.value}),children:vm.map(d=>o.jsx("option",{value:d,children:jm(e,d)},d))})})]}),o.jsx(Ie,{label:r.statement,hint:r.statementHint,children:o.jsx("textarea",{value:c.statement,maxLength:280,onChange:d=>i(u,{statement:d.target.value})})}),o.jsx(Ie,{label:r.target,children:o.jsx("input",{value:c.target,onChange:d=>i(u,{target:d.target.value})})}),o.jsx(Ie,{label:r.verificationMethod,children:o.jsx("select",{value:c.verification_method,onChange:d=>i(u,{verification_method:d.target.value}),children:bm.map(d=>o.jsx("option",{value:d,children:km(e,d)},d))})})]},c.id))})}function Ki({blueprint:t,language:e,report:n}){const r=It[e];if(!n)return o.jsxs("div",{className:"viewport-quality-summary pending",children:[o.jsx("strong",{children:r.qualityChecking}),o.jsx("span",{children:r.qualityCheckingDescription})]});if(n.issues.length===0)return o.jsxs("div",{className:"viewport-quality-summary pass",children:[o.jsx("strong",{children:r.qualityPassed}),o.jsx("span",{children:r.qualityPassedDescription})]});const i=new Map(t.nodes.map(a=>[a.id,a]));return o.jsxs("div",{className:"viewport-quality-summary fail",children:[o.jsx("strong",{children:r.qualityFailed.replace("{count}",String(n.issues.length))}),o.jsx("ul",{children:n.issues.slice(0,8).map((a,s)=>o.jsxs("li",{children:[o.jsx("span",{children:qr(e,a.viewportId)}),um(e,a)," · ",a.nodeIds.map(c=>{var u;return((u=i.get(c))==null?void 0:u.name)??c}).join(" / ")]},`${a.viewportId}-${a.type}-${a.nodeIds.join("-")}-${s}`))}),n.issues.length>8&&o.jsx("small",{children:r.qualityMore.replace("{count}",String(n.issues.length-8))})]})}function dm({blueprint:t,language:e,errorCount:n,viewportQuality:r,onExportJson:i,onExportMarkdown:a,onExportAgentPrompt:s,onExportPackage:c}){const u=It[e],d=Ji(t,r),l=[[u.checkGoal,d.brief],[u.checkLayout,d.layout],[u.checkInteractions,d.interactions],[u.checkResponsive,d.responsive],[u.checkAcceptance,d.acceptance],[u.checkSchema,n===0],[u.checkViewportQuality,r!==null&&r.issues.length===0]],m=l.every(([,g])=>g);return o.jsxs("div",{className:"handoff-panel",children:[o.jsxs("div",{className:`handoff-summary${m?" ready":""}`,children:[o.jsx("strong",{children:m?u.readyTitle:u.notReadyTitle}),o.jsx("span",{children:m?u.readyDescription:u.notReadyDescription})]}),o.jsx("div",{className:"handoff-checklist",children:l.map(([g,$])=>o.jsxs("div",{className:$?"complete":"",children:[o.jsx("span",{children:$?"✓":"!"}),o.jsx("strong",{children:g})]},g))}),o.jsx(Ki,{blueprint:t,language:e,report:r}),o.jsxs("div",{className:"handoff-stats",children:[o.jsxs("div",{children:[o.jsx("strong",{children:t.nodes.length}),o.jsx("span",{children:u.nodes})]}),o.jsxs("div",{children:[o.jsx("strong",{children:t.interactions.length}),o.jsx("span",{children:u.interactions})]}),o.jsxs("div",{children:[o.jsx("strong",{children:t.responsive.length}),o.jsx("span",{children:u.rules})]}),o.jsxs("div",{children:[o.jsx("strong",{children:t.acceptance.length}),o.jsx("span",{children:u.acceptance})]})]}),o.jsxs("div",{className:"handoff-actions",children:[o.jsx("button",{type:"button",onClick:i,children:u.exportJson}),o.jsx("button",{type:"button",onClick:a,children:u.exportMarkdown}),o.jsx("button",{type:"button",onClick:s,children:u.exportAgentPrompt}),o.jsx("button",{type:"button",className:"primary",disabled:!m,onClick:c,children:u.exportPackage})]})]})}function um(t,e){const n={"viewport-overflow":["超出畫板","outside artboard"],"horizontal-overflow":["內容水平溢出","horizontal content overflow"],undersized:["元件寬度不足","component is too narrow"],overlap:["元件重疊","component overlap"]};return t==="zh-Hant"?n[e.type][0]:n[e.type][1]}function Kr({title:t,empty:e,addLabel:n,count:r,meta:i,onAdd:a,suggestLabel:s,onSuggest:c,children:u}){return o.jsxs("div",{className:"collection-editor",children:[o.jsxs("div",{className:"collection-toolbar",children:[o.jsxs("div",{children:[o.jsx("strong",{children:t}),o.jsx("span",{children:i??`${r}`})]}),o.jsxs("div",{className:"collection-actions",children:[s&&c&&o.jsxs("button",{type:"button",className:"suggest-button",onClick:c,children:[o.jsx(cu,{}),s]}),o.jsxs("button",{type:"button",onClick:a,children:[o.jsx(zr,{}),n]})]})]}),r===0?o.jsx("p",{className:"spec-empty",children:e}):u]})}function Wr({title:t,deleteLabel:e,onDelete:n,children:r}){return o.jsxs("section",{className:"spec-card",children:[o.jsxs("header",{children:[o.jsx("strong",{children:t}),n&&o.jsx(xt,{label:e,align:"end",children:o.jsx("button",{type:"button","aria-label":e,onClick:n,children:o.jsx(ur,{})})})]}),o.jsx("div",{children:r})]})}function Ie({label:t,hint:e,children:n}){return o.jsxs("label",{className:"spec-field",children:[o.jsx("span",{children:t}),n,e&&o.jsx("small",{children:e})]})}function pm({label:t,invalidLabel:e,value:n,onChange:r}){const i=JSON.stringify(n,null,2),[a,s]=G.useState(i),[c,u]=G.useState(!1);return G.useEffect(()=>{c||s(i)},[c,i]),o.jsxs(Ie,{label:t,children:[o.jsx("textarea",{className:`spec-json${c?" invalid":""}`,value:a,onChange:d=>{s(d.target.value);try{r(JSON.parse(d.target.value)),u(!1)}catch{u(!0)}}}),c&&o.jsx("small",{className:"spec-error",children:e})]})}function Wi(t,e){const n=`${t}_${Date.now().toString(36)}`;if(!e.includes(n))return n;let r=2;for(;e.includes(`${n}_${r}`);)r+=1;return`${n}_${r}`}function hm(t){return t.toLowerCase().replace(/[^a-z0-9._-]+/g,"-").replace(/^-+/,"")}const mm=["dashboard","form","landing","settings","admin_table","detail","auth","error","empty","workspace","communication","content","commerce","calendar","files","onboarding"],fm=["web","mobile-web","ios","android","desktop"],ym=["click","double_click","hover","focus","blur","change","submit","key_enter","key_escape","swipe_left","swipe_right","load","scroll"],gm=["keep","hide","drawer","bottom_nav","stack","scroll","card_list","col_reduce","collapse","expand","icon_only","label_only"],_m=["layout","interaction","responsive","a11y","content","performance"],vm=["blocker","must","should","nice"],bm=["manual_visual","manual_ia_review","dom_query","computed_style","axe_audit","screenshot_diff","interaction_replay","code_diff"];function wm(t,e){return t==="zh-Hant"?{dashboard:"儀表板",form:"表單",landing:"Landing 頁",settings:"設定",admin_table:"管理資料表",detail:"詳細頁",auth:"登入/驗證",error:"錯誤頁",empty:"空狀態",workspace:"工作區",communication:"通訊",content:"內容",commerce:"商務",calendar:"行事曆",files:"檔案",onboarding:"導覽流程"}[e]:e.replaceAll("_"," ")}function $m(t,e){return t==="zh-Hant"?{web:"網頁","mobile-web":"行動網頁",ios:"iOS",android:"Android",desktop:"桌面應用"}[e]:e}function xm(t,e){return t==="zh-Hant"?{click:"點擊",double_click:"雙擊",hover:"游標停留",focus:"聚焦",blur:"失焦",change:"值變更",submit:"送出",key_enter:"按 Enter",key_escape:"按 Escape",swipe_left:"向左滑",swipe_right:"向右滑",load:"載入",scroll:"捲動"}[e]:e.replaceAll("_"," ")}function Qo(t,e){return t==="zh-Hant"?{keep:"維持",hide:"隱藏",drawer:"改為抽屜",bottom_nav:"改為底部導覽",stack:"改為堆疊",scroll:"允許捲動",card_list:"改為卡片清單",col_reduce:"減少欄數",collapse:"收合",expand:"展開",icon_only:"只顯示圖示",label_only:"只顯示文字"}[e]:e.replaceAll("_"," ")}function qr(t,e){return t==="zh-Hant"?{desktop:"桌面",tablet:"平板",mobile:"手機",wide:"寬螢幕"}[e]:e}function ei(t,e){return t==="zh-Hant"?{layout:"佈局",interaction:"互動",responsive:"響應式",a11y:"無障礙",content:"內容",performance:"效能"}[e]:e}function jm(t,e){return t==="zh-Hant"?{blocker:"阻擋交付",must:"必須",should:"應該",nice:"加分"}[e]:e}function km(t,e){return t==="zh-Hant"?{manual_visual:"人工視覺檢查",manual_ia_review:"人工資訊架構檢查",dom_query:"DOM 查詢",computed_style:"計算樣式",axe_audit:"Axe 無障礙檢查",screenshot_diff:"截圖差異",interaction_replay:"互動重播",code_diff:"程式碼差異"}[e]:e.replaceAll("_"," ")}const It={en:{workflow:"Blueprint specification",stageTitles:{brief:"Screen goal",interactions:"Interactions",responsive:"Responsive rules",acceptance:"Acceptance criteria",handoff:"AI handoff"},stageDescriptions:{brief:"Define what the user must accomplish before arranging details.",interactions:"Describe observable behavior instead of leaving the agent to infer it.",responsive:"State how important regions change between viewports.",acceptance:"Write binary checks the implementation can pass or fail.",handoff:"Review completeness and export agent-ready artifacts."},screenName:"Screen name",screenId:"Screen ID",screenType:"Screen type",platform:"Platform",primaryGoal:"Primary user goal",primaryGoalHint:"One concrete outcome, written from the user perspective.",agentNotes:"Implementation notes",agentNotesHint:"Context for the agent. Keep layout rules in the layout and acceptance sections.",interactionsTitle:"Declared interactions",noInteractions:"No interaction has been declared. Add one for every meaningful action.",addInteraction:"Add interaction",trigger:"Trigger",sourceComponent:"Source component",suggestFromLayout:"Suggest from layout",actionIntent:"Action intent",target:"Target",resultState:"Observable result",resultStateHint:"Describe what becomes visibly true after the action.",defaultResult:"The intended result is visible.",responsiveTitle:"Responsive transformations",noResponsive:"No responsive behavior has been declared.",addResponsive:"Add rule",viewport:"Viewport",rule:"Transformation",targetComponent:"Target component",specificChanges:"Specific overrides (JSON)",invalidJson:"Enter a valid JSON object before continuing.",deleteItem:"Delete item",acceptanceTitle:"Acceptance checklist",noAcceptance:"No acceptance item exists.",addAcceptance:"Add criterion",acceptanceMinimum:"At least 5, including layout, interaction, responsive, and accessibility.",acceptanceType:"Category",priority:"Priority",statement:"Pass/fail statement",statementHint:"Avoid subjective wording such as “looks good”.",verificationMethod:"Verification method",defaultAcceptance:"The implementation matches the declared UI intent.",readyTitle:"Ready for AI handoff",readyDescription:"The Blueprint contains the minimum context required for implementation.",notReadyTitle:"Handoff is incomplete",notReadyDescription:"Finish the missing specification sections before exporting the package.",checkGoal:"Screen goal is specific",checkLayout:"UI structure contains components",checkInteractions:"Interactions are declared",checkResponsive:"Responsive behavior is declared",checkAcceptance:"Acceptance coverage is complete",checkSchema:"Schema and semantics are valid",checkViewportQuality:"Rendered viewports pass layout checks",qualityChecking:"Checking rendered viewports",qualityCheckingDescription:"Desktop, tablet, and mobile are being checked for overflow and overlap.",qualityPassed:"Rendered viewport check passed",qualityPassedDescription:"No blocking overflow or overlap was detected.",qualityFailed:"{count} rendered layout issue(s) block handoff",qualityMore:"{count} more issue(s) not shown.",nodes:"nodes",interactions:"interactions",rules:"responsive rules",acceptance:"criteria",exportJson:"Export JSON",exportMarkdown:"Export Markdown",exportPackage:"Export complete package",exportAgentPrompt:"Export Codex task"},"zh-Hant":{workflow:"藍圖規格",stageTitles:{brief:"畫面目標",interactions:"互動行為",responsive:"響應式規則",acceptance:"驗收條件",handoff:"AI 交付"},stageDescriptions:{brief:"先定義使用者要完成什麼,再處理畫面細節。",interactions:"描述可觀察的行為,不讓 Agent 自行猜測。",responsive:"定義重要區域在不同裝置上的變化方式。",acceptance:"撰寫實作結果可以明確通過或失敗的條件。",handoff:"檢查完整度並匯出可直接交給 Agent 的產物。"},screenName:"畫面名稱",screenId:"畫面識別碼",screenType:"畫面類型",platform:"目標平台",primaryGoal:"主要使用者目標",primaryGoalHint:"用使用者角度寫一個具體、可完成的結果。",agentNotes:"實作補充說明",agentNotesHint:"提供背景脈絡;佈局規則請寫在佈局與驗收條件。",interactionsTitle:"已宣告互動",noInteractions:"尚未定義互動。每個重要操作都應有一筆可觀察結果。",addInteraction:"新增互動",trigger:"觸發方式",sourceComponent:"來源元件",suggestFromLayout:"從版面建議",actionIntent:"動作意圖",target:"目標",resultState:"可觀察結果",resultStateHint:"描述動作完成後,畫面上什麼事情會變成真的。",defaultResult:"預期的結果已顯示。",responsiveTitle:"響應式轉換",noResponsive:"尚未定義不同裝置的行為。",addResponsive:"新增規則",viewport:"裝置",rule:"轉換方式",targetComponent:"目標元件",specificChanges:"特定覆寫(JSON)",invalidJson:"請輸入有效的 JSON 物件後再繼續。",deleteItem:"刪除此項",acceptanceTitle:"驗收清單",noAcceptance:"尚未建立驗收條件。",addAcceptance:"新增條件",acceptanceMinimum:"至少 5 項,且必須涵蓋佈局、互動、響應式與無障礙。",acceptanceType:"類別",priority:"優先級",statement:"通過/失敗敘述",statementHint:"避免使用「看起來不錯」等主觀文字。",verificationMethod:"驗證方式",defaultAcceptance:"實作結果符合已宣告的 UI 意圖。",readyTitle:"可以交付給 AI Agent",readyDescription:"這份藍圖已包含實作所需的最低完整脈絡。",notReadyTitle:"交付規格尚未完整",notReadyDescription:"請先完成缺少的規格階段,再匯出完整交付包。",checkGoal:"畫面目標具體",checkLayout:"畫面已有元件結構",checkInteractions:"已定義互動行為",checkResponsive:"已定義響應式規則",checkAcceptance:"驗收條件涵蓋完整",checkSchema:"Schema 與語意驗證通過",checkViewportQuality:"實際裝置畫面通過版面檢查",qualityChecking:"正在檢查實際裝置畫面",qualityCheckingDescription:"正在檢查桌面、平板與手機是否有溢出或重疊。",qualityPassed:"實際裝置畫面檢查通過",qualityPassedDescription:"沒有偵測到會阻擋交付的溢出或重疊。",qualityFailed:"偵測到 {count} 個版面問題,已阻擋交付",qualityMore:"另有 {count} 個問題未顯示。",nodes:"個節點",interactions:"個互動",rules:"個響應式規則",acceptance:"個驗收條件",exportJson:"匯出 JSON",exportMarkdown:"匯出 Markdown",exportPackage:"匯出完整交付包",exportAgentPrompt:"匯出 Codex 任務"}},Sm=["click","submit","change","load","system","gesture"];function Nm(t){return JSON.parse(t)}function Cm(t){const e=t.replace(/\\/g,"/"),n=e.split("/");return n[n.length-1]||e}function Pm(t,e){const n=[],r=[];for(const a of t.screens){const s=e.get(Cm(a.path));if(!s){n.push(a.path);continue}r.push({id:a.id,name:a.name??s.screen.name,path:a.path,blueprint:s})}return{project:{id:t.id,name:t.name,description:t.description,entryScreenId:t.entry_screen,navigation:t.navigation?t.navigation.map(a=>({...a})):[],designSystem:t.design_system,screens:r},missing:n}}function Em(t){const e=t.screens.map(r=>({id:r.id,name:r.name,path:r.path})),n={version:"0.1.0",id:t.id,name:t.name,screens:e,entry_screen:t.entryScreenId};return t.description&&(n.description=t.description),t.navigation.length&&(n.navigation=t.navigation.map(r=>({...r}))),t.designSystem&&(n.design_system=t.designSystem),n}function Am(t){return t.toLowerCase().replace(/[^a-z0-9._-]+/g,"-").replace(/^-+|-+$/g,"")||"screen"}function Rm(t){const e=t.screen.id,n=Am(e),r={id:e,name:t.screen.name,path:`${n}.ui.json`,blueprint:t};return{id:`${n}-project`,name:t.screen.name,entryScreenId:e,navigation:[],screens:[r]}}function Tm({project:t,activeScreenId:e,language:n,onSwitchScreen:r,onAddScreen:i,onRemoveScreen:a,onRenameScreen:s,onSetEntryScreen:c,onUpdateNavigation:u,onUpdateMeta:d}){const[l,m]=G.useState(!1),[g,$]=G.useState(null),[k,j]=G.useState("");function _(p){const h=k.trim();h&&s(p,h),$(null)}function b(p,h){const y=t.navigation.map((w,A)=>A===p?{...w,...h}:w);u(y)}function f(p){u(t.navigation.filter((h,y)=>y!==p))}function x(){var y,w;const p=((y=t.screens[0])==null?void 0:y.id)??"",h=((w=t.screens[1])==null?void 0:w.id)??p;u([...t.navigation,{from:p,to:h}])}const C=t.screens.length<=1;return o.jsxs("div",{className:"project-bar",children:[o.jsxs("div",{className:"project-bar-meta",children:[o.jsx("input",{className:"project-name-input","aria-label":T(n,"projectName"),placeholder:T(n,"projectName"),value:t.name,onChange:p=>d({name:p.target.value})}),o.jsx("input",{className:"project-description-input","aria-label":T(n,"projectDescription"),placeholder:T(n,"projectDescription"),value:t.description??"",onChange:p=>d({description:p.target.value})})]}),o.jsxs("div",{className:"project-screens",role:"tablist","aria-label":T(n,"projectScreens"),children:[t.screens.map(p=>{const h=p.id===e,y=p.id===t.entryScreenId;return o.jsxs("div",{className:`project-tab ${h?"active":""}`,children:[g===p.id?o.jsx("input",{className:"project-tab-rename",autoFocus:!0,value:k,onChange:w=>j(w.target.value),onBlur:()=>_(p.id),onKeyDown:w=>{w.key==="Enter"&&_(p.id),w.key==="Escape"&&$(null)}}):o.jsxs("button",{type:"button",className:"project-tab-label",role:"tab","aria-selected":h,onClick:()=>r(p.id),onDoubleClick:()=>{$(p.id),j(p.name)},children:[y&&o.jsx(zo,{className:"project-tab-entry","aria-hidden":!0}),o.jsx("span",{children:p.name})]}),o.jsx(xt,{label:T(n,"setEntryScreen"),children:o.jsx("button",{type:"button",className:"project-tab-icon","aria-label":T(n,"setEntryScreen"),disabled:y,onClick:()=>c(p.id),children:o.jsx(zo,{})})}),o.jsx(xt,{label:T(n,"removeScreen"),align:"end",children:o.jsx("button",{type:"button",className:"project-tab-icon","aria-label":T(n,"removeScreen"),disabled:C,onClick:()=>a(p.id),children:o.jsx(pr,{})})})]},p.id)}),o.jsx(xt,{label:T(n,"addScreen"),children:o.jsx("button",{type:"button",className:"project-add-screen","aria-label":T(n,"addScreen"),onClick:i,children:o.jsx(zr,{})})}),o.jsxs("button",{type:"button",className:"project-nav-toggle","aria-expanded":l,onClick:()=>m(p=>!p),children:[l?o.jsx(vd,{}):o.jsx(fd,{}),o.jsx("span",{children:l?T(n,"hideNavigation"):T(n,"showNavigation")})]})]}),l&&o.jsxs("div",{className:"project-nav-editor",children:[o.jsxs("div",{className:"project-nav-toolbar",children:[o.jsx("strong",{children:T(n,"navigation")}),o.jsxs("button",{type:"button",onClick:x,children:[o.jsx(zr,{}),T(n,"addNavEdge")]})]}),t.navigation.length===0?o.jsx("p",{className:"project-nav-empty",children:T(n,"noNavEdges")}):o.jsx("div",{className:"project-nav-rows",children:t.navigation.map((p,h)=>o.jsxs("div",{className:"project-nav-row",children:[o.jsxs("label",{children:[o.jsx("span",{children:T(n,"navFrom")}),o.jsx("select",{value:p.from,onChange:y=>b(h,{from:y.target.value}),children:t.screens.map(y=>o.jsx("option",{value:y.id,children:y.name},y.id))})]}),o.jsxs("label",{children:[o.jsx("span",{children:T(n,"navTo")}),o.jsx("select",{value:p.to,onChange:y=>b(h,{to:y.target.value}),children:t.screens.map(y=>o.jsx("option",{value:y.id,children:y.name},y.id))})]}),o.jsxs("label",{children:[o.jsx("span",{children:T(n,"navTrigger")}),o.jsxs("select",{value:p.trigger??"",onChange:y=>{const w=y.target.value;b(h,{trigger:w||void 0})},children:[o.jsx("option",{value:"",children:T(n,"navTriggerNone")}),Sm.map(y=>o.jsx("option",{value:y,children:y},y))]})]}),o.jsxs("label",{className:"project-nav-label-field",children:[o.jsx("span",{children:T(n,"navLabel")}),o.jsx("input",{value:p.label??"",onChange:y=>{const w=y.target.value;b(h,{label:w||void 0})}})]}),o.jsx(xt,{label:T(n,"removeScreen"),align:"end",children:o.jsx("button",{type:"button",className:"project-nav-remove","aria-label":T(n,"removeScreen"),onClick:()=>f(h),children:o.jsx(ur,{})})})]},h))})]})]})}async function Im(t){const e=[];for(const n of Array.from(t)){if(n.name.toLowerCase().endsWith(".zip")){const{default:r}=await Ke(async()=>{const{default:a}=await import("./jszip.min-CRfXyL92.js").then(s=>s.j);return{default:a}},__vite__mapDeps([3,1,2])),i=await r.loadAsync(n);for(const[a,s]of Object.entries(i.files))s.dir||!/\.(html|scss|css|ts)$/i.test(a)||/\.spec\.ts$/i.test(a)||e.push({path:ti(a),content:await s.async("string")});continue}!/\.(html|scss|css|ts)$/i.test(n.name)||/\.spec\.ts$/i.test(n.name)||e.push({path:ti(n.webkitRelativePath||n.name),content:await n.text()})}return e}async function Mm(t){return(await Ke(()=>import("./angular-importer.lib-dB_jK4mR.js"),__vite__mapDeps([4,1,5]))).discoverAngularComponents(t)}async function Om(t,e){return(await Ke(()=>import("./angular-importer.lib-dB_jK4mR.js"),__vite__mapDeps([4,1,5]))).importAngularComponent(t,{entry:e})}async function zm(t,e,n){const r=t.diagnostics.filter(l=>l.confidence<.7&&l.node_id).slice(0,20);if(r.length===0)return[];const i=new Set(r.map(l=>l.file)),a=e.filter(l=>i.has(l.path)).map(l=>({path:l.path,content:l.content.slice(0,12e3)})),s=["You are reviewing a deterministic Angular-to-AUB import.",'Return JSON only with shape {"suggestions":[{"node_id":"...","patch":{},"reason":"...","confidence":0.0}]}.',"Allowed patch keys: type, name, role, content, bindings, validation.","Do not invent business behavior. Only suggest changes supported by the source snippets.",`Diagnostics: ${JSON.stringify(r)}`,`Nodes: ${JSON.stringify(t.blueprint.nodes.filter(l=>r.some(m=>m.node_id===l.id)))}`,`Sources: ${JSON.stringify(a)}`].join(`
|
|
501
|
+
|
|
502
|
+
`),c=await fetch(`${n.baseUrl.replace(/\/$/,"")}/api/generate`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({model:n.model,prompt:s,stream:!1,think:!1,format:"json",options:{temperature:0}})});if(!c.ok)throw new Error(`Ollama ${c.status}: ${await c.text()}`);const u=await c.json();return(JSON.parse(u.response??"{}").suggestions??[]).flatMap((l,m)=>Dm(l,t.blueprint)?[{...l,id:`ai_suggestion_${m+1}`,confidence:Math.max(0,Math.min(1,l.confidence))}]:[])}function Dm(t,e){if(!t||typeof t!="object")return!1;const n=t;if(typeof n.node_id!="string"||!e.nodes.some(i=>i.id===n.node_id)||!n.patch||typeof n.patch!="object"||Array.isArray(n.patch)||typeof n.reason!="string"||typeof n.confidence!="number")return!1;const r=new Set(["type","name","role","content","bindings","validation"]);return Object.keys(n.patch).every(i=>r.has(i))}function ti(t){return t.replace(/\\/g,"/").split("/").filter(e=>e&&e!=="."&&e!=="..").join("/")}function qm({open:t,language:e,files:n,entries:r,selectedEntry:i,result:a,loading:s,error:c,onEntryChange:u,onClose:d,onLoad:l,onResultChange:m}){const g=e==="zh-Hant",[$,k]=G.useState(()=>localStorage.getItem("aub.ollama.base-url")??void 0??"http://127.0.0.1:11434"),[j,_]=G.useState(()=>localStorage.getItem("aub.ollama.model")??void 0??""),[b,f]=G.useState([]),[x,C]=G.useState(!1),[p,h]=G.useState(null);G.useEffect(()=>{f([]),h(null)},[a]);const y=G.useMemo(()=>({errors:(a==null?void 0:a.diagnostics.filter(S=>S.severity==="error").length)??0,warnings:(a==null?void 0:a.diagnostics.filter(S=>S.severity==="warning").length)??0}),[a]);if(!t)return null;async function w(){if(!(!a||!j.trim())){C(!0),h(null),localStorage.setItem("aub.ollama.base-url",$),localStorage.setItem("aub.ollama.model",j);try{f(await zm(a,n,{baseUrl:$,model:j}))}catch(S){h(S.message)}finally{C(!1)}}}function A(S){if(!a)return;const O=a.blueprint.nodes.map(H=>H.id===S.node_id?Lm(H,S.patch):H);m({...a,blueprint:{...a.blueprint,nodes:O}}),f(H=>H.filter(B=>B.id!==S.id))}return o.jsx("div",{className:"modal-backdrop",role:"presentation",onMouseDown:S=>{S.target===S.currentTarget&&d()},children:o.jsxs("section",{className:"import-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"angular-import-title",children:[o.jsxs("header",{children:[o.jsxs("div",{children:[o.jsx($i,{}),o.jsxs("div",{children:[o.jsx("h2",{id:"angular-import-title",children:g?"匯入 Angular 元件":"Import Angular component"}),o.jsx("p",{children:g?`${n.length} 個來源檔案`:`${n.length} source files`})]})]}),o.jsx("button",{type:"button",className:"icon-button","aria-label":g?"關閉":"Close",title:g?"關閉":"Close",onClick:d,children:o.jsx(pr,{})})]}),o.jsxs("div",{className:"import-dialog-body",children:[o.jsxs("label",{className:"import-entry-field",children:[o.jsx("span",{children:g?"入口元件":"Entry component"}),o.jsx("select",{value:i,onChange:S=>u(S.target.value),children:r.map(S=>o.jsxs("option",{value:S.selector??S.templatePath??"",children:[S.label," ",S.templatePath?`· ${S.templatePath}`:""]},S.selector??S.templatePath??S.label))})]}),s&&o.jsxs("div",{className:"import-loading",children:[o.jsx(Oo,{className:"spin"}),g?"正在解析元件、樣式與互動…":"Parsing components, styles, and interactions..."]}),c&&o.jsxs("div",{className:"import-error",children:[o.jsx(Do,{}),c]}),a&&!s&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"import-summary",children:[o.jsxs("div",{children:[o.jsx("strong",{children:a.blueprint.nodes.length}),o.jsx("span",{children:g?"節點":"Nodes"})]}),o.jsxs("div",{children:[o.jsx("strong",{children:a.blueprint.interactions.length}),o.jsx("span",{children:g?"互動":"Interactions"})]}),o.jsxs("div",{children:[o.jsxs("strong",{children:[Math.round(a.confidenceSummary.score*100),"%"]}),o.jsx("span",{children:g?"解析信心":"Confidence"})]}),o.jsxs("div",{className:y.warnings?"warn":"",children:[o.jsx("strong",{children:y.warnings}),o.jsx("span",{children:g?"警告":"Warnings"})]})]}),o.jsxs("section",{className:"import-diagnostics",children:[o.jsx("h3",{children:g?"解析診斷":"Import diagnostics"}),a.diagnostics.length===0?o.jsxs("p",{className:"import-clean",children:[o.jsx(hd,{}),g?"沒有需要處理的問題。":"No issues require review."]}):a.diagnostics.map((S,O)=>o.jsxs("div",{className:`diagnostic-row ${S.severity}`,children:[o.jsx(Do,{}),o.jsxs("span",{children:[o.jsx("strong",{children:S.message}),o.jsxs("small",{children:[S.file,S.line?`:${S.line}`:""," · ",Math.round(S.confidence*100),"%"]})]})]},`${S.code}-${S.node_id??O}`))]}),o.jsxs("section",{className:"import-ai",children:[o.jsxs("div",{className:"import-ai-heading",children:[o.jsxs("div",{children:[o.jsx(Mo,{}),o.jsx("strong",{children:g?"本機 AI 建議":"Local AI suggestions"})]}),o.jsxs("button",{type:"button",onClick:w,disabled:x||!j.trim(),children:[x?o.jsx(Oo,{className:"spin"}):o.jsx(Mo,{}),g?"分析低信心項目":"Review low-confidence items"]})]}),o.jsxs("div",{className:"import-ai-config",children:[o.jsxs("label",{children:[o.jsx("span",{children:"Ollama URL"}),o.jsx("input",{value:$,onChange:S=>k(S.target.value)})]}),o.jsxs("label",{children:[o.jsx("span",{children:g?"模型":"Model"}),o.jsx("input",{value:j,onChange:S=>_(S.target.value),placeholder:"qwen3.6:35b"})]})]}),p&&o.jsx("p",{className:"import-ai-error",children:p}),b.map(S=>{var O;return o.jsxs("div",{className:"ai-suggestion",children:[o.jsxs("div",{children:[o.jsx("strong",{children:((O=a.blueprint.nodes.find(H=>H.id===S.node_id))==null?void 0:O.name)??S.node_id}),o.jsx("p",{children:S.reason}),o.jsxs("small",{children:[Math.round(S.confidence*100),"%"]})]}),o.jsx("button",{type:"button",onClick:()=>A(S),children:g?"套用":"Apply"})]},S.id)})]})]})]}),o.jsxs("footer",{children:[o.jsx("button",{type:"button",onClick:d,children:g?"取消":"Cancel"}),o.jsx("button",{type:"button",className:"primary",disabled:!a||s||y.errors>0,onClick:()=>a&&l(a),children:g?"載入畫布":"Load into canvas"})]})]})})}function Lm(t,e){return{...t,...e,id:t.id,parent_id:t.parent_id,children:t.children,content:e.content?{...t.content,...e.content}:t.content,bindings:e.bindings?{...t.bindings,...e.bindings}:t.bindings,validation:e.validation?{...t.validation,...e.validation}:t.validation}}function Hm(t){const e=t.trim()||"http://127.0.0.1:3100/mcp",n=new URL(e),r=e.endsWith("/mcp")?e.slice(0,-4):e.replace(/\/$/,"");return{endpoint:e,rpcUrl:`${r}/rpc`,healthUrl:`${n.origin}/health`}}async function ht(t,e,n={}){const r=await fetch(t.rpcUrl,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({tool:e,args:n})}),i=await r.json();if(!r.ok||i.ok===!1)throw new Error(i.error??`AUB workspace RPC failed: ${r.status}`);return i.result}async function Bm(t){const e=Hm(t),n=await fetch(e.healthUrl);if(!n.ok)throw new Error(`AUB workspace server is not healthy: ${n.status}`);const r=await ht(e,"get_workspace_status");return{connection:e,status:r}}function Vm(t){var r,i,a;const e=(i=(r=t==null?void 0:t.preview)==null?void 0:r.devServerUrl)==null?void 0:i.replace(/\/$/,""),n=((a=t==null?void 0:t.preview)==null?void 0:a.route)??(t==null?void 0:t.targetRoute)??"";return e?n?`${e}${n.startsWith("/")?n:`/${n}`}`:e:""}function Fm({language:t,endpoint:e,connected:n,loading:r,error:i,status:a,blueprint:s,savePath:c,onEndpointChange:u,onConnect:d,onDisconnect:l,onRefresh:m,onLoadBlueprint:g,onSaveBlueprint:$,onSavePathChange:k,onPreviewChange:j,onReviewCandidate:_}){var y,w,A,S,O;const b=t==="zh-Hant",f=(a==null?void 0:a.session)??null,x=Vm(f),[C,p]=G.useState({devServerUrl:"",route:""});G.useEffect(()=>{var H,B;p({devServerUrl:((H=f==null?void 0:f.preview)==null?void 0:H.devServerUrl)??"",route:((B=f==null?void 0:f.preview)==null?void 0:B.route)??""})},[(y=f==null?void 0:f.preview)==null?void 0:y.devServerUrl,(w=f==null?void 0:f.preview)==null?void 0:w.route]);const h=C.devServerUrl!==(((A=f==null?void 0:f.preview)==null?void 0:A.devServerUrl)??"")||C.route!==(((S=f==null?void 0:f.preview)==null?void 0:S.route)??"");return o.jsxs("section",{className:`workspace-panel${n?" connected":""}`,children:[o.jsxs("header",{children:[o.jsxs("div",{children:[o.jsx("strong",{children:b?"Workspace 連線":"Workspace connection"}),o.jsx("span",{children:n&&a?`${a.packageName??"workspace"} · ${a.frameworks.join(", ")}`:b?"連到本機 aub-mcp-http":"Connect to local aub-mcp-http"})]}),o.jsxs("div",{className:"workspace-connect-row",children:[o.jsx("input",{value:e,onChange:H=>u(H.target.value),placeholder:"http://127.0.0.1:3100/mcp"}),o.jsxs("button",{type:"button",onClick:n?m:d,disabled:r,children:[n?o.jsx(tu,{}):o.jsx(vu,{}),n?b?"刷新":"Refresh":b?"連線":"Connect"]}),n&&o.jsx("button",{type:"button",onClick:l,title:b?"中斷連線":"Disconnect",children:o.jsx(pr,{})})]})]}),i&&o.jsx("p",{className:"workspace-error",children:i}),n&&a&&o.jsxs("div",{className:"workspace-grid",children:[o.jsxs("section",{children:[o.jsx("h3",{children:b?"Blueprint 檔案":"Blueprint files"}),o.jsxs("select",{defaultValue:"",onChange:H=>H.target.value&&g(H.target.value),children:[o.jsx("option",{value:"",disabled:!0,children:b?"載入 workspace Blueprint...":"Load workspace Blueprint..."}),a.routes.length===0&&o.jsx("option",{value:"",disabled:!0,children:b?"尚未掃描 route":"No scanned routes yet"}),(O=a.blueprints)==null?void 0:O.map(H=>o.jsxs("option",{value:H.path,children:[H.screenName," · ",H.path]},H.path))]}),o.jsxs("div",{className:"workspace-save-row",children:[o.jsx("input",{value:c,onChange:H=>k(H.target.value),placeholder:"screens/settings.ui.json"}),o.jsxs("button",{type:"button",disabled:!s||r,onClick:$,children:[o.jsx(Fr,{}),b?"存回 workspace":"Save to workspace"]})]}),o.jsx("small",{children:f!=null&&f.activeBlueprint?`${b?"目前 session":"Current session"}: ${f.activeBlueprint}`:b?"儲存後 Agent 可透過 get_aub_session 讀到。":"After save, agents can read this through get_aub_session."})]}),o.jsxs("section",{children:[o.jsx("h3",{children:b?"真實畫面預覽":"Implementation preview"}),o.jsx("input",{value:C.devServerUrl,onChange:H=>p(B=>({...B,devServerUrl:H.target.value})),placeholder:"http://localhost:3000"}),o.jsx("input",{value:C.route,onChange:H=>p(B=>({...B,route:H.target.value})),placeholder:"/settings"}),o.jsx("button",{type:"button",disabled:!h||r,onClick:()=>j(C),children:b?"套用預覽":"Apply preview"}),x&&o.jsxs(o.Fragment,{children:[o.jsx("a",{href:x,target:"_blank",rel:"noreferrer",children:b?"另開預覽":"Open preview"}),o.jsx("iframe",{title:"AUB implementation preview",src:x})]})]}),o.jsxs("section",{children:[o.jsx("h3",{children:b?"自訂元件候選":"Component candidates"}),o.jsx(Um,{language:t,candidates:a.componentCandidates,onReviewCandidate:_})]})]})]})}function Um({language:t,candidates:e,onReviewCandidate:n}){const r=t==="zh-Hant",i=Pi().flatMap(a=>a.types.map(s=>s.name));return e.length===0?o.jsx("p",{className:"empty",children:r?"尚未有候選元件。請先讓 Agent 執行 scan_project_ui。":"No candidates yet. Ask an agent to run scan_project_ui first."}):o.jsx("div",{className:"workspace-candidates",children:e.map(a=>o.jsx(Jm,{language:t,candidate:a,coreTypes:i,onReviewCandidate:n},a.id))})}function Jm({language:t,candidate:e,coreTypes:n,onReviewCandidate:r}){const i=t==="zh-Hant",a=e.suggestedCoreType&&n.includes(e.suggestedCoreType)?e.suggestedCoreType:"card";return o.jsxs("article",{className:`workspace-candidate ${e.status}`,children:[o.jsx("strong",{children:e.componentName}),o.jsxs("small",{children:[e.suggestedType," · ",e.sourcePath]}),o.jsx("span",{children:e.status}),o.jsx(Km,{language:t,candidate:e,coreTypes:n,defaultCore:a,onReviewCandidate:r}),e.status!=="candidate"&&o.jsxs("small",{children:[i?"已審核":"Reviewed",e.approvedAs?`: ${e.approvedAs}`:""]})]})}function Km({language:t,candidate:e,coreTypes:n,defaultCore:r,onReviewCandidate:i}){const a=t==="zh-Hant",s=`core-${e.id}`;return e.status!=="candidate"?null:o.jsxs("div",{className:"workspace-candidate-actions",children:[o.jsx("select",{id:s,defaultValue:r,children:n.map(c=>o.jsx("option",{value:c,children:c},c))}),o.jsx("button",{type:"button",onClick:()=>{const c=document.getElementById(s);i(e,"map_core",(c==null?void 0:c.value)??r)},children:a?"映射 core":"Map core"}),o.jsx("button",{type:"button",onClick:()=>i(e,"create_extension"),children:a?"建立 extension":"Create extension"}),o.jsx("button",{type:"button",onClick:()=>i(e,"ignore"),children:a?"忽略":"Ignore"})]})}const Gi="aub.editor.active-draft.v1";function Wm(){try{const t=window.localStorage.getItem(Gi);if(!t)return null;const e=JSON.parse(t);return!e.blueprint||typeof e.savedAt!="string"?null:{blueprint:e.blueprint,language:e.language==="en"?"en":"zh-Hant",savedAt:e.savedAt}}catch{return null}}function Gm(t,e){const n=new Date().toISOString(),r={blueprint:t,language:e,savedAt:n};return window.localStorage.setItem(Gi,JSON.stringify(r)),n}function ni(t=null){return{past:[],present:t,future:[]}}function Ym(t,e){return t.present===e||t.present&&e&&JSON.stringify(t.present)===JSON.stringify(e)?t:{past:t.present?[...t.past.slice(-99),t.present]:t.past,present:e,future:[]}}function ri(t){const e=t.past.at(-1);return e?{past:t.past.slice(0,-1),present:e,future:t.present?[t.present,...t.future].slice(0,100):t.future}:t}function Ir(t){const e=t.future[0];return e?{past:t.present?[...t.past,t.present].slice(-100):t.past,present:e,future:t.future.slice(1)}:t}const Gr="aub.personal-templates.v1";function Yr(){try{const t=JSON.parse(localStorage.getItem(Gr)??"[]");return Array.isArray(t)?t.filter(Yi):[]}catch{return[]}}function ai(t){const e=Yr(),n=[t,...e.filter(r=>r.id!==t.id)].slice(0,40);return localStorage.setItem(Gr,JSON.stringify(n)),n}function Zm(t){const e=Yr().filter(n=>n.id!==t);return localStorage.setItem(Gr,JSON.stringify(e)),e}function Xm(t,e,n,r){const i=new Date().toISOString();return{id:`personal_${Date.now().toString(36)}_${Math.random().toString(36).slice(2,8)}`,name:t.trim()||e.screen.name,createdAt:i,updatedAt:i,blueprint:structuredClone(e),preview:n,importSummary:r}}async function Qm(t){if(t.name.toLowerCase().endsWith(".zip")){const{default:e}=await Ke(async()=>{const{default:i}=await import("./jszip.min-CRfXyL92.js").then(a=>a.j);return{default:i}},__vite__mapDeps([3,1,2])),n=await e.loadAsync(t),r=Object.values(n.files).find(i=>/template\.json$/i.test(i.name));if(!r)throw new Error("Template ZIP does not contain template.json.");return oi(await r.async("string"))}return oi(await t.text())}function oi(t){const e=JSON.parse(t),n=(e==null?void 0:e.format)==="aub-personal-template"?e.template:e;if(!Yi(n))throw new Error("Invalid AUB personal template.");return n}function Yi(t){if(!t||typeof t!="object")return!1;const e=t;return typeof e.id=="string"&&typeof e.name=="string"&&!!e.blueprint&&typeof e.blueprint=="object"}function ef(t,{knownTypes:e}={}){var c,u,d,l;const n=[],r=Array.isArray(t==null?void 0:t.nodes)?t.nodes:[],i=new Map,a=new Set;for(const m of r){i.has(m.id)&&n.push(`duplicate node id: ${m.id}`),i.set(m.id,m),a.add(m.id);for(const g of((c=m.content)==null?void 0:c.items)??[])g!=null&&g.id&&a.add(g.id)}if(e)for(const m of r){const g=m==null?void 0:m.type;if(typeof g!="string")continue;const $=g.includes(":"),k=e.get(g);if(!k){$&&n.push(`${m.id}: unknown component type "${g}" — declare it in aub.registry.json`);continue}$&&!k.isContainer&&(m.children??[]).length>0&&n.push(`${m.id}: extension type "${g}" is a leaf (isContainer:false) but declares children`)}const s=r.filter(m=>m.parent_id==null);s.length!==1&&n.push(`expected exactly one root node, found ${s.length}`);for(const m of r){m.parent_id!=null&&!i.has(m.parent_id)?n.push(`${m.id}: parent_id references missing node ${m.parent_id}`):m.parent_id!=null&&((i.get(m.parent_id).children??[]).includes(m.id)||n.push(`${m.id}: parent ${m.parent_id} does not declare it in children`));for(const g of m.children??[]){const $=i.get(g);$?$.parent_id!==m.id&&n.push(`${m.id}: child ${g} has parent_id ${String($.parent_id)}`):n.push(`${m.id}: children references missing node ${g}`)}for(const g of["empty_state","loading_state","error_state"]){const $=(u=m.content)==null?void 0:u[g];$&&!i.has($)&&n.push(`${m.id}: content.${g} references missing node ${$}`)}if(((d=m.layout)==null?void 0:d.mode)==="freeform"){const g=(m.children??[]).map(k=>i.get(k)).filter(Boolean),$=t.viewports??[];for(const k of g)for(const j of $){const _=(l=k.placements)==null?void 0:l[j.id];if(!_){n.push(`${k.id}: missing placement for ${j.id} inside freeform parent ${m.id}`);continue}(_.x<0||_.y<0)&&n.push(`${k.id}: placement for ${j.id} has negative coordinates`),(_.width<=0||_.height<=0)&&n.push(`${k.id}: placement for ${j.id} must have positive size`),_.x+_.width>j.width&&n.push(`${k.id}: placement for ${j.id} overflows viewport width ${j.width}`)}}}if(s.length===1){const m=new Set,g=new Set,$=k=>{if(g.has(k)){n.push(`component tree contains a cycle at ${k}`);return}if(m.has(k))return;m.add(k),g.add(k);const j=i.get(k);for(const _ of(j==null?void 0:j.children)??[])i.has(_)&&$(_);g.delete(k)};$(s[0].id);for(const k of r)m.has(k.id)||n.push(`${k.id}: node is not reachable from root ${s[0].id}`)}for(const m of(t==null?void 0:t.interactions)??[])a.has(m.source_node_id)||n.push(`${m.id}: source_node_id references missing node ${m.source_node_id}`);for(const m of(t==null?void 0:t.responsive)??[])i.has(m.target_node_id)||n.push(`responsive ${m.viewport}/${m.rule}: missing target ${m.target_node_id}`);return n}const tf=new Ml({allErrors:!0,strict:!1}),ii=tf.compile(ji);async function si(t){return(await Ke(()=>import("./export-md.lib-DdmdeWgO.js"),[])).exportMarkdown(t)}async function ci(t){return(await Ke(()=>import("./export-agent-prompt.lib-BsP0KNqo.js"),__vite__mapDeps([6,7,8]))).exportAgentPrompt(t,{adapter:"codex",task:"implement"})}async function nf(t){return(await Ke(()=>import("./export-agent-prompt.lib-BsP0KNqo.js"),__vite__mapDeps([6,7,8]))).exportAgentPrompt(t,{adapter:"generic",task:"implement"})}async function rf(t){return(await Ke(()=>import("./implementation-report.lib-CmsSB_8s.js"),[])).createImplementationReportTemplate(t)}function Mr(t,e="page"){const n=e==="app",r=n?"app_shell":"root",i=n?[{id:"app_shell",type:"app_shell",name:T(t,"starterAppShellName"),role:T(t,"starterAppShellRole"),parent_id:null,children:["starter_sidebar","starter_top_bar","starter_main_page"],layout:{mode:"freeform"}},Or("starter_sidebar","sidebar","app_shell",t,{desktop:{x:0,y:0,width:240,height:900,z_index:2},tablet:{x:0,y:0,width:220,height:768,z_index:2},mobile:{x:0,y:780,width:390,height:64,z_index:5}}),Or("starter_top_bar","top_bar","app_shell",t,{desktop:{x:240,y:0,width:1200,height:64,z_index:3},tablet:{x:220,y:0,width:804,height:64,z_index:3},mobile:{x:0,y:0,width:390,height:60,z_index:3}}),Or("starter_main_page","page","app_shell",t,{desktop:{x:240,y:64,width:1200,height:836,z_index:1},tablet:{x:220,y:64,width:804,height:704,z_index:1},mobile:{x:0,y:60,width:390,height:720,z_index:1}},{mode:"freeform"})]:[{id:"root",type:"page",name:T(t,"starterRootName"),role:T(t,"starterRootRole"),parent_id:null,children:[],layout:{mode:"freeform"}}];return{version:"0.3.0",screen:{id:n?"starter.app":"demo.screen",name:T(t,n?"starterAppScreenName":"starterScreenName"),type:n?"dashboard":"landing",platform:"web",primary_user_goal:T(t,n?"starterAppGoal":"starterPrimaryGoal")},viewports:[{id:"desktop",width:1440,height:900},{id:"tablet",width:1024,height:768},{id:"mobile",width:390,height:844}],design_system:Ur(),nodes:i,interactions:[],responsive:[],acceptance:af(t,r)}}function Or(t,e,n,r,i,a=St(e)){const s=e==="sidebar"?["starterSidebarName","starterSidebarRole"]:e==="top_bar"?["starterTopBarName","starterTopBarRole"]:["starterMainPageName","starterMainPageRole"];return{id:t,type:e,name:T(r,s[0]),role:T(r,s[1]),parent_id:n,children:[],layout:a,placements:i}}function af(t,e){const n=t==="zh-Hant";return[{id:"acc_starter_layout",type:"layout",statement:n?"元件位置與尺寸符合畫板。":"Component geometry matches the artboard.",target:e,priority:"must",verification_method:"screenshot_diff"},{id:"acc_starter_interaction",type:"interaction",statement:n?"每個互動元件具有明確 action。":"Every interactive node declares an action.",target:"*",priority:"must",verification_method:"manual_ia_review"},{id:"acc_starter_responsive",type:"responsive",statement:n?"桌面、平板與手機皆有可讀配置。":"Desktop, tablet, and mobile have readable layouts.",target:"desktop,tablet,mobile",priority:"must",verification_method:"screenshot_diff"},{id:"acc_starter_a11y",type:"a11y",statement:n?"互動元件具有文字標籤。":"Interactive nodes have text labels.",target:"*",priority:"must",verification_method:"axe_audit"},{id:"acc_starter_content",type:"content",statement:n?"所有可見元件皆有明確名稱。":"Every visible node has a clear name.",target:"*",priority:"should",verification_method:"manual_ia_review"}]}function of(){const[t]=G.useState(Wm),[e]=G.useState(()=>typeof window>"u"?"http://127.0.0.1:3100/mcp":new URLSearchParams(window.location.search).get("mcp")??"http://127.0.0.1:3100/mcp"),[n,r]=G.useState(()=>ni((t==null?void 0:t.blueprint)??null)),[i,a]=G.useState(()=>{const P=t==null?void 0:t.blueprint.nodes.find(D=>D.parent_id===null);return P?[P.id]:[]}),[s,c]=G.useState((t==null?void 0:t.language)??"zh-Hant"),[u,d]=G.useState(()=>t?t.language==="zh-Hant"?"已恢復上次的本機草稿。":"Restored the last local draft.":null),[l,m]=G.useState(null),[g,$]=G.useState(()=>window.innerWidth>980),[k,j]=G.useState(0),[_,b]=G.useState("layout"),[f,x]=G.useState(null),[C,p]=G.useState(Yr),[h,y]=G.useState(),[w,A]=G.useState([]),[S,O]=G.useState({open:!1,files:[],entries:[],selectedEntry:"",result:null,loading:!1,error:null}),[H,B]=G.useState((t==null?void 0:t.savedAt)??null),[W,ae]=G.useState(null),[oe,we]=G.useState(null),[he,Q]=G.useState(null),[Y,M]=G.useState(e),[U,z]=G.useState(null),[v,N]=G.useState(null),[E,te]=G.useState(!1),[ee,se]=G.useState(null),[pe,R]=G.useState(""),q=G.useRef(null),J=G.useRef(null),X=G.useRef(!1),V=n.present,ce=i[0]??null,$e=G.useMemo(()=>V?[...ii(V)?[]:(ii.errors??[]).map(K=>`${K.instancePath||"(root)"} ${K.message}`),...ef(V)]:[],[V]),ve=G.useCallback(P=>{r(D=>{const K=typeof P=="function"?P(D.present):P;return Ym(D,K)})},[]);function xe(P){var K;const D=tr(P);ve(D),j(ne=>ne+1),a([(K=D.nodes.find(ne=>ne.parent_id===null))==null?void 0:K.id].filter(Boolean)),d(P.version!=="0.3.0"?T(s,"importMigrated"):T(s,"imported"))}async function Te(P){try{const D=await Dr(P),K=JSON.parse(D);if(!Array.isArray(K.components))throw new Error('missing required "components" array');Q(`${JSON.stringify(K,null,2)}
|
|
503
|
+
`),d(T(s,"registryImported",{count:K.components.length}))}catch(D){d(T(s,"registryInvalid",{message:D.message}))}}async function Pe(P){try{const D=await Im(P),K=await Mm(D);if(!D.length||!K.length)throw new Error(s==="zh-Hant"?"找不到可匯入的 Angular 元件檔案。":"No importable Angular component files were found.");const ne=K[0];if(!ne)throw new Error("Angular entry component is missing.");const _e=ne.selector??ne.templatePath??"";O({open:!0,files:D,entries:K,selectedEntry:_e,result:null,loading:!0,error:null}),await Qe(D,K,_e)}catch(D){d(D.message)}}async function Qe(P,D,K){O(ne=>({...ne,open:!0,files:P,entries:D,selectedEntry:K,loading:!0,error:null}));try{const ne=await Om(P,K);O(_e=>({..._e,result:ne,loading:!1,error:null}))}catch(ne){O(_e=>({..._e,result:null,loading:!1,error:ne.message}))}}function Oe(P){var D;xe(P.blueprint),A(P.diagnostics),y({score:P.confidenceSummary.score,warnings:P.diagnostics.filter(K=>K.severity==="warning").length,sourceKind:(D=P.blueprint.provenance)==null?void 0:D.source_kind}),O(K=>({...K,open:!1})),d(s==="zh-Hant"?`已載入 Angular 畫面:${P.blueprint.nodes.length} 個節點,${P.diagnostics.length} 個診斷。`:`Loaded Angular screen: ${P.blueprint.nodes.length} nodes and ${P.diagnostics.length} diagnostics.`)}async function jt(P){var ne;if(!V)return;const D=await((ne=J.current)==null?void 0:ne.captureViewports()),K=Xm(P,V,D==null?void 0:D.desktop,h);p(ai(K)),d(s==="zh-Hant"?`已儲存個人範本「${K.name}」。`:`Saved personal template "${K.name}".`)}function gt(P){xe(P.blueprint),d(s==="zh-Hant"?`已載入個人範本「${P.name}」。`:`Loaded personal template "${P.name}".`)}async function ut(P){try{const D=await Qm(P);p(ai(D)),gt(D)}catch(D){d(D.message)}}function L(P){window.confirm(s==="zh-Hant"?`刪除個人範本「${P.name}」?`:`Delete personal template "${P.name}"?`)&&p(Zm(P.id))}function F(P){var K;const D=tr(Xp(P,s));ve(D),j(ne=>ne+1),a([(K=D.nodes.find(ne=>ne.parent_id===null))==null?void 0:K.id].filter(Boolean)),d(T(s,"templateLoaded",{template:mt(s,P)}))}async function Z(P){const[D,K,ne]=await Promise.all([ht(P,"get_workspace_status"),ht(P,"list_blueprints"),ht(P,"list_projects")]);return{...D,blueprints:K.blueprints??[],projects:ne.projects??[]}}async function ie(){te(!0),se(null);try{const{connection:P}=await Bm(Y),D=await Z(P);z(P),N(D),M(P.endpoint),R(D.session.activeBlueprint??(V?`${V.screen.id}.ui.json`:"")),d(s==="zh-Hant"?"已連到 AUB workspace。":"Connected to AUB workspace.")}catch(P){se(P.message)}finally{te(!1)}}G.useEffect(()=>{X.current||!e||U||E||new URLSearchParams(window.location.search).has("mcp")&&(X.current=!0,ie())},[e,U,E]);async function ue(){if(U){te(!0),se(null);try{N(await Z(U))}catch(P){se(P.message)}finally{te(!1)}}}async function je(P){if(U){te(!0),se(null);try{const D=await ht(U,"get_blueprint",{ref:P});xe(D.blueprint),R(P),await ht(U,"update_aub_session",{patch:{activeBlueprint:P}}),N(await Z(U)),d(s==="zh-Hant"?`已載入 workspace Blueprint:${P}`:`Loaded workspace Blueprint: ${P}`)}catch(D){se(D.message)}finally{te(!1)}}}async function ge(){var D,K;if(!U||!V)return;const P=pe.trim()||`${V.screen.id}.ui.json`;te(!0),se(null);try{await ht(U,"write_blueprint",{path:P,blueprint:V,overwrite:!0}),await ht(U,"update_aub_session",{patch:{activeBlueprint:P,activeProject:W?`${W.id}.aub.project.json`:null,targetRoute:((K=(D=v==null?void 0:v.session)==null?void 0:D.preview)==null?void 0:K.route)??null}}),R(P),N(await Z(U)),d(s==="zh-Hant"?`已存回 workspace:${P}`:`Saved to workspace: ${P}`)}catch(ne){se(ne.message)}finally{te(!1)}}function Ee(P){xe(P.blueprint),R(`${P.blueprint.screen.id}.ui.json`),d(s==="zh-Hant"?`已載入 Workspace 範本「${P.name}」。`:`Loaded workspace template "${P.name}".`)}async function We(P){if(!U)return;const K={...(v==null?void 0:v.session.preview)??{},...P};te(!0),se(null);try{await ht(U,"update_aub_session",{patch:{preview:K,targetRoute:K.route??(v==null?void 0:v.session.targetRoute)??null}}),N(await Z(U))}catch(ne){se(ne.message)}finally{te(!1)}}async function Le(P,D,K){if(U){te(!0),se(null);try{await ht(U,"approve_component_candidate",{id:P.id,action:D,...K?{coreType:K}:{}}),N(await Z(U)),d(s==="zh-Hant"?`已審核元件候選:${P.componentName}`:`Reviewed component candidate: ${P.componentName}`)}catch(ne){se(ne.message)}finally{te(!1)}}}function et(P){const D=Mr(s,P);ve(D),j(K=>K+1),a([P==="app"?"starter_main_page":"root"]),b("brief"),d(T(s,P==="app"?"starterAppCreated":"starterPageCreated"))}function ke(P){return!oe||!V?P:{...P,screens:P.screens.map(D=>D.id===oe?{...D,blueprint:V}:D)}}function ze(P){var D;r(ni(P.blueprint)),we(P.id),j(K=>K+1),a([(D=P.blueprint.nodes.find(K=>K.parent_id===null))==null?void 0:D.id].filter(Boolean))}function Ae(P){if(!W)return;const D=ke(W),K=D.screens.find(ne=>ne.id===P);K&&(ae(D),ze(K))}async function Ve(P){var D;try{const K=await Promise.all(Array.from(P).map(async Ne=>({file:Ne,text:await Dr(Ne)}))),ne=K.find(Ne=>/\.aub\.project\.json$/i.test(Ne.file.name)),_e=K.find(Ne=>/^aub\.registry\.json$/i.test(Ne.file.name));if(!ne){d(T(s,"projectNoDocument"));return}const Me=Nm(ne.text),Se=new Map;for(const Ne of K)if(Ne!==ne&&!(!/\.ui\.json$/i.test(Ne.file.name)&&!/\.json$/i.test(Ne.file.name)))try{const at=tr(JSON.parse(Ne.text));(D=at==null?void 0:at.screen)!=null&&D.id&&Se.set(Ne.file.name,at)}catch{}const{project:Re,missing:rt}=Pm(Me,Se);if(Re.screens.length===0){d(T(s,"projectNoDocument"));return}if(ae(Re),_e){const Ne=JSON.parse(_e.text);if(!Array.isArray(Ne.components))throw new Error('aub.registry.json is missing the required "components" array');Q(`${JSON.stringify(Ne,null,2)}
|
|
504
|
+
`)}else Q(null);const Fe=Re.screens.find(Ne=>Ne.id===Re.entryScreenId)??Re.screens[0];Fe&&ze(Fe),b("layout"),rt.length>0?d(T(s,"projectMissingScreens",{paths:rt.join(", ")})):d(T(s,"projectOpened",{name:Re.name}))}catch(K){d(K.message)}}function tt(){var D;if(!V)return;const P=Rm(V);ae(P),we(((D=P.screens[0])==null?void 0:D.id)??null),d(T(s,"projectCreated",{name:P.name}))}async function Mt(){if(!W)return;const P=ke(W);ae(P);const D=Em(P),K={[`${P.id}.aub.project.json`]:`${JSON.stringify(D,null,2)}
|
|
505
|
+
`};for(const ne of P.screens)K[ne.path]=`${JSON.stringify(ne.blueprint,null,2)}
|
|
506
|
+
`;he&&(K["aub.registry.json"]=he),await cp(`${P.id}.aub.project.zip`,K),d(T(s,"projectSaved"))}function Qt(){W&&ae(ke(W)),ae(null),we(null),Q(null),d(T(s,"projectClosed"))}function Ge(P,D){let K=P,ne=2;for(;D.has(K);)K=`${P}-${ne}`,ne+=1;return K}function en(){if(!W)return;const P=ke(W),D=new Set(P.screens.map(rt=>rt.id)),K=Mr(s,"page"),ne=Ge(`${P.id}.screen`,D),_e={...K,screen:{...K.screen,id:ne}},Me=_e.screen.name,Se={id:ne,name:Me,path:`${ne.replace(/[^a-z0-9._-]+/gi,"-")}.ui.json`,blueprint:_e},Re={...P,screens:[...P.screens,Se]};ae(Re),ze(Se),d(T(s,"screenAdded",{name:Me}))}function Ot(P){if(!W)return;if(W.screens.length<=1){d(T(s,"cannotRemoveLastScreen"));return}const D=ke(W),K=D.screens.find(Re=>Re.id===P),ne=D.screens.filter(Re=>Re.id!==P),_e=ne[0];if(!_e){d(T(s,"cannotRemoveLastScreen"));return}const Me=D.entryScreenId===P?_e.id:D.entryScreenId,Se={...D,screens:ne,entryScreenId:Me,navigation:D.navigation.filter(Re=>Re.from!==P&&Re.to!==P)};ae(Se),oe===P&&ze(_e),d(T(s,"screenRemoved",{name:(K==null?void 0:K.name)??P}))}function nt(P,D){ae(K=>K&&{...K,screens:K.screens.map(ne=>ne.id===P?{...ne,name:D,blueprint:{...ne.blueprint,screen:{...ne.blueprint.screen,name:D}}}:ne)})}function Zr(P){ae(D=>D&&{...D,entryScreenId:P})}function hr(P){ae(D=>D&&{...D,navigation:P})}function mr(P){ae(D=>D&&{...D,...P})}G.useEffect(()=>{if(!u)return;const P=window.setTimeout(()=>d(null),2600);return()=>window.clearTimeout(P)},[u]),G.useEffect(()=>{if(!V)return;const P=window.setTimeout(()=>{B(Gm(V,s))},350);return()=>window.clearTimeout(P)},[V,s]),G.useEffect(()=>{l&&$(!1)},[l]),G.useEffect(()=>{if(!V||!["responsive","handoff"].includes(_))return;let P=!1;x(null);const D=window.setTimeout(()=>{var K;(K=J.current)==null||K.auditViewports().then(ne=>{P||x(ne)})},120);return()=>{P=!0,window.clearTimeout(D)}},[V,_]),G.useEffect(()=>{const P=window.matchMedia("(max-width: 980px)"),D=()=>{P.matches&&$(!1)};return D(),P.addEventListener("change",D),()=>P.removeEventListener("change",D)},[]),G.useEffect(()=>{function P(D){if(sf(D.target))return;const K=D.metaKey||D.ctrlKey;K&&D.key.toLowerCase()==="z"?(D.preventDefault(),r(ne=>D.shiftKey?Ir(ne):ri(ne))):K&&D.key.toLowerCase()==="y"&&(D.preventDefault(),r(ne=>Ir(ne)))}return window.addEventListener("keydown",P),()=>window.removeEventListener("keydown",P)},[]);function Ut(P,D=null,K,ne="desktop",_e={}){var at,ta;const Me=ft(s,P),Se=Uo(P,T(s,"addedByEditor",{type:Me}),Me),Re={...Se,content:cf(s,P,Me,Se.content)},rt=V==null?void 0:V.nodes.find(_t=>_t.parent_id===null),Fe=ce?V==null?void 0:V.nodes.find(_t=>_t.id===ce):null,Ne=D?(at=V==null?void 0:V.nodes.find(_t=>_t.id===D))==null?void 0:at.name:Fe&&qe(Fe.type)?Fe.name:Fe!=null&&Fe.parent_id?(ta=V==null?void 0:V.nodes.find(_t=>_t.id===Fe.parent_id))==null?void 0:ta.name:rt==null?void 0:rt.name;ve(_t=>{var ra,aa,oa;let Ye=_t??Mr(s);const He=Ye.nodes.find(ot=>ot.parent_id===null),zt=ce?Ye.nodes.find(ot=>ot.id===ce):null,na=P==="top_bar"||P==="header"||P==="bottom_nav",Dt=D??(zt&&qe(zt.type)?zt.id:zt==null?void 0:zt.parent_id)??(He==null?void 0:He.id)??null,fr=Dt?Ye.nodes.find(ot=>ot.id===Dt):null,ts=na&&(He==null?void 0:He.type)==="app_shell",ns=na&&(He==null?void 0:He.type)!=="app_shell";let pt=Re;if((ra=_e.existingPlacements)!=null&&ra.length&&(Ye=Ko(Ye,_e.existingPlacements)),_e.makeParentFreeform&&Dt){const ot=Ye.nodes.find(rs=>rs.id===Dt);ot&&(Ye=ar(Ye,Dt,{layout:{...ot.layout,mode:"freeform"}}))}if((_e.makeParentFreeform||((aa=fr==null?void 0:fr.layout)==null?void 0:aa.mode)==="freeform"||((oa=He==null?void 0:He.layout)==null?void 0:oa.mode)==="freeform")&&(pt={...pt,placements:li(Ye,pt.type,K,ne)}),P==="sidebar"&&(pt={...pt,layout:{...pt.layout,width:{value:240,unit:"px"}}}),ts&&He)return Jo(Ye,pt,He.id);if(ns&&He){const ot=Uo("app_shell",T(s,"starterAppShellRole"),T(s,"starterAppShellName"));return ot.layout={mode:"freeform"},Ep(Ye,ot,{...pt,placements:li(Ye,pt.type,K,ne)})}return Jo(Ye,pt,Dt)}),a([Re.id]),d(T(s,_e.makeParentFreeform?"placedFreely":"addedToContainer",{component:Me,container:Ne??T(s,"starterRootName")}))}function Jt(P,D){ve(K=>K&&ar(K,P,D))}function tn(P){ve(D=>D&&Ko(D,P))}function Kt(P){ve(D=>D&&P.reduce((K,ne)=>{const _e=K.nodes.find(Me=>Me.id===ne);return _e!=null&&_e.parent_id?Ap(K,ne):K},D)),a([])}function Ct(P){if(!V)return;const D=Tp(V,P,K=>T(s,"duplicateName",{name:K}));ve(D.blueprint),a(D.ids)}function nn(P,D){ve(K=>K&&Wo(K,P,D))}function Zi(P,D,K,ne){const _e=V==null?void 0:V.nodes.find(Se=>Se.id===P),Me=V==null?void 0:V.nodes.find(Se=>Se.id===D);ve(Se=>{var Ne;if(!Se)return Se;const Re=Se.nodes.find(at=>at.id===P),rt=Se.nodes.find(at=>at.id===D);if(!Re||!rt)return Se;let Fe=Re.parent_id===D?Se:Wo(Se,P,D);return((Ne=rt.layout)==null?void 0:Ne.mode)==="freeform"&&K&&(Fe=or(Fe,P,ne,K)),Fe}),a([P]),_e&&Me&&d(T(s,"movedToContainer",{component:_e.name,container:Me.name}))}function Xi(P,D,K){ve(ne=>ne&&Ip(ne,P,D,K))}function Qi(P,D){ve(K=>K&&Rp(K,P,D))}async function Xr(){V&&Tt(`${V.screen.id}.ui.md`,await si(V),"text/markdown")}function Qr(){V&&Tt(`${V.screen.id}.ui.json`,`${JSON.stringify(V,null,2)}
|
|
507
|
+
`,"application/json")}async function es(){V&&Tt(`${V.screen.id}.codex.md`,await ci(V),"text/markdown")}async function ea(){if(!V||!J.current)return;const P=await J.current.auditViewports();if(x(P),P.issues.length>0){d(T(s,"viewportQualityBlocked",{count:P.issues.length}));return}d(T(s,"preparingPackage"));const D=await J.current.captureViewports(),K=await si(V),[ne,_e]=await Promise.all([nf(V),ci(V)]),Me=await rf(V);await sp(V,K,ne,_e,Me,D,he),d(T(s,"packageReady"))}const Wt=i.length===1?(V==null?void 0:V.nodes.find(P=>P.id===ce))??null:null;return o.jsxs("div",{className:"app",children:[o.jsx(jh,{blueprint:V,onImport:xe,onAngularFiles:Pe,onPersonalTemplateFile:ut,onRegistryFile:P=>void Te(P),onDownloadAuthoringKit:()=>void lp(),onOpenProject:P=>void Ve(P),onNewProject:tt,onSaveProject:()=>void Mt(),onCloseProject:Qt,projectActive:W!==null,onExportJson:Qr,onExportMarkdown:Xr,onExportPackage:ea,packageBlocked:!!(f!=null&&f.issues.length),errorCount:$e.length,fileInputRef:q,language:s,onLanguageChange:c,onTemplateSelect:F,canUndo:n.past.length>0,canRedo:n.future.length>0,onUndo:()=>r(P=>ri(P)),onRedo:()=>r(P=>Ir(P))}),o.jsx(am,{blueprint:V,language:s,stage:_,savedAt:H,errorCount:$e.length,viewportQuality:f,onChange:b}),o.jsx(Fm,{language:s,endpoint:Y,connected:U!==null,loading:E,error:ee,status:v,blueprint:V,savePath:pe,onEndpointChange:M,onConnect:()=>void ie(),onDisconnect:()=>{z(null),N(null),se(null)},onRefresh:()=>void ue(),onLoadBlueprint:P=>void je(P),onSaveBlueprint:()=>void ge(),onSavePathChange:R,onPreviewChange:P=>void We(P),onReviewCandidate:(P,D,K)=>void Le(P,D,K)}),W&&o.jsx(Tm,{project:W,activeScreenId:oe,language:s,onSwitchScreen:Ae,onAddScreen:en,onRemoveScreen:Ot,onRenameScreen:nt,onSetEntryScreen:Zr,onUpdateNavigation:hr,onUpdateMeta:mr}),o.jsxs("div",{className:["body",g?"":"properties-collapsed",_==="layout"?"":"workflow-spec"].filter(Boolean).join(" "),children:[_==="layout"&&o.jsx(kh,{blueprint:V,selectedIds:i,language:s,onAdd:P=>{var D;(D=J.current)!=null&&D.addComponent(P)||Ut(P)},onSelect:a,onReparent:nn,draggingType:l,onDraggingTypeChange:m,onTemplateSelect:F,personalTemplates:C,workspaceTemplates:(v==null?void 0:v.templates)??[],onSavePersonalTemplate:P=>void jt(P),onLoadPersonalTemplate:gt,onLoadWorkspaceTemplate:Ee,onExportPersonalTemplate:P=>void dp(P),onDeletePersonalTemplate:L}),o.jsx(Rh,{ref:J,blueprint:V,selectedIds:i,language:s,onSelectionChange:a,onAddNode:Ut,onDeleteNodes:Kt,onUpdateNode:Jt,onUpdatePlacements:tn,onMoveNode:Zi,onDuplicateNodes:Ct,onSetZIndex:Xi,onSetViewportSize:Qi,onCreateStarter:et,onTemplateSelect:F,draggingType:l,onDragComplete:()=>m(null),resetKey:k,propertiesOpen:_!=="layout"||g,onPropertiesOpen:()=>$(!0)}),_==="layout"&&g&&o.jsx(Qh,{blueprint:V,node:Wt,selectedCount:i.length,language:s,onUpdate:P=>ce&&Jt(ce,P),onUpdatePlacement:(P,D)=>ce&&ve(K=>K&&or(K,ce,P,D)),onDelete:()=>Kt(i),onSelectParent:()=>(Wt==null?void 0:Wt.parent_id)&&a([Wt.parent_id]),onReparent:P=>ce&&nn(ce,P),onCollapse:()=>$(!1)}),V&&_!=="layout"&&o.jsx(om,{blueprint:V,language:s,stage:_,errorCount:$e.length,viewportQuality:f,onChange:P=>ve(D=>D&&{...D,...P}),onExportJson:Qr,onExportMarkdown:Xr,onExportAgentPrompt:es,onExportPackage:ea})]}),u&&o.jsx("div",{className:"toast-notice",role:"status","aria-live":"polite",children:u}),_==="layout"&&w.length>0&&o.jsxs("aside",{className:"import-review-panel","aria-label":s==="zh-Hant"?"匯入診斷":"Import diagnostics",children:[o.jsxs("header",{children:[o.jsxs("div",{children:[o.jsx("strong",{children:s==="zh-Hant"?"匯入診斷":"Import diagnostics"}),o.jsx("span",{children:w.length})]}),o.jsx("button",{type:"button",className:"icon-button","aria-label":s==="zh-Hant"?"關閉匯入診斷":"Close import diagnostics",title:s==="zh-Hant"?"關閉匯入診斷":"Close import diagnostics",onClick:()=>A([]),children:"×"})]}),o.jsx("div",{className:"import-review-list",children:w.map((P,D)=>o.jsxs("button",{type:"button",className:`import-review-item ${P.severity}`,disabled:!P.node_id,onClick:()=>{P.node_id&&(a([P.node_id]),$(!0),requestAnimationFrame(()=>{var K;return(K=J.current)==null?void 0:K.focusNode(P.node_id)}))},children:[o.jsx("span",{children:P.message}),o.jsxs("small",{children:[P.file,P.line?`:${P.line}`:"",P.node_id?` · ${s==="zh-Hant"?"定位元件":"Focus node"}`:""]})]},`${P.code}-${P.node_id??D}`))})]}),o.jsx(qm,{open:S.open,language:s,files:S.files,entries:S.entries,selectedEntry:S.selectedEntry,result:S.result,loading:S.loading,error:S.error,onEntryChange:P=>void Qe(S.files,S.entries,P),onClose:()=>O(P=>({...P,open:!1})),onLoad:Oe,onResultChange:P=>O(D=>({...D,result:P}))}),o.jsx("footer",{className:"statusbar",children:V?o.jsxs(o.Fragment,{children:[o.jsxs("span",{children:[V.nodes.length," ",T(s,"nodes")," · ",i.length," ",T(s,"selected")," · ",V.acceptance.length," ",T(s,"acceptance")]}),o.jsx("span",{className:$e.length>0?"err":"ok",style:{marginLeft:"auto"},children:$e.length>0?`${$e.length} ${T(s,"schemaErrors")}`:T(s,"schemaValid")})]}):o.jsx("span",{children:T(s,"startHint")})})]})}function li(t,e,n,r){const i=t.viewports.find(c=>c.id===r)??t.viewports[0],a=Ft(e,n??{x:32,y:32}),s={};for(const c of t.viewports){const u=i?Math.min(1,c.width/i.width):1,d=i?a.width>i.width*.5:!1,l=i?a.height>i.height*.5:!1,m=d?Math.round(a.width*u):a.width,g=l?Math.round(a.height*u):a.height,$=Math.max(24,Math.min(m,c.width-32)),k=Math.max(1,Math.min(g,c.height-32));s[c.id]={...a,x:Math.max(0,Math.min(Math.round(a.x*u),c.width-$)),y:Math.max(0,Math.min(Math.round(a.y*u),c.height-k)),width:$,height:k}}return s}function sf(t){if(!(t instanceof HTMLElement))return!1;const e=t.tagName.toLowerCase();return e==="input"||e==="textarea"||e==="select"||t.isContentEditable}function cf(t,e,n,r){if(!r)return r;switch(e){case"heading":case"text":case"badge":case"tag":case"link":return{...r,text:n};case"button":return{...r,label:n};case"image":case"avatar":return{...r,alt:n};case"icon":return{...r,label:n};case"textarea":return{...r,label:n,placeholder:T(t,"enterValue")};case"search_input":return{...r,label:n,placeholder:`${n}...`};default:return r}}is.createRoot(document.getElementById("root")).render(o.jsx(ss.StrictMode,{children:o.jsx(of,{})}));export{Ur as d};
|