@json-to-office/jto 7.0.0 → 7.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (28) hide show
  1. package/dist/cli.js +1 -1
  2. package/dist/client/assets/{HomePage-CAQsE0sn.js → HomePage-Lgf6tdDd.js} +4 -4
  3. package/dist/client/assets/{HomePage-CAQsE0sn.js.map → HomePage-Lgf6tdDd.js.map} +1 -1
  4. package/dist/client/assets/{JsonEditorPage-Cqz2zDan.js → JsonEditorPage-CvR_nPhi.js} +3 -3
  5. package/dist/client/assets/{JsonEditorPage-Cqz2zDan.js.map → JsonEditorPage-CvR_nPhi.js.map} +1 -1
  6. package/dist/client/assets/{MonacoPluginProvider-FJHgHgFQ.js → MonacoPluginProvider-B9ylIvJ1.js} +5 -5
  7. package/dist/client/assets/{MonacoPluginProvider-FJHgHgFQ.js.map → MonacoPluginProvider-B9ylIvJ1.js.map} +1 -1
  8. package/dist/client/assets/{_virtual_jto-plugin-type-libs-DroopP3q.js → _virtual_jto-plugin-type-libs-0VdrjFY7.js} +158 -5
  9. package/dist/client/assets/{_virtual_jto-plugin-type-libs-DroopP3q.js.map → _virtual_jto-plugin-type-libs-0VdrjFY7.js.map} +1 -1
  10. package/dist/client/assets/{_virtual_jto-sandbox-runtime-v4kQF3ee.js → _virtual_jto-sandbox-runtime-D-AIkzB-.js} +2 -2
  11. package/dist/client/assets/_virtual_jto-sandbox-runtime-D-AIkzB-.js.map +1 -0
  12. package/dist/client/assets/{editor-1mTGQjga.js → editor-RriNJVGd.js} +2 -2
  13. package/dist/client/assets/{editor-1mTGQjga.js.map → editor-RriNJVGd.js.map} +1 -1
  14. package/dist/client/assets/{editor-monaco-json-B19wOO_b.js → editor-monaco-json-DB7frltk.js} +2 -2
  15. package/dist/client/assets/{editor-monaco-json-B19wOO_b.js.map → editor-monaco-json-DB7frltk.js.map} +1 -1
  16. package/dist/client/assets/{index-Da5mi8tP.js → index-4AXBK6QA.js} +2 -2
  17. package/dist/client/assets/{index-Da5mi8tP.js.map → index-4AXBK6QA.js.map} +1 -1
  18. package/dist/client/assets/{index-DsuZTLjf.js → index-CPNiZvgQ.js} +8 -8
  19. package/dist/client/assets/index-CPNiZvgQ.js.map +1 -0
  20. package/dist/client/assets/{preview-T1T-uQbx.js → preview-CchFIss2.js} +2 -2
  21. package/dist/client/assets/{preview-T1T-uQbx.js.map → preview-CchFIss2.js.map} +1 -1
  22. package/dist/client/assets/{useQualityAnalysis-CnLgG345.js → useQualityAnalysis-DgWJorkg.js} +2 -2
  23. package/dist/client/assets/{useQualityAnalysis-CnLgG345.js.map → useQualityAnalysis-DgWJorkg.js.map} +1 -1
  24. package/dist/client/index.html +1 -1
  25. package/dist/client/templates/client-report-blocks.docx.json +2 -10
  26. package/package.json +4 -4
  27. package/dist/client/assets/_virtual_jto-sandbox-runtime-v4kQF3ee.js.map +0 -1
  28. package/dist/client/assets/index-DsuZTLjf.js.map +0 -1
@@ -1,2 +1,2 @@
1
- const e='"use strict";(()=>{var Jb=Object.create;var us=Object.defineProperty;var Yb=Object.getOwnPropertyDescriptor;var Qb=Object.getOwnPropertyNames;var Xb=Object.getPrototypeOf,Zb=Object.prototype.hasOwnProperty;var eO=(e,t,r)=>t in e?us(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var tO=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),nt=(e,t)=>{for(var r in t)us(e,r,{get:t[r],enumerable:!0})},rO=(e,t,r,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Qb(t))!Zb.call(e,o)&&o!==r&&us(e,o,{get:()=>t[o],enumerable:!(i=Yb(t,o))||i.enumerable});return e};var pd=(e,t,r)=>(r=e!=null?Jb(Xb(e)):{},rO(t||!e||!e.__esModule?us(r,"default",{value:e,enumerable:!0}):r,e));var R=(e,t,r)=>eO(e,typeof t!="symbol"?t+"":t,r);var _p=tO((JW,Sh)=>{Sh.exports={}});var dp={};nt(dp,{Any:()=>Qt,Argument:()=>$o,Array:()=>kr,AsyncIterator:()=>Fr,Awaited:()=>Mr,BigInt:()=>_r,Boolean:()=>ei,Capitalize:()=>Ho,Clone:()=>se,CloneRest:()=>cO,CloneType:()=>bn,Composite:()=>_o,Const:()=>Do,Constructor:()=>jr,ConstructorParameters:()=>Mo,CreateType:()=>y,Date:()=>ii,Enum:()=>Bo,Exclude:()=>Gr,ExcludeFromMappedResult:()=>Ql,ExcludeFromTemplateLiteral:()=>Yl,Extends:()=>Kr,ExtendsCheck:()=>Vr,ExtendsFromMappedKey:()=>Jl,ExtendsFromMappedResult:()=>zl,ExtendsResolverError:()=>$s,ExtendsResult:()=>b,ExtendsUndefinedCheck:()=>Pn,Extract:()=>qr,ExtractFromMappedResult:()=>Zl,ExtractFromTemplateLiteral:()=>Xl,FormatRegistry:()=>Ut,FromTypes:()=>Ui,Function:()=>yt,Hint:()=>ze,Increment:()=>_O,Index:()=>Zt,IndexFromComputed:()=>Fx,IndexFromMappedKey:()=>Ul,IndexFromMappedResult:()=>Fl,IndexFromPropertyKey:()=>jl,IndexFromPropertyKeys:()=>Fi,IndexPropertyKeys:()=>Qe,InstanceType:()=>Vo,Instantiate:()=>qo,Integer:()=>Wo,Intersect:()=>Ae,IntersectEvaluated:()=>Ro,Intrinsic:()=>Vt,IntrinsicFromMappedKey:()=>rp,IsTemplateLiteralExpressionFinite:()=>Cn,IsTemplateLiteralFinite:()=>No,Iterator:()=>Dr,JavaScriptTypeBuilder:()=>ks,JsonTypeBuilder:()=>_i,KeyOf:()=>Br,KeyOfFromMappedResult:()=>Bl,KeyOfPattern:()=>ni,KeyOfPropertyEntries:()=>Uo,KeyOfPropertyKeys:()=>Ze,KeyOfPropertyKeysToRest:()=>xf,Kind:()=>g,KindGuard:()=>Yt,Literal:()=>j,Lowercase:()=>zo,Mapped:()=>Fo,MappedFunctionReturnType:()=>gf,MappedKey:()=>nx,MappedResult:()=>W,Module:()=>Xo,Never:()=>k,Not:()=>Zo,Null:()=>oi,Number:()=>Ye,Object:()=>q,Omit:()=>tr,OmitFromMappedKey:()=>op,OmitFromMappedResult:()=>np,Optional:()=>$e,OptionalFromMappedResult:()=>Dl,OptionalKind:()=>Ne,Parameters:()=>ea,Partial:()=>Wr,PartialFromMappedResult:()=>lp,PatternBoolean:()=>xs,PatternBooleanExact:()=>DO,PatternNever:()=>sf,PatternNeverExact:()=>$l,PatternNumber:()=>Li,PatternNumberExact:()=>Nr,PatternString:()=>Ss,PatternStringExact:()=>Rr,Pick:()=>rr,PickFromMappedKey:()=>cp,PickFromMappedResult:()=>ap,Promise:()=>ri,Readonly:()=>Be,ReadonlyFromMappedResult:()=>_l,ReadonlyKind:()=>vt,ReadonlyOptional:()=>li,Record:()=>mi,RecordKey:()=>tp,RecordPattern:()=>Ko,RecordValue:()=>Go,Recursive:()=>ta,Ref:()=>bt,RegExp:()=>ra,Required:()=>Hr,RequiredFromMappedResult:()=>pp,Rest:()=>na,ReturnType:()=>ia,SetComplement:()=>ex,SetDistinct:()=>Al,SetIncludes:()=>Is,SetIntersect:()=>cf,SetIntersectMany:()=>vl,SetIsSubset:()=>XO,SetUnion:()=>ZO,SetUnionMany:()=>Ll,String:()=>ke,Symbol:()=>ai,TModule:()=>Ls,TemplateLiteral:()=>ti,TemplateLiteralExpressionGenerate:()=>ki,TemplateLiteralFiniteError:()=>ws,TemplateLiteralGenerate:()=>Zn,TemplateLiteralGenerateError:()=>Cs,TemplateLiteralParse:()=>Qn,TemplateLiteralParseExact:()=>Xn,TemplateLiteralParserError:()=>vo,TemplateLiteralPattern:()=>Ps,TemplateLiteralPatternError:()=>Ts,TemplateLiteralSyntax:()=>kl,TemplateLiteralToUnion:()=>Tn,Transform:()=>oa,TransformDecodeBuilder:()=>Ns,TransformEncodeBuilder:()=>Rs,TransformKind:()=>ue,Tuple:()=>Xe,Type:()=>n,TypeBoxError:()=>A,TypeGuard:()=>d,TypeRegistry:()=>_t,Uint8Array:()=>ci,Uncapitalize:()=>Jo,Undefined:()=>si,Union:()=>G,UnionEvaluated:()=>Xt,Unknown:()=>lt,Unsafe:()=>aa,Uppercase:()=>Yo,ValueGuard:()=>De,Void:()=>sa});var De={};nt(De,{HasPropertyKey:()=>ds,IsArray:()=>Ie,IsAsyncIterator:()=>yl,IsBigInt:()=>bo,IsBoolean:()=>dr,IsDate:()=>zn,IsFunction:()=>bl,IsIterator:()=>Ol,IsNull:()=>xl,IsNumber:()=>it,IsObject:()=>ee,IsRegExp:()=>Oo,IsString:()=>ie,IsSymbol:()=>Sl,IsUint8Array:()=>Ar,IsUndefined:()=>we});function ds(e,t){return t in e}function yl(e){return ee(e)&&!Ie(e)&&!Ar(e)&&Symbol.asyncIterator in e}function Ie(e){return Array.isArray(e)}function bo(e){return typeof e=="bigint"}function dr(e){return typeof e=="boolean"}function zn(e){return e instanceof globalThis.Date}function bl(e){return typeof e=="function"}function Ol(e){return ee(e)&&!Ie(e)&&!Ar(e)&&Symbol.iterator in e}function xl(e){return e===null}function it(e){return typeof e=="number"}function ee(e){return typeof e=="object"&&e!==null}function Oo(e){return e instanceof globalThis.RegExp}function ie(e){return typeof e=="string"}function Sl(e){return typeof e=="symbol"}function Ar(e){return e instanceof globalThis.Uint8Array}function we(e){return e===void 0}function nO(e){return e.map(t=>fs(t))}function iO(e){return new Date(e.getTime())}function oO(e){return new Uint8Array(e)}function aO(e){return new RegExp(e.source,e.flags)}function sO(e){let t={};for(let r of Object.getOwnPropertyNames(e))t[r]=fs(e[r]);for(let r of Object.getOwnPropertySymbols(e))t[r]=fs(e[r]);return t}function fs(e){return Ie(e)?nO(e):zn(e)?iO(e):Ar(e)?oO(e):Oo(e)?aO(e):ee(e)?sO(e):e}function se(e){return fs(e)}function cO(e){return e.map(t=>bn(t))}function bn(e,t){return t===void 0?se(e):se({...t,...e})}function xo(e){return L(e)&&globalThis.Symbol.asyncIterator in e}function So(e){return L(e)&&globalThis.Symbol.iterator in e}function hs(e){return L(e)&&(globalThis.Object.getPrototypeOf(e)===Object.prototype||globalThis.Object.getPrototypeOf(e)===null)}function lO(e){return L(e)&&!$(e)&&hr(e.constructor)&&e.constructor.name!=="Object"}function Io(e){return e instanceof globalThis.Promise}function Ge(e){return e instanceof Date&&globalThis.Number.isFinite(e.getTime())}function Il(e){return e instanceof globalThis.Map}function wl(e){return e instanceof globalThis.Set}function pO(e){return e instanceof globalThis.RegExp}function gt(e){return globalThis.ArrayBuffer.isView(e)}function mO(e){return e instanceof globalThis.Int8Array}function Jn(e){return e instanceof globalThis.Uint8Array}function uO(e){return e instanceof globalThis.Uint8ClampedArray}function dO(e){return e instanceof globalThis.Int16Array}function fO(e){return e instanceof globalThis.Uint16Array}function hO(e){return e instanceof globalThis.Int32Array}function gO(e){return e instanceof globalThis.Uint32Array}function yO(e){return e instanceof globalThis.Float32Array}function bO(e){return e instanceof globalThis.Float64Array}function OO(e){return e instanceof globalThis.BigInt64Array}function xO(e){return e instanceof globalThis.BigUint64Array}function E(e,t){return t in e}function L(e){return e!==null&&typeof e=="object"}function $(e){return globalThis.Array.isArray(e)&&!globalThis.ArrayBuffer.isView(e)}function ce(e){return e===void 0}function fr(e){return e===null}function Jt(e){return typeof e=="boolean"}function le(e){return typeof e=="number"}function wo(e){return globalThis.Number.isInteger(e)}function At(e){return typeof e=="bigint"}function X(e){return typeof e=="string"}function hr(e){return typeof e=="function"}function gr(e){return typeof e=="symbol"}function ot(e){return At(e)||Jt(e)||fr(e)||le(e)||X(e)||gr(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&&!$(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 SO(e){return globalThis.Object.freeze(e).map(t=>Co(t))}function IO(e){let t={};for(let r of Object.getOwnPropertyNames(e))t[r]=Co(e[r]);for(let r of Object.getOwnPropertySymbols(e))t[r]=Co(e[r]);return globalThis.Object.freeze(t)}function Co(e){return Ie(e)?SO(e):zn(e)?e:Ar(e)?e:Oo(e)?e:ee(e)?IO(e):e}function y(e,t){let r=t!==void 0?{...t,...e}:e;switch(Te.InstanceMode){case"freeze":return Co(r);case"clone":return se(r);default:return r}}var A=class extends Error{constructor(t){super(t)}};var Yt={};nt(Yt,{IsAny:()=>gs,IsArgument:()=>ys,IsArray:()=>Lt,IsAsyncIterator:()=>On,IsBigInt:()=>xn,IsBoolean:()=>yr,IsComputed:()=>Nt,IsConstructor:()=>Rt,IsDate:()=>md,IsFunction:()=>kt,IsImport:()=>wO,IsInteger:()=>Ft,IsIntersect:()=>ge,IsIterator:()=>Sn,IsKind:()=>Lr,IsKindOf:()=>U,IsLiteral:()=>Me,IsLiteralBoolean:()=>EO,IsLiteralNumber:()=>PO,IsLiteralString:()=>TO,IsLiteralValue:()=>To,IsMappedKey:()=>at,IsMappedResult:()=>pe,IsNever:()=>vr,IsNot:()=>ud,IsNull:()=>Ai,IsNumber:()=>jt,IsObject:()=>Se,IsOptional:()=>Je,IsPromise:()=>In,IsProperties:()=>CO,IsReadonly:()=>Yn,IsRecord:()=>wn,IsRecursive:()=>$O,IsRef:()=>Oe,IsRegExp:()=>bs,IsSchema:()=>de,IsString:()=>br,IsSymbol:()=>vi,IsTemplateLiteral:()=>st,IsThis:()=>dd,IsTransform:()=>z,IsTuple:()=>ct,IsUint8Array:()=>fd,IsUndefined:()=>Or,IsUnion:()=>K,IsUnknown:()=>hd,IsUnsafe:()=>gd,IsVoid:()=>yd});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 gs(e){return U(e,"Any")}function ys(e){return U(e,"Argument")}function Lt(e){return U(e,"Array")}function On(e){return U(e,"AsyncIterator")}function xn(e){return U(e,"BigInt")}function yr(e){return U(e,"Boolean")}function Nt(e){return U(e,"Computed")}function Rt(e){return U(e,"Constructor")}function md(e){return U(e,"Date")}function kt(e){return U(e,"Function")}function wO(e){return U(e,"Import")}function Ft(e){return U(e,"Integer")}function CO(e){return ee(e)}function ge(e){return U(e,"Intersect")}function Sn(e){return U(e,"Iterator")}function U(e,t){return ee(e)&&g in e&&e[g]===t}function TO(e){return Me(e)&&ie(e.const)}function PO(e){return Me(e)&&it(e.const)}function EO(e){return Me(e)&&dr(e.const)}function To(e){return dr(e)||it(e)||ie(e)}function Me(e){return U(e,"Literal")}function at(e){return U(e,"MappedKey")}function pe(e){return U(e,"MappedResult")}function vr(e){return U(e,"Never")}function ud(e){return U(e,"Not")}function Ai(e){return U(e,"Null")}function jt(e){return U(e,"Number")}function Se(e){return U(e,"Object")}function In(e){return U(e,"Promise")}function wn(e){return U(e,"Record")}function $O(e){return ee(e)&&ze in e&&e[ze]==="Recursive"}function Oe(e){return U(e,"Ref")}function bs(e){return U(e,"RegExp")}function br(e){return U(e,"String")}function vi(e){return U(e,"Symbol")}function st(e){return U(e,"TemplateLiteral")}function dd(e){return U(e,"This")}function z(e){return ee(e)&&ue in e}function ct(e){return U(e,"Tuple")}function Or(e){return U(e,"Undefined")}function K(e){return U(e,"Union")}function fd(e){return U(e,"Uint8Array")}function hd(e){return U(e,"Unknown")}function gd(e){return U(e,"Unsafe")}function yd(e){return U(e,"Void")}function Lr(e){return ee(e)&&g in e&&ie(e[g])}function de(e){return gs(e)||ys(e)||Lt(e)||yr(e)||xn(e)||On(e)||Nt(e)||Rt(e)||md(e)||kt(e)||Ft(e)||ge(e)||Sn(e)||Me(e)||at(e)||pe(e)||vr(e)||ud(e)||Ai(e)||jt(e)||Se(e)||In(e)||wn(e)||Oe(e)||bs(e)||br(e)||vi(e)||st(e)||dd(e)||ct(e)||Or(e)||K(e)||fd(e)||hd(e)||gd(e)||yd(e)||Lr(e)}var d={};nt(d,{IsAny:()=>Sd,IsArgument:()=>Id,IsArray:()=>wd,IsAsyncIterator:()=>Cd,IsBigInt:()=>Td,IsBoolean:()=>Pd,IsComputed:()=>Ed,IsConstructor:()=>$d,IsDate:()=>Ad,IsFunction:()=>vd,IsImport:()=>kO,IsInteger:()=>Ld,IsIntersect:()=>Nd,IsIterator:()=>Rd,IsKind:()=>af,IsKindOf:()=>_,IsLiteral:()=>Eo,IsLiteralBoolean:()=>FO,IsLiteralNumber:()=>Fd,IsLiteralString:()=>kd,IsLiteralValue:()=>jd,IsMappedKey:()=>Ud,IsMappedResult:()=>_d,IsNever:()=>Dd,IsNot:()=>Md,IsNull:()=>Bd,IsNumber:()=>Vd,IsObject:()=>Kd,IsOptional:()=>RO,IsPromise:()=>Gd,IsProperties:()=>Os,IsReadonly:()=>NO,IsRecord:()=>qd,IsRecursive:()=>jO,IsRef:()=>Wd,IsRegExp:()=>Hd,IsSchema:()=>Re,IsString:()=>zd,IsSymbol:()=>Jd,IsTemplateLiteral:()=>Yd,IsThis:()=>Qd,IsTransform:()=>Xd,IsTuple:()=>Zd,IsUint8Array:()=>tf,IsUndefined:()=>ef,IsUnion:()=>El,IsUnionLiteral:()=>UO,IsUnknown:()=>rf,IsUnsafe:()=>nf,IsVoid:()=>of,TypeGuardUnknownTypeError:()=>Cl});var Cl=class extends A{},AO=["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 bd(e){try{return new RegExp(e),!0}catch{return!1}}function Tl(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 Od(e){return Pl(e)||Re(e)}function Po(e){return we(e)||bo(e)}function oe(e){return we(e)||it(e)}function Pl(e){return we(e)||dr(e)}function re(e){return we(e)||ie(e)}function vO(e){return we(e)||ie(e)&&Tl(e)&&bd(e)}function LO(e){return we(e)||ie(e)&&Tl(e)}function xd(e){return we(e)||Re(e)}function NO(e){return ee(e)&&e[vt]==="Readonly"}function RO(e){return ee(e)&&e[Ne]==="Optional"}function Sd(e){return _(e,"Any")&&re(e.$id)}function Id(e){return _(e,"Argument")&&it(e.index)}function wd(e){return _(e,"Array")&&e.type==="array"&&re(e.$id)&&Re(e.items)&&oe(e.minItems)&&oe(e.maxItems)&&Pl(e.uniqueItems)&&xd(e.contains)&&oe(e.minContains)&&oe(e.maxContains)}function Cd(e){return _(e,"AsyncIterator")&&e.type==="AsyncIterator"&&re(e.$id)&&Re(e.items)}function Td(e){return _(e,"BigInt")&&e.type==="bigint"&&re(e.$id)&&Po(e.exclusiveMaximum)&&Po(e.exclusiveMinimum)&&Po(e.maximum)&&Po(e.minimum)&&Po(e.multipleOf)}function Pd(e){return _(e,"Boolean")&&e.type==="boolean"&&re(e.$id)}function Ed(e){return _(e,"Computed")&&ie(e.target)&&Ie(e.parameters)&&e.parameters.every(t=>Re(t))}function $d(e){return _(e,"Constructor")&&e.type==="Constructor"&&re(e.$id)&&Ie(e.parameters)&&e.parameters.every(t=>Re(t))&&Re(e.returns)}function Ad(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 vd(e){return _(e,"Function")&&e.type==="Function"&&re(e.$id)&&Ie(e.parameters)&&e.parameters.every(t=>Re(t))&&Re(e.returns)}function kO(e){return _(e,"Import")&&ds(e,"$defs")&&ee(e.$defs)&&Os(e.$defs)&&ds(e,"$ref")&&ie(e.$ref)&&e.$ref in e.$defs}function Ld(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 Os(e){return ee(e)&&Object.entries(e).every(([t,r])=>Tl(t)&&Re(r))}function Nd(e){return _(e,"Intersect")&&!(ie(e.type)&&e.type!=="object")&&Ie(e.allOf)&&e.allOf.every(t=>Re(t)&&!Xd(t))&&re(e.type)&&(Pl(e.unevaluatedProperties)||xd(e.unevaluatedProperties))&&re(e.$id)}function Rd(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 kd(e){return Eo(e)&&ie(e.const)}function Fd(e){return Eo(e)&&it(e.const)}function FO(e){return Eo(e)&&dr(e.const)}function Eo(e){return _(e,"Literal")&&re(e.$id)&&jd(e.const)}function jd(e){return dr(e)||it(e)||ie(e)}function Ud(e){return _(e,"MappedKey")&&Ie(e.keys)&&e.keys.every(t=>it(t)||ie(t))}function _d(e){return _(e,"MappedResult")&&Os(e.properties)}function Dd(e){return _(e,"Never")&&ee(e.not)&&Object.getOwnPropertyNames(e.not).length===0}function Md(e){return _(e,"Not")&&Re(e.not)}function Bd(e){return _(e,"Null")&&e.type==="null"&&re(e.$id)}function Vd(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 Kd(e){return _(e,"Object")&&e.type==="object"&&re(e.$id)&&Os(e.properties)&&Od(e.additionalProperties)&&oe(e.minProperties)&&oe(e.maxProperties)}function Gd(e){return _(e,"Promise")&&e.type==="Promise"&&re(e.$id)&&Re(e.item)}function qd(e){return _(e,"Record")&&e.type==="object"&&re(e.$id)&&Od(e.additionalProperties)&&ee(e.patternProperties)&&(t=>{let r=Object.getOwnPropertyNames(t.patternProperties);return r.length===1&&bd(r[0])&&ee(t.patternProperties)&&Re(t.patternProperties[r[0]])})(e)}function jO(e){return ee(e)&&ze in e&&e[ze]==="Recursive"}function Wd(e){return _(e,"Ref")&&re(e.$id)&&ie(e.$ref)}function Hd(e){return _(e,"RegExp")&&re(e.$id)&&ie(e.source)&&ie(e.flags)&&oe(e.maxLength)&&oe(e.minLength)}function zd(e){return _(e,"String")&&e.type==="string"&&re(e.$id)&&oe(e.minLength)&&oe(e.maxLength)&&vO(e.pattern)&&LO(e.format)}function Jd(e){return _(e,"Symbol")&&e.type==="symbol"&&re(e.$id)}function Yd(e){return _(e,"TemplateLiteral")&&e.type==="string"&&ie(e.pattern)&&e.pattern[0]==="^"&&e.pattern[e.pattern.length-1]==="$"}function Qd(e){return _(e,"This")&&re(e.$id)&&ie(e.$ref)}function Xd(e){return ee(e)&&ue in e}function Zd(e){return _(e,"Tuple")&&e.type==="array"&&re(e.$id)&&it(e.minItems)&&it(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 ef(e){return _(e,"Undefined")&&e.type==="undefined"&&re(e.$id)}function UO(e){return El(e)&&e.anyOf.every(t=>kd(t)||Fd(t))}function El(e){return _(e,"Union")&&re(e.$id)&&ee(e)&&Ie(e.anyOf)&&e.anyOf.every(t=>Re(t))}function tf(e){return _(e,"Uint8Array")&&e.type==="Uint8Array"&&re(e.$id)&&oe(e.minByteLength)&&oe(e.maxByteLength)}function rf(e){return _(e,"Unknown")&&re(e.$id)}function nf(e){return _(e,"Unsafe")}function of(e){return _(e,"Void")&&e.type==="void"&&re(e.$id)}function af(e){return ee(e)&&g in e&&ie(e[g])&&!AO.includes(e[g])}function Re(e){return ee(e)&&(Sd(e)||Id(e)||wd(e)||Pd(e)||Td(e)||Cd(e)||Ed(e)||$d(e)||Ad(e)||vd(e)||Ld(e)||Nd(e)||Rd(e)||Eo(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)||Jd(e)||Yd(e)||Qd(e)||Zd(e)||ef(e)||El(e)||tf(e)||rf(e)||nf(e)||of(e)||af(e))}function _O(e){return(parseInt(e)+1).toString()}var xs="(true|false)",Li="(0|[1-9][0-9]*)",Ss="(.*)",sf="(?!.*)",DO=`^${xs}$`,Nr=`^${Li}$`,Rr=`^${Ss}$`,$l=`^${sf}$`;var Ut={};nt(Ut,{Clear:()=>BO,Delete:()=>VO,Entries:()=>MO,Get:()=>qO,Has:()=>KO,Set:()=>GO});var Ni=new Map;function MO(){return new Map(Ni)}function BO(){return Ni.clear()}function VO(e){return Ni.delete(e)}function KO(e){return Ni.has(e)}function GO(e,t){Ni.set(e,t)}function qO(e){return Ni.get(e)}var _t={};nt(_t,{Clear:()=>HO,Delete:()=>zO,Entries:()=>WO,Get:()=>QO,Has:()=>JO,Set:()=>YO});var Ri=new Map;function WO(){return new Map(Ri)}function HO(){return Ri.clear()}function zO(e){return Ri.delete(e)}function JO(e){return Ri.has(e)}function YO(e,t){Ri.set(e,t)}function QO(e){return Ri.get(e)}function Is(e,t){return e.includes(t)}function XO(e,t){return e.every(r=>Is(t,r))}function Al(e){return[...new Set(e)]}function cf(e,t){return e.filter(r=>t.includes(r))}function ZO(e,t){return[...e,...t]}function ex(e,t){return e.filter(r=>!t.includes(r))}function tx(e,t){return e.reduce((r,i)=>cf(r,i),t)}function vl(e){return e.length===1?e[0]:e.length>1?tx(e.slice(1),e[0]):[]}function Ll(e){let t=[];for(let r of e)t.push(...r);return t}function Qt(e){return y({[g]:"Any"},e)}function kr(e,t){return y({[g]:"Array",type:"array",items:e},t)}function $o(e){return y({[g]:"Argument",index:e})}function Fr(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 rx(e,t){let{[t]:r,...i}=e;return i}function xe(e,t){return t.reduce((r,i)=>rx(r,i),e)}function k(e){return y({[g]:"Never",not:{}},e)}function nx(e){return y({[g]:"MappedKey",keys:e})}function W(e){return y({[g]:"MappedResult",properties:e})}function jr(e,t,r){return y({[g]:"Constructor",type:"Constructor",parameters:e,returns:t},r)}function yt(e,t,r){return y({[g]:"Function",type:"Function",parameters:e,returns:t},r)}function Ao(e,t){return y({[g]:"Union",anyOf:e},t)}function ix(e){return e.some(t=>Je(t))}function lf(e){return e.map(t=>Je(t)?ox(t):t)}function ox(e){return xe(e,[Ne])}function ax(e,t){return ix(e)?$e(Ao(lf(e),t)):Ao(lf(e),t)}function Xt(e,t){return e.length===1?y(e[0],t):e.length===0?k(t):ax(e,t)}function G(e,t){return e.length===0?k(t):e.length===1?y(e[0],t):Ao(e,t)}var vo=class extends A{};function sx(e){return e.replace(/\\\\\\$/g,"$").replace(/\\\\\\*/g,"*").replace(/\\\\\\^/g,"^").replace(/\\\\\\|/g,"|").replace(/\\\\\\(/g,"(").replace(/\\\\\\)/g,")")}function Nl(e,t,r){return e[t]===r&&e.charCodeAt(t-1)!==92}function Ur(e,t){return Nl(e,t,"(")}function Lo(e,t){return Nl(e,t,")")}function pf(e,t){return Nl(e,t,"|")}function cx(e){if(!(Ur(e,0)&&Lo(e,e.length-1)))return!1;let t=0;for(let r=0;r<e.length;r++)if(Ur(e,r)&&(t+=1),Lo(e,r)&&(t-=1),t===0&&r!==e.length-1)return!1;return!0}function lx(e){return e.slice(1,e.length-1)}function px(e){let t=0;for(let r=0;r<e.length;r++)if(Ur(e,r)&&(t+=1),Lo(e,r)&&(t-=1),pf(e,r)&&t===0)return!0;return!1}function mx(e){for(let t=0;t<e.length;t++)if(Ur(e,t))return!0;return!1}function ux(e){let[t,r]=[0,0],i=[];for(let a=0;a<e.length;a++)if(Ur(e,a)&&(t+=1),Lo(e,a)&&(t-=1),pf(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 dx(e){function t(o,a){if(!Ur(o,a))throw new vo("TemplateLiteralParser: Index must point to open parens");let s=0;for(let c=a;c<o.length;c++)if(Ur(o,c)&&(s+=1),Lo(o,c)&&(s-=1),s===0)return[a,c];throw new vo("TemplateLiteralParser: Unclosed group parens in expression")}function r(o,a){for(let s=a;s<o.length;s++)if(Ur(o,s))return[a,s];return[a,o.length]}let i=[];for(let o=0;o<e.length;o++)if(Ur(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 cx(e)?Qn(lx(e)):px(e)?ux(e):mx(e)?dx(e):{type:"const",const:sx(e)}}function Xn(e){return Qn(e.slice(1,e.length-1))}var ws=class extends A{};function fx(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 hx(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 gx(e){return e.type==="const"&&e.const===".*"}function Cn(e){return fx(e)||gx(e)?!1:hx(e)?!0:e.type==="and"?e.expr.every(t=>Cn(t)):e.type==="or"?e.expr.every(t=>Cn(t)):e.type==="const"?!0:(()=>{throw new ws("Unknown expression type")})()}function No(e){let t=Xn(e.pattern);return Cn(t)}var Cs=class extends A{};function*mf(e){if(e.length===1)return yield*e[0];for(let t of e[0])for(let r of mf(e.slice(1)))yield`${t}${r}`}function*yx(e){return yield*mf(e.expr.map(t=>[...ki(t)]))}function*bx(e){for(let t of e.expr)yield*ki(t)}function*Ox(e){return yield e.const}function*ki(e){return e.type==="and"?yield*yx(e):e.type==="or"?yield*bx(e):e.type==="const"?yield*Ox(e):(()=>{throw new Cs("Unknown expression")})()}function Zn(e){let t=Xn(e.pattern);return Cn(t)?[...ki(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 _r(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*xx(e){let t=e.trim().replace(/"|\'/g,"");return t==="boolean"?yield ei():t==="number"?yield Ye():t==="bigint"?yield _r():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*Sx(e){if(e[1]!=="{"){let t=j("$"),r=Rl(e.slice(1));return yield*[t,...r]}for(let t=2;t<e.length;t++)if(e[t]==="}"){let r=xx(e.slice(2,t)),i=Rl(e.slice(t+1));return yield*[...r,...i]}yield j(e)}function*Rl(e){for(let t=0;t<e.length;t++)if(e[t]==="$"){let r=j(e.slice(0,t)),i=Sx(e.slice(t));return yield*[r,...i]}yield j(e)}function kl(e){return[...Rl(e)]}var Ts=class extends A{};function Ix(e){return e.replace(/[.*+?^${}()|[\\]\\\\]/g,"\\\\$&")}function uf(e,t){return st(e)?e.pattern.slice(1,e.pattern.length-1):K(e)?`(${e.anyOf.map(r=>uf(r,t)).join("|")})`:jt(e)?`${t}${Li}`:Ft(e)?`${t}${Li}`:xn(e)?`${t}${Li}`:br(e)?`${t}${Ss}`:Me(e)?`${t}${Ix(e.const.toString())}`:yr(e)?`${t}${xs}`:(()=>{throw new Ts(`Unexpected Kind \'${e[g]}\'`)})()}function Ps(e){return`^${e.map(t=>uf(t,"")).join("")}$`}function Tn(e){let r=Zn(e).map(i=>j(i));return Xt(r)}function ti(e,t){let r=ie(e)?Ps(kl(e)):Ps(e);return y({[g]:"TemplateLiteral",type:"string",pattern:r},t)}function wx(e){return Zn(e).map(r=>r.toString())}function Cx(e){let t=[];for(let r of e)t.push(...Qe(r));return t}function Tx(e){return[e.toString()]}function Qe(e){return[...new Set(st(e)?wx(e):K(e)?Cx(e.anyOf):Me(e)?Tx(e.const):jt(e)?["[number]"]:Ft(e)?["[number]"]:[])]}function Px(e,t,r){let i={};for(let o of Object.getOwnPropertyNames(t))i[o]=Zt(e,Qe(t[o]),r);return i}function Ex(e,t,r){return Px(e,t.properties,r)}function Fl(e,t,r){let i=Ex(e,t,r);return W(i)}function ff(e,t){return e.map(r=>jl(r,t))}function $x(e){return e.filter(t=>!vr(t))}function Ax(e,t){return Ro($x(ff(e,t)))}function vx(e){return e.some(t=>vr(t))?[]:e}function Lx(e,t){return Xt(vx(ff(e,t)))}function Nx(e,t){return t in e?e[t]:t==="[number]"?Xt(e):k()}function Rx(e,t){return t==="[number]"?e:k()}function kx(e,t){return t in e?e[t]:k()}function jl(e,t){return ge(e)?Ax(e.allOf,t):K(e)?Lx(e.anyOf,t):ct(e)?Nx(e.items??[],t):Lt(e)?Rx(e.items,t):Se(e)?kx(e.properties,t):k()}function Fi(e,t){return t.map(r=>jl(e,r))}function df(e,t){return Xt(Fi(e,t))}function Fx(e,t){return ae("Index",[e,t])}function Zt(e,t,r){if(Oe(e)||Oe(t)){let i="Index types using Ref parameters require both Type and Key to be of TSchema";if(!de(e)||!de(t))throw new A(i);return ae("Index",[e,t])}return pe(t)?Fl(e,t,r):at(t)?Ul(e,t,r):y(de(t)?df(e,Qe(t)):df(e,t),r)}function jx(e,t,r){return{[t]:Zt(e,[t],se(r))}}function Ux(e,t,r){return t.reduce((i,o)=>({...i,...jx(e,o,r)}),{})}function _x(e,t,r){return Ux(e,t.keys,r)}function Ul(e,t,r){let i=_x(e,t,r);return W(i)}function Dr(e,t){return y({[g]:"Iterator",type:"Iterator",items:e},t)}function Dx(e){let t=[];for(let r in e)Je(e[r])||t.push(r);return t}function Mx(e,t){let r=Dx(e),i=r.length>0?{[g]:"Object",type:"object",properties:e,required:r}:{[g]:"Object",type:"object",properties:e};return y(i,t)}var q=Mx;function ri(e,t){return y({[g]:"Promise",type:"Promise",item:e},t)}function Bx(e){return y(xe(e,[vt]))}function Vx(e){return y({...e,[vt]:"Readonly"})}function Kx(e,t){return t===!1?Bx(e):Vx(e)}function Be(e,t){let r=t??!0;return pe(e)?_l(e,r):Kx(e,r)}function Gx(e,t){let r={};for(let i of globalThis.Object.getOwnPropertyNames(e))r[i]=Be(e[i],t);return r}function qx(e,t){return Gx(e.properties,t)}function _l(e,t){let r=qx(e,t);return W(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 hf(e,t){return e in t?Dt(e,t[e]):W(t)}function Wx(e){return{[e]:j(e)}}function Hx(e){let t={};for(let r of e)t[r]=j(r);return t}function zx(e,t){return Is(t,e)?Wx(e):Hx(t)}function Jx(e,t){let r=zx(e,t);return hf(e,r)}function ko(e,t){return t.map(r=>Dt(e,r))}function Yx(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)?$e(Dt(e,xe(t,[Ne]))):Yn(t)?Be(Dt(e,xe(t,[vt]))):pe(t)?hf(e,t.properties):at(t)?Jx(e,t.keys):Rt(t)?jr(ko(e,t.parameters),Dt(e,t.returns),r):kt(t)?yt(ko(e,t.parameters),Dt(e,t.returns),r):On(t)?Fr(Dt(e,t.items),r):Sn(t)?Dr(Dt(e,t.items),r):ge(t)?Ae(ko(e,t.allOf),r):K(t)?G(ko(e,t.anyOf),r):ct(t)?Xe(ko(e,t.items??[]),r):Se(t)?q(Yx(e,t.properties),r):Lt(t)?kr(Dt(e,t.items),r):In(t)?ri(Dt(e,t.item),r):t}function gf(e,t){let r={};for(let i of e)r[i]=Dt(i,t);return r}function Fo(e,t,r){let i=de(e)?Qe(e):e,o=t({[g]:"MappedKey",keys:i}),a=gf(i,o);return q(a,r)}function Qx(e){return y(xe(e,[Ne]))}function Xx(e){return y({...e,[Ne]:"Optional"})}function Zx(e,t){return t===!1?Qx(e):Xx(e)}function $e(e,t){let r=t??!0;return pe(e)?Dl(e,r):Zx(e,r)}function eS(e,t){let r={};for(let i of globalThis.Object.getOwnPropertyNames(e))r[i]=$e(e[i],t);return r}function tS(e,t){return eS(e.properties,t)}function Dl(e,t){let r=tS(e,t);return W(r)}function jo(e,t={}){let r=e.every(o=>Se(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 rS(e){return e.every(t=>Je(t))}function nS(e){return xe(e,[Ne])}function yf(e){return e.map(t=>Je(t)?nS(t):t)}function iS(e,t){return rS(e)?$e(jo(yf(e),t)):jo(yf(e),t)}function Ro(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 iS(e,t)}function Ae(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 jo(e,t)}function bt(...e){let[t,r]=typeof e[0]=="string"?[e[0],e[1]]:[e[0].$id,e[1]];if(typeof t!="string")throw new A("Ref: $ref must be a string");return y({[g]:"Ref",$ref:t},r)}function oS(e,t){return ae("Awaited",[ae(e,t)])}function aS(e){return ae("Awaited",[bt(e)])}function sS(e){return Ae(bf(e))}function cS(e){return G(bf(e))}function lS(e){return Mr(e)}function bf(e){return e.map(t=>Mr(t))}function Mr(e,t){return y(Nt(e)?oS(e.target,e.parameters):ge(e)?sS(e.allOf):K(e)?cS(e.anyOf):In(e)?lS(e.item):Oe(e)?aS(e.$ref):e,t)}function Of(e){let t=[];for(let r of e)t.push(Ze(r));return t}function pS(e){let t=Of(e);return Ll(t)}function mS(e){let t=Of(e);return vl(t)}function uS(e){return e.map((t,r)=>r.toString())}function dS(e){return["[number]"]}function fS(e){return globalThis.Object.getOwnPropertyNames(e)}function hS(e){return Ml?globalThis.Object.getOwnPropertyNames(e).map(r=>r[0]==="^"&&r[r.length-1]==="$"?r.slice(1,r.length-1):r):[]}function Ze(e){return ge(e)?pS(e.allOf):K(e)?mS(e.anyOf):ct(e)?uS(e.items??[]):Lt(e)?dS(e.items):Se(e)?fS(e.properties):wn(e)?hS(e.patternProperties):[]}var Ml=!1;function ni(e){Ml=!0;let t=Ze(e);return Ml=!1,`^(${t.map(i=>`(${i})`).join("|")})$`}function gS(e,t){return ae("KeyOf",[ae(e,t)])}function yS(e){return ae("KeyOf",[bt(e)])}function bS(e,t){let r=Ze(e),i=xf(r),o=Xt(i);return y(o,t)}function xf(e){return e.map(t=>t==="[number]"?Ye():j(t))}function Br(e,t){return Nt(e)?gS(e.target,e.parameters):Oe(e)?yS(e.$ref):pe(e)?Bl(e,t):bS(e,t)}function OS(e,t){let r={};for(let i of globalThis.Object.getOwnPropertyNames(e))r[i]=Br(e[i],se(t));return r}function xS(e,t){return OS(e.properties,t)}function Bl(e,t){let r=xS(e,t);return W(r)}function Uo(e){let t=Ze(e),r=Fi(e,t);return t.map((i,o)=>[t[o],r[o]])}function SS(e){let t=[];for(let r of e)t.push(...Ze(r));return Al(t)}function IS(e){return e.filter(t=>!vr(t))}function wS(e,t){let r=[];for(let i of e)r.push(...Fi(i,[t]));return IS(r)}function CS(e,t){let r={};for(let i of t)r[i]=Ro(wS(e,i));return r}function _o(e,t){let r=SS(e),i=CS(e,r);return q(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 lt(e){return y({[g]:"Unknown"},e)}function TS(e){return e.map(t=>Vl(t,!1))}function PS(e){let t={};for(let r of globalThis.Object.getOwnPropertyNames(e))t[r]=Be(Vl(e[r],!1));return t}function Es(e,t){return t===!0?e:Be(e)}function Vl(e,t){return yl(e)?Es(Qt(),t):Ol(e)?Es(Qt(),t):Ie(e)?Be(Xe(TS(e))):Ar(e)?ci():zn(e)?ii():ee(e)?Es(q(PS(e)),t):bl(e)?Es(yt([],lt()),t):we(e)?si():xl(e)?oi():Sl(e)?ai():bo(e)?_r():it(e)?j(e):dr(e)?j(e):ie(e)?j(e):q({})}function Do(e,t){return y(Vl(e,!0),t)}function Mo(e,t){return Rt(e)?Xe(e.parameters,t):k(t)}function Bo(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 G(o,{...t,[ze]:"Enum"})}var $s=class extends A{},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 ji(e){throw new $s(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)?Ef(e,t):d.IsIntersect(t)?As(e,t):d.IsUnion(t)?Hl(e,t):d.IsUnknown(t)?Lf(e,t):d.IsAny(t)?Wl(e,t):ji("StructuralRight")}function Wl(e,t){return b.True}function ES(e,t){return d.IsIntersect(t)?As(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 $S(e,t){return d.IsUnknown(e)?b.False:d.IsAny(e)?b.Union:d.IsNever(e)?b.True:b.False}function AS(e,t){return d.IsObject(t)&&vs(t)?b.True:Pe(t)?Ee(e,t):d.IsArray(t)?Mt(ne(e.items,t.items)):b.False}function vS(e,t){return Pe(t)?Ee(e,t):d.IsAsyncIterator(t)?Mt(ne(e.items,t.items)):b.False}function LS(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 Tf(e,t){return d.IsLiteralBoolean(e)||d.IsBoolean(e)?b.True:b.False}function NS(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 RS(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 kS(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 FS(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 Pf(e,t){return d.IsLiteral(e)&&De.IsNumber(e.const)||d.IsNumber(e)||d.IsInteger(e)?b.True:b.False}function jS(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 As(e,t){return t.allOf.every(r=>ne(e,r)===b.True)?b.True:b.False}function US(e,t){return e.allOf.some(r=>ne(r,t)===b.True)?b.True:b.False}function _S(e,t){return Pe(t)?Ee(e,t):d.IsIterator(t)?Mt(ne(e.items,t.items)):b.False}function DS(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)?vf(e,t):d.IsNumber(t)?$f(e,t):d.IsInteger(t)?Pf(e,t):d.IsBoolean(t)?Tf(e,t):b.False}function Ef(e,t){return b.False}function MS(e,t){return b.True}function Sf(e){let[t,r]=[e,0];for(;d.IsNot(t);)t=t.not,r+=1;return r%2===0?t:lt()}function BS(e,t){return d.IsNot(e)?ne(Sf(e),t):d.IsNot(t)?ne(e,Sf(t)):ji("Invalid fallthrough for Not")}function VS(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 $f(e,t){return d.IsLiteralNumber(e)||d.IsNumber(e)||d.IsInteger(e)?b.True:b.False}function KS(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 pt(e,t){return Object.getOwnPropertyNames(e.properties).length===t}function If(e){return vs(e)}function wf(e){return pt(e,0)||pt(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 Kl(e){return pt(e,0)}function Cf(e){return pt(e,0)}function GS(e){return pt(e,0)}function qS(e){return pt(e,0)}function WS(e){return vs(e)}function HS(e){let t=Ye();return pt(e,0)||pt(e,1)&&"length"in e.properties&&Mt(ne(e.properties.length,t))===b.True}function zS(e){return pt(e,0)}function vs(e){let t=Ye();return pt(e,0)||pt(e,1)&&"length"in e.properties&&Mt(ne(e.properties.length,t))===b.True}function JS(e){let t=yt([Qt()],Qt());return pt(e,0)||pt(e,1)&&"then"in e.properties&&Mt(ne(e.properties.then,t))===b.True}function Af(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)&&If(t)||d.IsLiteralNumber(e)&&Kl(t)||d.IsLiteralBoolean(e)&&Cf(t)||d.IsSymbol(e)&&wf(t)||d.IsBigInt(e)&&GS(t)||d.IsString(e)&&If(t)||d.IsSymbol(e)&&wf(t)||d.IsNumber(e)&&Kl(t)||d.IsInteger(e)&&Kl(t)||d.IsBoolean(e)&&Cf(t)||d.IsUint8Array(e)&&WS(t)||d.IsDate(e)&&qS(t)||d.IsConstructor(e)&&zS(t)||d.IsFunction(e)&&HS(t)?b.True:d.IsRecord(e)&&d.IsString(Gl(e))?t[ze]==="Record"?b.True:b.False:d.IsRecord(e)&&d.IsNumber(Gl(e))?pt(t,0)?b.True:b.False:b.False}function YS(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(Af(e.properties[r],t.properties[r])===b.False)return b.False}return b.True})():b.False}function QS(e,t){return Pe(t)?Ee(e,t):d.IsObject(t)&&JS(t)?b.True:d.IsPromise(t)?Mt(ne(e.item,t.item)):b.False}function Gl(e){return Nr in e.patternProperties?Ye():Rr in e.patternProperties?ke():ji("Unknown record key pattern")}function ql(e){return Nr in e.patternProperties?e.patternProperties[Nr]:Rr in e.patternProperties?e.patternProperties[Rr]:ji("Unable to get record value schema")}function Bt(e,t){let[r,i]=[Gl(t),ql(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(Af(i,e.properties[o])===b.False)return b.False;return b.True})():b.False}function XS(e,t){return Pe(t)?Ee(e,t):d.IsObject(t)?qe(e,t):d.IsRecord(t)?ne(ql(e),ql(t)):b.False}function ZS(e,t){let r=d.IsRegExp(e)?ke():e,i=d.IsRegExp(t)?ke():t;return ne(r,i)}function vf(e,t){return d.IsLiteral(e)&&De.IsString(e.const)||d.IsString(e)?b.True:b.False}function eI(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 tI(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 rI(e,t){return d.IsTemplateLiteral(e)?ne(Tn(e),t):d.IsTemplateLiteral(t)?ne(e,Tn(t)):ji("Invalid fallthrough for TemplateLiteral")}function nI(e,t){return d.IsArray(t)&&e.items!==void 0&&e.items.every(r=>ne(r,t.items)===b.True)}function iI(e,t){return d.IsNever(e)?b.True:d.IsUnknown(e)?b.False:d.IsAny(e)?b.Union:b.False}function oI(e,t){return Pe(t)?Ee(e,t):d.IsObject(t)&&vs(t)||d.IsArray(t)&&nI(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 aI(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 sI(e,t){return Pe(t)?Ee(e,t):d.IsObject(t)?qe(e,t):d.IsRecord(t)?Bt(e,t):d.IsVoid(t)?pI(e,t):d.IsUndefined(t)?b.True:b.False}function Hl(e,t){return t.anyOf.some(r=>ne(e,r)===b.True)?b.True:b.False}function cI(e,t){return e.anyOf.every(r=>ne(r,t)===b.True)?b.True:b.False}function Lf(e,t){return b.True}function lI(e,t){return d.IsNever(t)?Ef(e,t):d.IsIntersect(t)?As(e,t):d.IsUnion(t)?Hl(e,t):d.IsAny(t)?Wl(e,t):d.IsString(t)?vf(e,t):d.IsNumber(t)?$f(e,t):d.IsInteger(t)?Pf(e,t):d.IsBoolean(t)?Tf(e,t):d.IsArray(t)?$S(e,t):d.IsTuple(t)?iI(e,t):d.IsObject(t)?qe(e,t):d.IsUnknown(t)?b.True:b.False}function pI(e,t){return d.IsUndefined(e)||d.IsUndefined(e)?b.True:b.False}function mI(e,t){return d.IsIntersect(t)?As(e,t):d.IsUnion(t)?Hl(e,t):d.IsUnknown(t)?Lf(e,t):d.IsAny(t)?Wl(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)?rI(e,t):d.IsRegExp(e)||d.IsRegExp(t)?ZS(e,t):d.IsNot(e)||d.IsNot(t)?BS(e,t):d.IsAny(e)?ES(e,t):d.IsArray(e)?AS(e,t):d.IsBigInt(e)?LS(e,t):d.IsBoolean(e)?NS(e,t):d.IsAsyncIterator(e)?vS(e,t):d.IsConstructor(e)?RS(e,t):d.IsDate(e)?kS(e,t):d.IsFunction(e)?FS(e,t):d.IsInteger(e)?jS(e,t):d.IsIntersect(e)?US(e,t):d.IsIterator(e)?_S(e,t):d.IsLiteral(e)?DS(e,t):d.IsNever(e)?MS(e,t):d.IsNull(e)?VS(e,t):d.IsNumber(e)?KS(e,t):d.IsObject(e)?YS(e,t):d.IsRecord(e)?XS(e,t):d.IsString(e)?eI(e,t):d.IsSymbol(e)?tI(e,t):d.IsTuple(e)?oI(e,t):d.IsPromise(e)?QS(e,t):d.IsUint8Array(e)?aI(e,t):d.IsUndefined(e)?sI(e,t):d.IsUnion(e)?cI(e,t):d.IsUnknown(e)?lI(e,t):d.IsVoid(e)?mI(e,t):ji(`Unknown left type operand \'${e[g]}\'`)}function Vr(e,t){return ne(e,t)}function uI(e,t,r,i,o){let a={};for(let s of globalThis.Object.getOwnPropertyNames(e))a[s]=Kr(e[s],t,r,i,se(o));return a}function dI(e,t,r,i,o){return uI(e.properties,t,r,i,o)}function zl(e,t,r,i,o){let a=dI(e,t,r,i,o);return W(a)}function fI(e,t,r,i){let o=Vr(e,t);return o===b.Union?G([r,i]):o===b.True?r:i}function Kr(e,t,r,i,o){return pe(e)?zl(e,t,r,i,o):at(e)?y(Jl(e,t,r,i,o)):y(fI(e,t,r,i),o)}function hI(e,t,r,i,o){return{[e]:Kr(j(e),t,r,i,se(o))}}function gI(e,t,r,i,o){return e.reduce((a,s)=>({...a,...hI(s,t,r,i,o)}),{})}function yI(e,t,r,i,o){return gI(e.keys,t,r,i,o)}function Jl(e,t,r,i,o){let a=yI(e,t,r,i,o);return W(a)}function bI(e){return e.allOf.every(t=>Pn(t))}function OI(e){return e.anyOf.some(t=>Pn(t))}function xI(e){return!Pn(e.not)}function Pn(e){return e[g]==="Intersect"?bI(e):e[g]==="Union"?OI(e):e[g]==="Not"?xI(e):e[g]==="Undefined"}function Yl(e,t){return Gr(Tn(e),t)}function SI(e,t){let r=e.filter(i=>Vr(i,t)===b.False);return r.length===1?r[0]:G(r)}function Gr(e,t,r={}){return st(e)?y(Yl(e,t),r):pe(e)?y(Ql(e,t),r):y(K(e)?SI(e.anyOf,t):Vr(e,t)!==b.False?k():e,r)}function II(e,t){let r={};for(let i of globalThis.Object.getOwnPropertyNames(e))r[i]=Gr(e[i],t);return r}function wI(e,t){return II(e.properties,t)}function Ql(e,t){let r=wI(e,t);return W(r)}function Xl(e,t){return qr(Tn(e),t)}function CI(e,t){let r=e.filter(i=>Vr(i,t)!==b.False);return r.length===1?r[0]:G(r)}function qr(e,t,r){return st(e)?y(Xl(e,t),r):pe(e)?y(Zl(e,t),r):y(K(e)?CI(e.anyOf,t):Vr(e,t)!==b.False?e:k(),r)}function TI(e,t){let r={};for(let i of globalThis.Object.getOwnPropertyNames(e))r[i]=qr(e[i],t);return r}function PI(e,t){return TI(e.properties,t)}function Zl(e,t){let r=PI(e,t);return W(r)}function Vo(e,t){return Rt(e)?y(e.returns,t):k(t)}function li(e){return Be($e(e))}function pi(e,t,r){return y({[g]:"Record",type:"object",patternProperties:{[e]:t}},r)}function ep(e,t,r){let i={};for(let o of e)i[o]=t;return q(i,{...r,[ze]:"Record"})}function EI(e,t,r){return No(e)?ep(Qe(e),t,r):pi(e.pattern,t,r)}function $I(e,t,r){return ep(Qe(G(e)),t,r)}function AI(e,t,r){return ep([e.toString()],t,r)}function vI(e,t,r){return pi(e.source,t,r)}function LI(e,t,r){let i=we(e.pattern)?Rr:e.pattern;return pi(i,t,r)}function NI(e,t,r){return pi(Rr,t,r)}function RI(e,t,r){return pi($l,t,r)}function kI(e,t,r){return q({true:t,false:t},r)}function FI(e,t,r){return pi(Nr,t,r)}function jI(e,t,r){return pi(Nr,t,r)}function mi(e,t,r={}){return K(e)?$I(e.anyOf,t,r):st(e)?EI(e,t,r):Me(e)?AI(e.const,t,r):yr(e)?kI(e,t,r):Ft(e)?FI(e,t,r):jt(e)?jI(e,t,r):bs(e)?vI(e,t,r):br(e)?LI(e,t,r):gs(e)?NI(e,t,r):vr(e)?RI(e,t,r):k(r)}function Ko(e){return globalThis.Object.getOwnPropertyNames(e.patternProperties)[0]}function tp(e){let t=Ko(e);return t===Rr?ke():t===Nr?Ye():ke({pattern:t})}function Go(e){return e.patternProperties[Ko(e)]}function UI(e,t){return t.parameters=Ui(e,t.parameters),t.returns=er(e,t.returns),t}function _I(e,t){return t.parameters=Ui(e,t.parameters),t.returns=er(e,t.returns),t}function DI(e,t){return t.allOf=Ui(e,t.allOf),t}function MI(e,t){return t.anyOf=Ui(e,t.anyOf),t}function BI(e,t){return we(t.items)||(t.items=Ui(e,t.items)),t}function VI(e,t){return t.items=er(e,t.items),t}function KI(e,t){return t.items=er(e,t.items),t}function GI(e,t){return t.items=er(e,t.items),t}function qI(e,t){return t.item=er(e,t.item),t}function WI(e,t){let r=YI(e,t.properties);return{...t,...q(r)}}function HI(e,t){let r=er(e,tp(t)),i=er(e,Go(t)),o=mi(r,i);return{...t,...o}}function zI(e,t){return t.index in e?e[t.index]:lt()}function JI(e,t){let r=Yn(t),i=Je(t),o=er(e,t);return r&&i?li(o):r&&!i?Be(o):!r&&i?$e(o):o}function YI(e,t){return globalThis.Object.getOwnPropertyNames(t).reduce((r,i)=>({...r,[i]:JI(e,t[i])}),{})}function Ui(e,t){return t.map(r=>er(e,r))}function er(e,t){return Rt(t)?UI(e,t):kt(t)?_I(e,t):ge(t)?DI(e,t):K(t)?MI(e,t):ct(t)?BI(e,t):Lt(t)?VI(e,t):On(t)?KI(e,t):Sn(t)?GI(e,t):In(t)?qI(e,t):Se(t)?WI(e,t):wn(t)?HI(e,t):ys(t)?zI(e,t):t}function qo(e,t){return er(t,bn(e))}function Wo(e){return y({[g]:"Integer",type:"integer"},e)}function QI(e,t,r){return{[e]:Vt(j(e),t,se(r))}}function XI(e,t,r){return e.reduce((o,a)=>({...o,...QI(a,t,r)}),{})}function ZI(e,t,r){return XI(e.keys,t,r)}function rp(e,t,r){let i=ZI(e,t,r);return W(i)}function e0(e){let[t,r]=[e.slice(0,1),e.slice(1)];return[t.toLowerCase(),r].join("")}function t0(e){let[t,r]=[e.slice(0,1),e.slice(1)];return[t.toUpperCase(),r].join("")}function r0(e){return e.toUpperCase()}function n0(e){return e.toLowerCase()}function i0(e,t,r){let i=Xn(e.pattern);if(!Cn(i))return{...e,pattern:Nf(e.pattern,t)};let s=[...ki(i)].map(p=>j(p)),c=Rf(s,t),l=G(c);return ti([l],r)}function Nf(e,t){return typeof e=="string"?t==="Uncapitalize"?e0(e):t==="Capitalize"?t0(e):t==="Uppercase"?r0(e):t==="Lowercase"?n0(e):e:e.toString()}function Rf(e,t){return e.map(r=>Vt(r,t))}function Vt(e,t,r={}){return at(e)?rp(e,t,r):st(e)?i0(e,t,r):K(e)?G(Rf(e.anyOf,t),r):Me(e)?j(Nf(e.const,t),r):y(e,r)}function Ho(e,t={}){return Vt(e,"Capitalize",t)}function zo(e,t={}){return Vt(e,"Lowercase",t)}function Jo(e,t={}){return Vt(e,"Uncapitalize",t)}function Yo(e,t={}){return Vt(e,"Uppercase",t)}function o0(e,t,r){let i={};for(let o of globalThis.Object.getOwnPropertyNames(e))i[o]=tr(e[o],t,se(r));return i}function a0(e,t,r){return o0(e.properties,t,r)}function np(e,t,r){let i=a0(e,t,r);return W(i)}function s0(e,t){return e.map(r=>ip(r,t))}function c0(e,t){return e.map(r=>ip(r,t))}function l0(e,t){let{[t]:r,...i}=e;return i}function p0(e,t){return t.reduce((r,i)=>l0(r,i),e)}function m0(e,t){let r=xe(e,[ue,"$id","required","properties"]),i=p0(e.properties,t);return q(i,r)}function u0(e){let t=e.reduce((r,i)=>To(i)?[...r,j(i)]:r,[]);return G(t)}function ip(e,t){return ge(e)?Ae(s0(e.allOf,t)):K(e)?G(c0(e.anyOf,t)):Se(e)?m0(e,t):q({})}function tr(e,t,r){let i=Ie(t)?u0(t):t,o=de(t)?Qe(t):t,a=Oe(e),s=Oe(t);return pe(e)?np(e,o,r):at(t)?op(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({...ip(e,o),...r})}function d0(e,t,r){return{[t]:tr(e,[t],se(r))}}function f0(e,t,r){return t.reduce((i,o)=>({...i,...d0(e,o,r)}),{})}function h0(e,t,r){return f0(e,t.keys,r)}function op(e,t,r){let i=h0(e,t,r);return W(i)}function g0(e,t,r){let i={};for(let o of globalThis.Object.getOwnPropertyNames(e))i[o]=rr(e[o],t,se(r));return i}function y0(e,t,r){return g0(e.properties,t,r)}function ap(e,t,r){let i=y0(e,t,r);return W(i)}function b0(e,t){return e.map(r=>sp(r,t))}function O0(e,t){return e.map(r=>sp(r,t))}function x0(e,t){let r={};for(let i of t)i in e&&(r[i]=e[i]);return r}function S0(e,t){let r=xe(e,[ue,"$id","required","properties"]),i=x0(e.properties,t);return q(i,r)}function I0(e){let t=e.reduce((r,i)=>To(i)?[...r,j(i)]:r,[]);return G(t)}function sp(e,t){return ge(e)?Ae(b0(e.allOf,t)):K(e)?G(O0(e.anyOf,t)):Se(e)?S0(e,t):q({})}function rr(e,t,r){let i=Ie(t)?I0(t):t,o=de(t)?Qe(t):t,a=Oe(e),s=Oe(t);return pe(e)?ap(e,o,r):at(t)?cp(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({...sp(e,o),...r})}function w0(e,t,r){return{[t]:rr(e,[t],se(r))}}function C0(e,t,r){return t.reduce((i,o)=>({...i,...w0(e,o,r)}),{})}function T0(e,t,r){return C0(e,t.keys,r)}function cp(e,t,r){let i=T0(e,t,r);return W(i)}function P0(e,t){return ae("Partial",[ae(e,t)])}function E0(e){return ae("Partial",[bt(e)])}function $0(e){let t={};for(let r of globalThis.Object.getOwnPropertyNames(e))t[r]=$e(e[r]);return t}function A0(e){let t=xe(e,[ue,"$id","required","properties"]),r=$0(e.properties);return q(r,t)}function kf(e){return e.map(t=>Ff(t))}function Ff(e){return Nt(e)?P0(e.target,e.parameters):Oe(e)?E0(e.$ref):ge(e)?Ae(kf(e.allOf)):K(e)?G(kf(e.anyOf)):Se(e)?A0(e):xn(e)||yr(e)||Ft(e)||Me(e)||Ai(e)||jt(e)||br(e)||vi(e)||Or(e)?e:q({})}function Wr(e,t){return pe(e)?lp(e,t):y({...Ff(e),...t})}function v0(e,t){let r={};for(let i of globalThis.Object.getOwnPropertyNames(e))r[i]=Wr(e[i],se(t));return r}function L0(e,t){return v0(e.properties,t)}function lp(e,t){let r=L0(e,t);return W(r)}function N0(e,t){return ae("Required",[ae(e,t)])}function R0(e){return ae("Required",[bt(e)])}function k0(e){let t={};for(let r of globalThis.Object.getOwnPropertyNames(e))t[r]=xe(e[r],[Ne]);return t}function F0(e){let t=xe(e,[ue,"$id","required","properties"]),r=k0(e.properties);return q(r,t)}function jf(e){return e.map(t=>Uf(t))}function Uf(e){return Nt(e)?N0(e.target,e.parameters):Oe(e)?R0(e.$ref):ge(e)?Ae(jf(e.allOf)):K(e)?G(jf(e.anyOf)):Se(e)?F0(e):xn(e)||yr(e)||Ft(e)||Me(e)||Ai(e)||jt(e)||br(e)||vi(e)||Or(e)?e:q({})}function Hr(e,t){return pe(e)?pp(e,t):y({...Uf(e),...t})}function j0(e,t){let r={};for(let i of globalThis.Object.getOwnPropertyNames(e))r[i]=Hr(e[i],t);return r}function U0(e,t){return j0(e.properties,t)}function pp(e,t){let r=U0(e,t);return W(r)}function _0(e,t){return t.map(r=>Oe(r)?mp(e,r.$ref):Ot(e,r))}function mp(e,t){return t in e?Oe(e[t])?mp(e,e[t].$ref):Ot(e,e[t]):k()}function D0(e){return Mr(e[0])}function M0(e){return Zt(e[0],e[1])}function B0(e){return Br(e[0])}function V0(e){return Wr(e[0])}function K0(e){return tr(e[0],e[1])}function G0(e){return rr(e[0],e[1])}function q0(e){return Hr(e[0])}function W0(e,t,r){let i=_0(e,r);return t==="Awaited"?D0(i):t==="Index"?M0(i):t==="KeyOf"?B0(i):t==="Partial"?V0(i):t==="Omit"?K0(i):t==="Pick"?G0(i):t==="Required"?q0(i):k()}function H0(e,t){return kr(Ot(e,t))}function z0(e,t){return Fr(Ot(e,t))}function J0(e,t,r){return jr(Qo(e,t),Ot(e,r))}function Y0(e,t,r){return yt(Qo(e,t),Ot(e,r))}function Q0(e,t){return Ae(Qo(e,t))}function X0(e,t){return Dr(Ot(e,t))}function Z0(e,t){return q(globalThis.Object.keys(t).reduce((r,i)=>({...r,[i]:Ot(e,t[i])}),{}))}function ew(e,t){let[r,i]=[Ot(e,Go(t)),Ko(t)],o=bn(t);return o.patternProperties[i]=r,o}function tw(e,t){return Oe(t)?{...mp(e,t.$ref),[ue]:t[ue]}:t}function rw(e,t){return Xe(Qo(e,t))}function nw(e,t){return G(Qo(e,t))}function Qo(e,t){return t.map(r=>Ot(e,r))}function Ot(e,t){return Je(t)?y(Ot(e,xe(t,[Ne])),t):Yn(t)?y(Ot(e,xe(t,[vt])),t):z(t)?y(tw(e,t),t):Lt(t)?y(H0(e,t.items),t):On(t)?y(z0(e,t.items),t):Nt(t)?y(W0(e,t.target,t.parameters)):Rt(t)?y(J0(e,t.parameters,t.returns),t):kt(t)?y(Y0(e,t.parameters,t.returns),t):ge(t)?y(Q0(e,t.allOf),t):Sn(t)?y(X0(e,t.items),t):Se(t)?y(Z0(e,t.properties),t):wn(t)?y(ew(e,t)):ct(t)?y(rw(e,t.items||[]),t):K(t)?y(nw(e,t.anyOf),t):t}function iw(e,t){return t in e?Ot(e,e[t]):k()}function _f(e){return globalThis.Object.getOwnPropertyNames(e).reduce((t,r)=>({...t,[r]:iw(e,r)}),{})}var Ls=class{constructor(t){let r=_f(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 Xo(e){return new Ls(e)}function Zo(e,t){return y({[g]:"Not",not:e},t)}function ea(e,t){return kt(e)?Xe(e.parameters,t):k()}var ow=0;function ta(e,t={}){we(t.$id)&&(t.$id=`T${ow++}`);let r=bn(e({[g]:"This",$ref:`${t.$id}`}));return r.$id=t.$id,y({[ze]:"Recursive",...r},t)}function ra(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 aw(e){return ge(e)?e.allOf:K(e)?e.anyOf:ct(e)?e.items??[]:[]}function na(e){return aw(e)}function ia(e,t){return kt(e)?y(e.returns,t):k(t)}var Ns=class{constructor(t){this.schema=t}Decode(t){return new Rs(this.schema,t)}},Rs=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 oa(e){return new Ns(e)}function aa(e={}){return y({[g]:e[g]??"Unsafe"},e)}function sa(e){return y({[g]:"Void",type:"void"},e)}var _i=class{ReadonlyOptional(t){return li(t)}Readonly(t,r){return Be(t,r??!0)}Optional(t,r){return $e(t,r??!0)}Any(t){return Qt(t)}Array(t,r){return kr(t,r)}Boolean(t){return ei(t)}Capitalize(t,r){return Ho(t,r)}Composite(t,r){return _o(t,r)}Const(t,r){return Do(t,r)}Enum(t,r){return Bo(t,r)}Exclude(t,r,i){return Gr(t,r,i)}Extends(t,r,i,o,a){return Kr(t,r,i,o,a)}Extract(t,r,i){return qr(t,r,i)}Index(t,r,i){return Zt(t,r,i)}Integer(t){return Wo(t)}Intersect(t,r){return Ae(t,r)}KeyOf(t,r){return Br(t,r)}Literal(t,r){return j(t,r)}Lowercase(t,r){return zo(t,r)}Mapped(t,r,i){return Fo(t,r,i)}Module(t){return Xo(t)}Never(t){return k(t)}Not(t,r){return Zo(t,r)}Null(t){return oi(t)}Number(t){return Ye(t)}Object(t,r){return q(t,r)}Omit(t,r,i){return tr(t,r,i)}Partial(t,r){return Wr(t,r)}Pick(t,r,i){return rr(t,r,i)}Record(t,r,i){return mi(t,r,i)}Recursive(t,r){return ta(t,r)}Ref(...t){return bt(t[0],t[1])}Required(t,r){return Hr(t,r)}Rest(t){return na(t)}String(t){return ke(t)}TemplateLiteral(t,r){return ti(t,r)}Transform(t){return oa(t)}Tuple(t,r){return Xe(t,r)}Uncapitalize(t,r){return Jo(t,r)}Union(t,r){return G(t,r)}Unknown(t){return lt(t)}Unsafe(t){return aa(t)}Uppercase(t,r){return Yo(t,r)}};var up={};nt(up,{Any:()=>Qt,Argument:()=>$o,Array:()=>kr,AsyncIterator:()=>Fr,Awaited:()=>Mr,BigInt:()=>_r,Boolean:()=>ei,Capitalize:()=>Ho,Composite:()=>_o,Const:()=>Do,Constructor:()=>jr,ConstructorParameters:()=>Mo,Date:()=>ii,Enum:()=>Bo,Exclude:()=>Gr,Extends:()=>Kr,Extract:()=>qr,Function:()=>yt,Index:()=>Zt,InstanceType:()=>Vo,Instantiate:()=>qo,Integer:()=>Wo,Intersect:()=>Ae,Iterator:()=>Dr,KeyOf:()=>Br,Literal:()=>j,Lowercase:()=>zo,Mapped:()=>Fo,Module:()=>Xo,Never:()=>k,Not:()=>Zo,Null:()=>oi,Number:()=>Ye,Object:()=>q,Omit:()=>tr,Optional:()=>$e,Parameters:()=>ea,Partial:()=>Wr,Pick:()=>rr,Promise:()=>ri,Readonly:()=>Be,ReadonlyOptional:()=>li,Record:()=>mi,Recursive:()=>ta,Ref:()=>bt,RegExp:()=>ra,Required:()=>Hr,Rest:()=>na,ReturnType:()=>ia,String:()=>ke,Symbol:()=>ai,TemplateLiteral:()=>ti,Transform:()=>oa,Tuple:()=>Xe,Uint8Array:()=>ci,Uncapitalize:()=>Jo,Undefined:()=>si,Union:()=>G,Unknown:()=>lt,Unsafe:()=>aa,Uppercase:()=>Yo,Void:()=>sa});var ks=class extends _i{Argument(t){return $o(t)}AsyncIterator(t,r){return Fr(t,r)}Awaited(t,r){return Mr(t,r)}BigInt(t){return _r(t)}ConstructorParameters(t,r){return Mo(t,r)}Constructor(t,r,i){return jr(t,r,i)}Date(t={}){return ii(t)}Function(t,r,i){return yt(t,r,i)}InstanceType(t,r){return Vo(t,r)}Instantiate(t,r){return qo(t,r)}Iterator(t,r){return Dr(t,r)}Parameters(t,r){return ea(t,r)}Promise(t,r){return ri(t,r)}RegExp(t,r){return ra(t,r)}ReturnType(t,r){return ia(t,r)}Symbol(t){return ai(t)}Undefined(t){return si(t)}Uint8Array(t){return ci(t)}Void(t){return sa(t)}};var n=up;var $p={};nt($p,{Assert:()=>ca,AssertError:()=>_s,Cast:()=>Bi,Check:()=>F,Clean:()=>pa,Clone:()=>H,Convert:()=>da,Create:()=>Kt,Decode:()=>bp,Default:()=>ba,Delete:()=>rh,Diff:()=>Sp,Edit:()=>xp,Encode:()=>wp,Equal:()=>An,HasPropertyKey:()=>E,HasTransform:()=>$n,Hash:()=>ui,Insert:()=>eh,IsArray:()=>$,IsAsyncIterator:()=>xo,IsBigInt:()=>At,IsBigInt64Array:()=>OO,IsBigUint64Array:()=>xO,IsBoolean:()=>Jt,IsDate:()=>Ge,IsFloat32Array:()=>yO,IsFloat64Array:()=>bO,IsFunction:()=>hr,IsInstanceObject:()=>lO,IsInt16Array:()=>dO,IsInt32Array:()=>hO,IsInt8Array:()=>mO,IsInteger:()=>wo,IsIterator:()=>So,IsMap:()=>Il,IsNull:()=>fr,IsNumber:()=>le,IsObject:()=>L,IsPromise:()=>Io,IsRegExp:()=>pO,IsSet:()=>wl,IsStandardObject:()=>hs,IsString:()=>X,IsSymbol:()=>gr,IsTypedArray:()=>gt,IsUint16Array:()=>fO,IsUint32Array:()=>gO,IsUint8Array:()=>Jn,IsUint8ClampedArray:()=>uO,IsUndefined:()=>ce,IsValueType:()=>ot,Mutate:()=>Tp,Parse:()=>Ep,ParseDefault:()=>Pp,ParseError:()=>Ia,ParseRegistry:()=>Hs,Patch:()=>Ip,TransformDecode:()=>ha,TransformDecodeCheckError:()=>fa,TransformDecodeError:()=>Ms,TransformEncode:()=>ya,TransformEncodeCheckError:()=>ga,TransformEncodeError:()=>Bs,Update:()=>th,Value:()=>T,ValueCastError:()=>la,ValueCheckUnknownTypeError:()=>js,ValueCreateError:()=>mt,ValueDiffError:()=>xa,ValueErrorIterator:()=>xr,ValueErrorType:()=>h,ValueHashError:()=>Fs,ValueMutateError:()=>Sa,ValuePointer:()=>Gt});function sw(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 cw=sw;function Df(){return cw}var fp=class extends A{constructor(t){super(`Unable to dereference schema with $id \'${t.$ref}\'`),this.schema=t}};function lw(e,t){let r=t.find(i=>i.$id===e.$ref);if(r===void 0)throw new fp(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"?lw(e,t):e}var Fs=class extends A{constructor(t){super("Unable to hash value"),this.value=t}},xt;(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"})(xt||(xt={}));var Di=BigInt("14695981039346656037"),[pw,mw]=[BigInt("1099511628211"),BigInt("18446744073709551616")],uw=Array.from({length:256}).map((e,t)=>BigInt(t)),Mf=new Float64Array(1),Bf=new DataView(Mf.buffer),Vf=new Uint8Array(Mf.buffer);function*dw(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 fw(e){We(xt.Array);for(let t of e)Mi(t)}function hw(e){We(xt.Boolean),We(e?1:0)}function gw(e){We(xt.BigInt),Bf.setBigInt64(0,e);for(let t of Vf)We(t)}function yw(e){We(xt.Date),Mi(e.getTime())}function bw(e){We(xt.Null)}function Ow(e){We(xt.Number),Bf.setFloat64(0,e);for(let t of Vf)We(t)}function xw(e){We(xt.Object);for(let t of globalThis.Object.getOwnPropertyNames(e).sort())Mi(t),Mi(e[t])}function Sw(e){We(xt.String);for(let t=0;t<e.length;t++)for(let r of dw(e.charCodeAt(t)))We(r)}function Iw(e){We(xt.Symbol),Mi(e.description)}function ww(e){We(xt.Uint8Array);for(let t=0;t<e.length;t++)We(e[t])}function Cw(e){return We(xt.Undefined)}function Mi(e){if($(e))return fw(e);if(Jt(e))return hw(e);if(At(e))return gw(e);if(Ge(e))return yw(e);if(fr(e))return bw(e);if(le(e))return Ow(e);if(L(e))return xw(e);if(X(e))return Sw(e);if(gr(e))return Iw(e);if(Jn(e))return ww(e);if(ce(e))return Cw(e);throw new Fs(e)}function We(e){Di=Di^uw[e],Di=Di*pw%mw}function ui(e){return Di=BigInt("14695981039346656037"),Mi(e),Di}var js=class extends A{constructor(t){super("Unknown type"),this.schema=t}};function Tw(e){return e[g]==="Any"||e[g]==="Unknown"}function M(e){return e!==void 0}function Pw(e,t,r){return!0}function Ew(e,t,r){return!0}function $w(e,t,r){if(!$(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 Aw(e,t,r){return xo(r)}function vw(e,t,r){return!(!At(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 Lw(e,t,r){return Jt(r)}function Nw(e,t,r){return je(e.returns,t,r.prototype)}function Rw(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 kw(e,t,r){return hr(r)}function Fw(e,t,r){let i=globalThis.Object.values(e.$defs),o=e.$defs[e.$ref];return je(o,[...t,...i],r)}function jw(e,t,r){return!(!wo(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 Uw(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 _w(e,t,r){return So(r)}function Dw(e,t,r){return r===e.const}function Mw(e,t,r){return!1}function Bw(e,t,r){return!je(e.not,t,r)}function Vw(e,t,r){return fr(r)}function Kw(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 Gw(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])||(Pn(a)||Tw(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 qw(e,t,r){return Io(r)}function Ww(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 Hw(e,t,r){return je(Y(e,t),t,r)}function zw(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 Jw(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 Yw(e,t,r){return gr(r)}function Qw(e,t,r){return X(r)&&new RegExp(e.pattern).test(r)}function Xw(e,t,r){return je(Y(e,t),t,r)}function Zw(e,t,r){if(!$(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 eC(e,t,r){return ce(r)}function tC(e,t,r){return e.anyOf.some(i=>je(i,t,r))}function rC(e,t,r){return!(!Jn(r)||M(e.maxByteLength)&&!(r.length<=e.maxByteLength)||M(e.minByteLength)&&!(r.length>=e.minByteLength))}function nC(e,t,r){return!0}function iC(e,t,r){return Te.IsVoidLike(r)}function oC(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 Pw(o,i,r);case"Argument":return Ew(o,i,r);case"Array":return $w(o,i,r);case"AsyncIterator":return Aw(o,i,r);case"BigInt":return vw(o,i,r);case"Boolean":return Lw(o,i,r);case"Constructor":return Nw(o,i,r);case"Date":return Rw(o,i,r);case"Function":return kw(o,i,r);case"Import":return Fw(o,i,r);case"Integer":return jw(o,i,r);case"Intersect":return Uw(o,i,r);case"Iterator":return _w(o,i,r);case"Literal":return Dw(o,i,r);case"Never":return Mw(o,i,r);case"Not":return Bw(o,i,r);case"Null":return Vw(o,i,r);case"Number":return Kw(o,i,r);case"Object":return Gw(o,i,r);case"Promise":return qw(o,i,r);case"Record":return Ww(o,i,r);case"Ref":return Hw(o,i,r);case"RegExp":return zw(o,i,r);case"String":return Jw(o,i,r);case"Symbol":return Yw(o,i,r);case"TemplateLiteral":return Qw(o,i,r);case"This":return Xw(o,i,r);case"Tuple":return Zw(o,i,r);case"Undefined":return eC(o,i,r);case"Union":return tC(o,i,r);case"Uint8Array":return rC(o,i,r);case"Unknown":return nC(o,i,r);case"Void":return iC(o,i,r);default:if(!_t.Has(o[g]))throw new js(o);return oC(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 hp=class extends A{constructor(t){super("Unknown type"),this.schema=t}};function zr(e){return e.replace(/~/g,"~0").replace(/\\//g,"~1")}function B(e){return e!==void 0}var xr=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:Df()({errorType:e,path:r,schema:t,value:i,errors:o}),errors:o}}function*aC(e,t,r,i){}function*sC(e,t,r,i){}function*cC(e,t,r,i){if(!$(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*lC(e,t,r,i){xo(i)||(yield C(h.AsyncIterator,e,r,i))}function*pC(e,t,r,i){if(!At(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*mC(e,t,r,i){Jt(i)||(yield C(h.Boolean,e,r,i))}function*uC(e,t,r,i){yield*Ue(e.returns,t,r,i.prototype)}function*dC(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*fC(e,t,r,i){hr(i)||(yield C(h.Function,e,r,i))}function*hC(e,t,r,i){let o=globalThis.Object.values(e.$defs),a=e.$defs[e.$ref];yield*Ue(a,[...t,...o],r,i)}function*gC(e,t,r,i){if(!wo(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*yC(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*bC(e,t,r,i){So(i)||(yield C(h.Iterator,e,r,i))}function*OC(e,t,r,i){i!==e.const&&(yield C(h.Literal,e,r,i))}function*xC(e,t,r,i){yield C(h.Never,e,r,i)}function*SC(e,t,r,i){Ue(e.not,t,r,i).next().done===!0&&(yield C(h.Not,e,r,i))}function*IC(e,t,r,i){fr(i)||(yield C(h.Null,e,r,i))}function*wC(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*CC(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}/${zr(c)}`,void 0));if(e.additionalProperties===!1)for(let c of s)a.includes(c)||(yield C(h.ObjectAdditionalProperties,e,`${r}/${zr(c)}`,i[c]));if(typeof e.additionalProperties=="object")for(let c of s)a.includes(c)||(yield*Ue(e.additionalProperties,t,`${r}/${zr(c)}`,i[c]));for(let c of a){let l=e.properties[c];e.required&&e.required.includes(c)?(yield*Ue(l,t,`${r}/${zr(c)}`,i[c]),Pn(e)&&!(c in i)&&(yield C(h.ObjectRequiredProperty,l,`${r}/${zr(c)}`,void 0))):Te.IsExactOptionalProperty(i,c)&&(yield*Ue(l,t,`${r}/${zr(c)}`,i[c]))}}function*TC(e,t,r,i){Io(i)||(yield C(h.Promise,e,r,i))}function*PC(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}/${zr(c)}`,l));if(typeof e.additionalProperties=="object")for(let[c,l]of Object.entries(i))s.test(c)||(yield*Ue(e.additionalProperties,t,`${r}/${zr(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}/${zr(c)}`,l)}}function*EC(e,t,r,i){yield*Ue(Y(e,t),t,r,i)}function*$C(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*AC(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*vC(e,t,r,i){gr(i)||(yield C(h.Symbol,e,r,i))}function*LC(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*NC(e,t,r,i){yield*Ue(Y(e,t),t,r,i)}function*RC(e,t,r,i){if(!$(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*kC(e,t,r,i){ce(i)||(yield C(h.Undefined,e,r,i))}function*FC(e,t,r,i){if(F(e,t,i))return;let o=e.anyOf.map(a=>new xr(Ue(a,t,r,i)));yield C(h.Union,e,r,i,o)}function*jC(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*UC(e,t,r,i){}function*_C(e,t,r,i){Te.IsVoidLike(i)||(yield C(h.Void,e,r,i))}function*DC(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*aC(a,o,r,i);case"Argument":return yield*sC(a,o,r,i);case"Array":return yield*cC(a,o,r,i);case"AsyncIterator":return yield*lC(a,o,r,i);case"BigInt":return yield*pC(a,o,r,i);case"Boolean":return yield*mC(a,o,r,i);case"Constructor":return yield*uC(a,o,r,i);case"Date":return yield*dC(a,o,r,i);case"Function":return yield*fC(a,o,r,i);case"Import":return yield*hC(a,o,r,i);case"Integer":return yield*gC(a,o,r,i);case"Intersect":return yield*yC(a,o,r,i);case"Iterator":return yield*bC(a,o,r,i);case"Literal":return yield*OC(a,o,r,i);case"Never":return yield*xC(a,o,r,i);case"Not":return yield*SC(a,o,r,i);case"Null":return yield*IC(a,o,r,i);case"Number":return yield*wC(a,o,r,i);case"Object":return yield*CC(a,o,r,i);case"Promise":return yield*TC(a,o,r,i);case"Record":return yield*PC(a,o,r,i);case"Ref":return yield*EC(a,o,r,i);case"RegExp":return yield*$C(a,o,r,i);case"String":return yield*AC(a,o,r,i);case"Symbol":return yield*vC(a,o,r,i);case"TemplateLiteral":return yield*LC(a,o,r,i);case"This":return yield*NC(a,o,r,i);case"Tuple":return yield*RC(a,o,r,i);case"Undefined":return yield*kC(a,o,r,i);case"Union":return yield*FC(a,o,r,i);case"Uint8Array":return yield*jC(a,o,r,i);case"Unknown":return yield*UC(a,o,r,i);case"Void":return yield*_C(a,o,r,i);default:if(!_t.Has(a[g]))throw new hp(e);return yield*DC(a,o,r,i)}}function En(...e){let t=e.length===3?Ue(e[0],e[1],"",e[2]):Ue(e[0],[],"",e[1]);return new xr(t)}var MC=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},Gf=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)},gp,Us,qf,_s=class extends A{constructor(t){let r=t.First();super(r===void 0?"Invalid Value":r.message),gp.add(this),Us.set(this,void 0),MC(this,Us,t,"f"),this.error=r}Errors(){return new xr(Gf(this,gp,"m",qf).call(this))}};Us=new WeakMap,gp=new WeakSet,qf=function*(){this.error&&(yield this.error),yield*Gf(this,Us,"f")};function Kf(e,t,r){if(!F(e,t,r))throw new _s(En(e,t,r))}function ca(...e){return e.length===3?Kf(e[0],e[1],e[2]):Kf(e[0],[],e[1])}function BC(e){let t={};for(let r of Object.getOwnPropertyNames(e))t[r]=H(e[r]);for(let r of Object.getOwnPropertySymbols(e))t[r]=H(e[r]);return t}function VC(e){return e.map(t=>H(t))}function KC(e){return e.slice()}function GC(e){return new Map(H([...e.entries()]))}function qC(e){return new Set(H([...e.entries()]))}function WC(e){return new Date(e.toISOString())}function H(e){if($(e))return VC(e);if(Ge(e))return WC(e);if(gt(e))return KC(e);if(Il(e))return GC(e);if(wl(e))return qC(e);if(L(e))return BC(e);if(ot(e))return e;throw new Error("ValueClone: Unable to clone value")}var mt=class extends A{constructor(t,r){super(r),this.schema=t}};function J(e){return hr(e)?e():H(e)}function HC(e,t){return E(e,"default")?J(e.default):{}}function zC(e,t){return{}}function JC(e,t){if(e.uniqueItems===!0&&!E(e,"default"))throw new mt(e,"Array with the uniqueItems constraint requires a default value");if("contains"in e&&!E(e,"default"))throw new mt(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=>St(e.items,t)):[]}function YC(e,t){return E(e,"default")?J(e.default):async function*(){}()}function QC(e,t){return E(e,"default")?J(e.default):BigInt(0)}function XC(e,t){return E(e,"default")?J(e.default):!1}function ZC(e,t){if(E(e,"default"))return J(e.default);{let r=St(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 eT(e,t){return E(e,"default")?J(e.default):e.minimumTimestamp!==void 0?new Date(e.minimumTimestamp):new Date}function tT(e,t){return E(e,"default")?J(e.default):()=>St(e.returns,t)}function rT(e,t){let r=globalThis.Object.values(e.$defs),i=e.$defs[e.$ref];return St(i,[...t,...r])}function nT(e,t){return E(e,"default")?J(e.default):e.minimum!==void 0?e.minimum:0}function iT(e,t){if(E(e,"default"))return J(e.default);{let r=e.allOf.reduce((i,o)=>{let a=St(o,t);return typeof a=="object"?{...i,...a}:a},{});if(!F(e,t,r))throw new mt(e,"Intersect produced invalid value. Consider using a default value.");return r}}function oT(e,t){return E(e,"default")?J(e.default):function*(){}()}function aT(e,t){return E(e,"default")?J(e.default):e.const}function sT(e,t){if(E(e,"default"))return J(e.default);throw new mt(e,"Never types cannot be created. Consider using a default value.")}function cT(e,t){if(E(e,"default"))return J(e.default);throw new mt(e,"Not types must have a default value")}function lT(e,t){return E(e,"default")?J(e.default):null}function pT(e,t){return E(e,"default")?J(e.default):e.minimum!==void 0?e.minimum:0}function mT(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]=St(a,t));return i}}function uT(e,t){return E(e,"default")?J(e.default):Promise.resolve(St(e.item,t))}function dT(e,t){return E(e,"default")?J(e.default):{}}function fT(e,t){return E(e,"default")?J(e.default):St(Y(e,t),t)}function hT(e,t){if(E(e,"default"))return J(e.default);throw new mt(e,"RegExp types cannot be created. Consider using a default value.")}function gT(e,t){if(e.pattern!==void 0){if(E(e,"default"))return J(e.default);throw new mt(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 mt(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 yT(e,t){return E(e,"default")?J(e.default):"value"in e?Symbol.for(e.value):Symbol()}function bT(e,t){if(E(e,"default"))return J(e.default);if(!No(e))throw new mt(e,"Can only create template literals that produce a finite variants. Consider using a default value.");return Zn(e)[0]}function OT(e,t){if(Wf++>ET)throw new mt(e,"Cannot create recursive type as it appears possibly infinite. Consider using a default.");return E(e,"default")?J(e.default):St(Y(e,t),t)}function xT(e,t){return E(e,"default")?J(e.default):e.items===void 0?[]:Array.from({length:e.minItems}).map((r,i)=>St(e.items[i],t))}function ST(e,t){if(E(e,"default"))return J(e.default)}function IT(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 St(e.anyOf[0],t)}function wT(e,t){return E(e,"default")?J(e.default):e.minByteLength!==void 0?new Uint8Array(e.minByteLength):new Uint8Array(0)}function CT(e,t){return E(e,"default")?J(e.default):{}}function TT(e,t){if(E(e,"default"))return J(e.default)}function PT(e,t){if(E(e,"default"))return J(e.default);throw new Error("User defined types must specify a default value")}function St(e,t){let r=Fe(e,t),i=e;switch(i[g]){case"Any":return HC(i,r);case"Argument":return zC(i,r);case"Array":return JC(i,r);case"AsyncIterator":return YC(i,r);case"BigInt":return QC(i,r);case"Boolean":return XC(i,r);case"Constructor":return ZC(i,r);case"Date":return eT(i,r);case"Function":return tT(i,r);case"Import":return rT(i,r);case"Integer":return nT(i,r);case"Intersect":return iT(i,r);case"Iterator":return oT(i,r);case"Literal":return aT(i,r);case"Never":return sT(i,r);case"Not":return cT(i,r);case"Null":return lT(i,r);case"Number":return pT(i,r);case"Object":return mT(i,r);case"Promise":return uT(i,r);case"Record":return dT(i,r);case"Ref":return fT(i,r);case"RegExp":return hT(i,r);case"String":return gT(i,r);case"Symbol":return yT(i,r);case"TemplateLiteral":return bT(i,r);case"This":return OT(i,r);case"Tuple":return xT(i,r);case"Undefined":return ST(i,r);case"Union":return IT(i,r);case"Uint8Array":return wT(i,r);case"Unknown":return CT(i,r);case"Void":return TT(i,r);default:if(!_t.Has(i[g]))throw new mt(i,"Unknown type");return PT(i,r)}}var ET=512,Wf=0;function Kt(...e){return Wf=0,e.length===2?St(e[0],e[1]):St(e[0],[])}var la=class extends A{constructor(t,r){super(r),this.schema=t}};function Hf(e,t,r){if(e[g]==="Object"&&typeof r=="object"&&!fr(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=>Hf(a,t,r));return Math.max(...o)}else return F(e,t,r)?1:0}function $T(e,t,r){let i=e.anyOf.map(s=>Y(s,t)),[o,a]=[i[0],0];for(let s of i){let c=Hf(s,t,r);c>a&&(o=s,a=c)}return o}function AT(e,t,r){if("default"in e)return typeof r=="function"?e.default:H(e.default);{let i=$T(e,t,r);return Bi(i,t,r)}}function vT(e,t,r){return F(e,t,r)?H(r):Kt(e,t)}function LT(e,t,r){return F(e,t,r)?r:Kt(e,t)}function NT(e,t,r){if(F(e,t,r))return H(r);let i=$(r)?H(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 la(e,"Array cast produced invalid data due to uniqueItems constraint");return c}function RT(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 kT(e,t,r){let i=globalThis.Object.values(e.$defs),o=e.$defs[e.$ref];return nr(o,[...t,...i],r)}function zf(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?zf(e[i],t[i]):e[i];return{...r,[i]:o}},{})}function FT(e,t,r){if(F(e,t,r))return r;let i=Kt(e,t),o=zf(i,r);return F(e,t,o)?o:i}function jT(e,t,r){throw new la(e,"Never types cannot be cast")}function UT(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 _T(e,t,r){if(F(e,t,r))return H(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 DT(e,t,r){return nr(Y(e,t),t,r)}function MT(e,t,r){return nr(Y(e,t),t,r)}function BT(e,t,r){return F(e,t,r)?H(r):$(r)?e.items===void 0?[]:e.items.map((i,o)=>nr(i,t,r[o])):Kt(e,t)}function VT(e,t,r){return F(e,t,r)?H(r):AT(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 NT(o,i,r);case"Constructor":return RT(o,i,r);case"Import":return kT(o,i,r);case"Intersect":return FT(o,i,r);case"Never":return jT(o,i,r);case"Object":return UT(o,i,r);case"Record":return _T(o,i,r);case"Ref":return DT(o,i,r);case"This":return MT(o,i,r);case"Tuple":return BT(o,i,r);case"Union":return VT(o,i,r);case"Date":case"Symbol":case"Uint8Array":return vT(e,t,r);default:return LT(o,i,r)}}function Bi(...e){return e.length===3?nr(e[0],e[1],e[2]):nr(e[0],[],e[1])}function KT(e){return Lr(e)&&e[g]!=="Unsafe"}function GT(e,t,r){return $(r)?r.map(i=>ut(e.items,t,i)):r}function qT(e,t,r){let i=globalThis.Object.values(e.$defs),o=e.$defs[e.$ref];return ut(o,[...t,...i],r)}function WT(e,t,r){let i=e.unevaluatedProperties,a=e.allOf.map(c=>ut(c,t,H(r))).reduce((c,l)=>L(l)?{...c,...l}:l,{});if(!L(r)||!L(a)||!Lr(i))return a;let s=Ze(e);for(let c of Object.getOwnPropertyNames(r))s.includes(c)||F(i,t,r[c])&&(a[c]=ut(i,t,r[c]));return a}function HT(e,t,r){if(!L(r)||$(r))return r;let i=e.additionalProperties;for(let o of Object.getOwnPropertyNames(r)){if(E(e.properties,o)){r[o]=ut(e.properties[o],t,r[o]);continue}if(Lr(i)&&F(i,t,r[o])){r[o]=ut(i,t,r[o]);continue}delete r[o]}return r}function zT(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]=ut(s,t,r[l]);continue}if(Lr(i)&&F(i,t,r[l])){r[l]=ut(i,t,r[l]);continue}delete r[l]}return r}function JT(e,t,r){return ut(Y(e,t),t,r)}function YT(e,t,r){return ut(Y(e,t),t,r)}function QT(e,t,r){if(!$(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]=ut(e.items[o],t,r[o]);return r.length>i?r.slice(0,i):r}function XT(e,t,r){for(let i of e.anyOf)if(KT(i)&&F(i,t,r))return ut(i,t,r);return r}function ut(e,t,r){let i=X(e.$id)?Fe(e,t):t,o=e;switch(o[g]){case"Array":return GT(o,i,r);case"Import":return qT(o,i,r);case"Intersect":return WT(o,i,r);case"Object":return HT(o,i,r);case"Record":return zT(o,i,r);case"Ref":return JT(o,i,r);case"This":return YT(o,i,r);case"Tuple":return QT(o,i,r);case"Union":return XT(o,i,r);default:return r}}function pa(...e){return e.length===3?ut(e[0],e[1],e[2]):ut(e[0],[],e[1])}function Ds(e){return X(e)&&!isNaN(e)&&!isNaN(parseFloat(e))}function ZT(e){return At(e)||Jt(e)||le(e)}function ma(e){return e===!0||le(e)&&e===1||At(e)&&e===BigInt("1")||X(e)&&(e.toLowerCase()==="true"||e==="1")}function ua(e){return e===!1||le(e)&&(e===0||Object.is(e,-0))||At(e)&&e===BigInt("0")||X(e)&&(e.toLowerCase()==="false"||e==="0"||e==="-0")}function eP(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 tP(e){return X(e)&&/^(?:[0-2]\\d:[0-5]\\d:[0-5]\\d|23:59:60)?$/i.test(e)}function rP(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 nP(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 iP(e){return X(e)&&/^\\d\\d\\d\\d-[0-1]\\d-[0-3]\\d$/i.test(e)}function oP(e,t){let r=Yf(e);return r===t?r:e}function aP(e,t){let r=Qf(e);return r===t?r:e}function sP(e,t){let r=Jf(e);return r===t?r:e}function cP(e,t){return X(e.const)?oP(t,e.const):le(e.const)?aP(t,e.const):Jt(e.const)?sP(t,e.const):t}function Jf(e){return ma(e)?!0:ua(e)?!1:e}function lP(e){let t=r=>r.split(".")[0];return Ds(e)?BigInt(t(e)):le(e)?BigInt(Math.trunc(e)):ua(e)?BigInt(0):ma(e)?BigInt(1):e}function Yf(e){return gr(e)&&e.description!==void 0?e.description.toString():ZT(e)?e.toString():e}function Qf(e){return Ds(e)?parseFloat(e):ma(e)?1:ua(e)?0:e}function pP(e){return Ds(e)?parseInt(e):le(e)?Math.trunc(e):ma(e)?1:ua(e)?0:e}function mP(e){return X(e)&&e.toLowerCase()==="null"?null:e}function uP(e){return X(e)&&e==="undefined"?void 0:e}function dP(e){return Ge(e)?e:le(e)?new Date(e):ma(e)?new Date(1):ua(e)?new Date(0):Ds(e)?new Date(parseInt(e)):tP(e)?new Date(`1970-01-01T${e}.000Z`):eP(e)?new Date(`1970-01-01T${e}`):nP(e)?new Date(`${e}.000Z`):rP(e)?new Date(e):iP(e)?new Date(`${e}T00:00:00.000Z`):e}function fP(e,t,r){return($(r)?r:[r]).map(o=>ir(e.items,t,o))}function hP(e,t,r){return lP(r)}function gP(e,t,r){return Jf(r)}function yP(e,t,r){return dP(r)}function bP(e,t,r){let i=globalThis.Object.values(e.$defs),o=e.$defs[e.$ref];return ir(o,[...t,...i],r)}function OP(e,t,r){return pP(r)}function xP(e,t,r){return e.allOf.reduce((i,o)=>ir(o,t,i),r)}function SP(e,t,r){return cP(e,r)}function IP(e,t,r){return mP(r)}function wP(e,t,r){return Qf(r)}function CP(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 TP(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 PP(e,t,r){return ir(Y(e,t),t,r)}function EP(e,t,r){return Yf(r)}function $P(e,t,r){return X(r)||le(r)?Symbol(r):r}function AP(e,t,r){return ir(Y(e,t),t,r)}function vP(e,t,r){return $(r)&&!ce(e.items)?r.map((o,a)=>a<e.items.length?ir(e.items[a],t,o):o):r}function LP(e,t,r){return uP(r)}function NP(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,H(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 fP(o,i,r);case"BigInt":return hP(o,i,r);case"Boolean":return gP(o,i,r);case"Date":return yP(o,i,r);case"Import":return bP(o,i,r);case"Integer":return OP(o,i,r);case"Intersect":return xP(o,i,r);case"Literal":return SP(o,i,r);case"Null":return IP(o,i,r);case"Number":return wP(o,i,r);case"Object":return CP(o,i,r);case"Record":return TP(o,i,r);case"Ref":return PP(o,i,r);case"String":return EP(o,i,r);case"Symbol":return $P(o,i,r);case"This":return AP(o,i,r);case"Tuple":return vP(o,i,r);case"Undefined":return LP(o,i,r);case"Union":return NP(o,i,r);default:return r}}function da(...e){return e.length===3?ir(e[0],e[1],e[2]):ir(e[0],[],e[1])}var fa=class extends A{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}},Ms=class extends A{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 ye(e,t,r){try{return z(e)?e[ue].Decode(r):r}catch(i){throw new Ms(e,t,r,i)}}function RP(e,t,r,i){return $(i)?ye(e,r,i.map((o,a)=>or(e.items,t,`${r}/${a}`,o))):ye(e,r,i)}function kP(e,t,r,i){if(!L(i)||ot(i))return ye(e,r,i);let o=Uo(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 ye(e,r,s);let c=Object.getOwnPropertyNames(s),l=e.unevaluatedProperties,p={...s};for(let m of c)a.includes(m)||(p[m]=ye(l,`${r}/${m}`,p[m]));return ye(e,r,p)}function FP(e,t,r,i){let o=globalThis.Object.values(e.$defs),a=e.$defs[e.$ref],s=or(a,[...t,...o],r,i);return ye(e,r,s)}function jP(e,t,r,i){return ye(e,r,or(e.not,t,r,i))}function UP(e,t,r,i){if(!L(i))return ye(e,r,i);let o=Ze(e),a={...i};for(let p of o)E(a,p)&&(ce(a[p])&&(!Or(e.properties[p])||Te.IsExactOptionalProperty(a,p))||(a[p]=or(e.properties[p],t,`${r}/${p}`,a[p])));if(!de(e.additionalProperties))return ye(e,r,a);let s=Object.getOwnPropertyNames(a),c=e.additionalProperties,l={...a};for(let p of s)o.includes(p)||(l[p]=ye(c,`${r}/${p}`,l[p]));return ye(e,r,l)}function _P(e,t,r,i){if(!L(i))return ye(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 ye(e,r,s);let c=Object.getOwnPropertyNames(s),l=e.additionalProperties,p={...s};for(let m of c)a.test(m)||(p[m]=ye(l,`${r}/${m}`,p[m]));return ye(e,r,p)}function DP(e,t,r,i){let o=Y(e,t);return ye(e,r,or(o,t,r,i))}function MP(e,t,r,i){let o=Y(e,t);return ye(e,r,or(o,t,r,i))}function BP(e,t,r,i){return $(i)&&$(e.items)?ye(e,r,e.items.map((o,a)=>or(o,t,`${r}/${a}`,i[a]))):ye(e,r,i)}function VP(e,t,r,i){for(let o of e.anyOf){if(!F(o,t,i))continue;let a=or(o,t,r,i);return ye(e,r,a)}return ye(e,r,i)}function or(e,t,r,i){let o=Fe(e,t),a=e;switch(e[g]){case"Array":return RP(a,o,r,i);case"Import":return FP(a,o,r,i);case"Intersect":return kP(a,o,r,i);case"Not":return jP(a,o,r,i);case"Object":return UP(a,o,r,i);case"Record":return _P(a,o,r,i);case"Ref":return DP(a,o,r,i);case"Symbol":return ye(a,r,i);case"This":return MP(a,o,r,i);case"Tuple":return BP(a,o,r,i);case"Union":return VP(a,o,r,i);default:return ye(a,r,i)}}function ha(e,t,r){return or(e,t,"",r)}var ga=class extends A{constructor(t,r,i){super("The encoded value does not match the expected schema"),this.schema=t,this.value=r,this.error=i}},Bs=class extends A{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 Bs(e,t,r,i)}}function KP(e,t,r,i){let o=Ve(e,r,i);return $(o)?o.map((a,s)=>ar(e.items,t,`${r}/${s}`,a)):o}function GP(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 qP(e,t,r,i){let o=Ve(e,r,i);if(!L(i)||ot(i))return o;let a=Uo(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 WP(e,t,r,i){return Ve(e.not,r,Ve(e,r,i))}function HP(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])&&(!Or(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 zP(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 JP(e,t,r,i){let o=Y(e,t),a=ar(o,t,r,i);return Ve(e,r,a)}function YP(e,t,r,i){let o=Y(e,t),a=ar(o,t,r,i);return Ve(e,r,a)}function QP(e,t,r,i){let o=Ve(e,r,i);return $(e.items)?e.items.map((a,s)=>ar(a,t,`${r}/${s}`,o[s])):[]}function XP(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 KP(a,o,r,i);case"Import":return GP(a,o,r,i);case"Intersect":return qP(a,o,r,i);case"Not":return WP(a,o,r,i);case"Object":return HP(a,o,r,i);case"Record":return zP(a,o,r,i);case"Ref":return JP(a,o,r,i);case"This":return YP(a,o,r,i);case"Tuple":return QP(a,o,r,i);case"Union":return XP(a,o,r,i);default:return Ve(a,r,i)}}function ya(e,t,r){return ar(e,t,"",r)}function ZP(e,t){return z(e)||ve(e.items,t)}function eE(e,t){return z(e)||ve(e.items,t)}function tE(e,t){return z(e)||ve(e.returns,t)||e.parameters.some(r=>ve(r,t))}function rE(e,t){return z(e)||ve(e.returns,t)||e.parameters.some(r=>ve(r,t))}function nE(e,t){return z(e)||z(e.unevaluatedProperties)||e.allOf.some(r=>ve(r,t))}function iE(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 oE(e,t){return z(e)||ve(e.items,t)}function aE(e,t){return z(e)||ve(e.not,t)}function sE(e,t){return z(e)||Object.values(e.properties).some(r=>ve(r,t))||de(e.additionalProperties)&&ve(e.additionalProperties,t)}function cE(e,t){return z(e)||ve(e.item,t)}function lE(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 pE(e,t){return z(e)?!0:ve(Y(e,t),t)}function mE(e,t){return z(e)?!0:ve(Y(e,t),t)}function uE(e,t){return z(e)||!ce(e.items)&&e.items.some(r=>ve(r,t))}function dE(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&&yp.has(e.$id))return!1;switch(e.$id&&yp.add(e.$id),e[g]){case"Array":return ZP(i,r);case"AsyncIterator":return eE(i,r);case"Constructor":return tE(i,r);case"Function":return rE(i,r);case"Import":return iE(i,r);case"Intersect":return nE(i,r);case"Iterator":return oE(i,r);case"Not":return aE(i,r);case"Object":return sE(i,r);case"Promise":return cE(i,r);case"Record":return lE(i,r);case"Ref":return pE(i,r);case"This":return mE(i,r);case"Tuple":return uE(i,r);case"Union":return dE(i,r);default:return z(e)}}var yp=new Set;function $n(e,t){return yp.clear(),ve(e,t)}function bp(...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 fa(t,i,En(t,r,i).First());return $n(t,r)?ha(t,r,i):i}function Jr(e,t){let r=E(e,"default")?e.default:void 0,i=hr(r)?r():H(r);return ce(t)?i:L(t)&&L(i)?Object.assign(i,t):t}function Op(e){return Lr(e)&&"default"in e}function fE(e,t,r){if($(r)){for(let o=0;o<r.length;o++)r[o]=et(e.items,t,r[o]);return r}let i=Jr(e,r);if(!$(i))return i;for(let o=0;o<i.length;o++)i[o]=et(e.items,t,i[o]);return i}function hE(e,t,r){return Ge(r)?r:Jr(e,r)}function gE(e,t,r){let i=globalThis.Object.values(e.$defs),o=e.$defs[e.$ref];return et(o,[...t,...i],r)}function yE(e,t,r){let i=Jr(e,r);return e.allOf.reduce((o,a)=>{let s=et(a,t,i);return L(s)?{...o,...s}:s},{})}function bE(e,t,r){let i=Jr(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(!Op(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 OE(e,t,r){let i=Jr(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)&&Op(s)&&(i[l]=et(s,t,i[l]));if(!Op(o))return i;for(let l of Object.getOwnPropertyNames(i))c.test(l)||(i[l]=et(o,t,i[l]));return i}function xE(e,t,r){return et(Y(e,t),t,Jr(e,r))}function SE(e,t,r){return et(Y(e,t),t,r)}function IE(e,t,r){let i=Jr(e,r);if(!$(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 wE(e,t,r){let i=Jr(e,r);for(let o of e.anyOf){let a=et(o,t,H(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 fE(o,i,r);case"Date":return hE(o,i,r);case"Import":return gE(o,i,r);case"Intersect":return yE(o,i,r);case"Object":return bE(o,i,r);case"Record":return OE(o,i,r);case"Ref":return xE(o,i,r);case"This":return SE(o,i,r);case"Tuple":return IE(o,i,r);case"Union":return wE(o,i,r);default:return Jr(o,r)}}function ba(...e){return e.length===3?et(e[0],e[1],e[2]):et(e[0],[],e[1])}var Gt={};nt(Gt,{Delete:()=>TE,Format:()=>Oa,Get:()=>EE,Has:()=>PE,Set:()=>CE,ValuePointerRootDeleteError:()=>Ks,ValuePointerRootSetError:()=>Vs});var Vs=class extends A{constructor(t,r,i){super("Cannot set root value"),this.value=t,this.path=r,this.update=i}},Ks=class extends A{constructor(t,r){super("Cannot delete root value"),this.value=t,this.path=r}};function Xf(e){return e.indexOf("~")===-1?e:e.replace(/~1/g,"/").replace(/~0/g,"~")}function*Oa(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 Xf(e.slice(t,r))),t=i+1):r=i;yield Xf(e.slice(t))}function CE(e,t,r){if(t==="")throw new Vs(e,t,r);let[i,o,a]=[null,e,""];for(let s of Oa(t))o[s]===void 0&&(o[s]={}),i=o,o=o[s],a=s;i[a]=r}function TE(e,t){if(t==="")throw new Ks(e,t);let[r,i,o]=[null,e,""];for(let a of Oa(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 PE(e,t){if(t==="")return!0;let[r,i,o]=[null,e,""];for(let a of Oa(t)){if(i[a]===void 0)return!1;r=i,i=i[a],o=a}return Object.getOwnPropertyNames(r).includes(o)}function EE(e,t){if(t==="")return e;let r=e;for(let i of Oa(t)){if(r[i]===void 0)return;r=r[i]}return r}function $E(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=>An(e[o],t[o]))}function AE(e,t){return Ge(t)&&e.getTime()===t.getTime()}function vE(e,t){return!$(t)||e.length!==t.length?!1:e.every((r,i)=>An(r,t[i]))}function LE(e,t){return!gt(t)||e.length!==t.length||Object.getPrototypeOf(e).constructor.name!==Object.getPrototypeOf(t).constructor.name?!1:e.every((r,i)=>An(r,t[i]))}function NE(e,t){return e===t}function An(e,t){if(Ge(e))return AE(e,t);if(gt(e))return LE(e,t);if($(e))return vE(e,t);if(L(e))return $E(e,t);if(ot(e))return NE(e,t);throw new Error("ValueEquals: Unable to compare value")}var eh=q({type:j("insert"),path:ke(),value:lt()}),th=q({type:j("update"),path:ke(),value:lt()}),rh=q({type:j("delete"),path:ke()}),xp=G([eh,th,rh]),xa=class extends A{constructor(t,r){super(r),this.value=t}};function Gs(e,t){return{type:"update",path:e,value:t}}function nh(e,t){return{type:"insert",path:e,value:t}}function ih(e){return{type:"delete",path:e}}function Zf(e){if(globalThis.Object.getOwnPropertySymbols(e).length>0)throw new xa(e,"Cannot diff objects with symbols")}function*RE(e,t,r){if(Zf(t),Zf(r),!hs(r))return yield Gs(e,r);let i=globalThis.Object.getOwnPropertyNames(t),o=globalThis.Object.getOwnPropertyNames(r);for(let a of o)E(t,a)||(yield nh(`${e}/${a}`,r[a]));for(let a of i)E(r,a)&&(An(t,r)||(yield*qs(`${e}/${a}`,t[a],r[a])));for(let a of i)E(r,a)||(yield ih(`${e}/${a}`))}function*kE(e,t,r){if(!$(r))return yield Gs(e,r);for(let i=0;i<Math.min(t.length,r.length);i++)yield*qs(`${e}/${i}`,t[i],r[i]);for(let i=0;i<r.length;i++)i<t.length||(yield nh(`${e}/${i}`,r[i]));for(let i=t.length-1;i>=0;i--)i<r.length||(yield ih(`${e}/${i}`))}function*FE(e,t,r){if(!gt(r)||t.length!==r.length||globalThis.Object.getPrototypeOf(t).constructor.name!==globalThis.Object.getPrototypeOf(r).constructor.name)return yield Gs(e,r);for(let i=0;i<Math.min(t.length,r.length);i++)yield*qs(`${e}/${i}`,t[i],r[i])}function*jE(e,t,r){t!==r&&(yield Gs(e,r))}function*qs(e,t,r){if(hs(t))return yield*RE(e,t,r);if($(t))return yield*kE(e,t,r);if(gt(t))return yield*FE(e,t,r);if(ot(t))return yield*jE(e,t,r);throw new xa(t,"Unable to diff value")}function Sp(e,t){return[...qs("",e,t)]}function UE(e){return e.length>0&&e[0].path===""&&e[0].type==="update"}function _E(e){return e.length===0}function Ip(e,t){if(UE(t))return H(t[0].value);if(_E(t))return H(e);let r=H(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 wp(...e){let[t,r,i]=e.length===3?[e[0],e[1],e[2]]:[e[0],[],e[1]],o=$n(t,r)?ya(t,r,i):i;if(!F(t,r,o))throw new ga(t,o,En(t,r,o).First());return o}function Ws(e){return L(e)&&!$(e)}var Sa=class extends A{constructor(t){super(t)}};function DE(e,t,r,i){if(!Ws(r))Gt.Set(e,t,H(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)Cp(e,`${t}/${s}`,r[s],i[s])}}function ME(e,t,r,i){if(!$(r))Gt.Set(e,t,H(i));else{for(let o=0;o<i.length;o++)Cp(e,`${t}/${o}`,r[o],i[o]);r.splice(i.length)}}function BE(e,t,r,i){if(gt(r)&&r.length===i.length)for(let o=0;o<r.length;o++)r[o]=i[o];else Gt.Set(e,t,H(i))}function VE(e,t,r,i){r!==i&&Gt.Set(e,t,i)}function Cp(e,t,r,i){if($(i))return ME(e,t,r,i);if(gt(i))return BE(e,t,r,i);if(Ws(i))return DE(e,t,r,i);if(ot(i))return VE(e,t,r,i)}function oh(e){return gt(e)||ot(e)}function KE(e,t){return Ws(e)&&$(t)||$(e)&&Ws(t)}function Tp(e,t){if(oh(e)||oh(t))throw new Sa("Only object and array types can be mutated at the root level");if(KE(e,t))throw new Sa("Cannot assign due type mismatch of assignable values");Cp(e,"",e,t)}var Ia=class extends A{constructor(t){super(t)}},Hs;(function(e){let t=new Map([["Assert",(a,s,c)=>(ca(a,s,c),c)],["Cast",(a,s,c)=>Bi(a,s,c)],["Clean",(a,s,c)=>pa(a,s,c)],["Clone",(a,s,c)=>H(c)],["Convert",(a,s,c)=>da(a,s,c)],["Decode",(a,s,c)=>$n(a,s)?ha(a,s,c):c],["Default",(a,s,c)=>ba(a,s,c)],["Encode",(a,s,c)=>$n(a,s)?ya(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})(Hs||(Hs={}));var Pp=["Clone","Clean","Default","Convert","Assert","Decode"];function GE(e,t,r,i){return e.reduce((o,a)=>{let s=Hs.Get(a);if(ce(s))throw new Ia(`Unable to find Parse operation \'${a}\'`);return s(t,r,o)},i)}function Ep(...e){let[t,r,i,o]=e.length===4?[e[0],e[1],e[2],e[3]]:e.length===3?$(e[0])?[e[0],e[1],[],e[2]]:[Pp,e[0],e[1],e[2]]:e.length===2?[Pp,e[0],[],e[1]]:(()=>{throw new Ia("Invalid Arguments")})();return GE(t,r,i,o)}var T={};nt(T,{Assert:()=>ca,Cast:()=>Bi,Check:()=>F,Clean:()=>pa,Clone:()=>H,Convert:()=>da,Create:()=>Kt,Decode:()=>bp,Default:()=>ba,Diff:()=>Sp,Edit:()=>xp,Encode:()=>wp,Equal:()=>An,Errors:()=>En,Hash:()=>ui,Mutate:()=>Tp,Parse:()=>Ep,Patch:()=>Ip,ValueErrorIterator:()=>xr});var xm={};nt(xm,{ASSET_UNREADABLE:()=>Up,BLOCK_SLOT_PLACEMENT_PROPS:()=>um,BLOCK_SLOT_ROLES:()=>ng,BLUEPRINT_FORMATS:()=>gg,BlockDefinitionsSchema:()=>en,BlockEvaluationError:()=>Ra,BlockInvocationPropsSchema:()=>Dn,BlockSlotSchema:()=>ig,BlueprintPagesSchema:()=>yg,BlueprintSchema:()=>bm,BlueprintVariantSchema:()=>bg,CANVASES:()=>Ch,ChromeSchema:()=>Hp,ComponentValidationError:()=>bi,DEFAULT_CHART_CONCURRENCY:()=>$g,DEFAULT_CHART_THEME_COLORS:()=>cA,DEFAULT_ERROR_CONFIG:()=>vn,DEFAULT_VISUAL_DPI:()=>ka,DesignSpacingSchema:()=>Wp,DesignSystemProperties:()=>Un,DesignSystemSchema:()=>Th,DuplicateComponentError:()=>qi,ERROR_EMOJIS:()=>fi,FONT_URL_ALLOWLIST:()=>Np,FeatureRequirementCollector:()=>yh,FontFamilyNameSchema:()=>Ht,FontRegistry:()=>eA,FontRegistryEntrySchema:()=>Bp,FontRegistrySchema:()=>Cr,FontSourceSchema:()=>Mp,GENERICNESS_PENALTY:()=>KA,JsonBlockDefinitionSchema:()=>og,JsonBlockEvaluator:()=>OA,MAX_RASTERIZE_BATCH_SLIDES:()=>N$,MAX_RASTERIZE_FONTS:()=>v$,MAX_RASTERIZE_FONT_BYTES:()=>L$,MAX_VISUAL_DPI:()=>ja,MIN_VISUAL_DPI:()=>Fa,MotifSchema:()=>zp,POINTS_PER_PIXEL_96DPI:()=>eg,POPULAR_GOOGLE_FONTS:()=>Yh,PaletteSchema:()=>Kp,REMOTE_EXPORT_WARNING:()=>qA,RENDERER_DEPENDENCY_MISSING:()=>ec,ROLE_SCALE_STEPS:()=>Jp,RUBRIC:()=>BA,RendererRegistry:()=>Oh,SAFE_FONTS:()=>ac,SERVICE_UNAVAILABLE_CODE:()=>Om,SHIPPING_QUESTION:()=>VA,TYPE_ROLES:()=>zi,TextCaseSchema:()=>xi,TypeRoleNameSchema:()=>Vp,TypeRoleSchema:()=>wt,TypeRolesSchema:()=>Gp,TypographySchema:()=>qp,UPSTREAM_OVERRIDES:()=>Qh,UnknownPreservedComponentError:()=>Qs,UnsupportedRendererFeatureError:()=>kp,WEIGHT_LABELS:()=>zh,applyDocumentBlocksToSchema:()=>vA,applyExportMode:()=>sA,applyFontSubstitution:()=>sm,assertNever:()=>uh,assertRendererSupports:()=>bh,assetUnreadableError:()=>xh,blockDependencies:()=>ym,blockInvocationExample:()=>hg,blockInvocationPropsSchema:()=>ug,blockPointerKey:()=>fe,blockReferencesFromDocument:()=>LA,blockSlotBudgets:()=>SA,blockSlotEditorSchema:()=>yc,blockSlotFacts:()=>lg,blockSlotJsonSchema:()=>hc,blockSlotMarkdown:()=>pg,blockSlotRoles:()=>IA,blockSlotsEditorSchema:()=>mg,blockSlotsJsonSchema:()=>hm,blockValueAt:()=>cr,blockWordCount:()=>dm,buildDefaultSubstitutionMap:()=>Zh,calculatePosition:()=>Vi,capsFormatting:()=>Ah,chartFamilyResolver:()=>uA,chartFontFaceCss:()=>rg,chartPointsPerPixel:()=>lA,clampVisualDpi:()=>A$,clearComponentNamesCache:()=>Ca,collectFontNamesFromDocx:()=>R$,collectFontNamesFromPptx:()=>k$,compareSemver:()=>gi,composeBlocksWithPlugins:()=>$A,convertToJsonSchema:()=>rc,createBlockAuthoringSchema:()=>Ua,createComponent:()=>Gi,createComponentSchema:()=>Wi,createComponentSchemaObject:()=>nc,createErrorConfig:()=>wr,createJsonParseError:()=>hi,createLimiter:()=>Eg,createVersion:()=>Ki,cssFontFamily:()=>tg,defaultSubstituteFor:()=>Xh,definitionsFor:()=>Sg,designCanvas:()=>Ph,designColors:()=>Yp,detectFontFormat:()=>Yr,diagnoseUnsupportedFeatures:()=>jp,documentBlockMetadata:()=>xA,documentFontRegistry:()=>j$,explainRemovedBlockSyntax:()=>Xi,exportSchemaToFile:()=>Hi,extractStandardComponentNames:()=>di,fetchGoogleFontSources:()=>Jh,fixSchemaReferences:()=>Fn,formatErrorMessage:()=>Sr,formatErrorSummary:()=>Xr,getChartRequestStats:()=>iv,getLiteralValue:()=>It,getObjectSchemaPropertyNames:()=>Ir,getSchemaMetadata:()=>Ta,getUpstreamOverride:()=>iA,getValidationSummary:()=>Zs,groupErrorsByPath:()=>Pa,instantiateBlueprint:()=>DA,isAllowedFontUrl:()=>Js,isBlockRecord:()=>V,isBlueprint:()=>jA,isLiteralSchema:()=>Qr,isObjectSchema:()=>qt,isPrivateServiceUrl:()=>Pg,isSafeFont:()=>Oi,isUnionSchema:()=>wa,isValidSemver:()=>Rn,isValidationSuccess:()=>Xs,latestVersion:()=>dt,mergeFontRegistries:()=>U$,mergeWithDefaults:()=>GA,parseSemver:()=>Nn,partitionDiagnostics:()=>gh,postJsonToService:()=>nv,readBlockDefinitions:()=>Pr,recordChartCollected:()=>av,recordChartRetry:()=>sv,registerBlueprints:()=>UA,remoteExportNotice:()=>WA,rendererError:()=>Fp,rendererWarning:()=>hh,resetChartLimiters:()=>fv,resetChartRequestStats:()=>ov,resolveBlockSlot:()=>Oc,resolveComponentVersion:()=>yi,resolveDesignColor:()=>Qp,resolveMotif:()=>vh,resolveServiceUrl:()=>QA,resolveTypeRoles:()=>Lh,restructureNameDiscriminatedUnions:()=>Ea,rewriteFontFamilyName:()=>vp,selectVariant:()=>xg,sendChartRequest:()=>uv,slotAt:()=>Ig,synthesizeFamilyName:()=>M$,themeFontRegistry:()=>Hh,toAuthoredBlockPointer:()=>Zr,transformValueError:()=>Ln,transformValueErrors:()=>tt,typeScaleSizes:()=>$h,unionBranches:()=>tc,validateBlockDefinitions:()=>xc,validateBlockInvocations:()=>Qi,validateBlueprint:()=>Og,validateCustomComponentProps:()=>kn,validateDesignColors:()=>Nh,validateFontReferences:()=>D$,valueAt:()=>Cg,withChartFontFaceCss:()=>hA,withChartTypography:()=>dA});var qE=new Set([1,4,6,16]),WE=2981146554;function ah(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 HE(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 zE(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 JE(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),be=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:be,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),be=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:be,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=HE(I,v.value)),u.push(I))}m.length=0,m.push(...u);let f=zE(m);a[s]={...a[s],data:f,checksum:ah(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=ah(S),v=WE-I>>>0;S.writeUInt32BE(v,N.offset+8)}return S}function YE(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 zs(e,t){let r=YE(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 Ap(e){let t=[];for(let r of zs(e,QE)){let i=r.value.trim();i.length>0&&!t.includes(i)&&t.push(i)}return t}var QE=new Set([1,16]);function XE(e,t){return e?t?"Bold Italic":"Bold":t?"Italic":"Regular"}function vp(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 JE(e,p=>qE.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 ZE={100:"Thin",200:"ExtraLight",300:"Light",400:"Regular",500:"Medium",600:"SemiBold",700:"Bold",800:"ExtraBold",900:"Black"};function Lp(e,t){let r=ZE[e];return r?{typographic:t?`${r} Italic`:r,legacy:XE(e>=600,t)}:null}var Np=["fonts.gstatic.com","fonts.googleapis.com","cdn.jsdelivr.net"];function Js(e){let t;try{t=new URL(e)}catch{return!1}return t.protocol!=="https:"?!1:Np.includes(t.hostname.toLowerCase())}function Yr(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 Ys=new Map;function wa(e){return"anyOf"in e&&Array.isArray(e.anyOf)}function qt(e){return e.type==="object"&&"properties"in e}function Qr(e){return"const"in e}function Ir(e){return qt(e)?Object.keys(e.properties):[]}function It(e){if(Qr(e))return e.const}function di(e){if(Ys.has(e))return Ys.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&&Qr(i)){let o=It(i);typeof o=="string"&&t.push(o)}}}else if(qt(e)){let r=e.properties?.name??e.properties?.type;if(r&&Qr(r)){let i=It(r);typeof i=="string"&&t.push(i)}}return Ys.set(e,t),t}function Ca(){Ys.clear()}function Ta(e){let t={};return"type"in e&&(t.type=String(e.type)),qt(e)&&(t.properties=Ir(e)),Qr(e)&&(t.literal=It(e)),t}function sh(){return typeof process>"u"||!process.env?!1:!!(process.env.CI||process.env.GITHUB_ACTIONS||process.env.GITLAB_CI)}function e$(){return typeof process>"u"||process.env?.NO_COLOR?!1:process.env?.FORCE_COLOR||process.stdout?.isTTY?!0:!sh()}var vn={includeEmojis:!sh(),verbosity:"normal",includeSuggestions:!0,includePath:!0,maxMessageLength:0,includeDocLinks:!1,colorSupport:e$()};function wr(e){return{...vn,...e}}var fi={ERROR:"\\u274C",WARNING:"\\u26A0\\uFE0F",FIX:"\\u{1F527}",INFO:"\\u2139\\uFE0F",SUCCESS:"\\u2705"};function Sr(e,t){return t.maxMessageLength>0&&e.length>t.maxMessageLength?e.substring(0,t.maxMessageLength)+"...":e}function t$(e,t){let r=String(e.type||""),i=e.path||"root";return r==="62"||r==="union"?r$(e):e.message?.includes("additionalProperties")?n$(e):e.message?.includes("Required property")?i$(e):r==="string"||r==="number"||r==="boolean"||r==="array"||r==="object"?o$(e):r==="literal"?a$(e):r==="pattern"||r==="RegExp"?s$(e):`At ${i}: ${e.message}`}function r$(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 n$(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=Ir(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 i$(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 o$(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 a$(e){let t=e.path||"root",r=e.schema?JSON.stringify(It(e.schema)):"specific value",i=JSON.stringify(e.value);return`Invalid value at ${t}: Expected exactly ${r} but got ${i}`}function s$(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 Ln(e,t,r){let i=wr(r),o=t$(e,i),a={path:e.path||"root",message:Sr(o||e.message,i),code:String(e.type||"validation_error"),value:e.value};if(i.includeSuggestions){let s=c$(e,i);s&&(a.suggestion=Sr(s,i))}if(t&&e.path){let s=Vi(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(Ln(a,t?.jsonString,void 0)))}return i}function Vi(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 c$(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(It(e.schema)):"specific value"}`}function Xr(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 Pa(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 ch=/^(\\d+)\\.(\\d+)\\.(\\d+)$/;function Rn(e){return ch.test(e)}function Nn(e){let t=e.match(ch);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=Nn(e),i=Nn(t);return r.major-i.major||r.minor-i.minor||r.patch-i.patch}function dt(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 Ki(e){return e}function Gi(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(!Rn(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=dt(i);return t[o]}var qi=class lh 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,lh)}},Qs=class ph 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,ph)}},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 Rp(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 kn(e,t,r){let i=r?.componentName??"custom";try{let o=Rp(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 Xs(e){return e.valid===!0&&e.data!==void 0}function Zs(e){return e.valid?"Validation successful":!e.errors||e.errors.length===0?"Validation failed with unknown error":Xr(e.errors)}function uh(e,t){let r=l$(e);throw new Error(t?`Unhandled variant in ${t}: ${r}`:`Unhandled variant: ${r}`)}function l$(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 kp=class dh extends Error{constructor(r){let{format:i,rendererId:o,diagnostics:a}=r,s=mh(a.map(l=>l.feature)),c=mh(a.map(l=>l.path));super(m$(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,dh)}},p$=class fh 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,fh)}};function mh(e){return[...new Set(e)]}function m$(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 Fp(e,t,r){return{feature:e,path:t,severity:"error",message:r}}function hh(e,t,r){return{feature:e,path:t,severity:"warning",message:r}}function gh(e){let t=[],r=[];for(let i of e)i.severity==="error"?t.push(i):r.push(i);return{errors:t,warnings:r}}var yh=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 jp(e,t,r){let i=[];for(let o of e)t.has(o.feature)||i.push(Fp(o.feature,o.path,u$(o,r)));return i}function u$(e,t){let r=`the "${t}" renderer cannot express "${e.feature}"`;return e.detail?`${r} (${e.detail})`:r}function bh(e,t){let r=jp(e,t.capabilities,t.id);if(r.length!==0)throw new kp({format:t.format,rendererId:t.id,diagnostics:r})}var Oh=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 p$(this.format,t,this.ids());try{return await r()}catch(i){throw d$(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===ec&&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 d$(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=f$(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=ec,a&&(c.packageName=a),c}var ec="RendererDependencyMissingError";function f$(e){return(/Cannot find (?:module|package) [\'"]([^\'"]+)[\'"]/.exec(e)??/Failed to resolve (?:module|import)[: ]+[\'"]?([^\'"\\s]+)/.exec(e))?.[1]}var Up="AssetUnreadableError";function xh(e,t){let r=t instanceof Error?t.message:String(t),i=e.startsWith("data:")&&e.length>50?`${e.slice(0,50)}\\u2026`:e,o=new Error(`Failed to load image from ${i}: ${r}`,{cause:t});return o.name=Up,o.source=e,o}var h$="Sheet1";var GW=`<?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="${h$}" sheetId="1" r:id="rId1"/></sheets></workbook>`;function Ih(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 g$(e){return typeof e.properties?.version?.const=="string"}function y$(e){return Array.isArray(e.required)&&e.required.includes("name")}function b$(e){let t=new Map;for(let r of e){let i=Ih(r),o=t.get(i);o?o.push(r):t.set(i,[r])}return t}function O$(e,t){let r=t.find(i=>!g$(i)&&typeof i.description=="string")??t.find(i=>typeof i.description=="string");return{const:e,type:"string",...r?{description:r.description}:{}}}function Ea(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=>Ih(l)!==void 0&&y$(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")?b$(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])=>O$(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 tc(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 Dp(e,t,r){if(!(typeof e!="object"||e===null)){if(Array.isArray(e)){e.forEach(i=>{typeof i=="object"&&i!==null&&Dp(i,t,r)});return}e.$ref===t&&(e.$ref=r);for(let i of Object.values(e))typeof i=="object"&&i!==null&&Dp(i,t,r)}}function Fn(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 rc(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,Dp(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),Fn(u),c?.(u),Ea(u),u}function Wi(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))})),Fn(a,o),a.additionalProperties=!1,a}async function Hi(e,t,r={}){let{prettyPrint:i=!0}=r,o=i?JSON.stringify(e,null,2):JSON.stringify(e);await(await Promise.resolve().then(()=>pd(_p(),1))).writeFile(t,o,"utf-8")}function nc(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 ac=["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 ac.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"]}),$a=n.Number({minimum:100,maximum:900,description:"OpenType weight (100 thin ... 900 black). Default 400."}),sc=n.Boolean({description:"Whether this source is italic. Default false."}),x$=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"}),S$=n.Object({kind:n.Literal("google"),family:n.String({description:\'Exact Google Fonts family name (e.g. "Inter").\'}),weights:n.Optional(n.Array($a,{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"}),I$=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($a),italic:n.Optional(sc)},{additionalProperties:!1,description:"Local font file to embed"}),w$=n.Object({kind:n.Literal("url"),url:n.String({description:"HTTPS URL of a TTF or OTF file."}),weight:n.Optional($a),italic:n.Optional(sc)},{additionalProperties:!1,description:"Direct TTF/OTF URL (non-Google CDN)"}),C$=n.Object({kind:n.Literal("variable"),url:n.String({description:"HTTPS URL of a variable TTF (`fvar` axis table required)."}),weight:$a,italic:n.Optional(sc),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."}),T$=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($a),italic:n.Optional(sc)},{additionalProperties:!1,description:"Inline base64 font \\u2014 portable"}),Mp=n.Union([x$,S$,I$,T$,w$,C$],{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.\'}),P$=n.Union([n.Literal("sans"),n.Literal("serif"),n.Literal("mono"),n.Literal("display"),n.Literal("handwriting")],{description:"Broad category used for fallback selection"}),Bp=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(P$),sources:n.Array(Mp,{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.*."}),Cr=n.Array(Bp,{description:"Document-scoped font registry. Every non-safe font used in this document must be registered here."}),zi=["eyebrow","display","stat","quote","label","footer","tableHeader","tableCell","chartLabel","tracker","source"],Vp=n.Union(zi.map(e=>n.Literal(e))),Ch=["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."}),Kp=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}),wt=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}),Gp=n.Object({eyebrow:n.Optional(wt),display:n.Optional(wt),stat:n.Optional(wt),quote:n.Optional(wt),label:n.Optional(wt),footer:n.Optional(wt),tableHeader:n.Optional(wt),tableCell:n.Optional(wt),chartLabel:n.Optional(wt),tracker:n.Optional(wt),source:n.Optional(wt)},{additionalProperties:!1}),ic=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}),qp=n.Object({roles:n.Optional(Gp),scale:n.Optional(n.Object({a4:n.Optional(ic),letter:n.Optional(ic),wide169:n.Optional(ic),standard43:n.Optional(ic)},{additionalProperties:!1}))},{additionalProperties:!1}),oc=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}),Wp=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(oc),letter:n.Optional(oc),wide169:n.Optional(oc),standard43:n.Optional(oc)},{additionalProperties:!1}))},{additionalProperties:!1}),jn=n.Object({type:n.Optional(Vp),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}),Hp=n.Object({runningHead:n.Optional(jn),tracker:n.Optional(jn),actionTitle:n.Optional(jn),keyTakeaways:n.Optional(jn),sourceLine:n.Optional(jn),confidentialFooter:n.Optional(jn),logoSlot:n.Optional(jn),cover:n.Optional(jn)},{additionalProperties:!1,description:"Visual recipes; consumers land in #361. No automatic content or presence requirements."}),zp=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."}),Un={palette:n.Optional(Kp),typography:n.Optional(qp),spacing:n.Optional(Wp),chrome:n.Optional(Hp),motif:n.Optional(zp)},Th=n.Object(Un,{additionalProperties:!1});function Ph(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 Jp={display:4,stat:3,quote:1,tableHeader:0,tableCell:0,label:-1,eyebrow:-1,chartLabel:-1,tracker:-1,footer:-2,source:-2};function Eh(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 wh={from:-2,to:5};function $h(e){let t=new Set;for(let r=wh.from;r<=wh.to;r+=1)t.add(Eh(e,r));return[...t].sort((r,i)=>r-i)}function E$(e){let t={};for(let[r,i]of Object.entries(e??{}))typeof i=="string"&&(t[r]=i);return t}function Ah(e){return e==="upper"?{allCaps:!0}:{smallCaps:e==="smallCaps"}}function vh(e){return e&&e.kind!=="none"?e:void 0}function Lh(e,t,r){let i=e.typography?.scale?.[t],o={};for(let a of zi){let s=e.typography?.roles?.[a];s&&(o[a]={...s,size:s.size??(i?Eh(i,Jp[a]):r)})}return o}function Yp(e,t){return{...e,...E$(t)}}function Qp(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 Nh(e,t){let r=Yp(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&&!Qp(a,r))throw new Error(`Unresolvable theme color at ${o}: "${a}" (unknown token or cycle)`)}function cc(e){return/^\\s*\\{\\{\\s*[^{}\\n]*?\\S[^{}\\n]*?\\s*\\}\\}\\s*$/.test(e)}var $$=[{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 t6=$$.map(e=>e.id);var ka=200,Fa=36,ja=600;function A$(e){return typeof e!="number"||!Number.isFinite(e)?ka:Math.min(ja,Math.max(Fa,Math.round(e)))}var v$=32,L$=8*1024*1024,N$=32,Kh=new Set(["family","fontFace","titleFontFace","legendFontFace","dataLabelFontFace","catAxisLabelFontFace","valAxisLabelFontFace"]),Gh=new Set(["heading","body","mono","light"]),qh=new Set(["fontRegistry"]);function am(e,t,r){if(e!=null){if(typeof e=="string"){if(r&&(Kh.has(r)||Gh.has(r))){let i=e.trim();i.length>0&&t.add(i)}return}if(Array.isArray(e)){for(let i of e)am(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))qh.has(o)||am(a,t,o)}}}function Yi(e){let t=new Set;return am(e,t),t}var R$=Yi,k$=Yi;function F$(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 Wh(e,t){if(!e||typeof e!="object")return[];let r=e[t];return Array.isArray(r)?r.filter(F$):[]}function j$(e){return!e||typeof e!="object"?[]:Wh(e.props,"fontRegistry")}function Hh(e){return Wh(e,"fontRegistry")}function U$(...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 _$(e){let t=new Set;for(let r of e??[])t.add(r.family.toLowerCase()),t.add(r.id.toLowerCase());return t}function D$(e){let t=_$(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: ${ac.join(", ")}.`})}return{resolved:r,unresolved:i,warnings:o}}var zh={100:"Thin",200:"ExtraLight",300:"Light",400:"Regular",500:"Medium",600:"SemiBold",700:"Bold",800:"ExtraBold",900:"Black"};function M$(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=zh[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 lc=5*1024*1024;function B$(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)>lc)throw new Error(`Font data payload exceeds ${lc} byte limit`);let o=Buffer.from(r,"base64");if(o.length===0)throw new Error("Decoded font buffer is empty");if(o.length>lc)throw new Error(`Font data payload exceeds ${lc} byte limit`);let a=Yr(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 V$="Mozilla/4.0";async function Rh(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 K$(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 G$(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 kh(e,t,r){return`google|${e}|${t}|${r?"i":"r"}`}async function Jh(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=kh(e.family,m.weight,m.italic),f=e.memoryCache?.get(u);if(f){o.push({data:f,weight:m.weight,italic:m.italic,format:Yr(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:Yr(O)});continue}s.push(m)}if(s.length===0)return{sources:o,warnings:i};let c=s.some(m=>m.italic),l=K$(e.family,Array.from(new Set(s.map(m=>m.weight))),c),p;try{let m=await Rh(l,{headers:{"User-Agent":V$},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=G$(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 Rh(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=kh(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:Yr(w)})}catch(f){i.push(`Google Fonts TTF fetch for "${e.family}" ${m.weight} failed: ${f.message}`)}}return{sources:o,warnings:i}}function q$(e,t,r){return`url|${e}|${t}|${r?"i":"r"}`}async function W$(e){if(!Js(e.url))return{warnings:[`URL font fetch rejected (host not in allowlist or non-HTTPS): ${e.url}`]};let t=q$(e.url,e.weight,e.italic),r=e.memoryCache?.get(t);if(r)return{source:{data:r,weight:e.weight,italic:e.italic,format:Yr(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:Yr(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(!Js(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=Yr(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 Fh=12,jh=16;function H$(e,t){if(e.length<Fh)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=Fh+o*jh;if(a+jh>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 z$(e){let t=H$(e,"OS/2");return!t||t.off+6>e.length?null:e.readUInt16BE(t.off+4)}function J$(e,t,r,i){let o=[],a=z$(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=Ap(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=Lp(t,r);if(!c)return o;let l=c.typographic,p=c.legacy,m=zs(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 Y$=new Set([65536,1330926671,1953658213,1954115633]),Xp=12,Uh=16;function Q$(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<Xp)return a(`${e.length} bytes is shorter than an sfnt header \\u2014 the download is truncated or empty.`);let s=e.readUInt32BE(0);if(!Y$.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=Xp+c*Uh;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=Xp+f*Uh,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 ").\'):zs(e).length===0?a(\'its "name" table carries no readable records.\'):null}var X$=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 Z$(e,t){if(e.format!=="ttf"&&e.format!=="otf")return e;let r=Ap(e.data);if(r.length===0||r.includes(t))return e;let i=Lp(e.weight,e.italic)?.legacy;return{...e,data:vp(e.data,t,i)}}var eA=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 X$,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?Q$(a.data,a.weight,a.italic,e.family):null;if(c){r.push(`[${c.code}] ${c.message}`),t.push(a);continue}let l=Z$(a,e.family);if(s)for(let p of J$(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[B$({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 Jh({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 W$({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}`)}}},Yh=[{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}],tA="https://cdn.jsdelivr.net/gh/rsms/inter@v4.1/docs/font-files/InterVariable.ttf",rA="https://cdn.jsdelivr.net/gh/rsms/inter@v4.1/docs/font-files/InterVariable-Italic.woff2";function nA(){let e=[100,200,300,400,500,600,700,800,900],t=e.map(i=>({kind:"variable",url:tA,weight:i,italic:!1})),r=e.map(i=>({kind:"variable",url:rA,weight:i,italic:!0}));return[...t,...r]}var Qh={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:nA()}};function iA(e){return Qh[e.toLowerCase()]}function sm(e,t){let r=new Map,i=dc(e,t,r),o=[];for(let[a,s]of r)o.push({from:a,to:s});return{doc:i,substitutions:o}}function dc(e,t,r,i){if(e==null)return e;if(typeof e=="string")return i&&(Kh.has(i)||Gh.has(i))?Zp(e,t,r):e;if(Array.isArray(e))return e.map(o=>dc(o,t,r,i));if(typeof e=="object"){let o={};for(let[a,s]of Object.entries(e)){if(qh.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]=Zp(p,t,r);else if(p&&typeof p=="object"){let m=p.family;c[l]=typeof m=="string"?{...p,family:Zp(m,t,r)}:dc(p,t,r,l)}else c[l]=p;o[a]=c;continue}o[a]=dc(s,t,r,a)}return o}return e}function Zp(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 oA={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"},aA={sans:"Calibri",serif:"Georgia",mono:"Consolas",display:"Georgia",handwriting:"Segoe UI"};function Xh(e){let t=e.trim();for(let[i,o]of Object.entries(oA))if(i.toLowerCase()===t.toLowerCase())return o;let r=Yh.find(i=>i.family.toLowerCase()===t.toLowerCase());if(r){let i=aA[r.category];if(i)return i}return"Calibri"}function Zh(e){let t={};for(let r of e){let i=r.trim();i.length!==0&&(Oi(i)||t[i]||(t[i]=Xh(i)))}return t}function sA(e){if((e.fonts?.mode??"custom")==="custom"){if(!e.fonts)return{doc:e.doc,theme:e.theme,warnings:[]};let m=[...new Set([...Yi(e.doc),...Yi(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([...Yi(e.doc),...Yi(e.theme)]),o={...Zh(r),...e.fonts?.substitution??{}},a=sm(e.doc,o),s=sm(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 cA=["primary","secondary","accent","accent4","accent5","accent6"],eg=.75;function lA(e,t){return!Number.isFinite(e)||e<=0||t===void 0||!Number.isFinite(t)||t<=0?eg:t/e}var pA=new Set(["georgia","times new roman","cambria"]),mA=new Set(["consolas","courier new","menlo","monaco"]);function tg(e,t){let r=t==="serif"?"serif":t==="mono"?"monospace":t==="handwriting"?"cursive":t===void 0&&pA.has(e.toLowerCase())?"serif":t===void 0&&mA.has(e.toLowerCase())?"monospace":"sans-serif";return`"${e.replace(/["\\\\]/g,"\\\\$&")}", ${r}`}function uA(e){let t=new Map(Hh(e).map(r=>[r.family.toLowerCase(),r.category]));return r=>tg(r,t.get(r.toLowerCase()))}function Aa(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function sr(e,t){if(e!==void 0&&!Aa(e))return e;let r=Aa(e)?{...e}:{};for(let[i,o]of Object.entries(t)){if(o===void 0)continue;let a=r[i];a===void 0?r[i]=Aa(o)?sr(void 0,o):o:Aa(a)&&Aa(o)&&(r[i]=sr(a,o))}return r}function _h(e,t){return Array.isArray(e)?e.map(r=>sr(r,t)):sr(e,t)}function Dh(e){return e===void 0?void 0:String(e)}function dA(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:Dh(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:Dh(t.titleWeight),color:t.textColor}}),subtitle:sr(e.subtitle,{style:s}),caption:sr(e.caption,{style:c}),xAxis:_h(e.xAxis,p),yAxis:_h(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 fA={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 rg(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}=fA[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 hA(e,t,r){let i=rg(t,r);if(!i)return e;let o=e.resources?.css;return{...e,resources:{...e.resources,css:o?`${i}\n${o}`:i}}}var ng=["actionTitle","takeaway","source","tracker","footer","logo"],ig=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(ng.map(t=>n.Literal(t)),{description:"Content role for quality profiles: actionTitle, takeaway, source, tracker, footer or logo. A profile may require or measure it; the theme only styles it. Tracker, footer, source and logo are chrome, which a deck may draw in the margin band."}))},{additionalProperties:!1}),{$id:"BlockSlot"}),og=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(),ig,{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})),en=n.Record(n.String({pattern:"^[a-zA-Z][a-zA-Z0-9_-]*$"}),og,{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 hc(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:hc(i)},...r&&{properties:Object.fromEntries(Object.entries(r).map(([s,c])=>[s,hc(c)])),required:Object.entries(r).filter(([,s])=>s.required&&s.default===void 0).map(([s])=>s),additionalProperties:!1}}}var pm={$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"}},mm=["$item","$slot","$context","$theme"],Ra=class extends Error{constructor(e){super(e.map(t=>`${t.path}: ${t.message}`).join(`\n`)),this.issues=e,this.name="BlockEvaluationError"}},V=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),fe=e=>e.replace(/~/g,"~0").replace(/\\//g,"~1"),rt=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);function cr(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(!V(r)&&!Array.isArray(r)||!rt(r,o))return;r=r[o]}return r}function Zr(e,t,r=[]){let i;for(let a of r)(t===a||t.startsWith(`${a}/`))&&(i===void 0||a.length>i.length)&&(i=a);if(i!==void 0)return Zr(e,i);let o;for(let a of Object.keys(e))(t===a||t.startsWith(`${a}/`))&&(o===void 0||a.length>o.length)&&(o=a);return o===void 0?t:`${e[o]}${t.slice(o.length)}`}var um=["x","y","w","h","position","grid","gridConfig","direction","gap","weights","alignment","spacing"],dm=e=>e.trim()===""?0:e.trim().split(/\\s+/).length,em=e=>e!=null&&e!==""&&e!==!1&&(!Array.isArray(e)||e.length>0),_n=(e,t,r)=>{throw new Ra([{path:e,code:t,message:r}])};function Oc(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"?V(o)&&typeof o.name=="string":e.type==="object"?V(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"&&cc(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&&dm(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)=>Oc(e.items,l,`${r}/${p}`,i)):o;if(e.type==="component"&&V(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(!V(p))return;let f=typeof p.name=="string"&&V(p.props)?p.props:{};for(let O of um)rt(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}/${fe(O)}`,u+1)};l(o,r)}return e.type==="object"&&V(o)&&e.properties?fm(e.properties,o,r,i):o}function fm(e,t,r,i){let o={};for(let a of Object.keys(t))rt(e,a)||i.push({path:`${r}/${fe(a)}`,code:"block_unknown_slot",message:`Unknown slot \'${a}\'. Expected: ${Object.keys(e).join(", ")}.`});for(let[a,s]of Object.entries(e)){let c=Oc(s,rt(t,a)?t[a]:void 0,`${r}/${fe(a)}`,i);c!==void 0&&Object.defineProperty(o,a,{value:c,enumerable:!0,writable:!0,configurable:!0})}return o}var gA=Object.fromEntries(Object.entries(pm).map(([e,t])=>[e,t.keys]));function yA(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=rt(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 cm=["$if","$each","$count"],gc=e=>typeof e=="string"&&(e===""||e.startsWith("/")),ag=e=>gc(e)?[e]:Array.isArray(e)&&e.length>0&&e.every(gc)?e:void 0;function sg(e,t){if(gc(e))return{root:cm.includes(t)?"$slot":t,pointer:e};if(!cm.includes(t)||!V(e))return;let r=Object.keys(e),i=mm.find(o=>o===r[0]);if(!(r.length!==1||!i||!gc(e[i])))return{root:i,pointer:e[i]}}function va(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)=>va(c,`${t}/${l}`,r,i,o,a+1));return}if(!V(e))return;let s=Object.keys(e).filter(c=>c.startsWith("$"));if(s.length){let c=s[0],l=gA[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=sg(e[c],c),m=c==="$theme"?ag(e[c]):void 0;if(!p&&!m)i.push({path:t,code:"block_invalid_binding",message:cm.includes(c)?`${c} takes a slot pointer such as /items, or one reference: ${mm.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=yA(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")&&rt(e,"props")&&!V(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"&&!rt(e,"then")&&i.push({path:t,code:"block_invalid_binding",message:"$if requires then."}),c==="$each"&&(!rt(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"||va(l,`${t}/${fe(c)}`,r,i,o||rt(e,"$each"),a+1)}function Pr(e){return(V(e)&&V(e.props)?e.props.blocks:void 0)??{}}function xc(e,t,r=[]){if(!T.Check(en,e))return[...T.Errors(en,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/${fe(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&&Oc(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/${fe(m)}`)};for(let[l,p]of Object.entries(a.slots))c(p,`${s}/slots/${fe(l)}`);va(a.body,`${s}/body`,a.slots,i),a.section&&va(a.section,`${s}/section`,a.slots,i),a.slide&&va(a.slide,`${s}/slide`,a.slots,i)}return i.push(...bA(e)),i}function Ii(e,t,r,i=!1){if(Array.isArray(e)){e.forEach((a,s)=>Ii(a,`${t}/${s}`,r,i));return}if(!V(e)||e.enabled===!1)return;if(e.name==="block"&&V(e.props)&&typeof e.props.ref=="string"&&r.push({ref:e.props.ref,path:`${t}/props/ref`,guarded:i}),"$if"in e&&("then"in e||"else"in e)){Ii(e.$if,`${t}/$if`,r,i);let a=p=>{let m=[];return p in e&&Ii(e[p],`${t}/${fe(p)}`,m,i),m},s=a("then"),c=a("else"),l=new Set("then"in e&&"else"in e?s.filter(p=>!p.guarded).map(p=>p.ref).filter(p=>c.some(m=>!m.guarded&&m.ref===p)):[]);for(let p of[...s,...c])r.push({...p,guarded:p.guarded||!l.has(p.ref)});return}let o=Object.keys(e).some(a=>a.startsWith("$")&&a!=="$join");for(let[a,s]of Object.entries(e))Ii(s,`${t}/${fe(a)}`,r,i||o)}function bA(e){let t=[],r=new Map;for(let[c,l]of Object.entries(e)){let p=`/props/blocks/${fe(c)}`,m=[];Ii(l.body,`${p}/body`,m),l.section&&Ii(l.section,`${p}/section`,m),l.slide&&Ii(l.slide,`${p}/slide`,m),r.set(c,m);for(let u of m)rt(e,u.ref)||t.push({path:u.path,code:"block_unknown_reference",message:`Block \'${u.ref}\' is not defined in this document.`})}let i=new Set,o=[],a=new Set,s=c=>{if(!i.has(c)){o.push(c);for(let l of r.get(c)??[]){if(l.guarded||!rt(e,l.ref))continue;let p=o.indexOf(l.ref);if(p!==-1){if(a.has(`${c}\\0${l.ref}`))continue;a.add(`${c}\\0${l.ref}`),t.push({path:l.path,code:"block_expansion_limit",message:`Block \'${l.ref}\' invokes itself on every expansion (${[...o.slice(p),l.ref].join(" \\u2192 ")}), so expansion could only stop at its limit.`});continue}s(l.ref)}o.pop(),i.add(c)}};for(let c of Object.keys(e))s(c);return t}function Qi(e,t,r,i=[]){let o=xc(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(!(!V(s)||s.enabled===!1)){if(s.name==="block"&&V(s.props)&&typeof s.props.ref=="string"){let l=rt(t,s.props.ref)?t[s.props.ref]:void 0;l?((s.props.slots===void 0||V(s.props.slots))&&fm(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}/${fe(l)}`)}};return a(e,""),o}var OA=class{constructor(e,t){R(this,"sourceMap",{});R(this,"blocks",[]);R(this,"pluginOutputs",[]);R(this,"blockSources",new Set);R(this,"nodes",0);this.definitions=e,this.options=t;let r=xc(e,t.format,t.reservedNames);if(r.length)throw new Ra(r)}guard(e,t){(t>64||++this.nodes>5e4)&&_n(e,"block_expansion_limit","Block expansion exceeds the depth/node limit (64/50000).")}operand(e,t,r){let{root:i,pointer:o}=sg(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:cr(r.item,t),source:`${r.itemSource??r.source}${t}`};if(e==="$context"){let i=Zr(r.contextSources??{},t);return{value:cr(r.context,t),source:i===t?r.source:i}}return e==="$theme"?{value:cr(this.options.theme,t),source:r.source}:{value:cr(r.slots,t),source:r.slotSources?Zr(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(V(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(!V(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"?ag(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&&rt(e,"default")&&(u=this.evaluate(e.default,t,r,`${i}/default`,o+1)),u===void 0&&s==="$theme")return _n(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")&&rt(e,"props")&&V(u)&&typeof u.name=="string"){let f=this.sourceMap[r],O=this.evaluate(e.props,t,`${r}/props`,`${i}/props`,o+1),w=V(u.props)?u.props:{};for(let S of Object.keys(w)){let x=`${r}/props/${fe(S)}`;for(let N of Object.keys(this.sourceMap))(N===x||N.startsWith(`${x}/`))&&delete this.sourceMap[N];this.sourceMap[x]=`${f}/props/${fe(S)}`}u={...u,props:{...V(O)?O:{},...w}}}return u}if("$if"in e){let s=this.operand(e.$if,"$if",t),c=em(s.value)?e.then:e.else,l=this.evaluate(c,t,r,i,o+1);return(!V(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:_n(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 _n(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(em);return c>=0&&(this.sourceMap[r]=this.sourceMap[`${r}/${c}`]),(e.keepEmpty===!0?s:s.filter(em)).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):_n(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}/${fe(s)}`,`${i}/${fe(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(!V(e))return e;if(e.name==="block"&&e.enabled!==!1){if(!V(e.props)||typeof e.props.ref!="string")return _n(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&&!V(e.props.slots))return _n(t,"block_invalid_invocation","Block props accept only ref and an object of slots.");let o=rt(this.definitions,e.props.ref)?this.definitions[e.props.ref]:void 0;if(!o)return _n(`${t}/props/ref`,"block_unknown_reference",`Block \'${e.props.ref}\' is not defined in this document.`);let a=[],s=Zr(this.sourceMap,t),c=`${t}/props/slots`,l=fm(o.slots,e.props.slots??{},c,a);if(a.length)throw new Ra(a.map(f=>({...f,path:Zr(this.sourceMap,f.path)})));let p=Object.fromEntries([["",Zr(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/${fe(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}/${fe(o)}`,r+1),enumerable:!0,configurable:!0,writable:!0});return i}};function hm(e){return{type:"object",additionalProperties:!1,properties:Object.fromEntries(Object.entries(e.slots).map(([t,r])=>[t,hc(r)])),required:Object.entries(e.slots).filter(([,t])=>t.required&&t.default===void 0).map(([t])=>t)}}function xA(e){let t=Pr(e);if(!T.Check(en,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(V(o)){o.name==="block"&&V(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}/${fe(s)}`)}};return i(e,""),{definitions:Object.entries(t).map(([o,a])=>({name:o,definitionPointer:`/props/blocks/${fe(o)}`,definition:a,slotsSchema:hm(a)})),invocations:r,invalidDefinitions:!1}}function cg(e,t,r){let i=Pr(e);for(let o of t){let a=cr(e,o);if(!V(a)||!V(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),V(m)&&p.properties)for(let[O,w]of Object.entries(p.properties))l(w,cr(m,`/${fe(O)}`),`${u}/${fe(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=cr(a.props.slots,`/${fe(p)}`);l(m,u===void 0&&m.default!==void 0?m.default:u,`${o}/props/slots/${fe(p)}`,p)}}}function SA(e,t){let r=[];return cg(e,t,(i,o,a,s,c)=>{typeof a=="string"&&o.maxWords!==void 0&&!cc(a)&&r.push({block:i,slot:c,path:s,words:dm(a),maxWords:o.maxWords})}),r}function IA(e,t){let r=[];return cg(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 tm=["null","boolean","number","string","array","object"],Ji=(e,t)=>new Set([...e].filter(r=>t.has(r))),wA=e=>new Set(e.flatMap(t=>[...t])),Mh=e=>e===null?"null":Array.isArray(e)?"array":typeof e;function La(e,t,r=new Set){if(e===!1)return new Set;if(e===!0||r.has(e))return new Set(tm);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(tm);if(e.type){let s=Array.isArray(e.type)?e.type:[e.type];a=Ji(a,new Set(tm.filter(c=>s.includes(c)||c==="number"&&s.includes("integer"))))}if(Object.hasOwn(e,"const")&&(a=Ji(a,new Set([Mh(e.const)]))),Array.isArray(e.enum)&&(a=Ji(a,new Set(e.enum.map(Mh)))),typeof e.$ref=="string"){let s=t(e.$ref);s!==void 0&&(a=Ji(a,La(s,t,o)))}for(let s of["anyOf","oneOf"])Array.isArray(e[s])&&(a=Ji(a,wA(e[s].map(c=>La(c,t,o)))));if(Array.isArray(e.allOf))for(let s of e.allOf)a=Ji(a,La(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 fc(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(fc(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=>La(s,t).has("array")).map(s=>fc(s,t,i))});return Array.isArray(e.allOf)&&o.push(...e.allOf.map(a=>fc(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}),Na=e=>({type:"string",pattern:"^(|/.*)$",description:e}),CA=e=>({anyOf:[Na(e),{type:"array",minItems:1,items:Na(e),description:e}],description:e}),TA=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."}),PA=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."},pc=(e,t)=>({...typeof e=="boolean"?{allOf:[e]}:e,description:t}),rm=e=>typeof e=="boolean"?{}:{...e.description&&{description:e.description},...e.markdownDescription&&{markdownDescription:e.markdownDescription}},EA=e=>({type:"object",required:[e]}),mc=Object.keys(pm);function Ua(e,t,r=[],i="docx"){let o=`BlockTemplate_${t}`,a=TA(i),s=PA(i),c=P=>({description:P,anyOf:[Na(P),...mm.map(Z=>Si({[Z]:Na(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(mc.map(P=>[P,I(EA(P))])),D=I({anyOf:Object.values(v)}),be=[...new Set(["",...mc.flatMap(P=>Array.from({length:P.length-1},(Z,_e)=>P.slice(0,_e+1)))])],Le=I({type:"object",propertyNames:{pattern:`^(?:${be.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),...rm(P)};let Ke=`${o}_Literal${S++}`;w.set(Z,Ke);let ht=e[Ke]={};if(Object.assign(ht,P),typeof P.$ref=="string"){let me=f(P.$ref);if(me!==void 0){let Ce=He(me);typeof Ce=="object"?ht.$ref=Ce.$ref:(delete ht.$ref,Ce||(ht.not={}))}}P.properties&&(ht.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&&(ht.patternProperties=Object.fromEntries(Object.entries(P.patternProperties).map(([me,Ce])=>[me,te(Ce)]))),P.items!==void 0&&(ht.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"&&(ht[me]=te(P[me],me==="additionalItems"));for(let me of["anyOf","oneOf","allOf"])Array.isArray(P[me])&&(ht[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&&(ht[me]=He(P[me]));return{...p(Ke),...rm(P)}}function te(P,Z=!1){if(P===!1)return!1;let _e=rm(P),Ke=typeof P=="object"?{...P}:P;typeof Ke=="object"&&(delete Ke.description,delete Ke.markdownDescription);let ht=`${Z?"sequence":"value"}:${JSON.stringify(Ke)}`,me=O.get(ht);if(me)return{...p(me),..._e};let Ce=`${o}_Value${S++}`;O.set(ht,Ce),e[Ce]={};let zt=p(Ce),sd=La(Ke,f);if(sd.size===0)return e[Ce]={allOf:[He(Ke)]},zt;let cd=()=>Z?te(Ke):zt,ld=()=>Z?{anyOf:[zt,{type:"array",items:zt}]}:zt,zb=()=>Z?cd():te(fc(Ke,f)),ur={};for(let he of mc){let Hn=pm[he].result;if(!(Hn!=="dynamic"&&!sd.has(Hn)&&!(Z&&Hn==="array")))switch(he){case"$slot":case"$item":case"$theme":case"$context":ur[he]=Si({[he]:he==="$theme"?CA(a[he]):Na(a[he]),default:pc(cd(),"Fallback value or binding used only when the referenced value is missing. Null, false and empty values do not trigger it."),...he==="$slot"||he==="$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."}}:{}},[he]);break;case"$if":ur[he]=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:pc(ld(),"Value or components to emit when the slot tested by $if is present."),else:pc(ld(),"Value or components to emit otherwise. Omit to produce no output.")},["$if","then"]);break;case"$each":ur[he]=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:pc(zb(),"One template evaluated per array entry. Use $item for the current entry and a group for multiple components.")},["$each","template"]);break;case"$count":ur[he]=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":ur[he]=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":ur[he]=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 gl=he;throw new Error(`Missing authoring schema for directive ${gl}`)}}}return e[Ce]={allOf:[{if:D,then:{allOf:mc.map(he=>({if:v[he],then:ur[he]?I({...ur[he],properties:Object.fromEntries(Object.entries(ur[he].properties).map(([Hn,gl])=>[Hn,I(gl)]))}):!1}))},else:He(Ke)},{if:Le,then:{properties:Object.fromEntries(Object.entries(ur).map(([he,Hn])=>[he,I(Hn.properties[he])]))}}]},{...zt,..._e}}return e[l]=te(x,!0),p(l)}async function $A(e,t,r){let i=r.preserve??new Set,o=0,a=async(s,c,l)=>{if(l>64||++o>1e5)throw new Ra([{path:Zr(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(!V(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=Zr(e.sourceMap,c),f=await r.render(p,u);e.sourceMap[`${c}/children`]=u,e.pluginOutputs.push(`${c}/children`);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 AA="^\\\\s*\\\\{\\\\{\\\\s*[^{}\\\\n]*?\\\\S[^{}\\\\n]*?\\\\s*\\\\}\\\\}\\\\s*$",gm=e=>JSON.parse(JSON.stringify(e));function nm(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 lg(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=nm(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=nm(e.minimum,e.maximum,"");i&&t.push(i.trim());let o=nm(e.minItems,e.maxItems,"entries");return o&&t.push(o),e.role&&t.push(`Role: ${e.role}`),t}function pg(e){return[e.description,lg(e).join(" \\xB7 ")].filter(Boolean).join(`\n\n`)}function yc(e,t){let r;if(e.type==="component")r=t?{allOf:[t,{properties:{props:{propertyNames:{not:{enum:[...um]},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:AA}]}}o&&(r.pattern="^[^\\\\r\\\\n]*$"),s&&(r.items=yc(s,t)),a&&(r.properties=Object.fromEntries(Object.entries(a).map(([l,p])=>[l,yc(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=pg(e);return i&&(r.markdownDescription=i),r}function mg(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,yc(i,t)])),required:Object.entries(e.slots).filter(([,r])=>r.required&&r.default===void 0).map(([r])=>r)}}function ug(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:mg(e[o],t)}}}))),i}function vA(e,t,r){for(let i of r){let o=e.definitions?.[i.name];if(!o)continue;let a=ug(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=gm(a);return}for(let[m,u]of Object.entries(p))m!=="$ref"&&c(u)};c(o)}}function bc(e,t){if(Array.isArray(e)){e.forEach(r=>bc(r,t));return}if(V(e)){e.name==="block"&&V(e.props)&&typeof e.props.ref=="string"&&t(e.props.ref,e);for(let r of Object.values(e))bc(r,t)}}function ym(e,t){let r=[],i=new Set([t]),o=a=>{let s=Object.prototype.hasOwnProperty.call(e,a)?e[a]:void 0;s&&bc([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 dg(e,t,r){if(e.default!==void 0)return gm(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)=>dg(o,`${t} ${s+1}`,r))}case"object":return fg(e.properties??{},r);case"component":return r==="docx"?{name:"paragraph",props:{text:t}}:{name:"text",props:{text:t}};default:return t}}function fg(e,t){return Object.fromEntries(Object.entries(e).filter(([,r])=>r.required&&r.default===void 0||r.role).map(([r,i])=>[r,dg(i,r,t)]))}function hg(e,t,r){let i;if(V(r.document)){let o=Object.fromEntries(Object.entries(r.document).filter(([a])=>a!=="props"));bc(o,(a,s)=>{if(i||a!==e)return;let c=s.props;i={name:"block",props:{ref:a,...V(c.slots)&&{slots:gm(c.slots)}}}})}return i??{name:"block",props:{ref:e,slots:fg(t.slots,r.format)}}}function LA(e,t){let r=Pr(e);return!T.Check(en,r)||xc(r,t.format).length>0?[]:Object.entries(r).map(([i,o])=>({name:i,format:t.format,template:t.template,definitionPointer:`/props/blocks/${fe(i)}`,description:o.description??"",definition:o,slotsSchema:hm(o),example:hg(i,o,{document:e,format:t.format}),dependencies:ym(r,i)}))}var NA=\'Slide templates were replaced by JSON blocks: define the shared slide content once in props.blocks and invoke it on each slide with { "name": "block", "props": { "ref": "<definition>" } }.\',RA={template:\'A slide no longer names a template: put { "name": "block", "props": { "ref": "<definition>" } } first among its children, with the definition in props.blocks.\',placeholders:\'Placeholders became block slots: fill them in the invocation as { "name": "block", "props": { "ref": "<definition>", "slots": { \\u2026 } } }.\',layout:"Slide layouts are not read: the block a slide invokes lays it out, from its definition in props.blocks."},kA=e=>typeof e=="object"&&e!==null&&!Array.isArray(e);function Xi(e,t,r){let i=Pr(e);return r.map(o=>{let a=FA(e,t,i,o);return a?{...o,suggestion:a}:o})}function FA(e,t,r,i){if(t==="pptx"){if(i.path==="/props/templates")return NA;let a=/^\\/children\\/\\d+\\/props\\/(template|placeholders|layout)$/.exec(i.path);if(a)return RA[a[1]]}if(i.code==="unknown_component"&&i.path.endsWith("/name")){let a=cr(e,i.path);return typeof a!="string"?void 0:Object.prototype.hasOwnProperty.call(r,a)?`"${a}" is a JSON block this document defines, not a component: invoke it as { "name": "block", "props": { "ref": "${a}", "slots": { \\u2026 } } }.`:`If "${a}" is a JSON block, copy its definition from jto://blocks into props.blocks and invoke it as { "name": "block", "props": { "ref": "${a}" } }; blocks are never components.`}let o=/^(.*)\\/props\\/name$/.exec(i.path);if(o){let a=cr(e,o[1]),s=cr(e,i.path);if(kA(a)&&a.name==="block"&&typeof s=="string")return`A block invocation names its definition with ref: { "name": "block", "props": { "ref": "${s}" } }.`}}var gg=["docx","pptx"],im=n.String({pattern:"^[a-z][a-z0-9]*(-[a-z0-9]+)*$",description:"Kebab-case identifier."}),yg=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."}),bg=n.Object({description:n.String({minLength:1}),whenToUse:n.String({minLength:1}),pages:yg,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}),bm=n.Object({id:im,format:n.Union(gg.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:im,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(im,bg,{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 Og(e){let t=[...T.Errors(bm,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 jA(e){return T.Check(bm,e)}function UA(e,t){let r={};for(let i of t){let o=Og(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 _A=/^\\{\\{\\s*([\\s\\S]*?)\\s*\\}\\}$/;function xg(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 DA(e,t,r){let{id:i,variant:o}=xg(e,r.format,t.variant),a=structuredClone(t.children??o.children),s=Sg(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:MA(p,s,r),variant:i}}function Sg(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[...ym(t,s),s])a[c]??(a[c]=structuredClone(t[c]))}return a}function MA(e,t,r){let i=`${r.metadataPointer}/`;return r.markers(e).map(o=>{let a=o.text.match(_A)?.[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=Ig(e,o.path,t);return c?{...s,kind:"slot",...c}:{...s,kind:"text"}})}function Ig(e,t,r){let i=t.lastIndexOf("/props/slots/");if(i<0)return;let a=Cg(e,t.slice(0,i))?.props?.ref;if(typeof a!="string"||!r[a])return;let s=t.slice(i+13).split("/").map(wg),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 wg(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function Cg(e,t){if(t==="")return e;let r=e;for(let i of t.split("/").slice(1).map(wg))if(Array.isArray(r))r=r[Number(i)];else if(r&&typeof r=="object")r=r[i];else return;return r}var BA=[{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."}],VA="Would you send this to a client, unchanged, with your name on it?",KA="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 uc(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function Tg(e,t){let r={...e};return uc(e)&&uc(t)&&Object.keys(t).forEach(i=>{uc(t[i])?!(i in e)||!uc(e[i])?r[i]=t[i]:r[i]=Tg(e[i],t[i]):r[i]=t[i]}),r}function GA(e,t){return Tg(t,e)}function Pg(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 qA="W_HIGHCHARTS_REMOTE_EXPORT";function WA(e,t){if(!Pg(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 HA=3e4,zA=2,JA=250,YA=2e3;function QA(e,t,r){let i=(e||t||r).trim();return(/^https?:\\/\\//i.test(i)?i:`http://${i}`).replace(/\\/+$/,"")}var Om="SERVICE_UNAVAILABLE";function Bh(e){return Object.assign(new Error(e),{code:Om})}function XA(e){let{code:t,status:r}=e;return t===Om?!0:r===429||r!==void 0&&r>=500}function ZA(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 ev(e,t){let r=Math.min(t*2**(e-1),YA);return Math.round(r*(.5+Math.random()*.5))}function Vh(e,t,r){if(e?.name==="AbortError")return Bh(`${t.serviceLabel} timed out after ${r}ms at ${t.url}.`);let i=e instanceof Error?e.message:String(e);return Bh(t.onUnreachable(t.url,i))}async function tv(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 Vh(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 Vh(a,e,i)}}async function rv(e,t,r){let i=new AbortController,o=setTimeout(()=>i.abort(),r);try{return await tv(e,t,i.signal,r)}finally{clearTimeout(o)}}async function nv(e){let r={"Content-Type":"application/json",...typeof e.headers=="function"?await e.headers(e.body):e.headers},i=e.timeoutMs??HA,o=e.retryBaseDelayMs??JA,a=1+Math.max(0,e.retries??zA);for(let s=1;;s++)try{return await rv(e,r,i)}catch(c){let l=c;if(s>=a||!XA(l))throw s===1?l:ZA(l,s);e.onRetry?.(s,l),await new Promise(p=>setTimeout(p,ev(s,o)))}}function Eg(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 $g=4,Tr={collected:0,unique:0,retries:0,maxInFlight:0},om=0;function iv(){return{...Tr}}function ov(){Tr.collected=0,Tr.unique=0,Tr.retries=0,Tr.maxInFlight=0}function av(){Tr.collected++}function sv(){Tr.retries++}var lm=new Map;function cv(e,t){let r=lm.get(e);if(r)return r;let i=Math.max(1,Math.floor(Number.isFinite(t)?t:$g)),o=Eg(i);return lm.set(e,o),o}function lv(e,t,r){return cv(e,t)(r)}function pv(e,t){return`${e}\n${JSON.stringify(t)}`}function mv(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 uv(e){return mv(e.cache,pv(e.serverUrl,e.requestBody),()=>lv(e.serverUrl,e.concurrency,()=>dv(e.send)))}async function dv(e){Tr.unique++,om++,Tr.maxInFlight=Math.max(Tr.maxInFlight,om);try{return await e()}finally{om--}}function fv(){lm.clear()}var Sm={};nt(Sm,{ComponentValidationError:()=>bi,DuplicateComponentError:()=>qi,UnknownPreservedComponentError:()=>Qs,createComponent:()=>Gi,createVersion:()=>Ki,getValidationSummary:()=>Zs,isValidationSuccess:()=>Xs,resolveComponentVersion:()=>yi,validateAgainstSchema:()=>Rp,validateCustomComponentProps:()=>kn});var Ru={};nt(Ru,{AlignmentSchema:()=>rn,BASE_SCHEMA_METADATA:()=>gy,BUILT_IN_DOCX_THEME_NAMES:()=>Xa,BaseComponentPropsSchema:()=>Rg,BlockInvocationPropsSchema:()=>Dn,BorderSchema:()=>Lg,COMPONENT_METADATA:()=>hy,ChartPropsSchema:()=>ou,ColumnsPropsSchema:()=>dn,CommentReplySchema:()=>Hm,CommentSchema:()=>oo,ComponentDefinitionSchema:()=>ft,CustomComponentDefinitionSchema:()=>$r,DEFAULT_DOCX_RENDERER_ID:()=>Qa,DEFAULT_ERROR_CONFIG:()=>vn,DOCX_RENDERER_IDS:()=>Er,DividerPropsSchema:()=>nu,ERROR_EMOJIS:()=>fi,ERROR_TEMPLATES:()=>ky,EndnotesSchema:()=>Jm,FLOW_CHILDREN:()=>hn,FootnotesSchema:()=>zm,GenerateDocumentRequestSchema:()=>Xy,GenerateDocumentResponseSchema:()=>eb,GroupPropsSchema:()=>eu,HeadingLevelSchema:()=>Ic,HeadingPropsSchema:()=>sn,HighchartsPropsSchema:()=>iu,ImagePropsSchema:()=>ln,IndentSchema:()=>Mn,JSON_SCHEMA_URLS:()=>nb,JsonComponentDefinitionSchema:()=>rb,JsonDocumentParser:()=>Lu,JsonParsingError:()=>fo,JsonValidationError:()=>ho,JustifiedAlignmentSchema:()=>Da,LineSpacingSchema:()=>Ma,ListMarkerFontSchema:()=>Xm,ListPropsSchema:()=>fn,MarginsSchema:()=>vg,NATIVE_RENDER_MODE:()=>Rc,NATIVE_VISUAL_ELEMENT_NAMES:()=>Kg,NativeVisualCanvasSchema:()=>Um,NativeVisualElementSchema:()=>jm,NativeVisualImagePropsSchema:()=>Fm,NativeVisualShapePropsSchema:()=>km,NativeVisualTextPropsSchema:()=>Rm,NoteSchema:()=>Uc,NumberingSchema:()=>Ng,ParagraphIndentSchema:()=>Ba,ParagraphPropsSchema:()=>cn,ReportPropsSchema:()=>gn,RevisionMarkSchema:()=>Wm,RevisionSchema:()=>io,RevisionSegmentSchema:()=>qm,SHARED_DOCX_VERSION:()=>NN,STANDARD_COMPONENTS:()=>ub,STANDARD_COMPONENTS_REGISTRY:()=>Tt,STANDARD_COMPONENTS_SET:()=>yN,SectionPropsSchema:()=>un,SpacingSchema:()=>Ct,StandardComponentDefinitionSchema:()=>Kc,StatisticPropsSchema:()=>pn,THEME_SCHEMA_METADATA:()=>yy,TabStopLeaderSchema:()=>Pm,TabStopSchema:()=>Em,TabStopTypeSchema:()=>Tm,TabStopsSchema:()=>wc,TablePropsSchema:()=>mn,TextBoxPropsSchema:()=>tu,TextSpaceAfterComponentSchema:()=>su,TextSpaceAfterPropsSchema:()=>au,ThemeConfigSchema:()=>so,ThemeOverridesSchema:()=>Mc,TocPropsSchema:()=>ru,ValidateDocumentRequestSchema:()=>Zy,ValidateDocumentResponseSchema:()=>tb,VisualCanvasBackgroundSchema:()=>_m,VisualCanvasSchema:()=>Dm,VisualNativePropsSchema:()=>Bm,VisualPropsSchema:()=>Nc,VisualRasterPropsSchema:()=>Mm,calculatePosition:()=>Vi,clearComponentNamesCache:()=>Ca,collectDocxRendererErrors:()=>jc,collectIndentConflicts:()=>fu,collectNoteRevisionConflicts:()=>hu,collectTextBoxShapeConflicts:()=>gu,compareSemver:()=>gi,componentValidator:()=>po,comprehensiveValidateDocument:()=>bu,convertDocxToJsonSchema:()=>uy,convertToJsonSchema:()=>uy,createComponentSchema:()=>Wi,createComponentValidator:()=>Qc,createDocumentValidator:()=>Wc,createDocxComponentSchema:()=>dy,createErrorConfig:()=>wr,createJsonParseError:()=>hi,createJsonValidator:()=>Ty,createMinimalTheme:()=>cy,createThemeValidator:()=>Yc,createValidatedComponent:()=>hN,createValidator:()=>Cy,deepValidateDocument:()=>yu,diffDocuments:()=>tN,diffWords:()=>il,documentValidator:()=>lo,docxComponentDefinitionName:()=>an,docxDocumentBlockTargets:()=>Hg,docxFlowDefinitionName:()=>kc,exportDocxSchemaToFile:()=>fy,exportSchemaToFile:()=>Hi,extractStandardComponentNames:()=>di,fixDocxSchemaReferences:()=>Vc,fixSchemaReferences:()=>Fn,formatErrorMessage:()=>Sr,formatErrorReport:()=>os,formatErrorSummary:()=>Xr,formatValidationError:()=>mN,formatValidationErrorStrings:()=>uN,formatValidationErrors:()=>iN,generateUnifiedDocumentSchema:()=>by,getAllStandardComponentNames:()=>ly,getErrorSummary:()=>mb,getLiteralValue:()=>It,getObjectSchemaPropertyNames:()=>Ir,getSchemaMetadata:()=>Ta,getStandardComponent:()=>Za,getThemeName:()=>Uy,getValidationContext:()=>pN,getValidationErrors:()=>sN,getValidationSummary:()=>Ey,groupErrorsByPath:()=>Pa,hasCriticalErrors:()=>as,isColumnsComponent:()=>xN,isColumnsProps:()=>Gy,isCustomComponentProps:()=>Jy,isHeadingComponent:()=>SN,isHeadingProps:()=>Vy,isHighchartsComponent:()=>AN,isImageComponent:()=>wN,isImageProps:()=>qy,isListComponent:()=>EN,isListProps:()=>zy,isLiteralSchema:()=>Qr,isNativeVisualProps:()=>qg,isObjectSchema:()=>qt,isParagraphComponent:()=>IN,isParagraphProps:()=>Ky,isReportComponent:()=>bN,isReportProps:()=>My,isSectionComponent:()=>ON,isSectionProps:()=>By,isStandardComponentName:()=>uo,isStatisticComponent:()=>TN,isStatisticProps:()=>Wy,isTableComponent:()=>PN,isTableProps:()=>Hy,isTextBoxComponent:()=>CN,isTextSpaceAfterComponent:()=>LN,isThemeConfig:()=>_y,isTocComponent:()=>$N,isUnionSchema:()=>wa,isValidComponent:()=>gN,isValidDocument:()=>vy,isValidSemver:()=>Rn,isValidTheme:()=>jy,isValidThemeConfig:()=>sy,isValidThemeJson:()=>jy,isValidationSuccess:()=>Py,isVisualComponent:()=>vN,latestVersion:()=>dt,parseJsonComponent:()=>rN,parseJsonWithLineNumbers:()=>nN,parseSemver:()=>Nn,safeValidateComponentDefinition:()=>aN,safeValidateComponentProps:()=>oN,sharedCreateComponentSchemaObject:()=>nc,strictComponentValidator:()=>zc,strictDocumentValidator:()=>es,strictThemeValidator:()=>Hc,stripMarkdown:()=>ns,themeValidator:()=>ts,transformAndValidate:()=>fN,transformDocxValueError:()=>uu,transformDocxValueErrors:()=>du,transformValueError:()=>Ln,transformValueErrors:()=>tt,validate:()=>Yy,validateAgainstSchema:()=>Pt,validateBatch:()=>Iy,validateComponent:()=>sl,validateComponentDefinition:()=>Nu,validateComponentProps:()=>mo,validateComponents:()=>dN,validateCustomComponentProps:()=>Iu,validateDocument:()=>Gc,validateDocumentWithSchema:()=>Ry,validateJson:()=>co,validateJsonComponent:()=>qc,validateJsonComponentDoc:()=>Ny,validateJsonDocument:()=>qc,validateStrict:()=>Qy,validateTheme:()=>Jc,validateThemeJson:()=>Ou,validateThemeWithEnhancement:()=>xu,validateWithEnhancement:()=>wy});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\'}),Im=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"\'}),wm=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"]}),Cm=n.Boolean({description:"Disable spell/grammar checking for this text (e.g. code snippets or identifiers)"}),_a=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"]]}),Sc=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}),tn=n.Object({family:Ht,...Sc.properties},{description:"Font definition with family and optional formatting properties",additionalProperties:!1});var rn=n.Union([n.Literal("left"),n.Literal("center"),n.Literal("right")],{description:"Text alignment options"}),Da=n.Union([n.Literal("left"),n.Literal("center"),n.Literal("right"),n.Literal("justify")],{description:"Text alignment options including justify"}),Ic=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}),Ag=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}),vg=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}),Lg=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}),Ma=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}),Ba=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}),Tm=n.Union([n.Literal("left"),n.Literal("right"),n.Literal("center"),n.Literal("decimal"),n.Literal("bar")],{description:"Tab stop alignment type"}),Pm=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"}),Em=n.Object({type:Tm,position:n.Number({minimum:0,description:"Tab stop position in twips (1/20 of a point)"}),leader:n.Optional(Pm)},{description:"Tab stop definition (w:tab in w:tabs)",additionalProperties:!1});var wc=n.Array(Em,{description:"Tab stops for the paragraph. Tab characters (\\\\t) in the text jump to these positions."}),hv=n.Union([n.Literal("character"),n.Literal("column"),n.Literal("margin"),n.Literal("page"),n.Literal("text")],{description:"Horizontal position relative to"}),gv=n.Union([n.Literal("margin"),n.Literal("page"),n.Literal("paragraph"),n.Literal("line"),n.Literal("text")],{description:"Vertical position relative to"}),yv=n.Union([n.Literal("left"),n.Literal("center"),n.Literal("right"),n.Literal("inside"),n.Literal("outside")],{description:"Horizontal alignment"}),bv=n.Union([n.Literal("top"),n.Literal("center"),n.Literal("bottom"),n.Literal("inside"),n.Literal("outside")],{description:"Vertical alignment"}),Ov=n.Union([n.Literal("none"),n.Literal("square"),n.Literal("topAndBottom"),n.Literal("around"),n.Literal("tight"),n.Literal("through")],{description:"Text wrapping type"}),xv=n.Union([n.Literal("bothSides"),n.Literal("left"),n.Literal("right"),n.Literal("largest")],{description:"Text wrapping side"}),wi=n.Object({horizontalPosition:n.Optional(n.Object({relative:n.Optional(hv),align:n.Optional(yv),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(gv),align:n.Optional(bv),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:Ov,side:n.Optional(xv),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}),Ng=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}),Sv={},Rg=n.Object(Sv,{description:"Base component props",additionalProperties:!0});var Iv=n.String({pattern:"^#?[0-9A-Fa-f]{6}$",description:"Hex color (e.g. #FF0000)"}),Tc=["primary","secondary","accent","background","text","text2","background2","accent4","accent5","accent6"],Pc=["accent1","accent2","accent3","tx1","tx2","bg1","bg2"],Bn=n.Union([Iv,...Tc.map(e=>n.Literal(e)),...Pc.map(e=>n.Literal(e))],{description:"Hex color or semantic theme color name"}),eo=["title","subtitle","heading1","heading2","heading3","body","caption",...zi],Va=n.Union(eo.map(e=>n.Literal(e)),{description:"Predefined style name"}),Ka=n.Union([n.Literal("left"),n.Literal("center"),n.Literal("right")],{description:"Horizontal alignment options"}),Ci=n.Union([n.Literal("top"),n.Literal("middle"),n.Literal("bottom")],{description:"Vertical alignment options"}),to=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}),on=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"}),Ec=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}),Ga=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(Ec,{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(Ka),valign:n.Optional(Ci),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(to),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(on),style:n.Optional(Va)},{description:"Text component props",additionalProperties:!1}),qa=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(to),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(on)},{description:"PPTX image component props",additionalProperties:!1}),ro=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"}),Fg=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}),$c=["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"],Ac=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"}),no=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(Ac,{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"}),vc=n.Object({preset:n.Union($c.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"}),Wa=n.Object({type:ro,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(no),pattern:n.Optional(vc)},{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(Fg,{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(Ka),valign:n.Optional(Ci),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(to),rectRadius:n.Optional(n.Number({minimum:0,description:"Corner radius for roundRect shape in inches"})),grid:n.Optional(on),style:n.Optional(Va)},{description:"Shape component props",additionalProperties:!1}),wv=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(Ka),valign:n.Optional(Ci),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})]),Ha=n.Object({rows:n.Array(n.Array(wv,{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(Ka),valign:n.Optional(Ci),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(on)},{description:"PPTX table component props",additionalProperties:!1}),za=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(on)},{description:"PPTX Highcharts component props",additionalProperties:!1}),Cc=(e,t)=>n.Union([n.Number({description:e}),n.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:t})]),Cv=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"}),Tv=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}),kg=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"}),Ja=n.Object({type:Cv,data:n.Array(Tv,{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(kg),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(kg),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(Cc("X position in inches","X as percentage")),y:n.Optional(Cc("Y position in inches","Y as percentage")),w:n.Optional(Cc("Width in inches","Width as percentage")),h:n.Optional(Cc("Height in inches","Height as percentage")),grid:n.Optional(on)},{description:"Native PowerPoint chart component props",additionalProperties:!1});function Ti(e){if(e.propsRequired!==void 0)return e.propsRequired;let t=e.propsSchema;return t.type!=="object"||(t.required?.length??0)>0}var nn=[{name:"text",propsSchema:Ga,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:qa,hasChildren:!1,category:"content",propsRequired:!0,description:"Image element - displays images from file path, URL, or base64 data."},{name:"shape",propsSchema:Wa,hasChildren:!1,category:"content",description:"Shape element - draws geometric shapes with optional text, fill, and line styling."},{name:"table",propsSchema:Ha,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:za,hasChildren:!1,category:"content",description:"Highcharts element - renders charts via Highcharts Export Server."},{name:"chart",propsSchema:Ja,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 Zi(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:Ti(e)?e.propsSchema:n.Optional(e.propsSchema)},{additionalProperties:!1,description:e.description})}var Ya=n.Union([Zi(nn[0]),Zi(nn[1]),Zi(nn[2]),Zi(nn[3]),Zi(nn[4]),Zi(nn[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")\'}),Pv="^-?\\\\d+(\\\\.\\\\d+)?%$",Ev="^\\\\d+(\\\\.\\\\d+)?%$",jg=n.Union([n.Number({description:"Inches from the canvas origin"}),n.String({pattern:Pv,description:\'Percentage of the canvas extent on this axis, e.g. "25%"\'})],{description:"Position in inches (number) or as a canvas percentage"}),Ug=n.Union([n.Number({minimum:0,description:"Size in inches"}),n.String({pattern:Ev,description:\'Percentage of the canvas extent on this axis, e.g. "50%"\'})],{description:"Size in inches (number) or as a canvas percentage"}),Nm={x:n.Optional(jg),y:n.Optional(jg),w:n.Optional(Ug),h:n.Optional(Ug),rotate:n.Optional(n.Number({description:"Clockwise rotation in degrees"}))},_g=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"}),Lc={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())},$v=n.Object({text:n.String({description:"Run text"}),color:n.Optional(Vn),...Lc,underline:n.Optional(_g),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"}),Av=n.Object({text:n.String({description:"Segment text"}),color:n.Optional(Vn),...Lc,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"}),Dg=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."}),vv=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"}),Mg=n.Union([n.Literal("left"),n.Literal("center"),n.Literal("right"),n.Literal("justify")],{description:"Horizontal text alignment"}),Bg=n.Union([n.Literal("top"),n.Literal("middle"),n.Literal("bottom")],{description:"Vertical text anchoring inside the box"}),Vg=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"}),Rm=n.Object({text:n.Optional(n.String({description:"Plain text content"})),runs:n.Optional(n.Array($v,{minItems:1,description:\'Formatted runs, as an alternative to "text"\'})),...Nm,color:n.Optional(Vn),...Lc,underline:n.Optional(_g),strike:n.Optional(n.Boolean({description:"Strikethrough"})),align:n.Optional(Mg),valign:n.Optional(Bg),margin:n.Optional(Vg),fill:n.Optional(Dg)},{additionalProperties:!1,description:"Native visual text element \\u2014 becomes a Word text box (wps:wsp) inside the drawing group"}),km=n.Object({type:ro,...Nm,fill:n.Optional(Dg),line:n.Optional(vv),text:n.Optional(n.Union([n.String(),n.Array(Av,{minItems:1})],{description:"Text drawn inside the shape"})),...Lc,fontColor:n.Optional(Vn),align:n.Optional(Mg),valign:n.Optional(Bg),margin:n.Optional(Vg),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"}),Fm=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"})),...Nm,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"}),Kg=["text","shape","image"];function $m(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 jm=n.Union([$m("text",Rm,"Text element - a native Word text box drawn on the visual canvas."),$m("shape",km,"Shape element - a native preset-geometry shape, optionally holding text."),$m("image",Fm,"Image element - a native picture; an SVG stays vector.")],{$id:"DocxNativeVisualContent",discriminator:{propertyName:"name"},description:"A single native visual element (text, shape, or image)."}),Um=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"}),_m=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}),Dm=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(_m)},{description:"pptx canvas definition for the visual",additionalProperties:!1}),Gg={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(rn),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(wi),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"}))},Mm=n.Object({renderMode:n.Optional(n.Literal("raster",{description:"Render as a rasterized pptx slide (the default when omitted)."})),canvas:Dm,elements:n.Optional(n.Array(Ya,{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:Fa,maximum:ja,default:ka,description:`Raster resolution in DPI (default ${ka}, range ${Fa}-${ja}). Higher = sharper + larger.`})),serverUrl:n.Optional(n.String({description:"Rasterization service URL override (default from services.pptx)"})),...Gg},{$id:"DocxVisualRasterProps",description:"Visual component props (pptx-rendered graphic)",additionalProperties:!1}),Bm=n.Object({renderMode:n.Literal("native",{description:\'Draw natively as a Word DrawingML group. Requires the "office-open" renderer.\'}),canvas:Um,elements:n.Optional(n.Array(jm,{description:"Native drawing elements (text, shape, image), positioned with x/y/w/h in inches or canvas percentages"})),...Gg},{$id:"DocxVisualNativeProps",description:\'Visual component props (native Word drawing group; requires renderer "office-open")\',additionalProperties:!1}),Nc=n.Union([Mm,Bm],{description:"Visual component props \\u2014 rasterized pptx slide (default) or a native Word drawing group"}),Rc="native";function qg(e){return!!e&&e.renderMode===Rc}var Er=["docxjs","office-open"],Qa="docxjs",Lv=new Set(["text","shape","image"]);function an(e){return`ComponentDefinition_${e}`}function kc(e){return e?`FlowContent_${e}`:"FlowContent"}function Fc(e,t,r){let i=Lm(t);return vm(i,an(r)),e==="visual"&&r!=="office-open"?Rv(i)??i:(r==="office-open"&&Am(i),i)}function jc(e){if(!e||typeof e!="object"||Array.isArray(e))return[];let t=e,r=t.renderer??Qa;if(!Er.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"&&Nv(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 Nv(e,t,r,i){let o=e.props;if(!o||typeof o!="object"||Array.isArray(o))return;let a=o;if(a.renderMode!==Rc)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"||Lv.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 Rv(e){let t=e.anyOf;return Array.isArray(t)&&t.length>0?t[0]:void 0}function Am(e){if(Array.isArray(e)){e.forEach(Am);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))Am(t[i])}function vm(e,t){if(Array.isArray(e)){e.forEach(i=>vm(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))vm(r[i],t)}function Lm(e){if(Array.isArray(e))return e.map(Lm);if(!e||typeof e!="object")return e;let t=Object.create(Object.getPrototypeOf(e));for(let r of Reflect.ownKeys(e))t[r]=Lm(e[r]);return t}function Wg(e){let t=e.definitions??{},r=new Map;for(let o of Er){let a=an(o);t[a]&&r.set(o,Ua(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 Hg(e){let t=e.definitions??{};return Er.filter(r=>t[an(r)]).map(r=>{let i=an(r);return{name:i,componentRef:{$ref:`#/definitions/${i}`}}})}var qm=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}),io=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(qm,{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}),Wm=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}),Jg={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"}))},Hm=n.Object(Jg,{description:"A reply within a comment thread",additionalProperties:!1}),oo=n.Object({...Jg,replies:n.Optional(n.Array(Hm,{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}),sn=n.Object({text:n.String({description:"Heading text (required)"}),level:n.Optional(Ic),font:n.Optional(n.Partial(tn)),language:n.Optional(wm),noProof:n.Optional(Cm),noProofWords:n.Optional(_a),alignment:n.Optional(Da),spacing:n.Optional(Ct),indent:n.Optional(Ba),lineSpacing:n.Optional(n.Union([n.Number({minimum:0}),Ma],{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(io),comment:n.Optional(oo)},{description:"Heading component props",additionalProperties:!1}),Uc=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}),zm=n.Array(Uc,{description:"Footnote bodies for `[^id]` markers in this paragraph, placed at the foot of the page. An unreferenced body is not emitted.",minItems:1}),Jm=n.Array(Uc,{description:"Endnote bodies for `[^id]` markers in this paragraph, collected at the end of the document. An unreferenced body is not emitted.",minItems:1}),kv=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"}),zg=n.Union([n.Literal("margin"),n.Literal("page"),n.Literal("text")],{description:"Frame anchor type"}),Fv=n.Union([n.Literal("left"),n.Literal("center"),n.Literal("right"),n.Literal("inside"),n.Literal("outside")],{description:"Frame horizontal alignment"}),jv=n.Union([n.Literal("top"),n.Literal("center"),n.Literal("bottom"),n.Literal("inside"),n.Literal("outside")],{description:"Frame vertical alignment"}),Uv=n.Object({horizontalPosition:n.Optional(n.Object({relative:n.Optional(zg),align:n.Optional(Fv),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(zg),align:n.Optional(jv),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:kv},{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"}),cn=n.Object({text:n.String({description:"Text content (required)"}),font:n.Optional(n.Partial(tn)),themeStyle:n.Optional(n.String()),language:n.Optional(wm),noProof:n.Optional(Cm),noProofWords:n.Optional(_a),boldColor:n.Optional(Q),spacing:n.Optional(Ct),alignment:n.Optional(_v),indent:n.Optional(Ba),tabStops:n.Optional(wc),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(Uv),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(io),comment:n.Optional(oo),footnotes:n.Optional(zm),endnotes:n.Optional(Jm)},{description:"Paragraph component props (font nested for theme consistency; no flat font properties)",additionalProperties:!1}),ln=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(rn),caption:n.Optional(n.String({description:"Image caption (supports rich text with **bold**, *italic*, ***both***)"})),spacing:n.Optional(Ct),floating:n.Optional(wi),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}),pn=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(rn),spacing:n.Optional(Ct),size:n.Optional(n.Union([n.Literal("small"),n.Literal("medium"),n.Literal("large")]))},{description:"Statistic component props",additionalProperties:!1}),Dv=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})])),Yg=n.Union([n.Literal("left"),n.Literal("center"),n.Literal("right"),n.Literal("justify")],{description:"Horizontal text alignment"}),Qg=n.Union([n.Literal("top"),n.Literal("middle"),n.Literal("bottom")],{description:"Vertical cell alignment"}),Xg=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({...Ma.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}),Km=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})]),Gm=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})]),Mv=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})]),Zg=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})]),Vm=n.Object({color:n.Optional(Q),backgroundColor:n.Optional(Im),horizontalAlignment:n.Optional(Yg),verticalAlignment:n.Optional(Qg),font:n.Optional(Xg),borderColor:n.Optional(Km),borderSize:n.Optional(Gm),padding:n.Optional(Zg),height:n.Optional(n.Number({minimum:0,description:"Cell height in points"}))},{additionalProperties:!1});function Ym(e){let t=n.Union([n.String(),e]),r={color:n.Optional(Q),backgroundColor:n.Optional(Im),horizontalAlignment:n.Optional(Yg),verticalAlignment:n.Optional(Qg),font:n.Optional(Xg),borderColor:n.Optional(Km),borderSize:n.Optional(Gm),padding:n.Optional(Zg),height:n.Optional(n.Number({minimum:0,description:"Cell height in points"})),comment:n.Optional(oo),revision:n.Optional(io)},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(Vm),header:n.Optional(i),cells:n.Optional(n.Array(o))},{additionalProperties:!1});return n.Object({borderColor:n.Optional(Km),borderSize:n.Optional(Gm),hideBorders:n.Optional(Mv),cellDefaults:n.Optional(Vm),headerCellDefaults:n.Optional(Vm),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(Wm),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 mn=Ym(Dv),Qm=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}),un=Qm(),Bv=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}),dn=n.Object({columns:n.Union([n.Number({minimum:1,description:"Number of equal-width columns (converter will normalize to array)"}),n.Array(Bv,{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}),ey=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"}),Xm=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}),Vv=n.Object({level:n.Number({minimum:0,maximum:8,description:"Nesting level (0 = root, 1 = first sublevel, etc.)"}),format:n.Optional(ey),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(Xm)},{description:"Configuration for a single list level",additionalProperties:!1}),fn=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(io)},{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(Vv,{description:"Configuration for each nesting level",minItems:1,maxItems:9})),format:n.Optional(n.Union([ey,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(tn)),spacing:n.Optional(Ag),alignment:n.Optional(Da),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(oo)},{description:"List component props",additionalProperties:!1}),Zm=["revision","comment","footnotes","endnotes"],Kv=n.Partial(n.Omit(sn,Zm)),Gv=n.Partial(n.Omit(cn,Zm)),qv=n.Partial(ln),Wv=n.Partial(pn),Hv=n.Partial(n.Omit(mn,["rows"])),zv=n.Partial(un),Jv=n.Partial(dn),Yv=n.Partial(n.Omit(fn,Zm)),_c=n.Object({heading:n.Optional(Kv),paragraph:n.Optional(Gv),image:n.Optional(qv),statistic:n.Optional(Wv),table:n.Optional(Hv),section:n.Optional(zv),columns:n.Optional(Jv),list:n.Optional(Yv)},{additionalProperties:!0});var Xa=["consulting","devportal","minimal","vermilion"],Qv=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"}),IH=n.Object({width:n.Number({minimum:0}),height:n.Number({minimum:0})},{additionalProperties:!1,description:"Page dimensions in twips"}),Xv=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:Qv},{description:"Page configuration including dimensions and margins",additionalProperties:!1}),ty=n.Object({heading:tn,body:tn,mono:tn,light:tn},{additionalProperties:!1,description:"Font definitions for different text types"}),Zv=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"}),ry={style:Zv,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"}))},Dc=n.Object(ry,{additionalProperties:!1,description:"Paragraph border side definition"}),eL=n.Object(ry,{additionalProperties:!1,description:"Rule drawn between consecutive paragraphs sharing this border set (w:between), in place of their adjoining bottom and top edges"}),ny=n.Object({top:n.Optional(Dc),bottom:n.Optional(Dc),left:n.Optional(Dc),right:n.Optional(Dc),between:n.Optional(eL)},{additionalProperties:!1,description:"Paragraph borders (per side, plus the between-paragraph rule)"}),iy=n.Optional(n.Union([n.Literal("left"),n.Literal("center"),n.Literal("right"),n.Literal("justify")])),lr=n.Object({font:n.Optional(n.Union([n.Literal("heading"),n.Literal("body"),n.Literal("mono"),n.Literal("light")])),...Sc.properties,alignment:iy,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(ny),indent:n.Optional(Mn)},{additionalProperties:!1}),tL=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"}),rL=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"}),nL=n.Object({type:rL,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(tL)},{description:"Tab stop configuration with position, alignment, and optional leader",additionalProperties:!1}),ao=n.Object({font:n.Optional(n.Union([n.Literal("heading"),n.Literal("body"),n.Literal("mono"),n.Literal("light")])),...Sc.properties,alignment:iy,tabStops:n.Optional(n.Array(nL,{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(ny),indent:n.Optional(Mn)},{additionalProperties:!1}),oy=n.Object({normal:n.Optional(lr),heading1:n.Optional(lr),heading2:n.Optional(lr),heading3:n.Optional(lr),heading4:n.Optional(lr),heading5:n.Optional(lr),heading6:n.Optional(lr),title:n.Optional(lr),subtitle:n.Optional(lr),TOC1:n.Optional(ao),TOC2:n.Optional(ao),TOC3:n.Optional(ao),TOC4:n.Optional(ao),TOC5:n.Optional(ao),TOC6:n.Optional(ao)},{additionalProperties:lr,description:"Style definitions supporting predefined styles (normal, heading1..6, title, subtitle), TOC entry styles (TOC1..TOC6), and arbitrary custom styles."}),wH=n.Object({level:n.Union([n.Literal(1),n.Literal(2),n.Literal(3),n.Literal(4),n.Literal(5),n.Literal(6)]),...lr.properties},{additionalProperties:!1}),ay=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}),Mc=n.Object({...Un,colors:n.Optional(n.Partial(ay)),fonts:n.Optional(n.Partial(ty)),styles:n.Optional(oy)},{additionalProperties:!1,description:"Partial theme deep-merged over the resolved named theme: define or override palette tokens, font roles, and named styles in-document."}),so=n.Object({...Un,$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:ay,fonts:ty,fontRegistry:n.Optional(Cr),page:Xv,styles:n.Optional(oy),componentDefaults:n.Optional(_c),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 sy(e){return T.Check(so,e)}function cy(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 eu=n.Object({},{additionalProperties:!1}),iL=e=>n.Object({blocks:n.Optional(en),theme:n.Optional(n.String({description:`Theme name to apply (default: "consulting"). Built-ins: ${Xa.join(", ")} (consulting is the house style).`,examples:[...Xa],default:"consulting"})),themeOverrides:n.Optional(Mc),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(Cr),componentDefaults:n.Optional(_c),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(_a),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}),gn=iL(),tu=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(wi),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"]}}}]))}}}}}}]}),oL=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"}),aL=n.Union([n.Literal("document"),n.Literal("section")],{description:"TOC scope: document-wide or section-only"}),sL=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}),ru=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(oL),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([aL,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(sL,{description:"Custom style mappings for TOC entries. Maps custom theme styles to TOC levels."}))},{description:"Table of Contents component props",additionalProperties:!1}),nu=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}),iu=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%")\'}))}),cL=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"}),lL=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}),ou=n.Object({type:cL,data:n.Array(lL,{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(rn),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(wi),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}),hn=["block","group","heading","paragraph","image","statistic","table","list","toc","divider","highcharts","chart","visual","columns","text-box"],Tt=[{name:"docx",propsSchema:gn,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:un,createPropsSchema:Qm,embeddedComponents:[{path:["header"],arity:"component-array",reportStructure:!0},{path:["footer"],arity:"component-array",reportStructure:!0}],hasChildren:!0,allowedChildren:hn,category:"container",description:"Section container - groups related content with optional title. Use for organizing document structure."},{name:"columns",propsSchema:dn,hasChildren:!0,allowedChildren:hn.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:tu,hasChildren:!0,allowedChildren:hn,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:sn,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:cn,hasChildren:!1,category:"content",description:"Paragraph text - supports formatting like bold, italic, and color. Main content element."},{name:"image",propsSchema:ln,hasChildren:!1,category:"content",description:"Image element - displays images with optional caption. Supports various formats."},{name:"statistic",propsSchema:pn,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:eu,hasChildren:!0,allowedChildren:hn,category:"container",description:"Transparent group of flow components; also the inspectable result of block expansion."},{name:"table",propsSchema:mn,createPropsSchema:Ym,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:fn,hasChildren:!1,category:"content",description:"List element - bulleted or numbered list items. Supports nested lists."},{name:"toc",propsSchema:ru,hasChildren:!1,category:"content",description:"Table of contents - automatically generates TOC from document headings. Supports depth ranges and custom styles."},{name:"divider",propsSchema:nu,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:iu,hasChildren:!1,category:"content",description:"Chart component powered by Highcharts - render line, bar, pie, heatmap, and more with rich options."},{name:"chart",propsSchema:ou,hasChildren:!1,renderers:["office-open"],category:"content",description:\'Native Word chart - editable, scalable, no export server needed. Requires renderer "office-open".\'},{name:"visual",propsSchema:Nc,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 Za(e){return Tt.find(t=>t.name===e)}function ly(){return Tt.map(e=>e.name)}function py(){return Tt.filter(e=>e.hasChildren)}function pL(e){let t=e;return t.type!=="object"||(t.required?.length??0)>0}function Pi(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(Er.map(c=>n.Literal(c)),{description:\'Renderer backend. Omitted defaults to "docxjs".\'})));let a=e.createPropsSchema&&r?e.createPropsSchema(r):e.propsSchema,s=i?Fc(e.name,a,i.renderer):a;return o.props=pL(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 my(e){return Tt.map(t=>Pi(t,e))}function mL(e,t){let r=new Set(e);return e.length===r.size&&t.length===r.size&&t.every(i=>r.has(i))}function Bc(e,t=[],r){let i=u=>!r||!u.renderers||u.renderers.includes(r.renderer),o=Tt.filter(i),a=new Set(hn),s=new Map;for(let u of o)u.hasChildren||s.set(u.name,Pi(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,Pi(x,e,e,r)),O.splice(S,1);continue}if(mL(x.allowedChildren,hn)){s.set(x.name,Pi(x,f,e,r)),O.splice(S,1);continue}if(!x.allowedChildren.filter(be=>o.some(Le=>Le.name===be&&Le.hasChildren)).every(be=>s.has(be)))continue;let v=[...x.allowedChildren.map(be=>s.get(be)).filter(be=>be!==void 0),...t],D=v.length===1?v[0]:n.Union(v);s.set(x.name,Pi(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=hn.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:kc(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 Vc(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 uy(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),Vc(m),Wg(m),Ea(m),m}function dy(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(py().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 Vc(o,i),o.additionalProperties=!1,o}async function fy(e,t,r={}){let{prettyPrint:i=!0}=r,o=i?JSON.stringify(e,null,2):JSON.stringify(e);await(await Promise.resolve().then(()=>pd(_p(),1))).writeFile(t,o,"utf-8")}var hy={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"\'}},gy={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"}},yy={theme:{title:"Theme Configuration",description:"JSON theme configuration for document styling and appearance"}};function by(e={}){return n.Union(Er.map(t=>uL(e,t,t!==Qa)),{description:"Document definition, discriminated by the optional renderer field. Omitted renderer means docxjs."})}function uL(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=an(t),m=n.Recursive(f=>{let O=[];for(let I of o)if(I.versionedProps&&I.versionedProps.length>0){let v=I.versionedProps,D=dt(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 be=v.find(te=>te.version===D),Le={name:n.Literal(I.name),id:n.Optional(n.String()),props:be.propsSchema};be.hasChildren&&(Le.children=n.Optional(n.Array(f)));let He=be.description?`${I.name} (latest: v${D}) \\u2014 ${be.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?Bc(f,O,{renderer:t,requireDiscriminator:r}):{schemas:[],byName:new Map};c=["section",...Za("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=Za("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(Fc(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 Kc=n.Union([...my(n.Any())],{discriminator:{propertyName:"name"},description:"Standard component definition with discriminated union"}),ft=n.Recursive(e=>{let{roots:t,flow:r}=Bc(e);return n.Union([...t,r],{discriminator:{propertyName:"name"},description:"Component definition with discriminated union"})});var au=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")]))}),su=n.Object({name:n.Literal("text-space-after"),id:n.Optional(n.String()),props:au}),$r=su;function dL(e,t){let r=String(e.type||""),i=e.path||"root";return r==="62"||r==="union"?fL(e):e.message?.includes("additionalProperties")?hL(e):e.message?.includes("Required property")?gL(e):r==="string"||r==="number"||r==="boolean"||r==="array"||r==="object"?yL(e):r==="literal"?bL(e):r==="pattern"||r==="RegExp"?OL(e):`At ${i}: ${e.message}`}function fL(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 hL(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=Ir(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 gL(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 yL(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 bL(e){let t=e.path||"root",r=e.schema?JSON.stringify(It(e.schema)):"specific value",i=JSON.stringify(e.value);return`Invalid value at ${t}: Expected exactly ${r} but got ${i}`}function OL(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 uu(e,t,r){let i=wr(r),o=dL(e,i),a={path:e.path||"root",message:Sr(o||e.message,i),code:String(e.type||"validation_error"),value:e.value};if(i.includeSuggestions){let s=SL(e,i);s&&(a.suggestion=Sr(s,i))}if(t&&e.path){let s=xL(t,e.path);s&&(a.line=s.line,a.column=s.column)}return a}function du(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(uu(a,t?.jsonString,void 0)))}return i}function xL(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 SL(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: ${Ir(gn).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(It(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 IL=Object.fromEntries([...Tt.map(e=>[e.name,e.propsSchema]),["custom",$r]]),wL=new Map(Tt.filter(e=>(e.embeddedComponents?.length??0)>0).map(e=>[e.name,e.embeddedComponents])),cu=new Set(Tt.filter(e=>!!e.special?.hasSchemaField).map(e=>e.name)),CL=new Map(Tt.map(e=>[e.name,new Set(["name","id","enabled","props",...e.hasChildren?["children"]:[],...e.special?.hasSchemaField?["$schema","renderer"]:[]])])),TL={id:"string",enabled:"boolean",$schema:"string",renderer:"string"};function xy(e,t,r,i){let o=typeof e.name=="string"?CL.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=TL[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 PL=["path","base64","svg"];function EL(e){if(!e||typeof e!="object")return[];let t=e;return PL.filter(r=>{let i=t[r];return typeof i=="string"&&i.trim().length>0})}function $L(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=EL(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 AL=new Set(["paragraph","heading"]);function fu(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(AL.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 hu(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 vL=new Set(["dashed","dotted","double"]);function gu(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"&&vL.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 yu(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(!cu.has(e.name)){let i=[...cu].map(o=>`"${o}"`).join(", ");r.push({path:"/name",message:`Invalid name "${e.name}". Expected ${i}`,code:"invalid_value"})}if(xy(e,"",t,r),cu.has(e.name)&&"props"in e){let i=pu(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"}),Sy(e,"",t,r),r}function Sy(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)||(xy(s,c,r,i),"props"in s?i.push(...pu(s.name,s.props,`${c}/props`,r)):s.name!=="custom"&&i.push(...pu(s.name,{},`${c}/props`,r)),Sy(s,c,r,i))},a=typeof e.name=="string"?wL.get(e.name):void 0;if(a&&e.props&&typeof e.props=="object")for(let s of a)lu(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 lu(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)=>lu(s,a,`${r}/${c}`,i));return}lu(e[o],a,`${r}/${o}`,i)}function pu(e,t,r,i={}){let o=[],a=IL[e];if(!a)return o.push({path:r.replace(/\\/props$/,"/name"),message:`Unknown component "${e}"`,code:"unknown_component"}),o;let s=LL(a,t),c=i.allowUnknownFields?T.Clean(s,T.Clone(t)):t;if(!T.Check(s,c)){let l=[...T.Errors(s,c)];du(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 LL(e,t){let r=e.anyOf;if(!Array.isArray(r)||r.length===0)return e;let i=r.filter(c=>NL(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 NL(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 bu(e,t=[],r={}){let i=yu(e,r),o=t.filter(a=>!RL(a));return kL([...o,...i])}function RL(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 kL(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 co(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 Iy(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 wy(e,t,r,i){let o=Pt(e,t,i);return!o.valid&&o.errors&&(o.errors=r(o.errors)),o}function Cy(e,t){return(r,i)=>Pt(e,r,{...t,...i})}function Ty(e,t){return(r,i)=>co(e,r,{...t,...i})}function Py(e){return e.valid===!0&&e.data!==void 0}function Ey(e){return e.valid?"Validation successful":!e.errors||e.errors.length===0?"Validation failed with unknown error":Xr(e.errors)}var FL=ft,jL=[{why:"image source mutual-exclusivity",collect:$L},{why:"indent hanging/firstLine mutual-exclusivity",collect:fu},{why:"notes on a revised paragraph",collect:hu},{why:"a text box asking for a shape rendering a shape cannot give it",collect:gu},{why:"renderer profile compatibility",collect:jc}];function $y(e){return jL.flatMap(({collect:t})=>t(e))}function mu(e,t){if(Array.isArray(e))return e.some(i=>mu(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=>mu(i,t))}var Oy;function UL(){return Oy??(Oy=n.Recursive(e=>n.Union(Tt.map(t=>Pi(t,e,e))))),Oy}function _L(e,t,r){return r?.allowUnknownFields===!0||r?.knownCustomNames!==void 0&&r.knownCustomNames.size>0&&mu(e,r.knownCustomNames)||T.Check(UL(),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 Ay(e,t,r){let i=bu(e,t,{allowUnknownFields:r?.allowUnknownFields,knownCustomNames:r?.knownCustomNames});return i.length===0?_L(e,t,r):{valid:!1,errors:i}}function Gc(e,t){let r=Pt(ft,e,t),i=r.errors||[],o=r.valid;!r.valid&&e&&({valid:o,errors:i}=Ay(e,r.errors||[],t));let a=[...$y(e),...Qi(e,Pr(e),"docx",[...t?.knownCustomNames??[]])];a.length>0&&(i=[...i,...a],o=!1),i=Xi(e,"docx",i);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=>!Ly(m.name));c.hasCustomComponents=p}}return c}function qc(e,t){let r=co(FL,e,t),i=r.errors||[],o=r.valid;!r.valid&&r.parsed&&({valid:o,errors:i}=Ay(r.parsed,r.errors||[],t));let a=[...$y(r.parsed),...Qi(r.parsed,Pr(r.parsed),"docx",[...t?.knownCustomNames??[]])];a.length>0&&(i=[...i,...a],o=!1),i=Xi(r.parsed,"docx",i);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=>!Ly(m.name));c.hasCustomComponents=p}}return c}function vy(e){return e.valid===!0&&e.data!==void 0}function DL(){return di(Kc)}function Ly(e){return DL().includes(e)}function Wc(e){return{validate:(t,r)=>Gc(t,{...e,...r}),validateJson:(t,r)=>qc(t,{...e,...r})}}var lo=Wc({clean:!0,applyDefaults:!0,maxErrors:100}),es=Wc({clean:!1,applyDefaults:!1,maxErrors:100}),Ny=qc,Ry=Gc;function ML(){return{includeEmojis:!Fy(),verbosity:"normal",includeSuggestions:!0,includePath:!0,maxMessageLength:0,includeDocLinks:!1,colorSupport:BL()}}var Cz=ML(),ky={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 Fy(){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 BL(){return typeof process>"u"||process.env?.NO_COLOR?!1:process.env?.FORCE_COLOR||process.stdout?.isTTY?!0:!Fy()}function Jc(e,t){if(typeof e=="string")return{valid:!0,themeName:e};let r=Pt(so,e,t),i={...r};if(r.valid&&r.data){let o=r.data;o.name&&(i.themeName=o.name)}return i}function Ou(e,t){let r=co(so,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 xu(e,t){let r=Jc(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 jy(e){return e.valid===!0&&e.data!==void 0}function Yc(e){return{validate:(t,r)=>Jc(t,{...e,...r}),validateJson:(t,r)=>Ou(t,{...e,...r}),validateWithEnhancement:(t,r)=>xu(t,{...e,...r})}}var ts=Yc({clean:!0,applyDefaults:!0}),Hc=Yc({clean:!1,applyDefaults:!1,maxErrors:10});function Uy(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 _y(e){if(!e||typeof e!="object")return!1;let t=e;return!!(t.colors&&t.fonts)}var Dy={report:gn,section:un,heading:sn,paragraph:cn,columns:dn,image:ln,statistic:pn,table:mn,list:fn,custom:$r};function mo(e,t,r){let i=Dy[e];if(!i){let a=Pt($r,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 Su(e,t){let r=Pt(ft,e,t),i={...r};if(r.valid&&r.data){let o=r.data;i.componentName=o.name,i.isCustomComponent=!uo(o.name)}return i}function Iu(e,t,r){return kn(e,t,r)}function uo(e){return e in Dy}function My(e){return T.Check(gn,e)}function By(e){return T.Check(un,e)}function Vy(e){return T.Check(sn,e)}function Ky(e){return T.Check(cn,e)}function Gy(e){return T.Check(dn,e)}function qy(e){return T.Check(ln,e)}function Wy(e){return T.Check(pn,e)}function Hy(e){return T.Check(mn,e)}function zy(e){return T.Check(fn,e)}function Jy(e){return T.Check($r,e)}function Qc(e){return{validate:(t,r,i)=>uo(t)?mo(t,r,{...e,...i}):mo("custom",r,{...e,...i}),validateDefinition:(t,r)=>Su(t,{...e,...r}),validateCustom:(t,r,i)=>Iu(t,r,{...e,...i})}}var po=Qc({clean:!0,applyDefaults:!0}),zc=Qc({clean:!1,applyDefaults:!1,maxErrors:10}),Yy={document:e=>lo.validate(e),jsonDocument:e=>lo.validateJson(e),theme:e=>ts.validate(e),jsonTheme:e=>ts.validateJson(e),component:(e,t)=>po.validate(e,t),componentDefinition:e=>po.validateDefinition(e),components:e=>e.map(t=>po.validate(t.name,t.props)),isDocument:e=>lo.validate(e).valid,isTheme:e=>ts.validate(e).valid,isComponent:(e,t)=>po.validate(e,t).valid},Qy={document:e=>es.validate(e),jsonDocument:e=>es.validateJson(e),theme:e=>Hc.validate(e),jsonTheme:e=>Hc.validateJson(e),component:(e,t)=>zc.validate(e,t),componentDefinition:e=>zc.validateDefinition(e)};var Xy=n.Object({definition:ft,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"}),Zy=n.Object({definition:n.Unknown(),strict:n.Optional(n.Boolean())},{additionalProperties:!1,description:"Document validation request"}),eb=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"}),tb=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 rb=ft,nb={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 VL=1e6;function ib(e){return e?e.split(/(\\s+)/).filter(t=>t.length>0):[]}function Xc(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 Xc(r)}function il(e,t){if(e===t)return e?[{type:"equal",text:e}]:[];let r=ib(e),i=ib(t);if(r.length===0)return Xc([{type:"insert",text:t}]);if(i.length===0)return Xc([{type:"delete",text:e}]);if(r.length*i.length>VL)return Xc([{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 ns(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 $u=new Set(["paragraph","heading"]);function pr(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 rs(e){let t=e.props?.text;return typeof t=="string"?t.normalize("NFC"):""}function Zc(e){return ns(rs(e))}var GL=/\\{[^}]+\\}/;function el(e){return e.enabled!==!1}function ss(e,t,r,i){e.some(o=>o.type!=="equal"&&GL.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 qL=4e6;function Au(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>qL){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 vu(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 WL(e,t,r,i){let o=Zc(e),a=Zc(t),s=!pr(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 rs(e)!==rs(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=il(o,a);return ss(c,r,t.name,i),(rs(e)!==o||rs(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:{...ol(t,r,i),text:a,revision:Kn(i,c)}}}function ol(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 HL(e,t,r){r.summary.tracked.inserted++;let i=Zc(e),o=[{type:"insert",text:i}];return ss(o,t,e.name,r),{...e,props:{...ol(e,t,r),text:i,revision:Kn(r,o)}}}function zL(e,t,r){r.summary.tracked.deleted++;let o=[{type:"delete",text:Zc(e)}];return ss(o,t,e.name,r),{...e,props:{...ol(e,t,r),text:"",revision:Kn(r,o)}}}function wu(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:ns(i.normalize("NFC")),level:o}})}function JL(e,t,r,i){let o=!pr(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=wu(e),s=wu(t),c=f=>f.map(O=>({text:O.text,level:O.level}));if(pr(c(a),c(s)))return pr(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=Au(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}=vu(O,w,(x,N)=>x.level===N.level);for(let x of S)if(m=!0,x.kind==="paired"){let N=il(x.oldItem.text,x.newItem.text);ss(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 ab(e,t,r){t==="insert"?r.summary.tracked.inserted++:r.summary.tracked.deleted++;let i=wu(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 Cu(e){if(!e)return"";let t=e.content;if(typeof t=="string")return ns(t.normalize("NFC"));if(t&&typeof t=="object"){let i=t.props?.text;if(typeof i=="string")return ns(i.normalize("NFC"))}return""}function Tu(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 ob(e){if(!e)return!0;let t=e.content;return t===void 0||typeof t=="string"?!0:typeof t=="object"&&t.name==="paragraph"}function Pu(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(Cu).join("\\0"),rawKey:s.map(Tu).join("\\0"),rowProps:i[a]}})}function sb(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 tl(e){return Array.isArray(e.props?.columns)&&!e.props?.headers}function YL(e,t,r,i,o,a){let s=il(r,i);ss(s,o,"table",a),(Tu(t)!==r||Tu(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:QL(c.content,i,o,a),revision:Kn(a,s)}}function QL(e,t,r,i){if(!e||typeof e!="object")return t;let o=e;return{...o,props:{...ol(o,r,i),text:t}}}function XL(e,t,r,i){let o=Pu(e),a=Pu(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=!pr(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=!pr(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"}),pr(o.map(x=>x.key),a.map(x=>x.key)))return pr(o.map(x=>x.rawKey),a.map(x=>x.rawKey))?!l&&!p&&pr(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=Au(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}=vu(N,I,(D,be)=>D.cells.length===be.cells.length&&D.cells.every(ob)&&be.cells.every(ob));for(let D of v)if(O=!0,D.kind==="paired"){let be=D.newItem.cells.map((Le,He)=>{let te=Cu(D.oldItem.cells[He]),P=Cu(Le);return te===P?Le??{content:""}:YL(Le,D.oldItem.cells[He],te,P,r,i)});w({...D.newItem,cells:be},{})}else D.kind==="inserted"?(i.summary.tracked.inserted++,w(D.newItem,{revision:Eu(i,"insert")})):(i.summary.tracked.deleted++,w(D.oldItem,{revision:Eu(i,"delete")}))}return O&&i.summary.tracked.modified++,sb(t,u,f)}function cb(e,t,r){t==="insert"?r.summary.tracked.inserted++:r.summary.tracked.deleted++;let i=Pu(e);return sb(e,i,i.map(()=>({revision:Eu(r,t)})))}function Eu(e,t){return{type:t,...e.author&&{author:e.author},...e.date&&{date:e.date}}}function rl(e){return Array.isArray(e.children)}function ZL(e,t){return e.name===t.name}function eN(e,t,r,i){let o=el(e),a=el(t);return!o&&!a?(i.summary.unchangedBlocks++,t):!o&&a?lb(t,r,i):o&&!a?pb(e,r,i)??t:$u.has(t.name)?WL(e,t,r,i):t.name==="list"?JL(e,t,r,i):t.name==="table"&&tl(e)&&tl(t)?XL(e,t,r,i):rl(t)||rl(e)?(!pr(e.props,t.props)&&i.summary.untracked.push({path:r,kind:"modified",component:t.name,detail:"container props changed; new version rendered"}),{...t,children:al(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 lb(e,t,r){return el(e)?$u.has(e.name)?HL(e,t,r):e.name==="list"?ab(e,"insert",r):e.name==="table"&&tl(e)?cb(e,"insert",r):rl(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:al([],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 pb(e,t,r){if(!el(e))return null;if($u.has(e.name))return zL(e,t,r);if(e.name==="list")return ab(e,"delete",r);if(e.name==="table"&&tl(e))return cb(e,"delete",r);if(rl(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=al(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 al(e,t,r,i){let o=Au(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}=vu(p,m,ZL);for(let f of u)if(f.kind==="paired")a.push(eN(f.oldItem,f.newItem,`${r}/${c}`,i)),c++;else if(f.kind==="inserted")a.push(lb(f.newItem,`${r}/${c}`,i)),c++;else{let O=pb(f.oldItem,`${r}/${c}`,i);O&&a.push(O)}}return a}function tN(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};!pr(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=al(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 Lu=class{constructor(){R(this,"schema",ft)}parse(e){let t;if(typeof e=="string")try{t=JSON.parse(e)}catch(r){throw new fo("Invalid JSON syntax",this.extractJSONSyntaxError(r,e))}else t=e;if(typeof t!="object"||t===null||!("name"in t)||t.name!=="docx")throw new ho(\'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 ho("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 fo||t instanceof ho?{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 fo||r instanceof ho){let i=r.validationErrors.map(o=>({...o,...this.findLineNumber(o.path,e,t)}));throw r instanceof fo?new fo(r.message,i):new ho(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{}}},fo=class extends Error{constructor(t,r){super(t);R(this,"validationErrors");this.name="JsonParsingError",this.validationErrors=r}},ho=class extends Error{constructor(t,r){super(t);R(this,"validationErrors");this.name="JsonValidationError",this.validationErrors=r}};function rN(e){return new Lu().parse(e)}function nN(e){return new Lu().parseWithLineNumbers(e)}function iN(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 oN(e,t){let r=uo(e)?e:"custom",i=mo(r,t);return i.valid?{success:!0,data:i.data}:{success:!1,error:i.errors||[]}}function aN(e){let t=Su(e);return t.valid?{success:!0,data:t.data}:{success:!1,error:t.errors||[]}}function sN(e,t){let r=t&&uo(t)?t:"custom",i=mo(r,e);return i.valid?[]:(i.errors||[]).map(o=>o.path?`${o.path}: ${o.message}`:o.message)}function cN(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=lN(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 lN(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(cN)}function is(e){return qn(e).map(t=>{let r=`${t.path}: ${t.message}`;return t.suggestion&&(r+=` (Suggestion: ${t.suggestion})`),r})}function mb(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 os(e){let t=qn(e),r=mb(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 as(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 pN(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 mN=qn,uN=is,nl={report:gn,section:un,heading:sn,paragraph:cn,columns:dn,image:ln,statistic:pn,table:mn,list:fn};function sl(e,t,r){let i=nl[e];if(!i){if(T.Check($r,t))return{success:!0,data:t};let s=[...T.Errors($r,t)];return{success:!1,errors:qn(s),errorStrings:is(s),report:r?.includeReport?os(s):void 0,hasCriticalErrors:r?.checkCritical?as(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:is(o),report:r?.includeReport?os(o):void 0,hasCriticalErrors:r?.checkCritical?as(o):void 0}}function Nu(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(ft,e)){let s=e,c=[];if(s.children&&Array.isArray(s.children))for(let l=0;l<s.children.length;l++){let p=Nu(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(ft,e)];return{success:!1,errors:qn(o),errorStrings:is(o),report:t?.includeReport?os(o):void 0,hasCriticalErrors:t?.checkCritical?as(o):void 0}}function dN(e,t){let r=[],i=0;for(let{name:s,props:c}of e){let l=s in nl?sl(s,c,t):Nu(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 fN(e,t,r){try{let i=r?r(t):t;return sl(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 hN(e,t){let r=nl[e];if(!r)return{success:!1,errors:[{path:"name",message:`Unknown component name: ${e}`,code:"custom",suggestion:`Use one of: ${Object.keys(nl).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:is(i),report:os(i),hasCriticalErrors:as(i)}}function gN(e,t){return sl(e,t).success}var ub=["chart","columns","divider","heading","highcharts","image","list","paragraph","docx","section","statistic","table","text-box","toc","visual","block","group"],yN=new Set(ub);function bN(e){return e.name==="docx"}function ON(e){return e.name==="section"}function xN(e){return e.name==="columns"}function SN(e){return e.name==="heading"}function IN(e){return e.name==="paragraph"}function wN(e){return e.name==="image"}function CN(e){return e.name==="text-box"}function TN(e){return e.name==="statistic"}function PN(e){return e.name==="table"}function EN(e){return e.name==="list"}function $N(e){return e.name==="toc"}function AN(e){return e.name==="highcharts"}function vN(e){return e.name==="visual"}function LN(e){return e.name==="text-space-after"}var NN="1.0.0";var ed={};nt(ed,{BUILT_IN_PPTX_THEME_NAMES:()=>cs,ChartComponentDefaultsSchema:()=>Du,ColorValueSchema:()=>Bn,DEFAULT_ERROR_CONFIG:()=>vn,DEFAULT_PPTX_RENDERER_ID:()=>yn,GradientFillSchema:()=>no,GradientStopSchema:()=>Ac,HighchartsComponentDefaultsSchema:()=>_u,ImageComponentDefaultsSchema:()=>Fu,PATTERN_FILL_PRESETS:()=>$c,PPTX_BASE_SCHEMA_METADATA:()=>vb,PPTX_COMPONENT_METADATA:()=>Ab,PPTX_JSON_SCHEMA_URLS:()=>Pb,PPTX_RENDERER_IDS:()=>Et,PPTX_SHARED_VERSION:()=>HN,PPTX_STANDARD_COMPONENTS_REGISTRY:()=>$t,PatternFillSchema:()=>vc,PositionSchema:()=>yb,PptxChartPropsSchema:()=>Ja,PptxComponentDefaultsSchema:()=>go,PptxComponentDefinitionSchema:()=>ul,PptxHighchartsPropsSchema:()=>za,PptxImagePropsSchema:()=>qa,PptxJsonComponentDefinitionSchema:()=>Tb,PptxSlideContentSchema:()=>Ya,PptxStandardComponentDefinitionSchema:()=>Cb,PptxTablePropsSchema:()=>Ha,PresentationPropsSchema:()=>Gu,SEMANTIC_COLOR_ALIASES:()=>Pc,SEMANTIC_COLOR_NAMES:()=>Tc,STYLE_NAMES:()=>eo,ShadowSchema:()=>to,ShapeComponentDefaultsSchema:()=>ju,ShapePropsSchema:()=>Wa,ShapeTypeSchema:()=>ro,SlideBackgroundSchema:()=>qu,SlidePropsSchema:()=>Hu,StyleNameSchema:()=>Va,TableComponentDefaultsSchema:()=>Uu,TextComponentDefaultsSchema:()=>ku,TextPropsSchema:()=>Ga,TextRunSchema:()=>Ec,TextStyleSchema:()=>Bu,ThemeConfigSchema:()=>Ei,TransitionSchema:()=>Wu,VerticalAlignmentSchema:()=>Ci,addPptxBlockAuthoringSchemas:()=>dl,collectImageSourceConflicts:()=>Nb,collectPptxRendererErrors:()=>Ku,collectTextContentConflicts:()=>Rb,compareSemver:()=>gi,comprehensiveValidatePresentation:()=>Ub,convertToJsonSchema:()=>$b,createAllPptxComponentSchemas:()=>pl,createComponentSchema:()=>Wi,createErrorConfig:()=>wr,createPptxComponentSchemaObject:()=>$i,deepValidatePresentation:()=>jb,dispatchPptxRootByRenderer:()=>fl,exportSchemaToFile:()=>Hi,fixSchemaReferences:()=>Fn,generateUnifiedDocumentSchema:()=>wb,getAllPptxComponentNames:()=>bb,getPptxComponentsByCategory:()=>Ob,getPptxContainerComponents:()=>xb,getPptxContentComponents:()=>Sb,getPptxStandardComponent:()=>yo,isPptxStandardComponent:()=>Ib,isValidSemver:()=>Rn,isValidThemeConfig:()=>db,latestVersion:()=>dt,parseSemver:()=>Nn,pptxComponentDefinitionName:()=>Wn,pptxComponentRequiresProps:()=>Ti,preparePptxDocumentBlockTargets:()=>Eb,presentImageSources:()=>Lb,transformValueError:()=>Ln,transformValueErrors:()=>tt,validate:()=>qN,validateJsonPptxTheme:()=>Zu,validateJsonPresentationDocument:()=>Xu,validatePptxTheme:()=>ps,validatePresentationDocument:()=>ls,validateStrict:()=>WN});var ku=n.Partial(Ga),Fu=n.Partial(qa),ju=n.Partial(Wa),Uu=n.Partial(Ha),_u=n.Partial(za),Du=n.Partial(Ja),go=n.Object({text:n.Optional(ku),image:n.Optional(Fu),shape:n.Optional(ju),table:n.Optional(Uu),highcharts:n.Optional(_u),chart:n.Optional(Du)},{additionalProperties:!0});var cs=["consulting","dark","devportal","minimal","vermilion"],RN=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"}),kN=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"}),Mu=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(RN),gutter:n.Optional(kN)},{additionalProperties:!1,description:"Grid layout configuration"}),mr=n.String({pattern:"^#?[0-9A-Fa-f]{6}$",description:"Hex color (e.g. #FF0000)"}),Bu=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"}),Ei=n.Object({...Un,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:mr,secondary:mr,accent:mr,background:mr,text:mr,text2:n.Optional(mr),background2:n.Optional(mr),accent4:n.Optional(mr),accent5:n.Optional(mr),accent6:n.Optional(mr)},{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(Cr),defaults:n.Object({fontSize:n.Number({description:"Default font size in points"}),fontColor:mr},{additionalProperties:!1,description:"Default text styling"}),styles:n.Optional(n.Partial(n.Object(Object.fromEntries(eo.map(e=>[e,Bu]))),{additionalProperties:!1,description:"Named text style presets"})),componentDefaults:n.Optional(go)},{additionalProperties:!1,description:"Presentation theme configuration"});function db(e){return T.Check(Ei,e)}var Et=["pptxgenjs","office-open"],yn="pptxgenjs";function Wn(e){return`PptxComponentDefinition_${e}`}function fb(e,t,r){let i=Vu(t),o=cl(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];FN(i);break}return hb(i),i}function Ku(e){if(!e||typeof e!="object"||Array.isArray(e))return[];let t=e,r=t.renderer??yn;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 FN(e){let i=cl(e)?.rows?.items?.items?.anyOf;if(Array.isArray(i))for(let o of i){let a=cl(o);a?.text&&(delete a.colspan,delete a.rowspan,delete a.margin,hb(o))}}function cl(e){if(!(!e||typeof e!="object"))return e.properties}function hb(e){let t=cl(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 Vu(e){if(Array.isArray(e))return e.map(Vu);if(!e||typeof e!="object")return e;let t=Object.create(Object.getPrototypeOf(e));for(let r of Reflect.ownKeys(e))t[r]=Vu(e[r]);return t}var ll=(e,t)=>n.Union([n.Number({description:e}),n.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:t})]),jN=n.Object({x:n.Optional(ll("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(ll("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(ll("Frame width in inches","Frame width as a percentage of the enclosing width")),h:n.Optional(ll("Frame height in inches","Frame height as a percentage of the enclosing height")),grid:n.Optional(on),gridConfig:n.Optional(n.Object({...Mu.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."}),Gu=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: "consulting"). Built-ins: ${cs.join(", ")} (consulting is the house style).`,examples:[...cs],default:"consulting"}),Ei],{description:\'Theme to apply: a built-in/custom theme name (default: "consulting"), or an inline theme config object so the document stays self-contained\'})),fontRegistry:n.Optional(Cr),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(go),grid:n.Optional(Mu),blocks:n.Optional(en),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}),yb=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}),qu=n.Object({color:n.Optional(Bn),gradient:n.Optional(no),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}),Wu=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}),Hu=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(qu),transition:n.Optional(Wu),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}),gb=[...nn.map(({name:e})=>e),"block","group"],$t=[{name:"pptx",propsSchema:Gu,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:Hu,hasChildren:!0,allowedChildren:gb,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:jN,hasChildren:!0,allowedChildren:gb,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."},...nn];function yo(e){return $t.find(t=>t.name===e)}function bb(){return $t.map(e=>e.name)}function Ob(e){return $t.filter(t=>t.category===e)}function xb(){return $t.filter(e=>e.hasChildren)}function Sb(){return $t.filter(e=>!e.hasChildren)}function Ib(e){return $t.some(t=>t.name===e)}function $i(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?fb(e.name,e.propsSchema,r.renderer):e.propsSchema,e.hasChildren&&t&&(i.children=n.Optional(n.Array(t))),Ti(e)||(i.props=n.Optional(i.props)),n.Object(i,{additionalProperties:!1,description:e.description})}function pl(e){return $t.map(t=>$i(t,e))}function ml(e,t=[],r){let i=new Map;for(let c of $t)c.hasChildren||i.set(c.name,$i(c,void 0,r));let o=$t.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,$i(p,w,r)),s.splice(l,1);continue}if(!p.allowedChildren){a.set(p.name,$i(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,$i(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 UN(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 wb(e={}){let{customComponents:t=[]}=e,r=Et.map(i=>_N(t,i,i!==yn));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=dt(c.versions.map(m=>m.version)),p=c.versions.map(m=>UN(c,m,i,m.version===l));o.push(...p)}let s=[...ml(i,o,{renderer:t,requireDiscriminator:r}),...o];return s.length===0?n.Object({}):n.Union(s)},{$id:Wn(t)})}var Cb=n.Union([...pl(n.Any())],{discriminator:{propertyName:"name"},description:"Standard PPTX component definition with discriminated union"}),ul=n.Recursive(e=>n.Union([...ml(e)],{discriminator:{propertyName:"name"},description:"PPTX component definition with discriminated union"}));var Tb=ul,Pb={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 dl(e){let t=e.definitions??{},r=new Map;for(let o of Et){let a=Wn(o);t[a]&&r.set(o,Ua(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 fl(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(yn))return;let i=a=>({properties:{renderer:{const:a}},required:["renderer"]}),o=Et.filter(a=>a!==yn&&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(yn)}]}function Eb(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=tc(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 $b(e,t={}){return rc(e,{...t,enrich:r=>{dl(r),fl(r)}})}var Ab={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"}},vb={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 DN=["path","base64","svg"];function Lb(e){if(!e||typeof e!="object")return[];let t=e;return DN.filter(r=>{let i=t[r];return typeof i=="string"&&i.trim().length>0})}function Nb(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=Lb(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 Rb(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 MN=Object.fromEntries($t.map(e=>[e.name,e.propsSchema])),zu=new Set($t.filter(e=>!!e.special?.hasSchemaField).map(e=>e.name)),Qu=new Set(["name","id","enabled","props","children"]),BN=new Set([...Qu,"version"]),kb=new Set([...Qu,"$schema"]);kb.add("renderer");var VN={id:"string",enabled:"boolean",$schema:"string",version:"string"};function Fb(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=VN[a];s&&typeof e[a]!==s&&o.push({path:`${t}/${a}`,message:`Field "${a}" on ${i} must be a ${s}`,code:"invalid_type"})}}function jb(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(!zu.has(e.name)){let o=[...zu].map(a=>`"${a}"`).join(", ");r.push({path:"/name",message:`Invalid name "${e.name}". Expected ${o}`,code:"invalid_value"})}Fb(e,"",kb,"the root component",r);let i=yo(e.name);return"props"in e?zu.has(e.name)&&r.push(...Yu(e.name,e.props,"/props",t)):(!i||Ti(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"}),Ju(e,"",t,r),r}function Ju(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(Fb(c,l,p?BN:Qu,`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.`}),Ju(c,l,r,i);return}let u=yo(c.name),f=`${l}/props`;if("props"in c)i.push(...Yu(c.name,c.props,f,r));else if(u&&Ti(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(...Yu(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}Ju(c,l,r,i)},a=yo(e.name),s=(c,l)=>{if(a?.allowedChildren&&c&&typeof c=="object"&&typeof c.name=="string"&&yo(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 Yu(e,t,r,i={}){let o=[],a=MN[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 Ub(e,t=[],r={}){let i=jb(e,r),o=t.filter(a=>!KN(a));return GN([...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 GN(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 _b(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 ls(e,t={}){let r=Ub(e,[],t);r.push(...Nb(e)),r.push(...Rb(e)),r.push(...Ku(e)),r.push(...Qi(e,Pr(e),"pptx",[...t.knownCustomNames??[]]));let i=r.length===0;return{valid:i,errors:Xi(e,"pptx",r),documentType:"pptx",data:i?e:void 0}}function Xu(e,t={}){let{parsed:r,error:i}=_b(e);return i?{valid:!1,errors:[i],documentType:"pptx"}:ls(r,t)}function ps(e){if(T.Check(Ei,e))return{valid:!0,errors:[],data:e};let t=[...T.Errors(Ei,e)];return{valid:!1,errors:tt(t,{maxErrors:100})}}function Zu(e){let{parsed:t,error:r}=_b(e);return r?{valid:!1,errors:[r]}:ps(t)}var qN={document:e=>ls(e),jsonDocument:e=>Xu(e),theme:e=>ps(e),jsonTheme:e=>Zu(e),isDocument:e=>ls(e).valid,isTheme:e=>ps(e).valid},WN={document:e=>ls(e),jsonDocument:e=>Xu(e),theme:e=>ps(e),jsonTheme:e=>Zu(e)},HN="1.0.0";function Db(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 td(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 Mb(e){if(td(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(td(r))return r;for(let r of Object.values(e))if(td(r))return r;return null}var zN=/^\\d+\\.\\d+\\.\\d+$/;function Bb(e,t,r){let i=[];for(let[o,a]of Object.entries(e.versions)){if(!zN.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:dt(i.map(o=>o.version)),examples:r}}function Vb(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 rd=Vb("@json-to-office/shared-docx","ComponentDefinition","ThemeConfigJson"),nd=Vb("@json-to-office/shared-pptx","PptxComponentDefinition","ThemeConfigJson");function hl(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 b9={"node_modules/@json-to-office/core-docx/package.json":hl("@json-to-office/core-docx",!0),"node_modules/@json-to-office/core-docx/index.d.ts":rd,"node_modules/@json-to-office/core-docx/plugin/index.d.ts":rd,"node_modules/@json-to-office/json-to-docx/package.json":hl("@json-to-office/json-to-docx",!1),"node_modules/@json-to-office/json-to-docx/index.d.ts":rd,"node_modules/@json-to-office/core-pptx/package.json":hl("@json-to-office/core-pptx",!0),"node_modules/@json-to-office/core-pptx/index.d.ts":nd,"node_modules/@json-to-office/core-pptx/plugin/index.d.ts":nd,"node_modules/@json-to-office/json-to-pptx/package.json":hl("@json-to-office/json-to-pptx",!1),"node_modules/@json-to-office/json-to-pptx/index.d.ts":nd},Kb=["@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 id="[plugin-network-off]";var od=globalThis,ad=od.postMessage.bind(od),JN={createComponent:Gi,createVersion:Ki,resolveComponentVersion:yi,ComponentValidationError:bi,DuplicateComponentError:qi},YN={"@sinclair/typebox":dp,"@sinclair/typebox/value":$p,"@json-to-office/shared":xm,"@json-to-office/shared/plugin":Sm,"@json-to-office/shared-docx":Ru,"@json-to-office/shared-pptx":ed,...Object.fromEntries(Kb.map(e=>[e,JN]))},QN=["importScripts","Worker","SharedWorker","indexedDB","caches","BroadcastChannel","FileSystemHandle","FileSystemFileHandle","FileSystemDirectoryHandle","showOpenFilePicker","showSaveFilePicker","showDirectoryPicker","close"],XN=["fetch","XMLHttpRequest","WebSocket","EventSource","WebTransport"];function Gb(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 qb(e){let t=`${id} ${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 ZN(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(`${id} 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 Wb=!1;function eR(e,t){if(Wb)return;Wb=!0;for(let i of QN)Gb(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 XN)Gb(i,qb(i));if(r)try{Object.defineProperty(r,"sendBeacon",{value:qb("navigator.sendBeacon")})}catch{}return}ZN(t)}var Hb=5*1024*1024,ms=null;function tR(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}:{}};ad(i)}async function rR(e){if(e.type==="load"){eR(e.allowNetwork,e.networkOrigins??[]);let t=Db(e.js,YN),r=Mb(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".\');ms=r;let i=Bb(r,e.format,e.examples),o={id:e.id,type:"loaded",metadata:i};ad(o);return}if(e.type==="render"){if(!ms)throw new Error("Plugin is not loaded");let t=yi(ms.name,ms.versions,e.version),r=kn(t.propsSchema,e.props,{componentName:ms.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>Hb)throw new Error(`render() returned ${Math.round(c.length/1024/1024)} MB of components; the limit is ${Hb/1024/1024} MB.`);let l=JSON.parse(c),p={id:e.id,type:"rendered",components:l,warnings:i};ad(p);return}}od.addEventListener("message",e=>{let t=e.data;!t||typeof t!="object"||typeof t.id!="number"||rR(t).catch(r=>tR(t.id,r))});})();\n';export{e as default};
2
- //# sourceMappingURL=_virtual_jto-sandbox-runtime-v4kQF3ee.js.map
1
+ const e='"use strict";(()=>{var Jb=Object.create;var us=Object.defineProperty;var Yb=Object.getOwnPropertyDescriptor;var Qb=Object.getOwnPropertyNames;var Xb=Object.getPrototypeOf,Zb=Object.prototype.hasOwnProperty;var eO=(e,t,r)=>t in e?us(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var tO=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),nt=(e,t)=>{for(var r in t)us(e,r,{get:t[r],enumerable:!0})},rO=(e,t,r,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Qb(t))!Zb.call(e,o)&&o!==r&&us(e,o,{get:()=>t[o],enumerable:!(i=Yb(t,o))||i.enumerable});return e};var pd=(e,t,r)=>(r=e!=null?Jb(Xb(e)):{},rO(t||!e||!e.__esModule?us(r,"default",{value:e,enumerable:!0}):r,e));var R=(e,t,r)=>eO(e,typeof t!="symbol"?t+"":t,r);var _p=tO((YW,Sh)=>{Sh.exports={}});var dp={};nt(dp,{Any:()=>Qt,Argument:()=>$o,Array:()=>kr,AsyncIterator:()=>Fr,Awaited:()=>Mr,BigInt:()=>_r,Boolean:()=>ei,Capitalize:()=>Ho,Clone:()=>se,CloneRest:()=>cO,CloneType:()=>bn,Composite:()=>_o,Const:()=>Do,Constructor:()=>jr,ConstructorParameters:()=>Mo,CreateType:()=>y,Date:()=>ii,Enum:()=>Bo,Exclude:()=>Gr,ExcludeFromMappedResult:()=>Ql,ExcludeFromTemplateLiteral:()=>Yl,Extends:()=>Kr,ExtendsCheck:()=>Vr,ExtendsFromMappedKey:()=>Jl,ExtendsFromMappedResult:()=>zl,ExtendsResolverError:()=>$s,ExtendsResult:()=>b,ExtendsUndefinedCheck:()=>Pn,Extract:()=>qr,ExtractFromMappedResult:()=>Zl,ExtractFromTemplateLiteral:()=>Xl,FormatRegistry:()=>Ut,FromTypes:()=>Ui,Function:()=>yt,Hint:()=>ze,Increment:()=>_O,Index:()=>Zt,IndexFromComputed:()=>Fx,IndexFromMappedKey:()=>Ul,IndexFromMappedResult:()=>Fl,IndexFromPropertyKey:()=>jl,IndexFromPropertyKeys:()=>Fi,IndexPropertyKeys:()=>Qe,InstanceType:()=>Vo,Instantiate:()=>qo,Integer:()=>Wo,Intersect:()=>Ae,IntersectEvaluated:()=>Ro,Intrinsic:()=>Vt,IntrinsicFromMappedKey:()=>rp,IsTemplateLiteralExpressionFinite:()=>Cn,IsTemplateLiteralFinite:()=>No,Iterator:()=>Dr,JavaScriptTypeBuilder:()=>ks,JsonTypeBuilder:()=>_i,KeyOf:()=>Br,KeyOfFromMappedResult:()=>Bl,KeyOfPattern:()=>ni,KeyOfPropertyEntries:()=>Uo,KeyOfPropertyKeys:()=>Ze,KeyOfPropertyKeysToRest:()=>xf,Kind:()=>g,KindGuard:()=>Yt,Literal:()=>j,Lowercase:()=>zo,Mapped:()=>Fo,MappedFunctionReturnType:()=>gf,MappedKey:()=>nx,MappedResult:()=>W,Module:()=>Xo,Never:()=>k,Not:()=>Zo,Null:()=>oi,Number:()=>Ye,Object:()=>q,Omit:()=>tr,OmitFromMappedKey:()=>op,OmitFromMappedResult:()=>np,Optional:()=>$e,OptionalFromMappedResult:()=>Dl,OptionalKind:()=>Ne,Parameters:()=>ea,Partial:()=>Wr,PartialFromMappedResult:()=>lp,PatternBoolean:()=>xs,PatternBooleanExact:()=>DO,PatternNever:()=>sf,PatternNeverExact:()=>$l,PatternNumber:()=>Li,PatternNumberExact:()=>Nr,PatternString:()=>Ss,PatternStringExact:()=>Rr,Pick:()=>rr,PickFromMappedKey:()=>cp,PickFromMappedResult:()=>ap,Promise:()=>ri,Readonly:()=>Be,ReadonlyFromMappedResult:()=>_l,ReadonlyKind:()=>vt,ReadonlyOptional:()=>li,Record:()=>mi,RecordKey:()=>tp,RecordPattern:()=>Ko,RecordValue:()=>Go,Recursive:()=>ta,Ref:()=>bt,RegExp:()=>ra,Required:()=>Hr,RequiredFromMappedResult:()=>pp,Rest:()=>na,ReturnType:()=>ia,SetComplement:()=>ex,SetDistinct:()=>Al,SetIncludes:()=>Is,SetIntersect:()=>cf,SetIntersectMany:()=>vl,SetIsSubset:()=>XO,SetUnion:()=>ZO,SetUnionMany:()=>Ll,String:()=>ke,Symbol:()=>ai,TModule:()=>Ls,TemplateLiteral:()=>ti,TemplateLiteralExpressionGenerate:()=>ki,TemplateLiteralFiniteError:()=>ws,TemplateLiteralGenerate:()=>Zn,TemplateLiteralGenerateError:()=>Cs,TemplateLiteralParse:()=>Qn,TemplateLiteralParseExact:()=>Xn,TemplateLiteralParserError:()=>vo,TemplateLiteralPattern:()=>Ps,TemplateLiteralPatternError:()=>Ts,TemplateLiteralSyntax:()=>kl,TemplateLiteralToUnion:()=>Tn,Transform:()=>oa,TransformDecodeBuilder:()=>Ns,TransformEncodeBuilder:()=>Rs,TransformKind:()=>ue,Tuple:()=>Xe,Type:()=>n,TypeBoxError:()=>A,TypeGuard:()=>d,TypeRegistry:()=>_t,Uint8Array:()=>ci,Uncapitalize:()=>Jo,Undefined:()=>si,Union:()=>G,UnionEvaluated:()=>Xt,Unknown:()=>lt,Unsafe:()=>aa,Uppercase:()=>Yo,ValueGuard:()=>De,Void:()=>sa});var De={};nt(De,{HasPropertyKey:()=>ds,IsArray:()=>Ie,IsAsyncIterator:()=>yl,IsBigInt:()=>bo,IsBoolean:()=>dr,IsDate:()=>zn,IsFunction:()=>bl,IsIterator:()=>Ol,IsNull:()=>xl,IsNumber:()=>it,IsObject:()=>ee,IsRegExp:()=>Oo,IsString:()=>ie,IsSymbol:()=>Sl,IsUint8Array:()=>Ar,IsUndefined:()=>we});function ds(e,t){return t in e}function yl(e){return ee(e)&&!Ie(e)&&!Ar(e)&&Symbol.asyncIterator in e}function Ie(e){return Array.isArray(e)}function bo(e){return typeof e=="bigint"}function dr(e){return typeof e=="boolean"}function zn(e){return e instanceof globalThis.Date}function bl(e){return typeof e=="function"}function Ol(e){return ee(e)&&!Ie(e)&&!Ar(e)&&Symbol.iterator in e}function xl(e){return e===null}function it(e){return typeof e=="number"}function ee(e){return typeof e=="object"&&e!==null}function Oo(e){return e instanceof globalThis.RegExp}function ie(e){return typeof e=="string"}function Sl(e){return typeof e=="symbol"}function Ar(e){return e instanceof globalThis.Uint8Array}function we(e){return e===void 0}function nO(e){return e.map(t=>fs(t))}function iO(e){return new Date(e.getTime())}function oO(e){return new Uint8Array(e)}function aO(e){return new RegExp(e.source,e.flags)}function sO(e){let t={};for(let r of Object.getOwnPropertyNames(e))t[r]=fs(e[r]);for(let r of Object.getOwnPropertySymbols(e))t[r]=fs(e[r]);return t}function fs(e){return Ie(e)?nO(e):zn(e)?iO(e):Ar(e)?oO(e):Oo(e)?aO(e):ee(e)?sO(e):e}function se(e){return fs(e)}function cO(e){return e.map(t=>bn(t))}function bn(e,t){return t===void 0?se(e):se({...t,...e})}function xo(e){return L(e)&&globalThis.Symbol.asyncIterator in e}function So(e){return L(e)&&globalThis.Symbol.iterator in e}function hs(e){return L(e)&&(globalThis.Object.getPrototypeOf(e)===Object.prototype||globalThis.Object.getPrototypeOf(e)===null)}function lO(e){return L(e)&&!$(e)&&hr(e.constructor)&&e.constructor.name!=="Object"}function Io(e){return e instanceof globalThis.Promise}function Ge(e){return e instanceof Date&&globalThis.Number.isFinite(e.getTime())}function Il(e){return e instanceof globalThis.Map}function wl(e){return e instanceof globalThis.Set}function pO(e){return e instanceof globalThis.RegExp}function gt(e){return globalThis.ArrayBuffer.isView(e)}function mO(e){return e instanceof globalThis.Int8Array}function Jn(e){return e instanceof globalThis.Uint8Array}function uO(e){return e instanceof globalThis.Uint8ClampedArray}function dO(e){return e instanceof globalThis.Int16Array}function fO(e){return e instanceof globalThis.Uint16Array}function hO(e){return e instanceof globalThis.Int32Array}function gO(e){return e instanceof globalThis.Uint32Array}function yO(e){return e instanceof globalThis.Float32Array}function bO(e){return e instanceof globalThis.Float64Array}function OO(e){return e instanceof globalThis.BigInt64Array}function xO(e){return e instanceof globalThis.BigUint64Array}function E(e,t){return t in e}function L(e){return e!==null&&typeof e=="object"}function $(e){return globalThis.Array.isArray(e)&&!globalThis.ArrayBuffer.isView(e)}function ce(e){return e===void 0}function fr(e){return e===null}function Jt(e){return typeof e=="boolean"}function le(e){return typeof e=="number"}function wo(e){return globalThis.Number.isInteger(e)}function At(e){return typeof e=="bigint"}function X(e){return typeof e=="string"}function hr(e){return typeof e=="function"}function gr(e){return typeof e=="symbol"}function ot(e){return At(e)||Jt(e)||fr(e)||le(e)||X(e)||gr(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&&!$(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 SO(e){return globalThis.Object.freeze(e).map(t=>Co(t))}function IO(e){let t={};for(let r of Object.getOwnPropertyNames(e))t[r]=Co(e[r]);for(let r of Object.getOwnPropertySymbols(e))t[r]=Co(e[r]);return globalThis.Object.freeze(t)}function Co(e){return Ie(e)?SO(e):zn(e)?e:Ar(e)?e:Oo(e)?e:ee(e)?IO(e):e}function y(e,t){let r=t!==void 0?{...t,...e}:e;switch(Te.InstanceMode){case"freeze":return Co(r);case"clone":return se(r);default:return r}}var A=class extends Error{constructor(t){super(t)}};var Yt={};nt(Yt,{IsAny:()=>gs,IsArgument:()=>ys,IsArray:()=>Lt,IsAsyncIterator:()=>On,IsBigInt:()=>xn,IsBoolean:()=>yr,IsComputed:()=>Nt,IsConstructor:()=>Rt,IsDate:()=>md,IsFunction:()=>kt,IsImport:()=>wO,IsInteger:()=>Ft,IsIntersect:()=>ge,IsIterator:()=>Sn,IsKind:()=>Lr,IsKindOf:()=>U,IsLiteral:()=>Me,IsLiteralBoolean:()=>EO,IsLiteralNumber:()=>PO,IsLiteralString:()=>TO,IsLiteralValue:()=>To,IsMappedKey:()=>at,IsMappedResult:()=>pe,IsNever:()=>vr,IsNot:()=>ud,IsNull:()=>Ai,IsNumber:()=>jt,IsObject:()=>Se,IsOptional:()=>Je,IsPromise:()=>In,IsProperties:()=>CO,IsReadonly:()=>Yn,IsRecord:()=>wn,IsRecursive:()=>$O,IsRef:()=>Oe,IsRegExp:()=>bs,IsSchema:()=>de,IsString:()=>br,IsSymbol:()=>vi,IsTemplateLiteral:()=>st,IsThis:()=>dd,IsTransform:()=>z,IsTuple:()=>ct,IsUint8Array:()=>fd,IsUndefined:()=>Or,IsUnion:()=>K,IsUnknown:()=>hd,IsUnsafe:()=>gd,IsVoid:()=>yd});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 gs(e){return U(e,"Any")}function ys(e){return U(e,"Argument")}function Lt(e){return U(e,"Array")}function On(e){return U(e,"AsyncIterator")}function xn(e){return U(e,"BigInt")}function yr(e){return U(e,"Boolean")}function Nt(e){return U(e,"Computed")}function Rt(e){return U(e,"Constructor")}function md(e){return U(e,"Date")}function kt(e){return U(e,"Function")}function wO(e){return U(e,"Import")}function Ft(e){return U(e,"Integer")}function CO(e){return ee(e)}function ge(e){return U(e,"Intersect")}function Sn(e){return U(e,"Iterator")}function U(e,t){return ee(e)&&g in e&&e[g]===t}function TO(e){return Me(e)&&ie(e.const)}function PO(e){return Me(e)&&it(e.const)}function EO(e){return Me(e)&&dr(e.const)}function To(e){return dr(e)||it(e)||ie(e)}function Me(e){return U(e,"Literal")}function at(e){return U(e,"MappedKey")}function pe(e){return U(e,"MappedResult")}function vr(e){return U(e,"Never")}function ud(e){return U(e,"Not")}function Ai(e){return U(e,"Null")}function jt(e){return U(e,"Number")}function Se(e){return U(e,"Object")}function In(e){return U(e,"Promise")}function wn(e){return U(e,"Record")}function $O(e){return ee(e)&&ze in e&&e[ze]==="Recursive"}function Oe(e){return U(e,"Ref")}function bs(e){return U(e,"RegExp")}function br(e){return U(e,"String")}function vi(e){return U(e,"Symbol")}function st(e){return U(e,"TemplateLiteral")}function dd(e){return U(e,"This")}function z(e){return ee(e)&&ue in e}function ct(e){return U(e,"Tuple")}function Or(e){return U(e,"Undefined")}function K(e){return U(e,"Union")}function fd(e){return U(e,"Uint8Array")}function hd(e){return U(e,"Unknown")}function gd(e){return U(e,"Unsafe")}function yd(e){return U(e,"Void")}function Lr(e){return ee(e)&&g in e&&ie(e[g])}function de(e){return gs(e)||ys(e)||Lt(e)||yr(e)||xn(e)||On(e)||Nt(e)||Rt(e)||md(e)||kt(e)||Ft(e)||ge(e)||Sn(e)||Me(e)||at(e)||pe(e)||vr(e)||ud(e)||Ai(e)||jt(e)||Se(e)||In(e)||wn(e)||Oe(e)||bs(e)||br(e)||vi(e)||st(e)||dd(e)||ct(e)||Or(e)||K(e)||fd(e)||hd(e)||gd(e)||yd(e)||Lr(e)}var d={};nt(d,{IsAny:()=>Sd,IsArgument:()=>Id,IsArray:()=>wd,IsAsyncIterator:()=>Cd,IsBigInt:()=>Td,IsBoolean:()=>Pd,IsComputed:()=>Ed,IsConstructor:()=>$d,IsDate:()=>Ad,IsFunction:()=>vd,IsImport:()=>kO,IsInteger:()=>Ld,IsIntersect:()=>Nd,IsIterator:()=>Rd,IsKind:()=>af,IsKindOf:()=>_,IsLiteral:()=>Eo,IsLiteralBoolean:()=>FO,IsLiteralNumber:()=>Fd,IsLiteralString:()=>kd,IsLiteralValue:()=>jd,IsMappedKey:()=>Ud,IsMappedResult:()=>_d,IsNever:()=>Dd,IsNot:()=>Md,IsNull:()=>Bd,IsNumber:()=>Vd,IsObject:()=>Kd,IsOptional:()=>RO,IsPromise:()=>Gd,IsProperties:()=>Os,IsReadonly:()=>NO,IsRecord:()=>qd,IsRecursive:()=>jO,IsRef:()=>Wd,IsRegExp:()=>Hd,IsSchema:()=>Re,IsString:()=>zd,IsSymbol:()=>Jd,IsTemplateLiteral:()=>Yd,IsThis:()=>Qd,IsTransform:()=>Xd,IsTuple:()=>Zd,IsUint8Array:()=>tf,IsUndefined:()=>ef,IsUnion:()=>El,IsUnionLiteral:()=>UO,IsUnknown:()=>rf,IsUnsafe:()=>nf,IsVoid:()=>of,TypeGuardUnknownTypeError:()=>Cl});var Cl=class extends A{},AO=["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 bd(e){try{return new RegExp(e),!0}catch{return!1}}function Tl(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 Od(e){return Pl(e)||Re(e)}function Po(e){return we(e)||bo(e)}function oe(e){return we(e)||it(e)}function Pl(e){return we(e)||dr(e)}function re(e){return we(e)||ie(e)}function vO(e){return we(e)||ie(e)&&Tl(e)&&bd(e)}function LO(e){return we(e)||ie(e)&&Tl(e)}function xd(e){return we(e)||Re(e)}function NO(e){return ee(e)&&e[vt]==="Readonly"}function RO(e){return ee(e)&&e[Ne]==="Optional"}function Sd(e){return _(e,"Any")&&re(e.$id)}function Id(e){return _(e,"Argument")&&it(e.index)}function wd(e){return _(e,"Array")&&e.type==="array"&&re(e.$id)&&Re(e.items)&&oe(e.minItems)&&oe(e.maxItems)&&Pl(e.uniqueItems)&&xd(e.contains)&&oe(e.minContains)&&oe(e.maxContains)}function Cd(e){return _(e,"AsyncIterator")&&e.type==="AsyncIterator"&&re(e.$id)&&Re(e.items)}function Td(e){return _(e,"BigInt")&&e.type==="bigint"&&re(e.$id)&&Po(e.exclusiveMaximum)&&Po(e.exclusiveMinimum)&&Po(e.maximum)&&Po(e.minimum)&&Po(e.multipleOf)}function Pd(e){return _(e,"Boolean")&&e.type==="boolean"&&re(e.$id)}function Ed(e){return _(e,"Computed")&&ie(e.target)&&Ie(e.parameters)&&e.parameters.every(t=>Re(t))}function $d(e){return _(e,"Constructor")&&e.type==="Constructor"&&re(e.$id)&&Ie(e.parameters)&&e.parameters.every(t=>Re(t))&&Re(e.returns)}function Ad(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 vd(e){return _(e,"Function")&&e.type==="Function"&&re(e.$id)&&Ie(e.parameters)&&e.parameters.every(t=>Re(t))&&Re(e.returns)}function kO(e){return _(e,"Import")&&ds(e,"$defs")&&ee(e.$defs)&&Os(e.$defs)&&ds(e,"$ref")&&ie(e.$ref)&&e.$ref in e.$defs}function Ld(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 Os(e){return ee(e)&&Object.entries(e).every(([t,r])=>Tl(t)&&Re(r))}function Nd(e){return _(e,"Intersect")&&!(ie(e.type)&&e.type!=="object")&&Ie(e.allOf)&&e.allOf.every(t=>Re(t)&&!Xd(t))&&re(e.type)&&(Pl(e.unevaluatedProperties)||xd(e.unevaluatedProperties))&&re(e.$id)}function Rd(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 kd(e){return Eo(e)&&ie(e.const)}function Fd(e){return Eo(e)&&it(e.const)}function FO(e){return Eo(e)&&dr(e.const)}function Eo(e){return _(e,"Literal")&&re(e.$id)&&jd(e.const)}function jd(e){return dr(e)||it(e)||ie(e)}function Ud(e){return _(e,"MappedKey")&&Ie(e.keys)&&e.keys.every(t=>it(t)||ie(t))}function _d(e){return _(e,"MappedResult")&&Os(e.properties)}function Dd(e){return _(e,"Never")&&ee(e.not)&&Object.getOwnPropertyNames(e.not).length===0}function Md(e){return _(e,"Not")&&Re(e.not)}function Bd(e){return _(e,"Null")&&e.type==="null"&&re(e.$id)}function Vd(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 Kd(e){return _(e,"Object")&&e.type==="object"&&re(e.$id)&&Os(e.properties)&&Od(e.additionalProperties)&&oe(e.minProperties)&&oe(e.maxProperties)}function Gd(e){return _(e,"Promise")&&e.type==="Promise"&&re(e.$id)&&Re(e.item)}function qd(e){return _(e,"Record")&&e.type==="object"&&re(e.$id)&&Od(e.additionalProperties)&&ee(e.patternProperties)&&(t=>{let r=Object.getOwnPropertyNames(t.patternProperties);return r.length===1&&bd(r[0])&&ee(t.patternProperties)&&Re(t.patternProperties[r[0]])})(e)}function jO(e){return ee(e)&&ze in e&&e[ze]==="Recursive"}function Wd(e){return _(e,"Ref")&&re(e.$id)&&ie(e.$ref)}function Hd(e){return _(e,"RegExp")&&re(e.$id)&&ie(e.source)&&ie(e.flags)&&oe(e.maxLength)&&oe(e.minLength)}function zd(e){return _(e,"String")&&e.type==="string"&&re(e.$id)&&oe(e.minLength)&&oe(e.maxLength)&&vO(e.pattern)&&LO(e.format)}function Jd(e){return _(e,"Symbol")&&e.type==="symbol"&&re(e.$id)}function Yd(e){return _(e,"TemplateLiteral")&&e.type==="string"&&ie(e.pattern)&&e.pattern[0]==="^"&&e.pattern[e.pattern.length-1]==="$"}function Qd(e){return _(e,"This")&&re(e.$id)&&ie(e.$ref)}function Xd(e){return ee(e)&&ue in e}function Zd(e){return _(e,"Tuple")&&e.type==="array"&&re(e.$id)&&it(e.minItems)&&it(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 ef(e){return _(e,"Undefined")&&e.type==="undefined"&&re(e.$id)}function UO(e){return El(e)&&e.anyOf.every(t=>kd(t)||Fd(t))}function El(e){return _(e,"Union")&&re(e.$id)&&ee(e)&&Ie(e.anyOf)&&e.anyOf.every(t=>Re(t))}function tf(e){return _(e,"Uint8Array")&&e.type==="Uint8Array"&&re(e.$id)&&oe(e.minByteLength)&&oe(e.maxByteLength)}function rf(e){return _(e,"Unknown")&&re(e.$id)}function nf(e){return _(e,"Unsafe")}function of(e){return _(e,"Void")&&e.type==="void"&&re(e.$id)}function af(e){return ee(e)&&g in e&&ie(e[g])&&!AO.includes(e[g])}function Re(e){return ee(e)&&(Sd(e)||Id(e)||wd(e)||Pd(e)||Td(e)||Cd(e)||Ed(e)||$d(e)||Ad(e)||vd(e)||Ld(e)||Nd(e)||Rd(e)||Eo(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)||Jd(e)||Yd(e)||Qd(e)||Zd(e)||ef(e)||El(e)||tf(e)||rf(e)||nf(e)||of(e)||af(e))}function _O(e){return(parseInt(e)+1).toString()}var xs="(true|false)",Li="(0|[1-9][0-9]*)",Ss="(.*)",sf="(?!.*)",DO=`^${xs}$`,Nr=`^${Li}$`,Rr=`^${Ss}$`,$l=`^${sf}$`;var Ut={};nt(Ut,{Clear:()=>BO,Delete:()=>VO,Entries:()=>MO,Get:()=>qO,Has:()=>KO,Set:()=>GO});var Ni=new Map;function MO(){return new Map(Ni)}function BO(){return Ni.clear()}function VO(e){return Ni.delete(e)}function KO(e){return Ni.has(e)}function GO(e,t){Ni.set(e,t)}function qO(e){return Ni.get(e)}var _t={};nt(_t,{Clear:()=>HO,Delete:()=>zO,Entries:()=>WO,Get:()=>QO,Has:()=>JO,Set:()=>YO});var Ri=new Map;function WO(){return new Map(Ri)}function HO(){return Ri.clear()}function zO(e){return Ri.delete(e)}function JO(e){return Ri.has(e)}function YO(e,t){Ri.set(e,t)}function QO(e){return Ri.get(e)}function Is(e,t){return e.includes(t)}function XO(e,t){return e.every(r=>Is(t,r))}function Al(e){return[...new Set(e)]}function cf(e,t){return e.filter(r=>t.includes(r))}function ZO(e,t){return[...e,...t]}function ex(e,t){return e.filter(r=>!t.includes(r))}function tx(e,t){return e.reduce((r,i)=>cf(r,i),t)}function vl(e){return e.length===1?e[0]:e.length>1?tx(e.slice(1),e[0]):[]}function Ll(e){let t=[];for(let r of e)t.push(...r);return t}function Qt(e){return y({[g]:"Any"},e)}function kr(e,t){return y({[g]:"Array",type:"array",items:e},t)}function $o(e){return y({[g]:"Argument",index:e})}function Fr(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 rx(e,t){let{[t]:r,...i}=e;return i}function xe(e,t){return t.reduce((r,i)=>rx(r,i),e)}function k(e){return y({[g]:"Never",not:{}},e)}function nx(e){return y({[g]:"MappedKey",keys:e})}function W(e){return y({[g]:"MappedResult",properties:e})}function jr(e,t,r){return y({[g]:"Constructor",type:"Constructor",parameters:e,returns:t},r)}function yt(e,t,r){return y({[g]:"Function",type:"Function",parameters:e,returns:t},r)}function Ao(e,t){return y({[g]:"Union",anyOf:e},t)}function ix(e){return e.some(t=>Je(t))}function lf(e){return e.map(t=>Je(t)?ox(t):t)}function ox(e){return xe(e,[Ne])}function ax(e,t){return ix(e)?$e(Ao(lf(e),t)):Ao(lf(e),t)}function Xt(e,t){return e.length===1?y(e[0],t):e.length===0?k(t):ax(e,t)}function G(e,t){return e.length===0?k(t):e.length===1?y(e[0],t):Ao(e,t)}var vo=class extends A{};function sx(e){return e.replace(/\\\\\\$/g,"$").replace(/\\\\\\*/g,"*").replace(/\\\\\\^/g,"^").replace(/\\\\\\|/g,"|").replace(/\\\\\\(/g,"(").replace(/\\\\\\)/g,")")}function Nl(e,t,r){return e[t]===r&&e.charCodeAt(t-1)!==92}function Ur(e,t){return Nl(e,t,"(")}function Lo(e,t){return Nl(e,t,")")}function pf(e,t){return Nl(e,t,"|")}function cx(e){if(!(Ur(e,0)&&Lo(e,e.length-1)))return!1;let t=0;for(let r=0;r<e.length;r++)if(Ur(e,r)&&(t+=1),Lo(e,r)&&(t-=1),t===0&&r!==e.length-1)return!1;return!0}function lx(e){return e.slice(1,e.length-1)}function px(e){let t=0;for(let r=0;r<e.length;r++)if(Ur(e,r)&&(t+=1),Lo(e,r)&&(t-=1),pf(e,r)&&t===0)return!0;return!1}function mx(e){for(let t=0;t<e.length;t++)if(Ur(e,t))return!0;return!1}function ux(e){let[t,r]=[0,0],i=[];for(let a=0;a<e.length;a++)if(Ur(e,a)&&(t+=1),Lo(e,a)&&(t-=1),pf(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 dx(e){function t(o,a){if(!Ur(o,a))throw new vo("TemplateLiteralParser: Index must point to open parens");let s=0;for(let c=a;c<o.length;c++)if(Ur(o,c)&&(s+=1),Lo(o,c)&&(s-=1),s===0)return[a,c];throw new vo("TemplateLiteralParser: Unclosed group parens in expression")}function r(o,a){for(let s=a;s<o.length;s++)if(Ur(o,s))return[a,s];return[a,o.length]}let i=[];for(let o=0;o<e.length;o++)if(Ur(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 cx(e)?Qn(lx(e)):px(e)?ux(e):mx(e)?dx(e):{type:"const",const:sx(e)}}function Xn(e){return Qn(e.slice(1,e.length-1))}var ws=class extends A{};function fx(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 hx(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 gx(e){return e.type==="const"&&e.const===".*"}function Cn(e){return fx(e)||gx(e)?!1:hx(e)?!0:e.type==="and"?e.expr.every(t=>Cn(t)):e.type==="or"?e.expr.every(t=>Cn(t)):e.type==="const"?!0:(()=>{throw new ws("Unknown expression type")})()}function No(e){let t=Xn(e.pattern);return Cn(t)}var Cs=class extends A{};function*mf(e){if(e.length===1)return yield*e[0];for(let t of e[0])for(let r of mf(e.slice(1)))yield`${t}${r}`}function*yx(e){return yield*mf(e.expr.map(t=>[...ki(t)]))}function*bx(e){for(let t of e.expr)yield*ki(t)}function*Ox(e){return yield e.const}function*ki(e){return e.type==="and"?yield*yx(e):e.type==="or"?yield*bx(e):e.type==="const"?yield*Ox(e):(()=>{throw new Cs("Unknown expression")})()}function Zn(e){let t=Xn(e.pattern);return Cn(t)?[...ki(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 _r(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*xx(e){let t=e.trim().replace(/"|\'/g,"");return t==="boolean"?yield ei():t==="number"?yield Ye():t==="bigint"?yield _r():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*Sx(e){if(e[1]!=="{"){let t=j("$"),r=Rl(e.slice(1));return yield*[t,...r]}for(let t=2;t<e.length;t++)if(e[t]==="}"){let r=xx(e.slice(2,t)),i=Rl(e.slice(t+1));return yield*[...r,...i]}yield j(e)}function*Rl(e){for(let t=0;t<e.length;t++)if(e[t]==="$"){let r=j(e.slice(0,t)),i=Sx(e.slice(t));return yield*[r,...i]}yield j(e)}function kl(e){return[...Rl(e)]}var Ts=class extends A{};function Ix(e){return e.replace(/[.*+?^${}()|[\\]\\\\]/g,"\\\\$&")}function uf(e,t){return st(e)?e.pattern.slice(1,e.pattern.length-1):K(e)?`(${e.anyOf.map(r=>uf(r,t)).join("|")})`:jt(e)?`${t}${Li}`:Ft(e)?`${t}${Li}`:xn(e)?`${t}${Li}`:br(e)?`${t}${Ss}`:Me(e)?`${t}${Ix(e.const.toString())}`:yr(e)?`${t}${xs}`:(()=>{throw new Ts(`Unexpected Kind \'${e[g]}\'`)})()}function Ps(e){return`^${e.map(t=>uf(t,"")).join("")}$`}function Tn(e){let r=Zn(e).map(i=>j(i));return Xt(r)}function ti(e,t){let r=ie(e)?Ps(kl(e)):Ps(e);return y({[g]:"TemplateLiteral",type:"string",pattern:r},t)}function wx(e){return Zn(e).map(r=>r.toString())}function Cx(e){let t=[];for(let r of e)t.push(...Qe(r));return t}function Tx(e){return[e.toString()]}function Qe(e){return[...new Set(st(e)?wx(e):K(e)?Cx(e.anyOf):Me(e)?Tx(e.const):jt(e)?["[number]"]:Ft(e)?["[number]"]:[])]}function Px(e,t,r){let i={};for(let o of Object.getOwnPropertyNames(t))i[o]=Zt(e,Qe(t[o]),r);return i}function Ex(e,t,r){return Px(e,t.properties,r)}function Fl(e,t,r){let i=Ex(e,t,r);return W(i)}function ff(e,t){return e.map(r=>jl(r,t))}function $x(e){return e.filter(t=>!vr(t))}function Ax(e,t){return Ro($x(ff(e,t)))}function vx(e){return e.some(t=>vr(t))?[]:e}function Lx(e,t){return Xt(vx(ff(e,t)))}function Nx(e,t){return t in e?e[t]:t==="[number]"?Xt(e):k()}function Rx(e,t){return t==="[number]"?e:k()}function kx(e,t){return t in e?e[t]:k()}function jl(e,t){return ge(e)?Ax(e.allOf,t):K(e)?Lx(e.anyOf,t):ct(e)?Nx(e.items??[],t):Lt(e)?Rx(e.items,t):Se(e)?kx(e.properties,t):k()}function Fi(e,t){return t.map(r=>jl(e,r))}function df(e,t){return Xt(Fi(e,t))}function Fx(e,t){return ae("Index",[e,t])}function Zt(e,t,r){if(Oe(e)||Oe(t)){let i="Index types using Ref parameters require both Type and Key to be of TSchema";if(!de(e)||!de(t))throw new A(i);return ae("Index",[e,t])}return pe(t)?Fl(e,t,r):at(t)?Ul(e,t,r):y(de(t)?df(e,Qe(t)):df(e,t),r)}function jx(e,t,r){return{[t]:Zt(e,[t],se(r))}}function Ux(e,t,r){return t.reduce((i,o)=>({...i,...jx(e,o,r)}),{})}function _x(e,t,r){return Ux(e,t.keys,r)}function Ul(e,t,r){let i=_x(e,t,r);return W(i)}function Dr(e,t){return y({[g]:"Iterator",type:"Iterator",items:e},t)}function Dx(e){let t=[];for(let r in e)Je(e[r])||t.push(r);return t}function Mx(e,t){let r=Dx(e),i=r.length>0?{[g]:"Object",type:"object",properties:e,required:r}:{[g]:"Object",type:"object",properties:e};return y(i,t)}var q=Mx;function ri(e,t){return y({[g]:"Promise",type:"Promise",item:e},t)}function Bx(e){return y(xe(e,[vt]))}function Vx(e){return y({...e,[vt]:"Readonly"})}function Kx(e,t){return t===!1?Bx(e):Vx(e)}function Be(e,t){let r=t??!0;return pe(e)?_l(e,r):Kx(e,r)}function Gx(e,t){let r={};for(let i of globalThis.Object.getOwnPropertyNames(e))r[i]=Be(e[i],t);return r}function qx(e,t){return Gx(e.properties,t)}function _l(e,t){let r=qx(e,t);return W(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 hf(e,t){return e in t?Dt(e,t[e]):W(t)}function Wx(e){return{[e]:j(e)}}function Hx(e){let t={};for(let r of e)t[r]=j(r);return t}function zx(e,t){return Is(t,e)?Wx(e):Hx(t)}function Jx(e,t){let r=zx(e,t);return hf(e,r)}function ko(e,t){return t.map(r=>Dt(e,r))}function Yx(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)?$e(Dt(e,xe(t,[Ne]))):Yn(t)?Be(Dt(e,xe(t,[vt]))):pe(t)?hf(e,t.properties):at(t)?Jx(e,t.keys):Rt(t)?jr(ko(e,t.parameters),Dt(e,t.returns),r):kt(t)?yt(ko(e,t.parameters),Dt(e,t.returns),r):On(t)?Fr(Dt(e,t.items),r):Sn(t)?Dr(Dt(e,t.items),r):ge(t)?Ae(ko(e,t.allOf),r):K(t)?G(ko(e,t.anyOf),r):ct(t)?Xe(ko(e,t.items??[]),r):Se(t)?q(Yx(e,t.properties),r):Lt(t)?kr(Dt(e,t.items),r):In(t)?ri(Dt(e,t.item),r):t}function gf(e,t){let r={};for(let i of e)r[i]=Dt(i,t);return r}function Fo(e,t,r){let i=de(e)?Qe(e):e,o=t({[g]:"MappedKey",keys:i}),a=gf(i,o);return q(a,r)}function Qx(e){return y(xe(e,[Ne]))}function Xx(e){return y({...e,[Ne]:"Optional"})}function Zx(e,t){return t===!1?Qx(e):Xx(e)}function $e(e,t){let r=t??!0;return pe(e)?Dl(e,r):Zx(e,r)}function eS(e,t){let r={};for(let i of globalThis.Object.getOwnPropertyNames(e))r[i]=$e(e[i],t);return r}function tS(e,t){return eS(e.properties,t)}function Dl(e,t){let r=tS(e,t);return W(r)}function jo(e,t={}){let r=e.every(o=>Se(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 rS(e){return e.every(t=>Je(t))}function nS(e){return xe(e,[Ne])}function yf(e){return e.map(t=>Je(t)?nS(t):t)}function iS(e,t){return rS(e)?$e(jo(yf(e),t)):jo(yf(e),t)}function Ro(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 iS(e,t)}function Ae(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 jo(e,t)}function bt(...e){let[t,r]=typeof e[0]=="string"?[e[0],e[1]]:[e[0].$id,e[1]];if(typeof t!="string")throw new A("Ref: $ref must be a string");return y({[g]:"Ref",$ref:t},r)}function oS(e,t){return ae("Awaited",[ae(e,t)])}function aS(e){return ae("Awaited",[bt(e)])}function sS(e){return Ae(bf(e))}function cS(e){return G(bf(e))}function lS(e){return Mr(e)}function bf(e){return e.map(t=>Mr(t))}function Mr(e,t){return y(Nt(e)?oS(e.target,e.parameters):ge(e)?sS(e.allOf):K(e)?cS(e.anyOf):In(e)?lS(e.item):Oe(e)?aS(e.$ref):e,t)}function Of(e){let t=[];for(let r of e)t.push(Ze(r));return t}function pS(e){let t=Of(e);return Ll(t)}function mS(e){let t=Of(e);return vl(t)}function uS(e){return e.map((t,r)=>r.toString())}function dS(e){return["[number]"]}function fS(e){return globalThis.Object.getOwnPropertyNames(e)}function hS(e){return Ml?globalThis.Object.getOwnPropertyNames(e).map(r=>r[0]==="^"&&r[r.length-1]==="$"?r.slice(1,r.length-1):r):[]}function Ze(e){return ge(e)?pS(e.allOf):K(e)?mS(e.anyOf):ct(e)?uS(e.items??[]):Lt(e)?dS(e.items):Se(e)?fS(e.properties):wn(e)?hS(e.patternProperties):[]}var Ml=!1;function ni(e){Ml=!0;let t=Ze(e);return Ml=!1,`^(${t.map(i=>`(${i})`).join("|")})$`}function gS(e,t){return ae("KeyOf",[ae(e,t)])}function yS(e){return ae("KeyOf",[bt(e)])}function bS(e,t){let r=Ze(e),i=xf(r),o=Xt(i);return y(o,t)}function xf(e){return e.map(t=>t==="[number]"?Ye():j(t))}function Br(e,t){return Nt(e)?gS(e.target,e.parameters):Oe(e)?yS(e.$ref):pe(e)?Bl(e,t):bS(e,t)}function OS(e,t){let r={};for(let i of globalThis.Object.getOwnPropertyNames(e))r[i]=Br(e[i],se(t));return r}function xS(e,t){return OS(e.properties,t)}function Bl(e,t){let r=xS(e,t);return W(r)}function Uo(e){let t=Ze(e),r=Fi(e,t);return t.map((i,o)=>[t[o],r[o]])}function SS(e){let t=[];for(let r of e)t.push(...Ze(r));return Al(t)}function IS(e){return e.filter(t=>!vr(t))}function wS(e,t){let r=[];for(let i of e)r.push(...Fi(i,[t]));return IS(r)}function CS(e,t){let r={};for(let i of t)r[i]=Ro(wS(e,i));return r}function _o(e,t){let r=SS(e),i=CS(e,r);return q(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 lt(e){return y({[g]:"Unknown"},e)}function TS(e){return e.map(t=>Vl(t,!1))}function PS(e){let t={};for(let r of globalThis.Object.getOwnPropertyNames(e))t[r]=Be(Vl(e[r],!1));return t}function Es(e,t){return t===!0?e:Be(e)}function Vl(e,t){return yl(e)?Es(Qt(),t):Ol(e)?Es(Qt(),t):Ie(e)?Be(Xe(TS(e))):Ar(e)?ci():zn(e)?ii():ee(e)?Es(q(PS(e)),t):bl(e)?Es(yt([],lt()),t):we(e)?si():xl(e)?oi():Sl(e)?ai():bo(e)?_r():it(e)?j(e):dr(e)?j(e):ie(e)?j(e):q({})}function Do(e,t){return y(Vl(e,!0),t)}function Mo(e,t){return Rt(e)?Xe(e.parameters,t):k(t)}function Bo(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 G(o,{...t,[ze]:"Enum"})}var $s=class extends A{},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 ji(e){throw new $s(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)?Ef(e,t):d.IsIntersect(t)?As(e,t):d.IsUnion(t)?Hl(e,t):d.IsUnknown(t)?Lf(e,t):d.IsAny(t)?Wl(e,t):ji("StructuralRight")}function Wl(e,t){return b.True}function ES(e,t){return d.IsIntersect(t)?As(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 $S(e,t){return d.IsUnknown(e)?b.False:d.IsAny(e)?b.Union:d.IsNever(e)?b.True:b.False}function AS(e,t){return d.IsObject(t)&&vs(t)?b.True:Pe(t)?Ee(e,t):d.IsArray(t)?Mt(ne(e.items,t.items)):b.False}function vS(e,t){return Pe(t)?Ee(e,t):d.IsAsyncIterator(t)?Mt(ne(e.items,t.items)):b.False}function LS(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 Tf(e,t){return d.IsLiteralBoolean(e)||d.IsBoolean(e)?b.True:b.False}function NS(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 RS(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 kS(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 FS(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 Pf(e,t){return d.IsLiteral(e)&&De.IsNumber(e.const)||d.IsNumber(e)||d.IsInteger(e)?b.True:b.False}function jS(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 As(e,t){return t.allOf.every(r=>ne(e,r)===b.True)?b.True:b.False}function US(e,t){return e.allOf.some(r=>ne(r,t)===b.True)?b.True:b.False}function _S(e,t){return Pe(t)?Ee(e,t):d.IsIterator(t)?Mt(ne(e.items,t.items)):b.False}function DS(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)?vf(e,t):d.IsNumber(t)?$f(e,t):d.IsInteger(t)?Pf(e,t):d.IsBoolean(t)?Tf(e,t):b.False}function Ef(e,t){return b.False}function MS(e,t){return b.True}function Sf(e){let[t,r]=[e,0];for(;d.IsNot(t);)t=t.not,r+=1;return r%2===0?t:lt()}function BS(e,t){return d.IsNot(e)?ne(Sf(e),t):d.IsNot(t)?ne(e,Sf(t)):ji("Invalid fallthrough for Not")}function VS(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 $f(e,t){return d.IsLiteralNumber(e)||d.IsNumber(e)||d.IsInteger(e)?b.True:b.False}function KS(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 pt(e,t){return Object.getOwnPropertyNames(e.properties).length===t}function If(e){return vs(e)}function wf(e){return pt(e,0)||pt(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 Kl(e){return pt(e,0)}function Cf(e){return pt(e,0)}function GS(e){return pt(e,0)}function qS(e){return pt(e,0)}function WS(e){return vs(e)}function HS(e){let t=Ye();return pt(e,0)||pt(e,1)&&"length"in e.properties&&Mt(ne(e.properties.length,t))===b.True}function zS(e){return pt(e,0)}function vs(e){let t=Ye();return pt(e,0)||pt(e,1)&&"length"in e.properties&&Mt(ne(e.properties.length,t))===b.True}function JS(e){let t=yt([Qt()],Qt());return pt(e,0)||pt(e,1)&&"then"in e.properties&&Mt(ne(e.properties.then,t))===b.True}function Af(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)&&If(t)||d.IsLiteralNumber(e)&&Kl(t)||d.IsLiteralBoolean(e)&&Cf(t)||d.IsSymbol(e)&&wf(t)||d.IsBigInt(e)&&GS(t)||d.IsString(e)&&If(t)||d.IsSymbol(e)&&wf(t)||d.IsNumber(e)&&Kl(t)||d.IsInteger(e)&&Kl(t)||d.IsBoolean(e)&&Cf(t)||d.IsUint8Array(e)&&WS(t)||d.IsDate(e)&&qS(t)||d.IsConstructor(e)&&zS(t)||d.IsFunction(e)&&HS(t)?b.True:d.IsRecord(e)&&d.IsString(Gl(e))?t[ze]==="Record"?b.True:b.False:d.IsRecord(e)&&d.IsNumber(Gl(e))?pt(t,0)?b.True:b.False:b.False}function YS(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(Af(e.properties[r],t.properties[r])===b.False)return b.False}return b.True})():b.False}function QS(e,t){return Pe(t)?Ee(e,t):d.IsObject(t)&&JS(t)?b.True:d.IsPromise(t)?Mt(ne(e.item,t.item)):b.False}function Gl(e){return Nr in e.patternProperties?Ye():Rr in e.patternProperties?ke():ji("Unknown record key pattern")}function ql(e){return Nr in e.patternProperties?e.patternProperties[Nr]:Rr in e.patternProperties?e.patternProperties[Rr]:ji("Unable to get record value schema")}function Bt(e,t){let[r,i]=[Gl(t),ql(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(Af(i,e.properties[o])===b.False)return b.False;return b.True})():b.False}function XS(e,t){return Pe(t)?Ee(e,t):d.IsObject(t)?qe(e,t):d.IsRecord(t)?ne(ql(e),ql(t)):b.False}function ZS(e,t){let r=d.IsRegExp(e)?ke():e,i=d.IsRegExp(t)?ke():t;return ne(r,i)}function vf(e,t){return d.IsLiteral(e)&&De.IsString(e.const)||d.IsString(e)?b.True:b.False}function eI(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 tI(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 rI(e,t){return d.IsTemplateLiteral(e)?ne(Tn(e),t):d.IsTemplateLiteral(t)?ne(e,Tn(t)):ji("Invalid fallthrough for TemplateLiteral")}function nI(e,t){return d.IsArray(t)&&e.items!==void 0&&e.items.every(r=>ne(r,t.items)===b.True)}function iI(e,t){return d.IsNever(e)?b.True:d.IsUnknown(e)?b.False:d.IsAny(e)?b.Union:b.False}function oI(e,t){return Pe(t)?Ee(e,t):d.IsObject(t)&&vs(t)||d.IsArray(t)&&nI(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 aI(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 sI(e,t){return Pe(t)?Ee(e,t):d.IsObject(t)?qe(e,t):d.IsRecord(t)?Bt(e,t):d.IsVoid(t)?pI(e,t):d.IsUndefined(t)?b.True:b.False}function Hl(e,t){return t.anyOf.some(r=>ne(e,r)===b.True)?b.True:b.False}function cI(e,t){return e.anyOf.every(r=>ne(r,t)===b.True)?b.True:b.False}function Lf(e,t){return b.True}function lI(e,t){return d.IsNever(t)?Ef(e,t):d.IsIntersect(t)?As(e,t):d.IsUnion(t)?Hl(e,t):d.IsAny(t)?Wl(e,t):d.IsString(t)?vf(e,t):d.IsNumber(t)?$f(e,t):d.IsInteger(t)?Pf(e,t):d.IsBoolean(t)?Tf(e,t):d.IsArray(t)?$S(e,t):d.IsTuple(t)?iI(e,t):d.IsObject(t)?qe(e,t):d.IsUnknown(t)?b.True:b.False}function pI(e,t){return d.IsUndefined(e)||d.IsUndefined(e)?b.True:b.False}function mI(e,t){return d.IsIntersect(t)?As(e,t):d.IsUnion(t)?Hl(e,t):d.IsUnknown(t)?Lf(e,t):d.IsAny(t)?Wl(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)?rI(e,t):d.IsRegExp(e)||d.IsRegExp(t)?ZS(e,t):d.IsNot(e)||d.IsNot(t)?BS(e,t):d.IsAny(e)?ES(e,t):d.IsArray(e)?AS(e,t):d.IsBigInt(e)?LS(e,t):d.IsBoolean(e)?NS(e,t):d.IsAsyncIterator(e)?vS(e,t):d.IsConstructor(e)?RS(e,t):d.IsDate(e)?kS(e,t):d.IsFunction(e)?FS(e,t):d.IsInteger(e)?jS(e,t):d.IsIntersect(e)?US(e,t):d.IsIterator(e)?_S(e,t):d.IsLiteral(e)?DS(e,t):d.IsNever(e)?MS(e,t):d.IsNull(e)?VS(e,t):d.IsNumber(e)?KS(e,t):d.IsObject(e)?YS(e,t):d.IsRecord(e)?XS(e,t):d.IsString(e)?eI(e,t):d.IsSymbol(e)?tI(e,t):d.IsTuple(e)?oI(e,t):d.IsPromise(e)?QS(e,t):d.IsUint8Array(e)?aI(e,t):d.IsUndefined(e)?sI(e,t):d.IsUnion(e)?cI(e,t):d.IsUnknown(e)?lI(e,t):d.IsVoid(e)?mI(e,t):ji(`Unknown left type operand \'${e[g]}\'`)}function Vr(e,t){return ne(e,t)}function uI(e,t,r,i,o){let a={};for(let s of globalThis.Object.getOwnPropertyNames(e))a[s]=Kr(e[s],t,r,i,se(o));return a}function dI(e,t,r,i,o){return uI(e.properties,t,r,i,o)}function zl(e,t,r,i,o){let a=dI(e,t,r,i,o);return W(a)}function fI(e,t,r,i){let o=Vr(e,t);return o===b.Union?G([r,i]):o===b.True?r:i}function Kr(e,t,r,i,o){return pe(e)?zl(e,t,r,i,o):at(e)?y(Jl(e,t,r,i,o)):y(fI(e,t,r,i),o)}function hI(e,t,r,i,o){return{[e]:Kr(j(e),t,r,i,se(o))}}function gI(e,t,r,i,o){return e.reduce((a,s)=>({...a,...hI(s,t,r,i,o)}),{})}function yI(e,t,r,i,o){return gI(e.keys,t,r,i,o)}function Jl(e,t,r,i,o){let a=yI(e,t,r,i,o);return W(a)}function bI(e){return e.allOf.every(t=>Pn(t))}function OI(e){return e.anyOf.some(t=>Pn(t))}function xI(e){return!Pn(e.not)}function Pn(e){return e[g]==="Intersect"?bI(e):e[g]==="Union"?OI(e):e[g]==="Not"?xI(e):e[g]==="Undefined"}function Yl(e,t){return Gr(Tn(e),t)}function SI(e,t){let r=e.filter(i=>Vr(i,t)===b.False);return r.length===1?r[0]:G(r)}function Gr(e,t,r={}){return st(e)?y(Yl(e,t),r):pe(e)?y(Ql(e,t),r):y(K(e)?SI(e.anyOf,t):Vr(e,t)!==b.False?k():e,r)}function II(e,t){let r={};for(let i of globalThis.Object.getOwnPropertyNames(e))r[i]=Gr(e[i],t);return r}function wI(e,t){return II(e.properties,t)}function Ql(e,t){let r=wI(e,t);return W(r)}function Xl(e,t){return qr(Tn(e),t)}function CI(e,t){let r=e.filter(i=>Vr(i,t)!==b.False);return r.length===1?r[0]:G(r)}function qr(e,t,r){return st(e)?y(Xl(e,t),r):pe(e)?y(Zl(e,t),r):y(K(e)?CI(e.anyOf,t):Vr(e,t)!==b.False?e:k(),r)}function TI(e,t){let r={};for(let i of globalThis.Object.getOwnPropertyNames(e))r[i]=qr(e[i],t);return r}function PI(e,t){return TI(e.properties,t)}function Zl(e,t){let r=PI(e,t);return W(r)}function Vo(e,t){return Rt(e)?y(e.returns,t):k(t)}function li(e){return Be($e(e))}function pi(e,t,r){return y({[g]:"Record",type:"object",patternProperties:{[e]:t}},r)}function ep(e,t,r){let i={};for(let o of e)i[o]=t;return q(i,{...r,[ze]:"Record"})}function EI(e,t,r){return No(e)?ep(Qe(e),t,r):pi(e.pattern,t,r)}function $I(e,t,r){return ep(Qe(G(e)),t,r)}function AI(e,t,r){return ep([e.toString()],t,r)}function vI(e,t,r){return pi(e.source,t,r)}function LI(e,t,r){let i=we(e.pattern)?Rr:e.pattern;return pi(i,t,r)}function NI(e,t,r){return pi(Rr,t,r)}function RI(e,t,r){return pi($l,t,r)}function kI(e,t,r){return q({true:t,false:t},r)}function FI(e,t,r){return pi(Nr,t,r)}function jI(e,t,r){return pi(Nr,t,r)}function mi(e,t,r={}){return K(e)?$I(e.anyOf,t,r):st(e)?EI(e,t,r):Me(e)?AI(e.const,t,r):yr(e)?kI(e,t,r):Ft(e)?FI(e,t,r):jt(e)?jI(e,t,r):bs(e)?vI(e,t,r):br(e)?LI(e,t,r):gs(e)?NI(e,t,r):vr(e)?RI(e,t,r):k(r)}function Ko(e){return globalThis.Object.getOwnPropertyNames(e.patternProperties)[0]}function tp(e){let t=Ko(e);return t===Rr?ke():t===Nr?Ye():ke({pattern:t})}function Go(e){return e.patternProperties[Ko(e)]}function UI(e,t){return t.parameters=Ui(e,t.parameters),t.returns=er(e,t.returns),t}function _I(e,t){return t.parameters=Ui(e,t.parameters),t.returns=er(e,t.returns),t}function DI(e,t){return t.allOf=Ui(e,t.allOf),t}function MI(e,t){return t.anyOf=Ui(e,t.anyOf),t}function BI(e,t){return we(t.items)||(t.items=Ui(e,t.items)),t}function VI(e,t){return t.items=er(e,t.items),t}function KI(e,t){return t.items=er(e,t.items),t}function GI(e,t){return t.items=er(e,t.items),t}function qI(e,t){return t.item=er(e,t.item),t}function WI(e,t){let r=YI(e,t.properties);return{...t,...q(r)}}function HI(e,t){let r=er(e,tp(t)),i=er(e,Go(t)),o=mi(r,i);return{...t,...o}}function zI(e,t){return t.index in e?e[t.index]:lt()}function JI(e,t){let r=Yn(t),i=Je(t),o=er(e,t);return r&&i?li(o):r&&!i?Be(o):!r&&i?$e(o):o}function YI(e,t){return globalThis.Object.getOwnPropertyNames(t).reduce((r,i)=>({...r,[i]:JI(e,t[i])}),{})}function Ui(e,t){return t.map(r=>er(e,r))}function er(e,t){return Rt(t)?UI(e,t):kt(t)?_I(e,t):ge(t)?DI(e,t):K(t)?MI(e,t):ct(t)?BI(e,t):Lt(t)?VI(e,t):On(t)?KI(e,t):Sn(t)?GI(e,t):In(t)?qI(e,t):Se(t)?WI(e,t):wn(t)?HI(e,t):ys(t)?zI(e,t):t}function qo(e,t){return er(t,bn(e))}function Wo(e){return y({[g]:"Integer",type:"integer"},e)}function QI(e,t,r){return{[e]:Vt(j(e),t,se(r))}}function XI(e,t,r){return e.reduce((o,a)=>({...o,...QI(a,t,r)}),{})}function ZI(e,t,r){return XI(e.keys,t,r)}function rp(e,t,r){let i=ZI(e,t,r);return W(i)}function e0(e){let[t,r]=[e.slice(0,1),e.slice(1)];return[t.toLowerCase(),r].join("")}function t0(e){let[t,r]=[e.slice(0,1),e.slice(1)];return[t.toUpperCase(),r].join("")}function r0(e){return e.toUpperCase()}function n0(e){return e.toLowerCase()}function i0(e,t,r){let i=Xn(e.pattern);if(!Cn(i))return{...e,pattern:Nf(e.pattern,t)};let s=[...ki(i)].map(p=>j(p)),c=Rf(s,t),l=G(c);return ti([l],r)}function Nf(e,t){return typeof e=="string"?t==="Uncapitalize"?e0(e):t==="Capitalize"?t0(e):t==="Uppercase"?r0(e):t==="Lowercase"?n0(e):e:e.toString()}function Rf(e,t){return e.map(r=>Vt(r,t))}function Vt(e,t,r={}){return at(e)?rp(e,t,r):st(e)?i0(e,t,r):K(e)?G(Rf(e.anyOf,t),r):Me(e)?j(Nf(e.const,t),r):y(e,r)}function Ho(e,t={}){return Vt(e,"Capitalize",t)}function zo(e,t={}){return Vt(e,"Lowercase",t)}function Jo(e,t={}){return Vt(e,"Uncapitalize",t)}function Yo(e,t={}){return Vt(e,"Uppercase",t)}function o0(e,t,r){let i={};for(let o of globalThis.Object.getOwnPropertyNames(e))i[o]=tr(e[o],t,se(r));return i}function a0(e,t,r){return o0(e.properties,t,r)}function np(e,t,r){let i=a0(e,t,r);return W(i)}function s0(e,t){return e.map(r=>ip(r,t))}function c0(e,t){return e.map(r=>ip(r,t))}function l0(e,t){let{[t]:r,...i}=e;return i}function p0(e,t){return t.reduce((r,i)=>l0(r,i),e)}function m0(e,t){let r=xe(e,[ue,"$id","required","properties"]),i=p0(e.properties,t);return q(i,r)}function u0(e){let t=e.reduce((r,i)=>To(i)?[...r,j(i)]:r,[]);return G(t)}function ip(e,t){return ge(e)?Ae(s0(e.allOf,t)):K(e)?G(c0(e.anyOf,t)):Se(e)?m0(e,t):q({})}function tr(e,t,r){let i=Ie(t)?u0(t):t,o=de(t)?Qe(t):t,a=Oe(e),s=Oe(t);return pe(e)?np(e,o,r):at(t)?op(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({...ip(e,o),...r})}function d0(e,t,r){return{[t]:tr(e,[t],se(r))}}function f0(e,t,r){return t.reduce((i,o)=>({...i,...d0(e,o,r)}),{})}function h0(e,t,r){return f0(e,t.keys,r)}function op(e,t,r){let i=h0(e,t,r);return W(i)}function g0(e,t,r){let i={};for(let o of globalThis.Object.getOwnPropertyNames(e))i[o]=rr(e[o],t,se(r));return i}function y0(e,t,r){return g0(e.properties,t,r)}function ap(e,t,r){let i=y0(e,t,r);return W(i)}function b0(e,t){return e.map(r=>sp(r,t))}function O0(e,t){return e.map(r=>sp(r,t))}function x0(e,t){let r={};for(let i of t)i in e&&(r[i]=e[i]);return r}function S0(e,t){let r=xe(e,[ue,"$id","required","properties"]),i=x0(e.properties,t);return q(i,r)}function I0(e){let t=e.reduce((r,i)=>To(i)?[...r,j(i)]:r,[]);return G(t)}function sp(e,t){return ge(e)?Ae(b0(e.allOf,t)):K(e)?G(O0(e.anyOf,t)):Se(e)?S0(e,t):q({})}function rr(e,t,r){let i=Ie(t)?I0(t):t,o=de(t)?Qe(t):t,a=Oe(e),s=Oe(t);return pe(e)?ap(e,o,r):at(t)?cp(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({...sp(e,o),...r})}function w0(e,t,r){return{[t]:rr(e,[t],se(r))}}function C0(e,t,r){return t.reduce((i,o)=>({...i,...w0(e,o,r)}),{})}function T0(e,t,r){return C0(e,t.keys,r)}function cp(e,t,r){let i=T0(e,t,r);return W(i)}function P0(e,t){return ae("Partial",[ae(e,t)])}function E0(e){return ae("Partial",[bt(e)])}function $0(e){let t={};for(let r of globalThis.Object.getOwnPropertyNames(e))t[r]=$e(e[r]);return t}function A0(e){let t=xe(e,[ue,"$id","required","properties"]),r=$0(e.properties);return q(r,t)}function kf(e){return e.map(t=>Ff(t))}function Ff(e){return Nt(e)?P0(e.target,e.parameters):Oe(e)?E0(e.$ref):ge(e)?Ae(kf(e.allOf)):K(e)?G(kf(e.anyOf)):Se(e)?A0(e):xn(e)||yr(e)||Ft(e)||Me(e)||Ai(e)||jt(e)||br(e)||vi(e)||Or(e)?e:q({})}function Wr(e,t){return pe(e)?lp(e,t):y({...Ff(e),...t})}function v0(e,t){let r={};for(let i of globalThis.Object.getOwnPropertyNames(e))r[i]=Wr(e[i],se(t));return r}function L0(e,t){return v0(e.properties,t)}function lp(e,t){let r=L0(e,t);return W(r)}function N0(e,t){return ae("Required",[ae(e,t)])}function R0(e){return ae("Required",[bt(e)])}function k0(e){let t={};for(let r of globalThis.Object.getOwnPropertyNames(e))t[r]=xe(e[r],[Ne]);return t}function F0(e){let t=xe(e,[ue,"$id","required","properties"]),r=k0(e.properties);return q(r,t)}function jf(e){return e.map(t=>Uf(t))}function Uf(e){return Nt(e)?N0(e.target,e.parameters):Oe(e)?R0(e.$ref):ge(e)?Ae(jf(e.allOf)):K(e)?G(jf(e.anyOf)):Se(e)?F0(e):xn(e)||yr(e)||Ft(e)||Me(e)||Ai(e)||jt(e)||br(e)||vi(e)||Or(e)?e:q({})}function Hr(e,t){return pe(e)?pp(e,t):y({...Uf(e),...t})}function j0(e,t){let r={};for(let i of globalThis.Object.getOwnPropertyNames(e))r[i]=Hr(e[i],t);return r}function U0(e,t){return j0(e.properties,t)}function pp(e,t){let r=U0(e,t);return W(r)}function _0(e,t){return t.map(r=>Oe(r)?mp(e,r.$ref):Ot(e,r))}function mp(e,t){return t in e?Oe(e[t])?mp(e,e[t].$ref):Ot(e,e[t]):k()}function D0(e){return Mr(e[0])}function M0(e){return Zt(e[0],e[1])}function B0(e){return Br(e[0])}function V0(e){return Wr(e[0])}function K0(e){return tr(e[0],e[1])}function G0(e){return rr(e[0],e[1])}function q0(e){return Hr(e[0])}function W0(e,t,r){let i=_0(e,r);return t==="Awaited"?D0(i):t==="Index"?M0(i):t==="KeyOf"?B0(i):t==="Partial"?V0(i):t==="Omit"?K0(i):t==="Pick"?G0(i):t==="Required"?q0(i):k()}function H0(e,t){return kr(Ot(e,t))}function z0(e,t){return Fr(Ot(e,t))}function J0(e,t,r){return jr(Qo(e,t),Ot(e,r))}function Y0(e,t,r){return yt(Qo(e,t),Ot(e,r))}function Q0(e,t){return Ae(Qo(e,t))}function X0(e,t){return Dr(Ot(e,t))}function Z0(e,t){return q(globalThis.Object.keys(t).reduce((r,i)=>({...r,[i]:Ot(e,t[i])}),{}))}function ew(e,t){let[r,i]=[Ot(e,Go(t)),Ko(t)],o=bn(t);return o.patternProperties[i]=r,o}function tw(e,t){return Oe(t)?{...mp(e,t.$ref),[ue]:t[ue]}:t}function rw(e,t){return Xe(Qo(e,t))}function nw(e,t){return G(Qo(e,t))}function Qo(e,t){return t.map(r=>Ot(e,r))}function Ot(e,t){return Je(t)?y(Ot(e,xe(t,[Ne])),t):Yn(t)?y(Ot(e,xe(t,[vt])),t):z(t)?y(tw(e,t),t):Lt(t)?y(H0(e,t.items),t):On(t)?y(z0(e,t.items),t):Nt(t)?y(W0(e,t.target,t.parameters)):Rt(t)?y(J0(e,t.parameters,t.returns),t):kt(t)?y(Y0(e,t.parameters,t.returns),t):ge(t)?y(Q0(e,t.allOf),t):Sn(t)?y(X0(e,t.items),t):Se(t)?y(Z0(e,t.properties),t):wn(t)?y(ew(e,t)):ct(t)?y(rw(e,t.items||[]),t):K(t)?y(nw(e,t.anyOf),t):t}function iw(e,t){return t in e?Ot(e,e[t]):k()}function _f(e){return globalThis.Object.getOwnPropertyNames(e).reduce((t,r)=>({...t,[r]:iw(e,r)}),{})}var Ls=class{constructor(t){let r=_f(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 Xo(e){return new Ls(e)}function Zo(e,t){return y({[g]:"Not",not:e},t)}function ea(e,t){return kt(e)?Xe(e.parameters,t):k()}var ow=0;function ta(e,t={}){we(t.$id)&&(t.$id=`T${ow++}`);let r=bn(e({[g]:"This",$ref:`${t.$id}`}));return r.$id=t.$id,y({[ze]:"Recursive",...r},t)}function ra(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 aw(e){return ge(e)?e.allOf:K(e)?e.anyOf:ct(e)?e.items??[]:[]}function na(e){return aw(e)}function ia(e,t){return kt(e)?y(e.returns,t):k(t)}var Ns=class{constructor(t){this.schema=t}Decode(t){return new Rs(this.schema,t)}},Rs=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 oa(e){return new Ns(e)}function aa(e={}){return y({[g]:e[g]??"Unsafe"},e)}function sa(e){return y({[g]:"Void",type:"void"},e)}var _i=class{ReadonlyOptional(t){return li(t)}Readonly(t,r){return Be(t,r??!0)}Optional(t,r){return $e(t,r??!0)}Any(t){return Qt(t)}Array(t,r){return kr(t,r)}Boolean(t){return ei(t)}Capitalize(t,r){return Ho(t,r)}Composite(t,r){return _o(t,r)}Const(t,r){return Do(t,r)}Enum(t,r){return Bo(t,r)}Exclude(t,r,i){return Gr(t,r,i)}Extends(t,r,i,o,a){return Kr(t,r,i,o,a)}Extract(t,r,i){return qr(t,r,i)}Index(t,r,i){return Zt(t,r,i)}Integer(t){return Wo(t)}Intersect(t,r){return Ae(t,r)}KeyOf(t,r){return Br(t,r)}Literal(t,r){return j(t,r)}Lowercase(t,r){return zo(t,r)}Mapped(t,r,i){return Fo(t,r,i)}Module(t){return Xo(t)}Never(t){return k(t)}Not(t,r){return Zo(t,r)}Null(t){return oi(t)}Number(t){return Ye(t)}Object(t,r){return q(t,r)}Omit(t,r,i){return tr(t,r,i)}Partial(t,r){return Wr(t,r)}Pick(t,r,i){return rr(t,r,i)}Record(t,r,i){return mi(t,r,i)}Recursive(t,r){return ta(t,r)}Ref(...t){return bt(t[0],t[1])}Required(t,r){return Hr(t,r)}Rest(t){return na(t)}String(t){return ke(t)}TemplateLiteral(t,r){return ti(t,r)}Transform(t){return oa(t)}Tuple(t,r){return Xe(t,r)}Uncapitalize(t,r){return Jo(t,r)}Union(t,r){return G(t,r)}Unknown(t){return lt(t)}Unsafe(t){return aa(t)}Uppercase(t,r){return Yo(t,r)}};var up={};nt(up,{Any:()=>Qt,Argument:()=>$o,Array:()=>kr,AsyncIterator:()=>Fr,Awaited:()=>Mr,BigInt:()=>_r,Boolean:()=>ei,Capitalize:()=>Ho,Composite:()=>_o,Const:()=>Do,Constructor:()=>jr,ConstructorParameters:()=>Mo,Date:()=>ii,Enum:()=>Bo,Exclude:()=>Gr,Extends:()=>Kr,Extract:()=>qr,Function:()=>yt,Index:()=>Zt,InstanceType:()=>Vo,Instantiate:()=>qo,Integer:()=>Wo,Intersect:()=>Ae,Iterator:()=>Dr,KeyOf:()=>Br,Literal:()=>j,Lowercase:()=>zo,Mapped:()=>Fo,Module:()=>Xo,Never:()=>k,Not:()=>Zo,Null:()=>oi,Number:()=>Ye,Object:()=>q,Omit:()=>tr,Optional:()=>$e,Parameters:()=>ea,Partial:()=>Wr,Pick:()=>rr,Promise:()=>ri,Readonly:()=>Be,ReadonlyOptional:()=>li,Record:()=>mi,Recursive:()=>ta,Ref:()=>bt,RegExp:()=>ra,Required:()=>Hr,Rest:()=>na,ReturnType:()=>ia,String:()=>ke,Symbol:()=>ai,TemplateLiteral:()=>ti,Transform:()=>oa,Tuple:()=>Xe,Uint8Array:()=>ci,Uncapitalize:()=>Jo,Undefined:()=>si,Union:()=>G,Unknown:()=>lt,Unsafe:()=>aa,Uppercase:()=>Yo,Void:()=>sa});var ks=class extends _i{Argument(t){return $o(t)}AsyncIterator(t,r){return Fr(t,r)}Awaited(t,r){return Mr(t,r)}BigInt(t){return _r(t)}ConstructorParameters(t,r){return Mo(t,r)}Constructor(t,r,i){return jr(t,r,i)}Date(t={}){return ii(t)}Function(t,r,i){return yt(t,r,i)}InstanceType(t,r){return Vo(t,r)}Instantiate(t,r){return qo(t,r)}Iterator(t,r){return Dr(t,r)}Parameters(t,r){return ea(t,r)}Promise(t,r){return ri(t,r)}RegExp(t,r){return ra(t,r)}ReturnType(t,r){return ia(t,r)}Symbol(t){return ai(t)}Undefined(t){return si(t)}Uint8Array(t){return ci(t)}Void(t){return sa(t)}};var n=up;var $p={};nt($p,{Assert:()=>ca,AssertError:()=>_s,Cast:()=>Bi,Check:()=>F,Clean:()=>pa,Clone:()=>H,Convert:()=>da,Create:()=>Kt,Decode:()=>bp,Default:()=>ba,Delete:()=>rh,Diff:()=>Sp,Edit:()=>xp,Encode:()=>wp,Equal:()=>An,HasPropertyKey:()=>E,HasTransform:()=>$n,Hash:()=>ui,Insert:()=>eh,IsArray:()=>$,IsAsyncIterator:()=>xo,IsBigInt:()=>At,IsBigInt64Array:()=>OO,IsBigUint64Array:()=>xO,IsBoolean:()=>Jt,IsDate:()=>Ge,IsFloat32Array:()=>yO,IsFloat64Array:()=>bO,IsFunction:()=>hr,IsInstanceObject:()=>lO,IsInt16Array:()=>dO,IsInt32Array:()=>hO,IsInt8Array:()=>mO,IsInteger:()=>wo,IsIterator:()=>So,IsMap:()=>Il,IsNull:()=>fr,IsNumber:()=>le,IsObject:()=>L,IsPromise:()=>Io,IsRegExp:()=>pO,IsSet:()=>wl,IsStandardObject:()=>hs,IsString:()=>X,IsSymbol:()=>gr,IsTypedArray:()=>gt,IsUint16Array:()=>fO,IsUint32Array:()=>gO,IsUint8Array:()=>Jn,IsUint8ClampedArray:()=>uO,IsUndefined:()=>ce,IsValueType:()=>ot,Mutate:()=>Tp,Parse:()=>Ep,ParseDefault:()=>Pp,ParseError:()=>Ia,ParseRegistry:()=>Hs,Patch:()=>Ip,TransformDecode:()=>ha,TransformDecodeCheckError:()=>fa,TransformDecodeError:()=>Ms,TransformEncode:()=>ya,TransformEncodeCheckError:()=>ga,TransformEncodeError:()=>Bs,Update:()=>th,Value:()=>T,ValueCastError:()=>la,ValueCheckUnknownTypeError:()=>js,ValueCreateError:()=>mt,ValueDiffError:()=>xa,ValueErrorIterator:()=>xr,ValueErrorType:()=>h,ValueHashError:()=>Fs,ValueMutateError:()=>Sa,ValuePointer:()=>Gt});function sw(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 cw=sw;function Df(){return cw}var fp=class extends A{constructor(t){super(`Unable to dereference schema with $id \'${t.$ref}\'`),this.schema=t}};function lw(e,t){let r=t.find(i=>i.$id===e.$ref);if(r===void 0)throw new fp(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"?lw(e,t):e}var Fs=class extends A{constructor(t){super("Unable to hash value"),this.value=t}},xt;(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"})(xt||(xt={}));var Di=BigInt("14695981039346656037"),[pw,mw]=[BigInt("1099511628211"),BigInt("18446744073709551616")],uw=Array.from({length:256}).map((e,t)=>BigInt(t)),Mf=new Float64Array(1),Bf=new DataView(Mf.buffer),Vf=new Uint8Array(Mf.buffer);function*dw(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 fw(e){We(xt.Array);for(let t of e)Mi(t)}function hw(e){We(xt.Boolean),We(e?1:0)}function gw(e){We(xt.BigInt),Bf.setBigInt64(0,e);for(let t of Vf)We(t)}function yw(e){We(xt.Date),Mi(e.getTime())}function bw(e){We(xt.Null)}function Ow(e){We(xt.Number),Bf.setFloat64(0,e);for(let t of Vf)We(t)}function xw(e){We(xt.Object);for(let t of globalThis.Object.getOwnPropertyNames(e).sort())Mi(t),Mi(e[t])}function Sw(e){We(xt.String);for(let t=0;t<e.length;t++)for(let r of dw(e.charCodeAt(t)))We(r)}function Iw(e){We(xt.Symbol),Mi(e.description)}function ww(e){We(xt.Uint8Array);for(let t=0;t<e.length;t++)We(e[t])}function Cw(e){return We(xt.Undefined)}function Mi(e){if($(e))return fw(e);if(Jt(e))return hw(e);if(At(e))return gw(e);if(Ge(e))return yw(e);if(fr(e))return bw(e);if(le(e))return Ow(e);if(L(e))return xw(e);if(X(e))return Sw(e);if(gr(e))return Iw(e);if(Jn(e))return ww(e);if(ce(e))return Cw(e);throw new Fs(e)}function We(e){Di=Di^uw[e],Di=Di*pw%mw}function ui(e){return Di=BigInt("14695981039346656037"),Mi(e),Di}var js=class extends A{constructor(t){super("Unknown type"),this.schema=t}};function Tw(e){return e[g]==="Any"||e[g]==="Unknown"}function M(e){return e!==void 0}function Pw(e,t,r){return!0}function Ew(e,t,r){return!0}function $w(e,t,r){if(!$(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 Aw(e,t,r){return xo(r)}function vw(e,t,r){return!(!At(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 Lw(e,t,r){return Jt(r)}function Nw(e,t,r){return je(e.returns,t,r.prototype)}function Rw(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 kw(e,t,r){return hr(r)}function Fw(e,t,r){let i=globalThis.Object.values(e.$defs),o=e.$defs[e.$ref];return je(o,[...t,...i],r)}function jw(e,t,r){return!(!wo(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 Uw(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 _w(e,t,r){return So(r)}function Dw(e,t,r){return r===e.const}function Mw(e,t,r){return!1}function Bw(e,t,r){return!je(e.not,t,r)}function Vw(e,t,r){return fr(r)}function Kw(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 Gw(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])||(Pn(a)||Tw(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 qw(e,t,r){return Io(r)}function Ww(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 Hw(e,t,r){return je(Y(e,t),t,r)}function zw(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 Jw(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 Yw(e,t,r){return gr(r)}function Qw(e,t,r){return X(r)&&new RegExp(e.pattern).test(r)}function Xw(e,t,r){return je(Y(e,t),t,r)}function Zw(e,t,r){if(!$(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 eC(e,t,r){return ce(r)}function tC(e,t,r){return e.anyOf.some(i=>je(i,t,r))}function rC(e,t,r){return!(!Jn(r)||M(e.maxByteLength)&&!(r.length<=e.maxByteLength)||M(e.minByteLength)&&!(r.length>=e.minByteLength))}function nC(e,t,r){return!0}function iC(e,t,r){return Te.IsVoidLike(r)}function oC(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 Pw(o,i,r);case"Argument":return Ew(o,i,r);case"Array":return $w(o,i,r);case"AsyncIterator":return Aw(o,i,r);case"BigInt":return vw(o,i,r);case"Boolean":return Lw(o,i,r);case"Constructor":return Nw(o,i,r);case"Date":return Rw(o,i,r);case"Function":return kw(o,i,r);case"Import":return Fw(o,i,r);case"Integer":return jw(o,i,r);case"Intersect":return Uw(o,i,r);case"Iterator":return _w(o,i,r);case"Literal":return Dw(o,i,r);case"Never":return Mw(o,i,r);case"Not":return Bw(o,i,r);case"Null":return Vw(o,i,r);case"Number":return Kw(o,i,r);case"Object":return Gw(o,i,r);case"Promise":return qw(o,i,r);case"Record":return Ww(o,i,r);case"Ref":return Hw(o,i,r);case"RegExp":return zw(o,i,r);case"String":return Jw(o,i,r);case"Symbol":return Yw(o,i,r);case"TemplateLiteral":return Qw(o,i,r);case"This":return Xw(o,i,r);case"Tuple":return Zw(o,i,r);case"Undefined":return eC(o,i,r);case"Union":return tC(o,i,r);case"Uint8Array":return rC(o,i,r);case"Unknown":return nC(o,i,r);case"Void":return iC(o,i,r);default:if(!_t.Has(o[g]))throw new js(o);return oC(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 hp=class extends A{constructor(t){super("Unknown type"),this.schema=t}};function zr(e){return e.replace(/~/g,"~0").replace(/\\//g,"~1")}function B(e){return e!==void 0}var xr=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:Df()({errorType:e,path:r,schema:t,value:i,errors:o}),errors:o}}function*aC(e,t,r,i){}function*sC(e,t,r,i){}function*cC(e,t,r,i){if(!$(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*lC(e,t,r,i){xo(i)||(yield C(h.AsyncIterator,e,r,i))}function*pC(e,t,r,i){if(!At(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*mC(e,t,r,i){Jt(i)||(yield C(h.Boolean,e,r,i))}function*uC(e,t,r,i){yield*Ue(e.returns,t,r,i.prototype)}function*dC(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*fC(e,t,r,i){hr(i)||(yield C(h.Function,e,r,i))}function*hC(e,t,r,i){let o=globalThis.Object.values(e.$defs),a=e.$defs[e.$ref];yield*Ue(a,[...t,...o],r,i)}function*gC(e,t,r,i){if(!wo(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*yC(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*bC(e,t,r,i){So(i)||(yield C(h.Iterator,e,r,i))}function*OC(e,t,r,i){i!==e.const&&(yield C(h.Literal,e,r,i))}function*xC(e,t,r,i){yield C(h.Never,e,r,i)}function*SC(e,t,r,i){Ue(e.not,t,r,i).next().done===!0&&(yield C(h.Not,e,r,i))}function*IC(e,t,r,i){fr(i)||(yield C(h.Null,e,r,i))}function*wC(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*CC(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}/${zr(c)}`,void 0));if(e.additionalProperties===!1)for(let c of s)a.includes(c)||(yield C(h.ObjectAdditionalProperties,e,`${r}/${zr(c)}`,i[c]));if(typeof e.additionalProperties=="object")for(let c of s)a.includes(c)||(yield*Ue(e.additionalProperties,t,`${r}/${zr(c)}`,i[c]));for(let c of a){let l=e.properties[c];e.required&&e.required.includes(c)?(yield*Ue(l,t,`${r}/${zr(c)}`,i[c]),Pn(e)&&!(c in i)&&(yield C(h.ObjectRequiredProperty,l,`${r}/${zr(c)}`,void 0))):Te.IsExactOptionalProperty(i,c)&&(yield*Ue(l,t,`${r}/${zr(c)}`,i[c]))}}function*TC(e,t,r,i){Io(i)||(yield C(h.Promise,e,r,i))}function*PC(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}/${zr(c)}`,l));if(typeof e.additionalProperties=="object")for(let[c,l]of Object.entries(i))s.test(c)||(yield*Ue(e.additionalProperties,t,`${r}/${zr(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}/${zr(c)}`,l)}}function*EC(e,t,r,i){yield*Ue(Y(e,t),t,r,i)}function*$C(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*AC(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*vC(e,t,r,i){gr(i)||(yield C(h.Symbol,e,r,i))}function*LC(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*NC(e,t,r,i){yield*Ue(Y(e,t),t,r,i)}function*RC(e,t,r,i){if(!$(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*kC(e,t,r,i){ce(i)||(yield C(h.Undefined,e,r,i))}function*FC(e,t,r,i){if(F(e,t,i))return;let o=e.anyOf.map(a=>new xr(Ue(a,t,r,i)));yield C(h.Union,e,r,i,o)}function*jC(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*UC(e,t,r,i){}function*_C(e,t,r,i){Te.IsVoidLike(i)||(yield C(h.Void,e,r,i))}function*DC(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*aC(a,o,r,i);case"Argument":return yield*sC(a,o,r,i);case"Array":return yield*cC(a,o,r,i);case"AsyncIterator":return yield*lC(a,o,r,i);case"BigInt":return yield*pC(a,o,r,i);case"Boolean":return yield*mC(a,o,r,i);case"Constructor":return yield*uC(a,o,r,i);case"Date":return yield*dC(a,o,r,i);case"Function":return yield*fC(a,o,r,i);case"Import":return yield*hC(a,o,r,i);case"Integer":return yield*gC(a,o,r,i);case"Intersect":return yield*yC(a,o,r,i);case"Iterator":return yield*bC(a,o,r,i);case"Literal":return yield*OC(a,o,r,i);case"Never":return yield*xC(a,o,r,i);case"Not":return yield*SC(a,o,r,i);case"Null":return yield*IC(a,o,r,i);case"Number":return yield*wC(a,o,r,i);case"Object":return yield*CC(a,o,r,i);case"Promise":return yield*TC(a,o,r,i);case"Record":return yield*PC(a,o,r,i);case"Ref":return yield*EC(a,o,r,i);case"RegExp":return yield*$C(a,o,r,i);case"String":return yield*AC(a,o,r,i);case"Symbol":return yield*vC(a,o,r,i);case"TemplateLiteral":return yield*LC(a,o,r,i);case"This":return yield*NC(a,o,r,i);case"Tuple":return yield*RC(a,o,r,i);case"Undefined":return yield*kC(a,o,r,i);case"Union":return yield*FC(a,o,r,i);case"Uint8Array":return yield*jC(a,o,r,i);case"Unknown":return yield*UC(a,o,r,i);case"Void":return yield*_C(a,o,r,i);default:if(!_t.Has(a[g]))throw new hp(e);return yield*DC(a,o,r,i)}}function En(...e){let t=e.length===3?Ue(e[0],e[1],"",e[2]):Ue(e[0],[],"",e[1]);return new xr(t)}var MC=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},Gf=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)},gp,Us,qf,_s=class extends A{constructor(t){let r=t.First();super(r===void 0?"Invalid Value":r.message),gp.add(this),Us.set(this,void 0),MC(this,Us,t,"f"),this.error=r}Errors(){return new xr(Gf(this,gp,"m",qf).call(this))}};Us=new WeakMap,gp=new WeakSet,qf=function*(){this.error&&(yield this.error),yield*Gf(this,Us,"f")};function Kf(e,t,r){if(!F(e,t,r))throw new _s(En(e,t,r))}function ca(...e){return e.length===3?Kf(e[0],e[1],e[2]):Kf(e[0],[],e[1])}function BC(e){let t={};for(let r of Object.getOwnPropertyNames(e))t[r]=H(e[r]);for(let r of Object.getOwnPropertySymbols(e))t[r]=H(e[r]);return t}function VC(e){return e.map(t=>H(t))}function KC(e){return e.slice()}function GC(e){return new Map(H([...e.entries()]))}function qC(e){return new Set(H([...e.entries()]))}function WC(e){return new Date(e.toISOString())}function H(e){if($(e))return VC(e);if(Ge(e))return WC(e);if(gt(e))return KC(e);if(Il(e))return GC(e);if(wl(e))return qC(e);if(L(e))return BC(e);if(ot(e))return e;throw new Error("ValueClone: Unable to clone value")}var mt=class extends A{constructor(t,r){super(r),this.schema=t}};function J(e){return hr(e)?e():H(e)}function HC(e,t){return E(e,"default")?J(e.default):{}}function zC(e,t){return{}}function JC(e,t){if(e.uniqueItems===!0&&!E(e,"default"))throw new mt(e,"Array with the uniqueItems constraint requires a default value");if("contains"in e&&!E(e,"default"))throw new mt(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=>St(e.items,t)):[]}function YC(e,t){return E(e,"default")?J(e.default):async function*(){}()}function QC(e,t){return E(e,"default")?J(e.default):BigInt(0)}function XC(e,t){return E(e,"default")?J(e.default):!1}function ZC(e,t){if(E(e,"default"))return J(e.default);{let r=St(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 eT(e,t){return E(e,"default")?J(e.default):e.minimumTimestamp!==void 0?new Date(e.minimumTimestamp):new Date}function tT(e,t){return E(e,"default")?J(e.default):()=>St(e.returns,t)}function rT(e,t){let r=globalThis.Object.values(e.$defs),i=e.$defs[e.$ref];return St(i,[...t,...r])}function nT(e,t){return E(e,"default")?J(e.default):e.minimum!==void 0?e.minimum:0}function iT(e,t){if(E(e,"default"))return J(e.default);{let r=e.allOf.reduce((i,o)=>{let a=St(o,t);return typeof a=="object"?{...i,...a}:a},{});if(!F(e,t,r))throw new mt(e,"Intersect produced invalid value. Consider using a default value.");return r}}function oT(e,t){return E(e,"default")?J(e.default):function*(){}()}function aT(e,t){return E(e,"default")?J(e.default):e.const}function sT(e,t){if(E(e,"default"))return J(e.default);throw new mt(e,"Never types cannot be created. Consider using a default value.")}function cT(e,t){if(E(e,"default"))return J(e.default);throw new mt(e,"Not types must have a default value")}function lT(e,t){return E(e,"default")?J(e.default):null}function pT(e,t){return E(e,"default")?J(e.default):e.minimum!==void 0?e.minimum:0}function mT(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]=St(a,t));return i}}function uT(e,t){return E(e,"default")?J(e.default):Promise.resolve(St(e.item,t))}function dT(e,t){return E(e,"default")?J(e.default):{}}function fT(e,t){return E(e,"default")?J(e.default):St(Y(e,t),t)}function hT(e,t){if(E(e,"default"))return J(e.default);throw new mt(e,"RegExp types cannot be created. Consider using a default value.")}function gT(e,t){if(e.pattern!==void 0){if(E(e,"default"))return J(e.default);throw new mt(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 mt(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 yT(e,t){return E(e,"default")?J(e.default):"value"in e?Symbol.for(e.value):Symbol()}function bT(e,t){if(E(e,"default"))return J(e.default);if(!No(e))throw new mt(e,"Can only create template literals that produce a finite variants. Consider using a default value.");return Zn(e)[0]}function OT(e,t){if(Wf++>ET)throw new mt(e,"Cannot create recursive type as it appears possibly infinite. Consider using a default.");return E(e,"default")?J(e.default):St(Y(e,t),t)}function xT(e,t){return E(e,"default")?J(e.default):e.items===void 0?[]:Array.from({length:e.minItems}).map((r,i)=>St(e.items[i],t))}function ST(e,t){if(E(e,"default"))return J(e.default)}function IT(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 St(e.anyOf[0],t)}function wT(e,t){return E(e,"default")?J(e.default):e.minByteLength!==void 0?new Uint8Array(e.minByteLength):new Uint8Array(0)}function CT(e,t){return E(e,"default")?J(e.default):{}}function TT(e,t){if(E(e,"default"))return J(e.default)}function PT(e,t){if(E(e,"default"))return J(e.default);throw new Error("User defined types must specify a default value")}function St(e,t){let r=Fe(e,t),i=e;switch(i[g]){case"Any":return HC(i,r);case"Argument":return zC(i,r);case"Array":return JC(i,r);case"AsyncIterator":return YC(i,r);case"BigInt":return QC(i,r);case"Boolean":return XC(i,r);case"Constructor":return ZC(i,r);case"Date":return eT(i,r);case"Function":return tT(i,r);case"Import":return rT(i,r);case"Integer":return nT(i,r);case"Intersect":return iT(i,r);case"Iterator":return oT(i,r);case"Literal":return aT(i,r);case"Never":return sT(i,r);case"Not":return cT(i,r);case"Null":return lT(i,r);case"Number":return pT(i,r);case"Object":return mT(i,r);case"Promise":return uT(i,r);case"Record":return dT(i,r);case"Ref":return fT(i,r);case"RegExp":return hT(i,r);case"String":return gT(i,r);case"Symbol":return yT(i,r);case"TemplateLiteral":return bT(i,r);case"This":return OT(i,r);case"Tuple":return xT(i,r);case"Undefined":return ST(i,r);case"Union":return IT(i,r);case"Uint8Array":return wT(i,r);case"Unknown":return CT(i,r);case"Void":return TT(i,r);default:if(!_t.Has(i[g]))throw new mt(i,"Unknown type");return PT(i,r)}}var ET=512,Wf=0;function Kt(...e){return Wf=0,e.length===2?St(e[0],e[1]):St(e[0],[])}var la=class extends A{constructor(t,r){super(r),this.schema=t}};function Hf(e,t,r){if(e[g]==="Object"&&typeof r=="object"&&!fr(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=>Hf(a,t,r));return Math.max(...o)}else return F(e,t,r)?1:0}function $T(e,t,r){let i=e.anyOf.map(s=>Y(s,t)),[o,a]=[i[0],0];for(let s of i){let c=Hf(s,t,r);c>a&&(o=s,a=c)}return o}function AT(e,t,r){if("default"in e)return typeof r=="function"?e.default:H(e.default);{let i=$T(e,t,r);return Bi(i,t,r)}}function vT(e,t,r){return F(e,t,r)?H(r):Kt(e,t)}function LT(e,t,r){return F(e,t,r)?r:Kt(e,t)}function NT(e,t,r){if(F(e,t,r))return H(r);let i=$(r)?H(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 la(e,"Array cast produced invalid data due to uniqueItems constraint");return c}function RT(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 kT(e,t,r){let i=globalThis.Object.values(e.$defs),o=e.$defs[e.$ref];return nr(o,[...t,...i],r)}function zf(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?zf(e[i],t[i]):e[i];return{...r,[i]:o}},{})}function FT(e,t,r){if(F(e,t,r))return r;let i=Kt(e,t),o=zf(i,r);return F(e,t,o)?o:i}function jT(e,t,r){throw new la(e,"Never types cannot be cast")}function UT(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 _T(e,t,r){if(F(e,t,r))return H(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 DT(e,t,r){return nr(Y(e,t),t,r)}function MT(e,t,r){return nr(Y(e,t),t,r)}function BT(e,t,r){return F(e,t,r)?H(r):$(r)?e.items===void 0?[]:e.items.map((i,o)=>nr(i,t,r[o])):Kt(e,t)}function VT(e,t,r){return F(e,t,r)?H(r):AT(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 NT(o,i,r);case"Constructor":return RT(o,i,r);case"Import":return kT(o,i,r);case"Intersect":return FT(o,i,r);case"Never":return jT(o,i,r);case"Object":return UT(o,i,r);case"Record":return _T(o,i,r);case"Ref":return DT(o,i,r);case"This":return MT(o,i,r);case"Tuple":return BT(o,i,r);case"Union":return VT(o,i,r);case"Date":case"Symbol":case"Uint8Array":return vT(e,t,r);default:return LT(o,i,r)}}function Bi(...e){return e.length===3?nr(e[0],e[1],e[2]):nr(e[0],[],e[1])}function KT(e){return Lr(e)&&e[g]!=="Unsafe"}function GT(e,t,r){return $(r)?r.map(i=>ut(e.items,t,i)):r}function qT(e,t,r){let i=globalThis.Object.values(e.$defs),o=e.$defs[e.$ref];return ut(o,[...t,...i],r)}function WT(e,t,r){let i=e.unevaluatedProperties,a=e.allOf.map(c=>ut(c,t,H(r))).reduce((c,l)=>L(l)?{...c,...l}:l,{});if(!L(r)||!L(a)||!Lr(i))return a;let s=Ze(e);for(let c of Object.getOwnPropertyNames(r))s.includes(c)||F(i,t,r[c])&&(a[c]=ut(i,t,r[c]));return a}function HT(e,t,r){if(!L(r)||$(r))return r;let i=e.additionalProperties;for(let o of Object.getOwnPropertyNames(r)){if(E(e.properties,o)){r[o]=ut(e.properties[o],t,r[o]);continue}if(Lr(i)&&F(i,t,r[o])){r[o]=ut(i,t,r[o]);continue}delete r[o]}return r}function zT(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]=ut(s,t,r[l]);continue}if(Lr(i)&&F(i,t,r[l])){r[l]=ut(i,t,r[l]);continue}delete r[l]}return r}function JT(e,t,r){return ut(Y(e,t),t,r)}function YT(e,t,r){return ut(Y(e,t),t,r)}function QT(e,t,r){if(!$(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]=ut(e.items[o],t,r[o]);return r.length>i?r.slice(0,i):r}function XT(e,t,r){for(let i of e.anyOf)if(KT(i)&&F(i,t,r))return ut(i,t,r);return r}function ut(e,t,r){let i=X(e.$id)?Fe(e,t):t,o=e;switch(o[g]){case"Array":return GT(o,i,r);case"Import":return qT(o,i,r);case"Intersect":return WT(o,i,r);case"Object":return HT(o,i,r);case"Record":return zT(o,i,r);case"Ref":return JT(o,i,r);case"This":return YT(o,i,r);case"Tuple":return QT(o,i,r);case"Union":return XT(o,i,r);default:return r}}function pa(...e){return e.length===3?ut(e[0],e[1],e[2]):ut(e[0],[],e[1])}function Ds(e){return X(e)&&!isNaN(e)&&!isNaN(parseFloat(e))}function ZT(e){return At(e)||Jt(e)||le(e)}function ma(e){return e===!0||le(e)&&e===1||At(e)&&e===BigInt("1")||X(e)&&(e.toLowerCase()==="true"||e==="1")}function ua(e){return e===!1||le(e)&&(e===0||Object.is(e,-0))||At(e)&&e===BigInt("0")||X(e)&&(e.toLowerCase()==="false"||e==="0"||e==="-0")}function eP(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 tP(e){return X(e)&&/^(?:[0-2]\\d:[0-5]\\d:[0-5]\\d|23:59:60)?$/i.test(e)}function rP(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 nP(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 iP(e){return X(e)&&/^\\d\\d\\d\\d-[0-1]\\d-[0-3]\\d$/i.test(e)}function oP(e,t){let r=Yf(e);return r===t?r:e}function aP(e,t){let r=Qf(e);return r===t?r:e}function sP(e,t){let r=Jf(e);return r===t?r:e}function cP(e,t){return X(e.const)?oP(t,e.const):le(e.const)?aP(t,e.const):Jt(e.const)?sP(t,e.const):t}function Jf(e){return ma(e)?!0:ua(e)?!1:e}function lP(e){let t=r=>r.split(".")[0];return Ds(e)?BigInt(t(e)):le(e)?BigInt(Math.trunc(e)):ua(e)?BigInt(0):ma(e)?BigInt(1):e}function Yf(e){return gr(e)&&e.description!==void 0?e.description.toString():ZT(e)?e.toString():e}function Qf(e){return Ds(e)?parseFloat(e):ma(e)?1:ua(e)?0:e}function pP(e){return Ds(e)?parseInt(e):le(e)?Math.trunc(e):ma(e)?1:ua(e)?0:e}function mP(e){return X(e)&&e.toLowerCase()==="null"?null:e}function uP(e){return X(e)&&e==="undefined"?void 0:e}function dP(e){return Ge(e)?e:le(e)?new Date(e):ma(e)?new Date(1):ua(e)?new Date(0):Ds(e)?new Date(parseInt(e)):tP(e)?new Date(`1970-01-01T${e}.000Z`):eP(e)?new Date(`1970-01-01T${e}`):nP(e)?new Date(`${e}.000Z`):rP(e)?new Date(e):iP(e)?new Date(`${e}T00:00:00.000Z`):e}function fP(e,t,r){return($(r)?r:[r]).map(o=>ir(e.items,t,o))}function hP(e,t,r){return lP(r)}function gP(e,t,r){return Jf(r)}function yP(e,t,r){return dP(r)}function bP(e,t,r){let i=globalThis.Object.values(e.$defs),o=e.$defs[e.$ref];return ir(o,[...t,...i],r)}function OP(e,t,r){return pP(r)}function xP(e,t,r){return e.allOf.reduce((i,o)=>ir(o,t,i),r)}function SP(e,t,r){return cP(e,r)}function IP(e,t,r){return mP(r)}function wP(e,t,r){return Qf(r)}function CP(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 TP(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 PP(e,t,r){return ir(Y(e,t),t,r)}function EP(e,t,r){return Yf(r)}function $P(e,t,r){return X(r)||le(r)?Symbol(r):r}function AP(e,t,r){return ir(Y(e,t),t,r)}function vP(e,t,r){return $(r)&&!ce(e.items)?r.map((o,a)=>a<e.items.length?ir(e.items[a],t,o):o):r}function LP(e,t,r){return uP(r)}function NP(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,H(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 fP(o,i,r);case"BigInt":return hP(o,i,r);case"Boolean":return gP(o,i,r);case"Date":return yP(o,i,r);case"Import":return bP(o,i,r);case"Integer":return OP(o,i,r);case"Intersect":return xP(o,i,r);case"Literal":return SP(o,i,r);case"Null":return IP(o,i,r);case"Number":return wP(o,i,r);case"Object":return CP(o,i,r);case"Record":return TP(o,i,r);case"Ref":return PP(o,i,r);case"String":return EP(o,i,r);case"Symbol":return $P(o,i,r);case"This":return AP(o,i,r);case"Tuple":return vP(o,i,r);case"Undefined":return LP(o,i,r);case"Union":return NP(o,i,r);default:return r}}function da(...e){return e.length===3?ir(e[0],e[1],e[2]):ir(e[0],[],e[1])}var fa=class extends A{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}},Ms=class extends A{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 ye(e,t,r){try{return z(e)?e[ue].Decode(r):r}catch(i){throw new Ms(e,t,r,i)}}function RP(e,t,r,i){return $(i)?ye(e,r,i.map((o,a)=>or(e.items,t,`${r}/${a}`,o))):ye(e,r,i)}function kP(e,t,r,i){if(!L(i)||ot(i))return ye(e,r,i);let o=Uo(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 ye(e,r,s);let c=Object.getOwnPropertyNames(s),l=e.unevaluatedProperties,p={...s};for(let m of c)a.includes(m)||(p[m]=ye(l,`${r}/${m}`,p[m]));return ye(e,r,p)}function FP(e,t,r,i){let o=globalThis.Object.values(e.$defs),a=e.$defs[e.$ref],s=or(a,[...t,...o],r,i);return ye(e,r,s)}function jP(e,t,r,i){return ye(e,r,or(e.not,t,r,i))}function UP(e,t,r,i){if(!L(i))return ye(e,r,i);let o=Ze(e),a={...i};for(let p of o)E(a,p)&&(ce(a[p])&&(!Or(e.properties[p])||Te.IsExactOptionalProperty(a,p))||(a[p]=or(e.properties[p],t,`${r}/${p}`,a[p])));if(!de(e.additionalProperties))return ye(e,r,a);let s=Object.getOwnPropertyNames(a),c=e.additionalProperties,l={...a};for(let p of s)o.includes(p)||(l[p]=ye(c,`${r}/${p}`,l[p]));return ye(e,r,l)}function _P(e,t,r,i){if(!L(i))return ye(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 ye(e,r,s);let c=Object.getOwnPropertyNames(s),l=e.additionalProperties,p={...s};for(let m of c)a.test(m)||(p[m]=ye(l,`${r}/${m}`,p[m]));return ye(e,r,p)}function DP(e,t,r,i){let o=Y(e,t);return ye(e,r,or(o,t,r,i))}function MP(e,t,r,i){let o=Y(e,t);return ye(e,r,or(o,t,r,i))}function BP(e,t,r,i){return $(i)&&$(e.items)?ye(e,r,e.items.map((o,a)=>or(o,t,`${r}/${a}`,i[a]))):ye(e,r,i)}function VP(e,t,r,i){for(let o of e.anyOf){if(!F(o,t,i))continue;let a=or(o,t,r,i);return ye(e,r,a)}return ye(e,r,i)}function or(e,t,r,i){let o=Fe(e,t),a=e;switch(e[g]){case"Array":return RP(a,o,r,i);case"Import":return FP(a,o,r,i);case"Intersect":return kP(a,o,r,i);case"Not":return jP(a,o,r,i);case"Object":return UP(a,o,r,i);case"Record":return _P(a,o,r,i);case"Ref":return DP(a,o,r,i);case"Symbol":return ye(a,r,i);case"This":return MP(a,o,r,i);case"Tuple":return BP(a,o,r,i);case"Union":return VP(a,o,r,i);default:return ye(a,r,i)}}function ha(e,t,r){return or(e,t,"",r)}var ga=class extends A{constructor(t,r,i){super("The encoded value does not match the expected schema"),this.schema=t,this.value=r,this.error=i}},Bs=class extends A{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 Bs(e,t,r,i)}}function KP(e,t,r,i){let o=Ve(e,r,i);return $(o)?o.map((a,s)=>ar(e.items,t,`${r}/${s}`,a)):o}function GP(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 qP(e,t,r,i){let o=Ve(e,r,i);if(!L(i)||ot(i))return o;let a=Uo(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 WP(e,t,r,i){return Ve(e.not,r,Ve(e,r,i))}function HP(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])&&(!Or(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 zP(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 JP(e,t,r,i){let o=Y(e,t),a=ar(o,t,r,i);return Ve(e,r,a)}function YP(e,t,r,i){let o=Y(e,t),a=ar(o,t,r,i);return Ve(e,r,a)}function QP(e,t,r,i){let o=Ve(e,r,i);return $(e.items)?e.items.map((a,s)=>ar(a,t,`${r}/${s}`,o[s])):[]}function XP(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 KP(a,o,r,i);case"Import":return GP(a,o,r,i);case"Intersect":return qP(a,o,r,i);case"Not":return WP(a,o,r,i);case"Object":return HP(a,o,r,i);case"Record":return zP(a,o,r,i);case"Ref":return JP(a,o,r,i);case"This":return YP(a,o,r,i);case"Tuple":return QP(a,o,r,i);case"Union":return XP(a,o,r,i);default:return Ve(a,r,i)}}function ya(e,t,r){return ar(e,t,"",r)}function ZP(e,t){return z(e)||ve(e.items,t)}function eE(e,t){return z(e)||ve(e.items,t)}function tE(e,t){return z(e)||ve(e.returns,t)||e.parameters.some(r=>ve(r,t))}function rE(e,t){return z(e)||ve(e.returns,t)||e.parameters.some(r=>ve(r,t))}function nE(e,t){return z(e)||z(e.unevaluatedProperties)||e.allOf.some(r=>ve(r,t))}function iE(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 oE(e,t){return z(e)||ve(e.items,t)}function aE(e,t){return z(e)||ve(e.not,t)}function sE(e,t){return z(e)||Object.values(e.properties).some(r=>ve(r,t))||de(e.additionalProperties)&&ve(e.additionalProperties,t)}function cE(e,t){return z(e)||ve(e.item,t)}function lE(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 pE(e,t){return z(e)?!0:ve(Y(e,t),t)}function mE(e,t){return z(e)?!0:ve(Y(e,t),t)}function uE(e,t){return z(e)||!ce(e.items)&&e.items.some(r=>ve(r,t))}function dE(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&&yp.has(e.$id))return!1;switch(e.$id&&yp.add(e.$id),e[g]){case"Array":return ZP(i,r);case"AsyncIterator":return eE(i,r);case"Constructor":return tE(i,r);case"Function":return rE(i,r);case"Import":return iE(i,r);case"Intersect":return nE(i,r);case"Iterator":return oE(i,r);case"Not":return aE(i,r);case"Object":return sE(i,r);case"Promise":return cE(i,r);case"Record":return lE(i,r);case"Ref":return pE(i,r);case"This":return mE(i,r);case"Tuple":return uE(i,r);case"Union":return dE(i,r);default:return z(e)}}var yp=new Set;function $n(e,t){return yp.clear(),ve(e,t)}function bp(...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 fa(t,i,En(t,r,i).First());return $n(t,r)?ha(t,r,i):i}function Jr(e,t){let r=E(e,"default")?e.default:void 0,i=hr(r)?r():H(r);return ce(t)?i:L(t)&&L(i)?Object.assign(i,t):t}function Op(e){return Lr(e)&&"default"in e}function fE(e,t,r){if($(r)){for(let o=0;o<r.length;o++)r[o]=et(e.items,t,r[o]);return r}let i=Jr(e,r);if(!$(i))return i;for(let o=0;o<i.length;o++)i[o]=et(e.items,t,i[o]);return i}function hE(e,t,r){return Ge(r)?r:Jr(e,r)}function gE(e,t,r){let i=globalThis.Object.values(e.$defs),o=e.$defs[e.$ref];return et(o,[...t,...i],r)}function yE(e,t,r){let i=Jr(e,r);return e.allOf.reduce((o,a)=>{let s=et(a,t,i);return L(s)?{...o,...s}:s},{})}function bE(e,t,r){let i=Jr(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(!Op(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 OE(e,t,r){let i=Jr(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)&&Op(s)&&(i[l]=et(s,t,i[l]));if(!Op(o))return i;for(let l of Object.getOwnPropertyNames(i))c.test(l)||(i[l]=et(o,t,i[l]));return i}function xE(e,t,r){return et(Y(e,t),t,Jr(e,r))}function SE(e,t,r){return et(Y(e,t),t,r)}function IE(e,t,r){let i=Jr(e,r);if(!$(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 wE(e,t,r){let i=Jr(e,r);for(let o of e.anyOf){let a=et(o,t,H(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 fE(o,i,r);case"Date":return hE(o,i,r);case"Import":return gE(o,i,r);case"Intersect":return yE(o,i,r);case"Object":return bE(o,i,r);case"Record":return OE(o,i,r);case"Ref":return xE(o,i,r);case"This":return SE(o,i,r);case"Tuple":return IE(o,i,r);case"Union":return wE(o,i,r);default:return Jr(o,r)}}function ba(...e){return e.length===3?et(e[0],e[1],e[2]):et(e[0],[],e[1])}var Gt={};nt(Gt,{Delete:()=>TE,Format:()=>Oa,Get:()=>EE,Has:()=>PE,Set:()=>CE,ValuePointerRootDeleteError:()=>Ks,ValuePointerRootSetError:()=>Vs});var Vs=class extends A{constructor(t,r,i){super("Cannot set root value"),this.value=t,this.path=r,this.update=i}},Ks=class extends A{constructor(t,r){super("Cannot delete root value"),this.value=t,this.path=r}};function Xf(e){return e.indexOf("~")===-1?e:e.replace(/~1/g,"/").replace(/~0/g,"~")}function*Oa(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 Xf(e.slice(t,r))),t=i+1):r=i;yield Xf(e.slice(t))}function CE(e,t,r){if(t==="")throw new Vs(e,t,r);let[i,o,a]=[null,e,""];for(let s of Oa(t))o[s]===void 0&&(o[s]={}),i=o,o=o[s],a=s;i[a]=r}function TE(e,t){if(t==="")throw new Ks(e,t);let[r,i,o]=[null,e,""];for(let a of Oa(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 PE(e,t){if(t==="")return!0;let[r,i,o]=[null,e,""];for(let a of Oa(t)){if(i[a]===void 0)return!1;r=i,i=i[a],o=a}return Object.getOwnPropertyNames(r).includes(o)}function EE(e,t){if(t==="")return e;let r=e;for(let i of Oa(t)){if(r[i]===void 0)return;r=r[i]}return r}function $E(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=>An(e[o],t[o]))}function AE(e,t){return Ge(t)&&e.getTime()===t.getTime()}function vE(e,t){return!$(t)||e.length!==t.length?!1:e.every((r,i)=>An(r,t[i]))}function LE(e,t){return!gt(t)||e.length!==t.length||Object.getPrototypeOf(e).constructor.name!==Object.getPrototypeOf(t).constructor.name?!1:e.every((r,i)=>An(r,t[i]))}function NE(e,t){return e===t}function An(e,t){if(Ge(e))return AE(e,t);if(gt(e))return LE(e,t);if($(e))return vE(e,t);if(L(e))return $E(e,t);if(ot(e))return NE(e,t);throw new Error("ValueEquals: Unable to compare value")}var eh=q({type:j("insert"),path:ke(),value:lt()}),th=q({type:j("update"),path:ke(),value:lt()}),rh=q({type:j("delete"),path:ke()}),xp=G([eh,th,rh]),xa=class extends A{constructor(t,r){super(r),this.value=t}};function Gs(e,t){return{type:"update",path:e,value:t}}function nh(e,t){return{type:"insert",path:e,value:t}}function ih(e){return{type:"delete",path:e}}function Zf(e){if(globalThis.Object.getOwnPropertySymbols(e).length>0)throw new xa(e,"Cannot diff objects with symbols")}function*RE(e,t,r){if(Zf(t),Zf(r),!hs(r))return yield Gs(e,r);let i=globalThis.Object.getOwnPropertyNames(t),o=globalThis.Object.getOwnPropertyNames(r);for(let a of o)E(t,a)||(yield nh(`${e}/${a}`,r[a]));for(let a of i)E(r,a)&&(An(t,r)||(yield*qs(`${e}/${a}`,t[a],r[a])));for(let a of i)E(r,a)||(yield ih(`${e}/${a}`))}function*kE(e,t,r){if(!$(r))return yield Gs(e,r);for(let i=0;i<Math.min(t.length,r.length);i++)yield*qs(`${e}/${i}`,t[i],r[i]);for(let i=0;i<r.length;i++)i<t.length||(yield nh(`${e}/${i}`,r[i]));for(let i=t.length-1;i>=0;i--)i<r.length||(yield ih(`${e}/${i}`))}function*FE(e,t,r){if(!gt(r)||t.length!==r.length||globalThis.Object.getPrototypeOf(t).constructor.name!==globalThis.Object.getPrototypeOf(r).constructor.name)return yield Gs(e,r);for(let i=0;i<Math.min(t.length,r.length);i++)yield*qs(`${e}/${i}`,t[i],r[i])}function*jE(e,t,r){t!==r&&(yield Gs(e,r))}function*qs(e,t,r){if(hs(t))return yield*RE(e,t,r);if($(t))return yield*kE(e,t,r);if(gt(t))return yield*FE(e,t,r);if(ot(t))return yield*jE(e,t,r);throw new xa(t,"Unable to diff value")}function Sp(e,t){return[...qs("",e,t)]}function UE(e){return e.length>0&&e[0].path===""&&e[0].type==="update"}function _E(e){return e.length===0}function Ip(e,t){if(UE(t))return H(t[0].value);if(_E(t))return H(e);let r=H(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 wp(...e){let[t,r,i]=e.length===3?[e[0],e[1],e[2]]:[e[0],[],e[1]],o=$n(t,r)?ya(t,r,i):i;if(!F(t,r,o))throw new ga(t,o,En(t,r,o).First());return o}function Ws(e){return L(e)&&!$(e)}var Sa=class extends A{constructor(t){super(t)}};function DE(e,t,r,i){if(!Ws(r))Gt.Set(e,t,H(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)Cp(e,`${t}/${s}`,r[s],i[s])}}function ME(e,t,r,i){if(!$(r))Gt.Set(e,t,H(i));else{for(let o=0;o<i.length;o++)Cp(e,`${t}/${o}`,r[o],i[o]);r.splice(i.length)}}function BE(e,t,r,i){if(gt(r)&&r.length===i.length)for(let o=0;o<r.length;o++)r[o]=i[o];else Gt.Set(e,t,H(i))}function VE(e,t,r,i){r!==i&&Gt.Set(e,t,i)}function Cp(e,t,r,i){if($(i))return ME(e,t,r,i);if(gt(i))return BE(e,t,r,i);if(Ws(i))return DE(e,t,r,i);if(ot(i))return VE(e,t,r,i)}function oh(e){return gt(e)||ot(e)}function KE(e,t){return Ws(e)&&$(t)||$(e)&&Ws(t)}function Tp(e,t){if(oh(e)||oh(t))throw new Sa("Only object and array types can be mutated at the root level");if(KE(e,t))throw new Sa("Cannot assign due type mismatch of assignable values");Cp(e,"",e,t)}var Ia=class extends A{constructor(t){super(t)}},Hs;(function(e){let t=new Map([["Assert",(a,s,c)=>(ca(a,s,c),c)],["Cast",(a,s,c)=>Bi(a,s,c)],["Clean",(a,s,c)=>pa(a,s,c)],["Clone",(a,s,c)=>H(c)],["Convert",(a,s,c)=>da(a,s,c)],["Decode",(a,s,c)=>$n(a,s)?ha(a,s,c):c],["Default",(a,s,c)=>ba(a,s,c)],["Encode",(a,s,c)=>$n(a,s)?ya(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})(Hs||(Hs={}));var Pp=["Clone","Clean","Default","Convert","Assert","Decode"];function GE(e,t,r,i){return e.reduce((o,a)=>{let s=Hs.Get(a);if(ce(s))throw new Ia(`Unable to find Parse operation \'${a}\'`);return s(t,r,o)},i)}function Ep(...e){let[t,r,i,o]=e.length===4?[e[0],e[1],e[2],e[3]]:e.length===3?$(e[0])?[e[0],e[1],[],e[2]]:[Pp,e[0],e[1],e[2]]:e.length===2?[Pp,e[0],[],e[1]]:(()=>{throw new Ia("Invalid Arguments")})();return GE(t,r,i,o)}var T={};nt(T,{Assert:()=>ca,Cast:()=>Bi,Check:()=>F,Clean:()=>pa,Clone:()=>H,Convert:()=>da,Create:()=>Kt,Decode:()=>bp,Default:()=>ba,Diff:()=>Sp,Edit:()=>xp,Encode:()=>wp,Equal:()=>An,Errors:()=>En,Hash:()=>ui,Mutate:()=>Tp,Parse:()=>Ep,Patch:()=>Ip,ValueErrorIterator:()=>xr});var xm={};nt(xm,{ASSET_UNREADABLE:()=>Up,BLOCK_SLOT_PLACEMENT_PROPS:()=>um,BLOCK_SLOT_ROLES:()=>ng,BLUEPRINT_FORMATS:()=>gg,BlockDefinitionsSchema:()=>en,BlockEvaluationError:()=>Ra,BlockInvocationPropsSchema:()=>Dn,BlockSlotSchema:()=>ig,BlueprintPagesSchema:()=>yg,BlueprintSchema:()=>bm,BlueprintVariantSchema:()=>bg,CANVASES:()=>Ch,ChromeSchema:()=>Hp,ComponentValidationError:()=>bi,DEFAULT_CHART_CONCURRENCY:()=>$g,DEFAULT_CHART_THEME_COLORS:()=>cA,DEFAULT_ERROR_CONFIG:()=>Nn,DEFAULT_VISUAL_DPI:()=>ka,DesignSpacingSchema:()=>Wp,DesignSystemProperties:()=>Un,DesignSystemSchema:()=>Th,DuplicateComponentError:()=>qi,ERROR_EMOJIS:()=>hi,FONT_URL_ALLOWLIST:()=>Np,FeatureRequirementCollector:()=>yh,FontFamilyNameSchema:()=>Ht,FontRegistry:()=>eA,FontRegistryEntrySchema:()=>Bp,FontRegistrySchema:()=>Cr,FontSourceSchema:()=>Mp,GENERICNESS_PENALTY:()=>KA,JsonBlockDefinitionSchema:()=>og,JsonBlockEvaluator:()=>OA,MAX_RASTERIZE_BATCH_SLIDES:()=>N$,MAX_RASTERIZE_FONTS:()=>v$,MAX_RASTERIZE_FONT_BYTES:()=>L$,MAX_VISUAL_DPI:()=>ja,MIN_VISUAL_DPI:()=>Fa,MotifSchema:()=>zp,POINTS_PER_PIXEL_96DPI:()=>eg,POPULAR_GOOGLE_FONTS:()=>Yh,PaletteSchema:()=>Kp,REMOTE_EXPORT_WARNING:()=>qA,RENDERER_DEPENDENCY_MISSING:()=>ec,ROLE_SCALE_STEPS:()=>Jp,RUBRIC:()=>BA,RendererRegistry:()=>Oh,SAFE_FONTS:()=>ac,SERVICE_UNAVAILABLE_CODE:()=>Om,SHIPPING_QUESTION:()=>VA,TYPE_ROLES:()=>zi,TextCaseSchema:()=>xi,TypeRoleNameSchema:()=>Vp,TypeRoleSchema:()=>wt,TypeRolesSchema:()=>Gp,TypographySchema:()=>qp,UPSTREAM_OVERRIDES:()=>Qh,UnknownPreservedComponentError:()=>Qs,UnsupportedRendererFeatureError:()=>kp,WEIGHT_LABELS:()=>zh,applyDocumentBlocksToSchema:()=>vA,applyExportMode:()=>sA,applyFontSubstitution:()=>sm,assertNever:()=>mh,assertRendererSupports:()=>bh,assetUnreadableError:()=>xh,blockDependencies:()=>ym,blockInvocationExample:()=>hg,blockInvocationPropsSchema:()=>ug,blockPointerKey:()=>fe,blockReferencesFromDocument:()=>LA,blockSlotBudgets:()=>SA,blockSlotEditorSchema:()=>yc,blockSlotFacts:()=>lg,blockSlotJsonSchema:()=>hc,blockSlotMarkdown:()=>pg,blockSlotRoles:()=>IA,blockSlotsEditorSchema:()=>mg,blockSlotsJsonSchema:()=>hm,blockValueAt:()=>cr,blockWordCount:()=>dm,buildDefaultSubstitutionMap:()=>Zh,calculatePosition:()=>Vi,capsFormatting:()=>Ah,chartFamilyResolver:()=>uA,chartFontFaceCss:()=>rg,chartPointsPerPixel:()=>lA,clampVisualDpi:()=>A$,clearComponentNamesCache:()=>Ca,collectFontNamesFromDocx:()=>R$,collectFontNamesFromPptx:()=>k$,compareSemver:()=>di,composeBlocksWithPlugins:()=>$A,convertToJsonSchema:()=>rc,createBlockAuthoringSchema:()=>Ua,createComponent:()=>Gi,createComponentSchema:()=>Wi,createComponentSchemaObject:()=>nc,createErrorConfig:()=>wr,createJsonParseError:()=>gi,createLimiter:()=>Eg,createVersion:()=>Ki,cssFontFamily:()=>tg,defaultSubstituteFor:()=>Xh,definitionsFor:()=>Sg,designCanvas:()=>Ph,designColors:()=>Yp,detectFontFormat:()=>Yr,diagnoseUnsupportedFeatures:()=>jp,documentBlockMetadata:()=>xA,documentFontRegistry:()=>j$,explainRemovedBlockSyntax:()=>Xi,exportSchemaToFile:()=>Hi,extractStandardComponentNames:()=>fi,fetchGoogleFontSources:()=>Jh,fixSchemaReferences:()=>Fn,formatErrorMessage:()=>Sr,formatErrorSummary:()=>Xr,getChartRequestStats:()=>iv,getLiteralValue:()=>It,getObjectSchemaPropertyNames:()=>Ir,getSchemaMetadata:()=>Ta,getUpstreamOverride:()=>iA,getValidationSummary:()=>Zs,groupErrorsByPath:()=>Pa,instantiateBlueprint:()=>DA,isAllowedFontUrl:()=>Js,isBlockRecord:()=>V,isBlueprint:()=>jA,isLiteralSchema:()=>Qr,isObjectSchema:()=>qt,isPrivateServiceUrl:()=>Pg,isSafeFont:()=>Oi,isUnionSchema:()=>wa,isValidSemver:()=>Ln,isValidationSuccess:()=>Xs,latestVersion:()=>dt,mergeFontRegistries:()=>U$,mergeWithDefaults:()=>GA,parseSemver:()=>vn,partitionDiagnostics:()=>gh,postJsonToService:()=>nv,readBlockDefinitions:()=>Pr,recordChartCollected:()=>av,recordChartRetry:()=>sv,registerBlueprints:()=>UA,remoteExportNotice:()=>WA,rendererError:()=>Fp,rendererWarning:()=>hh,resetChartLimiters:()=>fv,resetChartRequestStats:()=>ov,resolveBlockSlot:()=>Oc,resolveComponentVersion:()=>yi,resolveDesignColor:()=>Qp,resolveMotif:()=>vh,resolveServiceUrl:()=>QA,resolveTypeRoles:()=>Lh,restructureNameDiscriminatedUnions:()=>Ea,rewriteFontFamilyName:()=>vp,selectVariant:()=>xg,sendChartRequest:()=>uv,slotAt:()=>Ig,synthesizeFamilyName:()=>M$,themeFontRegistry:()=>Hh,toAuthoredBlockPointer:()=>Zr,transformValueError:()=>Rn,transformValueErrors:()=>tt,typeScaleSizes:()=>$h,unionBranches:()=>tc,validateBlockDefinitions:()=>xc,validateBlockInvocations:()=>Qi,validateBlueprint:()=>Og,validateCustomComponentProps:()=>kn,validateDesignColors:()=>Nh,validateFontReferences:()=>D$,valueAt:()=>Cg,withChartFontFaceCss:()=>hA,withChartTypography:()=>dA});var qE=new Set([1,4,6,16]),WE=2981146554;function ah(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 HE(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 zE(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 JE(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),be=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:be,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),be=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:be,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=HE(I,v.value)),u.push(I))}m.length=0,m.push(...u);let f=zE(m);a[s]={...a[s],data:f,checksum:ah(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=ah(S),v=WE-I>>>0;S.writeUInt32BE(v,N.offset+8)}return S}function YE(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 zs(e,t){let r=YE(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 Ap(e){let t=[];for(let r of zs(e,QE)){let i=r.value.trim();i.length>0&&!t.includes(i)&&t.push(i)}return t}var QE=new Set([1,16]);function XE(e,t){return e?t?"Bold Italic":"Bold":t?"Italic":"Regular"}function vp(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 JE(e,p=>qE.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 ZE={100:"Thin",200:"ExtraLight",300:"Light",400:"Regular",500:"Medium",600:"SemiBold",700:"Bold",800:"ExtraBold",900:"Black"};function Lp(e,t){let r=ZE[e];return r?{typographic:t?`${r} Italic`:r,legacy:XE(e>=600,t)}:null}var Np=["fonts.gstatic.com","fonts.googleapis.com","cdn.jsdelivr.net"];function Js(e){let t;try{t=new URL(e)}catch{return!1}return t.protocol!=="https:"?!1:Np.includes(t.hostname.toLowerCase())}function Yr(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 sh=/^(\\d+)\\.(\\d+)\\.(\\d+)$/;function Ln(e){return sh.test(e)}function vn(e){let t=e.match(sh);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 di(e,t){let r=vn(e),i=vn(t);return r.major-i.major||r.minor-i.minor||r.patch-i.patch}function dt(e){if(e.length===0)throw new Error("Cannot determine latest version from empty array");return e.reduce((t,r)=>di(r,t)>0?r:t)}var Ys=new Map;function wa(e){return"anyOf"in e&&Array.isArray(e.anyOf)}function qt(e){return e.type==="object"&&"properties"in e}function Qr(e){return"const"in e}function Ir(e){return qt(e)?Object.keys(e.properties):[]}function It(e){if(Qr(e))return e.const}function fi(e){if(Ys.has(e))return Ys.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&&Qr(i)){let o=It(i);typeof o=="string"&&t.push(o)}}}else if(qt(e)){let r=e.properties?.name??e.properties?.type;if(r&&Qr(r)){let i=It(r);typeof i=="string"&&t.push(i)}}return Ys.set(e,t),t}function Ca(){Ys.clear()}function Ta(e){let t={};return"type"in e&&(t.type=String(e.type)),qt(e)&&(t.properties=Ir(e)),Qr(e)&&(t.literal=It(e)),t}function ch(){return typeof process>"u"||!process.env?!1:!!(process.env.CI||process.env.GITHUB_ACTIONS||process.env.GITLAB_CI)}function e$(){return typeof process>"u"||process.env?.NO_COLOR?!1:process.env?.FORCE_COLOR||process.stdout?.isTTY?!0:!ch()}var Nn={includeEmojis:!ch(),verbosity:"normal",includeSuggestions:!0,includePath:!0,maxMessageLength:0,includeDocLinks:!1,colorSupport:e$()};function wr(e){return{...Nn,...e}}var hi={ERROR:"\\u274C",WARNING:"\\u26A0\\uFE0F",FIX:"\\u{1F527}",INFO:"\\u2139\\uFE0F",SUCCESS:"\\u2705"};function Sr(e,t){return t.maxMessageLength>0&&e.length>t.maxMessageLength?e.substring(0,t.maxMessageLength)+"...":e}function t$(e,t){let r=String(e.type||""),i=e.path||"root";return r==="62"||r==="union"?r$(e):e.message?.includes("additionalProperties")?n$(e):e.message?.includes("Required property")?i$(e):r==="string"||r==="number"||r==="boolean"||r==="array"||r==="object"?o$(e):r==="literal"?a$(e):r==="pattern"||r==="RegExp"?s$(e):`At ${i}: ${e.message}`}function r$(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 n$(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=Ir(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 i$(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 o$(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 a$(e){let t=e.path||"root",r=e.schema?JSON.stringify(It(e.schema)):"specific value",i=JSON.stringify(e.value);return`Invalid value at ${t}: Expected exactly ${r} but got ${i}`}function s$(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 Rn(e,t,r){let i=wr(r),o=t$(e,i),a={path:e.path||"root",message:Sr(o||e.message,i),code:String(e.type||"validation_error"),value:e.value};if(i.includeSuggestions){let s=c$(e,i);s&&(a.suggestion=Sr(s,i))}if(t&&e.path){let s=Vi(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(Rn(a,t?.jsonString,void 0)))}return i}function Vi(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 c$(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(It(e.schema)):"specific value"}`}function Xr(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 Pa(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 gi(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"}}function Ki(e){return e}function Gi(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=dt(i);return t[o]}var qi=class lh 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,lh)}},Qs=class ph 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,ph)}},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 Rp(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 kn(e,t,r){let i=r?.componentName??"custom";try{let o=Rp(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 Xs(e){return e.valid===!0&&e.data!==void 0}function Zs(e){return e.valid?"Validation successful":!e.errors||e.errors.length===0?"Validation failed with unknown error":Xr(e.errors)}function mh(e,t){let r=l$(e);throw new Error(t?`Unhandled variant in ${t}: ${r}`:`Unhandled variant: ${r}`)}function l$(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 p$="Sheet1";var GW=`<?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="${p$}" sheetId="1" r:id="rId1"/></sheets></workbook>`;var kp=class dh extends Error{constructor(r){let{format:i,rendererId:o,diagnostics:a}=r,s=uh(a.map(l=>l.feature)),c=uh(a.map(l=>l.path));super(u$(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,dh)}},m$=class fh 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,fh)}};function uh(e){return[...new Set(e)]}function u$(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 Fp(e,t,r){return{feature:e,path:t,severity:"error",message:r}}function hh(e,t,r){return{feature:e,path:t,severity:"warning",message:r}}function gh(e){let t=[],r=[];for(let i of e)i.severity==="error"?t.push(i):r.push(i);return{errors:t,warnings:r}}var yh=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 jp(e,t,r){let i=[];for(let o of e)t.has(o.feature)||i.push(Fp(o.feature,o.path,d$(o,r)));return i}function d$(e,t){let r=`the "${t}" renderer cannot express "${e.feature}"`;return e.detail?`${r} (${e.detail})`:r}function bh(e,t){let r=jp(e,t.capabilities,t.id);if(r.length!==0)throw new kp({format:t.format,rendererId:t.id,diagnostics:r})}var Oh=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 m$(this.format,t,this.ids());try{return await r()}catch(i){throw f$(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===ec&&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 f$(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=h$(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=ec,a&&(c.packageName=a),c}var ec="RendererDependencyMissingError";function h$(e){return(/Cannot find (?:module|package) [\'"]([^\'"]+)[\'"]/.exec(e)??/Failed to resolve (?:module|import)[: ]+[\'"]?([^\'"\\s]+)/.exec(e))?.[1]}var Up="AssetUnreadableError";function xh(e,t){let r=t instanceof Error?t.message:String(t),i=e.startsWith("data:")&&e.length>50?`${e.slice(0,50)}\\u2026`:e,o=new Error(`Failed to load image from ${i}: ${r}`,{cause:t});return o.name=Up,o.source=e,o}function Ih(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 g$(e){return typeof e.properties?.version?.const=="string"}function y$(e){return Array.isArray(e.required)&&e.required.includes("name")}function b$(e){let t=new Map;for(let r of e){let i=Ih(r),o=t.get(i);o?o.push(r):t.set(i,[r])}return t}function O$(e,t){let r=t.find(i=>!g$(i)&&typeof i.description=="string")??t.find(i=>typeof i.description=="string");return{const:e,type:"string",...r?{description:r.description}:{}}}function Ea(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=>Ih(l)!==void 0&&y$(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")?b$(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])=>O$(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 tc(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 Dp(e,t,r){if(!(typeof e!="object"||e===null)){if(Array.isArray(e)){e.forEach(i=>{typeof i=="object"&&i!==null&&Dp(i,t,r)});return}e.$ref===t&&(e.$ref=r);for(let i of Object.values(e))typeof i=="object"&&i!==null&&Dp(i,t,r)}}function Fn(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 rc(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,Dp(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),Fn(u),c?.(u),Ea(u),u}function Wi(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))})),Fn(a,o),a.additionalProperties=!1,a}async function Hi(e,t,r={}){let{prettyPrint:i=!0}=r,o=i?JSON.stringify(e,null,2):JSON.stringify(e);await(await Promise.resolve().then(()=>pd(_p(),1))).writeFile(t,o,"utf-8")}function nc(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 ac=["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 ac.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"]}),$a=n.Number({minimum:100,maximum:900,description:"OpenType weight (100 thin ... 900 black). Default 400."}),sc=n.Boolean({description:"Whether this source is italic. Default false."}),x$=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"}),S$=n.Object({kind:n.Literal("google"),family:n.String({description:\'Exact Google Fonts family name (e.g. "Inter").\'}),weights:n.Optional(n.Array($a,{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"}),I$=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($a),italic:n.Optional(sc)},{additionalProperties:!1,description:"Local font file to embed"}),w$=n.Object({kind:n.Literal("url"),url:n.String({description:"HTTPS URL of a TTF or OTF file."}),weight:n.Optional($a),italic:n.Optional(sc)},{additionalProperties:!1,description:"Direct TTF/OTF URL (non-Google CDN)"}),C$=n.Object({kind:n.Literal("variable"),url:n.String({description:"HTTPS URL of a variable TTF (`fvar` axis table required)."}),weight:$a,italic:n.Optional(sc),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."}),T$=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($a),italic:n.Optional(sc)},{additionalProperties:!1,description:"Inline base64 font \\u2014 portable"}),Mp=n.Union([x$,S$,I$,T$,w$,C$],{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.\'}),P$=n.Union([n.Literal("sans"),n.Literal("serif"),n.Literal("mono"),n.Literal("display"),n.Literal("handwriting")],{description:"Broad category used for fallback selection"}),Bp=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(P$),sources:n.Array(Mp,{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.*."}),Cr=n.Array(Bp,{description:"Document-scoped font registry. Every non-safe font used in this document must be registered here."}),zi=["eyebrow","display","stat","quote","label","footer","tableHeader","tableCell","chartLabel","tracker","source"],Vp=n.Union(zi.map(e=>n.Literal(e))),Ch=["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."}),Kp=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}),wt=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}),Gp=n.Object({eyebrow:n.Optional(wt),display:n.Optional(wt),stat:n.Optional(wt),quote:n.Optional(wt),label:n.Optional(wt),footer:n.Optional(wt),tableHeader:n.Optional(wt),tableCell:n.Optional(wt),chartLabel:n.Optional(wt),tracker:n.Optional(wt),source:n.Optional(wt)},{additionalProperties:!1}),ic=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}),qp=n.Object({roles:n.Optional(Gp),scale:n.Optional(n.Object({a4:n.Optional(ic),letter:n.Optional(ic),wide169:n.Optional(ic),standard43:n.Optional(ic)},{additionalProperties:!1}))},{additionalProperties:!1}),oc=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}),Wp=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(oc),letter:n.Optional(oc),wide169:n.Optional(oc),standard43:n.Optional(oc)},{additionalProperties:!1}))},{additionalProperties:!1}),jn=n.Object({type:n.Optional(Vp),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}),Hp=n.Object({runningHead:n.Optional(jn),tracker:n.Optional(jn),actionTitle:n.Optional(jn),keyTakeaways:n.Optional(jn),sourceLine:n.Optional(jn),confidentialFooter:n.Optional(jn),logoSlot:n.Optional(jn),cover:n.Optional(jn)},{additionalProperties:!1,description:"Visual recipes; consumers land in #361. No automatic content or presence requirements."}),zp=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."}),Un={palette:n.Optional(Kp),typography:n.Optional(qp),spacing:n.Optional(Wp),chrome:n.Optional(Hp),motif:n.Optional(zp)},Th=n.Object(Un,{additionalProperties:!1});function Ph(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 Jp={display:4,stat:3,quote:1,tableHeader:0,tableCell:0,label:-1,eyebrow:-1,chartLabel:-1,tracker:-1,footer:-2,source:-2};function Eh(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 wh={from:-2,to:5};function $h(e){let t=new Set;for(let r=wh.from;r<=wh.to;r+=1)t.add(Eh(e,r));return[...t].sort((r,i)=>r-i)}function E$(e){let t={};for(let[r,i]of Object.entries(e??{}))typeof i=="string"&&(t[r]=i);return t}function Ah(e){return e==="upper"?{allCaps:!0}:{smallCaps:e==="smallCaps"}}function vh(e){return e&&e.kind!=="none"?e:void 0}function Lh(e,t,r){let i=e.typography?.scale?.[t],o={};for(let a of zi){let s=e.typography?.roles?.[a];s&&(o[a]={...s,size:s.size??(i?Eh(i,Jp[a]):r)})}return o}function Yp(e,t){return{...e,...E$(t)}}function Qp(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 Nh(e,t){let r=Yp(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&&!Qp(a,r))throw new Error(`Unresolvable theme color at ${o}: "${a}" (unknown token or cycle)`)}function cc(e){return/^\\s*\\{\\{\\s*[^{}\\n]*?\\S[^{}\\n]*?\\s*\\}\\}\\s*$/.test(e)}var $$=[{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 r6=$$.map(e=>e.id);var ka=200,Fa=36,ja=600;function A$(e){return typeof e!="number"||!Number.isFinite(e)?ka:Math.min(ja,Math.max(Fa,Math.round(e)))}var v$=32,L$=8*1024*1024,N$=32,Kh=new Set(["family","fontFace","titleFontFace","legendFontFace","dataLabelFontFace","catAxisLabelFontFace","valAxisLabelFontFace"]),Gh=new Set(["heading","body","mono","light"]),qh=new Set(["fontRegistry"]);function am(e,t,r){if(e!=null){if(typeof e=="string"){if(r&&(Kh.has(r)||Gh.has(r))){let i=e.trim();i.length>0&&t.add(i)}return}if(Array.isArray(e)){for(let i of e)am(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))qh.has(o)||am(a,t,o)}}}function Yi(e){let t=new Set;return am(e,t),t}var R$=Yi,k$=Yi;function F$(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 Wh(e,t){if(!e||typeof e!="object")return[];let r=e[t];return Array.isArray(r)?r.filter(F$):[]}function j$(e){return!e||typeof e!="object"?[]:Wh(e.props,"fontRegistry")}function Hh(e){return Wh(e,"fontRegistry")}function U$(...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 _$(e){let t=new Set;for(let r of e??[])t.add(r.family.toLowerCase()),t.add(r.id.toLowerCase());return t}function D$(e){let t=_$(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: ${ac.join(", ")}.`})}return{resolved:r,unresolved:i,warnings:o}}var zh={100:"Thin",200:"ExtraLight",300:"Light",400:"Regular",500:"Medium",600:"SemiBold",700:"Bold",800:"ExtraBold",900:"Black"};function M$(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=zh[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 lc=5*1024*1024;function B$(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)>lc)throw new Error(`Font data payload exceeds ${lc} byte limit`);let o=Buffer.from(r,"base64");if(o.length===0)throw new Error("Decoded font buffer is empty");if(o.length>lc)throw new Error(`Font data payload exceeds ${lc} byte limit`);let a=Yr(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 V$="Mozilla/4.0";async function Rh(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 K$(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 G$(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 kh(e,t,r){return`google|${e}|${t}|${r?"i":"r"}`}async function Jh(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=kh(e.family,m.weight,m.italic),f=e.memoryCache?.get(u);if(f){o.push({data:f,weight:m.weight,italic:m.italic,format:Yr(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:Yr(O)});continue}s.push(m)}if(s.length===0)return{sources:o,warnings:i};let c=s.some(m=>m.italic),l=K$(e.family,Array.from(new Set(s.map(m=>m.weight))),c),p;try{let m=await Rh(l,{headers:{"User-Agent":V$},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=G$(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 Rh(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=kh(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:Yr(w)})}catch(f){i.push(`Google Fonts TTF fetch for "${e.family}" ${m.weight} failed: ${f.message}`)}}return{sources:o,warnings:i}}function q$(e,t,r){return`url|${e}|${t}|${r?"i":"r"}`}async function W$(e){if(!Js(e.url))return{warnings:[`URL font fetch rejected (host not in allowlist or non-HTTPS): ${e.url}`]};let t=q$(e.url,e.weight,e.italic),r=e.memoryCache?.get(t);if(r)return{source:{data:r,weight:e.weight,italic:e.italic,format:Yr(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:Yr(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(!Js(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=Yr(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 Fh=12,jh=16;function H$(e,t){if(e.length<Fh)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=Fh+o*jh;if(a+jh>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 z$(e){let t=H$(e,"OS/2");return!t||t.off+6>e.length?null:e.readUInt16BE(t.off+4)}function J$(e,t,r,i){let o=[],a=z$(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=Ap(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=Lp(t,r);if(!c)return o;let l=c.typographic,p=c.legacy,m=zs(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 Y$=new Set([65536,1330926671,1953658213,1954115633]),Xp=12,Uh=16;function Q$(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<Xp)return a(`${e.length} bytes is shorter than an sfnt header \\u2014 the download is truncated or empty.`);let s=e.readUInt32BE(0);if(!Y$.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=Xp+c*Uh;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=Xp+f*Uh,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 ").\'):zs(e).length===0?a(\'its "name" table carries no readable records.\'):null}var X$=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 Z$(e,t){if(e.format!=="ttf"&&e.format!=="otf")return e;let r=Ap(e.data);if(r.length===0||r.includes(t))return e;let i=Lp(e.weight,e.italic)?.legacy;return{...e,data:vp(e.data,t,i)}}var eA=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 X$,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?Q$(a.data,a.weight,a.italic,e.family):null;if(c){r.push(`[${c.code}] ${c.message}`),t.push(a);continue}let l=Z$(a,e.family);if(s)for(let p of J$(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[B$({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 Jh({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 W$({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}`)}}},Yh=[{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}],tA="https://cdn.jsdelivr.net/gh/rsms/inter@v4.1/docs/font-files/InterVariable.ttf",rA="https://cdn.jsdelivr.net/gh/rsms/inter@v4.1/docs/font-files/InterVariable-Italic.woff2";function nA(){let e=[100,200,300,400,500,600,700,800,900],t=e.map(i=>({kind:"variable",url:tA,weight:i,italic:!1})),r=e.map(i=>({kind:"variable",url:rA,weight:i,italic:!0}));return[...t,...r]}var Qh={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:nA()}};function iA(e){return Qh[e.toLowerCase()]}function sm(e,t){let r=new Map,i=dc(e,t,r),o=[];for(let[a,s]of r)o.push({from:a,to:s});return{doc:i,substitutions:o}}function dc(e,t,r,i){if(e==null)return e;if(typeof e=="string")return i&&(Kh.has(i)||Gh.has(i))?Zp(e,t,r):e;if(Array.isArray(e))return e.map(o=>dc(o,t,r,i));if(typeof e=="object"){let o={};for(let[a,s]of Object.entries(e)){if(qh.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]=Zp(p,t,r);else if(p&&typeof p=="object"){let m=p.family;c[l]=typeof m=="string"?{...p,family:Zp(m,t,r)}:dc(p,t,r,l)}else c[l]=p;o[a]=c;continue}o[a]=dc(s,t,r,a)}return o}return e}function Zp(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 oA={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"},aA={sans:"Calibri",serif:"Georgia",mono:"Consolas",display:"Georgia",handwriting:"Segoe UI"};function Xh(e){let t=e.trim();for(let[i,o]of Object.entries(oA))if(i.toLowerCase()===t.toLowerCase())return o;let r=Yh.find(i=>i.family.toLowerCase()===t.toLowerCase());if(r){let i=aA[r.category];if(i)return i}return"Calibri"}function Zh(e){let t={};for(let r of e){let i=r.trim();i.length!==0&&(Oi(i)||t[i]||(t[i]=Xh(i)))}return t}function sA(e){if((e.fonts?.mode??"custom")==="custom"){if(!e.fonts)return{doc:e.doc,theme:e.theme,warnings:[]};let m=[...new Set([...Yi(e.doc),...Yi(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([...Yi(e.doc),...Yi(e.theme)]),o={...Zh(r),...e.fonts?.substitution??{}},a=sm(e.doc,o),s=sm(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 cA=["primary","secondary","accent","accent4","accent5","accent6"],eg=.75;function lA(e,t){return!Number.isFinite(e)||e<=0||t===void 0||!Number.isFinite(t)||t<=0?eg:t/e}var pA=new Set(["georgia","times new roman","cambria"]),mA=new Set(["consolas","courier new","menlo","monaco"]);function tg(e,t){let r=t==="serif"?"serif":t==="mono"?"monospace":t==="handwriting"?"cursive":t===void 0&&pA.has(e.toLowerCase())?"serif":t===void 0&&mA.has(e.toLowerCase())?"monospace":"sans-serif";return`"${e.replace(/["\\\\]/g,"\\\\$&")}", ${r}`}function uA(e){let t=new Map(Hh(e).map(r=>[r.family.toLowerCase(),r.category]));return r=>tg(r,t.get(r.toLowerCase()))}function Aa(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function sr(e,t){if(e!==void 0&&!Aa(e))return e;let r=Aa(e)?{...e}:{};for(let[i,o]of Object.entries(t)){if(o===void 0)continue;let a=r[i];a===void 0?r[i]=Aa(o)?sr(void 0,o):o:Aa(a)&&Aa(o)&&(r[i]=sr(a,o))}return r}function _h(e,t){return Array.isArray(e)?e.map(r=>sr(r,t)):sr(e,t)}function Dh(e){return e===void 0?void 0:String(e)}function dA(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:Dh(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:Dh(t.titleWeight),color:t.textColor}}),subtitle:sr(e.subtitle,{style:s}),caption:sr(e.caption,{style:c}),xAxis:_h(e.xAxis,p),yAxis:_h(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 fA={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 rg(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}=fA[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 hA(e,t,r){let i=rg(t,r);if(!i)return e;let o=e.resources?.css;return{...e,resources:{...e.resources,css:o?`${i}\n${o}`:i}}}var ng=["actionTitle","takeaway","source","tracker","footer","logo"],ig=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(ng.map(t=>n.Literal(t)),{description:"Content role for quality profiles: actionTitle, takeaway, source, tracker, footer or logo. A profile may require or measure it; the theme only styles it. Tracker, footer, source and logo are chrome, which a deck may draw in the margin band."}))},{additionalProperties:!1}),{$id:"BlockSlot"}),og=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(),ig,{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})),en=n.Record(n.String({pattern:"^[a-zA-Z][a-zA-Z0-9_-]*$"}),og,{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 hc(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:hc(i)},...r&&{properties:Object.fromEntries(Object.entries(r).map(([s,c])=>[s,hc(c)])),required:Object.entries(r).filter(([,s])=>s.required&&s.default===void 0).map(([s])=>s),additionalProperties:!1}}}var pm={$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"}},mm=["$item","$slot","$context","$theme"],Ra=class extends Error{constructor(e){super(e.map(t=>`${t.path}: ${t.message}`).join(`\n`)),this.issues=e,this.name="BlockEvaluationError"}},V=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),fe=e=>e.replace(/~/g,"~0").replace(/\\//g,"~1"),rt=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);function cr(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(!V(r)&&!Array.isArray(r)||!rt(r,o))return;r=r[o]}return r}function Zr(e,t,r=[]){let i;for(let a of r)(t===a||t.startsWith(`${a}/`))&&(i===void 0||a.length>i.length)&&(i=a);if(i!==void 0)return Zr(e,i);let o;for(let a of Object.keys(e))(t===a||t.startsWith(`${a}/`))&&(o===void 0||a.length>o.length)&&(o=a);return o===void 0?t:`${e[o]}${t.slice(o.length)}`}var um=["x","y","w","h","position","grid","gridConfig","direction","gap","weights","alignment","spacing"],dm=e=>e.trim()===""?0:e.trim().split(/\\s+/).length,em=e=>e!=null&&e!==""&&e!==!1&&(!Array.isArray(e)||e.length>0),_n=(e,t,r)=>{throw new Ra([{path:e,code:t,message:r}])};function Oc(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"?V(o)&&typeof o.name=="string":e.type==="object"?V(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"&&cc(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&&dm(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)=>Oc(e.items,l,`${r}/${p}`,i)):o;if(e.type==="component"&&V(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(!V(p))return;let f=typeof p.name=="string"&&V(p.props)?p.props:{};for(let O of um)rt(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}/${fe(O)}`,u+1)};l(o,r)}return e.type==="object"&&V(o)&&e.properties?fm(e.properties,o,r,i):o}function fm(e,t,r,i){let o={};for(let a of Object.keys(t))rt(e,a)||i.push({path:`${r}/${fe(a)}`,code:"block_unknown_slot",message:`Unknown slot \'${a}\'. Expected: ${Object.keys(e).join(", ")}.`});for(let[a,s]of Object.entries(e)){let c=Oc(s,rt(t,a)?t[a]:void 0,`${r}/${fe(a)}`,i);c!==void 0&&Object.defineProperty(o,a,{value:c,enumerable:!0,writable:!0,configurable:!0})}return o}var gA=Object.fromEntries(Object.entries(pm).map(([e,t])=>[e,t.keys]));function yA(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=rt(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 cm=["$if","$each","$count"],gc=e=>typeof e=="string"&&(e===""||e.startsWith("/")),ag=e=>gc(e)?[e]:Array.isArray(e)&&e.length>0&&e.every(gc)?e:void 0;function sg(e,t){if(gc(e))return{root:cm.includes(t)?"$slot":t,pointer:e};if(!cm.includes(t)||!V(e))return;let r=Object.keys(e),i=mm.find(o=>o===r[0]);if(!(r.length!==1||!i||!gc(e[i])))return{root:i,pointer:e[i]}}function va(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)=>va(c,`${t}/${l}`,r,i,o,a+1));return}if(!V(e))return;let s=Object.keys(e).filter(c=>c.startsWith("$"));if(s.length){let c=s[0],l=gA[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=sg(e[c],c),m=c==="$theme"?ag(e[c]):void 0;if(!p&&!m)i.push({path:t,code:"block_invalid_binding",message:cm.includes(c)?`${c} takes a slot pointer such as /items, or one reference: ${mm.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=yA(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")&&rt(e,"props")&&!V(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"&&!rt(e,"then")&&i.push({path:t,code:"block_invalid_binding",message:"$if requires then."}),c==="$each"&&(!rt(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"||va(l,`${t}/${fe(c)}`,r,i,o||rt(e,"$each"),a+1)}function Pr(e){return(V(e)&&V(e.props)?e.props.blocks:void 0)??{}}function xc(e,t,r=[]){if(!T.Check(en,e))return[...T.Errors(en,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/${fe(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&&Oc(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/${fe(m)}`)};for(let[l,p]of Object.entries(a.slots))c(p,`${s}/slots/${fe(l)}`);va(a.body,`${s}/body`,a.slots,i),a.section&&va(a.section,`${s}/section`,a.slots,i),a.slide&&va(a.slide,`${s}/slide`,a.slots,i)}return i.push(...bA(e)),i}function Ii(e,t,r,i=!1){if(Array.isArray(e)){e.forEach((a,s)=>Ii(a,`${t}/${s}`,r,i));return}if(!V(e)||e.enabled===!1)return;if(e.name==="block"&&V(e.props)&&typeof e.props.ref=="string"&&r.push({ref:e.props.ref,path:`${t}/props/ref`,guarded:i}),"$if"in e&&("then"in e||"else"in e)){Ii(e.$if,`${t}/$if`,r,i);let a=p=>{let m=[];return p in e&&Ii(e[p],`${t}/${fe(p)}`,m,i),m},s=a("then"),c=a("else"),l=new Set("then"in e&&"else"in e?s.filter(p=>!p.guarded).map(p=>p.ref).filter(p=>c.some(m=>!m.guarded&&m.ref===p)):[]);for(let p of[...s,...c])r.push({...p,guarded:p.guarded||!l.has(p.ref)});return}let o=Object.keys(e).some(a=>a.startsWith("$")&&a!=="$join");for(let[a,s]of Object.entries(e))Ii(s,`${t}/${fe(a)}`,r,i||o)}function bA(e){let t=[],r=new Map;for(let[c,l]of Object.entries(e)){let p=`/props/blocks/${fe(c)}`,m=[];Ii(l.body,`${p}/body`,m),l.section&&Ii(l.section,`${p}/section`,m),l.slide&&Ii(l.slide,`${p}/slide`,m),r.set(c,m);for(let u of m)rt(e,u.ref)||t.push({path:u.path,code:"block_unknown_reference",message:`Block \'${u.ref}\' is not defined in this document.`})}let i=new Set,o=[],a=new Set,s=c=>{if(!i.has(c)){o.push(c);for(let l of r.get(c)??[]){if(l.guarded||!rt(e,l.ref))continue;let p=o.indexOf(l.ref);if(p!==-1){if(a.has(`${c}\\0${l.ref}`))continue;a.add(`${c}\\0${l.ref}`),t.push({path:l.path,code:"block_expansion_limit",message:`Block \'${l.ref}\' invokes itself on every expansion (${[...o.slice(p),l.ref].join(" \\u2192 ")}), so expansion could only stop at its limit.`});continue}s(l.ref)}o.pop(),i.add(c)}};for(let c of Object.keys(e))s(c);return t}function Qi(e,t,r,i=[]){let o=xc(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(!(!V(s)||s.enabled===!1)){if(s.name==="block"&&V(s.props)&&typeof s.props.ref=="string"){let l=rt(t,s.props.ref)?t[s.props.ref]:void 0;l?((s.props.slots===void 0||V(s.props.slots))&&fm(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}/${fe(l)}`)}};return a(e,""),o}var OA=class{constructor(e,t){R(this,"sourceMap",{});R(this,"blocks",[]);R(this,"pluginOutputs",[]);R(this,"blockSources",new Set);R(this,"nodes",0);this.definitions=e,this.options=t;let r=xc(e,t.format,t.reservedNames);if(r.length)throw new Ra(r)}guard(e,t){(t>64||++this.nodes>5e4)&&_n(e,"block_expansion_limit","Block expansion exceeds the depth/node limit (64/50000).")}operand(e,t,r){let{root:i,pointer:o}=sg(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:cr(r.item,t),source:`${r.itemSource??r.source}${t}`};if(e==="$context"){let i=Zr(r.contextSources??{},t);return{value:cr(r.context,t),source:i===t?r.source:i}}return e==="$theme"?{value:cr(this.options.theme,t),source:r.source}:{value:cr(r.slots,t),source:r.slotSources?Zr(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(V(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(!V(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"?ag(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&&rt(e,"default")&&(u=this.evaluate(e.default,t,r,`${i}/default`,o+1)),u===void 0&&s==="$theme")return _n(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")&&rt(e,"props")&&V(u)&&typeof u.name=="string"){let f=this.sourceMap[r],O=this.evaluate(e.props,t,`${r}/props`,`${i}/props`,o+1),w=V(u.props)?u.props:{};for(let S of Object.keys(w)){let x=`${r}/props/${fe(S)}`;for(let N of Object.keys(this.sourceMap))(N===x||N.startsWith(`${x}/`))&&delete this.sourceMap[N];this.sourceMap[x]=`${f}/props/${fe(S)}`}u={...u,props:{...V(O)?O:{},...w}}}return u}if("$if"in e){let s=this.operand(e.$if,"$if",t),c=em(s.value)?e.then:e.else,l=this.evaluate(c,t,r,i,o+1);return(!V(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:_n(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 _n(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(em);return c>=0&&(this.sourceMap[r]=this.sourceMap[`${r}/${c}`]),(e.keepEmpty===!0?s:s.filter(em)).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):_n(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}/${fe(s)}`,`${i}/${fe(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(!V(e))return e;if(e.name==="block"&&e.enabled!==!1){if(!V(e.props)||typeof e.props.ref!="string")return _n(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&&!V(e.props.slots))return _n(t,"block_invalid_invocation","Block props accept only ref and an object of slots.");let o=rt(this.definitions,e.props.ref)?this.definitions[e.props.ref]:void 0;if(!o)return _n(`${t}/props/ref`,"block_unknown_reference",`Block \'${e.props.ref}\' is not defined in this document.`);let a=[],s=Zr(this.sourceMap,t),c=`${t}/props/slots`,l=fm(o.slots,e.props.slots??{},c,a);if(a.length)throw new Ra(a.map(f=>({...f,path:Zr(this.sourceMap,f.path)})));let p=Object.fromEntries([["",Zr(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/${fe(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}/${fe(o)}`,r+1),enumerable:!0,configurable:!0,writable:!0});return i}};function hm(e){return{type:"object",additionalProperties:!1,properties:Object.fromEntries(Object.entries(e.slots).map(([t,r])=>[t,hc(r)])),required:Object.entries(e.slots).filter(([,t])=>t.required&&t.default===void 0).map(([t])=>t)}}function xA(e){let t=Pr(e);if(!T.Check(en,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(V(o)){o.name==="block"&&V(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}/${fe(s)}`)}};return i(e,""),{definitions:Object.entries(t).map(([o,a])=>({name:o,definitionPointer:`/props/blocks/${fe(o)}`,definition:a,slotsSchema:hm(a)})),invocations:r,invalidDefinitions:!1}}function cg(e,t,r){let i=Pr(e);for(let o of t){let a=cr(e,o);if(!V(a)||!V(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),V(m)&&p.properties)for(let[O,w]of Object.entries(p.properties))l(w,cr(m,`/${fe(O)}`),`${u}/${fe(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=cr(a.props.slots,`/${fe(p)}`);l(m,u===void 0&&m.default!==void 0?m.default:u,`${o}/props/slots/${fe(p)}`,p)}}}function SA(e,t){let r=[];return cg(e,t,(i,o,a,s,c)=>{typeof a=="string"&&o.maxWords!==void 0&&!cc(a)&&r.push({block:i,slot:c,path:s,words:dm(a),maxWords:o.maxWords})}),r}function IA(e,t){let r=[];return cg(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 tm=["null","boolean","number","string","array","object"],Ji=(e,t)=>new Set([...e].filter(r=>t.has(r))),wA=e=>new Set(e.flatMap(t=>[...t])),Mh=e=>e===null?"null":Array.isArray(e)?"array":typeof e;function La(e,t,r=new Set){if(e===!1)return new Set;if(e===!0||r.has(e))return new Set(tm);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(tm);if(e.type){let s=Array.isArray(e.type)?e.type:[e.type];a=Ji(a,new Set(tm.filter(c=>s.includes(c)||c==="number"&&s.includes("integer"))))}if(Object.hasOwn(e,"const")&&(a=Ji(a,new Set([Mh(e.const)]))),Array.isArray(e.enum)&&(a=Ji(a,new Set(e.enum.map(Mh)))),typeof e.$ref=="string"){let s=t(e.$ref);s!==void 0&&(a=Ji(a,La(s,t,o)))}for(let s of["anyOf","oneOf"])Array.isArray(e[s])&&(a=Ji(a,wA(e[s].map(c=>La(c,t,o)))));if(Array.isArray(e.allOf))for(let s of e.allOf)a=Ji(a,La(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 fc(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(fc(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=>La(s,t).has("array")).map(s=>fc(s,t,i))});return Array.isArray(e.allOf)&&o.push(...e.allOf.map(a=>fc(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}),Na=e=>({type:"string",pattern:"^(|/.*)$",description:e}),CA=e=>({anyOf:[Na(e),{type:"array",minItems:1,items:Na(e),description:e}],description:e}),TA=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."}),PA=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."},pc=(e,t)=>({...typeof e=="boolean"?{allOf:[e]}:e,description:t}),rm=e=>typeof e=="boolean"?{}:{...e.description&&{description:e.description},...e.markdownDescription&&{markdownDescription:e.markdownDescription}},EA=e=>({type:"object",required:[e]}),mc=Object.keys(pm);function Ua(e,t,r=[],i="docx"){let o=`BlockTemplate_${t}`,a=TA(i),s=PA(i),c=P=>({description:P,anyOf:[Na(P),...mm.map(Z=>Si({[Z]:Na(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(mc.map(P=>[P,I(EA(P))])),D=I({anyOf:Object.values(v)}),be=[...new Set(["",...mc.flatMap(P=>Array.from({length:P.length-1},(Z,_e)=>P.slice(0,_e+1)))])],Le=I({type:"object",propertyNames:{pattern:`^(?:${be.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),...rm(P)};let Ke=`${o}_Literal${S++}`;w.set(Z,Ke);let ht=e[Ke]={};if(Object.assign(ht,P),typeof P.$ref=="string"){let me=f(P.$ref);if(me!==void 0){let Ce=He(me);typeof Ce=="object"?ht.$ref=Ce.$ref:(delete ht.$ref,Ce||(ht.not={}))}}P.properties&&(ht.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&&(ht.patternProperties=Object.fromEntries(Object.entries(P.patternProperties).map(([me,Ce])=>[me,te(Ce)]))),P.items!==void 0&&(ht.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"&&(ht[me]=te(P[me],me==="additionalItems"));for(let me of["anyOf","oneOf","allOf"])Array.isArray(P[me])&&(ht[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&&(ht[me]=He(P[me]));return{...p(Ke),...rm(P)}}function te(P,Z=!1){if(P===!1)return!1;let _e=rm(P),Ke=typeof P=="object"?{...P}:P;typeof Ke=="object"&&(delete Ke.description,delete Ke.markdownDescription);let ht=`${Z?"sequence":"value"}:${JSON.stringify(Ke)}`,me=O.get(ht);if(me)return{...p(me),..._e};let Ce=`${o}_Value${S++}`;O.set(ht,Ce),e[Ce]={};let zt=p(Ce),sd=La(Ke,f);if(sd.size===0)return e[Ce]={allOf:[He(Ke)]},zt;let cd=()=>Z?te(Ke):zt,ld=()=>Z?{anyOf:[zt,{type:"array",items:zt}]}:zt,zb=()=>Z?cd():te(fc(Ke,f)),ur={};for(let he of mc){let Hn=pm[he].result;if(!(Hn!=="dynamic"&&!sd.has(Hn)&&!(Z&&Hn==="array")))switch(he){case"$slot":case"$item":case"$theme":case"$context":ur[he]=Si({[he]:he==="$theme"?CA(a[he]):Na(a[he]),default:pc(cd(),"Fallback value or binding used only when the referenced value is missing. Null, false and empty values do not trigger it."),...he==="$slot"||he==="$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."}}:{}},[he]);break;case"$if":ur[he]=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:pc(ld(),"Value or components to emit when the slot tested by $if is present."),else:pc(ld(),"Value or components to emit otherwise. Omit to produce no output.")},["$if","then"]);break;case"$each":ur[he]=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:pc(zb(),"One template evaluated per array entry. Use $item for the current entry and a group for multiple components.")},["$each","template"]);break;case"$count":ur[he]=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":ur[he]=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":ur[he]=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 gl=he;throw new Error(`Missing authoring schema for directive ${gl}`)}}}return e[Ce]={allOf:[{if:D,then:{allOf:mc.map(he=>({if:v[he],then:ur[he]?I({...ur[he],properties:Object.fromEntries(Object.entries(ur[he].properties).map(([Hn,gl])=>[Hn,I(gl)]))}):!1}))},else:He(Ke)},{if:Le,then:{properties:Object.fromEntries(Object.entries(ur).map(([he,Hn])=>[he,I(Hn.properties[he])]))}}]},{...zt,..._e}}return e[l]=te(x,!0),p(l)}async function $A(e,t,r){let i=r.preserve??new Set,o=0,a=async(s,c,l)=>{if(l>64||++o>1e5)throw new Ra([{path:Zr(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(!V(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=Zr(e.sourceMap,c),f=await r.render(p,u);e.sourceMap[`${c}/children`]=u,e.pluginOutputs.push(`${c}/children`);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 AA="^\\\\s*\\\\{\\\\{\\\\s*[^{}\\\\n]*?\\\\S[^{}\\\\n]*?\\\\s*\\\\}\\\\}\\\\s*$",gm=e=>JSON.parse(JSON.stringify(e));function nm(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 lg(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=nm(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=nm(e.minimum,e.maximum,"");i&&t.push(i.trim());let o=nm(e.minItems,e.maxItems,"entries");return o&&t.push(o),e.role&&t.push(`Role: ${e.role}`),t}function pg(e){return[e.description,lg(e).join(" \\xB7 ")].filter(Boolean).join(`\n\n`)}function yc(e,t){let r;if(e.type==="component")r=t?{allOf:[t,{properties:{props:{propertyNames:{not:{enum:[...um]},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:AA}]}}o&&(r.pattern="^[^\\\\r\\\\n]*$"),s&&(r.items=yc(s,t)),a&&(r.properties=Object.fromEntries(Object.entries(a).map(([l,p])=>[l,yc(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=pg(e);return i&&(r.markdownDescription=i),r}function mg(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,yc(i,t)])),required:Object.entries(e.slots).filter(([,r])=>r.required&&r.default===void 0).map(([r])=>r)}}function ug(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:mg(e[o],t)}}}))),i}function vA(e,t,r){for(let i of r){let o=e.definitions?.[i.name];if(!o)continue;let a=ug(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=gm(a);return}for(let[m,u]of Object.entries(p))m!=="$ref"&&c(u)};c(o)}}function bc(e,t){if(Array.isArray(e)){e.forEach(r=>bc(r,t));return}if(V(e)){e.name==="block"&&V(e.props)&&typeof e.props.ref=="string"&&t(e.props.ref,e);for(let r of Object.values(e))bc(r,t)}}function ym(e,t){let r=[],i=new Set([t]),o=a=>{let s=Object.prototype.hasOwnProperty.call(e,a)?e[a]:void 0;s&&bc([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 dg(e,t,r){if(e.default!==void 0)return gm(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)=>dg(o,`${t} ${s+1}`,r))}case"object":return fg(e.properties??{},r);case"component":return r==="docx"?{name:"paragraph",props:{text:t}}:{name:"text",props:{text:t}};default:return t}}function fg(e,t){return Object.fromEntries(Object.entries(e).filter(([,r])=>r.required&&r.default===void 0||r.role).map(([r,i])=>[r,dg(i,r,t)]))}function hg(e,t,r){let i;if(V(r.document)){let o=Object.fromEntries(Object.entries(r.document).filter(([a])=>a!=="props"));bc(o,(a,s)=>{if(i||a!==e)return;let c=s.props;i={name:"block",props:{ref:a,...V(c.slots)&&{slots:gm(c.slots)}}}})}return i??{name:"block",props:{ref:e,slots:fg(t.slots,r.format)}}}function LA(e,t){let r=Pr(e);return!T.Check(en,r)||xc(r,t.format).length>0?[]:Object.entries(r).map(([i,o])=>({name:i,format:t.format,template:t.template,definitionPointer:`/props/blocks/${fe(i)}`,description:o.description??"",definition:o,slotsSchema:hm(o),example:hg(i,o,{document:e,format:t.format}),dependencies:ym(r,i)}))}var NA=\'Slide templates were replaced by JSON blocks: define the shared slide content once in props.blocks and invoke it on each slide with { "name": "block", "props": { "ref": "<definition>" } }.\',RA={template:\'A slide no longer names a template: put { "name": "block", "props": { "ref": "<definition>" } } first among its children, with the definition in props.blocks.\',placeholders:\'Placeholders became block slots: fill them in the invocation as { "name": "block", "props": { "ref": "<definition>", "slots": { \\u2026 } } }.\',layout:"Slide layouts are not read: the block a slide invokes lays it out, from its definition in props.blocks."},kA=e=>typeof e=="object"&&e!==null&&!Array.isArray(e);function Xi(e,t,r){let i=Pr(e);return r.map(o=>{let a=FA(e,t,i,o);return a?{...o,suggestion:a}:o})}function FA(e,t,r,i){if(t==="pptx"){if(i.path==="/props/templates")return NA;let a=/^\\/children\\/\\d+\\/props\\/(template|placeholders|layout)$/.exec(i.path);if(a)return RA[a[1]]}if(i.code==="unknown_component"&&i.path.endsWith("/name")){let a=cr(e,i.path);return typeof a!="string"?void 0:Object.prototype.hasOwnProperty.call(r,a)?`"${a}" is a JSON block this document defines, not a component: invoke it as { "name": "block", "props": { "ref": "${a}", "slots": { \\u2026 } } }.`:`If "${a}" is a JSON block, copy its definition from jto://blocks into props.blocks and invoke it as { "name": "block", "props": { "ref": "${a}" } }; blocks are never components.`}let o=/^(.*)\\/props\\/name$/.exec(i.path);if(o){let a=cr(e,o[1]),s=cr(e,i.path);if(kA(a)&&a.name==="block"&&typeof s=="string")return`A block invocation names its definition with ref: { "name": "block", "props": { "ref": "${s}" } }.`}}var gg=["docx","pptx"],im=n.String({pattern:"^[a-z][a-z0-9]*(-[a-z0-9]+)*$",description:"Kebab-case identifier."}),yg=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."}),bg=n.Object({description:n.String({minLength:1}),whenToUse:n.String({minLength:1}),pages:yg,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}),bm=n.Object({id:im,format:n.Union(gg.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:im,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(im,bg,{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 Og(e){let t=[...T.Errors(bm,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 jA(e){return T.Check(bm,e)}function UA(e,t){let r={};for(let i of t){let o=Og(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 _A=/^\\{\\{\\s*([\\s\\S]*?)\\s*\\}\\}$/;function xg(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 DA(e,t,r){let{id:i,variant:o}=xg(e,r.format,t.variant),a=structuredClone(t.children??o.children),s=Sg(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:MA(p,s,r),variant:i}}function Sg(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[...ym(t,s),s])a[c]??(a[c]=structuredClone(t[c]))}return a}function MA(e,t,r){let i=`${r.metadataPointer}/`;return r.markers(e).map(o=>{let a=o.text.match(_A)?.[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=Ig(e,o.path,t);return c?{...s,kind:"slot",...c}:{...s,kind:"text"}})}function Ig(e,t,r){let i=t.lastIndexOf("/props/slots/");if(i<0)return;let a=Cg(e,t.slice(0,i))?.props?.ref;if(typeof a!="string"||!r[a])return;let s=t.slice(i+13).split("/").map(wg),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 wg(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function Cg(e,t){if(t==="")return e;let r=e;for(let i of t.split("/").slice(1).map(wg))if(Array.isArray(r))r=r[Number(i)];else if(r&&typeof r=="object")r=r[i];else return;return r}var BA=[{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."}],VA="Would you send this to a client, unchanged, with your name on it?",KA="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 uc(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function Tg(e,t){let r={...e};return uc(e)&&uc(t)&&Object.keys(t).forEach(i=>{uc(t[i])?!(i in e)||!uc(e[i])?r[i]=t[i]:r[i]=Tg(e[i],t[i]):r[i]=t[i]}),r}function GA(e,t){return Tg(t,e)}function Pg(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 qA="W_HIGHCHARTS_REMOTE_EXPORT";function WA(e,t){if(!Pg(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 HA=3e4,zA=2,JA=250,YA=2e3;function QA(e,t,r){let i=(e||t||r).trim();return(/^https?:\\/\\//i.test(i)?i:`http://${i}`).replace(/\\/+$/,"")}var Om="SERVICE_UNAVAILABLE";function Bh(e){return Object.assign(new Error(e),{code:Om})}function XA(e){let{code:t,status:r}=e;return t===Om?!0:r===429||r!==void 0&&r>=500}function ZA(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 ev(e,t){let r=Math.min(t*2**(e-1),YA);return Math.round(r*(.5+Math.random()*.5))}function Vh(e,t,r){if(e?.name==="AbortError")return Bh(`${t.serviceLabel} timed out after ${r}ms at ${t.url}.`);let i=e instanceof Error?e.message:String(e);return Bh(t.onUnreachable(t.url,i))}async function tv(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 Vh(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 Vh(a,e,i)}}async function rv(e,t,r){let i=new AbortController,o=setTimeout(()=>i.abort(),r);try{return await tv(e,t,i.signal,r)}finally{clearTimeout(o)}}async function nv(e){let r={"Content-Type":"application/json",...typeof e.headers=="function"?await e.headers(e.body):e.headers},i=e.timeoutMs??HA,o=e.retryBaseDelayMs??JA,a=1+Math.max(0,e.retries??zA);for(let s=1;;s++)try{return await rv(e,r,i)}catch(c){let l=c;if(s>=a||!XA(l))throw s===1?l:ZA(l,s);e.onRetry?.(s,l),await new Promise(p=>setTimeout(p,ev(s,o)))}}function Eg(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 $g=4,Tr={collected:0,unique:0,retries:0,maxInFlight:0},om=0;function iv(){return{...Tr}}function ov(){Tr.collected=0,Tr.unique=0,Tr.retries=0,Tr.maxInFlight=0}function av(){Tr.collected++}function sv(){Tr.retries++}var lm=new Map;function cv(e,t){let r=lm.get(e);if(r)return r;let i=Math.max(1,Math.floor(Number.isFinite(t)?t:$g)),o=Eg(i);return lm.set(e,o),o}function lv(e,t,r){return cv(e,t)(r)}function pv(e,t){return`${e}\n${JSON.stringify(t)}`}function mv(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 uv(e){return mv(e.cache,pv(e.serverUrl,e.requestBody),()=>lv(e.serverUrl,e.concurrency,()=>dv(e.send)))}async function dv(e){Tr.unique++,om++,Tr.maxInFlight=Math.max(Tr.maxInFlight,om);try{return await e()}finally{om--}}function fv(){lm.clear()}var Sm={};nt(Sm,{ComponentValidationError:()=>bi,DuplicateComponentError:()=>qi,UnknownPreservedComponentError:()=>Qs,createComponent:()=>Gi,createVersion:()=>Ki,getValidationSummary:()=>Zs,isValidationSuccess:()=>Xs,resolveComponentVersion:()=>yi,validateAgainstSchema:()=>Rp,validateCustomComponentProps:()=>kn});var Ru={};nt(Ru,{AlignmentSchema:()=>rn,BASE_SCHEMA_METADATA:()=>gy,BUILT_IN_DOCX_THEME_NAMES:()=>Xa,BaseComponentPropsSchema:()=>Rg,BlockInvocationPropsSchema:()=>Dn,BorderSchema:()=>Lg,COMPONENT_METADATA:()=>hy,ChartPropsSchema:()=>ou,ColumnsPropsSchema:()=>dn,CommentReplySchema:()=>Hm,CommentSchema:()=>oo,ComponentDefinitionSchema:()=>ft,CustomComponentDefinitionSchema:()=>$r,DEFAULT_DOCX_RENDERER_ID:()=>Qa,DEFAULT_ERROR_CONFIG:()=>Nn,DOCX_RENDERER_IDS:()=>Er,DividerPropsSchema:()=>nu,ERROR_EMOJIS:()=>hi,ERROR_TEMPLATES:()=>ky,EndnotesSchema:()=>Jm,FLOW_CHILDREN:()=>hn,FootnotesSchema:()=>zm,GenerateDocumentRequestSchema:()=>Xy,GenerateDocumentResponseSchema:()=>eb,GroupPropsSchema:()=>eu,HeadingLevelSchema:()=>Ic,HeadingPropsSchema:()=>sn,HighchartsPropsSchema:()=>iu,ImagePropsSchema:()=>ln,IndentSchema:()=>Mn,JSON_SCHEMA_URLS:()=>nb,JsonComponentDefinitionSchema:()=>rb,JsonDocumentParser:()=>Lu,JsonParsingError:()=>fo,JsonValidationError:()=>ho,JustifiedAlignmentSchema:()=>Da,LineSpacingSchema:()=>Ma,ListMarkerFontSchema:()=>Xm,ListPropsSchema:()=>fn,MarginsSchema:()=>vg,NATIVE_RENDER_MODE:()=>Rc,NATIVE_VISUAL_ELEMENT_NAMES:()=>Kg,NativeVisualCanvasSchema:()=>Um,NativeVisualElementSchema:()=>jm,NativeVisualImagePropsSchema:()=>Fm,NativeVisualShapePropsSchema:()=>km,NativeVisualTextPropsSchema:()=>Rm,NoteSchema:()=>Uc,NumberingSchema:()=>Ng,ParagraphIndentSchema:()=>Ba,ParagraphPropsSchema:()=>cn,ReportPropsSchema:()=>gn,RevisionMarkSchema:()=>Wm,RevisionSchema:()=>io,RevisionSegmentSchema:()=>qm,SHARED_DOCX_VERSION:()=>NN,STANDARD_COMPONENTS:()=>ub,STANDARD_COMPONENTS_REGISTRY:()=>Tt,STANDARD_COMPONENTS_SET:()=>yN,SectionPropsSchema:()=>un,SpacingSchema:()=>Ct,StandardComponentDefinitionSchema:()=>Kc,StatisticPropsSchema:()=>pn,THEME_SCHEMA_METADATA:()=>yy,TabStopLeaderSchema:()=>Pm,TabStopSchema:()=>Em,TabStopTypeSchema:()=>Tm,TabStopsSchema:()=>wc,TablePropsSchema:()=>mn,TextBoxPropsSchema:()=>tu,TextSpaceAfterComponentSchema:()=>su,TextSpaceAfterPropsSchema:()=>au,ThemeConfigSchema:()=>so,ThemeOverridesSchema:()=>Mc,TocPropsSchema:()=>ru,ValidateDocumentRequestSchema:()=>Zy,ValidateDocumentResponseSchema:()=>tb,VisualCanvasBackgroundSchema:()=>_m,VisualCanvasSchema:()=>Dm,VisualNativePropsSchema:()=>Bm,VisualPropsSchema:()=>Nc,VisualRasterPropsSchema:()=>Mm,calculatePosition:()=>Vi,clearComponentNamesCache:()=>Ca,collectDocxRendererErrors:()=>jc,collectIndentConflicts:()=>fu,collectNoteRevisionConflicts:()=>hu,collectTextBoxShapeConflicts:()=>gu,compareSemver:()=>di,componentValidator:()=>po,comprehensiveValidateDocument:()=>bu,convertDocxToJsonSchema:()=>uy,convertToJsonSchema:()=>uy,createComponentSchema:()=>Wi,createComponentValidator:()=>Qc,createDocumentValidator:()=>Wc,createDocxComponentSchema:()=>dy,createErrorConfig:()=>wr,createJsonParseError:()=>gi,createJsonValidator:()=>Ty,createMinimalTheme:()=>cy,createThemeValidator:()=>Yc,createValidatedComponent:()=>hN,createValidator:()=>Cy,deepValidateDocument:()=>yu,diffDocuments:()=>tN,diffWords:()=>il,documentValidator:()=>lo,docxComponentDefinitionName:()=>an,docxDocumentBlockTargets:()=>Hg,docxFlowDefinitionName:()=>kc,exportDocxSchemaToFile:()=>fy,exportSchemaToFile:()=>Hi,extractStandardComponentNames:()=>fi,fixDocxSchemaReferences:()=>Vc,fixSchemaReferences:()=>Fn,formatErrorMessage:()=>Sr,formatErrorReport:()=>os,formatErrorSummary:()=>Xr,formatValidationError:()=>mN,formatValidationErrorStrings:()=>uN,formatValidationErrors:()=>iN,generateUnifiedDocumentSchema:()=>by,getAllStandardComponentNames:()=>ly,getErrorSummary:()=>mb,getLiteralValue:()=>It,getObjectSchemaPropertyNames:()=>Ir,getSchemaMetadata:()=>Ta,getStandardComponent:()=>Za,getThemeName:()=>Uy,getValidationContext:()=>pN,getValidationErrors:()=>sN,getValidationSummary:()=>Ey,groupErrorsByPath:()=>Pa,hasCriticalErrors:()=>as,isColumnsComponent:()=>xN,isColumnsProps:()=>Gy,isCustomComponentProps:()=>Jy,isHeadingComponent:()=>SN,isHeadingProps:()=>Vy,isHighchartsComponent:()=>AN,isImageComponent:()=>wN,isImageProps:()=>qy,isListComponent:()=>EN,isListProps:()=>zy,isLiteralSchema:()=>Qr,isNativeVisualProps:()=>qg,isObjectSchema:()=>qt,isParagraphComponent:()=>IN,isParagraphProps:()=>Ky,isReportComponent:()=>bN,isReportProps:()=>My,isSectionComponent:()=>ON,isSectionProps:()=>By,isStandardComponentName:()=>uo,isStatisticComponent:()=>TN,isStatisticProps:()=>Wy,isTableComponent:()=>PN,isTableProps:()=>Hy,isTextBoxComponent:()=>CN,isTextSpaceAfterComponent:()=>LN,isThemeConfig:()=>_y,isTocComponent:()=>$N,isUnionSchema:()=>wa,isValidComponent:()=>gN,isValidDocument:()=>vy,isValidSemver:()=>Ln,isValidTheme:()=>jy,isValidThemeConfig:()=>sy,isValidThemeJson:()=>jy,isValidationSuccess:()=>Py,isVisualComponent:()=>vN,latestVersion:()=>dt,parseJsonComponent:()=>rN,parseJsonWithLineNumbers:()=>nN,parseSemver:()=>vn,safeValidateComponentDefinition:()=>aN,safeValidateComponentProps:()=>oN,sharedCreateComponentSchemaObject:()=>nc,strictComponentValidator:()=>zc,strictDocumentValidator:()=>es,strictThemeValidator:()=>Hc,stripMarkdown:()=>ns,themeValidator:()=>ts,transformAndValidate:()=>fN,transformDocxValueError:()=>uu,transformDocxValueErrors:()=>du,transformValueError:()=>Rn,transformValueErrors:()=>tt,validate:()=>Yy,validateAgainstSchema:()=>Pt,validateBatch:()=>Iy,validateComponent:()=>sl,validateComponentDefinition:()=>Nu,validateComponentProps:()=>mo,validateComponents:()=>dN,validateCustomComponentProps:()=>Iu,validateDocument:()=>Gc,validateDocumentWithSchema:()=>Ry,validateJson:()=>co,validateJsonComponent:()=>qc,validateJsonComponentDoc:()=>Ny,validateJsonDocument:()=>qc,validateStrict:()=>Qy,validateTheme:()=>Jc,validateThemeJson:()=>Ou,validateThemeWithEnhancement:()=>xu,validateWithEnhancement:()=>wy});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\'}),Im=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"\'}),wm=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"]}),Cm=n.Boolean({description:"Disable spell/grammar checking for this text (e.g. code snippets or identifiers)"}),_a=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"]]}),Sc=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}),tn=n.Object({family:Ht,...Sc.properties},{description:"Font definition with family and optional formatting properties",additionalProperties:!1});var rn=n.Union([n.Literal("left"),n.Literal("center"),n.Literal("right")],{description:"Text alignment options"}),Da=n.Union([n.Literal("left"),n.Literal("center"),n.Literal("right"),n.Literal("justify")],{description:"Text alignment options including justify"}),Ic=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}),Ag=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}),vg=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}),Lg=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}),Ma=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}),Ba=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}),Tm=n.Union([n.Literal("left"),n.Literal("right"),n.Literal("center"),n.Literal("decimal"),n.Literal("bar")],{description:"Tab stop alignment type"}),Pm=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"}),Em=n.Object({type:Tm,position:n.Number({minimum:0,description:"Tab stop position in twips (1/20 of a point)"}),leader:n.Optional(Pm)},{description:"Tab stop definition (w:tab in w:tabs)",additionalProperties:!1});var wc=n.Array(Em,{description:"Tab stops for the paragraph. Tab characters (\\\\t) in the text jump to these positions."}),hv=n.Union([n.Literal("character"),n.Literal("column"),n.Literal("margin"),n.Literal("page"),n.Literal("text")],{description:"Horizontal position relative to"}),gv=n.Union([n.Literal("margin"),n.Literal("page"),n.Literal("paragraph"),n.Literal("line"),n.Literal("text")],{description:"Vertical position relative to"}),yv=n.Union([n.Literal("left"),n.Literal("center"),n.Literal("right"),n.Literal("inside"),n.Literal("outside")],{description:"Horizontal alignment"}),bv=n.Union([n.Literal("top"),n.Literal("center"),n.Literal("bottom"),n.Literal("inside"),n.Literal("outside")],{description:"Vertical alignment"}),Ov=n.Union([n.Literal("none"),n.Literal("square"),n.Literal("topAndBottom"),n.Literal("around"),n.Literal("tight"),n.Literal("through")],{description:"Text wrapping type"}),xv=n.Union([n.Literal("bothSides"),n.Literal("left"),n.Literal("right"),n.Literal("largest")],{description:"Text wrapping side"}),wi=n.Object({horizontalPosition:n.Optional(n.Object({relative:n.Optional(hv),align:n.Optional(yv),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(gv),align:n.Optional(bv),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:Ov,side:n.Optional(xv),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}),Ng=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}),Sv={},Rg=n.Object(Sv,{description:"Base component props",additionalProperties:!0});var Iv=n.String({pattern:"^#?[0-9A-Fa-f]{6}$",description:"Hex color (e.g. #FF0000)"}),Tc=["primary","secondary","accent","background","text","text2","background2","accent4","accent5","accent6"],Pc=["accent1","accent2","accent3","tx1","tx2","bg1","bg2"],Bn=n.Union([Iv,...Tc.map(e=>n.Literal(e)),...Pc.map(e=>n.Literal(e))],{description:"Hex color or semantic theme color name"}),eo=["title","subtitle","heading1","heading2","heading3","body","caption",...zi],Va=n.Union(eo.map(e=>n.Literal(e)),{description:"Predefined style name"}),Ka=n.Union([n.Literal("left"),n.Literal("center"),n.Literal("right")],{description:"Horizontal alignment options"}),Ci=n.Union([n.Literal("top"),n.Literal("middle"),n.Literal("bottom")],{description:"Vertical alignment options"}),to=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}),on=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"}),Ec=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}),Ga=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(Ec,{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(Ka),valign:n.Optional(Ci),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(to),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(on),style:n.Optional(Va)},{description:"Text component props",additionalProperties:!1}),qa=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(to),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(on)},{description:"PPTX image component props",additionalProperties:!1}),ro=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"}),Fg=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}),$c=["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"],Ac=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"}),no=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(Ac,{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"}),vc=n.Object({preset:n.Union($c.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"}),Wa=n.Object({type:ro,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(no),pattern:n.Optional(vc)},{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(Fg,{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(Ka),valign:n.Optional(Ci),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(to),rectRadius:n.Optional(n.Number({minimum:0,description:"Corner radius for roundRect shape in inches"})),grid:n.Optional(on),style:n.Optional(Va)},{description:"Shape component props",additionalProperties:!1}),wv=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(Ka),valign:n.Optional(Ci),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})]),Ha=n.Object({rows:n.Array(n.Array(wv,{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(Ka),valign:n.Optional(Ci),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(on)},{description:"PPTX table component props",additionalProperties:!1}),za=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(on)},{description:"PPTX Highcharts component props",additionalProperties:!1}),Cc=(e,t)=>n.Union([n.Number({description:e}),n.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:t})]),Cv=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"}),Tv=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}),kg=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"}),Ja=n.Object({type:Cv,data:n.Array(Tv,{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"})),catAxisTitleFontSize:n.Optional(n.Number({minimum:1,description:"Category axis title font size (points). Defaults to the axis label size."})),catAxisTitleFontFace:n.Optional(n.String({description:"Category axis title font face. Defaults to the axis label face, else the theme body font."})),catAxisTitleColor:n.Optional(n.String({description:"Category axis title color (hex or semantic). Defaults to the axis label color."})),catAxisTitleRotate:n.Optional(n.Number({minimum:-360,maximum:360,description:"Category axis title rotation (degrees). Omit for the PowerPoint default."})),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(kg),valAxisTitle:n.Optional(n.String({description:"Value axis title"})),valAxisTitleFontSize:n.Optional(n.Number({minimum:1,description:"Value axis title font size (points). Defaults to the axis label size."})),valAxisTitleFontFace:n.Optional(n.String({description:"Value axis title font face. Defaults to the axis label face, else the theme body font."})),valAxisTitleColor:n.Optional(n.String({description:"Value axis title color (hex or semantic). Defaults to the axis label color."})),valAxisTitleRotate:n.Optional(n.Number({minimum:-360,maximum:360,description:"Value axis title rotation (degrees), e.g. -90 to read bottom to top. Omit for the PowerPoint default."})),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(kg),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(Cc("X position in inches","X as percentage")),y:n.Optional(Cc("Y position in inches","Y as percentage")),w:n.Optional(Cc("Width in inches","Width as percentage")),h:n.Optional(Cc("Height in inches","Height as percentage")),grid:n.Optional(on)},{description:"Native PowerPoint chart component props",additionalProperties:!1});function Ti(e){if(e.propsRequired!==void 0)return e.propsRequired;let t=e.propsSchema;return t.type!=="object"||(t.required?.length??0)>0}var nn=[{name:"text",propsSchema:Ga,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:qa,hasChildren:!1,category:"content",propsRequired:!0,description:"Image element - displays images from file path, URL, or base64 data."},{name:"shape",propsSchema:Wa,hasChildren:!1,category:"content",description:"Shape element - draws geometric shapes with optional text, fill, and line styling."},{name:"table",propsSchema:Ha,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:za,hasChildren:!1,category:"content",description:"Highcharts element - renders charts via Highcharts Export Server."},{name:"chart",propsSchema:Ja,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 Zi(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:Ti(e)?e.propsSchema:n.Optional(e.propsSchema)},{additionalProperties:!1,description:e.description})}var Ya=n.Union([Zi(nn[0]),Zi(nn[1]),Zi(nn[2]),Zi(nn[3]),Zi(nn[4]),Zi(nn[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")\'}),Pv="^-?\\\\d+(\\\\.\\\\d+)?%$",Ev="^\\\\d+(\\\\.\\\\d+)?%$",jg=n.Union([n.Number({description:"Inches from the canvas origin"}),n.String({pattern:Pv,description:\'Percentage of the canvas extent on this axis, e.g. "25%"\'})],{description:"Position in inches (number) or as a canvas percentage"}),Ug=n.Union([n.Number({minimum:0,description:"Size in inches"}),n.String({pattern:Ev,description:\'Percentage of the canvas extent on this axis, e.g. "50%"\'})],{description:"Size in inches (number) or as a canvas percentage"}),Nm={x:n.Optional(jg),y:n.Optional(jg),w:n.Optional(Ug),h:n.Optional(Ug),rotate:n.Optional(n.Number({description:"Clockwise rotation in degrees"}))},_g=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"}),Lc={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())},$v=n.Object({text:n.String({description:"Run text"}),color:n.Optional(Vn),...Lc,underline:n.Optional(_g),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"}),Av=n.Object({text:n.String({description:"Segment text"}),color:n.Optional(Vn),...Lc,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"}),Dg=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."}),vv=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"}),Mg=n.Union([n.Literal("left"),n.Literal("center"),n.Literal("right"),n.Literal("justify")],{description:"Horizontal text alignment"}),Bg=n.Union([n.Literal("top"),n.Literal("middle"),n.Literal("bottom")],{description:"Vertical text anchoring inside the box"}),Vg=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"}),Rm=n.Object({text:n.Optional(n.String({description:"Plain text content"})),runs:n.Optional(n.Array($v,{minItems:1,description:\'Formatted runs, as an alternative to "text"\'})),...Nm,color:n.Optional(Vn),...Lc,underline:n.Optional(_g),strike:n.Optional(n.Boolean({description:"Strikethrough"})),align:n.Optional(Mg),valign:n.Optional(Bg),margin:n.Optional(Vg),fill:n.Optional(Dg)},{additionalProperties:!1,description:"Native visual text element \\u2014 becomes a Word text box (wps:wsp) inside the drawing group"}),km=n.Object({type:ro,...Nm,fill:n.Optional(Dg),line:n.Optional(vv),text:n.Optional(n.Union([n.String(),n.Array(Av,{minItems:1})],{description:"Text drawn inside the shape"})),...Lc,fontColor:n.Optional(Vn),align:n.Optional(Mg),valign:n.Optional(Bg),margin:n.Optional(Vg),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"}),Fm=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"})),...Nm,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"}),Kg=["text","shape","image"];function $m(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 jm=n.Union([$m("text",Rm,"Text element - a native Word text box drawn on the visual canvas."),$m("shape",km,"Shape element - a native preset-geometry shape, optionally holding text."),$m("image",Fm,"Image element - a native picture; an SVG stays vector.")],{$id:"DocxNativeVisualContent",discriminator:{propertyName:"name"},description:"A single native visual element (text, shape, or image)."}),Um=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"}),_m=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}),Dm=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(_m)},{description:"pptx canvas definition for the visual",additionalProperties:!1}),Gg={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(rn),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(wi),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"}))},Mm=n.Object({renderMode:n.Optional(n.Literal("raster",{description:"Render as a rasterized pptx slide (the default when omitted)."})),canvas:Dm,elements:n.Optional(n.Array(Ya,{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:Fa,maximum:ja,default:ka,description:`Raster resolution in DPI (default ${ka}, range ${Fa}-${ja}). Higher = sharper + larger.`})),serverUrl:n.Optional(n.String({description:"Rasterization service URL override (default from services.pptx)"})),...Gg},{$id:"DocxVisualRasterProps",description:"Visual component props (pptx-rendered graphic)",additionalProperties:!1}),Bm=n.Object({renderMode:n.Literal("native",{description:\'Draw natively as a Word DrawingML group. Requires the "office-open" renderer.\'}),canvas:Um,elements:n.Optional(n.Array(jm,{description:"Native drawing elements (text, shape, image), positioned with x/y/w/h in inches or canvas percentages"})),...Gg},{$id:"DocxVisualNativeProps",description:\'Visual component props (native Word drawing group; requires renderer "office-open")\',additionalProperties:!1}),Nc=n.Union([Mm,Bm],{description:"Visual component props \\u2014 rasterized pptx slide (default) or a native Word drawing group"}),Rc="native";function qg(e){return!!e&&e.renderMode===Rc}var Er=["docxjs","office-open"],Qa="docxjs",Lv=new Set(["text","shape","image"]);function an(e){return`ComponentDefinition_${e}`}function kc(e){return e?`FlowContent_${e}`:"FlowContent"}function Fc(e,t,r){let i=Lm(t);return vm(i,an(r)),e==="visual"&&r!=="office-open"?Rv(i)??i:(r==="office-open"&&Am(i),i)}function jc(e){if(!e||typeof e!="object"||Array.isArray(e))return[];let t=e,r=t.renderer??Qa;if(!Er.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"&&Nv(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 Nv(e,t,r,i){let o=e.props;if(!o||typeof o!="object"||Array.isArray(o))return;let a=o;if(a.renderMode!==Rc)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"||Lv.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 Rv(e){let t=e.anyOf;return Array.isArray(t)&&t.length>0?t[0]:void 0}function Am(e){if(Array.isArray(e)){e.forEach(Am);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))Am(t[i])}function vm(e,t){if(Array.isArray(e)){e.forEach(i=>vm(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))vm(r[i],t)}function Lm(e){if(Array.isArray(e))return e.map(Lm);if(!e||typeof e!="object")return e;let t=Object.create(Object.getPrototypeOf(e));for(let r of Reflect.ownKeys(e))t[r]=Lm(e[r]);return t}function Wg(e){let t=e.definitions??{},r=new Map;for(let o of Er){let a=an(o);t[a]&&r.set(o,Ua(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 Hg(e){let t=e.definitions??{};return Er.filter(r=>t[an(r)]).map(r=>{let i=an(r);return{name:i,componentRef:{$ref:`#/definitions/${i}`}}})}var qm=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}),io=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(qm,{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}),Wm=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}),Jg={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"}))},Hm=n.Object(Jg,{description:"A reply within a comment thread",additionalProperties:!1}),oo=n.Object({...Jg,replies:n.Optional(n.Array(Hm,{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}),sn=n.Object({text:n.String({description:"Heading text (required)"}),level:n.Optional(Ic),font:n.Optional(n.Partial(tn)),language:n.Optional(wm),noProof:n.Optional(Cm),noProofWords:n.Optional(_a),alignment:n.Optional(Da),spacing:n.Optional(Ct),indent:n.Optional(Ba),lineSpacing:n.Optional(n.Union([n.Number({minimum:0}),Ma],{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(io),comment:n.Optional(oo)},{description:"Heading component props",additionalProperties:!1}),Uc=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}),zm=n.Array(Uc,{description:"Footnote bodies for `[^id]` markers in this paragraph, placed at the foot of the page. An unreferenced body is not emitted.",minItems:1}),Jm=n.Array(Uc,{description:"Endnote bodies for `[^id]` markers in this paragraph, collected at the end of the document. An unreferenced body is not emitted.",minItems:1}),kv=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"}),zg=n.Union([n.Literal("margin"),n.Literal("page"),n.Literal("text")],{description:"Frame anchor type"}),Fv=n.Union([n.Literal("left"),n.Literal("center"),n.Literal("right"),n.Literal("inside"),n.Literal("outside")],{description:"Frame horizontal alignment"}),jv=n.Union([n.Literal("top"),n.Literal("center"),n.Literal("bottom"),n.Literal("inside"),n.Literal("outside")],{description:"Frame vertical alignment"}),Uv=n.Object({horizontalPosition:n.Optional(n.Object({relative:n.Optional(zg),align:n.Optional(Fv),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(zg),align:n.Optional(jv),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:kv},{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"}),cn=n.Object({text:n.String({description:"Text content (required)"}),font:n.Optional(n.Partial(tn)),themeStyle:n.Optional(n.String()),language:n.Optional(wm),noProof:n.Optional(Cm),noProofWords:n.Optional(_a),boldColor:n.Optional(Q),spacing:n.Optional(Ct),alignment:n.Optional(_v),indent:n.Optional(Ba),tabStops:n.Optional(wc),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(Uv),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(io),comment:n.Optional(oo),footnotes:n.Optional(zm),endnotes:n.Optional(Jm)},{description:"Paragraph component props (font nested for theme consistency; no flat font properties)",additionalProperties:!1}),ln=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(rn),caption:n.Optional(n.String({description:"Image caption (supports rich text with **bold**, *italic*, ***both***)"})),spacing:n.Optional(Ct),floating:n.Optional(wi),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}),pn=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(rn),spacing:n.Optional(Ct),size:n.Optional(n.Union([n.Literal("small"),n.Literal("medium"),n.Literal("large")]))},{description:"Statistic component props",additionalProperties:!1}),Dv=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})])),Yg=n.Union([n.Literal("left"),n.Literal("center"),n.Literal("right"),n.Literal("justify")],{description:"Horizontal text alignment"}),Qg=n.Union([n.Literal("top"),n.Literal("middle"),n.Literal("bottom")],{description:"Vertical cell alignment"}),Xg=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({...Ma.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}),Km=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})]),Gm=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})]),Mv=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})]),Zg=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})]),Vm=n.Object({color:n.Optional(Q),backgroundColor:n.Optional(Im),horizontalAlignment:n.Optional(Yg),verticalAlignment:n.Optional(Qg),font:n.Optional(Xg),borderColor:n.Optional(Km),borderSize:n.Optional(Gm),padding:n.Optional(Zg),height:n.Optional(n.Number({minimum:0,description:"Cell height in points"}))},{additionalProperties:!1});function Ym(e){let t=n.Union([n.String(),e]),r={color:n.Optional(Q),backgroundColor:n.Optional(Im),horizontalAlignment:n.Optional(Yg),verticalAlignment:n.Optional(Qg),font:n.Optional(Xg),borderColor:n.Optional(Km),borderSize:n.Optional(Gm),padding:n.Optional(Zg),height:n.Optional(n.Number({minimum:0,description:"Cell height in points"})),comment:n.Optional(oo),revision:n.Optional(io)},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(Vm),header:n.Optional(i),cells:n.Optional(n.Array(o))},{additionalProperties:!1});return n.Object({borderColor:n.Optional(Km),borderSize:n.Optional(Gm),hideBorders:n.Optional(Mv),cellDefaults:n.Optional(Vm),headerCellDefaults:n.Optional(Vm),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(Wm),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 mn=Ym(Dv),Qm=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}),un=Qm(),Bv=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}),dn=n.Object({columns:n.Union([n.Number({minimum:1,description:"Number of equal-width columns (converter will normalize to array)"}),n.Array(Bv,{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}),ey=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"}),Xm=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}),Vv=n.Object({level:n.Number({minimum:0,maximum:8,description:"Nesting level (0 = root, 1 = first sublevel, etc.)"}),format:n.Optional(ey),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(Xm)},{description:"Configuration for a single list level",additionalProperties:!1}),fn=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(io)},{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(Vv,{description:"Configuration for each nesting level",minItems:1,maxItems:9})),format:n.Optional(n.Union([ey,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(tn)),spacing:n.Optional(Ag),alignment:n.Optional(Da),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(oo)},{description:"List component props",additionalProperties:!1}),Zm=["revision","comment","footnotes","endnotes"],Kv=n.Partial(n.Omit(sn,Zm)),Gv=n.Partial(n.Omit(cn,Zm)),qv=n.Partial(ln),Wv=n.Partial(pn),Hv=n.Partial(n.Omit(mn,["rows"])),zv=n.Partial(un),Jv=n.Partial(dn),Yv=n.Partial(n.Omit(fn,Zm)),_c=n.Object({heading:n.Optional(Kv),paragraph:n.Optional(Gv),image:n.Optional(qv),statistic:n.Optional(Wv),table:n.Optional(Hv),section:n.Optional(zv),columns:n.Optional(Jv),list:n.Optional(Yv)},{additionalProperties:!0});var Xa=["consulting","devportal","minimal","vermilion"],Qv=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"}),CH=n.Object({width:n.Number({minimum:0}),height:n.Number({minimum:0})},{additionalProperties:!1,description:"Page dimensions in twips"}),Xv=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:Qv},{description:"Page configuration including dimensions and margins",additionalProperties:!1}),ty=n.Object({heading:tn,body:tn,mono:tn,light:tn},{additionalProperties:!1,description:"Font definitions for different text types"}),Zv=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"}),ry={style:Zv,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"}))},Dc=n.Object(ry,{additionalProperties:!1,description:"Paragraph border side definition"}),eL=n.Object(ry,{additionalProperties:!1,description:"Rule drawn between consecutive paragraphs sharing this border set (w:between), in place of their adjoining bottom and top edges"}),ny=n.Object({top:n.Optional(Dc),bottom:n.Optional(Dc),left:n.Optional(Dc),right:n.Optional(Dc),between:n.Optional(eL)},{additionalProperties:!1,description:"Paragraph borders (per side, plus the between-paragraph rule)"}),iy=n.Optional(n.Union([n.Literal("left"),n.Literal("center"),n.Literal("right"),n.Literal("justify")])),lr=n.Object({font:n.Optional(n.Union([n.Literal("heading"),n.Literal("body"),n.Literal("mono"),n.Literal("light")])),...Sc.properties,alignment:iy,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(ny),indent:n.Optional(Mn)},{additionalProperties:!1}),tL=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"}),rL=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"}),nL=n.Object({type:rL,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(tL)},{description:"Tab stop configuration with position, alignment, and optional leader",additionalProperties:!1}),ao=n.Object({font:n.Optional(n.Union([n.Literal("heading"),n.Literal("body"),n.Literal("mono"),n.Literal("light")])),...Sc.properties,alignment:iy,tabStops:n.Optional(n.Array(nL,{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(ny),indent:n.Optional(Mn)},{additionalProperties:!1}),oy=n.Object({normal:n.Optional(lr),heading1:n.Optional(lr),heading2:n.Optional(lr),heading3:n.Optional(lr),heading4:n.Optional(lr),heading5:n.Optional(lr),heading6:n.Optional(lr),title:n.Optional(lr),subtitle:n.Optional(lr),TOC1:n.Optional(ao),TOC2:n.Optional(ao),TOC3:n.Optional(ao),TOC4:n.Optional(ao),TOC5:n.Optional(ao),TOC6:n.Optional(ao)},{additionalProperties:lr,description:"Style definitions supporting predefined styles (normal, heading1..6, title, subtitle), TOC entry styles (TOC1..TOC6), and arbitrary custom styles."}),TH=n.Object({level:n.Union([n.Literal(1),n.Literal(2),n.Literal(3),n.Literal(4),n.Literal(5),n.Literal(6)]),...lr.properties},{additionalProperties:!1}),ay=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}),Mc=n.Object({...Un,colors:n.Optional(n.Partial(ay)),fonts:n.Optional(n.Partial(ty)),styles:n.Optional(oy)},{additionalProperties:!1,description:"Partial theme deep-merged over the resolved named theme: define or override palette tokens, font roles, and named styles in-document."}),so=n.Object({...Un,$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:ay,fonts:ty,fontRegistry:n.Optional(Cr),page:Xv,styles:n.Optional(oy),componentDefaults:n.Optional(_c),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 sy(e){return T.Check(so,e)}function cy(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 eu=n.Object({},{additionalProperties:!1}),iL=e=>n.Object({blocks:n.Optional(en),theme:n.Optional(n.String({description:`Theme name to apply (default: "consulting"). Built-ins: ${Xa.join(", ")} (consulting is the house style).`,examples:[...Xa],default:"consulting"})),themeOverrides:n.Optional(Mc),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(Cr),componentDefaults:n.Optional(_c),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(_a),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}),gn=iL(),tu=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(wi),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"]}}}]))}}}}}}]}),oL=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"}),aL=n.Union([n.Literal("document"),n.Literal("section")],{description:"TOC scope: document-wide or section-only"}),sL=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}),MH=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}),ru=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(oL),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([aL,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(sL,{description:"Custom style mappings for TOC entries. Maps custom theme styles to TOC levels."}))},{description:"Table of Contents component props",additionalProperties:!1}),nu=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}),iu=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%")\'}))}),cL=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"}),lL=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}),ou=n.Object({type:cL,data:n.Array(lL,{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(rn),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(wi),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}),hn=["block","group","heading","paragraph","image","statistic","table","list","toc","divider","highcharts","chart","visual","columns","text-box"],Tt=[{name:"docx",propsSchema:gn,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:un,createPropsSchema:Qm,embeddedComponents:[{path:["header"],arity:"component-array",reportStructure:!0},{path:["footer"],arity:"component-array",reportStructure:!0}],hasChildren:!0,allowedChildren:hn,category:"container",description:"Section container - groups related content with optional title. Use for organizing document structure."},{name:"columns",propsSchema:dn,hasChildren:!0,allowedChildren:hn.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:tu,hasChildren:!0,allowedChildren:hn,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:sn,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:cn,hasChildren:!1,category:"content",description:"Paragraph text - supports formatting like bold, italic, and color. Main content element."},{name:"image",propsSchema:ln,hasChildren:!1,category:"content",description:"Image element - displays images with optional caption. Supports various formats."},{name:"statistic",propsSchema:pn,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:eu,hasChildren:!0,allowedChildren:hn,category:"container",description:"Transparent group of flow components; also the inspectable result of block expansion."},{name:"table",propsSchema:mn,createPropsSchema:Ym,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:fn,hasChildren:!1,category:"content",description:"List element - bulleted or numbered list items. Supports nested lists."},{name:"toc",propsSchema:ru,hasChildren:!1,category:"content",description:"Table of contents - automatically generates TOC from document headings. Supports depth ranges and custom styles."},{name:"divider",propsSchema:nu,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:iu,hasChildren:!1,category:"content",description:"Chart component powered by Highcharts - render line, bar, pie, heatmap, and more with rich options."},{name:"chart",propsSchema:ou,hasChildren:!1,renderers:["office-open"],category:"content",description:\'Native Word chart - editable, scalable, no export server needed. Requires renderer "office-open".\'},{name:"visual",propsSchema:Nc,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 Za(e){return Tt.find(t=>t.name===e)}function ly(){return Tt.map(e=>e.name)}function py(){return Tt.filter(e=>e.hasChildren)}function pL(e){let t=e;return t.type!=="object"||(t.required?.length??0)>0}function Pi(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(Er.map(c=>n.Literal(c)),{description:\'Renderer backend. Omitted defaults to "docxjs".\'})));let a=e.createPropsSchema&&r?e.createPropsSchema(r):e.propsSchema,s=i?Fc(e.name,a,i.renderer):a;return o.props=pL(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 my(e){return Tt.map(t=>Pi(t,e))}function mL(e,t){let r=new Set(e);return e.length===r.size&&t.length===r.size&&t.every(i=>r.has(i))}function Bc(e,t=[],r){let i=u=>!r||!u.renderers||u.renderers.includes(r.renderer),o=Tt.filter(i),a=new Set(hn),s=new Map;for(let u of o)u.hasChildren||s.set(u.name,Pi(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,Pi(x,e,e,r)),O.splice(S,1);continue}if(mL(x.allowedChildren,hn)){s.set(x.name,Pi(x,f,e,r)),O.splice(S,1);continue}if(!x.allowedChildren.filter(be=>o.some(Le=>Le.name===be&&Le.hasChildren)).every(be=>s.has(be)))continue;let v=[...x.allowedChildren.map(be=>s.get(be)).filter(be=>be!==void 0),...t],D=v.length===1?v[0]:n.Union(v);s.set(x.name,Pi(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=hn.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:kc(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 Vc(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 uy(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),Vc(m),Wg(m),Ea(m),m}function dy(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(py().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 Vc(o,i),o.additionalProperties=!1,o}async function fy(e,t,r={}){let{prettyPrint:i=!0}=r,o=i?JSON.stringify(e,null,2):JSON.stringify(e);await(await Promise.resolve().then(()=>pd(_p(),1))).writeFile(t,o,"utf-8")}var hy={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"\'}},gy={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"}},yy={theme:{title:"Theme Configuration",description:"JSON theme configuration for document styling and appearance"}};function by(e={}){return n.Union(Er.map(t=>uL(e,t,t!==Qa)),{description:"Document definition, discriminated by the optional renderer field. Omitted renderer means docxjs."})}function uL(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=an(t),m=n.Recursive(f=>{let O=[];for(let I of o)if(I.versionedProps&&I.versionedProps.length>0){let v=I.versionedProps,D=dt(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 be=v.find(te=>te.version===D),Le={name:n.Literal(I.name),id:n.Optional(n.String()),props:be.propsSchema};be.hasChildren&&(Le.children=n.Optional(n.Array(f)));let He=be.description?`${I.name} (latest: v${D}) \\u2014 ${be.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?Bc(f,O,{renderer:t,requireDiscriminator:r}):{schemas:[],byName:new Map};c=["section",...Za("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=Za("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(Fc(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 Kc=n.Union([...my(n.Any())],{discriminator:{propertyName:"name"},description:"Standard component definition with discriminated union"}),ft=n.Recursive(e=>{let{roots:t,flow:r}=Bc(e);return n.Union([...t,r],{discriminator:{propertyName:"name"},description:"Component definition with discriminated union"})});var au=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")]))}),su=n.Object({name:n.Literal("text-space-after"),id:n.Optional(n.String()),props:au}),$r=su;function dL(e,t){let r=String(e.type||""),i=e.path||"root";return r==="62"||r==="union"?fL(e):e.message?.includes("additionalProperties")?hL(e):e.message?.includes("Required property")?gL(e):r==="string"||r==="number"||r==="boolean"||r==="array"||r==="object"?yL(e):r==="literal"?bL(e):r==="pattern"||r==="RegExp"?OL(e):`At ${i}: ${e.message}`}function fL(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 hL(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=Ir(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 gL(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 yL(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 bL(e){let t=e.path||"root",r=e.schema?JSON.stringify(It(e.schema)):"specific value",i=JSON.stringify(e.value);return`Invalid value at ${t}: Expected exactly ${r} but got ${i}`}function OL(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 uu(e,t,r){let i=wr(r),o=dL(e,i),a={path:e.path||"root",message:Sr(o||e.message,i),code:String(e.type||"validation_error"),value:e.value};if(i.includeSuggestions){let s=SL(e,i);s&&(a.suggestion=Sr(s,i))}if(t&&e.path){let s=xL(t,e.path);s&&(a.line=s.line,a.column=s.column)}return a}function du(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(uu(a,t?.jsonString,void 0)))}return i}function xL(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 SL(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?`${hi.FIX} ${s}`:s}if("props"in o&&typeof o.props=="object")return`Review the props section for unsupported fields. Allowed fields: ${Ir(gn).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(It(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 IL=Object.fromEntries([...Tt.map(e=>[e.name,e.propsSchema]),["custom",$r]]),wL=new Map(Tt.filter(e=>(e.embeddedComponents?.length??0)>0).map(e=>[e.name,e.embeddedComponents])),cu=new Set(Tt.filter(e=>!!e.special?.hasSchemaField).map(e=>e.name)),CL=new Map(Tt.map(e=>[e.name,new Set(["name","id","enabled","props",...e.hasChildren?["children"]:[],...e.special?.hasSchemaField?["$schema","renderer"]:[]])])),TL={id:"string",enabled:"boolean",$schema:"string",renderer:"string"};function xy(e,t,r,i){let o=typeof e.name=="string"?CL.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=TL[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 PL=["path","base64","svg"];function EL(e){if(!e||typeof e!="object")return[];let t=e;return PL.filter(r=>{let i=t[r];return typeof i=="string"&&i.trim().length>0})}function $L(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=EL(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 AL=new Set(["paragraph","heading"]);function fu(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(AL.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 hu(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 vL=new Set(["dashed","dotted","double"]);function gu(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"&&vL.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 yu(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(!cu.has(e.name)){let i=[...cu].map(o=>`"${o}"`).join(", ");r.push({path:"/name",message:`Invalid name "${e.name}". Expected ${i}`,code:"invalid_value"})}if(xy(e,"",t,r),cu.has(e.name)&&"props"in e){let i=pu(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"}),Sy(e,"",t,r),r}function Sy(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)||(xy(s,c,r,i),"props"in s?i.push(...pu(s.name,s.props,`${c}/props`,r)):s.name!=="custom"&&i.push(...pu(s.name,{},`${c}/props`,r)),Sy(s,c,r,i))},a=typeof e.name=="string"?wL.get(e.name):void 0;if(a&&e.props&&typeof e.props=="object")for(let s of a)lu(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 lu(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)=>lu(s,a,`${r}/${c}`,i));return}lu(e[o],a,`${r}/${o}`,i)}function pu(e,t,r,i={}){let o=[],a=IL[e];if(!a)return o.push({path:r.replace(/\\/props$/,"/name"),message:`Unknown component "${e}"`,code:"unknown_component"}),o;let s=LL(a,t),c=i.allowUnknownFields?T.Clean(s,T.Clone(t)):t;if(!T.Check(s,c)){let l=[...T.Errors(s,c)];du(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 LL(e,t){let r=e.anyOf;if(!Array.isArray(r)||r.length===0)return e;let i=r.filter(c=>NL(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 NL(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 bu(e,t=[],r={}){let i=yu(e,r),o=t.filter(a=>!RL(a));return kL([...o,...i])}function RL(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 kL(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 co(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:[gi(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 Iy(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 wy(e,t,r,i){let o=Pt(e,t,i);return!o.valid&&o.errors&&(o.errors=r(o.errors)),o}function Cy(e,t){return(r,i)=>Pt(e,r,{...t,...i})}function Ty(e,t){return(r,i)=>co(e,r,{...t,...i})}function Py(e){return e.valid===!0&&e.data!==void 0}function Ey(e){return e.valid?"Validation successful":!e.errors||e.errors.length===0?"Validation failed with unknown error":Xr(e.errors)}var FL=ft,jL=[{why:"image source mutual-exclusivity",collect:$L},{why:"indent hanging/firstLine mutual-exclusivity",collect:fu},{why:"notes on a revised paragraph",collect:hu},{why:"a text box asking for a shape rendering a shape cannot give it",collect:gu},{why:"renderer profile compatibility",collect:jc}];function $y(e){return jL.flatMap(({collect:t})=>t(e))}function mu(e,t){if(Array.isArray(e))return e.some(i=>mu(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=>mu(i,t))}var Oy;function UL(){return Oy??(Oy=n.Recursive(e=>n.Union(Tt.map(t=>Pi(t,e,e))))),Oy}function _L(e,t,r){return r?.allowUnknownFields===!0||r?.knownCustomNames!==void 0&&r.knownCustomNames.size>0&&mu(e,r.knownCustomNames)||T.Check(UL(),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 Ay(e,t,r){let i=bu(e,t,{allowUnknownFields:r?.allowUnknownFields,knownCustomNames:r?.knownCustomNames});return i.length===0?_L(e,t,r):{valid:!1,errors:i}}function Gc(e,t){let r=Pt(ft,e,t),i=r.errors||[],o=r.valid;!r.valid&&e&&({valid:o,errors:i}=Ay(e,r.errors||[],t));let a=[...$y(e),...Qi(e,Pr(e),"docx",[...t?.knownCustomNames??[]])];a.length>0&&(i=[...i,...a],o=!1),i=Xi(e,"docx",i);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=>!Ly(m.name));c.hasCustomComponents=p}}return c}function qc(e,t){let r=co(FL,e,t),i=r.errors||[],o=r.valid;!r.valid&&r.parsed&&({valid:o,errors:i}=Ay(r.parsed,r.errors||[],t));let a=[...$y(r.parsed),...Qi(r.parsed,Pr(r.parsed),"docx",[...t?.knownCustomNames??[]])];a.length>0&&(i=[...i,...a],o=!1),i=Xi(r.parsed,"docx",i);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=>!Ly(m.name));c.hasCustomComponents=p}}return c}function vy(e){return e.valid===!0&&e.data!==void 0}function DL(){return fi(Kc)}function Ly(e){return DL().includes(e)}function Wc(e){return{validate:(t,r)=>Gc(t,{...e,...r}),validateJson:(t,r)=>qc(t,{...e,...r})}}var lo=Wc({clean:!0,applyDefaults:!0,maxErrors:100}),es=Wc({clean:!1,applyDefaults:!1,maxErrors:100}),Ny=qc,Ry=Gc;function ML(){return{includeEmojis:!Fy(),verbosity:"normal",includeSuggestions:!0,includePath:!0,maxMessageLength:0,includeDocLinks:!1,colorSupport:BL()}}var Pz=ML(),ky={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 Fy(){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 BL(){return typeof process>"u"||process.env?.NO_COLOR?!1:process.env?.FORCE_COLOR||process.stdout?.isTTY?!0:!Fy()}function Jc(e,t){if(typeof e=="string")return{valid:!0,themeName:e};let r=Pt(so,e,t),i={...r};if(r.valid&&r.data){let o=r.data;o.name&&(i.themeName=o.name)}return i}function Ou(e,t){let r=co(so,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 xu(e,t){let r=Jc(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 jy(e){return e.valid===!0&&e.data!==void 0}function Yc(e){return{validate:(t,r)=>Jc(t,{...e,...r}),validateJson:(t,r)=>Ou(t,{...e,...r}),validateWithEnhancement:(t,r)=>xu(t,{...e,...r})}}var ts=Yc({clean:!0,applyDefaults:!0}),Hc=Yc({clean:!1,applyDefaults:!1,maxErrors:10});function Uy(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 _y(e){if(!e||typeof e!="object")return!1;let t=e;return!!(t.colors&&t.fonts)}var Dy={report:gn,section:un,heading:sn,paragraph:cn,columns:dn,image:ln,statistic:pn,table:mn,list:fn,custom:$r};function mo(e,t,r){let i=Dy[e];if(!i){let a=Pt($r,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 Su(e,t){let r=Pt(ft,e,t),i={...r};if(r.valid&&r.data){let o=r.data;i.componentName=o.name,i.isCustomComponent=!uo(o.name)}return i}function Iu(e,t,r){return kn(e,t,r)}function uo(e){return e in Dy}function My(e){return T.Check(gn,e)}function By(e){return T.Check(un,e)}function Vy(e){return T.Check(sn,e)}function Ky(e){return T.Check(cn,e)}function Gy(e){return T.Check(dn,e)}function qy(e){return T.Check(ln,e)}function Wy(e){return T.Check(pn,e)}function Hy(e){return T.Check(mn,e)}function zy(e){return T.Check(fn,e)}function Jy(e){return T.Check($r,e)}function Qc(e){return{validate:(t,r,i)=>uo(t)?mo(t,r,{...e,...i}):mo("custom",r,{...e,...i}),validateDefinition:(t,r)=>Su(t,{...e,...r}),validateCustom:(t,r,i)=>Iu(t,r,{...e,...i})}}var po=Qc({clean:!0,applyDefaults:!0}),zc=Qc({clean:!1,applyDefaults:!1,maxErrors:10}),Yy={document:e=>lo.validate(e),jsonDocument:e=>lo.validateJson(e),theme:e=>ts.validate(e),jsonTheme:e=>ts.validateJson(e),component:(e,t)=>po.validate(e,t),componentDefinition:e=>po.validateDefinition(e),components:e=>e.map(t=>po.validate(t.name,t.props)),isDocument:e=>lo.validate(e).valid,isTheme:e=>ts.validate(e).valid,isComponent:(e,t)=>po.validate(e,t).valid},Qy={document:e=>es.validate(e),jsonDocument:e=>es.validateJson(e),theme:e=>Hc.validate(e),jsonTheme:e=>Hc.validateJson(e),component:(e,t)=>zc.validate(e,t),componentDefinition:e=>zc.validateDefinition(e)};var Xy=n.Object({definition:ft,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"}),Zy=n.Object({definition:n.Unknown(),strict:n.Optional(n.Boolean())},{additionalProperties:!1,description:"Document validation request"}),eb=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"}),tb=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 rb=ft,nb={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 VL=1e6;function ib(e){return e?e.split(/(\\s+)/).filter(t=>t.length>0):[]}function Xc(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 Xc(r)}function il(e,t){if(e===t)return e?[{type:"equal",text:e}]:[];let r=ib(e),i=ib(t);if(r.length===0)return Xc([{type:"insert",text:t}]);if(i.length===0)return Xc([{type:"delete",text:e}]);if(r.length*i.length>VL)return Xc([{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 ns(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 $u=new Set(["paragraph","heading"]);function pr(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 rs(e){let t=e.props?.text;return typeof t=="string"?t.normalize("NFC"):""}function Zc(e){return ns(rs(e))}var GL=/\\{[^}]+\\}/;function el(e){return e.enabled!==!1}function ss(e,t,r,i){e.some(o=>o.type!=="equal"&&GL.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 qL=4e6;function Au(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>qL){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 vu(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 WL(e,t,r,i){let o=Zc(e),a=Zc(t),s=!pr(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 rs(e)!==rs(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=il(o,a);return ss(c,r,t.name,i),(rs(e)!==o||rs(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:{...ol(t,r,i),text:a,revision:Kn(i,c)}}}function ol(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 HL(e,t,r){r.summary.tracked.inserted++;let i=Zc(e),o=[{type:"insert",text:i}];return ss(o,t,e.name,r),{...e,props:{...ol(e,t,r),text:i,revision:Kn(r,o)}}}function zL(e,t,r){r.summary.tracked.deleted++;let o=[{type:"delete",text:Zc(e)}];return ss(o,t,e.name,r),{...e,props:{...ol(e,t,r),text:"",revision:Kn(r,o)}}}function wu(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:ns(i.normalize("NFC")),level:o}})}function JL(e,t,r,i){let o=!pr(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=wu(e),s=wu(t),c=f=>f.map(O=>({text:O.text,level:O.level}));if(pr(c(a),c(s)))return pr(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=Au(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}=vu(O,w,(x,N)=>x.level===N.level);for(let x of S)if(m=!0,x.kind==="paired"){let N=il(x.oldItem.text,x.newItem.text);ss(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 ab(e,t,r){t==="insert"?r.summary.tracked.inserted++:r.summary.tracked.deleted++;let i=wu(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 Cu(e){if(!e)return"";let t=e.content;if(typeof t=="string")return ns(t.normalize("NFC"));if(t&&typeof t=="object"){let i=t.props?.text;if(typeof i=="string")return ns(i.normalize("NFC"))}return""}function Tu(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 ob(e){if(!e)return!0;let t=e.content;return t===void 0||typeof t=="string"?!0:typeof t=="object"&&t.name==="paragraph"}function Pu(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(Cu).join("\\0"),rawKey:s.map(Tu).join("\\0"),rowProps:i[a]}})}function sb(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 tl(e){return Array.isArray(e.props?.columns)&&!e.props?.headers}function YL(e,t,r,i,o,a){let s=il(r,i);ss(s,o,"table",a),(Tu(t)!==r||Tu(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:QL(c.content,i,o,a),revision:Kn(a,s)}}function QL(e,t,r,i){if(!e||typeof e!="object")return t;let o=e;return{...o,props:{...ol(o,r,i),text:t}}}function XL(e,t,r,i){let o=Pu(e),a=Pu(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=!pr(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=!pr(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"}),pr(o.map(x=>x.key),a.map(x=>x.key)))return pr(o.map(x=>x.rawKey),a.map(x=>x.rawKey))?!l&&!p&&pr(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=Au(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}=vu(N,I,(D,be)=>D.cells.length===be.cells.length&&D.cells.every(ob)&&be.cells.every(ob));for(let D of v)if(O=!0,D.kind==="paired"){let be=D.newItem.cells.map((Le,He)=>{let te=Cu(D.oldItem.cells[He]),P=Cu(Le);return te===P?Le??{content:""}:YL(Le,D.oldItem.cells[He],te,P,r,i)});w({...D.newItem,cells:be},{})}else D.kind==="inserted"?(i.summary.tracked.inserted++,w(D.newItem,{revision:Eu(i,"insert")})):(i.summary.tracked.deleted++,w(D.oldItem,{revision:Eu(i,"delete")}))}return O&&i.summary.tracked.modified++,sb(t,u,f)}function cb(e,t,r){t==="insert"?r.summary.tracked.inserted++:r.summary.tracked.deleted++;let i=Pu(e);return sb(e,i,i.map(()=>({revision:Eu(r,t)})))}function Eu(e,t){return{type:t,...e.author&&{author:e.author},...e.date&&{date:e.date}}}function rl(e){return Array.isArray(e.children)}function ZL(e,t){return e.name===t.name}function eN(e,t,r,i){let o=el(e),a=el(t);return!o&&!a?(i.summary.unchangedBlocks++,t):!o&&a?lb(t,r,i):o&&!a?pb(e,r,i)??t:$u.has(t.name)?WL(e,t,r,i):t.name==="list"?JL(e,t,r,i):t.name==="table"&&tl(e)&&tl(t)?XL(e,t,r,i):rl(t)||rl(e)?(!pr(e.props,t.props)&&i.summary.untracked.push({path:r,kind:"modified",component:t.name,detail:"container props changed; new version rendered"}),{...t,children:al(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 lb(e,t,r){return el(e)?$u.has(e.name)?HL(e,t,r):e.name==="list"?ab(e,"insert",r):e.name==="table"&&tl(e)?cb(e,"insert",r):rl(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:al([],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 pb(e,t,r){if(!el(e))return null;if($u.has(e.name))return zL(e,t,r);if(e.name==="list")return ab(e,"delete",r);if(e.name==="table"&&tl(e))return cb(e,"delete",r);if(rl(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=al(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 al(e,t,r,i){let o=Au(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}=vu(p,m,ZL);for(let f of u)if(f.kind==="paired")a.push(eN(f.oldItem,f.newItem,`${r}/${c}`,i)),c++;else if(f.kind==="inserted")a.push(lb(f.newItem,`${r}/${c}`,i)),c++;else{let O=pb(f.oldItem,`${r}/${c}`,i);O&&a.push(O)}}return a}function tN(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};!pr(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=al(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 Lu=class{constructor(){R(this,"schema",ft)}parse(e){let t;if(typeof e=="string")try{t=JSON.parse(e)}catch(r){throw new fo("Invalid JSON syntax",this.extractJSONSyntaxError(r,e))}else t=e;if(typeof t!="object"||t===null||!("name"in t)||t.name!=="docx")throw new ho(\'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 ho("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 fo||t instanceof ho?{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 fo||r instanceof ho){let i=r.validationErrors.map(o=>({...o,...this.findLineNumber(o.path,e,t)}));throw r instanceof fo?new fo(r.message,i):new ho(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{}}},fo=class extends Error{constructor(t,r){super(t);R(this,"validationErrors");this.name="JsonParsingError",this.validationErrors=r}},ho=class extends Error{constructor(t,r){super(t);R(this,"validationErrors");this.name="JsonValidationError",this.validationErrors=r}};function rN(e){return new Lu().parse(e)}function nN(e){return new Lu().parseWithLineNumbers(e)}function iN(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 oN(e,t){let r=uo(e)?e:"custom",i=mo(r,t);return i.valid?{success:!0,data:i.data}:{success:!1,error:i.errors||[]}}function aN(e){let t=Su(e);return t.valid?{success:!0,data:t.data}:{success:!1,error:t.errors||[]}}function sN(e,t){let r=t&&uo(t)?t:"custom",i=mo(r,e);return i.valid?[]:(i.errors||[]).map(o=>o.path?`${o.path}: ${o.message}`:o.message)}function cN(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=lN(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 lN(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(cN)}function is(e){return qn(e).map(t=>{let r=`${t.path}: ${t.message}`;return t.suggestion&&(r+=` (Suggestion: ${t.suggestion})`),r})}function mb(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 os(e){let t=qn(e),r=mb(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 as(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 pN(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 mN=qn,uN=is,nl={report:gn,section:un,heading:sn,paragraph:cn,columns:dn,image:ln,statistic:pn,table:mn,list:fn};function sl(e,t,r){let i=nl[e];if(!i){if(T.Check($r,t))return{success:!0,data:t};let s=[...T.Errors($r,t)];return{success:!1,errors:qn(s),errorStrings:is(s),report:r?.includeReport?os(s):void 0,hasCriticalErrors:r?.checkCritical?as(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:is(o),report:r?.includeReport?os(o):void 0,hasCriticalErrors:r?.checkCritical?as(o):void 0}}function Nu(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(ft,e)){let s=e,c=[];if(s.children&&Array.isArray(s.children))for(let l=0;l<s.children.length;l++){let p=Nu(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(ft,e)];return{success:!1,errors:qn(o),errorStrings:is(o),report:t?.includeReport?os(o):void 0,hasCriticalErrors:t?.checkCritical?as(o):void 0}}function dN(e,t){let r=[],i=0;for(let{name:s,props:c}of e){let l=s in nl?sl(s,c,t):Nu(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 fN(e,t,r){try{let i=r?r(t):t;return sl(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 hN(e,t){let r=nl[e];if(!r)return{success:!1,errors:[{path:"name",message:`Unknown component name: ${e}`,code:"custom",suggestion:`Use one of: ${Object.keys(nl).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:is(i),report:os(i),hasCriticalErrors:as(i)}}function gN(e,t){return sl(e,t).success}var ub=["chart","columns","divider","heading","highcharts","image","list","paragraph","docx","section","statistic","table","text-box","toc","visual","block","group"],yN=new Set(ub);function bN(e){return e.name==="docx"}function ON(e){return e.name==="section"}function xN(e){return e.name==="columns"}function SN(e){return e.name==="heading"}function IN(e){return e.name==="paragraph"}function wN(e){return e.name==="image"}function CN(e){return e.name==="text-box"}function TN(e){return e.name==="statistic"}function PN(e){return e.name==="table"}function EN(e){return e.name==="list"}function $N(e){return e.name==="toc"}function AN(e){return e.name==="highcharts"}function vN(e){return e.name==="visual"}function LN(e){return e.name==="text-space-after"}var NN="1.0.0";var ed={};nt(ed,{BUILT_IN_PPTX_THEME_NAMES:()=>cs,ChartComponentDefaultsSchema:()=>Du,ColorValueSchema:()=>Bn,DEFAULT_ERROR_CONFIG:()=>Nn,DEFAULT_PPTX_RENDERER_ID:()=>yn,GradientFillSchema:()=>no,GradientStopSchema:()=>Ac,HighchartsComponentDefaultsSchema:()=>_u,ImageComponentDefaultsSchema:()=>Fu,PATTERN_FILL_PRESETS:()=>$c,PPTX_BASE_SCHEMA_METADATA:()=>vb,PPTX_COMPONENT_METADATA:()=>Ab,PPTX_JSON_SCHEMA_URLS:()=>Pb,PPTX_RENDERER_IDS:()=>Et,PPTX_SHARED_VERSION:()=>HN,PPTX_STANDARD_COMPONENTS_REGISTRY:()=>$t,PatternFillSchema:()=>vc,PositionSchema:()=>yb,PptxChartPropsSchema:()=>Ja,PptxComponentDefaultsSchema:()=>go,PptxComponentDefinitionSchema:()=>ul,PptxHighchartsPropsSchema:()=>za,PptxImagePropsSchema:()=>qa,PptxJsonComponentDefinitionSchema:()=>Tb,PptxSlideContentSchema:()=>Ya,PptxStandardComponentDefinitionSchema:()=>Cb,PptxTablePropsSchema:()=>Ha,PresentationPropsSchema:()=>Gu,SEMANTIC_COLOR_ALIASES:()=>Pc,SEMANTIC_COLOR_NAMES:()=>Tc,STYLE_NAMES:()=>eo,ShadowSchema:()=>to,ShapeComponentDefaultsSchema:()=>ju,ShapePropsSchema:()=>Wa,ShapeTypeSchema:()=>ro,SlideBackgroundSchema:()=>qu,SlidePropsSchema:()=>Hu,StyleNameSchema:()=>Va,TableComponentDefaultsSchema:()=>Uu,TextComponentDefaultsSchema:()=>ku,TextPropsSchema:()=>Ga,TextRunSchema:()=>Ec,TextStyleSchema:()=>Bu,ThemeConfigSchema:()=>Ei,TransitionSchema:()=>Wu,VerticalAlignmentSchema:()=>Ci,addPptxBlockAuthoringSchemas:()=>dl,collectImageSourceConflicts:()=>Nb,collectPptxRendererErrors:()=>Ku,collectTextContentConflicts:()=>Rb,compareSemver:()=>di,comprehensiveValidatePresentation:()=>Ub,convertToJsonSchema:()=>$b,createAllPptxComponentSchemas:()=>pl,createComponentSchema:()=>Wi,createErrorConfig:()=>wr,createPptxComponentSchemaObject:()=>$i,deepValidatePresentation:()=>jb,dispatchPptxRootByRenderer:()=>fl,exportSchemaToFile:()=>Hi,fixSchemaReferences:()=>Fn,generateUnifiedDocumentSchema:()=>wb,getAllPptxComponentNames:()=>bb,getPptxComponentsByCategory:()=>Ob,getPptxContainerComponents:()=>xb,getPptxContentComponents:()=>Sb,getPptxStandardComponent:()=>yo,isPptxStandardComponent:()=>Ib,isValidSemver:()=>Ln,isValidThemeConfig:()=>db,latestVersion:()=>dt,parseSemver:()=>vn,pptxComponentDefinitionName:()=>Wn,pptxComponentRequiresProps:()=>Ti,preparePptxDocumentBlockTargets:()=>Eb,presentImageSources:()=>Lb,transformValueError:()=>Rn,transformValueErrors:()=>tt,validate:()=>qN,validateJsonPptxTheme:()=>Zu,validateJsonPresentationDocument:()=>Xu,validatePptxTheme:()=>ps,validatePresentationDocument:()=>ls,validateStrict:()=>WN});var ku=n.Partial(Ga),Fu=n.Partial(qa),ju=n.Partial(Wa),Uu=n.Partial(Ha),_u=n.Partial(za),Du=n.Partial(Ja),go=n.Object({text:n.Optional(ku),image:n.Optional(Fu),shape:n.Optional(ju),table:n.Optional(Uu),highcharts:n.Optional(_u),chart:n.Optional(Du)},{additionalProperties:!0});var cs=["consulting","dark","devportal","minimal","vermilion"],RN=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"}),kN=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"}),Mu=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(RN),gutter:n.Optional(kN)},{additionalProperties:!1,description:"Grid layout configuration"}),mr=n.String({pattern:"^#?[0-9A-Fa-f]{6}$",description:"Hex color (e.g. #FF0000)"}),Bu=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"}),Ei=n.Object({...Un,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:mr,secondary:mr,accent:mr,background:mr,text:mr,text2:n.Optional(mr),background2:n.Optional(mr),accent4:n.Optional(mr),accent5:n.Optional(mr),accent6:n.Optional(mr)},{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(Cr),defaults:n.Object({fontSize:n.Number({description:"Default font size in points"}),fontColor:mr},{additionalProperties:!1,description:"Default text styling"}),styles:n.Optional(n.Partial(n.Object(Object.fromEntries(eo.map(e=>[e,Bu]))),{additionalProperties:!1,description:"Named text style presets"})),componentDefaults:n.Optional(go)},{additionalProperties:!1,description:"Presentation theme configuration"});function db(e){return T.Check(Ei,e)}var Et=["pptxgenjs","office-open"],yn="pptxgenjs";function Wn(e){return`PptxComponentDefinition_${e}`}function fb(e,t,r){let i=Vu(t),o=cl(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];FN(i);break}return hb(i),i}function Ku(e){if(!e||typeof e!="object"||Array.isArray(e))return[];let t=e,r=t.renderer??yn;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 FN(e){let i=cl(e)?.rows?.items?.items?.anyOf;if(Array.isArray(i))for(let o of i){let a=cl(o);a?.text&&(delete a.colspan,delete a.rowspan,delete a.margin,hb(o))}}function cl(e){if(!(!e||typeof e!="object"))return e.properties}function hb(e){let t=cl(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 Vu(e){if(Array.isArray(e))return e.map(Vu);if(!e||typeof e!="object")return e;let t=Object.create(Object.getPrototypeOf(e));for(let r of Reflect.ownKeys(e))t[r]=Vu(e[r]);return t}var ll=(e,t)=>n.Union([n.Number({description:e}),n.String({pattern:"^\\\\d+(\\\\.\\\\d+)?%$",description:t})]),jN=n.Object({x:n.Optional(ll("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(ll("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(ll("Frame width in inches","Frame width as a percentage of the enclosing width")),h:n.Optional(ll("Frame height in inches","Frame height as a percentage of the enclosing height")),grid:n.Optional(on),gridConfig:n.Optional(n.Object({...Mu.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."}),Gu=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: "consulting"). Built-ins: ${cs.join(", ")} (consulting is the house style).`,examples:[...cs],default:"consulting"}),Ei],{description:\'Theme to apply: a built-in/custom theme name (default: "consulting"), or an inline theme config object so the document stays self-contained\'})),fontRegistry:n.Optional(Cr),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(go),grid:n.Optional(Mu),blocks:n.Optional(en),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}),yb=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}),qu=n.Object({color:n.Optional(Bn),gradient:n.Optional(no),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}),Wu=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}),Hu=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(qu),transition:n.Optional(Wu),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}),gb=[...nn.map(({name:e})=>e),"block","group"],$t=[{name:"pptx",propsSchema:Gu,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:Hu,hasChildren:!0,allowedChildren:gb,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:jN,hasChildren:!0,allowedChildren:gb,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."},...nn];function yo(e){return $t.find(t=>t.name===e)}function bb(){return $t.map(e=>e.name)}function Ob(e){return $t.filter(t=>t.category===e)}function xb(){return $t.filter(e=>e.hasChildren)}function Sb(){return $t.filter(e=>!e.hasChildren)}function Ib(e){return $t.some(t=>t.name===e)}function $i(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?fb(e.name,e.propsSchema,r.renderer):e.propsSchema,e.hasChildren&&t&&(i.children=n.Optional(n.Array(t))),Ti(e)||(i.props=n.Optional(i.props)),n.Object(i,{additionalProperties:!1,description:e.description})}function pl(e){return $t.map(t=>$i(t,e))}function ml(e,t=[],r){let i=new Map;for(let c of $t)c.hasChildren||i.set(c.name,$i(c,void 0,r));let o=$t.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,$i(p,w,r)),s.splice(l,1);continue}if(!p.allowedChildren){a.set(p.name,$i(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,$i(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 UN(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 wb(e={}){let{customComponents:t=[]}=e,r=Et.map(i=>_N(t,i,i!==yn));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=dt(c.versions.map(m=>m.version)),p=c.versions.map(m=>UN(c,m,i,m.version===l));o.push(...p)}let s=[...ml(i,o,{renderer:t,requireDiscriminator:r}),...o];return s.length===0?n.Object({}):n.Union(s)},{$id:Wn(t)})}var Cb=n.Union([...pl(n.Any())],{discriminator:{propertyName:"name"},description:"Standard PPTX component definition with discriminated union"}),ul=n.Recursive(e=>n.Union([...ml(e)],{discriminator:{propertyName:"name"},description:"PPTX component definition with discriminated union"}));var Tb=ul,Pb={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 dl(e){let t=e.definitions??{},r=new Map;for(let o of Et){let a=Wn(o);t[a]&&r.set(o,Ua(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 fl(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(yn))return;let i=a=>({properties:{renderer:{const:a}},required:["renderer"]}),o=Et.filter(a=>a!==yn&&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(yn)}]}function Eb(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=tc(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 $b(e,t={}){return rc(e,{...t,enrich:r=>{dl(r),fl(r)}})}var Ab={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"}},vb={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 DN=["path","base64","svg"];function Lb(e){if(!e||typeof e!="object")return[];let t=e;return DN.filter(r=>{let i=t[r];return typeof i=="string"&&i.trim().length>0})}function Nb(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=Lb(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 Rb(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 MN=Object.fromEntries($t.map(e=>[e.name,e.propsSchema])),zu=new Set($t.filter(e=>!!e.special?.hasSchemaField).map(e=>e.name)),Qu=new Set(["name","id","enabled","props","children"]),BN=new Set([...Qu,"version"]),kb=new Set([...Qu,"$schema"]);kb.add("renderer");var VN={id:"string",enabled:"boolean",$schema:"string",version:"string"};function Fb(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=VN[a];s&&typeof e[a]!==s&&o.push({path:`${t}/${a}`,message:`Field "${a}" on ${i} must be a ${s}`,code:"invalid_type"})}}function jb(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(!zu.has(e.name)){let o=[...zu].map(a=>`"${a}"`).join(", ");r.push({path:"/name",message:`Invalid name "${e.name}". Expected ${o}`,code:"invalid_value"})}Fb(e,"",kb,"the root component",r);let i=yo(e.name);return"props"in e?zu.has(e.name)&&r.push(...Yu(e.name,e.props,"/props",t)):(!i||Ti(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"}),Ju(e,"",t,r),r}function Ju(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(Fb(c,l,p?BN:Qu,`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.`}),Ju(c,l,r,i);return}let u=yo(c.name),f=`${l}/props`;if("props"in c)i.push(...Yu(c.name,c.props,f,r));else if(u&&Ti(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(...Yu(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}Ju(c,l,r,i)},a=yo(e.name),s=(c,l)=>{if(a?.allowedChildren&&c&&typeof c=="object"&&typeof c.name=="string"&&yo(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 Yu(e,t,r,i={}){let o=[],a=MN[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 Ub(e,t=[],r={}){let i=jb(e,r),o=t.filter(a=>!KN(a));return GN([...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 GN(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 _b(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 ls(e,t={}){let r=Ub(e,[],t);r.push(...Nb(e)),r.push(...Rb(e)),r.push(...Ku(e)),r.push(...Qi(e,Pr(e),"pptx",[...t.knownCustomNames??[]]));let i=r.length===0;return{valid:i,errors:Xi(e,"pptx",r),documentType:"pptx",data:i?e:void 0}}function Xu(e,t={}){let{parsed:r,error:i}=_b(e);return i?{valid:!1,errors:[i],documentType:"pptx"}:ls(r,t)}function ps(e){if(T.Check(Ei,e))return{valid:!0,errors:[],data:e};let t=[...T.Errors(Ei,e)];return{valid:!1,errors:tt(t,{maxErrors:100})}}function Zu(e){let{parsed:t,error:r}=_b(e);return r?{valid:!1,errors:[r]}:ps(t)}var qN={document:e=>ls(e),jsonDocument:e=>Xu(e),theme:e=>ps(e),jsonTheme:e=>Zu(e),isDocument:e=>ls(e).valid,isTheme:e=>ps(e).valid},WN={document:e=>ls(e),jsonDocument:e=>Xu(e),theme:e=>ps(e),jsonTheme:e=>Zu(e)},HN="1.0.0";function Db(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 td(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 Mb(e){if(td(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(td(r))return r;for(let r of Object.values(e))if(td(r))return r;return null}var zN=/^\\d+\\.\\d+\\.\\d+$/;function Bb(e,t,r){let i=[];for(let[o,a]of Object.entries(e.versions)){if(!zN.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:dt(i.map(o=>o.version)),examples:r}}function Vb(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 rd=Vb("@json-to-office/shared-docx","ComponentDefinition","ThemeConfigJson"),nd=Vb("@json-to-office/shared-pptx","PptxComponentDefinition","ThemeConfigJson");function hl(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 x9={"node_modules/@json-to-office/core-docx/package.json":hl("@json-to-office/core-docx",!0),"node_modules/@json-to-office/core-docx/index.d.ts":rd,"node_modules/@json-to-office/core-docx/plugin/index.d.ts":rd,"node_modules/@json-to-office/json-to-docx/package.json":hl("@json-to-office/json-to-docx",!1),"node_modules/@json-to-office/json-to-docx/index.d.ts":rd,"node_modules/@json-to-office/core-pptx/package.json":hl("@json-to-office/core-pptx",!0),"node_modules/@json-to-office/core-pptx/index.d.ts":nd,"node_modules/@json-to-office/core-pptx/plugin/index.d.ts":nd,"node_modules/@json-to-office/json-to-pptx/package.json":hl("@json-to-office/json-to-pptx",!1),"node_modules/@json-to-office/json-to-pptx/index.d.ts":nd},Kb=["@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 id="[plugin-network-off]";var od=globalThis,ad=od.postMessage.bind(od),JN={createComponent:Gi,createVersion:Ki,resolveComponentVersion:yi,ComponentValidationError:bi,DuplicateComponentError:qi},YN={"@sinclair/typebox":dp,"@sinclair/typebox/value":$p,"@json-to-office/shared":xm,"@json-to-office/shared/plugin":Sm,"@json-to-office/shared-docx":Ru,"@json-to-office/shared-pptx":ed,...Object.fromEntries(Kb.map(e=>[e,JN]))},QN=["importScripts","Worker","SharedWorker","indexedDB","caches","BroadcastChannel","FileSystemHandle","FileSystemFileHandle","FileSystemDirectoryHandle","showOpenFilePicker","showSaveFilePicker","showDirectoryPicker","close"],XN=["fetch","XMLHttpRequest","WebSocket","EventSource","WebTransport"];function Gb(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 qb(e){let t=`${id} ${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 ZN(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(`${id} 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 Wb=!1;function eR(e,t){if(Wb)return;Wb=!0;for(let i of QN)Gb(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 XN)Gb(i,qb(i));if(r)try{Object.defineProperty(r,"sendBeacon",{value:qb("navigator.sendBeacon")})}catch{}return}ZN(t)}var Hb=5*1024*1024,ms=null;function tR(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}:{}};ad(i)}async function rR(e){if(e.type==="load"){eR(e.allowNetwork,e.networkOrigins??[]);let t=Db(e.js,YN),r=Mb(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".\');ms=r;let i=Bb(r,e.format,e.examples),o={id:e.id,type:"loaded",metadata:i};ad(o);return}if(e.type==="render"){if(!ms)throw new Error("Plugin is not loaded");let t=yi(ms.name,ms.versions,e.version),r=kn(t.propsSchema,e.props,{componentName:ms.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>Hb)throw new Error(`render() returned ${Math.round(c.length/1024/1024)} MB of components; the limit is ${Hb/1024/1024} MB.`);let l=JSON.parse(c),p={id:e.id,type:"rendered",components:l,warnings:i};ad(p);return}}od.addEventListener("message",e=>{let t=e.data;!t||typeof t!="object"||typeof t.id!="number"||rR(t).catch(r=>tR(t.id,r))});})();\n';export{e as default};
2
+ //# sourceMappingURL=_virtual_jto-sandbox-runtime-D-AIkzB-.js.map