@vcp-dev/contracts 0.10.31 → 0.10.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/auth-account.d.ts +12 -0
- package/dist/designer-bridge-telemetry.d.ts +86 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +7 -7
- package/dist/site-edit-version.d.ts +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import{z as t}from"zod";import{z as re}from"zod";import{z as j}from"zod";import{z as bd}from"zod";var Q=bd.uuidv7(),ck=Q,mk=Q,lk=Q,pk=Q,dk=Q,uk=Q,_k=Q,k=Q,Yt=Q,Ya=Q,Ae=Q,Ti=Q,I=Q,Xa=Q,$=Q,Qa=Q,st=Q,cs=Q,lt=Q,gk=Q,hk=Q,ms=Q,it=Q,Za=Q,Sk=Q,fk=Q,bk=Q,Rn=Q,yk=Q,xk=Q,Ek=Q;var Ja=Q,ki=j.enum(["external_site_edit","page_template_create"]),yd=200,Lt=j.string().min(1).max(yd),xd=4e3,er=j.enum(["succeeded","degraded","no_changes","failed"]),In=j.enum(["typecheck_unresolved","step_cap_reached","partial_apply_gave_up","patch_protected_dropped","preview_build_failed","preview_runtime_degraded","build_not_verified","external_blocked","cms_reconcile_failed","run_expired","sandbox_unavailable"]),Tn=j.object({code:j.enum(["preexisting_placeholder_media"]),block_ids:j.array(j.string().min(1))}).strict(),Ed=["sandbox_unavailable"];function kk(e){return e!=null&&Ed.includes(e)}var Rd=j.enum(["pending","delivered","failed"]),Id=j.enum(["running","succeeded","degraded","no_changes","failed"]),Ak=j.object({site_id:k,external_run_id:Lt,external_thread_id:Lt,prompt:j.string().min(1).max(xd),thread_title:j.string().trim().min(1).max(200).optional()}).strict(),Ai=j.enum(["added","modified","deleted"]),Td=j.enum(["landing_page","general_page","detail_page"]),kd=j.enum(["header","footer","styles","layout"]),tr={block_id:j.string().min(1),type:j.string().min(1),change:Ai},nr={slug:j.string().min(1),title:j.string().min(1),page_type:Td,change:Ai},Ad=j.object({kind:kd,change:Ai}).strict(),sr={site_wide:j.array(Ad),unclassified_count:j.number().int().nonnegative()},Pd=j.object(tr).strict(),wd=j.object({...nr,sections:j.array(Pd)}).strict(),Cd=j.object({pages:j.array(wd),...sr}).strict(),vd=j.object({...tr,label:j.string().min(1)}).strict(),Dd=j.object({page_id:j.number().int().positive().nullable(),...nr,sections:j.array(vd)}).strict(),ir=j.object({pages:j.array(Dd),...sr}).strict(),Pk={pages:[],site_wide:[],unclassified_count:0},wk=j.object({base_snapshot_id:I,target_snapshot_id:I}).strict(),Ck=j.object({data:Cd}).strict(),ls=j.object({id:Ja,execution_scene:ki.default("external_site_edit"),site_id:k,external_run_id:j.string().min(1).nullable(),external_thread_id:j.string().min(1).nullable(),status:Id,outcome:er.nullable(),degraded_reason:In.nullable(),vcp_run_id:$.nullable(),vcp_thread_id:st.nullable(),base_snapshot_id:I,snapshot_id:I.nullable(),preview_url:j.string().url().nullable(),summary:j.string().nullable(),error_code:j.string().nullable(),build_verified:j.boolean().nullable(),callback_status:Rd.nullable(),created_at:j.string().min(1),started_at:j.string().min(1).nullable(),finished_at:j.string().min(1).nullable(),changes:ir.nullable().default(null),advisories:j.array(Tn).nullable().default(null)}).strict().superRefine((e,n)=>{e.execution_scene==="page_template_create"?((e.external_run_id===null!=(e.external_thread_id===null)||e.callback_status!==null)&&n.addIssue({code:"custom",message:"Page Template tasks require paired external identities and no callback"}),(!["running","succeeded","failed"].includes(e.status)||e.outcome!==null&&!["succeeded","failed"].includes(e.outcome)||e.degraded_reason!==null)&&n.addIssue({code:"custom",message:"Page Template tasks require strict whole-batch outcomes"}),e.changes!==null&&n.addIssue({code:"custom",message:"Page Template tasks never carry changes"}),e.advisories!==null&&e.status!=="succeeded"&&n.addIssue({code:"custom",message:"Page Template advisories belong to succeeded tasks only"})):e.advisories!==null?n.addIssue({code:"custom",message:"External edit tasks never carry advisories"}):(!e.external_run_id||!e.external_thread_id||!e.callback_status)&&n.addIssue({code:"custom",message:"External edit tasks require external identity and callback status"})}),vk=j.object({task:ls}).strict(),Dk=j.object({task:ls}).strict(),Ok=j.object({task_id:Ja,external_run_id:j.string().min(1),external_thread_id:j.string().min(1),site_id:k,vcp_run_id:$.nullable(),outcome:er,degraded_reason:In.nullable(),snapshot_id:I.nullable(),preview_url:j.string().url().nullable(),summary:j.string().nullable(),error_code:j.string().nullable(),build_verified:j.boolean().nullable(),retryable:j.boolean(),finished_at:j.string().min(1),changes:ir.nullable().default(null)}).strict(),Nk=j.object({received:j.literal(!0)}).strict();var Xe=re.string().min(1).max(191).refine(e=>{if(/[^\x20-\x7e\xa0-\xff]/.test(e)||e.startsWith(" ")||e.endsWith(" ")||new TextEncoder().encode(e).length>191)return!1;try{return new Headers({"x-template-id":e}).get("x-template-id")===e}catch{return!1}},{message:"template_id must round-trip through HTTP headers and fit a 255-byte base64url filename"}),kn=re.string().min(1).refine(e=>e.startsWith("/")&&!e.startsWith("//")&&!/[?#\\\x00-\x20\x7f]/.test(e)&&!e.startsWith("/.vcp")&&!e.split("/").some(n=>{try{let s=decodeURIComponent(n);return s==="."||s===".."||/[/\\\x00-\x1f\x7f]/.test(s)||s.startsWith(".vcp")}catch{return!0}}),{message:"page_path must start with / and must not contain ? or #"});function or(e){return/^\[\[\.\.\.[^\[\]]+\]\]$|^\[[^\[\]]+\]$/.test(e)}function ps(e){let n=/^(?:src\/)?app\/\.vcp\/page-templates\/(.+)\/page\.tsx$/.exec(e);if(!n)return!1;let s=n[1].split("/"),i=s.some(or),o=i?s[0]:s.pop(),a=i?s.slice(1):s;if(i&&a.length===0||!/^[A-Za-z0-9_-]{1,255}$/.test(o)||!kn.safeParse(`/${a.join("/")}`).success||a.some(c=>c?c.includes("[")||c.includes("]")?!or(c):/[\[\]()%]/.test(c)||c.startsWith("_")||c.startsWith("@"):!0))return!1;try{let c=atob(o.replace(/-/g,"+").replace(/_/g,"/")),r=Uint8Array.from(c,x=>x.charCodeAt(0)),m=new TextDecoder("utf-8",{fatal:!0}).decode(r);return Xe.safeParse(m).success&&btoa(String.fromCharCode(...new TextEncoder().encode(m))).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")===o}catch{return!1}}var ar=re.object({page_path:kn,template_id:Xe,instruction:re.string().min(1).refine(e=>e.trim().length>0)}).strict(),rr=3;function cr(e){return e.replace(/\/+$/,"")||"/"}var Fk=re.object({external_run_id:Lt,external_thread_id:Lt,items:re.array(ar).min(1).max(rr)}).strict().transform(e=>({external_run_id:e.external_run_id,external_thread_id:e.external_thread_id,items:e.items.map(n=>({...n,page_path:cr(n.page_path)}))})).superRefine((e,n)=>{let s=new Set;e.items.forEach((i,o)=>{let a=JSON.stringify([i.page_path,i.template_id]);s.has(a)&&n.addIssue({code:"custom",path:["items",o],message:"Duplicate normalized page_path/template_id identity"}),s.add(a)})}),mr=re.object({items:re.array(ar).min(1).max(rr)}).strict().refine(e=>e.items.every(n=>n.page_path===cr(n.page_path))&&new Set(e.items.map(n=>JSON.stringify([n.page_path,n.template_id]))).size===e.items.length,{message:"Batch Manifest must contain unique normalized identities"}),lr=e=>[...new Set(e)],Gk=re.object({page_path:kn,template_id:Xe,exit_template_ids:re.array(Xe).default([]).transform(lr)}).strict().refine(e=>!e.exit_template_ids.includes(e.template_id),{path:["exit_template_ids"],message:"exit_template_ids must not contain the promoted template"}),qk=re.object({page_path:kn,template_ids:re.array(Xe).min(1).transform(lr)}).strict(),pr={ok:re.literal(!0),site_id:k,page_path:kn,route_id:re.string().min(1),snapshot_id:I,advisories:re.array(Tn).default([])},Od=ls.safeExtend({execution_scene:re.literal("page_template_create"),external_run_id:Lt,external_thread_id:Lt,callback_status:re.null(),status:re.enum(["running","succeeded","failed"]),outcome:re.enum(["succeeded","failed"]).nullable(),degraded_reason:re.null(),changes:re.null().default(null)}),Wk=re.object({task:Od}).strict(),Bk=re.object({...pr,promoted_template_id:Xe,deleted_template_ids:re.array(Xe),status:re.literal("promoted")}).strict(),Kk=re.object({...pr,deleted_template_ids:re.array(Xe),status:re.literal("cleaned")}).strict(),zk=re.enum(["PAGE_TEMPLATE_REQUEST_INVALID","PAGE_TEMPLATE_PAGE_NOT_FOUND","PAGE_TEMPLATE_NOT_FOUND","PAGE_TEMPLATE_ALREADY_EXISTS","PAGE_TEMPLATE_ID_COLLISION","PAGE_TEMPLATE_MANAGED_SOURCE_INVALID","PAGE_TEMPLATE_SNAPSHOT_CONFLICT","PAGE_TEMPLATE_SOURCE_UNSUPPORTED","PAGE_TEMPLATE_GENERATION_FAILED","PAGE_TEMPLATE_PATCH_FAILED"]);import{z as ds}from"zod";var dr=ds.object({primary_products:ds.string().trim().min(1).max(1e3).optional(),current_markets:ds.string().trim().min(1).max(1e3).optional(),qualifications:ds.string().trim().min(1).max(1e3).optional()}).strict();function Vk(e){return Object.values(e).some(n=>typeof n=="string"&&n.trim().length>0)}import{z as pt}from"zod";var ur={autoplay:pt.boolean().optional(),intervalMs:pt.number().int().min(5e3).max(15e3).optional(),loop:pt.boolean().optional()},us=pt.discriminatedUnion("kind",[pt.object({kind:pt.literal("media-carousel"),presentation:pt.enum(["flat","angled"]).optional(),...ur}).strict(),pt.object({kind:pt.literal("category-carousel"),...ur}).strict()]);import{z as An}from"zod";var Nd=40,Mt=An.object({protocol:An.enum(["phone","form","download","route","external"]),ctaLabel:An.string().min(1).max(Nd),ctaTarget:An.string().min(1).max(200).optional(),requiresOwnerDetail:An.boolean().optional()});var Xt=["queued","preparing_source","building","artifact_ready","deploying","released","lock_failed","source_prepare_failed","build_failed","artifact_fetch_failed","artifact_validation_failed","deploy_failed","cleanup_failed"];function e0(e){let n=e.VCP_REDIS_URL??e.REDIS_URL;if(n){let s=new URL(n);return{url:n,host:s.hostname,port:s.port?Number(s.port):6379,password:s.password?decodeURIComponent(s.password):void 0}}return{host:e.VCP_REDIS_HOST??"127.0.0.1",port:jd(e.VCP_REDIS_PORT,56379)}}function jd(e,n){if(!e)return n;let s=Number(e);return Number.isInteger(s)&&s>0?s:n}import{z as ae}from"zod";var Ld=ae.enum(["component","page","shared"]),Md=ae.enum(["generation_failed","repair_exhausted","page_unusable","check_incomplete","design_missing","chrome_fallback","style_fallback","resume_exhausted","user_stopped","conflict"]),_r=ae.object({kind:Ld,target_id:ae.string().min(1),page_id:ae.string().min(1).nullable(),reason:Md,repair_attempts:ae.number().int().nonnegative(),message:ae.string().min(1),filled:ae.boolean().optional()}).strict(),Ud=ae.enum(["complete","partial","omitted","check_incomplete","pending"]),Fd=ae.object({page_id:ae.string().min(1),slug:ae.string().min(1),title:ae.string().min(1),parent_page_id:ae.string().min(1).nullable(),result:Ud,attempts:ae.number().int().nonnegative(),omissions:ae.array(_r)}).strict(),Pn=ae.object({schema_version:ae.literal(1),sitemap_id:ae.string().min(1),confirmed_page_ids:ae.array(ae.string().min(1)).min(1),pages:ae.array(Fd),shared:ae.array(_r),stopped_by_user:ae.boolean(),resume_count:ae.number().int().nonnegative(),home_replaced_by:ae.string().min(1).nullable(),updated_at:ae.string().min(1)}).strict(),gr=ae.object({type:ae.literal("workspace.generation_ledger"),ledger:Pn,at:ae.string().min(1)}).strict();function s0(e){return e.pages.filter(n=>n.result==="complete"||n.result==="partial").length}function i0(e){return e.pages.filter(n=>n.result==="complete"||n.result==="partial"||n.omissions.some(s=>s.kind==="page")).length}import{z as F}from"zod";var Pi=F.enum(["text","url","document","image"]),wi=F.enum(["pending","ready","failed"]),Gd=F.enum(["pending","ready","failed"]),qd=F.enum(["product","price","contact","copy","audience","other"]),_s=F.object({fact:F.string().min(1).max(300),kind:qd,source_id:Rn,quote:F.string().min(1).max(500),trust:F.enum(["verbatim","ocr"]).default("verbatim")}),Wd=F.object({page_type:F.string().min(1).max(40),sections:F.array(F.string().min(1).max(40)).max(12)}),gs=F.object({source_id:Rn,nav_structure:F.array(F.string().min(1).max(30)).max(12),page_patterns:F.array(Wd).max(10),tone:F.array(F.string().min(1).max(20)).max(8),screenshot_ref:F.string().optional()}),Bd=F.object({source_id:Rn,type:Pi,status:wi,title:F.string().max(120).optional(),original_ref:F.string().min(1),source_metadata:F.record(F.string(),F.unknown()),error_code:F.string().optional(),submitted:F.boolean().optional()}),hs=F.object({topic:F.string().min(1).max(80),variants:F.array(F.object({value:F.string().min(1).max(300),source_id:Rn})).min(2)}),Kd=F.object({type:F.literal("text"),content:F.string().min(20).max(1e4),title:F.string().min(1).max(120).optional()}).strict(),zd=F.object({type:F.literal("url"),url:F.string().url().max(2048),rights_ack:F.boolean().optional(),title:F.string().min(1).max(120).optional()}).strict(),c0=F.discriminatedUnion("type",[Kd,zd]),m0=[".docx",".html",".md",".txt"],l0=["application/vnd.openxmlformats-officedocument.wordprocessingml.document","text/html","text/markdown","text/x-markdown","text/plain","application/octet-stream"],p0=10*1024*1024,d0=2,u0=F.object({consent_cross_border:F.union([F.literal(!0),F.literal("true")]),consent_text_version:F.string().min(1).max(120),title:F.string().min(1).max(120).optional()}).strict();function _0(e){return e===!0||e==="true"}var g0=[".png",".jpg",".jpeg",".webp"],h0=["image/png","image/jpeg","image/webp","application/octet-stream"],S0=8*1024*1024,f0=10,Hd=F.enum(["asset","reference"]),b0=F.object({image_role:Hd,title:F.string().min(1).max(120).optional()}).strict(),y0=F.object({version:F.literal(1),site_id:k,tenant_id:F.string().min(1),user_prompt:F.string(),status:Gd,sources:F.array(Bd).max(16),facts:F.array(_s).max(120),reference:gs.optional(),conflicts:F.array(hs).max(20)}).superRefine((e,n)=>{let s=new Map(e.sources.map(i=>[i.source_id,i]));for(let[i,o]of e.facts.entries()){let a=s.get(o.source_id);(!a||a.type==="url")&&n.addIssue({code:"custom",path:["facts",i,"source_id"],message:"facts must reference a text/document/image source (never url)"})}if(e.reference){let i=s.get(e.reference.source_id),o=i?.type==="image"&&i.source_metadata.image_role==="reference";(!i||i.type!=="url"&&!o)&&n.addIssue({code:"custom",path:["reference","source_id"],message:"reference must point at a url source or reference image source"})}});function x0(e){for(let n of e.sources)if(n.type==="image"&&n.status==="ready"&&n.source_metadata?.image_role==="reference")return{source_id:n.source_id};return e.reference?.screenshot_ref?{source_id:e.reference.source_id}:null}import{z as L}from"zod";import{z as Ss}from"zod";var ge=Ss.object({routeId:Ss.string().min(1),templateId:Xe.optional()}).strict(),K=Ss.object({routeId:Ss.string().min(1),effectiveTemplateId:Xe.optional()}).strict();function Ci(e){return JSON.stringify([e.routeId,e.effectiveTemplateId??null])}function T0(e){let n;try{n=JSON.parse(e)}catch{return null}if(!Array.isArray(n)||n.length!==2)return null;let[s,i]=n,o=K.safeParse(i===null?{routeId:s}:{routeId:s,effectiveTemplateId:i});return o.success?o.data:null}var $d=["design.md","DESIGN.md"],hr=["components/site","src/components/site","lib/generated","src/lib/generated","public"],Vd=["components/system/not-found-content.tsx","src/components/system/not-found-content.tsx"],Yd=["app/globals.css","src/app/globals.css"],Xd=[".cjs",".css",".cts",".html",".js",".json",".jsx",".md",".mdx",".mjs",".mts",".ts",".tsx",".txt",".yaml",".yml"],Qd=new Set(Xd),vi="source-delete",Sr=L.literal(vi),Re=L.string().min(1).refine(br,"Invalid site edit source path"),Zd=L.string().min(1).refine(au,"Invalid site edit source directory path"),C0=L.enum(["text","binary"]),fs=L.object({composition:K,path:Re,language:L.string().min(1).nullable(),sizeBytes:L.number().int().nonnegative(),contentHash:L.string().min(1).optional()}).strict(),Jd=L.discriminatedUnion("kind",[fs.extend({kind:L.literal("text"),language:L.string().min(1),readonly:L.boolean().default(!1)}),fs.extend({kind:L.literal("binary"),language:L.null(),mimeType:L.string().min(1).optional(),readonly:L.literal(!0)})]),fr=L.lazy(()=>L.discriminatedUnion("kind",[L.object({kind:L.literal("directory"),name:L.string().min(1),path:Zd,children:L.array(fr)}),L.object({kind:L.literal("file"),name:L.string().min(1),path:Re,file:Jd}).superRefine((e,n)=>{e.path!==e.file.path&&n.addIssue({code:"custom",path:["file","path"],message:"file.path must match node path"})})])),eu=L.enum(["max-files","max-depth","max-total-bytes"]),tu=L.object({reasons:L.array(eu).min(1),maxFiles:L.number().int().positive(),maxDepth:L.number().int().positive(),maxTotalBytes:L.number().int().positive()}),v0=L.object({composition:K,nodes:L.array(fr),defaultPath:Re.optional(),totalFiles:L.number().int().nonnegative(),truncated:tu.optional()}).strict(),D0=L.object({composition:ge}).strict(),O0=L.object({path:Re,composition:ge}).strict(),nu=fs.extend({kind:L.literal("text"),language:L.string().min(1),readonly:L.boolean().default(!1),content:L.string()}),su=L.enum(["too-large","unsupported-mime","bytes-unavailable"]),iu=fs.extend({kind:L.literal("binary"),language:L.null(),readonly:L.literal(!0),mimeType:L.string().min(1),contentBase64:L.string().min(1).optional(),previewUnavailableReason:su.optional()}),N0=L.discriminatedUnion("kind",[nu,iu]),j0=L.object({key:L.string().min(1),composition:ge}).strict(),ou=L.object({startLine:L.number().int().positive(),startColumn:L.number().int().nonnegative(),endLine:L.number().int().positive(),endColumn:L.number().int().nonnegative()}),L0=L.object({key:L.string().min(1),composition:K,sourceFile:Re,componentName:L.string().min(1),openingElementRange:ou,structuralPath:L.string().min(1),textPreview:L.string().min(1).optional()}).strict();function br(e){return!bs(e)&&!cu(e)||pu(e)?!1:Ni(e)||Er(e)||xr(e)||yr(e)||hr.some(n=>e===n||e.startsWith(`${n}/`))}function Di(e){return Ni(e)||Qd.has(lu(e))}function au(e){return!bs(e)&&!mu(e)||du(e)?!1:e==="app"||e.startsWith("app/")||e==="src"||e==="src/app"||e.startsWith("src/app/")||hr.some(n=>e===n||e.startsWith(`${n}/`)||n.startsWith(`${e}/`))}function ru(e){return Ni(e)}function Oi(e){return br(e)?ru(e)?"design-document":xr(e)?"route-entry":Er(e)?"app-global-style":e.toLowerCase()==="lib/generated/media-assets.ts"||e.toLowerCase()==="src/lib/generated/media-assets.ts"?"generated-media-manifest":yr(e)?"system-page":null:null}function yr(e){return Vd.includes(e)}function M0(e){return Oi(e)!==null}function xr(e){return/^(?:src\/)?app\/(?:.*\/)?page\.[cm]?[jt]sx?$/.test(e.toLowerCase())}function cu(e){return ps(e)&&bs(e.replace("/.vcp/","/_vcp/"))}function mu(e){return/^(?:src\/)?app\/\.vcp(?:\/page-templates(?:\/.+)?)?$/i.test(e)?bs(e.replace("/.vcp","/_vcp")):!1}function Er(e){return Yd.some(n=>n.toLowerCase()===e.toLowerCase())}function lu(e){let n=e.split("/").at(-1)??e,s=n.lastIndexOf(".");return s>0?n.slice(s).toLowerCase():""}function Ni(e){return!e.includes("/")&&$d.some(n=>n.toLowerCase()===e.toLowerCase())}function pu(e){let n=e.toLowerCase(),s=n.split("/"),o=(s.at(-1)??n).replace(/\.[^.]+$/,"");return/^(?:src\/)?app\/api(?:\/|$)/.test(n)||/^(?:src\/)?app\/(?:.*\/)?route\.[cm]?[jt]sx?$/.test(n)||/^(?:src\/)?app\/(?:.*\/)?(?:action|actions)\.[cm]?[jt]sx?$/.test(n)||/(^|\/)[^/]+\.server\.[cm]?[jt]sx?$/.test(n)||n==="lib/server"||n.startsWith("lib/server")||n==="src/lib/server"||n.startsWith("src/lib/server")||n==="lib/db"||n.startsWith("lib/db")||n==="src/lib/db"||n.startsWith("src/lib/db")||n==="lib/cms"||n.startsWith("lib/cms/")||n==="src/lib/cms"||n.startsWith("src/lib/cms/")?!0:o==="server"||o==="db"||o==="database"||o==="auth"||o==="secret"||o==="secrets"||o==="token"||o==="tokens"||o==="credential"||o==="credentials"||s.includes("server")||s.includes("secrets")}function du(e){let n=e.toLowerCase();return/^(?:src\/)?app\/api(?:\/|$)/.test(n)||n==="lib/server"||n.startsWith("lib/server/")||n==="src/lib/server"||n.startsWith("src/lib/server/")||n==="lib/db"||n.startsWith("lib/db/")||n==="src/lib/db"||n.startsWith("src/lib/db/")||n==="lib/cms"||n.startsWith("lib/cms/")||n==="src/lib/cms"||n.startsWith("src/lib/cms/")}function bs(e){return!e||e.startsWith("/")||e.includes("\\")?!1:e.split("/").every(n=>!(n.length===0||n==="."||n===".."||n.startsWith(".")||n==="package.json"||n==="node_modules"||n==="recipes"||n.startsWith(".env")))}import{z as Pe}from"zod";var Rr=Pe.string().min(1).max(320).refine(e=>!e.includes("..")&&/^(?:(?:src\/)?(?:app|pages|components|lib|hooks|utils|types)\/|next\.config\.)[\w./()[\]@-]+$/.test(e)),uu=Pe.union([Rr,Pe.string().max(320).regex(/^\.next\/[\w./()[\]@-]+\.js$/).refine(e=>!e.includes(".."))]),ji=Pe.object({code:Pe.enum(["NEXT_PAGE_CODE_ERROR","NEXT_CLIENT_COMPONENT_FUNCTION_PROP"]),message:Pe.string().min(1).max(2e3),messages:Pe.array(Pe.string().min(1).max(2e3)).max(3),source_paths:Pe.array(Rr).max(8),components:Pe.array(Pe.string().max(80).regex(/^[\w.$-]+$/)).max(8),stack:Pe.array(Pe.object({file:uu,line:Pe.number().int().positive(),column:Pe.number().int().nonnegative(),function:Pe.string().max(80),generated:Pe.boolean()}).strict()).max(8)}).strict();function _u(e){return e==="NEXT_PAGE_CODE_ERROR"||e==="NEXT_CLIENT_COMPONENT_FUNCTION_PROP"}import{z as gu}from"zod";var wn=["zh-CN","zh-HK","zh-TW","en-US","en-GB","ja-JP","ko-KR","es-ES","fr-FR","de-DE","pt-PT","ru-RU","ar-SA","id-ID","vi-VN","th-TH","it-IT","nl-NL","tr-TR","pl-PL","uk-UA","cs-CZ","sk-SK","hu-HU","ro-RO","el-GR","sv-SE","da-DK","fi-FI","hr-HR","lt-LT","lv-LV","et-EE","ga-IE","mt-MT","ka-GE","fa-IR","bn-BD","ta-IN","si-LK","ms-MY","fil-PH","my-MM","km-KH","lo-LA","mn-MN","kk-KZ"],hu=["en","ja","es","fr","de","ko","pt","pt-BR","it","ru","ar","hi","id","vi","th","tr","nl","pl","uk","sv","da","fi","no","cs","el","hu","ro","he","ms","fil","bn","ta","ca","sk","hr","bg","lt","lv","et","fa","sw","sr","is"],Su=[...wn,...hu],fu=new Set(["ar","fa","he"]),W0=[{code:"zh-CN",label:"\u7B80\u4F53\u4E2D\u6587",englishName:"Chinese (Simplified)"},{code:"zh-HK",label:"\u7E41\u9AD4\u4E2D\u6587\uFF08\u9999\u6E2F\uFF09",englishName:"Chinese (Traditional, Hong Kong)"},{code:"zh-TW",label:"\u7E41\u9AD4\u4E2D\u6587\uFF08\u53F0\u7063\uFF09",englishName:"Chinese (Traditional, Taiwan)"},{code:"en-US",label:"English (US)",englishName:"English (United States)",common:!0},{code:"en-GB",label:"English (UK)",englishName:"English (United Kingdom)",common:!0},{code:"ja-JP",label:"\u65E5\u672C\u8A9E",englishName:"Japanese"},{code:"ko-KR",label:"\uD55C\uAD6D\uC5B4",englishName:"Korean"},{code:"es-ES",label:"Espa\xF1ol",englishName:"Spanish"},{code:"fr-FR",label:"Fran\xE7ais",englishName:"French"},{code:"de-DE",label:"Deutsch",englishName:"German"},{code:"pt-PT",label:"Portugu\xEAs",englishName:"Portuguese"},{code:"ru-RU",label:"\u0420\u0443\u0441\u0441\u043A\u0438\u0439",englishName:"Russian"},{code:"ar-SA",label:"\u0627\u0644\u0639\u0631\u0628\u064A\u0629",englishName:"Arabic"},{code:"id-ID",label:"Bahasa Indonesia",englishName:"Indonesian"},{code:"vi-VN",label:"Ti\u1EBFng Vi\u1EC7t",englishName:"Vietnamese"},{code:"th-TH",label:"\u0E44\u0E17\u0E22",englishName:"Thai"},{code:"it-IT",label:"Italiano",englishName:"Italian"},{code:"nl-NL",label:"Nederlands",englishName:"Dutch"},{code:"tr-TR",label:"T\xFCrk\xE7e",englishName:"Turkish"},{code:"pl-PL",label:"Polski",englishName:"Polish"},{code:"uk-UA",label:"\u0423\u043A\u0440\u0430\u0457\u043D\u0441\u044C\u043A\u0430",englishName:"Ukrainian"},{code:"cs-CZ",label:"\u010Ce\u0161tina",englishName:"Czech"},{code:"sk-SK",label:"Sloven\u010Dina",englishName:"Slovak"},{code:"hu-HU",label:"Magyar",englishName:"Hungarian"},{code:"ro-RO",label:"Rom\xE2n\u0103",englishName:"Romanian"},{code:"el-GR",label:"\u0395\u03BB\u03BB\u03B7\u03BD\u03B9\u03BA\u03AC",englishName:"Greek"},{code:"sv-SE",label:"Svenska",englishName:"Swedish"},{code:"da-DK",label:"Dansk",englishName:"Danish"},{code:"fi-FI",label:"Suomi",englishName:"Finnish"},{code:"hr-HR",label:"Hrvatski",englishName:"Croatian"},{code:"lt-LT",label:"Lietuvi\u0173",englishName:"Lithuanian"},{code:"lv-LV",label:"Latvie\u0161u",englishName:"Latvian"},{code:"et-EE",label:"Eesti",englishName:"Estonian"},{code:"ga-IE",label:"Gaeilge",englishName:"Irish"},{code:"mt-MT",label:"Malti",englishName:"Maltese"},{code:"ka-GE",label:"\u10E5\u10D0\u10E0\u10D7\u10E3\u10DA\u10D8",englishName:"Georgian"},{code:"fa-IR",label:"\u0641\u0627\u0631\u0633\u06CC",englishName:"Persian"},{code:"bn-BD",label:"\u09AC\u09BE\u0982\u09B2\u09BE",englishName:"Bengali"},{code:"ta-IN",label:"\u0BA4\u0BAE\u0BBF\u0BB4\u0BCD",englishName:"Tamil"},{code:"si-LK",label:"\u0DC3\u0DD2\u0D82\u0DC4\u0DBD",englishName:"Sinhala"},{code:"ms-MY",label:"Bahasa Melayu",englishName:"Malay"},{code:"fil-PH",label:"Filipino",englishName:"Filipino"},{code:"my-MM",label:"\u1019\u103C\u1014\u103A\u1019\u102C",englishName:"Burmese"},{code:"km-KH",label:"\u1797\u17B6\u179F\u17B6\u1781\u17D2\u1798\u17C2\u179A",englishName:"Khmer"},{code:"lo-LA",label:"\u0EA5\u0EB2\u0EA7",englishName:"Lao"},{code:"mn-MN",label:"\u041C\u043E\u043D\u0433\u043E\u043B",englishName:"Mongolian"},{code:"kk-KZ",label:"\u049A\u0430\u0437\u0430\u049B",englishName:"Kazakh"}],bu={en:"en-US",ja:"ja-JP",es:"es-ES",fr:"fr-FR",de:"de-DE",ko:"ko-KR",pt:"pt-PT",it:"it-IT",ru:"ru-RU",ar:"ar-SA",id:"id-ID",vi:"vi-VN",th:"th-TH",tr:"tr-TR",nl:"nl-NL",pl:"pl-PL",uk:"uk-UA",sv:"sv-SE",da:"da-DK",fi:"fi-FI",cs:"cs-CZ",el:"el-GR",hu:"hu-HU",ro:"ro-RO",ms:"ms-MY",fil:"fil-PH",bn:"bn-BD",ta:"ta-IN",sk:"sk-SK",hr:"hr-HR",lt:"lt-LT",lv:"lv-LV",et:"et-EE",fa:"fa-IR"},yu=new Set(wn);function Ir(e){return yu.has(e)?e:bu[e]}var xu="en";function B0(e){let n=e.toLowerCase().split("-",1)[0]??"";return fu.has(n)?"rtl":"ltr"}var Eu={cmn:"zh-CN",eng:"en",jpn:"ja",spa:"es",fra:"fr",deu:"de",kor:"ko",por:"pt",ita:"it",rus:"ru",arb:"ar",ara:"ar",hin:"hi",ind:"id",vie:"vi",tha:"th",tur:"tr",nld:"nl",pol:"pl",ukr:"uk",swe:"sv",dan:"da",fin:"fi",nob:"no",nor:"no",ces:"cs",ell:"el",hun:"hu",ron:"ro",heb:"he",msa:"ms",zsm:"ms",tgl:"fil",ben:"bn",tam:"ta",cat:"ca",slk:"sk",hrv:"hr",bul:"bg",lit:"lt",lav:"lv",est:"et",pes:"fa",fas:"fa",swh:"sw",swa:"sw",srp:"sr",isl:"is"};function K0(e){return Eu[e]??xu}var Ru=["zh-CN","zh-HK","zh-TW","ja-JP","ja","ko-KR","ko","ru-RU","ru","uk-UA","uk","bg","sr","mn-MN","kk-KZ","ar-SA","ar","fa-IR","fa","he","hi","th-TH","th","el-GR","el","ka-GE","bn-BD","bn","ta-IN","ta","si-LK","my-MM","km-KH","lo-LA"],Iu=new Set(Ru);function z0(e){return Iu.has(e)}var Ie=gu.enum(Su);import{z as Tu}from"zod";var ys=Tu.string().uuid();import{z as S}from"zod";import{z as ee}from"zod";var Et=ee.string().trim().min(1).max(128),Qt=ee.string().trim().min(1).max(500),ku=["\u4EA7\u54C1","\u90E8\u4EF6/\u8017\u6750","\u5E94\u7528\u65B9\u6848","\u5B9A\u5236/OEM","\u670D\u52A1","\u8D44\u8D28/\u80FD\u529B"],xs=ee.enum(ku),Cn=ee.object({id:Et,keyword:ee.string().trim().min(1).max(255),business_ids:ee.array(Et).min(1),category:xs,selling_points:ee.string().trim().max(2e3),intent:Qt,semantic_group:Et,monthly_volume:ee.number().int().min(1),keyword_difficulty:ee.number().min(0).max(100).nullable(),variants:ee.array(ee.string().trim().min(1).max(255)),source:ee.literal("semrush"),source_evidence:ee.array(Qt).min(1)}).strict().superRefine((e,n)=>{new Set(e.business_ids).size!==e.business_ids.length&&n.addIssue({code:"custom",path:["business_ids"],message:"\u4E1A\u52A1 ID \u4E0D\u80FD\u91CD\u590D"})}),Li=ee.object({schema_version:ee.literal(1),snapshot_id:Et,dependency_hash:ee.string().regex(/^[a-f0-9]{64}$/),language:ee.string().trim().min(2).max(35),database:ee.string().regex(/^[a-z]{2}$/),generated_at:ee.string().datetime({offset:!0}),entries:ee.array(Cn),candidates:ee.array(Cn),search_result_ids:ee.array(Et).optional()}).strict().superRefine((e,n)=>{for(let s of["entries","candidates"]){let i=e[s];(new Set(i.map(o=>o.id)).size!==i.length||new Set(i.map(o=>o.keyword.normalize("NFKC").trim().toLowerCase())).size!==i.length)&&n.addIssue({code:"custom",path:[s],message:"\u5173\u952E\u8BCD\u4E0D\u80FD\u91CD\u590D"})}}),Au=ee.object({entry_id:Et,category:xs,selling_points:ee.string().trim().max(2e3)}).strict(),Es=ee.object({snapshot_id:Et,entry_ids:ee.array(Et),entry_edits:ee.array(Au).optional()}).strict().superRefine((e,n)=>{new Set(e.entry_ids).size!==e.entry_ids.length&&n.addIssue({code:"custom",path:["entry_ids"],message:"\u5173\u952E\u8BCD\u4E0D\u80FD\u91CD\u590D"}),new Set((e.entry_edits??[]).map(i=>i.entry_id)).size!==(e.entry_edits??[]).length&&n.addIssue({code:"custom",path:["entry_edits"],message:"\u5173\u952E\u8BCD\u7F16\u8F91\u4E0D\u80FD\u91CD\u590D"});let s=new Set(e.entry_ids);(e.entry_edits??[]).forEach((i,o)=>{s.has(i.entry_id)||n.addIssue({code:"custom",path:["entry_edits",o,"entry_id"],message:"\u53EA\u80FD\u7F16\u8F91\u5DF2\u9009\u5173\u952E\u8BCD"})})}),X0=ee.object({expected_revision:ee.number().int().nonnegative(),business_subject:ee.string().trim().min(1).max(255)}).strict(),Tr=ee.object({points:ee.array(Qt).length(3),comparison:ee.array(ee.object({dimension:Qt,recommended:Qt,alternative:Qt}).strict()).min(1).max(4)}).strict();var ot=S.string().trim().min(1).max(128),Ut=S.string().trim().min(1).max(200),Qe=S.string().trim().min(1).max(2e3),Mi=S.string().trim().max(200),Rs=S.string().regex(/^[a-f0-9]{64}$/),Ui=S.enum(["en-US","zh-CN","zh-TW","fr-FR","de-DE","es-ES","ja-JP","ko-KR"]),Zt=["market","persona","product","brand","competition","structure","language","keywords","risk"],Ne=Zt.length,Pu=["keywords"],vn=Zt.filter(e=>!Pu.includes(e)),Is=vn.length,Ts=S.enum(Zt);function tA(e){return vn.some(n=>n===e)}var ks=Ts,kr=["recommended","conservative","focused"],Ar=S.enum(kr),Dn=S.union([Ar,S.literal("confirmed")]),As=S.enum(["single_country","regional_combination","multi_market"]),Ps=S.object({code:S.string().trim().regex(/^[A-Z]{2}$/),name_zh:Ut,name_en:Ut,region:Ut}).strict(),wu=S.object({id:ot,name:S.string().trim().min(1).max(255),category:xs}).strict(),ws=S.array(wu).min(1).superRefine((e,n)=>{new Set(e.map(s=>s.id)).size!==e.length&&n.addIssue({code:"custom",message:"Promoted business IDs must be unique."})}),Pr=S.object({lead:S.string().trim().min(1).max(500),title:Ut,columns:S.array(S.string().trim().min(1).max(80)).min(1).max(8),rows:S.array(S.array(S.string().trim().max(500)).min(1).max(8)).max(100)}).strict().superRefine((e,n)=>{e.rows.forEach((s,i)=>{s.length!==e.columns.length&&n.addIssue({code:"custom",path:["rows",i],message:"Each Step5 plan row must match the column count."})})}),Cu=S.object({id:Ar,presentation:Tr.nullish(),sections:S.array(S.object({id:S.string().trim().min(1).max(128),label:S.string().trim().min(1).max(200)}).strict()).max(30).optional(),label:Ut,note:Qe,impact:S.string().trim().max(500).nullish(),set_value:S.string().trim().max(500).nullish(),site_locale:Ie.nullish(),market_type:As.nullish(),markets:S.array(Ps).max(32).optional(),promoted_businesses:ws.optional(),plan:Pr.nullish()}).loose(),vu=S.object({goal:Qe,issue:Qe,criteria:S.array(Qe).min(1).max(12),resources:S.array(Qe).min(1).max(12),risks:S.array(Qe).min(1).max(12),execution:S.object({standard:S.array(Qe).min(1).max(12),acceptance:S.array(Qe).min(1).max(12),downstream:S.array(Qe).min(1).max(12)}).strict()}).strict(),Du=S.object({source_type:S.enum(["step2","step3"]),source_id:ot,field_path:S.string().trim().max(300).nullish()}).strict(),Ou=S.enum(["ok","degraded"]),Fi=S.object({key:ks,position:S.number().int().min(1).max(Ne),category:Ut,title:Ut,summary:Qe,rationale:Qe,parameter:S.string().trim().max(500).nullish(),options:S.array(Cu).max(3),keyword_library:Li.nullish(),plan:Pr.nullish(),structure_detail:vu.nullish(),note_tips:S.array(S.string().trim().min(1).max(200)).max(6),note_placeholder:S.string().trim().min(1).max(300),evidence_refs:S.array(Du).min(1).max(8),generation_status:Ou.optional()}).loose().superRefine((e,n)=>{let s=new Map,i=new Map,o=Zt.indexOf(e.key)+1;o>0&&e.position!==o&&n.addIssue({code:"custom",path:["position"],message:`Step5 strategy ${e.key} uses an invalid position.`}),e.key!=="keywords"&&e.keyword_library&&n.addIssue({code:"custom",path:["keyword_library"],message:"Only the keywords card can carry an enterprise keyword library."}),e.options.length!==(e.key==="keywords"?0:3)&&n.addIssue({code:"custom",path:["options"],message:"Keywords use no options; ordinary cards require three options."}),e.options.forEach((a,c)=>{a.id!==kr[c]&&n.addIssue({code:"custom",path:["options",c,"id"],message:"Step5 strategy options must use the canonical order."}),e.key==="product"&&!a.promoted_businesses&&n.addIssue({code:"custom",path:["options",c,"promoted_businesses"],message:"Product options require the ordered promoted businesses."}),e.key!=="product"&&a.promoted_businesses&&n.addIssue({code:"custom",path:["options",c,"promoted_businesses"],message:"Promoted businesses are only valid for product options."});for(let[r,m]of(a.promoted_businesses??[]).entries()){let x=s.get(m.id);x&&(x.name!==m.name||x.category!==m.category)?n.addIssue({code:"custom",path:["options",c,"promoted_businesses",r],message:"A promoted business ID must keep the same identity."}):s.set(m.id,m);let _=`${m.category}\0${m.name.normalize("NFKC").toLocaleLowerCase()}`,w=i.get(_);w&&w!==m.id?n.addIssue({code:"custom",path:["options",c,"promoted_businesses",r],message:"A promoted business must keep its stable ID."}):i.set(_,m.id)}}),e.structure_detail&&e.key!=="structure"&&n.addIssue({code:"custom",path:["structure_detail"],message:"Structure detail is only valid for the structure item."})}),Nu=S.object({item_key:Ts,selected_option_id:Dn,note:Mi,keyword_selection:Es.optional()}).strict().superRefine((e,n)=>{(e.item_key==="keywords"?e.selected_option_id!=="confirmed"||e.note!==""||!e.keyword_selection:e.selected_option_id==="confirmed"||e.keyword_selection!==void 0)&&n.addIssue({code:"custom",message:"\u666E\u901A\u5361\u4EC5\u63A5\u53D7\u65B9\u6848\u4E0E\u5907\u6CE8\uFF1B\u4F01\u4E1A\u5173\u952E\u8BCD\u5E93\u4EC5\u63A5\u53D7\u5DF2\u751F\u6210\u5FEB\u7167\u4E2D\u7684\u5173\u952E\u8BCD ID"})}),Gi=S.object({item_key:Ts,selected_option_id:Dn,note:Mi,keyword_selection:Es.optional(),keyword_library:Li.optional(),market_type:As.nullish(),markets:S.array(Ps).max(32).optional(),promoted_businesses:ws.optional(),selected_value:S.unknown().nullable(),accepted_at:S.string().datetime({offset:!0})}).loose().superRefine((e,n)=>{e.item_key==="product"&&!e.promoted_businesses&&n.addIssue({code:"custom",path:["promoted_businesses"],message:"Product decisions require the ordered promoted businesses."}),e.item_key!=="product"&&e.promoted_businesses&&n.addIssue({code:"custom",path:["promoted_businesses"],message:"Promoted businesses are only valid for product decisions."})}),ju=S.enum(["running","succeeded","failed"]),Lu=S.object({schema_version:S.literal(1),source_job_id:ot,site_id:ot,output_locale:Ui.optional(),items:S.array(Fi).length(Ne),decisions:S.array(Gi).min(Is).max(Ne)}).loose(),Mu=S.object({strategy_version_id:ot,site_id:ot,source_job_id:ot,output_locale:Ui.optional(),version:S.number().int().positive(),checksum:Rs,snapshot:Lu,committed_at:S.string().datetime({offset:!0})}).loose(),wr=S.object({job_id:ot,site_id:ot,output_locale:Ui.optional(),status:ju,keyword_library_needs_update:S.boolean().optional(),revision:S.number().int().nonnegative(),items:S.array(Fi).max(Ne),decisions:S.array(Gi).max(Ne),output_checksum:Rs.nullish(),error_code:S.string().trim().max(64).nullish(),error_message:S.string().trim().max(500).nullish(),committed_version:Mu.nullish()}).loose().superRefine((e,n)=>{let s=e.items.map(o=>o.key);new Set(s).size!==s.length&&n.addIssue({code:"custom",path:["items"],message:"Step5 job items must have unique keys."});let i=e.decisions.map(o=>o.item_key);new Set(i).size!==i.length&&n.addIssue({code:"custom",path:["decisions"],message:"Step5 job decisions must have unique item keys."})}),nA=S.object({force_refresh:S.boolean().optional().default(!1)}).strict(),sA=wr.extend({cached:S.boolean()}).strict(),iA=S.object({expected_revision:S.number().int().nonnegative()}).strict(),oA=S.object({expected_revision:S.number().int().nonnegative(),selected_option_id:Dn,note:Mi,keyword_selection:Es.optional()}).strict().superRefine((e,n)=>{(e.selected_option_id==="confirmed"?!e.keyword_selection||e.note!=="":e.keyword_selection)&&n.addIssue({code:"custom",message:"\u4F01\u4E1A\u5173\u952E\u8BCD\u53EA\u63A5\u53D7\u5019\u9009 ID \u4E0E\u7C7B\u522B/\u5356\u70B9\u7F16\u8F91\uFF1B\u666E\u901A\u7B56\u7565\u53EA\u63A5\u53D7\u65B9\u6848\u548C\u5907\u6CE8"})}),aA=S.object({revision:S.number().int().positive(),decision:Gi}).strict(),rA=S.object({idempotency_key:S.string().trim().min(8).max(128),expected_revision:S.number().int().nonnegative(),decisions:S.array(Nu).min(Is).max(Ne)}).strict().superRefine((e,n)=>{let s=e.decisions.map(i=>i.item_key);new Set(s).size!==s.length&&n.addIssue({code:"custom",path:["decisions"],message:"Step5 commit decisions must use unique strategy keys."}),vn.forEach(i=>{s.includes(i)||n.addIssue({code:"custom",path:["decisions"],message:`Step5 commit is missing ${i}.`})})}),cA=S.object({strategy_version_id:ot,version:S.number().int().positive(),checksum:Rs,next_path:S.string().trim().min(1).max(500)}).strict(),Uu=wr.extend({completed:S.number().int().min(0).max(Ne),total:S.literal(Ne)}).loose(),Fu=["snapshot","strategy_item_start","strategy_item_done","strategy_items_invalidated","strategy_generation_done","failed"];function mA(e){return typeof e=="string"&&Fu.includes(e)}var lA=S.discriminatedUnion("event",[S.object({id:S.number().int().nonnegative(),event:S.literal("snapshot"),data:Uu}).strict(),S.object({id:S.number().int().positive(),event:S.literal("strategy_item_start"),data:S.object({key:Ts,position:S.number().int().min(1).max(Ne)}).strict()}).strict(),S.object({id:S.number().int().positive(),event:S.literal("strategy_item_done"),data:S.object({item:Fi}).strict()}).strict(),S.object({id:S.number().int().positive(),event:S.literal("strategy_items_invalidated"),data:S.object({after_position:S.number().int().min(0).max(Ne)}).strict()}).strict(),S.object({id:S.number().int().positive(),event:S.literal("strategy_generation_done"),data:S.object({item_count:S.literal(Ne),schema_version:S.literal(1),checksum:Rs}).strict()}).strict(),S.object({id:S.number().int().positive(),event:S.literal("failed"),data:S.object({code:S.string().trim().min(1).max(64),message:S.string().trim().min(1).max(500),retryable:S.boolean(),item_key:ks.optional()}).loose()}).loose()]);import{z as Gu}from"zod";var Ze=Gu.string().regex(/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[A-Za-z-][0-9A-Za-z-]*)(?:\.(?:0|[1-9]\d*|\d*[A-Za-z-][0-9A-Za-z-]*))*))?(?:\+([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?$/);function uA(e,n){let s=Ze.safeParse(e),i=Ze.safeParse(n);if(!s.success||!i.success)return null;let o=Cr(s.data),a=Cr(i.data);for(let r=0;r<3;r+=1){let m=vr(o.release[r],a.release[r]);if(m!==0)return m}if(!o.prerelease&&!a.prerelease)return 0;if(!o.prerelease)return 1;if(!a.prerelease)return-1;let c=Math.max(o.prerelease.length,a.prerelease.length);for(let r=0;r<c;r+=1){let m=o.prerelease[r],x=a.prerelease[r];if(m===void 0)return-1;if(x===void 0)return 1;if(m===x)continue;let _=/^\d+$/u.test(m),w=/^\d+$/u.test(x);return _&&w?vr(BigInt(m),BigInt(x)):_?-1:w?1:qu(m,x)}return 0}function Cr(e){let n=e.indexOf("+"),s=n===-1?e:e.slice(0,n),i=s.indexOf("-"),o=i===-1?s:s.slice(0,i),a=i===-1?void 0:s.slice(i+1),[c,r,m]=o.split(".");return{release:[BigInt(c),BigInt(r),BigInt(m)],...a?{prerelease:a.split(".")}:{}}}function vr(e,n){return e<n?-1:e>n?1:0}function qu(e,n){return e<n?-1:e>n?1:0}import{z as Z}from"zod";import{z as ye}from"zod";var qi=64,Wu=512*1024,Wi=4*1024*1024,Bu=/^(?!\/)(?!.*\\)(?!.*(?:^|\/)\.\.(?:\/|$))(?!.*\/\/).+/;function Ku(e){return Bu.test(e)}var Dr=ye.string().min(1).refine(Ku,{message:"Materialization pathTemplate must be a safe relative path."}),zu=ye.object({pathTemplate:Dr,content:ye.string(),role:ye.string().min(1).optional()}).strict(),Hu=ye.union([ye.object({kind:ye.literal("default")}).strict(),ye.object({kind:ye.literal("named"),name:ye.string().min(1)}).strict()]),$u=ye.object({pathTemplate:Dr,export:Hu}).strict(),Vu=ye.array(ye.never()).optional(),Ft=ye.object({instanceBaseName:ye.string().min(1),files:ye.array(zu).min(1).max(qi),entry:$u,dataRequirements:Vu,projectDependencies:ye.record(ye.string().min(1),ye.string().min(1)).optional()}).strict().superRefine((e,n)=>{let s=new Set,i=e.entry.pathTemplate,o=0;for(let[a,c]of e.files.entries()){s.has(c.pathTemplate)&&n.addIssue({code:"custom",path:["files",a,"pathTemplate"],message:`Duplicate materialization pathTemplate: ${c.pathTemplate}`}),s.add(c.pathTemplate);let r=new TextEncoder().encode(c.content).length;r>Wu&&n.addIssue({code:"custom",path:["files",a,"content"],message:"Materialization file content exceeds the per-file byte limit."}),o+=r}s.has(i)||n.addIssue({code:"custom",path:["entry","pathTemplate"],message:"Materialization entry pathTemplate must match a file."}),o>Wi&&n.addIssue({code:"custom",path:["files"],message:"Materialization exceeds the total content byte limit."})});var Or="insertNewComponent",bA={categoryGroupMissing:"DESIGNER_COMPONENT_CATEGORY_GROUP_MISSING",unavailable:"DESIGNER_COMPONENT_LIBRARY_UNAVAILABLE",timeout:"DESIGNER_COMPONENT_LIBRARY_TIMEOUT",invalidResponse:"DESIGNER_COMPONENT_LIBRARY_INVALID_RESPONSE",incompatibleResource:"DESIGNER_COMPONENT_RESOURCE_INCOMPATIBLE"},Bi=Z.number().int().positive().refine(Number.isSafeInteger,"Must be a safe positive integer"),Nr=Z.lazy(()=>Z.object({id:Z.string().uuid(),key:Z.string().min(1),name:Z.string(),children:Z.array(Nr)}).strict()),jr=Z.object({category_group_key:Z.literal(Or),categories:Z.array(Nr)}).strict(),Yu=Z.object({resource_id:Z.string().min(1),name:Z.string(),description:Z.string().nullable(),thumbnail_url:Z.string().nullable(),resolved_version:Bi,category_id:Z.string().uuid().nullable()}).strict(),Lr=Z.object({category_group_key:Z.literal(Or),items:Z.array(Yu),next_cursor:Z.string().min(1).nullable()}).strict(),yA=Z.object({resource_id:Z.string().min(1),resolved_version:Bi,anchor_block_id:Z.string().min(1),placement:Z.enum(["before","after"])}).strict(),xA=Z.object({status:Z.literal("mock_acknowledged")}).strict(),EA=Z.object({category_id:Z.string().uuid().optional(),include_descendants:Z.enum(["true","false"]).optional().transform(e=>e==="true"),limit:Z.coerce.number().int().min(1).max(100).optional().default(20),cursor:Z.string().min(1).optional()}).strict().superRefine((e,n)=>{e.include_descendants&&!e.category_id&&n.addIssue({code:"custom",message:"include_descendants requires category_id"})}),Gt=Bi,RA=Z.object({version:Gt}).strict(),Mr=Z.object({resource_id:Z.string().min(1),resolved_version:Gt,revision_id:Z.string().uuid().optional(),digest_sha256:Z.string().regex(/^[a-f0-9]{64}$/),materialization:Ft}).strict();import{z as R}from"zod";import{z as h}from"zod";var Gr="/",qr=255,Xu=2048,Qu=5e3,Zu=64;function Wr(e){if(!e.startsWith("/")||e.includes("//")||/[?#\\\s\u0000-\u001f\u007f]/u.test(e))return!1;try{let n=decodeURIComponent(e);return n.includes("//")||/[?#\\\s\u0000-\u001f\u007f]/u.test(n)||n.split("/").length!==e.split("/").length||/%25/iu.test(e)?!1:n.split("/").every(s=>![".",".."].includes(s))}catch{return!1}}var qt=h.string().min(1).max(qr).refine(Wr,"url_path must be a safe site-relative path"),Hi=h.string().min(1).max(Xu).refine(Wr,"url must be a safe site-relative path"),$i=h.string().max(qr),Jt=h.preprocess(e=>e===0?!1:e===1?!0:e,h.boolean()),On=h.union([h.url(),Hi]),Vi=h.enum(["landing_page","general_page","detail_page"]),Yi=h.enum([...Vi.options,"list_page","category_page","tag_page","author_page","search_page","date_page"]);function AA(e){return e.vcp_managed&&e.url!==null&&Vi.safeParse(e.page_type).success&&qt.safeParse(e.url_path).success}function Ur(e){return e.includes("{")||e.includes("}")}function PA(e){if(!Ur(e.url_path))return Ju(e.url_path);if(e.url===null)return null;let n=/^[a-z][a-z0-9+.-]*:\/\//iu.test(e.url)?e_(e.url):e.url;if(n===null||Ur(n))return null;let s=Hi.safeParse(n);return s.success?s.data:null}function Ju(e){let n=qt.safeParse(e);return n.success?n.data:null}function e_(e){try{return new URL(e).pathname}catch{return null}}var Br=h.lazy(()=>h.object({cms_page_id:h.number().int().positive(),title:h.string().trim().min(1).max(255),url_path:$i,url:On.nullable(),page_type:Yi,vcp_managed:Jt,has_vcp_render_source:Jt.optional(),children:h.array(Br)}).strict()),t_=h.object({group_id:h.string().min(1),title:h.string().trim().min(1).max(255),collection_slug:h.string(),pages:h.array(Br)}).strict(),Fr=h.object({groups:h.array(t_)}).strict(),Kr=h.lazy(()=>h.object({id:h.number().int().positive(),title:h.string().trim().min(1).max(120),url_path:$i,parent_id:h.number().int().nonnegative(),group_type:h.string().min(1),page_type:Yi,plugin_id:h.number().int().nonnegative(),is_default:Jt,is_published:Jt,url:On.nullable(),vcp_managed:Jt,has_vcp_render_source:Jt.optional(),children:h.array(Kr)})),n_=h.object({plugin_id:h.number().int().nonnegative(),slug:h.string(),group_name:h.string().trim().min(1).max(255),pages:h.array(Kr)}).passthrough(),s_=h.array(n_);function zr(e){return{cms_page_id:e.id,title:e.title,url_path:e.url_path,url:e.url,page_type:e.page_type,vcp_managed:e.vcp_managed,has_vcp_render_source:e.has_vcp_render_source??!1,children:e.children.map(n=>zr(n))}}function wA(e){if(!i_(e))return null;let n=Fr.safeParse(e);if(n.success)return n.data;let s=s_.safeParse(e);if(!s.success)return null;let i=Fr.safeParse({groups:s.data.map(o=>({group_id:String(o.plugin_id),title:o.group_name,collection_slug:o.slug,pages:o.pages.map(zr)}))});return i.success?i.data:null}function i_(e){let n=Array.isArray(e)?e:Ki(e)&&Array.isArray(e.groups)?e.groups:[],s=[];for(let o of n)if(!(!Ki(o)||!Array.isArray(o.pages)))for(let a of o.pages)s.push({node:a,depth:1});let i=0;for(;s.length>0;){let o=s.pop();if(i+=1,i>Qu||o.depth>Zu)return!1;if(!(!Ki(o.node)||!Array.isArray(o.node.children)))for(let a of o.node.children)s.push({node:a,depth:o.depth+1})}return!0}function Ki(e){return typeof e=="object"&&e!==null}var o_=h.enum(["invalid_url_path","missing_url","not_vcp_managed","unsupported_page_type","page_not_generated"]),a_=h.enum(["home_page","invalid_url_path","not_selectable","not_vcp_managed","page_has_children","last_selectable_page","cms_unbound","unsupported_page_type"]),Hr=h.lazy(()=>h.object({cms_page_id:h.number().int().positive().nullable(),title:h.string().trim().min(1).max(255),url_path:$i,preview_url_path:Hi.nullable(),url:On.nullable(),page_type:Yi,vcp_managed:h.boolean(),selectable:h.boolean(),disabled_reason:o_.nullable(),can_delete:h.boolean(),delete_block_reason:a_.nullable(),has_cms_children:h.boolean(),children:h.array(Hr)}).strict()),$r=h.object({group_id:h.string().min(1),title:h.string().trim().min(1).max(255),pages:h.array(Hr)}).strict(),CA=h.object({base_snapshot_id:I,expected_url_path:qt}).strict(),r_=h.enum(["succeeded","failed"]),c_=h.object({url_path:qt,phase:h.enum(["ensure","binding","delete"]),code:h.string().min(1),message:h.string().min(1)}).strict(),Xi=h.object({status:r_,checked_count:h.number().int().nonnegative(),ensured_count:h.number().int().nonnegative(),deleted_count:h.number().int().nonnegative(),already_absent_count:h.number().int().nonnegative(),failed_pages:h.array(c_),warnings:h.array(h.string().min(1))}).strict(),m_=h.object({result_snapshot_id:I,deleted_files:h.array(h.string().min(1)),updated_files:h.array(h.string().min(1)),preserved_shared_files:h.array(h.string().min(1)),warnings:h.array(h.string().min(1)),next_url:On.nullable(),previous_url:On.nullable(),cms_reconcile_result:Xi}).strict(),vA=h.object({code:h.literal(0),message:h.string(),data:m_}).strict(),DA=h.object({snapshot_id:I}).strict(),l_=h.object({snapshot_id:I,warnings:h.array(h.string().min(1)),cms_reconcile_result:Xi}).strict(),OA=h.object({code:h.literal(0),message:h.string(),data:l_}).strict(),NA=h.object({snapshot_id:I}).strict(),p_=h.object({snapshot_id:I,status:h.enum(["converged","required","unknown"]),reason:h.string().min(1).max(255).optional()}).strict(),jA=h.object({code:h.literal(0),message:h.literal("ok"),data:p_}).strict(),LA=h.object({source_committed:h.boolean(),result_snapshot_id:I.optional(),cms_reconcile_result:Xi.optional()}).strict().superRefine((e,n)=>{e.source_committed&&!e.result_snapshot_id&&n.addIssue({code:"custom",path:["result_snapshot_id"],message:"committed source requires result_snapshot_id"})}),d_=Vi,u_=h.object({title:h.string().min(1).max(255).optional(),description:h.string().min(1).max(1e3).optional(),keywords:h.string().min(1).max(255).optional(),meta_tags_json:h.record(h.string(),h.unknown()).optional(),schema_json:h.union([h.record(h.string(),h.unknown()),h.array(h.unknown())]).optional(),breadcrumbs_json:h.array(h.unknown()).optional()}).strict(),Vr=h.object({url_path:qt,title:h.string().trim().min(1).max(255),kind:d_,route_file:h.string().min(1),collection_id:h.string().trim().min(1).optional(),seo:u_.optional()}).strict().superRefine((e,n)=>{e.kind==="detail_page"&&e.seo&&n.addIssue({code:"custom",path:["seo"],message:"detail_page target cannot carry seo (owned by the collection binding flow)"}),e.kind==="detail_page"&&!e.collection_id&&n.addIssue({code:"custom",path:["collection_id"],message:"detail_page target requires collection_id"}),e.kind!=="detail_page"&&e.collection_id&&n.addIssue({code:"custom",path:["collection_id"],message:`${e.kind} target cannot have collection_id`}),e.kind==="landing_page"!=(e.url_path===Gr)&&n.addIssue({code:"custom",path:["kind"],message:"The home target must be the only landing_page target."})}),__=h.object({complete:h.literal(!0),targets:h.array(Vr)}).strict().superRefine((e,n)=>{e.targets.length<1&&n.addIssue({code:"too_small",minimum:1,inclusive:!0,origin:"array",path:["targets"],message:"A complete page target set must contain at least one page."}),e.targets.filter(i=>i.url_path===Gr).length!==1&&n.addIssue({code:"custom",path:["targets"],message:"A complete page target set must contain exactly one home page."})}),MA=h.discriminatedUnion("complete",[__,h.object({complete:h.literal(!1),targets:h.array(Vr),errors:h.array(h.string().min(1)).min(1)}).strict()]),zi=h.string().regex(/^sha256:[0-9a-f]{64}$/),UA=h.object({projection_hash:zi.nullable()}).strict(),FA=h.object({expected_projection_hash:zi.nullable(),projection_hash:zi}).strict(),GA=h.object({clean_snapshot_id:h.string().uuid().nullable()}).strict(),qA=h.object({clean_snapshot_id:h.string().uuid()}).strict();var Yr="insertNewPage",$A={categoryGroupMissing:"DESIGNER_PAGE_CATEGORY_GROUP_MISSING",unavailable:"DESIGNER_PAGE_LIBRARY_UNAVAILABLE",timeout:"DESIGNER_PAGE_LIBRARY_TIMEOUT",invalidResponse:"DESIGNER_PAGE_LIBRARY_INVALID_RESPONSE",incompatibleResource:"DESIGNER_PAGE_RESOURCE_INCOMPATIBLE"},Wt=R.enum(["page","pages"]),g_=R.object({resource_id:R.string().min(1),resource_type:Wt,resolved_version:Gt,template_page_id:R.string().min(1)}).strict(),Xr=R.lazy(()=>R.object({id:R.string().uuid(),key:R.string().min(1),name:R.string(),children:R.array(Xr)}).strict()),Qr=R.object({category_group_key:R.literal(Yr),categories:R.array(Xr)}).strict(),h_=R.object({resource_id:R.string().min(1),resource_type:Wt,name:R.string(),description:R.string().nullable(),thumbnail_url:R.string().nullable(),preview_images:R.array(R.object({url:R.string().min(1),page_id:R.string().min(1).nullable(),is_primary:R.boolean()}).strict()).optional(),resolved_version:Gt,category_id:R.string().uuid().nullable()}).strict(),Zr=R.object({category_group_key:R.literal(Yr),items:R.array(h_),next_cursor:R.string().min(1).nullable()}).strict(),VA=R.object({category_id:R.string().uuid().optional(),include_descendants:R.enum(["true","false"]).optional().transform(e=>e==="true"),limit:R.coerce.number().int().min(1).max(100).optional().default(20),cursor:R.string().min(1).optional()}).strict().superRefine((e,n)=>{e.include_descendants&&!e.category_id&&n.addIssue({code:"custom",message:"include_descendants requires category_id"})}),Nn=Gt,Cs=R.string().regex(/^\/[a-z0-9]+(?:-[a-z0-9]+)*$/),YA=R.string().regex(/^\/(?:[a-z0-9]+(?:-[a-z0-9]+)*)?$/),S_=R.object({template_page_id:R.string().min(1),title:R.string().trim().min(1).max(120),final_route:Cs}).strict(),f_=R.object({template_page_id:R.string().min(1),title:R.string().trim().min(1).max(120),source:g_.optional(),blocks:R.array(R.discriminatedUnion("kind",[R.object({kind:R.literal("package-component"),instance_id:R.string().min(1),component_id:R.string().min(1),label:R.string().trim().min(1).max(120)}).strict(),R.object({kind:R.literal("component-resource"),instance_id:R.string().min(1),resource_id:R.string().min(1),resolved_version:Gt,label:R.string().trim().min(1).max(120)}).strict()])).optional(),route:R.object({input:R.string(),append_random_suffix:R.boolean().optional(),random_suffix_length:R.number().int().min(4).max(16).optional(),final:Cs}).strict()}).strict(),b_=R.object({resource_id:R.string().min(1),resource_type:Wt,resolved_version:Nn,pages:R.array(f_).min(1)}).strict().superRefine((e,n)=>{Rt(e.pages.map(s=>s.template_page_id),"pages",n),Rt(e.pages.map(s=>s.route.final),"routes",n);for(let[s,i]of e.pages.entries()){if(!i.blocks)continue;let o=new Set;for(let[a,c]of i.blocks.entries())o.has(c.instance_id)&&n.addIssue({code:"custom",path:["pages",s,"blocks",a,"instance_id"],message:`Duplicate block instance identifier within page: ${c.instance_id}`}),o.add(c.instance_id)}});function Qi(e,n){e.resource_type==="page"&&e.pages.length!==1&&n.addIssue({code:"custom",path:["pages"],message:"page resources must contain exactly one page"}),e.resource_type==="pages"&&e.pages.length<2&&n.addIssue({code:"custom",path:["pages"],message:"pages resources must contain at least two pages"})}function Rt(e,n,s){let i=new Set;for(let[o,a]of e.entries())i.has(a)&&s.addIssue({code:"custom",path:[n,o],message:`Duplicate ${n} identifier: ${a}`}),i.add(a)}var XA=R.object({resource_type:Wt,version:Nn,pages:R.array(S_).min(1)}).strict().superRefine((e,n)=>{Qi(e,n),Rt(e.pages.map(s=>s.template_page_id),"pages",n),Rt(e.pages.map(s=>s.final_route),"routes",n)}),y_=R.object({instance_id:R.string().min(1),component_id:R.string().min(1)}).strict(),x_=R.object({component_id:R.string().min(1),materialization:Ft}).strict(),E_=R.object({template_page_id:R.string().min(1),title:R.string().trim().min(1).max(120),final_route:Cs,materialization:Ft,components:R.array(y_)}).strict(),Zi=R.object({resource_id:R.string().min(1),resource_type:Wt,resolved_version:Nn,revision_id:R.string().uuid().optional(),digest_sha256:R.string().regex(/^[a-f0-9]{64}$/),components:R.array(x_),pages:R.array(E_).min(1),project_dependencies:R.record(R.string(),R.never()).optional()}).strict().superRefine((e,n)=>{Qi(e,n);let s=e.components.map(o=>o.component_id),i=new Set(s);Rt(s,"components",n),Rt(e.pages.map(o=>o.template_page_id),"pages",n),Rt(e.pages.map(o=>o.final_route),"routes",n);for(let[o,a]of e.pages.entries()){let c=new Set;for(let[r,m]of a.components.entries())i.has(m.component_id)||n.addIssue({code:"custom",path:["pages",o,"components",r,"component_id"],message:`Unknown component reference: ${m.component_id}`}),c.has(m.instance_id)&&n.addIssue({code:"custom",path:["pages",o,"components",r,"instance_id"],message:`Duplicate component instance identifier within page: ${m.instance_id}`}),c.add(m.instance_id)}}),Jr=Zi,ec=R.object({template_page_id:R.string().min(1),title:R.string().trim().min(1).max(120),final_route:Cs,route_file_path:R.string().regex(/^app\/[a-z0-9]+(?:-[a-z0-9]+)*\/page\.tsx$/)}).strict(),R_=R.object({template_page_id:R.string().min(1),title:R.string().trim().min(1).max(120),composition_supported:R.boolean(),blocks:R.array(R.object({instance_id:R.string().min(1),component_id:R.string().min(1),label:R.string().trim().min(1).max(120)}).strict())}).strict(),tc=R.object({resource_id:R.string().min(1),resource_type:Wt,resolved_version:Nn,pages:R.array(R_).min(1)}).strict().superRefine((e,n)=>{Qi(e,n),Rt(e.pages.map(s=>s.template_page_id),"pages",n)}),QA=R.object({resource_type:Wt,version:Nn}).strict(),ZA=R.object({draft:b_}).strict(),nc=R.object({groups:R.array($r)}).strict(),sc=R.object({candidate:R.record(R.string(),R.unknown())}).strict();var en="[a-z0-9]+(?:-[a-z0-9]+)*",jn=new RegExp(`^/(?:${en}(?:/${en})*)?$`),ic=["/privacy","/cookie-policy","/system/not-found"],I_=ic.map(e=>`app/${e.slice(1)}/page.tsx`);function T_(e){return e.replace(/[^A-Za-z0-9-]+/g,"-").replace(/-+/g,"-").replace(/^-+|-+$/g,"").toLowerCase()}function oc(e){return typeof e=="string"&&jn.test(e)}function ac(e){if(typeof e!="string")return null;let n=e.trim();if(/[^\x00-\x7F]/.test(n))return null;let s=n.replace(/^\/+|\/+$/g,"");if(s==="")return"/";let i=s.split("/");if(i.some(r=>r==="."||r===".."))return null;let o=s.toLowerCase();if(o==="index"||o==="home")return"/";let a=i.map(T_).filter(r=>r.length>0);if(a.length===0)return null;let c=`/${a.join("/")}`;return oc(c)?c:null}function rc(e){let n=ac(e);if(n===null)throw new Error("Page slug must be an ASCII route without traversal segments.");return n}function k_(e){let n=rc(e);return n==="/"?"app/page.tsx":`app/${n.slice(1)}/page.tsx`}import{z as J}from"zod";import{z as p}from"zod";import{z as je}from"zod";var A_=je.object({code:je.string().min(1),message:je.string().min(1),details:je.record(je.string(),je.unknown()).optional()}),s1=je.object({code:je.string().min(1),message:je.string().min(1)});function Ji(e){return je.object({ok:je.literal(!0),composition:K,data:e}).strict()}function P_(e){let n={ok:je.literal(!1),composition:K,error:A_.extend({code:e.codeSchema})};return e.currentSchema&&(n.current=e.currentSchema.optional()),e.diagnosticsSchema&&(n.diagnostics=je.array(e.diagnosticsSchema).optional()),e.dataSchema&&(n.data=e.dataSchema.optional()),je.object(n).strict()}function cc(e){return je.discriminatedUnion("ok",[Ji(e.dataSchema),P_({codeSchema:e.codeSchema,currentSchema:e.currentSchema,diagnosticsSchema:e.diagnosticsSchema,dataSchema:e.failureDataSchema})])}import{z as se}from"zod";var dt=se.object({start:se.number().int().nonnegative(),end:se.number().int().nonnegative()}).superRefine((e,n)=>{e.end<e.start&&n.addIssue({code:"custom",path:["end"],message:"end must be greater than or equal to start"})}),w_=se.object({code:se.enum(["missing-class-name","unsupported-attribute-name","source-locator-warning","invalid-new-attr","version-conflict","write-failed"]),message:se.string().min(1)}),mc=se.object({path:se.string().min(1),content:se.string(),hash:se.string().min(1).optional()}),c1=se.object({composition:K,revision:se.string().min(1),entryCss:mc,stylesheets:se.array(mc).default([])}).strict(),m1=se.object({composition:ge}).strict(),l1=se.object({key:se.string().min(1),composition:ge}).strict(),lc=se.object({key:se.string().min(1),composition:K,filePath:se.string().min(1),componentName:se.string().min(1),sourceKind:se.enum(["missing","stringLiteral","expression"]),attrRaw:se.string().min(1).nullable(),valueRaw:se.string().min(1).nullable(),attrRange:dt.nullable(),openingElementRange:dt,version:se.object({documentVersion:se.number().int().nonnegative(),contentHash:se.string().min(1)}),diagnostics:se.array(w_),computedStyle:se.record(se.string(),se.string()).optional()}).strict().superRefine((e,n)=>{if(e.sourceKind==="missing"){(e.attrRaw!==null||e.valueRaw!==null||e.attrRange!==null)&&n.addIssue({code:"custom",message:"missing className source must not include attr raw or range"});return}(e.attrRaw===null||e.valueRaw===null||e.attrRange===null)&&n.addIssue({code:"custom",message:"present className source must include attr raw and ranges"})}),p1=lc,d1=Ji(lc),eo=se.object({source:se.enum(["style-panel","class-source-editor"]),operation:se.enum(["replace-static-classname","replace-expression","create-attribute","remove-attribute"])});import{z as at}from"zod";var C_=new Set(["children","key","ref","dangerouslysetinnerhtml"]),v_=new Set(["data-designer-hover-outline","data-designer-select-outline"]),D_=/^[A-Za-z_$][A-Za-z0-9_$:-]*$/u;function O_(e){return{code:"protected-attribute",message:`Property is protected from generic site editing: ${e}`}}function N_(){return{code:"invalid-attribute-name",message:"Property name must be a valid single JSX attribute name"}}function j_(e){let n=e.toLowerCase();return C_.has(n)||n.startsWith("data-vcp-")||v_.has(n)||/^on[a-z]/iu.test(e)}function to(e){if(!D_.test(e))return{owner:"blocked",name:e,diagnostic:N_()};if(j_(e))return{owner:"blocked",name:e,diagnostic:O_(e)};let n=e.toLowerCase();return n==="classname"||n==="class"?{owner:"class-name-source",name:e}:n==="style"?{owner:"style",name:e}:{owner:"generic",name:e}}import{z as ut}from"zod";var Bt=ut.lazy(()=>ut.union([ut.string(),ut.number().finite(),ut.boolean(),ut.null(),ut.array(Bt),ut.record(ut.string(),Bt)]));var pc=at.string().min(1),no=at.discriminatedUnion("operation",[at.object({operation:at.literal("set"),name:pc,value:Bt}).strict(),at.object({operation:at.literal("remove"),name:pc}).strict()]).superRefine((e,n)=>{let s=to(e.name);s.owner==="blocked"&&n.addIssue({code:"custom",path:["name"],message:s.diagnostic?.message??"Property is not available for site editing"})}),dc=at.object({kind:at.literal("set-props"),scope:at.enum(["selection","template"]),changes:at.array(no).min(1)}).strict().superRefine((e,n)=>{let s=new Map;for(let[i,o]of e.changes.entries()){let a=to(o.name),c=L_(a),r=s.get(c);r!==void 0?n.addIssue({code:"custom",path:["changes",i,"name"],message:`Duplicate property change; first declared at index ${r}`}):s.set(c,i)}});function L_(e){return e.owner==="class-name-source"||e.owner==="style"?`owner:${e.owner}`:`name:${e.name}`}import{z as M_}from"zod";var uc=M_.enum(["src","alt","poster","href","width","height"]);import{z as tn}from"zod";var Ln=tn.object({editingSessionId:tn.string().min(1),lockId:tn.string().min(1),ownerId:tn.string().min(1),leaseAssertion:tn.string().min(1)}).strict(),I1="signed-designer-mutations-v1",T1=tn.object({mutationContext:Ln}).strict();import{z as u}from"zod";import{z as Mn}from"zod";var vs="::",so=Mn.object({file:Mn.string().min(1),component:Mn.string().min(1),structuralPath:Mn.string().min(1),key:Mn.string().min(1)}).superRefine((e,n)=>{let s=U_(e.file,e.component,e.structuralPath);e.key!==s&&n.addIssue({code:"custom",path:["key"],message:"key must match file::component::structuralPath"})});function U_(e,n,s){return`${e}${vs}${n}${vs}${s}`}function P1(e){let[n,s,...i]=e.split(vs);return!n||!s||i.length===0?null:{file:n,component:s,structuralPath:i.join(vs)}}var Ds=u.enum(["VERSION_STALE","RECOVERY_REQUIRED","MULTIPLE_PAGE_RETURNS","INDIRECT_RETURN_ONLY","PAGE_CONTAINER_AMBIGUOUS","NO_SAFE_PAGE_PLACEMENT","MEMBER_NOT_INDEPENDENT","UNSUPPORTED_ROUTE_STRUCTURE","RUNTIME_ANCHOR_UNRESOLVED","ROUTE_RETURN_NOT_FOUND"]),Un=u.object({code:u.string().min(1),message:u.string().min(1)}).strict(),F_=u.union([u.object({kind:u.literal("virtual-route-root"),key:u.string().min(1)}).strict(),u.object({kind:u.literal("jsx-container"),key:u.string().min(1),sourceMemberKey:u.string().min(1),sourceFile:u.string().min(1),componentName:u.string().min(1).optional()}).strict(),u.object({kind:u.literal("starter-placeholder"),key:u.string().min(1),sourceFile:u.string().min(1).optional()}).strict()]),G_=u.object({key:u.string().min(1),kind:u.enum(["jsx-element","jsx-fragment","jsx-expression","null-return","starter-placeholder"]),containerKey:u.string().min(1),label:u.string().min(1),sourceFile:u.string().min(1).optional(),isAtomic:u.boolean()}).strict(),q_=u.object({key:u.string().min(1),sourceMemberKey:u.string().min(1),containerKey:u.string().min(1),label:u.string().min(1),isIndependent:u.boolean()}).strict(),W_=u.object({key:u.string().min(1),containerKey:u.string().min(1),businessMemberKeys:u.array(u.string().min(1)),isMultiMember:u.boolean()}).strict(),gc=u.object({kind:u.literal("page-composition"),placementKey:u.string().min(1),documentVersion:u.number().int().nonnegative(),composition:ge}).strict(),B_=u.object({kind:u.literal("page-composition"),placementKey:u.string().min(1),documentVersion:u.number().int().nonnegative(),composition:K,placementUnitKey:u.string().min(1),relation:u.enum(["before","after","prepend","append"])}).strict(),hc=u.object({kind:u.literal("page-composition"),placementKey:u.string().min(1),documentVersion:u.number().int().nonnegative(),composition:ge,placementUnitKey:u.string().min(1),relation:u.enum(["before","after","prepend","append"])}).strict(),Sc=u.object({kind:u.literal("page-unit"),composition:ge,placementUnitKey:u.string().min(1)}).strict(),fc=u.object({kind:u.literal("page-unit"),composition:K,placementUnitKey:u.string().min(1)}).strict();function _t(e,n,s,i,o){let a=new Set;for(let[c,r]of e.entries()){let m=i(r);a.has(m)&&n.addIssue({code:"custom",path:[s,c,o],message:`Duplicate ${s} key: ${m}`}),a.add(m)}}var K_=u.object({status:u.literal("supported"),version:u.number().int().nonnegative(),composition:K,container:F_,sourceMembers:u.array(G_),businessMembers:u.array(q_),placementUnits:u.array(W_),placements:u.array(B_)}).strict().superRefine((e,n)=>{_t(e.sourceMembers,n,"sourceMembers",r=>r.key,"key"),_t(e.businessMembers,n,"businessMembers",r=>r.key,"key"),_t(e.placementUnits,n,"placementUnits",r=>r.key,"key"),_t(e.placements,n,"placements",r=>r.placementKey,"placementKey");let s=new Set(e.sourceMembers.map(r=>r.key)),i=new Set(e.placementUnits.map(r=>r.key)),o=new Map(e.sourceMembers.map(r=>[r.key,r])),a=new Map(e.businessMembers.map(r=>[r.key,r]));for(let[r,m]of e.sourceMembers.entries()){m.containerKey!==e.container.key&&!s.has(m.containerKey)&&n.addIssue({code:"custom",path:["sourceMembers",r,"containerKey"],message:"Source member parent must reference the page container or another source member."}),m.containerKey===m.key&&n.addIssue({code:"custom",path:["sourceMembers",r,"containerKey"],message:"Source member cannot contain itself."});let x=new Set([m.key]),_=m.containerKey;for(;_!==e.container.key;){if(x.has(_)){n.addIssue({code:"custom",path:["sourceMembers",r,"containerKey"],message:"Source member hierarchy must be acyclic."});break}x.add(_);let w=o.get(_);if(!w)break;_=w.containerKey}}e.container.kind==="jsx-container"&&!s.has(e.container.sourceMemberKey)&&n.addIssue({code:"custom",path:["container","sourceMemberKey"],message:"Container sourceMemberKey must reference a source member."});for(let[r,m]of e.businessMembers.entries())s.has(m.sourceMemberKey)||n.addIssue({code:"custom",path:["businessMembers",r,"sourceMemberKey"],message:"Business member must reference a source member."}),i.has(m.containerKey)||n.addIssue({code:"custom",path:["businessMembers",r,"containerKey"],message:"Business member must reference a placement unit container."});for(let[r,m]of e.placementUnits.entries()){let x=o.get(m.containerKey);x?x.containerKey!==e.container.key&&n.addIssue({code:"custom",path:["placementUnits",r,"containerKey"],message:"Placement unit must reference a direct child of the page container."}):n.addIssue({code:"custom",path:["placementUnits",r,"containerKey"],message:"Placement unit containerKey must reference a source member."});let _=new Set;for(let[w,B]of m.businessMemberKeys.entries()){let z=a.get(B);if(!z){n.addIssue({code:"custom",path:["placementUnits",r,"businessMemberKeys",w],message:"Placement unit must reference existing business members."});continue}_.has(B)&&n.addIssue({code:"custom",path:["placementUnits",r,"businessMemberKeys",w],message:"Placement unit cannot reference the same business member twice."}),_.add(B),z.containerKey!==m.key&&n.addIssue({code:"custom",path:["placementUnits",r,"businessMemberKeys",w],message:"Business member containerKey must match its placement unit."});let ne=z.sourceMemberKey,Se=new Set;for(;ne&&ne!==m.containerKey&&!Se.has(ne);)Se.add(ne),ne=o.get(ne)?.containerKey;ne!==m.containerKey&&n.addIssue({code:"custom",path:["placementUnits",r,"businessMemberKeys",w],message:"Placement unit business members must belong to its source subtree."})}}for(let[r,m]of e.businessMembers.entries())e.placementUnits.find(_=>_.key===m.containerKey)?.businessMemberKeys.includes(m.key)||n.addIssue({code:"custom",path:["businessMembers",r,"containerKey"],message:"Business member must be listed by its placement unit container."});let c=new Map;for(let r of e.placementUnits)c.set(r.containerKey,(c.get(r.containerKey)??0)+1);for(let[r,m]of e.sourceMembers.entries())m.containerKey===e.container.key&&c.get(m.key)!==1&&n.addIssue({code:"custom",path:["sourceMembers",r,"key"],message:"Every direct source member must be owned by exactly one placement unit."});for(let[r,m]of e.placements.entries())xc(m.composition,e.composition)||n.addIssue({code:"custom",path:["placements",r,"composition"],message:"Page placement composition must match page composition."}),m.documentVersion!==e.version&&n.addIssue({code:"custom",path:["placements",r,"documentVersion"],message:"Page placement version must match page composition version."}),i.has(m.placementUnitKey)||n.addIssue({code:"custom",path:["placements",r,"placementUnitKey"],message:"Placement option must reference an existing placement unit."})}),z_=u.object({status:u.literal("unsupported"),version:u.number().int().nonnegative(),composition:K,reason:Ds,diagnostics:u.array(Un)}).strict(),H_=u.discriminatedUnion("status",[K_,z_]),bc=2,O1="page-composition-v2",yc=u.object({start:u.number().int().nonnegative(),end:u.number().int().nonnegative(),startLine:u.number().int().positive().optional(),startColumn:u.number().int().nonnegative().optional(),endLine:u.number().int().positive().optional(),endColumn:u.number().int().nonnegative().optional()}).strict().superRefine((e,n)=>{e.end<e.start&&n.addIssue({code:"custom",path:["end"],message:"Source range end must be greater than or equal to start."});let s=[e.startLine,e.startColumn,e.endLine,e.endColumn],i=s.some(a=>a!==void 0),o=s.every(a=>a!==void 0);i&&!o&&n.addIssue({code:"custom",path:["startLine"],message:"Source line and column locations must be provided together."}),e.startLine!==void 0&&e.endLine!==void 0&&e.endLine<e.startLine&&n.addIssue({code:"custom",path:["endLine"],message:"Source range endLine must not precede startLine."}),e.startLine!==void 0&&e.endLine===e.startLine&&e.startColumn!==void 0&&e.endColumn!==void 0&&e.endColumn<e.startColumn&&n.addIssue({code:"custom",path:["endColumn"],message:"Source range endColumn must not precede startColumn."})}),$_=u.object({key:u.string().min(1),instanceIndex:u.number().int().nonnegative().optional(),instanceCount:u.number().int().positive().optional(),textSegmentIndex:u.number().int().nonnegative().optional()}).strict().superRefine((e,n)=>{e.instanceIndex!==void 0&&e.instanceCount!==void 0&&e.instanceIndex>=e.instanceCount&&n.addIssue({code:"custom",path:["instanceIndex"],message:"instanceIndex must be lower than instanceCount."})}),V_=u.enum(["component-call","native-jsx","dynamic-expression","indirect-expression","text","starter-placeholder"]),Y_=u.enum(["none","dynamic-expression","indirect-expression","text","starter-placeholder"]),X_=u.discriminatedUnion("kind",[u.object({kind:u.literal("virtual-route-root"),key:u.null(),routeReturn:u.object({sourceIdentity:so,sourceRange:yc}).strict()}).strict(),u.object({kind:u.literal("jsx-container"),key:u.string().min(1),sourceMemberKey:u.string().min(1)}).strict(),u.object({kind:u.literal("starter-placeholder"),key:u.string().min(1),sourceMemberKey:u.string().min(1),replacementMode:u.literal("replace")}).strict()]),Q_=u.object({key:u.string().min(1),kind:V_,parentKey:u.string().min(1).nullable(),childKeys:u.array(u.string().min(1)),order:u.number().int().nonnegative(),label:u.string().min(1),sourceIdentity:so,sourceRange:yc.nullable(),atomicKind:Y_}).strict().superRefine((e,n)=>{let s=e.kind==="component-call"||e.kind==="native-jsx"?"none":e.kind;e.atomicKind!==s&&n.addIssue({code:"custom",path:["atomicKind"],message:`atomicKind must be ${s} for ${e.kind}.`});let i=new Set;for(let[o,a]of e.childKeys.entries())i.has(a)&&n.addIssue({code:"custom",path:["childKeys",o],message:`Duplicate child source member key: ${a}`}),i.add(a)}),Z_=u.object({key:u.string().min(1),sourceMemberKey:u.string().min(1),placementUnitKey:u.string().min(1),label:u.string().min(1),isIndependent:u.boolean()}).strict(),J_=u.enum(["independent","atomic","container"]),eg=u.object({key:u.string().min(1),containerKey:u.string().min(1).nullable(),sourceMemberKeys:u.array(u.string().min(1)).min(1),businessMemberKeys:u.array(u.string().min(1)),order:u.number().int().nonnegative(),boundaryMode:J_,isIndependent:u.boolean(),isMultiMember:u.boolean()}).strict().superRefine((e,n)=>{_c(e.sourceMemberKeys,n,"sourceMemberKeys","source member"),_c(e.businessMemberKeys,n,"businessMemberKeys","business member");let s=e.sourceMemberKeys.length>1||e.businessMemberKeys.length>1;e.isMultiMember!==s&&n.addIssue({code:"custom",path:["isMultiMember"],message:"isMultiMember must reflect the source and business member cardinality."});let i=e.boundaryMode==="independent";e.isIndependent!==i&&n.addIssue({code:"custom",path:["isIndependent"],message:"isIndependent must match boundaryMode."})}),tg=u.enum(["before","after","prepend","append","replace"]),ng=u.enum(["insert-sibling","insert-child","replace-placeholder"]),sg=u.object({kind:u.literal("page-composition"),placementKey:u.string().min(1),documentVersion:u.number().int().nonnegative(),composition:K,placementUnitKey:u.string().min(1),containerKey:u.string().min(1).nullable(),relation:tg,writeMode:ng}).strict().superRefine((e,n)=>{let s=e.relation==="before"||e.relation==="after"?"insert-sibling":e.relation==="prepend"||e.relation==="append"?"insert-child":"replace-placeholder";e.writeMode!==s&&n.addIssue({code:"custom",path:["writeMode"],message:`writeMode must be ${s} for ${e.relation}.`})}),ig=u.object({key:u.string().min(1),placementUnitKey:u.string().min(1),runtimeRefs:u.array($_).min(1)}).strict(),og=u.object({schemaVersion:u.literal(bc),status:u.literal("supported"),version:u.number().int().nonnegative(),composition:K,container:X_,sourceMembers:u.array(Q_),businessMembers:u.array(Z_),placementUnits:u.array(eg),placements:u.array(sg),visualAnchors:u.array(ig).optional(),diagnostics:u.array(Un)}).strict().superRefine((e,n)=>{cg(e,n)}),ag=u.object({schemaVersion:u.literal(bc),status:u.literal("unsupported"),version:u.number().int().nonnegative(),composition:K,reason:Ds,diagnostics:u.array(Un)}).strict(),rg=u.discriminatedUnion("status",[og,ag]),N1=u.union([rg,H_]);function _c(e,n,s,i){let o=new Set;for(let[a,c]of e.entries())o.has(c)&&n.addIssue({code:"custom",path:[s,a],message:`Duplicate ${i} key: ${c}`}),o.add(c)}function xc(e,n){return Ci(e)===Ci(n)}function cg(e,n){_t(e.sourceMembers,n,"sourceMembers",_=>_.key,"key"),_t(e.businessMembers,n,"businessMembers",_=>_.key,"key"),_t(e.placementUnits,n,"placementUnits",_=>_.key,"key"),_t(e.placements,n,"placements",_=>_.placementKey,"placementKey"),_t(e.visualAnchors??[],n,"visualAnchors",_=>_.key,"key"),mg(e,n);let s=new Map(e.sourceMembers.map(_=>[_.key,_])),i=new Map(e.businessMembers.map(_=>[_.key,_])),o=new Map(e.placementUnits.map(_=>[_.key,_]));lg(e,s,n),e.container.kind!=="virtual-route-root"&&(s.has(e.container.sourceMemberKey)||n.addIssue({code:"custom",path:["container","sourceMemberKey"],message:"Container sourceMemberKey must reference a source member."}));let a=new Map,c=new Map,r=new Set;for(let[_,w]of e.placementUnits.entries()){w.containerKey!==e.container.key&&n.addIssue({code:"custom",path:["placementUnits",_,"containerKey"],message:"Placement unit containerKey must match the page container."});let B=`${w.containerKey??"<virtual>"}:${w.order}`;r.has(B)&&n.addIssue({code:"custom",path:["placementUnits",_,"order"],message:"Placement unit order must be unique within its container."}),r.add(B);for(let[z,ne]of w.sourceMemberKeys.entries()){s.has(ne)||n.addIssue({code:"custom",path:["placementUnits",_,"sourceMemberKeys",z],message:"Placement unit must reference existing source members."});let Se=a.get(ne);Se&&Se!==w.key&&n.addIssue({code:"custom",path:["placementUnits",_,"sourceMemberKeys",z],message:`Source member is already assigned to ${Se}.`}),a.set(ne,w.key)}for(let[z,ne]of w.businessMemberKeys.entries()){let Se=i.get(ne);if(!Se){n.addIssue({code:"custom",path:["placementUnits",_,"businessMemberKeys",z],message:"Placement unit must reference existing business members."});continue}Se.placementUnitKey!==w.key&&n.addIssue({code:"custom",path:["placementUnits",_,"businessMemberKeys",z],message:"Placement unit and business member must reference each other."}),w.sourceMemberKeys.includes(Se.sourceMemberKey)||n.addIssue({code:"custom",path:["placementUnits",_,"businessMemberKeys",z],message:"Business member sourceMemberKey must belong to the placement unit."});let En=c.get(ne);En&&En!==w.key&&n.addIssue({code:"custom",path:["placementUnits",_,"businessMemberKeys",z],message:`Business member is already assigned to ${En}.`}),c.set(ne,w.key)}}for(let[_,w]of e.businessMembers.entries()){s.has(w.sourceMemberKey)||n.addIssue({code:"custom",path:["businessMembers",_,"sourceMemberKey"],message:"Business member must reference a source member."});let B=o.get(w.placementUnitKey);if(!B){n.addIssue({code:"custom",path:["businessMembers",_,"placementUnitKey"],message:"Business member must reference a placement unit."});continue}B.businessMemberKeys.includes(w.key)||n.addIssue({code:"custom",path:["businessMembers",_,"placementUnitKey"],message:"Business member and placement unit must reference each other."}),B.sourceMemberKeys.includes(w.sourceMemberKey)||n.addIssue({code:"custom",path:["businessMembers",_,"sourceMemberKey"],message:"Business member sourceMemberKey must belong to its placement unit."});let z=B.isIndependent&&B.businessMemberKeys.length===1;w.isIndependent!==z&&n.addIssue({code:"custom",path:["businessMembers",_,"isIndependent"],message:"Business member independence must match its placement unit boundary."})}let m=new Set;for(let[_,w]of e.placements.entries()){w.documentVersion!==e.version&&n.addIssue({code:"custom",path:["placements",_,"documentVersion"],message:"Page placement version must match page composition version."}),xc(w.composition,e.composition)||n.addIssue({code:"custom",path:["placements",_,"composition"],message:"Page placement composition must match page composition."});let B=o.get(w.placementUnitKey);B?w.containerKey!==B.containerKey&&n.addIssue({code:"custom",path:["placements",_,"containerKey"],message:"Placement containerKey must match its placement unit."}):n.addIssue({code:"custom",path:["placements",_,"placementUnitKey"],message:"Placement option must reference a placement unit."});let z=`${w.placementUnitKey}:${w.relation}`;m.has(z)&&n.addIssue({code:"custom",path:["placements",_,"relation"],message:"A placement unit cannot expose the same relation more than once."}),m.add(z),w.relation==="replace"&&e.container.kind!=="starter-placeholder"&&n.addIssue({code:"custom",path:["placements",_,"relation"],message:"replace is only valid for a starter placeholder container."}),e.container.kind==="starter-placeholder"&&w.relation!=="replace"&&n.addIssue({code:"custom",path:["placements",_,"relation"],message:"Starter placeholder placements must use replace."})}let x=new Set;for(let[_,w]of(e.visualAnchors??[]).entries())o.has(w.placementUnitKey)||n.addIssue({code:"custom",path:["visualAnchors",_,"placementUnitKey"],message:"Visual anchor must reference a placement unit."}),x.has(w.placementUnitKey)&&n.addIssue({code:"custom",path:["visualAnchors",_,"placementUnitKey"],message:"A placement unit may expose only one visual anchor."}),x.add(w.placementUnitKey)}function mg(e,n){let s=[];e.container.key!==null&&s.push({key:e.container.key,path:["container","key"],namespace:"container"});for(let[o,a]of e.sourceMembers.entries())s.push({key:a.key,path:["sourceMembers",o,"key"],namespace:"source member"});for(let[o,a]of e.businessMembers.entries())s.push({key:a.key,path:["businessMembers",o,"key"],namespace:"business member"});for(let[o,a]of e.placementUnits.entries())s.push({key:a.key,path:["placementUnits",o,"key"],namespace:"placement unit"});for(let[o,a]of(e.visualAnchors??[]).entries())s.push({key:a.key,path:["visualAnchors",o,"key"],namespace:"visual anchor"});let i=new Map;for(let o of s){let a=i.get(o.key);a?n.addIssue({code:"custom",path:o.path,message:`${o.namespace} key collides with ${a}: ${o.key}`}):i.set(o.key,o.namespace)}}function lg(e,n,s){let i=new Set;for(let[o,a]of e.sourceMembers.entries()){let c=`${a.parentKey??"<root>"}:${a.order}`;if(i.has(c)&&s.addIssue({code:"custom",path:["sourceMembers",o,"order"],message:"Source member order must be unique among siblings."}),i.add(c),a.parentKey===a.key&&s.addIssue({code:"custom",path:["sourceMembers",o,"parentKey"],message:"Source member cannot be its own parent."}),a.parentKey!==null){let x=n.get(a.parentKey);x?x.childKeys.includes(a.key)||s.addIssue({code:"custom",path:["sourceMembers",o,"parentKey"],message:"Source parent and child references must be bidirectional."}):s.addIssue({code:"custom",path:["sourceMembers",o,"parentKey"],message:"Source member parentKey must reference a source member."})}for(let[x,_]of a.childKeys.entries()){if(_===a.key){s.addIssue({code:"custom",path:["sourceMembers",o,"childKeys",x],message:"Source member cannot be its own child."});continue}let w=n.get(_);w?w.parentKey!==a.key&&s.addIssue({code:"custom",path:["sourceMembers",o,"childKeys",x],message:"Source parent and child references must be bidirectional."}):s.addIssue({code:"custom",path:["sourceMembers",o,"childKeys",x],message:"Source child key must reference a source member."})}let r=new Set,m=a;for(;m;){if(r.has(m.key)){s.addIssue({code:"custom",path:["sourceMembers",o,"parentKey"],message:"Source member graph must be acyclic."});break}r.add(m.key),m=m.parentKey===null?void 0:n.get(m.parentKey)}}}var Fn=p.enum(["update-text","update-array-item","remove-node","insert-child","replace-node","move-node","set-class-name-source","set-props","set-link-target","apply-style-draft","source-edit","insert-page-resource","delete-page-source"]),pg=p.discriminatedUnion("kind",[p.object({kind:p.literal("node"),key:p.string().min(1)}).strict(),Sc,p.object({kind:p.literal("route"),composition:ge}).strict(),p.object({kind:p.literal("source-file"),path:Re}).strict(),p.object({kind:p.literal("source-batch"),paths:p.array(Re).min(1)}).superRefine((e,n)=>{let s=new Set;for(let[i,o]of e.paths.entries())s.has(o)&&n.addIssue({code:"custom",path:["paths",i],message:`Duplicate source target path: ${o}`}),s.add(o)}).strict(),p.object({kind:p.literal("project")}).strict()]),dg=p.string().min(1).refine(Tg,{message:"Link href must use http(s), mailto, tel, or a non-empty anchor"}),ug=p.discriminatedUnion("kind",[p.object({kind:p.literal("none")}).strict(),p.object({kind:p.literal("internal-route"),href:p.string().min(1)}).strict().superRefine(({href:e},n)=>{(!e.startsWith("/")||e.startsWith("//")||e.includes("\\")||e.endsWith("#")||/[\s\u0000-\u001f]/u.test(e))&&n.addIssue({code:"custom",path:["href"],message:"Internal routes must be non-empty single-slash paths"})}),p.object({kind:p.literal("native-link"),href:dg}).strict()]),_g=no.superRefine((e,n)=>{["target","rel","title","aria-label"].includes(e.name)||n.addIssue({code:"custom",path:["name"],message:"Link target changes are limited to target, rel, title and aria-label"})}),gg=p.object({kind:p.literal("set-link-target"),scope:p.literal("selection"),link:ug,changes:p.array(_g)}).strict().superRefine((e,n)=>{let s=new Set;for(let[i,o]of e.changes.entries())s.has(o.name)&&n.addIssue({code:"custom",path:["changes",i,"name"],message:`Duplicate link target change: ${o.name}`}),s.add(o.name),e.link.kind==="none"&&o.operation==="set"&&(o.name==="target"||o.name==="rel")&&n.addIssue({code:"custom",path:["changes",i],message:"An unlinked anchor cannot set target or rel attributes"})}),hg=p.discriminatedUnion("kind",[p.object({kind:p.literal("node"),key:p.string().min(1)}).strict(),fc,p.object({kind:p.literal("route"),composition:K}).strict(),p.object({kind:p.literal("source-file"),path:Re}).strict(),p.object({kind:p.literal("source-batch"),paths:p.array(Re).min(1)}).strict(),p.object({kind:p.literal("project")}).strict()]),Ec=p.enum(["display","position","top","right","bottom","left","zIndex","flexDirection","flexWrap","flexGrow","flexShrink","flexBasis","order","gridTemplateColumns","gridTemplateRows","columns","gridColumn","gridRow","gap","gapX","gapY","spaceX","spaceY","alignItems","justifyContent","marginTop","marginRight","marginBottom","marginLeft","paddingTop","paddingRight","paddingBottom","paddingLeft","width","height","minWidth","minHeight","maxWidth","maxHeight","overflow","fontFamily","fontSize","fontWeight","lineHeight","letterSpacing","textAlign","textTransform","textDecoration","textOverflow","textIndent","writingMode","whiteSpace","wordBreak","lineClamp","fontVariantNumeric","screenReaderOnly","color","backgroundColor","backgroundImage","backgroundRepeat","backgroundSize","backgroundPosition","backgroundAttachment","backgroundClip","backgroundOrigin","borderStyle","borderWidth","borderRadius","borderColor","objectFit","objectPosition","aspectRatio","opacity","boxShadow","transform","transformOrigin","transitionProperty","transitionDuration","transitionTimingFunction","animation","pointerEvents","cursor","userSelect","fontStyle","textUnderlineOffset","scrollMarginTop","alignSelf","flex","outlineStyle","resize","ringWidth","ringColor","backdropFilter","overscrollBehavior","divideWidth","divideColor"]),Rc=p.enum(["hover","active","focus","disabled"]),Ic=p.enum(["sm","md","lg","xl","2xl"]),Tc=p.union([p.object({relation:p.enum(["before","after"]),anchorKey:p.string().min(1),parentKey:p.string().min(1)}),p.object({relation:p.enum(["prepend","append"]),parentKey:p.string().min(1)}),hc]),Sg=p.object({kind:p.literal("source-sibling"),relation:p.enum(["before","after"]),anchorKey:p.string().min(1)}).strict(),fg=p.union([Tc,Sg]),kc=p.object({kind:p.literal("component-call"),component:p.never().optional(),materialization:Ft,props:p.record(p.string(),p.never()).optional()}).strict(),bg=p.union([p.object({kind:p.literal("native-tag"),tag:p.string().min(1),text:p.string().optional()}),p.object({kind:p.literal("component-call"),component:p.object({source:p.string().min(1),exportName:p.string().min(1)}),materialization:p.never().optional(),props:p.record(p.string(),p.unknown()).optional()}).strict(),kc]),yg=p.discriminatedUnion("kind",[p.object({kind:p.literal("update-text"),segmentIndex:p.number().int().min(0),value:p.string()}),p.object({kind:p.literal("update-array-item"),segmentIndex:p.number().int().min(0),index:p.number().int().min(0),value:p.string()}),p.object({kind:p.literal("remove-node")}),p.object({kind:p.literal("insert-child"),node:bg,position:p.union([Tc,gc])}),p.object({kind:p.literal("replace-node"),node:kc}),p.object({kind:p.literal("move-node"),target:fg,preserveBindings:p.boolean().optional()}),p.object({kind:p.literal("set-class-name-source"),filePath:p.string().min(1),expectedVersion:p.object({documentVersion:p.number().int().nonnegative(),contentHash:p.string().min(1)}),oldAttrRaw:p.string().min(1).nullable(),oldAttrRange:dt.nullable(),openingElementRange:dt,newAttrRaw:p.string().min(1).nullable(),intent:eo}),dc,gg,p.object({kind:p.literal("apply-style-draft"),className:p.object({filePath:p.string().min(1),expectedVersion:p.object({documentVersion:p.number().int().nonnegative(),contentHash:p.string().min(1)}),oldAttrRaw:p.string().min(1).nullable(),oldAttrRange:dt.nullable(),openingElementRange:dt,newAttrRaw:p.string().min(1).nullable(),intent:eo}).optional(),props:p.partialRecord(uc,p.string()).optional()}).superRefine((e,n)=>{!e.className&&!e.props&&n.addIssue({code:"custom",message:"apply-style-draft requires className or props"})}),p.object({kind:p.literal("source-edit"),conflictPolicy:p.enum(["compare-and-swap","overwrite"]),edits:p.array(p.discriminatedUnion("operation",[p.object({operation:p.literal("upsert"),path:Re,content:p.string(),baseContentHash:p.string().min(1).nullable().optional()}).strict().superRefine((e,n)=>{Di(e.path)||n.addIssue({code:"custom",path:["path"],message:"source-edit upsert only accepts allowlisted text source files"}),e.content.includes("\0")&&n.addIssue({code:"custom",path:["content"],message:"source-edit content must be valid text"})}),p.object({operation:p.literal("delete"),path:Re,capability:Sr,confirmDelete:p.literal(!0),confirmPath:Re,baseContentHash:p.string().min(1).nullable().optional()}).strict().superRefine((e,n)=>{e.capability!==vi&&n.addIssue({code:"custom",path:["capability"],message:"delete requires source-delete capability"}),e.confirmPath!==e.path&&n.addIssue({code:"custom",path:["confirmPath"],message:"delete confirmation path must match edit path"}),Di(e.path)||n.addIssue({code:"custom",path:["path"],message:"source-edit delete only accepts allowlisted text source files"});let s=Oi(e.path);s&&n.addIssue({code:"custom",path:["path"],message:`Protected source file cannot be deleted: ${e.path} (${s})`})})])).min(1),reason:p.string().min(1).optional()}).strict().superRefine((e,n)=>{let s=new Set;for(let[i,o]of e.edits.entries())s.has(o.path)&&n.addIssue({code:"custom",path:["edits",i,"path"],message:`Duplicate source edit path: ${o.path}`}),s.add(o.path),e.conflictPolicy==="compare-and-swap"&&o.baseContentHash===void 0&&n.addIssue({code:"custom",path:["edits",i,"baseContentHash"],message:"source-edit compare-and-swap requires baseContentHash for every edit"})}),p.object({kind:p.literal("insert-page-resource"),artifact:Zi}).strict(),p.object({kind:p.literal("delete-page-source"),expectedUrlPath:p.string().startsWith("/")}).strict()]),Ac=p.enum(["NODE_NOT_FOUND","HOME_PAGE_LOCKED","ROUTE_NOT_FOUND","CAPABILITY_REJECTED","CONSTRAINT_VIOLATED","INVALID_PARAMS","PLAN_FAILED","TRANSACTION_PREFLIGHT_FAILED","ROUTE_REBUILD_FAILED","HISTORY_COMMIT_FAILED","MATERIALIZATION_CONFLICT","MATERIALIZATION_REJECTED","MUTATION_ASSERTION_REQUIRED","MUTATION_ASSERTION_INVALID","VERSION_STALE","AST_PARSE_ERROR","UNSUPPORTED_OPERATION","LOCATOR_FAILED","INVALID_TARGET","WRITE_IO_ERROR","CONCURRENT_MODIFIED","ROLLBACK_FAILED","RECOVERY_REQUIRED","RECOVERY_PERSIST_FAILED","MUTATION_SESSION_REQUIRED","LEASE_ASSERTION_INVALID","LEASE_ASSERTION_EXPIRED","LEASE_ASSERTION_SCOPE_MISMATCH","CROSS_PAGE_MOVE_UNSUPPORTED","INTERNAL_ERROR"]),Pc=p.object({code:Ac,message:p.string().min(1),details:p.record(p.string(),p.unknown()).optional()}),nn=p.object({key:p.string().min(1),instanceIndex:p.number().int().nonnegative().optional(),instanceCount:p.number().int().positive().optional()}),io=p.object({id:p.string().min(1),siteId:k,baseSnapshotId:I,composition:ge,kind:Fn,target:pg,documentVersion:p.number().int().nonnegative(),selectionRef:nn.optional(),mutationContext:Ln.optional(),params:yg}).strict().superRefine((e,n)=>{if(e.kind!==e.params.kind&&n.addIssue({code:"custom",path:["params","kind"],message:"params.kind must match operation kind"}),e.kind==="set-link-target"&&e.target.kind!=="node"&&n.addIssue({code:"custom",path:["target","kind"],message:"set-link-target requires a node target"}),e.kind==="source-edit"){if(e.target.kind!=="source-file"&&e.target.kind!=="source-batch")n.addIssue({code:"custom",path:["target","kind"],message:"source-edit requires a source-file or source-batch target"});else if(e.params.kind==="source-edit"){let s=e.params.edits.map(o=>o.path),i=e.target.kind==="source-file"?[e.target.path]:e.target.paths;Ig(s,i)||n.addIssue({code:"custom",path:["target"],message:"source-edit target paths must match edit paths"})}}else(e.target.kind==="source-file"||e.target.kind==="source-batch")&&n.addIssue({code:"custom",path:["target","kind"],message:"source targets are only valid for source-edit"});e.target.kind==="page-unit"&&(e.kind!=="insert-child"&&e.kind!=="replace-node"&&e.kind!=="move-node"&&e.kind!=="remove-node"&&n.addIssue({code:"custom",path:["target","kind"],message:"page-unit target is only valid for page-level operations"}),e.kind==="move-node"&&e.params.kind==="move-node"&&(!("kind"in e.params.target)||e.params.target.kind!=="page-composition")&&n.addIssue({code:"custom",path:["params","target","kind"],message:"page-unit move-node target requires page-composition placement"})),e.params.kind==="insert-child"&&"kind"in e.params.position&&e.params.position.kind==="page-composition"&&e.target.kind!=="page-unit"&&n.addIssue({code:"custom",path:["params","position","kind"],message:"page-composition position requires page-unit target"}),e.kind==="replace-node"&&e.target.kind!=="page-unit"&&n.addIssue({code:"custom",path:["target","kind"],message:"replace-node requires a page-unit target"}),e.kind==="insert-page-resource"||e.kind==="delete-page-source"?e.target.kind!=="project"&&n.addIssue({code:"custom",path:["target","kind"],message:`${e.kind} requires a project target`}):e.target.kind==="project"&&n.addIssue({code:"custom",path:["target","kind"],message:"project target is only valid for insert-page-resource or delete-page-source"}),e.kind==="insert-child"&&e.target.kind==="page-unit"&&e.params.kind==="insert-child"&&(!("kind"in e.params.position)||e.params.position.kind!=="page-composition")&&n.addIssue({code:"custom",path:["params","position","kind"],message:"page-unit target requires page-composition position"})}),V1=io,xg=p.object({kind:p.literal("insert-page-resource"),package_instance_id:p.string().min(1),pages:p.array(ec).min(1)}).strict().superRefine((e,n)=>{let s=new Set,i=new Set;for(let[o,a]of e.pages.entries())s.has(a.template_page_id)&&n.addIssue({code:"custom",path:["pages",o,"template_page_id"],message:`Duplicate template page route mapping: ${a.template_page_id}`}),i.has(a.final_route)&&n.addIssue({code:"custom",path:["pages",o,"final_route"],message:`Duplicate final route mapping: ${a.final_route}`}),s.add(a.template_page_id),i.add(a.final_route)}),Eg=p.object({kind:p.literal("delete-page-source"),deleted_files:p.array(p.string().min(1)),updated_files:p.array(p.string().min(1)),preserved_shared_files:p.array(p.string().min(1)),warnings:p.array(p.string().min(1))}).strict(),Rg=p.discriminatedUnion("kind",[xg,Eg]),wc=p.object({requestId:p.string().min(1),kind:Fn,composition:K,target:hg,resultVersion:p.number().int().nonnegative(),affectedFiles:p.array(p.string().min(1)).optional(),selectionRef:nn.optional(),output:Rg.optional()}).strict(),oo=wc.superRefine((e,n)=>{let s=e.kind==="insert-page-resource"||e.kind==="delete-page-source";s&&e.target.kind!=="project"?n.addIssue({code:"custom",path:["target","kind"],message:`${e.kind} result requires a project target`}):!s&&e.target.kind==="project"&&n.addIssue({code:"custom",path:["target","kind"],message:"project result target requires a project operation"}),s&&!e.output&&n.addIssue({code:"custom",path:["output"],message:`${e.kind} result requires typed output`}),e.output&&e.output.kind!==e.kind&&n.addIssue({code:"custom",path:["output","kind"],message:"output.kind must match operation kind"})}),Y1=cc({dataSchema:oo,codeSchema:Ac,failureDataSchema:wc.partial()});function Ig(e,n){return e.length===n.length&&e.every((s,i)=>s===n[i])}function Tg(e){if(/[\s\u0000-\u001f]/u.test(e))return!1;if(/^#[^\s]+$/u.test(e)||/^mailto:.+$/iu.test(e)||/^tel:.+$/iu.test(e))return!0;try{let n=new URL(e);return(n.protocol==="http:"||n.protocol==="https:")&&n.hostname.length>0}catch{return!1}}var kg=J.enum(["component","page","pages"]),Ag=J.object({resource_kind:kg,resource_name:J.string().trim().min(1).max(200),file_count:J.number().int().min(1).max(64),total_bytes:J.number().int().min(0).max(4*1024*1024),content_digest:J.string().regex(/^sha256:[a-f0-9]{64}$/),custom_prompt:J.string().trim().min(1).max(4e3).optional(),final_routes:J.array(J.string().min(1)).max(64)}).strict(),Pg=J.discriminatedUnion("kind",[J.object({kind:J.literal("none")}).strict(),J.object({kind:J.literal("primary"),items:J.array(J.object({label:J.string().trim().min(1).max(120),href:J.string().startsWith("/").max(200)}).strict()).min(1).max(64)}).strict().superRefine((e,n)=>{let s=new Set;for(let[i,o]of e.items.entries())s.has(o.href)&&n.addIssue({code:"custom",path:["items",i,"href"],message:`Duplicate navigation href: ${o.href}`}),s.add(o.href)})]),Os=J.array(J.object({href:J.string().startsWith("/").max(200),page_title:J.string().trim().min(1).max(200),selected_navigation_label:J.string().trim().min(1).max(120).optional()}).strict()).max(64).superRefine((e,n)=>{let s=new Set;for(let[i,o]of e.entries())s.has(o.href)&&n.addIssue({code:"custom",path:[i,"href"],message:"Duplicate resource page href."}),s.add(o.href)});function tP(e,n){let s=Os.safeParse(e);if(!s.success||s.data.length!==n.final_routes.length)return null;let i=new Set(n.final_routes);if(i.size!==n.final_routes.length)return null;let o=new Set(n.navigation_selection?.kind==="primary"?n.navigation_selection.items.map(a=>a.href):[]);return s.data.some(a=>!i.has(a.href)||o.has(a.href)!==(a.selected_navigation_label!==void 0))?null:s.data}var wg=J.object({base_snapshot_id:J.string().min(1),operation:io,navigation_selection:Pg.optional()}).strict().superRefine((e,n)=>{e.base_snapshot_id!==e.operation.baseSnapshotId&&n.addIssue({code:"custom",path:["operation","baseSnapshotId"],message:"Resource operation baseSnapshotId must match base_snapshot_id."})});function Cg(e){return(e.kind==="insert-child"||e.kind==="replace-node")&&(e.params.kind==="insert-child"||e.params.kind==="replace-node")&&e.params.node.kind==="component-call"&&"materialization"in e.params.node&&e.params.node.materialization?[e.params.node.materialization]:e.kind==="insert-page-resource"&&e.params.kind==="insert-page-resource"?[...e.params.artifact.components.map(n=>n.materialization),...e.params.artifact.pages.map(n=>n.materialization)]:[]}var Cc=J.object({id:J.string().min(1),tenant_id:J.string().min(1),site_id:J.string().min(1),run_id:J.string().min(1).optional(),correlation_id:J.string().min(1).optional(),sent_at:J.string().min(1),type:J.literal("client.resource.operation.create"),payload:J.object({client_message_id:J.string().min(1),display:Ag,transient_resource_input:wg}).strict()}).strict().superRefine((e,n)=>{let{display:s,transient_resource_input:i}=e.payload;e.site_id!==i.operation.siteId&&n.addIssue({code:"custom",path:["payload","transient_resource_input","operation","siteId"],message:"Resource operation siteId must match envelope site_id."}),(s.resource_kind==="component"?i.operation.kind==="insert-child"||i.operation.kind==="replace-node":i.operation.kind==="insert-page-resource")||n.addIssue({code:"custom",path:["payload","transient_resource_input","operation","kind"],message:s.resource_kind==="component"?"component resources require insert-child or replace-node.":`${s.resource_kind} resources require insert-page-resource.`});let c=Cg(i.operation).flatMap(m=>m.files),r=c.reduce((m,x)=>m+new TextEncoder().encode(x.content).byteLength,0);if(c.length>qi&&n.addIssue({code:"custom",path:["payload","transient_resource_input","operation"],message:"Resource operation exceeds the aggregate file count limit."}),r>Wi&&n.addIssue({code:"custom",path:["payload","transient_resource_input","operation"],message:"Resource operation exceeds the aggregate content byte limit."}),s.file_count!==c.length&&n.addIssue({code:"custom",path:["payload","display","file_count"],message:"Resource summary file_count must match the transient operation."}),s.total_bytes!==r&&n.addIssue({code:"custom",path:["payload","display","total_bytes"],message:"Resource summary total_bytes must match the transient operation."}),i.operation.kind==="insert-page-resource"&&i.operation.params.kind==="insert-page-resource"){let m=i.operation.params.artifact;m.resource_type!==s.resource_kind&&n.addIssue({code:"custom",path:["payload","display","resource_kind"],message:"Resource summary kind must match the page artifact resource_type."});let x=m.pages.map(_=>_.final_route);(x.length!==s.final_routes.length||x.some((_,w)=>_!==s.final_routes[w]))&&n.addIssue({code:"custom",path:["payload","display","final_routes"],message:"Resource summary final_routes must match the page artifact routes."})}if(i.navigation_selection?.kind==="primary"){let m=new Set(s.final_routes);for(let[x,_]of i.navigation_selection.items.entries())m.has(_.href)||n.addIssue({code:"custom",path:["payload","transient_resource_input","navigation_selection","items",x,"href"],message:"Navigation selection href must reference a final resource route."})}});import{z as C}from"zod";import{z as ao}from"zod";var M=e=>ao.object({code:ao.number().int(),data:e,message:ao.string()});var vg=["with_website","without_website"],sn=C.enum(vg),ro=C.string().trim().url().refine(e=>{let n=new URL(e).protocol;return n==="http:"||n==="https:"},{message:"Website must use the http or https protocol."}),Dg=["welcome","website_scan","customer_materials","analysis","diagnosis","strategy","structure_planning","preview_personalization","publishing"],It=C.enum(Dg),Og=["company_info","website_crawl","website_basic_info_extract","website_metrics_evaluate","intelligent_analysis","strategy_recommendation"],Dc=C.enum(Og),Ng=["started","running","succeeded","failed","invalidated"],Oc=C.enum(Ng),jg=["draft","structure_saved","generating","workspace_ready"],co=C.enum(jg),Lg=["not_deployed","deploying","deployed"],mo=C.enum(Lg),Mg=["active","completed"],Ug=C.enum(Mg),Fg=["completed","current","locked"],Gg=C.enum(Fg),Nc={draft:10,structure_saved:20,generating:30,workspace_ready:40},jc={not_deployed:10,deploying:20,deployed:30},Lc={active:10,completed:20},Mc={started:10,running:20,succeeded:30,failed:40,invalidated:50};function Ns(e){return new Map(Object.entries(e).map(([n,s])=>[s,n]))}var qg=Ns(Nc),Wg=Ns(jc),Bg=Ns(Lc),Kg=Ns(Mc);function mP(e){let n=qg.get(e);if(!n)throw new Error(`Unknown site build status code: ${e}`);return n}function lP(e){let n=Wg.get(e);if(!n)throw new Error(`Unknown site deployment status code: ${e}`);return n}function pP(e){let n=Bg.get(e);if(!n)throw new Error(`Unknown site workflow status code: ${e}`);return n}function dP(e){let n=Kg.get(e);if(!n)throw new Error(`Unknown task execution status code: ${e}`);return n}function uP(e){return Nc[e]}function _P(e){return jc[e]}function gP(e){return Lc[e]}function hP(e){return Mc[e]}var lo=[{definition_version:1,published:!0,required_client_capability:null,definitions:{with_website:[{id:"01900000-0000-7000-8000-000000000001",node_code:"welcome",label:"\u6B22\u8FCE\u542F\u52A8",sort_order:1,is_enabled:!0},{id:"01900000-0000-7000-8000-000000000002",node_code:"website_scan",label:"\u521D\u59CB\u5316\u9700\u6C42\u4E0E\u5B98\u7F51\u626B\u63CF",sort_order:2,is_enabled:!0},{id:"01900000-0000-7000-8000-000000000003",node_code:"analysis",label:"\u667A\u80FD\u5206\u6790",sort_order:3,is_enabled:!0},{id:"01900000-0000-7000-8000-000000000004",node_code:"diagnosis",label:"\u8BCA\u65AD\u62A5\u544A",sort_order:4,is_enabled:!0},{id:"01900000-0000-7000-8000-000000000005",node_code:"strategy",label:"\u7B56\u7565\u4E0E\u5EFA\u8BAE",sort_order:5,is_enabled:!0},{id:"01900000-0000-7000-8000-000000000014",node_code:"structure_planning",label:"\u7ED3\u6784\u89C4\u5212",sort_order:6,is_enabled:!0},{id:"01900000-0000-7000-8000-000000000015",node_code:"preview_personalization",label:"\u9884\u89C8\u4E0E\u4E2A\u6027\u5316",sort_order:7,is_enabled:!0},{id:"01900000-0000-7000-8000-000000000016",node_code:"publishing",label:"\u7F51\u7AD9\u53D1\u5E03",sort_order:8,is_enabled:!0}],without_website:[{id:"01900000-0000-7000-8000-00000000000b",node_code:"welcome",label:"\u6B22\u8FCE\u542F\u52A8",sort_order:1,is_enabled:!0},{id:"01900000-0000-7000-8000-00000000000c",node_code:"customer_materials",label:"\u5BA2\u6237\u8D44\u6599\u63D0\u4F9B",sort_order:2,is_enabled:!0},{id:"01900000-0000-7000-8000-00000000000d",node_code:"analysis",label:"\u667A\u80FD\u5206\u6790",sort_order:3,is_enabled:!0},{id:"01900000-0000-7000-8000-00000000000e",node_code:"strategy",label:"\u7B56\u7565\u4E0E\u5EFA\u8BAE",sort_order:4,is_enabled:!0},{id:"01900000-0000-7000-8000-000000000017",node_code:"structure_planning",label:"\u7ED3\u6784\u89C4\u5212",sort_order:5,is_enabled:!0},{id:"01900000-0000-7000-8000-000000000018",node_code:"preview_personalization",label:"\u9884\u89C8\u4E0E\u4E2A\u6027\u5316",sort_order:6,is_enabled:!0},{id:"01900000-0000-7000-8000-000000000019",node_code:"publishing",label:"\u7F51\u7AD9\u53D1\u5E03",sort_order:7,is_enabled:!0}]}}],SP=lo[0].definitions,Uc=C.number().int().min(1),zg=C.object({id:Q,flow_type:sn,definition_version:Uc,node_code:It,label:C.string().min(1),sort_order:C.number().int().min(1),is_enabled:C.boolean(),state:Gg}),Fc=C.object({id:Za,tenant_id:C.string().min(1),site_id:k,workflow_id:it,node_code:It,task_type:Dc,external_task_id:C.string().min(1),execution_status:Oc,idempotency_key:C.string().min(1),attempt_no:C.number().int().min(1),source_crawl_task_ref_id:C.string().uuid().nullable(),succeeded_at:C.string().min(1).nullable(),superseded_at:C.string().min(1).nullable(),site_url:C.string().url().nullable(),created_at:C.string().min(1),updated_at:C.string().min(1)}),Hg=C.object({id:it,tenant_id:C.string().min(1),site_id:k,flow_type:sn,website:ro.nullable(),definition_version:Uc,current_node_code:It,status:Ug,started_at:C.string().min(1),completed_at:C.string().min(1).nullable(),created_at:C.string().min(1),updated_at:C.string().min(1)}),po=C.object({workflow:Hg,menu:C.array(zg),task_refs:C.array(Fc),site:C.object({default_locale:Ie.optional(),status:co,deployment_status:mo,archived_at:C.string().min(1).nullable(),current_sitemap_id:C.string().nullable().optional(),current_sitemap_version:C.number().int().positive().nullable().optional(),confirmed_sitemap_id:C.string().nullable().optional(),confirmed_sitemap_version:C.number().int().positive().nullable().optional(),structure_confirmed_at:C.string().min(1).nullable().optional(),current_snapshot_id:C.string().nullable(),deployed_url:C.string().url().nullable(),cms_site_id:C.string().min(1).nullish()})}),fP=M(po),bP=M(Fc),vc=C.array(C.string().min(1).max(64)).max(16).optional(),yP=C.discriminatedUnion("flow_type",[C.object({flow_type:C.literal("with_website"),website:ro,client_capabilities:vc}).strict(),C.object({flow_type:C.literal("without_website"),website:C.null().optional(),client_capabilities:vc}).strict()]),xP=C.object({expected_current_node:C.literal("website_scan"),website:ro}).strict(),EP=C.object({expected_current_node:It}).strict(),RP=C.object({expected_current_node:C.literal("publishing")}).strict(),IP=C.object({publish_workflow_id:ms,expected_publish_revision:C.number().int().min(1)}).strict(),$g=C.object({node_code:It,task_type:Dc,external_task_id:C.string().min(1).max(255),idempotency_key:C.string().min(1).max(255),site_url:C.string().url().optional()}),TP=$g.extend({workflow_id:it}).strict(),kP=C.object({external_task_id:C.string().min(1).max(255),execution_status:Oc}),Vg=C.object({previous_external_task_id:C.string().min(1).max(255),external_task_id:C.string().min(1).max(255),idempotency_key:C.string().min(1).max(255),site_url:C.string().url().optional()}),AP=Vg.extend({workflow_id:it}).strict(),Yg=C.object({previous_external_task_id:C.string().min(1).max(255),external_task_id:C.string().min(1).max(255),idempotency_key:C.string().min(1).max(255),site_url:C.string().url()}),PP=Yg.extend({workflow_id:it}).strict(),wP=C.object({}).strict();function Xg(e,n,s){return e.find(i=>i.definition_version===s)?.definitions[n]}function Qg(e,n){return Xg(lo,e,n)}function Zg(e,n=1){let s=Qg(e,n);if(!s)throw new Error(`Unknown workflow definition: ${e} v${n}.`);return s}function Jg(e,n,s){let i=new Set(s);return e.filter(o=>o.published&&(o.required_client_capability===null||i.has(o.required_client_capability))).sort((o,a)=>a.definition_version-o.definition_version).map(o=>({definition_version:o.definition_version,items:o.definitions[n]}))[0]}function CP(e,n){return Jg(lo,e,n)}function vP(e,n){return Zg(e).findIndex(s=>s.node_code===n)}function DP(e,n){return e==="website_scan"?n==="website_crawl"||n==="website_basic_info_extract"||n==="website_metrics_evaluate":e==="customer_materials"?n==="company_info":e==="analysis"?n==="intelligent_analysis":e==="strategy"?n==="strategy_recommendation":!1}function OP(e,n){if(e===n)return n;if(!{started:["running","succeeded","failed","invalidated"],running:["succeeded","failed","invalidated"],succeeded:["invalidated"],failed:["invalidated"],invalidated:[]}[e].includes(n))throw new Error(`Invalid task execution status transition: ${e} -> ${n}`);return n}function NP(e,n){if(e===n)return n;if(!{draft:["structure_saved"],structure_saved:["generating","draft"],generating:["workspace_ready","structure_saved"],workspace_ready:[]}[e].includes(n))throw new Error(`Invalid site build status transition: ${e} -> ${n}`);return n}import{z as E}from"zod";var uo=E.string().min(1).max(120).regex(/^[a-z][a-z0-9_-]*$/),Ue=E.string().min(1).max(120).regex(/^[A-Za-z_][A-Za-z0-9_]*$/),eh=E.enum(["text","select","multi_select","tags","category_list","boolean","number"]),Gn=E.string().min(1).max(512).regex(/^\/(?:[^?#]*)$/),th=E.enum(["base_snapshot_missing","route_not_found","cms_unavailable","product_application_not_found","not_a_configuration_change","tool_execution_failed"]),_o=E.object({status:E.literal("failed"),reason:th}).strict(),nh=E.object({minimum:E.number().finite(),maximum:E.number().finite(),step:E.number().finite().positive()}).strict().refine(e=>e.minimum<e.maximum,{message:"minimum must be less than maximum"}),sh=E.string().trim().min(1).max(100),qc=E.array(sh).max(5).refine(e=>new Set(e.map(n=>n.toLowerCase())).size===e.length,{message:"popular_terms must be unique ignoring case"}),UP=E.array(E.string()).max(20).transform(e=>{let n=new Set;return e.map(s=>s.trim()).filter(s=>{if(s.length===0||s.length>100)return!1;let i=s.toLowerCase();return n.has(i)?!1:(n.add(i),!0)}).slice(0,5)}),Wc=E.object({filter_enabled:E.boolean(),selected_fields:E.array(Ue).max(64),selected_card_fields:E.array(Ue).max(64).default([]),popular_terms_enabled:E.boolean().default(!1),popular_terms:qc.optional()}).strict(),ih=E.object({app_slug:uo}).extend(Wc.shape).strict(),go=E.object({kind:E.literal("product_search_confirmation"),baseline_snapshot_id:I,target_route_id:Gn,applications:E.array(E.object({app_slug:uo,label:E.string().min(1).max(200),popular_terms:qc.default([]),current_config:Wc.nullable().default(null),affected_routes:E.array(Gn).max(64).default([]),fields:E.array(E.object({field_name:Ue,label:E.string().min(1).max(200),value_shape:eh,option_count:E.number().int().nonnegative().optional(),filter_meta:nh.optional()}).strict()).max(64)}).strict()).min(1).max(12),current_config:ih.nullable().optional(),affected_routes:E.array(Gn).min(1).max(64).optional()}).strict(),oh=E.object({kind:E.literal("product_search_confirmation"),action:E.enum(["confirm","modify"]),app_slug:uo,filter_enabled:E.boolean(),popular_terms_enabled:E.boolean().default(!1),selected_fields:E.array(Ue).max(64),selected_card_fields:E.array(Ue).max(64).default([])}).strict().superRefine((e,n)=>{e.filter_enabled&&e.selected_fields.length===0&&n.addIssue({code:"custom",path:["selected_fields"],message:"selected_fields must not be empty while filters are enabled"}),new Set(e.selected_fields).size!==e.selected_fields.length&&n.addIssue({code:"custom",path:["selected_fields"],message:"selected_fields must be unique"}),new Set(e.selected_card_fields).size!==e.selected_card_fields.length&&n.addIssue({code:"custom",path:["selected_card_fields"],message:"selected_card_fields must be unique"})}),js=E.union([oh,E.object({kind:E.literal("product_search_confirmation"),action:E.literal("cancel")}).strict()]),qn=E.union([E.string().max(255),E.number().finite(),E.boolean()]),ah=E.object({values:E.array(qn).min(1).max(20).refine(e=>new Set(e.map(n=>`${typeof n}:${String(n)}`)).size===e.length,{message:"values must be unique"})}).strict(),rh=E.object({min:E.number().finite().optional(),max:E.number().finite().optional(),include_unlabeled:E.boolean().optional()}).strict().refine(e=>e.min!==void 0||e.max!==void 0||e.include_unlabeled===!0,{message:"a numeric boundary or include_unlabeled is required"}).refine(e=>e.min===void 0||e.max===void 0||e.min<=e.max,{message:"min must not be greater than max"}),ch=E.object({q:E.string().max(200),page:E.number().int().min(1).max(500),page_size:E.union([E.literal(9),E.literal(20)]),sort:E.enum(["published_at_desc","published_at_asc","product_name_asc","product_name_desc"]),filters:E.record(Ue,E.union([ah,rh])).superRefine((e,n)=>{Object.keys(e).length>12&&n.addIssue({code:"custom",message:"filters must contain at most 12 fields"})}),display_fields:E.array(Ue).max(64).default([]),missing_count_fields:E.array(Ue).max(12).default([]),relaxation_count_fields:E.array(Ue).max(12).default([]),facets:E.array(E.object({field:Ue,query:E.string().max(100),page:E.number().int().min(1).max(100),page_size:E.literal(10),include_values:E.array(qn).max(20)}).strict()).max(8)}).strict(),Gc=E.object({value:qn,label:E.string().max(200),count:E.number().int().nonnegative()}).strict(),mh=E.union([qn,E.array(qn).max(50)]),lh=E.object({items:E.array(E.object({id:E.number().int().positive(),thumbnail:E.string().max(2048).nullable(),title:E.string().max(300),summary:E.string().max(2e3),category:E.string().max(300).nullable(),field_values:E.record(Ue,mh).default({}),url:E.string().min(1).max(2048)}).strict()).max(20),page:E.object({total:E.number().int().nonnegative(),page:E.number().int().positive(),page_size:E.union([E.literal(9),E.literal(20)])}).strict(),facets:E.array(E.object({field:Ue,total:E.number().int().nonnegative(),page:E.number().int().positive(),page_size:E.literal(10),values:E.array(Gc).max(10),selected_values:E.array(Gc).max(20)}).strict()).max(8),missing_counts:E.record(Ue,E.number().int().nonnegative()).default({}),relaxation_counts:E.record(Ue,E.number().int().nonnegative()).default({})}).strict(),FP=E.object({contract_version:E.literal(1),request:ch,response:lh}).strict();import{z as qe}from"zod";var ho=4,WP=20,BP=1440*60*1e3,KP=1e6,ph=["image/png","image/jpeg","image/webp"],So=qe.enum(ph),zP="WORKSPACE_ATTACHMENT_UNSUPPORTED_FORMAT",HP="WORKSPACE_ATTACHMENT_TOO_LARGE",$P="WORKSPACE_ATTACHMENT_LIMIT",VP="WORKSPACE_ATTACHMENT_BOUND",YP=10,XP=3600*1e3,QP="WORKSPACE_ATTACHMENT_URL_REJECTED",ZP="WORKSPACE_ATTACHMENT_CAPTURE_FAILED",JP="WORKSPACE_ATTACHMENT_CAPTURE_BUSY",ew="WORKSPACE_ATTACHMENT_CAPTURE_TIMEOUT",tw="WORKSPACE_ATTACHMENT_CAPTURE_BUDGET_EXCEEDED",nw="WORKSPACE_ATTACHMENT_CAPTURE_UNAVAILABLE",sw=qe.object({attachment_id:qe.string().min(1),media_type:So,width:qe.number().int().positive(),height:qe.number().int().positive(),size_bytes:qe.number().int().nonnegative(),filename:qe.string().min(1).max(120),image_url:qe.string().min(1),source_url:qe.string().min(1).optional(),created_at:qe.string().min(1)}).strict(),iw=qe.object({url:qe.string().url().max(2048),full_page:qe.boolean().optional()}).strict(),Bc="[A-Za-z0-9_-]+",dh=new RegExp(`^/sites/(${Bc})/workspace/attachments/(${Bc})/image$`);function ow(e,n){return`/sites/${encodeURIComponent(e)}/workspace/attachments/${encodeURIComponent(n)}/image`}function fo(e){let n=dh.exec(e);return n?{site_id:n[1],attachment_id:n[2]}:null}function aw(e){let n=[];for(let s of e){if(s.type!=="file"||typeof s.url!="string")continue;let i=fo(s.url);i&&n.push({attachment_id:i.attachment_id,site_id:i.site_id,media_type:typeof s.mediaType=="string"?s.mediaType:"",filename:typeof s.filename=="string"&&s.filename.trim()!==""?s.filename:"image",url:s.url})}return n}import{z as Wn}from"zod";var uh=["deployment_queued","prepare_source","build_artifact","publish_site","site_released","cleanup_release"],_h=Wn.enum(uh),gh=Wn.enum(["running","succeeded","failed"]),hh=Wn.object({code:_h,status:gh,message:Wn.string().trim().min(1)}).strict(),Kc=Wn.array(hh);import{z as Bn}from"zod";var Sh={slug:/^page_[0-9]+_slug$/,showInHeader:/^page_[0-9]+_show_in_header$/,showInFooter:/^page_[0-9]+_show_in_footer$/,type:/^block_[0-9]+_type$/};function pw(e){let n={},s=new Set;for(let i of e){if(!Sh[i.field].test(i.key))throw new Error("Invalid Sitemap Resolver answer-sheet hole key.");if(s.has(i.key))throw new Error("Duplicate Sitemap Resolver answer-sheet hole key.");s.add(i.key),n[i.key]=i.field==="slug"?Bn.string().min(1):i.field==="type"?Bn.string().trim().min(1):Bn.boolean()}return Bn.object({answers:Bn.object(n).strict()}).strict()}import{z as v}from"zod";var fh=v.enum(["pending","running","succeeded","failed"]),bh=v.enum(["TASK_FAILED","WEBSITE_UNREACHABLE"]),yh=v.object({task_id:v.string().uuid(),site_url:v.string().url(),crawler_task_id:v.string().min(1).max(255).nullable(),crawler_error_code:bh.nullable().optional(),crawler_failure_stage:v.enum(["URL_DISCOVERY","PAGE_CRAWL","TASK_SCHEDULING","RESULT_PERSISTENCE"]).nullable().optional(),page_count:v.number().int().min(0).max(20),status:fh,error:v.string().nullable(),created_at:v.string().min(1),updated_at:v.string().min(1)}),gw=M(yh),bo=v.enum(["existing_site","new_site"]),Hc=v.enum(["google_indexing","ai_recommendation","qualification_verifiability","content_freshness","inquiry_form","inquiry_response","privacy_compliance","prohibited_content"]),zc=v.object({observed_result:v.enum(["pass","fail","unknown"])}).strict(),$c=v.object({kind:v.literal("ai_crawlability"),checks:v.object({ai_access_guidance:zc,structured_data_presence:zc}).strict()}).strict(),yo=v.object({label:v.string().trim(),value:v.union([v.string(),v.number(),v.boolean(),v.null()]),summary:v.string().trim(),tone:v.enum(["good","warn","bad","unknown"]),status:v.enum(["ok","unknown"]),assessment:$c.optional()}),Ls=v.object({key:v.string().trim().min(1).max(100),label:v.string().trim().min(1).max(100),value:v.union([v.string().max(1e3),v.number(),v.boolean(),v.null()]),tone:v.enum(["good","warn","bad","unknown"]),status:v.enum(["ok","unknown"]),evidence:v.string().trim().max(2e3).optional(),assessment:$c.optional()}).strict(),xh=v.object({url:v.string().url().max(2048),title:v.string().trim().max(300),words:v.number().int().nonnegative().max(1e7)}).strict(),Eh=v.object({site_url:v.string().url().max(2048),scanned_at:v.string().datetime({offset:!0}),reach:v.array(Ls).max(64),trust:v.array(Ls).max(64),convert:v.array(Ls).max(64),safe:v.array(Ls).max(64),pages:v.array(xh).max(100)}).strict(),Ms=v.object({company_task_id:v.string().min(1).max(128),scan_task_id:v.string().min(1).max(128),type:bo,result:v.object({company_name:v.string(),website:v.string().url().optional(),primary_product:v.string(),current_market:v.string(),qualifications:v.string(),scan_cards:v.record(v.string(),yo),scan_result:Eh.optional()})}),Rh=v.object({saved:v.literal(!0),company_task_id:v.string().min(1).max(128),scan_task_id:v.string().min(1).max(128)}),hw=M(Rh),Ih=v.enum(["snapshot","task"]),Th=Ms.shape.result.extend({type:bo,structured_facts:v.unknown().optional()}).extend({company_name:v.string(),primary_product:v.string(),current_market:v.string(),qualifications:v.string()}),kh=v.object({site_id:v.string().min(1).max(128),company_task_id:v.string().min(1).max(128),scan_task_id:v.string().min(1).max(128),type:bo,data_source:Ih,result:Th}),Sw=M(kh.nullable());import{z as Te}from"zod";var Tt=Te.enum(["company","product_service","case_qualification","market","contact_inquiry","privacy_compliance","news_freshness"]),Ah=Te.object({ordinal:Te.number().int().min(1).max(1e4),path:Te.string().min(1).max(2048).refine(e=>!Ch(e),{message:"path must be a site-relative path, not an absolute URL"}),last_modified:Te.string().max(64).nullable()}).strict(),yw=Te.object({candidates:Te.array(Ah).min(1).max(1e4),selection_limit:Te.number().int().min(1).max(19)}).strict().superRefine((e,n)=>{let s=e.candidates.map(i=>i.ordinal).sort((i,o)=>i-o);for(let[i,o]of s.entries())if(o!==i+1){n.addIssue({code:"custom",path:["candidates"],message:"candidates ordinals must be unique and consecutive from 1"});return}}),Ph=Te.object({ordinal:Te.number().int().positive().max(1e4),roles:Te.array(Tt).min(1).max(7)}).strict(),wh=Te.object({role:Tt,status:Te.enum(["selected","not_found"]),selected_ordinals:Te.array(Te.number().int().positive().max(1e4)).max(19)}).strict(),xw=Te.object({selections:Te.array(Ph).max(19),coverage:Te.array(wh).length(7)}).strict().superRefine((e,n)=>{let s=new Set;for(let[o,a]of e.coverage.entries())s.has(a.role)&&n.addIssue({code:"custom",path:["coverage",o,"role"],message:"coverage roles must be unique"}),s.add(a.role);for(let o of Tt.options)s.has(o)||n.addIssue({code:"custom",path:["coverage"],message:`coverage must include every page role (missing ${o})`});let i=new Map;for(let o of e.selections)for(let a of o.roles){let c=i.get(a)??new Set;c.add(o.ordinal),i.set(a,c)}for(let[o,a]of e.coverage.entries()){let c=i.get(a.role);a.selected_ordinals.some(m=>!c?.has(m))&&n.addIssue({code:"custom",path:["coverage",o,"selected_ordinals"],message:"selected_ordinals must reference selections carrying the same role"})}});function Ch(e){let n=e.toLowerCase();return n.startsWith("http://")||n.startsWith("https://")||e.startsWith("//")}import{z as f}from"zod";var Tw=f.object({force_refresh:f.boolean().optional()}),Yc=f.enum(["running","succeeded","failed"]),vh=f.object({agent_id:f.string().min(1),name:f.string().min(1),icon:f.string().min(1),capability:f.string().min(1),data_source:f.string().min(1),output_topics:f.string().min(1)}),Dh=f.object({site_mode:f.enum(["existing_site","new_site"]),scan_required:f.boolean(),scheduled_agent_ids:f.array(f.string().min(1)),omitted_agent_ids:f.array(f.string().min(1)),next_stage:f.enum(["diagnostic_report","strategy"])}),Oh=f.object({t:f.string(),d:f.string(),evidence:f.object({from:f.string(),url:f.string().nullable().optional(),value:f.string().nullable().optional()})}),Nh=f.enum(["complete","partial","insufficient_data","failed"]),jh=f.enum(["ok","failed","insufficient_data"]),xo=f.object({agent_id:f.string().min(1),name:f.string().min(1),icon:f.string().min(1),status:jh,topics:f.array(f.object({topic_id:f.string().min(1),status:Nh,evidence_refs:f.array(f.string())})).length(3),findings:f.array(Oh).max(3),elapsed_ms:f.number().nonnegative(),note:f.string().optional(),error:f.string().optional()}),Xc=f.object({total:f.number().int().nonnegative(),ok:f.number().int().nonnegative(),degraded:f.number().int().nonnegative(),total_findings:f.number().int().nonnegative(),elapsed_ms:f.number().nonnegative(),site_mode:f.enum(["existing_site","new_site"]).optional(),scheduled_agent_ids:f.array(f.string()).optional(),omitted_agent_ids:f.array(f.string()).optional(),scheduled:f.number().int().nonnegative().optional(),complete:f.number().int().nonnegative().optional(),partial:f.number().int().nonnegative().optional(),insufficient:f.number().int().nonnegative().optional(),failed:f.number().int().nonnegative().optional(),next_stage:f.enum(["diagnostic_report","strategy"]).optional()}),Lh=f.object({agents_done:f.boolean(),analysis:f.record(f.string(),xo),step4_scoring_input:f.unknown().optional(),summary:Xc}),Qc=f.object({job_id:f.string().min(1),site_id:f.string().min(1),model_version:f.string().min(1),output_locale:f.string().min(2),cached:f.boolean().optional(),status:Yc,result:Lh.nullable().optional(),error:f.string().nullable().optional()}),kw=M(f.array(vh)),Aw=M(Dh),Pw=M(Qc),ww=M(Qc.nullable()),gt=f.object({id:f.union([f.number().int().nonnegative(),f.string().regex(/^(0|[1-9]\d*)$/u).transform(Number)]).pipe(f.number().int().nonnegative())}),Vc=f.object({percent:f.number().int().min(0).max(100),phase:f.enum(["preparing","analyzing","finalizing","completed","failed"]),stage:f.enum(["queued","baseline_ready","source_pages_ready","external_evidence_ready","knowledge_evidence_ready","page_evidence_ready","analysis_context_ready","preparation_saved","workflow_ready","agent_started","agent_completed","workflow_completed","scoring_input_ready","red_texts_ready","result_ready","result_persisted","completed","failed"]),agents_done:f.number().int().nonnegative(),agents_total:f.number().int().nonnegative(),agent_id:f.string().min(1).optional()}),Cw=f.discriminatedUnion("event",[gt.extend({event:f.literal("snapshot"),data:f.object({job_id:f.string().min(1),status:Yc,done:f.number().int().nonnegative(),total:f.number().int().nonnegative(),results:f.array(xo),progress:Vc.optional()})}),gt.extend({event:f.literal("progress"),data:Vc}),gt.extend({event:f.literal("preparing_started"),data:f.object({stage:f.literal("baseline")})}),gt.extend({event:f.literal("preparing_progress"),data:f.object({stage:f.enum(["context","external_evidence"])})}),gt.extend({event:f.literal("preparing_done"),data:f.object({evidence_count:f.number().int().nonnegative(),rule_count:f.number().int().nonnegative(),degraded_capabilities:f.array(f.string())})}),gt.extend({event:f.literal("agent_start"),data:f.object({agent_id:f.string().min(1),name:f.string().min(1),icon:f.string().min(1)})}),gt.extend({event:f.literal("agent_done"),data:xo}),gt.extend({event:f.literal("done"),data:f.object({agents_done:f.literal(!0),summary:Xc})}),gt.extend({event:f.literal("failed"),data:f.object({message:f.string().min(1)})})]);import{z as U}from"zod";var Ro=U.enum(["reach","trust","convert","safe"]),Oe=U.number().finite(),Mh=U.number().finite().positive(),Eo=["reach","trust","convert","safe"],Uh=17,Fh=U.enum(["passed","partial","failed"]),Gh=U.object({landing_page_mode:U.enum(["intent_dynamic","static","none"]),ab_test_enabled:U.boolean()}).strict(),qh=U.union([U.boolean(),U.number().finite(),Fh,Gh]).nullable(),Wh=U.union([U.boolean(),U.number().finite()]).nullable(),Bh=U.object({competitor_avg:U.number().finite(),score_items:U.record(U.string(),qh),penalty_items:U.record(U.string(),Wh),red_texts:U.array(U.string())}).strict(),Kh=U.record(Ro,Bh),zh=U.object({key:Ro,score:Oe,pass_score:Oe,gap:Oe}),Hh=U.object({key:U.string(),title:U.string(),is_redline_option:U.boolean().optional(),score:Oe,max_score:Mh,pass_score:Oe,passed:U.boolean(),description:U.string()}),$h=U.object({key:Ro,title:U.string(),alias:U.string(),slogan:U.string(),score:Oe,max_score:U.literal(100),pass_score:Oe,competitor_average:Oe,status:U.enum(["reached","near","not_reached"]),status_name:U.enum(["\u8FBE\u6807","\u63A5\u8FD1","\u672A\u8FBE\u6807"]),summary:U.string(),sub_dimensions:U.array(Hh),red_texts:U.array(U.string()),redline_hit:U.boolean().optional()}),Vh=U.object({id:U.number().int().positive(),task_code:U.string().min(1).max(128),is_sync:U.literal(0),status:U.literal("succeeded"),rules:Kh,scores_list:U.object({overview:U.object({pass_scores:U.object({reach:Oe,trust:Oe,convert:Oe,safe:Oe}),total_score:Oe,total_pass_score:Oe,score_gap:Oe,competitor_average_score:Oe,scoring_criteria_text:U.string().min(1),gap_dimensions:U.array(zh).max(4),overall_passed:U.boolean(),all_scores_passed:U.boolean(),diagnosis_passed:U.boolean(),commitment_eligible:U.boolean(),safe_redline_hit:U.boolean()}),dimensions:U.array($h).length(4)}),created_at:U.string().datetime({offset:!0}),updated_at:U.string().datetime({offset:!0})}).superRefine((e,n)=>{Yh(e.scores_list.dimensions)||n.addIssue({code:"custom",path:["scores_list","dimensions"],message:"dimensions must include each canonical score dimension."}),e.scores_list.dimensions.reduce((i,o)=>i+o.sub_dimensions.length,0)!==Uh&&n.addIssue({code:"custom",path:["scores_list","dimensions"],message:"dimensions must include 17 subdimensions in total."});for(let[i,o]of e.scores_list.dimensions.entries()){if(o.redline_hit===void 0)continue;let a=o.sub_dimensions.findIndex(c=>c.is_redline_option===void 0);a!==-1&&n.addIssue({code:"custom",path:["scores_list","dimensions",i,"sub_dimensions",a,"is_redline_option"],message:"subdimensions must define is_redline_option when redline_hit is defined."})}}),Nw=M(Vh);function Yh(e){let n=e.map(s=>s.key);return n.length===Eo.length&&new Set(n).size===Eo.length&&Eo.every(s=>n.includes(s))}var kt={queued:["preparing_source","lock_failed","deploy_failed"],preparing_source:["building","source_prepare_failed","deploy_failed"],building:["artifact_ready","build_failed","artifact_fetch_failed","artifact_validation_failed","deploy_failed"],artifact_ready:["deploying","deploy_failed"],deploying:["released","deploy_failed"],released:[],lock_failed:[],source_prepare_failed:[],build_failed:[],artifact_fetch_failed:[],artifact_validation_failed:[],deploy_failed:[],cleanup_failed:[]};for(let e of Object.values(kt))Object.freeze(e);Object.freeze(kt);var Mw=Object.freeze(Xt.filter(e=>kt[e].length>0)),Uw=Object.freeze(Xt.filter(e=>kt[e].length===0)),Xh=Object.freeze(["preparing_source","building","artifact_ready","deploying","released"]),Qh="DEPLOYMENT_TRANSITION_INVALID",Io=class extends Error{constructor(n,s){super(`Invalid deployment transition: ${n} -> ${s}`),this.currentStatus=n,this.nextStatus=s,this.code=Qh,this.name="DeploymentTransitionError"}};function Fw(e){return kt[e]}function Gw(e){return Xt.filter(n=>kt[n].some(s=>s===e))}function Zh(e){return kt[e].length>0}function qw(e){return!Zh(e)}function Ww(e,n){if(!kt[e].some(s=>s===n))throw new Io(e,n);return n}function Bw(){return Xh}import{converter as Jh,formatHex as eS,parse as tS,wcagContrast as Hw}from"culori";var $w=Jh("oklch");var T={paper:"oklch(0.92 0.008 250)",cream:"oklch(0.90 0.035 85)",sand:"oklch(0.75 0.05 78)",stone:"oklch(0.60 0.02 75)",ash:"oklch(0.60 0.012 250)",slate:"oklch(0.45 0.025 250)",charcoal:"oklch(0.30 0.015 255)",ink:"oklch(0.25 0.04 260)",sky:"oklch(0.72 0.12 230)",blue:"oklch(0.58 0.17 250)","medical blue":"oklch(0.58 0.12 235)",indigo:"oklch(0.50 0.18 280)",navy:"oklch(0.40 0.10 258)",ocean:"oklch(0.55 0.13 220)","slate blue":"oklch(0.46 0.06 245)",teal:"oklch(0.60 0.12 195)","soft aqua":"oklch(0.78 0.07 190)",mint:"oklch(0.78 0.10 165)",sage:"oklch(0.65 0.05 145)",green:"oklch(0.58 0.15 145)","clinical green":"oklch(0.62 0.12 155)",emerald:"oklch(0.60 0.16 155)",forest:"oklch(0.45 0.10 145)",olive:"oklch(0.58 0.08 115)",lime:"oklch(0.72 0.17 130)",yellow:"oklch(0.82 0.15 100)",gold:"oklch(0.72 0.14 85)",amber:"oklch(0.70 0.16 70)",orange:"oklch(0.66 0.18 55)",coral:"oklch(0.68 0.16 32)",terracotta:"oklch(0.55 0.12 42)",rust:"oklch(0.50 0.13 38)",brown:"oklch(0.45 0.07 55)",rose:"oklch(0.65 0.16 18)",red:"oklch(0.58 0.20 25)",crimson:"oklch(0.52 0.20 22)",wine:"oklch(0.42 0.13 18)",pink:"oklch(0.72 0.14 0)",magenta:"oklch(0.60 0.22 345)",lavender:"oklch(0.72 0.08 295)",violet:"oklch(0.58 0.19 295)",purple:"oklch(0.52 0.19 305)",plum:"oklch(0.45 0.13 325)",electric:"oklch(0.62 0.23 285)","clean white":"oklch(0.97 0.01 245)","cool gray":"oklch(0.62 0.02 245)",zinc:"oklch(0.60 0.012 250)",gray:"oklch(0.60 0.012 250)",grey:"oklch(0.60 0.012 250)",neutral:"oklch(0.60 0.005 250)",gunmetal:"oklch(0.30 0.015 255)"},nS={\u84DD:T.blue,\u84DD\u8272:T.blue,\u5929\u84DD:T.sky,\u5929\u84DD\u8272:T.sky,\u6D45\u84DD:T.sky,\u6E56\u84DD:T.ocean,\u6D77\u84DD:T.ocean,\u6DF1\u84DD:T.navy,\u85CF\u84DD:T.navy,\u85CF\u9752:T.navy,\u6D77\u519B\u84DD:T.navy,\u6DF1\u6D77\u519B\u84DD:T.navy,\u5348\u591C\u84DD:T.navy,\u975B\u84DD:T.indigo,\u975B\u9752:T.indigo,\u94A2\u84DD:T["slate blue"],\u9752:T.teal,\u9752\u8272:T.teal,\u84DD\u7EFF:T.teal,\u7EFF:T.green,\u7EFF\u8272:T.green,\u6D45\u7EFF:T.mint,\u8584\u8377\u7EFF:T.mint,\u8349\u7EFF:T.lime,\u6A44\u6984\u7EFF:T.olive,\u58A8\u7EFF:T.forest,\u6DF1\u7EFF:T.forest,\u68EE\u6797\u7EFF:T.forest,\u7FE0\u7EFF:T.emerald,\u7956\u6BCD\u7EFF:T.emerald,\u9EC4:T.yellow,\u9EC4\u8272:T.yellow,\u91D1:T.gold,\u91D1\u8272:T.gold,\u91D1\u9EC4:T.gold,\u7425\u73C0:T.amber,\u7425\u73C0\u8272:T.amber,\u6A59:T.orange,\u6A59\u8272:T.orange,\u6A58\u8272:T.orange,\u6A58\u9EC4:T.orange,\u6D3B\u529B\u6A59:T.orange,\u6696\u6A59:T.orange,\u73CA\u745A:T.coral,\u73CA\u745A\u6A59:T.coral,\u9676\u571F:T.terracotta,\u8D64\u9676:T.terracotta,\u9508\u7EA2:T.rust,\u68D5:T.brown,\u68D5\u8272:T.brown,\u8910\u8272:T.brown,\u5496\u5561\u8272:T.brown,\u7EA2:T.red,\u7EA2\u8272:T.red,\u6731\u7EA2:T.red,\u7EEF\u7EA2:T.crimson,\u6DF1\u7EA2:T.crimson,\u9152\u7EA2:T.wine,\u73AB\u7470:T.rose,\u73AB\u7EA2:T.rose,\u7C89:T.pink,\u7C89\u8272:T.pink,\u7C89\u7EA2:T.pink,\u6D0B\u7EA2:T.magenta,\u54C1\u7EA2:T.magenta,\u7D2B:T.purple,\u7D2B\u8272:T.purple,\u6DE1\u7D2B:T.lavender,\u85B0\u8863\u8349:T.lavender,\u7D2B\u7F57\u5170:T.violet,\u6885\u7EA2:T.plum,\u7070:T.gray,\u7070\u8272:T.gray,\u6D45\u7070:T.gray,\u6DE1\u7070:T.gray,\u51B7\u7070:T["cool gray"],\u51B7\u7070\u767D:T["cool gray"],\u6696\u7070:T.stone,\u6DF1\u7070:T.slate,\u77F3\u58A8\u7070:T.slate,\u77F3\u677F\u7070:T.slate,\u70AD\u7070:T.charcoal,\u70AD\u9ED1:T.charcoal,\u58A8:T.ink,\u58A8\u8272:T.ink,\u9ED1:T.ink,\u9ED1\u8272:T.ink,\u767D:T["clean white"],\u767D\u8272:T["clean white"],\u7C73\u767D:T.cream,\u7C73\u8272:T.cream,\u8C61\u7259\u767D:T.cream,\u5976\u6CB9\u767D:T.cream,\u6C99\u8272:T.sand},Vw={...T,...nS};function To(e){let n=tS(e.trim());return n?eS(n)??null:null}var ht={Inter:{import:"Inter"},"Inter Tight":{import:"Inter_Tight"},"DM Sans":{import:"DM_Sans"},"Source Sans 3":{import:"Source_Sans_3"},"Libre Franklin":{import:"Libre_Franklin"},Montserrat:{import:"Montserrat"},Archivo:{import:"Archivo"},"Space Grotesk":{import:"Space_Grotesk"},Manrope:{import:"Manrope"},"IBM Plex Sans":{import:"IBM_Plex_Sans"},Oswald:{import:"Oswald"},"Roboto Condensed":{import:"Roboto_Condensed"},"Bebas Neue":{import:"Bebas_Neue",weights:["400"]},"Playfair Display":{import:"Playfair_Display"},Lora:{import:"Lora"},Fraunces:{import:"Fraunces"},"Cormorant Garamond":{import:"Cormorant_Garamond"},"JetBrains Mono":{import:"JetBrains_Mono"},"IBM Plex Mono":{import:"IBM_Plex_Mono",weights:["400","500","600","700"]},"Noto Sans SC":{import:"Noto_Sans_SC",download:!1},"Noto Serif SC":{import:"Noto_Serif_SC",download:!1}},sS={heading:"Inter",body:"Inter"},Zc=ht.Inter;function Us(e){return e.trim().replace(/\s+/g,"_").toLowerCase()}var nm=(()=>{let e=new Map;for(let[n,s]of Object.entries(ht))e.set(Us(n),s),e.set(Us(s.import),s);return e})();function iS(e){return typeof e!="string"||e.trim().length===0?Zc:nm.get(Us(e))??Zc}var oS=(()=>{let e=new Map;for(let[n,s]of Object.entries(ht))e.set(s.import,n);return e})();function on(e){if(typeof e!="string"||e.trim().length===0)return"Inter";let n=nm.get(Us(e));return n?oS.get(n.import)??"Inter":"Inter"}var aS=Object.keys(ht),Jc='ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',em='Georgia, "Times New Roman", serif',tm='"SFMono-Regular", Consolas, monospace',rS=new Set(["serif","sans-serif","sans serif","monospace","mono","cursive","fantasy","system-ui","ui-serif","ui-sans-serif","ui-monospace"]),cS=new Set(["Playfair Display","Lora","Fraunces","Cormorant Garamond","Noto Serif SC"].map(e=>e.toLowerCase())),mS=new Set(["JetBrains Mono","IBM Plex Mono"].map(e=>e.toLowerCase()));function lS(e){let n=e.toLowerCase();return mS.has(n)||n.includes("mono")?"mono":cS.has(n)||n.includes("serif")?"serif":"sans"}function ko(e,n){let s=m=>(m??"").trim().replace(/^['"]|['"]$/g,"").replace(/[^A-Za-z0-9 _-]+/g,"").trim().slice(0,60),i=s(e),o=s(n),a=m=>rS.has(m.toLowerCase());if(i&&a(i)){let m=i.toLowerCase();return m.includes("mono")?tm:m.includes("serif")?em:Jc}let c=i;c||(c=a(o)?"":o),c||(c="Inter");let r=lS(c);return r==="mono"?`"${c}", ${tm}`:r==="serif"?`"${c}", ${em}`:`"${c}", ${Jc}`}function pS(e){return{"--site-font-sans":ko(e?.body,"Inter"),"--site-font-heading":ko(e?.heading,e?.body??"Inter")}}var Ao=["archivo-inter","playfair-source-sans","space-grotesk-manrope","fraunces-libre-franklin","noto-serif-sc-noto-sans-sc","noto-sans-sc"],sm=[{id:"archivo-inter",heading:"Archivo",body:"Inter"},{id:"playfair-source-sans",heading:"Playfair Display",body:"Source Sans 3"},{id:"space-grotesk-manrope",heading:"Space Grotesk",body:"Manrope"},{id:"fraunces-libre-franklin",heading:"Fraunces",body:"Libre Franklin"},{id:"noto-serif-sc-noto-sans-sc",heading:"Noto Serif SC",body:"Noto Sans SC"},{id:"noto-sans-sc",heading:"Noto Sans SC",body:"Noto Sans SC"}];function im(e){let n=sm.find(s=>s.id===e);if(!n)throw new Error(`Unknown font pairing: ${e}`);return n}import{z as an}from"zod";import{z as dS}from"zod";var uS=["light","standard","bold"],We=dS.enum(uS),Fs="standard",_S=new Set(["display","heading","title"]),om={light:{display:300,heading:400,title:400,ui:400,button:400,body:400,strong:600},standard:{display:600,heading:500,title:500,ui:400,button:500,body:400,strong:600},bold:{display:700,heading:700,title:700,ui:400,button:600,body:400,strong:700}},Jw=Object.keys(om.standard).map(e=>`--site-weight-${e}`),eC="--site-leading-body",tC=["--site-leading-display","--site-leading-heading","--site-leading-title"];function Je(e,n){let s=[];for(let i=e;i<=n;i+=100)s.push(i);return s}var gS={"Source Sans 3":Je(200,900),"Space Grotesk":Je(300,700),Manrope:Je(200,800),"IBM Plex Sans":Je(100,700),Oswald:Je(200,700),"Bebas Neue":[400],"Playfair Display":Je(400,900),Lora:Je(400,700),"Cormorant Garamond":Je(300,700),"JetBrains Mono":Je(100,800),"IBM Plex Mono":[400,500,600,700],"DM Sans":Je(100,1e3)};function Po(e){return e.trim().replace(/\s+/g,"_").toLowerCase()}var hS=new Set(Object.entries(ht).flatMap(([e,n])=>[Po(e),Po(n.import)]));function wo(e){if(!(e in ht)&&!hS.has(Po(e)))return null;let n=on(e);return ht[n].download===!1?null:gS[n]??Je(100,900)}function am(e,n){return!n||n.length===0?e:n.reduce((s,i)=>Math.abs(i-e)<Math.abs(s-e)?i:s,n[0])}function nC(e,n){let s=om[e??Fs],i=n?.heading?wo(n.heading):null,o=n?.body?wo(n.body):null,a={};for(let c of Object.keys(s)){let r=_S.has(c)?i:o;a[`--site-weight-${c}`]=String(am(s[c],r))}return a}var SS=/^(zh|ja|ko)(?:[-_]|$)/i,fS=/^(ar|fa|hi|bn|ta|si|th|lo|km|my|vi)(?:[-_]|$)/i;function rm(e){return SS.test(e??"")?"dense":fS.test(e??"")?"tall":"default"}function bS(e){return rm(e)==="dense"?"1.75":"1.5"}var yS={default:["1.1","1.2","1.3"],dense:["1.2","1.3","1.4"]};function sC(e){let n=rm(e),s=bS(e),[i,o,a]=n==="tall"?[s,s,s]:yS[n];return{"--site-leading-display":i,"--site-leading-heading":o,"--site-leading-title":a}}function iC(e,n){let s=wo(e);return[...new Set(n.map(o=>am(o,s)))].sort((o,a)=>o-a).map(String)}var rn="/* <cms-builder:site-design-notes>",Kt="</cms-builder:site-design-notes> */",Co="palette-inputs: ",vo="type-inputs: ",At=an.string().min(1).max(40),Do=an.object({primarySource:an.enum(["user","derived"]),neutral:At.optional(),foreground:At.optional(),supporting:an.array(At).max(4).optional(),imagePalette:an.object({background:At.optional(),foreground:At.optional(),card:At.optional(),muted:At.optional(),border:At.optional()}).optional()}),xS=an.object({weightStyle:We}),ES=e=>e.replaceAll("*/","* /").replace(/\s+/g," ").trim();function RS(e){let n=e.lines.map(ES).filter(Boolean).map(s=>` ${s}`);return e.paletteInputs&&n.push(` ${Co}${JSON.stringify(e.paletteInputs).replaceAll("*/","* /")}`),e.typeInputs&&n.push(` ${vo}${JSON.stringify(e.typeInputs).replaceAll("*/","* /")}`),[rn,...n,` ${Kt}`].join(`
|
|
2
|
-
`)}function
|
|
1
|
+
import{z as t}from"zod";import{z as re}from"zod";import{z as j}from"zod";import{z as Rd}from"zod";var Q=Rd.uuidv7(),gk=Q,hk=Q,Sk=Q,fk=Q,bk=Q,yk=Q,xk=Q,k=Q,Xt=Q,Za=Q,Ae=Q,Ai=Q,I=Q,Ja=Q,$=Q,er=Q,it=Q,ls=Q,pt=Q,Ek=Q,Rk=Q,ps=Q,ot=Q,tr=Q,Ik=Q,Tk=Q,kk=Q,In=Q,Ak=Q,Pk=Q,wk=Q;var nr=Q,Pi=j.enum(["external_site_edit","page_template_create"]),Id=200,Mt=j.string().min(1).max(Id),Td=4e3,sr=j.enum(["succeeded","degraded","no_changes","failed"]),Tn=j.enum(["typecheck_unresolved","step_cap_reached","partial_apply_gave_up","patch_protected_dropped","preview_build_failed","preview_runtime_degraded","build_not_verified","external_blocked","cms_reconcile_failed","run_expired","sandbox_unavailable"]),kn=j.object({code:j.enum(["preexisting_placeholder_media"]),block_ids:j.array(j.string().min(1))}).strict(),kd=["sandbox_unavailable"];function Ok(e){return e!=null&&kd.includes(e)}var Ad=j.enum(["pending","delivered","failed"]),Pd=j.enum(["running","succeeded","degraded","no_changes","failed"]),Nk=j.object({site_id:k,external_run_id:Mt,external_thread_id:Mt,prompt:j.string().min(1).max(Td),thread_title:j.string().trim().min(1).max(200).optional()}).strict(),wi=j.enum(["added","modified","deleted"]),wd=j.enum(["landing_page","general_page","detail_page"]),Cd=j.enum(["header","footer","styles","layout"]),ir={block_id:j.string().min(1),type:j.string().min(1),change:wi},or={slug:j.string().min(1),title:j.string().min(1),page_type:wd,change:wi},vd=j.object({kind:Cd,change:wi}).strict(),ar={site_wide:j.array(vd),unclassified_count:j.number().int().nonnegative()},Dd=j.object(ir).strict(),Od=j.object({...or,sections:j.array(Dd)}).strict(),Nd=j.object({pages:j.array(Od),...ar}).strict(),jd=j.object({...ir,label:j.string().min(1)}).strict(),Ld=j.object({page_id:j.number().int().positive().nullable(),...or,sections:j.array(jd)}).strict(),rr=j.object({pages:j.array(Ld),...ar}).strict(),jk={pages:[],site_wide:[],unclassified_count:0},Lk=j.object({base_snapshot_id:I,target_snapshot_id:I}).strict(),Mk=j.object({data:Nd}).strict(),ds=j.object({id:nr,execution_scene:Pi.default("external_site_edit"),site_id:k,external_run_id:j.string().min(1).nullable(),external_thread_id:j.string().min(1).nullable(),status:Pd,outcome:sr.nullable(),degraded_reason:Tn.nullable(),vcp_run_id:$.nullable(),vcp_thread_id:it.nullable(),base_snapshot_id:I,snapshot_id:I.nullable(),preview_url:j.string().url().nullable(),summary:j.string().nullable(),error_code:j.string().nullable(),build_verified:j.boolean().nullable(),callback_status:Ad.nullable(),created_at:j.string().min(1),started_at:j.string().min(1).nullable(),finished_at:j.string().min(1).nullable(),changes:rr.nullable().default(null),advisories:j.array(kn).nullable().default(null)}).strict().superRefine((e,n)=>{e.execution_scene==="page_template_create"?((e.external_run_id===null!=(e.external_thread_id===null)||e.callback_status!==null)&&n.addIssue({code:"custom",message:"Page Template tasks require paired external identities and no callback"}),(!["running","succeeded","failed"].includes(e.status)||e.outcome!==null&&!["succeeded","failed"].includes(e.outcome)||e.degraded_reason!==null)&&n.addIssue({code:"custom",message:"Page Template tasks require strict whole-batch outcomes"}),e.changes!==null&&n.addIssue({code:"custom",message:"Page Template tasks never carry changes"}),e.advisories!==null&&e.status!=="succeeded"&&n.addIssue({code:"custom",message:"Page Template advisories belong to succeeded tasks only"})):e.advisories!==null?n.addIssue({code:"custom",message:"External edit tasks never carry advisories"}):(!e.external_run_id||!e.external_thread_id||!e.callback_status)&&n.addIssue({code:"custom",message:"External edit tasks require external identity and callback status"})}),Uk=j.object({task:ds}).strict(),Fk=j.object({task:ds}).strict(),Gk=j.object({task_id:nr,external_run_id:j.string().min(1),external_thread_id:j.string().min(1),site_id:k,vcp_run_id:$.nullable(),outcome:sr,degraded_reason:Tn.nullable(),snapshot_id:I.nullable(),preview_url:j.string().url().nullable(),summary:j.string().nullable(),error_code:j.string().nullable(),build_verified:j.boolean().nullable(),retryable:j.boolean(),finished_at:j.string().min(1),changes:rr.nullable().default(null)}).strict(),qk=j.object({received:j.literal(!0)}).strict();var Qe=re.string().min(1).max(191).refine(e=>{if(/[^\x20-\x7e\xa0-\xff]/.test(e)||e.startsWith(" ")||e.endsWith(" ")||new TextEncoder().encode(e).length>191)return!1;try{return new Headers({"x-template-id":e}).get("x-template-id")===e}catch{return!1}},{message:"template_id must round-trip through HTTP headers and fit a 255-byte base64url filename"}),An=re.string().min(1).refine(e=>e.startsWith("/")&&!e.startsWith("//")&&!/[?#\\\x00-\x20\x7f]/.test(e)&&!e.startsWith("/.vcp")&&!e.split("/").some(n=>{try{let s=decodeURIComponent(n);return s==="."||s===".."||/[/\\\x00-\x1f\x7f]/.test(s)||s.startsWith(".vcp")}catch{return!0}}),{message:"page_path must start with / and must not contain ? or #"});function cr(e){return/^\[\[\.\.\.[^\[\]]+\]\]$|^\[[^\[\]]+\]$/.test(e)}function us(e){let n=/^(?:src\/)?app\/\.vcp\/page-templates\/(.+)\/page\.tsx$/.exec(e);if(!n)return!1;let s=n[1].split("/"),i=s.some(cr),o=i?s[0]:s.pop(),a=i?s.slice(1):s;if(i&&a.length===0||!/^[A-Za-z0-9_-]{1,255}$/.test(o)||!An.safeParse(`/${a.join("/")}`).success||a.some(c=>c?c.includes("[")||c.includes("]")?!cr(c):/[\[\]()%]/.test(c)||c.startsWith("_")||c.startsWith("@"):!0))return!1;try{let c=atob(o.replace(/-/g,"+").replace(/_/g,"/")),r=Uint8Array.from(c,x=>x.charCodeAt(0)),m=new TextDecoder("utf-8",{fatal:!0}).decode(r);return Qe.safeParse(m).success&&btoa(String.fromCharCode(...new TextEncoder().encode(m))).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")===o}catch{return!1}}var mr=re.object({page_path:An,template_id:Qe,instruction:re.string().min(1).refine(e=>e.trim().length>0)}).strict(),lr=3;function pr(e){return e.replace(/\/+$/,"")||"/"}var Hk=re.object({external_run_id:Mt,external_thread_id:Mt,items:re.array(mr).min(1).max(lr)}).strict().transform(e=>({external_run_id:e.external_run_id,external_thread_id:e.external_thread_id,items:e.items.map(n=>({...n,page_path:pr(n.page_path)}))})).superRefine((e,n)=>{let s=new Set;e.items.forEach((i,o)=>{let a=JSON.stringify([i.page_path,i.template_id]);s.has(a)&&n.addIssue({code:"custom",path:["items",o],message:"Duplicate normalized page_path/template_id identity"}),s.add(a)})}),dr=re.object({items:re.array(mr).min(1).max(lr)}).strict().refine(e=>e.items.every(n=>n.page_path===pr(n.page_path))&&new Set(e.items.map(n=>JSON.stringify([n.page_path,n.template_id]))).size===e.items.length,{message:"Batch Manifest must contain unique normalized identities"}),ur=e=>[...new Set(e)],$k=re.object({page_path:An,template_id:Qe,exit_template_ids:re.array(Qe).default([]).transform(ur)}).strict().refine(e=>!e.exit_template_ids.includes(e.template_id),{path:["exit_template_ids"],message:"exit_template_ids must not contain the promoted template"}),Vk=re.object({page_path:An,template_ids:re.array(Qe).min(1).transform(ur)}).strict(),_r={ok:re.literal(!0),site_id:k,page_path:An,route_id:re.string().min(1),snapshot_id:I,advisories:re.array(kn).default([])},Md=ds.safeExtend({execution_scene:re.literal("page_template_create"),external_run_id:Mt,external_thread_id:Mt,callback_status:re.null(),status:re.enum(["running","succeeded","failed"]),outcome:re.enum(["succeeded","failed"]).nullable(),degraded_reason:re.null(),changes:re.null().default(null)}),Yk=re.object({task:Md}).strict(),Xk=re.object({..._r,promoted_template_id:Qe,deleted_template_ids:re.array(Qe),status:re.literal("promoted")}).strict(),Qk=re.object({..._r,deleted_template_ids:re.array(Qe),status:re.literal("cleaned")}).strict(),Zk=re.enum(["PAGE_TEMPLATE_REQUEST_INVALID","PAGE_TEMPLATE_PAGE_NOT_FOUND","PAGE_TEMPLATE_NOT_FOUND","PAGE_TEMPLATE_ALREADY_EXISTS","PAGE_TEMPLATE_ID_COLLISION","PAGE_TEMPLATE_MANAGED_SOURCE_INVALID","PAGE_TEMPLATE_SNAPSHOT_CONFLICT","PAGE_TEMPLATE_SOURCE_UNSUPPORTED","PAGE_TEMPLATE_GENERATION_FAILED","PAGE_TEMPLATE_PATCH_FAILED"]);import{z as _s}from"zod";var gr=_s.object({primary_products:_s.string().trim().min(1).max(1e3).optional(),current_markets:_s.string().trim().min(1).max(1e3).optional(),qualifications:_s.string().trim().min(1).max(1e3).optional()}).strict();function t0(e){return Object.values(e).some(n=>typeof n=="string"&&n.trim().length>0)}import{z as dt}from"zod";var hr={autoplay:dt.boolean().optional(),intervalMs:dt.number().int().min(5e3).max(15e3).optional(),loop:dt.boolean().optional()},gs=dt.discriminatedUnion("kind",[dt.object({kind:dt.literal("media-carousel"),presentation:dt.enum(["flat","angled"]).optional(),...hr}).strict(),dt.object({kind:dt.literal("category-carousel"),...hr}).strict()]);import{z as Pn}from"zod";var Ud=40,Ut=Pn.object({protocol:Pn.enum(["phone","form","download","route","external"]),ctaLabel:Pn.string().min(1).max(Ud),ctaTarget:Pn.string().min(1).max(200).optional(),requiresOwnerDetail:Pn.boolean().optional()});var Qt=["queued","preparing_source","building","artifact_ready","deploying","released","lock_failed","source_prepare_failed","build_failed","artifact_fetch_failed","artifact_validation_failed","deploy_failed","cleanup_failed"];function r0(e){let n=e.VCP_REDIS_URL??e.REDIS_URL;if(n){let s=new URL(n);return{url:n,host:s.hostname,port:s.port?Number(s.port):6379,password:s.password?decodeURIComponent(s.password):void 0}}return{host:e.VCP_REDIS_HOST??"127.0.0.1",port:Fd(e.VCP_REDIS_PORT,56379)}}function Fd(e,n){if(!e)return n;let s=Number(e);return Number.isInteger(s)&&s>0?s:n}import{z as ae}from"zod";var Gd=ae.enum(["component","page","shared"]),qd=ae.enum(["generation_failed","repair_exhausted","page_unusable","check_incomplete","design_missing","chrome_fallback","style_fallback","resume_exhausted","user_stopped","conflict"]),Sr=ae.object({kind:Gd,target_id:ae.string().min(1),page_id:ae.string().min(1).nullable(),reason:qd,repair_attempts:ae.number().int().nonnegative(),message:ae.string().min(1),filled:ae.boolean().optional()}).strict(),Wd=ae.enum(["complete","partial","omitted","check_incomplete","pending"]),Bd=ae.object({page_id:ae.string().min(1),slug:ae.string().min(1),title:ae.string().min(1),parent_page_id:ae.string().min(1).nullable(),result:Wd,attempts:ae.number().int().nonnegative(),omissions:ae.array(Sr)}).strict(),wn=ae.object({schema_version:ae.literal(1),sitemap_id:ae.string().min(1),confirmed_page_ids:ae.array(ae.string().min(1)).min(1),pages:ae.array(Bd),shared:ae.array(Sr),stopped_by_user:ae.boolean(),resume_count:ae.number().int().nonnegative(),home_replaced_by:ae.string().min(1).nullable(),updated_at:ae.string().min(1)}).strict(),fr=ae.object({type:ae.literal("workspace.generation_ledger"),ledger:wn,at:ae.string().min(1)}).strict();function l0(e){return e.pages.filter(n=>n.result==="complete"||n.result==="partial").length}function p0(e){return e.pages.filter(n=>n.result==="complete"||n.result==="partial"||n.omissions.some(s=>s.kind==="page")).length}import{z as F}from"zod";var Ci=F.enum(["text","url","document","image"]),vi=F.enum(["pending","ready","failed"]),Kd=F.enum(["pending","ready","failed"]),zd=F.enum(["product","price","contact","copy","audience","other"]),hs=F.object({fact:F.string().min(1).max(300),kind:zd,source_id:In,quote:F.string().min(1).max(500),trust:F.enum(["verbatim","ocr"]).default("verbatim")}),Hd=F.object({page_type:F.string().min(1).max(40),sections:F.array(F.string().min(1).max(40)).max(12)}),Ss=F.object({source_id:In,nav_structure:F.array(F.string().min(1).max(30)).max(12),page_patterns:F.array(Hd).max(10),tone:F.array(F.string().min(1).max(20)).max(8),screenshot_ref:F.string().optional()}),$d=F.object({source_id:In,type:Ci,status:vi,title:F.string().max(120).optional(),original_ref:F.string().min(1),source_metadata:F.record(F.string(),F.unknown()),error_code:F.string().optional(),submitted:F.boolean().optional()}),fs=F.object({topic:F.string().min(1).max(80),variants:F.array(F.object({value:F.string().min(1).max(300),source_id:In})).min(2)}),Vd=F.object({type:F.literal("text"),content:F.string().min(20).max(1e4),title:F.string().min(1).max(120).optional()}).strict(),Yd=F.object({type:F.literal("url"),url:F.string().url().max(2048),rights_ack:F.boolean().optional(),title:F.string().min(1).max(120).optional()}).strict(),g0=F.discriminatedUnion("type",[Vd,Yd]),h0=[".docx",".html",".md",".txt"],S0=["application/vnd.openxmlformats-officedocument.wordprocessingml.document","text/html","text/markdown","text/x-markdown","text/plain","application/octet-stream"],f0=10*1024*1024,b0=2,y0=F.object({consent_cross_border:F.union([F.literal(!0),F.literal("true")]),consent_text_version:F.string().min(1).max(120),title:F.string().min(1).max(120).optional()}).strict();function x0(e){return e===!0||e==="true"}var E0=[".png",".jpg",".jpeg",".webp"],R0=["image/png","image/jpeg","image/webp","application/octet-stream"],I0=8*1024*1024,T0=10,Xd=F.enum(["asset","reference"]),k0=F.object({image_role:Xd,title:F.string().min(1).max(120).optional()}).strict(),A0=F.object({version:F.literal(1),site_id:k,tenant_id:F.string().min(1),user_prompt:F.string(),status:Kd,sources:F.array($d).max(16),facts:F.array(hs).max(120),reference:Ss.optional(),conflicts:F.array(fs).max(20)}).superRefine((e,n)=>{let s=new Map(e.sources.map(i=>[i.source_id,i]));for(let[i,o]of e.facts.entries()){let a=s.get(o.source_id);(!a||a.type==="url")&&n.addIssue({code:"custom",path:["facts",i,"source_id"],message:"facts must reference a text/document/image source (never url)"})}if(e.reference){let i=s.get(e.reference.source_id),o=i?.type==="image"&&i.source_metadata.image_role==="reference";(!i||i.type!=="url"&&!o)&&n.addIssue({code:"custom",path:["reference","source_id"],message:"reference must point at a url source or reference image source"})}});function P0(e){for(let n of e.sources)if(n.type==="image"&&n.status==="ready"&&n.source_metadata?.image_role==="reference")return{source_id:n.source_id};return e.reference?.screenshot_ref?{source_id:e.reference.source_id}:null}import{z as L}from"zod";import{z as bs}from"zod";var ge=bs.object({routeId:bs.string().min(1),templateId:Qe.optional()}).strict(),K=bs.object({routeId:bs.string().min(1),effectiveTemplateId:Qe.optional()}).strict();function Di(e){return JSON.stringify([e.routeId,e.effectiveTemplateId??null])}function D0(e){let n;try{n=JSON.parse(e)}catch{return null}if(!Array.isArray(n)||n.length!==2)return null;let[s,i]=n,o=K.safeParse(i===null?{routeId:s}:{routeId:s,effectiveTemplateId:i});return o.success?o.data:null}var Qd=["design.md","DESIGN.md"],br=["components/site","src/components/site","lib/generated","src/lib/generated","public"],Zd=["components/system/not-found-content.tsx","src/components/system/not-found-content.tsx"],Jd=["app/globals.css","src/app/globals.css"],eu=[".cjs",".css",".cts",".html",".js",".json",".jsx",".md",".mdx",".mjs",".mts",".ts",".tsx",".txt",".yaml",".yml"],tu=new Set(eu),Oi="source-delete",yr=L.literal(Oi),Re=L.string().min(1).refine(Er,"Invalid site edit source path"),nu=L.string().min(1).refine(lu,"Invalid site edit source directory path"),M0=L.enum(["text","binary"]),ys=L.object({composition:K,path:Re,language:L.string().min(1).nullable(),sizeBytes:L.number().int().nonnegative(),contentHash:L.string().min(1).optional()}).strict(),su=L.discriminatedUnion("kind",[ys.extend({kind:L.literal("text"),language:L.string().min(1),readonly:L.boolean().default(!1)}),ys.extend({kind:L.literal("binary"),language:L.null(),mimeType:L.string().min(1).optional(),readonly:L.literal(!0)})]),xr=L.lazy(()=>L.discriminatedUnion("kind",[L.object({kind:L.literal("directory"),name:L.string().min(1),path:nu,children:L.array(xr)}),L.object({kind:L.literal("file"),name:L.string().min(1),path:Re,file:su}).superRefine((e,n)=>{e.path!==e.file.path&&n.addIssue({code:"custom",path:["file","path"],message:"file.path must match node path"})})])),iu=L.enum(["max-files","max-depth","max-total-bytes"]),ou=L.object({reasons:L.array(iu).min(1),maxFiles:L.number().int().positive(),maxDepth:L.number().int().positive(),maxTotalBytes:L.number().int().positive()}),U0=L.object({composition:K,nodes:L.array(xr),defaultPath:Re.optional(),totalFiles:L.number().int().nonnegative(),truncated:ou.optional()}).strict(),F0=L.object({composition:ge}).strict(),G0=L.object({path:Re,composition:ge}).strict(),au=ys.extend({kind:L.literal("text"),language:L.string().min(1),readonly:L.boolean().default(!1),content:L.string()}),ru=L.enum(["too-large","unsupported-mime","bytes-unavailable"]),cu=ys.extend({kind:L.literal("binary"),language:L.null(),readonly:L.literal(!0),mimeType:L.string().min(1),contentBase64:L.string().min(1).optional(),previewUnavailableReason:ru.optional()}),q0=L.discriminatedUnion("kind",[au,cu]),W0=L.object({key:L.string().min(1),composition:ge}).strict(),mu=L.object({startLine:L.number().int().positive(),startColumn:L.number().int().nonnegative(),endLine:L.number().int().positive(),endColumn:L.number().int().nonnegative()}),B0=L.object({key:L.string().min(1),composition:K,sourceFile:Re,componentName:L.string().min(1),openingElementRange:mu,structuralPath:L.string().min(1),textPreview:L.string().min(1).optional()}).strict();function Er(e){return!xs(e)&&!du(e)||gu(e)?!1:Li(e)||Tr(e)||Ir(e)||Rr(e)||br.some(n=>e===n||e.startsWith(`${n}/`))}function Ni(e){return Li(e)||tu.has(_u(e))}function lu(e){return!xs(e)&&!uu(e)||hu(e)?!1:e==="app"||e.startsWith("app/")||e==="src"||e==="src/app"||e.startsWith("src/app/")||br.some(n=>e===n||e.startsWith(`${n}/`)||n.startsWith(`${e}/`))}function pu(e){return Li(e)}function ji(e){return Er(e)?pu(e)?"design-document":Ir(e)?"route-entry":Tr(e)?"app-global-style":e.toLowerCase()==="lib/generated/media-assets.ts"||e.toLowerCase()==="src/lib/generated/media-assets.ts"?"generated-media-manifest":Rr(e)?"system-page":null:null}function Rr(e){return Zd.includes(e)}function K0(e){return ji(e)!==null}function Ir(e){return/^(?:src\/)?app\/(?:.*\/)?page\.[cm]?[jt]sx?$/.test(e.toLowerCase())}function du(e){return us(e)&&xs(e.replace("/.vcp/","/_vcp/"))}function uu(e){return/^(?:src\/)?app\/\.vcp(?:\/page-templates(?:\/.+)?)?$/i.test(e)?xs(e.replace("/.vcp","/_vcp")):!1}function Tr(e){return Jd.some(n=>n.toLowerCase()===e.toLowerCase())}function _u(e){let n=e.split("/").at(-1)??e,s=n.lastIndexOf(".");return s>0?n.slice(s).toLowerCase():""}function Li(e){return!e.includes("/")&&Qd.some(n=>n.toLowerCase()===e.toLowerCase())}function gu(e){let n=e.toLowerCase(),s=n.split("/"),o=(s.at(-1)??n).replace(/\.[^.]+$/,"");return/^(?:src\/)?app\/api(?:\/|$)/.test(n)||/^(?:src\/)?app\/(?:.*\/)?route\.[cm]?[jt]sx?$/.test(n)||/^(?:src\/)?app\/(?:.*\/)?(?:action|actions)\.[cm]?[jt]sx?$/.test(n)||/(^|\/)[^/]+\.server\.[cm]?[jt]sx?$/.test(n)||n==="lib/server"||n.startsWith("lib/server")||n==="src/lib/server"||n.startsWith("src/lib/server")||n==="lib/db"||n.startsWith("lib/db")||n==="src/lib/db"||n.startsWith("src/lib/db")||n==="lib/cms"||n.startsWith("lib/cms/")||n==="src/lib/cms"||n.startsWith("src/lib/cms/")?!0:o==="server"||o==="db"||o==="database"||o==="auth"||o==="secret"||o==="secrets"||o==="token"||o==="tokens"||o==="credential"||o==="credentials"||s.includes("server")||s.includes("secrets")}function hu(e){let n=e.toLowerCase();return/^(?:src\/)?app\/api(?:\/|$)/.test(n)||n==="lib/server"||n.startsWith("lib/server/")||n==="src/lib/server"||n.startsWith("src/lib/server/")||n==="lib/db"||n.startsWith("lib/db/")||n==="src/lib/db"||n.startsWith("src/lib/db/")||n==="lib/cms"||n.startsWith("lib/cms/")||n==="src/lib/cms"||n.startsWith("src/lib/cms/")}function xs(e){return!e||e.startsWith("/")||e.includes("\\")?!1:e.split("/").every(n=>!(n.length===0||n==="."||n===".."||n.startsWith(".")||n==="package.json"||n==="node_modules"||n==="recipes"||n.startsWith(".env")))}import{z as Pe}from"zod";var kr=Pe.string().min(1).max(320).refine(e=>!e.includes("..")&&/^(?:(?:src\/)?(?:app|pages|components|lib|hooks|utils|types)\/|next\.config\.)[\w./()[\]@-]+$/.test(e)),Su=Pe.union([kr,Pe.string().max(320).regex(/^\.next\/[\w./()[\]@-]+\.js$/).refine(e=>!e.includes(".."))]),Mi=Pe.object({code:Pe.enum(["NEXT_PAGE_CODE_ERROR","NEXT_CLIENT_COMPONENT_FUNCTION_PROP"]),message:Pe.string().min(1).max(2e3),messages:Pe.array(Pe.string().min(1).max(2e3)).max(3),source_paths:Pe.array(kr).max(8),components:Pe.array(Pe.string().max(80).regex(/^[\w.$-]+$/)).max(8),stack:Pe.array(Pe.object({file:Su,line:Pe.number().int().positive(),column:Pe.number().int().nonnegative(),function:Pe.string().max(80),generated:Pe.boolean()}).strict()).max(8)}).strict();function fu(e){return e==="NEXT_PAGE_CODE_ERROR"||e==="NEXT_CLIENT_COMPONENT_FUNCTION_PROP"}import{z as bu}from"zod";var Cn=["zh-CN","zh-HK","zh-TW","en-US","en-GB","ja-JP","ko-KR","es-ES","fr-FR","de-DE","pt-PT","ru-RU","ar-SA","id-ID","vi-VN","th-TH","it-IT","nl-NL","tr-TR","pl-PL","uk-UA","cs-CZ","sk-SK","hu-HU","ro-RO","el-GR","sv-SE","da-DK","fi-FI","hr-HR","lt-LT","lv-LV","et-EE","ga-IE","mt-MT","ka-GE","fa-IR","bn-BD","ta-IN","si-LK","ms-MY","fil-PH","my-MM","km-KH","lo-LA","mn-MN","kk-KZ"],yu=["en","ja","es","fr","de","ko","pt","pt-BR","it","ru","ar","hi","id","vi","th","tr","nl","pl","uk","sv","da","fi","no","cs","el","hu","ro","he","ms","fil","bn","ta","ca","sk","hr","bg","lt","lv","et","fa","sw","sr","is"],xu=[...Cn,...yu],Eu=new Set(["ar","fa","he"]),Y0=[{code:"zh-CN",label:"\u7B80\u4F53\u4E2D\u6587",englishName:"Chinese (Simplified)"},{code:"zh-HK",label:"\u7E41\u9AD4\u4E2D\u6587\uFF08\u9999\u6E2F\uFF09",englishName:"Chinese (Traditional, Hong Kong)"},{code:"zh-TW",label:"\u7E41\u9AD4\u4E2D\u6587\uFF08\u53F0\u7063\uFF09",englishName:"Chinese (Traditional, Taiwan)"},{code:"en-US",label:"English (US)",englishName:"English (United States)",common:!0},{code:"en-GB",label:"English (UK)",englishName:"English (United Kingdom)",common:!0},{code:"ja-JP",label:"\u65E5\u672C\u8A9E",englishName:"Japanese"},{code:"ko-KR",label:"\uD55C\uAD6D\uC5B4",englishName:"Korean"},{code:"es-ES",label:"Espa\xF1ol",englishName:"Spanish"},{code:"fr-FR",label:"Fran\xE7ais",englishName:"French"},{code:"de-DE",label:"Deutsch",englishName:"German"},{code:"pt-PT",label:"Portugu\xEAs",englishName:"Portuguese"},{code:"ru-RU",label:"\u0420\u0443\u0441\u0441\u043A\u0438\u0439",englishName:"Russian"},{code:"ar-SA",label:"\u0627\u0644\u0639\u0631\u0628\u064A\u0629",englishName:"Arabic"},{code:"id-ID",label:"Bahasa Indonesia",englishName:"Indonesian"},{code:"vi-VN",label:"Ti\u1EBFng Vi\u1EC7t",englishName:"Vietnamese"},{code:"th-TH",label:"\u0E44\u0E17\u0E22",englishName:"Thai"},{code:"it-IT",label:"Italiano",englishName:"Italian"},{code:"nl-NL",label:"Nederlands",englishName:"Dutch"},{code:"tr-TR",label:"T\xFCrk\xE7e",englishName:"Turkish"},{code:"pl-PL",label:"Polski",englishName:"Polish"},{code:"uk-UA",label:"\u0423\u043A\u0440\u0430\u0457\u043D\u0441\u044C\u043A\u0430",englishName:"Ukrainian"},{code:"cs-CZ",label:"\u010Ce\u0161tina",englishName:"Czech"},{code:"sk-SK",label:"Sloven\u010Dina",englishName:"Slovak"},{code:"hu-HU",label:"Magyar",englishName:"Hungarian"},{code:"ro-RO",label:"Rom\xE2n\u0103",englishName:"Romanian"},{code:"el-GR",label:"\u0395\u03BB\u03BB\u03B7\u03BD\u03B9\u03BA\u03AC",englishName:"Greek"},{code:"sv-SE",label:"Svenska",englishName:"Swedish"},{code:"da-DK",label:"Dansk",englishName:"Danish"},{code:"fi-FI",label:"Suomi",englishName:"Finnish"},{code:"hr-HR",label:"Hrvatski",englishName:"Croatian"},{code:"lt-LT",label:"Lietuvi\u0173",englishName:"Lithuanian"},{code:"lv-LV",label:"Latvie\u0161u",englishName:"Latvian"},{code:"et-EE",label:"Eesti",englishName:"Estonian"},{code:"ga-IE",label:"Gaeilge",englishName:"Irish"},{code:"mt-MT",label:"Malti",englishName:"Maltese"},{code:"ka-GE",label:"\u10E5\u10D0\u10E0\u10D7\u10E3\u10DA\u10D8",englishName:"Georgian"},{code:"fa-IR",label:"\u0641\u0627\u0631\u0633\u06CC",englishName:"Persian"},{code:"bn-BD",label:"\u09AC\u09BE\u0982\u09B2\u09BE",englishName:"Bengali"},{code:"ta-IN",label:"\u0BA4\u0BAE\u0BBF\u0BB4\u0BCD",englishName:"Tamil"},{code:"si-LK",label:"\u0DC3\u0DD2\u0D82\u0DC4\u0DBD",englishName:"Sinhala"},{code:"ms-MY",label:"Bahasa Melayu",englishName:"Malay"},{code:"fil-PH",label:"Filipino",englishName:"Filipino"},{code:"my-MM",label:"\u1019\u103C\u1014\u103A\u1019\u102C",englishName:"Burmese"},{code:"km-KH",label:"\u1797\u17B6\u179F\u17B6\u1781\u17D2\u1798\u17C2\u179A",englishName:"Khmer"},{code:"lo-LA",label:"\u0EA5\u0EB2\u0EA7",englishName:"Lao"},{code:"mn-MN",label:"\u041C\u043E\u043D\u0433\u043E\u043B",englishName:"Mongolian"},{code:"kk-KZ",label:"\u049A\u0430\u0437\u0430\u049B",englishName:"Kazakh"}],Ru={en:"en-US",ja:"ja-JP",es:"es-ES",fr:"fr-FR",de:"de-DE",ko:"ko-KR",pt:"pt-PT",it:"it-IT",ru:"ru-RU",ar:"ar-SA",id:"id-ID",vi:"vi-VN",th:"th-TH",tr:"tr-TR",nl:"nl-NL",pl:"pl-PL",uk:"uk-UA",sv:"sv-SE",da:"da-DK",fi:"fi-FI",cs:"cs-CZ",el:"el-GR",hu:"hu-HU",ro:"ro-RO",ms:"ms-MY",fil:"fil-PH",bn:"bn-BD",ta:"ta-IN",sk:"sk-SK",hr:"hr-HR",lt:"lt-LT",lv:"lv-LV",et:"et-EE",fa:"fa-IR"},Iu=new Set(Cn);function Ar(e){return Iu.has(e)?e:Ru[e]}var Tu="en";function X0(e){let n=e.toLowerCase().split("-",1)[0]??"";return Eu.has(n)?"rtl":"ltr"}var ku={cmn:"zh-CN",eng:"en",jpn:"ja",spa:"es",fra:"fr",deu:"de",kor:"ko",por:"pt",ita:"it",rus:"ru",arb:"ar",ara:"ar",hin:"hi",ind:"id",vie:"vi",tha:"th",tur:"tr",nld:"nl",pol:"pl",ukr:"uk",swe:"sv",dan:"da",fin:"fi",nob:"no",nor:"no",ces:"cs",ell:"el",hun:"hu",ron:"ro",heb:"he",msa:"ms",zsm:"ms",tgl:"fil",ben:"bn",tam:"ta",cat:"ca",slk:"sk",hrv:"hr",bul:"bg",lit:"lt",lav:"lv",est:"et",pes:"fa",fas:"fa",swh:"sw",swa:"sw",srp:"sr",isl:"is"};function Q0(e){return ku[e]??Tu}var Au=["zh-CN","zh-HK","zh-TW","ja-JP","ja","ko-KR","ko","ru-RU","ru","uk-UA","uk","bg","sr","mn-MN","kk-KZ","ar-SA","ar","fa-IR","fa","he","hi","th-TH","th","el-GR","el","ka-GE","bn-BD","bn","ta-IN","ta","si-LK","my-MM","km-KH","lo-LA"],Pu=new Set(Au);function Z0(e){return Pu.has(e)}var Ie=bu.enum(xu);import{z as wu}from"zod";var Es=wu.string().uuid();import{z as S}from"zod";import{z as ee}from"zod";var Rt=ee.string().trim().min(1).max(128),Zt=ee.string().trim().min(1).max(500),Cu=["\u4EA7\u54C1","\u90E8\u4EF6/\u8017\u6750","\u5E94\u7528\u65B9\u6848","\u5B9A\u5236/OEM","\u670D\u52A1","\u8D44\u8D28/\u80FD\u529B"],Rs=ee.enum(Cu),vn=ee.object({id:Rt,keyword:ee.string().trim().min(1).max(255),business_ids:ee.array(Rt).min(1),category:Rs,selling_points:ee.string().trim().max(2e3),intent:Zt,semantic_group:Rt,monthly_volume:ee.number().int().min(1),keyword_difficulty:ee.number().min(0).max(100).nullable(),variants:ee.array(ee.string().trim().min(1).max(255)),source:ee.literal("semrush"),source_evidence:ee.array(Zt).min(1)}).strict().superRefine((e,n)=>{new Set(e.business_ids).size!==e.business_ids.length&&n.addIssue({code:"custom",path:["business_ids"],message:"\u4E1A\u52A1 ID \u4E0D\u80FD\u91CD\u590D"})}),Ui=ee.object({schema_version:ee.literal(1),snapshot_id:Rt,dependency_hash:ee.string().regex(/^[a-f0-9]{64}$/),language:ee.string().trim().min(2).max(35),database:ee.string().regex(/^[a-z]{2}$/),generated_at:ee.string().datetime({offset:!0}),entries:ee.array(vn),candidates:ee.array(vn),search_result_ids:ee.array(Rt).optional()}).strict().superRefine((e,n)=>{for(let s of["entries","candidates"]){let i=e[s];(new Set(i.map(o=>o.id)).size!==i.length||new Set(i.map(o=>o.keyword.normalize("NFKC").trim().toLowerCase())).size!==i.length)&&n.addIssue({code:"custom",path:[s],message:"\u5173\u952E\u8BCD\u4E0D\u80FD\u91CD\u590D"})}}),vu=ee.object({entry_id:Rt,category:Rs,selling_points:ee.string().trim().max(2e3)}).strict(),Is=ee.object({snapshot_id:Rt,entry_ids:ee.array(Rt),entry_edits:ee.array(vu).optional()}).strict().superRefine((e,n)=>{new Set(e.entry_ids).size!==e.entry_ids.length&&n.addIssue({code:"custom",path:["entry_ids"],message:"\u5173\u952E\u8BCD\u4E0D\u80FD\u91CD\u590D"}),new Set((e.entry_edits??[]).map(i=>i.entry_id)).size!==(e.entry_edits??[]).length&&n.addIssue({code:"custom",path:["entry_edits"],message:"\u5173\u952E\u8BCD\u7F16\u8F91\u4E0D\u80FD\u91CD\u590D"});let s=new Set(e.entry_ids);(e.entry_edits??[]).forEach((i,o)=>{s.has(i.entry_id)||n.addIssue({code:"custom",path:["entry_edits",o,"entry_id"],message:"\u53EA\u80FD\u7F16\u8F91\u5DF2\u9009\u5173\u952E\u8BCD"})})}),sA=ee.object({expected_revision:ee.number().int().nonnegative(),business_subject:ee.string().trim().min(1).max(255)}).strict(),Pr=ee.object({points:ee.array(Zt).length(3),comparison:ee.array(ee.object({dimension:Zt,recommended:Zt,alternative:Zt}).strict()).min(1).max(4)}).strict();var at=S.string().trim().min(1).max(128),Ft=S.string().trim().min(1).max(200),Ze=S.string().trim().min(1).max(2e3),Fi=S.string().trim().max(200),Ts=S.string().regex(/^[a-f0-9]{64}$/),Gi=S.enum(["en-US","zh-CN","zh-TW","fr-FR","de-DE","es-ES","ja-JP","ko-KR"]),Jt=["market","persona","product","brand","competition","structure","language","keywords","risk"],Ne=Jt.length,Du=["keywords"],Dn=Jt.filter(e=>!Du.includes(e)),ks=Dn.length,As=S.enum(Jt);function cA(e){return Dn.some(n=>n===e)}var Ps=As,wr=["recommended","conservative","focused"],Cr=S.enum(wr),On=S.union([Cr,S.literal("confirmed")]),ws=S.enum(["single_country","regional_combination","multi_market"]),Cs=S.object({code:S.string().trim().regex(/^[A-Z]{2}$/),name_zh:Ft,name_en:Ft,region:Ft}).strict(),Ou=S.object({id:at,name:S.string().trim().min(1).max(255),category:Rs}).strict(),vs=S.array(Ou).min(1).superRefine((e,n)=>{new Set(e.map(s=>s.id)).size!==e.length&&n.addIssue({code:"custom",message:"Promoted business IDs must be unique."})}),vr=S.object({lead:S.string().trim().min(1).max(500),title:Ft,columns:S.array(S.string().trim().min(1).max(80)).min(1).max(8),rows:S.array(S.array(S.string().trim().max(500)).min(1).max(8)).max(100)}).strict().superRefine((e,n)=>{e.rows.forEach((s,i)=>{s.length!==e.columns.length&&n.addIssue({code:"custom",path:["rows",i],message:"Each Step5 plan row must match the column count."})})}),Nu=S.object({id:Cr,presentation:Pr.nullish(),sections:S.array(S.object({id:S.string().trim().min(1).max(128),label:S.string().trim().min(1).max(200)}).strict()).max(30).optional(),label:Ft,note:Ze,impact:S.string().trim().max(500).nullish(),set_value:S.string().trim().max(500).nullish(),site_locale:Ie.nullish(),market_type:ws.nullish(),markets:S.array(Cs).max(32).optional(),promoted_businesses:vs.optional(),plan:vr.nullish()}).loose(),ju=S.object({goal:Ze,issue:Ze,criteria:S.array(Ze).min(1).max(12),resources:S.array(Ze).min(1).max(12),risks:S.array(Ze).min(1).max(12),execution:S.object({standard:S.array(Ze).min(1).max(12),acceptance:S.array(Ze).min(1).max(12),downstream:S.array(Ze).min(1).max(12)}).strict()}).strict(),Lu=S.object({source_type:S.enum(["step2","step3"]),source_id:at,field_path:S.string().trim().max(300).nullish()}).strict(),Mu=S.enum(["ok","degraded"]),qi=S.object({key:Ps,position:S.number().int().min(1).max(Ne),category:Ft,title:Ft,summary:Ze,rationale:Ze,parameter:S.string().trim().max(500).nullish(),options:S.array(Nu).max(3),keyword_library:Ui.nullish(),plan:vr.nullish(),structure_detail:ju.nullish(),note_tips:S.array(S.string().trim().min(1).max(200)).max(6),note_placeholder:S.string().trim().min(1).max(300),evidence_refs:S.array(Lu).min(1).max(8),generation_status:Mu.optional()}).loose().superRefine((e,n)=>{let s=new Map,i=new Map,o=Jt.indexOf(e.key)+1;o>0&&e.position!==o&&n.addIssue({code:"custom",path:["position"],message:`Step5 strategy ${e.key} uses an invalid position.`}),e.key!=="keywords"&&e.keyword_library&&n.addIssue({code:"custom",path:["keyword_library"],message:"Only the keywords card can carry an enterprise keyword library."}),e.options.length!==(e.key==="keywords"?0:3)&&n.addIssue({code:"custom",path:["options"],message:"Keywords use no options; ordinary cards require three options."}),e.options.forEach((a,c)=>{a.id!==wr[c]&&n.addIssue({code:"custom",path:["options",c,"id"],message:"Step5 strategy options must use the canonical order."}),e.key==="product"&&!a.promoted_businesses&&n.addIssue({code:"custom",path:["options",c,"promoted_businesses"],message:"Product options require the ordered promoted businesses."}),e.key!=="product"&&a.promoted_businesses&&n.addIssue({code:"custom",path:["options",c,"promoted_businesses"],message:"Promoted businesses are only valid for product options."});for(let[r,m]of(a.promoted_businesses??[]).entries()){let x=s.get(m.id);x&&(x.name!==m.name||x.category!==m.category)?n.addIssue({code:"custom",path:["options",c,"promoted_businesses",r],message:"A promoted business ID must keep the same identity."}):s.set(m.id,m);let _=`${m.category}\0${m.name.normalize("NFKC").toLocaleLowerCase()}`,w=i.get(_);w&&w!==m.id?n.addIssue({code:"custom",path:["options",c,"promoted_businesses",r],message:"A promoted business must keep its stable ID."}):i.set(_,m.id)}}),e.structure_detail&&e.key!=="structure"&&n.addIssue({code:"custom",path:["structure_detail"],message:"Structure detail is only valid for the structure item."})}),Uu=S.object({item_key:As,selected_option_id:On,note:Fi,keyword_selection:Is.optional()}).strict().superRefine((e,n)=>{(e.item_key==="keywords"?e.selected_option_id!=="confirmed"||e.note!==""||!e.keyword_selection:e.selected_option_id==="confirmed"||e.keyword_selection!==void 0)&&n.addIssue({code:"custom",message:"\u666E\u901A\u5361\u4EC5\u63A5\u53D7\u65B9\u6848\u4E0E\u5907\u6CE8\uFF1B\u4F01\u4E1A\u5173\u952E\u8BCD\u5E93\u4EC5\u63A5\u53D7\u5DF2\u751F\u6210\u5FEB\u7167\u4E2D\u7684\u5173\u952E\u8BCD ID"})}),Wi=S.object({item_key:As,selected_option_id:On,note:Fi,keyword_selection:Is.optional(),keyword_library:Ui.optional(),market_type:ws.nullish(),markets:S.array(Cs).max(32).optional(),promoted_businesses:vs.optional(),selected_value:S.unknown().nullable(),accepted_at:S.string().datetime({offset:!0})}).loose().superRefine((e,n)=>{e.item_key==="product"&&!e.promoted_businesses&&n.addIssue({code:"custom",path:["promoted_businesses"],message:"Product decisions require the ordered promoted businesses."}),e.item_key!=="product"&&e.promoted_businesses&&n.addIssue({code:"custom",path:["promoted_businesses"],message:"Promoted businesses are only valid for product decisions."})}),Fu=S.enum(["running","succeeded","failed"]),Gu=S.object({schema_version:S.literal(1),source_job_id:at,site_id:at,output_locale:Gi.optional(),items:S.array(qi).length(Ne),decisions:S.array(Wi).min(ks).max(Ne)}).loose(),qu=S.object({strategy_version_id:at,site_id:at,source_job_id:at,output_locale:Gi.optional(),version:S.number().int().positive(),checksum:Ts,snapshot:Gu,committed_at:S.string().datetime({offset:!0})}).loose(),Dr=S.object({job_id:at,site_id:at,output_locale:Gi.optional(),status:Fu,keyword_library_needs_update:S.boolean().optional(),revision:S.number().int().nonnegative(),items:S.array(qi).max(Ne),decisions:S.array(Wi).max(Ne),output_checksum:Ts.nullish(),error_code:S.string().trim().max(64).nullish(),error_message:S.string().trim().max(500).nullish(),committed_version:qu.nullish()}).loose().superRefine((e,n)=>{let s=e.items.map(o=>o.key);new Set(s).size!==s.length&&n.addIssue({code:"custom",path:["items"],message:"Step5 job items must have unique keys."});let i=e.decisions.map(o=>o.item_key);new Set(i).size!==i.length&&n.addIssue({code:"custom",path:["decisions"],message:"Step5 job decisions must have unique item keys."})}),mA=S.object({force_refresh:S.boolean().optional().default(!1)}).strict(),lA=Dr.extend({cached:S.boolean()}).strict(),pA=S.object({expected_revision:S.number().int().nonnegative()}).strict(),dA=S.object({expected_revision:S.number().int().nonnegative(),selected_option_id:On,note:Fi,keyword_selection:Is.optional()}).strict().superRefine((e,n)=>{(e.selected_option_id==="confirmed"?!e.keyword_selection||e.note!=="":e.keyword_selection)&&n.addIssue({code:"custom",message:"\u4F01\u4E1A\u5173\u952E\u8BCD\u53EA\u63A5\u53D7\u5019\u9009 ID \u4E0E\u7C7B\u522B/\u5356\u70B9\u7F16\u8F91\uFF1B\u666E\u901A\u7B56\u7565\u53EA\u63A5\u53D7\u65B9\u6848\u548C\u5907\u6CE8"})}),uA=S.object({revision:S.number().int().positive(),decision:Wi}).strict(),_A=S.object({idempotency_key:S.string().trim().min(8).max(128),expected_revision:S.number().int().nonnegative(),decisions:S.array(Uu).min(ks).max(Ne)}).strict().superRefine((e,n)=>{let s=e.decisions.map(i=>i.item_key);new Set(s).size!==s.length&&n.addIssue({code:"custom",path:["decisions"],message:"Step5 commit decisions must use unique strategy keys."}),Dn.forEach(i=>{s.includes(i)||n.addIssue({code:"custom",path:["decisions"],message:`Step5 commit is missing ${i}.`})})}),gA=S.object({strategy_version_id:at,version:S.number().int().positive(),checksum:Ts,next_path:S.string().trim().min(1).max(500)}).strict(),Wu=Dr.extend({completed:S.number().int().min(0).max(Ne),total:S.literal(Ne)}).loose(),Bu=["snapshot","strategy_item_start","strategy_item_done","strategy_items_invalidated","strategy_generation_done","failed"];function hA(e){return typeof e=="string"&&Bu.includes(e)}var SA=S.discriminatedUnion("event",[S.object({id:S.number().int().nonnegative(),event:S.literal("snapshot"),data:Wu}).strict(),S.object({id:S.number().int().positive(),event:S.literal("strategy_item_start"),data:S.object({key:As,position:S.number().int().min(1).max(Ne)}).strict()}).strict(),S.object({id:S.number().int().positive(),event:S.literal("strategy_item_done"),data:S.object({item:qi}).strict()}).strict(),S.object({id:S.number().int().positive(),event:S.literal("strategy_items_invalidated"),data:S.object({after_position:S.number().int().min(0).max(Ne)}).strict()}).strict(),S.object({id:S.number().int().positive(),event:S.literal("strategy_generation_done"),data:S.object({item_count:S.literal(Ne),schema_version:S.literal(1),checksum:Ts}).strict()}).strict(),S.object({id:S.number().int().positive(),event:S.literal("failed"),data:S.object({code:S.string().trim().min(1).max(64),message:S.string().trim().min(1).max(500),retryable:S.boolean(),item_key:Ps.optional()}).loose()}).loose()]);import{z as Ku}from"zod";var Je=Ku.string().regex(/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[A-Za-z-][0-9A-Za-z-]*)(?:\.(?:0|[1-9]\d*|\d*[A-Za-z-][0-9A-Za-z-]*))*))?(?:\+([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?$/);function yA(e,n){let s=Je.safeParse(e),i=Je.safeParse(n);if(!s.success||!i.success)return null;let o=Or(s.data),a=Or(i.data);for(let r=0;r<3;r+=1){let m=Nr(o.release[r],a.release[r]);if(m!==0)return m}if(!o.prerelease&&!a.prerelease)return 0;if(!o.prerelease)return 1;if(!a.prerelease)return-1;let c=Math.max(o.prerelease.length,a.prerelease.length);for(let r=0;r<c;r+=1){let m=o.prerelease[r],x=a.prerelease[r];if(m===void 0)return-1;if(x===void 0)return 1;if(m===x)continue;let _=/^\d+$/u.test(m),w=/^\d+$/u.test(x);return _&&w?Nr(BigInt(m),BigInt(x)):_?-1:w?1:zu(m,x)}return 0}function Or(e){let n=e.indexOf("+"),s=n===-1?e:e.slice(0,n),i=s.indexOf("-"),o=i===-1?s:s.slice(0,i),a=i===-1?void 0:s.slice(i+1),[c,r,m]=o.split(".");return{release:[BigInt(c),BigInt(r),BigInt(m)],...a?{prerelease:a.split(".")}:{}}}function Nr(e,n){return e<n?-1:e>n?1:0}function zu(e,n){return e<n?-1:e>n?1:0}import{z as Z}from"zod";import{z as ye}from"zod";var Bi=64,Hu=512*1024,Ki=4*1024*1024,$u=/^(?!\/)(?!.*\\)(?!.*(?:^|\/)\.\.(?:\/|$))(?!.*\/\/).+/;function Vu(e){return $u.test(e)}var jr=ye.string().min(1).refine(Vu,{message:"Materialization pathTemplate must be a safe relative path."}),Yu=ye.object({pathTemplate:jr,content:ye.string(),role:ye.string().min(1).optional()}).strict(),Xu=ye.union([ye.object({kind:ye.literal("default")}).strict(),ye.object({kind:ye.literal("named"),name:ye.string().min(1)}).strict()]),Qu=ye.object({pathTemplate:jr,export:Xu}).strict(),Zu=ye.array(ye.never()).optional(),Gt=ye.object({instanceBaseName:ye.string().min(1),files:ye.array(Yu).min(1).max(Bi),entry:Qu,dataRequirements:Zu,projectDependencies:ye.record(ye.string().min(1),ye.string().min(1)).optional()}).strict().superRefine((e,n)=>{let s=new Set,i=e.entry.pathTemplate,o=0;for(let[a,c]of e.files.entries()){s.has(c.pathTemplate)&&n.addIssue({code:"custom",path:["files",a,"pathTemplate"],message:`Duplicate materialization pathTemplate: ${c.pathTemplate}`}),s.add(c.pathTemplate);let r=new TextEncoder().encode(c.content).length;r>Hu&&n.addIssue({code:"custom",path:["files",a,"content"],message:"Materialization file content exceeds the per-file byte limit."}),o+=r}s.has(i)||n.addIssue({code:"custom",path:["entry","pathTemplate"],message:"Materialization entry pathTemplate must match a file."}),o>Ki&&n.addIssue({code:"custom",path:["files"],message:"Materialization exceeds the total content byte limit."})});var Lr="insertNewComponent",kA={categoryGroupMissing:"DESIGNER_COMPONENT_CATEGORY_GROUP_MISSING",unavailable:"DESIGNER_COMPONENT_LIBRARY_UNAVAILABLE",timeout:"DESIGNER_COMPONENT_LIBRARY_TIMEOUT",invalidResponse:"DESIGNER_COMPONENT_LIBRARY_INVALID_RESPONSE",incompatibleResource:"DESIGNER_COMPONENT_RESOURCE_INCOMPATIBLE"},zi=Z.number().int().positive().refine(Number.isSafeInteger,"Must be a safe positive integer"),Mr=Z.lazy(()=>Z.object({id:Z.string().uuid(),key:Z.string().min(1),name:Z.string(),children:Z.array(Mr)}).strict()),Ur=Z.object({category_group_key:Z.literal(Lr),categories:Z.array(Mr)}).strict(),Ju=Z.object({resource_id:Z.string().min(1),name:Z.string(),description:Z.string().nullable(),thumbnail_url:Z.string().nullable(),resolved_version:zi,category_id:Z.string().uuid().nullable()}).strict(),Fr=Z.object({category_group_key:Z.literal(Lr),items:Z.array(Ju),next_cursor:Z.string().min(1).nullable()}).strict(),AA=Z.object({resource_id:Z.string().min(1),resolved_version:zi,anchor_block_id:Z.string().min(1),placement:Z.enum(["before","after"])}).strict(),PA=Z.object({status:Z.literal("mock_acknowledged")}).strict(),wA=Z.object({category_id:Z.string().uuid().optional(),include_descendants:Z.enum(["true","false"]).optional().transform(e=>e==="true"),limit:Z.coerce.number().int().min(1).max(100).optional().default(20),cursor:Z.string().min(1).optional()}).strict().superRefine((e,n)=>{e.include_descendants&&!e.category_id&&n.addIssue({code:"custom",message:"include_descendants requires category_id"})}),qt=zi,CA=Z.object({version:qt}).strict(),Gr=Z.object({resource_id:Z.string().min(1),resolved_version:qt,revision_id:Z.string().uuid().optional(),digest_sha256:Z.string().regex(/^[a-f0-9]{64}$/),materialization:Gt}).strict();import{z as R}from"zod";import{z as h}from"zod";var Br="/",Kr=255,e_=2048,t_=5e3,n_=64;function zr(e){if(!e.startsWith("/")||e.includes("//")||/[?#\\\s\u0000-\u001f\u007f]/u.test(e))return!1;try{let n=decodeURIComponent(e);return n.includes("//")||/[?#\\\s\u0000-\u001f\u007f]/u.test(n)||n.split("/").length!==e.split("/").length||/%25/iu.test(e)?!1:n.split("/").every(s=>![".",".."].includes(s))}catch{return!1}}var Wt=h.string().min(1).max(Kr).refine(zr,"url_path must be a safe site-relative path"),Vi=h.string().min(1).max(e_).refine(zr,"url must be a safe site-relative path"),Yi=h.string().max(Kr),en=h.preprocess(e=>e===0?!1:e===1?!0:e,h.boolean()),Nn=h.union([h.url(),Vi]),Xi=h.enum(["landing_page","general_page","detail_page"]),Qi=h.enum([...Xi.options,"list_page","category_page","tag_page","author_page","search_page","date_page"]);function NA(e){return e.vcp_managed&&e.url!==null&&Xi.safeParse(e.page_type).success&&Wt.safeParse(e.url_path).success}function qr(e){return e.includes("{")||e.includes("}")}function jA(e){if(!qr(e.url_path))return s_(e.url_path);if(e.url===null)return null;let n=/^[a-z][a-z0-9+.-]*:\/\//iu.test(e.url)?i_(e.url):e.url;if(n===null||qr(n))return null;let s=Vi.safeParse(n);return s.success?s.data:null}function s_(e){let n=Wt.safeParse(e);return n.success?n.data:null}function i_(e){try{return new URL(e).pathname}catch{return null}}var Hr=h.lazy(()=>h.object({cms_page_id:h.number().int().positive(),title:h.string().trim().min(1).max(255),url_path:Yi,url:Nn.nullable(),page_type:Qi,vcp_managed:en,has_vcp_render_source:en.optional(),children:h.array(Hr)}).strict()),o_=h.object({group_id:h.string().min(1),title:h.string().trim().min(1).max(255),collection_slug:h.string(),pages:h.array(Hr)}).strict(),Wr=h.object({groups:h.array(o_)}).strict(),$r=h.lazy(()=>h.object({id:h.number().int().positive(),title:h.string().trim().min(1).max(120),url_path:Yi,parent_id:h.number().int().nonnegative(),group_type:h.string().min(1),page_type:Qi,plugin_id:h.number().int().nonnegative(),is_default:en,is_published:en,url:Nn.nullable(),vcp_managed:en,has_vcp_render_source:en.optional(),children:h.array($r)})),a_=h.object({plugin_id:h.number().int().nonnegative(),slug:h.string(),group_name:h.string().trim().min(1).max(255),pages:h.array($r)}).passthrough(),r_=h.array(a_);function Vr(e){return{cms_page_id:e.id,title:e.title,url_path:e.url_path,url:e.url,page_type:e.page_type,vcp_managed:e.vcp_managed,has_vcp_render_source:e.has_vcp_render_source??!1,children:e.children.map(n=>Vr(n))}}function LA(e){if(!c_(e))return null;let n=Wr.safeParse(e);if(n.success)return n.data;let s=r_.safeParse(e);if(!s.success)return null;let i=Wr.safeParse({groups:s.data.map(o=>({group_id:String(o.plugin_id),title:o.group_name,collection_slug:o.slug,pages:o.pages.map(Vr)}))});return i.success?i.data:null}function c_(e){let n=Array.isArray(e)?e:Hi(e)&&Array.isArray(e.groups)?e.groups:[],s=[];for(let o of n)if(!(!Hi(o)||!Array.isArray(o.pages)))for(let a of o.pages)s.push({node:a,depth:1});let i=0;for(;s.length>0;){let o=s.pop();if(i+=1,i>t_||o.depth>n_)return!1;if(!(!Hi(o.node)||!Array.isArray(o.node.children)))for(let a of o.node.children)s.push({node:a,depth:o.depth+1})}return!0}function Hi(e){return typeof e=="object"&&e!==null}var m_=h.enum(["invalid_url_path","missing_url","not_vcp_managed","unsupported_page_type","page_not_generated"]),l_=h.enum(["home_page","invalid_url_path","not_selectable","not_vcp_managed","page_has_children","last_selectable_page","cms_unbound","unsupported_page_type"]),Yr=h.lazy(()=>h.object({cms_page_id:h.number().int().positive().nullable(),title:h.string().trim().min(1).max(255),url_path:Yi,preview_url_path:Vi.nullable(),url:Nn.nullable(),page_type:Qi,vcp_managed:h.boolean(),selectable:h.boolean(),disabled_reason:m_.nullable(),can_delete:h.boolean(),delete_block_reason:l_.nullable(),has_cms_children:h.boolean(),children:h.array(Yr)}).strict()),Xr=h.object({group_id:h.string().min(1),title:h.string().trim().min(1).max(255),pages:h.array(Yr)}).strict(),MA=h.object({base_snapshot_id:I,expected_url_path:Wt}).strict(),p_=h.enum(["succeeded","failed"]),d_=h.object({url_path:Wt,phase:h.enum(["ensure","binding","delete"]),code:h.string().min(1),message:h.string().min(1)}).strict(),Zi=h.object({status:p_,checked_count:h.number().int().nonnegative(),ensured_count:h.number().int().nonnegative(),deleted_count:h.number().int().nonnegative(),already_absent_count:h.number().int().nonnegative(),failed_pages:h.array(d_),warnings:h.array(h.string().min(1))}).strict(),u_=h.object({result_snapshot_id:I,deleted_files:h.array(h.string().min(1)),updated_files:h.array(h.string().min(1)),preserved_shared_files:h.array(h.string().min(1)),warnings:h.array(h.string().min(1)),next_url:Nn.nullable(),previous_url:Nn.nullable(),cms_reconcile_result:Zi}).strict(),UA=h.object({code:h.literal(0),message:h.string(),data:u_}).strict(),FA=h.object({snapshot_id:I}).strict(),__=h.object({snapshot_id:I,warnings:h.array(h.string().min(1)),cms_reconcile_result:Zi}).strict(),GA=h.object({code:h.literal(0),message:h.string(),data:__}).strict(),qA=h.object({snapshot_id:I}).strict(),g_=h.object({snapshot_id:I,status:h.enum(["converged","required","unknown"]),reason:h.string().min(1).max(255).optional()}).strict(),WA=h.object({code:h.literal(0),message:h.literal("ok"),data:g_}).strict(),BA=h.object({source_committed:h.boolean(),result_snapshot_id:I.optional(),cms_reconcile_result:Zi.optional()}).strict().superRefine((e,n)=>{e.source_committed&&!e.result_snapshot_id&&n.addIssue({code:"custom",path:["result_snapshot_id"],message:"committed source requires result_snapshot_id"})}),h_=Xi,S_=h.object({title:h.string().min(1).max(255).optional(),description:h.string().min(1).max(1e3).optional(),keywords:h.string().min(1).max(255).optional(),meta_tags_json:h.record(h.string(),h.unknown()).optional(),schema_json:h.union([h.record(h.string(),h.unknown()),h.array(h.unknown())]).optional(),breadcrumbs_json:h.array(h.unknown()).optional()}).strict(),Qr=h.object({url_path:Wt,title:h.string().trim().min(1).max(255),kind:h_,route_file:h.string().min(1),collection_id:h.string().trim().min(1).optional(),seo:S_.optional()}).strict().superRefine((e,n)=>{e.kind==="detail_page"&&e.seo&&n.addIssue({code:"custom",path:["seo"],message:"detail_page target cannot carry seo (owned by the collection binding flow)"}),e.kind==="detail_page"&&!e.collection_id&&n.addIssue({code:"custom",path:["collection_id"],message:"detail_page target requires collection_id"}),e.kind!=="detail_page"&&e.collection_id&&n.addIssue({code:"custom",path:["collection_id"],message:`${e.kind} target cannot have collection_id`}),e.kind==="landing_page"!=(e.url_path===Br)&&n.addIssue({code:"custom",path:["kind"],message:"The home target must be the only landing_page target."})}),f_=h.object({complete:h.literal(!0),targets:h.array(Qr)}).strict().superRefine((e,n)=>{e.targets.length<1&&n.addIssue({code:"too_small",minimum:1,inclusive:!0,origin:"array",path:["targets"],message:"A complete page target set must contain at least one page."}),e.targets.filter(i=>i.url_path===Br).length!==1&&n.addIssue({code:"custom",path:["targets"],message:"A complete page target set must contain exactly one home page."})}),KA=h.discriminatedUnion("complete",[f_,h.object({complete:h.literal(!1),targets:h.array(Qr),errors:h.array(h.string().min(1)).min(1)}).strict()]),$i=h.string().regex(/^sha256:[0-9a-f]{64}$/),zA=h.object({projection_hash:$i.nullable()}).strict(),HA=h.object({expected_projection_hash:$i.nullable(),projection_hash:$i}).strict(),$A=h.object({clean_snapshot_id:h.string().uuid().nullable()}).strict(),VA=h.object({clean_snapshot_id:h.string().uuid()}).strict();var Zr="insertNewPage",e1={categoryGroupMissing:"DESIGNER_PAGE_CATEGORY_GROUP_MISSING",unavailable:"DESIGNER_PAGE_LIBRARY_UNAVAILABLE",timeout:"DESIGNER_PAGE_LIBRARY_TIMEOUT",invalidResponse:"DESIGNER_PAGE_LIBRARY_INVALID_RESPONSE",incompatibleResource:"DESIGNER_PAGE_RESOURCE_INCOMPATIBLE"},Bt=R.enum(["page","pages"]),b_=R.object({resource_id:R.string().min(1),resource_type:Bt,resolved_version:qt,template_page_id:R.string().min(1)}).strict(),Jr=R.lazy(()=>R.object({id:R.string().uuid(),key:R.string().min(1),name:R.string(),children:R.array(Jr)}).strict()),ec=R.object({category_group_key:R.literal(Zr),categories:R.array(Jr)}).strict(),y_=R.object({resource_id:R.string().min(1),resource_type:Bt,name:R.string(),description:R.string().nullable(),thumbnail_url:R.string().nullable(),preview_images:R.array(R.object({url:R.string().min(1),page_id:R.string().min(1).nullable(),is_primary:R.boolean()}).strict()).optional(),resolved_version:qt,category_id:R.string().uuid().nullable()}).strict(),tc=R.object({category_group_key:R.literal(Zr),items:R.array(y_),next_cursor:R.string().min(1).nullable()}).strict(),t1=R.object({category_id:R.string().uuid().optional(),include_descendants:R.enum(["true","false"]).optional().transform(e=>e==="true"),limit:R.coerce.number().int().min(1).max(100).optional().default(20),cursor:R.string().min(1).optional()}).strict().superRefine((e,n)=>{e.include_descendants&&!e.category_id&&n.addIssue({code:"custom",message:"include_descendants requires category_id"})}),jn=qt,Ds=R.string().regex(/^\/[a-z0-9]+(?:-[a-z0-9]+)*$/),n1=R.string().regex(/^\/(?:[a-z0-9]+(?:-[a-z0-9]+)*)?$/),x_=R.object({template_page_id:R.string().min(1),title:R.string().trim().min(1).max(120),final_route:Ds}).strict(),E_=R.object({template_page_id:R.string().min(1),title:R.string().trim().min(1).max(120),source:b_.optional(),blocks:R.array(R.discriminatedUnion("kind",[R.object({kind:R.literal("package-component"),instance_id:R.string().min(1),component_id:R.string().min(1),label:R.string().trim().min(1).max(120)}).strict(),R.object({kind:R.literal("component-resource"),instance_id:R.string().min(1),resource_id:R.string().min(1),resolved_version:qt,label:R.string().trim().min(1).max(120)}).strict()])).optional(),route:R.object({input:R.string(),append_random_suffix:R.boolean().optional(),random_suffix_length:R.number().int().min(4).max(16).optional(),final:Ds}).strict()}).strict(),R_=R.object({resource_id:R.string().min(1),resource_type:Bt,resolved_version:jn,pages:R.array(E_).min(1)}).strict().superRefine((e,n)=>{It(e.pages.map(s=>s.template_page_id),"pages",n),It(e.pages.map(s=>s.route.final),"routes",n);for(let[s,i]of e.pages.entries()){if(!i.blocks)continue;let o=new Set;for(let[a,c]of i.blocks.entries())o.has(c.instance_id)&&n.addIssue({code:"custom",path:["pages",s,"blocks",a,"instance_id"],message:`Duplicate block instance identifier within page: ${c.instance_id}`}),o.add(c.instance_id)}});function Ji(e,n){e.resource_type==="page"&&e.pages.length!==1&&n.addIssue({code:"custom",path:["pages"],message:"page resources must contain exactly one page"}),e.resource_type==="pages"&&e.pages.length<2&&n.addIssue({code:"custom",path:["pages"],message:"pages resources must contain at least two pages"})}function It(e,n,s){let i=new Set;for(let[o,a]of e.entries())i.has(a)&&s.addIssue({code:"custom",path:[n,o],message:`Duplicate ${n} identifier: ${a}`}),i.add(a)}var s1=R.object({resource_type:Bt,version:jn,pages:R.array(x_).min(1)}).strict().superRefine((e,n)=>{Ji(e,n),It(e.pages.map(s=>s.template_page_id),"pages",n),It(e.pages.map(s=>s.final_route),"routes",n)}),I_=R.object({instance_id:R.string().min(1),component_id:R.string().min(1)}).strict(),T_=R.object({component_id:R.string().min(1),materialization:Gt}).strict(),k_=R.object({template_page_id:R.string().min(1),title:R.string().trim().min(1).max(120),final_route:Ds,materialization:Gt,components:R.array(I_)}).strict(),eo=R.object({resource_id:R.string().min(1),resource_type:Bt,resolved_version:jn,revision_id:R.string().uuid().optional(),digest_sha256:R.string().regex(/^[a-f0-9]{64}$/),components:R.array(T_),pages:R.array(k_).min(1),project_dependencies:R.record(R.string(),R.never()).optional()}).strict().superRefine((e,n)=>{Ji(e,n);let s=e.components.map(o=>o.component_id),i=new Set(s);It(s,"components",n),It(e.pages.map(o=>o.template_page_id),"pages",n),It(e.pages.map(o=>o.final_route),"routes",n);for(let[o,a]of e.pages.entries()){let c=new Set;for(let[r,m]of a.components.entries())i.has(m.component_id)||n.addIssue({code:"custom",path:["pages",o,"components",r,"component_id"],message:`Unknown component reference: ${m.component_id}`}),c.has(m.instance_id)&&n.addIssue({code:"custom",path:["pages",o,"components",r,"instance_id"],message:`Duplicate component instance identifier within page: ${m.instance_id}`}),c.add(m.instance_id)}}),nc=eo,sc=R.object({template_page_id:R.string().min(1),title:R.string().trim().min(1).max(120),final_route:Ds,route_file_path:R.string().regex(/^app\/[a-z0-9]+(?:-[a-z0-9]+)*\/page\.tsx$/)}).strict(),A_=R.object({template_page_id:R.string().min(1),title:R.string().trim().min(1).max(120),composition_supported:R.boolean(),blocks:R.array(R.object({instance_id:R.string().min(1),component_id:R.string().min(1),label:R.string().trim().min(1).max(120)}).strict())}).strict(),ic=R.object({resource_id:R.string().min(1),resource_type:Bt,resolved_version:jn,pages:R.array(A_).min(1)}).strict().superRefine((e,n)=>{Ji(e,n),It(e.pages.map(s=>s.template_page_id),"pages",n)}),i1=R.object({resource_type:Bt,version:jn}).strict(),o1=R.object({draft:R_}).strict(),oc=R.object({groups:R.array(Xr)}).strict(),ac=R.object({candidate:R.record(R.string(),R.unknown())}).strict();var tn="[a-z0-9]+(?:-[a-z0-9]+)*",Ln=new RegExp(`^/(?:${tn}(?:/${tn})*)?$`),rc=["/privacy","/cookie-policy","/system/not-found"],P_=rc.map(e=>`app/${e.slice(1)}/page.tsx`);function w_(e){return e.replace(/[^A-Za-z0-9-]+/g,"-").replace(/-+/g,"-").replace(/^-+|-+$/g,"").toLowerCase()}function cc(e){return typeof e=="string"&&Ln.test(e)}function mc(e){if(typeof e!="string")return null;let n=e.trim();if(/[^\x00-\x7F]/.test(n))return null;let s=n.replace(/^\/+|\/+$/g,"");if(s==="")return"/";let i=s.split("/");if(i.some(r=>r==="."||r===".."))return null;let o=s.toLowerCase();if(o==="index"||o==="home")return"/";let a=i.map(w_).filter(r=>r.length>0);if(a.length===0)return null;let c=`/${a.join("/")}`;return cc(c)?c:null}function lc(e){let n=mc(e);if(n===null)throw new Error("Page slug must be an ASCII route without traversal segments.");return n}function C_(e){let n=lc(e);return n==="/"?"app/page.tsx":`app/${n.slice(1)}/page.tsx`}import{z as J}from"zod";import{z as p}from"zod";import{z as je}from"zod";var v_=je.object({code:je.string().min(1),message:je.string().min(1),details:je.record(je.string(),je.unknown()).optional()}),l1=je.object({code:je.string().min(1),message:je.string().min(1)});function to(e){return je.object({ok:je.literal(!0),composition:K,data:e}).strict()}function D_(e){let n={ok:je.literal(!1),composition:K,error:v_.extend({code:e.codeSchema})};return e.currentSchema&&(n.current=e.currentSchema.optional()),e.diagnosticsSchema&&(n.diagnostics=je.array(e.diagnosticsSchema).optional()),e.dataSchema&&(n.data=e.dataSchema.optional()),je.object(n).strict()}function pc(e){return je.discriminatedUnion("ok",[to(e.dataSchema),D_({codeSchema:e.codeSchema,currentSchema:e.currentSchema,diagnosticsSchema:e.diagnosticsSchema,dataSchema:e.failureDataSchema})])}import{z as se}from"zod";var ut=se.object({start:se.number().int().nonnegative(),end:se.number().int().nonnegative()}).superRefine((e,n)=>{e.end<e.start&&n.addIssue({code:"custom",path:["end"],message:"end must be greater than or equal to start"})}),O_=se.object({code:se.enum(["missing-class-name","unsupported-attribute-name","source-locator-warning","invalid-new-attr","version-conflict","write-failed"]),message:se.string().min(1)}),dc=se.object({path:se.string().min(1),content:se.string(),hash:se.string().min(1).optional()}),g1=se.object({composition:K,revision:se.string().min(1),entryCss:dc,stylesheets:se.array(dc).default([])}).strict(),h1=se.object({composition:ge}).strict(),S1=se.object({key:se.string().min(1),composition:ge}).strict(),uc=se.object({key:se.string().min(1),composition:K,filePath:se.string().min(1),componentName:se.string().min(1),sourceKind:se.enum(["missing","stringLiteral","expression"]),attrRaw:se.string().min(1).nullable(),valueRaw:se.string().min(1).nullable(),attrRange:ut.nullable(),openingElementRange:ut,version:se.object({documentVersion:se.number().int().nonnegative(),contentHash:se.string().min(1)}),diagnostics:se.array(O_),computedStyle:se.record(se.string(),se.string()).optional()}).strict().superRefine((e,n)=>{if(e.sourceKind==="missing"){(e.attrRaw!==null||e.valueRaw!==null||e.attrRange!==null)&&n.addIssue({code:"custom",message:"missing className source must not include attr raw or range"});return}(e.attrRaw===null||e.valueRaw===null||e.attrRange===null)&&n.addIssue({code:"custom",message:"present className source must include attr raw and ranges"})}),f1=uc,b1=to(uc),no=se.object({source:se.enum(["style-panel","class-source-editor"]),operation:se.enum(["replace-static-classname","replace-expression","create-attribute","remove-attribute"])});import{z as rt}from"zod";var N_=new Set(["children","key","ref","dangerouslysetinnerhtml"]),j_=new Set(["data-designer-hover-outline","data-designer-select-outline"]),L_=/^[A-Za-z_$][A-Za-z0-9_$:-]*$/u;function M_(e){return{code:"protected-attribute",message:`Property is protected from generic site editing: ${e}`}}function U_(){return{code:"invalid-attribute-name",message:"Property name must be a valid single JSX attribute name"}}function F_(e){let n=e.toLowerCase();return N_.has(n)||n.startsWith("data-vcp-")||j_.has(n)||/^on[a-z]/iu.test(e)}function so(e){if(!L_.test(e))return{owner:"blocked",name:e,diagnostic:U_()};if(F_(e))return{owner:"blocked",name:e,diagnostic:M_(e)};let n=e.toLowerCase();return n==="classname"||n==="class"?{owner:"class-name-source",name:e}:n==="style"?{owner:"style",name:e}:{owner:"generic",name:e}}import{z as _t}from"zod";var Kt=_t.lazy(()=>_t.union([_t.string(),_t.number().finite(),_t.boolean(),_t.null(),_t.array(Kt),_t.record(_t.string(),Kt)]));var _c=rt.string().min(1),io=rt.discriminatedUnion("operation",[rt.object({operation:rt.literal("set"),name:_c,value:Kt}).strict(),rt.object({operation:rt.literal("remove"),name:_c}).strict()]).superRefine((e,n)=>{let s=so(e.name);s.owner==="blocked"&&n.addIssue({code:"custom",path:["name"],message:s.diagnostic?.message??"Property is not available for site editing"})}),gc=rt.object({kind:rt.literal("set-props"),scope:rt.enum(["selection","template"]),changes:rt.array(io).min(1)}).strict().superRefine((e,n)=>{let s=new Map;for(let[i,o]of e.changes.entries()){let a=so(o.name),c=G_(a),r=s.get(c);r!==void 0?n.addIssue({code:"custom",path:["changes",i,"name"],message:`Duplicate property change; first declared at index ${r}`}):s.set(c,i)}});function G_(e){return e.owner==="class-name-source"||e.owner==="style"?`owner:${e.owner}`:`name:${e.name}`}import{z as q_}from"zod";var hc=q_.enum(["src","alt","poster","href","width","height"]);import{z as nn}from"zod";var Mn=nn.object({editingSessionId:nn.string().min(1),lockId:nn.string().min(1),ownerId:nn.string().min(1),leaseAssertion:nn.string().min(1)}).strict(),v1="signed-designer-mutations-v1",D1=nn.object({mutationContext:Mn}).strict();import{z as u}from"zod";import{z as Un}from"zod";var Os="::",oo=Un.object({file:Un.string().min(1),component:Un.string().min(1),structuralPath:Un.string().min(1),key:Un.string().min(1)}).superRefine((e,n)=>{let s=W_(e.file,e.component,e.structuralPath);e.key!==s&&n.addIssue({code:"custom",path:["key"],message:"key must match file::component::structuralPath"})});function W_(e,n,s){return`${e}${Os}${n}${Os}${s}`}function j1(e){let[n,s,...i]=e.split(Os);return!n||!s||i.length===0?null:{file:n,component:s,structuralPath:i.join(Os)}}var Ns=u.enum(["VERSION_STALE","RECOVERY_REQUIRED","MULTIPLE_PAGE_RETURNS","INDIRECT_RETURN_ONLY","PAGE_CONTAINER_AMBIGUOUS","NO_SAFE_PAGE_PLACEMENT","MEMBER_NOT_INDEPENDENT","UNSUPPORTED_ROUTE_STRUCTURE","RUNTIME_ANCHOR_UNRESOLVED","ROUTE_RETURN_NOT_FOUND"]),Fn=u.object({code:u.string().min(1),message:u.string().min(1)}).strict(),B_=u.union([u.object({kind:u.literal("virtual-route-root"),key:u.string().min(1)}).strict(),u.object({kind:u.literal("jsx-container"),key:u.string().min(1),sourceMemberKey:u.string().min(1),sourceFile:u.string().min(1),componentName:u.string().min(1).optional()}).strict(),u.object({kind:u.literal("starter-placeholder"),key:u.string().min(1),sourceFile:u.string().min(1).optional()}).strict()]),K_=u.object({key:u.string().min(1),kind:u.enum(["jsx-element","jsx-fragment","jsx-expression","null-return","starter-placeholder"]),containerKey:u.string().min(1),label:u.string().min(1),sourceFile:u.string().min(1).optional(),isAtomic:u.boolean()}).strict(),z_=u.object({key:u.string().min(1),sourceMemberKey:u.string().min(1),containerKey:u.string().min(1),label:u.string().min(1),isIndependent:u.boolean()}).strict(),H_=u.object({key:u.string().min(1),containerKey:u.string().min(1),businessMemberKeys:u.array(u.string().min(1)),isMultiMember:u.boolean()}).strict(),fc=u.object({kind:u.literal("page-composition"),placementKey:u.string().min(1),documentVersion:u.number().int().nonnegative(),composition:ge}).strict(),$_=u.object({kind:u.literal("page-composition"),placementKey:u.string().min(1),documentVersion:u.number().int().nonnegative(),composition:K,placementUnitKey:u.string().min(1),relation:u.enum(["before","after","prepend","append"])}).strict(),bc=u.object({kind:u.literal("page-composition"),placementKey:u.string().min(1),documentVersion:u.number().int().nonnegative(),composition:ge,placementUnitKey:u.string().min(1),relation:u.enum(["before","after","prepend","append"])}).strict(),yc=u.object({kind:u.literal("page-unit"),composition:ge,placementUnitKey:u.string().min(1)}).strict(),xc=u.object({kind:u.literal("page-unit"),composition:K,placementUnitKey:u.string().min(1)}).strict();function gt(e,n,s,i,o){let a=new Set;for(let[c,r]of e.entries()){let m=i(r);a.has(m)&&n.addIssue({code:"custom",path:[s,c,o],message:`Duplicate ${s} key: ${m}`}),a.add(m)}}var V_=u.object({status:u.literal("supported"),version:u.number().int().nonnegative(),composition:K,container:B_,sourceMembers:u.array(K_),businessMembers:u.array(z_),placementUnits:u.array(H_),placements:u.array($_)}).strict().superRefine((e,n)=>{gt(e.sourceMembers,n,"sourceMembers",r=>r.key,"key"),gt(e.businessMembers,n,"businessMembers",r=>r.key,"key"),gt(e.placementUnits,n,"placementUnits",r=>r.key,"key"),gt(e.placements,n,"placements",r=>r.placementKey,"placementKey");let s=new Set(e.sourceMembers.map(r=>r.key)),i=new Set(e.placementUnits.map(r=>r.key)),o=new Map(e.sourceMembers.map(r=>[r.key,r])),a=new Map(e.businessMembers.map(r=>[r.key,r]));for(let[r,m]of e.sourceMembers.entries()){m.containerKey!==e.container.key&&!s.has(m.containerKey)&&n.addIssue({code:"custom",path:["sourceMembers",r,"containerKey"],message:"Source member parent must reference the page container or another source member."}),m.containerKey===m.key&&n.addIssue({code:"custom",path:["sourceMembers",r,"containerKey"],message:"Source member cannot contain itself."});let x=new Set([m.key]),_=m.containerKey;for(;_!==e.container.key;){if(x.has(_)){n.addIssue({code:"custom",path:["sourceMembers",r,"containerKey"],message:"Source member hierarchy must be acyclic."});break}x.add(_);let w=o.get(_);if(!w)break;_=w.containerKey}}e.container.kind==="jsx-container"&&!s.has(e.container.sourceMemberKey)&&n.addIssue({code:"custom",path:["container","sourceMemberKey"],message:"Container sourceMemberKey must reference a source member."});for(let[r,m]of e.businessMembers.entries())s.has(m.sourceMemberKey)||n.addIssue({code:"custom",path:["businessMembers",r,"sourceMemberKey"],message:"Business member must reference a source member."}),i.has(m.containerKey)||n.addIssue({code:"custom",path:["businessMembers",r,"containerKey"],message:"Business member must reference a placement unit container."});for(let[r,m]of e.placementUnits.entries()){let x=o.get(m.containerKey);x?x.containerKey!==e.container.key&&n.addIssue({code:"custom",path:["placementUnits",r,"containerKey"],message:"Placement unit must reference a direct child of the page container."}):n.addIssue({code:"custom",path:["placementUnits",r,"containerKey"],message:"Placement unit containerKey must reference a source member."});let _=new Set;for(let[w,B]of m.businessMemberKeys.entries()){let z=a.get(B);if(!z){n.addIssue({code:"custom",path:["placementUnits",r,"businessMemberKeys",w],message:"Placement unit must reference existing business members."});continue}_.has(B)&&n.addIssue({code:"custom",path:["placementUnits",r,"businessMemberKeys",w],message:"Placement unit cannot reference the same business member twice."}),_.add(B),z.containerKey!==m.key&&n.addIssue({code:"custom",path:["placementUnits",r,"businessMemberKeys",w],message:"Business member containerKey must match its placement unit."});let ne=z.sourceMemberKey,Se=new Set;for(;ne&&ne!==m.containerKey&&!Se.has(ne);)Se.add(ne),ne=o.get(ne)?.containerKey;ne!==m.containerKey&&n.addIssue({code:"custom",path:["placementUnits",r,"businessMemberKeys",w],message:"Placement unit business members must belong to its source subtree."})}}for(let[r,m]of e.businessMembers.entries())e.placementUnits.find(_=>_.key===m.containerKey)?.businessMemberKeys.includes(m.key)||n.addIssue({code:"custom",path:["businessMembers",r,"containerKey"],message:"Business member must be listed by its placement unit container."});let c=new Map;for(let r of e.placementUnits)c.set(r.containerKey,(c.get(r.containerKey)??0)+1);for(let[r,m]of e.sourceMembers.entries())m.containerKey===e.container.key&&c.get(m.key)!==1&&n.addIssue({code:"custom",path:["sourceMembers",r,"key"],message:"Every direct source member must be owned by exactly one placement unit."});for(let[r,m]of e.placements.entries())Ic(m.composition,e.composition)||n.addIssue({code:"custom",path:["placements",r,"composition"],message:"Page placement composition must match page composition."}),m.documentVersion!==e.version&&n.addIssue({code:"custom",path:["placements",r,"documentVersion"],message:"Page placement version must match page composition version."}),i.has(m.placementUnitKey)||n.addIssue({code:"custom",path:["placements",r,"placementUnitKey"],message:"Placement option must reference an existing placement unit."})}),Y_=u.object({status:u.literal("unsupported"),version:u.number().int().nonnegative(),composition:K,reason:Ns,diagnostics:u.array(Fn)}).strict(),X_=u.discriminatedUnion("status",[V_,Y_]),Ec=2,G1="page-composition-v2",Rc=u.object({start:u.number().int().nonnegative(),end:u.number().int().nonnegative(),startLine:u.number().int().positive().optional(),startColumn:u.number().int().nonnegative().optional(),endLine:u.number().int().positive().optional(),endColumn:u.number().int().nonnegative().optional()}).strict().superRefine((e,n)=>{e.end<e.start&&n.addIssue({code:"custom",path:["end"],message:"Source range end must be greater than or equal to start."});let s=[e.startLine,e.startColumn,e.endLine,e.endColumn],i=s.some(a=>a!==void 0),o=s.every(a=>a!==void 0);i&&!o&&n.addIssue({code:"custom",path:["startLine"],message:"Source line and column locations must be provided together."}),e.startLine!==void 0&&e.endLine!==void 0&&e.endLine<e.startLine&&n.addIssue({code:"custom",path:["endLine"],message:"Source range endLine must not precede startLine."}),e.startLine!==void 0&&e.endLine===e.startLine&&e.startColumn!==void 0&&e.endColumn!==void 0&&e.endColumn<e.startColumn&&n.addIssue({code:"custom",path:["endColumn"],message:"Source range endColumn must not precede startColumn."})}),Q_=u.object({key:u.string().min(1),instanceIndex:u.number().int().nonnegative().optional(),instanceCount:u.number().int().positive().optional(),textSegmentIndex:u.number().int().nonnegative().optional()}).strict().superRefine((e,n)=>{e.instanceIndex!==void 0&&e.instanceCount!==void 0&&e.instanceIndex>=e.instanceCount&&n.addIssue({code:"custom",path:["instanceIndex"],message:"instanceIndex must be lower than instanceCount."})}),Z_=u.enum(["component-call","native-jsx","dynamic-expression","indirect-expression","text","starter-placeholder"]),J_=u.enum(["none","dynamic-expression","indirect-expression","text","starter-placeholder"]),eg=u.discriminatedUnion("kind",[u.object({kind:u.literal("virtual-route-root"),key:u.null(),routeReturn:u.object({sourceIdentity:oo,sourceRange:Rc}).strict()}).strict(),u.object({kind:u.literal("jsx-container"),key:u.string().min(1),sourceMemberKey:u.string().min(1)}).strict(),u.object({kind:u.literal("starter-placeholder"),key:u.string().min(1),sourceMemberKey:u.string().min(1),replacementMode:u.literal("replace")}).strict()]),tg=u.object({key:u.string().min(1),kind:Z_,parentKey:u.string().min(1).nullable(),childKeys:u.array(u.string().min(1)),order:u.number().int().nonnegative(),label:u.string().min(1),sourceIdentity:oo,sourceRange:Rc.nullable(),atomicKind:J_}).strict().superRefine((e,n)=>{let s=e.kind==="component-call"||e.kind==="native-jsx"?"none":e.kind;e.atomicKind!==s&&n.addIssue({code:"custom",path:["atomicKind"],message:`atomicKind must be ${s} for ${e.kind}.`});let i=new Set;for(let[o,a]of e.childKeys.entries())i.has(a)&&n.addIssue({code:"custom",path:["childKeys",o],message:`Duplicate child source member key: ${a}`}),i.add(a)}),ng=u.object({key:u.string().min(1),sourceMemberKey:u.string().min(1),placementUnitKey:u.string().min(1),label:u.string().min(1),isIndependent:u.boolean()}).strict(),sg=u.enum(["independent","atomic","container"]),ig=u.object({key:u.string().min(1),containerKey:u.string().min(1).nullable(),sourceMemberKeys:u.array(u.string().min(1)).min(1),businessMemberKeys:u.array(u.string().min(1)),order:u.number().int().nonnegative(),boundaryMode:sg,isIndependent:u.boolean(),isMultiMember:u.boolean()}).strict().superRefine((e,n)=>{Sc(e.sourceMemberKeys,n,"sourceMemberKeys","source member"),Sc(e.businessMemberKeys,n,"businessMemberKeys","business member");let s=e.sourceMemberKeys.length>1||e.businessMemberKeys.length>1;e.isMultiMember!==s&&n.addIssue({code:"custom",path:["isMultiMember"],message:"isMultiMember must reflect the source and business member cardinality."});let i=e.boundaryMode==="independent";e.isIndependent!==i&&n.addIssue({code:"custom",path:["isIndependent"],message:"isIndependent must match boundaryMode."})}),og=u.enum(["before","after","prepend","append","replace"]),ag=u.enum(["insert-sibling","insert-child","replace-placeholder"]),rg=u.object({kind:u.literal("page-composition"),placementKey:u.string().min(1),documentVersion:u.number().int().nonnegative(),composition:K,placementUnitKey:u.string().min(1),containerKey:u.string().min(1).nullable(),relation:og,writeMode:ag}).strict().superRefine((e,n)=>{let s=e.relation==="before"||e.relation==="after"?"insert-sibling":e.relation==="prepend"||e.relation==="append"?"insert-child":"replace-placeholder";e.writeMode!==s&&n.addIssue({code:"custom",path:["writeMode"],message:`writeMode must be ${s} for ${e.relation}.`})}),cg=u.object({key:u.string().min(1),placementUnitKey:u.string().min(1),runtimeRefs:u.array(Q_).min(1)}).strict(),mg=u.object({schemaVersion:u.literal(Ec),status:u.literal("supported"),version:u.number().int().nonnegative(),composition:K,container:eg,sourceMembers:u.array(tg),businessMembers:u.array(ng),placementUnits:u.array(ig),placements:u.array(rg),visualAnchors:u.array(cg).optional(),diagnostics:u.array(Fn)}).strict().superRefine((e,n)=>{dg(e,n)}),lg=u.object({schemaVersion:u.literal(Ec),status:u.literal("unsupported"),version:u.number().int().nonnegative(),composition:K,reason:Ns,diagnostics:u.array(Fn)}).strict(),pg=u.discriminatedUnion("status",[mg,lg]),q1=u.union([pg,X_]);function Sc(e,n,s,i){let o=new Set;for(let[a,c]of e.entries())o.has(c)&&n.addIssue({code:"custom",path:[s,a],message:`Duplicate ${i} key: ${c}`}),o.add(c)}function Ic(e,n){return Di(e)===Di(n)}function dg(e,n){gt(e.sourceMembers,n,"sourceMembers",_=>_.key,"key"),gt(e.businessMembers,n,"businessMembers",_=>_.key,"key"),gt(e.placementUnits,n,"placementUnits",_=>_.key,"key"),gt(e.placements,n,"placements",_=>_.placementKey,"placementKey"),gt(e.visualAnchors??[],n,"visualAnchors",_=>_.key,"key"),ug(e,n);let s=new Map(e.sourceMembers.map(_=>[_.key,_])),i=new Map(e.businessMembers.map(_=>[_.key,_])),o=new Map(e.placementUnits.map(_=>[_.key,_]));_g(e,s,n),e.container.kind!=="virtual-route-root"&&(s.has(e.container.sourceMemberKey)||n.addIssue({code:"custom",path:["container","sourceMemberKey"],message:"Container sourceMemberKey must reference a source member."}));let a=new Map,c=new Map,r=new Set;for(let[_,w]of e.placementUnits.entries()){w.containerKey!==e.container.key&&n.addIssue({code:"custom",path:["placementUnits",_,"containerKey"],message:"Placement unit containerKey must match the page container."});let B=`${w.containerKey??"<virtual>"}:${w.order}`;r.has(B)&&n.addIssue({code:"custom",path:["placementUnits",_,"order"],message:"Placement unit order must be unique within its container."}),r.add(B);for(let[z,ne]of w.sourceMemberKeys.entries()){s.has(ne)||n.addIssue({code:"custom",path:["placementUnits",_,"sourceMemberKeys",z],message:"Placement unit must reference existing source members."});let Se=a.get(ne);Se&&Se!==w.key&&n.addIssue({code:"custom",path:["placementUnits",_,"sourceMemberKeys",z],message:`Source member is already assigned to ${Se}.`}),a.set(ne,w.key)}for(let[z,ne]of w.businessMemberKeys.entries()){let Se=i.get(ne);if(!Se){n.addIssue({code:"custom",path:["placementUnits",_,"businessMemberKeys",z],message:"Placement unit must reference existing business members."});continue}Se.placementUnitKey!==w.key&&n.addIssue({code:"custom",path:["placementUnits",_,"businessMemberKeys",z],message:"Placement unit and business member must reference each other."}),w.sourceMemberKeys.includes(Se.sourceMemberKey)||n.addIssue({code:"custom",path:["placementUnits",_,"businessMemberKeys",z],message:"Business member sourceMemberKey must belong to the placement unit."});let Rn=c.get(ne);Rn&&Rn!==w.key&&n.addIssue({code:"custom",path:["placementUnits",_,"businessMemberKeys",z],message:`Business member is already assigned to ${Rn}.`}),c.set(ne,w.key)}}for(let[_,w]of e.businessMembers.entries()){s.has(w.sourceMemberKey)||n.addIssue({code:"custom",path:["businessMembers",_,"sourceMemberKey"],message:"Business member must reference a source member."});let B=o.get(w.placementUnitKey);if(!B){n.addIssue({code:"custom",path:["businessMembers",_,"placementUnitKey"],message:"Business member must reference a placement unit."});continue}B.businessMemberKeys.includes(w.key)||n.addIssue({code:"custom",path:["businessMembers",_,"placementUnitKey"],message:"Business member and placement unit must reference each other."}),B.sourceMemberKeys.includes(w.sourceMemberKey)||n.addIssue({code:"custom",path:["businessMembers",_,"sourceMemberKey"],message:"Business member sourceMemberKey must belong to its placement unit."});let z=B.isIndependent&&B.businessMemberKeys.length===1;w.isIndependent!==z&&n.addIssue({code:"custom",path:["businessMembers",_,"isIndependent"],message:"Business member independence must match its placement unit boundary."})}let m=new Set;for(let[_,w]of e.placements.entries()){w.documentVersion!==e.version&&n.addIssue({code:"custom",path:["placements",_,"documentVersion"],message:"Page placement version must match page composition version."}),Ic(w.composition,e.composition)||n.addIssue({code:"custom",path:["placements",_,"composition"],message:"Page placement composition must match page composition."});let B=o.get(w.placementUnitKey);B?w.containerKey!==B.containerKey&&n.addIssue({code:"custom",path:["placements",_,"containerKey"],message:"Placement containerKey must match its placement unit."}):n.addIssue({code:"custom",path:["placements",_,"placementUnitKey"],message:"Placement option must reference a placement unit."});let z=`${w.placementUnitKey}:${w.relation}`;m.has(z)&&n.addIssue({code:"custom",path:["placements",_,"relation"],message:"A placement unit cannot expose the same relation more than once."}),m.add(z),w.relation==="replace"&&e.container.kind!=="starter-placeholder"&&n.addIssue({code:"custom",path:["placements",_,"relation"],message:"replace is only valid for a starter placeholder container."}),e.container.kind==="starter-placeholder"&&w.relation!=="replace"&&n.addIssue({code:"custom",path:["placements",_,"relation"],message:"Starter placeholder placements must use replace."})}let x=new Set;for(let[_,w]of(e.visualAnchors??[]).entries())o.has(w.placementUnitKey)||n.addIssue({code:"custom",path:["visualAnchors",_,"placementUnitKey"],message:"Visual anchor must reference a placement unit."}),x.has(w.placementUnitKey)&&n.addIssue({code:"custom",path:["visualAnchors",_,"placementUnitKey"],message:"A placement unit may expose only one visual anchor."}),x.add(w.placementUnitKey)}function ug(e,n){let s=[];e.container.key!==null&&s.push({key:e.container.key,path:["container","key"],namespace:"container"});for(let[o,a]of e.sourceMembers.entries())s.push({key:a.key,path:["sourceMembers",o,"key"],namespace:"source member"});for(let[o,a]of e.businessMembers.entries())s.push({key:a.key,path:["businessMembers",o,"key"],namespace:"business member"});for(let[o,a]of e.placementUnits.entries())s.push({key:a.key,path:["placementUnits",o,"key"],namespace:"placement unit"});for(let[o,a]of(e.visualAnchors??[]).entries())s.push({key:a.key,path:["visualAnchors",o,"key"],namespace:"visual anchor"});let i=new Map;for(let o of s){let a=i.get(o.key);a?n.addIssue({code:"custom",path:o.path,message:`${o.namespace} key collides with ${a}: ${o.key}`}):i.set(o.key,o.namespace)}}function _g(e,n,s){let i=new Set;for(let[o,a]of e.sourceMembers.entries()){let c=`${a.parentKey??"<root>"}:${a.order}`;if(i.has(c)&&s.addIssue({code:"custom",path:["sourceMembers",o,"order"],message:"Source member order must be unique among siblings."}),i.add(c),a.parentKey===a.key&&s.addIssue({code:"custom",path:["sourceMembers",o,"parentKey"],message:"Source member cannot be its own parent."}),a.parentKey!==null){let x=n.get(a.parentKey);x?x.childKeys.includes(a.key)||s.addIssue({code:"custom",path:["sourceMembers",o,"parentKey"],message:"Source parent and child references must be bidirectional."}):s.addIssue({code:"custom",path:["sourceMembers",o,"parentKey"],message:"Source member parentKey must reference a source member."})}for(let[x,_]of a.childKeys.entries()){if(_===a.key){s.addIssue({code:"custom",path:["sourceMembers",o,"childKeys",x],message:"Source member cannot be its own child."});continue}let w=n.get(_);w?w.parentKey!==a.key&&s.addIssue({code:"custom",path:["sourceMembers",o,"childKeys",x],message:"Source parent and child references must be bidirectional."}):s.addIssue({code:"custom",path:["sourceMembers",o,"childKeys",x],message:"Source child key must reference a source member."})}let r=new Set,m=a;for(;m;){if(r.has(m.key)){s.addIssue({code:"custom",path:["sourceMembers",o,"parentKey"],message:"Source member graph must be acyclic."});break}r.add(m.key),m=m.parentKey===null?void 0:n.get(m.parentKey)}}}var Gn=p.enum(["update-text","update-array-item","remove-node","insert-child","replace-node","move-node","set-class-name-source","set-props","set-link-target","apply-style-draft","source-edit","insert-page-resource","delete-page-source"]),gg=p.discriminatedUnion("kind",[p.object({kind:p.literal("node"),key:p.string().min(1)}).strict(),yc,p.object({kind:p.literal("route"),composition:ge}).strict(),p.object({kind:p.literal("source-file"),path:Re}).strict(),p.object({kind:p.literal("source-batch"),paths:p.array(Re).min(1)}).superRefine((e,n)=>{let s=new Set;for(let[i,o]of e.paths.entries())s.has(o)&&n.addIssue({code:"custom",path:["paths",i],message:`Duplicate source target path: ${o}`}),s.add(o)}).strict(),p.object({kind:p.literal("project")}).strict()]),hg=p.string().min(1).refine(wg,{message:"Link href must use http(s), mailto, tel, or a non-empty anchor"}),Sg=p.discriminatedUnion("kind",[p.object({kind:p.literal("none")}).strict(),p.object({kind:p.literal("internal-route"),href:p.string().min(1)}).strict().superRefine(({href:e},n)=>{(!e.startsWith("/")||e.startsWith("//")||e.includes("\\")||e.endsWith("#")||/[\s\u0000-\u001f]/u.test(e))&&n.addIssue({code:"custom",path:["href"],message:"Internal routes must be non-empty single-slash paths"})}),p.object({kind:p.literal("native-link"),href:hg}).strict()]),fg=io.superRefine((e,n)=>{["target","rel","title","aria-label"].includes(e.name)||n.addIssue({code:"custom",path:["name"],message:"Link target changes are limited to target, rel, title and aria-label"})}),bg=p.object({kind:p.literal("set-link-target"),scope:p.literal("selection"),link:Sg,changes:p.array(fg)}).strict().superRefine((e,n)=>{let s=new Set;for(let[i,o]of e.changes.entries())s.has(o.name)&&n.addIssue({code:"custom",path:["changes",i,"name"],message:`Duplicate link target change: ${o.name}`}),s.add(o.name),e.link.kind==="none"&&o.operation==="set"&&(o.name==="target"||o.name==="rel")&&n.addIssue({code:"custom",path:["changes",i],message:"An unlinked anchor cannot set target or rel attributes"})}),yg=p.discriminatedUnion("kind",[p.object({kind:p.literal("node"),key:p.string().min(1)}).strict(),xc,p.object({kind:p.literal("route"),composition:K}).strict(),p.object({kind:p.literal("source-file"),path:Re}).strict(),p.object({kind:p.literal("source-batch"),paths:p.array(Re).min(1)}).strict(),p.object({kind:p.literal("project")}).strict()]),Tc=p.enum(["display","position","top","right","bottom","left","zIndex","flexDirection","flexWrap","flexGrow","flexShrink","flexBasis","order","gridTemplateColumns","gridTemplateRows","columns","gridColumn","gridRow","gap","gapX","gapY","spaceX","spaceY","alignItems","justifyContent","marginTop","marginRight","marginBottom","marginLeft","paddingTop","paddingRight","paddingBottom","paddingLeft","width","height","minWidth","minHeight","maxWidth","maxHeight","overflow","fontFamily","fontSize","fontWeight","lineHeight","letterSpacing","textAlign","textTransform","textDecoration","textOverflow","textIndent","writingMode","whiteSpace","wordBreak","lineClamp","fontVariantNumeric","screenReaderOnly","color","backgroundColor","backgroundImage","backgroundRepeat","backgroundSize","backgroundPosition","backgroundAttachment","backgroundClip","backgroundOrigin","borderStyle","borderWidth","borderRadius","borderColor","objectFit","objectPosition","aspectRatio","opacity","boxShadow","transform","transformOrigin","transitionProperty","transitionDuration","transitionTimingFunction","animation","pointerEvents","cursor","userSelect","fontStyle","textUnderlineOffset","scrollMarginTop","alignSelf","flex","outlineStyle","resize","ringWidth","ringColor","backdropFilter","overscrollBehavior","divideWidth","divideColor"]),kc=p.enum(["hover","active","focus","disabled"]),Ac=p.enum(["sm","md","lg","xl","2xl"]),Pc=p.union([p.object({relation:p.enum(["before","after"]),anchorKey:p.string().min(1),parentKey:p.string().min(1)}),p.object({relation:p.enum(["prepend","append"]),parentKey:p.string().min(1)}),bc]),xg=p.object({kind:p.literal("source-sibling"),relation:p.enum(["before","after"]),anchorKey:p.string().min(1)}).strict(),Eg=p.union([Pc,xg]),wc=p.object({kind:p.literal("component-call"),component:p.never().optional(),materialization:Gt,props:p.record(p.string(),p.never()).optional()}).strict(),Rg=p.union([p.object({kind:p.literal("native-tag"),tag:p.string().min(1),text:p.string().optional()}),p.object({kind:p.literal("component-call"),component:p.object({source:p.string().min(1),exportName:p.string().min(1)}),materialization:p.never().optional(),props:p.record(p.string(),p.unknown()).optional()}).strict(),wc]),Ig=p.discriminatedUnion("kind",[p.object({kind:p.literal("update-text"),segmentIndex:p.number().int().min(0),value:p.string()}),p.object({kind:p.literal("update-array-item"),segmentIndex:p.number().int().min(0),index:p.number().int().min(0),value:p.string()}),p.object({kind:p.literal("remove-node")}),p.object({kind:p.literal("insert-child"),node:Rg,position:p.union([Pc,fc])}),p.object({kind:p.literal("replace-node"),node:wc}),p.object({kind:p.literal("move-node"),target:Eg,preserveBindings:p.boolean().optional()}),p.object({kind:p.literal("set-class-name-source"),filePath:p.string().min(1),expectedVersion:p.object({documentVersion:p.number().int().nonnegative(),contentHash:p.string().min(1)}),oldAttrRaw:p.string().min(1).nullable(),oldAttrRange:ut.nullable(),openingElementRange:ut,newAttrRaw:p.string().min(1).nullable(),intent:no}),gc,bg,p.object({kind:p.literal("apply-style-draft"),className:p.object({filePath:p.string().min(1),expectedVersion:p.object({documentVersion:p.number().int().nonnegative(),contentHash:p.string().min(1)}),oldAttrRaw:p.string().min(1).nullable(),oldAttrRange:ut.nullable(),openingElementRange:ut,newAttrRaw:p.string().min(1).nullable(),intent:no}).optional(),props:p.partialRecord(hc,p.string()).optional()}).superRefine((e,n)=>{!e.className&&!e.props&&n.addIssue({code:"custom",message:"apply-style-draft requires className or props"})}),p.object({kind:p.literal("source-edit"),conflictPolicy:p.enum(["compare-and-swap","overwrite"]),edits:p.array(p.discriminatedUnion("operation",[p.object({operation:p.literal("upsert"),path:Re,content:p.string(),baseContentHash:p.string().min(1).nullable().optional()}).strict().superRefine((e,n)=>{Ni(e.path)||n.addIssue({code:"custom",path:["path"],message:"source-edit upsert only accepts allowlisted text source files"}),e.content.includes("\0")&&n.addIssue({code:"custom",path:["content"],message:"source-edit content must be valid text"})}),p.object({operation:p.literal("delete"),path:Re,capability:yr,confirmDelete:p.literal(!0),confirmPath:Re,baseContentHash:p.string().min(1).nullable().optional()}).strict().superRefine((e,n)=>{e.capability!==Oi&&n.addIssue({code:"custom",path:["capability"],message:"delete requires source-delete capability"}),e.confirmPath!==e.path&&n.addIssue({code:"custom",path:["confirmPath"],message:"delete confirmation path must match edit path"}),Ni(e.path)||n.addIssue({code:"custom",path:["path"],message:"source-edit delete only accepts allowlisted text source files"});let s=ji(e.path);s&&n.addIssue({code:"custom",path:["path"],message:`Protected source file cannot be deleted: ${e.path} (${s})`})})])).min(1),reason:p.string().min(1).optional()}).strict().superRefine((e,n)=>{let s=new Set;for(let[i,o]of e.edits.entries())s.has(o.path)&&n.addIssue({code:"custom",path:["edits",i,"path"],message:`Duplicate source edit path: ${o.path}`}),s.add(o.path),e.conflictPolicy==="compare-and-swap"&&o.baseContentHash===void 0&&n.addIssue({code:"custom",path:["edits",i,"baseContentHash"],message:"source-edit compare-and-swap requires baseContentHash for every edit"})}),p.object({kind:p.literal("insert-page-resource"),artifact:eo}).strict(),p.object({kind:p.literal("delete-page-source"),expectedUrlPath:p.string().startsWith("/")}).strict()]),Cc=p.enum(["NODE_NOT_FOUND","HOME_PAGE_LOCKED","ROUTE_NOT_FOUND","CAPABILITY_REJECTED","CONSTRAINT_VIOLATED","INVALID_PARAMS","PLAN_FAILED","TRANSACTION_PREFLIGHT_FAILED","ROUTE_REBUILD_FAILED","HISTORY_COMMIT_FAILED","MATERIALIZATION_CONFLICT","MATERIALIZATION_REJECTED","MUTATION_ASSERTION_REQUIRED","MUTATION_ASSERTION_INVALID","VERSION_STALE","AST_PARSE_ERROR","UNSUPPORTED_OPERATION","LOCATOR_FAILED","INVALID_TARGET","WRITE_IO_ERROR","CONCURRENT_MODIFIED","ROLLBACK_FAILED","RECOVERY_REQUIRED","RECOVERY_PERSIST_FAILED","MUTATION_SESSION_REQUIRED","LEASE_ASSERTION_INVALID","LEASE_ASSERTION_EXPIRED","LEASE_ASSERTION_SCOPE_MISMATCH","CROSS_PAGE_MOVE_UNSUPPORTED","INTERNAL_ERROR"]),vc=p.object({code:Cc,message:p.string().min(1),details:p.record(p.string(),p.unknown()).optional()}),sn=p.object({key:p.string().min(1),instanceIndex:p.number().int().nonnegative().optional(),instanceCount:p.number().int().positive().optional()}),ao=p.object({id:p.string().min(1),siteId:k,baseSnapshotId:I,composition:ge,kind:Gn,target:gg,documentVersion:p.number().int().nonnegative(),selectionRef:sn.optional(),mutationContext:Mn.optional(),params:Ig}).strict().superRefine((e,n)=>{if(e.kind!==e.params.kind&&n.addIssue({code:"custom",path:["params","kind"],message:"params.kind must match operation kind"}),e.kind==="set-link-target"&&e.target.kind!=="node"&&n.addIssue({code:"custom",path:["target","kind"],message:"set-link-target requires a node target"}),e.kind==="source-edit"){if(e.target.kind!=="source-file"&&e.target.kind!=="source-batch")n.addIssue({code:"custom",path:["target","kind"],message:"source-edit requires a source-file or source-batch target"});else if(e.params.kind==="source-edit"){let s=e.params.edits.map(o=>o.path),i=e.target.kind==="source-file"?[e.target.path]:e.target.paths;Pg(s,i)||n.addIssue({code:"custom",path:["target"],message:"source-edit target paths must match edit paths"})}}else(e.target.kind==="source-file"||e.target.kind==="source-batch")&&n.addIssue({code:"custom",path:["target","kind"],message:"source targets are only valid for source-edit"});e.target.kind==="page-unit"&&(e.kind!=="insert-child"&&e.kind!=="replace-node"&&e.kind!=="move-node"&&e.kind!=="remove-node"&&n.addIssue({code:"custom",path:["target","kind"],message:"page-unit target is only valid for page-level operations"}),e.kind==="move-node"&&e.params.kind==="move-node"&&(!("kind"in e.params.target)||e.params.target.kind!=="page-composition")&&n.addIssue({code:"custom",path:["params","target","kind"],message:"page-unit move-node target requires page-composition placement"})),e.params.kind==="insert-child"&&"kind"in e.params.position&&e.params.position.kind==="page-composition"&&e.target.kind!=="page-unit"&&n.addIssue({code:"custom",path:["params","position","kind"],message:"page-composition position requires page-unit target"}),e.kind==="replace-node"&&e.target.kind!=="page-unit"&&n.addIssue({code:"custom",path:["target","kind"],message:"replace-node requires a page-unit target"}),e.kind==="insert-page-resource"||e.kind==="delete-page-source"?e.target.kind!=="project"&&n.addIssue({code:"custom",path:["target","kind"],message:`${e.kind} requires a project target`}):e.target.kind==="project"&&n.addIssue({code:"custom",path:["target","kind"],message:"project target is only valid for insert-page-resource or delete-page-source"}),e.kind==="insert-child"&&e.target.kind==="page-unit"&&e.params.kind==="insert-child"&&(!("kind"in e.params.position)||e.params.position.kind!=="page-composition")&&n.addIssue({code:"custom",path:["params","position","kind"],message:"page-unit target requires page-composition position"})}),tP=ao,Tg=p.object({kind:p.literal("insert-page-resource"),package_instance_id:p.string().min(1),pages:p.array(sc).min(1)}).strict().superRefine((e,n)=>{let s=new Set,i=new Set;for(let[o,a]of e.pages.entries())s.has(a.template_page_id)&&n.addIssue({code:"custom",path:["pages",o,"template_page_id"],message:`Duplicate template page route mapping: ${a.template_page_id}`}),i.has(a.final_route)&&n.addIssue({code:"custom",path:["pages",o,"final_route"],message:`Duplicate final route mapping: ${a.final_route}`}),s.add(a.template_page_id),i.add(a.final_route)}),kg=p.object({kind:p.literal("delete-page-source"),deleted_files:p.array(p.string().min(1)),updated_files:p.array(p.string().min(1)),preserved_shared_files:p.array(p.string().min(1)),warnings:p.array(p.string().min(1))}).strict(),Ag=p.discriminatedUnion("kind",[Tg,kg]),Dc=p.object({requestId:p.string().min(1),kind:Gn,composition:K,target:yg,resultVersion:p.number().int().nonnegative(),affectedFiles:p.array(p.string().min(1)).optional(),selectionRef:sn.optional(),output:Ag.optional()}).strict(),ro=Dc.superRefine((e,n)=>{let s=e.kind==="insert-page-resource"||e.kind==="delete-page-source";s&&e.target.kind!=="project"?n.addIssue({code:"custom",path:["target","kind"],message:`${e.kind} result requires a project target`}):!s&&e.target.kind==="project"&&n.addIssue({code:"custom",path:["target","kind"],message:"project result target requires a project operation"}),s&&!e.output&&n.addIssue({code:"custom",path:["output"],message:`${e.kind} result requires typed output`}),e.output&&e.output.kind!==e.kind&&n.addIssue({code:"custom",path:["output","kind"],message:"output.kind must match operation kind"})}),nP=pc({dataSchema:ro,codeSchema:Cc,failureDataSchema:Dc.partial()});function Pg(e,n){return e.length===n.length&&e.every((s,i)=>s===n[i])}function wg(e){if(/[\s\u0000-\u001f]/u.test(e))return!1;if(/^#[^\s]+$/u.test(e)||/^mailto:.+$/iu.test(e)||/^tel:.+$/iu.test(e))return!0;try{let n=new URL(e);return(n.protocol==="http:"||n.protocol==="https:")&&n.hostname.length>0}catch{return!1}}var Cg=J.enum(["component","page","pages"]),vg=J.object({resource_kind:Cg,resource_name:J.string().trim().min(1).max(200),file_count:J.number().int().min(1).max(64),total_bytes:J.number().int().min(0).max(4*1024*1024),content_digest:J.string().regex(/^sha256:[a-f0-9]{64}$/),custom_prompt:J.string().trim().min(1).max(4e3).optional(),final_routes:J.array(J.string().min(1)).max(64)}).strict(),Dg=J.discriminatedUnion("kind",[J.object({kind:J.literal("none")}).strict(),J.object({kind:J.literal("primary"),items:J.array(J.object({label:J.string().trim().min(1).max(120),href:J.string().startsWith("/").max(200)}).strict()).min(1).max(64)}).strict().superRefine((e,n)=>{let s=new Set;for(let[i,o]of e.items.entries())s.has(o.href)&&n.addIssue({code:"custom",path:["items",i,"href"],message:`Duplicate navigation href: ${o.href}`}),s.add(o.href)})]),js=J.array(J.object({href:J.string().startsWith("/").max(200),page_title:J.string().trim().min(1).max(200),selected_navigation_label:J.string().trim().min(1).max(120).optional()}).strict()).max(64).superRefine((e,n)=>{let s=new Set;for(let[i,o]of e.entries())s.has(o.href)&&n.addIssue({code:"custom",path:[i,"href"],message:"Duplicate resource page href."}),s.add(o.href)});function cP(e,n){let s=js.safeParse(e);if(!s.success||s.data.length!==n.final_routes.length)return null;let i=new Set(n.final_routes);if(i.size!==n.final_routes.length)return null;let o=new Set(n.navigation_selection?.kind==="primary"?n.navigation_selection.items.map(a=>a.href):[]);return s.data.some(a=>!i.has(a.href)||o.has(a.href)!==(a.selected_navigation_label!==void 0))?null:s.data}var Og=J.object({base_snapshot_id:J.string().min(1),operation:ao,navigation_selection:Dg.optional()}).strict().superRefine((e,n)=>{e.base_snapshot_id!==e.operation.baseSnapshotId&&n.addIssue({code:"custom",path:["operation","baseSnapshotId"],message:"Resource operation baseSnapshotId must match base_snapshot_id."})});function Ng(e){return(e.kind==="insert-child"||e.kind==="replace-node")&&(e.params.kind==="insert-child"||e.params.kind==="replace-node")&&e.params.node.kind==="component-call"&&"materialization"in e.params.node&&e.params.node.materialization?[e.params.node.materialization]:e.kind==="insert-page-resource"&&e.params.kind==="insert-page-resource"?[...e.params.artifact.components.map(n=>n.materialization),...e.params.artifact.pages.map(n=>n.materialization)]:[]}var Oc=J.object({id:J.string().min(1),tenant_id:J.string().min(1),site_id:J.string().min(1),run_id:J.string().min(1).optional(),correlation_id:J.string().min(1).optional(),sent_at:J.string().min(1),type:J.literal("client.resource.operation.create"),payload:J.object({client_message_id:J.string().min(1),display:vg,transient_resource_input:Og}).strict()}).strict().superRefine((e,n)=>{let{display:s,transient_resource_input:i}=e.payload;e.site_id!==i.operation.siteId&&n.addIssue({code:"custom",path:["payload","transient_resource_input","operation","siteId"],message:"Resource operation siteId must match envelope site_id."}),(s.resource_kind==="component"?i.operation.kind==="insert-child"||i.operation.kind==="replace-node":i.operation.kind==="insert-page-resource")||n.addIssue({code:"custom",path:["payload","transient_resource_input","operation","kind"],message:s.resource_kind==="component"?"component resources require insert-child or replace-node.":`${s.resource_kind} resources require insert-page-resource.`});let c=Ng(i.operation).flatMap(m=>m.files),r=c.reduce((m,x)=>m+new TextEncoder().encode(x.content).byteLength,0);if(c.length>Bi&&n.addIssue({code:"custom",path:["payload","transient_resource_input","operation"],message:"Resource operation exceeds the aggregate file count limit."}),r>Ki&&n.addIssue({code:"custom",path:["payload","transient_resource_input","operation"],message:"Resource operation exceeds the aggregate content byte limit."}),s.file_count!==c.length&&n.addIssue({code:"custom",path:["payload","display","file_count"],message:"Resource summary file_count must match the transient operation."}),s.total_bytes!==r&&n.addIssue({code:"custom",path:["payload","display","total_bytes"],message:"Resource summary total_bytes must match the transient operation."}),i.operation.kind==="insert-page-resource"&&i.operation.params.kind==="insert-page-resource"){let m=i.operation.params.artifact;m.resource_type!==s.resource_kind&&n.addIssue({code:"custom",path:["payload","display","resource_kind"],message:"Resource summary kind must match the page artifact resource_type."});let x=m.pages.map(_=>_.final_route);(x.length!==s.final_routes.length||x.some((_,w)=>_!==s.final_routes[w]))&&n.addIssue({code:"custom",path:["payload","display","final_routes"],message:"Resource summary final_routes must match the page artifact routes."})}if(i.navigation_selection?.kind==="primary"){let m=new Set(s.final_routes);for(let[x,_]of i.navigation_selection.items.entries())m.has(_.href)||n.addIssue({code:"custom",path:["payload","transient_resource_input","navigation_selection","items",x,"href"],message:"Navigation selection href must reference a final resource route."})}});import{z as C}from"zod";import{z as co}from"zod";var M=e=>co.object({code:co.number().int(),data:e,message:co.string()});var jg=["with_website","without_website"],on=C.enum(jg),mo=C.string().trim().url().refine(e=>{let n=new URL(e).protocol;return n==="http:"||n==="https:"},{message:"Website must use the http or https protocol."}),Lg=["welcome","website_scan","customer_materials","analysis","diagnosis","strategy","structure_planning","preview_personalization","publishing"],Tt=C.enum(Lg),Mg=["company_info","website_crawl","website_basic_info_extract","website_metrics_evaluate","intelligent_analysis","strategy_recommendation"],jc=C.enum(Mg),Ug=["started","running","succeeded","failed","invalidated"],Lc=C.enum(Ug),Fg=["draft","structure_saved","generating","workspace_ready"],lo=C.enum(Fg),Gg=["not_deployed","deploying","deployed"],po=C.enum(Gg),qg=["active","completed"],Wg=C.enum(qg),Bg=["completed","current","locked"],Kg=C.enum(Bg),Mc={draft:10,structure_saved:20,generating:30,workspace_ready:40},Uc={not_deployed:10,deploying:20,deployed:30},Fc={active:10,completed:20},Gc={started:10,running:20,succeeded:30,failed:40,invalidated:50};function Ls(e){return new Map(Object.entries(e).map(([n,s])=>[s,n]))}var zg=Ls(Mc),Hg=Ls(Uc),$g=Ls(Fc),Vg=Ls(Gc);function hP(e){let n=zg.get(e);if(!n)throw new Error(`Unknown site build status code: ${e}`);return n}function SP(e){let n=Hg.get(e);if(!n)throw new Error(`Unknown site deployment status code: ${e}`);return n}function fP(e){let n=$g.get(e);if(!n)throw new Error(`Unknown site workflow status code: ${e}`);return n}function bP(e){let n=Vg.get(e);if(!n)throw new Error(`Unknown task execution status code: ${e}`);return n}function yP(e){return Mc[e]}function xP(e){return Uc[e]}function EP(e){return Fc[e]}function RP(e){return Gc[e]}var uo=[{definition_version:1,published:!0,required_client_capability:null,definitions:{with_website:[{id:"01900000-0000-7000-8000-000000000001",node_code:"welcome",label:"\u6B22\u8FCE\u542F\u52A8",sort_order:1,is_enabled:!0},{id:"01900000-0000-7000-8000-000000000002",node_code:"website_scan",label:"\u521D\u59CB\u5316\u9700\u6C42\u4E0E\u5B98\u7F51\u626B\u63CF",sort_order:2,is_enabled:!0},{id:"01900000-0000-7000-8000-000000000003",node_code:"analysis",label:"\u667A\u80FD\u5206\u6790",sort_order:3,is_enabled:!0},{id:"01900000-0000-7000-8000-000000000004",node_code:"diagnosis",label:"\u8BCA\u65AD\u62A5\u544A",sort_order:4,is_enabled:!0},{id:"01900000-0000-7000-8000-000000000005",node_code:"strategy",label:"\u7B56\u7565\u4E0E\u5EFA\u8BAE",sort_order:5,is_enabled:!0},{id:"01900000-0000-7000-8000-000000000014",node_code:"structure_planning",label:"\u7ED3\u6784\u89C4\u5212",sort_order:6,is_enabled:!0},{id:"01900000-0000-7000-8000-000000000015",node_code:"preview_personalization",label:"\u9884\u89C8\u4E0E\u4E2A\u6027\u5316",sort_order:7,is_enabled:!0},{id:"01900000-0000-7000-8000-000000000016",node_code:"publishing",label:"\u7F51\u7AD9\u53D1\u5E03",sort_order:8,is_enabled:!0}],without_website:[{id:"01900000-0000-7000-8000-00000000000b",node_code:"welcome",label:"\u6B22\u8FCE\u542F\u52A8",sort_order:1,is_enabled:!0},{id:"01900000-0000-7000-8000-00000000000c",node_code:"customer_materials",label:"\u5BA2\u6237\u8D44\u6599\u63D0\u4F9B",sort_order:2,is_enabled:!0},{id:"01900000-0000-7000-8000-00000000000d",node_code:"analysis",label:"\u667A\u80FD\u5206\u6790",sort_order:3,is_enabled:!0},{id:"01900000-0000-7000-8000-00000000000e",node_code:"strategy",label:"\u7B56\u7565\u4E0E\u5EFA\u8BAE",sort_order:4,is_enabled:!0},{id:"01900000-0000-7000-8000-000000000017",node_code:"structure_planning",label:"\u7ED3\u6784\u89C4\u5212",sort_order:5,is_enabled:!0},{id:"01900000-0000-7000-8000-000000000018",node_code:"preview_personalization",label:"\u9884\u89C8\u4E0E\u4E2A\u6027\u5316",sort_order:6,is_enabled:!0},{id:"01900000-0000-7000-8000-000000000019",node_code:"publishing",label:"\u7F51\u7AD9\u53D1\u5E03",sort_order:7,is_enabled:!0}]}}],IP=uo[0].definitions,qc=C.number().int().min(1),Yg=C.object({id:Q,flow_type:on,definition_version:qc,node_code:Tt,label:C.string().min(1),sort_order:C.number().int().min(1),is_enabled:C.boolean(),state:Kg}),Wc=C.object({id:tr,tenant_id:C.string().min(1),site_id:k,workflow_id:ot,node_code:Tt,task_type:jc,external_task_id:C.string().min(1),execution_status:Lc,idempotency_key:C.string().min(1),attempt_no:C.number().int().min(1),source_crawl_task_ref_id:C.string().uuid().nullable(),succeeded_at:C.string().min(1).nullable(),superseded_at:C.string().min(1).nullable(),site_url:C.string().url().nullable(),created_at:C.string().min(1),updated_at:C.string().min(1)}),Xg=C.object({id:ot,tenant_id:C.string().min(1),site_id:k,flow_type:on,website:mo.nullable(),definition_version:qc,current_node_code:Tt,status:Wg,started_at:C.string().min(1),completed_at:C.string().min(1).nullable(),created_at:C.string().min(1),updated_at:C.string().min(1)}),_o=C.object({workflow:Xg,menu:C.array(Yg),task_refs:C.array(Wc),site:C.object({default_locale:Ie.optional(),status:lo,deployment_status:po,archived_at:C.string().min(1).nullable(),current_sitemap_id:C.string().nullable().optional(),current_sitemap_version:C.number().int().positive().nullable().optional(),confirmed_sitemap_id:C.string().nullable().optional(),confirmed_sitemap_version:C.number().int().positive().nullable().optional(),structure_confirmed_at:C.string().min(1).nullable().optional(),current_snapshot_id:C.string().nullable(),deployed_url:C.string().url().nullable(),cms_site_id:C.string().min(1).nullish()})}),TP=M(_o),kP=M(Wc),Nc=C.array(C.string().min(1).max(64)).max(16).optional(),AP=C.discriminatedUnion("flow_type",[C.object({flow_type:C.literal("with_website"),website:mo,client_capabilities:Nc}).strict(),C.object({flow_type:C.literal("without_website"),website:C.null().optional(),client_capabilities:Nc}).strict()]),PP=C.object({expected_current_node:C.literal("website_scan"),website:mo}).strict(),wP=C.object({expected_current_node:Tt}).strict(),CP=C.object({expected_current_node:C.literal("publishing")}).strict(),vP=C.object({publish_workflow_id:ps,expected_publish_revision:C.number().int().min(1)}).strict(),Qg=C.object({node_code:Tt,task_type:jc,external_task_id:C.string().min(1).max(255),idempotency_key:C.string().min(1).max(255),site_url:C.string().url().optional()}),DP=Qg.extend({workflow_id:ot}).strict(),OP=C.object({external_task_id:C.string().min(1).max(255),execution_status:Lc}),Zg=C.object({previous_external_task_id:C.string().min(1).max(255),external_task_id:C.string().min(1).max(255),idempotency_key:C.string().min(1).max(255),site_url:C.string().url().optional()}),NP=Zg.extend({workflow_id:ot}).strict(),Jg=C.object({previous_external_task_id:C.string().min(1).max(255),external_task_id:C.string().min(1).max(255),idempotency_key:C.string().min(1).max(255),site_url:C.string().url()}),jP=Jg.extend({workflow_id:ot}).strict(),LP=C.object({}).strict();function eh(e,n,s){return e.find(i=>i.definition_version===s)?.definitions[n]}function th(e,n){return eh(uo,e,n)}function nh(e,n=1){let s=th(e,n);if(!s)throw new Error(`Unknown workflow definition: ${e} v${n}.`);return s}function sh(e,n,s){let i=new Set(s);return e.filter(o=>o.published&&(o.required_client_capability===null||i.has(o.required_client_capability))).sort((o,a)=>a.definition_version-o.definition_version).map(o=>({definition_version:o.definition_version,items:o.definitions[n]}))[0]}function MP(e,n){return sh(uo,e,n)}function UP(e,n){return nh(e).findIndex(s=>s.node_code===n)}function FP(e,n){return e==="website_scan"?n==="website_crawl"||n==="website_basic_info_extract"||n==="website_metrics_evaluate":e==="customer_materials"?n==="company_info":e==="analysis"?n==="intelligent_analysis":e==="strategy"?n==="strategy_recommendation":!1}function GP(e,n){if(e===n)return n;if(!{started:["running","succeeded","failed","invalidated"],running:["succeeded","failed","invalidated"],succeeded:["invalidated"],failed:["invalidated"],invalidated:[]}[e].includes(n))throw new Error(`Invalid task execution status transition: ${e} -> ${n}`);return n}function qP(e,n){if(e===n)return n;if(!{draft:["structure_saved"],structure_saved:["generating","draft"],generating:["workspace_ready","structure_saved"],workspace_ready:[]}[e].includes(n))throw new Error(`Invalid site build status transition: ${e} -> ${n}`);return n}import{z as E}from"zod";var go=E.string().min(1).max(120).regex(/^[a-z][a-z0-9_-]*$/),Fe=E.string().min(1).max(120).regex(/^[A-Za-z_][A-Za-z0-9_]*$/),ih=E.enum(["text","select","multi_select","tags","category_list","boolean","number"]),qn=E.string().min(1).max(512).regex(/^\/(?:[^?#]*)$/),oh=E.enum(["base_snapshot_missing","route_not_found","cms_unavailable","product_application_not_found","not_a_configuration_change","tool_execution_failed"]),ho=E.object({status:E.literal("failed"),reason:oh}).strict(),ah=E.object({minimum:E.number().finite(),maximum:E.number().finite(),step:E.number().finite().positive()}).strict().refine(e=>e.minimum<e.maximum,{message:"minimum must be less than maximum"}),rh=E.string().trim().min(1).max(100),Kc=E.array(rh).max(5).refine(e=>new Set(e.map(n=>n.toLowerCase())).size===e.length,{message:"popular_terms must be unique ignoring case"}),zP=E.array(E.string()).max(20).transform(e=>{let n=new Set;return e.map(s=>s.trim()).filter(s=>{if(s.length===0||s.length>100)return!1;let i=s.toLowerCase();return n.has(i)?!1:(n.add(i),!0)}).slice(0,5)}),zc=E.object({filter_enabled:E.boolean(),selected_fields:E.array(Fe).max(64),selected_card_fields:E.array(Fe).max(64).default([]),popular_terms_enabled:E.boolean().default(!1),popular_terms:Kc.optional()}).strict(),ch=E.object({app_slug:go}).extend(zc.shape).strict(),So=E.object({kind:E.literal("product_search_confirmation"),baseline_snapshot_id:I,target_route_id:qn,applications:E.array(E.object({app_slug:go,label:E.string().min(1).max(200),popular_terms:Kc.default([]),current_config:zc.nullable().default(null),affected_routes:E.array(qn).max(64).default([]),fields:E.array(E.object({field_name:Fe,label:E.string().min(1).max(200),value_shape:ih,option_count:E.number().int().nonnegative().optional(),filter_meta:ah.optional()}).strict()).max(64)}).strict()).min(1).max(12),current_config:ch.nullable().optional(),affected_routes:E.array(qn).min(1).max(64).optional()}).strict(),mh=E.object({kind:E.literal("product_search_confirmation"),action:E.enum(["confirm","modify"]),app_slug:go,filter_enabled:E.boolean(),popular_terms_enabled:E.boolean().default(!1),selected_fields:E.array(Fe).max(64),selected_card_fields:E.array(Fe).max(64).default([])}).strict().superRefine((e,n)=>{e.filter_enabled&&e.selected_fields.length===0&&n.addIssue({code:"custom",path:["selected_fields"],message:"selected_fields must not be empty while filters are enabled"}),new Set(e.selected_fields).size!==e.selected_fields.length&&n.addIssue({code:"custom",path:["selected_fields"],message:"selected_fields must be unique"}),new Set(e.selected_card_fields).size!==e.selected_card_fields.length&&n.addIssue({code:"custom",path:["selected_card_fields"],message:"selected_card_fields must be unique"})}),Ms=E.union([mh,E.object({kind:E.literal("product_search_confirmation"),action:E.literal("cancel")}).strict()]),Wn=E.union([E.string().max(255),E.number().finite(),E.boolean()]),lh=E.object({values:E.array(Wn).min(1).max(20).refine(e=>new Set(e.map(n=>`${typeof n}:${String(n)}`)).size===e.length,{message:"values must be unique"})}).strict(),ph=E.object({min:E.number().finite().optional(),max:E.number().finite().optional(),include_unlabeled:E.boolean().optional()}).strict().refine(e=>e.min!==void 0||e.max!==void 0||e.include_unlabeled===!0,{message:"a numeric boundary or include_unlabeled is required"}).refine(e=>e.min===void 0||e.max===void 0||e.min<=e.max,{message:"min must not be greater than max"}),dh=E.object({q:E.string().max(200),page:E.number().int().min(1).max(500),page_size:E.union([E.literal(9),E.literal(20)]),sort:E.enum(["published_at_desc","published_at_asc","product_name_asc","product_name_desc"]),filters:E.record(Fe,E.union([lh,ph])).superRefine((e,n)=>{Object.keys(e).length>12&&n.addIssue({code:"custom",message:"filters must contain at most 12 fields"})}),display_fields:E.array(Fe).max(64).default([]),missing_count_fields:E.array(Fe).max(12).default([]),relaxation_count_fields:E.array(Fe).max(12).default([]),facets:E.array(E.object({field:Fe,query:E.string().max(100),page:E.number().int().min(1).max(100),page_size:E.literal(10),include_values:E.array(Wn).max(20)}).strict()).max(8)}).strict(),Bc=E.object({value:Wn,label:E.string().max(200),count:E.number().int().nonnegative()}).strict(),uh=E.union([Wn,E.array(Wn).max(50)]),_h=E.object({items:E.array(E.object({id:E.number().int().positive(),thumbnail:E.string().max(2048).nullable(),title:E.string().max(300),summary:E.string().max(2e3),category:E.string().max(300).nullable(),field_values:E.record(Fe,uh).default({}),url:E.string().min(1).max(2048)}).strict()).max(20),page:E.object({total:E.number().int().nonnegative(),page:E.number().int().positive(),page_size:E.union([E.literal(9),E.literal(20)])}).strict(),facets:E.array(E.object({field:Fe,total:E.number().int().nonnegative(),page:E.number().int().positive(),page_size:E.literal(10),values:E.array(Bc).max(10),selected_values:E.array(Bc).max(20)}).strict()).max(8),missing_counts:E.record(Fe,E.number().int().nonnegative()).default({}),relaxation_counts:E.record(Fe,E.number().int().nonnegative()).default({})}).strict(),HP=E.object({contract_version:E.literal(1),request:dh,response:_h}).strict();import{z as We}from"zod";var fo=4,YP=20,XP=1440*60*1e3,QP=1e6,gh=["image/png","image/jpeg","image/webp"],bo=We.enum(gh),ZP="WORKSPACE_ATTACHMENT_UNSUPPORTED_FORMAT",JP="WORKSPACE_ATTACHMENT_TOO_LARGE",ew="WORKSPACE_ATTACHMENT_LIMIT",tw="WORKSPACE_ATTACHMENT_BOUND",nw=10,sw=3600*1e3,iw="WORKSPACE_ATTACHMENT_URL_REJECTED",ow="WORKSPACE_ATTACHMENT_CAPTURE_FAILED",aw="WORKSPACE_ATTACHMENT_CAPTURE_BUSY",rw="WORKSPACE_ATTACHMENT_CAPTURE_TIMEOUT",cw="WORKSPACE_ATTACHMENT_CAPTURE_BUDGET_EXCEEDED",mw="WORKSPACE_ATTACHMENT_CAPTURE_UNAVAILABLE",lw=We.object({attachment_id:We.string().min(1),media_type:bo,width:We.number().int().positive(),height:We.number().int().positive(),size_bytes:We.number().int().nonnegative(),filename:We.string().min(1).max(120),image_url:We.string().min(1),source_url:We.string().min(1).optional(),created_at:We.string().min(1)}).strict(),pw=We.object({url:We.string().url().max(2048),full_page:We.boolean().optional()}).strict(),Hc="[A-Za-z0-9_-]+",hh=new RegExp(`^/sites/(${Hc})/workspace/attachments/(${Hc})/image$`);function dw(e,n){return`/sites/${encodeURIComponent(e)}/workspace/attachments/${encodeURIComponent(n)}/image`}function yo(e){let n=hh.exec(e);return n?{site_id:n[1],attachment_id:n[2]}:null}function uw(e){let n=[];for(let s of e){if(s.type!=="file"||typeof s.url!="string")continue;let i=yo(s.url);i&&n.push({attachment_id:i.attachment_id,site_id:i.site_id,media_type:typeof s.mediaType=="string"?s.mediaType:"",filename:typeof s.filename=="string"&&s.filename.trim()!==""?s.filename:"image",url:s.url})}return n}import{z as Bn}from"zod";var Sh=["deployment_queued","prepare_source","build_artifact","publish_site","site_released","cleanup_release"],fh=Bn.enum(Sh),bh=Bn.enum(["running","succeeded","failed"]),yh=Bn.object({code:fh,status:bh,message:Bn.string().trim().min(1)}).strict(),$c=Bn.array(yh);import{z as Kn}from"zod";var xh={slug:/^page_[0-9]+_slug$/,showInHeader:/^page_[0-9]+_show_in_header$/,showInFooter:/^page_[0-9]+_show_in_footer$/,type:/^block_[0-9]+_type$/};function fw(e){let n={},s=new Set;for(let i of e){if(!xh[i.field].test(i.key))throw new Error("Invalid Sitemap Resolver answer-sheet hole key.");if(s.has(i.key))throw new Error("Duplicate Sitemap Resolver answer-sheet hole key.");s.add(i.key),n[i.key]=i.field==="slug"?Kn.string().min(1):i.field==="type"?Kn.string().trim().min(1):Kn.boolean()}return Kn.object({answers:Kn.object(n).strict()}).strict()}import{z as v}from"zod";var Eh=v.enum(["pending","running","succeeded","failed"]),Rh=v.enum(["TASK_FAILED","WEBSITE_UNREACHABLE"]),Ih=v.object({task_id:v.string().uuid(),site_url:v.string().url(),crawler_task_id:v.string().min(1).max(255).nullable(),crawler_error_code:Rh.nullable().optional(),crawler_failure_stage:v.enum(["URL_DISCOVERY","PAGE_CRAWL","TASK_SCHEDULING","RESULT_PERSISTENCE"]).nullable().optional(),page_count:v.number().int().min(0).max(20),status:Eh,error:v.string().nullable(),created_at:v.string().min(1),updated_at:v.string().min(1)}),Ew=M(Ih),xo=v.enum(["existing_site","new_site"]),Yc=v.enum(["google_indexing","ai_recommendation","qualification_verifiability","content_freshness","inquiry_form","inquiry_response","privacy_compliance","prohibited_content"]),Vc=v.object({observed_result:v.enum(["pass","fail","unknown"])}).strict(),Xc=v.object({kind:v.literal("ai_crawlability"),checks:v.object({ai_access_guidance:Vc,structured_data_presence:Vc}).strict()}).strict(),Eo=v.object({label:v.string().trim(),value:v.union([v.string(),v.number(),v.boolean(),v.null()]),summary:v.string().trim(),tone:v.enum(["good","warn","bad","unknown"]),status:v.enum(["ok","unknown"]),assessment:Xc.optional()}),Us=v.object({key:v.string().trim().min(1).max(100),label:v.string().trim().min(1).max(100),value:v.union([v.string().max(1e3),v.number(),v.boolean(),v.null()]),tone:v.enum(["good","warn","bad","unknown"]),status:v.enum(["ok","unknown"]),evidence:v.string().trim().max(2e3).optional(),assessment:Xc.optional()}).strict(),Th=v.object({url:v.string().url().max(2048),title:v.string().trim().max(300),words:v.number().int().nonnegative().max(1e7)}).strict(),kh=v.object({site_url:v.string().url().max(2048),scanned_at:v.string().datetime({offset:!0}),reach:v.array(Us).max(64),trust:v.array(Us).max(64),convert:v.array(Us).max(64),safe:v.array(Us).max(64),pages:v.array(Th).max(100)}).strict(),Fs=v.object({company_task_id:v.string().min(1).max(128),scan_task_id:v.string().min(1).max(128),type:xo,result:v.object({company_name:v.string(),website:v.string().url().optional(),primary_product:v.string(),current_market:v.string(),qualifications:v.string(),scan_cards:v.record(v.string(),Eo),scan_result:kh.optional()})}),Ah=v.object({saved:v.literal(!0),company_task_id:v.string().min(1).max(128),scan_task_id:v.string().min(1).max(128)}),Rw=M(Ah),Ph=v.enum(["snapshot","task"]),wh=Fs.shape.result.extend({type:xo,structured_facts:v.unknown().optional()}).extend({company_name:v.string(),primary_product:v.string(),current_market:v.string(),qualifications:v.string()}),Ch=v.object({site_id:v.string().min(1).max(128),company_task_id:v.string().min(1).max(128),scan_task_id:v.string().min(1).max(128),type:xo,data_source:Ph,result:wh}),Iw=M(Ch.nullable());import{z as Te}from"zod";var kt=Te.enum(["company","product_service","case_qualification","market","contact_inquiry","privacy_compliance","news_freshness"]),vh=Te.object({ordinal:Te.number().int().min(1).max(1e4),path:Te.string().min(1).max(2048).refine(e=>!Nh(e),{message:"path must be a site-relative path, not an absolute URL"}),last_modified:Te.string().max(64).nullable()}).strict(),Aw=Te.object({candidates:Te.array(vh).min(1).max(1e4),selection_limit:Te.number().int().min(1).max(19)}).strict().superRefine((e,n)=>{let s=e.candidates.map(i=>i.ordinal).sort((i,o)=>i-o);for(let[i,o]of s.entries())if(o!==i+1){n.addIssue({code:"custom",path:["candidates"],message:"candidates ordinals must be unique and consecutive from 1"});return}}),Dh=Te.object({ordinal:Te.number().int().positive().max(1e4),roles:Te.array(kt).min(1).max(7)}).strict(),Oh=Te.object({role:kt,status:Te.enum(["selected","not_found"]),selected_ordinals:Te.array(Te.number().int().positive().max(1e4)).max(19)}).strict(),Pw=Te.object({selections:Te.array(Dh).max(19),coverage:Te.array(Oh).length(7)}).strict().superRefine((e,n)=>{let s=new Set;for(let[o,a]of e.coverage.entries())s.has(a.role)&&n.addIssue({code:"custom",path:["coverage",o,"role"],message:"coverage roles must be unique"}),s.add(a.role);for(let o of kt.options)s.has(o)||n.addIssue({code:"custom",path:["coverage"],message:`coverage must include every page role (missing ${o})`});let i=new Map;for(let o of e.selections)for(let a of o.roles){let c=i.get(a)??new Set;c.add(o.ordinal),i.set(a,c)}for(let[o,a]of e.coverage.entries()){let c=i.get(a.role);a.selected_ordinals.some(m=>!c?.has(m))&&n.addIssue({code:"custom",path:["coverage",o,"selected_ordinals"],message:"selected_ordinals must reference selections carrying the same role"})}});function Nh(e){let n=e.toLowerCase();return n.startsWith("http://")||n.startsWith("https://")||e.startsWith("//")}import{z as f}from"zod";var Dw=f.object({force_refresh:f.boolean().optional()}),Zc=f.enum(["running","succeeded","failed"]),jh=f.object({agent_id:f.string().min(1),name:f.string().min(1),icon:f.string().min(1),capability:f.string().min(1),data_source:f.string().min(1),output_topics:f.string().min(1)}),Lh=f.object({site_mode:f.enum(["existing_site","new_site"]),scan_required:f.boolean(),scheduled_agent_ids:f.array(f.string().min(1)),omitted_agent_ids:f.array(f.string().min(1)),next_stage:f.enum(["diagnostic_report","strategy"])}),Mh=f.object({t:f.string(),d:f.string(),evidence:f.object({from:f.string(),url:f.string().nullable().optional(),value:f.string().nullable().optional()})}),Uh=f.enum(["complete","partial","insufficient_data","failed"]),Fh=f.enum(["ok","failed","insufficient_data"]),Ro=f.object({agent_id:f.string().min(1),name:f.string().min(1),icon:f.string().min(1),status:Fh,topics:f.array(f.object({topic_id:f.string().min(1),status:Uh,evidence_refs:f.array(f.string())})).length(3),findings:f.array(Mh).max(3),elapsed_ms:f.number().nonnegative(),note:f.string().optional(),error:f.string().optional()}),Jc=f.object({total:f.number().int().nonnegative(),ok:f.number().int().nonnegative(),degraded:f.number().int().nonnegative(),total_findings:f.number().int().nonnegative(),elapsed_ms:f.number().nonnegative(),site_mode:f.enum(["existing_site","new_site"]).optional(),scheduled_agent_ids:f.array(f.string()).optional(),omitted_agent_ids:f.array(f.string()).optional(),scheduled:f.number().int().nonnegative().optional(),complete:f.number().int().nonnegative().optional(),partial:f.number().int().nonnegative().optional(),insufficient:f.number().int().nonnegative().optional(),failed:f.number().int().nonnegative().optional(),next_stage:f.enum(["diagnostic_report","strategy"]).optional()}),Gh=f.object({agents_done:f.boolean(),analysis:f.record(f.string(),Ro),step4_scoring_input:f.unknown().optional(),summary:Jc}),em=f.object({job_id:f.string().min(1),site_id:f.string().min(1),model_version:f.string().min(1),output_locale:f.string().min(2),cached:f.boolean().optional(),status:Zc,result:Gh.nullable().optional(),error:f.string().nullable().optional()}),Ow=M(f.array(jh)),Nw=M(Lh),jw=M(em),Lw=M(em.nullable()),ht=f.object({id:f.union([f.number().int().nonnegative(),f.string().regex(/^(0|[1-9]\d*)$/u).transform(Number)]).pipe(f.number().int().nonnegative())}),Qc=f.object({percent:f.number().int().min(0).max(100),phase:f.enum(["preparing","analyzing","finalizing","completed","failed"]),stage:f.enum(["queued","baseline_ready","source_pages_ready","external_evidence_ready","knowledge_evidence_ready","page_evidence_ready","analysis_context_ready","preparation_saved","workflow_ready","agent_started","agent_completed","workflow_completed","scoring_input_ready","red_texts_ready","result_ready","result_persisted","completed","failed"]),agents_done:f.number().int().nonnegative(),agents_total:f.number().int().nonnegative(),agent_id:f.string().min(1).optional()}),Mw=f.discriminatedUnion("event",[ht.extend({event:f.literal("snapshot"),data:f.object({job_id:f.string().min(1),status:Zc,done:f.number().int().nonnegative(),total:f.number().int().nonnegative(),results:f.array(Ro),progress:Qc.optional()})}),ht.extend({event:f.literal("progress"),data:Qc}),ht.extend({event:f.literal("preparing_started"),data:f.object({stage:f.literal("baseline")})}),ht.extend({event:f.literal("preparing_progress"),data:f.object({stage:f.enum(["context","external_evidence"])})}),ht.extend({event:f.literal("preparing_done"),data:f.object({evidence_count:f.number().int().nonnegative(),rule_count:f.number().int().nonnegative(),degraded_capabilities:f.array(f.string())})}),ht.extend({event:f.literal("agent_start"),data:f.object({agent_id:f.string().min(1),name:f.string().min(1),icon:f.string().min(1)})}),ht.extend({event:f.literal("agent_done"),data:Ro}),ht.extend({event:f.literal("done"),data:f.object({agents_done:f.literal(!0),summary:Jc})}),ht.extend({event:f.literal("failed"),data:f.object({message:f.string().min(1)})})]);import{z as U}from"zod";var To=U.enum(["reach","trust","convert","safe"]),Oe=U.number().finite(),qh=U.number().finite().positive(),Io=["reach","trust","convert","safe"],Wh=17,Bh=U.enum(["passed","partial","failed"]),Kh=U.object({landing_page_mode:U.enum(["intent_dynamic","static","none"]),ab_test_enabled:U.boolean()}).strict(),zh=U.union([U.boolean(),U.number().finite(),Bh,Kh]).nullable(),Hh=U.union([U.boolean(),U.number().finite()]).nullable(),$h=U.object({competitor_avg:U.number().finite(),score_items:U.record(U.string(),zh),penalty_items:U.record(U.string(),Hh),red_texts:U.array(U.string())}).strict(),Vh=U.record(To,$h),Yh=U.object({key:To,score:Oe,pass_score:Oe,gap:Oe}),Xh=U.object({key:U.string(),title:U.string(),is_redline_option:U.boolean().optional(),score:Oe,max_score:qh,pass_score:Oe,passed:U.boolean(),description:U.string()}),Qh=U.object({key:To,title:U.string(),alias:U.string(),slogan:U.string(),score:Oe,max_score:U.literal(100),pass_score:Oe,competitor_average:Oe,status:U.enum(["reached","near","not_reached"]),status_name:U.enum(["\u8FBE\u6807","\u63A5\u8FD1","\u672A\u8FBE\u6807"]),summary:U.string(),sub_dimensions:U.array(Xh),red_texts:U.array(U.string()),redline_hit:U.boolean().optional()}),Zh=U.object({id:U.number().int().positive(),task_code:U.string().min(1).max(128),is_sync:U.literal(0),status:U.literal("succeeded"),rules:Vh,scores_list:U.object({overview:U.object({pass_scores:U.object({reach:Oe,trust:Oe,convert:Oe,safe:Oe}),total_score:Oe,total_pass_score:Oe,score_gap:Oe,competitor_average_score:Oe,scoring_criteria_text:U.string().min(1),gap_dimensions:U.array(Yh).max(4),overall_passed:U.boolean(),all_scores_passed:U.boolean(),diagnosis_passed:U.boolean(),commitment_eligible:U.boolean(),safe_redline_hit:U.boolean()}),dimensions:U.array(Qh).length(4)}),created_at:U.string().datetime({offset:!0}),updated_at:U.string().datetime({offset:!0})}).superRefine((e,n)=>{Jh(e.scores_list.dimensions)||n.addIssue({code:"custom",path:["scores_list","dimensions"],message:"dimensions must include each canonical score dimension."}),e.scores_list.dimensions.reduce((i,o)=>i+o.sub_dimensions.length,0)!==Wh&&n.addIssue({code:"custom",path:["scores_list","dimensions"],message:"dimensions must include 17 subdimensions in total."});for(let[i,o]of e.scores_list.dimensions.entries()){if(o.redline_hit===void 0)continue;let a=o.sub_dimensions.findIndex(c=>c.is_redline_option===void 0);a!==-1&&n.addIssue({code:"custom",path:["scores_list","dimensions",i,"sub_dimensions",a,"is_redline_option"],message:"subdimensions must define is_redline_option when redline_hit is defined."})}}),qw=M(Zh);function Jh(e){let n=e.map(s=>s.key);return n.length===Io.length&&new Set(n).size===Io.length&&Io.every(s=>n.includes(s))}var At={queued:["preparing_source","lock_failed","deploy_failed"],preparing_source:["building","source_prepare_failed","deploy_failed"],building:["artifact_ready","build_failed","artifact_fetch_failed","artifact_validation_failed","deploy_failed"],artifact_ready:["deploying","deploy_failed"],deploying:["released","deploy_failed"],released:[],lock_failed:[],source_prepare_failed:[],build_failed:[],artifact_fetch_failed:[],artifact_validation_failed:[],deploy_failed:[],cleanup_failed:[]};for(let e of Object.values(At))Object.freeze(e);Object.freeze(At);var Kw=Object.freeze(Qt.filter(e=>At[e].length>0)),zw=Object.freeze(Qt.filter(e=>At[e].length===0)),eS=Object.freeze(["preparing_source","building","artifact_ready","deploying","released"]),tS="DEPLOYMENT_TRANSITION_INVALID",ko=class extends Error{constructor(n,s){super(`Invalid deployment transition: ${n} -> ${s}`),this.currentStatus=n,this.nextStatus=s,this.code=tS,this.name="DeploymentTransitionError"}};function Hw(e){return At[e]}function $w(e){return Qt.filter(n=>At[n].some(s=>s===e))}function nS(e){return At[e].length>0}function Vw(e){return!nS(e)}function Yw(e,n){if(!At[e].some(s=>s===n))throw new ko(e,n);return n}function Xw(){return eS}import{converter as sS,formatHex as iS,parse as oS,wcagContrast as Jw}from"culori";var eC=sS("oklch");var T={paper:"oklch(0.92 0.008 250)",cream:"oklch(0.90 0.035 85)",sand:"oklch(0.75 0.05 78)",stone:"oklch(0.60 0.02 75)",ash:"oklch(0.60 0.012 250)",slate:"oklch(0.45 0.025 250)",charcoal:"oklch(0.30 0.015 255)",ink:"oklch(0.25 0.04 260)",sky:"oklch(0.72 0.12 230)",blue:"oklch(0.58 0.17 250)","medical blue":"oklch(0.58 0.12 235)",indigo:"oklch(0.50 0.18 280)",navy:"oklch(0.40 0.10 258)",ocean:"oklch(0.55 0.13 220)","slate blue":"oklch(0.46 0.06 245)",teal:"oklch(0.60 0.12 195)","soft aqua":"oklch(0.78 0.07 190)",mint:"oklch(0.78 0.10 165)",sage:"oklch(0.65 0.05 145)",green:"oklch(0.58 0.15 145)","clinical green":"oklch(0.62 0.12 155)",emerald:"oklch(0.60 0.16 155)",forest:"oklch(0.45 0.10 145)",olive:"oklch(0.58 0.08 115)",lime:"oklch(0.72 0.17 130)",yellow:"oklch(0.82 0.15 100)",gold:"oklch(0.72 0.14 85)",amber:"oklch(0.70 0.16 70)",orange:"oklch(0.66 0.18 55)",coral:"oklch(0.68 0.16 32)",terracotta:"oklch(0.55 0.12 42)",rust:"oklch(0.50 0.13 38)",brown:"oklch(0.45 0.07 55)",rose:"oklch(0.65 0.16 18)",red:"oklch(0.58 0.20 25)",crimson:"oklch(0.52 0.20 22)",wine:"oklch(0.42 0.13 18)",pink:"oklch(0.72 0.14 0)",magenta:"oklch(0.60 0.22 345)",lavender:"oklch(0.72 0.08 295)",violet:"oklch(0.58 0.19 295)",purple:"oklch(0.52 0.19 305)",plum:"oklch(0.45 0.13 325)",electric:"oklch(0.62 0.23 285)","clean white":"oklch(0.97 0.01 245)","cool gray":"oklch(0.62 0.02 245)",zinc:"oklch(0.60 0.012 250)",gray:"oklch(0.60 0.012 250)",grey:"oklch(0.60 0.012 250)",neutral:"oklch(0.60 0.005 250)",gunmetal:"oklch(0.30 0.015 255)"},aS={\u84DD:T.blue,\u84DD\u8272:T.blue,\u5929\u84DD:T.sky,\u5929\u84DD\u8272:T.sky,\u6D45\u84DD:T.sky,\u6E56\u84DD:T.ocean,\u6D77\u84DD:T.ocean,\u6DF1\u84DD:T.navy,\u85CF\u84DD:T.navy,\u85CF\u9752:T.navy,\u6D77\u519B\u84DD:T.navy,\u6DF1\u6D77\u519B\u84DD:T.navy,\u5348\u591C\u84DD:T.navy,\u975B\u84DD:T.indigo,\u975B\u9752:T.indigo,\u94A2\u84DD:T["slate blue"],\u9752:T.teal,\u9752\u8272:T.teal,\u84DD\u7EFF:T.teal,\u7EFF:T.green,\u7EFF\u8272:T.green,\u6D45\u7EFF:T.mint,\u8584\u8377\u7EFF:T.mint,\u8349\u7EFF:T.lime,\u6A44\u6984\u7EFF:T.olive,\u58A8\u7EFF:T.forest,\u6DF1\u7EFF:T.forest,\u68EE\u6797\u7EFF:T.forest,\u7FE0\u7EFF:T.emerald,\u7956\u6BCD\u7EFF:T.emerald,\u9EC4:T.yellow,\u9EC4\u8272:T.yellow,\u91D1:T.gold,\u91D1\u8272:T.gold,\u91D1\u9EC4:T.gold,\u7425\u73C0:T.amber,\u7425\u73C0\u8272:T.amber,\u6A59:T.orange,\u6A59\u8272:T.orange,\u6A58\u8272:T.orange,\u6A58\u9EC4:T.orange,\u6D3B\u529B\u6A59:T.orange,\u6696\u6A59:T.orange,\u73CA\u745A:T.coral,\u73CA\u745A\u6A59:T.coral,\u9676\u571F:T.terracotta,\u8D64\u9676:T.terracotta,\u9508\u7EA2:T.rust,\u68D5:T.brown,\u68D5\u8272:T.brown,\u8910\u8272:T.brown,\u5496\u5561\u8272:T.brown,\u7EA2:T.red,\u7EA2\u8272:T.red,\u6731\u7EA2:T.red,\u7EEF\u7EA2:T.crimson,\u6DF1\u7EA2:T.crimson,\u9152\u7EA2:T.wine,\u73AB\u7470:T.rose,\u73AB\u7EA2:T.rose,\u7C89:T.pink,\u7C89\u8272:T.pink,\u7C89\u7EA2:T.pink,\u6D0B\u7EA2:T.magenta,\u54C1\u7EA2:T.magenta,\u7D2B:T.purple,\u7D2B\u8272:T.purple,\u6DE1\u7D2B:T.lavender,\u85B0\u8863\u8349:T.lavender,\u7D2B\u7F57\u5170:T.violet,\u6885\u7EA2:T.plum,\u7070:T.gray,\u7070\u8272:T.gray,\u6D45\u7070:T.gray,\u6DE1\u7070:T.gray,\u51B7\u7070:T["cool gray"],\u51B7\u7070\u767D:T["cool gray"],\u6696\u7070:T.stone,\u6DF1\u7070:T.slate,\u77F3\u58A8\u7070:T.slate,\u77F3\u677F\u7070:T.slate,\u70AD\u7070:T.charcoal,\u70AD\u9ED1:T.charcoal,\u58A8:T.ink,\u58A8\u8272:T.ink,\u9ED1:T.ink,\u9ED1\u8272:T.ink,\u767D:T["clean white"],\u767D\u8272:T["clean white"],\u7C73\u767D:T.cream,\u7C73\u8272:T.cream,\u8C61\u7259\u767D:T.cream,\u5976\u6CB9\u767D:T.cream,\u6C99\u8272:T.sand},tC={...T,...aS};function Ao(e){let n=oS(e.trim());return n?iS(n)??null:null}var St={Inter:{import:"Inter"},"Inter Tight":{import:"Inter_Tight"},"DM Sans":{import:"DM_Sans"},"Source Sans 3":{import:"Source_Sans_3"},"Libre Franklin":{import:"Libre_Franklin"},Montserrat:{import:"Montserrat"},Archivo:{import:"Archivo"},"Space Grotesk":{import:"Space_Grotesk"},Manrope:{import:"Manrope"},"IBM Plex Sans":{import:"IBM_Plex_Sans"},Oswald:{import:"Oswald"},"Roboto Condensed":{import:"Roboto_Condensed"},"Bebas Neue":{import:"Bebas_Neue",weights:["400"]},"Playfair Display":{import:"Playfair_Display"},Lora:{import:"Lora"},Fraunces:{import:"Fraunces"},"Cormorant Garamond":{import:"Cormorant_Garamond"},"JetBrains Mono":{import:"JetBrains_Mono"},"IBM Plex Mono":{import:"IBM_Plex_Mono",weights:["400","500","600","700"]},"Noto Sans SC":{import:"Noto_Sans_SC",download:!1},"Noto Serif SC":{import:"Noto_Serif_SC",download:!1}},rS={heading:"Inter",body:"Inter"},tm=St.Inter;function Gs(e){return e.trim().replace(/\s+/g,"_").toLowerCase()}var om=(()=>{let e=new Map;for(let[n,s]of Object.entries(St))e.set(Gs(n),s),e.set(Gs(s.import),s);return e})();function cS(e){return typeof e!="string"||e.trim().length===0?tm:om.get(Gs(e))??tm}var mS=(()=>{let e=new Map;for(let[n,s]of Object.entries(St))e.set(s.import,n);return e})();function an(e){if(typeof e!="string"||e.trim().length===0)return"Inter";let n=om.get(Gs(e));return n?mS.get(n.import)??"Inter":"Inter"}var lS=Object.keys(St),nm='ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',sm='Georgia, "Times New Roman", serif',im='"SFMono-Regular", Consolas, monospace',pS=new Set(["serif","sans-serif","sans serif","monospace","mono","cursive","fantasy","system-ui","ui-serif","ui-sans-serif","ui-monospace"]),dS=new Set(["Playfair Display","Lora","Fraunces","Cormorant Garamond","Noto Serif SC"].map(e=>e.toLowerCase())),uS=new Set(["JetBrains Mono","IBM Plex Mono"].map(e=>e.toLowerCase()));function _S(e){let n=e.toLowerCase();return uS.has(n)||n.includes("mono")?"mono":dS.has(n)||n.includes("serif")?"serif":"sans"}function Po(e,n){let s=m=>(m??"").trim().replace(/^['"]|['"]$/g,"").replace(/[^A-Za-z0-9 _-]+/g,"").trim().slice(0,60),i=s(e),o=s(n),a=m=>pS.has(m.toLowerCase());if(i&&a(i)){let m=i.toLowerCase();return m.includes("mono")?im:m.includes("serif")?sm:nm}let c=i;c||(c=a(o)?"":o),c||(c="Inter");let r=_S(c);return r==="mono"?`"${c}", ${im}`:r==="serif"?`"${c}", ${sm}`:`"${c}", ${nm}`}function gS(e){return{"--site-font-sans":Po(e?.body,"Inter"),"--site-font-heading":Po(e?.heading,e?.body??"Inter")}}var wo=["archivo-inter","playfair-source-sans","space-grotesk-manrope","fraunces-libre-franklin","noto-serif-sc-noto-sans-sc","noto-sans-sc"],am=[{id:"archivo-inter",heading:"Archivo",body:"Inter"},{id:"playfair-source-sans",heading:"Playfair Display",body:"Source Sans 3"},{id:"space-grotesk-manrope",heading:"Space Grotesk",body:"Manrope"},{id:"fraunces-libre-franklin",heading:"Fraunces",body:"Libre Franklin"},{id:"noto-serif-sc-noto-sans-sc",heading:"Noto Serif SC",body:"Noto Sans SC"},{id:"noto-sans-sc",heading:"Noto Sans SC",body:"Noto Sans SC"}];function rm(e){let n=am.find(s=>s.id===e);if(!n)throw new Error(`Unknown font pairing: ${e}`);return n}import{z as rn}from"zod";import{z as hS}from"zod";var SS=["light","standard","bold"],Be=hS.enum(SS),qs="standard",fS=new Set(["display","heading","title"]),cm={light:{display:300,heading:400,title:400,ui:400,button:400,body:400,strong:600},standard:{display:600,heading:500,title:500,ui:400,button:500,body:400,strong:600},bold:{display:700,heading:700,title:700,ui:400,button:600,body:400,strong:700}},aC=Object.keys(cm.standard).map(e=>`--site-weight-${e}`),rC="--site-leading-body",cC=["--site-leading-display","--site-leading-heading","--site-leading-title"];function et(e,n){let s=[];for(let i=e;i<=n;i+=100)s.push(i);return s}var bS={"Source Sans 3":et(200,900),"Space Grotesk":et(300,700),Manrope:et(200,800),"IBM Plex Sans":et(100,700),Oswald:et(200,700),"Bebas Neue":[400],"Playfair Display":et(400,900),Lora:et(400,700),"Cormorant Garamond":et(300,700),"JetBrains Mono":et(100,800),"IBM Plex Mono":[400,500,600,700],"DM Sans":et(100,1e3)};function Co(e){return e.trim().replace(/\s+/g,"_").toLowerCase()}var yS=new Set(Object.entries(St).flatMap(([e,n])=>[Co(e),Co(n.import)]));function vo(e){if(!(e in St)&&!yS.has(Co(e)))return null;let n=an(e);return St[n].download===!1?null:bS[n]??et(100,900)}function mm(e,n){return!n||n.length===0?e:n.reduce((s,i)=>Math.abs(i-e)<Math.abs(s-e)?i:s,n[0])}function mC(e,n){let s=cm[e??qs],i=n?.heading?vo(n.heading):null,o=n?.body?vo(n.body):null,a={};for(let c of Object.keys(s)){let r=fS.has(c)?i:o;a[`--site-weight-${c}`]=String(mm(s[c],r))}return a}var xS=/^(zh|ja|ko)(?:[-_]|$)/i,ES=/^(ar|fa|hi|bn|ta|si|th|lo|km|my|vi)(?:[-_]|$)/i;function lm(e){return xS.test(e??"")?"dense":ES.test(e??"")?"tall":"default"}function RS(e){return lm(e)==="dense"?"1.75":"1.5"}var IS={default:["1.1","1.2","1.3"],dense:["1.2","1.3","1.4"]};function lC(e){let n=lm(e),s=RS(e),[i,o,a]=n==="tall"?[s,s,s]:IS[n];return{"--site-leading-display":i,"--site-leading-heading":o,"--site-leading-title":a}}function pC(e,n){let s=vo(e);return[...new Set(n.map(o=>mm(o,s)))].sort((o,a)=>o-a).map(String)}var cn="/* <cms-builder:site-design-notes>",zt="</cms-builder:site-design-notes> */",Do="palette-inputs: ",Oo="type-inputs: ",Pt=rn.string().min(1).max(40),No=rn.object({primarySource:rn.enum(["user","derived"]),neutral:Pt.optional(),foreground:Pt.optional(),supporting:rn.array(Pt).max(4).optional(),imagePalette:rn.object({background:Pt.optional(),foreground:Pt.optional(),card:Pt.optional(),muted:Pt.optional(),border:Pt.optional()}).optional()}),TS=rn.object({weightStyle:Be}),kS=e=>e.replaceAll("*/","* /").replace(/\s+/g," ").trim();function AS(e){let n=e.lines.map(kS).filter(Boolean).map(s=>` ${s}`);return e.paletteInputs&&n.push(` ${Do}${JSON.stringify(e.paletteInputs).replaceAll("*/","* /")}`),e.typeInputs&&n.push(` ${Oo}${JSON.stringify(e.typeInputs).replaceAll("*/","* /")}`),[cn,...n,` ${zt}`].join(`
|
|
2
|
+
`)}function jo(e){let n=e.indexOf(cn),s=e.indexOf(zt,n+1);return n===-1||s===-1?null:{start:n,end:s+zt.length}}function gC(e){let n=jo(e);if(!n)return e;let s=e.slice(0,n.start),i=e.slice(n.end);return s?(s.endsWith(`
|
|
3
3
|
`)&&(s=s.slice(0,-1)),i.startsWith(`
|
|
4
4
|
`)&&(i=i.slice(1))):i.startsWith(`
|
|
5
5
|
|
|
6
|
-
`)&&(i=i.slice(2)),s+i}function
|
|
7
|
-
`).map(r=>r.trim()).filter(Boolean))c.startsWith(
|
|
6
|
+
`)&&(i=i.slice(2)),s+i}function PS(e){try{let n=JSON.parse(e),s=No.safeParse(n);return s.success?s.data:null}catch{return null}}function wS(e){try{let n=JSON.parse(e),s=TS.safeParse(n);return s.success?s.data:void 0}catch{return}}function pm(e){let n=jo(e);if(!n)return null;let s=e.slice(n.start+cn.length,n.end-zt.length),i=[],o=null,a;for(let c of s.split(`
|
|
7
|
+
`).map(r=>r.trim()).filter(Boolean))c.startsWith(Do)?o=PS(c.slice(Do.length)):c.startsWith(Oo)?a=wS(c.slice(Oo.length)):i.push(c);return{lines:i,paletteInputs:o,...a?{typeInputs:a}:{}}}function hC(e,n){let s=AS(n),i=jo(e);if(i)return e.slice(0,i.start)+s+e.slice(i.end);let a=[...e.matchAll(/^@import[^\n]*\n/gm)].at(-1);if(!a||a.index===void 0)return`${s}
|
|
8
8
|
|
|
9
9
|
${e}`;let c=a.index+a[0].length;return`${e.slice(0,c)}
|
|
10
10
|
${s}
|
|
11
|
-
${e.slice(c)}`}var cn="/* <cms-builder:global-design-tokens> */",Kn="/* </cms-builder:global-design-tokens> */",Fe=class extends Error{constructor(n,s){super(`${n}: ${s}`),this.code=n,this.name="DesignTokenBlockError"}};function kS(e){let n=[],s=0;for(;s<e.length;){let i=e.indexOf(cn,s),o=e.indexOf(Kn,s);if(i<0){if(o>=0)throw new Fe("DESIGN_TOKEN_BLOCK_MISSING","a closing global-design-tokens marker appears without a matching opening marker.");break}if(o<0||o<i)throw new Fe("DESIGN_TOKEN_BLOCK_MISSING","a global-design-tokens region is opened but never closed.");let a=i+cn.length,c=e.indexOf(cn,a);if(c>=0&&c<o)throw new Fe("DESIGN_TOKEN_BLOCK_MISSING","global-design-tokens regions are nested; refusing to guess the intended boundaries.");n.push({bodyStart:a,bodyEnd:o}),s=o+Kn.length}if(n.length===0)throw new Fe("DESIGN_TOKEN_BLOCK_MISSING","app/globals.css does not contain a cms-builder:global-design-tokens region.");return n}var AS=/^--[A-Za-z0-9_-]+/;function PS(e){return e===void 0||e==="{"||e==="}"||e===";"||/\s/.test(e)}function lm(e,n,s){let i=[],o=n,a=0;for(;o<s;){let c=e[o];if(c==="/"&&e[o+1]==="*"){let r=e.indexOf("*/",o+2);o=r<0||r>=s?s:r+2;continue}if(c==='"'||c==="'"){o=pm(e,o,s);continue}if(c==="("){a+=1,o+=1;continue}if(c===")"){a=Math.max(0,a-1),o+=1;continue}if(c==="-"&&a===0&&e[o+1]==="-"&&PS(o===0?void 0:e[o-1])){let r=AS.exec(e.slice(o,s));if(r){let m=r[0],x=o+m.length;for(;x<s&&(e[x]===" "||e[x]===" ");)x+=1;if(e[x]===":"){for(x+=1;x<s&&(e[x]===" "||e[x]===" ");)x+=1;let _=x,w=wS(e,_,s),z=e.slice(_,w).trimEnd();i.push({name:m,value:z.trim(),valueStart:_,valueEnd:_+z.length}),o=w;continue}}}o+=1}return i}function pm(e,n,s){let i=e[n],o=n+1;for(;o<s;){let a=e[o];if(a==="\\"){o+=2;continue}if(a===i)return o+1;o+=1}return s}function wS(e,n,s){let i=n,o=0;for(;i<s;){let a=e[i];if(a==="\\"){i+=2;continue}if(a==='"'||a==="'"){i=pm(e,i,s);continue}if(a==="/"&&e[i+1]==="*"){let c=e.indexOf("*/",i+2);i=c<0||c>=s?s:c+2;continue}if(a==="(")o+=1;else if(a===")")o=Math.max(0,o-1);else if(o===0&&(a===";"||a==="}"))return i;i+=1}return s}function dm(e){return kS(e).flatMap(n=>lm(e,n.bodyStart,n.bodyEnd))}function CS(e){return new Set(lm(e,0,e.length).map(n=>n.name))}var vS=/[;{}]|\/\*|\*\/|[\r\n]/;function DS(e,n){if(n.trim().length===0)throw new Fe("DESIGN_TOKEN_UNSAFE_VALUE",`refusing to write an empty declaration value for ${e}.`);if(vS.test(n))throw new Fe("DESIGN_TOKEN_UNSAFE_VALUE",`refusing to write a declaration value for ${e} that contains a declaration or block terminator, a comment marker, or a newline.`)}function Gs(e){let n=new Map;for(let s of dm(e))n.set(s.name,s.value);return n}function _C(e,n,s={}){let i=dm(e),o=new Set(i.map(_=>_.name)),a=new Set,c=new Set,r=[],m=null;for(let _ of n.keys())if(!o.has(_)){if(s.derivedKeys?.has(_)!==!0){r.push(_);continue}m??=CS(e),m.has(_)?c.add(_):a.add(_)}if(r.length>0)throw new Fe("DESIGN_TOKEN_UNKNOWN",`refusing to add token names that the shared derivation never produces: ${r.join(", ")}`);for(let[_,w]of n)o.has(_)&&DS(_,w);for(let _ of a)s.onOutOfScopeToken?.(_);for(let _ of c)s.onUnwritableToken?.(_);let x=e;for(let _=i.length-1;_>=0;_-=1){let w=i[_],B=n.get(w.name);B!==void 0&&(x=x.slice(0,w.valueStart)+B+x.slice(w.valueEnd))}return x}function zn(e){let n=e.indexOf(cn),s=e.indexOf(Kn);return n!==-1&&s!==-1&&s>n}var um=/(color-scheme:\s*)(light|dark)(\s*;)/;function OS(e){let n=e.indexOf(cn),s=e.indexOf(Kn);return n!==-1&&s>n?e.slice(n,s):null}function NS(e){let s=OS(e)?.match(um);return s?s[2]:null}function gC(e,n){let s=e.indexOf(cn),i=e.indexOf(Kn);if(s===-1||i===-1||i<s)throw new Fe("DESIGN_TOKEN_BLOCK_MISSING","globals.css has no design token block");let o=e.slice(s,i);return e.slice(0,s)+o.replace(um,`$1${n}$3`)+e.slice(i)}var jS=/["']([^"']+)["']/;function mm(e){return e?.match(jS)?.[1]??null}function hC(e){if(!zn(e))return null;let n;try{n=Gs(e)}catch(m){if(m instanceof Fe)return null;throw m}let s=To(n.get("--primary")??"")?.toLowerCase()??null,i=To(n.get("--accent")??"")?.toLowerCase()??null,o=mm(n.get("--site-font-heading")),a=mm(n.get("--site-font-sans")),c=cm(e),r=c?.paletteInputs??null;return{primary:s,accent:i,...r?.foreground!==void 0?{foreground:r.foreground}:{},...r?.neutral!==void 0?{neutral:r.neutral}:{},...r?.supporting!==void 0?{supporting:r.supporting}:{},...r?.imagePalette!==void 0?{imagePalette:r.imagePalette}:{},surfaceMode:NS(e),fonts:o&&a?{heading:on(o),body:on(a)}:null,paletteInputs:r,paletteInputsPresent:r!=null,notesLines:c?.lines??null,weightStyle:n.has("--site-weight-display")&&c?.typeInputs?c.typeInputs.weightStyle:null}}var qs=(e,n)=>e.split(n).length-1;function LS(e){let n=0,s=0,i=0,o=e.length;for(;i<o;){let a=e[i];if(a==="/"&&e[i+1]==="*"){let c=e.indexOf("*/",i+2);i=c===-1?o:c+2;continue}if(a==='"'||a==="'"){let c=a;for(i+=1;i<o;){if(e[i]==="\\"){i+=2;continue}if(e[i]===c){i+=1;break}i+=1}continue}a==="{"?n+=1:a==="}"&&(s+=1),i+=1}return{open:n,close:s}}var _m=e=>{let{open:n,close:s}=LS(e);return n===s};function yC(e,n){if(_m(e)&&!_m(n))return{ok:!1,code:"GLOBALS_CSS_UNBALANCED",message:"app/globals.css has unbalanced braces."};if(zn(e)&&!zn(n))return{ok:!1,code:"GLOBALS_CSS_TOKEN_BLOCK_MISSING",message:"Keep the /* <cms-builder:global-design-tokens> */ and /* </cms-builder:global-design-tokens> */ markers in app/globals.css."};if(qs(e,rn)===qs(e,Kt)&&qs(n,rn)!==qs(n,Kt))return{ok:!1,code:"GLOBALS_CSS_NOTES_UNPAIRED",message:"The site design notes comment must keep both of its markers."};if(zn(e)){let i=null;try{i=Gs(e)}catch(a){if(!(a instanceof Fe))throw a}let o;try{o=Gs(n)}catch(a){if(a instanceof Fe)return{ok:!1,code:"GLOBALS_CSS_TOKEN_BLOCK_MALFORMED",message:`app/globals.css design token block is malformed: ${a.message}`};throw a}if(i){let a=[...i.keys()].filter(c=>!o.has(c));if(a.length>0)return{ok:!1,code:"GLOBALS_CSS_TOKEN_REMOVED",message:`Do not delete design tokens from app/globals.css; change their values instead. Removed: ${a.slice(0,8).join(", ")}`}}}return{ok:!0}}import{z as q}from"zod";var AC="x-vcp-run-lease-owner",PC=600*1e3,wC=60*1e3,CC=3,vC=2,DC="WORKSPACE_RUN_RESUME_EXHAUSTED",OC="WORKSPACE_CHECK_INCOMPLETE",NC="WORKSPACE_GENERATION_STOPPED",jC="WORKSPACE_FILL_IN_INTERRUPTED",LC="WORKSPACE_RUN_LEASE_SUPERSEDED",MC="WORKSPACE_RUN_NOT_ACTIVE",UC="FILL_IN_NOT_AVAILABLE",FC="FILL_IN_TARGET_NOT_OMITTED",GC="FILL_IN_TARGET_MODIFIED",MS=q.object({authMode:q.enum(["disabled-dev","internal-service","oidc"]),user_id:q.string().min(1),external_user_id:q.string().min(1).optional(),email:q.string().min(1).optional(),display_name:q.string().min(1).optional()}).strict(),qC=q.object({run_id:$,lease_owner:q.string().min(1),lease_ms:q.number().int().positive().max(1800*1e3).optional()}).strict(),WC=q.object({status:q.enum(["renewed","not_active","superseded"]),expires_at:q.string().min(1).nullable(),stop_requested:q.boolean()}).strict(),gm=q.object({run_id:$,page_id:q.string().min(1),attempt:q.number().int().positive(),snapshot_id:I,object_key:q.string().min(1),manifest_hash:q.string().min(1),file_paths:q.array(q.string().min(1)).min(1),created_at:q.string().min(1)}).strict(),BC=gm.omit({created_at:!0}).extend({lease_owner:q.string().min(1)}).strict(),KC=q.object({checkpoints:q.array(gm)}).strict(),hm=q.object({kind:q.enum(["page","component","shared"]),target_id:q.string().min(1)}).strict(),zC=q.object({run_id:$,site_id:k,tenant_id:q.string().min(1),run_kind:q.enum(["initial_generation","iteration","landing_page","fill_in"]),status:q.enum(["queued","running","succeeded","failed","cancelled"]),base_snapshot_id:I.nullable(),lease_owner:q.string().min(1).nullable(),resume_count:q.number().int().nonnegative(),stop_requested:q.boolean(),reuse_from_run_id:$.nullable(),source_run_id:$.nullable(),fill_in_targets:q.array(hm),execution_scene:ki.nullable().optional(),intent:q.literal("navigation_adaptation").optional(),page_template_manifest:mr.nullable().optional()}).strict().superRefine((e,n)=>{e.execution_scene==="page_template_create"?(e.run_kind!=="iteration"||!e.page_template_manifest)&&n.addIssue({code:"custom",message:"Page Template execution requires an iteration run with its authoritative manifest"}):e.page_template_manifest&&n.addIssue({code:"custom",message:"Only Page Template execution has a batch manifest"})}),HC=q.object({runs:q.array(q.object({run_id:$,site_id:k,tenant_id:q.string().min(1),run_kind:q.literal("initial_generation"),base_snapshot_id:I,sitemap_id:Ae,resume_count:q.number().int().nonnegative(),lease_owner:q.string().min(1),stop_requested:q.boolean(),resume_principal:MS}).strict())}).strict(),$C=q.object({site_id:k}).strict(),VC=q.object({status:q.enum(["requested","already_requested","stopped","no_active_run"]),run_id:$.nullable()}).strict(),YC=q.object({ledger:Pn.nullable(),source_run_id:$.nullable(),updated_at:q.string().min(1).nullable()}).strict(),XC=q.object({targets:q.array(hm).min(1).max(50),client_run_key:q.string().min(1).max(400)}).strict();import{z as US}from"zod";var JC=".i18n.json",Ws="translation",Sm=new Set(["__proto__","constructor","prototype"]);function bm(e){if(!Bs(e)||Object.keys(e).length===0)return Pt("I18N_ROOT_INVALID","Component i18n resources must be a non-empty object.",[]);for(let[n,s]of Object.entries(e)){if(Sm.has(n))return fm([n]);if(!FS(n))return Pt("I18N_LOCALE_INVALID",`Component i18n locale must be canonical BCP-47: ${n}`,[n]);if(!Bs(s))return Pt("I18N_NAMESPACE_INVALID",`Component i18n locale ${n} must contain only the translation namespace.`,[n]);let i=Object.keys(s);if(i.length!==1||i[0]!==Ws)return Pt("I18N_NAMESPACE_INVALID",`Component i18n locale ${n} must contain only the translation namespace.`,[n]);let o=s[Ws];if(!Bs(o))return Pt("I18N_RESOURCE_TREE_INVALID",`Component i18n translation namespace for ${n} must be an object.`,[n,Ws]);let a=[{value:o,path:[n,Ws]}];for(;a.length>0;){let c=a.pop();for(let[r,m]of Object.entries(c.value)){let x=[...c.path,r];if(Sm.has(r))return fm(x);if(typeof m!="string"){if(!Bs(m))return Pt("I18N_RESOURCE_TREE_INVALID","Component i18n resource leaves must be strings.",x);a.push({value:m,path:x})}}}}return{success:!0,data:e}}function ev(e){let n;try{n=JSON.parse(e)}catch{return Pt("I18N_JSON_INVALID","Component i18n resource file must contain valid JSON.",[])}return bm(n)}var tv=US.custom(e=>bm(e).success,"Invalid component i18n resources.");function FS(e){try{let n=Intl.getCanonicalLocales(e);return n.length===1&&n[0]===e}catch{return!1}}function Bs(e){if(typeof e!="object"||e===null||Array.isArray(e))return!1;let n=Object.getPrototypeOf(e);return n===Object.prototype||n===null}function fm(e){return Pt("I18N_RESOURCE_KEY_FORBIDDEN",`Component i18n resource key is forbidden: ${e.at(-1)??""}`,e)}function Pt(e,n,s){return{success:!1,error:{code:e,message:n,path:s}}}var St="products",GS=`/${St}`,sv=GS,iv=`${St} detail`,ov="cms_collection_view",av="list",rv="detail",ze={zhHans:{pageTitle:"\u4EA7\u54C1\u4E2D\u5FC3",blockLabel:"\u4EA7\u54C1\u6982\u89C8",detailBlockLabel:"\u4EA7\u54C1\u8BE6\u60C5",heroBlockLabel:"\u4EA7\u54C1\u7B80\u4ECB",homeLabel:"\u9996\u9875"},zhHant:{pageTitle:"\u7522\u54C1\u4E2D\u5FC3",blockLabel:"\u7522\u54C1\u6982\u89BD",detailBlockLabel:"\u7522\u54C1\u8A73\u60C5",heroBlockLabel:"\u7522\u54C1\u7C21\u4ECB",homeLabel:"\u9996\u9801"},en:{pageTitle:"Products",blockLabel:"Products overview",detailBlockLabel:"Product details",heroBlockLabel:"Products Introduction",homeLabel:"Home"},de:{pageTitle:"Produkte",blockLabel:"Produkt\xFCbersicht",detailBlockLabel:"Produktdetails",heroBlockLabel:"Produkteinf\xFChrung",homeLabel:"Startseite"},fr:{pageTitle:"Produits",blockLabel:"Aper\xE7u des produits",detailBlockLabel:"D\xE9tails du produit",heroBlockLabel:"Pr\xE9sentation des produits",homeLabel:"Accueil"},es:{pageTitle:"Productos",blockLabel:"Resumen de productos",detailBlockLabel:"Detalles del producto",heroBlockLabel:"Introducci\xF3n de productos",homeLabel:"Inicio"},ja:{pageTitle:"\u88FD\u54C1",blockLabel:"\u88FD\u54C1\u6982\u8981",detailBlockLabel:"\u88FD\u54C1\u8A73\u7D30",heroBlockLabel:"\u88FD\u54C1\u7D39\u4ECB",homeLabel:"\u30DB\u30FC\u30E0"},ko:{pageTitle:"\uC81C\uD488",blockLabel:"\uC81C\uD488 \uAC1C\uC694",detailBlockLabel:"\uC81C\uD488 \uC0C1\uC138",heroBlockLabel:"\uC81C\uD488 \uC18C\uAC1C",homeLabel:"\uD648"},ru:{pageTitle:"\u041F\u0440\u043E\u0434\u0443\u043A\u0446\u0438\u044F",blockLabel:"\u041E\u0431\u0437\u043E\u0440 \u043F\u0440\u043E\u0434\u0443\u043A\u0446\u0438\u0438",detailBlockLabel:"\u041E \u043F\u0440\u043E\u0434\u0443\u043A\u0442\u0435",heroBlockLabel:"\u041D\u0430\u0448\u0430 \u043F\u0440\u043E\u0434\u0443\u043A\u0446\u0438\u044F",homeLabel:"\u0413\u043B\u0430\u0432\u043D\u0430\u044F"}},qS=new Set(Object.values(ze).map(e=>e.pageTitle)),WS=new Set(Object.values(ze).flatMap(e=>[e.blockLabel,e.detailBlockLabel,e.heroBlockLabel]));function cv(e){let n=e?.trim().toLowerCase()??"";if(n==="zh-tw"||n==="zh-hk"||n==="zh-mo")return ze.zhHant;if(n.startsWith("zh"))return ze.zhHans;switch(n.split("-")[0]){case"de":return ze.de;case"fr":return ze.fr;case"es":return ze.es;case"ja":return ze.ja;case"ko":return ze.ko;case"ru":return ze.ru;case"en":default:return ze.en}}function mv(){return Object.values(ze)}function lv(e){return qS.has(e.trim())}function pv(e){return WS.has(e.trim())}var BS="4rem",KS="0.75rem",zS="2rem";function HS(e){if(e?.variant!=="floating")return"container pt-8";let n=[zS,BS];return e.shape==="island"&&n.push(KS),`container pt-[calc(${n.join("+")})]`}function uv(e){return`// Auto-generated by connect_dynamic_collection \u2014 do not edit by hand.
|
|
11
|
+
${e.slice(c)}`}var mn="/* <cms-builder:global-design-tokens> */",zn="/* </cms-builder:global-design-tokens> */",Ge=class extends Error{constructor(n,s){super(`${n}: ${s}`),this.code=n,this.name="DesignTokenBlockError"}};function CS(e){let n=[],s=0;for(;s<e.length;){let i=e.indexOf(mn,s),o=e.indexOf(zn,s);if(i<0){if(o>=0)throw new Ge("DESIGN_TOKEN_BLOCK_MISSING","a closing global-design-tokens marker appears without a matching opening marker.");break}if(o<0||o<i)throw new Ge("DESIGN_TOKEN_BLOCK_MISSING","a global-design-tokens region is opened but never closed.");let a=i+mn.length,c=e.indexOf(mn,a);if(c>=0&&c<o)throw new Ge("DESIGN_TOKEN_BLOCK_MISSING","global-design-tokens regions are nested; refusing to guess the intended boundaries.");n.push({bodyStart:a,bodyEnd:o}),s=o+zn.length}if(n.length===0)throw new Ge("DESIGN_TOKEN_BLOCK_MISSING","app/globals.css does not contain a cms-builder:global-design-tokens region.");return n}var vS=/^--[A-Za-z0-9_-]+/;function DS(e){return e===void 0||e==="{"||e==="}"||e===";"||/\s/.test(e)}function um(e,n,s){let i=[],o=n,a=0;for(;o<s;){let c=e[o];if(c==="/"&&e[o+1]==="*"){let r=e.indexOf("*/",o+2);o=r<0||r>=s?s:r+2;continue}if(c==='"'||c==="'"){o=_m(e,o,s);continue}if(c==="("){a+=1,o+=1;continue}if(c===")"){a=Math.max(0,a-1),o+=1;continue}if(c==="-"&&a===0&&e[o+1]==="-"&&DS(o===0?void 0:e[o-1])){let r=vS.exec(e.slice(o,s));if(r){let m=r[0],x=o+m.length;for(;x<s&&(e[x]===" "||e[x]===" ");)x+=1;if(e[x]===":"){for(x+=1;x<s&&(e[x]===" "||e[x]===" ");)x+=1;let _=x,w=OS(e,_,s),z=e.slice(_,w).trimEnd();i.push({name:m,value:z.trim(),valueStart:_,valueEnd:_+z.length}),o=w;continue}}}o+=1}return i}function _m(e,n,s){let i=e[n],o=n+1;for(;o<s;){let a=e[o];if(a==="\\"){o+=2;continue}if(a===i)return o+1;o+=1}return s}function OS(e,n,s){let i=n,o=0;for(;i<s;){let a=e[i];if(a==="\\"){i+=2;continue}if(a==='"'||a==="'"){i=_m(e,i,s);continue}if(a==="/"&&e[i+1]==="*"){let c=e.indexOf("*/",i+2);i=c<0||c>=s?s:c+2;continue}if(a==="(")o+=1;else if(a===")")o=Math.max(0,o-1);else if(o===0&&(a===";"||a==="}"))return i;i+=1}return s}function gm(e){return CS(e).flatMap(n=>um(e,n.bodyStart,n.bodyEnd))}function NS(e){return new Set(um(e,0,e.length).map(n=>n.name))}var jS=/[;{}]|\/\*|\*\/|[\r\n]/;function LS(e,n){if(n.trim().length===0)throw new Ge("DESIGN_TOKEN_UNSAFE_VALUE",`refusing to write an empty declaration value for ${e}.`);if(jS.test(n))throw new Ge("DESIGN_TOKEN_UNSAFE_VALUE",`refusing to write a declaration value for ${e} that contains a declaration or block terminator, a comment marker, or a newline.`)}function Ws(e){let n=new Map;for(let s of gm(e))n.set(s.name,s.value);return n}function xC(e,n,s={}){let i=gm(e),o=new Set(i.map(_=>_.name)),a=new Set,c=new Set,r=[],m=null;for(let _ of n.keys())if(!o.has(_)){if(s.derivedKeys?.has(_)!==!0){r.push(_);continue}m??=NS(e),m.has(_)?c.add(_):a.add(_)}if(r.length>0)throw new Ge("DESIGN_TOKEN_UNKNOWN",`refusing to add token names that the shared derivation never produces: ${r.join(", ")}`);for(let[_,w]of n)o.has(_)&&LS(_,w);for(let _ of a)s.onOutOfScopeToken?.(_);for(let _ of c)s.onUnwritableToken?.(_);let x=e;for(let _=i.length-1;_>=0;_-=1){let w=i[_],B=n.get(w.name);B!==void 0&&(x=x.slice(0,w.valueStart)+B+x.slice(w.valueEnd))}return x}function Hn(e){let n=e.indexOf(mn),s=e.indexOf(zn);return n!==-1&&s!==-1&&s>n}var hm=/(color-scheme:\s*)(light|dark)(\s*;)/;function MS(e){let n=e.indexOf(mn),s=e.indexOf(zn);return n!==-1&&s>n?e.slice(n,s):null}function US(e){let s=MS(e)?.match(hm);return s?s[2]:null}function EC(e,n){let s=e.indexOf(mn),i=e.indexOf(zn);if(s===-1||i===-1||i<s)throw new Ge("DESIGN_TOKEN_BLOCK_MISSING","globals.css has no design token block");let o=e.slice(s,i);return e.slice(0,s)+o.replace(hm,`$1${n}$3`)+e.slice(i)}var FS=/["']([^"']+)["']/;function dm(e){return e?.match(FS)?.[1]??null}function RC(e){if(!Hn(e))return null;let n;try{n=Ws(e)}catch(m){if(m instanceof Ge)return null;throw m}let s=Ao(n.get("--primary")??"")?.toLowerCase()??null,i=Ao(n.get("--accent")??"")?.toLowerCase()??null,o=dm(n.get("--site-font-heading")),a=dm(n.get("--site-font-sans")),c=pm(e),r=c?.paletteInputs??null;return{primary:s,accent:i,...r?.foreground!==void 0?{foreground:r.foreground}:{},...r?.neutral!==void 0?{neutral:r.neutral}:{},...r?.supporting!==void 0?{supporting:r.supporting}:{},...r?.imagePalette!==void 0?{imagePalette:r.imagePalette}:{},surfaceMode:US(e),fonts:o&&a?{heading:an(o),body:an(a)}:null,paletteInputs:r,paletteInputsPresent:r!=null,notesLines:c?.lines??null,weightStyle:n.has("--site-weight-display")&&c?.typeInputs?c.typeInputs.weightStyle:null}}var Bs=(e,n)=>e.split(n).length-1;function GS(e){let n=0,s=0,i=0,o=e.length;for(;i<o;){let a=e[i];if(a==="/"&&e[i+1]==="*"){let c=e.indexOf("*/",i+2);i=c===-1?o:c+2;continue}if(a==='"'||a==="'"){let c=a;for(i+=1;i<o;){if(e[i]==="\\"){i+=2;continue}if(e[i]===c){i+=1;break}i+=1}continue}a==="{"?n+=1:a==="}"&&(s+=1),i+=1}return{open:n,close:s}}var Sm=e=>{let{open:n,close:s}=GS(e);return n===s};function AC(e,n){if(Sm(e)&&!Sm(n))return{ok:!1,code:"GLOBALS_CSS_UNBALANCED",message:"app/globals.css has unbalanced braces."};if(Hn(e)&&!Hn(n))return{ok:!1,code:"GLOBALS_CSS_TOKEN_BLOCK_MISSING",message:"Keep the /* <cms-builder:global-design-tokens> */ and /* </cms-builder:global-design-tokens> */ markers in app/globals.css."};if(Bs(e,cn)===Bs(e,zt)&&Bs(n,cn)!==Bs(n,zt))return{ok:!1,code:"GLOBALS_CSS_NOTES_UNPAIRED",message:"The site design notes comment must keep both of its markers."};if(Hn(e)){let i=null;try{i=Ws(e)}catch(a){if(!(a instanceof Ge))throw a}let o;try{o=Ws(n)}catch(a){if(a instanceof Ge)return{ok:!1,code:"GLOBALS_CSS_TOKEN_BLOCK_MALFORMED",message:`app/globals.css design token block is malformed: ${a.message}`};throw a}if(i){let a=[...i.keys()].filter(c=>!o.has(c));if(a.length>0)return{ok:!1,code:"GLOBALS_CSS_TOKEN_REMOVED",message:`Do not delete design tokens from app/globals.css; change their values instead. Removed: ${a.slice(0,8).join(", ")}`}}}return{ok:!0}}import{z as q}from"zod";var NC="x-vcp-run-lease-owner",jC=600*1e3,LC=60*1e3,MC=3,UC=2,FC="WORKSPACE_RUN_RESUME_EXHAUSTED",GC="WORKSPACE_CHECK_INCOMPLETE",qC="WORKSPACE_GENERATION_STOPPED",WC="WORKSPACE_FILL_IN_INTERRUPTED",BC="WORKSPACE_RUN_LEASE_SUPERSEDED",KC="WORKSPACE_RUN_NOT_ACTIVE",zC="FILL_IN_NOT_AVAILABLE",HC="FILL_IN_TARGET_NOT_OMITTED",$C="FILL_IN_TARGET_MODIFIED",qS=q.object({authMode:q.enum(["disabled-dev","internal-service","oidc"]),user_id:q.string().min(1),external_user_id:q.string().min(1).optional(),email:q.string().min(1).optional(),display_name:q.string().min(1).optional()}).strict(),VC=q.object({run_id:$,lease_owner:q.string().min(1),lease_ms:q.number().int().positive().max(1800*1e3).optional()}).strict(),YC=q.object({status:q.enum(["renewed","not_active","superseded"]),expires_at:q.string().min(1).nullable(),stop_requested:q.boolean()}).strict(),fm=q.object({run_id:$,page_id:q.string().min(1),attempt:q.number().int().positive(),snapshot_id:I,object_key:q.string().min(1),manifest_hash:q.string().min(1),file_paths:q.array(q.string().min(1)).min(1),created_at:q.string().min(1)}).strict(),XC=fm.omit({created_at:!0}).extend({lease_owner:q.string().min(1)}).strict(),QC=q.object({checkpoints:q.array(fm)}).strict(),bm=q.object({kind:q.enum(["page","component","shared"]),target_id:q.string().min(1)}).strict(),ZC=q.object({run_id:$,site_id:k,tenant_id:q.string().min(1),run_kind:q.enum(["initial_generation","iteration","landing_page","fill_in"]),status:q.enum(["queued","running","succeeded","failed","cancelled"]),base_snapshot_id:I.nullable(),lease_owner:q.string().min(1).nullable(),resume_count:q.number().int().nonnegative(),stop_requested:q.boolean(),reuse_from_run_id:$.nullable(),source_run_id:$.nullable(),fill_in_targets:q.array(bm),execution_scene:Pi.nullable().optional(),intent:q.literal("navigation_adaptation").optional(),page_template_manifest:dr.nullable().optional()}).strict().superRefine((e,n)=>{e.execution_scene==="page_template_create"?(e.run_kind!=="iteration"||!e.page_template_manifest)&&n.addIssue({code:"custom",message:"Page Template execution requires an iteration run with its authoritative manifest"}):e.page_template_manifest&&n.addIssue({code:"custom",message:"Only Page Template execution has a batch manifest"})}),JC=q.object({runs:q.array(q.object({run_id:$,site_id:k,tenant_id:q.string().min(1),run_kind:q.literal("initial_generation"),base_snapshot_id:I,sitemap_id:Ae,resume_count:q.number().int().nonnegative(),lease_owner:q.string().min(1),stop_requested:q.boolean(),resume_principal:qS}).strict())}).strict(),ev=q.object({site_id:k}).strict(),tv=q.object({status:q.enum(["requested","already_requested","stopped","no_active_run"]),run_id:$.nullable()}).strict(),nv=q.object({ledger:wn.nullable(),source_run_id:$.nullable(),updated_at:q.string().min(1).nullable()}).strict(),sv=q.object({targets:q.array(bm).min(1).max(50),client_run_key:q.string().min(1).max(400)}).strict();import{z as Le}from"zod";var WS=20,BS=Le.enum(["lifecycle_ready","activation_timeout","bridge_failure","readiness_recovery_failed"]),Lo=Le.number().int().min(0).max(36e5),ym=Le.number().int().min(0).max(1e3),KS=Le.object({type:BS,lifecycle_id:Le.string().regex(/^[A-Za-z0-9_-]{8,64}$/),elapsed_ms:Lo,route_id:Le.string().min(1).max(256).optional(),expected_snapshot_id:Le.string().uuid().nullable().optional(),bridge_state:Le.enum(["connecting","ready","reconnecting","failed","reload-required"]).optional(),failure_code:Le.string().regex(/^[A-Z][A-Z0-9_]{2,63}$/).optional(),reason:Le.string().regex(/^[a-z][a-z0-9-]{1,47}$/).optional(),action:Le.enum(["failed"]).optional(),transport_ms:Lo.optional(),activation_ms:Lo.optional(),reconnects:ym.optional(),reloads:ym.optional(),edit_engine_version:Le.string().regex(/^[0-9A-Za-z.+-]{1,32}$/).optional(),visibility:Le.enum(["visible","hidden"]).optional()}).strict(),av=Le.object({events:Le.array(KS).min(1).max(WS)}).strict();import{z as zS}from"zod";var mv=".i18n.json",Ks="translation",xm=new Set(["__proto__","constructor","prototype"]);function Rm(e){if(!zs(e)||Object.keys(e).length===0)return wt("I18N_ROOT_INVALID","Component i18n resources must be a non-empty object.",[]);for(let[n,s]of Object.entries(e)){if(xm.has(n))return Em([n]);if(!HS(n))return wt("I18N_LOCALE_INVALID",`Component i18n locale must be canonical BCP-47: ${n}`,[n]);if(!zs(s))return wt("I18N_NAMESPACE_INVALID",`Component i18n locale ${n} must contain only the translation namespace.`,[n]);let i=Object.keys(s);if(i.length!==1||i[0]!==Ks)return wt("I18N_NAMESPACE_INVALID",`Component i18n locale ${n} must contain only the translation namespace.`,[n]);let o=s[Ks];if(!zs(o))return wt("I18N_RESOURCE_TREE_INVALID",`Component i18n translation namespace for ${n} must be an object.`,[n,Ks]);let a=[{value:o,path:[n,Ks]}];for(;a.length>0;){let c=a.pop();for(let[r,m]of Object.entries(c.value)){let x=[...c.path,r];if(xm.has(r))return Em(x);if(typeof m!="string"){if(!zs(m))return wt("I18N_RESOURCE_TREE_INVALID","Component i18n resource leaves must be strings.",x);a.push({value:m,path:x})}}}}return{success:!0,data:e}}function lv(e){let n;try{n=JSON.parse(e)}catch{return wt("I18N_JSON_INVALID","Component i18n resource file must contain valid JSON.",[])}return Rm(n)}var pv=zS.custom(e=>Rm(e).success,"Invalid component i18n resources.");function HS(e){try{let n=Intl.getCanonicalLocales(e);return n.length===1&&n[0]===e}catch{return!1}}function zs(e){if(typeof e!="object"||e===null||Array.isArray(e))return!1;let n=Object.getPrototypeOf(e);return n===Object.prototype||n===null}function Em(e){return wt("I18N_RESOURCE_KEY_FORBIDDEN",`Component i18n resource key is forbidden: ${e.at(-1)??""}`,e)}function wt(e,n,s){return{success:!1,error:{code:e,message:n,path:s}}}var ft="products",$S=`/${ft}`,uv=$S,_v=`${ft} detail`,gv="cms_collection_view",hv="list",Sv="detail",He={zhHans:{pageTitle:"\u4EA7\u54C1\u4E2D\u5FC3",blockLabel:"\u4EA7\u54C1\u6982\u89C8",detailBlockLabel:"\u4EA7\u54C1\u8BE6\u60C5",heroBlockLabel:"\u4EA7\u54C1\u7B80\u4ECB",homeLabel:"\u9996\u9875"},zhHant:{pageTitle:"\u7522\u54C1\u4E2D\u5FC3",blockLabel:"\u7522\u54C1\u6982\u89BD",detailBlockLabel:"\u7522\u54C1\u8A73\u60C5",heroBlockLabel:"\u7522\u54C1\u7C21\u4ECB",homeLabel:"\u9996\u9801"},en:{pageTitle:"Products",blockLabel:"Products overview",detailBlockLabel:"Product details",heroBlockLabel:"Products Introduction",homeLabel:"Home"},de:{pageTitle:"Produkte",blockLabel:"Produkt\xFCbersicht",detailBlockLabel:"Produktdetails",heroBlockLabel:"Produkteinf\xFChrung",homeLabel:"Startseite"},fr:{pageTitle:"Produits",blockLabel:"Aper\xE7u des produits",detailBlockLabel:"D\xE9tails du produit",heroBlockLabel:"Pr\xE9sentation des produits",homeLabel:"Accueil"},es:{pageTitle:"Productos",blockLabel:"Resumen de productos",detailBlockLabel:"Detalles del producto",heroBlockLabel:"Introducci\xF3n de productos",homeLabel:"Inicio"},ja:{pageTitle:"\u88FD\u54C1",blockLabel:"\u88FD\u54C1\u6982\u8981",detailBlockLabel:"\u88FD\u54C1\u8A73\u7D30",heroBlockLabel:"\u88FD\u54C1\u7D39\u4ECB",homeLabel:"\u30DB\u30FC\u30E0"},ko:{pageTitle:"\uC81C\uD488",blockLabel:"\uC81C\uD488 \uAC1C\uC694",detailBlockLabel:"\uC81C\uD488 \uC0C1\uC138",heroBlockLabel:"\uC81C\uD488 \uC18C\uAC1C",homeLabel:"\uD648"},ru:{pageTitle:"\u041F\u0440\u043E\u0434\u0443\u043A\u0446\u0438\u044F",blockLabel:"\u041E\u0431\u0437\u043E\u0440 \u043F\u0440\u043E\u0434\u0443\u043A\u0446\u0438\u0438",detailBlockLabel:"\u041E \u043F\u0440\u043E\u0434\u0443\u043A\u0442\u0435",heroBlockLabel:"\u041D\u0430\u0448\u0430 \u043F\u0440\u043E\u0434\u0443\u043A\u0446\u0438\u044F",homeLabel:"\u0413\u043B\u0430\u0432\u043D\u0430\u044F"}},VS=new Set(Object.values(He).map(e=>e.pageTitle)),YS=new Set(Object.values(He).flatMap(e=>[e.blockLabel,e.detailBlockLabel,e.heroBlockLabel]));function fv(e){let n=e?.trim().toLowerCase()??"";if(n==="zh-tw"||n==="zh-hk"||n==="zh-mo")return He.zhHant;if(n.startsWith("zh"))return He.zhHans;switch(n.split("-")[0]){case"de":return He.de;case"fr":return He.fr;case"es":return He.es;case"ja":return He.ja;case"ko":return He.ko;case"ru":return He.ru;case"en":default:return He.en}}function bv(){return Object.values(He)}function yv(e){return VS.has(e.trim())}function xv(e){return YS.has(e.trim())}var XS="4rem",QS="0.75rem",ZS="2rem";function JS(e){if(e?.variant!=="floating")return"container pt-8";let n=[ZS,XS];return e.shape==="island"&&n.push(QS),`container pt-[calc(${n.join("+")})]`}function Rv(e){return`// Auto-generated by connect_dynamic_collection \u2014 do not edit by hand.
|
|
12
12
|
import { Fragment } from "react";
|
|
13
13
|
import Link from "next/link";
|
|
14
14
|
import type { CmsSeo } from "@/lib/cms";
|
|
@@ -42,7 +42,7 @@ export default function DetailBreadcrumb({ seo, title }: DetailBreadcrumbProps)
|
|
|
42
42
|
];
|
|
43
43
|
|
|
44
44
|
return (
|
|
45
|
-
<Breadcrumb className="${
|
|
45
|
+
<Breadcrumb className="${JS(e.headerShell)}">
|
|
46
46
|
<BreadcrumbList>
|
|
47
47
|
{trail.map((item) => (
|
|
48
48
|
<Fragment key={item.name}>
|
|
@@ -65,4 +65,4 @@ export default function DetailBreadcrumb({ seo, title }: DetailBreadcrumbProps)
|
|
|
65
65
|
</Breadcrumb>
|
|
66
66
|
);
|
|
67
67
|
}
|
|
68
|
-
`}import{z as mn}from"zod";var Sv="SITE_HAS_ACTIVE_SUBSITES",fv="SITE_HAS_SUBSITES",$S=mn.object({site_id:k,name:mn.string().min(1),mount_path:mn.string().min(1),archived_at:mn.string().nullable()}),bv=mn.object({subsites:mn.array($S)});import{z as we}from"zod";var Rv=we.object({key:we.string().min(1),composition:ge}).strict(),zs=we.enum(["component-boundary","repeat-region","conditional-region","fragment-region","opaque-region"]),VS=we.enum(["direct","proxy","upstream","readonly","unsupported"]),YS=we.enum(["component-boundary","repeat-region","conditional-region","opaque-region","void-element","read-only","cross-file-required","import-required"]),Ks=we.object({mode:VS,reasonCode:we.string().min(1).optional()}),XS=we.object({kind:YS,message:we.string().min(1)}),Hs=we.object({composition:K,key:we.string().min(1),canUpdateText:we.boolean(),canInsertChild:we.boolean(),canMove:we.boolean(),canRemove:we.boolean(),editModes:we.object({updateText:Ks.optional(),insertChild:Ks.optional(),move:Ks.optional(),remove:Ks.optional()}).optional(),constraints:we.array(XS)}).strict();import{z as X}from"zod";var Cv=X.discriminatedUnion("type",[X.object({type:X.literal("site-edit.document.changed"),siteId:k,snapshotId:I,composition:K,version:X.number().int().nonnegative(),at:X.string().min(1)}).strict(),X.object({type:X.literal("site-edit.operation.planned"),siteId:k,operationId:X.string().min(1),baseSnapshotId:I,composition:K,changedFiles:X.array(X.string().min(1)),at:X.string().min(1)}).strict(),X.object({type:X.literal("site-edit.operation.completed"),siteId:k,composition:K,result:oo,at:X.string().min(1)}).strict(),X.object({type:X.literal("site-edit.operation.failed"),siteId:k,composition:K,requestId:X.string().min(1),error:Pc,at:X.string().min(1)}).strict(),X.object({type:X.literal("site-edit.capability.changed"),siteId:k,composition:K,keys:X.array(X.string().min(1)),at:X.string().min(1)}).strict(),X.object({type:X.literal("site-edit.graph.invalidated"),siteId:k,composition:K,at:X.string().min(1)}).strict(),X.object({type:X.literal("site-edit.graph.ready"),siteId:k,composition:K,version:X.number().int().nonnegative(),at:X.string().min(1)}).strict(),X.object({type:X.literal("site-edit.graph.error"),siteId:k,composition:K,message:X.string().min(1),at:X.string().min(1)}).strict(),X.object({type:X.literal("site-edit.snapshot.changed"),siteId:k,composition:K,snapshotId:I,previousSnapshotId:X.string().min(1).nullable(),at:X.string().min(1)}).strict()]);import{z as ce}from"zod";var Nv="durable-history-v1",$s=ce.object({initiatingComposition:K.optional(),affectedCompositions:ce.array(K)}).strict(),jv=ce.enum(["writable","read-only-recovery","unavailable"]),QS=ce.enum(["INDEX_CORRUPT","ENTRY_MISSING","BLOB_MISSING","FILESYSTEM_UNAVAILABLE","ROLLBACK_INCOMPLETE","UNKNOWN"]),ZS=ce.object({code:QS,message:ce.string().min(1),occurredAt:ce.iso.datetime().optional()}).strict(),JS=ce.enum(["NOT_INITIALIZED","FILESYSTEM_UNAVAILABLE","UNSUPPORTED_RUNTIME"]),ym={revision:ce.number().int().nonnegative(),undoDepth:ce.number().int().nonnegative(),redoDepth:ce.number().int().nonnegative()},ef=ce.object({mode:ce.literal("writable"),composition:K,...ym,canUndo:ce.boolean(),canRedo:ce.boolean(),provenance:$s.optional()}).strict().superRefine((e,n)=>{e.canUndo!==e.undoDepth>0&&n.addIssue({code:"custom",path:["canUndo"],message:"canUndo must reflect undoDepth."}),e.canRedo!==e.redoDepth>0&&n.addIssue({code:"custom",path:["canRedo"],message:"canRedo must reflect redoDepth."})}),tf=ce.object({mode:ce.literal("read-only-recovery"),composition:K,...ym,canUndo:ce.literal(!1),canRedo:ce.literal(!1),recoveryDiagnostic:ZS,provenance:$s.optional()}).strict(),nf=ce.object({mode:ce.literal("unavailable"),composition:K,revision:ce.literal(0),undoDepth:ce.literal(0),redoDepth:ce.literal(0),canUndo:ce.literal(!1),canRedo:ce.literal(!1),reason:JS,provenance:$s.optional()}).strict(),sf=ce.discriminatedUnion("mode",[ef,tf,nf]),Lv=ce.object({composition:K,status:sf,provenance:$s}).strict();import{z as V}from"zod";var Vs=V.enum(["api-field","cms-field","i18n-message","config-entry"]),No=V.object({kind:V.enum(["jsx-node","value-path","route-export","external-entry"]),file:V.string().min(1).optional(),isProxy:V.boolean(),displayPath:V.string().min(1).optional(),sourceType:Vs.optional(),sourceId:V.string().min(1).optional()}),of=V.discriminatedUnion("status",[V.object({status:V.literal("resolved"),value:Bt}).strict(),V.object({status:V.literal("undefined")}).strict(),V.object({status:V.literal("unresolved")}).strict()]),af=V.object({kind:V.enum(["literal","boolean-shorthand","expression","binding","repeat-template"]),raw:V.string().optional()}).strict(),rf=V.object({name:V.string().min(1),source:af,resolution:of,editMode:V.enum(["direct","proxy","upstream","readonly","unsupported"]),sourceScope:V.enum(["node","repeat-item","repeat-template"]),allowedWriteScopes:V.array(V.enum(["selection","template"])),effectiveWriteTarget:No.optional(),diagnostics:V.array(V.object({code:V.string().min(1),message:V.string().min(1)}).strict())}).strict(),cf=V.object({raw:V.string().min(1),sourceRange:dt,order:V.number().int().nonnegative(),diagnostics:V.array(V.object({code:V.string().min(1),message:V.string().min(1)}).strict())}).strict(),mf=V.object({selection:V.enum(["direct","materialize","unsupported"]),template:V.enum(["direct","unsupported"])}).strict(),jo=V.object({documentVersion:V.number().int().nonnegative(),selectionRef:nn.optional(),items:V.array(rf),spreads:V.array(cf),creation:mf}).strict().superRefine((e,n)=>{let s=e.selectionRef;s&&s.instanceIndex!==void 0&&s.instanceCount!==void 0&&s.instanceIndex>=s.instanceCount&&n.addIssue({code:"custom",path:["selectionRef","instanceIndex"],message:"instanceIndex must be smaller than instanceCount"})});import{z as Ce}from"zod";var lf=Ce.string().min(1).refine(e=>!e.startsWith("/")&&!e.includes(".."),{message:"Patch paths must be safe relative POSIX paths."}),pf=Ce.string().regex(/^sha256:[a-f0-9]{64}$/),df=Ce.object({path:lf,operation:Ce.enum(["create","update","delete"]),expectedHash:pf.optional(),fullContent:Ce.string().optional()}).superRefine((e,n)=>{e.operation==="delete"&&e.fullContent!==void 0&&n.addIssue({code:"custom",path:["fullContent"],message:"delete patches must not include fullContent"}),e.operation!=="delete"&&e.fullContent===void 0&&n.addIssue({code:"custom",path:["fullContent"],message:"create/update patches must include fullContent"})}),uf=Ce.object({siteId:k,baseSnapshotId:I,operationId:Ce.string().min(1),reason:Ce.string().min(1),patches:Ce.array(df).min(1),changedCompositions:Ce.array(K),changedRouteIds:Ce.array(Ce.string().min(1)).optional(),diagnostics:Ce.array(Ce.object({code:Ce.string().min(1),message:Ce.string().min(1),path:Ce.string().min(1).optional()})).default([])}).strict().superRefine((e,n)=>{let s=new Set;for(let[o,a]of e.patches.entries())s.has(a.path)&&n.addIssue({code:"custom",path:["patches",o,"path"],message:`Duplicate patch path: ${a.path}`}),s.add(a.path);let i=[...new Set(e.changedCompositions.map(o=>o.routeId))];e.changedRouteIds!==void 0&&(e.changedRouteIds.length!==i.length||e.changedRouteIds.some((o,a)=>o!==i[a]))&&n.addIssue({code:"custom",path:["changedRouteIds"],message:"changedRouteIds must be the stable deduplicated route projection of changedCompositions."})}),Hv=uf.transform(e=>({...e,changedRouteIds:[...new Set(e.changedCompositions.map(n=>n.routeId))]}));var Lo="::repeat-item#";function _f(e,n){return`${e}${Lo}${n}`}function Vv(e,n){return n.reduce((s,i)=>_f(s,i),e)}function gf(e){if(typeof e!="string"||e.length===0)return null;let n=[],s=e;for(;;){let i=s.lastIndexOf(Lo);if(i<0)break;let o=Number(s.slice(i+Lo.length));if(!Number.isInteger(o)||o<0)return null;n.unshift({repeatIndex:o}),s=s.slice(0,i)}return!s||n.length===0?null:{baseKey:s,parts:n}}function Yv(e){return gf(e)?.baseKey??e??null}import{z as l}from"zod";import{z as Le}from"zod";var hf=Le.object({placementKey:Le.string().min(1),placementUnitKey:Le.string().min(1),relation:Le.enum(["before","after","prepend","append"])}).strict(),Sf=Le.object({status:Le.literal("supported"),containerKey:Le.string().min(1),hasBusinessMembers:Le.boolean(),placementUnitKeys:Le.array(Le.string().min(1)),placements:Le.array(hf)}).strict().superRefine((e,n)=>{let s=new Set(e.placementUnitKeys);s.size!==e.placementUnitKeys.length&&n.addIssue({code:"custom",path:["placementUnitKeys"],message:"Render page composition placement unit keys must be unique."});let i=new Set;e.placements.forEach((o,a)=>{i.has(o.placementKey)&&n.addIssue({code:"custom",path:["placements",a,"placementKey"],message:"Render page composition placement keys must be unique."}),i.add(o.placementKey),s.has(o.placementUnitKey)||n.addIssue({code:"custom",path:["placements",a,"placementUnitKey"],message:"Render page composition placement must reference a projected unit."})})}),ff=Le.object({status:Le.literal("unsupported"),reason:Ds,diagnostics:Le.array(Un)}).strict(),xm=Le.discriminatedUnion("status",[Sf,ff]);var bf=l.object({canUpdateText:l.boolean(),canInsertChild:l.boolean(),canMove:l.boolean(),canRemove:l.boolean()}),Em=l.enum(["vcp-cms-collection","vcp-cms-form","vcp-cms-settings","vcp-cms-navigation","site-api-route","external-api","unknown-api"]),yf=l.enum(["cms-field","api-field"]),xf=l.enum(["text","attribute","richtext","repeat-region","conditional-region","component-prop"]),Ef=l.enum(["exact","safe-derived","partial","unknown"]),Rf=l.object({file:l.string().min(1),symbol:l.string().min(1).optional(),reason:l.string().min(1)}),If=l.object({sourceKind:Em,sourceType:yf,endpointPattern:l.string().min(1).optional(),operation:l.string().min(1).optional(),collection:l.string().min(1).optional(),fieldPath:l.string().min(1).optional(),valuePath:l.string().min(1).optional(),targetKind:xf,targetName:l.string().min(1),confidence:Ef,readonly:l.literal(!0),evidence:l.array(Rf)}),Rm=l.object({hasDynamicData:l.boolean(),bindings:l.array(If)}),Im=l.object({hasDynamicData:l.boolean(),sourceKinds:l.array(Em),collections:l.array(l.string().min(1)).min(1).optional(),primaryEndpoint:l.string().min(1).optional(),primaryCollection:l.string().min(1).optional(),primaryFieldPath:l.string().min(1).optional()}),Tf=l.discriminatedUnion("kind",[l.object({kind:l.literal("route-unit")}).strict(),l.object({kind:l.literal("source-siblings"),siblingKeys:l.array(l.string().min(1)).min(2)}).strict(),l.object({kind:l.literal("unavailable")}).strict()]),kf=l.object({key:l.string().min(1),parentKey:l.string().min(1).nullable().optional(),pageCompositionUnitKey:l.string().min(1).optional(),pageCompositionActionScope:Tf.optional(),operationSummary:bf,dynamicDataSummary:Im.optional()}).strict(),dD=l.object({composition:ge}).strict(),uD=l.object({key:l.string().min(1),composition:ge,selectionRef:nn.optional()}).strict(),_D=l.object({siteId:k,snapshotId:I,composition:K,version:l.number().int().nonnegative(),entries:l.array(kf),pageComposition:xm}).strict(),Tm=l.object({kind:l.enum(["literal","binding","imported-binding","repeat-template"]),file:l.string().min(1),expression:l.string().min(1),bindingName:l.string().min(1).optional(),path:l.array(l.union([l.string(),l.number()])).optional()}),Mo=l.object({index:l.number().int().min(0),value:l.string(),editable:l.boolean(),source:Tm.nullable()}),Hn=l.object({key:l.string().min(1),label:l.string().min(1),tag:l.string().min(1)}),gD=l.object({composition:K,key:l.string().min(1),canUpdateText:l.boolean(),canInsertChild:l.boolean(),canMove:l.boolean(),canRemove:l.boolean(),boundaryKind:zs.nullable(),isOpaque:l.boolean()}).strict(),Af=l.object({kind:l.enum(["jsx-node","component-proxy","value-binding","route-export"]),file:l.string().min(1),componentName:l.string().min(1),isProxy:l.boolean()}),km=l.object({kind:l.union([l.enum(["jsx-literal","component-prop","binding","imported-binding","object-field","array-item","repeat-template","conditional-branch"]),Vs]),file:l.string().min(1),displayPath:l.string().min(1),externalSource:l.object({sourceType:Vs,sourceId:l.string().min(1),adapterId:l.string().min(1).optional()}).optional()}),Pf=l.object({kind:km.shape.kind,file:l.string().min(1),displayName:l.string().min(1),canEditHere:l.boolean()}),$n=l.object({finalSource:km.nullable(),chain:l.array(Pf),confidence:l.enum(["exact","safe-derived","partial","unknown"]),editMode:l.enum(["direct","proxy","upstream","readonly","unsupported"]),diagnostics:l.array(l.object({code:l.string().min(1),message:l.string().min(1)}))}),wf=l.object({kind:l.literal("css-style-model"),properties:l.array(l.object({property:Ec,value:l.union([l.string(),l.number(),l.boolean(),l.null()]),resolvedValue:l.union([l.string(),l.number(),l.boolean(),l.null()]).optional(),breakpoint:Ic.optional(),state:Rc.optional(),variants:l.array(l.string().min(1)).optional(),options:l.array(l.union([l.string(),l.number()])).optional(),editable:l.boolean(),diagnostics:l.array(l.object({code:l.string().min(1),message:l.string().min(1)})).optional(),operationBoundary:l.array(Fn).optional()}))}),hD=l.union([l.record(l.string(),l.unknown()),wf]),Am=l.object({kind:l.literal("class-name-source"),className:l.string(),sourceKind:l.enum(["missing","static-attribute","static-expression","dynamic-expression"]),editable:l.boolean(),operationBoundary:l.array(Fn),sourcePath:l.string().min(1).optional(),diagnostics:l.array(l.object({code:l.enum(["missing-class-name","dynamic-binding","non-string-binding"]),message:l.string().min(1)})).optional()}),Cf=l.object({startLine:l.number().int().positive(),startColumn:l.number().int().nonnegative(),endLine:l.number().int().positive(),endColumn:l.number().int().nonnegative()}),Uo=l.object({sourceFile:l.string().min(1),componentName:l.string().min(1),openingElementRange:Cf,structuralPath:l.string().min(1),textPreview:l.string().min(1).optional()}),Pm=l.enum(["native-anchor","next-link","unsupported"]),SD=l.object({composition:K,key:l.string().min(1),tag:l.string().min(1),linkSourceKind:Pm.optional(),componentName:l.string().min(1),sourceFile:l.string().min(1),sourceLocator:Uo.optional(),label:l.string().min(1),capabilities:Hs,writeTarget:Af,effectiveWriteTarget:No.optional(),provenanceChain:$n.optional(),componentSemantic:l.record(l.string(),l.unknown()).optional(),styleSource:Am.optional(),conditional:l.record(l.string(),l.unknown()).optional(),dynamicData:Rm.optional(),properties:jo.optional(),textSegments:l.array(Mo),boundaryKind:zs.nullable(),isOpaque:l.boolean(),ancestors:l.array(Hn),children:l.array(Hn),siblings:l.array(Hn)}).strict(),fD=l.object({composition:K,key:l.string().min(1),tag:l.string().min(1),label:l.string().min(1),sourceLocator:Uo.optional(),capabilities:l.object({constraints:Hs.shape.constraints}),isOpaque:l.boolean(),provenanceChain:l.object({editMode:$n.shape.editMode,diagnostics:$n.shape.diagnostics}).optional(),dynamicDataSummary:Im.optional(),ancestors:l.array(Hn)}).strict(),bD=l.object({composition:K,key:l.string().min(1),tag:l.string().min(1),linkSourceKind:Pm.optional(),label:l.string().min(1),sourceLocator:Uo.optional(),isOpaque:l.boolean(),ancestors:l.array(Hn),componentName:l.string().min(1),sourceFile:l.string().min(1),capabilities:Hs,provenanceChain:l.object({editMode:$n.shape.editMode,diagnostics:$n.shape.diagnostics}).optional(),textSegments:l.array(l.object({index:Mo.shape.index,editable:Mo.shape.editable,sourceKind:Tm.shape.kind.nullable()})),dynamicData:Rm.optional(),properties:jo.optional(),boundaryKind:zs.nullable()}).strict(),yD=l.object({composition:K,key:l.string().min(1),styleSource:Am.optional()}).strict();var vf=["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"],Df=["article","aside","div","footer","form","header","li","main","nav","ol","section","select","table","tbody","tfoot","thead","tr","ul"],Of=["a","button","em","h1","h2","h3","h4","h5","h6","label","p","small","span","strong"],Nf=new Set(vf),jf=new Set(Df),Lf=new Set(Of),Mf={canUpdateText:!1,canInsertChild:!1,canMove:!1,canRemove:!1};function ED(e){return Nf.has(Fo(e))}function Uf(e){return jf.has(Fo(e))}function Ff(e){return Lf.has(Fo(e))}function RD(e){let{operationSummary:n}=e;return n?{canUpdateText:n.canUpdateText,canInsertChild:n.canInsertChild,canMove:n.canMove,canRemove:n.canRemove}:e.fallbackMode!=="preview"?{...Mf}:{canUpdateText:Ff(e.tagName),canInsertChild:Uf(e.tagName),canMove:!1,canRemove:!1}}function Fo(e){return e?.trim().toLowerCase()??""}import{z as Gf}from"zod";var PD=Gf.object({composition:ge,mutationContext:Ln.optional()}).strict();var CD={PATCH_VALIDATION_FAILED:"The code didn't pass validation. Try describing the change more specifically.",PATCH_BATCH_FAILED:"The site code couldn't be generated. Please regenerate the site.",PATCH_BATCH_INVALID:"The change couldn't be applied. Try simpler instructions.",VALIDATION_FAILED:"Your message couldn't be sent as written. Please edit it and try again.",WORKSPACE_MESSAGE_CONTAINS_SECRET:"Your message looks like it contains a secret or token, so it wasn't sent. Remove it and try again.",WORKSPACE_RUN_INPUT_REQUIRED:"Nothing to work on: the request had no instruction, so no edit was started. Describe the change you want and send it.",WORKSPACE_TOOL_RESULT_INVALID:"This change couldn't be completed and was rolled back. Please try again.",WORKSPACE_TOOL_FAILED:"A tool step failed. Please try again.",WORKSPACE_TOOL_RESULT_MISSING:"The tool didn't return a usable result. Please try again.",WORKSPACE_MODEL_STREAM_FAILED:"The model stream ended unexpectedly. Please try again.",WORKSPACE_MODEL_STREAM_ABORTED:"Generation was interrupted before finishing. Please try again.",MODEL_OUTPUT_TRUNCATED:"The response was too long and was cut off before any change was applied. Try again, or split the request into smaller changes.",WORKSPACE_EDIT_NOT_APPLIED:"No change was applied. Try describing the change differently.",PRODUCT_SEARCH_APPLY_NOT_AVAILABLE:"Product search changes aren't available yet. Please try again later.",WORKSPACE_INITIAL_EXECUTION_FAILED:"Initial generation failed. Please retry from the brief.",WORKSPACE_INITIAL_GENERATION_CHECK_FAILED:"Initial generation could not be verified. Please retry.",WORKSPACE_INITIAL_GENERATION_FINALIZE_FAILED:"Initial generation could not finalize. Please retry.",WORKSPACE_INITIAL_GENERATION_QUALITY_GATE_FAILED:"Initial generation failed quality checks. Please regenerate the site.",WORKSPACE_CHECK_INCOMPLETE:"The check couldn't complete, so no page was delivered this round. Please regenerate the site.",WORKSPACE_RUN_RESUME_EXHAUSTED:"Generation was interrupted several times and stopped. Everything already saved is kept; you can regenerate the missing pages.",WORKSPACE_GENERATION_STOPPED:"You stopped this generation before any page was ready. Nothing was lost \u2014 start it again when you want.",WORKSPACE_FILL_IN_INTERRUPTED:"The fill-in run was interrupted and stopped. Your site is unchanged; select the targets again to retry.",WORKSPACE_RUN_LEASE_SUPERSEDED:"Another attempt took over this run, so this one stopped. Reload to see the current progress.",FILL_IN_NOT_AVAILABLE:"Fill-in is available after the site has been generated.",FILL_IN_TARGET_NOT_OMITTED:"One of the selected items is no longer listed as missing. Reload the omissions list and try again.",FILL_IN_TARGET_MODIFIED:"One of the selected items was changed or removed after generation, so it was not filled in. Your edits are kept.",WORKSPACE_ITERATION_QUALITY_GATE_FAILED:"Quality check failed. The change was rolled back; try a smaller or more specific request.",WORKSPACE_RESOURCE_MATERIALIZATION_FAILED:"The resource couldn't be prepared. Check its file format, dependencies, and target paths before trying again.",DESIGNER_PAGE_RESOURCE_INCOMPATIBLE:"This template contains files or dependencies the page editor doesn't support. Choose another template or adapt the resource package first.",WORKSPACE_SOCKET_DEAD:"The workspace connection was lost. Please retry.",WORKSPACE_RUN_CANCELLED:"The run was cancelled.",WORKSPACE_RUN_ABANDONED:"This run was interrupted and did not finish. Please try again.",WORKSPACE_RUN_REQUEST_FAILED:"Couldn't start the workspace. Please try again.",WORKSPACE_RUN_BAD_RESPONSE:"The server response was malformed. Please try again.",WORKSPACE_SOCKET_UNAVAILABLE:"Workspace connection unavailable. Please try again.",WORKSPACE_SOCKET_ERROR:"The workspace connection had an error. Please try again.",WORKSPACE_SOCKET_CLOSED:"The workspace connection closed. Please try again.",WORKSPACE_SOCKET_OPEN_TIMEOUT:"Couldn't reach the workspace in time. Please try again.",WORKSPACE_CLIENT_MESSAGE_ID_MISSING:"Something went wrong sending your message. Please try again.",SITE_SNAPSHOT_REQUIRED:"This site has no usable snapshot yet. Complete Step 3 first.",AGENT_TIMEOUT:"That took longer than expected. Try breaking the change into smaller pieces.",SANDBOX_NOT_AVAILABLE:"The preview environment isn't ready. Your edits have still been saved.",PREVIEW_BUILD_FAILED:"Preview is available, but the production build failed. Fix the reported build error before deploying.",PREVIEW_BUILD_NOT_CONFIGURED:"Preview is available, but the production build check is not configured.",PREVIEW_BUILD_SANDBOX_NOT_FOUND:"Preview is available, but the build check could not find the active preview sandbox.",BUILD_FONT_METADATA_INVALID:"We couldn't read the font file information. Publishing is blocked until the font file is checked.",BUILD_FONT_LICENSE_UNKNOWN:"We couldn't verify this font's license. Publishing is blocked until its license is confirmed.",BUILD_FONT_LICENSE_CONFLICT:"The font file license conflicts with the verified record. Publishing is blocked until the conflict is resolved.",BUILD_FONT_LICENSE_TEXT_MISSING:"The complete font license text is missing. Publishing is blocked until it is provided.",BUILD_FONT_LICENSE_DELIVERY_FAILED:"We couldn't include the font license files in the deployment. Please try publishing again.",WS_CONNECTION_ERROR:"Connection lost. Reconnecting\u2026",USER_MESSAGE_PERSIST_FAILED:"Your message wasn't saved. Please send it again.",CLARIFICATION_REPLY_STALE:"That question has expired. Please tell me what you'd like to do now.",CLARIFY_MODEL_FAILED:"Clarify couldn't finish generating questions. Please try again.",WORKSPACE_RUN_IN_FLIGHT:"Another session is already running. Please try again in a moment.",SITE_OPERATION_LOCKED:"Another change is already running for this site. Wait for it to finish, then try again.",SITE_SITEMAP_DRAFT_STALE:"The draft was updated elsewhere. Reload the latest draft before saving.",SITE_SITEMAP_DRAFT_OPERATION_MISMATCH:"This save identity belongs to a different draft operation.",WORKSPACE_THREAD_NOT_FOUND:"That conversation no longer exists. Switching back to the default conversation.",WORKSPACE_THREAD_ARCHIVED:"This conversation is archived. Start a new one to continue.",WORKSPACE_THREAD_BUSY:"This conversation is still running. Wait for it to finish before archiving.",WORKSPACE_THREAD_READ_ONLY:"Background conversations are read-only here.",WORKSPACE_THREAD_INVALID:"This conversation can't accept new requests right now. Refresh and try again.",EDIT_ENGINE_VERSION_INVALID:"Invalid editor version. Refresh the page and try again.",SANDBOX_DEPENDENCY_SYNC_FAILED:"The preview runtime could not be prepared. Please try again.",SANDBOX_PREVIEW_FAILED:"The site preview failed to start. Please try again.",SANDBOX_DEPENDENCY_VERSION_MISMATCH:"The preview runtime could not be verified. Please try again.",SANDBOX_RUNTIME_NOT_READY:"The preview needs to be refreshed before this change can be applied. Refresh the preview and try again.",GENERIC:"Something went wrong. Please try again."},qf=["BUILD_FONT_METADATA_INVALID","BUILD_FONT_LICENSE_UNKNOWN","BUILD_FONT_LICENSE_CONFLICT","BUILD_FONT_LICENSE_TEXT_MISSING","BUILD_FONT_LICENSE_DELIVERY_FAILED"],Wf=new Set(qf);function vD(e){return typeof e=="string"&&Wf.has(e)}var Bf=["WORKSPACE_RUN_CANCELLED","WORKSPACE_GENERATION_STOPPED"],Kf=new Set(Bf);function DD(e){return typeof e=="string"&&Kf.has(e)}var OD={UNDO_OR_ROLLBACK:"I can't roll back from chat. Use the version history at the top right to pick a restore point.",HISTORY_RECALL:"Tell me what you'd like to change now\u2014I'll work from the current page state.",OUT_OF_SCOPE:"That's outside what I can do from chat. Try the corresponding panel on the right."},ND={CARD_HEADER:"Needs your confirmation",FREE_TEXT_PLACEHOLDER:"Or describe what you'd like instead",SUBMIT_LABEL:"Submit"},jD={SEND_FAILED_RETRY:"Send failed \u2014 tap to retry"};var wm="0.10.31",MD="x-vcp-edit-engine-version",UD="x-vcp-edit-engine-version-source",Go=class extends Error{constructor(n="Invalid edit-engine version."){super(n),this.code="EDIT_ENGINE_VERSION_INVALID",this.name="EditEngineVersionParseError"}},zf=/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-[0-9A-Za-z]+(?:\.[0-9A-Za-z]+)*)?$/;function Hf(e){return zf.test(e)}function $f(e){if(typeof e!="string"||!Hf(e))throw new Go;return e}function FD(e){return e==null?{version:wm,source:"fallback_current"}:{version:$f(e),source:"explicit"}}function GD(){return{version:wm,source:"system_current"}}import{z as et}from"zod";var Vf=200,Yf=200;function Xf(e){let n=e.indexOf(":");if(n<=0)return null;let s=e.slice(0,n).trim(),i=e.slice(n+1).trim();return s.length===0||i.length===0?null:{source:s,target:i}}var Qf=et.string().min(3).max(Vf).refine(e=>Xf(e)!==null,{message:'glossary entries must be "source:target" pairs split on a half-width colon, e.g. "\u7C73:Rice"'}),BD=et.array(Qf).max(Yf),KD=et.object({website_name:et.string().min(1).max(200),website_industry:et.string().min(1).max(200).optional(),website_description:et.string().min(1).max(1e3).optional()}),Zf=et.enum(["regional","fonts_only"]),Ys=et.string().regex(/^#[0-9a-fA-F]{6}$/,'color must be a "#rrggbb" value'),Jf=et.object({primary:Ys.optional(),accent:Ys.optional(),foreground:Ys.optional(),neutral:Ys.optional()}),eb=600,zD=et.object({mode:Zf.default("regional"),seeds:Jf.optional(),note:et.string().min(1).max(eb).optional()}),HD={mode:"regional"};function $D(e){return e===void 0?!1:Object.values(e).some(n=>typeof n=="string"&&n.length>0)}import{z as zt}from"zod";var tb=12,QD=zt.object({tenant_id:zt.string().min(1),site_id:k,snapshot_id:I,manifest_hash:zt.string().regex(/^sha256:[a-f0-9]{64}$/),object_key:zt.string().min(1).max(2048)}),Xs=zt.number().int().nonnegative().safe(),ZD=zt.object({page_count:Xs,translation_character_count:Xs,image_estimate:zt.object({media_key_count:Xs,max_replacement_count:Xs})}).superRefine((e,n)=>{let{media_key_count:s,max_replacement_count:i}=e.image_estimate;i!==Math.min(s,tb)&&n.addIssue({code:"custom",path:["image_estimate","max_replacement_count"],message:"max replacement count does not match the deterministic ceiling"})});import{z as ue}from"zod";var nb=ue.string().trim().min(1),ln=ue.string().uuid(),sb=ue.string().min(1).max(2048).refine(e=>e.startsWith("/")||e.includes("\\")?!1:e.split("/").every(n=>n.length>0&&n!=="."&&n!==".."),"object_key must be a relative snapshot store path without empty, '.' or '..' segments"),Cm=ue.object({snapshot_id:ln,object_key:sb}),tO=ue.object({tenant_id:nb,parent_site_id:ln,subsite_site_id:ln,base:Cm,target:Cm}),ib=ue.object({page_path:ue.string().min(1),page_route:ue.string().min(1).describe("\u4E3B\u7AD9\u76EE\u6807\u5FEB\u7167\u7684\u9875\u9762\u8DEF\u7531\uFF1A\u4F18\u5148 PAGE_SEO.path\uFF0C\u7F3A\u5931\u65F6\u7531\u6587\u4EF6\u8DEF\u7531\u63A8\u5BFC\uFF1B\u52A8\u6001\u9875\u4FDD\u7559\u8DEF\u7531\u6A21\u677F\uFF0C\u4E0D\u542B\u57DF\u540D\u6216\u5B50\u7AD9\u6302\u8F7D\u524D\u7F00\u3002"),page_title:ue.string().nullable().describe("\u4E3B\u7AD9\u76EE\u6807\u5FEB\u7167\u4E2D\u7684\u9759\u6001 PAGE_SEO.title\uFF1B\u7F3A\u5931\u6216\u52A8\u6001\u503C\u8FD4\u56DE null\uFF0C\u4E0D\u67E5\u8BE2 CMS \u6807\u9898\u8986\u76D6\u3002"),ai_image_count:ue.number().int().nonnegative().safe().describe("\u9875\u9762\u5F15\u7528\u7684\u5A92\u4F53\u6CE8\u518C\u8868 key \u6570\u91CF\uFF0C\u9875\u5185\u53BB\u91CD\uFF0C\u4E0D\u9650 12 \u5F20\uFF1B\u8868\u793A\u53EF\u4F9B AI \u91CD\u65B0\u751F\u6210\u7684\u5019\u9009\u56FE\u7247\u6570\u3002"),translation_character_count:ue.number().int().nonnegative().safe().describe("\u6574\u9875\u53EF\u9759\u6001\u63D0\u53D6\u7684\u6587\u6848\u53CA\u76F8\u5173\u56FE\u7247 alt\uFF0C\u539F\u6587\u53BB\u91CD\u540E\u7684 UTF-16 \u5B57\u7B26\u6570\uFF0C\u4E0D\u6263\u9664\u5386\u53F2\u8BD1\u6587\u3002")}),ob={page_count:ue.number().int().nonnegative().safe().describe("\u65B0\u589E\u9875\u9762\u6570\u91CF\uFF0C\u7B49\u4E8E pending_pages \u957F\u5EA6\u3002"),ai_image_count:ue.number().int().nonnegative().safe().describe("\u9010\u9875\u5019\u9009\u56FE\u7247\u6570\u91CF\u4E4B\u548C\uFF0C\u8DE8\u9875\u4E0D\u53BB\u91CD\uFF0C\u4E0D\u8868\u793A\u5DF2\u7531 AI \u751F\u6210\u7684\u56FE\u7247\u6570\u3002"),translation_character_count:ue.number().int().nonnegative().safe().describe("\u9010\u9875\u9884\u4F30\u7FFB\u8BD1\u5B57\u7B26\u6570\u4E4B\u548C\uFF0C\u8DE8\u9875\u4E0D\u53BB\u91CD\uFF0C\u4E0D\u8868\u793A\u5B9E\u9645\u7FFB\u8BD1\u6D88\u8017\u3002"),page_estimates:ue.array(ib)};function ab(e,n){let s=new Set(e.pending_pages),i=new Set(e.page_estimates.map(o=>o.page_path));(s.size!==e.pending_pages.length||i.size!==e.page_estimates.length||s.size!==i.size||[...s].some(o=>!i.has(o)))&&n.addIssue({code:"custom",path:["page_estimates"],message:"page_estimates must correspond to pending_pages exactly once"});for(let[o,a]of[["page_count",e.pending_pages.length],["ai_image_count",e.page_estimates.reduce((c,r)=>c+r.ai_image_count,0)],["translation_character_count",e.page_estimates.reduce((c,r)=>c+r.translation_character_count,0)]])e[o]!==a&&n.addIssue({code:"custom",path:[o],message:"total must equal the sum of page estimates"})}var nO=ue.object({...ob,subsite_site_id:ln,pending_pages:ue.array(ue.string().min(1)),hash_diverged_count:ue.number().int().nonnegative(),child_only_count:ue.number().int().nonnegative(),base_snapshot_id:ln,target_snapshot_id:ln}).superRefine(ab),rb=ue.enum(["SUBSITE_DIFF_REQUEST_INVALID","SUBSITE_DIFF_STORE_NOT_CONFIGURED","SUBSITE_DIFF_MANIFEST_MISSING","SUBSITE_DIFF_MANIFEST_INVALID","SUBSITE_DIFF_ESTIMATE_INVALID"]),sO=ue.object({error_code:rb,message:ue.string().min(1),side:ue.enum(["base","target"]).optional()});import{z as te}from"zod";var rO=te.object({tenant_id:te.string().min(1),site_id:k,snapshot_id:I,manifest_hash:te.string().regex(/^sha256:[a-f0-9]{64}$/),object_key:te.string().min(1).max(2048),page_slug:te.string().max(512).optional()}),cO=te.object({site_id:k,snapshot_id:I,unit_count:te.number().int().nonnegative(),file_count:te.number().int().nonnegative(),markdown:te.string().min(1),page_slug:te.string().optional(),page_file:te.string().optional(),entries:te.array(te.object({id:te.string().min(1),file_path:te.string().min(1),line:te.number().int().nullable(),kind:te.string().min(1),text:te.string(),media_key:te.string().optional()})).optional(),images:te.array(te.object({id:te.string().min(1),source:te.enum(["media-registry","source-literal"]),src:te.string().min(1),alt:te.string().nullable(),media_key:te.string().optional(),width:te.number().optional(),height:te.number().optional(),provider:te.string().optional(),is_placeholder:te.boolean(),occurrences:te.array(te.object({file_path:te.string().min(1),line:te.number().int()}))})).optional()});import{z as cb}from"zod";var mb=/^\/[a-z0-9][a-z0-9-]{0,30}$/,lb=Object.freeze(["api","_next","assets","static","robots.txt","sitemap.xml",".well-known"]),pb=new Set(lb);function db(e){return pb.has(e)}var pO=cb.string().regex(mb).refine(e=>!db(e.slice(1)),{message:"mount_path must not use a reserved segment (api, _next, assets, static, robots.txt, sitemap.xml, .well-known)"});import{z as he}from"zod";var ub=he.enum(["active","paused","blocked"]),vm=he.enum(["typecheck_failed","health_failed","validation_failed"]),_b={status:ub,attempts:he.number().int().nonnegative(),attempted_template_version:Ze.nullable(),last_error_code:vm.nullable()},pn=he.object(_b).strict(),Qs=he.object({template_id:he.string().trim().min(1),target_template_version:Ze}).strict(),gO=Qs,gb=he.discriminatedUnion("action",[he.object({action:he.literal("proceed"),state:pn.extend({status:he.literal("active")})}).strict(),he.object({action:he.literal("skip_not_newer"),state:pn.extend({status:he.literal("active")})}).strict(),he.object({action:he.literal("skip_paused"),state:pn.extend({status:he.literal("paused")})}).strict(),he.object({action:he.literal("skip_blocked"),state:pn.extend({status:he.literal("blocked")})}).strict()]),hO=Qs,SO=gb,fO=Qs.extend({error_code:vm}),bO=he.object({state:pn}).strict(),yO=Qs,xO=he.object({state:pn}).strict();import{z as Y}from"zod";var hb=744*60*60*1e3,Sb=Y.enum(["eligible","fast_path","upgraded","skipped","lock_skipped","cas_aborted","validation_failed","blocked","paused"]),fb=Y.enum(["typecheck","build","health","validation"]),bb=Y.enum(["not_attempted","promoted","aborted"]),kO=Y.object({template_id:Y.string().trim().min(1).max(128),from_version:Ze.nullable(),to_version:Ze,outcome:Sb,attempt:Y.number().int().nonnegative().max(2147483647),duration_ms:Y.number().int().nonnegative().max(2147483647),replaced_group_count:Y.number().int().nonnegative().max(2147483647),skipped_group_count:Y.number().int().nonnegative().max(2147483647),validation_stage:fb.nullable(),cas_outcome:bb.nullable()}).strict(),AO=Y.object({recorded:Y.literal(!0)}).strict(),Dm=Y.object({from:Y.iso.datetime(),to:Y.iso.datetime()}).strict().refine(({from:e,to:n})=>Date.parse(e)<Date.parse(n),{message:"from must be earlier than to",path:["to"]}).refine(({from:e,to:n})=>Date.parse(n)-Date.parse(e)<=hb,{message:"report window must not exceed 31 days",path:["to"]}),PO=Dm,yb=Y.object({eligible:Y.number().int().nonnegative(),fast_path:Y.number().int().nonnegative(),upgraded:Y.number().int().nonnegative(),skipped:Y.number().int().nonnegative(),lock_skipped:Y.number().int().nonnegative(),cas_aborted:Y.number().int().nonnegative(),validation_failed:Y.number().int().nonnegative(),blocked:Y.number().int().nonnegative(),paused:Y.number().int().nonnegative()}).strict(),wO=Y.object({window:Dm,outcome_counts:yb,current_state_counts:Y.object({blocked:Y.number().int().nonnegative(),paused:Y.number().int().nonnegative()}).strict(),duration_ms:Y.object({p50:Y.number().int().nonnegative().nullable(),p95:Y.number().int().nonnegative().nullable(),sample_count:Y.number().int().nonnegative()}).strict()}).strict(),CO=Y.object({older_than:Y.iso.datetime(),limit:Y.coerce.number().int().min(1).max(200).default(50),include_candidates:Y.enum(["true","false"]).default("false").transform(e=>e==="true")}).strict(),xb=Y.object({site_id:k,snapshot_id:I,status:Y.enum(["candidate","deleting"]),created_at:Y.iso.datetime()}).strict(),vO=Y.object({snapshots:Y.array(xb)}).strict();import{z as ft}from"zod";var Eb=ft.enum(["PREVIEW_SESSION_NOT_FOUND","PREVIEW_SESSION_INVALID","PREVIEW_SESSION_STALE","PREVIEW_SESSION_LOOKUP_FAILED","PREVIEW_SANDBOX_NOT_FOUND","PREVIEW_SANDBOX_CONNECT_FAILED","PREVIEW_SANDBOX_OWNERSHIP_MISMATCH","PREVIEW_ACTIVATION_TIMEOUT","PREVIEW_PREFLIGHT_FAILED","PREVIEW_ENV_LOOKUP_FAILED","PREVIEW_SERVER_START_FAILED","PREVIEW_HEALTH_CHECK_FAILED","SANDBOX_NOT_CONFIGURED"]),Rb=ft.object({status:ft.literal("ready"),preview_url:ft.string().url()}).strict(),Ib=ft.object({status:ft.literal("failed"),code:Eb,message:ft.string().min(1),retryable:ft.boolean()}).strict(),NO=ft.discriminatedUnion("status",[Rb,Ib]);import{z as wt}from"zod";var Tb=["not_started","active","completed"],kb=wt.enum(Tb),Ab=["not_started","in_progress","completed"],Pb=wt.enum(Ab),wb=wt.object({sequence:wt.number().int().positive(),code:It,status:Pb}).strict(),Cb=wt.object({site_id:k,workflow_status:kb,flow_type:sn.nullable(),current_step_code:It.nullable(),completed_count:wt.number().int().nonnegative(),total_count:wt.number().int().nonnegative(),steps:wt.array(wb)}).strict().superRefine((e,n)=>{let s=e.steps.filter(i=>i.status==="completed").length;e.total_count!==e.steps.length&&n.addIssue({code:"custom",path:["total_count"],message:"total_count must equal steps.length."}),e.completed_count!==s&&n.addIssue({code:"custom",path:["completed_count"],message:"completed_count must equal completed steps."}),e.steps.forEach((i,o)=>{i.sequence!==o+1&&n.addIssue({code:"custom",path:["steps",o,"sequence"],message:"Step sequence must be continuous and start at 1."})}),e.workflow_status==="not_started"&&(e.flow_type!==null&&n.addIssue({code:"custom",path:["flow_type"],message:"not_started progress cannot have a flow_type."}),e.current_step_code!==null&&n.addIssue({code:"custom",path:["current_step_code"],message:"not_started progress cannot have a current step."}),(e.completed_count!==0||e.total_count!==0)&&n.addIssue({code:"custom",path:["steps"],message:"not_started progress must have zero counts and no steps."})),e.workflow_status==="active"&&(e.flow_type===null&&n.addIssue({code:"custom",path:["flow_type"],message:"active progress requires a flow_type."}),e.current_step_code===null&&n.addIssue({code:"custom",path:["current_step_code"],message:"active progress requires a current step."})),e.workflow_status==="completed"&&(e.flow_type===null&&n.addIssue({code:"custom",path:["flow_type"],message:"completed progress requires a flow_type."}),e.current_step_code!==null&&n.addIssue({code:"custom",path:["current_step_code"],message:"completed progress cannot have a current step."}),e.steps.some(i=>i.status!=="completed")&&n.addIssue({code:"custom",path:["steps"],message:"completed progress must have only completed steps."}),e.completed_count!==e.total_count&&n.addIssue({code:"custom",path:["completed_count"],message:"completed progress counts must be equal."}))}),GO=M(Cb);import{z as qo}from"zod";var vb=qo.enum(["none","build","build_publish"]),Db=qo.object({site_id:k,launcher_scope:vb}),KO=qo.object({permission:Db});function zO(e){return e!=="none"}function HO(e){return e==="build_publish"}import{z as fe}from"zod";var ZO="build-context.json",JO=2e5,Om=fe.string().regex(/^sha256:[a-f0-9]{64}$/u),Nm=1e3;function Ob(e){return Array.from(e).length<=Nm}var Nb=fe.object({kind:fe.enum(["customer_materials","website_scan_diagnosis","committed_strategy"]),digest:Om}).strict(),jb=fe.object({schema_version:fe.literal(1),flow_type:sn,sources:fe.array(Nb).min(2).max(2)}).strict().superRefine((e,n)=>{let s=new Set(e.sources.map(o=>o.kind)),i=e.flow_type==="with_website"?["website_scan_diagnosis","committed_strategy"]:["customer_materials","committed_strategy"];(s.size!==i.length||i.some(o=>!s.has(o)))&&n.addIssue({code:"custom",path:["sources"],message:"Site-build provenance sources must match the persisted workflow flow."})}),Lb=fe.object({schema_version:fe.literal(1),seed:Om.optional(),cms_settings:fe.object({main_products:fe.string().trim().min(1).refine(Ob,{message:`main_products must contain at most ${Nm} characters`}).optional()}).strict().optional(),provenance:jb.optional()}).strict(),Mb=fe.object({schema_version:fe.literal(1),site_id:k,workflow_id:it,brief:fe.string().min(1),source:fe.enum(["business_provider","mock"]),payload:Lb}).strict().superRefine((e,n)=>{e.source==="business_provider"&&!e.payload.provenance&&n.addIssue({code:"custom",path:["payload","provenance"],message:"Business site-build context requires persisted provenance."})}),eN=fe.object({source_snapshot_id:I,source_run_id:$,build_context:Mb,page_slugs:fe.array(fe.string().min(1)).optional()}).strict(),tN=fe.object({disposition:fe.enum(["reused","rebased"]),snapshot_id:I}).strict(),Ub=fe.object({snapshot:po,workspace_run_id:$.nullable()}).strict(),nN=M(Ub);import{z as rt}from"zod";import{z as He}from"zod";import{z as ve}from"zod";import{z as Fb}from"zod";var Gb=["brand","fact","cert","case","svc","faq","voice"],jm=Fb.enum(Gb);var qb=ve.enum(["pending","running","ready","failed","missing"]),Vn=ve.string().trim().min(1).max(255),cN=ve.object({knowledge_site_id:Vn,source_ids:ve.array(Vn).min(1).max(200)}).strict().superRefine((e,n)=>{new Set(e.source_ids).size!==e.source_ids.length&&n.addIssue({code:"custom",message:"Knowledge source IDs must be unique.",path:["source_ids"]})}),Wb=ve.object({source_file_id:Vn,category_code:jm.nullable(),category_confirmed:ve.boolean(),status:qb}).strict(),mN=ve.object({ready:ve.boolean(),files:ve.array(Wb),counts:ve.object({total:ve.number().int().nonnegative(),pending:ve.number().int().nonnegative(),running:ve.number().int().nonnegative(),ready:ve.number().int().nonnegative(),failed:ve.number().int().nonnegative(),missing:ve.number().int().nonnegative(),unclassified:ve.number().int().nonnegative()}).strict()}).strict();var xe=e=>He.string().trim().max(e),Lm=He.array(He.string().trim().min(1).max(120)).max(20),Wo=He.object({company_name:He.string().trim().min(1).max(200),brand_name:xe(200),primary_products:He.string().trim().min(1).max(1e3),industry:xe(200),applications:xe(1e3),business_summary:xe(2e3),registered_capital:xe(200).default(""),legal_representative:xe(200).default(""),target_markets:Lm,customer_industries:xe(1e3),customer_roles:xe(1e3),buying_scenarios:xe(2e3),differentiators:xe(2e3),competitors:xe(1e3),trust_proof:xe(2e3),customer_cases:xe(3e3),channels:Lm,expected_domain:xe(255),brand_tone:xe(500),contact_name:xe(200),contact_info:xe(500),timezone:xe(100),launch_timing:xe(200),input_source_ids:He.array(Vn).max(50)}).strict(),Bb=He.enum(["draft","submitted"]),Bo=Wo.extend({id:Q,tenant_id:He.string().min(1),site_id:k,workflow_id:it,status:Bb,submitted_at:He.string().min(1).nullable(),created_at:He.string().min(1),updated_at:He.string().min(1)}).strict(),gN=M(Bo),hN=M(Bo),SN=M(Bo.nullable());var EN=Ms.extend({expected_current_node:rt.literal("website_scan"),type:rt.literal("existing_site"),result:Ms.shape.result.extend({website:rt.string().url(),scan_cards:rt.partialRecord(Hc,yo).refine(e=>Object.keys(e).length>0,{message:"At least one recognized scan card is required."})}).strict()}).strict(),RN=rt.object({expected_current_node:rt.literal("customer_materials"),materials:Wo}).strict(),IN=rt.object({expected_current_node:rt.literal("diagnosis")}).strict(),TN=rt.object({expected_current_node:rt.literal("strategy")}).strict();import{z as N}from"zod";var Ko=["compact","comfortable","airy"],Mm=["none","sm","md","lg","xl"],Um="lg",zo=["subtle","moderate","expressive"],Kb=[{id:"subtle",motionLevel:"subtle"},{id:"moderate",motionLevel:"moderate"},{id:"expressive",motionLevel:"expressive"}];function Fm(e){let n=Kb.find(s=>s.id===e);if(!n)throw new Error(`Unknown motion preset: ${e}`);return n}var Gm=["ocean","forest","clay","violet","graphite","crimson"],qm=["ai-forest","ai-navy","ai-steel"],Wm=/^gen-[0-9a-f]{8}$/,Ho=[{id:"ai-forest",name:"\u5DE5\u4E1A\u58A8\u7EFF \xB7 Industrial Teal",description:"\u6C89\u7A33\u4E13\u4E1A\uFF0C\u7A81\u51FA\u7CBE\u5BC6\u4E0E\u53EF\u4FE1\u3002",fallbackReason:"\u7A33\u5B9A\u4E13\u4E1A\u7684\u9ED8\u8BA4\u9009\u62E9\u3002",colorSeeds:{primary:"#0E7C6F",accent:"#2F6FED",foreground:"#0F1B2D"},surfaceMode:"light",radius:"sm"},{id:"ai-navy",name:"\u79D1\u6280\u6DF1\u84DD \xB7 Deep Tech Blue",description:"\u7406\u6027\u79D1\u6280\u611F\uFF0C\u5F3A\u8C03\u6280\u672F\u5B9E\u529B\u4E0E\u6570\u636E\u53EF\u4FE1\u3002",fallbackReason:"\u6280\u672F\u8868\u8FBE\u7684\u5907\u9009\u3002",colorSeeds:{primary:"#1E3A8A",accent:"#2F6FED",foreground:"#0F1B2D"},surfaceMode:"light",radius:"md"},{id:"ai-steel",name:"\u7CBE\u5BC6\u94F6\u7070 \xB7 Precision Steel",description:"\u514B\u5236\u6E05\u6670\uFF0C\u9002\u5408\u53C2\u6570\u4E0E\u5DE5\u7A0B\u7EC6\u8282\u8868\u8FBE\u3002",fallbackReason:"\u53C2\u6570\u4FE1\u606F\u8F83\u591A\u65F6\u7684\u5907\u9009\u3002",colorSeeds:{primary:"#475569",accent:"#94A3B8",foreground:"#111827"},surfaceMode:"light",radius:"none"}],$o=[{id:"ocean",colorSeeds:{primary:"#1e3a5f",accent:"#2563eb",foreground:"#0f172a"},surfaceMode:"light",radius:"md"},{id:"forest",colorSeeds:{primary:"#14532d",accent:"#16a34a",foreground:"#0f172a"},surfaceMode:"light",radius:"lg"},{id:"clay",colorSeeds:{primary:"#7c2d12",accent:"#ea580c",foreground:"#1c1917"},surfaceMode:"light",radius:"xl"},{id:"violet",colorSeeds:{primary:"#3b0764",accent:"#7c3aed",foreground:"#18181b"},surfaceMode:"light",radius:"lg"},{id:"graphite",colorSeeds:{primary:"#1f2937",accent:"#0d9488",foreground:"#111827"},surfaceMode:"light",radius:"none"},{id:"crimson",colorSeeds:{primary:"#7f1d1d",accent:"#dc2626",foreground:"#1f1012"},surfaceMode:"light",radius:"sm"}];function PN(e){let n=$o.find(s=>s.id===e);if(!n)throw new Error(`Unknown theme preset: ${e}`);return n}function Bm(e){return $o.find(n=>n.id===e)?.radius??Ho.find(n=>n.id===e)?.radius}var Vo=N.string().regex(/^#[0-9A-F]{6}$/i),Yn=N.string().trim().min(1).max(500),Km=N.string().datetime({offset:!0}),zb=N.enum(Gm),Hb=N.enum(qm),$b=N.string().regex(Wm),Xn=N.union([zb,Hb,$b]),Qn=N.enum(Ao),Zn=N.enum(zo),Jn=N.enum(Ko),Zs=N.enum(Mm),zm=300,Vb=N.string().trim().min(1).max(zm),Js=N.object({primary:Vo,accent:Vo,foreground:Vo}).strict(),Yb=N.object({id:Xn,rank:N.number().int().min(1).max(3),name:N.string().trim().min(1).max(120),description:N.string().trim().min(1).max(240),color_seeds:Js,surface_mode:N.enum(["light","dark"]),radius:Zs,font_pairing_id:Qn,motion_preset_id:Zn,density:Jn,weight_style:We.optional(),reason:Yn}).strict(),Hm=N.object({name:N.string().trim().min(1).max(120),description:N.string().trim().min(1).max(240),reason:Yn,color_seeds:Js,surface_mode:N.enum(["light","dark"]),radius:Zs,font_pairing_id:Qn,motion_preset_id:Zn,density:Jn,weight_style:We}).strict(),$m=N.object({version:N.number().int().min(1),recommendation_id:N.string().uuid(),theme_preset_id:Xn,color_seeds:Js,surface_mode:N.enum(["light","dark"]),font_pairing_id:Qn,motion_preset_id:Zn,density:Jn,radius:Zs.optional(),weight_style:We.optional(),aesthetic_note:Vb.optional(),updated_at:Km}).strict(),Xb=N.object({id:N.string().uuid(),version:N.number().int().min(1),catalog_version:N.string().trim().min(1).max(80),source:N.object({mode:N.enum(["ai","fallback"]),fallback_reason:N.string().trim().min(1).max(80).nullable()}).strict(),inputs:N.object({industry:N.string().trim().min(1).max(160).optional(),site_language:N.string().trim().min(2).max(35),owner_locale:Ie.optional(),strategy_version:N.number().int().min(1),input_digest:N.string().regex(/^sha256:[a-f0-9]{64}$/)}).strict(),theme:N.object({recommended_id:Xn,candidate_ids:N.array(Xn).length(3),candidates:N.array(Yb).length(3)}).strict().superRefine((e,n)=>{e.recommended_id!==e.candidate_ids[0]&&n.addIssue({code:"custom",path:["recommended_id"],message:"recommended_id must be the first candidate"}),e.candidates.some((s,i)=>s.id!==e.candidate_ids[i]||s.rank!==i+1)&&n.addIssue({code:"custom",path:["candidates"],message:"Candidates must follow candidate_ids order."})}),font:N.object({recommended_id:Qn,reason:Yn}).strict(),motion:N.object({recommended_id:Zn,reason:Yn}).strict(),density:N.object({recommended_id:Jn,reason:Yn}).strict(),conversion:Mt.optional(),generated_at:Km}).strict(),FN=N.object({force_refresh:N.boolean().optional()}).strict(),GN=N.object({request_id:N.string().trim().min(1).max(160),site_id:k,cached:N.boolean(),recommendation:Xb,selection:$m}).strict(),qN=N.object({recommendation_id:N.string().uuid(),expected_version:N.number().int().min(1),theme_preset_id:Xn,color_seeds:Js,surface_mode:N.enum(["light","dark"]),font_pairing_id:Qn,motion_preset_id:Zn,density:Jn,radius:Zs.optional(),weight_style:We.optional(),aesthetic_note:N.string().trim().max(zm).optional()}).strict(),WN=N.object({selection:$m}).strict(),Qb=4e3,BN=N.object({tenant_id:N.string().trim().min(1).max(160),site_id:k,site_language:N.string().trim().min(2).max(35),owner_locale:Ie,industry:N.string().trim().min(1).max(160).optional(),strategy_version_id:N.string().uuid(),strategy_version:N.number().int().min(1),strategy_checksum:N.string().regex(/^[a-f0-9]{64}$/),strategy_summary:N.array(N.string().trim().min(1).max(Qb)).min(1).max(Ne)}).strict(),Yo=N.object({theme_candidates:N.array(Hm).length(3),conversion:Mt.optional()}).strict().superRefine((e,n)=>{let s=new Set;e.theme_candidates.forEach((i,o)=>{let a=JSON.stringify(i.color_seeds).toUpperCase();s.has(a)&&n.addIssue({code:"custom",path:["theme_candidates",o,"color_seeds"],message:"Theme candidates must have pairwise distinct color_seeds"}),s.add(a)})});function KN(){return Ho.map(e=>Hm.parse({name:e.name,description:e.description,reason:e.fallbackReason,color_seeds:e.colorSeeds,surface_mode:e.surfaceMode,radius:e.radius,font_pairing_id:Ao[0],motion_preset_id:zo[0],density:Ko[1],weight_style:Fs}))}function Zb(e){return e.radius??Bm(e.theme_preset_id)??"lg"}function Jb(e,n){return e.weight_style??n?.theme?.candidates?.find(s=>s.id===e.theme_preset_id)?.weight_style??n?.theme?.candidates?.[0]?.weight_style??Fs}function zN(e,n){let s=im(e.font_pairing_id),i=Fm(e.motion_preset_id);return{colorSeeds:e.color_seeds,surfaceMode:e.surface_mode,fonts:{heading:s.heading,body:s.body},density:e.density,motionLevel:i.motionLevel,motionPreset:i.id,radius:Zb(e),weightStyle:Jb(e,n)}}function HN(e,n){let s=e.theme.candidates[0];return{version:1,recommendation_id:e.id,theme_preset_id:s.id,color_seeds:s.color_seeds,surface_mode:s.surface_mode,font_pairing_id:e.font.recommended_id,motion_preset_id:e.motion.recommended_id,density:e.density.recommended_id,radius:s.radius,weight_style:s.weight_style,updated_at:n.toISOString()}}import{z as Xo}from"zod";function ey(e){return JSON.stringify([e.color_seeds.primary.toUpperCase(),e.color_seeds.accent.toUpperCase(),e.color_seeds.foreground.toUpperCase(),e.surface_mode,e.font_pairing_id,e.radius,e.motion_preset_id,e.density,e.weight_style])}var ty=Xo.object(Yo.shape).strict().superRefine((e,n)=>{let s=new Set;e.theme_candidates.forEach((i,o)=>{let a=ey(i);s.has(a)&&n.addIssue({code:"custom",path:["theme_candidates",o],message:"Theme candidates must have pairwise distinct visual identities"}),s.add(a)})}),XN=Xo.union([Yo,ty.safeExtend({model_profile:Xo.literal("azure-gpt")})]);import{z as Ct}from"zod";var ej=Ct.object({site_id:k,site_language:Ct.string().trim().min(2).max(35),business_facts:Ct.array(Ct.string().trim().min(1).max(1e3)).min(1).max(8)}).strict(),ny=Ct.enum(["high","medium","low"]),tj=Ct.object({skill_name:Ct.string().trim().min(1).max(80).nullable(),confidence:ny,reason:Ct.string().trim().min(1).max(240)}).strict();import{z as es}from"zod";var Vm=1e4,sy=es.object({note:es.string().trim().max(Vm),updated_at:es.string().min(1)}).strict(),oj=es.object({note:es.string().trim().max(Vm)}).strict(),aj=M(sy.nullable());import{z as ie}from"zod";var Qo=["title","text","richtext","number","boolean","date","datetime","url","email","color","select","multiselect","tag"],ei=ie.object({name:ie.string().min(1).max(100),type:ie.enum(Qo),label:ie.string().min(1).max(255),required:ie.boolean().optional(),options:ie.array(ie.string()).optional()}),mj=ie.object({name:ie.string(),cms_type:ie.string(),label:ie.string().optional(),required:ie.boolean().optional(),value_shape:ie.string().optional(),front_display:ie.enum(["visible","internal","forbidden"]).optional(),choices:ie.array(ie.object({value:ie.union([ie.string(),ie.number()]),label:ie.string()})).optional()}),lj=ie.object({route_file_path:ie.string().min(1),target_component_path:ie.string().min(1),content_type_hint:ie.string().min(1),collection_purpose:ie.enum(["generic","product"]).optional(),required_fields:ie.array(ei).optional(),mode:ie.enum(["bind_existing","provision"]),list_mode:ie.enum(["page","embedded"]).optional(),fields:ie.array(ei).optional(),seed_records:ie.array(ie.record(ie.string(),ie.unknown())).optional()});import{z as G}from"zod";var ts=G.number().int().positive().refine(Number.isSafeInteger,"Must be a safe positive integer"),ti=G.string().regex(/^[a-f0-9]{64}$/),ni=G.string().regex(/^[a-z][a-z0-9-]{0,99}$/),si=G.string().regex(/^[a-z0-9]{1,30}$/),Ve=e=>G.string().max(e).refine(n=>n.trim().length>0,"Value must not be blank"),Ym=G.object({id:G.string().uuid(),key:Ve(100),name:Ve(255)}).strict(),Qm=new Set(["title","summary","description","category","thumbnail","url","admin_id"]),iy=new Set(["title","summary","description","image_query"]),oy=new Set(["category","thumbnail","url","admin_id","page","pages","route","path","component","components","snapshot","run","site_id","cms_site_id","tenant_id","token","secret","password","authorization","headers","__proto__","prototype","constructor"]),Xm=new Set(["select","multiselect"]),ay=new Set(["title","text","richtext","date","datetime","url","email","color"]),ry=G.object({name:Ve(100),label:Ve(255),type:G.enum(Qo),required:G.boolean().optional(),options:G.array(Ve(100)).max(100).optional()}).strict().superRefine((e,n)=>{let s=e.options??[];Xm.has(e.type)&&s.length===0&&n.addIssue({code:"custom",path:["options"],message:"Choice fields require at least one option"}),!Xm.has(e.type)&&s.length>0&&n.addIssue({code:"custom",path:["options"],message:"Only choice fields may declare options"}),new Set(s).size!==s.length&&n.addIssue({code:"custom",path:["options"],message:"Field options must be unique"}),Qm.has(e.name)&&n.addIssue({code:"custom",path:["name"],message:"Reserved CMS field names cannot be declared"})}),cy=G.array(ry).min(1).max(200),my=G.array(G.record(G.string(),G.unknown())).max(1e3);function $e(e,n,s){e.addIssue({code:"custom",path:n,message:s})}var ly=G.object({name:Ve(30),slug:si,collection_purpose:G.enum(["generic","product"]).optional(),fields:cy,seed_records:my}).strict().superRefine((e,n)=>{let s=e.fields.map(o=>o.name);new Set(s).size!==s.length&&n.addIssue({code:"custom",path:["fields"],message:"Field names must be unique"}),s.some(o=>!Qm.has(o))||n.addIssue({code:"custom",path:["fields"],message:"At least one custom field is required"});let i=new Map(e.fields.map(o=>[o.name,o]));e.seed_records.forEach((o,a)=>{for(let[c,r]of Object.entries(o)){let m=["seed_records",a,c];if(oy.has(c)){$e(n,m,"Seed cannot write reserved or runtime-owned fields");continue}if(c==="image_query"){(typeof r!="string"||r.trim()==="")&&$e(n,m,"image_query must be a non-empty string");continue}if(iy.has(c)){typeof r!="string"&&$e(n,m,"Seed skeleton text fields must be strings");continue}let x=i.get(c);if(!x){$e(n,m,"Seed contains an undeclared field");continue}if(r==null){$e(n,m,"Seed field values must not be null");continue}if(x.type==="select")(typeof r!="string"||!(x.options??[]).includes(r))&&$e(n,m,"Seed select value must be one of the declared options");else if(x.type==="multiselect")(!Array.isArray(r)||r.length===0||r.some(_=>typeof _!="string"||!(x.options??[]).includes(_)))&&$e(n,m,"Seed multiselect value must contain only declared options");else if(x.type==="number")(typeof r!="number"||!Number.isFinite(r))&&$e(n,m,"Seed number values must be finite numbers");else if(x.type==="boolean")typeof r!="boolean"&&$e(n,m,"Seed boolean values must be booleans");else if(x.type==="tag"){let _=Array.isArray(r)?r:[r];(_.length===0||_.some(w=>typeof w!="string"||w.trim()===""))&&$e(n,m,"Seed tag values must be non-empty strings")}else ay.has(x.type)&&typeof r!="string"&&$e(n,m,"Seed text-like values must be strings")}for(let c of e.fields)c.required&&!(c.name in o)&&$e(n,["seed_records",a,c.name],"Required fields must be present in every seed record")}),new TextEncoder().encode(JSON.stringify(e)).byteLength>1024*1024&&n.addIssue({code:"custom",path:[],message:"Application template must not exceed 1048576 UTF-8 bytes"})}),Zo=G.object({schema_version:G.literal(1),application:ly}).strict(),py=G.object({templateId:G.string().uuid(),stableKey:ni,resolvedVersion:ts,digest:ti,template:Zo}).strict(),dy=py,uy={alreadyCreated:"APPLICATION_ALREADY_CREATED",slugConflict:"APPLICATION_SLUG_CONFLICT",createInProgress:"APPLICATION_CREATE_IN_PROGRESS",cmsUnbound:"APPLICATION_CMS_UNBOUND",templateVersionUnavailable:"APPLICATION_TEMPLATE_VERSION_UNAVAILABLE",createFailed:"APPLICATION_CREATE_FAILED",createResultUnknown:"APPLICATION_CREATE_RESULT_UNKNOWN"},Zm=G.enum(Object.values(uy)),Jm=G.object({category_status:G.enum(["succeeded","failed","not_attempted"]),seed_status:G.enum(["skipped","succeeded","partial","failed"]),requested_count:G.number().int().nonnegative(),written_count:G.number().int().nonnegative().nullable(),published_count:G.number().int().nonnegative().nullable(),errors:G.array(G.object({stage:G.enum(["category","seed","receipt"]),code:Ve(100)}).strict()).max(20)}).strict(),_y=G.object({templateId:G.string().uuid(),stableKey:ni,title:Ve(200),description:G.string().max(1e3),thumbnailUrl:G.string().url().nullable(),resolvedVersion:ts,digest:ti,application:G.object({name:Ve(30),slug:si}).strict(),categories:G.array(Ym),tags:G.array(Ym),status:G.enum(["available","creating","created","conflict","failed"]),errorCode:Zm.nullable().optional(),template:Zo.optional()}).strict(),el=G.object({items:G.array(_y)}).strict(),_j=G.object({version:ts}).strict(),gy=G.object({app_slug:si,name:Ve(30),template:G.object({stable_key:ni,version:ts,digest:ti}).strict()}).strict(),hy=G.object({status:G.literal("created"),application:gy,initialization:Jm}).strict(),gj=hy,Sy=G.object({stable_key:ni,version:ts,digest:ti,created_at:G.string().datetime().nullable(),initialization:Jm.nullable()}).strict(),fy=G.object({app_slug:si,name:Ve(30),collection_slug:G.string().min(1),detail_prefix:G.string().min(1).optional(),source:Sy.nullable()}).strict(),hj=G.object({applications:G.array(fy)}).strict(),Sj=el,fj=G.object({code:Zm,message:Ve(500)}).strict(),bj=Zo,yj=dy,xj=el;import{z as _e}from"zod";var tl=e=>_e.string().max(e).refine(n=>n.trim().length>0,"Value must not be blank"),by=ei.strict(),sl=_e.array(by).min(1).max(200),yy=_e.array(_e.record(_e.string(),_e.unknown())).max(1e3),xy=_e.string().regex(/^[a-z0-9]{1,30}$/),Jo=_e.number().int().positive().refine(Number.isSafeInteger,"Must be a safe positive integer"),Tj=_e.object({name:tl(30),slug:tl(50),collection_purpose:_e.enum(["generic","product"]).optional(),fields:sl}).strict(),nl=_e.object({collection_slug:xy,detail_prefix:_e.string().min(1).max(255),plugin_id:Jo.optional()}).strict(),kj=_e.discriminatedUnion("kind",[nl.extend({kind:_e.literal("created")}),nl.extend({kind:_e.literal("exists")})]),Aj=_e.object({fields:sl,seed_records:yy,category_id:Jo}).strict(),Ey=_e.record(_e.string().min(1),_e.string().min(1).nullable()),Pj=_e.object({ids:_e.array(Jo).max(1e3),urls:Ey,failed:_e.array(_e.unknown()).max(1e3)}).strict();function wj(e){return e.replace(/[^a-zA-Z0-9]/g,"").toLowerCase().slice(0,30)}import{z as Ee}from"zod";import{z as ea}from"zod";var il=["lead-generation","trial-and-samples","quote-and-commerce","appointments-and-visits","resources-and-subscriptions","service-and-channel"],ol="-",Ry="embedded",ta=ea.enum([...il,ol]),Iy=ea.literal(Ry),na=ea.object({scene:ta,shape:Iy}).strict();function Dj(e){return il.find(n=>n===e)??ol}var ii=["text","textarea","email","phone","select","radio","multiselect","boolean","date","number","file"],Ty=["text","textarea","email","phone","select","radio","multiselect","boolean","date","number"],ky=Ee.object({name:Ee.string().min(1).max(100),type:Ee.enum(Ty),label:Ee.string().min(1).max(255),required:Ee.boolean().optional(),options:Ee.array(Ee.string()).optional()}),Ay=Ee.string().regex(/^[a-z][a-z0-9-]{0,48}$/).optional(),Lj=Ee.object({mode:Ee.enum(["bind_existing","provision"],{error:'mode is required. Use "bind_existing" or "provision". Never call connect_form with {}.'}),form_hint:Ee.string().min(1).optional(),name:Ee.string().min(1).max(255).optional(),scene:ta.optional(),component_slug:Ay,description:Ee.string().min(1).max(1e3).optional(),fields:Ee.array(ky).optional()}).superRefine((e,n)=>{e.mode==="provision"&&e.scene===void 0&&n.addIssue({code:"custom",path:["scene"],message:"scene is required for provision"}),e.mode==="bind_existing"&&e.scene!==void 0&&n.addIssue({code:"custom",path:["scene"],message:"scene is prohibited for bind_existing"}),e.mode==="bind_existing"&&!e.form_hint?.trim()&&n.addIssue({code:"custom",path:["form_hint"],message:"form_hint is required for bind_existing"}),e.mode==="provision"&&!e.name?.trim()&&n.addIssue({code:"custom",path:["name"],message:"name is required for provision"})}),Mj=Ee.object({name:Ee.string(),label:Ee.string(),cms_type:Ee.string(),required:Ee.boolean()});import{z as d}from"zod";var ns=/^[A-Za-z0-9][A-Za-z0-9_-]{0,127}$/,un=/^[A-Za-z][A-Za-z0-9_-]{0,127}$/,oi=/^[A-Za-z][A-Za-z0-9_]{0,99}$/,ml=/^[A-Za-z0-9][A-Za-z0-9_-]{0,99}$/,ia=/^[a-z][a-z0-9-]{0,99}$/,ll=/^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?$/,al=2,rl=3,ai=d.string().regex(ns),Py=d.string().regex(ns),oa=d.string().regex(ns),ss=d.string().regex(oi),aa=d.string().regex(ml),wy=d.discriminatedUnion("status",[d.object({status:d.literal("unbound"),form_code:d.null()}).strict(),d.object({status:d.literal("bound"),form_code:d.string().regex(un)}).strict(),d.object({status:d.literal("missing"),form_code:d.string().regex(un)}).strict()]),Cy=d.object({value:aa,label:d.string().trim().min(1).max(255)}).strict(),vy=d.object({kind:d.literal("field"),field_name:ss,type:d.enum(ii),label:d.string().trim().min(1).max(255),required:d.boolean(),span:d.enum(["full","half"]),options:d.array(Cy).max(100),max_files:d.number().int().min(1).max(5).optional()}).strict(),Dy=d.object({kind:d.literal("step-break"),step_id:d.string().regex(ns)}).strict(),Oy=d.discriminatedUnion("kind",[vy,Dy]),Ny=d.object({field_name:ss,type:d.enum(ii),last_label:d.string().max(255)}).strict(),jy=d.object({field_name:ss,value:aa,last_label:d.string().max(255)}).strict(),Ly=d.discriminatedUnion("kind",[d.object({kind:d.literal("custom")}).strict(),d.object({kind:d.literal("template"),slug:d.string().regex(ia),version:d.string().regex(ll)}).strict()]),My={select:2,radio:2,multiselect:1,DropdownSelection:2,RadioButton:2,Checkbox:1};function ct(e){return e.toLowerCase()}function pl(e,n){return e.trim().toLocaleLowerCase(n)}function dn(e,n){return`${ct(e)}\0${n}`}function ke(e,n,s,i){let o=new Set;for(let a of e){if(o.has(a)){i.addIssue({code:"custom",path:n,message:s});return}o.add(a)}}function ra(e,n,s,i){let o=My[e]??0;o>0&&n<o?i.addIssue({code:"custom",path:s,message:`choice field requires at least ${o} option${o===1?"":"s"}`}):o===0&&n>0&&i.addIssue({code:"custom",path:s,message:"non-choice fields must use an empty options array"})}var ca=d.object({schema_version:d.literal(1),min_runtime_version:d.number().int().positive(),form_definition_id:ai,binding:wy,content_locale:Ie,features:d.object({multistep:d.boolean()}).strict(),copy:d.object({title:d.string().max(255),description:d.string().max(1e3),submit_button:d.string().trim().min(1).max(100),success_message:d.string().trim().min(1).max(500),error_message:d.string().max(500)}).strict(),layout:d.object({columns:d.enum(["one","two"])}).strict(),nodes:d.array(Oy).min(1).max(200),source:Ly,retired:d.object({fields:d.array(Ny).max(1e3),options:d.array(jy).max(5e3)}).strict(),compatibility:d.object({standardization_version:d.number().int().positive(),diagnostics:d.array(d.string().trim().min(1).max(500)).max(100)}).strict()}).strict().superRefine((e,n)=>{let s=e.nodes.flatMap((r,m)=>r.kind==="field"?[[m,r]]:[]),i=s.map(([,r])=>r);i.length===0&&n.addIssue({code:"custom",path:["nodes"],message:"at least one field node is required"});let o=e.nodes.filter(r=>r.kind==="step-break");!e.features.multistep&&o.length>0&&n.addIssue({code:"custom",path:["nodes"],message:"step-break requires the multistep feature"}),e.features.multistep&&(e.min_runtime_version<al&&n.addIssue({code:"custom",path:["min_runtime_version"],message:`multistep requires runtime version ${al}`}),o.length===0&&n.addIssue({code:"custom",path:["nodes"],message:"multistep requires at least one step-break"}));for(let[r,m]of e.nodes.entries())m.kind==="step-break"&&(r===0||r===e.nodes.length-1||e.nodes[r-1]?.kind==="step-break"||e.nodes[r+1]?.kind==="step-break")&&n.addIssue({code:"custom",path:["nodes",r],message:"step-break must separate two non-empty steps"});ke(o.map(r=>r.step_id),["nodes"],"step_id must be unique",n),ke(i.map(r=>ct(r.field_name)),["nodes"],"field_name must be unique",n),ke(e.retired.fields.map(r=>ct(r.field_name)),["retired","fields"],"retired field_name must be unique",n);let a=new Set(e.retired.fields.map(r=>ct(r.field_name)));for(let[r,m]of s)a.has(ct(m.field_name))&&n.addIssue({code:"custom",path:["nodes",r,"field_name"],message:"retired field_name cannot be reused"}),ra(m.type,m.options.length,["nodes",r,"options"],n),m.type==="file"?e.min_runtime_version<rl&&n.addIssue({code:"custom",path:["min_runtime_version"],message:`file fields require runtime version ${rl}`}):m.max_files!==void 0&&n.addIssue({code:"custom",path:["nodes",r,"max_files"],message:"max_files is only valid for file fields"}),ke(m.options.map(x=>x.value),["nodes",r,"options"],"option value must be unique within a field",n),ke(m.options.map(x=>pl(x.label,e.content_locale)),["nodes",r,"options"],"option label must be unique within a field",n);ke(e.retired.options.map(r=>dn(r.field_name,r.value)),["retired","options"],"retired option identity must be unique",n);let c=new Set(e.retired.options.map(r=>dn(r.field_name,r.value)));for(let[r,m]of s)for(let[x,_]of m.options.entries())c.has(dn(m.field_name,_.value))&&n.addIssue({code:"custom",path:["nodes",r,"options",x,"value"],message:"retired option value cannot be reused"})}),Uy=["copy.title","copy.description","copy.submit_button","copy.success_message","copy.error_message","nodes.*.label","nodes.*.options.*.label"],Fy=new Set(Uy);function zj(e){let n=e.map(s=>typeof s=="number"||/^\d+$/.test(s)?"*":s).join(".");return Fy.has(n)}function Hj(e,n){let s=[],i=e.nodes.filter(r=>r.kind==="field"),o=new Map(n.nodes.filter(r=>r.kind==="field").map(r=>[ct(r.field_name),r])),a=new Map(n.retired.fields.map(r=>[ct(r.field_name),r])),c=new Map(n.retired.options.map(r=>[dn(r.field_name,r.value),r]));for(let r of i){let m=ct(r.field_name),x=o.get(m),_=a.get(m);x&&x.field_name!==r.field_name&&s.push({code:"FIELD_IDENTITY_CHANGED",field_name:r.field_name}),x&&x.type!==r.type&&s.push({code:"FIELD_TYPE_CHANGED",field_name:r.field_name}),!x&&_&&_.field_name!==r.field_name&&s.push({code:"FIELD_IDENTITY_CHANGED",field_name:r.field_name}),!x&&_&&_.type!==r.type&&s.push({code:"FIELD_TYPE_CHANGED",field_name:r.field_name}),!x&&!a.has(m)&&s.push({code:"FIELD_RETIREMENT_MISSING",field_name:r.field_name});let w=new Set(x?.options.map(B=>B.value)??[]);for(let B of r.options){let z=c.get(dn(r.field_name,B.value));!w.has(B.value)&&z&&z.field_name!==r.field_name&&s.push({code:"FIELD_IDENTITY_CHANGED",field_name:r.field_name}),!w.has(B.value)&&!z&&s.push({code:"OPTION_RETIREMENT_MISSING",field_name:r.field_name,value:B.value})}}for(let r of e.retired.fields){let m=a.get(ct(r.field_name));m&&m.field_name!==r.field_name&&s.push({code:"FIELD_IDENTITY_CHANGED",field_name:r.field_name}),m&&m.type!==r.type&&s.push({code:"FIELD_TYPE_CHANGED",field_name:r.field_name}),m||s.push({code:"FIELD_RETIREMENT_MISSING",field_name:r.field_name})}for(let r of e.retired.options){let m=c.get(dn(r.field_name,r.value));m&&m.field_name!==r.field_name&&s.push({code:"FIELD_IDENTITY_CHANGED",field_name:r.field_name}),m||s.push({code:"OPTION_RETIREMENT_MISSING",field_name:r.field_name,value:r.value})}return s}var Gy=d.enum(wn),vt=d.object({english:d.string().max(1e3),translations:d.partialRecord(Gy,d.string().max(1e3)).optional()}).strict(),qy=d.object({template_option_key:d.string().regex(ml),label:vt}).strict(),Wy=d.object({template_field_key:d.string().regex(oi),type:d.enum(ii),label:vt,required:d.boolean(),span:d.enum(["full","half"]),options:d.array(qy).max(100)}).strict(),By=d.object({template_step_key:d.string().regex(oi),after_field_key:d.string().regex(oi)}).strict(),$j=["lead-generation","trial-and-samples","quote-and-commerce","appointments-and-visits","resources-and-subscriptions","service-and-channel"],Vj=[1,1,1,1,1,1],dl=d.string().regex(ia),Ky=d.object({schema_version:d.literal(1),slug:dl,template_slugs:d.array(d.string().regex(/^[a-z][a-z0-9-]{0,99}$/)).max(500).optional(),name:vt,template_count:d.number().int().min(0).max(500)}).strict().superRefine((e,n)=>{e.name.english.trim()===""&&n.addIssue({code:"custom",path:["name","english"],message:"English category name is required"})}),zy=d.object({schema_version:d.literal(1),slug:d.string().regex(ia),version:d.string().regex(ll),category:dl,copy:d.object({title:vt,description:vt,submit_button:vt,success_message:vt,error_message:vt}).strict(),layout:d.object({columns:d.enum(["one","two"])}).strict(),fields:d.array(Wy).min(1).max(200),step_breaks:d.array(By).max(20).optional()}).strict().superRefine((e,n)=>{for(let a of["title","description","submit_button","success_message","error_message"])e.copy[a].english.trim()===""&&n.addIssue({code:"custom",path:["copy",a,"english"],message:"English baseline text is required"});ke(e.fields.map(a=>a.template_field_key),["fields"],"template_field_key must be unique",n);let s=new Map(e.fields.map((a,c)=>[a.template_field_key,c])),i=e.step_breaks??[];ke(i.map(a=>a.template_step_key),["step_breaks"],"template_step_key must be unique",n),ke(i.map(a=>a.after_field_key),["step_breaks"],"step breaks must not share an anchor field",n);let o=-1;for(let[a,c]of i.entries()){let r=s.get(c.after_field_key);r===void 0||r>=e.fields.length-1?n.addIssue({code:"custom",path:["step_breaks",a,"after_field_key"],message:"step break must follow an existing non-final field"}):r<=o&&n.addIssue({code:"custom",path:["step_breaks",a,"after_field_key"],message:"step breaks must follow field order"}),o=r??o}e.fields.length+i.length>200&&n.addIssue({code:"custom",path:["step_breaks"],message:"template fields and step breaks must not exceed 200 nodes"});for(let[a,c]of e.fields.entries()){c.label.english.trim()===""&&n.addIssue({code:"custom",path:["fields",a,"label","english"],message:"English field label is required"}),ra(c.type,c.options.length,["fields",a,"options"],n),ke(c.options.map(r=>r.template_option_key),["fields",a,"options"],"template_option_key must be unique within a field",n),ke(c.options.map(r=>r.label.english.trim().toLowerCase()),["fields",a,"options"],"English option labels must be unique within a field",n);for(let[r,m]of c.options.entries())m.label.english.trim()===""&&n.addIssue({code:"custom",path:["fields",a,"options",r,"label","english"],message:"English option label is required"})}}),Yj=d.object({schema_version:d.literal(1),visibility:d.enum(["internal","public"]),categories:d.array(Ky).max(500),templates:d.array(zy).max(500)}).strict().superRefine((e,n)=>{let s=(o,a)=>{let c=wn.filter(r=>!o.translations?.[r]?.trim());c.length>0&&n.addIssue({code:"custom",path:[...a,"translations"],message:`public template copy is missing locales: ${c.join(", ")}`})};ke(e.categories.map(o=>o.slug),["categories"],"template category slug must be unique",n);let i=new Set(e.categories.map(o=>o.slug));for(let[o,a]of e.categories.entries()){let c=e.templates.filter(r=>a.template_slugs?a.template_slugs.includes(r.slug):r.category===a.slug).length;a.template_count!==c&&n.addIssue({code:"custom",path:["categories",o,"template_count"],message:"template_count must match catalog templates"})}ke(e.templates.map(o=>o.slug),["templates"],"template slug must be unique",n);for(let[o,a]of e.templates.entries())(e.categories.some(r=>r.template_slugs!==void 0)?!e.categories.some(r=>r.template_slugs?.includes(a.slug)):!i.has(a.category))&&n.addIssue({code:"custom",path:["templates",o,"category"],message:"template category must exist in catalog categories"});for(let[o,a]of e.categories.entries())if(a.template_slugs){ke(a.template_slugs,["categories",o,"template_slugs"],"template membership must be unique",n);for(let c of a.template_slugs)e.templates.some(r=>r.slug===c)||n.addIssue({code:"custom",path:["categories",o,"template_slugs"],message:"template membership must exist in catalog templates"})}if(e.visibility==="public"){for(let[o,a]of e.categories.entries())s(a.name,["categories",o,"name"]);for(let[o,a]of e.templates.entries()){for(let[c,r]of Object.entries(a.copy))s(r,["templates",o,"copy",c]);for(let[c,r]of a.fields.entries()){s(r.label,["templates",o,"fields",c,"label"]);for(let[m,x]of r.options.entries())s(x.label,["templates",o,"fields",c,"options",m,"label"])}}}});function Xj(e,n){let s=Ir(n),i=s?e.translations?.[s]:void 0;return i!==void 0&&i.trim()!==""?i:e.english}var Hy=["Text","Summary","Email","Phone","DropdownSelection","RadioButton","Checkbox","Boolean","Date","Num","MultipleFile","SpecificFile"],$y={text:"Text",textarea:"Summary",email:"Email",phone:"Phone",select:"DropdownSelection",radio:"RadioButton",multiselect:"Checkbox",boolean:"Boolean",date:"Date",number:"Num",file:"MultipleFile"},Vy=d.object({value:aa,label:d.string().trim().min(1).max(255)}).strict(),Yy=d.object({field_name:ss,field_type:d.enum(Hy),field_label:d.string().trim().min(1).max(255),is_required:d.boolean(),sort_order:d.number().int().nonnegative(),options:d.array(Vy).max(100)}).strict(),ul=d.object({version:d.literal(1),locale:Ie,fields:d.array(Yy).min(1).max(200)}).strict().superRefine((e,n)=>{ke(e.fields.map(s=>ct(s.field_name)),["fields"],"field_name must be unique",n);for(let[s,i]of e.fields.entries())ra(i.field_type,i.options.length,["fields",s,"options"],n),ke(i.options.map(o=>o.value),["fields",s,"options"],"option value must be unique within a field",n),ke(i.options.map(o=>pl(o.label,e.locale)),["fields",s,"options"],"option label must be unique within a field",n)});function Qj(e){let n=e.nodes.filter(s=>s.kind==="field").map((s,i)=>({field_name:s.field_name,field_type:s.type==="file"&&s.max_files===1?"SpecificFile":$y[s.type],field_label:s.label,is_required:s.required,sort_order:i,options:s.options.map(o=>({...o}))}));return ul.parse({version:1,locale:e.content_locale,fields:n})}function Zj(e){return{form_display:{columns:e.layout.columns},fields:e.nodes.filter(n=>n.kind==="field").map(n=>({field_name:n.field_name,span:n.span}))}}function Jj(e,n){if(e.binding.form_code!==null&&e.binding.form_code!==n.form.form_code)return e;let s=new Map(n.fields.map(i=>[i.field_name,i.span]));return{...e,layout:{columns:n.form.config_basic?.form_display?.columns??e.layout.columns},nodes:e.nodes.map(i=>i.kind==="field"?{...i,span:s.get(i.field_name)??i.span}:i)}}var de=d.string().regex(/^sha256:[0-9a-f]{64}$/),Xy=d.union([Re,d.enum(["app/api/forms/[code]/route.ts","hooks/use-cms-form-submit.ts","lib/cms/forms.ts","lib/cms/client.ts"])]),Qy=d.object({path:Xy,content_hash:de.nullable()}).strict(),Zy=d.array(Qy).min(1).max(500).superRefine((e,n)=>{ke(e.map(s=>s.path),[],"affected file paths must be unique",n)}),ma=d.object({grade:d.enum(["standard","A","B","C"]),required:d.boolean(),pending_confirmations:d.array(d.object({item_id:d.string().regex(ns),field_name:ss.optional(),kind:d.enum(["form_copy","layout","field_label","field_type","field_required","field_options"]),message:d.string().trim().min(1).max(500)}).strict().superRefine((e,n)=>{e.kind.startsWith("field_")&&!e.field_name&&n.addIssue({code:"custom",path:["field_name"],message:"field confirmation items require field_name"})})).max(200)}).strict().superRefine((e,n)=>{let s=e.grade==="standard";s===e.required&&n.addIssue({code:"custom",path:["required"],message:s?"standard forms do not require standardization confirmation":"legacy forms require standardization confirmation"}),e.grade==="C"&&e.pending_confirmations.length===0&&n.addIssue({code:"custom",path:["pending_confirmations"],message:"grade C requires at least one pending confirmation"}),e.grade!=="C"&&e.pending_confirmations.length>0&&n.addIssue({code:"custom",path:["pending_confirmations"],message:"only grade C can contain pending confirmations"})}),Jy=d.object({site_id:k,form_definition_id:ai,base_snapshot_id:I,expected_form_spec_hash:de,expected_cms_schema_hash:de.nullable(),form_metadata:na.nullable(),draft_form_spec_hash:de,desired_cms_schema_hash:de,affected_files_hash:de,shared_reference_hash:de,shared_reference_count:d.number().int().positive(),confirm_shared_update:d.boolean(),recreate_missing_binding:d.boolean(),standardization:ma,confirm_standardization:d.boolean()}).strict(),_l=d.object({reference_hash:de,page_count:d.number().int().positive(),block_count:d.number().int().positive()}).strict().refine(e=>e.page_count<=e.block_count,{message:"page_count cannot exceed block_count"}),eL=d.object({site_id:k,form_block_id:Py,base_snapshot_id:I,form_spec:ca,runtime_upgrade_required:d.boolean(),expected_form_spec_hash:de,expected_cms_schema_hash:de.nullable(),affected_files_hash:de,shared_impact:_l,standardization:ma}).strict(),ex=d.object({operation_id:oa,operation_fingerprint:de,site_id:k,form_definition_id:ai,base_snapshot_id:I,expected_form_spec_hash:de,expected_cms_schema_hash:de.nullable(),form_metadata:na.nullable(),draft_form_spec:ca,draft_form_spec_hash:de,desired_cms_schema_hash:de,affected_files_hash:de,shared_impact:_l,confirm_shared_update:d.boolean(),recreate_missing_binding:d.boolean(),standardization:ma,confirm_standardization:d.boolean()}).strict().superRefine((e,n)=>{e.form_definition_id!==e.draft_form_spec.form_definition_id&&n.addIssue({code:"custom",path:["form_definition_id"],message:"form_definition_id must match draft_form_spec"}),e.shared_impact.block_count>1&&!e.confirm_shared_update&&n.addIssue({code:"custom",path:["confirm_shared_update"],message:"shared definition updates require explicit confirmation"});let s=e.draft_form_spec.binding.status==="missing";s!==e.recreate_missing_binding&&n.addIssue({code:"custom",path:["recreate_missing_binding"],message:s?"missing bindings require explicit recreation confirmation":"only missing bindings can be recreated"});let i=e.draft_form_spec.binding.status==="bound",o=i&&e.standardization.required&&(e.standardization.grade==="B"||e.standardization.grade==="C");(i&&!o&&e.expected_cms_schema_hash===null||!i&&e.expected_cms_schema_hash!==null)&&n.addIssue({code:"custom",path:["expected_cms_schema_hash"],message:i?"bound standard forms require the current CMS schema hash":"unbound or missing forms cannot claim a current CMS schema hash"}),e.confirm_standardization!==e.standardization.required&&n.addIssue({code:"custom",path:["confirm_standardization"],message:e.standardization.required?"legacy standardization requires explicit confirmation":"standard forms cannot claim legacy standardization confirmation"})}),tx=["created","validated","binding_reserved","candidate_ready","cms_applied","snapshot_promoted","committed","compensating","recovery_required","failed"],la=d.enum(tx),nx=["pending","running","succeeded","failed","recovery_required"],gl=d.enum(nx),sx=["candidate_abandon","snapshot_reconcile","cms_restore"],hl=d.enum(sx),ix=["FORM_DESIGN_INVALID","FORM_DESIGN_UNSUPPORTED","FORM_DESIGN_STANDARDIZATION_AGENT_REQUIRED","FORM_DESIGN_STANDARDIZATION_UNSUPPORTED","FORM_DESIGN_FEATURE_NOT_ENABLED","FORM_DESIGN_PERMISSION_DENIED","FORM_DESIGN_LOCKED","FORM_DESIGN_CODE_CONFLICT","FORM_DESIGN_CMS_CONFLICT","FORM_DESIGN_CMS_SCHEMA_MISMATCH","FORM_DESIGN_CMS_NOT_FOUND","FORM_DESIGN_BINDING_MISSING","FORM_DESIGN_OPERATION_CONFLICT","FORM_DESIGN_CMS_UNAVAILABLE","FORM_DESIGN_PATCH_FAILED","FORM_DESIGN_COMPENSATION_FAILED","FORM_DESIGN_RECOVERY_REQUIRED"],pa=d.enum(ix),Sl=d.enum(["wait","resume","retry_new_operation","manual_recovery","none"]),fl=d.enum(["not_started","pending","succeeded","failed"]),bl=d.object({operation_id:oa,operation_fingerprint:de,site_id:k,form_definition_id:ai,stage:la,status:gl,base_snapshot_id:I,candidate_snapshot_id:I.nullable(),before_form_code:d.string().regex(un).nullable(),materialized_form_code:d.string().regex(un).nullable(),expected_form_spec_hash:de,draft_form_spec_hash:de,materialized_form_spec_hash:de.nullable(),expected_cms_schema_hash:de.nullable(),desired_cms_schema_hash:de,retry_count:d.number().int().nonnegative(),failure_stage:hl.nullable(),last_error_code:pa.nullable(),retryable:d.boolean(),next_action:Sl,preview_refresh_status:fl,created_at:d.string().datetime({offset:!0}),updated_at:d.string().datetime({offset:!0})}).strict().superRefine((e,n)=>{if(!(e.stage!=="committed"&&e.status!=="succeeded")){(e.stage!=="committed"||e.status!=="succeeded")&&n.addIssue({code:"custom",path:["status"],message:"committed stage and succeeded status must be reported together"});for(let s of["candidate_snapshot_id","materialized_form_code","materialized_form_spec_hash"])e[s]===null&&n.addIssue({code:"custom",path:[s],message:`${s} is required for a committed success`});(e.failure_stage!==null||e.last_error_code!==null||e.retryable||e.next_action!=="none")&&n.addIssue({code:"custom",path:["next_action"],message:"a committed success cannot retain an error or retry action"})}}),da=d.object({operation:bl}).strict(),tL=da,nL=da,sL=d.object({operation_fingerprint:de}).strict(),iL=da,ox=d.preprocess(e=>{if(!e||typeof e!="object"||Array.isArray(e))return e;let n="form_metadata"in e?e:{...e,form_metadata:null};return"standardization"in e||"confirm_standardization"in e?n:{...n,standardization:{grade:"standard",required:!1,pending_confirmations:[]},confirm_standardization:!1}},ex),oL=d.object({operation:bl,request:ox,cms_replace_result:d.unknown().nullable()}).strict(),ax=d.object({stage:la.optional(),status:gl.optional(),candidate_snapshot_id:I.nullable().optional(),before_form_code:d.string().regex(un).nullable().optional(),materialized_form_code:d.string().regex(un).nullable().optional(),materialized_form_spec_hash:de.nullable().optional(),retry_count:d.number().int().nonnegative().optional(),failure_stage:hl.nullable().optional(),last_error_code:pa.nullable().optional(),retryable:d.boolean().optional(),next_action:Sl.optional(),preview_refresh_status:fl.optional()}).strict(),aL=d.object({expected_updated_at:d.string().datetime({offset:!0}),operation:ax,cms_replace_result:d.unknown().nullable().optional()}).strict().refine(e=>Object.keys(e.operation).length>0||Object.hasOwn(e,"cms_replace_result"),{message:"transition must change operation state or CMS result"}),rL=d.object({code:pa,message:d.string().trim().min(1).max(500),retryable:d.boolean(),operation_id:oa.optional(),stage:la.optional()}).strict();function rx(e){return Jy.parse({site_id:e.site_id,form_definition_id:e.form_definition_id,base_snapshot_id:e.base_snapshot_id,expected_form_spec_hash:e.expected_form_spec_hash,expected_cms_schema_hash:e.expected_cms_schema_hash,draft_form_spec_hash:e.draft_form_spec_hash,desired_cms_schema_hash:e.desired_cms_schema_hash,affected_files_hash:e.affected_files_hash,form_metadata:e.form_metadata,shared_reference_hash:e.shared_impact.reference_hash,shared_reference_count:e.shared_impact.block_count,confirm_shared_update:e.confirm_shared_update,recreate_missing_binding:e.recreate_missing_binding,standardization:e.standardization,confirm_standardization:e.confirm_standardization})}function cl(e){for(let n=0;n<e.length;n+=1){let s=e.charCodeAt(n);if(s>=55296&&s<=56319){let i=e.charCodeAt(n+1);if(n+1>=e.length||i<56320||i>57343)throw new TypeError("canonical JSON cannot contain a lone surrogate");n+=1}else if(s>=56320&&s<=57343)throw new TypeError("canonical JSON cannot contain a lone surrogate")}}function sa(e,n){if(e===null)return"null";if(typeof e=="boolean")return e?"true":"false";if(typeof e=="number"){if(!Number.isFinite(e))throw new TypeError("canonical JSON numbers must be finite");return JSON.stringify(e)}if(typeof e=="string")return cl(e),JSON.stringify(e);if(typeof e!="object")throw new TypeError("value is not valid JSON");if(n.has(e))throw new TypeError("canonical JSON cannot contain cycles");n.add(e);try{if(Array.isArray(e)){let a=[];for(let c=0;c<e.length;c+=1){if(!(c in e))throw new TypeError("canonical JSON cannot contain sparse arrays");a.push(sa(e[c],n))}return`[${a.join(",")}]`}let s=Object.getPrototypeOf(e);if(s!==Object.prototype&&s!==null)throw new TypeError("canonical JSON objects must be plain records");let i=e;return`{${Object.keys(i).sort().map(a=>(cl(a),`${JSON.stringify(a)}:${sa(i[a],n)}`)).join(",")}}`}finally{n.delete(e)}}function ua(e){return sa(e,new Set)}async function ri(e){let n=ua(e),s=new TextEncoder().encode(n),i=globalThis.crypto?.subtle?new Uint8Array(await globalThis.crypto.subtle.digest("SHA-256",s)):(await import("@noble/hashes/sha256")).sha256(s);return`sha256:${Array.from(i,a=>a.toString(16).padStart(2,"0")).join("")}`}async function cL(e){return ri(ca.parse(e))}async function mL(e){return ri(ul.parse(e))}async function lL(e){let n=Zy.parse(e).map(s=>({...s})).sort((s,i)=>s.path<i.path?-1:s.path>i.path?1:0);return ri({version:1,files:n})}async function pL(e){return ri(rx(e))}import{z as D}from"zod";var _L=["page-seo","root-layout-metadata","nav-items"],gL=D.object({path:D.string(),title:D.string(),description:D.string().optional(),keywords:D.string().optional(),meta_tags_json:D.record(D.string(),D.record(D.string(),D.string())).nullish(),schema_json:D.union([D.record(D.string(),D.unknown()),D.array(D.record(D.string(),D.unknown())),D.string()]).nullish(),breadcrumbs_json:D.array(D.object({name:D.string().optional(),text:D.string().optional(),url:D.string().nullish()})).nullish()}),hL=D.object({metadataBase:D.string().optional(),title:D.union([D.string(),D.object({default:D.string().optional(),template:D.string().optional(),absolute:D.string().optional()})]).optional(),description:D.string().optional(),keywords:D.string().optional(),openGraph:D.object({title:D.string().optional(),description:D.string().optional(),type:D.string().optional(),siteName:D.string().optional(),url:D.string().optional(),locale:D.string().optional(),images:D.array(D.union([D.string(),D.object({url:D.string(),alt:D.string().optional()})])).optional()}).optional(),twitter:D.object({card:D.string().optional(),title:D.string().optional(),description:D.string().optional(),images:D.array(D.string()).optional()}).optional(),alternates:D.object({canonical:D.string().optional()}).optional(),robots:D.union([D.string(),D.record(D.string(),D.unknown())]).optional()}),yl=()=>D.object({label:D.string(),href:D.string().optional(),targetType:D.enum(["page","anchor","external","email","phone","file","group"]).optional(),role:D.enum(["link","cta"]).optional(),openInNewTab:D.boolean().optional(),nofollow:D.boolean().optional(),description:D.string().optional(),badge:D.string().optional(),iconKey:D.string().optional()}),SL=yl().extend({children:D.array(yl()).optional()}),cx=["title","description","keywords","breadcrumbs_json.*.name","breadcrumbs_json.*.text"],mx=["path","meta_tags_json.**","schema_json.**","breadcrumbs_json.*.url"],lx=["title","title.default","title.template","title.absolute","description","keywords","openGraph.title","openGraph.description","openGraph.siteName","openGraph.images.*.alt","twitter.title","twitter.description"],px=["metadataBase","openGraph.type","openGraph.url","openGraph.locale","openGraph.images.*","openGraph.images.*.url","twitter.card","twitter.images.*","alternates.canonical","robots.**"],dx=["label","description","badge"],ux=["href","targetType","role","iconKey"],xl={"page-seo":{localizable:cx,machine:mx},"root-layout-metadata":{localizable:lx,machine:px},"nav-items":{localizable:dx,machine:ux}},El="*",Rl="**",_x="children";function gx(e){return typeof e=="number"||/^\d+$/.test(e)?El:e}function Il(e,n){let s=n.map(gx);return e!=="nav-items"?s:s.filter(i=>i!==El&&i!==_x)}function Tl(e,n){let s=e.split(".");for(let i=0;i<s.length;i+=1){if(s[i]===Rl)return!0;if(i>=n.length||s[i]!==n[i])return!1}return s.length===n.length}function hx(e,n){let s=e.split(".");if(n.length>=s.length)return!1;for(let i=0;i<n.length;i+=1){if(s[i]===Rl)return!0;if(s[i]!==n[i])return!1}return!0}function fL(e,n){let s=Il(e,n);return s.length===0?!1:xl[e].localizable.some(i=>Tl(i,s))}function bL(e,n){let s=Il(e,n);if(s.length===0)return!0;let{localizable:i,machine:o}=xl[e];return[...i,...o].some(a=>Tl(a,s)||hx(a,s))}var EL=["product-search","migration-products","standard-form","form-submission-infrastructure"],Sx=[{path:"app/search/page.tsx",materializer:"product-search"},{path:"components/site/generated/product-search/entry.tsx",materializer:"product-search"},{path:"components/site/generated/product-search/results.tsx",materializer:"product-search"},{path:"app/api/product-search/facets/route.ts",materializer:"product-search"},{path:"lib/cms/product-search.ts",materializer:"product-search"},{path:"lib/generated/product-search-value-codec.ts",materializer:"product-search"},{path:"lib/generated/product-search-config.json",materializer:"product-search"},{path:`lib/cms/generated/${St}.ts`,materializer:"migration-products"},{path:`components/site/generated/${St}-list.tsx`,materializer:"migration-products"},{path:`app/${St}/[slug]/page.tsx`,materializer:"migration-products"},{path:`components/site/generated/${St}-breadcrumb.tsx`,materializer:"migration-products"},{path:"components/site/generated/forms/vcp-form-runtime.tsx",materializer:"standard-form"},{path:"app/api/forms/[code]/route.ts",materializer:"form-submission-infrastructure"},{path:"hooks/use-cms-form-submit.ts",materializer:"form-submission-infrastructure"},{path:"lib/cms/forms.ts",materializer:"form-submission-infrastructure"}],fx=[{prefix:"components/site/generated/forms/form-",suffix:".tsx",materializer:"standard-form"}],RL=[{path:`components/site/generated/${St}-list-view.tsx`,reason:"\u8DEF\u5F84\u5F52\u5E73\u53F0\u3001\u5185\u5BB9\u5F52\u7AD9\u70B9\uFF1A\u4E13\u7528\u4EA7\u54C1 Worker \u6309\u7AD9\u70B9\u8BBE\u8BA1\u751F\u6210\u5217\u8868\u89C6\u56FE\uFF1B\u9996\u6B21 fallback \u4E0D\u6539\u53D8\u5F52\u5C5E\uFF0C\u9759\u6001\u6587\u6848\u987B\u968F\u5B50\u7AD9\u7FFB\u8BD1\u3002"},{path:`components/site/generated/${St}-detail-view.tsx`,reason:"\u8DEF\u5F84\u5F52\u5E73\u53F0\u3001\u5185\u5BB9\u5F52\u7AD9\u70B9\uFF1A\u4E13\u7528\u4EA7\u54C1 Worker \u6309\u7AD9\u70B9\u8BBE\u8BA1\u751F\u6210\u8BE6\u60C5\u89C6\u56FE\uFF1B\u9996\u6B21 fallback \u4E0D\u6539\u53D8\u5F52\u5C5E\uFF0C\u9759\u6001\u6587\u6848\u987B\u968F\u5B50\u7AD9\u7FFB\u8BD1\u3002"},{path:"lib/cms/client.ts",reason:"\u4E0D\u662F\u7269\u5316\u4EA7\u7269\uFF1A\u6A21\u677F\u81EA\u5E26\u7684 CMS \u4F20\u8F93\u5C42\uFF0C\u7269\u5316\u5668\u53EA\u5BF9\u5B83\u505A\u5B9A\u70B9\u5B57\u7B26\u4E32\u5347\u7EA7\uFF08\u591A\u90E8\u5206\u8868\u5355\u63D0\u4EA4\u3001no-store \u8BFB\uFF09\uFF0C\u6574\u4EFD\u8986\u5199\u53CD\u800C\u4F1A\u62B9\u6389\u7AD9\u70B9\u4FA7\u7684\u5176\u4ED6\u5347\u7EA7\u3002"},{path:"components/site/generated/forms/form-<id>.spec.ts",reason:"\u8DEF\u5F84\u5F52\u5E73\u53F0\u3001\u5185\u5BB9\u5F52\u7AD9\u70B9\uFF1A\u8868\u5355\u8BBE\u8BA1\u5668\u5199\u7684\u5B57\u6BB5\u6587\u6848\uFF0C\u5F52 FORM_SPEC_LOCALIZABLE_FIELD_PATHS \u7684\u5B57\u6BB5\u7EA7\u6E05\u5355\u7BA1\u8F96\u3002"},{path:"components/system/not-found-content.tsx",reason:"\u4E00\u6B21\u6027\u5199\u5165\u3001\u4E4B\u540E\u5185\u5BB9\u5F52\u7AD9\u70B9\uFF1A\u5EFA\u7AD9\u65F6\u4EC5\u5728\u6A21\u677F\u539F\u7248\u4E0A\u6309\u7AD9\u70B9\u8BED\u79CD\u5199\u4E00\u6B21 404 \u6587\u6848\uFF0C\u4E4B\u540E\u7531\u7528\u6237\u3001\u8BBE\u8BA1\u5668\u6216 Agent \u7EF4\u62A4\uFF0C\u91CD\u8DD1\u4E5F\u4E0D\u4F1A\u8986\u5199\u6539\u8FC7\u7684\u5185\u5BB9\uFF1B\u5B50\u7AD9\u987B\u968F\u6574\u7AD9\u7FFB\u8BD1\u5B83\u3002"}];function bx(e){return e.length>0&&!e.includes("/")&&!e.includes(".")}function IL(e){return Sx.some(n=>n.path===e)?!0:fx.some(n=>!e.startsWith(n.prefix)||!e.endsWith(n.suffix)?!1:bx(e.slice(n.prefix.length,e.length-n.suffix.length)))}import{z as bt}from"zod";var yx=["provisioning","cms_app_created","seeded","ready","failed"],PL=bt.object({tenant_id:bt.string().min(1),site_id:k,collection_slug:bt.string().min(1),cms_collection_id:bt.string().min(1).nullable(),status:bt.enum(yx),owned_by_vcp:bt.boolean(),run_id:$.nullable(),last_error:bt.string().nullable(),created_at:bt.string().datetime(),updated_at:bt.string().datetime()});var kl="/vibe/v1";function xx(e){let n=e?.trim().replace(/\/+$/,"");if(!n)return null;try{let s=new URL(n),i=s.pathname.replace(/\/+$/,"");return s.search="",s.hash="",s.pathname=i.endsWith(kl)?i:kl,s.href.replace(/\/+$/,"")}catch{return n}}function CL(e){let n=xx(e.publicProxyUrl),s=e.cmsSiteId?.trim(),i=e.tenantId?.trim();return n&&s&&i?{cmsProxyUrl:n,cmsProjectId:s,cmsTenantId:i}:null}function DL(e){let n=e.tenant_id?.trim(),s=e.cms_site_id?.trim();if(!n||!s)throw new Error("CMS_REQUEST_CONTEXT_MISSING");return{Accept:"application/json","X-Tenant-Id":n,"X-Site-Id":s}}import{z as g}from"zod";var ci=g.string().url().refine(qx,{message:"URL must use http or https"}),Al=g.string().trim().pipe(ci),Ex=g.object({task_type:g.literal("home_url"),task_url:Al,planned_num:g.number().int().min(1).max(20).optional()}).strict(),Rx=g.object({task_type:g.literal("url_list"),urls:g.array(ci).min(1).max(1e4)}).strict(),LL=g.discriminatedUnion("task_type",[Ex,Rx]),ML=g.object({page:g.coerce.number().int().positive().default(1),page_size:g.coerce.number().int().min(1).max(20).default(20)}).strict(),UL=g.object({home_url:Al}).strict(),Ht=g.string().uuid(),_n=g.string().uuid(),FL=g.object({task_uuid:Ht}).strict(),Pl=g.enum(["URL_DISCOVERY","PAGE_CRAWL","TASK_SCHEDULING","RESULT_PERSISTENCE"]),Ix=g.object({task_uuid:Ht,status:g.literal("NOT_STARTED"),total:g.literal(0)}).strict(),Tx=g.object({task_uuid:Ht,status:g.literal("PROCESSING"),total:g.literal(0)}).strict(),GL=g.enum(["no_suitable_page_candidate","page_discovery_unavailable","page_selection_unavailable","page_selection_invalid","page_content_unavailable"]),kx=g.discriminatedUnion("status",[g.object({role:Tt,status:g.literal("selected"),reason_code:g.null()}).strict(),g.object({role:Tt,status:g.literal("not_found"),reason_code:g.literal("no_suitable_page_candidate")}).strict(),g.object({role:Tt,status:g.literal("unknown"),reason_code:g.enum(["page_discovery_unavailable","page_selection_unavailable","page_selection_invalid","page_content_unavailable"])}).strict()]),wl=g.array(kx).length(7).superRefine((e,n)=>{let s=new Set(e.map(i=>i.role));s.size!==e.length&&n.addIssue({code:"custom",message:"discovery coverage roles must be unique"});for(let i of Tt.options)s.has(i)||n.addIssue({code:"custom",message:`discovery coverage is missing role ${i}`})}),Ax=g.object({task_uuid:Ht,status:g.literal("SUCCEEDED"),total:g.number().int().positive(),discovery_coverage:wl.optional()}).strict(),Px=g.enum(["TASK_FAILED","PROVIDER_CAPABILITY_LIMIT","WEBSITE_UNREACHABLE"]),wx=g.object({task_uuid:Ht,status:g.literal("FAILED"),total:g.literal(0),error_code:Px,error_message:g.string().min(1),failure_stage:Pl}).strict(),qL=g.discriminatedUnion("status",[Ix,Tx,Ax,wx]),Cx=g.object({url:ci,raw_html:g.string().min(1)}).strict(),WL=g.object({task_uuid:Ht,status:g.literal("SUCCEEDED"),page:g.number().int().positive(),page_size:g.number().int().min(1).max(20),total:g.number().int().positive(),total_pages:g.number().int().positive(),pages:g.array(Cx).max(20),discovery_coverage:wl.optional()}).strict().superRefine((e,n)=>{e.total_pages!==Math.ceil(e.total/e.page_size)&&n.addIssue({code:"custom",path:["total_pages"],message:"total_pages must equal ceil(total / page_size)"}),e.pages.length>e.page_size&&n.addIssue({code:"custom",path:["pages"],message:"pages must not exceed page_size"})}),BL=g.object({task_code:_n}).strict(),vx=g.object({task_code:_n,status:g.literal("NOT_STARTED")}).strict(),Dx=g.object({task_code:_n,status:g.literal("PROCESSING")}).strict(),Ox=g.object({task_code:_n,status:g.literal("SUCCEEDED"),urls:g.array(ci)}).strict(),Nx=g.literal("SITEMAP_DISCOVERY_FAILED"),jx=g.object({task_code:_n,status:g.literal("FAILED"),error_code:Nx,error_message:g.string().min(1)}).strict(),KL=g.discriminatedUnion("status",[vx,Dx,Ox,jx]),zL=g.object({company_name:g.string().regex(/\S/u)}).strict(),Lx=g.object({company_name:g.string(),brand_name:g.string(),main_products:g.array(g.string()),industry:g.array(g.string()),subfields:g.array(g.string()),business_intro:g.string(),registered_capital:g.string(),legal_representative:g.string(),target_markets:g.array(g.string()),target_customer_industries:g.array(g.string()),target_customer_roles:g.array(g.string()),purchase_scenarios:g.string(),differentiators:g.array(g.string()),competitors:g.array(g.object({name:g.string(),official_url:g.string()}).strict()).max(3),qualifications:g.array(g.string()),representative_cases:g.array(g.string()),acquisition_channels:g.array(g.string()),desired_domain:g.string(),brand_tone:g.string(),timezone:g.string()}).strict(),mi=g.object({company_uuid:g.string().uuid(),company_info:Lx,created_at:g.string().datetime(),updated_at:g.string().datetime()}),Mx=mi.extend({status:g.literal("NOT_STARTED"),last_error_code:g.null(),last_error_message:g.null(),started_at:g.null(),completed_at:g.null()}).strict(),Ux=mi.extend({status:g.literal("PROCESSING"),last_error_code:g.null(),last_error_message:g.null(),started_at:g.string().datetime(),completed_at:g.null()}).strict(),Cl=mi.extend({status:g.literal("SUCCEEDED"),last_error_code:g.null(),last_error_message:g.null(),started_at:g.string().datetime(),completed_at:g.string().datetime()}).strict(),vl=mi.extend({status:g.literal("FAILED"),last_error_code:g.string().min(1),last_error_message:g.string().min(1),started_at:g.string().datetime(),completed_at:g.string().datetime()}).strict(),HL=g.discriminatedUnion("status",[Cl,vl]),$L=g.discriminatedUnion("status",[Mx,Ux,Cl,vl]),Fx=["BAD_REQUEST","NOT_FOUND","PAYLOAD_TOO_LARGE","INTERNAL_SERVER_ERROR","UNAUTHORIZED","FORBIDDEN","INVALID_TASK_TYPE","TASK_URL_REQUIRED","INVALID_PLANNED_NUM","URL_LIST_REQUIRED","URL_LIST_LIMIT_EXCEEDED","INVALID_URL_LIST","INVALID_PAGINATION","INVALID_TASK_CODE","INVALID_HOME_URL","TASK_CODE_HOME_URL_CONFLICT","SITEMAP_TASK_NOT_FOUND","SITEMAP_DISCOVERY_FAILED","TASK_NOT_FOUND","PROVIDER_CAPABILITY_LIMIT","TASK_FAILED","WEBSITE_UNREACHABLE"],Gx=g.enum(Fx),VL=g.object({error_code:Gx,error_message:g.string().min(1),failure_stage:Pl.optional(),task_uuid:Ht.optional(),task_code:_n.optional()}).strict();function qx(e){try{let n=new URL(e).protocol;return n==="http:"||n==="https:"}catch{return!1}}import{z as W}from"zod";var Ye=W.string().url().refine(Kx,{message:"URL must use http or https"}),Dl=W.string().min(1).max(512),li=W.string().datetime({offset:!0}),Ol=W.enum(["scraping","completed","failed","expired"]),QL=W.object({url:Ye,ignore_cache:W.boolean(),sitemap:W.enum(["include","skip"]),include_subdomains:W.boolean(),ignore_query_parameters:W.boolean(),limit:W.number().int().min(1).max(1e5)}).strict(),ZL=W.object({links:W.array(Ye).max(1e5)}).strict(),JL=W.object({url:Ye,limit:W.number().int().min(1).max(1e5),max_discovery_depth:W.literal(1),crawl_entire_domain:W.literal(!1),allow_subdomains:W.literal(!0),sitemap:W.literal("skip")}).strict(),eM=W.object({crawl_id:Dl,expires_at:li.optional()}).strict(),tM=W.object({status:Ol,urls:W.array(Ye).max(1e5),next:Ye.optional(),expires_at:li}).strict(),nM=W.object({url:Ye,formats:W.tuple([W.literal("rawHtml")]),only_main_content:W.literal(!1),max_age:W.number().int().nonnegative()}).strict(),sM=W.object({url:Ye,raw_html:W.string().min(1),status_code:W.number().int().min(100).max(599).nullable()}).strict(),iM=W.object({urls:W.array(Ye).min(1).max(1e4),formats:W.tuple([W.literal("rawHtml")]),ignore_invalid_urls:W.literal(!1),max_age:W.number().int().nonnegative(),max_concurrency:W.number().int().positive().optional()}).strict(),oM=W.object({batch_id:Dl,expires_at:li.optional()}).strict(),Wx=W.object({url:Ye,raw_html:W.string().min(1)}).strict(),aM=W.object({status:Ol,total:W.number().int().nonnegative(),completed:W.number().int().nonnegative(),pages:W.array(Wx).max(1e4),next:Ye.optional(),expires_at:li}).strict().superRefine((e,n)=>{e.completed>e.total&&n.addIssue({code:"custom",path:["completed"],message:"completed must not exceed total"})}),Bx=W.object({url:Ye,error_message:W.string().min(1)}).strict(),rM=W.object({errors:W.array(Bx).max(1e4),robots_blocked:W.array(Ye).max(1e4)}).strict(),cM=W.object({active:W.number().int().nonnegative(),waiting:W.number().int().nonnegative(),max_concurrency:W.number().int().positive()}).strict();function Kx(e){try{let n=new URL(e).protocol;return n==="http:"||n==="https:"}catch{return!1}}var Nl=["write_file","edit_file","delete_file"],jl="apply_patch_batch",zx=["set_breadcrumb_placement"],Hx=[...Nl,jl,...zx];function $x(e){return Nl.includes(e)}function lM(e){return Hx.includes(e)}function pM(e){return $x(e)||e===jl}import{z as y}from"zod";var Ll=y.lazy(()=>gn),Vx=y.enum(["page","block"]),di=y.enum(["component","page","pages"]),Yx=y.enum(["en-US","zh-CN","zh-TW","fr-FR","de-DE","es-ES","ja-JP","ko-KR"]),$t=Yx,Ml=y.object({requested_locale:$t,resolved_locale:$t,fallback_used:y.boolean()}).strict(),is=y.object({id:y.string().uuid(),key:y.string().min(1),name:y.string().min(1)}).strict(),pi=is.extend({color:y.string().nullable()}).strict(),hM=y.object({kind:Vx,category_id:y.string().uuid().optional(),tag_id:y.string().uuid().optional(),search:y.string().trim().min(1).max(200).optional(),limit:y.coerce.number().int().min(1).max(50).default(20),cursor:y.string().min(1).optional()}).strict(),Xx=y.object({stable_key:y.string().min(1),type:di,title:y.string().min(1).max(200),description:y.string().max(1e3),thumbnail_url:y.string().url().nullable(),resolved_version:y.number().int().positive(),content_schema_version:y.literal(3),category:is.nullable(),tags:y.array(pi),page_count:y.number().int().nonnegative(),component_count:y.number().int().nonnegative(),locale:Ml}).strict(),SM=y.object({items:y.array(Xx),facets:y.object({categories:y.array(is),tags:y.array(pi)}).strict(),next_cursor:y.string().nullable()}).strict(),fM=y.object({operation_id:y.string().uuidv7(),resolved_version:y.number().int().positive(),base_sitemap_id:y.string().uuid(),base_sitemap_version:y.number().int().positive(),sitemap:Ll,target_page_id:y.string().min(1).optional()}).strict(),bM=y.object({next_sitemap:Ll,applied:y.object({stable_key:y.string().min(1),resolved_version:y.number().int().positive(),template_type:di,page_ids:y.array(y.string().min(1)),block_ids:y.array(y.string().min(1))}).strict(),locale:Ml,warnings:y.array(y.string())}).strict(),Ul=y.object({nodeId:y.string().uuid(),type:y.string().trim().min(1).max(100),label:y.string().trim().min(1).max(200),variant:y.string().trim().min(1).max(100).optional(),order:y.number().int().nonnegative(),props:y.record(y.string(),y.unknown()),thumbnail:y.string().url().optional(),source:y.unknown().optional()}).strict(),Fl=y.object({nodeId:y.string().uuid().optional(),slug:y.string().regex(/^\/$|^\/[a-z0-9]+(?:-[a-z0-9]+)*(?:\/[a-z0-9]+(?:-[a-z0-9]+)*)*$/u),navigation:y.object({showInHeader:y.boolean(),showInFooter:y.boolean(),order:y.number().int().nonnegative()}).strict(),components:y.array(Ul).min(1).max(100),thumbnail:y.string().url().optional(),source:y.unknown().optional()}).strict(),Qx=Fl.extend({nodeId:y.uuidv7(),parentNodeId:y.uuidv7().optional()}).strict(),Zx=y.object({pages:y.array(Qx).min(1).max(50),thumbnail:y.string().url().optional(),source:y.unknown().optional()}).strict().superRefine(({pages:e},n)=>{let s=new Map(e.map(o=>[o.nodeId,o])),i=e.flatMap(o=>[o.nodeId,...o.components.map(a=>a.nodeId)]);new Set(i).size!==i.length&&n.addIssue({code:"custom",path:["pages"],message:"Node ids must be unique within the shared structure."}),new Set(e.map(o=>o.slug)).size!==e.length&&n.addIssue({code:"custom",path:["pages"],message:"Page slugs must be unique."});for(let[o,a]of e.entries()){if(a.parentNodeId===void 0)continue;let c=_=>n.addIssue({code:"custom",path:["pages",o,"parentNodeId"],message:_}),r=s.get(a.parentNodeId);r||c("Parent must reference a page in this template."),a.parentNodeId===a.nodeId&&c("A page cannot be its own parent."),(a.slug==="/"||r?.slug==="/")&&c("The home page cannot be a parent or child."),r?.parentNodeId!==void 0&&c("Pages allow at most two levels; the parent must be a root page.");let m=new Set([a.nodeId]),x=a.parentNodeId;for(;x!==void 0;){if(m.has(x)){c("Page parent references must not contain a cycle.");break}m.add(x),x=s.get(x)?.parentNodeId}}}),Jx=y.union([Ul,Fl,Zx]),eE=y.object({title:y.string().min(1).max(200),description:y.string().min(1).max(1e3),prompt:y.string().min(1).max(8192)}).strict(),tE=y.object({locale:$t,title:y.string().min(1).max(200),content:y.object({description:y.string().min(1).max(1e3),prompt:y.string().min(1).max(8192),nodes:y.record(y.string().uuid(),eE)}).strict()}).strict(),yM=y.object({templateId:y.string().uuid(),stableKey:y.string().min(1),type:di,resolvedVersion:y.number().int().positive(),contentSchemaVersion:y.literal(3),structure:Jx,requestedLocale:$t,resolvedLocale:$t,fallbackUsed:y.boolean(),contents:y.array(tE).length(1)}).strict().superRefine((e,n)=>{(e.type==="component"&&!("type"in e.structure)||e.type==="page"&&!("components"in e.structure)||e.type==="pages"&&!("pages"in e.structure))&&n.addIssue({code:"custom",path:["structure"],message:"Template type and structure must match."});let s=nE(e.structure),i=new Set(Object.keys(e.contents[0]?.content.nodes??{}));(s.size!==i.size||[...s].some(o=>!i.has(o)))&&n.addIssue({code:"custom",path:["contents",0,"content","nodes"],message:"Localized nodes must exactly match the structure nodes."}),e.contents[0]?.locale!==e.resolvedLocale&&n.addIssue({code:"custom",path:["contents"],message:"Resolved locale must match returned content."}),e.fallbackUsed!==(e.requestedLocale!==e.resolvedLocale)&&n.addIssue({code:"custom",path:["fallbackUsed"],message:"fallbackUsed must match locale resolution."})}),xM=y.object({items:y.array(y.object({stableKey:y.string().min(1),type:di,title:y.string().min(1).max(200),description:y.string().max(1e3),thumbnailUrl:y.string().url().nullable(),resolvedVersion:y.number().int().positive(),contentSchemaVersion:y.literal(3),category:is.nullable(),tags:y.array(pi),pageCount:y.number().int().nonnegative(),componentCount:y.number().int().nonnegative(),requestedLocale:$t,resolvedLocale:$t,fallbackUsed:y.boolean()}).strict()),facets:y.object({categories:y.array(is),tags:y.array(pi)}).strict(),nextCursor:y.string().nullable()}).strict().superRefine((e,n)=>{e.items.forEach((s,i)=>{s.fallbackUsed!==(s.requestedLocale!==s.resolvedLocale)&&n.addIssue({code:"custom",path:["items",i,"fallbackUsed"],message:"fallbackUsed must match locale resolution."})})});function nE(e){if("type"in e)return new Set([e.nodeId]);let n="pages"in e?e.pages:[e];return new Set(n.flatMap(s=>[...s.nodeId?[s.nodeId]:[],...s.components.map(i=>i.nodeId)]))}function EM(e){return ua({tenant_id:e.tenant_id,site_id:e.site_id,stable_key:e.stable_key,resolved_version:e.request.resolved_version,base_sitemap_id:e.request.base_sitemap_id,base_sitemap_version:e.request.base_sitemap_version,sitemap:e.request.sitemap,target_page_id:e.request.target_page_id??null})}import{z as H}from"zod";var sE=["pending_dns","active","failed","removing"],iE=H.enum(sE),oE=["serve_site","redirect_301"],aE=H.enum(oE),rE=["traffic","ownership","certificate_delegation"],_a=H.enum(rE),cE=["pending","verified"],mE=H.enum(cE),lE=["not_applicable","unavailable","not_needed","auto_applied","confirmation_required","blocked"],pE=H.enum(lE),ga=H.enum(["prepare_configuration","apply_configuration","verify_dns","remediate_dns","confirm_dns_remediation"]),dE=H.enum(["accepted","running","succeeded","failed"]),uE=H.object({code:H.string().min(1),message:H.string().min(1)}).strict(),_E=H.object({purpose:_a,verified:H.boolean(),observedValues:H.array(H.string())}).strict(),Gl=H.object({ready:H.boolean(),providerReady:H.boolean(),dnsVerified:H.boolean(),records:H.array(_E)}).strict(),ql=H.object({type:H.string().min(1),name:H.string().min(1),value:H.string().min(1),ttl:H.number().nullable()}).strict(),gE=H.object({purpose:_a,action:H.enum(["none","create","update","blocked"]),before:ql.nullable(),after:ql.nullable()}).strict(),Wl=H.object({domainId:H.string().min(1),status:pE,changes:H.array(gE)}).strict(),hE=H.object({purpose:_a,type:H.string().min(1),name:H.string().min(1),value:H.string().min(1),verificationStatus:mE}).strict(),Bl=H.object({id:H.string().min(1),hostname:H.string().min(1),isPrimary:H.boolean(),routingMode:aE,observedStatus:iE,lastVerifiedAt:H.string().datetime().nullable(),dnsRecords:H.array(hE)}).strict().superRefine((e,n)=>{SE(e.hostname)||n.addIssue({code:"custom",path:["hostname"],message:"hostname must be a canonical ASCII hostname"}),e.isPrimary&&e.routingMode!=="serve_site"&&n.addIssue({code:"custom",path:["routingMode"],message:"a primary domain must serve the site"}),!e.isPrimary&&e.routingMode!=="redirect_301"&&n.addIssue({code:"custom",path:["routingMode"],message:"a non-primary domain must redirect with 301"})}),Kl=H.object({primaryDomain:Bl.nullable(),redirectDomains:H.array(Bl)}).strict().superRefine((e,n)=>{e.primaryDomain!==null&&(!e.primaryDomain.isPrimary||e.primaryDomain.routingMode!=="serve_site")&&n.addIssue({code:"custom",path:["primaryDomain"],message:"primaryDomain must be primary and serve the site"});for(let[i,o]of e.redirectDomains.entries())(o.isPrimary||o.routingMode!=="redirect_301")&&n.addIssue({code:"custom",path:["redirectDomains",i],message:"redirectDomains must be non-primary 301 redirects"});e.primaryDomain!==null&&e.redirectDomains.some(o=>o.hostname===e.primaryDomain?.hostname)&&n.addIssue({code:"custom",path:["redirectDomains"],message:"primaryDomain must not also be a redirect"});let s=[...e.primaryDomain===null?[]:[e.primaryDomain.hostname],...e.redirectDomains.map(i=>i.hostname)];new Set(s).size!==s.length&&n.addIssue({code:"custom",path:["redirectDomains"],message:"domain hostnames must be unique"})}),ui=H.object({id:H.string().min(1),type:ga,status:dE,error:uE.nullable(),result:H.union([Gl,Wl]).nullable().optional()}).strict().superRefine((e,n)=>{if(e.status==="failed"&&e.error===null&&n.addIssue({code:"custom",path:["error"],message:"failed operations must include a stable error"}),e.status!=="failed"&&e.error!==null&&n.addIssue({code:"custom",path:["error"],message:"non-failed operations must not include an error"}),!(e.result===void 0||e.result===null)){if(e.status!=="succeeded"){n.addIssue({code:"custom",path:["result"],message:"operation results only belong to succeeded operations"});return}if(e.type==="verify_dns"){Gl.safeParse(e.result).success||n.addIssue({code:"custom",path:["result"],message:"verify_dns operations require a DNS verification result"});return}if(e.type==="remediate_dns"){Wl.safeParse(e.result).success||n.addIssue({code:"custom",path:["result"],message:"remediate_dns operations require a DNS remediation result"});return}n.addIssue({code:"custom",path:["result"],message:"only verify_dns and remediate_dns operations may carry a result"})}});function SE(e){if(e!==e.trim()||e!==e.toLowerCase()||e.length>253||e.endsWith("."))return!1;let n=e.split(".");return n.length>=2&&n[n.length-1].length>=2&&n.every(s=>s.length>=1&&s.length<=63&&/^[a-z0-9-]+$/.test(s)&&!s.startsWith("-")&&!s.endsWith("-"))}import{z as Me}from"zod";import{z as b}from"zod";var fE=b.enum(["active","completed","canceled"]),bE=b.enum(["quality","domain","gsc","publish"]),gi=b.enum(["pending","running","succeeded","failed"]),Hl=gi,$l=b.enum(["pending","running","completed"]),yE=b.object({group_code:b.string().min(1),name:b.string().min(1),score:b.number().nonnegative(),total_score:b.number().nonnegative(),pass_score:b.number().nonnegative(),running_status:$l,result_text:b.string()}).strict(),xE=b.object({id:b.number().int().positive().optional(),quality_task_id:b.number().int().positive(),item_code:b.string().min(1),status:gi,is_repaired:b.boolean(),total_score:b.number().nonnegative(),score:b.number().nonnegative(),check_result:b.unknown().nullable(),remediation_items:b.unknown().nullable(),result_text:b.string(),created_at:b.string().min(1),updated_at:b.string().min(1),item_name:b.string().min(1),dimension_code:b.enum(["reach","trust","convert","safe"]),group_code:b.string().min(1),auto_fix:b.boolean()}).strict(),EE=b.object({dimension_code:b.enum(["reach","trust","convert","safe"]),name:b.string().min(1),alias_en:b.string().min(1),description:b.string(),tips:b.string(),score:b.number().nonnegative(),repaired_score:b.number().nonnegative(),total_score:b.number().nonnegative(),pass_score:b.number().nonnegative(),running_status:$l,problem_group_count:b.number().int().nonnegative(),remediation_items:b.array(xE),groups:b.array(yE)}).strict(),RE=b.object({id:b.number().int().positive(),task_code:b.string().uuid(),scene_code:b.enum(["site_publish","vcp_published_pages","content_publish"]),tenant_id:b.string().min(1),vcp_site_id:k,cms_site_id:b.string().min(1),checked_url:b.string().url(),quality_params:b.record(b.string(),b.unknown()).nullable(),status:gi,error_info:b.record(b.string(),b.unknown()).nullable(),created_at:b.string().min(1),updated_at:b.string().min(1)}).strict(),IE=b.union([b.object({}).strict(),b.object({summary:b.object({final_score:b.number().nonnegative(),pass_score:b.number().nonnegative(),group_count:b.number().int().nonnegative(),problem_group_count:b.number().int().nonnegative()}).strict(),dimensions:b.array(EE)}).strict()]),zl=b.object({quality_info:RE,quality_detail:IE}).strict().superRefine((e,n)=>{let s="summary"in e.quality_detail;e.quality_info.status!=="failed"&&!s&&n.addIssue({code:"custom",message:"nonfailed quality tasks require complete detail",path:["quality_detail"]}),e.quality_info.status==="failed"&&s&&n.addIssue({code:"custom",message:"failed quality tasks require empty detail",path:["quality_detail"]})}),vM=b.object({item_code:b.string().min(1),remediation_items:b.unknown().nullable()}).strict(),TE=b.object({item_code:b.string().min(1),repair_status:b.enum(["succeeded","failed"]),message:b.string().min(1).optional(),error_code:b.string().min(1).optional(),metadata:b.record(b.string(),b.unknown()).optional()}).strict(),Vl=b.object({items:b.array(TE)}).strict(),DM=b.object({task_code:b.string().min(1),status:Hl,result:Vl.optional()}).strict().superRefine((e,n)=>{e.status==="succeeded"&&e.result===void 0&&n.addIssue({code:"custom",path:["result"],message:"succeeded repair tasks require a complete result"}),(e.status==="pending"||e.status==="running")&&e.result!==void 0&&n.addIssue({code:"custom",path:["result"],message:"nonterminal repair tasks cannot expose a result"})}),Dt=b.object({id:ms,tenant_id:b.string().min(1),site_id:k,status:fE,current_step:bE,quality_task_code:b.string().uuid().nullable(),quality_task_status:gi,repair_task_code:b.string().min(1).nullable(),repair_task_status:Hl,publish_deployment_id:lt.nullable(),domain_hostname:b.string().min(1).nullable(),domain_operation_type:ga.nullable(),domain_operation_payload:b.record(b.string(),b.unknown()).nullable(),domain_preparation_operation_id:b.string().min(1).nullable(),domain_operation_id:b.string().min(1).nullable(),revision:b.number().int().positive(),created_at:b.string().min(1),updated_at:b.string().min(1),completed_at:b.string().min(1).nullable(),canceled_at:b.string().min(1).nullable()}).strict().superRefine((e,n)=>{if(e.domain_operation_type===null){e.domain_operation_payload!==null&&n.addIssue({code:"custom",path:["domain_operation_payload"],message:"domain_operation_payload must be null without an active domain operation"}),e.domain_operation_id!==null&&n.addIssue({code:"custom",path:["domain_operation_id"],message:"domain_operation_id must be null without an active domain operation"});return}e.domain_hostname===null&&n.addIssue({code:"custom",path:["domain_hostname"],message:"an active domain operation requires a hostname"}),e.domain_operation_payload===null&&n.addIssue({code:"custom",path:["domain_operation_payload"],message:"an active domain operation requires a payload"})}),OM=b.object({}).strict(),NM=b.object({expected_revision:b.number().int().nonnegative(),current_step:b.enum(["domain","gsc","publish"]),skip_domain_binding:b.boolean().optional()}).strict(),jM=b.object({expected_revision:b.number().int().nonnegative()}).strict(),kE=b.object({workflow:Dt.nullable(),can_cancel:b.boolean()}).strict(),LM=M(kE).strict(),AE=b.object({workflow:Dt,can_cancel:b.boolean()}).strict(),MM=M(AE).strict(),PE=b.object({workflow:Dt,deployment:b.lazy(()=>Ot)}).strict(),UM=M(PE).strict(),wE=b.object({workflow:Dt,can_cancel:b.boolean(),quality_result:zl.optional(),safety_gate_enabled:b.boolean().optional(),repair_result:Vl.optional(),final_quality_result:zl.optional(),message:b.string().min(1).optional()}).strict(),FM=M(wE).strict();function GM(e){if(e.quality_info.status!=="succeeded"||!("summary"in e.quality_detail))return[];let n=new Set(["heading_structure","click_obstruction","page_runtime_error"]);return e.quality_detail.dimensions.flatMap(s=>s.remediation_items.filter(i=>i.status==="succeeded"&&_i(i)==="not_passed"&&i.auto_fix&&n.has(i.item_code)).map(i=>({item_code:i.item_code,remediation_items:i.remediation_items})))}function qM(e,n){let s=e.map(a=>a.item_code),i=n.items.map(a=>a.item_code);if(new Set(s).size!==s.length||new Set(i).size!==i.length||s.length!==i.length)return!1;let o=new Set(s);return n.items.every(a=>o.has(a.item_code)&&a.repair_status==="succeeded")}function WM(e,n){return e.quality_info.status!=="succeeded"||!("summary"in e.quality_detail)||CE(e)?null:e}function CE(e){let n=e.quality_info.error_info;return e.quality_info.scene_code!=="site_publish"||n?.stage!=="html_sampling"||n.code!=="PAGE_SAMPLING_ISSUES"&&n.code!=="PAGE_RUNTIME_ERRORS"?!1:[n.failed_urls,n.sampling_issues].flatMap(i=>Array.isArray(i)?i:[]).some(i=>{if(!i||typeof i!="object")return!1;let o=i;if(o.page_type!=="general_page"||o.http_status!==404||typeof o.url!="string")return!1;try{let a=new URL(e.quality_info.checked_url),c=new URL(o.url,a);return c.origin===a.origin&&!c.username&&!c.password}catch{return!1}})}var BM=b.enum(["checking","passed","not_passed","failed","not_checked"]);function _i(e){if(e.status==="pending"||e.status==="running")return"checking";if(e.status!=="succeeded")return"failed";let n=e.result_text?.trim();if(n==="\u8D28\u68C0\u9879\u5173\u95ED\uFF0C\u6682\u672A\u68C0\u6D4B")return"not_checked";if(n==="\u8D28\u91CF\u68C0\u6D4B\u9879\u6267\u884C\u5931\u8D25")return"failed";let s=typeof e.check_result=="boolean"?[e.check_result]:e.check_result&&typeof e.check_result=="object"?Object.values(e.check_result):[];return e.score<e.total_score||s.includes(!1)?"not_passed":"passed"}function vE(e){let n=_i(e);return n==="failed"||n==="not_passed"}function KM(e){let n={status:"unavailable",issueCount:0};if(!e||e.quality_info.status!=="succeeded"||!("summary"in e.quality_detail))return n;let s=e.quality_detail.dimensions.filter(a=>a.dimension_code==="safe");if(s.length!==1)return n;let i=s[0];if(i.running_status!=="completed"||!i.remediation_items.length||i.remediation_items.some(a=>a.dimension_code!=="safe"||_i(a)==="checking"||_i(a)==="not_checked"))return n;let o=i.remediation_items.filter(vE).length;return o>0?{status:"blocked",issueCount:o}:i.score<i.pass_score?n:{status:"passed",issueCount:0}}var DE=Me.object({hostname:Me.string().min(1),expected_revision:Me.number().int().nonnegative()}).strict(),Yl=Me.object({workflow:Dt,operation:ui}).strict(),OE=M(Yl).strict(),NE=Me.object({expected_revision:Me.number().int().nonnegative()}).strict(),jE=Me.object({workflow:Dt,operation:ui}).strict(),LE=M(jE).strict(),ha=Me.object({workflow:Dt,operation:ui.nullable()}).strict(),ME=M(ha).strict(),UE=ha,FE=M(UE).strict(),XM=M(Kl).strict(),GE=Me.object({published:Me.boolean(),hostname:Me.string(),url:Me.string(),sandbox_url:Me.union([Me.string().url(),Me.literal("")])}).strict().superRefine((e,n)=>{e.published||(e.hostname!==""&&n.addIssue({code:"custom",path:["hostname"],message:"unpublished sites must not include a hostname"}),e.url!==""&&n.addIssue({code:"custom",path:["url"],message:"unpublished sites must not include a URL"}))}),QM=M(GE).strict(),ZM=DE,JM=Yl,eU=OE,tU=ha,nU=ME,sU=FE,iU=NE,oU=LE;import{z as Be}from"zod";var qE=["started","success","failed","canceled"],Sa=Be.enum(qE),WE=["inactive","pending_binding","active"],fa=Be.enum(WE),BE=["domain","url_prefix"],ba=Be.enum(BE),KE=["not_connected","authorizing","matching_property","ready","failed","canceled","domain_mismatch"],ya=Be.enum(KE),mt=Be.string().nullable(),Xl=Be.object({}).strict(),xa=Be.object({authorize_url:Be.string().url(),custom_domain:mt}).strict(),Ql=M(xa),zE=Be.object({auth_status:Sa,binding_status:fa,credential_connected:Be.boolean(),custom_domain:mt,gsc_site_url:mt,property_type:ba.nullable(),auth_error_code:mt,auth_error_message:mt}).strict(),Zl=Be.object({auth_status:Sa,binding_status:fa,credential_connected:Be.boolean(),custom_domain:mt,gsc_site_url:mt,property_type:ba.nullable(),auth_error_code:mt,auth_error_message:mt,current_domain:mt,state:ya,ready:Be.boolean()}).strict().superRefine((e,n)=>{let s=$E(e,e.current_domain),i=s==="ready";e.state!==s&&n.addIssue({code:"custom",path:["state"],message:`state must equal ${s} for the supplied GSC facts`}),e.ready!==i&&n.addIssue({code:"custom",path:["ready"],message:`ready must equal ${String(i)} for the supplied GSC facts`})}),HE=M(Zl);function os(e){let n=e?.trim()??"";if(!n)return"";let s=/^[a-z][a-z0-9+.-]*:\/\//i.test(n)?n:`https://${n}`;try{return new URL(s).hostname.replace(/\.+$/,"").toLowerCase()}catch{return n.replace(/^[a-z][a-z0-9+.-]*:\/\//i,"").split(/[/?#]/,1)[0].replace(/\.+$/,"").toLowerCase()}}function $E(e,n){let s=e.gsc_site_url?.trim()??"",i=os(e.custom_domain),o=os(n??("current_domain"in e?e.current_domain:void 0)),a=i.length>0&&o.length>0&&i===o,c=VE(s,e.property_type,o);return e.auth_status==="canceled"?"canceled":e.auth_status==="failed"?"failed":e.auth_status==="started"?"authorizing":!e.credential_connected||e.binding_status==="inactive"?"not_connected":s.length===0||e.property_type===null?"matching_property":!a||!c?"domain_mismatch":e.binding_status==="pending_binding"?"matching_property":e.auth_status==="success"&&e.binding_status==="active"&&e.credential_connected&&s.length>0&&a&&c?"ready":"failed"}function VE(e,n,s){let i=e?.trim()??"",o=os(s);if(!i||!o||!n)return!1;if(n==="domain"){let a=/^sc-domain:(.+)$/i.exec(i);if(!a)return!1;let c=a[1].trim();if(!c||/[/:?#]/.test(c))return!1;let r=os(c);return r?o===r||o.endsWith(`.${r}`):!1}try{let a=new URL(i);return a.protocol!=="https:"||a.username||a.password||a.port||a.pathname!=="/"||a.search||a.hash?!1:os(a.hostname)===o}catch{return!1}}var mU=Xl,lU=xa,pU=Ql,dU=ya,uU=Sa,_U=fa,gU=ba,hU=ya,SU=Xl,fU=xa,bU=Ql,yU=zE,xU=Zl,EU=HE;import{z as O}from"zod";var Ke=O.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER),tt=O.string().min(1).max(4096),hn=O.string().regex(/^[A-Za-z0-9_-]{43}$/),Sn=O.string().max(300),Ea=O.string().datetime({offset:!0}).nullable(),Jl=O.string().regex(/^[A-Z][A-Z0-9_]*$/).max(100).nullable(),YE=["authorized","pending","failed","revoked","expired","not_authorized"],XE=O.enum(YE),QE=["pending","succeeded","failed","canceled","expired","superseded"],ZE=O.enum(QE),JE=["unconfigured","configured","needs_reconfiguration","unverified"],eR=O.enum(JE),tR=["not_checked","valid","invalid","unavailable"],nR=O.enum(tR),sR=["authorization_pending","authorization_required","authorization_changed","resource_unavailable","resource_changed","verification_required","verification_unavailable"],iR=O.enum(sR),ep=O.object({revision:Ke,status:ZE,started_at:O.string().datetime({offset:!0}),expires_at:O.string().datetime({offset:!0}),finished_at:Ea,error_code:Jl}).strict(),kU=O.object({expected_authorization_revision:Ke,expected_attempt_revision:Ke,select_account:O.boolean().default(!1),replace_pending:O.boolean().default(!1)}).strict(),oR=O.object({authorize_url:O.string().url(),authorization_revision:Ke,attempt:ep}).strict(),AU=M(oR),aR=O.object({status:XE,authorization_revision:Ke,account_email:O.string().max(320).nullable(),latest_attempt:ep.nullable()}).strict(),rR=O.object({account_ref:tt,account_key:hn,account_display_name:Sn,property_ref:tt,property_key:hn,property_display_name:Sn,data_stream_ref:tt,data_stream_key:hn,data_stream_display_name:Sn,measurement_id_display:O.string().min(1).max(40),default_uri:O.string().url().nullable(),selected_authorization_revision:Ke,configured_at:O.string().datetime({offset:!0}),updated_at:O.string().datetime({offset:!0})}).strict(),cR=O.object({status:nR,checked_at:Ea,expires_at:Ea,error_code:Jl}).strict(),mR=O.enum(["oauth","verification"]),lR=O.object({measurement_id_display:O.string().min(1).max(40),stream_display_name:O.string().max(100).nullable()}).strict(),pR=O.object({status:O.enum(["pending","applied"]),applied_revision:Ke}).strict(),tp=O.object({capability_enabled:O.boolean(),revision:Ke,authorization:aR,binding_status:eR,reason:iR.nullable(),ready:O.boolean(),mode:mR.nullable(),binding:rR.nullable(),verification:cR,tracking:lR.nullable(),deployment:pR}).strict().superRefine((e,n)=>{if(!e.capability_enabled){(e.ready||e.revision!==0||e.authorization.status!=="not_authorized"||e.authorization.authorization_revision!==0||e.authorization.account_email!==null||e.authorization.latest_attempt!==null||e.binding_status!=="unconfigured"||e.reason!==null||e.mode!==null||e.binding!==null||e.tracking!==null||e.deployment.status!=="applied"||e.deployment.applied_revision!==0||e.verification.status!=="not_checked"||e.verification.checked_at!==null||e.verification.expires_at!==null||e.verification.error_code!==null)&&n.addIssue({code:O.ZodIssueCode.custom,message:"disabled GA4 capability must expose an empty state"});return}e.ready&&(e.authorization.status!=="authorized"||e.binding_status!=="configured"||e.mode!=="oauth"||e.binding===null||e.tracking===null||e.verification.status!=="valid"||e.reason!==null)&&n.addIssue({code:O.ZodIssueCode.custom,message:"ready GA4 status must be authorized, configured, and valid"})}),PU=M(tp),wU=O.object({refresh:O.union([O.boolean(),O.enum(["true","false"]).transform(e=>e==="true")]).default(!1)}).strict(),dR=O.object({property_ref:tt,property_key:hn,display_name:Sn}).strict(),uR=O.object({account_ref:tt,account_key:hn,display_name:Sn,properties:O.array(dR)}).strict(),_R=O.object({accounts:O.array(uR),returned_count:O.number().int().nonnegative(),completeness:O.literal("unknown"),authorization_revision:Ke}).strict(),CU=M(_R),vU=O.object({authorization_revision:O.coerce.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER)}).strict(),gR=O.object({data_stream_ref:tt,data_stream_key:hn,display_name:Sn,measurement_id_display:O.string().min(1).max(40),default_uri:O.string().url().nullable(),selectable:O.boolean(),unavailable_reason:O.string().max(100).nullable()}).strict(),hR=O.object({property_ref:tt,streams:O.array(gR),returned_count:O.number().int().nonnegative(),completeness:O.literal("unknown"),authorization_revision:Ke}).strict(),DU=M(hR),OU=O.object({property_ref:tt,authorization_revision:O.coerce.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER)}).strict(),NU=O.object({expected_revision:Ke,authorization_revision:Ke,account_ref:tt,property_ref:tt,data_stream_ref:tt,confirm_url_mismatch:O.boolean()}).strict(),SR=O.object({applied_revision:Ke,idempotency_replayed:O.boolean()}).strict(),fR=tp.and(O.object({mutation:SR}).strict()),jU=M(fR);var np=/^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/,sp="VCP_E2B_PREVIEW_PROXY_DOMAIN must be a valid hostname.";function bR(e){let n=e?.trim().toLowerCase()??"";if(!n)return null;if(n.length>253||!n.includes(".")||!n.split(".").every(s=>np.test(s)))throw new Error(sp);return n}function MU(e){let n=bR(e.proxyDomain);if(!n)return null;let s=e.sandboxId.trim();if(!np.test(s))throw new Error("sandboxId must be a valid DNS label.");if(`${s}.${n}`.length>253)throw new Error(sp);return`https://${s}.${n}/`}function FU(e){for(let n of e.targets)if(!(n.kind==="shared"?e.ledger.shared.some(i=>i.kind==="shared"&&i.target_id===n.target_id&&i.filled!==!0):e.ledger.pages.some(i=>i.omissions.some(o=>o.kind===n.kind&&o.target_id===n.target_id&&o.filled!==!0))))return{ok:!1,target_id:n.target_id};return{ok:!0}}function yR(e,n,s=e){let i=new Map(e.map(r=>[r.slug,r])),o=new Map(s.map(r=>[r.id,r])),a=new Map(e.map(r=>{let m=o.get(r.id);return m&&m.slug!==null&&m.slug!==r.slug?[m.slug,r]:null}).filter(r=>r!==null)),c=new Set(s.map(r=>r.slug).filter(r=>r!==null&&!i.has(r)));return{primaryLinks:ip(n.primaryLinks,e,i,a,c,o,"showInHeader"),footerLinks:ip(n.footerLinks,e,i,a,c,o,"showInFooter")}}function ip(e,n,s,i,o,a,c){let r=new Set,m=[];for(let[B,z]of e.entries()){let ne=xR(z.href),Se=ne===null?void 0:s.get(ne)??i.get(ne);if(ne!==null&&o.has(ne)&&!s.has(ne)&&!i.has(ne))continue;if(Se?.slug==="/"){m.push({kind:"independent",link:{...z,label:op(z,Se,a)}});continue}if(!Se){m.push({kind:"independent",link:z});continue}if(!Se.navigation[c])continue;r.add(Se.slug);let En=ne===Se.slug?z.href:ER(z.href,Se.slug);m.push({kind:"page",page:Se,link:{...z,label:op(z,Se,a),href:En},index:B})}let x=m.filter(B=>B.kind==="page").sort((B,z)=>B.page.navigation.order-z.page.navigation.order||B.index-z.index),_=0,w=m.map(B=>B.kind==="page"?x[_++].link:B.link);for(let B of[...n].filter(z=>z.slug!=="/"&&z.navigation[c]).sort((z,ne)=>z.navigation.order-ne.navigation.order))r.has(B.slug)||w.push({label:B.title,href:B.slug});return w}function op(e,n,s){let i=s.get(n.id);return e.label===(i?.title??n.title)?n.title:e.label}function xR(e){if(!e.startsWith("/")||e.startsWith("//"))return null;let n=e.search(/[?#]/u);return n===-1?e:e.slice(0,n)}function ER(e,n){let s=e.search(/[?#]/u);return s===-1?n:`${n}${e.slice(s)}`}function hi(e){return e.trim().normalize("NFKC").toLowerCase()}function RR(e){let n=e?.toLowerCase();return n?.startsWith("zh")?"\u9996\u9875":n?.startsWith("ja")?"\u30DB\u30FC\u30E0":n?.startsWith("ko")?"\uD648":"Home"}function IR(e){let n=e?.toLowerCase();return n?.startsWith("zh")?"\u66F4\u591A":n?.startsWith("ja")?"\u305D\u306E\u4ED6":n?.startsWith("ko")?"\uB354\uBCF4\uAE30":n?.startsWith("fr")?"Plus":n?.startsWith("de")?"Mehr":n?.startsWith("es")?"M\xE1s":"More"}function TR(e){return e.map(n=>n.navigation.showInHeader===!0?n:{...n,navigation:{...n.navigation,showInHeader:!0}})}function as(e){return e.parent_page_id??null}function Si(e,n){let s=as(e);return s===null?!0:!n.some(i=>i.id===s)}function ap(e,n){return e.filter(s=>as(s)===n&&s.id!==n)}function rp(e){let n=e.filter(c=>Si(c,e)),s=n.filter(c=>c.slug==="/"),i=n.filter(c=>c.slug!=="/"),o=[],a=new Set;for(let c of[...s,...i])if(!a.has(c.id)){o.push(c),a.add(c.id);for(let r of ap(e,c.id))a.has(r.id)||(o.push(r),a.add(r.id))}for(let c of e)a.has(c.id)||(o.push(c),a.add(c.id));return o}function kR(e){if(!e.startsWith("/")||e.startsWith("//"))return null;let n=e.search(/[?#]/);return n===-1?e:e.slice(0,n)}function AR(e,n){let s=rp(n),i=new Map;s.forEach((c,r)=>{c.slug!==null&&!i.has(c.slug)&&i.set(c.slug,r)});let o=[],a=[];for(let c of e){let r=kR(c.href),m=r===null?void 0:i.get(r);m===void 0?a.push(c):o.push({link:c,rank:m})}return o.sort((c,r)=>c.rank-r.rank),[...o.map(c=>c.link),...a]}function PR(e){let n=e.filter(s=>Si(s,e)).length;return{top_level_pages:n,sub_pages:e.length-n,total_pages:e.length,content_items:e.reduce((s,i)=>s+i.blocks.length,0)}}function wR(e,n={}){let s=[],i=new Map(e.map(c=>[c.id,c])),o=e.filter(c=>c.slug==="/");o.length!==1?s.push({code:"missing_home",page_id:null,message:"The structure must contain exactly one home page."}):n.expectedHomeTitle&&hi(o[0].title)!==hi(n.expectedHomeTitle)&&s.push({code:"home_renamed",page_id:o[0].id,message:`The home page must keep its fixed name '${n.expectedHomeTitle}'.`});for(let c of e){c.title.trim().length===0&&s.push({code:"empty_title",page_id:c.id,message:"Page name is empty."}),c.slug&&n.reservedSlugs?.includes(c.slug)&&s.push({code:"reserved_slug",page_id:c.id,message:`Slug '${c.slug}' is reserved by the site's applications.`});let r=as(c);if(r===null)continue;if(c.slug==="/"){s.push({code:"home_has_parent",page_id:c.id,message:"The home page cannot have a parent."});continue}if(r===c.id){s.push({code:"self_parent",page_id:c.id,message:"A page cannot be its own parent."});continue}let m=i.get(r);if(!m){s.push({code:"parent_not_found",page_id:c.id,message:`Parent page '${r}' does not exist.`});continue}if(m.slug==="/"){s.push({code:"home_has_children",page_id:c.id,message:"The home page cannot have sub pages."});continue}as(m)!==null&&s.push({code:"depth_exceeded",page_id:c.id,message:"At most two levels are allowed."})}let a=new Map;for(let c of e){let r=Si(c,e)?"__top__":as(c),m=hi(c.title);if(m.length===0)continue;let x=a.get(r)??new Map,_=x.get(m);_!==void 0&&_!==c.id?s.push({code:"duplicate_sibling_title",page_id:c.id,message:`Page name '${c.title}' is already used at the same level.`}):x.set(m,c.id),a.set(r,x)}return s}var CR=16,vR=/[ᄀ-ᅟ⺀-〾ぁ-㏿㐀-䶿一-鿿ꀀ-가-힣豈-︰--⦆¢-₩]/u;function DR(e){let n=0;for(let s of e)n+=vR.test(s)?2:1;return n}function OR(e){let n=e.normalize("NFKC").trim().replace(/\s+/g," ").toLowerCase();return n.length>3&&n.endsWith("s")?n.slice(0,-1):n}import{z as A}from"zod";var cp=20*1024*1024,NR=cp,mp=["jpg","jpeg","png","gif","webp","bmp"],lp=["mp4","avi","mov","webm","mkv"],pp=["mp3","wav","aac","flac","ogg","wma","m4a"],dp=["pdf","doc","docx","xls","xlsx","ppt","pptx","txt","md","csv"],up=[...dp,"zip","rar","json","xmind","psd","ai","fig","sketch"],jR=[...mp,...lp,...pp,...up],_p=["image/jpeg","image/png","image/gif","image/webp","image/bmp"],gp=["video/mp4","video/x-msvideo","video/quicktime","video/webm","video/x-matroska"],hp=["audio/mpeg","audio/wav","audio/x-wav","audio/vnd.wave","audio/aac","audio/flac","audio/x-flac","audio/ogg","audio/x-ms-wma","audio/mp4","audio/x-m4a"],LR=[..._p,...gp,...hp],Sp=A.enum(["image","video","audio","file"]),fp=A.enum(["external","ai_generated","unsplash"]),Ra=A.object({resource_id:A.string().min(1),name:A.string().min(1).max(255),url:A.string().url(),thumbnail_url:A.union([A.string().url(),A.literal("")]),mime_type:A.string().trim().min(3).max(127),size:A.number().int().nonnegative(),width:A.number().int().positive().nullable(),height:A.number().int().positive().nullable(),source:fp,created_at:A.string().min(1).nullable()}),MR=A.object({page:A.coerce.number().int().min(1).default(1),page_size:A.coerce.number().int().min(1).max(100).default(24),keyword:A.string().trim().max(100).optional(),file_type:Sp.default("image")}),UR=A.object({code:A.literal(0),message:A.string(),data:A.object({items:A.array(Ra),page:A.number().int().min(1),page_size:A.number().int().min(1),total:A.number().int().nonnegative()})}),FR=A.object({code:A.literal(0),message:A.string(),data:Ra}),Ia=4,GR=A.object({pageName:A.string().trim().min(1).max(200),pageType:A.enum(["landing_page","general_page","detail_page","list_page","category_page","tag_page","author_page","search_page","date_page"]),sectionTitle:A.string(),nearbyTitle:A.string(),nearbyBody:A.string(),prompt:A.string().trim().min(1).max(2e3),aspectRatio:A.string().regex(/^[1-9]\d*:[1-9]\d*$/)}),bp=A.object({index:A.number().int().min(0).max(Ia-1),ok:A.literal(!0),url:A.string().regex(/^data:image\/(?:png|jpeg|gif|webp|bmp);base64,[A-Za-z0-9+/]+={0,2}$/)}),qR=A.object({code:A.literal(0),message:A.string(),data:A.object({items:A.array(bp).min(1).max(Ia)})}),yp=A.object({provider_id:A.string().min(1),url:A.string().url(),thumbnail_url:A.string().url(),width:A.number().int().positive(),height:A.number().int().positive(),alt:A.string(),photographer_name:A.string().min(1),photographer_url:A.string().url(),photo_url:A.string().url(),download_location:A.string().url(),dominant_color:A.string().nullable()}),WR=A.object({query:A.string().trim().min(1).max(100),page:A.coerce.number().int().min(1).default(1),page_size:A.coerce.number().int().min(1).max(30).default(18),orientation:A.enum(["landscape","portrait","squarish"]).optional()}),BR=A.object({code:A.literal(0),message:A.string(),data:A.object({items:A.array(yp),page:A.number().int().min(1),page_size:A.number().int().min(1),total:A.number().int().nonnegative(),total_pages:A.number().int().nonnegative()})}),xp=A.string().url().refine(VR,{message:"download_location must be an official Unsplash download URL"}),KR=A.object({download_location:xp}),zR=A.object({code:A.literal(0),message:A.string(),data:A.object({reported:A.boolean()})}),HR=A.object({source_id:A.number().int().positive(),source_title:A.string().min(1).max(255),source_url:qt,resource_id:A.number().int().positive()}),$R=A.object({code:A.literal(0),message:A.string(),data:A.object({reported:A.boolean()})});function VR(e){if(!URL.canParse(e))return!1;let n=new URL(e);return n.protocol==="https:"&&n.hostname==="api.unsplash.com"&&n.username===""&&n.password===""&&n.port===""&&n.hash===""&&/^\/photos\/[^/]+\/download$/.test(n.pathname)}import{z as me}from"zod";var YR=me.object({colorSeeds:me.object({primary:me.string().min(1).max(40),accent:me.string().min(1).max(40),foreground:me.string().min(1).max(40).optional()}).strict().optional(),surfaceMode:me.enum(["light","dark"]).optional(),fonts:me.object({heading:me.string().min(1).max(60),body:me.string().min(1).max(60)}).strict().optional(),weightStyle:We.optional()}).strict().refine(e=>e.colorSeeds!==void 0||e.surfaceMode!==void 0||e.fonts!==void 0||e.weightStyle!==void 0,{message:"colorSeeds, surfaceMode, fonts, or weightStyle is required"}),XR=me.object({ok:me.literal(!0),design_plan_version:me.number().int().positive().optional(),snapshot_id:I,site_design_context:me.lazy(()=>fi).optional(),changed_files:me.array(me.string().min(1)).optional()}),QR=me.object({snapshot_id:I,color_seeds:me.object({primary:me.string(),accent:me.string(),foreground:me.string().optional()}).nullable(),surface_mode:me.enum(["light","dark"]).nullable(),fonts:me.object({heading:me.string(),body:me.string()}).nullable(),palette_inputs_present:me.boolean(),palette_inputs:Do.nullable(),notes:me.array(me.string()).nullable(),weight_style:We.nullable().default(null),source:me.enum(["globals_css","design_plan_archive"])});import{z as P}from"zod";var be=P.string().min(1).max(100),ka=P.enum(["page","anchor","external","email","phone","file","group"]);function ZR(e){if(!e||e.trim()!==e||/[\u0000-\u001f\u007f\\]/u.test(e))return!1;if(e.startsWith("/")&&!e.startsWith("//")||/^#[^\s]*$/u.test(e)||/^(mailto:|tel:)[^\s]+$/iu.test(e))return!0;try{let n=new URL(e);return(n.protocol==="http:"||n.protocol==="https:")&&!n.username&&!n.password}catch{return!1}}var JR=P.string().max(2048).refine(ZR,"Invalid navigation destination"),Aa=P.string().trim().min(1).max(255),Pa=P.enum(["link","cta"]).nullable(),Ep=P.lazy(()=>P.object({id:be,group_id:be,parent_id:be.nullable(),sort_order:P.number().int().nonnegative(),label:P.string(),href:P.string().nullable(),target_type:ka,enabled:P.boolean(),effective_visible:P.boolean(),open_in_new:P.boolean(),nofollow:P.boolean(),role:Pa,link_binding:P.object({kind:P.enum(["custom","cms_page","file"]),page_id:be.nullable()}),children:P.array(Ep)})),eI=P.object({id:be,name:P.string(),description:P.string(),is_default:P.boolean(),can_delete:P.boolean(),delete_block_reason:P.string().nullable(),items:P.array(Ep)}),tI=P.object({site_id:P.string().min(1),default_group_id:be.nullable(),groups:P.array(eI),limits:P.object({max_depth:P.number().int().positive(),max_items:P.number().int().positive()})}),eF=P.object({data:tI}),Rp=P.object({name:Aa,description:P.string().max(2e3).optional()}).strict(),nI=Rp.partial().refine(e=>Object.keys(e).length>0,"At least one field is required"),tF=P.object({group_id:be}).strict(),Ip={label:Aa,target_type:ka,href:JR.nullable().optional(),enabled:P.boolean().optional(),open_in_new:P.boolean().optional(),nofollow:P.boolean().optional(),role:Pa.optional()},Tp=P.object({group_id:be,parent_id:be.nullable().optional(),...Ip}).strict().superRefine((e,n)=>{e.target_type!=="group"&&!e.href&&n.addIssue({code:"custom",path:["href"],message:"Link destination is required"}),e.target_type==="group"&&e.href&&n.addIssue({code:"custom",path:["href"],message:"Groups have no destination"})}),sI=P.object({...Ip,link_mode:P.literal("custom").optional()}).partial().strict().refine(e=>Object.keys(e).length>0,"At least one field is required"),iI=P.object({group_id:be,parent_id:be.nullable(),before_id:be.nullable().optional()}).strict(),Ta=P.lazy(()=>P.object({id:be.nullable(),label:P.string().max(255),href:P.string().max(2048).nullable(),target_type:ka,enabled:P.boolean(),open_in_new:P.boolean(),nofollow:P.boolean(),role:Pa,children:P.array(Ta)}).strict()),nF=P.object({group_id:be.nullable(),group_name:Aa.optional(),baseline:P.array(Ta),items:P.array(Ta)}).strict().superRefine((e,n)=>{e.group_id===null&&e.items.length>0&&!e.group_name&&n.addIssue({code:"custom",path:["group_name"],message:"New navigation group name is required"});for(let s of["baseline","items"]){let i=new Set,o=0,a=(c,r,m)=>{for(let[x,_]of c.entries()){let w=[...m,x];if(o++,s==="items"&&(o>1e3||r>20)){n.addIssue({code:"custom",path:w,message:"Navigation tree limit exceeded"});return}if((s==="baseline"&&_.id===null||_.id!==null&&i.has(_.id))&&n.addIssue({code:"custom",path:[...w,"id"],message:"Invalid or duplicate navigation ID"}),_.id!==null&&i.add(_.id),s==="items"){let B=Tp.safeParse({group_id:e.group_id??"new",label:_.label,href:_.href,target_type:_.target_type,enabled:_.enabled,open_in_new:_.open_in_new,nofollow:_.nofollow,role:_.role});if(!B.success)for(let z of B.error.issues)n.addIssue({code:"custom",path:[...w,...z.path.filter(ne=>typeof ne=="string"||typeof ne=="number")],message:z.message})}a(_.children,r+1,[...w,"children"])}};a(e[s],1,[s])}}),oI=P.object({cms_bound:P.boolean(),bound_nav_keys:P.array(P.string()).optional(),analyzed_snapshot_id:P.string().nullable().optional(),cms_driven:P.boolean(),supports_groups:P.boolean(),supports_nested_groups:P.boolean(),supports_link_attributes:P.boolean(),requires_agent:P.boolean(),reasons:P.array(P.string())}),sF=P.object({data:oI}),iF=P.discriminatedUnion("action",[P.object({action:P.literal("create_group"),values:Rp}).strict(),P.object({action:P.literal("update_group"),id:be,values:nI}).strict(),P.object({action:P.literal("delete_group"),id:be}).strict(),P.object({action:P.literal("set_default_group"),group_id:be}).strict(),P.object({action:P.literal("create_item"),values:Tp}).strict(),P.object({action:P.literal("update_item"),id:be,values:sI}).strict(),P.object({action:P.literal("delete_item"),id:be,cascade:P.boolean().optional()}).strict(),P.object({action:P.literal("move_item"),id:be,values:iI}).strict()]);import{z as le}from"zod";var wa=le.enum(["products","cases","guides","documents","company"]),aI=le.enum(["source_unreachable","content_mojibake","min_fields_unmet","document_no_file_reference","document_file_unavailable","media_ingest_failed","app_unavailable","write_failed","kind_input_unavailable","kind_uncertain","kind_service_unavailable","kind_budget_exhausted"]),yt=le.number().int().nonnegative(),rI=le.discriminatedUnion("status",[le.object({collection:wa,status:le.literal("processing")}).strict(),le.object({collection:wa,status:le.enum(["imported","partial","failed"]),imported:yt,exception:yt}).strict()]),kp=le.enum(["legacy_domain_not_routed","site_context_missing","site_rules_limit_exceeded","site_rules_not_served"]),cI=le.enum(["target_page_unpublished","redirect_target_missing","redirect_write_failed",...kp.options]),mI=le.discriminatedUnion("status",[le.object({status:le.literal("processing")}).strict(),le.object({status:le.literal("unavailable")}).strict(),le.object({status:le.literal("ready"),site_reason:kp.nullable(),same_path:yt,active:yt,exception:yt,exceptions:le.array(le.object({path:le.string().regex(/^\/[^?#]*$/),reason_code:cI}))})]),rF=le.object({overall_status:le.enum(["moving","completed","disabled","failed"]),by_collection:le.array(rI),media:le.object({image:yt,video:yt,audio:yt,file:yt}),exceptions:le.array(le.object({collection:wa.nullable(),path:le.string().regex(/^\/[^?#]*$/),reason_code:aI})),redirects:mI.nullable().optional()});var Da=t.object({heading:t.string().min(1).max(160).optional(),body:t.string().min(1).max(160).optional(),paletteIntent:t.string().min(1).max(400).optional(),surfaceMode:t.enum(["light","dark"]).optional(),radius:t.enum(["none","sm","md","lg","xl"]).optional(),density:t.enum(["compact","comfortable","airy","editorial"]).optional(),motionPreset:t.enum(["subtle","moderate","expressive"]).optional(),colorSeeds:t.object({primary:t.string().min(1).max(40),accent:t.string().min(1).max(40),foreground:t.string().min(1).max(40).optional(),neutral:t.string().min(1).max(40).optional(),supporting:t.array(t.string().min(1).max(40)).max(4).optional()}).optional(),imagePalette:t.object({background:t.string().min(1).max(40).optional(),foreground:t.string().min(1).max(40).optional(),card:t.string().min(1).max(40).optional(),muted:t.string().min(1).max(40).optional(),border:t.string().min(1).max(40).optional()}).optional(),themeId:t.string().min(1).max(60).optional(),themeDescription:t.string().min(1).max(400).optional(),aestheticNote:t.string().min(1).max(300).optional(),weightStyle:We.optional()}),Ca=t.enum(["material","reference","brief","industry"]),lI=t.object({market:t.object({value:t.string().min(1).max(200),source:Ca}),customer:t.object({value:t.string().min(1).max(200),source:Ca}),purpose:t.object({options:t.array(t.string().min(1).max(60)).min(2).max(4),selected:t.string().min(1).max(60),source:Ca})}),pI=t.enum(["text-options","motion-slider","positioning"]),Oa=t.enum(["none","subtle","moderate","expressive"]),dI=t.enum(["compact","comfortable","airy","editorial"]),uI=Oa,Dp=t.object({skill_name:t.string().min(1),rationale:t.string().min(4).max(200),confidence:t.enum(["high","medium","low"]).optional(),displayName:t.object({zh:t.string().min(1),en:t.string().min(1)}).partial().optional()}),_I=t.object({value:t.string(),label:t.string(),desc:t.string().optional(),impact:t.string().optional(),isRecommended:t.boolean().optional(),preselect:t.boolean().optional(),visualHints:Da.optional(),conversionHints:Mt.optional()}),gI=t.object({id:t.string(),type:pI,question:t.string(),tag:t.string(),aiThinking:t.string(),options:t.array(_I),source:t.enum(["ai-detected","always-ask"]),sourceDetail:t.string(),positioning:lI.optional()}),Na=t.object({questions:t.array(gI).min(1).max(6)}),LF=t.object({tenant_id:t.string().min(1),site_id:k,brief_id:Yt,brief:t.string().min(20).max(1e3),site_default_locale:Ie.optional(),owner_locale:Ie.optional(),input_context:t.object({facts:t.array(_s).max(120),conflicts:t.array(hs).max(20),reference:gs.optional(),sources:t.array(t.object({type:Pi,title:t.string().max(120).optional(),status:wi})).max(16).optional()}).optional()}),Op=t.enum(["model_schema_invalid","provider_rate_limited","provider_unavailable","aborted","unknown"]),MF=t.discriminatedUnion("type",[t.object({type:t.literal("run.started"),runId:$,at:t.string().min(1)}),t.object({type:t.literal("skill.selecting"),category:t.literal("page-generation"),available:t.array(t.object({id:t.string().min(1),name:t.string().min(1)})).max(20),at:t.string().min(1)}),t.object({type:t.literal("skill.selected"),category:t.literal("page-generation"),selected:t.object({id:t.string().min(1),name:t.string().min(1),reason:t.string().min(1).max(200)}),at:t.string().min(1)}),t.object({type:t.literal("clarify.partial"),object:t.unknown(),at:t.string().min(1)}),t.object({type:t.literal("clarify.archetype_proposals"),proposals:t.array(Dp).min(1).max(5),at:t.string().min(1)}),t.object({type:t.literal("clarify.finished"),questions_id:t.string().min(1),at:t.string().min(1)}),t.object({type:t.literal("run.failed"),error_code:t.string().min(1),message:t.string().min(1),error_category:Op.optional(),retryable:t.boolean().optional(),attempts:t.number().int().positive().optional(),at:t.string().min(1)}),t.object({type:t.literal("run.finished"),at:t.string().min(1)})]),UF="SITE_PLANNING_INPUT_FROZEN",FF="SITE_PLANNING_LOCKED",GF="SITE_STRUCTURE_CONFIRMATION_REQUIRED",qF="SITE_STRUCTURE_CONFIRMATION_STALE",WF="SITE_SITEMAP_DRAFT_STALE",BF="SITE_SITEMAP_DRAFT_OPERATION_MISMATCH",Ap="SITE_STRUCTURE_INVALID",KF=t.object({tenant_id:t.string().min(1),name:t.string().min(1).max(120),brief:t.string().min(20).max(1e3)}),zF=t.object({name:t.string().min(1).max(120),brief:t.string().min(20).max(1e3)}),HF=t.object({name:t.string().min(1).max(120)}),$F=t.object({name:t.string().min(1).max(120),default_locale:Ie.optional()}),VF=t.object({body:t.string().min(20).max(1e3)}),YF=t.object({body:t.string().min(20).max(1e3)}),ja=t.string().url().refine(e=>{try{let n=new URL(e).protocol;return n==="http:"||n==="https:"}catch{return!1}},{message:"URL must use http or https protocol"}),XF=t.object({tenant_id:t.string().min(1),site_id:k.optional(),site_url:ja.optional(),site_name:t.string().trim().min(1).max(255).optional()}),QF=M(jr),ZF=M(Lr),JF=M(Mr),eG=M(Qr),tG=M(Zr),nG=M(Jr),sG=M(tc),iG=M(nc),oG=M(sc),aG=M(t.object({site_id:k,site_url:ja.nullable()})),jt=t.object({id:k,tenant_id:t.string().min(1),name:t.string().min(1),slug:t.string().min(1),status:co,deployment_status:mo,archived_at:t.string().min(1).nullable(),current_sitemap_id:Ae.nullable(),confirmed_sitemap_id:Ae.nullable().optional(),confirmed_sitemap_version:t.number().int().positive().nullable().optional(),structure_confirmed_at:t.string().min(1).nullable().optional(),migration_content_requested:t.boolean().optional(),current_snapshot_id:I.nullable(),published_deployment_id:lt.nullable().optional(),deployed_url:t.string().url().nullable(),default_locale:Ie,owner_locale:Ie.optional(),cms_site_id:ys.nullable().optional(),cms_site_url:ja.nullable().optional(),parent_site_id:k.nullable().optional(),mount_path:t.string().min(1).nullable().optional(),schema_version:t.literal(1),created_at:t.string().min(1),updated_at:t.string().min(1)}),La=t.object({id:Yt,tenant_id:t.string().min(1),site_id:k,body:t.string().min(1),source:t.enum(["user","import","system"]),created_at:t.string().min(1),updated_at:t.string().min(1)}),rG=t.object({site:jt,brief:La,next_step:t.literal("clarify")}),cG=t.object({site:jt,brief:La}),mG=t.object({brief:La}),hI=t.enum(["queued","running","succeeded","failed","cancelled"]),Np=t.enum(["clarify","sitemap","workspace"]),jp=t.enum(["clarify","sitemap","initial_generation","iteration","landing_page","fill_in"]),Lp=t.enum(["clarify","sitemap","workspace","summarize"]),nt=t.object({id:$,tenant_id:t.string().min(1),site_id:k,agent_type:Np,run_kind:jp,status:hI,model_route:Lp,started_at:t.string().min(1).nullable(),finished_at:t.string().min(1).nullable(),error_code:t.string().min(1).nullable(),created_at:t.string().min(1),thread_id:st.nullable().optional()}),lG=t.object({agent_run:nt}).strict(),SI=t.enum(["workspace","landing_page","external"]),fI=t.enum(["user","background"]),Mp=t.enum(["active","archived"]),Ei=t.object({id:st,tenant_id:t.string().min(1),site_id:k,kind:SI,origin:fI,subject_key:t.string().min(1).max(200),title:t.string().min(1).max(200),status:Mp,external_thread_id:t.string().min(1).max(200).nullable(),last_run_id:$.nullable(),last_activity_at:t.string().min(1),created_at:t.string().min(1),updated_at:t.string().min(1)}),pG=t.object({agent_run:nt,thread:Ei.nullable()}),dG=t.object({run_id:$.optional(),site_id:k,agent_type:Np,run_kind:jp.optional(),model_route:Lp,input:t.record(t.string(),t.unknown()).optional()}).superRefine((e,n)=>{rs(e.input)&&n.addIssue({code:"custom",path:["input"],message:"Agent run input must not contain secrets"})}),uG=t.object({agent_run:nt,next_step:t.literal("stream_events")}),Up=t.enum(["draft","candidate","deleting","current","failed"]),xt=t.object({id:I,tenant_id:t.string().min(1),site_id:k,version:t.number().int().positive(),manifest_hash:t.string().regex(/^sha256:[a-f0-9]{64}$/),object_key:t.string().min(1),template_version:Ze.nullable().optional(),reason:t.enum(["initial_generation","workspace_edit","pre_deploy","manual_save","rollback","template_upgrade","subsite_clone"]),status:Up,created_at:t.string().min(1)}),_G=t.object({snapshot_id:I,creation_key:t.string().min(1),manifest_hash:t.string().regex(/^sha256:[a-f0-9]{64}$/),object_key:t.string().min(1),template_version:Ze.optional(),reason:xt.shape.reason,status:t.enum(["draft","candidate","current","failed"]).default("candidate"),source_run_id:$.optional()}),gG=t.object({site:jt,snapshot:xt,next_step:t.literal("workspace")}),hG=t.object({expected_manifest_hash:xt.shape.manifest_hash,manifest_hash:xt.shape.manifest_hash,object_key:xt.shape.object_key}).strict(),SG=t.union([t.object({base_snapshot_id:I.nullable(),source_run_id:$.optional(),page_template_advisories:t.array(Tn).optional()}).strict(),t.object({skip_base_check:t.literal(!0)}).strict()]),bI=t.object({site:jt,snapshot:xt,next_step:t.literal("workspace")}),fG=t.object({snapshot:xt}),bG=t.object({status:t.literal("deleting"),snapshot_id:I,object_key:t.string().min(1)}),yG=t.object({status:t.literal("deleted"),snapshot_id:I}),Ri=t.object({id:Xa,tenant_id:t.string().min(1),site_id:k,snapshot_id:I,version:t.number().int().positive(),accepted_commit:t.string().min(1),source_run_id:$.nullable(),created_at:t.string().min(1)}),yI=Ri.extend({reason:xt.shape.reason,status:Up}),xG=t.object({accepted_commit:t.string().min(1),source_run_id:$.optional()}),EG=t.object({site_version:Ri,next_step:t.literal("workspace")}),RG=t.object({owner_id:t.string().min(1)}).strict(),IG=t.discriminatedUnion("acquired",[t.object({acquired:t.literal(!0)}).strict(),t.object({acquired:t.literal(!1)}).strict()]),TG=t.object({owner_id:t.string().min(1)}).strict(),kG=t.object({released:t.literal(!0)}).strict(),AG="TEMPLATE_UPGRADE_LOCK_LOST",PG=t.object({base_snapshot_id:I,accepted_commit:Ri.shape.accepted_commit,owner_id:t.string().min(1)}).strict(),wG=bI.strict(),CG=t.object({site_versions:t.array(yI)}),vG=t.object({site:jt,snapshot:xt,site_version:Ri,next_step:t.literal("workspace")}),DG=t.object({snapshot_id:I,force_rehydrate:t.boolean().optional(),recovery_required:t.boolean().optional(),required_cms_site_id:ys.optional()}),xI=t.discriminatedUnion("status",[t.object({status:t.literal("ready"),snapshot_id:I,preview_url:t.string().min(1),launch_id:t.string().min(1).optional()}),t.object({status:t.literal("failed"),code:t.string().min(1),message:t.string().min(1),retryable:t.boolean(),snapshot_id:I.optional(),code_error:ji.optional()})]),OG=t.object({tenant_id:t.string().min(1),site_id:k,snapshot_id:I,cms_site_id:ys.optional()}).strict(),NG=xI,Ma=t.enum(Xt),Fp=t.enum(["quality_check","publish"]),Ot=t.object({id:lt,tenant_id:t.string().min(1),site_id:k,snapshot_id:I,type:Fp.default("publish"),version:t.number().int().positive(),status:Ma,provider:t.enum(["cloudflare"]),url:t.string().url().nullable(),error_code:t.string().min(1).nullable(),provider_deployment_id:t.string().min(1).nullable(),created_at:t.string().min(1),updated_at:t.string().min(1)}),jG=t.object({tenant_id:t.string().min(1),site_id:k,expected_snapshot_id:I}).strict(),LG=t.object({deployment:Ot}),MG=t.object({tenant_id:t.string().min(1),site_id:k,deployment_id:lt}).strict(),UG=t.object({deployment:Ot}),FG=t.object({}).strict(),GG=t.object({snapshot_id:I.optional()}).strict(),EI=t.object({deployment:Ot}),qG=M(EI),WG=t.object({deployment:Ot.nullable()}),BG=t.object({deployment:Ot}),Pp=t.object({id:lt,type:Fp.default("publish"),status:Ma,url:t.string().url().nullable(),error_code:t.string().min(1).nullable(),provider_deployment_id:t.string().min(1).nullable()}),RI=t.object({current:Pp.nullable(),latest_released:Pp.nullable()}),KG=M(RI),II=t.enum(["deployment.snapshot","deployment.status.changed","deployment.finished","deployment.failed","deployment.realtime.recovered","server.error"]),fn=t.object({id:t.string().min(1),tenant_id:t.string().min(1),site_id:k,deployment_id:lt,seq:t.number().int().positive(),sent_at:t.string().min(1)}),bi=t.object({deployment:Ot,steps:Kc.default([])}),zG=t.discriminatedUnion("type",[fn.extend({type:t.literal("deployment.snapshot"),payload:bi}),fn.extend({type:t.literal("deployment.status.changed"),payload:bi}),fn.extend({type:t.literal("deployment.finished"),payload:bi}),fn.extend({type:t.literal("deployment.failed"),payload:bi}),fn.extend({type:t.literal("deployment.realtime.recovered"),payload:t.object({action:t.literal("refresh")})}),fn.extend({type:t.literal("server.error"),payload:t.object({code:t.string().min(1),message:t.string().min(1),retryable:t.boolean()})})]),HG=t.object({tenant_id:t.string().min(1),site_id:k,deployment_id:lt,status:Ma,updated_at:t.string().min(1)}),TI="vcp:deployments",$G={path:"/v1/sites/:site_id/deployments/:deployment_id/socket",redis_channel:TI,outbound_message_schema:"DeploymentWsServerMessageSchema",message_types:[...II.options]},kI=t.object({error:t.object({code:t.string().min(1),message:t.string().min(1),details:t.unknown().optional(),request_id:t.string().min(1).optional(),retryable:t.boolean().default(!1)})}),VG=t.object({error:kI.shape.error.extend({code:t.literal("AGENT_RUN_IN_FLIGHT"),details:t.object({code:t.literal("AGENT_RUN_IN_FLIGHT"),message:t.string().min(1),agent_run:nt})})}),YG=t.object({colors:t.record(t.string(),t.string()).default({}),typography:t.record(t.string(),t.string()).default({}),spacing:t.record(t.string(),t.string()).default({}),motion:t.record(t.string(),t.string()).default({})}),AI=t.object({theme_id:t.string().min(1),paletteIntent:t.string().min(1),tone:t.string().min(1),mediaMood:t.string().min(1),motionLevel:Oa.optional(),userVisualHints:Da.optional()}),PI=t.object({key:t.string().min(1).max(64).optional(),question:t.string().min(1),answer:t.string().min(1)}),XG=t.object({query:t.string().min(1),keywords:t.array(t.string()).default([]),orientation:t.enum(["landscape","portrait","square"]).optional(),role:t.enum(["hero","section","card","gallery","testimonial","decorative"]),altHint:t.string().min(1)}),QG=t.object({id:t.string().min(1),role:t.enum(["site_background","nav_background","footer_background"]),query:t.string().min(1),keywords:t.array(t.string()).default([]),treatment:t.enum(["cover","fixed-cover","subtle-texture"]),altHint:t.string().optional()}),wI=t.object({provider:t.enum(["unsplash","pexels"]),providerLabel:t.enum(["Unsplash","Pexels"]),providerHref:t.string().url(),photoHref:t.string().url().optional(),photographerName:t.string().optional(),photographerHref:t.string().url().optional(),requiresAttribution:t.boolean()}),ZG=t.object({src:t.string().min(1),alt:t.string().min(1),width:t.number().int().positive().optional(),height:t.number().int().positive().optional(),provider:t.enum(["unsplash","pexels","placeholder"]).optional(),providerId:t.string().optional(),photoUrl:t.string().url().optional(),photographer:t.string().optional(),photographerUrl:t.string().url().optional(),credit:t.string().optional(),dominantColor:t.string().optional(),attribution:wI.optional()}),CI=t.enum(["system_recommended","user_picked","user_picked_extended","deterministic_fallback"]),bn=t.object({id:t.string().min(1),name:t.string().min(1),category:t.literal("page-generation"),version:t.string().min(1).optional(),reason:t.string().min(1).max(200),source:CI.default("system_recommended")}),oe=t.string().min(1).max(2e3),wp=t.string().min(1).max(120),fi=t.object({visualDirection:oe,brandFeeling:oe,paletteIntent:oe,typographyIntent:oe,density:dI,motionLevel:uI,motionPreset:t.enum(["subtle","moderate","expressive"]).optional(),mediaStrategy:oe,compositionRules:t.array(oe).max(20),avoidPatterns:t.array(oe).max(20),fonts:t.object({heading:t.string().min(1),body:t.string().min(1)}).optional(),colorSeeds:t.object({primary:t.string().min(1).max(40),accent:t.string().min(1).max(40),foreground:t.string().min(1).max(40).optional(),neutral:t.string().min(1).max(40).optional(),supporting:t.array(t.string().min(1).max(40)).max(4).optional()}).optional(),surfaceMode:t.enum(["light","dark"]).optional(),radius:t.enum(["none","sm","md","lg","xl"]).optional(),imagePalette:t.object({background:t.string().min(1).max(40).optional(),foreground:t.string().min(1).max(40).optional(),card:t.string().min(1).max(40).optional(),muted:t.string().min(1).max(40).optional(),border:t.string().min(1).max(40).optional()}).optional(),weightStyle:We.optional()}),Ua=160,Gp=t.object({routeGoal:oe,narrativeArc:oe,firstViewportIntent:oe,visualContinuity:oe,sectionRhythm:oe,avoidPatterns:t.array(oe).max(20),displayTitle:t.string().min(1).max(40).optional(),displayDescription:t.string().min(1).max(Ua).optional(),metaTitle:t.string().min(1).max(120).optional(),metaDescription:t.string().min(1).max(320).optional(),primaryKeyword:t.string().min(1).max(160).optional(),longTailKeywords:t.array(t.string().min(1).max(160)).max(3).optional()}),qp=t.enum(["model_call","validation","repair","preview","worker_group"]),Nt=t.enum(["generating","generating_design_plan","checking_quality","updating_design_memory"]),Wp=t.object({sectionRole:oe,contentIntent:oe,layoutIntent:oe,visualIntent:oe,mediaIntent:oe,motionIntent:oe,interaction:us.optional(),copyTone:oe,displayTitle:t.string().min(1).max(40).optional(),displayDescription:t.string().min(1).max(Ua).optional(),ctaIntent:oe.optional(),continuityWithPrevious:oe.optional(),avoidRepeating:t.array(oe).max(20).optional(),industryRecipeRefs:t.array(wp).max(12).optional(),templateRecipeRefs:t.array(wp).max(12).optional()}),Bp=t.object({siteName:t.string().min(1).max(120),tagline:t.string().min(1).max(200).optional(),primaryCta:t.object({label:t.string().min(1).max(60),target:t.string().min(1).max(200)}).optional(),trustSignals:t.array(t.string().min(1).max(60)).max(6).optional(),industry:t.string().min(1).max(40).optional()}),vI=t.enum(["solid","floating"]),DI=t.enum(["background","card","primary","frosted"]),OI=t.enum(["sticky","hide-on-scroll","static"]),NI=t.enum(["bar","island"]),jI=t.object({variant:vI,surface:DI.optional(),behavior:OI.optional(),shape:NI.optional()}),LI=t.object({form:oe,layoutIntent:oe,scrollBehavior:oe,shell:jI.optional(),avoidPatterns:t.array(oe).max(10).optional()}),MI=t.enum(["background","card","primary","inverse"]),UI=t.object({surface:MI}),FI=t.object({form:oe,composition:oe,shell:UI.optional(),avoidPatterns:t.array(oe).max(10).optional()}),GI=t.object({pattern:oe,intent:oe}),Kp=t.object({header:LI,footer:FI,mobileNav:GI}),zp=t.enum(["top","below-hero","footer","none"]),Hp=t.object({schemaVersion:t.literal(1).default(1),siteDesignContext:fi,routeCards:t.record(t.string().min(1),Gp),blockContexts:t.record(t.string().min(1),Wp),selectedSkillPacks:t.array(bn).max(3).optional(),branding:Bp.optional(),chromeDesign:Kp.optional(),breadcrumbPlacement:zp.optional()}),JG=t.object({siteDesignContext:fi.omit({imagePalette:!0}).optional(),routeCards:t.record(t.string().min(1),Gp).optional(),blockContexts:t.record(t.string().min(1),Wp.extend({interaction:us.nullable().optional()})).optional(),branding:Bp.optional(),chromeDesign:Kp.optional()}),Ge=t.string().trim().min(1),Fa=t.object({id:Ge,label:t.string().trim().min(1),type:t.string(),variant:t.string().optional(),order:t.number(),props:t.record(t.string(),t.unknown()),meta:t.object({aiGenerated:t.boolean(),userEdited:t.boolean(),lastEditedAt:t.string(),lastEditedBy:t.enum(["ai","user"]),userInstruction:t.string().optional()}).optional()}).strict(),Ga=t.string().regex(jn,"Page slug must be '/' or a lowercase ASCII kebab-case absolute path."),qI=new RegExp(`^/(?:${en}(?:/${en})*)?(?:\\?[^#\\s]*)?(?:#[^\\s]*)?$`),WI=/^(?:#[^\s]*|[a-z][a-z0-9+.-]*:[^\s]+|\/\/[^\s]+)$/i,BI=t.union([t.string().regex(qI),t.string().regex(WI)]),Cp=t.object({label:t.string(),href:BI}).passthrough(),KI=t.object({primaryLinks:t.array(Cp),footerLinks:t.array(Cp)}),$p=t.object({showInHeader:t.boolean(),showInFooter:t.boolean(),order:t.number()}).strict(),qa=t.object({id:Ge,slug:Ga,title:t.string().trim().min(1),blocks:t.array(Fa).min(1),navigation:$p,parent_page_id:Ge.nullable().optional()}).strict(),zI=Fa.extend({type:t.string().nullable()}).strict(),HI=qa.extend({slug:Ga.nullable(),navigation:$p.extend({showInHeader:t.boolean().nullable(),showInFooter:t.boolean().nullable()}).strict(),blocks:t.array(zI).min(1)}).strict(),$I=Fa.extend({id:t.string()}),VI=qa.omit({parent_page_id:!0}).extend({id:t.string(),slug:t.string().min(1),blocks:t.array($I).min(1),parent_page_id:t.string().nullable().optional()}),vp=t.object({label:t.string(),href:t.string().min(1)}),YI=t.object({primaryLinks:t.array(vp),footerLinks:t.array(vp)}),XI=t.discriminatedUnion("kind",[t.object({kind:t.literal("brief_clarify"),brief_id:Yt,answer_ids:t.array(t.string().min(1)).max(10)}).strict(),t.object({kind:t.literal("step5_strategy"),strategy_version_id:t.string().uuid(),strategy_version:t.number().int().positive(),strategy_checksum:t.string().regex(/^[a-f0-9]{64}$/)}).strict()]),yi=t.object({site_name:t.string().min(1).max(80).optional(),version:t.number().int().positive(),pages:t.array(qa).min(1),navigation:KI,integrations:t.object({cms:t.unknown().optional(),analytics:t.unknown().optional()}).optional(),meta:t.object({generatedAt:t.string(),generatedBy:t.literal("sitemap-agent"),source_brief_id:t.string().optional(),source_answer_ids:t.array(t.string()).optional(),source:XI.optional()}),skillSelection:bn,visualTheme:AI.optional(),userChoices:t.array(PI).optional(),confirmedChoices:t.object({conversion:Mt.optional()}).optional(),seoKeywords:t.array(Cn).min(1).optional()}).strict(),yn=yi.superRefine((e,n)=>{Vp(e.pages,n)}),gn=yi.extend({pages:t.array(HI).min(1)}).strict().superRefine((e,n)=>{Vp(e.pages,n)}),QI=t.enum(["slug","showInHeader","showInFooter"]),ZI=t.object({page_id:Ge,fields:t.array(QI).min(1).max(3)}).strict(),JI=t.object({page_id:Ge,block_id:Ge,fields:t.tuple([t.literal("type")])}).strict(),eT=100,tT=500,nT=t.object({pages:t.array(ZI).max(eT),blocks:t.array(JI).max(tT)}).strict().superRefine((e,n)=>{let s=new Set;e.pages.forEach((o,a)=>{s.has(o.page_id)&&n.addIssue({code:"custom",path:["pages",a,"page_id"],message:`Duplicate page target '${o.page_id}'.`}),s.add(o.page_id),new Set(o.fields).size!==o.fields.length&&n.addIssue({code:"custom",path:["pages",a,"fields"],message:"Page target fields must be unique."})});let i=new Set;e.blocks.forEach((o,a)=>{let c=`${o.page_id}\0${o.block_id}`;i.has(c)&&n.addIssue({code:"custom",path:["blocks",a],message:`Duplicate block target '${o.page_id}/${o.block_id}'.`}),i.add(c)})}),eq=t.object({sitemap:gn,targets:nT,reserved_slugs:t.array(Ga).optional()}).strict(),tq=t.object({sitemap:yn}).strict();function Vp(e,n){let s=new Map,i=new Map,o=new Map,a=0;e.forEach((m,x)=>{let _=s.get(m.id);if(_!==void 0?n.addIssue({code:"custom",path:["pages",x,"id"],message:`Duplicate page id '${m.id}' (first used at pages.${_}.id).`}):s.set(m.id,x),m.blocks.forEach((B,z)=>{let ne=i.get(B.id);ne!==void 0?n.addIssue({code:"custom",path:["pages",x,"blocks",z,"id"],message:`Duplicate block id '${B.id}' (first used at pages.${ne.pageIndex}.blocks.${ne.blockIndex}.id).`}):i.set(B.id,{pageIndex:x,blockIndex:z})}),m.slug===null)return;m.slug==="/"&&(a+=1);let w=o.get(m.slug);w!==void 0?n.addIssue({code:"custom",path:["pages",x,"slug"],message:`Duplicate page slug '${m.slug}' (first used at pages.${w}.slug).`}):o.set(m.slug,x)}),(a!==1||e[0]?.slug!=="/")&&n.addIssue({code:"custom",path:["pages"],message:"Sitemap must contain exactly one home page at pages[0] with slug '/'.",params:{errorCode:Ap}});let c=new Map(e.map((m,x)=>[m.id,{page:m,index:x}])),r=(m,x)=>n.addIssue({code:"custom",path:m,message:x,params:{errorCode:Ap}});e.forEach((m,x)=>{let _=m.parent_page_id??null;if(_===null)return;let w=["pages",x,"parent_page_id"];if(m.slug==="/"){r(w,"The home page cannot have a parent.");return}if(_===m.id){r(w,`Page '${m.id}' cannot be its own parent.`);return}let B=c.get(_);if(!B){r(w,`Parent page '${_}' does not exist.`);return}if(B.page.slug==="/"){r(w,"The home page cannot have sub pages.");return}(B.page.parent_page_id??null)!==null&&r(w,`Sitemap allows at most two levels; parent '${_}' must be a top-level page.`)})}var nq=yi.omit({skillSelection:!0,visualTheme:!0,userChoices:!0,confirmedChoices:!0,seoKeywords:!0}).extend({meta:yi.shape.meta.omit({source:!0}),site_name:t.string().min(1).max(80),pages:t.array(VI).min(1),navigation:YI}),sT=t.enum(["ai","user"]),xn=t.object({site_id:k,page_id:Ge,edited_by:sT.default("ai"),source_agent_run_id:$.optional()}),sq=xn.extend({block_id:Ge,target_index:t.number().int().min(0)}),iT=xn.extend({block_id:Ge}),oT=xn.extend({block_id:Ge,instruction:t.string()}),iq=xn.extend({block_id:Ge,variant:t.string().min(1).nullable()}),oq=xn.extend({block_id:Ge,props:t.record(t.string(),t.unknown()),mode:t.enum(["replace","merge"]).default("replace")}),aq=xn.extend({block:t.object({id:Ge,label:t.string().trim().min(1),type:t.string().min(1),variant:t.string().min(1).optional(),props:t.record(t.string(),t.unknown()).default({}),insert_index:t.number().int().min(0).optional()})}),aT=t.enum(["move_block","delete_block","update_block_instruction","change_block_variant","update_block_props","add_block"]),rq=t.discriminatedUnion("operation",[t.object({operation:t.literal("delete_block"),input:iT}).strict(),t.object({operation:t.literal("update_block_instruction"),input:oT}).strict()]),rT=t.enum(["SITEMAP_EDIT_INVALID","SITEMAP_API_NOT_CONFIGURED","SITEMAP_NOT_FOUND","SITEMAP_PAGE_NOT_FOUND","SITEMAP_BLOCK_NOT_FOUND","SITEMAP_BLOCK_ALREADY_EXISTS","SITEMAP_LAST_BLOCK_DELETE_FORBIDDEN","SITEMAP_EDIT_FAILED"]),cT=t.object({status:t.literal("updated"),operation:aT,site_id:k,sitemap_id:Ae,version:t.number().int().positive(),changed_pages:t.array(Ge).min(1),requires_code_patch:t.literal(!0)}),mT=t.object({status:t.literal("failed"),code:rT,message:t.string().min(1),retryable:t.boolean().default(!1),details:t.unknown().optional()}),cq=t.discriminatedUnion("status",[cT,mT]),Wa=t.object({question_id:t.string().min(1),value:t.string().min(1),label:t.string().min(1).optional(),question:t.string().min(1).optional(),option_label:t.string().min(1).optional(),motion_level:Oa.optional(),visual_tonality:Da.optional(),conversion:Mt.optional(),positioning:t.object({market:t.string().min(1).max(200),customer:t.string().min(1).max(200),purpose:t.string().min(1).max(60)}).optional()}),lT=t.object({id:t.string().trim().min(1).max(128),type:t.literal(1),search_intent:t.string().trim().min(1).max(255),path:t.string().trim().regex(/^\/(?:[a-z0-9]+(?:-[a-z0-9]+)*)?$/),channel:t.string().trim().min(1).max(80),content_format:t.string().trim().min(1).max(80),priority:t.enum(["P0","P1","P2","P3"])}).strict(),mq=t.object({source:t.object({kind:t.literal("step5_strategy")}).strict()}).strict(),pT=t.object({item_key:ks,title:t.string().trim().min(1).max(200),selected_option_id:Dn,selected_label:t.string().trim().min(1).max(200),selected_value:t.string().trim().min(1).max(500),selected_description:t.string().trim().min(1).max(2e3),impact:t.string().trim().min(1).max(500).optional(),customer_note:t.string().trim().min(1).max(200).optional(),market_type:As.optional(),markets:t.array(Ps).max(32).optional(),promoted_businesses:ws.optional(),sections:t.array(t.object({id:t.string().min(1),label:t.string().min(1)}).strict()).optional()}).strict().superRefine((e,n)=>{e.item_key==="product"&&!e.promoted_businesses&&n.addIssue({code:"custom",path:["promoted_businesses"],message:"The product sitemap decision requires ordered promoted businesses."}),e.item_key!=="product"&&e.promoted_businesses!==void 0&&n.addIssue({code:"custom",path:["promoted_businesses"],message:"Promoted businesses are only valid for the product sitemap decision."})}),dT=t.object({kind:t.literal("step5_strategy"),site_name:t.string().trim().min(1).max(80).optional(),strategy_version_id:t.string().uuid(),strategy_version:t.number().int().positive(),strategy_checksum:t.string().regex(/^[a-f0-9]{64}$/),decisions:t.array(pT).min(Is).max(Ne),enterprise_keywords:t.array(Cn).min(1).optional()}).strict().superRefine((e,n)=>{let s=e.decisions.map(o=>o.item_key);new Set(s).size!==s.length&&n.addIssue({code:"custom",path:["decisions"],message:"Step5 sitemap decisions must use unique strategy keys."}),vn.forEach(o=>{s.includes(o)||n.addIssue({code:"custom",path:["decisions"],message:`Step5 sitemap decisions are missing ${o}.`})});let i=Zt.filter(o=>s.includes(o));e.decisions.forEach((o,a)=>{o.item_key!==i[a]&&n.addIssue({code:"custom",path:["decisions",a,"item_key"],message:"Step5 sitemap decisions must use the canonical order."})})}),Yp=t.object({tenant_id:t.string().min(1),site_id:k,brief_id:Yt,brief:t.string().min(20).max(1e3),answers:t.array(Wa).min(1).max(10),skillSelection:bn,site_default_locale:Ie.optional(),owner_locale:Ie.optional(),cms_site_id:t.string().min(1).nullish(),intent_pages:t.array(lT).max(9).optional(),reference:gs.optional(),input_context:t.object({facts:t.array(_s).max(120),conflicts:t.array(hs).max(20)}).optional(),business_facts:dr.optional(),migration_products_enabled:t.boolean().optional()}),uT=Yp.pick({tenant_id:!0,site_id:!0,skillSelection:!0,site_default_locale:!0,owner_locale:!0,cms_site_id:!0,reference:!0,input_context:!0,business_facts:!0,migration_products_enabled:!0}).partial({skillSelection:!0}).extend({source:dT}).strict(),lq=t.union([Yp,uT]),Xp=t.enum(["planning","generating","validating","ready"]),_T=t.enum(["salvaged","deterministic_fallback"]),gT=t.enum(["model_exception_settled_prefix","model_exception_safe_root"]),Qp={outcome:_T.optional(),reason:gT.optional(),attempts:t.number().int().positive().optional()};function Zp(e,n){if(e.type!=="sitemap.generated")return;let s=e.outcome!==void 0,i=e.reason!==void 0;s!==i&&n.addIssue({code:"custom",path:[s?"reason":"outcome"],message:"sitemap.generated outcome and reason must be provided together"})}var hT=t.discriminatedUnion("type",[t.object({type:t.literal("run.started"),runId:$,at:t.string().min(1)}),t.object({type:t.literal("sitemap.generating"),stage:Xp,message:t.string().min(1).optional(),at:t.string().min(1)}),t.object({type:t.literal("sitemap.partial"),object:t.unknown(),at:t.string().min(1)}),t.object({type:t.literal("sitemap.generated"),sitemap_id:Ae,sitemap:yn,...Qp,at:t.string().min(1)}),t.object({type:t.literal("sitemap.clamped"),reason:t.enum(["page_early_stop","finalize_best_effort"]),original_page_count:t.number().int().nonnegative().optional(),final_page_count:t.number().int().nonnegative().optional(),original_block_count:t.number().int().nonnegative().optional(),final_block_count:t.number().int().nonnegative().optional(),at:t.string().min(1)}),t.object({type:t.literal("media_resolution.started"),slot_count:t.number().int().nonnegative(),at:t.string().min(1)}),t.object({type:t.literal("media_resolution.finished"),slot_count:t.number().int().nonnegative(),provider_counts:t.object({unsplash:t.number().int().nonnegative(),pexels:t.number().int().nonnegative(),placeholder:t.number().int().nonnegative()}),fallback_count:t.number().int().nonnegative(),error_codes:t.array(t.string()),at:t.string().min(1)}),t.object({type:t.literal("snapshot.created"),snapshot_id:I,manifest_hash:t.string().regex(/^sha256:[a-f0-9]{64}$/),at:t.string().min(1)}),t.object({type:t.literal("run.failed"),error_code:t.string().min(1),message:t.string().min(1),at:t.string().min(1)}),t.object({type:t.literal("run.finished"),snapshot_id:I.optional(),at:t.string().min(1)})]),pq=hT.superRefine(Zp),Jp=t.object({id:Ae,tenant_id:t.string().min(1),site_id:k,version:t.number().int().positive(),source_agent_run_id:$.nullable(),created_at:t.string().min(1),updated_at:t.string().min(1)}).strict();function ed(e,n){e.version!==e.sitemap.version&&n.addIssue({code:"custom",path:["sitemap","version"],message:`Sitemap JSON version ${e.sitemap.version} must equal record version ${e.version}.`})}var td=Jp.extend({sitemap:yn}).superRefine(ed),nd=Jp.extend({sitemap:gn}).superRefine(ed),dq=t.object({sitemap_id:Ae,creation_key:t.string().min(1),sitemap:gn,expected_current_sitemap_id:Ae,expected_current_sitemap_version:t.number().int().positive()}).strict().superRefine((e,n)=>{e.sitemap.version!==e.expected_current_sitemap_version&&n.addIssue({code:"custom",path:["sitemap","version"],message:"Draft version must match the expected base version."})}),uq=t.object({sitemap:nd}).strict();function _q(e){return`sitemap-user-draft:${e.site_id}:${e.expected_current_sitemap_id}:${e.expected_current_sitemap_version}:${e.sitemap_id}`}var gq=t.object({sitemap_id:Ae,creation_key:t.string().min(1),sitemap:yn,source_agent_run_id:$.optional()}),hq=t.object({sitemap_id:Ae,creation_key:t.string().min(1),sitemap:gn,expected_current_sitemap_id:Ae,expected_current_sitemap_version:t.number().int().positive(),migration_content_requested:t.boolean().optional()}),Sq=t.object({sitemap_id:Ae,creation_key:t.string().min(1),sitemap:yn,source_agent_run_id:$}),fq=t.object({site:jt,sitemap:td,next_step:t.literal("workspace")}).strict(),bq=t.object({site:jt,sitemap:nd,next_step:t.literal("workspace")}).strict(),yq=t.object({site:jt,sitemap:td,next_step:t.literal("sitemap_review")}).strict(),ST=t.object({id:Ya,tenant_id:t.string().min(1),site_id:k,brief_id:Yt,questions:Na,answers:t.array(Wa),selected_archetype:bn.optional(),completed_at:t.string().min(1).nullable(),created_at:t.string().min(1),updated_at:t.string().min(1)}),xq=t.object({answers:t.array(Wa).min(1),questions:Na,selected_archetype:bn.optional()}),Eq=t.object({clarify_session:ST}),Rq=t.object({questions:Na,selected_archetype:bn}),fT=t.object({id:Ti,tenant_id:t.string().min(1),site_id:k,version:t.number().int().positive(),design_plan:Hp,source_agent_run_id:$.nullable(),created_at:t.string().min(1),updated_at:t.string().min(1)}),Iq=t.object({design_plan_id:Ti.optional(),design_plan:Hp,source_agent_run_id:$.optional()}),Tq=t.object({design_plan:fT}),Ii=t.enum(["initial_generation","iteration","landing_page","fill_in"]),bT=t.object({label:t.string().min(1).max(48),prompt:t.string().min(1).max(160)}).strict(),yT=t.enum(["model","derived","mixed","advisor"]),sd=t.object({suggestions:t.array(bT).min(1).max(4),source:yT}).strict(),xT=t.enum(["clean","salvaged","deterministic_fallback","baseline_retained"]),ET=t.enum(["generation_succeeded","entry_slots_omitted","quality_gate_exhausted","schema_gate_exhausted","generation_timeout","stream_schema_mismatch","stream_generation_error","generation_error","fallback_compiler_error","legacy_result_missing_metadata"]),RT=t.enum(["progress","assistant_final"]),id=t.enum(["run.started","message.delta","user.message","plan.updated","clarify.partial","clarify.archetype_proposals","clarify.finished","sitemap.generating","sitemap.partial","sitemap.generated","sitemap.clamped","sitemap.updated","sitemap.resync.failed","sitemap.resync.warning","block.changed","tool.started","tool.finished","workspace.plan.created","workspace.worker.updated","workspace.task.updated","workspace.degraded","workspace.design_plan.outcome","workspace.suggestions","workspace.generation_ledger","file.changed","snapshot.created","snapshot.finalized","preview.preparing","preview.ready","preview.build.started","preview.build.succeeded","preview.build.failed","run.failed","run.finished","media_resolution.started","media_resolution.finished","skill.selecting","skill.selected","activity.started","activity.updated","activity.finished","activity.failed"]),IT=t.object({id:t.string().min(1),title:t.string().min(1),status:t.enum(["pending","running","completed","failed"])}),Vt=t.enum(["pending","running","completed","completed_with_skips","failed","skipped"]),Ba=t.enum(["style_media","chrome","sections","layout","pages","detect_typecheck","repair","finalize","sitemap_resync","preview"]),Ka=t.object({code:t.string().min(1),message:t.string().min(1),path:t.string().min(1).optional(),task_id:t.string().min(1).optional(),details:t.record(t.string(),t.unknown()).optional()}),De=t.string().min(1).refine(e=>Sd(e),{message:"Snapshot file paths must be safe relative POSIX paths without traversal."}),za=t.object({deduped_paths:t.array(De),skipped_tasks:t.array(t.string().min(1)),failed_tasks:t.array(t.string().min(1)),fallback_files:t.array(t.string().min(1)),applied_paths:t.array(De)}),Ha=t.object({group_id:t.string().min(1),phase:Ba,title:t.string().min(1),status:Vt,task_ids:t.array(t.string().min(1)),depends_on_groups:t.array(t.string().min(1)),target_paths:t.array(De)}),TT=t.enum(["style","media","chrome","section","layout","page","breadcrumb"]),$a=t.object({task_id:t.string().min(1),group_id:t.string().min(1),kind:TT,target_path:De,block_id:t.string().min(1).optional(),block_type:t.string().min(1).optional(),block_variant:t.string().min(1).optional(),block_order:t.number().int().nonnegative().optional(),user_instruction:t.string().min(1).optional(),page_id:t.string().min(1).optional(),page_slug:t.string().min(1).optional(),page_title:t.string().min(1).optional(),title:t.string().min(1).max(60).optional(),description:t.string().min(1).max(Ua).optional(),status:Vt,required_reads:t.array(De).optional(),search_params_sections:t.array(De).optional(),standard_form_view:De.optional(),breadcrumb:t.object({trail:t.array(t.object({name:t.string().min(1),href:t.string().min(1).nullable(),omitted_href:t.string().min(1).optional()}).strict()).min(1),current:t.string().min(1),placement:zp.optional()}).strict().optional()}),Va=t.object({from_group_id:t.string().min(1),to_group_id:t.string().min(1),reason:t.enum(["style_media","chrome","sections","layout","page_composition","quality_gate"])}),kq=t.object({plan_id:t.string().min(1),run_kind:Ii,model_route:t.object({planner:t.literal("workspace_planner"),worker:t.literal("workspace")}),groups:t.array(Ha),tasks:t.array($a),dependencies:t.array(Va),expected_outputs:t.array(De),diagnostics:za}),Aq=t.object({task_id:t.string().min(1),patch:t.unknown().optional(),snapshot_id:I.optional(),read_files:t.array(De),diagnostics:t.array(Ka),status:Vt}),od=t.object({worker_count:t.number().int().nonnegative(),task_count:t.number().int().nonnegative(),group_count:t.number().int().nonnegative()}),ad=t.object({pending:t.number().int().nonnegative(),running:t.number().int().nonnegative(),completed:t.number().int().nonnegative(),completed_with_skips:t.number().int().nonnegative(),failed:t.number().int().nonnegative(),skipped:t.number().int().nonnegative()}),kT=t.object({type:t.literal("text"),text:t.string(),state:t.enum(["streaming","done"]).optional()}),AT=t.object({type:t.literal("reasoning"),text:t.string(),state:t.enum(["streaming","done"]).optional(),providerMetadata:t.record(t.string(),t.unknown()).optional()}),PT=t.object({type:t.literal("file"),mediaType:t.string().min(1),filename:t.string().min(1).optional(),url:t.string().min(1)}),wT=t.object({type:t.literal("source-url"),sourceId:t.string().min(1),url:t.string().min(1),title:t.string().min(1).optional(),providerMetadata:t.record(t.string(),t.unknown()).optional()}),CT=t.object({type:t.literal("source-document"),sourceId:t.string().min(1),mediaType:t.string().min(1),title:t.string().min(1),filename:t.string().min(1).optional(),providerMetadata:t.record(t.string(),t.unknown()).optional()}),vT=t.object({type:t.string().regex(/^data-[a-zA-Z0-9_-]+$/),id:t.string().min(1).optional(),data:t.unknown()}),DT=t.object({type:t.string().regex(/^tool-[a-zA-Z0-9_-]+$/),toolCallId:t.string().min(1),state:t.enum(["input-streaming","input-available","output-available","output-error"]),input:t.unknown().optional(),output:t.unknown().optional(),errorText:t.string().min(1).optional()}),OT=t.object({type:t.literal("error"),errorText:t.string().min(1)}),NT=t.object({type:t.literal("step-start")}),xi=t.union([kT,AT,PT,wT,CT,vT,DT,OT,NT]),jT=t.string().min(1).max(512).refine(e=>Sd(e)&&!/^[A-Za-z]:\//.test(e),{message:"Generated-code rescue paths must be safe relative POSIX paths without traversal."}),LT=t.array(jT).min(1).max(64),MT=t.array(t.string().min(1).max(120)).min(1).max(64),rd=t.discriminatedUnion("outcome",[t.object({outcome:t.literal("full_success"),page_copy:Os.optional(),navigation:t.discriminatedUnion("status",[t.object({status:t.literal("not_requested")}).strict(),t.object({status:t.literal("succeeded")}).strict()])}).strict(),t.object({outcome:t.literal("partial_success"),page_copy:Os.optional(),navigation:t.object({status:t.literal("failed"),error_code:t.string().min(1).max(120),message:t.string().min(1).max(360)}).strict()}).strict()]).describe("Typed completion details for a committed Workspace Resource Run."),UT=t.discriminatedUnion("type",[t.object({type:t.literal("run.started"),runId:$,at:t.string().min(1)}),t.object({type:t.literal("message.delta"),text:t.string().min(1),history_purpose:RT.optional(),at:t.string().min(1)}),t.object({type:t.literal("user.message"),client_message_id:t.string().min(1),message_id:t.string().min(1),parts:t.array(xi).min(1),display_text:t.string().min(1).max(4e3).optional(),in_reply_to_tool_call_id:t.string().min(1).optional(),interaction_response:js.optional(),at:t.string().min(1)}),t.object({type:t.literal("plan.updated"),steps:t.array(IT),at:t.string().min(1)}),t.object({type:t.literal("clarify.partial"),object:t.unknown(),at:t.string().min(1)}),t.object({type:t.literal("clarify.archetype_proposals"),proposals:t.array(Dp).min(1).max(5),at:t.string().min(1)}),t.object({type:t.literal("clarify.finished"),questions_id:t.string().min(1),at:t.string().min(1)}),t.object({type:t.literal("sitemap.generating"),stage:Xp,message:t.string().min(1).optional(),at:t.string().min(1)}),t.object({type:t.literal("sitemap.partial"),object:t.unknown(),at:t.string().min(1)}),t.object({type:t.literal("sitemap.generated"),sitemap_id:Ae,sitemap:yn,...Qp,at:t.string().min(1)}),t.object({type:t.literal("sitemap.clamped"),reason:t.enum(["page_early_stop","finalize_best_effort"]),original_page_count:t.number().int().nonnegative().optional(),final_page_count:t.number().int().nonnegative().optional(),original_block_count:t.number().int().nonnegative().optional(),final_block_count:t.number().int().nonnegative().optional(),at:t.string().min(1)}).strict(),t.object({type:t.literal("sitemap.updated"),sitemap_id:Ae,version:t.number().int().positive(),reason:t.string().min(1),at:t.string().min(1)}),t.object({type:t.literal("sitemap.resync.failed"),error_code:t.string().min(1),message:t.string().min(1),retryable:t.boolean(),diagnostics:t.unknown().optional(),at:t.string().min(1)}),t.object({type:t.literal("sitemap.resync.warning"),code:t.string().min(1),message:t.string().min(1),diagnostics:t.unknown().optional(),at:t.string().min(1)}),t.object({type:t.literal("block.changed"),block_id:t.string().min(1),change_type:t.enum(["add","update","delete","move"]),at:t.string().min(1)}),t.object({type:t.literal("tool.started"),tool_call_id:t.string().min(1),name:t.string().min(1),summary:t.string().min(1),at:t.string().min(1)}),t.object({type:t.literal("tool.finished"),tool_call_id:t.string().min(1),name:t.string().min(1),result_summary:t.string().min(1),interaction_request:go.optional(),interaction_failure:_o.optional(),at:t.string().min(1)}),t.object({type:t.literal("workspace.plan.created"),plan_id:t.string().min(1),run_kind:Ii,groups:t.array(Ha),tasks:t.array($a),dependencies:t.array(Va),expected_outputs:t.array(De),diagnostics:za,summary:od,at:t.string().min(1)}).strict(),t.object({type:t.literal("workspace.worker.updated"),group_id:t.string().min(1),phase:Ba,status:Vt,task_counts:ad,target_paths:t.array(De),diagnostics:t.array(t.string().min(1)),at:t.string().min(1)}).strict(),t.object({type:t.literal("workspace.task.updated"),task_id:t.string().min(1),group_id:t.string().min(1),status:Vt,target_path:De,read_files_count:t.number().int().nonnegative(),diagnostics:t.array(t.string().min(1)),diagnostic_details:t.array(Ka).optional(),at:t.string().min(1)}).strict(),t.object({type:t.literal("workspace.degraded"),reason:t.enum(["block_placeholder","form_placeholder","patch_protected_dropped","preview_health_degraded","preview_build_failed","design_plan_fallback","generated_code_rescue","cms_page_directory_degraded","form_prebuild_skipped","form_section_fallback","first_settings_sync_failed","component_omitted","page_omitted","shared_fallback"]),degraded_block_ids:t.array(t.string().min(1)).min(1).optional(),dropped_files:t.array(t.string().min(1)).min(1).optional(),degraded_file_paths:LT.optional(),degraded_page_ids:MT.optional(),snapshot_id:I.optional(),code:t.string().min(1).optional(),message:t.string().min(1).optional(),diagnostics:t.string().min(1).optional(),retryable:t.boolean().optional(),at:t.string().min(1)}).strict().superRefine((e,n)=>{let s=e.reason==="generated_code_rescue",i=e.reason==="page_omitted",o=e.reason==="shared_fallback";if(!s){if(e.degraded_file_paths!==void 0&&n.addIssue({code:"custom",path:["degraded_file_paths"],message:"degraded_file_paths is only allowed for generated_code_rescue"}),e.degraded_page_ids!==void 0&&!i&&n.addIssue({code:"custom",path:["degraded_page_ids"],message:"degraded_page_ids is only allowed for generated_code_rescue or page_omitted"}),o)for(let a of["degraded_block_ids","dropped_files","snapshot_id","code","diagnostics","retryable"])e[a]!==void 0&&n.addIssue({code:"custom",path:[a],message:`${a} is not allowed for shared_fallback`});return}e.degraded_file_paths===void 0&&n.addIssue({code:"custom",path:["degraded_file_paths"],message:"generated_code_rescue requires degraded_file_paths"});for(let a of["degraded_block_ids","dropped_files","snapshot_id","code","message","diagnostics","retryable"])e[a]!==void 0&&n.addIssue({code:"custom",path:[a],message:`${a} is not allowed for generated_code_rescue`})}),t.object({type:t.literal("workspace.design_plan.outcome"),design_plan_outcome:xT,reason:ET,gate_diagnostics:t.object({gate:t.enum(["quality","schema"]),issue_codes:t.array(t.string().min(1)).max(20),issue_paths:t.array(t.string()).max(20),finish_reason:t.string().min(1).optional()}).strict().optional(),media_floor:t.object({total_blocks:t.number().int().min(0),media_bearing_blocks:t.number().int().min(0),hero_total:t.number().int().min(0),hero_media_bearing:t.number().int().min(0),pages_without_media:t.array(t.string().min(1)).max(50),met:t.boolean()}).strict().optional(),at:t.string().min(1)}).strict(),sd.extend({type:t.literal("workspace.suggestions"),at:t.string().min(1)}).strict(),gr,t.object({type:t.literal("file.changed"),path:t.string().min(1),change_type:t.enum(["create","update","delete"]),diff:t.string().optional(),at:t.string().min(1)}),t.object({type:t.literal("snapshot.created"),snapshot_id:I,manifest_hash:t.string().regex(/^sha256:[a-f0-9]{64}$/),at:t.string().min(1)}),t.object({type:t.literal("snapshot.finalized"),snapshot_id:I,at:t.string().min(1)}),t.object({type:t.literal("preview.preparing"),at:t.string().min(1)}),t.object({type:t.literal("preview.ready"),url:t.string().url(),at:t.string().min(1),launch_id:t.string().min(1).optional()}),t.object({type:t.literal("preview.build.started"),snapshot_id:I,at:t.string().min(1)}),t.object({type:t.literal("preview.build.succeeded"),snapshot_id:I,at:t.string().min(1)}),t.object({type:t.literal("preview.build.failed"),snapshot_id:I,message:t.string().min(1),diagnostics:t.string().min(1),retryable:t.boolean(),at:t.string().min(1)}),t.object({type:t.literal("run.failed"),error_code:t.string().min(1),message:t.string().min(1),error_category:Op.optional(),retryable:t.boolean().optional(),attempts:t.number().int().positive().optional(),outcome:t.literal("retained_previous").optional(),details:t.record(t.string(),t.unknown()).optional(),at:t.string().min(1)}),t.object({type:t.literal("run.finished"),snapshot_id:I.optional(),degraded_reason:In.optional(),build_verified:t.boolean().optional(),generation_ledger:Pn.optional(),resource_operation:rd.optional(),at:t.string().min(1)}),t.object({type:t.literal("media_resolution.started"),slot_count:t.number().int().nonnegative(),at:t.string().datetime()}),t.object({type:t.literal("media_resolution.finished"),slot_count:t.number().int().nonnegative(),provider_counts:t.object({unsplash:t.number().int().nonnegative(),pexels:t.number().int().nonnegative(),placeholder:t.number().int().nonnegative()}),fallback_count:t.number().int().nonnegative(),error_codes:t.array(t.string()),at:t.string().datetime()}),t.object({type:t.literal("skill.selecting"),category:t.literal("page-generation"),available:t.array(t.object({id:t.string().min(1),name:t.string().min(1)})).max(20),at:t.string().min(1)}),t.object({type:t.literal("skill.selected"),category:t.literal("page-generation"),selected:t.object({id:t.string().min(1),name:t.string().min(1),reason:t.string().min(1).max(200)}),at:t.string().min(1)}),t.object({type:t.literal("activity.started"),activity_id:t.string().min(1),parent_activity_id:t.string().min(1).optional(),kind:qp,title:t.string().min(1).max(200),detail:t.string().max(360).optional(),title_code:Nt.optional(),detail_code:Nt.optional(),locks_input:t.boolean(),at:t.string().min(1)}),t.object({type:t.literal("activity.updated"),activity_id:t.string().min(1),title:t.string().min(1).max(200).optional(),detail:t.string().max(360).optional(),title_code:Nt.optional(),detail_code:Nt.optional(),at:t.string().min(1)}),t.object({type:t.literal("activity.finished"),activity_id:t.string().min(1),at:t.string().min(1)}),t.object({type:t.literal("activity.failed"),activity_id:t.string().min(1),detail:t.string().max(360).optional(),at:t.string().min(1)})]),cd=UT.superRefine(Zp).superRefine((e,n)=>{if(e.type==="user.message"&&e.interaction_response&&!e.in_reply_to_tool_call_id&&n.addIssue({code:"custom",path:["in_reply_to_tool_call_id"],message:"in_reply_to_tool_call_id is required for an interaction response"}),e.type==="run.finished"&&e.resource_operation&&!e.snapshot_id&&n.addIssue({code:"custom",path:["snapshot_id"],message:"resource_operation requires a confirmed snapshot_id"}),e.type!=="tool.finished")return;let s=e.name==="prepare_product_search_entry",i=!!e.interaction_request,o=!!e.interaction_failure;(s?i!==o:!i&&!o)||n.addIssue({code:"custom",path:["interaction_request"],message:s?"prepare_product_search_entry requires exactly one of interaction_request or interaction_failure":"product search interaction results are only valid for prepare_product_search_entry"})}),va=t.object({id:Qa,tenant_id:t.string().min(1),site_id:k,agent_run_id:$,sequence:t.number().int().positive(),event_type:id,payload:cd,created_at:t.string().min(1),thread_id:st.nullable().optional()}),Pq=t.object({event_type:id,payload:cd}).superRefine((e,n)=>{e.event_type!==e.payload.type&&n.addIssue({code:"custom",path:["payload","type"],message:"payload.type must match event_type"}),rs(e.payload)&&n.addIssue({code:"custom",path:["payload"],message:"AgentEvent payload must not contain secrets"})}),wq=t.discriminatedUnion("status",[t.object({status:t.literal("appended"),agent_run:nt,event:va,next_cursor:t.number().int().nonnegative()}),t.object({status:t.literal("duplicate_ignored"),agent_run:nt,event:va,next_cursor:t.number().int().nonnegative()})]),Cq=t.object({events:t.array(va),next_cursor:t.number().int().nonnegative().optional()}),vq=t.object({after_sequence:t.coerce.number().int().nonnegative().default(0)}),Dq=t.object({run_id:$.optional(),thread_id:st.optional()}).superRefine((e,n)=>{e.run_id&&e.thread_id&&n.addIssue({code:"custom",path:["thread_id"],message:"run_id and thread_id are mutually exclusive"})}),Oq=t.enum(["implemented","skeleton","planned"]),Nq=t.enum(["GET","POST","PUT","PATCH","DELETE"]),jq=[{method:"PATCH",path:"/internal/sites/:site_id/snapshots/:snapshot_id/manifest",tag:"snapshots",summary:"Compare-and-set the manifest hash for the active current snapshot after an in-place object replacement.",status:"implemented",request_body_schema:"UpdateCurrentSnapshotManifestRequestSchema",response_schema:"SnapshotRecordSchema",notes:["Internal Agent authentication is required. The update succeeds only when site current_snapshot_id, snapshot status, object key, and expected manifest hash still match."]},{method:"GET",path:"/health",tag:"system",summary:"API health check.",status:"implemented",response_schema:"ApiHealth"},{method:"POST",path:"/sites",tag:"sites",summary:"Create a site and Step 1 brief in the current dev context.",status:"implemented",request_body_schema:"CreateSiteBriefRequestSchema",response_schema:"CreateSiteBriefResponseSchema"},{method:"POST",path:"/sites/drafts",tag:"sites",summary:"Create a draft site without a brief in the current tenant so /s/:site_id can collect Step 1 later.",status:"implemented",request_body_schema:"CreateSiteDraftRequestSchema",response_schema:"SiteRecordSchema"},{method:"GET",path:"/sites",tag:"sites",summary:"List current tenant sites.",status:"implemented",response_schema:"SiteRecordSchema[]"},{method:"GET",path:"/sites/by-cms/:cms_site_id",tag:"sites",summary:"Resolve an external CMS site id to one tenant-scoped VCP site.",status:"implemented",response_schema:"SiteRecordSchema",notes:["Used by the browser /d/:cms_site_id handoff route; lookup is scoped by current request tenant and returns 404 when the CMS site has not been synchronized."]},{method:"GET",path:"/sites/:site_id",tag:"sites",summary:"Get one tenant-scoped site.",status:"implemented",response_schema:"SiteRecordSchema"},{method:"POST",path:"/sites/:site_id/workflow",tag:"site-workflows",summary:"Create one version-bound site workflow from a published flow definition.",status:"implemented",request_body_schema:"CreateSiteWorkflowRequestSchema",response_schema:"SiteWorkflowSnapshotResponseSchema"},{method:"GET",path:"/sites/:site_id/workflow",tag:"site-workflows",summary:"Read the current site workflow snapshot and derived menu state.",status:"implemented",response_schema:"SiteWorkflowSnapshotResponseSchema"},{method:"GET",path:"/internal/sites/:site_id/workflow/progress",tag:"site-workflows",summary:"Read the minimal internal site workflow progress projection.",status:"implemented",response_schema:"SiteWorkflowProgressResponseSchema"},{method:"PUT",path:"/sites/:site_id/workflow/website",tag:"site-workflows",summary:"Update the source website while website_scan is current.",status:"implemented",request_body_schema:"UpdateSiteWorkflowWebsiteRequestSchema",response_schema:"SiteWorkflowSnapshotResponseSchema"},{method:"POST",path:"/sites/:site_id/workflow/advance",tag:"site-workflows",summary:"Advance one non-terminal workflow node with an expected-current-node guard.",status:"implemented",request_body_schema:"AdvanceSiteWorkflowRequestSchema",response_schema:"SiteWorkflowSnapshotResponseSchema"},{method:"POST",path:"/sites/:site_id/workflow/complete",tag:"site-workflows",summary:"Complete the workflow from its final publishing node after server-side release checks pass.",status:"implemented",request_body_schema:"CompleteSiteWorkflowRequestSchema",response_schema:"SiteWorkflowSnapshotResponseSchema",notes:["The browser supplies only the expected current node; the server verifies persisted release facts before completing the workflow."]},{method:"POST",path:"/sites/:site_id/workflow/complete-quality-only",tag:"site-workflows",summary:"Complete the designer workflow after the linked quality-only publish workflow succeeds.",status:"implemented",request_body_schema:"CompleteQualityOnlyWorkflowRequestSchema",response_schema:"SiteWorkflowSnapshotResponseSchema",notes:["The server resolves the designer role and atomically completes both workflows without creating a publish deployment or updating the site deployment projection."]},{method:"POST",path:"/sites/:site_id/workflow/tasks/register",tag:"site-workflows",summary:"Register a business-owned external task id and its idempotency key.",status:"implemented",request_body_schema:"RegisterWorkflowTaskCommandRequestSchema",response_schema:"SiteWorkflowTaskRefResponseSchema"},{method:"POST",path:"/sites/:site_id/workflow/step2-site-initialization/tasks",tag:"site-workflows/step2-site-initialization",summary:"Create or reuse the current workflow's Step2 website crawl task.",status:"implemented",response_schema:"Step2SiteInitializationTaskResponseSchema",notes:["The server derives tenantId, sessionId, and siteUrl from trusted request/workflow state; the browser cannot submit upstream scope fields."]},{method:"GET",path:"/sites/:site_id/workflow/step2-site-initialization/tasks/:task_id",tag:"site-workflows/step2-site-initialization",summary:"Poll the workflow-owned Step2 website crawl task.",status:"implemented",response_schema:"Step2SiteInitializationTaskResponseSchema",notes:["The task id must match the current non-superseded website_crawl task reference for the workflow."]},{method:"POST",path:"/sites/:site_id/workflow/tasks/:task_type/replace",tag:"site-workflows",summary:"Replace one task reference while retaining its superseded history.",status:"implemented",request_body_schema:"ReplaceWorkflowTaskCommandRequestSchema",response_schema:"SiteWorkflowTaskRefResponseSchema"},{method:"POST",path:"/sites/:site_id/workflow/tasks/website_crawl/replace-and-invalidate-dependents",tag:"site-workflows",summary:"Replace website crawl and invalidate basic-info and metrics dependents atomically.",status:"implemented",request_body_schema:"ReplaceCrawlWorkflowTaskCommandRequestSchema",response_schema:"SiteWorkflowTaskRefResponseSchema"},{method:"POST",path:"/sites/:site_id/workflow/build",tag:"site-workflows",summary:"Start the server-owned site build and workspace snapshot lifecycle.",status:"implemented",request_body_schema:"StartSiteBuildRequestSchema",response_schema:"StartSiteBuildResponseSchema",notes:["The browser may start or query the build, but cannot write site build or deployment summary status directly."]},{method:"GET",path:"/sites/:site_id/workflow/customer-materials",tag:"site-workflows",summary:"Read the persisted no-website customer materials draft.",status:"implemented",response_schema:"CustomerMaterialsNullableResponseSchema"},{method:"PUT",path:"/sites/:site_id/workflow/customer-materials",tag:"site-workflows",summary:"Save the no-website customer materials before submission.",status:"implemented",request_body_schema:"CustomerMaterialsDraftSchema",response_schema:"CustomerMaterialsResponseSchema",notes:["A submitted record is immutable and rejects later writes."]},{method:"POST",path:"/sites/:site_id/workflow/customer-materials/submit",tag:"site-workflows",summary:"Submit and freeze customer materials before analysis.",status:"implemented",request_body_schema:"CustomerMaterialsDraftSchema",response_schema:"CustomerMaterialsResponseSchema",notes:["Repeated submissions return 409; clients may retry only the separate workflow advance."]},{method:"GET",path:"/sites/:site_id/designer/component-library/categories",tag:"designer-component-library",summary:"List the fixed insert-new-component category tree for a site.",status:"implemented",response_schema:"ListDesignerComponentCategoriesResponseSchema",notes:["The server validates site ownership and fixes category_group_key to insertNewComponent."]},{method:"GET",path:"/sites/:site_id/designer/component-library/resources",tag:"designer-component-library",summary:"List component resources from the fixed designer catalog group.",status:"implemented",query_schema:"ListDesignerComponentsQuerySchema",response_schema:"ListDesignerComponentsResponseSchema",notes:["The server fixes resource type to component and does not expose resource-platform secrets, internal hosts, or product-line selection."]},{method:"POST",path:"/sites/:site_id/designer/component-library/resources/:resource_id/install",tag:"designer-component-library",summary:"Install one exact component version and return a strict SiteEditEngine materialization.",status:"implemented",request_body_schema:"InstallDesignerComponentBodySchema",response_schema:"InstallDesignerComponentResponseSchema",notes:["The server downloads the resource ZIP with the configured secret, validates main.json identity and compatibility, and returns only the strict materialization plus immutable revision metadata."]},{method:"GET",path:"/sites/:site_id/designer/page-library/categories",tag:"designer-page-library",summary:"List the fixed insert-new-page category tree for a site.",status:"implemented",response_schema:"ListDesignerPageCategoriesResponseSchema",notes:["The server validates site ownership and fixes category_group_key to insertNewPage."]},{method:"GET",path:"/sites/:site_id/designer/page-library/resources",tag:"designer-page-library",summary:"List page and pages resources from the fixed designer catalog.",status:"implemented",query_schema:"ListDesignerPagesQuerySchema",response_schema:"ListDesignerPagesResponseSchema",notes:["The server fixes resource types to page and pages and does not expose resource-platform credentials or internal routing."]},{method:"POST",path:"/sites/:site_id/designer/page-library/resources/:resource_id/prepare",tag:"designer-page-library",summary:"Resolve one exact page resource version for designer-side draft configuration.",status:"implemented",request_body_schema:"PrepareDesignerPageBodySchema",response_schema:"PrepareDesignerPageResponseSchema"},{method:"POST",path:"/sites/:site_id/designer/page-library/resources/:resource_id/install",tag:"designer-page-library",summary:"Install one exact page resource version and return a strict PageResourceArtifact.",status:"implemented",request_body_schema:"InstallDesignerPageBodySchema",response_schema:"InstallDesignerPageResponseSchema",notes:["The server validates the explicit resource type, immutable package identity, page selections, materializations, and package-local references."]},{method:"GET",path:"/sites/:site_id/designer/pages",tag:"designer-page-library",summary:"List designer pages from the stable first-phase fixture source.",status:"implemented",response_schema:"ListDesignerSitePagesResponseSchema"},{method:"POST",path:"/sites/:site_id/designer/page-resources/enhance",tag:"designer-page-library",summary:"Echo a designer page-resource candidate without model execution or normalization.",status:"implemented",request_body_schema:"EnhanceDesignerPageResourceBodySchema",response_schema:"EnhanceDesignerPageResourceResponseSchema"},{method:"POST",path:"/sites/:site_id/designer/page-resources/compose",tag:"designer-page-library",summary:"Compose exact page and component resources into one strict page artifact.",status:"implemented",request_body_schema:"ComposeDesignerPageResourceBodySchema",response_schema:"InstallDesignerPageResponseSchema",notes:["The server installs every immutable source, validates ordered page blocks, scopes component materializations, and returns one artifact without exposing resource-platform credentials."]},{method:"POST",path:"/sites/:site_id/designer/page-resources/blank",tag:"designer-page-library",summary:"Create the deterministic built-in blank page artifact for one configured route.",status:"implemented",request_body_schema:"InstallDesignerPageBodySchema",response_schema:"InstallDesignerPageResponseSchema"},{method:"PATCH",path:"/sites/:site_id",tag:"sites",summary:"Update site display name and optional generated-site locale for the current tenant.",status:"implemented",request_body_schema:"UpdateSiteRequestSchema",response_schema:"SiteRecordSchema"},{method:"DELETE",path:"/sites/:site_id",tag:"sites",summary:"Archive a site so it no longer appears in the tenant site list.",status:"implemented",response_schema:"SiteRecordSchema"},{method:"GET",path:"/sites/:site_id/workspace/source-files",tag:"sites",summary:"List source files available in the ready preview sandbox.",status:"implemented",response_schema:"WorkspaceSourceFileListItemSchema[]"},{method:"GET",path:"/sites/:site_id/workspace/source-file",tag:"sites",summary:"Read a source file from the ready preview sandbox.",status:"implemented",query_schema:"WorkspaceSourceFilePathQuerySchema",response_schema:"WorkspaceSourceFileResponseSchema"},{method:"GET",path:"/sites/:site_id/media-assets",tag:"media-assets",summary:"List or search enterprise image assets through the CMS adapter.",status:"implemented",query_schema:"ListMediaLibraryAssetsQuerySchema",response_schema:"ListMediaLibraryAssetsResponseSchema"},{method:"POST",path:"/sites/:site_id/media-assets",tag:"media-assets",summary:"Upload one validated image and create its enterprise asset.",status:"implemented",response_schema:"UploadMediaLibraryAssetResponseSchema",notes:["Accepts one multipart field named file; only the image MIME allowlist is accepted and the maximum size is 20 MiB."]},{method:"GET",path:"/sites/:site_id/media-assets/unsplash/search",tag:"media-assets",summary:"Search Unsplash through the VCP server-side client.",status:"implemented",query_schema:"SearchUnsplashMediaQuerySchema",response_schema:"SearchUnsplashMediaResponseSchema",notes:["The browser never receives the Unsplash access key; CMS is not involved in search."]},{method:"POST",path:"/sites/:site_id/media-assets/unsplash/:provider_id/use",tag:"media-assets",summary:"Best-effort report that an Unsplash image was selected.",status:"implemented",request_body_schema:"UseUnsplashMediaRequestSchema",response_schema:"UseUnsplashMediaResponseSchema",notes:["CMS report failure returns reported=false and does not roll back the image replacement."]},{method:"POST",path:"/sites/:site_id/sitemap",tag:"sitemaps",summary:"Confirm the currently reviewed Sitemap Draft and advance the site to structure_saved.",status:"implemented",request_body_schema:"ConfirmSiteStructureRequestSchema",response_schema:"PersistSiteSitemapDraftResponseSchema"},{method:"POST",path:"/internal/sites/:site_id/sitemap-draft",tag:"sitemaps",summary:"Persist an agent-generated sitemap draft without confirming the structure.",status:"implemented",request_body_schema:"PersistGeneratedSitemapDraftRequestSchema",response_schema:"PersistGeneratedSitemapDraftResponseSchema"},{method:"PUT",path:"/sites/:site_id/sitemap/draft",tag:"sitemaps",summary:"Save an immutable user draft without confirming or advancing the workflow.",status:"implemented",request_body_schema:"SaveSiteSitemapDraftRequestSchema",response_schema:"SaveSiteSitemapDraftResponseSchema"},{method:"GET",path:"/sites/:site_id/sitemap",tag:"sitemaps",summary:"Read the current Sitemap Draft for a site.",status:"implemented",response_schema:"SitemapDraftRecordSchema"},{method:"POST",path:"/sites/:site_id/clarify/answers",tag:"clarify",summary:"Persist the Step 2 clarify answers (and the answered questions) into the site's clarify session.",status:"implemented",request_body_schema:"PersistClarifyAnswersRequestSchema",response_schema:"PersistClarifyAnswersResponseSchema"},{method:"PATCH",path:"/sites/:site_id/clarify/archetype",tag:"clarify",summary:"Switch the Step 2 industry archetype (user_picked) into the site's clarify session via an idempotent upsert.",status:"implemented",request_body_schema:"UpdateClarifyArchetypeRequestSchema",response_schema:"PersistClarifyAnswersResponseSchema",notes:["Independent of generate: materializes a clarify_sessions row when none exists (using the supplied questions) or updates only selected_archetype; never writes answers/completed_at. Forces source=user_picked."]},{method:"POST",path:"/internal/sites/:site_id/design-plan",tag:"design-plans",summary:"Persist a generated design plan version for a site (internal agent-only write).",status:"implemented",request_body_schema:"PersistSiteDesignPlanRequestSchema",response_schema:"PersistSiteDesignPlanResponseSchema",notes:["Guarded by the internal agent token; only the Workspace/Sitemap agent writes design plans."]},{method:"GET",path:"/internal/sites/:site_id/design-plan",tag:"design-plans",summary:"Read the current (latest version) design plan for a site (internal agent-only read).",status:"implemented",response_schema:"DesignPlanRecordSchema",notes:["Guarded by the internal agent token; only the Workspace/Sitemap agent reads design plans."]},{method:"GET",path:"/sites/:site_id/design-plan",tag:"design-plans",summary:"Read the current (latest version) design plan for a site so Workspace UI can inspect the generated design contract.",status:"implemented",response_schema:"DesignPlanRecordSchema"},{method:"GET",path:"/sites/:site_id/brief",tag:"briefs",summary:"Read the persisted Step 1 brief for a site so the Workspace Agent can seed first full-site generation without a new write surface.",status:"implemented",response_schema:"BriefRecordSchema"},{method:"PUT",path:"/sites/:site_id/brief/draft",tag:"briefs",summary:"Save a draft site's Step 1 brief without advancing the workflow.",status:"implemented",request_body_schema:"SaveBriefDraftRequestSchema",response_schema:"SaveBriefDraftResponseSchema",notes:["Only sites in the editable build phase are writable; the brief row is upserted idempotently while site status, locale, and workflow stage remain unchanged."]},{method:"PATCH",path:"/sites/:site_id/brief",tag:"briefs",summary:"Create or update a draft site's Step 1 brief and advance it to Clarify without allowing later workflow states to roll back.",status:"implemented",request_body_schema:"UpdateBriefRequestSchema",response_schema:"UpdateBriefResponseSchema",notes:["Only sites in the editable build phase are writable; missing brief rows are created on first save; identical retries are idempotent."]},{method:"POST",path:"/internal/sites/:cms_site_id/external-sync",tag:"sites",summary:"Synchronize trusted CMS identity by tenant_id + cms_site_id; legacy site_url is optional and ignored. The response URL is the configured public API base or null.",status:"implemented",request_body_schema:"ExternalSyncSiteRequestSchema",response_schema:"ExternalSyncSiteResponseSchema",notes:["This trusted external entry does not require browser login or internal bearer auth; tenant_id is written directly to tenants.id and the response uses the internal { code, data, message } success envelope."]},{method:"POST",path:"/internal/sites/:site_id/page-templates",tag:"page-templates",summary:"Accept 1\u20133 Page Template items as one asynchronous Workspace task (HTTP 202).",status:"implemented",request_body_schema:"PageTemplateCreateRequestSchema",response_schema:"PageTemplateCreateResponseSchema",notes:["Internal bearer plus tenant context; API starts one new background thread/run with its fixed system identity. Poll GET /internal/external-site-edits/:task_id; no external IDs or callbacks. Manifest-gated whole-batch success commits exactly one snapshot."]},{method:"POST",path:"/internal/sites/:site_id/page-templates/promote",tag:"page-templates",summary:"Promote a private page template through the authenticated VCP internal service surface.",status:"implemented",request_body_schema:"PageTemplatePromoteRequestSchema",response_schema:"PageTemplatePromoteResponseSchema",notes:["Internal service endpoint; uses the same bearer + tenant/user context as create and delegates to Agent with API-owned credentials."]},{method:"POST",path:"/internal/sites/:site_id/page-templates/cleanup",tag:"page-templates",summary:"Clean up private page templates through the authenticated VCP internal service surface.",status:"implemented",request_body_schema:"PageTemplateCleanupRequestSchema",response_schema:"PageTemplateCleanupResponseSchema",notes:["Internal service endpoint; cleanup remains explicit and default-template protection is enforced by the Agent lifecycle service."]},{method:"POST",path:"/sites/:site_id/snapshots",tag:"snapshots",summary:"Persist snapshot metadata without changing the current site snapshot.",status:"implemented",request_body_schema:"PersistSiteSnapshotRequestSchema",response_schema:"PersistSiteSnapshotResponseSchema"},{method:"POST",path:"/sites/:site_id/snapshots/:snapshot_id/promote",tag:"snapshots",summary:"Promote a site snapshot as the current workspace version.",status:"implemented",request_body_schema:"PromoteSiteSnapshotRequestSchema",response_schema:"PromoteSiteSnapshotResponseSchema"},{method:"POST",path:"/internal/sites/:site_id/template-upgrade/lock/try-acquire",tag:"snapshots",summary:"Try to acquire the short-lived template-upgrade site lock.",status:"implemented",request_body_schema:"TryAcquireTemplateUpgradeLockRequestSchema",response_schema:"TryAcquireTemplateUpgradeLockResponseSchema",notes:["Internal agent-only endpoint; lock contention returns acquired=false instead of a user-facing conflict."]},{method:"POST",path:"/internal/sites/:site_id/template-upgrade/lock/release",tag:"snapshots",summary:"Release the calling template-upgrade attempt's site lock.",status:"implemented",request_body_schema:"ReleaseTemplateUpgradeLockRequestSchema",response_schema:"ReleaseTemplateUpgradeLockResponseSchema",notes:["Internal agent-only endpoint; release is scoped by tenant, site, operation type, and owner."]},{method:"POST",path:"/internal/sites/:site_id/template-upgrade/snapshots/:snapshot_id/promote",tag:"snapshots",summary:"CAS-promote a validated template-upgrade candidate and bind its accepted commit atomically.",status:"implemented",request_body_schema:"PromoteTemplateUpgradeSnapshotRequestSchema",response_schema:"PromoteTemplateUpgradeSnapshotResponseSchema",notes:["Internal agent-only endpoint; accepted_commit is never part of the public promote request or response."]},{method:"GET",path:"/internal/sites/:site_id/template-upgrade/state",tag:"snapshots",summary:"Inspect the projected tenant-scoped template-upgrade state without mutation.",status:"implemented",query_schema:"InspectTemplateUpgradeStateRequestSchema",response_schema:"InspectTemplateUpgradeStateResponseSchema",notes:["Internal agent-only endpoint; tenant identity is derived from trusted request context and the repository path is read-only."]},{method:"POST",path:"/internal/sites/:site_id/template-upgrade/state/prepare",tag:"snapshots",summary:"Prepare the tenant-scoped template-upgrade retry state for a target version.",status:"implemented",request_body_schema:"PrepareTemplateUpgradeStateRequestSchema",response_schema:"PrepareTemplateUpgradeStateResponseSchema",notes:["Internal agent-only endpoint; tenant identity is derived from trusted request context and is never accepted in the request body."]},{method:"POST",path:"/internal/sites/:site_id/template-upgrade/state/failure",tag:"snapshots",summary:"Record a finite validation failure for the prepared template-upgrade target.",status:"implemented",request_body_schema:"RecordTemplateUpgradeFailureRequestSchema",response_schema:"RecordTemplateUpgradeFailureResponseSchema",notes:["Internal agent-only endpoint; accepts a finite error code and never raw validation output."]},{method:"POST",path:"/internal/sites/:site_id/template-upgrade/state/success",tag:"snapshots",summary:"Reset retry state after the prepared template-upgrade target succeeds.",status:"implemented",request_body_schema:"RecordTemplateUpgradeSuccessRequestSchema",response_schema:"RecordTemplateUpgradeSuccessResponseSchema",notes:["Internal agent-only endpoint; tenant identity is derived from trusted request context and is never accepted in the request body."]},{method:"POST",path:"/internal/sites/:site_id/template-upgrade/events",tag:"snapshots",summary:"Record one bounded template-upgrade observability event.",status:"implemented",request_body_schema:"RecordTemplateUpgradeEventRequestSchema",response_schema:"RecordTemplateUpgradeEventResponseSchema",notes:["Internal agent-only endpoint; tenant identity is derived from trusted request context and the strict request excludes raw errors, source content, and file paths."]},{method:"GET",path:"/internal/template-upgrades/report",tag:"snapshots",summary:"Read tenant-scoped template-upgrade outcome, state, and duration aggregates.",status:"implemented",query_schema:"GetTemplateUpgradeReportQuerySchema",response_schema:"GetTemplateUpgradeReportResponseSchema",notes:["Internal endpoint; tenant identity is derived from trusted request context and all aggregates are tenant-scoped."]},{method:"GET",path:"/internal/template-upgrades/snapshot-deletions/pending",tag:"snapshots",summary:"List tenant-scoped stale template-upgrade snapshot deletions for dry-run or reconciliation.",status:"implemented",query_schema:"ListTemplateUpgradeSnapshotDeletionCandidatesQuerySchema",response_schema:"ListTemplateUpgradeSnapshotDeletionCandidatesResponseSchema",notes:["Defaults to retrying deleting tombstones. Including candidate snapshots is an explicit maintenance action and should use a conservative age threshold."]},{method:"POST",path:"/sites/:site_id/snapshots/:snapshot_id/abandon",tag:"snapshots",summary:"Mark an unpromoted candidate snapshot as failed.",status:"implemented",response_schema:"AbandonSiteSnapshotResponseSchema"},{method:"GET",path:"/sites/:site_id/snapshots/:snapshot_id",tag:"snapshots",summary:"Read one tenant-scoped snapshot metadata record for a site.",status:"implemented",response_schema:"SnapshotRecordSchema"},{method:"DELETE",path:"/sites/:site_id/snapshots/:snapshot_id",tag:"snapshots",summary:"Prepare two-phase deletion of a candidate snapshot and return its object key; refuses non-candidate/current/referenced snapshots.",status:"implemented",response_schema:"DeleteSiteSnapshotResponseSchema",notes:["Internal Agent authentication is required. This endpoint only creates a deleting tombstone; object removal and completion are separate steps."]},{method:"POST",path:"/sites/:site_id/snapshots/:snapshot_id/deletion/complete",tag:"snapshots",summary:"Complete deletion after the snapshot object has been removed; only accepts deleting snapshots.",status:"implemented",response_schema:"CompleteSiteSnapshotDeletionResponseSchema",notes:["Internal Agent authentication is required; callers must remove the object before completing the DB deletion."]},{method:"POST",path:"/agent-runs",tag:"agent-runs",summary:"Create an agent run for event persistence and replay.",status:"implemented",request_body_schema:"CreateAgentRunRequestSchema",response_schema:"CreateAgentRunResponseSchema"},{method:"POST",path:"/agent-runs/:run_id/events",tag:"agent-runs",summary:"Append one normalized AgentEvent to a run.",status:"implemented",request_body_schema:"AppendAgentEventRequestSchema",response_schema:"AppendAgentEventResponseSchema",notes:["Internal-only write surface: only internal-service callers may append, except browser (oidc) contexts may append run.failed (the WS connect-stage unlock path, equivalent to POST /agent-runs/workspace/cancel). All other oidc appends \u2014 run.finished, run.started, tool/system/progress, file/snapshot \u2014 are rejected with 403 FORBIDDEN. The browser sends user messages over the Workspace WebSocket (recorded server-side as user.message) and otherwise only reads the GET replay."]},{method:"GET",path:"/agent-runs/:run_id/events",tag:"agent-runs",summary:"Replay AgentEvents after a run-local sequence cursor.",status:"implemented",response_schema:"ListAgentEventsResponseSchema"},{method:"POST",path:"/agent-runs/workspace/stop",tag:"agent-runs",summary:"Request a soft stop of the active first-generation or fill-in run for a site.",status:"implemented",request_body_schema:"StopWorkspaceGenerationRequestSchema",response_schema:"StopWorkspaceGenerationResponseSchema",notes:["Browser surface with the same tenant scoping as POST /agent-runs/workspace/cancel: only the active initial_generation / fill_in run of a site in the caller's tenant is touched.","A run holding a live lease gets stop_requested_at instead of a terminal event, so it keeps the pages it already saved and closes itself: status=requested, or already_requested on a repeat (the first stop timestamp is never moved).","A run whose lease has lapsed has no process left to honour the flag, so it is closed immediately (run.failed, site lock released) and the answer is status=stopped. Nothing in flight returns no_active_run with run_id null."]},{method:"POST",path:"/internal/agent-runs/fail-stale-in-flight",tag:"agent-runs",summary:"Fail stale in-flight workspace runs (internal maintenance, cross-tenant sweep).",status:"implemented",response_schema:"FailStaleInFlightWorkspaceRunsResponseSchema",notes:["Internal maintenance endpoint guarded by InternalAgentAuthGuard (Bearer VCP_AGENT_INTERNAL_TOKEN, production fail-closed); the /internal/** prefix is exempt from browser auth middleware so the guard is the sole trust boundary. Not exposed to the browser via agent-proxy; called by an external admin cron / controlled ops script."]},{method:"POST",path:"/internal/agent-runs/claim-stale-workspace-runs",tag:"agent-runs",summary:"Claim stale workspace runs for resumption (internal maintenance, cross-tenant sweep).",status:"implemented",response_schema:"ClaimStaleWorkspaceRunsResponseSchema",notes:["Internal maintenance endpoint guarded by InternalAgentAuthGuard; same trust boundary as fail-stale-in-flight and not exposed to the browser.","Re-issues a fresh lease_owner (fencing token) and increments resume_count in one UPDATE for each resumable initial run; a lease expiring only means the work was interrupted, not that the run failed. Initial runs that used up WORKSPACE_MAX_RESUME_COUNT and interrupted fill-in runs are failed instead and are absent from the response."]},{method:"GET",path:"/internal/agent-runs/:run_id/context",tag:"agent-runs",summary:"Resolve run thread context (internal, Agent Runtime).",status:"implemented",response_schema:"AgentRunContextResponseSchema",notes:["Internal endpoint guarded by InternalAgentAuthGuard; tenant comes from x-vcp-tenant-id.","Returns the run together with its thread (null = the site main thread); a run outside the tenant is 404."]},{method:"POST",path:"/internal/agent-runs/:run_id/heartbeat",tag:"agent-runs",summary:"Renew a workspace run lease (internal, Agent Runtime).",status:"implemented",request_body_schema:"WorkspaceRunHeartbeatRequestSchema",response_schema:"WorkspaceRunHeartbeatResponseSchema",notes:["Internal endpoint guarded by InternalAgentAuthGuard; tenant comes from x-vcp-tenant-id.","One CAS UPDATE checks that the run is still in flight and that lease_owner has not been re-issued: superseded means another attempt took over and this process must stop dispatching; not_active means the run already reached a terminal state."]},{method:"POST",path:"/internal/agent-runs/:run_id/page-checkpoints",tag:"agent-runs",summary:"Register a workspace page checkpoint (internal, Agent Runtime).",status:"implemented",request_body_schema:"RegisterWorkspacePageCheckpointRequestSchema",response_schema:"WorkspacePageCheckpointSchema",notes:["Internal endpoint guarded by InternalAgentAuthGuard; tenant comes from x-vcp-tenant-id.","Idempotent on (tenant_id, run_id, page_id, attempt): a conflict returns the existing row unchanged. The object must already be written to storage \u2014 a failed registration means the page was not saved. A lease_owner that no longer matches the run is 409, and a run in a terminal state is 409."]},{method:"GET",path:"/internal/agent-runs/:run_id/page-checkpoints",tag:"agent-runs",summary:"List workspace page checkpoints (internal, Agent Runtime).",status:"implemented",response_schema:"ListWorkspacePageCheckpointsResponseSchema",notes:["Internal endpoint guarded by InternalAgentAuthGuard; returns one row per page_id (the highest attempt). A run outside the tenant returns no checkpoints."]},{method:"GET",path:"/internal/agent-runs/:run_id/run-control",tag:"agent-runs",summary:"Read workspace run control input (internal, Agent Runtime).",status:"implemented",response_schema:"WorkspaceRunControlInputResponseSchema",notes:["Internal endpoint guarded by InternalAgentAuthGuard; AgentRunRecord carries no input, so the lease owner, stop flag, resume count and fill-in inputs stored on the run row are read here. A run outside the tenant, or one that is not a workspace run, is 404."]},{method:"GET",path:"/deployments",tag:"deployments",summary:"Deployment resource summary endpoint until publish APIs land.",status:"skeleton"},{method:"GET",path:"/sites/:site_id/generation-ledger",tag:"sites",summary:"Read the stored generation ledger of a site (omitted deliverables and fill-in progress).",status:"implemented",response_schema:"SiteGenerationLedgerResponseSchema",notes:["One ledger per (tenant_id, site_id), written when an initial_generation / fill_in run.finished carries generation_ledger. A site that has never finished such a run returns ledger null with source_run_id and updated_at null."]},{method:"POST",path:"/sites/:site_id/generation/fill-in",tag:"sites",summary:"Start a fill-in run for deliverables the generation ledger still lists as omitted.",status:"implemented",request_body_schema:"StartFillInRequestSchema",response_schema:"StartFillInResponseSchema",notes:["Every target must still be listed as an unfilled omission in the site ledger; otherwise 400 FILL_IN_TARGET_NOT_OMITTED with details.target_id. A site with no ledger at all is rejected with the same code.","The site must be workspace_ready; otherwise 409 FILL_IN_NOT_AVAILABLE.","A fill-in run does not take the per-site workspace_run operation lock: while it runs the user keeps browsing. client_run_key makes the POST idempotent \u2014 repeating it returns the existing in-flight run and does not dispatch it again; another in-flight workspace run on the same site is rejected with 409 WORKSPACE_RUN_IN_FLIGHT."]},{method:"POST",path:"/sites/:site_id/workspace/runs",tag:"workspace",summary:"Start an asynchronous Workspace Agent run from the current snapshot.",status:"implemented",request_body_schema:"StartWorkspaceRunRequestSchema",response_schema:"StartWorkspaceRunResponseSchema",notes:["Long-running work must be event-driven and must not block API transactions."]},{method:"POST",path:"/sites/:site_id/workspace/attachments",tag:"workspace",summary:"Upload a chat image attachment for the Workspace conversation.",status:"implemented",response_schema:"WorkspaceAttachmentSchema",notes:["multipart/form-data with a single `file`; the response `image_url` is referenced by a `file` part of the next client message."]},{method:"POST",path:"/sites/:site_id/workspace/attachments/from-url",tag:"workspace",summary:"Capture a screenshot of a web page and store it as a chat image attachment.",status:"implemented",request_body_schema:"WorkspaceAttachmentFromUrlRequestSchema",response_schema:"WorkspaceAttachmentSchema",notes:["The screenshot becomes an ordinary attachment: same quotas, same `file` part reference, never placed on the site.","Capture runs through the ingestion service (SSRF guard, concurrency gate, Firecrawl credits)."]},{method:"GET",path:"/sites/:site_id/workspace/attachments/:attachment_id/image",tag:"workspace",summary:"Read the bytes of a chat image attachment (owner thumbnails and replay).",status:"implemented"},{method:"DELETE",path:"/sites/:site_id/workspace/attachments/:attachment_id",tag:"workspace",summary:"Delete an unsent chat image attachment.",status:"implemented",notes:["Attachments already sent with a message return 409 WORKSPACE_ATTACHMENT_BOUND."]},{method:"GET",path:"/internal/workspace-attachments/:site_id/:attachment_id",tag:"workspace",summary:"Internal side-channel for the Workspace Agent to read a chat image attachment.",status:"implemented"},{method:"GET",path:"/sites/:site_id/threads",tag:"workspace",summary:"List a site's named Agent threads (workspace conversations).",status:"implemented",response_schema:"SiteThreadListResponseSchema",notes:["The browser can only list threads that belong to the current site."]},{method:"POST",path:"/sites/:site_id/threads",tag:"workspace",summary:"Create a new named Agent thread for a site.",status:"implemented",request_body_schema:"CreateSiteThreadRequestSchema",response_schema:"SiteThreadResponseSchema",notes:["The created thread is scoped to the current site; the browser cannot create a thread for another site."]},{method:"PATCH",path:"/sites/:site_id/threads/:thread_id",tag:"workspace",summary:"Rename or archive an Agent thread.",status:"implemented",request_body_schema:"UpdateSiteThreadRequestSchema",response_schema:"SiteThreadResponseSchema",notes:["The server verifies the thread belongs to the current site and tenant before applying the update."]},{method:"GET",path:"/sites/:site_id/workspace/runs/active",tag:"workspace",summary:"Look up the site's current in-flight Workspace Agent run across all threads.",status:"implemented",response_schema:"ActiveWorkspaceRunResponseSchema",notes:["Scoped to the current site regardless of thread; the browser cannot query another site's active run."]},{method:"POST",path:"/v1/agent/workspace/:site_id/form-design-operations",tag:"agent/workspace",summary:"Create or replay a deterministic FORM_SPEC save operation.",status:"implemented",request_body_schema:"FormDesignSaveRequestSchema",response_schema:"FormDesignOperationResponseSchema"},{method:"GET",path:"/v1/agent/workspace/:site_id/form-design-operations/:operation_id",tag:"agent/workspace",summary:"Read a persisted FORM_SPEC save operation.",status:"implemented",response_schema:"FormDesignOperationResponseSchema"},{method:"POST",path:"/v1/agent/workspace/:site_id/form-design-operations/:operation_id/resume",tag:"agent/workspace",summary:"Resume a recoverable FORM_SPEC save with its original fingerprint.",status:"implemented",request_body_schema:"FormDesignResumeRequestSchema",response_schema:"FormDesignOperationResponseSchema"},{method:"GET",path:"/sites/:site_id/workspace/runs/latest",tag:"workspace",summary:"Look up the latest workspace Agent run for a site so Step 4 re-entry can replay persisted events without re-triggering the model.",status:"implemented",response_schema:"LatestWorkspaceRunResponseSchema"},{method:"POST",path:"/internal/sites/:site_id/preview-sessions",tag:"sandbox-sessions",summary:"Persist or update an Agent-owned on-demand preview session; optional current/ready-session guards support current-snapshot CAS and guarded in-place snapshot advance.",status:"implemented",request_body_schema:"PersistPreviewSessionRequestSchema",response_schema:"PersistPreviewSessionResponseSchema"},{method:"GET",path:"/sites/:site_id/preview-sessions/current",tag:"sandbox-sessions",summary:"Read the latest tenant-scoped preview session for a site.",status:"implemented",response_schema:"SandboxSessionSchema"},{method:"POST",path:"/sites/:site_id/preview/activate",tag:"site-preview",summary:"Activate the existing preview sandbox for a site.",status:"implemented",response_schema:"SitePreviewActivateResponseSchema"},{method:"POST",path:"/v1/agent/site-preview/:site_id/activate",tag:"agent/site-preview",summary:"Activate the existing preview sandbox for a site through Agent.",status:"implemented",response_schema:"SitePreviewActivateResponseSchema"},{method:"POST",path:"/sites/:site_id/deployments",tag:"deployments",summary:"Queue an explicit user-confirmed publish from the latest current snapshot.",status:"implemented",request_body_schema:"CreateDeploymentRequestSchema",response_schema:"CreateDeploymentResponseSchema",notes:["The server resolves the latest current snapshot and validates site and snapshot existence, in-flight deployment state, and site operation lock before creating the deployment record and queue job.","The API returns after creating the deployment record and queue job; worker-service claims deployment_jobs for build and Cloudflare publish."]},{method:"POST",path:"/sites/:site_id/deployments/quality-check",tag:"deployments",summary:"Queue a quality-check deployment from a snapshot.",status:"implemented",request_body_schema:"CreateQualityCheckDeploymentRequestSchema",response_schema:"CreateDeploymentResponseSchema"},{method:"GET",path:"/sites/:site_id/deployments/quality-check/status",tag:"deployments",summary:"Read the latest quality-check deployment status.",status:"implemented",response_schema:"GetDeploymentsStatusResponseSchema"},{method:"POST",path:"/internal/site-deployments/quality-check",tag:"deployments",summary:"Queue a quality-check deployment for the current site through the internal Agent API.",status:"implemented",response_schema:"InternalCreateDeploymentResponseSchema",notes:["InternalAgentAuthGuard is required; request context is supplied by x-vcp-tenant-id, x-vcp-user-id, and x-vcp-site-id.","POST accepts no request body; VCP resolves the current snapshot. Quality-check and publish deployments are independent."]},{method:"GET",path:"/internal/site-deployments/quality-check/status",tag:"deployments",summary:"Read the latest internal quality-check deployment status for the current site.",status:"implemented",response_schema:"InternalGetDeploymentsStatusResponseSchema",notes:["InternalAgentAuthGuard is required; request context is supplied by x-vcp-tenant-id, x-vcp-user-id, and x-vcp-site-id."]},{method:"POST",path:"/internal/site-deployments/publish",tag:"deployments",summary:"Queue a publish deployment for the current site through the internal Agent API.",status:"implemented",response_schema:"InternalCreateDeploymentResponseSchema",notes:["InternalAgentAuthGuard is required; request context is supplied by x-vcp-tenant-id, x-vcp-user-id, and x-vcp-site-id.","POST accepts no request body; VCP resolves the latest current snapshot. Quality-check and publish deployments are independent."]},{method:"GET",path:"/internal/site-deployments/publish/status",tag:"deployments",summary:"Read the latest internal publish deployment status for the current site.",status:"implemented",response_schema:"InternalGetDeploymentsStatusResponseSchema",notes:["InternalAgentAuthGuard is required; request context is supplied by x-vcp-tenant-id, x-vcp-user-id, and x-vcp-site-id."]},{method:"GET",path:"/sites/:site_id/deployments/current",tag:"deployments",summary:"Read the latest deployment for workspace refresh recovery.",status:"implemented",response_schema:"CurrentDeploymentResponseSchema"},{method:"GET",path:"/sites/:site_id/deployments/status",tag:"deployments",summary:"Read current in-flight deployment and latest released deployment.",status:"implemented",response_schema:"GetDeploymentsStatusResponseSchema"},{method:"GET",path:"/sites/:site_id/deployments/:deployment_id",tag:"deployments",summary:"Read one tenant-scoped deployment for status polling.",status:"implemented",response_schema:"GetDeploymentResponseSchema"},{method:"GET",path:"/sites/:site_id/cms/collections",tag:"cms",summary:"List CMS collections for a site.",status:"planned"},{method:"POST",path:"/sites/:site_id/cms/collections",tag:"cms",summary:"Create a CMS collection bound to generated content.",status:"planned"},{method:"GET",path:"/sites/:site_id/cms/collections/:collection_id/entries",tag:"cms",summary:"List CMS entries for a collection.",status:"planned"},{method:"POST",path:"/sites/:site_id/cms/collections/:collection_id/entries",tag:"cms",summary:"Create a CMS entry.",status:"planned"},{method:"PATCH",path:"/sites/:site_id/cms/collections/:collection_id/entries/:entry_id",tag:"cms",summary:"Update a CMS entry.",status:"planned"},{method:"POST",path:"/sites/:site_id/snapshots/:snapshot_id/version-record",tag:"versions",summary:"Record the sandbox accepted git commit for a promoted snapshot version.",status:"implemented",request_body_schema:"RecordSnapshotVersionRequestSchema",response_schema:"RecordSnapshotVersionResponseSchema"},{method:"GET",path:"/sites/:site_id/versions",tag:"versions",summary:"List snapshot-backed site versions.",status:"implemented",response_schema:"ListSiteVersionsResponseSchema"},{method:"POST",path:"/sites/:site_id/versions/:snapshot_id/restore",tag:"versions",summary:"Restore a site to an earlier snapshot version.",status:"implemented",response_schema:"RestoreSiteSnapshotResponseSchema"},{method:"GET",path:"/sites/:site_id/domains/configuration",tag:"custom-domains",summary:"Read the authoritative site domain configuration.",status:"implemented",response_schema:"GetSiteDomainConfigurationResponseSchema"},{method:"GET",path:"/internal/sites/:site_id/active-domain",tag:"internal/active-domain",summary:"Read whether an internal site has an active primary domain.",status:"implemented",response_schema:"GetActiveSiteDomainResponseSchema"},{method:"POST",path:"/sites/:site_id/publish-workflows/:workflow_id/domain/check",tag:"publish-workflow",summary:"Check a publish workflow domain and start its operation.",status:"implemented",request_body_schema:"CheckSitePublishDomainRequestSchema",response_schema:"CheckSitePublishDomainResponseSchema"},{method:"GET",path:"/sites/:site_id/publish-workflows/:workflow_id/domain/operation",tag:"publish-workflow",summary:"Read the current publish workflow domain operation.",status:"implemented",response_schema:"GetSitePublishDomainOperationResponseSchema"},{method:"POST",path:"/sites/:site_id/publish-workflows/:workflow_id/domain/operation/reconcile",tag:"publish-workflow",summary:"Recover or reconcile the current publish workflow domain operation.",status:"implemented",response_schema:"ReconcileSitePublishDomainOperationResponseSchema"},{method:"POST",path:"/sites/:site_id/publish-workflows/:workflow_id/domain/remediation/confirm",tag:"publish-workflow",summary:"Confirm the current DNS remediation plan.",status:"implemented",request_body_schema:"ConfirmSitePublishDomainRemediationRequestSchema",response_schema:"ConfirmSitePublishDomainRemediationResponseSchema"},{method:"POST",path:"/sites/:site_id/integrations/gsc/auth/start",tag:"gsc",summary:"Start Google Search Console authorization for a site.",status:"implemented",request_body_schema:"StartGscAuthRequestSchema",response_schema:"StartGscAuthResponseSchema"},{method:"GET",path:"/sites/:site_id/integrations/gsc/status",tag:"gsc",summary:"Read Google Search Console authorization and property status.",status:"implemented",response_schema:"GscStatusResponseSchema"},{method:"GET",path:"/admin/tenants",tag:"admin",summary:"Admin tenant listing.",status:"planned"},{method:"GET",path:"/usage/summary",tag:"usage",summary:"Summarize tenant usage and cost controls.",status:"planned"},{method:"GET",path:"/sites/:site_id/publish-workflow/active",tag:"publish-workflow",summary:"Read the active site publish workflow.",status:"implemented",response_schema:"SitePublishWorkflowActiveResponseSchema"},{method:"POST",path:"/sites/:site_id/publish-workflow/start",tag:"publish-workflow",summary:"Start or recover the site publish workflow.",status:"implemented",request_body_schema:"StartSitePublishWorkflowRequestSchema",response_schema:"SitePublishWorkflowQualityResponseSchema"},{method:"POST",path:"/sites/:site_id/publish-workflow/:workflow_id/repair-task",tag:"publish-workflow",summary:"Retired repair task entry: returns 409 WORKSPACE_REPAIR_REQUIRED; use the Workspace repair action.",status:"implemented",request_body_schema:"SitePublishWorkflowRevisionRequestSchema",response_schema:"ApiErrorEnvelopeSchema"},{method:"GET",path:"/sites/:site_id/publish-workflow/:workflow_id",tag:"publish-workflow",summary:"Read and reconcile a site publish workflow quality task.",status:"implemented",response_schema:"SitePublishWorkflowQualityResponseSchema"},{method:"PATCH",path:"/sites/:site_id/publish-workflow/:workflow_id/step",tag:"publish-workflow",summary:"Move the site publish workflow to an allowed step.",status:"implemented",request_body_schema:"UpdateSitePublishWorkflowStepRequestSchema",response_schema:"SitePublishWorkflowMutationResponseSchema"},{method:"POST",path:"/sites/:site_id/publish-workflow/:workflow_id/cancel",tag:"publish-workflow",summary:"Cancel a stable site publish workflow.",status:"implemented",request_body_schema:"SitePublishWorkflowRevisionRequestSchema",response_schema:"SitePublishWorkflowMutationResponseSchema"},{method:"POST",path:"/sites/:site_id/publish-workflow/:workflow_id/publish",tag:"publish-workflow",summary:"Start formal publishing for a site publish workflow.",status:"implemented",request_body_schema:"SitePublishWorkflowRevisionRequestSchema",response_schema:"SitePublishWorkflowPublishResponseSchema"}],Lq=[{method:"POST",path:"/v1/agent/clarify/:site_id",tag:"clarify",summary:"Stream Step 2 clarify questions as SSE; event_order includes optional skill.selecting, skill.selected, clarify.archetype_proposals, and run.failed on errors.",status:"implemented",request_body_schema:"ClarifyRunInputSchema without tenant_id/site_id",event_schema:"ClarifyStreamEventSchema",event_order:["run.started","skill.selecting","skill.selected","clarify.partial","clarify.archetype_proposals","clarify.finished","run.failed"]},{method:"POST",path:"/v1/agent/sitemap/:site_id",tag:"sitemap",summary:"Stream Step 3 sitemap generation as SSE; event_order includes sitemap.partial and run.failed on errors.",status:"implemented",request_body_schema:"Step5SitemapStartRequestSchema (browser marker only; API injects committed Step5 strategy)",event_schema:"SitemapStreamEventSchema",event_order:["run.started","sitemap.generating","sitemap.partial","sitemap.generated","sitemap.clamped","run.failed"]}],FT=t.object({id:t.string().min(1),role:t.enum(["system","user","assistant"]),metadata:t.unknown().optional(),parts:t.array(xi).min(1)}),md=FT.extend({role:t.literal("user")}).superRefine((e,n)=>{let s=0;for(let[i,o]of e.parts.entries()){if(o.type!=="file")continue;s+=1;let a=o;So.safeParse(a.mediaType).success||n.addIssue({code:"custom",path:["parts",i,"mediaType"],message:"Attachment mediaType must be image/png, image/jpeg or image/webp"}),(typeof a.url!="string"||fo(a.url)===null)&&n.addIssue({code:"custom",path:["parts",i,"url"],message:"Attachment url must be a workspace attachment image path"})}s>ho&&n.addIssue({code:"custom",path:["parts"],message:`A message may carry at most ${ho} attachments`})}),Mq=t.object({base_snapshot_id:I.optional(),intent:t.literal("navigation_adaptation").optional(),message:md.optional(),thread_id:st.optional(),client_run_key:t.string().min(1).max(200).optional()}).superRefine((e,n)=>{rs(e.message)&&n.addIssue({code:"custom",path:["message"],message:"Workspace startup message must not contain secrets",params:{errorCode:"WORKSPACE_MESSAGE_CONTAINS_SECRET"}})}),GT=t.object({path:t.string().regex(/^\/v1\/workspace\/sites\/[^/]+\/socket$/),run_id:$,base_snapshot_id:I,run_kind:Ii}),Uq=t.object({agent_run:nt,websocket:GT,next_step:t.literal("workspace_socket")}),Fq=t.object({agent_run:nt}),Gq=t.object({thread_id:st.optional()}),qq=t.object({agent_run:nt.nullable(),thread:Ei.nullable()}),Wq=t.object({status:Mp.default("active")}),Bq=t.object({threads:t.array(Ei)}),Kq=t.object({title:t.string().trim().min(1).max(200)}).strict(),zq=t.object({title:t.string().trim().min(1).max(200).optional(),status:t.literal("archived").optional()}).strict().refine(e=>e.title!==void 0||e.status!==void 0,{message:"title or status is required"}),Hq=t.object({thread:Ei}),$q=t.object({agent_type:t.enum(["clarify","sitemap","workspace"]),thread_id:st.optional()}),Vq=t.object({agent_run:nt}),Yq=t.enum(["client.message.create","client.resource.operation.create","client.run.cancel","client.tool.approve","server.run.started","server.user.message","server.assistant.delta","server.tool.started","server.tool.completed","server.workspace.suggestions","workspace.plan.created","workspace.worker.updated","workspace.task.updated","server.patch.applied","server.sitemap.updated","server.snapshot.created","server.snapshot.finalized","server.preview.invalidated","preview.build.started","preview.build.succeeded","preview.build.failed","server.run.finished","server.run.failed","server.error","server.activity.started","server.activity.updated","server.activity.finished","server.activity.failed"]),pe=t.object({id:t.string().min(1),tenant_id:t.string().min(1),site_id:k,run_id:$.optional(),correlation_id:t.string().min(1).optional(),seq:t.number().int().positive().optional(),sent_at:t.string().min(1)}),qT=t.object({key:t.string().min(1),label:t.string().min(1),source_file:t.string().min(1).optional(),component_name:t.string().min(1).optional(),opening_element_range:t.object({start_line:t.number().int().positive(),start_column:t.number().int().nonnegative(),end_line:t.number().int().positive(),end_column:t.number().int().nonnegative()}).optional(),structural_path:t.string().min(1).optional(),text_preview:t.string().min(1).optional()}),WT=t.discriminatedUnion("type",[pe.extend({type:t.literal("client.message.create"),payload:t.object({client_message_id:t.string().min(1),in_reply_to_tool_call_id:t.string().min(1).optional(),current_route_id:Gn.optional(),interaction_response:js.optional(),selected_component:qT.optional(),intent:t.literal("navigation_adaptation").optional(),display_text:t.string().min(1).max(4e3).optional(),message:md,base_snapshot_id:I.optional()}).superRefine((e,n)=>{e.interaction_response&&!e.in_reply_to_tool_call_id&&n.addIssue({code:"custom",path:["in_reply_to_tool_call_id"],message:"in_reply_to_tool_call_id is required for an interaction response"})})}),pe.extend({type:t.literal("client.run.cancel"),payload:t.object({run_id:$,reason:t.string().min(1).optional()})}),pe.extend({type:t.literal("client.tool.approve"),payload:t.object({tool_call_id:t.string().min(1),decision:t.enum(["approve","reject"]),reason:t.string().min(1).optional()})}),Cc]),BT=t.discriminatedUnion("type",[pe.extend({type:t.literal("server.run.started"),payload:t.object({run_id:$,agent_type:t.literal("workspace")})}),pe.extend({type:t.literal("server.user.message"),payload:t.object({client_message_id:t.string().min(1),message_id:t.string().min(1),parts:t.array(xi).min(1),display_text:t.string().min(1).max(4e3).optional(),in_reply_to_tool_call_id:t.string().min(1).optional(),interaction_response:js.optional()})}),pe.extend({type:t.literal("server.assistant.delta"),payload:t.object({message_id:t.string().min(1),parts:t.array(xi).min(1),status:t.enum(["streaming","ready"])})}),pe.extend({type:t.literal("server.tool.started"),payload:t.object({tool_call_id:t.string().min(1),name:t.string().min(1),summary:t.string().min(1)})}),pe.extend({type:t.literal("server.tool.completed"),payload:t.object({tool_call_id:t.string().min(1),name:t.string().min(1),result_summary:t.string().min(1),interaction_request:go.optional(),interaction_failure:_o.optional()})}),pe.extend({type:t.literal("server.workspace.suggestions"),payload:sd.extend({run_id:$}).strict()}),pe.extend({type:t.literal("workspace.plan.created"),payload:t.object({plan_id:t.string().min(1),run_kind:Ii,groups:t.array(Ha),tasks:t.array($a),dependencies:t.array(Va),expected_outputs:t.array(De),diagnostics:za,summary:od})}),pe.extend({type:t.literal("workspace.worker.updated"),payload:t.object({group_id:t.string().min(1),phase:Ba,status:Vt,task_counts:ad,target_paths:t.array(De),diagnostics:t.array(t.string().min(1))})}),pe.extend({type:t.literal("workspace.task.updated"),payload:t.object({task_id:t.string().min(1),group_id:t.string().min(1),status:Vt,target_path:De,read_files_count:t.number().int().nonnegative(),diagnostics:t.array(t.string().min(1)),diagnostic_details:t.array(Ka).optional()})}),pe.extend({type:t.literal("server.patch.applied"),payload:t.object({patch_batch_id:t.string().min(1),changed_files:t.array(t.string().min(1)),sitemap_resync_queued:t.boolean()})}),pe.extend({type:t.literal("server.sitemap.updated"),payload:t.object({sitemap_id:Ae,version:t.number().int().positive(),reason:t.string().min(1)})}),pe.extend({type:t.literal("server.snapshot.created"),payload:t.object({snapshot_id:I,manifest_hash:t.string().regex(/^sha256:[a-f0-9]{64}$/)})}),pe.extend({type:t.literal("server.snapshot.finalized"),payload:t.object({snapshot_id:I})}),pe.extend({type:t.literal("server.preview.invalidated"),payload:t.object({reason:t.string().min(1),next_preview_url:t.string().url().optional(),launch_id:t.string().min(1).optional()})}),pe.extend({type:t.literal("preview.build.started"),payload:t.object({snapshot_id:I})}),pe.extend({type:t.literal("preview.build.succeeded"),payload:t.object({snapshot_id:I})}),pe.extend({type:t.literal("preview.build.failed"),payload:t.object({snapshot_id:I,message:t.string().min(1),diagnostics:t.string().min(1),retryable:t.boolean()})}),pe.extend({type:t.literal("server.run.finished"),payload:t.object({run_id:$,snapshot_id:I,degraded_reason:In.optional(),build_verified:t.boolean().optional(),resource_operation:rd.optional()})}),pe.extend({type:t.literal("server.run.failed"),payload:t.object({run_id:$,error_code:t.string().min(1),message:t.string().min(1),retryable:t.boolean(),outcome:t.literal("retained_previous").optional(),details:t.record(t.string(),t.unknown()).optional()})}),pe.extend({type:t.literal("server.error"),payload:t.object({code:t.string().min(1),message:t.string().min(1),retryable:t.boolean()})}),pe.extend({type:t.literal("server.activity.started"),payload:t.object({activity_id:t.string().min(1),parent_activity_id:t.string().min(1).optional(),kind:qp,title:t.string().min(1).max(200),title_code:Nt.optional(),detail:t.string().max(360).optional(),detail_code:Nt.optional(),locks_input:t.boolean()})}),pe.extend({type:t.literal("server.activity.updated"),payload:t.object({activity_id:t.string().min(1),title:t.string().min(1).max(200).optional(),title_code:Nt.optional(),detail:t.string().max(360).optional(),detail_code:Nt.optional()})}),pe.extend({type:t.literal("server.activity.finished"),payload:t.object({activity_id:t.string().min(1)})}),pe.extend({type:t.literal("server.activity.failed"),payload:t.object({activity_id:t.string().min(1),detail:t.string().max(360).optional()})})]),KT=BT.superRefine((e,n)=>{if(e.type==="server.user.message"&&e.payload.interaction_response&&!e.payload.in_reply_to_tool_call_id&&n.addIssue({code:"custom",path:["payload","in_reply_to_tool_call_id"],message:"in_reply_to_tool_call_id is required for an interaction response"}),e.type!=="server.tool.completed")return;let s=e.payload.name==="prepare_product_search_entry",i=!!e.payload.interaction_request,o=!!e.payload.interaction_failure;(s?i!==o:!i&&!o)||n.addIssue({code:"custom",path:["payload","interaction_request"],message:s?"prepare_product_search_entry requires exactly one of interaction_request or interaction_failure":"product search interaction results are only valid for prepare_product_search_entry"})}),Xq=t.union([WT,KT]),Qq={path:"/v1/workspace/sites/:site_id/socket",protocol:"ws",status:"implemented",inbound_message_schema:"WorkspaceClientMessageSchema",outbound_message_schema:"WorkspaceServerMessageSchema",query_parameters:[{name:"run_id",required:!1,schema:"string",summary:"Workspace run id returned by the API run-start response."},{name:"run_kind",required:!1,schema:"WorkspaceRunKindSchema",summary:"Workspace run mode; initial_generation can auto-start when base_snapshot_id is present."},{name:"base_snapshot_id",required:!1,schema:"string",summary:"Authoritative base snapshot id for this workspace run."},{name:"unattended",required:!1,schema:'"1"',summary:"Unattended mode for machine-driven runs: interactive tools are withheld so the run cannot stall waiting for a human answer. Server-to-server only; the browser proxy strips it."}],ai_sdk_ui_compatible:!0,notes:["Assistant UI output is carried as AI SDK UIMessage parts, including text, data-*, and tool-* parts.","Operational AgentEvents remain persisted separately for replay and audit."]},ld=t.string().regex(/^sha256:[a-f0-9]{64}$/),zT=t.enum(["create","update","delete","str_replace"]),pd=t.enum(["sitemap_resync","smoke_test","prepare_preview"]),HT=t.object({old_string:t.string().min(1).describe("Exact text to find in the current file. Must match the file uniquely; include enough surrounding context (usually 2-4 adjacent lines)."),new_string:t.string().describe("Replacement text. May be empty to delete the matched text."),replace_all:t.boolean().optional()}).strict(),$T=t.object({path:De,operation:zT,expected_hash:ld.optional(),full_content:t.string().describe("Complete file content for create/update patches. Only this single field is a string value: every double quote inside the source code must be escaped so the field stays valid JSON. Avoid ASCII double quotes inside JSX attribute values and use corner quotes like \u300C\u751F\u65E5\u5FEB\u4E50\u300D for visitor-facing quoted examples. The surrounding patch object and the patches array are ordinary JSON structures, not strings.").optional(),edits:t.array(HT).min(1).max(20).optional()}).strict().superRefine((e,n)=>{let s=e.full_content!==void 0;if(e.operation==="delete"){s&&n.addIssue({code:"custom",path:["full_content"],message:"delete patches must not include full_content"}),e.edits!==void 0&&n.addIssue({code:"custom",path:["edits"],message:"edits is only allowed for str_replace patches"});return}if(ok(e.path)||n.addIssue({code:"custom",path:["path"],message:"Static App Router page paths must use lowercase ASCII kebab-case public segments."}),e.operation==="str_replace"){e.full_content!==void 0&&n.addIssue({code:"custom",path:["full_content"],message:"str_replace patches must not include full_content"}),(!e.edits||e.edits.length===0)&&n.addIssue({code:"custom",path:["edits"],message:"str_replace patches must include a non-empty edits array"});return}s||n.addIssue({code:"custom",path:["full_content"],message:"create/update patches must include full_content"}),e.edits!==void 0&&n.addIssue({code:"custom",path:["edits"],message:"edits is only allowed for str_replace patches"})}),VT=t.object({kind:t.enum(["block","page","site","chrome"]),id:t.string().min(1).max(120)}),YT=t.object({base_key:t.string().min(1).max(120).regex(/^[A-Za-z0-9._:-]+$/).refine(e=>!e.includes(".."),{message:"base_key must not contain '..'"}),owner:VT,count:t.number().int().min(1).max(12),query:t.string().min(1).max(400),role:t.enum(["hero","section","card","gallery","testimonial","decorative","site_background","nav_background","footer_background"]),orientation:t.enum(["landscape","portrait","square"]).optional(),altHint:t.string().min(1).max(300)}),dd=t.object({site_id:k,base_snapshot_id:I,reason:t.string().min(1),patches:t.array($T).min(1).describe("A real JSON array of patch objects. Never JSON.stringify this array, and never put an encoded JSON array inside a string \u2014 emit the array itself. Only full_content within a patch object is a string field."),media_requests:t.array(YT).max(24).optional(),post_actions:t.array(pd).optional()});function ud(e,n){let s=new Set;for(let[i,o]of e.patches.entries())s.has(o.path)&&n.addIssue({code:"custom",path:["patches",i,"path"],message:`Duplicate patch path: ${o.path}`}),s.add(o.path)}var Zq=dd.superRefine(ud),Jq=dd.omit({base_snapshot_id:!0}).extend({site_id:k.optional()}).superRefine(ud),XT=Re,QT=t.object({path:XT,operation:t.enum(["upsert","delete"]).optional()}),_d=t.enum(["sync_cms_pages","sync_cms_navigation"]),e2=t.object({files:t.array(QT).min(1),post_actions:t.array(_d).optional()}).strict().overwrite(e=>e.post_actions?{...e,post_actions:[...new Set(e.post_actions)]}:e),ZT=t.enum(["BASE_SNAPSHOT_NOT_FOUND","PATCH_TARGET_NOT_FOUND","PATCH_TARGET_ALREADY_EXISTS","PATCH_EXPECTED_HASH_MISMATCH","PATCH_DIFF_UNSUPPORTED","PATCH_PROTECTED_FILE","PATCH_VALIDATION_FAILED","PATCH_MEDIA_REFERENCE_NOT_DECLARED","PATCH_BATCH_INVALID","PATCH_BATCH_FAILED","PATCH_BATCH_TOO_LARGE","STR_REPLACE_NOT_FOUND","STR_REPLACE_NOT_UNIQUE","STR_REPLACE_BINARY_FILE","STR_REPLACE_REQUIRES_READ","GLOBALS_CSS_EDIT_REJECTED"]),JT=t.object({status:t.literal("applied"),patch_batch_id:t.string().min(1),site_id:k,base_snapshot_id:I,snapshot_id:I,manifest_hash:ld,object_key:t.string().min(1),changed_files:t.array(De).min(1),post_actions_queued:t.array(pd),dropped_protected_files:t.array(t.string().min(1)).min(1).optional()}),ek=t.object({status:t.literal("failed"),code:ZT,message:t.string().min(1),retryable:t.boolean().default(!1),details:t.unknown().optional()}),t2=t.discriminatedUnion("status",[JT,ek]),n2=t.object({ok:t.literal(!0),post_actions:t.array(t.object({action:_d,status:t.enum(["succeeded","failed"])}).strict()).default([])}),gd=Re,tk=t.enum(["text","binary"]),hd=t.object({path:gd,kind:tk,language:t.string().min(1).nullable(),size_bytes:t.number().int().nonnegative()}),s2=t.object({path:gd}),nk=hd.extend({kind:t.literal("text"),language:t.string().min(1),content:t.string()}),sk=hd.extend({kind:t.literal("binary"),language:t.null(),mime_type:t.string().min(1),content_base64:t.string().min(1)}),i2=t.union([nk,sk]);function rs(e){return typeof e=="string"?/authorization\s*:|bearer\s+|token\s*=|secret\s*=|api[_-]?key\s*=|access[_\s-]?key\s*=|\bsk-[a-z0-9_-]{20,}|eyJ[a-z0-9_-]{10,}\.[a-z0-9_-]{10,}\.[a-z0-9_-]{10,}/i.test(e):!e||typeof e!="object"?!1:Array.isArray(e)?e.some(n=>rs(n)):Object.entries(e).some(([n,s])=>ik(n)||rs(s))}function ik(e){let n=e.replace(/([a-z0-9])([A-Z])/g,"$1_$2").replace(/\s+/g,"_").toLowerCase();return/(^|[_-])(authorization|token|secret|api[_-]?key|apikey|access[_-]?key|accesskey)([_-]|$)/.test(n)}function Sd(e){let n=e.split("/");return e.length>0&&!e.startsWith("/")&&!e.includes("\\")&&n.every(s=>s!==""&&s!=="."&&s!=="..")}function ok(e){if(/^(?:src\/)?app\/\.vcp\//.test(e))return ps(e);let n=/^app\/(?:(.*)\/)?page\.(?:tsx|jsx)$/.exec(e);if(!n)return!0;let i=(n[1]??"").split("/").filter(a=>a.length>0);return i.some(a=>a.startsWith("_"))?!0:i.filter(a=>!a.startsWith("@")&&!/^\(.+\)$/.test(a)).map(a=>a.replace(/^\((?:\.|\.\.|\.\.\.)\)/,"")).filter(a=>a.length>0).every(a=>/^\[.*\]$/.test(a)||jn.test(`/${a}`))}var fd=t.enum(["idle","creating","restoring_snapshot","installing_dependencies","starting_preview","ready","active","stopping","stopped","failed"]),ak=t.object({id:cs,tenant_id:t.string().min(1),site_id:k,sandbox_id:t.string().min(1).nullable(),status:fd,source_snapshot_id:I.nullable(),last_snapshot_id:I.nullable(),preview_url:t.string().url().nullable(),browser_preview_url:t.string().url().nullable().optional(),launch_id:t.string().min(1).nullable().optional(),last_activity_at:t.string().min(1).nullable(),created_at:t.string().min(1),updated_at:t.string().min(1)}),o2=t.object({session_id:cs.optional(),sandbox_id:t.string().min(1).optional(),source_snapshot_id:I.optional(),last_snapshot_id:I,expected_current_snapshot_id:I.optional(),expected_ready_session_id:cs.optional(),expected_ready_session_last_snapshot_id:I.optional(),status:fd,preview_url:t.string().url().optional(),launch_id:t.string().min(1).optional()}),a2=t.object({preview_session:ak,next_step:t.literal("preview")}),r2=t.object({failed_count:t.number().int().nonnegative()}),c2=t.object({site_id:k}),m2=t.object({status:t.enum(["cancelled","stop_requested","no_active_run"]),agent_run:nt.nullable()});export{zm as AESTHETIC_NOTE_MAX_LENGTH,Ia as AI_IMAGE_GENERATION_MAX_QUANTITY,uy as APPLICATION_LIBRARY_ERROR_CODES,fG as AbandonSiteSnapshotResponseSchema,GE as ActiveSiteDomainDataSchema,qq as ActiveWorkspaceRunResponseSchema,qp as ActivityKindSchema,Nt as ActivityTitleCodeSchema,EP as AdvanceSiteWorkflowRequestSchema,Op as AgentErrorCategorySchema,Qa as AgentEventIdSchema,va as AgentEventRecordSchema,cd as AgentEventSchema,id as AgentEventTypeSchema,RT as AgentMessageHistoryPurposeSchema,Lp as AgentModelRouteSchema,IT as AgentPlanStepSchema,pG as AgentRunContextResponseSchema,$ as AgentRunIdSchema,jp as AgentRunKindSchema,nt as AgentRunRecordSchema,hI as AgentRunStatusSchema,Np as AgentRunTypeSchema,st as AgentThreadIdSchema,SI as AgentThreadKindSchema,fI as AgentThreadOriginSchema,Ei as AgentThreadRecordSchema,Mp as AgentThreadStatusSchema,vT as AiSdkUiDataPartSchema,OT as AiSdkUiErrorPartSchema,PT as AiSdkUiFilePartSchema,xi as AiSdkUiMessagePartSchema,FT as AiSdkUiMessageSchema,AT as AiSdkUiReasoningPartSchema,CT as AiSdkUiSourceDocumentPartSchema,wT as AiSdkUiSourceUrlPartSchema,NT as AiSdkUiStepStartPartSchema,kT as AiSdkUiTextPartSchema,DT as AiSdkUiToolPartSchema,Oq as ApiContractStatusSchema,kI as ApiErrorEnvelopeSchema,M as ApiResponseSchema,Pq as AppendAgentEventRequestSchema,wq as AppendAgentEventResponseSchema,gj as ApplicationCreateResponseSchema,fy as ApplicationLibraryApplicationSchema,hj as ApplicationLibraryApplicationsDataSchema,Zm as ApplicationLibraryErrorCodeSchema,fj as ApplicationLibraryErrorResponseSchema,Sj as ApplicationLibraryTemplatesDataSchema,el as ApplicationTemplateCatalogDataSchema,_y as ApplicationTemplateCatalogItemSchema,dy as ApplicationTemplateConsumeDataSchema,_j as ApplicationTemplateCreateRequestSchema,hy as ApplicationTemplateCreateResponseSchema,gy as ApplicationTemplateCreatedApplicationSchema,ti as ApplicationTemplateDigestSchema,ry as ApplicationTemplateFieldSchema,py as ApplicationTemplateReferenceSchema,Sy as ApplicationTemplateSourceSchema,ni as ApplicationTemplateStableKeySchema,Zo as ApplicationTemplateV1Schema,ZT as ApplyPatchBatchErrorCodeSchema,ek as ApplyPatchBatchFailureSchema,Zq as ApplyPatchBatchInputSchema,$T as ApplyPatchBatchPatchSchema,pd as ApplyPatchBatchPostActionSchema,t2 as ApplyPatchBatchResultSchema,JT as ApplyPatchBatchSuccessSchema,Jq as ApplyPatchBatchToolInputSchema,HT as ApplyPatchEditSchema,zT as ApplyPatchOperationSchema,Dp as ArchetypeProposalSchema,xk as AuditLogIdSchema,mk as AuthIdentityIdSchema,uk as AuthLoginCodeIdSchema,dk as AuthOidcStateIdSchema,lk as AuthSessionIdSchema,pk as AuthTokenIdSchema,_k as AuthWsTicketIdSchema,yx as BINDING_STATUSES,Wp as BlockGenerationContextSchema,us as BlockInteractionSchema,XG as BlockMediaIntentSchema,Fa as BlockSchema,$S as BlockingSubsiteSchema,Bp as BrandingSchema,Yt as BriefIdSchema,La as BriefRecordSchema,dr as BusinessFactsSchema,jD as CHAT_COPY,ND as CLARIFICATION_COPY,Hy as CMS_FORM_FIELD_TYPES,Nm as CMS_MAIN_PRODUCTS_MAX_LENGTH,Zu as CMS_PAGE_DIRECTORY_MAX_DEPTH,Qu as CMS_PAGE_DIRECTORY_MAX_NODES,Xu as CMS_PAGE_URL_MAX_LENGTH,qr as CMS_PAGE_URL_PATH_MAX_LENGTH,JC as COMPONENT_I18N_FILE_SUFFIX,Ws as COMPONENT_I18N_NAMESPACE,Nd as CONVERSION_CTA_LABEL_MAX_LENGTH,Fx as CRAWLER_INTERNAL_ERROR_CODES,wm as CURRENT_EDIT_ENGINE_VERSION,c2 as CancelActiveWorkspaceRunRequestSchema,m2 as CancelActiveWorkspaceRunResponseSchema,NA as CheckDesignerPageProjectionRequestSchema,jA as CheckDesignerPageProjectionResponseSchema,p_ as CheckDesignerPageProjectionResultSchema,Yl as CheckSitePublishDomainDataSchema,DE as CheckSitePublishDomainRequestSchema,OE as CheckSitePublishDomainResponseSchema,Kp as ChromeDesignSchema,FI as ChromeFooterDesignSchema,UI as ChromeFooterShellSchema,LI as ChromeHeaderDesignSchema,jI as ChromeHeaderShellSchema,GI as ChromeMobileNavDesignSchema,HC as ClaimStaleWorkspaceRunsResponseSchema,_I as ClarifyQuestionOptionSchema,gI as ClarifyQuestionSchema,pI as ClarifyQuestionTypeSchema,Na as ClarifyQuestionsSchema,LF as ClarifyRunInputSchema,Ya as ClarifySessionIdSchema,ST as ClarifySessionRecordSchema,MF as ClarifyStreamEventSchema,Tj as CmsApplicationCoreInputSchema,kj as CmsApplicationCoreResultSchema,Aj as CmsApplicationSeedInputSchema,Pj as CmsApplicationSeedResultSchema,Ek as CmsCollectionBindingIdSchema,PL as CmsCollectionBindingSchema,ul as CmsFormSchemaProjectionSchema,Vi as CmsManagedPageTypeSchema,iF as CmsNavigationActionSchema,sF as CmsNavigationCapabilitiesResponseSchema,oI as CmsNavigationCapabilitiesSchema,Rp as CmsNavigationCreateGroupBodySchema,Tp as CmsNavigationCreateItemBodySchema,tF as CmsNavigationDefaultGroupBodySchema,Ta as CmsNavigationDraftItemSchema,tI as CmsNavigationEditorContextSchema,eF as CmsNavigationEditorResponseSchema,eI as CmsNavigationGroupSchema,Ep as CmsNavigationItemSchema,iI as CmsNavigationMoveItemBodySchema,nI as CmsNavigationPatchGroupBodySchema,sI as CmsNavigationPatchItemBodySchema,nF as CmsNavigationSaveItemsBodySchema,ka as CmsNavigationTargetTypeSchema,t_ as CmsPageDirectoryGroupSchema,Br as CmsPageDirectoryNodeSchema,Fr as CmsPageDirectorySchema,Yi as CmsPageTypeSchema,qt as CmsPageUrlPathSchema,GA as CmsSeoSyncStateSchema,ys as CmsSiteIdSchema,Lx as CompanyInfoSchema,zL as CompanyInfoTaskCreateRequestSchema,HL as CompanyInfoTaskCreateResponseSchema,$L as CompanyInfoTaskResponseSchema,RN as CompleteCustomerMaterialsRequestSchema,IN as CompleteDiagnosisRequestSchema,IP as CompleteQualityOnlyWorkflowRequestSchema,yG as CompleteSiteSnapshotDeletionResponseSchema,RP as CompleteSiteWorkflowRequestSchema,TN as CompleteStrategyRequestSchema,EN as CompleteWebsiteScanRequestSchema,tv as ComponentI18nResourcesSchema,ZA as ComposeDesignerPageResourceBodySchema,wk as ComputeSnapshotEditChangesRequestSchema,Ck as ComputeSnapshotEditChangesResponseSchema,jE as ConfirmSitePublishDomainRemediationDataSchema,NE as ConfirmSitePublishDomainRemediationRequestSchema,LE as ConfirmSitePublishDomainRemediationResponseSchema,hq as ConfirmSiteStructureRequestSchema,lj as ConnectDynamicCollectionInputSchema,Lj as ConnectFormInputSchema,Mt as ConversionHintsSchema,Gx as CrawlerInternalErrorCodeSchema,VL as CrawlerInternalErrorSchema,_n as CrawlerTaskCodeSchema,LL as CrawlerTaskCreateRequestSchema,FL as CrawlerTaskCreateResponseSchema,Px as CrawlerTaskFailureErrorCodeSchema,Pl as CrawlerTaskFailureStageSchema,Cx as CrawlerTaskPageSchema,ML as CrawlerTaskPagesQuerySchema,WL as CrawlerTaskPagesResponseSchema,qL as CrawlerTaskStatusResponseSchema,Ht as CrawlerTaskUuidSchema,VG as CreateAgentRunConflictResponseSchema,dG as CreateAgentRunRequestSchema,uG as CreateAgentRunResponseSchema,FG as CreateDeploymentRequestSchema,EI as CreateDeploymentResponseSchema,u0 as CreateDocumentUploadRequestSchema,Ak as CreateExternalSiteEditRequestSchema,vk as CreateExternalSiteEditResponseSchema,b0 as CreateImageUploadRequestSchema,c0 as CreateInputSourceRequestSchema,GG as CreateQualityCheckDeploymentRequestSchema,zF as CreateSiteBriefRequestSchema,rG as CreateSiteBriefResponseSchema,HF as CreateSiteDraftRequestSchema,KF as CreateSiteInputSchema,Kq as CreateSiteThreadRequestSchema,yP as CreateSiteWorkflowRequestSchema,Kd as CreateTextInputSourceRequestSchema,zd as CreateUrlInputSourceRequestSchema,WG as CurrentDeploymentResponseSchema,hN as CustomerMaterialsDraftResponseSchema,Wo as CustomerMaterialsDraftSchema,SN as CustomerMaterialsNullableResponseSchema,Bo as CustomerMaterialsRecordSchema,gN as CustomerMaterialsResponseSchema,Bb as CustomerMaterialsStatusSchema,sS as DEFAULT_FONTS,Um as DEFAULT_SITE_DESIGN_RADIUS_ID,xu as DEFAULT_SITE_LOCALE,HD as DEFAULT_SUBSITE_PALETTE,Fs as DEFAULT_WEIGHT_STYLE_ID,Mw as DEPLOYMENT_ACTIVE_STATUSES,kt as DEPLOYMENT_LIFECYCLE_TRANSITIONS,uh as DEPLOYMENT_PROGRESS_STEP_CODES,TI as DEPLOYMENT_REALTIME_CHANNEL,Xt as DEPLOYMENT_STATUSES,Uw as DEPLOYMENT_TERMINAL_STATUSES,Qh as DEPLOYMENT_TRANSITION_ERROR_CODE,$G as DEPLOYMENT_WEBSOCKET_CONTRACT,bA as DESIGNER_COMPONENT_LIBRARY_ERROR_CODES,$A as DESIGNER_PAGE_LIBRARY_ERROR_CODES,m0 as DOCUMENT_EXTENSION_WHITELIST,l0 as DOCUMENT_MIME_WHITELIST,rE as DOMAIN_DNS_PURPOSES,lE as DOMAIN_DNS_REMEDIATION_STATUSES,cE as DOMAIN_DNS_VERIFICATION_STATUSES,sE as DOMAIN_OBSERVED_STATUSES,oE as DOMAIN_ROUTING_MODES,LA as DeleteDesignerPageErrorDetailsSchema,CA as DeleteDesignerPageRequestSchema,vA as DeleteDesignerPageResponseSchema,m_ as DeleteDesignerPageResultSchema,bG as DeleteSiteSnapshotResponseSchema,lt as DeploymentIdSchema,gk as DeploymentJobIdSchema,_h as DeploymentProgressStepCodeSchema,hh as DeploymentProgressStepSchema,gh as DeploymentProgressStepStatusSchema,Kc as DeploymentProgressStepsSchema,Ot as DeploymentRecordSchema,HG as DeploymentRedisPubSubEventSchema,Ma as DeploymentStatusSchema,Pp as DeploymentStatusSummarySchema,Io as DeploymentTransitionError,Fp as DeploymentTypeSchema,bi as DeploymentWsDeploymentPayloadSchema,zG as DeploymentWsServerMessageSchema,II as DeploymentWsServerMessageTypeSchema,xT as DesignPlanGenerationOutcomeSchema,ET as DesignPlanGenerationReasonSchema,Ti as DesignPlanIdSchema,JG as DesignPlanPatchSchema,fT as DesignPlanRecordSchema,Hp as DesignPlanSchema,Fe as DesignTokenBlockError,YG as DesignTokensSchema,Yu as DesignerComponentCatalogItemSchema,jr as DesignerComponentCategoriesDataSchema,Nr as DesignerComponentCategoryNodeSchema,Gt as DesignerComponentExactVersionSchema,Mr as DesignerComponentInstallDataSchema,Lr as DesignerComponentsDataSchema,h_ as DesignerPageCatalogItemSchema,Qr as DesignerPageCategoriesDataSchema,Xr as DesignerPageCategoryNodeSchema,a_ as DesignerPageDeleteBlockReasonSchema,o_ as DesignerPageDisabledReasonSchema,Nn as DesignerPageExactVersionSchema,$r as DesignerPageGroupSchema,Jr as DesignerPageInstallDataSchema,Hr as DesignerPageNodeSchema,tc as DesignerPageResourcePreparationDataSchema,g_ as DesignerPageResourceSourceSchema,R_ as DesignerPageResourceTemplateSchema,Wt as DesignerPageResourceTypeSchema,Zr as DesignerPagesDataSchema,Bi as DesignerResourceVersionSchema,nc as DesignerSitePagesDataSchema,YA as DesignerSiteRouteIdSchema,Kl as DomainConfigurationSchema,_a as DomainDnsPurposeSchema,hE as DomainDnsRecordSchema,gE as DomainDnsRemediationChangeSchema,ql as DomainDnsRemediationRecordSchema,Wl as DomainDnsRemediationResultSchema,pE as DomainDnsRemediationStatusSchema,_E as DomainDnsVerificationObservationSchema,Gl as DomainDnsVerificationResultSchema,mE as DomainDnsVerificationStatusSchema,iE as DomainObservedStatusSchema,uE as DomainOperationErrorSchema,ui as DomainOperationSchema,dE as DomainOperationStatusSchema,ga as DomainOperationTypeSchema,Bl as DomainRecordSchema,aE as DomainRoutingModeSchema,MD as EDIT_ENGINE_VERSION_HEADER,UD as EDIT_ENGINE_VERSION_SOURCE_HEADER,Pk as EMPTY_EXTERNAL_SITE_EDIT_CHANGES,CD as ERROR_COPY,Ed as EXTERNAL_SITE_EDIT_INFRASTRUCTURE_REASONS,xd as EXTERNAL_SITE_EDIT_PROMPT_MAX_LENGTH,Go as EditEngineVersionParseError,sc as EnhanceDesignerPageResourceBodySchema,oG as EnhanceDesignerPageResourceResponseSchema,Nk as ExternalSiteEditCallbackAckSchema,Ok as ExternalSiteEditCallbackPayloadSchema,Rd as ExternalSiteEditCallbackStatusSchema,Ai as ExternalSiteEditChangeKindSchema,ir as ExternalSiteEditChangesSchema,In as ExternalSiteEditDegradedReasonSchema,Lt as ExternalSiteEditExternalIdSchema,er as ExternalSiteEditOutcomeSchema,Dd as ExternalSiteEditPageChangeSchema,Td as ExternalSiteEditPageTypeSchema,vd as ExternalSiteEditSectionChangeSchema,Ad as ExternalSiteEditSiteWideChangeSchema,kd as ExternalSiteEditSiteWideKindSchema,Ja as ExternalSiteEditTaskIdSchema,ls as ExternalSiteEditTaskSchema,Id as ExternalSiteEditTaskStatusSchema,XF as ExternalSyncSiteRequestSchema,aG as ExternalSyncSiteResponseSchema,qd as ExtractedFactKindSchema,_s as ExtractedFactSchema,Qo as FIELD_TYPES,UC as FILL_IN_NOT_AVAILABLE_ERROR_CODE,GC as FILL_IN_TARGET_MODIFIED_ERROR_CODE,FC as FILL_IN_TARGET_NOT_OMITTED_ERROR_CODE,qf as FONT_LICENSE_BUILD_ERROR_CODES,sm as FONT_PAIRINGS,Ao as FONT_PAIRING_IDS,ix as FORM_DESIGN_ERROR_CODES,sx as FORM_DESIGN_FAILURE_STAGES,tx as FORM_DESIGN_OPERATION_STAGES,nx as FORM_DESIGN_OPERATION_STATUSES,ii as FORM_FIELD_TYPES,il as FORM_SCENE_CODES,ol as FORM_SCENE_UNKNOWN,Ry as FORM_SHAPE_EMBEDDED,$y as FORM_SPEC_FIELD_TYPE_TO_CMS,rl as FORM_SPEC_FILE_MIN_RUNTIME_VERSION,Uy as FORM_SPEC_LOCALIZABLE_FIELD_PATHS,al as FORM_SPEC_MULTISTEP_MIN_RUNTIME_VERSION,Vj as FORM_TEMPLATE_CATEGORY_COUNTS,$j as FORM_TEMPLATE_CATEGORY_SLUGS,r2 as FailStaleInFlightWorkspaceRunsResponseSchema,ei as FieldDeclSchema,hm as FillInTargetSchema,iM as FirecrawlBatchCreateRequestSchema,oM as FirecrawlBatchCreatedResponseSchema,Bx as FirecrawlBatchErrorSchema,rM as FirecrawlBatchErrorsResponseSchema,Wx as FirecrawlBatchPageSchema,aM as FirecrawlBatchStatusResponseSchema,JL as FirecrawlCrawlCreateRequestSchema,eM as FirecrawlCrawlCreatedResponseSchema,tM as FirecrawlCrawlStatusResponseSchema,Ol as FirecrawlJobStatusSchema,QL as FirecrawlMapRequestSchema,ZL as FirecrawlMapResponseSchema,cM as FirecrawlQueueStatusResponseSchema,nM as FirecrawlScrapeRequestSchema,sM as FirecrawlScrapeResponseSchema,MI as FooterShellSurfaceSchema,Py as FormBlockIdSchema,ai as FormDefinitionIdSchema,Zy as FormDesignAffectedFilesSchema,pa as FormDesignErrorCodeSchema,rL as FormDesignErrorSchema,hl as FormDesignFailureStageSchema,de as FormDesignHashSchema,eL as FormDesignOpenResponseSchema,Jy as FormDesignOperationFingerprintInputSchema,oa as FormDesignOperationIdSchema,Sl as FormDesignOperationNextActionSchema,Sk as FormDesignOperationRecordIdSchema,oL as FormDesignOperationRecordSchema,da as FormDesignOperationResponseSchema,bl as FormDesignOperationSchema,la as FormDesignOperationStageSchema,gl as FormDesignOperationStatusSchema,aL as FormDesignOperationTransitionRequestSchema,fl as FormDesignPreviewRefreshStatusSchema,nL as FormDesignQueryResponseSchema,sL as FormDesignResumeRequestSchema,iL as FormDesignResumeResponseSchema,ex as FormDesignSaveRequestSchema,tL as FormDesignSaveResponseSchema,_l as FormDesignSharedImpactSchema,ma as FormDesignStandardizationSchema,ky as FormFieldDeclSchema,ss as FormFieldNameSchema,na as FormMetadataSchema,aa as FormOptionValueSchema,ta as FormSceneSchema,Iy as FormShapeSchema,wy as FormSpecBindingSchema,vy as FormSpecFieldNodeSchema,Oy as FormSpecNodeSchema,Cy as FormSpecOptionSchema,Dy as FormSpecStepBreakNodeSchema,ca as FormSpecV1Schema,Yj as FormTemplateCatalogResponseSchema,dl as FormTemplateCategorySlugSchema,Ky as FormTemplateCategoryV1Schema,vt as FormTemplateTextSchema,zy as FormTemplateV1Schema,YE as GA4_AUTHORIZATION_STATUSES,QE as GA4_AUTH_ATTEMPT_STATUSES,sR as GA4_BINDING_REASONS,JE as GA4_BINDING_STATUSES,tR as GA4_VERIFICATION_STATUSES,Kn as GLOBAL_DESIGN_TOKENS_END,cn as GLOBAL_DESIGN_TOKENS_START,qE as GSC_AUTH_STATUSES,WE as GSC_BINDING_STATUSES,BE as GSC_PROPERTY_TYPES,uR as Ga4AccountOptionSchema,ep as Ga4AuthAttemptSchema,ZE as Ga4AuthAttemptStatusSchema,aR as Ga4AuthorizationSchema,XE as Ga4AuthorizationStatusSchema,iR as Ga4BindingReasonSchema,rR as Ga4BindingSchema,eR as Ga4BindingStatusSchema,gR as Ga4DataStreamOptionSchema,hR as Ga4DataStreamsDataSchema,OU as Ga4DataStreamsQuerySchema,DU as Ga4DataStreamsResponseSchema,pR as Ga4DeploymentSchema,mR as Ga4ModeSchema,SR as Ga4MutationSchema,dR as Ga4PropertyOptionSchema,_R as Ga4SetupResourcesDataSchema,vU as Ga4SetupResourcesQuerySchema,CU as Ga4SetupResourcesResponseSchema,tp as Ga4StatusDataSchema,wU as Ga4StatusQuerySchema,PU as Ga4StatusResponseSchema,lR as Ga4TrackingSchema,cR as Ga4VerificationSchema,nR as Ga4VerificationStatusSchema,GR as GenerateAiImagesRequestSchema,qR as GenerateAiImagesResponseSchema,bp as GeneratedAiImageResultSchema,QM as GetActiveSiteDomainResponseSchema,BG as GetDeploymentResponseSchema,RI as GetDeploymentsStatusResponseSchema,Dk as GetExternalSiteEditResponseSchema,XM as GetSiteDomainConfigurationResponseSchema,KO as GetSiteLauncherPermissionResponseSchema,ha as GetSitePublishDomainOperationDataSchema,ME as GetSitePublishDomainOperationResponseSchema,PO as GetTemplateUpgradeReportQuerySchema,wO as GetTemplateUpgradeReportResponseSchema,fU as GoogleSearchConsoleAuthStartDataSchema,SU as GoogleSearchConsoleAuthStartRequestSchema,bU as GoogleSearchConsoleAuthStartResponseSchema,uU as GoogleSearchConsoleAuthStatusSchema,_U as GoogleSearchConsoleBindingStatusSchema,gU as GoogleSearchConsolePropertyTypeSchema,hU as GoogleSearchConsoleStateSchema,xU as GoogleSearchConsoleStatusDataSchema,yU as GoogleSearchConsoleStatusInputSchema,EU as GoogleSearchConsoleStatusResponseSchema,lU as GscAuthStartDataSchema,mU as GscAuthStartRequestSchema,pU as GscAuthStartResponseSchema,Sa as GscAuthStatusSchema,fa as GscBindingStatusSchema,ba as GscPropertyTypeSchema,zE as GscStateInputSchema,dU as GscStateSchema,Zl as GscStatusDataSchema,HE as GscStatusResponseSchema,Gr as HOME_PAGE_URL_PATH,OI as HeaderShellBehaviorSchema,NI as HeaderShellShapeSchema,DI as HeaderShellSurfaceSchema,vI as HeaderShellVariantSchema,Ex as HomeUrlCrawlerTaskCreateRequestSchema,ro as HttpUrlSchema,g0 as IMAGE_EXTENSION_WHITELIST,h0 as IMAGE_MIME_WHITELIST,Or as INSERT_NEW_COMPONENT_CATEGORY_GROUP_KEY,Yr as INSERT_NEW_PAGE_CATEGORY_GROUP_KEY,AC as INTERNAL_RUN_LEASE_OWNER_HEADER,Eu as ISO_639_3_TO_SITE_LOCALE,Hd as ImageRoleSchema,md as InboundUserMessageSchema,ej as IndustryClassificationRequestSchema,tj as IndustryClassificationResultSchema,ny as IndustryConfidenceSchema,Jm as InitializationResultSchema,Gd as InputBundleStatusSchema,hs as InputConflictSchema,y0 as InputContextBundleSchema,Rn as InputContextSourceIdSchema,Bd as InputSourceSchema,wi as InputSourceStatusSchema,Pi as InputSourceTypeSchema,hO as InspectTemplateUpgradeStateRequestSchema,SO as InspectTemplateUpgradeStateResponseSchema,RA as InstallDesignerComponentBodySchema,JF as InstallDesignerComponentResponseSchema,XA as InstallDesignerPageBodySchema,nG as InstallDesignerPageResponseSchema,qG as InternalCreateDeploymentResponseSchema,jG as InternalEnsureSubsitePublishRequestSchema,LG as InternalEnsureSubsitePublishResponseSchema,Q as InternalEntityIdSchema,KG as InternalGetDeploymentsStatusResponseSchema,MG as InternalGetSubsitePublishStatusRequestSchema,UG as InternalGetSubsitePublishStatusResponseSchema,OG as InternalPrepareSubsitePreviewRequestSchema,NG as InternalPrepareSubsitePreviewResponseSchema,Gb as KNOWLEDGE_CATEGORY_CODES,jm as KnowledgeCategoryCodeSchema,mN as KnowledgeContextReadinessSchema,Wb as KnowledgeSourceReadinessSchema,qb as KnowledgeSourceReadinessStatusSchema,jl as LEGACY_FILE_MUTATION_TOOL_NAME,hu as LEGACY_SITE_LOCALE_CODES,$q as LatestAgentRunQuerySchema,Vq as LatestAgentRunResponseSchema,Gq as LatestWorkspaceRunQuerySchema,Fq as LatestWorkspaceRunResponseSchema,fM as LauncherPromptTemplateApplyRequestSchema,bM as LauncherPromptTemplateApplyResponseSchema,Xx as LauncherPromptTemplateCatalogItemSchema,hM as LauncherPromptTemplateCatalogQuerySchema,SM as LauncherPromptTemplateCatalogSchema,Vx as LauncherPromptTemplateKindSchema,Yx as LauncherPromptTemplateLocaleSchema,di as LauncherPromptTemplateTypeSchema,vb as LauncherScopeSchema,vq as ListAgentEventsQuerySchema,Cq as ListAgentEventsResponseSchema,QF as ListDesignerComponentCategoriesResponseSchema,EA as ListDesignerComponentsQuerySchema,ZF as ListDesignerComponentsResponseSchema,eG as ListDesignerPageCategoriesResponseSchema,VA as ListDesignerPagesQuerySchema,tG as ListDesignerPagesResponseSchema,iG as ListDesignerSitePagesResponseSchema,MR as ListMediaLibraryAssetsQuerySchema,UR as ListMediaLibraryAssetsResponseSchema,Dq as ListSiteAgentEventsQuerySchema,CG as ListSiteVersionsResponseSchema,CO as ListTemplateUpgradeSnapshotDeletionCandidatesQuerySchema,vO as ListTemplateUpgradeSnapshotDeletionCandidatesResponseSchema,KC as ListWorkspacePageCheckpointsResponseSchema,d0 as MAX_DOCUMENT_SOURCES_PER_SITE,p0 as MAX_DOCUMENT_UPLOAD_BYTES,f0 as MAX_IMAGE_SOURCES_PER_SITE,S0 as MAX_IMAGE_UPLOAD_BYTES,CR as MAX_NAV_LABEL_WIDTH,tb as MAX_SUBSITE_MEDIA_REPLACEMENTS,WP as MAX_UNBOUND_WORKSPACE_ATTACHMENTS_PER_SITE,ho as MAX_WORKSPACE_ATTACHMENTS_PER_MESSAGE,YP as MAX_WORKSPACE_URL_CAPTURES_PER_SITE_HOUR,pp as MEDIA_LIBRARY_AUDIO_EXTENSIONS,hp as MEDIA_LIBRARY_AUDIO_MIME_TYPES,dp as MEDIA_LIBRARY_DOCUMENT_EXTENSIONS,jR as MEDIA_LIBRARY_EXTENSIONS,up as MEDIA_LIBRARY_FILE_EXTENSIONS,mp as MEDIA_LIBRARY_IMAGE_EXTENSIONS,NR as MEDIA_LIBRARY_IMAGE_MAX_BYTES,_p as MEDIA_LIBRARY_IMAGE_MIME_TYPES,cp as MEDIA_LIBRARY_MAX_BYTES,LR as MEDIA_LIBRARY_MIME_TYPES,lp as MEDIA_LIBRARY_VIDEO_EXTENSIONS,gp as MEDIA_LIBRARY_VIDEO_MIME_TYPES,iv as MIGRATION_PRODUCTS_CMS_DETAIL_PAGE_TITLE,sv as MIGRATION_PRODUCTS_DETAIL_PREFIX,rv as MIGRATION_PRODUCTS_DETAIL_VIEW_VARIANT,av as MIGRATION_PRODUCTS_LIST_VIEW_VARIANT,GS as MIGRATION_PRODUCTS_ROUTE,St as MIGRATION_PRODUCTS_SLUG,ov as MIGRATION_PRODUCTS_VIEW_BLOCK_TYPE,Ty as MODEL_DECLARABLE_FORM_FIELD_TYPES,Nl as MODEL_FILE_MUTATION_TOOL_NAMES,Kb as MOTION_PRESETS,zo as MOTION_PRESET_IDS,ZG as MediaAssetSchema,wI as MediaAttributionSchema,Ra as MediaLibraryAssetSchema,Sp as MediaLibraryFileTypeSchema,fp as MediaLibrarySourceSchema,VT as MediaRequestOwnerSchema,yk as MediaResolutionCacheIdSchema,rI as MigrationCollectionProgressSchema,wa as MigrationCollectionSchema,rF as MigrationContentProgressSchema,aI as MigrationReasonCodeSchema,mI as MigrationRedirectProgressSchema,cI as MigrationRedirectReasonCodeSchema,kp as MigrationRedirectSiteReasonSchema,xA as MockDesignerComponentInsertDataSchema,yA as MockDesignerComponentInsertRequestSchema,Oa as MotionLevelSchema,dx as NAV_ITEMS_LOCALIZABLE_FIELD_PATHS,ux as NAV_ITEMS_MACHINE_FIELD_PATHS,aS as NEXT_FONT_DISPLAY_NAMES,ht as NEXT_FONT_REGISTRY,Ru as NON_LATIN_SITE_LOCALE_CODES,SL as NavItemSchema,ji as NextPageCodeErrorSchema,cx as PAGE_SEO_LOCALIZABLE_FIELD_PATHS,mx as PAGE_SEO_MACHINE_FIELD_PATHS,jn as PAGE_SLUG_PATTERN,en as PAGE_SLUG_SEGMENT_PATTERN_SOURCE,rr as PAGE_TEMPLATE_BATCH_MAX_ITEMS,zx as PLATFORM_FILE_MUTATION_TOOL_NAMES,RL as PLATFORM_MATERIALIZED_EXEMPTIONS,Sx as PLATFORM_MATERIALIZED_FILES,fx as PLATFORM_MATERIALIZED_FILE_PATTERNS,EL as PLATFORM_MATERIALIZERS,ic as PLATFORM_OWNED_PAGE_SLUGS,I_ as PLATFORM_OWNED_ROUTE_FILE_PATHS,c_ as PageDirectoryReconcileFailedPageSchema,Xi as PageDirectoryReconcileResultSchema,UA as PageDirectoryReconcileStateSchema,r_ as PageDirectoryReconcileStatusSchema,kx as PageDiscoveryCoverageEntrySchema,GL as PageDiscoveryCoverageReasonSchema,wl as PageDiscoveryCoverageSchema,$p as PageNavigationSchema,Zi as PageResourceArtifactSchema,y_ as PageResourceComponentReferenceSchema,x_ as PageResourceComponentSchema,f_ as PageResourceDraftPageSchema,b_ as PageResourceDraftSchema,Cs as PageResourceFinalRouteSchema,E_ as PageResourcePageSchema,S_ as PageResourcePageSelectionSchema,ec as PageResourceRouteMappingSchema,qa as PageSchema,gL as PageSeoDeclSchema,Ga as PageSlugSchema,d_ as PageTargetKindSchema,zi as PageTargetProjectionHashSchema,Vr as PageTargetSchema,u_ as PageTargetSeoSchema,MA as PageTargetSetSchema,mr as PageTemplateBatchManifestSchema,qk as PageTemplateCleanupRequestSchema,Kk as PageTemplateCleanupResponseSchema,ar as PageTemplateCreateItemSchema,Fk as PageTemplateCreateRequestSchema,Wk as PageTemplateCreateResponseSchema,zk as PageTemplateErrorCodeSchema,Xe as PageTemplateIdSchema,kn as PageTemplatePagePathSchema,Gk as PageTemplatePromoteRequestSchema,Bk as PageTemplatePromoteResponseSchema,Od as PageTemplateTaskSchema,Do as PaletteInputsSchema,xq as PersistClarifyAnswersRequestSchema,Eq as PersistClarifyAnswersResponseSchema,Sq as PersistGeneratedSitemapDraftRequestSchema,yq as PersistGeneratedSitemapDraftResponseSchema,o2 as PersistPreviewSessionRequestSchema,a2 as PersistPreviewSessionResponseSchema,Iq as PersistSiteDesignPlanRequestSchema,Tq as PersistSiteDesignPlanResponseSchema,bq as PersistSiteSitemapDraftResponseSchema,gq as PersistSiteSitemapRequestSchema,fq as PersistSiteSitemapResponseSchema,_G as PersistSiteSnapshotRequestSchema,gG as PersistSiteSnapshotResponseSchema,lI as PositioningPrefillSchema,Ca as PositioningSourceSchema,QA as PrepareDesignerPageBodySchema,sG as PrepareDesignerPageResponseSchema,eN as PrepareSiteBuildInitialGenerationBaseRequestSchema,tN as PrepareSiteBuildInitialGenerationBaseResultSchema,gO as PrepareTemplateUpgradeStateRequestSchema,gb as PrepareTemplateUpgradeStateResponseSchema,DG as PrepareVersionPreviewRequestSchema,xI as PrepareVersionPreviewResponseSchema,Wc as ProductSearchAppConfigDraftSchema,uo as ProductSearchAppSlugSchema,FP as ProductSearchContractFixtureSchema,ih as ProductSearchDraftConfigSchema,Ue as ProductSearchFieldNameSchema,nh as ProductSearchFilterMetaSchema,go as ProductSearchInteractionRequestSchema,js as ProductSearchInteractionResponseSchema,UP as ProductSearchPopularTermsReadSchema,qc as ProductSearchPopularTermsSchema,th as ProductSearchPrepareFailureReasonSchema,_o as ProductSearchPrepareFailureSchema,ch as ProductSearchRequestSchema,lh as ProductSearchResponseSchema,Gn as ProductSearchRouteIdSchema,eh as ProductSearchValueShapeSchema,SG as PromoteSiteSnapshotRequestSchema,bI as PromoteSiteSnapshotResponseSchema,PG as PromoteTemplateUpgradeSnapshotRequestSchema,wG as PromoteTemplateUpgradeSnapshotResponseSchema,BM as QualityCheckOutcomeSchema,$l as QualityRunningStatusSchema,OD as REFUSAL_COPY,jq as REST_API_ENDPOINTS,lx as ROOT_LAYOUT_METADATA_LOCALIZABLE_FIELD_PATHS,px as ROOT_LAYOUT_METADATA_MACHINE_FIELD_PATHS,UE as ReconcileSitePublishDomainOperationDataSchema,FE as ReconcileSitePublishDomainOperationResponseSchema,xG as RecordSnapshotVersionRequestSchema,EG as RecordSnapshotVersionResponseSchema,kO as RecordTemplateUpgradeEventRequestSchema,AO as RecordTemplateUpgradeEventResponseSchema,fO as RecordTemplateUpgradeFailureRequestSchema,bO as RecordTemplateUpgradeFailureResponseSchema,yO as RecordTemplateUpgradeSuccessRequestSchema,xO as RecordTemplateUpgradeSuccessResponseSchema,DA as RecoverDesignerPageProjectionRequestSchema,OA as RecoverDesignerPageProjectionResponseSchema,l_ as RecoverDesignerPageProjectionResultSchema,Wd as ReferencePagePatternSchema,gs as ReferenceSignalsSchema,HR as RegisterMediaResourceReferenceRequestSchema,$R as RegisterMediaResourceReferenceResponseSchema,TP as RegisterWorkflowTaskCommandRequestSchema,$g as RegisterWorkflowTaskRequestSchema,BC as RegisterWorkspacePageCheckpointRequestSchema,TG as ReleaseTemplateUpgradeLockRequestSchema,kG as ReleaseTemplateUpgradeLockResponseSchema,PP as ReplaceCrawlWorkflowTaskCommandRequestSchema,Yg as ReplaceCrawlWorkflowTaskRequestSchema,AP as ReplaceWorkflowTaskCommandRequestSchema,Vg as ReplaceWorkflowTaskRequestSchema,mj as ResolvedFieldSchema,Mj as ResolvedFormFieldSchema,Nq as RestApiMethodSchema,vG as RestoreSiteSnapshotResponseSchema,hL as RootLayoutMetadataSchema,Gp as RouteGenerationCardSchema,Kh as RuleEngineInputSchema,Vh as RuleEngineScoreRecordSchema,Ro as RuleScoreDimensionKeySchema,$h as RuleScoreDimensionSchema,wn as SELECTABLE_SITE_LOCALE_CODES,tT as SITEMAP_RESOLVER_MAX_BLOCK_TARGETS,eT as SITEMAP_RESOLVER_MAX_PAGE_TARGETS,ZO as SITE_BUILD_CONTEXT_FILE_PATH,JO as SITE_BUILD_CONTEXT_MAX_BYTES,jg as SITE_BUILD_STATUSES,Nc as SITE_BUILD_STATUS_CODES,Lg as SITE_DEPLOYMENT_STATUSES,jc as SITE_DEPLOYMENT_STATUS_CODES,Ko as SITE_DESIGN_DENSITY_IDS,Kt as SITE_DESIGN_NOTES_END,rn as SITE_DESIGN_NOTES_START,Mm as SITE_DESIGN_RADIUS_IDS,Nv as SITE_EDIT_DURABLE_HISTORY_CAPABILITY,Wu as SITE_EDIT_MATERIALIZATION_MAX_FILE_CONTENT_BYTES,qi as SITE_EDIT_MATERIALIZATION_MAX_FILE_COUNT,Wi as SITE_EDIT_MATERIALIZATION_MAX_TOTAL_CONTENT_BYTES,bc as SITE_EDIT_PAGE_COMPOSITION_SCHEMA_VERSION,O1 as SITE_EDIT_PAGE_COMPOSITION_V2_CAPABILITY,Df as SITE_EDIT_RUNTIME_CONTAINER_TAGS,Of as SITE_EDIT_RUNTIME_TEXT_TAGS,vf as SITE_EDIT_RUNTIME_VOID_ELEMENT_TAGS,I1 as SITE_EDIT_SIGNED_MUTATION_CAPABILITY,Yd as SITE_EDIT_SOURCE_ALLOWED_APP_FILES,hr as SITE_EDIT_SOURCE_ALLOWED_DIRS,$d as SITE_EDIT_SOURCE_ALLOWED_ROOT_FILES,Vd as SITE_EDIT_SOURCE_ALLOWED_SYSTEM_FILES,vi as SITE_EDIT_SOURCE_DELETE_CAPABILITY,Xd as SITE_EDIT_TEXT_SOURCE_EXTENSIONS,Vm as SITE_EXTRA_REQUIREMENT_MAX_LENGTH,Sv as SITE_HAS_ACTIVE_SUBSITES_ERROR_CODE,fv as SITE_HAS_SUBSITES_ERROR_CODE,eC as SITE_LEADING_BODY_TOKEN,tC as SITE_LEADING_HEADING_TOKEN_NAMES,Su as SITE_LOCALE_CODES,_L as SITE_LOCALIZATION_STRUCTURES,UF as SITE_PLANNING_FROZEN_ERROR_CODE,FF as SITE_PLANNING_LOCKED_ERROR_CODE,BF as SITE_SITEMAP_DRAFT_OPERATION_MISMATCH_ERROR_CODE,WF as SITE_SITEMAP_DRAFT_STALE_ERROR_CODE,GF as SITE_STRUCTURE_CONFIRMATION_REQUIRED_ERROR_CODE,qF as SITE_STRUCTURE_CONFIRMATION_STALE_ERROR_CODE,Ap as SITE_STRUCTURE_INVALID_ERROR_CODE,Jw as SITE_WEIGHT_TOKEN_NAMES,Tb as SITE_WORKFLOW_PROGRESS_STATUSES,Ab as SITE_WORKFLOW_PROGRESS_STEP_STATUSES,Mg as SITE_WORKFLOW_STATUSES,Lc as SITE_WORKFLOW_STATUS_CODES,Lq as SSE_STREAMS,ku as STEP5_KEYWORD_CATEGORIES,Pu as STEP5_OPTIONAL_STRATEGY_KEYS,Is as STEP5_REQUIRED_STRATEGY_COUNT,vn as STEP5_REQUIRED_STRATEGY_KEYS,Fu as STEP5_SSE_EVENT_NAMES,Ne as STEP5_STRATEGY_COUNT,Zt as STEP5_STRATEGY_KEYS,kr as STEP5_STRATEGY_OPTION_IDS,qm as STEP6_AI_THEME_IDS,Ho as STEP6_AI_THEME_PRESETS,Wm as STEP6_GENERATED_THEME_ID_PATTERN,Vf as SUBSITE_GLOSSARY_ENTRY_MAX_CHARS,Yf as SUBSITE_GLOSSARY_MAX_ENTRIES,mb as SUBSITE_MOUNT_PATH_PATTERN,eb as SUBSITE_PALETTE_NOTE_MAX_CHARS,lb as SUBSITE_RESERVED_MOUNT_SEGMENTS,W0 as SUPPORTED_SITE_LOCALES,cs as SandboxSessionIdSchema,ak as SandboxSessionSchema,fd as SandboxSessionStatusSchema,YF as SaveBriefDraftRequestSchema,mG as SaveBriefDraftResponseSchema,fR as SaveGa4BindingDataSchema,NU as SaveGa4BindingRequestSchema,jU as SaveGa4BindingResponseSchema,oj as SaveSiteExtraRequirementRequestSchema,dq as SaveSiteSitemapDraftRequestSchema,uq as SaveSiteSitemapDraftResponseSchema,WR as SearchUnsplashMediaQuerySchema,BR as SearchUnsplashMediaResponseSchema,zp as SiteBreadcrumbPlacementSchema,Mb as SiteBuildContextFileSchema,Lb as SiteBuildContextPayloadSchema,jb as SiteBuildContextProvenanceSchema,Nb as SiteBuildContextProvenanceSourceSchema,co as SiteBuildStatusSchema,bv as SiteDeletionBlockedDetailsSchema,mo as SiteDeploymentStatusSchema,fi as SiteDesignContextSchema,dI as SiteDesignDensitySchema,uI as SiteDesignMotionLevelSchema,Tn as SiteEditAdvisorySchema,zs as SiteEditBoundaryKindSchema,XS as SiteEditCapabilityConstraintSchema,VS as SiteEditCapabilityModeSchema,Ks as SiteEditCapabilityModeViewSchema,Rv as SiteEditCapabilityReadRequestSchema,w_ as SiteEditClassNameSourceDiagnosticSchema,dt as SiteEditClassNameSourceRangeSchema,lc as SiteEditClassNameSourceSchema,c1 as SiteEditClassNameSourceStyleContextSchema,mc as SiteEditClassNameSourceStylesheetSchema,eo as SiteEditClassNameSourceWriteIntentSchema,s1 as SiteEditCommandDiagnosticSchema,A_ as SiteEditCommandErrorSchema,K as SiteEditCompositionContextSchema,ge as SiteEditCompositionSelectorSchema,YS as SiteEditConstraintKindSchema,Eg as SiteEditDeletePageSourceOutputSchema,Ef as SiteEditDynamicConfidenceSchema,If as SiteEditDynamicDataBindingSchema,Rm as SiteEditDynamicDataDetailSchema,Im as SiteEditDynamicDataSummarySchema,Rf as SiteEditDynamicEvidenceSchema,Em as SiteEditDynamicSourceKindSchema,yf as SiteEditDynamicSourceTypeSchema,xf as SiteEditDynamicTargetKindSchema,No as SiteEditEffectiveWriteTargetSchema,Cv as SiteEditEventSchema,ki as SiteEditExecutionSceneSchema,Vs as SiteEditExternalSourceKindSchema,d1 as SiteEditGetClassNameSourceCommandResultSchema,l1 as SiteEditGetClassNameSourceInputSchema,p1 as SiteEditGetClassNameSourceResultSchema,dD as SiteEditGetDocumentInputSchema,uD as SiteEditGetObjectEditContextInputSchema,O0 as SiteEditGetSourceFileInputSchema,D0 as SiteEditGetSourceTreeInputSchema,m1 as SiteEditGetStyleContextInputSchema,$s as SiteEditHistoryProvenanceSchema,tf as SiteEditHistoryReadOnlyRecoveryStatusSchema,QS as SiteEditHistoryRecoveryCodeSchema,ZS as SiteEditHistoryRecoveryDiagnosticSchema,Lv as SiteEditHistoryResultSchema,jv as SiteEditHistoryStatusModeSchema,sf as SiteEditHistoryStatusSchema,JS as SiteEditHistoryUnavailableReasonSchema,nf as SiteEditHistoryUnavailableStatusSchema,ef as SiteEditHistoryWritableStatusSchema,PD as SiteEditInitializeSessionInputSchema,bg as SiteEditInsertNodeSpecSchema,xg as SiteEditInsertPageResourceOutputSchema,Vu as SiteEditMaterializationDataRequirementsSchema,$u as SiteEditMaterializationEntrySchema,Hu as SiteEditMaterializationExportSchema,zu as SiteEditMaterializationFileSchema,Dr as SiteEditMaterializationPathTemplateSchema,Ft as SiteEditMaterializationSchema,kc as SiteEditMaterializedComponentNodeSpecSchema,fg as SiteEditMoveNodeTargetSchema,Tc as SiteEditMoveTargetSchema,Ln as SiteEditMutationContextSchema,Hs as SiteEditNodeCapabilitySnapshotSchema,gD as SiteEditObjectCapabilitiesSchema,SD as SiteEditObjectDetailSchema,bD as SiteEditObjectEditContextSchema,yD as SiteEditObjectStyleDetailSchema,fD as SiteEditObjectSummarySchema,Y1 as SiteEditOperationCommandResultSchema,Ac as SiteEditOperationErrorCodeSchema,Pc as SiteEditOperationErrorSchema,Rg as SiteEditOperationOutputSchema,yg as SiteEditOperationParamsSchema,oo as SiteEditOperationPayloadSchema,io as SiteEditOperationRequestSchema,hg as SiteEditOperationResultTargetSchema,nn as SiteEditOperationSelectionRefSchema,bf as SiteEditOperationSummarySchema,pg as SiteEditOperationTargetSchema,Fn as SiteEditOperationTypeSchema,Bt as SiteEditOperationValueSchema,Tf as SiteEditPageCompositionActionScopeSchema,N1 as SiteEditPageCompositionAnyVersionSchema,Y_ as SiteEditPageCompositionAtomicKindSchema,J_ as SiteEditPageCompositionBoundaryModeSchema,q_ as SiteEditPageCompositionBusinessMemberSchema,F_ as SiteEditPageCompositionContainerSchema,Un as SiteEditPageCompositionDiagnosticSchema,Ds as SiteEditPageCompositionErrorCodeSchema,hc as SiteEditPageCompositionPlacementTargetSchema,W_ as SiteEditPageCompositionPlacementUnitSchema,$_ as SiteEditPageCompositionRuntimeRefSchema,H_ as SiteEditPageCompositionSchema,V_ as SiteEditPageCompositionSourceMemberKindSchema,G_ as SiteEditPageCompositionSourceMemberSchema,yc as SiteEditPageCompositionSourceRangeSchema,K_ as SiteEditPageCompositionSupportedSchema,z_ as SiteEditPageCompositionUnsupportedSchema,Z_ as SiteEditPageCompositionV2BusinessMemberSchema,X_ as SiteEditPageCompositionV2ContainerSchema,tg as SiteEditPageCompositionV2PlacementRelationSchema,sg as SiteEditPageCompositionV2PlacementSchema,eg as SiteEditPageCompositionV2PlacementUnitSchema,rg as SiteEditPageCompositionV2Schema,Q_ as SiteEditPageCompositionV2SourceMemberSchema,og as SiteEditPageCompositionV2SupportedSchema,ag as SiteEditPageCompositionV2UnsupportedSchema,ng as SiteEditPageCompositionV2WriteModeSchema,ig as SiteEditPageCompositionVisualAnchorSchema,B_ as SiteEditPagePlacementOptionSchema,gc as SiteEditPagePlacementSchema,fc as SiteEditPageUnitResultTargetSchema,Sc as SiteEditPageUnitTargetSchema,df as SiteEditPatchPlanPatchSchema,Hv as SiteEditPatchPlanSchema,jo as SiteEditPropertiesSchema,no as SiteEditPropertyChangeSchema,mf as SiteEditPropertyCreationSchema,rf as SiteEditPropertyItemSchema,of as SiteEditPropertyResolutionSchema,af as SiteEditPropertySourceSchema,cf as SiteEditPropertySpreadSchema,$n as SiteEditProvenanceChainSchema,Pf as SiteEditProvenanceHopSchema,_D as SiteEditRenderDocumentSchema,Hn as SiteEditRenderEntryRefSchema,kf as SiteEditRenderEntrySchema,xm as SiteEditRenderPageCompositionSchema,Sf as SiteEditRenderPageCompositionSupportedSchema,ff as SiteEditRenderPageCompositionUnsupportedSchema,hf as SiteEditRenderPagePlacementSchema,T1 as SiteEditRequiredMutationContextEnvelopeSchema,j0 as SiteEditResolveSourceLocationInputSchema,km as SiteEditSemanticSourceSchema,dc as SiteEditSetPropsParamsSchema,V1 as SiteEditSignedOperationRequestSchema,Sr as SiteEditSourceDeleteCapabilitySchema,Zd as SiteEditSourceDirectoryPathSchema,su as SiteEditSourceFileBinaryPreviewUnavailableReasonSchema,iu as SiteEditSourceFileBinaryResponseSchema,C0 as SiteEditSourceFileKindSchema,Jd as SiteEditSourceFileListItemSchema,N0 as SiteEditSourceFileResponseSchema,nu as SiteEditSourceFileTextResponseSchema,so as SiteEditSourceIdentitySchema,ou as SiteEditSourceLocationRangeSchema,L0 as SiteEditSourceLocationSchema,Cf as SiteEditSourceLocatorRangeSchema,Uo as SiteEditSourceLocatorSchema,Re as SiteEditSourcePathSchema,Sg as SiteEditSourceSiblingMoveTargetSchema,fr as SiteEditSourceTreeNodeSchema,v0 as SiteEditSourceTreeResponseSchema,eu as SiteEditSourceTreeTruncationReasonSchema,tu as SiteEditSourceTreeTruncationSchema,Ic as SiteEditStyleBreakpointSchema,uc as SiteEditStyleDraftPropertySchema,hD as SiteEditStyleModelSchema,Ec as SiteEditStylePropertySchema,Am as SiteEditStyleSourceSchema,Rc as SiteEditStyleStateModeSchema,Mo as SiteEditTextSegmentSchema,Tm as SiteEditTextSourceSchema,Af as SiteEditWriteTargetSchema,aj as SiteExtraRequirementResponseSchema,sy as SiteExtraRequirementSchema,YC as SiteGenerationLedgerResponseSchema,k as SiteIdSchema,Db as SiteLauncherPermissionSchema,Ie as SiteLocaleSchema,QG as SiteMediaIntentSchema,hk as SiteOperationLockIdSchema,Eb as SitePreviewActivateErrorCodeSchema,Ib as SitePreviewActivateFailedSchema,Rb as SitePreviewActivateReadySchema,NO as SitePreviewActivateResponseSchema,JM as SitePublishDomainCheckDataSchema,ZM as SitePublishDomainCheckRequestSchema,eU as SitePublishDomainCheckResponseSchema,tU as SitePublishDomainOperationDataSchema,nU as SitePublishDomainOperationResponseSchema,sU as SitePublishDomainReconcileOperationResponseSchema,iU as SitePublishDomainRemediationConfirmRequestSchema,oU as SitePublishDomainRemediationConfirmResponseSchema,gi as SitePublishQualityTaskStatusSchema,vM as SitePublishRepairInputItemSchema,TE as SitePublishRepairResultItemSchema,Vl as SitePublishRepairResultSchema,DM as SitePublishRepairTaskSnapshotSchema,Hl as SitePublishRepairTaskStatusSchema,LM as SitePublishWorkflowActiveResponseSchema,ms as SitePublishWorkflowIdSchema,AE as SitePublishWorkflowMutationDataSchema,MM as SitePublishWorkflowMutationResponseSchema,PE as SitePublishWorkflowPublishDataSchema,UM as SitePublishWorkflowPublishResponseSchema,wE as SitePublishWorkflowQualityDataSchema,FM as SitePublishWorkflowQualityResponseSchema,Dt as SitePublishWorkflowRecordSchema,jM as SitePublishWorkflowRevisionRequestSchema,fE as SitePublishWorkflowStatusSchema,bE as SitePublishWorkflowStepSchema,jt as SiteRecordSchema,fk as SiteTemplateUpgradeStateIdSchema,Wq as SiteThreadListQuerySchema,Bq as SiteThreadListResponseSchema,Hq as SiteThreadResponseSchema,Xa as SiteVersionIdSchema,yI as SiteVersionListItemSchema,Ri as SiteVersionRecordSchema,it as SiteWorkflowIdSchema,Cb as SiteWorkflowProgressDataSchema,GO as SiteWorkflowProgressResponseSchema,kb as SiteWorkflowProgressStatusSchema,wb as SiteWorkflowProgressStepSchema,Pb as SiteWorkflowProgressStepStatusSchema,Hg as SiteWorkflowRecordSchema,fP as SiteWorkflowSnapshotResponseSchema,po as SiteWorkflowSnapshotSchema,Ug as SiteWorkflowStatusSchema,Za as SiteWorkflowTaskRefIdSchema,bP as SiteWorkflowTaskRefResponseSchema,Fc as SiteWorkflowTaskRefSchema,aq as SitemapAddBlockInputSchema,Wa as SitemapAnswerSchema,iq as SitemapChangeBlockVariantInputSchema,iT as SitemapDeleteBlockInputSchema,zI as SitemapDraftBlockSchema,HI as SitemapDraftPageSchema,nd as SitemapDraftRecordSchema,gn as SitemapDraftSchema,sT as SitemapEditActorSchema,rT as SitemapEditErrorCodeSchema,mT as SitemapEditFailureSchema,aT as SitemapEditOperationSchema,cq as SitemapEditResultSchema,cT as SitemapEditSuccessSchema,lq as SitemapGenerationInputSchema,_T as SitemapGenerationOutcomeSchema,gT as SitemapGenerationReasonSchema,Xp as SitemapGenerationStageSchema,Ae as SitemapIdSchema,lT as SitemapIntentPageSchema,nq as SitemapModelOutputSchema,VI as SitemapModelPageSchema,sq as SitemapMoveBlockInputSchema,BI as SitemapNavigationHrefSchema,Ge as SitemapNodeIdSchema,td as SitemapRecordSchema,eq as SitemapResolverRequestSchema,tq as SitemapResolverResponseSchema,nT as SitemapResolverTargetsSchema,Yp as SitemapRunInputSchema,yn as SitemapSchema,XI as SitemapSourceProvenanceSchema,pq as SitemapStreamEventSchema,UL as SitemapTaskCreateRequestSchema,BL as SitemapTaskCreateResponseSchema,Nx as SitemapTaskFailureErrorCodeSchema,KL as SitemapTaskResponseSchema,oT as SitemapUpdateBlockInstructionInputSchema,oq as SitemapUpdateBlockPropsInputSchema,PI as SitemapUserChoiceSchema,bn as SkillSelectionSchema,CI as SkillSelectionSourceSchema,ld as SnapshotContentHashSchema,Cd as SnapshotEditChangesSchema,wd as SnapshotEditPageChangeSchema,Pd as SnapshotEditSectionChangeSchema,De as SnapshotFilePathSchema,I as SnapshotIdSchema,xt as SnapshotRecordSchema,Up as SnapshotStatusSchema,XC as StartFillInRequestSchema,lG as StartFillInResponseSchema,oR as StartGa4AuthDataSchema,kU as StartGa4AuthRequestSchema,AU as StartGa4AuthResponseSchema,xa as StartGscAuthDataSchema,Xl as StartGscAuthRequestSchema,Ql as StartGscAuthResponseSchema,wP as StartSiteBuildRequestSchema,nN as StartSiteBuildResponseSchema,Ub as StartSiteBuildResultSchema,OM as StartSitePublishWorkflowRequestSchema,Mq as StartWorkspaceRunRequestSchema,Uq as StartWorkspaceRunResponseSchema,$c as Step2AiCrawlabilityAssessmentSchema,Ih as Step2FinalResultDataSourceSchema,Ms as Step2FinalResultRequestSchema,Sw as Step2FinalResultResponseSchema,hw as Step2FinalResultSaveResponseSchema,Rh as Step2FinalResultSaveResultSchema,bo as Step2FinalResultTypeSchema,kh as Step2FinalResultViewSchema,Hc as Step2FinalScanCardKeySchema,yo as Step2FinalScanCardSchema,Eh as Step2FinalScanResultSchema,Vn as Step2KnowledgeOpaqueIdSchema,cN as Step2KnowledgeScopeSchema,Tt as Step2PageRoleSchema,yw as Step2PageSelectionRequestSchema,xw as Step2PageSelectionResponseSchema,bh as Step2SiteInitializationCrawlerErrorCodeSchema,fh as Step2SiteInitializationStatusSchema,gw as Step2SiteInitializationTaskResponseSchema,yh as Step2SiteInitializationTaskSchema,xo as Step3AgentAnalysisSchema,Oh as Step3AnalysisFindingSchema,Pw as Step3AnalysisJobResponseSchema,Qc as Step3AnalysisJobSchema,Yc as Step3AnalysisJobStatusSchema,ww as Step3AnalysisLatestResponseSchema,Vc as Step3AnalysisProgressSchema,Lh as Step3AnalysisResultSchema,Aw as Step3AnalysisScheduleResponseSchema,Dh as Step3AnalysisScheduleSchema,Cw as Step3AnalysisSseFrameSchema,Tw as Step3AnalysisStartRequestSchema,Xc as Step3AnalysisSummarySchema,vh as Step3AnalystSchema,kw as Step3AnalystsResponseSchema,Nw as Step4DiagnosisResponseSchema,Ts as Step5ActiveStrategyKeySchema,rA as Step5CommitStrategyRequestSchema,cA as Step5CommitStrategyResponseSchema,Mu as Step5CommittedVersionSchema,Dn as Step5DecisionSelectionIdSchema,Du as Step5EvidenceReferenceSchema,Ou as Step5GenerationStatusSchema,ju as Step5JobStatusSchema,xs as Step5KeywordCategorySchema,Au as Step5KeywordEntryEditSchema,Cn as Step5KeywordEntrySchema,Li as Step5KeywordLibrarySchema,X0 as Step5KeywordSearchBodySchema,Es as Step5KeywordSelectionSchema,Ps as Step5MarketCountrySchema,As as Step5MarketTypeSchema,Tr as Step5OptionPresentationSchema,Ui as Step5OutputLocaleSchema,wu as Step5PromotedBusinessSchema,ws as Step5PromotedBusinessesSchema,iA as Step5RegenerateItemRequestSchema,oA as Step5SaveDecisionRequestSchema,aA as Step5SaveDecisionResponseSchema,pT as Step5SitemapDecisionSchema,uT as Step5SitemapRunInputSchema,dT as Step5SitemapSourceSchema,mq as Step5SitemapStartRequestSchema,nA as Step5StartStrategyRequestSchema,sA as Step5StartStrategyResponseSchema,Nu as Step5StrategyDecisionInputSchema,Gi as Step5StrategyDecisionSchema,Fi as Step5StrategyItemSchema,wr as Step5StrategyJobSchema,ks as Step5StrategyKeySchema,Ar as Step5StrategyOptionIdSchema,Cu as Step5StrategyOptionSchema,Pr as Step5StrategyPlanSchema,Uu as Step5StrategySnapshotDataSchema,lA as Step5StrategySseFrameSchema,Lu as Step5StrategyVersionSnapshotSchema,vu as Step5StructureDetailSchema,Yb as Step6AiThemeCandidateSchema,Js as Step6ColorSeedsSchema,XN as Step6DesignAgentRecommendationsResponseSchema,BN as Step6DesignRecommendationGenerationInputSchema,Yo as Step6DesignRecommendationModelOutputSchema,Xb as Step6DesignRecommendationSchema,FN as Step6DesignRecommendationsRequestSchema,GN as Step6DesignRecommendationsResponseSchema,$m as Step6DesignSelectionSchema,Hm as Step6GeneratedThemeCardSchema,ty as Step6GptDesignRecommendationModelOutputSchema,$C as StopWorkspaceGenerationRequestSchema,VC as StopWorkspaceGenerationResponseSchema,QD as SubsiteCopyEstimateRequestSchema,ZD as SubsiteCopyEstimateResponseSchema,ob as SubsiteDiffEstimateShape,BD as SubsiteGlossariesSchema,Qf as SubsiteGlossaryEntrySchema,Ys as SubsiteHexColorSchema,pO as SubsiteMountPathSchema,ib as SubsitePageEstimateSchema,zD as SubsitePaletteLocalizationSchema,Zf as SubsitePaletteModeSchema,Jf as SubsitePaletteSeedsSchema,KD as SubsiteSiteInfoSchema,tO as SubsiteSyncDiffComputeRequestSchema,nO as SubsiteSyncDiffComputeResponseSchema,rb as SubsiteSyncDiffErrorCodeSchema,sO as SubsiteSyncDiffErrorResponseSchema,rO as SubsiteVisibleTextExportRequestSchema,cO as SubsiteVisibleTextExportResponseSchema,Ng as TASK_EXECUTION_STATUSES,Mc as TASK_EXECUTION_STATUS_CODES,AG as TEMPLATE_UPGRADE_LOCK_LOST_ERROR_CODE,$o as THEME_PRESETS,Gm as THEME_PRESET_IDS,Oc as TaskExecutionStatusSchema,bb as TemplateUpgradeCasOutcomeSchema,vm as TemplateUpgradeErrorCodeSchema,yb as TemplateUpgradeOutcomeCountsSchema,Sb as TemplateUpgradeOutcomeSchema,xb as TemplateUpgradeSnapshotDeletionCandidateSchema,pn as TemplateUpgradeStateSchema,ub as TemplateUpgradeStatusSchema,fb as TemplateUpgradeValidationStageSchema,Ze as TemplateVersionSchema,RG as TryAcquireTemplateUpgradeLockRequestSchema,IG as TryAcquireTemplateUpgradeLockResponseSchema,xS as TypeInputsSchema,Bf as USER_STOPPED_RUN_ERROR_CODES,xp as UnsplashDownloadLocationSchema,yp as UnsplashMediaAssetSchema,VF as UpdateBriefRequestSchema,cG as UpdateBriefResponseSchema,Rq as UpdateClarifyArchetypeRequestSchema,qA as UpdateCmsSeoSyncStateRequestSchema,hG as UpdateCurrentSnapshotManifestRequestSchema,FA as UpdatePageDirectoryReconcileStateRequestSchema,NM as UpdateSitePublishWorkflowStepRequestSchema,$F as UpdateSiteRequestSchema,zq as UpdateSiteThreadRequestSchema,xP as UpdateSiteWorkflowWebsiteRequestSchema,qN as UpdateStep6DesignSelectionRequestSchema,WN as UpdateStep6DesignSelectionResponseSchema,kP as UpdateWorkflowTaskStatusRequestSchema,FR as UploadMediaLibraryAssetResponseSchema,xM as UpstreamPromptTemplateCatalogDataSchema,yM as UpstreamPromptTemplateConsumeDataSchema,Rx as UrlListCrawlerTaskCreateRequestSchema,bk as UsageRecordIdSchema,KR as UseUnsplashMediaRequestSchema,zR as UseUnsplashMediaResponseSchema,ck as UserIdSchema,KE as VCP_GSC_STATES,ya as VcpGscStateSchema,xE as VcpQualityRemediationItemSchema,zl as VcpQualityResultSchema,Da as VisualHintsSchema,AI as VisualThemeSchema,uS as WEIGHT_STYLE_IDS,om as WEIGHT_STYLE_PRESETS,SP as WORKFLOW_DEFINITIONS_V1,lo as WORKFLOW_DEFINITION_REGISTRY,vg as WORKFLOW_FLOW_TYPES,Fg as WORKFLOW_MENU_STATES,Dg as WORKFLOW_NODE_CODES,Og as WORKFLOW_TASK_TYPES,VP as WORKSPACE_ATTACHMENT_BOUND_ERROR_CODE,tw as WORKSPACE_ATTACHMENT_CAPTURE_BUDGET_ERROR_CODE,JP as WORKSPACE_ATTACHMENT_CAPTURE_BUSY_ERROR_CODE,ZP as WORKSPACE_ATTACHMENT_CAPTURE_FAILED_ERROR_CODE,ew as WORKSPACE_ATTACHMENT_CAPTURE_TIMEOUT_ERROR_CODE,nw as WORKSPACE_ATTACHMENT_CAPTURE_UNAVAILABLE_ERROR_CODE,$P as WORKSPACE_ATTACHMENT_LIMIT_ERROR_CODE,ph as WORKSPACE_ATTACHMENT_MEDIA_TYPES,KP as WORKSPACE_ATTACHMENT_TARGET_BASE64_BYTES,HP as WORKSPACE_ATTACHMENT_TOO_LARGE_ERROR_CODE,BP as WORKSPACE_ATTACHMENT_UNBOUND_TTL_MS,zP as WORKSPACE_ATTACHMENT_UNSUPPORTED_FORMAT_ERROR_CODE,QP as WORKSPACE_ATTACHMENT_URL_REJECTED_ERROR_CODE,OC as WORKSPACE_CHECK_INCOMPLETE_ERROR_CODE,Hx as WORKSPACE_FILE_MUTATION_TOOL_NAMES,jC as WORKSPACE_FILL_IN_INTERRUPTED_ERROR_CODE,NC as WORKSPACE_GENERATION_STOPPED_ERROR_CODE,vC as WORKSPACE_MAX_PAGE_ATTEMPTS,CC as WORKSPACE_MAX_RESUME_COUNT,wC as WORKSPACE_RUN_HEARTBEAT_INTERVAL_MS,PC as WORKSPACE_RUN_LEASE_MS,LC as WORKSPACE_RUN_LEASE_SUPERSEDED_ERROR_CODE,MC as WORKSPACE_RUN_NOT_ACTIVE_ERROR_CODE,DC as WORKSPACE_RUN_RESUME_EXHAUSTED_ERROR_CODE,XP as WORKSPACE_URL_CAPTURE_WINDOW_MS,Qq as WORKSPACE_WEBSOCKET_CONTRACT,We as WeightStyleIdSchema,vc as WorkflowClientCapabilitiesSchema,Uc as WorkflowDefinitionVersionSchema,sn as WorkflowFlowTypeSchema,zg as WorkflowMenuItemSchema,Gg as WorkflowMenuStateSchema,It as WorkflowNodeCodeSchema,Dc as WorkflowTaskTypeSchema,iw as WorkspaceAttachmentFromUrlRequestSchema,So as WorkspaceAttachmentMediaTypeSchema,sw as WorkspaceAttachmentSchema,WT as WorkspaceClientMessageSchema,YR as WorkspaceDesignApplyRequestSchema,XR as WorkspaceDesignApplyResponseSchema,QR as WorkspaceDesignCurrentResponseSchema,Ka as WorkspaceDiagnosticSchema,QT as WorkspaceDirectEditFileSchema,XT as WorkspaceDirectEditPathSchema,_d as WorkspaceDirectEditPostActionSchema,e2 as WorkspaceDirectEditRequestSchema,n2 as WorkspaceDirectEditResponseSchema,za as WorkspaceExecutionDiagnosticsSchema,kq as WorkspaceExecutionPlanSchema,gr as WorkspaceGenerationLedgerEventSchema,Pn as WorkspaceGenerationLedgerSchema,YT as WorkspaceMediaRequestSchema,Ld as WorkspaceOmissionKindSchema,Md as WorkspaceOmissionReasonSchema,_r as WorkspaceOmissionSchema,gm as WorkspacePageCheckpointSchema,Fd as WorkspacePageOutcomeSchema,Ud as WorkspacePageResultSchema,Va as WorkspacePlanDependencySchema,od as WorkspacePlanSummarySchema,TT as WorkspacePlanTaskKindSchema,$a as WorkspacePlanTaskSchema,kg as WorkspaceResourceKindSchema,Pg as WorkspaceResourceNavigationSelectionSchema,Cc as WorkspaceResourceOperationClientMessageSchema,rd as WorkspaceResourceOperationCompletionSchema,Ag as WorkspaceResourceOperationSummarySchema,wg as WorkspaceResourceOperationTransientInputSchema,Os as WorkspaceResourcePageCopySchema,zC as WorkspaceRunControlInputResponseSchema,qC as WorkspaceRunHeartbeatRequestSchema,WC as WorkspaceRunHeartbeatResponseSchema,Ii as WorkspaceRunKindSchema,MS as WorkspaceRunResumePrincipalSchema,qT as WorkspaceSelectedComponentSchema,KT as WorkspaceServerMessageSchema,rq as WorkspaceSitemapEditRequestSchema,GT as WorkspaceSocketDescriptorSchema,sk as WorkspaceSourceFileBinaryResponseSchema,tk as WorkspaceSourceFileKindSchema,hd as WorkspaceSourceFileListItemSchema,s2 as WorkspaceSourceFilePathQuerySchema,i2 as WorkspaceSourceFileResponseSchema,nk as WorkspaceSourceFileTextResponseSchema,gd as WorkspaceSourcePathSchema,bT as WorkspaceSuggestionSchema,sd as WorkspaceSuggestionsSchema,yT as WorkspaceSuggestionsSourceSchema,ad as WorkspaceTaskCountsSchema,Xq as WorkspaceWebSocketMessageSchema,Yq as WorkspaceWebSocketMessageTypeSchema,Ha as WorkspaceWorkerGroupSchema,Ba as WorkspaceWorkerPhaseSchema,Aq as WorkspaceWorkerResultSchema,Vt as WorkspaceWorkerStatusSchema,xj as applicationTemplateCatalogDataSchema,yj as applicationTemplateConsumeDataSchema,bj as applicationTemplateV1Schema,Ww as assertDeploymentTransition,FU as assertFillInTargetsOmitted,NP as assertSiteBuildStatusTransition,OP as assertTaskExecutionStatusTransition,wo as availableFontWeights,HS as breadcrumbClassName,DL as buildCmsIdentityHeaders,MU as buildE2bBrowserPreviewUrl,WM as buildFinalSitePublishQualityResult,KN as buildStep6FallbackThemeCards,zO as canEnterLauncher,HO as canPublishSite,ua as canonicalizeFormDesignJson,EM as canonicalizeLauncherPromptTemplateOperation,rc as canonicalizePageSlug,yC as checkGlobalsCssEdit,to as classifySiteEditPropertyName,PA as cmsPagePreviewUrlPath,uA as compareTemplateVersions,Vv as composeSiteEditRepeatInstanceKey,pL as computeFormDesignOperationFingerprint,Ci as computeSiteEditCompositionKey,U_ as computeSiteEditSourceIdentityKey,rs as containsSensitiveData,s0 as countLedgerAccessiblePages,i0 as countLedgerProcessedPages,PR as countSitemapStructure,P_ as createSiteEditCommandFailureSchema,cc as createSiteEditCommandResultSchema,Ji as createSiteEditCommandSuccessSchema,_q as createSiteSitemapDraftCreationKey,pw as createSitemapResolverAnswerSheetSchema,HN as defaultStep6Selection,$E as deriveVcpGscState,VE as doesGscPropertyMatchDomain,DR as estimateNavLabelWidth,Qg as findWorkflowDefinition,Xg as findWorkflowDefinitionInRegistry,ko as fontStack,rx as formDesignOperationFingerprintInput,RS as formatSiteDesignNotes,uv as generateDetailBreadcrumb,Bw as getDeploymentHappyPathTransitions,Gw as getDeploymentTransitionPredecessors,Fw as getDeploymentTransitionTargets,im as getFontPairing,Fm as getMotionPreset,_i as getQualityCheckOutcome,Bm as getSiteDesignThemeRadius,Oi as getSiteEditSourceDeleteProtectionReason,GM as getSitePublishRepairItems,KM as getSitePublishSafetyAssessment,PN as getThemePreset,Zg as getWorkflowDefinition,vP as getWorkflowNodeIndex,Vk as hasAnyBusinessFact,zn as hasDesignTokenBlock,$D as hasLockedSeeds,lL as hashAffectedFormDesignFiles,mL as hashCmsFormSchemaProjection,ri as hashFormDesignJson,cL as hashFormSpec,RR as homeLabelForLocale,pM as isCanonicalFileMutationToolName,oc as isCanonicalPageSlug,Ob as isCmsMainProductsWithinLimit,ZR as isCmsNavigationHref,AA as isCmsPageSelectable,Ur as isCmsTemplateUrlPath,_0 as isConsentGranted,Zh as isDeploymentActiveStatus,qw as isDeploymentTerminalStatus,Hf as isExactEditEngineVersion,kk as isExternalSiteEditInfrastructureReason,vD as isFontLicenseBuildErrorCode,zj as isFormSpecLocalizableFieldPath,mA as isKnownStep5SseEventName,pv as isMigrationProductsPresetBlockLabel,lv as isMigrationProductsPresetPageTitle,$x as isModelFileMutationToolName,_u as isNextPageCodeErrorCode,z0 as isNonLatinSiteLocale,ps as isPageTemplateCandidateEntryPath,IL as isPlatformMaterializedFile,db as isReservedSubsiteMountSegment,ru as isSiteEditDesignDocumentPath,Ku as isSiteEditMaterializationPathTemplate,Uf as isSiteEditRuntimeContainerTag,Ff as isSiteEditRuntimeTextTag,ED as isSiteEditRuntimeVoidElementTag,M0 as isSiteEditSourceDeleteProtectedPath,au as isSiteEditSourceDirectoryPath,br as isSiteEditSourcePath,Di as isSiteEditTextSourcePath,vE as isSitePublishQualityItemIssue,qM as isSitePublishRepairResultSuccessful,bL as isSiteStructureKnownFieldPath,fL as isSiteStructureLocalizableFieldPath,tA as isStep5RequiredStrategyKey,Si as isTopLevelPage,DD as isUserStoppedRunErrorCode,DP as isWorkflowTaskTypeForNode,lM as isWorkspaceFileMutationToolName,ap as listChildPages,_f as makeSiteEditRepeatInstanceKey,TR as markAllPagesInHeader,Jj as mergeCmsFormDisplay,cv as migrationProductsCopyForLocale,mv as migrationProductsKnownCopies,IR as moreLabelForLocale,OR as navLabelCollisionKey,wj as normalizeCmsApplicationSlug,xx as normalizeCmsPublicApiBase,pl as normalizeFormOptionLabelIdentity,os as normalizeGscDomain,cr as normalizePageTemplatePagePath,hi as normalizeStructureTitle,AR as orderNavigationLinksByStructure,rp as orderSitemapPagesForDisplay,k_ as pageSlugToRouteFilePath,wA as parseCmsPageDirectory,ev as parseComponentI18nResourcesJson,bR as parseE2bPreviewProxyDomain,$f as parseExactEditEngineVersion,T0 as parseSiteEditCompositionKey,gf as parseSiteEditRepeatInstanceKey,P1 as parseSiteEditSourceIdentityKey,fo as parseWorkspaceAttachmentImagePath,Zj as projectFormSpecToCmsDisplay,Qj as projectFormSpecToCmsSchema,NS as readColorScheme,Gs as readDesignTokens,hC as readGlobalsDesignValues,cm as readSiteDesignNotes,aw as readWorkspaceAttachmentReferences,yR as reconcileSitemapNavigation,CL as resolveCmsPublicRuntimeBinding,iS as resolveFont,on as resolveFontDisplayName,Xj as resolveFormTemplateText,CP as resolvePublishedWorkflowDefinition,e0 as resolveRedisConnectionConfig,FD as resolveRequestedEditEngineVersion,Ir as resolveSelectableSiteLocale,RD as resolveSiteEditRuntimeOperationSummary,K0 as resolveSiteLocaleFromIso6393,B0 as resolveSiteTextDirection,Zb as resolveStep6RadiusId,Jb as resolveStep6WeightStyle,GD as resolveSystemCurrentEditEngineVersion,Dj as resolveTemplateFormScene,iC as resolveTryOnFontWeights,Jg as selectPublishedWorkflowDefinition,x0 as selectReferenceVisualImage,mP as siteBuildStatusFromCode,uP as siteBuildStatusToCode,lP as siteDeploymentStatusFromCode,_P as siteDeploymentStatusToCode,pS as siteFontVariables,bS as siteLeadingBody,sC as siteLeadingHeadingVariables,nC as siteWeightVariables,pP as siteWorkflowStatusFromCode,gP as siteWorkflowStatusToCode,Xf as splitSubsiteGlossaryEntry,ey as step6GptVisualIdentity,cC as stripSiteDesignNotes,Yv as stripSiteEditRepeatInstanceKeys,dP as taskExecutionStatusFromCode,hP as taskExecutionStatusToCode,zN as toStep6GenerationVisualHints,ac as tryCanonicalizeAsciiPageSlug,mC as upsertSiteDesignNotes,bm as validateComponentI18nResources,Hj as validateFormSpecIdentityTransition,wR as validateSitemapStructure,ab as validateSubsiteDiffEstimates,tP as validateWorkspaceResourcePageCopy,ow as workspaceAttachmentImagePath,gC as writeColorScheme,_C as writeDesignTokens};
|
|
68
|
+
`}import{z as ln}from"zod";var Av="SITE_HAS_ACTIVE_SUBSITES",Pv="SITE_HAS_SUBSITES",ef=ln.object({site_id:k,name:ln.string().min(1),mount_path:ln.string().min(1),archived_at:ln.string().nullable()}),wv=ln.object({subsites:ln.array(ef)});import{z as we}from"zod";var Ov=we.object({key:we.string().min(1),composition:ge}).strict(),$s=we.enum(["component-boundary","repeat-region","conditional-region","fragment-region","opaque-region"]),tf=we.enum(["direct","proxy","upstream","readonly","unsupported"]),nf=we.enum(["component-boundary","repeat-region","conditional-region","opaque-region","void-element","read-only","cross-file-required","import-required"]),Hs=we.object({mode:tf,reasonCode:we.string().min(1).optional()}),sf=we.object({kind:nf,message:we.string().min(1)}),Vs=we.object({composition:K,key:we.string().min(1),canUpdateText:we.boolean(),canInsertChild:we.boolean(),canMove:we.boolean(),canRemove:we.boolean(),editModes:we.object({updateText:Hs.optional(),insertChild:Hs.optional(),move:Hs.optional(),remove:Hs.optional()}).optional(),constraints:we.array(sf)}).strict();import{z as X}from"zod";var Gv=X.discriminatedUnion("type",[X.object({type:X.literal("site-edit.document.changed"),siteId:k,snapshotId:I,composition:K,version:X.number().int().nonnegative(),at:X.string().min(1)}).strict(),X.object({type:X.literal("site-edit.operation.planned"),siteId:k,operationId:X.string().min(1),baseSnapshotId:I,composition:K,changedFiles:X.array(X.string().min(1)),at:X.string().min(1)}).strict(),X.object({type:X.literal("site-edit.operation.completed"),siteId:k,composition:K,result:ro,at:X.string().min(1)}).strict(),X.object({type:X.literal("site-edit.operation.failed"),siteId:k,composition:K,requestId:X.string().min(1),error:vc,at:X.string().min(1)}).strict(),X.object({type:X.literal("site-edit.capability.changed"),siteId:k,composition:K,keys:X.array(X.string().min(1)),at:X.string().min(1)}).strict(),X.object({type:X.literal("site-edit.graph.invalidated"),siteId:k,composition:K,at:X.string().min(1)}).strict(),X.object({type:X.literal("site-edit.graph.ready"),siteId:k,composition:K,version:X.number().int().nonnegative(),at:X.string().min(1)}).strict(),X.object({type:X.literal("site-edit.graph.error"),siteId:k,composition:K,message:X.string().min(1),at:X.string().min(1)}).strict(),X.object({type:X.literal("site-edit.snapshot.changed"),siteId:k,composition:K,snapshotId:I,previousSnapshotId:X.string().min(1).nullable(),at:X.string().min(1)}).strict()]);import{z as ce}from"zod";var Kv="durable-history-v1",Ys=ce.object({initiatingComposition:K.optional(),affectedCompositions:ce.array(K)}).strict(),zv=ce.enum(["writable","read-only-recovery","unavailable"]),of=ce.enum(["INDEX_CORRUPT","ENTRY_MISSING","BLOB_MISSING","FILESYSTEM_UNAVAILABLE","ROLLBACK_INCOMPLETE","UNKNOWN"]),af=ce.object({code:of,message:ce.string().min(1),occurredAt:ce.iso.datetime().optional()}).strict(),rf=ce.enum(["NOT_INITIALIZED","FILESYSTEM_UNAVAILABLE","UNSUPPORTED_RUNTIME"]),Im={revision:ce.number().int().nonnegative(),undoDepth:ce.number().int().nonnegative(),redoDepth:ce.number().int().nonnegative()},cf=ce.object({mode:ce.literal("writable"),composition:K,...Im,canUndo:ce.boolean(),canRedo:ce.boolean(),provenance:Ys.optional()}).strict().superRefine((e,n)=>{e.canUndo!==e.undoDepth>0&&n.addIssue({code:"custom",path:["canUndo"],message:"canUndo must reflect undoDepth."}),e.canRedo!==e.redoDepth>0&&n.addIssue({code:"custom",path:["canRedo"],message:"canRedo must reflect redoDepth."})}),mf=ce.object({mode:ce.literal("read-only-recovery"),composition:K,...Im,canUndo:ce.literal(!1),canRedo:ce.literal(!1),recoveryDiagnostic:af,provenance:Ys.optional()}).strict(),lf=ce.object({mode:ce.literal("unavailable"),composition:K,revision:ce.literal(0),undoDepth:ce.literal(0),redoDepth:ce.literal(0),canUndo:ce.literal(!1),canRedo:ce.literal(!1),reason:rf,provenance:Ys.optional()}).strict(),pf=ce.discriminatedUnion("mode",[cf,mf,lf]),Hv=ce.object({composition:K,status:pf,provenance:Ys}).strict();import{z as V}from"zod";var Xs=V.enum(["api-field","cms-field","i18n-message","config-entry"]),Mo=V.object({kind:V.enum(["jsx-node","value-path","route-export","external-entry"]),file:V.string().min(1).optional(),isProxy:V.boolean(),displayPath:V.string().min(1).optional(),sourceType:Xs.optional(),sourceId:V.string().min(1).optional()}),df=V.discriminatedUnion("status",[V.object({status:V.literal("resolved"),value:Kt}).strict(),V.object({status:V.literal("undefined")}).strict(),V.object({status:V.literal("unresolved")}).strict()]),uf=V.object({kind:V.enum(["literal","boolean-shorthand","expression","binding","repeat-template"]),raw:V.string().optional()}).strict(),_f=V.object({name:V.string().min(1),source:uf,resolution:df,editMode:V.enum(["direct","proxy","upstream","readonly","unsupported"]),sourceScope:V.enum(["node","repeat-item","repeat-template"]),allowedWriteScopes:V.array(V.enum(["selection","template"])),effectiveWriteTarget:Mo.optional(),diagnostics:V.array(V.object({code:V.string().min(1),message:V.string().min(1)}).strict())}).strict(),gf=V.object({raw:V.string().min(1),sourceRange:ut,order:V.number().int().nonnegative(),diagnostics:V.array(V.object({code:V.string().min(1),message:V.string().min(1)}).strict())}).strict(),hf=V.object({selection:V.enum(["direct","materialize","unsupported"]),template:V.enum(["direct","unsupported"])}).strict(),Uo=V.object({documentVersion:V.number().int().nonnegative(),selectionRef:sn.optional(),items:V.array(_f),spreads:V.array(gf),creation:hf}).strict().superRefine((e,n)=>{let s=e.selectionRef;s&&s.instanceIndex!==void 0&&s.instanceCount!==void 0&&s.instanceIndex>=s.instanceCount&&n.addIssue({code:"custom",path:["selectionRef","instanceIndex"],message:"instanceIndex must be smaller than instanceCount"})});import{z as Ce}from"zod";var Sf=Ce.string().min(1).refine(e=>!e.startsWith("/")&&!e.includes(".."),{message:"Patch paths must be safe relative POSIX paths."}),ff=Ce.string().regex(/^sha256:[a-f0-9]{64}$/),bf=Ce.object({path:Sf,operation:Ce.enum(["create","update","delete"]),expectedHash:ff.optional(),fullContent:Ce.string().optional()}).superRefine((e,n)=>{e.operation==="delete"&&e.fullContent!==void 0&&n.addIssue({code:"custom",path:["fullContent"],message:"delete patches must not include fullContent"}),e.operation!=="delete"&&e.fullContent===void 0&&n.addIssue({code:"custom",path:["fullContent"],message:"create/update patches must include fullContent"})}),yf=Ce.object({siteId:k,baseSnapshotId:I,operationId:Ce.string().min(1),reason:Ce.string().min(1),patches:Ce.array(bf).min(1),changedCompositions:Ce.array(K),changedRouteIds:Ce.array(Ce.string().min(1)).optional(),diagnostics:Ce.array(Ce.object({code:Ce.string().min(1),message:Ce.string().min(1),path:Ce.string().min(1).optional()})).default([])}).strict().superRefine((e,n)=>{let s=new Set;for(let[o,a]of e.patches.entries())s.has(a.path)&&n.addIssue({code:"custom",path:["patches",o,"path"],message:`Duplicate patch path: ${a.path}`}),s.add(a.path);let i=[...new Set(e.changedCompositions.map(o=>o.routeId))];e.changedRouteIds!==void 0&&(e.changedRouteIds.length!==i.length||e.changedRouteIds.some((o,a)=>o!==i[a]))&&n.addIssue({code:"custom",path:["changedRouteIds"],message:"changedRouteIds must be the stable deduplicated route projection of changedCompositions."})}),nD=yf.transform(e=>({...e,changedRouteIds:[...new Set(e.changedCompositions.map(n=>n.routeId))]}));var Fo="::repeat-item#";function xf(e,n){return`${e}${Fo}${n}`}function iD(e,n){return n.reduce((s,i)=>xf(s,i),e)}function Ef(e){if(typeof e!="string"||e.length===0)return null;let n=[],s=e;for(;;){let i=s.lastIndexOf(Fo);if(i<0)break;let o=Number(s.slice(i+Fo.length));if(!Number.isInteger(o)||o<0)return null;n.unshift({repeatIndex:o}),s=s.slice(0,i)}return!s||n.length===0?null:{baseKey:s,parts:n}}function oD(e){return Ef(e)?.baseKey??e??null}import{z as l}from"zod";import{z as Me}from"zod";var Rf=Me.object({placementKey:Me.string().min(1),placementUnitKey:Me.string().min(1),relation:Me.enum(["before","after","prepend","append"])}).strict(),If=Me.object({status:Me.literal("supported"),containerKey:Me.string().min(1),hasBusinessMembers:Me.boolean(),placementUnitKeys:Me.array(Me.string().min(1)),placements:Me.array(Rf)}).strict().superRefine((e,n)=>{let s=new Set(e.placementUnitKeys);s.size!==e.placementUnitKeys.length&&n.addIssue({code:"custom",path:["placementUnitKeys"],message:"Render page composition placement unit keys must be unique."});let i=new Set;e.placements.forEach((o,a)=>{i.has(o.placementKey)&&n.addIssue({code:"custom",path:["placements",a,"placementKey"],message:"Render page composition placement keys must be unique."}),i.add(o.placementKey),s.has(o.placementUnitKey)||n.addIssue({code:"custom",path:["placements",a,"placementUnitKey"],message:"Render page composition placement must reference a projected unit."})})}),Tf=Me.object({status:Me.literal("unsupported"),reason:Ns,diagnostics:Me.array(Fn)}).strict(),Tm=Me.discriminatedUnion("status",[If,Tf]);var kf=l.object({canUpdateText:l.boolean(),canInsertChild:l.boolean(),canMove:l.boolean(),canRemove:l.boolean()}),km=l.enum(["vcp-cms-collection","vcp-cms-form","vcp-cms-settings","vcp-cms-navigation","site-api-route","external-api","unknown-api"]),Af=l.enum(["cms-field","api-field"]),Pf=l.enum(["text","attribute","richtext","repeat-region","conditional-region","component-prop"]),wf=l.enum(["exact","safe-derived","partial","unknown"]),Cf=l.object({file:l.string().min(1),symbol:l.string().min(1).optional(),reason:l.string().min(1)}),vf=l.object({sourceKind:km,sourceType:Af,endpointPattern:l.string().min(1).optional(),operation:l.string().min(1).optional(),collection:l.string().min(1).optional(),fieldPath:l.string().min(1).optional(),valuePath:l.string().min(1).optional(),targetKind:Pf,targetName:l.string().min(1),confidence:wf,readonly:l.literal(!0),evidence:l.array(Cf)}),Am=l.object({hasDynamicData:l.boolean(),bindings:l.array(vf)}),Pm=l.object({hasDynamicData:l.boolean(),sourceKinds:l.array(km),collections:l.array(l.string().min(1)).min(1).optional(),primaryEndpoint:l.string().min(1).optional(),primaryCollection:l.string().min(1).optional(),primaryFieldPath:l.string().min(1).optional()}),Df=l.discriminatedUnion("kind",[l.object({kind:l.literal("route-unit")}).strict(),l.object({kind:l.literal("source-siblings"),siblingKeys:l.array(l.string().min(1)).min(2)}).strict(),l.object({kind:l.literal("unavailable")}).strict()]),Of=l.object({key:l.string().min(1),parentKey:l.string().min(1).nullable().optional(),pageCompositionUnitKey:l.string().min(1).optional(),pageCompositionActionScope:Df.optional(),operationSummary:kf,dynamicDataSummary:Pm.optional()}).strict(),ED=l.object({composition:ge}).strict(),RD=l.object({key:l.string().min(1),composition:ge,selectionRef:sn.optional()}).strict(),ID=l.object({siteId:k,snapshotId:I,composition:K,version:l.number().int().nonnegative(),entries:l.array(Of),pageComposition:Tm}).strict(),wm=l.object({kind:l.enum(["literal","binding","imported-binding","repeat-template"]),file:l.string().min(1),expression:l.string().min(1),bindingName:l.string().min(1).optional(),path:l.array(l.union([l.string(),l.number()])).optional()}),Go=l.object({index:l.number().int().min(0),value:l.string(),editable:l.boolean(),source:wm.nullable()}),$n=l.object({key:l.string().min(1),label:l.string().min(1),tag:l.string().min(1)}),TD=l.object({composition:K,key:l.string().min(1),canUpdateText:l.boolean(),canInsertChild:l.boolean(),canMove:l.boolean(),canRemove:l.boolean(),boundaryKind:$s.nullable(),isOpaque:l.boolean()}).strict(),Nf=l.object({kind:l.enum(["jsx-node","component-proxy","value-binding","route-export"]),file:l.string().min(1),componentName:l.string().min(1),isProxy:l.boolean()}),Cm=l.object({kind:l.union([l.enum(["jsx-literal","component-prop","binding","imported-binding","object-field","array-item","repeat-template","conditional-branch"]),Xs]),file:l.string().min(1),displayPath:l.string().min(1),externalSource:l.object({sourceType:Xs,sourceId:l.string().min(1),adapterId:l.string().min(1).optional()}).optional()}),jf=l.object({kind:Cm.shape.kind,file:l.string().min(1),displayName:l.string().min(1),canEditHere:l.boolean()}),Vn=l.object({finalSource:Cm.nullable(),chain:l.array(jf),confidence:l.enum(["exact","safe-derived","partial","unknown"]),editMode:l.enum(["direct","proxy","upstream","readonly","unsupported"]),diagnostics:l.array(l.object({code:l.string().min(1),message:l.string().min(1)}))}),Lf=l.object({kind:l.literal("css-style-model"),properties:l.array(l.object({property:Tc,value:l.union([l.string(),l.number(),l.boolean(),l.null()]),resolvedValue:l.union([l.string(),l.number(),l.boolean(),l.null()]).optional(),breakpoint:Ac.optional(),state:kc.optional(),variants:l.array(l.string().min(1)).optional(),options:l.array(l.union([l.string(),l.number()])).optional(),editable:l.boolean(),diagnostics:l.array(l.object({code:l.string().min(1),message:l.string().min(1)})).optional(),operationBoundary:l.array(Gn).optional()}))}),kD=l.union([l.record(l.string(),l.unknown()),Lf]),vm=l.object({kind:l.literal("class-name-source"),className:l.string(),sourceKind:l.enum(["missing","static-attribute","static-expression","dynamic-expression"]),editable:l.boolean(),operationBoundary:l.array(Gn),sourcePath:l.string().min(1).optional(),diagnostics:l.array(l.object({code:l.enum(["missing-class-name","dynamic-binding","non-string-binding"]),message:l.string().min(1)})).optional()}),Mf=l.object({startLine:l.number().int().positive(),startColumn:l.number().int().nonnegative(),endLine:l.number().int().positive(),endColumn:l.number().int().nonnegative()}),qo=l.object({sourceFile:l.string().min(1),componentName:l.string().min(1),openingElementRange:Mf,structuralPath:l.string().min(1),textPreview:l.string().min(1).optional()}),Dm=l.enum(["native-anchor","next-link","unsupported"]),AD=l.object({composition:K,key:l.string().min(1),tag:l.string().min(1),linkSourceKind:Dm.optional(),componentName:l.string().min(1),sourceFile:l.string().min(1),sourceLocator:qo.optional(),label:l.string().min(1),capabilities:Vs,writeTarget:Nf,effectiveWriteTarget:Mo.optional(),provenanceChain:Vn.optional(),componentSemantic:l.record(l.string(),l.unknown()).optional(),styleSource:vm.optional(),conditional:l.record(l.string(),l.unknown()).optional(),dynamicData:Am.optional(),properties:Uo.optional(),textSegments:l.array(Go),boundaryKind:$s.nullable(),isOpaque:l.boolean(),ancestors:l.array($n),children:l.array($n),siblings:l.array($n)}).strict(),PD=l.object({composition:K,key:l.string().min(1),tag:l.string().min(1),label:l.string().min(1),sourceLocator:qo.optional(),capabilities:l.object({constraints:Vs.shape.constraints}),isOpaque:l.boolean(),provenanceChain:l.object({editMode:Vn.shape.editMode,diagnostics:Vn.shape.diagnostics}).optional(),dynamicDataSummary:Pm.optional(),ancestors:l.array($n)}).strict(),wD=l.object({composition:K,key:l.string().min(1),tag:l.string().min(1),linkSourceKind:Dm.optional(),label:l.string().min(1),sourceLocator:qo.optional(),isOpaque:l.boolean(),ancestors:l.array($n),componentName:l.string().min(1),sourceFile:l.string().min(1),capabilities:Vs,provenanceChain:l.object({editMode:Vn.shape.editMode,diagnostics:Vn.shape.diagnostics}).optional(),textSegments:l.array(l.object({index:Go.shape.index,editable:Go.shape.editable,sourceKind:wm.shape.kind.nullable()})),dynamicData:Am.optional(),properties:Uo.optional(),boundaryKind:$s.nullable()}).strict(),CD=l.object({composition:K,key:l.string().min(1),styleSource:vm.optional()}).strict();var Uf=["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"],Ff=["article","aside","div","footer","form","header","li","main","nav","ol","section","select","table","tbody","tfoot","thead","tr","ul"],Gf=["a","button","em","h1","h2","h3","h4","h5","h6","label","p","small","span","strong"],qf=new Set(Uf),Wf=new Set(Ff),Bf=new Set(Gf),Kf={canUpdateText:!1,canInsertChild:!1,canMove:!1,canRemove:!1};function DD(e){return qf.has(Wo(e))}function zf(e){return Wf.has(Wo(e))}function Hf(e){return Bf.has(Wo(e))}function OD(e){let{operationSummary:n}=e;return n?{canUpdateText:n.canUpdateText,canInsertChild:n.canInsertChild,canMove:n.canMove,canRemove:n.canRemove}:e.fallbackMode!=="preview"?{...Kf}:{canUpdateText:Hf(e.tagName),canInsertChild:zf(e.tagName),canMove:!1,canRemove:!1}}function Wo(e){return e?.trim().toLowerCase()??""}import{z as $f}from"zod";var UD=$f.object({composition:ge,mutationContext:Mn.optional()}).strict();var GD={PATCH_VALIDATION_FAILED:"The code didn't pass validation. Try describing the change more specifically.",PATCH_BATCH_FAILED:"The site code couldn't be generated. Please regenerate the site.",PATCH_BATCH_INVALID:"The change couldn't be applied. Try simpler instructions.",VALIDATION_FAILED:"Your message couldn't be sent as written. Please edit it and try again.",WORKSPACE_MESSAGE_CONTAINS_SECRET:"Your message looks like it contains a secret or token, so it wasn't sent. Remove it and try again.",WORKSPACE_RUN_INPUT_REQUIRED:"Nothing to work on: the request had no instruction, so no edit was started. Describe the change you want and send it.",WORKSPACE_TOOL_RESULT_INVALID:"This change couldn't be completed and was rolled back. Please try again.",WORKSPACE_TOOL_FAILED:"A tool step failed. Please try again.",WORKSPACE_TOOL_RESULT_MISSING:"The tool didn't return a usable result. Please try again.",WORKSPACE_MODEL_STREAM_FAILED:"The model stream ended unexpectedly. Please try again.",WORKSPACE_MODEL_STREAM_ABORTED:"Generation was interrupted before finishing. Please try again.",MODEL_OUTPUT_TRUNCATED:"The response was too long and was cut off before any change was applied. Try again, or split the request into smaller changes.",WORKSPACE_EDIT_NOT_APPLIED:"No change was applied. Try describing the change differently.",PRODUCT_SEARCH_APPLY_NOT_AVAILABLE:"Product search changes aren't available yet. Please try again later.",WORKSPACE_INITIAL_EXECUTION_FAILED:"Initial generation failed. Please retry from the brief.",WORKSPACE_INITIAL_GENERATION_CHECK_FAILED:"Initial generation could not be verified. Please retry.",WORKSPACE_INITIAL_GENERATION_FINALIZE_FAILED:"Initial generation could not finalize. Please retry.",WORKSPACE_INITIAL_GENERATION_QUALITY_GATE_FAILED:"Initial generation failed quality checks. Please regenerate the site.",WORKSPACE_CHECK_INCOMPLETE:"The check couldn't complete, so no page was delivered this round. Please regenerate the site.",WORKSPACE_RUN_RESUME_EXHAUSTED:"Generation was interrupted several times and stopped. Everything already saved is kept; you can regenerate the missing pages.",WORKSPACE_GENERATION_STOPPED:"You stopped this generation before any page was ready. Nothing was lost \u2014 start it again when you want.",WORKSPACE_FILL_IN_INTERRUPTED:"The fill-in run was interrupted and stopped. Your site is unchanged; select the targets again to retry.",WORKSPACE_RUN_LEASE_SUPERSEDED:"Another attempt took over this run, so this one stopped. Reload to see the current progress.",FILL_IN_NOT_AVAILABLE:"Fill-in is available after the site has been generated.",FILL_IN_TARGET_NOT_OMITTED:"One of the selected items is no longer listed as missing. Reload the omissions list and try again.",FILL_IN_TARGET_MODIFIED:"One of the selected items was changed or removed after generation, so it was not filled in. Your edits are kept.",WORKSPACE_ITERATION_QUALITY_GATE_FAILED:"Quality check failed. The change was rolled back; try a smaller or more specific request.",WORKSPACE_RESOURCE_MATERIALIZATION_FAILED:"The resource couldn't be prepared. Check its file format, dependencies, and target paths before trying again.",DESIGNER_PAGE_RESOURCE_INCOMPATIBLE:"This template contains files or dependencies the page editor doesn't support. Choose another template or adapt the resource package first.",WORKSPACE_SOCKET_DEAD:"The workspace connection was lost. Please retry.",WORKSPACE_RUN_CANCELLED:"The run was cancelled.",WORKSPACE_RUN_ABANDONED:"This run was interrupted and did not finish. Please try again.",WORKSPACE_RUN_REQUEST_FAILED:"Couldn't start the workspace. Please try again.",WORKSPACE_RUN_BAD_RESPONSE:"The server response was malformed. Please try again.",WORKSPACE_SOCKET_UNAVAILABLE:"Workspace connection unavailable. Please try again.",WORKSPACE_SOCKET_ERROR:"The workspace connection had an error. Please try again.",WORKSPACE_SOCKET_CLOSED:"The workspace connection closed. Please try again.",WORKSPACE_SOCKET_OPEN_TIMEOUT:"Couldn't reach the workspace in time. Please try again.",WORKSPACE_CLIENT_MESSAGE_ID_MISSING:"Something went wrong sending your message. Please try again.",SITE_SNAPSHOT_REQUIRED:"This site has no usable snapshot yet. Complete Step 3 first.",AGENT_TIMEOUT:"That took longer than expected. Try breaking the change into smaller pieces.",SANDBOX_NOT_AVAILABLE:"The preview environment isn't ready. Your edits have still been saved.",PREVIEW_BUILD_FAILED:"Preview is available, but the production build failed. Fix the reported build error before deploying.",PREVIEW_BUILD_NOT_CONFIGURED:"Preview is available, but the production build check is not configured.",PREVIEW_BUILD_SANDBOX_NOT_FOUND:"Preview is available, but the build check could not find the active preview sandbox.",BUILD_FONT_METADATA_INVALID:"We couldn't read the font file information. Publishing is blocked until the font file is checked.",BUILD_FONT_LICENSE_UNKNOWN:"We couldn't verify this font's license. Publishing is blocked until its license is confirmed.",BUILD_FONT_LICENSE_CONFLICT:"The font file license conflicts with the verified record. Publishing is blocked until the conflict is resolved.",BUILD_FONT_LICENSE_TEXT_MISSING:"The complete font license text is missing. Publishing is blocked until it is provided.",BUILD_FONT_LICENSE_DELIVERY_FAILED:"We couldn't include the font license files in the deployment. Please try publishing again.",WS_CONNECTION_ERROR:"Connection lost. Reconnecting\u2026",USER_MESSAGE_PERSIST_FAILED:"Your message wasn't saved. Please send it again.",CLARIFICATION_REPLY_STALE:"That question has expired. Please tell me what you'd like to do now.",CLARIFY_MODEL_FAILED:"Clarify couldn't finish generating questions. Please try again.",WORKSPACE_RUN_IN_FLIGHT:"Another session is already running. Please try again in a moment.",SITE_OPERATION_LOCKED:"Another change is already running for this site. Wait for it to finish, then try again.",SITE_SITEMAP_DRAFT_STALE:"The draft was updated elsewhere. Reload the latest draft before saving.",SITE_SITEMAP_DRAFT_OPERATION_MISMATCH:"This save identity belongs to a different draft operation.",WORKSPACE_THREAD_NOT_FOUND:"That conversation no longer exists. Switching back to the default conversation.",WORKSPACE_THREAD_ARCHIVED:"This conversation is archived. Start a new one to continue.",WORKSPACE_THREAD_BUSY:"This conversation is still running. Wait for it to finish before archiving.",WORKSPACE_THREAD_READ_ONLY:"Background conversations are read-only here.",WORKSPACE_THREAD_INVALID:"This conversation can't accept new requests right now. Refresh and try again.",EDIT_ENGINE_VERSION_INVALID:"Invalid editor version. Refresh the page and try again.",SANDBOX_DEPENDENCY_SYNC_FAILED:"The preview runtime could not be prepared. Please try again.",SANDBOX_PREVIEW_FAILED:"The site preview failed to start. Please try again.",SANDBOX_DEPENDENCY_VERSION_MISMATCH:"The preview runtime could not be verified. Please try again.",SANDBOX_RUNTIME_NOT_READY:"The preview needs to be refreshed before this change can be applied. Refresh the preview and try again.",GENERIC:"Something went wrong. Please try again."},Vf=["BUILD_FONT_METADATA_INVALID","BUILD_FONT_LICENSE_UNKNOWN","BUILD_FONT_LICENSE_CONFLICT","BUILD_FONT_LICENSE_TEXT_MISSING","BUILD_FONT_LICENSE_DELIVERY_FAILED"],Yf=new Set(Vf);function qD(e){return typeof e=="string"&&Yf.has(e)}var Xf=["WORKSPACE_RUN_CANCELLED","WORKSPACE_GENERATION_STOPPED"],Qf=new Set(Xf);function WD(e){return typeof e=="string"&&Qf.has(e)}var BD={UNDO_OR_ROLLBACK:"I can't roll back from chat. Use the version history at the top right to pick a restore point.",HISTORY_RECALL:"Tell me what you'd like to change now\u2014I'll work from the current page state.",OUT_OF_SCOPE:"That's outside what I can do from chat. Try the corresponding panel on the right."},KD={CARD_HEADER:"Needs your confirmation",FREE_TEXT_PLACEHOLDER:"Or describe what you'd like instead",SUBMIT_LABEL:"Submit"},zD={SEND_FAILED_RETRY:"Send failed \u2014 tap to retry"};var Om="0.10.32",$D="x-vcp-edit-engine-version",VD="x-vcp-edit-engine-version-source",Bo=class extends Error{constructor(n="Invalid edit-engine version."){super(n),this.code="EDIT_ENGINE_VERSION_INVALID",this.name="EditEngineVersionParseError"}},Zf=/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-[0-9A-Za-z]+(?:\.[0-9A-Za-z]+)*)?$/;function Jf(e){return Zf.test(e)}function eb(e){if(typeof e!="string"||!Jf(e))throw new Bo;return e}function YD(e){return e==null?{version:Om,source:"fallback_current"}:{version:eb(e),source:"explicit"}}function XD(){return{version:Om,source:"system_current"}}import{z as tt}from"zod";var tb=200,nb=200;function sb(e){let n=e.indexOf(":");if(n<=0)return null;let s=e.slice(0,n).trim(),i=e.slice(n+1).trim();return s.length===0||i.length===0?null:{source:s,target:i}}var ib=tt.string().min(3).max(tb).refine(e=>sb(e)!==null,{message:'glossary entries must be "source:target" pairs split on a half-width colon, e.g. "\u7C73:Rice"'}),JD=tt.array(ib).max(nb),eO=tt.object({website_name:tt.string().min(1).max(200),website_industry:tt.string().min(1).max(200).optional(),website_description:tt.string().min(1).max(1e3).optional()}),ob=tt.enum(["regional","fonts_only"]),Qs=tt.string().regex(/^#[0-9a-fA-F]{6}$/,'color must be a "#rrggbb" value'),ab=tt.object({primary:Qs.optional(),accent:Qs.optional(),foreground:Qs.optional(),neutral:Qs.optional()}),rb=600,tO=tt.object({mode:ob.default("regional"),seeds:ab.optional(),note:tt.string().min(1).max(rb).optional()}),nO={mode:"regional"};function sO(e){return e===void 0?!1:Object.values(e).some(n=>typeof n=="string"&&n.length>0)}import{z as Ht}from"zod";var cb=12,rO=Ht.object({tenant_id:Ht.string().min(1),site_id:k,snapshot_id:I,manifest_hash:Ht.string().regex(/^sha256:[a-f0-9]{64}$/),object_key:Ht.string().min(1).max(2048)}),Zs=Ht.number().int().nonnegative().safe(),cO=Ht.object({page_count:Zs,translation_character_count:Zs,image_estimate:Ht.object({media_key_count:Zs,max_replacement_count:Zs})}).superRefine((e,n)=>{let{media_key_count:s,max_replacement_count:i}=e.image_estimate;i!==Math.min(s,cb)&&n.addIssue({code:"custom",path:["image_estimate","max_replacement_count"],message:"max replacement count does not match the deterministic ceiling"})});import{z as ue}from"zod";var mb=ue.string().trim().min(1),pn=ue.string().uuid(),lb=ue.string().min(1).max(2048).refine(e=>e.startsWith("/")||e.includes("\\")?!1:e.split("/").every(n=>n.length>0&&n!=="."&&n!==".."),"object_key must be a relative snapshot store path without empty, '.' or '..' segments"),Nm=ue.object({snapshot_id:pn,object_key:lb}),pO=ue.object({tenant_id:mb,parent_site_id:pn,subsite_site_id:pn,base:Nm,target:Nm}),pb=ue.object({page_path:ue.string().min(1),page_route:ue.string().min(1).describe("\u4E3B\u7AD9\u76EE\u6807\u5FEB\u7167\u7684\u9875\u9762\u8DEF\u7531\uFF1A\u4F18\u5148 PAGE_SEO.path\uFF0C\u7F3A\u5931\u65F6\u7531\u6587\u4EF6\u8DEF\u7531\u63A8\u5BFC\uFF1B\u52A8\u6001\u9875\u4FDD\u7559\u8DEF\u7531\u6A21\u677F\uFF0C\u4E0D\u542B\u57DF\u540D\u6216\u5B50\u7AD9\u6302\u8F7D\u524D\u7F00\u3002"),page_title:ue.string().nullable().describe("\u4E3B\u7AD9\u76EE\u6807\u5FEB\u7167\u4E2D\u7684\u9759\u6001 PAGE_SEO.title\uFF1B\u7F3A\u5931\u6216\u52A8\u6001\u503C\u8FD4\u56DE null\uFF0C\u4E0D\u67E5\u8BE2 CMS \u6807\u9898\u8986\u76D6\u3002"),ai_image_count:ue.number().int().nonnegative().safe().describe("\u9875\u9762\u5F15\u7528\u7684\u5A92\u4F53\u6CE8\u518C\u8868 key \u6570\u91CF\uFF0C\u9875\u5185\u53BB\u91CD\uFF0C\u4E0D\u9650 12 \u5F20\uFF1B\u8868\u793A\u53EF\u4F9B AI \u91CD\u65B0\u751F\u6210\u7684\u5019\u9009\u56FE\u7247\u6570\u3002"),translation_character_count:ue.number().int().nonnegative().safe().describe("\u6574\u9875\u53EF\u9759\u6001\u63D0\u53D6\u7684\u6587\u6848\u53CA\u76F8\u5173\u56FE\u7247 alt\uFF0C\u539F\u6587\u53BB\u91CD\u540E\u7684 UTF-16 \u5B57\u7B26\u6570\uFF0C\u4E0D\u6263\u9664\u5386\u53F2\u8BD1\u6587\u3002")}),db={page_count:ue.number().int().nonnegative().safe().describe("\u65B0\u589E\u9875\u9762\u6570\u91CF\uFF0C\u7B49\u4E8E pending_pages \u957F\u5EA6\u3002"),ai_image_count:ue.number().int().nonnegative().safe().describe("\u9010\u9875\u5019\u9009\u56FE\u7247\u6570\u91CF\u4E4B\u548C\uFF0C\u8DE8\u9875\u4E0D\u53BB\u91CD\uFF0C\u4E0D\u8868\u793A\u5DF2\u7531 AI \u751F\u6210\u7684\u56FE\u7247\u6570\u3002"),translation_character_count:ue.number().int().nonnegative().safe().describe("\u9010\u9875\u9884\u4F30\u7FFB\u8BD1\u5B57\u7B26\u6570\u4E4B\u548C\uFF0C\u8DE8\u9875\u4E0D\u53BB\u91CD\uFF0C\u4E0D\u8868\u793A\u5B9E\u9645\u7FFB\u8BD1\u6D88\u8017\u3002"),page_estimates:ue.array(pb)};function ub(e,n){let s=new Set(e.pending_pages),i=new Set(e.page_estimates.map(o=>o.page_path));(s.size!==e.pending_pages.length||i.size!==e.page_estimates.length||s.size!==i.size||[...s].some(o=>!i.has(o)))&&n.addIssue({code:"custom",path:["page_estimates"],message:"page_estimates must correspond to pending_pages exactly once"});for(let[o,a]of[["page_count",e.pending_pages.length],["ai_image_count",e.page_estimates.reduce((c,r)=>c+r.ai_image_count,0)],["translation_character_count",e.page_estimates.reduce((c,r)=>c+r.translation_character_count,0)]])e[o]!==a&&n.addIssue({code:"custom",path:[o],message:"total must equal the sum of page estimates"})}var dO=ue.object({...db,subsite_site_id:pn,pending_pages:ue.array(ue.string().min(1)),hash_diverged_count:ue.number().int().nonnegative(),child_only_count:ue.number().int().nonnegative(),base_snapshot_id:pn,target_snapshot_id:pn}).superRefine(ub),_b=ue.enum(["SUBSITE_DIFF_REQUEST_INVALID","SUBSITE_DIFF_STORE_NOT_CONFIGURED","SUBSITE_DIFF_MANIFEST_MISSING","SUBSITE_DIFF_MANIFEST_INVALID","SUBSITE_DIFF_ESTIMATE_INVALID"]),uO=ue.object({error_code:_b,message:ue.string().min(1),side:ue.enum(["base","target"]).optional()});import{z as te}from"zod";var SO=te.object({tenant_id:te.string().min(1),site_id:k,snapshot_id:I,manifest_hash:te.string().regex(/^sha256:[a-f0-9]{64}$/),object_key:te.string().min(1).max(2048),page_slug:te.string().max(512).optional()}),fO=te.object({site_id:k,snapshot_id:I,unit_count:te.number().int().nonnegative(),file_count:te.number().int().nonnegative(),markdown:te.string().min(1),page_slug:te.string().optional(),page_file:te.string().optional(),entries:te.array(te.object({id:te.string().min(1),file_path:te.string().min(1),line:te.number().int().nullable(),kind:te.string().min(1),text:te.string(),media_key:te.string().optional()})).optional(),images:te.array(te.object({id:te.string().min(1),source:te.enum(["media-registry","source-literal"]),src:te.string().min(1),alt:te.string().nullable(),media_key:te.string().optional(),width:te.number().optional(),height:te.number().optional(),provider:te.string().optional(),is_placeholder:te.boolean(),occurrences:te.array(te.object({file_path:te.string().min(1),line:te.number().int()}))})).optional()});import{z as gb}from"zod";var hb=/^\/[a-z0-9][a-z0-9-]{0,30}$/,Sb=Object.freeze(["api","_next","assets","static","robots.txt","sitemap.xml",".well-known"]),fb=new Set(Sb);function bb(e){return fb.has(e)}var xO=gb.string().regex(hb).refine(e=>!bb(e.slice(1)),{message:"mount_path must not use a reserved segment (api, _next, assets, static, robots.txt, sitemap.xml, .well-known)"});import{z as he}from"zod";var yb=he.enum(["active","paused","blocked"]),jm=he.enum(["typecheck_failed","health_failed","validation_failed"]),xb={status:yb,attempts:he.number().int().nonnegative(),attempted_template_version:Je.nullable(),last_error_code:jm.nullable()},dn=he.object(xb).strict(),Js=he.object({template_id:he.string().trim().min(1),target_template_version:Je}).strict(),TO=Js,Eb=he.discriminatedUnion("action",[he.object({action:he.literal("proceed"),state:dn.extend({status:he.literal("active")})}).strict(),he.object({action:he.literal("skip_not_newer"),state:dn.extend({status:he.literal("active")})}).strict(),he.object({action:he.literal("skip_paused"),state:dn.extend({status:he.literal("paused")})}).strict(),he.object({action:he.literal("skip_blocked"),state:dn.extend({status:he.literal("blocked")})}).strict()]),kO=Js,AO=Eb,PO=Js.extend({error_code:jm}),wO=he.object({state:dn}).strict(),CO=Js,vO=he.object({state:dn}).strict();import{z as Y}from"zod";var Rb=744*60*60*1e3,Ib=Y.enum(["eligible","fast_path","upgraded","skipped","lock_skipped","cas_aborted","validation_failed","blocked","paused"]),Tb=Y.enum(["typecheck","build","health","validation"]),kb=Y.enum(["not_attempted","promoted","aborted"]),LO=Y.object({template_id:Y.string().trim().min(1).max(128),from_version:Je.nullable(),to_version:Je,outcome:Ib,attempt:Y.number().int().nonnegative().max(2147483647),duration_ms:Y.number().int().nonnegative().max(2147483647),replaced_group_count:Y.number().int().nonnegative().max(2147483647),skipped_group_count:Y.number().int().nonnegative().max(2147483647),validation_stage:Tb.nullable(),cas_outcome:kb.nullable()}).strict(),MO=Y.object({recorded:Y.literal(!0)}).strict(),Lm=Y.object({from:Y.iso.datetime(),to:Y.iso.datetime()}).strict().refine(({from:e,to:n})=>Date.parse(e)<Date.parse(n),{message:"from must be earlier than to",path:["to"]}).refine(({from:e,to:n})=>Date.parse(n)-Date.parse(e)<=Rb,{message:"report window must not exceed 31 days",path:["to"]}),UO=Lm,Ab=Y.object({eligible:Y.number().int().nonnegative(),fast_path:Y.number().int().nonnegative(),upgraded:Y.number().int().nonnegative(),skipped:Y.number().int().nonnegative(),lock_skipped:Y.number().int().nonnegative(),cas_aborted:Y.number().int().nonnegative(),validation_failed:Y.number().int().nonnegative(),blocked:Y.number().int().nonnegative(),paused:Y.number().int().nonnegative()}).strict(),FO=Y.object({window:Lm,outcome_counts:Ab,current_state_counts:Y.object({blocked:Y.number().int().nonnegative(),paused:Y.number().int().nonnegative()}).strict(),duration_ms:Y.object({p50:Y.number().int().nonnegative().nullable(),p95:Y.number().int().nonnegative().nullable(),sample_count:Y.number().int().nonnegative()}).strict()}).strict(),GO=Y.object({older_than:Y.iso.datetime(),limit:Y.coerce.number().int().min(1).max(200).default(50),include_candidates:Y.enum(["true","false"]).default("false").transform(e=>e==="true")}).strict(),Pb=Y.object({site_id:k,snapshot_id:I,status:Y.enum(["candidate","deleting"]),created_at:Y.iso.datetime()}).strict(),qO=Y.object({snapshots:Y.array(Pb)}).strict();import{z as bt}from"zod";var wb=bt.enum(["PREVIEW_SESSION_NOT_FOUND","PREVIEW_SESSION_INVALID","PREVIEW_SESSION_STALE","PREVIEW_SESSION_LOOKUP_FAILED","PREVIEW_SANDBOX_NOT_FOUND","PREVIEW_SANDBOX_CONNECT_FAILED","PREVIEW_SANDBOX_OWNERSHIP_MISMATCH","PREVIEW_ACTIVATION_TIMEOUT","PREVIEW_PREFLIGHT_FAILED","PREVIEW_ENV_LOOKUP_FAILED","PREVIEW_SERVER_START_FAILED","PREVIEW_HEALTH_CHECK_FAILED","SANDBOX_NOT_CONFIGURED"]),Cb=bt.object({status:bt.literal("ready"),preview_url:bt.string().url()}).strict(),vb=bt.object({status:bt.literal("failed"),code:wb,message:bt.string().min(1),retryable:bt.boolean()}).strict(),KO=bt.discriminatedUnion("status",[Cb,vb]);import{z as Ct}from"zod";var Db=["not_started","active","completed"],Ob=Ct.enum(Db),Nb=["not_started","in_progress","completed"],jb=Ct.enum(Nb),Lb=Ct.object({sequence:Ct.number().int().positive(),code:Tt,status:jb}).strict(),Mb=Ct.object({site_id:k,workflow_status:Ob,flow_type:on.nullable(),current_step_code:Tt.nullable(),completed_count:Ct.number().int().nonnegative(),total_count:Ct.number().int().nonnegative(),steps:Ct.array(Lb)}).strict().superRefine((e,n)=>{let s=e.steps.filter(i=>i.status==="completed").length;e.total_count!==e.steps.length&&n.addIssue({code:"custom",path:["total_count"],message:"total_count must equal steps.length."}),e.completed_count!==s&&n.addIssue({code:"custom",path:["completed_count"],message:"completed_count must equal completed steps."}),e.steps.forEach((i,o)=>{i.sequence!==o+1&&n.addIssue({code:"custom",path:["steps",o,"sequence"],message:"Step sequence must be continuous and start at 1."})}),e.workflow_status==="not_started"&&(e.flow_type!==null&&n.addIssue({code:"custom",path:["flow_type"],message:"not_started progress cannot have a flow_type."}),e.current_step_code!==null&&n.addIssue({code:"custom",path:["current_step_code"],message:"not_started progress cannot have a current step."}),(e.completed_count!==0||e.total_count!==0)&&n.addIssue({code:"custom",path:["steps"],message:"not_started progress must have zero counts and no steps."})),e.workflow_status==="active"&&(e.flow_type===null&&n.addIssue({code:"custom",path:["flow_type"],message:"active progress requires a flow_type."}),e.current_step_code===null&&n.addIssue({code:"custom",path:["current_step_code"],message:"active progress requires a current step."})),e.workflow_status==="completed"&&(e.flow_type===null&&n.addIssue({code:"custom",path:["flow_type"],message:"completed progress requires a flow_type."}),e.current_step_code!==null&&n.addIssue({code:"custom",path:["current_step_code"],message:"completed progress cannot have a current step."}),e.steps.some(i=>i.status!=="completed")&&n.addIssue({code:"custom",path:["steps"],message:"completed progress must have only completed steps."}),e.completed_count!==e.total_count&&n.addIssue({code:"custom",path:["completed_count"],message:"completed progress counts must be equal."}))}),XO=M(Mb);import{z as Ko}from"zod";var Ub=Ko.enum(["none","build","build_publish"]),Fb=Ko.object({site_id:k,launcher_scope:Ub}),eN=Ko.object({permission:Fb});function tN(e){return e!=="none"}function nN(e){return e==="build_publish"}import{z as fe}from"zod";var cN="build-context.json",mN=2e5,Mm=fe.string().regex(/^sha256:[a-f0-9]{64}$/u),Um=1e3;function Gb(e){return Array.from(e).length<=Um}var qb=fe.object({kind:fe.enum(["customer_materials","website_scan_diagnosis","committed_strategy"]),digest:Mm}).strict(),Wb=fe.object({schema_version:fe.literal(1),flow_type:on,sources:fe.array(qb).min(2).max(2)}).strict().superRefine((e,n)=>{let s=new Set(e.sources.map(o=>o.kind)),i=e.flow_type==="with_website"?["website_scan_diagnosis","committed_strategy"]:["customer_materials","committed_strategy"];(s.size!==i.length||i.some(o=>!s.has(o)))&&n.addIssue({code:"custom",path:["sources"],message:"Site-build provenance sources must match the persisted workflow flow."})}),Bb=fe.object({schema_version:fe.literal(1),seed:Mm.optional(),cms_settings:fe.object({main_products:fe.string().trim().min(1).refine(Gb,{message:`main_products must contain at most ${Um} characters`}).optional()}).strict().optional(),provenance:Wb.optional()}).strict(),Kb=fe.object({schema_version:fe.literal(1),site_id:k,workflow_id:ot,brief:fe.string().min(1),source:fe.enum(["business_provider","mock"]),payload:Bb}).strict().superRefine((e,n)=>{e.source==="business_provider"&&!e.payload.provenance&&n.addIssue({code:"custom",path:["payload","provenance"],message:"Business site-build context requires persisted provenance."})}),lN=fe.object({source_snapshot_id:I,source_run_id:$,build_context:Kb,page_slugs:fe.array(fe.string().min(1)).optional()}).strict(),pN=fe.object({disposition:fe.enum(["reused","rebased"]),snapshot_id:I}).strict(),zb=fe.object({snapshot:_o,workspace_run_id:$.nullable()}).strict(),dN=M(zb);import{z as ct}from"zod";import{z as $e}from"zod";import{z as ve}from"zod";import{z as Hb}from"zod";var $b=["brand","fact","cert","case","svc","faq","voice"],Fm=Hb.enum($b);var Vb=ve.enum(["pending","running","ready","failed","missing"]),Yn=ve.string().trim().min(1).max(255),fN=ve.object({knowledge_site_id:Yn,source_ids:ve.array(Yn).min(1).max(200)}).strict().superRefine((e,n)=>{new Set(e.source_ids).size!==e.source_ids.length&&n.addIssue({code:"custom",message:"Knowledge source IDs must be unique.",path:["source_ids"]})}),Yb=ve.object({source_file_id:Yn,category_code:Fm.nullable(),category_confirmed:ve.boolean(),status:Vb}).strict(),bN=ve.object({ready:ve.boolean(),files:ve.array(Yb),counts:ve.object({total:ve.number().int().nonnegative(),pending:ve.number().int().nonnegative(),running:ve.number().int().nonnegative(),ready:ve.number().int().nonnegative(),failed:ve.number().int().nonnegative(),missing:ve.number().int().nonnegative(),unclassified:ve.number().int().nonnegative()}).strict()}).strict();var xe=e=>$e.string().trim().max(e),Gm=$e.array($e.string().trim().min(1).max(120)).max(20),zo=$e.object({company_name:$e.string().trim().min(1).max(200),brand_name:xe(200),primary_products:$e.string().trim().min(1).max(1e3),industry:xe(200),applications:xe(1e3),business_summary:xe(2e3),registered_capital:xe(200).default(""),legal_representative:xe(200).default(""),target_markets:Gm,customer_industries:xe(1e3),customer_roles:xe(1e3),buying_scenarios:xe(2e3),differentiators:xe(2e3),competitors:xe(1e3),trust_proof:xe(2e3),customer_cases:xe(3e3),channels:Gm,expected_domain:xe(255),brand_tone:xe(500),contact_name:xe(200),contact_info:xe(500),timezone:xe(100),launch_timing:xe(200),input_source_ids:$e.array(Yn).max(50)}).strict(),Xb=$e.enum(["draft","submitted"]),Ho=zo.extend({id:Q,tenant_id:$e.string().min(1),site_id:k,workflow_id:ot,status:Xb,submitted_at:$e.string().min(1).nullable(),created_at:$e.string().min(1),updated_at:$e.string().min(1)}).strict(),TN=M(Ho),kN=M(Ho),AN=M(Ho.nullable());var DN=Fs.extend({expected_current_node:ct.literal("website_scan"),type:ct.literal("existing_site"),result:Fs.shape.result.extend({website:ct.string().url(),scan_cards:ct.partialRecord(Yc,Eo).refine(e=>Object.keys(e).length>0,{message:"At least one recognized scan card is required."})}).strict()}).strict(),ON=ct.object({expected_current_node:ct.literal("customer_materials"),materials:zo}).strict(),NN=ct.object({expected_current_node:ct.literal("diagnosis")}).strict(),jN=ct.object({expected_current_node:ct.literal("strategy")}).strict();import{z as N}from"zod";var $o=["compact","comfortable","airy"],qm=["none","sm","md","lg","xl"],Wm="lg",Vo=["subtle","moderate","expressive"],Qb=[{id:"subtle",motionLevel:"subtle"},{id:"moderate",motionLevel:"moderate"},{id:"expressive",motionLevel:"expressive"}];function Bm(e){let n=Qb.find(s=>s.id===e);if(!n)throw new Error(`Unknown motion preset: ${e}`);return n}var Km=["ocean","forest","clay","violet","graphite","crimson"],zm=["ai-forest","ai-navy","ai-steel"],Hm=/^gen-[0-9a-f]{8}$/,Yo=[{id:"ai-forest",name:"\u5DE5\u4E1A\u58A8\u7EFF \xB7 Industrial Teal",description:"\u6C89\u7A33\u4E13\u4E1A\uFF0C\u7A81\u51FA\u7CBE\u5BC6\u4E0E\u53EF\u4FE1\u3002",fallbackReason:"\u7A33\u5B9A\u4E13\u4E1A\u7684\u9ED8\u8BA4\u9009\u62E9\u3002",colorSeeds:{primary:"#0E7C6F",accent:"#2F6FED",foreground:"#0F1B2D"},surfaceMode:"light",radius:"sm"},{id:"ai-navy",name:"\u79D1\u6280\u6DF1\u84DD \xB7 Deep Tech Blue",description:"\u7406\u6027\u79D1\u6280\u611F\uFF0C\u5F3A\u8C03\u6280\u672F\u5B9E\u529B\u4E0E\u6570\u636E\u53EF\u4FE1\u3002",fallbackReason:"\u6280\u672F\u8868\u8FBE\u7684\u5907\u9009\u3002",colorSeeds:{primary:"#1E3A8A",accent:"#2F6FED",foreground:"#0F1B2D"},surfaceMode:"light",radius:"md"},{id:"ai-steel",name:"\u7CBE\u5BC6\u94F6\u7070 \xB7 Precision Steel",description:"\u514B\u5236\u6E05\u6670\uFF0C\u9002\u5408\u53C2\u6570\u4E0E\u5DE5\u7A0B\u7EC6\u8282\u8868\u8FBE\u3002",fallbackReason:"\u53C2\u6570\u4FE1\u606F\u8F83\u591A\u65F6\u7684\u5907\u9009\u3002",colorSeeds:{primary:"#475569",accent:"#94A3B8",foreground:"#111827"},surfaceMode:"light",radius:"none"}],Xo=[{id:"ocean",colorSeeds:{primary:"#1e3a5f",accent:"#2563eb",foreground:"#0f172a"},surfaceMode:"light",radius:"md"},{id:"forest",colorSeeds:{primary:"#14532d",accent:"#16a34a",foreground:"#0f172a"},surfaceMode:"light",radius:"lg"},{id:"clay",colorSeeds:{primary:"#7c2d12",accent:"#ea580c",foreground:"#1c1917"},surfaceMode:"light",radius:"xl"},{id:"violet",colorSeeds:{primary:"#3b0764",accent:"#7c3aed",foreground:"#18181b"},surfaceMode:"light",radius:"lg"},{id:"graphite",colorSeeds:{primary:"#1f2937",accent:"#0d9488",foreground:"#111827"},surfaceMode:"light",radius:"none"},{id:"crimson",colorSeeds:{primary:"#7f1d1d",accent:"#dc2626",foreground:"#1f1012"},surfaceMode:"light",radius:"sm"}];function UN(e){let n=Xo.find(s=>s.id===e);if(!n)throw new Error(`Unknown theme preset: ${e}`);return n}function $m(e){return Xo.find(n=>n.id===e)?.radius??Yo.find(n=>n.id===e)?.radius}var Qo=N.string().regex(/^#[0-9A-F]{6}$/i),Xn=N.string().trim().min(1).max(500),Vm=N.string().datetime({offset:!0}),Zb=N.enum(Km),Jb=N.enum(zm),ey=N.string().regex(Hm),Qn=N.union([Zb,Jb,ey]),Zn=N.enum(wo),Jn=N.enum(Vo),es=N.enum($o),ei=N.enum(qm),Ym=300,ty=N.string().trim().min(1).max(Ym),ti=N.object({primary:Qo,accent:Qo,foreground:Qo}).strict(),ny=N.object({id:Qn,rank:N.number().int().min(1).max(3),name:N.string().trim().min(1).max(120),description:N.string().trim().min(1).max(240),color_seeds:ti,surface_mode:N.enum(["light","dark"]),radius:ei,font_pairing_id:Zn,motion_preset_id:Jn,density:es,weight_style:Be.optional(),reason:Xn}).strict(),Xm=N.object({name:N.string().trim().min(1).max(120),description:N.string().trim().min(1).max(240),reason:Xn,color_seeds:ti,surface_mode:N.enum(["light","dark"]),radius:ei,font_pairing_id:Zn,motion_preset_id:Jn,density:es,weight_style:Be}).strict(),Qm=N.object({version:N.number().int().min(1),recommendation_id:N.string().uuid(),theme_preset_id:Qn,color_seeds:ti,surface_mode:N.enum(["light","dark"]),font_pairing_id:Zn,motion_preset_id:Jn,density:es,radius:ei.optional(),weight_style:Be.optional(),aesthetic_note:ty.optional(),updated_at:Vm}).strict(),sy=N.object({id:N.string().uuid(),version:N.number().int().min(1),catalog_version:N.string().trim().min(1).max(80),source:N.object({mode:N.enum(["ai","fallback"]),fallback_reason:N.string().trim().min(1).max(80).nullable()}).strict(),inputs:N.object({industry:N.string().trim().min(1).max(160).optional(),site_language:N.string().trim().min(2).max(35),owner_locale:Ie.optional(),strategy_version:N.number().int().min(1),input_digest:N.string().regex(/^sha256:[a-f0-9]{64}$/)}).strict(),theme:N.object({recommended_id:Qn,candidate_ids:N.array(Qn).length(3),candidates:N.array(ny).length(3)}).strict().superRefine((e,n)=>{e.recommended_id!==e.candidate_ids[0]&&n.addIssue({code:"custom",path:["recommended_id"],message:"recommended_id must be the first candidate"}),e.candidates.some((s,i)=>s.id!==e.candidate_ids[i]||s.rank!==i+1)&&n.addIssue({code:"custom",path:["candidates"],message:"Candidates must follow candidate_ids order."})}),font:N.object({recommended_id:Zn,reason:Xn}).strict(),motion:N.object({recommended_id:Jn,reason:Xn}).strict(),density:N.object({recommended_id:es,reason:Xn}).strict(),conversion:Ut.optional(),generated_at:Vm}).strict(),YN=N.object({force_refresh:N.boolean().optional()}).strict(),XN=N.object({request_id:N.string().trim().min(1).max(160),site_id:k,cached:N.boolean(),recommendation:sy,selection:Qm}).strict(),QN=N.object({recommendation_id:N.string().uuid(),expected_version:N.number().int().min(1),theme_preset_id:Qn,color_seeds:ti,surface_mode:N.enum(["light","dark"]),font_pairing_id:Zn,motion_preset_id:Jn,density:es,radius:ei.optional(),weight_style:Be.optional(),aesthetic_note:N.string().trim().max(Ym).optional()}).strict(),ZN=N.object({selection:Qm}).strict(),iy=4e3,JN=N.object({tenant_id:N.string().trim().min(1).max(160),site_id:k,site_language:N.string().trim().min(2).max(35),owner_locale:Ie,industry:N.string().trim().min(1).max(160).optional(),strategy_version_id:N.string().uuid(),strategy_version:N.number().int().min(1),strategy_checksum:N.string().regex(/^[a-f0-9]{64}$/),strategy_summary:N.array(N.string().trim().min(1).max(iy)).min(1).max(Ne)}).strict(),Zo=N.object({theme_candidates:N.array(Xm).length(3),conversion:Ut.optional()}).strict().superRefine((e,n)=>{let s=new Set;e.theme_candidates.forEach((i,o)=>{let a=JSON.stringify(i.color_seeds).toUpperCase();s.has(a)&&n.addIssue({code:"custom",path:["theme_candidates",o,"color_seeds"],message:"Theme candidates must have pairwise distinct color_seeds"}),s.add(a)})});function ej(){return Yo.map(e=>Xm.parse({name:e.name,description:e.description,reason:e.fallbackReason,color_seeds:e.colorSeeds,surface_mode:e.surfaceMode,radius:e.radius,font_pairing_id:wo[0],motion_preset_id:Vo[0],density:$o[1],weight_style:qs}))}function oy(e){return e.radius??$m(e.theme_preset_id)??"lg"}function ay(e,n){return e.weight_style??n?.theme?.candidates?.find(s=>s.id===e.theme_preset_id)?.weight_style??n?.theme?.candidates?.[0]?.weight_style??qs}function tj(e,n){let s=rm(e.font_pairing_id),i=Bm(e.motion_preset_id);return{colorSeeds:e.color_seeds,surfaceMode:e.surface_mode,fonts:{heading:s.heading,body:s.body},density:e.density,motionLevel:i.motionLevel,motionPreset:i.id,radius:oy(e),weightStyle:ay(e,n)}}function nj(e,n){let s=e.theme.candidates[0];return{version:1,recommendation_id:e.id,theme_preset_id:s.id,color_seeds:s.color_seeds,surface_mode:s.surface_mode,font_pairing_id:e.font.recommended_id,motion_preset_id:e.motion.recommended_id,density:e.density.recommended_id,radius:s.radius,weight_style:s.weight_style,updated_at:n.toISOString()}}import{z as Jo}from"zod";function ry(e){return JSON.stringify([e.color_seeds.primary.toUpperCase(),e.color_seeds.accent.toUpperCase(),e.color_seeds.foreground.toUpperCase(),e.surface_mode,e.font_pairing_id,e.radius,e.motion_preset_id,e.density,e.weight_style])}var cy=Jo.object(Zo.shape).strict().superRefine((e,n)=>{let s=new Set;e.theme_candidates.forEach((i,o)=>{let a=ry(i);s.has(a)&&n.addIssue({code:"custom",path:["theme_candidates",o],message:"Theme candidates must have pairwise distinct visual identities"}),s.add(a)})}),aj=Jo.union([Zo,cy.safeExtend({model_profile:Jo.literal("azure-gpt")})]);import{z as vt}from"zod";var lj=vt.object({site_id:k,site_language:vt.string().trim().min(2).max(35),business_facts:vt.array(vt.string().trim().min(1).max(1e3)).min(1).max(8)}).strict(),my=vt.enum(["high","medium","low"]),pj=vt.object({skill_name:vt.string().trim().min(1).max(80).nullable(),confidence:my,reason:vt.string().trim().min(1).max(240)}).strict();import{z as ts}from"zod";var Zm=1e4,ly=ts.object({note:ts.string().trim().max(Zm),updated_at:ts.string().min(1)}).strict(),gj=ts.object({note:ts.string().trim().max(Zm)}).strict(),hj=M(ly.nullable());import{z as ie}from"zod";var ea=["title","text","richtext","number","boolean","date","datetime","url","email","color","select","multiselect","tag"],ni=ie.object({name:ie.string().min(1).max(100),type:ie.enum(ea),label:ie.string().min(1).max(255),required:ie.boolean().optional(),options:ie.array(ie.string()).optional()}),bj=ie.object({name:ie.string(),cms_type:ie.string(),label:ie.string().optional(),required:ie.boolean().optional(),value_shape:ie.string().optional(),front_display:ie.enum(["visible","internal","forbidden"]).optional(),choices:ie.array(ie.object({value:ie.union([ie.string(),ie.number()]),label:ie.string()})).optional()}),yj=ie.object({route_file_path:ie.string().min(1),target_component_path:ie.string().min(1),content_type_hint:ie.string().min(1),collection_purpose:ie.enum(["generic","product"]).optional(),required_fields:ie.array(ni).optional(),mode:ie.enum(["bind_existing","provision"]),list_mode:ie.enum(["page","embedded"]).optional(),fields:ie.array(ni).optional(),seed_records:ie.array(ie.record(ie.string(),ie.unknown())).optional()});import{z as G}from"zod";var ns=G.number().int().positive().refine(Number.isSafeInteger,"Must be a safe positive integer"),si=G.string().regex(/^[a-f0-9]{64}$/),ii=G.string().regex(/^[a-z][a-z0-9-]{0,99}$/),oi=G.string().regex(/^[a-z0-9]{1,30}$/),Ye=e=>G.string().max(e).refine(n=>n.trim().length>0,"Value must not be blank"),Jm=G.object({id:G.string().uuid(),key:Ye(100),name:Ye(255)}).strict(),tl=new Set(["title","summary","description","category","thumbnail","url","admin_id"]),py=new Set(["title","summary","description","image_query"]),dy=new Set(["category","thumbnail","url","admin_id","page","pages","route","path","component","components","snapshot","run","site_id","cms_site_id","tenant_id","token","secret","password","authorization","headers","__proto__","prototype","constructor"]),el=new Set(["select","multiselect"]),uy=new Set(["title","text","richtext","date","datetime","url","email","color"]),_y=G.object({name:Ye(100),label:Ye(255),type:G.enum(ea),required:G.boolean().optional(),options:G.array(Ye(100)).max(100).optional()}).strict().superRefine((e,n)=>{let s=e.options??[];el.has(e.type)&&s.length===0&&n.addIssue({code:"custom",path:["options"],message:"Choice fields require at least one option"}),!el.has(e.type)&&s.length>0&&n.addIssue({code:"custom",path:["options"],message:"Only choice fields may declare options"}),new Set(s).size!==s.length&&n.addIssue({code:"custom",path:["options"],message:"Field options must be unique"}),tl.has(e.name)&&n.addIssue({code:"custom",path:["name"],message:"Reserved CMS field names cannot be declared"})}),gy=G.array(_y).min(1).max(200),hy=G.array(G.record(G.string(),G.unknown())).max(1e3);function Ve(e,n,s){e.addIssue({code:"custom",path:n,message:s})}var Sy=G.object({name:Ye(30),slug:oi,collection_purpose:G.enum(["generic","product"]).optional(),fields:gy,seed_records:hy}).strict().superRefine((e,n)=>{let s=e.fields.map(o=>o.name);new Set(s).size!==s.length&&n.addIssue({code:"custom",path:["fields"],message:"Field names must be unique"}),s.some(o=>!tl.has(o))||n.addIssue({code:"custom",path:["fields"],message:"At least one custom field is required"});let i=new Map(e.fields.map(o=>[o.name,o]));e.seed_records.forEach((o,a)=>{for(let[c,r]of Object.entries(o)){let m=["seed_records",a,c];if(dy.has(c)){Ve(n,m,"Seed cannot write reserved or runtime-owned fields");continue}if(c==="image_query"){(typeof r!="string"||r.trim()==="")&&Ve(n,m,"image_query must be a non-empty string");continue}if(py.has(c)){typeof r!="string"&&Ve(n,m,"Seed skeleton text fields must be strings");continue}let x=i.get(c);if(!x){Ve(n,m,"Seed contains an undeclared field");continue}if(r==null){Ve(n,m,"Seed field values must not be null");continue}if(x.type==="select")(typeof r!="string"||!(x.options??[]).includes(r))&&Ve(n,m,"Seed select value must be one of the declared options");else if(x.type==="multiselect")(!Array.isArray(r)||r.length===0||r.some(_=>typeof _!="string"||!(x.options??[]).includes(_)))&&Ve(n,m,"Seed multiselect value must contain only declared options");else if(x.type==="number")(typeof r!="number"||!Number.isFinite(r))&&Ve(n,m,"Seed number values must be finite numbers");else if(x.type==="boolean")typeof r!="boolean"&&Ve(n,m,"Seed boolean values must be booleans");else if(x.type==="tag"){let _=Array.isArray(r)?r:[r];(_.length===0||_.some(w=>typeof w!="string"||w.trim()===""))&&Ve(n,m,"Seed tag values must be non-empty strings")}else uy.has(x.type)&&typeof r!="string"&&Ve(n,m,"Seed text-like values must be strings")}for(let c of e.fields)c.required&&!(c.name in o)&&Ve(n,["seed_records",a,c.name],"Required fields must be present in every seed record")}),new TextEncoder().encode(JSON.stringify(e)).byteLength>1024*1024&&n.addIssue({code:"custom",path:[],message:"Application template must not exceed 1048576 UTF-8 bytes"})}),ta=G.object({schema_version:G.literal(1),application:Sy}).strict(),fy=G.object({templateId:G.string().uuid(),stableKey:ii,resolvedVersion:ns,digest:si,template:ta}).strict(),by=fy,yy={alreadyCreated:"APPLICATION_ALREADY_CREATED",slugConflict:"APPLICATION_SLUG_CONFLICT",createInProgress:"APPLICATION_CREATE_IN_PROGRESS",cmsUnbound:"APPLICATION_CMS_UNBOUND",templateVersionUnavailable:"APPLICATION_TEMPLATE_VERSION_UNAVAILABLE",createFailed:"APPLICATION_CREATE_FAILED",createResultUnknown:"APPLICATION_CREATE_RESULT_UNKNOWN"},nl=G.enum(Object.values(yy)),sl=G.object({category_status:G.enum(["succeeded","failed","not_attempted"]),seed_status:G.enum(["skipped","succeeded","partial","failed"]),requested_count:G.number().int().nonnegative(),written_count:G.number().int().nonnegative().nullable(),published_count:G.number().int().nonnegative().nullable(),errors:G.array(G.object({stage:G.enum(["category","seed","receipt"]),code:Ye(100)}).strict()).max(20)}).strict(),xy=G.object({templateId:G.string().uuid(),stableKey:ii,title:Ye(200),description:G.string().max(1e3),thumbnailUrl:G.string().url().nullable(),resolvedVersion:ns,digest:si,application:G.object({name:Ye(30),slug:oi}).strict(),categories:G.array(Jm),tags:G.array(Jm),status:G.enum(["available","creating","created","conflict","failed"]),errorCode:nl.nullable().optional(),template:ta.optional()}).strict(),il=G.object({items:G.array(xy)}).strict(),Ij=G.object({version:ns}).strict(),Ey=G.object({app_slug:oi,name:Ye(30),template:G.object({stable_key:ii,version:ns,digest:si}).strict()}).strict(),Ry=G.object({status:G.literal("created"),application:Ey,initialization:sl}).strict(),Tj=Ry,Iy=G.object({stable_key:ii,version:ns,digest:si,created_at:G.string().datetime().nullable(),initialization:sl.nullable()}).strict(),Ty=G.object({app_slug:oi,name:Ye(30),collection_slug:G.string().min(1),detail_prefix:G.string().min(1).optional(),source:Iy.nullable()}).strict(),kj=G.object({applications:G.array(Ty)}).strict(),Aj=il,Pj=G.object({code:nl,message:Ye(500)}).strict(),wj=ta,Cj=by,vj=il;import{z as _e}from"zod";var ol=e=>_e.string().max(e).refine(n=>n.trim().length>0,"Value must not be blank"),ky=ni.strict(),rl=_e.array(ky).min(1).max(200),Ay=_e.array(_e.record(_e.string(),_e.unknown())).max(1e3),Py=_e.string().regex(/^[a-z0-9]{1,30}$/),na=_e.number().int().positive().refine(Number.isSafeInteger,"Must be a safe positive integer"),jj=_e.object({name:ol(30),slug:ol(50),collection_purpose:_e.enum(["generic","product"]).optional(),fields:rl}).strict(),al=_e.object({collection_slug:Py,detail_prefix:_e.string().min(1).max(255),plugin_id:na.optional()}).strict(),Lj=_e.discriminatedUnion("kind",[al.extend({kind:_e.literal("created")}),al.extend({kind:_e.literal("exists")})]),Mj=_e.object({fields:rl,seed_records:Ay,category_id:na}).strict(),wy=_e.record(_e.string().min(1),_e.string().min(1).nullable()),Uj=_e.object({ids:_e.array(na).max(1e3),urls:wy,failed:_e.array(_e.unknown()).max(1e3)}).strict();function Fj(e){return e.replace(/[^a-zA-Z0-9]/g,"").toLowerCase().slice(0,30)}import{z as Ee}from"zod";import{z as sa}from"zod";var cl=["lead-generation","trial-and-samples","quote-and-commerce","appointments-and-visits","resources-and-subscriptions","service-and-channel"],ml="-",Cy="embedded",ia=sa.enum([...cl,ml]),vy=sa.literal(Cy),oa=sa.object({scene:ia,shape:vy}).strict();function Wj(e){return cl.find(n=>n===e)??ml}var ai=["text","textarea","email","phone","select","radio","multiselect","boolean","date","number","file"],Dy=["text","textarea","email","phone","select","radio","multiselect","boolean","date","number"],Oy=Ee.object({name:Ee.string().min(1).max(100),type:Ee.enum(Dy),label:Ee.string().min(1).max(255),required:Ee.boolean().optional(),options:Ee.array(Ee.string()).optional()}),Ny=Ee.string().regex(/^[a-z][a-z0-9-]{0,48}$/).optional(),Hj=Ee.object({mode:Ee.enum(["bind_existing","provision"],{error:'mode is required. Use "bind_existing" or "provision". Never call connect_form with {}.'}),form_hint:Ee.string().min(1).optional(),name:Ee.string().min(1).max(255).optional(),scene:ia.optional(),component_slug:Ny,description:Ee.string().min(1).max(1e3).optional(),fields:Ee.array(Oy).optional()}).superRefine((e,n)=>{e.mode==="provision"&&e.scene===void 0&&n.addIssue({code:"custom",path:["scene"],message:"scene is required for provision"}),e.mode==="bind_existing"&&e.scene!==void 0&&n.addIssue({code:"custom",path:["scene"],message:"scene is prohibited for bind_existing"}),e.mode==="bind_existing"&&!e.form_hint?.trim()&&n.addIssue({code:"custom",path:["form_hint"],message:"form_hint is required for bind_existing"}),e.mode==="provision"&&!e.name?.trim()&&n.addIssue({code:"custom",path:["name"],message:"name is required for provision"})}),$j=Ee.object({name:Ee.string(),label:Ee.string(),cms_type:Ee.string(),required:Ee.boolean()});import{z as d}from"zod";var ss=/^[A-Za-z0-9][A-Za-z0-9_-]{0,127}$/,_n=/^[A-Za-z][A-Za-z0-9_-]{0,127}$/,ri=/^[A-Za-z][A-Za-z0-9_]{0,99}$/,ul=/^[A-Za-z0-9][A-Za-z0-9_-]{0,99}$/,ra=/^[a-z][a-z0-9-]{0,99}$/,_l=/^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?$/,ll=2,pl=3,ci=d.string().regex(ss),jy=d.string().regex(ss),ca=d.string().regex(ss),is=d.string().regex(ri),ma=d.string().regex(ul),Ly=d.discriminatedUnion("status",[d.object({status:d.literal("unbound"),form_code:d.null()}).strict(),d.object({status:d.literal("bound"),form_code:d.string().regex(_n)}).strict(),d.object({status:d.literal("missing"),form_code:d.string().regex(_n)}).strict()]),My=d.object({value:ma,label:d.string().trim().min(1).max(255)}).strict(),Uy=d.object({kind:d.literal("field"),field_name:is,type:d.enum(ai),label:d.string().trim().min(1).max(255),required:d.boolean(),span:d.enum(["full","half"]),options:d.array(My).max(100),max_files:d.number().int().min(1).max(5).optional()}).strict(),Fy=d.object({kind:d.literal("step-break"),step_id:d.string().regex(ss)}).strict(),Gy=d.discriminatedUnion("kind",[Uy,Fy]),qy=d.object({field_name:is,type:d.enum(ai),last_label:d.string().max(255)}).strict(),Wy=d.object({field_name:is,value:ma,last_label:d.string().max(255)}).strict(),By=d.discriminatedUnion("kind",[d.object({kind:d.literal("custom")}).strict(),d.object({kind:d.literal("template"),slug:d.string().regex(ra),version:d.string().regex(_l)}).strict()]),Ky={select:2,radio:2,multiselect:1,DropdownSelection:2,RadioButton:2,Checkbox:1};function mt(e){return e.toLowerCase()}function gl(e,n){return e.trim().toLocaleLowerCase(n)}function un(e,n){return`${mt(e)}\0${n}`}function ke(e,n,s,i){let o=new Set;for(let a of e){if(o.has(a)){i.addIssue({code:"custom",path:n,message:s});return}o.add(a)}}function la(e,n,s,i){let o=Ky[e]??0;o>0&&n<o?i.addIssue({code:"custom",path:s,message:`choice field requires at least ${o} option${o===1?"":"s"}`}):o===0&&n>0&&i.addIssue({code:"custom",path:s,message:"non-choice fields must use an empty options array"})}var pa=d.object({schema_version:d.literal(1),min_runtime_version:d.number().int().positive(),form_definition_id:ci,binding:Ly,content_locale:Ie,features:d.object({multistep:d.boolean()}).strict(),copy:d.object({title:d.string().max(255),description:d.string().max(1e3),submit_button:d.string().trim().min(1).max(100),success_message:d.string().trim().min(1).max(500),error_message:d.string().max(500)}).strict(),layout:d.object({columns:d.enum(["one","two"])}).strict(),nodes:d.array(Gy).min(1).max(200),source:By,retired:d.object({fields:d.array(qy).max(1e3),options:d.array(Wy).max(5e3)}).strict(),compatibility:d.object({standardization_version:d.number().int().positive(),diagnostics:d.array(d.string().trim().min(1).max(500)).max(100)}).strict()}).strict().superRefine((e,n)=>{let s=e.nodes.flatMap((r,m)=>r.kind==="field"?[[m,r]]:[]),i=s.map(([,r])=>r);i.length===0&&n.addIssue({code:"custom",path:["nodes"],message:"at least one field node is required"});let o=e.nodes.filter(r=>r.kind==="step-break");!e.features.multistep&&o.length>0&&n.addIssue({code:"custom",path:["nodes"],message:"step-break requires the multistep feature"}),e.features.multistep&&(e.min_runtime_version<ll&&n.addIssue({code:"custom",path:["min_runtime_version"],message:`multistep requires runtime version ${ll}`}),o.length===0&&n.addIssue({code:"custom",path:["nodes"],message:"multistep requires at least one step-break"}));for(let[r,m]of e.nodes.entries())m.kind==="step-break"&&(r===0||r===e.nodes.length-1||e.nodes[r-1]?.kind==="step-break"||e.nodes[r+1]?.kind==="step-break")&&n.addIssue({code:"custom",path:["nodes",r],message:"step-break must separate two non-empty steps"});ke(o.map(r=>r.step_id),["nodes"],"step_id must be unique",n),ke(i.map(r=>mt(r.field_name)),["nodes"],"field_name must be unique",n),ke(e.retired.fields.map(r=>mt(r.field_name)),["retired","fields"],"retired field_name must be unique",n);let a=new Set(e.retired.fields.map(r=>mt(r.field_name)));for(let[r,m]of s)a.has(mt(m.field_name))&&n.addIssue({code:"custom",path:["nodes",r,"field_name"],message:"retired field_name cannot be reused"}),la(m.type,m.options.length,["nodes",r,"options"],n),m.type==="file"?e.min_runtime_version<pl&&n.addIssue({code:"custom",path:["min_runtime_version"],message:`file fields require runtime version ${pl}`}):m.max_files!==void 0&&n.addIssue({code:"custom",path:["nodes",r,"max_files"],message:"max_files is only valid for file fields"}),ke(m.options.map(x=>x.value),["nodes",r,"options"],"option value must be unique within a field",n),ke(m.options.map(x=>gl(x.label,e.content_locale)),["nodes",r,"options"],"option label must be unique within a field",n);ke(e.retired.options.map(r=>un(r.field_name,r.value)),["retired","options"],"retired option identity must be unique",n);let c=new Set(e.retired.options.map(r=>un(r.field_name,r.value)));for(let[r,m]of s)for(let[x,_]of m.options.entries())c.has(un(m.field_name,_.value))&&n.addIssue({code:"custom",path:["nodes",r,"options",x,"value"],message:"retired option value cannot be reused"})}),zy=["copy.title","copy.description","copy.submit_button","copy.success_message","copy.error_message","nodes.*.label","nodes.*.options.*.label"],Hy=new Set(zy);function tL(e){let n=e.map(s=>typeof s=="number"||/^\d+$/.test(s)?"*":s).join(".");return Hy.has(n)}function nL(e,n){let s=[],i=e.nodes.filter(r=>r.kind==="field"),o=new Map(n.nodes.filter(r=>r.kind==="field").map(r=>[mt(r.field_name),r])),a=new Map(n.retired.fields.map(r=>[mt(r.field_name),r])),c=new Map(n.retired.options.map(r=>[un(r.field_name,r.value),r]));for(let r of i){let m=mt(r.field_name),x=o.get(m),_=a.get(m);x&&x.field_name!==r.field_name&&s.push({code:"FIELD_IDENTITY_CHANGED",field_name:r.field_name}),x&&x.type!==r.type&&s.push({code:"FIELD_TYPE_CHANGED",field_name:r.field_name}),!x&&_&&_.field_name!==r.field_name&&s.push({code:"FIELD_IDENTITY_CHANGED",field_name:r.field_name}),!x&&_&&_.type!==r.type&&s.push({code:"FIELD_TYPE_CHANGED",field_name:r.field_name}),!x&&!a.has(m)&&s.push({code:"FIELD_RETIREMENT_MISSING",field_name:r.field_name});let w=new Set(x?.options.map(B=>B.value)??[]);for(let B of r.options){let z=c.get(un(r.field_name,B.value));!w.has(B.value)&&z&&z.field_name!==r.field_name&&s.push({code:"FIELD_IDENTITY_CHANGED",field_name:r.field_name}),!w.has(B.value)&&!z&&s.push({code:"OPTION_RETIREMENT_MISSING",field_name:r.field_name,value:B.value})}}for(let r of e.retired.fields){let m=a.get(mt(r.field_name));m&&m.field_name!==r.field_name&&s.push({code:"FIELD_IDENTITY_CHANGED",field_name:r.field_name}),m&&m.type!==r.type&&s.push({code:"FIELD_TYPE_CHANGED",field_name:r.field_name}),m||s.push({code:"FIELD_RETIREMENT_MISSING",field_name:r.field_name})}for(let r of e.retired.options){let m=c.get(un(r.field_name,r.value));m&&m.field_name!==r.field_name&&s.push({code:"FIELD_IDENTITY_CHANGED",field_name:r.field_name}),m||s.push({code:"OPTION_RETIREMENT_MISSING",field_name:r.field_name,value:r.value})}return s}var $y=d.enum(Cn),Dt=d.object({english:d.string().max(1e3),translations:d.partialRecord($y,d.string().max(1e3)).optional()}).strict(),Vy=d.object({template_option_key:d.string().regex(ul),label:Dt}).strict(),Yy=d.object({template_field_key:d.string().regex(ri),type:d.enum(ai),label:Dt,required:d.boolean(),span:d.enum(["full","half"]),options:d.array(Vy).max(100)}).strict(),Xy=d.object({template_step_key:d.string().regex(ri),after_field_key:d.string().regex(ri)}).strict(),sL=["lead-generation","trial-and-samples","quote-and-commerce","appointments-and-visits","resources-and-subscriptions","service-and-channel"],iL=[1,1,1,1,1,1],hl=d.string().regex(ra),Qy=d.object({schema_version:d.literal(1),slug:hl,template_slugs:d.array(d.string().regex(/^[a-z][a-z0-9-]{0,99}$/)).max(500).optional(),name:Dt,template_count:d.number().int().min(0).max(500)}).strict().superRefine((e,n)=>{e.name.english.trim()===""&&n.addIssue({code:"custom",path:["name","english"],message:"English category name is required"})}),Zy=d.object({schema_version:d.literal(1),slug:d.string().regex(ra),version:d.string().regex(_l),category:hl,copy:d.object({title:Dt,description:Dt,submit_button:Dt,success_message:Dt,error_message:Dt}).strict(),layout:d.object({columns:d.enum(["one","two"])}).strict(),fields:d.array(Yy).min(1).max(200),step_breaks:d.array(Xy).max(20).optional()}).strict().superRefine((e,n)=>{for(let a of["title","description","submit_button","success_message","error_message"])e.copy[a].english.trim()===""&&n.addIssue({code:"custom",path:["copy",a,"english"],message:"English baseline text is required"});ke(e.fields.map(a=>a.template_field_key),["fields"],"template_field_key must be unique",n);let s=new Map(e.fields.map((a,c)=>[a.template_field_key,c])),i=e.step_breaks??[];ke(i.map(a=>a.template_step_key),["step_breaks"],"template_step_key must be unique",n),ke(i.map(a=>a.after_field_key),["step_breaks"],"step breaks must not share an anchor field",n);let o=-1;for(let[a,c]of i.entries()){let r=s.get(c.after_field_key);r===void 0||r>=e.fields.length-1?n.addIssue({code:"custom",path:["step_breaks",a,"after_field_key"],message:"step break must follow an existing non-final field"}):r<=o&&n.addIssue({code:"custom",path:["step_breaks",a,"after_field_key"],message:"step breaks must follow field order"}),o=r??o}e.fields.length+i.length>200&&n.addIssue({code:"custom",path:["step_breaks"],message:"template fields and step breaks must not exceed 200 nodes"});for(let[a,c]of e.fields.entries()){c.label.english.trim()===""&&n.addIssue({code:"custom",path:["fields",a,"label","english"],message:"English field label is required"}),la(c.type,c.options.length,["fields",a,"options"],n),ke(c.options.map(r=>r.template_option_key),["fields",a,"options"],"template_option_key must be unique within a field",n),ke(c.options.map(r=>r.label.english.trim().toLowerCase()),["fields",a,"options"],"English option labels must be unique within a field",n);for(let[r,m]of c.options.entries())m.label.english.trim()===""&&n.addIssue({code:"custom",path:["fields",a,"options",r,"label","english"],message:"English option label is required"})}}),oL=d.object({schema_version:d.literal(1),visibility:d.enum(["internal","public"]),categories:d.array(Qy).max(500),templates:d.array(Zy).max(500)}).strict().superRefine((e,n)=>{let s=(o,a)=>{let c=Cn.filter(r=>!o.translations?.[r]?.trim());c.length>0&&n.addIssue({code:"custom",path:[...a,"translations"],message:`public template copy is missing locales: ${c.join(", ")}`})};ke(e.categories.map(o=>o.slug),["categories"],"template category slug must be unique",n);let i=new Set(e.categories.map(o=>o.slug));for(let[o,a]of e.categories.entries()){let c=e.templates.filter(r=>a.template_slugs?a.template_slugs.includes(r.slug):r.category===a.slug).length;a.template_count!==c&&n.addIssue({code:"custom",path:["categories",o,"template_count"],message:"template_count must match catalog templates"})}ke(e.templates.map(o=>o.slug),["templates"],"template slug must be unique",n);for(let[o,a]of e.templates.entries())(e.categories.some(r=>r.template_slugs!==void 0)?!e.categories.some(r=>r.template_slugs?.includes(a.slug)):!i.has(a.category))&&n.addIssue({code:"custom",path:["templates",o,"category"],message:"template category must exist in catalog categories"});for(let[o,a]of e.categories.entries())if(a.template_slugs){ke(a.template_slugs,["categories",o,"template_slugs"],"template membership must be unique",n);for(let c of a.template_slugs)e.templates.some(r=>r.slug===c)||n.addIssue({code:"custom",path:["categories",o,"template_slugs"],message:"template membership must exist in catalog templates"})}if(e.visibility==="public"){for(let[o,a]of e.categories.entries())s(a.name,["categories",o,"name"]);for(let[o,a]of e.templates.entries()){for(let[c,r]of Object.entries(a.copy))s(r,["templates",o,"copy",c]);for(let[c,r]of a.fields.entries()){s(r.label,["templates",o,"fields",c,"label"]);for(let[m,x]of r.options.entries())s(x.label,["templates",o,"fields",c,"options",m,"label"])}}}});function aL(e,n){let s=Ar(n),i=s?e.translations?.[s]:void 0;return i!==void 0&&i.trim()!==""?i:e.english}var Jy=["Text","Summary","Email","Phone","DropdownSelection","RadioButton","Checkbox","Boolean","Date","Num","MultipleFile","SpecificFile"],ex={text:"Text",textarea:"Summary",email:"Email",phone:"Phone",select:"DropdownSelection",radio:"RadioButton",multiselect:"Checkbox",boolean:"Boolean",date:"Date",number:"Num",file:"MultipleFile"},tx=d.object({value:ma,label:d.string().trim().min(1).max(255)}).strict(),nx=d.object({field_name:is,field_type:d.enum(Jy),field_label:d.string().trim().min(1).max(255),is_required:d.boolean(),sort_order:d.number().int().nonnegative(),options:d.array(tx).max(100)}).strict(),Sl=d.object({version:d.literal(1),locale:Ie,fields:d.array(nx).min(1).max(200)}).strict().superRefine((e,n)=>{ke(e.fields.map(s=>mt(s.field_name)),["fields"],"field_name must be unique",n);for(let[s,i]of e.fields.entries())la(i.field_type,i.options.length,["fields",s,"options"],n),ke(i.options.map(o=>o.value),["fields",s,"options"],"option value must be unique within a field",n),ke(i.options.map(o=>gl(o.label,e.locale)),["fields",s,"options"],"option label must be unique within a field",n)});function rL(e){let n=e.nodes.filter(s=>s.kind==="field").map((s,i)=>({field_name:s.field_name,field_type:s.type==="file"&&s.max_files===1?"SpecificFile":ex[s.type],field_label:s.label,is_required:s.required,sort_order:i,options:s.options.map(o=>({...o}))}));return Sl.parse({version:1,locale:e.content_locale,fields:n})}function cL(e){return{form_display:{columns:e.layout.columns},fields:e.nodes.filter(n=>n.kind==="field").map(n=>({field_name:n.field_name,span:n.span}))}}function mL(e,n){if(e.binding.form_code!==null&&e.binding.form_code!==n.form.form_code)return e;let s=new Map(n.fields.map(i=>[i.field_name,i.span]));return{...e,layout:{columns:n.form.config_basic?.form_display?.columns??e.layout.columns},nodes:e.nodes.map(i=>i.kind==="field"?{...i,span:s.get(i.field_name)??i.span}:i)}}var de=d.string().regex(/^sha256:[0-9a-f]{64}$/),sx=d.union([Re,d.enum(["app/api/forms/[code]/route.ts","hooks/use-cms-form-submit.ts","lib/cms/forms.ts","lib/cms/client.ts"])]),ix=d.object({path:sx,content_hash:de.nullable()}).strict(),ox=d.array(ix).min(1).max(500).superRefine((e,n)=>{ke(e.map(s=>s.path),[],"affected file paths must be unique",n)}),da=d.object({grade:d.enum(["standard","A","B","C"]),required:d.boolean(),pending_confirmations:d.array(d.object({item_id:d.string().regex(ss),field_name:is.optional(),kind:d.enum(["form_copy","layout","field_label","field_type","field_required","field_options"]),message:d.string().trim().min(1).max(500)}).strict().superRefine((e,n)=>{e.kind.startsWith("field_")&&!e.field_name&&n.addIssue({code:"custom",path:["field_name"],message:"field confirmation items require field_name"})})).max(200)}).strict().superRefine((e,n)=>{let s=e.grade==="standard";s===e.required&&n.addIssue({code:"custom",path:["required"],message:s?"standard forms do not require standardization confirmation":"legacy forms require standardization confirmation"}),e.grade==="C"&&e.pending_confirmations.length===0&&n.addIssue({code:"custom",path:["pending_confirmations"],message:"grade C requires at least one pending confirmation"}),e.grade!=="C"&&e.pending_confirmations.length>0&&n.addIssue({code:"custom",path:["pending_confirmations"],message:"only grade C can contain pending confirmations"})}),ax=d.object({site_id:k,form_definition_id:ci,base_snapshot_id:I,expected_form_spec_hash:de,expected_cms_schema_hash:de.nullable(),form_metadata:oa.nullable(),draft_form_spec_hash:de,desired_cms_schema_hash:de,affected_files_hash:de,shared_reference_hash:de,shared_reference_count:d.number().int().positive(),confirm_shared_update:d.boolean(),recreate_missing_binding:d.boolean(),standardization:da,confirm_standardization:d.boolean()}).strict(),fl=d.object({reference_hash:de,page_count:d.number().int().positive(),block_count:d.number().int().positive()}).strict().refine(e=>e.page_count<=e.block_count,{message:"page_count cannot exceed block_count"}),lL=d.object({site_id:k,form_block_id:jy,base_snapshot_id:I,form_spec:pa,runtime_upgrade_required:d.boolean(),expected_form_spec_hash:de,expected_cms_schema_hash:de.nullable(),affected_files_hash:de,shared_impact:fl,standardization:da}).strict(),rx=d.object({operation_id:ca,operation_fingerprint:de,site_id:k,form_definition_id:ci,base_snapshot_id:I,expected_form_spec_hash:de,expected_cms_schema_hash:de.nullable(),form_metadata:oa.nullable(),draft_form_spec:pa,draft_form_spec_hash:de,desired_cms_schema_hash:de,affected_files_hash:de,shared_impact:fl,confirm_shared_update:d.boolean(),recreate_missing_binding:d.boolean(),standardization:da,confirm_standardization:d.boolean()}).strict().superRefine((e,n)=>{e.form_definition_id!==e.draft_form_spec.form_definition_id&&n.addIssue({code:"custom",path:["form_definition_id"],message:"form_definition_id must match draft_form_spec"}),e.shared_impact.block_count>1&&!e.confirm_shared_update&&n.addIssue({code:"custom",path:["confirm_shared_update"],message:"shared definition updates require explicit confirmation"});let s=e.draft_form_spec.binding.status==="missing";s!==e.recreate_missing_binding&&n.addIssue({code:"custom",path:["recreate_missing_binding"],message:s?"missing bindings require explicit recreation confirmation":"only missing bindings can be recreated"});let i=e.draft_form_spec.binding.status==="bound",o=i&&e.standardization.required&&(e.standardization.grade==="B"||e.standardization.grade==="C");(i&&!o&&e.expected_cms_schema_hash===null||!i&&e.expected_cms_schema_hash!==null)&&n.addIssue({code:"custom",path:["expected_cms_schema_hash"],message:i?"bound standard forms require the current CMS schema hash":"unbound or missing forms cannot claim a current CMS schema hash"}),e.confirm_standardization!==e.standardization.required&&n.addIssue({code:"custom",path:["confirm_standardization"],message:e.standardization.required?"legacy standardization requires explicit confirmation":"standard forms cannot claim legacy standardization confirmation"})}),cx=["created","validated","binding_reserved","candidate_ready","cms_applied","snapshot_promoted","committed","compensating","recovery_required","failed"],ua=d.enum(cx),mx=["pending","running","succeeded","failed","recovery_required"],bl=d.enum(mx),lx=["candidate_abandon","snapshot_reconcile","cms_restore"],yl=d.enum(lx),px=["FORM_DESIGN_INVALID","FORM_DESIGN_UNSUPPORTED","FORM_DESIGN_STANDARDIZATION_AGENT_REQUIRED","FORM_DESIGN_STANDARDIZATION_UNSUPPORTED","FORM_DESIGN_FEATURE_NOT_ENABLED","FORM_DESIGN_PERMISSION_DENIED","FORM_DESIGN_LOCKED","FORM_DESIGN_CODE_CONFLICT","FORM_DESIGN_CMS_CONFLICT","FORM_DESIGN_CMS_SCHEMA_MISMATCH","FORM_DESIGN_CMS_NOT_FOUND","FORM_DESIGN_BINDING_MISSING","FORM_DESIGN_OPERATION_CONFLICT","FORM_DESIGN_CMS_UNAVAILABLE","FORM_DESIGN_PATCH_FAILED","FORM_DESIGN_COMPENSATION_FAILED","FORM_DESIGN_RECOVERY_REQUIRED"],_a=d.enum(px),xl=d.enum(["wait","resume","retry_new_operation","manual_recovery","none"]),El=d.enum(["not_started","pending","succeeded","failed"]),Rl=d.object({operation_id:ca,operation_fingerprint:de,site_id:k,form_definition_id:ci,stage:ua,status:bl,base_snapshot_id:I,candidate_snapshot_id:I.nullable(),before_form_code:d.string().regex(_n).nullable(),materialized_form_code:d.string().regex(_n).nullable(),expected_form_spec_hash:de,draft_form_spec_hash:de,materialized_form_spec_hash:de.nullable(),expected_cms_schema_hash:de.nullable(),desired_cms_schema_hash:de,retry_count:d.number().int().nonnegative(),failure_stage:yl.nullable(),last_error_code:_a.nullable(),retryable:d.boolean(),next_action:xl,preview_refresh_status:El,created_at:d.string().datetime({offset:!0}),updated_at:d.string().datetime({offset:!0})}).strict().superRefine((e,n)=>{if(!(e.stage!=="committed"&&e.status!=="succeeded")){(e.stage!=="committed"||e.status!=="succeeded")&&n.addIssue({code:"custom",path:["status"],message:"committed stage and succeeded status must be reported together"});for(let s of["candidate_snapshot_id","materialized_form_code","materialized_form_spec_hash"])e[s]===null&&n.addIssue({code:"custom",path:[s],message:`${s} is required for a committed success`});(e.failure_stage!==null||e.last_error_code!==null||e.retryable||e.next_action!=="none")&&n.addIssue({code:"custom",path:["next_action"],message:"a committed success cannot retain an error or retry action"})}}),ga=d.object({operation:Rl}).strict(),pL=ga,dL=ga,uL=d.object({operation_fingerprint:de}).strict(),_L=ga,dx=d.preprocess(e=>{if(!e||typeof e!="object"||Array.isArray(e))return e;let n="form_metadata"in e?e:{...e,form_metadata:null};return"standardization"in e||"confirm_standardization"in e?n:{...n,standardization:{grade:"standard",required:!1,pending_confirmations:[]},confirm_standardization:!1}},rx),gL=d.object({operation:Rl,request:dx,cms_replace_result:d.unknown().nullable()}).strict(),ux=d.object({stage:ua.optional(),status:bl.optional(),candidate_snapshot_id:I.nullable().optional(),before_form_code:d.string().regex(_n).nullable().optional(),materialized_form_code:d.string().regex(_n).nullable().optional(),materialized_form_spec_hash:de.nullable().optional(),retry_count:d.number().int().nonnegative().optional(),failure_stage:yl.nullable().optional(),last_error_code:_a.nullable().optional(),retryable:d.boolean().optional(),next_action:xl.optional(),preview_refresh_status:El.optional()}).strict(),hL=d.object({expected_updated_at:d.string().datetime({offset:!0}),operation:ux,cms_replace_result:d.unknown().nullable().optional()}).strict().refine(e=>Object.keys(e.operation).length>0||Object.hasOwn(e,"cms_replace_result"),{message:"transition must change operation state or CMS result"}),SL=d.object({code:_a,message:d.string().trim().min(1).max(500),retryable:d.boolean(),operation_id:ca.optional(),stage:ua.optional()}).strict();function _x(e){return ax.parse({site_id:e.site_id,form_definition_id:e.form_definition_id,base_snapshot_id:e.base_snapshot_id,expected_form_spec_hash:e.expected_form_spec_hash,expected_cms_schema_hash:e.expected_cms_schema_hash,draft_form_spec_hash:e.draft_form_spec_hash,desired_cms_schema_hash:e.desired_cms_schema_hash,affected_files_hash:e.affected_files_hash,form_metadata:e.form_metadata,shared_reference_hash:e.shared_impact.reference_hash,shared_reference_count:e.shared_impact.block_count,confirm_shared_update:e.confirm_shared_update,recreate_missing_binding:e.recreate_missing_binding,standardization:e.standardization,confirm_standardization:e.confirm_standardization})}function dl(e){for(let n=0;n<e.length;n+=1){let s=e.charCodeAt(n);if(s>=55296&&s<=56319){let i=e.charCodeAt(n+1);if(n+1>=e.length||i<56320||i>57343)throw new TypeError("canonical JSON cannot contain a lone surrogate");n+=1}else if(s>=56320&&s<=57343)throw new TypeError("canonical JSON cannot contain a lone surrogate")}}function aa(e,n){if(e===null)return"null";if(typeof e=="boolean")return e?"true":"false";if(typeof e=="number"){if(!Number.isFinite(e))throw new TypeError("canonical JSON numbers must be finite");return JSON.stringify(e)}if(typeof e=="string")return dl(e),JSON.stringify(e);if(typeof e!="object")throw new TypeError("value is not valid JSON");if(n.has(e))throw new TypeError("canonical JSON cannot contain cycles");n.add(e);try{if(Array.isArray(e)){let a=[];for(let c=0;c<e.length;c+=1){if(!(c in e))throw new TypeError("canonical JSON cannot contain sparse arrays");a.push(aa(e[c],n))}return`[${a.join(",")}]`}let s=Object.getPrototypeOf(e);if(s!==Object.prototype&&s!==null)throw new TypeError("canonical JSON objects must be plain records");let i=e;return`{${Object.keys(i).sort().map(a=>(dl(a),`${JSON.stringify(a)}:${aa(i[a],n)}`)).join(",")}}`}finally{n.delete(e)}}function ha(e){return aa(e,new Set)}async function mi(e){let n=ha(e),s=new TextEncoder().encode(n),i=globalThis.crypto?.subtle?new Uint8Array(await globalThis.crypto.subtle.digest("SHA-256",s)):(await import("@noble/hashes/sha256")).sha256(s);return`sha256:${Array.from(i,a=>a.toString(16).padStart(2,"0")).join("")}`}async function fL(e){return mi(pa.parse(e))}async function bL(e){return mi(Sl.parse(e))}async function yL(e){let n=ox.parse(e).map(s=>({...s})).sort((s,i)=>s.path<i.path?-1:s.path>i.path?1:0);return mi({version:1,files:n})}async function xL(e){return mi(_x(e))}import{z as D}from"zod";var IL=["page-seo","root-layout-metadata","nav-items"],TL=D.object({path:D.string(),title:D.string(),description:D.string().optional(),keywords:D.string().optional(),meta_tags_json:D.record(D.string(),D.record(D.string(),D.string())).nullish(),schema_json:D.union([D.record(D.string(),D.unknown()),D.array(D.record(D.string(),D.unknown())),D.string()]).nullish(),breadcrumbs_json:D.array(D.object({name:D.string().optional(),text:D.string().optional(),url:D.string().nullish()})).nullish()}),kL=D.object({metadataBase:D.string().optional(),title:D.union([D.string(),D.object({default:D.string().optional(),template:D.string().optional(),absolute:D.string().optional()})]).optional(),description:D.string().optional(),keywords:D.string().optional(),openGraph:D.object({title:D.string().optional(),description:D.string().optional(),type:D.string().optional(),siteName:D.string().optional(),url:D.string().optional(),locale:D.string().optional(),images:D.array(D.union([D.string(),D.object({url:D.string(),alt:D.string().optional()})])).optional()}).optional(),twitter:D.object({card:D.string().optional(),title:D.string().optional(),description:D.string().optional(),images:D.array(D.string()).optional()}).optional(),alternates:D.object({canonical:D.string().optional()}).optional(),robots:D.union([D.string(),D.record(D.string(),D.unknown())]).optional()}),Il=()=>D.object({label:D.string(),href:D.string().optional(),targetType:D.enum(["page","anchor","external","email","phone","file","group"]).optional(),role:D.enum(["link","cta"]).optional(),openInNewTab:D.boolean().optional(),nofollow:D.boolean().optional(),description:D.string().optional(),badge:D.string().optional(),iconKey:D.string().optional()}),AL=Il().extend({children:D.array(Il()).optional()}),gx=["title","description","keywords","breadcrumbs_json.*.name","breadcrumbs_json.*.text"],hx=["path","meta_tags_json.**","schema_json.**","breadcrumbs_json.*.url"],Sx=["title","title.default","title.template","title.absolute","description","keywords","openGraph.title","openGraph.description","openGraph.siteName","openGraph.images.*.alt","twitter.title","twitter.description"],fx=["metadataBase","openGraph.type","openGraph.url","openGraph.locale","openGraph.images.*","openGraph.images.*.url","twitter.card","twitter.images.*","alternates.canonical","robots.**"],bx=["label","description","badge"],yx=["href","targetType","role","iconKey"],Tl={"page-seo":{localizable:gx,machine:hx},"root-layout-metadata":{localizable:Sx,machine:fx},"nav-items":{localizable:bx,machine:yx}},kl="*",Al="**",xx="children";function Ex(e){return typeof e=="number"||/^\d+$/.test(e)?kl:e}function Pl(e,n){let s=n.map(Ex);return e!=="nav-items"?s:s.filter(i=>i!==kl&&i!==xx)}function wl(e,n){let s=e.split(".");for(let i=0;i<s.length;i+=1){if(s[i]===Al)return!0;if(i>=n.length||s[i]!==n[i])return!1}return s.length===n.length}function Rx(e,n){let s=e.split(".");if(n.length>=s.length)return!1;for(let i=0;i<n.length;i+=1){if(s[i]===Al)return!0;if(s[i]!==n[i])return!1}return!0}function PL(e,n){let s=Pl(e,n);return s.length===0?!1:Tl[e].localizable.some(i=>wl(i,s))}function wL(e,n){let s=Pl(e,n);if(s.length===0)return!0;let{localizable:i,machine:o}=Tl[e];return[...i,...o].some(a=>wl(a,s)||Rx(a,s))}var DL=["product-search","migration-products","standard-form","form-submission-infrastructure"],Ix=[{path:"app/search/page.tsx",materializer:"product-search"},{path:"components/site/generated/product-search/entry.tsx",materializer:"product-search"},{path:"components/site/generated/product-search/results.tsx",materializer:"product-search"},{path:"app/api/product-search/facets/route.ts",materializer:"product-search"},{path:"lib/cms/product-search.ts",materializer:"product-search"},{path:"lib/generated/product-search-value-codec.ts",materializer:"product-search"},{path:"lib/generated/product-search-config.json",materializer:"product-search"},{path:`lib/cms/generated/${ft}.ts`,materializer:"migration-products"},{path:`components/site/generated/${ft}-list.tsx`,materializer:"migration-products"},{path:`app/${ft}/[slug]/page.tsx`,materializer:"migration-products"},{path:`components/site/generated/${ft}-breadcrumb.tsx`,materializer:"migration-products"},{path:"components/site/generated/forms/vcp-form-runtime.tsx",materializer:"standard-form"},{path:"app/api/forms/[code]/route.ts",materializer:"form-submission-infrastructure"},{path:"hooks/use-cms-form-submit.ts",materializer:"form-submission-infrastructure"},{path:"lib/cms/forms.ts",materializer:"form-submission-infrastructure"}],Tx=[{prefix:"components/site/generated/forms/form-",suffix:".tsx",materializer:"standard-form"}],OL=[{path:`components/site/generated/${ft}-list-view.tsx`,reason:"\u8DEF\u5F84\u5F52\u5E73\u53F0\u3001\u5185\u5BB9\u5F52\u7AD9\u70B9\uFF1A\u4E13\u7528\u4EA7\u54C1 Worker \u6309\u7AD9\u70B9\u8BBE\u8BA1\u751F\u6210\u5217\u8868\u89C6\u56FE\uFF1B\u9996\u6B21 fallback \u4E0D\u6539\u53D8\u5F52\u5C5E\uFF0C\u9759\u6001\u6587\u6848\u987B\u968F\u5B50\u7AD9\u7FFB\u8BD1\u3002"},{path:`components/site/generated/${ft}-detail-view.tsx`,reason:"\u8DEF\u5F84\u5F52\u5E73\u53F0\u3001\u5185\u5BB9\u5F52\u7AD9\u70B9\uFF1A\u4E13\u7528\u4EA7\u54C1 Worker \u6309\u7AD9\u70B9\u8BBE\u8BA1\u751F\u6210\u8BE6\u60C5\u89C6\u56FE\uFF1B\u9996\u6B21 fallback \u4E0D\u6539\u53D8\u5F52\u5C5E\uFF0C\u9759\u6001\u6587\u6848\u987B\u968F\u5B50\u7AD9\u7FFB\u8BD1\u3002"},{path:"lib/cms/client.ts",reason:"\u4E0D\u662F\u7269\u5316\u4EA7\u7269\uFF1A\u6A21\u677F\u81EA\u5E26\u7684 CMS \u4F20\u8F93\u5C42\uFF0C\u7269\u5316\u5668\u53EA\u5BF9\u5B83\u505A\u5B9A\u70B9\u5B57\u7B26\u4E32\u5347\u7EA7\uFF08\u591A\u90E8\u5206\u8868\u5355\u63D0\u4EA4\u3001no-store \u8BFB\uFF09\uFF0C\u6574\u4EFD\u8986\u5199\u53CD\u800C\u4F1A\u62B9\u6389\u7AD9\u70B9\u4FA7\u7684\u5176\u4ED6\u5347\u7EA7\u3002"},{path:"components/site/generated/forms/form-<id>.spec.ts",reason:"\u8DEF\u5F84\u5F52\u5E73\u53F0\u3001\u5185\u5BB9\u5F52\u7AD9\u70B9\uFF1A\u8868\u5355\u8BBE\u8BA1\u5668\u5199\u7684\u5B57\u6BB5\u6587\u6848\uFF0C\u5F52 FORM_SPEC_LOCALIZABLE_FIELD_PATHS \u7684\u5B57\u6BB5\u7EA7\u6E05\u5355\u7BA1\u8F96\u3002"},{path:"components/system/not-found-content.tsx",reason:"\u4E00\u6B21\u6027\u5199\u5165\u3001\u4E4B\u540E\u5185\u5BB9\u5F52\u7AD9\u70B9\uFF1A\u5EFA\u7AD9\u65F6\u4EC5\u5728\u6A21\u677F\u539F\u7248\u4E0A\u6309\u7AD9\u70B9\u8BED\u79CD\u5199\u4E00\u6B21 404 \u6587\u6848\uFF0C\u4E4B\u540E\u7531\u7528\u6237\u3001\u8BBE\u8BA1\u5668\u6216 Agent \u7EF4\u62A4\uFF0C\u91CD\u8DD1\u4E5F\u4E0D\u4F1A\u8986\u5199\u6539\u8FC7\u7684\u5185\u5BB9\uFF1B\u5B50\u7AD9\u987B\u968F\u6574\u7AD9\u7FFB\u8BD1\u5B83\u3002"}];function kx(e){return e.length>0&&!e.includes("/")&&!e.includes(".")}function NL(e){return Ix.some(n=>n.path===e)?!0:Tx.some(n=>!e.startsWith(n.prefix)||!e.endsWith(n.suffix)?!1:kx(e.slice(n.prefix.length,e.length-n.suffix.length)))}import{z as yt}from"zod";var Ax=["provisioning","cms_app_created","seeded","ready","failed"],UL=yt.object({tenant_id:yt.string().min(1),site_id:k,collection_slug:yt.string().min(1),cms_collection_id:yt.string().min(1).nullable(),status:yt.enum(Ax),owned_by_vcp:yt.boolean(),run_id:$.nullable(),last_error:yt.string().nullable(),created_at:yt.string().datetime(),updated_at:yt.string().datetime()});var Cl="/vibe/v1";function Px(e){let n=e?.trim().replace(/\/+$/,"");if(!n)return null;try{let s=new URL(n),i=s.pathname.replace(/\/+$/,"");return s.search="",s.hash="",s.pathname=i.endsWith(Cl)?i:Cl,s.href.replace(/\/+$/,"")}catch{return n}}function GL(e){let n=Px(e.publicProxyUrl),s=e.cmsSiteId?.trim(),i=e.tenantId?.trim();return n&&s&&i?{cmsProxyUrl:n,cmsProjectId:s,cmsTenantId:i}:null}function WL(e){let n=e.tenant_id?.trim(),s=e.cms_site_id?.trim();if(!n||!s)throw new Error("CMS_REQUEST_CONTEXT_MISSING");return{Accept:"application/json","X-Tenant-Id":n,"X-Site-Id":s}}import{z as g}from"zod";var li=g.string().url().refine(Vx,{message:"URL must use http or https"}),vl=g.string().trim().pipe(li),wx=g.object({task_type:g.literal("home_url"),task_url:vl,planned_num:g.number().int().min(1).max(20).optional()}).strict(),Cx=g.object({task_type:g.literal("url_list"),urls:g.array(li).min(1).max(1e4)}).strict(),HL=g.discriminatedUnion("task_type",[wx,Cx]),$L=g.object({page:g.coerce.number().int().positive().default(1),page_size:g.coerce.number().int().min(1).max(20).default(20)}).strict(),VL=g.object({home_url:vl}).strict(),$t=g.string().uuid(),gn=g.string().uuid(),YL=g.object({task_uuid:$t}).strict(),Dl=g.enum(["URL_DISCOVERY","PAGE_CRAWL","TASK_SCHEDULING","RESULT_PERSISTENCE"]),vx=g.object({task_uuid:$t,status:g.literal("NOT_STARTED"),total:g.literal(0)}).strict(),Dx=g.object({task_uuid:$t,status:g.literal("PROCESSING"),total:g.literal(0)}).strict(),XL=g.enum(["no_suitable_page_candidate","page_discovery_unavailable","page_selection_unavailable","page_selection_invalid","page_content_unavailable"]),Ox=g.discriminatedUnion("status",[g.object({role:kt,status:g.literal("selected"),reason_code:g.null()}).strict(),g.object({role:kt,status:g.literal("not_found"),reason_code:g.literal("no_suitable_page_candidate")}).strict(),g.object({role:kt,status:g.literal("unknown"),reason_code:g.enum(["page_discovery_unavailable","page_selection_unavailable","page_selection_invalid","page_content_unavailable"])}).strict()]),Ol=g.array(Ox).length(7).superRefine((e,n)=>{let s=new Set(e.map(i=>i.role));s.size!==e.length&&n.addIssue({code:"custom",message:"discovery coverage roles must be unique"});for(let i of kt.options)s.has(i)||n.addIssue({code:"custom",message:`discovery coverage is missing role ${i}`})}),Nx=g.object({task_uuid:$t,status:g.literal("SUCCEEDED"),total:g.number().int().positive(),discovery_coverage:Ol.optional()}).strict(),jx=g.enum(["TASK_FAILED","PROVIDER_CAPABILITY_LIMIT","WEBSITE_UNREACHABLE"]),Lx=g.object({task_uuid:$t,status:g.literal("FAILED"),total:g.literal(0),error_code:jx,error_message:g.string().min(1),failure_stage:Dl}).strict(),QL=g.discriminatedUnion("status",[vx,Dx,Nx,Lx]),Mx=g.object({url:li,raw_html:g.string().min(1)}).strict(),ZL=g.object({task_uuid:$t,status:g.literal("SUCCEEDED"),page:g.number().int().positive(),page_size:g.number().int().min(1).max(20),total:g.number().int().positive(),total_pages:g.number().int().positive(),pages:g.array(Mx).max(20),discovery_coverage:Ol.optional()}).strict().superRefine((e,n)=>{e.total_pages!==Math.ceil(e.total/e.page_size)&&n.addIssue({code:"custom",path:["total_pages"],message:"total_pages must equal ceil(total / page_size)"}),e.pages.length>e.page_size&&n.addIssue({code:"custom",path:["pages"],message:"pages must not exceed page_size"})}),JL=g.object({task_code:gn}).strict(),Ux=g.object({task_code:gn,status:g.literal("NOT_STARTED")}).strict(),Fx=g.object({task_code:gn,status:g.literal("PROCESSING")}).strict(),Gx=g.object({task_code:gn,status:g.literal("SUCCEEDED"),urls:g.array(li)}).strict(),qx=g.literal("SITEMAP_DISCOVERY_FAILED"),Wx=g.object({task_code:gn,status:g.literal("FAILED"),error_code:qx,error_message:g.string().min(1)}).strict(),eM=g.discriminatedUnion("status",[Ux,Fx,Gx,Wx]),tM=g.object({company_name:g.string().regex(/\S/u)}).strict(),Bx=g.object({company_name:g.string(),brand_name:g.string(),main_products:g.array(g.string()),industry:g.array(g.string()),subfields:g.array(g.string()),business_intro:g.string(),registered_capital:g.string(),legal_representative:g.string(),target_markets:g.array(g.string()),target_customer_industries:g.array(g.string()),target_customer_roles:g.array(g.string()),purchase_scenarios:g.string(),differentiators:g.array(g.string()),competitors:g.array(g.object({name:g.string(),official_url:g.string()}).strict()).max(3),qualifications:g.array(g.string()),representative_cases:g.array(g.string()),acquisition_channels:g.array(g.string()),desired_domain:g.string(),brand_tone:g.string(),timezone:g.string()}).strict(),pi=g.object({company_uuid:g.string().uuid(),company_info:Bx,created_at:g.string().datetime(),updated_at:g.string().datetime()}),Kx=pi.extend({status:g.literal("NOT_STARTED"),last_error_code:g.null(),last_error_message:g.null(),started_at:g.null(),completed_at:g.null()}).strict(),zx=pi.extend({status:g.literal("PROCESSING"),last_error_code:g.null(),last_error_message:g.null(),started_at:g.string().datetime(),completed_at:g.null()}).strict(),Nl=pi.extend({status:g.literal("SUCCEEDED"),last_error_code:g.null(),last_error_message:g.null(),started_at:g.string().datetime(),completed_at:g.string().datetime()}).strict(),jl=pi.extend({status:g.literal("FAILED"),last_error_code:g.string().min(1),last_error_message:g.string().min(1),started_at:g.string().datetime(),completed_at:g.string().datetime()}).strict(),nM=g.discriminatedUnion("status",[Nl,jl]),sM=g.discriminatedUnion("status",[Kx,zx,Nl,jl]),Hx=["BAD_REQUEST","NOT_FOUND","PAYLOAD_TOO_LARGE","INTERNAL_SERVER_ERROR","UNAUTHORIZED","FORBIDDEN","INVALID_TASK_TYPE","TASK_URL_REQUIRED","INVALID_PLANNED_NUM","URL_LIST_REQUIRED","URL_LIST_LIMIT_EXCEEDED","INVALID_URL_LIST","INVALID_PAGINATION","INVALID_TASK_CODE","INVALID_HOME_URL","TASK_CODE_HOME_URL_CONFLICT","SITEMAP_TASK_NOT_FOUND","SITEMAP_DISCOVERY_FAILED","TASK_NOT_FOUND","PROVIDER_CAPABILITY_LIMIT","TASK_FAILED","WEBSITE_UNREACHABLE"],$x=g.enum(Hx),iM=g.object({error_code:$x,error_message:g.string().min(1),failure_stage:Dl.optional(),task_uuid:$t.optional(),task_code:gn.optional()}).strict();function Vx(e){try{let n=new URL(e).protocol;return n==="http:"||n==="https:"}catch{return!1}}import{z as W}from"zod";var Xe=W.string().url().refine(Qx,{message:"URL must use http or https"}),Ll=W.string().min(1).max(512),di=W.string().datetime({offset:!0}),Ml=W.enum(["scraping","completed","failed","expired"]),rM=W.object({url:Xe,ignore_cache:W.boolean(),sitemap:W.enum(["include","skip"]),include_subdomains:W.boolean(),ignore_query_parameters:W.boolean(),limit:W.number().int().min(1).max(1e5)}).strict(),cM=W.object({links:W.array(Xe).max(1e5)}).strict(),mM=W.object({url:Xe,limit:W.number().int().min(1).max(1e5),max_discovery_depth:W.literal(1),crawl_entire_domain:W.literal(!1),allow_subdomains:W.literal(!0),sitemap:W.literal("skip")}).strict(),lM=W.object({crawl_id:Ll,expires_at:di.optional()}).strict(),pM=W.object({status:Ml,urls:W.array(Xe).max(1e5),next:Xe.optional(),expires_at:di}).strict(),dM=W.object({url:Xe,formats:W.tuple([W.literal("rawHtml")]),only_main_content:W.literal(!1),max_age:W.number().int().nonnegative()}).strict(),uM=W.object({url:Xe,raw_html:W.string().min(1),status_code:W.number().int().min(100).max(599).nullable()}).strict(),_M=W.object({urls:W.array(Xe).min(1).max(1e4),formats:W.tuple([W.literal("rawHtml")]),ignore_invalid_urls:W.literal(!1),max_age:W.number().int().nonnegative(),max_concurrency:W.number().int().positive().optional()}).strict(),gM=W.object({batch_id:Ll,expires_at:di.optional()}).strict(),Yx=W.object({url:Xe,raw_html:W.string().min(1)}).strict(),hM=W.object({status:Ml,total:W.number().int().nonnegative(),completed:W.number().int().nonnegative(),pages:W.array(Yx).max(1e4),next:Xe.optional(),expires_at:di}).strict().superRefine((e,n)=>{e.completed>e.total&&n.addIssue({code:"custom",path:["completed"],message:"completed must not exceed total"})}),Xx=W.object({url:Xe,error_message:W.string().min(1)}).strict(),SM=W.object({errors:W.array(Xx).max(1e4),robots_blocked:W.array(Xe).max(1e4)}).strict(),fM=W.object({active:W.number().int().nonnegative(),waiting:W.number().int().nonnegative(),max_concurrency:W.number().int().positive()}).strict();function Qx(e){try{let n=new URL(e).protocol;return n==="http:"||n==="https:"}catch{return!1}}var Ul=["write_file","edit_file","delete_file"],Fl="apply_patch_batch",Zx=["set_breadcrumb_placement"],Jx=[...Ul,Fl,...Zx];function eE(e){return Ul.includes(e)}function yM(e){return Jx.includes(e)}function xM(e){return eE(e)||e===Fl}import{z as y}from"zod";var Gl=y.lazy(()=>hn),tE=y.enum(["page","block"]),_i=y.enum(["component","page","pages"]),nE=y.enum(["en-US","zh-CN","zh-TW","fr-FR","de-DE","es-ES","ja-JP","ko-KR"]),Vt=nE,ql=y.object({requested_locale:Vt,resolved_locale:Vt,fallback_used:y.boolean()}).strict(),os=y.object({id:y.string().uuid(),key:y.string().min(1),name:y.string().min(1)}).strict(),ui=os.extend({color:y.string().nullable()}).strict(),kM=y.object({kind:tE,category_id:y.string().uuid().optional(),tag_id:y.string().uuid().optional(),search:y.string().trim().min(1).max(200).optional(),limit:y.coerce.number().int().min(1).max(50).default(20),cursor:y.string().min(1).optional()}).strict(),sE=y.object({stable_key:y.string().min(1),type:_i,title:y.string().min(1).max(200),description:y.string().max(1e3),thumbnail_url:y.string().url().nullable(),resolved_version:y.number().int().positive(),content_schema_version:y.literal(3),category:os.nullable(),tags:y.array(ui),page_count:y.number().int().nonnegative(),component_count:y.number().int().nonnegative(),locale:ql}).strict(),AM=y.object({items:y.array(sE),facets:y.object({categories:y.array(os),tags:y.array(ui)}).strict(),next_cursor:y.string().nullable()}).strict(),PM=y.object({operation_id:y.string().uuidv7(),resolved_version:y.number().int().positive(),base_sitemap_id:y.string().uuid(),base_sitemap_version:y.number().int().positive(),sitemap:Gl,target_page_id:y.string().min(1).optional()}).strict(),wM=y.object({next_sitemap:Gl,applied:y.object({stable_key:y.string().min(1),resolved_version:y.number().int().positive(),template_type:_i,page_ids:y.array(y.string().min(1)),block_ids:y.array(y.string().min(1))}).strict(),locale:ql,warnings:y.array(y.string())}).strict(),Wl=y.object({nodeId:y.string().uuid(),type:y.string().trim().min(1).max(100),label:y.string().trim().min(1).max(200),variant:y.string().trim().min(1).max(100).optional(),order:y.number().int().nonnegative(),props:y.record(y.string(),y.unknown()),thumbnail:y.string().url().optional(),source:y.unknown().optional()}).strict(),Bl=y.object({nodeId:y.string().uuid().optional(),slug:y.string().regex(/^\/$|^\/[a-z0-9]+(?:-[a-z0-9]+)*(?:\/[a-z0-9]+(?:-[a-z0-9]+)*)*$/u),navigation:y.object({showInHeader:y.boolean(),showInFooter:y.boolean(),order:y.number().int().nonnegative()}).strict(),components:y.array(Wl).min(1).max(100),thumbnail:y.string().url().optional(),source:y.unknown().optional()}).strict(),iE=Bl.extend({nodeId:y.uuidv7(),parentNodeId:y.uuidv7().optional()}).strict(),oE=y.object({pages:y.array(iE).min(1).max(50),thumbnail:y.string().url().optional(),source:y.unknown().optional()}).strict().superRefine(({pages:e},n)=>{let s=new Map(e.map(o=>[o.nodeId,o])),i=e.flatMap(o=>[o.nodeId,...o.components.map(a=>a.nodeId)]);new Set(i).size!==i.length&&n.addIssue({code:"custom",path:["pages"],message:"Node ids must be unique within the shared structure."}),new Set(e.map(o=>o.slug)).size!==e.length&&n.addIssue({code:"custom",path:["pages"],message:"Page slugs must be unique."});for(let[o,a]of e.entries()){if(a.parentNodeId===void 0)continue;let c=_=>n.addIssue({code:"custom",path:["pages",o,"parentNodeId"],message:_}),r=s.get(a.parentNodeId);r||c("Parent must reference a page in this template."),a.parentNodeId===a.nodeId&&c("A page cannot be its own parent."),(a.slug==="/"||r?.slug==="/")&&c("The home page cannot be a parent or child."),r?.parentNodeId!==void 0&&c("Pages allow at most two levels; the parent must be a root page.");let m=new Set([a.nodeId]),x=a.parentNodeId;for(;x!==void 0;){if(m.has(x)){c("Page parent references must not contain a cycle.");break}m.add(x),x=s.get(x)?.parentNodeId}}}),aE=y.union([Wl,Bl,oE]),rE=y.object({title:y.string().min(1).max(200),description:y.string().min(1).max(1e3),prompt:y.string().min(1).max(8192)}).strict(),cE=y.object({locale:Vt,title:y.string().min(1).max(200),content:y.object({description:y.string().min(1).max(1e3),prompt:y.string().min(1).max(8192),nodes:y.record(y.string().uuid(),rE)}).strict()}).strict(),CM=y.object({templateId:y.string().uuid(),stableKey:y.string().min(1),type:_i,resolvedVersion:y.number().int().positive(),contentSchemaVersion:y.literal(3),structure:aE,requestedLocale:Vt,resolvedLocale:Vt,fallbackUsed:y.boolean(),contents:y.array(cE).length(1)}).strict().superRefine((e,n)=>{(e.type==="component"&&!("type"in e.structure)||e.type==="page"&&!("components"in e.structure)||e.type==="pages"&&!("pages"in e.structure))&&n.addIssue({code:"custom",path:["structure"],message:"Template type and structure must match."});let s=mE(e.structure),i=new Set(Object.keys(e.contents[0]?.content.nodes??{}));(s.size!==i.size||[...s].some(o=>!i.has(o)))&&n.addIssue({code:"custom",path:["contents",0,"content","nodes"],message:"Localized nodes must exactly match the structure nodes."}),e.contents[0]?.locale!==e.resolvedLocale&&n.addIssue({code:"custom",path:["contents"],message:"Resolved locale must match returned content."}),e.fallbackUsed!==(e.requestedLocale!==e.resolvedLocale)&&n.addIssue({code:"custom",path:["fallbackUsed"],message:"fallbackUsed must match locale resolution."})}),vM=y.object({items:y.array(y.object({stableKey:y.string().min(1),type:_i,title:y.string().min(1).max(200),description:y.string().max(1e3),thumbnailUrl:y.string().url().nullable(),resolvedVersion:y.number().int().positive(),contentSchemaVersion:y.literal(3),category:os.nullable(),tags:y.array(ui),pageCount:y.number().int().nonnegative(),componentCount:y.number().int().nonnegative(),requestedLocale:Vt,resolvedLocale:Vt,fallbackUsed:y.boolean()}).strict()),facets:y.object({categories:y.array(os),tags:y.array(ui)}).strict(),nextCursor:y.string().nullable()}).strict().superRefine((e,n)=>{e.items.forEach((s,i)=>{s.fallbackUsed!==(s.requestedLocale!==s.resolvedLocale)&&n.addIssue({code:"custom",path:["items",i,"fallbackUsed"],message:"fallbackUsed must match locale resolution."})})});function mE(e){if("type"in e)return new Set([e.nodeId]);let n="pages"in e?e.pages:[e];return new Set(n.flatMap(s=>[...s.nodeId?[s.nodeId]:[],...s.components.map(i=>i.nodeId)]))}function DM(e){return ha({tenant_id:e.tenant_id,site_id:e.site_id,stable_key:e.stable_key,resolved_version:e.request.resolved_version,base_sitemap_id:e.request.base_sitemap_id,base_sitemap_version:e.request.base_sitemap_version,sitemap:e.request.sitemap,target_page_id:e.request.target_page_id??null})}import{z as H}from"zod";var lE=["pending_dns","active","failed","removing"],pE=H.enum(lE),dE=["serve_site","redirect_301"],uE=H.enum(dE),_E=["traffic","ownership","certificate_delegation"],Sa=H.enum(_E),gE=["pending","verified"],hE=H.enum(gE),SE=["not_applicable","unavailable","not_needed","auto_applied","confirmation_required","blocked"],fE=H.enum(SE),fa=H.enum(["prepare_configuration","apply_configuration","verify_dns","remediate_dns","confirm_dns_remediation"]),bE=H.enum(["accepted","running","succeeded","failed"]),yE=H.object({code:H.string().min(1),message:H.string().min(1)}).strict(),xE=H.object({purpose:Sa,verified:H.boolean(),observedValues:H.array(H.string())}).strict(),Kl=H.object({ready:H.boolean(),providerReady:H.boolean(),dnsVerified:H.boolean(),records:H.array(xE)}).strict(),zl=H.object({type:H.string().min(1),name:H.string().min(1),value:H.string().min(1),ttl:H.number().nullable()}).strict(),EE=H.object({purpose:Sa,action:H.enum(["none","create","update","blocked"]),before:zl.nullable(),after:zl.nullable()}).strict(),Hl=H.object({domainId:H.string().min(1),status:fE,changes:H.array(EE)}).strict(),RE=H.object({purpose:Sa,type:H.string().min(1),name:H.string().min(1),value:H.string().min(1),verificationStatus:hE}).strict(),$l=H.object({id:H.string().min(1),hostname:H.string().min(1),isPrimary:H.boolean(),routingMode:uE,observedStatus:pE,lastVerifiedAt:H.string().datetime().nullable(),dnsRecords:H.array(RE)}).strict().superRefine((e,n)=>{IE(e.hostname)||n.addIssue({code:"custom",path:["hostname"],message:"hostname must be a canonical ASCII hostname"}),e.isPrimary&&e.routingMode!=="serve_site"&&n.addIssue({code:"custom",path:["routingMode"],message:"a primary domain must serve the site"}),!e.isPrimary&&e.routingMode!=="redirect_301"&&n.addIssue({code:"custom",path:["routingMode"],message:"a non-primary domain must redirect with 301"})}),Vl=H.object({primaryDomain:$l.nullable(),redirectDomains:H.array($l)}).strict().superRefine((e,n)=>{e.primaryDomain!==null&&(!e.primaryDomain.isPrimary||e.primaryDomain.routingMode!=="serve_site")&&n.addIssue({code:"custom",path:["primaryDomain"],message:"primaryDomain must be primary and serve the site"});for(let[i,o]of e.redirectDomains.entries())(o.isPrimary||o.routingMode!=="redirect_301")&&n.addIssue({code:"custom",path:["redirectDomains",i],message:"redirectDomains must be non-primary 301 redirects"});e.primaryDomain!==null&&e.redirectDomains.some(o=>o.hostname===e.primaryDomain?.hostname)&&n.addIssue({code:"custom",path:["redirectDomains"],message:"primaryDomain must not also be a redirect"});let s=[...e.primaryDomain===null?[]:[e.primaryDomain.hostname],...e.redirectDomains.map(i=>i.hostname)];new Set(s).size!==s.length&&n.addIssue({code:"custom",path:["redirectDomains"],message:"domain hostnames must be unique"})}),gi=H.object({id:H.string().min(1),type:fa,status:bE,error:yE.nullable(),result:H.union([Kl,Hl]).nullable().optional()}).strict().superRefine((e,n)=>{if(e.status==="failed"&&e.error===null&&n.addIssue({code:"custom",path:["error"],message:"failed operations must include a stable error"}),e.status!=="failed"&&e.error!==null&&n.addIssue({code:"custom",path:["error"],message:"non-failed operations must not include an error"}),!(e.result===void 0||e.result===null)){if(e.status!=="succeeded"){n.addIssue({code:"custom",path:["result"],message:"operation results only belong to succeeded operations"});return}if(e.type==="verify_dns"){Kl.safeParse(e.result).success||n.addIssue({code:"custom",path:["result"],message:"verify_dns operations require a DNS verification result"});return}if(e.type==="remediate_dns"){Hl.safeParse(e.result).success||n.addIssue({code:"custom",path:["result"],message:"remediate_dns operations require a DNS remediation result"});return}n.addIssue({code:"custom",path:["result"],message:"only verify_dns and remediate_dns operations may carry a result"})}});function IE(e){if(e!==e.trim()||e!==e.toLowerCase()||e.length>253||e.endsWith("."))return!1;let n=e.split(".");return n.length>=2&&n[n.length-1].length>=2&&n.every(s=>s.length>=1&&s.length<=63&&/^[a-z0-9-]+$/.test(s)&&!s.startsWith("-")&&!s.endsWith("-"))}import{z as Ue}from"zod";import{z as b}from"zod";var TE=b.enum(["active","completed","canceled"]),kE=b.enum(["quality","domain","gsc","publish"]),Si=b.enum(["pending","running","succeeded","failed"]),Xl=Si,Ql=b.enum(["pending","running","completed"]),AE=b.object({group_code:b.string().min(1),name:b.string().min(1),score:b.number().nonnegative(),total_score:b.number().nonnegative(),pass_score:b.number().nonnegative(),running_status:Ql,result_text:b.string()}).strict(),PE=b.object({id:b.number().int().positive().optional(),quality_task_id:b.number().int().positive(),item_code:b.string().min(1),status:Si,is_repaired:b.boolean(),total_score:b.number().nonnegative(),score:b.number().nonnegative(),check_result:b.unknown().nullable(),remediation_items:b.unknown().nullable(),result_text:b.string(),created_at:b.string().min(1),updated_at:b.string().min(1),item_name:b.string().min(1),dimension_code:b.enum(["reach","trust","convert","safe"]),group_code:b.string().min(1),auto_fix:b.boolean()}).strict(),wE=b.object({dimension_code:b.enum(["reach","trust","convert","safe"]),name:b.string().min(1),alias_en:b.string().min(1),description:b.string(),tips:b.string(),score:b.number().nonnegative(),repaired_score:b.number().nonnegative(),total_score:b.number().nonnegative(),pass_score:b.number().nonnegative(),running_status:Ql,problem_group_count:b.number().int().nonnegative(),remediation_items:b.array(PE),groups:b.array(AE)}).strict(),CE=b.object({id:b.number().int().positive(),task_code:b.string().uuid(),scene_code:b.enum(["site_publish","vcp_published_pages","content_publish"]),tenant_id:b.string().min(1),vcp_site_id:k,cms_site_id:b.string().min(1),checked_url:b.string().url(),quality_params:b.record(b.string(),b.unknown()).nullable(),status:Si,error_info:b.record(b.string(),b.unknown()).nullable(),created_at:b.string().min(1),updated_at:b.string().min(1)}).strict(),vE=b.union([b.object({}).strict(),b.object({summary:b.object({final_score:b.number().nonnegative(),pass_score:b.number().nonnegative(),group_count:b.number().int().nonnegative(),problem_group_count:b.number().int().nonnegative()}).strict(),dimensions:b.array(wE)}).strict()]),Yl=b.object({quality_info:CE,quality_detail:vE}).strict().superRefine((e,n)=>{let s="summary"in e.quality_detail;e.quality_info.status!=="failed"&&!s&&n.addIssue({code:"custom",message:"nonfailed quality tasks require complete detail",path:["quality_detail"]}),e.quality_info.status==="failed"&&s&&n.addIssue({code:"custom",message:"failed quality tasks require empty detail",path:["quality_detail"]})}),qM=b.object({item_code:b.string().min(1),remediation_items:b.unknown().nullable()}).strict(),DE=b.object({item_code:b.string().min(1),repair_status:b.enum(["succeeded","failed"]),message:b.string().min(1).optional(),error_code:b.string().min(1).optional(),metadata:b.record(b.string(),b.unknown()).optional()}).strict(),Zl=b.object({items:b.array(DE)}).strict(),WM=b.object({task_code:b.string().min(1),status:Xl,result:Zl.optional()}).strict().superRefine((e,n)=>{e.status==="succeeded"&&e.result===void 0&&n.addIssue({code:"custom",path:["result"],message:"succeeded repair tasks require a complete result"}),(e.status==="pending"||e.status==="running")&&e.result!==void 0&&n.addIssue({code:"custom",path:["result"],message:"nonterminal repair tasks cannot expose a result"})}),Ot=b.object({id:ps,tenant_id:b.string().min(1),site_id:k,status:TE,current_step:kE,quality_task_code:b.string().uuid().nullable(),quality_task_status:Si,repair_task_code:b.string().min(1).nullable(),repair_task_status:Xl,publish_deployment_id:pt.nullable(),domain_hostname:b.string().min(1).nullable(),domain_operation_type:fa.nullable(),domain_operation_payload:b.record(b.string(),b.unknown()).nullable(),domain_preparation_operation_id:b.string().min(1).nullable(),domain_operation_id:b.string().min(1).nullable(),revision:b.number().int().positive(),created_at:b.string().min(1),updated_at:b.string().min(1),completed_at:b.string().min(1).nullable(),canceled_at:b.string().min(1).nullable()}).strict().superRefine((e,n)=>{if(e.domain_operation_type===null){e.domain_operation_payload!==null&&n.addIssue({code:"custom",path:["domain_operation_payload"],message:"domain_operation_payload must be null without an active domain operation"}),e.domain_operation_id!==null&&n.addIssue({code:"custom",path:["domain_operation_id"],message:"domain_operation_id must be null without an active domain operation"});return}e.domain_hostname===null&&n.addIssue({code:"custom",path:["domain_hostname"],message:"an active domain operation requires a hostname"}),e.domain_operation_payload===null&&n.addIssue({code:"custom",path:["domain_operation_payload"],message:"an active domain operation requires a payload"})}),BM=b.object({}).strict(),KM=b.object({expected_revision:b.number().int().nonnegative(),current_step:b.enum(["domain","gsc","publish"]),skip_domain_binding:b.boolean().optional()}).strict(),zM=b.object({expected_revision:b.number().int().nonnegative()}).strict(),OE=b.object({workflow:Ot.nullable(),can_cancel:b.boolean()}).strict(),HM=M(OE).strict(),NE=b.object({workflow:Ot,can_cancel:b.boolean()}).strict(),$M=M(NE).strict(),jE=b.object({workflow:Ot,deployment:b.lazy(()=>Nt)}).strict(),VM=M(jE).strict(),LE=b.object({workflow:Ot,can_cancel:b.boolean(),quality_result:Yl.optional(),safety_gate_enabled:b.boolean().optional(),repair_result:Zl.optional(),final_quality_result:Yl.optional(),message:b.string().min(1).optional()}).strict(),YM=M(LE).strict();function XM(e){if(e.quality_info.status!=="succeeded"||!("summary"in e.quality_detail))return[];let n=new Set(["heading_structure","click_obstruction","page_runtime_error"]);return e.quality_detail.dimensions.flatMap(s=>s.remediation_items.filter(i=>i.status==="succeeded"&&hi(i)==="not_passed"&&i.auto_fix&&n.has(i.item_code)).map(i=>({item_code:i.item_code,remediation_items:i.remediation_items})))}function QM(e,n){let s=e.map(a=>a.item_code),i=n.items.map(a=>a.item_code);if(new Set(s).size!==s.length||new Set(i).size!==i.length||s.length!==i.length)return!1;let o=new Set(s);return n.items.every(a=>o.has(a.item_code)&&a.repair_status==="succeeded")}function ZM(e,n){return e.quality_info.status!=="succeeded"||!("summary"in e.quality_detail)||ME(e)?null:e}function ME(e){let n=e.quality_info.error_info;return e.quality_info.scene_code!=="site_publish"||n?.stage!=="html_sampling"||n.code!=="PAGE_SAMPLING_ISSUES"&&n.code!=="PAGE_RUNTIME_ERRORS"?!1:[n.failed_urls,n.sampling_issues].flatMap(i=>Array.isArray(i)?i:[]).some(i=>{if(!i||typeof i!="object")return!1;let o=i;if(o.page_type!=="general_page"||o.http_status!==404||typeof o.url!="string")return!1;try{let a=new URL(e.quality_info.checked_url),c=new URL(o.url,a);return c.origin===a.origin&&!c.username&&!c.password}catch{return!1}})}var JM=b.enum(["checking","passed","not_passed","failed","not_checked"]);function hi(e){if(e.status==="pending"||e.status==="running")return"checking";if(e.status!=="succeeded")return"failed";let n=e.result_text?.trim();if(n==="\u8D28\u68C0\u9879\u5173\u95ED\uFF0C\u6682\u672A\u68C0\u6D4B")return"not_checked";if(n==="\u8D28\u91CF\u68C0\u6D4B\u9879\u6267\u884C\u5931\u8D25")return"failed";let s=typeof e.check_result=="boolean"?[e.check_result]:e.check_result&&typeof e.check_result=="object"?Object.values(e.check_result):[];return e.score<e.total_score||s.includes(!1)?"not_passed":"passed"}function UE(e){let n=hi(e);return n==="failed"||n==="not_passed"}function eU(e){let n={status:"unavailable",issueCount:0};if(!e||e.quality_info.status!=="succeeded"||!("summary"in e.quality_detail))return n;let s=e.quality_detail.dimensions.filter(a=>a.dimension_code==="safe");if(s.length!==1)return n;let i=s[0];if(i.running_status!=="completed"||!i.remediation_items.length||i.remediation_items.some(a=>a.dimension_code!=="safe"||hi(a)==="checking"||hi(a)==="not_checked"))return n;let o=i.remediation_items.filter(UE).length;return o>0?{status:"blocked",issueCount:o}:i.score<i.pass_score?n:{status:"passed",issueCount:0}}var FE=Ue.object({hostname:Ue.string().min(1),expected_revision:Ue.number().int().nonnegative()}).strict(),Jl=Ue.object({workflow:Ot,operation:gi}).strict(),GE=M(Jl).strict(),qE=Ue.object({expected_revision:Ue.number().int().nonnegative()}).strict(),WE=Ue.object({workflow:Ot,operation:gi}).strict(),BE=M(WE).strict(),ba=Ue.object({workflow:Ot,operation:gi.nullable()}).strict(),KE=M(ba).strict(),zE=ba,HE=M(zE).strict(),aU=M(Vl).strict(),$E=Ue.object({published:Ue.boolean(),hostname:Ue.string(),url:Ue.string(),sandbox_url:Ue.union([Ue.string().url(),Ue.literal("")])}).strict().superRefine((e,n)=>{e.published||(e.hostname!==""&&n.addIssue({code:"custom",path:["hostname"],message:"unpublished sites must not include a hostname"}),e.url!==""&&n.addIssue({code:"custom",path:["url"],message:"unpublished sites must not include a URL"}))}),rU=M($E).strict(),cU=FE,mU=Jl,lU=GE,pU=ba,dU=KE,uU=HE,_U=qE,gU=BE;import{z as Ke}from"zod";var VE=["started","success","failed","canceled"],ya=Ke.enum(VE),YE=["inactive","pending_binding","active"],xa=Ke.enum(YE),XE=["domain","url_prefix"],Ea=Ke.enum(XE),QE=["not_connected","authorizing","matching_property","ready","failed","canceled","domain_mismatch"],Ra=Ke.enum(QE),lt=Ke.string().nullable(),ep=Ke.object({}).strict(),Ia=Ke.object({authorize_url:Ke.string().url(),custom_domain:lt}).strict(),tp=M(Ia),ZE=Ke.object({auth_status:ya,binding_status:xa,credential_connected:Ke.boolean(),custom_domain:lt,gsc_site_url:lt,property_type:Ea.nullable(),auth_error_code:lt,auth_error_message:lt}).strict(),np=Ke.object({auth_status:ya,binding_status:xa,credential_connected:Ke.boolean(),custom_domain:lt,gsc_site_url:lt,property_type:Ea.nullable(),auth_error_code:lt,auth_error_message:lt,current_domain:lt,state:Ra,ready:Ke.boolean()}).strict().superRefine((e,n)=>{let s=eR(e,e.current_domain),i=s==="ready";e.state!==s&&n.addIssue({code:"custom",path:["state"],message:`state must equal ${s} for the supplied GSC facts`}),e.ready!==i&&n.addIssue({code:"custom",path:["ready"],message:`ready must equal ${String(i)} for the supplied GSC facts`})}),JE=M(np);function as(e){let n=e?.trim()??"";if(!n)return"";let s=/^[a-z][a-z0-9+.-]*:\/\//i.test(n)?n:`https://${n}`;try{return new URL(s).hostname.replace(/\.+$/,"").toLowerCase()}catch{return n.replace(/^[a-z][a-z0-9+.-]*:\/\//i,"").split(/[/?#]/,1)[0].replace(/\.+$/,"").toLowerCase()}}function eR(e,n){let s=e.gsc_site_url?.trim()??"",i=as(e.custom_domain),o=as(n??("current_domain"in e?e.current_domain:void 0)),a=i.length>0&&o.length>0&&i===o,c=tR(s,e.property_type,o);return e.auth_status==="canceled"?"canceled":e.auth_status==="failed"?"failed":e.auth_status==="started"?"authorizing":!e.credential_connected||e.binding_status==="inactive"?"not_connected":s.length===0||e.property_type===null?"matching_property":!a||!c?"domain_mismatch":e.binding_status==="pending_binding"?"matching_property":e.auth_status==="success"&&e.binding_status==="active"&&e.credential_connected&&s.length>0&&a&&c?"ready":"failed"}function tR(e,n,s){let i=e?.trim()??"",o=as(s);if(!i||!o||!n)return!1;if(n==="domain"){let a=/^sc-domain:(.+)$/i.exec(i);if(!a)return!1;let c=a[1].trim();if(!c||/[/:?#]/.test(c))return!1;let r=as(c);return r?o===r||o.endsWith(`.${r}`):!1}try{let a=new URL(i);return a.protocol!=="https:"||a.username||a.password||a.port||a.pathname!=="/"||a.search||a.hash?!1:as(a.hostname)===o}catch{return!1}}var bU=ep,yU=Ia,xU=tp,EU=Ra,RU=ya,IU=xa,TU=Ea,kU=Ra,AU=ep,PU=Ia,wU=tp,CU=ZE,vU=np,DU=JE;import{z as O}from"zod";var ze=O.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER),nt=O.string().min(1).max(4096),Sn=O.string().regex(/^[A-Za-z0-9_-]{43}$/),fn=O.string().max(300),Ta=O.string().datetime({offset:!0}).nullable(),sp=O.string().regex(/^[A-Z][A-Z0-9_]*$/).max(100).nullable(),nR=["authorized","pending","failed","revoked","expired","not_authorized"],sR=O.enum(nR),iR=["pending","succeeded","failed","canceled","expired","superseded"],oR=O.enum(iR),aR=["unconfigured","configured","needs_reconfiguration","unverified"],rR=O.enum(aR),cR=["not_checked","valid","invalid","unavailable"],mR=O.enum(cR),lR=["authorization_pending","authorization_required","authorization_changed","resource_unavailable","resource_changed","verification_required","verification_unavailable"],pR=O.enum(lR),ip=O.object({revision:ze,status:oR,started_at:O.string().datetime({offset:!0}),expires_at:O.string().datetime({offset:!0}),finished_at:Ta,error_code:sp}).strict(),LU=O.object({expected_authorization_revision:ze,expected_attempt_revision:ze,select_account:O.boolean().default(!1),replace_pending:O.boolean().default(!1)}).strict(),dR=O.object({authorize_url:O.string().url(),authorization_revision:ze,attempt:ip}).strict(),MU=M(dR),uR=O.object({status:sR,authorization_revision:ze,account_email:O.string().max(320).nullable(),latest_attempt:ip.nullable()}).strict(),_R=O.object({account_ref:nt,account_key:Sn,account_display_name:fn,property_ref:nt,property_key:Sn,property_display_name:fn,data_stream_ref:nt,data_stream_key:Sn,data_stream_display_name:fn,measurement_id_display:O.string().min(1).max(40),default_uri:O.string().url().nullable(),selected_authorization_revision:ze,configured_at:O.string().datetime({offset:!0}),updated_at:O.string().datetime({offset:!0})}).strict(),gR=O.object({status:mR,checked_at:Ta,expires_at:Ta,error_code:sp}).strict(),hR=O.enum(["oauth","verification"]),SR=O.object({measurement_id_display:O.string().min(1).max(40),stream_display_name:O.string().max(100).nullable()}).strict(),fR=O.object({status:O.enum(["pending","applied"]),applied_revision:ze}).strict(),op=O.object({capability_enabled:O.boolean(),revision:ze,authorization:uR,binding_status:rR,reason:pR.nullable(),ready:O.boolean(),mode:hR.nullable(),binding:_R.nullable(),verification:gR,tracking:SR.nullable(),deployment:fR}).strict().superRefine((e,n)=>{if(!e.capability_enabled){(e.ready||e.revision!==0||e.authorization.status!=="not_authorized"||e.authorization.authorization_revision!==0||e.authorization.account_email!==null||e.authorization.latest_attempt!==null||e.binding_status!=="unconfigured"||e.reason!==null||e.mode!==null||e.binding!==null||e.tracking!==null||e.deployment.status!=="applied"||e.deployment.applied_revision!==0||e.verification.status!=="not_checked"||e.verification.checked_at!==null||e.verification.expires_at!==null||e.verification.error_code!==null)&&n.addIssue({code:O.ZodIssueCode.custom,message:"disabled GA4 capability must expose an empty state"});return}e.ready&&(e.authorization.status!=="authorized"||e.binding_status!=="configured"||e.mode!=="oauth"||e.binding===null||e.tracking===null||e.verification.status!=="valid"||e.reason!==null)&&n.addIssue({code:O.ZodIssueCode.custom,message:"ready GA4 status must be authorized, configured, and valid"})}),UU=M(op),FU=O.object({refresh:O.union([O.boolean(),O.enum(["true","false"]).transform(e=>e==="true")]).default(!1)}).strict(),bR=O.object({property_ref:nt,property_key:Sn,display_name:fn}).strict(),yR=O.object({account_ref:nt,account_key:Sn,display_name:fn,properties:O.array(bR)}).strict(),xR=O.object({accounts:O.array(yR),returned_count:O.number().int().nonnegative(),completeness:O.literal("unknown"),authorization_revision:ze}).strict(),GU=M(xR),qU=O.object({authorization_revision:O.coerce.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER)}).strict(),ER=O.object({data_stream_ref:nt,data_stream_key:Sn,display_name:fn,measurement_id_display:O.string().min(1).max(40),default_uri:O.string().url().nullable(),selectable:O.boolean(),unavailable_reason:O.string().max(100).nullable()}).strict(),RR=O.object({property_ref:nt,streams:O.array(ER),returned_count:O.number().int().nonnegative(),completeness:O.literal("unknown"),authorization_revision:ze}).strict(),WU=M(RR),BU=O.object({property_ref:nt,authorization_revision:O.coerce.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER)}).strict(),KU=O.object({expected_revision:ze,authorization_revision:ze,account_ref:nt,property_ref:nt,data_stream_ref:nt,confirm_url_mismatch:O.boolean()}).strict(),IR=O.object({applied_revision:ze,idempotency_replayed:O.boolean()}).strict(),TR=op.and(O.object({mutation:IR}).strict()),zU=M(TR);var ap=/^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/,rp="VCP_E2B_PREVIEW_PROXY_DOMAIN must be a valid hostname.";function kR(e){let n=e?.trim().toLowerCase()??"";if(!n)return null;if(n.length>253||!n.includes(".")||!n.split(".").every(s=>ap.test(s)))throw new Error(rp);return n}function $U(e){let n=kR(e.proxyDomain);if(!n)return null;let s=e.sandboxId.trim();if(!ap.test(s))throw new Error("sandboxId must be a valid DNS label.");if(`${s}.${n}`.length>253)throw new Error(rp);return`https://${s}.${n}/`}function YU(e){for(let n of e.targets)if(!(n.kind==="shared"?e.ledger.shared.some(i=>i.kind==="shared"&&i.target_id===n.target_id&&i.filled!==!0):e.ledger.pages.some(i=>i.omissions.some(o=>o.kind===n.kind&&o.target_id===n.target_id&&o.filled!==!0))))return{ok:!1,target_id:n.target_id};return{ok:!0}}function AR(e,n,s=e){let i=new Map(e.map(r=>[r.slug,r])),o=new Map(s.map(r=>[r.id,r])),a=new Map(e.map(r=>{let m=o.get(r.id);return m&&m.slug!==null&&m.slug!==r.slug?[m.slug,r]:null}).filter(r=>r!==null)),c=new Set(s.map(r=>r.slug).filter(r=>r!==null&&!i.has(r)));return{primaryLinks:cp(n.primaryLinks,e,i,a,c,o,"showInHeader"),footerLinks:cp(n.footerLinks,e,i,a,c,o,"showInFooter")}}function cp(e,n,s,i,o,a,c){let r=new Set,m=[];for(let[B,z]of e.entries()){let ne=PR(z.href),Se=ne===null?void 0:s.get(ne)??i.get(ne);if(ne!==null&&o.has(ne)&&!s.has(ne)&&!i.has(ne))continue;if(Se?.slug==="/"){m.push({kind:"independent",link:{...z,label:mp(z,Se,a)}});continue}if(!Se){m.push({kind:"independent",link:z});continue}if(!Se.navigation[c])continue;r.add(Se.slug);let Rn=ne===Se.slug?z.href:wR(z.href,Se.slug);m.push({kind:"page",page:Se,link:{...z,label:mp(z,Se,a),href:Rn},index:B})}let x=m.filter(B=>B.kind==="page").sort((B,z)=>B.page.navigation.order-z.page.navigation.order||B.index-z.index),_=0,w=m.map(B=>B.kind==="page"?x[_++].link:B.link);for(let B of[...n].filter(z=>z.slug!=="/"&&z.navigation[c]).sort((z,ne)=>z.navigation.order-ne.navigation.order))r.has(B.slug)||w.push({label:B.title,href:B.slug});return w}function mp(e,n,s){let i=s.get(n.id);return e.label===(i?.title??n.title)?n.title:e.label}function PR(e){if(!e.startsWith("/")||e.startsWith("//"))return null;let n=e.search(/[?#]/u);return n===-1?e:e.slice(0,n)}function wR(e,n){let s=e.search(/[?#]/u);return s===-1?n:`${n}${e.slice(s)}`}function fi(e){return e.trim().normalize("NFKC").toLowerCase()}function CR(e){let n=e?.toLowerCase();return n?.startsWith("zh")?"\u9996\u9875":n?.startsWith("ja")?"\u30DB\u30FC\u30E0":n?.startsWith("ko")?"\uD648":"Home"}function vR(e){let n=e?.toLowerCase();return n?.startsWith("zh")?"\u66F4\u591A":n?.startsWith("ja")?"\u305D\u306E\u4ED6":n?.startsWith("ko")?"\uB354\uBCF4\uAE30":n?.startsWith("fr")?"Plus":n?.startsWith("de")?"Mehr":n?.startsWith("es")?"M\xE1s":"More"}function DR(e){return e.map(n=>n.navigation.showInHeader===!0?n:{...n,navigation:{...n.navigation,showInHeader:!0}})}function rs(e){return e.parent_page_id??null}function bi(e,n){let s=rs(e);return s===null?!0:!n.some(i=>i.id===s)}function lp(e,n){return e.filter(s=>rs(s)===n&&s.id!==n)}function pp(e){let n=e.filter(c=>bi(c,e)),s=n.filter(c=>c.slug==="/"),i=n.filter(c=>c.slug!=="/"),o=[],a=new Set;for(let c of[...s,...i])if(!a.has(c.id)){o.push(c),a.add(c.id);for(let r of lp(e,c.id))a.has(r.id)||(o.push(r),a.add(r.id))}for(let c of e)a.has(c.id)||(o.push(c),a.add(c.id));return o}function OR(e){if(!e.startsWith("/")||e.startsWith("//"))return null;let n=e.search(/[?#]/);return n===-1?e:e.slice(0,n)}function NR(e,n){let s=pp(n),i=new Map;s.forEach((c,r)=>{c.slug!==null&&!i.has(c.slug)&&i.set(c.slug,r)});let o=[],a=[];for(let c of e){let r=OR(c.href),m=r===null?void 0:i.get(r);m===void 0?a.push(c):o.push({link:c,rank:m})}return o.sort((c,r)=>c.rank-r.rank),[...o.map(c=>c.link),...a]}function jR(e){let n=e.filter(s=>bi(s,e)).length;return{top_level_pages:n,sub_pages:e.length-n,total_pages:e.length,content_items:e.reduce((s,i)=>s+i.blocks.length,0)}}function LR(e,n={}){let s=[],i=new Map(e.map(c=>[c.id,c])),o=e.filter(c=>c.slug==="/");o.length!==1?s.push({code:"missing_home",page_id:null,message:"The structure must contain exactly one home page."}):n.expectedHomeTitle&&fi(o[0].title)!==fi(n.expectedHomeTitle)&&s.push({code:"home_renamed",page_id:o[0].id,message:`The home page must keep its fixed name '${n.expectedHomeTitle}'.`});for(let c of e){c.title.trim().length===0&&s.push({code:"empty_title",page_id:c.id,message:"Page name is empty."}),c.slug&&n.reservedSlugs?.includes(c.slug)&&s.push({code:"reserved_slug",page_id:c.id,message:`Slug '${c.slug}' is reserved by the site's applications.`});let r=rs(c);if(r===null)continue;if(c.slug==="/"){s.push({code:"home_has_parent",page_id:c.id,message:"The home page cannot have a parent."});continue}if(r===c.id){s.push({code:"self_parent",page_id:c.id,message:"A page cannot be its own parent."});continue}let m=i.get(r);if(!m){s.push({code:"parent_not_found",page_id:c.id,message:`Parent page '${r}' does not exist.`});continue}if(m.slug==="/"){s.push({code:"home_has_children",page_id:c.id,message:"The home page cannot have sub pages."});continue}rs(m)!==null&&s.push({code:"depth_exceeded",page_id:c.id,message:"At most two levels are allowed."})}let a=new Map;for(let c of e){let r=bi(c,e)?"__top__":rs(c),m=fi(c.title);if(m.length===0)continue;let x=a.get(r)??new Map,_=x.get(m);_!==void 0&&_!==c.id?s.push({code:"duplicate_sibling_title",page_id:c.id,message:`Page name '${c.title}' is already used at the same level.`}):x.set(m,c.id),a.set(r,x)}return s}var MR=16,UR=/[ᄀ-ᅟ⺀-〾ぁ-㏿㐀-䶿一-鿿ꀀ-가-힣豈-︰--⦆¢-₩]/u;function FR(e){let n=0;for(let s of e)n+=UR.test(s)?2:1;return n}function GR(e){let n=e.normalize("NFKC").trim().replace(/\s+/g," ").toLowerCase();return n.length>3&&n.endsWith("s")?n.slice(0,-1):n}import{z as A}from"zod";var dp=20*1024*1024,qR=dp,up=["jpg","jpeg","png","gif","webp","bmp"],_p=["mp4","avi","mov","webm","mkv"],gp=["mp3","wav","aac","flac","ogg","wma","m4a"],hp=["pdf","doc","docx","xls","xlsx","ppt","pptx","txt","md","csv"],Sp=[...hp,"zip","rar","json","xmind","psd","ai","fig","sketch"],WR=[...up,..._p,...gp,...Sp],fp=["image/jpeg","image/png","image/gif","image/webp","image/bmp"],bp=["video/mp4","video/x-msvideo","video/quicktime","video/webm","video/x-matroska"],yp=["audio/mpeg","audio/wav","audio/x-wav","audio/vnd.wave","audio/aac","audio/flac","audio/x-flac","audio/ogg","audio/x-ms-wma","audio/mp4","audio/x-m4a"],BR=[...fp,...bp,...yp],xp=A.enum(["image","video","audio","file"]),Ep=A.enum(["external","ai_generated","unsplash"]),ka=A.object({resource_id:A.string().min(1),name:A.string().min(1).max(255),url:A.string().url(),thumbnail_url:A.union([A.string().url(),A.literal("")]),mime_type:A.string().trim().min(3).max(127),size:A.number().int().nonnegative(),width:A.number().int().positive().nullable(),height:A.number().int().positive().nullable(),source:Ep,created_at:A.string().min(1).nullable()}),KR=A.object({page:A.coerce.number().int().min(1).default(1),page_size:A.coerce.number().int().min(1).max(100).default(24),keyword:A.string().trim().max(100).optional(),file_type:xp.default("image")}),zR=A.object({code:A.literal(0),message:A.string(),data:A.object({items:A.array(ka),page:A.number().int().min(1),page_size:A.number().int().min(1),total:A.number().int().nonnegative()})}),HR=A.object({code:A.literal(0),message:A.string(),data:ka}),Aa=4,$R=A.object({pageName:A.string().trim().min(1).max(200),pageType:A.enum(["landing_page","general_page","detail_page","list_page","category_page","tag_page","author_page","search_page","date_page"]),sectionTitle:A.string(),nearbyTitle:A.string(),nearbyBody:A.string(),prompt:A.string().trim().min(1).max(2e3),aspectRatio:A.string().regex(/^[1-9]\d*:[1-9]\d*$/)}),Rp=A.object({index:A.number().int().min(0).max(Aa-1),ok:A.literal(!0),url:A.string().regex(/^data:image\/(?:png|jpeg|gif|webp|bmp);base64,[A-Za-z0-9+/]+={0,2}$/)}),VR=A.object({code:A.literal(0),message:A.string(),data:A.object({items:A.array(Rp).min(1).max(Aa)})}),Ip=A.object({provider_id:A.string().min(1),url:A.string().url(),thumbnail_url:A.string().url(),width:A.number().int().positive(),height:A.number().int().positive(),alt:A.string(),photographer_name:A.string().min(1),photographer_url:A.string().url(),photo_url:A.string().url(),download_location:A.string().url(),dominant_color:A.string().nullable()}),YR=A.object({query:A.string().trim().min(1).max(100),page:A.coerce.number().int().min(1).default(1),page_size:A.coerce.number().int().min(1).max(30).default(18),orientation:A.enum(["landscape","portrait","squarish"]).optional()}),XR=A.object({code:A.literal(0),message:A.string(),data:A.object({items:A.array(Ip),page:A.number().int().min(1),page_size:A.number().int().min(1),total:A.number().int().nonnegative(),total_pages:A.number().int().nonnegative()})}),Tp=A.string().url().refine(tI,{message:"download_location must be an official Unsplash download URL"}),QR=A.object({download_location:Tp}),ZR=A.object({code:A.literal(0),message:A.string(),data:A.object({reported:A.boolean()})}),JR=A.object({source_id:A.number().int().positive(),source_title:A.string().min(1).max(255),source_url:Wt,resource_id:A.number().int().positive()}),eI=A.object({code:A.literal(0),message:A.string(),data:A.object({reported:A.boolean()})});function tI(e){if(!URL.canParse(e))return!1;let n=new URL(e);return n.protocol==="https:"&&n.hostname==="api.unsplash.com"&&n.username===""&&n.password===""&&n.port===""&&n.hash===""&&/^\/photos\/[^/]+\/download$/.test(n.pathname)}import{z as me}from"zod";var nI=me.object({colorSeeds:me.object({primary:me.string().min(1).max(40),accent:me.string().min(1).max(40),foreground:me.string().min(1).max(40).optional()}).strict().optional(),surfaceMode:me.enum(["light","dark"]).optional(),fonts:me.object({heading:me.string().min(1).max(60),body:me.string().min(1).max(60)}).strict().optional(),weightStyle:Be.optional()}).strict().refine(e=>e.colorSeeds!==void 0||e.surfaceMode!==void 0||e.fonts!==void 0||e.weightStyle!==void 0,{message:"colorSeeds, surfaceMode, fonts, or weightStyle is required"}),sI=me.object({ok:me.literal(!0),design_plan_version:me.number().int().positive().optional(),snapshot_id:I,site_design_context:me.lazy(()=>yi).optional(),changed_files:me.array(me.string().min(1)).optional()}),iI=me.object({snapshot_id:I,color_seeds:me.object({primary:me.string(),accent:me.string(),foreground:me.string().optional()}).nullable(),surface_mode:me.enum(["light","dark"]).nullable(),fonts:me.object({heading:me.string(),body:me.string()}).nullable(),palette_inputs_present:me.boolean(),palette_inputs:No.nullable(),notes:me.array(me.string()).nullable(),weight_style:Be.nullable().default(null),source:me.enum(["globals_css","design_plan_archive"])});import{z as P}from"zod";var be=P.string().min(1).max(100),wa=P.enum(["page","anchor","external","email","phone","file","group"]);function oI(e){if(!e||e.trim()!==e||/[\u0000-\u001f\u007f\\]/u.test(e))return!1;if(e.startsWith("/")&&!e.startsWith("//")||/^#[^\s]*$/u.test(e)||/^(mailto:|tel:)[^\s]+$/iu.test(e))return!0;try{let n=new URL(e);return(n.protocol==="http:"||n.protocol==="https:")&&!n.username&&!n.password}catch{return!1}}var aI=P.string().max(2048).refine(oI,"Invalid navigation destination"),Ca=P.string().trim().min(1).max(255),va=P.enum(["link","cta"]).nullable(),kp=P.lazy(()=>P.object({id:be,group_id:be,parent_id:be.nullable(),sort_order:P.number().int().nonnegative(),label:P.string(),href:P.string().nullable(),target_type:wa,enabled:P.boolean(),effective_visible:P.boolean(),open_in_new:P.boolean(),nofollow:P.boolean(),role:va,link_binding:P.object({kind:P.enum(["custom","cms_page","file"]),page_id:be.nullable()}),children:P.array(kp)})),rI=P.object({id:be,name:P.string(),description:P.string(),is_default:P.boolean(),can_delete:P.boolean(),delete_block_reason:P.string().nullable(),items:P.array(kp)}),cI=P.object({site_id:P.string().min(1),default_group_id:be.nullable(),groups:P.array(rI),limits:P.object({max_depth:P.number().int().positive(),max_items:P.number().int().positive()})}),lF=P.object({data:cI}),Ap=P.object({name:Ca,description:P.string().max(2e3).optional()}).strict(),mI=Ap.partial().refine(e=>Object.keys(e).length>0,"At least one field is required"),pF=P.object({group_id:be}).strict(),Pp={label:Ca,target_type:wa,href:aI.nullable().optional(),enabled:P.boolean().optional(),open_in_new:P.boolean().optional(),nofollow:P.boolean().optional(),role:va.optional()},wp=P.object({group_id:be,parent_id:be.nullable().optional(),...Pp}).strict().superRefine((e,n)=>{e.target_type!=="group"&&!e.href&&n.addIssue({code:"custom",path:["href"],message:"Link destination is required"}),e.target_type==="group"&&e.href&&n.addIssue({code:"custom",path:["href"],message:"Groups have no destination"})}),lI=P.object({...Pp,link_mode:P.literal("custom").optional()}).partial().strict().refine(e=>Object.keys(e).length>0,"At least one field is required"),pI=P.object({group_id:be,parent_id:be.nullable(),before_id:be.nullable().optional()}).strict(),Pa=P.lazy(()=>P.object({id:be.nullable(),label:P.string().max(255),href:P.string().max(2048).nullable(),target_type:wa,enabled:P.boolean(),open_in_new:P.boolean(),nofollow:P.boolean(),role:va,children:P.array(Pa)}).strict()),dF=P.object({group_id:be.nullable(),group_name:Ca.optional(),baseline:P.array(Pa),items:P.array(Pa)}).strict().superRefine((e,n)=>{e.group_id===null&&e.items.length>0&&!e.group_name&&n.addIssue({code:"custom",path:["group_name"],message:"New navigation group name is required"});for(let s of["baseline","items"]){let i=new Set,o=0,a=(c,r,m)=>{for(let[x,_]of c.entries()){let w=[...m,x];if(o++,s==="items"&&(o>1e3||r>20)){n.addIssue({code:"custom",path:w,message:"Navigation tree limit exceeded"});return}if((s==="baseline"&&_.id===null||_.id!==null&&i.has(_.id))&&n.addIssue({code:"custom",path:[...w,"id"],message:"Invalid or duplicate navigation ID"}),_.id!==null&&i.add(_.id),s==="items"){let B=wp.safeParse({group_id:e.group_id??"new",label:_.label,href:_.href,target_type:_.target_type,enabled:_.enabled,open_in_new:_.open_in_new,nofollow:_.nofollow,role:_.role});if(!B.success)for(let z of B.error.issues)n.addIssue({code:"custom",path:[...w,...z.path.filter(ne=>typeof ne=="string"||typeof ne=="number")],message:z.message})}a(_.children,r+1,[...w,"children"])}};a(e[s],1,[s])}}),dI=P.object({cms_bound:P.boolean(),bound_nav_keys:P.array(P.string()).optional(),analyzed_snapshot_id:P.string().nullable().optional(),cms_driven:P.boolean(),supports_groups:P.boolean(),supports_nested_groups:P.boolean(),supports_link_attributes:P.boolean(),requires_agent:P.boolean(),reasons:P.array(P.string())}),uF=P.object({data:dI}),_F=P.discriminatedUnion("action",[P.object({action:P.literal("create_group"),values:Ap}).strict(),P.object({action:P.literal("update_group"),id:be,values:mI}).strict(),P.object({action:P.literal("delete_group"),id:be}).strict(),P.object({action:P.literal("set_default_group"),group_id:be}).strict(),P.object({action:P.literal("create_item"),values:wp}).strict(),P.object({action:P.literal("update_item"),id:be,values:lI}).strict(),P.object({action:P.literal("delete_item"),id:be,cascade:P.boolean().optional()}).strict(),P.object({action:P.literal("move_item"),id:be,values:pI}).strict()]);import{z as le}from"zod";var Da=le.enum(["products","cases","guides","documents","company"]),uI=le.enum(["source_unreachable","content_mojibake","min_fields_unmet","document_no_file_reference","document_file_unavailable","media_ingest_failed","app_unavailable","write_failed","kind_input_unavailable","kind_uncertain","kind_service_unavailable","kind_budget_exhausted"]),xt=le.number().int().nonnegative(),_I=le.discriminatedUnion("status",[le.object({collection:Da,status:le.literal("processing")}).strict(),le.object({collection:Da,status:le.enum(["imported","partial","failed"]),imported:xt,exception:xt}).strict()]),Cp=le.enum(["legacy_domain_not_routed","site_context_missing","site_rules_limit_exceeded","site_rules_not_served"]),gI=le.enum(["target_page_unpublished","redirect_target_missing","redirect_write_failed",...Cp.options]),hI=le.discriminatedUnion("status",[le.object({status:le.literal("processing")}).strict(),le.object({status:le.literal("unavailable")}).strict(),le.object({status:le.literal("ready"),site_reason:Cp.nullable(),same_path:xt,active:xt,exception:xt,exceptions:le.array(le.object({path:le.string().regex(/^\/[^?#]*$/),reason_code:gI}))})]),SF=le.object({overall_status:le.enum(["moving","completed","disabled","failed"]),by_collection:le.array(_I),media:le.object({image:xt,video:xt,audio:xt,file:xt}),exceptions:le.array(le.object({collection:Da.nullable(),path:le.string().regex(/^\/[^?#]*$/),reason_code:uI})),redirects:hI.nullable().optional()});import{z as cs}from"zod";var yF=cs.strictObject({display_name:cs.string().nullable(),account_category:cs.number().int().nullable()}),xF=cs.strictObject({redirect_url:cs.url({protocol:/^https$/}).refine(e=>{try{let n=new URL(e);return!n.username&&!n.password}catch{return!1}})});var ja=t.object({heading:t.string().min(1).max(160).optional(),body:t.string().min(1).max(160).optional(),paletteIntent:t.string().min(1).max(400).optional(),surfaceMode:t.enum(["light","dark"]).optional(),radius:t.enum(["none","sm","md","lg","xl"]).optional(),density:t.enum(["compact","comfortable","airy","editorial"]).optional(),motionPreset:t.enum(["subtle","moderate","expressive"]).optional(),colorSeeds:t.object({primary:t.string().min(1).max(40),accent:t.string().min(1).max(40),foreground:t.string().min(1).max(40).optional(),neutral:t.string().min(1).max(40).optional(),supporting:t.array(t.string().min(1).max(40)).max(4).optional()}).optional(),imagePalette:t.object({background:t.string().min(1).max(40).optional(),foreground:t.string().min(1).max(40).optional(),card:t.string().min(1).max(40).optional(),muted:t.string().min(1).max(40).optional(),border:t.string().min(1).max(40).optional()}).optional(),themeId:t.string().min(1).max(60).optional(),themeDescription:t.string().min(1).max(400).optional(),aestheticNote:t.string().min(1).max(300).optional(),weightStyle:Be.optional()}),Oa=t.enum(["material","reference","brief","industry"]),SI=t.object({market:t.object({value:t.string().min(1).max(200),source:Oa}),customer:t.object({value:t.string().min(1).max(200),source:Oa}),purpose:t.object({options:t.array(t.string().min(1).max(60)).min(2).max(4),selected:t.string().min(1).max(60),source:Oa})}),fI=t.enum(["text-options","motion-slider","positioning"]),La=t.enum(["none","subtle","moderate","expressive"]),bI=t.enum(["compact","comfortable","airy","editorial"]),yI=La,Lp=t.object({skill_name:t.string().min(1),rationale:t.string().min(4).max(200),confidence:t.enum(["high","medium","low"]).optional(),displayName:t.object({zh:t.string().min(1),en:t.string().min(1)}).partial().optional()}),xI=t.object({value:t.string(),label:t.string(),desc:t.string().optional(),impact:t.string().optional(),isRecommended:t.boolean().optional(),preselect:t.boolean().optional(),visualHints:ja.optional(),conversionHints:Ut.optional()}),EI=t.object({id:t.string(),type:fI,question:t.string(),tag:t.string(),aiThinking:t.string(),options:t.array(xI),source:t.enum(["ai-detected","always-ask"]),sourceDetail:t.string(),positioning:SI.optional()}),Ma=t.object({questions:t.array(EI).min(1).max(6)}),XF=t.object({tenant_id:t.string().min(1),site_id:k,brief_id:Xt,brief:t.string().min(20).max(1e3),site_default_locale:Ie.optional(),owner_locale:Ie.optional(),input_context:t.object({facts:t.array(hs).max(120),conflicts:t.array(fs).max(20),reference:Ss.optional(),sources:t.array(t.object({type:Ci,title:t.string().max(120).optional(),status:vi})).max(16).optional()}).optional()}),Mp=t.enum(["model_schema_invalid","provider_rate_limited","provider_unavailable","aborted","unknown"]),QF=t.discriminatedUnion("type",[t.object({type:t.literal("run.started"),runId:$,at:t.string().min(1)}),t.object({type:t.literal("skill.selecting"),category:t.literal("page-generation"),available:t.array(t.object({id:t.string().min(1),name:t.string().min(1)})).max(20),at:t.string().min(1)}),t.object({type:t.literal("skill.selected"),category:t.literal("page-generation"),selected:t.object({id:t.string().min(1),name:t.string().min(1),reason:t.string().min(1).max(200)}),at:t.string().min(1)}),t.object({type:t.literal("clarify.partial"),object:t.unknown(),at:t.string().min(1)}),t.object({type:t.literal("clarify.archetype_proposals"),proposals:t.array(Lp).min(1).max(5),at:t.string().min(1)}),t.object({type:t.literal("clarify.finished"),questions_id:t.string().min(1),at:t.string().min(1)}),t.object({type:t.literal("run.failed"),error_code:t.string().min(1),message:t.string().min(1),error_category:Mp.optional(),retryable:t.boolean().optional(),attempts:t.number().int().positive().optional(),at:t.string().min(1)}),t.object({type:t.literal("run.finished"),at:t.string().min(1)})]),ZF="SITE_PLANNING_INPUT_FROZEN",JF="SITE_PLANNING_LOCKED",eG="SITE_STRUCTURE_CONFIRMATION_REQUIRED",tG="SITE_STRUCTURE_CONFIRMATION_STALE",nG="SITE_SITEMAP_DRAFT_STALE",sG="SITE_SITEMAP_DRAFT_OPERATION_MISMATCH",vp="SITE_STRUCTURE_INVALID",iG=t.object({tenant_id:t.string().min(1),name:t.string().min(1).max(120),brief:t.string().min(20).max(1e3)}),oG=t.object({name:t.string().min(1).max(120),brief:t.string().min(20).max(1e3)}),aG=t.object({name:t.string().min(1).max(120)}),rG=t.object({name:t.string().min(1).max(120),default_locale:Ie.optional()}),cG=t.object({body:t.string().min(20).max(1e3)}),mG=t.object({body:t.string().min(20).max(1e3)}),Ua=t.string().url().refine(e=>{try{let n=new URL(e).protocol;return n==="http:"||n==="https:"}catch{return!1}},{message:"URL must use http or https protocol"}),lG=t.object({tenant_id:t.string().min(1),site_id:k.optional(),site_url:Ua.optional(),site_name:t.string().trim().min(1).max(255).optional()}),pG=M(Ur),dG=M(Fr),uG=M(Gr),_G=M(ec),gG=M(tc),hG=M(nc),SG=M(ic),fG=M(oc),bG=M(ac),yG=M(t.object({site_id:k,site_url:Ua.nullable()})),Lt=t.object({id:k,tenant_id:t.string().min(1),name:t.string().min(1),slug:t.string().min(1),status:lo,deployment_status:po,archived_at:t.string().min(1).nullable(),current_sitemap_id:Ae.nullable(),confirmed_sitemap_id:Ae.nullable().optional(),confirmed_sitemap_version:t.number().int().positive().nullable().optional(),structure_confirmed_at:t.string().min(1).nullable().optional(),migration_content_requested:t.boolean().optional(),current_snapshot_id:I.nullable(),published_deployment_id:pt.nullable().optional(),deployed_url:t.string().url().nullable(),default_locale:Ie,owner_locale:Ie.optional(),cms_site_id:Es.nullable().optional(),cms_site_url:Ua.nullable().optional(),parent_site_id:k.nullable().optional(),mount_path:t.string().min(1).nullable().optional(),schema_version:t.literal(1),created_at:t.string().min(1),updated_at:t.string().min(1)}),Fa=t.object({id:Xt,tenant_id:t.string().min(1),site_id:k,body:t.string().min(1),source:t.enum(["user","import","system"]),created_at:t.string().min(1),updated_at:t.string().min(1)}),xG=t.object({site:Lt,brief:Fa,next_step:t.literal("clarify")}),EG=t.object({site:Lt,brief:Fa}),RG=t.object({brief:Fa}),RI=t.enum(["queued","running","succeeded","failed","cancelled"]),Up=t.enum(["clarify","sitemap","workspace"]),Fp=t.enum(["clarify","sitemap","initial_generation","iteration","landing_page","fill_in"]),Gp=t.enum(["clarify","sitemap","workspace","summarize"]),st=t.object({id:$,tenant_id:t.string().min(1),site_id:k,agent_type:Up,run_kind:Fp,status:RI,model_route:Gp,started_at:t.string().min(1).nullable(),finished_at:t.string().min(1).nullable(),error_code:t.string().min(1).nullable(),created_at:t.string().min(1),thread_id:it.nullable().optional()}),IG=t.object({agent_run:st}).strict(),II=t.enum(["workspace","landing_page","external"]),TI=t.enum(["user","background"]),qp=t.enum(["active","archived"]),Ii=t.object({id:it,tenant_id:t.string().min(1),site_id:k,kind:II,origin:TI,subject_key:t.string().min(1).max(200),title:t.string().min(1).max(200),status:qp,external_thread_id:t.string().min(1).max(200).nullable(),last_run_id:$.nullable(),last_activity_at:t.string().min(1),created_at:t.string().min(1),updated_at:t.string().min(1)}),TG=t.object({agent_run:st,thread:Ii.nullable()}),kG=t.object({run_id:$.optional(),site_id:k,agent_type:Up,run_kind:Fp.optional(),model_route:Gp,input:t.record(t.string(),t.unknown()).optional()}).superRefine((e,n)=>{ms(e.input)&&n.addIssue({code:"custom",path:["input"],message:"Agent run input must not contain secrets"})}),AG=t.object({agent_run:st,next_step:t.literal("stream_events")}),Wp=t.enum(["draft","candidate","deleting","current","failed"]),Et=t.object({id:I,tenant_id:t.string().min(1),site_id:k,version:t.number().int().positive(),manifest_hash:t.string().regex(/^sha256:[a-f0-9]{64}$/),object_key:t.string().min(1),template_version:Je.nullable().optional(),reason:t.enum(["initial_generation","workspace_edit","pre_deploy","manual_save","rollback","template_upgrade","subsite_clone"]),status:Wp,created_at:t.string().min(1)}),PG=t.object({snapshot_id:I,creation_key:t.string().min(1),manifest_hash:t.string().regex(/^sha256:[a-f0-9]{64}$/),object_key:t.string().min(1),template_version:Je.optional(),reason:Et.shape.reason,status:t.enum(["draft","candidate","current","failed"]).default("candidate"),source_run_id:$.optional()}),wG=t.object({site:Lt,snapshot:Et,next_step:t.literal("workspace")}),CG=t.object({expected_manifest_hash:Et.shape.manifest_hash,manifest_hash:Et.shape.manifest_hash,object_key:Et.shape.object_key}).strict(),vG=t.union([t.object({base_snapshot_id:I.nullable(),source_run_id:$.optional(),page_template_advisories:t.array(kn).optional()}).strict(),t.object({skip_base_check:t.literal(!0)}).strict()]),kI=t.object({site:Lt,snapshot:Et,next_step:t.literal("workspace")}),DG=t.object({snapshot:Et}),OG=t.object({status:t.literal("deleting"),snapshot_id:I,object_key:t.string().min(1)}),NG=t.object({status:t.literal("deleted"),snapshot_id:I}),Ti=t.object({id:Ja,tenant_id:t.string().min(1),site_id:k,snapshot_id:I,version:t.number().int().positive(),accepted_commit:t.string().min(1),source_run_id:$.nullable(),created_at:t.string().min(1)}),AI=Ti.extend({reason:Et.shape.reason,status:Wp}),jG=t.object({accepted_commit:t.string().min(1),source_run_id:$.optional()}),LG=t.object({site_version:Ti,next_step:t.literal("workspace")}),MG=t.object({owner_id:t.string().min(1)}).strict(),UG=t.discriminatedUnion("acquired",[t.object({acquired:t.literal(!0)}).strict(),t.object({acquired:t.literal(!1)}).strict()]),FG=t.object({owner_id:t.string().min(1)}).strict(),GG=t.object({released:t.literal(!0)}).strict(),qG="TEMPLATE_UPGRADE_LOCK_LOST",WG=t.object({base_snapshot_id:I,accepted_commit:Ti.shape.accepted_commit,owner_id:t.string().min(1)}).strict(),BG=kI.strict(),KG=t.object({site_versions:t.array(AI)}),zG=t.object({site:Lt,snapshot:Et,site_version:Ti,next_step:t.literal("workspace")}),HG=t.object({snapshot_id:I,force_rehydrate:t.boolean().optional(),recovery_required:t.boolean().optional(),required_cms_site_id:Es.optional()}),PI=t.discriminatedUnion("status",[t.object({status:t.literal("ready"),snapshot_id:I,preview_url:t.string().min(1),launch_id:t.string().min(1).optional()}),t.object({status:t.literal("failed"),code:t.string().min(1),message:t.string().min(1),retryable:t.boolean(),snapshot_id:I.optional(),code_error:Mi.optional()})]),$G=t.object({tenant_id:t.string().min(1),site_id:k,snapshot_id:I,cms_site_id:Es.optional()}).strict(),VG=PI,Ga=t.enum(Qt),Bp=t.enum(["quality_check","publish"]),Nt=t.object({id:pt,tenant_id:t.string().min(1),site_id:k,snapshot_id:I,type:Bp.default("publish"),version:t.number().int().positive(),status:Ga,provider:t.enum(["cloudflare"]),url:t.string().url().nullable(),error_code:t.string().min(1).nullable(),provider_deployment_id:t.string().min(1).nullable(),created_at:t.string().min(1),updated_at:t.string().min(1)}),YG=t.object({tenant_id:t.string().min(1),site_id:k,expected_snapshot_id:I}).strict(),XG=t.object({deployment:Nt}),QG=t.object({tenant_id:t.string().min(1),site_id:k,deployment_id:pt}).strict(),ZG=t.object({deployment:Nt}),JG=t.object({}).strict(),eq=t.object({snapshot_id:I.optional()}).strict(),wI=t.object({deployment:Nt}),tq=M(wI),nq=t.object({deployment:Nt.nullable()}),sq=t.object({deployment:Nt}),Dp=t.object({id:pt,type:Bp.default("publish"),status:Ga,url:t.string().url().nullable(),error_code:t.string().min(1).nullable(),provider_deployment_id:t.string().min(1).nullable()}),CI=t.object({current:Dp.nullable(),latest_released:Dp.nullable()}),iq=M(CI),vI=t.enum(["deployment.snapshot","deployment.status.changed","deployment.finished","deployment.failed","deployment.realtime.recovered","server.error"]),bn=t.object({id:t.string().min(1),tenant_id:t.string().min(1),site_id:k,deployment_id:pt,seq:t.number().int().positive(),sent_at:t.string().min(1)}),xi=t.object({deployment:Nt,steps:$c.default([])}),oq=t.discriminatedUnion("type",[bn.extend({type:t.literal("deployment.snapshot"),payload:xi}),bn.extend({type:t.literal("deployment.status.changed"),payload:xi}),bn.extend({type:t.literal("deployment.finished"),payload:xi}),bn.extend({type:t.literal("deployment.failed"),payload:xi}),bn.extend({type:t.literal("deployment.realtime.recovered"),payload:t.object({action:t.literal("refresh")})}),bn.extend({type:t.literal("server.error"),payload:t.object({code:t.string().min(1),message:t.string().min(1),retryable:t.boolean()})})]),aq=t.object({tenant_id:t.string().min(1),site_id:k,deployment_id:pt,status:Ga,updated_at:t.string().min(1)}),DI="vcp:deployments",rq={path:"/v1/sites/:site_id/deployments/:deployment_id/socket",redis_channel:DI,outbound_message_schema:"DeploymentWsServerMessageSchema",message_types:[...vI.options]},OI=t.object({error:t.object({code:t.string().min(1),message:t.string().min(1),details:t.unknown().optional(),request_id:t.string().min(1).optional(),retryable:t.boolean().default(!1)})}),cq=t.object({error:OI.shape.error.extend({code:t.literal("AGENT_RUN_IN_FLIGHT"),details:t.object({code:t.literal("AGENT_RUN_IN_FLIGHT"),message:t.string().min(1),agent_run:st})})}),mq=t.object({colors:t.record(t.string(),t.string()).default({}),typography:t.record(t.string(),t.string()).default({}),spacing:t.record(t.string(),t.string()).default({}),motion:t.record(t.string(),t.string()).default({})}),NI=t.object({theme_id:t.string().min(1),paletteIntent:t.string().min(1),tone:t.string().min(1),mediaMood:t.string().min(1),motionLevel:La.optional(),userVisualHints:ja.optional()}),jI=t.object({key:t.string().min(1).max(64).optional(),question:t.string().min(1),answer:t.string().min(1)}),lq=t.object({query:t.string().min(1),keywords:t.array(t.string()).default([]),orientation:t.enum(["landscape","portrait","square"]).optional(),role:t.enum(["hero","section","card","gallery","testimonial","decorative"]),altHint:t.string().min(1)}),pq=t.object({id:t.string().min(1),role:t.enum(["site_background","nav_background","footer_background"]),query:t.string().min(1),keywords:t.array(t.string()).default([]),treatment:t.enum(["cover","fixed-cover","subtle-texture"]),altHint:t.string().optional()}),LI=t.object({provider:t.enum(["unsplash","pexels"]),providerLabel:t.enum(["Unsplash","Pexels"]),providerHref:t.string().url(),photoHref:t.string().url().optional(),photographerName:t.string().optional(),photographerHref:t.string().url().optional(),requiresAttribution:t.boolean()}),dq=t.object({src:t.string().min(1),alt:t.string().min(1),width:t.number().int().positive().optional(),height:t.number().int().positive().optional(),provider:t.enum(["unsplash","pexels","placeholder"]).optional(),providerId:t.string().optional(),photoUrl:t.string().url().optional(),photographer:t.string().optional(),photographerUrl:t.string().url().optional(),credit:t.string().optional(),dominantColor:t.string().optional(),attribution:LI.optional()}),MI=t.enum(["system_recommended","user_picked","user_picked_extended","deterministic_fallback"]),yn=t.object({id:t.string().min(1),name:t.string().min(1),category:t.literal("page-generation"),version:t.string().min(1).optional(),reason:t.string().min(1).max(200),source:MI.default("system_recommended")}),oe=t.string().min(1).max(2e3),Op=t.string().min(1).max(120),yi=t.object({visualDirection:oe,brandFeeling:oe,paletteIntent:oe,typographyIntent:oe,density:bI,motionLevel:yI,motionPreset:t.enum(["subtle","moderate","expressive"]).optional(),mediaStrategy:oe,compositionRules:t.array(oe).max(20),avoidPatterns:t.array(oe).max(20),fonts:t.object({heading:t.string().min(1),body:t.string().min(1)}).optional(),colorSeeds:t.object({primary:t.string().min(1).max(40),accent:t.string().min(1).max(40),foreground:t.string().min(1).max(40).optional(),neutral:t.string().min(1).max(40).optional(),supporting:t.array(t.string().min(1).max(40)).max(4).optional()}).optional(),surfaceMode:t.enum(["light","dark"]).optional(),radius:t.enum(["none","sm","md","lg","xl"]).optional(),imagePalette:t.object({background:t.string().min(1).max(40).optional(),foreground:t.string().min(1).max(40).optional(),card:t.string().min(1).max(40).optional(),muted:t.string().min(1).max(40).optional(),border:t.string().min(1).max(40).optional()}).optional(),weightStyle:Be.optional()}),qa=160,Kp=t.object({routeGoal:oe,narrativeArc:oe,firstViewportIntent:oe,visualContinuity:oe,sectionRhythm:oe,avoidPatterns:t.array(oe).max(20),displayTitle:t.string().min(1).max(40).optional(),displayDescription:t.string().min(1).max(qa).optional(),metaTitle:t.string().min(1).max(120).optional(),metaDescription:t.string().min(1).max(320).optional(),primaryKeyword:t.string().min(1).max(160).optional(),longTailKeywords:t.array(t.string().min(1).max(160)).max(3).optional()}),zp=t.enum(["model_call","validation","repair","preview","worker_group"]),jt=t.enum(["generating","generating_design_plan","checking_quality","updating_design_memory"]),Hp=t.object({sectionRole:oe,contentIntent:oe,layoutIntent:oe,visualIntent:oe,mediaIntent:oe,motionIntent:oe,interaction:gs.optional(),copyTone:oe,displayTitle:t.string().min(1).max(40).optional(),displayDescription:t.string().min(1).max(qa).optional(),ctaIntent:oe.optional(),continuityWithPrevious:oe.optional(),avoidRepeating:t.array(oe).max(20).optional(),industryRecipeRefs:t.array(Op).max(12).optional(),templateRecipeRefs:t.array(Op).max(12).optional()}),$p=t.object({siteName:t.string().min(1).max(120),tagline:t.string().min(1).max(200).optional(),primaryCta:t.object({label:t.string().min(1).max(60),target:t.string().min(1).max(200)}).optional(),trustSignals:t.array(t.string().min(1).max(60)).max(6).optional(),industry:t.string().min(1).max(40).optional()}),UI=t.enum(["solid","floating"]),FI=t.enum(["background","card","primary","frosted"]),GI=t.enum(["sticky","hide-on-scroll","static"]),qI=t.enum(["bar","island"]),WI=t.object({variant:UI,surface:FI.optional(),behavior:GI.optional(),shape:qI.optional()}),BI=t.object({form:oe,layoutIntent:oe,scrollBehavior:oe,shell:WI.optional(),avoidPatterns:t.array(oe).max(10).optional()}),KI=t.enum(["background","card","primary","inverse"]),zI=t.object({surface:KI}),HI=t.object({form:oe,composition:oe,shell:zI.optional(),avoidPatterns:t.array(oe).max(10).optional()}),$I=t.object({pattern:oe,intent:oe}),Vp=t.object({header:BI,footer:HI,mobileNav:$I}),Yp=t.enum(["top","below-hero","footer","none"]),Xp=t.object({schemaVersion:t.literal(1).default(1),siteDesignContext:yi,routeCards:t.record(t.string().min(1),Kp),blockContexts:t.record(t.string().min(1),Hp),selectedSkillPacks:t.array(yn).max(3).optional(),branding:$p.optional(),chromeDesign:Vp.optional(),breadcrumbPlacement:Yp.optional()}),uq=t.object({siteDesignContext:yi.omit({imagePalette:!0}).optional(),routeCards:t.record(t.string().min(1),Kp).optional(),blockContexts:t.record(t.string().min(1),Hp.extend({interaction:gs.nullable().optional()})).optional(),branding:$p.optional(),chromeDesign:Vp.optional()}),qe=t.string().trim().min(1),Wa=t.object({id:qe,label:t.string().trim().min(1),type:t.string(),variant:t.string().optional(),order:t.number(),props:t.record(t.string(),t.unknown()),meta:t.object({aiGenerated:t.boolean(),userEdited:t.boolean(),lastEditedAt:t.string(),lastEditedBy:t.enum(["ai","user"]),userInstruction:t.string().optional()}).optional()}).strict(),Ba=t.string().regex(Ln,"Page slug must be '/' or a lowercase ASCII kebab-case absolute path."),VI=new RegExp(`^/(?:${tn}(?:/${tn})*)?(?:\\?[^#\\s]*)?(?:#[^\\s]*)?$`),YI=/^(?:#[^\s]*|[a-z][a-z0-9+.-]*:[^\s]+|\/\/[^\s]+)$/i,XI=t.union([t.string().regex(VI),t.string().regex(YI)]),Np=t.object({label:t.string(),href:XI}).passthrough(),QI=t.object({primaryLinks:t.array(Np),footerLinks:t.array(Np)}),Qp=t.object({showInHeader:t.boolean(),showInFooter:t.boolean(),order:t.number()}).strict(),Ka=t.object({id:qe,slug:Ba,title:t.string().trim().min(1),blocks:t.array(Wa).min(1),navigation:Qp,parent_page_id:qe.nullable().optional()}).strict(),ZI=Wa.extend({type:t.string().nullable()}).strict(),JI=Ka.extend({slug:Ba.nullable(),navigation:Qp.extend({showInHeader:t.boolean().nullable(),showInFooter:t.boolean().nullable()}).strict(),blocks:t.array(ZI).min(1)}).strict(),eT=Wa.extend({id:t.string()}),tT=Ka.omit({parent_page_id:!0}).extend({id:t.string(),slug:t.string().min(1),blocks:t.array(eT).min(1),parent_page_id:t.string().nullable().optional()}),jp=t.object({label:t.string(),href:t.string().min(1)}),nT=t.object({primaryLinks:t.array(jp),footerLinks:t.array(jp)}),sT=t.discriminatedUnion("kind",[t.object({kind:t.literal("brief_clarify"),brief_id:Xt,answer_ids:t.array(t.string().min(1)).max(10)}).strict(),t.object({kind:t.literal("step5_strategy"),strategy_version_id:t.string().uuid(),strategy_version:t.number().int().positive(),strategy_checksum:t.string().regex(/^[a-f0-9]{64}$/)}).strict()]),Ei=t.object({site_name:t.string().min(1).max(80).optional(),version:t.number().int().positive(),pages:t.array(Ka).min(1),navigation:QI,integrations:t.object({cms:t.unknown().optional(),analytics:t.unknown().optional()}).optional(),meta:t.object({generatedAt:t.string(),generatedBy:t.literal("sitemap-agent"),source_brief_id:t.string().optional(),source_answer_ids:t.array(t.string()).optional(),source:sT.optional()}),skillSelection:yn,visualTheme:NI.optional(),userChoices:t.array(jI).optional(),confirmedChoices:t.object({conversion:Ut.optional()}).optional(),seoKeywords:t.array(vn).min(1).optional()}).strict(),xn=Ei.superRefine((e,n)=>{Zp(e.pages,n)}),hn=Ei.extend({pages:t.array(JI).min(1)}).strict().superRefine((e,n)=>{Zp(e.pages,n)}),iT=t.enum(["slug","showInHeader","showInFooter"]),oT=t.object({page_id:qe,fields:t.array(iT).min(1).max(3)}).strict(),aT=t.object({page_id:qe,block_id:qe,fields:t.tuple([t.literal("type")])}).strict(),rT=100,cT=500,mT=t.object({pages:t.array(oT).max(rT),blocks:t.array(aT).max(cT)}).strict().superRefine((e,n)=>{let s=new Set;e.pages.forEach((o,a)=>{s.has(o.page_id)&&n.addIssue({code:"custom",path:["pages",a,"page_id"],message:`Duplicate page target '${o.page_id}'.`}),s.add(o.page_id),new Set(o.fields).size!==o.fields.length&&n.addIssue({code:"custom",path:["pages",a,"fields"],message:"Page target fields must be unique."})});let i=new Set;e.blocks.forEach((o,a)=>{let c=`${o.page_id}\0${o.block_id}`;i.has(c)&&n.addIssue({code:"custom",path:["blocks",a],message:`Duplicate block target '${o.page_id}/${o.block_id}'.`}),i.add(c)})}),_q=t.object({sitemap:hn,targets:mT,reserved_slugs:t.array(Ba).optional()}).strict(),gq=t.object({sitemap:xn}).strict();function Zp(e,n){let s=new Map,i=new Map,o=new Map,a=0;e.forEach((m,x)=>{let _=s.get(m.id);if(_!==void 0?n.addIssue({code:"custom",path:["pages",x,"id"],message:`Duplicate page id '${m.id}' (first used at pages.${_}.id).`}):s.set(m.id,x),m.blocks.forEach((B,z)=>{let ne=i.get(B.id);ne!==void 0?n.addIssue({code:"custom",path:["pages",x,"blocks",z,"id"],message:`Duplicate block id '${B.id}' (first used at pages.${ne.pageIndex}.blocks.${ne.blockIndex}.id).`}):i.set(B.id,{pageIndex:x,blockIndex:z})}),m.slug===null)return;m.slug==="/"&&(a+=1);let w=o.get(m.slug);w!==void 0?n.addIssue({code:"custom",path:["pages",x,"slug"],message:`Duplicate page slug '${m.slug}' (first used at pages.${w}.slug).`}):o.set(m.slug,x)}),(a!==1||e[0]?.slug!=="/")&&n.addIssue({code:"custom",path:["pages"],message:"Sitemap must contain exactly one home page at pages[0] with slug '/'.",params:{errorCode:vp}});let c=new Map(e.map((m,x)=>[m.id,{page:m,index:x}])),r=(m,x)=>n.addIssue({code:"custom",path:m,message:x,params:{errorCode:vp}});e.forEach((m,x)=>{let _=m.parent_page_id??null;if(_===null)return;let w=["pages",x,"parent_page_id"];if(m.slug==="/"){r(w,"The home page cannot have a parent.");return}if(_===m.id){r(w,`Page '${m.id}' cannot be its own parent.`);return}let B=c.get(_);if(!B){r(w,`Parent page '${_}' does not exist.`);return}if(B.page.slug==="/"){r(w,"The home page cannot have sub pages.");return}(B.page.parent_page_id??null)!==null&&r(w,`Sitemap allows at most two levels; parent '${_}' must be a top-level page.`)})}var hq=Ei.omit({skillSelection:!0,visualTheme:!0,userChoices:!0,confirmedChoices:!0,seoKeywords:!0}).extend({meta:Ei.shape.meta.omit({source:!0}),site_name:t.string().min(1).max(80),pages:t.array(tT).min(1),navigation:nT}),lT=t.enum(["ai","user"]),En=t.object({site_id:k,page_id:qe,edited_by:lT.default("ai"),source_agent_run_id:$.optional()}),Sq=En.extend({block_id:qe,target_index:t.number().int().min(0)}),pT=En.extend({block_id:qe}),dT=En.extend({block_id:qe,instruction:t.string()}),fq=En.extend({block_id:qe,variant:t.string().min(1).nullable()}),bq=En.extend({block_id:qe,props:t.record(t.string(),t.unknown()),mode:t.enum(["replace","merge"]).default("replace")}),yq=En.extend({block:t.object({id:qe,label:t.string().trim().min(1),type:t.string().min(1),variant:t.string().min(1).optional(),props:t.record(t.string(),t.unknown()).default({}),insert_index:t.number().int().min(0).optional()})}),uT=t.enum(["move_block","delete_block","update_block_instruction","change_block_variant","update_block_props","add_block"]),xq=t.discriminatedUnion("operation",[t.object({operation:t.literal("delete_block"),input:pT}).strict(),t.object({operation:t.literal("update_block_instruction"),input:dT}).strict()]),_T=t.enum(["SITEMAP_EDIT_INVALID","SITEMAP_API_NOT_CONFIGURED","SITEMAP_NOT_FOUND","SITEMAP_PAGE_NOT_FOUND","SITEMAP_BLOCK_NOT_FOUND","SITEMAP_BLOCK_ALREADY_EXISTS","SITEMAP_LAST_BLOCK_DELETE_FORBIDDEN","SITEMAP_EDIT_FAILED"]),gT=t.object({status:t.literal("updated"),operation:uT,site_id:k,sitemap_id:Ae,version:t.number().int().positive(),changed_pages:t.array(qe).min(1),requires_code_patch:t.literal(!0)}),hT=t.object({status:t.literal("failed"),code:_T,message:t.string().min(1),retryable:t.boolean().default(!1),details:t.unknown().optional()}),Eq=t.discriminatedUnion("status",[gT,hT]),za=t.object({question_id:t.string().min(1),value:t.string().min(1),label:t.string().min(1).optional(),question:t.string().min(1).optional(),option_label:t.string().min(1).optional(),motion_level:La.optional(),visual_tonality:ja.optional(),conversion:Ut.optional(),positioning:t.object({market:t.string().min(1).max(200),customer:t.string().min(1).max(200),purpose:t.string().min(1).max(60)}).optional()}),ST=t.object({id:t.string().trim().min(1).max(128),type:t.literal(1),search_intent:t.string().trim().min(1).max(255),path:t.string().trim().regex(/^\/(?:[a-z0-9]+(?:-[a-z0-9]+)*)?$/),channel:t.string().trim().min(1).max(80),content_format:t.string().trim().min(1).max(80),priority:t.enum(["P0","P1","P2","P3"])}).strict(),Rq=t.object({source:t.object({kind:t.literal("step5_strategy")}).strict()}).strict(),fT=t.object({item_key:Ps,title:t.string().trim().min(1).max(200),selected_option_id:On,selected_label:t.string().trim().min(1).max(200),selected_value:t.string().trim().min(1).max(500),selected_description:t.string().trim().min(1).max(2e3),impact:t.string().trim().min(1).max(500).optional(),customer_note:t.string().trim().min(1).max(200).optional(),market_type:ws.optional(),markets:t.array(Cs).max(32).optional(),promoted_businesses:vs.optional(),sections:t.array(t.object({id:t.string().min(1),label:t.string().min(1)}).strict()).optional()}).strict().superRefine((e,n)=>{e.item_key==="product"&&!e.promoted_businesses&&n.addIssue({code:"custom",path:["promoted_businesses"],message:"The product sitemap decision requires ordered promoted businesses."}),e.item_key!=="product"&&e.promoted_businesses!==void 0&&n.addIssue({code:"custom",path:["promoted_businesses"],message:"Promoted businesses are only valid for the product sitemap decision."})}),bT=t.object({kind:t.literal("step5_strategy"),site_name:t.string().trim().min(1).max(80).optional(),strategy_version_id:t.string().uuid(),strategy_version:t.number().int().positive(),strategy_checksum:t.string().regex(/^[a-f0-9]{64}$/),decisions:t.array(fT).min(ks).max(Ne),enterprise_keywords:t.array(vn).min(1).optional()}).strict().superRefine((e,n)=>{let s=e.decisions.map(o=>o.item_key);new Set(s).size!==s.length&&n.addIssue({code:"custom",path:["decisions"],message:"Step5 sitemap decisions must use unique strategy keys."}),Dn.forEach(o=>{s.includes(o)||n.addIssue({code:"custom",path:["decisions"],message:`Step5 sitemap decisions are missing ${o}.`})});let i=Jt.filter(o=>s.includes(o));e.decisions.forEach((o,a)=>{o.item_key!==i[a]&&n.addIssue({code:"custom",path:["decisions",a,"item_key"],message:"Step5 sitemap decisions must use the canonical order."})})}),Jp=t.object({tenant_id:t.string().min(1),site_id:k,brief_id:Xt,brief:t.string().min(20).max(1e3),answers:t.array(za).min(1).max(10),skillSelection:yn,site_default_locale:Ie.optional(),owner_locale:Ie.optional(),cms_site_id:t.string().min(1).nullish(),intent_pages:t.array(ST).max(9).optional(),reference:Ss.optional(),input_context:t.object({facts:t.array(hs).max(120),conflicts:t.array(fs).max(20)}).optional(),business_facts:gr.optional(),migration_products_enabled:t.boolean().optional()}),yT=Jp.pick({tenant_id:!0,site_id:!0,skillSelection:!0,site_default_locale:!0,owner_locale:!0,cms_site_id:!0,reference:!0,input_context:!0,business_facts:!0,migration_products_enabled:!0}).partial({skillSelection:!0}).extend({source:bT}).strict(),Iq=t.union([Jp,yT]),ed=t.enum(["planning","generating","validating","ready"]),xT=t.enum(["salvaged","deterministic_fallback"]),ET=t.enum(["model_exception_settled_prefix","model_exception_safe_root"]),td={outcome:xT.optional(),reason:ET.optional(),attempts:t.number().int().positive().optional()};function nd(e,n){if(e.type!=="sitemap.generated")return;let s=e.outcome!==void 0,i=e.reason!==void 0;s!==i&&n.addIssue({code:"custom",path:[s?"reason":"outcome"],message:"sitemap.generated outcome and reason must be provided together"})}var RT=t.discriminatedUnion("type",[t.object({type:t.literal("run.started"),runId:$,at:t.string().min(1)}),t.object({type:t.literal("sitemap.generating"),stage:ed,message:t.string().min(1).optional(),at:t.string().min(1)}),t.object({type:t.literal("sitemap.partial"),object:t.unknown(),at:t.string().min(1)}),t.object({type:t.literal("sitemap.generated"),sitemap_id:Ae,sitemap:xn,...td,at:t.string().min(1)}),t.object({type:t.literal("sitemap.clamped"),reason:t.enum(["page_early_stop","finalize_best_effort"]),original_page_count:t.number().int().nonnegative().optional(),final_page_count:t.number().int().nonnegative().optional(),original_block_count:t.number().int().nonnegative().optional(),final_block_count:t.number().int().nonnegative().optional(),at:t.string().min(1)}),t.object({type:t.literal("media_resolution.started"),slot_count:t.number().int().nonnegative(),at:t.string().min(1)}),t.object({type:t.literal("media_resolution.finished"),slot_count:t.number().int().nonnegative(),provider_counts:t.object({unsplash:t.number().int().nonnegative(),pexels:t.number().int().nonnegative(),placeholder:t.number().int().nonnegative()}),fallback_count:t.number().int().nonnegative(),error_codes:t.array(t.string()),at:t.string().min(1)}),t.object({type:t.literal("snapshot.created"),snapshot_id:I,manifest_hash:t.string().regex(/^sha256:[a-f0-9]{64}$/),at:t.string().min(1)}),t.object({type:t.literal("run.failed"),error_code:t.string().min(1),message:t.string().min(1),at:t.string().min(1)}),t.object({type:t.literal("run.finished"),snapshot_id:I.optional(),at:t.string().min(1)})]),Tq=RT.superRefine(nd),sd=t.object({id:Ae,tenant_id:t.string().min(1),site_id:k,version:t.number().int().positive(),source_agent_run_id:$.nullable(),created_at:t.string().min(1),updated_at:t.string().min(1)}).strict();function id(e,n){e.version!==e.sitemap.version&&n.addIssue({code:"custom",path:["sitemap","version"],message:`Sitemap JSON version ${e.sitemap.version} must equal record version ${e.version}.`})}var od=sd.extend({sitemap:xn}).superRefine(id),ad=sd.extend({sitemap:hn}).superRefine(id),kq=t.object({sitemap_id:Ae,creation_key:t.string().min(1),sitemap:hn,expected_current_sitemap_id:Ae,expected_current_sitemap_version:t.number().int().positive()}).strict().superRefine((e,n)=>{e.sitemap.version!==e.expected_current_sitemap_version&&n.addIssue({code:"custom",path:["sitemap","version"],message:"Draft version must match the expected base version."})}),Aq=t.object({sitemap:ad}).strict();function Pq(e){return`sitemap-user-draft:${e.site_id}:${e.expected_current_sitemap_id}:${e.expected_current_sitemap_version}:${e.sitemap_id}`}var wq=t.object({sitemap_id:Ae,creation_key:t.string().min(1),sitemap:xn,source_agent_run_id:$.optional()}),Cq=t.object({sitemap_id:Ae,creation_key:t.string().min(1),sitemap:hn,expected_current_sitemap_id:Ae,expected_current_sitemap_version:t.number().int().positive(),migration_content_requested:t.boolean().optional()}),vq=t.object({sitemap_id:Ae,creation_key:t.string().min(1),sitemap:xn,source_agent_run_id:$}),Dq=t.object({site:Lt,sitemap:od,next_step:t.literal("workspace")}).strict(),Oq=t.object({site:Lt,sitemap:ad,next_step:t.literal("workspace")}).strict(),Nq=t.object({site:Lt,sitemap:od,next_step:t.literal("sitemap_review")}).strict(),IT=t.object({id:Za,tenant_id:t.string().min(1),site_id:k,brief_id:Xt,questions:Ma,answers:t.array(za),selected_archetype:yn.optional(),completed_at:t.string().min(1).nullable(),created_at:t.string().min(1),updated_at:t.string().min(1)}),jq=t.object({answers:t.array(za).min(1),questions:Ma,selected_archetype:yn.optional()}),Lq=t.object({clarify_session:IT}),Mq=t.object({questions:Ma,selected_archetype:yn}),TT=t.object({id:Ai,tenant_id:t.string().min(1),site_id:k,version:t.number().int().positive(),design_plan:Xp,source_agent_run_id:$.nullable(),created_at:t.string().min(1),updated_at:t.string().min(1)}),Uq=t.object({design_plan_id:Ai.optional(),design_plan:Xp,source_agent_run_id:$.optional()}),Fq=t.object({design_plan:TT}),ki=t.enum(["initial_generation","iteration","landing_page","fill_in"]),kT=t.object({label:t.string().min(1).max(48),prompt:t.string().min(1).max(160)}).strict(),AT=t.enum(["model","derived","mixed","advisor"]),rd=t.object({suggestions:t.array(kT).min(1).max(4),source:AT}).strict(),PT=t.enum(["clean","salvaged","deterministic_fallback","baseline_retained"]),wT=t.enum(["generation_succeeded","entry_slots_omitted","quality_gate_exhausted","schema_gate_exhausted","generation_timeout","stream_schema_mismatch","stream_generation_error","generation_error","fallback_compiler_error","legacy_result_missing_metadata"]),CT=t.enum(["progress","assistant_final"]),cd=t.enum(["run.started","message.delta","user.message","plan.updated","clarify.partial","clarify.archetype_proposals","clarify.finished","sitemap.generating","sitemap.partial","sitemap.generated","sitemap.clamped","sitemap.updated","sitemap.resync.failed","sitemap.resync.warning","block.changed","tool.started","tool.finished","workspace.plan.created","workspace.worker.updated","workspace.task.updated","workspace.degraded","workspace.design_plan.outcome","workspace.suggestions","workspace.generation_ledger","file.changed","snapshot.created","snapshot.finalized","preview.preparing","preview.ready","preview.build.started","preview.build.succeeded","preview.build.failed","run.failed","run.finished","media_resolution.started","media_resolution.finished","skill.selecting","skill.selected","activity.started","activity.updated","activity.finished","activity.failed"]),vT=t.object({id:t.string().min(1),title:t.string().min(1),status:t.enum(["pending","running","completed","failed"])}),Yt=t.enum(["pending","running","completed","completed_with_skips","failed","skipped"]),Ha=t.enum(["style_media","chrome","sections","layout","pages","detect_typecheck","repair","finalize","sitemap_resync","preview"]),$a=t.object({code:t.string().min(1),message:t.string().min(1),path:t.string().min(1).optional(),task_id:t.string().min(1).optional(),details:t.record(t.string(),t.unknown()).optional()}),De=t.string().min(1).refine(e=>xd(e),{message:"Snapshot file paths must be safe relative POSIX paths without traversal."}),Va=t.object({deduped_paths:t.array(De),skipped_tasks:t.array(t.string().min(1)),failed_tasks:t.array(t.string().min(1)),fallback_files:t.array(t.string().min(1)),applied_paths:t.array(De)}),Ya=t.object({group_id:t.string().min(1),phase:Ha,title:t.string().min(1),status:Yt,task_ids:t.array(t.string().min(1)),depends_on_groups:t.array(t.string().min(1)),target_paths:t.array(De)}),DT=t.enum(["style","media","chrome","section","layout","page","breadcrumb"]),Xa=t.object({task_id:t.string().min(1),group_id:t.string().min(1),kind:DT,target_path:De,block_id:t.string().min(1).optional(),block_type:t.string().min(1).optional(),block_variant:t.string().min(1).optional(),block_order:t.number().int().nonnegative().optional(),user_instruction:t.string().min(1).optional(),page_id:t.string().min(1).optional(),page_slug:t.string().min(1).optional(),page_title:t.string().min(1).optional(),title:t.string().min(1).max(60).optional(),description:t.string().min(1).max(qa).optional(),status:Yt,required_reads:t.array(De).optional(),search_params_sections:t.array(De).optional(),standard_form_view:De.optional(),breadcrumb:t.object({trail:t.array(t.object({name:t.string().min(1),href:t.string().min(1).nullable(),omitted_href:t.string().min(1).optional()}).strict()).min(1),current:t.string().min(1),placement:Yp.optional()}).strict().optional()}),Qa=t.object({from_group_id:t.string().min(1),to_group_id:t.string().min(1),reason:t.enum(["style_media","chrome","sections","layout","page_composition","quality_gate"])}),Gq=t.object({plan_id:t.string().min(1),run_kind:ki,model_route:t.object({planner:t.literal("workspace_planner"),worker:t.literal("workspace")}),groups:t.array(Ya),tasks:t.array(Xa),dependencies:t.array(Qa),expected_outputs:t.array(De),diagnostics:Va}),qq=t.object({task_id:t.string().min(1),patch:t.unknown().optional(),snapshot_id:I.optional(),read_files:t.array(De),diagnostics:t.array($a),status:Yt}),md=t.object({worker_count:t.number().int().nonnegative(),task_count:t.number().int().nonnegative(),group_count:t.number().int().nonnegative()}),ld=t.object({pending:t.number().int().nonnegative(),running:t.number().int().nonnegative(),completed:t.number().int().nonnegative(),completed_with_skips:t.number().int().nonnegative(),failed:t.number().int().nonnegative(),skipped:t.number().int().nonnegative()}),OT=t.object({type:t.literal("text"),text:t.string(),state:t.enum(["streaming","done"]).optional()}),NT=t.object({type:t.literal("reasoning"),text:t.string(),state:t.enum(["streaming","done"]).optional(),providerMetadata:t.record(t.string(),t.unknown()).optional()}),jT=t.object({type:t.literal("file"),mediaType:t.string().min(1),filename:t.string().min(1).optional(),url:t.string().min(1)}),LT=t.object({type:t.literal("source-url"),sourceId:t.string().min(1),url:t.string().min(1),title:t.string().min(1).optional(),providerMetadata:t.record(t.string(),t.unknown()).optional()}),MT=t.object({type:t.literal("source-document"),sourceId:t.string().min(1),mediaType:t.string().min(1),title:t.string().min(1),filename:t.string().min(1).optional(),providerMetadata:t.record(t.string(),t.unknown()).optional()}),UT=t.object({type:t.string().regex(/^data-[a-zA-Z0-9_-]+$/),id:t.string().min(1).optional(),data:t.unknown()}),FT=t.object({type:t.string().regex(/^tool-[a-zA-Z0-9_-]+$/),toolCallId:t.string().min(1),state:t.enum(["input-streaming","input-available","output-available","output-error"]),input:t.unknown().optional(),output:t.unknown().optional(),errorText:t.string().min(1).optional()}),GT=t.object({type:t.literal("error"),errorText:t.string().min(1)}),qT=t.object({type:t.literal("step-start")}),Ri=t.union([OT,NT,jT,LT,MT,UT,FT,GT,qT]),WT=t.string().min(1).max(512).refine(e=>xd(e)&&!/^[A-Za-z]:\//.test(e),{message:"Generated-code rescue paths must be safe relative POSIX paths without traversal."}),BT=t.array(WT).min(1).max(64),KT=t.array(t.string().min(1).max(120)).min(1).max(64),pd=t.discriminatedUnion("outcome",[t.object({outcome:t.literal("full_success"),page_copy:js.optional(),navigation:t.discriminatedUnion("status",[t.object({status:t.literal("not_requested")}).strict(),t.object({status:t.literal("succeeded")}).strict()])}).strict(),t.object({outcome:t.literal("partial_success"),page_copy:js.optional(),navigation:t.object({status:t.literal("failed"),error_code:t.string().min(1).max(120),message:t.string().min(1).max(360)}).strict()}).strict()]).describe("Typed completion details for a committed Workspace Resource Run."),zT=t.discriminatedUnion("type",[t.object({type:t.literal("run.started"),runId:$,at:t.string().min(1)}),t.object({type:t.literal("message.delta"),text:t.string().min(1),history_purpose:CT.optional(),at:t.string().min(1)}),t.object({type:t.literal("user.message"),client_message_id:t.string().min(1),message_id:t.string().min(1),parts:t.array(Ri).min(1),display_text:t.string().min(1).max(4e3).optional(),in_reply_to_tool_call_id:t.string().min(1).optional(),interaction_response:Ms.optional(),at:t.string().min(1)}),t.object({type:t.literal("plan.updated"),steps:t.array(vT),at:t.string().min(1)}),t.object({type:t.literal("clarify.partial"),object:t.unknown(),at:t.string().min(1)}),t.object({type:t.literal("clarify.archetype_proposals"),proposals:t.array(Lp).min(1).max(5),at:t.string().min(1)}),t.object({type:t.literal("clarify.finished"),questions_id:t.string().min(1),at:t.string().min(1)}),t.object({type:t.literal("sitemap.generating"),stage:ed,message:t.string().min(1).optional(),at:t.string().min(1)}),t.object({type:t.literal("sitemap.partial"),object:t.unknown(),at:t.string().min(1)}),t.object({type:t.literal("sitemap.generated"),sitemap_id:Ae,sitemap:xn,...td,at:t.string().min(1)}),t.object({type:t.literal("sitemap.clamped"),reason:t.enum(["page_early_stop","finalize_best_effort"]),original_page_count:t.number().int().nonnegative().optional(),final_page_count:t.number().int().nonnegative().optional(),original_block_count:t.number().int().nonnegative().optional(),final_block_count:t.number().int().nonnegative().optional(),at:t.string().min(1)}).strict(),t.object({type:t.literal("sitemap.updated"),sitemap_id:Ae,version:t.number().int().positive(),reason:t.string().min(1),at:t.string().min(1)}),t.object({type:t.literal("sitemap.resync.failed"),error_code:t.string().min(1),message:t.string().min(1),retryable:t.boolean(),diagnostics:t.unknown().optional(),at:t.string().min(1)}),t.object({type:t.literal("sitemap.resync.warning"),code:t.string().min(1),message:t.string().min(1),diagnostics:t.unknown().optional(),at:t.string().min(1)}),t.object({type:t.literal("block.changed"),block_id:t.string().min(1),change_type:t.enum(["add","update","delete","move"]),at:t.string().min(1)}),t.object({type:t.literal("tool.started"),tool_call_id:t.string().min(1),name:t.string().min(1),summary:t.string().min(1),at:t.string().min(1)}),t.object({type:t.literal("tool.finished"),tool_call_id:t.string().min(1),name:t.string().min(1),result_summary:t.string().min(1),interaction_request:So.optional(),interaction_failure:ho.optional(),at:t.string().min(1)}),t.object({type:t.literal("workspace.plan.created"),plan_id:t.string().min(1),run_kind:ki,groups:t.array(Ya),tasks:t.array(Xa),dependencies:t.array(Qa),expected_outputs:t.array(De),diagnostics:Va,summary:md,at:t.string().min(1)}).strict(),t.object({type:t.literal("workspace.worker.updated"),group_id:t.string().min(1),phase:Ha,status:Yt,task_counts:ld,target_paths:t.array(De),diagnostics:t.array(t.string().min(1)),at:t.string().min(1)}).strict(),t.object({type:t.literal("workspace.task.updated"),task_id:t.string().min(1),group_id:t.string().min(1),status:Yt,target_path:De,read_files_count:t.number().int().nonnegative(),diagnostics:t.array(t.string().min(1)),diagnostic_details:t.array($a).optional(),at:t.string().min(1)}).strict(),t.object({type:t.literal("workspace.degraded"),reason:t.enum(["block_placeholder","form_placeholder","patch_protected_dropped","preview_health_degraded","preview_build_failed","design_plan_fallback","generated_code_rescue","cms_page_directory_degraded","form_prebuild_skipped","form_section_fallback","first_settings_sync_failed","component_omitted","page_omitted","shared_fallback"]),degraded_block_ids:t.array(t.string().min(1)).min(1).optional(),dropped_files:t.array(t.string().min(1)).min(1).optional(),degraded_file_paths:BT.optional(),degraded_page_ids:KT.optional(),snapshot_id:I.optional(),code:t.string().min(1).optional(),message:t.string().min(1).optional(),diagnostics:t.string().min(1).optional(),retryable:t.boolean().optional(),at:t.string().min(1)}).strict().superRefine((e,n)=>{let s=e.reason==="generated_code_rescue",i=e.reason==="page_omitted",o=e.reason==="shared_fallback";if(!s){if(e.degraded_file_paths!==void 0&&n.addIssue({code:"custom",path:["degraded_file_paths"],message:"degraded_file_paths is only allowed for generated_code_rescue"}),e.degraded_page_ids!==void 0&&!i&&n.addIssue({code:"custom",path:["degraded_page_ids"],message:"degraded_page_ids is only allowed for generated_code_rescue or page_omitted"}),o)for(let a of["degraded_block_ids","dropped_files","snapshot_id","code","diagnostics","retryable"])e[a]!==void 0&&n.addIssue({code:"custom",path:[a],message:`${a} is not allowed for shared_fallback`});return}e.degraded_file_paths===void 0&&n.addIssue({code:"custom",path:["degraded_file_paths"],message:"generated_code_rescue requires degraded_file_paths"});for(let a of["degraded_block_ids","dropped_files","snapshot_id","code","message","diagnostics","retryable"])e[a]!==void 0&&n.addIssue({code:"custom",path:[a],message:`${a} is not allowed for generated_code_rescue`})}),t.object({type:t.literal("workspace.design_plan.outcome"),design_plan_outcome:PT,reason:wT,gate_diagnostics:t.object({gate:t.enum(["quality","schema"]),issue_codes:t.array(t.string().min(1)).max(20),issue_paths:t.array(t.string()).max(20),finish_reason:t.string().min(1).optional()}).strict().optional(),media_floor:t.object({total_blocks:t.number().int().min(0),media_bearing_blocks:t.number().int().min(0),hero_total:t.number().int().min(0),hero_media_bearing:t.number().int().min(0),pages_without_media:t.array(t.string().min(1)).max(50),met:t.boolean()}).strict().optional(),at:t.string().min(1)}).strict(),rd.extend({type:t.literal("workspace.suggestions"),at:t.string().min(1)}).strict(),fr,t.object({type:t.literal("file.changed"),path:t.string().min(1),change_type:t.enum(["create","update","delete"]),diff:t.string().optional(),at:t.string().min(1)}),t.object({type:t.literal("snapshot.created"),snapshot_id:I,manifest_hash:t.string().regex(/^sha256:[a-f0-9]{64}$/),at:t.string().min(1)}),t.object({type:t.literal("snapshot.finalized"),snapshot_id:I,at:t.string().min(1)}),t.object({type:t.literal("preview.preparing"),at:t.string().min(1)}),t.object({type:t.literal("preview.ready"),url:t.string().url(),at:t.string().min(1),launch_id:t.string().min(1).optional()}),t.object({type:t.literal("preview.build.started"),snapshot_id:I,at:t.string().min(1)}),t.object({type:t.literal("preview.build.succeeded"),snapshot_id:I,at:t.string().min(1)}),t.object({type:t.literal("preview.build.failed"),snapshot_id:I,message:t.string().min(1),diagnostics:t.string().min(1),retryable:t.boolean(),at:t.string().min(1)}),t.object({type:t.literal("run.failed"),error_code:t.string().min(1),message:t.string().min(1),error_category:Mp.optional(),retryable:t.boolean().optional(),attempts:t.number().int().positive().optional(),outcome:t.literal("retained_previous").optional(),details:t.record(t.string(),t.unknown()).optional(),at:t.string().min(1)}),t.object({type:t.literal("run.finished"),snapshot_id:I.optional(),degraded_reason:Tn.optional(),build_verified:t.boolean().optional(),generation_ledger:wn.optional(),resource_operation:pd.optional(),at:t.string().min(1)}),t.object({type:t.literal("media_resolution.started"),slot_count:t.number().int().nonnegative(),at:t.string().datetime()}),t.object({type:t.literal("media_resolution.finished"),slot_count:t.number().int().nonnegative(),provider_counts:t.object({unsplash:t.number().int().nonnegative(),pexels:t.number().int().nonnegative(),placeholder:t.number().int().nonnegative()}),fallback_count:t.number().int().nonnegative(),error_codes:t.array(t.string()),at:t.string().datetime()}),t.object({type:t.literal("skill.selecting"),category:t.literal("page-generation"),available:t.array(t.object({id:t.string().min(1),name:t.string().min(1)})).max(20),at:t.string().min(1)}),t.object({type:t.literal("skill.selected"),category:t.literal("page-generation"),selected:t.object({id:t.string().min(1),name:t.string().min(1),reason:t.string().min(1).max(200)}),at:t.string().min(1)}),t.object({type:t.literal("activity.started"),activity_id:t.string().min(1),parent_activity_id:t.string().min(1).optional(),kind:zp,title:t.string().min(1).max(200),detail:t.string().max(360).optional(),title_code:jt.optional(),detail_code:jt.optional(),locks_input:t.boolean(),at:t.string().min(1)}),t.object({type:t.literal("activity.updated"),activity_id:t.string().min(1),title:t.string().min(1).max(200).optional(),detail:t.string().max(360).optional(),title_code:jt.optional(),detail_code:jt.optional(),at:t.string().min(1)}),t.object({type:t.literal("activity.finished"),activity_id:t.string().min(1),at:t.string().min(1)}),t.object({type:t.literal("activity.failed"),activity_id:t.string().min(1),detail:t.string().max(360).optional(),at:t.string().min(1)})]),dd=zT.superRefine(nd).superRefine((e,n)=>{if(e.type==="user.message"&&e.interaction_response&&!e.in_reply_to_tool_call_id&&n.addIssue({code:"custom",path:["in_reply_to_tool_call_id"],message:"in_reply_to_tool_call_id is required for an interaction response"}),e.type==="run.finished"&&e.resource_operation&&!e.snapshot_id&&n.addIssue({code:"custom",path:["snapshot_id"],message:"resource_operation requires a confirmed snapshot_id"}),e.type!=="tool.finished")return;let s=e.name==="prepare_product_search_entry",i=!!e.interaction_request,o=!!e.interaction_failure;(s?i!==o:!i&&!o)||n.addIssue({code:"custom",path:["interaction_request"],message:s?"prepare_product_search_entry requires exactly one of interaction_request or interaction_failure":"product search interaction results are only valid for prepare_product_search_entry"})}),Na=t.object({id:er,tenant_id:t.string().min(1),site_id:k,agent_run_id:$,sequence:t.number().int().positive(),event_type:cd,payload:dd,created_at:t.string().min(1),thread_id:it.nullable().optional()}),Wq=t.object({event_type:cd,payload:dd}).superRefine((e,n)=>{e.event_type!==e.payload.type&&n.addIssue({code:"custom",path:["payload","type"],message:"payload.type must match event_type"}),ms(e.payload)&&n.addIssue({code:"custom",path:["payload"],message:"AgentEvent payload must not contain secrets"})}),Bq=t.discriminatedUnion("status",[t.object({status:t.literal("appended"),agent_run:st,event:Na,next_cursor:t.number().int().nonnegative()}),t.object({status:t.literal("duplicate_ignored"),agent_run:st,event:Na,next_cursor:t.number().int().nonnegative()})]),Kq=t.object({events:t.array(Na),next_cursor:t.number().int().nonnegative().optional()}),zq=t.object({after_sequence:t.coerce.number().int().nonnegative().default(0)}),Hq=t.object({run_id:$.optional(),thread_id:it.optional()}).superRefine((e,n)=>{e.run_id&&e.thread_id&&n.addIssue({code:"custom",path:["thread_id"],message:"run_id and thread_id are mutually exclusive"})}),$q=t.enum(["implemented","skeleton","planned"]),Vq=t.enum(["GET","POST","PUT","PATCH","DELETE"]),Yq=[{method:"PATCH",path:"/internal/sites/:site_id/snapshots/:snapshot_id/manifest",tag:"snapshots",summary:"Compare-and-set the manifest hash for the active current snapshot after an in-place object replacement.",status:"implemented",request_body_schema:"UpdateCurrentSnapshotManifestRequestSchema",response_schema:"SnapshotRecordSchema",notes:["Internal Agent authentication is required. The update succeeds only when site current_snapshot_id, snapshot status, object key, and expected manifest hash still match."]},{method:"GET",path:"/health",tag:"system",summary:"API health check.",status:"implemented",response_schema:"ApiHealth"},{method:"POST",path:"/sites",tag:"sites",summary:"Create a site and Step 1 brief in the current dev context.",status:"implemented",request_body_schema:"CreateSiteBriefRequestSchema",response_schema:"CreateSiteBriefResponseSchema"},{method:"POST",path:"/sites/drafts",tag:"sites",summary:"Create a draft site without a brief in the current tenant so /s/:site_id can collect Step 1 later.",status:"implemented",request_body_schema:"CreateSiteDraftRequestSchema",response_schema:"SiteRecordSchema"},{method:"GET",path:"/sites",tag:"sites",summary:"List current tenant sites.",status:"implemented",response_schema:"SiteRecordSchema[]"},{method:"GET",path:"/sites/by-cms/:cms_site_id",tag:"sites",summary:"Resolve an external CMS site id to one tenant-scoped VCP site.",status:"implemented",response_schema:"SiteRecordSchema",notes:["Used by the browser /d/:cms_site_id handoff route; lookup is scoped by current request tenant and returns 404 when the CMS site has not been synchronized."]},{method:"GET",path:"/sites/:site_id",tag:"sites",summary:"Get one tenant-scoped site.",status:"implemented",response_schema:"SiteRecordSchema"},{method:"POST",path:"/sites/:site_id/workflow",tag:"site-workflows",summary:"Create one version-bound site workflow from a published flow definition.",status:"implemented",request_body_schema:"CreateSiteWorkflowRequestSchema",response_schema:"SiteWorkflowSnapshotResponseSchema"},{method:"GET",path:"/sites/:site_id/workflow",tag:"site-workflows",summary:"Read the current site workflow snapshot and derived menu state.",status:"implemented",response_schema:"SiteWorkflowSnapshotResponseSchema"},{method:"GET",path:"/internal/sites/:site_id/workflow/progress",tag:"site-workflows",summary:"Read the minimal internal site workflow progress projection.",status:"implemented",response_schema:"SiteWorkflowProgressResponseSchema"},{method:"PUT",path:"/sites/:site_id/workflow/website",tag:"site-workflows",summary:"Update the source website while website_scan is current.",status:"implemented",request_body_schema:"UpdateSiteWorkflowWebsiteRequestSchema",response_schema:"SiteWorkflowSnapshotResponseSchema"},{method:"POST",path:"/sites/:site_id/workflow/advance",tag:"site-workflows",summary:"Advance one non-terminal workflow node with an expected-current-node guard.",status:"implemented",request_body_schema:"AdvanceSiteWorkflowRequestSchema",response_schema:"SiteWorkflowSnapshotResponseSchema"},{method:"POST",path:"/sites/:site_id/workflow/complete",tag:"site-workflows",summary:"Complete the workflow from its final publishing node after server-side release checks pass.",status:"implemented",request_body_schema:"CompleteSiteWorkflowRequestSchema",response_schema:"SiteWorkflowSnapshotResponseSchema",notes:["The browser supplies only the expected current node; the server verifies persisted release facts before completing the workflow."]},{method:"POST",path:"/sites/:site_id/workflow/complete-quality-only",tag:"site-workflows",summary:"Complete the designer workflow after the linked quality-only publish workflow succeeds.",status:"implemented",request_body_schema:"CompleteQualityOnlyWorkflowRequestSchema",response_schema:"SiteWorkflowSnapshotResponseSchema",notes:["The server resolves the designer role and atomically completes both workflows without creating a publish deployment or updating the site deployment projection."]},{method:"POST",path:"/sites/:site_id/workflow/tasks/register",tag:"site-workflows",summary:"Register a business-owned external task id and its idempotency key.",status:"implemented",request_body_schema:"RegisterWorkflowTaskCommandRequestSchema",response_schema:"SiteWorkflowTaskRefResponseSchema"},{method:"POST",path:"/sites/:site_id/workflow/step2-site-initialization/tasks",tag:"site-workflows/step2-site-initialization",summary:"Create or reuse the current workflow's Step2 website crawl task.",status:"implemented",response_schema:"Step2SiteInitializationTaskResponseSchema",notes:["The server derives tenantId, sessionId, and siteUrl from trusted request/workflow state; the browser cannot submit upstream scope fields."]},{method:"GET",path:"/sites/:site_id/workflow/step2-site-initialization/tasks/:task_id",tag:"site-workflows/step2-site-initialization",summary:"Poll the workflow-owned Step2 website crawl task.",status:"implemented",response_schema:"Step2SiteInitializationTaskResponseSchema",notes:["The task id must match the current non-superseded website_crawl task reference for the workflow."]},{method:"POST",path:"/sites/:site_id/workflow/tasks/:task_type/replace",tag:"site-workflows",summary:"Replace one task reference while retaining its superseded history.",status:"implemented",request_body_schema:"ReplaceWorkflowTaskCommandRequestSchema",response_schema:"SiteWorkflowTaskRefResponseSchema"},{method:"POST",path:"/sites/:site_id/workflow/tasks/website_crawl/replace-and-invalidate-dependents",tag:"site-workflows",summary:"Replace website crawl and invalidate basic-info and metrics dependents atomically.",status:"implemented",request_body_schema:"ReplaceCrawlWorkflowTaskCommandRequestSchema",response_schema:"SiteWorkflowTaskRefResponseSchema"},{method:"POST",path:"/sites/:site_id/workflow/build",tag:"site-workflows",summary:"Start the server-owned site build and workspace snapshot lifecycle.",status:"implemented",request_body_schema:"StartSiteBuildRequestSchema",response_schema:"StartSiteBuildResponseSchema",notes:["The browser may start or query the build, but cannot write site build or deployment summary status directly."]},{method:"GET",path:"/sites/:site_id/workflow/customer-materials",tag:"site-workflows",summary:"Read the persisted no-website customer materials draft.",status:"implemented",response_schema:"CustomerMaterialsNullableResponseSchema"},{method:"PUT",path:"/sites/:site_id/workflow/customer-materials",tag:"site-workflows",summary:"Save the no-website customer materials before submission.",status:"implemented",request_body_schema:"CustomerMaterialsDraftSchema",response_schema:"CustomerMaterialsResponseSchema",notes:["A submitted record is immutable and rejects later writes."]},{method:"POST",path:"/sites/:site_id/workflow/customer-materials/submit",tag:"site-workflows",summary:"Submit and freeze customer materials before analysis.",status:"implemented",request_body_schema:"CustomerMaterialsDraftSchema",response_schema:"CustomerMaterialsResponseSchema",notes:["Repeated submissions return 409; clients may retry only the separate workflow advance."]},{method:"GET",path:"/sites/:site_id/designer/component-library/categories",tag:"designer-component-library",summary:"List the fixed insert-new-component category tree for a site.",status:"implemented",response_schema:"ListDesignerComponentCategoriesResponseSchema",notes:["The server validates site ownership and fixes category_group_key to insertNewComponent."]},{method:"GET",path:"/sites/:site_id/designer/component-library/resources",tag:"designer-component-library",summary:"List component resources from the fixed designer catalog group.",status:"implemented",query_schema:"ListDesignerComponentsQuerySchema",response_schema:"ListDesignerComponentsResponseSchema",notes:["The server fixes resource type to component and does not expose resource-platform secrets, internal hosts, or product-line selection."]},{method:"POST",path:"/sites/:site_id/designer/component-library/resources/:resource_id/install",tag:"designer-component-library",summary:"Install one exact component version and return a strict SiteEditEngine materialization.",status:"implemented",request_body_schema:"InstallDesignerComponentBodySchema",response_schema:"InstallDesignerComponentResponseSchema",notes:["The server downloads the resource ZIP with the configured secret, validates main.json identity and compatibility, and returns only the strict materialization plus immutable revision metadata."]},{method:"GET",path:"/sites/:site_id/designer/page-library/categories",tag:"designer-page-library",summary:"List the fixed insert-new-page category tree for a site.",status:"implemented",response_schema:"ListDesignerPageCategoriesResponseSchema",notes:["The server validates site ownership and fixes category_group_key to insertNewPage."]},{method:"GET",path:"/sites/:site_id/designer/page-library/resources",tag:"designer-page-library",summary:"List page and pages resources from the fixed designer catalog.",status:"implemented",query_schema:"ListDesignerPagesQuerySchema",response_schema:"ListDesignerPagesResponseSchema",notes:["The server fixes resource types to page and pages and does not expose resource-platform credentials or internal routing."]},{method:"POST",path:"/sites/:site_id/designer/page-library/resources/:resource_id/prepare",tag:"designer-page-library",summary:"Resolve one exact page resource version for designer-side draft configuration.",status:"implemented",request_body_schema:"PrepareDesignerPageBodySchema",response_schema:"PrepareDesignerPageResponseSchema"},{method:"POST",path:"/sites/:site_id/designer/page-library/resources/:resource_id/install",tag:"designer-page-library",summary:"Install one exact page resource version and return a strict PageResourceArtifact.",status:"implemented",request_body_schema:"InstallDesignerPageBodySchema",response_schema:"InstallDesignerPageResponseSchema",notes:["The server validates the explicit resource type, immutable package identity, page selections, materializations, and package-local references."]},{method:"GET",path:"/sites/:site_id/designer/pages",tag:"designer-page-library",summary:"List designer pages from the stable first-phase fixture source.",status:"implemented",response_schema:"ListDesignerSitePagesResponseSchema"},{method:"POST",path:"/sites/:site_id/designer/page-resources/enhance",tag:"designer-page-library",summary:"Echo a designer page-resource candidate without model execution or normalization.",status:"implemented",request_body_schema:"EnhanceDesignerPageResourceBodySchema",response_schema:"EnhanceDesignerPageResourceResponseSchema"},{method:"POST",path:"/sites/:site_id/designer/page-resources/compose",tag:"designer-page-library",summary:"Compose exact page and component resources into one strict page artifact.",status:"implemented",request_body_schema:"ComposeDesignerPageResourceBodySchema",response_schema:"InstallDesignerPageResponseSchema",notes:["The server installs every immutable source, validates ordered page blocks, scopes component materializations, and returns one artifact without exposing resource-platform credentials."]},{method:"POST",path:"/sites/:site_id/designer/page-resources/blank",tag:"designer-page-library",summary:"Create the deterministic built-in blank page artifact for one configured route.",status:"implemented",request_body_schema:"InstallDesignerPageBodySchema",response_schema:"InstallDesignerPageResponseSchema"},{method:"PATCH",path:"/sites/:site_id",tag:"sites",summary:"Update site display name and optional generated-site locale for the current tenant.",status:"implemented",request_body_schema:"UpdateSiteRequestSchema",response_schema:"SiteRecordSchema"},{method:"DELETE",path:"/sites/:site_id",tag:"sites",summary:"Archive a site so it no longer appears in the tenant site list.",status:"implemented",response_schema:"SiteRecordSchema"},{method:"GET",path:"/sites/:site_id/workspace/source-files",tag:"sites",summary:"List source files available in the ready preview sandbox.",status:"implemented",response_schema:"WorkspaceSourceFileListItemSchema[]"},{method:"GET",path:"/sites/:site_id/workspace/source-file",tag:"sites",summary:"Read a source file from the ready preview sandbox.",status:"implemented",query_schema:"WorkspaceSourceFilePathQuerySchema",response_schema:"WorkspaceSourceFileResponseSchema"},{method:"GET",path:"/sites/:site_id/media-assets",tag:"media-assets",summary:"List or search enterprise image assets through the CMS adapter.",status:"implemented",query_schema:"ListMediaLibraryAssetsQuerySchema",response_schema:"ListMediaLibraryAssetsResponseSchema"},{method:"POST",path:"/sites/:site_id/media-assets",tag:"media-assets",summary:"Upload one validated image and create its enterprise asset.",status:"implemented",response_schema:"UploadMediaLibraryAssetResponseSchema",notes:["Accepts one multipart field named file; only the image MIME allowlist is accepted and the maximum size is 20 MiB."]},{method:"GET",path:"/sites/:site_id/media-assets/unsplash/search",tag:"media-assets",summary:"Search Unsplash through the VCP server-side client.",status:"implemented",query_schema:"SearchUnsplashMediaQuerySchema",response_schema:"SearchUnsplashMediaResponseSchema",notes:["The browser never receives the Unsplash access key; CMS is not involved in search."]},{method:"POST",path:"/sites/:site_id/media-assets/unsplash/:provider_id/use",tag:"media-assets",summary:"Best-effort report that an Unsplash image was selected.",status:"implemented",request_body_schema:"UseUnsplashMediaRequestSchema",response_schema:"UseUnsplashMediaResponseSchema",notes:["CMS report failure returns reported=false and does not roll back the image replacement."]},{method:"POST",path:"/sites/:site_id/sitemap",tag:"sitemaps",summary:"Confirm the currently reviewed Sitemap Draft and advance the site to structure_saved.",status:"implemented",request_body_schema:"ConfirmSiteStructureRequestSchema",response_schema:"PersistSiteSitemapDraftResponseSchema"},{method:"POST",path:"/internal/sites/:site_id/sitemap-draft",tag:"sitemaps",summary:"Persist an agent-generated sitemap draft without confirming the structure.",status:"implemented",request_body_schema:"PersistGeneratedSitemapDraftRequestSchema",response_schema:"PersistGeneratedSitemapDraftResponseSchema"},{method:"PUT",path:"/sites/:site_id/sitemap/draft",tag:"sitemaps",summary:"Save an immutable user draft without confirming or advancing the workflow.",status:"implemented",request_body_schema:"SaveSiteSitemapDraftRequestSchema",response_schema:"SaveSiteSitemapDraftResponseSchema"},{method:"GET",path:"/sites/:site_id/sitemap",tag:"sitemaps",summary:"Read the current Sitemap Draft for a site.",status:"implemented",response_schema:"SitemapDraftRecordSchema"},{method:"POST",path:"/sites/:site_id/clarify/answers",tag:"clarify",summary:"Persist the Step 2 clarify answers (and the answered questions) into the site's clarify session.",status:"implemented",request_body_schema:"PersistClarifyAnswersRequestSchema",response_schema:"PersistClarifyAnswersResponseSchema"},{method:"PATCH",path:"/sites/:site_id/clarify/archetype",tag:"clarify",summary:"Switch the Step 2 industry archetype (user_picked) into the site's clarify session via an idempotent upsert.",status:"implemented",request_body_schema:"UpdateClarifyArchetypeRequestSchema",response_schema:"PersistClarifyAnswersResponseSchema",notes:["Independent of generate: materializes a clarify_sessions row when none exists (using the supplied questions) or updates only selected_archetype; never writes answers/completed_at. Forces source=user_picked."]},{method:"POST",path:"/internal/sites/:site_id/design-plan",tag:"design-plans",summary:"Persist a generated design plan version for a site (internal agent-only write).",status:"implemented",request_body_schema:"PersistSiteDesignPlanRequestSchema",response_schema:"PersistSiteDesignPlanResponseSchema",notes:["Guarded by the internal agent token; only the Workspace/Sitemap agent writes design plans."]},{method:"GET",path:"/internal/sites/:site_id/design-plan",tag:"design-plans",summary:"Read the current (latest version) design plan for a site (internal agent-only read).",status:"implemented",response_schema:"DesignPlanRecordSchema",notes:["Guarded by the internal agent token; only the Workspace/Sitemap agent reads design plans."]},{method:"GET",path:"/sites/:site_id/design-plan",tag:"design-plans",summary:"Read the current (latest version) design plan for a site so Workspace UI can inspect the generated design contract.",status:"implemented",response_schema:"DesignPlanRecordSchema"},{method:"GET",path:"/sites/:site_id/brief",tag:"briefs",summary:"Read the persisted Step 1 brief for a site so the Workspace Agent can seed first full-site generation without a new write surface.",status:"implemented",response_schema:"BriefRecordSchema"},{method:"PUT",path:"/sites/:site_id/brief/draft",tag:"briefs",summary:"Save a draft site's Step 1 brief without advancing the workflow.",status:"implemented",request_body_schema:"SaveBriefDraftRequestSchema",response_schema:"SaveBriefDraftResponseSchema",notes:["Only sites in the editable build phase are writable; the brief row is upserted idempotently while site status, locale, and workflow stage remain unchanged."]},{method:"PATCH",path:"/sites/:site_id/brief",tag:"briefs",summary:"Create or update a draft site's Step 1 brief and advance it to Clarify without allowing later workflow states to roll back.",status:"implemented",request_body_schema:"UpdateBriefRequestSchema",response_schema:"UpdateBriefResponseSchema",notes:["Only sites in the editable build phase are writable; missing brief rows are created on first save; identical retries are idempotent."]},{method:"POST",path:"/internal/sites/:cms_site_id/external-sync",tag:"sites",summary:"Synchronize trusted CMS identity by tenant_id + cms_site_id; legacy site_url is optional and ignored. The response URL is the configured public API base or null.",status:"implemented",request_body_schema:"ExternalSyncSiteRequestSchema",response_schema:"ExternalSyncSiteResponseSchema",notes:["This trusted external entry does not require browser login or internal bearer auth; tenant_id is written directly to tenants.id and the response uses the internal { code, data, message } success envelope."]},{method:"POST",path:"/internal/sites/:site_id/page-templates",tag:"page-templates",summary:"Accept 1\u20133 Page Template items as one asynchronous Workspace task (HTTP 202).",status:"implemented",request_body_schema:"PageTemplateCreateRequestSchema",response_schema:"PageTemplateCreateResponseSchema",notes:["Internal bearer plus tenant context; API starts one new background thread/run with its fixed system identity. Poll GET /internal/external-site-edits/:task_id; no external IDs or callbacks. Manifest-gated whole-batch success commits exactly one snapshot."]},{method:"POST",path:"/internal/sites/:site_id/page-templates/promote",tag:"page-templates",summary:"Promote a private page template through the authenticated VCP internal service surface.",status:"implemented",request_body_schema:"PageTemplatePromoteRequestSchema",response_schema:"PageTemplatePromoteResponseSchema",notes:["Internal service endpoint; uses the same bearer + tenant/user context as create and delegates to Agent with API-owned credentials."]},{method:"POST",path:"/internal/sites/:site_id/page-templates/cleanup",tag:"page-templates",summary:"Clean up private page templates through the authenticated VCP internal service surface.",status:"implemented",request_body_schema:"PageTemplateCleanupRequestSchema",response_schema:"PageTemplateCleanupResponseSchema",notes:["Internal service endpoint; cleanup remains explicit and default-template protection is enforced by the Agent lifecycle service."]},{method:"POST",path:"/sites/:site_id/snapshots",tag:"snapshots",summary:"Persist snapshot metadata without changing the current site snapshot.",status:"implemented",request_body_schema:"PersistSiteSnapshotRequestSchema",response_schema:"PersistSiteSnapshotResponseSchema"},{method:"POST",path:"/sites/:site_id/snapshots/:snapshot_id/promote",tag:"snapshots",summary:"Promote a site snapshot as the current workspace version.",status:"implemented",request_body_schema:"PromoteSiteSnapshotRequestSchema",response_schema:"PromoteSiteSnapshotResponseSchema"},{method:"POST",path:"/internal/sites/:site_id/template-upgrade/lock/try-acquire",tag:"snapshots",summary:"Try to acquire the short-lived template-upgrade site lock.",status:"implemented",request_body_schema:"TryAcquireTemplateUpgradeLockRequestSchema",response_schema:"TryAcquireTemplateUpgradeLockResponseSchema",notes:["Internal agent-only endpoint; lock contention returns acquired=false instead of a user-facing conflict."]},{method:"POST",path:"/internal/sites/:site_id/template-upgrade/lock/release",tag:"snapshots",summary:"Release the calling template-upgrade attempt's site lock.",status:"implemented",request_body_schema:"ReleaseTemplateUpgradeLockRequestSchema",response_schema:"ReleaseTemplateUpgradeLockResponseSchema",notes:["Internal agent-only endpoint; release is scoped by tenant, site, operation type, and owner."]},{method:"POST",path:"/internal/sites/:site_id/template-upgrade/snapshots/:snapshot_id/promote",tag:"snapshots",summary:"CAS-promote a validated template-upgrade candidate and bind its accepted commit atomically.",status:"implemented",request_body_schema:"PromoteTemplateUpgradeSnapshotRequestSchema",response_schema:"PromoteTemplateUpgradeSnapshotResponseSchema",notes:["Internal agent-only endpoint; accepted_commit is never part of the public promote request or response."]},{method:"GET",path:"/internal/sites/:site_id/template-upgrade/state",tag:"snapshots",summary:"Inspect the projected tenant-scoped template-upgrade state without mutation.",status:"implemented",query_schema:"InspectTemplateUpgradeStateRequestSchema",response_schema:"InspectTemplateUpgradeStateResponseSchema",notes:["Internal agent-only endpoint; tenant identity is derived from trusted request context and the repository path is read-only."]},{method:"POST",path:"/internal/sites/:site_id/template-upgrade/state/prepare",tag:"snapshots",summary:"Prepare the tenant-scoped template-upgrade retry state for a target version.",status:"implemented",request_body_schema:"PrepareTemplateUpgradeStateRequestSchema",response_schema:"PrepareTemplateUpgradeStateResponseSchema",notes:["Internal agent-only endpoint; tenant identity is derived from trusted request context and is never accepted in the request body."]},{method:"POST",path:"/internal/sites/:site_id/template-upgrade/state/failure",tag:"snapshots",summary:"Record a finite validation failure for the prepared template-upgrade target.",status:"implemented",request_body_schema:"RecordTemplateUpgradeFailureRequestSchema",response_schema:"RecordTemplateUpgradeFailureResponseSchema",notes:["Internal agent-only endpoint; accepts a finite error code and never raw validation output."]},{method:"POST",path:"/internal/sites/:site_id/template-upgrade/state/success",tag:"snapshots",summary:"Reset retry state after the prepared template-upgrade target succeeds.",status:"implemented",request_body_schema:"RecordTemplateUpgradeSuccessRequestSchema",response_schema:"RecordTemplateUpgradeSuccessResponseSchema",notes:["Internal agent-only endpoint; tenant identity is derived from trusted request context and is never accepted in the request body."]},{method:"POST",path:"/internal/sites/:site_id/template-upgrade/events",tag:"snapshots",summary:"Record one bounded template-upgrade observability event.",status:"implemented",request_body_schema:"RecordTemplateUpgradeEventRequestSchema",response_schema:"RecordTemplateUpgradeEventResponseSchema",notes:["Internal agent-only endpoint; tenant identity is derived from trusted request context and the strict request excludes raw errors, source content, and file paths."]},{method:"GET",path:"/internal/template-upgrades/report",tag:"snapshots",summary:"Read tenant-scoped template-upgrade outcome, state, and duration aggregates.",status:"implemented",query_schema:"GetTemplateUpgradeReportQuerySchema",response_schema:"GetTemplateUpgradeReportResponseSchema",notes:["Internal endpoint; tenant identity is derived from trusted request context and all aggregates are tenant-scoped."]},{method:"GET",path:"/internal/template-upgrades/snapshot-deletions/pending",tag:"snapshots",summary:"List tenant-scoped stale template-upgrade snapshot deletions for dry-run or reconciliation.",status:"implemented",query_schema:"ListTemplateUpgradeSnapshotDeletionCandidatesQuerySchema",response_schema:"ListTemplateUpgradeSnapshotDeletionCandidatesResponseSchema",notes:["Defaults to retrying deleting tombstones. Including candidate snapshots is an explicit maintenance action and should use a conservative age threshold."]},{method:"POST",path:"/sites/:site_id/snapshots/:snapshot_id/abandon",tag:"snapshots",summary:"Mark an unpromoted candidate snapshot as failed.",status:"implemented",response_schema:"AbandonSiteSnapshotResponseSchema"},{method:"GET",path:"/sites/:site_id/snapshots/:snapshot_id",tag:"snapshots",summary:"Read one tenant-scoped snapshot metadata record for a site.",status:"implemented",response_schema:"SnapshotRecordSchema"},{method:"DELETE",path:"/sites/:site_id/snapshots/:snapshot_id",tag:"snapshots",summary:"Prepare two-phase deletion of a candidate snapshot and return its object key; refuses non-candidate/current/referenced snapshots.",status:"implemented",response_schema:"DeleteSiteSnapshotResponseSchema",notes:["Internal Agent authentication is required. This endpoint only creates a deleting tombstone; object removal and completion are separate steps."]},{method:"POST",path:"/sites/:site_id/snapshots/:snapshot_id/deletion/complete",tag:"snapshots",summary:"Complete deletion after the snapshot object has been removed; only accepts deleting snapshots.",status:"implemented",response_schema:"CompleteSiteSnapshotDeletionResponseSchema",notes:["Internal Agent authentication is required; callers must remove the object before completing the DB deletion."]},{method:"POST",path:"/agent-runs",tag:"agent-runs",summary:"Create an agent run for event persistence and replay.",status:"implemented",request_body_schema:"CreateAgentRunRequestSchema",response_schema:"CreateAgentRunResponseSchema"},{method:"POST",path:"/agent-runs/:run_id/events",tag:"agent-runs",summary:"Append one normalized AgentEvent to a run.",status:"implemented",request_body_schema:"AppendAgentEventRequestSchema",response_schema:"AppendAgentEventResponseSchema",notes:["Internal-only write surface: only internal-service callers may append, except browser (oidc) contexts may append run.failed (the WS connect-stage unlock path, equivalent to POST /agent-runs/workspace/cancel). All other oidc appends \u2014 run.finished, run.started, tool/system/progress, file/snapshot \u2014 are rejected with 403 FORBIDDEN. The browser sends user messages over the Workspace WebSocket (recorded server-side as user.message) and otherwise only reads the GET replay."]},{method:"GET",path:"/agent-runs/:run_id/events",tag:"agent-runs",summary:"Replay AgentEvents after a run-local sequence cursor.",status:"implemented",response_schema:"ListAgentEventsResponseSchema"},{method:"POST",path:"/agent-runs/workspace/stop",tag:"agent-runs",summary:"Request a soft stop of the active first-generation or fill-in run for a site.",status:"implemented",request_body_schema:"StopWorkspaceGenerationRequestSchema",response_schema:"StopWorkspaceGenerationResponseSchema",notes:["Browser surface with the same tenant scoping as POST /agent-runs/workspace/cancel: only the active initial_generation / fill_in run of a site in the caller's tenant is touched.","A run holding a live lease gets stop_requested_at instead of a terminal event, so it keeps the pages it already saved and closes itself: status=requested, or already_requested on a repeat (the first stop timestamp is never moved).","A run whose lease has lapsed has no process left to honour the flag, so it is closed immediately (run.failed, site lock released) and the answer is status=stopped. Nothing in flight returns no_active_run with run_id null."]},{method:"POST",path:"/internal/agent-runs/fail-stale-in-flight",tag:"agent-runs",summary:"Fail stale in-flight workspace runs (internal maintenance, cross-tenant sweep).",status:"implemented",response_schema:"FailStaleInFlightWorkspaceRunsResponseSchema",notes:["Internal maintenance endpoint guarded by InternalAgentAuthGuard (Bearer VCP_AGENT_INTERNAL_TOKEN, production fail-closed); the /internal/** prefix is exempt from browser auth middleware so the guard is the sole trust boundary. Not exposed to the browser via agent-proxy; called by an external admin cron / controlled ops script."]},{method:"POST",path:"/internal/agent-runs/claim-stale-workspace-runs",tag:"agent-runs",summary:"Claim stale workspace runs for resumption (internal maintenance, cross-tenant sweep).",status:"implemented",response_schema:"ClaimStaleWorkspaceRunsResponseSchema",notes:["Internal maintenance endpoint guarded by InternalAgentAuthGuard; same trust boundary as fail-stale-in-flight and not exposed to the browser.","Re-issues a fresh lease_owner (fencing token) and increments resume_count in one UPDATE for each resumable initial run; a lease expiring only means the work was interrupted, not that the run failed. Initial runs that used up WORKSPACE_MAX_RESUME_COUNT and interrupted fill-in runs are failed instead and are absent from the response."]},{method:"GET",path:"/internal/agent-runs/:run_id/context",tag:"agent-runs",summary:"Resolve run thread context (internal, Agent Runtime).",status:"implemented",response_schema:"AgentRunContextResponseSchema",notes:["Internal endpoint guarded by InternalAgentAuthGuard; tenant comes from x-vcp-tenant-id.","Returns the run together with its thread (null = the site main thread); a run outside the tenant is 404."]},{method:"POST",path:"/internal/agent-runs/:run_id/heartbeat",tag:"agent-runs",summary:"Renew a workspace run lease (internal, Agent Runtime).",status:"implemented",request_body_schema:"WorkspaceRunHeartbeatRequestSchema",response_schema:"WorkspaceRunHeartbeatResponseSchema",notes:["Internal endpoint guarded by InternalAgentAuthGuard; tenant comes from x-vcp-tenant-id.","One CAS UPDATE checks that the run is still in flight and that lease_owner has not been re-issued: superseded means another attempt took over and this process must stop dispatching; not_active means the run already reached a terminal state."]},{method:"POST",path:"/internal/agent-runs/:run_id/page-checkpoints",tag:"agent-runs",summary:"Register a workspace page checkpoint (internal, Agent Runtime).",status:"implemented",request_body_schema:"RegisterWorkspacePageCheckpointRequestSchema",response_schema:"WorkspacePageCheckpointSchema",notes:["Internal endpoint guarded by InternalAgentAuthGuard; tenant comes from x-vcp-tenant-id.","Idempotent on (tenant_id, run_id, page_id, attempt): a conflict returns the existing row unchanged. The object must already be written to storage \u2014 a failed registration means the page was not saved. A lease_owner that no longer matches the run is 409, and a run in a terminal state is 409."]},{method:"GET",path:"/internal/agent-runs/:run_id/page-checkpoints",tag:"agent-runs",summary:"List workspace page checkpoints (internal, Agent Runtime).",status:"implemented",response_schema:"ListWorkspacePageCheckpointsResponseSchema",notes:["Internal endpoint guarded by InternalAgentAuthGuard; returns one row per page_id (the highest attempt). A run outside the tenant returns no checkpoints."]},{method:"GET",path:"/internal/agent-runs/:run_id/run-control",tag:"agent-runs",summary:"Read workspace run control input (internal, Agent Runtime).",status:"implemented",response_schema:"WorkspaceRunControlInputResponseSchema",notes:["Internal endpoint guarded by InternalAgentAuthGuard; AgentRunRecord carries no input, so the lease owner, stop flag, resume count and fill-in inputs stored on the run row are read here. A run outside the tenant, or one that is not a workspace run, is 404."]},{method:"GET",path:"/deployments",tag:"deployments",summary:"Deployment resource summary endpoint until publish APIs land.",status:"skeleton"},{method:"GET",path:"/sites/:site_id/generation-ledger",tag:"sites",summary:"Read the stored generation ledger of a site (omitted deliverables and fill-in progress).",status:"implemented",response_schema:"SiteGenerationLedgerResponseSchema",notes:["One ledger per (tenant_id, site_id), written when an initial_generation / fill_in run.finished carries generation_ledger. A site that has never finished such a run returns ledger null with source_run_id and updated_at null."]},{method:"POST",path:"/sites/:site_id/generation/fill-in",tag:"sites",summary:"Start a fill-in run for deliverables the generation ledger still lists as omitted.",status:"implemented",request_body_schema:"StartFillInRequestSchema",response_schema:"StartFillInResponseSchema",notes:["Every target must still be listed as an unfilled omission in the site ledger; otherwise 400 FILL_IN_TARGET_NOT_OMITTED with details.target_id. A site with no ledger at all is rejected with the same code.","The site must be workspace_ready; otherwise 409 FILL_IN_NOT_AVAILABLE.","A fill-in run does not take the per-site workspace_run operation lock: while it runs the user keeps browsing. client_run_key makes the POST idempotent \u2014 repeating it returns the existing in-flight run and does not dispatch it again; another in-flight workspace run on the same site is rejected with 409 WORKSPACE_RUN_IN_FLIGHT."]},{method:"POST",path:"/sites/:site_id/workspace/runs",tag:"workspace",summary:"Start an asynchronous Workspace Agent run from the current snapshot.",status:"implemented",request_body_schema:"StartWorkspaceRunRequestSchema",response_schema:"StartWorkspaceRunResponseSchema",notes:["Long-running work must be event-driven and must not block API transactions."]},{method:"POST",path:"/sites/:site_id/workspace/attachments",tag:"workspace",summary:"Upload a chat image attachment for the Workspace conversation.",status:"implemented",response_schema:"WorkspaceAttachmentSchema",notes:["multipart/form-data with a single `file`; the response `image_url` is referenced by a `file` part of the next client message."]},{method:"POST",path:"/sites/:site_id/workspace/attachments/from-url",tag:"workspace",summary:"Capture a screenshot of a web page and store it as a chat image attachment.",status:"implemented",request_body_schema:"WorkspaceAttachmentFromUrlRequestSchema",response_schema:"WorkspaceAttachmentSchema",notes:["The screenshot becomes an ordinary attachment: same quotas, same `file` part reference, never placed on the site.","Capture runs through the ingestion service (SSRF guard, concurrency gate, Firecrawl credits)."]},{method:"GET",path:"/sites/:site_id/workspace/attachments/:attachment_id/image",tag:"workspace",summary:"Read the bytes of a chat image attachment (owner thumbnails and replay).",status:"implemented"},{method:"DELETE",path:"/sites/:site_id/workspace/attachments/:attachment_id",tag:"workspace",summary:"Delete an unsent chat image attachment.",status:"implemented",notes:["Attachments already sent with a message return 409 WORKSPACE_ATTACHMENT_BOUND."]},{method:"GET",path:"/internal/workspace-attachments/:site_id/:attachment_id",tag:"workspace",summary:"Internal side-channel for the Workspace Agent to read a chat image attachment.",status:"implemented"},{method:"GET",path:"/sites/:site_id/threads",tag:"workspace",summary:"List a site's named Agent threads (workspace conversations).",status:"implemented",response_schema:"SiteThreadListResponseSchema",notes:["The browser can only list threads that belong to the current site."]},{method:"POST",path:"/sites/:site_id/threads",tag:"workspace",summary:"Create a new named Agent thread for a site.",status:"implemented",request_body_schema:"CreateSiteThreadRequestSchema",response_schema:"SiteThreadResponseSchema",notes:["The created thread is scoped to the current site; the browser cannot create a thread for another site."]},{method:"PATCH",path:"/sites/:site_id/threads/:thread_id",tag:"workspace",summary:"Rename or archive an Agent thread.",status:"implemented",request_body_schema:"UpdateSiteThreadRequestSchema",response_schema:"SiteThreadResponseSchema",notes:["The server verifies the thread belongs to the current site and tenant before applying the update."]},{method:"GET",path:"/sites/:site_id/workspace/runs/active",tag:"workspace",summary:"Look up the site's current in-flight Workspace Agent run across all threads.",status:"implemented",response_schema:"ActiveWorkspaceRunResponseSchema",notes:["Scoped to the current site regardless of thread; the browser cannot query another site's active run."]},{method:"POST",path:"/v1/agent/workspace/:site_id/form-design-operations",tag:"agent/workspace",summary:"Create or replay a deterministic FORM_SPEC save operation.",status:"implemented",request_body_schema:"FormDesignSaveRequestSchema",response_schema:"FormDesignOperationResponseSchema"},{method:"GET",path:"/v1/agent/workspace/:site_id/form-design-operations/:operation_id",tag:"agent/workspace",summary:"Read a persisted FORM_SPEC save operation.",status:"implemented",response_schema:"FormDesignOperationResponseSchema"},{method:"POST",path:"/v1/agent/workspace/:site_id/form-design-operations/:operation_id/resume",tag:"agent/workspace",summary:"Resume a recoverable FORM_SPEC save with its original fingerprint.",status:"implemented",request_body_schema:"FormDesignResumeRequestSchema",response_schema:"FormDesignOperationResponseSchema"},{method:"GET",path:"/sites/:site_id/workspace/runs/latest",tag:"workspace",summary:"Look up the latest workspace Agent run for a site so Step 4 re-entry can replay persisted events without re-triggering the model.",status:"implemented",response_schema:"LatestWorkspaceRunResponseSchema"},{method:"POST",path:"/internal/sites/:site_id/preview-sessions",tag:"sandbox-sessions",summary:"Persist or update an Agent-owned on-demand preview session; optional current/ready-session guards support current-snapshot CAS and guarded in-place snapshot advance.",status:"implemented",request_body_schema:"PersistPreviewSessionRequestSchema",response_schema:"PersistPreviewSessionResponseSchema"},{method:"GET",path:"/sites/:site_id/preview-sessions/current",tag:"sandbox-sessions",summary:"Read the latest tenant-scoped preview session for a site.",status:"implemented",response_schema:"SandboxSessionSchema"},{method:"POST",path:"/sites/:site_id/preview/activate",tag:"site-preview",summary:"Activate the existing preview sandbox for a site.",status:"implemented",response_schema:"SitePreviewActivateResponseSchema"},{method:"POST",path:"/v1/agent/site-preview/:site_id/activate",tag:"agent/site-preview",summary:"Activate the existing preview sandbox for a site through Agent.",status:"implemented",response_schema:"SitePreviewActivateResponseSchema"},{method:"POST",path:"/sites/:site_id/deployments",tag:"deployments",summary:"Queue an explicit user-confirmed publish from the latest current snapshot.",status:"implemented",request_body_schema:"CreateDeploymentRequestSchema",response_schema:"CreateDeploymentResponseSchema",notes:["The server resolves the latest current snapshot and validates site and snapshot existence, in-flight deployment state, and site operation lock before creating the deployment record and queue job.","The API returns after creating the deployment record and queue job; worker-service claims deployment_jobs for build and Cloudflare publish."]},{method:"POST",path:"/sites/:site_id/deployments/quality-check",tag:"deployments",summary:"Queue a quality-check deployment from a snapshot.",status:"implemented",request_body_schema:"CreateQualityCheckDeploymentRequestSchema",response_schema:"CreateDeploymentResponseSchema"},{method:"GET",path:"/sites/:site_id/deployments/quality-check/status",tag:"deployments",summary:"Read the latest quality-check deployment status.",status:"implemented",response_schema:"GetDeploymentsStatusResponseSchema"},{method:"POST",path:"/internal/site-deployments/quality-check",tag:"deployments",summary:"Queue a quality-check deployment for the current site through the internal Agent API.",status:"implemented",response_schema:"InternalCreateDeploymentResponseSchema",notes:["InternalAgentAuthGuard is required; request context is supplied by x-vcp-tenant-id, x-vcp-user-id, and x-vcp-site-id.","POST accepts no request body; VCP resolves the current snapshot. Quality-check and publish deployments are independent."]},{method:"GET",path:"/internal/site-deployments/quality-check/status",tag:"deployments",summary:"Read the latest internal quality-check deployment status for the current site.",status:"implemented",response_schema:"InternalGetDeploymentsStatusResponseSchema",notes:["InternalAgentAuthGuard is required; request context is supplied by x-vcp-tenant-id, x-vcp-user-id, and x-vcp-site-id."]},{method:"POST",path:"/internal/site-deployments/publish",tag:"deployments",summary:"Queue a publish deployment for the current site through the internal Agent API.",status:"implemented",response_schema:"InternalCreateDeploymentResponseSchema",notes:["InternalAgentAuthGuard is required; request context is supplied by x-vcp-tenant-id, x-vcp-user-id, and x-vcp-site-id.","POST accepts no request body; VCP resolves the latest current snapshot. Quality-check and publish deployments are independent."]},{method:"GET",path:"/internal/site-deployments/publish/status",tag:"deployments",summary:"Read the latest internal publish deployment status for the current site.",status:"implemented",response_schema:"InternalGetDeploymentsStatusResponseSchema",notes:["InternalAgentAuthGuard is required; request context is supplied by x-vcp-tenant-id, x-vcp-user-id, and x-vcp-site-id."]},{method:"GET",path:"/sites/:site_id/deployments/current",tag:"deployments",summary:"Read the latest deployment for workspace refresh recovery.",status:"implemented",response_schema:"CurrentDeploymentResponseSchema"},{method:"GET",path:"/sites/:site_id/deployments/status",tag:"deployments",summary:"Read current in-flight deployment and latest released deployment.",status:"implemented",response_schema:"GetDeploymentsStatusResponseSchema"},{method:"GET",path:"/sites/:site_id/deployments/:deployment_id",tag:"deployments",summary:"Read one tenant-scoped deployment for status polling.",status:"implemented",response_schema:"GetDeploymentResponseSchema"},{method:"GET",path:"/sites/:site_id/cms/collections",tag:"cms",summary:"List CMS collections for a site.",status:"planned"},{method:"POST",path:"/sites/:site_id/cms/collections",tag:"cms",summary:"Create a CMS collection bound to generated content.",status:"planned"},{method:"GET",path:"/sites/:site_id/cms/collections/:collection_id/entries",tag:"cms",summary:"List CMS entries for a collection.",status:"planned"},{method:"POST",path:"/sites/:site_id/cms/collections/:collection_id/entries",tag:"cms",summary:"Create a CMS entry.",status:"planned"},{method:"PATCH",path:"/sites/:site_id/cms/collections/:collection_id/entries/:entry_id",tag:"cms",summary:"Update a CMS entry.",status:"planned"},{method:"POST",path:"/sites/:site_id/snapshots/:snapshot_id/version-record",tag:"versions",summary:"Record the sandbox accepted git commit for a promoted snapshot version.",status:"implemented",request_body_schema:"RecordSnapshotVersionRequestSchema",response_schema:"RecordSnapshotVersionResponseSchema"},{method:"GET",path:"/sites/:site_id/versions",tag:"versions",summary:"List snapshot-backed site versions.",status:"implemented",response_schema:"ListSiteVersionsResponseSchema"},{method:"POST",path:"/sites/:site_id/versions/:snapshot_id/restore",tag:"versions",summary:"Restore a site to an earlier snapshot version.",status:"implemented",response_schema:"RestoreSiteSnapshotResponseSchema"},{method:"GET",path:"/sites/:site_id/domains/configuration",tag:"custom-domains",summary:"Read the authoritative site domain configuration.",status:"implemented",response_schema:"GetSiteDomainConfigurationResponseSchema"},{method:"GET",path:"/internal/sites/:site_id/active-domain",tag:"internal/active-domain",summary:"Read whether an internal site has an active primary domain.",status:"implemented",response_schema:"GetActiveSiteDomainResponseSchema"},{method:"POST",path:"/sites/:site_id/publish-workflows/:workflow_id/domain/check",tag:"publish-workflow",summary:"Check a publish workflow domain and start its operation.",status:"implemented",request_body_schema:"CheckSitePublishDomainRequestSchema",response_schema:"CheckSitePublishDomainResponseSchema"},{method:"GET",path:"/sites/:site_id/publish-workflows/:workflow_id/domain/operation",tag:"publish-workflow",summary:"Read the current publish workflow domain operation.",status:"implemented",response_schema:"GetSitePublishDomainOperationResponseSchema"},{method:"POST",path:"/sites/:site_id/publish-workflows/:workflow_id/domain/operation/reconcile",tag:"publish-workflow",summary:"Recover or reconcile the current publish workflow domain operation.",status:"implemented",response_schema:"ReconcileSitePublishDomainOperationResponseSchema"},{method:"POST",path:"/sites/:site_id/publish-workflows/:workflow_id/domain/remediation/confirm",tag:"publish-workflow",summary:"Confirm the current DNS remediation plan.",status:"implemented",request_body_schema:"ConfirmSitePublishDomainRemediationRequestSchema",response_schema:"ConfirmSitePublishDomainRemediationResponseSchema"},{method:"POST",path:"/sites/:site_id/integrations/gsc/auth/start",tag:"gsc",summary:"Start Google Search Console authorization for a site.",status:"implemented",request_body_schema:"StartGscAuthRequestSchema",response_schema:"StartGscAuthResponseSchema"},{method:"GET",path:"/sites/:site_id/integrations/gsc/status",tag:"gsc",summary:"Read Google Search Console authorization and property status.",status:"implemented",response_schema:"GscStatusResponseSchema"},{method:"GET",path:"/admin/tenants",tag:"admin",summary:"Admin tenant listing.",status:"planned"},{method:"GET",path:"/usage/summary",tag:"usage",summary:"Summarize tenant usage and cost controls.",status:"planned"},{method:"GET",path:"/sites/:site_id/publish-workflow/active",tag:"publish-workflow",summary:"Read the active site publish workflow.",status:"implemented",response_schema:"SitePublishWorkflowActiveResponseSchema"},{method:"POST",path:"/sites/:site_id/publish-workflow/start",tag:"publish-workflow",summary:"Start or recover the site publish workflow.",status:"implemented",request_body_schema:"StartSitePublishWorkflowRequestSchema",response_schema:"SitePublishWorkflowQualityResponseSchema"},{method:"POST",path:"/sites/:site_id/publish-workflow/:workflow_id/repair-task",tag:"publish-workflow",summary:"Retired repair task entry: returns 409 WORKSPACE_REPAIR_REQUIRED; use the Workspace repair action.",status:"implemented",request_body_schema:"SitePublishWorkflowRevisionRequestSchema",response_schema:"ApiErrorEnvelopeSchema"},{method:"GET",path:"/sites/:site_id/publish-workflow/:workflow_id",tag:"publish-workflow",summary:"Read and reconcile a site publish workflow quality task.",status:"implemented",response_schema:"SitePublishWorkflowQualityResponseSchema"},{method:"PATCH",path:"/sites/:site_id/publish-workflow/:workflow_id/step",tag:"publish-workflow",summary:"Move the site publish workflow to an allowed step.",status:"implemented",request_body_schema:"UpdateSitePublishWorkflowStepRequestSchema",response_schema:"SitePublishWorkflowMutationResponseSchema"},{method:"POST",path:"/sites/:site_id/publish-workflow/:workflow_id/cancel",tag:"publish-workflow",summary:"Cancel a stable site publish workflow.",status:"implemented",request_body_schema:"SitePublishWorkflowRevisionRequestSchema",response_schema:"SitePublishWorkflowMutationResponseSchema"},{method:"POST",path:"/sites/:site_id/publish-workflow/:workflow_id/publish",tag:"publish-workflow",summary:"Start formal publishing for a site publish workflow.",status:"implemented",request_body_schema:"SitePublishWorkflowRevisionRequestSchema",response_schema:"SitePublishWorkflowPublishResponseSchema"}],Xq=[{method:"POST",path:"/v1/agent/clarify/:site_id",tag:"clarify",summary:"Stream Step 2 clarify questions as SSE; event_order includes optional skill.selecting, skill.selected, clarify.archetype_proposals, and run.failed on errors.",status:"implemented",request_body_schema:"ClarifyRunInputSchema without tenant_id/site_id",event_schema:"ClarifyStreamEventSchema",event_order:["run.started","skill.selecting","skill.selected","clarify.partial","clarify.archetype_proposals","clarify.finished","run.failed"]},{method:"POST",path:"/v1/agent/sitemap/:site_id",tag:"sitemap",summary:"Stream Step 3 sitemap generation as SSE; event_order includes sitemap.partial and run.failed on errors.",status:"implemented",request_body_schema:"Step5SitemapStartRequestSchema (browser marker only; API injects committed Step5 strategy)",event_schema:"SitemapStreamEventSchema",event_order:["run.started","sitemap.generating","sitemap.partial","sitemap.generated","sitemap.clamped","run.failed"]}],HT=t.object({id:t.string().min(1),role:t.enum(["system","user","assistant"]),metadata:t.unknown().optional(),parts:t.array(Ri).min(1)}),ud=HT.extend({role:t.literal("user")}).superRefine((e,n)=>{let s=0;for(let[i,o]of e.parts.entries()){if(o.type!=="file")continue;s+=1;let a=o;bo.safeParse(a.mediaType).success||n.addIssue({code:"custom",path:["parts",i,"mediaType"],message:"Attachment mediaType must be image/png, image/jpeg or image/webp"}),(typeof a.url!="string"||yo(a.url)===null)&&n.addIssue({code:"custom",path:["parts",i,"url"],message:"Attachment url must be a workspace attachment image path"})}s>fo&&n.addIssue({code:"custom",path:["parts"],message:`A message may carry at most ${fo} attachments`})}),Qq=t.object({base_snapshot_id:I.optional(),intent:t.literal("navigation_adaptation").optional(),message:ud.optional(),thread_id:it.optional(),client_run_key:t.string().min(1).max(200).optional()}).superRefine((e,n)=>{ms(e.message)&&n.addIssue({code:"custom",path:["message"],message:"Workspace startup message must not contain secrets",params:{errorCode:"WORKSPACE_MESSAGE_CONTAINS_SECRET"}})}),$T=t.object({path:t.string().regex(/^\/v1\/workspace\/sites\/[^/]+\/socket$/),run_id:$,base_snapshot_id:I,run_kind:ki}),Zq=t.object({agent_run:st,websocket:$T,next_step:t.literal("workspace_socket")}),Jq=t.object({agent_run:st}),e2=t.object({thread_id:it.optional()}),t2=t.object({agent_run:st.nullable(),thread:Ii.nullable()}),n2=t.object({status:qp.default("active")}),s2=t.object({threads:t.array(Ii)}),i2=t.object({title:t.string().trim().min(1).max(200)}).strict(),o2=t.object({title:t.string().trim().min(1).max(200).optional(),status:t.literal("archived").optional()}).strict().refine(e=>e.title!==void 0||e.status!==void 0,{message:"title or status is required"}),a2=t.object({thread:Ii}),r2=t.object({agent_type:t.enum(["clarify","sitemap","workspace"]),thread_id:it.optional()}),c2=t.object({agent_run:st}),m2=t.enum(["client.message.create","client.resource.operation.create","client.run.cancel","client.tool.approve","server.run.started","server.user.message","server.assistant.delta","server.tool.started","server.tool.completed","server.workspace.suggestions","workspace.plan.created","workspace.worker.updated","workspace.task.updated","server.patch.applied","server.sitemap.updated","server.snapshot.created","server.snapshot.finalized","server.preview.invalidated","preview.build.started","preview.build.succeeded","preview.build.failed","server.run.finished","server.run.failed","server.error","server.activity.started","server.activity.updated","server.activity.finished","server.activity.failed"]),pe=t.object({id:t.string().min(1),tenant_id:t.string().min(1),site_id:k,run_id:$.optional(),correlation_id:t.string().min(1).optional(),seq:t.number().int().positive().optional(),sent_at:t.string().min(1)}),VT=t.object({key:t.string().min(1),label:t.string().min(1),source_file:t.string().min(1).optional(),component_name:t.string().min(1).optional(),opening_element_range:t.object({start_line:t.number().int().positive(),start_column:t.number().int().nonnegative(),end_line:t.number().int().positive(),end_column:t.number().int().nonnegative()}).optional(),structural_path:t.string().min(1).optional(),text_preview:t.string().min(1).optional()}),YT=t.discriminatedUnion("type",[pe.extend({type:t.literal("client.message.create"),payload:t.object({client_message_id:t.string().min(1),in_reply_to_tool_call_id:t.string().min(1).optional(),current_route_id:qn.optional(),interaction_response:Ms.optional(),selected_component:VT.optional(),intent:t.literal("navigation_adaptation").optional(),display_text:t.string().min(1).max(4e3).optional(),message:ud,base_snapshot_id:I.optional()}).superRefine((e,n)=>{e.interaction_response&&!e.in_reply_to_tool_call_id&&n.addIssue({code:"custom",path:["in_reply_to_tool_call_id"],message:"in_reply_to_tool_call_id is required for an interaction response"})})}),pe.extend({type:t.literal("client.run.cancel"),payload:t.object({run_id:$,reason:t.string().min(1).optional()})}),pe.extend({type:t.literal("client.tool.approve"),payload:t.object({tool_call_id:t.string().min(1),decision:t.enum(["approve","reject"]),reason:t.string().min(1).optional()})}),Oc]),XT=t.discriminatedUnion("type",[pe.extend({type:t.literal("server.run.started"),payload:t.object({run_id:$,agent_type:t.literal("workspace")})}),pe.extend({type:t.literal("server.user.message"),payload:t.object({client_message_id:t.string().min(1),message_id:t.string().min(1),parts:t.array(Ri).min(1),display_text:t.string().min(1).max(4e3).optional(),in_reply_to_tool_call_id:t.string().min(1).optional(),interaction_response:Ms.optional()})}),pe.extend({type:t.literal("server.assistant.delta"),payload:t.object({message_id:t.string().min(1),parts:t.array(Ri).min(1),status:t.enum(["streaming","ready"])})}),pe.extend({type:t.literal("server.tool.started"),payload:t.object({tool_call_id:t.string().min(1),name:t.string().min(1),summary:t.string().min(1)})}),pe.extend({type:t.literal("server.tool.completed"),payload:t.object({tool_call_id:t.string().min(1),name:t.string().min(1),result_summary:t.string().min(1),interaction_request:So.optional(),interaction_failure:ho.optional()})}),pe.extend({type:t.literal("server.workspace.suggestions"),payload:rd.extend({run_id:$}).strict()}),pe.extend({type:t.literal("workspace.plan.created"),payload:t.object({plan_id:t.string().min(1),run_kind:ki,groups:t.array(Ya),tasks:t.array(Xa),dependencies:t.array(Qa),expected_outputs:t.array(De),diagnostics:Va,summary:md})}),pe.extend({type:t.literal("workspace.worker.updated"),payload:t.object({group_id:t.string().min(1),phase:Ha,status:Yt,task_counts:ld,target_paths:t.array(De),diagnostics:t.array(t.string().min(1))})}),pe.extend({type:t.literal("workspace.task.updated"),payload:t.object({task_id:t.string().min(1),group_id:t.string().min(1),status:Yt,target_path:De,read_files_count:t.number().int().nonnegative(),diagnostics:t.array(t.string().min(1)),diagnostic_details:t.array($a).optional()})}),pe.extend({type:t.literal("server.patch.applied"),payload:t.object({patch_batch_id:t.string().min(1),changed_files:t.array(t.string().min(1)),sitemap_resync_queued:t.boolean()})}),pe.extend({type:t.literal("server.sitemap.updated"),payload:t.object({sitemap_id:Ae,version:t.number().int().positive(),reason:t.string().min(1)})}),pe.extend({type:t.literal("server.snapshot.created"),payload:t.object({snapshot_id:I,manifest_hash:t.string().regex(/^sha256:[a-f0-9]{64}$/)})}),pe.extend({type:t.literal("server.snapshot.finalized"),payload:t.object({snapshot_id:I})}),pe.extend({type:t.literal("server.preview.invalidated"),payload:t.object({reason:t.string().min(1),next_preview_url:t.string().url().optional(),launch_id:t.string().min(1).optional()})}),pe.extend({type:t.literal("preview.build.started"),payload:t.object({snapshot_id:I})}),pe.extend({type:t.literal("preview.build.succeeded"),payload:t.object({snapshot_id:I})}),pe.extend({type:t.literal("preview.build.failed"),payload:t.object({snapshot_id:I,message:t.string().min(1),diagnostics:t.string().min(1),retryable:t.boolean()})}),pe.extend({type:t.literal("server.run.finished"),payload:t.object({run_id:$,snapshot_id:I,degraded_reason:Tn.optional(),build_verified:t.boolean().optional(),resource_operation:pd.optional()})}),pe.extend({type:t.literal("server.run.failed"),payload:t.object({run_id:$,error_code:t.string().min(1),message:t.string().min(1),retryable:t.boolean(),outcome:t.literal("retained_previous").optional(),details:t.record(t.string(),t.unknown()).optional()})}),pe.extend({type:t.literal("server.error"),payload:t.object({code:t.string().min(1),message:t.string().min(1),retryable:t.boolean()})}),pe.extend({type:t.literal("server.activity.started"),payload:t.object({activity_id:t.string().min(1),parent_activity_id:t.string().min(1).optional(),kind:zp,title:t.string().min(1).max(200),title_code:jt.optional(),detail:t.string().max(360).optional(),detail_code:jt.optional(),locks_input:t.boolean()})}),pe.extend({type:t.literal("server.activity.updated"),payload:t.object({activity_id:t.string().min(1),title:t.string().min(1).max(200).optional(),title_code:jt.optional(),detail:t.string().max(360).optional(),detail_code:jt.optional()})}),pe.extend({type:t.literal("server.activity.finished"),payload:t.object({activity_id:t.string().min(1)})}),pe.extend({type:t.literal("server.activity.failed"),payload:t.object({activity_id:t.string().min(1),detail:t.string().max(360).optional()})})]),QT=XT.superRefine((e,n)=>{if(e.type==="server.user.message"&&e.payload.interaction_response&&!e.payload.in_reply_to_tool_call_id&&n.addIssue({code:"custom",path:["payload","in_reply_to_tool_call_id"],message:"in_reply_to_tool_call_id is required for an interaction response"}),e.type!=="server.tool.completed")return;let s=e.payload.name==="prepare_product_search_entry",i=!!e.payload.interaction_request,o=!!e.payload.interaction_failure;(s?i!==o:!i&&!o)||n.addIssue({code:"custom",path:["payload","interaction_request"],message:s?"prepare_product_search_entry requires exactly one of interaction_request or interaction_failure":"product search interaction results are only valid for prepare_product_search_entry"})}),l2=t.union([YT,QT]),p2={path:"/v1/workspace/sites/:site_id/socket",protocol:"ws",status:"implemented",inbound_message_schema:"WorkspaceClientMessageSchema",outbound_message_schema:"WorkspaceServerMessageSchema",query_parameters:[{name:"run_id",required:!1,schema:"string",summary:"Workspace run id returned by the API run-start response."},{name:"run_kind",required:!1,schema:"WorkspaceRunKindSchema",summary:"Workspace run mode; initial_generation can auto-start when base_snapshot_id is present."},{name:"base_snapshot_id",required:!1,schema:"string",summary:"Authoritative base snapshot id for this workspace run."},{name:"unattended",required:!1,schema:'"1"',summary:"Unattended mode for machine-driven runs: interactive tools are withheld so the run cannot stall waiting for a human answer. Server-to-server only; the browser proxy strips it."}],ai_sdk_ui_compatible:!0,notes:["Assistant UI output is carried as AI SDK UIMessage parts, including text, data-*, and tool-* parts.","Operational AgentEvents remain persisted separately for replay and audit."]},_d=t.string().regex(/^sha256:[a-f0-9]{64}$/),ZT=t.enum(["create","update","delete","str_replace"]),gd=t.enum(["sitemap_resync","smoke_test","prepare_preview"]),JT=t.object({old_string:t.string().min(1).describe("Exact text to find in the current file. Must match the file uniquely; include enough surrounding context (usually 2-4 adjacent lines)."),new_string:t.string().describe("Replacement text. May be empty to delete the matched text."),replace_all:t.boolean().optional()}).strict(),ek=t.object({path:De,operation:ZT,expected_hash:_d.optional(),full_content:t.string().describe("Complete file content for create/update patches. Only this single field is a string value: every double quote inside the source code must be escaped so the field stays valid JSON. Avoid ASCII double quotes inside JSX attribute values and use corner quotes like \u300C\u751F\u65E5\u5FEB\u4E50\u300D for visitor-facing quoted examples. The surrounding patch object and the patches array are ordinary JSON structures, not strings.").optional(),edits:t.array(JT).min(1).max(20).optional()}).strict().superRefine((e,n)=>{let s=e.full_content!==void 0;if(e.operation==="delete"){s&&n.addIssue({code:"custom",path:["full_content"],message:"delete patches must not include full_content"}),e.edits!==void 0&&n.addIssue({code:"custom",path:["edits"],message:"edits is only allowed for str_replace patches"});return}if(dk(e.path)||n.addIssue({code:"custom",path:["path"],message:"Static App Router page paths must use lowercase ASCII kebab-case public segments."}),e.operation==="str_replace"){e.full_content!==void 0&&n.addIssue({code:"custom",path:["full_content"],message:"str_replace patches must not include full_content"}),(!e.edits||e.edits.length===0)&&n.addIssue({code:"custom",path:["edits"],message:"str_replace patches must include a non-empty edits array"});return}s||n.addIssue({code:"custom",path:["full_content"],message:"create/update patches must include full_content"}),e.edits!==void 0&&n.addIssue({code:"custom",path:["edits"],message:"edits is only allowed for str_replace patches"})}),tk=t.object({kind:t.enum(["block","page","site","chrome"]),id:t.string().min(1).max(120)}),nk=t.object({base_key:t.string().min(1).max(120).regex(/^[A-Za-z0-9._:-]+$/).refine(e=>!e.includes(".."),{message:"base_key must not contain '..'"}),owner:tk,count:t.number().int().min(1).max(12),query:t.string().min(1).max(400),role:t.enum(["hero","section","card","gallery","testimonial","decorative","site_background","nav_background","footer_background"]),orientation:t.enum(["landscape","portrait","square"]).optional(),altHint:t.string().min(1).max(300)}),hd=t.object({site_id:k,base_snapshot_id:I,reason:t.string().min(1),patches:t.array(ek).min(1).describe("A real JSON array of patch objects. Never JSON.stringify this array, and never put an encoded JSON array inside a string \u2014 emit the array itself. Only full_content within a patch object is a string field."),media_requests:t.array(nk).max(24).optional(),post_actions:t.array(gd).optional()});function Sd(e,n){let s=new Set;for(let[i,o]of e.patches.entries())s.has(o.path)&&n.addIssue({code:"custom",path:["patches",i,"path"],message:`Duplicate patch path: ${o.path}`}),s.add(o.path)}var d2=hd.superRefine(Sd),u2=hd.omit({base_snapshot_id:!0}).extend({site_id:k.optional()}).superRefine(Sd),sk=Re,ik=t.object({path:sk,operation:t.enum(["upsert","delete"]).optional()}),fd=t.enum(["sync_cms_pages","sync_cms_navigation"]),_2=t.object({files:t.array(ik).min(1),post_actions:t.array(fd).optional()}).strict().overwrite(e=>e.post_actions?{...e,post_actions:[...new Set(e.post_actions)]}:e),ok=t.enum(["BASE_SNAPSHOT_NOT_FOUND","PATCH_TARGET_NOT_FOUND","PATCH_TARGET_ALREADY_EXISTS","PATCH_EXPECTED_HASH_MISMATCH","PATCH_DIFF_UNSUPPORTED","PATCH_PROTECTED_FILE","PATCH_VALIDATION_FAILED","PATCH_MEDIA_REFERENCE_NOT_DECLARED","PATCH_BATCH_INVALID","PATCH_BATCH_FAILED","PATCH_BATCH_TOO_LARGE","STR_REPLACE_NOT_FOUND","STR_REPLACE_NOT_UNIQUE","STR_REPLACE_BINARY_FILE","STR_REPLACE_REQUIRES_READ","GLOBALS_CSS_EDIT_REJECTED"]),ak=t.object({status:t.literal("applied"),patch_batch_id:t.string().min(1),site_id:k,base_snapshot_id:I,snapshot_id:I,manifest_hash:_d,object_key:t.string().min(1),changed_files:t.array(De).min(1),post_actions_queued:t.array(gd),dropped_protected_files:t.array(t.string().min(1)).min(1).optional()}),rk=t.object({status:t.literal("failed"),code:ok,message:t.string().min(1),retryable:t.boolean().default(!1),details:t.unknown().optional()}),g2=t.discriminatedUnion("status",[ak,rk]),h2=t.object({ok:t.literal(!0),post_actions:t.array(t.object({action:fd,status:t.enum(["succeeded","failed"])}).strict()).default([])}),bd=Re,ck=t.enum(["text","binary"]),yd=t.object({path:bd,kind:ck,language:t.string().min(1).nullable(),size_bytes:t.number().int().nonnegative()}),S2=t.object({path:bd}),mk=yd.extend({kind:t.literal("text"),language:t.string().min(1),content:t.string()}),lk=yd.extend({kind:t.literal("binary"),language:t.null(),mime_type:t.string().min(1),content_base64:t.string().min(1)}),f2=t.union([mk,lk]);function ms(e){return typeof e=="string"?/authorization\s*:|bearer\s+|token\s*=|secret\s*=|api[_-]?key\s*=|access[_\s-]?key\s*=|\bsk-[a-z0-9_-]{20,}|eyJ[a-z0-9_-]{10,}\.[a-z0-9_-]{10,}\.[a-z0-9_-]{10,}/i.test(e):!e||typeof e!="object"?!1:Array.isArray(e)?e.some(n=>ms(n)):Object.entries(e).some(([n,s])=>pk(n)||ms(s))}function pk(e){let n=e.replace(/([a-z0-9])([A-Z])/g,"$1_$2").replace(/\s+/g,"_").toLowerCase();return/(^|[_-])(authorization|token|secret|api[_-]?key|apikey|access[_-]?key|accesskey)([_-]|$)/.test(n)}function xd(e){let n=e.split("/");return e.length>0&&!e.startsWith("/")&&!e.includes("\\")&&n.every(s=>s!==""&&s!=="."&&s!=="..")}function dk(e){if(/^(?:src\/)?app\/\.vcp\//.test(e))return us(e);let n=/^app\/(?:(.*)\/)?page\.(?:tsx|jsx)$/.exec(e);if(!n)return!0;let i=(n[1]??"").split("/").filter(a=>a.length>0);return i.some(a=>a.startsWith("_"))?!0:i.filter(a=>!a.startsWith("@")&&!/^\(.+\)$/.test(a)).map(a=>a.replace(/^\((?:\.|\.\.|\.\.\.)\)/,"")).filter(a=>a.length>0).every(a=>/^\[.*\]$/.test(a)||Ln.test(`/${a}`))}var Ed=t.enum(["idle","creating","restoring_snapshot","installing_dependencies","starting_preview","ready","active","stopping","stopped","failed"]),uk=t.object({id:ls,tenant_id:t.string().min(1),site_id:k,sandbox_id:t.string().min(1).nullable(),status:Ed,source_snapshot_id:I.nullable(),last_snapshot_id:I.nullable(),preview_url:t.string().url().nullable(),browser_preview_url:t.string().url().nullable().optional(),launch_id:t.string().min(1).nullable().optional(),last_activity_at:t.string().min(1).nullable(),created_at:t.string().min(1),updated_at:t.string().min(1)}),b2=t.object({session_id:ls.optional(),sandbox_id:t.string().min(1).optional(),source_snapshot_id:I.optional(),last_snapshot_id:I,expected_current_snapshot_id:I.optional(),expected_ready_session_id:ls.optional(),expected_ready_session_last_snapshot_id:I.optional(),status:Ed,preview_url:t.string().url().optional(),launch_id:t.string().min(1).optional()}),y2=t.object({preview_session:uk,next_step:t.literal("preview")}),x2=t.object({failed_count:t.number().int().nonnegative()}),E2=t.object({site_id:k}),R2=t.object({status:t.enum(["cancelled","stop_requested","no_active_run"]),agent_run:st.nullable()});export{Ym as AESTHETIC_NOTE_MAX_LENGTH,Aa as AI_IMAGE_GENERATION_MAX_QUANTITY,yy as APPLICATION_LIBRARY_ERROR_CODES,DG as AbandonSiteSnapshotResponseSchema,$E as ActiveSiteDomainDataSchema,t2 as ActiveWorkspaceRunResponseSchema,zp as ActivityKindSchema,jt as ActivityTitleCodeSchema,wP as AdvanceSiteWorkflowRequestSchema,Mp as AgentErrorCategorySchema,er as AgentEventIdSchema,Na as AgentEventRecordSchema,dd as AgentEventSchema,cd as AgentEventTypeSchema,CT as AgentMessageHistoryPurposeSchema,Gp as AgentModelRouteSchema,vT as AgentPlanStepSchema,TG as AgentRunContextResponseSchema,$ as AgentRunIdSchema,Fp as AgentRunKindSchema,st as AgentRunRecordSchema,RI as AgentRunStatusSchema,Up as AgentRunTypeSchema,it as AgentThreadIdSchema,II as AgentThreadKindSchema,TI as AgentThreadOriginSchema,Ii as AgentThreadRecordSchema,qp as AgentThreadStatusSchema,UT as AiSdkUiDataPartSchema,GT as AiSdkUiErrorPartSchema,jT as AiSdkUiFilePartSchema,Ri as AiSdkUiMessagePartSchema,HT as AiSdkUiMessageSchema,NT as AiSdkUiReasoningPartSchema,MT as AiSdkUiSourceDocumentPartSchema,LT as AiSdkUiSourceUrlPartSchema,qT as AiSdkUiStepStartPartSchema,OT as AiSdkUiTextPartSchema,FT as AiSdkUiToolPartSchema,$q as ApiContractStatusSchema,OI as ApiErrorEnvelopeSchema,M as ApiResponseSchema,Wq as AppendAgentEventRequestSchema,Bq as AppendAgentEventResponseSchema,Tj as ApplicationCreateResponseSchema,Ty as ApplicationLibraryApplicationSchema,kj as ApplicationLibraryApplicationsDataSchema,nl as ApplicationLibraryErrorCodeSchema,Pj as ApplicationLibraryErrorResponseSchema,Aj as ApplicationLibraryTemplatesDataSchema,il as ApplicationTemplateCatalogDataSchema,xy as ApplicationTemplateCatalogItemSchema,by as ApplicationTemplateConsumeDataSchema,Ij as ApplicationTemplateCreateRequestSchema,Ry as ApplicationTemplateCreateResponseSchema,Ey as ApplicationTemplateCreatedApplicationSchema,si as ApplicationTemplateDigestSchema,_y as ApplicationTemplateFieldSchema,fy as ApplicationTemplateReferenceSchema,Iy as ApplicationTemplateSourceSchema,ii as ApplicationTemplateStableKeySchema,ta as ApplicationTemplateV1Schema,ok as ApplyPatchBatchErrorCodeSchema,rk as ApplyPatchBatchFailureSchema,d2 as ApplyPatchBatchInputSchema,ek as ApplyPatchBatchPatchSchema,gd as ApplyPatchBatchPostActionSchema,g2 as ApplyPatchBatchResultSchema,ak as ApplyPatchBatchSuccessSchema,u2 as ApplyPatchBatchToolInputSchema,JT as ApplyPatchEditSchema,ZT as ApplyPatchOperationSchema,Lp as ArchetypeProposalSchema,Pk as AuditLogIdSchema,hk as AuthIdentityIdSchema,yk as AuthLoginCodeIdSchema,bk as AuthOidcStateIdSchema,yF as AuthProfileSchema,Sk as AuthSessionIdSchema,fk as AuthTokenIdSchema,xk as AuthWsTicketIdSchema,Ax as BINDING_STATUSES,Hp as BlockGenerationContextSchema,gs as BlockInteractionSchema,lq as BlockMediaIntentSchema,Wa as BlockSchema,ef as BlockingSubsiteSchema,$p as BrandingSchema,Xt as BriefIdSchema,Fa as BriefRecordSchema,gr as BusinessFactsSchema,zD as CHAT_COPY,KD as CLARIFICATION_COPY,Jy as CMS_FORM_FIELD_TYPES,Um as CMS_MAIN_PRODUCTS_MAX_LENGTH,n_ as CMS_PAGE_DIRECTORY_MAX_DEPTH,t_ as CMS_PAGE_DIRECTORY_MAX_NODES,e_ as CMS_PAGE_URL_MAX_LENGTH,Kr as CMS_PAGE_URL_PATH_MAX_LENGTH,mv as COMPONENT_I18N_FILE_SUFFIX,Ks as COMPONENT_I18N_NAMESPACE,Ud as CONVERSION_CTA_LABEL_MAX_LENGTH,Hx as CRAWLER_INTERNAL_ERROR_CODES,Om as CURRENT_EDIT_ENGINE_VERSION,E2 as CancelActiveWorkspaceRunRequestSchema,R2 as CancelActiveWorkspaceRunResponseSchema,qA as CheckDesignerPageProjectionRequestSchema,WA as CheckDesignerPageProjectionResponseSchema,g_ as CheckDesignerPageProjectionResultSchema,Jl as CheckSitePublishDomainDataSchema,FE as CheckSitePublishDomainRequestSchema,GE as CheckSitePublishDomainResponseSchema,Vp as ChromeDesignSchema,HI as ChromeFooterDesignSchema,zI as ChromeFooterShellSchema,BI as ChromeHeaderDesignSchema,WI as ChromeHeaderShellSchema,$I as ChromeMobileNavDesignSchema,JC as ClaimStaleWorkspaceRunsResponseSchema,xI as ClarifyQuestionOptionSchema,EI as ClarifyQuestionSchema,fI as ClarifyQuestionTypeSchema,Ma as ClarifyQuestionsSchema,XF as ClarifyRunInputSchema,Za as ClarifySessionIdSchema,IT as ClarifySessionRecordSchema,QF as ClarifyStreamEventSchema,jj as CmsApplicationCoreInputSchema,Lj as CmsApplicationCoreResultSchema,Mj as CmsApplicationSeedInputSchema,Uj as CmsApplicationSeedResultSchema,wk as CmsCollectionBindingIdSchema,UL as CmsCollectionBindingSchema,Sl as CmsFormSchemaProjectionSchema,Xi as CmsManagedPageTypeSchema,_F as CmsNavigationActionSchema,uF as CmsNavigationCapabilitiesResponseSchema,dI as CmsNavigationCapabilitiesSchema,Ap as CmsNavigationCreateGroupBodySchema,wp as CmsNavigationCreateItemBodySchema,pF as CmsNavigationDefaultGroupBodySchema,Pa as CmsNavigationDraftItemSchema,cI as CmsNavigationEditorContextSchema,lF as CmsNavigationEditorResponseSchema,rI as CmsNavigationGroupSchema,kp as CmsNavigationItemSchema,pI as CmsNavigationMoveItemBodySchema,mI as CmsNavigationPatchGroupBodySchema,lI as CmsNavigationPatchItemBodySchema,dF as CmsNavigationSaveItemsBodySchema,wa as CmsNavigationTargetTypeSchema,o_ as CmsPageDirectoryGroupSchema,Hr as CmsPageDirectoryNodeSchema,Wr as CmsPageDirectorySchema,Qi as CmsPageTypeSchema,Wt as CmsPageUrlPathSchema,$A as CmsSeoSyncStateSchema,Es as CmsSiteIdSchema,Bx as CompanyInfoSchema,tM as CompanyInfoTaskCreateRequestSchema,nM as CompanyInfoTaskCreateResponseSchema,sM as CompanyInfoTaskResponseSchema,ON as CompleteCustomerMaterialsRequestSchema,NN as CompleteDiagnosisRequestSchema,vP as CompleteQualityOnlyWorkflowRequestSchema,NG as CompleteSiteSnapshotDeletionResponseSchema,CP as CompleteSiteWorkflowRequestSchema,jN as CompleteStrategyRequestSchema,DN as CompleteWebsiteScanRequestSchema,pv as ComponentI18nResourcesSchema,o1 as ComposeDesignerPageResourceBodySchema,Lk as ComputeSnapshotEditChangesRequestSchema,Mk as ComputeSnapshotEditChangesResponseSchema,WE as ConfirmSitePublishDomainRemediationDataSchema,qE as ConfirmSitePublishDomainRemediationRequestSchema,BE as ConfirmSitePublishDomainRemediationResponseSchema,Cq as ConfirmSiteStructureRequestSchema,yj as ConnectDynamicCollectionInputSchema,Hj as ConnectFormInputSchema,Ut as ConversionHintsSchema,$x as CrawlerInternalErrorCodeSchema,iM as CrawlerInternalErrorSchema,gn as CrawlerTaskCodeSchema,HL as CrawlerTaskCreateRequestSchema,YL as CrawlerTaskCreateResponseSchema,jx as CrawlerTaskFailureErrorCodeSchema,Dl as CrawlerTaskFailureStageSchema,Mx as CrawlerTaskPageSchema,$L as CrawlerTaskPagesQuerySchema,ZL as CrawlerTaskPagesResponseSchema,QL as CrawlerTaskStatusResponseSchema,$t as CrawlerTaskUuidSchema,cq as CreateAgentRunConflictResponseSchema,kG as CreateAgentRunRequestSchema,AG as CreateAgentRunResponseSchema,JG as CreateDeploymentRequestSchema,wI as CreateDeploymentResponseSchema,y0 as CreateDocumentUploadRequestSchema,Nk as CreateExternalSiteEditRequestSchema,Uk as CreateExternalSiteEditResponseSchema,k0 as CreateImageUploadRequestSchema,g0 as CreateInputSourceRequestSchema,eq as CreateQualityCheckDeploymentRequestSchema,oG as CreateSiteBriefRequestSchema,xG as CreateSiteBriefResponseSchema,aG as CreateSiteDraftRequestSchema,iG as CreateSiteInputSchema,i2 as CreateSiteThreadRequestSchema,AP as CreateSiteWorkflowRequestSchema,Vd as CreateTextInputSourceRequestSchema,Yd as CreateUrlInputSourceRequestSchema,nq as CurrentDeploymentResponseSchema,kN as CustomerMaterialsDraftResponseSchema,zo as CustomerMaterialsDraftSchema,AN as CustomerMaterialsNullableResponseSchema,Ho as CustomerMaterialsRecordSchema,TN as CustomerMaterialsResponseSchema,Xb as CustomerMaterialsStatusSchema,rS as DEFAULT_FONTS,Wm as DEFAULT_SITE_DESIGN_RADIUS_ID,Tu as DEFAULT_SITE_LOCALE,nO as DEFAULT_SUBSITE_PALETTE,qs as DEFAULT_WEIGHT_STYLE_ID,Kw as DEPLOYMENT_ACTIVE_STATUSES,At as DEPLOYMENT_LIFECYCLE_TRANSITIONS,Sh as DEPLOYMENT_PROGRESS_STEP_CODES,DI as DEPLOYMENT_REALTIME_CHANNEL,Qt as DEPLOYMENT_STATUSES,zw as DEPLOYMENT_TERMINAL_STATUSES,tS as DEPLOYMENT_TRANSITION_ERROR_CODE,rq as DEPLOYMENT_WEBSOCKET_CONTRACT,WS as DESIGNER_BRIDGE_TELEMETRY_MAX_EVENTS,kA as DESIGNER_COMPONENT_LIBRARY_ERROR_CODES,e1 as DESIGNER_PAGE_LIBRARY_ERROR_CODES,h0 as DOCUMENT_EXTENSION_WHITELIST,S0 as DOCUMENT_MIME_WHITELIST,_E as DOMAIN_DNS_PURPOSES,SE as DOMAIN_DNS_REMEDIATION_STATUSES,gE as DOMAIN_DNS_VERIFICATION_STATUSES,lE as DOMAIN_OBSERVED_STATUSES,dE as DOMAIN_ROUTING_MODES,BA as DeleteDesignerPageErrorDetailsSchema,MA as DeleteDesignerPageRequestSchema,UA as DeleteDesignerPageResponseSchema,u_ as DeleteDesignerPageResultSchema,OG as DeleteSiteSnapshotResponseSchema,pt as DeploymentIdSchema,Ek as DeploymentJobIdSchema,fh as DeploymentProgressStepCodeSchema,yh as DeploymentProgressStepSchema,bh as DeploymentProgressStepStatusSchema,$c as DeploymentProgressStepsSchema,Nt as DeploymentRecordSchema,aq as DeploymentRedisPubSubEventSchema,Ga as DeploymentStatusSchema,Dp as DeploymentStatusSummarySchema,ko as DeploymentTransitionError,Bp as DeploymentTypeSchema,xi as DeploymentWsDeploymentPayloadSchema,oq as DeploymentWsServerMessageSchema,vI as DeploymentWsServerMessageTypeSchema,PT as DesignPlanGenerationOutcomeSchema,wT as DesignPlanGenerationReasonSchema,Ai as DesignPlanIdSchema,uq as DesignPlanPatchSchema,TT as DesignPlanRecordSchema,Xp as DesignPlanSchema,Ge as DesignTokenBlockError,mq as DesignTokensSchema,av as DesignerBridgeTelemetryBatchSchema,KS as DesignerBridgeTelemetryEventSchema,BS as DesignerBridgeTelemetryEventTypeSchema,Ju as DesignerComponentCatalogItemSchema,Ur as DesignerComponentCategoriesDataSchema,Mr as DesignerComponentCategoryNodeSchema,qt as DesignerComponentExactVersionSchema,Gr as DesignerComponentInstallDataSchema,Fr as DesignerComponentsDataSchema,y_ as DesignerPageCatalogItemSchema,ec as DesignerPageCategoriesDataSchema,Jr as DesignerPageCategoryNodeSchema,l_ as DesignerPageDeleteBlockReasonSchema,m_ as DesignerPageDisabledReasonSchema,jn as DesignerPageExactVersionSchema,Xr as DesignerPageGroupSchema,nc as DesignerPageInstallDataSchema,Yr as DesignerPageNodeSchema,ic as DesignerPageResourcePreparationDataSchema,b_ as DesignerPageResourceSourceSchema,A_ as DesignerPageResourceTemplateSchema,Bt as DesignerPageResourceTypeSchema,tc as DesignerPagesDataSchema,zi as DesignerResourceVersionSchema,oc as DesignerSitePagesDataSchema,n1 as DesignerSiteRouteIdSchema,Vl as DomainConfigurationSchema,Sa as DomainDnsPurposeSchema,RE as DomainDnsRecordSchema,EE as DomainDnsRemediationChangeSchema,zl as DomainDnsRemediationRecordSchema,Hl as DomainDnsRemediationResultSchema,fE as DomainDnsRemediationStatusSchema,xE as DomainDnsVerificationObservationSchema,Kl as DomainDnsVerificationResultSchema,hE as DomainDnsVerificationStatusSchema,pE as DomainObservedStatusSchema,yE as DomainOperationErrorSchema,gi as DomainOperationSchema,bE as DomainOperationStatusSchema,fa as DomainOperationTypeSchema,$l as DomainRecordSchema,uE as DomainRoutingModeSchema,$D as EDIT_ENGINE_VERSION_HEADER,VD as EDIT_ENGINE_VERSION_SOURCE_HEADER,jk as EMPTY_EXTERNAL_SITE_EDIT_CHANGES,GD as ERROR_COPY,kd as EXTERNAL_SITE_EDIT_INFRASTRUCTURE_REASONS,Td as EXTERNAL_SITE_EDIT_PROMPT_MAX_LENGTH,Bo as EditEngineVersionParseError,ac as EnhanceDesignerPageResourceBodySchema,bG as EnhanceDesignerPageResourceResponseSchema,qk as ExternalSiteEditCallbackAckSchema,Gk as ExternalSiteEditCallbackPayloadSchema,Ad as ExternalSiteEditCallbackStatusSchema,wi as ExternalSiteEditChangeKindSchema,rr as ExternalSiteEditChangesSchema,Tn as ExternalSiteEditDegradedReasonSchema,Mt as ExternalSiteEditExternalIdSchema,sr as ExternalSiteEditOutcomeSchema,Ld as ExternalSiteEditPageChangeSchema,wd as ExternalSiteEditPageTypeSchema,jd as ExternalSiteEditSectionChangeSchema,vd as ExternalSiteEditSiteWideChangeSchema,Cd as ExternalSiteEditSiteWideKindSchema,nr as ExternalSiteEditTaskIdSchema,ds as ExternalSiteEditTaskSchema,Pd as ExternalSiteEditTaskStatusSchema,lG as ExternalSyncSiteRequestSchema,yG as ExternalSyncSiteResponseSchema,zd as ExtractedFactKindSchema,hs as ExtractedFactSchema,ea as FIELD_TYPES,zC as FILL_IN_NOT_AVAILABLE_ERROR_CODE,$C as FILL_IN_TARGET_MODIFIED_ERROR_CODE,HC as FILL_IN_TARGET_NOT_OMITTED_ERROR_CODE,Vf as FONT_LICENSE_BUILD_ERROR_CODES,am as FONT_PAIRINGS,wo as FONT_PAIRING_IDS,px as FORM_DESIGN_ERROR_CODES,lx as FORM_DESIGN_FAILURE_STAGES,cx as FORM_DESIGN_OPERATION_STAGES,mx as FORM_DESIGN_OPERATION_STATUSES,ai as FORM_FIELD_TYPES,cl as FORM_SCENE_CODES,ml as FORM_SCENE_UNKNOWN,Cy as FORM_SHAPE_EMBEDDED,ex as FORM_SPEC_FIELD_TYPE_TO_CMS,pl as FORM_SPEC_FILE_MIN_RUNTIME_VERSION,zy as FORM_SPEC_LOCALIZABLE_FIELD_PATHS,ll as FORM_SPEC_MULTISTEP_MIN_RUNTIME_VERSION,iL as FORM_TEMPLATE_CATEGORY_COUNTS,sL as FORM_TEMPLATE_CATEGORY_SLUGS,x2 as FailStaleInFlightWorkspaceRunsResponseSchema,ni as FieldDeclSchema,bm as FillInTargetSchema,_M as FirecrawlBatchCreateRequestSchema,gM as FirecrawlBatchCreatedResponseSchema,Xx as FirecrawlBatchErrorSchema,SM as FirecrawlBatchErrorsResponseSchema,Yx as FirecrawlBatchPageSchema,hM as FirecrawlBatchStatusResponseSchema,mM as FirecrawlCrawlCreateRequestSchema,lM as FirecrawlCrawlCreatedResponseSchema,pM as FirecrawlCrawlStatusResponseSchema,Ml as FirecrawlJobStatusSchema,rM as FirecrawlMapRequestSchema,cM as FirecrawlMapResponseSchema,fM as FirecrawlQueueStatusResponseSchema,dM as FirecrawlScrapeRequestSchema,uM as FirecrawlScrapeResponseSchema,KI as FooterShellSurfaceSchema,jy as FormBlockIdSchema,ci as FormDefinitionIdSchema,ox as FormDesignAffectedFilesSchema,_a as FormDesignErrorCodeSchema,SL as FormDesignErrorSchema,yl as FormDesignFailureStageSchema,de as FormDesignHashSchema,lL as FormDesignOpenResponseSchema,ax as FormDesignOperationFingerprintInputSchema,ca as FormDesignOperationIdSchema,xl as FormDesignOperationNextActionSchema,Ik as FormDesignOperationRecordIdSchema,gL as FormDesignOperationRecordSchema,ga as FormDesignOperationResponseSchema,Rl as FormDesignOperationSchema,ua as FormDesignOperationStageSchema,bl as FormDesignOperationStatusSchema,hL as FormDesignOperationTransitionRequestSchema,El as FormDesignPreviewRefreshStatusSchema,dL as FormDesignQueryResponseSchema,uL as FormDesignResumeRequestSchema,_L as FormDesignResumeResponseSchema,rx as FormDesignSaveRequestSchema,pL as FormDesignSaveResponseSchema,fl as FormDesignSharedImpactSchema,da as FormDesignStandardizationSchema,Oy as FormFieldDeclSchema,is as FormFieldNameSchema,oa as FormMetadataSchema,ma as FormOptionValueSchema,ia as FormSceneSchema,vy as FormShapeSchema,Ly as FormSpecBindingSchema,Uy as FormSpecFieldNodeSchema,Gy as FormSpecNodeSchema,My as FormSpecOptionSchema,Fy as FormSpecStepBreakNodeSchema,pa as FormSpecV1Schema,oL as FormTemplateCatalogResponseSchema,hl as FormTemplateCategorySlugSchema,Qy as FormTemplateCategoryV1Schema,Dt as FormTemplateTextSchema,Zy as FormTemplateV1Schema,nR as GA4_AUTHORIZATION_STATUSES,iR as GA4_AUTH_ATTEMPT_STATUSES,lR as GA4_BINDING_REASONS,aR as GA4_BINDING_STATUSES,cR as GA4_VERIFICATION_STATUSES,zn as GLOBAL_DESIGN_TOKENS_END,mn as GLOBAL_DESIGN_TOKENS_START,VE as GSC_AUTH_STATUSES,YE as GSC_BINDING_STATUSES,XE as GSC_PROPERTY_TYPES,yR as Ga4AccountOptionSchema,ip as Ga4AuthAttemptSchema,oR as Ga4AuthAttemptStatusSchema,uR as Ga4AuthorizationSchema,sR as Ga4AuthorizationStatusSchema,pR as Ga4BindingReasonSchema,_R as Ga4BindingSchema,rR as Ga4BindingStatusSchema,ER as Ga4DataStreamOptionSchema,RR as Ga4DataStreamsDataSchema,BU as Ga4DataStreamsQuerySchema,WU as Ga4DataStreamsResponseSchema,fR as Ga4DeploymentSchema,hR as Ga4ModeSchema,IR as Ga4MutationSchema,bR as Ga4PropertyOptionSchema,xR as Ga4SetupResourcesDataSchema,qU as Ga4SetupResourcesQuerySchema,GU as Ga4SetupResourcesResponseSchema,op as Ga4StatusDataSchema,FU as Ga4StatusQuerySchema,UU as Ga4StatusResponseSchema,SR as Ga4TrackingSchema,gR as Ga4VerificationSchema,mR as Ga4VerificationStatusSchema,$R as GenerateAiImagesRequestSchema,VR as GenerateAiImagesResponseSchema,Rp as GeneratedAiImageResultSchema,rU as GetActiveSiteDomainResponseSchema,sq as GetDeploymentResponseSchema,CI as GetDeploymentsStatusResponseSchema,Fk as GetExternalSiteEditResponseSchema,aU as GetSiteDomainConfigurationResponseSchema,eN as GetSiteLauncherPermissionResponseSchema,ba as GetSitePublishDomainOperationDataSchema,KE as GetSitePublishDomainOperationResponseSchema,UO as GetTemplateUpgradeReportQuerySchema,FO as GetTemplateUpgradeReportResponseSchema,PU as GoogleSearchConsoleAuthStartDataSchema,AU as GoogleSearchConsoleAuthStartRequestSchema,wU as GoogleSearchConsoleAuthStartResponseSchema,RU as GoogleSearchConsoleAuthStatusSchema,IU as GoogleSearchConsoleBindingStatusSchema,TU as GoogleSearchConsolePropertyTypeSchema,kU as GoogleSearchConsoleStateSchema,vU as GoogleSearchConsoleStatusDataSchema,CU as GoogleSearchConsoleStatusInputSchema,DU as GoogleSearchConsoleStatusResponseSchema,yU as GscAuthStartDataSchema,bU as GscAuthStartRequestSchema,xU as GscAuthStartResponseSchema,ya as GscAuthStatusSchema,xa as GscBindingStatusSchema,Ea as GscPropertyTypeSchema,ZE as GscStateInputSchema,EU as GscStateSchema,np as GscStatusDataSchema,JE as GscStatusResponseSchema,Br as HOME_PAGE_URL_PATH,GI as HeaderShellBehaviorSchema,qI as HeaderShellShapeSchema,FI as HeaderShellSurfaceSchema,UI as HeaderShellVariantSchema,wx as HomeUrlCrawlerTaskCreateRequestSchema,mo as HttpUrlSchema,E0 as IMAGE_EXTENSION_WHITELIST,R0 as IMAGE_MIME_WHITELIST,Lr as INSERT_NEW_COMPONENT_CATEGORY_GROUP_KEY,Zr as INSERT_NEW_PAGE_CATEGORY_GROUP_KEY,NC as INTERNAL_RUN_LEASE_OWNER_HEADER,ku as ISO_639_3_TO_SITE_LOCALE,Xd as ImageRoleSchema,ud as InboundUserMessageSchema,lj as IndustryClassificationRequestSchema,pj as IndustryClassificationResultSchema,my as IndustryConfidenceSchema,sl as InitializationResultSchema,Kd as InputBundleStatusSchema,fs as InputConflictSchema,A0 as InputContextBundleSchema,In as InputContextSourceIdSchema,$d as InputSourceSchema,vi as InputSourceStatusSchema,Ci as InputSourceTypeSchema,kO as InspectTemplateUpgradeStateRequestSchema,AO as InspectTemplateUpgradeStateResponseSchema,CA as InstallDesignerComponentBodySchema,uG as InstallDesignerComponentResponseSchema,s1 as InstallDesignerPageBodySchema,hG as InstallDesignerPageResponseSchema,tq as InternalCreateDeploymentResponseSchema,YG as InternalEnsureSubsitePublishRequestSchema,XG as InternalEnsureSubsitePublishResponseSchema,Q as InternalEntityIdSchema,iq as InternalGetDeploymentsStatusResponseSchema,QG as InternalGetSubsitePublishStatusRequestSchema,ZG as InternalGetSubsitePublishStatusResponseSchema,$G as InternalPrepareSubsitePreviewRequestSchema,VG as InternalPrepareSubsitePreviewResponseSchema,$b as KNOWLEDGE_CATEGORY_CODES,Fm as KnowledgeCategoryCodeSchema,bN as KnowledgeContextReadinessSchema,Yb as KnowledgeSourceReadinessSchema,Vb as KnowledgeSourceReadinessStatusSchema,Fl as LEGACY_FILE_MUTATION_TOOL_NAME,yu as LEGACY_SITE_LOCALE_CODES,r2 as LatestAgentRunQuerySchema,c2 as LatestAgentRunResponseSchema,e2 as LatestWorkspaceRunQuerySchema,Jq as LatestWorkspaceRunResponseSchema,PM as LauncherPromptTemplateApplyRequestSchema,wM as LauncherPromptTemplateApplyResponseSchema,sE as LauncherPromptTemplateCatalogItemSchema,kM as LauncherPromptTemplateCatalogQuerySchema,AM as LauncherPromptTemplateCatalogSchema,tE as LauncherPromptTemplateKindSchema,nE as LauncherPromptTemplateLocaleSchema,_i as LauncherPromptTemplateTypeSchema,Ub as LauncherScopeSchema,zq as ListAgentEventsQuerySchema,Kq as ListAgentEventsResponseSchema,pG as ListDesignerComponentCategoriesResponseSchema,wA as ListDesignerComponentsQuerySchema,dG as ListDesignerComponentsResponseSchema,_G as ListDesignerPageCategoriesResponseSchema,t1 as ListDesignerPagesQuerySchema,gG as ListDesignerPagesResponseSchema,fG as ListDesignerSitePagesResponseSchema,KR as ListMediaLibraryAssetsQuerySchema,zR as ListMediaLibraryAssetsResponseSchema,Hq as ListSiteAgentEventsQuerySchema,KG as ListSiteVersionsResponseSchema,GO as ListTemplateUpgradeSnapshotDeletionCandidatesQuerySchema,qO as ListTemplateUpgradeSnapshotDeletionCandidatesResponseSchema,QC as ListWorkspacePageCheckpointsResponseSchema,b0 as MAX_DOCUMENT_SOURCES_PER_SITE,f0 as MAX_DOCUMENT_UPLOAD_BYTES,T0 as MAX_IMAGE_SOURCES_PER_SITE,I0 as MAX_IMAGE_UPLOAD_BYTES,MR as MAX_NAV_LABEL_WIDTH,cb as MAX_SUBSITE_MEDIA_REPLACEMENTS,YP as MAX_UNBOUND_WORKSPACE_ATTACHMENTS_PER_SITE,fo as MAX_WORKSPACE_ATTACHMENTS_PER_MESSAGE,nw as MAX_WORKSPACE_URL_CAPTURES_PER_SITE_HOUR,gp as MEDIA_LIBRARY_AUDIO_EXTENSIONS,yp as MEDIA_LIBRARY_AUDIO_MIME_TYPES,hp as MEDIA_LIBRARY_DOCUMENT_EXTENSIONS,WR as MEDIA_LIBRARY_EXTENSIONS,Sp as MEDIA_LIBRARY_FILE_EXTENSIONS,up as MEDIA_LIBRARY_IMAGE_EXTENSIONS,qR as MEDIA_LIBRARY_IMAGE_MAX_BYTES,fp as MEDIA_LIBRARY_IMAGE_MIME_TYPES,dp as MEDIA_LIBRARY_MAX_BYTES,BR as MEDIA_LIBRARY_MIME_TYPES,_p as MEDIA_LIBRARY_VIDEO_EXTENSIONS,bp as MEDIA_LIBRARY_VIDEO_MIME_TYPES,_v as MIGRATION_PRODUCTS_CMS_DETAIL_PAGE_TITLE,uv as MIGRATION_PRODUCTS_DETAIL_PREFIX,Sv as MIGRATION_PRODUCTS_DETAIL_VIEW_VARIANT,hv as MIGRATION_PRODUCTS_LIST_VIEW_VARIANT,$S as MIGRATION_PRODUCTS_ROUTE,ft as MIGRATION_PRODUCTS_SLUG,gv as MIGRATION_PRODUCTS_VIEW_BLOCK_TYPE,Dy as MODEL_DECLARABLE_FORM_FIELD_TYPES,Ul as MODEL_FILE_MUTATION_TOOL_NAMES,Qb as MOTION_PRESETS,Vo as MOTION_PRESET_IDS,dq as MediaAssetSchema,LI as MediaAttributionSchema,ka as MediaLibraryAssetSchema,xp as MediaLibraryFileTypeSchema,Ep as MediaLibrarySourceSchema,tk as MediaRequestOwnerSchema,Ak as MediaResolutionCacheIdSchema,_I as MigrationCollectionProgressSchema,Da as MigrationCollectionSchema,SF as MigrationContentProgressSchema,uI as MigrationReasonCodeSchema,hI as MigrationRedirectProgressSchema,gI as MigrationRedirectReasonCodeSchema,Cp as MigrationRedirectSiteReasonSchema,PA as MockDesignerComponentInsertDataSchema,AA as MockDesignerComponentInsertRequestSchema,La as MotionLevelSchema,bx as NAV_ITEMS_LOCALIZABLE_FIELD_PATHS,yx as NAV_ITEMS_MACHINE_FIELD_PATHS,lS as NEXT_FONT_DISPLAY_NAMES,St as NEXT_FONT_REGISTRY,Au as NON_LATIN_SITE_LOCALE_CODES,AL as NavItemSchema,Mi as NextPageCodeErrorSchema,gx as PAGE_SEO_LOCALIZABLE_FIELD_PATHS,hx as PAGE_SEO_MACHINE_FIELD_PATHS,Ln as PAGE_SLUG_PATTERN,tn as PAGE_SLUG_SEGMENT_PATTERN_SOURCE,lr as PAGE_TEMPLATE_BATCH_MAX_ITEMS,Zx as PLATFORM_FILE_MUTATION_TOOL_NAMES,OL as PLATFORM_MATERIALIZED_EXEMPTIONS,Ix as PLATFORM_MATERIALIZED_FILES,Tx as PLATFORM_MATERIALIZED_FILE_PATTERNS,DL as PLATFORM_MATERIALIZERS,rc as PLATFORM_OWNED_PAGE_SLUGS,P_ as PLATFORM_OWNED_ROUTE_FILE_PATHS,d_ as PageDirectoryReconcileFailedPageSchema,Zi as PageDirectoryReconcileResultSchema,zA as PageDirectoryReconcileStateSchema,p_ as PageDirectoryReconcileStatusSchema,Ox as PageDiscoveryCoverageEntrySchema,XL as PageDiscoveryCoverageReasonSchema,Ol as PageDiscoveryCoverageSchema,Qp as PageNavigationSchema,eo as PageResourceArtifactSchema,I_ as PageResourceComponentReferenceSchema,T_ as PageResourceComponentSchema,E_ as PageResourceDraftPageSchema,R_ as PageResourceDraftSchema,Ds as PageResourceFinalRouteSchema,k_ as PageResourcePageSchema,x_ as PageResourcePageSelectionSchema,sc as PageResourceRouteMappingSchema,Ka as PageSchema,TL as PageSeoDeclSchema,Ba as PageSlugSchema,h_ as PageTargetKindSchema,$i as PageTargetProjectionHashSchema,Qr as PageTargetSchema,S_ as PageTargetSeoSchema,KA as PageTargetSetSchema,dr as PageTemplateBatchManifestSchema,Vk as PageTemplateCleanupRequestSchema,Qk as PageTemplateCleanupResponseSchema,mr as PageTemplateCreateItemSchema,Hk as PageTemplateCreateRequestSchema,Yk as PageTemplateCreateResponseSchema,Zk as PageTemplateErrorCodeSchema,Qe as PageTemplateIdSchema,An as PageTemplatePagePathSchema,$k as PageTemplatePromoteRequestSchema,Xk as PageTemplatePromoteResponseSchema,Md as PageTemplateTaskSchema,No as PaletteInputsSchema,jq as PersistClarifyAnswersRequestSchema,Lq as PersistClarifyAnswersResponseSchema,vq as PersistGeneratedSitemapDraftRequestSchema,Nq as PersistGeneratedSitemapDraftResponseSchema,b2 as PersistPreviewSessionRequestSchema,y2 as PersistPreviewSessionResponseSchema,Uq as PersistSiteDesignPlanRequestSchema,Fq as PersistSiteDesignPlanResponseSchema,Oq as PersistSiteSitemapDraftResponseSchema,wq as PersistSiteSitemapRequestSchema,Dq as PersistSiteSitemapResponseSchema,PG as PersistSiteSnapshotRequestSchema,wG as PersistSiteSnapshotResponseSchema,SI as PositioningPrefillSchema,Oa as PositioningSourceSchema,i1 as PrepareDesignerPageBodySchema,SG as PrepareDesignerPageResponseSchema,lN as PrepareSiteBuildInitialGenerationBaseRequestSchema,pN as PrepareSiteBuildInitialGenerationBaseResultSchema,TO as PrepareTemplateUpgradeStateRequestSchema,Eb as PrepareTemplateUpgradeStateResponseSchema,HG as PrepareVersionPreviewRequestSchema,PI as PrepareVersionPreviewResponseSchema,zc as ProductSearchAppConfigDraftSchema,go as ProductSearchAppSlugSchema,HP as ProductSearchContractFixtureSchema,ch as ProductSearchDraftConfigSchema,Fe as ProductSearchFieldNameSchema,ah as ProductSearchFilterMetaSchema,So as ProductSearchInteractionRequestSchema,Ms as ProductSearchInteractionResponseSchema,zP as ProductSearchPopularTermsReadSchema,Kc as ProductSearchPopularTermsSchema,oh as ProductSearchPrepareFailureReasonSchema,ho as ProductSearchPrepareFailureSchema,dh as ProductSearchRequestSchema,_h as ProductSearchResponseSchema,qn as ProductSearchRouteIdSchema,ih as ProductSearchValueShapeSchema,vG as PromoteSiteSnapshotRequestSchema,kI as PromoteSiteSnapshotResponseSchema,WG as PromoteTemplateUpgradeSnapshotRequestSchema,BG as PromoteTemplateUpgradeSnapshotResponseSchema,JM as QualityCheckOutcomeSchema,Ql as QualityRunningStatusSchema,BD as REFUSAL_COPY,Yq as REST_API_ENDPOINTS,Sx as ROOT_LAYOUT_METADATA_LOCALIZABLE_FIELD_PATHS,fx as ROOT_LAYOUT_METADATA_MACHINE_FIELD_PATHS,zE as ReconcileSitePublishDomainOperationDataSchema,HE as ReconcileSitePublishDomainOperationResponseSchema,jG as RecordSnapshotVersionRequestSchema,LG as RecordSnapshotVersionResponseSchema,LO as RecordTemplateUpgradeEventRequestSchema,MO as RecordTemplateUpgradeEventResponseSchema,PO as RecordTemplateUpgradeFailureRequestSchema,wO as RecordTemplateUpgradeFailureResponseSchema,CO as RecordTemplateUpgradeSuccessRequestSchema,vO as RecordTemplateUpgradeSuccessResponseSchema,FA as RecoverDesignerPageProjectionRequestSchema,GA as RecoverDesignerPageProjectionResponseSchema,__ as RecoverDesignerPageProjectionResultSchema,Hd as ReferencePagePatternSchema,Ss as ReferenceSignalsSchema,JR as RegisterMediaResourceReferenceRequestSchema,eI as RegisterMediaResourceReferenceResponseSchema,DP as RegisterWorkflowTaskCommandRequestSchema,Qg as RegisterWorkflowTaskRequestSchema,XC as RegisterWorkspacePageCheckpointRequestSchema,FG as ReleaseTemplateUpgradeLockRequestSchema,GG as ReleaseTemplateUpgradeLockResponseSchema,jP as ReplaceCrawlWorkflowTaskCommandRequestSchema,Jg as ReplaceCrawlWorkflowTaskRequestSchema,NP as ReplaceWorkflowTaskCommandRequestSchema,Zg as ReplaceWorkflowTaskRequestSchema,bj as ResolvedFieldSchema,$j as ResolvedFormFieldSchema,Vq as RestApiMethodSchema,zG as RestoreSiteSnapshotResponseSchema,xF as ReturnWorkbenchResponseSchema,kL as RootLayoutMetadataSchema,Kp as RouteGenerationCardSchema,Vh as RuleEngineInputSchema,Zh as RuleEngineScoreRecordSchema,To as RuleScoreDimensionKeySchema,Qh as RuleScoreDimensionSchema,Cn as SELECTABLE_SITE_LOCALE_CODES,cT as SITEMAP_RESOLVER_MAX_BLOCK_TARGETS,rT as SITEMAP_RESOLVER_MAX_PAGE_TARGETS,cN as SITE_BUILD_CONTEXT_FILE_PATH,mN as SITE_BUILD_CONTEXT_MAX_BYTES,Fg as SITE_BUILD_STATUSES,Mc as SITE_BUILD_STATUS_CODES,Gg as SITE_DEPLOYMENT_STATUSES,Uc as SITE_DEPLOYMENT_STATUS_CODES,$o as SITE_DESIGN_DENSITY_IDS,zt as SITE_DESIGN_NOTES_END,cn as SITE_DESIGN_NOTES_START,qm as SITE_DESIGN_RADIUS_IDS,Kv as SITE_EDIT_DURABLE_HISTORY_CAPABILITY,Hu as SITE_EDIT_MATERIALIZATION_MAX_FILE_CONTENT_BYTES,Bi as SITE_EDIT_MATERIALIZATION_MAX_FILE_COUNT,Ki as SITE_EDIT_MATERIALIZATION_MAX_TOTAL_CONTENT_BYTES,Ec as SITE_EDIT_PAGE_COMPOSITION_SCHEMA_VERSION,G1 as SITE_EDIT_PAGE_COMPOSITION_V2_CAPABILITY,Ff as SITE_EDIT_RUNTIME_CONTAINER_TAGS,Gf as SITE_EDIT_RUNTIME_TEXT_TAGS,Uf as SITE_EDIT_RUNTIME_VOID_ELEMENT_TAGS,v1 as SITE_EDIT_SIGNED_MUTATION_CAPABILITY,Jd as SITE_EDIT_SOURCE_ALLOWED_APP_FILES,br as SITE_EDIT_SOURCE_ALLOWED_DIRS,Qd as SITE_EDIT_SOURCE_ALLOWED_ROOT_FILES,Zd as SITE_EDIT_SOURCE_ALLOWED_SYSTEM_FILES,Oi as SITE_EDIT_SOURCE_DELETE_CAPABILITY,eu as SITE_EDIT_TEXT_SOURCE_EXTENSIONS,Zm as SITE_EXTRA_REQUIREMENT_MAX_LENGTH,Av as SITE_HAS_ACTIVE_SUBSITES_ERROR_CODE,Pv as SITE_HAS_SUBSITES_ERROR_CODE,rC as SITE_LEADING_BODY_TOKEN,cC as SITE_LEADING_HEADING_TOKEN_NAMES,xu as SITE_LOCALE_CODES,IL as SITE_LOCALIZATION_STRUCTURES,ZF as SITE_PLANNING_FROZEN_ERROR_CODE,JF as SITE_PLANNING_LOCKED_ERROR_CODE,sG as SITE_SITEMAP_DRAFT_OPERATION_MISMATCH_ERROR_CODE,nG as SITE_SITEMAP_DRAFT_STALE_ERROR_CODE,eG as SITE_STRUCTURE_CONFIRMATION_REQUIRED_ERROR_CODE,tG as SITE_STRUCTURE_CONFIRMATION_STALE_ERROR_CODE,vp as SITE_STRUCTURE_INVALID_ERROR_CODE,aC as SITE_WEIGHT_TOKEN_NAMES,Db as SITE_WORKFLOW_PROGRESS_STATUSES,Nb as SITE_WORKFLOW_PROGRESS_STEP_STATUSES,qg as SITE_WORKFLOW_STATUSES,Fc as SITE_WORKFLOW_STATUS_CODES,Xq as SSE_STREAMS,Cu as STEP5_KEYWORD_CATEGORIES,Du as STEP5_OPTIONAL_STRATEGY_KEYS,ks as STEP5_REQUIRED_STRATEGY_COUNT,Dn as STEP5_REQUIRED_STRATEGY_KEYS,Bu as STEP5_SSE_EVENT_NAMES,Ne as STEP5_STRATEGY_COUNT,Jt as STEP5_STRATEGY_KEYS,wr as STEP5_STRATEGY_OPTION_IDS,zm as STEP6_AI_THEME_IDS,Yo as STEP6_AI_THEME_PRESETS,Hm as STEP6_GENERATED_THEME_ID_PATTERN,tb as SUBSITE_GLOSSARY_ENTRY_MAX_CHARS,nb as SUBSITE_GLOSSARY_MAX_ENTRIES,hb as SUBSITE_MOUNT_PATH_PATTERN,rb as SUBSITE_PALETTE_NOTE_MAX_CHARS,Sb as SUBSITE_RESERVED_MOUNT_SEGMENTS,Y0 as SUPPORTED_SITE_LOCALES,ls as SandboxSessionIdSchema,uk as SandboxSessionSchema,Ed as SandboxSessionStatusSchema,mG as SaveBriefDraftRequestSchema,RG as SaveBriefDraftResponseSchema,TR as SaveGa4BindingDataSchema,KU as SaveGa4BindingRequestSchema,zU as SaveGa4BindingResponseSchema,gj as SaveSiteExtraRequirementRequestSchema,kq as SaveSiteSitemapDraftRequestSchema,Aq as SaveSiteSitemapDraftResponseSchema,YR as SearchUnsplashMediaQuerySchema,XR as SearchUnsplashMediaResponseSchema,Yp as SiteBreadcrumbPlacementSchema,Kb as SiteBuildContextFileSchema,Bb as SiteBuildContextPayloadSchema,Wb as SiteBuildContextProvenanceSchema,qb as SiteBuildContextProvenanceSourceSchema,lo as SiteBuildStatusSchema,wv as SiteDeletionBlockedDetailsSchema,po as SiteDeploymentStatusSchema,yi as SiteDesignContextSchema,bI as SiteDesignDensitySchema,yI as SiteDesignMotionLevelSchema,kn as SiteEditAdvisorySchema,$s as SiteEditBoundaryKindSchema,sf as SiteEditCapabilityConstraintSchema,tf as SiteEditCapabilityModeSchema,Hs as SiteEditCapabilityModeViewSchema,Ov as SiteEditCapabilityReadRequestSchema,O_ as SiteEditClassNameSourceDiagnosticSchema,ut as SiteEditClassNameSourceRangeSchema,uc as SiteEditClassNameSourceSchema,g1 as SiteEditClassNameSourceStyleContextSchema,dc as SiteEditClassNameSourceStylesheetSchema,no as SiteEditClassNameSourceWriteIntentSchema,l1 as SiteEditCommandDiagnosticSchema,v_ as SiteEditCommandErrorSchema,K as SiteEditCompositionContextSchema,ge as SiteEditCompositionSelectorSchema,nf as SiteEditConstraintKindSchema,kg as SiteEditDeletePageSourceOutputSchema,wf as SiteEditDynamicConfidenceSchema,vf as SiteEditDynamicDataBindingSchema,Am as SiteEditDynamicDataDetailSchema,Pm as SiteEditDynamicDataSummarySchema,Cf as SiteEditDynamicEvidenceSchema,km as SiteEditDynamicSourceKindSchema,Af as SiteEditDynamicSourceTypeSchema,Pf as SiteEditDynamicTargetKindSchema,Mo as SiteEditEffectiveWriteTargetSchema,Gv as SiteEditEventSchema,Pi as SiteEditExecutionSceneSchema,Xs as SiteEditExternalSourceKindSchema,b1 as SiteEditGetClassNameSourceCommandResultSchema,S1 as SiteEditGetClassNameSourceInputSchema,f1 as SiteEditGetClassNameSourceResultSchema,ED as SiteEditGetDocumentInputSchema,RD as SiteEditGetObjectEditContextInputSchema,G0 as SiteEditGetSourceFileInputSchema,F0 as SiteEditGetSourceTreeInputSchema,h1 as SiteEditGetStyleContextInputSchema,Ys as SiteEditHistoryProvenanceSchema,mf as SiteEditHistoryReadOnlyRecoveryStatusSchema,of as SiteEditHistoryRecoveryCodeSchema,af as SiteEditHistoryRecoveryDiagnosticSchema,Hv as SiteEditHistoryResultSchema,zv as SiteEditHistoryStatusModeSchema,pf as SiteEditHistoryStatusSchema,rf as SiteEditHistoryUnavailableReasonSchema,lf as SiteEditHistoryUnavailableStatusSchema,cf as SiteEditHistoryWritableStatusSchema,UD as SiteEditInitializeSessionInputSchema,Rg as SiteEditInsertNodeSpecSchema,Tg as SiteEditInsertPageResourceOutputSchema,Zu as SiteEditMaterializationDataRequirementsSchema,Qu as SiteEditMaterializationEntrySchema,Xu as SiteEditMaterializationExportSchema,Yu as SiteEditMaterializationFileSchema,jr as SiteEditMaterializationPathTemplateSchema,Gt as SiteEditMaterializationSchema,wc as SiteEditMaterializedComponentNodeSpecSchema,Eg as SiteEditMoveNodeTargetSchema,Pc as SiteEditMoveTargetSchema,Mn as SiteEditMutationContextSchema,Vs as SiteEditNodeCapabilitySnapshotSchema,TD as SiteEditObjectCapabilitiesSchema,AD as SiteEditObjectDetailSchema,wD as SiteEditObjectEditContextSchema,CD as SiteEditObjectStyleDetailSchema,PD as SiteEditObjectSummarySchema,nP as SiteEditOperationCommandResultSchema,Cc as SiteEditOperationErrorCodeSchema,vc as SiteEditOperationErrorSchema,Ag as SiteEditOperationOutputSchema,Ig as SiteEditOperationParamsSchema,ro as SiteEditOperationPayloadSchema,ao as SiteEditOperationRequestSchema,yg as SiteEditOperationResultTargetSchema,sn as SiteEditOperationSelectionRefSchema,kf as SiteEditOperationSummarySchema,gg as SiteEditOperationTargetSchema,Gn as SiteEditOperationTypeSchema,Kt as SiteEditOperationValueSchema,Df as SiteEditPageCompositionActionScopeSchema,q1 as SiteEditPageCompositionAnyVersionSchema,J_ as SiteEditPageCompositionAtomicKindSchema,sg as SiteEditPageCompositionBoundaryModeSchema,z_ as SiteEditPageCompositionBusinessMemberSchema,B_ as SiteEditPageCompositionContainerSchema,Fn as SiteEditPageCompositionDiagnosticSchema,Ns as SiteEditPageCompositionErrorCodeSchema,bc as SiteEditPageCompositionPlacementTargetSchema,H_ as SiteEditPageCompositionPlacementUnitSchema,Q_ as SiteEditPageCompositionRuntimeRefSchema,X_ as SiteEditPageCompositionSchema,Z_ as SiteEditPageCompositionSourceMemberKindSchema,K_ as SiteEditPageCompositionSourceMemberSchema,Rc as SiteEditPageCompositionSourceRangeSchema,V_ as SiteEditPageCompositionSupportedSchema,Y_ as SiteEditPageCompositionUnsupportedSchema,ng as SiteEditPageCompositionV2BusinessMemberSchema,eg as SiteEditPageCompositionV2ContainerSchema,og as SiteEditPageCompositionV2PlacementRelationSchema,rg as SiteEditPageCompositionV2PlacementSchema,ig as SiteEditPageCompositionV2PlacementUnitSchema,pg as SiteEditPageCompositionV2Schema,tg as SiteEditPageCompositionV2SourceMemberSchema,mg as SiteEditPageCompositionV2SupportedSchema,lg as SiteEditPageCompositionV2UnsupportedSchema,ag as SiteEditPageCompositionV2WriteModeSchema,cg as SiteEditPageCompositionVisualAnchorSchema,$_ as SiteEditPagePlacementOptionSchema,fc as SiteEditPagePlacementSchema,xc as SiteEditPageUnitResultTargetSchema,yc as SiteEditPageUnitTargetSchema,bf as SiteEditPatchPlanPatchSchema,nD as SiteEditPatchPlanSchema,Uo as SiteEditPropertiesSchema,io as SiteEditPropertyChangeSchema,hf as SiteEditPropertyCreationSchema,_f as SiteEditPropertyItemSchema,df as SiteEditPropertyResolutionSchema,uf as SiteEditPropertySourceSchema,gf as SiteEditPropertySpreadSchema,Vn as SiteEditProvenanceChainSchema,jf as SiteEditProvenanceHopSchema,ID as SiteEditRenderDocumentSchema,$n as SiteEditRenderEntryRefSchema,Of as SiteEditRenderEntrySchema,Tm as SiteEditRenderPageCompositionSchema,If as SiteEditRenderPageCompositionSupportedSchema,Tf as SiteEditRenderPageCompositionUnsupportedSchema,Rf as SiteEditRenderPagePlacementSchema,D1 as SiteEditRequiredMutationContextEnvelopeSchema,W0 as SiteEditResolveSourceLocationInputSchema,Cm as SiteEditSemanticSourceSchema,gc as SiteEditSetPropsParamsSchema,tP as SiteEditSignedOperationRequestSchema,yr as SiteEditSourceDeleteCapabilitySchema,nu as SiteEditSourceDirectoryPathSchema,ru as SiteEditSourceFileBinaryPreviewUnavailableReasonSchema,cu as SiteEditSourceFileBinaryResponseSchema,M0 as SiteEditSourceFileKindSchema,su as SiteEditSourceFileListItemSchema,q0 as SiteEditSourceFileResponseSchema,au as SiteEditSourceFileTextResponseSchema,oo as SiteEditSourceIdentitySchema,mu as SiteEditSourceLocationRangeSchema,B0 as SiteEditSourceLocationSchema,Mf as SiteEditSourceLocatorRangeSchema,qo as SiteEditSourceLocatorSchema,Re as SiteEditSourcePathSchema,xg as SiteEditSourceSiblingMoveTargetSchema,xr as SiteEditSourceTreeNodeSchema,U0 as SiteEditSourceTreeResponseSchema,iu as SiteEditSourceTreeTruncationReasonSchema,ou as SiteEditSourceTreeTruncationSchema,Ac as SiteEditStyleBreakpointSchema,hc as SiteEditStyleDraftPropertySchema,kD as SiteEditStyleModelSchema,Tc as SiteEditStylePropertySchema,vm as SiteEditStyleSourceSchema,kc as SiteEditStyleStateModeSchema,Go as SiteEditTextSegmentSchema,wm as SiteEditTextSourceSchema,Nf as SiteEditWriteTargetSchema,hj as SiteExtraRequirementResponseSchema,ly as SiteExtraRequirementSchema,nv as SiteGenerationLedgerResponseSchema,k as SiteIdSchema,Fb as SiteLauncherPermissionSchema,Ie as SiteLocaleSchema,pq as SiteMediaIntentSchema,Rk as SiteOperationLockIdSchema,wb as SitePreviewActivateErrorCodeSchema,vb as SitePreviewActivateFailedSchema,Cb as SitePreviewActivateReadySchema,KO as SitePreviewActivateResponseSchema,mU as SitePublishDomainCheckDataSchema,cU as SitePublishDomainCheckRequestSchema,lU as SitePublishDomainCheckResponseSchema,pU as SitePublishDomainOperationDataSchema,dU as SitePublishDomainOperationResponseSchema,uU as SitePublishDomainReconcileOperationResponseSchema,_U as SitePublishDomainRemediationConfirmRequestSchema,gU as SitePublishDomainRemediationConfirmResponseSchema,Si as SitePublishQualityTaskStatusSchema,qM as SitePublishRepairInputItemSchema,DE as SitePublishRepairResultItemSchema,Zl as SitePublishRepairResultSchema,WM as SitePublishRepairTaskSnapshotSchema,Xl as SitePublishRepairTaskStatusSchema,HM as SitePublishWorkflowActiveResponseSchema,ps as SitePublishWorkflowIdSchema,NE as SitePublishWorkflowMutationDataSchema,$M as SitePublishWorkflowMutationResponseSchema,jE as SitePublishWorkflowPublishDataSchema,VM as SitePublishWorkflowPublishResponseSchema,LE as SitePublishWorkflowQualityDataSchema,YM as SitePublishWorkflowQualityResponseSchema,Ot as SitePublishWorkflowRecordSchema,zM as SitePublishWorkflowRevisionRequestSchema,TE as SitePublishWorkflowStatusSchema,kE as SitePublishWorkflowStepSchema,Lt as SiteRecordSchema,Tk as SiteTemplateUpgradeStateIdSchema,n2 as SiteThreadListQuerySchema,s2 as SiteThreadListResponseSchema,a2 as SiteThreadResponseSchema,Ja as SiteVersionIdSchema,AI as SiteVersionListItemSchema,Ti as SiteVersionRecordSchema,ot as SiteWorkflowIdSchema,Mb as SiteWorkflowProgressDataSchema,XO as SiteWorkflowProgressResponseSchema,Ob as SiteWorkflowProgressStatusSchema,Lb as SiteWorkflowProgressStepSchema,jb as SiteWorkflowProgressStepStatusSchema,Xg as SiteWorkflowRecordSchema,TP as SiteWorkflowSnapshotResponseSchema,_o as SiteWorkflowSnapshotSchema,Wg as SiteWorkflowStatusSchema,tr as SiteWorkflowTaskRefIdSchema,kP as SiteWorkflowTaskRefResponseSchema,Wc as SiteWorkflowTaskRefSchema,yq as SitemapAddBlockInputSchema,za as SitemapAnswerSchema,fq as SitemapChangeBlockVariantInputSchema,pT as SitemapDeleteBlockInputSchema,ZI as SitemapDraftBlockSchema,JI as SitemapDraftPageSchema,ad as SitemapDraftRecordSchema,hn as SitemapDraftSchema,lT as SitemapEditActorSchema,_T as SitemapEditErrorCodeSchema,hT as SitemapEditFailureSchema,uT as SitemapEditOperationSchema,Eq as SitemapEditResultSchema,gT as SitemapEditSuccessSchema,Iq as SitemapGenerationInputSchema,xT as SitemapGenerationOutcomeSchema,ET as SitemapGenerationReasonSchema,ed as SitemapGenerationStageSchema,Ae as SitemapIdSchema,ST as SitemapIntentPageSchema,hq as SitemapModelOutputSchema,tT as SitemapModelPageSchema,Sq as SitemapMoveBlockInputSchema,XI as SitemapNavigationHrefSchema,qe as SitemapNodeIdSchema,od as SitemapRecordSchema,_q as SitemapResolverRequestSchema,gq as SitemapResolverResponseSchema,mT as SitemapResolverTargetsSchema,Jp as SitemapRunInputSchema,xn as SitemapSchema,sT as SitemapSourceProvenanceSchema,Tq as SitemapStreamEventSchema,VL as SitemapTaskCreateRequestSchema,JL as SitemapTaskCreateResponseSchema,qx as SitemapTaskFailureErrorCodeSchema,eM as SitemapTaskResponseSchema,dT as SitemapUpdateBlockInstructionInputSchema,bq as SitemapUpdateBlockPropsInputSchema,jI as SitemapUserChoiceSchema,yn as SkillSelectionSchema,MI as SkillSelectionSourceSchema,_d as SnapshotContentHashSchema,Nd as SnapshotEditChangesSchema,Od as SnapshotEditPageChangeSchema,Dd as SnapshotEditSectionChangeSchema,De as SnapshotFilePathSchema,I as SnapshotIdSchema,Et as SnapshotRecordSchema,Wp as SnapshotStatusSchema,sv as StartFillInRequestSchema,IG as StartFillInResponseSchema,dR as StartGa4AuthDataSchema,LU as StartGa4AuthRequestSchema,MU as StartGa4AuthResponseSchema,Ia as StartGscAuthDataSchema,ep as StartGscAuthRequestSchema,tp as StartGscAuthResponseSchema,LP as StartSiteBuildRequestSchema,dN as StartSiteBuildResponseSchema,zb as StartSiteBuildResultSchema,BM as StartSitePublishWorkflowRequestSchema,Qq as StartWorkspaceRunRequestSchema,Zq as StartWorkspaceRunResponseSchema,Xc as Step2AiCrawlabilityAssessmentSchema,Ph as Step2FinalResultDataSourceSchema,Fs as Step2FinalResultRequestSchema,Iw as Step2FinalResultResponseSchema,Rw as Step2FinalResultSaveResponseSchema,Ah as Step2FinalResultSaveResultSchema,xo as Step2FinalResultTypeSchema,Ch as Step2FinalResultViewSchema,Yc as Step2FinalScanCardKeySchema,Eo as Step2FinalScanCardSchema,kh as Step2FinalScanResultSchema,Yn as Step2KnowledgeOpaqueIdSchema,fN as Step2KnowledgeScopeSchema,kt as Step2PageRoleSchema,Aw as Step2PageSelectionRequestSchema,Pw as Step2PageSelectionResponseSchema,Rh as Step2SiteInitializationCrawlerErrorCodeSchema,Eh as Step2SiteInitializationStatusSchema,Ew as Step2SiteInitializationTaskResponseSchema,Ih as Step2SiteInitializationTaskSchema,Ro as Step3AgentAnalysisSchema,Mh as Step3AnalysisFindingSchema,jw as Step3AnalysisJobResponseSchema,em as Step3AnalysisJobSchema,Zc as Step3AnalysisJobStatusSchema,Lw as Step3AnalysisLatestResponseSchema,Qc as Step3AnalysisProgressSchema,Gh as Step3AnalysisResultSchema,Nw as Step3AnalysisScheduleResponseSchema,Lh as Step3AnalysisScheduleSchema,Mw as Step3AnalysisSseFrameSchema,Dw as Step3AnalysisStartRequestSchema,Jc as Step3AnalysisSummarySchema,jh as Step3AnalystSchema,Ow as Step3AnalystsResponseSchema,qw as Step4DiagnosisResponseSchema,As as Step5ActiveStrategyKeySchema,_A as Step5CommitStrategyRequestSchema,gA as Step5CommitStrategyResponseSchema,qu as Step5CommittedVersionSchema,On as Step5DecisionSelectionIdSchema,Lu as Step5EvidenceReferenceSchema,Mu as Step5GenerationStatusSchema,Fu as Step5JobStatusSchema,Rs as Step5KeywordCategorySchema,vu as Step5KeywordEntryEditSchema,vn as Step5KeywordEntrySchema,Ui as Step5KeywordLibrarySchema,sA as Step5KeywordSearchBodySchema,Is as Step5KeywordSelectionSchema,Cs as Step5MarketCountrySchema,ws as Step5MarketTypeSchema,Pr as Step5OptionPresentationSchema,Gi as Step5OutputLocaleSchema,Ou as Step5PromotedBusinessSchema,vs as Step5PromotedBusinessesSchema,pA as Step5RegenerateItemRequestSchema,dA as Step5SaveDecisionRequestSchema,uA as Step5SaveDecisionResponseSchema,fT as Step5SitemapDecisionSchema,yT as Step5SitemapRunInputSchema,bT as Step5SitemapSourceSchema,Rq as Step5SitemapStartRequestSchema,mA as Step5StartStrategyRequestSchema,lA as Step5StartStrategyResponseSchema,Uu as Step5StrategyDecisionInputSchema,Wi as Step5StrategyDecisionSchema,qi as Step5StrategyItemSchema,Dr as Step5StrategyJobSchema,Ps as Step5StrategyKeySchema,Cr as Step5StrategyOptionIdSchema,Nu as Step5StrategyOptionSchema,vr as Step5StrategyPlanSchema,Wu as Step5StrategySnapshotDataSchema,SA as Step5StrategySseFrameSchema,Gu as Step5StrategyVersionSnapshotSchema,ju as Step5StructureDetailSchema,ny as Step6AiThemeCandidateSchema,ti as Step6ColorSeedsSchema,aj as Step6DesignAgentRecommendationsResponseSchema,JN as Step6DesignRecommendationGenerationInputSchema,Zo as Step6DesignRecommendationModelOutputSchema,sy as Step6DesignRecommendationSchema,YN as Step6DesignRecommendationsRequestSchema,XN as Step6DesignRecommendationsResponseSchema,Qm as Step6DesignSelectionSchema,Xm as Step6GeneratedThemeCardSchema,cy as Step6GptDesignRecommendationModelOutputSchema,ev as StopWorkspaceGenerationRequestSchema,tv as StopWorkspaceGenerationResponseSchema,rO as SubsiteCopyEstimateRequestSchema,cO as SubsiteCopyEstimateResponseSchema,db as SubsiteDiffEstimateShape,JD as SubsiteGlossariesSchema,ib as SubsiteGlossaryEntrySchema,Qs as SubsiteHexColorSchema,xO as SubsiteMountPathSchema,pb as SubsitePageEstimateSchema,tO as SubsitePaletteLocalizationSchema,ob as SubsitePaletteModeSchema,ab as SubsitePaletteSeedsSchema,eO as SubsiteSiteInfoSchema,pO as SubsiteSyncDiffComputeRequestSchema,dO as SubsiteSyncDiffComputeResponseSchema,_b as SubsiteSyncDiffErrorCodeSchema,uO as SubsiteSyncDiffErrorResponseSchema,SO as SubsiteVisibleTextExportRequestSchema,fO as SubsiteVisibleTextExportResponseSchema,Ug as TASK_EXECUTION_STATUSES,Gc as TASK_EXECUTION_STATUS_CODES,qG as TEMPLATE_UPGRADE_LOCK_LOST_ERROR_CODE,Xo as THEME_PRESETS,Km as THEME_PRESET_IDS,Lc as TaskExecutionStatusSchema,kb as TemplateUpgradeCasOutcomeSchema,jm as TemplateUpgradeErrorCodeSchema,Ab as TemplateUpgradeOutcomeCountsSchema,Ib as TemplateUpgradeOutcomeSchema,Pb as TemplateUpgradeSnapshotDeletionCandidateSchema,dn as TemplateUpgradeStateSchema,yb as TemplateUpgradeStatusSchema,Tb as TemplateUpgradeValidationStageSchema,Je as TemplateVersionSchema,MG as TryAcquireTemplateUpgradeLockRequestSchema,UG as TryAcquireTemplateUpgradeLockResponseSchema,TS as TypeInputsSchema,Xf as USER_STOPPED_RUN_ERROR_CODES,Tp as UnsplashDownloadLocationSchema,Ip as UnsplashMediaAssetSchema,cG as UpdateBriefRequestSchema,EG as UpdateBriefResponseSchema,Mq as UpdateClarifyArchetypeRequestSchema,VA as UpdateCmsSeoSyncStateRequestSchema,CG as UpdateCurrentSnapshotManifestRequestSchema,HA as UpdatePageDirectoryReconcileStateRequestSchema,KM as UpdateSitePublishWorkflowStepRequestSchema,rG as UpdateSiteRequestSchema,o2 as UpdateSiteThreadRequestSchema,PP as UpdateSiteWorkflowWebsiteRequestSchema,QN as UpdateStep6DesignSelectionRequestSchema,ZN as UpdateStep6DesignSelectionResponseSchema,OP as UpdateWorkflowTaskStatusRequestSchema,HR as UploadMediaLibraryAssetResponseSchema,vM as UpstreamPromptTemplateCatalogDataSchema,CM as UpstreamPromptTemplateConsumeDataSchema,Cx as UrlListCrawlerTaskCreateRequestSchema,kk as UsageRecordIdSchema,QR as UseUnsplashMediaRequestSchema,ZR as UseUnsplashMediaResponseSchema,gk as UserIdSchema,QE as VCP_GSC_STATES,Ra as VcpGscStateSchema,PE as VcpQualityRemediationItemSchema,Yl as VcpQualityResultSchema,ja as VisualHintsSchema,NI as VisualThemeSchema,SS as WEIGHT_STYLE_IDS,cm as WEIGHT_STYLE_PRESETS,IP as WORKFLOW_DEFINITIONS_V1,uo as WORKFLOW_DEFINITION_REGISTRY,jg as WORKFLOW_FLOW_TYPES,Bg as WORKFLOW_MENU_STATES,Lg as WORKFLOW_NODE_CODES,Mg as WORKFLOW_TASK_TYPES,tw as WORKSPACE_ATTACHMENT_BOUND_ERROR_CODE,cw as WORKSPACE_ATTACHMENT_CAPTURE_BUDGET_ERROR_CODE,aw as WORKSPACE_ATTACHMENT_CAPTURE_BUSY_ERROR_CODE,ow as WORKSPACE_ATTACHMENT_CAPTURE_FAILED_ERROR_CODE,rw as WORKSPACE_ATTACHMENT_CAPTURE_TIMEOUT_ERROR_CODE,mw as WORKSPACE_ATTACHMENT_CAPTURE_UNAVAILABLE_ERROR_CODE,ew as WORKSPACE_ATTACHMENT_LIMIT_ERROR_CODE,gh as WORKSPACE_ATTACHMENT_MEDIA_TYPES,QP as WORKSPACE_ATTACHMENT_TARGET_BASE64_BYTES,JP as WORKSPACE_ATTACHMENT_TOO_LARGE_ERROR_CODE,XP as WORKSPACE_ATTACHMENT_UNBOUND_TTL_MS,ZP as WORKSPACE_ATTACHMENT_UNSUPPORTED_FORMAT_ERROR_CODE,iw as WORKSPACE_ATTACHMENT_URL_REJECTED_ERROR_CODE,GC as WORKSPACE_CHECK_INCOMPLETE_ERROR_CODE,Jx as WORKSPACE_FILE_MUTATION_TOOL_NAMES,WC as WORKSPACE_FILL_IN_INTERRUPTED_ERROR_CODE,qC as WORKSPACE_GENERATION_STOPPED_ERROR_CODE,UC as WORKSPACE_MAX_PAGE_ATTEMPTS,MC as WORKSPACE_MAX_RESUME_COUNT,LC as WORKSPACE_RUN_HEARTBEAT_INTERVAL_MS,jC as WORKSPACE_RUN_LEASE_MS,BC as WORKSPACE_RUN_LEASE_SUPERSEDED_ERROR_CODE,KC as WORKSPACE_RUN_NOT_ACTIVE_ERROR_CODE,FC as WORKSPACE_RUN_RESUME_EXHAUSTED_ERROR_CODE,sw as WORKSPACE_URL_CAPTURE_WINDOW_MS,p2 as WORKSPACE_WEBSOCKET_CONTRACT,Be as WeightStyleIdSchema,Nc as WorkflowClientCapabilitiesSchema,qc as WorkflowDefinitionVersionSchema,on as WorkflowFlowTypeSchema,Yg as WorkflowMenuItemSchema,Kg as WorkflowMenuStateSchema,Tt as WorkflowNodeCodeSchema,jc as WorkflowTaskTypeSchema,pw as WorkspaceAttachmentFromUrlRequestSchema,bo as WorkspaceAttachmentMediaTypeSchema,lw as WorkspaceAttachmentSchema,YT as WorkspaceClientMessageSchema,nI as WorkspaceDesignApplyRequestSchema,sI as WorkspaceDesignApplyResponseSchema,iI as WorkspaceDesignCurrentResponseSchema,$a as WorkspaceDiagnosticSchema,ik as WorkspaceDirectEditFileSchema,sk as WorkspaceDirectEditPathSchema,fd as WorkspaceDirectEditPostActionSchema,_2 as WorkspaceDirectEditRequestSchema,h2 as WorkspaceDirectEditResponseSchema,Va as WorkspaceExecutionDiagnosticsSchema,Gq as WorkspaceExecutionPlanSchema,fr as WorkspaceGenerationLedgerEventSchema,wn as WorkspaceGenerationLedgerSchema,nk as WorkspaceMediaRequestSchema,Gd as WorkspaceOmissionKindSchema,qd as WorkspaceOmissionReasonSchema,Sr as WorkspaceOmissionSchema,fm as WorkspacePageCheckpointSchema,Bd as WorkspacePageOutcomeSchema,Wd as WorkspacePageResultSchema,Qa as WorkspacePlanDependencySchema,md as WorkspacePlanSummarySchema,DT as WorkspacePlanTaskKindSchema,Xa as WorkspacePlanTaskSchema,Cg as WorkspaceResourceKindSchema,Dg as WorkspaceResourceNavigationSelectionSchema,Oc as WorkspaceResourceOperationClientMessageSchema,pd as WorkspaceResourceOperationCompletionSchema,vg as WorkspaceResourceOperationSummarySchema,Og as WorkspaceResourceOperationTransientInputSchema,js as WorkspaceResourcePageCopySchema,ZC as WorkspaceRunControlInputResponseSchema,VC as WorkspaceRunHeartbeatRequestSchema,YC as WorkspaceRunHeartbeatResponseSchema,ki as WorkspaceRunKindSchema,qS as WorkspaceRunResumePrincipalSchema,VT as WorkspaceSelectedComponentSchema,QT as WorkspaceServerMessageSchema,xq as WorkspaceSitemapEditRequestSchema,$T as WorkspaceSocketDescriptorSchema,lk as WorkspaceSourceFileBinaryResponseSchema,ck as WorkspaceSourceFileKindSchema,yd as WorkspaceSourceFileListItemSchema,S2 as WorkspaceSourceFilePathQuerySchema,f2 as WorkspaceSourceFileResponseSchema,mk as WorkspaceSourceFileTextResponseSchema,bd as WorkspaceSourcePathSchema,kT as WorkspaceSuggestionSchema,rd as WorkspaceSuggestionsSchema,AT as WorkspaceSuggestionsSourceSchema,ld as WorkspaceTaskCountsSchema,l2 as WorkspaceWebSocketMessageSchema,m2 as WorkspaceWebSocketMessageTypeSchema,Ya as WorkspaceWorkerGroupSchema,Ha as WorkspaceWorkerPhaseSchema,qq as WorkspaceWorkerResultSchema,Yt as WorkspaceWorkerStatusSchema,vj as applicationTemplateCatalogDataSchema,Cj as applicationTemplateConsumeDataSchema,wj as applicationTemplateV1Schema,Yw as assertDeploymentTransition,YU as assertFillInTargetsOmitted,qP as assertSiteBuildStatusTransition,GP as assertTaskExecutionStatusTransition,vo as availableFontWeights,JS as breadcrumbClassName,WL as buildCmsIdentityHeaders,$U as buildE2bBrowserPreviewUrl,ZM as buildFinalSitePublishQualityResult,ej as buildStep6FallbackThemeCards,tN as canEnterLauncher,nN as canPublishSite,ha as canonicalizeFormDesignJson,DM as canonicalizeLauncherPromptTemplateOperation,lc as canonicalizePageSlug,AC as checkGlobalsCssEdit,so as classifySiteEditPropertyName,jA as cmsPagePreviewUrlPath,yA as compareTemplateVersions,iD as composeSiteEditRepeatInstanceKey,xL as computeFormDesignOperationFingerprint,Di as computeSiteEditCompositionKey,W_ as computeSiteEditSourceIdentityKey,ms as containsSensitiveData,l0 as countLedgerAccessiblePages,p0 as countLedgerProcessedPages,jR as countSitemapStructure,D_ as createSiteEditCommandFailureSchema,pc as createSiteEditCommandResultSchema,to as createSiteEditCommandSuccessSchema,Pq as createSiteSitemapDraftCreationKey,fw as createSitemapResolverAnswerSheetSchema,nj as defaultStep6Selection,eR as deriveVcpGscState,tR as doesGscPropertyMatchDomain,FR as estimateNavLabelWidth,th as findWorkflowDefinition,eh as findWorkflowDefinitionInRegistry,Po as fontStack,_x as formDesignOperationFingerprintInput,AS as formatSiteDesignNotes,Rv as generateDetailBreadcrumb,Xw as getDeploymentHappyPathTransitions,$w as getDeploymentTransitionPredecessors,Hw as getDeploymentTransitionTargets,rm as getFontPairing,Bm as getMotionPreset,hi as getQualityCheckOutcome,$m as getSiteDesignThemeRadius,ji as getSiteEditSourceDeleteProtectionReason,XM as getSitePublishRepairItems,eU as getSitePublishSafetyAssessment,UN as getThemePreset,nh as getWorkflowDefinition,UP as getWorkflowNodeIndex,t0 as hasAnyBusinessFact,Hn as hasDesignTokenBlock,sO as hasLockedSeeds,yL as hashAffectedFormDesignFiles,bL as hashCmsFormSchemaProjection,mi as hashFormDesignJson,fL as hashFormSpec,CR as homeLabelForLocale,xM as isCanonicalFileMutationToolName,cc as isCanonicalPageSlug,Gb as isCmsMainProductsWithinLimit,oI as isCmsNavigationHref,NA as isCmsPageSelectable,qr as isCmsTemplateUrlPath,x0 as isConsentGranted,nS as isDeploymentActiveStatus,Vw as isDeploymentTerminalStatus,Jf as isExactEditEngineVersion,Ok as isExternalSiteEditInfrastructureReason,qD as isFontLicenseBuildErrorCode,tL as isFormSpecLocalizableFieldPath,hA as isKnownStep5SseEventName,xv as isMigrationProductsPresetBlockLabel,yv as isMigrationProductsPresetPageTitle,eE as isModelFileMutationToolName,fu as isNextPageCodeErrorCode,Z0 as isNonLatinSiteLocale,us as isPageTemplateCandidateEntryPath,NL as isPlatformMaterializedFile,bb as isReservedSubsiteMountSegment,pu as isSiteEditDesignDocumentPath,Vu as isSiteEditMaterializationPathTemplate,zf as isSiteEditRuntimeContainerTag,Hf as isSiteEditRuntimeTextTag,DD as isSiteEditRuntimeVoidElementTag,K0 as isSiteEditSourceDeleteProtectedPath,lu as isSiteEditSourceDirectoryPath,Er as isSiteEditSourcePath,Ni as isSiteEditTextSourcePath,UE as isSitePublishQualityItemIssue,QM as isSitePublishRepairResultSuccessful,wL as isSiteStructureKnownFieldPath,PL as isSiteStructureLocalizableFieldPath,cA as isStep5RequiredStrategyKey,bi as isTopLevelPage,WD as isUserStoppedRunErrorCode,FP as isWorkflowTaskTypeForNode,yM as isWorkspaceFileMutationToolName,lp as listChildPages,xf as makeSiteEditRepeatInstanceKey,DR as markAllPagesInHeader,mL as mergeCmsFormDisplay,fv as migrationProductsCopyForLocale,bv as migrationProductsKnownCopies,vR as moreLabelForLocale,GR as navLabelCollisionKey,Fj as normalizeCmsApplicationSlug,Px as normalizeCmsPublicApiBase,gl as normalizeFormOptionLabelIdentity,as as normalizeGscDomain,pr as normalizePageTemplatePagePath,fi as normalizeStructureTitle,NR as orderNavigationLinksByStructure,pp as orderSitemapPagesForDisplay,C_ as pageSlugToRouteFilePath,LA as parseCmsPageDirectory,lv as parseComponentI18nResourcesJson,kR as parseE2bPreviewProxyDomain,eb as parseExactEditEngineVersion,D0 as parseSiteEditCompositionKey,Ef as parseSiteEditRepeatInstanceKey,j1 as parseSiteEditSourceIdentityKey,yo as parseWorkspaceAttachmentImagePath,cL as projectFormSpecToCmsDisplay,rL as projectFormSpecToCmsSchema,US as readColorScheme,Ws as readDesignTokens,RC as readGlobalsDesignValues,pm as readSiteDesignNotes,uw as readWorkspaceAttachmentReferences,AR as reconcileSitemapNavigation,GL as resolveCmsPublicRuntimeBinding,cS as resolveFont,an as resolveFontDisplayName,aL as resolveFormTemplateText,MP as resolvePublishedWorkflowDefinition,r0 as resolveRedisConnectionConfig,YD as resolveRequestedEditEngineVersion,Ar as resolveSelectableSiteLocale,OD as resolveSiteEditRuntimeOperationSummary,Q0 as resolveSiteLocaleFromIso6393,X0 as resolveSiteTextDirection,oy as resolveStep6RadiusId,ay as resolveStep6WeightStyle,XD as resolveSystemCurrentEditEngineVersion,Wj as resolveTemplateFormScene,pC as resolveTryOnFontWeights,sh as selectPublishedWorkflowDefinition,P0 as selectReferenceVisualImage,hP as siteBuildStatusFromCode,yP as siteBuildStatusToCode,SP as siteDeploymentStatusFromCode,xP as siteDeploymentStatusToCode,gS as siteFontVariables,RS as siteLeadingBody,lC as siteLeadingHeadingVariables,mC as siteWeightVariables,fP as siteWorkflowStatusFromCode,EP as siteWorkflowStatusToCode,sb as splitSubsiteGlossaryEntry,ry as step6GptVisualIdentity,gC as stripSiteDesignNotes,oD as stripSiteEditRepeatInstanceKeys,bP as taskExecutionStatusFromCode,RP as taskExecutionStatusToCode,tj as toStep6GenerationVisualHints,mc as tryCanonicalizeAsciiPageSlug,hC as upsertSiteDesignNotes,Rm as validateComponentI18nResources,nL as validateFormSpecIdentityTransition,LR as validateSitemapStructure,ub as validateSubsiteDiffEstimates,cP as validateWorkspaceResourcePageCopy,dw as workspaceAttachmentImagePath,EC as writeColorScheme,xC as writeDesignTokens};
|