@vcp-dev/contracts 0.10.25 → 0.10.27
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/cms-navigation.d.ts +21 -0
- package/dist/connect-form.d.ts +1 -0
- package/dist/designer-component-library.d.ts +1 -0
- package/dist/designer-page-library.d.ts +6 -0
- package/dist/form-design.d.ts +26 -0
- package/dist/index.d.ts +193 -4
- package/dist/index.js +8 -8
- package/dist/knowledge-category.d.ts +9 -12
- package/dist/knowledge-source-readiness.d.ts +14 -39
- package/dist/site-edit-event.d.ts +1 -0
- package/dist/site-edit-materialization.d.ts +1 -0
- package/dist/site-edit-operation.d.ts +82 -0
- package/dist/site-edit-render-document.d.ts +9 -0
- package/dist/site-edit-version.d.ts +1 -1
- package/dist/step5-strategy.d.ts +31 -31
- package/dist/workspace-resource-operation.d.ts +50 -0
- 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 ud}from"zod";var Q=ud.uuidv7(),XT=Q,QT=Q,ZT=Q,JT=Q,ek=Q,tk=Q,nk=Q,k=Q,Yt=Q,Wa=Q,ke=Q,Ri=Q,I=Q,Ba=Q,$=Q,Ka=Q,st=Q,rs=Q,lt=Q,sk=Q,ik=Q,cs=Q,it=Q,za=Q,ok=Q,ak=Q,rk=Q,En=Q,ck=Q,mk=Q,lk=Q;var Ha=Q,Ii=j.enum(["external_site_edit","page_template_create"]),_d=200,Lt=j.string().min(1).max(_d),gd=4e3,$a=j.enum(["succeeded","degraded","no_changes","failed"]),Rn=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"]),In=j.object({code:j.enum(["preexisting_placeholder_media"]),block_ids:j.array(j.string().min(1))}).strict(),hd=["sandbox_unavailable"];function _k(e){return e!=null&&hd.includes(e)}var Sd=j.enum(["pending","delivered","failed"]),fd=j.enum(["running","succeeded","degraded","no_changes","failed"]),gk=j.object({site_id:k,external_run_id:Lt,external_thread_id:Lt,prompt:j.string().min(1).max(gd),thread_title:j.string().trim().min(1).max(200).optional()}).strict(),Ti=j.enum(["added","modified","deleted"]),bd=j.enum(["landing_page","general_page","detail_page"]),yd=j.enum(["header","footer","styles","layout"]),Va={block_id:j.string().min(1),type:j.string().min(1),change:Ti},Ya={slug:j.string().min(1),title:j.string().min(1),page_type:bd,change:Ti},xd=j.object({kind:yd,change:Ti}).strict(),Xa={site_wide:j.array(xd),unclassified_count:j.number().int().nonnegative()},Ed=j.object(Va).strict(),Rd=j.object({...Ya,sections:j.array(Ed)}).strict(),Id=j.object({pages:j.array(Rd),...Xa}).strict(),Td=j.object({...Va,label:j.string().min(1)}).strict(),kd=j.object({page_id:j.number().int().positive().nullable(),...Ya,sections:j.array(Td)}).strict(),Qa=j.object({pages:j.array(kd),...Xa}).strict(),hk={pages:[],site_wide:[],unclassified_count:0},Sk=j.object({base_snapshot_id:I,target_snapshot_id:I}).strict(),fk=j.object({data:Id}).strict(),ms=j.object({id:Ha,execution_scene:Ii.default("external_site_edit"),site_id:k,external_run_id:j.string().min(1).nullable(),external_thread_id:j.string().min(1).nullable(),status:fd,outcome:$a.nullable(),degraded_reason:Rn.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:Sd.nullable(),created_at:j.string().min(1),started_at:j.string().min(1).nullable(),finished_at:j.string().min(1).nullable(),changes:Qa.nullable().default(null),advisories:j.array(In).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"})}),bk=j.object({task:ms}).strict(),yk=j.object({task:ms}).strict(),xk=j.object({task_id:Ha,external_run_id:j.string().min(1),external_thread_id:j.string().min(1),site_id:k,vcp_run_id:$.nullable(),outcome:$a,degraded_reason:Rn.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:Qa.nullable().default(null)}).strict(),Ek=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"}),Tn=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 Za(e){return/^\[\[\.\.\.[^\[\]]+\]\]$|^\[[^\[\]]+\]$/.test(e)}function ls(e){let n=/^(?:src\/)?app\/\.vcp\/page-templates\/(.+)\/page\.tsx$/.exec(e);if(!n)return!1;let s=n[1].split("/"),i=s.some(Za),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)||!Tn.safeParse(`/${a.join("/")}`).success||a.some(c=>c?c.includes("[")||c.includes("]")?!Za(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 Ja=re.object({page_path:Tn,template_id:Xe,instruction:re.string().min(1).refine(e=>e.trim().length>0)}).strict(),er=3;function tr(e){return e.replace(/\/+$/,"")||"/"}var Ak=re.object({external_run_id:Lt,external_thread_id:Lt,items:re.array(Ja).min(1).max(er)}).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:tr(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)})}),nr=re.object({items:re.array(Ja).min(1).max(er)}).strict().refine(e=>e.items.every(n=>n.page_path===tr(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"}),sr=e=>[...new Set(e)],Pk=re.object({page_path:Tn,template_id:Xe,exit_template_ids:re.array(Xe).default([]).transform(sr)}).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"}),wk=re.object({page_path:Tn,template_ids:re.array(Xe).min(1).transform(sr)}).strict(),ir={ok:re.literal(!0),site_id:k,page_path:Tn,route_id:re.string().min(1),snapshot_id:I,advisories:re.array(In).default([])},Ad=ms.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)}),Ck=re.object({task:Ad}).strict(),vk=re.object({...ir,promoted_template_id:Xe,deleted_template_ids:re.array(Xe),status:re.literal("promoted")}).strict(),Dk=re.object({...ir,deleted_template_ids:re.array(Xe),status:re.literal("cleaned")}).strict(),Ok=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 ps}from"zod";var or=ps.object({primary_products:ps.string().trim().min(1).max(1e3).optional(),current_markets:ps.string().trim().min(1).max(1e3).optional(),qualifications:ps.string().trim().min(1).max(1e3).optional()}).strict();function Lk(e){return Object.values(e).some(n=>typeof n=="string"&&n.trim().length>0)}import{z as pt}from"zod";var ar={autoplay:pt.boolean().optional(),intervalMs:pt.number().int().min(5e3).max(15e3).optional(),loop:pt.boolean().optional()},ds=pt.discriminatedUnion("kind",[pt.object({kind:pt.literal("media-carousel"),presentation:pt.enum(["flat","angled"]).optional(),...ar}).strict(),pt.object({kind:pt.literal("category-carousel"),...ar}).strict()]);import{z as kn}from"zod";var Pd=40,Mt=kn.object({protocol:kn.enum(["phone","form","download","route","external"]),ctaLabel:kn.string().min(1).max(Pd),ctaTarget:kn.string().min(1).max(200).optional(),requiresOwnerDetail:kn.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 Wk(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:wd(e.VCP_REDIS_PORT,56379)}}function wd(e,n){if(!e)return n;let s=Number(e);return Number.isInteger(s)&&s>0?s:n}import{z as oe}from"zod";var Cd=oe.enum(["component","page","shared"]),vd=oe.enum(["generation_failed","repair_exhausted","page_unusable","check_incomplete","design_missing","chrome_fallback","style_fallback","resume_exhausted","user_stopped","conflict"]),rr=oe.object({kind:Cd,target_id:oe.string().min(1),page_id:oe.string().min(1).nullable(),reason:vd,repair_attempts:oe.number().int().nonnegative(),message:oe.string().min(1),filled:oe.boolean().optional()}).strict(),Dd=oe.enum(["complete","partial","omitted","check_incomplete","pending"]),Od=oe.object({page_id:oe.string().min(1),slug:oe.string().min(1),title:oe.string().min(1),parent_page_id:oe.string().min(1).nullable(),result:Dd,attempts:oe.number().int().nonnegative(),omissions:oe.array(rr)}).strict(),An=oe.object({schema_version:oe.literal(1),sitemap_id:oe.string().min(1),confirmed_page_ids:oe.array(oe.string().min(1)).min(1),pages:oe.array(Od),shared:oe.array(rr),stopped_by_user:oe.boolean(),resume_count:oe.number().int().nonnegative(),home_replaced_by:oe.string().min(1).nullable(),updated_at:oe.string().min(1)}).strict(),cr=oe.object({type:oe.literal("workspace.generation_ledger"),ledger:An,at:oe.string().min(1)}).strict();function zk(e){return e.pages.filter(n=>n.result==="complete"||n.result==="partial").length}function Hk(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 ki=F.enum(["text","url","document","image"]),Ai=F.enum(["pending","ready","failed"]),Nd=F.enum(["pending","ready","failed"]),jd=F.enum(["product","price","contact","copy","audience","other"]),us=F.object({fact:F.string().min(1).max(300),kind:jd,source_id:En,quote:F.string().min(1).max(500),trust:F.enum(["verbatim","ocr"]).default("verbatim")}),Ld=F.object({page_type:F.string().min(1).max(40),sections:F.array(F.string().min(1).max(40)).max(12)}),_s=F.object({source_id:En,nav_structure:F.array(F.string().min(1).max(30)).max(12),page_patterns:F.array(Ld).max(10),tone:F.array(F.string().min(1).max(20)).max(8),screenshot_ref:F.string().optional()}),Md=F.object({source_id:En,type:ki,status:Ai,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()}),gs=F.object({topic:F.string().min(1).max(80),variants:F.array(F.object({value:F.string().min(1).max(300),source_id:En})).min(2)}),Ud=F.object({type:F.literal("text"),content:F.string().min(20).max(1e4),title:F.string().min(1).max(120).optional()}).strict(),Fd=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(),Xk=F.discriminatedUnion("type",[Ud,Fd]),Qk=[".docx",".html",".md",".txt"],Zk=["application/vnd.openxmlformats-officedocument.wordprocessingml.document","text/html","text/markdown","text/x-markdown","text/plain","application/octet-stream"],Jk=10*1024*1024,e0=2,t0=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 n0(e){return e===!0||e==="true"}var s0=[".png",".jpg",".jpeg",".webp"],i0=["image/png","image/jpeg","image/webp","application/octet-stream"],o0=8*1024*1024,a0=10,Gd=F.enum(["asset","reference"]),r0=F.object({image_role:Gd,title:F.string().min(1).max(120).optional()}).strict(),c0=F.object({version:F.literal(1),site_id:k,tenant_id:F.string().min(1),user_prompt:F.string(),status:Nd,sources:F.array(Md).max(16),facts:F.array(us).max(120),reference:_s.optional(),conflicts:F.array(gs).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 m0(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 hs}from"zod";var ge=hs.object({routeId:hs.string().min(1),templateId:Xe.optional()}).strict(),B=hs.object({routeId:hs.string().min(1),effectiveTemplateId:Xe.optional()}).strict();function Pi(e){return JSON.stringify([e.routeId,e.effectiveTemplateId??null])}function u0(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=B.safeParse(i===null?{routeId:s}:{routeId:s,effectiveTemplateId:i});return o.success?o.data:null}var qd=["design.md","DESIGN.md"],mr=["components/site","src/components/site","lib/generated","src/lib/generated","public"],Wd=["components/system/not-found-content.tsx","src/components/system/not-found-content.tsx"],Bd=["app/globals.css","src/app/globals.css"],Kd=[".cjs",".css",".cts",".html",".js",".json",".jsx",".md",".mdx",".mjs",".mts",".ts",".tsx",".txt",".yaml",".yml"],zd=new Set(Kd),wi="source-delete",lr=L.literal(wi),Ee=L.string().min(1).refine(dr,"Invalid site edit source path"),Hd=L.string().min(1).refine(eu,"Invalid site edit source directory path"),f0=L.enum(["text","binary"]),Ss=L.object({composition:B,path:Ee,language:L.string().min(1).nullable(),sizeBytes:L.number().int().nonnegative(),contentHash:L.string().min(1).optional()}).strict(),$d=L.discriminatedUnion("kind",[Ss.extend({kind:L.literal("text"),language:L.string().min(1),readonly:L.boolean().default(!1)}),Ss.extend({kind:L.literal("binary"),language:L.null(),mimeType:L.string().min(1).optional(),readonly:L.literal(!0)})]),pr=L.lazy(()=>L.discriminatedUnion("kind",[L.object({kind:L.literal("directory"),name:L.string().min(1),path:Hd,children:L.array(pr)}),L.object({kind:L.literal("file"),name:L.string().min(1),path:Ee,file:$d}).superRefine((e,n)=>{e.path!==e.file.path&&n.addIssue({code:"custom",path:["file","path"],message:"file.path must match node path"})})])),Vd=L.enum(["max-files","max-depth","max-total-bytes"]),Yd=L.object({reasons:L.array(Vd).min(1),maxFiles:L.number().int().positive(),maxDepth:L.number().int().positive(),maxTotalBytes:L.number().int().positive()}),b0=L.object({composition:B,nodes:L.array(pr),defaultPath:Ee.optional(),totalFiles:L.number().int().nonnegative(),truncated:Yd.optional()}).strict(),y0=L.object({composition:ge}).strict(),x0=L.object({path:Ee,composition:ge}).strict(),Xd=Ss.extend({kind:L.literal("text"),language:L.string().min(1),readonly:L.boolean().default(!1),content:L.string()}),Qd=L.enum(["too-large","unsupported-mime","bytes-unavailable"]),Zd=Ss.extend({kind:L.literal("binary"),language:L.null(),readonly:L.literal(!0),mimeType:L.string().min(1),contentBase64:L.string().min(1).optional(),previewUnavailableReason:Qd.optional()}),E0=L.discriminatedUnion("kind",[Xd,Zd]),R0=L.object({key:L.string().min(1),composition:ge}).strict(),Jd=L.object({startLine:L.number().int().positive(),startColumn:L.number().int().nonnegative(),endLine:L.number().int().positive(),endColumn:L.number().int().nonnegative()}),I0=L.object({key:L.string().min(1),composition:B,sourceFile:Ee,componentName:L.string().min(1),openingElementRange:Jd,structuralPath:L.string().min(1),textPreview:L.string().min(1).optional()}).strict();function dr(e){return!fs(e)&&!nu(e)||ou(e)?!1:Di(e)||gr(e)||_r(e)||ur(e)||mr.some(n=>e===n||e.startsWith(`${n}/`))}function Ci(e){return Di(e)||zd.has(iu(e))}function eu(e){return!fs(e)&&!su(e)||au(e)?!1:e==="app"||e.startsWith("app/")||e==="src"||e==="src/app"||e.startsWith("src/app/")||mr.some(n=>e===n||e.startsWith(`${n}/`)||n.startsWith(`${e}/`))}function tu(e){return Di(e)}function vi(e){return dr(e)?tu(e)?"design-document":_r(e)?"route-entry":gr(e)?"app-global-style":e.toLowerCase()==="lib/generated/media-assets.ts"||e.toLowerCase()==="src/lib/generated/media-assets.ts"?"generated-media-manifest":ur(e)?"system-page":null:null}function ur(e){return Wd.includes(e)}function T0(e){return vi(e)!==null}function _r(e){return/^(?:src\/)?app\/(?:.*\/)?page\.[cm]?[jt]sx?$/.test(e.toLowerCase())}function nu(e){return ls(e)&&fs(e.replace("/.vcp/","/_vcp/"))}function su(e){return/^(?:src\/)?app\/\.vcp(?:\/page-templates(?:\/.+)?)?$/i.test(e)?fs(e.replace("/.vcp","/_vcp")):!1}function gr(e){return Bd.some(n=>n.toLowerCase()===e.toLowerCase())}function iu(e){let n=e.split("/").at(-1)??e,s=n.lastIndexOf(".");return s>0?n.slice(s).toLowerCase():""}function Di(e){return!e.includes("/")&&qd.some(n=>n.toLowerCase()===e.toLowerCase())}function ou(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 au(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 fs(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 Ae}from"zod";var hr=Ae.string().min(1).max(320).refine(e=>!e.includes("..")&&/^(?:(?:src\/)?(?:app|pages|components|lib|hooks|utils|types)\/|next\.config\.)[\w./()[\]@-]+$/.test(e)),ru=Ae.union([hr,Ae.string().max(320).regex(/^\.next\/[\w./()[\]@-]+\.js$/).refine(e=>!e.includes(".."))]),Oi=Ae.object({code:Ae.enum(["NEXT_PAGE_CODE_ERROR","NEXT_CLIENT_COMPONENT_FUNCTION_PROP"]),message:Ae.string().min(1).max(2e3),messages:Ae.array(Ae.string().min(1).max(2e3)).max(3),source_paths:Ae.array(hr).max(8),components:Ae.array(Ae.string().max(80).regex(/^[\w.$-]+$/)).max(8),stack:Ae.array(Ae.object({file:ru,line:Ae.number().int().positive(),column:Ae.number().int().nonnegative(),function:Ae.string().max(80),generated:Ae.boolean()}).strict()).max(8)}).strict();function cu(e){return e==="NEXT_PAGE_CODE_ERROR"||e==="NEXT_CLIENT_COMPONENT_FUNCTION_PROP"}import{z as mu}from"zod";var Pn=["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"],lu=["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"],pu=[...Pn,...lu],du=new Set(["ar","fa","he"]),C0=[{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"}],uu={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"},_u=new Set(Pn);function Sr(e){return _u.has(e)?e:uu[e]}var gu="en";function v0(e){let n=e.toLowerCase().split("-",1)[0]??"";return du.has(n)?"rtl":"ltr"}var hu={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 D0(e){return hu[e]??gu}var Su=["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"],fu=new Set(Su);function O0(e){return fu.has(e)}var Re=mu.enum(pu);import{z as bu}from"zod";var bs=bu.string().uuid();import{z as S}from"zod";import{z as J}from"zod";var Et=J.string().trim().min(1).max(128),Qt=J.string().trim().min(1).max(500),yu=["\u4EA7\u54C1","\u90E8\u4EF6/\u8017\u6750","\u5E94\u7528\u65B9\u6848","\u5B9A\u5236/OEM","\u670D\u52A1","\u8D44\u8D28/\u80FD\u529B"],ys=J.enum(yu),wn=J.object({id:Et,keyword:J.string().trim().min(1).max(255),business_ids:J.array(Et).min(1),category:ys,selling_points:J.string().trim().max(2e3),intent:Qt,semantic_group:Et,monthly_volume:J.number().int().min(1),keyword_difficulty:J.number().min(0).max(100).nullable(),variants:J.array(J.string().trim().min(1).max(255)),source:J.literal("semrush"),source_evidence:J.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"})}),Ni=J.object({schema_version:J.literal(1),snapshot_id:Et,dependency_hash:J.string().regex(/^[a-f0-9]{64}$/),language:J.string().trim().min(2).max(35),database:J.string().regex(/^[a-z]{2}$/),generated_at:J.string().datetime({offset:!0}),entries:J.array(wn),candidates:J.array(wn),search_result_ids:J.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"})}}),xu=J.object({entry_id:Et,category:ys,selling_points:J.string().trim().max(2e3)}).strict(),xs=J.object({snapshot_id:Et,entry_ids:J.array(Et),entry_edits:J.array(xu).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"})})}),U0=J.object({expected_revision:J.number().int().nonnegative(),business_subject:J.string().trim().min(1).max(255)}).strict(),fr=J.object({points:J.array(Qt).length(3),comparison:J.array(J.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),ji=S.string().trim().max(200),Es=S.string().regex(/^[a-f0-9]{64}$/),Li=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,Eu=["keywords"],Cn=Zt.filter(e=>!Eu.includes(e)),Rs=Cn.length,Is=S.enum(Zt);function B0(e){return Cn.some(n=>n===e)}var Ts=Is,br=["recommended","conservative","focused"],yr=S.enum(br),vn=S.union([yr,S.literal("confirmed")]),ks=S.enum(["single_country","regional_combination","multi_market"]),As=S.object({code:S.string().trim().regex(/^[A-Z]{2}$/),name_zh:Ut,name_en:Ut,region:Ut}).strict(),Ru=S.object({id:ot,name:S.string().trim().min(1).max(255),category:ys}).strict(),Ps=S.array(Ru).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."})}),xr=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."})})}),Iu=S.object({id:yr,presentation:fr.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:Re.nullish(),market_type:ks.nullish(),markets:S.array(As).max(32).optional(),promoted_businesses:Ps.optional(),plan:xr.nullish()}).loose(),Tu=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(),ku=S.object({source_type:S.enum(["step2","step3"]),source_id:ot,field_path:S.string().trim().max(300).nullish()}).strict(),Au=S.enum(["ok","degraded"]),Mi=S.object({key:Ts,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(Iu).max(3),keyword_library:Ni.nullish(),plan:xr.nullish(),structure_detail:Tu.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(ku).min(1).max(8),generation_status:Au.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!==br[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 h=`${m.category}\0${m.name.normalize("NFKC").toLocaleLowerCase()}`,P=i.get(h);P&&P!==m.id?n.addIssue({code:"custom",path:["options",c,"promoted_businesses",r],message:"A promoted business must keep its stable ID."}):i.set(h,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."})}),Pu=S.object({item_key:Is,selected_option_id:vn,note:ji,keyword_selection:xs.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"})}),Ui=S.object({item_key:Is,selected_option_id:vn,note:ji,keyword_selection:xs.optional(),keyword_library:Ni.optional(),market_type:ks.nullish(),markets:S.array(As).max(32).optional(),promoted_businesses:Ps.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."})}),wu=S.enum(["running","succeeded","failed"]),Cu=S.object({schema_version:S.literal(1),source_job_id:ot,site_id:ot,output_locale:Li.optional(),items:S.array(Mi).length(Ne),decisions:S.array(Ui).min(Rs).max(Ne)}).loose(),vu=S.object({strategy_version_id:ot,site_id:ot,source_job_id:ot,output_locale:Li.optional(),version:S.number().int().positive(),checksum:Es,snapshot:Cu,committed_at:S.string().datetime({offset:!0})}).loose(),Er=S.object({job_id:ot,site_id:ot,output_locale:Li.optional(),status:wu,keyword_library_needs_update:S.boolean().optional(),revision:S.number().int().nonnegative(),items:S.array(Mi).max(Ne),decisions:S.array(Ui).max(Ne),output_checksum:Es.nullish(),error_code:S.string().trim().max(64).nullish(),error_message:S.string().trim().max(500).nullish(),committed_version:vu.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."})}),K0=S.object({force_refresh:S.boolean().optional().default(!1)}).strict(),z0=Er.extend({cached:S.boolean()}).strict(),H0=S.object({expected_revision:S.number().int().nonnegative()}).strict(),$0=S.object({expected_revision:S.number().int().nonnegative(),selected_option_id:vn,note:ji,keyword_selection:xs.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"})}),V0=S.object({revision:S.number().int().positive(),decision:Ui}).strict(),Y0=S.object({idempotency_key:S.string().trim().min(8).max(128),expected_revision:S.number().int().nonnegative(),decisions:S.array(Pu).min(Rs).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."}),Cn.forEach(i=>{s.includes(i)||n.addIssue({code:"custom",path:["decisions"],message:`Step5 commit is missing ${i}.`})})}),X0=S.object({strategy_version_id:ot,version:S.number().int().positive(),checksum:Es,next_path:S.string().trim().min(1).max(500)}).strict(),Du=Er.extend({completed:S.number().int().min(0).max(Ne),total:S.literal(Ne)}).loose(),Ou=["snapshot","strategy_item_start","strategy_item_done","strategy_items_invalidated","strategy_generation_done","failed"];function Q0(e){return typeof e=="string"&&Ou.includes(e)}var Z0=S.discriminatedUnion("event",[S.object({id:S.number().int().nonnegative(),event:S.literal("snapshot"),data:Du}).strict(),S.object({id:S.number().int().positive(),event:S.literal("strategy_item_start"),data:S.object({key:Is,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:Mi}).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:Es}).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:Ts.optional()}).loose()}).loose()]);import{z as Nu}from"zod";var Ze=Nu.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 tA(e,n){let s=Ze.safeParse(e),i=Ze.safeParse(n);if(!s.success||!i.success)return null;let o=Rr(s.data),a=Rr(i.data);for(let r=0;r<3;r+=1){let m=Ir(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 h=/^\d+$/u.test(m),P=/^\d+$/u.test(x);return h&&P?Ir(BigInt(m),BigInt(x)):h?-1:P?1:ju(m,x)}return 0}function Rr(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 Ir(e,n){return e<n?-1:e>n?1:0}function ju(e,n){return e<n?-1:e>n?1:0}import{z as Z}from"zod";import{z as De}from"zod";var Fi=64,Lu=512*1024,Gi=4*1024*1024,Mu=/^(?!\/)(?!.*\\)(?!.*(?:^|\/)\.\.(?:\/|$))(?!.*\/\/).+/;function Uu(e){return Mu.test(e)}var Tr=De.string().min(1).refine(Uu,{message:"Materialization pathTemplate must be a safe relative path."}),Fu=De.object({pathTemplate:Tr,content:De.string(),role:De.string().min(1).optional()}).strict(),Gu=De.union([De.object({kind:De.literal("default")}).strict(),De.object({kind:De.literal("named"),name:De.string().min(1)}).strict()]),qu=De.object({pathTemplate:Tr,export:Gu}).strict(),Wu=De.array(De.never()).optional(),Ft=De.object({instanceBaseName:De.string().min(1),files:De.array(Fu).min(1).max(Fi),entry:qu,dataRequirements:Wu}).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>Lu&&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>Gi&&n.addIssue({code:"custom",path:["files"],message:"Materialization exceeds the total content byte limit."})});var kr="insertNewComponent",rA={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"},qi=Z.number().int().positive().refine(Number.isSafeInteger,"Must be a safe positive integer"),Ar=Z.lazy(()=>Z.object({id:Z.string().uuid(),key:Z.string().min(1),name:Z.string(),children:Z.array(Ar)}).strict()),Pr=Z.object({category_group_key:Z.literal(kr),categories:Z.array(Ar)}).strict(),Bu=Z.object({resource_id:Z.string().min(1),name:Z.string(),description:Z.string().nullable(),thumbnail_url:Z.string().nullable(),resolved_version:qi,category_id:Z.string().uuid().nullable()}).strict(),wr=Z.object({category_group_key:Z.literal(kr),items:Z.array(Bu),next_cursor:Z.string().min(1).nullable()}).strict(),cA=Z.object({resource_id:Z.string().min(1),resolved_version:qi,anchor_block_id:Z.string().min(1),placement:Z.enum(["before","after"])}).strict(),mA=Z.object({status:Z.literal("mock_acknowledged")}).strict(),lA=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=qi,pA=Z.object({version:Gt}).strict(),Cr=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 g}from"zod";var Or="/",Nr=255,Ku=2048,zu=5e3,Hu=64;function jr(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=g.string().min(1).max(Nr).refine(jr,"url_path must be a safe site-relative path"),Ki=g.string().min(1).max(Ku).refine(jr,"url must be a safe site-relative path"),zi=g.string().max(Nr),ws=g.preprocess(e=>e===0?!1:e===1?!0:e,g.boolean()),Dn=g.union([g.url(),Ki]),Hi=g.enum(["landing_page","general_page","detail_page"]),$i=g.enum([...Hi.options,"list_page","category_page","tag_page","author_page","search_page","date_page"]);function gA(e){return e.vcp_managed&&e.url!==null&&Hi.safeParse(e.page_type).success&&qt.safeParse(e.url_path).success}function vr(e){return e.includes("{")||e.includes("}")}function hA(e){if(!vr(e.url_path))return $u(e.url_path);if(e.url===null)return null;let n=/^[a-z][a-z0-9+.-]*:\/\//iu.test(e.url)?Vu(e.url):e.url;if(n===null||vr(n))return null;let s=Ki.safeParse(n);return s.success?s.data:null}function $u(e){let n=qt.safeParse(e);return n.success?n.data:null}function Vu(e){try{return new URL(e).pathname}catch{return null}}var Lr=g.lazy(()=>g.object({cms_page_id:g.number().int().positive(),title:g.string().trim().min(1).max(255),url_path:zi,url:Dn.nullable(),page_type:$i,vcp_managed:ws,children:g.array(Lr)}).strict()),Yu=g.object({group_id:g.string().min(1),title:g.string().trim().min(1).max(255),collection_slug:g.string(),pages:g.array(Lr)}).strict(),Dr=g.object({groups:g.array(Yu)}).strict(),Mr=g.lazy(()=>g.object({id:g.number().int().positive(),title:g.string().trim().min(1).max(120),url_path:zi,parent_id:g.number().int().nonnegative(),group_type:g.string().min(1),page_type:$i,plugin_id:g.number().int().nonnegative(),is_default:ws,is_published:ws,url:Dn.nullable(),vcp_managed:ws,children:g.array(Mr)})),Xu=g.object({plugin_id:g.number().int().nonnegative(),slug:g.string(),group_name:g.string().trim().min(1).max(255),pages:g.array(Mr)}).passthrough(),Qu=g.array(Xu);function Ur(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,children:e.children.map(n=>Ur(n))}}function SA(e){if(!Zu(e))return null;let n=Dr.safeParse(e);if(n.success)return n.data;let s=Qu.safeParse(e);if(!s.success)return null;let i=Dr.safeParse({groups:s.data.map(o=>({group_id:String(o.plugin_id),title:o.group_name,collection_slug:o.slug,pages:o.pages.map(Ur)}))});return i.success?i.data:null}function Zu(e){let n=Array.isArray(e)?e:Wi(e)&&Array.isArray(e.groups)?e.groups:[],s=[];for(let o of n)if(!(!Wi(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>zu||o.depth>Hu)return!1;if(!(!Wi(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 Wi(e){return typeof e=="object"&&e!==null}var Ju=g.enum(["invalid_url_path","missing_url","not_vcp_managed","unsupported_page_type","page_not_generated"]),e_=g.enum(["home_page","invalid_url_path","not_selectable","not_vcp_managed","page_has_children","last_selectable_page","cms_unbound","unsupported_page_type"]),Fr=g.lazy(()=>g.object({cms_page_id:g.number().int().positive().nullable(),title:g.string().trim().min(1).max(255),url_path:zi,preview_url_path:Ki.nullable(),url:Dn.nullable(),page_type:$i,vcp_managed:g.boolean(),selectable:g.boolean(),disabled_reason:Ju.nullable(),can_delete:g.boolean(),delete_block_reason:e_.nullable(),has_cms_children:g.boolean(),children:g.array(Fr)}).strict()),Gr=g.object({group_id:g.string().min(1),title:g.string().trim().min(1).max(255),pages:g.array(Fr)}).strict(),fA=g.object({base_snapshot_id:I,expected_url_path:qt}).strict(),t_=g.enum(["succeeded","failed"]),n_=g.object({url_path:qt,phase:g.enum(["ensure","binding","delete"]),code:g.string().min(1),message:g.string().min(1)}).strict(),Vi=g.object({status:t_,checked_count:g.number().int().nonnegative(),ensured_count:g.number().int().nonnegative(),deleted_count:g.number().int().nonnegative(),already_absent_count:g.number().int().nonnegative(),failed_pages:g.array(n_),warnings:g.array(g.string().min(1))}).strict(),s_=g.object({result_snapshot_id:I,deleted_files:g.array(g.string().min(1)),updated_files:g.array(g.string().min(1)),preserved_shared_files:g.array(g.string().min(1)),warnings:g.array(g.string().min(1)),next_url:Dn.nullable(),previous_url:Dn.nullable(),cms_reconcile_result:Vi}).strict(),bA=g.object({code:g.literal(0),message:g.string(),data:s_}).strict(),yA=g.object({snapshot_id:I}).strict(),i_=g.object({snapshot_id:I,warnings:g.array(g.string().min(1)),cms_reconcile_result:Vi}).strict(),xA=g.object({code:g.literal(0),message:g.string(),data:i_}).strict(),EA=g.object({snapshot_id:I}).strict(),o_=g.object({snapshot_id:I,status:g.enum(["converged","required","unknown"]),reason:g.string().min(1).max(255).optional()}).strict(),RA=g.object({code:g.literal(0),message:g.literal("ok"),data:o_}).strict(),IA=g.object({source_committed:g.boolean(),result_snapshot_id:I.optional(),cms_reconcile_result:Vi.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"})}),a_=Hi,r_=g.object({title:g.string().min(1).max(255).optional(),description:g.string().min(1).max(1e3).optional(),keywords:g.string().min(1).max(255).optional(),meta_tags_json:g.record(g.string(),g.unknown()).optional(),schema_json:g.union([g.record(g.string(),g.unknown()),g.array(g.unknown())]).optional(),breadcrumbs_json:g.array(g.unknown()).optional()}).strict(),qr=g.object({url_path:qt,title:g.string().trim().min(1).max(255),kind:a_,route_file:g.string().min(1),collection_id:g.string().trim().min(1).optional(),seo:r_.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===Or)&&n.addIssue({code:"custom",path:["kind"],message:"The home target must be the only landing_page target."})}),c_=g.object({complete:g.literal(!0),targets:g.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===Or).length!==1&&n.addIssue({code:"custom",path:["targets"],message:"A complete page target set must contain exactly one home page."})}),TA=g.discriminatedUnion("complete",[c_,g.object({complete:g.literal(!1),targets:g.array(qr),errors:g.array(g.string().min(1)).min(1)}).strict()]),Bi=g.string().regex(/^sha256:[0-9a-f]{64}$/),kA=g.object({projection_hash:Bi.nullable()}).strict(),AA=g.object({expected_projection_hash:Bi.nullable(),projection_hash:Bi}).strict(),PA=g.object({clean_snapshot_id:g.string().uuid().nullable()}).strict(),wA=g.object({clean_snapshot_id:g.string().uuid()}).strict();var Wr="insertNewPage",jA={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"]),m_=R.object({resource_id:R.string().min(1),resource_type:Wt,resolved_version:Gt,template_page_id:R.string().min(1)}).strict(),Br=R.lazy(()=>R.object({id:R.string().uuid(),key:R.string().min(1),name:R.string(),children:R.array(Br)}).strict()),Kr=R.object({category_group_key:R.literal(Wr),categories:R.array(Br)}).strict(),l_=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(Wr),items:R.array(l_),next_cursor:R.string().min(1).nullable()}).strict(),LA=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"})}),On=Gt,Cs=R.string().regex(/^\/[a-z0-9]+(?:-[a-z0-9]+)*$/),MA=R.string().regex(/^\/(?:[a-z0-9]+(?:-[a-z0-9]+)*)?$/),p_=R.object({template_page_id:R.string().min(1),title:R.string().trim().min(1).max(120),final_route:Cs}).strict(),d_=R.object({template_page_id:R.string().min(1),title:R.string().trim().min(1).max(120),source:m_.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(),u_=R.object({resource_id:R.string().min(1),resource_type:Wt,resolved_version:On,pages:R.array(d_).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 Yi(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 UA=R.object({resource_type:Wt,version:On,pages:R.array(p_).min(1)}).strict().superRefine((e,n)=>{Yi(e,n),Rt(e.pages.map(s=>s.template_page_id),"pages",n),Rt(e.pages.map(s=>s.final_route),"routes",n)}),__=R.object({instance_id:R.string().min(1),component_id:R.string().min(1)}).strict(),g_=R.object({component_id:R.string().min(1),materialization:Ft}).strict(),h_=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(__)}).strict(),Xi=R.object({resource_id:R.string().min(1),resource_type:Wt,resolved_version:On,revision_id:R.string().uuid().optional(),digest_sha256:R.string().regex(/^[a-f0-9]{64}$/),components:R.array(g_),pages:R.array(h_).min(1),project_dependencies:R.record(R.string(),R.never()).optional()}).strict().superRefine((e,n)=>{Yi(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)}}),Hr=Xi,$r=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(),S_=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(),Vr=R.object({resource_id:R.string().min(1),resource_type:Wt,resolved_version:On,pages:R.array(S_).min(1)}).strict().superRefine((e,n)=>{Yi(e,n),Rt(e.pages.map(s=>s.template_page_id),"pages",n)}),FA=R.object({resource_type:Wt,version:On}).strict(),GA=R.object({draft:u_}).strict(),Yr=R.object({groups:R.array(Gr)}).strict(),Xr=R.object({candidate:R.record(R.string(),R.unknown())}).strict();var Jt="[a-z0-9]+(?:-[a-z0-9]+)*",Nn=new RegExp(`^/(?:${Jt}(?:/${Jt})*)?$`),Qr=["/privacy","/cookie-policy","/system/not-found"],f_=Qr.map(e=>`app/${e.slice(1)}/page.tsx`);function b_(e){return e.replace(/[^A-Za-z0-9-]+/g,"-").replace(/-+/g,"-").replace(/^-+|-+$/g,"").toLowerCase()}function Zr(e){return typeof e=="string"&&Nn.test(e)}function Jr(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(b_).filter(r=>r.length>0);if(a.length===0)return null;let c=`/${a.join("/")}`;return Zr(c)?c:null}function ec(e){let n=Jr(e);if(n===null)throw new Error("Page slug must be an ASCII route without traversal segments.");return n}function y_(e){let n=ec(e);return n==="/"?"app/page.tsx":`app/${n.slice(1)}/page.tsx`}import{z as ae}from"zod";import{z as d}from"zod";import{z as je}from"zod";var x_=je.object({code:je.string().min(1),message:je.string().min(1),details:je.record(je.string(),je.unknown()).optional()}),zA=je.object({code:je.string().min(1),message:je.string().min(1)});function Qi(e){return je.object({ok:je.literal(!0),composition:B,data:e}).strict()}function E_(e){let n={ok:je.literal(!1),composition:B,error:x_.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 tc(e){return je.discriminatedUnion("ok",[Qi(e.dataSchema),E_({codeSchema:e.codeSchema,currentSchema:e.currentSchema,diagnosticsSchema:e.diagnosticsSchema,dataSchema:e.failureDataSchema})])}import{z as te}from"zod";var dt=te.object({start:te.number().int().nonnegative(),end:te.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"})}),R_=te.object({code:te.enum(["missing-class-name","unsupported-attribute-name","source-locator-warning","invalid-new-attr","version-conflict","write-failed"]),message:te.string().min(1)}),nc=te.object({path:te.string().min(1),content:te.string(),hash:te.string().min(1).optional()}),XA=te.object({composition:B,revision:te.string().min(1),entryCss:nc,stylesheets:te.array(nc).default([])}).strict(),QA=te.object({composition:ge}).strict(),ZA=te.object({key:te.string().min(1),composition:ge}).strict(),sc=te.object({key:te.string().min(1),composition:B,filePath:te.string().min(1),componentName:te.string().min(1),sourceKind:te.enum(["missing","stringLiteral","expression"]),attrRaw:te.string().min(1).nullable(),valueRaw:te.string().min(1).nullable(),attrRange:dt.nullable(),openingElementRange:dt,version:te.object({documentVersion:te.number().int().nonnegative(),contentHash:te.string().min(1)}),diagnostics:te.array(R_),computedStyle:te.record(te.string(),te.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"})}),JA=sc,e1=Qi(sc),Zi=te.object({source:te.enum(["style-panel","class-source-editor"]),operation:te.enum(["replace-static-classname","replace-expression","create-attribute","remove-attribute"])});import{z as at}from"zod";var I_=new Set(["children","key","ref","dangerouslysetinnerhtml"]),T_=new Set(["data-designer-hover-outline","data-designer-select-outline"]),k_=/^[A-Za-z_$][A-Za-z0-9_$:-]*$/u;function A_(e){return{code:"protected-attribute",message:`Property is protected from generic site editing: ${e}`}}function P_(){return{code:"invalid-attribute-name",message:"Property name must be a valid single JSX attribute name"}}function w_(e){let n=e.toLowerCase();return I_.has(n)||n.startsWith("data-vcp-")||T_.has(n)||/^on[a-z]/iu.test(e)}function Ji(e){if(!k_.test(e))return{owner:"blocked",name:e,diagnostic:P_()};if(w_(e))return{owner:"blocked",name:e,diagnostic:A_(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 ic=at.string().min(1),C_=at.discriminatedUnion("operation",[at.object({operation:at.literal("set"),name:ic,value:Bt}).strict(),at.object({operation:at.literal("remove"),name:ic}).strict()]).superRefine((e,n)=>{let s=Ji(e.name);s.owner==="blocked"&&n.addIssue({code:"custom",path:["name"],message:s.diagnostic?.message??"Property is not available for site editing"})}),oc=at.object({kind:at.literal("set-props"),scope:at.enum(["selection","template"]),changes:at.array(C_).min(1)}).strict().superRefine((e,n)=>{let s=new Map;for(let[i,o]of e.changes.entries()){let a=Ji(o.name),c=v_(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 v_(e){return e.owner==="class-name-source"||e.owner==="style"?`owner:${e.owner}`:`name:${e.name}`}import{z as D_}from"zod";var ac=D_.enum(["src","alt","poster","href","width","height"]);import{z as en}from"zod";var jn=en.object({editingSessionId:en.string().min(1),lockId:en.string().min(1),ownerId:en.string().min(1),leaseAssertion:en.string().min(1)}).strict(),d1="signed-designer-mutations-v1",u1=en.object({mutationContext:jn}).strict();import{z as u}from"zod";import{z as Ln}from"zod";var vs="::",eo=Ln.object({file:Ln.string().min(1),component:Ln.string().min(1),structuralPath:Ln.string().min(1),key:Ln.string().min(1)}).superRefine((e,n)=>{let s=O_(e.file,e.component,e.structuralPath);e.key!==s&&n.addIssue({code:"custom",path:["key"],message:"key must match file::component::structuralPath"})});function O_(e,n,s){return`${e}${vs}${n}${vs}${s}`}function h1(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"]),Mn=u.object({code:u.string().min(1),message:u.string().min(1)}).strict(),N_=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()]),j_=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(),L_=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(),M_=u.object({key:u.string().min(1),containerKey:u.string().min(1),businessMemberKeys:u.array(u.string().min(1)),isMultiMember:u.boolean()}).strict(),cc=u.object({kind:u.literal("page-composition"),placementKey:u.string().min(1),documentVersion:u.number().int().nonnegative(),composition:ge}).strict(),U_=u.object({kind:u.literal("page-composition"),placementKey:u.string().min(1),documentVersion:u.number().int().nonnegative(),composition:B,placementUnitKey:u.string().min(1),relation:u.enum(["before","after","prepend","append"])}).strict(),mc=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(),lc=u.object({kind:u.literal("page-unit"),composition:ge,placementUnitKey:u.string().min(1)}).strict(),pc=u.object({kind:u.literal("page-unit"),composition:B,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 F_=u.object({status:u.literal("supported"),version:u.number().int().nonnegative(),composition:B,container:N_,sourceMembers:u.array(j_),businessMembers:u.array(L_),placementUnits:u.array(M_),placements:u.array(U_)}).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]),h=m.containerKey;for(;h!==e.container.key;){if(x.has(h)){n.addIssue({code:"custom",path:["sourceMembers",r,"containerKey"],message:"Source member hierarchy must be acyclic."});break}x.add(h);let P=o.get(h);if(!P)break;h=P.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 h=new Set;for(let[P,K]of m.businessMemberKeys.entries()){let H=a.get(K);if(!H){n.addIssue({code:"custom",path:["placementUnits",r,"businessMemberKeys",P],message:"Placement unit must reference existing business members."});continue}h.has(K)&&n.addIssue({code:"custom",path:["placementUnits",r,"businessMemberKeys",P],message:"Placement unit cannot reference the same business member twice."}),h.add(K),H.containerKey!==m.key&&n.addIssue({code:"custom",path:["placementUnits",r,"businessMemberKeys",P],message:"Business member containerKey must match its placement unit."});let ie=H.sourceMemberKey,fe=new Set;for(;ie&&ie!==m.containerKey&&!fe.has(ie);)fe.add(ie),ie=o.get(ie)?.containerKey;ie!==m.containerKey&&n.addIssue({code:"custom",path:["placementUnits",r,"businessMemberKeys",P],message:"Placement unit business members must belong to its source subtree."})}}for(let[r,m]of e.businessMembers.entries())e.placementUnits.find(h=>h.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())_c(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."})}),G_=u.object({status:u.literal("unsupported"),version:u.number().int().nonnegative(),composition:B,reason:Ds,diagnostics:u.array(Mn)}).strict(),q_=u.discriminatedUnion("status",[F_,G_]),dc=2,x1="page-composition-v2",uc=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."})}),W_=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."})}),B_=u.enum(["component-call","native-jsx","dynamic-expression","indirect-expression","text","starter-placeholder"]),K_=u.enum(["none","dynamic-expression","indirect-expression","text","starter-placeholder"]),z_=u.discriminatedUnion("kind",[u.object({kind:u.literal("virtual-route-root"),key:u.null(),routeReturn:u.object({sourceIdentity:eo,sourceRange:uc}).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()]),H_=u.object({key:u.string().min(1),kind:B_,parentKey:u.string().min(1).nullable(),childKeys:u.array(u.string().min(1)),order:u.number().int().nonnegative(),label:u.string().min(1),sourceIdentity:eo,sourceRange:uc.nullable(),atomicKind:K_}).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)}),$_=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(),V_=u.enum(["independent","atomic","container"]),Y_=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:V_,isIndependent:u.boolean(),isMultiMember:u.boolean()}).strict().superRefine((e,n)=>{rc(e.sourceMemberKeys,n,"sourceMemberKeys","source member"),rc(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."})}),X_=u.enum(["before","after","prepend","append","replace"]),Q_=u.enum(["insert-sibling","insert-child","replace-placeholder"]),Z_=u.object({kind:u.literal("page-composition"),placementKey:u.string().min(1),documentVersion:u.number().int().nonnegative(),composition:B,placementUnitKey:u.string().min(1),containerKey:u.string().min(1).nullable(),relation:X_,writeMode:Q_}).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}.`})}),J_=u.object({key:u.string().min(1),placementUnitKey:u.string().min(1),runtimeRefs:u.array(W_).min(1)}).strict(),eg=u.object({schemaVersion:u.literal(dc),status:u.literal("supported"),version:u.number().int().nonnegative(),composition:B,container:z_,sourceMembers:u.array(H_),businessMembers:u.array($_),placementUnits:u.array(Y_),placements:u.array(Z_),visualAnchors:u.array(J_).optional(),diagnostics:u.array(Mn)}).strict().superRefine((e,n)=>{sg(e,n)}),tg=u.object({schemaVersion:u.literal(dc),status:u.literal("unsupported"),version:u.number().int().nonnegative(),composition:B,reason:Ds,diagnostics:u.array(Mn)}).strict(),ng=u.discriminatedUnion("status",[eg,tg]),E1=u.union([ng,q_]);function rc(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 _c(e,n){return Pi(e)===Pi(n)}function sg(e,n){_t(e.sourceMembers,n,"sourceMembers",h=>h.key,"key"),_t(e.businessMembers,n,"businessMembers",h=>h.key,"key"),_t(e.placementUnits,n,"placementUnits",h=>h.key,"key"),_t(e.placements,n,"placements",h=>h.placementKey,"placementKey"),_t(e.visualAnchors??[],n,"visualAnchors",h=>h.key,"key"),ig(e,n);let s=new Map(e.sourceMembers.map(h=>[h.key,h])),i=new Map(e.businessMembers.map(h=>[h.key,h])),o=new Map(e.placementUnits.map(h=>[h.key,h]));og(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[h,P]of e.placementUnits.entries()){P.containerKey!==e.container.key&&n.addIssue({code:"custom",path:["placementUnits",h,"containerKey"],message:"Placement unit containerKey must match the page container."});let K=`${P.containerKey??"<virtual>"}:${P.order}`;r.has(K)&&n.addIssue({code:"custom",path:["placementUnits",h,"order"],message:"Placement unit order must be unique within its container."}),r.add(K);for(let[H,ie]of P.sourceMemberKeys.entries()){s.has(ie)||n.addIssue({code:"custom",path:["placementUnits",h,"sourceMemberKeys",H],message:"Placement unit must reference existing source members."});let fe=a.get(ie);fe&&fe!==P.key&&n.addIssue({code:"custom",path:["placementUnits",h,"sourceMemberKeys",H],message:`Source member is already assigned to ${fe}.`}),a.set(ie,P.key)}for(let[H,ie]of P.businessMemberKeys.entries()){let fe=i.get(ie);if(!fe){n.addIssue({code:"custom",path:["placementUnits",h,"businessMemberKeys",H],message:"Placement unit must reference existing business members."});continue}fe.placementUnitKey!==P.key&&n.addIssue({code:"custom",path:["placementUnits",h,"businessMemberKeys",H],message:"Placement unit and business member must reference each other."}),P.sourceMemberKeys.includes(fe.sourceMemberKey)||n.addIssue({code:"custom",path:["placementUnits",h,"businessMemberKeys",H],message:"Business member sourceMemberKey must belong to the placement unit."});let xn=c.get(ie);xn&&xn!==P.key&&n.addIssue({code:"custom",path:["placementUnits",h,"businessMemberKeys",H],message:`Business member is already assigned to ${xn}.`}),c.set(ie,P.key)}}for(let[h,P]of e.businessMembers.entries()){s.has(P.sourceMemberKey)||n.addIssue({code:"custom",path:["businessMembers",h,"sourceMemberKey"],message:"Business member must reference a source member."});let K=o.get(P.placementUnitKey);if(!K){n.addIssue({code:"custom",path:["businessMembers",h,"placementUnitKey"],message:"Business member must reference a placement unit."});continue}K.businessMemberKeys.includes(P.key)||n.addIssue({code:"custom",path:["businessMembers",h,"placementUnitKey"],message:"Business member and placement unit must reference each other."}),K.sourceMemberKeys.includes(P.sourceMemberKey)||n.addIssue({code:"custom",path:["businessMembers",h,"sourceMemberKey"],message:"Business member sourceMemberKey must belong to its placement unit."});let H=K.isIndependent&&K.businessMemberKeys.length===1;P.isIndependent!==H&&n.addIssue({code:"custom",path:["businessMembers",h,"isIndependent"],message:"Business member independence must match its placement unit boundary."})}let m=new Set;for(let[h,P]of e.placements.entries()){P.documentVersion!==e.version&&n.addIssue({code:"custom",path:["placements",h,"documentVersion"],message:"Page placement version must match page composition version."}),_c(P.composition,e.composition)||n.addIssue({code:"custom",path:["placements",h,"composition"],message:"Page placement composition must match page composition."});let K=o.get(P.placementUnitKey);K?P.containerKey!==K.containerKey&&n.addIssue({code:"custom",path:["placements",h,"containerKey"],message:"Placement containerKey must match its placement unit."}):n.addIssue({code:"custom",path:["placements",h,"placementUnitKey"],message:"Placement option must reference a placement unit."});let H=`${P.placementUnitKey}:${P.relation}`;m.has(H)&&n.addIssue({code:"custom",path:["placements",h,"relation"],message:"A placement unit cannot expose the same relation more than once."}),m.add(H),P.relation==="replace"&&e.container.kind!=="starter-placeholder"&&n.addIssue({code:"custom",path:["placements",h,"relation"],message:"replace is only valid for a starter placeholder container."}),e.container.kind==="starter-placeholder"&&P.relation!=="replace"&&n.addIssue({code:"custom",path:["placements",h,"relation"],message:"Starter placeholder placements must use replace."})}let x=new Set;for(let[h,P]of(e.visualAnchors??[]).entries())o.has(P.placementUnitKey)||n.addIssue({code:"custom",path:["visualAnchors",h,"placementUnitKey"],message:"Visual anchor must reference a placement unit."}),x.has(P.placementUnitKey)&&n.addIssue({code:"custom",path:["visualAnchors",h,"placementUnitKey"],message:"A placement unit may expose only one visual anchor."}),x.add(P.placementUnitKey)}function ig(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 og(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,h]of a.childKeys.entries()){if(h===a.key){s.addIssue({code:"custom",path:["sourceMembers",o,"childKeys",x],message:"Source member cannot be its own child."});continue}let P=n.get(h);P?P.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 Un=d.enum(["update-text","update-array-item","remove-node","insert-child","replace-node","move-node","set-class-name-source","set-props","apply-style-draft","source-edit","insert-page-resource","delete-page-source"]),ag=d.discriminatedUnion("kind",[d.object({kind:d.literal("node"),key:d.string().min(1)}).strict(),lc,d.object({kind:d.literal("route"),composition:ge}).strict(),d.object({kind:d.literal("source-file"),path:Ee}).strict(),d.object({kind:d.literal("source-batch"),paths:d.array(Ee).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(),d.object({kind:d.literal("project")}).strict()]),rg=d.discriminatedUnion("kind",[d.object({kind:d.literal("node"),key:d.string().min(1)}).strict(),pc,d.object({kind:d.literal("route"),composition:B}).strict(),d.object({kind:d.literal("source-file"),path:Ee}).strict(),d.object({kind:d.literal("source-batch"),paths:d.array(Ee).min(1)}).strict(),d.object({kind:d.literal("project")}).strict()]),gc=d.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"]),hc=d.enum(["hover","active","focus","disabled"]),Sc=d.enum(["sm","md","lg","xl","2xl"]),fc=d.union([d.object({relation:d.enum(["before","after"]),anchorKey:d.string().min(1),parentKey:d.string().min(1)}),d.object({relation:d.enum(["prepend","append"]),parentKey:d.string().min(1)}),mc]),cg=d.object({kind:d.literal("source-sibling"),relation:d.enum(["before","after"]),anchorKey:d.string().min(1)}).strict(),mg=d.union([fc,cg]),bc=d.object({kind:d.literal("component-call"),component:d.never().optional(),materialization:Ft,props:d.record(d.string(),d.never()).optional()}).strict(),lg=d.union([d.object({kind:d.literal("native-tag"),tag:d.string().min(1),text:d.string().optional()}),d.object({kind:d.literal("component-call"),component:d.object({source:d.string().min(1),exportName:d.string().min(1)}),materialization:d.never().optional(),props:d.record(d.string(),d.unknown()).optional()}).strict(),bc]),pg=d.discriminatedUnion("kind",[d.object({kind:d.literal("update-text"),segmentIndex:d.number().int().min(0),value:d.string()}),d.object({kind:d.literal("update-array-item"),segmentIndex:d.number().int().min(0),index:d.number().int().min(0),value:d.string()}),d.object({kind:d.literal("remove-node")}),d.object({kind:d.literal("insert-child"),node:lg,position:d.union([fc,cc])}),d.object({kind:d.literal("replace-node"),node:bc}),d.object({kind:d.literal("move-node"),target:mg,preserveBindings:d.boolean().optional()}),d.object({kind:d.literal("set-class-name-source"),filePath:d.string().min(1),expectedVersion:d.object({documentVersion:d.number().int().nonnegative(),contentHash:d.string().min(1)}),oldAttrRaw:d.string().min(1).nullable(),oldAttrRange:dt.nullable(),openingElementRange:dt,newAttrRaw:d.string().min(1).nullable(),intent:Zi}),oc,d.object({kind:d.literal("apply-style-draft"),className:d.object({filePath:d.string().min(1),expectedVersion:d.object({documentVersion:d.number().int().nonnegative(),contentHash:d.string().min(1)}),oldAttrRaw:d.string().min(1).nullable(),oldAttrRange:dt.nullable(),openingElementRange:dt,newAttrRaw:d.string().min(1).nullable(),intent:Zi}).optional(),props:d.partialRecord(ac,d.string()).optional()}).superRefine((e,n)=>{!e.className&&!e.props&&n.addIssue({code:"custom",message:"apply-style-draft requires className or props"})}),d.object({kind:d.literal("source-edit"),conflictPolicy:d.enum(["compare-and-swap","overwrite"]),edits:d.array(d.discriminatedUnion("operation",[d.object({operation:d.literal("upsert"),path:Ee,content:d.string(),baseContentHash:d.string().min(1).nullable().optional()}).strict().superRefine((e,n)=>{Ci(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"})}),d.object({operation:d.literal("delete"),path:Ee,capability:lr,confirmDelete:d.literal(!0),confirmPath:Ee,baseContentHash:d.string().min(1).nullable().optional()}).strict().superRefine((e,n)=>{e.capability!==wi&&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"}),Ci(e.path)||n.addIssue({code:"custom",path:["path"],message:"source-edit delete only accepts allowlisted text source files"});let s=vi(e.path);s&&n.addIssue({code:"custom",path:["path"],message:`Protected source file cannot be deleted: ${e.path} (${s})`})})])).min(1),reason:d.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"})}),d.object({kind:d.literal("insert-page-resource"),artifact:Xi}).strict(),d.object({kind:d.literal("delete-page-source"),expectedUrlPath:d.string().startsWith("/")}).strict()]),yc=d.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"]),xc=d.object({code:yc,message:d.string().min(1),details:d.record(d.string(),d.unknown()).optional()}),tn=d.object({key:d.string().min(1),instanceIndex:d.number().int().nonnegative().optional(),instanceCount:d.number().int().positive().optional()}),to=d.object({id:d.string().min(1),siteId:k,baseSnapshotId:I,composition:ge,kind:Un,target:ag,documentVersion:d.number().int().nonnegative(),selectionRef:tn.optional(),mutationContext:jn.optional(),params:pg}).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==="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;gg(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"})}),L1=to,dg=d.object({kind:d.literal("insert-page-resource"),package_instance_id:d.string().min(1),pages:d.array($r).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)}),ug=d.object({kind:d.literal("delete-page-source"),deleted_files:d.array(d.string().min(1)),updated_files:d.array(d.string().min(1)),preserved_shared_files:d.array(d.string().min(1)),warnings:d.array(d.string().min(1))}).strict(),_g=d.discriminatedUnion("kind",[dg,ug]),Ec=d.object({requestId:d.string().min(1),kind:Un,composition:B,target:rg,resultVersion:d.number().int().nonnegative(),affectedFiles:d.array(d.string().min(1)).optional(),selectionRef:tn.optional(),output:_g.optional()}).strict(),no=Ec.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"})}),M1=tc({dataSchema:no,codeSchema:yc,failureDataSchema:Ec.partial()});function gg(e,n){return e.length===n.length&&e.every((s,i)=>s===n[i])}var hg=ae.enum(["component","page","pages"]),Sg=ae.object({resource_kind:hg,resource_name:ae.string().trim().min(1).max(200),file_count:ae.number().int().min(1).max(64),total_bytes:ae.number().int().min(0).max(4*1024*1024),content_digest:ae.string().regex(/^sha256:[a-f0-9]{64}$/),custom_prompt:ae.string().trim().min(1).max(4e3).optional(),final_routes:ae.array(ae.string().min(1)).max(64)}).strict(),fg=ae.discriminatedUnion("kind",[ae.object({kind:ae.literal("none")}).strict(),ae.object({kind:ae.literal("primary"),items:ae.array(ae.object({label:ae.string().trim().min(1).max(120),href:ae.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)})]),bg=ae.object({base_snapshot_id:ae.string().min(1),operation:to,navigation_selection:fg.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 yg(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 Rc=ae.object({id:ae.string().min(1),tenant_id:ae.string().min(1),site_id:ae.string().min(1),run_id:ae.string().min(1).optional(),correlation_id:ae.string().min(1).optional(),sent_at:ae.string().min(1),type:ae.literal("client.resource.operation.create"),payload:ae.object({client_message_id:ae.string().min(1),display:Sg,transient_resource_input:bg}).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=yg(i.operation).flatMap(m=>m.files),r=c.reduce((m,x)=>m+new TextEncoder().encode(x.content).byteLength,0);if(c.length>Fi&&n.addIssue({code:"custom",path:["payload","transient_resource_input","operation"],message:"Resource operation exceeds the aggregate file count limit."}),r>Gi&&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(h=>h.final_route);(x.length!==s.final_routes.length||x.some((h,P)=>h!==s.final_routes[P]))&&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,h]of i.navigation_selection.items.entries())m.has(h.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 w}from"zod";import{z as so}from"zod";var M=e=>so.object({code:so.number().int(),data:e,message:so.string()});var xg=["with_website","without_website"],nn=w.enum(xg),io=w.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."}),Eg=["welcome","website_scan","customer_materials","analysis","diagnosis","strategy","structure_planning","preview_personalization","publishing"],It=w.enum(Eg),Rg=["company_info","website_crawl","website_basic_info_extract","website_metrics_evaluate","intelligent_analysis","strategy_recommendation"],Tc=w.enum(Rg),Ig=["started","running","succeeded","failed","invalidated"],kc=w.enum(Ig),Tg=["draft","structure_saved","generating","workspace_ready"],oo=w.enum(Tg),kg=["not_deployed","deploying","deployed"],ao=w.enum(kg),Ag=["active","completed"],Pg=w.enum(Ag),wg=["completed","current","locked"],Cg=w.enum(wg),Ac={draft:10,structure_saved:20,generating:30,workspace_ready:40},Pc={not_deployed:10,deploying:20,deployed:30},wc={active:10,completed:20},Cc={started:10,running:20,succeeded:30,failed:40,invalidated:50};function Os(e){return new Map(Object.entries(e).map(([n,s])=>[s,n]))}var vg=Os(Ac),Dg=Os(Pc),Og=Os(wc),Ng=Os(Cc);function X1(e){let n=vg.get(e);if(!n)throw new Error(`Unknown site build status code: ${e}`);return n}function Q1(e){let n=Dg.get(e);if(!n)throw new Error(`Unknown site deployment status code: ${e}`);return n}function Z1(e){let n=Og.get(e);if(!n)throw new Error(`Unknown site workflow status code: ${e}`);return n}function J1(e){let n=Ng.get(e);if(!n)throw new Error(`Unknown task execution status code: ${e}`);return n}function eP(e){return Ac[e]}function tP(e){return Pc[e]}function nP(e){return wc[e]}function sP(e){return Cc[e]}var ro=[{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=ro[0].definitions,vc=w.number().int().min(1),jg=w.object({id:Q,flow_type:nn,definition_version:vc,node_code:It,label:w.string().min(1),sort_order:w.number().int().min(1),is_enabled:w.boolean(),state:Cg}),Dc=w.object({id:za,tenant_id:w.string().min(1),site_id:k,workflow_id:it,node_code:It,task_type:Tc,external_task_id:w.string().min(1),execution_status:kc,idempotency_key:w.string().min(1),attempt_no:w.number().int().min(1),source_crawl_task_ref_id:w.string().uuid().nullable(),succeeded_at:w.string().min(1).nullable(),superseded_at:w.string().min(1).nullable(),site_url:w.string().url().nullable(),created_at:w.string().min(1),updated_at:w.string().min(1)}),Lg=w.object({id:it,tenant_id:w.string().min(1),site_id:k,flow_type:nn,website:io.nullable(),definition_version:vc,current_node_code:It,status:Pg,started_at:w.string().min(1),completed_at:w.string().min(1).nullable(),created_at:w.string().min(1),updated_at:w.string().min(1)}),co=w.object({workflow:Lg,menu:w.array(jg),task_refs:w.array(Dc),site:w.object({default_locale:Re.optional(),status:oo,deployment_status:ao,archived_at:w.string().min(1).nullable(),current_sitemap_id:w.string().nullable().optional(),current_sitemap_version:w.number().int().positive().nullable().optional(),confirmed_sitemap_id:w.string().nullable().optional(),confirmed_sitemap_version:w.number().int().positive().nullable().optional(),structure_confirmed_at:w.string().min(1).nullable().optional(),current_snapshot_id:w.string().nullable(),deployed_url:w.string().url().nullable(),cms_site_id:w.string().min(1).nullish()})}),oP=M(co),aP=M(Dc),Ic=w.array(w.string().min(1).max(64)).max(16).optional(),rP=w.discriminatedUnion("flow_type",[w.object({flow_type:w.literal("with_website"),website:io,client_capabilities:Ic}).strict(),w.object({flow_type:w.literal("without_website"),website:w.null().optional(),client_capabilities:Ic}).strict()]),cP=w.object({expected_current_node:w.literal("website_scan"),website:io}).strict(),mP=w.object({expected_current_node:It}).strict(),lP=w.object({expected_current_node:w.literal("publishing")}).strict(),pP=w.object({publish_workflow_id:cs,expected_publish_revision:w.number().int().min(1)}).strict(),Mg=w.object({node_code:It,task_type:Tc,external_task_id:w.string().min(1).max(255),idempotency_key:w.string().min(1).max(255),site_url:w.string().url().optional()}),dP=Mg.extend({workflow_id:it}).strict(),uP=w.object({external_task_id:w.string().min(1).max(255),execution_status:kc}),Ug=w.object({previous_external_task_id:w.string().min(1).max(255),external_task_id:w.string().min(1).max(255),idempotency_key:w.string().min(1).max(255),site_url:w.string().url().optional()}),_P=Ug.extend({workflow_id:it}).strict(),Fg=w.object({previous_external_task_id:w.string().min(1).max(255),external_task_id:w.string().min(1).max(255),idempotency_key:w.string().min(1).max(255),site_url:w.string().url()}),gP=Fg.extend({workflow_id:it}).strict(),hP=w.object({}).strict();function Gg(e,n,s){return e.find(i=>i.definition_version===s)?.definitions[n]}function qg(e,n){return Gg(ro,e,n)}function Wg(e,n=1){let s=qg(e,n);if(!s)throw new Error(`Unknown workflow definition: ${e} v${n}.`);return s}function Bg(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 SP(e,n){return Bg(ro,e,n)}function fP(e,n){return Wg(e).findIndex(s=>s.node_code===n)}function bP(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 yP(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 xP(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 mo=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_]*$/),Kg=E.enum(["text","select","multi_select","tags","category_list","boolean","number"]),Fn=E.string().min(1).max(512).regex(/^\/(?:[^?#]*)$/),zg=E.enum(["base_snapshot_missing","route_not_found","cms_unavailable","product_application_not_found","not_a_configuration_change","tool_execution_failed"]),lo=E.object({status:E.literal("failed"),reason:zg}).strict(),Hg=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"}),$g=E.string().trim().min(1).max(100),Nc=E.array($g).max(5).refine(e=>new Set(e.map(n=>n.toLowerCase())).size===e.length,{message:"popular_terms must be unique ignoring case"}),TP=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)}),jc=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:Nc.optional()}).strict(),Vg=E.object({app_slug:mo}).extend(jc.shape).strict(),po=E.object({kind:E.literal("product_search_confirmation"),baseline_snapshot_id:I,target_route_id:Fn,applications:E.array(E.object({app_slug:mo,label:E.string().min(1).max(200),popular_terms:Nc.default([]),current_config:jc.nullable().default(null),affected_routes:E.array(Fn).max(64).default([]),fields:E.array(E.object({field_name:Ue,label:E.string().min(1).max(200),value_shape:Kg,option_count:E.number().int().nonnegative().optional(),filter_meta:Hg.optional()}).strict()).max(64)}).strict()).min(1).max(12),current_config:Vg.nullable().optional(),affected_routes:E.array(Fn).min(1).max(64).optional()}).strict(),Yg=E.object({kind:E.literal("product_search_confirmation"),action:E.enum(["confirm","modify"]),app_slug:mo,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"})}),Ns=E.union([Yg,E.object({kind:E.literal("product_search_confirmation"),action:E.literal("cancel")}).strict()]),Gn=E.union([E.string().max(255),E.number().finite(),E.boolean()]),Xg=E.object({values:E.array(Gn).min(1).max(20).refine(e=>new Set(e.map(n=>`${typeof n}:${String(n)}`)).size===e.length,{message:"values must be unique"})}).strict(),Qg=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"}),Zg=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([Xg,Qg])).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(Gn).max(20)}).strict()).max(8)}).strict(),Oc=E.object({value:Gn,label:E.string().max(200),count:E.number().int().nonnegative()}).strict(),Jg=E.union([Gn,E.array(Gn).max(50)]),eh=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,Jg).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(Oc).max(10),selected_values:E.array(Oc).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(),kP=E.object({contract_version:E.literal(1),request:Zg,response:eh}).strict();import{z as qe}from"zod";var uo=4,wP=20,CP=1440*60*1e3,vP=1e6,th=["image/png","image/jpeg","image/webp"],_o=qe.enum(th),DP="WORKSPACE_ATTACHMENT_UNSUPPORTED_FORMAT",OP="WORKSPACE_ATTACHMENT_TOO_LARGE",NP="WORKSPACE_ATTACHMENT_LIMIT",jP="WORKSPACE_ATTACHMENT_BOUND",LP=10,MP=3600*1e3,UP="WORKSPACE_ATTACHMENT_URL_REJECTED",FP="WORKSPACE_ATTACHMENT_CAPTURE_FAILED",GP="WORKSPACE_ATTACHMENT_CAPTURE_BUSY",qP="WORKSPACE_ATTACHMENT_CAPTURE_TIMEOUT",WP="WORKSPACE_ATTACHMENT_CAPTURE_BUDGET_EXCEEDED",BP="WORKSPACE_ATTACHMENT_CAPTURE_UNAVAILABLE",KP=qe.object({attachment_id:qe.string().min(1),media_type:_o,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(),zP=qe.object({url:qe.string().url().max(2048),full_page:qe.boolean().optional()}).strict(),Lc="[A-Za-z0-9_-]+",nh=new RegExp(`^/sites/(${Lc})/workspace/attachments/(${Lc})/image$`);function HP(e,n){return`/sites/${encodeURIComponent(e)}/workspace/attachments/${encodeURIComponent(n)}/image`}function go(e){let n=nh.exec(e);return n?{site_id:n[1],attachment_id:n[2]}:null}function $P(e){let n=[];for(let s of e){if(s.type!=="file"||typeof s.url!="string")continue;let i=go(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 qn}from"zod";var sh=["deployment_queued","prepare_source","build_artifact","publish_site","site_released","cleanup_release"],ih=qn.enum(sh),oh=qn.enum(["running","succeeded","failed"]),ah=qn.object({code:ih,status:oh,message:qn.string().trim().min(1)}).strict(),Mc=qn.array(ah);import{z as Wn}from"zod";var rh={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 ZP(e){let n={},s=new Set;for(let i of e){if(!rh[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"?Wn.string().min(1):i.field==="type"?Wn.string().trim().min(1):Wn.boolean()}return Wn.object({answers:Wn.object(n).strict()}).strict()}import{z as C}from"zod";var ch=C.enum(["pending","running","succeeded","failed"]),mh=C.enum(["TASK_FAILED","WEBSITE_UNREACHABLE"]),lh=C.object({task_id:C.string().uuid(),site_url:C.string().url(),crawler_task_id:C.string().min(1).max(255).nullable(),crawler_error_code:mh.nullable().optional(),crawler_failure_stage:C.enum(["URL_DISCOVERY","PAGE_CRAWL","TASK_SCHEDULING","RESULT_PERSISTENCE"]).nullable().optional(),page_count:C.number().int().min(0).max(20),status:ch,error:C.string().nullable(),created_at:C.string().min(1),updated_at:C.string().min(1)}),nw=M(lh),ho=C.enum(["existing_site","new_site"]),Fc=C.enum(["google_indexing","ai_recommendation","qualification_verifiability","content_freshness","inquiry_form","inquiry_response","privacy_compliance","prohibited_content"]),Uc=C.object({observed_result:C.enum(["pass","fail","unknown"])}).strict(),Gc=C.object({kind:C.literal("ai_crawlability"),checks:C.object({ai_access_guidance:Uc,structured_data_presence:Uc}).strict()}).strict(),So=C.object({label:C.string().trim(),value:C.union([C.string(),C.number(),C.boolean(),C.null()]),summary:C.string().trim(),tone:C.enum(["good","warn","bad","unknown"]),status:C.enum(["ok","unknown"]),assessment:Gc.optional()}),js=C.object({key:C.string().trim().min(1).max(100),label:C.string().trim().min(1).max(100),value:C.union([C.string().max(1e3),C.number(),C.boolean(),C.null()]),tone:C.enum(["good","warn","bad","unknown"]),status:C.enum(["ok","unknown"]),evidence:C.string().trim().max(2e3).optional(),assessment:Gc.optional()}).strict(),ph=C.object({url:C.string().url().max(2048),title:C.string().trim().max(300),words:C.number().int().nonnegative().max(1e7)}).strict(),dh=C.object({site_url:C.string().url().max(2048),scanned_at:C.string().datetime({offset:!0}),reach:C.array(js).max(64),trust:C.array(js).max(64),convert:C.array(js).max(64),safe:C.array(js).max(64),pages:C.array(ph).max(100)}).strict(),Ls=C.object({company_task_id:C.string().min(1).max(128),scan_task_id:C.string().min(1).max(128),type:ho,result:C.object({company_name:C.string(),website:C.string().url().optional(),primary_product:C.string(),current_market:C.string(),qualifications:C.string(),scan_cards:C.record(C.string(),So),scan_result:dh.optional()})}),uh=C.object({saved:C.literal(!0),company_task_id:C.string().min(1).max(128),scan_task_id:C.string().min(1).max(128)}),sw=M(uh),_h=C.enum(["snapshot","task"]),gh=Ls.shape.result.extend({type:ho,structured_facts:C.unknown().optional()}).extend({company_name:C.string(),primary_product:C.string(),current_market:C.string(),qualifications:C.string()}),hh=C.object({site_id:C.string().min(1).max(128),company_task_id:C.string().min(1).max(128),scan_task_id:C.string().min(1).max(128),type:ho,data_source:_h,result:gh}),iw=M(hh.nullable());import{z as Ie}from"zod";var Tt=Ie.enum(["company","product_service","case_qualification","market","contact_inquiry","privacy_compliance","news_freshness"]),Sh=Ie.object({ordinal:Ie.number().int().min(1).max(1e4),path:Ie.string().min(1).max(2048).refine(e=>!yh(e),{message:"path must be a site-relative path, not an absolute URL"}),last_modified:Ie.string().max(64).nullable()}).strict(),rw=Ie.object({candidates:Ie.array(Sh).min(1).max(1e4),selection_limit:Ie.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}}),fh=Ie.object({ordinal:Ie.number().int().positive().max(1e4),roles:Ie.array(Tt).min(1).max(7)}).strict(),bh=Ie.object({role:Tt,status:Ie.enum(["selected","not_found"]),selected_ordinals:Ie.array(Ie.number().int().positive().max(1e4)).max(19)}).strict(),cw=Ie.object({selections:Ie.array(fh).max(19),coverage:Ie.array(bh).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 yh(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()}),Wc=f.enum(["running","succeeded","failed"]),xh=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)}),Eh=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"])}),Rh=f.object({t:f.string(),d:f.string(),evidence:f.object({from:f.string(),url:f.string().nullable().optional(),value:f.string().nullable().optional()})}),Ih=f.enum(["complete","partial","insufficient_data","failed"]),Th=f.enum(["ok","failed","insufficient_data"]),fo=f.object({agent_id:f.string().min(1),name:f.string().min(1),icon:f.string().min(1),status:Th,topics:f.array(f.object({topic_id:f.string().min(1),status:Ih,evidence_refs:f.array(f.string())})).length(3),findings:f.array(Rh).max(3),elapsed_ms:f.number().nonnegative(),note:f.string().optional(),error:f.string().optional()}),Bc=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()}),kh=f.object({agents_done:f.boolean(),analysis:f.record(f.string(),fo),step4_scoring_input:f.unknown().optional(),summary:Bc}),Kc=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:Wc,result:kh.nullable().optional(),error:f.string().nullable().optional()}),uw=M(f.array(xh)),_w=M(Eh),gw=M(Kc),hw=M(Kc.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())}),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()}),Sw=f.discriminatedUnion("event",[gt.extend({event:f.literal("snapshot"),data:f.object({job_id:f.string().min(1),status:Wc,done:f.number().int().nonnegative(),total:f.number().int().nonnegative(),results:f.array(fo),progress:qc.optional()})}),gt.extend({event:f.literal("progress"),data:qc}),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:fo}),gt.extend({event:f.literal("done"),data:f.object({agents_done:f.literal(!0),summary:Bc})}),gt.extend({event:f.literal("failed"),data:f.object({message:f.string().min(1)})})]);import{z as U}from"zod";var yo=U.enum(["reach","trust","convert","safe"]),Oe=U.number().finite(),Ah=U.number().finite().positive(),bo=["reach","trust","convert","safe"],Ph=17,wh=U.enum(["passed","partial","failed"]),Ch=U.object({landing_page_mode:U.enum(["intent_dynamic","static","none"]),ab_test_enabled:U.boolean()}).strict(),vh=U.union([U.boolean(),U.number().finite(),wh,Ch]).nullable(),Dh=U.union([U.boolean(),U.number().finite()]).nullable(),Oh=U.object({competitor_avg:U.number().finite(),score_items:U.record(U.string(),vh),penalty_items:U.record(U.string(),Dh),red_texts:U.array(U.string())}).strict(),Nh=U.record(yo,Oh),jh=U.object({key:yo,score:Oe,pass_score:Oe,gap:Oe}),Lh=U.object({key:U.string(),title:U.string(),is_redline_option:U.boolean().optional(),score:Oe,max_score:Ah,pass_score:Oe,passed:U.boolean(),description:U.string()}),Mh=U.object({key:yo,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(Lh),red_texts:U.array(U.string()),redline_hit:U.boolean().optional()}),Uh=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:Nh,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(jh).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(Mh).length(4)}),created_at:U.string().datetime({offset:!0}),updated_at:U.string().datetime({offset:!0})}).superRefine((e,n)=>{Fh(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)!==Ph&&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."})}}),xw=M(Uh);function Fh(e){let n=e.map(s=>s.key);return n.length===bo.length&&new Set(n).size===bo.length&&bo.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 Iw=Object.freeze(Xt.filter(e=>kt[e].length>0)),Tw=Object.freeze(Xt.filter(e=>kt[e].length===0)),Gh=Object.freeze(["preparing_source","building","artifact_ready","deploying","released"]),qh="DEPLOYMENT_TRANSITION_INVALID",xo=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 kw(e){return kt[e]}function Aw(e){return Xt.filter(n=>kt[n].some(s=>s===e))}function Wh(e){return kt[e].length>0}function Pw(e){return!Wh(e)}function ww(e,n){if(!kt[e].some(s=>s===n))throw new xo(e,n);return n}function Cw(){return Gh}import{converter as Bh,formatHex as Kh,parse as zh,wcagContrast as Ow}from"culori";var Nw=Bh("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)"},Hh={\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},jw={...T,...Hh};function Eo(e){let n=zh(e.trim());return n?Kh(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}},$h={heading:"Inter",body:"Inter"},zc=ht.Inter;function Ms(e){return e.trim().replace(/\s+/g,"_").toLowerCase()}var Yc=(()=>{let e=new Map;for(let[n,s]of Object.entries(ht))e.set(Ms(n),s),e.set(Ms(s.import),s);return e})();function Vh(e){return typeof e!="string"||e.trim().length===0?zc:Yc.get(Ms(e))??zc}var Yh=(()=>{let e=new Map;for(let[n,s]of Object.entries(ht))e.set(s.import,n);return e})();function sn(e){if(typeof e!="string"||e.trim().length===0)return"Inter";let n=Yc.get(Ms(e));return n?Yh.get(n.import)??"Inter":"Inter"}var Xh=Object.keys(ht),Hc='ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',$c='Georgia, "Times New Roman", serif',Vc='"SFMono-Regular", Consolas, monospace',Qh=new Set(["serif","sans-serif","sans serif","monospace","mono","cursive","fantasy","system-ui","ui-serif","ui-sans-serif","ui-monospace"]),Zh=new Set(["Playfair Display","Lora","Fraunces","Cormorant Garamond","Noto Serif SC"].map(e=>e.toLowerCase())),Jh=new Set(["JetBrains Mono","IBM Plex Mono"].map(e=>e.toLowerCase()));function eS(e){let n=e.toLowerCase();return Jh.has(n)||n.includes("mono")?"mono":Zh.has(n)||n.includes("serif")?"serif":"sans"}function Ro(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=>Qh.has(m.toLowerCase());if(i&&a(i)){let m=i.toLowerCase();return m.includes("mono")?Vc:m.includes("serif")?$c:Hc}let c=i;c||(c=a(o)?"":o),c||(c="Inter");let r=eS(c);return r==="mono"?`"${c}", ${Vc}`:r==="serif"?`"${c}", ${$c}`:`"${c}", ${Hc}`}function tS(e){return{"--site-font-sans":Ro(e?.body,"Inter"),"--site-font-heading":Ro(e?.heading,e?.body??"Inter")}}var Io=["archivo-inter","playfair-source-sans","space-grotesk-manrope","fraunces-libre-franklin","noto-serif-sc-noto-sans-sc","noto-sans-sc"],Xc=[{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 Qc(e){let n=Xc.find(s=>s.id===e);if(!n)throw new Error(`Unknown font pairing: ${e}`);return n}import{z as on}from"zod";import{z as nS}from"zod";var sS=["light","standard","bold"],We=nS.enum(sS),Us="standard",iS=new Set(["display","heading","title"]),Zc={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}},Gw=Object.keys(Zc.standard).map(e=>`--site-weight-${e}`),qw="--site-leading-body",Ww=["--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 oS={"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 To(e){return e.trim().replace(/\s+/g,"_").toLowerCase()}var aS=new Set(Object.entries(ht).flatMap(([e,n])=>[To(e),To(n.import)]));function ko(e){if(!(e in ht)&&!aS.has(To(e)))return null;let n=sn(e);return ht[n].download===!1?null:oS[n]??Je(100,900)}function Jc(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 Bw(e,n){let s=Zc[e??Us],i=n?.heading?ko(n.heading):null,o=n?.body?ko(n.body):null,a={};for(let c of Object.keys(s)){let r=iS.has(c)?i:o;a[`--site-weight-${c}`]=String(Jc(s[c],r))}return a}var rS=/^(zh|ja|ko)(?:[-_]|$)/i,cS=/^(ar|fa|hi|bn|ta|si|th|lo|km|my|vi)(?:[-_]|$)/i;function em(e){return rS.test(e??"")?"dense":cS.test(e??"")?"tall":"default"}function mS(e){return em(e)==="dense"?"1.75":"1.5"}var lS={default:["1.1","1.2","1.3"],dense:["1.2","1.3","1.4"]};function Kw(e){let n=em(e),s=mS(e),[i,o,a]=n==="tall"?[s,s,s]:lS[n];return{"--site-leading-display":i,"--site-leading-heading":o,"--site-leading-title":a}}function zw(e,n){let s=ko(e);return[...new Set(n.map(o=>Jc(o,s)))].sort((o,a)=>o-a).map(String)}var an="/* <cms-builder:site-design-notes>",Kt="</cms-builder:site-design-notes> */",Ao="palette-inputs: ",Po="type-inputs: ",At=on.string().min(1).max(40),wo=on.object({primarySource:on.enum(["user","derived"]),neutral:At.optional(),foreground:At.optional(),supporting:on.array(At).max(4).optional(),imagePalette:on.object({background:At.optional(),foreground:At.optional(),card:At.optional(),muted:At.optional(),border:At.optional()}).optional()}),pS=on.object({weightStyle:We}),dS=e=>e.replaceAll("*/","* /").replace(/\s+/g," ").trim();function uS(e){let n=e.lines.map(dS).filter(Boolean).map(s=>` ${s}`);return e.paletteInputs&&n.push(` ${Ao}${JSON.stringify(e.paletteInputs).replaceAll("*/","* /")}`),e.typeInputs&&n.push(` ${Po}${JSON.stringify(e.typeInputs).replaceAll("*/","* /")}`),[an,...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 hd}from"zod";var Q=hd.uuidv7(),sk=Q,ik=Q,ak=Q,ok=Q,rk=Q,ck=Q,mk=Q,k=Q,Yt=Q,$o=Q,ke=Q,Ri=Q,I=Q,Vo=Q,$=Q,Yo=Q,st=Q,rs=Q,lt=Q,lk=Q,pk=Q,cs=Q,it=Q,Xo=Q,dk=Q,uk=Q,gk=Q,En=Q,_k=Q,hk=Q,Sk=Q;var Qo=Q,Ii=j.enum(["external_site_edit","page_template_create"]),Sd=200,Lt=j.string().min(1).max(Sd),fd=4e3,Zo=j.enum(["succeeded","degraded","no_changes","failed"]),Rn=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"]),In=j.object({code:j.enum(["preexisting_placeholder_media"]),block_ids:j.array(j.string().min(1))}).strict(),bd=["sandbox_unavailable"];function xk(e){return e!=null&&bd.includes(e)}var yd=j.enum(["pending","delivered","failed"]),xd=j.enum(["running","succeeded","degraded","no_changes","failed"]),Ek=j.object({site_id:k,external_run_id:Lt,external_thread_id:Lt,prompt:j.string().min(1).max(fd),thread_title:j.string().trim().min(1).max(200).optional()}).strict(),Ti=j.enum(["added","modified","deleted"]),Ed=j.enum(["landing_page","general_page","detail_page"]),Rd=j.enum(["header","footer","styles","layout"]),Jo={block_id:j.string().min(1),type:j.string().min(1),change:Ti},er={slug:j.string().min(1),title:j.string().min(1),page_type:Ed,change:Ti},Id=j.object({kind:Rd,change:Ti}).strict(),tr={site_wide:j.array(Id),unclassified_count:j.number().int().nonnegative()},Td=j.object(Jo).strict(),kd=j.object({...er,sections:j.array(Td)}).strict(),Ad=j.object({pages:j.array(kd),...tr}).strict(),wd=j.object({...Jo,label:j.string().min(1)}).strict(),Pd=j.object({page_id:j.number().int().positive().nullable(),...er,sections:j.array(wd)}).strict(),nr=j.object({pages:j.array(Pd),...tr}).strict(),Rk={pages:[],site_wide:[],unclassified_count:0},Ik=j.object({base_snapshot_id:I,target_snapshot_id:I}).strict(),Tk=j.object({data:Ad}).strict(),ms=j.object({id:Qo,execution_scene:Ii.default("external_site_edit"),site_id:k,external_run_id:j.string().min(1).nullable(),external_thread_id:j.string().min(1).nullable(),status:xd,outcome:Zo.nullable(),degraded_reason:Rn.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:yd.nullable(),created_at:j.string().min(1),started_at:j.string().min(1).nullable(),finished_at:j.string().min(1).nullable(),changes:nr.nullable().default(null),advisories:j.array(In).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"})}),kk=j.object({task:ms}).strict(),Ak=j.object({task:ms}).strict(),wk=j.object({task_id:Qo,external_run_id:j.string().min(1),external_thread_id:j.string().min(1),site_id:k,vcp_run_id:$.nullable(),outcome:Zo,degraded_reason:Rn.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:nr.nullable().default(null)}).strict(),Pk=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"}),Tn=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 sr(e){return/^\[\[\.\.\.[^\[\]]+\]\]$|^\[[^\[\]]+\]$/.test(e)}function ls(e){let n=/^(?:src\/)?app\/\.vcp\/page-templates\/(.+)\/page\.tsx$/.exec(e);if(!n)return!1;let s=n[1].split("/"),i=s.some(sr),a=i?s[0]:s.pop(),o=i?s.slice(1):s;if(i&&o.length===0||!/^[A-Za-z0-9_-]{1,255}$/.test(a)||!Tn.safeParse(`/${o.join("/")}`).success||o.some(c=>c?c.includes("[")||c.includes("]")?!sr(c):/[\[\]()%]/.test(c)||c.startsWith("_")||c.startsWith("@"):!0))return!1;try{let c=atob(a.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(/=+$/,"")===a}catch{return!1}}var ir=re.object({page_path:Tn,template_id:Xe,instruction:re.string().min(1).refine(e=>e.trim().length>0)}).strict(),ar=3;function or(e){return e.replace(/\/+$/,"")||"/"}var Nk=re.object({external_run_id:Lt,external_thread_id:Lt,items:re.array(ir).min(1).max(ar)}).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:or(n.page_path)}))})).superRefine((e,n)=>{let s=new Set;e.items.forEach((i,a)=>{let o=JSON.stringify([i.page_path,i.template_id]);s.has(o)&&n.addIssue({code:"custom",path:["items",a],message:"Duplicate normalized page_path/template_id identity"}),s.add(o)})}),rr=re.object({items:re.array(ir).min(1).max(ar)}).strict().refine(e=>e.items.every(n=>n.page_path===or(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"}),cr=e=>[...new Set(e)],jk=re.object({page_path:Tn,template_id:Xe,exit_template_ids:re.array(Xe).default([]).transform(cr)}).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"}),Lk=re.object({page_path:Tn,template_ids:re.array(Xe).min(1).transform(cr)}).strict(),mr={ok:re.literal(!0),site_id:k,page_path:Tn,route_id:re.string().min(1),snapshot_id:I,advisories:re.array(In).default([])},Cd=ms.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)}),Mk=re.object({task:Cd}).strict(),Uk=re.object({...mr,promoted_template_id:Xe,deleted_template_ids:re.array(Xe),status:re.literal("promoted")}).strict(),Fk=re.object({...mr,deleted_template_ids:re.array(Xe),status:re.literal("cleaned")}).strict(),Gk=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 ps}from"zod";var lr=ps.object({primary_products:ps.string().trim().min(1).max(1e3).optional(),current_markets:ps.string().trim().min(1).max(1e3).optional(),qualifications:ps.string().trim().min(1).max(1e3).optional()}).strict();function Bk(e){return Object.values(e).some(n=>typeof n=="string"&&n.trim().length>0)}import{z as pt}from"zod";var pr={autoplay:pt.boolean().optional(),intervalMs:pt.number().int().min(5e3).max(15e3).optional(),loop:pt.boolean().optional()},ds=pt.discriminatedUnion("kind",[pt.object({kind:pt.literal("media-carousel"),presentation:pt.enum(["flat","angled"]).optional(),...pr}).strict(),pt.object({kind:pt.literal("category-carousel"),...pr}).strict()]);import{z as kn}from"zod";var vd=40,Mt=kn.object({protocol:kn.enum(["phone","form","download","route","external"]),ctaLabel:kn.string().min(1).max(vd),ctaTarget:kn.string().min(1).max(200).optional(),requiresOwnerDetail:kn.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 Yk(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:Dd(e.VCP_REDIS_PORT,56379)}}function Dd(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 Od=ae.enum(["component","page","shared"]),Nd=ae.enum(["generation_failed","repair_exhausted","page_unusable","check_incomplete","design_missing","chrome_fallback","style_fallback","resume_exhausted","user_stopped","conflict"]),dr=ae.object({kind:Od,target_id:ae.string().min(1),page_id:ae.string().min(1).nullable(),reason:Nd,repair_attempts:ae.number().int().nonnegative(),message:ae.string().min(1),filled:ae.boolean().optional()}).strict(),jd=ae.enum(["complete","partial","omitted","check_incomplete","pending"]),Ld=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:jd,attempts:ae.number().int().nonnegative(),omissions:ae.array(dr)}).strict(),An=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(Ld),shared:ae.array(dr),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(),ur=ae.object({type:ae.literal("workspace.generation_ledger"),ledger:An,at:ae.string().min(1)}).strict();function Zk(e){return e.pages.filter(n=>n.result==="complete"||n.result==="partial").length}function Jk(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 ki=F.enum(["text","url","document","image"]),Ai=F.enum(["pending","ready","failed"]),Md=F.enum(["pending","ready","failed"]),Ud=F.enum(["product","price","contact","copy","audience","other"]),us=F.object({fact:F.string().min(1).max(300),kind:Ud,source_id:En,quote:F.string().min(1).max(500),trust:F.enum(["verbatim","ocr"]).default("verbatim")}),Fd=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:En,nav_structure:F.array(F.string().min(1).max(30)).max(12),page_patterns:F.array(Fd).max(10),tone:F.array(F.string().min(1).max(20)).max(8),screenshot_ref:F.string().optional()}),Gd=F.object({source_id:En,type:ki,status:Ai,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()}),_s=F.object({topic:F.string().min(1).max(80),variants:F.array(F.object({value:F.string().min(1).max(300),source_id:En})).min(2)}),qd=F.object({type:F.literal("text"),content:F.string().min(20).max(1e4),title:F.string().min(1).max(120).optional()}).strict(),Wd=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(),s0=F.discriminatedUnion("type",[qd,Wd]),i0=[".docx",".html",".md",".txt"],a0=["application/vnd.openxmlformats-officedocument.wordprocessingml.document","text/html","text/markdown","text/x-markdown","text/plain","application/octet-stream"],o0=10*1024*1024,r0=2,c0=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 m0(e){return e===!0||e==="true"}var l0=[".png",".jpg",".jpeg",".webp"],p0=["image/png","image/jpeg","image/webp","application/octet-stream"],d0=8*1024*1024,u0=10,Bd=F.enum(["asset","reference"]),g0=F.object({image_role:Bd,title:F.string().min(1).max(120).optional()}).strict(),_0=F.object({version:F.literal(1),site_id:k,tenant_id:F.string().min(1),user_prompt:F.string(),status:Md,sources:F.array(Gd).max(16),facts:F.array(us).max(120),reference:gs.optional(),conflicts:F.array(_s).max(20)}).superRefine((e,n)=>{let s=new Map(e.sources.map(i=>[i.source_id,i]));for(let[i,a]of e.facts.entries()){let o=s.get(a.source_id);(!o||o.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),a=i?.type==="image"&&i.source_metadata.image_role==="reference";(!i||i.type!=="url"&&!a)&&n.addIssue({code:"custom",path:["reference","source_id"],message:"reference must point at a url source or reference image source"})}});function h0(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 hs}from"zod";var _e=hs.object({routeId:hs.string().min(1),templateId:Xe.optional()}).strict(),K=hs.object({routeId:hs.string().min(1),effectiveTemplateId:Xe.optional()}).strict();function wi(e){return JSON.stringify([e.routeId,e.effectiveTemplateId??null])}function y0(e){let n;try{n=JSON.parse(e)}catch{return null}if(!Array.isArray(n)||n.length!==2)return null;let[s,i]=n,a=K.safeParse(i===null?{routeId:s}:{routeId:s,effectiveTemplateId:i});return a.success?a.data:null}var Kd=["design.md","DESIGN.md"],gr=["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"],Hd=["app/globals.css","src/app/globals.css"],$d=[".cjs",".css",".cts",".html",".js",".json",".jsx",".md",".mdx",".mjs",".mts",".ts",".tsx",".txt",".yaml",".yml"],Vd=new Set($d),Pi="source-delete",_r=L.literal(Pi),Re=L.string().min(1).refine(Sr,"Invalid site edit source path"),Yd=L.string().min(1).refine(su,"Invalid site edit source directory path"),T0=L.enum(["text","binary"]),Ss=L.object({composition:K,path:Re,language:L.string().min(1).nullable(),sizeBytes:L.number().int().nonnegative(),contentHash:L.string().min(1).optional()}).strict(),Xd=L.discriminatedUnion("kind",[Ss.extend({kind:L.literal("text"),language:L.string().min(1),readonly:L.boolean().default(!1)}),Ss.extend({kind:L.literal("binary"),language:L.null(),mimeType:L.string().min(1).optional(),readonly:L.literal(!0)})]),hr=L.lazy(()=>L.discriminatedUnion("kind",[L.object({kind:L.literal("directory"),name:L.string().min(1),path:Yd,children:L.array(hr)}),L.object({kind:L.literal("file"),name:L.string().min(1),path:Re,file:Xd}).superRefine((e,n)=>{e.path!==e.file.path&&n.addIssue({code:"custom",path:["file","path"],message:"file.path must match node path"})})])),Qd=L.enum(["max-files","max-depth","max-total-bytes"]),Zd=L.object({reasons:L.array(Qd).min(1),maxFiles:L.number().int().positive(),maxDepth:L.number().int().positive(),maxTotalBytes:L.number().int().positive()}),k0=L.object({composition:K,nodes:L.array(hr),defaultPath:Re.optional(),totalFiles:L.number().int().nonnegative(),truncated:Zd.optional()}).strict(),A0=L.object({composition:_e}).strict(),w0=L.object({path:Re,composition:_e}).strict(),Jd=Ss.extend({kind:L.literal("text"),language:L.string().min(1),readonly:L.boolean().default(!1),content:L.string()}),eu=L.enum(["too-large","unsupported-mime","bytes-unavailable"]),tu=Ss.extend({kind:L.literal("binary"),language:L.null(),readonly:L.literal(!0),mimeType:L.string().min(1),contentBase64:L.string().min(1).optional(),previewUnavailableReason:eu.optional()}),P0=L.discriminatedUnion("kind",[Jd,tu]),C0=L.object({key:L.string().min(1),composition:_e}).strict(),nu=L.object({startLine:L.number().int().positive(),startColumn:L.number().int().nonnegative(),endLine:L.number().int().positive(),endColumn:L.number().int().nonnegative()}),v0=L.object({key:L.string().min(1),composition:K,sourceFile:Re,componentName:L.string().min(1),openingElementRange:nu,structuralPath:L.string().min(1),textPreview:L.string().min(1).optional()}).strict();function Sr(e){return!fs(e)&&!au(e)||cu(e)?!1:Di(e)||yr(e)||br(e)||fr(e)||gr.some(n=>e===n||e.startsWith(`${n}/`))}function Ci(e){return Di(e)||Vd.has(ru(e))}function su(e){return!fs(e)&&!ou(e)||mu(e)?!1:e==="app"||e.startsWith("app/")||e==="src"||e==="src/app"||e.startsWith("src/app/")||gr.some(n=>e===n||e.startsWith(`${n}/`)||n.startsWith(`${e}/`))}function iu(e){return Di(e)}function vi(e){return Sr(e)?iu(e)?"design-document":br(e)?"route-entry":yr(e)?"app-global-style":e.toLowerCase()==="lib/generated/media-assets.ts"||e.toLowerCase()==="src/lib/generated/media-assets.ts"?"generated-media-manifest":fr(e)?"system-page":null:null}function fr(e){return zd.includes(e)}function D0(e){return vi(e)!==null}function br(e){return/^(?:src\/)?app\/(?:.*\/)?page\.[cm]?[jt]sx?$/.test(e.toLowerCase())}function au(e){return ls(e)&&fs(e.replace("/.vcp/","/_vcp/"))}function ou(e){return/^(?:src\/)?app\/\.vcp(?:\/page-templates(?:\/.+)?)?$/i.test(e)?fs(e.replace("/.vcp","/_vcp")):!1}function yr(e){return Hd.some(n=>n.toLowerCase()===e.toLowerCase())}function ru(e){let n=e.split("/").at(-1)??e,s=n.lastIndexOf(".");return s>0?n.slice(s).toLowerCase():""}function Di(e){return!e.includes("/")&&Kd.some(n=>n.toLowerCase()===e.toLowerCase())}function cu(e){let n=e.toLowerCase(),s=n.split("/"),a=(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:a==="server"||a==="db"||a==="database"||a==="auth"||a==="secret"||a==="secrets"||a==="token"||a==="tokens"||a==="credential"||a==="credentials"||s.includes("server")||s.includes("secrets")}function mu(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 fs(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 Ae}from"zod";var xr=Ae.string().min(1).max(320).refine(e=>!e.includes("..")&&/^(?:(?:src\/)?(?:app|pages|components|lib|hooks|utils|types)\/|next\.config\.)[\w./()[\]@-]+$/.test(e)),lu=Ae.union([xr,Ae.string().max(320).regex(/^\.next\/[\w./()[\]@-]+\.js$/).refine(e=>!e.includes(".."))]),Oi=Ae.object({code:Ae.enum(["NEXT_PAGE_CODE_ERROR","NEXT_CLIENT_COMPONENT_FUNCTION_PROP"]),message:Ae.string().min(1).max(2e3),messages:Ae.array(Ae.string().min(1).max(2e3)).max(3),source_paths:Ae.array(xr).max(8),components:Ae.array(Ae.string().max(80).regex(/^[\w.$-]+$/)).max(8),stack:Ae.array(Ae.object({file:lu,line:Ae.number().int().positive(),column:Ae.number().int().nonnegative(),function:Ae.string().max(80),generated:Ae.boolean()}).strict()).max(8)}).strict();function pu(e){return e==="NEXT_PAGE_CODE_ERROR"||e==="NEXT_CLIENT_COMPONENT_FUNCTION_PROP"}import{z as du}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"],uu=["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"],gu=[...wn,...uu],_u=new Set(["ar","fa","he"]),M0=[{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"}],hu={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"},Su=new Set(wn);function Er(e){return Su.has(e)?e:hu[e]}var fu="en";function U0(e){let n=e.toLowerCase().split("-",1)[0]??"";return _u.has(n)?"rtl":"ltr"}var bu={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 F0(e){return bu[e]??fu}var yu=["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"],xu=new Set(yu);function G0(e){return xu.has(e)}var Ie=du.enum(gu);import{z as Eu}from"zod";var bs=Eu.string().uuid();import{z as S}from"zod";import{z as J}from"zod";var Et=J.string().trim().min(1).max(128),Qt=J.string().trim().min(1).max(500),Ru=["\u4EA7\u54C1","\u90E8\u4EF6/\u8017\u6750","\u5E94\u7528\u65B9\u6848","\u5B9A\u5236/OEM","\u670D\u52A1","\u8D44\u8D28/\u80FD\u529B"],ys=J.enum(Ru),Pn=J.object({id:Et,keyword:J.string().trim().min(1).max(255),business_ids:J.array(Et).min(1),category:ys,selling_points:J.string().trim().max(2e3),intent:Qt,semantic_group:Et,monthly_volume:J.number().int().min(1),keyword_difficulty:J.number().min(0).max(100).nullable(),variants:J.array(J.string().trim().min(1).max(255)),source:J.literal("semrush"),source_evidence:J.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"})}),Ni=J.object({schema_version:J.literal(1),snapshot_id:Et,dependency_hash:J.string().regex(/^[a-f0-9]{64}$/),language:J.string().trim().min(2).max(35),database:J.string().regex(/^[a-z]{2}$/),generated_at:J.string().datetime({offset:!0}),entries:J.array(Pn),candidates:J.array(Pn),search_result_ids:J.array(Et).optional()}).strict().superRefine((e,n)=>{for(let s of["entries","candidates"]){let i=e[s];(new Set(i.map(a=>a.id)).size!==i.length||new Set(i.map(a=>a.keyword.normalize("NFKC").trim().toLowerCase())).size!==i.length)&&n.addIssue({code:"custom",path:[s],message:"\u5173\u952E\u8BCD\u4E0D\u80FD\u91CD\u590D"})}}),Iu=J.object({entry_id:Et,category:ys,selling_points:J.string().trim().max(2e3)}).strict(),xs=J.object({snapshot_id:Et,entry_ids:J.array(Et),entry_edits:J.array(Iu).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,a)=>{s.has(i.entry_id)||n.addIssue({code:"custom",path:["entry_edits",a,"entry_id"],message:"\u53EA\u80FD\u7F16\u8F91\u5DF2\u9009\u5173\u952E\u8BCD"})})}),z0=J.object({expected_revision:J.number().int().nonnegative(),business_subject:J.string().trim().min(1).max(255)}).strict(),Rr=J.object({points:J.array(Qt).length(3),comparison:J.array(J.object({dimension:Qt,recommended:Qt,alternative:Qt}).strict()).min(1).max(4)}).strict();var at=S.string().trim().min(1).max(128),Ut=S.string().trim().min(1).max(200),Qe=S.string().trim().min(1).max(2e3),ji=S.string().trim().max(200),Es=S.string().regex(/^[a-f0-9]{64}$/),Li=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,Tu=["keywords"],Cn=Zt.filter(e=>!Tu.includes(e)),Rs=Cn.length,Is=S.enum(Zt);function X0(e){return Cn.some(n=>n===e)}var Ts=Is,Ir=["recommended","conservative","focused"],Tr=S.enum(Ir),vn=S.union([Tr,S.literal("confirmed")]),ks=S.enum(["single_country","regional_combination","multi_market"]),As=S.object({code:S.string().trim().regex(/^[A-Z]{2}$/),name_zh:Ut,name_en:Ut,region:Ut}).strict(),ku=S.object({id:at,name:S.string().trim().min(1).max(255),category:ys}).strict(),ws=S.array(ku).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."})}),kr=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."})})}),Au=S.object({id:Tr,presentation:Rr.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:ks.nullish(),markets:S.array(As).max(32).optional(),promoted_businesses:ws.optional(),plan:kr.nullish()}).loose(),wu=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(),Pu=S.object({source_type:S.enum(["step2","step3"]),source_id:at,field_path:S.string().trim().max(300).nullish()}).strict(),Cu=S.enum(["ok","degraded"]),Mi=S.object({key:Ts,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(Au).max(3),keyword_library:Ni.nullish(),plan:kr.nullish(),structure_detail:wu.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(Pu).min(1).max(8),generation_status:Cu.optional()}).loose().superRefine((e,n)=>{let s=new Map,i=new Map,a=Zt.indexOf(e.key)+1;a>0&&e.position!==a&&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((o,c)=>{o.id!==Ir[c]&&n.addIssue({code:"custom",path:["options",c,"id"],message:"Step5 strategy options must use the canonical order."}),e.key==="product"&&!o.promoted_businesses&&n.addIssue({code:"custom",path:["options",c,"promoted_businesses"],message:"Product options require the ordered promoted businesses."}),e.key!=="product"&&o.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(o.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 g=`${m.category}\0${m.name.normalize("NFKC").toLocaleLowerCase()}`,P=i.get(g);P&&P!==m.id?n.addIssue({code:"custom",path:["options",c,"promoted_businesses",r],message:"A promoted business must keep its stable ID."}):i.set(g,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."})}),vu=S.object({item_key:Is,selected_option_id:vn,note:ji,keyword_selection:xs.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"})}),Ui=S.object({item_key:Is,selected_option_id:vn,note:ji,keyword_selection:xs.optional(),keyword_library:Ni.optional(),market_type:ks.nullish(),markets:S.array(As).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."})}),Du=S.enum(["running","succeeded","failed"]),Ou=S.object({schema_version:S.literal(1),source_job_id:at,site_id:at,output_locale:Li.optional(),items:S.array(Mi).length(Ne),decisions:S.array(Ui).min(Rs).max(Ne)}).loose(),Nu=S.object({strategy_version_id:at,site_id:at,source_job_id:at,output_locale:Li.optional(),version:S.number().int().positive(),checksum:Es,snapshot:Ou,committed_at:S.string().datetime({offset:!0})}).loose(),Ar=S.object({job_id:at,site_id:at,output_locale:Li.optional(),status:Du,keyword_library_needs_update:S.boolean().optional(),revision:S.number().int().nonnegative(),items:S.array(Mi).max(Ne),decisions:S.array(Ui).max(Ne),output_checksum:Es.nullish(),error_code:S.string().trim().max(64).nullish(),error_message:S.string().trim().max(500).nullish(),committed_version:Nu.nullish()}).loose().superRefine((e,n)=>{let s=e.items.map(a=>a.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(a=>a.item_key);new Set(i).size!==i.length&&n.addIssue({code:"custom",path:["decisions"],message:"Step5 job decisions must have unique item keys."})}),Q0=S.object({force_refresh:S.boolean().optional().default(!1)}).strict(),Z0=Ar.extend({cached:S.boolean()}).strict(),J0=S.object({expected_revision:S.number().int().nonnegative()}).strict(),eA=S.object({expected_revision:S.number().int().nonnegative(),selected_option_id:vn,note:ji,keyword_selection:xs.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"})}),tA=S.object({revision:S.number().int().positive(),decision:Ui}).strict(),nA=S.object({idempotency_key:S.string().trim().min(8).max(128),expected_revision:S.number().int().nonnegative(),decisions:S.array(vu).min(Rs).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."}),Cn.forEach(i=>{s.includes(i)||n.addIssue({code:"custom",path:["decisions"],message:`Step5 commit is missing ${i}.`})})}),sA=S.object({strategy_version_id:at,version:S.number().int().positive(),checksum:Es,next_path:S.string().trim().min(1).max(500)}).strict(),ju=Ar.extend({completed:S.number().int().min(0).max(Ne),total:S.literal(Ne)}).loose(),Lu=["snapshot","strategy_item_start","strategy_item_done","strategy_items_invalidated","strategy_generation_done","failed"];function iA(e){return typeof e=="string"&&Lu.includes(e)}var aA=S.discriminatedUnion("event",[S.object({id:S.number().int().nonnegative(),event:S.literal("snapshot"),data:ju}).strict(),S.object({id:S.number().int().positive(),event:S.literal("strategy_item_start"),data:S.object({key:Is,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:Mi}).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:Es}).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:Ts.optional()}).loose()}).loose()]);import{z as Mu}from"zod";var Ze=Mu.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 cA(e,n){let s=Ze.safeParse(e),i=Ze.safeParse(n);if(!s.success||!i.success)return null;let a=wr(s.data),o=wr(i.data);for(let r=0;r<3;r+=1){let m=Pr(a.release[r],o.release[r]);if(m!==0)return m}if(!a.prerelease&&!o.prerelease)return 0;if(!a.prerelease)return 1;if(!o.prerelease)return-1;let c=Math.max(a.prerelease.length,o.prerelease.length);for(let r=0;r<c;r+=1){let m=a.prerelease[r],x=o.prerelease[r];if(m===void 0)return-1;if(x===void 0)return 1;if(m===x)continue;let g=/^\d+$/u.test(m),P=/^\d+$/u.test(x);return g&&P?Pr(BigInt(m),BigInt(x)):g?-1:P?1:Uu(m,x)}return 0}function wr(e){let n=e.indexOf("+"),s=n===-1?e:e.slice(0,n),i=s.indexOf("-"),a=i===-1?s:s.slice(0,i),o=i===-1?void 0:s.slice(i+1),[c,r,m]=a.split(".");return{release:[BigInt(c),BigInt(r),BigInt(m)],...o?{prerelease:o.split(".")}:{}}}function Pr(e,n){return e<n?-1:e>n?1:0}function Uu(e,n){return e<n?-1:e>n?1:0}import{z as Z}from"zod";import{z as ye}from"zod";var Fi=64,Fu=512*1024,Gi=4*1024*1024,Gu=/^(?!\/)(?!.*\\)(?!.*(?:^|\/)\.\.(?:\/|$))(?!.*\/\/).+/;function qu(e){return Gu.test(e)}var Cr=ye.string().min(1).refine(qu,{message:"Materialization pathTemplate must be a safe relative path."}),Wu=ye.object({pathTemplate:Cr,content:ye.string(),role:ye.string().min(1).optional()}).strict(),Bu=ye.union([ye.object({kind:ye.literal("default")}).strict(),ye.object({kind:ye.literal("named"),name:ye.string().min(1)}).strict()]),Ku=ye.object({pathTemplate:Cr,export:Bu}).strict(),zu=ye.array(ye.never()).optional(),Ft=ye.object({instanceBaseName:ye.string().min(1),files:ye.array(Wu).min(1).max(Fi),entry:Ku,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,a=0;for(let[o,c]of e.files.entries()){s.has(c.pathTemplate)&&n.addIssue({code:"custom",path:["files",o,"pathTemplate"],message:`Duplicate materialization pathTemplate: ${c.pathTemplate}`}),s.add(c.pathTemplate);let r=new TextEncoder().encode(c.content).length;r>Fu&&n.addIssue({code:"custom",path:["files",o,"content"],message:"Materialization file content exceeds the per-file byte limit."}),a+=r}s.has(i)||n.addIssue({code:"custom",path:["entry","pathTemplate"],message:"Materialization entry pathTemplate must match a file."}),a>Gi&&n.addIssue({code:"custom",path:["files"],message:"Materialization exceeds the total content byte limit."})});var vr="insertNewComponent",gA={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"},qi=Z.number().int().positive().refine(Number.isSafeInteger,"Must be a safe positive integer"),Dr=Z.lazy(()=>Z.object({id:Z.string().uuid(),key:Z.string().min(1),name:Z.string(),children:Z.array(Dr)}).strict()),Or=Z.object({category_group_key:Z.literal(vr),categories:Z.array(Dr)}).strict(),Hu=Z.object({resource_id:Z.string().min(1),name:Z.string(),description:Z.string().nullable(),thumbnail_url:Z.string().nullable(),resolved_version:qi,category_id:Z.string().uuid().nullable()}).strict(),Nr=Z.object({category_group_key:Z.literal(vr),items:Z.array(Hu),next_cursor:Z.string().min(1).nullable()}).strict(),_A=Z.object({resource_id:Z.string().min(1),resolved_version:qi,anchor_block_id:Z.string().min(1),placement:Z.enum(["before","after"])}).strict(),hA=Z.object({status:Z.literal("mock_acknowledged")}).strict(),SA=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=qi,fA=Z.object({version:Gt}).strict(),jr=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 Ur="/",Fr=255,$u=2048,Vu=5e3,Yu=64;function Gr(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(Fr).refine(Gr,"url_path must be a safe site-relative path"),Ki=h.string().min(1).max($u).refine(Gr,"url must be a safe site-relative path"),zi=h.string().max(Fr),Ps=h.preprocess(e=>e===0?!1:e===1?!0:e,h.boolean()),Dn=h.union([h.url(),Ki]),Hi=h.enum(["landing_page","general_page","detail_page"]),$i=h.enum([...Hi.options,"list_page","category_page","tag_page","author_page","search_page","date_page"]);function EA(e){return e.vcp_managed&&e.url!==null&&Hi.safeParse(e.page_type).success&&qt.safeParse(e.url_path).success}function Lr(e){return e.includes("{")||e.includes("}")}function RA(e){if(!Lr(e.url_path))return Xu(e.url_path);if(e.url===null)return null;let n=/^[a-z][a-z0-9+.-]*:\/\//iu.test(e.url)?Qu(e.url):e.url;if(n===null||Lr(n))return null;let s=Ki.safeParse(n);return s.success?s.data:null}function Xu(e){let n=qt.safeParse(e);return n.success?n.data:null}function Qu(e){try{return new URL(e).pathname}catch{return null}}var qr=h.lazy(()=>h.object({cms_page_id:h.number().int().positive(),title:h.string().trim().min(1).max(255),url_path:zi,url:Dn.nullable(),page_type:$i,vcp_managed:Ps,children:h.array(qr)}).strict()),Zu=h.object({group_id:h.string().min(1),title:h.string().trim().min(1).max(255),collection_slug:h.string(),pages:h.array(qr)}).strict(),Mr=h.object({groups:h.array(Zu)}).strict(),Wr=h.lazy(()=>h.object({id:h.number().int().positive(),title:h.string().trim().min(1).max(120),url_path:zi,parent_id:h.number().int().nonnegative(),group_type:h.string().min(1),page_type:$i,plugin_id:h.number().int().nonnegative(),is_default:Ps,is_published:Ps,url:Dn.nullable(),vcp_managed:Ps,children:h.array(Wr)})),Ju=h.object({plugin_id:h.number().int().nonnegative(),slug:h.string(),group_name:h.string().trim().min(1).max(255),pages:h.array(Wr)}).passthrough(),eg=h.array(Ju);function Br(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,children:e.children.map(n=>Br(n))}}function IA(e){if(!tg(e))return null;let n=Mr.safeParse(e);if(n.success)return n.data;let s=eg.safeParse(e);if(!s.success)return null;let i=Mr.safeParse({groups:s.data.map(a=>({group_id:String(a.plugin_id),title:a.group_name,collection_slug:a.slug,pages:a.pages.map(Br)}))});return i.success?i.data:null}function tg(e){let n=Array.isArray(e)?e:Wi(e)&&Array.isArray(e.groups)?e.groups:[],s=[];for(let a of n)if(!(!Wi(a)||!Array.isArray(a.pages)))for(let o of a.pages)s.push({node:o,depth:1});let i=0;for(;s.length>0;){let a=s.pop();if(i+=1,i>Vu||a.depth>Yu)return!1;if(!(!Wi(a.node)||!Array.isArray(a.node.children)))for(let o of a.node.children)s.push({node:o,depth:a.depth+1})}return!0}function Wi(e){return typeof e=="object"&&e!==null}var ng=h.enum(["invalid_url_path","missing_url","not_vcp_managed","unsupported_page_type","page_not_generated"]),sg=h.enum(["home_page","invalid_url_path","not_selectable","not_vcp_managed","page_has_children","last_selectable_page","cms_unbound","unsupported_page_type"]),Kr=h.lazy(()=>h.object({cms_page_id:h.number().int().positive().nullable(),title:h.string().trim().min(1).max(255),url_path:zi,preview_url_path:Ki.nullable(),url:Dn.nullable(),page_type:$i,vcp_managed:h.boolean(),selectable:h.boolean(),disabled_reason:ng.nullable(),can_delete:h.boolean(),delete_block_reason:sg.nullable(),has_cms_children:h.boolean(),children:h.array(Kr)}).strict()),zr=h.object({group_id:h.string().min(1),title:h.string().trim().min(1).max(255),pages:h.array(Kr)}).strict(),TA=h.object({base_snapshot_id:I,expected_url_path:qt}).strict(),ig=h.enum(["succeeded","failed"]),ag=h.object({url_path:qt,phase:h.enum(["ensure","binding","delete"]),code:h.string().min(1),message:h.string().min(1)}).strict(),Vi=h.object({status:ig,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(ag),warnings:h.array(h.string().min(1))}).strict(),og=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:Dn.nullable(),previous_url:Dn.nullable(),cms_reconcile_result:Vi}).strict(),kA=h.object({code:h.literal(0),message:h.string(),data:og}).strict(),AA=h.object({snapshot_id:I}).strict(),rg=h.object({snapshot_id:I,warnings:h.array(h.string().min(1)),cms_reconcile_result:Vi}).strict(),wA=h.object({code:h.literal(0),message:h.string(),data:rg}).strict(),PA=h.object({snapshot_id:I}).strict(),cg=h.object({snapshot_id:I,status:h.enum(["converged","required","unknown"]),reason:h.string().min(1).max(255).optional()}).strict(),CA=h.object({code:h.literal(0),message:h.literal("ok"),data:cg}).strict(),vA=h.object({source_committed:h.boolean(),result_snapshot_id:I.optional(),cms_reconcile_result:Vi.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"})}),mg=Hi,lg=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(),Hr=h.object({url_path:qt,title:h.string().trim().min(1).max(255),kind:mg,route_file:h.string().min(1),collection_id:h.string().trim().min(1).optional(),seo:lg.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===Ur)&&n.addIssue({code:"custom",path:["kind"],message:"The home target must be the only landing_page target."})}),pg=h.object({complete:h.literal(!0),targets:h.array(Hr)}).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===Ur).length!==1&&n.addIssue({code:"custom",path:["targets"],message:"A complete page target set must contain exactly one home page."})}),DA=h.discriminatedUnion("complete",[pg,h.object({complete:h.literal(!1),targets:h.array(Hr),errors:h.array(h.string().min(1)).min(1)}).strict()]),Bi=h.string().regex(/^sha256:[0-9a-f]{64}$/),OA=h.object({projection_hash:Bi.nullable()}).strict(),NA=h.object({expected_projection_hash:Bi.nullable(),projection_hash:Bi}).strict(),jA=h.object({clean_snapshot_id:h.string().uuid().nullable()}).strict(),LA=h.object({clean_snapshot_id:h.string().uuid()}).strict();var $r="insertNewPage",WA={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"]),dg=R.object({resource_id:R.string().min(1),resource_type:Wt,resolved_version:Gt,template_page_id:R.string().min(1)}).strict(),Vr=R.lazy(()=>R.object({id:R.string().uuid(),key:R.string().min(1),name:R.string(),children:R.array(Vr)}).strict()),Yr=R.object({category_group_key:R.literal($r),categories:R.array(Vr)}).strict(),ug=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(),Xr=R.object({category_group_key:R.literal($r),items:R.array(ug),next_cursor:R.string().min(1).nullable()}).strict(),BA=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"})}),On=Gt,Cs=R.string().regex(/^\/[a-z0-9]+(?:-[a-z0-9]+)*$/),KA=R.string().regex(/^\/(?:[a-z0-9]+(?:-[a-z0-9]+)*)?$/),gg=R.object({template_page_id:R.string().min(1),title:R.string().trim().min(1).max(120),final_route:Cs}).strict(),_g=R.object({template_page_id:R.string().min(1),title:R.string().trim().min(1).max(120),source:dg.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(),hg=R.object({resource_id:R.string().min(1),resource_type:Wt,resolved_version:On,pages:R.array(_g).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 a=new Set;for(let[o,c]of i.blocks.entries())a.has(c.instance_id)&&n.addIssue({code:"custom",path:["pages",s,"blocks",o,"instance_id"],message:`Duplicate block instance identifier within page: ${c.instance_id}`}),a.add(c.instance_id)}});function Yi(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[a,o]of e.entries())i.has(o)&&s.addIssue({code:"custom",path:[n,a],message:`Duplicate ${n} identifier: ${o}`}),i.add(o)}var zA=R.object({resource_type:Wt,version:On,pages:R.array(gg).min(1)}).strict().superRefine((e,n)=>{Yi(e,n),Rt(e.pages.map(s=>s.template_page_id),"pages",n),Rt(e.pages.map(s=>s.final_route),"routes",n)}),Sg=R.object({instance_id:R.string().min(1),component_id:R.string().min(1)}).strict(),fg=R.object({component_id:R.string().min(1),materialization:Ft}).strict(),bg=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(Sg)}).strict(),Xi=R.object({resource_id:R.string().min(1),resource_type:Wt,resolved_version:On,revision_id:R.string().uuid().optional(),digest_sha256:R.string().regex(/^[a-f0-9]{64}$/),components:R.array(fg),pages:R.array(bg).min(1),project_dependencies:R.record(R.string(),R.never()).optional()}).strict().superRefine((e,n)=>{Yi(e,n);let s=e.components.map(a=>a.component_id),i=new Set(s);Rt(s,"components",n),Rt(e.pages.map(a=>a.template_page_id),"pages",n),Rt(e.pages.map(a=>a.final_route),"routes",n);for(let[a,o]of e.pages.entries()){let c=new Set;for(let[r,m]of o.components.entries())i.has(m.component_id)||n.addIssue({code:"custom",path:["pages",a,"components",r,"component_id"],message:`Unknown component reference: ${m.component_id}`}),c.has(m.instance_id)&&n.addIssue({code:"custom",path:["pages",a,"components",r,"instance_id"],message:`Duplicate component instance identifier within page: ${m.instance_id}`}),c.add(m.instance_id)}}),Qr=Xi,Zr=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(),yg=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(),Jr=R.object({resource_id:R.string().min(1),resource_type:Wt,resolved_version:On,pages:R.array(yg).min(1)}).strict().superRefine((e,n)=>{Yi(e,n),Rt(e.pages.map(s=>s.template_page_id),"pages",n)}),HA=R.object({resource_type:Wt,version:On}).strict(),$A=R.object({draft:hg}).strict(),ec=R.object({groups:R.array(zr)}).strict(),tc=R.object({candidate:R.record(R.string(),R.unknown())}).strict();var Jt="[a-z0-9]+(?:-[a-z0-9]+)*",Nn=new RegExp(`^/(?:${Jt}(?:/${Jt})*)?$`),nc=["/privacy","/cookie-policy","/system/not-found"],xg=nc.map(e=>`app/${e.slice(1)}/page.tsx`);function Eg(e){return e.replace(/[^A-Za-z0-9-]+/g,"-").replace(/-+/g,"-").replace(/^-+|-+$/g,"").toLowerCase()}function sc(e){return typeof e=="string"&&Nn.test(e)}function ic(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 a=s.toLowerCase();if(a==="index"||a==="home")return"/";let o=i.map(Eg).filter(r=>r.length>0);if(o.length===0)return null;let c=`/${o.join("/")}`;return sc(c)?c:null}function ac(e){let n=ic(e);if(n===null)throw new Error("Page slug must be an ASCII route without traversal segments.");return n}function Rg(e){let n=ac(e);return n==="/"?"app/page.tsx":`app/${n.slice(1)}/page.tsx`}import{z as oe}from"zod";import{z as p}from"zod";import{z as je}from"zod";var Ig=je.object({code:je.string().min(1),message:je.string().min(1),details:je.record(je.string(),je.unknown()).optional()}),ZA=je.object({code:je.string().min(1),message:je.string().min(1)});function Qi(e){return je.object({ok:je.literal(!0),composition:K,data:e}).strict()}function Tg(e){let n={ok:je.literal(!1),composition:K,error:Ig.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 oc(e){return je.discriminatedUnion("ok",[Qi(e.dataSchema),Tg({codeSchema:e.codeSchema,currentSchema:e.currentSchema,diagnosticsSchema:e.diagnosticsSchema,dataSchema:e.failureDataSchema})])}import{z as ne}from"zod";var dt=ne.object({start:ne.number().int().nonnegative(),end:ne.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"})}),kg=ne.object({code:ne.enum(["missing-class-name","unsupported-attribute-name","source-locator-warning","invalid-new-attr","version-conflict","write-failed"]),message:ne.string().min(1)}),rc=ne.object({path:ne.string().min(1),content:ne.string(),hash:ne.string().min(1).optional()}),s1=ne.object({composition:K,revision:ne.string().min(1),entryCss:rc,stylesheets:ne.array(rc).default([])}).strict(),i1=ne.object({composition:_e}).strict(),a1=ne.object({key:ne.string().min(1),composition:_e}).strict(),cc=ne.object({key:ne.string().min(1),composition:K,filePath:ne.string().min(1),componentName:ne.string().min(1),sourceKind:ne.enum(["missing","stringLiteral","expression"]),attrRaw:ne.string().min(1).nullable(),valueRaw:ne.string().min(1).nullable(),attrRange:dt.nullable(),openingElementRange:dt,version:ne.object({documentVersion:ne.number().int().nonnegative(),contentHash:ne.string().min(1)}),diagnostics:ne.array(kg),computedStyle:ne.record(ne.string(),ne.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"})}),o1=cc,r1=Qi(cc),Zi=ne.object({source:ne.enum(["style-panel","class-source-editor"]),operation:ne.enum(["replace-static-classname","replace-expression","create-attribute","remove-attribute"])});import{z as ot}from"zod";var Ag=new Set(["children","key","ref","dangerouslysetinnerhtml"]),wg=new Set(["data-designer-hover-outline","data-designer-select-outline"]),Pg=/^[A-Za-z_$][A-Za-z0-9_$:-]*$/u;function Cg(e){return{code:"protected-attribute",message:`Property is protected from generic site editing: ${e}`}}function vg(){return{code:"invalid-attribute-name",message:"Property name must be a valid single JSX attribute name"}}function Dg(e){let n=e.toLowerCase();return Ag.has(n)||n.startsWith("data-vcp-")||wg.has(n)||/^on[a-z]/iu.test(e)}function Ji(e){if(!Pg.test(e))return{owner:"blocked",name:e,diagnostic:vg()};if(Dg(e))return{owner:"blocked",name:e,diagnostic:Cg(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 mc=ot.string().min(1),ea=ot.discriminatedUnion("operation",[ot.object({operation:ot.literal("set"),name:mc,value:Bt}).strict(),ot.object({operation:ot.literal("remove"),name:mc}).strict()]).superRefine((e,n)=>{let s=Ji(e.name);s.owner==="blocked"&&n.addIssue({code:"custom",path:["name"],message:s.diagnostic?.message??"Property is not available for site editing"})}),lc=ot.object({kind:ot.literal("set-props"),scope:ot.enum(["selection","template"]),changes:ot.array(ea).min(1)}).strict().superRefine((e,n)=>{let s=new Map;for(let[i,a]of e.changes.entries()){let o=Ji(a.name),c=Og(o),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 Og(e){return e.owner==="class-name-source"||e.owner==="style"?`owner:${e.owner}`:`name:${e.name}`}import{z as Ng}from"zod";var pc=Ng.enum(["src","alt","poster","href","width","height"]);import{z as en}from"zod";var jn=en.object({editingSessionId:en.string().min(1),lockId:en.string().min(1),ownerId:en.string().min(1),leaseAssertion:en.string().min(1)}).strict(),b1="signed-designer-mutations-v1",y1=en.object({mutationContext:jn}).strict();import{z as u}from"zod";import{z as Ln}from"zod";var vs="::",ta=Ln.object({file:Ln.string().min(1),component:Ln.string().min(1),structuralPath:Ln.string().min(1),key:Ln.string().min(1)}).superRefine((e,n)=>{let s=jg(e.file,e.component,e.structuralPath);e.key!==s&&n.addIssue({code:"custom",path:["key"],message:"key must match file::component::structuralPath"})});function jg(e,n,s){return`${e}${vs}${n}${vs}${s}`}function R1(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"]),Mn=u.object({code:u.string().min(1),message:u.string().min(1)}).strict(),Lg=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()]),Mg=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(),Ug=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(),Fg=u.object({key:u.string().min(1),containerKey:u.string().min(1),businessMemberKeys:u.array(u.string().min(1)),isMultiMember:u.boolean()}).strict(),uc=u.object({kind:u.literal("page-composition"),placementKey:u.string().min(1),documentVersion:u.number().int().nonnegative(),composition:_e}).strict(),Gg=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(),gc=u.object({kind:u.literal("page-composition"),placementKey:u.string().min(1),documentVersion:u.number().int().nonnegative(),composition:_e,placementUnitKey:u.string().min(1),relation:u.enum(["before","after","prepend","append"])}).strict(),_c=u.object({kind:u.literal("page-unit"),composition:_e,placementUnitKey:u.string().min(1)}).strict(),hc=u.object({kind:u.literal("page-unit"),composition:K,placementUnitKey:u.string().min(1)}).strict();function gt(e,n,s,i,a){let o=new Set;for(let[c,r]of e.entries()){let m=i(r);o.has(m)&&n.addIssue({code:"custom",path:[s,c,a],message:`Duplicate ${s} key: ${m}`}),o.add(m)}}var qg=u.object({status:u.literal("supported"),version:u.number().int().nonnegative(),composition:K,container:Lg,sourceMembers:u.array(Mg),businessMembers:u.array(Ug),placementUnits:u.array(Fg),placements:u.array(Gg)}).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)),a=new Map(e.sourceMembers.map(r=>[r.key,r])),o=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]),g=m.containerKey;for(;g!==e.container.key;){if(x.has(g)){n.addIssue({code:"custom",path:["sourceMembers",r,"containerKey"],message:"Source member hierarchy must be acyclic."});break}x.add(g);let P=a.get(g);if(!P)break;g=P.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=a.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 g=new Set;for(let[P,B]of m.businessMemberKeys.entries()){let z=o.get(B);if(!z){n.addIssue({code:"custom",path:["placementUnits",r,"businessMemberKeys",P],message:"Placement unit must reference existing business members."});continue}g.has(B)&&n.addIssue({code:"custom",path:["placementUnits",r,"businessMemberKeys",P],message:"Placement unit cannot reference the same business member twice."}),g.add(B),z.containerKey!==m.key&&n.addIssue({code:"custom",path:["placementUnits",r,"businessMemberKeys",P],message:"Business member containerKey must match its placement unit."});let te=z.sourceMemberKey,Se=new Set;for(;te&&te!==m.containerKey&&!Se.has(te);)Se.add(te),te=a.get(te)?.containerKey;te!==m.containerKey&&n.addIssue({code:"custom",path:["placementUnits",r,"businessMemberKeys",P],message:"Placement unit business members must belong to its source subtree."})}}for(let[r,m]of e.businessMembers.entries())e.placementUnits.find(g=>g.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())bc(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."})}),Wg=u.object({status:u.literal("unsupported"),version:u.number().int().nonnegative(),composition:K,reason:Ds,diagnostics:u.array(Mn)}).strict(),Bg=u.discriminatedUnion("status",[qg,Wg]),Sc=2,w1="page-composition-v2",fc=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(o=>o!==void 0),a=s.every(o=>o!==void 0);i&&!a&&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."})}),Kg=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."})}),zg=u.enum(["component-call","native-jsx","dynamic-expression","indirect-expression","text","starter-placeholder"]),Hg=u.enum(["none","dynamic-expression","indirect-expression","text","starter-placeholder"]),$g=u.discriminatedUnion("kind",[u.object({kind:u.literal("virtual-route-root"),key:u.null(),routeReturn:u.object({sourceIdentity:ta,sourceRange:fc}).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()]),Vg=u.object({key:u.string().min(1),kind:zg,parentKey:u.string().min(1).nullable(),childKeys:u.array(u.string().min(1)),order:u.number().int().nonnegative(),label:u.string().min(1),sourceIdentity:ta,sourceRange:fc.nullable(),atomicKind:Hg}).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[a,o]of e.childKeys.entries())i.has(o)&&n.addIssue({code:"custom",path:["childKeys",a],message:`Duplicate child source member key: ${o}`}),i.add(o)}),Yg=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(),Xg=u.enum(["independent","atomic","container"]),Qg=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:Xg,isIndependent:u.boolean(),isMultiMember:u.boolean()}).strict().superRefine((e,n)=>{dc(e.sourceMemberKeys,n,"sourceMemberKeys","source member"),dc(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."})}),Zg=u.enum(["before","after","prepend","append","replace"]),Jg=u.enum(["insert-sibling","insert-child","replace-placeholder"]),e_=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:Zg,writeMode:Jg}).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}.`})}),t_=u.object({key:u.string().min(1),placementUnitKey:u.string().min(1),runtimeRefs:u.array(Kg).min(1)}).strict(),n_=u.object({schemaVersion:u.literal(Sc),status:u.literal("supported"),version:u.number().int().nonnegative(),composition:K,container:$g,sourceMembers:u.array(Vg),businessMembers:u.array(Yg),placementUnits:u.array(Qg),placements:u.array(e_),visualAnchors:u.array(t_).optional(),diagnostics:u.array(Mn)}).strict().superRefine((e,n)=>{a_(e,n)}),s_=u.object({schemaVersion:u.literal(Sc),status:u.literal("unsupported"),version:u.number().int().nonnegative(),composition:K,reason:Ds,diagnostics:u.array(Mn)}).strict(),i_=u.discriminatedUnion("status",[n_,s_]),P1=u.union([i_,Bg]);function dc(e,n,s,i){let a=new Set;for(let[o,c]of e.entries())a.has(c)&&n.addIssue({code:"custom",path:[s,o],message:`Duplicate ${i} key: ${c}`}),a.add(c)}function bc(e,n){return wi(e)===wi(n)}function a_(e,n){gt(e.sourceMembers,n,"sourceMembers",g=>g.key,"key"),gt(e.businessMembers,n,"businessMembers",g=>g.key,"key"),gt(e.placementUnits,n,"placementUnits",g=>g.key,"key"),gt(e.placements,n,"placements",g=>g.placementKey,"placementKey"),gt(e.visualAnchors??[],n,"visualAnchors",g=>g.key,"key"),o_(e,n);let s=new Map(e.sourceMembers.map(g=>[g.key,g])),i=new Map(e.businessMembers.map(g=>[g.key,g])),a=new Map(e.placementUnits.map(g=>[g.key,g]));r_(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 o=new Map,c=new Map,r=new Set;for(let[g,P]of e.placementUnits.entries()){P.containerKey!==e.container.key&&n.addIssue({code:"custom",path:["placementUnits",g,"containerKey"],message:"Placement unit containerKey must match the page container."});let B=`${P.containerKey??"<virtual>"}:${P.order}`;r.has(B)&&n.addIssue({code:"custom",path:["placementUnits",g,"order"],message:"Placement unit order must be unique within its container."}),r.add(B);for(let[z,te]of P.sourceMemberKeys.entries()){s.has(te)||n.addIssue({code:"custom",path:["placementUnits",g,"sourceMemberKeys",z],message:"Placement unit must reference existing source members."});let Se=o.get(te);Se&&Se!==P.key&&n.addIssue({code:"custom",path:["placementUnits",g,"sourceMemberKeys",z],message:`Source member is already assigned to ${Se}.`}),o.set(te,P.key)}for(let[z,te]of P.businessMemberKeys.entries()){let Se=i.get(te);if(!Se){n.addIssue({code:"custom",path:["placementUnits",g,"businessMemberKeys",z],message:"Placement unit must reference existing business members."});continue}Se.placementUnitKey!==P.key&&n.addIssue({code:"custom",path:["placementUnits",g,"businessMemberKeys",z],message:"Placement unit and business member must reference each other."}),P.sourceMemberKeys.includes(Se.sourceMemberKey)||n.addIssue({code:"custom",path:["placementUnits",g,"businessMemberKeys",z],message:"Business member sourceMemberKey must belong to the placement unit."});let xn=c.get(te);xn&&xn!==P.key&&n.addIssue({code:"custom",path:["placementUnits",g,"businessMemberKeys",z],message:`Business member is already assigned to ${xn}.`}),c.set(te,P.key)}}for(let[g,P]of e.businessMembers.entries()){s.has(P.sourceMemberKey)||n.addIssue({code:"custom",path:["businessMembers",g,"sourceMemberKey"],message:"Business member must reference a source member."});let B=a.get(P.placementUnitKey);if(!B){n.addIssue({code:"custom",path:["businessMembers",g,"placementUnitKey"],message:"Business member must reference a placement unit."});continue}B.businessMemberKeys.includes(P.key)||n.addIssue({code:"custom",path:["businessMembers",g,"placementUnitKey"],message:"Business member and placement unit must reference each other."}),B.sourceMemberKeys.includes(P.sourceMemberKey)||n.addIssue({code:"custom",path:["businessMembers",g,"sourceMemberKey"],message:"Business member sourceMemberKey must belong to its placement unit."});let z=B.isIndependent&&B.businessMemberKeys.length===1;P.isIndependent!==z&&n.addIssue({code:"custom",path:["businessMembers",g,"isIndependent"],message:"Business member independence must match its placement unit boundary."})}let m=new Set;for(let[g,P]of e.placements.entries()){P.documentVersion!==e.version&&n.addIssue({code:"custom",path:["placements",g,"documentVersion"],message:"Page placement version must match page composition version."}),bc(P.composition,e.composition)||n.addIssue({code:"custom",path:["placements",g,"composition"],message:"Page placement composition must match page composition."});let B=a.get(P.placementUnitKey);B?P.containerKey!==B.containerKey&&n.addIssue({code:"custom",path:["placements",g,"containerKey"],message:"Placement containerKey must match its placement unit."}):n.addIssue({code:"custom",path:["placements",g,"placementUnitKey"],message:"Placement option must reference a placement unit."});let z=`${P.placementUnitKey}:${P.relation}`;m.has(z)&&n.addIssue({code:"custom",path:["placements",g,"relation"],message:"A placement unit cannot expose the same relation more than once."}),m.add(z),P.relation==="replace"&&e.container.kind!=="starter-placeholder"&&n.addIssue({code:"custom",path:["placements",g,"relation"],message:"replace is only valid for a starter placeholder container."}),e.container.kind==="starter-placeholder"&&P.relation!=="replace"&&n.addIssue({code:"custom",path:["placements",g,"relation"],message:"Starter placeholder placements must use replace."})}let x=new Set;for(let[g,P]of(e.visualAnchors??[]).entries())a.has(P.placementUnitKey)||n.addIssue({code:"custom",path:["visualAnchors",g,"placementUnitKey"],message:"Visual anchor must reference a placement unit."}),x.has(P.placementUnitKey)&&n.addIssue({code:"custom",path:["visualAnchors",g,"placementUnitKey"],message:"A placement unit may expose only one visual anchor."}),x.add(P.placementUnitKey)}function o_(e,n){let s=[];e.container.key!==null&&s.push({key:e.container.key,path:["container","key"],namespace:"container"});for(let[a,o]of e.sourceMembers.entries())s.push({key:o.key,path:["sourceMembers",a,"key"],namespace:"source member"});for(let[a,o]of e.businessMembers.entries())s.push({key:o.key,path:["businessMembers",a,"key"],namespace:"business member"});for(let[a,o]of e.placementUnits.entries())s.push({key:o.key,path:["placementUnits",a,"key"],namespace:"placement unit"});for(let[a,o]of(e.visualAnchors??[]).entries())s.push({key:o.key,path:["visualAnchors",a,"key"],namespace:"visual anchor"});let i=new Map;for(let a of s){let o=i.get(a.key);o?n.addIssue({code:"custom",path:a.path,message:`${a.namespace} key collides with ${o}: ${a.key}`}):i.set(a.key,a.namespace)}}function r_(e,n,s){let i=new Set;for(let[a,o]of e.sourceMembers.entries()){let c=`${o.parentKey??"<root>"}:${o.order}`;if(i.has(c)&&s.addIssue({code:"custom",path:["sourceMembers",a,"order"],message:"Source member order must be unique among siblings."}),i.add(c),o.parentKey===o.key&&s.addIssue({code:"custom",path:["sourceMembers",a,"parentKey"],message:"Source member cannot be its own parent."}),o.parentKey!==null){let x=n.get(o.parentKey);x?x.childKeys.includes(o.key)||s.addIssue({code:"custom",path:["sourceMembers",a,"parentKey"],message:"Source parent and child references must be bidirectional."}):s.addIssue({code:"custom",path:["sourceMembers",a,"parentKey"],message:"Source member parentKey must reference a source member."})}for(let[x,g]of o.childKeys.entries()){if(g===o.key){s.addIssue({code:"custom",path:["sourceMembers",a,"childKeys",x],message:"Source member cannot be its own child."});continue}let P=n.get(g);P?P.parentKey!==o.key&&s.addIssue({code:"custom",path:["sourceMembers",a,"childKeys",x],message:"Source parent and child references must be bidirectional."}):s.addIssue({code:"custom",path:["sourceMembers",a,"childKeys",x],message:"Source child key must reference a source member."})}let r=new Set,m=o;for(;m;){if(r.has(m.key)){s.addIssue({code:"custom",path:["sourceMembers",a,"parentKey"],message:"Source member graph must be acyclic."});break}r.add(m.key),m=m.parentKey===null?void 0:n.get(m.parentKey)}}}var Un=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"]),c_=p.discriminatedUnion("kind",[p.object({kind:p.literal("node"),key:p.string().min(1)}).strict(),_c,p.object({kind:p.literal("route"),composition:_e}).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,a]of e.paths.entries())s.has(a)&&n.addIssue({code:"custom",path:["paths",i],message:`Duplicate source target path: ${a}`}),s.add(a)}).strict(),p.object({kind:p.literal("project")}).strict()]),m_=p.string().min(1).refine(E_,{message:"Link href must use http(s), mailto, tel, or a non-empty anchor"}),l_=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:m_}).strict()]),p_=ea.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"})}),d_=p.object({kind:p.literal("set-link-target"),scope:p.literal("selection"),link:l_,changes:p.array(p_)}).strict().superRefine((e,n)=>{let s=new Set;for(let[i,a]of e.changes.entries())s.has(a.name)&&n.addIssue({code:"custom",path:["changes",i,"name"],message:`Duplicate link target change: ${a.name}`}),s.add(a.name),e.link.kind==="none"&&a.operation==="set"&&(a.name==="target"||a.name==="rel")&&n.addIssue({code:"custom",path:["changes",i],message:"An unlinked anchor cannot set target or rel attributes"})}),u_=p.discriminatedUnion("kind",[p.object({kind:p.literal("node"),key:p.string().min(1)}).strict(),hc,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()]),yc=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"]),xc=p.enum(["hover","active","focus","disabled"]),Ec=p.enum(["sm","md","lg","xl","2xl"]),Rc=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)}),gc]),g_=p.object({kind:p.literal("source-sibling"),relation:p.enum(["before","after"]),anchorKey:p.string().min(1)}).strict(),__=p.union([Rc,g_]),Ic=p.object({kind:p.literal("component-call"),component:p.never().optional(),materialization:Ft,props:p.record(p.string(),p.never()).optional()}).strict(),h_=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(),Ic]),S_=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:h_,position:p.union([Rc,uc])}),p.object({kind:p.literal("replace-node"),node:Ic}),p.object({kind:p.literal("move-node"),target:__,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:Zi}),lc,d_,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:Zi}).optional(),props:p.partialRecord(pc,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)=>{Ci(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:_r,confirmDelete:p.literal(!0),confirmPath:Re,baseContentHash:p.string().min(1).nullable().optional()}).strict().superRefine((e,n)=>{e.capability!==Pi&&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"}),Ci(e.path)||n.addIssue({code:"custom",path:["path"],message:"source-edit delete only accepts allowlisted text source files"});let s=vi(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,a]of e.edits.entries())s.has(a.path)&&n.addIssue({code:"custom",path:["edits",i,"path"],message:`Duplicate source edit path: ${a.path}`}),s.add(a.path),e.conflictPolicy==="compare-and-swap"&&a.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:Xi}).strict(),p.object({kind:p.literal("delete-page-source"),expectedUrlPath:p.string().startsWith("/")}).strict()]),Tc=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"]),kc=p.object({code:Tc,message:p.string().min(1),details:p.record(p.string(),p.unknown()).optional()}),tn=p.object({key:p.string().min(1),instanceIndex:p.number().int().nonnegative().optional(),instanceCount:p.number().int().positive().optional()}),na=p.object({id:p.string().min(1),siteId:k,baseSnapshotId:I,composition:_e,kind:Un,target:c_,documentVersion:p.number().int().nonnegative(),selectionRef:tn.optional(),mutationContext:jn.optional(),params:S_}).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(a=>a.path),i=e.target.kind==="source-file"?[e.target.path]:e.target.paths;x_(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"})}),B1=na,f_=p.object({kind:p.literal("insert-page-resource"),package_instance_id:p.string().min(1),pages:p.array(Zr).min(1)}).strict().superRefine((e,n)=>{let s=new Set,i=new Set;for(let[a,o]of e.pages.entries())s.has(o.template_page_id)&&n.addIssue({code:"custom",path:["pages",a,"template_page_id"],message:`Duplicate template page route mapping: ${o.template_page_id}`}),i.has(o.final_route)&&n.addIssue({code:"custom",path:["pages",a,"final_route"],message:`Duplicate final route mapping: ${o.final_route}`}),s.add(o.template_page_id),i.add(o.final_route)}),b_=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(),y_=p.discriminatedUnion("kind",[f_,b_]),Ac=p.object({requestId:p.string().min(1),kind:Un,composition:K,target:u_,resultVersion:p.number().int().nonnegative(),affectedFiles:p.array(p.string().min(1)).optional(),selectionRef:tn.optional(),output:y_.optional()}).strict(),sa=Ac.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"})}),K1=oc({dataSchema:sa,codeSchema:Tc,failureDataSchema:Ac.partial()});function x_(e,n){return e.length===n.length&&e.every((s,i)=>s===n[i])}function E_(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 R_=oe.enum(["component","page","pages"]),I_=oe.object({resource_kind:R_,resource_name:oe.string().trim().min(1).max(200),file_count:oe.number().int().min(1).max(64),total_bytes:oe.number().int().min(0).max(4*1024*1024),content_digest:oe.string().regex(/^sha256:[a-f0-9]{64}$/),custom_prompt:oe.string().trim().min(1).max(4e3).optional(),final_routes:oe.array(oe.string().min(1)).max(64)}).strict(),T_=oe.discriminatedUnion("kind",[oe.object({kind:oe.literal("none")}).strict(),oe.object({kind:oe.literal("primary"),items:oe.array(oe.object({label:oe.string().trim().min(1).max(120),href:oe.string().startsWith("/").max(200)}).strict()).min(1).max(64)}).strict().superRefine((e,n)=>{let s=new Set;for(let[i,a]of e.items.entries())s.has(a.href)&&n.addIssue({code:"custom",path:["items",i,"href"],message:`Duplicate navigation href: ${a.href}`}),s.add(a.href)})]),k_=oe.object({base_snapshot_id:oe.string().min(1),operation:na,navigation_selection:T_.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 A_(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 wc=oe.object({id:oe.string().min(1),tenant_id:oe.string().min(1),site_id:oe.string().min(1),run_id:oe.string().min(1).optional(),correlation_id:oe.string().min(1).optional(),sent_at:oe.string().min(1),type:oe.literal("client.resource.operation.create"),payload:oe.object({client_message_id:oe.string().min(1),display:I_,transient_resource_input:k_}).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=A_(i.operation).flatMap(m=>m.files),r=c.reduce((m,x)=>m+new TextEncoder().encode(x.content).byteLength,0);if(c.length>Fi&&n.addIssue({code:"custom",path:["payload","transient_resource_input","operation"],message:"Resource operation exceeds the aggregate file count limit."}),r>Gi&&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(g=>g.final_route);(x.length!==s.final_routes.length||x.some((g,P)=>g!==s.final_routes[P]))&&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,g]of i.navigation_selection.items.entries())m.has(g.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 ia}from"zod";var M=e=>ia.object({code:ia.number().int(),data:e,message:ia.string()});var w_=["with_website","without_website"],nn=C.enum(w_),aa=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."}),P_=["welcome","website_scan","customer_materials","analysis","diagnosis","strategy","structure_planning","preview_personalization","publishing"],It=C.enum(P_),C_=["company_info","website_crawl","website_basic_info_extract","website_metrics_evaluate","intelligent_analysis","strategy_recommendation"],Cc=C.enum(C_),v_=["started","running","succeeded","failed","invalidated"],vc=C.enum(v_),D_=["draft","structure_saved","generating","workspace_ready"],oa=C.enum(D_),O_=["not_deployed","deploying","deployed"],ra=C.enum(O_),N_=["active","completed"],j_=C.enum(N_),L_=["completed","current","locked"],M_=C.enum(L_),Dc={draft:10,structure_saved:20,generating:30,workspace_ready:40},Oc={not_deployed:10,deploying:20,deployed:30},Nc={active:10,completed:20},jc={started:10,running:20,succeeded:30,failed:40,invalidated:50};function Os(e){return new Map(Object.entries(e).map(([n,s])=>[s,n]))}var U_=Os(Dc),F_=Os(Oc),G_=Os(Nc),q_=Os(jc);function sw(e){let n=U_.get(e);if(!n)throw new Error(`Unknown site build status code: ${e}`);return n}function iw(e){let n=F_.get(e);if(!n)throw new Error(`Unknown site deployment status code: ${e}`);return n}function aw(e){let n=G_.get(e);if(!n)throw new Error(`Unknown site workflow status code: ${e}`);return n}function ow(e){let n=q_.get(e);if(!n)throw new Error(`Unknown task execution status code: ${e}`);return n}function rw(e){return Dc[e]}function cw(e){return Oc[e]}function mw(e){return Nc[e]}function lw(e){return jc[e]}var ca=[{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}]}}],pw=ca[0].definitions,Lc=C.number().int().min(1),W_=C.object({id:Q,flow_type:nn,definition_version:Lc,node_code:It,label:C.string().min(1),sort_order:C.number().int().min(1),is_enabled:C.boolean(),state:M_}),Mc=C.object({id:Xo,tenant_id:C.string().min(1),site_id:k,workflow_id:it,node_code:It,task_type:Cc,external_task_id:C.string().min(1),execution_status:vc,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)}),B_=C.object({id:it,tenant_id:C.string().min(1),site_id:k,flow_type:nn,website:aa.nullable(),definition_version:Lc,current_node_code:It,status:j_,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)}),ma=C.object({workflow:B_,menu:C.array(W_),task_refs:C.array(Mc),site:C.object({default_locale:Ie.optional(),status:oa,deployment_status:ra,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()})}),dw=M(ma),uw=M(Mc),Pc=C.array(C.string().min(1).max(64)).max(16).optional(),gw=C.discriminatedUnion("flow_type",[C.object({flow_type:C.literal("with_website"),website:aa,client_capabilities:Pc}).strict(),C.object({flow_type:C.literal("without_website"),website:C.null().optional(),client_capabilities:Pc}).strict()]),_w=C.object({expected_current_node:C.literal("website_scan"),website:aa}).strict(),hw=C.object({expected_current_node:It}).strict(),Sw=C.object({expected_current_node:C.literal("publishing")}).strict(),fw=C.object({publish_workflow_id:cs,expected_publish_revision:C.number().int().min(1)}).strict(),K_=C.object({node_code:It,task_type:Cc,external_task_id:C.string().min(1).max(255),idempotency_key:C.string().min(1).max(255),site_url:C.string().url().optional()}),bw=K_.extend({workflow_id:it}).strict(),yw=C.object({external_task_id:C.string().min(1).max(255),execution_status:vc}),z_=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()}),xw=z_.extend({workflow_id:it}).strict(),H_=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()}),Ew=H_.extend({workflow_id:it}).strict(),Rw=C.object({}).strict();function $_(e,n,s){return e.find(i=>i.definition_version===s)?.definitions[n]}function V_(e,n){return $_(ca,e,n)}function Y_(e,n=1){let s=V_(e,n);if(!s)throw new Error(`Unknown workflow definition: ${e} v${n}.`);return s}function X_(e,n,s){let i=new Set(s);return e.filter(a=>a.published&&(a.required_client_capability===null||i.has(a.required_client_capability))).sort((a,o)=>o.definition_version-a.definition_version).map(a=>({definition_version:a.definition_version,items:a.definitions[n]}))[0]}function Iw(e,n){return X_(ca,e,n)}function Tw(e,n){return Y_(e).findIndex(s=>s.node_code===n)}function kw(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 Aw(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 ww(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 la=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_]*$/),Q_=E.enum(["text","select","multi_select","tags","category_list","boolean","number"]),Fn=E.string().min(1).max(512).regex(/^\/(?:[^?#]*)$/),Z_=E.enum(["base_snapshot_missing","route_not_found","cms_unavailable","product_application_not_found","not_a_configuration_change","tool_execution_failed"]),pa=E.object({status:E.literal("failed"),reason:Z_}).strict(),J_=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"}),eh=E.string().trim().min(1).max(100),Fc=E.array(eh).max(5).refine(e=>new Set(e.map(n=>n.toLowerCase())).size===e.length,{message:"popular_terms must be unique ignoring case"}),Dw=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)}),Gc=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:Fc.optional()}).strict(),th=E.object({app_slug:la}).extend(Gc.shape).strict(),da=E.object({kind:E.literal("product_search_confirmation"),baseline_snapshot_id:I,target_route_id:Fn,applications:E.array(E.object({app_slug:la,label:E.string().min(1).max(200),popular_terms:Fc.default([]),current_config:Gc.nullable().default(null),affected_routes:E.array(Fn).max(64).default([]),fields:E.array(E.object({field_name:Ue,label:E.string().min(1).max(200),value_shape:Q_,option_count:E.number().int().nonnegative().optional(),filter_meta:J_.optional()}).strict()).max(64)}).strict()).min(1).max(12),current_config:th.nullable().optional(),affected_routes:E.array(Fn).min(1).max(64).optional()}).strict(),nh=E.object({kind:E.literal("product_search_confirmation"),action:E.enum(["confirm","modify"]),app_slug:la,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"})}),Ns=E.union([nh,E.object({kind:E.literal("product_search_confirmation"),action:E.literal("cancel")}).strict()]),Gn=E.union([E.string().max(255),E.number().finite(),E.boolean()]),sh=E.object({values:E.array(Gn).min(1).max(20).refine(e=>new Set(e.map(n=>`${typeof n}:${String(n)}`)).size===e.length,{message:"values must be unique"})}).strict(),ih=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"}),ah=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([sh,ih])).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(Gn).max(20)}).strict()).max(8)}).strict(),Uc=E.object({value:Gn,label:E.string().max(200),count:E.number().int().nonnegative()}).strict(),oh=E.union([Gn,E.array(Gn).max(50)]),rh=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,oh).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(Uc).max(10),selected_values:E.array(Uc).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(),Ow=E.object({contract_version:E.literal(1),request:ah,response:rh}).strict();import{z as qe}from"zod";var ua=4,Lw=20,Mw=1440*60*1e3,Uw=1e6,ch=["image/png","image/jpeg","image/webp"],ga=qe.enum(ch),Fw="WORKSPACE_ATTACHMENT_UNSUPPORTED_FORMAT",Gw="WORKSPACE_ATTACHMENT_TOO_LARGE",qw="WORKSPACE_ATTACHMENT_LIMIT",Ww="WORKSPACE_ATTACHMENT_BOUND",Bw=10,Kw=3600*1e3,zw="WORKSPACE_ATTACHMENT_URL_REJECTED",Hw="WORKSPACE_ATTACHMENT_CAPTURE_FAILED",$w="WORKSPACE_ATTACHMENT_CAPTURE_BUSY",Vw="WORKSPACE_ATTACHMENT_CAPTURE_TIMEOUT",Yw="WORKSPACE_ATTACHMENT_CAPTURE_BUDGET_EXCEEDED",Xw="WORKSPACE_ATTACHMENT_CAPTURE_UNAVAILABLE",Qw=qe.object({attachment_id:qe.string().min(1),media_type:ga,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(),Zw=qe.object({url:qe.string().url().max(2048),full_page:qe.boolean().optional()}).strict(),qc="[A-Za-z0-9_-]+",mh=new RegExp(`^/sites/(${qc})/workspace/attachments/(${qc})/image$`);function Jw(e,n){return`/sites/${encodeURIComponent(e)}/workspace/attachments/${encodeURIComponent(n)}/image`}function _a(e){let n=mh.exec(e);return n?{site_id:n[1],attachment_id:n[2]}:null}function eP(e){let n=[];for(let s of e){if(s.type!=="file"||typeof s.url!="string")continue;let i=_a(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 qn}from"zod";var lh=["deployment_queued","prepare_source","build_artifact","publish_site","site_released","cleanup_release"],ph=qn.enum(lh),dh=qn.enum(["running","succeeded","failed"]),uh=qn.object({code:ph,status:dh,message:qn.string().trim().min(1)}).strict(),Wc=qn.array(uh);import{z as Wn}from"zod";var gh={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 aP(e){let n={},s=new Set;for(let i of e){if(!gh[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"?Wn.string().min(1):i.field==="type"?Wn.string().trim().min(1):Wn.boolean()}return Wn.object({answers:Wn.object(n).strict()}).strict()}import{z as v}from"zod";var _h=v.enum(["pending","running","succeeded","failed"]),hh=v.enum(["TASK_FAILED","WEBSITE_UNREACHABLE"]),Sh=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:hh.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:_h,error:v.string().nullable(),created_at:v.string().min(1),updated_at:v.string().min(1)}),mP=M(Sh),ha=v.enum(["existing_site","new_site"]),Kc=v.enum(["google_indexing","ai_recommendation","qualification_verifiability","content_freshness","inquiry_form","inquiry_response","privacy_compliance","prohibited_content"]),Bc=v.object({observed_result:v.enum(["pass","fail","unknown"])}).strict(),zc=v.object({kind:v.literal("ai_crawlability"),checks:v.object({ai_access_guidance:Bc,structured_data_presence:Bc}).strict()}).strict(),Sa=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:zc.optional()}),js=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:zc.optional()}).strict(),fh=v.object({url:v.string().url().max(2048),title:v.string().trim().max(300),words:v.number().int().nonnegative().max(1e7)}).strict(),bh=v.object({site_url:v.string().url().max(2048),scanned_at:v.string().datetime({offset:!0}),reach:v.array(js).max(64),trust:v.array(js).max(64),convert:v.array(js).max(64),safe:v.array(js).max(64),pages:v.array(fh).max(100)}).strict(),Ls=v.object({company_task_id:v.string().min(1).max(128),scan_task_id:v.string().min(1).max(128),type:ha,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(),Sa),scan_result:bh.optional()})}),yh=v.object({saved:v.literal(!0),company_task_id:v.string().min(1).max(128),scan_task_id:v.string().min(1).max(128)}),lP=M(yh),xh=v.enum(["snapshot","task"]),Eh=Ls.shape.result.extend({type:ha,structured_facts:v.unknown().optional()}).extend({company_name:v.string(),primary_product:v.string(),current_market:v.string(),qualifications:v.string()}),Rh=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:ha,data_source:xh,result:Eh}),pP=M(Rh.nullable());import{z as Te}from"zod";var Tt=Te.enum(["company","product_service","case_qualification","market","contact_inquiry","privacy_compliance","news_freshness"]),Ih=Te.object({ordinal:Te.number().int().min(1).max(1e4),path:Te.string().min(1).max(2048).refine(e=>!Ah(e),{message:"path must be a site-relative path, not an absolute URL"}),last_modified:Te.string().max(64).nullable()}).strict(),gP=Te.object({candidates:Te.array(Ih).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,a)=>i-a);for(let[i,a]of s.entries())if(a!==i+1){n.addIssue({code:"custom",path:["candidates"],message:"candidates ordinals must be unique and consecutive from 1"});return}}),Th=Te.object({ordinal:Te.number().int().positive().max(1e4),roles:Te.array(Tt).min(1).max(7)}).strict(),kh=Te.object({role:Tt,status:Te.enum(["selected","not_found"]),selected_ordinals:Te.array(Te.number().int().positive().max(1e4)).max(19)}).strict(),_P=Te.object({selections:Te.array(Th).max(19),coverage:Te.array(kh).length(7)}).strict().superRefine((e,n)=>{let s=new Set;for(let[a,o]of e.coverage.entries())s.has(o.role)&&n.addIssue({code:"custom",path:["coverage",a,"role"],message:"coverage roles must be unique"}),s.add(o.role);for(let a of Tt.options)s.has(a)||n.addIssue({code:"custom",path:["coverage"],message:`coverage must include every page role (missing ${a})`});let i=new Map;for(let a of e.selections)for(let o of a.roles){let c=i.get(o)??new Set;c.add(a.ordinal),i.set(o,c)}for(let[a,o]of e.coverage.entries()){let c=i.get(o.role);o.selected_ordinals.some(m=>!c?.has(m))&&n.addIssue({code:"custom",path:["coverage",a,"selected_ordinals"],message:"selected_ordinals must reference selections carrying the same role"})}});function Ah(e){let n=e.toLowerCase();return n.startsWith("http://")||n.startsWith("https://")||e.startsWith("//")}import{z as f}from"zod";var bP=f.object({force_refresh:f.boolean().optional()}),$c=f.enum(["running","succeeded","failed"]),wh=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)}),Ph=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"])}),Ch=f.object({t:f.string(),d:f.string(),evidence:f.object({from:f.string(),url:f.string().nullable().optional(),value:f.string().nullable().optional()})}),vh=f.enum(["complete","partial","insufficient_data","failed"]),Dh=f.enum(["ok","failed","insufficient_data"]),fa=f.object({agent_id:f.string().min(1),name:f.string().min(1),icon:f.string().min(1),status:Dh,topics:f.array(f.object({topic_id:f.string().min(1),status:vh,evidence_refs:f.array(f.string())})).length(3),findings:f.array(Ch).max(3),elapsed_ms:f.number().nonnegative(),note:f.string().optional(),error:f.string().optional()}),Vc=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()}),Oh=f.object({agents_done:f.boolean(),analysis:f.record(f.string(),fa),step4_scoring_input:f.unknown().optional(),summary:Vc}),Yc=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:$c,result:Oh.nullable().optional(),error:f.string().nullable().optional()}),yP=M(f.array(wh)),xP=M(Ph),EP=M(Yc),RP=M(Yc.nullable()),_t=f.object({id:f.union([f.number().int().nonnegative(),f.string().regex(/^(0|[1-9]\d*)$/u).transform(Number)]).pipe(f.number().int().nonnegative())}),Hc=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()}),IP=f.discriminatedUnion("event",[_t.extend({event:f.literal("snapshot"),data:f.object({job_id:f.string().min(1),status:$c,done:f.number().int().nonnegative(),total:f.number().int().nonnegative(),results:f.array(fa),progress:Hc.optional()})}),_t.extend({event:f.literal("progress"),data:Hc}),_t.extend({event:f.literal("preparing_started"),data:f.object({stage:f.literal("baseline")})}),_t.extend({event:f.literal("preparing_progress"),data:f.object({stage:f.enum(["context","external_evidence"])})}),_t.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())})}),_t.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)})}),_t.extend({event:f.literal("agent_done"),data:fa}),_t.extend({event:f.literal("done"),data:f.object({agents_done:f.literal(!0),summary:Vc})}),_t.extend({event:f.literal("failed"),data:f.object({message:f.string().min(1)})})]);import{z as U}from"zod";var ya=U.enum(["reach","trust","convert","safe"]),Oe=U.number().finite(),Nh=U.number().finite().positive(),ba=["reach","trust","convert","safe"],jh=17,Lh=U.enum(["passed","partial","failed"]),Mh=U.object({landing_page_mode:U.enum(["intent_dynamic","static","none"]),ab_test_enabled:U.boolean()}).strict(),Uh=U.union([U.boolean(),U.number().finite(),Lh,Mh]).nullable(),Fh=U.union([U.boolean(),U.number().finite()]).nullable(),Gh=U.object({competitor_avg:U.number().finite(),score_items:U.record(U.string(),Uh),penalty_items:U.record(U.string(),Fh),red_texts:U.array(U.string())}).strict(),qh=U.record(ya,Gh),Wh=U.object({key:ya,score:Oe,pass_score:Oe,gap:Oe}),Bh=U.object({key:U.string(),title:U.string(),is_redline_option:U.boolean().optional(),score:Oe,max_score:Nh,pass_score:Oe,passed:U.boolean(),description:U.string()}),Kh=U.object({key:ya,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(Bh),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:qh,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(Wh).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(Kh).length(4)}),created_at:U.string().datetime({offset:!0}),updated_at:U.string().datetime({offset:!0})}).superRefine((e,n)=>{Hh(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,a)=>i+a.sub_dimensions.length,0)!==jh&&n.addIssue({code:"custom",path:["scores_list","dimensions"],message:"dimensions must include 17 subdimensions in total."});for(let[i,a]of e.scores_list.dimensions.entries()){if(a.redline_hit===void 0)continue;let o=a.sub_dimensions.findIndex(c=>c.is_redline_option===void 0);o!==-1&&n.addIssue({code:"custom",path:["scores_list","dimensions",i,"sub_dimensions",o,"is_redline_option"],message:"subdimensions must define is_redline_option when redline_hit is defined."})}}),wP=M(zh);function Hh(e){let n=e.map(s=>s.key);return n.length===ba.length&&new Set(n).size===ba.length&&ba.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 vP=Object.freeze(Xt.filter(e=>kt[e].length>0)),DP=Object.freeze(Xt.filter(e=>kt[e].length===0)),$h=Object.freeze(["preparing_source","building","artifact_ready","deploying","released"]),Vh="DEPLOYMENT_TRANSITION_INVALID",xa=class extends Error{constructor(n,s){super(`Invalid deployment transition: ${n} -> ${s}`),this.currentStatus=n,this.nextStatus=s,this.code=Vh,this.name="DeploymentTransitionError"}};function OP(e){return kt[e]}function NP(e){return Xt.filter(n=>kt[n].some(s=>s===e))}function Yh(e){return kt[e].length>0}function jP(e){return!Yh(e)}function LP(e,n){if(!kt[e].some(s=>s===n))throw new xa(e,n);return n}function MP(){return $h}import{converter as Xh,formatHex as Qh,parse as Zh,wcagContrast as GP}from"culori";var qP=Xh("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)"},Jh={\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},WP={...T,...Jh};function Ea(e){let n=Zh(e.trim());return n?Qh(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}},eS={heading:"Inter",body:"Inter"},Xc=ht.Inter;function Ms(e){return e.trim().replace(/\s+/g,"_").toLowerCase()}var em=(()=>{let e=new Map;for(let[n,s]of Object.entries(ht))e.set(Ms(n),s),e.set(Ms(s.import),s);return e})();function tS(e){return typeof e!="string"||e.trim().length===0?Xc:em.get(Ms(e))??Xc}var nS=(()=>{let e=new Map;for(let[n,s]of Object.entries(ht))e.set(s.import,n);return e})();function sn(e){if(typeof e!="string"||e.trim().length===0)return"Inter";let n=em.get(Ms(e));return n?nS.get(n.import)??"Inter":"Inter"}var sS=Object.keys(ht),Qc='ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',Zc='Georgia, "Times New Roman", serif',Jc='"SFMono-Regular", Consolas, monospace',iS=new Set(["serif","sans-serif","sans serif","monospace","mono","cursive","fantasy","system-ui","ui-serif","ui-sans-serif","ui-monospace"]),aS=new Set(["Playfair Display","Lora","Fraunces","Cormorant Garamond","Noto Serif SC"].map(e=>e.toLowerCase())),oS=new Set(["JetBrains Mono","IBM Plex Mono"].map(e=>e.toLowerCase()));function rS(e){let n=e.toLowerCase();return oS.has(n)||n.includes("mono")?"mono":aS.has(n)||n.includes("serif")?"serif":"sans"}function Ra(e,n){let s=m=>(m??"").trim().replace(/^['"]|['"]$/g,"").replace(/[^A-Za-z0-9 _-]+/g,"").trim().slice(0,60),i=s(e),a=s(n),o=m=>iS.has(m.toLowerCase());if(i&&o(i)){let m=i.toLowerCase();return m.includes("mono")?Jc:m.includes("serif")?Zc:Qc}let c=i;c||(c=o(a)?"":a),c||(c="Inter");let r=rS(c);return r==="mono"?`"${c}", ${Jc}`:r==="serif"?`"${c}", ${Zc}`:`"${c}", ${Qc}`}function cS(e){return{"--site-font-sans":Ra(e?.body,"Inter"),"--site-font-heading":Ra(e?.heading,e?.body??"Inter")}}var Ia=["archivo-inter","playfair-source-sans","space-grotesk-manrope","fraunces-libre-franklin","noto-serif-sc-noto-sans-sc","noto-sans-sc"],tm=[{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 nm(e){let n=tm.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 mS}from"zod";var lS=["light","standard","bold"],We=mS.enum(lS),Us="standard",pS=new Set(["display","heading","title"]),sm={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}},$P=Object.keys(sm.standard).map(e=>`--site-weight-${e}`),VP="--site-leading-body",YP=["--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 dS={"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 Ta(e){return e.trim().replace(/\s+/g,"_").toLowerCase()}var uS=new Set(Object.entries(ht).flatMap(([e,n])=>[Ta(e),Ta(n.import)]));function ka(e){if(!(e in ht)&&!uS.has(Ta(e)))return null;let n=sn(e);return ht[n].download===!1?null:dS[n]??Je(100,900)}function im(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 XP(e,n){let s=sm[e??Us],i=n?.heading?ka(n.heading):null,a=n?.body?ka(n.body):null,o={};for(let c of Object.keys(s)){let r=pS.has(c)?i:a;o[`--site-weight-${c}`]=String(im(s[c],r))}return o}var gS=/^(zh|ja|ko)(?:[-_]|$)/i,_S=/^(ar|fa|hi|bn|ta|si|th|lo|km|my|vi)(?:[-_]|$)/i;function am(e){return gS.test(e??"")?"dense":_S.test(e??"")?"tall":"default"}function hS(e){return am(e)==="dense"?"1.75":"1.5"}var SS={default:["1.1","1.2","1.3"],dense:["1.2","1.3","1.4"]};function QP(e){let n=am(e),s=hS(e),[i,a,o]=n==="tall"?[s,s,s]:SS[n];return{"--site-leading-display":i,"--site-leading-heading":a,"--site-leading-title":o}}function ZP(e,n){let s=ka(e);return[...new Set(n.map(a=>im(a,s)))].sort((a,o)=>a-o).map(String)}var on="/* <cms-builder:site-design-notes>",Kt="</cms-builder:site-design-notes> */",Aa="palette-inputs: ",wa="type-inputs: ",At=an.string().min(1).max(40),Pa=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()}),fS=an.object({weightStyle:We}),bS=e=>e.replaceAll("*/","* /").replace(/\s+/g," ").trim();function yS(e){let n=e.lines.map(bS).filter(Boolean).map(s=>` ${s}`);return e.paletteInputs&&n.push(` ${Aa}${JSON.stringify(e.paletteInputs).replaceAll("*/","* /")}`),e.typeInputs&&n.push(` ${wa}${JSON.stringify(e.typeInputs).replaceAll("*/","* /")}`),[on,...n,` ${Kt}`].join(`
|
|
2
|
+
`)}function Ca(e){let n=e.indexOf(on),s=e.indexOf(Kt,n+1);return n===-1||s===-1?null:{start:n,end:s+Kt.length}}function nC(e){let n=Ca(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 xS(e){try{let n=JSON.parse(e),s=Pa.safeParse(n);return s.success?s.data:null}catch{return null}}function ES(e){try{let n=JSON.parse(e),s=fS.safeParse(n);return s.success?s.data:void 0}catch{return}}function om(e){let n=Ca(e);if(!n)return null;let s=e.slice(n.start+on.length,n.end-Kt.length),i=[],a=null,o;for(let c of s.split(`
|
|
7
|
+
`).map(r=>r.trim()).filter(Boolean))c.startsWith(Aa)?a=xS(c.slice(Aa.length)):c.startsWith(wa)?o=ES(c.slice(wa.length)):i.push(c);return{lines:i,paletteInputs:a,...o?{typeInputs:o}:{}}}function sC(e,n){let s=yS(n),i=Ca(e);if(i)return e.slice(0,i.start)+s+e.slice(i.end);let o=[...e.matchAll(/^@import[^\n]*\n/gm)].at(-1);if(!o||o.index===void 0)return`${s}
|
|
8
8
|
|
|
9
|
-
${e}`;let c=
|
|
9
|
+
${e}`;let c=o.index+o[0].length;return`${e.slice(0,c)}
|
|
10
10
|
${s}
|
|
11
|
-
${e.slice(c)}`}var rn="/* <cms-builder:global-design-tokens> */",Bn="/* </cms-builder:global-design-tokens> */",Fe=class extends Error{constructor(n,s){super(`${n}: ${s}`),this.code=n,this.name="DesignTokenBlockError"}};function hS(e){let n=[],s=0;for(;s<e.length;){let i=e.indexOf(rn,s),o=e.indexOf(Bn,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+rn.length,c=e.indexOf(rn,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+Bn.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 SS=/^--[A-Za-z0-9_-]+/;function fS(e){return e===void 0||e==="{"||e==="}"||e===";"||/\s/.test(e)}function sm(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=im(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]==="-"&&fS(o===0?void 0:e[o-1])){let r=SS.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 h=x,P=bS(e,h,s),H=e.slice(h,P).trimEnd();i.push({name:m,value:H.trim(),valueStart:h,valueEnd:h+H.length}),o=P;continue}}}o+=1}return i}function im(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 bS(e,n,s){let i=n,o=0;for(;i<s;){let a=e[i];if(a==="\\"){i+=2;continue}if(a==='"'||a==="'"){i=im(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 om(e){return hS(e).flatMap(n=>sm(e,n.bodyStart,n.bodyEnd))}function yS(e){return new Set(sm(e,0,e.length).map(n=>n.name))}var xS=/[;{}]|\/\*|\*\/|[\r\n]/;function ES(e,n){if(n.trim().length===0)throw new Fe("DESIGN_TOKEN_UNSAFE_VALUE",`refusing to write an empty declaration value for ${e}.`);if(xS.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 Fs(e){let n=new Map;for(let s of om(e))n.set(s.name,s.value);return n}function tC(e,n,s={}){let i=om(e),o=new Set(i.map(h=>h.name)),a=new Set,c=new Set,r=[],m=null;for(let h of n.keys())if(!o.has(h)){if(s.derivedKeys?.has(h)!==!0){r.push(h);continue}m??=yS(e),m.has(h)?c.add(h):a.add(h)}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[h,P]of n)o.has(h)&&ES(h,P);for(let h of a)s.onOutOfScopeToken?.(h);for(let h of c)s.onUnwritableToken?.(h);let x=e;for(let h=i.length-1;h>=0;h-=1){let P=i[h],K=n.get(P.name);K!==void 0&&(x=x.slice(0,P.valueStart)+K+x.slice(P.valueEnd))}return x}function Kn(e){let n=e.indexOf(rn),s=e.indexOf(Bn);return n!==-1&&s!==-1&&s>n}var am=/(color-scheme:\s*)(light|dark)(\s*;)/;function RS(e){let n=e.indexOf(rn),s=e.indexOf(Bn);return n!==-1&&s>n?e.slice(n,s):null}function IS(e){let s=RS(e)?.match(am);return s?s[2]:null}function nC(e,n){let s=e.indexOf(rn),i=e.indexOf(Bn);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(am,`$1${n}$3`)+e.slice(i)}var TS=/["']([^"']+)["']/;function nm(e){return e?.match(TS)?.[1]??null}function sC(e){if(!Kn(e))return null;let n;try{n=Fs(e)}catch(m){if(m instanceof Fe)return null;throw m}let s=Eo(n.get("--primary")??"")?.toLowerCase()??null,i=Eo(n.get("--accent")??"")?.toLowerCase()??null,o=nm(n.get("--site-font-heading")),a=nm(n.get("--site-font-sans")),c=tm(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:IS(e),fonts:o&&a?{heading:sn(o),body:sn(a)}:null,paletteInputs:r,paletteInputsPresent:r!=null,notesLines:c?.lines??null,weightStyle:n.has("--site-weight-display")&&c?.typeInputs?c.typeInputs.weightStyle:null}}var Gs=(e,n)=>e.split(n).length-1;function kS(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 rm=e=>{let{open:n,close:s}=kS(e);return n===s};function rC(e,n){if(rm(e)&&!rm(n))return{ok:!1,code:"GLOBALS_CSS_UNBALANCED",message:"app/globals.css has unbalanced braces."};if(Kn(e)&&!Kn(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(Gs(e,an)===Gs(e,Kt)&&Gs(n,an)!==Gs(n,Kt))return{ok:!1,code:"GLOBALS_CSS_NOTES_UNPAIRED",message:"The site design notes comment must keep both of its markers."};if(Kn(e)){let i=null;try{i=Fs(e)}catch(a){if(!(a instanceof Fe))throw a}let o;try{o=Fs(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 _C="x-vcp-run-lease-owner",gC=600*1e3,hC=60*1e3,SC=3,fC=2,bC="WORKSPACE_RUN_RESUME_EXHAUSTED",yC="WORKSPACE_CHECK_INCOMPLETE",xC="WORKSPACE_GENERATION_STOPPED",EC="WORKSPACE_FILL_IN_INTERRUPTED",RC="WORKSPACE_RUN_LEASE_SUPERSEDED",IC="WORKSPACE_RUN_NOT_ACTIVE",TC="FILL_IN_NOT_AVAILABLE",kC="FILL_IN_TARGET_NOT_OMITTED",AC="FILL_IN_TARGET_MODIFIED",AS=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(),PC=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(),cm=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(),CC=cm.omit({created_at:!0}).extend({lease_owner:q.string().min(1)}).strict(),vC=q.object({checkpoints:q.array(cm)}).strict(),mm=q.object({kind:q.enum(["page","component","shared"]),target_id:q.string().min(1)}).strict(),DC=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(mm),execution_scene:Ii.nullable().optional(),intent:q.literal("navigation_adaptation").optional(),page_template_manifest:nr.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"})}),OC=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:ke,resume_count:q.number().int().nonnegative(),lease_owner:q.string().min(1),stop_requested:q.boolean(),resume_principal:AS}).strict())}).strict(),NC=q.object({site_id:k}).strict(),jC=q.object({status:q.enum(["requested","already_requested","stopped","no_active_run"]),run_id:$.nullable()}).strict(),LC=q.object({ledger:An.nullable(),source_run_id:$.nullable(),updated_at:q.string().min(1).nullable()}).strict(),MC=q.object({targets:q.array(mm).min(1).max(50),client_run_key:q.string().min(1).max(400)}).strict();import{z as PS}from"zod";var GC=".i18n.json",qs="translation",lm=new Set(["__proto__","constructor","prototype"]);function dm(e){if(!Ws(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(lm.has(n))return pm([n]);if(!wS(n))return Pt("I18N_LOCALE_INVALID",`Component i18n locale must be canonical BCP-47: ${n}`,[n]);if(!Ws(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]!==qs)return Pt("I18N_NAMESPACE_INVALID",`Component i18n locale ${n} must contain only the translation namespace.`,[n]);let o=s[qs];if(!Ws(o))return Pt("I18N_RESOURCE_TREE_INVALID",`Component i18n translation namespace for ${n} must be an object.`,[n,qs]);let a=[{value:o,path:[n,qs]}];for(;a.length>0;){let c=a.pop();for(let[r,m]of Object.entries(c.value)){let x=[...c.path,r];if(lm.has(r))return pm(x);if(typeof m!="string"){if(!Ws(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 qC(e){let n;try{n=JSON.parse(e)}catch{return Pt("I18N_JSON_INVALID","Component i18n resource file must contain valid JSON.",[])}return dm(n)}var WC=PS.custom(e=>dm(e).success,"Invalid component i18n resources.");function wS(e){try{let n=Intl.getCanonicalLocales(e);return n.length===1&&n[0]===e}catch{return!1}}function Ws(e){if(typeof e!="object"||e===null||Array.isArray(e))return!1;let n=Object.getPrototypeOf(e);return n===Object.prototype||n===null}function pm(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",CS=`/${St}`,KC=CS,zC=`${St} detail`,HC="cms_collection_view",$C="list",VC="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"}},vS=new Set(Object.values(ze).map(e=>e.pageTitle)),DS=new Set(Object.values(ze).flatMap(e=>[e.blockLabel,e.detailBlockLabel,e.heroBlockLabel]));function YC(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 XC(){return Object.values(ze)}function QC(e){return vS.has(e.trim())}function ZC(e){return DS.has(e.trim())}var OS="4rem",NS="0.75rem",jS="2rem";function LS(e){if(e?.variant!=="floating")return"container pt-8";let n=[jS,OS];return e.shape==="island"&&n.push(NS),`container pt-[calc(${n.join("+")})]`}function ev(e){return`// Auto-generated by connect_dynamic_collection \u2014 do not edit by hand.
|
|
11
|
+
${e.slice(c)}`}var rn="/* <cms-builder:global-design-tokens> */",Bn="/* </cms-builder:global-design-tokens> */",Fe=class extends Error{constructor(n,s){super(`${n}: ${s}`),this.code=n,this.name="DesignTokenBlockError"}};function RS(e){let n=[],s=0;for(;s<e.length;){let i=e.indexOf(rn,s),a=e.indexOf(Bn,s);if(i<0){if(a>=0)throw new Fe("DESIGN_TOKEN_BLOCK_MISSING","a closing global-design-tokens marker appears without a matching opening marker.");break}if(a<0||a<i)throw new Fe("DESIGN_TOKEN_BLOCK_MISSING","a global-design-tokens region is opened but never closed.");let o=i+rn.length,c=e.indexOf(rn,o);if(c>=0&&c<a)throw new Fe("DESIGN_TOKEN_BLOCK_MISSING","global-design-tokens regions are nested; refusing to guess the intended boundaries.");n.push({bodyStart:o,bodyEnd:a}),s=a+Bn.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 IS=/^--[A-Za-z0-9_-]+/;function TS(e){return e===void 0||e==="{"||e==="}"||e===";"||/\s/.test(e)}function cm(e,n,s){let i=[],a=n,o=0;for(;a<s;){let c=e[a];if(c==="/"&&e[a+1]==="*"){let r=e.indexOf("*/",a+2);a=r<0||r>=s?s:r+2;continue}if(c==='"'||c==="'"){a=mm(e,a,s);continue}if(c==="("){o+=1,a+=1;continue}if(c===")"){o=Math.max(0,o-1),a+=1;continue}if(c==="-"&&o===0&&e[a+1]==="-"&&TS(a===0?void 0:e[a-1])){let r=IS.exec(e.slice(a,s));if(r){let m=r[0],x=a+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 g=x,P=kS(e,g,s),z=e.slice(g,P).trimEnd();i.push({name:m,value:z.trim(),valueStart:g,valueEnd:g+z.length}),a=P;continue}}}a+=1}return i}function mm(e,n,s){let i=e[n],a=n+1;for(;a<s;){let o=e[a];if(o==="\\"){a+=2;continue}if(o===i)return a+1;a+=1}return s}function kS(e,n,s){let i=n,a=0;for(;i<s;){let o=e[i];if(o==="\\"){i+=2;continue}if(o==='"'||o==="'"){i=mm(e,i,s);continue}if(o==="/"&&e[i+1]==="*"){let c=e.indexOf("*/",i+2);i=c<0||c>=s?s:c+2;continue}if(o==="(")a+=1;else if(o===")")a=Math.max(0,a-1);else if(a===0&&(o===";"||o==="}"))return i;i+=1}return s}function lm(e){return RS(e).flatMap(n=>cm(e,n.bodyStart,n.bodyEnd))}function AS(e){return new Set(cm(e,0,e.length).map(n=>n.name))}var wS=/[;{}]|\/\*|\*\/|[\r\n]/;function PS(e,n){if(n.trim().length===0)throw new Fe("DESIGN_TOKEN_UNSAFE_VALUE",`refusing to write an empty declaration value for ${e}.`);if(wS.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 Fs(e){let n=new Map;for(let s of lm(e))n.set(s.name,s.value);return n}function cC(e,n,s={}){let i=lm(e),a=new Set(i.map(g=>g.name)),o=new Set,c=new Set,r=[],m=null;for(let g of n.keys())if(!a.has(g)){if(s.derivedKeys?.has(g)!==!0){r.push(g);continue}m??=AS(e),m.has(g)?c.add(g):o.add(g)}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[g,P]of n)a.has(g)&&PS(g,P);for(let g of o)s.onOutOfScopeToken?.(g);for(let g of c)s.onUnwritableToken?.(g);let x=e;for(let g=i.length-1;g>=0;g-=1){let P=i[g],B=n.get(P.name);B!==void 0&&(x=x.slice(0,P.valueStart)+B+x.slice(P.valueEnd))}return x}function Kn(e){let n=e.indexOf(rn),s=e.indexOf(Bn);return n!==-1&&s!==-1&&s>n}var pm=/(color-scheme:\s*)(light|dark)(\s*;)/;function CS(e){let n=e.indexOf(rn),s=e.indexOf(Bn);return n!==-1&&s>n?e.slice(n,s):null}function vS(e){let s=CS(e)?.match(pm);return s?s[2]:null}function mC(e,n){let s=e.indexOf(rn),i=e.indexOf(Bn);if(s===-1||i===-1||i<s)throw new Fe("DESIGN_TOKEN_BLOCK_MISSING","globals.css has no design token block");let a=e.slice(s,i);return e.slice(0,s)+a.replace(pm,`$1${n}$3`)+e.slice(i)}var DS=/["']([^"']+)["']/;function rm(e){return e?.match(DS)?.[1]??null}function lC(e){if(!Kn(e))return null;let n;try{n=Fs(e)}catch(m){if(m instanceof Fe)return null;throw m}let s=Ea(n.get("--primary")??"")?.toLowerCase()??null,i=Ea(n.get("--accent")??"")?.toLowerCase()??null,a=rm(n.get("--site-font-heading")),o=rm(n.get("--site-font-sans")),c=om(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:vS(e),fonts:a&&o?{heading:sn(a),body:sn(o)}:null,paletteInputs:r,paletteInputsPresent:r!=null,notesLines:c?.lines??null,weightStyle:n.has("--site-weight-display")&&c?.typeInputs?c.typeInputs.weightStyle:null}}var Gs=(e,n)=>e.split(n).length-1;function OS(e){let n=0,s=0,i=0,a=e.length;for(;i<a;){let o=e[i];if(o==="/"&&e[i+1]==="*"){let c=e.indexOf("*/",i+2);i=c===-1?a:c+2;continue}if(o==='"'||o==="'"){let c=o;for(i+=1;i<a;){if(e[i]==="\\"){i+=2;continue}if(e[i]===c){i+=1;break}i+=1}continue}o==="{"?n+=1:o==="}"&&(s+=1),i+=1}return{open:n,close:s}}var dm=e=>{let{open:n,close:s}=OS(e);return n===s};function gC(e,n){if(dm(e)&&!dm(n))return{ok:!1,code:"GLOBALS_CSS_UNBALANCED",message:"app/globals.css has unbalanced braces."};if(Kn(e)&&!Kn(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(Gs(e,on)===Gs(e,Kt)&&Gs(n,on)!==Gs(n,Kt))return{ok:!1,code:"GLOBALS_CSS_NOTES_UNPAIRED",message:"The site design notes comment must keep both of its markers."};if(Kn(e)){let i=null;try{i=Fs(e)}catch(o){if(!(o instanceof Fe))throw o}let a;try{a=Fs(n)}catch(o){if(o instanceof Fe)return{ok:!1,code:"GLOBALS_CSS_TOKEN_BLOCK_MALFORMED",message:`app/globals.css design token block is malformed: ${o.message}`};throw o}if(i){let o=[...i.keys()].filter(c=>!a.has(c));if(o.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: ${o.slice(0,8).join(", ")}`}}}return{ok:!0}}import{z as q}from"zod";var xC="x-vcp-run-lease-owner",EC=600*1e3,RC=60*1e3,IC=3,TC=2,kC="WORKSPACE_RUN_RESUME_EXHAUSTED",AC="WORKSPACE_CHECK_INCOMPLETE",wC="WORKSPACE_GENERATION_STOPPED",PC="WORKSPACE_FILL_IN_INTERRUPTED",CC="WORKSPACE_RUN_LEASE_SUPERSEDED",vC="WORKSPACE_RUN_NOT_ACTIVE",DC="FILL_IN_NOT_AVAILABLE",OC="FILL_IN_TARGET_NOT_OMITTED",NC="FILL_IN_TARGET_MODIFIED",NS=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(),jC=q.object({run_id:$,lease_owner:q.string().min(1),lease_ms:q.number().int().positive().max(1800*1e3).optional()}).strict(),LC=q.object({status:q.enum(["renewed","not_active","superseded"]),expires_at:q.string().min(1).nullable(),stop_requested:q.boolean()}).strict(),um=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(),MC=um.omit({created_at:!0}).extend({lease_owner:q.string().min(1)}).strict(),UC=q.object({checkpoints:q.array(um)}).strict(),gm=q.object({kind:q.enum(["page","component","shared"]),target_id:q.string().min(1)}).strict(),FC=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(gm),execution_scene:Ii.nullable().optional(),intent:q.literal("navigation_adaptation").optional(),page_template_manifest:rr.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"})}),GC=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:ke,resume_count:q.number().int().nonnegative(),lease_owner:q.string().min(1),stop_requested:q.boolean(),resume_principal:NS}).strict())}).strict(),qC=q.object({site_id:k}).strict(),WC=q.object({status:q.enum(["requested","already_requested","stopped","no_active_run"]),run_id:$.nullable()}).strict(),BC=q.object({ledger:An.nullable(),source_run_id:$.nullable(),updated_at:q.string().min(1).nullable()}).strict(),KC=q.object({targets:q.array(gm).min(1).max(50),client_run_key:q.string().min(1).max(400)}).strict();import{z as jS}from"zod";var $C=".i18n.json",qs="translation",_m=new Set(["__proto__","constructor","prototype"]);function Sm(e){if(!Ws(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(_m.has(n))return hm([n]);if(!LS(n))return wt("I18N_LOCALE_INVALID",`Component i18n locale must be canonical BCP-47: ${n}`,[n]);if(!Ws(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]!==qs)return wt("I18N_NAMESPACE_INVALID",`Component i18n locale ${n} must contain only the translation namespace.`,[n]);let a=s[qs];if(!Ws(a))return wt("I18N_RESOURCE_TREE_INVALID",`Component i18n translation namespace for ${n} must be an object.`,[n,qs]);let o=[{value:a,path:[n,qs]}];for(;o.length>0;){let c=o.pop();for(let[r,m]of Object.entries(c.value)){let x=[...c.path,r];if(_m.has(r))return hm(x);if(typeof m!="string"){if(!Ws(m))return wt("I18N_RESOURCE_TREE_INVALID","Component i18n resource leaves must be strings.",x);o.push({value:m,path:x})}}}}return{success:!0,data:e}}function VC(e){let n;try{n=JSON.parse(e)}catch{return wt("I18N_JSON_INVALID","Component i18n resource file must contain valid JSON.",[])}return Sm(n)}var YC=jS.custom(e=>Sm(e).success,"Invalid component i18n resources.");function LS(e){try{let n=Intl.getCanonicalLocales(e);return n.length===1&&n[0]===e}catch{return!1}}function Ws(e){if(typeof e!="object"||e===null||Array.isArray(e))return!1;let n=Object.getPrototypeOf(e);return n===Object.prototype||n===null}function hm(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 St="products",MS=`/${St}`,QC=MS,ZC=`${St} detail`,JC="cms_collection_view",ev="list",tv="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"}},US=new Set(Object.values(ze).map(e=>e.pageTitle)),FS=new Set(Object.values(ze).flatMap(e=>[e.blockLabel,e.detailBlockLabel,e.heroBlockLabel]));function nv(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 sv(){return Object.values(ze)}function iv(e){return US.has(e.trim())}function av(e){return FS.has(e.trim())}var GS="4rem",qS="0.75rem",WS="2rem";function BS(e){if(e?.variant!=="floating")return"container pt-8";let n=[WS,GS];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="${BS(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 cn}from"zod";var iv="SITE_HAS_ACTIVE_SUBSITES",ov="SITE_HAS_SUBSITES",MS=cn.object({site_id:k,name:cn.string().min(1),mount_path:cn.string().min(1),archived_at:cn.string().nullable()}),av=cn.object({subsites:cn.array(MS)});import{z as Pe}from"zod";var lv=Pe.object({key:Pe.string().min(1),composition:ge}).strict(),Ks=Pe.enum(["component-boundary","repeat-region","conditional-region","fragment-region","opaque-region"]),US=Pe.enum(["direct","proxy","upstream","readonly","unsupported"]),FS=Pe.enum(["component-boundary","repeat-region","conditional-region","opaque-region","void-element","read-only","cross-file-required","import-required"]),Bs=Pe.object({mode:US,reasonCode:Pe.string().min(1).optional()}),GS=Pe.object({kind:FS,message:Pe.string().min(1)}),zs=Pe.object({composition:B,key:Pe.string().min(1),canUpdateText:Pe.boolean(),canInsertChild:Pe.boolean(),canMove:Pe.boolean(),canRemove:Pe.boolean(),editModes:Pe.object({updateText:Bs.optional(),insertChild:Bs.optional(),move:Bs.optional(),remove:Bs.optional()}).optional(),constraints:Pe.array(GS)}).strict();import{z as X}from"zod";var Sv=X.discriminatedUnion("type",[X.object({type:X.literal("site-edit.document.changed"),siteId:k,snapshotId:I,composition:B,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:B,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:B,result:no,at:X.string().min(1)}).strict(),X.object({type:X.literal("site-edit.operation.failed"),siteId:k,composition:B,requestId:X.string().min(1),error:xc,at:X.string().min(1)}).strict(),X.object({type:X.literal("site-edit.capability.changed"),siteId:k,composition:B,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:B,at:X.string().min(1)}).strict(),X.object({type:X.literal("site-edit.graph.ready"),siteId:k,composition:B,version:X.number().int().nonnegative(),at:X.string().min(1)}).strict(),X.object({type:X.literal("site-edit.graph.error"),siteId:k,composition:B,message:X.string().min(1),at:X.string().min(1)}).strict(),X.object({type:X.literal("site-edit.snapshot.changed"),siteId:k,composition:B,snapshotId:I,previousSnapshotId:X.string().min(1).nullable(),at:X.string().min(1)}).strict()]);import{z as ce}from"zod";var xv="durable-history-v1",Hs=ce.object({initiatingComposition:B.optional(),affectedCompositions:ce.array(B)}).strict(),Ev=ce.enum(["writable","read-only-recovery","unavailable"]),qS=ce.enum(["INDEX_CORRUPT","ENTRY_MISSING","BLOB_MISSING","FILESYSTEM_UNAVAILABLE","ROLLBACK_INCOMPLETE","UNKNOWN"]),WS=ce.object({code:qS,message:ce.string().min(1),occurredAt:ce.iso.datetime().optional()}).strict(),BS=ce.enum(["NOT_INITIALIZED","FILESYSTEM_UNAVAILABLE","UNSUPPORTED_RUNTIME"]),um={revision:ce.number().int().nonnegative(),undoDepth:ce.number().int().nonnegative(),redoDepth:ce.number().int().nonnegative()},KS=ce.object({mode:ce.literal("writable"),composition:B,...um,canUndo:ce.boolean(),canRedo:ce.boolean(),provenance:Hs.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."})}),zS=ce.object({mode:ce.literal("read-only-recovery"),composition:B,...um,canUndo:ce.literal(!1),canRedo:ce.literal(!1),recoveryDiagnostic:WS,provenance:Hs.optional()}).strict(),HS=ce.object({mode:ce.literal("unavailable"),composition:B,revision:ce.literal(0),undoDepth:ce.literal(0),redoDepth:ce.literal(0),canUndo:ce.literal(!1),canRedo:ce.literal(!1),reason:BS,provenance:Hs.optional()}).strict(),$S=ce.discriminatedUnion("mode",[KS,zS,HS]),Rv=ce.object({composition:B,status:$S,provenance:Hs}).strict();import{z as V}from"zod";var $s=V.enum(["api-field","cms-field","i18n-message","config-entry"]),vo=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:$s.optional(),sourceId:V.string().min(1).optional()}),VS=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()]),YS=V.object({kind:V.enum(["literal","boolean-shorthand","expression","binding","repeat-template"]),raw:V.string().optional()}).strict(),XS=V.object({name:V.string().min(1),source:YS,resolution:VS,editMode:V.enum(["direct","proxy","upstream","readonly","unsupported"]),sourceScope:V.enum(["node","repeat-item","repeat-template"]),allowedWriteScopes:V.array(V.enum(["selection","template"])),effectiveWriteTarget:vo.optional(),diagnostics:V.array(V.object({code:V.string().min(1),message:V.string().min(1)}).strict())}).strict(),QS=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(),ZS=V.object({selection:V.enum(["direct","materialize","unsupported"]),template:V.enum(["direct","unsupported"])}).strict(),Do=V.object({documentVersion:V.number().int().nonnegative(),selectionRef:tn.optional(),items:V.array(XS),spreads:V.array(QS),creation:ZS}).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 we}from"zod";var JS=we.string().min(1).refine(e=>!e.startsWith("/")&&!e.includes(".."),{message:"Patch paths must be safe relative POSIX paths."}),ef=we.string().regex(/^sha256:[a-f0-9]{64}$/),tf=we.object({path:JS,operation:we.enum(["create","update","delete"]),expectedHash:ef.optional(),fullContent:we.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"})}),nf=we.object({siteId:k,baseSnapshotId:I,operationId:we.string().min(1),reason:we.string().min(1),patches:we.array(tf).min(1),changedCompositions:we.array(B),changedRouteIds:we.array(we.string().min(1)).optional(),diagnostics:we.array(we.object({code:we.string().min(1),message:we.string().min(1),path:we.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."})}),Ov=nf.transform(e=>({...e,changedRouteIds:[...new Set(e.changedCompositions.map(n=>n.routeId))]}));var Oo="::repeat-item#";function sf(e,n){return`${e}${Oo}${n}`}function jv(e,n){return n.reduce((s,i)=>sf(s,i),e)}function of(e){if(typeof e!="string"||e.length===0)return null;let n=[],s=e;for(;;){let i=s.lastIndexOf(Oo);if(i<0)break;let o=Number(s.slice(i+Oo.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 Lv(e){return of(e)?.baseKey??e??null}import{z as l}from"zod";import{z as Le}from"zod";var af=Le.object({placementKey:Le.string().min(1),placementUnitKey:Le.string().min(1),relation:Le.enum(["before","after","prepend","append"])}).strict(),rf=Le.object({status:Le.literal("supported"),containerKey:Le.string().min(1),hasBusinessMembers:Le.boolean(),placementUnitKeys:Le.array(Le.string().min(1)),placements:Le.array(af)}).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."})})}),cf=Le.object({status:Le.literal("unsupported"),reason:Ds,diagnostics:Le.array(Mn)}).strict(),_m=Le.discriminatedUnion("status",[rf,cf]);var mf=l.object({canUpdateText:l.boolean(),canInsertChild:l.boolean(),canMove:l.boolean(),canRemove:l.boolean()}),gm=l.enum(["vcp-cms-collection","vcp-cms-form","vcp-cms-settings","vcp-cms-navigation","site-api-route","external-api","unknown-api"]),lf=l.enum(["cms-field","api-field"]),pf=l.enum(["text","attribute","richtext","repeat-region","conditional-region","component-prop"]),df=l.enum(["exact","safe-derived","partial","unknown"]),uf=l.object({file:l.string().min(1),symbol:l.string().min(1).optional(),reason:l.string().min(1)}),_f=l.object({sourceKind:gm,sourceType:lf,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:df,readonly:l.literal(!0),evidence:l.array(uf)}),hm=l.object({hasDynamicData:l.boolean(),bindings:l.array(_f)}),Sm=l.object({hasDynamicData:l.boolean(),sourceKinds:l.array(gm),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()}),gf=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()]),hf=l.object({key:l.string().min(1),parentKey:l.string().min(1).nullable().optional(),pageCompositionUnitKey:l.string().min(1).optional(),pageCompositionActionScope:gf.optional(),operationSummary:mf,dynamicDataSummary:Sm.optional()}).strict(),Jv=l.object({composition:ge}).strict(),eD=l.object({key:l.string().min(1),composition:ge,selectionRef:tn.optional()}).strict(),tD=l.object({siteId:k,snapshotId:I,composition:B,version:l.number().int().nonnegative(),entries:l.array(hf),pageComposition:_m}).strict(),fm=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()}),No=l.object({index:l.number().int().min(0),value:l.string(),editable:l.boolean(),source:fm.nullable()}),zn=l.object({key:l.string().min(1),label:l.string().min(1),tag:l.string().min(1)}),nD=l.object({composition:B,key:l.string().min(1),canUpdateText:l.boolean(),canInsertChild:l.boolean(),canMove:l.boolean(),canRemove:l.boolean(),boundaryKind:Ks.nullable(),isOpaque:l.boolean()}).strict(),Sf=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()}),bm=l.object({kind:l.union([l.enum(["jsx-literal","component-prop","binding","imported-binding","object-field","array-item","repeat-template","conditional-branch"]),$s]),file:l.string().min(1),displayPath:l.string().min(1),externalSource:l.object({sourceType:$s,sourceId:l.string().min(1),adapterId:l.string().min(1).optional()}).optional()}),ff=l.object({kind:bm.shape.kind,file:l.string().min(1),displayName:l.string().min(1),canEditHere:l.boolean()}),Hn=l.object({finalSource:bm.nullable(),chain:l.array(ff),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)}))}),bf=l.object({kind:l.literal("css-style-model"),properties:l.array(l.object({property:gc,value:l.union([l.string(),l.number(),l.boolean(),l.null()]),resolvedValue:l.union([l.string(),l.number(),l.boolean(),l.null()]).optional(),breakpoint:Sc.optional(),state:hc.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(Un).optional()}))}),sD=l.union([l.record(l.string(),l.unknown()),bf]),ym=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(Un),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()}),yf=l.object({startLine:l.number().int().positive(),startColumn:l.number().int().nonnegative(),endLine:l.number().int().positive(),endColumn:l.number().int().nonnegative()}),jo=l.object({sourceFile:l.string().min(1),componentName:l.string().min(1),openingElementRange:yf,structuralPath:l.string().min(1),textPreview:l.string().min(1).optional()}),iD=l.object({composition:B,key:l.string().min(1),tag:l.string().min(1),componentName:l.string().min(1),sourceFile:l.string().min(1),sourceLocator:jo.optional(),label:l.string().min(1),capabilities:zs,writeTarget:Sf,effectiveWriteTarget:vo.optional(),provenanceChain:Hn.optional(),componentSemantic:l.record(l.string(),l.unknown()).optional(),styleSource:ym.optional(),conditional:l.record(l.string(),l.unknown()).optional(),dynamicData:hm.optional(),properties:Do.optional(),textSegments:l.array(No),boundaryKind:Ks.nullable(),isOpaque:l.boolean(),ancestors:l.array(zn),children:l.array(zn),siblings:l.array(zn)}).strict(),oD=l.object({composition:B,key:l.string().min(1),tag:l.string().min(1),label:l.string().min(1),sourceLocator:jo.optional(),capabilities:l.object({constraints:zs.shape.constraints}),isOpaque:l.boolean(),provenanceChain:l.object({editMode:Hn.shape.editMode,diagnostics:Hn.shape.diagnostics}).optional(),dynamicDataSummary:Sm.optional(),ancestors:l.array(zn)}).strict(),aD=l.object({composition:B,key:l.string().min(1),tag:l.string().min(1),label:l.string().min(1),sourceLocator:jo.optional(),isOpaque:l.boolean(),ancestors:l.array(zn),componentName:l.string().min(1),sourceFile:l.string().min(1),capabilities:zs,provenanceChain:l.object({editMode:Hn.shape.editMode,diagnostics:Hn.shape.diagnostics}).optional(),textSegments:l.array(l.object({index:No.shape.index,editable:No.shape.editable,sourceKind:fm.shape.kind.nullable()})),dynamicData:hm.optional(),properties:Do.optional(),boundaryKind:Ks.nullable()}).strict(),rD=l.object({composition:B,key:l.string().min(1),styleSource:ym.optional()}).strict();var xf=["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"],Ef=["article","aside","div","footer","form","header","li","main","nav","ol","section","select","table","tbody","tfoot","thead","tr","ul"],Rf=["a","button","em","h1","h2","h3","h4","h5","h6","label","p","small","span","strong"],If=new Set(xf),Tf=new Set(Ef),kf=new Set(Rf),Af={canUpdateText:!1,canInsertChild:!1,canMove:!1,canRemove:!1};function mD(e){return If.has(Lo(e))}function Pf(e){return Tf.has(Lo(e))}function wf(e){return kf.has(Lo(e))}function lD(e){let{operationSummary:n}=e;return n?{canUpdateText:n.canUpdateText,canInsertChild:n.canInsertChild,canMove:n.canMove,canRemove:n.canRemove}:e.fallbackMode!=="preview"?{...Af}:{canUpdateText:wf(e.tagName),canInsertChild:Pf(e.tagName),canMove:!1,canRemove:!1}}function Lo(e){return e?.trim().toLowerCase()??""}import{z as Cf}from"zod";var gD=Cf.object({composition:ge,mutationContext:jn.optional()}).strict();var SD={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_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.",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=["WORKSPACE_RUN_CANCELLED","WORKSPACE_GENERATION_STOPPED"],Df=new Set(vf);function fD(e){return typeof e=="string"&&Df.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."},yD={CARD_HEADER:"Needs your confirmation",FREE_TEXT_PLACEHOLDER:"Or describe what you'd like instead",SUBMIT_LABEL:"Submit"},xD={SEND_FAILED_RETRY:"Send failed \u2014 tap to retry"};var xm="0.10.25",RD="x-vcp-edit-engine-version",ID="x-vcp-edit-engine-version-source",Mo=class extends Error{constructor(n="Invalid edit-engine version."){super(n),this.code="EDIT_ENGINE_VERSION_INVALID",this.name="EditEngineVersionParseError"}},Of=/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-[0-9A-Za-z]+(?:\.[0-9A-Za-z]+)*)?$/;function Nf(e){return Of.test(e)}function jf(e){if(typeof e!="string"||!Nf(e))throw new Mo;return e}function TD(e){return e==null?{version:xm,source:"fallback_current"}:{version:jf(e),source:"explicit"}}function kD(){return{version:xm,source:"system_current"}}import{z as et}from"zod";var Lf=200,Mf=200;function Uf(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 Ff=et.string().min(3).max(Lf).refine(e=>Uf(e)!==null,{message:'glossary entries must be "source:target" pairs split on a half-width colon, e.g. "\u7C73:Rice"'}),wD=et.array(Ff).max(Mf),CD=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()}),Gf=et.enum(["regional","fonts_only"]),Vs=et.string().regex(/^#[0-9a-fA-F]{6}$/,'color must be a "#rrggbb" value'),qf=et.object({primary:Vs.optional(),accent:Vs.optional(),foreground:Vs.optional(),neutral:Vs.optional()}),Wf=600,vD=et.object({mode:Gf.default("regional"),seeds:qf.optional(),note:et.string().min(1).max(Wf).optional()}),DD={mode:"regional"};function OD(e){return e===void 0?!1:Object.values(e).some(n=>typeof n=="string"&&n.length>0)}import{z as zt}from"zod";var Bf=12,MD=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)}),Ys=zt.number().int().nonnegative().safe(),UD=zt.object({page_count:Ys,translation_character_count:Ys,image_estimate:zt.object({media_key_count:Ys,max_replacement_count:Ys})}).superRefine((e,n)=>{let{media_key_count:s,max_replacement_count:i}=e.image_estimate;i!==Math.min(s,Bf)&&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 Kf=ue.string().trim().min(1),mn=ue.string().uuid(),zf=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"),Em=ue.object({snapshot_id:mn,object_key:zf}),qD=ue.object({tenant_id:Kf,parent_site_id:mn,subsite_site_id:mn,base:Em,target:Em}),Hf=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")}),$f={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(Hf)};function Vf(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 WD=ue.object({...$f,subsite_site_id:mn,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:mn,target_snapshot_id:mn}).superRefine(Vf),Yf=ue.enum(["SUBSITE_DIFF_REQUEST_INVALID","SUBSITE_DIFF_STORE_NOT_CONFIGURED","SUBSITE_DIFF_MANIFEST_MISSING","SUBSITE_DIFF_MANIFEST_INVALID","SUBSITE_DIFF_ESTIMATE_INVALID"]),BD=ue.object({error_code:Yf,message:ue.string().min(1),side:ue.enum(["base","target"]).optional()});import{z as ee}from"zod";var $D=ee.object({tenant_id:ee.string().min(1),site_id:k,snapshot_id:I,manifest_hash:ee.string().regex(/^sha256:[a-f0-9]{64}$/),object_key:ee.string().min(1).max(2048),page_slug:ee.string().max(512).optional()}),VD=ee.object({site_id:k,snapshot_id:I,unit_count:ee.number().int().nonnegative(),file_count:ee.number().int().nonnegative(),markdown:ee.string().min(1),page_slug:ee.string().optional(),page_file:ee.string().optional(),entries:ee.array(ee.object({id:ee.string().min(1),file_path:ee.string().min(1),line:ee.number().int().nullable(),kind:ee.string().min(1),text:ee.string(),media_key:ee.string().optional()})).optional(),images:ee.array(ee.object({id:ee.string().min(1),source:ee.enum(["media-registry","source-literal"]),src:ee.string().min(1),alt:ee.string().nullable(),media_key:ee.string().optional(),width:ee.number().optional(),height:ee.number().optional(),provider:ee.string().optional(),is_placeholder:ee.boolean(),occurrences:ee.array(ee.object({file_path:ee.string().min(1),line:ee.number().int()}))})).optional()});import{z as Xf}from"zod";var Qf=/^\/[a-z0-9][a-z0-9-]{0,30}$/,Zf=Object.freeze(["api","_next","assets","static","robots.txt","sitemap.xml",".well-known"]),Jf=new Set(Zf);function eb(e){return Jf.has(e)}var QD=Xf.string().regex(Qf).refine(e=>!eb(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 tb=he.enum(["active","paused","blocked"]),Rm=he.enum(["typecheck_failed","health_failed","validation_failed"]),nb={status:tb,attempts:he.number().int().nonnegative(),attempted_template_version:Ze.nullable(),last_error_code:Rm.nullable()},ln=he.object(nb).strict(),Xs=he.object({template_id:he.string().trim().min(1),target_template_version:Ze}).strict(),tO=Xs,sb=he.discriminatedUnion("action",[he.object({action:he.literal("proceed"),state:ln.extend({status:he.literal("active")})}).strict(),he.object({action:he.literal("skip_not_newer"),state:ln.extend({status:he.literal("active")})}).strict(),he.object({action:he.literal("skip_paused"),state:ln.extend({status:he.literal("paused")})}).strict(),he.object({action:he.literal("skip_blocked"),state:ln.extend({status:he.literal("blocked")})}).strict()]),nO=Xs,sO=sb,iO=Xs.extend({error_code:Rm}),oO=he.object({state:ln}).strict(),aO=Xs,rO=he.object({state:ln}).strict();import{z as Y}from"zod";var ib=744*60*60*1e3,ob=Y.enum(["eligible","fast_path","upgraded","skipped","lock_skipped","cas_aborted","validation_failed","blocked","paused"]),ab=Y.enum(["typecheck","build","health","validation"]),rb=Y.enum(["not_attempted","promoted","aborted"]),dO=Y.object({template_id:Y.string().trim().min(1).max(128),from_version:Ze.nullable(),to_version:Ze,outcome:ob,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:ab.nullable(),cas_outcome:rb.nullable()}).strict(),uO=Y.object({recorded:Y.literal(!0)}).strict(),Im=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)<=ib,{message:"report window must not exceed 31 days",path:["to"]}),_O=Im,cb=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(),gO=Y.object({window:Im,outcome_counts:cb,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(),hO=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(),mb=Y.object({site_id:k,snapshot_id:I,status:Y.enum(["candidate","deleting"]),created_at:Y.iso.datetime()}).strict(),SO=Y.object({snapshots:Y.array(mb)}).strict();import{z as ft}from"zod";var lb=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"]),pb=ft.object({status:ft.literal("ready"),preview_url:ft.string().url()}).strict(),db=ft.object({status:ft.literal("failed"),code:lb,message:ft.string().min(1),retryable:ft.boolean()}).strict(),yO=ft.discriminatedUnion("status",[pb,db]);import{z as wt}from"zod";var ub=["not_started","active","completed"],_b=wt.enum(ub),gb=["not_started","in_progress","completed"],hb=wt.enum(gb),Sb=wt.object({sequence:wt.number().int().positive(),code:It,status:hb}).strict(),fb=wt.object({site_id:k,workflow_status:_b,flow_type:nn.nullable(),current_step_code:It.nullable(),completed_count:wt.number().int().nonnegative(),total_count:wt.number().int().nonnegative(),steps:wt.array(Sb)}).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."}))}),kO=M(fb);import{z as Uo}from"zod";var bb=Uo.enum(["none","build","build_publish"]),yb=Uo.object({site_id:k,launcher_scope:bb}),CO=Uo.object({permission:yb});function vO(e){return e!=="none"}function DO(e){return e==="build_publish"}import{z as be}from"zod";var UO="build-context.json",FO=2e5,Tm=be.string().regex(/^sha256:[a-f0-9]{64}$/u),km=1e3;function xb(e){return Array.from(e).length<=km}var Eb=be.object({kind:be.enum(["customer_materials","website_scan_diagnosis","committed_strategy"]),digest:Tm}).strict(),Rb=be.object({schema_version:be.literal(1),flow_type:nn,sources:be.array(Eb).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."})}),Ib=be.object({schema_version:be.literal(1),seed:Tm.optional(),cms_settings:be.object({main_products:be.string().trim().min(1).refine(xb,{message:`main_products must contain at most ${km} characters`}).optional()}).strict().optional(),provenance:Rb.optional()}).strict(),Tb=be.object({schema_version:be.literal(1),site_id:k,workflow_id:it,brief:be.string().min(1),source:be.enum(["business_provider","mock"]),payload:Ib}).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."})}),GO=be.object({source_snapshot_id:I,source_run_id:$,build_context:Tb,page_slugs:be.array(be.string().min(1)).optional()}).strict(),qO=be.object({disposition:be.enum(["reused","rebased"]),snapshot_id:I}).strict(),kb=be.object({snapshot:co,workspace_run_id:$.nullable()}).strict(),WO=M(kb);import{z as rt}from"zod";import{z as He}from"zod";import{z as Se}from"zod";import{z as Ab}from"zod";var Pb=["company_profile","product_manual","product_list","customer_case","product_help","qualification","industry_material"],Am=Ab.enum(Pb);var Pm=Se.enum(["pending","running","ready","failed","missing"]),wb=Se.object({task_id:Se.string().min(1).max(500),status:Pm}).strict(),VO=Se.object({items:Se.array(wb).max(100)}).strict(),$n=Se.string().trim().min(1).max(255),YO=Se.object({knowledge_site_id:$n,source_ids:Se.array($n).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"]})}),Cb=Se.object({source_file_id:$n,category_code:Am.nullable(),category_confirmed:Se.boolean(),status:Pm}).strict(),XO=Se.object({ready:Se.boolean(),files:Se.array(Cb),counts:Se.object({total:Se.number().int().nonnegative(),pending:Se.number().int().nonnegative(),running:Se.number().int().nonnegative(),ready:Se.number().int().nonnegative(),failed:Se.number().int().nonnegative(),missing:Se.number().int().nonnegative(),unclassified:Se.number().int().nonnegative()}).strict()}).strict();var ye=e=>He.string().trim().max(e),wm=He.array(He.string().trim().min(1).max(120)).max(20),Fo=He.object({company_name:He.string().trim().min(1).max(200),brand_name:ye(200),primary_products:He.string().trim().min(1).max(1e3),industry:ye(200),applications:ye(1e3),business_summary:ye(2e3),registered_capital:ye(200).default(""),legal_representative:ye(200).default(""),target_markets:wm,customer_industries:ye(1e3),customer_roles:ye(1e3),buying_scenarios:ye(2e3),differentiators:ye(2e3),competitors:ye(1e3),trust_proof:ye(2e3),customer_cases:ye(3e3),channels:wm,expected_domain:ye(255),brand_tone:ye(500),contact_name:ye(200),contact_info:ye(500),timezone:ye(100),launch_timing:ye(200),input_source_ids:He.array($n).max(50)}).strict(),vb=He.enum(["draft","submitted"]),Go=Fo.extend({id:Q,tenant_id:He.string().min(1),site_id:k,workflow_id:it,status:vb,submitted_at:He.string().min(1).nullable(),created_at:He.string().min(1),updated_at:He.string().min(1)}).strict(),nN=M(Go),sN=M(Go),iN=M(Go.nullable());var mN=Ls.extend({expected_current_node:rt.literal("website_scan"),type:rt.literal("existing_site"),result:Ls.shape.result.extend({website:rt.string().url(),scan_cards:rt.partialRecord(Fc,So).refine(e=>Object.keys(e).length>0,{message:"At least one recognized scan card is required."})}).strict()}).strict(),lN=rt.object({expected_current_node:rt.literal("customer_materials"),materials:Fo}).strict(),pN=rt.object({expected_current_node:rt.literal("diagnosis")}).strict(),dN=rt.object({expected_current_node:rt.literal("strategy")}).strict();import{z as N}from"zod";var qo=["compact","comfortable","airy"],Cm=["none","sm","md","lg","xl"],vm="lg",Wo=["subtle","moderate","expressive"],Db=[{id:"subtle",motionLevel:"subtle"},{id:"moderate",motionLevel:"moderate"},{id:"expressive",motionLevel:"expressive"}];function Dm(e){let n=Db.find(s=>s.id===e);if(!n)throw new Error(`Unknown motion preset: ${e}`);return n}var Om=["ocean","forest","clay","violet","graphite","crimson"],Nm=["ai-forest","ai-navy","ai-steel"],jm=/^gen-[0-9a-f]{8}$/,Bo=[{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"}],Ko=[{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 gN(e){let n=Ko.find(s=>s.id===e);if(!n)throw new Error(`Unknown theme preset: ${e}`);return n}function Lm(e){return Ko.find(n=>n.id===e)?.radius??Bo.find(n=>n.id===e)?.radius}var zo=N.string().regex(/^#[0-9A-F]{6}$/i),Vn=N.string().trim().min(1).max(500),Mm=N.string().datetime({offset:!0}),Ob=N.enum(Om),Nb=N.enum(Nm),jb=N.string().regex(jm),Yn=N.union([Ob,Nb,jb]),Xn=N.enum(Io),Qn=N.enum(Wo),Zn=N.enum(qo),Qs=N.enum(Cm),Um=300,Lb=N.string().trim().min(1).max(Um),Zs=N.object({primary:zo,accent:zo,foreground:zo}).strict(),Mb=N.object({id:Yn,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:Zs,surface_mode:N.enum(["light","dark"]),radius:Qs,font_pairing_id:Xn,motion_preset_id:Qn,density:Zn,weight_style:We.optional(),reason:Vn}).strict(),Fm=N.object({name:N.string().trim().min(1).max(120),description:N.string().trim().min(1).max(240),reason:Vn,color_seeds:Zs,surface_mode:N.enum(["light","dark"]),radius:Qs,font_pairing_id:Xn,motion_preset_id:Qn,density:Zn,weight_style:We}).strict(),Gm=N.object({version:N.number().int().min(1),recommendation_id:N.string().uuid(),theme_preset_id:Yn,color_seeds:Zs,surface_mode:N.enum(["light","dark"]),font_pairing_id:Xn,motion_preset_id:Qn,density:Zn,radius:Qs.optional(),weight_style:We.optional(),aesthetic_note:Lb.optional(),updated_at:Mm}).strict(),Ub=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:Re.optional(),strategy_version:N.number().int().min(1),input_digest:N.string().regex(/^sha256:[a-f0-9]{64}$/)}).strict(),theme:N.object({recommended_id:Yn,candidate_ids:N.array(Yn).length(3),candidates:N.array(Mb).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:Xn,reason:Vn}).strict(),motion:N.object({recommended_id:Qn,reason:Vn}).strict(),density:N.object({recommended_id:Zn,reason:Vn}).strict(),conversion:Mt.optional(),generated_at:Mm}).strict(),kN=N.object({force_refresh:N.boolean().optional()}).strict(),AN=N.object({request_id:N.string().trim().min(1).max(160),site_id:k,cached:N.boolean(),recommendation:Ub,selection:Gm}).strict(),PN=N.object({recommendation_id:N.string().uuid(),expected_version:N.number().int().min(1),theme_preset_id:Yn,color_seeds:Zs,surface_mode:N.enum(["light","dark"]),font_pairing_id:Xn,motion_preset_id:Qn,density:Zn,radius:Qs.optional(),weight_style:We.optional(),aesthetic_note:N.string().trim().max(Um).optional()}).strict(),wN=N.object({selection:Gm}).strict(),Fb=4e3,CN=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:Re,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(Fb)).min(1).max(Ne)}).strict(),Ho=N.object({theme_candidates:N.array(Fm).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 vN(){return Bo.map(e=>Fm.parse({name:e.name,description:e.description,reason:e.fallbackReason,color_seeds:e.colorSeeds,surface_mode:e.surfaceMode,radius:e.radius,font_pairing_id:Io[0],motion_preset_id:Wo[0],density:qo[1],weight_style:Us}))}function Gb(e){return e.radius??Lm(e.theme_preset_id)??"lg"}function qb(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??Us}function DN(e,n){let s=Qc(e.font_pairing_id),i=Dm(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:Gb(e),weightStyle:qb(e,n)}}function ON(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 $o}from"zod";function Wb(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 Bb=$o.object(Ho.shape).strict().superRefine((e,n)=>{let s=new Set;e.theme_candidates.forEach((i,o)=>{let a=Wb(i);s.has(a)&&n.addIssue({code:"custom",path:["theme_candidates",o],message:"Theme candidates must have pairwise distinct visual identities"}),s.add(a)})}),MN=$o.union([Ho,Bb.safeExtend({model_profile:$o.literal("azure-gpt")})]);import{z as Ct}from"zod";var qN=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(),Kb=Ct.enum(["high","medium","low"]),WN=Ct.object({skill_name:Ct.string().trim().min(1).max(80).nullable(),confidence:Kb,reason:Ct.string().trim().min(1).max(240)}).strict();import{z as Jn}from"zod";var qm=1e4,zb=Jn.object({note:Jn.string().trim().max(qm),updated_at:Jn.string().min(1)}).strict(),HN=Jn.object({note:Jn.string().trim().max(qm)}).strict(),$N=M(zb.nullable());import{z as ne}from"zod";var Vo=["title","text","richtext","number","boolean","date","datetime","url","email","color","select","multiselect","tag"],Js=ne.object({name:ne.string().min(1).max(100),type:ne.enum(Vo),label:ne.string().min(1).max(255),required:ne.boolean().optional(),options:ne.array(ne.string()).optional()}),XN=ne.object({name:ne.string(),cms_type:ne.string(),label:ne.string().optional(),required:ne.boolean().optional(),value_shape:ne.string().optional(),front_display:ne.enum(["visible","internal","forbidden"]).optional(),choices:ne.array(ne.object({value:ne.union([ne.string(),ne.number()]),label:ne.string()})).optional()}),QN=ne.object({route_file_path:ne.string().min(1),target_component_path:ne.string().min(1),content_type_hint:ne.string().min(1),collection_purpose:ne.enum(["generic","product"]).optional(),required_fields:ne.array(Js).optional(),mode:ne.enum(["bind_existing","provision"]),list_mode:ne.enum(["page","embedded"]).optional(),fields:ne.array(Js).optional(),seed_records:ne.array(ne.record(ne.string(),ne.unknown())).optional()});import{z as G}from"zod";var es=G.number().int().positive().refine(Number.isSafeInteger,"Must be a safe positive integer"),ei=G.string().regex(/^[a-f0-9]{64}$/),ti=G.string().regex(/^[a-z][a-z0-9-]{0,99}$/),ni=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"),Wm=G.object({id:G.string().uuid(),key:Ve(100),name:Ve(255)}).strict(),Km=new Set(["title","summary","description","category","thumbnail","url","admin_id"]),Hb=new Set(["title","summary","description","image_query"]),$b=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"]),Bm=new Set(["select","multiselect"]),Vb=new Set(["title","text","richtext","date","datetime","url","email","color"]),Yb=G.object({name:Ve(100),label:Ve(255),type:G.enum(Vo),required:G.boolean().optional(),options:G.array(Ve(100)).max(100).optional()}).strict().superRefine((e,n)=>{let s=e.options??[];Bm.has(e.type)&&s.length===0&&n.addIssue({code:"custom",path:["options"],message:"Choice fields require at least one option"}),!Bm.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"}),Km.has(e.name)&&n.addIssue({code:"custom",path:["name"],message:"Reserved CMS field names cannot be declared"})}),Xb=G.array(Yb).min(1).max(200),Qb=G.array(G.record(G.string(),G.unknown())).max(1e3);function $e(e,n,s){e.addIssue({code:"custom",path:n,message:s})}var Zb=G.object({name:Ve(30),slug:ni,collection_purpose:G.enum(["generic","product"]).optional(),fields:Xb,seed_records:Qb}).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=>!Km.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($b.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(Hb.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(h=>typeof h!="string"||!(x.options??[]).includes(h)))&&$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 h=Array.isArray(r)?r:[r];(h.length===0||h.some(P=>typeof P!="string"||P.trim()===""))&&$e(n,m,"Seed tag values must be non-empty strings")}else Vb.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"})}),Yo=G.object({schema_version:G.literal(1),application:Zb}).strict(),Jb=G.object({templateId:G.string().uuid(),stableKey:ti,resolvedVersion:es,digest:ei,template:Yo}).strict(),ey=Jb,ty={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(ty)),Hm=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(),ny=G.object({templateId:G.string().uuid(),stableKey:ti,title:Ve(200),description:G.string().max(1e3),thumbnailUrl:G.string().url().nullable(),resolvedVersion:es,digest:ei,application:G.object({name:Ve(30),slug:ni}).strict(),categories:G.array(Wm),tags:G.array(Wm),status:G.enum(["available","creating","created","conflict","failed"]),errorCode:zm.nullable().optional(),template:Yo.optional()}).strict(),$m=G.object({items:G.array(ny)}).strict(),tj=G.object({version:es}).strict(),sy=G.object({app_slug:ni,name:Ve(30),template:G.object({stable_key:ti,version:es,digest:ei}).strict()}).strict(),iy=G.object({status:G.literal("created"),application:sy,initialization:Hm}).strict(),nj=iy,oy=G.object({stable_key:ti,version:es,digest:ei,created_at:G.string().datetime().nullable(),initialization:Hm.nullable()}).strict(),ay=G.object({app_slug:ni,name:Ve(30),collection_slug:G.string().min(1),detail_prefix:G.string().min(1).optional(),source:oy.nullable()}).strict(),sj=G.object({applications:G.array(ay)}).strict(),ij=$m,oj=G.object({code:zm,message:Ve(500)}).strict(),aj=Yo,rj=ey,cj=$m;import{z as _e}from"zod";var Vm=e=>_e.string().max(e).refine(n=>n.trim().length>0,"Value must not be blank"),ry=Js.strict(),Xm=_e.array(ry).min(1).max(200),cy=_e.array(_e.record(_e.string(),_e.unknown())).max(1e3),my=_e.string().regex(/^[a-z0-9]{1,30}$/),Xo=_e.number().int().positive().refine(Number.isSafeInteger,"Must be a safe positive integer"),dj=_e.object({name:Vm(30),slug:Vm(50),collection_purpose:_e.enum(["generic","product"]).optional(),fields:Xm}).strict(),Ym=_e.object({collection_slug:my,detail_prefix:_e.string().min(1).max(255),plugin_id:Xo.optional()}).strict(),uj=_e.discriminatedUnion("kind",[Ym.extend({kind:_e.literal("created")}),Ym.extend({kind:_e.literal("exists")})]),_j=_e.object({fields:Xm,seed_records:cy,category_id:Xo}).strict(),ly=_e.record(_e.string().min(1),_e.string().min(1).nullable()),gj=_e.object({ids:_e.array(Xo).max(1e3),urls:ly,failed:_e.array(_e.unknown()).max(1e3)}).strict();function hj(e){return e.replace(/[^a-zA-Z0-9]/g,"").toLowerCase().slice(0,30)}import{z as xe}from"zod";import{z as Qo}from"zod";var Qm=["lead-generation","trial-and-samples","quote-and-commerce","appointments-and-visits","resources-and-subscriptions","service-and-channel"],Zm="-",py="embedded",Zo=Qo.enum([...Qm,Zm]),dy=Qo.literal(py),Jo=Qo.object({scene:Zo,shape:dy}).strict();function bj(e){return Qm.find(n=>n===e)??Zm}var si=["text","textarea","email","phone","select","radio","multiselect","boolean","date","number","file"],uy=["text","textarea","email","phone","select","radio","multiselect","boolean","date","number"],_y=xe.object({name:xe.string().min(1).max(100),type:xe.enum(uy),label:xe.string().min(1).max(255),required:xe.boolean().optional(),options:xe.array(xe.string()).optional()}),gy=xe.string().regex(/^[a-z][a-z0-9-]{0,48}$/).optional(),Rj=xe.object({mode:xe.enum(["bind_existing","provision"],{error:'mode is required. Use "bind_existing" or "provision". Never call connect_form with {}.'}),form_hint:xe.string().min(1).optional(),name:xe.string().min(1).max(255).optional(),scene:Zo.optional(),component_slug:gy,description:xe.string().min(1).max(1e3).optional(),fields:xe.array(_y).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"})}),Ij=xe.object({name:xe.string(),label:xe.string(),cms_type:xe.string(),required:xe.boolean()});import{z as p}from"zod";var ts=/^[A-Za-z0-9][A-Za-z0-9_-]{0,127}$/,dn=/^[A-Za-z][A-Za-z0-9_-]{0,127}$/,ii=/^[A-Za-z][A-Za-z0-9_]{0,99}$/,nl=/^[A-Za-z0-9][A-Za-z0-9_-]{0,99}$/,ta=/^[a-z][a-z0-9-]{0,99}$/,sl=/^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?$/,Jm=2,el=3,oi=p.string().regex(ts),hy=p.string().regex(ts),na=p.string().regex(ts),ns=p.string().regex(ii),sa=p.string().regex(nl),Sy=p.discriminatedUnion("status",[p.object({status:p.literal("unbound"),form_code:p.null()}).strict(),p.object({status:p.literal("bound"),form_code:p.string().regex(dn)}).strict(),p.object({status:p.literal("missing"),form_code:p.string().regex(dn)}).strict()]),fy=p.object({value:sa,label:p.string().trim().min(1).max(255)}).strict(),by=p.object({kind:p.literal("field"),field_name:ns,type:p.enum(si),label:p.string().trim().min(1).max(255),required:p.boolean(),span:p.enum(["full","half"]),options:p.array(fy).max(100),max_files:p.number().int().min(1).max(5).optional()}).strict(),yy=p.object({kind:p.literal("step-break"),step_id:p.string().regex(ts)}).strict(),xy=p.discriminatedUnion("kind",[by,yy]),Ey=p.object({field_name:ns,type:p.enum(si),last_label:p.string().max(255)}).strict(),Ry=p.object({field_name:ns,value:sa,last_label:p.string().max(255)}).strict(),Iy=p.discriminatedUnion("kind",[p.object({kind:p.literal("custom")}).strict(),p.object({kind:p.literal("template"),slug:p.string().regex(ta),version:p.string().regex(sl)}).strict()]),Ty={select:2,radio:2,multiselect:1,DropdownSelection:2,RadioButton:2,Checkbox:1};function ct(e){return e.toLowerCase()}function il(e,n){return e.trim().toLocaleLowerCase(n)}function pn(e,n){return`${ct(e)}\0${n}`}function Ce(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 ia(e,n,s,i){let o=Ty[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 oa=p.object({schema_version:p.literal(1),min_runtime_version:p.number().int().positive(),form_definition_id:oi,binding:Sy,content_locale:Re,features:p.object({multistep:p.boolean()}).strict(),copy:p.object({title:p.string().max(255),description:p.string().max(1e3),submit_button:p.string().trim().min(1).max(100),success_message:p.string().trim().min(1).max(500),error_message:p.string().max(500)}).strict(),layout:p.object({columns:p.enum(["one","two"])}).strict(),nodes:p.array(xy).min(1).max(200),source:Iy,retired:p.object({fields:p.array(Ey).max(1e3),options:p.array(Ry).max(5e3)}).strict(),compatibility:p.object({standardization_version:p.number().int().positive(),diagnostics:p.array(p.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<Jm&&n.addIssue({code:"custom",path:["min_runtime_version"],message:`multistep requires runtime version ${Jm}`}),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"});Ce(o.map(r=>r.step_id),["nodes"],"step_id must be unique",n),Ce(i.map(r=>ct(r.field_name)),["nodes"],"field_name must be unique",n),Ce(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"}),ia(m.type,m.options.length,["nodes",r,"options"],n),m.type==="file"?e.min_runtime_version<el&&n.addIssue({code:"custom",path:["min_runtime_version"],message:`file fields require runtime version ${el}`}):m.max_files!==void 0&&n.addIssue({code:"custom",path:["nodes",r,"max_files"],message:"max_files is only valid for file fields"}),Ce(m.options.map(x=>x.value),["nodes",r,"options"],"option value must be unique within a field",n),Ce(m.options.map(x=>il(x.label,e.content_locale)),["nodes",r,"options"],"option label must be unique within a field",n);Ce(e.retired.options.map(r=>pn(r.field_name,r.value)),["retired","options"],"retired option identity must be unique",n);let c=new Set(e.retired.options.map(r=>pn(r.field_name,r.value)));for(let[r,m]of s)for(let[x,h]of m.options.entries())c.has(pn(m.field_name,h.value))&&n.addIssue({code:"custom",path:["nodes",r,"options",x,"value"],message:"retired option value cannot be reused"})}),ky=["copy.title","copy.description","copy.submit_button","copy.success_message","copy.error_message","nodes.*.label","nodes.*.options.*.label"],Ay=new Set(ky);function Dj(e){let n=e.map(s=>typeof s=="number"||/^\d+$/.test(s)?"*":s).join(".");return Ay.has(n)}function Oj(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=>[pn(r.field_name,r.value),r]));for(let r of i){let m=ct(r.field_name),x=o.get(m),h=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&&h&&h.field_name!==r.field_name&&s.push({code:"FIELD_IDENTITY_CHANGED",field_name:r.field_name}),!x&&h&&h.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 P=new Set(x?.options.map(K=>K.value)??[]);for(let K of r.options){let H=c.get(pn(r.field_name,K.value));!P.has(K.value)&&H&&H.field_name!==r.field_name&&s.push({code:"FIELD_IDENTITY_CHANGED",field_name:r.field_name}),!P.has(K.value)&&!H&&s.push({code:"OPTION_RETIREMENT_MISSING",field_name:r.field_name,value:K.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(pn(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 Py=p.enum(Pn),vt=p.object({english:p.string().max(1e3),translations:p.partialRecord(Py,p.string().max(1e3)).optional()}).strict(),wy=p.object({template_option_key:p.string().regex(nl),label:vt}).strict(),Cy=p.object({template_field_key:p.string().regex(ii),type:p.enum(si),label:vt,required:p.boolean(),span:p.enum(["full","half"]),options:p.array(wy).max(100)}).strict(),vy=p.object({template_step_key:p.string().regex(ii),after_field_key:p.string().regex(ii)}).strict(),Nj=["lead-generation","trial-and-samples","quote-and-commerce","appointments-and-visits","resources-and-subscriptions","service-and-channel"],jj=[1,1,1,1,1,1],ol=p.string().regex(ta),Dy=p.object({schema_version:p.literal(1),slug:ol,name:vt,template_count:p.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"})}),Oy=p.object({schema_version:p.literal(1),slug:p.string().regex(ta),version:p.string().regex(sl),category:ol,copy:p.object({title:vt,description:vt,submit_button:vt,success_message:vt,error_message:vt}).strict(),layout:p.object({columns:p.enum(["one","two"])}).strict(),fields:p.array(Cy).min(1).max(200),step_breaks:p.array(vy).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"});Ce(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??[];Ce(i.map(a=>a.template_step_key),["step_breaks"],"template_step_key must be unique",n),Ce(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"}),ia(c.type,c.options.length,["fields",a,"options"],n),Ce(c.options.map(r=>r.template_option_key),["fields",a,"options"],"template_option_key must be unique within a field",n),Ce(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"})}}),Lj=p.object({schema_version:p.literal(1),visibility:p.enum(["internal","public"]),categories:p.array(Dy).max(500),templates:p.array(Oy).max(500)}).strict().superRefine((e,n)=>{let s=(o,a)=>{let c=Pn.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(", ")}`})};Ce(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=>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"})}Ce(e.templates.map(o=>o.slug),["templates"],"template slug must be unique",n);for(let[o,a]of e.templates.entries())i.has(a.category)||n.addIssue({code:"custom",path:["templates",o,"category"],message:"template category must exist in catalog categories"});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 Mj(e,n){let s=Sr(n),i=s?e.translations?.[s]:void 0;return i!==void 0&&i.trim()!==""?i:e.english}var Ny=["Text","Summary","Email","Phone","DropdownSelection","RadioButton","Checkbox","Boolean","Date","Num","MultipleFile","SpecificFile"],jy={text:"Text",textarea:"Summary",email:"Email",phone:"Phone",select:"DropdownSelection",radio:"RadioButton",multiselect:"Checkbox",boolean:"Boolean",date:"Date",number:"Num",file:"MultipleFile"},Ly=p.object({value:sa,label:p.string().trim().min(1).max(255)}).strict(),My=p.object({field_name:ns,field_type:p.enum(Ny),field_label:p.string().trim().min(1).max(255),is_required:p.boolean(),sort_order:p.number().int().nonnegative(),options:p.array(Ly).max(100)}).strict(),al=p.object({version:p.literal(1),locale:Re,fields:p.array(My).min(1).max(200)}).strict().superRefine((e,n)=>{Ce(e.fields.map(s=>ct(s.field_name)),["fields"],"field_name must be unique",n);for(let[s,i]of e.fields.entries())ia(i.field_type,i.options.length,["fields",s,"options"],n),Ce(i.options.map(o=>o.value),["fields",s,"options"],"option value must be unique within a field",n),Ce(i.options.map(o=>il(o.label,e.locale)),["fields",s,"options"],"option label must be unique within a field",n)});function Uj(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":jy[s.type],field_label:s.label,is_required:s.required,sort_order:i,options:s.options.map(o=>({...o}))}));return al.parse({version:1,locale:e.content_locale,fields:n})}var de=p.string().regex(/^sha256:[0-9a-f]{64}$/),Uy=p.union([Ee,p.enum(["app/api/forms/[code]/route.ts","hooks/use-cms-form-submit.ts","lib/cms/forms.ts","lib/cms/client.ts"])]),Fy=p.object({path:Uy,content_hash:de.nullable()}).strict(),Gy=p.array(Fy).min(1).max(500).superRefine((e,n)=>{Ce(e.map(s=>s.path),[],"affected file paths must be unique",n)}),aa=p.object({grade:p.enum(["standard","A","B","C"]),required:p.boolean(),pending_confirmations:p.array(p.object({item_id:p.string().regex(ts),field_name:ns.optional(),kind:p.enum(["form_copy","layout","field_label","field_type","field_required","field_options"]),message:p.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"})}),qy=p.object({site_id:k,form_definition_id:oi,base_snapshot_id:I,expected_form_spec_hash:de,expected_cms_schema_hash:de.nullable(),form_metadata:Jo.nullable(),draft_form_spec_hash:de,desired_cms_schema_hash:de,affected_files_hash:de,shared_reference_hash:de,shared_reference_count:p.number().int().positive(),confirm_shared_update:p.boolean(),recreate_missing_binding:p.boolean(),standardization:aa,confirm_standardization:p.boolean()}).strict(),rl=p.object({reference_hash:de,page_count:p.number().int().positive(),block_count:p.number().int().positive()}).strict().refine(e=>e.page_count<=e.block_count,{message:"page_count cannot exceed block_count"}),Fj=p.object({site_id:k,form_block_id:hy,base_snapshot_id:I,form_spec:oa,runtime_upgrade_required:p.boolean(),expected_form_spec_hash:de,expected_cms_schema_hash:de.nullable(),affected_files_hash:de,shared_impact:rl,standardization:aa}).strict(),Wy=p.object({operation_id:na,operation_fingerprint:de,site_id:k,form_definition_id:oi,base_snapshot_id:I,expected_form_spec_hash:de,expected_cms_schema_hash:de.nullable(),form_metadata:Jo.nullable(),draft_form_spec:oa,draft_form_spec_hash:de,desired_cms_schema_hash:de,affected_files_hash:de,shared_impact:rl,confirm_shared_update:p.boolean(),recreate_missing_binding:p.boolean(),standardization:aa,confirm_standardization:p.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"})}),By=["created","validated","binding_reserved","candidate_ready","cms_applied","snapshot_promoted","committed","compensating","recovery_required","failed"],ra=p.enum(By),Ky=["pending","running","succeeded","failed","recovery_required"],cl=p.enum(Ky),zy=["candidate_abandon","snapshot_reconcile","cms_restore"],ml=p.enum(zy),Hy=["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"],ca=p.enum(Hy),ll=p.enum(["wait","resume","retry_new_operation","manual_recovery","none"]),pl=p.enum(["not_started","pending","succeeded","failed"]),dl=p.object({operation_id:na,operation_fingerprint:de,site_id:k,form_definition_id:oi,stage:ra,status:cl,base_snapshot_id:I,candidate_snapshot_id:I.nullable(),before_form_code:p.string().regex(dn).nullable(),materialized_form_code:p.string().regex(dn).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:p.number().int().nonnegative(),failure_stage:ml.nullable(),last_error_code:ca.nullable(),retryable:p.boolean(),next_action:ll,preview_refresh_status:pl,created_at:p.string().datetime({offset:!0}),updated_at:p.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"})}}),ma=p.object({operation:dl}).strict(),Gj=ma,qj=ma,Wj=p.object({operation_fingerprint:de}).strict(),Bj=ma,$y=p.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}},Wy),Kj=p.object({operation:dl,request:$y,cms_replace_result:p.unknown().nullable()}).strict(),Vy=p.object({stage:ra.optional(),status:cl.optional(),candidate_snapshot_id:I.nullable().optional(),before_form_code:p.string().regex(dn).nullable().optional(),materialized_form_code:p.string().regex(dn).nullable().optional(),materialized_form_spec_hash:de.nullable().optional(),retry_count:p.number().int().nonnegative().optional(),failure_stage:ml.nullable().optional(),last_error_code:ca.nullable().optional(),retryable:p.boolean().optional(),next_action:ll.optional(),preview_refresh_status:pl.optional()}).strict(),zj=p.object({expected_updated_at:p.string().datetime({offset:!0}),operation:Vy,cms_replace_result:p.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"}),Hj=p.object({code:ca,message:p.string().trim().min(1).max(500),retryable:p.boolean(),operation_id:na.optional(),stage:ra.optional()}).strict();function Yy(e){return qy.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 tl(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 ea(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 tl(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(ea(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=>(tl(a),`${JSON.stringify(a)}:${ea(i[a],n)}`)).join(",")}}`}finally{n.delete(e)}}function la(e){return ea(e,new Set)}async function ai(e){let n=la(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 $j(e){return ai(oa.parse(e))}async function Vj(e){return ai(al.parse(e))}async function Yj(e){let n=Gy.parse(e).map(s=>({...s})).sort((s,i)=>s.path<i.path?-1:s.path>i.path?1:0);return ai({version:1,files:n})}async function Xj(e){return ai(Yy(e))}import{z as D}from"zod";var Jj=["page-seo","root-layout-metadata","nav-items"],eL=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()}),tL=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()}),ul=()=>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()}),nL=ul().extend({children:D.array(ul()).optional()}),Xy=["title","description","keywords","breadcrumbs_json.*.name","breadcrumbs_json.*.text"],Qy=["path","meta_tags_json.**","schema_json.**","breadcrumbs_json.*.url"],Zy=["title","title.default","title.template","title.absolute","description","keywords","openGraph.title","openGraph.description","openGraph.siteName","openGraph.images.*.alt","twitter.title","twitter.description"],Jy=["metadataBase","openGraph.type","openGraph.url","openGraph.locale","openGraph.images.*","openGraph.images.*.url","twitter.card","twitter.images.*","alternates.canonical","robots.**"],ex=["label","description","badge"],tx=["href","targetType","role","iconKey"],_l={"page-seo":{localizable:Xy,machine:Qy},"root-layout-metadata":{localizable:Zy,machine:Jy},"nav-items":{localizable:ex,machine:tx}},gl="*",hl="**",nx="children";function sx(e){return typeof e=="number"||/^\d+$/.test(e)?gl:e}function Sl(e,n){let s=n.map(sx);return e!=="nav-items"?s:s.filter(i=>i!==gl&&i!==nx)}function fl(e,n){let s=e.split(".");for(let i=0;i<s.length;i+=1){if(s[i]===hl)return!0;if(i>=n.length||s[i]!==n[i])return!1}return s.length===n.length}function ix(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]===hl)return!0;if(s[i]!==n[i])return!1}return!0}function sL(e,n){let s=Sl(e,n);return s.length===0?!1:_l[e].localizable.some(i=>fl(i,s))}function iL(e,n){let s=Sl(e,n);if(s.length===0)return!0;let{localizable:i,machine:o}=_l[e];return[...i,...o].some(a=>fl(a,s)||ix(a,s))}var rL=["product-search","migration-products","standard-form","form-submission-infrastructure"],ox=[{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"}],ax=[{prefix:"components/site/generated/forms/form-",suffix:".tsx",materializer:"standard-form"}],cL=[{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 rx(e){return e.length>0&&!e.includes("/")&&!e.includes(".")}function mL(e){return ox.some(n=>n.path===e)?!0:ax.some(n=>!e.startsWith(n.prefix)||!e.endsWith(n.suffix)?!1:rx(e.slice(n.prefix.length,e.length-n.suffix.length)))}import{z as bt}from"zod";var cx=["provisioning","cms_app_created","seeded","ready","failed"],uL=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(cx),owned_by_vcp:bt.boolean(),run_id:$.nullable(),last_error:bt.string().nullable(),created_at:bt.string().datetime(),updated_at:bt.string().datetime()});var bl="/vibe/v1";function mx(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(bl)?i:bl,s.href.replace(/\/+$/,"")}catch{return n}}function gL(e){let n=mx(e.publicProxyUrl),s=e.cmsSiteId?.trim(),i=e.tenantId?.trim();return n&&s&&i?{cmsProxyUrl:n,cmsProjectId:s,cmsTenantId:i}:null}function SL(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 _}from"zod";var ri=_.string().url().refine(wx,{message:"URL must use http or https"}),yl=_.string().trim().pipe(ri),lx=_.object({task_type:_.literal("home_url"),task_url:yl,planned_num:_.number().int().min(1).max(20).optional()}).strict(),px=_.object({task_type:_.literal("url_list"),urls:_.array(ri).min(1).max(1e4)}).strict(),xL=_.discriminatedUnion("task_type",[lx,px]),EL=_.object({page:_.coerce.number().int().positive().default(1),page_size:_.coerce.number().int().min(1).max(20).default(20)}).strict(),RL=_.object({home_url:yl}).strict(),Ht=_.string().uuid(),un=_.string().uuid(),IL=_.object({task_uuid:Ht}).strict(),xl=_.enum(["URL_DISCOVERY","PAGE_CRAWL","TASK_SCHEDULING","RESULT_PERSISTENCE"]),dx=_.object({task_uuid:Ht,status:_.literal("NOT_STARTED"),total:_.literal(0)}).strict(),ux=_.object({task_uuid:Ht,status:_.literal("PROCESSING"),total:_.literal(0)}).strict(),TL=_.enum(["no_suitable_page_candidate","page_discovery_unavailable","page_selection_unavailable","page_selection_invalid","page_content_unavailable"]),_x=_.discriminatedUnion("status",[_.object({role:Tt,status:_.literal("selected"),reason_code:_.null()}).strict(),_.object({role:Tt,status:_.literal("not_found"),reason_code:_.literal("no_suitable_page_candidate")}).strict(),_.object({role:Tt,status:_.literal("unknown"),reason_code:_.enum(["page_discovery_unavailable","page_selection_unavailable","page_selection_invalid","page_content_unavailable"])}).strict()]),El=_.array(_x).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}`})}),gx=_.object({task_uuid:Ht,status:_.literal("SUCCEEDED"),total:_.number().int().positive(),discovery_coverage:El.optional()}).strict(),hx=_.enum(["TASK_FAILED","PROVIDER_CAPABILITY_LIMIT","WEBSITE_UNREACHABLE"]),Sx=_.object({task_uuid:Ht,status:_.literal("FAILED"),total:_.literal(0),error_code:hx,error_message:_.string().min(1),failure_stage:xl}).strict(),kL=_.discriminatedUnion("status",[dx,ux,gx,Sx]),fx=_.object({url:ri,raw_html:_.string().min(1)}).strict(),AL=_.object({task_uuid:Ht,status:_.literal("SUCCEEDED"),page:_.number().int().positive(),page_size:_.number().int().min(1).max(20),total:_.number().int().positive(),total_pages:_.number().int().positive(),pages:_.array(fx).max(20),discovery_coverage:El.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"})}),PL=_.object({task_code:un}).strict(),bx=_.object({task_code:un,status:_.literal("NOT_STARTED")}).strict(),yx=_.object({task_code:un,status:_.literal("PROCESSING")}).strict(),xx=_.object({task_code:un,status:_.literal("SUCCEEDED"),urls:_.array(ri)}).strict(),Ex=_.literal("SITEMAP_DISCOVERY_FAILED"),Rx=_.object({task_code:un,status:_.literal("FAILED"),error_code:Ex,error_message:_.string().min(1)}).strict(),wL=_.discriminatedUnion("status",[bx,yx,xx,Rx]),CL=_.object({company_name:_.string().regex(/\S/u)}).strict(),Ix=_.object({company_name:_.string(),brand_name:_.string(),main_products:_.array(_.string()),industry:_.array(_.string()),subfields:_.array(_.string()),business_intro:_.string(),registered_capital:_.string(),legal_representative:_.string(),target_markets:_.array(_.string()),target_customer_industries:_.array(_.string()),target_customer_roles:_.array(_.string()),purchase_scenarios:_.string(),differentiators:_.array(_.string()),competitors:_.array(_.object({name:_.string(),official_url:_.string()}).strict()).max(3),qualifications:_.array(_.string()),representative_cases:_.array(_.string()),acquisition_channels:_.array(_.string()),desired_domain:_.string(),brand_tone:_.string(),timezone:_.string()}).strict(),ci=_.object({company_uuid:_.string().uuid(),company_info:Ix,created_at:_.string().datetime(),updated_at:_.string().datetime()}),Tx=ci.extend({status:_.literal("NOT_STARTED"),last_error_code:_.null(),last_error_message:_.null(),started_at:_.null(),completed_at:_.null()}).strict(),kx=ci.extend({status:_.literal("PROCESSING"),last_error_code:_.null(),last_error_message:_.null(),started_at:_.string().datetime(),completed_at:_.null()}).strict(),Rl=ci.extend({status:_.literal("SUCCEEDED"),last_error_code:_.null(),last_error_message:_.null(),started_at:_.string().datetime(),completed_at:_.string().datetime()}).strict(),Il=ci.extend({status:_.literal("FAILED"),last_error_code:_.string().min(1),last_error_message:_.string().min(1),started_at:_.string().datetime(),completed_at:_.string().datetime()}).strict(),vL=_.discriminatedUnion("status",[Rl,Il]),DL=_.discriminatedUnion("status",[Tx,kx,Rl,Il]),Ax=["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"],Px=_.enum(Ax),OL=_.object({error_code:Px,error_message:_.string().min(1),failure_stage:xl.optional(),task_uuid:Ht.optional(),task_code:un.optional()}).strict();function wx(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(Dx,{message:"URL must use http or https"}),Tl=W.string().min(1).max(512),mi=W.string().datetime({offset:!0}),kl=W.enum(["scraping","completed","failed","expired"]),LL=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(),ML=W.object({links:W.array(Ye).max(1e5)}).strict(),UL=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(),FL=W.object({crawl_id:Tl,expires_at:mi.optional()}).strict(),GL=W.object({status:kl,urls:W.array(Ye).max(1e5),next:Ye.optional(),expires_at:mi}).strict(),qL=W.object({url:Ye,formats:W.tuple([W.literal("rawHtml")]),only_main_content:W.literal(!1),max_age:W.number().int().nonnegative()}).strict(),WL=W.object({url:Ye,raw_html:W.string().min(1),status_code:W.number().int().min(100).max(599).nullable()}).strict(),BL=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(),KL=W.object({batch_id:Tl,expires_at:mi.optional()}).strict(),Cx=W.object({url:Ye,raw_html:W.string().min(1)}).strict(),zL=W.object({status:kl,total:W.number().int().nonnegative(),completed:W.number().int().nonnegative(),pages:W.array(Cx).max(1e4),next:Ye.optional(),expires_at:mi}).strict().superRefine((e,n)=>{e.completed>e.total&&n.addIssue({code:"custom",path:["completed"],message:"completed must not exceed total"})}),vx=W.object({url:Ye,error_message:W.string().min(1)}).strict(),HL=W.object({errors:W.array(vx).max(1e4),robots_blocked:W.array(Ye).max(1e4)}).strict(),$L=W.object({active:W.number().int().nonnegative(),waiting:W.number().int().nonnegative(),max_concurrency:W.number().int().positive()}).strict();function Dx(e){try{let n=new URL(e).protocol;return n==="http:"||n==="https:"}catch{return!1}}var Al=["write_file","edit_file","delete_file"],Pl="apply_patch_batch",Ox=["set_breadcrumb_placement"],Nx=[...Al,Pl,...Ox];function jx(e){return Al.includes(e)}function YL(e){return Nx.includes(e)}function XL(e){return jx(e)||e===Pl}import{z as b}from"zod";var wl=b.lazy(()=>_n),Lx=b.enum(["page","block"]),pi=b.enum(["component","page","pages"]),Mx=b.enum(["en-US","zh-CN","zh-TW","fr-FR","de-DE","es-ES","ja-JP","ko-KR"]),$t=Mx,Cl=b.object({requested_locale:$t,resolved_locale:$t,fallback_used:b.boolean()}).strict(),ss=b.object({id:b.string().uuid(),key:b.string().min(1),name:b.string().min(1)}).strict(),li=ss.extend({color:b.string().nullable()}).strict(),tM=b.object({kind:Lx,category_id:b.string().uuid().optional(),tag_id:b.string().uuid().optional(),search:b.string().trim().min(1).max(200).optional(),limit:b.coerce.number().int().min(1).max(50).default(20),cursor:b.string().min(1).optional()}).strict(),Ux=b.object({stable_key:b.string().min(1),type:pi,title:b.string().min(1).max(200),description:b.string().max(1e3),thumbnail_url:b.string().url().nullable(),resolved_version:b.number().int().positive(),content_schema_version:b.literal(3),category:ss.nullable(),tags:b.array(li),page_count:b.number().int().nonnegative(),component_count:b.number().int().nonnegative(),locale:Cl}).strict(),nM=b.object({items:b.array(Ux),facets:b.object({categories:b.array(ss),tags:b.array(li)}).strict(),next_cursor:b.string().nullable()}).strict(),sM=b.object({operation_id:b.string().uuidv7(),resolved_version:b.number().int().positive(),base_sitemap_id:b.string().uuid(),base_sitemap_version:b.number().int().positive(),sitemap:wl,target_page_id:b.string().min(1).optional()}).strict(),iM=b.object({next_sitemap:wl,applied:b.object({stable_key:b.string().min(1),resolved_version:b.number().int().positive(),template_type:pi,page_ids:b.array(b.string().min(1)),block_ids:b.array(b.string().min(1))}).strict(),locale:Cl,warnings:b.array(b.string())}).strict(),vl=b.object({nodeId:b.string().uuid(),type:b.string().trim().min(1).max(100),label:b.string().trim().min(1).max(200),variant:b.string().trim().min(1).max(100).optional(),order:b.number().int().nonnegative(),props:b.record(b.string(),b.unknown()),thumbnail:b.string().url().optional(),source:b.unknown().optional()}).strict(),Dl=b.object({nodeId:b.string().uuid().optional(),slug:b.string().regex(/^\/$|^\/[a-z0-9]+(?:-[a-z0-9]+)*(?:\/[a-z0-9]+(?:-[a-z0-9]+)*)*$/u),navigation:b.object({showInHeader:b.boolean(),showInFooter:b.boolean(),order:b.number().int().nonnegative()}).strict(),components:b.array(vl).min(1).max(100),thumbnail:b.string().url().optional(),source:b.unknown().optional()}).strict(),Fx=Dl.extend({nodeId:b.uuidv7(),parentNodeId:b.uuidv7().optional()}).strict(),Gx=b.object({pages:b.array(Fx).min(1).max(50),thumbnail:b.string().url().optional(),source:b.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=h=>n.addIssue({code:"custom",path:["pages",o,"parentNodeId"],message:h}),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}}}),qx=b.union([vl,Dl,Gx]),Wx=b.object({title:b.string().min(1).max(200),description:b.string().min(1).max(1e3),prompt:b.string().min(1).max(8192)}).strict(),Bx=b.object({locale:$t,title:b.string().min(1).max(200),content:b.object({description:b.string().min(1).max(1e3),prompt:b.string().min(1).max(8192),nodes:b.record(b.string().uuid(),Wx)}).strict()}).strict(),oM=b.object({templateId:b.string().uuid(),stableKey:b.string().min(1),type:pi,resolvedVersion:b.number().int().positive(),contentSchemaVersion:b.literal(3),structure:qx,requestedLocale:$t,resolvedLocale:$t,fallbackUsed:b.boolean(),contents:b.array(Bx).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=Kx(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."})}),aM=b.object({items:b.array(b.object({stableKey:b.string().min(1),type:pi,title:b.string().min(1).max(200),description:b.string().max(1e3),thumbnailUrl:b.string().url().nullable(),resolvedVersion:b.number().int().positive(),contentSchemaVersion:b.literal(3),category:ss.nullable(),tags:b.array(li),pageCount:b.number().int().nonnegative(),componentCount:b.number().int().nonnegative(),requestedLocale:$t,resolvedLocale:$t,fallbackUsed:b.boolean()}).strict()),facets:b.object({categories:b.array(ss),tags:b.array(li)}).strict(),nextCursor:b.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 Kx(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 rM(e){return la({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}from"zod";var zx=["pending_dns","active","failed","removing"],Hx=z.enum(zx),$x=["serve_site","redirect_301"],Vx=z.enum($x),Yx=["traffic","ownership","certificate_delegation"],pa=z.enum(Yx),Xx=["pending","verified"],Qx=z.enum(Xx),Zx=["not_applicable","unavailable","not_needed","auto_applied","confirmation_required","blocked"],Jx=z.enum(Zx),da=z.enum(["prepare_configuration","apply_configuration","verify_dns","remediate_dns","confirm_dns_remediation"]),eE=z.enum(["accepted","running","succeeded","failed"]),tE=z.object({code:z.string().min(1),message:z.string().min(1)}).strict(),nE=z.object({purpose:pa,verified:z.boolean(),observedValues:z.array(z.string())}).strict(),Ol=z.object({ready:z.boolean(),providerReady:z.boolean(),dnsVerified:z.boolean(),records:z.array(nE)}).strict(),Nl=z.object({type:z.string().min(1),name:z.string().min(1),value:z.string().min(1),ttl:z.number().nullable()}).strict(),sE=z.object({purpose:pa,action:z.enum(["none","create","update","blocked"]),before:Nl.nullable(),after:Nl.nullable()}).strict(),jl=z.object({domainId:z.string().min(1),status:Jx,changes:z.array(sE)}).strict(),iE=z.object({purpose:pa,type:z.string().min(1),name:z.string().min(1),value:z.string().min(1),verificationStatus:Qx}).strict(),Ll=z.object({id:z.string().min(1),hostname:z.string().min(1),isPrimary:z.boolean(),routingMode:Vx,observedStatus:Hx,lastVerifiedAt:z.string().datetime().nullable(),dnsRecords:z.array(iE)}).strict().superRefine((e,n)=>{oE(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"})}),Ml=z.object({primaryDomain:Ll.nullable(),redirectDomains:z.array(Ll)}).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"})}),di=z.object({id:z.string().min(1),type:da,status:eE,error:tE.nullable(),result:z.union([Ol,jl]).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"){Ol.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"){jl.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 oE(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 y}from"zod";var aE=y.enum(["active","completed","canceled"]),rE=y.enum(["quality","domain","gsc","publish"]),ui=y.enum(["pending","running","succeeded","failed"]),Fl=ui,Gl=y.enum(["pending","running","completed"]),cE=y.object({group_code:y.string().min(1),name:y.string().min(1),score:y.number().nonnegative(),total_score:y.number().nonnegative(),pass_score:y.number().nonnegative(),running_status:Gl,result_text:y.string()}).strict(),mE=y.object({id:y.number().int().positive().optional(),quality_task_id:y.number().int().positive(),item_code:y.string().min(1),status:ui,is_repaired:y.boolean(),total_score:y.number().nonnegative(),score:y.number().nonnegative(),check_result:y.unknown().nullable(),remediation_items:y.unknown().nullable(),result_text:y.string(),created_at:y.string().min(1),updated_at:y.string().min(1),item_name:y.string().min(1),dimension_code:y.enum(["reach","trust","convert","safe"]),group_code:y.string().min(1),auto_fix:y.boolean()}).strict(),lE=y.object({dimension_code:y.enum(["reach","trust","convert","safe"]),name:y.string().min(1),alias_en:y.string().min(1),description:y.string(),tips:y.string(),score:y.number().nonnegative(),repaired_score:y.number().nonnegative(),total_score:y.number().nonnegative(),pass_score:y.number().nonnegative(),running_status:Gl,problem_group_count:y.number().int().nonnegative(),remediation_items:y.array(mE),groups:y.array(cE)}).strict(),pE=y.object({id:y.number().int().positive(),task_code:y.string().uuid(),scene_code:y.enum(["site_publish","vcp_published_pages","content_publish"]),tenant_id:y.string().min(1),vcp_site_id:k,cms_site_id:y.string().min(1),checked_url:y.string().url(),quality_params:y.record(y.string(),y.unknown()).nullable(),status:ui,error_info:y.record(y.string(),y.unknown()).nullable(),created_at:y.string().min(1),updated_at:y.string().min(1)}).strict(),dE=y.union([y.object({}).strict(),y.object({summary:y.object({final_score:y.number().nonnegative(),pass_score:y.number().nonnegative(),group_count:y.number().int().nonnegative(),problem_group_count:y.number().int().nonnegative()}).strict(),dimensions:y.array(lE)}).strict()]),Ul=y.object({quality_info:pE,quality_detail:dE}).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"]})}),hM=y.object({item_code:y.string().min(1),remediation_items:y.unknown().nullable()}).strict(),uE=y.object({item_code:y.string().min(1),repair_status:y.enum(["succeeded","failed"]),message:y.string().min(1).optional(),error_code:y.string().min(1).optional(),metadata:y.record(y.string(),y.unknown()).optional()}).strict(),ql=y.object({items:y.array(uE)}).strict(),SM=y.object({task_code:y.string().min(1),status:Fl,result:ql.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=y.object({id:cs,tenant_id:y.string().min(1),site_id:k,status:aE,current_step:rE,quality_task_code:y.string().uuid().nullable(),quality_task_status:ui,repair_task_code:y.string().min(1).nullable(),repair_task_status:Fl,publish_deployment_id:lt.nullable(),domain_hostname:y.string().min(1).nullable(),domain_operation_type:da.nullable(),domain_operation_payload:y.record(y.string(),y.unknown()).nullable(),domain_preparation_operation_id:y.string().min(1).nullable(),domain_operation_id:y.string().min(1).nullable(),revision:y.number().int().positive(),created_at:y.string().min(1),updated_at:y.string().min(1),completed_at:y.string().min(1).nullable(),canceled_at:y.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"})}),fM=y.object({}).strict(),bM=y.object({expected_revision:y.number().int().nonnegative(),current_step:y.enum(["domain","gsc","publish"]),skip_domain_binding:y.boolean().optional()}).strict(),yM=y.object({expected_revision:y.number().int().nonnegative()}).strict(),_E=y.object({workflow:Dt.nullable(),can_cancel:y.boolean()}).strict(),xM=M(_E).strict(),gE=y.object({workflow:Dt,can_cancel:y.boolean()}).strict(),EM=M(gE).strict(),hE=y.object({workflow:Dt,deployment:y.lazy(()=>Ot)}).strict(),RM=M(hE).strict(),SE=y.object({workflow:Dt,can_cancel:y.boolean(),quality_result:Ul.optional(),safety_gate_enabled:y.boolean().optional(),repair_result:ql.optional(),final_quality_result:Ul.optional(),message:y.string().min(1).optional()}).strict(),IM=M(SE).strict();function TM(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.score<i.total_score&&i.auto_fix&&n.has(i.item_code)).map(i=>({item_code:i.item_code,remediation_items:i.remediation_items})))}function kM(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 AM(e,n){return e.quality_info.status!=="succeeded"||!("summary"in e.quality_detail)?null:e}function fE(e){return e.status==="failed"||e.status==="succeeded"&&e.score<e.total_score}function PM(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"||a.status!=="succeeded"&&a.status!=="failed"))return n;let o=i.remediation_items.filter(fE).length;return o>0?{status:"blocked",issueCount:o}:i.score<i.pass_score?n:{status:"passed",issueCount:0}}var bE=Me.object({hostname:Me.string().min(1),expected_revision:Me.number().int().nonnegative()}).strict(),Wl=Me.object({workflow:Dt,operation:di}).strict(),yE=M(Wl).strict(),xE=Me.object({expected_revision:Me.number().int().nonnegative()}).strict(),EE=Me.object({workflow:Dt,operation:di}).strict(),RE=M(EE).strict(),ua=Me.object({workflow:Dt,operation:di.nullable()}).strict(),IE=M(ua).strict(),TE=ua,kE=M(TE).strict(),NM=M(Ml).strict(),AE=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"}))}),jM=M(AE).strict(),LM=bE,MM=Wl,UM=yE,FM=ua,GM=IE,qM=kE,WM=xE,BM=RE;import{z as Be}from"zod";var PE=["started","success","failed","canceled"],_a=Be.enum(PE),wE=["inactive","pending_binding","active"],ga=Be.enum(wE),CE=["domain","url_prefix"],ha=Be.enum(CE),vE=["not_connected","authorizing","matching_property","ready","failed","canceled","domain_mismatch"],Sa=Be.enum(vE),mt=Be.string().nullable(),Bl=Be.object({}).strict(),fa=Be.object({authorize_url:Be.string().url(),custom_domain:mt}).strict(),Kl=M(fa),DE=Be.object({auth_status:_a,binding_status:ga,credential_connected:Be.boolean(),custom_domain:mt,gsc_site_url:mt,property_type:ha.nullable(),auth_error_code:mt,auth_error_message:mt}).strict(),zl=Be.object({auth_status:_a,binding_status:ga,credential_connected:Be.boolean(),custom_domain:mt,gsc_site_url:mt,property_type:ha.nullable(),auth_error_code:mt,auth_error_message:mt,current_domain:mt,state:Sa,ready:Be.boolean()}).strict().superRefine((e,n)=>{let s=NE(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`})}),OE=M(zl);function is(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 NE(e,n){let s=e.gsc_site_url?.trim()??"",i=is(e.custom_domain),o=is(n??("current_domain"in e?e.current_domain:void 0)),a=i.length>0&&o.length>0&&i===o,c=jE(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 jE(e,n,s){let i=e?.trim()??"",o=is(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=is(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:is(a.hostname)===o}catch{return!1}}var $M=Bl,VM=fa,YM=Kl,XM=Sa,QM=_a,ZM=ga,JM=ha,eU=Sa,tU=Bl,nU=fa,sU=Kl,iU=DE,oU=zl,aU=OE;import{z as O}from"zod";var Ke=O.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER),tt=O.string().min(1).max(4096),gn=O.string().regex(/^[A-Za-z0-9_-]{43}$/),hn=O.string().max(300),ba=O.string().datetime({offset:!0}).nullable(),Hl=O.string().regex(/^[A-Z][A-Z0-9_]*$/).max(100).nullable(),LE=["authorized","pending","failed","revoked","expired","not_authorized"],ME=O.enum(LE),UE=["pending","succeeded","failed","canceled","expired","superseded"],FE=O.enum(UE),GE=["unconfigured","configured","needs_reconfiguration","unverified"],qE=O.enum(GE),WE=["not_checked","valid","invalid","unavailable"],BE=O.enum(WE),KE=["authorization_pending","authorization_required","authorization_changed","resource_unavailable","resource_changed","verification_required","verification_unavailable"],zE=O.enum(KE),$l=O.object({revision:Ke,status:FE,started_at:O.string().datetime({offset:!0}),expires_at:O.string().datetime({offset:!0}),finished_at:ba,error_code:Hl}).strict(),lU=O.object({expected_authorization_revision:Ke,expected_attempt_revision:Ke,select_account:O.boolean().default(!1),replace_pending:O.boolean().default(!1)}).strict(),HE=O.object({authorize_url:O.string().url(),authorization_revision:Ke,attempt:$l}).strict(),pU=M(HE),$E=O.object({status:ME,authorization_revision:Ke,account_email:O.string().max(320).nullable(),latest_attempt:$l.nullable()}).strict(),VE=O.object({account_ref:tt,account_key:gn,account_display_name:hn,property_ref:tt,property_key:gn,property_display_name:hn,data_stream_ref:tt,data_stream_key:gn,data_stream_display_name:hn,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(),YE=O.object({status:BE,checked_at:ba,expires_at:ba,error_code:Hl}).strict(),XE=O.enum(["oauth","verification"]),QE=O.object({measurement_id_display:O.string().min(1).max(40),stream_display_name:O.string().max(100).nullable()}).strict(),ZE=O.object({status:O.enum(["pending","applied"]),applied_revision:Ke}).strict(),Vl=O.object({capability_enabled:O.boolean(),revision:Ke,authorization:$E,binding_status:qE,reason:zE.nullable(),ready:O.boolean(),mode:XE.nullable(),binding:VE.nullable(),verification:YE,tracking:QE.nullable(),deployment:ZE}).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"})}),dU=M(Vl),uU=O.object({refresh:O.union([O.boolean(),O.enum(["true","false"]).transform(e=>e==="true")]).default(!1)}).strict(),JE=O.object({property_ref:tt,property_key:gn,display_name:hn}).strict(),eR=O.object({account_ref:tt,account_key:gn,display_name:hn,properties:O.array(JE)}).strict(),tR=O.object({accounts:O.array(eR),returned_count:O.number().int().nonnegative(),completeness:O.literal("unknown"),authorization_revision:Ke}).strict(),_U=M(tR),gU=O.object({authorization_revision:O.coerce.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER)}).strict(),nR=O.object({data_stream_ref:tt,data_stream_key:gn,display_name:hn,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(),sR=O.object({property_ref:tt,streams:O.array(nR),returned_count:O.number().int().nonnegative(),completeness:O.literal("unknown"),authorization_revision:Ke}).strict(),hU=M(sR),SU=O.object({property_ref:tt,authorization_revision:O.coerce.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER)}).strict(),fU=O.object({expected_revision:Ke,authorization_revision:Ke,account_ref:tt,property_ref:tt,data_stream_ref:tt,confirm_url_mismatch:O.boolean()}).strict(),iR=O.object({applied_revision:Ke,idempotency_replayed:O.boolean()}).strict(),oR=Vl.and(O.object({mutation:iR}).strict()),bU=M(oR);var Yl=/^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/,Xl="VCP_E2B_PREVIEW_PROXY_DOMAIN must be a valid hostname.";function aR(e){let n=e?.trim().toLowerCase()??"";if(!n)return null;if(n.length>253||!n.includes(".")||!n.split(".").every(s=>Yl.test(s)))throw new Error(Xl);return n}function xU(e){let n=aR(e.proxyDomain);if(!n)return null;let s=e.sandboxId.trim();if(!Yl.test(s))throw new Error("sandboxId must be a valid DNS label.");if(`${s}.${n}`.length>253)throw new Error(Xl);return`https://${s}.${n}/`}function RU(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 rR(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:Ql(n.primaryLinks,e,i,a,c,o,"showInHeader"),footerLinks:Ql(n.footerLinks,e,i,a,c,o,"showInFooter")}}function Ql(e,n,s,i,o,a,c){let r=new Set,m=[];for(let[K,H]of e.entries()){let ie=cR(H.href),fe=ie===null?void 0:s.get(ie)??i.get(ie);if(ie!==null&&o.has(ie)&&!s.has(ie)&&!i.has(ie))continue;if(fe?.slug==="/"){m.push({kind:"independent",link:{...H,label:Zl(H,fe,a)}});continue}if(!fe){m.push({kind:"independent",link:H});continue}if(!fe.navigation[c])continue;r.add(fe.slug);let xn=ie===fe.slug?H.href:mR(H.href,fe.slug);m.push({kind:"page",page:fe,link:{...H,label:Zl(H,fe,a),href:xn},index:K})}let x=m.filter(K=>K.kind==="page").sort((K,H)=>K.page.navigation.order-H.page.navigation.order||K.index-H.index),h=0,P=m.map(K=>K.kind==="page"?x[h++].link:K.link);for(let K of[...n].filter(H=>H.slug!=="/"&&H.navigation[c]).sort((H,ie)=>H.navigation.order-ie.navigation.order))r.has(K.slug)||P.push({label:K.title,href:K.slug});return P}function Zl(e,n,s){let i=s.get(n.id);return e.label===(i?.title??n.title)?n.title:e.label}function cR(e){if(!e.startsWith("/")||e.startsWith("//"))return null;let n=e.search(/[?#]/u);return n===-1?e:e.slice(0,n)}function mR(e,n){let s=e.search(/[?#]/u);return s===-1?n:`${n}${e.slice(s)}`}function _i(e){return e.trim().normalize("NFKC").toLowerCase()}function lR(e){let n=e?.toLowerCase();return n?.startsWith("zh")?"\u9996\u9875":n?.startsWith("ja")?"\u30DB\u30FC\u30E0":n?.startsWith("ko")?"\uD648":"Home"}function pR(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 os(e){return e.parent_page_id??null}function gi(e,n){let s=os(e);return s===null?!0:!n.some(i=>i.id===s)}function Jl(e,n){return e.filter(s=>os(s)===n&&s.id!==n)}function ep(e){let n=e.filter(c=>gi(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 Jl(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 uR(e){if(!e.startsWith("/")||e.startsWith("//"))return null;let n=e.search(/[?#]/);return n===-1?e:e.slice(0,n)}function _R(e,n){let s=ep(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=uR(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 gR(e){let n=e.filter(s=>gi(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 hR(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&&_i(o[0].title)!==_i(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=os(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}os(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=gi(c,e)?"__top__":os(c),m=_i(c.title);if(m.length===0)continue;let x=a.get(r)??new Map,h=x.get(m);h!==void 0&&h!==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 SR=16,fR=/[ᄀ-ᅟ⺀-〾ぁ-㏿㐀-䶿一-鿿ꀀ-가-힣豈-︰--⦆¢-₩]/u;function bR(e){let n=0;for(let s of e)n+=fR.test(s)?2:1;return n}function yR(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 tp=20*1024*1024,xR=tp,np=["jpg","jpeg","png","gif","webp","bmp"],sp=["mp4","avi","mov","webm","mkv"],ip=["mp3","wav","aac","flac","ogg","wma","m4a"],op=["pdf","doc","docx","xls","xlsx","ppt","pptx","txt","md","csv"],ap=[...op,"zip","rar","json","xmind","psd","ai","fig","sketch"],ER=[...np,...sp,...ip,...ap],rp=["image/jpeg","image/png","image/gif","image/webp","image/bmp"],cp=["video/mp4","video/x-msvideo","video/quicktime","video/webm","video/x-matroska"],mp=["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"],RR=[...rp,...cp,...mp],lp=A.enum(["image","video","audio","file"]),pp=A.enum(["external","ai_generated","unsplash"]),ya=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:pp,created_at:A.string().min(1).nullable()}),IR=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:lp.default("image")}),TR=A.object({code:A.literal(0),message:A.string(),data:A.object({items:A.array(ya),page:A.number().int().min(1),page_size:A.number().int().min(1),total:A.number().int().nonnegative()})}),kR=A.object({code:A.literal(0),message:A.string(),data:ya}),xa=4,AR=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*$/)}),dp=A.object({index:A.number().int().min(0).max(xa-1),ok:A.literal(!0),url:A.string().regex(/^data:image\/(?:png|jpeg|gif|webp|bmp);base64,[A-Za-z0-9+/]+={0,2}$/)}),PR=A.object({code:A.literal(0),message:A.string(),data:A.object({items:A.array(dp).min(1).max(xa)})}),up=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()}),CR=A.object({code:A.literal(0),message:A.string(),data:A.object({items:A.array(up),page:A.number().int().min(1),page_size:A.number().int().min(1),total:A.number().int().nonnegative(),total_pages:A.number().int().nonnegative()})}),_p=A.string().url().refine(jR,{message:"download_location must be an official Unsplash download URL"}),vR=A.object({download_location:_p}),DR=A.object({code:A.literal(0),message:A.string(),data:A.object({reported:A.boolean()})}),OR=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()}),NR=A.object({code:A.literal(0),message:A.string(),data:A.object({reported:A.boolean()})});function jR(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 LR=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"}),MR=me.object({ok:me.literal(!0),design_plan_version:me.number().int().positive().optional(),snapshot_id:I,site_design_context:me.lazy(()=>hi).optional(),changed_files:me.array(me.string().min(1)).optional()}),UR=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:wo.nullable(),notes:me.array(me.string()).nullable(),weight_style:We.nullable().default(null),source:me.enum(["globals_css","design_plan_archive"])});import{z as v}from"zod";var Te=v.string().min(1).max(100),gp=v.enum(["page","anchor","external","email","phone","file","group"]);function FR(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 GR=v.string().max(2048).refine(FR,"Invalid navigation destination"),hp=v.string().trim().min(1).max(255),Sp=v.enum(["link","cta"]).nullable(),fp=v.lazy(()=>v.object({id:Te,group_id:Te,parent_id:Te.nullable(),sort_order:v.number().int().nonnegative(),label:v.string(),href:v.string().nullable(),target_type:gp,enabled:v.boolean(),effective_visible:v.boolean(),open_in_new:v.boolean(),nofollow:v.boolean(),role:Sp,link_binding:v.object({kind:v.enum(["custom","cms_page","file"]),page_id:Te.nullable()}),children:v.array(fp)})),qR=v.object({id:Te,name:v.string(),description:v.string(),is_default:v.boolean(),can_delete:v.boolean(),delete_block_reason:v.string().nullable(),items:v.array(fp)}),WR=v.object({site_id:v.string().min(1),default_group_id:Te.nullable(),groups:v.array(qR),limits:v.object({max_depth:v.number().int().positive(),max_items:v.number().int().positive()})}),UU=v.object({data:WR}),bp=v.object({name:hp,description:v.string().max(2e3).optional()}).strict(),BR=bp.partial().refine(e=>Object.keys(e).length>0,"At least one field is required"),FU=v.object({group_id:Te}).strict(),yp={label:hp,target_type:gp,href:GR.nullable().optional(),enabled:v.boolean().optional(),open_in_new:v.boolean().optional(),nofollow:v.boolean().optional(),role:Sp.optional()},KR=v.object({group_id:Te,parent_id:Te.nullable().optional(),...yp}).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"})}),zR=v.object({...yp,link_mode:v.literal("custom").optional()}).partial().strict().refine(e=>Object.keys(e).length>0,"At least one field is required"),HR=v.object({group_id:Te,parent_id:Te.nullable(),before_id:Te.nullable().optional()}).strict(),$R=v.object({cms_bound:v.boolean(),bound_nav_keys:v.array(v.string()).optional(),analyzed_snapshot_id:v.string().nullable().optional(),cms_driven:v.boolean(),supports_groups:v.boolean(),supports_nested_groups:v.boolean(),supports_link_attributes:v.boolean(),requires_agent:v.boolean(),reasons:v.array(v.string())}),GU=v.object({data:$R}),qU=v.discriminatedUnion("action",[v.object({action:v.literal("create_group"),values:bp}).strict(),v.object({action:v.literal("update_group"),id:Te,values:BR}).strict(),v.object({action:v.literal("delete_group"),id:Te}).strict(),v.object({action:v.literal("set_default_group"),group_id:Te}).strict(),v.object({action:v.literal("create_item"),values:KR}).strict(),v.object({action:v.literal("update_item"),id:Te,values:zR}).strict(),v.object({action:v.literal("delete_item"),id:Te,cascade:v.boolean().optional()}).strict(),v.object({action:v.literal("move_item"),id:Te,values:HR}).strict()]);import{z as le}from"zod";var Ea=le.enum(["products","cases","guides","documents","company"]),VR=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(),YR=le.discriminatedUnion("status",[le.object({collection:Ea,status:le.literal("processing")}).strict(),le.object({collection:Ea,status:le.enum(["imported","partial","failed"]),imported:yt,exception:yt}).strict()]),xp=le.enum(["legacy_domain_not_routed","site_context_missing","site_rules_limit_exceeded","site_rules_not_served"]),XR=le.enum(["target_page_unpublished","redirect_target_missing","redirect_write_failed",...xp.options]),QR=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:xp.nullable(),same_path:yt,active:yt,exception:yt,exceptions:le.array(le.object({path:le.string().regex(/^\/[^?#]*$/),reason_code:XR}))})]),KU=le.object({overall_status:le.enum(["moving","completed","disabled","failed"]),by_collection:le.array(YR),media:le.object({image:yt,video:yt,audio:yt,file:yt}),exceptions:le.array(le.object({collection:Ea.nullable(),path:le.string().regex(/^\/[^?#]*$/),reason_code:VR})),redirects:QR.nullable().optional()});var Ta=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()}),Ra=t.enum(["material","reference","brief","industry"]),ZR=t.object({market:t.object({value:t.string().min(1).max(200),source:Ra}),customer:t.object({value:t.string().min(1).max(200),source:Ra}),purpose:t.object({options:t.array(t.string().min(1).max(60)).min(2).max(4),selected:t.string().min(1).max(60),source:Ra})}),JR=t.enum(["text-options","motion-slider","positioning"]),ka=t.enum(["none","subtle","moderate","expressive"]),eI=t.enum(["compact","comfortable","airy","editorial"]),tI=ka,Ap=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()}),nI=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:Ta.optional(),conversionHints:Mt.optional()}),sI=t.object({id:t.string(),type:JR,question:t.string(),tag:t.string(),aiThinking:t.string(),options:t.array(nI),source:t.enum(["ai-detected","always-ask"]),sourceDetail:t.string(),positioning:ZR.optional()}),Aa=t.object({questions:t.array(sI).min(1).max(6)}),bF=t.object({tenant_id:t.string().min(1),site_id:k,brief_id:Yt,brief:t.string().min(20).max(1e3),site_default_locale:Re.optional(),owner_locale:Re.optional(),input_context:t.object({facts:t.array(us).max(120),conflicts:t.array(gs).max(20),reference:_s.optional(),sources:t.array(t.object({type:ki,title:t.string().max(120).optional(),status:Ai})).max(16).optional()}).optional()}),Pp=t.enum(["model_schema_invalid","provider_rate_limited","provider_unavailable","aborted","unknown"]),yF=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(Ap).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:Pp.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)})]),xF="SITE_PLANNING_INPUT_FROZEN",EF="SITE_PLANNING_LOCKED",RF="SITE_STRUCTURE_CONFIRMATION_REQUIRED",IF="SITE_STRUCTURE_CONFIRMATION_STALE",TF="SITE_SITEMAP_DRAFT_STALE",kF="SITE_SITEMAP_DRAFT_OPERATION_MISMATCH",Ep="SITE_STRUCTURE_INVALID",AF=t.object({tenant_id:t.string().min(1),name:t.string().min(1).max(120),brief:t.string().min(20).max(1e3)}),PF=t.object({name:t.string().min(1).max(120),brief:t.string().min(20).max(1e3)}),wF=t.object({name:t.string().min(1).max(120)}),CF=t.object({name:t.string().min(1).max(120),default_locale:Re.optional()}),vF=t.object({body:t.string().min(20).max(1e3)}),DF=t.object({body:t.string().min(20).max(1e3)}),Pa=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"}),OF=t.object({tenant_id:t.string().min(1),site_id:k.optional(),site_url:Pa.optional(),site_name:t.string().trim().min(1).max(255).optional()}),NF=M(Pr),jF=M(wr),LF=M(Cr),MF=M(Kr),UF=M(zr),FF=M(Hr),GF=M(Vr),qF=M(Yr),WF=M(Xr),BF=M(t.object({site_id:k,site_url:Pa.nullable()})),jt=t.object({id:k,tenant_id:t.string().min(1),name:t.string().min(1),slug:t.string().min(1),status:oo,deployment_status:ao,archived_at:t.string().min(1).nullable(),current_sitemap_id:ke.nullable(),confirmed_sitemap_id:ke.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:Re,owner_locale:Re.optional(),cms_site_id:bs.nullable().optional(),cms_site_url:Pa.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)}),wa=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)}),KF=t.object({site:jt,brief:wa,next_step:t.literal("clarify")}),zF=t.object({site:jt,brief:wa}),HF=t.object({brief:wa}),iI=t.enum(["queued","running","succeeded","failed","cancelled"]),wp=t.enum(["clarify","sitemap","workspace"]),Cp=t.enum(["clarify","sitemap","initial_generation","iteration","landing_page","fill_in"]),vp=t.enum(["clarify","sitemap","workspace","summarize"]),nt=t.object({id:$,tenant_id:t.string().min(1),site_id:k,agent_type:wp,run_kind:Cp,status:iI,model_route:vp,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()}),$F=t.object({agent_run:nt}).strict(),oI=t.enum(["workspace","landing_page","external"]),aI=t.enum(["user","background"]),Dp=t.enum(["active","archived"]),yi=t.object({id:st,tenant_id:t.string().min(1),site_id:k,kind:oI,origin:aI,subject_key:t.string().min(1).max(200),title:t.string().min(1).max(200),status:Dp,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)}),VF=t.object({agent_run:nt,thread:yi.nullable()}),YF=t.object({run_id:$.optional(),site_id:k,agent_type:wp,run_kind:Cp.optional(),model_route:vp,input:t.record(t.string(),t.unknown()).optional()}).superRefine((e,n)=>{as(e.input)&&n.addIssue({code:"custom",path:["input"],message:"Agent run input must not contain secrets"})}),XF=t.object({agent_run:nt,next_step:t.literal("stream_events")}),Op=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:Op,created_at:t.string().min(1)}),QF=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()}),ZF=t.object({site:jt,snapshot:xt,next_step:t.literal("workspace")}),JF=t.object({expected_manifest_hash:xt.shape.manifest_hash,manifest_hash:xt.shape.manifest_hash,object_key:xt.shape.object_key}).strict(),eG=t.union([t.object({base_snapshot_id:I.nullable(),source_run_id:$.optional(),page_template_advisories:t.array(In).optional()}).strict(),t.object({skip_base_check:t.literal(!0)}).strict()]),rI=t.object({site:jt,snapshot:xt,next_step:t.literal("workspace")}),tG=t.object({snapshot:xt}),nG=t.object({status:t.literal("deleting"),snapshot_id:I,object_key:t.string().min(1)}),sG=t.object({status:t.literal("deleted"),snapshot_id:I}),xi=t.object({id:Ba,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)}),cI=xi.extend({reason:xt.shape.reason,status:Op}),iG=t.object({accepted_commit:t.string().min(1),source_run_id:$.optional()}),oG=t.object({site_version:xi,next_step:t.literal("workspace")}),aG=t.object({owner_id:t.string().min(1)}).strict(),rG=t.discriminatedUnion("acquired",[t.object({acquired:t.literal(!0)}).strict(),t.object({acquired:t.literal(!1)}).strict()]),cG=t.object({owner_id:t.string().min(1)}).strict(),mG=t.object({released:t.literal(!0)}).strict(),lG="TEMPLATE_UPGRADE_LOCK_LOST",pG=t.object({base_snapshot_id:I,accepted_commit:xi.shape.accepted_commit,owner_id:t.string().min(1)}).strict(),dG=rI.strict(),uG=t.object({site_versions:t.array(cI)}),_G=t.object({site:jt,snapshot:xt,site_version:xi,next_step:t.literal("workspace")}),gG=t.object({snapshot_id:I,force_rehydrate:t.boolean().optional(),recovery_required:t.boolean().optional(),required_cms_site_id:bs.optional()}),mI=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:Oi.optional()})]),hG=t.object({tenant_id:t.string().min(1),site_id:k,snapshot_id:I,cms_site_id:bs.optional()}).strict(),SG=mI,Ca=t.enum(Xt),Np=t.enum(["quality_check","publish"]),Ot=t.object({id:lt,tenant_id:t.string().min(1),site_id:k,snapshot_id:I,type:Np.default("publish"),version:t.number().int().positive(),status:Ca,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)}),fG=t.object({tenant_id:t.string().min(1),site_id:k,expected_snapshot_id:I}).strict(),bG=t.object({deployment:Ot}),yG=t.object({tenant_id:t.string().min(1),site_id:k,deployment_id:lt}).strict(),xG=t.object({deployment:Ot}),EG=t.object({}).strict(),RG=t.object({snapshot_id:I.optional()}).strict(),lI=t.object({deployment:Ot}),IG=M(lI),TG=t.object({deployment:Ot.nullable()}),kG=t.object({deployment:Ot}),Rp=t.object({id:lt,type:Np.default("publish"),status:Ca,url:t.string().url().nullable(),error_code:t.string().min(1).nullable(),provider_deployment_id:t.string().min(1).nullable()}),pI=t.object({current:Rp.nullable(),latest_released:Rp.nullable()}),AG=M(pI),dI=t.enum(["deployment.snapshot","deployment.status.changed","deployment.finished","deployment.failed","deployment.realtime.recovered","server.error"]),Sn=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)}),Si=t.object({deployment:Ot,steps:Mc.default([])}),PG=t.discriminatedUnion("type",[Sn.extend({type:t.literal("deployment.snapshot"),payload:Si}),Sn.extend({type:t.literal("deployment.status.changed"),payload:Si}),Sn.extend({type:t.literal("deployment.finished"),payload:Si}),Sn.extend({type:t.literal("deployment.failed"),payload:Si}),Sn.extend({type:t.literal("deployment.realtime.recovered"),payload:t.object({action:t.literal("refresh")})}),Sn.extend({type:t.literal("server.error"),payload:t.object({code:t.string().min(1),message:t.string().min(1),retryable:t.boolean()})})]),wG=t.object({tenant_id:t.string().min(1),site_id:k,deployment_id:lt,status:Ca,updated_at:t.string().min(1)}),uI="vcp:deployments",CG={path:"/v1/sites/:site_id/deployments/:deployment_id/socket",redis_channel:uI,outbound_message_schema:"DeploymentWsServerMessageSchema",message_types:[...dI.options]},_I=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:_I.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})})}),DG=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({})}),gI=t.object({theme_id:t.string().min(1),paletteIntent:t.string().min(1),tone:t.string().min(1),mediaMood:t.string().min(1),motionLevel:ka.optional(),userVisualHints:Ta.optional()}),hI=t.object({key:t.string().min(1).max(64).optional(),question:t.string().min(1),answer:t.string().min(1)}),OG=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)}),NG=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()}),SI=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()}),jG=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:SI.optional()}),fI=t.enum(["system_recommended","user_picked","user_picked_extended","deterministic_fallback"]),fn=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:fI.default("system_recommended")}),se=t.string().min(1).max(2e3),Ip=t.string().min(1).max(120),hi=t.object({visualDirection:se,brandFeeling:se,paletteIntent:se,typographyIntent:se,density:eI,motionLevel:tI,motionPreset:t.enum(["subtle","moderate","expressive"]).optional(),mediaStrategy:se,compositionRules:t.array(se).max(20),avoidPatterns:t.array(se).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()}),va=160,jp=t.object({routeGoal:se,narrativeArc:se,firstViewportIntent:se,visualContinuity:se,sectionRhythm:se,avoidPatterns:t.array(se).max(20),displayTitle:t.string().min(1).max(40).optional(),displayDescription:t.string().min(1).max(va).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()}),Lp=t.enum(["model_call","validation","repair","preview","worker_group"]),Nt=t.enum(["generating","generating_design_plan","checking_quality","updating_design_memory"]),Mp=t.object({sectionRole:se,contentIntent:se,layoutIntent:se,visualIntent:se,mediaIntent:se,motionIntent:se,interaction:ds.optional(),copyTone:se,displayTitle:t.string().min(1).max(40).optional(),displayDescription:t.string().min(1).max(va).optional(),ctaIntent:se.optional(),continuityWithPrevious:se.optional(),avoidRepeating:t.array(se).max(20).optional(),industryRecipeRefs:t.array(Ip).max(12).optional(),templateRecipeRefs:t.array(Ip).max(12).optional()}),Up=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()}),bI=t.enum(["solid","floating"]),yI=t.enum(["background","card","primary","frosted"]),xI=t.enum(["sticky","hide-on-scroll","static"]),EI=t.enum(["bar","island"]),RI=t.object({variant:bI,surface:yI.optional(),behavior:xI.optional(),shape:EI.optional()}),II=t.object({form:se,layoutIntent:se,scrollBehavior:se,shell:RI.optional(),avoidPatterns:t.array(se).max(10).optional()}),TI=t.enum(["background","card","primary","inverse"]),kI=t.object({surface:TI}),AI=t.object({form:se,composition:se,shell:kI.optional(),avoidPatterns:t.array(se).max(10).optional()}),PI=t.object({pattern:se,intent:se}),Fp=t.object({header:II,footer:AI,mobileNav:PI}),Gp=t.enum(["top","below-hero","footer","none"]),qp=t.object({schemaVersion:t.literal(1).default(1),siteDesignContext:hi,routeCards:t.record(t.string().min(1),jp),blockContexts:t.record(t.string().min(1),Mp),selectedSkillPacks:t.array(fn).max(3).optional(),branding:Up.optional(),chromeDesign:Fp.optional(),breadcrumbPlacement:Gp.optional()}),LG=t.object({siteDesignContext:hi.omit({imagePalette:!0}).optional(),routeCards:t.record(t.string().min(1),jp).optional(),blockContexts:t.record(t.string().min(1),Mp.extend({interaction:ds.nullable().optional()})).optional(),branding:Up.optional(),chromeDesign:Fp.optional()}),Ge=t.string().trim().min(1),Da=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(),Oa=t.string().regex(Nn,"Page slug must be '/' or a lowercase ASCII kebab-case absolute path."),wI=new RegExp(`^/(?:${Jt}(?:/${Jt})*)?(?:\\?[^#\\s]*)?(?:#[^\\s]*)?$`),CI=/^(?:#[^\s]*|[a-z][a-z0-9+.-]*:[^\s]+|\/\/[^\s]+)$/i,vI=t.union([t.string().regex(wI),t.string().regex(CI)]),Tp=t.object({label:t.string(),href:vI}).passthrough(),DI=t.object({primaryLinks:t.array(Tp),footerLinks:t.array(Tp)}),Wp=t.object({showInHeader:t.boolean(),showInFooter:t.boolean(),order:t.number()}).strict(),Na=t.object({id:Ge,slug:Oa,title:t.string().trim().min(1),blocks:t.array(Da).min(1),navigation:Wp,parent_page_id:Ge.nullable().optional()}).strict(),OI=Da.extend({type:t.string().nullable()}).strict(),NI=Na.extend({slug:Oa.nullable(),navigation:Wp.extend({showInHeader:t.boolean().nullable(),showInFooter:t.boolean().nullable()}).strict(),blocks:t.array(OI).min(1)}).strict(),jI=Da.extend({id:t.string()}),LI=Na.omit({parent_page_id:!0}).extend({id:t.string(),slug:t.string().min(1),blocks:t.array(jI).min(1),parent_page_id:t.string().nullable().optional()}),kp=t.object({label:t.string(),href:t.string().min(1)}),MI=t.object({primaryLinks:t.array(kp),footerLinks:t.array(kp)}),UI=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()]),fi=t.object({site_name:t.string().min(1).max(80).optional(),version:t.number().int().positive(),pages:t.array(Na).min(1),navigation:DI,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:UI.optional()}),skillSelection:fn,visualTheme:gI.optional(),userChoices:t.array(hI).optional(),confirmedChoices:t.object({conversion:Mt.optional()}).optional(),seoKeywords:t.array(wn).min(1).optional()}).strict(),bn=fi.superRefine((e,n)=>{Bp(e.pages,n)}),_n=fi.extend({pages:t.array(NI).min(1)}).strict().superRefine((e,n)=>{Bp(e.pages,n)}),FI=t.enum(["slug","showInHeader","showInFooter"]),GI=t.object({page_id:Ge,fields:t.array(FI).min(1).max(3)}).strict(),qI=t.object({page_id:Ge,block_id:Ge,fields:t.tuple([t.literal("type")])}).strict(),WI=100,BI=500,KI=t.object({pages:t.array(GI).max(WI),blocks:t.array(qI).max(BI)}).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)})}),MG=t.object({sitemap:_n,targets:KI,reserved_slugs:t.array(Oa).optional()}).strict(),UG=t.object({sitemap:bn}).strict();function Bp(e,n){let s=new Map,i=new Map,o=new Map,a=0;e.forEach((m,x)=>{let h=s.get(m.id);if(h!==void 0?n.addIssue({code:"custom",path:["pages",x,"id"],message:`Duplicate page id '${m.id}' (first used at pages.${h}.id).`}):s.set(m.id,x),m.blocks.forEach((K,H)=>{let ie=i.get(K.id);ie!==void 0?n.addIssue({code:"custom",path:["pages",x,"blocks",H,"id"],message:`Duplicate block id '${K.id}' (first used at pages.${ie.pageIndex}.blocks.${ie.blockIndex}.id).`}):i.set(K.id,{pageIndex:x,blockIndex:H})}),m.slug===null)return;m.slug==="/"&&(a+=1);let P=o.get(m.slug);P!==void 0?n.addIssue({code:"custom",path:["pages",x,"slug"],message:`Duplicate page slug '${m.slug}' (first used at pages.${P}.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:Ep}});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:Ep}});e.forEach((m,x)=>{let h=m.parent_page_id??null;if(h===null)return;let P=["pages",x,"parent_page_id"];if(m.slug==="/"){r(P,"The home page cannot have a parent.");return}if(h===m.id){r(P,`Page '${m.id}' cannot be its own parent.`);return}let K=c.get(h);if(!K){r(P,`Parent page '${h}' does not exist.`);return}if(K.page.slug==="/"){r(P,"The home page cannot have sub pages.");return}(K.page.parent_page_id??null)!==null&&r(P,`Sitemap allows at most two levels; parent '${h}' must be a top-level page.`)})}var FG=fi.omit({skillSelection:!0,visualTheme:!0,userChoices:!0,confirmedChoices:!0,seoKeywords:!0}).extend({meta:fi.shape.meta.omit({source:!0}),site_name:t.string().min(1).max(80),pages:t.array(LI).min(1),navigation:MI}),zI=t.enum(["ai","user"]),yn=t.object({site_id:k,page_id:Ge,edited_by:zI.default("ai"),source_agent_run_id:$.optional()}),GG=yn.extend({block_id:Ge,target_index:t.number().int().min(0)}),HI=yn.extend({block_id:Ge}),$I=yn.extend({block_id:Ge,instruction:t.string()}),qG=yn.extend({block_id:Ge,variant:t.string().min(1).nullable()}),WG=yn.extend({block_id:Ge,props:t.record(t.string(),t.unknown()),mode:t.enum(["replace","merge"]).default("replace")}),BG=yn.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()})}),VI=t.enum(["move_block","delete_block","update_block_instruction","change_block_variant","update_block_props","add_block"]),KG=t.discriminatedUnion("operation",[t.object({operation:t.literal("delete_block"),input:HI}).strict(),t.object({operation:t.literal("update_block_instruction"),input:$I}).strict()]),YI=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"]),XI=t.object({status:t.literal("updated"),operation:VI,site_id:k,sitemap_id:ke,version:t.number().int().positive(),changed_pages:t.array(Ge).min(1),requires_code_patch:t.literal(!0)}),QI=t.object({status:t.literal("failed"),code:YI,message:t.string().min(1),retryable:t.boolean().default(!1),details:t.unknown().optional()}),zG=t.discriminatedUnion("status",[XI,QI]),ja=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:ka.optional(),visual_tonality:Ta.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()}),ZI=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(),HG=t.object({source:t.object({kind:t.literal("step5_strategy")}).strict()}).strict(),JI=t.object({item_key:Ts,title:t.string().trim().min(1).max(200),selected_option_id:vn,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:ks.optional(),markets:t.array(As).max(32).optional(),promoted_businesses:Ps.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."})}),eT=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(JI).min(Rs).max(Ne),enterprise_keywords:t.array(wn).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."}),Cn.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."})})}),Kp=t.object({tenant_id:t.string().min(1),site_id:k,brief_id:Yt,brief:t.string().min(20).max(1e3),answers:t.array(ja).min(1).max(10),skillSelection:fn,site_default_locale:Re.optional(),owner_locale:Re.optional(),cms_site_id:t.string().min(1).nullish(),intent_pages:t.array(ZI).max(9).optional(),reference:_s.optional(),input_context:t.object({facts:t.array(us).max(120),conflicts:t.array(gs).max(20)}).optional(),business_facts:or.optional(),migration_products_enabled:t.boolean().optional()}),tT=Kp.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:eT}).strict(),$G=t.union([Kp,tT]),zp=t.enum(["planning","generating","validating","ready"]),nT=t.enum(["salvaged","deterministic_fallback"]),sT=t.enum(["model_exception_settled_prefix","model_exception_safe_root"]),Hp={outcome:nT.optional(),reason:sT.optional(),attempts:t.number().int().positive().optional()};function $p(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 iT=t.discriminatedUnion("type",[t.object({type:t.literal("run.started"),runId:$,at:t.string().min(1)}),t.object({type:t.literal("sitemap.generating"),stage:zp,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:ke,sitemap:bn,...Hp,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)})]),VG=iT.superRefine($p),Vp=t.object({id:ke,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 Yp(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 Xp=Vp.extend({sitemap:bn}).superRefine(Yp),Qp=Vp.extend({sitemap:_n}).superRefine(Yp),YG=t.object({sitemap_id:ke,creation_key:t.string().min(1),sitemap:_n,expected_current_sitemap_id:ke,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."})}),XG=t.object({sitemap:Qp}).strict();function QG(e){return`sitemap-user-draft:${e.site_id}:${e.expected_current_sitemap_id}:${e.expected_current_sitemap_version}:${e.sitemap_id}`}var ZG=t.object({sitemap_id:ke,creation_key:t.string().min(1),sitemap:bn,source_agent_run_id:$.optional()}),JG=t.object({sitemap_id:ke,creation_key:t.string().min(1),sitemap:_n,expected_current_sitemap_id:ke,expected_current_sitemap_version:t.number().int().positive(),migration_content_requested:t.boolean().optional()}),eq=t.object({sitemap_id:ke,creation_key:t.string().min(1),sitemap:bn,source_agent_run_id:$}),tq=t.object({site:jt,sitemap:Xp,next_step:t.literal("workspace")}).strict(),nq=t.object({site:jt,sitemap:Qp,next_step:t.literal("workspace")}).strict(),sq=t.object({site:jt,sitemap:Xp,next_step:t.literal("sitemap_review")}).strict(),oT=t.object({id:Wa,tenant_id:t.string().min(1),site_id:k,brief_id:Yt,questions:Aa,answers:t.array(ja),selected_archetype:fn.optional(),completed_at:t.string().min(1).nullable(),created_at:t.string().min(1),updated_at:t.string().min(1)}),iq=t.object({answers:t.array(ja).min(1),questions:Aa,selected_archetype:fn.optional()}),oq=t.object({clarify_session:oT}),aq=t.object({questions:Aa,selected_archetype:fn}),aT=t.object({id:Ri,tenant_id:t.string().min(1),site_id:k,version:t.number().int().positive(),design_plan:qp,source_agent_run_id:$.nullable(),created_at:t.string().min(1),updated_at:t.string().min(1)}),rq=t.object({design_plan_id:Ri.optional(),design_plan:qp,source_agent_run_id:$.optional()}),cq=t.object({design_plan:aT}),Ei=t.enum(["initial_generation","iteration","landing_page","fill_in"]),rT=t.object({label:t.string().min(1).max(48),prompt:t.string().min(1).max(160)}).strict(),cT=t.enum(["model","derived","mixed","advisor"]),Zp=t.object({suggestions:t.array(rT).min(1).max(4),source:cT}).strict(),mT=t.enum(["clean","salvaged","deterministic_fallback","baseline_retained"]),lT=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"]),pT=t.enum(["progress","assistant_final"]),Jp=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"]),dT=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"]),La=t.enum(["style_media","chrome","sections","layout","pages","detect_typecheck","repair","finalize","sitemap_resync","preview"]),Ma=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()}),ve=t.string().min(1).refine(e=>pd(e),{message:"Snapshot file paths must be safe relative POSIX paths without traversal."}),Ua=t.object({deduped_paths:t.array(ve),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(ve)}),Fa=t.object({group_id:t.string().min(1),phase:La,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(ve)}),uT=t.enum(["style","media","chrome","section","layout","page","breadcrumb"]),Ga=t.object({task_id:t.string().min(1),group_id:t.string().min(1),kind:uT,target_path:ve,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(va).optional(),status:Vt,required_reads:t.array(ve).optional(),search_params_sections:t.array(ve).optional(),standard_form_view:ve.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:Gp.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"])}),mq=t.object({plan_id:t.string().min(1),run_kind:Ei,model_route:t.object({planner:t.literal("workspace_planner"),worker:t.literal("workspace")}),groups:t.array(Fa),tasks:t.array(Ga),dependencies:t.array(qa),expected_outputs:t.array(ve),diagnostics:Ua}),lq=t.object({task_id:t.string().min(1),patch:t.unknown().optional(),snapshot_id:I.optional(),read_files:t.array(ve),diagnostics:t.array(Ma),status:Vt}),ed=t.object({worker_count:t.number().int().nonnegative(),task_count:t.number().int().nonnegative(),group_count:t.number().int().nonnegative()}),td=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()}),_T=t.object({type:t.literal("text"),text:t.string(),state:t.enum(["streaming","done"]).optional()}),gT=t.object({type:t.literal("reasoning"),text:t.string(),state:t.enum(["streaming","done"]).optional(),providerMetadata:t.record(t.string(),t.unknown()).optional()}),hT=t.object({type:t.literal("file"),mediaType:t.string().min(1),filename:t.string().min(1).optional(),url:t.string().min(1)}),ST=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()}),fT=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()}),bT=t.object({type:t.string().regex(/^data-[a-zA-Z0-9_-]+$/),id:t.string().min(1).optional(),data:t.unknown()}),yT=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()}),xT=t.object({type:t.literal("error"),errorText:t.string().min(1)}),ET=t.object({type:t.literal("step-start")}),bi=t.union([_T,gT,hT,ST,fT,bT,yT,xT,ET]),RT=t.string().min(1).max(512).refine(e=>pd(e)&&!/^[A-Za-z]:\//.test(e),{message:"Generated-code rescue paths must be safe relative POSIX paths without traversal."}),IT=t.array(RT).min(1).max(64),TT=t.array(t.string().min(1).max(120)).min(1).max(64),kT=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:pT.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(bi).min(1),display_text:t.string().min(1).max(4e3).optional(),in_reply_to_tool_call_id:t.string().min(1).optional(),interaction_response:Ns.optional(),at:t.string().min(1)}),t.object({type:t.literal("plan.updated"),steps:t.array(dT),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(Ap).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:zp,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:ke,sitemap:bn,...Hp,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:ke,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:po.optional(),interaction_failure:lo.optional(),at:t.string().min(1)}),t.object({type:t.literal("workspace.plan.created"),plan_id:t.string().min(1),run_kind:Ei,groups:t.array(Fa),tasks:t.array(Ga),dependencies:t.array(qa),expected_outputs:t.array(ve),diagnostics:Ua,summary:ed,at:t.string().min(1)}).strict(),t.object({type:t.literal("workspace.worker.updated"),group_id:t.string().min(1),phase:La,status:Vt,task_counts:td,target_paths:t.array(ve),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:ve,read_files_count:t.number().int().nonnegative(),diagnostics:t.array(t.string().min(1)),diagnostic_details:t.array(Ma).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:IT.optional(),degraded_page_ids:TT.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:mT,reason:lT,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(),Zp.extend({type:t.literal("workspace.suggestions"),at:t.string().min(1)}).strict(),cr,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:Pp.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:Rn.optional(),build_verified:t.boolean().optional(),generation_ledger:An.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:Lp,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)})]),nd=kT.superRefine($p).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!=="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"})}),Ia=t.object({id:Ka,tenant_id:t.string().min(1),site_id:k,agent_run_id:$,sequence:t.number().int().positive(),event_type:Jp,payload:nd,created_at:t.string().min(1),thread_id:st.nullable().optional()}),pq=t.object({event_type:Jp,payload:nd}).superRefine((e,n)=>{e.event_type!==e.payload.type&&n.addIssue({code:"custom",path:["payload","type"],message:"payload.type must match event_type"}),as(e.payload)&&n.addIssue({code:"custom",path:["payload"],message:"AgentEvent payload must not contain secrets"})}),dq=t.discriminatedUnion("status",[t.object({status:t.literal("appended"),agent_run:nt,event:Ia,next_cursor:t.number().int().nonnegative()}),t.object({status:t.literal("duplicate_ignored"),agent_run:nt,event:Ia,next_cursor:t.number().int().nonnegative()})]),uq=t.object({events:t.array(Ia),next_cursor:t.number().int().nonnegative().optional()}),_q=t.object({after_sequence:t.coerce.number().int().nonnegative().default(0)}),gq=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"})}),hq=t.enum(["implemented","skeleton","planned"]),Sq=t.enum(["GET","POST","PUT","PATCH","DELETE"]),fq=[{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"}],bq=[{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"]}],AT=t.object({id:t.string().min(1),role:t.enum(["system","user","assistant"]),metadata:t.unknown().optional(),parts:t.array(bi).min(1)}),sd=AT.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;_o.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"||go(a.url)===null)&&n.addIssue({code:"custom",path:["parts",i,"url"],message:"Attachment url must be a workspace attachment image path"})}s>uo&&n.addIssue({code:"custom",path:["parts"],message:`A message may carry at most ${uo} attachments`})}),yq=t.object({base_snapshot_id:I.optional(),intent:t.literal("navigation_adaptation").optional(),message:sd.optional(),thread_id:st.optional(),client_run_key:t.string().min(1).max(200).optional()}).superRefine((e,n)=>{as(e.message)&&n.addIssue({code:"custom",path:["message"],message:"Workspace startup message must not contain secrets",params:{errorCode:"WORKSPACE_MESSAGE_CONTAINS_SECRET"}})}),PT=t.object({path:t.string().regex(/^\/v1\/workspace\/sites\/[^/]+\/socket$/),run_id:$,base_snapshot_id:I,run_kind:Ei}),xq=t.object({agent_run:nt,websocket:PT,next_step:t.literal("workspace_socket")}),Eq=t.object({agent_run:nt}),Rq=t.object({thread_id:st.optional()}),Iq=t.object({agent_run:nt.nullable(),thread:yi.nullable()}),Tq=t.object({status:Dp.default("active")}),kq=t.object({threads:t.array(yi)}),Aq=t.object({title:t.string().trim().min(1).max(200)}).strict(),Pq=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"}),wq=t.object({thread:yi}),Cq=t.object({agent_type:t.enum(["clarify","sitemap","workspace"]),thread_id:st.optional()}),vq=t.object({agent_run:nt}),Dq=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)}),wT=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()}),CT=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:Fn.optional(),interaction_response:Ns.optional(),selected_component:wT.optional(),intent:t.literal("navigation_adaptation").optional(),display_text:t.string().min(1).max(4e3).optional(),message:sd,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()})}),Rc]),vT=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(bi).min(1),display_text:t.string().min(1).max(4e3).optional(),in_reply_to_tool_call_id:t.string().min(1).optional(),interaction_response:Ns.optional()})}),pe.extend({type:t.literal("server.assistant.delta"),payload:t.object({message_id:t.string().min(1),parts:t.array(bi).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:po.optional(),interaction_failure:lo.optional()})}),pe.extend({type:t.literal("server.workspace.suggestions"),payload:Zp.extend({run_id:$}).strict()}),pe.extend({type:t.literal("workspace.plan.created"),payload:t.object({plan_id:t.string().min(1),run_kind:Ei,groups:t.array(Fa),tasks:t.array(Ga),dependencies:t.array(qa),expected_outputs:t.array(ve),diagnostics:Ua,summary:ed})}),pe.extend({type:t.literal("workspace.worker.updated"),payload:t.object({group_id:t.string().min(1),phase:La,status:Vt,task_counts:td,target_paths:t.array(ve),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:ve,read_files_count:t.number().int().nonnegative(),diagnostics:t.array(t.string().min(1)),diagnostic_details:t.array(Ma).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:ke,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:Rn.optional(),build_verified:t.boolean().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:Lp,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()})})]),DT=vT.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"})}),Oq=t.union([CT,DT]),Nq={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."]},id=t.string().regex(/^sha256:[a-f0-9]{64}$/),OT=t.enum(["create","update","delete","str_replace"]),od=t.enum(["sitemap_resync","smoke_test","prepare_preview"]),NT=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(),jT=t.object({path:ve,operation:OT,expected_hash:id.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(NT).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($T(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"})}),LT=t.object({kind:t.enum(["block","page","site","chrome"]),id:t.string().min(1).max(120)}),MT=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:LT,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)}),ad=t.object({site_id:k,base_snapshot_id:I,reason:t.string().min(1),patches:t.array(jT).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(MT).max(24).optional(),post_actions:t.array(od).optional()});function rd(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 jq=ad.superRefine(rd),Lq=ad.omit({base_snapshot_id:!0}).extend({site_id:k.optional()}).superRefine(rd),UT=Ee,FT=t.object({path:UT,operation:t.enum(["upsert","delete"]).optional()}),cd=t.enum(["sync_cms_pages","sync_cms_navigation"]),Mq=t.object({files:t.array(FT).min(1),post_actions:t.array(cd).optional()}).strict().overwrite(e=>e.post_actions?{...e,post_actions:[...new Set(e.post_actions)]}:e),GT=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"]),qT=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:id,object_key:t.string().min(1),changed_files:t.array(ve).min(1),post_actions_queued:t.array(od),dropped_protected_files:t.array(t.string().min(1)).min(1).optional()}),WT=t.object({status:t.literal("failed"),code:GT,message:t.string().min(1),retryable:t.boolean().default(!1),details:t.unknown().optional()}),Uq=t.discriminatedUnion("status",[qT,WT]),Fq=t.object({ok:t.literal(!0),post_actions:t.array(t.object({action:cd,status:t.enum(["succeeded","failed"])}).strict()).default([])}),md=Ee,BT=t.enum(["text","binary"]),ld=t.object({path:md,kind:BT,language:t.string().min(1).nullable(),size_bytes:t.number().int().nonnegative()}),Gq=t.object({path:md}),KT=ld.extend({kind:t.literal("text"),language:t.string().min(1),content:t.string()}),zT=ld.extend({kind:t.literal("binary"),language:t.null(),mime_type:t.string().min(1),content_base64:t.string().min(1)}),qq=t.union([KT,zT]);function as(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=>as(n)):Object.entries(e).some(([n,s])=>HT(n)||as(s))}function HT(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 pd(e){let n=e.split("/");return e.length>0&&!e.startsWith("/")&&!e.includes("\\")&&n.every(s=>s!==""&&s!=="."&&s!=="..")}function $T(e){if(/^(?:src\/)?app\/\.vcp\//.test(e))return ls(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)||Nn.test(`/${a}`))}var dd=t.enum(["idle","creating","restoring_snapshot","installing_dependencies","starting_preview","ready","active","stopping","stopped","failed"]),VT=t.object({id:rs,tenant_id:t.string().min(1),site_id:k,sandbox_id:t.string().min(1).nullable(),status:dd,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)}),Wq=t.object({session_id:rs.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:rs.optional(),expected_ready_session_last_snapshot_id:I.optional(),status:dd,preview_url:t.string().url().optional(),launch_id:t.string().min(1).optional()}),Bq=t.object({preview_session:VT,next_step:t.literal("preview")}),Kq=t.object({failed_count:t.number().int().nonnegative()}),zq=t.object({site_id:k}),Hq=t.object({status:t.enum(["cancelled","stop_requested","no_active_run"]),agent_run:nt.nullable()});export{Um as AESTHETIC_NOTE_MAX_LENGTH,xa as AI_IMAGE_GENERATION_MAX_QUANTITY,ty as APPLICATION_LIBRARY_ERROR_CODES,tG as AbandonSiteSnapshotResponseSchema,AE as ActiveSiteDomainDataSchema,Iq as ActiveWorkspaceRunResponseSchema,Lp as ActivityKindSchema,Nt as ActivityTitleCodeSchema,mP as AdvanceSiteWorkflowRequestSchema,Pp as AgentErrorCategorySchema,Ka as AgentEventIdSchema,Ia as AgentEventRecordSchema,nd as AgentEventSchema,Jp as AgentEventTypeSchema,pT as AgentMessageHistoryPurposeSchema,vp as AgentModelRouteSchema,dT as AgentPlanStepSchema,VF as AgentRunContextResponseSchema,$ as AgentRunIdSchema,Cp as AgentRunKindSchema,nt as AgentRunRecordSchema,iI as AgentRunStatusSchema,wp as AgentRunTypeSchema,st as AgentThreadIdSchema,oI as AgentThreadKindSchema,aI as AgentThreadOriginSchema,yi as AgentThreadRecordSchema,Dp as AgentThreadStatusSchema,bT as AiSdkUiDataPartSchema,xT as AiSdkUiErrorPartSchema,hT as AiSdkUiFilePartSchema,bi as AiSdkUiMessagePartSchema,AT as AiSdkUiMessageSchema,gT as AiSdkUiReasoningPartSchema,fT as AiSdkUiSourceDocumentPartSchema,ST as AiSdkUiSourceUrlPartSchema,ET as AiSdkUiStepStartPartSchema,_T as AiSdkUiTextPartSchema,yT as AiSdkUiToolPartSchema,hq as ApiContractStatusSchema,_I as ApiErrorEnvelopeSchema,M as ApiResponseSchema,pq as AppendAgentEventRequestSchema,dq as AppendAgentEventResponseSchema,nj as ApplicationCreateResponseSchema,ay as ApplicationLibraryApplicationSchema,sj as ApplicationLibraryApplicationsDataSchema,zm as ApplicationLibraryErrorCodeSchema,oj as ApplicationLibraryErrorResponseSchema,ij as ApplicationLibraryTemplatesDataSchema,$m as ApplicationTemplateCatalogDataSchema,ny as ApplicationTemplateCatalogItemSchema,ey as ApplicationTemplateConsumeDataSchema,tj as ApplicationTemplateCreateRequestSchema,iy as ApplicationTemplateCreateResponseSchema,sy as ApplicationTemplateCreatedApplicationSchema,ei as ApplicationTemplateDigestSchema,Yb as ApplicationTemplateFieldSchema,Jb as ApplicationTemplateReferenceSchema,oy as ApplicationTemplateSourceSchema,ti as ApplicationTemplateStableKeySchema,Yo as ApplicationTemplateV1Schema,GT as ApplyPatchBatchErrorCodeSchema,WT as ApplyPatchBatchFailureSchema,jq as ApplyPatchBatchInputSchema,jT as ApplyPatchBatchPatchSchema,od as ApplyPatchBatchPostActionSchema,Uq as ApplyPatchBatchResultSchema,qT as ApplyPatchBatchSuccessSchema,Lq as ApplyPatchBatchToolInputSchema,NT as ApplyPatchEditSchema,OT as ApplyPatchOperationSchema,Ap as ArchetypeProposalSchema,mk as AuditLogIdSchema,QT as AuthIdentityIdSchema,tk as AuthLoginCodeIdSchema,ek as AuthOidcStateIdSchema,ZT as AuthSessionIdSchema,JT as AuthTokenIdSchema,nk as AuthWsTicketIdSchema,cx as BINDING_STATUSES,Mp as BlockGenerationContextSchema,ds as BlockInteractionSchema,OG as BlockMediaIntentSchema,Da as BlockSchema,MS as BlockingSubsiteSchema,Up as BrandingSchema,Yt as BriefIdSchema,wa as BriefRecordSchema,or as BusinessFactsSchema,xD as CHAT_COPY,yD as CLARIFICATION_COPY,Ny as CMS_FORM_FIELD_TYPES,km as CMS_MAIN_PRODUCTS_MAX_LENGTH,Hu as CMS_PAGE_DIRECTORY_MAX_DEPTH,zu as CMS_PAGE_DIRECTORY_MAX_NODES,Ku as CMS_PAGE_URL_MAX_LENGTH,Nr as CMS_PAGE_URL_PATH_MAX_LENGTH,GC as COMPONENT_I18N_FILE_SUFFIX,qs as COMPONENT_I18N_NAMESPACE,Pd as CONVERSION_CTA_LABEL_MAX_LENGTH,Ax as CRAWLER_INTERNAL_ERROR_CODES,xm as CURRENT_EDIT_ENGINE_VERSION,zq as CancelActiveWorkspaceRunRequestSchema,Hq as CancelActiveWorkspaceRunResponseSchema,EA as CheckDesignerPageProjectionRequestSchema,RA as CheckDesignerPageProjectionResponseSchema,o_ as CheckDesignerPageProjectionResultSchema,Wl as CheckSitePublishDomainDataSchema,bE as CheckSitePublishDomainRequestSchema,yE as CheckSitePublishDomainResponseSchema,Fp as ChromeDesignSchema,AI as ChromeFooterDesignSchema,kI as ChromeFooterShellSchema,II as ChromeHeaderDesignSchema,RI as ChromeHeaderShellSchema,PI as ChromeMobileNavDesignSchema,OC as ClaimStaleWorkspaceRunsResponseSchema,nI as ClarifyQuestionOptionSchema,sI as ClarifyQuestionSchema,JR as ClarifyQuestionTypeSchema,Aa as ClarifyQuestionsSchema,bF as ClarifyRunInputSchema,Wa as ClarifySessionIdSchema,oT as ClarifySessionRecordSchema,yF as ClarifyStreamEventSchema,dj as CmsApplicationCoreInputSchema,uj as CmsApplicationCoreResultSchema,_j as CmsApplicationSeedInputSchema,gj as CmsApplicationSeedResultSchema,lk as CmsCollectionBindingIdSchema,uL as CmsCollectionBindingSchema,al as CmsFormSchemaProjectionSchema,Hi as CmsManagedPageTypeSchema,qU as CmsNavigationActionSchema,GU as CmsNavigationCapabilitiesResponseSchema,$R as CmsNavigationCapabilitiesSchema,bp as CmsNavigationCreateGroupBodySchema,KR as CmsNavigationCreateItemBodySchema,FU as CmsNavigationDefaultGroupBodySchema,WR as CmsNavigationEditorContextSchema,UU as CmsNavigationEditorResponseSchema,qR as CmsNavigationGroupSchema,fp as CmsNavigationItemSchema,HR as CmsNavigationMoveItemBodySchema,BR as CmsNavigationPatchGroupBodySchema,zR as CmsNavigationPatchItemBodySchema,gp as CmsNavigationTargetTypeSchema,Yu as CmsPageDirectoryGroupSchema,Lr as CmsPageDirectoryNodeSchema,Dr as CmsPageDirectorySchema,$i as CmsPageTypeSchema,qt as CmsPageUrlPathSchema,PA as CmsSeoSyncStateSchema,bs as CmsSiteIdSchema,Ix as CompanyInfoSchema,CL as CompanyInfoTaskCreateRequestSchema,vL as CompanyInfoTaskCreateResponseSchema,DL as CompanyInfoTaskResponseSchema,lN as CompleteCustomerMaterialsRequestSchema,pN as CompleteDiagnosisRequestSchema,pP as CompleteQualityOnlyWorkflowRequestSchema,sG as CompleteSiteSnapshotDeletionResponseSchema,lP as CompleteSiteWorkflowRequestSchema,dN as CompleteStrategyRequestSchema,mN as CompleteWebsiteScanRequestSchema,WC as ComponentI18nResourcesSchema,GA as ComposeDesignerPageResourceBodySchema,Sk as ComputeSnapshotEditChangesRequestSchema,fk as ComputeSnapshotEditChangesResponseSchema,EE as ConfirmSitePublishDomainRemediationDataSchema,xE as ConfirmSitePublishDomainRemediationRequestSchema,RE as ConfirmSitePublishDomainRemediationResponseSchema,JG as ConfirmSiteStructureRequestSchema,QN as ConnectDynamicCollectionInputSchema,Rj as ConnectFormInputSchema,Mt as ConversionHintsSchema,Px as CrawlerInternalErrorCodeSchema,OL as CrawlerInternalErrorSchema,un as CrawlerTaskCodeSchema,xL as CrawlerTaskCreateRequestSchema,IL as CrawlerTaskCreateResponseSchema,hx as CrawlerTaskFailureErrorCodeSchema,xl as CrawlerTaskFailureStageSchema,fx as CrawlerTaskPageSchema,EL as CrawlerTaskPagesQuerySchema,AL as CrawlerTaskPagesResponseSchema,kL as CrawlerTaskStatusResponseSchema,Ht as CrawlerTaskUuidSchema,vG as CreateAgentRunConflictResponseSchema,YF as CreateAgentRunRequestSchema,XF as CreateAgentRunResponseSchema,EG as CreateDeploymentRequestSchema,lI as CreateDeploymentResponseSchema,t0 as CreateDocumentUploadRequestSchema,gk as CreateExternalSiteEditRequestSchema,bk as CreateExternalSiteEditResponseSchema,r0 as CreateImageUploadRequestSchema,Xk as CreateInputSourceRequestSchema,RG as CreateQualityCheckDeploymentRequestSchema,PF as CreateSiteBriefRequestSchema,KF as CreateSiteBriefResponseSchema,wF as CreateSiteDraftRequestSchema,AF as CreateSiteInputSchema,Aq as CreateSiteThreadRequestSchema,rP as CreateSiteWorkflowRequestSchema,Ud as CreateTextInputSourceRequestSchema,Fd as CreateUrlInputSourceRequestSchema,TG as CurrentDeploymentResponseSchema,sN as CustomerMaterialsDraftResponseSchema,Fo as CustomerMaterialsDraftSchema,iN as CustomerMaterialsNullableResponseSchema,Go as CustomerMaterialsRecordSchema,nN as CustomerMaterialsResponseSchema,vb as CustomerMaterialsStatusSchema,$h as DEFAULT_FONTS,vm as DEFAULT_SITE_DESIGN_RADIUS_ID,gu as DEFAULT_SITE_LOCALE,DD as DEFAULT_SUBSITE_PALETTE,Us as DEFAULT_WEIGHT_STYLE_ID,Iw as DEPLOYMENT_ACTIVE_STATUSES,kt as DEPLOYMENT_LIFECYCLE_TRANSITIONS,sh as DEPLOYMENT_PROGRESS_STEP_CODES,uI as DEPLOYMENT_REALTIME_CHANNEL,Xt as DEPLOYMENT_STATUSES,Tw as DEPLOYMENT_TERMINAL_STATUSES,qh as DEPLOYMENT_TRANSITION_ERROR_CODE,CG as DEPLOYMENT_WEBSOCKET_CONTRACT,rA as DESIGNER_COMPONENT_LIBRARY_ERROR_CODES,jA as DESIGNER_PAGE_LIBRARY_ERROR_CODES,Qk as DOCUMENT_EXTENSION_WHITELIST,Zk as DOCUMENT_MIME_WHITELIST,Yx as DOMAIN_DNS_PURPOSES,Zx as DOMAIN_DNS_REMEDIATION_STATUSES,Xx as DOMAIN_DNS_VERIFICATION_STATUSES,zx as DOMAIN_OBSERVED_STATUSES,$x as DOMAIN_ROUTING_MODES,IA as DeleteDesignerPageErrorDetailsSchema,fA as DeleteDesignerPageRequestSchema,bA as DeleteDesignerPageResponseSchema,s_ as DeleteDesignerPageResultSchema,nG as DeleteSiteSnapshotResponseSchema,lt as DeploymentIdSchema,sk as DeploymentJobIdSchema,ih as DeploymentProgressStepCodeSchema,ah as DeploymentProgressStepSchema,oh as DeploymentProgressStepStatusSchema,Mc as DeploymentProgressStepsSchema,Ot as DeploymentRecordSchema,wG as DeploymentRedisPubSubEventSchema,Ca as DeploymentStatusSchema,Rp as DeploymentStatusSummarySchema,xo as DeploymentTransitionError,Np as DeploymentTypeSchema,Si as DeploymentWsDeploymentPayloadSchema,PG as DeploymentWsServerMessageSchema,dI as DeploymentWsServerMessageTypeSchema,mT as DesignPlanGenerationOutcomeSchema,lT as DesignPlanGenerationReasonSchema,Ri as DesignPlanIdSchema,LG as DesignPlanPatchSchema,aT as DesignPlanRecordSchema,qp as DesignPlanSchema,Fe as DesignTokenBlockError,DG as DesignTokensSchema,Bu as DesignerComponentCatalogItemSchema,Pr as DesignerComponentCategoriesDataSchema,Ar as DesignerComponentCategoryNodeSchema,Gt as DesignerComponentExactVersionSchema,Cr as DesignerComponentInstallDataSchema,wr as DesignerComponentsDataSchema,l_ as DesignerPageCatalogItemSchema,Kr as DesignerPageCategoriesDataSchema,Br as DesignerPageCategoryNodeSchema,e_ as DesignerPageDeleteBlockReasonSchema,Ju as DesignerPageDisabledReasonSchema,On as DesignerPageExactVersionSchema,Gr as DesignerPageGroupSchema,Hr as DesignerPageInstallDataSchema,Fr as DesignerPageNodeSchema,Vr as DesignerPageResourcePreparationDataSchema,m_ as DesignerPageResourceSourceSchema,S_ as DesignerPageResourceTemplateSchema,Wt as DesignerPageResourceTypeSchema,zr as DesignerPagesDataSchema,qi as DesignerResourceVersionSchema,Yr as DesignerSitePagesDataSchema,MA as DesignerSiteRouteIdSchema,Ml as DomainConfigurationSchema,pa as DomainDnsPurposeSchema,iE as DomainDnsRecordSchema,sE as DomainDnsRemediationChangeSchema,Nl as DomainDnsRemediationRecordSchema,jl as DomainDnsRemediationResultSchema,Jx as DomainDnsRemediationStatusSchema,nE as DomainDnsVerificationObservationSchema,Ol as DomainDnsVerificationResultSchema,Qx as DomainDnsVerificationStatusSchema,Hx as DomainObservedStatusSchema,tE as DomainOperationErrorSchema,di as DomainOperationSchema,eE as DomainOperationStatusSchema,da as DomainOperationTypeSchema,Ll as DomainRecordSchema,Vx as DomainRoutingModeSchema,RD as EDIT_ENGINE_VERSION_HEADER,ID as EDIT_ENGINE_VERSION_SOURCE_HEADER,hk as EMPTY_EXTERNAL_SITE_EDIT_CHANGES,SD as ERROR_COPY,hd as EXTERNAL_SITE_EDIT_INFRASTRUCTURE_REASONS,gd as EXTERNAL_SITE_EDIT_PROMPT_MAX_LENGTH,Mo as EditEngineVersionParseError,Xr as EnhanceDesignerPageResourceBodySchema,WF as EnhanceDesignerPageResourceResponseSchema,Ek as ExternalSiteEditCallbackAckSchema,xk as ExternalSiteEditCallbackPayloadSchema,Sd as ExternalSiteEditCallbackStatusSchema,Ti as ExternalSiteEditChangeKindSchema,Qa as ExternalSiteEditChangesSchema,Rn as ExternalSiteEditDegradedReasonSchema,Lt as ExternalSiteEditExternalIdSchema,$a as ExternalSiteEditOutcomeSchema,kd as ExternalSiteEditPageChangeSchema,bd as ExternalSiteEditPageTypeSchema,Td as ExternalSiteEditSectionChangeSchema,xd as ExternalSiteEditSiteWideChangeSchema,yd as ExternalSiteEditSiteWideKindSchema,Ha as ExternalSiteEditTaskIdSchema,ms as ExternalSiteEditTaskSchema,fd as ExternalSiteEditTaskStatusSchema,OF as ExternalSyncSiteRequestSchema,BF as ExternalSyncSiteResponseSchema,jd as ExtractedFactKindSchema,us as ExtractedFactSchema,Vo as FIELD_TYPES,TC as FILL_IN_NOT_AVAILABLE_ERROR_CODE,AC as FILL_IN_TARGET_MODIFIED_ERROR_CODE,kC as FILL_IN_TARGET_NOT_OMITTED_ERROR_CODE,Xc as FONT_PAIRINGS,Io as FONT_PAIRING_IDS,Hy as FORM_DESIGN_ERROR_CODES,zy as FORM_DESIGN_FAILURE_STAGES,By as FORM_DESIGN_OPERATION_STAGES,Ky as FORM_DESIGN_OPERATION_STATUSES,si as FORM_FIELD_TYPES,Qm as FORM_SCENE_CODES,Zm as FORM_SCENE_UNKNOWN,py as FORM_SHAPE_EMBEDDED,jy as FORM_SPEC_FIELD_TYPE_TO_CMS,el as FORM_SPEC_FILE_MIN_RUNTIME_VERSION,ky as FORM_SPEC_LOCALIZABLE_FIELD_PATHS,Jm as FORM_SPEC_MULTISTEP_MIN_RUNTIME_VERSION,jj as FORM_TEMPLATE_CATEGORY_COUNTS,Nj as FORM_TEMPLATE_CATEGORY_SLUGS,Kq as FailStaleInFlightWorkspaceRunsResponseSchema,Js as FieldDeclSchema,mm as FillInTargetSchema,BL as FirecrawlBatchCreateRequestSchema,KL as FirecrawlBatchCreatedResponseSchema,vx as FirecrawlBatchErrorSchema,HL as FirecrawlBatchErrorsResponseSchema,Cx as FirecrawlBatchPageSchema,zL as FirecrawlBatchStatusResponseSchema,UL as FirecrawlCrawlCreateRequestSchema,FL as FirecrawlCrawlCreatedResponseSchema,GL as FirecrawlCrawlStatusResponseSchema,kl as FirecrawlJobStatusSchema,LL as FirecrawlMapRequestSchema,ML as FirecrawlMapResponseSchema,$L as FirecrawlQueueStatusResponseSchema,qL as FirecrawlScrapeRequestSchema,WL as FirecrawlScrapeResponseSchema,TI as FooterShellSurfaceSchema,hy as FormBlockIdSchema,oi as FormDefinitionIdSchema,Gy as FormDesignAffectedFilesSchema,ca as FormDesignErrorCodeSchema,Hj as FormDesignErrorSchema,ml as FormDesignFailureStageSchema,de as FormDesignHashSchema,Fj as FormDesignOpenResponseSchema,qy as FormDesignOperationFingerprintInputSchema,na as FormDesignOperationIdSchema,ll as FormDesignOperationNextActionSchema,ok as FormDesignOperationRecordIdSchema,Kj as FormDesignOperationRecordSchema,ma as FormDesignOperationResponseSchema,dl as FormDesignOperationSchema,ra as FormDesignOperationStageSchema,cl as FormDesignOperationStatusSchema,zj as FormDesignOperationTransitionRequestSchema,pl as FormDesignPreviewRefreshStatusSchema,qj as FormDesignQueryResponseSchema,Wj as FormDesignResumeRequestSchema,Bj as FormDesignResumeResponseSchema,Wy as FormDesignSaveRequestSchema,Gj as FormDesignSaveResponseSchema,rl as FormDesignSharedImpactSchema,aa as FormDesignStandardizationSchema,_y as FormFieldDeclSchema,ns as FormFieldNameSchema,Jo as FormMetadataSchema,sa as FormOptionValueSchema,Zo as FormSceneSchema,dy as FormShapeSchema,Sy as FormSpecBindingSchema,by as FormSpecFieldNodeSchema,xy as FormSpecNodeSchema,fy as FormSpecOptionSchema,yy as FormSpecStepBreakNodeSchema,oa as FormSpecV1Schema,Lj as FormTemplateCatalogResponseSchema,ol as FormTemplateCategorySlugSchema,Dy as FormTemplateCategoryV1Schema,vt as FormTemplateTextSchema,Oy as FormTemplateV1Schema,LE as GA4_AUTHORIZATION_STATUSES,UE as GA4_AUTH_ATTEMPT_STATUSES,KE as GA4_BINDING_REASONS,GE as GA4_BINDING_STATUSES,WE as GA4_VERIFICATION_STATUSES,Bn as GLOBAL_DESIGN_TOKENS_END,rn as GLOBAL_DESIGN_TOKENS_START,PE as GSC_AUTH_STATUSES,wE as GSC_BINDING_STATUSES,CE as GSC_PROPERTY_TYPES,eR as Ga4AccountOptionSchema,$l as Ga4AuthAttemptSchema,FE as Ga4AuthAttemptStatusSchema,$E as Ga4AuthorizationSchema,ME as Ga4AuthorizationStatusSchema,zE as Ga4BindingReasonSchema,VE as Ga4BindingSchema,qE as Ga4BindingStatusSchema,nR as Ga4DataStreamOptionSchema,sR as Ga4DataStreamsDataSchema,SU as Ga4DataStreamsQuerySchema,hU as Ga4DataStreamsResponseSchema,ZE as Ga4DeploymentSchema,XE as Ga4ModeSchema,iR as Ga4MutationSchema,JE as Ga4PropertyOptionSchema,tR as Ga4SetupResourcesDataSchema,gU as Ga4SetupResourcesQuerySchema,_U as Ga4SetupResourcesResponseSchema,Vl as Ga4StatusDataSchema,uU as Ga4StatusQuerySchema,dU as Ga4StatusResponseSchema,QE as Ga4TrackingSchema,YE as Ga4VerificationSchema,BE as Ga4VerificationStatusSchema,AR as GenerateAiImagesRequestSchema,PR as GenerateAiImagesResponseSchema,dp as GeneratedAiImageResultSchema,jM as GetActiveSiteDomainResponseSchema,kG as GetDeploymentResponseSchema,pI as GetDeploymentsStatusResponseSchema,yk as GetExternalSiteEditResponseSchema,NM as GetSiteDomainConfigurationResponseSchema,CO as GetSiteLauncherPermissionResponseSchema,ua as GetSitePublishDomainOperationDataSchema,IE as GetSitePublishDomainOperationResponseSchema,_O as GetTemplateUpgradeReportQuerySchema,gO as GetTemplateUpgradeReportResponseSchema,nU as GoogleSearchConsoleAuthStartDataSchema,tU as GoogleSearchConsoleAuthStartRequestSchema,sU as GoogleSearchConsoleAuthStartResponseSchema,QM as GoogleSearchConsoleAuthStatusSchema,ZM as GoogleSearchConsoleBindingStatusSchema,JM as GoogleSearchConsolePropertyTypeSchema,eU as GoogleSearchConsoleStateSchema,oU as GoogleSearchConsoleStatusDataSchema,iU as GoogleSearchConsoleStatusInputSchema,aU as GoogleSearchConsoleStatusResponseSchema,VM as GscAuthStartDataSchema,$M as GscAuthStartRequestSchema,YM as GscAuthStartResponseSchema,_a as GscAuthStatusSchema,ga as GscBindingStatusSchema,ha as GscPropertyTypeSchema,DE as GscStateInputSchema,XM as GscStateSchema,zl as GscStatusDataSchema,OE as GscStatusResponseSchema,Or as HOME_PAGE_URL_PATH,xI as HeaderShellBehaviorSchema,EI as HeaderShellShapeSchema,yI as HeaderShellSurfaceSchema,bI as HeaderShellVariantSchema,lx as HomeUrlCrawlerTaskCreateRequestSchema,io as HttpUrlSchema,s0 as IMAGE_EXTENSION_WHITELIST,i0 as IMAGE_MIME_WHITELIST,kr as INSERT_NEW_COMPONENT_CATEGORY_GROUP_KEY,Wr as INSERT_NEW_PAGE_CATEGORY_GROUP_KEY,_C as INTERNAL_RUN_LEASE_OWNER_HEADER,hu as ISO_639_3_TO_SITE_LOCALE,Gd as ImageRoleSchema,sd as InboundUserMessageSchema,qN as IndustryClassificationRequestSchema,WN as IndustryClassificationResultSchema,Kb as IndustryConfidenceSchema,Hm as InitializationResultSchema,Nd as InputBundleStatusSchema,gs as InputConflictSchema,c0 as InputContextBundleSchema,En as InputContextSourceIdSchema,Md as InputSourceSchema,Ai as InputSourceStatusSchema,ki as InputSourceTypeSchema,nO as InspectTemplateUpgradeStateRequestSchema,sO as InspectTemplateUpgradeStateResponseSchema,pA as InstallDesignerComponentBodySchema,LF as InstallDesignerComponentResponseSchema,UA as InstallDesignerPageBodySchema,FF as InstallDesignerPageResponseSchema,IG as InternalCreateDeploymentResponseSchema,fG as InternalEnsureSubsitePublishRequestSchema,bG as InternalEnsureSubsitePublishResponseSchema,Q as InternalEntityIdSchema,AG as InternalGetDeploymentsStatusResponseSchema,yG as InternalGetSubsitePublishStatusRequestSchema,xG as InternalGetSubsitePublishStatusResponseSchema,hG as InternalPrepareSubsitePreviewRequestSchema,SG as InternalPrepareSubsitePreviewResponseSchema,Pb as KNOWLEDGE_CATEGORY_CODES,Am as KnowledgeCategoryCodeSchema,XO as KnowledgeContextReadinessSchema,Cb as KnowledgeSourceReadinessSchema,Pm as KnowledgeSourceReadinessStatusSchema,VO as KnowledgeTaskStatusBatchSchema,wb as KnowledgeTaskStatusSchema,Pl as LEGACY_FILE_MUTATION_TOOL_NAME,lu as LEGACY_SITE_LOCALE_CODES,Cq as LatestAgentRunQuerySchema,vq as LatestAgentRunResponseSchema,Rq as LatestWorkspaceRunQuerySchema,Eq as LatestWorkspaceRunResponseSchema,sM as LauncherPromptTemplateApplyRequestSchema,iM as LauncherPromptTemplateApplyResponseSchema,Ux as LauncherPromptTemplateCatalogItemSchema,tM as LauncherPromptTemplateCatalogQuerySchema,nM as LauncherPromptTemplateCatalogSchema,Lx as LauncherPromptTemplateKindSchema,Mx as LauncherPromptTemplateLocaleSchema,pi as LauncherPromptTemplateTypeSchema,bb as LauncherScopeSchema,_q as ListAgentEventsQuerySchema,uq as ListAgentEventsResponseSchema,NF as ListDesignerComponentCategoriesResponseSchema,lA as ListDesignerComponentsQuerySchema,jF as ListDesignerComponentsResponseSchema,MF as ListDesignerPageCategoriesResponseSchema,LA as ListDesignerPagesQuerySchema,UF as ListDesignerPagesResponseSchema,qF as ListDesignerSitePagesResponseSchema,IR as ListMediaLibraryAssetsQuerySchema,TR as ListMediaLibraryAssetsResponseSchema,gq as ListSiteAgentEventsQuerySchema,uG as ListSiteVersionsResponseSchema,hO as ListTemplateUpgradeSnapshotDeletionCandidatesQuerySchema,SO as ListTemplateUpgradeSnapshotDeletionCandidatesResponseSchema,vC as ListWorkspacePageCheckpointsResponseSchema,e0 as MAX_DOCUMENT_SOURCES_PER_SITE,Jk as MAX_DOCUMENT_UPLOAD_BYTES,a0 as MAX_IMAGE_SOURCES_PER_SITE,o0 as MAX_IMAGE_UPLOAD_BYTES,SR as MAX_NAV_LABEL_WIDTH,Bf as MAX_SUBSITE_MEDIA_REPLACEMENTS,wP as MAX_UNBOUND_WORKSPACE_ATTACHMENTS_PER_SITE,uo as MAX_WORKSPACE_ATTACHMENTS_PER_MESSAGE,LP as MAX_WORKSPACE_URL_CAPTURES_PER_SITE_HOUR,ip as MEDIA_LIBRARY_AUDIO_EXTENSIONS,mp as MEDIA_LIBRARY_AUDIO_MIME_TYPES,op as MEDIA_LIBRARY_DOCUMENT_EXTENSIONS,ER as MEDIA_LIBRARY_EXTENSIONS,ap as MEDIA_LIBRARY_FILE_EXTENSIONS,np as MEDIA_LIBRARY_IMAGE_EXTENSIONS,xR as MEDIA_LIBRARY_IMAGE_MAX_BYTES,rp as MEDIA_LIBRARY_IMAGE_MIME_TYPES,tp as MEDIA_LIBRARY_MAX_BYTES,RR as MEDIA_LIBRARY_MIME_TYPES,sp as MEDIA_LIBRARY_VIDEO_EXTENSIONS,cp as MEDIA_LIBRARY_VIDEO_MIME_TYPES,zC as MIGRATION_PRODUCTS_CMS_DETAIL_PAGE_TITLE,KC as MIGRATION_PRODUCTS_DETAIL_PREFIX,VC as MIGRATION_PRODUCTS_DETAIL_VIEW_VARIANT,$C as MIGRATION_PRODUCTS_LIST_VIEW_VARIANT,CS as MIGRATION_PRODUCTS_ROUTE,St as MIGRATION_PRODUCTS_SLUG,HC as MIGRATION_PRODUCTS_VIEW_BLOCK_TYPE,uy as MODEL_DECLARABLE_FORM_FIELD_TYPES,Al as MODEL_FILE_MUTATION_TOOL_NAMES,Db as MOTION_PRESETS,Wo as MOTION_PRESET_IDS,jG as MediaAssetSchema,SI as MediaAttributionSchema,ya as MediaLibraryAssetSchema,lp as MediaLibraryFileTypeSchema,pp as MediaLibrarySourceSchema,LT as MediaRequestOwnerSchema,ck as MediaResolutionCacheIdSchema,YR as MigrationCollectionProgressSchema,Ea as MigrationCollectionSchema,KU as MigrationContentProgressSchema,VR as MigrationReasonCodeSchema,QR as MigrationRedirectProgressSchema,XR as MigrationRedirectReasonCodeSchema,xp as MigrationRedirectSiteReasonSchema,mA as MockDesignerComponentInsertDataSchema,cA as MockDesignerComponentInsertRequestSchema,ka as MotionLevelSchema,ex as NAV_ITEMS_LOCALIZABLE_FIELD_PATHS,tx as NAV_ITEMS_MACHINE_FIELD_PATHS,Xh as NEXT_FONT_DISPLAY_NAMES,ht as NEXT_FONT_REGISTRY,Su as NON_LATIN_SITE_LOCALE_CODES,nL as NavItemSchema,Oi as NextPageCodeErrorSchema,Xy as PAGE_SEO_LOCALIZABLE_FIELD_PATHS,Qy as PAGE_SEO_MACHINE_FIELD_PATHS,Nn as PAGE_SLUG_PATTERN,Jt as PAGE_SLUG_SEGMENT_PATTERN_SOURCE,er as PAGE_TEMPLATE_BATCH_MAX_ITEMS,Ox as PLATFORM_FILE_MUTATION_TOOL_NAMES,cL as PLATFORM_MATERIALIZED_EXEMPTIONS,ox as PLATFORM_MATERIALIZED_FILES,ax as PLATFORM_MATERIALIZED_FILE_PATTERNS,rL as PLATFORM_MATERIALIZERS,Qr as PLATFORM_OWNED_PAGE_SLUGS,f_ as PLATFORM_OWNED_ROUTE_FILE_PATHS,n_ as PageDirectoryReconcileFailedPageSchema,Vi as PageDirectoryReconcileResultSchema,kA as PageDirectoryReconcileStateSchema,t_ as PageDirectoryReconcileStatusSchema,_x as PageDiscoveryCoverageEntrySchema,TL as PageDiscoveryCoverageReasonSchema,El as PageDiscoveryCoverageSchema,Wp as PageNavigationSchema,Xi as PageResourceArtifactSchema,__ as PageResourceComponentReferenceSchema,g_ as PageResourceComponentSchema,d_ as PageResourceDraftPageSchema,u_ as PageResourceDraftSchema,Cs as PageResourceFinalRouteSchema,h_ as PageResourcePageSchema,p_ as PageResourcePageSelectionSchema,$r as PageResourceRouteMappingSchema,Na as PageSchema,eL as PageSeoDeclSchema,Oa as PageSlugSchema,a_ as PageTargetKindSchema,Bi as PageTargetProjectionHashSchema,qr as PageTargetSchema,r_ as PageTargetSeoSchema,TA as PageTargetSetSchema,nr as PageTemplateBatchManifestSchema,wk as PageTemplateCleanupRequestSchema,Dk as PageTemplateCleanupResponseSchema,Ja as PageTemplateCreateItemSchema,Ak as PageTemplateCreateRequestSchema,Ck as PageTemplateCreateResponseSchema,Ok as PageTemplateErrorCodeSchema,Xe as PageTemplateIdSchema,Tn as PageTemplatePagePathSchema,Pk as PageTemplatePromoteRequestSchema,vk as PageTemplatePromoteResponseSchema,Ad as PageTemplateTaskSchema,wo as PaletteInputsSchema,iq as PersistClarifyAnswersRequestSchema,oq as PersistClarifyAnswersResponseSchema,eq as PersistGeneratedSitemapDraftRequestSchema,sq as PersistGeneratedSitemapDraftResponseSchema,Wq as PersistPreviewSessionRequestSchema,Bq as PersistPreviewSessionResponseSchema,rq as PersistSiteDesignPlanRequestSchema,cq as PersistSiteDesignPlanResponseSchema,nq as PersistSiteSitemapDraftResponseSchema,ZG as PersistSiteSitemapRequestSchema,tq as PersistSiteSitemapResponseSchema,QF as PersistSiteSnapshotRequestSchema,ZF as PersistSiteSnapshotResponseSchema,ZR as PositioningPrefillSchema,Ra as PositioningSourceSchema,FA as PrepareDesignerPageBodySchema,GF as PrepareDesignerPageResponseSchema,GO as PrepareSiteBuildInitialGenerationBaseRequestSchema,qO as PrepareSiteBuildInitialGenerationBaseResultSchema,tO as PrepareTemplateUpgradeStateRequestSchema,sb as PrepareTemplateUpgradeStateResponseSchema,gG as PrepareVersionPreviewRequestSchema,mI as PrepareVersionPreviewResponseSchema,jc as ProductSearchAppConfigDraftSchema,mo as ProductSearchAppSlugSchema,kP as ProductSearchContractFixtureSchema,Vg as ProductSearchDraftConfigSchema,Ue as ProductSearchFieldNameSchema,Hg as ProductSearchFilterMetaSchema,po as ProductSearchInteractionRequestSchema,Ns as ProductSearchInteractionResponseSchema,TP as ProductSearchPopularTermsReadSchema,Nc as ProductSearchPopularTermsSchema,zg as ProductSearchPrepareFailureReasonSchema,lo as ProductSearchPrepareFailureSchema,Zg as ProductSearchRequestSchema,eh as ProductSearchResponseSchema,Fn as ProductSearchRouteIdSchema,Kg as ProductSearchValueShapeSchema,eG as PromoteSiteSnapshotRequestSchema,rI as PromoteSiteSnapshotResponseSchema,pG as PromoteTemplateUpgradeSnapshotRequestSchema,dG as PromoteTemplateUpgradeSnapshotResponseSchema,Gl as QualityRunningStatusSchema,bD as REFUSAL_COPY,fq as REST_API_ENDPOINTS,Zy as ROOT_LAYOUT_METADATA_LOCALIZABLE_FIELD_PATHS,Jy as ROOT_LAYOUT_METADATA_MACHINE_FIELD_PATHS,TE as ReconcileSitePublishDomainOperationDataSchema,kE as ReconcileSitePublishDomainOperationResponseSchema,iG as RecordSnapshotVersionRequestSchema,oG as RecordSnapshotVersionResponseSchema,dO as RecordTemplateUpgradeEventRequestSchema,uO as RecordTemplateUpgradeEventResponseSchema,iO as RecordTemplateUpgradeFailureRequestSchema,oO as RecordTemplateUpgradeFailureResponseSchema,aO as RecordTemplateUpgradeSuccessRequestSchema,rO as RecordTemplateUpgradeSuccessResponseSchema,yA as RecoverDesignerPageProjectionRequestSchema,xA as RecoverDesignerPageProjectionResponseSchema,i_ as RecoverDesignerPageProjectionResultSchema,Ld as ReferencePagePatternSchema,_s as ReferenceSignalsSchema,OR as RegisterMediaResourceReferenceRequestSchema,NR as RegisterMediaResourceReferenceResponseSchema,dP as RegisterWorkflowTaskCommandRequestSchema,Mg as RegisterWorkflowTaskRequestSchema,CC as RegisterWorkspacePageCheckpointRequestSchema,cG as ReleaseTemplateUpgradeLockRequestSchema,mG as ReleaseTemplateUpgradeLockResponseSchema,gP as ReplaceCrawlWorkflowTaskCommandRequestSchema,Fg as ReplaceCrawlWorkflowTaskRequestSchema,_P as ReplaceWorkflowTaskCommandRequestSchema,Ug as ReplaceWorkflowTaskRequestSchema,XN as ResolvedFieldSchema,Ij as ResolvedFormFieldSchema,Sq as RestApiMethodSchema,_G as RestoreSiteSnapshotResponseSchema,tL as RootLayoutMetadataSchema,jp as RouteGenerationCardSchema,Nh as RuleEngineInputSchema,Uh as RuleEngineScoreRecordSchema,yo as RuleScoreDimensionKeySchema,Mh as RuleScoreDimensionSchema,Pn as SELECTABLE_SITE_LOCALE_CODES,BI as SITEMAP_RESOLVER_MAX_BLOCK_TARGETS,WI as SITEMAP_RESOLVER_MAX_PAGE_TARGETS,UO as SITE_BUILD_CONTEXT_FILE_PATH,FO as SITE_BUILD_CONTEXT_MAX_BYTES,Tg as SITE_BUILD_STATUSES,Ac as SITE_BUILD_STATUS_CODES,kg as SITE_DEPLOYMENT_STATUSES,Pc as SITE_DEPLOYMENT_STATUS_CODES,qo as SITE_DESIGN_DENSITY_IDS,Kt as SITE_DESIGN_NOTES_END,an as SITE_DESIGN_NOTES_START,Cm as SITE_DESIGN_RADIUS_IDS,xv as SITE_EDIT_DURABLE_HISTORY_CAPABILITY,Lu as SITE_EDIT_MATERIALIZATION_MAX_FILE_CONTENT_BYTES,Fi as SITE_EDIT_MATERIALIZATION_MAX_FILE_COUNT,Gi as SITE_EDIT_MATERIALIZATION_MAX_TOTAL_CONTENT_BYTES,dc as SITE_EDIT_PAGE_COMPOSITION_SCHEMA_VERSION,x1 as SITE_EDIT_PAGE_COMPOSITION_V2_CAPABILITY,Ef as SITE_EDIT_RUNTIME_CONTAINER_TAGS,Rf as SITE_EDIT_RUNTIME_TEXT_TAGS,xf as SITE_EDIT_RUNTIME_VOID_ELEMENT_TAGS,d1 as SITE_EDIT_SIGNED_MUTATION_CAPABILITY,Bd as SITE_EDIT_SOURCE_ALLOWED_APP_FILES,mr as SITE_EDIT_SOURCE_ALLOWED_DIRS,qd as SITE_EDIT_SOURCE_ALLOWED_ROOT_FILES,Wd as SITE_EDIT_SOURCE_ALLOWED_SYSTEM_FILES,wi as SITE_EDIT_SOURCE_DELETE_CAPABILITY,Kd as SITE_EDIT_TEXT_SOURCE_EXTENSIONS,qm as SITE_EXTRA_REQUIREMENT_MAX_LENGTH,iv as SITE_HAS_ACTIVE_SUBSITES_ERROR_CODE,ov as SITE_HAS_SUBSITES_ERROR_CODE,qw as SITE_LEADING_BODY_TOKEN,Ww as SITE_LEADING_HEADING_TOKEN_NAMES,pu as SITE_LOCALE_CODES,Jj as SITE_LOCALIZATION_STRUCTURES,xF as SITE_PLANNING_FROZEN_ERROR_CODE,EF as SITE_PLANNING_LOCKED_ERROR_CODE,kF as SITE_SITEMAP_DRAFT_OPERATION_MISMATCH_ERROR_CODE,TF as SITE_SITEMAP_DRAFT_STALE_ERROR_CODE,RF as SITE_STRUCTURE_CONFIRMATION_REQUIRED_ERROR_CODE,IF as SITE_STRUCTURE_CONFIRMATION_STALE_ERROR_CODE,Ep as SITE_STRUCTURE_INVALID_ERROR_CODE,Gw as SITE_WEIGHT_TOKEN_NAMES,ub as SITE_WORKFLOW_PROGRESS_STATUSES,gb as SITE_WORKFLOW_PROGRESS_STEP_STATUSES,Ag as SITE_WORKFLOW_STATUSES,wc as SITE_WORKFLOW_STATUS_CODES,bq as SSE_STREAMS,yu as STEP5_KEYWORD_CATEGORIES,Eu as STEP5_OPTIONAL_STRATEGY_KEYS,Rs as STEP5_REQUIRED_STRATEGY_COUNT,Cn as STEP5_REQUIRED_STRATEGY_KEYS,Ou as STEP5_SSE_EVENT_NAMES,Ne as STEP5_STRATEGY_COUNT,Zt as STEP5_STRATEGY_KEYS,br as STEP5_STRATEGY_OPTION_IDS,Nm as STEP6_AI_THEME_IDS,Bo as STEP6_AI_THEME_PRESETS,jm as STEP6_GENERATED_THEME_ID_PATTERN,Lf as SUBSITE_GLOSSARY_ENTRY_MAX_CHARS,Mf as SUBSITE_GLOSSARY_MAX_ENTRIES,Qf as SUBSITE_MOUNT_PATH_PATTERN,Wf as SUBSITE_PALETTE_NOTE_MAX_CHARS,Zf as SUBSITE_RESERVED_MOUNT_SEGMENTS,C0 as SUPPORTED_SITE_LOCALES,rs as SandboxSessionIdSchema,VT as SandboxSessionSchema,dd as SandboxSessionStatusSchema,DF as SaveBriefDraftRequestSchema,HF as SaveBriefDraftResponseSchema,oR as SaveGa4BindingDataSchema,fU as SaveGa4BindingRequestSchema,bU as SaveGa4BindingResponseSchema,HN as SaveSiteExtraRequirementRequestSchema,YG as SaveSiteSitemapDraftRequestSchema,XG as SaveSiteSitemapDraftResponseSchema,wR as SearchUnsplashMediaQuerySchema,CR as SearchUnsplashMediaResponseSchema,Gp as SiteBreadcrumbPlacementSchema,Tb as SiteBuildContextFileSchema,Ib as SiteBuildContextPayloadSchema,Rb as SiteBuildContextProvenanceSchema,Eb as SiteBuildContextProvenanceSourceSchema,oo as SiteBuildStatusSchema,av as SiteDeletionBlockedDetailsSchema,ao as SiteDeploymentStatusSchema,hi as SiteDesignContextSchema,eI as SiteDesignDensitySchema,tI as SiteDesignMotionLevelSchema,In as SiteEditAdvisorySchema,Ks as SiteEditBoundaryKindSchema,GS as SiteEditCapabilityConstraintSchema,US as SiteEditCapabilityModeSchema,Bs as SiteEditCapabilityModeViewSchema,lv as SiteEditCapabilityReadRequestSchema,R_ as SiteEditClassNameSourceDiagnosticSchema,dt as SiteEditClassNameSourceRangeSchema,sc as SiteEditClassNameSourceSchema,XA as SiteEditClassNameSourceStyleContextSchema,nc as SiteEditClassNameSourceStylesheetSchema,Zi as SiteEditClassNameSourceWriteIntentSchema,zA as SiteEditCommandDiagnosticSchema,x_ as SiteEditCommandErrorSchema,B as SiteEditCompositionContextSchema,ge as SiteEditCompositionSelectorSchema,FS as SiteEditConstraintKindSchema,ug as SiteEditDeletePageSourceOutputSchema,df as SiteEditDynamicConfidenceSchema,_f as SiteEditDynamicDataBindingSchema,hm as SiteEditDynamicDataDetailSchema,Sm as SiteEditDynamicDataSummarySchema,uf as SiteEditDynamicEvidenceSchema,gm as SiteEditDynamicSourceKindSchema,lf as SiteEditDynamicSourceTypeSchema,pf as SiteEditDynamicTargetKindSchema,vo as SiteEditEffectiveWriteTargetSchema,Sv as SiteEditEventSchema,Ii as SiteEditExecutionSceneSchema,$s as SiteEditExternalSourceKindSchema,e1 as SiteEditGetClassNameSourceCommandResultSchema,ZA as SiteEditGetClassNameSourceInputSchema,JA as SiteEditGetClassNameSourceResultSchema,Jv as SiteEditGetDocumentInputSchema,eD as SiteEditGetObjectEditContextInputSchema,x0 as SiteEditGetSourceFileInputSchema,y0 as SiteEditGetSourceTreeInputSchema,QA as SiteEditGetStyleContextInputSchema,Hs as SiteEditHistoryProvenanceSchema,zS as SiteEditHistoryReadOnlyRecoveryStatusSchema,qS as SiteEditHistoryRecoveryCodeSchema,WS as SiteEditHistoryRecoveryDiagnosticSchema,Rv as SiteEditHistoryResultSchema,Ev as SiteEditHistoryStatusModeSchema,$S as SiteEditHistoryStatusSchema,BS as SiteEditHistoryUnavailableReasonSchema,HS as SiteEditHistoryUnavailableStatusSchema,KS as SiteEditHistoryWritableStatusSchema,gD as SiteEditInitializeSessionInputSchema,lg as SiteEditInsertNodeSpecSchema,dg as SiteEditInsertPageResourceOutputSchema,Wu as SiteEditMaterializationDataRequirementsSchema,qu as SiteEditMaterializationEntrySchema,Gu as SiteEditMaterializationExportSchema,Fu as SiteEditMaterializationFileSchema,Tr as SiteEditMaterializationPathTemplateSchema,Ft as SiteEditMaterializationSchema,bc as SiteEditMaterializedComponentNodeSpecSchema,mg as SiteEditMoveNodeTargetSchema,fc as SiteEditMoveTargetSchema,jn as SiteEditMutationContextSchema,zs as SiteEditNodeCapabilitySnapshotSchema,nD as SiteEditObjectCapabilitiesSchema,iD as SiteEditObjectDetailSchema,aD as SiteEditObjectEditContextSchema,rD as SiteEditObjectStyleDetailSchema,oD as SiteEditObjectSummarySchema,M1 as SiteEditOperationCommandResultSchema,yc as SiteEditOperationErrorCodeSchema,xc as SiteEditOperationErrorSchema,_g as SiteEditOperationOutputSchema,pg as SiteEditOperationParamsSchema,no as SiteEditOperationPayloadSchema,to as SiteEditOperationRequestSchema,rg as SiteEditOperationResultTargetSchema,tn as SiteEditOperationSelectionRefSchema,mf as SiteEditOperationSummarySchema,ag as SiteEditOperationTargetSchema,Un as SiteEditOperationTypeSchema,Bt as SiteEditOperationValueSchema,gf as SiteEditPageCompositionActionScopeSchema,E1 as SiteEditPageCompositionAnyVersionSchema,K_ as SiteEditPageCompositionAtomicKindSchema,V_ as SiteEditPageCompositionBoundaryModeSchema,L_ as SiteEditPageCompositionBusinessMemberSchema,N_ as SiteEditPageCompositionContainerSchema,Mn as SiteEditPageCompositionDiagnosticSchema,Ds as SiteEditPageCompositionErrorCodeSchema,mc as SiteEditPageCompositionPlacementTargetSchema,M_ as SiteEditPageCompositionPlacementUnitSchema,W_ as SiteEditPageCompositionRuntimeRefSchema,q_ as SiteEditPageCompositionSchema,B_ as SiteEditPageCompositionSourceMemberKindSchema,j_ as SiteEditPageCompositionSourceMemberSchema,uc as SiteEditPageCompositionSourceRangeSchema,F_ as SiteEditPageCompositionSupportedSchema,G_ as SiteEditPageCompositionUnsupportedSchema,$_ as SiteEditPageCompositionV2BusinessMemberSchema,z_ as SiteEditPageCompositionV2ContainerSchema,X_ as SiteEditPageCompositionV2PlacementRelationSchema,Z_ as SiteEditPageCompositionV2PlacementSchema,Y_ as SiteEditPageCompositionV2PlacementUnitSchema,ng as SiteEditPageCompositionV2Schema,H_ as SiteEditPageCompositionV2SourceMemberSchema,eg as SiteEditPageCompositionV2SupportedSchema,tg as SiteEditPageCompositionV2UnsupportedSchema,Q_ as SiteEditPageCompositionV2WriteModeSchema,J_ as SiteEditPageCompositionVisualAnchorSchema,U_ as SiteEditPagePlacementOptionSchema,cc as SiteEditPagePlacementSchema,pc as SiteEditPageUnitResultTargetSchema,lc as SiteEditPageUnitTargetSchema,tf as SiteEditPatchPlanPatchSchema,Ov as SiteEditPatchPlanSchema,Do as SiteEditPropertiesSchema,C_ as SiteEditPropertyChangeSchema,ZS as SiteEditPropertyCreationSchema,XS as SiteEditPropertyItemSchema,VS as SiteEditPropertyResolutionSchema,YS as SiteEditPropertySourceSchema,QS as SiteEditPropertySpreadSchema,Hn as SiteEditProvenanceChainSchema,ff as SiteEditProvenanceHopSchema,tD as SiteEditRenderDocumentSchema,zn as SiteEditRenderEntryRefSchema,hf as SiteEditRenderEntrySchema,_m as SiteEditRenderPageCompositionSchema,rf as SiteEditRenderPageCompositionSupportedSchema,cf as SiteEditRenderPageCompositionUnsupportedSchema,af as SiteEditRenderPagePlacementSchema,u1 as SiteEditRequiredMutationContextEnvelopeSchema,R0 as SiteEditResolveSourceLocationInputSchema,bm as SiteEditSemanticSourceSchema,oc as SiteEditSetPropsParamsSchema,L1 as SiteEditSignedOperationRequestSchema,lr as SiteEditSourceDeleteCapabilitySchema,Hd as SiteEditSourceDirectoryPathSchema,Qd as SiteEditSourceFileBinaryPreviewUnavailableReasonSchema,Zd as SiteEditSourceFileBinaryResponseSchema,f0 as SiteEditSourceFileKindSchema,$d as SiteEditSourceFileListItemSchema,E0 as SiteEditSourceFileResponseSchema,Xd as SiteEditSourceFileTextResponseSchema,eo as SiteEditSourceIdentitySchema,Jd as SiteEditSourceLocationRangeSchema,I0 as SiteEditSourceLocationSchema,yf as SiteEditSourceLocatorRangeSchema,jo as SiteEditSourceLocatorSchema,Ee as SiteEditSourcePathSchema,cg as SiteEditSourceSiblingMoveTargetSchema,pr as SiteEditSourceTreeNodeSchema,b0 as SiteEditSourceTreeResponseSchema,Vd as SiteEditSourceTreeTruncationReasonSchema,Yd as SiteEditSourceTreeTruncationSchema,Sc as SiteEditStyleBreakpointSchema,ac as SiteEditStyleDraftPropertySchema,sD as SiteEditStyleModelSchema,gc as SiteEditStylePropertySchema,ym as SiteEditStyleSourceSchema,hc as SiteEditStyleStateModeSchema,No as SiteEditTextSegmentSchema,fm as SiteEditTextSourceSchema,Sf as SiteEditWriteTargetSchema,$N as SiteExtraRequirementResponseSchema,zb as SiteExtraRequirementSchema,LC as SiteGenerationLedgerResponseSchema,k as SiteIdSchema,yb as SiteLauncherPermissionSchema,Re as SiteLocaleSchema,NG as SiteMediaIntentSchema,ik as SiteOperationLockIdSchema,lb as SitePreviewActivateErrorCodeSchema,db as SitePreviewActivateFailedSchema,pb as SitePreviewActivateReadySchema,yO as SitePreviewActivateResponseSchema,MM as SitePublishDomainCheckDataSchema,LM as SitePublishDomainCheckRequestSchema,UM as SitePublishDomainCheckResponseSchema,FM as SitePublishDomainOperationDataSchema,GM as SitePublishDomainOperationResponseSchema,qM as SitePublishDomainReconcileOperationResponseSchema,WM as SitePublishDomainRemediationConfirmRequestSchema,BM as SitePublishDomainRemediationConfirmResponseSchema,ui as SitePublishQualityTaskStatusSchema,hM as SitePublishRepairInputItemSchema,uE as SitePublishRepairResultItemSchema,ql as SitePublishRepairResultSchema,SM as SitePublishRepairTaskSnapshotSchema,Fl as SitePublishRepairTaskStatusSchema,xM as SitePublishWorkflowActiveResponseSchema,cs as SitePublishWorkflowIdSchema,gE as SitePublishWorkflowMutationDataSchema,EM as SitePublishWorkflowMutationResponseSchema,hE as SitePublishWorkflowPublishDataSchema,RM as SitePublishWorkflowPublishResponseSchema,SE as SitePublishWorkflowQualityDataSchema,IM as SitePublishWorkflowQualityResponseSchema,Dt as SitePublishWorkflowRecordSchema,yM as SitePublishWorkflowRevisionRequestSchema,aE as SitePublishWorkflowStatusSchema,rE as SitePublishWorkflowStepSchema,jt as SiteRecordSchema,ak as SiteTemplateUpgradeStateIdSchema,Tq as SiteThreadListQuerySchema,kq as SiteThreadListResponseSchema,wq as SiteThreadResponseSchema,Ba as SiteVersionIdSchema,cI as SiteVersionListItemSchema,xi as SiteVersionRecordSchema,it as SiteWorkflowIdSchema,fb as SiteWorkflowProgressDataSchema,kO as SiteWorkflowProgressResponseSchema,_b as SiteWorkflowProgressStatusSchema,Sb as SiteWorkflowProgressStepSchema,hb as SiteWorkflowProgressStepStatusSchema,Lg as SiteWorkflowRecordSchema,oP as SiteWorkflowSnapshotResponseSchema,co as SiteWorkflowSnapshotSchema,Pg as SiteWorkflowStatusSchema,za as SiteWorkflowTaskRefIdSchema,aP as SiteWorkflowTaskRefResponseSchema,Dc as SiteWorkflowTaskRefSchema,BG as SitemapAddBlockInputSchema,ja as SitemapAnswerSchema,qG as SitemapChangeBlockVariantInputSchema,HI as SitemapDeleteBlockInputSchema,OI as SitemapDraftBlockSchema,NI as SitemapDraftPageSchema,Qp as SitemapDraftRecordSchema,_n as SitemapDraftSchema,zI as SitemapEditActorSchema,YI as SitemapEditErrorCodeSchema,QI as SitemapEditFailureSchema,VI as SitemapEditOperationSchema,zG as SitemapEditResultSchema,XI as SitemapEditSuccessSchema,$G as SitemapGenerationInputSchema,nT as SitemapGenerationOutcomeSchema,sT as SitemapGenerationReasonSchema,zp as SitemapGenerationStageSchema,ke as SitemapIdSchema,ZI as SitemapIntentPageSchema,FG as SitemapModelOutputSchema,LI as SitemapModelPageSchema,GG as SitemapMoveBlockInputSchema,vI as SitemapNavigationHrefSchema,Ge as SitemapNodeIdSchema,Xp as SitemapRecordSchema,MG as SitemapResolverRequestSchema,UG as SitemapResolverResponseSchema,KI as SitemapResolverTargetsSchema,Kp as SitemapRunInputSchema,bn as SitemapSchema,UI as SitemapSourceProvenanceSchema,VG as SitemapStreamEventSchema,RL as SitemapTaskCreateRequestSchema,PL as SitemapTaskCreateResponseSchema,Ex as SitemapTaskFailureErrorCodeSchema,wL as SitemapTaskResponseSchema,$I as SitemapUpdateBlockInstructionInputSchema,WG as SitemapUpdateBlockPropsInputSchema,hI as SitemapUserChoiceSchema,fn as SkillSelectionSchema,fI as SkillSelectionSourceSchema,id as SnapshotContentHashSchema,Id as SnapshotEditChangesSchema,Rd as SnapshotEditPageChangeSchema,Ed as SnapshotEditSectionChangeSchema,ve as SnapshotFilePathSchema,I as SnapshotIdSchema,xt as SnapshotRecordSchema,Op as SnapshotStatusSchema,MC as StartFillInRequestSchema,$F as StartFillInResponseSchema,HE as StartGa4AuthDataSchema,lU as StartGa4AuthRequestSchema,pU as StartGa4AuthResponseSchema,fa as StartGscAuthDataSchema,Bl as StartGscAuthRequestSchema,Kl as StartGscAuthResponseSchema,hP as StartSiteBuildRequestSchema,WO as StartSiteBuildResponseSchema,kb as StartSiteBuildResultSchema,fM as StartSitePublishWorkflowRequestSchema,yq as StartWorkspaceRunRequestSchema,xq as StartWorkspaceRunResponseSchema,Gc as Step2AiCrawlabilityAssessmentSchema,_h as Step2FinalResultDataSourceSchema,Ls as Step2FinalResultRequestSchema,iw as Step2FinalResultResponseSchema,sw as Step2FinalResultSaveResponseSchema,uh as Step2FinalResultSaveResultSchema,ho as Step2FinalResultTypeSchema,hh as Step2FinalResultViewSchema,Fc as Step2FinalScanCardKeySchema,So as Step2FinalScanCardSchema,dh as Step2FinalScanResultSchema,$n as Step2KnowledgeOpaqueIdSchema,YO as Step2KnowledgeScopeSchema,Tt as Step2PageRoleSchema,rw as Step2PageSelectionRequestSchema,cw as Step2PageSelectionResponseSchema,mh as Step2SiteInitializationCrawlerErrorCodeSchema,ch as Step2SiteInitializationStatusSchema,nw as Step2SiteInitializationTaskResponseSchema,lh as Step2SiteInitializationTaskSchema,fo as Step3AgentAnalysisSchema,Rh as Step3AnalysisFindingSchema,gw as Step3AnalysisJobResponseSchema,Kc as Step3AnalysisJobSchema,Wc as Step3AnalysisJobStatusSchema,hw as Step3AnalysisLatestResponseSchema,qc as Step3AnalysisProgressSchema,kh as Step3AnalysisResultSchema,_w as Step3AnalysisScheduleResponseSchema,Eh as Step3AnalysisScheduleSchema,Sw as Step3AnalysisSseFrameSchema,dw as Step3AnalysisStartRequestSchema,Bc as Step3AnalysisSummarySchema,xh as Step3AnalystSchema,uw as Step3AnalystsResponseSchema,xw as Step4DiagnosisResponseSchema,Is as Step5ActiveStrategyKeySchema,Y0 as Step5CommitStrategyRequestSchema,X0 as Step5CommitStrategyResponseSchema,vu as Step5CommittedVersionSchema,vn as Step5DecisionSelectionIdSchema,ku as Step5EvidenceReferenceSchema,Au as Step5GenerationStatusSchema,wu as Step5JobStatusSchema,ys as Step5KeywordCategorySchema,xu as Step5KeywordEntryEditSchema,wn as Step5KeywordEntrySchema,Ni as Step5KeywordLibrarySchema,U0 as Step5KeywordSearchBodySchema,xs as Step5KeywordSelectionSchema,As as Step5MarketCountrySchema,ks as Step5MarketTypeSchema,fr as Step5OptionPresentationSchema,Li as Step5OutputLocaleSchema,Ru as Step5PromotedBusinessSchema,Ps as Step5PromotedBusinessesSchema,H0 as Step5RegenerateItemRequestSchema,$0 as Step5SaveDecisionRequestSchema,V0 as Step5SaveDecisionResponseSchema,JI as Step5SitemapDecisionSchema,tT as Step5SitemapRunInputSchema,eT as Step5SitemapSourceSchema,HG as Step5SitemapStartRequestSchema,K0 as Step5StartStrategyRequestSchema,z0 as Step5StartStrategyResponseSchema,Pu as Step5StrategyDecisionInputSchema,Ui as Step5StrategyDecisionSchema,Mi as Step5StrategyItemSchema,Er as Step5StrategyJobSchema,Ts as Step5StrategyKeySchema,yr as Step5StrategyOptionIdSchema,Iu as Step5StrategyOptionSchema,xr as Step5StrategyPlanSchema,Du as Step5StrategySnapshotDataSchema,Z0 as Step5StrategySseFrameSchema,Cu as Step5StrategyVersionSnapshotSchema,Tu as Step5StructureDetailSchema,Mb as Step6AiThemeCandidateSchema,Zs as Step6ColorSeedsSchema,MN as Step6DesignAgentRecommendationsResponseSchema,CN as Step6DesignRecommendationGenerationInputSchema,Ho as Step6DesignRecommendationModelOutputSchema,Ub as Step6DesignRecommendationSchema,kN as Step6DesignRecommendationsRequestSchema,AN as Step6DesignRecommendationsResponseSchema,Gm as Step6DesignSelectionSchema,Fm as Step6GeneratedThemeCardSchema,Bb as Step6GptDesignRecommendationModelOutputSchema,NC as StopWorkspaceGenerationRequestSchema,jC as StopWorkspaceGenerationResponseSchema,MD as SubsiteCopyEstimateRequestSchema,UD as SubsiteCopyEstimateResponseSchema,$f as SubsiteDiffEstimateShape,wD as SubsiteGlossariesSchema,Ff as SubsiteGlossaryEntrySchema,Vs as SubsiteHexColorSchema,QD as SubsiteMountPathSchema,Hf as SubsitePageEstimateSchema,vD as SubsitePaletteLocalizationSchema,Gf as SubsitePaletteModeSchema,qf as SubsitePaletteSeedsSchema,CD as SubsiteSiteInfoSchema,qD as SubsiteSyncDiffComputeRequestSchema,WD as SubsiteSyncDiffComputeResponseSchema,Yf as SubsiteSyncDiffErrorCodeSchema,BD as SubsiteSyncDiffErrorResponseSchema,$D as SubsiteVisibleTextExportRequestSchema,VD as SubsiteVisibleTextExportResponseSchema,Ig as TASK_EXECUTION_STATUSES,Cc as TASK_EXECUTION_STATUS_CODES,lG as TEMPLATE_UPGRADE_LOCK_LOST_ERROR_CODE,Ko as THEME_PRESETS,Om as THEME_PRESET_IDS,kc as TaskExecutionStatusSchema,rb as TemplateUpgradeCasOutcomeSchema,Rm as TemplateUpgradeErrorCodeSchema,cb as TemplateUpgradeOutcomeCountsSchema,ob as TemplateUpgradeOutcomeSchema,mb as TemplateUpgradeSnapshotDeletionCandidateSchema,ln as TemplateUpgradeStateSchema,tb as TemplateUpgradeStatusSchema,ab as TemplateUpgradeValidationStageSchema,Ze as TemplateVersionSchema,aG as TryAcquireTemplateUpgradeLockRequestSchema,rG as TryAcquireTemplateUpgradeLockResponseSchema,pS as TypeInputsSchema,vf as USER_STOPPED_RUN_ERROR_CODES,_p as UnsplashDownloadLocationSchema,up as UnsplashMediaAssetSchema,vF as UpdateBriefRequestSchema,zF as UpdateBriefResponseSchema,aq as UpdateClarifyArchetypeRequestSchema,wA as UpdateCmsSeoSyncStateRequestSchema,JF as UpdateCurrentSnapshotManifestRequestSchema,AA as UpdatePageDirectoryReconcileStateRequestSchema,bM as UpdateSitePublishWorkflowStepRequestSchema,CF as UpdateSiteRequestSchema,Pq as UpdateSiteThreadRequestSchema,cP as UpdateSiteWorkflowWebsiteRequestSchema,PN as UpdateStep6DesignSelectionRequestSchema,wN as UpdateStep6DesignSelectionResponseSchema,uP as UpdateWorkflowTaskStatusRequestSchema,kR as UploadMediaLibraryAssetResponseSchema,aM as UpstreamPromptTemplateCatalogDataSchema,oM as UpstreamPromptTemplateConsumeDataSchema,px as UrlListCrawlerTaskCreateRequestSchema,rk as UsageRecordIdSchema,vR as UseUnsplashMediaRequestSchema,DR as UseUnsplashMediaResponseSchema,XT as UserIdSchema,vE as VCP_GSC_STATES,Sa as VcpGscStateSchema,mE as VcpQualityRemediationItemSchema,Ul as VcpQualityResultSchema,Ta as VisualHintsSchema,gI as VisualThemeSchema,sS as WEIGHT_STYLE_IDS,Zc as WEIGHT_STYLE_PRESETS,iP as WORKFLOW_DEFINITIONS_V1,ro as WORKFLOW_DEFINITION_REGISTRY,xg as WORKFLOW_FLOW_TYPES,wg as WORKFLOW_MENU_STATES,Eg as WORKFLOW_NODE_CODES,Rg as WORKFLOW_TASK_TYPES,jP as WORKSPACE_ATTACHMENT_BOUND_ERROR_CODE,WP as WORKSPACE_ATTACHMENT_CAPTURE_BUDGET_ERROR_CODE,GP as WORKSPACE_ATTACHMENT_CAPTURE_BUSY_ERROR_CODE,FP as WORKSPACE_ATTACHMENT_CAPTURE_FAILED_ERROR_CODE,qP as WORKSPACE_ATTACHMENT_CAPTURE_TIMEOUT_ERROR_CODE,BP as WORKSPACE_ATTACHMENT_CAPTURE_UNAVAILABLE_ERROR_CODE,NP as WORKSPACE_ATTACHMENT_LIMIT_ERROR_CODE,th as WORKSPACE_ATTACHMENT_MEDIA_TYPES,vP as WORKSPACE_ATTACHMENT_TARGET_BASE64_BYTES,OP as WORKSPACE_ATTACHMENT_TOO_LARGE_ERROR_CODE,CP as WORKSPACE_ATTACHMENT_UNBOUND_TTL_MS,DP as WORKSPACE_ATTACHMENT_UNSUPPORTED_FORMAT_ERROR_CODE,UP as WORKSPACE_ATTACHMENT_URL_REJECTED_ERROR_CODE,yC as WORKSPACE_CHECK_INCOMPLETE_ERROR_CODE,Nx as WORKSPACE_FILE_MUTATION_TOOL_NAMES,EC as WORKSPACE_FILL_IN_INTERRUPTED_ERROR_CODE,xC as WORKSPACE_GENERATION_STOPPED_ERROR_CODE,fC as WORKSPACE_MAX_PAGE_ATTEMPTS,SC as WORKSPACE_MAX_RESUME_COUNT,hC as WORKSPACE_RUN_HEARTBEAT_INTERVAL_MS,gC as WORKSPACE_RUN_LEASE_MS,RC as WORKSPACE_RUN_LEASE_SUPERSEDED_ERROR_CODE,IC as WORKSPACE_RUN_NOT_ACTIVE_ERROR_CODE,bC as WORKSPACE_RUN_RESUME_EXHAUSTED_ERROR_CODE,MP as WORKSPACE_URL_CAPTURE_WINDOW_MS,Nq as WORKSPACE_WEBSOCKET_CONTRACT,We as WeightStyleIdSchema,Ic as WorkflowClientCapabilitiesSchema,vc as WorkflowDefinitionVersionSchema,nn as WorkflowFlowTypeSchema,jg as WorkflowMenuItemSchema,Cg as WorkflowMenuStateSchema,It as WorkflowNodeCodeSchema,Tc as WorkflowTaskTypeSchema,zP as WorkspaceAttachmentFromUrlRequestSchema,_o as WorkspaceAttachmentMediaTypeSchema,KP as WorkspaceAttachmentSchema,CT as WorkspaceClientMessageSchema,LR as WorkspaceDesignApplyRequestSchema,MR as WorkspaceDesignApplyResponseSchema,UR as WorkspaceDesignCurrentResponseSchema,Ma as WorkspaceDiagnosticSchema,FT as WorkspaceDirectEditFileSchema,UT as WorkspaceDirectEditPathSchema,cd as WorkspaceDirectEditPostActionSchema,Mq as WorkspaceDirectEditRequestSchema,Fq as WorkspaceDirectEditResponseSchema,Ua as WorkspaceExecutionDiagnosticsSchema,mq as WorkspaceExecutionPlanSchema,cr as WorkspaceGenerationLedgerEventSchema,An as WorkspaceGenerationLedgerSchema,MT as WorkspaceMediaRequestSchema,Cd as WorkspaceOmissionKindSchema,vd as WorkspaceOmissionReasonSchema,rr as WorkspaceOmissionSchema,cm as WorkspacePageCheckpointSchema,Od as WorkspacePageOutcomeSchema,Dd as WorkspacePageResultSchema,qa as WorkspacePlanDependencySchema,ed as WorkspacePlanSummarySchema,uT as WorkspacePlanTaskKindSchema,Ga as WorkspacePlanTaskSchema,hg as WorkspaceResourceKindSchema,fg as WorkspaceResourceNavigationSelectionSchema,Rc as WorkspaceResourceOperationClientMessageSchema,Sg as WorkspaceResourceOperationSummarySchema,bg as WorkspaceResourceOperationTransientInputSchema,DC as WorkspaceRunControlInputResponseSchema,PC as WorkspaceRunHeartbeatRequestSchema,wC as WorkspaceRunHeartbeatResponseSchema,Ei as WorkspaceRunKindSchema,AS as WorkspaceRunResumePrincipalSchema,wT as WorkspaceSelectedComponentSchema,DT as WorkspaceServerMessageSchema,KG as WorkspaceSitemapEditRequestSchema,PT as WorkspaceSocketDescriptorSchema,zT as WorkspaceSourceFileBinaryResponseSchema,BT as WorkspaceSourceFileKindSchema,ld as WorkspaceSourceFileListItemSchema,Gq as WorkspaceSourceFilePathQuerySchema,qq as WorkspaceSourceFileResponseSchema,KT as WorkspaceSourceFileTextResponseSchema,md as WorkspaceSourcePathSchema,rT as WorkspaceSuggestionSchema,Zp as WorkspaceSuggestionsSchema,cT as WorkspaceSuggestionsSourceSchema,td as WorkspaceTaskCountsSchema,Oq as WorkspaceWebSocketMessageSchema,Dq as WorkspaceWebSocketMessageTypeSchema,Fa as WorkspaceWorkerGroupSchema,La as WorkspaceWorkerPhaseSchema,lq as WorkspaceWorkerResultSchema,Vt as WorkspaceWorkerStatusSchema,cj as applicationTemplateCatalogDataSchema,rj as applicationTemplateConsumeDataSchema,aj as applicationTemplateV1Schema,ww as assertDeploymentTransition,RU as assertFillInTargetsOmitted,xP as assertSiteBuildStatusTransition,yP as assertTaskExecutionStatusTransition,ko as availableFontWeights,LS as breadcrumbClassName,SL as buildCmsIdentityHeaders,xU as buildE2bBrowserPreviewUrl,AM as buildFinalSitePublishQualityResult,vN as buildStep6FallbackThemeCards,vO as canEnterLauncher,DO as canPublishSite,la as canonicalizeFormDesignJson,rM as canonicalizeLauncherPromptTemplateOperation,ec as canonicalizePageSlug,rC as checkGlobalsCssEdit,Ji as classifySiteEditPropertyName,hA as cmsPagePreviewUrlPath,tA as compareTemplateVersions,jv as composeSiteEditRepeatInstanceKey,Xj as computeFormDesignOperationFingerprint,Pi as computeSiteEditCompositionKey,O_ as computeSiteEditSourceIdentityKey,as as containsSensitiveData,zk as countLedgerAccessiblePages,Hk as countLedgerProcessedPages,gR as countSitemapStructure,E_ as createSiteEditCommandFailureSchema,tc as createSiteEditCommandResultSchema,Qi as createSiteEditCommandSuccessSchema,QG as createSiteSitemapDraftCreationKey,ZP as createSitemapResolverAnswerSheetSchema,ON as defaultStep6Selection,NE as deriveVcpGscState,jE as doesGscPropertyMatchDomain,bR as estimateNavLabelWidth,qg as findWorkflowDefinition,Gg as findWorkflowDefinitionInRegistry,Ro as fontStack,Yy as formDesignOperationFingerprintInput,uS as formatSiteDesignNotes,ev as generateDetailBreadcrumb,Cw as getDeploymentHappyPathTransitions,Aw as getDeploymentTransitionPredecessors,kw as getDeploymentTransitionTargets,Qc as getFontPairing,Dm as getMotionPreset,Lm as getSiteDesignThemeRadius,vi as getSiteEditSourceDeleteProtectionReason,TM as getSitePublishRepairItems,PM as getSitePublishSafetyAssessment,gN as getThemePreset,Wg as getWorkflowDefinition,fP as getWorkflowNodeIndex,Lk as hasAnyBusinessFact,Kn as hasDesignTokenBlock,OD as hasLockedSeeds,Yj as hashAffectedFormDesignFiles,Vj as hashCmsFormSchemaProjection,ai as hashFormDesignJson,$j as hashFormSpec,lR as homeLabelForLocale,XL as isCanonicalFileMutationToolName,Zr as isCanonicalPageSlug,xb as isCmsMainProductsWithinLimit,FR as isCmsNavigationHref,gA as isCmsPageSelectable,vr as isCmsTemplateUrlPath,n0 as isConsentGranted,Wh as isDeploymentActiveStatus,Pw as isDeploymentTerminalStatus,Nf as isExactEditEngineVersion,_k as isExternalSiteEditInfrastructureReason,Dj as isFormSpecLocalizableFieldPath,Q0 as isKnownStep5SseEventName,ZC as isMigrationProductsPresetBlockLabel,QC as isMigrationProductsPresetPageTitle,jx as isModelFileMutationToolName,cu as isNextPageCodeErrorCode,O0 as isNonLatinSiteLocale,ls as isPageTemplateCandidateEntryPath,mL as isPlatformMaterializedFile,eb as isReservedSubsiteMountSegment,tu as isSiteEditDesignDocumentPath,Uu as isSiteEditMaterializationPathTemplate,Pf as isSiteEditRuntimeContainerTag,wf as isSiteEditRuntimeTextTag,mD as isSiteEditRuntimeVoidElementTag,T0 as isSiteEditSourceDeleteProtectedPath,eu as isSiteEditSourceDirectoryPath,dr as isSiteEditSourcePath,Ci as isSiteEditTextSourcePath,fE as isSitePublishQualityItemIssue,kM as isSitePublishRepairResultSuccessful,iL as isSiteStructureKnownFieldPath,sL as isSiteStructureLocalizableFieldPath,B0 as isStep5RequiredStrategyKey,gi as isTopLevelPage,fD as isUserStoppedRunErrorCode,bP as isWorkflowTaskTypeForNode,YL as isWorkspaceFileMutationToolName,Jl as listChildPages,sf as makeSiteEditRepeatInstanceKey,dR as markAllPagesInHeader,YC as migrationProductsCopyForLocale,XC as migrationProductsKnownCopies,pR as moreLabelForLocale,yR as navLabelCollisionKey,hj as normalizeCmsApplicationSlug,mx as normalizeCmsPublicApiBase,il as normalizeFormOptionLabelIdentity,is as normalizeGscDomain,tr as normalizePageTemplatePagePath,_i as normalizeStructureTitle,_R as orderNavigationLinksByStructure,ep as orderSitemapPagesForDisplay,y_ as pageSlugToRouteFilePath,SA as parseCmsPageDirectory,qC as parseComponentI18nResourcesJson,aR as parseE2bPreviewProxyDomain,jf as parseExactEditEngineVersion,u0 as parseSiteEditCompositionKey,of as parseSiteEditRepeatInstanceKey,h1 as parseSiteEditSourceIdentityKey,go as parseWorkspaceAttachmentImagePath,Uj as projectFormSpecToCmsSchema,IS as readColorScheme,Fs as readDesignTokens,sC as readGlobalsDesignValues,tm as readSiteDesignNotes,$P as readWorkspaceAttachmentReferences,rR as reconcileSitemapNavigation,gL as resolveCmsPublicRuntimeBinding,Vh as resolveFont,sn as resolveFontDisplayName,Mj as resolveFormTemplateText,SP as resolvePublishedWorkflowDefinition,Wk as resolveRedisConnectionConfig,TD as resolveRequestedEditEngineVersion,Sr as resolveSelectableSiteLocale,lD as resolveSiteEditRuntimeOperationSummary,D0 as resolveSiteLocaleFromIso6393,v0 as resolveSiteTextDirection,Gb as resolveStep6RadiusId,qb as resolveStep6WeightStyle,kD as resolveSystemCurrentEditEngineVersion,bj as resolveTemplateFormScene,zw as resolveTryOnFontWeights,Bg as selectPublishedWorkflowDefinition,m0 as selectReferenceVisualImage,X1 as siteBuildStatusFromCode,eP as siteBuildStatusToCode,Q1 as siteDeploymentStatusFromCode,tP as siteDeploymentStatusToCode,tS as siteFontVariables,mS as siteLeadingBody,Kw as siteLeadingHeadingVariables,Bw as siteWeightVariables,Z1 as siteWorkflowStatusFromCode,nP as siteWorkflowStatusToCode,Uf as splitSubsiteGlossaryEntry,Wb as step6GptVisualIdentity,Yw as stripSiteDesignNotes,Lv as stripSiteEditRepeatInstanceKeys,J1 as taskExecutionStatusFromCode,sP as taskExecutionStatusToCode,DN as toStep6GenerationVisualHints,Jr as tryCanonicalizeAsciiPageSlug,Xw as upsertSiteDesignNotes,dm as validateComponentI18nResources,Oj as validateFormSpecIdentityTransition,hR as validateSitemapStructure,Vf as validateSubsiteDiffEstimates,HP as workspaceAttachmentImagePath,nC as writeColorScheme,tC as writeDesignTokens};
|
|
68
|
+
`}import{z as cn}from"zod";var pv="SITE_HAS_ACTIVE_SUBSITES",dv="SITE_HAS_SUBSITES",KS=cn.object({site_id:k,name:cn.string().min(1),mount_path:cn.string().min(1),archived_at:cn.string().nullable()}),uv=cn.object({subsites:cn.array(KS)});import{z as we}from"zod";var Sv=we.object({key:we.string().min(1),composition:_e}).strict(),Ks=we.enum(["component-boundary","repeat-region","conditional-region","fragment-region","opaque-region"]),zS=we.enum(["direct","proxy","upstream","readonly","unsupported"]),HS=we.enum(["component-boundary","repeat-region","conditional-region","opaque-region","void-element","read-only","cross-file-required","import-required"]),Bs=we.object({mode:zS,reasonCode:we.string().min(1).optional()}),$S=we.object({kind:HS,message:we.string().min(1)}),zs=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:Bs.optional(),insertChild:Bs.optional(),move:Bs.optional(),remove:Bs.optional()}).optional(),constraints:we.array($S)}).strict();import{z as X}from"zod";var Iv=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:sa,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:kc,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 wv="durable-history-v1",Hs=ce.object({initiatingComposition:K.optional(),affectedCompositions:ce.array(K)}).strict(),Pv=ce.enum(["writable","read-only-recovery","unavailable"]),VS=ce.enum(["INDEX_CORRUPT","ENTRY_MISSING","BLOB_MISSING","FILESYSTEM_UNAVAILABLE","ROLLBACK_INCOMPLETE","UNKNOWN"]),YS=ce.object({code:VS,message:ce.string().min(1),occurredAt:ce.iso.datetime().optional()}).strict(),XS=ce.enum(["NOT_INITIALIZED","FILESYSTEM_UNAVAILABLE","UNSUPPORTED_RUNTIME"]),fm={revision:ce.number().int().nonnegative(),undoDepth:ce.number().int().nonnegative(),redoDepth:ce.number().int().nonnegative()},QS=ce.object({mode:ce.literal("writable"),composition:K,...fm,canUndo:ce.boolean(),canRedo:ce.boolean(),provenance:Hs.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."})}),ZS=ce.object({mode:ce.literal("read-only-recovery"),composition:K,...fm,canUndo:ce.literal(!1),canRedo:ce.literal(!1),recoveryDiagnostic:YS,provenance:Hs.optional()}).strict(),JS=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:XS,provenance:Hs.optional()}).strict(),ef=ce.discriminatedUnion("mode",[QS,ZS,JS]),Cv=ce.object({composition:K,status:ef,provenance:Hs}).strict();import{z as V}from"zod";var $s=V.enum(["api-field","cms-field","i18n-message","config-entry"]),va=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:$s.optional(),sourceId:V.string().min(1).optional()}),tf=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()]),nf=V.object({kind:V.enum(["literal","boolean-shorthand","expression","binding","repeat-template"]),raw:V.string().optional()}).strict(),sf=V.object({name:V.string().min(1),source:nf,resolution:tf,editMode:V.enum(["direct","proxy","upstream","readonly","unsupported"]),sourceScope:V.enum(["node","repeat-item","repeat-template"]),allowedWriteScopes:V.array(V.enum(["selection","template"])),effectiveWriteTarget:va.optional(),diagnostics:V.array(V.object({code:V.string().min(1),message:V.string().min(1)}).strict())}).strict(),af=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(),of=V.object({selection:V.enum(["direct","materialize","unsupported"]),template:V.enum(["direct","unsupported"])}).strict(),Da=V.object({documentVersion:V.number().int().nonnegative(),selectionRef:tn.optional(),items:V.array(sf),spreads:V.array(af),creation:of}).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 Pe}from"zod";var rf=Pe.string().min(1).refine(e=>!e.startsWith("/")&&!e.includes(".."),{message:"Patch paths must be safe relative POSIX paths."}),cf=Pe.string().regex(/^sha256:[a-f0-9]{64}$/),mf=Pe.object({path:rf,operation:Pe.enum(["create","update","delete"]),expectedHash:cf.optional(),fullContent:Pe.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"})}),lf=Pe.object({siteId:k,baseSnapshotId:I,operationId:Pe.string().min(1),reason:Pe.string().min(1),patches:Pe.array(mf).min(1),changedCompositions:Pe.array(K),changedRouteIds:Pe.array(Pe.string().min(1)).optional(),diagnostics:Pe.array(Pe.object({code:Pe.string().min(1),message:Pe.string().min(1),path:Pe.string().min(1).optional()})).default([])}).strict().superRefine((e,n)=>{let s=new Set;for(let[a,o]of e.patches.entries())s.has(o.path)&&n.addIssue({code:"custom",path:["patches",a,"path"],message:`Duplicate patch path: ${o.path}`}),s.add(o.path);let i=[...new Set(e.changedCompositions.map(a=>a.routeId))];e.changedRouteIds!==void 0&&(e.changedRouteIds.length!==i.length||e.changedRouteIds.some((a,o)=>a!==i[o]))&&n.addIssue({code:"custom",path:["changedRouteIds"],message:"changedRouteIds must be the stable deduplicated route projection of changedCompositions."})}),Gv=lf.transform(e=>({...e,changedRouteIds:[...new Set(e.changedCompositions.map(n=>n.routeId))]}));var Oa="::repeat-item#";function pf(e,n){return`${e}${Oa}${n}`}function Wv(e,n){return n.reduce((s,i)=>pf(s,i),e)}function df(e){if(typeof e!="string"||e.length===0)return null;let n=[],s=e;for(;;){let i=s.lastIndexOf(Oa);if(i<0)break;let a=Number(s.slice(i+Oa.length));if(!Number.isInteger(a)||a<0)return null;n.unshift({repeatIndex:a}),s=s.slice(0,i)}return!s||n.length===0?null:{baseKey:s,parts:n}}function Bv(e){return df(e)?.baseKey??e??null}import{z as l}from"zod";import{z as Le}from"zod";var uf=Le.object({placementKey:Le.string().min(1),placementUnitKey:Le.string().min(1),relation:Le.enum(["before","after","prepend","append"])}).strict(),gf=Le.object({status:Le.literal("supported"),containerKey:Le.string().min(1),hasBusinessMembers:Le.boolean(),placementUnitKeys:Le.array(Le.string().min(1)),placements:Le.array(uf)}).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((a,o)=>{i.has(a.placementKey)&&n.addIssue({code:"custom",path:["placements",o,"placementKey"],message:"Render page composition placement keys must be unique."}),i.add(a.placementKey),s.has(a.placementUnitKey)||n.addIssue({code:"custom",path:["placements",o,"placementUnitKey"],message:"Render page composition placement must reference a projected unit."})})}),_f=Le.object({status:Le.literal("unsupported"),reason:Ds,diagnostics:Le.array(Mn)}).strict(),bm=Le.discriminatedUnion("status",[gf,_f]);var hf=l.object({canUpdateText:l.boolean(),canInsertChild:l.boolean(),canMove:l.boolean(),canRemove:l.boolean()}),ym=l.enum(["vcp-cms-collection","vcp-cms-form","vcp-cms-settings","vcp-cms-navigation","site-api-route","external-api","unknown-api"]),Sf=l.enum(["cms-field","api-field"]),ff=l.enum(["text","attribute","richtext","repeat-region","conditional-region","component-prop"]),bf=l.enum(["exact","safe-derived","partial","unknown"]),yf=l.object({file:l.string().min(1),symbol:l.string().min(1).optional(),reason:l.string().min(1)}),xf=l.object({sourceKind:ym,sourceType:Sf,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:ff,targetName:l.string().min(1),confidence:bf,readonly:l.literal(!0),evidence:l.array(yf)}),xm=l.object({hasDynamicData:l.boolean(),bindings:l.array(xf)}),Em=l.object({hasDynamicData:l.boolean(),sourceKinds:l.array(ym),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()}),Ef=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()]),Rf=l.object({key:l.string().min(1),parentKey:l.string().min(1).nullable().optional(),pageCompositionUnitKey:l.string().min(1).optional(),pageCompositionActionScope:Ef.optional(),operationSummary:hf,dynamicDataSummary:Em.optional()}).strict(),oD=l.object({composition:_e}).strict(),rD=l.object({key:l.string().min(1),composition:_e,selectionRef:tn.optional()}).strict(),cD=l.object({siteId:k,snapshotId:I,composition:K,version:l.number().int().nonnegative(),entries:l.array(Rf),pageComposition:bm}).strict(),Rm=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()}),Na=l.object({index:l.number().int().min(0),value:l.string(),editable:l.boolean(),source:Rm.nullable()}),zn=l.object({key:l.string().min(1),label:l.string().min(1),tag:l.string().min(1)}),mD=l.object({composition:K,key:l.string().min(1),canUpdateText:l.boolean(),canInsertChild:l.boolean(),canMove:l.boolean(),canRemove:l.boolean(),boundaryKind:Ks.nullable(),isOpaque:l.boolean()}).strict(),If=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()}),Im=l.object({kind:l.union([l.enum(["jsx-literal","component-prop","binding","imported-binding","object-field","array-item","repeat-template","conditional-branch"]),$s]),file:l.string().min(1),displayPath:l.string().min(1),externalSource:l.object({sourceType:$s,sourceId:l.string().min(1),adapterId:l.string().min(1).optional()}).optional()}),Tf=l.object({kind:Im.shape.kind,file:l.string().min(1),displayName:l.string().min(1),canEditHere:l.boolean()}),Hn=l.object({finalSource:Im.nullable(),chain:l.array(Tf),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)}))}),kf=l.object({kind:l.literal("css-style-model"),properties:l.array(l.object({property:yc,value:l.union([l.string(),l.number(),l.boolean(),l.null()]),resolvedValue:l.union([l.string(),l.number(),l.boolean(),l.null()]).optional(),breakpoint:Ec.optional(),state:xc.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(Un).optional()}))}),lD=l.union([l.record(l.string(),l.unknown()),kf]),Tm=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(Un),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()}),Af=l.object({startLine:l.number().int().positive(),startColumn:l.number().int().nonnegative(),endLine:l.number().int().positive(),endColumn:l.number().int().nonnegative()}),ja=l.object({sourceFile:l.string().min(1),componentName:l.string().min(1),openingElementRange:Af,structuralPath:l.string().min(1),textPreview:l.string().min(1).optional()}),pD=l.object({composition:K,key:l.string().min(1),tag:l.string().min(1),componentName:l.string().min(1),sourceFile:l.string().min(1),sourceLocator:ja.optional(),label:l.string().min(1),capabilities:zs,writeTarget:If,effectiveWriteTarget:va.optional(),provenanceChain:Hn.optional(),componentSemantic:l.record(l.string(),l.unknown()).optional(),styleSource:Tm.optional(),conditional:l.record(l.string(),l.unknown()).optional(),dynamicData:xm.optional(),properties:Da.optional(),textSegments:l.array(Na),boundaryKind:Ks.nullable(),isOpaque:l.boolean(),ancestors:l.array(zn),children:l.array(zn),siblings:l.array(zn)}).strict(),dD=l.object({composition:K,key:l.string().min(1),tag:l.string().min(1),label:l.string().min(1),sourceLocator:ja.optional(),capabilities:l.object({constraints:zs.shape.constraints}),isOpaque:l.boolean(),provenanceChain:l.object({editMode:Hn.shape.editMode,diagnostics:Hn.shape.diagnostics}).optional(),dynamicDataSummary:Em.optional(),ancestors:l.array(zn)}).strict(),uD=l.object({composition:K,key:l.string().min(1),tag:l.string().min(1),linkSourceKind:l.enum(["native-anchor","next-link","unsupported"]).optional(),label:l.string().min(1),sourceLocator:ja.optional(),isOpaque:l.boolean(),ancestors:l.array(zn),componentName:l.string().min(1),sourceFile:l.string().min(1),capabilities:zs,provenanceChain:l.object({editMode:Hn.shape.editMode,diagnostics:Hn.shape.diagnostics}).optional(),textSegments:l.array(l.object({index:Na.shape.index,editable:Na.shape.editable,sourceKind:Rm.shape.kind.nullable()})),dynamicData:xm.optional(),properties:Da.optional(),boundaryKind:Ks.nullable()}).strict(),gD=l.object({composition:K,key:l.string().min(1),styleSource:Tm.optional()}).strict();var wf=["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"],Pf=["article","aside","div","footer","form","header","li","main","nav","ol","section","select","table","tbody","tfoot","thead","tr","ul"],Cf=["a","button","em","h1","h2","h3","h4","h5","h6","label","p","small","span","strong"],vf=new Set(wf),Df=new Set(Pf),Of=new Set(Cf),Nf={canUpdateText:!1,canInsertChild:!1,canMove:!1,canRemove:!1};function hD(e){return vf.has(La(e))}function jf(e){return Df.has(La(e))}function Lf(e){return Of.has(La(e))}function SD(e){let{operationSummary:n}=e;return n?{canUpdateText:n.canUpdateText,canInsertChild:n.canInsertChild,canMove:n.canMove,canRemove:n.canRemove}:e.fallbackMode!=="preview"?{...Nf}:{canUpdateText:Lf(e.tagName),canInsertChild:jf(e.tagName),canMove:!1,canRemove:!1}}function La(e){return e?.trim().toLowerCase()??""}import{z as Mf}from"zod";var ED=Mf.object({composition:_e,mutationContext:jn.optional()}).strict();var ID={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_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.",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."},Uf=["WORKSPACE_RUN_CANCELLED","WORKSPACE_GENERATION_STOPPED"],Ff=new Set(Uf);function TD(e){return typeof e=="string"&&Ff.has(e)}var kD={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."},AD={CARD_HEADER:"Needs your confirmation",FREE_TEXT_PLACEHOLDER:"Or describe what you'd like instead",SUBMIT_LABEL:"Submit"},wD={SEND_FAILED_RETRY:"Send failed \u2014 tap to retry"};var km="0.10.27",CD="x-vcp-edit-engine-version",vD="x-vcp-edit-engine-version-source",Ma=class extends Error{constructor(n="Invalid edit-engine version."){super(n),this.code="EDIT_ENGINE_VERSION_INVALID",this.name="EditEngineVersionParseError"}},Gf=/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-[0-9A-Za-z]+(?:\.[0-9A-Za-z]+)*)?$/;function qf(e){return Gf.test(e)}function Wf(e){if(typeof e!="string"||!qf(e))throw new Ma;return e}function DD(e){return e==null?{version:km,source:"fallback_current"}:{version:Wf(e),source:"explicit"}}function OD(){return{version:km,source:"system_current"}}import{z as et}from"zod";var Bf=200,Kf=200;function zf(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 Hf=et.string().min(3).max(Bf).refine(e=>zf(e)!==null,{message:'glossary entries must be "source:target" pairs split on a half-width colon, e.g. "\u7C73:Rice"'}),LD=et.array(Hf).max(Kf),MD=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()}),$f=et.enum(["regional","fonts_only"]),Vs=et.string().regex(/^#[0-9a-fA-F]{6}$/,'color must be a "#rrggbb" value'),Vf=et.object({primary:Vs.optional(),accent:Vs.optional(),foreground:Vs.optional(),neutral:Vs.optional()}),Yf=600,UD=et.object({mode:$f.default("regional"),seeds:Vf.optional(),note:et.string().min(1).max(Yf).optional()}),FD={mode:"regional"};function GD(e){return e===void 0?!1:Object.values(e).some(n=>typeof n=="string"&&n.length>0)}import{z as zt}from"zod";var Xf=12,KD=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)}),Ys=zt.number().int().nonnegative().safe(),zD=zt.object({page_count:Ys,translation_character_count:Ys,image_estimate:zt.object({media_key_count:Ys,max_replacement_count:Ys})}).superRefine((e,n)=>{let{media_key_count:s,max_replacement_count:i}=e.image_estimate;i!==Math.min(s,Xf)&&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 Qf=ue.string().trim().min(1),mn=ue.string().uuid(),Zf=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"),Am=ue.object({snapshot_id:mn,object_key:Zf}),VD=ue.object({tenant_id:Qf,parent_site_id:mn,subsite_site_id:mn,base:Am,target:Am}),Jf=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")}),eb={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(Jf)};function tb(e,n){let s=new Set(e.pending_pages),i=new Set(e.page_estimates.map(a=>a.page_path));(s.size!==e.pending_pages.length||i.size!==e.page_estimates.length||s.size!==i.size||[...s].some(a=>!i.has(a)))&&n.addIssue({code:"custom",path:["page_estimates"],message:"page_estimates must correspond to pending_pages exactly once"});for(let[a,o]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[a]!==o&&n.addIssue({code:"custom",path:[a],message:"total must equal the sum of page estimates"})}var YD=ue.object({...eb,subsite_site_id:mn,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:mn,target_snapshot_id:mn}).superRefine(tb),nb=ue.enum(["SUBSITE_DIFF_REQUEST_INVALID","SUBSITE_DIFF_STORE_NOT_CONFIGURED","SUBSITE_DIFF_MANIFEST_MISSING","SUBSITE_DIFF_MANIFEST_INVALID","SUBSITE_DIFF_ESTIMATE_INVALID"]),XD=ue.object({error_code:nb,message:ue.string().min(1),side:ue.enum(["base","target"]).optional()});import{z as ee}from"zod";var eO=ee.object({tenant_id:ee.string().min(1),site_id:k,snapshot_id:I,manifest_hash:ee.string().regex(/^sha256:[a-f0-9]{64}$/),object_key:ee.string().min(1).max(2048),page_slug:ee.string().max(512).optional()}),tO=ee.object({site_id:k,snapshot_id:I,unit_count:ee.number().int().nonnegative(),file_count:ee.number().int().nonnegative(),markdown:ee.string().min(1),page_slug:ee.string().optional(),page_file:ee.string().optional(),entries:ee.array(ee.object({id:ee.string().min(1),file_path:ee.string().min(1),line:ee.number().int().nullable(),kind:ee.string().min(1),text:ee.string(),media_key:ee.string().optional()})).optional(),images:ee.array(ee.object({id:ee.string().min(1),source:ee.enum(["media-registry","source-literal"]),src:ee.string().min(1),alt:ee.string().nullable(),media_key:ee.string().optional(),width:ee.number().optional(),height:ee.number().optional(),provider:ee.string().optional(),is_placeholder:ee.boolean(),occurrences:ee.array(ee.object({file_path:ee.string().min(1),line:ee.number().int()}))})).optional()});import{z as sb}from"zod";var ib=/^\/[a-z0-9][a-z0-9-]{0,30}$/,ab=Object.freeze(["api","_next","assets","static","robots.txt","sitemap.xml",".well-known"]),ob=new Set(ab);function rb(e){return ob.has(e)}var iO=sb.string().regex(ib).refine(e=>!rb(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 cb=he.enum(["active","paused","blocked"]),wm=he.enum(["typecheck_failed","health_failed","validation_failed"]),mb={status:cb,attempts:he.number().int().nonnegative(),attempted_template_version:Ze.nullable(),last_error_code:wm.nullable()},ln=he.object(mb).strict(),Xs=he.object({template_id:he.string().trim().min(1),target_template_version:Ze}).strict(),cO=Xs,lb=he.discriminatedUnion("action",[he.object({action:he.literal("proceed"),state:ln.extend({status:he.literal("active")})}).strict(),he.object({action:he.literal("skip_not_newer"),state:ln.extend({status:he.literal("active")})}).strict(),he.object({action:he.literal("skip_paused"),state:ln.extend({status:he.literal("paused")})}).strict(),he.object({action:he.literal("skip_blocked"),state:ln.extend({status:he.literal("blocked")})}).strict()]),mO=Xs,lO=lb,pO=Xs.extend({error_code:wm}),dO=he.object({state:ln}).strict(),uO=Xs,gO=he.object({state:ln}).strict();import{z as Y}from"zod";var pb=744*60*60*1e3,db=Y.enum(["eligible","fast_path","upgraded","skipped","lock_skipped","cas_aborted","validation_failed","blocked","paused"]),ub=Y.enum(["typecheck","build","health","validation"]),gb=Y.enum(["not_attempted","promoted","aborted"]),bO=Y.object({template_id:Y.string().trim().min(1).max(128),from_version:Ze.nullable(),to_version:Ze,outcome:db,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:ub.nullable(),cas_outcome:gb.nullable()}).strict(),yO=Y.object({recorded:Y.literal(!0)}).strict(),Pm=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)<=pb,{message:"report window must not exceed 31 days",path:["to"]}),xO=Pm,_b=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(),EO=Y.object({window:Pm,outcome_counts:_b,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(),RO=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(),hb=Y.object({site_id:k,snapshot_id:I,status:Y.enum(["candidate","deleting"]),created_at:Y.iso.datetime()}).strict(),IO=Y.object({snapshots:Y.array(hb)}).strict();import{z as ft}from"zod";var Sb=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"]),fb=ft.object({status:ft.literal("ready"),preview_url:ft.string().url()}).strict(),bb=ft.object({status:ft.literal("failed"),code:Sb,message:ft.string().min(1),retryable:ft.boolean()}).strict(),AO=ft.discriminatedUnion("status",[fb,bb]);import{z as Pt}from"zod";var yb=["not_started","active","completed"],xb=Pt.enum(yb),Eb=["not_started","in_progress","completed"],Rb=Pt.enum(Eb),Ib=Pt.object({sequence:Pt.number().int().positive(),code:It,status:Rb}).strict(),Tb=Pt.object({site_id:k,workflow_status:xb,flow_type:nn.nullable(),current_step_code:It.nullable(),completed_count:Pt.number().int().nonnegative(),total_count:Pt.number().int().nonnegative(),steps:Pt.array(Ib)}).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,a)=>{i.sequence!==a+1&&n.addIssue({code:"custom",path:["steps",a,"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."}))}),OO=M(Tb);import{z as Ua}from"zod";var kb=Ua.enum(["none","build","build_publish"]),Ab=Ua.object({site_id:k,launcher_scope:kb}),MO=Ua.object({permission:Ab});function UO(e){return e!=="none"}function FO(e){return e==="build_publish"}import{z as fe}from"zod";var zO="build-context.json",HO=2e5,Cm=fe.string().regex(/^sha256:[a-f0-9]{64}$/u),vm=1e3;function wb(e){return Array.from(e).length<=vm}var Pb=fe.object({kind:fe.enum(["customer_materials","website_scan_diagnosis","committed_strategy"]),digest:Cm}).strict(),Cb=fe.object({schema_version:fe.literal(1),flow_type:nn,sources:fe.array(Pb).min(2).max(2)}).strict().superRefine((e,n)=>{let s=new Set(e.sources.map(a=>a.kind)),i=e.flow_type==="with_website"?["website_scan_diagnosis","committed_strategy"]:["customer_materials","committed_strategy"];(s.size!==i.length||i.some(a=>!s.has(a)))&&n.addIssue({code:"custom",path:["sources"],message:"Site-build provenance sources must match the persisted workflow flow."})}),vb=fe.object({schema_version:fe.literal(1),seed:Cm.optional(),cms_settings:fe.object({main_products:fe.string().trim().min(1).refine(wb,{message:`main_products must contain at most ${vm} characters`}).optional()}).strict().optional(),provenance:Cb.optional()}).strict(),Db=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:vb}).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."})}),$O=fe.object({source_snapshot_id:I,source_run_id:$,build_context:Db,page_slugs:fe.array(fe.string().min(1)).optional()}).strict(),VO=fe.object({disposition:fe.enum(["reused","rebased"]),snapshot_id:I}).strict(),Ob=fe.object({snapshot:ma,workspace_run_id:$.nullable()}).strict(),YO=M(Ob);import{z as rt}from"zod";import{z as He}from"zod";import{z as Ce}from"zod";import{z as Nb}from"zod";var jb=["brand","fact","cert","case","svc","faq","voice"],Dm=Nb.enum(jb);var Lb=Ce.enum(["pending","running","ready","failed","missing"]),$n=Ce.string().trim().min(1).max(255),tN=Ce.object({knowledge_site_id:$n,source_ids:Ce.array($n).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"]})}),Mb=Ce.object({source_file_id:$n,category_code:Dm.nullable(),category_confirmed:Ce.boolean(),status:Lb}).strict(),nN=Ce.object({ready:Ce.boolean(),files:Ce.array(Mb),counts:Ce.object({total:Ce.number().int().nonnegative(),pending:Ce.number().int().nonnegative(),running:Ce.number().int().nonnegative(),ready:Ce.number().int().nonnegative(),failed:Ce.number().int().nonnegative(),missing:Ce.number().int().nonnegative(),unclassified:Ce.number().int().nonnegative()}).strict()}).strict();var xe=e=>He.string().trim().max(e),Om=He.array(He.string().trim().min(1).max(120)).max(20),Fa=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:Om,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:Om,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($n).max(50)}).strict(),Ub=He.enum(["draft","submitted"]),Ga=Fa.extend({id:Q,tenant_id:He.string().min(1),site_id:k,workflow_id:it,status:Ub,submitted_at:He.string().min(1).nullable(),created_at:He.string().min(1),updated_at:He.string().min(1)}).strict(),cN=M(Ga),mN=M(Ga),lN=M(Ga.nullable());var _N=Ls.extend({expected_current_node:rt.literal("website_scan"),type:rt.literal("existing_site"),result:Ls.shape.result.extend({website:rt.string().url(),scan_cards:rt.partialRecord(Kc,Sa).refine(e=>Object.keys(e).length>0,{message:"At least one recognized scan card is required."})}).strict()}).strict(),hN=rt.object({expected_current_node:rt.literal("customer_materials"),materials:Fa}).strict(),SN=rt.object({expected_current_node:rt.literal("diagnosis")}).strict(),fN=rt.object({expected_current_node:rt.literal("strategy")}).strict();import{z as N}from"zod";var qa=["compact","comfortable","airy"],Nm=["none","sm","md","lg","xl"],jm="lg",Wa=["subtle","moderate","expressive"],Fb=[{id:"subtle",motionLevel:"subtle"},{id:"moderate",motionLevel:"moderate"},{id:"expressive",motionLevel:"expressive"}];function Lm(e){let n=Fb.find(s=>s.id===e);if(!n)throw new Error(`Unknown motion preset: ${e}`);return n}var Mm=["ocean","forest","clay","violet","graphite","crimson"],Um=["ai-forest","ai-navy","ai-steel"],Fm=/^gen-[0-9a-f]{8}$/,Ba=[{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"}],Ka=[{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 xN(e){let n=Ka.find(s=>s.id===e);if(!n)throw new Error(`Unknown theme preset: ${e}`);return n}function Gm(e){return Ka.find(n=>n.id===e)?.radius??Ba.find(n=>n.id===e)?.radius}var za=N.string().regex(/^#[0-9A-F]{6}$/i),Vn=N.string().trim().min(1).max(500),qm=N.string().datetime({offset:!0}),Gb=N.enum(Mm),qb=N.enum(Um),Wb=N.string().regex(Fm),Yn=N.union([Gb,qb,Wb]),Xn=N.enum(Ia),Qn=N.enum(Wa),Zn=N.enum(qa),Qs=N.enum(Nm),Wm=300,Bb=N.string().trim().min(1).max(Wm),Zs=N.object({primary:za,accent:za,foreground:za}).strict(),Kb=N.object({id:Yn,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:Zs,surface_mode:N.enum(["light","dark"]),radius:Qs,font_pairing_id:Xn,motion_preset_id:Qn,density:Zn,weight_style:We.optional(),reason:Vn}).strict(),Bm=N.object({name:N.string().trim().min(1).max(120),description:N.string().trim().min(1).max(240),reason:Vn,color_seeds:Zs,surface_mode:N.enum(["light","dark"]),radius:Qs,font_pairing_id:Xn,motion_preset_id:Qn,density:Zn,weight_style:We}).strict(),Km=N.object({version:N.number().int().min(1),recommendation_id:N.string().uuid(),theme_preset_id:Yn,color_seeds:Zs,surface_mode:N.enum(["light","dark"]),font_pairing_id:Xn,motion_preset_id:Qn,density:Zn,radius:Qs.optional(),weight_style:We.optional(),aesthetic_note:Bb.optional(),updated_at:qm}).strict(),zb=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:Yn,candidate_ids:N.array(Yn).length(3),candidates:N.array(Kb).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:Xn,reason:Vn}).strict(),motion:N.object({recommended_id:Qn,reason:Vn}).strict(),density:N.object({recommended_id:Zn,reason:Vn}).strict(),conversion:Mt.optional(),generated_at:qm}).strict(),DN=N.object({force_refresh:N.boolean().optional()}).strict(),ON=N.object({request_id:N.string().trim().min(1).max(160),site_id:k,cached:N.boolean(),recommendation:zb,selection:Km}).strict(),NN=N.object({recommendation_id:N.string().uuid(),expected_version:N.number().int().min(1),theme_preset_id:Yn,color_seeds:Zs,surface_mode:N.enum(["light","dark"]),font_pairing_id:Xn,motion_preset_id:Qn,density:Zn,radius:Qs.optional(),weight_style:We.optional(),aesthetic_note:N.string().trim().max(Wm).optional()}).strict(),jN=N.object({selection:Km}).strict(),Hb=4e3,LN=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(Hb)).min(1).max(Ne)}).strict(),Ha=N.object({theme_candidates:N.array(Bm).length(3),conversion:Mt.optional()}).strict().superRefine((e,n)=>{let s=new Set;e.theme_candidates.forEach((i,a)=>{let o=JSON.stringify(i.color_seeds).toUpperCase();s.has(o)&&n.addIssue({code:"custom",path:["theme_candidates",a,"color_seeds"],message:"Theme candidates must have pairwise distinct color_seeds"}),s.add(o)})});function MN(){return Ba.map(e=>Bm.parse({name:e.name,description:e.description,reason:e.fallbackReason,color_seeds:e.colorSeeds,surface_mode:e.surfaceMode,radius:e.radius,font_pairing_id:Ia[0],motion_preset_id:Wa[0],density:qa[1],weight_style:Us}))}function $b(e){return e.radius??Gm(e.theme_preset_id)??"lg"}function Vb(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??Us}function UN(e,n){let s=nm(e.font_pairing_id),i=Lm(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:$b(e),weightStyle:Vb(e,n)}}function FN(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 $a}from"zod";function Yb(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 Xb=$a.object(Ha.shape).strict().superRefine((e,n)=>{let s=new Set;e.theme_candidates.forEach((i,a)=>{let o=Yb(i);s.has(o)&&n.addIssue({code:"custom",path:["theme_candidates",a],message:"Theme candidates must have pairwise distinct visual identities"}),s.add(o)})}),BN=$a.union([Ha,Xb.safeExtend({model_profile:$a.literal("azure-gpt")})]);import{z as Ct}from"zod";var $N=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(),Qb=Ct.enum(["high","medium","low"]),VN=Ct.object({skill_name:Ct.string().trim().min(1).max(80).nullable(),confidence:Qb,reason:Ct.string().trim().min(1).max(240)}).strict();import{z as Jn}from"zod";var zm=1e4,Zb=Jn.object({note:Jn.string().trim().max(zm),updated_at:Jn.string().min(1)}).strict(),ZN=Jn.object({note:Jn.string().trim().max(zm)}).strict(),JN=M(Zb.nullable());import{z as se}from"zod";var Va=["title","text","richtext","number","boolean","date","datetime","url","email","color","select","multiselect","tag"],Js=se.object({name:se.string().min(1).max(100),type:se.enum(Va),label:se.string().min(1).max(255),required:se.boolean().optional(),options:se.array(se.string()).optional()}),nj=se.object({name:se.string(),cms_type:se.string(),label:se.string().optional(),required:se.boolean().optional(),value_shape:se.string().optional(),front_display:se.enum(["visible","internal","forbidden"]).optional(),choices:se.array(se.object({value:se.union([se.string(),se.number()]),label:se.string()})).optional()}),sj=se.object({route_file_path:se.string().min(1),target_component_path:se.string().min(1),content_type_hint:se.string().min(1),collection_purpose:se.enum(["generic","product"]).optional(),required_fields:se.array(Js).optional(),mode:se.enum(["bind_existing","provision"]),list_mode:se.enum(["page","embedded"]).optional(),fields:se.array(Js).optional(),seed_records:se.array(se.record(se.string(),se.unknown())).optional()});import{z as G}from"zod";var es=G.number().int().positive().refine(Number.isSafeInteger,"Must be a safe positive integer"),ei=G.string().regex(/^[a-f0-9]{64}$/),ti=G.string().regex(/^[a-z][a-z0-9-]{0,99}$/),ni=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"),Hm=G.object({id:G.string().uuid(),key:Ve(100),name:Ve(255)}).strict(),Vm=new Set(["title","summary","description","category","thumbnail","url","admin_id"]),Jb=new Set(["title","summary","description","image_query"]),ey=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"]),$m=new Set(["select","multiselect"]),ty=new Set(["title","text","richtext","date","datetime","url","email","color"]),ny=G.object({name:Ve(100),label:Ve(255),type:G.enum(Va),required:G.boolean().optional(),options:G.array(Ve(100)).max(100).optional()}).strict().superRefine((e,n)=>{let s=e.options??[];$m.has(e.type)&&s.length===0&&n.addIssue({code:"custom",path:["options"],message:"Choice fields require at least one option"}),!$m.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"}),Vm.has(e.name)&&n.addIssue({code:"custom",path:["name"],message:"Reserved CMS field names cannot be declared"})}),sy=G.array(ny).min(1).max(200),iy=G.array(G.record(G.string(),G.unknown())).max(1e3);function $e(e,n,s){e.addIssue({code:"custom",path:n,message:s})}var ay=G.object({name:Ve(30),slug:ni,collection_purpose:G.enum(["generic","product"]).optional(),fields:sy,seed_records:iy}).strict().superRefine((e,n)=>{let s=e.fields.map(a=>a.name);new Set(s).size!==s.length&&n.addIssue({code:"custom",path:["fields"],message:"Field names must be unique"}),s.some(a=>!Vm.has(a))||n.addIssue({code:"custom",path:["fields"],message:"At least one custom field is required"});let i=new Map(e.fields.map(a=>[a.name,a]));e.seed_records.forEach((a,o)=>{for(let[c,r]of Object.entries(a)){let m=["seed_records",o,c];if(ey.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(Jb.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(g=>typeof g!="string"||!(x.options??[]).includes(g)))&&$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 g=Array.isArray(r)?r:[r];(g.length===0||g.some(P=>typeof P!="string"||P.trim()===""))&&$e(n,m,"Seed tag values must be non-empty strings")}else ty.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 a)&&$e(n,["seed_records",o,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"})}),Ya=G.object({schema_version:G.literal(1),application:ay}).strict(),oy=G.object({templateId:G.string().uuid(),stableKey:ti,resolvedVersion:es,digest:ei,template:Ya}).strict(),ry=oy,cy={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"},Ym=G.enum(Object.values(cy)),Xm=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(),my=G.object({templateId:G.string().uuid(),stableKey:ti,title:Ve(200),description:G.string().max(1e3),thumbnailUrl:G.string().url().nullable(),resolvedVersion:es,digest:ei,application:G.object({name:Ve(30),slug:ni}).strict(),categories:G.array(Hm),tags:G.array(Hm),status:G.enum(["available","creating","created","conflict","failed"]),errorCode:Ym.nullable().optional(),template:Ya.optional()}).strict(),Qm=G.object({items:G.array(my)}).strict(),rj=G.object({version:es}).strict(),ly=G.object({app_slug:ni,name:Ve(30),template:G.object({stable_key:ti,version:es,digest:ei}).strict()}).strict(),py=G.object({status:G.literal("created"),application:ly,initialization:Xm}).strict(),cj=py,dy=G.object({stable_key:ti,version:es,digest:ei,created_at:G.string().datetime().nullable(),initialization:Xm.nullable()}).strict(),uy=G.object({app_slug:ni,name:Ve(30),collection_slug:G.string().min(1),detail_prefix:G.string().min(1).optional(),source:dy.nullable()}).strict(),mj=G.object({applications:G.array(uy)}).strict(),lj=Qm,pj=G.object({code:Ym,message:Ve(500)}).strict(),dj=Ya,uj=ry,gj=Qm;import{z as ge}from"zod";var Zm=e=>ge.string().max(e).refine(n=>n.trim().length>0,"Value must not be blank"),gy=Js.strict(),el=ge.array(gy).min(1).max(200),_y=ge.array(ge.record(ge.string(),ge.unknown())).max(1e3),hy=ge.string().regex(/^[a-z0-9]{1,30}$/),Xa=ge.number().int().positive().refine(Number.isSafeInteger,"Must be a safe positive integer"),fj=ge.object({name:Zm(30),slug:Zm(50),collection_purpose:ge.enum(["generic","product"]).optional(),fields:el}).strict(),Jm=ge.object({collection_slug:hy,detail_prefix:ge.string().min(1).max(255),plugin_id:Xa.optional()}).strict(),bj=ge.discriminatedUnion("kind",[Jm.extend({kind:ge.literal("created")}),Jm.extend({kind:ge.literal("exists")})]),yj=ge.object({fields:el,seed_records:_y,category_id:Xa}).strict(),Sy=ge.record(ge.string().min(1),ge.string().min(1).nullable()),xj=ge.object({ids:ge.array(Xa).max(1e3),urls:Sy,failed:ge.array(ge.unknown()).max(1e3)}).strict();function Ej(e){return e.replace(/[^a-zA-Z0-9]/g,"").toLowerCase().slice(0,30)}import{z as Ee}from"zod";import{z as Qa}from"zod";var tl=["lead-generation","trial-and-samples","quote-and-commerce","appointments-and-visits","resources-and-subscriptions","service-and-channel"],nl="-",fy="embedded",Za=Qa.enum([...tl,nl]),by=Qa.literal(fy),Ja=Qa.object({scene:Za,shape:by}).strict();function Tj(e){return tl.find(n=>n===e)??nl}var si=["text","textarea","email","phone","select","radio","multiselect","boolean","date","number","file"],yy=["text","textarea","email","phone","select","radio","multiselect","boolean","date","number"],xy=Ee.object({name:Ee.string().min(1).max(100),type:Ee.enum(yy),label:Ee.string().min(1).max(255),required:Ee.boolean().optional(),options:Ee.array(Ee.string()).optional()}),Ey=Ee.string().regex(/^[a-z][a-z0-9-]{0,48}$/).optional(),Pj=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:Za.optional(),component_slug:Ey,description:Ee.string().min(1).max(1e3).optional(),fields:Ee.array(xy).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"})}),Cj=Ee.object({name:Ee.string(),label:Ee.string(),cms_type:Ee.string(),required:Ee.boolean()});import{z as d}from"zod";var ts=/^[A-Za-z0-9][A-Za-z0-9_-]{0,127}$/,dn=/^[A-Za-z][A-Za-z0-9_-]{0,127}$/,ii=/^[A-Za-z][A-Za-z0-9_]{0,99}$/,ol=/^[A-Za-z0-9][A-Za-z0-9_-]{0,99}$/,to=/^[a-z][a-z0-9-]{0,99}$/,rl=/^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?$/,sl=2,il=3,ai=d.string().regex(ts),Ry=d.string().regex(ts),no=d.string().regex(ts),ns=d.string().regex(ii),so=d.string().regex(ol),Iy=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(dn)}).strict(),d.object({status:d.literal("missing"),form_code:d.string().regex(dn)}).strict()]),Ty=d.object({value:so,label:d.string().trim().min(1).max(255)}).strict(),ky=d.object({kind:d.literal("field"),field_name:ns,type:d.enum(si),label:d.string().trim().min(1).max(255),required:d.boolean(),span:d.enum(["full","half"]),options:d.array(Ty).max(100),max_files:d.number().int().min(1).max(5).optional()}).strict(),Ay=d.object({kind:d.literal("step-break"),step_id:d.string().regex(ts)}).strict(),wy=d.discriminatedUnion("kind",[ky,Ay]),Py=d.object({field_name:ns,type:d.enum(si),last_label:d.string().max(255)}).strict(),Cy=d.object({field_name:ns,value:so,last_label:d.string().max(255)}).strict(),vy=d.discriminatedUnion("kind",[d.object({kind:d.literal("custom")}).strict(),d.object({kind:d.literal("template"),slug:d.string().regex(to),version:d.string().regex(rl)}).strict()]),Dy={select:2,radio:2,multiselect:1,DropdownSelection:2,RadioButton:2,Checkbox:1};function ct(e){return e.toLowerCase()}function cl(e,n){return e.trim().toLocaleLowerCase(n)}function pn(e,n){return`${ct(e)}\0${n}`}function ve(e,n,s,i){let a=new Set;for(let o of e){if(a.has(o)){i.addIssue({code:"custom",path:n,message:s});return}a.add(o)}}function io(e,n,s,i){let a=Dy[e]??0;a>0&&n<a?i.addIssue({code:"custom",path:s,message:`choice field requires at least ${a} option${a===1?"":"s"}`}):a===0&&n>0&&i.addIssue({code:"custom",path:s,message:"non-choice fields must use an empty options array"})}var ao=d.object({schema_version:d.literal(1),min_runtime_version:d.number().int().positive(),form_definition_id:ai,binding:Iy,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(wy).min(1).max(200),source:vy,retired:d.object({fields:d.array(Py).max(1e3),options:d.array(Cy).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 a=e.nodes.filter(r=>r.kind==="step-break");!e.features.multistep&&a.length>0&&n.addIssue({code:"custom",path:["nodes"],message:"step-break requires the multistep feature"}),e.features.multistep&&(e.min_runtime_version<sl&&n.addIssue({code:"custom",path:["min_runtime_version"],message:`multistep requires runtime version ${sl}`}),a.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"});ve(a.map(r=>r.step_id),["nodes"],"step_id must be unique",n),ve(i.map(r=>ct(r.field_name)),["nodes"],"field_name must be unique",n),ve(e.retired.fields.map(r=>ct(r.field_name)),["retired","fields"],"retired field_name must be unique",n);let o=new Set(e.retired.fields.map(r=>ct(r.field_name)));for(let[r,m]of s)o.has(ct(m.field_name))&&n.addIssue({code:"custom",path:["nodes",r,"field_name"],message:"retired field_name cannot be reused"}),io(m.type,m.options.length,["nodes",r,"options"],n),m.type==="file"?e.min_runtime_version<il&&n.addIssue({code:"custom",path:["min_runtime_version"],message:`file fields require runtime version ${il}`}):m.max_files!==void 0&&n.addIssue({code:"custom",path:["nodes",r,"max_files"],message:"max_files is only valid for file fields"}),ve(m.options.map(x=>x.value),["nodes",r,"options"],"option value must be unique within a field",n),ve(m.options.map(x=>cl(x.label,e.content_locale)),["nodes",r,"options"],"option label must be unique within a field",n);ve(e.retired.options.map(r=>pn(r.field_name,r.value)),["retired","options"],"retired option identity must be unique",n);let c=new Set(e.retired.options.map(r=>pn(r.field_name,r.value)));for(let[r,m]of s)for(let[x,g]of m.options.entries())c.has(pn(m.field_name,g.value))&&n.addIssue({code:"custom",path:["nodes",r,"options",x,"value"],message:"retired option value cannot be reused"})}),Oy=["copy.title","copy.description","copy.submit_button","copy.success_message","copy.error_message","nodes.*.label","nodes.*.options.*.label"],Ny=new Set(Oy);function Uj(e){let n=e.map(s=>typeof s=="number"||/^\d+$/.test(s)?"*":s).join(".");return Ny.has(n)}function Fj(e,n){let s=[],i=e.nodes.filter(r=>r.kind==="field"),a=new Map(n.nodes.filter(r=>r.kind==="field").map(r=>[ct(r.field_name),r])),o=new Map(n.retired.fields.map(r=>[ct(r.field_name),r])),c=new Map(n.retired.options.map(r=>[pn(r.field_name,r.value),r]));for(let r of i){let m=ct(r.field_name),x=a.get(m),g=o.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&&g&&g.field_name!==r.field_name&&s.push({code:"FIELD_IDENTITY_CHANGED",field_name:r.field_name}),!x&&g&&g.type!==r.type&&s.push({code:"FIELD_TYPE_CHANGED",field_name:r.field_name}),!x&&!o.has(m)&&s.push({code:"FIELD_RETIREMENT_MISSING",field_name:r.field_name});let P=new Set(x?.options.map(B=>B.value)??[]);for(let B of r.options){let z=c.get(pn(r.field_name,B.value));!P.has(B.value)&&z&&z.field_name!==r.field_name&&s.push({code:"FIELD_IDENTITY_CHANGED",field_name:r.field_name}),!P.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=o.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(pn(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 jy=d.enum(wn),vt=d.object({english:d.string().max(1e3),translations:d.partialRecord(jy,d.string().max(1e3)).optional()}).strict(),Ly=d.object({template_option_key:d.string().regex(ol),label:vt}).strict(),My=d.object({template_field_key:d.string().regex(ii),type:d.enum(si),label:vt,required:d.boolean(),span:d.enum(["full","half"]),options:d.array(Ly).max(100)}).strict(),Uy=d.object({template_step_key:d.string().regex(ii),after_field_key:d.string().regex(ii)}).strict(),Gj=["lead-generation","trial-and-samples","quote-and-commerce","appointments-and-visits","resources-and-subscriptions","service-and-channel"],qj=[1,1,1,1,1,1],ml=d.string().regex(to),Fy=d.object({schema_version:d.literal(1),slug:ml,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"})}),Gy=d.object({schema_version:d.literal(1),slug:d.string().regex(to),version:d.string().regex(rl),category:ml,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(My).min(1).max(200),step_breaks:d.array(Uy).max(20).optional()}).strict().superRefine((e,n)=>{for(let o of["title","description","submit_button","success_message","error_message"])e.copy[o].english.trim()===""&&n.addIssue({code:"custom",path:["copy",o,"english"],message:"English baseline text is required"});ve(e.fields.map(o=>o.template_field_key),["fields"],"template_field_key must be unique",n);let s=new Map(e.fields.map((o,c)=>[o.template_field_key,c])),i=e.step_breaks??[];ve(i.map(o=>o.template_step_key),["step_breaks"],"template_step_key must be unique",n),ve(i.map(o=>o.after_field_key),["step_breaks"],"step breaks must not share an anchor field",n);let a=-1;for(let[o,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",o,"after_field_key"],message:"step break must follow an existing non-final field"}):r<=a&&n.addIssue({code:"custom",path:["step_breaks",o,"after_field_key"],message:"step breaks must follow field order"}),a=r??a}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[o,c]of e.fields.entries()){c.label.english.trim()===""&&n.addIssue({code:"custom",path:["fields",o,"label","english"],message:"English field label is required"}),io(c.type,c.options.length,["fields",o,"options"],n),ve(c.options.map(r=>r.template_option_key),["fields",o,"options"],"template_option_key must be unique within a field",n),ve(c.options.map(r=>r.label.english.trim().toLowerCase()),["fields",o,"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",o,"options",r,"label","english"],message:"English option label is required"})}}),Wj=d.object({schema_version:d.literal(1),visibility:d.enum(["internal","public"]),categories:d.array(Fy).max(500),templates:d.array(Gy).max(500)}).strict().superRefine((e,n)=>{let s=(a,o)=>{let c=wn.filter(r=>!a.translations?.[r]?.trim());c.length>0&&n.addIssue({code:"custom",path:[...o,"translations"],message:`public template copy is missing locales: ${c.join(", ")}`})};ve(e.categories.map(a=>a.slug),["categories"],"template category slug must be unique",n);let i=new Set(e.categories.map(a=>a.slug));for(let[a,o]of e.categories.entries()){let c=e.templates.filter(r=>r.category===o.slug).length;o.template_count!==c&&n.addIssue({code:"custom",path:["categories",a,"template_count"],message:"template_count must match catalog templates"})}ve(e.templates.map(a=>a.slug),["templates"],"template slug must be unique",n);for(let[a,o]of e.templates.entries())i.has(o.category)||n.addIssue({code:"custom",path:["templates",a,"category"],message:"template category must exist in catalog categories"});if(e.visibility==="public"){for(let[a,o]of e.categories.entries())s(o.name,["categories",a,"name"]);for(let[a,o]of e.templates.entries()){for(let[c,r]of Object.entries(o.copy))s(r,["templates",a,"copy",c]);for(let[c,r]of o.fields.entries()){s(r.label,["templates",a,"fields",c,"label"]);for(let[m,x]of r.options.entries())s(x.label,["templates",a,"fields",c,"options",m,"label"])}}}});function Bj(e,n){let s=Er(n),i=s?e.translations?.[s]:void 0;return i!==void 0&&i.trim()!==""?i:e.english}var qy=["Text","Summary","Email","Phone","DropdownSelection","RadioButton","Checkbox","Boolean","Date","Num","MultipleFile","SpecificFile"],Wy={text:"Text",textarea:"Summary",email:"Email",phone:"Phone",select:"DropdownSelection",radio:"RadioButton",multiselect:"Checkbox",boolean:"Boolean",date:"Date",number:"Num",file:"MultipleFile"},By=d.object({value:so,label:d.string().trim().min(1).max(255)}).strict(),Ky=d.object({field_name:ns,field_type:d.enum(qy),field_label:d.string().trim().min(1).max(255),is_required:d.boolean(),sort_order:d.number().int().nonnegative(),options:d.array(By).max(100)}).strict(),ll=d.object({version:d.literal(1),locale:Ie,fields:d.array(Ky).min(1).max(200)}).strict().superRefine((e,n)=>{ve(e.fields.map(s=>ct(s.field_name)),["fields"],"field_name must be unique",n);for(let[s,i]of e.fields.entries())io(i.field_type,i.options.length,["fields",s,"options"],n),ve(i.options.map(a=>a.value),["fields",s,"options"],"option value must be unique within a field",n),ve(i.options.map(a=>cl(a.label,e.locale)),["fields",s,"options"],"option label must be unique within a field",n)});function Kj(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":Wy[s.type],field_label:s.label,is_required:s.required,sort_order:i,options:s.options.map(a=>({...a}))}));return ll.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 Hj(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}$/),zy=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"])]),Hy=d.object({path:zy,content_hash:de.nullable()}).strict(),$y=d.array(Hy).min(1).max(500).superRefine((e,n)=>{ve(e.map(s=>s.path),[],"affected file paths must be unique",n)}),oo=d.object({grade:d.enum(["standard","A","B","C"]),required:d.boolean(),pending_confirmations:d.array(d.object({item_id:d.string().regex(ts),field_name:ns.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"})}),Vy=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:Ja.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:oo,confirm_standardization:d.boolean()}).strict(),pl=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"}),$j=d.object({site_id:k,form_block_id:Ry,base_snapshot_id:I,form_spec:ao,runtime_upgrade_required:d.boolean(),expected_form_spec_hash:de,expected_cms_schema_hash:de.nullable(),affected_files_hash:de,shared_impact:pl,standardization:oo}).strict(),Yy=d.object({operation_id:no,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:Ja.nullable(),draft_form_spec:ao,draft_form_spec_hash:de,desired_cms_schema_hash:de,affected_files_hash:de,shared_impact:pl,confirm_shared_update:d.boolean(),recreate_missing_binding:d.boolean(),standardization:oo,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",a=i&&e.standardization.required&&(e.standardization.grade==="B"||e.standardization.grade==="C");(i&&!a&&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"})}),Xy=["created","validated","binding_reserved","candidate_ready","cms_applied","snapshot_promoted","committed","compensating","recovery_required","failed"],ro=d.enum(Xy),Qy=["pending","running","succeeded","failed","recovery_required"],dl=d.enum(Qy),Zy=["candidate_abandon","snapshot_reconcile","cms_restore"],ul=d.enum(Zy),Jy=["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"],co=d.enum(Jy),gl=d.enum(["wait","resume","retry_new_operation","manual_recovery","none"]),_l=d.enum(["not_started","pending","succeeded","failed"]),hl=d.object({operation_id:no,operation_fingerprint:de,site_id:k,form_definition_id:ai,stage:ro,status:dl,base_snapshot_id:I,candidate_snapshot_id:I.nullable(),before_form_code:d.string().regex(dn).nullable(),materialized_form_code:d.string().regex(dn).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:ul.nullable(),last_error_code:co.nullable(),retryable:d.boolean(),next_action:gl,preview_refresh_status:_l,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"})}}),mo=d.object({operation:hl}).strict(),Vj=mo,Yj=mo,Xj=d.object({operation_fingerprint:de}).strict(),Qj=mo,ex=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}},Yy),Zj=d.object({operation:hl,request:ex,cms_replace_result:d.unknown().nullable()}).strict(),tx=d.object({stage:ro.optional(),status:dl.optional(),candidate_snapshot_id:I.nullable().optional(),before_form_code:d.string().regex(dn).nullable().optional(),materialized_form_code:d.string().regex(dn).nullable().optional(),materialized_form_spec_hash:de.nullable().optional(),retry_count:d.number().int().nonnegative().optional(),failure_stage:ul.nullable().optional(),last_error_code:co.nullable().optional(),retryable:d.boolean().optional(),next_action:gl.optional(),preview_refresh_status:_l.optional()}).strict(),Jj=d.object({expected_updated_at:d.string().datetime({offset:!0}),operation:tx,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"}),eL=d.object({code:co,message:d.string().trim().min(1).max(500),retryable:d.boolean(),operation_id:no.optional(),stage:ro.optional()}).strict();function nx(e){return Vy.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 al(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 eo(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 al(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 o=[];for(let c=0;c<e.length;c+=1){if(!(c in e))throw new TypeError("canonical JSON cannot contain sparse arrays");o.push(eo(e[c],n))}return`[${o.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(o=>(al(o),`${JSON.stringify(o)}:${eo(i[o],n)}`)).join(",")}}`}finally{n.delete(e)}}function lo(e){return eo(e,new Set)}async function oi(e){let n=lo(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,o=>o.toString(16).padStart(2,"0")).join("")}`}async function tL(e){return oi(ao.parse(e))}async function nL(e){return oi(ll.parse(e))}async function sL(e){let n=$y.parse(e).map(s=>({...s})).sort((s,i)=>s.path<i.path?-1:s.path>i.path?1:0);return oi({version:1,files:n})}async function iL(e){return oi(nx(e))}import{z as D}from"zod";var rL=["page-seo","root-layout-metadata","nav-items"],cL=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()}),mL=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()}),Sl=()=>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()}),lL=Sl().extend({children:D.array(Sl()).optional()}),sx=["title","description","keywords","breadcrumbs_json.*.name","breadcrumbs_json.*.text"],ix=["path","meta_tags_json.**","schema_json.**","breadcrumbs_json.*.url"],ax=["title","title.default","title.template","title.absolute","description","keywords","openGraph.title","openGraph.description","openGraph.siteName","openGraph.images.*.alt","twitter.title","twitter.description"],ox=["metadataBase","openGraph.type","openGraph.url","openGraph.locale","openGraph.images.*","openGraph.images.*.url","twitter.card","twitter.images.*","alternates.canonical","robots.**"],rx=["label","description","badge"],cx=["href","targetType","role","iconKey"],fl={"page-seo":{localizable:sx,machine:ix},"root-layout-metadata":{localizable:ax,machine:ox},"nav-items":{localizable:rx,machine:cx}},bl="*",yl="**",mx="children";function lx(e){return typeof e=="number"||/^\d+$/.test(e)?bl:e}function xl(e,n){let s=n.map(lx);return e!=="nav-items"?s:s.filter(i=>i!==bl&&i!==mx)}function El(e,n){let s=e.split(".");for(let i=0;i<s.length;i+=1){if(s[i]===yl)return!0;if(i>=n.length||s[i]!==n[i])return!1}return s.length===n.length}function px(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]===yl)return!0;if(s[i]!==n[i])return!1}return!0}function pL(e,n){let s=xl(e,n);return s.length===0?!1:fl[e].localizable.some(i=>El(i,s))}function dL(e,n){let s=xl(e,n);if(s.length===0)return!0;let{localizable:i,machine:a}=fl[e];return[...i,...a].some(o=>El(o,s)||px(o,s))}var _L=["product-search","migration-products","standard-form","form-submission-infrastructure"],dx=[{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"}],ux=[{prefix:"components/site/generated/forms/form-",suffix:".tsx",materializer:"standard-form"}],hL=[{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 gx(e){return e.length>0&&!e.includes("/")&&!e.includes(".")}function SL(e){return dx.some(n=>n.path===e)?!0:ux.some(n=>!e.startsWith(n.prefix)||!e.endsWith(n.suffix)?!1:gx(e.slice(n.prefix.length,e.length-n.suffix.length)))}import{z as bt}from"zod";var _x=["provisioning","cms_app_created","seeded","ready","failed"],xL=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(_x),owned_by_vcp:bt.boolean(),run_id:$.nullable(),last_error:bt.string().nullable(),created_at:bt.string().datetime(),updated_at:bt.string().datetime()});var Rl="/vibe/v1";function hx(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(Rl)?i:Rl,s.href.replace(/\/+$/,"")}catch{return n}}function RL(e){let n=hx(e.publicProxyUrl),s=e.cmsSiteId?.trim(),i=e.tenantId?.trim();return n&&s&&i?{cmsProxyUrl:n,cmsProjectId:s,cmsTenantId:i}:null}function TL(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 _}from"zod";var ri=_.string().url().refine(Lx,{message:"URL must use http or https"}),Il=_.string().trim().pipe(ri),Sx=_.object({task_type:_.literal("home_url"),task_url:Il,planned_num:_.number().int().min(1).max(20).optional()}).strict(),fx=_.object({task_type:_.literal("url_list"),urls:_.array(ri).min(1).max(1e4)}).strict(),PL=_.discriminatedUnion("task_type",[Sx,fx]),CL=_.object({page:_.coerce.number().int().positive().default(1),page_size:_.coerce.number().int().min(1).max(20).default(20)}).strict(),vL=_.object({home_url:Il}).strict(),Ht=_.string().uuid(),un=_.string().uuid(),DL=_.object({task_uuid:Ht}).strict(),Tl=_.enum(["URL_DISCOVERY","PAGE_CRAWL","TASK_SCHEDULING","RESULT_PERSISTENCE"]),bx=_.object({task_uuid:Ht,status:_.literal("NOT_STARTED"),total:_.literal(0)}).strict(),yx=_.object({task_uuid:Ht,status:_.literal("PROCESSING"),total:_.literal(0)}).strict(),OL=_.enum(["no_suitable_page_candidate","page_discovery_unavailable","page_selection_unavailable","page_selection_invalid","page_content_unavailable"]),xx=_.discriminatedUnion("status",[_.object({role:Tt,status:_.literal("selected"),reason_code:_.null()}).strict(),_.object({role:Tt,status:_.literal("not_found"),reason_code:_.literal("no_suitable_page_candidate")}).strict(),_.object({role:Tt,status:_.literal("unknown"),reason_code:_.enum(["page_discovery_unavailable","page_selection_unavailable","page_selection_invalid","page_content_unavailable"])}).strict()]),kl=_.array(xx).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}`})}),Ex=_.object({task_uuid:Ht,status:_.literal("SUCCEEDED"),total:_.number().int().positive(),discovery_coverage:kl.optional()}).strict(),Rx=_.enum(["TASK_FAILED","PROVIDER_CAPABILITY_LIMIT","WEBSITE_UNREACHABLE"]),Ix=_.object({task_uuid:Ht,status:_.literal("FAILED"),total:_.literal(0),error_code:Rx,error_message:_.string().min(1),failure_stage:Tl}).strict(),NL=_.discriminatedUnion("status",[bx,yx,Ex,Ix]),Tx=_.object({url:ri,raw_html:_.string().min(1)}).strict(),jL=_.object({task_uuid:Ht,status:_.literal("SUCCEEDED"),page:_.number().int().positive(),page_size:_.number().int().min(1).max(20),total:_.number().int().positive(),total_pages:_.number().int().positive(),pages:_.array(Tx).max(20),discovery_coverage:kl.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"})}),LL=_.object({task_code:un}).strict(),kx=_.object({task_code:un,status:_.literal("NOT_STARTED")}).strict(),Ax=_.object({task_code:un,status:_.literal("PROCESSING")}).strict(),wx=_.object({task_code:un,status:_.literal("SUCCEEDED"),urls:_.array(ri)}).strict(),Px=_.literal("SITEMAP_DISCOVERY_FAILED"),Cx=_.object({task_code:un,status:_.literal("FAILED"),error_code:Px,error_message:_.string().min(1)}).strict(),ML=_.discriminatedUnion("status",[kx,Ax,wx,Cx]),UL=_.object({company_name:_.string().regex(/\S/u)}).strict(),vx=_.object({company_name:_.string(),brand_name:_.string(),main_products:_.array(_.string()),industry:_.array(_.string()),subfields:_.array(_.string()),business_intro:_.string(),registered_capital:_.string(),legal_representative:_.string(),target_markets:_.array(_.string()),target_customer_industries:_.array(_.string()),target_customer_roles:_.array(_.string()),purchase_scenarios:_.string(),differentiators:_.array(_.string()),competitors:_.array(_.object({name:_.string(),official_url:_.string()}).strict()).max(3),qualifications:_.array(_.string()),representative_cases:_.array(_.string()),acquisition_channels:_.array(_.string()),desired_domain:_.string(),brand_tone:_.string(),timezone:_.string()}).strict(),ci=_.object({company_uuid:_.string().uuid(),company_info:vx,created_at:_.string().datetime(),updated_at:_.string().datetime()}),Dx=ci.extend({status:_.literal("NOT_STARTED"),last_error_code:_.null(),last_error_message:_.null(),started_at:_.null(),completed_at:_.null()}).strict(),Ox=ci.extend({status:_.literal("PROCESSING"),last_error_code:_.null(),last_error_message:_.null(),started_at:_.string().datetime(),completed_at:_.null()}).strict(),Al=ci.extend({status:_.literal("SUCCEEDED"),last_error_code:_.null(),last_error_message:_.null(),started_at:_.string().datetime(),completed_at:_.string().datetime()}).strict(),wl=ci.extend({status:_.literal("FAILED"),last_error_code:_.string().min(1),last_error_message:_.string().min(1),started_at:_.string().datetime(),completed_at:_.string().datetime()}).strict(),FL=_.discriminatedUnion("status",[Al,wl]),GL=_.discriminatedUnion("status",[Dx,Ox,Al,wl]),Nx=["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"],jx=_.enum(Nx),qL=_.object({error_code:jx,error_message:_.string().min(1),failure_stage:Tl.optional(),task_uuid:Ht.optional(),task_code:un.optional()}).strict();function Lx(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(Fx,{message:"URL must use http or https"}),Pl=W.string().min(1).max(512),mi=W.string().datetime({offset:!0}),Cl=W.enum(["scraping","completed","failed","expired"]),KL=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(),HL=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(),$L=W.object({crawl_id:Pl,expires_at:mi.optional()}).strict(),VL=W.object({status:Cl,urls:W.array(Ye).max(1e5),next:Ye.optional(),expires_at:mi}).strict(),YL=W.object({url:Ye,formats:W.tuple([W.literal("rawHtml")]),only_main_content:W.literal(!1),max_age:W.number().int().nonnegative()}).strict(),XL=W.object({url:Ye,raw_html:W.string().min(1),status_code:W.number().int().min(100).max(599).nullable()}).strict(),QL=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(),ZL=W.object({batch_id:Pl,expires_at:mi.optional()}).strict(),Mx=W.object({url:Ye,raw_html:W.string().min(1)}).strict(),JL=W.object({status:Cl,total:W.number().int().nonnegative(),completed:W.number().int().nonnegative(),pages:W.array(Mx).max(1e4),next:Ye.optional(),expires_at:mi}).strict().superRefine((e,n)=>{e.completed>e.total&&n.addIssue({code:"custom",path:["completed"],message:"completed must not exceed total"})}),Ux=W.object({url:Ye,error_message:W.string().min(1)}).strict(),eM=W.object({errors:W.array(Ux).max(1e4),robots_blocked:W.array(Ye).max(1e4)}).strict(),tM=W.object({active:W.number().int().nonnegative(),waiting:W.number().int().nonnegative(),max_concurrency:W.number().int().positive()}).strict();function Fx(e){try{let n=new URL(e).protocol;return n==="http:"||n==="https:"}catch{return!1}}var vl=["write_file","edit_file","delete_file"],Dl="apply_patch_batch",Gx=["set_breadcrumb_placement"],qx=[...vl,Dl,...Gx];function Wx(e){return vl.includes(e)}function sM(e){return qx.includes(e)}function iM(e){return Wx(e)||e===Dl}import{z as b}from"zod";var Ol=b.lazy(()=>gn),Bx=b.enum(["page","block"]),pi=b.enum(["component","page","pages"]),Kx=b.enum(["en-US","zh-CN","zh-TW","fr-FR","de-DE","es-ES","ja-JP","ko-KR"]),$t=Kx,Nl=b.object({requested_locale:$t,resolved_locale:$t,fallback_used:b.boolean()}).strict(),ss=b.object({id:b.string().uuid(),key:b.string().min(1),name:b.string().min(1)}).strict(),li=ss.extend({color:b.string().nullable()}).strict(),mM=b.object({kind:Bx,category_id:b.string().uuid().optional(),tag_id:b.string().uuid().optional(),search:b.string().trim().min(1).max(200).optional(),limit:b.coerce.number().int().min(1).max(50).default(20),cursor:b.string().min(1).optional()}).strict(),zx=b.object({stable_key:b.string().min(1),type:pi,title:b.string().min(1).max(200),description:b.string().max(1e3),thumbnail_url:b.string().url().nullable(),resolved_version:b.number().int().positive(),content_schema_version:b.literal(3),category:ss.nullable(),tags:b.array(li),page_count:b.number().int().nonnegative(),component_count:b.number().int().nonnegative(),locale:Nl}).strict(),lM=b.object({items:b.array(zx),facets:b.object({categories:b.array(ss),tags:b.array(li)}).strict(),next_cursor:b.string().nullable()}).strict(),pM=b.object({operation_id:b.string().uuidv7(),resolved_version:b.number().int().positive(),base_sitemap_id:b.string().uuid(),base_sitemap_version:b.number().int().positive(),sitemap:Ol,target_page_id:b.string().min(1).optional()}).strict(),dM=b.object({next_sitemap:Ol,applied:b.object({stable_key:b.string().min(1),resolved_version:b.number().int().positive(),template_type:pi,page_ids:b.array(b.string().min(1)),block_ids:b.array(b.string().min(1))}).strict(),locale:Nl,warnings:b.array(b.string())}).strict(),jl=b.object({nodeId:b.string().uuid(),type:b.string().trim().min(1).max(100),label:b.string().trim().min(1).max(200),variant:b.string().trim().min(1).max(100).optional(),order:b.number().int().nonnegative(),props:b.record(b.string(),b.unknown()),thumbnail:b.string().url().optional(),source:b.unknown().optional()}).strict(),Ll=b.object({nodeId:b.string().uuid().optional(),slug:b.string().regex(/^\/$|^\/[a-z0-9]+(?:-[a-z0-9]+)*(?:\/[a-z0-9]+(?:-[a-z0-9]+)*)*$/u),navigation:b.object({showInHeader:b.boolean(),showInFooter:b.boolean(),order:b.number().int().nonnegative()}).strict(),components:b.array(jl).min(1).max(100),thumbnail:b.string().url().optional(),source:b.unknown().optional()}).strict(),Hx=Ll.extend({nodeId:b.uuidv7(),parentNodeId:b.uuidv7().optional()}).strict(),$x=b.object({pages:b.array(Hx).min(1).max(50),thumbnail:b.string().url().optional(),source:b.unknown().optional()}).strict().superRefine(({pages:e},n)=>{let s=new Map(e.map(a=>[a.nodeId,a])),i=e.flatMap(a=>[a.nodeId,...a.components.map(o=>o.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(a=>a.slug)).size!==e.length&&n.addIssue({code:"custom",path:["pages"],message:"Page slugs must be unique."});for(let[a,o]of e.entries()){if(o.parentNodeId===void 0)continue;let c=g=>n.addIssue({code:"custom",path:["pages",a,"parentNodeId"],message:g}),r=s.get(o.parentNodeId);r||c("Parent must reference a page in this template."),o.parentNodeId===o.nodeId&&c("A page cannot be its own parent."),(o.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([o.nodeId]),x=o.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}}}),Vx=b.union([jl,Ll,$x]),Yx=b.object({title:b.string().min(1).max(200),description:b.string().min(1).max(1e3),prompt:b.string().min(1).max(8192)}).strict(),Xx=b.object({locale:$t,title:b.string().min(1).max(200),content:b.object({description:b.string().min(1).max(1e3),prompt:b.string().min(1).max(8192),nodes:b.record(b.string().uuid(),Yx)}).strict()}).strict(),uM=b.object({templateId:b.string().uuid(),stableKey:b.string().min(1),type:pi,resolvedVersion:b.number().int().positive(),contentSchemaVersion:b.literal(3),structure:Vx,requestedLocale:$t,resolvedLocale:$t,fallbackUsed:b.boolean(),contents:b.array(Xx).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=Qx(e.structure),i=new Set(Object.keys(e.contents[0]?.content.nodes??{}));(s.size!==i.size||[...s].some(a=>!i.has(a)))&&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."})}),gM=b.object({items:b.array(b.object({stableKey:b.string().min(1),type:pi,title:b.string().min(1).max(200),description:b.string().max(1e3),thumbnailUrl:b.string().url().nullable(),resolvedVersion:b.number().int().positive(),contentSchemaVersion:b.literal(3),category:ss.nullable(),tags:b.array(li),pageCount:b.number().int().nonnegative(),componentCount:b.number().int().nonnegative(),requestedLocale:$t,resolvedLocale:$t,fallbackUsed:b.boolean()}).strict()),facets:b.object({categories:b.array(ss),tags:b.array(li)}).strict(),nextCursor:b.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 Qx(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 _M(e){return lo({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 Zx=["pending_dns","active","failed","removing"],Jx=H.enum(Zx),eE=["serve_site","redirect_301"],tE=H.enum(eE),nE=["traffic","ownership","certificate_delegation"],po=H.enum(nE),sE=["pending","verified"],iE=H.enum(sE),aE=["not_applicable","unavailable","not_needed","auto_applied","confirmation_required","blocked"],oE=H.enum(aE),uo=H.enum(["prepare_configuration","apply_configuration","verify_dns","remediate_dns","confirm_dns_remediation"]),rE=H.enum(["accepted","running","succeeded","failed"]),cE=H.object({code:H.string().min(1),message:H.string().min(1)}).strict(),mE=H.object({purpose:po,verified:H.boolean(),observedValues:H.array(H.string())}).strict(),Ml=H.object({ready:H.boolean(),providerReady:H.boolean(),dnsVerified:H.boolean(),records:H.array(mE)}).strict(),Ul=H.object({type:H.string().min(1),name:H.string().min(1),value:H.string().min(1),ttl:H.number().nullable()}).strict(),lE=H.object({purpose:po,action:H.enum(["none","create","update","blocked"]),before:Ul.nullable(),after:Ul.nullable()}).strict(),Fl=H.object({domainId:H.string().min(1),status:oE,changes:H.array(lE)}).strict(),pE=H.object({purpose:po,type:H.string().min(1),name:H.string().min(1),value:H.string().min(1),verificationStatus:iE}).strict(),Gl=H.object({id:H.string().min(1),hostname:H.string().min(1),isPrimary:H.boolean(),routingMode:tE,observedStatus:Jx,lastVerifiedAt:H.string().datetime().nullable(),dnsRecords:H.array(pE)}).strict().superRefine((e,n)=>{dE(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"})}),ql=H.object({primaryDomain:Gl.nullable(),redirectDomains:H.array(Gl)}).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,a]of e.redirectDomains.entries())(a.isPrimary||a.routingMode!=="redirect_301")&&n.addIssue({code:"custom",path:["redirectDomains",i],message:"redirectDomains must be non-primary 301 redirects"});e.primaryDomain!==null&&e.redirectDomains.some(a=>a.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"})}),di=H.object({id:H.string().min(1),type:uo,status:rE,error:cE.nullable(),result:H.union([Ml,Fl]).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"){Ml.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"){Fl.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 dE(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 y}from"zod";var uE=y.enum(["active","completed","canceled"]),gE=y.enum(["quality","domain","gsc","publish"]),ui=y.enum(["pending","running","succeeded","failed"]),Bl=ui,Kl=y.enum(["pending","running","completed"]),_E=y.object({group_code:y.string().min(1),name:y.string().min(1),score:y.number().nonnegative(),total_score:y.number().nonnegative(),pass_score:y.number().nonnegative(),running_status:Kl,result_text:y.string()}).strict(),hE=y.object({id:y.number().int().positive().optional(),quality_task_id:y.number().int().positive(),item_code:y.string().min(1),status:ui,is_repaired:y.boolean(),total_score:y.number().nonnegative(),score:y.number().nonnegative(),check_result:y.unknown().nullable(),remediation_items:y.unknown().nullable(),result_text:y.string(),created_at:y.string().min(1),updated_at:y.string().min(1),item_name:y.string().min(1),dimension_code:y.enum(["reach","trust","convert","safe"]),group_code:y.string().min(1),auto_fix:y.boolean()}).strict(),SE=y.object({dimension_code:y.enum(["reach","trust","convert","safe"]),name:y.string().min(1),alias_en:y.string().min(1),description:y.string(),tips:y.string(),score:y.number().nonnegative(),repaired_score:y.number().nonnegative(),total_score:y.number().nonnegative(),pass_score:y.number().nonnegative(),running_status:Kl,problem_group_count:y.number().int().nonnegative(),remediation_items:y.array(hE),groups:y.array(_E)}).strict(),fE=y.object({id:y.number().int().positive(),task_code:y.string().uuid(),scene_code:y.enum(["site_publish","vcp_published_pages","content_publish"]),tenant_id:y.string().min(1),vcp_site_id:k,cms_site_id:y.string().min(1),checked_url:y.string().url(),quality_params:y.record(y.string(),y.unknown()).nullable(),status:ui,error_info:y.record(y.string(),y.unknown()).nullable(),created_at:y.string().min(1),updated_at:y.string().min(1)}).strict(),bE=y.union([y.object({}).strict(),y.object({summary:y.object({final_score:y.number().nonnegative(),pass_score:y.number().nonnegative(),group_count:y.number().int().nonnegative(),problem_group_count:y.number().int().nonnegative()}).strict(),dimensions:y.array(SE)}).strict()]),Wl=y.object({quality_info:fE,quality_detail:bE}).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"]})}),IM=y.object({item_code:y.string().min(1),remediation_items:y.unknown().nullable()}).strict(),yE=y.object({item_code:y.string().min(1),repair_status:y.enum(["succeeded","failed"]),message:y.string().min(1).optional(),error_code:y.string().min(1).optional(),metadata:y.record(y.string(),y.unknown()).optional()}).strict(),zl=y.object({items:y.array(yE)}).strict(),TM=y.object({task_code:y.string().min(1),status:Bl,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"})}),Dt=y.object({id:cs,tenant_id:y.string().min(1),site_id:k,status:uE,current_step:gE,quality_task_code:y.string().uuid().nullable(),quality_task_status:ui,repair_task_code:y.string().min(1).nullable(),repair_task_status:Bl,publish_deployment_id:lt.nullable(),domain_hostname:y.string().min(1).nullable(),domain_operation_type:uo.nullable(),domain_operation_payload:y.record(y.string(),y.unknown()).nullable(),domain_preparation_operation_id:y.string().min(1).nullable(),domain_operation_id:y.string().min(1).nullable(),revision:y.number().int().positive(),created_at:y.string().min(1),updated_at:y.string().min(1),completed_at:y.string().min(1).nullable(),canceled_at:y.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"})}),kM=y.object({}).strict(),AM=y.object({expected_revision:y.number().int().nonnegative(),current_step:y.enum(["domain","gsc","publish"]),skip_domain_binding:y.boolean().optional()}).strict(),wM=y.object({expected_revision:y.number().int().nonnegative()}).strict(),xE=y.object({workflow:Dt.nullable(),can_cancel:y.boolean()}).strict(),PM=M(xE).strict(),EE=y.object({workflow:Dt,can_cancel:y.boolean()}).strict(),CM=M(EE).strict(),RE=y.object({workflow:Dt,deployment:y.lazy(()=>Ot)}).strict(),vM=M(RE).strict(),IE=y.object({workflow:Dt,can_cancel:y.boolean(),quality_result:Wl.optional(),safety_gate_enabled:y.boolean().optional(),repair_result:zl.optional(),final_quality_result:Wl.optional(),message:y.string().min(1).optional()}).strict(),DM=M(IE).strict();function OM(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.score<i.total_score&&i.auto_fix&&n.has(i.item_code)).map(i=>({item_code:i.item_code,remediation_items:i.remediation_items})))}function NM(e,n){let s=e.map(o=>o.item_code),i=n.items.map(o=>o.item_code);if(new Set(s).size!==s.length||new Set(i).size!==i.length||s.length!==i.length)return!1;let a=new Set(s);return n.items.every(o=>a.has(o.item_code)&&o.repair_status==="succeeded")}function jM(e,n){return e.quality_info.status!=="succeeded"||!("summary"in e.quality_detail)||TE(e)?null:e}function TE(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 a=i;if(a.page_type!=="general_page"||a.http_status!==404||typeof a.url!="string")return!1;try{let o=new URL(e.quality_info.checked_url),c=new URL(a.url,o);return c.origin===o.origin&&!c.username&&!c.password}catch{return!1}})}function kE(e){return e.status==="failed"||e.status==="succeeded"&&e.score<e.total_score}function LM(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(o=>o.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(o=>o.dimension_code!=="safe"||o.status!=="succeeded"&&o.status!=="failed"))return n;let a=i.remediation_items.filter(kE).length;return a>0?{status:"blocked",issueCount:a}:i.score<i.pass_score?n:{status:"passed",issueCount:0}}var AE=Me.object({hostname:Me.string().min(1),expected_revision:Me.number().int().nonnegative()}).strict(),Hl=Me.object({workflow:Dt,operation:di}).strict(),wE=M(Hl).strict(),PE=Me.object({expected_revision:Me.number().int().nonnegative()}).strict(),CE=Me.object({workflow:Dt,operation:di}).strict(),vE=M(CE).strict(),go=Me.object({workflow:Dt,operation:di.nullable()}).strict(),DE=M(go).strict(),OE=go,NE=M(OE).strict(),WM=M(ql).strict(),jE=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"}))}),BM=M(jE).strict(),KM=AE,zM=Hl,HM=wE,$M=go,VM=DE,YM=NE,XM=PE,QM=vE;import{z as Be}from"zod";var LE=["started","success","failed","canceled"],_o=Be.enum(LE),ME=["inactive","pending_binding","active"],ho=Be.enum(ME),UE=["domain","url_prefix"],So=Be.enum(UE),FE=["not_connected","authorizing","matching_property","ready","failed","canceled","domain_mismatch"],fo=Be.enum(FE),mt=Be.string().nullable(),$l=Be.object({}).strict(),bo=Be.object({authorize_url:Be.string().url(),custom_domain:mt}).strict(),Vl=M(bo),GE=Be.object({auth_status:_o,binding_status:ho,credential_connected:Be.boolean(),custom_domain:mt,gsc_site_url:mt,property_type:So.nullable(),auth_error_code:mt,auth_error_message:mt}).strict(),Yl=Be.object({auth_status:_o,binding_status:ho,credential_connected:Be.boolean(),custom_domain:mt,gsc_site_url:mt,property_type:So.nullable(),auth_error_code:mt,auth_error_message:mt,current_domain:mt,state:fo,ready:Be.boolean()}).strict().superRefine((e,n)=>{let s=WE(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`})}),qE=M(Yl);function is(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 WE(e,n){let s=e.gsc_site_url?.trim()??"",i=is(e.custom_domain),a=is(n??("current_domain"in e?e.current_domain:void 0)),o=i.length>0&&a.length>0&&i===a,c=BE(s,e.property_type,a);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":!o||!c?"domain_mismatch":e.binding_status==="pending_binding"?"matching_property":e.auth_status==="success"&&e.binding_status==="active"&&e.credential_connected&&s.length>0&&o&&c?"ready":"failed"}function BE(e,n,s){let i=e?.trim()??"",a=is(s);if(!i||!a||!n)return!1;if(n==="domain"){let o=/^sc-domain:(.+)$/i.exec(i);if(!o)return!1;let c=o[1].trim();if(!c||/[/:?#]/.test(c))return!1;let r=is(c);return r?a===r||a.endsWith(`.${r}`):!1}try{let o=new URL(i);return o.protocol!=="https:"||o.username||o.password||o.port||o.pathname!=="/"||o.search||o.hash?!1:is(o.hostname)===a}catch{return!1}}var tU=$l,nU=bo,sU=Vl,iU=fo,aU=_o,oU=ho,rU=So,cU=fo,mU=$l,lU=bo,pU=Vl,dU=GE,uU=Yl,gU=qE;import{z as O}from"zod";var Ke=O.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER),tt=O.string().min(1).max(4096),_n=O.string().regex(/^[A-Za-z0-9_-]{43}$/),hn=O.string().max(300),yo=O.string().datetime({offset:!0}).nullable(),Xl=O.string().regex(/^[A-Z][A-Z0-9_]*$/).max(100).nullable(),KE=["authorized","pending","failed","revoked","expired","not_authorized"],zE=O.enum(KE),HE=["pending","succeeded","failed","canceled","expired","superseded"],$E=O.enum(HE),VE=["unconfigured","configured","needs_reconfiguration","unverified"],YE=O.enum(VE),XE=["not_checked","valid","invalid","unavailable"],QE=O.enum(XE),ZE=["authorization_pending","authorization_required","authorization_changed","resource_unavailable","resource_changed","verification_required","verification_unavailable"],JE=O.enum(ZE),Ql=O.object({revision:Ke,status:$E,started_at:O.string().datetime({offset:!0}),expires_at:O.string().datetime({offset:!0}),finished_at:yo,error_code:Xl}).strict(),fU=O.object({expected_authorization_revision:Ke,expected_attempt_revision:Ke,select_account:O.boolean().default(!1),replace_pending:O.boolean().default(!1)}).strict(),eR=O.object({authorize_url:O.string().url(),authorization_revision:Ke,attempt:Ql}).strict(),bU=M(eR),tR=O.object({status:zE,authorization_revision:Ke,account_email:O.string().max(320).nullable(),latest_attempt:Ql.nullable()}).strict(),nR=O.object({account_ref:tt,account_key:_n,account_display_name:hn,property_ref:tt,property_key:_n,property_display_name:hn,data_stream_ref:tt,data_stream_key:_n,data_stream_display_name:hn,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(),sR=O.object({status:QE,checked_at:yo,expires_at:yo,error_code:Xl}).strict(),iR=O.enum(["oauth","verification"]),aR=O.object({measurement_id_display:O.string().min(1).max(40),stream_display_name:O.string().max(100).nullable()}).strict(),oR=O.object({status:O.enum(["pending","applied"]),applied_revision:Ke}).strict(),Zl=O.object({capability_enabled:O.boolean(),revision:Ke,authorization:tR,binding_status:YE,reason:JE.nullable(),ready:O.boolean(),mode:iR.nullable(),binding:nR.nullable(),verification:sR,tracking:aR.nullable(),deployment:oR}).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"})}),yU=M(Zl),xU=O.object({refresh:O.union([O.boolean(),O.enum(["true","false"]).transform(e=>e==="true")]).default(!1)}).strict(),rR=O.object({property_ref:tt,property_key:_n,display_name:hn}).strict(),cR=O.object({account_ref:tt,account_key:_n,display_name:hn,properties:O.array(rR)}).strict(),mR=O.object({accounts:O.array(cR),returned_count:O.number().int().nonnegative(),completeness:O.literal("unknown"),authorization_revision:Ke}).strict(),EU=M(mR),RU=O.object({authorization_revision:O.coerce.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER)}).strict(),lR=O.object({data_stream_ref:tt,data_stream_key:_n,display_name:hn,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(),pR=O.object({property_ref:tt,streams:O.array(lR),returned_count:O.number().int().nonnegative(),completeness:O.literal("unknown"),authorization_revision:Ke}).strict(),IU=M(pR),TU=O.object({property_ref:tt,authorization_revision:O.coerce.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER)}).strict(),kU=O.object({expected_revision:Ke,authorization_revision:Ke,account_ref:tt,property_ref:tt,data_stream_ref:tt,confirm_url_mismatch:O.boolean()}).strict(),dR=O.object({applied_revision:Ke,idempotency_replayed:O.boolean()}).strict(),uR=Zl.and(O.object({mutation:dR}).strict()),AU=M(uR);var Jl=/^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/,ep="VCP_E2B_PREVIEW_PROXY_DOMAIN must be a valid hostname.";function gR(e){let n=e?.trim().toLowerCase()??"";if(!n)return null;if(n.length>253||!n.includes(".")||!n.split(".").every(s=>Jl.test(s)))throw new Error(ep);return n}function PU(e){let n=gR(e.proxyDomain);if(!n)return null;let s=e.sandboxId.trim();if(!Jl.test(s))throw new Error("sandboxId must be a valid DNS label.");if(`${s}.${n}`.length>253)throw new Error(ep);return`https://${s}.${n}/`}function vU(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(a=>a.kind===n.kind&&a.target_id===n.target_id&&a.filled!==!0))))return{ok:!1,target_id:n.target_id};return{ok:!0}}function _R(e,n,s=e){let i=new Map(e.map(r=>[r.slug,r])),a=new Map(s.map(r=>[r.id,r])),o=new Map(e.map(r=>{let m=a.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:tp(n.primaryLinks,e,i,o,c,a,"showInHeader"),footerLinks:tp(n.footerLinks,e,i,o,c,a,"showInFooter")}}function tp(e,n,s,i,a,o,c){let r=new Set,m=[];for(let[B,z]of e.entries()){let te=hR(z.href),Se=te===null?void 0:s.get(te)??i.get(te);if(te!==null&&a.has(te)&&!s.has(te)&&!i.has(te))continue;if(Se?.slug==="/"){m.push({kind:"independent",link:{...z,label:np(z,Se,o)}});continue}if(!Se){m.push({kind:"independent",link:z});continue}if(!Se.navigation[c])continue;r.add(Se.slug);let xn=te===Se.slug?z.href:SR(z.href,Se.slug);m.push({kind:"page",page:Se,link:{...z,label:np(z,Se,o),href:xn},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),g=0,P=m.map(B=>B.kind==="page"?x[g++].link:B.link);for(let B of[...n].filter(z=>z.slug!=="/"&&z.navigation[c]).sort((z,te)=>z.navigation.order-te.navigation.order))r.has(B.slug)||P.push({label:B.title,href:B.slug});return P}function np(e,n,s){let i=s.get(n.id);return e.label===(i?.title??n.title)?n.title:e.label}function hR(e){if(!e.startsWith("/")||e.startsWith("//"))return null;let n=e.search(/[?#]/u);return n===-1?e:e.slice(0,n)}function SR(e,n){let s=e.search(/[?#]/u);return s===-1?n:`${n}${e.slice(s)}`}function gi(e){return e.trim().normalize("NFKC").toLowerCase()}function fR(e){let n=e?.toLowerCase();return n?.startsWith("zh")?"\u9996\u9875":n?.startsWith("ja")?"\u30DB\u30FC\u30E0":n?.startsWith("ko")?"\uD648":"Home"}function bR(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 yR(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 _i(e,n){let s=as(e);return s===null?!0:!n.some(i=>i.id===s)}function sp(e,n){return e.filter(s=>as(s)===n&&s.id!==n)}function ip(e){let n=e.filter(c=>_i(c,e)),s=n.filter(c=>c.slug==="/"),i=n.filter(c=>c.slug!=="/"),a=[],o=new Set;for(let c of[...s,...i])if(!o.has(c.id)){a.push(c),o.add(c.id);for(let r of sp(e,c.id))o.has(r.id)||(a.push(r),o.add(r.id))}for(let c of e)o.has(c.id)||(a.push(c),o.add(c.id));return a}function xR(e){if(!e.startsWith("/")||e.startsWith("//"))return null;let n=e.search(/[?#]/);return n===-1?e:e.slice(0,n)}function ER(e,n){let s=ip(n),i=new Map;s.forEach((c,r)=>{c.slug!==null&&!i.has(c.slug)&&i.set(c.slug,r)});let a=[],o=[];for(let c of e){let r=xR(c.href),m=r===null?void 0:i.get(r);m===void 0?o.push(c):a.push({link:c,rank:m})}return a.sort((c,r)=>c.rank-r.rank),[...a.map(c=>c.link),...o]}function RR(e){let n=e.filter(s=>_i(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 IR(e,n={}){let s=[],i=new Map(e.map(c=>[c.id,c])),a=e.filter(c=>c.slug==="/");a.length!==1?s.push({code:"missing_home",page_id:null,message:"The structure must contain exactly one home page."}):n.expectedHomeTitle&&gi(a[0].title)!==gi(n.expectedHomeTitle)&&s.push({code:"home_renamed",page_id:a[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 o=new Map;for(let c of e){let r=_i(c,e)?"__top__":as(c),m=gi(c.title);if(m.length===0)continue;let x=o.get(r)??new Map,g=x.get(m);g!==void 0&&g!==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),o.set(r,x)}return s}var TR=16,kR=/[ᄀ-ᅟ⺀-〾ぁ-㏿㐀-䶿一-鿿ꀀ-가-힣豈-︰--⦆¢-₩]/u;function AR(e){let n=0;for(let s of e)n+=kR.test(s)?2:1;return n}function wR(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 ap=20*1024*1024,PR=ap,op=["jpg","jpeg","png","gif","webp","bmp"],rp=["mp4","avi","mov","webm","mkv"],cp=["mp3","wav","aac","flac","ogg","wma","m4a"],mp=["pdf","doc","docx","xls","xlsx","ppt","pptx","txt","md","csv"],lp=[...mp,"zip","rar","json","xmind","psd","ai","fig","sketch"],CR=[...op,...rp,...cp,...lp],pp=["image/jpeg","image/png","image/gif","image/webp","image/bmp"],dp=["video/mp4","video/x-msvideo","video/quicktime","video/webm","video/x-matroska"],up=["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"],vR=[...pp,...dp,...up],gp=A.enum(["image","video","audio","file"]),_p=A.enum(["external","ai_generated","unsplash"]),xo=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:_p,created_at:A.string().min(1).nullable()}),DR=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:gp.default("image")}),OR=A.object({code:A.literal(0),message:A.string(),data:A.object({items:A.array(xo),page:A.number().int().min(1),page_size:A.number().int().min(1),total:A.number().int().nonnegative()})}),NR=A.object({code:A.literal(0),message:A.string(),data:xo}),Eo=4,jR=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*$/)}),hp=A.object({index:A.number().int().min(0).max(Eo-1),ok:A.literal(!0),url:A.string().regex(/^data:image\/(?:png|jpeg|gif|webp|bmp);base64,[A-Za-z0-9+/]+={0,2}$/)}),LR=A.object({code:A.literal(0),message:A.string(),data:A.object({items:A.array(hp).min(1).max(Eo)})}),Sp=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()}),MR=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()}),UR=A.object({code:A.literal(0),message:A.string(),data:A.object({items:A.array(Sp),page:A.number().int().min(1),page_size:A.number().int().min(1),total:A.number().int().nonnegative(),total_pages:A.number().int().nonnegative()})}),fp=A.string().url().refine(BR,{message:"download_location must be an official Unsplash download URL"}),FR=A.object({download_location:fp}),GR=A.object({code:A.literal(0),message:A.string(),data:A.object({reported:A.boolean()})}),qR=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()}),WR=A.object({code:A.literal(0),message:A.string(),data:A.object({reported:A.boolean()})});function BR(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 KR=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"}),zR=me.object({ok:me.literal(!0),design_plan_version:me.number().int().positive().optional(),snapshot_id:I,site_design_context:me.lazy(()=>hi).optional(),changed_files:me.array(me.string().min(1)).optional()}),HR=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:Pa.nullable(),notes:me.array(me.string()).nullable(),weight_style:We.nullable().default(null),source:me.enum(["globals_css","design_plan_archive"])});import{z as w}from"zod";var be=w.string().min(1).max(100),Io=w.enum(["page","anchor","external","email","phone","file","group"]);function $R(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 VR=w.string().max(2048).refine($R,"Invalid navigation destination"),To=w.string().trim().min(1).max(255),ko=w.enum(["link","cta"]).nullable(),bp=w.lazy(()=>w.object({id:be,group_id:be,parent_id:be.nullable(),sort_order:w.number().int().nonnegative(),label:w.string(),href:w.string().nullable(),target_type:Io,enabled:w.boolean(),effective_visible:w.boolean(),open_in_new:w.boolean(),nofollow:w.boolean(),role:ko,link_binding:w.object({kind:w.enum(["custom","cms_page","file"]),page_id:be.nullable()}),children:w.array(bp)})),YR=w.object({id:be,name:w.string(),description:w.string(),is_default:w.boolean(),can_delete:w.boolean(),delete_block_reason:w.string().nullable(),items:w.array(bp)}),XR=w.object({site_id:w.string().min(1),default_group_id:be.nullable(),groups:w.array(YR),limits:w.object({max_depth:w.number().int().positive(),max_items:w.number().int().positive()})}),HU=w.object({data:XR}),yp=w.object({name:To,description:w.string().max(2e3).optional()}).strict(),QR=yp.partial().refine(e=>Object.keys(e).length>0,"At least one field is required"),$U=w.object({group_id:be}).strict(),xp={label:To,target_type:Io,href:VR.nullable().optional(),enabled:w.boolean().optional(),open_in_new:w.boolean().optional(),nofollow:w.boolean().optional(),role:ko.optional()},Ep=w.object({group_id:be,parent_id:be.nullable().optional(),...xp}).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"})}),ZR=w.object({...xp,link_mode:w.literal("custom").optional()}).partial().strict().refine(e=>Object.keys(e).length>0,"At least one field is required"),JR=w.object({group_id:be,parent_id:be.nullable(),before_id:be.nullable().optional()}).strict(),Ro=w.lazy(()=>w.object({id:be.nullable(),label:w.string().max(255),href:w.string().max(2048).nullable(),target_type:Io,enabled:w.boolean(),open_in_new:w.boolean(),nofollow:w.boolean(),role:ko,children:w.array(Ro)}).strict()),VU=w.object({group_id:be.nullable(),group_name:To.optional(),baseline:w.array(Ro),items:w.array(Ro)}).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,a=0,o=(c,r,m)=>{for(let[x,g]of c.entries()){let P=[...m,x];if(a++,s==="items"&&(a>1e3||r>20)){n.addIssue({code:"custom",path:P,message:"Navigation tree limit exceeded"});return}if((s==="baseline"&&g.id===null||g.id!==null&&i.has(g.id))&&n.addIssue({code:"custom",path:[...P,"id"],message:"Invalid or duplicate navigation ID"}),g.id!==null&&i.add(g.id),s==="items"){let B=Ep.safeParse({group_id:e.group_id??"new",label:g.label,href:g.href,target_type:g.target_type,enabled:g.enabled,open_in_new:g.open_in_new,nofollow:g.nofollow,role:g.role});if(!B.success)for(let z of B.error.issues)n.addIssue({code:"custom",path:[...P,...z.path.filter(te=>typeof te=="string"||typeof te=="number")],message:z.message})}o(g.children,r+1,[...P,"children"])}};o(e[s],1,[s])}}),eI=w.object({cms_bound:w.boolean(),bound_nav_keys:w.array(w.string()).optional(),analyzed_snapshot_id:w.string().nullable().optional(),cms_driven:w.boolean(),supports_groups:w.boolean(),supports_nested_groups:w.boolean(),supports_link_attributes:w.boolean(),requires_agent:w.boolean(),reasons:w.array(w.string())}),YU=w.object({data:eI}),XU=w.discriminatedUnion("action",[w.object({action:w.literal("create_group"),values:yp}).strict(),w.object({action:w.literal("update_group"),id:be,values:QR}).strict(),w.object({action:w.literal("delete_group"),id:be}).strict(),w.object({action:w.literal("set_default_group"),group_id:be}).strict(),w.object({action:w.literal("create_item"),values:Ep}).strict(),w.object({action:w.literal("update_item"),id:be,values:ZR}).strict(),w.object({action:w.literal("delete_item"),id:be,cascade:w.boolean().optional()}).strict(),w.object({action:w.literal("move_item"),id:be,values:JR}).strict()]);import{z as le}from"zod";var Ao=le.enum(["products","cases","guides","documents","company"]),tI=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(),nI=le.discriminatedUnion("status",[le.object({collection:Ao,status:le.literal("processing")}).strict(),le.object({collection:Ao,status:le.enum(["imported","partial","failed"]),imported:yt,exception:yt}).strict()]),Rp=le.enum(["legacy_domain_not_routed","site_context_missing","site_rules_limit_exceeded","site_rules_not_served"]),sI=le.enum(["target_page_unpublished","redirect_target_missing","redirect_write_failed",...Rp.options]),iI=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:Rp.nullable(),same_path:yt,active:yt,exception:yt,exceptions:le.array(le.object({path:le.string().regex(/^\/[^?#]*$/),reason_code:sI}))})]),JU=le.object({overall_status:le.enum(["moving","completed","disabled","failed"]),by_collection:le.array(nI),media:le.object({image:yt,video:yt,audio:yt,file:yt}),exceptions:le.array(le.object({collection:Ao.nullable(),path:le.string().regex(/^\/[^?#]*$/),reason_code:tI})),redirects:iI.nullable().optional()});var Co=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()}),wo=t.enum(["material","reference","brief","industry"]),aI=t.object({market:t.object({value:t.string().min(1).max(200),source:wo}),customer:t.object({value:t.string().min(1).max(200),source:wo}),purpose:t.object({options:t.array(t.string().min(1).max(60)).min(2).max(4),selected:t.string().min(1).max(60),source:wo})}),oI=t.enum(["text-options","motion-slider","positioning"]),vo=t.enum(["none","subtle","moderate","expressive"]),rI=t.enum(["compact","comfortable","airy","editorial"]),cI=vo,Pp=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()}),mI=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:Co.optional(),conversionHints:Mt.optional()}),lI=t.object({id:t.string(),type:oI,question:t.string(),tag:t.string(),aiThinking:t.string(),options:t.array(mI),source:t.enum(["ai-detected","always-ask"]),sourceDetail:t.string(),positioning:aI.optional()}),Do=t.object({questions:t.array(lI).min(1).max(6)}),wF=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(us).max(120),conflicts:t.array(_s).max(20),reference:gs.optional(),sources:t.array(t.object({type:ki,title:t.string().max(120).optional(),status:Ai})).max(16).optional()}).optional()}),Cp=t.enum(["model_schema_invalid","provider_rate_limited","provider_unavailable","aborted","unknown"]),PF=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(Pp).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:Cp.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)})]),CF="SITE_PLANNING_INPUT_FROZEN",vF="SITE_PLANNING_LOCKED",DF="SITE_STRUCTURE_CONFIRMATION_REQUIRED",OF="SITE_STRUCTURE_CONFIRMATION_STALE",NF="SITE_SITEMAP_DRAFT_STALE",jF="SITE_SITEMAP_DRAFT_OPERATION_MISMATCH",Ip="SITE_STRUCTURE_INVALID",LF=t.object({tenant_id:t.string().min(1),name:t.string().min(1).max(120),brief:t.string().min(20).max(1e3)}),MF=t.object({name:t.string().min(1).max(120),brief:t.string().min(20).max(1e3)}),UF=t.object({name:t.string().min(1).max(120)}),FF=t.object({name:t.string().min(1).max(120),default_locale:Ie.optional()}),GF=t.object({body:t.string().min(20).max(1e3)}),qF=t.object({body:t.string().min(20).max(1e3)}),Oo=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"}),WF=t.object({tenant_id:t.string().min(1),site_id:k.optional(),site_url:Oo.optional(),site_name:t.string().trim().min(1).max(255).optional()}),BF=M(Or),KF=M(Nr),zF=M(jr),HF=M(Yr),$F=M(Xr),VF=M(Qr),YF=M(Jr),XF=M(ec),QF=M(tc),ZF=M(t.object({site_id:k,site_url:Oo.nullable()})),jt=t.object({id:k,tenant_id:t.string().min(1),name:t.string().min(1),slug:t.string().min(1),status:oa,deployment_status:ra,archived_at:t.string().min(1).nullable(),current_sitemap_id:ke.nullable(),confirmed_sitemap_id:ke.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:bs.nullable().optional(),cms_site_url:Oo.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)}),No=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)}),JF=t.object({site:jt,brief:No,next_step:t.literal("clarify")}),eG=t.object({site:jt,brief:No}),tG=t.object({brief:No}),pI=t.enum(["queued","running","succeeded","failed","cancelled"]),vp=t.enum(["clarify","sitemap","workspace"]),Dp=t.enum(["clarify","sitemap","initial_generation","iteration","landing_page","fill_in"]),Op=t.enum(["clarify","sitemap","workspace","summarize"]),nt=t.object({id:$,tenant_id:t.string().min(1),site_id:k,agent_type:vp,run_kind:Dp,status:pI,model_route:Op,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()}),nG=t.object({agent_run:nt}).strict(),dI=t.enum(["workspace","landing_page","external"]),uI=t.enum(["user","background"]),Np=t.enum(["active","archived"]),yi=t.object({id:st,tenant_id:t.string().min(1),site_id:k,kind:dI,origin:uI,subject_key:t.string().min(1).max(200),title:t.string().min(1).max(200),status:Np,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)}),sG=t.object({agent_run:nt,thread:yi.nullable()}),iG=t.object({run_id:$.optional(),site_id:k,agent_type:vp,run_kind:Dp.optional(),model_route:Op,input:t.record(t.string(),t.unknown()).optional()}).superRefine((e,n)=>{os(e.input)&&n.addIssue({code:"custom",path:["input"],message:"Agent run input must not contain secrets"})}),aG=t.object({agent_run:nt,next_step:t.literal("stream_events")}),jp=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:jp,created_at:t.string().min(1)}),oG=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()}),rG=t.object({site:jt,snapshot:xt,next_step:t.literal("workspace")}),cG=t.object({expected_manifest_hash:xt.shape.manifest_hash,manifest_hash:xt.shape.manifest_hash,object_key:xt.shape.object_key}).strict(),mG=t.union([t.object({base_snapshot_id:I.nullable(),source_run_id:$.optional(),page_template_advisories:t.array(In).optional()}).strict(),t.object({skip_base_check:t.literal(!0)}).strict()]),gI=t.object({site:jt,snapshot:xt,next_step:t.literal("workspace")}),lG=t.object({snapshot:xt}),pG=t.object({status:t.literal("deleting"),snapshot_id:I,object_key:t.string().min(1)}),dG=t.object({status:t.literal("deleted"),snapshot_id:I}),xi=t.object({id:Vo,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)}),_I=xi.extend({reason:xt.shape.reason,status:jp}),uG=t.object({accepted_commit:t.string().min(1),source_run_id:$.optional()}),gG=t.object({site_version:xi,next_step:t.literal("workspace")}),_G=t.object({owner_id:t.string().min(1)}).strict(),hG=t.discriminatedUnion("acquired",[t.object({acquired:t.literal(!0)}).strict(),t.object({acquired:t.literal(!1)}).strict()]),SG=t.object({owner_id:t.string().min(1)}).strict(),fG=t.object({released:t.literal(!0)}).strict(),bG="TEMPLATE_UPGRADE_LOCK_LOST",yG=t.object({base_snapshot_id:I,accepted_commit:xi.shape.accepted_commit,owner_id:t.string().min(1)}).strict(),xG=gI.strict(),EG=t.object({site_versions:t.array(_I)}),RG=t.object({site:jt,snapshot:xt,site_version:xi,next_step:t.literal("workspace")}),IG=t.object({snapshot_id:I,force_rehydrate:t.boolean().optional(),recovery_required:t.boolean().optional(),required_cms_site_id:bs.optional()}),hI=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:Oi.optional()})]),TG=t.object({tenant_id:t.string().min(1),site_id:k,snapshot_id:I,cms_site_id:bs.optional()}).strict(),kG=hI,jo=t.enum(Xt),Lp=t.enum(["quality_check","publish"]),Ot=t.object({id:lt,tenant_id:t.string().min(1),site_id:k,snapshot_id:I,type:Lp.default("publish"),version:t.number().int().positive(),status:jo,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)}),AG=t.object({tenant_id:t.string().min(1),site_id:k,expected_snapshot_id:I}).strict(),wG=t.object({deployment:Ot}),PG=t.object({tenant_id:t.string().min(1),site_id:k,deployment_id:lt}).strict(),CG=t.object({deployment:Ot}),vG=t.object({}).strict(),DG=t.object({snapshot_id:I.optional()}).strict(),SI=t.object({deployment:Ot}),OG=M(SI),NG=t.object({deployment:Ot.nullable()}),jG=t.object({deployment:Ot}),Tp=t.object({id:lt,type:Lp.default("publish"),status:jo,url:t.string().url().nullable(),error_code:t.string().min(1).nullable(),provider_deployment_id:t.string().min(1).nullable()}),fI=t.object({current:Tp.nullable(),latest_released:Tp.nullable()}),LG=M(fI),bI=t.enum(["deployment.snapshot","deployment.status.changed","deployment.finished","deployment.failed","deployment.realtime.recovered","server.error"]),Sn=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)}),Si=t.object({deployment:Ot,steps:Wc.default([])}),MG=t.discriminatedUnion("type",[Sn.extend({type:t.literal("deployment.snapshot"),payload:Si}),Sn.extend({type:t.literal("deployment.status.changed"),payload:Si}),Sn.extend({type:t.literal("deployment.finished"),payload:Si}),Sn.extend({type:t.literal("deployment.failed"),payload:Si}),Sn.extend({type:t.literal("deployment.realtime.recovered"),payload:t.object({action:t.literal("refresh")})}),Sn.extend({type:t.literal("server.error"),payload:t.object({code:t.string().min(1),message:t.string().min(1),retryable:t.boolean()})})]),UG=t.object({tenant_id:t.string().min(1),site_id:k,deployment_id:lt,status:jo,updated_at:t.string().min(1)}),yI="vcp:deployments",FG={path:"/v1/sites/:site_id/deployments/:deployment_id/socket",redis_channel:yI,outbound_message_schema:"DeploymentWsServerMessageSchema",message_types:[...bI.options]},xI=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)})}),GG=t.object({error:xI.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})})}),qG=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({})}),EI=t.object({theme_id:t.string().min(1),paletteIntent:t.string().min(1),tone:t.string().min(1),mediaMood:t.string().min(1),motionLevel:vo.optional(),userVisualHints:Co.optional()}),RI=t.object({key:t.string().min(1).max(64).optional(),question:t.string().min(1),answer:t.string().min(1)}),WG=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)}),BG=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()}),II=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()}),KG=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:II.optional()}),TI=t.enum(["system_recommended","user_picked","user_picked_extended","deterministic_fallback"]),fn=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:TI.default("system_recommended")}),ie=t.string().min(1).max(2e3),kp=t.string().min(1).max(120),hi=t.object({visualDirection:ie,brandFeeling:ie,paletteIntent:ie,typographyIntent:ie,density:rI,motionLevel:cI,motionPreset:t.enum(["subtle","moderate","expressive"]).optional(),mediaStrategy:ie,compositionRules:t.array(ie).max(20),avoidPatterns:t.array(ie).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()}),Lo=160,Mp=t.object({routeGoal:ie,narrativeArc:ie,firstViewportIntent:ie,visualContinuity:ie,sectionRhythm:ie,avoidPatterns:t.array(ie).max(20),displayTitle:t.string().min(1).max(40).optional(),displayDescription:t.string().min(1).max(Lo).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()}),Up=t.enum(["model_call","validation","repair","preview","worker_group"]),Nt=t.enum(["generating","generating_design_plan","checking_quality","updating_design_memory"]),Fp=t.object({sectionRole:ie,contentIntent:ie,layoutIntent:ie,visualIntent:ie,mediaIntent:ie,motionIntent:ie,interaction:ds.optional(),copyTone:ie,displayTitle:t.string().min(1).max(40).optional(),displayDescription:t.string().min(1).max(Lo).optional(),ctaIntent:ie.optional(),continuityWithPrevious:ie.optional(),avoidRepeating:t.array(ie).max(20).optional(),industryRecipeRefs:t.array(kp).max(12).optional(),templateRecipeRefs:t.array(kp).max(12).optional()}),Gp=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()}),kI=t.enum(["solid","floating"]),AI=t.enum(["background","card","primary","frosted"]),wI=t.enum(["sticky","hide-on-scroll","static"]),PI=t.enum(["bar","island"]),CI=t.object({variant:kI,surface:AI.optional(),behavior:wI.optional(),shape:PI.optional()}),vI=t.object({form:ie,layoutIntent:ie,scrollBehavior:ie,shell:CI.optional(),avoidPatterns:t.array(ie).max(10).optional()}),DI=t.enum(["background","card","primary","inverse"]),OI=t.object({surface:DI}),NI=t.object({form:ie,composition:ie,shell:OI.optional(),avoidPatterns:t.array(ie).max(10).optional()}),jI=t.object({pattern:ie,intent:ie}),qp=t.object({header:vI,footer:NI,mobileNav:jI}),Wp=t.enum(["top","below-hero","footer","none"]),Bp=t.object({schemaVersion:t.literal(1).default(1),siteDesignContext:hi,routeCards:t.record(t.string().min(1),Mp),blockContexts:t.record(t.string().min(1),Fp),selectedSkillPacks:t.array(fn).max(3).optional(),branding:Gp.optional(),chromeDesign:qp.optional(),breadcrumbPlacement:Wp.optional()}),zG=t.object({siteDesignContext:hi.omit({imagePalette:!0}).optional(),routeCards:t.record(t.string().min(1),Mp).optional(),blockContexts:t.record(t.string().min(1),Fp.extend({interaction:ds.nullable().optional()})).optional(),branding:Gp.optional(),chromeDesign:qp.optional()}),Ge=t.string().trim().min(1),Mo=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(),Uo=t.string().regex(Nn,"Page slug must be '/' or a lowercase ASCII kebab-case absolute path."),LI=new RegExp(`^/(?:${Jt}(?:/${Jt})*)?(?:\\?[^#\\s]*)?(?:#[^\\s]*)?$`),MI=/^(?:#[^\s]*|[a-z][a-z0-9+.-]*:[^\s]+|\/\/[^\s]+)$/i,UI=t.union([t.string().regex(LI),t.string().regex(MI)]),Ap=t.object({label:t.string(),href:UI}).passthrough(),FI=t.object({primaryLinks:t.array(Ap),footerLinks:t.array(Ap)}),Kp=t.object({showInHeader:t.boolean(),showInFooter:t.boolean(),order:t.number()}).strict(),Fo=t.object({id:Ge,slug:Uo,title:t.string().trim().min(1),blocks:t.array(Mo).min(1),navigation:Kp,parent_page_id:Ge.nullable().optional()}).strict(),GI=Mo.extend({type:t.string().nullable()}).strict(),qI=Fo.extend({slug:Uo.nullable(),navigation:Kp.extend({showInHeader:t.boolean().nullable(),showInFooter:t.boolean().nullable()}).strict(),blocks:t.array(GI).min(1)}).strict(),WI=Mo.extend({id:t.string()}),BI=Fo.omit({parent_page_id:!0}).extend({id:t.string(),slug:t.string().min(1),blocks:t.array(WI).min(1),parent_page_id:t.string().nullable().optional()}),wp=t.object({label:t.string(),href:t.string().min(1)}),KI=t.object({primaryLinks:t.array(wp),footerLinks:t.array(wp)}),zI=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()]),fi=t.object({site_name:t.string().min(1).max(80).optional(),version:t.number().int().positive(),pages:t.array(Fo).min(1),navigation:FI,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:zI.optional()}),skillSelection:fn,visualTheme:EI.optional(),userChoices:t.array(RI).optional(),confirmedChoices:t.object({conversion:Mt.optional()}).optional(),seoKeywords:t.array(Pn).min(1).optional()}).strict(),bn=fi.superRefine((e,n)=>{zp(e.pages,n)}),gn=fi.extend({pages:t.array(qI).min(1)}).strict().superRefine((e,n)=>{zp(e.pages,n)}),HI=t.enum(["slug","showInHeader","showInFooter"]),$I=t.object({page_id:Ge,fields:t.array(HI).min(1).max(3)}).strict(),VI=t.object({page_id:Ge,block_id:Ge,fields:t.tuple([t.literal("type")])}).strict(),YI=100,XI=500,QI=t.object({pages:t.array($I).max(YI),blocks:t.array(VI).max(XI)}).strict().superRefine((e,n)=>{let s=new Set;e.pages.forEach((a,o)=>{s.has(a.page_id)&&n.addIssue({code:"custom",path:["pages",o,"page_id"],message:`Duplicate page target '${a.page_id}'.`}),s.add(a.page_id),new Set(a.fields).size!==a.fields.length&&n.addIssue({code:"custom",path:["pages",o,"fields"],message:"Page target fields must be unique."})});let i=new Set;e.blocks.forEach((a,o)=>{let c=`${a.page_id}\0${a.block_id}`;i.has(c)&&n.addIssue({code:"custom",path:["blocks",o],message:`Duplicate block target '${a.page_id}/${a.block_id}'.`}),i.add(c)})}),HG=t.object({sitemap:gn,targets:QI,reserved_slugs:t.array(Uo).optional()}).strict(),$G=t.object({sitemap:bn}).strict();function zp(e,n){let s=new Map,i=new Map,a=new Map,o=0;e.forEach((m,x)=>{let g=s.get(m.id);if(g!==void 0?n.addIssue({code:"custom",path:["pages",x,"id"],message:`Duplicate page id '${m.id}' (first used at pages.${g}.id).`}):s.set(m.id,x),m.blocks.forEach((B,z)=>{let te=i.get(B.id);te!==void 0?n.addIssue({code:"custom",path:["pages",x,"blocks",z,"id"],message:`Duplicate block id '${B.id}' (first used at pages.${te.pageIndex}.blocks.${te.blockIndex}.id).`}):i.set(B.id,{pageIndex:x,blockIndex:z})}),m.slug===null)return;m.slug==="/"&&(o+=1);let P=a.get(m.slug);P!==void 0?n.addIssue({code:"custom",path:["pages",x,"slug"],message:`Duplicate page slug '${m.slug}' (first used at pages.${P}.slug).`}):a.set(m.slug,x)}),(o!==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:Ip}});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:Ip}});e.forEach((m,x)=>{let g=m.parent_page_id??null;if(g===null)return;let P=["pages",x,"parent_page_id"];if(m.slug==="/"){r(P,"The home page cannot have a parent.");return}if(g===m.id){r(P,`Page '${m.id}' cannot be its own parent.`);return}let B=c.get(g);if(!B){r(P,`Parent page '${g}' does not exist.`);return}if(B.page.slug==="/"){r(P,"The home page cannot have sub pages.");return}(B.page.parent_page_id??null)!==null&&r(P,`Sitemap allows at most two levels; parent '${g}' must be a top-level page.`)})}var VG=fi.omit({skillSelection:!0,visualTheme:!0,userChoices:!0,confirmedChoices:!0,seoKeywords:!0}).extend({meta:fi.shape.meta.omit({source:!0}),site_name:t.string().min(1).max(80),pages:t.array(BI).min(1),navigation:KI}),ZI=t.enum(["ai","user"]),yn=t.object({site_id:k,page_id:Ge,edited_by:ZI.default("ai"),source_agent_run_id:$.optional()}),YG=yn.extend({block_id:Ge,target_index:t.number().int().min(0)}),JI=yn.extend({block_id:Ge}),eT=yn.extend({block_id:Ge,instruction:t.string()}),XG=yn.extend({block_id:Ge,variant:t.string().min(1).nullable()}),QG=yn.extend({block_id:Ge,props:t.record(t.string(),t.unknown()),mode:t.enum(["replace","merge"]).default("replace")}),ZG=yn.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()})}),tT=t.enum(["move_block","delete_block","update_block_instruction","change_block_variant","update_block_props","add_block"]),JG=t.discriminatedUnion("operation",[t.object({operation:t.literal("delete_block"),input:JI}).strict(),t.object({operation:t.literal("update_block_instruction"),input:eT}).strict()]),nT=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"]),sT=t.object({status:t.literal("updated"),operation:tT,site_id:k,sitemap_id:ke,version:t.number().int().positive(),changed_pages:t.array(Ge).min(1),requires_code_patch:t.literal(!0)}),iT=t.object({status:t.literal("failed"),code:nT,message:t.string().min(1),retryable:t.boolean().default(!1),details:t.unknown().optional()}),eq=t.discriminatedUnion("status",[sT,iT]),Go=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:vo.optional(),visual_tonality:Co.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()}),aT=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(),tq=t.object({source:t.object({kind:t.literal("step5_strategy")}).strict()}).strict(),oT=t.object({item_key:Ts,title:t.string().trim().min(1).max(200),selected_option_id:vn,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:ks.optional(),markets:t.array(As).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."})}),rT=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(oT).min(Rs).max(Ne),enterprise_keywords:t.array(Pn).min(1).optional()}).strict().superRefine((e,n)=>{let s=e.decisions.map(a=>a.item_key);new Set(s).size!==s.length&&n.addIssue({code:"custom",path:["decisions"],message:"Step5 sitemap decisions must use unique strategy keys."}),Cn.forEach(a=>{s.includes(a)||n.addIssue({code:"custom",path:["decisions"],message:`Step5 sitemap decisions are missing ${a}.`})});let i=Zt.filter(a=>s.includes(a));e.decisions.forEach((a,o)=>{a.item_key!==i[o]&&n.addIssue({code:"custom",path:["decisions",o,"item_key"],message:"Step5 sitemap decisions must use the canonical order."})})}),Hp=t.object({tenant_id:t.string().min(1),site_id:k,brief_id:Yt,brief:t.string().min(20).max(1e3),answers:t.array(Go).min(1).max(10),skillSelection:fn,site_default_locale:Ie.optional(),owner_locale:Ie.optional(),cms_site_id:t.string().min(1).nullish(),intent_pages:t.array(aT).max(9).optional(),reference:gs.optional(),input_context:t.object({facts:t.array(us).max(120),conflicts:t.array(_s).max(20)}).optional(),business_facts:lr.optional(),migration_products_enabled:t.boolean().optional()}),cT=Hp.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:rT}).strict(),nq=t.union([Hp,cT]),$p=t.enum(["planning","generating","validating","ready"]),mT=t.enum(["salvaged","deterministic_fallback"]),lT=t.enum(["model_exception_settled_prefix","model_exception_safe_root"]),Vp={outcome:mT.optional(),reason:lT.optional(),attempts:t.number().int().positive().optional()};function Yp(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 pT=t.discriminatedUnion("type",[t.object({type:t.literal("run.started"),runId:$,at:t.string().min(1)}),t.object({type:t.literal("sitemap.generating"),stage:$p,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:ke,sitemap:bn,...Vp,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)})]),sq=pT.superRefine(Yp),Xp=t.object({id:ke,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 Qp(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 Zp=Xp.extend({sitemap:bn}).superRefine(Qp),Jp=Xp.extend({sitemap:gn}).superRefine(Qp),iq=t.object({sitemap_id:ke,creation_key:t.string().min(1),sitemap:gn,expected_current_sitemap_id:ke,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:Jp}).strict();function oq(e){return`sitemap-user-draft:${e.site_id}:${e.expected_current_sitemap_id}:${e.expected_current_sitemap_version}:${e.sitemap_id}`}var rq=t.object({sitemap_id:ke,creation_key:t.string().min(1),sitemap:bn,source_agent_run_id:$.optional()}),cq=t.object({sitemap_id:ke,creation_key:t.string().min(1),sitemap:gn,expected_current_sitemap_id:ke,expected_current_sitemap_version:t.number().int().positive(),migration_content_requested:t.boolean().optional()}),mq=t.object({sitemap_id:ke,creation_key:t.string().min(1),sitemap:bn,source_agent_run_id:$}),lq=t.object({site:jt,sitemap:Zp,next_step:t.literal("workspace")}).strict(),pq=t.object({site:jt,sitemap:Jp,next_step:t.literal("workspace")}).strict(),dq=t.object({site:jt,sitemap:Zp,next_step:t.literal("sitemap_review")}).strict(),dT=t.object({id:$o,tenant_id:t.string().min(1),site_id:k,brief_id:Yt,questions:Do,answers:t.array(Go),selected_archetype:fn.optional(),completed_at:t.string().min(1).nullable(),created_at:t.string().min(1),updated_at:t.string().min(1)}),uq=t.object({answers:t.array(Go).min(1),questions:Do,selected_archetype:fn.optional()}),gq=t.object({clarify_session:dT}),_q=t.object({questions:Do,selected_archetype:fn}),uT=t.object({id:Ri,tenant_id:t.string().min(1),site_id:k,version:t.number().int().positive(),design_plan:Bp,source_agent_run_id:$.nullable(),created_at:t.string().min(1),updated_at:t.string().min(1)}),hq=t.object({design_plan_id:Ri.optional(),design_plan:Bp,source_agent_run_id:$.optional()}),Sq=t.object({design_plan:uT}),Ei=t.enum(["initial_generation","iteration","landing_page","fill_in"]),gT=t.object({label:t.string().min(1).max(48),prompt:t.string().min(1).max(160)}).strict(),_T=t.enum(["model","derived","mixed","advisor"]),ed=t.object({suggestions:t.array(gT).min(1).max(4),source:_T}).strict(),hT=t.enum(["clean","salvaged","deterministic_fallback","baseline_retained"]),ST=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"]),fT=t.enum(["progress","assistant_final"]),td=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"]),bT=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"]),qo=t.enum(["style_media","chrome","sections","layout","pages","detect_typecheck","repair","finalize","sitemap_resync","preview"]),Wo=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=>gd(e),{message:"Snapshot file paths must be safe relative POSIX paths without traversal."}),Bo=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)}),Ko=t.object({group_id:t.string().min(1),phase:qo,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)}),yT=t.enum(["style","media","chrome","section","layout","page","breadcrumb"]),zo=t.object({task_id:t.string().min(1),group_id:t.string().min(1),kind:yT,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(Lo).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:Wp.optional()}).strict().optional()}),Ho=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"])}),fq=t.object({plan_id:t.string().min(1),run_kind:Ei,model_route:t.object({planner:t.literal("workspace_planner"),worker:t.literal("workspace")}),groups:t.array(Ko),tasks:t.array(zo),dependencies:t.array(Ho),expected_outputs:t.array(De),diagnostics:Bo}),bq=t.object({task_id:t.string().min(1),patch:t.unknown().optional(),snapshot_id:I.optional(),read_files:t.array(De),diagnostics:t.array(Wo),status:Vt}),nd=t.object({worker_count:t.number().int().nonnegative(),task_count:t.number().int().nonnegative(),group_count:t.number().int().nonnegative()}),sd=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()}),xT=t.object({type:t.literal("text"),text:t.string(),state:t.enum(["streaming","done"]).optional()}),ET=t.object({type:t.literal("reasoning"),text:t.string(),state:t.enum(["streaming","done"]).optional(),providerMetadata:t.record(t.string(),t.unknown()).optional()}),RT=t.object({type:t.literal("file"),mediaType:t.string().min(1),filename:t.string().min(1).optional(),url:t.string().min(1)}),IT=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()}),TT=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()}),kT=t.object({type:t.string().regex(/^data-[a-zA-Z0-9_-]+$/),id:t.string().min(1).optional(),data:t.unknown()}),AT=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()}),wT=t.object({type:t.literal("error"),errorText:t.string().min(1)}),PT=t.object({type:t.literal("step-start")}),bi=t.union([xT,ET,RT,IT,TT,kT,AT,wT,PT]),CT=t.string().min(1).max(512).refine(e=>gd(e)&&!/^[A-Za-z]:\//.test(e),{message:"Generated-code rescue paths must be safe relative POSIX paths without traversal."}),vT=t.array(CT).min(1).max(64),DT=t.array(t.string().min(1).max(120)).min(1).max(64),id=t.discriminatedUnion("outcome",[t.object({outcome:t.literal("full_success"),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"),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."),OT=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:fT.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(bi).min(1),display_text:t.string().min(1).max(4e3).optional(),in_reply_to_tool_call_id:t.string().min(1).optional(),interaction_response:Ns.optional(),at:t.string().min(1)}),t.object({type:t.literal("plan.updated"),steps:t.array(bT),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(Pp).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:$p,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:ke,sitemap:bn,...Vp,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:ke,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:da.optional(),interaction_failure:pa.optional(),at:t.string().min(1)}),t.object({type:t.literal("workspace.plan.created"),plan_id:t.string().min(1),run_kind:Ei,groups:t.array(Ko),tasks:t.array(zo),dependencies:t.array(Ho),expected_outputs:t.array(De),diagnostics:Bo,summary:nd,at:t.string().min(1)}).strict(),t.object({type:t.literal("workspace.worker.updated"),group_id:t.string().min(1),phase:qo,status:Vt,task_counts:sd,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(Wo).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:vT.optional(),degraded_page_ids:DT.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",a=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"}),a)for(let o of["degraded_block_ids","dropped_files","snapshot_id","code","diagnostics","retryable"])e[o]!==void 0&&n.addIssue({code:"custom",path:[o],message:`${o} 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 o of["degraded_block_ids","dropped_files","snapshot_id","code","message","diagnostics","retryable"])e[o]!==void 0&&n.addIssue({code:"custom",path:[o],message:`${o} is not allowed for generated_code_rescue`})}),t.object({type:t.literal("workspace.design_plan.outcome"),design_plan_outcome:hT,reason:ST,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(),ed.extend({type:t.literal("workspace.suggestions"),at:t.string().min(1)}).strict(),ur,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:Cp.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:Rn.optional(),build_verified:t.boolean().optional(),generation_ledger:An.optional(),resource_operation:id.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:Up,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)})]),ad=OT.superRefine(Yp).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,a=!!e.interaction_failure;(s?i!==a:!i&&!a)||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"})}),Po=t.object({id:Yo,tenant_id:t.string().min(1),site_id:k,agent_run_id:$,sequence:t.number().int().positive(),event_type:td,payload:ad,created_at:t.string().min(1),thread_id:st.nullable().optional()}),yq=t.object({event_type:td,payload:ad}).superRefine((e,n)=>{e.event_type!==e.payload.type&&n.addIssue({code:"custom",path:["payload","type"],message:"payload.type must match event_type"}),os(e.payload)&&n.addIssue({code:"custom",path:["payload"],message:"AgentEvent payload must not contain secrets"})}),xq=t.discriminatedUnion("status",[t.object({status:t.literal("appended"),agent_run:nt,event:Po,next_cursor:t.number().int().nonnegative()}),t.object({status:t.literal("duplicate_ignored"),agent_run:nt,event:Po,next_cursor:t.number().int().nonnegative()})]),Eq=t.object({events:t.array(Po),next_cursor:t.number().int().nonnegative().optional()}),Rq=t.object({after_sequence:t.coerce.number().int().nonnegative().default(0)}),Iq=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"})}),Tq=t.enum(["implemented","skeleton","planned"]),kq=t.enum(["GET","POST","PUT","PATCH","DELETE"]),Aq=[{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"}],wq=[{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"]}],NT=t.object({id:t.string().min(1),role:t.enum(["system","user","assistant"]),metadata:t.unknown().optional(),parts:t.array(bi).min(1)}),od=NT.extend({role:t.literal("user")}).superRefine((e,n)=>{let s=0;for(let[i,a]of e.parts.entries()){if(a.type!=="file")continue;s+=1;let o=a;ga.safeParse(o.mediaType).success||n.addIssue({code:"custom",path:["parts",i,"mediaType"],message:"Attachment mediaType must be image/png, image/jpeg or image/webp"}),(typeof o.url!="string"||_a(o.url)===null)&&n.addIssue({code:"custom",path:["parts",i,"url"],message:"Attachment url must be a workspace attachment image path"})}s>ua&&n.addIssue({code:"custom",path:["parts"],message:`A message may carry at most ${ua} attachments`})}),Pq=t.object({base_snapshot_id:I.optional(),intent:t.literal("navigation_adaptation").optional(),message:od.optional(),thread_id:st.optional(),client_run_key:t.string().min(1).max(200).optional()}).superRefine((e,n)=>{os(e.message)&&n.addIssue({code:"custom",path:["message"],message:"Workspace startup message must not contain secrets",params:{errorCode:"WORKSPACE_MESSAGE_CONTAINS_SECRET"}})}),jT=t.object({path:t.string().regex(/^\/v1\/workspace\/sites\/[^/]+\/socket$/),run_id:$,base_snapshot_id:I,run_kind:Ei}),Cq=t.object({agent_run:nt,websocket:jT,next_step:t.literal("workspace_socket")}),vq=t.object({agent_run:nt}),Dq=t.object({thread_id:st.optional()}),Oq=t.object({agent_run:nt.nullable(),thread:yi.nullable()}),Nq=t.object({status:Np.default("active")}),jq=t.object({threads:t.array(yi)}),Lq=t.object({title:t.string().trim().min(1).max(200)}).strict(),Mq=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"}),Uq=t.object({thread:yi}),Fq=t.object({agent_type:t.enum(["clarify","sitemap","workspace"]),thread_id:st.optional()}),Gq=t.object({agent_run:nt}),qq=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)}),LT=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()}),MT=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:Fn.optional(),interaction_response:Ns.optional(),selected_component:LT.optional(),intent:t.literal("navigation_adaptation").optional(),display_text:t.string().min(1).max(4e3).optional(),message:od,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()})}),wc]),UT=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(bi).min(1),display_text:t.string().min(1).max(4e3).optional(),in_reply_to_tool_call_id:t.string().min(1).optional(),interaction_response:Ns.optional()})}),pe.extend({type:t.literal("server.assistant.delta"),payload:t.object({message_id:t.string().min(1),parts:t.array(bi).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:da.optional(),interaction_failure:pa.optional()})}),pe.extend({type:t.literal("server.workspace.suggestions"),payload:ed.extend({run_id:$}).strict()}),pe.extend({type:t.literal("workspace.plan.created"),payload:t.object({plan_id:t.string().min(1),run_kind:Ei,groups:t.array(Ko),tasks:t.array(zo),dependencies:t.array(Ho),expected_outputs:t.array(De),diagnostics:Bo,summary:nd})}),pe.extend({type:t.literal("workspace.worker.updated"),payload:t.object({group_id:t.string().min(1),phase:qo,status:Vt,task_counts:sd,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(Wo).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:ke,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:Rn.optional(),build_verified:t.boolean().optional(),resource_operation:id.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:Up,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()})})]),FT=UT.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,a=!!e.payload.interaction_failure;(s?i!==a:!i&&!a)||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"})}),Wq=t.union([MT,FT]),Bq={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."]},rd=t.string().regex(/^sha256:[a-f0-9]{64}$/),GT=t.enum(["create","update","delete","str_replace"]),cd=t.enum(["sitemap_resync","smoke_test","prepare_preview"]),qT=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(),WT=t.object({path:De,operation:GT,expected_hash:rd.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(qT).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(ek(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"})}),BT=t.object({kind:t.enum(["block","page","site","chrome"]),id:t.string().min(1).max(120)}),KT=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:BT,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)}),md=t.object({site_id:k,base_snapshot_id:I,reason:t.string().min(1),patches:t.array(WT).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(KT).max(24).optional(),post_actions:t.array(cd).optional()});function ld(e,n){let s=new Set;for(let[i,a]of e.patches.entries())s.has(a.path)&&n.addIssue({code:"custom",path:["patches",i,"path"],message:`Duplicate patch path: ${a.path}`}),s.add(a.path)}var Kq=md.superRefine(ld),zq=md.omit({base_snapshot_id:!0}).extend({site_id:k.optional()}).superRefine(ld),zT=Re,HT=t.object({path:zT,operation:t.enum(["upsert","delete"]).optional()}),pd=t.enum(["sync_cms_pages","sync_cms_navigation"]),Hq=t.object({files:t.array(HT).min(1),post_actions:t.array(pd).optional()}).strict().overwrite(e=>e.post_actions?{...e,post_actions:[...new Set(e.post_actions)]}:e),$T=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"]),VT=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:rd,object_key:t.string().min(1),changed_files:t.array(De).min(1),post_actions_queued:t.array(cd),dropped_protected_files:t.array(t.string().min(1)).min(1).optional()}),YT=t.object({status:t.literal("failed"),code:$T,message:t.string().min(1),retryable:t.boolean().default(!1),details:t.unknown().optional()}),$q=t.discriminatedUnion("status",[VT,YT]),Vq=t.object({ok:t.literal(!0),post_actions:t.array(t.object({action:pd,status:t.enum(["succeeded","failed"])}).strict()).default([])}),dd=Re,XT=t.enum(["text","binary"]),ud=t.object({path:dd,kind:XT,language:t.string().min(1).nullable(),size_bytes:t.number().int().nonnegative()}),Yq=t.object({path:dd}),QT=ud.extend({kind:t.literal("text"),language:t.string().min(1),content:t.string()}),ZT=ud.extend({kind:t.literal("binary"),language:t.null(),mime_type:t.string().min(1),content_base64:t.string().min(1)}),Xq=t.union([QT,ZT]);function os(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=>os(n)):Object.entries(e).some(([n,s])=>JT(n)||os(s))}function JT(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 gd(e){let n=e.split("/");return e.length>0&&!e.startsWith("/")&&!e.includes("\\")&&n.every(s=>s!==""&&s!=="."&&s!=="..")}function ek(e){if(/^(?:src\/)?app\/\.vcp\//.test(e))return ls(e);let n=/^app\/(?:(.*)\/)?page\.(?:tsx|jsx)$/.exec(e);if(!n)return!0;let i=(n[1]??"").split("/").filter(o=>o.length>0);return i.some(o=>o.startsWith("_"))?!0:i.filter(o=>!o.startsWith("@")&&!/^\(.+\)$/.test(o)).map(o=>o.replace(/^\((?:\.|\.\.|\.\.\.)\)/,"")).filter(o=>o.length>0).every(o=>/^\[.*\]$/.test(o)||Nn.test(`/${o}`))}var _d=t.enum(["idle","creating","restoring_snapshot","installing_dependencies","starting_preview","ready","active","stopping","stopped","failed"]),tk=t.object({id:rs,tenant_id:t.string().min(1),site_id:k,sandbox_id:t.string().min(1).nullable(),status:_d,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)}),Qq=t.object({session_id:rs.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:rs.optional(),expected_ready_session_last_snapshot_id:I.optional(),status:_d,preview_url:t.string().url().optional(),launch_id:t.string().min(1).optional()}),Zq=t.object({preview_session:tk,next_step:t.literal("preview")}),Jq=t.object({failed_count:t.number().int().nonnegative()}),e2=t.object({site_id:k}),t2=t.object({status:t.enum(["cancelled","stop_requested","no_active_run"]),agent_run:nt.nullable()});export{Wm as AESTHETIC_NOTE_MAX_LENGTH,Eo as AI_IMAGE_GENERATION_MAX_QUANTITY,cy as APPLICATION_LIBRARY_ERROR_CODES,lG as AbandonSiteSnapshotResponseSchema,jE as ActiveSiteDomainDataSchema,Oq as ActiveWorkspaceRunResponseSchema,Up as ActivityKindSchema,Nt as ActivityTitleCodeSchema,hw as AdvanceSiteWorkflowRequestSchema,Cp as AgentErrorCategorySchema,Yo as AgentEventIdSchema,Po as AgentEventRecordSchema,ad as AgentEventSchema,td as AgentEventTypeSchema,fT as AgentMessageHistoryPurposeSchema,Op as AgentModelRouteSchema,bT as AgentPlanStepSchema,sG as AgentRunContextResponseSchema,$ as AgentRunIdSchema,Dp as AgentRunKindSchema,nt as AgentRunRecordSchema,pI as AgentRunStatusSchema,vp as AgentRunTypeSchema,st as AgentThreadIdSchema,dI as AgentThreadKindSchema,uI as AgentThreadOriginSchema,yi as AgentThreadRecordSchema,Np as AgentThreadStatusSchema,kT as AiSdkUiDataPartSchema,wT as AiSdkUiErrorPartSchema,RT as AiSdkUiFilePartSchema,bi as AiSdkUiMessagePartSchema,NT as AiSdkUiMessageSchema,ET as AiSdkUiReasoningPartSchema,TT as AiSdkUiSourceDocumentPartSchema,IT as AiSdkUiSourceUrlPartSchema,PT as AiSdkUiStepStartPartSchema,xT as AiSdkUiTextPartSchema,AT as AiSdkUiToolPartSchema,Tq as ApiContractStatusSchema,xI as ApiErrorEnvelopeSchema,M as ApiResponseSchema,yq as AppendAgentEventRequestSchema,xq as AppendAgentEventResponseSchema,cj as ApplicationCreateResponseSchema,uy as ApplicationLibraryApplicationSchema,mj as ApplicationLibraryApplicationsDataSchema,Ym as ApplicationLibraryErrorCodeSchema,pj as ApplicationLibraryErrorResponseSchema,lj as ApplicationLibraryTemplatesDataSchema,Qm as ApplicationTemplateCatalogDataSchema,my as ApplicationTemplateCatalogItemSchema,ry as ApplicationTemplateConsumeDataSchema,rj as ApplicationTemplateCreateRequestSchema,py as ApplicationTemplateCreateResponseSchema,ly as ApplicationTemplateCreatedApplicationSchema,ei as ApplicationTemplateDigestSchema,ny as ApplicationTemplateFieldSchema,oy as ApplicationTemplateReferenceSchema,dy as ApplicationTemplateSourceSchema,ti as ApplicationTemplateStableKeySchema,Ya as ApplicationTemplateV1Schema,$T as ApplyPatchBatchErrorCodeSchema,YT as ApplyPatchBatchFailureSchema,Kq as ApplyPatchBatchInputSchema,WT as ApplyPatchBatchPatchSchema,cd as ApplyPatchBatchPostActionSchema,$q as ApplyPatchBatchResultSchema,VT as ApplyPatchBatchSuccessSchema,zq as ApplyPatchBatchToolInputSchema,qT as ApplyPatchEditSchema,GT as ApplyPatchOperationSchema,Pp as ArchetypeProposalSchema,hk as AuditLogIdSchema,ik as AuthIdentityIdSchema,ck as AuthLoginCodeIdSchema,rk as AuthOidcStateIdSchema,ak as AuthSessionIdSchema,ok as AuthTokenIdSchema,mk as AuthWsTicketIdSchema,_x as BINDING_STATUSES,Fp as BlockGenerationContextSchema,ds as BlockInteractionSchema,WG as BlockMediaIntentSchema,Mo as BlockSchema,KS as BlockingSubsiteSchema,Gp as BrandingSchema,Yt as BriefIdSchema,No as BriefRecordSchema,lr as BusinessFactsSchema,wD as CHAT_COPY,AD as CLARIFICATION_COPY,qy as CMS_FORM_FIELD_TYPES,vm as CMS_MAIN_PRODUCTS_MAX_LENGTH,Yu as CMS_PAGE_DIRECTORY_MAX_DEPTH,Vu as CMS_PAGE_DIRECTORY_MAX_NODES,$u as CMS_PAGE_URL_MAX_LENGTH,Fr as CMS_PAGE_URL_PATH_MAX_LENGTH,$C as COMPONENT_I18N_FILE_SUFFIX,qs as COMPONENT_I18N_NAMESPACE,vd as CONVERSION_CTA_LABEL_MAX_LENGTH,Nx as CRAWLER_INTERNAL_ERROR_CODES,km as CURRENT_EDIT_ENGINE_VERSION,e2 as CancelActiveWorkspaceRunRequestSchema,t2 as CancelActiveWorkspaceRunResponseSchema,PA as CheckDesignerPageProjectionRequestSchema,CA as CheckDesignerPageProjectionResponseSchema,cg as CheckDesignerPageProjectionResultSchema,Hl as CheckSitePublishDomainDataSchema,AE as CheckSitePublishDomainRequestSchema,wE as CheckSitePublishDomainResponseSchema,qp as ChromeDesignSchema,NI as ChromeFooterDesignSchema,OI as ChromeFooterShellSchema,vI as ChromeHeaderDesignSchema,CI as ChromeHeaderShellSchema,jI as ChromeMobileNavDesignSchema,GC as ClaimStaleWorkspaceRunsResponseSchema,mI as ClarifyQuestionOptionSchema,lI as ClarifyQuestionSchema,oI as ClarifyQuestionTypeSchema,Do as ClarifyQuestionsSchema,wF as ClarifyRunInputSchema,$o as ClarifySessionIdSchema,dT as ClarifySessionRecordSchema,PF as ClarifyStreamEventSchema,fj as CmsApplicationCoreInputSchema,bj as CmsApplicationCoreResultSchema,yj as CmsApplicationSeedInputSchema,xj as CmsApplicationSeedResultSchema,Sk as CmsCollectionBindingIdSchema,xL as CmsCollectionBindingSchema,ll as CmsFormSchemaProjectionSchema,Hi as CmsManagedPageTypeSchema,XU as CmsNavigationActionSchema,YU as CmsNavigationCapabilitiesResponseSchema,eI as CmsNavigationCapabilitiesSchema,yp as CmsNavigationCreateGroupBodySchema,Ep as CmsNavigationCreateItemBodySchema,$U as CmsNavigationDefaultGroupBodySchema,Ro as CmsNavigationDraftItemSchema,XR as CmsNavigationEditorContextSchema,HU as CmsNavigationEditorResponseSchema,YR as CmsNavigationGroupSchema,bp as CmsNavigationItemSchema,JR as CmsNavigationMoveItemBodySchema,QR as CmsNavigationPatchGroupBodySchema,ZR as CmsNavigationPatchItemBodySchema,VU as CmsNavigationSaveItemsBodySchema,Io as CmsNavigationTargetTypeSchema,Zu as CmsPageDirectoryGroupSchema,qr as CmsPageDirectoryNodeSchema,Mr as CmsPageDirectorySchema,$i as CmsPageTypeSchema,qt as CmsPageUrlPathSchema,jA as CmsSeoSyncStateSchema,bs as CmsSiteIdSchema,vx as CompanyInfoSchema,UL as CompanyInfoTaskCreateRequestSchema,FL as CompanyInfoTaskCreateResponseSchema,GL as CompanyInfoTaskResponseSchema,hN as CompleteCustomerMaterialsRequestSchema,SN as CompleteDiagnosisRequestSchema,fw as CompleteQualityOnlyWorkflowRequestSchema,dG as CompleteSiteSnapshotDeletionResponseSchema,Sw as CompleteSiteWorkflowRequestSchema,fN as CompleteStrategyRequestSchema,_N as CompleteWebsiteScanRequestSchema,YC as ComponentI18nResourcesSchema,$A as ComposeDesignerPageResourceBodySchema,Ik as ComputeSnapshotEditChangesRequestSchema,Tk as ComputeSnapshotEditChangesResponseSchema,CE as ConfirmSitePublishDomainRemediationDataSchema,PE as ConfirmSitePublishDomainRemediationRequestSchema,vE as ConfirmSitePublishDomainRemediationResponseSchema,cq as ConfirmSiteStructureRequestSchema,sj as ConnectDynamicCollectionInputSchema,Pj as ConnectFormInputSchema,Mt as ConversionHintsSchema,jx as CrawlerInternalErrorCodeSchema,qL as CrawlerInternalErrorSchema,un as CrawlerTaskCodeSchema,PL as CrawlerTaskCreateRequestSchema,DL as CrawlerTaskCreateResponseSchema,Rx as CrawlerTaskFailureErrorCodeSchema,Tl as CrawlerTaskFailureStageSchema,Tx as CrawlerTaskPageSchema,CL as CrawlerTaskPagesQuerySchema,jL as CrawlerTaskPagesResponseSchema,NL as CrawlerTaskStatusResponseSchema,Ht as CrawlerTaskUuidSchema,GG as CreateAgentRunConflictResponseSchema,iG as CreateAgentRunRequestSchema,aG as CreateAgentRunResponseSchema,vG as CreateDeploymentRequestSchema,SI as CreateDeploymentResponseSchema,c0 as CreateDocumentUploadRequestSchema,Ek as CreateExternalSiteEditRequestSchema,kk as CreateExternalSiteEditResponseSchema,g0 as CreateImageUploadRequestSchema,s0 as CreateInputSourceRequestSchema,DG as CreateQualityCheckDeploymentRequestSchema,MF as CreateSiteBriefRequestSchema,JF as CreateSiteBriefResponseSchema,UF as CreateSiteDraftRequestSchema,LF as CreateSiteInputSchema,Lq as CreateSiteThreadRequestSchema,gw as CreateSiteWorkflowRequestSchema,qd as CreateTextInputSourceRequestSchema,Wd as CreateUrlInputSourceRequestSchema,NG as CurrentDeploymentResponseSchema,mN as CustomerMaterialsDraftResponseSchema,Fa as CustomerMaterialsDraftSchema,lN as CustomerMaterialsNullableResponseSchema,Ga as CustomerMaterialsRecordSchema,cN as CustomerMaterialsResponseSchema,Ub as CustomerMaterialsStatusSchema,eS as DEFAULT_FONTS,jm as DEFAULT_SITE_DESIGN_RADIUS_ID,fu as DEFAULT_SITE_LOCALE,FD as DEFAULT_SUBSITE_PALETTE,Us as DEFAULT_WEIGHT_STYLE_ID,vP as DEPLOYMENT_ACTIVE_STATUSES,kt as DEPLOYMENT_LIFECYCLE_TRANSITIONS,lh as DEPLOYMENT_PROGRESS_STEP_CODES,yI as DEPLOYMENT_REALTIME_CHANNEL,Xt as DEPLOYMENT_STATUSES,DP as DEPLOYMENT_TERMINAL_STATUSES,Vh as DEPLOYMENT_TRANSITION_ERROR_CODE,FG as DEPLOYMENT_WEBSOCKET_CONTRACT,gA as DESIGNER_COMPONENT_LIBRARY_ERROR_CODES,WA as DESIGNER_PAGE_LIBRARY_ERROR_CODES,i0 as DOCUMENT_EXTENSION_WHITELIST,a0 as DOCUMENT_MIME_WHITELIST,nE as DOMAIN_DNS_PURPOSES,aE as DOMAIN_DNS_REMEDIATION_STATUSES,sE as DOMAIN_DNS_VERIFICATION_STATUSES,Zx as DOMAIN_OBSERVED_STATUSES,eE as DOMAIN_ROUTING_MODES,vA as DeleteDesignerPageErrorDetailsSchema,TA as DeleteDesignerPageRequestSchema,kA as DeleteDesignerPageResponseSchema,og as DeleteDesignerPageResultSchema,pG as DeleteSiteSnapshotResponseSchema,lt as DeploymentIdSchema,lk as DeploymentJobIdSchema,ph as DeploymentProgressStepCodeSchema,uh as DeploymentProgressStepSchema,dh as DeploymentProgressStepStatusSchema,Wc as DeploymentProgressStepsSchema,Ot as DeploymentRecordSchema,UG as DeploymentRedisPubSubEventSchema,jo as DeploymentStatusSchema,Tp as DeploymentStatusSummarySchema,xa as DeploymentTransitionError,Lp as DeploymentTypeSchema,Si as DeploymentWsDeploymentPayloadSchema,MG as DeploymentWsServerMessageSchema,bI as DeploymentWsServerMessageTypeSchema,hT as DesignPlanGenerationOutcomeSchema,ST as DesignPlanGenerationReasonSchema,Ri as DesignPlanIdSchema,zG as DesignPlanPatchSchema,uT as DesignPlanRecordSchema,Bp as DesignPlanSchema,Fe as DesignTokenBlockError,qG as DesignTokensSchema,Hu as DesignerComponentCatalogItemSchema,Or as DesignerComponentCategoriesDataSchema,Dr as DesignerComponentCategoryNodeSchema,Gt as DesignerComponentExactVersionSchema,jr as DesignerComponentInstallDataSchema,Nr as DesignerComponentsDataSchema,ug as DesignerPageCatalogItemSchema,Yr as DesignerPageCategoriesDataSchema,Vr as DesignerPageCategoryNodeSchema,sg as DesignerPageDeleteBlockReasonSchema,ng as DesignerPageDisabledReasonSchema,On as DesignerPageExactVersionSchema,zr as DesignerPageGroupSchema,Qr as DesignerPageInstallDataSchema,Kr as DesignerPageNodeSchema,Jr as DesignerPageResourcePreparationDataSchema,dg as DesignerPageResourceSourceSchema,yg as DesignerPageResourceTemplateSchema,Wt as DesignerPageResourceTypeSchema,Xr as DesignerPagesDataSchema,qi as DesignerResourceVersionSchema,ec as DesignerSitePagesDataSchema,KA as DesignerSiteRouteIdSchema,ql as DomainConfigurationSchema,po as DomainDnsPurposeSchema,pE as DomainDnsRecordSchema,lE as DomainDnsRemediationChangeSchema,Ul as DomainDnsRemediationRecordSchema,Fl as DomainDnsRemediationResultSchema,oE as DomainDnsRemediationStatusSchema,mE as DomainDnsVerificationObservationSchema,Ml as DomainDnsVerificationResultSchema,iE as DomainDnsVerificationStatusSchema,Jx as DomainObservedStatusSchema,cE as DomainOperationErrorSchema,di as DomainOperationSchema,rE as DomainOperationStatusSchema,uo as DomainOperationTypeSchema,Gl as DomainRecordSchema,tE as DomainRoutingModeSchema,CD as EDIT_ENGINE_VERSION_HEADER,vD as EDIT_ENGINE_VERSION_SOURCE_HEADER,Rk as EMPTY_EXTERNAL_SITE_EDIT_CHANGES,ID as ERROR_COPY,bd as EXTERNAL_SITE_EDIT_INFRASTRUCTURE_REASONS,fd as EXTERNAL_SITE_EDIT_PROMPT_MAX_LENGTH,Ma as EditEngineVersionParseError,tc as EnhanceDesignerPageResourceBodySchema,QF as EnhanceDesignerPageResourceResponseSchema,Pk as ExternalSiteEditCallbackAckSchema,wk as ExternalSiteEditCallbackPayloadSchema,yd as ExternalSiteEditCallbackStatusSchema,Ti as ExternalSiteEditChangeKindSchema,nr as ExternalSiteEditChangesSchema,Rn as ExternalSiteEditDegradedReasonSchema,Lt as ExternalSiteEditExternalIdSchema,Zo as ExternalSiteEditOutcomeSchema,Pd as ExternalSiteEditPageChangeSchema,Ed as ExternalSiteEditPageTypeSchema,wd as ExternalSiteEditSectionChangeSchema,Id as ExternalSiteEditSiteWideChangeSchema,Rd as ExternalSiteEditSiteWideKindSchema,Qo as ExternalSiteEditTaskIdSchema,ms as ExternalSiteEditTaskSchema,xd as ExternalSiteEditTaskStatusSchema,WF as ExternalSyncSiteRequestSchema,ZF as ExternalSyncSiteResponseSchema,Ud as ExtractedFactKindSchema,us as ExtractedFactSchema,Va as FIELD_TYPES,DC as FILL_IN_NOT_AVAILABLE_ERROR_CODE,NC as FILL_IN_TARGET_MODIFIED_ERROR_CODE,OC as FILL_IN_TARGET_NOT_OMITTED_ERROR_CODE,tm as FONT_PAIRINGS,Ia as FONT_PAIRING_IDS,Jy as FORM_DESIGN_ERROR_CODES,Zy as FORM_DESIGN_FAILURE_STAGES,Xy as FORM_DESIGN_OPERATION_STAGES,Qy as FORM_DESIGN_OPERATION_STATUSES,si as FORM_FIELD_TYPES,tl as FORM_SCENE_CODES,nl as FORM_SCENE_UNKNOWN,fy as FORM_SHAPE_EMBEDDED,Wy as FORM_SPEC_FIELD_TYPE_TO_CMS,il as FORM_SPEC_FILE_MIN_RUNTIME_VERSION,Oy as FORM_SPEC_LOCALIZABLE_FIELD_PATHS,sl as FORM_SPEC_MULTISTEP_MIN_RUNTIME_VERSION,qj as FORM_TEMPLATE_CATEGORY_COUNTS,Gj as FORM_TEMPLATE_CATEGORY_SLUGS,Jq as FailStaleInFlightWorkspaceRunsResponseSchema,Js as FieldDeclSchema,gm as FillInTargetSchema,QL as FirecrawlBatchCreateRequestSchema,ZL as FirecrawlBatchCreatedResponseSchema,Ux as FirecrawlBatchErrorSchema,eM as FirecrawlBatchErrorsResponseSchema,Mx as FirecrawlBatchPageSchema,JL as FirecrawlBatchStatusResponseSchema,HL as FirecrawlCrawlCreateRequestSchema,$L as FirecrawlCrawlCreatedResponseSchema,VL as FirecrawlCrawlStatusResponseSchema,Cl as FirecrawlJobStatusSchema,KL as FirecrawlMapRequestSchema,zL as FirecrawlMapResponseSchema,tM as FirecrawlQueueStatusResponseSchema,YL as FirecrawlScrapeRequestSchema,XL as FirecrawlScrapeResponseSchema,DI as FooterShellSurfaceSchema,Ry as FormBlockIdSchema,ai as FormDefinitionIdSchema,$y as FormDesignAffectedFilesSchema,co as FormDesignErrorCodeSchema,eL as FormDesignErrorSchema,ul as FormDesignFailureStageSchema,de as FormDesignHashSchema,$j as FormDesignOpenResponseSchema,Vy as FormDesignOperationFingerprintInputSchema,no as FormDesignOperationIdSchema,gl as FormDesignOperationNextActionSchema,dk as FormDesignOperationRecordIdSchema,Zj as FormDesignOperationRecordSchema,mo as FormDesignOperationResponseSchema,hl as FormDesignOperationSchema,ro as FormDesignOperationStageSchema,dl as FormDesignOperationStatusSchema,Jj as FormDesignOperationTransitionRequestSchema,_l as FormDesignPreviewRefreshStatusSchema,Yj as FormDesignQueryResponseSchema,Xj as FormDesignResumeRequestSchema,Qj as FormDesignResumeResponseSchema,Yy as FormDesignSaveRequestSchema,Vj as FormDesignSaveResponseSchema,pl as FormDesignSharedImpactSchema,oo as FormDesignStandardizationSchema,xy as FormFieldDeclSchema,ns as FormFieldNameSchema,Ja as FormMetadataSchema,so as FormOptionValueSchema,Za as FormSceneSchema,by as FormShapeSchema,Iy as FormSpecBindingSchema,ky as FormSpecFieldNodeSchema,wy as FormSpecNodeSchema,Ty as FormSpecOptionSchema,Ay as FormSpecStepBreakNodeSchema,ao as FormSpecV1Schema,Wj as FormTemplateCatalogResponseSchema,ml as FormTemplateCategorySlugSchema,Fy as FormTemplateCategoryV1Schema,vt as FormTemplateTextSchema,Gy as FormTemplateV1Schema,KE as GA4_AUTHORIZATION_STATUSES,HE as GA4_AUTH_ATTEMPT_STATUSES,ZE as GA4_BINDING_REASONS,VE as GA4_BINDING_STATUSES,XE as GA4_VERIFICATION_STATUSES,Bn as GLOBAL_DESIGN_TOKENS_END,rn as GLOBAL_DESIGN_TOKENS_START,LE as GSC_AUTH_STATUSES,ME as GSC_BINDING_STATUSES,UE as GSC_PROPERTY_TYPES,cR as Ga4AccountOptionSchema,Ql as Ga4AuthAttemptSchema,$E as Ga4AuthAttemptStatusSchema,tR as Ga4AuthorizationSchema,zE as Ga4AuthorizationStatusSchema,JE as Ga4BindingReasonSchema,nR as Ga4BindingSchema,YE as Ga4BindingStatusSchema,lR as Ga4DataStreamOptionSchema,pR as Ga4DataStreamsDataSchema,TU as Ga4DataStreamsQuerySchema,IU as Ga4DataStreamsResponseSchema,oR as Ga4DeploymentSchema,iR as Ga4ModeSchema,dR as Ga4MutationSchema,rR as Ga4PropertyOptionSchema,mR as Ga4SetupResourcesDataSchema,RU as Ga4SetupResourcesQuerySchema,EU as Ga4SetupResourcesResponseSchema,Zl as Ga4StatusDataSchema,xU as Ga4StatusQuerySchema,yU as Ga4StatusResponseSchema,aR as Ga4TrackingSchema,sR as Ga4VerificationSchema,QE as Ga4VerificationStatusSchema,jR as GenerateAiImagesRequestSchema,LR as GenerateAiImagesResponseSchema,hp as GeneratedAiImageResultSchema,BM as GetActiveSiteDomainResponseSchema,jG as GetDeploymentResponseSchema,fI as GetDeploymentsStatusResponseSchema,Ak as GetExternalSiteEditResponseSchema,WM as GetSiteDomainConfigurationResponseSchema,MO as GetSiteLauncherPermissionResponseSchema,go as GetSitePublishDomainOperationDataSchema,DE as GetSitePublishDomainOperationResponseSchema,xO as GetTemplateUpgradeReportQuerySchema,EO as GetTemplateUpgradeReportResponseSchema,lU as GoogleSearchConsoleAuthStartDataSchema,mU as GoogleSearchConsoleAuthStartRequestSchema,pU as GoogleSearchConsoleAuthStartResponseSchema,aU as GoogleSearchConsoleAuthStatusSchema,oU as GoogleSearchConsoleBindingStatusSchema,rU as GoogleSearchConsolePropertyTypeSchema,cU as GoogleSearchConsoleStateSchema,uU as GoogleSearchConsoleStatusDataSchema,dU as GoogleSearchConsoleStatusInputSchema,gU as GoogleSearchConsoleStatusResponseSchema,nU as GscAuthStartDataSchema,tU as GscAuthStartRequestSchema,sU as GscAuthStartResponseSchema,_o as GscAuthStatusSchema,ho as GscBindingStatusSchema,So as GscPropertyTypeSchema,GE as GscStateInputSchema,iU as GscStateSchema,Yl as GscStatusDataSchema,qE as GscStatusResponseSchema,Ur as HOME_PAGE_URL_PATH,wI as HeaderShellBehaviorSchema,PI as HeaderShellShapeSchema,AI as HeaderShellSurfaceSchema,kI as HeaderShellVariantSchema,Sx as HomeUrlCrawlerTaskCreateRequestSchema,aa as HttpUrlSchema,l0 as IMAGE_EXTENSION_WHITELIST,p0 as IMAGE_MIME_WHITELIST,vr as INSERT_NEW_COMPONENT_CATEGORY_GROUP_KEY,$r as INSERT_NEW_PAGE_CATEGORY_GROUP_KEY,xC as INTERNAL_RUN_LEASE_OWNER_HEADER,bu as ISO_639_3_TO_SITE_LOCALE,Bd as ImageRoleSchema,od as InboundUserMessageSchema,$N as IndustryClassificationRequestSchema,VN as IndustryClassificationResultSchema,Qb as IndustryConfidenceSchema,Xm as InitializationResultSchema,Md as InputBundleStatusSchema,_s as InputConflictSchema,_0 as InputContextBundleSchema,En as InputContextSourceIdSchema,Gd as InputSourceSchema,Ai as InputSourceStatusSchema,ki as InputSourceTypeSchema,mO as InspectTemplateUpgradeStateRequestSchema,lO as InspectTemplateUpgradeStateResponseSchema,fA as InstallDesignerComponentBodySchema,zF as InstallDesignerComponentResponseSchema,zA as InstallDesignerPageBodySchema,VF as InstallDesignerPageResponseSchema,OG as InternalCreateDeploymentResponseSchema,AG as InternalEnsureSubsitePublishRequestSchema,wG as InternalEnsureSubsitePublishResponseSchema,Q as InternalEntityIdSchema,LG as InternalGetDeploymentsStatusResponseSchema,PG as InternalGetSubsitePublishStatusRequestSchema,CG as InternalGetSubsitePublishStatusResponseSchema,TG as InternalPrepareSubsitePreviewRequestSchema,kG as InternalPrepareSubsitePreviewResponseSchema,jb as KNOWLEDGE_CATEGORY_CODES,Dm as KnowledgeCategoryCodeSchema,nN as KnowledgeContextReadinessSchema,Mb as KnowledgeSourceReadinessSchema,Lb as KnowledgeSourceReadinessStatusSchema,Dl as LEGACY_FILE_MUTATION_TOOL_NAME,uu as LEGACY_SITE_LOCALE_CODES,Fq as LatestAgentRunQuerySchema,Gq as LatestAgentRunResponseSchema,Dq as LatestWorkspaceRunQuerySchema,vq as LatestWorkspaceRunResponseSchema,pM as LauncherPromptTemplateApplyRequestSchema,dM as LauncherPromptTemplateApplyResponseSchema,zx as LauncherPromptTemplateCatalogItemSchema,mM as LauncherPromptTemplateCatalogQuerySchema,lM as LauncherPromptTemplateCatalogSchema,Bx as LauncherPromptTemplateKindSchema,Kx as LauncherPromptTemplateLocaleSchema,pi as LauncherPromptTemplateTypeSchema,kb as LauncherScopeSchema,Rq as ListAgentEventsQuerySchema,Eq as ListAgentEventsResponseSchema,BF as ListDesignerComponentCategoriesResponseSchema,SA as ListDesignerComponentsQuerySchema,KF as ListDesignerComponentsResponseSchema,HF as ListDesignerPageCategoriesResponseSchema,BA as ListDesignerPagesQuerySchema,$F as ListDesignerPagesResponseSchema,XF as ListDesignerSitePagesResponseSchema,DR as ListMediaLibraryAssetsQuerySchema,OR as ListMediaLibraryAssetsResponseSchema,Iq as ListSiteAgentEventsQuerySchema,EG as ListSiteVersionsResponseSchema,RO as ListTemplateUpgradeSnapshotDeletionCandidatesQuerySchema,IO as ListTemplateUpgradeSnapshotDeletionCandidatesResponseSchema,UC as ListWorkspacePageCheckpointsResponseSchema,r0 as MAX_DOCUMENT_SOURCES_PER_SITE,o0 as MAX_DOCUMENT_UPLOAD_BYTES,u0 as MAX_IMAGE_SOURCES_PER_SITE,d0 as MAX_IMAGE_UPLOAD_BYTES,TR as MAX_NAV_LABEL_WIDTH,Xf as MAX_SUBSITE_MEDIA_REPLACEMENTS,Lw as MAX_UNBOUND_WORKSPACE_ATTACHMENTS_PER_SITE,ua as MAX_WORKSPACE_ATTACHMENTS_PER_MESSAGE,Bw as MAX_WORKSPACE_URL_CAPTURES_PER_SITE_HOUR,cp as MEDIA_LIBRARY_AUDIO_EXTENSIONS,up as MEDIA_LIBRARY_AUDIO_MIME_TYPES,mp as MEDIA_LIBRARY_DOCUMENT_EXTENSIONS,CR as MEDIA_LIBRARY_EXTENSIONS,lp as MEDIA_LIBRARY_FILE_EXTENSIONS,op as MEDIA_LIBRARY_IMAGE_EXTENSIONS,PR as MEDIA_LIBRARY_IMAGE_MAX_BYTES,pp as MEDIA_LIBRARY_IMAGE_MIME_TYPES,ap as MEDIA_LIBRARY_MAX_BYTES,vR as MEDIA_LIBRARY_MIME_TYPES,rp as MEDIA_LIBRARY_VIDEO_EXTENSIONS,dp as MEDIA_LIBRARY_VIDEO_MIME_TYPES,ZC as MIGRATION_PRODUCTS_CMS_DETAIL_PAGE_TITLE,QC as MIGRATION_PRODUCTS_DETAIL_PREFIX,tv as MIGRATION_PRODUCTS_DETAIL_VIEW_VARIANT,ev as MIGRATION_PRODUCTS_LIST_VIEW_VARIANT,MS as MIGRATION_PRODUCTS_ROUTE,St as MIGRATION_PRODUCTS_SLUG,JC as MIGRATION_PRODUCTS_VIEW_BLOCK_TYPE,yy as MODEL_DECLARABLE_FORM_FIELD_TYPES,vl as MODEL_FILE_MUTATION_TOOL_NAMES,Fb as MOTION_PRESETS,Wa as MOTION_PRESET_IDS,KG as MediaAssetSchema,II as MediaAttributionSchema,xo as MediaLibraryAssetSchema,gp as MediaLibraryFileTypeSchema,_p as MediaLibrarySourceSchema,BT as MediaRequestOwnerSchema,_k as MediaResolutionCacheIdSchema,nI as MigrationCollectionProgressSchema,Ao as MigrationCollectionSchema,JU as MigrationContentProgressSchema,tI as MigrationReasonCodeSchema,iI as MigrationRedirectProgressSchema,sI as MigrationRedirectReasonCodeSchema,Rp as MigrationRedirectSiteReasonSchema,hA as MockDesignerComponentInsertDataSchema,_A as MockDesignerComponentInsertRequestSchema,vo as MotionLevelSchema,rx as NAV_ITEMS_LOCALIZABLE_FIELD_PATHS,cx as NAV_ITEMS_MACHINE_FIELD_PATHS,sS as NEXT_FONT_DISPLAY_NAMES,ht as NEXT_FONT_REGISTRY,yu as NON_LATIN_SITE_LOCALE_CODES,lL as NavItemSchema,Oi as NextPageCodeErrorSchema,sx as PAGE_SEO_LOCALIZABLE_FIELD_PATHS,ix as PAGE_SEO_MACHINE_FIELD_PATHS,Nn as PAGE_SLUG_PATTERN,Jt as PAGE_SLUG_SEGMENT_PATTERN_SOURCE,ar as PAGE_TEMPLATE_BATCH_MAX_ITEMS,Gx as PLATFORM_FILE_MUTATION_TOOL_NAMES,hL as PLATFORM_MATERIALIZED_EXEMPTIONS,dx as PLATFORM_MATERIALIZED_FILES,ux as PLATFORM_MATERIALIZED_FILE_PATTERNS,_L as PLATFORM_MATERIALIZERS,nc as PLATFORM_OWNED_PAGE_SLUGS,xg as PLATFORM_OWNED_ROUTE_FILE_PATHS,ag as PageDirectoryReconcileFailedPageSchema,Vi as PageDirectoryReconcileResultSchema,OA as PageDirectoryReconcileStateSchema,ig as PageDirectoryReconcileStatusSchema,xx as PageDiscoveryCoverageEntrySchema,OL as PageDiscoveryCoverageReasonSchema,kl as PageDiscoveryCoverageSchema,Kp as PageNavigationSchema,Xi as PageResourceArtifactSchema,Sg as PageResourceComponentReferenceSchema,fg as PageResourceComponentSchema,_g as PageResourceDraftPageSchema,hg as PageResourceDraftSchema,Cs as PageResourceFinalRouteSchema,bg as PageResourcePageSchema,gg as PageResourcePageSelectionSchema,Zr as PageResourceRouteMappingSchema,Fo as PageSchema,cL as PageSeoDeclSchema,Uo as PageSlugSchema,mg as PageTargetKindSchema,Bi as PageTargetProjectionHashSchema,Hr as PageTargetSchema,lg as PageTargetSeoSchema,DA as PageTargetSetSchema,rr as PageTemplateBatchManifestSchema,Lk as PageTemplateCleanupRequestSchema,Fk as PageTemplateCleanupResponseSchema,ir as PageTemplateCreateItemSchema,Nk as PageTemplateCreateRequestSchema,Mk as PageTemplateCreateResponseSchema,Gk as PageTemplateErrorCodeSchema,Xe as PageTemplateIdSchema,Tn as PageTemplatePagePathSchema,jk as PageTemplatePromoteRequestSchema,Uk as PageTemplatePromoteResponseSchema,Cd as PageTemplateTaskSchema,Pa as PaletteInputsSchema,uq as PersistClarifyAnswersRequestSchema,gq as PersistClarifyAnswersResponseSchema,mq as PersistGeneratedSitemapDraftRequestSchema,dq as PersistGeneratedSitemapDraftResponseSchema,Qq as PersistPreviewSessionRequestSchema,Zq as PersistPreviewSessionResponseSchema,hq as PersistSiteDesignPlanRequestSchema,Sq as PersistSiteDesignPlanResponseSchema,pq as PersistSiteSitemapDraftResponseSchema,rq as PersistSiteSitemapRequestSchema,lq as PersistSiteSitemapResponseSchema,oG as PersistSiteSnapshotRequestSchema,rG as PersistSiteSnapshotResponseSchema,aI as PositioningPrefillSchema,wo as PositioningSourceSchema,HA as PrepareDesignerPageBodySchema,YF as PrepareDesignerPageResponseSchema,$O as PrepareSiteBuildInitialGenerationBaseRequestSchema,VO as PrepareSiteBuildInitialGenerationBaseResultSchema,cO as PrepareTemplateUpgradeStateRequestSchema,lb as PrepareTemplateUpgradeStateResponseSchema,IG as PrepareVersionPreviewRequestSchema,hI as PrepareVersionPreviewResponseSchema,Gc as ProductSearchAppConfigDraftSchema,la as ProductSearchAppSlugSchema,Ow as ProductSearchContractFixtureSchema,th as ProductSearchDraftConfigSchema,Ue as ProductSearchFieldNameSchema,J_ as ProductSearchFilterMetaSchema,da as ProductSearchInteractionRequestSchema,Ns as ProductSearchInteractionResponseSchema,Dw as ProductSearchPopularTermsReadSchema,Fc as ProductSearchPopularTermsSchema,Z_ as ProductSearchPrepareFailureReasonSchema,pa as ProductSearchPrepareFailureSchema,ah as ProductSearchRequestSchema,rh as ProductSearchResponseSchema,Fn as ProductSearchRouteIdSchema,Q_ as ProductSearchValueShapeSchema,mG as PromoteSiteSnapshotRequestSchema,gI as PromoteSiteSnapshotResponseSchema,yG as PromoteTemplateUpgradeSnapshotRequestSchema,xG as PromoteTemplateUpgradeSnapshotResponseSchema,Kl as QualityRunningStatusSchema,kD as REFUSAL_COPY,Aq as REST_API_ENDPOINTS,ax as ROOT_LAYOUT_METADATA_LOCALIZABLE_FIELD_PATHS,ox as ROOT_LAYOUT_METADATA_MACHINE_FIELD_PATHS,OE as ReconcileSitePublishDomainOperationDataSchema,NE as ReconcileSitePublishDomainOperationResponseSchema,uG as RecordSnapshotVersionRequestSchema,gG as RecordSnapshotVersionResponseSchema,bO as RecordTemplateUpgradeEventRequestSchema,yO as RecordTemplateUpgradeEventResponseSchema,pO as RecordTemplateUpgradeFailureRequestSchema,dO as RecordTemplateUpgradeFailureResponseSchema,uO as RecordTemplateUpgradeSuccessRequestSchema,gO as RecordTemplateUpgradeSuccessResponseSchema,AA as RecoverDesignerPageProjectionRequestSchema,wA as RecoverDesignerPageProjectionResponseSchema,rg as RecoverDesignerPageProjectionResultSchema,Fd as ReferencePagePatternSchema,gs as ReferenceSignalsSchema,qR as RegisterMediaResourceReferenceRequestSchema,WR as RegisterMediaResourceReferenceResponseSchema,bw as RegisterWorkflowTaskCommandRequestSchema,K_ as RegisterWorkflowTaskRequestSchema,MC as RegisterWorkspacePageCheckpointRequestSchema,SG as ReleaseTemplateUpgradeLockRequestSchema,fG as ReleaseTemplateUpgradeLockResponseSchema,Ew as ReplaceCrawlWorkflowTaskCommandRequestSchema,H_ as ReplaceCrawlWorkflowTaskRequestSchema,xw as ReplaceWorkflowTaskCommandRequestSchema,z_ as ReplaceWorkflowTaskRequestSchema,nj as ResolvedFieldSchema,Cj as ResolvedFormFieldSchema,kq as RestApiMethodSchema,RG as RestoreSiteSnapshotResponseSchema,mL as RootLayoutMetadataSchema,Mp as RouteGenerationCardSchema,qh as RuleEngineInputSchema,zh as RuleEngineScoreRecordSchema,ya as RuleScoreDimensionKeySchema,Kh as RuleScoreDimensionSchema,wn as SELECTABLE_SITE_LOCALE_CODES,XI as SITEMAP_RESOLVER_MAX_BLOCK_TARGETS,YI as SITEMAP_RESOLVER_MAX_PAGE_TARGETS,zO as SITE_BUILD_CONTEXT_FILE_PATH,HO as SITE_BUILD_CONTEXT_MAX_BYTES,D_ as SITE_BUILD_STATUSES,Dc as SITE_BUILD_STATUS_CODES,O_ as SITE_DEPLOYMENT_STATUSES,Oc as SITE_DEPLOYMENT_STATUS_CODES,qa as SITE_DESIGN_DENSITY_IDS,Kt as SITE_DESIGN_NOTES_END,on as SITE_DESIGN_NOTES_START,Nm as SITE_DESIGN_RADIUS_IDS,wv as SITE_EDIT_DURABLE_HISTORY_CAPABILITY,Fu as SITE_EDIT_MATERIALIZATION_MAX_FILE_CONTENT_BYTES,Fi as SITE_EDIT_MATERIALIZATION_MAX_FILE_COUNT,Gi as SITE_EDIT_MATERIALIZATION_MAX_TOTAL_CONTENT_BYTES,Sc as SITE_EDIT_PAGE_COMPOSITION_SCHEMA_VERSION,w1 as SITE_EDIT_PAGE_COMPOSITION_V2_CAPABILITY,Pf as SITE_EDIT_RUNTIME_CONTAINER_TAGS,Cf as SITE_EDIT_RUNTIME_TEXT_TAGS,wf as SITE_EDIT_RUNTIME_VOID_ELEMENT_TAGS,b1 as SITE_EDIT_SIGNED_MUTATION_CAPABILITY,Hd as SITE_EDIT_SOURCE_ALLOWED_APP_FILES,gr as SITE_EDIT_SOURCE_ALLOWED_DIRS,Kd as SITE_EDIT_SOURCE_ALLOWED_ROOT_FILES,zd as SITE_EDIT_SOURCE_ALLOWED_SYSTEM_FILES,Pi as SITE_EDIT_SOURCE_DELETE_CAPABILITY,$d as SITE_EDIT_TEXT_SOURCE_EXTENSIONS,zm as SITE_EXTRA_REQUIREMENT_MAX_LENGTH,pv as SITE_HAS_ACTIVE_SUBSITES_ERROR_CODE,dv as SITE_HAS_SUBSITES_ERROR_CODE,VP as SITE_LEADING_BODY_TOKEN,YP as SITE_LEADING_HEADING_TOKEN_NAMES,gu as SITE_LOCALE_CODES,rL as SITE_LOCALIZATION_STRUCTURES,CF as SITE_PLANNING_FROZEN_ERROR_CODE,vF as SITE_PLANNING_LOCKED_ERROR_CODE,jF as SITE_SITEMAP_DRAFT_OPERATION_MISMATCH_ERROR_CODE,NF as SITE_SITEMAP_DRAFT_STALE_ERROR_CODE,DF as SITE_STRUCTURE_CONFIRMATION_REQUIRED_ERROR_CODE,OF as SITE_STRUCTURE_CONFIRMATION_STALE_ERROR_CODE,Ip as SITE_STRUCTURE_INVALID_ERROR_CODE,$P as SITE_WEIGHT_TOKEN_NAMES,yb as SITE_WORKFLOW_PROGRESS_STATUSES,Eb as SITE_WORKFLOW_PROGRESS_STEP_STATUSES,N_ as SITE_WORKFLOW_STATUSES,Nc as SITE_WORKFLOW_STATUS_CODES,wq as SSE_STREAMS,Ru as STEP5_KEYWORD_CATEGORIES,Tu as STEP5_OPTIONAL_STRATEGY_KEYS,Rs as STEP5_REQUIRED_STRATEGY_COUNT,Cn as STEP5_REQUIRED_STRATEGY_KEYS,Lu as STEP5_SSE_EVENT_NAMES,Ne as STEP5_STRATEGY_COUNT,Zt as STEP5_STRATEGY_KEYS,Ir as STEP5_STRATEGY_OPTION_IDS,Um as STEP6_AI_THEME_IDS,Ba as STEP6_AI_THEME_PRESETS,Fm as STEP6_GENERATED_THEME_ID_PATTERN,Bf as SUBSITE_GLOSSARY_ENTRY_MAX_CHARS,Kf as SUBSITE_GLOSSARY_MAX_ENTRIES,ib as SUBSITE_MOUNT_PATH_PATTERN,Yf as SUBSITE_PALETTE_NOTE_MAX_CHARS,ab as SUBSITE_RESERVED_MOUNT_SEGMENTS,M0 as SUPPORTED_SITE_LOCALES,rs as SandboxSessionIdSchema,tk as SandboxSessionSchema,_d as SandboxSessionStatusSchema,qF as SaveBriefDraftRequestSchema,tG as SaveBriefDraftResponseSchema,uR as SaveGa4BindingDataSchema,kU as SaveGa4BindingRequestSchema,AU as SaveGa4BindingResponseSchema,ZN as SaveSiteExtraRequirementRequestSchema,iq as SaveSiteSitemapDraftRequestSchema,aq as SaveSiteSitemapDraftResponseSchema,MR as SearchUnsplashMediaQuerySchema,UR as SearchUnsplashMediaResponseSchema,Wp as SiteBreadcrumbPlacementSchema,Db as SiteBuildContextFileSchema,vb as SiteBuildContextPayloadSchema,Cb as SiteBuildContextProvenanceSchema,Pb as SiteBuildContextProvenanceSourceSchema,oa as SiteBuildStatusSchema,uv as SiteDeletionBlockedDetailsSchema,ra as SiteDeploymentStatusSchema,hi as SiteDesignContextSchema,rI as SiteDesignDensitySchema,cI as SiteDesignMotionLevelSchema,In as SiteEditAdvisorySchema,Ks as SiteEditBoundaryKindSchema,$S as SiteEditCapabilityConstraintSchema,zS as SiteEditCapabilityModeSchema,Bs as SiteEditCapabilityModeViewSchema,Sv as SiteEditCapabilityReadRequestSchema,kg as SiteEditClassNameSourceDiagnosticSchema,dt as SiteEditClassNameSourceRangeSchema,cc as SiteEditClassNameSourceSchema,s1 as SiteEditClassNameSourceStyleContextSchema,rc as SiteEditClassNameSourceStylesheetSchema,Zi as SiteEditClassNameSourceWriteIntentSchema,ZA as SiteEditCommandDiagnosticSchema,Ig as SiteEditCommandErrorSchema,K as SiteEditCompositionContextSchema,_e as SiteEditCompositionSelectorSchema,HS as SiteEditConstraintKindSchema,b_ as SiteEditDeletePageSourceOutputSchema,bf as SiteEditDynamicConfidenceSchema,xf as SiteEditDynamicDataBindingSchema,xm as SiteEditDynamicDataDetailSchema,Em as SiteEditDynamicDataSummarySchema,yf as SiteEditDynamicEvidenceSchema,ym as SiteEditDynamicSourceKindSchema,Sf as SiteEditDynamicSourceTypeSchema,ff as SiteEditDynamicTargetKindSchema,va as SiteEditEffectiveWriteTargetSchema,Iv as SiteEditEventSchema,Ii as SiteEditExecutionSceneSchema,$s as SiteEditExternalSourceKindSchema,r1 as SiteEditGetClassNameSourceCommandResultSchema,a1 as SiteEditGetClassNameSourceInputSchema,o1 as SiteEditGetClassNameSourceResultSchema,oD as SiteEditGetDocumentInputSchema,rD as SiteEditGetObjectEditContextInputSchema,w0 as SiteEditGetSourceFileInputSchema,A0 as SiteEditGetSourceTreeInputSchema,i1 as SiteEditGetStyleContextInputSchema,Hs as SiteEditHistoryProvenanceSchema,ZS as SiteEditHistoryReadOnlyRecoveryStatusSchema,VS as SiteEditHistoryRecoveryCodeSchema,YS as SiteEditHistoryRecoveryDiagnosticSchema,Cv as SiteEditHistoryResultSchema,Pv as SiteEditHistoryStatusModeSchema,ef as SiteEditHistoryStatusSchema,XS as SiteEditHistoryUnavailableReasonSchema,JS as SiteEditHistoryUnavailableStatusSchema,QS as SiteEditHistoryWritableStatusSchema,ED as SiteEditInitializeSessionInputSchema,h_ as SiteEditInsertNodeSpecSchema,f_ as SiteEditInsertPageResourceOutputSchema,zu as SiteEditMaterializationDataRequirementsSchema,Ku as SiteEditMaterializationEntrySchema,Bu as SiteEditMaterializationExportSchema,Wu as SiteEditMaterializationFileSchema,Cr as SiteEditMaterializationPathTemplateSchema,Ft as SiteEditMaterializationSchema,Ic as SiteEditMaterializedComponentNodeSpecSchema,__ as SiteEditMoveNodeTargetSchema,Rc as SiteEditMoveTargetSchema,jn as SiteEditMutationContextSchema,zs as SiteEditNodeCapabilitySnapshotSchema,mD as SiteEditObjectCapabilitiesSchema,pD as SiteEditObjectDetailSchema,uD as SiteEditObjectEditContextSchema,gD as SiteEditObjectStyleDetailSchema,dD as SiteEditObjectSummarySchema,K1 as SiteEditOperationCommandResultSchema,Tc as SiteEditOperationErrorCodeSchema,kc as SiteEditOperationErrorSchema,y_ as SiteEditOperationOutputSchema,S_ as SiteEditOperationParamsSchema,sa as SiteEditOperationPayloadSchema,na as SiteEditOperationRequestSchema,u_ as SiteEditOperationResultTargetSchema,tn as SiteEditOperationSelectionRefSchema,hf as SiteEditOperationSummarySchema,c_ as SiteEditOperationTargetSchema,Un as SiteEditOperationTypeSchema,Bt as SiteEditOperationValueSchema,Ef as SiteEditPageCompositionActionScopeSchema,P1 as SiteEditPageCompositionAnyVersionSchema,Hg as SiteEditPageCompositionAtomicKindSchema,Xg as SiteEditPageCompositionBoundaryModeSchema,Ug as SiteEditPageCompositionBusinessMemberSchema,Lg as SiteEditPageCompositionContainerSchema,Mn as SiteEditPageCompositionDiagnosticSchema,Ds as SiteEditPageCompositionErrorCodeSchema,gc as SiteEditPageCompositionPlacementTargetSchema,Fg as SiteEditPageCompositionPlacementUnitSchema,Kg as SiteEditPageCompositionRuntimeRefSchema,Bg as SiteEditPageCompositionSchema,zg as SiteEditPageCompositionSourceMemberKindSchema,Mg as SiteEditPageCompositionSourceMemberSchema,fc as SiteEditPageCompositionSourceRangeSchema,qg as SiteEditPageCompositionSupportedSchema,Wg as SiteEditPageCompositionUnsupportedSchema,Yg as SiteEditPageCompositionV2BusinessMemberSchema,$g as SiteEditPageCompositionV2ContainerSchema,Zg as SiteEditPageCompositionV2PlacementRelationSchema,e_ as SiteEditPageCompositionV2PlacementSchema,Qg as SiteEditPageCompositionV2PlacementUnitSchema,i_ as SiteEditPageCompositionV2Schema,Vg as SiteEditPageCompositionV2SourceMemberSchema,n_ as SiteEditPageCompositionV2SupportedSchema,s_ as SiteEditPageCompositionV2UnsupportedSchema,Jg as SiteEditPageCompositionV2WriteModeSchema,t_ as SiteEditPageCompositionVisualAnchorSchema,Gg as SiteEditPagePlacementOptionSchema,uc as SiteEditPagePlacementSchema,hc as SiteEditPageUnitResultTargetSchema,_c as SiteEditPageUnitTargetSchema,mf as SiteEditPatchPlanPatchSchema,Gv as SiteEditPatchPlanSchema,Da as SiteEditPropertiesSchema,ea as SiteEditPropertyChangeSchema,of as SiteEditPropertyCreationSchema,sf as SiteEditPropertyItemSchema,tf as SiteEditPropertyResolutionSchema,nf as SiteEditPropertySourceSchema,af as SiteEditPropertySpreadSchema,Hn as SiteEditProvenanceChainSchema,Tf as SiteEditProvenanceHopSchema,cD as SiteEditRenderDocumentSchema,zn as SiteEditRenderEntryRefSchema,Rf as SiteEditRenderEntrySchema,bm as SiteEditRenderPageCompositionSchema,gf as SiteEditRenderPageCompositionSupportedSchema,_f as SiteEditRenderPageCompositionUnsupportedSchema,uf as SiteEditRenderPagePlacementSchema,y1 as SiteEditRequiredMutationContextEnvelopeSchema,C0 as SiteEditResolveSourceLocationInputSchema,Im as SiteEditSemanticSourceSchema,lc as SiteEditSetPropsParamsSchema,B1 as SiteEditSignedOperationRequestSchema,_r as SiteEditSourceDeleteCapabilitySchema,Yd as SiteEditSourceDirectoryPathSchema,eu as SiteEditSourceFileBinaryPreviewUnavailableReasonSchema,tu as SiteEditSourceFileBinaryResponseSchema,T0 as SiteEditSourceFileKindSchema,Xd as SiteEditSourceFileListItemSchema,P0 as SiteEditSourceFileResponseSchema,Jd as SiteEditSourceFileTextResponseSchema,ta as SiteEditSourceIdentitySchema,nu as SiteEditSourceLocationRangeSchema,v0 as SiteEditSourceLocationSchema,Af as SiteEditSourceLocatorRangeSchema,ja as SiteEditSourceLocatorSchema,Re as SiteEditSourcePathSchema,g_ as SiteEditSourceSiblingMoveTargetSchema,hr as SiteEditSourceTreeNodeSchema,k0 as SiteEditSourceTreeResponseSchema,Qd as SiteEditSourceTreeTruncationReasonSchema,Zd as SiteEditSourceTreeTruncationSchema,Ec as SiteEditStyleBreakpointSchema,pc as SiteEditStyleDraftPropertySchema,lD as SiteEditStyleModelSchema,yc as SiteEditStylePropertySchema,Tm as SiteEditStyleSourceSchema,xc as SiteEditStyleStateModeSchema,Na as SiteEditTextSegmentSchema,Rm as SiteEditTextSourceSchema,If as SiteEditWriteTargetSchema,JN as SiteExtraRequirementResponseSchema,Zb as SiteExtraRequirementSchema,BC as SiteGenerationLedgerResponseSchema,k as SiteIdSchema,Ab as SiteLauncherPermissionSchema,Ie as SiteLocaleSchema,BG as SiteMediaIntentSchema,pk as SiteOperationLockIdSchema,Sb as SitePreviewActivateErrorCodeSchema,bb as SitePreviewActivateFailedSchema,fb as SitePreviewActivateReadySchema,AO as SitePreviewActivateResponseSchema,zM as SitePublishDomainCheckDataSchema,KM as SitePublishDomainCheckRequestSchema,HM as SitePublishDomainCheckResponseSchema,$M as SitePublishDomainOperationDataSchema,VM as SitePublishDomainOperationResponseSchema,YM as SitePublishDomainReconcileOperationResponseSchema,XM as SitePublishDomainRemediationConfirmRequestSchema,QM as SitePublishDomainRemediationConfirmResponseSchema,ui as SitePublishQualityTaskStatusSchema,IM as SitePublishRepairInputItemSchema,yE as SitePublishRepairResultItemSchema,zl as SitePublishRepairResultSchema,TM as SitePublishRepairTaskSnapshotSchema,Bl as SitePublishRepairTaskStatusSchema,PM as SitePublishWorkflowActiveResponseSchema,cs as SitePublishWorkflowIdSchema,EE as SitePublishWorkflowMutationDataSchema,CM as SitePublishWorkflowMutationResponseSchema,RE as SitePublishWorkflowPublishDataSchema,vM as SitePublishWorkflowPublishResponseSchema,IE as SitePublishWorkflowQualityDataSchema,DM as SitePublishWorkflowQualityResponseSchema,Dt as SitePublishWorkflowRecordSchema,wM as SitePublishWorkflowRevisionRequestSchema,uE as SitePublishWorkflowStatusSchema,gE as SitePublishWorkflowStepSchema,jt as SiteRecordSchema,uk as SiteTemplateUpgradeStateIdSchema,Nq as SiteThreadListQuerySchema,jq as SiteThreadListResponseSchema,Uq as SiteThreadResponseSchema,Vo as SiteVersionIdSchema,_I as SiteVersionListItemSchema,xi as SiteVersionRecordSchema,it as SiteWorkflowIdSchema,Tb as SiteWorkflowProgressDataSchema,OO as SiteWorkflowProgressResponseSchema,xb as SiteWorkflowProgressStatusSchema,Ib as SiteWorkflowProgressStepSchema,Rb as SiteWorkflowProgressStepStatusSchema,B_ as SiteWorkflowRecordSchema,dw as SiteWorkflowSnapshotResponseSchema,ma as SiteWorkflowSnapshotSchema,j_ as SiteWorkflowStatusSchema,Xo as SiteWorkflowTaskRefIdSchema,uw as SiteWorkflowTaskRefResponseSchema,Mc as SiteWorkflowTaskRefSchema,ZG as SitemapAddBlockInputSchema,Go as SitemapAnswerSchema,XG as SitemapChangeBlockVariantInputSchema,JI as SitemapDeleteBlockInputSchema,GI as SitemapDraftBlockSchema,qI as SitemapDraftPageSchema,Jp as SitemapDraftRecordSchema,gn as SitemapDraftSchema,ZI as SitemapEditActorSchema,nT as SitemapEditErrorCodeSchema,iT as SitemapEditFailureSchema,tT as SitemapEditOperationSchema,eq as SitemapEditResultSchema,sT as SitemapEditSuccessSchema,nq as SitemapGenerationInputSchema,mT as SitemapGenerationOutcomeSchema,lT as SitemapGenerationReasonSchema,$p as SitemapGenerationStageSchema,ke as SitemapIdSchema,aT as SitemapIntentPageSchema,VG as SitemapModelOutputSchema,BI as SitemapModelPageSchema,YG as SitemapMoveBlockInputSchema,UI as SitemapNavigationHrefSchema,Ge as SitemapNodeIdSchema,Zp as SitemapRecordSchema,HG as SitemapResolverRequestSchema,$G as SitemapResolverResponseSchema,QI as SitemapResolverTargetsSchema,Hp as SitemapRunInputSchema,bn as SitemapSchema,zI as SitemapSourceProvenanceSchema,sq as SitemapStreamEventSchema,vL as SitemapTaskCreateRequestSchema,LL as SitemapTaskCreateResponseSchema,Px as SitemapTaskFailureErrorCodeSchema,ML as SitemapTaskResponseSchema,eT as SitemapUpdateBlockInstructionInputSchema,QG as SitemapUpdateBlockPropsInputSchema,RI as SitemapUserChoiceSchema,fn as SkillSelectionSchema,TI as SkillSelectionSourceSchema,rd as SnapshotContentHashSchema,Ad as SnapshotEditChangesSchema,kd as SnapshotEditPageChangeSchema,Td as SnapshotEditSectionChangeSchema,De as SnapshotFilePathSchema,I as SnapshotIdSchema,xt as SnapshotRecordSchema,jp as SnapshotStatusSchema,KC as StartFillInRequestSchema,nG as StartFillInResponseSchema,eR as StartGa4AuthDataSchema,fU as StartGa4AuthRequestSchema,bU as StartGa4AuthResponseSchema,bo as StartGscAuthDataSchema,$l as StartGscAuthRequestSchema,Vl as StartGscAuthResponseSchema,Rw as StartSiteBuildRequestSchema,YO as StartSiteBuildResponseSchema,Ob as StartSiteBuildResultSchema,kM as StartSitePublishWorkflowRequestSchema,Pq as StartWorkspaceRunRequestSchema,Cq as StartWorkspaceRunResponseSchema,zc as Step2AiCrawlabilityAssessmentSchema,xh as Step2FinalResultDataSourceSchema,Ls as Step2FinalResultRequestSchema,pP as Step2FinalResultResponseSchema,lP as Step2FinalResultSaveResponseSchema,yh as Step2FinalResultSaveResultSchema,ha as Step2FinalResultTypeSchema,Rh as Step2FinalResultViewSchema,Kc as Step2FinalScanCardKeySchema,Sa as Step2FinalScanCardSchema,bh as Step2FinalScanResultSchema,$n as Step2KnowledgeOpaqueIdSchema,tN as Step2KnowledgeScopeSchema,Tt as Step2PageRoleSchema,gP as Step2PageSelectionRequestSchema,_P as Step2PageSelectionResponseSchema,hh as Step2SiteInitializationCrawlerErrorCodeSchema,_h as Step2SiteInitializationStatusSchema,mP as Step2SiteInitializationTaskResponseSchema,Sh as Step2SiteInitializationTaskSchema,fa as Step3AgentAnalysisSchema,Ch as Step3AnalysisFindingSchema,EP as Step3AnalysisJobResponseSchema,Yc as Step3AnalysisJobSchema,$c as Step3AnalysisJobStatusSchema,RP as Step3AnalysisLatestResponseSchema,Hc as Step3AnalysisProgressSchema,Oh as Step3AnalysisResultSchema,xP as Step3AnalysisScheduleResponseSchema,Ph as Step3AnalysisScheduleSchema,IP as Step3AnalysisSseFrameSchema,bP as Step3AnalysisStartRequestSchema,Vc as Step3AnalysisSummarySchema,wh as Step3AnalystSchema,yP as Step3AnalystsResponseSchema,wP as Step4DiagnosisResponseSchema,Is as Step5ActiveStrategyKeySchema,nA as Step5CommitStrategyRequestSchema,sA as Step5CommitStrategyResponseSchema,Nu as Step5CommittedVersionSchema,vn as Step5DecisionSelectionIdSchema,Pu as Step5EvidenceReferenceSchema,Cu as Step5GenerationStatusSchema,Du as Step5JobStatusSchema,ys as Step5KeywordCategorySchema,Iu as Step5KeywordEntryEditSchema,Pn as Step5KeywordEntrySchema,Ni as Step5KeywordLibrarySchema,z0 as Step5KeywordSearchBodySchema,xs as Step5KeywordSelectionSchema,As as Step5MarketCountrySchema,ks as Step5MarketTypeSchema,Rr as Step5OptionPresentationSchema,Li as Step5OutputLocaleSchema,ku as Step5PromotedBusinessSchema,ws as Step5PromotedBusinessesSchema,J0 as Step5RegenerateItemRequestSchema,eA as Step5SaveDecisionRequestSchema,tA as Step5SaveDecisionResponseSchema,oT as Step5SitemapDecisionSchema,cT as Step5SitemapRunInputSchema,rT as Step5SitemapSourceSchema,tq as Step5SitemapStartRequestSchema,Q0 as Step5StartStrategyRequestSchema,Z0 as Step5StartStrategyResponseSchema,vu as Step5StrategyDecisionInputSchema,Ui as Step5StrategyDecisionSchema,Mi as Step5StrategyItemSchema,Ar as Step5StrategyJobSchema,Ts as Step5StrategyKeySchema,Tr as Step5StrategyOptionIdSchema,Au as Step5StrategyOptionSchema,kr as Step5StrategyPlanSchema,ju as Step5StrategySnapshotDataSchema,aA as Step5StrategySseFrameSchema,Ou as Step5StrategyVersionSnapshotSchema,wu as Step5StructureDetailSchema,Kb as Step6AiThemeCandidateSchema,Zs as Step6ColorSeedsSchema,BN as Step6DesignAgentRecommendationsResponseSchema,LN as Step6DesignRecommendationGenerationInputSchema,Ha as Step6DesignRecommendationModelOutputSchema,zb as Step6DesignRecommendationSchema,DN as Step6DesignRecommendationsRequestSchema,ON as Step6DesignRecommendationsResponseSchema,Km as Step6DesignSelectionSchema,Bm as Step6GeneratedThemeCardSchema,Xb as Step6GptDesignRecommendationModelOutputSchema,qC as StopWorkspaceGenerationRequestSchema,WC as StopWorkspaceGenerationResponseSchema,KD as SubsiteCopyEstimateRequestSchema,zD as SubsiteCopyEstimateResponseSchema,eb as SubsiteDiffEstimateShape,LD as SubsiteGlossariesSchema,Hf as SubsiteGlossaryEntrySchema,Vs as SubsiteHexColorSchema,iO as SubsiteMountPathSchema,Jf as SubsitePageEstimateSchema,UD as SubsitePaletteLocalizationSchema,$f as SubsitePaletteModeSchema,Vf as SubsitePaletteSeedsSchema,MD as SubsiteSiteInfoSchema,VD as SubsiteSyncDiffComputeRequestSchema,YD as SubsiteSyncDiffComputeResponseSchema,nb as SubsiteSyncDiffErrorCodeSchema,XD as SubsiteSyncDiffErrorResponseSchema,eO as SubsiteVisibleTextExportRequestSchema,tO as SubsiteVisibleTextExportResponseSchema,v_ as TASK_EXECUTION_STATUSES,jc as TASK_EXECUTION_STATUS_CODES,bG as TEMPLATE_UPGRADE_LOCK_LOST_ERROR_CODE,Ka as THEME_PRESETS,Mm as THEME_PRESET_IDS,vc as TaskExecutionStatusSchema,gb as TemplateUpgradeCasOutcomeSchema,wm as TemplateUpgradeErrorCodeSchema,_b as TemplateUpgradeOutcomeCountsSchema,db as TemplateUpgradeOutcomeSchema,hb as TemplateUpgradeSnapshotDeletionCandidateSchema,ln as TemplateUpgradeStateSchema,cb as TemplateUpgradeStatusSchema,ub as TemplateUpgradeValidationStageSchema,Ze as TemplateVersionSchema,_G as TryAcquireTemplateUpgradeLockRequestSchema,hG as TryAcquireTemplateUpgradeLockResponseSchema,fS as TypeInputsSchema,Uf as USER_STOPPED_RUN_ERROR_CODES,fp as UnsplashDownloadLocationSchema,Sp as UnsplashMediaAssetSchema,GF as UpdateBriefRequestSchema,eG as UpdateBriefResponseSchema,_q as UpdateClarifyArchetypeRequestSchema,LA as UpdateCmsSeoSyncStateRequestSchema,cG as UpdateCurrentSnapshotManifestRequestSchema,NA as UpdatePageDirectoryReconcileStateRequestSchema,AM as UpdateSitePublishWorkflowStepRequestSchema,FF as UpdateSiteRequestSchema,Mq as UpdateSiteThreadRequestSchema,_w as UpdateSiteWorkflowWebsiteRequestSchema,NN as UpdateStep6DesignSelectionRequestSchema,jN as UpdateStep6DesignSelectionResponseSchema,yw as UpdateWorkflowTaskStatusRequestSchema,NR as UploadMediaLibraryAssetResponseSchema,gM as UpstreamPromptTemplateCatalogDataSchema,uM as UpstreamPromptTemplateConsumeDataSchema,fx as UrlListCrawlerTaskCreateRequestSchema,gk as UsageRecordIdSchema,FR as UseUnsplashMediaRequestSchema,GR as UseUnsplashMediaResponseSchema,sk as UserIdSchema,FE as VCP_GSC_STATES,fo as VcpGscStateSchema,hE as VcpQualityRemediationItemSchema,Wl as VcpQualityResultSchema,Co as VisualHintsSchema,EI as VisualThemeSchema,lS as WEIGHT_STYLE_IDS,sm as WEIGHT_STYLE_PRESETS,pw as WORKFLOW_DEFINITIONS_V1,ca as WORKFLOW_DEFINITION_REGISTRY,w_ as WORKFLOW_FLOW_TYPES,L_ as WORKFLOW_MENU_STATES,P_ as WORKFLOW_NODE_CODES,C_ as WORKFLOW_TASK_TYPES,Ww as WORKSPACE_ATTACHMENT_BOUND_ERROR_CODE,Yw as WORKSPACE_ATTACHMENT_CAPTURE_BUDGET_ERROR_CODE,$w as WORKSPACE_ATTACHMENT_CAPTURE_BUSY_ERROR_CODE,Hw as WORKSPACE_ATTACHMENT_CAPTURE_FAILED_ERROR_CODE,Vw as WORKSPACE_ATTACHMENT_CAPTURE_TIMEOUT_ERROR_CODE,Xw as WORKSPACE_ATTACHMENT_CAPTURE_UNAVAILABLE_ERROR_CODE,qw as WORKSPACE_ATTACHMENT_LIMIT_ERROR_CODE,ch as WORKSPACE_ATTACHMENT_MEDIA_TYPES,Uw as WORKSPACE_ATTACHMENT_TARGET_BASE64_BYTES,Gw as WORKSPACE_ATTACHMENT_TOO_LARGE_ERROR_CODE,Mw as WORKSPACE_ATTACHMENT_UNBOUND_TTL_MS,Fw as WORKSPACE_ATTACHMENT_UNSUPPORTED_FORMAT_ERROR_CODE,zw as WORKSPACE_ATTACHMENT_URL_REJECTED_ERROR_CODE,AC as WORKSPACE_CHECK_INCOMPLETE_ERROR_CODE,qx as WORKSPACE_FILE_MUTATION_TOOL_NAMES,PC as WORKSPACE_FILL_IN_INTERRUPTED_ERROR_CODE,wC as WORKSPACE_GENERATION_STOPPED_ERROR_CODE,TC as WORKSPACE_MAX_PAGE_ATTEMPTS,IC as WORKSPACE_MAX_RESUME_COUNT,RC as WORKSPACE_RUN_HEARTBEAT_INTERVAL_MS,EC as WORKSPACE_RUN_LEASE_MS,CC as WORKSPACE_RUN_LEASE_SUPERSEDED_ERROR_CODE,vC as WORKSPACE_RUN_NOT_ACTIVE_ERROR_CODE,kC as WORKSPACE_RUN_RESUME_EXHAUSTED_ERROR_CODE,Kw as WORKSPACE_URL_CAPTURE_WINDOW_MS,Bq as WORKSPACE_WEBSOCKET_CONTRACT,We as WeightStyleIdSchema,Pc as WorkflowClientCapabilitiesSchema,Lc as WorkflowDefinitionVersionSchema,nn as WorkflowFlowTypeSchema,W_ as WorkflowMenuItemSchema,M_ as WorkflowMenuStateSchema,It as WorkflowNodeCodeSchema,Cc as WorkflowTaskTypeSchema,Zw as WorkspaceAttachmentFromUrlRequestSchema,ga as WorkspaceAttachmentMediaTypeSchema,Qw as WorkspaceAttachmentSchema,MT as WorkspaceClientMessageSchema,KR as WorkspaceDesignApplyRequestSchema,zR as WorkspaceDesignApplyResponseSchema,HR as WorkspaceDesignCurrentResponseSchema,Wo as WorkspaceDiagnosticSchema,HT as WorkspaceDirectEditFileSchema,zT as WorkspaceDirectEditPathSchema,pd as WorkspaceDirectEditPostActionSchema,Hq as WorkspaceDirectEditRequestSchema,Vq as WorkspaceDirectEditResponseSchema,Bo as WorkspaceExecutionDiagnosticsSchema,fq as WorkspaceExecutionPlanSchema,ur as WorkspaceGenerationLedgerEventSchema,An as WorkspaceGenerationLedgerSchema,KT as WorkspaceMediaRequestSchema,Od as WorkspaceOmissionKindSchema,Nd as WorkspaceOmissionReasonSchema,dr as WorkspaceOmissionSchema,um as WorkspacePageCheckpointSchema,Ld as WorkspacePageOutcomeSchema,jd as WorkspacePageResultSchema,Ho as WorkspacePlanDependencySchema,nd as WorkspacePlanSummarySchema,yT as WorkspacePlanTaskKindSchema,zo as WorkspacePlanTaskSchema,R_ as WorkspaceResourceKindSchema,T_ as WorkspaceResourceNavigationSelectionSchema,wc as WorkspaceResourceOperationClientMessageSchema,id as WorkspaceResourceOperationCompletionSchema,I_ as WorkspaceResourceOperationSummarySchema,k_ as WorkspaceResourceOperationTransientInputSchema,FC as WorkspaceRunControlInputResponseSchema,jC as WorkspaceRunHeartbeatRequestSchema,LC as WorkspaceRunHeartbeatResponseSchema,Ei as WorkspaceRunKindSchema,NS as WorkspaceRunResumePrincipalSchema,LT as WorkspaceSelectedComponentSchema,FT as WorkspaceServerMessageSchema,JG as WorkspaceSitemapEditRequestSchema,jT as WorkspaceSocketDescriptorSchema,ZT as WorkspaceSourceFileBinaryResponseSchema,XT as WorkspaceSourceFileKindSchema,ud as WorkspaceSourceFileListItemSchema,Yq as WorkspaceSourceFilePathQuerySchema,Xq as WorkspaceSourceFileResponseSchema,QT as WorkspaceSourceFileTextResponseSchema,dd as WorkspaceSourcePathSchema,gT as WorkspaceSuggestionSchema,ed as WorkspaceSuggestionsSchema,_T as WorkspaceSuggestionsSourceSchema,sd as WorkspaceTaskCountsSchema,Wq as WorkspaceWebSocketMessageSchema,qq as WorkspaceWebSocketMessageTypeSchema,Ko as WorkspaceWorkerGroupSchema,qo as WorkspaceWorkerPhaseSchema,bq as WorkspaceWorkerResultSchema,Vt as WorkspaceWorkerStatusSchema,gj as applicationTemplateCatalogDataSchema,uj as applicationTemplateConsumeDataSchema,dj as applicationTemplateV1Schema,LP as assertDeploymentTransition,vU as assertFillInTargetsOmitted,ww as assertSiteBuildStatusTransition,Aw as assertTaskExecutionStatusTransition,ka as availableFontWeights,BS as breadcrumbClassName,TL as buildCmsIdentityHeaders,PU as buildE2bBrowserPreviewUrl,jM as buildFinalSitePublishQualityResult,MN as buildStep6FallbackThemeCards,UO as canEnterLauncher,FO as canPublishSite,lo as canonicalizeFormDesignJson,_M as canonicalizeLauncherPromptTemplateOperation,ac as canonicalizePageSlug,gC as checkGlobalsCssEdit,Ji as classifySiteEditPropertyName,RA as cmsPagePreviewUrlPath,cA as compareTemplateVersions,Wv as composeSiteEditRepeatInstanceKey,iL as computeFormDesignOperationFingerprint,wi as computeSiteEditCompositionKey,jg as computeSiteEditSourceIdentityKey,os as containsSensitiveData,Zk as countLedgerAccessiblePages,Jk as countLedgerProcessedPages,RR as countSitemapStructure,Tg as createSiteEditCommandFailureSchema,oc as createSiteEditCommandResultSchema,Qi as createSiteEditCommandSuccessSchema,oq as createSiteSitemapDraftCreationKey,aP as createSitemapResolverAnswerSheetSchema,FN as defaultStep6Selection,WE as deriveVcpGscState,BE as doesGscPropertyMatchDomain,AR as estimateNavLabelWidth,V_ as findWorkflowDefinition,$_ as findWorkflowDefinitionInRegistry,Ra as fontStack,nx as formDesignOperationFingerprintInput,yS as formatSiteDesignNotes,rv as generateDetailBreadcrumb,MP as getDeploymentHappyPathTransitions,NP as getDeploymentTransitionPredecessors,OP as getDeploymentTransitionTargets,nm as getFontPairing,Lm as getMotionPreset,Gm as getSiteDesignThemeRadius,vi as getSiteEditSourceDeleteProtectionReason,OM as getSitePublishRepairItems,LM as getSitePublishSafetyAssessment,xN as getThemePreset,Y_ as getWorkflowDefinition,Tw as getWorkflowNodeIndex,Bk as hasAnyBusinessFact,Kn as hasDesignTokenBlock,GD as hasLockedSeeds,sL as hashAffectedFormDesignFiles,nL as hashCmsFormSchemaProjection,oi as hashFormDesignJson,tL as hashFormSpec,fR as homeLabelForLocale,iM as isCanonicalFileMutationToolName,sc as isCanonicalPageSlug,wb as isCmsMainProductsWithinLimit,$R as isCmsNavigationHref,EA as isCmsPageSelectable,Lr as isCmsTemplateUrlPath,m0 as isConsentGranted,Yh as isDeploymentActiveStatus,jP as isDeploymentTerminalStatus,qf as isExactEditEngineVersion,xk as isExternalSiteEditInfrastructureReason,Uj as isFormSpecLocalizableFieldPath,iA as isKnownStep5SseEventName,av as isMigrationProductsPresetBlockLabel,iv as isMigrationProductsPresetPageTitle,Wx as isModelFileMutationToolName,pu as isNextPageCodeErrorCode,G0 as isNonLatinSiteLocale,ls as isPageTemplateCandidateEntryPath,SL as isPlatformMaterializedFile,rb as isReservedSubsiteMountSegment,iu as isSiteEditDesignDocumentPath,qu as isSiteEditMaterializationPathTemplate,jf as isSiteEditRuntimeContainerTag,Lf as isSiteEditRuntimeTextTag,hD as isSiteEditRuntimeVoidElementTag,D0 as isSiteEditSourceDeleteProtectedPath,su as isSiteEditSourceDirectoryPath,Sr as isSiteEditSourcePath,Ci as isSiteEditTextSourcePath,kE as isSitePublishQualityItemIssue,NM as isSitePublishRepairResultSuccessful,dL as isSiteStructureKnownFieldPath,pL as isSiteStructureLocalizableFieldPath,X0 as isStep5RequiredStrategyKey,_i as isTopLevelPage,TD as isUserStoppedRunErrorCode,kw as isWorkflowTaskTypeForNode,sM as isWorkspaceFileMutationToolName,sp as listChildPages,pf as makeSiteEditRepeatInstanceKey,yR as markAllPagesInHeader,Hj as mergeCmsFormDisplay,nv as migrationProductsCopyForLocale,sv as migrationProductsKnownCopies,bR as moreLabelForLocale,wR as navLabelCollisionKey,Ej as normalizeCmsApplicationSlug,hx as normalizeCmsPublicApiBase,cl as normalizeFormOptionLabelIdentity,is as normalizeGscDomain,or as normalizePageTemplatePagePath,gi as normalizeStructureTitle,ER as orderNavigationLinksByStructure,ip as orderSitemapPagesForDisplay,Rg as pageSlugToRouteFilePath,IA as parseCmsPageDirectory,VC as parseComponentI18nResourcesJson,gR as parseE2bPreviewProxyDomain,Wf as parseExactEditEngineVersion,y0 as parseSiteEditCompositionKey,df as parseSiteEditRepeatInstanceKey,R1 as parseSiteEditSourceIdentityKey,_a as parseWorkspaceAttachmentImagePath,zj as projectFormSpecToCmsDisplay,Kj as projectFormSpecToCmsSchema,vS as readColorScheme,Fs as readDesignTokens,lC as readGlobalsDesignValues,om as readSiteDesignNotes,eP as readWorkspaceAttachmentReferences,_R as reconcileSitemapNavigation,RL as resolveCmsPublicRuntimeBinding,tS as resolveFont,sn as resolveFontDisplayName,Bj as resolveFormTemplateText,Iw as resolvePublishedWorkflowDefinition,Yk as resolveRedisConnectionConfig,DD as resolveRequestedEditEngineVersion,Er as resolveSelectableSiteLocale,SD as resolveSiteEditRuntimeOperationSummary,F0 as resolveSiteLocaleFromIso6393,U0 as resolveSiteTextDirection,$b as resolveStep6RadiusId,Vb as resolveStep6WeightStyle,OD as resolveSystemCurrentEditEngineVersion,Tj as resolveTemplateFormScene,ZP as resolveTryOnFontWeights,X_ as selectPublishedWorkflowDefinition,h0 as selectReferenceVisualImage,sw as siteBuildStatusFromCode,rw as siteBuildStatusToCode,iw as siteDeploymentStatusFromCode,cw as siteDeploymentStatusToCode,cS as siteFontVariables,hS as siteLeadingBody,QP as siteLeadingHeadingVariables,XP as siteWeightVariables,aw as siteWorkflowStatusFromCode,mw as siteWorkflowStatusToCode,zf as splitSubsiteGlossaryEntry,Yb as step6GptVisualIdentity,nC as stripSiteDesignNotes,Bv as stripSiteEditRepeatInstanceKeys,ow as taskExecutionStatusFromCode,lw as taskExecutionStatusToCode,UN as toStep6GenerationVisualHints,ic as tryCanonicalizeAsciiPageSlug,sC as upsertSiteDesignNotes,Sm as validateComponentI18nResources,Fj as validateFormSpecIdentityTransition,IR as validateSitemapStructure,tb as validateSubsiteDiffEstimates,Jw as workspaceAttachmentImagePath,mC as writeColorScheme,cC as writeDesignTokens};
|