@json-to-office/jto 6.4.0 → 6.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +1 -1
- package/dist/client/assets/{HomePage-DgyrBIGY.js → HomePage-DdKO7Rz8.js} +4 -4
- package/dist/client/assets/{HomePage-DgyrBIGY.js.map → HomePage-DdKO7Rz8.js.map} +1 -1
- package/dist/client/assets/{JsonEditorPage-BGctWRXE.js → JsonEditorPage-CIB7kfUW.js} +3 -3
- package/dist/client/assets/{JsonEditorPage-BGctWRXE.js.map → JsonEditorPage-CIB7kfUW.js.map} +1 -1
- package/dist/client/assets/{MonacoPluginProvider-DbBCCotq.js → MonacoPluginProvider-Cql9aylS.js} +5 -5
- package/dist/client/assets/{MonacoPluginProvider-DbBCCotq.js.map → MonacoPluginProvider-Cql9aylS.js.map} +1 -1
- package/dist/client/assets/{_virtual_jto-plugin-type-libs-BpQu9aDr.js → _virtual_jto-plugin-type-libs-BJgH7I8Z.js} +32 -9
- package/dist/client/assets/{_virtual_jto-plugin-type-libs-BpQu9aDr.js.map → _virtual_jto-plugin-type-libs-BJgH7I8Z.js.map} +1 -1
- package/dist/client/assets/_virtual_jto-sandbox-runtime-BFXK15tx.js +2 -0
- package/dist/client/assets/_virtual_jto-sandbox-runtime-BFXK15tx.js.map +1 -0
- package/dist/client/assets/{editor-DnPnx_0M.js → editor-Dl0mPZWB.js} +2 -2
- package/dist/client/assets/{editor-DnPnx_0M.js.map → editor-Dl0mPZWB.js.map} +1 -1
- package/dist/client/assets/{editor-monaco-json-B_U6hHbA.js → editor-monaco-json-BWLlWM6o.js} +2 -2
- package/dist/client/assets/{editor-monaco-json-B_U6hHbA.js.map → editor-monaco-json-BWLlWM6o.js.map} +1 -1
- package/dist/client/assets/{index-2S58SOrb.js → index-1Vg-Jg2R.js} +4 -4
- package/dist/client/assets/index-1Vg-Jg2R.js.map +1 -0
- package/dist/client/assets/{index-CWzQeme_.js → index-Db2WFiF0.js} +2 -2
- package/dist/client/assets/{index-CWzQeme_.js.map → index-Db2WFiF0.js.map} +1 -1
- package/dist/client/assets/{preview-Bdmil0FT.js → preview-BXysnPth.js} +2 -2
- package/dist/client/assets/{preview-Bdmil0FT.js.map → preview-BXysnPth.js.map} +1 -1
- package/dist/client/assets/{useQualityAnalysis-B0tasjoU.js → useQualityAnalysis-Dr3UHxyN.js} +2 -2
- package/dist/client/assets/{useQualityAnalysis-B0tasjoU.js.map → useQualityAnalysis-Dr3UHxyN.js.map} +1 -1
- package/dist/client/index.html +1 -1
- package/package.json +10 -10
- package/dist/client/assets/_virtual_jto-sandbox-runtime-CySzPJ5n.js +0 -2
- package/dist/client/assets/_virtual_jto-sandbox-runtime-CySzPJ5n.js.map +0 -1
- package/dist/client/assets/index-2S58SOrb.js.map +0 -1
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const e='"use strict";(()=>{var qb=Object.create;var ps=Object.defineProperty;var Wb=Object.getOwnPropertyDescriptor;var Hb=Object.getOwnPropertyNames;var zb=Object.getPrototypeOf,Jb=Object.prototype.hasOwnProperty;var Yb=(e,t,r)=>t in e?ps(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var Qb=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),rt=(e,t)=>{for(var r in t)ps(e,r,{get:t[r],enumerable:!0})},Xb=(e,t,r,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Hb(t))!Jb.call(e,o)&&o!==r&&ps(e,o,{get:()=>t[o],enumerable:!(i=Wb(t,o))||i.enumerable});return e};var sd=(e,t,r)=>(r=e!=null?qb(zb(e)):{},Xb(t||!e||!e.__esModule?ps(r,"default",{value:e,enumerable:!0}):r,e));var R=(e,t,r)=>Yb(e,typeof t!="symbol"?t+"":t,r);var Fp=Qb((MW,yh)=>{yh.exports={}});var mp={};rt(mp,{Any:()=>Qt,Argument:()=>Po,Array:()=>Nr,AsyncIterator:()=>Rr,Awaited:()=>_r,BigInt:()=>jr,Boolean:()=>ei,Capitalize:()=>qo,Clone:()=>se,CloneRest:()=>iO,CloneType:()=>gn,Composite:()=>jo,Const:()=>Uo,Constructor:()=>kr,ConstructorParameters:()=>_o,CreateType:()=>y,Date:()=>ii,Enum:()=>Do,Exclude:()=>Vr,ExcludeFromMappedResult:()=>Jl,ExcludeFromTemplateLiteral:()=>zl,Extends:()=>Br,ExtendsCheck:()=>Mr,ExtendsFromMappedKey:()=>Hl,ExtendsFromMappedResult:()=>Wl,ExtendsResolverError:()=>Ps,ExtendsResult:()=>b,ExtendsUndefinedCheck:()=>Cn,Extract:()=>Kr,ExtractFromMappedResult:()=>Ql,ExtractFromTemplateLiteral:()=>Yl,FormatRegistry:()=>Ut,FromTypes:()=>ji,Function:()=>gt,Hint:()=>ze,Increment:()=>kO,Index:()=>Zt,IndexFromComputed:()=>Lx,IndexFromMappedKey:()=>Fl,IndexFromMappedResult:()=>Rl,IndexFromPropertyKey:()=>kl,IndexFromPropertyKeys:()=>ki,IndexPropertyKeys:()=>Qe,InstanceType:()=>Mo,Instantiate:()=>Ko,Integer:()=>Go,Intersect:()=>$e,IntersectEvaluated:()=>Lo,Intrinsic:()=>Vt,IntrinsicFromMappedKey:()=>ep,IsTemplateLiteralExpressionFinite:()=>In,IsTemplateLiteralFinite:()=>vo,Iterator:()=>Ur,JavaScriptTypeBuilder:()=>Ns,JsonTypeBuilder:()=>Ui,KeyOf:()=>Dr,KeyOfFromMappedResult:()=>Dl,KeyOfPattern:()=>ni,KeyOfPropertyEntries:()=>Fo,KeyOfPropertyKeys:()=>Ze,KeyOfPropertyKeysToRest:()=>yf,Kind:()=>g,KindGuard:()=>Yt,Literal:()=>j,Lowercase:()=>Wo,Mapped:()=>Ro,MappedFunctionReturnType:()=>df,MappedKey:()=>ZO,MappedResult:()=>q,Module:()=>Yo,Never:()=>k,Not:()=>Qo,Null:()=>oi,Number:()=>Ye,Object:()=>G,Omit:()=>tr,OmitFromMappedKey:()=>np,OmitFromMappedResult:()=>tp,Optional:()=>Ae,OptionalFromMappedResult:()=>Ul,OptionalKind:()=>Ne,Parameters:()=>Xo,Partial:()=>Gr,PartialFromMappedResult:()=>sp,PatternBoolean:()=>bs,PatternBooleanExact:()=>FO,PatternNever:()=>nf,PatternNeverExact:()=>Pl,PatternNumber:()=>vi,PatternNumberExact:()=>vr,PatternString:()=>Os,PatternStringExact:()=>Lr,Pick:()=>rr,PickFromMappedKey:()=>ap,PickFromMappedResult:()=>ip,Promise:()=>ri,Readonly:()=>Be,ReadonlyFromMappedResult:()=>jl,ReadonlyKind:()=>vt,ReadonlyOptional:()=>li,Record:()=>mi,RecordKey:()=>Zl,RecordPattern:()=>Bo,RecordValue:()=>Vo,Recursive:()=>Zo,Ref:()=>yt,RegExp:()=>ea,Required:()=>qr,RequiredFromMappedResult:()=>cp,Rest:()=>ta,ReturnType:()=>ra,SetComplement:()=>YO,SetDistinct:()=>El,SetIncludes:()=>xs,SetIntersect:()=>of,SetIntersectMany:()=>Al,SetIsSubset:()=>zO,SetUnion:()=>JO,SetUnionMany:()=>$l,String:()=>ke,Symbol:()=>ai,TModule:()=>$s,TemplateLiteral:()=>ti,TemplateLiteralExpressionGenerate:()=>Ri,TemplateLiteralFiniteError:()=>Ss,TemplateLiteralGenerate:()=>Zn,TemplateLiteralGenerateError:()=>Is,TemplateLiteralParse:()=>Qn,TemplateLiteralParseExact:()=>Xn,TemplateLiteralParserError:()=>Ao,TemplateLiteralPattern:()=>Cs,TemplateLiteralPatternError:()=>ws,TemplateLiteralSyntax:()=>Nl,TemplateLiteralToUnion:()=>wn,Transform:()=>na,TransformDecodeBuilder:()=>vs,TransformEncodeBuilder:()=>Ls,TransformKind:()=>ue,Tuple:()=>Xe,Type:()=>n,TypeBoxError:()=>$,TypeGuard:()=>d,TypeRegistry:()=>_t,Uint8Array:()=>ci,Uncapitalize:()=>Ho,Undefined:()=>si,Union:()=>K,UnionEvaluated:()=>Xt,Unknown:()=>ct,Unsafe:()=>ia,Uppercase:()=>zo,ValueGuard:()=>De,Void:()=>oa});var De={};rt(De,{HasPropertyKey:()=>ms,IsArray:()=>Ie,IsAsyncIterator:()=>hl,IsBigInt:()=>go,IsBoolean:()=>ur,IsDate:()=>zn,IsFunction:()=>gl,IsIterator:()=>yl,IsNull:()=>bl,IsNumber:()=>nt,IsObject:()=>ee,IsRegExp:()=>yo,IsString:()=>ie,IsSymbol:()=>Ol,IsUint8Array:()=>Er,IsUndefined:()=>we});function ms(e,t){return t in e}function hl(e){return ee(e)&&!Ie(e)&&!Er(e)&&Symbol.asyncIterator in e}function Ie(e){return Array.isArray(e)}function go(e){return typeof e=="bigint"}function ur(e){return typeof e=="boolean"}function zn(e){return e instanceof globalThis.Date}function gl(e){return typeof e=="function"}function yl(e){return ee(e)&&!Ie(e)&&!Er(e)&&Symbol.iterator in e}function bl(e){return e===null}function nt(e){return typeof e=="number"}function ee(e){return typeof e=="object"&&e!==null}function yo(e){return e instanceof globalThis.RegExp}function ie(e){return typeof e=="string"}function Ol(e){return typeof e=="symbol"}function Er(e){return e instanceof globalThis.Uint8Array}function we(e){return e===void 0}function Zb(e){return e.map(t=>us(t))}function eO(e){return new Date(e.getTime())}function tO(e){return new Uint8Array(e)}function rO(e){return new RegExp(e.source,e.flags)}function nO(e){let t={};for(let r of Object.getOwnPropertyNames(e))t[r]=us(e[r]);for(let r of Object.getOwnPropertySymbols(e))t[r]=us(e[r]);return t}function us(e){return Ie(e)?Zb(e):zn(e)?eO(e):Er(e)?tO(e):yo(e)?rO(e):ee(e)?nO(e):e}function se(e){return us(e)}function iO(e){return e.map(t=>gn(t))}function gn(e,t){return t===void 0?se(e):se({...t,...e})}function bo(e){return L(e)&&globalThis.Symbol.asyncIterator in e}function Oo(e){return L(e)&&globalThis.Symbol.iterator in e}function ds(e){return L(e)&&(globalThis.Object.getPrototypeOf(e)===Object.prototype||globalThis.Object.getPrototypeOf(e)===null)}function oO(e){return L(e)&&!A(e)&&fr(e.constructor)&&e.constructor.name!=="Object"}function xo(e){return e instanceof globalThis.Promise}function Ge(e){return e instanceof Date&&globalThis.Number.isFinite(e.getTime())}function xl(e){return e instanceof globalThis.Map}function Sl(e){return e instanceof globalThis.Set}function aO(e){return e instanceof globalThis.RegExp}function ht(e){return globalThis.ArrayBuffer.isView(e)}function sO(e){return e instanceof globalThis.Int8Array}function Jn(e){return e instanceof globalThis.Uint8Array}function cO(e){return e instanceof globalThis.Uint8ClampedArray}function lO(e){return e instanceof globalThis.Int16Array}function pO(e){return e instanceof globalThis.Uint16Array}function mO(e){return e instanceof globalThis.Int32Array}function uO(e){return e instanceof globalThis.Uint32Array}function dO(e){return e instanceof globalThis.Float32Array}function fO(e){return e instanceof globalThis.Float64Array}function hO(e){return e instanceof globalThis.BigInt64Array}function gO(e){return e instanceof globalThis.BigUint64Array}function E(e,t){return t in e}function L(e){return e!==null&&typeof e=="object"}function A(e){return globalThis.Array.isArray(e)&&!globalThis.ArrayBuffer.isView(e)}function ce(e){return e===void 0}function dr(e){return e===null}function Jt(e){return typeof e=="boolean"}function le(e){return typeof e=="number"}function So(e){return globalThis.Number.isInteger(e)}function $t(e){return typeof e=="bigint"}function X(e){return typeof e=="string"}function fr(e){return typeof e=="function"}function hr(e){return typeof e=="symbol"}function it(e){return $t(e)||Jt(e)||dr(e)||le(e)||X(e)||hr(e)||ce(e)}var Te;(function(e){e.InstanceMode="default",e.ExactOptionalPropertyTypes=!1,e.AllowArrayObject=!1,e.AllowNaN=!1,e.AllowNullVoid=!1;function t(s,c){return e.ExactOptionalPropertyTypes?c in s:s[c]!==void 0}e.IsExactOptionalProperty=t;function r(s){let c=L(s);return e.AllowArrayObject?c:c&&!A(s)}e.IsObjectLike=r;function i(s){return r(s)&&!(s instanceof Date)&&!(s instanceof Uint8Array)}e.IsRecordLike=i;function o(s){return e.AllowNaN?le(s):Number.isFinite(s)}e.IsNumberLike=o;function a(s){let c=ce(s);return e.AllowNullVoid?c||s===null:c}e.IsVoidLike=a})(Te||(Te={}));function yO(e){return globalThis.Object.freeze(e).map(t=>Io(t))}function bO(e){let t={};for(let r of Object.getOwnPropertyNames(e))t[r]=Io(e[r]);for(let r of Object.getOwnPropertySymbols(e))t[r]=Io(e[r]);return globalThis.Object.freeze(t)}function Io(e){return Ie(e)?yO(e):zn(e)?e:Er(e)?e:yo(e)?e:ee(e)?bO(e):e}function y(e,t){let r=t!==void 0?{...t,...e}:e;switch(Te.InstanceMode){case"freeze":return Io(r);case"clone":return se(r);default:return r}}var $=class extends Error{constructor(t){super(t)}};var Yt={};rt(Yt,{IsAny:()=>fs,IsArgument:()=>hs,IsArray:()=>Lt,IsAsyncIterator:()=>yn,IsBigInt:()=>bn,IsBoolean:()=>gr,IsComputed:()=>Nt,IsConstructor:()=>Rt,IsDate:()=>cd,IsFunction:()=>kt,IsImport:()=>OO,IsInteger:()=>Ft,IsIntersect:()=>he,IsIterator:()=>On,IsKind:()=>$r,IsKindOf:()=>U,IsLiteral:()=>Me,IsLiteralBoolean:()=>wO,IsLiteralNumber:()=>IO,IsLiteralString:()=>SO,IsLiteralValue:()=>wo,IsMappedKey:()=>ot,IsMappedResult:()=>pe,IsNever:()=>Ar,IsNot:()=>ld,IsNull:()=>Ai,IsNumber:()=>jt,IsObject:()=>xe,IsOptional:()=>Je,IsPromise:()=>xn,IsProperties:()=>xO,IsReadonly:()=>Yn,IsRecord:()=>Sn,IsRecursive:()=>CO,IsRef:()=>be,IsRegExp:()=>gs,IsSchema:()=>de,IsString:()=>yr,IsSymbol:()=>$i,IsTemplateLiteral:()=>at,IsThis:()=>pd,IsTransform:()=>z,IsTuple:()=>st,IsUint8Array:()=>md,IsUndefined:()=>br,IsUnion:()=>V,IsUnknown:()=>ud,IsUnsafe:()=>dd,IsVoid:()=>fd});var ue=Symbol.for("TypeBox.Transform"),vt=Symbol.for("TypeBox.Readonly"),Ne=Symbol.for("TypeBox.Optional"),ze=Symbol.for("TypeBox.Hint"),g=Symbol.for("TypeBox.Kind");function Yn(e){return ee(e)&&e[vt]==="Readonly"}function Je(e){return ee(e)&&e[Ne]==="Optional"}function fs(e){return U(e,"Any")}function hs(e){return U(e,"Argument")}function Lt(e){return U(e,"Array")}function yn(e){return U(e,"AsyncIterator")}function bn(e){return U(e,"BigInt")}function gr(e){return U(e,"Boolean")}function Nt(e){return U(e,"Computed")}function Rt(e){return U(e,"Constructor")}function cd(e){return U(e,"Date")}function kt(e){return U(e,"Function")}function OO(e){return U(e,"Import")}function Ft(e){return U(e,"Integer")}function xO(e){return ee(e)}function he(e){return U(e,"Intersect")}function On(e){return U(e,"Iterator")}function U(e,t){return ee(e)&&g in e&&e[g]===t}function SO(e){return Me(e)&&ie(e.const)}function IO(e){return Me(e)&&nt(e.const)}function wO(e){return Me(e)&&ur(e.const)}function wo(e){return ur(e)||nt(e)||ie(e)}function Me(e){return U(e,"Literal")}function ot(e){return U(e,"MappedKey")}function pe(e){return U(e,"MappedResult")}function Ar(e){return U(e,"Never")}function ld(e){return U(e,"Not")}function Ai(e){return U(e,"Null")}function jt(e){return U(e,"Number")}function xe(e){return U(e,"Object")}function xn(e){return U(e,"Promise")}function Sn(e){return U(e,"Record")}function CO(e){return ee(e)&&ze in e&&e[ze]==="Recursive"}function be(e){return U(e,"Ref")}function gs(e){return U(e,"RegExp")}function yr(e){return U(e,"String")}function $i(e){return U(e,"Symbol")}function at(e){return U(e,"TemplateLiteral")}function pd(e){return U(e,"This")}function z(e){return ee(e)&&ue in e}function st(e){return U(e,"Tuple")}function br(e){return U(e,"Undefined")}function V(e){return U(e,"Union")}function md(e){return U(e,"Uint8Array")}function ud(e){return U(e,"Unknown")}function dd(e){return U(e,"Unsafe")}function fd(e){return U(e,"Void")}function $r(e){return ee(e)&&g in e&&ie(e[g])}function de(e){return fs(e)||hs(e)||Lt(e)||gr(e)||bn(e)||yn(e)||Nt(e)||Rt(e)||cd(e)||kt(e)||Ft(e)||he(e)||On(e)||Me(e)||ot(e)||pe(e)||Ar(e)||ld(e)||Ai(e)||jt(e)||xe(e)||xn(e)||Sn(e)||be(e)||gs(e)||yr(e)||$i(e)||at(e)||pd(e)||st(e)||br(e)||V(e)||md(e)||ud(e)||dd(e)||fd(e)||$r(e)}var d={};rt(d,{IsAny:()=>bd,IsArgument:()=>Od,IsArray:()=>xd,IsAsyncIterator:()=>Sd,IsBigInt:()=>Id,IsBoolean:()=>wd,IsComputed:()=>Cd,IsConstructor:()=>Td,IsDate:()=>Pd,IsFunction:()=>Ed,IsImport:()=>vO,IsInteger:()=>Ad,IsIntersect:()=>$d,IsIterator:()=>vd,IsKind:()=>rf,IsKindOf:()=>_,IsLiteral:()=>To,IsLiteralBoolean:()=>LO,IsLiteralNumber:()=>Nd,IsLiteralString:()=>Ld,IsLiteralValue:()=>Rd,IsMappedKey:()=>kd,IsMappedResult:()=>Fd,IsNever:()=>jd,IsNot:()=>Ud,IsNull:()=>_d,IsNumber:()=>Dd,IsObject:()=>Md,IsOptional:()=>$O,IsPromise:()=>Bd,IsProperties:()=>ys,IsReadonly:()=>AO,IsRecord:()=>Vd,IsRecursive:()=>NO,IsRef:()=>Kd,IsRegExp:()=>Gd,IsSchema:()=>Re,IsString:()=>qd,IsSymbol:()=>Wd,IsTemplateLiteral:()=>Hd,IsThis:()=>zd,IsTransform:()=>Jd,IsTuple:()=>Yd,IsUint8Array:()=>Xd,IsUndefined:()=>Qd,IsUnion:()=>Tl,IsUnionLiteral:()=>RO,IsUnknown:()=>Zd,IsUnsafe:()=>ef,IsVoid:()=>tf,TypeGuardUnknownTypeError:()=>Il});var Il=class extends ${},TO=["Argument","Any","Array","AsyncIterator","BigInt","Boolean","Computed","Constructor","Date","Enum","Function","Integer","Intersect","Iterator","Literal","MappedKey","MappedResult","Not","Null","Number","Object","Promise","Record","Ref","RegExp","String","Symbol","TemplateLiteral","This","Tuple","Undefined","Union","Uint8Array","Unknown","Void"];function hd(e){try{return new RegExp(e),!0}catch{return!1}}function wl(e){if(!ie(e))return!1;for(let t=0;t<e.length;t++){let r=e.charCodeAt(t);if(r>=7&&r<=13||r===27||r===127)return!1}return!0}function gd(e){return Cl(e)||Re(e)}function Co(e){return we(e)||go(e)}function oe(e){return we(e)||nt(e)}function Cl(e){return we(e)||ur(e)}function re(e){return we(e)||ie(e)}function PO(e){return we(e)||ie(e)&&wl(e)&&hd(e)}function EO(e){return we(e)||ie(e)&&wl(e)}function yd(e){return we(e)||Re(e)}function AO(e){return ee(e)&&e[vt]==="Readonly"}function $O(e){return ee(e)&&e[Ne]==="Optional"}function bd(e){return _(e,"Any")&&re(e.$id)}function Od(e){return _(e,"Argument")&&nt(e.index)}function xd(e){return _(e,"Array")&&e.type==="array"&&re(e.$id)&&Re(e.items)&&oe(e.minItems)&&oe(e.maxItems)&&Cl(e.uniqueItems)&&yd(e.contains)&&oe(e.minContains)&&oe(e.maxContains)}function Sd(e){return _(e,"AsyncIterator")&&e.type==="AsyncIterator"&&re(e.$id)&&Re(e.items)}function Id(e){return _(e,"BigInt")&&e.type==="bigint"&&re(e.$id)&&Co(e.exclusiveMaximum)&&Co(e.exclusiveMinimum)&&Co(e.maximum)&&Co(e.minimum)&&Co(e.multipleOf)}function wd(e){return _(e,"Boolean")&&e.type==="boolean"&&re(e.$id)}function Cd(e){return _(e,"Computed")&&ie(e.target)&&Ie(e.parameters)&&e.parameters.every(t=>Re(t))}function Td(e){return _(e,"Constructor")&&e.type==="Constructor"&&re(e.$id)&&Ie(e.parameters)&&e.parameters.every(t=>Re(t))&&Re(e.returns)}function Pd(e){return _(e,"Date")&&e.type==="Date"&&re(e.$id)&&oe(e.exclusiveMaximumTimestamp)&&oe(e.exclusiveMinimumTimestamp)&&oe(e.maximumTimestamp)&&oe(e.minimumTimestamp)&&oe(e.multipleOfTimestamp)}function Ed(e){return _(e,"Function")&&e.type==="Function"&&re(e.$id)&&Ie(e.parameters)&&e.parameters.every(t=>Re(t))&&Re(e.returns)}function vO(e){return _(e,"Import")&&ms(e,"$defs")&&ee(e.$defs)&&ys(e.$defs)&&ms(e,"$ref")&&ie(e.$ref)&&e.$ref in e.$defs}function Ad(e){return _(e,"Integer")&&e.type==="integer"&&re(e.$id)&&oe(e.exclusiveMaximum)&&oe(e.exclusiveMinimum)&&oe(e.maximum)&&oe(e.minimum)&&oe(e.multipleOf)}function ys(e){return ee(e)&&Object.entries(e).every(([t,r])=>wl(t)&&Re(r))}function $d(e){return _(e,"Intersect")&&!(ie(e.type)&&e.type!=="object")&&Ie(e.allOf)&&e.allOf.every(t=>Re(t)&&!Jd(t))&&re(e.type)&&(Cl(e.unevaluatedProperties)||yd(e.unevaluatedProperties))&&re(e.$id)}function vd(e){return _(e,"Iterator")&&e.type==="Iterator"&&re(e.$id)&&Re(e.items)}function _(e,t){return ee(e)&&g in e&&e[g]===t}function Ld(e){return To(e)&&ie(e.const)}function Nd(e){return To(e)&&nt(e.const)}function LO(e){return To(e)&&ur(e.const)}function To(e){return _(e,"Literal")&&re(e.$id)&&Rd(e.const)}function Rd(e){return ur(e)||nt(e)||ie(e)}function kd(e){return _(e,"MappedKey")&&Ie(e.keys)&&e.keys.every(t=>nt(t)||ie(t))}function Fd(e){return _(e,"MappedResult")&&ys(e.properties)}function jd(e){return _(e,"Never")&&ee(e.not)&&Object.getOwnPropertyNames(e.not).length===0}function Ud(e){return _(e,"Not")&&Re(e.not)}function _d(e){return _(e,"Null")&&e.type==="null"&&re(e.$id)}function Dd(e){return _(e,"Number")&&e.type==="number"&&re(e.$id)&&oe(e.exclusiveMaximum)&&oe(e.exclusiveMinimum)&&oe(e.maximum)&&oe(e.minimum)&&oe(e.multipleOf)}function Md(e){return _(e,"Object")&&e.type==="object"&&re(e.$id)&&ys(e.properties)&&gd(e.additionalProperties)&&oe(e.minProperties)&&oe(e.maxProperties)}function Bd(e){return _(e,"Promise")&&e.type==="Promise"&&re(e.$id)&&Re(e.item)}function Vd(e){return _(e,"Record")&&e.type==="object"&&re(e.$id)&&gd(e.additionalProperties)&&ee(e.patternProperties)&&(t=>{let r=Object.getOwnPropertyNames(t.patternProperties);return r.length===1&&hd(r[0])&&ee(t.patternProperties)&&Re(t.patternProperties[r[0]])})(e)}function NO(e){return ee(e)&&ze in e&&e[ze]==="Recursive"}function Kd(e){return _(e,"Ref")&&re(e.$id)&&ie(e.$ref)}function Gd(e){return _(e,"RegExp")&&re(e.$id)&&ie(e.source)&&ie(e.flags)&&oe(e.maxLength)&&oe(e.minLength)}function qd(e){return _(e,"String")&&e.type==="string"&&re(e.$id)&&oe(e.minLength)&&oe(e.maxLength)&&PO(e.pattern)&&EO(e.format)}function Wd(e){return _(e,"Symbol")&&e.type==="symbol"&&re(e.$id)}function Hd(e){return _(e,"TemplateLiteral")&&e.type==="string"&&ie(e.pattern)&&e.pattern[0]==="^"&&e.pattern[e.pattern.length-1]==="$"}function zd(e){return _(e,"This")&&re(e.$id)&&ie(e.$ref)}function Jd(e){return ee(e)&&ue in e}function Yd(e){return _(e,"Tuple")&&e.type==="array"&&re(e.$id)&&nt(e.minItems)&&nt(e.maxItems)&&e.minItems===e.maxItems&&(we(e.items)&&we(e.additionalItems)&&e.minItems===0||Ie(e.items)&&e.items.every(t=>Re(t)))}function Qd(e){return _(e,"Undefined")&&e.type==="undefined"&&re(e.$id)}function RO(e){return Tl(e)&&e.anyOf.every(t=>Ld(t)||Nd(t))}function Tl(e){return _(e,"Union")&&re(e.$id)&&ee(e)&&Ie(e.anyOf)&&e.anyOf.every(t=>Re(t))}function Xd(e){return _(e,"Uint8Array")&&e.type==="Uint8Array"&&re(e.$id)&&oe(e.minByteLength)&&oe(e.maxByteLength)}function Zd(e){return _(e,"Unknown")&&re(e.$id)}function ef(e){return _(e,"Unsafe")}function tf(e){return _(e,"Void")&&e.type==="void"&&re(e.$id)}function rf(e){return ee(e)&&g in e&&ie(e[g])&&!TO.includes(e[g])}function Re(e){return ee(e)&&(bd(e)||Od(e)||xd(e)||wd(e)||Id(e)||Sd(e)||Cd(e)||Td(e)||Pd(e)||Ed(e)||Ad(e)||$d(e)||vd(e)||To(e)||kd(e)||Fd(e)||jd(e)||Ud(e)||_d(e)||Dd(e)||Md(e)||Bd(e)||Vd(e)||Kd(e)||Gd(e)||qd(e)||Wd(e)||Hd(e)||zd(e)||Yd(e)||Qd(e)||Tl(e)||Xd(e)||Zd(e)||ef(e)||tf(e)||rf(e))}function kO(e){return(parseInt(e)+1).toString()}var bs="(true|false)",vi="(0|[1-9][0-9]*)",Os="(.*)",nf="(?!.*)",FO=`^${bs}$`,vr=`^${vi}$`,Lr=`^${Os}$`,Pl=`^${nf}$`;var Ut={};rt(Ut,{Clear:()=>UO,Delete:()=>_O,Entries:()=>jO,Get:()=>BO,Has:()=>DO,Set:()=>MO});var Li=new Map;function jO(){return new Map(Li)}function UO(){return Li.clear()}function _O(e){return Li.delete(e)}function DO(e){return Li.has(e)}function MO(e,t){Li.set(e,t)}function BO(e){return Li.get(e)}var _t={};rt(_t,{Clear:()=>KO,Delete:()=>GO,Entries:()=>VO,Get:()=>HO,Has:()=>qO,Set:()=>WO});var Ni=new Map;function VO(){return new Map(Ni)}function KO(){return Ni.clear()}function GO(e){return Ni.delete(e)}function qO(e){return Ni.has(e)}function WO(e,t){Ni.set(e,t)}function HO(e){return Ni.get(e)}function xs(e,t){return e.includes(t)}function zO(e,t){return e.every(r=>xs(t,r))}function El(e){return[...new Set(e)]}function of(e,t){return e.filter(r=>t.includes(r))}function JO(e,t){return[...e,...t]}function YO(e,t){return e.filter(r=>!t.includes(r))}function QO(e,t){return e.reduce((r,i)=>of(r,i),t)}function Al(e){return e.length===1?e[0]:e.length>1?QO(e.slice(1),e[0]):[]}function $l(e){let t=[];for(let r of e)t.push(...r);return t}function Qt(e){return y({[g]:"Any"},e)}function Nr(e,t){return y({[g]:"Array",type:"array",items:e},t)}function Po(e){return y({[g]:"Argument",index:e})}function Rr(e,t){return y({[g]:"AsyncIterator",type:"AsyncIterator",items:e},t)}function ae(e,t,r){return y({[g]:"Computed",target:e,parameters:t},r)}function XO(e,t){let{[t]:r,...i}=e;return i}function Oe(e,t){return t.reduce((r,i)=>XO(r,i),e)}function k(e){return y({[g]:"Never",not:{}},e)}function ZO(e){return y({[g]:"MappedKey",keys:e})}function q(e){return y({[g]:"MappedResult",properties:e})}function kr(e,t,r){return y({[g]:"Constructor",type:"Constructor",parameters:e,returns:t},r)}function gt(e,t,r){return y({[g]:"Function",type:"Function",parameters:e,returns:t},r)}function Eo(e,t){return y({[g]:"Union",anyOf:e},t)}function ex(e){return e.some(t=>Je(t))}function af(e){return e.map(t=>Je(t)?tx(t):t)}function tx(e){return Oe(e,[Ne])}function rx(e,t){return ex(e)?Ae(Eo(af(e),t)):Eo(af(e),t)}function Xt(e,t){return e.length===1?y(e[0],t):e.length===0?k(t):rx(e,t)}function K(e,t){return e.length===0?k(t):e.length===1?y(e[0],t):Eo(e,t)}var Ao=class extends ${};function nx(e){return e.replace(/\\\\\\$/g,"$").replace(/\\\\\\*/g,"*").replace(/\\\\\\^/g,"^").replace(/\\\\\\|/g,"|").replace(/\\\\\\(/g,"(").replace(/\\\\\\)/g,")")}function vl(e,t,r){return e[t]===r&&e.charCodeAt(t-1)!==92}function Fr(e,t){return vl(e,t,"(")}function $o(e,t){return vl(e,t,")")}function sf(e,t){return vl(e,t,"|")}function ix(e){if(!(Fr(e,0)&&$o(e,e.length-1)))return!1;let t=0;for(let r=0;r<e.length;r++)if(Fr(e,r)&&(t+=1),$o(e,r)&&(t-=1),t===0&&r!==e.length-1)return!1;return!0}function ox(e){return e.slice(1,e.length-1)}function ax(e){let t=0;for(let r=0;r<e.length;r++)if(Fr(e,r)&&(t+=1),$o(e,r)&&(t-=1),sf(e,r)&&t===0)return!0;return!1}function sx(e){for(let t=0;t<e.length;t++)if(Fr(e,t))return!0;return!1}function cx(e){let[t,r]=[0,0],i=[];for(let a=0;a<e.length;a++)if(Fr(e,a)&&(t+=1),$o(e,a)&&(t-=1),sf(e,a)&&t===0){let s=e.slice(r,a);s.length>0&&i.push(Qn(s)),r=a+1}let o=e.slice(r);return o.length>0&&i.push(Qn(o)),i.length===0?{type:"const",const:""}:i.length===1?i[0]:{type:"or",expr:i}}function lx(e){function t(o,a){if(!Fr(o,a))throw new Ao("TemplateLiteralParser: Index must point to open parens");let s=0;for(let c=a;c<o.length;c++)if(Fr(o,c)&&(s+=1),$o(o,c)&&(s-=1),s===0)return[a,c];throw new Ao("TemplateLiteralParser: Unclosed group parens in expression")}function r(o,a){for(let s=a;s<o.length;s++)if(Fr(o,s))return[a,s];return[a,o.length]}let i=[];for(let o=0;o<e.length;o++)if(Fr(e,o)){let[a,s]=t(e,o),c=e.slice(a,s+1);i.push(Qn(c)),o=s}else{let[a,s]=r(e,o),c=e.slice(a,s);c.length>0&&i.push(Qn(c)),o=s-1}return i.length===0?{type:"const",const:""}:i.length===1?i[0]:{type:"and",expr:i}}function Qn(e){return ix(e)?Qn(ox(e)):ax(e)?cx(e):sx(e)?lx(e):{type:"const",const:nx(e)}}function Xn(e){return Qn(e.slice(1,e.length-1))}var Ss=class extends ${};function px(e){return e.type==="or"&&e.expr.length===2&&e.expr[0].type==="const"&&e.expr[0].const==="0"&&e.expr[1].type==="const"&&e.expr[1].const==="[1-9][0-9]*"}function mx(e){return e.type==="or"&&e.expr.length===2&&e.expr[0].type==="const"&&e.expr[0].const==="true"&&e.expr[1].type==="const"&&e.expr[1].const==="false"}function ux(e){return e.type==="const"&&e.const===".*"}function In(e){return px(e)||ux(e)?!1:mx(e)?!0:e.type==="and"?e.expr.every(t=>In(t)):e.type==="or"?e.expr.every(t=>In(t)):e.type==="const"?!0:(()=>{throw new Ss("Unknown expression type")})()}function vo(e){let t=Xn(e.pattern);return In(t)}var Is=class extends ${};function*cf(e){if(e.length===1)return yield*e[0];for(let t of e[0])for(let r of cf(e.slice(1)))yield`${t}${r}`}function*dx(e){return yield*cf(e.expr.map(t=>[...Ri(t)]))}function*fx(e){for(let t of e.expr)yield*Ri(t)}function*hx(e){return yield e.const}function*Ri(e){return e.type==="and"?yield*dx(e):e.type==="or"?yield*fx(e):e.type==="const"?yield*hx(e):(()=>{throw new Is("Unknown expression")})()}function Zn(e){let t=Xn(e.pattern);return In(t)?[...Ri(t)]:[]}function j(e,t){return y({[g]:"Literal",const:e,type:typeof e},t)}function ei(e){return y({[g]:"Boolean",type:"boolean"},e)}function jr(e){return y({[g]:"BigInt",type:"bigint"},e)}function Ye(e){return y({[g]:"Number",type:"number"},e)}function ke(e){return y({[g]:"String",type:"string"},e)}function*gx(e){let t=e.trim().replace(/"|\'/g,"");return t==="boolean"?yield ei():t==="number"?yield Ye():t==="bigint"?yield jr():t==="string"?yield ke():yield(()=>{let r=t.split("|").map(i=>j(i.trim()));return r.length===0?k():r.length===1?r[0]:Xt(r)})()}function*yx(e){if(e[1]!=="{"){let t=j("$"),r=Ll(e.slice(1));return yield*[t,...r]}for(let t=2;t<e.length;t++)if(e[t]==="}"){let r=gx(e.slice(2,t)),i=Ll(e.slice(t+1));return yield*[...r,...i]}yield j(e)}function*Ll(e){for(let t=0;t<e.length;t++)if(e[t]==="$"){let r=j(e.slice(0,t)),i=yx(e.slice(t));return yield*[r,...i]}yield j(e)}function Nl(e){return[...Ll(e)]}var ws=class extends ${};function bx(e){return e.replace(/[.*+?^${}()|[\\]\\\\]/g,"\\\\$&")}function lf(e,t){return at(e)?e.pattern.slice(1,e.pattern.length-1):V(e)?`(${e.anyOf.map(r=>lf(r,t)).join("|")})`:jt(e)?`${t}${vi}`:Ft(e)?`${t}${vi}`:bn(e)?`${t}${vi}`:yr(e)?`${t}${Os}`:Me(e)?`${t}${bx(e.const.toString())}`:gr(e)?`${t}${bs}`:(()=>{throw new ws(`Unexpected Kind \'${e[g]}\'`)})()}function Cs(e){return`^${e.map(t=>lf(t,"")).join("")}$`}function wn(e){let r=Zn(e).map(i=>j(i));return Xt(r)}function ti(e,t){let r=ie(e)?Cs(Nl(e)):Cs(e);return y({[g]:"TemplateLiteral",type:"string",pattern:r},t)}function Ox(e){return Zn(e).map(r=>r.toString())}function xx(e){let t=[];for(let r of e)t.push(...Qe(r));return t}function Sx(e){return[e.toString()]}function Qe(e){return[...new Set(at(e)?Ox(e):V(e)?xx(e.anyOf):Me(e)?Sx(e.const):jt(e)?["[number]"]:Ft(e)?["[number]"]:[])]}function Ix(e,t,r){let i={};for(let o of Object.getOwnPropertyNames(t))i[o]=Zt(e,Qe(t[o]),r);return i}function wx(e,t,r){return Ix(e,t.properties,r)}function Rl(e,t,r){let i=wx(e,t,r);return q(i)}function mf(e,t){return e.map(r=>kl(r,t))}function Cx(e){return e.filter(t=>!Ar(t))}function Tx(e,t){return Lo(Cx(mf(e,t)))}function Px(e){return e.some(t=>Ar(t))?[]:e}function Ex(e,t){return Xt(Px(mf(e,t)))}function Ax(e,t){return t in e?e[t]:t==="[number]"?Xt(e):k()}function $x(e,t){return t==="[number]"?e:k()}function vx(e,t){return t in e?e[t]:k()}function kl(e,t){return he(e)?Tx(e.allOf,t):V(e)?Ex(e.anyOf,t):st(e)?Ax(e.items??[],t):Lt(e)?$x(e.items,t):xe(e)?vx(e.properties,t):k()}function ki(e,t){return t.map(r=>kl(e,r))}function pf(e,t){return Xt(ki(e,t))}function Lx(e,t){return ae("Index",[e,t])}function Zt(e,t,r){if(be(e)||be(t)){let i="Index types using Ref parameters require both Type and Key to be of TSchema";if(!de(e)||!de(t))throw new $(i);return ae("Index",[e,t])}return pe(t)?Rl(e,t,r):ot(t)?Fl(e,t,r):y(de(t)?pf(e,Qe(t)):pf(e,t),r)}function Nx(e,t,r){return{[t]:Zt(e,[t],se(r))}}function Rx(e,t,r){return t.reduce((i,o)=>({...i,...Nx(e,o,r)}),{})}function kx(e,t,r){return Rx(e,t.keys,r)}function Fl(e,t,r){let i=kx(e,t,r);return q(i)}function Ur(e,t){return y({[g]:"Iterator",type:"Iterator",items:e},t)}function Fx(e){let t=[];for(let r in e)Je(e[r])||t.push(r);return t}function jx(e,t){let r=Fx(e),i=r.length>0?{[g]:"Object",type:"object",properties:e,required:r}:{[g]:"Object",type:"object",properties:e};return y(i,t)}var G=jx;function ri(e,t){return y({[g]:"Promise",type:"Promise",item:e},t)}function Ux(e){return y(Oe(e,[vt]))}function _x(e){return y({...e,[vt]:"Readonly"})}function Dx(e,t){return t===!1?Ux(e):_x(e)}function Be(e,t){let r=t??!0;return pe(e)?jl(e,r):Dx(e,r)}function Mx(e,t){let r={};for(let i of globalThis.Object.getOwnPropertyNames(e))r[i]=Be(e[i],t);return r}function Bx(e,t){return Mx(e.properties,t)}function jl(e,t){let r=Bx(e,t);return q(r)}function Xe(e,t){return y(e.length>0?{[g]:"Tuple",type:"array",items:e,additionalItems:!1,minItems:e.length,maxItems:e.length}:{[g]:"Tuple",type:"array",minItems:e.length,maxItems:e.length},t)}function uf(e,t){return e in t?Dt(e,t[e]):q(t)}function Vx(e){return{[e]:j(e)}}function Kx(e){let t={};for(let r of e)t[r]=j(r);return t}function Gx(e,t){return xs(t,e)?Vx(e):Kx(t)}function qx(e,t){let r=Gx(e,t);return uf(e,r)}function No(e,t){return t.map(r=>Dt(e,r))}function Wx(e,t){let r={};for(let i of globalThis.Object.getOwnPropertyNames(t))r[i]=Dt(e,t[i]);return r}function Dt(e,t){let r={...t};return Je(t)?Ae(Dt(e,Oe(t,[Ne]))):Yn(t)?Be(Dt(e,Oe(t,[vt]))):pe(t)?uf(e,t.properties):ot(t)?qx(e,t.keys):Rt(t)?kr(No(e,t.parameters),Dt(e,t.returns),r):kt(t)?gt(No(e,t.parameters),Dt(e,t.returns),r):yn(t)?Rr(Dt(e,t.items),r):On(t)?Ur(Dt(e,t.items),r):he(t)?$e(No(e,t.allOf),r):V(t)?K(No(e,t.anyOf),r):st(t)?Xe(No(e,t.items??[]),r):xe(t)?G(Wx(e,t.properties),r):Lt(t)?Nr(Dt(e,t.items),r):xn(t)?ri(Dt(e,t.item),r):t}function df(e,t){let r={};for(let i of e)r[i]=Dt(i,t);return r}function Ro(e,t,r){let i=de(e)?Qe(e):e,o=t({[g]:"MappedKey",keys:i}),a=df(i,o);return G(a,r)}function Hx(e){return y(Oe(e,[Ne]))}function zx(e){return y({...e,[Ne]:"Optional"})}function Jx(e,t){return t===!1?Hx(e):zx(e)}function Ae(e,t){let r=t??!0;return pe(e)?Ul(e,r):Jx(e,r)}function Yx(e,t){let r={};for(let i of globalThis.Object.getOwnPropertyNames(e))r[i]=Ae(e[i],t);return r}function Qx(e,t){return Yx(e.properties,t)}function Ul(e,t){let r=Qx(e,t);return q(r)}function ko(e,t={}){let r=e.every(o=>xe(o)),i=de(t.unevaluatedProperties)?{unevaluatedProperties:t.unevaluatedProperties}:{};return y(t.unevaluatedProperties===!1||de(t.unevaluatedProperties)||r?{...i,[g]:"Intersect",type:"object",allOf:e}:{...i,[g]:"Intersect",allOf:e},t)}function Xx(e){return e.every(t=>Je(t))}function Zx(e){return Oe(e,[Ne])}function ff(e){return e.map(t=>Je(t)?Zx(t):t)}function eS(e,t){return Xx(e)?Ae(ko(ff(e),t)):ko(ff(e),t)}function Lo(e,t={}){if(e.length===1)return y(e[0],t);if(e.length===0)return k(t);if(e.some(r=>z(r)))throw new Error("Cannot intersect transform types");return eS(e,t)}function $e(e,t){if(e.length===1)return y(e[0],t);if(e.length===0)return k(t);if(e.some(r=>z(r)))throw new Error("Cannot intersect transform types");return ko(e,t)}function yt(...e){let[t,r]=typeof e[0]=="string"?[e[0],e[1]]:[e[0].$id,e[1]];if(typeof t!="string")throw new $("Ref: $ref must be a string");return y({[g]:"Ref",$ref:t},r)}function tS(e,t){return ae("Awaited",[ae(e,t)])}function rS(e){return ae("Awaited",[yt(e)])}function nS(e){return $e(hf(e))}function iS(e){return K(hf(e))}function oS(e){return _r(e)}function hf(e){return e.map(t=>_r(t))}function _r(e,t){return y(Nt(e)?tS(e.target,e.parameters):he(e)?nS(e.allOf):V(e)?iS(e.anyOf):xn(e)?oS(e.item):be(e)?rS(e.$ref):e,t)}function gf(e){let t=[];for(let r of e)t.push(Ze(r));return t}function aS(e){let t=gf(e);return $l(t)}function sS(e){let t=gf(e);return Al(t)}function cS(e){return e.map((t,r)=>r.toString())}function lS(e){return["[number]"]}function pS(e){return globalThis.Object.getOwnPropertyNames(e)}function mS(e){return _l?globalThis.Object.getOwnPropertyNames(e).map(r=>r[0]==="^"&&r[r.length-1]==="$"?r.slice(1,r.length-1):r):[]}function Ze(e){return he(e)?aS(e.allOf):V(e)?sS(e.anyOf):st(e)?cS(e.items??[]):Lt(e)?lS(e.items):xe(e)?pS(e.properties):Sn(e)?mS(e.patternProperties):[]}var _l=!1;function ni(e){_l=!0;let t=Ze(e);return _l=!1,`^(${t.map(i=>`(${i})`).join("|")})$`}function uS(e,t){return ae("KeyOf",[ae(e,t)])}function dS(e){return ae("KeyOf",[yt(e)])}function fS(e,t){let r=Ze(e),i=yf(r),o=Xt(i);return y(o,t)}function yf(e){return e.map(t=>t==="[number]"?Ye():j(t))}function Dr(e,t){return Nt(e)?uS(e.target,e.parameters):be(e)?dS(e.$ref):pe(e)?Dl(e,t):fS(e,t)}function hS(e,t){let r={};for(let i of globalThis.Object.getOwnPropertyNames(e))r[i]=Dr(e[i],se(t));return r}function gS(e,t){return hS(e.properties,t)}function Dl(e,t){let r=gS(e,t);return q(r)}function Fo(e){let t=Ze(e),r=ki(e,t);return t.map((i,o)=>[t[o],r[o]])}function yS(e){let t=[];for(let r of e)t.push(...Ze(r));return El(t)}function bS(e){return e.filter(t=>!Ar(t))}function OS(e,t){let r=[];for(let i of e)r.push(...ki(i,[t]));return bS(r)}function xS(e,t){let r={};for(let i of t)r[i]=Lo(OS(e,i));return r}function jo(e,t){let r=yS(e),i=xS(e,r);return G(i,t)}function ii(e){return y({[g]:"Date",type:"Date"},e)}function oi(e){return y({[g]:"Null",type:"null"},e)}function ai(e){return y({[g]:"Symbol",type:"symbol"},e)}function si(e){return y({[g]:"Undefined",type:"undefined"},e)}function ci(e){return y({[g]:"Uint8Array",type:"Uint8Array"},e)}function ct(e){return y({[g]:"Unknown"},e)}function SS(e){return e.map(t=>Ml(t,!1))}function IS(e){let t={};for(let r of globalThis.Object.getOwnPropertyNames(e))t[r]=Be(Ml(e[r],!1));return t}function Ts(e,t){return t===!0?e:Be(e)}function Ml(e,t){return hl(e)?Ts(Qt(),t):yl(e)?Ts(Qt(),t):Ie(e)?Be(Xe(SS(e))):Er(e)?ci():zn(e)?ii():ee(e)?Ts(G(IS(e)),t):gl(e)?Ts(gt([],ct()),t):we(e)?si():bl(e)?oi():Ol(e)?ai():go(e)?jr():nt(e)?j(e):ur(e)?j(e):ie(e)?j(e):G({})}function Uo(e,t){return y(Ml(e,!0),t)}function _o(e,t){return Rt(e)?Xe(e.parameters,t):k(t)}function Do(e,t){if(we(e))throw new Error("Enum undefined or empty");let r=globalThis.Object.getOwnPropertyNames(e).filter(a=>isNaN(a)).map(a=>e[a]),o=[...new Set(r)].map(a=>j(a));return K(o,{...t,[ze]:"Enum"})}var Ps=class extends ${},b;(function(e){e[e.Union=0]="Union",e[e.True=1]="True",e[e.False=2]="False"})(b||(b={}));function Mt(e){return e===b.False?e:b.True}function Fi(e){throw new Ps(e)}function Pe(e){return d.IsNever(e)||d.IsIntersect(e)||d.IsUnion(e)||d.IsUnknown(e)||d.IsAny(e)}function Ee(e,t){return d.IsNever(t)?Cf(e,t):d.IsIntersect(t)?Es(e,t):d.IsUnion(t)?ql(e,t):d.IsUnknown(t)?Af(e,t):d.IsAny(t)?Gl(e,t):Fi("StructuralRight")}function Gl(e,t){return b.True}function wS(e,t){return d.IsIntersect(t)?Es(e,t):d.IsUnion(t)&&t.anyOf.some(r=>d.IsAny(r)||d.IsUnknown(r))?b.True:d.IsUnion(t)?b.Union:d.IsUnknown(t)||d.IsAny(t)?b.True:b.Union}function CS(e,t){return d.IsUnknown(e)?b.False:d.IsAny(e)?b.Union:d.IsNever(e)?b.True:b.False}function TS(e,t){return d.IsObject(t)&&As(t)?b.True:Pe(t)?Ee(e,t):d.IsArray(t)?Mt(ne(e.items,t.items)):b.False}function PS(e,t){return Pe(t)?Ee(e,t):d.IsAsyncIterator(t)?Mt(ne(e.items,t.items)):b.False}function ES(e,t){return Pe(t)?Ee(e,t):d.IsObject(t)?qe(e,t):d.IsRecord(t)?Bt(e,t):d.IsBigInt(t)?b.True:b.False}function If(e,t){return d.IsLiteralBoolean(e)||d.IsBoolean(e)?b.True:b.False}function AS(e,t){return Pe(t)?Ee(e,t):d.IsObject(t)?qe(e,t):d.IsRecord(t)?Bt(e,t):d.IsBoolean(t)?b.True:b.False}function $S(e,t){return Pe(t)?Ee(e,t):d.IsObject(t)?qe(e,t):d.IsConstructor(t)?e.parameters.length>t.parameters.length?b.False:e.parameters.every((r,i)=>Mt(ne(t.parameters[i],r))===b.True)?Mt(ne(e.returns,t.returns)):b.False:b.False}function vS(e,t){return Pe(t)?Ee(e,t):d.IsObject(t)?qe(e,t):d.IsRecord(t)?Bt(e,t):d.IsDate(t)?b.True:b.False}function LS(e,t){return Pe(t)?Ee(e,t):d.IsObject(t)?qe(e,t):d.IsFunction(t)?e.parameters.length>t.parameters.length?b.False:e.parameters.every((r,i)=>Mt(ne(t.parameters[i],r))===b.True)?Mt(ne(e.returns,t.returns)):b.False:b.False}function wf(e,t){return d.IsLiteral(e)&&De.IsNumber(e.const)||d.IsNumber(e)||d.IsInteger(e)?b.True:b.False}function NS(e,t){return d.IsInteger(t)||d.IsNumber(t)?b.True:Pe(t)?Ee(e,t):d.IsObject(t)?qe(e,t):d.IsRecord(t)?Bt(e,t):b.False}function Es(e,t){return t.allOf.every(r=>ne(e,r)===b.True)?b.True:b.False}function RS(e,t){return e.allOf.some(r=>ne(r,t)===b.True)?b.True:b.False}function kS(e,t){return Pe(t)?Ee(e,t):d.IsIterator(t)?Mt(ne(e.items,t.items)):b.False}function FS(e,t){return d.IsLiteral(t)&&t.const===e.const?b.True:Pe(t)?Ee(e,t):d.IsObject(t)?qe(e,t):d.IsRecord(t)?Bt(e,t):d.IsString(t)?Ef(e,t):d.IsNumber(t)?Tf(e,t):d.IsInteger(t)?wf(e,t):d.IsBoolean(t)?If(e,t):b.False}function Cf(e,t){return b.False}function jS(e,t){return b.True}function bf(e){let[t,r]=[e,0];for(;d.IsNot(t);)t=t.not,r+=1;return r%2===0?t:ct()}function US(e,t){return d.IsNot(e)?ne(bf(e),t):d.IsNot(t)?ne(e,bf(t)):Fi("Invalid fallthrough for Not")}function _S(e,t){return Pe(t)?Ee(e,t):d.IsObject(t)?qe(e,t):d.IsRecord(t)?Bt(e,t):d.IsNull(t)?b.True:b.False}function Tf(e,t){return d.IsLiteralNumber(e)||d.IsNumber(e)||d.IsInteger(e)?b.True:b.False}function DS(e,t){return Pe(t)?Ee(e,t):d.IsObject(t)?qe(e,t):d.IsRecord(t)?Bt(e,t):d.IsInteger(t)||d.IsNumber(t)?b.True:b.False}function lt(e,t){return Object.getOwnPropertyNames(e.properties).length===t}function Of(e){return As(e)}function xf(e){return lt(e,0)||lt(e,1)&&"description"in e.properties&&d.IsUnion(e.properties.description)&&e.properties.description.anyOf.length===2&&(d.IsString(e.properties.description.anyOf[0])&&d.IsUndefined(e.properties.description.anyOf[1])||d.IsString(e.properties.description.anyOf[1])&&d.IsUndefined(e.properties.description.anyOf[0]))}function Bl(e){return lt(e,0)}function Sf(e){return lt(e,0)}function MS(e){return lt(e,0)}function BS(e){return lt(e,0)}function VS(e){return As(e)}function KS(e){let t=Ye();return lt(e,0)||lt(e,1)&&"length"in e.properties&&Mt(ne(e.properties.length,t))===b.True}function GS(e){return lt(e,0)}function As(e){let t=Ye();return lt(e,0)||lt(e,1)&&"length"in e.properties&&Mt(ne(e.properties.length,t))===b.True}function qS(e){let t=gt([Qt()],Qt());return lt(e,0)||lt(e,1)&&"then"in e.properties&&Mt(ne(e.properties.then,t))===b.True}function Pf(e,t){return ne(e,t)===b.False||d.IsOptional(e)&&!d.IsOptional(t)?b.False:b.True}function qe(e,t){return d.IsUnknown(e)?b.False:d.IsAny(e)?b.Union:d.IsNever(e)||d.IsLiteralString(e)&&Of(t)||d.IsLiteralNumber(e)&&Bl(t)||d.IsLiteralBoolean(e)&&Sf(t)||d.IsSymbol(e)&&xf(t)||d.IsBigInt(e)&&MS(t)||d.IsString(e)&&Of(t)||d.IsSymbol(e)&&xf(t)||d.IsNumber(e)&&Bl(t)||d.IsInteger(e)&&Bl(t)||d.IsBoolean(e)&&Sf(t)||d.IsUint8Array(e)&&VS(t)||d.IsDate(e)&&BS(t)||d.IsConstructor(e)&&GS(t)||d.IsFunction(e)&&KS(t)?b.True:d.IsRecord(e)&&d.IsString(Vl(e))?t[ze]==="Record"?b.True:b.False:d.IsRecord(e)&&d.IsNumber(Vl(e))?lt(t,0)?b.True:b.False:b.False}function WS(e,t){return Pe(t)?Ee(e,t):d.IsRecord(t)?Bt(e,t):d.IsObject(t)?(()=>{for(let r of Object.getOwnPropertyNames(t.properties)){if(!(r in e.properties)&&!d.IsOptional(t.properties[r]))return b.False;if(d.IsOptional(t.properties[r]))return b.True;if(Pf(e.properties[r],t.properties[r])===b.False)return b.False}return b.True})():b.False}function HS(e,t){return Pe(t)?Ee(e,t):d.IsObject(t)&&qS(t)?b.True:d.IsPromise(t)?Mt(ne(e.item,t.item)):b.False}function Vl(e){return vr in e.patternProperties?Ye():Lr in e.patternProperties?ke():Fi("Unknown record key pattern")}function Kl(e){return vr in e.patternProperties?e.patternProperties[vr]:Lr in e.patternProperties?e.patternProperties[Lr]:Fi("Unable to get record value schema")}function Bt(e,t){let[r,i]=[Vl(t),Kl(t)];return d.IsLiteralString(e)&&d.IsNumber(r)&&Mt(ne(e,i))===b.True?b.True:d.IsUint8Array(e)&&d.IsNumber(r)||d.IsString(e)&&d.IsNumber(r)||d.IsArray(e)&&d.IsNumber(r)?ne(e,i):d.IsObject(e)?(()=>{for(let o of Object.getOwnPropertyNames(e.properties))if(Pf(i,e.properties[o])===b.False)return b.False;return b.True})():b.False}function zS(e,t){return Pe(t)?Ee(e,t):d.IsObject(t)?qe(e,t):d.IsRecord(t)?ne(Kl(e),Kl(t)):b.False}function JS(e,t){let r=d.IsRegExp(e)?ke():e,i=d.IsRegExp(t)?ke():t;return ne(r,i)}function Ef(e,t){return d.IsLiteral(e)&&De.IsString(e.const)||d.IsString(e)?b.True:b.False}function YS(e,t){return Pe(t)?Ee(e,t):d.IsObject(t)?qe(e,t):d.IsRecord(t)?Bt(e,t):d.IsString(t)?b.True:b.False}function QS(e,t){return Pe(t)?Ee(e,t):d.IsObject(t)?qe(e,t):d.IsRecord(t)?Bt(e,t):d.IsSymbol(t)?b.True:b.False}function XS(e,t){return d.IsTemplateLiteral(e)?ne(wn(e),t):d.IsTemplateLiteral(t)?ne(e,wn(t)):Fi("Invalid fallthrough for TemplateLiteral")}function ZS(e,t){return d.IsArray(t)&&e.items!==void 0&&e.items.every(r=>ne(r,t.items)===b.True)}function eI(e,t){return d.IsNever(e)?b.True:d.IsUnknown(e)?b.False:d.IsAny(e)?b.Union:b.False}function tI(e,t){return Pe(t)?Ee(e,t):d.IsObject(t)&&As(t)||d.IsArray(t)&&ZS(e,t)?b.True:d.IsTuple(t)?De.IsUndefined(e.items)&&!De.IsUndefined(t.items)||!De.IsUndefined(e.items)&&De.IsUndefined(t.items)?b.False:De.IsUndefined(e.items)&&!De.IsUndefined(t.items)||e.items.every((r,i)=>ne(r,t.items[i])===b.True)?b.True:b.False:b.False}function rI(e,t){return Pe(t)?Ee(e,t):d.IsObject(t)?qe(e,t):d.IsRecord(t)?Bt(e,t):d.IsUint8Array(t)?b.True:b.False}function nI(e,t){return Pe(t)?Ee(e,t):d.IsObject(t)?qe(e,t):d.IsRecord(t)?Bt(e,t):d.IsVoid(t)?aI(e,t):d.IsUndefined(t)?b.True:b.False}function ql(e,t){return t.anyOf.some(r=>ne(e,r)===b.True)?b.True:b.False}function iI(e,t){return e.anyOf.every(r=>ne(r,t)===b.True)?b.True:b.False}function Af(e,t){return b.True}function oI(e,t){return d.IsNever(t)?Cf(e,t):d.IsIntersect(t)?Es(e,t):d.IsUnion(t)?ql(e,t):d.IsAny(t)?Gl(e,t):d.IsString(t)?Ef(e,t):d.IsNumber(t)?Tf(e,t):d.IsInteger(t)?wf(e,t):d.IsBoolean(t)?If(e,t):d.IsArray(t)?CS(e,t):d.IsTuple(t)?eI(e,t):d.IsObject(t)?qe(e,t):d.IsUnknown(t)?b.True:b.False}function aI(e,t){return d.IsUndefined(e)||d.IsUndefined(e)?b.True:b.False}function sI(e,t){return d.IsIntersect(t)?Es(e,t):d.IsUnion(t)?ql(e,t):d.IsUnknown(t)?Af(e,t):d.IsAny(t)?Gl(e,t):d.IsObject(t)?qe(e,t):d.IsVoid(t)?b.True:b.False}function ne(e,t){return d.IsTemplateLiteral(e)||d.IsTemplateLiteral(t)?XS(e,t):d.IsRegExp(e)||d.IsRegExp(t)?JS(e,t):d.IsNot(e)||d.IsNot(t)?US(e,t):d.IsAny(e)?wS(e,t):d.IsArray(e)?TS(e,t):d.IsBigInt(e)?ES(e,t):d.IsBoolean(e)?AS(e,t):d.IsAsyncIterator(e)?PS(e,t):d.IsConstructor(e)?$S(e,t):d.IsDate(e)?vS(e,t):d.IsFunction(e)?LS(e,t):d.IsInteger(e)?NS(e,t):d.IsIntersect(e)?RS(e,t):d.IsIterator(e)?kS(e,t):d.IsLiteral(e)?FS(e,t):d.IsNever(e)?jS(e,t):d.IsNull(e)?_S(e,t):d.IsNumber(e)?DS(e,t):d.IsObject(e)?WS(e,t):d.IsRecord(e)?zS(e,t):d.IsString(e)?YS(e,t):d.IsSymbol(e)?QS(e,t):d.IsTuple(e)?tI(e,t):d.IsPromise(e)?HS(e,t):d.IsUint8Array(e)?rI(e,t):d.IsUndefined(e)?nI(e,t):d.IsUnion(e)?iI(e,t):d.IsUnknown(e)?oI(e,t):d.IsVoid(e)?sI(e,t):Fi(`Unknown left type operand \'${e[g]}\'`)}function Mr(e,t){return ne(e,t)}function cI(e,t,r,i,o){let a={};for(let s of globalThis.Object.getOwnPropertyNames(e))a[s]=Br(e[s],t,r,i,se(o));return a}function lI(e,t,r,i,o){return cI(e.properties,t,r,i,o)}function Wl(e,t,r,i,o){let a=lI(e,t,r,i,o);return q(a)}function pI(e,t,r,i){let o=Mr(e,t);return o===b.Union?K([r,i]):o===b.True?r:i}function Br(e,t,r,i,o){return pe(e)?Wl(e,t,r,i,o):ot(e)?y(Hl(e,t,r,i,o)):y(pI(e,t,r,i),o)}function mI(e,t,r,i,o){return{[e]:Br(j(e),t,r,i,se(o))}}function uI(e,t,r,i,o){return e.reduce((a,s)=>({...a,...mI(s,t,r,i,o)}),{})}function dI(e,t,r,i,o){return uI(e.keys,t,r,i,o)}function Hl(e,t,r,i,o){let a=dI(e,t,r,i,o);return q(a)}function fI(e){return e.allOf.every(t=>Cn(t))}function hI(e){return e.anyOf.some(t=>Cn(t))}function gI(e){return!Cn(e.not)}function Cn(e){return e[g]==="Intersect"?fI(e):e[g]==="Union"?hI(e):e[g]==="Not"?gI(e):e[g]==="Undefined"}function zl(e,t){return Vr(wn(e),t)}function yI(e,t){let r=e.filter(i=>Mr(i,t)===b.False);return r.length===1?r[0]:K(r)}function Vr(e,t,r={}){return at(e)?y(zl(e,t),r):pe(e)?y(Jl(e,t),r):y(V(e)?yI(e.anyOf,t):Mr(e,t)!==b.False?k():e,r)}function bI(e,t){let r={};for(let i of globalThis.Object.getOwnPropertyNames(e))r[i]=Vr(e[i],t);return r}function OI(e,t){return bI(e.properties,t)}function Jl(e,t){let r=OI(e,t);return q(r)}function Yl(e,t){return Kr(wn(e),t)}function xI(e,t){let r=e.filter(i=>Mr(i,t)!==b.False);return r.length===1?r[0]:K(r)}function Kr(e,t,r){return at(e)?y(Yl(e,t),r):pe(e)?y(Ql(e,t),r):y(V(e)?xI(e.anyOf,t):Mr(e,t)!==b.False?e:k(),r)}function SI(e,t){let r={};for(let i of globalThis.Object.getOwnPropertyNames(e))r[i]=Kr(e[i],t);return r}function II(e,t){return SI(e.properties,t)}function Ql(e,t){let r=II(e,t);return q(r)}function Mo(e,t){return Rt(e)?y(e.returns,t):k(t)}function li(e){return Be(Ae(e))}function pi(e,t,r){return y({[g]:"Record",type:"object",patternProperties:{[e]:t}},r)}function Xl(e,t,r){let i={};for(let o of e)i[o]=t;return G(i,{...r,[ze]:"Record"})}function wI(e,t,r){return vo(e)?Xl(Qe(e),t,r):pi(e.pattern,t,r)}function CI(e,t,r){return Xl(Qe(K(e)),t,r)}function TI(e,t,r){return Xl([e.toString()],t,r)}function PI(e,t,r){return pi(e.source,t,r)}function EI(e,t,r){let i=we(e.pattern)?Lr:e.pattern;return pi(i,t,r)}function AI(e,t,r){return pi(Lr,t,r)}function $I(e,t,r){return pi(Pl,t,r)}function vI(e,t,r){return G({true:t,false:t},r)}function LI(e,t,r){return pi(vr,t,r)}function NI(e,t,r){return pi(vr,t,r)}function mi(e,t,r={}){return V(e)?CI(e.anyOf,t,r):at(e)?wI(e,t,r):Me(e)?TI(e.const,t,r):gr(e)?vI(e,t,r):Ft(e)?LI(e,t,r):jt(e)?NI(e,t,r):gs(e)?PI(e,t,r):yr(e)?EI(e,t,r):fs(e)?AI(e,t,r):Ar(e)?$I(e,t,r):k(r)}function Bo(e){return globalThis.Object.getOwnPropertyNames(e.patternProperties)[0]}function Zl(e){let t=Bo(e);return t===Lr?ke():t===vr?Ye():ke({pattern:t})}function Vo(e){return e.patternProperties[Bo(e)]}function RI(e,t){return t.parameters=ji(e,t.parameters),t.returns=er(e,t.returns),t}function kI(e,t){return t.parameters=ji(e,t.parameters),t.returns=er(e,t.returns),t}function FI(e,t){return t.allOf=ji(e,t.allOf),t}function jI(e,t){return t.anyOf=ji(e,t.anyOf),t}function UI(e,t){return we(t.items)||(t.items=ji(e,t.items)),t}function _I(e,t){return t.items=er(e,t.items),t}function DI(e,t){return t.items=er(e,t.items),t}function MI(e,t){return t.items=er(e,t.items),t}function BI(e,t){return t.item=er(e,t.item),t}function VI(e,t){let r=WI(e,t.properties);return{...t,...G(r)}}function KI(e,t){let r=er(e,Zl(t)),i=er(e,Vo(t)),o=mi(r,i);return{...t,...o}}function GI(e,t){return t.index in e?e[t.index]:ct()}function qI(e,t){let r=Yn(t),i=Je(t),o=er(e,t);return r&&i?li(o):r&&!i?Be(o):!r&&i?Ae(o):o}function WI(e,t){return globalThis.Object.getOwnPropertyNames(t).reduce((r,i)=>({...r,[i]:qI(e,t[i])}),{})}function ji(e,t){return t.map(r=>er(e,r))}function er(e,t){return Rt(t)?RI(e,t):kt(t)?kI(e,t):he(t)?FI(e,t):V(t)?jI(e,t):st(t)?UI(e,t):Lt(t)?_I(e,t):yn(t)?DI(e,t):On(t)?MI(e,t):xn(t)?BI(e,t):xe(t)?VI(e,t):Sn(t)?KI(e,t):hs(t)?GI(e,t):t}function Ko(e,t){return er(t,gn(e))}function Go(e){return y({[g]:"Integer",type:"integer"},e)}function HI(e,t,r){return{[e]:Vt(j(e),t,se(r))}}function zI(e,t,r){return e.reduce((o,a)=>({...o,...HI(a,t,r)}),{})}function JI(e,t,r){return zI(e.keys,t,r)}function ep(e,t,r){let i=JI(e,t,r);return q(i)}function YI(e){let[t,r]=[e.slice(0,1),e.slice(1)];return[t.toLowerCase(),r].join("")}function QI(e){let[t,r]=[e.slice(0,1),e.slice(1)];return[t.toUpperCase(),r].join("")}function XI(e){return e.toUpperCase()}function ZI(e){return e.toLowerCase()}function e0(e,t,r){let i=Xn(e.pattern);if(!In(i))return{...e,pattern:$f(e.pattern,t)};let s=[...Ri(i)].map(p=>j(p)),c=vf(s,t),l=K(c);return ti([l],r)}function $f(e,t){return typeof e=="string"?t==="Uncapitalize"?YI(e):t==="Capitalize"?QI(e):t==="Uppercase"?XI(e):t==="Lowercase"?ZI(e):e:e.toString()}function vf(e,t){return e.map(r=>Vt(r,t))}function Vt(e,t,r={}){return ot(e)?ep(e,t,r):at(e)?e0(e,t,r):V(e)?K(vf(e.anyOf,t),r):Me(e)?j($f(e.const,t),r):y(e,r)}function qo(e,t={}){return Vt(e,"Capitalize",t)}function Wo(e,t={}){return Vt(e,"Lowercase",t)}function Ho(e,t={}){return Vt(e,"Uncapitalize",t)}function zo(e,t={}){return Vt(e,"Uppercase",t)}function t0(e,t,r){let i={};for(let o of globalThis.Object.getOwnPropertyNames(e))i[o]=tr(e[o],t,se(r));return i}function r0(e,t,r){return t0(e.properties,t,r)}function tp(e,t,r){let i=r0(e,t,r);return q(i)}function n0(e,t){return e.map(r=>rp(r,t))}function i0(e,t){return e.map(r=>rp(r,t))}function o0(e,t){let{[t]:r,...i}=e;return i}function a0(e,t){return t.reduce((r,i)=>o0(r,i),e)}function s0(e,t){let r=Oe(e,[ue,"$id","required","properties"]),i=a0(e.properties,t);return G(i,r)}function c0(e){let t=e.reduce((r,i)=>wo(i)?[...r,j(i)]:r,[]);return K(t)}function rp(e,t){return he(e)?$e(n0(e.allOf,t)):V(e)?K(i0(e.anyOf,t)):xe(e)?s0(e,t):G({})}function tr(e,t,r){let i=Ie(t)?c0(t):t,o=de(t)?Qe(t):t,a=be(e),s=be(t);return pe(e)?tp(e,o,r):ot(t)?np(e,t,r):a&&s?ae("Omit",[e,i],r):!a&&s?ae("Omit",[e,i],r):a&&!s?ae("Omit",[e,i],r):y({...rp(e,o),...r})}function l0(e,t,r){return{[t]:tr(e,[t],se(r))}}function p0(e,t,r){return t.reduce((i,o)=>({...i,...l0(e,o,r)}),{})}function m0(e,t,r){return p0(e,t.keys,r)}function np(e,t,r){let i=m0(e,t,r);return q(i)}function u0(e,t,r){let i={};for(let o of globalThis.Object.getOwnPropertyNames(e))i[o]=rr(e[o],t,se(r));return i}function d0(e,t,r){return u0(e.properties,t,r)}function ip(e,t,r){let i=d0(e,t,r);return q(i)}function f0(e,t){return e.map(r=>op(r,t))}function h0(e,t){return e.map(r=>op(r,t))}function g0(e,t){let r={};for(let i of t)i in e&&(r[i]=e[i]);return r}function y0(e,t){let r=Oe(e,[ue,"$id","required","properties"]),i=g0(e.properties,t);return G(i,r)}function b0(e){let t=e.reduce((r,i)=>wo(i)?[...r,j(i)]:r,[]);return K(t)}function op(e,t){return he(e)?$e(f0(e.allOf,t)):V(e)?K(h0(e.anyOf,t)):xe(e)?y0(e,t):G({})}function rr(e,t,r){let i=Ie(t)?b0(t):t,o=de(t)?Qe(t):t,a=be(e),s=be(t);return pe(e)?ip(e,o,r):ot(t)?ap(e,t,r):a&&s?ae("Pick",[e,i],r):!a&&s?ae("Pick",[e,i],r):a&&!s?ae("Pick",[e,i],r):y({...op(e,o),...r})}function O0(e,t,r){return{[t]:rr(e,[t],se(r))}}function x0(e,t,r){return t.reduce((i,o)=>({...i,...O0(e,o,r)}),{})}function S0(e,t,r){return x0(e,t.keys,r)}function ap(e,t,r){let i=S0(e,t,r);return q(i)}function I0(e,t){return ae("Partial",[ae(e,t)])}function w0(e){return ae("Partial",[yt(e)])}function C0(e){let t={};for(let r of globalThis.Object.getOwnPropertyNames(e))t[r]=Ae(e[r]);return t}function T0(e){let t=Oe(e,[ue,"$id","required","properties"]),r=C0(e.properties);return G(r,t)}function Lf(e){return e.map(t=>Nf(t))}function Nf(e){return Nt(e)?I0(e.target,e.parameters):be(e)?w0(e.$ref):he(e)?$e(Lf(e.allOf)):V(e)?K(Lf(e.anyOf)):xe(e)?T0(e):bn(e)||gr(e)||Ft(e)||Me(e)||Ai(e)||jt(e)||yr(e)||$i(e)||br(e)?e:G({})}function Gr(e,t){return pe(e)?sp(e,t):y({...Nf(e),...t})}function P0(e,t){let r={};for(let i of globalThis.Object.getOwnPropertyNames(e))r[i]=Gr(e[i],se(t));return r}function E0(e,t){return P0(e.properties,t)}function sp(e,t){let r=E0(e,t);return q(r)}function A0(e,t){return ae("Required",[ae(e,t)])}function $0(e){return ae("Required",[yt(e)])}function v0(e){let t={};for(let r of globalThis.Object.getOwnPropertyNames(e))t[r]=Oe(e[r],[Ne]);return t}function L0(e){let t=Oe(e,[ue,"$id","required","properties"]),r=v0(e.properties);return G(r,t)}function Rf(e){return e.map(t=>kf(t))}function kf(e){return Nt(e)?A0(e.target,e.parameters):be(e)?$0(e.$ref):he(e)?$e(Rf(e.allOf)):V(e)?K(Rf(e.anyOf)):xe(e)?L0(e):bn(e)||gr(e)||Ft(e)||Me(e)||Ai(e)||jt(e)||yr(e)||$i(e)||br(e)?e:G({})}function qr(e,t){return pe(e)?cp(e,t):y({...kf(e),...t})}function N0(e,t){let r={};for(let i of globalThis.Object.getOwnPropertyNames(e))r[i]=qr(e[i],t);return r}function R0(e,t){return N0(e.properties,t)}function cp(e,t){let r=R0(e,t);return q(r)}function k0(e,t){return t.map(r=>be(r)?lp(e,r.$ref):bt(e,r))}function lp(e,t){return t in e?be(e[t])?lp(e,e[t].$ref):bt(e,e[t]):k()}function F0(e){return _r(e[0])}function j0(e){return Zt(e[0],e[1])}function U0(e){return Dr(e[0])}function _0(e){return Gr(e[0])}function D0(e){return tr(e[0],e[1])}function M0(e){return rr(e[0],e[1])}function B0(e){return qr(e[0])}function V0(e,t,r){let i=k0(e,r);return t==="Awaited"?F0(i):t==="Index"?j0(i):t==="KeyOf"?U0(i):t==="Partial"?_0(i):t==="Omit"?D0(i):t==="Pick"?M0(i):t==="Required"?B0(i):k()}function K0(e,t){return Nr(bt(e,t))}function G0(e,t){return Rr(bt(e,t))}function q0(e,t,r){return kr(Jo(e,t),bt(e,r))}function W0(e,t,r){return gt(Jo(e,t),bt(e,r))}function H0(e,t){return $e(Jo(e,t))}function z0(e,t){return Ur(bt(e,t))}function J0(e,t){return G(globalThis.Object.keys(t).reduce((r,i)=>({...r,[i]:bt(e,t[i])}),{}))}function Y0(e,t){let[r,i]=[bt(e,Vo(t)),Bo(t)],o=gn(t);return o.patternProperties[i]=r,o}function Q0(e,t){return be(t)?{...lp(e,t.$ref),[ue]:t[ue]}:t}function X0(e,t){return Xe(Jo(e,t))}function Z0(e,t){return K(Jo(e,t))}function Jo(e,t){return t.map(r=>bt(e,r))}function bt(e,t){return Je(t)?y(bt(e,Oe(t,[Ne])),t):Yn(t)?y(bt(e,Oe(t,[vt])),t):z(t)?y(Q0(e,t),t):Lt(t)?y(K0(e,t.items),t):yn(t)?y(G0(e,t.items),t):Nt(t)?y(V0(e,t.target,t.parameters)):Rt(t)?y(q0(e,t.parameters,t.returns),t):kt(t)?y(W0(e,t.parameters,t.returns),t):he(t)?y(H0(e,t.allOf),t):On(t)?y(z0(e,t.items),t):xe(t)?y(J0(e,t.properties),t):Sn(t)?y(Y0(e,t)):st(t)?y(X0(e,t.items||[]),t):V(t)?y(Z0(e,t.anyOf),t):t}function ew(e,t){return t in e?bt(e,e[t]):k()}function Ff(e){return globalThis.Object.getOwnPropertyNames(e).reduce((t,r)=>({...t,[r]:ew(e,r)}),{})}var $s=class{constructor(t){let r=Ff(t),i=this.WithIdentifiers(r);this.$defs=i}Import(t,r){let i={...this.$defs,[t]:y(this.$defs[t],r)};return y({[g]:"Import",$defs:i,$ref:t})}WithIdentifiers(t){return globalThis.Object.getOwnPropertyNames(t).reduce((r,i)=>({...r,[i]:{...t[i],$id:i}}),{})}};function Yo(e){return new $s(e)}function Qo(e,t){return y({[g]:"Not",not:e},t)}function Xo(e,t){return kt(e)?Xe(e.parameters,t):k()}var tw=0;function Zo(e,t={}){we(t.$id)&&(t.$id=`T${tw++}`);let r=gn(e({[g]:"This",$ref:`${t.$id}`}));return r.$id=t.$id,y({[ze]:"Recursive",...r},t)}function ea(e,t){let r=ie(e)?new globalThis.RegExp(e):e;return y({[g]:"RegExp",type:"RegExp",source:r.source,flags:r.flags},t)}function rw(e){return he(e)?e.allOf:V(e)?e.anyOf:st(e)?e.items??[]:[]}function ta(e){return rw(e)}function ra(e,t){return kt(e)?y(e.returns,t):k(t)}var vs=class{constructor(t){this.schema=t}Decode(t){return new Ls(this.schema,t)}},Ls=class{constructor(t,r){this.schema=t,this.decode=r}EncodeTransform(t,r){let a={Encode:s=>r[ue].Encode(t(s)),Decode:s=>this.decode(r[ue].Decode(s))};return{...r,[ue]:a}}EncodeSchema(t,r){let i={Decode:this.decode,Encode:t};return{...r,[ue]:i}}Encode(t){return z(this.schema)?this.EncodeTransform(t,this.schema):this.EncodeSchema(t,this.schema)}};function na(e){return new vs(e)}function ia(e={}){return y({[g]:e[g]??"Unsafe"},e)}function oa(e){return y({[g]:"Void",type:"void"},e)}var Ui=class{ReadonlyOptional(t){return li(t)}Readonly(t,r){return Be(t,r??!0)}Optional(t,r){return Ae(t,r??!0)}Any(t){return Qt(t)}Array(t,r){return Nr(t,r)}Boolean(t){return ei(t)}Capitalize(t,r){return qo(t,r)}Composite(t,r){return jo(t,r)}Const(t,r){return Uo(t,r)}Enum(t,r){return Do(t,r)}Exclude(t,r,i){return Vr(t,r,i)}Extends(t,r,i,o,a){return Br(t,r,i,o,a)}Extract(t,r,i){return Kr(t,r,i)}Index(t,r,i){return Zt(t,r,i)}Integer(t){return Go(t)}Intersect(t,r){return $e(t,r)}KeyOf(t,r){return Dr(t,r)}Literal(t,r){return j(t,r)}Lowercase(t,r){return Wo(t,r)}Mapped(t,r,i){return Ro(t,r,i)}Module(t){return Yo(t)}Never(t){return k(t)}Not(t,r){return Qo(t,r)}Null(t){return oi(t)}Number(t){return Ye(t)}Object(t,r){return G(t,r)}Omit(t,r,i){return tr(t,r,i)}Partial(t,r){return Gr(t,r)}Pick(t,r,i){return rr(t,r,i)}Record(t,r,i){return mi(t,r,i)}Recursive(t,r){return Zo(t,r)}Ref(...t){return yt(t[0],t[1])}Required(t,r){return qr(t,r)}Rest(t){return ta(t)}String(t){return ke(t)}TemplateLiteral(t,r){return ti(t,r)}Transform(t){return na(t)}Tuple(t,r){return Xe(t,r)}Uncapitalize(t,r){return Ho(t,r)}Union(t,r){return K(t,r)}Unknown(t){return ct(t)}Unsafe(t){return ia(t)}Uppercase(t,r){return zo(t,r)}};var pp={};rt(pp,{Any:()=>Qt,Argument:()=>Po,Array:()=>Nr,AsyncIterator:()=>Rr,Awaited:()=>_r,BigInt:()=>jr,Boolean:()=>ei,Capitalize:()=>qo,Composite:()=>jo,Const:()=>Uo,Constructor:()=>kr,ConstructorParameters:()=>_o,Date:()=>ii,Enum:()=>Do,Exclude:()=>Vr,Extends:()=>Br,Extract:()=>Kr,Function:()=>gt,Index:()=>Zt,InstanceType:()=>Mo,Instantiate:()=>Ko,Integer:()=>Go,Intersect:()=>$e,Iterator:()=>Ur,KeyOf:()=>Dr,Literal:()=>j,Lowercase:()=>Wo,Mapped:()=>Ro,Module:()=>Yo,Never:()=>k,Not:()=>Qo,Null:()=>oi,Number:()=>Ye,Object:()=>G,Omit:()=>tr,Optional:()=>Ae,Parameters:()=>Xo,Partial:()=>Gr,Pick:()=>rr,Promise:()=>ri,Readonly:()=>Be,ReadonlyOptional:()=>li,Record:()=>mi,Recursive:()=>Zo,Ref:()=>yt,RegExp:()=>ea,Required:()=>qr,Rest:()=>ta,ReturnType:()=>ra,String:()=>ke,Symbol:()=>ai,TemplateLiteral:()=>ti,Transform:()=>na,Tuple:()=>Xe,Uint8Array:()=>ci,Uncapitalize:()=>Ho,Undefined:()=>si,Union:()=>K,Unknown:()=>ct,Unsafe:()=>ia,Uppercase:()=>zo,Void:()=>oa});var Ns=class extends Ui{Argument(t){return Po(t)}AsyncIterator(t,r){return Rr(t,r)}Awaited(t,r){return _r(t,r)}BigInt(t){return jr(t)}ConstructorParameters(t,r){return _o(t,r)}Constructor(t,r,i){return kr(t,r,i)}Date(t={}){return ii(t)}Function(t,r,i){return gt(t,r,i)}InstanceType(t,r){return Mo(t,r)}Instantiate(t,r){return Ko(t,r)}Iterator(t,r){return Ur(t,r)}Parameters(t,r){return Xo(t,r)}Promise(t,r){return ri(t,r)}RegExp(t,r){return ea(t,r)}ReturnType(t,r){return ra(t,r)}Symbol(t){return ai(t)}Undefined(t){return si(t)}Uint8Array(t){return ci(t)}Void(t){return oa(t)}};var n=pp;var Pp={};rt(Pp,{Assert:()=>aa,AssertError:()=>js,Cast:()=>Mi,Check:()=>F,Clean:()=>ca,Clone:()=>W,Convert:()=>ma,Create:()=>Kt,Decode:()=>gp,Default:()=>ga,Delete:()=>Zf,Diff:()=>Op,Edit:()=>bp,Encode:()=>Sp,Equal:()=>En,HasPropertyKey:()=>E,HasTransform:()=>Pn,Hash:()=>ui,Insert:()=>Qf,IsArray:()=>A,IsAsyncIterator:()=>bo,IsBigInt:()=>$t,IsBigInt64Array:()=>hO,IsBigUint64Array:()=>gO,IsBoolean:()=>Jt,IsDate:()=>Ge,IsFloat32Array:()=>dO,IsFloat64Array:()=>fO,IsFunction:()=>fr,IsInstanceObject:()=>oO,IsInt16Array:()=>lO,IsInt32Array:()=>mO,IsInt8Array:()=>sO,IsInteger:()=>So,IsIterator:()=>Oo,IsMap:()=>xl,IsNull:()=>dr,IsNumber:()=>le,IsObject:()=>L,IsPromise:()=>xo,IsRegExp:()=>aO,IsSet:()=>Sl,IsStandardObject:()=>ds,IsString:()=>X,IsSymbol:()=>hr,IsTypedArray:()=>ht,IsUint16Array:()=>pO,IsUint32Array:()=>uO,IsUint8Array:()=>Jn,IsUint8ClampedArray:()=>cO,IsUndefined:()=>ce,IsValueType:()=>it,Mutate:()=>wp,Parse:()=>Tp,ParseDefault:()=>Cp,ParseError:()=>xa,ParseRegistry:()=>qs,Patch:()=>xp,TransformDecode:()=>da,TransformDecodeCheckError:()=>ua,TransformDecodeError:()=>_s,TransformEncode:()=>ha,TransformEncodeCheckError:()=>fa,TransformEncodeError:()=>Ds,Update:()=>Xf,Value:()=>T,ValueCastError:()=>sa,ValueCheckUnknownTypeError:()=>ks,ValueCreateError:()=>pt,ValueDiffError:()=>ba,ValueErrorIterator:()=>Or,ValueErrorType:()=>h,ValueHashError:()=>Rs,ValueMutateError:()=>Oa,ValuePointer:()=>Gt});function nw(e){switch(e.errorType){case h.ArrayContains:return"Expected array to contain at least one matching value";case h.ArrayMaxContains:return`Expected array to contain no more than ${e.schema.maxContains} matching values`;case h.ArrayMinContains:return`Expected array to contain at least ${e.schema.minContains} matching values`;case h.ArrayMaxItems:return`Expected array length to be less or equal to ${e.schema.maxItems}`;case h.ArrayMinItems:return`Expected array length to be greater or equal to ${e.schema.minItems}`;case h.ArrayUniqueItems:return"Expected array elements to be unique";case h.Array:return"Expected array";case h.AsyncIterator:return"Expected AsyncIterator";case h.BigIntExclusiveMaximum:return`Expected bigint to be less than ${e.schema.exclusiveMaximum}`;case h.BigIntExclusiveMinimum:return`Expected bigint to be greater than ${e.schema.exclusiveMinimum}`;case h.BigIntMaximum:return`Expected bigint to be less or equal to ${e.schema.maximum}`;case h.BigIntMinimum:return`Expected bigint to be greater or equal to ${e.schema.minimum}`;case h.BigIntMultipleOf:return`Expected bigint to be a multiple of ${e.schema.multipleOf}`;case h.BigInt:return"Expected bigint";case h.Boolean:return"Expected boolean";case h.DateExclusiveMinimumTimestamp:return`Expected Date timestamp to be greater than ${e.schema.exclusiveMinimumTimestamp}`;case h.DateExclusiveMaximumTimestamp:return`Expected Date timestamp to be less than ${e.schema.exclusiveMaximumTimestamp}`;case h.DateMinimumTimestamp:return`Expected Date timestamp to be greater or equal to ${e.schema.minimumTimestamp}`;case h.DateMaximumTimestamp:return`Expected Date timestamp to be less or equal to ${e.schema.maximumTimestamp}`;case h.DateMultipleOfTimestamp:return`Expected Date timestamp to be a multiple of ${e.schema.multipleOfTimestamp}`;case h.Date:return"Expected Date";case h.Function:return"Expected function";case h.IntegerExclusiveMaximum:return`Expected integer to be less than ${e.schema.exclusiveMaximum}`;case h.IntegerExclusiveMinimum:return`Expected integer to be greater than ${e.schema.exclusiveMinimum}`;case h.IntegerMaximum:return`Expected integer to be less or equal to ${e.schema.maximum}`;case h.IntegerMinimum:return`Expected integer to be greater or equal to ${e.schema.minimum}`;case h.IntegerMultipleOf:return`Expected integer to be a multiple of ${e.schema.multipleOf}`;case h.Integer:return"Expected integer";case h.IntersectUnevaluatedProperties:return"Unexpected property";case h.Intersect:return"Expected all values to match";case h.Iterator:return"Expected Iterator";case h.Literal:return`Expected ${typeof e.schema.const=="string"?`\'${e.schema.const}\'`:e.schema.const}`;case h.Never:return"Never";case h.Not:return"Value should not match";case h.Null:return"Expected null";case h.NumberExclusiveMaximum:return`Expected number to be less than ${e.schema.exclusiveMaximum}`;case h.NumberExclusiveMinimum:return`Expected number to be greater than ${e.schema.exclusiveMinimum}`;case h.NumberMaximum:return`Expected number to be less or equal to ${e.schema.maximum}`;case h.NumberMinimum:return`Expected number to be greater or equal to ${e.schema.minimum}`;case h.NumberMultipleOf:return`Expected number to be a multiple of ${e.schema.multipleOf}`;case h.Number:return"Expected number";case h.Object:return"Expected object";case h.ObjectAdditionalProperties:return"Unexpected property";case h.ObjectMaxProperties:return`Expected object to have no more than ${e.schema.maxProperties} properties`;case h.ObjectMinProperties:return`Expected object to have at least ${e.schema.minProperties} properties`;case h.ObjectRequiredProperty:return"Expected required property";case h.Promise:return"Expected Promise";case h.RegExp:return"Expected string to match regular expression";case h.StringFormatUnknown:return`Unknown format \'${e.schema.format}\'`;case h.StringFormat:return`Expected string to match \'${e.schema.format}\' format`;case h.StringMaxLength:return`Expected string length less or equal to ${e.schema.maxLength}`;case h.StringMinLength:return`Expected string length greater or equal to ${e.schema.minLength}`;case h.StringPattern:return`Expected string to match \'${e.schema.pattern}\'`;case h.String:return"Expected string";case h.Symbol:return"Expected symbol";case h.TupleLength:return`Expected tuple to have ${e.schema.maxItems||0} elements`;case h.Tuple:return"Expected tuple";case h.Uint8ArrayMaxByteLength:return`Expected byte length less or equal to ${e.schema.maxByteLength}`;case h.Uint8ArrayMinByteLength:return`Expected byte length greater or equal to ${e.schema.minByteLength}`;case h.Uint8Array:return"Expected Uint8Array";case h.Undefined:return"Expected undefined";case h.Union:return"Expected union value";case h.Void:return"Expected void";case h.Kind:return`Expected kind \'${e.schema[g]}\'`;default:return"Unknown error type"}}var iw=nw;function jf(){return iw}var up=class extends ${constructor(t){super(`Unable to dereference schema with $id \'${t.$ref}\'`),this.schema=t}};function ow(e,t){let r=t.find(i=>i.$id===e.$ref);if(r===void 0)throw new up(e);return Y(r,t)}function Fe(e,t){return!X(e.$id)||t.some(r=>r.$id===e.$id)||t.push(e),t}function Y(e,t){return e[g]==="This"||e[g]==="Ref"?ow(e,t):e}var Rs=class extends ${constructor(t){super("Unable to hash value"),this.value=t}},Ot;(function(e){e[e.Undefined=0]="Undefined",e[e.Null=1]="Null",e[e.Boolean=2]="Boolean",e[e.Number=3]="Number",e[e.String=4]="String",e[e.Object=5]="Object",e[e.Array=6]="Array",e[e.Date=7]="Date",e[e.Uint8Array=8]="Uint8Array",e[e.Symbol=9]="Symbol",e[e.BigInt=10]="BigInt"})(Ot||(Ot={}));var _i=BigInt("14695981039346656037"),[aw,sw]=[BigInt("1099511628211"),BigInt("18446744073709551616")],cw=Array.from({length:256}).map((e,t)=>BigInt(t)),Uf=new Float64Array(1),_f=new DataView(Uf.buffer),Df=new Uint8Array(Uf.buffer);function*lw(e){let t=e===0?1:Math.ceil(Math.floor(Math.log2(e)+1)/8);for(let r=0;r<t;r++)yield e>>8*(t-1-r)&255}function pw(e){We(Ot.Array);for(let t of e)Di(t)}function mw(e){We(Ot.Boolean),We(e?1:0)}function uw(e){We(Ot.BigInt),_f.setBigInt64(0,e);for(let t of Df)We(t)}function dw(e){We(Ot.Date),Di(e.getTime())}function fw(e){We(Ot.Null)}function hw(e){We(Ot.Number),_f.setFloat64(0,e);for(let t of Df)We(t)}function gw(e){We(Ot.Object);for(let t of globalThis.Object.getOwnPropertyNames(e).sort())Di(t),Di(e[t])}function yw(e){We(Ot.String);for(let t=0;t<e.length;t++)for(let r of lw(e.charCodeAt(t)))We(r)}function bw(e){We(Ot.Symbol),Di(e.description)}function Ow(e){We(Ot.Uint8Array);for(let t=0;t<e.length;t++)We(e[t])}function xw(e){return We(Ot.Undefined)}function Di(e){if(A(e))return pw(e);if(Jt(e))return mw(e);if($t(e))return uw(e);if(Ge(e))return dw(e);if(dr(e))return fw(e);if(le(e))return hw(e);if(L(e))return gw(e);if(X(e))return yw(e);if(hr(e))return bw(e);if(Jn(e))return Ow(e);if(ce(e))return xw(e);throw new Rs(e)}function We(e){_i=_i^cw[e],_i=_i*aw%sw}function ui(e){return _i=BigInt("14695981039346656037"),Di(e),_i}var ks=class extends ${constructor(t){super("Unknown type"),this.schema=t}};function Sw(e){return e[g]==="Any"||e[g]==="Unknown"}function M(e){return e!==void 0}function Iw(e,t,r){return!0}function ww(e,t,r){return!0}function Cw(e,t,r){if(!A(r)||M(e.minItems)&&!(r.length>=e.minItems)||M(e.maxItems)&&!(r.length<=e.maxItems)||!r.every(a=>je(e.items,t,a))||e.uniqueItems===!0&&!function(){let a=new Set;for(let s of r){let c=ui(s);if(a.has(c))return!1;a.add(c)}return!0}())return!1;if(!(M(e.contains)||le(e.minContains)||le(e.maxContains)))return!0;let i=M(e.contains)?e.contains:k(),o=r.reduce((a,s)=>je(i,t,s)?a+1:a,0);return!(o===0||le(e.minContains)&&o<e.minContains||le(e.maxContains)&&o>e.maxContains)}function Tw(e,t,r){return bo(r)}function Pw(e,t,r){return!(!$t(r)||M(e.exclusiveMaximum)&&!(r<e.exclusiveMaximum)||M(e.exclusiveMinimum)&&!(r>e.exclusiveMinimum)||M(e.maximum)&&!(r<=e.maximum)||M(e.minimum)&&!(r>=e.minimum)||M(e.multipleOf)&&r%e.multipleOf!==BigInt(0))}function Ew(e,t,r){return Jt(r)}function Aw(e,t,r){return je(e.returns,t,r.prototype)}function $w(e,t,r){return!(!Ge(r)||M(e.exclusiveMaximumTimestamp)&&!(r.getTime()<e.exclusiveMaximumTimestamp)||M(e.exclusiveMinimumTimestamp)&&!(r.getTime()>e.exclusiveMinimumTimestamp)||M(e.maximumTimestamp)&&!(r.getTime()<=e.maximumTimestamp)||M(e.minimumTimestamp)&&!(r.getTime()>=e.minimumTimestamp)||M(e.multipleOfTimestamp)&&r.getTime()%e.multipleOfTimestamp!==0)}function vw(e,t,r){return fr(r)}function Lw(e,t,r){let i=globalThis.Object.values(e.$defs),o=e.$defs[e.$ref];return je(o,[...t,...i],r)}function Nw(e,t,r){return!(!So(r)||M(e.exclusiveMaximum)&&!(r<e.exclusiveMaximum)||M(e.exclusiveMinimum)&&!(r>e.exclusiveMinimum)||M(e.maximum)&&!(r<=e.maximum)||M(e.minimum)&&!(r>=e.minimum)||M(e.multipleOf)&&r%e.multipleOf!==0)}function Rw(e,t,r){let i=e.allOf.every(o=>je(o,t,r));if(e.unevaluatedProperties===!1){let o=new RegExp(ni(e)),a=Object.getOwnPropertyNames(r).every(s=>o.test(s));return i&&a}else if(de(e.unevaluatedProperties)){let o=new RegExp(ni(e)),a=Object.getOwnPropertyNames(r).every(s=>o.test(s)||je(e.unevaluatedProperties,t,r[s]));return i&&a}else return i}function kw(e,t,r){return Oo(r)}function Fw(e,t,r){return r===e.const}function jw(e,t,r){return!1}function Uw(e,t,r){return!je(e.not,t,r)}function _w(e,t,r){return dr(r)}function Dw(e,t,r){return!(!Te.IsNumberLike(r)||M(e.exclusiveMaximum)&&!(r<e.exclusiveMaximum)||M(e.exclusiveMinimum)&&!(r>e.exclusiveMinimum)||M(e.minimum)&&!(r>=e.minimum)||M(e.maximum)&&!(r<=e.maximum)||M(e.multipleOf)&&r%e.multipleOf!==0)}function Mw(e,t,r){if(!Te.IsObjectLike(r)||M(e.minProperties)&&!(Object.getOwnPropertyNames(r).length>=e.minProperties)||M(e.maxProperties)&&!(Object.getOwnPropertyNames(r).length<=e.maxProperties))return!1;let i=Object.getOwnPropertyNames(e.properties);for(let o of i){let a=e.properties[o];if(e.required&&e.required.includes(o)){if(!je(a,t,r[o])||(Cn(a)||Sw(a))&&!(o in r))return!1}else if(Te.IsExactOptionalProperty(r,o)&&!je(a,t,r[o]))return!1}if(e.additionalProperties===!1){let o=Object.getOwnPropertyNames(r);return e.required&&e.required.length===i.length&&o.length===i.length?!0:o.every(a=>i.includes(a))}else return typeof e.additionalProperties=="object"?Object.getOwnPropertyNames(r).every(a=>i.includes(a)||je(e.additionalProperties,t,r[a])):!0}function Bw(e,t,r){return xo(r)}function Vw(e,t,r){if(!Te.IsRecordLike(r)||M(e.minProperties)&&!(Object.getOwnPropertyNames(r).length>=e.minProperties)||M(e.maxProperties)&&!(Object.getOwnPropertyNames(r).length<=e.maxProperties))return!1;let[i,o]=Object.entries(e.patternProperties)[0],a=new RegExp(i),s=Object.entries(r).every(([p,m])=>a.test(p)?je(o,t,m):!0),c=typeof e.additionalProperties=="object"?Object.entries(r).every(([p,m])=>a.test(p)?!0:je(e.additionalProperties,t,m)):!0,l=e.additionalProperties===!1?Object.getOwnPropertyNames(r).every(p=>a.test(p)):!0;return s&&c&&l}function Kw(e,t,r){return je(Y(e,t),t,r)}function Gw(e,t,r){let i=new RegExp(e.source,e.flags);return M(e.minLength)&&!(r.length>=e.minLength)||M(e.maxLength)&&!(r.length<=e.maxLength)?!1:i.test(r)}function qw(e,t,r){return!X(r)||M(e.minLength)&&!(r.length>=e.minLength)||M(e.maxLength)&&!(r.length<=e.maxLength)||M(e.pattern)&&!new RegExp(e.pattern).test(r)?!1:M(e.format)?Ut.Has(e.format)?Ut.Get(e.format)(r):!1:!0}function Ww(e,t,r){return hr(r)}function Hw(e,t,r){return X(r)&&new RegExp(e.pattern).test(r)}function zw(e,t,r){return je(Y(e,t),t,r)}function Jw(e,t,r){if(!A(r)||e.items===void 0&&r.length!==0||r.length!==e.maxItems)return!1;if(!e.items)return!0;for(let i=0;i<e.items.length;i++)if(!je(e.items[i],t,r[i]))return!1;return!0}function Yw(e,t,r){return ce(r)}function Qw(e,t,r){return e.anyOf.some(i=>je(i,t,r))}function Xw(e,t,r){return!(!Jn(r)||M(e.maxByteLength)&&!(r.length<=e.maxByteLength)||M(e.minByteLength)&&!(r.length>=e.minByteLength))}function Zw(e,t,r){return!0}function eC(e,t,r){return Te.IsVoidLike(r)}function tC(e,t,r){return _t.Has(e[g])?_t.Get(e[g])(e,r):!1}function je(e,t,r){let i=M(e.$id)?Fe(e,t):t,o=e;switch(o[g]){case"Any":return Iw(o,i,r);case"Argument":return ww(o,i,r);case"Array":return Cw(o,i,r);case"AsyncIterator":return Tw(o,i,r);case"BigInt":return Pw(o,i,r);case"Boolean":return Ew(o,i,r);case"Constructor":return Aw(o,i,r);case"Date":return $w(o,i,r);case"Function":return vw(o,i,r);case"Import":return Lw(o,i,r);case"Integer":return Nw(o,i,r);case"Intersect":return Rw(o,i,r);case"Iterator":return kw(o,i,r);case"Literal":return Fw(o,i,r);case"Never":return jw(o,i,r);case"Not":return Uw(o,i,r);case"Null":return _w(o,i,r);case"Number":return Dw(o,i,r);case"Object":return Mw(o,i,r);case"Promise":return Bw(o,i,r);case"Record":return Vw(o,i,r);case"Ref":return Kw(o,i,r);case"RegExp":return Gw(o,i,r);case"String":return qw(o,i,r);case"Symbol":return Ww(o,i,r);case"TemplateLiteral":return Hw(o,i,r);case"This":return zw(o,i,r);case"Tuple":return Jw(o,i,r);case"Undefined":return Yw(o,i,r);case"Union":return Qw(o,i,r);case"Uint8Array":return Xw(o,i,r);case"Unknown":return Zw(o,i,r);case"Void":return eC(o,i,r);default:if(!_t.Has(o[g]))throw new ks(o);return tC(o,i,r)}}function F(...e){return e.length===3?je(e[0],e[1],e[2]):je(e[0],[],e[1])}var h;(function(e){e[e.ArrayContains=0]="ArrayContains",e[e.ArrayMaxContains=1]="ArrayMaxContains",e[e.ArrayMaxItems=2]="ArrayMaxItems",e[e.ArrayMinContains=3]="ArrayMinContains",e[e.ArrayMinItems=4]="ArrayMinItems",e[e.ArrayUniqueItems=5]="ArrayUniqueItems",e[e.Array=6]="Array",e[e.AsyncIterator=7]="AsyncIterator",e[e.BigIntExclusiveMaximum=8]="BigIntExclusiveMaximum",e[e.BigIntExclusiveMinimum=9]="BigIntExclusiveMinimum",e[e.BigIntMaximum=10]="BigIntMaximum",e[e.BigIntMinimum=11]="BigIntMinimum",e[e.BigIntMultipleOf=12]="BigIntMultipleOf",e[e.BigInt=13]="BigInt",e[e.Boolean=14]="Boolean",e[e.DateExclusiveMaximumTimestamp=15]="DateExclusiveMaximumTimestamp",e[e.DateExclusiveMinimumTimestamp=16]="DateExclusiveMinimumTimestamp",e[e.DateMaximumTimestamp=17]="DateMaximumTimestamp",e[e.DateMinimumTimestamp=18]="DateMinimumTimestamp",e[e.DateMultipleOfTimestamp=19]="DateMultipleOfTimestamp",e[e.Date=20]="Date",e[e.Function=21]="Function",e[e.IntegerExclusiveMaximum=22]="IntegerExclusiveMaximum",e[e.IntegerExclusiveMinimum=23]="IntegerExclusiveMinimum",e[e.IntegerMaximum=24]="IntegerMaximum",e[e.IntegerMinimum=25]="IntegerMinimum",e[e.IntegerMultipleOf=26]="IntegerMultipleOf",e[e.Integer=27]="Integer",e[e.IntersectUnevaluatedProperties=28]="IntersectUnevaluatedProperties",e[e.Intersect=29]="Intersect",e[e.Iterator=30]="Iterator",e[e.Kind=31]="Kind",e[e.Literal=32]="Literal",e[e.Never=33]="Never",e[e.Not=34]="Not",e[e.Null=35]="Null",e[e.NumberExclusiveMaximum=36]="NumberExclusiveMaximum",e[e.NumberExclusiveMinimum=37]="NumberExclusiveMinimum",e[e.NumberMaximum=38]="NumberMaximum",e[e.NumberMinimum=39]="NumberMinimum",e[e.NumberMultipleOf=40]="NumberMultipleOf",e[e.Number=41]="Number",e[e.ObjectAdditionalProperties=42]="ObjectAdditionalProperties",e[e.ObjectMaxProperties=43]="ObjectMaxProperties",e[e.ObjectMinProperties=44]="ObjectMinProperties",e[e.ObjectRequiredProperty=45]="ObjectRequiredProperty",e[e.Object=46]="Object",e[e.Promise=47]="Promise",e[e.RegExp=48]="RegExp",e[e.StringFormatUnknown=49]="StringFormatUnknown",e[e.StringFormat=50]="StringFormat",e[e.StringMaxLength=51]="StringMaxLength",e[e.StringMinLength=52]="StringMinLength",e[e.StringPattern=53]="StringPattern",e[e.String=54]="String",e[e.Symbol=55]="Symbol",e[e.TupleLength=56]="TupleLength",e[e.Tuple=57]="Tuple",e[e.Uint8ArrayMaxByteLength=58]="Uint8ArrayMaxByteLength",e[e.Uint8ArrayMinByteLength=59]="Uint8ArrayMinByteLength",e[e.Uint8Array=60]="Uint8Array",e[e.Undefined=61]="Undefined",e[e.Union=62]="Union",e[e.Void=63]="Void"})(h||(h={}));var dp=class extends ${constructor(t){super("Unknown type"),this.schema=t}};function Wr(e){return e.replace(/~/g,"~0").replace(/\\//g,"~1")}function B(e){return e!==void 0}var Or=class{constructor(t){this.iterator=t}[Symbol.iterator](){return this.iterator}First(){let t=this.iterator.next();return t.done?void 0:t.value}};function C(e,t,r,i,o=[]){return{type:e,schema:t,path:r,value:i,message:jf()({errorType:e,path:r,schema:t,value:i,errors:o}),errors:o}}function*rC(e,t,r,i){}function*nC(e,t,r,i){}function*iC(e,t,r,i){if(!A(i))return yield C(h.Array,e,r,i);B(e.minItems)&&!(i.length>=e.minItems)&&(yield C(h.ArrayMinItems,e,r,i)),B(e.maxItems)&&!(i.length<=e.maxItems)&&(yield C(h.ArrayMaxItems,e,r,i));for(let s=0;s<i.length;s++)yield*Ue(e.items,t,`${r}/${s}`,i[s]);if(e.uniqueItems===!0&&!function(){let s=new Set;for(let c of i){let l=ui(c);if(s.has(l))return!1;s.add(l)}return!0}()&&(yield C(h.ArrayUniqueItems,e,r,i)),!(B(e.contains)||B(e.minContains)||B(e.maxContains)))return;let o=B(e.contains)?e.contains:k(),a=i.reduce((s,c,l)=>Ue(o,t,`${r}${l}`,c).next().done===!0?s+1:s,0);a===0&&(yield C(h.ArrayContains,e,r,i)),le(e.minContains)&&a<e.minContains&&(yield C(h.ArrayMinContains,e,r,i)),le(e.maxContains)&&a>e.maxContains&&(yield C(h.ArrayMaxContains,e,r,i))}function*oC(e,t,r,i){bo(i)||(yield C(h.AsyncIterator,e,r,i))}function*aC(e,t,r,i){if(!$t(i))return yield C(h.BigInt,e,r,i);B(e.exclusiveMaximum)&&!(i<e.exclusiveMaximum)&&(yield C(h.BigIntExclusiveMaximum,e,r,i)),B(e.exclusiveMinimum)&&!(i>e.exclusiveMinimum)&&(yield C(h.BigIntExclusiveMinimum,e,r,i)),B(e.maximum)&&!(i<=e.maximum)&&(yield C(h.BigIntMaximum,e,r,i)),B(e.minimum)&&!(i>=e.minimum)&&(yield C(h.BigIntMinimum,e,r,i)),B(e.multipleOf)&&i%e.multipleOf!==BigInt(0)&&(yield C(h.BigIntMultipleOf,e,r,i))}function*sC(e,t,r,i){Jt(i)||(yield C(h.Boolean,e,r,i))}function*cC(e,t,r,i){yield*Ue(e.returns,t,r,i.prototype)}function*lC(e,t,r,i){if(!Ge(i))return yield C(h.Date,e,r,i);B(e.exclusiveMaximumTimestamp)&&!(i.getTime()<e.exclusiveMaximumTimestamp)&&(yield C(h.DateExclusiveMaximumTimestamp,e,r,i)),B(e.exclusiveMinimumTimestamp)&&!(i.getTime()>e.exclusiveMinimumTimestamp)&&(yield C(h.DateExclusiveMinimumTimestamp,e,r,i)),B(e.maximumTimestamp)&&!(i.getTime()<=e.maximumTimestamp)&&(yield C(h.DateMaximumTimestamp,e,r,i)),B(e.minimumTimestamp)&&!(i.getTime()>=e.minimumTimestamp)&&(yield C(h.DateMinimumTimestamp,e,r,i)),B(e.multipleOfTimestamp)&&i.getTime()%e.multipleOfTimestamp!==0&&(yield C(h.DateMultipleOfTimestamp,e,r,i))}function*pC(e,t,r,i){fr(i)||(yield C(h.Function,e,r,i))}function*mC(e,t,r,i){let o=globalThis.Object.values(e.$defs),a=e.$defs[e.$ref];yield*Ue(a,[...t,...o],r,i)}function*uC(e,t,r,i){if(!So(i))return yield C(h.Integer,e,r,i);B(e.exclusiveMaximum)&&!(i<e.exclusiveMaximum)&&(yield C(h.IntegerExclusiveMaximum,e,r,i)),B(e.exclusiveMinimum)&&!(i>e.exclusiveMinimum)&&(yield C(h.IntegerExclusiveMinimum,e,r,i)),B(e.maximum)&&!(i<=e.maximum)&&(yield C(h.IntegerMaximum,e,r,i)),B(e.minimum)&&!(i>=e.minimum)&&(yield C(h.IntegerMinimum,e,r,i)),B(e.multipleOf)&&i%e.multipleOf!==0&&(yield C(h.IntegerMultipleOf,e,r,i))}function*dC(e,t,r,i){let o=!1;for(let a of e.allOf)for(let s of Ue(a,t,r,i))o=!0,yield s;if(o)return yield C(h.Intersect,e,r,i);if(e.unevaluatedProperties===!1){let a=new RegExp(ni(e));for(let s of Object.getOwnPropertyNames(i))a.test(s)||(yield C(h.IntersectUnevaluatedProperties,e,`${r}/${s}`,i))}if(typeof e.unevaluatedProperties=="object"){let a=new RegExp(ni(e));for(let s of Object.getOwnPropertyNames(i))if(!a.test(s)){let c=Ue(e.unevaluatedProperties,t,`${r}/${s}`,i[s]).next();c.done||(yield c.value)}}}function*fC(e,t,r,i){Oo(i)||(yield C(h.Iterator,e,r,i))}function*hC(e,t,r,i){i!==e.const&&(yield C(h.Literal,e,r,i))}function*gC(e,t,r,i){yield C(h.Never,e,r,i)}function*yC(e,t,r,i){Ue(e.not,t,r,i).next().done===!0&&(yield C(h.Not,e,r,i))}function*bC(e,t,r,i){dr(i)||(yield C(h.Null,e,r,i))}function*OC(e,t,r,i){if(!Te.IsNumberLike(i))return yield C(h.Number,e,r,i);B(e.exclusiveMaximum)&&!(i<e.exclusiveMaximum)&&(yield C(h.NumberExclusiveMaximum,e,r,i)),B(e.exclusiveMinimum)&&!(i>e.exclusiveMinimum)&&(yield C(h.NumberExclusiveMinimum,e,r,i)),B(e.maximum)&&!(i<=e.maximum)&&(yield C(h.NumberMaximum,e,r,i)),B(e.minimum)&&!(i>=e.minimum)&&(yield C(h.NumberMinimum,e,r,i)),B(e.multipleOf)&&i%e.multipleOf!==0&&(yield C(h.NumberMultipleOf,e,r,i))}function*xC(e,t,r,i){if(!Te.IsObjectLike(i))return yield C(h.Object,e,r,i);B(e.minProperties)&&!(Object.getOwnPropertyNames(i).length>=e.minProperties)&&(yield C(h.ObjectMinProperties,e,r,i)),B(e.maxProperties)&&!(Object.getOwnPropertyNames(i).length<=e.maxProperties)&&(yield C(h.ObjectMaxProperties,e,r,i));let o=Array.isArray(e.required)?e.required:[],a=Object.getOwnPropertyNames(e.properties),s=Object.getOwnPropertyNames(i);for(let c of o)s.includes(c)||(yield C(h.ObjectRequiredProperty,e.properties[c],`${r}/${Wr(c)}`,void 0));if(e.additionalProperties===!1)for(let c of s)a.includes(c)||(yield C(h.ObjectAdditionalProperties,e,`${r}/${Wr(c)}`,i[c]));if(typeof e.additionalProperties=="object")for(let c of s)a.includes(c)||(yield*Ue(e.additionalProperties,t,`${r}/${Wr(c)}`,i[c]));for(let c of a){let l=e.properties[c];e.required&&e.required.includes(c)?(yield*Ue(l,t,`${r}/${Wr(c)}`,i[c]),Cn(e)&&!(c in i)&&(yield C(h.ObjectRequiredProperty,l,`${r}/${Wr(c)}`,void 0))):Te.IsExactOptionalProperty(i,c)&&(yield*Ue(l,t,`${r}/${Wr(c)}`,i[c]))}}function*SC(e,t,r,i){xo(i)||(yield C(h.Promise,e,r,i))}function*IC(e,t,r,i){if(!Te.IsRecordLike(i))return yield C(h.Object,e,r,i);B(e.minProperties)&&!(Object.getOwnPropertyNames(i).length>=e.minProperties)&&(yield C(h.ObjectMinProperties,e,r,i)),B(e.maxProperties)&&!(Object.getOwnPropertyNames(i).length<=e.maxProperties)&&(yield C(h.ObjectMaxProperties,e,r,i));let[o,a]=Object.entries(e.patternProperties)[0],s=new RegExp(o);for(let[c,l]of Object.entries(i))s.test(c)&&(yield*Ue(a,t,`${r}/${Wr(c)}`,l));if(typeof e.additionalProperties=="object")for(let[c,l]of Object.entries(i))s.test(c)||(yield*Ue(e.additionalProperties,t,`${r}/${Wr(c)}`,l));if(e.additionalProperties===!1){for(let[c,l]of Object.entries(i))if(!s.test(c))return yield C(h.ObjectAdditionalProperties,e,`${r}/${Wr(c)}`,l)}}function*wC(e,t,r,i){yield*Ue(Y(e,t),t,r,i)}function*CC(e,t,r,i){if(!X(i))return yield C(h.String,e,r,i);if(B(e.minLength)&&!(i.length>=e.minLength)&&(yield C(h.StringMinLength,e,r,i)),B(e.maxLength)&&!(i.length<=e.maxLength)&&(yield C(h.StringMaxLength,e,r,i)),!new RegExp(e.source,e.flags).test(i))return yield C(h.RegExp,e,r,i)}function*TC(e,t,r,i){if(!X(i))return yield C(h.String,e,r,i);B(e.minLength)&&!(i.length>=e.minLength)&&(yield C(h.StringMinLength,e,r,i)),B(e.maxLength)&&!(i.length<=e.maxLength)&&(yield C(h.StringMaxLength,e,r,i)),X(e.pattern)&&(new RegExp(e.pattern).test(i)||(yield C(h.StringPattern,e,r,i))),X(e.format)&&(Ut.Has(e.format)?Ut.Get(e.format)(i)||(yield C(h.StringFormat,e,r,i)):yield C(h.StringFormatUnknown,e,r,i))}function*PC(e,t,r,i){hr(i)||(yield C(h.Symbol,e,r,i))}function*EC(e,t,r,i){if(!X(i))return yield C(h.String,e,r,i);new RegExp(e.pattern).test(i)||(yield C(h.StringPattern,e,r,i))}function*AC(e,t,r,i){yield*Ue(Y(e,t),t,r,i)}function*$C(e,t,r,i){if(!A(i))return yield C(h.Tuple,e,r,i);if(e.items===void 0&&i.length!==0)return yield C(h.TupleLength,e,r,i);if(i.length!==e.maxItems)return yield C(h.TupleLength,e,r,i);if(e.items)for(let o=0;o<e.items.length;o++)yield*Ue(e.items[o],t,`${r}/${o}`,i[o])}function*vC(e,t,r,i){ce(i)||(yield C(h.Undefined,e,r,i))}function*LC(e,t,r,i){if(F(e,t,i))return;let o=e.anyOf.map(a=>new Or(Ue(a,t,r,i)));yield C(h.Union,e,r,i,o)}function*NC(e,t,r,i){if(!Jn(i))return yield C(h.Uint8Array,e,r,i);B(e.maxByteLength)&&!(i.length<=e.maxByteLength)&&(yield C(h.Uint8ArrayMaxByteLength,e,r,i)),B(e.minByteLength)&&!(i.length>=e.minByteLength)&&(yield C(h.Uint8ArrayMinByteLength,e,r,i))}function*RC(e,t,r,i){}function*kC(e,t,r,i){Te.IsVoidLike(i)||(yield C(h.Void,e,r,i))}function*FC(e,t,r,i){_t.Get(e[g])(e,i)||(yield C(h.Kind,e,r,i))}function*Ue(e,t,r,i){let o=B(e.$id)?[...t,e]:t,a=e;switch(a[g]){case"Any":return yield*rC(a,o,r,i);case"Argument":return yield*nC(a,o,r,i);case"Array":return yield*iC(a,o,r,i);case"AsyncIterator":return yield*oC(a,o,r,i);case"BigInt":return yield*aC(a,o,r,i);case"Boolean":return yield*sC(a,o,r,i);case"Constructor":return yield*cC(a,o,r,i);case"Date":return yield*lC(a,o,r,i);case"Function":return yield*pC(a,o,r,i);case"Import":return yield*mC(a,o,r,i);case"Integer":return yield*uC(a,o,r,i);case"Intersect":return yield*dC(a,o,r,i);case"Iterator":return yield*fC(a,o,r,i);case"Literal":return yield*hC(a,o,r,i);case"Never":return yield*gC(a,o,r,i);case"Not":return yield*yC(a,o,r,i);case"Null":return yield*bC(a,o,r,i);case"Number":return yield*OC(a,o,r,i);case"Object":return yield*xC(a,o,r,i);case"Promise":return yield*SC(a,o,r,i);case"Record":return yield*IC(a,o,r,i);case"Ref":return yield*wC(a,o,r,i);case"RegExp":return yield*CC(a,o,r,i);case"String":return yield*TC(a,o,r,i);case"Symbol":return yield*PC(a,o,r,i);case"TemplateLiteral":return yield*EC(a,o,r,i);case"This":return yield*AC(a,o,r,i);case"Tuple":return yield*$C(a,o,r,i);case"Undefined":return yield*vC(a,o,r,i);case"Union":return yield*LC(a,o,r,i);case"Uint8Array":return yield*NC(a,o,r,i);case"Unknown":return yield*RC(a,o,r,i);case"Void":return yield*kC(a,o,r,i);default:if(!_t.Has(a[g]))throw new dp(e);return yield*FC(a,o,r,i)}}function Tn(...e){let t=e.length===3?Ue(e[0],e[1],"",e[2]):Ue(e[0],[],"",e[1]);return new Or(t)}var jC=function(e,t,r,i,o){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!o)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?o.call(e,r):o?o.value=r:t.set(e,r),r},Bf=function(e,t,r,i){if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?i:r==="a"?i.call(e):i?i.value:t.get(e)},fp,Fs,Vf,js=class extends ${constructor(t){let r=t.First();super(r===void 0?"Invalid Value":r.message),fp.add(this),Fs.set(this,void 0),jC(this,Fs,t,"f"),this.error=r}Errors(){return new Or(Bf(this,fp,"m",Vf).call(this))}};Fs=new WeakMap,fp=new WeakSet,Vf=function*(){this.error&&(yield this.error),yield*Bf(this,Fs,"f")};function Mf(e,t,r){if(!F(e,t,r))throw new js(Tn(e,t,r))}function aa(...e){return e.length===3?Mf(e[0],e[1],e[2]):Mf(e[0],[],e[1])}function UC(e){let t={};for(let r of Object.getOwnPropertyNames(e))t[r]=W(e[r]);for(let r of Object.getOwnPropertySymbols(e))t[r]=W(e[r]);return t}function _C(e){return e.map(t=>W(t))}function DC(e){return e.slice()}function MC(e){return new Map(W([...e.entries()]))}function BC(e){return new Set(W([...e.entries()]))}function VC(e){return new Date(e.toISOString())}function W(e){if(A(e))return _C(e);if(Ge(e))return VC(e);if(ht(e))return DC(e);if(xl(e))return MC(e);if(Sl(e))return BC(e);if(L(e))return UC(e);if(it(e))return e;throw new Error("ValueClone: Unable to clone value")}var pt=class extends ${constructor(t,r){super(r),this.schema=t}};function J(e){return fr(e)?e():W(e)}function KC(e,t){return E(e,"default")?J(e.default):{}}function GC(e,t){return{}}function qC(e,t){if(e.uniqueItems===!0&&!E(e,"default"))throw new pt(e,"Array with the uniqueItems constraint requires a default value");if("contains"in e&&!E(e,"default"))throw new pt(e,"Array with the contains constraint requires a default value");return"default"in e?J(e.default):e.minItems!==void 0?Array.from({length:e.minItems}).map(r=>xt(e.items,t)):[]}function WC(e,t){return E(e,"default")?J(e.default):async function*(){}()}function HC(e,t){return E(e,"default")?J(e.default):BigInt(0)}function zC(e,t){return E(e,"default")?J(e.default):!1}function JC(e,t){if(E(e,"default"))return J(e.default);{let r=xt(e.returns,t);return typeof r=="object"&&!Array.isArray(r)?class{constructor(){for(let[i,o]of Object.entries(r)){let a=this;a[i]=o}}}:class{}}}function YC(e,t){return E(e,"default")?J(e.default):e.minimumTimestamp!==void 0?new Date(e.minimumTimestamp):new Date}function QC(e,t){return E(e,"default")?J(e.default):()=>xt(e.returns,t)}function XC(e,t){let r=globalThis.Object.values(e.$defs),i=e.$defs[e.$ref];return xt(i,[...t,...r])}function ZC(e,t){return E(e,"default")?J(e.default):e.minimum!==void 0?e.minimum:0}function eT(e,t){if(E(e,"default"))return J(e.default);{let r=e.allOf.reduce((i,o)=>{let a=xt(o,t);return typeof a=="object"?{...i,...a}:a},{});if(!F(e,t,r))throw new pt(e,"Intersect produced invalid value. Consider using a default value.");return r}}function tT(e,t){return E(e,"default")?J(e.default):function*(){}()}function rT(e,t){return E(e,"default")?J(e.default):e.const}function nT(e,t){if(E(e,"default"))return J(e.default);throw new pt(e,"Never types cannot be created. Consider using a default value.")}function iT(e,t){if(E(e,"default"))return J(e.default);throw new pt(e,"Not types must have a default value")}function oT(e,t){return E(e,"default")?J(e.default):null}function aT(e,t){return E(e,"default")?J(e.default):e.minimum!==void 0?e.minimum:0}function sT(e,t){if(E(e,"default"))return J(e.default);{let r=new Set(e.required),i={};for(let[o,a]of Object.entries(e.properties))r.has(o)&&(i[o]=xt(a,t));return i}}function cT(e,t){return E(e,"default")?J(e.default):Promise.resolve(xt(e.item,t))}function lT(e,t){return E(e,"default")?J(e.default):{}}function pT(e,t){return E(e,"default")?J(e.default):xt(Y(e,t),t)}function mT(e,t){if(E(e,"default"))return J(e.default);throw new pt(e,"RegExp types cannot be created. Consider using a default value.")}function uT(e,t){if(e.pattern!==void 0){if(E(e,"default"))return J(e.default);throw new pt(e,"String types with patterns must specify a default value")}else if(e.format!==void 0){if(E(e,"default"))return J(e.default);throw new pt(e,"String types with formats must specify a default value")}else return E(e,"default")?J(e.default):e.minLength!==void 0?Array.from({length:e.minLength}).map(()=>" ").join(""):""}function dT(e,t){return E(e,"default")?J(e.default):"value"in e?Symbol.for(e.value):Symbol()}function fT(e,t){if(E(e,"default"))return J(e.default);if(!vo(e))throw new pt(e,"Can only create template literals that produce a finite variants. Consider using a default value.");return Zn(e)[0]}function hT(e,t){if(Kf++>wT)throw new pt(e,"Cannot create recursive type as it appears possibly infinite. Consider using a default.");return E(e,"default")?J(e.default):xt(Y(e,t),t)}function gT(e,t){return E(e,"default")?J(e.default):e.items===void 0?[]:Array.from({length:e.minItems}).map((r,i)=>xt(e.items[i],t))}function yT(e,t){if(E(e,"default"))return J(e.default)}function bT(e,t){if(E(e,"default"))return J(e.default);if(e.anyOf.length===0)throw new Error("ValueCreate.Union: Cannot create Union with zero variants");return xt(e.anyOf[0],t)}function OT(e,t){return E(e,"default")?J(e.default):e.minByteLength!==void 0?new Uint8Array(e.minByteLength):new Uint8Array(0)}function xT(e,t){return E(e,"default")?J(e.default):{}}function ST(e,t){if(E(e,"default"))return J(e.default)}function IT(e,t){if(E(e,"default"))return J(e.default);throw new Error("User defined types must specify a default value")}function xt(e,t){let r=Fe(e,t),i=e;switch(i[g]){case"Any":return KC(i,r);case"Argument":return GC(i,r);case"Array":return qC(i,r);case"AsyncIterator":return WC(i,r);case"BigInt":return HC(i,r);case"Boolean":return zC(i,r);case"Constructor":return JC(i,r);case"Date":return YC(i,r);case"Function":return QC(i,r);case"Import":return XC(i,r);case"Integer":return ZC(i,r);case"Intersect":return eT(i,r);case"Iterator":return tT(i,r);case"Literal":return rT(i,r);case"Never":return nT(i,r);case"Not":return iT(i,r);case"Null":return oT(i,r);case"Number":return aT(i,r);case"Object":return sT(i,r);case"Promise":return cT(i,r);case"Record":return lT(i,r);case"Ref":return pT(i,r);case"RegExp":return mT(i,r);case"String":return uT(i,r);case"Symbol":return dT(i,r);case"TemplateLiteral":return fT(i,r);case"This":return hT(i,r);case"Tuple":return gT(i,r);case"Undefined":return yT(i,r);case"Union":return bT(i,r);case"Uint8Array":return OT(i,r);case"Unknown":return xT(i,r);case"Void":return ST(i,r);default:if(!_t.Has(i[g]))throw new pt(i,"Unknown type");return IT(i,r)}}var wT=512,Kf=0;function Kt(...e){return Kf=0,e.length===2?xt(e[0],e[1]):xt(e[0],[])}var sa=class extends ${constructor(t,r){super(r),this.schema=t}};function Gf(e,t,r){if(e[g]==="Object"&&typeof r=="object"&&!dr(r)){let i=e,o=Object.getOwnPropertyNames(r),a=Object.entries(i.properties),[s,c]=[1/a.length,a.length];return a.reduce((l,[p,m])=>{let u=m[g]==="Literal"&&m.const===r[p]?c:0,f=F(m,t,r[p])?s:0,O=o.includes(p)?s:0;return l+(u+f+O)},0)}else if(e[g]==="Union"){let o=e.anyOf.map(a=>Y(a,t)).map(a=>Gf(a,t,r));return Math.max(...o)}else return F(e,t,r)?1:0}function CT(e,t,r){let i=e.anyOf.map(s=>Y(s,t)),[o,a]=[i[0],0];for(let s of i){let c=Gf(s,t,r);c>a&&(o=s,a=c)}return o}function TT(e,t,r){if("default"in e)return typeof r=="function"?e.default:W(e.default);{let i=CT(e,t,r);return Mi(i,t,r)}}function PT(e,t,r){return F(e,t,r)?W(r):Kt(e,t)}function ET(e,t,r){return F(e,t,r)?r:Kt(e,t)}function AT(e,t,r){if(F(e,t,r))return W(r);let i=A(r)?W(r):Kt(e,t),o=le(e.minItems)&&i.length<e.minItems?[...i,...Array.from({length:e.minItems-i.length},()=>null)]:i,s=(le(e.maxItems)&&o.length>e.maxItems?o.slice(0,e.maxItems):o).map(l=>nr(e.items,t,l));if(e.uniqueItems!==!0)return s;let c=[...new Set(s)];if(!F(e,t,c))throw new sa(e,"Array cast produced invalid data due to uniqueItems constraint");return c}function $T(e,t,r){if(F(e,t,r))return Kt(e,t);let i=new Set(e.returns.required||[]),o=function(){};for(let[a,s]of Object.entries(e.returns.properties))!i.has(a)&&r.prototype[a]===void 0||(o.prototype[a]=nr(s,t,r.prototype[a]));return o}function vT(e,t,r){let i=globalThis.Object.values(e.$defs),o=e.$defs[e.$ref];return nr(o,[...t,...i],r)}function qf(e,t){return L(e)&&!L(t)||!L(e)&&L(t)?e:!L(e)||!L(t)?t:globalThis.Object.getOwnPropertyNames(e).reduce((r,i)=>{let o=i in t?qf(e[i],t[i]):e[i];return{...r,[i]:o}},{})}function LT(e,t,r){if(F(e,t,r))return r;let i=Kt(e,t),o=qf(i,r);return F(e,t,o)?o:i}function NT(e,t,r){throw new sa(e,"Never types cannot be cast")}function RT(e,t,r){if(F(e,t,r))return r;if(r===null||typeof r!="object")return Kt(e,t);let i=new Set(e.required||[]),o={};for(let[a,s]of Object.entries(e.properties))!i.has(a)&&r[a]===void 0||(o[a]=nr(s,t,r[a]));if(typeof e.additionalProperties=="object"){let a=Object.getOwnPropertyNames(e.properties);for(let s of Object.getOwnPropertyNames(r))a.includes(s)||(o[s]=nr(e.additionalProperties,t,r[s]))}return o}function kT(e,t,r){if(F(e,t,r))return W(r);if(r===null||typeof r!="object"||Array.isArray(r)||r instanceof Date)return Kt(e,t);let i=Object.getOwnPropertyNames(e.patternProperties)[0],o=e.patternProperties[i],a={};for(let[s,c]of Object.entries(r))a[s]=nr(o,t,c);return a}function FT(e,t,r){return nr(Y(e,t),t,r)}function jT(e,t,r){return nr(Y(e,t),t,r)}function UT(e,t,r){return F(e,t,r)?W(r):A(r)?e.items===void 0?[]:e.items.map((i,o)=>nr(i,t,r[o])):Kt(e,t)}function _T(e,t,r){return F(e,t,r)?W(r):TT(e,t,r)}function nr(e,t,r){let i=X(e.$id)?Fe(e,t):t,o=e;switch(e[g]){case"Array":return AT(o,i,r);case"Constructor":return $T(o,i,r);case"Import":return vT(o,i,r);case"Intersect":return LT(o,i,r);case"Never":return NT(o,i,r);case"Object":return RT(o,i,r);case"Record":return kT(o,i,r);case"Ref":return FT(o,i,r);case"This":return jT(o,i,r);case"Tuple":return UT(o,i,r);case"Union":return _T(o,i,r);case"Date":case"Symbol":case"Uint8Array":return PT(e,t,r);default:return ET(o,i,r)}}function Mi(...e){return e.length===3?nr(e[0],e[1],e[2]):nr(e[0],[],e[1])}function DT(e){return $r(e)&&e[g]!=="Unsafe"}function MT(e,t,r){return A(r)?r.map(i=>mt(e.items,t,i)):r}function BT(e,t,r){let i=globalThis.Object.values(e.$defs),o=e.$defs[e.$ref];return mt(o,[...t,...i],r)}function VT(e,t,r){let i=e.unevaluatedProperties,a=e.allOf.map(c=>mt(c,t,W(r))).reduce((c,l)=>L(l)?{...c,...l}:l,{});if(!L(r)||!L(a)||!$r(i))return a;let s=Ze(e);for(let c of Object.getOwnPropertyNames(r))s.includes(c)||F(i,t,r[c])&&(a[c]=mt(i,t,r[c]));return a}function KT(e,t,r){if(!L(r)||A(r))return r;let i=e.additionalProperties;for(let o of Object.getOwnPropertyNames(r)){if(E(e.properties,o)){r[o]=mt(e.properties[o],t,r[o]);continue}if($r(i)&&F(i,t,r[o])){r[o]=mt(i,t,r[o]);continue}delete r[o]}return r}function GT(e,t,r){if(!L(r))return r;let i=e.additionalProperties,o=Object.getOwnPropertyNames(r),[a,s]=Object.entries(e.patternProperties)[0],c=new RegExp(a);for(let l of o){if(c.test(l)){r[l]=mt(s,t,r[l]);continue}if($r(i)&&F(i,t,r[l])){r[l]=mt(i,t,r[l]);continue}delete r[l]}return r}function qT(e,t,r){return mt(Y(e,t),t,r)}function WT(e,t,r){return mt(Y(e,t),t,r)}function HT(e,t,r){if(!A(r))return r;if(ce(e.items))return[];let i=Math.min(r.length,e.items.length);for(let o=0;o<i;o++)r[o]=mt(e.items[o],t,r[o]);return r.length>i?r.slice(0,i):r}function zT(e,t,r){for(let i of e.anyOf)if(DT(i)&&F(i,t,r))return mt(i,t,r);return r}function mt(e,t,r){let i=X(e.$id)?Fe(e,t):t,o=e;switch(o[g]){case"Array":return MT(o,i,r);case"Import":return BT(o,i,r);case"Intersect":return VT(o,i,r);case"Object":return KT(o,i,r);case"Record":return GT(o,i,r);case"Ref":return qT(o,i,r);case"This":return WT(o,i,r);case"Tuple":return HT(o,i,r);case"Union":return zT(o,i,r);default:return r}}function ca(...e){return e.length===3?mt(e[0],e[1],e[2]):mt(e[0],[],e[1])}function Us(e){return X(e)&&!isNaN(e)&&!isNaN(parseFloat(e))}function JT(e){return $t(e)||Jt(e)||le(e)}function la(e){return e===!0||le(e)&&e===1||$t(e)&&e===BigInt("1")||X(e)&&(e.toLowerCase()==="true"||e==="1")}function pa(e){return e===!1||le(e)&&(e===0||Object.is(e,-0))||$t(e)&&e===BigInt("0")||X(e)&&(e.toLowerCase()==="false"||e==="0"||e==="-0")}function YT(e){return X(e)&&/^(?:[0-2]\\d:[0-5]\\d:[0-5]\\d|23:59:60)(?:\\.\\d+)?(?:z|[+-]\\d\\d(?::?\\d\\d)?)$/i.test(e)}function QT(e){return X(e)&&/^(?:[0-2]\\d:[0-5]\\d:[0-5]\\d|23:59:60)?$/i.test(e)}function XT(e){return X(e)&&/^\\d\\d\\d\\d-[0-1]\\d-[0-3]\\dt(?:[0-2]\\d:[0-5]\\d:[0-5]\\d|23:59:60)(?:\\.\\d+)?(?:z|[+-]\\d\\d(?::?\\d\\d)?)$/i.test(e)}function ZT(e){return X(e)&&/^\\d\\d\\d\\d-[0-1]\\d-[0-3]\\dt(?:[0-2]\\d:[0-5]\\d:[0-5]\\d|23:59:60)?$/i.test(e)}function eP(e){return X(e)&&/^\\d\\d\\d\\d-[0-1]\\d-[0-3]\\d$/i.test(e)}function tP(e,t){let r=Hf(e);return r===t?r:e}function rP(e,t){let r=zf(e);return r===t?r:e}function nP(e,t){let r=Wf(e);return r===t?r:e}function iP(e,t){return X(e.const)?tP(t,e.const):le(e.const)?rP(t,e.const):Jt(e.const)?nP(t,e.const):t}function Wf(e){return la(e)?!0:pa(e)?!1:e}function oP(e){let t=r=>r.split(".")[0];return Us(e)?BigInt(t(e)):le(e)?BigInt(Math.trunc(e)):pa(e)?BigInt(0):la(e)?BigInt(1):e}function Hf(e){return hr(e)&&e.description!==void 0?e.description.toString():JT(e)?e.toString():e}function zf(e){return Us(e)?parseFloat(e):la(e)?1:pa(e)?0:e}function aP(e){return Us(e)?parseInt(e):le(e)?Math.trunc(e):la(e)?1:pa(e)?0:e}function sP(e){return X(e)&&e.toLowerCase()==="null"?null:e}function cP(e){return X(e)&&e==="undefined"?void 0:e}function lP(e){return Ge(e)?e:le(e)?new Date(e):la(e)?new Date(1):pa(e)?new Date(0):Us(e)?new Date(parseInt(e)):QT(e)?new Date(`1970-01-01T${e}.000Z`):YT(e)?new Date(`1970-01-01T${e}`):ZT(e)?new Date(`${e}.000Z`):XT(e)?new Date(e):eP(e)?new Date(`${e}T00:00:00.000Z`):e}function pP(e,t,r){return(A(r)?r:[r]).map(o=>ir(e.items,t,o))}function mP(e,t,r){return oP(r)}function uP(e,t,r){return Wf(r)}function dP(e,t,r){return lP(r)}function fP(e,t,r){let i=globalThis.Object.values(e.$defs),o=e.$defs[e.$ref];return ir(o,[...t,...i],r)}function hP(e,t,r){return aP(r)}function gP(e,t,r){return e.allOf.reduce((i,o)=>ir(o,t,i),r)}function yP(e,t,r){return iP(e,r)}function bP(e,t,r){return sP(r)}function OP(e,t,r){return zf(r)}function xP(e,t,r){if(!L(r))return r;for(let i of Object.getOwnPropertyNames(e.properties))E(r,i)&&(r[i]=ir(e.properties[i],t,r[i]));return r}function SP(e,t,r){if(!L(r))return r;let o=Object.getOwnPropertyNames(e.patternProperties)[0],a=e.patternProperties[o];for(let[s,c]of Object.entries(r))r[s]=ir(a,t,c);return r}function IP(e,t,r){return ir(Y(e,t),t,r)}function wP(e,t,r){return Hf(r)}function CP(e,t,r){return X(r)||le(r)?Symbol(r):r}function TP(e,t,r){return ir(Y(e,t),t,r)}function PP(e,t,r){return A(r)&&!ce(e.items)?r.map((o,a)=>a<e.items.length?ir(e.items[a],t,o):o):r}function EP(e,t,r){return cP(r)}function AP(e,t,r){for(let i of e.anyOf)if(F(i,t,r))return r;for(let i of e.anyOf){let o=ir(i,t,W(r));if(F(i,t,o))return o}return r}function ir(e,t,r){let i=Fe(e,t),o=e;switch(e[g]){case"Array":return pP(o,i,r);case"BigInt":return mP(o,i,r);case"Boolean":return uP(o,i,r);case"Date":return dP(o,i,r);case"Import":return fP(o,i,r);case"Integer":return hP(o,i,r);case"Intersect":return gP(o,i,r);case"Literal":return yP(o,i,r);case"Null":return bP(o,i,r);case"Number":return OP(o,i,r);case"Object":return xP(o,i,r);case"Record":return SP(o,i,r);case"Ref":return IP(o,i,r);case"String":return wP(o,i,r);case"Symbol":return CP(o,i,r);case"This":return TP(o,i,r);case"Tuple":return PP(o,i,r);case"Undefined":return EP(o,i,r);case"Union":return AP(o,i,r);default:return r}}function ma(...e){return e.length===3?ir(e[0],e[1],e[2]):ir(e[0],[],e[1])}var ua=class extends ${constructor(t,r,i){super("Unable to decode value as it does not match the expected schema"),this.schema=t,this.value=r,this.error=i}},_s=class extends ${constructor(t,r,i,o){super(o instanceof Error?o.message:"Unknown error"),this.schema=t,this.path=r,this.value=i,this.error=o}};function ge(e,t,r){try{return z(e)?e[ue].Decode(r):r}catch(i){throw new _s(e,t,r,i)}}function $P(e,t,r,i){return A(i)?ge(e,r,i.map((o,a)=>or(e.items,t,`${r}/${a}`,o))):ge(e,r,i)}function vP(e,t,r,i){if(!L(i)||it(i))return ge(e,r,i);let o=Fo(e),a=o.map(m=>m[0]),s={...i};for(let[m,u]of o)m in s&&(s[m]=or(u,t,`${r}/${m}`,s[m]));if(!z(e.unevaluatedProperties))return ge(e,r,s);let c=Object.getOwnPropertyNames(s),l=e.unevaluatedProperties,p={...s};for(let m of c)a.includes(m)||(p[m]=ge(l,`${r}/${m}`,p[m]));return ge(e,r,p)}function LP(e,t,r,i){let o=globalThis.Object.values(e.$defs),a=e.$defs[e.$ref],s=or(a,[...t,...o],r,i);return ge(e,r,s)}function NP(e,t,r,i){return ge(e,r,or(e.not,t,r,i))}function RP(e,t,r,i){if(!L(i))return ge(e,r,i);let o=Ze(e),a={...i};for(let p of o)E(a,p)&&(ce(a[p])&&(!br(e.properties[p])||Te.IsExactOptionalProperty(a,p))||(a[p]=or(e.properties[p],t,`${r}/${p}`,a[p])));if(!de(e.additionalProperties))return ge(e,r,a);let s=Object.getOwnPropertyNames(a),c=e.additionalProperties,l={...a};for(let p of s)o.includes(p)||(l[p]=ge(c,`${r}/${p}`,l[p]));return ge(e,r,l)}function kP(e,t,r,i){if(!L(i))return ge(e,r,i);let o=Object.getOwnPropertyNames(e.patternProperties)[0],a=new RegExp(o),s={...i};for(let m of Object.getOwnPropertyNames(i))a.test(m)&&(s[m]=or(e.patternProperties[o],t,`${r}/${m}`,s[m]));if(!de(e.additionalProperties))return ge(e,r,s);let c=Object.getOwnPropertyNames(s),l=e.additionalProperties,p={...s};for(let m of c)a.test(m)||(p[m]=ge(l,`${r}/${m}`,p[m]));return ge(e,r,p)}function FP(e,t,r,i){let o=Y(e,t);return ge(e,r,or(o,t,r,i))}function jP(e,t,r,i){let o=Y(e,t);return ge(e,r,or(o,t,r,i))}function UP(e,t,r,i){return A(i)&&A(e.items)?ge(e,r,e.items.map((o,a)=>or(o,t,`${r}/${a}`,i[a]))):ge(e,r,i)}function _P(e,t,r,i){for(let o of e.anyOf){if(!F(o,t,i))continue;let a=or(o,t,r,i);return ge(e,r,a)}return ge(e,r,i)}function or(e,t,r,i){let o=Fe(e,t),a=e;switch(e[g]){case"Array":return $P(a,o,r,i);case"Import":return LP(a,o,r,i);case"Intersect":return vP(a,o,r,i);case"Not":return NP(a,o,r,i);case"Object":return RP(a,o,r,i);case"Record":return kP(a,o,r,i);case"Ref":return FP(a,o,r,i);case"Symbol":return ge(a,r,i);case"This":return jP(a,o,r,i);case"Tuple":return UP(a,o,r,i);case"Union":return _P(a,o,r,i);default:return ge(a,r,i)}}function da(e,t,r){return or(e,t,"",r)}var fa=class extends ${constructor(t,r,i){super("The encoded value does not match the expected schema"),this.schema=t,this.value=r,this.error=i}},Ds=class extends ${constructor(t,r,i,o){super(`${o instanceof Error?o.message:"Unknown error"}`),this.schema=t,this.path=r,this.value=i,this.error=o}};function Ve(e,t,r){try{return z(e)?e[ue].Encode(r):r}catch(i){throw new Ds(e,t,r,i)}}function DP(e,t,r,i){let o=Ve(e,r,i);return A(o)?o.map((a,s)=>ar(e.items,t,`${r}/${s}`,a)):o}function MP(e,t,r,i){let o=globalThis.Object.values(e.$defs),a=e.$defs[e.$ref],s=Ve(e,r,i);return ar(a,[...t,...o],r,s)}function BP(e,t,r,i){let o=Ve(e,r,i);if(!L(i)||it(i))return o;let a=Fo(e),s=a.map(u=>u[0]),c={...o};for(let[u,f]of a)u in c&&(c[u]=ar(f,t,`${r}/${u}`,c[u]));if(!z(e.unevaluatedProperties))return c;let l=Object.getOwnPropertyNames(c),p=e.unevaluatedProperties,m={...c};for(let u of l)s.includes(u)||(m[u]=Ve(p,`${r}/${u}`,m[u]));return m}function VP(e,t,r,i){return Ve(e.not,r,Ve(e,r,i))}function KP(e,t,r,i){let o=Ve(e,r,i);if(!L(o))return o;let a=Ze(e),s={...o};for(let m of a)E(s,m)&&(ce(s[m])&&(!br(e.properties[m])||Te.IsExactOptionalProperty(s,m))||(s[m]=ar(e.properties[m],t,`${r}/${m}`,s[m])));if(!de(e.additionalProperties))return s;let c=Object.getOwnPropertyNames(s),l=e.additionalProperties,p={...s};for(let m of c)a.includes(m)||(p[m]=Ve(l,`${r}/${m}`,p[m]));return p}function GP(e,t,r,i){let o=Ve(e,r,i);if(!L(i))return o;let a=Object.getOwnPropertyNames(e.patternProperties)[0],s=new RegExp(a),c={...o};for(let u of Object.getOwnPropertyNames(i))s.test(u)&&(c[u]=ar(e.patternProperties[a],t,`${r}/${u}`,c[u]));if(!de(e.additionalProperties))return c;let l=Object.getOwnPropertyNames(c),p=e.additionalProperties,m={...c};for(let u of l)s.test(u)||(m[u]=Ve(p,`${r}/${u}`,m[u]));return m}function qP(e,t,r,i){let o=Y(e,t),a=ar(o,t,r,i);return Ve(e,r,a)}function WP(e,t,r,i){let o=Y(e,t),a=ar(o,t,r,i);return Ve(e,r,a)}function HP(e,t,r,i){let o=Ve(e,r,i);return A(e.items)?e.items.map((a,s)=>ar(a,t,`${r}/${s}`,o[s])):[]}function zP(e,t,r,i){for(let o of e.anyOf){if(!F(o,t,i))continue;let a=ar(o,t,r,i);return Ve(e,r,a)}for(let o of e.anyOf){let a=ar(o,t,r,i);if(F(e,t,a))return Ve(e,r,a)}return Ve(e,r,i)}function ar(e,t,r,i){let o=Fe(e,t),a=e;switch(e[g]){case"Array":return DP(a,o,r,i);case"Import":return MP(a,o,r,i);case"Intersect":return BP(a,o,r,i);case"Not":return VP(a,o,r,i);case"Object":return KP(a,o,r,i);case"Record":return GP(a,o,r,i);case"Ref":return qP(a,o,r,i);case"This":return WP(a,o,r,i);case"Tuple":return HP(a,o,r,i);case"Union":return zP(a,o,r,i);default:return Ve(a,r,i)}}function ha(e,t,r){return ar(e,t,"",r)}function JP(e,t){return z(e)||ve(e.items,t)}function YP(e,t){return z(e)||ve(e.items,t)}function QP(e,t){return z(e)||ve(e.returns,t)||e.parameters.some(r=>ve(r,t))}function XP(e,t){return z(e)||ve(e.returns,t)||e.parameters.some(r=>ve(r,t))}function ZP(e,t){return z(e)||z(e.unevaluatedProperties)||e.allOf.some(r=>ve(r,t))}function eE(e,t){let r=globalThis.Object.getOwnPropertyNames(e.$defs).reduce((o,a)=>[...o,e.$defs[a]],[]),i=e.$defs[e.$ref];return z(e)||ve(i,[...r,...t])}function tE(e,t){return z(e)||ve(e.items,t)}function rE(e,t){return z(e)||ve(e.not,t)}function nE(e,t){return z(e)||Object.values(e.properties).some(r=>ve(r,t))||de(e.additionalProperties)&&ve(e.additionalProperties,t)}function iE(e,t){return z(e)||ve(e.item,t)}function oE(e,t){let r=Object.getOwnPropertyNames(e.patternProperties)[0],i=e.patternProperties[r];return z(e)||ve(i,t)||de(e.additionalProperties)&&z(e.additionalProperties)}function aE(e,t){return z(e)?!0:ve(Y(e,t),t)}function sE(e,t){return z(e)?!0:ve(Y(e,t),t)}function cE(e,t){return z(e)||!ce(e.items)&&e.items.some(r=>ve(r,t))}function lE(e,t){return z(e)||e.anyOf.some(r=>ve(r,t))}function ve(e,t){let r=Fe(e,t),i=e;if(e.$id&&hp.has(e.$id))return!1;switch(e.$id&&hp.add(e.$id),e[g]){case"Array":return JP(i,r);case"AsyncIterator":return YP(i,r);case"Constructor":return QP(i,r);case"Function":return XP(i,r);case"Import":return eE(i,r);case"Intersect":return ZP(i,r);case"Iterator":return tE(i,r);case"Not":return rE(i,r);case"Object":return nE(i,r);case"Promise":return iE(i,r);case"Record":return oE(i,r);case"Ref":return aE(i,r);case"This":return sE(i,r);case"Tuple":return cE(i,r);case"Union":return lE(i,r);default:return z(e)}}var hp=new Set;function Pn(e,t){return hp.clear(),ve(e,t)}function gp(...e){let[t,r,i]=e.length===3?[e[0],e[1],e[2]]:[e[0],[],e[1]];if(!F(t,r,i))throw new ua(t,i,Tn(t,r,i).First());return Pn(t,r)?da(t,r,i):i}function Hr(e,t){let r=E(e,"default")?e.default:void 0,i=fr(r)?r():W(r);return ce(t)?i:L(t)&&L(i)?Object.assign(i,t):t}function yp(e){return $r(e)&&"default"in e}function pE(e,t,r){if(A(r)){for(let o=0;o<r.length;o++)r[o]=et(e.items,t,r[o]);return r}let i=Hr(e,r);if(!A(i))return i;for(let o=0;o<i.length;o++)i[o]=et(e.items,t,i[o]);return i}function mE(e,t,r){return Ge(r)?r:Hr(e,r)}function uE(e,t,r){let i=globalThis.Object.values(e.$defs),o=e.$defs[e.$ref];return et(o,[...t,...i],r)}function dE(e,t,r){let i=Hr(e,r);return e.allOf.reduce((o,a)=>{let s=et(a,t,i);return L(s)?{...o,...s}:s},{})}function fE(e,t,r){let i=Hr(e,r);if(!L(i))return i;let o=Object.getOwnPropertyNames(e.properties);for(let a of o){let s=et(e.properties[a],t,i[a]);ce(s)||(i[a]=et(e.properties[a],t,i[a]))}if(!yp(e.additionalProperties))return i;for(let a of Object.getOwnPropertyNames(i))o.includes(a)||(i[a]=et(e.additionalProperties,t,i[a]));return i}function hE(e,t,r){let i=Hr(e,r);if(!L(i))return i;let o=e.additionalProperties,[a,s]=Object.entries(e.patternProperties)[0],c=new RegExp(a);for(let l of Object.getOwnPropertyNames(i))c.test(l)&&yp(s)&&(i[l]=et(s,t,i[l]));if(!yp(o))return i;for(let l of Object.getOwnPropertyNames(i))c.test(l)||(i[l]=et(o,t,i[l]));return i}function gE(e,t,r){return et(Y(e,t),t,Hr(e,r))}function yE(e,t,r){return et(Y(e,t),t,r)}function bE(e,t,r){let i=Hr(e,r);if(!A(i)||ce(e.items))return i;let[o,a]=[e.items,Math.max(e.items.length,i.length)];for(let s=0;s<a;s++)s<o.length&&(i[s]=et(o[s],t,i[s]));return i}function OE(e,t,r){let i=Hr(e,r);for(let o of e.anyOf){let a=et(o,t,W(i));if(F(o,t,a))return a}return i}function et(e,t,r){let i=Fe(e,t),o=e;switch(o[g]){case"Array":return pE(o,i,r);case"Date":return mE(o,i,r);case"Import":return uE(o,i,r);case"Intersect":return dE(o,i,r);case"Object":return fE(o,i,r);case"Record":return hE(o,i,r);case"Ref":return gE(o,i,r);case"This":return yE(o,i,r);case"Tuple":return bE(o,i,r);case"Union":return OE(o,i,r);default:return Hr(o,r)}}function ga(...e){return e.length===3?et(e[0],e[1],e[2]):et(e[0],[],e[1])}var Gt={};rt(Gt,{Delete:()=>SE,Format:()=>ya,Get:()=>wE,Has:()=>IE,Set:()=>xE,ValuePointerRootDeleteError:()=>Bs,ValuePointerRootSetError:()=>Ms});var Ms=class extends ${constructor(t,r,i){super("Cannot set root value"),this.value=t,this.path=r,this.update=i}},Bs=class extends ${constructor(t,r){super("Cannot delete root value"),this.value=t,this.path=r}};function Jf(e){return e.indexOf("~")===-1?e:e.replace(/~1/g,"/").replace(/~0/g,"~")}function*ya(e){if(e==="")return;let[t,r]=[0,0];for(let i=0;i<e.length;i++)e.charAt(i)==="/"?(i===0||(r=i,yield Jf(e.slice(t,r))),t=i+1):r=i;yield Jf(e.slice(t))}function xE(e,t,r){if(t==="")throw new Ms(e,t,r);let[i,o,a]=[null,e,""];for(let s of ya(t))o[s]===void 0&&(o[s]={}),i=o,o=o[s],a=s;i[a]=r}function SE(e,t){if(t==="")throw new Bs(e,t);let[r,i,o]=[null,e,""];for(let a of ya(t)){if(i[a]===void 0||i[a]===null)return;r=i,i=i[a],o=a}if(Array.isArray(r)){let a=parseInt(o);r.splice(a,1)}else delete r[o]}function IE(e,t){if(t==="")return!0;let[r,i,o]=[null,e,""];for(let a of ya(t)){if(i[a]===void 0)return!1;r=i,i=i[a],o=a}return Object.getOwnPropertyNames(r).includes(o)}function wE(e,t){if(t==="")return e;let r=e;for(let i of ya(t)){if(r[i]===void 0)return;r=r[i]}return r}function CE(e,t){if(!L(t))return!1;let r=[...Object.keys(e),...Object.getOwnPropertySymbols(e)],i=[...Object.keys(t),...Object.getOwnPropertySymbols(t)];return r.length!==i.length?!1:r.every(o=>En(e[o],t[o]))}function TE(e,t){return Ge(t)&&e.getTime()===t.getTime()}function PE(e,t){return!A(t)||e.length!==t.length?!1:e.every((r,i)=>En(r,t[i]))}function EE(e,t){return!ht(t)||e.length!==t.length||Object.getPrototypeOf(e).constructor.name!==Object.getPrototypeOf(t).constructor.name?!1:e.every((r,i)=>En(r,t[i]))}function AE(e,t){return e===t}function En(e,t){if(Ge(e))return TE(e,t);if(ht(e))return EE(e,t);if(A(e))return PE(e,t);if(L(e))return CE(e,t);if(it(e))return AE(e,t);throw new Error("ValueEquals: Unable to compare value")}var Qf=G({type:j("insert"),path:ke(),value:ct()}),Xf=G({type:j("update"),path:ke(),value:ct()}),Zf=G({type:j("delete"),path:ke()}),bp=K([Qf,Xf,Zf]),ba=class extends ${constructor(t,r){super(r),this.value=t}};function Vs(e,t){return{type:"update",path:e,value:t}}function eh(e,t){return{type:"insert",path:e,value:t}}function th(e){return{type:"delete",path:e}}function Yf(e){if(globalThis.Object.getOwnPropertySymbols(e).length>0)throw new ba(e,"Cannot diff objects with symbols")}function*$E(e,t,r){if(Yf(t),Yf(r),!ds(r))return yield Vs(e,r);let i=globalThis.Object.getOwnPropertyNames(t),o=globalThis.Object.getOwnPropertyNames(r);for(let a of o)E(t,a)||(yield eh(`${e}/${a}`,r[a]));for(let a of i)E(r,a)&&(En(t,r)||(yield*Ks(`${e}/${a}`,t[a],r[a])));for(let a of i)E(r,a)||(yield th(`${e}/${a}`))}function*vE(e,t,r){if(!A(r))return yield Vs(e,r);for(let i=0;i<Math.min(t.length,r.length);i++)yield*Ks(`${e}/${i}`,t[i],r[i]);for(let i=0;i<r.length;i++)i<t.length||(yield eh(`${e}/${i}`,r[i]));for(let i=t.length-1;i>=0;i--)i<r.length||(yield th(`${e}/${i}`))}function*LE(e,t,r){if(!ht(r)||t.length!==r.length||globalThis.Object.getPrototypeOf(t).constructor.name!==globalThis.Object.getPrototypeOf(r).constructor.name)return yield Vs(e,r);for(let i=0;i<Math.min(t.length,r.length);i++)yield*Ks(`${e}/${i}`,t[i],r[i])}function*NE(e,t,r){t!==r&&(yield Vs(e,r))}function*Ks(e,t,r){if(ds(t))return yield*$E(e,t,r);if(A(t))return yield*vE(e,t,r);if(ht(t))return yield*LE(e,t,r);if(it(t))return yield*NE(e,t,r);throw new ba(t,"Unable to diff value")}function Op(e,t){return[...Ks("",e,t)]}function RE(e){return e.length>0&&e[0].path===""&&e[0].type==="update"}function kE(e){return e.length===0}function xp(e,t){if(RE(t))return W(t[0].value);if(kE(t))return W(e);let r=W(e);for(let i of t)switch(i.type){case"insert":{Gt.Set(r,i.path,i.value);break}case"update":{Gt.Set(r,i.path,i.value);break}case"delete":{Gt.Delete(r,i.path);break}}return r}function Sp(...e){let[t,r,i]=e.length===3?[e[0],e[1],e[2]]:[e[0],[],e[1]],o=Pn(t,r)?ha(t,r,i):i;if(!F(t,r,o))throw new fa(t,o,Tn(t,r,o).First());return o}function Gs(e){return L(e)&&!A(e)}var Oa=class extends ${constructor(t){super(t)}};function FE(e,t,r,i){if(!Gs(r))Gt.Set(e,t,W(i));else{let o=Object.getOwnPropertyNames(r),a=Object.getOwnPropertyNames(i);for(let s of o)a.includes(s)||delete r[s];for(let s of a)o.includes(s)||(r[s]=null);for(let s of a)Ip(e,`${t}/${s}`,r[s],i[s])}}function jE(e,t,r,i){if(!A(r))Gt.Set(e,t,W(i));else{for(let o=0;o<i.length;o++)Ip(e,`${t}/${o}`,r[o],i[o]);r.splice(i.length)}}function UE(e,t,r,i){if(ht(r)&&r.length===i.length)for(let o=0;o<r.length;o++)r[o]=i[o];else Gt.Set(e,t,W(i))}function _E(e,t,r,i){r!==i&&Gt.Set(e,t,i)}function Ip(e,t,r,i){if(A(i))return jE(e,t,r,i);if(ht(i))return UE(e,t,r,i);if(Gs(i))return FE(e,t,r,i);if(it(i))return _E(e,t,r,i)}function rh(e){return ht(e)||it(e)}function DE(e,t){return Gs(e)&&A(t)||A(e)&&Gs(t)}function wp(e,t){if(rh(e)||rh(t))throw new Oa("Only object and array types can be mutated at the root level");if(DE(e,t))throw new Oa("Cannot assign due type mismatch of assignable values");Ip(e,"",e,t)}var xa=class extends ${constructor(t){super(t)}},qs;(function(e){let t=new Map([["Assert",(a,s,c)=>(aa(a,s,c),c)],["Cast",(a,s,c)=>Mi(a,s,c)],["Clean",(a,s,c)=>ca(a,s,c)],["Clone",(a,s,c)=>W(c)],["Convert",(a,s,c)=>ma(a,s,c)],["Decode",(a,s,c)=>Pn(a,s)?da(a,s,c):c],["Default",(a,s,c)=>ga(a,s,c)],["Encode",(a,s,c)=>Pn(a,s)?ha(a,s,c):c]]);function r(a){t.delete(a)}e.Delete=r;function i(a,s){t.set(a,s)}e.Set=i;function o(a){return t.get(a)}e.Get=o})(qs||(qs={}));var Cp=["Clone","Clean","Default","Convert","Assert","Decode"];function ME(e,t,r,i){return e.reduce((o,a)=>{let s=qs.Get(a);if(ce(s))throw new xa(`Unable to find Parse operation \'${a}\'`);return s(t,r,o)},i)}function Tp(...e){let[t,r,i,o]=e.length===4?[e[0],e[1],e[2],e[3]]:e.length===3?A(e[0])?[e[0],e[1],[],e[2]]:[Cp,e[0],e[1],e[2]]:e.length===2?[Cp,e[0],[],e[1]]:(()=>{throw new xa("Invalid Arguments")})();return ME(t,r,i,o)}var T={};rt(T,{Assert:()=>aa,Cast:()=>Mi,Check:()=>F,Clean:()=>ca,Clone:()=>W,Convert:()=>ma,Create:()=>Kt,Decode:()=>gp,Default:()=>ga,Diff:()=>Op,Edit:()=>bp,Encode:()=>Sp,Equal:()=>En,Errors:()=>Tn,Hash:()=>ui,Mutate:()=>wp,Parse:()=>Tp,Patch:()=>xp,ValueErrorIterator:()=>Or});var ym={};rt(ym,{BLOCK_SLOT_PLACEMENT_PROPS:()=>lm,BLOCK_SLOT_ROLES:()=>Zh,BLUEPRINT_FORMATS:()=>ug,BlockDefinitionsSchema:()=>Qr,BlockEvaluationError:()=>La,BlockInvocationPropsSchema:()=>Dn,BlockSlotSchema:()=>eg,BlueprintPagesSchema:()=>dg,BlueprintSchema:()=>hm,BlueprintVariantSchema:()=>fg,CANVASES:()=>xh,ChromeSchema:()=>Gp,ComponentValidationError:()=>bi,DEFAULT_CHART_CONCURRENCY:()=>Cg,DEFAULT_CHART_THEME_COLORS:()=>i$,DEFAULT_ERROR_CONFIG:()=>An,DEFAULT_VISUAL_DPI:()=>Na,DesignSpacingSchema:()=>Kp,DesignSystemProperties:()=>Fn,DesignSystemSchema:()=>Sh,DuplicateComponentError:()=>Gi,ERROR_EMOJIS:()=>fi,FONT_URL_ALLOWLIST:()=>vp,FeatureRequirementCollector:()=>fh,FontFamilyNameSchema:()=>Ht,FontRegistry:()=>YA,FontRegistryEntrySchema:()=>_p,FontRegistrySchema:()=>wr,FontSourceSchema:()=>Up,GENERICNESS_PENALTY:()=>k$,JsonBlockDefinitionSchema:()=>tg,JsonBlockEvaluator:()=>f$,MAX_RASTERIZE_BATCH_SLIDES:()=>AA,MAX_RASTERIZE_FONTS:()=>PA,MAX_RASTERIZE_FONT_BYTES:()=>EA,MAX_VISUAL_DPI:()=>ka,MIN_VISUAL_DPI:()=>Ra,MotifSchema:()=>qp,POINTS_PER_PIXEL_96DPI:()=>Yh,POPULAR_GOOGLE_FONTS:()=>Wh,PaletteSchema:()=>Mp,REMOTE_EXPORT_WARNING:()=>j$,RENDERER_DEPENDENCY_MISSING:()=>Xs,ROLE_SCALE_STEPS:()=>Wp,RUBRIC:()=>N$,RendererRegistry:()=>gh,SAFE_FONTS:()=>ic,SERVICE_UNAVAILABLE_CODE:()=>gm,SHIPPING_QUESTION:()=>R$,TYPE_ROLES:()=>Hi,TextCaseSchema:()=>xi,TypeRoleNameSchema:()=>Dp,TypeRoleSchema:()=>It,TypeRolesSchema:()=>Bp,TypographySchema:()=>Vp,UPSTREAM_OVERRIDES:()=>Hh,UnknownPreservedComponentError:()=>Js,UnsupportedRendererFeatureError:()=>Np,WEIGHT_LABELS:()=>Gh,applyDocumentBlocksToSchema:()=>T$,applyExportMode:()=>n$,applyFontSubstitution:()=>im,assertNever:()=>lh,assertRendererSupports:()=>hh,blockDependencies:()=>fm,blockInvocationExample:()=>mg,blockInvocationPropsSchema:()=>cg,blockPointerKey:()=>Se,blockReferencesFromDocument:()=>P$,blockSlotBudgets:()=>g$,blockSlotEditorSchema:()=>hc,blockSlotFacts:()=>og,blockSlotJsonSchema:()=>dc,blockSlotMarkdown:()=>ag,blockSlotRoles:()=>y$,blockSlotsEditorSchema:()=>sg,blockSlotsJsonSchema:()=>um,blockValueAt:()=>_n,blockWordCount:()=>pm,buildDefaultSubstitutionMap:()=>Jh,calculatePosition:()=>Bi,capsFormatting:()=>Th,chartFamilyResolver:()=>c$,chartFontFaceCss:()=>Xh,chartPointsPerPixel:()=>o$,clampVisualDpi:()=>TA,clearComponentNamesCache:()=>Ia,collectFontNamesFromDocx:()=>$A,collectFontNamesFromPptx:()=>vA,compareSemver:()=>gi,composeBlocksWithPlugins:()=>w$,convertToJsonSchema:()=>ec,createBlockAuthoringSchema:()=>Fa,createComponent:()=>Ki,createComponentSchema:()=>qi,createComponentSchemaObject:()=>tc,createErrorConfig:()=>Ir,createJsonParseError:()=>hi,createLimiter:()=>wg,createVersion:()=>Vi,cssFontFamily:()=>Qh,defaultSubstituteFor:()=>zh,definitionsFor:()=>yg,designCanvas:()=>Ih,designColors:()=>Hp,detectFontFormat:()=>zr,diagnoseUnsupportedFeatures:()=>kp,documentBlockMetadata:()=>h$,documentFontRegistry:()=>NA,exportSchemaToFile:()=>Wi,extractStandardComponentNames:()=>di,fetchGoogleFontSources:()=>qh,fixSchemaReferences:()=>Rn,formatErrorMessage:()=>xr,formatErrorSummary:()=>Yr,getChartRequestStats:()=>J$,getLiteralValue:()=>St,getObjectSchemaPropertyNames:()=>Sr,getSchemaMetadata:()=>wa,getUpstreamOverride:()=>e$,getValidationSummary:()=>Qs,groupErrorsByPath:()=>Ca,instantiateBlueprint:()=>v$,isAllowedFontUrl:()=>Hs,isBlockRecord:()=>H,isBlueprint:()=>E$,isLiteralSchema:()=>Jr,isObjectSchema:()=>qt,isPrivateServiceUrl:()=>Ig,isSafeFont:()=>Oi,isUnionSchema:()=>Sa,isValidSemver:()=>Ln,isValidationSuccess:()=>Ys,latestVersion:()=>ut,mergeFontRegistries:()=>RA,mergeWithDefaults:()=>F$,parseSemver:()=>vn,partitionDiagnostics:()=>dh,postJsonToService:()=>z$,readBlockDefinitions:()=>Xr,recordChartCollected:()=>Q$,recordChartRetry:()=>X$,registerBlueprints:()=>A$,remoteExportNotice:()=>U$,rendererError:()=>Rp,rendererWarning:()=>uh,resetChartLimiters:()=>ov,resetChartRequestStats:()=>Y$,resolveBlockSlot:()=>yc,resolveComponentVersion:()=>yi,resolveDesignColor:()=>zp,resolveMotif:()=>Ph,resolveServiceUrl:()=>V$,resolveTypeRoles:()=>Eh,restructureNameDiscriminatedUnions:()=>Ta,rewriteFontFamilyName:()=>Ap,selectVariant:()=>gg,sendChartRequest:()=>nv,slotAt:()=>bg,synthesizeFamilyName:()=>jA,themeFontRegistry:()=>Kh,toAuthoredBlockPointer:()=>Un,transformValueError:()=>$n,transformValueErrors:()=>tt,typeScaleSizes:()=>Ch,unionBranches:()=>Zs,validateBlockDefinitions:()=>bc,validateBlockInvocations:()=>Yi,validateBlueprint:()=>hg,validateCustomComponentProps:()=>Nn,validateDesignColors:()=>Ah,validateFontReferences:()=>FA,valueAt:()=>xg,withChartFontFaceCss:()=>m$,withChartTypography:()=>l$});var BE=new Set([1,4,6,16]),VE=2981146554;function nh(e){let t=0,r=e.length,i=r-r%4;for(let o=0;o<i;o+=4)t=t+e.readUInt32BE(o)>>>0;if(i<r){let o=0,a=r-i;a>=1&&(o|=e[i]<<24),a>=2&&(o|=e[i+1]<<16),a>=3&&(o|=e[i+2]<<8),t=t+o>>>0}return t>>>0}function KE(e,t){if(e.platformID===1)return Buffer.from(t,"ascii");let r=Buffer.alloc(t.length*2);for(let i=0;i<t.length;i+=1)r.writeUInt16BE(t.charCodeAt(i),i*2);return r}function GE(e){let t=e.length,r=6+t*12,i=0;for(let s of e)i+=s.bytes.length;let o=Buffer.alloc(r+i);o.writeUInt16BE(0,0),o.writeUInt16BE(t,2),o.writeUInt16BE(r,4);let a=0;for(let s=0;s<t;s+=1){let c=e[s],l=6+s*12;o.writeUInt16BE(c.platformID,l),o.writeUInt16BE(c.encodingID,l+2),o.writeUInt16BE(c.languageID,l+4),o.writeUInt16BE(c.nameID,l+6),o.writeUInt16BE(c.bytes.length,l+8),o.writeUInt16BE(a,l+10),c.bytes.copy(o,r+a),a+=c.bytes.length}return o}function qE(e,t){if(e.length<12)return e;let r=e.readUInt32BE(0);if(!(r===65536||r===1330926671||r===1953658213||r===1954115633))return e;let o=e.readUInt16BE(4);if(o===0||e.length<12+o*16)return e;let a=[];for(let I=0;I<o;I+=1){let v=12+I*16,D=e.toString("ascii",v,v+4),ye=e.readUInt32BE(v+4),Le=e.readUInt32BE(v+8),He=e.readUInt32BE(v+12);if(Le+He>e.length)return e;a.push({tag:D,checksum:ye,offset:0,originalOffset:Le,data:e.slice(Le,Le+He)})}let s=a.findIndex(I=>I.tag==="name");if(s===-1)return e;let c=a[s].data;if(c.length<6||c.readUInt16BE(0)!==0)return e;let l=c.readUInt16BE(2),p=c.readUInt16BE(4);if(c.length<6+l*12)return e;let m=[];for(let I=0;I<l;I+=1){let v=6+I*12,D=c.readUInt16BE(v),ye=c.readUInt16BE(v+2),Le=c.readUInt16BE(v+4),He=c.readUInt16BE(v+6),te=c.readUInt16BE(v+8),P=c.readUInt16BE(v+10),Z=c.slice(p+P,p+P+te);m.push({platformID:D,encodingID:ye,languageID:Le,nameID:He,bytes:Z})}let u=[];for(let I of m){let v=t(I);v.action!=="drop"&&(v.action==="set"&&(I.bytes=KE(I,v.value)),u.push(I))}m.length=0,m.push(...u);let f=GE(m);a[s]={...a[s],data:f,checksum:nh(f)},a.sort((I,v)=>I.originalOffset-v.originalOffset);let O=12+a.length*16;for(let I of a)O=O+3&-4,I.offset=O,O+=I.data.length;let w=O+3&-4,S=Buffer.alloc(w);e.copy(S,0,0,12),S.writeUInt16BE(a.length,4);let x=[...a].sort((I,v)=>I.tag<v.tag?-1:I.tag>v.tag?1:0);for(let I=0;I<x.length;I+=1){let v=x[I],D=12+I*16;S.write(v.tag,D,4,"ascii"),S.writeUInt32BE(v.checksum,D+4),S.writeUInt32BE(v.offset,D+8),S.writeUInt32BE(v.data.length,D+12)}for(let I of a)I.data.copy(S,I.offset);let N=a.find(I=>I.tag==="head");if(N&&N.data.length>=12){S.writeUInt32BE(0,N.offset+8);let I=nh(S),v=VE-I>>>0;S.writeUInt32BE(v,N.offset+8)}return S}function WE(e,t){if(e.length<12)return null;let r=e.readUInt16BE(4);for(let i=0;i<r;i+=1){let o=12+i*16;if(o+16>e.length)return null;if(e.toString("ascii",o,o+4)===t)return{offset:e.readUInt32BE(o+8),length:e.readUInt32BE(o+12)}}return null}function Ws(e,t){let r=WE(e,"name");if(!r)return[];let i=r.offset;if(i+6>e.length)return[];let o=Math.min(i+r.length,e.length),a=e.readUInt16BE(i+2),s=i+e.readUInt16BE(i+4),c=Math.min(s,o),l=[];for(let p=0;p<a;p+=1){let m=i+6+p*12;if(m+12>c)break;let u=e.readUInt16BE(m),f=e.readUInt16BE(m+6);if(t&&!t.has(f))continue;let O=e.readUInt16BE(m+8),w=e.readUInt16BE(m+10),S=s+w;if(S+O>o)continue;let x=e.slice(S,S+O),N;if(u===1)N=x.toString("ascii");else{let I=Buffer.from(x);I.length%2===0&&I.swap16(),N=I.toString("utf16le")}l.push({platformID:u,nameID:f,value:N})}return l}function Ep(e){let t=[];for(let r of Ws(e,HE)){let i=r.value.trim();i.length>0&&!t.includes(i)&&t.push(i)}return t}var HE=new Set([1,16]);function zE(e,t){return e?t?"Bold Italic":"Bold":t?"Italic":"Regular"}function Ap(e,t,r){let i=r&&r!=="Regular"?r:"",o=i?`${t} ${i}`:t,a=/[[\\](){}<>/%]/g,s=/^[\\x00-\\x7f]*$/.test(o),c=p=>p.replace(/\\s+/g,"").replace(a,"").replace(/[^\\x21-\\x7e]/g,""),l=i?`${c(t)}-${c(i)}`:c(t);return qE(e,p=>BE.has(p.nameID)?p.platformID===1&&!s?{action:"drop"}:p.nameID===6?{action:"set",value:l}:p.nameID===4?{action:"set",value:o}:{action:"set",value:t}:{action:"keep"})}var JE={100:"Thin",200:"ExtraLight",300:"Light",400:"Regular",500:"Medium",600:"SemiBold",700:"Bold",800:"ExtraBold",900:"Black"};function $p(e,t){let r=JE[e];return r?{typographic:t?`${r} Italic`:r,legacy:zE(e>=600,t)}:null}var vp=["fonts.gstatic.com","fonts.googleapis.com","cdn.jsdelivr.net"];function Hs(e){let t;try{t=new URL(e)}catch{return!1}return t.protocol!=="https:"?!1:vp.includes(t.hostname.toLowerCase())}function zr(e){if(e.length<4)return"unknown";let t=e[0],r=e[1],i=e[2],o=e[3];return t===0&&r===1&&i===0&&o===0||t===116&&r===114&&i===117&&o===101||t===116&&r===121&&i===112&&o===49?"ttf":t===79&&r===84&&i===84&&o===79?"otf":t===119&&r===79&&i===70&&o===70?"woff":t===119&&r===79&&i===70&&o===50?"woff2":e.length>=36&&e[34]===76&&e[35]===80?"eot":t===128&&r===1||e.length>=14&&e.slice(0,14).toString("ascii")==="%!PS-AdobeFont"?"pfb":"unknown"}var zs=new Map;function Sa(e){return"anyOf"in e&&Array.isArray(e.anyOf)}function qt(e){return e.type==="object"&&"properties"in e}function Jr(e){return"const"in e}function Sr(e){return qt(e)?Object.keys(e.properties):[]}function St(e){if(Jr(e))return e.const}function di(e){if(zs.has(e))return zs.get(e);let t=[];if("anyOf"in e&&Array.isArray(e.anyOf)){for(let r of e.anyOf)if(qt(r)){let i=r.properties?.name;if(i&&Jr(i)){let o=St(i);typeof o=="string"&&t.push(o)}}}else if(qt(e)){let r=e.properties?.name??e.properties?.type;if(r&&Jr(r)){let i=St(r);typeof i=="string"&&t.push(i)}}return zs.set(e,t),t}function Ia(){zs.clear()}function wa(e){let t={};return"type"in e&&(t.type=String(e.type)),qt(e)&&(t.properties=Sr(e)),Jr(e)&&(t.literal=St(e)),t}function ih(){return typeof process>"u"||!process.env?!1:!!(process.env.CI||process.env.GITHUB_ACTIONS||process.env.GITLAB_CI)}function YE(){return typeof process>"u"||process.env?.NO_COLOR?!1:process.env?.FORCE_COLOR||process.stdout?.isTTY?!0:!ih()}var An={includeEmojis:!ih(),verbosity:"normal",includeSuggestions:!0,includePath:!0,maxMessageLength:0,includeDocLinks:!1,colorSupport:YE()};function Ir(e){return{...An,...e}}var fi={ERROR:"\\u274C",WARNING:"\\u26A0\\uFE0F",FIX:"\\u{1F527}",INFO:"\\u2139\\uFE0F",SUCCESS:"\\u2705"};function xr(e,t){return t.maxMessageLength>0&&e.length>t.maxMessageLength?e.substring(0,t.maxMessageLength)+"...":e}function QE(e,t){let r=String(e.type||""),i=e.path||"root";return r==="62"||r==="union"?XE(e):e.message?.includes("additionalProperties")?ZE(e):e.message?.includes("Required property")?eA(e):r==="string"||r==="number"||r==="boolean"||r==="array"||r==="object"?tA(e):r==="literal"?rA(e):r==="pattern"||r==="RegExp"?nA(e):`At ${i}: ${e.message}`}function XE(e){let t=e.path||"root",r=e.value;if(t==="root"||t==="/"||t==="/jsonDefinition"){if(r&&typeof r=="object"){if("name"in r)return`Invalid component configuration for \'${r.name}\'. Check that all required fields are present.`;if("children"in r&&Array.isArray(r.children))return"Document is missing required \'name\' field."}return"Invalid document structure. Check required fields."}return t.includes("/children/")?r&&typeof r=="object"&&"name"in r?`Invalid component configuration for type \'${r.name}\'. Check that all required fields are present and correctly formatted.`:\'Invalid component structure. Each component must have a "name" field and valid configuration.\':`Value at ${t} doesn\'t match any of the expected formats. Check the structure and required fields.`}function ZE(e){let t=e.path||"root",r=e.value;if(typeof r=="object"&&r!==null){let i=e.schema;if(i&&qt(i)){let o=Sr(i),s=Object.keys(r).filter(c=>!o.includes(c));if(s.length>0)return`Unknown properties at ${t}: ${s.join(", ")}. Allowed properties are: ${o.join(", ")}`}}return`Additional properties not allowed at ${t}. Check for typos or unsupported fields.`}function eA(e){let t=e.path||"root",r=e.message?.match(/Required property \'([^\']+)\'/);return r?`Missing required field \'${r[1]}\' at ${t}. This field is mandatory.`:`Missing required property at ${t}. Check that all mandatory fields are present.`}function tA(e){let t=e.path||"root",r=String(e.type),i=Array.isArray(e.value)?"array":typeof e.value;return t.includes("alignment")?`Invalid alignment value at ${t}. Expected one of: left, center, right, justify`:t.includes("color")?`Invalid color value at ${t}. Use hex format (#RRGGBB), rgb(r,g,b), or a named color`:t.includes("fontSize")||t.includes("size")?`Invalid size value at ${t}. Expected a number (in points)`:t.includes("margin")||t.includes("padding")||t.includes("spacing")?`Invalid spacing value at ${t}. Expected a number or spacing object with top/bottom/left/right`:`Type mismatch at ${t}: Expected ${r} but got ${i}`}function rA(e){let t=e.path||"root",r=e.schema?JSON.stringify(St(e.schema)):"specific value",i=JSON.stringify(e.value);return`Invalid value at ${t}: Expected exactly ${r} but got ${i}`}function nA(e){let t=e.path||"root";return t.includes("email")?`Invalid email format at ${t}. Use format: user@example.com`:t.includes("url")||t.includes("link")?`Invalid URL format at ${t}. Use format: https://example.com`:t.includes("date")?`Invalid date format at ${t}. Use ISO format: YYYY-MM-DD`:`Value at ${t} doesn\'t match the required pattern`}function $n(e,t,r){let i=Ir(r),o=QE(e,i),a={path:e.path||"root",message:xr(o||e.message,i),code:String(e.type||"validation_error"),value:e.value};if(i.includeSuggestions){let s=iA(e,i);s&&(a.suggestion=xr(s,i))}if(t&&e.path){let s=Bi(t,e.path);s&&(a.line=s.line,a.column=s.column)}return a}function tt(e,t){let r=t?.maxErrors??Number.MAX_SAFE_INTEGER,i=[],o=new Set;for(let a of e){if(i.length>=r)break;let s=`${a.path}:${a.type}`;o.has(s)||(o.add(s),i.push($n(a,t?.jsonString,void 0)))}return i}function Bi(e,t){try{let r=t.split("/").filter(Boolean);if(r.length===0)return{line:1,column:1};let o=`"${r[r.length-1]}"`,a=e.indexOf(o);if(a===-1)return{line:1,column:1};let c=e.substring(0,a).split(`\n`),l=c.length,p=c[c.length-1].length+1;return{line:l,column:p}}catch{return null}}function iA(e,t){let{type:r,path:i}=e,o=String(r);if(o==="62"||o==="union")return i==="root"||i==="/"?\'Ensure the document has proper structure with a root "name" field\':i?.includes("/children/")?\'Check that the component has a valid "name" and all required fields\':"Review the structure and ensure all required fields are present with correct types";if(e.message?.includes("additionalProperties"))return"Remove any unknown or unsupported fields.";if(e.message?.includes("Required property"))return"Add the missing required field to fix this error";if(o==="string")return i?.includes("color")?"Use a valid color format (hex: #RRGGBB, rgb: rgb(r,g,b), or named color)":"Provide a text string value";if(o==="number")return"Provide a numeric value";if(o==="boolean")return"Use true or false (without quotes)";if(o==="array")return"Provide an array of values using square brackets []";if(o==="object")return"Provide an object with key-value pairs using curly braces {}";if(o==="literal")return`Use exactly this value: ${e.schema?JSON.stringify(St(e.schema)):"specific value"}`}function Yr(e){if(e.length===0)return"No errors";if(e.length===1)return e[0].message;let t=e.slice(0,3).map(r=>`${r.path}: ${r.message}`).join(", ");return e.length>3?`${t} and ${e.length-3} more...`:t}function Ca(e){let t=new Map;for(let r of e){let i=r.path||"root",o=t.get(i)||[];o.push(r),t.set(i,o)}return t}function hi(e,t){let r=e.message.match(/position (\\d+)/),i=r?parseInt(r[1],10):0,o=1,a=1;if(i>0){let s=t.substring(0,i).split(`\n`);o=s.length,a=s[s.length-1].length+1}return{path:"root",message:`JSON Parse Error: ${e.message}`,code:"json_parse_error",line:o,column:a,suggestion:"Check for missing commas, quotes, or brackets"}}var oh=/^(\\d+)\\.(\\d+)\\.(\\d+)$/;function Ln(e){return oh.test(e)}function vn(e){let t=e.match(oh);if(!t)throw new Error(`Invalid semver: "${e}". Expected format: major.minor.patch`);return{major:Number(t[1]),minor:Number(t[2]),patch:Number(t[3])}}function gi(e,t){let r=vn(e),i=vn(t);return r.major-i.major||r.minor-i.minor||r.patch-i.patch}function ut(e){if(e.length===0)throw new Error("Cannot determine latest version from empty array");return e.reduce((t,r)=>gi(r,t)>0?r:t)}function Vi(e){return e}function Ki(e){if(!e.name)throw new Error("Component name is required");if(!e.versions||typeof e.versions!="object")throw new Error(`Component "${e.name}" requires a versions map`);let t=Object.keys(e.versions);if(t.length===0)throw new Error(`Component "${e.name}" must have at least one version`);for(let r of t){if(!Ln(r))throw new Error(`Component "${e.name}": invalid semver key "${r}". Expected format: major.minor.patch`);let i=e.versions[r];if(!i.propsSchema)throw new Error(`Component "${e.name}" version "${r}" requires a propsSchema`);if(!i.render||typeof i.render!="function")throw new Error(`Component "${e.name}" version "${r}" requires a render function`)}return e}function yi(e,t,r){let i=Object.keys(t);if(r){let a=t[r];if(!a)throw new Error(`Component "${e}" does not have version "${r}". Available versions: ${i.join(", ")}`);return a}let o=ut(i);return t[o]}var Gi=class ah extends Error{constructor(r){super(`Cannot register component "${r}": a component with this name is already registered. Component names must be unique within a document generator.`);R(this,"componentName");R(this,"code","DUPLICATE_COMPONENT");this.name="DuplicateComponentError",this.componentName=r,Error.captureStackTrace&&Error.captureStackTrace(this,ah)}},Js=class sh extends Error{constructor(r,i){let o=r.map(s=>`"${s}"`).join(", "),a=i.length?i.map(s=>`"${s}"`).join(", "):"(none)";super(`preserveCustomComponents lists unregistered component name(s): ${o}. Registered components: ${a}.`);R(this,"unknownNames");R(this,"registeredNames");R(this,"code","UNKNOWN_PRESERVED_COMPONENT");this.name="UnknownPreservedComponentError",this.unknownNames=[...r],this.registeredNames=[...i],Error.captureStackTrace&&Error.captureStackTrace(this,sh)}},bi=class extends Error{constructor(t,r){let i=r!==void 0?`\nProps: ${JSON.stringify(r,null,2)}`:"",o=`Document validation failed:\n${t.map(a=>` ${a.path}: ${a.message}`).join(`\n`)}${i}`;super(o);R(this,"errors");R(this,"props");this.name="ComponentValidationError",this.errors=t,this.props=r}};function Lp(e,t,r){try{let i=T.Clone(t);if(r?.applyDefaults&&(i=T.Default(e,i)),r?.clean&&(i=T.Clean(e,i)),!T.Check(e,i)){let o=[...T.Errors(e,i)];return{valid:!1,errors:tt(o,{jsonString:r?.jsonString,maxErrors:r?.maxErrors||100})}}return{valid:!0,data:i}}catch(i){return{valid:!1,errors:[{path:"root",message:i instanceof Error?i.message:"Unknown validation error",code:"validation_exception"}]}}}function Nn(e,t,r){let i=r?.componentName??"custom";try{let o=Lp(e,t,{...r,clean:r?.clean??!0,applyDefaults:r?.applyDefaults??!0});return{...o,success:o.valid,data:o.data,componentName:i,isCustomComponent:!0}}catch(o){return{valid:!1,success:!1,errors:[{path:"props",message:o instanceof Error?o.message:"Unknown validation error",code:"validation_exception"}],componentName:i,isCustomComponent:!0}}}function Ys(e){return e.valid===!0&&e.data!==void 0}function Qs(e){return e.valid?"Validation successful":!e.errors||e.errors.length===0?"Validation failed with unknown error":Yr(e.errors)}function lh(e,t){let r=oA(e);throw new Error(t?`Unhandled variant in ${t}: ${r}`:`Unhandled variant: ${r}`)}function oA(e){if(e===null||typeof e!="object")return String(e);let t=e.kind,r=e.type;if(typeof t=="string")return`kind="${t}"`;if(typeof r=="string")return`type="${r}"`;try{return JSON.stringify(e)}catch{return Object.prototype.toString.call(e)}}var Np=class ph extends Error{constructor(r){let{format:i,rendererId:o,diagnostics:a}=r,s=ch(a.map(l=>l.feature)),c=ch(a.map(l=>l.path));super(sA(i,o,a,s));R(this,"code","UNSUPPORTED_RENDERER_FEATURE");R(this,"format");R(this,"rendererId");R(this,"features");R(this,"paths");R(this,"diagnostics");this.name="UnsupportedRendererFeatureError",this.format=i,this.rendererId=o,this.features=s,this.paths=c,this.diagnostics=[...a],Error.captureStackTrace&&Error.captureStackTrace(this,ph)}},aA=class mh extends Error{constructor(r,i,o){let a=o.map(s=>`"${s}"`).join(", ");super(`Unknown ${r} renderer "${i}". Available renderers: ${a}.`);R(this,"code","UNKNOWN_RENDERER");R(this,"format");R(this,"rendererId");R(this,"availableIds");this.name="UnknownRendererError",this.format=r,this.rendererId=i,this.availableIds=[...o],Error.captureStackTrace&&Error.captureStackTrace(this,mh)}};function ch(e){return[...new Set(e)]}function sA(e,t,r,i){let o=i.map(s=>`"${s}"`).join(", "),a=r.map(s=>` - ${s.feature} at ${s.path}: ${s.message}`);return`The "${t}" ${e} renderer does not support ${i.length} required feature(s): ${o}.\n${a.join(`\n`)}`}function Rp(e,t,r){return{feature:e,path:t,severity:"error",message:r}}function uh(e,t,r){return{feature:e,path:t,severity:"warning",message:r}}function dh(e){let t=[],r=[];for(let i of e)i.severity==="error"?t.push(i):r.push(i);return{errors:t,warnings:r}}var fh=class{constructor(){R(this,"requirements",[]);R(this,"seen",new Set)}require(e,t,r){let i=`${e}\\0${t}`;this.seen.has(i)||(this.seen.add(i),this.requirements.push(r===void 0?{feature:e,path:t}:{feature:e,path:t,detail:r}))}list(){return this.requirements}features(){return[...new Set(this.requirements.map(e=>e.feature))]}isEmpty(){return this.requirements.length===0}};function kp(e,t,r){let i=[];for(let o of e)t.has(o.feature)||i.push(Rp(o.feature,o.path,cA(o,r)));return i}function cA(e,t){let r=`the "${t}" renderer cannot express "${e.feature}"`;return e.detail?`${r} (${e.detail})`:r}function hh(e,t){let r=kp(e,t.capabilities,t.id);if(r.length!==0)throw new Np({format:t.format,rendererId:t.id,diagnostics:r})}var gh=class{constructor(e,t){R(this,"renderers",new Map);R(this,"statusCache");this.format=e,this.defaultId=t}register(e,t){this.renderers.set(e,t),this.statusCache=void 0}ids(){return[...this.renderers.keys()]}getDefaultId(){return this.defaultId}has(e){return this.renderers.has(e)}async resolve(e){let t=e??this.defaultId,r=this.renderers.get(t);if(!r)throw new aA(this.format,t,this.ids());try{return await r()}catch(i){throw lA(i,this.format,t)}}statuses(){return this.statusCache??(this.statusCache=this.probeStatuses()),this.statusCache}async probeStatuses(){return Promise.all(this.ids().map(async e=>{let t={id:e,default:e===this.defaultId};try{return await this.resolve(e),{...t,available:!0}}catch(r){let o=r instanceof Error&&r.name===Xs&&r instanceof Error?r.packageName:void 0;return{...t,available:!1,reason:r instanceof Error?r.message:String(r),...o?{installHint:`pnpm add ${o}`}:{}}}}))}};function lA(e,t,r){let i=e instanceof Error?e.message:String(e);if(!/Cannot find (?:module|package)|ERR_MODULE_NOT_FOUND|Failed to resolve/i.test(i))return e instanceof Error?e:new Error(i);let a=pA(i),s=a??`the "${r}" backend`,c=new Error(`The "${r}" ${t} renderer requires ${s}, which is not installed. Install it with: pnpm add ${s}\nOriginal error: ${i}`);return c.name=Xs,a&&(c.packageName=a),c}var Xs="RendererDependencyMissingError";function pA(e){return(/Cannot find (?:module|package) [\'"]([^\'"]+)[\'"]/.exec(e)??/Failed to resolve (?:module|import)[: ]+[\'"]?([^\'"\\s]+)/.exec(e))?.[1]}var mA="Sheet1";var FW=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?><workbook xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"><sheets><sheet name="${mA}" sheetId="1" r:id="rId1"/></sheets></workbook>`;function bh(e){if(typeof e!="object"||e===null||Array.isArray(e))return;let t=e.properties?.name;return typeof t?.const=="string"?t.const:void 0}function uA(e){return typeof e.properties?.version?.const=="string"}function dA(e){return Array.isArray(e.required)&&e.required.includes("name")}function fA(e){let t=new Map;for(let r of e){let i=bh(r),o=t.get(i);o?o.push(r):t.set(i,[r])}return t}function hA(e,t){let r=t.find(i=>!uA(i)&&typeof i.description=="string")??t.find(i=>typeof i.description=="string");return{const:e,type:"string",...r?{description:r.description}:{}}}function Ta(e){let t=new WeakSet;function r(i){if(typeof i!="object"||i===null||t.has(i))return;if(t.add(i),Array.isArray(i)){i.forEach(r);return}let o=i,a=o.anyOf,c=Array.isArray(a)&&a.length>=2&&a.every(l=>bh(l)!==void 0&&dA(l))&&o.properties===void 0&&o.allOf===void 0&&o.if===void 0&&o.required===void 0&&o.additionalProperties===void 0&&(o.type===void 0||o.type==="object")?fA(a):void 0;c&&c.size>=2&&(o.type="object",o.required=["name"],o.properties={name:{description:"Component or registered plugin to render.",anyOf:[...c.entries()].map(([l,p])=>hA(l,p))}},o.allOf=[...c.entries()].map(([l,p])=>({if:{properties:{name:{const:l}},required:["name"]},then:p.length===1?p[0]:{anyOf:p}})),delete o.anyOf);for(let l of Object.values(o))r(l)}r(e)}function Zs(e){if(typeof e!="object"||e===null)return[];let t=e;return Array.isArray(t.anyOf)?t.anyOf.filter(r=>typeof r=="object"&&r!==null):Array.isArray(t.allOf)?t.allOf.flatMap(r=>{let i=r?.then;if(typeof i!="object"||i===null)return[];let o=i.anyOf;return Array.isArray(o)?o.filter(a=>typeof a=="object"&&a!==null):[i]}):[]}function jp(e,t,r){if(!(typeof e!="object"||e===null)){if(Array.isArray(e)){e.forEach(i=>{typeof i=="object"&&i!==null&&jp(i,t,r)});return}e.$ref===t&&(e.$ref=r);for(let i of Object.values(e))typeof i=="object"&&i!==null&&jp(i,t,r)}}function Rn(e,t="ComponentDefinition"){let r=new Set(Object.keys(e.definitions??{})),i=s=>{let c=r.has(s)?s:t;return r.has(c)?`#/definitions/${c}`:void 0},o=s=>typeof s=="string"&&(/^T\\d+$/.test(s)||s===t||r.has(s));function a(s,c=""){if(!(typeof s!="object"||s===null))for(let[l,p]of Object.entries(s)){let m=c?`${c}.${l}`:l;if(p&&typeof p=="object"){let u=p;if(u.type==="array"&&u.items&&Object.keys(u.items).length===0&&r.has(t)&&(u.items={$ref:`#/definitions/${t}`}),u.type==="array"&&u.items&&typeof u.items=="object"&&"$ref"in u.items&&o(u.items.$ref)){let f=u.items.$ref,O=i(f);u.items=O?{$ref:O}:{}}if(o(u.$ref)){let f=i(u.$ref);f?u.$ref=f:delete u.$ref}if(l==="$id"&&o(p)&&m!==`definitions.${p}.$id`){delete s[l];continue}a(p,m)}}}a(e)}function ec(e,t={}){let{$schema:r="http://json-schema.org/draft-07/schema#",$id:i,title:o,description:a,definitions:s={},enrich:c}=t,l=JSON.parse(JSON.stringify(e));if(l.$id&&typeof l.$id=="string"&&/^T\\d+$/.test(l.$id)){let f=l.$id;delete l.$id,jp(l,f,"#")}let p={...s};function m(f,O=""){if(!(typeof f!="object"||f===null)){for(let[w,S]of Object.entries(f))if(S&&typeof S=="object"){let x=S;if(x.$id&&typeof x.$id=="string"){let N=x.$id;if(O!==`definitions.${N}`){let{$id:I,...v}=x;p[N]=v,f[w]={$ref:`#/definitions/${N}`},m(v,`definitions.${N}`);continue}}m(S,O?`${O}.${w}`:w)}}}m(l);let u={$schema:r};return i&&(u.$id=i),Object.assign(u,l),u.$schema=r,i&&(u.$id=i),o!==void 0&&(u.title=o),a!==void 0&&(u.description=a),Object.keys(p).length>0&&(u.definitions=p),Rn(u),c?.(u),Ta(u),u}function qi(e,t,r,i,o="ComponentDefinition"){let a={$schema:"http://json-schema.org/draft-07/schema#",$id:`${e}.schema.json`,title:t.title,description:t.description,type:"object",required:["name","props"],properties:{name:{type:"string",const:e,description:`Component name identifier (must be "${e}")`},id:{type:"string",description:"Optional unique identifier for the component"},props:JSON.parse(JSON.stringify(t.schema))}};return r.includes(e)&&(a.properties.children={type:"array",description:"Children within this container",items:{$ref:`#/definitions/${o}`}},i&&(a.definitions={[o]:JSON.parse(JSON.stringify(i))})),Rn(a,o),a.additionalProperties=!1,a}async function Wi(e,t,r={}){let{prettyPrint:i=!0}=r,o=i?JSON.stringify(e,null,2):JSON.stringify(e);await(await Promise.resolve().then(()=>sd(Fp(),1))).writeFile(t,o,"utf-8")}function tc(e,t){let r={name:n.Literal(e.name),id:n.Optional(n.String()),enabled:n.Optional(n.Boolean({default:!0,description:"When false, this component is filtered out and not rendered. Defaults to true."}))};return e.special?.hasSchemaField&&(r.$schema=n.Optional(n.String({format:"uri"}))),r.props=e.propsSchema,e.hasChildren&&t&&(r.children=n.Optional(n.Array(t))),n.Object(r,{additionalProperties:!1})}var ic=["Arial","Calibri","Cambria","Consolas","Courier New","Georgia","Segoe UI","Tahoma","Times New Roman","Trebuchet MS","Verdana","Helvetica","Helvetica Neue","Menlo","Monaco"];function Oi(e){let t=e.toLowerCase();return ic.some(r=>r.toLowerCase()===t)}var Ht=n.String({description:"Font family name. Prefer a SAFE_FONTS entry (Arial, Calibri, Cambria, Consolas, Courier New, Georgia, Segoe UI, Tahoma, Times New Roman, Trebuchet MS, Verdana, Helvetica, Helvetica Neue, Menlo, Monaco) for zero-setup rendering. For any other font, register it in props.fontRegistry[] and reference it here by family. Unregistered non-safe names render with a host fallback.",examples:["Arial","Calibri","Georgia","Inter","Roboto"]}),Pa=n.Number({minimum:100,maximum:900,description:"OpenType weight (100 thin ... 900 black). Default 400."}),oc=n.Boolean({description:"Whether this source is italic. Default false."}),gA=n.Object({kind:n.Literal("safe"),family:n.String({description:"A SAFE_FONTS name \\u2014 installed with Office."})},{additionalProperties:!1,description:"Office-installed font \\u2014 no embedding"}),yA=n.Object({kind:n.Literal("google"),family:n.String({description:\'Exact Google Fonts family name (e.g. "Inter").\'}),weights:n.Optional(n.Array(Pa,{description:"Weights to fetch. Default [400, 700]."})),italics:n.Optional(n.Boolean({description:"Include italic variants. Default false."}))},{additionalProperties:!1,description:"Google Fonts \\u2014 auto-fetched and embedded"}),bA=n.Object({kind:n.Literal("file"),path:n.String({description:"Path to a .ttf/.otf file. Relative paths are resolved against the JSON document file."}),weight:n.Optional(Pa),italic:n.Optional(oc)},{additionalProperties:!1,description:"Local font file to embed"}),OA=n.Object({kind:n.Literal("url"),url:n.String({description:"HTTPS URL of a TTF or OTF file."}),weight:n.Optional(Pa),italic:n.Optional(oc)},{additionalProperties:!1,description:"Direct TTF/OTF URL (non-Google CDN)"}),xA=n.Object({kind:n.Literal("variable"),url:n.String({description:"HTTPS URL of a variable TTF (`fvar` axis table required)."}),weight:Pa,italic:n.Optional(oc),axes:n.Optional(n.Record(n.String(),n.Number(),{description:"Additional axis pin values (e.g. `{ ital: 1, opsz: 14 }`) merged on top of the derived `wght` pin. Uncommon \\u2014 the `weight` field is usually enough."}))},{additionalProperties:!1,description:"Variable-font instancer. The fetcher pins `wght` to `weight` (plus any `axes` overrides) and emits a clean static TTF, bypassing upstream distributions that collapse multiple static weights onto the same glyph geometry."}),SA=n.Object({kind:n.Literal("data"),data:n.String({description:"Base64-encoded TTF/OTF or data: URL (data:font/ttf;base64,...). Makes the JSON self-contained at the cost of size."}),weight:n.Optional(Pa),italic:n.Optional(oc)},{additionalProperties:!1,description:"Inline base64 font \\u2014 portable"}),Up=n.Union([gA,yA,bA,SA,OA,xA],{description:\'A single font variant source. Use kind:"safe" for installed fonts, kind:"google" for Google Fonts, kind:"file" for local files, kind:"data" for base64, kind:"url" for direct HTTPS TTF/OTF URLs, kind:"variable" to instance a variable TTF at a specific weight.\'}),IA=n.Union([n.Literal("sans"),n.Literal("serif"),n.Literal("mono"),n.Literal("display"),n.Literal("handwriting")],{description:"Broad category used for fallback selection"}),_p=n.Object({id:n.String({description:\'Registry key. By convention, match the display family name ("Inter", "Roboto Slab").\'}),family:n.String({description:"Display family used in font.family / fontFace / theme.fonts.*. Usually identical to id."}),category:n.Optional(IA),sources:n.Array(Up,{minItems:1,description:"One or more weight/style variants. List at least a regular (weight 400, italic false)."})},{additionalProperties:!1,description:"A font registered for this document. Referenced by family from font.family, fontFace, and theme.fonts.*."}),wr=n.Array(_p,{description:"Document-scoped font registry. Every non-safe font used in this document must be registered here."}),Hi=["eyebrow","display","stat","quote","label","footer","tableHeader","tableCell","chartLabel","tracker","source"],Dp=n.Union(Hi.map(e=>n.Literal(e))),xh=["a4","letter","wide169","standard43"],xi=n.Union([n.Literal("none"),n.Literal("upper"),n.Literal("smallCaps")]),Wt=n.String({pattern:"^(#?[0-9A-Fa-f]{6}|[a-zA-Z][a-zA-Z0-9]*)$",description:"Six-digit hex or a theme color/palette token. References must resolve without cycles."}),Mp=n.Object({rule:n.Optional(Wt),textMuted:n.Optional(Wt),onPrimary:n.Optional(Wt),surfaceInverse:n.Optional(Wt),positive:n.Optional(Wt),negative:n.Optional(Wt),chart:n.Optional(n.Array(Wt,{minItems:1,maxItems:12}))},{additionalProperties:!1}),It=n.Object({face:n.Optional(n.Union([n.Literal("heading"),n.Literal("body"),n.Literal("mono"),n.Literal("light")])),weight:n.Optional(n.Integer({minimum:100,maximum:900})),size:n.Optional(n.Number({minimum:5,maximum:200,description:"Explicit size in points; takes precedence over the canvas scale."})),lineHeight:n.Optional(n.Number({minimum:.5,maximum:3})),tracking:n.Optional(n.Number({description:"Tracking in hundredths of an em."})),case:n.Optional(xi),color:n.Optional(Wt),spaceBefore:n.Optional(n.Number({minimum:0})),spaceAfter:n.Optional(n.Number({minimum:0}))},{additionalProperties:!1}),Bp=n.Object({eyebrow:n.Optional(It),display:n.Optional(It),stat:n.Optional(It),quote:n.Optional(It),label:n.Optional(It),footer:n.Optional(It),tableHeader:n.Optional(It),tableCell:n.Optional(It),chartLabel:n.Optional(It),tracker:n.Optional(It),source:n.Optional(It)},{additionalProperties:!1}),rc=n.Object({base:n.Number({minimum:5,maximum:200}),ratio:n.Optional(n.Number({minimum:1,maximum:2})),baselinePt:n.Optional(n.Number({exclusiveMinimum:0,maximum:24}))},{additionalProperties:!1}),Vp=n.Object({roles:n.Optional(Bp),scale:n.Optional(n.Object({a4:n.Optional(rc),letter:n.Optional(rc),wide169:n.Optional(rc),standard43:n.Optional(rc)},{additionalProperties:!1}))},{additionalProperties:!1}),nc=n.Object({safeAreaIn:n.Optional(n.Number({minimum:0})),gutterIn:n.Optional(n.Number({minimum:0})),columns:n.Optional(n.Integer({minimum:1,maximum:100})),rows:n.Optional(n.Integer({minimum:1,maximum:100}))},{additionalProperties:!1}),Kp=n.Object({basePt:n.Optional(n.Number({exclusiveMinimum:0})),blockGap:n.Optional(n.Object({tight:n.Optional(n.Number({minimum:0})),normal:n.Optional(n.Number({minimum:0})),loose:n.Optional(n.Number({minimum:0}))},{additionalProperties:!1})),canvas:n.Optional(n.Object({a4:n.Optional(nc),letter:n.Optional(nc),wide169:n.Optional(nc),standard43:n.Optional(nc)},{additionalProperties:!1}))},{additionalProperties:!1}),kn=n.Object({type:n.Optional(Dp),color:n.Optional(Wt),fill:n.Optional(Wt),rule:n.Optional(n.Object({weightPt:n.Optional(n.Number({minimum:0})),color:n.Optional(Wt)},{additionalProperties:!1})),padPt:n.Optional(n.Number({minimum:0})),alignment:n.Optional(n.Union([n.Literal("left"),n.Literal("center"),n.Literal("right")]))},{additionalProperties:!1}),Gp=n.Object({runningHead:n.Optional(kn),tracker:n.Optional(kn),actionTitle:n.Optional(kn),keyTakeaways:n.Optional(kn),sourceLine:n.Optional(kn),confidentialFooter:n.Optional(kn),logoSlot:n.Optional(kn),cover:n.Optional(kn)},{additionalProperties:!1,description:"Visual recipes; consumers land in #361. No automatic content or presence requirements."}),qp=n.Object({kind:n.Union([n.Literal("none"),n.Literal("rule"),n.Literal("corner"),n.Literal("band")]),color:n.Optional(Wt),weightPt:n.Optional(n.Number({minimum:0})),placement:n.Optional(n.Union([n.Literal("top"),n.Literal("bottom"),n.Literal("left"),n.Literal("right"),n.Literal("topLeft"),n.Literal("topRight"),n.Literal("bottomLeft"),n.Literal("bottomRight")]))},{additionalProperties:!1,description:"At most one motif. Rendering consumers land in #361."}),Fn={palette:n.Optional(Mp),typography:n.Optional(Vp),spacing:n.Optional(Kp),chrome:n.Optional(Gp),motif:n.Optional(qp)},Sh=n.Object(Fn,{additionalProperties:!1});function Ih(e,t){if(e==="docx")return t==="LETTER"?"letter":"a4";let r=typeof t=="object"?t.width/t.height:4/3;return Math.abs(r-16/9)<Math.abs(r-4/3)?"wide169":"standard43"}var Wp={display:4,stat:3,quote:1,tableHeader:0,tableCell:0,label:-1,eyebrow:-1,chartLabel:-1,tracker:-1,footer:-2,source:-2};function wh(e,t){if(t===0)return e.base;let r=e.baselinePt??4,i=e.base*(e.ratio??1.25)**t;return Math.max(5,Math.min(200,Math.round(i/r)*r))}var Oh={from:-2,to:5};function Ch(e){let t=new Set;for(let r=Oh.from;r<=Oh.to;r+=1)t.add(wh(e,r));return[...t].sort((r,i)=>r-i)}function wA(e){let t={};for(let[r,i]of Object.entries(e??{}))typeof i=="string"&&(t[r]=i);return t}function Th(e){return e==="upper"?{allCaps:!0}:{smallCaps:e==="smallCaps"}}function Ph(e){return e&&e.kind!=="none"?e:void 0}function Eh(e,t,r){let i=e.typography?.scale?.[t],o={};for(let a of Hi){let s=e.typography?.roles?.[a];s&&(o[a]={...s,size:s.size??(i?wh(i,Wp[a]):r)})}return o}function Hp(e,t){return{...e,...wA(t)}}function zp(e,t){let r=new Set,i=e;for(;i!==void 0&&!r.has(i);)if(!i.startsWith("#")&&Object.hasOwn(t,i))r.add(i),i=t[i];else return/^#?[0-9a-f]{6}$/i.test(i)?i.replace(/^#/,""):void 0}function Ah(e,t){let r=Hp(t,e.palette),i=Object.entries(e.palette??{}).flatMap(([o,a])=>Array.isArray(a)?a.map((s,c)=>[`palette.${o}[${c}]`,s]):[[`palette.${o}`,a]]);for(let[o,a]of Object.entries(e.typography?.roles??{}))a.color&&i.push([`typography.roles.${o}.color`,a.color]);for(let[o,a]of i)if(a&&!zp(a,r))throw new Error(`Unresolvable theme color at ${o}: "${a}" (unknown token or cycle)`)}function ac(e){return/^\\s*\\{\\{\\s*[^{}\\n]*?\\S[^{}\\n]*?\\s*\\}\\}\\s*$/.test(e)}var CA=[{id:"scaffold-marker",kind:"scaffold-marker",expression:/\\{\\{\\s*[^{}\\n]*?\\S[^{}\\n]*?\\s*\\}\\}/},{id:"lorem-ipsum",kind:"filler",expression:/lorem\\s+ipsum/i},{id:"your-x-here",kind:"filler",expression:/\\byour\\b[^.!?\\n]{0,40}?\\bhere\\b/i},{id:"goes-here",kind:"filler",expression:/\\b(?:goes\\s+here|go\\s+here|(?:text|title|subtitle|content|image|logo|caption|name)\\s+here)\\b/i},{id:"click-to-add",kind:"filler",expression:/\\bclick\\s+to\\s+(?:add|edit)\\b/i},{id:"bracketed",kind:"filler",expression:/^\\[[^[\\]\\n]*[A-Za-z][^[\\]\\n]*\\]$/},{id:"debris",kind:"filler",expression:/^(?:todo|fixme|x{3,}|placeholder|sample\\s+text|dummy\\s+text|insert\\s+text)$/i}];var WW=CA.map(e=>e.id);var Na=200,Ra=36,ka=600;function TA(e){return typeof e!="number"||!Number.isFinite(e)?Na:Math.min(ka,Math.max(Ra,Math.round(e)))}var PA=32,EA=8*1024*1024,AA=32,Dh=new Set(["family","fontFace","titleFontFace","legendFontFace","dataLabelFontFace","catAxisLabelFontFace","valAxisLabelFontFace"]),Mh=new Set(["heading","body","mono","light"]),Bh=new Set(["fontRegistry"]);function nm(e,t,r){if(e!=null){if(typeof e=="string"){if(r&&(Dh.has(r)||Mh.has(r))){let i=e.trim();i.length>0&&t.add(i)}return}if(Array.isArray(e)){for(let i of e)nm(i,t,r);return}if(typeof e=="object"){let i=e.fonts;if(r==="theme"&&i&&typeof i=="object"){for(let[o,a]of Object.entries(i))if(typeof a=="string"){let s=a.trim();s.length>0&&t.add(s)}else if(a&&typeof a=="object"){let s=a.family;typeof s=="string"&&s.trim().length>0&&t.add(s.trim())}}for(let[o,a]of Object.entries(e))Bh.has(o)||nm(a,t,o)}}}function Ji(e){let t=new Set;return nm(e,t),t}var $A=Ji,vA=Ji;function LA(e){if(!e||typeof e!="object")return!1;let t=e;return typeof t.id=="string"&&typeof t.family=="string"&&Array.isArray(t.sources)}function Vh(e,t){if(!e||typeof e!="object")return[];let r=e[t];return Array.isArray(r)?r.filter(LA):[]}function NA(e){return!e||typeof e!="object"?[]:Vh(e.props,"fontRegistry")}function Kh(e){return Vh(e,"fontRegistry")}function RA(...e){let t=[];for(let r of e)for(let i of r??[]){let o=i.family.toLowerCase(),a=i.id.toLowerCase();for(let s=t.length-1;s>=0;s--)t[s].family.toLowerCase()===o&&t[s].id.toLowerCase()===a&&t.splice(s,1);t.push(i)}return t}function kA(e){let t=new Set;for(let r of e??[])t.add(r.family.toLowerCase()),t.add(r.id.toLowerCase());return t}function FA(e){let t=kA(e.registeredEntries),r=[],i=[],o=[];for(let a of e.referencedNames){if(Oi(a)||t.has(a.toLowerCase())){r.push(a);continue}i.push(a),o.push({code:"FONT_UNRESOLVED",family:a,message:`Font "${a}" is not a SAFE_FONTS entry and is not registered via fonts.extraEntries. It will render with a host fallback on machines lacking the font. Safe fonts: ${ic.join(", ")}.`})}return{resolved:r,unresolved:i,warnings:o}}var Gh={100:"Thin",200:"ExtraLight",300:"Light",400:"Regular",500:"Medium",600:"SemiBold",700:"Bold",800:"ExtraBold",900:"Black"};function jA(e,t,r){if(t==null)return{family:e,bold:!1,italic:r,nonCanonicalWeight:!1};if(t===400)return{family:e,bold:!1,italic:r,nonCanonicalWeight:!1};if(t===700)return{family:e,bold:!0,italic:r,nonCanonicalWeight:!1};let i=Gh[t];if(!i)return{family:e,bold:t>=600,italic:r,nonCanonicalWeight:!0};let o=r?` ${i} Italic`:` ${i}`;return{family:`${e}${o}`,bold:!1,italic:!1,nonCanonicalWeight:!1}}var sc=5*1024*1024;function UA(e){let t=e.data.trim(),r;if(t.startsWith("data:")){let s=t.indexOf(",");if(s<0)throw new Error("Invalid data URL: no payload separator");if(!t.slice(5,s).includes(";base64"))throw new Error("Data URL must be base64-encoded");r=t.slice(s+1)}else r=t;if(Math.floor(r.length*3/4)>sc)throw new Error(`Font data payload exceeds ${sc} byte limit`);let o=Buffer.from(r,"base64");if(o.length===0)throw new Error("Decoded font buffer is empty");if(o.length>sc)throw new Error(`Font data payload exceeds ${sc} byte limit`);let a=zr(o);if(a==="unknown")throw new Error("Decoded font buffer is not a recognized font (expected TTF/OTF/WOFF/WOFF2)");return{data:o,weight:e.weight??400,italic:e.italic??!1,format:a}}var _A="Mozilla/4.0";async function $h(e,t){let r=new AbortController,i=setTimeout(()=>r.abort(),t.timeoutMs??5e3);try{return await(t.fetcher??fetch)(e,{headers:t.headers,signal:r.signal})}finally{clearTimeout(i)}}function DA(e,t,r){let i=encodeURIComponent(e).replace(/%20/g,"+"),o=[...t].sort((s,c)=>s-c);if(r){let s=o.flatMap(c=>[`0,${c}`,`1,${c}`]).join(";");return`https://fonts.googleapis.com/css2?family=${i}:ital,wght@${s}&display=swap`}let a=o.join(";");return`https://fonts.googleapis.com/css2?family=${i}:wght@${a}&display=swap`}function MA(e){let t=[],r=/@font-face\\s*\\{([^}]*)\\}/g,i;for(;(i=r.exec(e))!==null;){let o=i[1],a=o.match(/src:\\s*url\\((https:\\/\\/fonts\\.gstatic\\.com\\/[^)]+\\.ttf)\\)/);if(!a)continue;let s=o.match(/font-weight:\\s*(\\d+)/),c=o.match(/font-style:\\s*italic/);t.push({weight:s?parseInt(s[1],10):400,italic:!!c,ttfUrl:a[1]})}return t}function vh(e,t,r){return`google|${e}|${t}|${r?"i":"r"}`}async function qh(e){let t=e.weights?.length?e.weights:[400,700],r=e.italics??!1,i=[],o=[],a=[];for(let m of t)a.push({weight:m,italic:!1}),r&&a.push({weight:m,italic:!0});let s=[];for(let m of a){let u=vh(e.family,m.weight,m.italic),f=e.memoryCache?.get(u);if(f){o.push({data:f,weight:m.weight,italic:m.italic,format:zr(f)});continue}let O=await e.diskCache?.get(u);if(O){e.memoryCache?.set(u,O),o.push({data:O,weight:m.weight,italic:m.italic,format:zr(O)});continue}s.push(m)}if(s.length===0)return{sources:o,warnings:i};let c=s.some(m=>m.italic),l=DA(e.family,Array.from(new Set(s.map(m=>m.weight))),c),p;try{let m=await $h(l,{headers:{"User-Agent":_A},timeoutMs:e.fetchTimeoutMs,fetcher:e.fetcher});if(!m.ok)return i.push(`Google Fonts CSS fetch for "${e.family}" returned ${m.status}`),{sources:o,warnings:i};let u=await m.text();p=MA(u)}catch(m){return i.push(`Google Fonts CSS fetch for "${e.family}" failed: ${m.message}`),{sources:o,warnings:i}}for(let m of s){let u=p.find(f=>f.weight===m.weight&&f.italic===m.italic);if(!u){i.push(`Google Fonts "${e.family}" missing weight ${m.weight}${m.italic?" italic":""}`);continue}try{let f=await $h(u.ttfUrl,{timeoutMs:e.fetchTimeoutMs,fetcher:e.fetcher});if(!f.ok){i.push(`Google Fonts TTF fetch for "${e.family}" ${m.weight} returned ${f.status}`);continue}let O=await f.arrayBuffer(),w=Buffer.from(O),S=vh(e.family,m.weight,m.italic);e.memoryCache?.set(S,w),await e.diskCache?.set(S,w),o.push({data:w,weight:m.weight,italic:m.italic,format:zr(w)})}catch(f){i.push(`Google Fonts TTF fetch for "${e.family}" ${m.weight} failed: ${f.message}`)}}return{sources:o,warnings:i}}function BA(e,t,r){return`url|${e}|${t}|${r?"i":"r"}`}async function VA(e){if(!Hs(e.url))return{warnings:[`URL font fetch rejected (host not in allowlist or non-HTTPS): ${e.url}`]};let t=BA(e.url,e.weight,e.italic),r=e.memoryCache?.get(t);if(r)return{source:{data:r,weight:e.weight,italic:e.italic,format:zr(r)},warnings:[]};let i=await e.diskCache?.get(t);if(i)return e.memoryCache?.set(t,i),{source:{data:i,weight:e.weight,italic:e.italic,format:zr(i)},warnings:[]};let o=new AbortController,a=setTimeout(()=>o.abort(),e.fetchTimeoutMs??1e4);try{let s=e.fetcher??fetch,c=await s(e.url,{signal:o.signal,redirect:"manual"}),l=0;for(;c.status>=300&&c.status<400&&c.status!==304;){let O=c.headers.get("location");if(!O)return{warnings:[`URL font fetch "${e.url}" ${c.status} with no Location header`]};let w=new URL(O,e.url).toString();if(!Hs(w))return{warnings:[`URL font fetch "${e.url}" redirected to disallowed host: ${w}`]};if(++l>3)return{warnings:[`URL font fetch "${e.url}" too many redirects`]};c=await s(w,{signal:o.signal,redirect:"manual"})}if(!c.ok)return{warnings:[`URL font fetch "${e.url}" returned ${c.status}`]};let p=await c.arrayBuffer(),m=Buffer.from(p),u=zr(m);if(u==="unknown"||m.length<512)return{warnings:[`URL font fetch "${e.url}" returned ${m.length} bytes of ${u} \\u2014 not a TTF/OTF. Skipping.`]};let f=m;return e.memoryCache?.set(t,f),await e.diskCache?.set(t,f),{source:{data:f,weight:e.weight,italic:e.italic,format:u},warnings:[]}}catch(s){return{warnings:[`URL font fetch "${e.url}" failed: ${s.message}`]}}finally{clearTimeout(a)}}var Lh=12,Nh=16;function KA(e,t){if(e.length<Lh)return null;let r=e.readUInt32BE(0);if(r!==65536&&r!==1330926671)return null;let i=e.readUInt16BE(4);for(let o=0;o<i;o++){let a=Lh+o*Nh;if(a+Nh>e.length)return null;if(e.toString("ascii",a,a+4)===t)return{off:e.readUInt32BE(a+8),len:e.readUInt32BE(a+12)}}return null}function GA(e){let t=KA(e,"OS/2");return!t||t.off+6>e.length?null:e.readUInt16BE(t.off+4)}function qA(e,t,r,i){let o=[],a=GA(e);a!=null&&a!==t&&o.push({code:"WEIGHT_CLASS_MISMATCH",message:`Font "${i}" weight ${t}: OS/2.usWeightClass reports ${a}. Likely a defective redistribution \\u2014 consider adding an upstream override.`});let s=Ep(e);s.length>0&&!s.includes(i.trim())&&o.push({code:"FAMILY_MISMATCH",message:`Font "${i}" weight ${t}${r?" italic":""}: name table declares ${s.map(u=>`"${u}"`).join(" / ")}, not "${i}". Referencing runs will not resolve this face.`});let c=$p(t,r);if(!c)return o;let l=c.typographic,p=c.legacy,m=Ws(e,new Set([2,17]));for(let u of m)u.nameID===17&&u.value!==l&&o.push({code:"SUBFAMILY_MISMATCH",message:`Font "${i}" weight ${t}${r?" italic":""}: name record (platform ${u.platformID}) nameID 17 = "${u.value}", expected "${l}".`}),u.nameID===2&&u.value!==p&&o.push({code:"LEGACY_SUBFAMILY_MISMATCH",message:`Font "${i}" weight ${t}${r?" italic":""}: name record (platform ${u.platformID}) nameID 2 = "${u.value}", expected "${p}".`});return o}var WA=new Set([65536,1330926671,1953658213,1954115633]),Jp=12,Rh=16;function HA(e,t,r,i){let o=`Font "${i}" weight ${t}${r?" italic":""}`,a=f=>({code:"FONT_UNREADABLE",message:`${o}: ${f} The face will not resolve; text referencing it renders in a fallback.`});if(e.length<Jp)return a(`${e.length} bytes is shorter than an sfnt header \\u2014 the download is truncated or empty.`);let s=e.readUInt32BE(0);if(!WA.has(s))return a(`sfnt version 0x${s.toString(16).padStart(8,"0")} is neither TrueType nor OpenType.`);let c=e.readUInt16BE(4);if(c===0)return a("its table directory is empty.");let l=Jp+c*Rh;if(l>e.length)return a(`its directory claims ${c} tables (${l} bytes) but the file is ${e.length} bytes \\u2014 truncated.`);let p=new Set;for(let f=0;f<c;f+=1){let O=Jp+f*Rh,w=e.toString("ascii",O,O+4),S=e.readUInt32BE(O+8),x=e.readUInt32BE(O+12);if(S+x>e.length)return a(`its "${w}" table runs to byte ${S+x} but the file is ${e.length} bytes \\u2014 truncated.`);p.add(w)}for(let f of["name","head"])if(!p.has(f))return a(`it has no "${f}" table.`);let m=p.has("glyf")&&p.has("loca"),u=p.has("CFF ")||p.has("CFF2");return!m&&!u?a(\'it carries no glyph outlines (neither "glyf" + "loca" nor "CFF ").\'):Ws(e).length===0?a(\'its "name" table carries no readable records.\'):null}var zA=class{constructor(e={}){R(this,"store",new Map);R(this,"bytes",0);R(this,"maxBytes");this.maxBytes=e.maxBytes??20*1024*1024}get(e){let t=this.store.get(e);if(t)return this.store.delete(e),this.store.set(e,t),t}set(e,t){let r=this.store.get(e);for(r&&(this.bytes-=r.byteLength),this.store.set(e,t),this.bytes+=t.byteLength;this.bytes>this.maxBytes&&this.store.size>0;){let i=this.store.keys().next().value;if(!i)break;let o=this.store.get(i);this.store.delete(i),o&&(this.bytes-=o.byteLength)}}size(){return this.store.size}};function JA(e,t){if(e.format!=="ttf"&&e.format!=="otf")return e;let r=Ep(e.data);if(r.length===0||r.includes(t))return e;let i=$p(e.weight,e.italic)?.legacy;return{...e,data:Ap(e.data,t,i)}}var YA=class{constructor(e={}){R(this,"index");R(this,"cache");R(this,"opts");R(this,"memoryCache");R(this,"diskCache");R(this,"fileLoader");R(this,"variableLoader");this.opts=e.opts??{},this.index=new Map,this.cache=new Map,this.memoryCache=new zA,this.diskCache=e.diskCache,this.fileLoader=e.fileLoader,this.variableLoader=e.variableLoader;for(let t of this.opts.extraEntries??[])this.addEntry(t)}addEntry(e){this.index.set(e.family.toLowerCase(),e),this.index.set(e.id.toLowerCase(),e)}async resolveMany(e){let t=[];for(let r of e)t.push(await this.resolve(r));return t}async resolve(e){let t=e.toLowerCase(),r=this.cache.get(t);if(r)return r;let i=this.index.get(t),o;return i?o=await this.materializeEntry(i):Oi(e)?o={family:e,sources:[],warnings:[]}:o={family:e,sources:[],warnings:[`Font "${e}" is not registered and not in SAFE_FONTS; will rely on host fallback.`]},this.cache.set(t,o),o}async materializeEntry(e){let t=[],r=[];for(let i of e.sources)try{let o=await this.materializeSource(i,r);for(let a of o){let s=a.format==="ttf"||a.format==="otf",c=s?HA(a.data,a.weight,a.italic,e.family):null;if(c){r.push(`[${c.code}] ${c.message}`),t.push(a);continue}let l=JA(a,e.family);if(s)for(let p of qA(l.data,l.weight,l.italic,e.family))r.push(`[FONT_METADATA_DEFECT:${p.code}] ${p.message}`);t.push(l)}}catch(o){r.push(`Font "${e.family}" source (${i.kind}) failed: ${o.message}`)}return{family:e.family,sources:t,warnings:r}}async materializeSource(e,t){switch(e.kind){case"safe":return[];case"file":return this.fileLoader?[await this.fileLoader({path:e.path,weight:e.weight,italic:e.italic,baseDir:this.opts.baseDir})]:(t.push(`kind:"file" source for "${e.path}" requires a fileLoader (Node-only); skipping.`),[]);case"data":return[UA({data:e.data,weight:e.weight,italic:e.italic})];case"google":{let r=this.opts.googleFonts;if(r?.enabled===!1)return t.push(`Google Fonts fetch disabled \\u2014 skipping "${e.family}".`),[];let{sources:i,warnings:o}=await qh({family:e.family,weights:e.weights??[400,700],italics:e.italics??!1,memoryCache:this.memoryCache,diskCache:this.diskCache,fetchTimeoutMs:r?.fetchTimeoutMs});return t.push(...o),i}case"url":{let r=this.opts.googleFonts,{source:i,warnings:o}=await VA({url:e.url,weight:e.weight??400,italic:e.italic??!1,memoryCache:this.memoryCache,diskCache:this.diskCache,fetchTimeoutMs:r?.fetchTimeoutMs});return o&&t.push(...o),i?[i]:[]}case"variable":{if(!this.variableLoader)return t.push(`kind:"variable" source for "${e.url}" requires a variableLoader (Node-only); skipping.`),[];let r=this.opts.googleFonts,{source:i,warnings:o}=await this.variableLoader({url:e.url,weight:e.weight,italic:e.italic??!1,axes:e.axes,memoryCache:this.memoryCache,diskCache:this.diskCache,fetchTimeoutMs:r?.fetchTimeoutMs});return o&&t.push(...o),i?[i]:[]}default:throw new Error(`Unknown font source kind: ${e.kind}`)}}},Wh=[{family:"Inter",category:"sans",weights:[100,200,300,400,500,600,700,800,900],hasItalic:!1},{family:"Roboto",category:"sans",weights:[100,300,400,500,700,900],hasItalic:!0},{family:"Open Sans",category:"sans",weights:[300,400,500,600,700,800],hasItalic:!0},{family:"Lato",category:"sans",weights:[100,300,400,700,900],hasItalic:!0},{family:"Montserrat",category:"sans",weights:[100,200,300,400,500,600,700,800,900],hasItalic:!0},{family:"Poppins",category:"sans",weights:[100,200,300,400,500,600,700,800,900],hasItalic:!0},{family:"Work Sans",category:"sans",weights:[100,200,300,400,500,600,700,800,900],hasItalic:!0},{family:"Nunito",category:"sans",weights:[200,300,400,500,600,700,800,900],hasItalic:!0},{family:"DM Sans",category:"sans",weights:[100,200,300,400,500,600,700,800,900],hasItalic:!0},{family:"Rubik",category:"sans",weights:[300,400,500,600,700,800,900],hasItalic:!0},{family:"Source Sans 3",category:"sans",weights:[200,300,400,500,600,700,800,900],hasItalic:!0},{family:"Manrope",category:"sans",weights:[200,300,400,500,600,700,800],hasItalic:!1},{family:"Plus Jakarta Sans",category:"sans",weights:[200,300,400,500,600,700,800],hasItalic:!0},{family:"IBM Plex Sans",category:"sans",weights:[100,200,300,400,500,600,700],hasItalic:!0},{family:"Archivo",category:"sans",weights:[100,200,300,400,500,600,700,800,900],hasItalic:!0},{family:"Geist",category:"sans",weights:[100,200,300,400,500,600,700,800,900],hasItalic:!0},{family:"Space Grotesk",category:"sans",weights:[300,400,500,600,700],hasItalic:!1},{family:"Playfair Display",category:"serif",weights:[400,500,600,700,800,900],hasItalic:!0},{family:"Merriweather",category:"serif",weights:[300,400,700,900],hasItalic:!0},{family:"Lora",category:"serif",weights:[400,500,600,700],hasItalic:!0},{family:"Source Serif 4",category:"serif",weights:[200,300,400,500,600,700,800,900],hasItalic:!0},{family:"DM Serif Display",category:"serif",weights:[400],hasItalic:!0},{family:"Crimson Pro",category:"serif",weights:[200,300,400,500,600,700,800,900],hasItalic:!0},{family:"Cormorant Garamond",category:"serif",weights:[300,400,500,600,700],hasItalic:!0},{family:"JetBrains Mono",category:"mono",weights:[100,200,300,400,500,600,700,800],hasItalic:!0},{family:"Fira Code",category:"mono",weights:[300,400,500,600,700],hasItalic:!1},{family:"IBM Plex Mono",category:"mono",weights:[100,200,300,400,500,600,700],hasItalic:!0},{family:"Source Code Pro",category:"mono",weights:[200,300,400,500,600,700,800,900],hasItalic:!0},{family:"Space Mono",category:"mono",weights:[400,700],hasItalic:!0},{family:"Geist Mono",category:"mono",weights:[100,200,300,400,500,600,700,800,900],hasItalic:!0},{family:"Bebas Neue",category:"display",weights:[400],hasItalic:!1},{family:"Abril Fatface",category:"display",weights:[400],hasItalic:!1},{family:"Archivo Black",category:"display",weights:[400],hasItalic:!1},{family:"Oswald",category:"display",weights:[200,300,400,500,600,700],hasItalic:!1},{family:"Caveat",category:"handwriting",weights:[400,500,600,700],hasItalic:!1},{family:"Pacifico",category:"handwriting",weights:[400],hasItalic:!1}],QA="https://cdn.jsdelivr.net/gh/rsms/inter@v4.1/docs/font-files/InterVariable.ttf",XA="https://cdn.jsdelivr.net/gh/rsms/inter@v4.1/docs/font-files/InterVariable-Italic.woff2";function ZA(){let e=[100,200,300,400,500,600,700,800,900],t=e.map(i=>({kind:"variable",url:QA,weight:i,italic:!1})),r=e.map(i=>({kind:"variable",url:XA,weight:i,italic:!0}));return[...t,...r]}var Hh={inter:{reason:"Google\'s static Inter Thin/ExtraLight both carry usWeightClass=250 and near-identical glyph outlines (xAvgCharWidth differs by 1.8%); instancing the upstream variable font per weight produces properly distinct statics.",variants:ZA()}};function e$(e){return Hh[e.toLowerCase()]}function im(e,t){let r=new Map,i=mc(e,t,r),o=[];for(let[a,s]of r)o.push({from:a,to:s});return{doc:i,substitutions:o}}function mc(e,t,r,i){if(e==null)return e;if(typeof e=="string")return i&&(Dh.has(i)||Mh.has(i))?Yp(e,t,r):e;if(Array.isArray(e))return e.map(o=>mc(o,t,r,i));if(typeof e=="object"){let o={};for(let[a,s]of Object.entries(e)){if(Bh.has(a)){o[a]=s;continue}if(i==="theme"&&a==="fonts"&&s&&typeof s=="object"){let c={};for(let[l,p]of Object.entries(s))if(typeof p=="string")c[l]=Yp(p,t,r);else if(p&&typeof p=="object"){let m=p.family;c[l]=typeof m=="string"?{...p,family:Yp(m,t,r)}:mc(p,t,r,l)}else c[l]=p;o[a]=c;continue}o[a]=mc(s,t,r,a)}return o}return e}function Yp(e,t,r){let i=e.trim();if(i.length===0||Oi(i))return e;let o=i.toLowerCase();for(let[a,s]of Object.entries(t))if(a.toLowerCase()===o)return r.set(i,s),s;return e}var t$={Inter:"Calibri",Roboto:"Calibri","Open Sans":"Calibri",Lato:"Calibri","Source Sans 3":"Calibri","Source Sans Pro":"Calibri","IBM Plex Sans":"Calibri",Archivo:"Calibri",Geist:"Calibri","Space Grotesk":"Calibri","Work Sans":"Calibri",Manrope:"Calibri",Nunito:"Calibri","Nunito Sans":"Calibri",Poppins:"Calibri",Montserrat:"Calibri","Playfair Display":"Georgia",Merriweather:"Georgia","Source Serif 4":"Cambria","Source Serif Pro":"Cambria","IBM Plex Serif":"Cambria","Crimson Pro":"Cambria",Lora:"Georgia","PT Serif":"Georgia","Cormorant Garamond":"Cambria","JetBrains Mono":"Consolas","Fira Code":"Consolas","IBM Plex Mono":"Consolas","Source Code Pro":"Consolas","Roboto Mono":"Consolas","Geist Mono":"Consolas"},r$={sans:"Calibri",serif:"Georgia",mono:"Consolas",display:"Georgia",handwriting:"Segoe UI"};function zh(e){let t=e.trim();for(let[i,o]of Object.entries(t$))if(i.toLowerCase()===t.toLowerCase())return o;let r=Wh.find(i=>i.family.toLowerCase()===t.toLowerCase());if(r){let i=r$[r.category];if(i)return i}return"Calibri"}function Jh(e){let t={};for(let r of e){let i=r.trim();i.length!==0&&(Oi(i)||t[i]||(t[i]=zh(i)))}return t}function n$(e){if((e.fonts?.mode??"custom")==="custom"){if(!e.fonts)return{doc:e.doc,theme:e.theme,warnings:[]};let m=[...new Set([...Ji(e.doc),...Ji(e.theme)])].filter(f=>!Oi(f.trim())),u=m.length>0?[{code:"FONT_MODE_CUSTOM",message:`Export mode "custom": non-safe font references (${m.join(", ")}) kept as-is. Recipients need these fonts installed locally; Word falls back to a generic substitute otherwise.`}]:[];return{doc:e.doc,theme:e.theme,warnings:u}}let r=new Set([...Ji(e.doc),...Ji(e.theme)]),o={...Jh(r),...e.fonts?.substitution??{}},a=im(e.doc,o),s=im(e.theme,o),c=new Map;for(let p of a.substitutions)c.set(p.from,p.to);for(let p of s.substitutions)c.set(p.from,p.to);let l=[];if(c.size>0){let p=[...c].map(([m,u])=>`${m} \\u2192 ${u}`).join(", ");l.push({code:"FONT_MODE_SUBSTITUTED",message:`Export mode "substitute": rewrote non-safe families to safe equivalents \\u2014 ${p}. No fonts embedded; document renders identically on every machine.`})}return{doc:a.doc,theme:s.doc,warnings:l}}var i$=["primary","secondary","accent","accent4","accent5","accent6"],Yh=.75;function o$(e,t){return!Number.isFinite(e)||e<=0||t===void 0||!Number.isFinite(t)||t<=0?Yh:t/e}var a$=new Set(["georgia","times new roman","cambria"]),s$=new Set(["consolas","courier new","menlo","monaco"]);function Qh(e,t){let r=t==="serif"?"serif":t==="mono"?"monospace":t==="handwriting"?"cursive":t===void 0&&a$.has(e.toLowerCase())?"serif":t===void 0&&s$.has(e.toLowerCase())?"monospace":"sans-serif";return`"${e.replace(/["\\\\]/g,"\\\\$&")}", ${r}`}function c$(e){let t=new Map(Kh(e).map(r=>[r.family.toLowerCase(),r.category]));return r=>Qh(r,t.get(r.toLowerCase()))}function Ea(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function sr(e,t){if(e!==void 0&&!Ea(e))return e;let r=Ea(e)?{...e}:{};for(let[i,o]of Object.entries(t)){if(o===void 0)continue;let a=r[i];a===void 0?r[i]=Ea(o)?sr(void 0,o):o:Ea(a)&&Ea(o)&&(r[i]=sr(a,o))}return r}function kh(e,t){return Array.isArray(e)?e.map(r=>sr(r,t)):sr(e,t)}function Fh(e){return e===void 0?void 0:String(e)}function l$(e,t,r){let i=m=>`${Math.round(m/r*10)/10}px`,o=i(t.labelPt),a=i(t.sourcePt),s={fontSize:o,color:t.mutedColor},c={fontSize:a,color:t.mutedColor},l={fontSize:o,color:t.textColor,fontWeight:Fh(t.labelWeight)},p={labels:{style:s},title:{style:s}};return{...e,chart:sr(e.chart,{style:{fontFamily:t.bodyFamily}}),title:sr(e.title,{style:{fontFamily:t.headingFamily,fontSize:i(t.titlePt),fontWeight:Fh(t.titleWeight),color:t.textColor}}),subtitle:sr(e.subtitle,{style:s}),caption:sr(e.caption,{style:c}),xAxis:kh(e.xAxis,p),yAxis:kh(e.yAxis,p),legend:sr(e.legend,{itemStyle:l}),plotOptions:sr(e.plotOptions,{series:{dataLabels:{style:l}}}),credits:sr(e.credits,{enabled:!1,style:c})}}var p$={ttf:{mime:"font/ttf",format:"truetype"},otf:{mime:"font/otf",format:"opentype"},woff:{mime:"font/woff",format:"woff"},woff2:{mime:"font/woff2",format:"woff2"}};function Xh(e,t){let r=new Set(t.map(i=>i.toLowerCase()));return e.filter(i=>r.has(i.family.toLowerCase())).map(i=>{let{mime:o,format:a}=p$[i.format??"ttf"];return`@font-face{font-family:"${i.family.replace(/["\\\\]/g,"\\\\$&")}";font-weight:${i.weight};font-style:${i.italic?"italic":"normal"};src:url(data:${o};base64,${i.data}) format("${a}")}`}).join(`\n`)}function m$(e,t,r){let i=Xh(t,r);if(!i)return e;let o=e.resources?.css;return{...e,resources:{...e.resources,css:o?`${i}\n${o}`:i}}}var Zh=["actionTitle","takeaway","source","tracker","footer"],eg=n.Recursive(e=>n.Object({type:n.Union(["string","number","integer","boolean","object","array","component"].map(t=>n.Literal(t)),{description:"Content type accepted by this slot. Use component for a document component or registered plugin."}),description:n.Optional(n.String({description:"Explain this slot\\u2019s content and purpose to authors."})),required:n.Optional(n.Boolean({description:"Require a value when no default is provided. Defaults to false."})),default:n.Optional(n.Unknown({description:"Value used when the caller omits this slot. Must satisfy the slot\\u2019s type and constraints."})),enum:n.Optional(n.Array(n.Union([n.String(),n.Number(),n.Boolean()]),{minItems:1,description:"Allowed scalar values for this slot."})),minItems:n.Optional(n.Integer({minimum:0,description:"Minimum number of array entries, inclusive."})),maxItems:n.Optional(n.Integer({minimum:0,description:"Maximum number of array entries, inclusive."})),minLength:n.Optional(n.Integer({minimum:0,description:"Minimum string length in characters, inclusive."})),maxLength:n.Optional(n.Integer({minimum:0,description:"Maximum string length in characters, inclusive."})),minimum:n.Optional(n.Number({description:"Minimum numeric value, inclusive."})),maximum:n.Optional(n.Number({description:"Maximum numeric value, inclusive."})),maxWords:n.Optional(n.Integer({minimum:1,description:"Maximum whitespace-separated word count. Exceeding it fails validation."})),oneLine:n.Optional(n.Boolean({description:"Reject newline characters in string values. Does not prevent visual line wrapping."})),items:n.Optional({...e,description:"Slot type and constraints for each array entry."}),properties:n.Optional(n.Record(n.String(),e,{description:"Named child slots accepted by an object slot. Undeclared properties are rejected."})),role:n.Optional(n.Union(Zh.map(t=>n.Literal(t)),{description:"Content role for quality profiles: actionTitle, takeaway, source, tracker or footer. A profile may require or measure it; the theme only styles it."}))},{additionalProperties:!1}),{$id:"BlockSlot"}),tg=n.Unsafe(n.Object({description:n.Optional(n.String({description:"Describe what this reusable block renders and when to use it."})),slots:n.Record(n.String(),eg,{description:"Named inputs and their types, defaults and constraints. Use an empty object for a block with no inputs."}),body:n.Array(n.Unknown(),{description:"Components and binding directives expanded in order when this block is invoked."}),section:n.Optional(n.Object({tracker:n.Optional(n.Unknown({description:"Section tracker value or binding, available to headers and footers through $context at /section/tracker."})),header:n.Optional(n.Array(n.Unknown(),{description:"Header component templates. Explicit header settings on the section take precedence."})),footer:n.Optional(n.Array(n.Unknown(),{description:"Footer component templates. Explicit footer settings on the section take precedence."})),pageBreak:n.Optional(n.Boolean({description:"Start the containing section on a new page. An explicit section pageBreak setting takes precedence."})),scope:n.Optional(n.Union([n.Literal("section"),n.Literal("following")],{description:"Apply header/footer templates to this section only, or inherit them in following sections. Defaults to section."}))},{additionalProperties:!1,description:"DOCX section tracker, header/footer templates and page-break behavior. Place this block at the section boundary."})),slide:n.Optional(n.Object({background:n.Optional(n.Unknown({description:"Slide background (color, gradient or image) or a binding. A background the slide states itself takes precedence."})),grid:n.Optional(n.Unknown({description:"Grid configuration merged over the presentation grid when resolving grid placements in this block\\u2019s body."})),notes:n.Optional(n.Unknown({description:"Speaker notes or a binding. Notes the slide states itself take precedence."}))},{additionalProperties:!1,description:"PPTX slide background, grid and notes supplied by this block. Invoke the block as a direct child of a slide."}))},{additionalProperties:!1})),Qr=n.Record(n.String({pattern:"^[a-zA-Z][a-zA-Z0-9_-]*$"}),tg,{description:"Document-local JSON block definitions. Names are not built into the engine."}),Dn=n.Object({ref:n.String({minLength:1,description:"Name in this document\\u2019s props.blocks."}),slots:n.Optional(n.Record(n.String(),n.Unknown(),{description:"Input values keyed by the slot names declared in the referenced block definition."}))},{additionalProperties:!1});function dc(e){let{oneLine:t,properties:r,items:i,role:o,...a}=e;return delete a.required,delete a.maxWords,e.type==="component"?{type:"object",properties:{name:{type:"string"}},required:["name"],description:e.description}:{...a,...t&&{pattern:"^[^\\\\r\\\\n]*$"},...i&&{items:dc(i)},...r&&{properties:Object.fromEntries(Object.entries(r).map(([s,c])=>[s,dc(c)])),required:Object.entries(r).filter(([,s])=>s.required&&s.default===void 0).map(([s])=>s),additionalProperties:!1}}}var sm={$slot:{keys:["$slot","default","props"],result:"dynamic"},$item:{keys:["$item","default","props"],result:"dynamic"},$theme:{keys:["$theme","default"],result:"dynamic"},$context:{keys:["$context","default"],result:"dynamic"},$count:{keys:["$count"],result:"number"},$if:{keys:["$if","then","else"],result:"dynamic"},$each:{keys:["$each","template"],result:"array"},$join:{keys:["$join","separator","keepEmpty"],result:"string"},$measure:{keys:["$measure","fraction","unit"],result:"number"}},cm=["$item","$slot","$context","$theme"],La=class extends Error{constructor(e){super(e.map(t=>`${t.path}: ${t.message}`).join(`\n`)),this.issues=e,this.name="BlockEvaluationError"}},H=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),Se=e=>e.replace(/~/g,"~0").replace(/\\//g,"~1"),wt=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);function _n(e,t){if(t==="")return e;if(!t.startsWith("/"))return;let r=e;for(let i of t.slice(1).split("/")){let o=i.replace(/~1/g,"/").replace(/~0/g,"~");if(!H(r)&&!Array.isArray(r)||!wt(r,o))return;r=r[o]}return r}function Un(e,t){let r;for(let i of Object.keys(e))(t===i||t.startsWith(`${i}/`))&&(r===void 0||i.length>r.length)&&(r=i);return r===void 0?t:`${e[r]}${t.slice(r.length)}`}var lm=["x","y","w","h","position","grid","gridConfig","direction","gap","weights","alignment","spacing"],pm=e=>e.trim()===""?0:e.trim().split(/\\s+/).length,Qp=e=>e!=null&&e!==""&&e!==!1&&(!Array.isArray(e)||e.length>0),jn=(e,t,r)=>{throw new La([{path:e,code:t,message:r}])};function yc(e,t,r,i){let o=t===void 0&&e.default!==void 0?structuredClone(e.default):t;if(o===void 0){e.required&&i.push({path:r,code:"block_required_slot",message:"Required block slot is missing."});return}if(!(e.type==="array"?Array.isArray(o):e.type==="component"?H(o)&&typeof o.name=="string":e.type==="object"?H(o):e.type==="integer"?typeof o=="number"&&Number.isInteger(o):typeof o===e.type&&(typeof o!="number"||Number.isFinite(o))))return i.push({path:r,code:"block_slot_type",message:`Expected ${e.type}.`}),o;let s=l=>i.push({path:r,code:"block_slot_budget",message:l}),c=typeof o=="string"&&ac(o);if(!c&&e.enum&&!e.enum.includes(o)&&s("Value is not one of the declared choices."),typeof o=="string"&&!c&&(e.oneLine&&/[\\r\\n]/.test(o)&&s("Slot must contain one line."),e.minLength!==void 0&&o.length<e.minLength&&s(`Minimum length is ${e.minLength}.`),e.maxLength!==void 0&&o.length>e.maxLength&&s(`Maximum length is ${e.maxLength}.`),e.maxWords!==void 0&&pm(o)>e.maxWords&&s(`Maximum word count is ${e.maxWords}.`)),typeof o=="number"&&(e.minimum!==void 0&&o<e.minimum&&s(`Minimum value is ${e.minimum}.`),e.maximum!==void 0&&o>e.maximum&&s(`Maximum value is ${e.maximum}.`)),Array.isArray(o))return e.minItems!==void 0&&o.length<e.minItems&&s(`Minimum item count is ${e.minItems}.`),e.maxItems!==void 0&&o.length>e.maxItems&&s(`Maximum item count is ${e.maxItems}.`),e.items?o.map((l,p)=>yc(e.items,l,`${r}/${p}`,i)):o;if(e.type==="component"&&H(o)){let l=(p,m,u=0)=>{if(u>64){i.push({path:m,code:"block_expansion_limit",message:"Component slot exceeds 64 levels."});return}if(Array.isArray(p)){p.forEach((O,w)=>l(O,`${m}/${w}`,u+1));return}if(!H(p))return;let f=typeof p.name=="string"&&H(p.props)?p.props:{};for(let O of lm)wt(f,O)&&i.push({path:`${m}/props/${O}`,code:"block_slot_placement",message:"Block placement belongs in the definition, not in a component slot."});for(let[O,w]of Object.entries(p))l(w,`${m}/${Se(O)}`,u+1)};l(o,r)}return e.type==="object"&&H(o)&&e.properties?mm(e.properties,o,r,i):o}function mm(e,t,r,i){let o={};for(let a of Object.keys(t))wt(e,a)||i.push({path:`${r}/${Se(a)}`,code:"block_unknown_slot",message:`Unknown slot \'${a}\'. Expected: ${Object.keys(e).join(", ")}.`});for(let[a,s]of Object.entries(e)){let c=yc(s,wt(t,a)?t[a]:void 0,`${r}/${Se(a)}`,i);c!==void 0&&Object.defineProperty(o,a,{value:c,enumerable:!0,writable:!0,configurable:!0})}return o}var u$=Object.fromEntries(Object.entries(sm).map(([e,t])=>[e,t.keys]));function d$(e,t){let r={type:"object",properties:e};for(let i of t.slice(1).split("/")){let o=i.replace(/~1/g,"/").replace(/~0/g,"~");if(r?.type==="object"){if(!r.properties)return{type:"object"};r=wt(r.properties,o)?r.properties[o]:void 0}else if(r?.type==="array"&&/^(0|[1-9]\\d*)$/.test(o))r=r.items??{type:"object"};else return r?.type==="component"?{type:"object"}:void 0}return r}var om=["$if","$each","$count"],fc=e=>typeof e=="string"&&(e===""||e.startsWith("/")),rg=e=>fc(e)?[e]:Array.isArray(e)&&e.length>0&&e.every(fc)?e:void 0;function ng(e,t){if(fc(e))return{root:om.includes(t)?"$slot":t,pointer:e};if(!om.includes(t)||!H(e))return;let r=Object.keys(e),i=cm.find(o=>o===r[0]);if(!(r.length!==1||!i||!fc(e[i])))return{root:i,pointer:e[i]}}function Aa(e,t,r,i,o=!1,a=0){if(a>64){i.push({path:t,code:"block_depth",message:"Definition exceeds 64 levels."});return}if(Array.isArray(e)){e.forEach((c,l)=>Aa(c,`${t}/${l}`,r,i,o,a+1));return}if(!H(e))return;let s=Object.keys(e).filter(c=>c.startsWith("$"));if(s.length){let c=s[0],l=u$[c];if(!l||s.length!==1||Object.keys(e).some(p=>!l.includes(p))){i.push({path:t,code:"block_invalid_binding",message:"Unknown or malformed block directive."});return}if(["$slot","$item","$theme","$context","$if","$each","$count"].includes(c)){let p=ng(e[c],c),m=c==="$theme"?rg(e[c]):void 0;if(!p&&!m)i.push({path:t,code:"block_invalid_binding",message:om.includes(c)?`${c} takes a slot pointer such as /items, or one reference: ${cm.map(u=>`{ "${u}": ... }`).join(", ")}.`:c==="$theme"?"Bindings use a JSON Pointer, e.g. /styles/source/size, or a non-empty array of them tried in order.":"Bindings use JSON Pointers, e.g. /title."});else if(p?.root==="$slot"){let u=d$(r,p.pointer);u?["$each","$count"].includes(c)&&u.type!=="array"&&i.push({path:t,code:"block_invalid_binding",message:`${c} requires an array slot.`}):i.push({path:t,code:"block_unknown_binding",message:`No slot field \'${p.pointer}\' is declared.`})}p?.root==="$item"&&!o&&i.push({path:t,code:"block_invalid_binding",message:"$item is only available inside $each."}),(c==="$slot"||c==="$item")&&wt(e,"props")&&!H(e.props)&&i.push({path:`${t}/props`,code:"block_invalid_binding",message:"props must be an object of component props merged beneath a component-slot value."})}c==="$join"&&e.keepEmpty!==void 0&&typeof e.keepEmpty!="boolean"&&i.push({path:t,code:"block_invalid_binding",message:"keepEmpty must be boolean."}),c==="$if"&&!wt(e,"then")&&i.push({path:t,code:"block_invalid_binding",message:"$if requires then."}),c==="$each"&&(!wt(e,"template")||Array.isArray(e.template))&&i.push({path:t,code:"block_invalid_binding",message:"$each requires one template value; use a group for multiple flow children."}),c==="$join"&&(!Array.isArray(e.$join)||e.separator!==void 0&&typeof e.separator!="string")&&i.push({path:t,code:"block_invalid_binding",message:"$join requires an array and an optional string separator."}),c==="$measure"&&(!["width","height"].includes(String(e.$measure))||!["pt","twip","in"].includes(String(e.unit??"pt"))||e.fraction!==void 0&&(typeof e.fraction!="number"||e.fraction<0||e.fraction>1))&&i.push({path:t,code:"block_invalid_binding",message:"$measure requires width/height, pt/twip/in and a fraction between 0 and 1."})}for(let[c,l]of Object.entries(e))c.startsWith("$")&&c!=="$join"||Aa(l,`${t}/${Se(c)}`,r,i,o||wt(e,"$each"),a+1)}function Xr(e){return(H(e)&&H(e.props)?e.props.blocks:void 0)??{}}function bc(e,t,r=[]){if(!T.Check(Qr,e))return[...T.Errors(Qr,e)].slice(0,100).map(o=>({path:`/props/blocks${o.path}`,code:"block_invalid_definition",message:o.message}));let i=[];for(let[o,a]of Object.entries(e)){let s=`/props/blocks/${Se(o)}`;r.includes(o)&&i.push({path:s,code:"block_name_collision",message:`Block \'${o}\' conflicts with a registered component.`}),t!=="docx"&&a.section&&i.push({path:`${s}/section`,code:"block_format",message:"Section effects are DOCX-only."}),t!=="pptx"&&a.slide&&i.push({path:`${s}/slide`,code:"block_format",message:"Slide effects are PPTX-only."});let c=(l,p)=>{l.default!==void 0&&yc(l,l.default,`${p}/default`,i);for(let[m,u]of[["minItems","maxItems"],["minLength","maxLength"],["minimum","maximum"]])l[m]!==void 0&&l[u]!==void 0&&l[m]>l[u]&&i.push({path:p,code:"block_invalid_definition",message:`${m} exceeds ${u}.`});l.items&&c(l.items,`${p}/items`);for(let[m,u]of Object.entries(l.properties??{}))c(u,`${p}/properties/${Se(m)}`)};for(let[l,p]of Object.entries(a.slots))c(p,`${s}/slots/${Se(l)}`);Aa(a.body,`${s}/body`,a.slots,i),a.section&&Aa(a.section,`${s}/section`,a.slots,i),a.slide&&Aa(a.slide,`${s}/slide`,a.slots,i)}return i}function Yi(e,t,r,i=[]){let o=bc(t,r,i);if(o.length)return o;let a=(s,c)=>{if(Array.isArray(s)){s.forEach((l,p)=>a(l,`${c}/${p}`));return}if(!(!H(s)||s.enabled===!1)){if(s.name==="block"&&H(s.props)&&typeof s.props.ref=="string"){let l=wt(t,s.props.ref)?t[s.props.ref]:void 0;l?((s.props.slots===void 0||H(s.props.slots))&&mm(l.slots,s.props.slots??{},`${c}/props/slots`,o),l.section&&!/^\\/children\\/\\d+\\/children\\/\\d+$/.test(c)&&o.push({path:c,code:"invalid_placement",message:"A block with section effects must be a direct child of a top-level section."}),l.slide&&!/^\\/children\\/\\d+\\/children\\/\\d+$/.test(c)&&o.push({path:c,code:"invalid_placement",message:"A block with slide effects must be a direct child of a slide."})):o.push({path:`${c}/props/ref`,code:"block_unknown_reference",message:`Block \'${s.props.ref}\' is not defined in this document.`})}for(let[l,p]of Object.entries(s))c==="/props"&&l==="blocks"||a(p,`${c}/${Se(l)}`)}};return a(e,""),o}var f$=class{constructor(e,t){R(this,"sourceMap",{});R(this,"blocks",[]);R(this,"blockSources",new Set);R(this,"nodes",0);this.definitions=e,this.options=t;let r=bc(e,t.format,t.reservedNames);if(r.length)throw new La(r)}guard(e,t){(t>64||++this.nodes>5e4)&&jn(e,"block_expansion_limit","Block expansion exceeds the depth/node limit (64/50000).")}operand(e,t,r){let{root:i,pointer:o}=ng(e,t),{value:a,source:s}=this.reference(i,o,r);return{value:a,source:s,element:c=>this.reference(i,`${o}/${c}`,r).source}}reference(e,t,r){if(e==="$item")return{value:_n(r.item,t),source:`${r.itemSource??r.source}${t}`};if(e==="$context"){let i=Un(r.contextSources??{},t);return{value:_n(r.context,t),source:i===t?r.source:i}}return e==="$theme"?{value:_n(this.options.theme,t),source:r.source}:{value:_n(r.slots,t),source:r.slotSources?Un(r.slotSources,t):`${r.source}/props/slots${t}`}}evaluate(e,t,r,i,o=0){if(this.guard(t.source,o),this.sourceMap[r]=t.source,Array.isArray(e)){let s=[];return e.forEach((c,l)=>{let p=this.evaluate(c,t,`${r}/${s.length}`,`${i}/${l}`,o+1);if(p!==void 0)if(H(c)&&("$if"in c||"$each"in c)&&Array.isArray(p)){let m=`${r}/${s.length}`,u=Object.entries(this.sourceMap).filter(([f])=>f.startsWith(`${m}/`));for(let[f]of u)delete this.sourceMap[f];for(let[f,O]of u){let w=f.slice(m.length+1),[S,...x]=w.split("/");this.sourceMap[`${r}/${s.length+Number(S)}${x.length?"/"+x.join("/"):""}`]=O}s.push(...p)}else s.push(p)}),s}if(!H(e))return e;if("$slot"in e||"$item"in e||"$theme"in e||"$context"in e){let s=["$slot","$item","$theme","$context"].find(f=>f in e),c=(s==="$theme"?rg(e[s]):void 0)??[],l=c[0]??e[s],p,m=t.source;for(let f of c.length?c:[l]){let O=this.reference(s,f,t);if(m=O.source,O.value!==void 0){p=O.value;break}}this.sourceMap[r]=m;let u=p!==void 0?structuredClone(p):void 0;if(u===void 0&&wt(e,"default")&&(u=this.evaluate(e.default,t,r,`${i}/default`,o+1)),u===void 0&&s==="$theme")return jn(i,"block_unknown_theme_binding",`Theme value \'${c.length>1?c.join(", "):l}\' is missing; declare a fallback or use an existing token.`);if((s==="$slot"||s==="$item")&&wt(e,"props")&&H(u)&&typeof u.name=="string"){let f=this.sourceMap[r],O=this.evaluate(e.props,t,`${r}/props`,`${i}/props`,o+1),w=H(u.props)?u.props:{};for(let S of Object.keys(w)){let x=`${r}/props/${Se(S)}`;for(let N of Object.keys(this.sourceMap))(N===x||N.startsWith(`${x}/`))&&delete this.sourceMap[N];this.sourceMap[x]=`${f}/props/${Se(S)}`}u={...u,props:{...H(O)?O:{},...w}}}return u}if("$if"in e){let s=this.operand(e.$if,"$if",t),c=Qp(s.value)?e.then:e.else,l=this.evaluate(c,t,r,i,o+1);return(!H(c)||!Object.keys(c).some(m=>m.startsWith("$")))&&this.sourceMap[r]===t.source&&(this.sourceMap[r]=s.source),l}if("$count"in e){let s=this.operand(e.$count,"$count",t);return Array.isArray(s.value)?s.value.length:jn(s.source,"block_slot_type","$count requires an array.")}if("$each"in e){let s=this.operand(e.$each,"$each",t),c=s.value;if(!Array.isArray(c))return jn(s.source,"block_slot_type","$each requires an array.");let l=[];return c.forEach((p,m)=>{let u=`${r}/${l.length}`,f=this.evaluate(e.template,{...t,item:p,itemSource:s.element(m)},u,`${i}/template`,o+1);if(f!==void 0)this.sourceMap[u]===t.source&&(this.sourceMap[u]=s.element(m)),l.push(f);else for(let O of Object.keys(this.sourceMap))(O===u||O.startsWith(`${u}/`))&&delete this.sourceMap[O]}),l}if("$join"in e){let s=e.$join.map((l,p)=>this.evaluate(l,t,`${r}/${p}`,`${i}/$join/${p}`,o+1)),c=s.findIndex(Qp);return c>=0&&(this.sourceMap[r]=this.sourceMap[`${r}/${c}`]),(e.keepEmpty===!0?s:s.filter(Qp)).map(l=>String(l??"")).join(String(e.separator??""))}if("$measure"in e)return this.options.measure?this.options.measure(e.$measure,e.unit??"pt",t.context)*Number(e.fraction??1):jn(i,"block_unsupported_operation","This format does not support $measure.");let a={};for(let[s,c]of Object.entries(e)){let l=this.evaluate(c,t,`${r}/${Se(s)}`,`${i}/${Se(s)}`,o+1);l!==void 0&&Object.defineProperty(a,s,{value:l,enumerable:!0,configurable:!0,writable:!0})}return a}expand(e,t="",r=0){if(this.guard(t,r),Array.isArray(e))return e.map((o,a)=>this.expand(o,`${t}/${a}`,r+1));if(!H(e))return e;if(e.name==="block"&&e.enabled!==!1){if(!H(e.props)||typeof e.props.ref!="string")return jn(t,"block_invalid_invocation","A block requires props.ref and optional props.slots.");if(Object.keys(e.props).some(f=>!["ref","slots"].includes(f))||e.props.slots!==void 0&&!H(e.props.slots))return jn(t,"block_invalid_invocation","Block props accept only ref and an object of slots.");let o=wt(this.definitions,e.props.ref)?this.definitions[e.props.ref]:void 0;if(!o)return jn(`${t}/props/ref`,"block_unknown_reference",`Block \'${e.props.ref}\' is not defined in this document.`);let a=[],s=Un(this.sourceMap,t),c=`${t}/props/slots`,l=mm(o.slots,e.props.slots??{},c,a);if(a.length)throw new La(a.map(f=>({...f,path:Un(this.sourceMap,f.path)})));let p=Object.fromEntries([["",Un(this.sourceMap,c)],...Object.entries(this.sourceMap).filter(([f])=>f.startsWith(`${c}/`)).map(([f,O])=>[f.slice(c.length),O])]),m={slots:l,slotSources:p,source:s,definition:`/props/blocks/${Se(e.props.ref)}`,context:this.options.contextAt?.(t)??this.options.context??{},contextSources:this.options.contextSources};o.section&&this.options.onSection?.({settings:o.section,environment:m,path:t}),o.slide&&this.options.onSlide?.({settings:o.slide,environment:m,path:t}),this.blockSources.has(s)||(this.blockSources.add(s),this.blocks.push(s));let u=this.evaluate(o.body,m,`${t}/children`,`${m.definition}/body`,r+1);return{name:"group",...e.id!==void 0&&{id:e.id},children:this.expand(u,`${t}/children`,r+1)}}if(e.enabled===!1)return{...e};let i={...e};for(let[o,a]of Object.entries(e))t==="/props"&&o==="blocks"||Object.defineProperty(i,o,{value:this.expand(a,`${t}/${Se(o)}`,r+1),enumerable:!0,configurable:!0,writable:!0});return i}};function um(e){return{type:"object",additionalProperties:!1,properties:Object.fromEntries(Object.entries(e.slots).map(([t,r])=>[t,dc(r)])),required:Object.entries(e.slots).filter(([,t])=>t.required&&t.default===void 0).map(([t])=>t)}}function h$(e){let t=Xr(e);if(!T.Check(Qr,t))return{definitions:[],invocations:[],invalidDefinitions:!0};let r=[],i=(o,a)=>{if(Array.isArray(o)){o.forEach((s,c)=>i(s,`${a}/${c}`));return}if(H(o)){o.name==="block"&&H(o.props)&&typeof o.props.ref=="string"&&r.push({ref:o.props.ref,path:a,slotsPath:`${a}/props/slots`,defined:Object.prototype.hasOwnProperty.call(t,o.props.ref)});for(let[s,c]of Object.entries(o))a==="/props"&&s==="blocks"||i(c,`${a}/${Se(s)}`)}};return i(e,""),{definitions:Object.entries(t).map(([o,a])=>({name:o,definitionPointer:`/props/blocks/${Se(o)}`,definition:a,slotsSchema:um(a)})),invocations:r,invalidDefinitions:!1}}function ig(e,t,r){let i=Xr(e);for(let o of t){let a=_n(e,o);if(!H(a)||!H(a.props)||typeof a.props.ref!="string")continue;let s=a.props.ref,c=i[s];if(!c)continue;let l=(p,m,u,f)=>{if(r(s,p,m,u,f),H(m)&&p.properties)for(let[O,w]of Object.entries(p.properties))l(w,_n(m,`/${Se(O)}`),`${u}/${Se(O)}`,`${f}.${O}`);Array.isArray(m)&&p.items&&m.forEach((O,w)=>l(p.items,O,`${u}/${w}`,f))};for(let[p,m]of Object.entries(c.slots)){let u=_n(a.props.slots,`/${Se(p)}`);l(m,u===void 0&&m.default!==void 0?m.default:u,`${o}/props/slots/${Se(p)}`,p)}}}function g$(e,t){let r=[];return ig(e,t,(i,o,a,s,c)=>{typeof a=="string"&&o.maxWords!==void 0&&!ac(a)&&r.push({block:i,slot:c,path:s,words:pm(a),maxWords:o.maxWords})}),r}function y$(e,t){let r=[];return ig(e,t,(i,o,a,s,c)=>{o.role&&r.push({block:i,invocation:s.replace(/\\/props\\/slots\\/.*$/,""),slot:c,role:o.role,path:s,value:a})}),r}var Xp=["null","boolean","number","string","array","object"],zi=(e,t)=>new Set([...e].filter(r=>t.has(r))),b$=e=>new Set(e.flatMap(t=>[...t])),jh=e=>e===null?"null":Array.isArray(e)?"array":typeof e;function $a(e,t,r=new Set){if(e===!1)return new Set;if(e===!0||r.has(e))return new Set(Xp);let i=e.not;if(i===!0||i&&typeof i=="object"&&Object.keys(i).length===0)return new Set;let o=new Set(r).add(e),a=new Set(Xp);if(e.type){let s=Array.isArray(e.type)?e.type:[e.type];a=zi(a,new Set(Xp.filter(c=>s.includes(c)||c==="number"&&s.includes("integer"))))}if(Object.hasOwn(e,"const")&&(a=zi(a,new Set([jh(e.const)]))),Array.isArray(e.enum)&&(a=zi(a,new Set(e.enum.map(jh)))),typeof e.$ref=="string"){let s=t(e.$ref);s!==void 0&&(a=zi(a,$a(s,t,o)))}for(let s of["anyOf","oneOf"])Array.isArray(e[s])&&(a=zi(a,b$(e[s].map(c=>$a(c,t,o)))));if(Array.isArray(e.allOf))for(let s of e.allOf)a=zi(a,$a(s,t,o));if(i&&typeof i=="object"&&i.type&&Object.keys(i).every(s=>["type","description","title","$comment"].includes(s))){let s=(Array.isArray(i.type)?i.type:[i.type]).filter(c=>c!=="integer");a=new Set([...a].filter(c=>!s.includes(c)))}return a}function uc(e,t,r=new Set){if(e===!1)return!1;if(e===!0||r.has(e))return{};let i=new Set(r).add(e),o=[];if(typeof e.$ref=="string"){let a=t(e.$ref);a!==void 0&&o.push(uc(a,t,i))}e.items!==void 0&&o.push(Array.isArray(e.items)?{anyOf:[...e.items,...e.additionalItems===!1?[]:[e.additionalItems??{}]]}:e.items);for(let a of["anyOf","oneOf"])Array.isArray(e[a])&&o.push({anyOf:e[a].filter(s=>$a(s,t).has("array")).map(s=>uc(s,t,i))});return Array.isArray(e.allOf)&&o.push(...e.allOf.map(a=>uc(a,t,i))),o.length===0?{}:o.length===1?o[0]:{allOf:o}}var Si=(e,t)=>({type:"object",properties:e,required:t,additionalProperties:!1}),va=e=>({type:"string",pattern:"^(|/.*)$",description:e}),O$=e=>({anyOf:[va(e),{type:"array",minItems:1,items:va(e),description:e}],description:e}),x$=e=>({$slot:"Read a named input slot by JSON Pointer, e.g. /title or /client/name.",$item:"Read the current $each entry by JSON Pointer. Use an empty string for the whole entry or /title for a property.",$theme:\'Read the active theme by JSON Pointer, e.g. /colors/primary, or by a list of pointers tried in order, e.g. ["/chrome/sourceLine/color", "/styles/source/color"] \\u2014 the chrome recipe if the theme sets one, else the type role. A missing value requires a default.\',$context:e==="pptx"?"Read deck or slide context by JSON Pointer, e.g. /document/title, /slide/width or /slide/index.":"Read document or section context by JSON Pointer, e.g. /document/title or /section/tracker."}),S$=e=>e==="pptx"?{axis:"Measure the slide canvas width or height, in the unit given.",unit:"Measurement unit: points, twentieths of a point, or inches. Defaults to pt; use in for frame coordinates."}:{axis:"Measure the usable page width or height after margins, using the containing section\\u2019s page settings.",unit:"Measurement unit: points, twentieths of a point, or inches. Defaults to pt."},cc=(e,t)=>({...typeof e=="boolean"?{allOf:[e]}:e,description:t}),Zp=e=>typeof e=="boolean"?{}:{...e.description&&{description:e.description},...e.markdownDescription&&{markdownDescription:e.markdownDescription}},I$=e=>({type:"object",required:[e]}),lc=Object.keys(sm);function Fa(e,t,r=[],i="docx"){let o=`BlockTemplate_${t}`,a=x$(i),s=S$(i),c=P=>({description:P,anyOf:[va(P),...cm.map(Z=>Si({[Z]:va(a[Z])},[Z]))]}),l=`${o}_Body`,p=P=>({$ref:`#/definitions/${P}`});if(e[l])return p(l);let m={...e},u=m[t];m[t]={...u,anyOf:(u.anyOf??[u]).filter(P=>!r.includes(P.properties?.name?.const))};let f=P=>{if(!P.startsWith("#/definitions/"))return;let Z=m;for(let _e of P.slice(14).split("/")){let Ke=_e.replace(/~1/g,"/").replace(/~0/g,"~");if(!Z||typeof Z!="object"||!Object.hasOwn(Z,Ke))return;Z=Z[Ke]}return typeof Z=="boolean"||Z&&typeof Z=="object"?Z:void 0},O=new Map,w=new Map,S=0,x=p(t),N=new Map,I=P=>{let Z=JSON.stringify(P),_e=N.get(Z);return _e||(_e=`${o}_Shared${S++}`,N.set(Z,_e),e[_e]=P),p(_e)},v=Object.fromEntries(lc.map(P=>[P,I(I$(P))])),D=I({anyOf:Object.values(v)}),ye=[...new Set(["",...lc.flatMap(P=>Array.from({length:P.length-1},(Z,_e)=>P.slice(0,_e+1)))])],Le=I({type:"object",propertyNames:{pattern:`^(?:${ye.map(P=>P.replace(/[.*+?^${}()|[\\]\\\\]/g,"\\\\$&")).join("|")})$`}});function He(P){if(typeof P=="boolean")return P;let Z=JSON.stringify(P),_e=w.get(Z);if(_e)return{...p(_e),...Zp(P)};let Ke=`${o}_Literal${S++}`;w.set(Z,Ke);let ft=e[Ke]={};if(Object.assign(ft,P),typeof P.$ref=="string"){let me=f(P.$ref);if(me!==void 0){let Ce=He(me);typeof Ce=="object"?ft.$ref=Ce.$ref:(delete ft.$ref,Ce||(ft.not={}))}}P.properties&&(ft.properties=Object.fromEntries(Object.entries(P.properties).map(([me,Ce])=>[me,["name","version"].includes(me)&&typeof Ce=="object"&&typeof Ce.const=="string"?Ce:te(Ce)]))),P.patternProperties&&(ft.patternProperties=Object.fromEntries(Object.entries(P.patternProperties).map(([me,Ce])=>[me,te(Ce)]))),P.items!==void 0&&(ft.items=Array.isArray(P.items)?P.items.map(me=>te(me,!0)):te(P.items,!0));for(let me of["additionalProperties","additionalItems"])typeof P[me]=="object"&&(ft[me]=te(P[me],me==="additionalItems"));for(let me of["anyOf","oneOf","allOf"])Array.isArray(P[me])&&(ft[me]=P[me].map(Ce=>{let zt=He(Ce);return typeof Ce=="object"&&typeof Ce.properties?.name?.const=="string"&&typeof zt=="object"&&zt.$ref?e[zt.$ref.slice(14)]:zt}));for(let me of["then","else"])P[me]!==void 0&&(ft[me]=He(P[me]));return{...p(Ke),...Zp(P)}}function te(P,Z=!1){if(P===!1)return!1;let _e=Zp(P),Ke=typeof P=="object"?{...P}:P;typeof Ke=="object"&&(delete Ke.description,delete Ke.markdownDescription);let ft=`${Z?"sequence":"value"}:${JSON.stringify(Ke)}`,me=O.get(ft);if(me)return{...p(me),..._e};let Ce=`${o}_Value${S++}`;O.set(ft,Ce),e[Ce]={};let zt=p(Ce),id=$a(Ke,f);if(id.size===0)return e[Ce]={allOf:[He(Ke)]},zt;let od=()=>Z?te(Ke):zt,ad=()=>Z?{anyOf:[zt,{type:"array",items:zt}]}:zt,Gb=()=>Z?od():te(uc(Ke,f)),mr={};for(let fe of lc){let Hn=sm[fe].result;if(!(Hn!=="dynamic"&&!id.has(Hn)&&!(Z&&Hn==="array")))switch(fe){case"$slot":case"$item":case"$theme":case"$context":mr[fe]=Si({[fe]:fe==="$theme"?O$(a[fe]):va(a[fe]),default:cc(od(),"Fallback value or binding used only when the referenced value is missing. Null, false and empty values do not trigger it."),...fe==="$slot"||fe==="$item"?{props:{type:"object",description:"Component props merged beneath a component-slot value. Put placement (x, y, w, h, grid) and styling defaults here; the slot content may override styling but never placement."}}:{}},[fe]);break;case"$if":mr[fe]=Si({$if:c(\'Test a slot by JSON Pointer, e.g. /subtitle, or a reference such as { "$item": "/numeric" } or { "$theme": "/chrome/keyTakeaways/fill" }. Missing, null, false, empty text and empty arrays select else; zero selects then.\'),then:cc(ad(),"Value or components to emit when the slot tested by $if is present."),else:cc(ad(),"Value or components to emit otherwise. Omit to produce no output.")},["$if","then"]);break;case"$each":mr[fe]=Si({$each:c(\'Repeat template for each entry in an array slot, e.g. /items, or in an array named by a reference, { "$item": "/cells" } or { "$theme": "/palette/chart" }. Read the current entry with $item.\'),template:cc(Gb(),"One template evaluated per array entry. Use $item for the current entry and a group for multiple components.")},["$each","template"]);break;case"$count":mr[fe]=Si({$count:c(\'Return the number of entries in an array slot, e.g. /items, or in an array of the current entry, { "$item": "/cells" }.\')},["$count"]);break;case"$join":mr[fe]=Si({$join:{type:"array",items:te({}),description:"Evaluate these values or bindings and join them as text. Empty values are skipped unless keepEmpty is true."},separator:{type:"string",description:"Text inserted between joined values. Defaults to an empty string."},keepEmpty:{type:"boolean",description:"Keep missing, null, false, empty text and empty arrays in the join. Defaults to false."}},["$join"]);break;case"$measure":mr[fe]=Si({$measure:{enum:["width","height"],description:s.axis},fraction:{type:"number",minimum:0,maximum:1,description:"Fraction of the measured dimension, from 0 to 1. Defaults to 1."},unit:{enum:["pt","twip","in"],description:s.unit}},["$measure"]);break;default:{let fl=fe;throw new Error(`Missing authoring schema for directive ${fl}`)}}}return e[Ce]={allOf:[{if:D,then:{allOf:lc.map(fe=>({if:v[fe],then:mr[fe]?I({...mr[fe],properties:Object.fromEntries(Object.entries(mr[fe].properties).map(([Hn,fl])=>[Hn,I(fl)]))}):!1}))},else:He(Ke)},{if:Le,then:{properties:Object.fromEntries(Object.entries(mr).map(([fe,Hn])=>[fe,I(Hn.properties[fe])]))}}]},{...zt,..._e}}return e[l]=te(x,!0),p(l)}async function w$(e,t,r){let i=r.preserve??new Set,o=0,a=async(s,c,l)=>{if(l>64||++o>1e5)throw new La([{path:Un(e.sourceMap,c),code:"block_expansion_limit",message:"Combined plugin/block expansion exceeds depth/node limits (64/100000)."}]);if(Array.isArray(s)){let u=[];for(let f=0;f<s.length;f++)u.push(await a(s[f],`${c}/${f}`,l+1));return{standard:u.map(f=>f.standard),preserved:u.map(f=>f.preserved)}}if(!H(s)||s.enabled===!1)return{standard:s,preserved:s};if(s.name==="block")return a(e.expand(s,c,l),c,l+1);let p={...s},m={...s};for(let[u,f]of Object.entries(s)){if(c==="/props"&&u==="blocks")continue;let O=await a(f,`${c}/${u}`,l+1);Object.defineProperty(p,u,{value:O.standard,enumerable:!0,configurable:!0,writable:!0}),Object.defineProperty(m,u,{value:O.preserved,enumerable:!0,configurable:!0,writable:!0})}if(typeof s.name=="string"&&r.plugins.has(s.name)){let u=Un(e.sourceMap,c),f=await r.render(p,u);e.sourceMap[`${c}/children`]=u;let O=await a(f,`${c}/children`,l+1);return{standard:{name:"group",children:O.standard},preserved:i.has(s.name)?s:{name:"group",children:O.preserved}}}return{standard:p,preserved:m}};return a(t,"",0)}var C$="^\\\\s*\\\\{\\\\{\\\\s*[^{}\\\\n]*?\\\\S[^{}\\\\n]*?\\\\s*\\\\}\\\\}\\\\s*$",dm=e=>JSON.parse(JSON.stringify(e));function em(e,t,r){if(e!==void 0&&t!==void 0)return e===t?`${e} ${r}`:`${e}\\u2013${t} ${r}`;if(e!==void 0)return`at least ${e} ${r}`;if(t!==void 0)return`at most ${t} ${r}`}function og(e){let t=[];e.required&&e.default===void 0&&t.push("Required"),e.default!==void 0&&t.push(`Default: \\`${JSON.stringify(e.default)}\\``),e.type==="component"&&t.push("A component; placement stays in the definition"),e.enum&&t.push(`One of ${e.enum.map(a=>`\\`${JSON.stringify(a)}\\``).join(", ")}`);let r=em(e.minLength,e.maxLength,"characters");r&&t.push(r),e.maxWords!==void 0&&t.push(`at most ${e.maxWords} words`),e.oneLine&&t.push("one line");let i=em(e.minimum,e.maximum,"");i&&t.push(i.trim());let o=em(e.minItems,e.maxItems,"entries");return o&&t.push(o),e.role&&t.push(`Role: ${e.role}`),t}function ag(e){return[e.description,og(e).join(" \\xB7 ")].filter(Boolean).join(`\n\n`)}function hc(e,t){let r;if(e.type==="component")r=t?{allOf:[t,{properties:{props:{propertyNames:{not:{enum:[...lm]},errorMessage:"Block placement belongs in the definition, not in a component slot."}}}}]}:{type:"object",properties:{name:{type:"string"}},required:["name"]};else{let{oneLine:o,properties:a,items:s,...c}=e;for(let l of["role","required","maxWords","description"])delete c[l];if(r={...c},c.minLength!==void 0||c.maxLength!==void 0||c.enum!==void 0){let{minLength:l,maxLength:p,enum:m,...u}=c;r={...u,anyOf:[{...l!==void 0&&{minLength:l},...p!==void 0&&{maxLength:p},...m!==void 0&&{enum:m}},{type:"string",pattern:C$}]}}o&&(r.pattern="^[^\\\\r\\\\n]*$"),s&&(r.items=hc(s,t)),a&&(r.properties=Object.fromEntries(Object.entries(a).map(([l,p])=>[l,hc(p,t)])),r.required=Object.entries(a).filter(([,l])=>l.required&&l.default===void 0).map(([l])=>l),r.additionalProperties=!1)}e.description&&(r.description=e.description);let i=ag(e);return i&&(r.markdownDescription=i),r}function sg(e,t){return{type:"object",additionalProperties:!1,description:"Input values keyed by the slot names declared in the referenced block definition.",properties:Object.fromEntries(Object.entries(e.slots).map(([r,i])=>[r,hc(i,t)])),required:Object.entries(e.slots).filter(([,r])=>r.required&&r.default===void 0).map(([r])=>r)}}function cg(e,t){let r=Object.keys(e),i={type:"object",additionalProperties:!1,required:["ref"],properties:{ref:{type:"string",minLength:1,description:"Name in this document\\u2019s props.blocks.",...r.length&&{anyOf:r.map(o=>({const:o,type:"string",description:e[o].description??`Block "${o}", defined in this document.`}))}},slots:{type:"object",description:"Input values keyed by the slot names declared in the referenced block definition."}}};return r.length&&(i.allOf=r.map(o=>({if:{properties:{ref:{const:o}},required:["ref"]},then:{properties:{slots:sg(e[o],t)}}}))),i}function T$(e,t,r){for(let i of r){let o=e.definitions?.[i.name];if(!o)continue;let a=cg(t,i.componentRef),s=new Set,c=l=>{if(!l||typeof l!="object"||s.has(l))return;if(s.add(l),Array.isArray(l)){l.forEach(c);return}let p=l;if(p.properties?.name?.const==="block"&&p.properties.props){p.properties.props=dm(a);return}for(let[m,u]of Object.entries(p))m!=="$ref"&&c(u)};c(o)}}function gc(e,t){if(Array.isArray(e)){e.forEach(r=>gc(r,t));return}if(H(e)){e.name==="block"&&H(e.props)&&typeof e.props.ref=="string"&&t(e.props.ref,e);for(let r of Object.values(e))gc(r,t)}}function fm(e,t){let r=[],i=new Set([t]),o=a=>{let s=Object.prototype.hasOwnProperty.call(e,a)?e[a]:void 0;s&&gc([s.body,s.section,s.slide],c=>{i.has(c)||(i.add(c),Object.prototype.hasOwnProperty.call(e,c)&&(o(c),r.push(c)))})};return o(t),r}function lg(e,t,r){if(e.default!==void 0)return dm(e.default);if(e.enum?.length)return e.enum[0];switch(e.type){case"string":return t;case"number":case"integer":{let i=e.minimum??0;return e.maximum!==void 0&&e.maximum<i?e.maximum:i}case"boolean":return!0;case"array":{let i=Math.min(Math.max(3,e.minItems??0),e.maxItems??Number.POSITIVE_INFINITY),o=e.items??{type:"string"};return Array.from({length:i},(a,s)=>lg(o,`${t} ${s+1}`,r))}case"object":return pg(e.properties??{},r);case"component":return r==="docx"?{name:"paragraph",props:{text:t}}:{name:"text",props:{text:t}};default:return t}}function pg(e,t){return Object.fromEntries(Object.entries(e).filter(([,r])=>r.required&&r.default===void 0||r.role).map(([r,i])=>[r,lg(i,r,t)]))}function mg(e,t,r){let i;if(H(r.document)){let o=Object.fromEntries(Object.entries(r.document).filter(([a])=>a!=="props"));gc(o,(a,s)=>{if(i||a!==e)return;let c=s.props;i={name:"block",props:{ref:a,...H(c.slots)&&{slots:dm(c.slots)}}}})}return i??{name:"block",props:{ref:e,slots:pg(t.slots,r.format)}}}function P$(e,t){let r=Xr(e);return!T.Check(Qr,r)||bc(r,t.format).length>0?[]:Object.entries(r).map(([i,o])=>({name:i,format:t.format,template:t.template,definitionPointer:`/props/blocks/${Se(i)}`,description:o.description??"",definition:o,slotsSchema:um(o),example:mg(i,o,{document:e,format:t.format}),dependencies:fm(r,i)}))}var ug=["docx","pptx"],tm=n.String({pattern:"^[a-z][a-z0-9]*(-[a-z0-9]+)*$",description:"Kebab-case identifier."}),dg=n.Object({min:n.Integer({minimum:1}),max:n.Integer({minimum:1})},{additionalProperties:!1,description:"Expected length once filled: pages for a document, slides for a deck."}),fg=n.Object({description:n.String({minLength:1}),whenToUse:n.String({minLength:1}),pages:dg,metadata:n.Optional(n.Record(n.String(),n.String(),{description:"Document metadata the scaffold writes; a value may be a scaffold marker."})),children:n.Array(n.Unknown(),{minItems:1,description:"The top-level children of the scaffolded document, in order: sections holding block invocations and ordinary components, every slot carrying a {{\\u2026}} marker whose text is the guidance for filling it."})},{additionalProperties:!1}),hm=n.Object({id:tm,format:n.Union(ug.map(e=>n.Literal(e))),title:n.String({minLength:1}),description:n.String({minLength:1}),whenToUse:n.String({minLength:1}),theme:n.String({minLength:1,description:"Recommended theme. Any theme renders the scaffold; this one is the archetype\\u2019s house look."}),profile:tm,definitions:n.String({minLength:1,description:"The playground template whose props.blocks the variants invoke. The scaffold copies the definitions it needs, and their dependencies, into the document."}),numbering:n.Union([n.Literal("none"),n.Literal("sections")],{description:"Whether section openers carry numbers the reader cites (01, 02, \\u2026)."}),toc:n.Boolean({description:"Whether the scaffold places a table of contents."}),variants:n.Record(tm,fg,{minProperties:1,description:"Structural variants of the same archetype, so two documents from one brief do not look alike."})},{additionalProperties:!1,description:"A document archetype as data."});function hg(e){let t=[...T.Errors(hm,e)].map(r=>({path:r.path,message:r.message}));if(t.length>0)return t;for(let[r,i]of Object.entries(e.variants))i.pages.min>i.pages.max&&t.push({path:`/variants/${r}/pages`,message:`min (${i.pages.min}) exceeds max (${i.pages.max})`});return t}function E$(e){return T.Check(hm,e)}function A$(e,t){let r={};for(let i of t){let o=hg(i);if(o.length>0)throw new Error(`Invalid bundled blueprint: ${o.map(s=>`${s.path}: ${s.message}`).join("; ")}`);let a=i;if(a.format!==e)throw new Error(`Blueprint ${a.id} is not a ${e.toUpperCase()} blueprint.`);if(r[a.id])throw new Error(`Two bundled blueprints share the id "${a.id}"; the later one would silently replace the earlier.`);r[a.id]=a}return r}var $$=/^\\{\\{\\s*([\\s\\S]*?)\\s*\\}\\}$/;function gg(e,t,r){if(e.format!==t)throw new Error(`Blueprint ${e.id} is a ${e.format} blueprint; this instantiates ${t.toUpperCase()} ones.`);let i=r??Object.keys(e.variants)[0],o=e.variants[i];if(!o)throw new Error(`Blueprint ${e.id} has no variant "${i}"; it has ${Object.keys(e.variants).join(", ")}.`);return{id:i,variant:o}}function v$(e,t,r){let{id:i,variant:o}=gg(e,r.format,t.variant),a=structuredClone(t.children??o.children),s=yg(a,t.definitions,e),c={...o.metadata,...t.metadata},l={theme:t.theme??e.theme,qualityProfile:e.profile,...r.props,...Object.keys(s).length>0&&{blocks:s},...r.metadataPointer==="/props"?c:{metadata:c}},p={name:r.format,props:l,children:a};return{document:p,fillMap:L$(p,s,r),variant:i}}function yg(e,t,r){let i=new Set,o=s=>{if(Array.isArray(s))return s.forEach(o);if(!s||typeof s!="object")return;let c=s,l=c.props;c.name==="block"&&typeof l?.ref=="string"&&i.add(l.ref),Object.values(c).forEach(o)};o(e);let a={};for(let s of i){if(!t[s])throw new Error(`Blueprint ${r.id} invokes "${s}", which ${r.definitions} does not define.`);for(let c of[...fm(t,s),s])a[c]??(a[c]=structuredClone(t[c]))}return a}function L$(e,t,r){let i=`${r.metadataPointer}/`;return r.markers(e).map(o=>{let a=o.text.match($$)?.[1]??o.text,s={path:o.path,marker:o.text,guidance:a};if(o.path.startsWith(i)&&!o.path.slice(i.length).includes("/"))return{...s,kind:"metadata"};let c=bg(e,o.path,t);return c?{...s,kind:"slot",...c}:{...s,kind:"text"}})}function bg(e,t,r){let i=t.lastIndexOf("/props/slots/");if(i<0)return;let a=xg(e,t.slice(0,i))?.props?.ref;if(typeof a!="string"||!r[a])return;let s=t.slice(i+13).split("/").map(Og),c=r[a].slots[s[0]],l=[s[0]];for(let p of s.slice(1)){if(!c)break;if(c.type==="array"&&/^\\d+$/.test(p))c=c.items;else if(c.type==="object")c=c.properties?.[p],l.push(p);else{if(c.type==="component")break;c=void 0}}if(c)return{block:a,slot:l.join("."),type:c.type,...c.maxWords!==void 0&&{maxWords:c.maxWords},...c.maxLength!==void 0&&{maxLength:c.maxLength},...c.oneLine!==void 0&&{oneLine:c.oneLine},...c.required!==void 0&&{required:c.required}}}function Og(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function xg(e,t){if(t==="")return e;let r=e;for(let i of t.split("/").slice(1).map(Og))if(Array.isArray(r))r=r[Number(i)];else if(r&&typeof r=="object")r=r[i];else return;return r}var N$=[{level:1,name:"Integrity",bar:"Nothing is clipped, overflowing, overlapping, empty or left as placeholder text. Every page renders what the author meant to put there."},{level:2,name:"Legibility and accessibility",bar:"Type is large enough to read at the medium it is for, contrast holds, and the reading order is obvious."},{level:3,name:"Visual coherence",bar:"Hierarchy, grid, rhythm, typography and colour agree across every page. Repeated elements repeat. Nothing looks hand-placed."},{level:4,name:"Communicative effectiveness",bar:"Density, structure, charts and tables fit the purpose. Titles say what the page concludes. Every chart has a takeaway and a source; every number has a unit."},{level:5,name:"Craft and distinctiveness",bar:"The composition is refined and intentional, and does not read as a template with the blanks filled in."}],R$="Would you send this to a client, unchanged, with your name on it?",k$="Separately, rate how generic this looks: whether it reads as a document made for this brief, or as a template that would look identical for any other. A document can be clean, coherent and still generic.";function pc(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function Sg(e,t){let r={...e};return pc(e)&&pc(t)&&Object.keys(t).forEach(i=>{pc(t[i])?!(i in e)||!pc(e[i])?r[i]=t[i]:r[i]=Sg(e[i],t[i]):r[i]=t[i]}),r}function F$(e,t){return Sg(t,e)}function Ig(e){let t;try{t=new URL(/^https?:\\/\\//i.test(e.trim())?e.trim():`http://${e.trim()}`).hostname.toLowerCase()}catch{return!1}let r=t.replace(/^\\[|\\]$/g,"").replace(/\\.$/,"");if(r==="localhost"||r.endsWith(".localhost")||r==="::1"||/^f[cd][0-9a-f]{2}:/.test(r)||/^fe[89ab][0-9a-f]:/.test(r))return!0;let i=/^(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})$/.exec(r);if(i){let[o,a]=[Number(i[1]),Number(i[2])];return o===127||o===10||o===172&&a>=16&&a<=31||o===192&&a===168||o===169&&a===254}return/\\.(local|internal|home\\.arpa)$/.test(r)}var j$="W_HIGHCHARTS_REMOTE_EXPORT";function U$(e,t){if(!Ig(e)){if(!t)throw new Error(`Highcharts export server ${e} is outside this machine and its private networks, and a chart is posted whole \\u2014 every series, label and title. Run the export server locally (pnpm dlx highcharts-export-server --enableServer true), or set services.highcharts.allowRemote (HIGHCHARTS_ALLOW_REMOTE=1) to send chart data there deliberately.`);return`Chart data \\u2014 every series, label and title \\u2014 was sent to ${e}, outside this machine and its private networks (services.highcharts.allowRemote).`}}var _$=3e4,D$=2,M$=250,B$=2e3;function V$(e,t,r){let i=(e||t||r).trim();return(/^https?:\\/\\//i.test(i)?i:`http://${i}`).replace(/\\/+$/,"")}var gm="SERVICE_UNAVAILABLE";function Uh(e){return Object.assign(new Error(e),{code:gm})}function K$(e){let{code:t,status:r}=e;return t===gm?!0:r===429||r!==void 0&&r>=500}function G$(e,t){let r=new Error(`${e.message} (after ${t} attempts)`),{code:i,status:o}=e;return i!==void 0&&Object.assign(r,{code:i}),o!==void 0&&Object.assign(r,{status:o}),r}function q$(e,t){let r=Math.min(t*2**(e-1),B$);return Math.round(r*(.5+Math.random()*.5))}function _h(e,t,r){if(e?.name==="AbortError")return Uh(`${t.serviceLabel} timed out after ${r}ms at ${t.url}.`);let i=e instanceof Error?e.message:String(e);return Uh(t.onUnreachable(t.url,i))}async function W$(e,t,r,i){let o;try{o=await fetch(`${e.url}${e.path}`,{method:"POST",headers:t,body:JSON.stringify(e.body),signal:r})}catch(a){throw _h(a,e,i)}if(!o.ok)throw await o.body?.cancel().catch(()=>{}),Object.assign(new Error(`${e.serviceLabel} returned ${o.status}: ${o.statusText}`),{status:o.status});try{return await e.decode(o)}catch(a){throw _h(a,e,i)}}async function H$(e,t,r){let i=new AbortController,o=setTimeout(()=>i.abort(),r);try{return await W$(e,t,i.signal,r)}finally{clearTimeout(o)}}async function z$(e){let r={"Content-Type":"application/json",...typeof e.headers=="function"?await e.headers(e.body):e.headers},i=e.timeoutMs??_$,o=e.retryBaseDelayMs??M$,a=1+Math.max(0,e.retries??D$);for(let s=1;;s++)try{return await H$(e,r,i)}catch(c){let l=c;if(s>=a||!K$(l))throw s===1?l:G$(l,s);e.onRetry?.(s,l),await new Promise(p=>setTimeout(p,q$(s,o)))}}function wg(e){let t=0,r=[],i=()=>{t--,r.shift()?.()};return async function(a){for(;t>=e;)await new Promise(s=>r.push(s));t++;try{return await a()}finally{i()}}}var Cg=4,Cr={collected:0,unique:0,retries:0,maxInFlight:0},rm=0;function J$(){return{...Cr}}function Y$(){Cr.collected=0,Cr.unique=0,Cr.retries=0,Cr.maxInFlight=0}function Q$(){Cr.collected++}function X$(){Cr.retries++}var am=new Map;function Z$(e,t){let r=am.get(e);if(r)return r;let i=Math.max(1,Math.floor(Number.isFinite(t)?t:Cg)),o=wg(i);return am.set(e,o),o}function ev(e,t,r){return Z$(e,t)(r)}function tv(e,t){return`${e}\n${JSON.stringify(t)}`}function rv(e,t,r){if(!e)return r();let i=e.get(t);if(i)return i;let o=r();return e.set(t,o),o}function nv(e){return rv(e.cache,tv(e.serverUrl,e.requestBody),()=>ev(e.serverUrl,e.concurrency,()=>iv(e.send)))}async function iv(e){Cr.unique++,rm++,Cr.maxInFlight=Math.max(Cr.maxInFlight,rm);try{return await e()}finally{rm--}}function ov(){am.clear()}var bm={};rt(bm,{ComponentValidationError:()=>bi,DuplicateComponentError:()=>Gi,UnknownPreservedComponentError:()=>Js,createComponent:()=>Ki,createVersion:()=>Vi,getValidationSummary:()=>Qs,isValidationSuccess:()=>Ys,resolveComponentVersion:()=>yi,validateAgainstSchema:()=>Lp,validateCustomComponentProps:()=>Nn});var vu={};rt(vu,{AlignmentSchema:()=>en,BASE_SCHEMA_METADATA:()=>uy,BUILT_IN_DOCX_THEME_NAMES:()=>Ya,BaseComponentPropsSchema:()=>$g,BlockInvocationPropsSchema:()=>Dn,BorderSchema:()=>Eg,COMPONENT_METADATA:()=>my,ChartPropsSchema:()=>ru,ColumnsPropsSchema:()=>mn,CommentReplySchema:()=>Gm,CommentSchema:()=>no,ComponentDefinitionSchema:()=>dt,CustomComponentDefinitionSchema:()=>Pr,DEFAULT_DOCX_RENDERER_ID:()=>Ja,DEFAULT_ERROR_CONFIG:()=>An,DOCX_RENDERER_IDS:()=>Tr,DividerPropsSchema:()=>eu,ERROR_EMOJIS:()=>fi,ERROR_TEMPLATES:()=>vy,EndnotesSchema:()=>Wm,FLOW_CHILDREN:()=>dn,FootnotesSchema:()=>qm,GenerateDocumentRequestSchema:()=>zy,GenerateDocumentResponseSchema:()=>Yy,GroupPropsSchema:()=>Qm,HeadingLevelSchema:()=>xc,HeadingPropsSchema:()=>on,HighchartsPropsSchema:()=>tu,ImagePropsSchema:()=>sn,IndentSchema:()=>Mn,JSON_SCHEMA_URLS:()=>Zy,JsonComponentDefinitionSchema:()=>Xy,JsonDocumentParser:()=>Au,JsonParsingError:()=>mo,JsonValidationError:()=>uo,JustifiedAlignmentSchema:()=>Ua,LineSpacingSchema:()=>_a,ListMarkerFontSchema:()=>Jm,ListPropsSchema:()=>un,MarginsSchema:()=>Pg,NATIVE_RENDER_MODE:()=>Lc,NATIVE_VISUAL_ELEMENT_NAMES:()=>Dg,NativeVisualCanvasSchema:()=>km,NativeVisualElementSchema:()=>Rm,NativeVisualImagePropsSchema:()=>Nm,NativeVisualShapePropsSchema:()=>Lm,NativeVisualTextPropsSchema:()=>vm,NoteSchema:()=>Fc,NumberingSchema:()=>Ag,ParagraphIndentSchema:()=>Da,ParagraphPropsSchema:()=>an,ReportPropsSchema:()=>fn,RevisionMarkSchema:()=>Km,RevisionSchema:()=>ro,RevisionSegmentSchema:()=>Vm,SHARED_DOCX_VERSION:()=>wN,STANDARD_COMPONENTS:()=>cb,STANDARD_COMPONENTS_REGISTRY:()=>Tt,STANDARD_COMPONENTS_SET:()=>cN,SectionPropsSchema:()=>pn,SpacingSchema:()=>Ct,StandardComponentDefinitionSchema:()=>Bc,StatisticPropsSchema:()=>cn,THEME_SCHEMA_METADATA:()=>dy,TabStopLeaderSchema:()=>wm,TabStopSchema:()=>Cm,TabStopTypeSchema:()=>Im,TabStopsSchema:()=>Sc,TablePropsSchema:()=>ln,TextBoxPropsSchema:()=>Xm,TextSpaceAfterComponentSchema:()=>iu,TextSpaceAfterPropsSchema:()=>nu,ThemeConfigSchema:()=>oo,ThemeOverridesSchema:()=>_c,TocPropsSchema:()=>Zm,ValidateDocumentRequestSchema:()=>Jy,ValidateDocumentResponseSchema:()=>Qy,VisualCanvasBackgroundSchema:()=>Fm,VisualCanvasSchema:()=>jm,VisualNativePropsSchema:()=>_m,VisualPropsSchema:()=>vc,VisualRasterPropsSchema:()=>Um,calculatePosition:()=>Bi,clearComponentNamesCache:()=>Ia,collectDocxRendererErrors:()=>kc,collectIndentConflicts:()=>mu,collectNoteRevisionConflicts:()=>uu,collectTextBoxShapeConflicts:()=>du,compareSemver:()=>gi,componentValidator:()=>co,comprehensiveValidateDocument:()=>hu,convertDocxToJsonSchema:()=>cy,convertToJsonSchema:()=>cy,createComponentSchema:()=>qi,createComponentValidator:()=>Jc,createDocumentValidator:()=>Gc,createDocxComponentSchema:()=>ly,createErrorConfig:()=>Ir,createJsonParseError:()=>hi,createJsonValidator:()=>Sy,createMinimalTheme:()=>iy,createThemeValidator:()=>zc,createValidatedComponent:()=>aN,createValidator:()=>xy,deepValidateDocument:()=>fu,diffDocuments:()=>WL,diffWords:()=>rl,documentValidator:()=>so,docxComponentDefinitionName:()=>nn,docxDocumentBlockTargets:()=>Kg,docxFlowDefinitionName:()=>Nc,exportDocxSchemaToFile:()=>py,exportSchemaToFile:()=>Wi,extractStandardComponentNames:()=>di,fixDocxSchemaReferences:()=>Mc,fixSchemaReferences:()=>Rn,formatErrorMessage:()=>xr,formatErrorReport:()=>ns,formatErrorSummary:()=>Yr,formatValidationError:()=>rN,formatValidationErrorStrings:()=>nN,formatValidationErrors:()=>JL,generateUnifiedDocumentSchema:()=>fy,getAllStandardComponentNames:()=>oy,getErrorSummary:()=>sb,getLiteralValue:()=>St,getObjectSchemaPropertyNames:()=>Sr,getSchemaMetadata:()=>wa,getStandardComponent:()=>Qa,getThemeName:()=>Ry,getValidationContext:()=>tN,getValidationErrors:()=>XL,getValidationSummary:()=>wy,groupErrorsByPath:()=>Ca,hasCriticalErrors:()=>is,isColumnsComponent:()=>mN,isColumnsProps:()=>My,isCustomComponentProps:()=>qy,isHeadingComponent:()=>uN,isHeadingProps:()=>_y,isHighchartsComponent:()=>xN,isImageComponent:()=>fN,isImageProps:()=>By,isListComponent:()=>bN,isListProps:()=>Gy,isLiteralSchema:()=>Jr,isNativeVisualProps:()=>Bg,isObjectSchema:()=>qt,isParagraphComponent:()=>dN,isParagraphProps:()=>Dy,isReportComponent:()=>lN,isReportProps:()=>jy,isSectionComponent:()=>pN,isSectionProps:()=>Uy,isStandardComponentName:()=>po,isStatisticComponent:()=>gN,isStatisticProps:()=>Vy,isTableComponent:()=>yN,isTableProps:()=>Ky,isTextBoxComponent:()=>hN,isTextSpaceAfterComponent:()=>IN,isThemeConfig:()=>ky,isTocComponent:()=>ON,isUnionSchema:()=>Sa,isValidComponent:()=>sN,isValidDocument:()=>Py,isValidSemver:()=>Ln,isValidTheme:()=>Ny,isValidThemeConfig:()=>ny,isValidThemeJson:()=>Ny,isValidationSuccess:()=>Iy,isVisualComponent:()=>SN,latestVersion:()=>ut,parseJsonComponent:()=>HL,parseJsonWithLineNumbers:()=>zL,parseSemver:()=>vn,safeValidateComponentDefinition:()=>QL,safeValidateComponentProps:()=>YL,sharedCreateComponentSchemaObject:()=>tc,strictComponentValidator:()=>Wc,strictDocumentValidator:()=>Xa,strictThemeValidator:()=>qc,stripMarkdown:()=>ts,themeValidator:()=>Za,transformAndValidate:()=>oN,transformDocxValueError:()=>lu,transformDocxValueErrors:()=>pu,transformValueError:()=>$n,transformValueErrors:()=>tt,validate:()=>Wy,validateAgainstSchema:()=>Pt,validateBatch:()=>by,validateComponent:()=>ol,validateComponentDefinition:()=>$u,validateComponentProps:()=>lo,validateComponents:()=>iN,validateCustomComponentProps:()=>Ou,validateDocument:()=>Vc,validateDocumentWithSchema:()=>$y,validateJson:()=>ao,validateJsonComponent:()=>Kc,validateJsonComponentDoc:()=>Ay,validateJsonDocument:()=>Kc,validateStrict:()=>Hy,validateTheme:()=>Hc,validateThemeJson:()=>gu,validateThemeWithEnhancement:()=>yu,validateWithEnhancement:()=>Oy});var Q=n.String({pattern:"^(#[0-9A-Fa-f]{6}|[a-zA-Z][a-zA-Z0-9]*)$",description:\'Hex color with # prefix (e.g. "#000000") or theme color name\'}),Om=n.String({pattern:"^(transparent|#[0-9A-Fa-f]{6}|[a-zA-Z][a-zA-Z0-9]*)$",description:\'Hex color with # prefix, theme color name, or "transparent"\'}),xm=n.String({pattern:"^[A-Za-z]{2,3}(-[A-Za-z0-9]{2,8})*$",description:\'BCP-47 language tag for spell/grammar checking (e.g. "en-US", "fr-FR", "de-DE")\',examples:["en-US","fr-FR","de-DE","it-IT","es-ES"]}),Sm=n.Boolean({description:"Disable spell/grammar checking for this text (e.g. code snippets or identifiers)"}),ja=n.Array(n.String({minLength:1}),{description:"Words that should never be flagged as misspelled (whole-word, case-insensitive). E.g. brand names or technical terms.",examples:[["Wiseair","json-to-office","pptx"]]}),Oc=n.Object({case:n.Optional(xi),size:n.Optional(n.Number({minimum:8,maximum:1638})),color:n.Optional(Q),bold:n.Optional(n.Boolean()),fontWeight:n.Optional(n.Integer({minimum:100,maximum:900,description:"Per-run weight (100\\u2013900). Any integer accepted; renderer picks the closest embedded variant via CSS font-matching. `bold: true` is shorthand for `fontWeight: 700`; if both are set, `fontWeight` wins."})),italic:n.Optional(n.Boolean()),underline:n.Optional(n.Boolean()),lineSpacing:n.Optional(n.Object({type:n.Union([n.Literal("single"),n.Literal("atLeast"),n.Literal("exactly"),n.Literal("double"),n.Literal("multiple")],{description:"`single`/`double` ignore `value`; `multiple` scales single spacing by it; `atLeast` is a floor the line grows past; `exactly` pins an absolute box the glyphs are clipped to."}),value:n.Optional(n.Number({minimum:0,description:"Points for `exactly` and `atLeast`, a factor of single spacing for `multiple`. Unlike `size` this has no floor \\u2014 an empty spacer paragraph legitimately pins a fraction of a point \\u2014 so an `exactly` box too small for the text it holds is reported as W_QUALITY_LINE_BOX_COLLAPSE instead."}))},{additionalProperties:!1})),spacing:n.Optional(n.Object({before:n.Optional(n.Number({minimum:0})),after:n.Optional(n.Number({minimum:0}))},{additionalProperties:!1})),characterSpacing:n.Optional(n.Object({type:n.Union([n.Literal("condensed"),n.Literal("expanded")]),value:n.Number()},{additionalProperties:!1})),scale:n.Optional(n.Number({minimum:1,maximum:600,description:"Character width scaling in percent (w:w). 100 is normal; values below compress glyphs, above expand them (e.g. 55, 115)."}))},{additionalProperties:!1}),Zr=n.Object({family:Ht,...Oc.properties},{description:"Font definition with family and optional formatting properties",additionalProperties:!1});var en=n.Union([n.Literal("left"),n.Literal("center"),n.Literal("right")],{description:"Text alignment options"}),Ua=n.Union([n.Literal("left"),n.Literal("center"),n.Literal("right"),n.Literal("justify")],{description:"Text alignment options including justify"}),xc=n.Union([n.Literal(1),n.Literal(2),n.Literal(3),n.Literal(4),n.Literal(5),n.Literal(6)],{description:"Heading level (1-6)"}),Ct=n.Object({before:n.Optional(n.Number({minimum:0,description:"Spacing before element in points"})),after:n.Optional(n.Number({minimum:0,description:"Spacing after element in points"}))},{description:"Spacing configuration",additionalProperties:!1}),Tg=n.Object({before:n.Optional(n.Number({minimum:0,description:"Spacing before list in points"})),after:n.Optional(n.Number({minimum:0,description:"Spacing after list in points"})),item:n.Optional(n.Number({minimum:0,description:"Spacing between list items in points"}))},{description:"List spacing configuration with item spacing",additionalProperties:!1}),Pg=n.Object({top:n.Optional(n.Number({minimum:0})),bottom:n.Optional(n.Number({minimum:0})),left:n.Optional(n.Number({minimum:0})),right:n.Optional(n.Number({minimum:0}))},{description:"Margin configuration",additionalProperties:!1}),Eg=n.Object({style:n.Optional(n.Union([n.Literal("solid"),n.Literal("dashed"),n.Literal("dotted"),n.Literal("double"),n.Literal("none")])),width:n.Optional(n.Number({minimum:0})),color:n.Optional(Q)},{description:"Border configuration",additionalProperties:!1}),_a=n.Object({type:n.Union([n.Literal("single"),n.Literal("atLeast"),n.Literal("exactly"),n.Literal("double"),n.Literal("multiple")],{description:"`single`/`double` ignore `value`; `multiple` scales single spacing by it; `atLeast` is a floor the line grows past; `exactly` pins an absolute box the glyphs are clipped to."}),value:n.Optional(n.Number({minimum:0,description:"Points for `exactly` and `atLeast`, a factor of single spacing for `multiple`. `exactly` has no floor of its own \\u2014 an empty spacer paragraph legitimately pins a fraction of a point \\u2014 so a box smaller than the text it holds is accepted here and clips it."}))},{description:"Line spacing configuration",additionalProperties:!1}),Mn=n.Object({left:n.Optional(n.Number({minimum:0,description:"Left indentation in points. Omit to inherit the per-level default of 36pt (half an inch) per level."})),hanging:n.Optional(n.Number({minimum:0,description:"Hanging indent in points \\u2014 how far the marker sits left of the text. Omit for the 18pt default."}))},{description:"Indentation configuration, in points",additionalProperties:!1}),Da=n.Object({left:n.Optional(n.Number({description:"Left indentation in twips (1/20 of a point)"})),right:n.Optional(n.Number({description:"Right indentation in twips (1/20 of a point)"})),hanging:n.Optional(n.Number({minimum:0,description:"Hanging indent in twips: first line stays at the left indent, following lines are indented. Mutually exclusive with firstLine."})),firstLine:n.Optional(n.Number({minimum:0,description:"First-line indent in twips: only the first line is indented. Mutually exclusive with hanging."}))},{description:"Paragraph indentation (w:ind) in twips. Use either hanging or firstLine, not both.",additionalProperties:!1}),Im=n.Union([n.Literal("left"),n.Literal("right"),n.Literal("center"),n.Literal("decimal"),n.Literal("bar")],{description:"Tab stop alignment type"}),wm=n.Union([n.Literal("dot"),n.Literal("hyphen"),n.Literal("underscore"),n.Literal("middleDot"),n.Literal("none")],{description:"Leader character filling the space before the tab stop"}),Cm=n.Object({type:Im,position:n.Number({minimum:0,description:"Tab stop position in twips (1/20 of a point)"}),leader:n.Optional(wm)},{description:"Tab stop definition (w:tab in w:tabs)",additionalProperties:!1});var Sc=n.Array(Cm,{description:"Tab stops for the paragraph. Tab characters (\\\\t) in the text jump to these positions."}),av=n.Union([n.Literal("character"),n.Literal("column"),n.Literal("margin"),n.Literal("page"),n.Literal("text")],{description:"Horizontal position relative to"}),sv=n.Union([n.Literal("margin"),n.Literal("page"),n.Literal("paragraph"),n.Literal("line"),n.Literal("text")],{description:"Vertical position relative to"}),cv=n.Union([n.Literal("left"),n.Literal("center"),n.Literal("right"),n.Literal("inside"),n.Literal("outside")],{description:"Horizontal alignment"}),lv=n.Union([n.Literal("top"),n.Literal("center"),n.Literal("bottom"),n.Literal("inside"),n.Literal("outside")],{description:"Vertical alignment"}),pv=n.Union([n.Literal("none"),n.Literal("square"),n.Literal("topAndBottom"),n.Literal("around"),n.Literal("tight"),n.Literal("through")],{description:"Text wrapping type"}),mv=n.Union([n.Literal("bothSides"),n.Literal("left"),n.Literal("right"),n.Literal("largest")],{description:"Text wrapping side"}),Ii=n.Object({horizontalPosition:n.Optional(n.Object({relative:n.Optional(av),align:n.Optional(cv),offset:n.Optional(n.Union([n.Number({description:"Horizontal offset in twips (1/20 of a point)"}),n.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:\'Horizontal offset as percentage (e.g., "50%") relative to page or margin width\'})]))},{description:"Horizontal positioning (use either align or offset, not both)",additionalProperties:!1})),verticalPosition:n.Optional(n.Object({relative:n.Optional(sv),align:n.Optional(lv),offset:n.Optional(n.Union([n.Number({description:"Vertical offset in twips (1/20 of a point)"}),n.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:\'Vertical offset as percentage (e.g., "50%") relative to page or margin height\'})]))},{description:"Vertical positioning (use either align or offset, not both)",additionalProperties:!1})),wrap:n.Optional(n.Object({type:pv,side:n.Optional(mv),margins:n.Optional(n.Object({top:n.Optional(n.Union([n.Number({description:"Top margin in twips"}),n.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:"Top margin as percentage of page height"})])),bottom:n.Optional(n.Union([n.Number({description:"Bottom margin in twips"}),n.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:"Bottom margin as percentage of page height"})])),left:n.Optional(n.Union([n.Number({description:"Left margin in twips"}),n.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:"Left margin as percentage of page width"})])),right:n.Optional(n.Union([n.Number({description:"Right margin in twips"}),n.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:"Right margin as percentage of page width"})]))},{description:"Distance from text margins",additionalProperties:!1}))},{description:"Text wrapping configuration",additionalProperties:!1})),allowOverlap:n.Optional(n.Boolean({description:"Allow element to overlap with other elements"})),behindDocument:n.Optional(n.Boolean({description:"Place element behind document text"})),lockAnchor:n.Optional(n.Boolean({description:"Lock the anchor position"})),layoutInCell:n.Optional(n.Boolean({description:"Layout element within table cell"})),zIndex:n.Optional(n.Number({minimum:0,description:"Z-order for overlapping elements (must be non-negative)"})),rotation:n.Optional(n.Number({description:"Rotation angle in degrees"})),visibility:n.Optional(n.Union([n.Literal("hidden"),n.Literal("inherit")],{description:"Visibility of the floating element"}))},{description:"Floating element properties",additionalProperties:!1}),Ag=n.Object({start:n.Optional(n.Number({minimum:1})),style:n.Optional(n.Union([n.Literal("decimal"),n.Literal("lowerLetter"),n.Literal("upperLetter"),n.Literal("lowerRoman"),n.Literal("upperRoman")])),separator:n.Optional(n.String())},{description:"Numbering configuration for lists",additionalProperties:!1}),uv={},$g=n.Object(uv,{description:"Base component props",additionalProperties:!0});var dv=n.String({pattern:"^#?[0-9A-Fa-f]{6}$",description:"Hex color (e.g. #FF0000)"}),wc=["primary","secondary","accent","background","text","text2","background2","accent4","accent5","accent6"],Cc=["accent1","accent2","accent3","tx1","tx2","bg1","bg2"],Bn=n.Union([dv,...wc.map(e=>n.Literal(e)),...Cc.map(e=>n.Literal(e))],{description:"Hex color or semantic theme color name"}),Xi=["title","subtitle","heading1","heading2","heading3","body","caption",...Hi],Ma=n.Union(Xi.map(e=>n.Literal(e)),{description:"Predefined style name"}),Ba=n.Union([n.Literal("left"),n.Literal("center"),n.Literal("right")],{description:"Horizontal alignment options"}),wi=n.Union([n.Literal("top"),n.Literal("middle"),n.Literal("bottom")],{description:"Vertical alignment options"}),Zi=n.Object({type:n.Optional(n.Union([n.Literal("outer"),n.Literal("inner")],{description:"Shadow type"})),color:n.Optional(Bn),blur:n.Optional(n.Number({description:"Shadow blur radius in points"})),offset:n.Optional(n.Number({description:"Shadow offset in points"})),angle:n.Optional(n.Number({description:"Shadow angle in degrees"})),opacity:n.Optional(n.Number({minimum:0,maximum:1,description:"Shadow opacity (0-1)"}))},{description:"Shadow configuration",additionalProperties:!1}),rn=n.Object({column:n.Number({minimum:0,description:"Starting column (0-indexed)"}),row:n.Number({minimum:0,description:"Starting row (0-indexed)"}),columnSpan:n.Optional(n.Number({minimum:1,description:"Number of columns to span (default: 1)"})),rowSpan:n.Optional(n.Number({minimum:1,description:"Number of rows to span (default: 1)"}))},{additionalProperties:!1,description:"Grid-based positioning"}),Tc=n.Object({text:n.String({description:"Run text content"}),color:n.Optional(n.String({description:"Run color (hex without # or semantic theme name)"})),bold:n.Optional(n.Boolean({description:"Bold run"})),fontWeight:n.Optional(n.Integer({minimum:100,maximum:900,description:"Per-run weight (100\\u2013900). Overrides `bold` when set \\u2014 renderer picks the closest embedded variant via CSS font-matching."})),italic:n.Optional(n.Boolean({description:"Italic run"})),underline:n.Optional(n.Union([n.Boolean({description:"Simple underline toggle"}),n.Object({style:n.Optional(n.Union([n.Literal("sng"),n.Literal("dbl"),n.Literal("dash"),n.Literal("dotted")])),color:n.Optional(n.String({description:"Underline color (hex)"}))},{additionalProperties:!1})])),strike:n.Optional(n.Boolean({description:"Strikethrough run"})),fontSize:n.Optional(n.Number({minimum:1,description:"Run font size in points"})),fontFace:n.Optional(n.String({description:"Run font family"})),superscript:n.Optional(n.Boolean({description:"Render run as superscript"})),subscript:n.Optional(n.Boolean({description:"Render run as subscript"})),charSpacing:n.Optional(n.Number({description:"Character spacing in points"})),breakLine:n.Optional(n.Boolean({description:"Insert line break after this run"}))},{description:"A styled text run. Run options override component-level defaults.",additionalProperties:!1}),Va=n.Object({text:n.Optional(n.String({description:"Text content to display. Mutually exclusive with `runs` \\u2014 set exactly one of the two."})),runs:n.Optional(n.Array(Tc,{minItems:1,description:"Rich text runs with per-run styling, rendered as one text block. Mutually exclusive with `text` \\u2014 set exactly one of the two. Component-level props (align, valign, fill, lineSpacing, position\\u2026) still apply to the whole block."})),x:n.Optional(n.Union([n.Number({description:"X position in inches"}),n.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:"X as percentage"})])),y:n.Optional(n.Union([n.Number({description:"Y position in inches"}),n.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:"Y as percentage"})])),w:n.Optional(n.Union([n.Number({description:"Width in inches"}),n.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:"Width as percentage"})])),h:n.Optional(n.Union([n.Number({description:"Height in inches"}),n.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:"Height as percentage"})])),fit:n.Optional(n.Object({maxLines:n.Optional(n.Integer({minimum:1,description:"Lines the text may occupy, estimated with the width model at the effective font size."})),shrink:n.Optional(n.Array(n.Number({minimum:1}),{minItems:1,description:"Readable font sizes to try in order when the text exceeds maxLines or the box height. The first that fits is used."}))},{additionalProperties:!1,description:"Bounded fit: estimate the lines at the effective size, step down only through the declared readable sizes, and fail generation with text_fit_overflow when nothing fits. Without maxLines the box height bounds the text; without shrink the text must fit as sized."})),fontSize:n.Optional(n.Number({minimum:1,description:"Font size in points"})),fontFace:n.Optional(Ht),color:n.Optional(n.String({description:\'Text color (hex without #, e.g., "FF0000")\'})),bold:n.Optional(n.Boolean({description:"Bold text"})),fontWeight:n.Optional(n.Integer({minimum:100,maximum:900,description:"Per-run weight (100\\u2013900). Renderer picks the closest embedded variant via CSS font-matching and references it through a synthetic family alias. Overrides `bold` when set."})),italic:n.Optional(n.Boolean({description:"Italic text"})),underline:n.Optional(n.Union([n.Boolean({description:"Simple underline toggle"}),n.Object({style:n.Optional(n.Union([n.Literal("sng"),n.Literal("dbl"),n.Literal("dash"),n.Literal("dotted")])),color:n.Optional(n.String({description:"Underline color (hex)"}))},{additionalProperties:!1})])),strike:n.Optional(n.Boolean({description:"Strikethrough text"})),language:n.Optional(n.String({pattern:"^[A-Za-z]{2,3}(-[A-Za-z0-9]{2,8})*$",description:\'Language tag (BCP-47, e.g. "en-US", "fr-FR") for spell-checking this text. Overrides the presentation default.\',examples:["en-US","fr-FR","de-DE","it-IT","es-ES"]})),align:n.Optional(Ba),valign:n.Optional(wi),breakLine:n.Optional(n.Boolean({description:"Add line break after text"})),bullet:n.Optional(n.Union([n.Boolean({description:"Enable default bullet"}),n.Object({type:n.Optional(n.Union([n.Literal("bullet"),n.Literal("number")])),style:n.Optional(n.String({description:"Bullet character or style"})),startAt:n.Optional(n.Number({description:"Starting number for numbered lists"}))},{additionalProperties:!1})])),margin:n.Optional(n.Union([n.Number({description:"Margin in points (all sides)"}),n.Array(n.Number(),{description:"Margins as [top, right, bottom, left] in points",minItems:4,maxItems:4})])),rotate:n.Optional(n.Number({description:"Rotation angle in degrees"})),shadow:n.Optional(Zi),fill:n.Optional(n.Object({color:n.String({description:"Fill color (hex without #)"}),transparency:n.Optional(n.Number({minimum:0,maximum:100,description:"Fill transparency (0-100)"}))},{additionalProperties:!1})),hyperlink:n.Optional(n.Object({url:n.Optional(n.String({description:"Hyperlink URL"})),slide:n.Optional(n.Number({description:"Slide number to link to"})),tooltip:n.Optional(n.String({description:"Hyperlink tooltip"}))},{additionalProperties:!1})),lineSpacing:n.Optional(n.Number({description:"Line spacing in points"})),lineSpacingMultiple:n.Optional(n.Number({minimum:.1,maximum:10,description:"Line spacing as a multiple of the font size (e.g. 0.9 = 90%). Takes precedence over lineSpacing."})),charSpacing:n.Optional(n.Number({description:"Character spacing in points (positive = wider, negative = tighter)"})),paraSpaceBefore:n.Optional(n.Number({description:"Space before paragraph in points"})),paraSpaceAfter:n.Optional(n.Number({description:"Space after paragraph in points"})),grid:n.Optional(rn),style:n.Optional(Ma)},{description:"Text component props",additionalProperties:!1}),Ka=n.Object({path:n.Optional(n.String({description:"Image file path or URL (mutually exclusive with base64 and svg)"})),base64:n.Optional(n.String({description:"Base64-encoded image data in data URI format (mutually exclusive with path and svg)"})),svg:n.Optional(n.String({description:\'Raw inline SVG markup, e.g. "<svg xmlns=\\\\"http://www.w3.org/2000/svg\\\\" viewBox=\\\\"0 0 24 24\\\\">...</svg>" (mutually exclusive with path and base64). Wrapped into an image/svg+xml data URI and embedded as a vector (PowerPoint 2016+); intrinsic size taken from the SVG viewBox/width/height when w/h omitted.\'})),x:n.Optional(n.Union([n.Number({description:"X position in inches"}),n.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:"X as percentage"})])),y:n.Optional(n.Union([n.Number({description:"Y position in inches"}),n.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:"Y as percentage"})])),w:n.Optional(n.Union([n.Number({description:"Width in inches"}),n.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:"Width as percentage"})])),h:n.Optional(n.Union([n.Number({description:"Height in inches"}),n.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:"Height as percentage"})])),sizing:n.Optional(n.Object({type:n.Union([n.Literal("contain"),n.Literal("cover"),n.Literal("crop")],{description:"Image sizing strategy"}),w:n.Optional(n.Number({description:"Target width in inches"})),h:n.Optional(n.Number({description:"Target height in inches"}))},{description:"Image sizing options",additionalProperties:!1})),rotate:n.Optional(n.Number({description:"Rotation angle in degrees"})),rounding:n.Optional(n.Boolean({description:"Apply rounded corners to image"})),shadow:n.Optional(Zi),hyperlink:n.Optional(n.Object({url:n.Optional(n.String({description:"Hyperlink URL"})),slide:n.Optional(n.Number({description:"Slide number to link to"})),tooltip:n.Optional(n.String({description:"Hyperlink tooltip"}))},{additionalProperties:!1})),alt:n.Optional(n.String({description:"Alternative text for accessibility"})),grid:n.Optional(rn)},{description:"PPTX image component props",additionalProperties:!1}),eo=n.Union([n.Literal("rect"),n.Literal("roundRect"),n.Literal("ellipse"),n.Literal("triangle"),n.Literal("diamond"),n.Literal("pentagon"),n.Literal("hexagon"),n.Literal("star5"),n.Literal("star6"),n.Literal("line"),n.Literal("arc"),n.Literal("pie"),n.Literal("blockArc"),n.Literal("chord"),n.Literal("arrow"),n.Literal("chevron"),n.Literal("cloud"),n.Literal("heart"),n.Literal("lightning")],{description:"Shape type"}),Lg=n.Object({text:n.String(),fontSize:n.Optional(n.Number({minimum:1})),fontFace:n.Optional(n.String()),color:n.Optional(n.String({description:"Segment color (hex without # or semantic name)"})),bold:n.Optional(n.Boolean()),fontWeight:n.Optional(n.Integer({minimum:100,maximum:900})),italic:n.Optional(n.Boolean()),breakLine:n.Optional(n.Boolean({description:"Insert line break after this segment"})),spaceBefore:n.Optional(n.Number({minimum:0,description:"Space before paragraph in points"})),spaceAfter:n.Optional(n.Number({minimum:0,description:"Space after paragraph in points"})),charSpacing:n.Optional(n.Number({description:"Character spacing in points"}))},{additionalProperties:!1}),Pc=["pct5","pct10","pct20","pct25","pct30","pct40","pct50","pct60","pct70","pct75","pct80","pct90","horz","vert","ltHorz","ltVert","dkHorz","dkVert","narHorz","narVert","dashHorz","dashVert","cross","dnDiag","upDiag","ltDnDiag","ltUpDiag","dkDnDiag","dkUpDiag","wdDnDiag","wdUpDiag","dashDnDiag","dashUpDiag","diagCross","smCheck","lgCheck","smGrid","lgGrid","dotGrid","smConfetti","lgConfetti","horzBrick","diagBrick","solidDmnd","openDmnd","dotDmnd","plaid","sphere","weave","divot","shingle","wave","trellis","zigZag"],Ec=n.Object({color:n.String({description:"Stop color (hex without # or semantic theme name)"}),pos:n.Number({minimum:0,maximum:100,description:"Stop position along the gradient (0-100)"}),transparency:n.Optional(n.Number({minimum:0,maximum:100,description:"Stop transparency (0-100)"}))},{additionalProperties:!1,description:"Gradient color stop"}),to=n.Object({type:n.Union([n.Literal("linear"),n.Literal("radial")],{description:"Gradient type"}),angle:n.Optional(n.Number({minimum:0,maximum:360,description:"Gradient angle in degrees for linear gradients (0 = left\\u2192right, 90 = top\\u2192bottom). Default: 0."})),stops:n.Array(Ec,{minItems:2,description:"Gradient color stops (at least 2)"}),focus:n.Optional(n.Union([n.Literal("center"),n.Literal("topLeft"),n.Literal("topRight"),n.Literal("bottomLeft"),n.Literal("bottomRight")],{description:\'Focus point for radial gradients (default: "center")\'}))},{additionalProperties:!1,description:"Gradient fill configuration"}),Ac=n.Object({preset:n.Union(Pc.map(e=>n.Literal(e)),{description:"OOXML pattern preset name (a:pattFill prst value)"}),foreground:n.String({description:"Pattern foreground color (hex without # or semantic name)"}),background:n.String({description:"Pattern background color (hex without # or semantic name)"})},{additionalProperties:!1,description:"Pattern fill configuration"}),Ga=n.Object({type:eo,x:n.Optional(n.Union([n.Number({description:"X position in inches"}),n.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:"X as percentage"})])),y:n.Optional(n.Union([n.Number({description:"Y position in inches"}),n.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:"Y as percentage"})])),w:n.Optional(n.Union([n.Number({description:"Width in inches"}),n.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:"Width as percentage"})])),h:n.Optional(n.Union([n.Number({description:"Height in inches"}),n.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:"Height as percentage"})])),fill:n.Optional(n.Object({color:n.Optional(n.String({description:"Fill color (hex without #)"})),transparency:n.Optional(n.Number({minimum:0,maximum:100,description:"Fill transparency (0-100)"})),gradient:n.Optional(to),pattern:n.Optional(Ac)},{additionalProperties:!1})),line:n.Optional(n.Object({color:n.Optional(n.String({description:"Line color (hex without #)"})),width:n.Optional(n.Number({minimum:0,description:"Line width in points"})),dashType:n.Optional(n.Union([n.Literal("solid"),n.Literal("dash"),n.Literal("dot"),n.Literal("dashDot")]))},{additionalProperties:!1})),text:n.Optional(n.Union([n.String({description:"Plain text"}),n.Array(Lg,{description:"Rich text segments with per-segment formatting"})],{description:"Text content inside the shape"})),fontSize:n.Optional(n.Number({minimum:1,description:"Font size for shape text"})),fontFace:n.Optional(n.String({description:"Font family for shape text"})),fontColor:n.Optional(n.String({description:"Font color for shape text (hex without #)"})),charSpacing:n.Optional(n.Number({description:"Character spacing in points for shape text"})),bold:n.Optional(n.Boolean({description:"Bold shape text"})),fontWeight:n.Optional(n.Integer({minimum:100,maximum:900,description:"Per-shape weight (100\\u2013900). Overrides `bold` when set."})),italic:n.Optional(n.Boolean({description:"Italic shape text"})),align:n.Optional(Ba),valign:n.Optional(wi),rotate:n.Optional(n.Number({description:"Rotation angle in degrees"})),angleRange:n.Optional(n.Array(n.Number(),{minItems:2,maxItems:2,description:"Shape arc [start, end] angles in degrees (arc/pie/blockArc/chord shapes)"})),flipH:n.Optional(n.Boolean({description:"Flip shape horizontally"})),flipV:n.Optional(n.Boolean({description:"Flip shape vertically"})),shadow:n.Optional(Zi),rectRadius:n.Optional(n.Number({minimum:0,description:"Corner radius for roundRect shape in inches"})),grid:n.Optional(rn),style:n.Optional(Ma)},{description:"Shape component props",additionalProperties:!1}),fv=n.Union([n.String({description:"Simple text cell"}),n.Object({text:n.String({description:"Cell text content"}),color:n.Optional(n.String({description:"Text color (hex without #)"})),fill:n.Optional(n.String({description:"Cell background color (hex without #)"})),fontSize:n.Optional(n.Number({description:"Font size in points"})),fontFace:n.Optional(n.String({description:"Font family"})),bold:n.Optional(n.Boolean({description:"Bold text"})),fontWeight:n.Optional(n.Integer({minimum:100,maximum:900,description:"Per-cell weight (100\\u2013900). Overrides `bold` when set."})),italic:n.Optional(n.Boolean({description:"Italic text"})),align:n.Optional(Ba),valign:n.Optional(wi),colspan:n.Optional(n.Number({minimum:1,description:"Column span"})),rowspan:n.Optional(n.Number({minimum:1,description:"Row span"})),margin:n.Optional(n.Union([n.Number({description:"Margin in points (all sides)"}),n.Array(n.Number(),{minItems:4,maxItems:4})]))},{additionalProperties:!1})]),qa=n.Object({rows:n.Array(n.Array(fv,{description:"Row of cells"}),{description:"Table rows (array of arrays)",minItems:1}),x:n.Optional(n.Union([n.Number({description:"X position in inches"}),n.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:"X as percentage"})])),y:n.Optional(n.Union([n.Number({description:"Y position in inches"}),n.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:"Y as percentage"})])),w:n.Optional(n.Union([n.Number({description:"Width in inches"}),n.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:"Width as percentage"})])),h:n.Optional(n.Union([n.Number({description:"Height in inches"}),n.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:"Height as percentage"})])),colW:n.Optional(n.Union([n.Number({description:"Uniform column width in inches"}),n.Array(n.Number(),{description:"Individual column widths in inches"})])),rowH:n.Optional(n.Union([n.Number({description:"Uniform row height in inches"}),n.Array(n.Number(),{description:"Individual row heights in inches"})])),border:n.Optional(n.Object({type:n.Optional(n.Union([n.Literal("solid"),n.Literal("dash"),n.Literal("dot"),n.Literal("none")])),pt:n.Optional(n.Number({minimum:0,description:"Border width in points"})),color:n.Optional(n.String({description:"Border color (hex without #)"}))},{additionalProperties:!1})),fill:n.Optional(n.String({description:"Table background color (hex without #)"})),fontSize:n.Optional(n.Number({minimum:1,description:"Default font size for all cells"})),fontFace:n.Optional(n.String({description:"Default font family for all cells"})),fontWeight:n.Optional(n.Integer({minimum:100,maximum:900,description:"Default weight for all cells (100\\u2013900). Same sub-family aliasing as the per-cell `fontWeight`; a cell that sets its own `fontWeight` or `bold` opts out."})),color:n.Optional(n.String({description:"Default text color for all cells (hex without #)"})),align:n.Optional(Ba),valign:n.Optional(wi),headerRow:n.Optional(n.Boolean({description:"Style the first row as a header \\u2014 bold, on the theme\'s secondary background. Cells that state their own `bold`, `fill` or `color` keep it. Unlike the DOCX table, which declares its headers structurally, a PPTX table is rows of cells and the first one is a header only because you say so."})),autoPage:n.Optional(n.Boolean({description:"Auto-paginate table across multiple slides when content overflows"})),autoPageRepeatHeader:n.Optional(n.Boolean({description:"Repeat first row as header on each auto-paged slide"})),margin:n.Optional(n.Union([n.Number({description:"Cell margin in points (all sides)"}),n.Array(n.Number(),{minItems:4,maxItems:4})])),borderRadius:n.Optional(n.Number({minimum:0,description:"Rounded corner radius in inches. Renders a roundRect shape behind the table."})),grid:n.Optional(rn)},{description:"PPTX table component props",additionalProperties:!1}),Wa=n.Object({options:n.Intersect([n.Record(n.String(),n.Unknown()),n.Object({chart:n.Object({width:n.Number(),height:n.Number()})})]),scale:n.Optional(n.Number()),serverUrl:n.Optional(n.String({description:"Highcharts Export Server URL (default: http://localhost:7801)"})),resources:n.Optional(n.Object({css:n.Optional(n.String()),js:n.Optional(n.String()),files:n.Optional(n.Array(n.String()))})),x:n.Optional(n.Union([n.Number({description:"X position in inches"}),n.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:"X as percentage"})])),y:n.Optional(n.Union([n.Number({description:"Y position in inches"}),n.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:"Y as percentage"})])),w:n.Optional(n.Union([n.Number({description:"Width in inches"}),n.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:"Width as percentage"})])),h:n.Optional(n.Union([n.Number({description:"Height in inches"}),n.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:"Height as percentage"})])),grid:n.Optional(rn)},{description:"PPTX Highcharts component props",additionalProperties:!1}),Ic=(e,t)=>n.Union([n.Number({description:e}),n.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:t})]),hv=n.Union([n.Literal("area"),n.Literal("bar"),n.Literal("bar3D"),n.Literal("bubble"),n.Literal("doughnut"),n.Literal("line"),n.Literal("pie"),n.Literal("radar"),n.Literal("scatter")],{description:"Chart type"}),gv=n.Object({name:n.Optional(n.String({description:"Series name"})),labels:n.Optional(n.Array(n.String(),{description:"Category labels. Needed on every series, not just the first, and the same length as `values`; a series without both `labels` and `values` drops the whole chart."})),values:n.Optional(n.Array(n.Number(),{description:"Data values, one per label. Needed on every series \\u2014 see `labels`."})),sizes:n.Optional(n.Array(n.Number(),{description:"Bubble sizes (bubble charts only)"}))},{additionalProperties:!1}),vg=n.Object({style:n.Optional(n.Union([n.Literal("solid"),n.Literal("dash"),n.Literal("dot"),n.Literal("none")],{description:"Grid line style"})),size:n.Optional(n.Number({minimum:0,description:"Grid line width (points)"})),color:n.Optional(n.String({description:"Grid line color (hex or semantic)"}))},{additionalProperties:!1,description:"Axis grid line styling"}),Ha=n.Object({type:hv,data:n.Array(gv,{description:"Chart data series",minItems:1}),showLegend:n.Optional(n.Boolean({description:"Show chart legend"})),showTitle:n.Optional(n.Boolean({description:"Show chart title"})),showValue:n.Optional(n.Boolean({description:"Show data values"})),showPercent:n.Optional(n.Boolean({description:"Show percentages (pie/doughnut)"})),showLabel:n.Optional(n.Boolean({description:"Show category labels on data points"})),showSerName:n.Optional(n.Boolean({description:"Show series name on data points"})),title:n.Optional(n.String({description:"Chart title text"})),titleFontSize:n.Optional(n.Number({description:"Title font size (points)"})),titleColor:n.Optional(n.String({description:"Title color (hex or semantic)"})),titleFontFace:n.Optional(n.String({description:"Title font face"})),titleFontWeight:n.Optional(n.Integer({minimum:100,maximum:900,description:"Title weight (100\\u2013900). Rendered as a sub-family alias \\u2014 see `dataLabelFontWeight`."})),chartColors:n.Optional(n.Array(n.String(),{description:"Series colors (hex or semantic theme names). Defaults to theme palette."})),dataBorder:n.Optional(n.Object({pt:n.Number({minimum:0,description:"Border width (points)"}),color:n.String({description:"Border color (hex or semantic)"})},{additionalProperties:!1,description:"Outline on data elements (bars, slices, areas)"})),legendPos:n.Optional(n.Union([n.Literal("b"),n.Literal("l"),n.Literal("r"),n.Literal("t"),n.Literal("tr")],{description:"Legend position"})),legendFontSize:n.Optional(n.Number({description:"Legend font size"})),legendFontFace:n.Optional(n.String({description:"Legend font face"})),legendFontWeight:n.Optional(n.Integer({minimum:100,maximum:900,description:"Legend weight (100\\u2013900). Rendered as a sub-family alias \\u2014 see `dataLabelFontWeight`. PowerPoint gives the legend no bold toggle, so 400 and 700 both render Regular (700 warns)."})),legendColor:n.Optional(n.String({description:"Legend text color"})),catAxisTitle:n.Optional(n.String({description:"Category axis title"})),catAxisHidden:n.Optional(n.Boolean({description:"Hide category axis"})),catAxisLabelRotate:n.Optional(n.Number({description:"Category axis label rotation (degrees)"})),catAxisLabelFontSize:n.Optional(n.Number({description:"Category axis label font size"})),catAxisLabelColor:n.Optional(n.String({description:"Category axis label color (hex or semantic)"})),catAxisLabelFontFace:n.Optional(n.String({description:"Category axis label font face"})),catAxisLabelFontWeight:n.Optional(n.Integer({minimum:100,maximum:900,description:"Category axis label weight (100\\u2013900). Rendered as a sub-family alias \\u2014 see `dataLabelFontWeight`."})),catGridLine:n.Optional(vg),valAxisTitle:n.Optional(n.String({description:"Value axis title"})),valAxisHidden:n.Optional(n.Boolean({description:"Hide value axis"})),valAxisMinVal:n.Optional(n.Number({description:"Value axis minimum"})),valAxisMaxVal:n.Optional(n.Number({description:"Value axis maximum"})),valAxisLabelFormatCode:n.Optional(n.String({description:\'Value axis label format (e.g. "$0.00", "#%")\'})),valAxisMajorUnit:n.Optional(n.Number({description:"Value axis major unit / tick interval"})),valAxisLabelColor:n.Optional(n.String({description:"Value axis label color (hex or semantic)"})),valAxisLabelFontFace:n.Optional(n.String({description:"Value axis label font face"})),valAxisLabelFontWeight:n.Optional(n.Integer({minimum:100,maximum:900,description:"Value axis label weight (100\\u2013900). Rendered as a sub-family alias \\u2014 see `dataLabelFontWeight`."})),valAxisLabelFontSize:n.Optional(n.Number({description:"Value axis label font size"})),valGridLine:n.Optional(vg),catAxisLineShow:n.Optional(n.Boolean({description:"Show the category axis line"})),valAxisLineShow:n.Optional(n.Boolean({description:"Show the value axis line"})),barDir:n.Optional(n.Union([n.Literal("bar"),n.Literal("col")],{description:\'Bar direction: "bar" (horizontal) or "col" (vertical, default)\'})),barGrouping:n.Optional(n.Union([n.Literal("clustered"),n.Literal("stacked"),n.Literal("percentStacked")],{description:"Bar grouping style"})),barGapWidthPct:n.Optional(n.Number({minimum:0,maximum:500,description:"Bar gap width (0-500%)"})),barOverlapPct:n.Optional(n.Number({minimum:-100,maximum:100,description:"Overlap between series bars (-100 to 100%). 100 = fully overlapped, negative = gap."})),lineSmooth:n.Optional(n.Boolean({description:"Smooth lines"})),lineDataSymbol:n.Optional(n.Union([n.Literal("circle"),n.Literal("dash"),n.Literal("diamond"),n.Literal("dot"),n.Literal("none"),n.Literal("square"),n.Literal("triangle")],{description:"Line data point marker symbol"})),lineSize:n.Optional(n.Number({description:"Line width (points)"})),lineDataSymbolSize:n.Optional(n.Number({minimum:2,maximum:72,description:"Line data point marker size (points)"})),firstSliceAng:n.Optional(n.Number({minimum:0,maximum:359,description:"Angle of first slice (degrees)"})),holeSize:n.Optional(n.Number({minimum:10,maximum:90,description:"Doughnut hole size (%)"})),radarStyle:n.Optional(n.Union([n.Literal("standard"),n.Literal("marker"),n.Literal("filled")],{description:"Radar chart style"})),dataLabelColor:n.Optional(n.String({description:"Data label text color"})),dataLabelFontSize:n.Optional(n.Number({description:"Data label font size"})),dataLabelFontFace:n.Optional(n.String({description:"Data label font face"})),dataLabelFontWeight:n.Optional(n.Integer({minimum:100,maximum:900,description:\'Data label weight (100\\u2013900); overrides `dataLabelFontBold`. PowerPoint chart labels carry no numeric weight, so a non-RIBBI weight renders by rewriting the font face to the matching sub-family ("Inter" at 300 \\u2192 "Inter Light") \\u2014 400 and 700 stay on the family and use the bold toggle. Falls back to the theme body font when the sibling font face is unset.\'})),dataLabelFontBold:n.Optional(n.Boolean({description:"Bold data labels"})),dataLabelPosition:n.Optional(n.Union([n.Literal("b"),n.Literal("bestFit"),n.Literal("ctr"),n.Literal("l"),n.Literal("r"),n.Literal("t"),n.Literal("inEnd"),n.Literal("outEnd")],{description:"Data label position"})),x:n.Optional(Ic("X position in inches","X as percentage")),y:n.Optional(Ic("Y position in inches","Y as percentage")),w:n.Optional(Ic("Width in inches","Width as percentage")),h:n.Optional(Ic("Height in inches","Height as percentage")),grid:n.Optional(rn)},{description:"Native PowerPoint chart component props",additionalProperties:!1});function Ci(e){if(e.propsRequired!==void 0)return e.propsRequired;let t=e.propsSchema;return t.type!=="object"||(t.required?.length??0)>0}var tn=[{name:"text",propsSchema:Va,hasChildren:!1,category:"content",propsRequired:!0,description:"Text element - displays text with formatting, positioning and styling options. Prefer the named `style` values (title, heading1, body\\u2026) and theme color tokens over raw fontSize/hex \\u2014 a theme swap must restyle the deck without editing every node."},{name:"image",propsSchema:Ka,hasChildren:!1,category:"content",propsRequired:!0,description:"Image element - displays images from file path, URL, or base64 data."},{name:"shape",propsSchema:Ga,hasChildren:!1,category:"content",description:"Shape element - draws geometric shapes with optional text, fill, and line styling."},{name:"table",propsSchema:qa,hasChildren:!1,category:"content",description:"Table element, declared ROW-MAJOR: `props.rows[][]`, an array of rows, each an array of cells, with no structural header \\u2014 `headerRow: true` styles the first row as one. Note the DOCX `table` is the other way round \\u2014 columns each carrying their own header and cells \\u2014 so a table cannot be moved between the formats unchanged."},{name:"highcharts",propsSchema:Wa,hasChildren:!1,category:"content",description:"Highcharts element - renders charts via Highcharts Export Server."},{name:"chart",propsSchema:Ha,hasChildren:!1,category:"content",description:"Native PowerPoint chart - editable, scalable, no external server needed. Always set series colors (theme-derived, one accent per series) \\u2014 the auto-palette reads as default Office."}];function Qi(e){return n.Object({name:n.Literal(e.name),id:n.Optional(n.String()),enabled:n.Optional(n.Boolean({default:!0,description:"When false, this component is filtered out and not rendered. Defaults to true."})),props:Ci(e)?e.propsSchema:n.Optional(e.propsSchema)},{additionalProperties:!1,description:e.description})}var za=n.Union([Qi(tn[0]),Qi(tn[1]),Qi(tn[2]),Qi(tn[3]),Qi(tn[4]),Qi(tn[5])],{$id:"PptxSlideContent",discriminator:{propertyName:"name"},description:"A single PPTX slide content element (text, image, shape, table, highcharts, or chart)."});var Vn=n.String({pattern:"^(#?[0-9A-Fa-f]{6}|[a-zA-Z][a-zA-Z0-9]*)$",description:\'Hex colour ("#0F172A" or "0F172A") or a docx theme colour name (e.g. "primary")\'}),yv="^-?\\\\d+(\\\\.\\\\d+)?%$",bv="^\\\\d+(\\\\.\\\\d+)?%$",Ng=n.Union([n.Number({description:"Inches from the canvas origin"}),n.String({pattern:yv,description:\'Percentage of the canvas extent on this axis, e.g. "25%"\'})],{description:"Position in inches (number) or as a canvas percentage"}),Rg=n.Union([n.Number({minimum:0,description:"Size in inches"}),n.String({pattern:bv,description:\'Percentage of the canvas extent on this axis, e.g. "50%"\'})],{description:"Size in inches (number) or as a canvas percentage"}),$m={x:n.Optional(Ng),y:n.Optional(Ng),w:n.Optional(Rg),h:n.Optional(Rg),rotate:n.Optional(n.Number({description:"Clockwise rotation in degrees"}))},kg=n.Union([n.Boolean({description:"Single underline in the text colour"}),n.Object({style:n.Optional(n.Union([n.Literal("sng"),n.Literal("dbl"),n.Literal("dash"),n.Literal("dotted")],{description:\'Underline style (default "sng")\'})),color:n.Optional(Vn)},{additionalProperties:!1})],{description:"Underline: true for a single line, or a style/colour object"}),$c={fontFace:n.Optional(n.String({description:"Font family name"})),fontSize:n.Optional(n.Number({minimum:1,description:"Font size in points"})),bold:n.Optional(n.Boolean()),italic:n.Optional(n.Boolean())},Ov=n.Object({text:n.String({description:"Run text"}),color:n.Optional(Vn),...$c,underline:n.Optional(kg),strike:n.Optional(n.Boolean({description:"Strikethrough"})),breakLine:n.Optional(n.Boolean({description:"Start a new line after this run"}))},{additionalProperties:!1,description:"A formatted run inside a native visual text element"}),xv=n.Object({text:n.String({description:"Segment text"}),color:n.Optional(Vn),...$c,breakLine:n.Optional(n.Boolean({description:"Start a new line after this segment"}))},{additionalProperties:!1,description:"A formatted segment of a native visual shape\\u2019s text"}),Fg=n.Object({color:n.Optional(Vn),transparency:n.Optional(n.Number({minimum:0,maximum:100,description:"Fill transparency, 0 (opaque) to 100 (invisible)"}))},{additionalProperties:!1,description:"Solid fill. Omit the whole property for no fill; gradients and patterns are raster-only."}),Sv=n.Object({color:n.Optional(Vn),width:n.Optional(n.Number({minimum:0,description:"Outline width in points"})),dashType:n.Optional(n.Union([n.Literal("solid"),n.Literal("dash"),n.Literal("dot"),n.Literal("dashDot")],{description:\'Outline dash pattern (default "solid")\'}))},{additionalProperties:!1,description:"Shape outline"}),jg=n.Union([n.Literal("left"),n.Literal("center"),n.Literal("right"),n.Literal("justify")],{description:"Horizontal text alignment"}),Ug=n.Union([n.Literal("top"),n.Literal("middle"),n.Literal("bottom")],{description:"Vertical text anchoring inside the box"}),_g=n.Union([n.Number({minimum:0,description:"Inset on every side, in points"}),n.Array(n.Number({minimum:0}),{minItems:4,maxItems:4,description:"Insets as [top, right, bottom, left], in points"})],{description:"Text insets in points"}),vm=n.Object({text:n.Optional(n.String({description:"Plain text content"})),runs:n.Optional(n.Array(Ov,{minItems:1,description:\'Formatted runs, as an alternative to "text"\'})),...$m,color:n.Optional(Vn),...$c,underline:n.Optional(kg),strike:n.Optional(n.Boolean({description:"Strikethrough"})),align:n.Optional(jg),valign:n.Optional(Ug),margin:n.Optional(_g),fill:n.Optional(Fg)},{additionalProperties:!1,description:"Native visual text element \\u2014 becomes a Word text box (wps:wsp) inside the drawing group"}),Lm=n.Object({type:eo,...$m,fill:n.Optional(Fg),line:n.Optional(Sv),text:n.Optional(n.Union([n.String(),n.Array(xv,{minItems:1})],{description:"Text drawn inside the shape"})),...$c,fontColor:n.Optional(Vn),align:n.Optional(jg),valign:n.Optional(Ug),margin:n.Optional(_g),flipH:n.Optional(n.Boolean({description:"Mirror horizontally"})),flipV:n.Optional(n.Boolean({description:"Mirror vertically"}))},{additionalProperties:!1,description:"Native visual shape element \\u2014 becomes a preset-geometry shape (wps:wsp) inside the drawing group"}),Nm=n.Object({path:n.Optional(n.String({description:"File path or http(s) URL"})),base64:n.Optional(n.String({description:"Base64 data URI"})),svg:n.Optional(n.String({description:"Raw SVG markup"})),...$m,sizing:n.Optional(n.Object({type:n.Union([n.Literal("contain"),n.Literal("cover"),n.Literal("crop")],{description:"How the image fills its box"}),w:n.Optional(n.Number({minimum:0,description:\'Box width in inches; overrides the element\\u2019s own "w"\'})),h:n.Optional(n.Number({minimum:0,description:\'Box height in inches; overrides the element\\u2019s own "h"\'}))},{additionalProperties:!1,description:\'How the image fills its box. "w"/"h" state the box itself, taking precedence over the element\\u2019s "w"/"h", as they do in raster mode.\'})),alt:n.Optional(n.String({description:"Alternative text for accessibility"}))},{additionalProperties:!1,description:"Native visual image element \\u2014 becomes a native picture inside the drawing group"}),Dg=["text","shape","image"];function Tm(e,t,r){return n.Object({name:n.Literal(e),id:n.Optional(n.String()),enabled:n.Optional(n.Boolean({default:!0,description:"When false, this element is filtered out and not drawn. Defaults to true."})),props:t},{additionalProperties:!1,description:r})}var Rm=n.Union([Tm("text",vm,"Text element - a native Word text box drawn on the visual canvas."),Tm("shape",Lm,"Shape element - a native preset-geometry shape, optionally holding text."),Tm("image",Nm,"Image element - a native picture; an SVG stays vector.")],{$id:"DocxNativeVisualContent",discriminator:{propertyName:"name"},description:"A single native visual element (text, shape, or image)."}),km=n.Object({width:n.Number({minimum:.1,description:"Canvas width in inches"}),height:n.Number({minimum:.1,description:"Canvas height in inches"}),background:n.Optional(n.Object({color:n.Optional(Vn),image:n.Optional(n.Object({path:n.Optional(n.String()),base64:n.Optional(n.String())},{additionalProperties:!1}))},{additionalProperties:!1,description:"Canvas background. A colour becomes the bottom-most rectangle; an image becomes the bottom-most picture."}))},{additionalProperties:!1,description:"Drawing canvas for a native visual"}),Fm=n.Object({color:n.Optional(n.String({description:\'Background color (hex like "#FFFFFF" or a theme color name)\'})),image:n.Optional(n.Object({path:n.Optional(n.String()),base64:n.Optional(n.String())},{additionalProperties:!1}))},{additionalProperties:!1}),jm=n.Object({width:n.Number({minimum:.1,description:"Canvas width in inches (pptx slideWidth)"}),height:n.Number({minimum:.1,description:"Canvas height in inches (pptx slideHeight)"}),theme:n.Optional(n.String({description:"pptx theme name applied to the slide"})),background:n.Optional(Fm)},{description:"pptx canvas definition for the visual",additionalProperties:!1}),Mg={width:n.Optional(n.Union([n.Number({minimum:1,description:"Rendered width in pixels"}),n.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:\'Rendered width as percentage (e.g. "90%")\'})],{description:"Rendered width in the document, in pixels (number) or percentage string. Defaults to the canvas physical size."})),height:n.Optional(n.Union([n.Number({minimum:1,description:"Rendered height in pixels"}),n.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:\'Rendered height as percentage (e.g. "90%")\'})])),alignment:n.Optional(en),caption:n.Optional(n.String({description:"Caption (supports rich text with **bold**, *italic*, ***both***)"})),alt:n.Optional(n.String({description:"Alternative text for accessibility"})),spacing:n.Optional(Ct),floating:n.Optional(Ii),keepNext:n.Optional(n.Boolean({description:"Keep paragraph with next paragraph on same page"})),keepLines:n.Optional(n.Boolean({description:"Keep all lines of paragraph together on same page"}))},Um=n.Object({renderMode:n.Optional(n.Literal("raster",{description:"Render as a rasterized pptx slide (the default when omitted)."})),canvas:jm,elements:n.Optional(n.Array(za,{description:"pptx slide content elements (text, image, shape, table, highcharts, chart), positioned with x/y/w/h in inches"})),dpi:n.Optional(n.Number({minimum:Ra,maximum:ka,default:Na,description:`Raster resolution in DPI (default ${Na}, range ${Ra}-${ka}). Higher = sharper + larger.`})),serverUrl:n.Optional(n.String({description:"Rasterization service URL override (default from services.pptx)"})),...Mg},{$id:"DocxVisualRasterProps",description:"Visual component props (pptx-rendered graphic)",additionalProperties:!1}),_m=n.Object({renderMode:n.Literal("native",{description:\'Draw natively as a Word DrawingML group. Requires the "office-open" renderer.\'}),canvas:km,elements:n.Optional(n.Array(Rm,{description:"Native drawing elements (text, shape, image), positioned with x/y/w/h in inches or canvas percentages"})),...Mg},{$id:"DocxVisualNativeProps",description:\'Visual component props (native Word drawing group; requires renderer "office-open")\',additionalProperties:!1}),vc=n.Union([Um,_m],{description:"Visual component props \\u2014 rasterized pptx slide (default) or a native Word drawing group"}),Lc="native";function Bg(e){return!!e&&e.renderMode===Lc}var Tr=["docxjs","office-open"],Ja="docxjs",Iv=new Set(["text","shape","image"]);function nn(e){return`ComponentDefinition_${e}`}function Nc(e){return e?`FlowContent_${e}`:"FlowContent"}function Rc(e,t,r){let i=Am(t);return Em(i,nn(r)),e==="visual"&&r!=="office-open"?Cv(i)??i:(r==="office-open"&&Pm(i),i)}function kc(e){if(!e||typeof e!="object"||Array.isArray(e))return[];let t=e,r=t.renderer??Ja;if(!Tr.includes(r))return[{path:"/renderer",message:`Invalid renderer "${String(r)}". Expected "docxjs" or "office-open".`,code:"invalid_value"}];let i=[],o=r==="office-open",a=(s,c)=>{if(Array.isArray(s)){s.forEach((p,m)=>a(p,`${c}/${m}`));return}if(!s||typeof s!="object")return;let l=s;if(o){let p=l.comment;if(p&&typeof p=="object"&&!Array.isArray(p)){let m=p;for(let u of["replies","resolved"])m[u]!==void 0&&i.push({path:`${c}/comment/${u}`,message:\'The "office-open" renderer does not support comment threads.\',code:"unsupported_renderer_feature"})}}l.name==="visual"&&wv(l,`${c}`,o,i),l.name==="chart"&&!o&&i.push({path:`${c}/name`,message:`Only the "office-open" renderer draws a native chart. Set the document\'s "renderer" to "office-open", or use "highcharts" to render one as an image.`,code:"unsupported_renderer_feature"});for(let[p,m]of Object.entries(l))p!=="renderer"&&a(m,`${c}/${p}`)};return a(t,""),i}function wv(e,t,r,i){let o=e.props;if(!o||typeof o!="object"||Array.isArray(o))return;let a=o;if(a.renderMode!==Lc)return;if(!r){i.push({path:`${t}/props/renderMode`,message:`Only the "office-open" renderer draws a native visual. Set the document\'s "renderer" to "office-open", or drop "renderMode" to rasterize.`,code:"unsupported_renderer_feature"});return}let s=a.elements;Array.isArray(s)&&s.forEach((c,l)=>{if(!c||typeof c!="object"||Array.isArray(c))return;let p=c.name;typeof p!="string"||Iv.has(p)||i.push({path:`${t}/props/elements/${l}/name`,message:`A native visual cannot draw "${p}". Native mode holds "text", "shape" and "image"; use renderMode "raster" for anything else.`,code:"unsupported_renderer_feature"})})}function Cv(e){let t=e.anyOf;return Array.isArray(t)&&t.length>0?t[0]:void 0}function Pm(e){if(Array.isArray(e)){e.forEach(Pm);return}if(!e||typeof e!="object")return;let t=e,r=t.properties;if(r?.text&&r?.author&&(r.replies||r.resolved)&&typeof t.description=="string"&&t.description.includes("Word review comment")){delete r.replies,delete r.resolved;let i=t.required;i&&(t.required=i.filter(o=>o!=="replies"&&o!=="resolved"))}for(let i of Reflect.ownKeys(t))Pm(t[i])}function Em(e,t){if(Array.isArray(e)){e.forEach(i=>Em(i,t));return}if(!e||typeof e!="object")return;let r=e;r.type==="array"&&r.items&&typeof r.items=="object"&&Object.keys(r.items).length===0&&r.items[g]==="Any"&&(r.items={$ref:t});for(let i of Reflect.ownKeys(r))Em(r[i],t)}function Am(e){if(Array.isArray(e))return e.map(Am);if(!e||typeof e!="object")return e;let t=Object.create(Object.getPrototypeOf(e));for(let r of Reflect.ownKeys(e))t[r]=Am(e[r]);return t}function Vg(e){let t=e.definitions??{},r=new Map;for(let o of Tr){let a=nn(o);t[a]&&r.set(o,Fa(t,a,["docx","section"]))}let i=o=>{if(!o||typeof o!="object")return;if(Array.isArray(o)){o.forEach(i);return}let a=o;if(a.properties?.name?.const==="docx"){let s=r.get(a.properties.renderer?.const),c=a.properties.props?.properties?.blocks?.patternProperties;if(s&&c)for(let l of Object.values(c)){l.properties.body.items=s;for(let p of["header","footer"])l.properties.section.properties[p].items=s}}Object.values(a).forEach(i)};i(e)}function Kg(e){let t=e.definitions??{};return Tr.filter(r=>t[nn(r)]).map(r=>{let i=nn(r);return{name:i,componentRef:{$ref:`#/definitions/${i}`}}})}var Vm=n.Object({type:n.Union([n.Literal("equal"),n.Literal("insert"),n.Literal("delete")],{description:"Segment kind: \'equal\' renders as normal text, \'insert\' as a tracked insertion, \'delete\' as a tracked deletion"}),text:n.String({description:"Literal text of this segment (rendered without markdown)"})},{description:"A contiguous run of text sharing one revision state",additionalProperties:!1}),ro=n.Object({author:n.Optional(n.String({description:\'Revision author shown in Word (default: "json-to-office")\'})),date:n.Optional(n.String({format:"date-time",description:"Revision timestamp (ISO 8601). Defaults to the Unix epoch for deterministic output"})),segments:n.Array(Vm,{minItems:1,description:"Ordered text segments; concatenating equal+insert segments yields the new text, equal+delete the old text"})},{description:"Tracked-change data: renders the component text as native Word revisions (accept/reject in Word)",additionalProperties:!1}),Km=n.Object({type:n.Union([n.Literal("insert"),n.Literal("delete")],{description:"Whether the element was inserted or deleted"}),author:n.Optional(n.String({description:\'Revision author shown in Word (default: "json-to-office")\'})),date:n.Optional(n.String({format:"date-time",description:"Revision timestamp (ISO 8601). Defaults to the Unix epoch for deterministic output"}))},{description:"Structural tracked change: the element itself was inserted or deleted",additionalProperties:!1}),qg={text:n.String({minLength:1,description:"Comment body. Newlines split it into separate paragraphs in the comment pane."}),author:n.Optional(n.String({description:\'Comment author shown in Word (default: "json-to-office")\'})),initials:n.Optional(n.String({description:"Author initials shown on the comment bubble (derived from the author when omitted)"})),date:n.Optional(n.String({format:"date-time",description:"Comment timestamp (ISO 8601). Defaults to the Unix epoch for deterministic output"}))},Gm=n.Object(qg,{description:"A reply within a comment thread",additionalProperties:!1}),no=n.Object({...qg,replies:n.Optional(n.Array(Gm,{minItems:1,description:"Replies, in order. They anchor to the same text and Word shows them as one thread."})),resolved:n.Optional(n.Boolean({description:"Mark the whole thread resolved (w15:done). Word writes the thread state only when the document contains at least one reply."}))},{description:"A Word review comment anchored to this component\'s text",additionalProperties:!1}),on=n.Object({text:n.String({description:"Heading text (required)"}),level:n.Optional(xc),font:n.Optional(n.Partial(Zr)),language:n.Optional(xm),noProof:n.Optional(Sm),noProofWords:n.Optional(ja),alignment:n.Optional(Ua),spacing:n.Optional(Ct),indent:n.Optional(Da),lineSpacing:n.Optional(n.Union([n.Number({minimum:0}),_a],{description:"A bare number is a multiple of single spacing. Takes precedence over `font.lineSpacing`. An `exactly` box smaller than the heading it holds is reported as W_QUALITY_LINE_BOX_COLLAPSE."})),pageBreak:n.Optional(n.Boolean({description:"Insert page break before heading"})),columnBreak:n.Optional(n.Boolean({description:"Insert column break before heading"})),numbering:n.Optional(n.Boolean({description:"Number this heading with the document\'s multilevel heading numbering (1., 1.1., 1.1.1.). Set globally via componentDefaults.heading.numbering; false opts a single heading out."})),keepNext:n.Optional(n.Boolean({description:"Keep heading with next paragraph on same page"})),keepLines:n.Optional(n.Boolean({description:"Keep all lines of heading together on same page"})),revision:n.Optional(ro),comment:n.Optional(no)},{description:"Heading component props",additionalProperties:!1}),Fc=n.Object({id:n.String({minLength:1,pattern:"^[^\\\\]\\\\s]+$",description:\'Marker id referenced from the text as `[^id]`. Any characters except whitespace and "]".\'}),text:n.String({minLength:1,description:"Note body. Newlines split it into separate paragraphs where the note is placed."})},{description:"A note body bound to an inline `[^id]` marker",additionalProperties:!1}),qm=n.Array(Fc,{description:"Footnote bodies for `[^id]` markers in this paragraph, placed at the foot of the page. An unreferenced body is not emitted.",minItems:1}),Wm=n.Array(Fc,{description:"Endnote bodies for `[^id]` markers in this paragraph, collected at the end of the document. An unreferenced body is not emitted.",minItems:1}),Tv=n.Union([n.Literal("around"),n.Literal("none"),n.Literal("notBeside"),n.Literal("through"),n.Literal("tight"),n.Literal("auto")],{description:"Frame text wrapping type"}),Gg=n.Union([n.Literal("margin"),n.Literal("page"),n.Literal("text")],{description:"Frame anchor type"}),Pv=n.Union([n.Literal("left"),n.Literal("center"),n.Literal("right"),n.Literal("inside"),n.Literal("outside")],{description:"Frame horizontal alignment"}),Ev=n.Union([n.Literal("top"),n.Literal("center"),n.Literal("bottom"),n.Literal("inside"),n.Literal("outside")],{description:"Frame vertical alignment"}),Av=n.Object({horizontalPosition:n.Optional(n.Object({relative:n.Optional(Gg),align:n.Optional(Pv),offset:n.Optional(n.Union([n.Number({description:"Horizontal offset in twips (1/20 of a point)"}),n.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:\'Horizontal offset as percentage (e.g., "50%") relative to page or margin width\'})]))},{description:"Horizontal positioning (use either align or offset, not both)",additionalProperties:!1})),verticalPosition:n.Optional(n.Object({relative:n.Optional(Gg),align:n.Optional(Ev),offset:n.Optional(n.Union([n.Number({description:"Vertical offset in twips (1/20 of a point)"}),n.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:\'Vertical offset as percentage (e.g., "50%") relative to page or margin height\'})]))},{description:"Vertical positioning (use either align or offset, not both)",additionalProperties:!1})),wrap:n.Optional(n.Object({type:Tv},{description:"Text wrapping configuration",additionalProperties:!1})),lockAnchor:n.Optional(n.Boolean({description:"Lock the anchor position"})),width:n.Optional(n.Number({minimum:1,description:"Frame width in twips (DXA units)"})),height:n.Optional(n.Number({minimum:1,description:"Frame height in twips (DXA units)"}))},{description:"Floating text frame properties",additionalProperties:!1}),$v=n.Union([n.Literal("left"),n.Literal("center"),n.Literal("right"),n.Literal("justify")],{description:"Paragraph text alignment"}),an=n.Object({text:n.String({description:"Text content (required)"}),font:n.Optional(n.Partial(Zr)),themeStyle:n.Optional(n.String()),language:n.Optional(xm),noProof:n.Optional(Sm),noProofWords:n.Optional(ja),boldColor:n.Optional(Q),spacing:n.Optional(Ct),alignment:n.Optional($v),indent:n.Optional(Da),tabStops:n.Optional(Sc),pageBreak:n.Optional(n.Boolean({description:"Insert page break before paragraph"})),columnBreak:n.Optional(n.Boolean({description:"Insert column break before paragraph"})),floating:n.Optional(Av),keepNext:n.Optional(n.Boolean({description:"Keep paragraph with next paragraph on same page"})),keepLines:n.Optional(n.Boolean({description:"Keep all lines of paragraph together on same page"})),id:n.Optional(n.String({description:"Unique identifier for internal linking (bookmark anchor)"})),revision:n.Optional(ro),comment:n.Optional(no),footnotes:n.Optional(qm),endnotes:n.Optional(Wm)},{description:"Paragraph component props (font nested for theme consistency; no flat font properties)",additionalProperties:!1}),sn=n.Object({path:n.Optional(n.String({description:"Image source URL or file path (mutually exclusive with base64 and svg)"})),base64:n.Optional(n.String({description:\'Base64-encoded image data in data URI format (e.g., "data:image/png;base64,iVBORw0KGgo...") (mutually exclusive with path and svg)\'})),svg:n.Optional(n.String({description:\'Raw inline SVG markup, e.g. "<svg xmlns=\\\\"http://www.w3.org/2000/svg\\\\" viewBox=\\\\"0 0 24 24\\\\">...</svg>" (mutually exclusive with path and base64). Renders as a vector image (Word 2016+); intrinsic size taken from the SVG viewBox/width/height when width/height omitted.\'})),alt:n.Optional(n.String({description:"Alternative text for accessibility"})),width:n.Optional(n.Union([n.Number({minimum:1,description:"Image width in pixels"}),n.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:\'Image width as percentage (e.g., "90%") relative to widthRelativeTo (defaults to content width)\'})],{description:\'Image width in pixels (number) or as percentage string (e.g., "90%")\',default:"100%"})),height:n.Optional(n.Union([n.Number({minimum:1,description:"Image height in pixels"}),n.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:\'Image height as percentage (e.g., "90%") relative to heightRelativeTo (defaults to content height)\'})],{description:\'Image height in pixels (number) or as percentage string (e.g., "90%")\'})),widthRelativeTo:n.Optional(n.Union([n.Literal("content"),n.Literal("page")],{description:"Reference for width percentages: content (page width minus margins) or page (full page width)",default:"content"})),heightRelativeTo:n.Optional(n.Union([n.Literal("content"),n.Literal("page")],{description:"Reference for height percentages: content (page height minus margins) or page (full page height)",default:"content"})),alignment:n.Optional(en),caption:n.Optional(n.String({description:"Image caption (supports rich text with **bold**, *italic*, ***both***)"})),spacing:n.Optional(Ct),floating:n.Optional(Ii),keepNext:n.Optional(n.Boolean({description:"Keep paragraph with next paragraph on same page"})),keepLines:n.Optional(n.Boolean({description:"Keep all lines of paragraph together on same page"}))},{description:"Image component props",additionalProperties:!1}),cn=n.Object({number:n.String({description:"Statistic number/value (required)"}),description:n.String({description:"Statistic description (required)"}),unit:n.Optional(n.String({description:"Unit of measurement"})),format:n.Optional(n.String({description:"Number format pattern"})),trend:n.Optional(n.Union([n.Literal("up"),n.Literal("down"),n.Literal("neutral")])),trendValue:n.Optional(n.Union([n.String(),n.Number()])),alignment:n.Optional(en),spacing:n.Optional(Ct),size:n.Optional(n.Union([n.Literal("small"),n.Literal("medium"),n.Literal("large")]))},{description:"Statistic component props",additionalProperties:!1}),vv=n.Recursive(e=>n.Union([n.String(),n.Object({name:n.String(),props:n.Object({},{additionalProperties:!0}),children:n.Optional(n.Array(e))},{additionalProperties:!1})])),Wg=n.Union([n.Literal("left"),n.Literal("center"),n.Literal("right"),n.Literal("justify")],{description:"Horizontal text alignment"}),Hg=n.Union([n.Literal("top"),n.Literal("middle"),n.Literal("bottom")],{description:"Vertical cell alignment"}),zg=n.Object({family:n.Optional(n.String({description:"Font family name"})),size:n.Optional(n.Number({minimum:0,description:"Font size in points"})),bold:n.Optional(n.Boolean({description:"Bold text"})),fontWeight:n.Optional(n.Integer({minimum:100,maximum:900,description:"Per-cell weight (100\\u2013900). Overrides `bold` when set."})),italic:n.Optional(n.Boolean({description:"Italic text"})),underline:n.Optional(n.Boolean({description:"Underlined text"})),lineSpacing:n.Optional(n.Object({..._a.properties},{description:"Line spacing of the cell\'s paragraph. Overrides the theme\'s tableCell style; `exactly` gives dense, fixed-height rows.",additionalProperties:!1}))},{additionalProperties:!1}),Mm=n.Union([n.String({description:"Border color for all sides (hex without #)"}),n.Object({bottom:n.Optional(n.String({description:"Bottom border color (hex without #)"})),top:n.Optional(n.String({description:"Top border color (hex without #)"})),right:n.Optional(n.String({description:"Right border color (hex without #)"})),left:n.Optional(n.String({description:"Left border color (hex without #)"}))},{additionalProperties:!1})]),Bm=n.Union([n.Number({minimum:0,description:"Border size for all sides in points"}),n.Object({bottom:n.Optional(n.Number({minimum:0,description:"Bottom border size in points"})),top:n.Optional(n.Number({minimum:0,description:"Top border size in points"})),right:n.Optional(n.Number({minimum:0,description:"Right border size in points"})),left:n.Optional(n.Number({minimum:0,description:"Left border size in points"}))},{additionalProperties:!1})]),Lv=n.Union([n.Boolean({description:"Hide all borders when true. A side named in a cell/column per-side borderColor or borderSize keeps its border"}),n.Object({bottom:n.Optional(n.Boolean({description:"Hide bottom border"})),top:n.Optional(n.Boolean({description:"Hide top border"})),right:n.Optional(n.Boolean({description:"Hide right border"})),left:n.Optional(n.Boolean({description:"Hide left border"})),insideHorizontal:n.Optional(n.Boolean({description:"Hide horizontal borders between rows"})),insideVertical:n.Optional(n.Boolean({description:"Hide vertical borders between columns"}))},{description:"Selectively hide specific borders",additionalProperties:!1})]),Jg=n.Union([n.Number({minimum:0,description:"Padding for all sides in points"}),n.Object({bottom:n.Optional(n.Number({minimum:0,description:"Bottom padding in points"})),top:n.Optional(n.Number({minimum:0,description:"Top padding in points"})),right:n.Optional(n.Number({minimum:0,description:"Right padding in points"})),left:n.Optional(n.Number({minimum:0,description:"Left padding in points"}))},{additionalProperties:!1})]),Dm=n.Object({color:n.Optional(Q),backgroundColor:n.Optional(Om),horizontalAlignment:n.Optional(Wg),verticalAlignment:n.Optional(Hg),font:n.Optional(zg),borderColor:n.Optional(Mm),borderSize:n.Optional(Bm),padding:n.Optional(Jg),height:n.Optional(n.Number({minimum:0,description:"Cell height in points"}))},{additionalProperties:!1});function Hm(e){let t=n.Union([n.String(),e]),r={color:n.Optional(Q),backgroundColor:n.Optional(Om),horizontalAlignment:n.Optional(Wg),verticalAlignment:n.Optional(Hg),font:n.Optional(zg),borderColor:n.Optional(Mm),borderSize:n.Optional(Bm),padding:n.Optional(Jg),height:n.Optional(n.Number({minimum:0,description:"Cell height in points"})),comment:n.Optional(no),revision:n.Optional(ro)},i=n.Object({...r,content:n.Optional(t)},{additionalProperties:!1}),o=n.Object({...r,content:n.Optional(t)},{additionalProperties:!1}),a=n.Object({width:n.Optional(n.Union([n.Number({minimum:0,description:"Column width in points. When set on some columns, remaining columns will automatically share the leftover table space equally. Leave undefined to distribute space evenly among unspecified columns."}),n.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:\'Column width as percentage of available width (e.g., "40%")\'})])),cellDefaults:n.Optional(Dm),header:n.Optional(i),cells:n.Optional(n.Array(o))},{additionalProperties:!1});return n.Object({borderColor:n.Optional(Mm),borderSize:n.Optional(Bm),hideBorders:n.Optional(Lv),cellDefaults:n.Optional(Dm),headerCellDefaults:n.Optional(Dm),width:n.Optional(n.Number({minimum:0,maximum:100,description:"Table width in percentage (0-100)"})),columns:n.Array(a,{description:"Table columns with headers and cells",minItems:1}),rows:n.Optional(n.Array(n.Object({revision:n.Optional(Km),cantSplit:n.Optional(n.Boolean({description:"Keep this row on one page"})),tableHeader:n.Optional(n.Boolean({description:"Repeat this row as a header on each page"}))},{additionalProperties:!1}),{description:"Row-parallel properties, indexed like `columns[].cells`. The model is column-major, so anything that belongs to a whole row lives here."})),keepInOnePage:n.Optional(n.Boolean({description:"Keep table rows together on the same page by setting keepNext on all paragraphs"})),keepNext:n.Optional(n.Boolean({description:"Set keepNext on the last row to keep it connected to the next element. Works independently of keepInOnePage. Defaults to false."})),repeatHeaderOnPageBreak:n.Optional(n.Boolean({description:"Repeat the header row on each page when the table spans multiple pages. Defaults to true.",default:!0}))},{description:"Table component props with column-based structure",additionalProperties:!1})}var ln=Hm(vv),zm=e=>n.Object({meta:n.Optional(n.Object({title:n.Optional(n.String({description:"Authoring label for this section, shown in editors and outlines. Never rendered \\u2014 add a heading child for a visible title."}))},{additionalProperties:!1,description:"Authoring metadata; has no effect on the document."})),header:n.Optional(n.Union([n.Array(e||n.Any(),{description:"Section header components"}),n.Literal("linkToPrevious",{description:"Link header to previous section"})])),footer:n.Optional(n.Union([n.Array(e||n.Any(),{description:"Section footer components"}),n.Literal("linkToPrevious",{description:"Link footer to previous section"})])),pageBreak:n.Optional(n.Boolean({description:"Insert page break before section",default:!0})),spacing:n.Optional(Ct),page:n.Optional(n.Object({size:n.Optional(n.Union([n.Literal("A4"),n.Literal("A3"),n.Literal("LETTER"),n.Literal("LEGAL"),n.Object({width:n.Number({minimum:0}),height:n.Number({minimum:0})})])),margins:n.Optional(n.Object({top:n.Optional(n.Number({minimum:0})),bottom:n.Optional(n.Number({minimum:0})),left:n.Optional(n.Number({minimum:0})),right:n.Optional(n.Number({minimum:0})),header:n.Optional(n.Number({minimum:0})),footer:n.Optional(n.Number({minimum:0})),gutter:n.Optional(n.Number({minimum:0}))},{additionalProperties:!1}))},{description:"Page configuration override for this section (overrides theme page settings)",additionalProperties:!1}))},{description:"Section component props",additionalProperties:!1}),pn=zm(),Nv=n.Object({width:n.Optional(n.Union([n.Number({minimum:1,description:"Column width in points"}),n.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:\'Column width as percentage of available width (e.g., "30%")\'}),n.Literal("auto",{description:"Auto width: consume remaining space after fixed widths and gaps"})])),gap:n.Optional(n.Union([n.Number({minimum:0,description:"Gap after this column in points"}),n.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:\'Gap after this column as percentage of available width (e.g., "5%")\'})]))},{additionalProperties:!1}),mn=n.Object({columns:n.Union([n.Number({minimum:1,description:"Number of equal-width columns (converter will normalize to array)"}),n.Array(Nv,{minItems:1,description:"List of columns in order; width and gap can be points, percentages, or auto width"})]),gap:n.Optional(n.Union([n.Number({minimum:0,description:"Default gap applied after each column except the last (points)"}),n.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:\'Default gap applied after each column except the last as percentage of available width (e.g., "5%")\'})]))},{description:"Columns component props",additionalProperties:!1}),Yg=n.Union([n.Literal("decimal"),n.Literal("upperRoman"),n.Literal("lowerRoman"),n.Literal("upperLetter"),n.Literal("lowerLetter"),n.Literal("bullet"),n.Literal("ordinal"),n.Literal("cardinalText"),n.Literal("ordinalText"),n.Literal("hex"),n.Literal("chicago"),n.Literal("ideographDigital"),n.Literal("japaneseCounting"),n.Literal("aiueo"),n.Literal("iroha"),n.Literal("decimalFullWidth"),n.Literal("decimalHalfWidth"),n.Literal("japaneseLegal"),n.Literal("japaneseDigitalTenThousand"),n.Literal("decimalEnclosedCircle"),n.Literal("decimalFullWidth2"),n.Literal("aiueoFullWidth"),n.Literal("irohaFullWidth"),n.Literal("decimalZero"),n.Literal("ganada"),n.Literal("chosung"),n.Literal("decimalEnclosedFullstop"),n.Literal("decimalEnclosedParen"),n.Literal("decimalEnclosedCircleChinese"),n.Literal("ideographEnclosedCircle"),n.Literal("ideographTraditional"),n.Literal("ideographZodiac"),n.Literal("ideographZodiacTraditional"),n.Literal("taiwaneseCounting"),n.Literal("ideographLegalTraditional"),n.Literal("taiwaneseCountingThousand"),n.Literal("taiwaneseDigital"),n.Literal("chineseCounting"),n.Literal("chineseLegalSimplified"),n.Literal("chineseCountingThousand"),n.Literal("koreanDigital"),n.Literal("koreanCounting"),n.Literal("koreanLegal"),n.Literal("koreanDigital2"),n.Literal("vietnameseCounting"),n.Literal("russianLower"),n.Literal("russianUpper"),n.Literal("none"),n.Literal("numberInDash"),n.Literal("hebrew1"),n.Literal("hebrew2"),n.Literal("arabicAlpha"),n.Literal("arabicAbjad"),n.Literal("hindiVowels"),n.Literal("hindiConsonants"),n.Literal("hindiNumbers"),n.Literal("hindiCounting"),n.Literal("thaiLetters"),n.Literal("thaiNumbers"),n.Literal("thaiCounting")],{description:"Number or bullet format for list levels"}),Jm=n.Object({family:n.Optional(n.String({description:"Font family name"})),size:n.Optional(n.Number({minimum:1,description:"Marker size in points"})),color:n.Optional(Q),bold:n.Optional(n.Boolean({description:"Bold marker"})),italic:n.Optional(n.Boolean({description:"Italic marker"})),underline:n.Optional(n.Boolean({description:"Underlined marker"}))},{description:"Styling for the number/bullet glyph only. The list text is unaffected.",additionalProperties:!1}),Rv=n.Object({level:n.Number({minimum:0,maximum:8,description:"Nesting level (0 = root, 1 = first sublevel, etc.)"}),format:n.Optional(Yg),text:n.Optional(n.String({description:\'Number format string (e.g., "%1." for "1.", "%1)" for "1)", custom bullet character for bullet format)\'})),alignment:n.Optional(n.Union([n.Literal("start"),n.Literal("end"),n.Literal("left"),n.Literal("right"),n.Literal("center")],{description:"Alignment of the numbering/bullet"})),indent:n.Optional(Mn),start:n.Optional(n.Number({minimum:1,description:"Starting number for this level (default: 1)"})),font:n.Optional(Jm)},{description:"Configuration for a single list level",additionalProperties:!1}),un=n.Object({items:n.Array(n.Union([n.String(),n.Object({text:n.String(),level:n.Optional(n.Number({minimum:0,maximum:8,description:"Nesting level for this item"})),id:n.Optional(n.String({description:"Bookmark id for this item, targetable by internal links (#id) and cross-references ([@id])"})),revision:n.Optional(ro)},{additionalProperties:!1})]),{description:"List items (required)",minItems:1}),reference:n.Optional(n.String({description:"Unique reference ID for this numbering configuration (auto-generated if not provided)"})),levels:n.Optional(n.Array(Rv,{description:"Configuration for each nesting level",minItems:1,maxItems:9})),format:n.Optional(n.Union([Yg,n.Literal("numbered"),n.Literal("none")],{description:"Format for level 0 (simplified option when levels not specified)"})),bullet:n.Optional(n.String({description:"Custom bullet character (simplified option when levels not specified)"})),start:n.Optional(n.Number({minimum:1,description:"Starting number for level 0. Applies whether or not `levels` is given; a `start` on the level itself wins."})),font:n.Optional(n.Partial(Zr)),spacing:n.Optional(Tg),alignment:n.Optional(Ua),keepNext:n.Optional(n.Boolean({description:"Keep every item with what follows, so the list stays with the text that introduces it"})),keepLines:n.Optional(n.Boolean({description:"Keep all lines of each item together on the same page"})),indent:n.Optional(n.Union([n.Number({minimum:0}),Mn])),comment:n.Optional(no)},{description:"List component props",additionalProperties:!1}),Ym=["revision","comment","footnotes","endnotes"],kv=n.Partial(n.Omit(on,Ym)),Fv=n.Partial(n.Omit(an,Ym)),jv=n.Partial(sn),Uv=n.Partial(cn),_v=n.Partial(n.Omit(ln,["rows"])),Dv=n.Partial(pn),Mv=n.Partial(mn),Bv=n.Partial(n.Omit(un,Ym)),jc=n.Object({heading:n.Optional(kv),paragraph:n.Optional(Fv),image:n.Optional(jv),statistic:n.Optional(Uv),table:n.Optional(_v),section:n.Optional(Dv),columns:n.Optional(Mv),list:n.Optional(Bv)},{additionalProperties:!0});var Ya=["consulting","devportal","minimal","vermilion"],Vv=n.Object({top:n.Number({minimum:0}),bottom:n.Number({minimum:0}),left:n.Number({minimum:0}),right:n.Number({minimum:0}),header:n.Number({minimum:0}),footer:n.Number({minimum:0}),gutter:n.Number({minimum:0})},{additionalProperties:!1,description:"Document margin configuration"}),dH=n.Object({width:n.Number({minimum:0}),height:n.Number({minimum:0})},{additionalProperties:!1,description:"Page dimensions in twips"}),Kv=n.Object({size:n.Union([n.Literal("A4"),n.Literal("A3"),n.Literal("LETTER"),n.Literal("LEGAL"),n.Object({width:n.Number({minimum:0}),height:n.Number({minimum:0})},{additionalProperties:!1})],{description:"Standard page size or custom dimensions"}),margins:Vv},{description:"Page configuration including dimensions and margins",additionalProperties:!1}),Qg=n.Object({heading:Zr,body:Zr,mono:Zr,light:Zr},{additionalProperties:!1,description:"Font definitions for different text types"}),Gv=n.Union([n.Literal("single"),n.Literal("dashDotStroked"),n.Literal("dashed"),n.Literal("dashSmallGap"),n.Literal("dotDash"),n.Literal("dotDotDash"),n.Literal("dotted"),n.Literal("double"),n.Literal("doubleWave"),n.Literal("inset"),n.Literal("nil"),n.Literal("none"),n.Literal("outset"),n.Literal("thick"),n.Literal("thickThinLargeGap"),n.Literal("thickThinMediumGap"),n.Literal("thickThinSmallGap"),n.Literal("thinThickLargeGap"),n.Literal("thinThickMediumGap"),n.Literal("thinThickSmallGap"),n.Literal("thinThickThinLargeGap"),n.Literal("thinThickThinMediumGap"),n.Literal("thinThickThinSmallGap"),n.Literal("threeDEmboss"),n.Literal("threeDEngrave"),n.Literal("triple"),n.Literal("wave")],{description:"Paragraph border style"}),Xg={style:Gv,size:n.Number({minimum:0,description:"Width in eighths of a point (docx sz)"}),color:Q,space:n.Optional(n.Number({minimum:0,description:"Space between text and border in points"}))},Uc=n.Object(Xg,{additionalProperties:!1,description:"Paragraph border side definition"}),qv=n.Object(Xg,{additionalProperties:!1,description:"Rule drawn between consecutive paragraphs sharing this border set (w:between), in place of their adjoining bottom and top edges"}),Zg=n.Object({top:n.Optional(Uc),bottom:n.Optional(Uc),left:n.Optional(Uc),right:n.Optional(Uc),between:n.Optional(qv)},{additionalProperties:!1,description:"Paragraph borders (per side, plus the between-paragraph rule)"}),ey=n.Optional(n.Union([n.Literal("left"),n.Literal("center"),n.Literal("right"),n.Literal("justify")])),cr=n.Object({font:n.Optional(n.Union([n.Literal("heading"),n.Literal("body"),n.Literal("mono"),n.Literal("light")])),...Oc.properties,alignment:ey,priority:n.Optional(n.Number()),baseStyle:n.Optional(n.String()),followingStyle:n.Optional(n.String()),widowControl:n.Optional(n.Boolean()),keepNext:n.Optional(n.Boolean()),keepLinesTogether:n.Optional(n.Boolean()),outlineLevel:n.Optional(n.Number()),borders:n.Optional(Zg),indent:n.Optional(Mn)},{additionalProperties:!1}),Wv=n.Union([n.Literal("dot"),n.Literal("hyphen"),n.Literal("middleDot"),n.Literal("none"),n.Literal("underscore")],{description:"Tab leader style: dot (dotted), hyphen (dashed), middleDot, none (blank), or underscore"}),Hv=n.Union([n.Literal("left"),n.Literal("right"),n.Literal("center"),n.Literal("bar"),n.Literal("clear"),n.Literal("decimal"),n.Literal("end"),n.Literal("num"),n.Literal("start")],{description:"Tab stop alignment type"}),zv=n.Object({type:Hv,position:n.Union([n.Number({description:"Tab stop position in twips (1/1440 inch). Common: 9026 for right-aligned at page margin"}),n.Literal("max",{description:"Use maximum position (TabStopPosition.MAX = 9026 twips)"})]),leader:n.Optional(Wv)},{description:"Tab stop configuration with position, alignment, and optional leader",additionalProperties:!1}),io=n.Object({font:n.Optional(n.Union([n.Literal("heading"),n.Literal("body"),n.Literal("mono"),n.Literal("light")])),...Oc.properties,alignment:ey,tabStops:n.Optional(n.Array(zv,{description:"Tab stops for TOC entries. Use right-aligned tab with leader to create dotted lines to page numbers.",default:[{type:"right",position:"max",leader:"none"}]})),priority:n.Optional(n.Number()),followingStyle:n.Optional(n.String()),widowControl:n.Optional(n.Boolean()),keepNext:n.Optional(n.Boolean()),keepLinesTogether:n.Optional(n.Boolean()),outlineLevel:n.Optional(n.Number()),borders:n.Optional(Zg),indent:n.Optional(Mn)},{additionalProperties:!1}),ty=n.Object({normal:n.Optional(cr),heading1:n.Optional(cr),heading2:n.Optional(cr),heading3:n.Optional(cr),heading4:n.Optional(cr),heading5:n.Optional(cr),heading6:n.Optional(cr),title:n.Optional(cr),subtitle:n.Optional(cr),TOC1:n.Optional(io),TOC2:n.Optional(io),TOC3:n.Optional(io),TOC4:n.Optional(io),TOC5:n.Optional(io),TOC6:n.Optional(io)},{additionalProperties:cr,description:"Style definitions supporting predefined styles (normal, heading1..6, title, subtitle), TOC entry styles (TOC1..TOC6), and arbitrary custom styles."}),fH=n.Object({level:n.Union([n.Literal(1),n.Literal(2),n.Literal(3),n.Literal(4),n.Literal(5),n.Literal(6)]),...cr.properties},{additionalProperties:!1}),ry=n.Object({primary:Q,secondary:Q,accent:Q,text:Q,background:Q,border:Q,textPrimary:Q,textSecondary:Q,textMuted:Q,borderPrimary:Q,borderSecondary:Q,backgroundPrimary:Q,backgroundSecondary:Q,accent4:n.Optional(Q),accent5:n.Optional(Q),accent6:n.Optional(Q)},{additionalProperties:!1}),_c=n.Object({...Fn,colors:n.Optional(n.Partial(ry)),fonts:n.Optional(n.Partial(Qg)),styles:n.Optional(ty)},{additionalProperties:!1,description:"Partial theme deep-merged over the resolved named theme: define or override palette tokens, font roles, and named styles in-document."}),oo=n.Object({...Fn,$schema:n.Optional(n.String()),name:n.String(),displayName:n.String(),description:n.String({description:"The visual voice: what the theme looks like, in one sentence."}),whenToUse:n.Optional(n.String({description:"The documents the theme suits; discovery and the design guide quote it."})),version:n.String(),colors:ry,fonts:Qg,fontRegistry:n.Optional(wr),page:Kv,styles:n.Optional(ty),componentDefaults:n.Optional(jc),noProofWords:n.Optional(n.Array(n.String({minLength:1}),{description:"Words that should never be flagged as misspelled (whole-word, case-insensitive)."}))},{additionalProperties:!1,description:"Theme configuration"});function ny(e){return T.Check(oo,e)}function iy(e="minimal-theme"){return{name:e,displayName:e.split(/[-_\\s]+/).filter(Boolean).map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" ")||e,description:"A minimal theme with basic styling",version:"1.0.0",colors:{primary:"#2563EB",secondary:"#64748B",accent:"#F8FAFC",text:"#334155",background:"#FFFFFF",border:"#E2E8F0",textPrimary:"#334155",textSecondary:"#64748B",textMuted:"#94A3B8",borderPrimary:"#CBD5E1",borderSecondary:"#E2E8F0",backgroundPrimary:"#FFFFFF",backgroundSecondary:"#F8FAFC"},fonts:{heading:{family:"Arial",size:14},body:{family:"Arial",size:11},mono:{family:"Courier New",size:10},light:{family:"Arial",size:10}},page:{size:"A4",margins:{top:1440,bottom:1440,left:1440,right:1440,header:720,footer:720,gutter:0}},styles:{normal:{font:"body",size:11,color:"#334155",alignment:"left",lineSpacing:{type:"multiple",value:1.15},spacing:{after:8}}}}}var Qm=n.Object({},{additionalProperties:!1}),Jv=e=>n.Object({blocks:n.Optional(Qr),theme:n.Optional(n.String({description:`Theme name to apply (default: "minimal"). Built-ins: ${Ya.join(", ")} (consulting is the house style).`,examples:[...Ya],default:"minimal"})),themeOverrides:n.Optional(_c),qualityProfile:n.Optional(n.String({description:"The quality profile validation judges this document by when the caller names none \\u2014 a blueprint scaffold writes its archetype\\u2019s profile here. A profile names required structure and content; the theme only paints. Built-ins: client-report, technical-report, executive-report, legal-appendix, general (the format default); an unknown name falls back to it.",examples:["client-report","technical-report","executive-report","legal-appendix","general"]})),fontRegistry:n.Optional(wr),componentDefaults:n.Optional(jc),language:n.Optional(n.String({pattern:"^[A-Za-z]{2,3}(-[A-Za-z0-9]{2,8})*$",description:`Default document language (BCP-47 tag, e.g. "en-US"). Sets Word\'s default proofing/spell-check language; individual components can override it locally.`,examples:["en-US","fr-FR","de-DE","it-IT","es-ES"]})),noProofWords:n.Optional(ja),trackRevisions:n.Optional(n.Boolean({description:"Open the document in track-changes mode: Word marks any further edits as revisions. Set automatically on redline documents produced by the diff engine"})),metadata:n.Optional(n.Object({title:n.Optional(n.String({description:"Document title",examples:["Annual Report 2024","Technical Documentation"]})),subtitle:n.Optional(n.String({description:"Document subtitle"})),description:n.Optional(n.String()),author:n.Optional(n.String()),company:n.Optional(n.String({description:"Company name, written to docProps/custom.xml (Word has no core-property slot for it)"})),date:n.Optional(n.String({description:"Document date used by {DATE}/{DATETIME} placeholders (defaults to the generation timestamp)"})),version:n.Optional(n.String({description:"Document version, written to docProps/custom.xml",examples:["1.0","2024.3"]})),tags:n.Optional(n.Array(n.String()))},{description:"Document metadata (title, author, company, version, etc.). Package timestamps (dcterms:created/modified) are not part of this object: they come from the `generatedAt` generation option so repeated builds stay byte-identical.",additionalProperties:!1}))},{description:"Report component props",additionalProperties:!1}),fn=Jv(),Xm=n.Object({width:n.Optional(n.Union([n.Number({minimum:1,description:"Text box width in pixels"}),n.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:\'Text box width as percentage (e.g., "50%") relative to content width\'})],{description:\'Text box width in pixels (number) or as percentage string (e.g., "50%")\'})),height:n.Optional(n.Union([n.Number({minimum:1,description:"Text box height in pixels"}),n.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:\'Text box height as percentage (e.g., "50%") relative to content height\'})],{description:\'Text box height in pixels (number) or as percentage string (e.g., "50%")\'})),renderAs:n.Optional(n.Union([n.Literal("table"),n.Literal("shape")],{description:"Rendering strategy. \'table\' (default): borderless one-cell table \\u2014 height auto-fits content, per-side borders and percentage widths resolve in Word. \'shape\': native Word text box (WPS shape) \\u2014 real wrap modes and z-order, but requires explicit width and height (no autofit), a single uniform border, and eagerly-resolved percentage sizes."})),floating:n.Optional(Ii),style:n.Optional(n.Object({padding:n.Optional(n.Object({top:n.Optional(n.Number({minimum:0})),right:n.Optional(n.Number({minimum:0})),bottom:n.Optional(n.Number({minimum:0})),left:n.Optional(n.Number({minimum:0}))},{additionalProperties:!1})),border:n.Optional(n.Object({top:n.Optional(n.Object({style:n.Optional(n.Union([n.Literal("solid"),n.Literal("dashed"),n.Literal("dotted"),n.Literal("double"),n.Literal("none")])),width:n.Optional(n.Number({minimum:0})),color:n.Optional(Q)},{additionalProperties:!1})),right:n.Optional(n.Object({style:n.Optional(n.Union([n.Literal("solid"),n.Literal("dashed"),n.Literal("dotted"),n.Literal("double"),n.Literal("none")])),width:n.Optional(n.Number({minimum:0})),color:n.Optional(Q)},{additionalProperties:!1})),bottom:n.Optional(n.Object({style:n.Optional(n.Union([n.Literal("solid"),n.Literal("dashed"),n.Literal("dotted"),n.Literal("double"),n.Literal("none")])),width:n.Optional(n.Number({minimum:0})),color:n.Optional(Q)},{additionalProperties:!1})),left:n.Optional(n.Object({style:n.Optional(n.Union([n.Literal("solid"),n.Literal("dashed"),n.Literal("dotted"),n.Literal("double"),n.Literal("none")])),width:n.Optional(n.Number({minimum:0})),color:n.Optional(Q)},{additionalProperties:!1}))},{additionalProperties:!1})),shading:n.Optional(n.Object({fill:n.Optional(Q)},{additionalProperties:!1}))},{additionalProperties:!1}))},{additionalProperties:!1,allOf:[{if:{properties:{renderAs:{const:"shape"}},required:["renderAs"]},then:{required:["width","height"],properties:{style:{properties:{border:{properties:Object.fromEntries(["top","right","bottom","left"].map(e=>[e,{properties:{style:{enum:["solid","none"]}}}]))}}}}}}]}),Yv=n.Union([n.Literal("numeric"),n.Literal("bullet"),n.Literal("none")],{description:"TOC numbering style \\u2014 accepted but not applied (Word TOC fields carry no numbering switch); setting it logs a warning during generation"}),Qv=n.Union([n.Literal("document"),n.Literal("section")],{description:"TOC scope: document-wide or section-only"}),Xv=n.Object({styleId:n.String({description:"Custom style ID matching a key in theme.styles"}),level:n.Number({minimum:1,maximum:6,description:"TOC level (1-6) to assign to this style"})},{description:"Mapping of custom style to TOC level",additionalProperties:!1}),$H=n.Object({from:n.Optional(n.Number({minimum:1,maximum:6,default:1,description:"Starting heading level (1-6). Defaults to 1 if not specified."})),to:n.Optional(n.Number({minimum:1,maximum:6,default:3,description:"Ending heading level (1-6). Defaults to 3 if not specified."}))},{description:\'Range of heading levels to include in TOC. Specify at least one of "from" or "to".\',additionalProperties:!1}),Zm=n.Object({pageBreak:n.Optional(n.Boolean({description:"Insert page break before TOC block"})),depth:n.Optional(n.Object({from:n.Optional(n.Number({minimum:1,maximum:6,default:1,description:"Starting heading level (1-6). Defaults to 1 if not specified."})),to:n.Optional(n.Number({minimum:1,maximum:6,default:3,description:"Ending heading level (1-6). Defaults to 3 if not specified."}))},{description:\'Range of heading levels to include in TOC. Specify "from", "to", or both. Defaults: from=1, to=3\',additionalProperties:!1,default:{to:3}})),pageNumbersDepth:n.Optional(n.Object({from:n.Optional(n.Number({minimum:1,maximum:6,default:1,description:"Starting heading level (1-6). Defaults to 1 if not specified."})),to:n.Optional(n.Number({minimum:1,maximum:6,default:3,description:"Ending heading level (1-6). Defaults to 3 if not specified."}))},{description:\'Range of heading levels to show page numbers. Specify "from", "to", or both. When specified, page numbers are hidden for entries outside this range.\',additionalProperties:!1})),numberingStyle:n.Optional(Yv),title:n.Optional(n.String({description:"TOC heading title"})),includePageNumbers:n.Optional(n.Boolean({default:!0,description:"Show page numbers next to entries"})),numberSeparator:n.Optional(n.Boolean({default:!0,description:\'Use tab separator between entry and page number. True applies "\\\\t" (default), false applies " "\'})),scope:n.Optional(n.Union([Qv,n.Literal("auto")],{default:"auto",description:\'TOC scope: "document" for entire document, "section" for parent section only, "auto" for automatic detection (section if inside section, otherwise document)\'})),styles:n.Optional(n.Array(Xv,{description:"Custom style mappings for TOC entries. Maps custom theme styles to TOC levels."}))},{description:"Table of Contents component props",additionalProperties:!1}),eu=n.Object({thickness:n.Optional(n.Number({minimum:.25,maximum:12,description:"Line weight in points (default 1). OOXML measures a border in eighths of a point and Word stops at 12pt, so this is the whole usable range."})),color:n.Optional(Q),style:n.Optional(n.Union([n.Literal("solid"),n.Literal("dashed"),n.Literal("dotted"),n.Literal("double")],{description:\'Line style (default "solid"). `double` draws two lines and is measured per line, so it reads about twice as tall as its thickness.\'})),width:n.Optional(n.Union([n.Number({minimum:1,description:"Divider width in points"}),n.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:\'Divider width as a percentage of the text measure (e.g. "40%")\'})],{description:"How far the line runs (default: the full text measure). A percentage or a point width is turned into paragraph indents, resolved against the theme page \\u2014 so a partial divider inside a column or a re-margined section is measured against the page, while the default full-measure divider is exact everywhere."})),alignment:n.Optional(n.Union([n.Literal("left"),n.Literal("center"),n.Literal("right")],{description:\'Which end of the measure a partial divider sits at (default "left"). Ignored at full width.\'})),spacing:n.Optional(Ct)},{description:"Horizontal divider \\u2014 a thin line across the measure, drawn as a Word paragraph border so it stays editable in Word.",additionalProperties:!1}),tu=n.Object({options:n.Intersect([n.Record(n.String(),n.Unknown()),n.Object({chart:n.Object({width:n.Number(),height:n.Number()})})]),scale:n.Optional(n.Number()),resources:n.Optional(n.Object({css:n.Optional(n.String()),js:n.Optional(n.String()),files:n.Optional(n.Array(n.String()))})),serverUrl:n.Optional(n.String({description:"Highcharts Export Server URL (default: http://localhost:7801)"})),width:n.Optional(n.Union([n.Number({minimum:1,description:"Image width in pixels"}),n.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:\'Image width as percentage (e.g., "90%") relative to content width\'})],{description:\'Rendered image width in pixels (number) or as percentage string (e.g., "90%")\'})),height:n.Optional(n.Union([n.Number({minimum:1,description:"Image height in pixels"}),n.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:\'Image height as percentage (e.g., "90%") relative to content height\'})],{description:\'Rendered image height in pixels (number) or as percentage string (e.g., "90%")\'}))}),Zv=n.Union([n.Literal("area"),n.Literal("bar"),n.Literal("column"),n.Literal("doughnut"),n.Literal("line"),n.Literal("pie"),n.Literal("radar"),n.Literal("scatter")],{description:"Chart type"}),eL=n.Object({name:n.Optional(n.String({description:"Series name"})),labels:n.Optional(n.Array(n.String(),{description:"Category labels. Needed on every series, not just the first, and the same length as `values`; a series without both `labels` and `values` drops the whole chart."})),values:n.Optional(n.Array(n.Number(),{description:"Data values, one per label. Needed on every series \\u2014 see `labels`."}))},{additionalProperties:!1}),ru=n.Object({type:Zv,data:n.Array(eL,{description:"Chart data series",minItems:1}),title:n.Optional(n.String({description:"Chart title text"})),showTitle:n.Optional(n.Boolean({description:"Show the chart title. Defaults to true when `title` is set."})),showLegend:n.Optional(n.Boolean({description:"Show chart legend"})),legendPos:n.Optional(n.Union([n.Literal("b"),n.Literal("l"),n.Literal("r"),n.Literal("t"),n.Literal("tr")],{description:"Legend position"})),chartColors:n.Optional(n.Array(n.String(),{description:"Series colors (hex or semantic theme names). Defaults to the theme palette."})),catAxisTitle:n.Optional(n.String({description:"Category axis title"})),valAxisTitle:n.Optional(n.String({description:"Value axis title"})),width:n.Optional(n.Number({minimum:0,exclusiveMinimum:0,description:"Chart width in inches. Defaults to the content width."})),height:n.Optional(n.Number({minimum:0,exclusiveMinimum:0,description:"Chart height in inches. Defaults to 3."})),alignment:n.Optional(en),caption:n.Optional(n.String({description:"Chart caption (supports rich text with **bold**, *italic*, ***both***)"})),alt:n.Optional(n.String({description:"Alternative text for accessibility"})),spacing:n.Optional(Ct),floating:n.Optional(Ii),keepNext:n.Optional(n.Boolean({description:"Keep paragraph with next paragraph on same page"})),keepLines:n.Optional(n.Boolean({description:"Keep all lines of paragraph together on same page"}))},{description:\'Native Word chart - editable, scalable, no export server needed. Requires renderer "office-open".\',additionalProperties:!1}),dn=["block","group","heading","paragraph","image","statistic","table","list","toc","divider","highcharts","chart","visual","columns","text-box"],Tt=[{name:"docx",propsSchema:fn,hasChildren:!0,allowedChildren:["section"],category:"container",description:"Main document container - defines the overall document structure. Required as the root component.",special:{hasSchemaField:!0}},{name:"section",propsSchema:pn,createPropsSchema:zm,embeddedComponents:[{path:["header"],arity:"component-array",reportStructure:!0},{path:["footer"],arity:"component-array",reportStructure:!0}],hasChildren:!0,allowedChildren:dn,category:"container",description:"Section container - groups related content with optional title. Use for organizing document structure."},{name:"columns",propsSchema:mn,hasChildren:!0,allowedChildren:dn.filter(e=>e!=="columns"),category:"layout",description:"Multi-column layout - arranges content in 2-4 columns. Great for side-by-side content."},{name:"text-box",propsSchema:Xm,hasChildren:!0,allowedChildren:dn,category:"layout",description:"Floating text container - allows positioning text anywhere on the page with absolute or relative positioning. Holds any flow content, tables and columns included."},{name:"heading",propsSchema:on,hasChildren:!1,category:"content",description:"Heading text - supports levels 1-6 for document hierarchy. Level 1 is largest. Never skip a level going down (1 \\u2192 3): the gap breaks the document outline."},{name:"paragraph",propsSchema:an,hasChildren:!1,category:"content",description:"Paragraph text - supports formatting like bold, italic, and color. Main content element."},{name:"image",propsSchema:sn,hasChildren:!1,category:"content",description:"Image element - displays images with optional caption. Supports various formats."},{name:"statistic",propsSchema:cn,hasChildren:!1,category:"content",description:"Statistic display - shows a number with description. Perfect for KPIs and metrics."},{name:"block",propsSchema:Dn,hasChildren:!1,category:"content",description:"Invoke a JSON block defined in this document\\u2019s props.blocks. Fill its named slots; no block names are built into the engine."},{name:"group",propsSchema:Qm,hasChildren:!0,allowedChildren:dn,category:"container",description:"Transparent group of flow components; also the inspectable result of block expansion."},{name:"table",propsSchema:ln,createPropsSchema:Hm,embeddedComponents:[{path:["columns","*","header","content"],arity:"component",reportStructure:!1},{path:["columns","*","cells","*","content"],arity:"component",reportStructure:!1}],hasChildren:!1,category:"content",description:"Data table, declared COLUMN-MAJOR: `props.columns[]`, each with its own `header` and its own `cells[]` running down the column. Note the PPTX `table` is the other way round \\u2014 rows of cells \\u2014 so a table cannot be moved between the formats unchanged. Fixed column widths are points and must fit the page; leave some columns unsized so they share the leftover space."},{name:"list",propsSchema:un,hasChildren:!1,category:"content",description:"List element - bulleted or numbered list items. Supports nested lists."},{name:"toc",propsSchema:Zm,hasChildren:!1,category:"content",description:"Table of contents - automatically generates TOC from document headings. Supports depth ranges and custom styles."},{name:"divider",propsSchema:eu,hasChildren:!1,category:"content",description:"Horizontal divider - a thin line across the measure, for separating sections. Drawn as a Word paragraph border, so it stays a real Word object. Use this rather than collapsing a paragraph\'s line spacing to fake one."},{name:"highcharts",propsSchema:tu,hasChildren:!1,category:"content",description:"Chart component powered by Highcharts - render line, bar, pie, heatmap, and more with rich options."},{name:"chart",propsSchema:ru,hasChildren:!1,renderers:["office-open"],category:"content",description:\'Native Word chart - editable, scalable, no export server needed. Requires renderer "office-open".\'},{name:"visual",propsSchema:vc,hasChildren:!1,category:"content",description:\'Free-canvas graphic for infographics, diagrams and layered compositions the document flow cannot express. Rasterized from a pptx slide by default; renderMode "native" draws it as an editable Word drawing group (renderer "office-open").\'}];function Qa(e){return Tt.find(t=>t.name===e)}function oy(){return Tt.map(e=>e.name)}function ay(){return Tt.filter(e=>e.hasChildren)}function tL(e){let t=e;return t.type!=="object"||(t.required?.length??0)>0}function Ti(e,t,r,i){let o={name:n.Literal(e.name),id:n.Optional(n.String()),enabled:n.Optional(n.Boolean({default:!0,description:"When false, this component is filtered out and not rendered. Defaults to true. Useful for conditional component inclusion."}))};e.special?.hasSchemaField&&(o.$schema=n.Optional(n.String({format:"uri"})),o.renderer=i?i.requireDiscriminator?n.Literal(i.renderer,{description:"Renderer backend for this document"}):n.Optional(n.Literal(i.renderer,{description:\'Renderer backend. Omitted defaults to "docxjs".\'})):n.Optional(n.Union(Tr.map(c=>n.Literal(c)),{description:\'Renderer backend. Omitted defaults to "docxjs".\'})));let a=e.createPropsSchema&&r?e.createPropsSchema(r):e.propsSchema,s=i?Rc(e.name,a,i.renderer):a;return o.props=tL(s)?s:n.Optional(s),e.hasChildren&&t&&(o.children=e.special?.hasSchemaField?n.Array(t):n.Optional(n.Array(t))),n.Object(o,{additionalProperties:!1,description:e.description})}function sy(e){return Tt.map(t=>Ti(t,e))}function rL(e,t){let r=new Set(e);return e.length===r.size&&t.length===r.size&&t.every(i=>r.has(i))}function Dc(e,t=[],r){let i=u=>!r||!u.renderers||u.renderers.includes(r.renderer),o=Tt.filter(i),a=new Set(dn),s=new Map;for(let u of o)u.hasChildren||s.set(u.name,Ti(u,void 0,e,r));let c=(u,f)=>{let O=[...u];for(;O.length>0;){let w=O.length;for(let S=O.length-1;S>=0;S--){let x=O[S];if(!x.allowedChildren){s.set(x.name,Ti(x,e,e,r)),O.splice(S,1);continue}if(rL(x.allowedChildren,dn)){s.set(x.name,Ti(x,f,e,r)),O.splice(S,1);continue}if(!x.allowedChildren.filter(ye=>o.some(Le=>Le.name===ye&&Le.hasChildren)).every(ye=>s.has(ye)))continue;let v=[...x.allowedChildren.map(ye=>s.get(ye)).filter(ye=>ye!==void 0),...t],D=v.length===1?v[0]:n.Union(v);s.set(x.name,Ti(x,D,e,r)),O.splice(S,1)}if(O.length===w)throw new Error(`Circular allowedChildren among: ${O.map(S=>S.name).join(", ")}`)}},l=n.Recursive(u=>{c(o.filter(O=>O.hasChildren&&a.has(O.name)),u);let f=dn.map(O=>s.get(O)).filter(O=>O!==void 0);return n.Union([...f,...t],{discriminator:{propertyName:"name"},description:"Flow content: what a section body holds, and so what a group, columns or text-box holds."})},{$id:Nc(r?.renderer)});c(o.filter(u=>u.hasChildren&&!a.has(u.name)),l);let p=o.map(u=>s.get(u.name)).filter(u=>u!==void 0),m=o.filter(u=>!a.has(u.name)).map(u=>s.get(u.name));return{schemas:p,byName:s,flow:l,roots:m}}function Mc(e,t="ComponentDefinition"){let r=new Set(Object.keys(e.definitions??{})),i=s=>{let c=r.has(s)?s:t;return r.has(c)?`#/definitions/${c}`:void 0},o=s=>typeof s=="string"&&(/^T\\d+$/.test(s)||s===t||r.has(s));function a(s,c=""){if(!(typeof s!="object"||s===null))for(let[l,p]of Object.entries(s)){let m=c?`${c}.${l}`:l;if(p&&typeof p=="object"){let u=p;if(u.type==="array"&&u.items&&Object.keys(u.items).length===0&&r.has(t)&&(u.items={$ref:`#/definitions/${t}`}),u.type==="array"&&u.items&&typeof u.items=="object"&&"$ref"in u.items&&o(u.items.$ref)){let f=i(u.items.$ref);u.items=f?{$ref:f}:{}}if(o(u.$ref)){let f=i(u.$ref);f?u.$ref=f:delete u.$ref}if(l==="$id"&&o(p)&&m!==`definitions.${p}.$id`){delete s[l];continue}a(p,m)}}}a(e)}function cy(e,t={}){let{$schema:r="http://json-schema.org/draft-07/schema#",$id:i,title:o,description:a,definitions:s={}}=t,c=JSON.parse(JSON.stringify(e)),l={...s};function p(u,f=""){if(!(typeof u!="object"||u===null)){for(let[O,w]of Object.entries(u))if(w&&typeof w=="object"){let S=w;if(S.$id&&typeof S.$id=="string"){let x=S.$id;if(f!==`definitions.${x}`){let{$id:N,...I}=S;l[x]=I,u[O]={$ref:`#/definitions/${x}`},p(I,`definitions.${x}`);continue}}p(w,f?`${f}.${O}`:O)}}}p(c);let m={$schema:r};return i&&(m.$id=i),Object.assign(m,c),o!==void 0&&(m.title=o),a!==void 0&&(m.description=a),Object.keys(l).length>0&&(m.definitions=l),Mc(m),Vg(m),Ta(m),m}function ly(e,t,r,i="ComponentDefinition"){let o={$schema:"http://json-schema.org/draft-07/schema#",$id:`${e}.schema.json`,title:t.title,description:t.description,type:"object",required:["name","props"],properties:{name:{type:"string",const:e,description:`Component name identifier (must be "${e}")`},id:{type:"string",description:"Optional unique identifier for the component"},props:JSON.parse(JSON.stringify(t.schema))}};if(ay().map(s=>s.name).includes(e)&&(o.properties.children={type:"array",description:"Children within this container",items:{$ref:`#/definitions/${i}`}},r&&(o.definitions={[i]:JSON.parse(JSON.stringify(r))})),t.enhanceForRichContent&&e==="table"){let s=o;s.definitions||(s.definitions={}),r&&(s.definitions[i]=JSON.parse(JSON.stringify(r)));let l=o.properties.props;if(l?.properties&&typeof l.properties=="object"&&l.properties!==null){let m=l.properties.rows;if(m?.items&&typeof m.items=="object"&&m.items!==null){let f=m.items.items;if(f?.anyOf&&Array.isArray(f.anyOf)){let O=`#/definitions/${i}`;f.anyOf.some(S=>S.$ref===O)||f.anyOf.push({description:"Rich content cell with component (e.g., image, paragraph)",$ref:O})}}}}return Mc(o,i),o.additionalProperties=!1,o}async function py(e,t,r={}){let{prettyPrint:i=!0}=r,o=i?JSON.stringify(e,null,2):JSON.stringify(e);await(await Promise.resolve().then(()=>sd(Fp(),1))).writeFile(t,o,"utf-8")}var my={report:{title:"Report Component",description:"Top-level report container component with document-wide settings"},section:{title:"Section Component",description:"Section container for organizing document content"},columns:{title:"Columns Component",description:"Multi-column layout container"},heading:{title:"Heading Component",description:"Heading text with configurable levels and styling"},paragraph:{title:"Paragraph Component",description:"Rich paragraph text content with formatting options"},"text-box":{title:"Text Box Component",description:"Inline or floating container that groups text and image components with shared positioning"},image:{title:"Image Component",description:"Image content with positioning and sizing options"},statistic:{title:"Statistic Component",description:"Statistical display with value and label"},table:{title:"Table Component",description:"Tabular data display with headers and rows",enhanceForRichContent:!0},list:{title:"List Component",description:"Ordered or unordered list with nested items"},highcharts:{title:"Highcharts Component",description:"Charts powered by Highcharts (line, bar, pie, heatmap, etc.) with rich configuration"},visual:{title:"Visual Component",description:\'Free-canvas graphic: a rasterized pptx slide, or a native Word drawing group with renderMode "native"\'}},uy={alignment:{title:"Alignment",description:"Text alignment options"},"base-component":{title:"Base Component Props",description:"Common props for all components"},border:{title:"Border",description:"Border styling configuration"},spacing:{title:"Spacing",description:"Spacing configuration for before and after elements"},margins:{title:"Margins",description:"Margin configuration for all sides"},indent:{title:"Indent",description:"Indentation configuration"},"line-spacing":{title:"Line Spacing",description:"Line height and spacing configuration"},"heading-level":{title:"Heading Level",description:"Heading level from 1 to 6"},numbering:{title:"Numbering",description:"Numbering configuration for ordered lists"},"justified-alignment":{title:"Justified Alignment",description:"Justified text alignment options"}},dy={theme:{title:"Theme Configuration",description:"JSON theme configuration for document styling and appearance"}};function fy(e={}){return n.Union(Tr.map(t=>nL(e,t,t!==Ja)),{description:"Document definition, discriminated by the optional renderer field. Omitted renderer means docxjs."})}function nL(e,t,r){let{includeStandardComponents:i=!0,customComponents:o=[],title:a="JSON Report Definition",description:s="JSON report definition with TypeBox schemas"}=e,c=[],l=[],p=nn(t),m=n.Recursive(f=>{let O=[];for(let I of o)if(I.versionedProps&&I.versionedProps.length>0){let v=I.versionedProps,D=ut(v.map(te=>te.version));for(let te of v){let P=te.description||I.description,Z={name:n.Literal(I.name),id:n.Optional(n.String()),version:P?n.Literal(te.version,{description:P}):n.Literal(te.version),props:te.propsSchema};te.hasChildren&&(Z.children=n.Optional(n.Array(f)));let _e=te.description?`${I.name} v${te.version} \\u2014 ${te.description}`:I.description?`${I.name} v${te.version} \\u2014 ${I.description}`:`${I.name} v${te.version}`;O.push(n.Object(Z,{additionalProperties:!1,description:_e}))}let ye=v.find(te=>te.version===D),Le={name:n.Literal(I.name),id:n.Optional(n.String()),props:ye.propsSchema};ye.hasChildren&&(Le.children=n.Optional(n.Array(f)));let He=ye.description?`${I.name} (latest: v${D}) \\u2014 ${ye.description}`:I.description?`${I.name} (latest: v${D}) \\u2014 ${I.description}`:`${I.name} (latest: v${D})`;O.push(n.Object(Le,{additionalProperties:!1,description:He}))}else{let v=!!I.hasChildren,D={name:n.Literal(I.name),id:n.Optional(n.String()),props:I.propsSchema};v&&(D.children=n.Optional(n.Array(f))),O.push(n.Object(D,{additionalProperties:!1,...I.description?{description:I.description}:{}}))}let{schemas:w,byName:S}=i?Dc(f,O,{renderer:t,requireDiscriminator:r}):{schemas:[],byName:new Map};c=["section",...Qa("section")?.allowedChildren??[]].map(I=>S.get(I)).filter(I=>I!==void 0),l=O;let N=[...w,...O];if(N.length===0)return n.Any();if(N.length===1)return N[0];{let I=o.length>0?"Component definition with discriminated union including custom components":"Component definition with discriminated union";return n.Union(N,{discriminator:{propertyName:"name"},description:I})}},{$id:p}),u=Qa("docx");if(!u)throw new Error("Docx root component not found in registry");if(c.length===0)throw new Error("Root child schemas not found in narrowed standard schemas");return n.Object({name:n.Literal("docx"),id:n.Optional(n.String()),$schema:n.Optional(n.String({format:"uri"})),renderer:r?n.Literal(t,{description:"Renderer backend for this document"}):n.Optional(n.Literal(t,{description:\'Renderer backend. Omitted defaults to "docxjs".\'})),props:n.Optional(Rc(u.name,u.propsSchema,t)),children:n.Array(n.Union([...c,...l],{discriminator:{propertyName:"name"}}))},{additionalProperties:!1,title:a,description:s,definitions:{[p]:m}})}var Bc=n.Union([...sy(n.Any())],{discriminator:{propertyName:"name"},description:"Standard component definition with discriminated union"}),dt=n.Recursive(e=>{let{roots:t,flow:r}=Dc(e);return n.Union([...t,r],{discriminator:{propertyName:"name"},description:"Component definition with discriminated union"})});var nu=n.Object({content:n.String({description:"Text content (required)"}),spaceAfter:n.Optional(n.Number({minimum:0,description:"Spacing after text in points"})),fontSize:n.Optional(n.Number({minimum:1})),fontFamily:n.Optional(n.String()),bold:n.Optional(n.Boolean()),fontWeight:n.Optional(n.Integer({minimum:100,maximum:900})),italic:n.Optional(n.Boolean()),underline:n.Optional(n.Boolean()),color:n.Optional(n.String({pattern:"^#[0-9A-Fa-f]{6}$"})),alignment:n.Optional(n.Union([n.Literal("left"),n.Literal("center"),n.Literal("right"),n.Literal("justify")]))}),iu=n.Object({name:n.Literal("text-space-after"),id:n.Optional(n.String()),props:nu}),Pr=iu;function iL(e,t){let r=String(e.type||""),i=e.path||"root";return r==="62"||r==="union"?oL(e):e.message?.includes("additionalProperties")?aL(e):e.message?.includes("Required property")?sL(e):r==="string"||r==="number"||r==="boolean"||r==="array"||r==="object"?cL(e):r==="literal"?lL(e):r==="pattern"||r==="RegExp"?pL(e):`At ${i}: ${e.message}`}function oL(e){let t=e.path||"root",r=e.value;if(t==="root"||t==="/"||t==="/jsonDefinition"){if(r&&typeof r=="object"){if("name"in r){let o=r.name;return o==="docx"?"Document structure appears valid but contains invalid component configurations. Check each component for errors.":`Unknown document name \'${o}\'. Expected \'docx\'.`}let i=r;if("children"in r&&Array.isArray(i.children))return`Document is missing required \'name\' field. Add "name": "docx" at the root level.`;if("name"in r||"styles"in r)return"This appears to be a theme configuration. Use --type theme or ensure proper document structure."}return\'Invalid document structure. Expected a document with name="docx" or a theme configuration.\'}return t.includes("/children/")?r&&typeof r=="object"&&"name"in r?`Invalid component configuration for type \'${r.name}\'. Check that all required fields are present and correctly formatted.`:\'Invalid component structure. Each component must have a "name" field and valid configuration.\':`Value at ${t} doesn\'t match any of the expected formats. Check the structure and required fields.`}function aL(e){let t=e.path||"root",r=e.value;if(typeof r=="object"&&r!==null){let i=e.schema;if(i&&qt(i)){let o=Sr(i),s=Object.keys(r).filter(c=>!o.includes(c));if(s.length>0)return`Unknown properties at ${t}: ${s.join(", ")}. Allowed properties are: ${o.join(", ")}`}}return`Additional properties not allowed at ${t}. Check for typos or unsupported fields.`}function sL(e){let t=e.path||"root",r=e.message?.match(/Required property \'([^\']+)\'/);return r?`Missing required field \'${r[1]}\' at ${t}. This field is mandatory for this configuration.`:`Missing required property at ${t}. Check that all mandatory fields are present.`}function cL(e){let t=e.path||"root",r=String(e.type),i=Array.isArray(e.value)?"array":typeof e.value;return t.includes("alignment")?`Invalid alignment value at ${t}. Expected one of: left, center, right, justify`:t.includes("color")?`Invalid color value at ${t}. Use hex format (#RRGGBB), rgb(r,g,b), or a named color`:t.includes("fontSize")||t.includes("size")?`Invalid size value at ${t}. Expected a number (in points)`:t.includes("margin")||t.includes("padding")||t.includes("spacing")?`Invalid spacing value at ${t}. Expected a number or spacing object with top/bottom/left/right`:`Type mismatch at ${t}: Expected ${r} but got ${i}`}function lL(e){let t=e.path||"root",r=e.schema?JSON.stringify(St(e.schema)):"specific value",i=JSON.stringify(e.value);return`Invalid value at ${t}: Expected exactly ${r} but got ${i}`}function pL(e){let t=e.path||"root";return t.includes("email")?`Invalid email format at ${t}. Use format: user@example.com`:t.includes("url")||t.includes("link")?`Invalid URL format at ${t}. Use format: https://example.com`:t.includes("date")?`Invalid date format at ${t}. Use ISO format: YYYY-MM-DD`:t.includes("phone")?`Invalid phone number format at ${t}`:`Value at ${t} doesn\'t match the required pattern`}function lu(e,t,r){let i=Ir(r),o=iL(e,i),a={path:e.path||"root",message:xr(o||e.message,i),code:String(e.type||"validation_error"),value:e.value};if(i.includeSuggestions){let s=uL(e,i);s&&(a.suggestion=xr(s,i))}if(t&&e.path){let s=mL(t,e.path);s&&(a.line=s.line,a.column=s.column)}return a}function pu(e,t){let r=t?.maxErrors??Number.MAX_SAFE_INTEGER,i=[],o=new Set;for(let a of e){if(i.length>=r)break;let s=`${a.path}:${a.type}`;o.has(s)||(o.add(s),i.push(lu(a,t?.jsonString,void 0)))}return i}function mL(e,t){try{let r=t.split("/").filter(Boolean);if(r.length===0)return{line:1,column:1};let o=`"${r[r.length-1]}"`,a=e.indexOf(o);if(a===-1)return{line:1,column:1};let c=e.substring(0,a).split(`\n`),l=c.length,p=c[c.length-1].length+1;return{line:l,column:p}}catch{return null}}function uL(e,t){let{type:r,path:i,value:o}=e,a=String(r);if(a==="62"||a==="union"){if(i==="root"||i==="/"){if(o&&typeof o=="object"){if(!("name"in o)){let s=\'Add a "name" field with value "docx" for documents\';return t.includeEmojis?`${fi.FIX} ${s}`:s}if("props"in o&&typeof o.props=="object")return`Review the props section for unsupported fields. Allowed fields: ${Sr(fn).join(", ")}`}return\'Ensure the document has proper structure: { "name": "docx", "props": {...}, "children": [...] }\'}return i?.includes("/children/")?\'Check that the component has a valid "name" and all required fields for that component type\':"Review the structure and ensure all required fields are present with correct types"}if(e.message?.includes("additionalProperties"))return"Remove any unknown or unsupported fields. Check documentation for allowed properties.";if(e.message?.includes("Required property"))return"Add the missing required field to fix this error";if(a==="string")return i?.includes("alignment")?"Use one of: left, center, right, justify":i?.includes("color")?"Use a valid color format (hex: #RRGGBB, rgb: rgb(r,g,b), or named color)":"Provide a text string value";if(a==="number")return i?.includes("fontSize")||i?.includes("size")?"Use a number in points (e.g., 12, 14, 16)":i?.includes("margin")||i?.includes("padding")?"Use a number for spacing in points":"Provide a numeric value";if(a==="boolean")return"Use true or false (without quotes)";if(a==="array")return i?.includes("children")?\'Provide an array of component objects, each with a "name" field\':"Provide an array/list of values using square brackets []";if(a==="object")return"Provide an object with key-value pairs using curly braces {}";if(a==="literal")return`Use exactly this value: ${e.schema?JSON.stringify(St(e.schema)):"specific value"}`;if(a==="pattern"||a==="RegExp")return i?.includes("email")?"Use valid email format: user@example.com":i?.includes("url")?"Use valid URL format: https://example.com":i?.includes("date")?"Use ISO date format: YYYY-MM-DD":"Ensure the value matches the required format";if(i?.includes("name")||i?.includes("type"))return"Use a valid component name: docx, section, columns, heading, paragraph, image, statistic, table, list, toc, text-box, highcharts, or visual"}var dL=Object.fromEntries([...Tt.map(e=>[e.name,e.propsSchema]),["custom",Pr]]),fL=new Map(Tt.filter(e=>(e.embeddedComponents?.length??0)>0).map(e=>[e.name,e.embeddedComponents])),ou=new Set(Tt.filter(e=>!!e.special?.hasSchemaField).map(e=>e.name)),hL=new Map(Tt.map(e=>[e.name,new Set(["name","id","enabled","props",...e.hasChildren?["children"]:[],...e.special?.hasSchemaField?["$schema","renderer"]:[]])])),gL={id:"string",enabled:"boolean",$schema:"string",renderer:"string"};function gy(e,t,r,i){let o=typeof e.name=="string"?hL.get(e.name):void 0;if(o)for(let a of Object.keys(e)){if(!o.has(a)){if(r.allowUnknownFields)continue;i.push({path:`${t}/${a}`,message:`Unknown key "${a}" on component "${e.name}". Allowed keys: ${[...o].join(", ")}.`,code:"unknown_key"});continue}let s=gL[a];s&&typeof e[a]!==s&&i.push({path:`${t}/${a}`,message:`Key "${a}" on component "${e.name}" must be a ${s}.`,code:"invalid_type"})}}var yL=["path","base64","svg"];function bL(e){if(!e||typeof e!="object")return[];let t=e;return yL.filter(r=>{let i=t[r];return typeof i=="string"&&i.trim().length>0})}function OL(e){let t=[],r=(i,o)=>{if(Array.isArray(i)){i.forEach((a,s)=>r(a,`${o}/${s}`));return}if(!(!i||typeof i!="object")){if(i.name==="image"){let a=bL(i.props);a.length>1&&t.push({path:`${o}/props`,message:`Image component accepts only one source, but found ${a.map(s=>`"${s}"`).join(", ")}. Use exactly one of "path", "base64", or "svg".`,code:"mutually_exclusive"})}for(let a of Object.keys(i))r(i[a],`${o}/${a}`)}};return r(e,""),t}var xL=new Set(["paragraph","heading"]);function mu(e){let t=[],r=(i,o)=>{if(Array.isArray(i)){i.forEach((a,s)=>r(a,`${o}/${s}`));return}if(!(!i||typeof i!="object")){if(xL.has(i.name)){let a=i.props?.indent;a&&typeof a=="object"&&a.hanging!==void 0&&a.firstLine!==void 0&&t.push({path:`${o}/props/indent`,message:\'Indent accepts either "hanging" or "firstLine", not both. Use exactly one of the two.\',code:"mutually_exclusive"})}for(let a of Object.keys(i))r(i[a],`${o}/${a}`)}};return r(e,""),t}function uu(e){let t=[],r=(i,o)=>{if(Array.isArray(i)){i.forEach((s,c)=>r(s,`${o}/${c}`));return}if(!i||typeof i!="object")return;let a=[];if(i.name==="paragraph"&&i.props?.revision)for(let s of["footnotes","endnotes"])a.push({notes:i.props[s],path:`${o}/props/${s}`});if(i.revision&&i.content?.name==="paragraph")for(let s of["footnotes","endnotes"])a.push({notes:i.content.props?.[s],path:`${o}/content/props/${s}`});for(let{notes:s,path:c}of a)if(Array.isArray(s)&&s.length>0){let l=c.endsWith("endnotes")?"endnotes":"footnotes";t.push({path:c,message:`"revision" and "${l}" cannot apply to the same text. Tracked-change text renders literally, so note markers inside it are not resolved and the note bodies would be dropped. Move the notes to text without a revision.`,code:"mutually_exclusive"})}for(let s of Object.keys(i))r(i[s],`${o}/${s}`)};return r(e,""),t}var SL=new Set(["dashed","dotted","double"]);function du(e){let t=[],r=(i,o)=>{if(Array.isArray(i)){i.forEach((a,s)=>r(a,`${o}/${s}`));return}if(!(!i||typeof i!="object")){if(i.name==="text-box"&&i.props?.renderAs==="shape"){let a=["width","height"].filter(c=>i.props[c]===void 0);a.length>0&&t.push({path:`${o}/props/${a[0]}`,message:`A text-box with renderAs "shape" requires ${a.join(" and ")}: a shape has no autofit, so its size cannot be derived from its content. Give it an explicit size, or use renderAs "table", which grows to fit.`,code:"required"});let s=i.props.style?.border;if(s&&typeof s=="object")for(let c of["top","right","bottom","left"]){let l=s[c]?.style;typeof l=="string"&&SL.has(l)&&t.push({path:`${o}/props/style/border/${c}/style`,message:`A text-box with renderAs "shape" cannot draw a "${l}" border: a shape outline carries no dash pattern. Use "solid", or use renderAs "table", which draws every border style.`,code:"unsupported_value"})}}for(let a of Object.keys(i))r(i[a],`${o}/${a}`)}};return r(e,""),t}function fu(e,t={}){let r=[];if(!e||typeof e!="object")return r.push({path:"root",message:"Document must be an object",code:"invalid_type"}),r;if(!e.name)r.push({path:"/name",message:\'Missing required field "name"\',code:"required_property"});else if(!ou.has(e.name)){let i=[...ou].map(o=>`"${o}"`).join(", ");r.push({path:"/name",message:`Invalid name "${e.name}". Expected ${i}`,code:"invalid_value"})}if(gy(e,"",t,r),ou.has(e.name)&&"props"in e){let i=su(e.name,e.props,"/props",t);r.push(...i)}return e.children?Array.isArray(e.children)||r.push({path:"/children",message:\'Field "children" must be an array\',code:"invalid_type"}):r.push({path:"/children",message:\'Missing required field "children"\',code:"required_property"}),yy(e,"",t,r),r}function yy(e,t,r,i){if(!e||typeof e!="object")return;let o=(s,c,l)=>{if(!s||typeof s!="object"){l&&i.push({path:c,message:"Component must be an object",code:"invalid_type"});return}if(typeof s.name!="string"||s.name.length===0){l&&i.push({path:`${c}/name`,message:\'Component missing required field "name"\',code:"required_property"});return}r.knownCustomNames?.has(s.name)||(gy(s,c,r,i),"props"in s?i.push(...su(s.name,s.props,`${c}/props`,r)):s.name!=="custom"&&i.push(...su(s.name,{},`${c}/props`,r)),yy(s,c,r,i))},a=typeof e.name=="string"?fL.get(e.name):void 0;if(a&&e.props&&typeof e.props=="object")for(let s of a)au(e.props,s.path,`${t}/props`,(c,l)=>{s.arity==="component-array"?Array.isArray(c)&&c.forEach((p,m)=>o(p,`${l}/${m}`,s.reportStructure)):c&&typeof c=="object"&&!Array.isArray(c)&&o(c,l,s.reportStructure)});Array.isArray(e.children)?e.children.forEach((s,c)=>o(s,`${t}/children/${c}`,!0)):e.children!=null&&t!==""&&i.push({path:`${t}/children`,message:\'Field "children" must be an array\',code:"invalid_type"})}function au(e,t,r,i){if(t.length===0){i(e,r);return}if(!e||typeof e!="object")return;let[o,...a]=t;if(o==="*"){if(!Array.isArray(e))return;e.forEach((s,c)=>au(s,a,`${r}/${c}`,i));return}au(e[o],a,`${r}/${o}`,i)}function su(e,t,r,i={}){let o=[],a=dL[e];if(!a)return o.push({path:r.replace(/\\/props$/,"/name"),message:`Unknown component "${e}"`,code:"unknown_component"}),o;let s=IL(a,t),c=i.allowUnknownFields?T.Clean(s,T.Clone(t)):t;if(!T.Check(s,c)){let l=[...T.Errors(s,c)];pu(l,{maxErrors:100}).forEach(m=>{let u=m.path==="root"?r:`${r}${m.path.startsWith("/")?m.path:"/"+m.path}`;o.push({...m,path:u})})}return o}function IL(e,t){let r=e.anyOf;if(!Array.isArray(r)||r.length===0)return e;let i=r.filter(c=>wL(c,t));if(i.length===1)return i[0];let o=i.length>1?i:r,a=o[0],s=Number.POSITIVE_INFINITY;for(let c of o){let l=[...T.Errors(c,t)].length;l<s&&(s=l,a=c)}return a}function wL(e,t){let r=e.properties;if(!r)return!1;let i=new Set(e.required??[]),o=t??{};for(let[a,s]of Object.entries(r)){let c=s.const;if(c===void 0)continue;if(!(o[a]!==void 0)){if(i.has(a))return!1;continue}if(o[a]!==c)return!1}return!0}function hu(e,t=[],r={}){let i=fu(e,r),o=t.filter(a=>!CL(a));return TL([...o,...i])}function CL(e){if(!(!e.path||e.path==="root"||e.path==="/"))return!1;let r=e.message||"";return/invalid component configurations?/i.test(r)||/invalid document structure/i.test(r)}function TL(e){let t=new Set,r=[];for(let i of e){let o=`${i.path}:${i.message}`;t.has(o)||(t.add(o),r.push(i))}return r}function Pt(e,t,r){try{if(!T.Check(e,t)){let o=[...T.Errors(e,t)];return{valid:!1,errors:tt(o,{jsonString:r?.jsonString,maxErrors:r?.maxErrors||100})}}let i=t;return r?.clean&&(i=T.Clean(e,T.Clone(i))),r?.applyDefaults&&(i=T.Default(e,i)),{valid:!0,data:i}}catch(i){return{valid:!1,errors:[{path:"root",message:i instanceof Error?i.message:"Unknown validation error",code:"validation_exception"}]}}}function ao(e,t,r){if(typeof t=="string"){if(!t.trim())return{valid:!1,errors:[{path:"root",message:"Input must be a non-empty string",code:"empty_input"}],isJsonError:!0};let o;try{o=JSON.parse(t)}catch(s){return s instanceof Error?{valid:!1,errors:[hi(s,t)],isJsonError:!0}:{valid:!1,errors:[{path:"root",message:"Failed to parse JSON",code:"json_parse_error"}],isJsonError:!0}}return{...Pt(e,o,{...r,jsonString:t,calculatePosition:!0}),parsed:o,isJsonError:!1}}return{...Pt(e,t,r),parsed:t,isJsonError:!1}}function by(e,t,r){let i=[],o=[],a=!1;for(let s=0;s<t.length;s++){let c=Pt(e,t[s],r);if(c.valid&&c.data)i.push(c.data);else if(a=!0,c.errors){let l=c.errors.map(p=>({...p,path:`[${s}]${p.path?"/"+p.path:""}`}));o.push(...l)}if(r?.maxErrors&&o.length>=r.maxErrors)break}return a?{valid:!1,errors:o.slice(0,r?.maxErrors)}:{valid:!0,data:i}}function Oy(e,t,r,i){let o=Pt(e,t,i);return!o.valid&&o.errors&&(o.errors=r(o.errors)),o}function xy(e,t){return(r,i)=>Pt(e,r,{...t,...i})}function Sy(e,t){return(r,i)=>ao(e,r,{...t,...i})}function Iy(e){return e.valid===!0&&e.data!==void 0}function wy(e){return e.valid?"Validation successful":!e.errors||e.errors.length===0?"Validation failed with unknown error":Yr(e.errors)}var PL=dt,EL=[{why:"image source mutual-exclusivity",collect:OL},{why:"indent hanging/firstLine mutual-exclusivity",collect:mu},{why:"notes on a revised paragraph",collect:uu},{why:"a text box asking for a shape rendering a shape cannot give it",collect:du},{why:"renderer profile compatibility",collect:kc}];function Cy(e){return EL.flatMap(({collect:t})=>t(e))}function cu(e,t){if(Array.isArray(e))return e.some(i=>cu(i,t));if(!e||typeof e!="object")return!1;let r=e;return typeof r.name=="string"&&t.has(r.name)?!0:Object.values(r).some(i=>cu(i,t))}var hy;function AL(){return hy??(hy=n.Recursive(e=>n.Union(Tt.map(t=>Ti(t,e,e))))),hy}function $L(e,t,r){return r?.allowUnknownFields===!0||r?.knownCustomNames!==void 0&&r.knownCustomNames.size>0&&cu(e,r.knownCustomNames)||T.Check(AL(),e)?{valid:!0,errors:[]}:{valid:!1,errors:[...t.length>0?t:[{path:"root",message:"Document does not match the \'docx\' document schema.",code:"invalid_document"}],{path:"root",message:\'The document was rejected by the whole-document schema, but deep validation could not localize the fault. Common causes: an unknown key next to "name", "props" or "children" on some component, or a value at a position the schema does not declare.\',code:"unlocalized_schema_error"}]}}function Ty(e,t,r){let i=hu(e,t,{allowUnknownFields:r?.allowUnknownFields,knownCustomNames:r?.knownCustomNames});return i.length===0?$L(e,t,r):{valid:!1,errors:i}}function Vc(e,t){let r=Pt(dt,e,t),i=r.errors||[],o=r.valid;!r.valid&&e&&({valid:o,errors:i}=Ty(e,r.errors||[],t));let a=[...Cy(e),...Yi(e,Xr(e),"docx",[...t?.knownCustomNames??[]])];a.length>0&&(i=[...i,...a],o=!1);let s=r.data??(o?e:void 0),c={...r,valid:o,documentType:"docx",errors:i,data:s};if(o){let l=s;if(l&&l.children&&Array.isArray(l.children)){let p=l.children.some(m=>!Ey(m.name));c.hasCustomComponents=p}}return c}function Kc(e,t){let r=ao(PL,e,t),i=r.errors||[],o=r.valid;!r.valid&&r.parsed&&({valid:o,errors:i}=Ty(r.parsed,r.errors||[],t));let a=[...Cy(r.parsed),...Yi(r.parsed,Xr(r.parsed),"docx",[...t?.knownCustomNames??[]])];a.length>0&&(i=[...i,...a],o=!1);let s=r.data??(o?r.parsed:void 0),c={...r,valid:o,documentType:"docx",errors:i,data:s};if(o){let l=s;if(l&&l.children&&Array.isArray(l.children)){let p=l.children.some(m=>!Ey(m.name));c.hasCustomComponents=p}}return c}function Py(e){return e.valid===!0&&e.data!==void 0}function vL(){return di(Bc)}function Ey(e){return vL().includes(e)}function Gc(e){return{validate:(t,r)=>Vc(t,{...e,...r}),validateJson:(t,r)=>Kc(t,{...e,...r})}}var so=Gc({clean:!0,applyDefaults:!0,maxErrors:100}),Xa=Gc({clean:!1,applyDefaults:!1,maxErrors:100}),Ay=Kc,$y=Vc;function LL(){return{includeEmojis:!Ly(),verbosity:"normal",includeSuggestions:!0,includePath:!0,maxMessageLength:0,includeDocLinks:!1,colorSupport:NL()}}var hz=LL(),vy={UNION_NO_MATCH:"Value doesn\'t match any of the expected formats",TYPE_MISMATCH:"Expected {expected} but got {actual}",MISSING_REQUIRED:"Missing required field \'{field}\'",UNKNOWN_PROPERTY:"Unknown property \'{property}\'",INVALID_FORMAT:"Invalid {type} format",PATTERN_MISMATCH:"Value doesn\'t match the required pattern"};function Ly(){return typeof process>"u"||!process.env?!1:!!(process.env.CI||process.env.CONTINUOUS_INTEGRATION||process.env.GITHUB_ACTIONS||process.env.GITLAB_CI||process.env.CIRCLECI||process.env.TRAVIS||process.env.JENKINS_URL)}function NL(){return typeof process>"u"||process.env?.NO_COLOR?!1:process.env?.FORCE_COLOR||process.stdout?.isTTY?!0:!Ly()}function Hc(e,t){if(typeof e=="string")return{valid:!0,themeName:e};let r=Pt(oo,e,t),i={...r};if(r.valid&&r.data){let o=r.data;o.name&&(i.themeName=o.name)}return i}function gu(e,t){let r=ao(oo,e,t),i={...r};if(r.valid&&r.data){let o=r.data;typeof o=="object"&&!o.$schema&&(o.$schema="./json-schemas/theme.schema.json"),o.name&&(i.themeName=o.name)}return i}function yu(e,t){let r=Hc(e,t);return!r.valid&&r.errors&&(r.errors=r.errors.map(i=>(i.path.includes("colors")&&!i.suggestion&&(i.suggestion="Colors must be valid hex, rgb, or named colors"),i.path.includes("fonts")&&!i.suggestion&&(i.suggestion="Fonts must include size and family properties"),i.path.includes("headings")&&!i.suggestion&&(i.suggestion="Headings must be an array of 6 style definitions"),i))),r}function Ny(e){return e.valid===!0&&e.data!==void 0}function zc(e){return{validate:(t,r)=>Hc(t,{...e,...r}),validateJson:(t,r)=>gu(t,{...e,...r}),validateWithEnhancement:(t,r)=>yu(t,{...e,...r})}}var Za=zc({clean:!0,applyDefaults:!0}),qc=zc({clean:!1,applyDefaults:!1,maxErrors:10});function Ry(e){if(typeof e=="string")return e;if(typeof e=="object"&&e!==null&&"name"in e){let t=e;if(typeof t.name=="string")return t.name}}function ky(e){if(!e||typeof e!="object")return!1;let t=e;return!!(t.colors&&t.fonts)}var Fy={report:fn,section:pn,heading:on,paragraph:an,columns:mn,image:sn,statistic:cn,table:ln,list:un,custom:Pr};function lo(e,t,r){let i=Fy[e];if(!i){let a=Pt(Pr,t,r);return{...a,success:a.valid,componentName:e,isCustomComponent:!0}}let o=Pt(i,t,r);return{...o,success:o.valid,componentName:e,isCustomComponent:e==="custom"}}function bu(e,t){let r=Pt(dt,e,t),i={...r};if(r.valid&&r.data){let o=r.data;i.componentName=o.name,i.isCustomComponent=!po(o.name)}return i}function Ou(e,t,r){return Nn(e,t,r)}function po(e){return e in Fy}function jy(e){return T.Check(fn,e)}function Uy(e){return T.Check(pn,e)}function _y(e){return T.Check(on,e)}function Dy(e){return T.Check(an,e)}function My(e){return T.Check(mn,e)}function By(e){return T.Check(sn,e)}function Vy(e){return T.Check(cn,e)}function Ky(e){return T.Check(ln,e)}function Gy(e){return T.Check(un,e)}function qy(e){return T.Check(Pr,e)}function Jc(e){return{validate:(t,r,i)=>po(t)?lo(t,r,{...e,...i}):lo("custom",r,{...e,...i}),validateDefinition:(t,r)=>bu(t,{...e,...r}),validateCustom:(t,r,i)=>Ou(t,r,{...e,...i})}}var co=Jc({clean:!0,applyDefaults:!0}),Wc=Jc({clean:!1,applyDefaults:!1,maxErrors:10}),Wy={document:e=>so.validate(e),jsonDocument:e=>so.validateJson(e),theme:e=>Za.validate(e),jsonTheme:e=>Za.validateJson(e),component:(e,t)=>co.validate(e,t),componentDefinition:e=>co.validateDefinition(e),components:e=>e.map(t=>co.validate(t.name,t.props)),isDocument:e=>so.validate(e).valid,isTheme:e=>Za.validate(e).valid,isComponent:(e,t)=>co.validate(e,t).valid},Hy={document:e=>Xa.validate(e),jsonDocument:e=>Xa.validateJson(e),theme:e=>qc.validate(e),jsonTheme:e=>qc.validateJson(e),component:(e,t)=>Wc.validate(e,t),componentDefinition:e=>Wc.validateDefinition(e)};var zy=n.Object({definition:dt,format:n.Optional(n.Union([n.Literal("docx"),n.Literal("pdf"),n.Literal("html")])),options:n.Optional(n.Object({includeMetadata:n.Optional(n.Boolean()),includeComments:n.Optional(n.Boolean({deprecated:!0,description:"Deprecated and ignored. Comments are authored per component via the `comment` prop."})),trackChanges:n.Optional(n.Boolean())},{additionalProperties:!0}))},{additionalProperties:!1,description:"Document generation request"}),Jy=n.Object({definition:n.Unknown(),strict:n.Optional(n.Boolean())},{additionalProperties:!1,description:"Document validation request"}),Yy=n.Object({success:n.Boolean(),documentId:n.Optional(n.String()),downloadUrl:n.Optional(n.String()),error:n.Optional(n.String()),metadata:n.Optional(n.Object({pageCount:n.Optional(n.Number()),wordCount:n.Optional(n.Number()),generatedAt:n.Optional(n.String({format:"date-time"}))},{additionalProperties:!0}))},{additionalProperties:!1,description:"Document generation response"}),Qy=n.Object({valid:n.Boolean(),errors:n.Array(n.Object({path:n.String(),message:n.String(),code:n.Optional(n.String())})),warnings:n.Optional(n.Array(n.Object({path:n.String(),message:n.String(),code:n.Optional(n.String())})))},{additionalProperties:!1,description:"Document validation response"});var Xy=dt,Zy={report:"./json-schemas/components/report.schema.json",section:"./json-schemas/components/section.schema.json",columns:"./json-schemas/components/columns.schema.json",heading:"./json-schemas/components/heading.schema.json",paragraph:"./json-schemas/components/paragraph.schema.json",image:"./json-schemas/components/image.schema.json",statistic:"./json-schemas/components/statistic.schema.json",table:"./json-schemas/components/table.schema.json",header:"./json-schemas/components/header.schema.json",footer:"./json-schemas/components/footer.schema.json",list:"./json-schemas/components/list.schema.json",alignment:"./json-schemas/base/alignment.schema.json",baseComponent:"./json-schemas/base/base-component.schema.json",border:"./json-schemas/base/border.schema.json",spacing:"./json-schemas/base/spacing.schema.json",margins:"./json-schemas/base/margins.schema.json",index:"./json-schemas/index.schema.json"};var RL=1e6;function eb(e){return e?e.split(/(\\s+)/).filter(t=>t.length>0):[]}function Yc(e){let t=[];for(let r of e){if(!r.text)continue;let i=t[t.length-1];i&&i.type===r.type?i.text+=r.text:t.push({...r})}return t}function kL(e){let t=[];for(let o=0;o<e.length;o++){let a=e[o];if(a.type==="equal"&&/^\\s+$/.test(a.text)){let s=t[t.length-1],c=e[o+1];if(s&&s.type!=="equal"&&c&&c.type!=="equal"){t.push({type:"delete",text:a.text},{type:"insert",text:a.text});continue}}t.push({...a})}let r=[],i=0;for(;i<t.length;){if(t[i].type==="equal"){r.push(t[i]),i++;continue}let o="",a="";for(;i<t.length&&t[i].type!=="equal";)t[i].type==="delete"?o+=t[i].text:a+=t[i].text,i++;o&&r.push({type:"delete",text:o}),a&&r.push({type:"insert",text:a})}return Yc(r)}function rl(e,t){if(e===t)return e?[{type:"equal",text:e}]:[];let r=eb(e),i=eb(t);if(r.length===0)return Yc([{type:"insert",text:t}]);if(i.length===0)return Yc([{type:"delete",text:e}]);if(r.length*i.length>RL)return Yc([{type:"delete",text:e},{type:"insert",text:t}]);let o=r.length,a=i.length,s=Array.from({length:o+1},()=>new Int32Array(a+1));for(let m=o-1;m>=0;m--)for(let u=a-1;u>=0;u--)s[m][u]=r[m]===i[u]?s[m+1][u+1]+1:Math.max(s[m+1][u],s[m][u+1]);let c=[],l=0,p=0;for(;l<o&&p<a;)r[l]===i[p]?(c.push({type:"equal",text:r[l]}),l++,p++):s[l+1][p]>=s[l][p+1]?(c.push({type:"delete",text:r[l]}),l++):(c.push({type:"insert",text:i[p]}),p++);for(;l<o;)c.push({type:"delete",text:r[l]}),l++;for(;p<a;)c.push({type:"insert",text:i[p]}),p++;return kL(c)}function ts(e){return e.replace(/\\[([^\\]]+)\\]\\(([^)]+)\\)/g,"$1").replace(/(\\*\\*\\*|___)([\\s\\S]*?)\\1|(\\*\\*|__)([\\s\\S]*?)\\3|(\\*|_)([\\s\\S]*?)\\5/g,(t,r,i,o,a,s,c)=>i??a??c??"")}var Tu=new Set(["paragraph","heading"]);function lr(e,t){return JSON.stringify(e)===JSON.stringify(t)}function Kn(e,t){return{...e.author&&{author:e.author},...e.date&&{date:e.date},segments:t}}function es(e){let t=e.props?.text;return typeof t=="string"?t.normalize("NFC"):""}function Qc(e){return ts(es(e))}var FL=/\\{[^}]+\\}/;function Xc(e){return e.enabled!==!1}function os(e,t,r,i){e.some(o=>o.type!=="equal"&&FL.test(o.text))&&i.summary.untracked.push({path:t,kind:"modified",component:r,detail:"placeholder (e.g. {DATE}) inside inserted/deleted text renders literally in the redline"})}function Gn(e,...t){let r={...e||{}};for(let i of t)delete r[i];return r}var jL=4e6;function Pu(e,t,r){let i=e.map(r),o=t.map(r),a=0;for(;a<e.length&&a<t.length&&i[a]===o[a];)a++;let s=e.length,c=t.length;for(;s>a&&c>a&&i[s-1]===o[c-1];)s--,c--;let l=[];for(let x=0;x<a;x++)l.push({op:"equal",oldItem:e[x],newItem:t[x]});let p=[];for(let x=0;x<e.length-s;x++)p.push({op:"equal",oldItem:e[s+x],newItem:t[c+x]});let m=s-a,u=c-a,f=[];if(m*u>jL){for(let x=0;x<m;x++)f.push({op:"delete",oldItem:e[a+x]});for(let x=0;x<u;x++)f.push({op:"insert",newItem:t[a+x]});return[...l,...f,...p]}let O=Array.from({length:m+1},()=>new Int32Array(u+1));for(let x=m-1;x>=0;x--)for(let N=u-1;N>=0;N--)O[x][N]=i[a+x]===o[a+N]?O[x+1][N+1]+1:Math.max(O[x+1][N],O[x][N+1]);let w=0,S=0;for(;w<m&&S<u;)i[a+w]===o[a+S]?(f.push({op:"equal",oldItem:e[a+w],newItem:t[a+S]}),w++,S++):O[w+1][S]>=O[w][S+1]?(f.push({op:"delete",oldItem:e[a+w]}),w++):(f.push({op:"insert",newItem:t[a+S]}),S++);for(;w<m;)f.push({op:"delete",oldItem:e[a+w++]});for(;S<u;)f.push({op:"insert",newItem:t[a+S++]});return[...l,...f,...p]}function Eu(e,t,r){let i=new Array(e.length).fill(!1),o=new Array(t.length).fill(-1),a=0;for(let p=0;p<t.length;p++)for(let m=a;m<e.length;m++)if(!i[m]&&r(e[m],t[p])){i[m]=!0,o[p]=m,a=m+1;break}let s=[],c=[],l=0;for(let p=0;p<t.length;p++){let m=o[p];if(m>=0){for(;l<m;)i[l]||s.push({kind:"deleted",oldItem:e[l]}),l++;l=m+1,s.push({kind:"paired",oldItem:e[m],newItem:t[p]}),c.push({oldItem:e[m],newItem:t[p]})}else s.push({kind:"inserted",newItem:t[p]})}for(let p=l;p<e.length;p++)i[p]||s.push({kind:"deleted",oldItem:e[p]});return{pairs:c,plan:s}}function UL(e,t,r,i){let o=Qc(e),a=Qc(t),s=!lr(Gn(e.props,"text","revision","comment"),Gn(t.props,"text","revision","comment"));if(s&&i.summary.untracked.push({path:r,kind:"modified",component:t.name,detail:"formatting/props changed (not expressible as a tracked change); new version rendered"}),o===a)return es(e)!==es(t)?i.summary.untracked.push({path:r,kind:"modified",component:t.name,detail:"inline formatting or link target changed (markdown-only); new version rendered without a tracked change"}):s||i.summary.unchangedBlocks++,t;i.summary.tracked.modified++;let c=rl(o,a);return os(c,r,t.name,i),(es(e)!==o||es(t)!==a)&&i.summary.untracked.push({path:r,kind:"modified",component:t.name,detail:"inline formatting or links flattened to plain text in the redline (revision segments render literally)"}),{...t,props:{...nl(t,r,i),text:a,revision:Kn(i,c)}}}function nl(e,t,r){let i={...e.props??{}},o=["footnotes","endnotes"].filter(a=>{let s=i[a];return Array.isArray(s)&&s.length>0});if(o.length===0)return i;for(let a of o)delete i[a];return r.summary.untracked.push({path:t,kind:"modified",component:e.name,detail:`${o.join(" and ")} dropped from a tracked-change paragraph (note markers do not resolve inside revision text); the note bodies are not in the redline`}),i}function _L(e,t,r){r.summary.tracked.inserted++;let i=Qc(e),o=[{type:"insert",text:i}];return os(o,t,e.name,r),{...e,props:{...nl(e,t,r),text:i,revision:Kn(r,o)}}}function DL(e,t,r){r.summary.tracked.deleted++;let o=[{type:"delete",text:Qc(e)}];return os(o,t,e.name,r),{...e,props:{...nl(e,t,r),text:"",revision:Kn(r,o)}}}function xu(e){return(e.props?.items||[]).map(r=>{let i=typeof r=="string"?r:r.text,o=typeof r=="string"?0:r.level||0;return{raw:i,text:ts(i.normalize("NFC")),level:o}})}function ML(e,t,r,i){let o=!lr(Gn(e.props,"items"),Gn(t.props,"items"));o&&i.summary.untracked.push({path:r,kind:"modified",component:"list",detail:"list configuration changed (format/levels/spacing); new version rendered"});let a=xu(e),s=xu(t),c=f=>f.map(O=>({text:O.text,level:O.level}));if(lr(c(a),c(s)))return lr(a.map(f=>f.raw),s.map(f=>f.raw))?o||i.summary.unchangedBlocks++:i.summary.untracked.push({path:r,kind:"modified",component:"list",detail:"inline formatting or link target changed in list items (markdown-only); new version rendered without a tracked change"}),t;let l=Pu(a,s,f=>`${f.level}:${f.text}`),p=[],m=!1,u=0;for(;u<l.length;){let f=l[u];if(f.op==="equal"){p.push({text:f.newItem.raw,level:f.newItem.level}),u++;continue}let O=[],w=[];for(;u<l.length&&l[u].op!=="equal";){let x=l[u];x.op==="delete"?O.push(x.oldItem):x.op==="insert"&&w.push(x.newItem),u++}let{plan:S}=Eu(O,w,(x,N)=>x.level===N.level);for(let x of S)if(m=!0,x.kind==="paired"){let N=rl(x.oldItem.text,x.newItem.text);os(N,r,"list",i),p.push({text:x.newItem.text,level:x.newItem.level,revision:Kn(i,N)})}else x.kind==="inserted"?p.push({text:x.newItem.text,level:x.newItem.level,revision:Kn(i,[{type:"insert",text:x.newItem.text}])}):p.push({text:"",level:x.oldItem.level,revision:Kn(i,[{type:"delete",text:x.oldItem.text}])})}return m&&i.summary.tracked.modified++,{...t,props:{...t.props,items:p}}}function rb(e,t,r){t==="insert"?r.summary.tracked.inserted++:r.summary.tracked.deleted++;let i=xu(e).map(o=>({text:t==="insert"?o.text:"",level:o.level,revision:Kn(r,[{type:t,text:o.text}])}));return{...e,props:{...e.props,items:i}}}function Su(e){if(!e)return"";let t=e.content;if(typeof t=="string")return ts(t.normalize("NFC"));if(t&&typeof t=="object"){let i=t.props?.text;if(typeof i=="string")return ts(i.normalize("NFC"))}return""}function Iu(e){if(!e)return"";let t=e.content;if(typeof t=="string")return t.normalize("NFC");if(t&&typeof t=="object"){let r=t.props?.text;if(typeof r=="string")return r.normalize("NFC")}return""}function tb(e){if(!e)return!0;let t=e.content;return t===void 0||typeof t=="string"?!0:typeof t=="object"&&t.name==="paragraph"}function wu(e){let t=e.props?.columns??[],r=t.reduce((o,a)=>Math.max(o,a.cells?.length??0),0),i=e.props?.rows??[];return Array.from({length:r},(o,a)=>{let s=t.map(c=>c.cells?.[a]);return{cells:s,key:s.map(Su).join("\\0"),rawKey:s.map(Iu).join("\\0"),rowProps:i[a]}})}function nb(e,t,r){let i=e.props?.columns??[],o=t.map((a,s)=>({...a.rowProps??{},...r[s]}));return{...e,props:{...e.props,columns:i.map((a,s)=>({...a,cells:t.map(c=>c.cells[s]??{content:""})})),...o.some(a=>Object.keys(a).length>0)&&{rows:o}}}}function Zc(e){return Array.isArray(e.props?.columns)&&!e.props?.headers}function BL(e,t,r,i,o,a){let s=rl(r,i);os(s,o,"table",a),(Iu(t)!==r||Iu(e)!==i)&&a.summary.untracked.push({path:o,kind:"modified",component:"table",detail:"inline formatting or links flattened to plain text in a table cell (revision segments render literally)"});let c=e??{content:""};return{...c,content:VL(c.content,i,o,a),revision:Kn(a,s)}}function VL(e,t,r,i){if(!e||typeof e!="object")return t;let o=e;return{...o,props:{...nl(o,r,i),text:t}}}function KL(e,t,r,i){let o=wu(e),a=wu(t),s=e.props?.columns??[],c=t.props?.columns??[];if(s.length!==c.length)return i.summary.untracked.push({path:r,kind:"modified",component:"table",detail:"table column count changed (columns are not expressible as a tracked change); new version rendered"}),t;let l=!lr(Gn(e.props,"columns","rows"),Gn(t.props,"columns","rows"));l&&i.summary.untracked.push({path:r,kind:"modified",component:"table",detail:"table configuration changed (borders/widths/defaults); new version rendered"});let p=!lr(s.map(x=>x.header),c.map(x=>x.header));if(p&&i.summary.untracked.push({path:r,kind:"modified",component:"table",detail:"table header row changed (headers are not row content); new version rendered"}),lr(o.map(x=>x.key),a.map(x=>x.key)))return lr(o.map(x=>x.rawKey),a.map(x=>x.rawKey))?!l&&!p&&lr(o,a)&&i.summary.unchangedBlocks++:i.summary.untracked.push({path:r,kind:"modified",component:"table",detail:"inline formatting or link target changed in table cells (markdown-only); new version rendered without a tracked change"}),t;let m=Pu(o,a,x=>x.key),u=[],f=[],O=!1,w=(x,N)=>{u.push(x),f.push(N)},S=0;for(;S<m.length;){let x=m[S];if(x.op==="equal"){w(x.newItem,{}),S++;continue}let N=[],I=[];for(;S<m.length&&m[S].op!=="equal";){let D=m[S];D.op==="delete"?N.push(D.oldItem):D.op==="insert"&&I.push(D.newItem),S++}let{plan:v}=Eu(N,I,(D,ye)=>D.cells.length===ye.cells.length&&D.cells.every(tb)&&ye.cells.every(tb));for(let D of v)if(O=!0,D.kind==="paired"){let ye=D.newItem.cells.map((Le,He)=>{let te=Su(D.oldItem.cells[He]),P=Su(Le);return te===P?Le??{content:""}:BL(Le,D.oldItem.cells[He],te,P,r,i)});w({...D.newItem,cells:ye},{})}else D.kind==="inserted"?(i.summary.tracked.inserted++,w(D.newItem,{revision:Cu(i,"insert")})):(i.summary.tracked.deleted++,w(D.oldItem,{revision:Cu(i,"delete")}))}return O&&i.summary.tracked.modified++,nb(t,u,f)}function ib(e,t,r){t==="insert"?r.summary.tracked.inserted++:r.summary.tracked.deleted++;let i=wu(e);return nb(e,i,i.map(()=>({revision:Cu(r,t)})))}function Cu(e,t){return{type:t,...e.author&&{author:e.author},...e.date&&{date:e.date}}}function el(e){return Array.isArray(e.children)}function GL(e,t){return e.name===t.name}function qL(e,t,r,i){let o=Xc(e),a=Xc(t);return!o&&!a?(i.summary.unchangedBlocks++,t):!o&&a?ob(t,r,i):o&&!a?ab(e,r,i)??t:Tu.has(t.name)?UL(e,t,r,i):t.name==="list"?ML(e,t,r,i):t.name==="table"&&Zc(e)&&Zc(t)?KL(e,t,r,i):el(t)||el(e)?(!lr(e.props,t.props)&&i.summary.untracked.push({path:r,kind:"modified",component:t.name,detail:"container props changed; new version rendered"}),{...t,children:il(e.children||[],t.children||[],`${r}/children`,i)}):(i.summary.untracked.push({path:r,kind:"modified",component:t.name,detail:`"${t.name}" changed (no native tracked-change support); new version rendered`}),t)}function ob(e,t,r){return Xc(e)?Tu.has(e.name)?_L(e,t,r):e.name==="list"?rb(e,"insert",r):e.name==="table"&&Zc(e)?ib(e,"insert",r):el(e)?(typeof e.props?.title=="string"&&r.summary.untracked.push({path:t,kind:"inserted",component:e.name,detail:`"${e.name}" title rendered without insertion mark (titles are props, not text blocks)`}),{...e,children:il([],e.children||[],`${t}/children`,r)}):(r.summary.untracked.push({path:t,kind:"inserted",component:e.name,detail:`"${e.name}" added (rendered, but not marked as a tracked insertion)`}),e):e}function ab(e,t,r){if(!Xc(e))return null;if(Tu.has(e.name))return DL(e,t,r);if(e.name==="list")return rb(e,"delete",r);if(e.name==="table"&&Zc(e))return ib(e,"delete",r);if(el(e)){typeof e.props?.title=="string"&&r.summary.untracked.push({path:t,kind:"deleted",component:e.name,detail:`"${e.name}" title still rendered without deletion mark (titles are props, not text blocks)`});let i=il(e.children||[],[],`${t}/children`,r);return{...e,children:i}}return r.summary.untracked.push({path:t,kind:"deleted",component:e.name,detail:`"${e.name}" removed (dropped from the redline; Word cannot mark it as a tracked deletion)`}),null}function il(e,t,r,i){let o=Pu(e,t,l=>JSON.stringify(l)),a=[],s=0,c=0;for(;s<o.length;){let l=o[s];if(l.op==="equal"){i.summary.unchangedBlocks++,a.push(l.newItem),s++,c++;continue}let p=[],m=[];for(;s<o.length&&o[s].op!=="equal";){let f=o[s];f.op==="delete"?p.push(f.oldItem):f.op==="insert"&&m.push(f.newItem),s++}let{plan:u}=Eu(p,m,GL);for(let f of u)if(f.kind==="paired")a.push(qL(f.oldItem,f.newItem,`${r}/${c}`,i)),c++;else if(f.kind==="inserted")a.push(ob(f.newItem,`${r}/${c}`,i)),c++;else{let O=ab(f.oldItem,`${r}/${c}`,i);O&&a.push(O)}}return a}function WL(e,t,r={}){if(!e||e.name!=="docx")throw new Error(\'Old document: top-level component must be "docx"\');if(!t||t.name!=="docx")throw new Error(\'New document: top-level component must be "docx"\');let i={tracked:{modified:0,inserted:0,deleted:0},untracked:[],unchangedBlocks:0,notes:[]},o={author:r.author,date:r.date,summary:i};!lr(Gn(e.props,"trackRevisions"),Gn(t.props,"trackRevisions"))&&i.untracked.push({path:"/props",kind:"modified",component:"docx",detail:"document props changed (theme/metadata/defaults); new version used"});let s=il(e.children||[],t.children||[],"/children",o);return i.tracked.deleted>0&&i.notes.push(`${i.tracked.deleted} fully deleted block(s): accepting all changes leaves an empty paragraph behind (OOXML paragraph-mark deletion is not supported by the renderer)`),{document:{...t,props:{...t.props,trackRevisions:!0},children:s},summary:i}}Ut.Set("uri",e=>{try{return new URL(e),!0}catch{return e.includes(".json")||e.includes("/")||e.includes("\\\\")?!0:/^https?:\\/\\/.+/.test(e)}});Ut.Set("date-time",e=>/^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d{3})?Z?$/.test(e)&&!isNaN(Date.parse(e)));var Au=class{constructor(){R(this,"schema",dt)}parse(e){let t;if(typeof e=="string")try{t=JSON.parse(e)}catch(r){throw new mo("Invalid JSON syntax",this.extractJSONSyntaxError(r,e))}else t=e;if(typeof t!="object"||t===null||!("name"in t)||t.name!=="docx")throw new uo(\'Invalid document structure: Document must be a docx component with name="docx"\',[{path:"name",message:\'Document must be a docx component with name="docx"\',code:"INVALID_STRUCTURE"}]);if(!T.Check(this.schema,t)){let r=[...T.Errors(this.schema,t)];throw new uo("JSON validation failed",this.formatTypeBoxErrors(r,typeof e=="string"?e:JSON.stringify(e,null,2)))}return t}validate(e){try{return this.parse(e),{valid:!0,errors:[],warnings:[]}}catch(t){return t instanceof mo||t instanceof uo?{valid:!1,errors:t.validationErrors,warnings:[]}:{valid:!1,errors:[{path:"",message:t instanceof Error?t.message:"Unknown validation error",code:"UNEXPECTED_ERROR"}],warnings:[]}}}parseWithLineNumbers(e){let t=e.split(`\n`);try{return this.parse(e)}catch(r){if(r instanceof mo||r instanceof uo){let i=r.validationErrors.map(o=>({...o,...this.findLineNumber(o.path,e,t)}));throw r instanceof mo?new mo(r.message,i):new uo(r.message,i)}throw r}}extractJSONSyntaxError(e,t){let r=e.message,i=r.match(/position\\s+(\\d+)/i)||r.match(/at\\s+(\\d+)/i)||r.match(/character\\s+(\\d+)/i),o=0,a=0;if(i){let s=parseInt(i[1],10),c=t.substring(0,s).split(`\n`);o=c.length,a=c[c.length-1].length+1}return[{path:"",message:`JSON syntax error: ${r}`,code:"JSON_SYNTAX_ERROR",line:o||void 0,column:a||void 0,suggestions:["Check for missing commas, brackets, or quotes","Validate JSON syntax using a JSON validator","Ensure all strings are properly quoted"]}]}formatTypeBoxErrors(e,t){return e.map(r=>{let i=r.path||"",o=this.findLineNumber(i,t);return{path:i,message:this.formatTypeBoxErrorMessage(r),code:this.getErrorCode(r),line:o.line,column:o.column,suggestions:this.generateSuggestions(r)}})}formatTypeBoxErrorMessage(e){let t=e.path?`at "${e.path}"`:"",r=e.message;return r.includes("Expected")?`${r} ${t}`:r.includes("Required property")?`${r} ${t}`:r.includes("Unexpected property")?`${r} ${t}`:r.includes("minimum")?`Value is too small ${t}. ${r}`:r.includes("maximum")?`Value is too big ${t}. ${r}`:`${r} ${t}`}getErrorCode(e){let t=String(e.type||"VALIDATION_ERROR").toUpperCase(),r=e.path?e.path.replace(/\\//g,"_").toUpperCase():"";return r?`${t}_${r}`:t}generateSuggestions(e){let t=[],r=e.message;if(r.includes("Expected string"))t.push("Ensure the value is wrapped in quotes");else if(r.includes("Expected number"))t.push("Remove quotes around numeric values");else if(r.includes("Expected array"))t.push("Use square brackets [] for arrays");else if(r.includes("Expected object"))t.push("Use curly braces {} for objects");else if(r.includes("Expected literal")){let i=r.match(/Expected literal (.+)/);i&&t.push(`Use the exact value: ${i[1]}`)}else if(r.includes("Unexpected property"))t.push("Remove unknown properties or check spelling"),t.push("Refer to the JSON schema documentation for valid properties");else if(r.includes("Expected union")){t.push("Check that the value matches one of the allowed formats");let i=e.path??"";(/\\/children\\/\\d+$/.test(i)||i.endsWith("/name"))&&t.push("Verify the component name is spelled correctly")}else if(r.includes("minimum")){let i=r.match(/minimum.*?(\\d+)/);i&&(r.includes("Array")?t.push(`Array must have at least ${i[1]} items`):t.push(`Value must be at least ${i[1]}`))}else r.includes("format")&&r.includes("uri")&&t.push("Ensure the URL is valid and starts with http:// or https://");return t.length===0&&(t.push("Check the JSON schema documentation for valid values"),t.push("Verify the property name and value format")),t}findLineNumber(e,t,r){if(!e)return{};let i=r||t.split(`\n`),o=e.split(".");for(let a=0;a<i.length;a++){let s=i[a],c=o[o.length-1];if(s.includes(`"${c}"`)){let l=s.indexOf(`"${c}"`)+1;return{line:a+1,column:l}}}return{}}},mo=class extends Error{constructor(t,r){super(t);R(this,"validationErrors");this.name="JsonParsingError",this.validationErrors=r}},uo=class extends Error{constructor(t,r){super(t);R(this,"validationErrors");this.name="JsonValidationError",this.validationErrors=r}};function HL(e){return new Au().parse(e)}function zL(e){return new Au().parseWithLineNumbers(e)}function JL(e){return Array.isArray(e)?e.map(t=>{if(typeof t=="string")return t;let r=t.path?`${t.path}: `:"",i=t.message||"Validation error";return`${r}${i}`}):[]}function YL(e,t){let r=po(e)?e:"custom",i=lo(r,t);return i.valid?{success:!0,data:i.data}:{success:!1,error:i.errors||[]}}function QL(e){let t=bu(e);return t.valid?{success:!0,data:t.data}:{success:!1,error:t.errors||[]}}function XL(e,t){let r=t&&po(t)?t:"custom",i=lo(r,e);return i.valid?[]:(i.errors||[]).map(o=>o.path?`${o.path}: ${o.message}`:o.message)}function ZL(e){let t=e.path||"root",r=e.message,i,o,a,s;if(r.includes("Expected")){let c=r.match(/Expected (.+) but received (.+)/);c&&(o=c[1],a=c[2],i=eN(o,a))}if(r.includes("Required property")){let c=r.match(/Required property \'(.+)\'/);c&&(r=`Missing required field: ${c[1]}`,i=`Add the required field: ${c[1]}`)}if(r.includes("Unexpected property")){let c=r.match(/Unexpected property \'(.+)\'/);c&&(r=`Unknown property: ${c[1]}`,i=`Remove the unknown property: ${c[1]}`)}if(r.includes("Expected union")&&(r="Value does not match any of the expected types",i="Check the documentation for valid format options"),r.includes("Expected literal")){let c=r.match(/Expected literal (.+)/);c&&(o=c[1],r=`Expected value: ${o}`,i=`Use the exact value: ${o}`)}if(r.includes("String length")){let c=r.match(/minimum length of (\\d+)/),l=r.match(/maximum length of (\\d+)/);c?(r=`String must be at least ${c[1]} characters long`,i=`Add more characters to meet the minimum length of ${c[1]}`):l&&(r=`String must be at most ${l[1]} characters long`,i=`Reduce to ${l[1]} characters or less`)}if(r.includes("Expected number")){let c=r.match(/minimum value of ([\\d.]+)/),l=r.match(/maximum value of ([\\d.]+)/);c?(r=`Number must be greater than or equal to ${c[1]}`,i=`Use a value of ${c[1]} or higher`):l&&(r=`Number must be less than or equal to ${l[1]}`,i=`Use a value of ${l[1]} or lower`)}if(r.includes("Array length")){let c=r.match(/minimum length of (\\d+)/),l=r.match(/maximum length of (\\d+)/);c?(r=`Array must have at least ${c[1]} items`,i=`Add more items to meet the minimum of ${c[1]}`):l&&(r=`Array must have at most ${l[1]} items`,i=`Remove items to meet the maximum of ${l[1]}`)}return r.includes("format")&&(r.includes("email")?(r="Invalid email address format",i="Use a valid email format like user@example.com"):r.includes("uri")||r.includes("url")?(r="Invalid URL format",i="Use a valid URL format like https://example.com"):r.includes("date-time")&&(r="Invalid date-time format",i="Use ISO 8601 format like 2024-01-01T00:00:00Z")),r.includes("pattern")&&(r="String does not match the required pattern",i="Check the format requirements for this field"),{path:t,message:r,code:String(e.type||"validation_error"),suggestion:i,expected:o,received:a,options:s}}function eN(e,t){if(e==="number"&&t==="string")return"Remove quotes or convert the string to a number";if(e==="string"&&t==="number")return"Add quotes or convert the number to a string";if(e==="boolean")return"Use true or false (without quotes)";if(e==="array"&&t==="object")return"Use square brackets [] for arrays instead of curly braces {}";if(e==="object"&&t==="array")return"Use curly braces {} for objects instead of square brackets []";if(t==="null"||t==="undefined")return`Provide a valid ${e} value or mark the field as optional`}function qn(e){return e.map(ZL)}function rs(e){return qn(e).map(t=>{let r=`${t.path}: ${t.message}`;return t.suggestion&&(r+=` (Suggestion: ${t.suggestion})`),r})}function sb(e){let t=new Map;for(let r of qn(e)){let i=t.get(r.path)||[];i.push(r),t.set(r.path,i)}return t}function ns(e){let t=qn(e),r=sb(e),i=`Validation failed with ${t.length} error${t.length>1?"s":""}:\n\n`;for(let[o,a]of r){i+=`\\u{1F4CD} ${o}:\n`;for(let s of a)i+=` \\u274C ${s.message}\n`,s.suggestion&&(i+=` \\u{1F4A1} ${s.suggestion}\n`),s.expected&&s.received&&(i+=` \\u{1F4CB} Expected: ${s.expected}, Received: ${s.received}\n`),s.options&&(i+=` \\u{1F4CB} Valid options: ${s.options.join(", ")}\n`);i+=`\n`}return i}function is(e){return e.some(t=>!!(t.message.includes("Required property")||t.path.includes("name")&&t.message.includes("Expected literal")||t.message.includes("Expected union")||t.message.includes("Never")))}function tN(e){if(!e||e==="root")return"document root";let t=e.split(".");if(t.includes("children")){let r=t.indexOf("children");if(t.length>r+1)return`component at index ${t[r+1]}`}return t.includes("props")?"props section":t.includes("theme")?"theme configuration":t.join(" > ")}var rN=qn,nN=rs,tl={report:fn,section:pn,heading:on,paragraph:an,columns:mn,image:sn,statistic:cn,table:ln,list:un};function ol(e,t,r){let i=tl[e];if(!i){if(T.Check(Pr,t))return{success:!0,data:t};let s=[...T.Errors(Pr,t)];return{success:!1,errors:qn(s),errorStrings:rs(s),report:r?.includeReport?ns(s):void 0,hasCriticalErrors:r?.checkCritical?is(s):void 0}}if(T.Check(i,t))return{success:!0,data:t};let o=[...T.Errors(i,t)];return{success:!1,errors:qn(o),errorStrings:rs(o),report:r?.includeReport?ns(o):void 0,hasCriticalErrors:r?.checkCritical?is(o):void 0}}function $u(e,t){let r=t?.maxDepth??10,i=t?.currentDepth??0;if(i>r)return{success:!1,errors:[{path:"children",message:`Maximum nesting depth (${r}) exceeded`,code:"custom",suggestion:"Reduce the nesting level of components"}],errorStrings:[`Maximum nesting depth (${r}) exceeded`],hasCriticalErrors:!0};if(T.Check(dt,e)){let s=e,c=[];if(s.children&&Array.isArray(s.children))for(let l=0;l<s.children.length;l++){let p=$u(s.children[l],{...t,currentDepth:i+1});if(!p.success){let m=p.errors?.map(u=>({...u,path:`children[${l}].${u.path}`}));return{success:!1,errors:m,errorStrings:m?.map(u=>`${u.path}: ${u.message}`),report:t?.includeReport?`Validation failed in nested component at index ${l}:\n${p.report}`:void 0,hasCriticalErrors:p.hasCriticalErrors}}p.warnings&&c.push(...p.warnings.map(m=>`children[${l}]: ${m}`))}return{success:!0,data:e,warnings:c.length>0?c:void 0}}let o=[...T.Errors(dt,e)];return{success:!1,errors:qn(o),errorStrings:rs(o),report:t?.includeReport?ns(o):void 0,hasCriticalErrors:t?.checkCritical?is(o):void 0}}function iN(e,t){let r=[],i=0;for(let{name:s,props:c}of e){let l=s in tl?ol(s,c,t):$u(c,t);if(r.push(l),l.hasCriticalErrors&&i++,!l.success&&t?.stopOnFirst)break}let o=r.filter(s=>s.success).length,a=r.length-o;return{success:a===0,results:r,summary:{total:r.length,valid:o,invalid:a,criticalErrors:i}}}function oN(e,t,r){try{let i=r?r(t):t;return ol(e,i,{includeReport:!0,checkCritical:!0})}catch(i){return{success:!1,errors:[{path:"root",message:`Transformation failed: ${i instanceof Error?i.message:String(i)}`,code:"custom"}],errorStrings:[`Transformation failed: ${i instanceof Error?i.message:String(i)}`],hasCriticalErrors:!0}}}function aN(e,t){let r=tl[e];if(!r)return{success:!1,errors:[{path:"name",message:`Unknown component name: ${e}`,code:"custom",suggestion:`Use one of: ${Object.keys(tl).join(", ")}`}],errorStrings:[`Unknown component name: ${e}`],hasCriticalErrors:!0};if(T.Check(r,t))return{success:!0,data:t};let i=[...T.Errors(r,t)];return{success:!1,errors:qn(i),errorStrings:rs(i),report:ns(i),hasCriticalErrors:is(i)}}function sN(e,t){return ol(e,t).success}var cb=["chart","columns","divider","heading","highcharts","image","list","paragraph","docx","section","statistic","table","text-box","toc","visual","block","group"],cN=new Set(cb);function lN(e){return e.name==="docx"}function pN(e){return e.name==="section"}function mN(e){return e.name==="columns"}function uN(e){return e.name==="heading"}function dN(e){return e.name==="paragraph"}function fN(e){return e.name==="image"}function hN(e){return e.name==="text-box"}function gN(e){return e.name==="statistic"}function yN(e){return e.name==="table"}function bN(e){return e.name==="list"}function ON(e){return e.name==="toc"}function xN(e){return e.name==="highcharts"}function SN(e){return e.name==="visual"}function IN(e){return e.name==="text-space-after"}var wN="1.0.0";var Qu={};rt(Qu,{BUILT_IN_PPTX_THEME_NAMES:()=>as,ChartComponentDefaultsSchema:()=>ju,ColorValueSchema:()=>Bn,DEFAULT_ERROR_CONFIG:()=>An,DEFAULT_PPTX_RENDERER_ID:()=>hn,GradientFillSchema:()=>to,GradientStopSchema:()=>Ec,HighchartsComponentDefaultsSchema:()=>Fu,ImageComponentDefaultsSchema:()=>Nu,PATTERN_FILL_PRESETS:()=>Pc,PPTX_BASE_SCHEMA_METADATA:()=>Pb,PPTX_COMPONENT_METADATA:()=>Tb,PPTX_JSON_SCHEMA_URLS:()=>Ib,PPTX_RENDERER_IDS:()=>Et,PPTX_SHARED_VERSION:()=>_N,PPTX_STANDARD_COMPONENTS_REGISTRY:()=>At,PatternFillSchema:()=>Ac,PositionSchema:()=>db,PptxChartPropsSchema:()=>Ha,PptxComponentDefaultsSchema:()=>fo,PptxComponentDefinitionSchema:()=>pl,PptxHighchartsPropsSchema:()=>Wa,PptxImagePropsSchema:()=>Ka,PptxJsonComponentDefinitionSchema:()=>Sb,PptxSlideContentSchema:()=>za,PptxStandardComponentDefinitionSchema:()=>xb,PptxTablePropsSchema:()=>qa,PresentationPropsSchema:()=>Bu,SEMANTIC_COLOR_ALIASES:()=>Cc,SEMANTIC_COLOR_NAMES:()=>wc,STYLE_NAMES:()=>Xi,ShadowSchema:()=>Zi,ShapeComponentDefaultsSchema:()=>Ru,ShapePropsSchema:()=>Ga,ShapeTypeSchema:()=>eo,SlideBackgroundSchema:()=>Vu,SlidePropsSchema:()=>Gu,StyleNameSchema:()=>Ma,TableComponentDefaultsSchema:()=>ku,TextComponentDefaultsSchema:()=>Lu,TextPropsSchema:()=>Va,TextRunSchema:()=>Tc,TextStyleSchema:()=>_u,ThemeConfigSchema:()=>Pi,TransitionSchema:()=>Ku,VerticalAlignmentSchema:()=>wi,addPptxBlockAuthoringSchemas:()=>ml,collectImageSourceConflicts:()=>Ab,collectPptxRendererErrors:()=>Mu,collectTextContentConflicts:()=>$b,compareSemver:()=>gi,comprehensiveValidatePresentation:()=>Rb,convertToJsonSchema:()=>Cb,createAllPptxComponentSchemas:()=>cl,createComponentSchema:()=>qi,createErrorConfig:()=>Ir,createPptxComponentSchemaObject:()=>Ei,deepValidatePresentation:()=>Nb,dispatchPptxRootByRenderer:()=>ul,exportSchemaToFile:()=>Wi,fixSchemaReferences:()=>Rn,generateUnifiedDocumentSchema:()=>Ob,getAllPptxComponentNames:()=>fb,getPptxComponentsByCategory:()=>hb,getPptxContainerComponents:()=>gb,getPptxContentComponents:()=>yb,getPptxStandardComponent:()=>ho,isPptxStandardComponent:()=>bb,isValidSemver:()=>Ln,isValidThemeConfig:()=>lb,latestVersion:()=>ut,parseSemver:()=>vn,pptxComponentDefinitionName:()=>Wn,pptxComponentRequiresProps:()=>Ci,preparePptxDocumentBlockTargets:()=>wb,presentImageSources:()=>Eb,transformValueError:()=>$n,transformValueErrors:()=>tt,validate:()=>jN,validateJsonPptxTheme:()=>Yu,validateJsonPresentationDocument:()=>Ju,validatePptxTheme:()=>cs,validatePresentationDocument:()=>ss,validateStrict:()=>UN});var Lu=n.Partial(Va),Nu=n.Partial(Ka),Ru=n.Partial(Ga),ku=n.Partial(qa),Fu=n.Partial(Wa),ju=n.Partial(Ha),fo=n.Object({text:n.Optional(Lu),image:n.Optional(Nu),shape:n.Optional(Ru),table:n.Optional(ku),highcharts:n.Optional(Fu),chart:n.Optional(ju)},{additionalProperties:!0});var as=["consulting","dark","default","devportal","minimal","vermilion"],CN=n.Union([n.Number({description:"Margin in inches (all sides)"}),n.Object({top:n.Number({description:"Top margin in inches"}),right:n.Number({description:"Right margin in inches"}),bottom:n.Number({description:"Bottom margin in inches"}),left:n.Number({description:"Left margin in inches"})},{additionalProperties:!1})],{description:"Slide margins in inches"}),TN=n.Union([n.Number({description:"Gutter in inches (both axes)"}),n.Object({column:n.Number({description:"Column gutter in inches"}),row:n.Number({description:"Row gutter in inches"})},{additionalProperties:!1})],{description:"Gaps between grid tracks in inches"}),Uu=n.Object({columns:n.Optional(n.Number({minimum:1,description:"Number of columns (default: 12)"})),rows:n.Optional(n.Number({minimum:1,description:"Number of rows (default: 6)"})),margin:n.Optional(CN),gutter:n.Optional(TN)},{additionalProperties:!1,description:"Grid layout configuration"}),pr=n.String({pattern:"^#?[0-9A-Fa-f]{6}$",description:"Hex color (e.g. #FF0000)"}),_u=n.Object({fontSize:n.Optional(n.Number()),fontFace:n.Optional(Ht),fontColor:n.Optional(Bn),bold:n.Optional(n.Boolean()),fontWeight:n.Optional(n.Integer({minimum:100,maximum:900})),italic:n.Optional(n.Boolean()),align:n.Optional(n.Union([n.Literal("left"),n.Literal("center"),n.Literal("right"),n.Literal("justify")])),lineSpacing:n.Optional(n.Number()),charSpacing:n.Optional(n.Number()),paraSpaceAfter:n.Optional(n.Number()),paraSpaceBefore:n.Optional(n.Number()),case:n.Optional(xi)},{additionalProperties:!1,description:"Text style preset"}),Pi=n.Object({...Fn,displayName:n.Optional(n.String()),description:n.Optional(n.String({description:"The visual voice: what the theme looks like, in one sentence."})),whenToUse:n.Optional(n.String({description:"The decks the theme suits; discovery and the design guide quote it."})),version:n.Optional(n.String()),name:n.String({description:"Theme name"}),colors:n.Object({primary:pr,secondary:pr,accent:pr,background:pr,text:pr,text2:n.Optional(pr),background2:n.Optional(pr),accent4:n.Optional(pr),accent5:n.Optional(pr),accent6:n.Optional(pr)},{additionalProperties:!1,description:"Theme color palette (10-slot scheme)"}),fonts:n.Object({heading:Ht,body:Ht,mono:n.Optional(Ht),light:n.Optional(Ht)},{additionalProperties:!1,description:"Font families"}),fontRegistry:n.Optional(wr),defaults:n.Object({fontSize:n.Number({description:"Default font size in points"}),fontColor:pr},{additionalProperties:!1,description:"Default text styling"}),styles:n.Optional(n.Partial(n.Object(Object.fromEntries(Xi.map(e=>[e,_u]))),{additionalProperties:!1,description:"Named text style presets"})),componentDefaults:n.Optional(fo)},{additionalProperties:!1,description:"Presentation theme configuration"});function lb(e){return T.Check(Pi,e)}var Et=["pptxgenjs","office-open"],hn="pptxgenjs";function Wn(e){return`PptxComponentDefinition_${e}`}function pb(e,t,r){let i=Du(t),o=al(i);if(r==="pptxgenjs")return e==="slide"&&delete o?.transition,i;switch(e){case"image":for(let a of["svg","sizing","rotate","rounding","hyperlink"])delete o?.[a];break;case"shape":delete o?.flipV;break;case"table":for(let a of["autoPage","autoPageRepeatHeader","margin","borderRadius"])delete o?.[a];PN(i);break}return mb(i),i}function Mu(e){if(!e||typeof e!="object"||Array.isArray(e))return[];let t=e,r=t.renderer??hn;if(!Et.includes(r))return[{path:"/renderer",message:`Invalid renderer "${String(r)}". Expected "pptxgenjs" or "office-open".`,code:"invalid_value"}];let i=[],o=(s,c)=>{i.push({path:s,message:`The "${r}" renderer does not support ${c}.`,code:"unsupported_renderer_feature"})},a=(s,c)=>{if(Array.isArray(s)){s.forEach((p,m)=>a(p,`${c}/${m}`));return}if(!s||typeof s!="object")return;let l=s.props;if(r==="pptxgenjs")s.name==="slide"&&l?.transition!==void 0&&o(`${c}/props/transition`,"slide transitions");else{if(s.name==="chart"&&l?.type==="bubble"&&o(`${c}/props/type`,"bubble charts"),s.name==="image"){let p={svg:"SVG images",sizing:"image cropping",rotate:"image transforms",rounding:"image rounding",hyperlink:"element hyperlinks"};for(let[m,u]of Object.entries(p))l?.[m]!==void 0&&o(`${c}/props/${m}`,u)}if(s.name==="shape"&&l?.flipV!==void 0&&o(`${c}/props/flipV`,"vertical flipping"),s.name==="table"){let p={autoPage:"table auto-pagination",autoPageRepeatHeader:"table auto-pagination",margin:"table insets",borderRadius:"rounded table corners"};for(let[m,u]of Object.entries(p))l?.[m]!==void 0&&o(`${c}/props/${m}`,u);Array.isArray(l?.rows)&&l.rows.forEach((m,u)=>{Array.isArray(m)&&m.forEach((f,O)=>{if(!(!f||typeof f!="object"))for(let[w,S]of[["colspan","merged table cells"],["rowspan","merged table cells"],["margin","table insets"]])f[w]!==void 0&&o(`${c}/props/rows/${u}/${O}/${w}`,S)})})}}for(let[p,m]of Object.entries(s))p!=="renderer"&&a(m,`${c}/${p}`)};return a(t,""),i}function PN(e){let i=al(e)?.rows?.items?.items?.anyOf;if(Array.isArray(i))for(let o of i){let a=al(o);a?.text&&(delete a.colspan,delete a.rowspan,delete a.margin,mb(o))}}function al(e){if(!(!e||typeof e!="object"))return e.properties}function mb(e){let t=al(e),r=e.required;if(!t||!r)return;let i=r.filter(o=>o in t);i.length>0?e.required=i:delete e.required}function Du(e){if(Array.isArray(e))return e.map(Du);if(!e||typeof e!="object")return e;let t=Object.create(Object.getPrototypeOf(e));for(let r of Reflect.ownKeys(e))t[r]=Du(e[r]);return t}var sl=(e,t)=>n.Union([n.Number({description:e}),n.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:t})]),EN=n.Object({x:n.Optional(sl("Frame left edge in inches, relative to the enclosing frame or slide","Frame left edge as a percentage of the enclosing width")),y:n.Optional(sl("Frame top edge in inches, relative to the enclosing frame or slide","Frame top edge as a percentage of the enclosing height")),w:n.Optional(sl("Frame width in inches","Frame width as a percentage of the enclosing width")),h:n.Optional(sl("Frame height in inches","Frame height as a percentage of the enclosing height")),grid:n.Optional(rn),gridConfig:n.Optional(n.Object({...Uu.properties},{additionalProperties:!1,description:"Grid used for grid placements of this group\\u2019s descendants, merged over the enclosing grid field by field. Inside a frame the grid spans the frame."})),direction:n.Optional(n.Union([n.Literal("row"),n.Literal("column")],{description:"Distribute the children into cells along this axis: equal cells, or weighted by `weights`. Each child fills its cell unless it states its own offsets; an omitted optional child simply redistributes the rest."})),gap:n.Optional(n.Number({minimum:0,description:"Space between distributed cells, in inches. Default 0."})),weights:n.Optional(n.Array(n.Number({exclusiveMinimum:0}),{minItems:1,description:"Relative cell sizes in child order (e.g. [1.1, 1] for a 1.1 : 1 split). Missing entries count as 1."}))},{additionalProperties:!1,description:"Transparent group. Without a frame, a plain sequence of slide content; with `x`/`y`/`w`/`h` or `grid`, a frame its children position within (numbers are offsets in inches, percentages are fractions of the frame, omitted values fill it); with `direction`, a row or column that distributes its children into cells."}),Bu=n.Object({title:n.Optional(n.String({description:"Presentation title metadata"})),author:n.Optional(n.String({description:"Presentation author metadata"})),subject:n.Optional(n.String({description:"Presentation subject metadata"})),company:n.Optional(n.String({description:"Company name metadata"})),theme:n.Optional(n.Union([n.String({description:`Theme name to apply (default: "default"). Built-ins: ${as.join(", ")} (consulting is the house style).`,examples:[...as],default:"default"}),Pi],{description:\'Theme to apply: a built-in/custom theme name (default: "default"), or an inline theme config object so the document stays self-contained\'})),fontRegistry:n.Optional(wr),slideWidth:n.Optional(n.Number({description:"Slide width in inches (default: 10)",default:10})),slideHeight:n.Optional(n.Number({description:"Slide height in inches (default: 7.5)",default:7.5})),rtlMode:n.Optional(n.Boolean({description:"Right-to-left text direction"})),language:n.Optional(n.String({pattern:"^[A-Za-z]{2,3}(-[A-Za-z0-9]{2,8})*$",description:\'Default presentation language (BCP-47 tag, e.g. "en-US"). Sets the spell-check language for all text; individual text components can override it.\',examples:["en-US","fr-FR","de-DE","it-IT","es-ES"]})),pageNumberFormat:n.Optional(n.Union([n.Literal("9"),n.Literal("09")],{description:\'Format for {PAGE_NUMBER} placeholders: "9" = bare number (default), "09" = zero-padded\',default:"9"})),componentDefaults:n.Optional(fo),grid:n.Optional(Uu),blocks:n.Optional(Qr),qualityProfile:n.Optional(n.String({description:"The quality profile validation judges this deck by when the caller names none \\u2014 a blueprint scaffold writes its archetype\\u2019s profile here. A profile names required structure and content; the theme only paints. Built-ins: consulting-deck, executive-presentation, technical-presentation; an unknown name falls back to the format default.",examples:["consulting-deck","executive-presentation","technical-presentation"]}))},{description:"Presentation container props",additionalProperties:!1}),db=n.Object({x:n.Optional(n.Union([n.Number({description:"X position in inches"}),n.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:\'X position as percentage (e.g., "10%")\'})])),y:n.Optional(n.Union([n.Number({description:"Y position in inches"}),n.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:\'Y position as percentage (e.g., "10%")\'})])),w:n.Optional(n.Union([n.Number({description:"Width in inches"}),n.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:\'Width as percentage (e.g., "80%")\'})])),h:n.Optional(n.Union([n.Number({description:"Height in inches"}),n.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:\'Height as percentage (e.g., "20%")\'})]))},{description:"Position and size in inches or percentages",additionalProperties:!1}),Vu=n.Object({color:n.Optional(Bn),gradient:n.Optional(to),image:n.Optional(n.Object({path:n.Optional(n.String({description:"Image file path or URL"})),base64:n.Optional(n.String({description:"Base64-encoded image data"}))},{description:"Background image",additionalProperties:!1}))},{description:"Slide background configuration",additionalProperties:!1}),Ku=n.Object({type:n.Optional(n.Union([n.Literal("fade"),n.Literal("push"),n.Literal("wipe"),n.Literal("zoom"),n.Literal("none")],{description:"Transition effect type"})),speed:n.Optional(n.Union([n.Literal("slow"),n.Literal("medium"),n.Literal("fast")],{description:"Transition speed"}))},{description:"Slide transition configuration",additionalProperties:!1}),Gu=n.Object({meta:n.Optional(n.Object({title:n.Optional(n.String({description:"Authoring label for this slide, shown in editors and outlines. Never rendered \\u2014 slide content is unaffected."}))},{additionalProperties:!1,description:"Authoring metadata; has no effect on the presentation."})),background:n.Optional(Vu),transition:n.Optional(Ku),notes:n.Optional(n.String({description:"Speaker notes for this slide"})),hidden:n.Optional(n.Boolean({description:"Hide this slide from presentation"}))},{description:"Slide container props",additionalProperties:!1}),ub=[...tn.map(({name:e})=>e),"block","group"],At=[{name:"pptx",propsSchema:Bu,hasChildren:!0,allowedChildren:["slide"],category:"container",propsRequired:!0,description:"Main presentation container - defines the overall presentation structure. Required as the root component. Always declare `slideWidth`/`slideHeight` (13.333 \\xD7 7.5 for 16:9) \\u2014 omitted, the renderer silently falls back to 4:3 and 16:9 content leaves a dead strip.",special:{hasSchemaField:!0}},{name:"slide",propsSchema:Gu,hasChildren:!0,allowedChildren:ub,category:"container",description:"Slide container - groups content elements on a single slide. One idea per slide: past roughly 40 words of body text, split the content across more slides."},{name:"group",propsSchema:EN,hasChildren:!0,allowedChildren:ub,category:"layout",description:"Transparent group of slide content; also the inspectable result of block expansion. Give it a frame (x/y/w/h or grid) to position children within it, and a direction to distribute them into equal or weighted cells."},{name:"block",propsSchema:Dn,hasChildren:!1,category:"layout",description:"Invoke a JSON block defined in this document\\u2019s props.blocks. Fill its named slots; no block names are built into the engine and no coordinates are accepted here."},...tn];function ho(e){return At.find(t=>t.name===e)}function fb(){return At.map(e=>e.name)}function hb(e){return At.filter(t=>t.category===e)}function gb(){return At.filter(e=>e.hasChildren)}function yb(){return At.filter(e=>!e.hasChildren)}function bb(e){return At.some(t=>t.name===e)}function Ei(e,t,r){let i={name:n.Literal(e.name),id:n.Optional(n.String()),enabled:n.Optional(n.Boolean({default:!0,description:"When false, this component is filtered out and not rendered. Defaults to true."}))};return e.special?.hasSchemaField&&(i.$schema=n.Optional(n.String({format:"uri"})),i.renderer=r?r.requireDiscriminator?n.Literal(r.renderer,{description:"Renderer backend for this presentation"}):n.Optional(n.Literal(r.renderer,{description:\'Renderer backend. Omitted defaults to "pptxgenjs".\'})):n.Optional(n.Union(Et.map(o=>n.Literal(o)),{description:\'Renderer backend. Omitted defaults to "pptxgenjs".\'}))),i.props=r?pb(e.name,e.propsSchema,r.renderer):e.propsSchema,e.hasChildren&&t&&(i.children=n.Optional(n.Array(t))),Ci(e)||(i.props=n.Optional(i.props)),n.Object(i,{additionalProperties:!1,description:e.description})}function cl(e){return At.map(t=>Ei(t,e))}function ll(e,t=[],r){let i=new Map;for(let c of At)c.hasChildren||i.set(c.name,Ei(c,void 0,r));let o=At.filter(c=>c.hasChildren),a=new Map,s=[...o];for(;s.length>0;){let c=s.length;for(let l=s.length-1;l>=0;l--){let p=s[l];if(p.name==="group"){let w=n.Intersect([e,n.Object({name:n.Union([...p.allowedChildren.map(S=>n.Literal(S)),...t.map(S=>S.properties?.name??n.String())])})]);a.set(p.name,Ei(p,w,r)),s.splice(l,1);continue}if(!p.allowedChildren){a.set(p.name,Ei(p,e,r)),s.splice(l,1);continue}if(!p.allowedChildren.filter(w=>o.some(S=>S.name===w)).every(w=>a.has(w)))continue;let f=[...p.allowedChildren.map(w=>a.get(w)??i.get(w)).filter(w=>w!==void 0),...t],O=f.length===1?f[0]:n.Union(f);a.set(p.name,Ei(p,O,r)),s.splice(l,1)}if(s.length===c)throw new Error(`Circular allowedChildren among: ${s.map(l=>l.name).join(", ")}`)}return[...a.values(),...i.values()]}function AN(e,t,r,i){let o={name:n.Literal(e.name),id:n.Optional(n.String()),enabled:n.Optional(n.Boolean({default:!0,description:"When false, this component is filtered out and not rendered. Defaults to true."})),version:i?n.Optional(n.Literal(t.version)):n.Literal(t.version),props:t.propsSchema};return t.hasChildren&&(o.children=n.Optional(n.Array(r))),n.Object(o,{additionalProperties:!1,description:t.description??e.name})}function Ob(e={}){let{customComponents:t=[]}=e,r=Et.map(i=>$N(t,i,i!==hn));return n.Union(r,{description:"Presentation definition, discriminated by the optional renderer field. Omitted renderer means pptxgenjs."})}function $N(e,t,r){return n.Recursive(i=>{let o=[];for(let c of e)if(c.versions.length>0){let l=ut(c.versions.map(m=>m.version)),p=c.versions.map(m=>AN(c,m,i,m.version===l));o.push(...p)}let s=[...ll(i,o,{renderer:t,requireDiscriminator:r}),...o];return s.length===0?n.Object({}):n.Union(s)},{$id:Wn(t)})}var xb=n.Union([...cl(n.Any())],{discriminator:{propertyName:"name"},description:"Standard PPTX component definition with discriminated union"}),pl=n.Recursive(e=>n.Union([...ll(e)],{discriminator:{propertyName:"name"},description:"PPTX component definition with discriminated union"}));var Sb=pl,Ib={presentation:"./json-schemas/components/presentation.schema.json",slide:"./json-schemas/components/slide.schema.json",text:"./json-schemas/components/text.schema.json",image:"./json-schemas/components/image.schema.json",shape:"./json-schemas/components/shape.schema.json",table:"./json-schemas/components/table.schema.json",index:"./json-schemas/index.schema.json"};function ml(e){let t=e.definitions??{},r=new Map;for(let o of Et){let a=Wn(o);t[a]&&r.set(o,Fa(t,a,["pptx","slide"],"pptx"))}let i=o=>{if(!o||typeof o!="object")return;if(Array.isArray(o)){o.forEach(i);return}let a=o;if(a.properties?.name?.const==="pptx"){let s=r.get(a.properties.renderer?.const),c=a.properties.props?.properties?.blocks?.patternProperties;if(s&&c)for(let l of Object.values(c))l.properties.body.items=s}Object.values(a).forEach(i)};i(e)}function ul(e){let t=e.anyOf;if(!Array.isArray(t))return;let r=new Map;for(let a of Et){let s=`#/definitions/${Wn(a)}`,c=t.find(l=>l&&l.$ref===s);c&&r.set(a,c)}if(r.size!==t.length||!r.has(hn))return;let i=a=>({properties:{renderer:{const:a}},required:["renderer"]}),o=Et.filter(a=>a!==hn&&r.has(a));delete e.anyOf,e.type="object",e.properties={renderer:{description:\'Renderer backend. Omitted defaults to "pptxgenjs".\',anyOf:Et.filter(a=>r.has(a)).map(a=>({const:a,type:"string"}))}},e.allOf=[...o.map(a=>({if:i(a),then:r.get(a)})),{if:{not:{anyOf:o.map(i)}},then:r.get(hn)}]}function wb(e){let t=e.definitions??{},r=[];for(let i of Et){let o=Wn(i),a=t[o];if(!a)continue;let s=`PptxSlotContent_${i}`;if(!t[s]){let p=Zs(a).find(m=>m.properties?.name?.const==="slide")?.properties?.children?.items;p&&(t[s]=JSON.parse(JSON.stringify(p)))}if(!t[s]){r.push({name:o});continue}let c={$ref:`#/definitions/${s}`};r.push({name:o,componentRef:c},{name:s,componentRef:c})}return r}function Cb(e,t={}){return ec(e,{...t,enrich:r=>{ml(r),ul(r)}})}var Tb={presentation:{title:"Presentation Component",description:"Top-level presentation container with metadata and settings"},slide:{title:"Slide Component",description:"Slide container for organizing content elements"},text:{title:"Text Component",description:"Text element with formatting and positioning"},image:{title:"Image Component",description:"Image element with sizing and positioning"},shape:{title:"Shape Component",description:"Geometric shape with optional text and styling"},table:{title:"Table Component",description:"Tabular data display with rows and columns"}},Pb={position:{title:"Position",description:"Position and size in inches or percentages"},"slide-background":{title:"Slide Background",description:"Slide background configuration"},transition:{title:"Transition",description:"Slide transition effect configuration"},shadow:{title:"Shadow",description:"Shadow configuration for elements"}};var vN=["path","base64","svg"];function Eb(e){if(!e||typeof e!="object")return[];let t=e;return vN.filter(r=>{let i=t[r];return typeof i=="string"&&i.trim().length>0})}function Ab(e){let t=[],r=(i,o)=>{if(Array.isArray(i)){i.forEach((a,s)=>r(a,`${o}/${s}`));return}if(!(!i||typeof i!="object")){if(i.name==="image"){let a=Eb(i.props);a.length>1&&t.push({path:`${o}/props`,message:`Image component accepts only one source, but found ${a.map(s=>`"${s}"`).join(", ")}. Use exactly one of "path", "base64", or "svg".`,code:"mutually_exclusive"})}for(let a of Object.keys(i))r(i[a],`${o}/${a}`)}};return r(e,""),t}function $b(e){let t=[],r=(i,o,a)=>{if(Array.isArray(i)){i.forEach((s,c)=>r(s,`${o}/${c}`,a));return}if(!(!i||typeof i!="object")){if(!a&&i.name==="text"&&i.props&&typeof i.props=="object"){let s=typeof i.props.text=="string",c=Array.isArray(i.props.runs);s&&c?t.push({path:`${o}/props`,message:\'Text component accepts either "text" or "runs", not both. Use exactly one of the two.\',code:"mutually_exclusive"}):!s&&!c&&t.push({path:`${o}/props`,message:\'Text component requires content: set either "text" or "runs".\',code:"required_property"})}for(let s of Object.keys(i))r(i[s],`${o}/${s}`,a||o==="/props"&&s==="blocks")}};return r(e,"",!1),t}var LN=Object.fromEntries(At.map(e=>[e.name,e.propsSchema])),qu=new Set(At.filter(e=>!!e.special?.hasSchemaField).map(e=>e.name)),zu=new Set(["name","id","enabled","props","children"]),NN=new Set([...zu,"version"]),vb=new Set([...zu,"$schema"]);vb.add("renderer");var RN={id:"string",enabled:"boolean",$schema:"string",version:"string"};function Lb(e,t,r,i,o){for(let a of Object.keys(e)){if(!r.has(a)){o.push({path:`${t}/${a}`,message:`Unknown field "${a}" on ${i}`,code:"unknown_field"});continue}let s=RN[a];s&&typeof e[a]!==s&&o.push({path:`${t}/${a}`,message:`Field "${a}" on ${i} must be a ${s}`,code:"invalid_type"})}}function Nb(e,t={}){let r=[];if(!e||typeof e!="object")return r.push({path:"root",message:"Presentation must be an object",code:"invalid_type"}),r;if(!e.name)r.push({path:"/name",message:\'Missing required field "name"\',code:"required_property"});else if(!qu.has(e.name)){let o=[...qu].map(a=>`"${a}"`).join(", ");r.push({path:"/name",message:`Invalid name "${e.name}". Expected ${o}`,code:"invalid_value"})}Lb(e,"",vb,"the root component",r);let i=ho(e.name);return"props"in e?qu.has(e.name)&&r.push(...Hu(e.name,e.props,"/props",t)):(!i||Ci(i))&&r.push({path:"/props",message:\'Missing required field "props"\',code:"required_property"}),e.children?Array.isArray(e.children)||r.push({path:"/children",message:\'Field "children" must be an array\',code:"invalid_type"}):r.push({path:"/children",message:\'Missing required field "children"\',code:"required_property"}),Wu(e,"",t,r),r}function Wu(e,t,r,i){if(!e||typeof e!="object")return;let o=(c,l)=>{if(!c||typeof c!="object"||Array.isArray(c)){i.push({path:l,message:"Component must be an object",code:"invalid_type"});return}if(typeof c.name!="string"||c.name.length===0){i.push({path:`${l}/name`,message:\'Component missing required field "name"\',code:"required_property"});return}let p=r.knownCustomNames?.has(c.name)??!1;if(Lb(c,l,p?NN:zu,`component "${c.name}"`,i),p){"props"in c||i.push({path:`${l}/props`,message:`Component "${c.name}" is missing required field "props"`,code:"required_property",suggestion:`Add a "props" object holding the content "${c.name}" renders.`}),Wu(c,l,r,i);return}let u=ho(c.name),f=`${l}/props`;if("props"in c)i.push(...Hu(c.name,c.props,f,r));else if(u&&Ci(u)){let O=u.propsSchema.required??[];i.push({path:f,message:`Component "${c.name}" is missing required field "props"`,code:"required_property",suggestion:O.length>0?`Add "props" carrying ${O.map(w=>`"${w}"`).join(", ")}.`:`Add a "props" object holding the content "${c.name}" renders.`})}else i.push(...Hu(c.name,{},f,r));if(u&&!u.hasChildren&&c.children!=null){i.push({path:`${l}/children`,message:`Component "${c.name}" does not accept children`,code:"invalid_value"});return}Wu(c,l,r,i)},a=ho(e.name),s=(c,l)=>{if(a?.allowedChildren&&c&&typeof c=="object"&&typeof c.name=="string"&&ho(c.name)&&!a.allowedChildren.includes(c.name)){let p=a.allowedChildren.map(m=>`"${m}"`).join(", ");i.push({path:`${l}/name`,message:`Component "${c.name}" is not allowed inside "${e.name}". Expected ${p}`,code:"invalid_value"})}};Array.isArray(e.children)?e.children.forEach((c,l)=>{let p=`${t}/children/${l}`;s(c,p),o(c,p)}):e.children!=null&&t!==""&&i.push({path:`${t}/children`,message:\'Field "children" must be an array\',code:"invalid_type"})}function Hu(e,t,r,i={}){let o=[],a=LN[e];if(!a)return o.push({path:r.replace(/\\/props$/,"/name"),message:`Unknown component "${e}"`,code:"unknown_component"}),o;let s=t;if(i.allowUnknownFields&&(s=T.Clean(a,T.Clone(s))),!T.Check(a,s)){let c=[...T.Errors(a,s)];tt(c,{maxErrors:100}).forEach(p=>{let m=p.path==="root"?r:`${r}${p.path.startsWith("/")?p.path:"/"+p.path}`;o.push({...p,path:m})})}return o}function Rb(e,t=[],r={}){let i=Nb(e,r),o=t.filter(a=>!kN(a));return FN([...o,...i])}function kN(e){if(!(!e.path||e.path==="root"||e.path==="/"))return!1;let r=e.message||"";return/invalid component configurations?/i.test(r)||/invalid document structure/i.test(r)}function FN(e){let t=new Set,r=[];for(let i of e){let o=`${i.path}:${i.message}`;t.has(o)||(t.add(o),r.push(i))}return r}function kb(e){if(typeof e!="string")return{parsed:e};try{return{parsed:JSON.parse(e)}}catch(t){return{error:{path:"root",message:`Invalid JSON: ${t?.message??String(t)}`,code:"json_parse_error"}}}}function ss(e,t={}){let r=Rb(e,[],t);r.push(...Ab(e)),r.push(...$b(e)),r.push(...Mu(e)),r.push(...Yi(e,Xr(e),"pptx",[...t.knownCustomNames??[]]));let i=r.length===0;return{valid:i,errors:r,documentType:"pptx",data:i?e:void 0}}function Ju(e,t={}){let{parsed:r,error:i}=kb(e);return i?{valid:!1,errors:[i],documentType:"pptx"}:ss(r,t)}function cs(e){if(T.Check(Pi,e))return{valid:!0,errors:[],data:e};let t=[...T.Errors(Pi,e)];return{valid:!1,errors:tt(t,{maxErrors:100})}}function Yu(e){let{parsed:t,error:r}=kb(e);return r?{valid:!1,errors:[r]}:cs(t)}var jN={document:e=>ss(e),jsonDocument:e=>Ju(e),theme:e=>cs(e),jsonTheme:e=>Yu(e),isDocument:e=>ss(e).valid,isTheme:e=>cs(e).valid},UN={document:e=>ss(e),jsonDocument:e=>Ju(e),theme:e=>cs(e),jsonTheme:e=>Yu(e)},_N="1.0.0";function Fb(e,t){let r={exports:{}},i=a=>{if(Object.prototype.hasOwnProperty.call(t,a))return t[a];throw new Error(`Module "${a}" is not available in the playground sandbox. Available modules: ${Object.keys(t).join(", ")}`)};return new Function("require","module","exports",e)(i,r,r.exports),r.exports}function Xu(e){if(!e||typeof e!="object")return!1;let t=e;if(typeof t.name!="string"||t.name.length===0||!t.versions||typeof t.versions!="object")return!1;let r=Object.values(t.versions);return r.length>0&&r.some(i=>!!i&&typeof i=="object"&&!!i.propsSchema&&typeof i.propsSchema=="object"&&typeof i.render=="function")}function jb(e){if(Xu(e.default))return e.default;let t=Object.entries(e).filter(([r])=>r.endsWith("Component")||r.endsWith("component")||r.endsWith("Module")||r.endsWith("module"));for(let[,r]of t)if(Xu(r))return r;for(let r of Object.values(e))if(Xu(r))return r;return null}var DN=/^\\d+\\.\\d+\\.\\d+$/;function Ub(e,t,r){let i=[];for(let[o,a]of Object.entries(e.versions)){if(!DN.test(o))throw new Error(`Component "${e.name}": invalid semver key "${o}". Expected format: major.minor.patch`);if(!a||typeof a!="object"||!a.propsSchema)throw new Error(`Component "${e.name}" version "${o}" requires a propsSchema`);if(typeof a.render!="function")throw new Error(`Component "${e.name}" version "${o}" requires a render function`);let s;try{s=JSON.parse(JSON.stringify(a.propsSchema))}catch(c){throw new Error(`Component "${e.name}" version "${o}": propsSchema is not serializable (${c instanceof Error?c.message:String(c)})`)}i.push({version:o,propsSchema:s,hasChildren:a.hasChildren===!0,...typeof a.description=="string"?{description:a.description}:{}})}if(i.length===0)throw new Error(`Component "${e.name}" must have at least one version`);return{name:e.name,format:t,versions:i,latest:ut(i.map(o=>o.version)),examples:r}}function _b(e,t,r){return`import type { TSchema } from \'@sinclair/typebox\';\nimport type { ${t}, ${r} } from \'${e}\';\nimport type {\n RenderContext as SharedRenderContext,\n RenderFunction as SharedRenderFunction,\n ComponentVersion as SharedComponentVersion,\n ComponentVersionMap as SharedComponentVersionMap,\n CustomComponent as SharedCustomComponent,\n} from \'@json-to-office/shared/plugin\';\n\n/** The resolved theme handed to \\`render\\`. */\nexport type ThemeConfig = ${r};\n\nexport type RenderContext<T> = SharedRenderContext<T, ${r}>;\n\nexport type RenderFunction<\n TProps,\n TComponentDefinition = ${t},\n> = SharedRenderFunction<TProps, TComponentDefinition, ${r}>;\n\nexport type ComponentVersion<\n TComponentDefinition = ${t},\n TPropsSchema extends TSchema = TSchema,\n> = SharedComponentVersion<TComponentDefinition, TPropsSchema, ${r}>;\n\nexport type ComponentVersionMap<TComponentDefinition = ${t}> =\n SharedComponentVersionMap<TComponentDefinition, ${r}>;\n\nexport type CustomComponent<\n TComponentDefinition = ${t},\n TVersions extends\n ComponentVersionMap<TComponentDefinition> = ComponentVersionMap<TComponentDefinition>,\n TName extends string = string,\n> = SharedCustomComponent<TComponentDefinition, TVersions, TName>;\n\n/** Create one semver version entry with full type inference for its props. */\nexport declare function createVersion<\n TPropsSchema extends TSchema,\n TComponentDefinition = ${t},\n>(\n version: ComponentVersion<TComponentDefinition, TPropsSchema>\n): ComponentVersion<TComponentDefinition, TPropsSchema>;\n\n/** Create a custom component with semver-keyed versions. */\nexport declare function createComponent<\n TComponentDefinition = ${t},\n TVersions extends\n ComponentVersionMap<TComponentDefinition> = ComponentVersionMap<TComponentDefinition>,\n TName extends string = string,\n>(\n component: CustomComponent<TComponentDefinition, TVersions, TName>\n): CustomComponent<TComponentDefinition, TVersions, TName>;\n\nexport {\n resolveComponentVersion,\n ComponentValidationError,\n DuplicateComponentError,\n} from \'@json-to-office/shared/plugin\';\nexport type { ${t}, ${r} } from \'${e}\';\n`}var Zu=_b("@json-to-office/shared-docx","ComponentDefinition","ThemeConfigJson"),ed=_b("@json-to-office/shared-pptx","PptxComponentDefinition","ThemeConfigJson");function dl(e,t){return JSON.stringify({name:e,version:"0.0.0-playground",types:"index.d.ts",exports:{".":{types:"./index.d.ts"},...t?{"./plugin":{types:"./plugin/index.d.ts"}}:{}}},null,2)}var l9={"node_modules/@json-to-office/core-docx/package.json":dl("@json-to-office/core-docx",!0),"node_modules/@json-to-office/core-docx/index.d.ts":Zu,"node_modules/@json-to-office/core-docx/plugin/index.d.ts":Zu,"node_modules/@json-to-office/json-to-docx/package.json":dl("@json-to-office/json-to-docx",!1),"node_modules/@json-to-office/json-to-docx/index.d.ts":Zu,"node_modules/@json-to-office/core-pptx/package.json":dl("@json-to-office/core-pptx",!0),"node_modules/@json-to-office/core-pptx/index.d.ts":ed,"node_modules/@json-to-office/core-pptx/plugin/index.d.ts":ed,"node_modules/@json-to-office/json-to-pptx/package.json":dl("@json-to-office/json-to-pptx",!1),"node_modules/@json-to-office/json-to-pptx/index.d.ts":ed},Db=["@json-to-office/core-docx","@json-to-office/core-docx/plugin","@json-to-office/json-to-docx","@json-to-office/core-pptx","@json-to-office/core-pptx/plugin","@json-to-office/json-to-pptx"];var td="[plugin-network-off]";var rd=globalThis,nd=rd.postMessage.bind(rd),MN={createComponent:Ki,createVersion:Vi,resolveComponentVersion:yi,ComponentValidationError:bi,DuplicateComponentError:Gi},BN={"@sinclair/typebox":mp,"@sinclair/typebox/value":Pp,"@json-to-office/shared":ym,"@json-to-office/shared/plugin":bm,"@json-to-office/shared-docx":vu,"@json-to-office/shared-pptx":Qu,...Object.fromEntries(Db.map(e=>[e,MN]))},VN=["importScripts","Worker","SharedWorker","indexedDB","caches","BroadcastChannel","FileSystemHandle","FileSystemFileHandle","FileSystemDirectoryHandle","showOpenFilePicker","showSaveFilePicker","showDirectoryPicker","close"],KN=["fetch","XMLHttpRequest","WebSocket","EventSource","WebTransport"];function Mb(e,t){let r=globalThis;for(;r&&r!==Object.prototype;){if(Object.prototype.hasOwnProperty.call(r,e))try{delete r[e]}catch{}r=Object.getPrototypeOf(r)}try{Object.defineProperty(globalThis,e,{value:t,configurable:!1,writable:!1})}catch{}}function Bb(e){let t=`${td} ${e} is not available: Network is off for this plugin. Turn on Network in the plugin header and list the hosts it may call.`;return new Proxy(function(){},{apply(){throw new Error(t)},construct(){throw new Error(t)},get(r,i){if(i==="name")return e;throw new Error(t)}})}function GN(e){let t=globalThis.fetch;if(typeof t!="function")return;let r=e.length>0?`This plugin may call: ${e.join(", ")}.`:"This plugin has Network on but no hosts listed, so it may call nothing.",i=async(...o)=>{try{return await t.apply(globalThis,o)}catch(a){let s=String(o[0]instanceof Request?o[0].url:o[0]);throw new Error(`${td} fetch("${s}") was refused. ${r} Add the host under Network in the plugin header to allow it.`,{cause:a})}};try{Object.defineProperty(globalThis,"fetch",{value:i,configurable:!1,writable:!1})}catch{}}var Vb=!1;function qN(e,t){if(Vb)return;Vb=!0;for(let i of VN)Mb(i);let r=globalThis.navigator;if(r)for(let i of["storage","locks","serviceWorker"])try{Object.defineProperty(r,i,{value:void 0})}catch{}if(!e){for(let i of KN)Mb(i,Bb(i));if(r)try{Object.defineProperty(r,"sendBeacon",{value:Bb("navigator.sendBeacon")})}catch{}return}GN(t)}var Kb=5*1024*1024,ls=null;function WN(e,t){let r=t instanceof Error?t.message:String(t),i={id:e,type:"error",message:r,...t instanceof Error&&t.stack?{stack:t.stack}:{}};nd(i)}async function HN(e){if(e.type==="load"){qN(e.allowNetwork,e.networkOrigins??[]);let t=Fb(e.js,BN),r=jb(t);if(!r)throw new Error(\'No component export found. Export the result of createComponent() as the default export or under a name ending in "Component".\');ls=r;let i=Ub(r,e.format,e.examples),o={id:e.id,type:"loaded",metadata:i};nd(o);return}if(e.type==="render"){if(!ls)throw new Error("Plugin is not loaded");let t=yi(ls.name,ls.versions,e.version),r=Nn(t.propsSchema,e.props,{componentName:ls.name});if(!r.valid)throw new bi(r.errors??[],e.props);let i=[],o=(m,u)=>{i.push({message:m,...u?{context:u}:{}})},a=await t.render({props:r.data,theme:e.theme,addWarning:o,children:e.children}),s=Array.isArray(a)?a:[a],c=JSON.stringify(s);if(c.length>Kb)throw new Error(`render() returned ${Math.round(c.length/1024/1024)} MB of components; the limit is ${Kb/1024/1024} MB.`);let l=JSON.parse(c),p={id:e.id,type:"rendered",components:l,warnings:i};nd(p);return}}rd.addEventListener("message",e=>{let t=e.data;!t||typeof t!="object"||typeof t.id!="number"||HN(t).catch(r=>WN(t.id,r))});})();\n';export{e as default};
|
|
2
|
-
//# sourceMappingURL=_virtual_jto-sandbox-runtime-CySzPJ5n.js.map
|