@clawos-dev/clawd 0.2.681 → 0.2.683

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.
@@ -274,7 +274,7 @@ Error generating stack: `+o.message+`
274
274
  * This source code is licensed under the ISC license.
275
275
  * See the LICENSE file in the root directory of this source tree.
276
276
  */const jw=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],Aw=pe("zap",jw);function fp(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Pw(...e){return t=>{let n=!1;const r=e.map(i=>{const o=fp(i,t);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let i=0;i<r.length;i++){const o=r[i];typeof o=="function"?o():fp(e[i],null)}}}}var Rw=Symbol.for("react.lazy"),ol=u0[" use ".trim().toString()];function zw(e){return typeof e=="object"&&e!==null&&"then"in e}function u1(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===Rw&&"_payload"in e&&zw(e._payload)}function Mw(e){const t=Ow(e),n=U.forwardRef((r,i)=>{let{children:o,...s}=r;u1(o)&&typeof ol=="function"&&(o=ol(o._payload));const l=U.Children.toArray(o),a=l.find(Fw);if(a){const u=a.props.children,f=l.map(d=>d===a?U.Children.count(u)>1?U.Children.only(null):U.isValidElement(u)?u.props.children:null:d);return h.jsx(t,{...s,ref:i,children:U.isValidElement(u)?U.cloneElement(u,void 0,f):null})}return h.jsx(t,{...s,ref:i,children:o})});return n.displayName=`${e}.Slot`,n}var Lw=Mw("Slot");function Ow(e){const t=U.forwardRef((n,r)=>{let{children:i,...o}=n;if(u1(i)&&typeof ol=="function"&&(i=ol(i._payload)),U.isValidElement(i)){const s=Uw(i),l=$w(o,i.props);return i.type!==U.Fragment&&(l.ref=r?Pw(r,s):s),U.cloneElement(i,l)}return U.Children.count(i)>1?U.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Dw=Symbol("radix.slottable");function Fw(e){return U.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Dw}function $w(e,t){const n={...t};for(const r in t){const i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...l)=>{const a=o(...l);return i(...l),a}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}function Uw(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function c1(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=c1(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function d1(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=c1(e))&&(r&&(r+=" "),r+=t);return r}const pp=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,mp=d1,Bw=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return mp(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:i,defaultVariants:o}=t,s=Object.keys(i).map(u=>{const f=n==null?void 0:n[u],d=o==null?void 0:o[u];if(f===null)return null;const m=pp(f)||pp(d);return i[u][m]}),l=n&&Object.entries(n).reduce((u,f)=>{let[d,m]=f;return m===void 0||(u[d]=m),u},{}),a=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((u,f)=>{let{class:d,className:m,...p}=f;return Object.entries(p).every(x=>{let[b,I]=x;return Array.isArray(I)?I.includes({...o,...l}[b]):{...o,...l}[b]===I})?[...u,d,m]:u},[]);return mp(e,s,a,n==null?void 0:n.class,n==null?void 0:n.className)},Vw=(e,t)=>{const n=new Array(e.length+t.length);for(let r=0;r<e.length;r++)n[r]=e[r];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},Hw=(e,t)=>({classGroupId:e,validator:t}),f1=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),sl="-",hp=[],Ww="arbitrary..",qw=e=>{const t=Gw(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:s=>{if(s.startsWith("[")&&s.endsWith("]"))return Zw(s);const l=s.split(sl),a=l[0]===""&&l.length>1?1:0;return p1(l,a,t)},getConflictingClassGroupIds:(s,l)=>{if(l){const a=r[s],u=n[s];return a?u?Vw(u,a):a:u||hp}return n[s]||hp}}},p1=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const i=e[t],o=n.nextPart.get(i);if(o){const u=p1(e,t+1,o);if(u)return u}const s=n.validators;if(s===null)return;const l=t===0?e.join(sl):e.slice(t).join(sl),a=s.length;for(let u=0;u<a;u++){const f=s[u];if(f.validator(l))return f.classGroupId}},Zw=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),r=t.slice(0,n);return r?Ww+r:void 0})(),Gw=e=>{const{theme:t,classGroups:n}=e;return Kw(n,t)},Kw=(e,t)=>{const n=f1();for(const r in e){const i=e[r];ld(i,n,r,t)}return n},ld=(e,t,n,r)=>{const i=e.length;for(let o=0;o<i;o++){const s=e[o];Qw(s,t,n,r)}},Qw=(e,t,n,r)=>{if(typeof e=="string"){Yw(e,t,n);return}if(typeof e=="function"){Xw(e,t,n,r);return}Jw(e,t,n,r)},Yw=(e,t,n)=>{const r=e===""?t:m1(t,e);r.classGroupId=n},Xw=(e,t,n,r)=>{if(eb(e)){ld(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(Hw(n,e))},Jw=(e,t,n,r)=>{const i=Object.entries(e),o=i.length;for(let s=0;s<o;s++){const[l,a]=i[s];ld(a,m1(t,l),n,r)}},m1=(e,t)=>{let n=e;const r=t.split(sl),i=r.length;for(let o=0;o<i;o++){const s=r[o];let l=n.nextPart.get(s);l||(l=f1(),n.nextPart.set(s,l)),n=l}return n},eb=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,tb=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const i=(o,s)=>{n[o]=s,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(o){let s=n[o];if(s!==void 0)return s;if((s=r[o])!==void 0)return i(o,s),s},set(o,s){o in n?n[o]=s:i(o,s)}}},Fu="!",gp=":",nb=[],yp=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),rb=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=i=>{const o=[];let s=0,l=0,a=0,u;const f=i.length;for(let b=0;b<f;b++){const I=i[b];if(s===0&&l===0){if(I===gp){o.push(i.slice(a,b)),a=b+1;continue}if(I==="/"){u=b;continue}}I==="["?s++:I==="]"?s--:I==="("?l++:I===")"&&l--}const d=o.length===0?i:i.slice(a);let m=d,p=!1;d.endsWith(Fu)?(m=d.slice(0,-1),p=!0):d.startsWith(Fu)&&(m=d.slice(1),p=!0);const x=u&&u>a?u-a:void 0;return yp(o,p,m,x)};if(t){const i=t+gp,o=r;r=s=>s.startsWith(i)?o(s.slice(i.length)):yp(nb,!1,s,void 0,!0)}if(n){const i=r;r=o=>n({className:o,parseClassName:i})}return r},ib=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let i=[];for(let o=0;o<n.length;o++){const s=n[o],l=s[0]==="[",a=t.has(s);l||a?(i.length>0&&(i.sort(),r.push(...i),i=[]),r.push(s)):i.push(s)}return i.length>0&&(i.sort(),r.push(...i)),r}},ob=e=>({cache:tb(e.cacheSize),parseClassName:rb(e),sortModifiers:ib(e),...qw(e)}),sb=/\s+/,lb=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:o}=t,s=[],l=e.trim().split(sb);let a="";for(let u=l.length-1;u>=0;u-=1){const f=l[u],{isExternal:d,modifiers:m,hasImportantModifier:p,baseClassName:x,maybePostfixModifierPosition:b}=n(f);if(d){a=f+(a.length>0?" "+a:a);continue}let I=!!b,y=r(I?x.substring(0,b):x);if(!y){if(!I){a=f+(a.length>0?" "+a:a);continue}if(y=r(x),!y){a=f+(a.length>0?" "+a:a);continue}I=!1}const v=m.length===0?"":m.length===1?m[0]:o(m).join(":"),w=p?v+Fu:v,E=w+y;if(s.indexOf(E)>-1)continue;s.push(E);const j=i(y,I);for(let S=0;S<j.length;++S){const A=j[S];s.push(w+A)}a=f+(a.length>0?" "+a:a)}return a},ab=(...e)=>{let t=0,n,r,i="";for(;t<e.length;)(n=e[t++])&&(r=h1(n))&&(i&&(i+=" "),i+=r);return i},h1=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=h1(e[r]))&&(n&&(n+=" "),n+=t);return n},ub=(e,...t)=>{let n,r,i,o;const s=a=>{const u=t.reduce((f,d)=>d(f),e());return n=ob(u),r=n.cache.get,i=n.cache.set,o=l,l(a)},l=a=>{const u=r(a);if(u)return u;const f=lb(a,n);return i(a,f),f};return o=s,(...a)=>o(ab(...a))},cb=[],Ve=e=>{const t=n=>n[e]||cb;return t.isThemeGetter=!0,t},g1=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,y1=/^\((?:(\w[\w-]*):)?(.+)\)$/i,db=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,fb=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,pb=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,mb=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,hb=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,gb=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Rn=e=>db.test(e),fe=e=>!!e&&!Number.isNaN(Number(e)),zn=e=>!!e&&Number.isInteger(Number(e)),Ca=e=>e.endsWith("%")&&fe(e.slice(0,-1)),pn=e=>fb.test(e),x1=()=>!0,yb=e=>pb.test(e)&&!mb.test(e),ad=()=>!1,xb=e=>hb.test(e),vb=e=>gb.test(e),kb=e=>!X(e)&&!J(e),wb=e=>lr(e,w1,ad),X=e=>g1.test(e),cr=e=>lr(e,b1,yb),xp=e=>lr(e,Tb,fe),bb=e=>lr(e,_1,x1),Sb=e=>lr(e,S1,ad),vp=e=>lr(e,v1,ad),_b=e=>lr(e,k1,vb),as=e=>lr(e,C1,xb),J=e=>y1.test(e),$i=e=>zr(e,b1),Cb=e=>zr(e,S1),kp=e=>zr(e,v1),Ib=e=>zr(e,w1),Eb=e=>zr(e,k1),us=e=>zr(e,C1,!0),Nb=e=>zr(e,_1,!0),lr=(e,t,n)=>{const r=g1.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},zr=(e,t,n=!1)=>{const r=y1.exec(e);return r?r[1]?t(r[1]):n:!1},v1=e=>e==="position"||e==="percentage",k1=e=>e==="image"||e==="url",w1=e=>e==="length"||e==="size"||e==="bg-size",b1=e=>e==="length",Tb=e=>e==="number",S1=e=>e==="family-name",_1=e=>e==="number"||e==="weight",C1=e=>e==="shadow",jb=()=>{const e=Ve("color"),t=Ve("font"),n=Ve("text"),r=Ve("font-weight"),i=Ve("tracking"),o=Ve("leading"),s=Ve("breakpoint"),l=Ve("container"),a=Ve("spacing"),u=Ve("radius"),f=Ve("shadow"),d=Ve("inset-shadow"),m=Ve("text-shadow"),p=Ve("drop-shadow"),x=Ve("blur"),b=Ve("perspective"),I=Ve("aspect"),y=Ve("ease"),v=Ve("animate"),w=()=>["auto","avoid","all","avoid-page","page","left","right","column"],E=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],j=()=>[...E(),J,X],S=()=>["auto","hidden","clip","visible","scroll"],A=()=>["auto","contain","none"],T=()=>[J,X,a],$=()=>[Rn,"full","auto",...T()],C=()=>[zn,"none","subgrid",J,X],O=()=>["auto",{span:["full",zn,J,X]},zn,J,X],z=()=>[zn,"auto",J,X],oe=()=>["auto","min","max","fr",J,X],Z=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],te=()=>["start","end","center","stretch","center-safe","end-safe"],Q=()=>["auto",...T()],se=()=>[Rn,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...T()],D=()=>[Rn,"screen","full","dvw","lvw","svw","min","max","fit",...T()],q=()=>[Rn,"screen","full","lh","dvh","lvh","svh","min","max","fit",...T()],k=()=>[e,J,X],ae=()=>[...E(),kp,vp,{position:[J,X]}],ye=()=>["no-repeat",{repeat:["","x","y","space","round"]}],_=()=>["auto","cover","contain",Ib,wb,{size:[J,X]}],Re=()=>[Ca,$i,cr],Ce=()=>["","none","full",u,J,X],ue=()=>["",fe,$i,cr],ot=()=>["solid","dashed","dotted","double"],Ft=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Te=()=>[fe,Ca,kp,vp],un=()=>["","none",x,J,X],cn=()=>["none",fe,J,X],Lr=()=>["none",fe,J,X],Ti=()=>[fe,J,X],Or=()=>[Rn,"full",...T()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[pn],breakpoint:[pn],color:[x1],container:[pn],"drop-shadow":[pn],ease:["in","out","in-out"],font:[kb],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[pn],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[pn],shadow:[pn],spacing:["px",fe],text:[pn],"text-shadow":[pn],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Rn,X,J,I]}],container:["container"],columns:[{columns:[fe,X,J,l]}],"break-after":[{"break-after":w()}],"break-before":[{"break-before":w()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:j()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:A()}],"overscroll-x":[{"overscroll-x":A()}],"overscroll-y":[{"overscroll-y":A()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:$()}],"inset-x":[{"inset-x":$()}],"inset-y":[{"inset-y":$()}],start:[{"inset-s":$(),start:$()}],end:[{"inset-e":$(),end:$()}],"inset-bs":[{"inset-bs":$()}],"inset-be":[{"inset-be":$()}],top:[{top:$()}],right:[{right:$()}],bottom:[{bottom:$()}],left:[{left:$()}],visibility:["visible","invisible","collapse"],z:[{z:[zn,"auto",J,X]}],basis:[{basis:[Rn,"full","auto",l,...T()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[fe,Rn,"auto","initial","none",X]}],grow:[{grow:["",fe,J,X]}],shrink:[{shrink:["",fe,J,X]}],order:[{order:[zn,"first","last","none",J,X]}],"grid-cols":[{"grid-cols":C()}],"col-start-end":[{col:O()}],"col-start":[{"col-start":z()}],"col-end":[{"col-end":z()}],"grid-rows":[{"grid-rows":C()}],"row-start-end":[{row:O()}],"row-start":[{"row-start":z()}],"row-end":[{"row-end":z()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":oe()}],"auto-rows":[{"auto-rows":oe()}],gap:[{gap:T()}],"gap-x":[{"gap-x":T()}],"gap-y":[{"gap-y":T()}],"justify-content":[{justify:[...Z(),"normal"]}],"justify-items":[{"justify-items":[...te(),"normal"]}],"justify-self":[{"justify-self":["auto",...te()]}],"align-content":[{content:["normal",...Z()]}],"align-items":[{items:[...te(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...te(),{baseline:["","last"]}]}],"place-content":[{"place-content":Z()}],"place-items":[{"place-items":[...te(),"baseline"]}],"place-self":[{"place-self":["auto",...te()]}],p:[{p:T()}],px:[{px:T()}],py:[{py:T()}],ps:[{ps:T()}],pe:[{pe:T()}],pbs:[{pbs:T()}],pbe:[{pbe:T()}],pt:[{pt:T()}],pr:[{pr:T()}],pb:[{pb:T()}],pl:[{pl:T()}],m:[{m:Q()}],mx:[{mx:Q()}],my:[{my:Q()}],ms:[{ms:Q()}],me:[{me:Q()}],mbs:[{mbs:Q()}],mbe:[{mbe:Q()}],mt:[{mt:Q()}],mr:[{mr:Q()}],mb:[{mb:Q()}],ml:[{ml:Q()}],"space-x":[{"space-x":T()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":T()}],"space-y-reverse":["space-y-reverse"],size:[{size:se()}],"inline-size":[{inline:["auto",...D()]}],"min-inline-size":[{"min-inline":["auto",...D()]}],"max-inline-size":[{"max-inline":["none",...D()]}],"block-size":[{block:["auto",...q()]}],"min-block-size":[{"min-block":["auto",...q()]}],"max-block-size":[{"max-block":["none",...q()]}],w:[{w:[l,"screen",...se()]}],"min-w":[{"min-w":[l,"screen","none",...se()]}],"max-w":[{"max-w":[l,"screen","none","prose",{screen:[s]},...se()]}],h:[{h:["screen","lh",...se()]}],"min-h":[{"min-h":["screen","lh","none",...se()]}],"max-h":[{"max-h":["screen","lh",...se()]}],"font-size":[{text:["base",n,$i,cr]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,Nb,bb]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Ca,X]}],"font-family":[{font:[Cb,Sb,t]}],"font-features":[{"font-features":[X]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[i,J,X]}],"line-clamp":[{"line-clamp":[fe,"none",J,xp]}],leading:[{leading:[o,...T()]}],"list-image":[{"list-image":["none",J,X]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",J,X]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:k()}],"text-color":[{text:k()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ot(),"wavy"]}],"text-decoration-thickness":[{decoration:[fe,"from-font","auto",J,cr]}],"text-decoration-color":[{decoration:k()}],"underline-offset":[{"underline-offset":[fe,"auto",J,X]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:T()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",J,X]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",J,X]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:ae()}],"bg-repeat":[{bg:ye()}],"bg-size":[{bg:_()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},zn,J,X],radial:["",J,X],conic:[zn,J,X]},Eb,_b]}],"bg-color":[{bg:k()}],"gradient-from-pos":[{from:Re()}],"gradient-via-pos":[{via:Re()}],"gradient-to-pos":[{to:Re()}],"gradient-from":[{from:k()}],"gradient-via":[{via:k()}],"gradient-to":[{to:k()}],rounded:[{rounded:Ce()}],"rounded-s":[{"rounded-s":Ce()}],"rounded-e":[{"rounded-e":Ce()}],"rounded-t":[{"rounded-t":Ce()}],"rounded-r":[{"rounded-r":Ce()}],"rounded-b":[{"rounded-b":Ce()}],"rounded-l":[{"rounded-l":Ce()}],"rounded-ss":[{"rounded-ss":Ce()}],"rounded-se":[{"rounded-se":Ce()}],"rounded-ee":[{"rounded-ee":Ce()}],"rounded-es":[{"rounded-es":Ce()}],"rounded-tl":[{"rounded-tl":Ce()}],"rounded-tr":[{"rounded-tr":Ce()}],"rounded-br":[{"rounded-br":Ce()}],"rounded-bl":[{"rounded-bl":Ce()}],"border-w":[{border:ue()}],"border-w-x":[{"border-x":ue()}],"border-w-y":[{"border-y":ue()}],"border-w-s":[{"border-s":ue()}],"border-w-e":[{"border-e":ue()}],"border-w-bs":[{"border-bs":ue()}],"border-w-be":[{"border-be":ue()}],"border-w-t":[{"border-t":ue()}],"border-w-r":[{"border-r":ue()}],"border-w-b":[{"border-b":ue()}],"border-w-l":[{"border-l":ue()}],"divide-x":[{"divide-x":ue()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ue()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ot(),"hidden","none"]}],"divide-style":[{divide:[...ot(),"hidden","none"]}],"border-color":[{border:k()}],"border-color-x":[{"border-x":k()}],"border-color-y":[{"border-y":k()}],"border-color-s":[{"border-s":k()}],"border-color-e":[{"border-e":k()}],"border-color-bs":[{"border-bs":k()}],"border-color-be":[{"border-be":k()}],"border-color-t":[{"border-t":k()}],"border-color-r":[{"border-r":k()}],"border-color-b":[{"border-b":k()}],"border-color-l":[{"border-l":k()}],"divide-color":[{divide:k()}],"outline-style":[{outline:[...ot(),"none","hidden"]}],"outline-offset":[{"outline-offset":[fe,J,X]}],"outline-w":[{outline:["",fe,$i,cr]}],"outline-color":[{outline:k()}],shadow:[{shadow:["","none",f,us,as]}],"shadow-color":[{shadow:k()}],"inset-shadow":[{"inset-shadow":["none",d,us,as]}],"inset-shadow-color":[{"inset-shadow":k()}],"ring-w":[{ring:ue()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:k()}],"ring-offset-w":[{"ring-offset":[fe,cr]}],"ring-offset-color":[{"ring-offset":k()}],"inset-ring-w":[{"inset-ring":ue()}],"inset-ring-color":[{"inset-ring":k()}],"text-shadow":[{"text-shadow":["none",m,us,as]}],"text-shadow-color":[{"text-shadow":k()}],opacity:[{opacity:[fe,J,X]}],"mix-blend":[{"mix-blend":[...Ft(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Ft()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[fe]}],"mask-image-linear-from-pos":[{"mask-linear-from":Te()}],"mask-image-linear-to-pos":[{"mask-linear-to":Te()}],"mask-image-linear-from-color":[{"mask-linear-from":k()}],"mask-image-linear-to-color":[{"mask-linear-to":k()}],"mask-image-t-from-pos":[{"mask-t-from":Te()}],"mask-image-t-to-pos":[{"mask-t-to":Te()}],"mask-image-t-from-color":[{"mask-t-from":k()}],"mask-image-t-to-color":[{"mask-t-to":k()}],"mask-image-r-from-pos":[{"mask-r-from":Te()}],"mask-image-r-to-pos":[{"mask-r-to":Te()}],"mask-image-r-from-color":[{"mask-r-from":k()}],"mask-image-r-to-color":[{"mask-r-to":k()}],"mask-image-b-from-pos":[{"mask-b-from":Te()}],"mask-image-b-to-pos":[{"mask-b-to":Te()}],"mask-image-b-from-color":[{"mask-b-from":k()}],"mask-image-b-to-color":[{"mask-b-to":k()}],"mask-image-l-from-pos":[{"mask-l-from":Te()}],"mask-image-l-to-pos":[{"mask-l-to":Te()}],"mask-image-l-from-color":[{"mask-l-from":k()}],"mask-image-l-to-color":[{"mask-l-to":k()}],"mask-image-x-from-pos":[{"mask-x-from":Te()}],"mask-image-x-to-pos":[{"mask-x-to":Te()}],"mask-image-x-from-color":[{"mask-x-from":k()}],"mask-image-x-to-color":[{"mask-x-to":k()}],"mask-image-y-from-pos":[{"mask-y-from":Te()}],"mask-image-y-to-pos":[{"mask-y-to":Te()}],"mask-image-y-from-color":[{"mask-y-from":k()}],"mask-image-y-to-color":[{"mask-y-to":k()}],"mask-image-radial":[{"mask-radial":[J,X]}],"mask-image-radial-from-pos":[{"mask-radial-from":Te()}],"mask-image-radial-to-pos":[{"mask-radial-to":Te()}],"mask-image-radial-from-color":[{"mask-radial-from":k()}],"mask-image-radial-to-color":[{"mask-radial-to":k()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":E()}],"mask-image-conic-pos":[{"mask-conic":[fe]}],"mask-image-conic-from-pos":[{"mask-conic-from":Te()}],"mask-image-conic-to-pos":[{"mask-conic-to":Te()}],"mask-image-conic-from-color":[{"mask-conic-from":k()}],"mask-image-conic-to-color":[{"mask-conic-to":k()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:ae()}],"mask-repeat":[{mask:ye()}],"mask-size":[{mask:_()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",J,X]}],filter:[{filter:["","none",J,X]}],blur:[{blur:un()}],brightness:[{brightness:[fe,J,X]}],contrast:[{contrast:[fe,J,X]}],"drop-shadow":[{"drop-shadow":["","none",p,us,as]}],"drop-shadow-color":[{"drop-shadow":k()}],grayscale:[{grayscale:["",fe,J,X]}],"hue-rotate":[{"hue-rotate":[fe,J,X]}],invert:[{invert:["",fe,J,X]}],saturate:[{saturate:[fe,J,X]}],sepia:[{sepia:["",fe,J,X]}],"backdrop-filter":[{"backdrop-filter":["","none",J,X]}],"backdrop-blur":[{"backdrop-blur":un()}],"backdrop-brightness":[{"backdrop-brightness":[fe,J,X]}],"backdrop-contrast":[{"backdrop-contrast":[fe,J,X]}],"backdrop-grayscale":[{"backdrop-grayscale":["",fe,J,X]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[fe,J,X]}],"backdrop-invert":[{"backdrop-invert":["",fe,J,X]}],"backdrop-opacity":[{"backdrop-opacity":[fe,J,X]}],"backdrop-saturate":[{"backdrop-saturate":[fe,J,X]}],"backdrop-sepia":[{"backdrop-sepia":["",fe,J,X]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":T()}],"border-spacing-x":[{"border-spacing-x":T()}],"border-spacing-y":[{"border-spacing-y":T()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",J,X]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[fe,"initial",J,X]}],ease:[{ease:["linear","initial",y,J,X]}],delay:[{delay:[fe,J,X]}],animate:[{animate:["none",v,J,X]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[b,J,X]}],"perspective-origin":[{"perspective-origin":j()}],rotate:[{rotate:cn()}],"rotate-x":[{"rotate-x":cn()}],"rotate-y":[{"rotate-y":cn()}],"rotate-z":[{"rotate-z":cn()}],scale:[{scale:Lr()}],"scale-x":[{"scale-x":Lr()}],"scale-y":[{"scale-y":Lr()}],"scale-z":[{"scale-z":Lr()}],"scale-3d":["scale-3d"],skew:[{skew:Ti()}],"skew-x":[{"skew-x":Ti()}],"skew-y":[{"skew-y":Ti()}],transform:[{transform:[J,X,"","none","gpu","cpu"]}],"transform-origin":[{origin:j()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Or()}],"translate-x":[{"translate-x":Or()}],"translate-y":[{"translate-y":Or()}],"translate-z":[{"translate-z":Or()}],"translate-none":["translate-none"],accent:[{accent:k()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:k()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",J,X]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":T()}],"scroll-mx":[{"scroll-mx":T()}],"scroll-my":[{"scroll-my":T()}],"scroll-ms":[{"scroll-ms":T()}],"scroll-me":[{"scroll-me":T()}],"scroll-mbs":[{"scroll-mbs":T()}],"scroll-mbe":[{"scroll-mbe":T()}],"scroll-mt":[{"scroll-mt":T()}],"scroll-mr":[{"scroll-mr":T()}],"scroll-mb":[{"scroll-mb":T()}],"scroll-ml":[{"scroll-ml":T()}],"scroll-p":[{"scroll-p":T()}],"scroll-px":[{"scroll-px":T()}],"scroll-py":[{"scroll-py":T()}],"scroll-ps":[{"scroll-ps":T()}],"scroll-pe":[{"scroll-pe":T()}],"scroll-pbs":[{"scroll-pbs":T()}],"scroll-pbe":[{"scroll-pbe":T()}],"scroll-pt":[{"scroll-pt":T()}],"scroll-pr":[{"scroll-pr":T()}],"scroll-pb":[{"scroll-pb":T()}],"scroll-pl":[{"scroll-pl":T()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",J,X]}],fill:[{fill:["none",...k()]}],"stroke-w":[{stroke:[fe,$i,cr,xp]}],stroke:[{stroke:["none",...k()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},Ab=ub(jb);function ve(...e){return Ab(d1(e))}const Pb=Bw("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-accent text-accent-contrast hover:bg-accent-hover",destructive:"bg-destructive text-white hover:bg-destructive-hover",outline:"border border-border bg-transparent text-text-100 hover:bg-bg-200",ghost:"bg-transparent text-text-200 hover:bg-bg-200 hover:text-text-100"},size:{sm:"h-8 px-3 text-xs",md:"h-9 px-4",lg:"h-11 px-6 text-base"}},defaultVariants:{variant:"default",size:"md"}}),Xn=U.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...i},o)=>{const s=r?Lw:"button";return h.jsx(s,{ref:o,className:ve(Pb({variant:t,size:n}),e),...i})});Xn.displayName="Button";const Rb=["TaskCreate","TaskUpdate","TaskList","TaskGet"];function zb(e){return Rb.includes(e)}function I1(e){return e==="in_progress"||e==="completed"?e:"pending"}function Mb(e,t){if(!t||typeof t!="object")return e;const n=t,r=typeof n.subject=="string"&&n.subject?n.subject:typeof n.content=="string"&&n.content?n.content:null;if(!r)return e;const i=typeof n.activeForm=="string"?n.activeForm:void 0,o=typeof n.description=="string"?n.description:void 0;return[...e,{id:String(e.length+1),content:r,status:I1(n.status),activeForm:i,description:o}]}function Lb(e,t){if(!t||typeof t!="object")return e;const n=t,r=typeof n.taskId=="string"&&n.taskId?n.taskId:typeof n.id=="string"&&n.id?n.id:null;if(!r)return e;const i=e.findIndex(l=>l.id===r);if(i<0)return e;const o=[...e],s={...o[i]};return"status"in n&&(s.status=I1(n.status)),typeof n.subject=="string"&&(s.content=n.subject),typeof n.content=="string"&&(s.content=n.content),typeof n.activeForm=="string"&&(s.activeForm=n.activeForm),typeof n.description=="string"&&(s.description=n.description),o[i]=s,o}function Ob(e){let t=[],n=-1;for(let r=0;r<e.length;r++){const i=e[r];if(i.kind==="task-event")switch(n=r,i.name){case"TaskCreate":t=Mb(t,i.input);break;case"TaskUpdate":t=Lb(t,i.input);break}}return{tasks:t,lastEventIndex:n}}function Db(e){var n;if(e.error)return!1;if(e.pending)return!0;if(e.notifications.length>0)return!1;const t=(n=e.progress)==null?void 0:n.status;return t==="running"?!0:t==="started"?Fb(e.input):!1}function Fb(e){return!e||typeof e!="object"?!1:e.run_in_background===!0}function $b(e){var d;const{tasks:t,lastEventIndex:n}=Ob(e);let r=-1;for(let m=e.length-1;m>=0;m--)if(e[m].kind==="todo-checklist"){r=m;break}const i=[],o=new Map,s=new Map,l=new Map,a=new Map,u=new Map,f=(m,p)=>{var v,w,E,j,S,A;const x=i[m],b=u.get(m),I=b!==void 0&&b!==p.toolUseId;if(!I&&(((v=x.progress)==null?void 0:v.status)==="completed"||((w=x.progress)==null?void 0:w.status)==="failed"))return;if(u.set(m,p.toolUseId),a.set(p.agentId,m),I&&(x.pending=!0,(E=x.toolResultExtra)!=null&&E.stats)){const{stats:T,...$}=x.toolResultExtra;x.toolResultExtra=$}const y={agentId:p.agentId,status:p.status};p.description?y.description=p.description:(j=x.progress)!=null&&j.description&&(y.description=x.progress.description),p.lastToolName?y.lastToolName=p.lastToolName:!I&&((S=x.progress)!=null&&S.lastToolName)&&(y.lastToolName=x.progress.lastToolName),p.stats?y.stats=p.stats:!I&&((A=x.progress)!=null&&A.stats)&&(y.stats=x.progress.stats),x.progress=y,(p.status==="completed"||p.status==="failed")&&(x.pending=!1)};for(let m=0;m<e.length;m++){const p=e[m];switch(p.kind){case"tool-call":{const x={kind:"merged-tool",seq:p.seq,tool:p.tool,toolKind:p.toolKind,toolUseId:p.toolUseId,input:p.input,pending:!0};o.set(p.toolUseId,i.length),i.push(x);break}case"tool-result":{const x=o.get(p.toolUseId);if(x!==void 0){const I=i[x];I.output=p.output,I.error=p.error,I.pending=!1,o.delete(p.toolUseId);break}const b=s.get(p.toolUseId);if(b!==void 0){const I=i[b];I.output=p.output,I.error=p.error,I.pending=!1,p.toolResultExtra&&(I.toolResultExtra=p.toolResultExtra),(d=p.toolResultExtra)!=null&&d.agentId&&(a.set(p.toolResultExtra.agentId,b),u.set(b,p.toolUseId));break}break}case"agent-call":{const x={kind:"merged-agent",seq:p.seq,toolUseId:p.toolUseId,description:p.description,input:p.input,pending:!0,notifications:[]},b=i.length;s.set(p.toolUseId,b),i.push(x);const I=l.get(p.toolUseId);I&&(f(b,I),l.delete(p.toolUseId));break}case"agent-progress":{const x=s.get(p.toolUseId)??a.get(p.agentId);if(x!==void 0){f(x,p);break}const b=l.get(p.toolUseId);if((b==null?void 0:b.status)==="completed"||(b==null?void 0:b.status)==="failed")break;l.set(p.toolUseId,p);break}case"agent-notification":{const x=(p.parentToolUseId?s.get(p.parentToolUseId):void 0)??(p.taskId?a.get(p.taskId):void 0);if(x!==void 0){i[x].notifications.push({text:p.text,taskId:p.taskId});break}i.push({kind:"agent-notification",seq:p.seq,text:p.text,taskId:p.taskId,parentToolUseId:p.parentToolUseId});break}case"todo-checklist":{m===r&&p.todos.length>0&&i.push({kind:"todo-checklist",seq:p.seq,toolUseId:p.toolUseId,todos:p.todos});break}case"task-event":{m===n&&t.length>0&&i.push({kind:"plan-card",seq:p.seq,tasks:t});break}default:i.push(p)}}return i}var we;(function(e){e.assertEqual=i=>{};function t(i){}e.assertIs=t;function n(i){throw new Error}e.assertNever=n,e.arrayToEnum=i=>{const o={};for(const s of i)o[s]=s;return o},e.getValidEnumValues=i=>{const o=e.objectKeys(i).filter(l=>typeof i[i[l]]!="number"),s={};for(const l of o)s[l]=i[l];return e.objectValues(s)},e.objectValues=i=>e.objectKeys(i).map(function(o){return i[o]}),e.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const o=[];for(const s in i)Object.prototype.hasOwnProperty.call(i,s)&&o.push(s);return o},e.find=(i,o)=>{for(const s of i)if(o(s))return s},e.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&Number.isFinite(i)&&Math.floor(i)===i;function r(i,o=" | "){return i.map(s=>typeof s=="string"?`'${s}'`:s).join(o)}e.joinValues=r,e.jsonStringifyReplacer=(i,o)=>typeof o=="bigint"?o.toString():o})(we||(we={}));var wp;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(wp||(wp={}));const K=we.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Dn=e=>{switch(typeof e){case"undefined":return K.undefined;case"string":return K.string;case"number":return Number.isNaN(e)?K.nan:K.number;case"boolean":return K.boolean;case"function":return K.function;case"bigint":return K.bigint;case"symbol":return K.symbol;case"object":return Array.isArray(e)?K.array:e===null?K.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?K.promise:typeof Map<"u"&&e instanceof Map?K.map:typeof Set<"u"&&e instanceof Set?K.set:typeof Date<"u"&&e instanceof Date?K.date:K.object;default:return K.unknown}},L=we.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class Nn extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}format(t){const n=t||function(o){return o.message},r={_errors:[]},i=o=>{for(const s of o.issues)if(s.code==="invalid_union")s.unionErrors.map(i);else if(s.code==="invalid_return_type")i(s.returnTypeError);else if(s.code==="invalid_arguments")i(s.argumentsError);else if(s.path.length===0)r._errors.push(n(s));else{let l=r,a=0;for(;a<s.path.length;){const u=s.path[a];a===s.path.length-1?(l[u]=l[u]||{_errors:[]},l[u]._errors.push(n(s))):l[u]=l[u]||{_errors:[]},l=l[u],a++}}};return i(this),r}static assert(t){if(!(t instanceof Nn))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,we.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=n=>n.message){const n={},r=[];for(const i of this.issues)if(i.path.length>0){const o=i.path[0];n[o]=n[o]||[],n[o].push(t(i))}else r.push(t(i));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}Nn.create=e=>new Nn(e);const $u=(e,t)=>{let n;switch(e.code){case L.invalid_type:e.received===K.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case L.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,we.jsonStringifyReplacer)}`;break;case L.unrecognized_keys:n=`Unrecognized key(s) in object: ${we.joinValues(e.keys,", ")}`;break;case L.invalid_union:n="Invalid input";break;case L.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${we.joinValues(e.options)}`;break;case L.invalid_enum_value:n=`Invalid enum value. Expected ${we.joinValues(e.options)}, received '${e.received}'`;break;case L.invalid_arguments:n="Invalid function arguments";break;case L.invalid_return_type:n="Invalid function return type";break;case L.invalid_date:n="Invalid date";break;case L.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:we.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case L.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case L.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case L.custom:n="Invalid input";break;case L.invalid_intersection_types:n="Intersection results could not be merged";break;case L.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case L.not_finite:n="Number must be finite";break;default:n=t.defaultError,we.assertNever(e)}return{message:n}};let Ub=$u;function Bb(){return Ub}const Vb=e=>{const{data:t,path:n,errorMaps:r,issueData:i}=e,o=[...n,...i.path||[]],s={...i,path:o};if(i.message!==void 0)return{...i,path:o,message:i.message};let l="";const a=r.filter(u=>!!u).slice().reverse();for(const u of a)l=u(s,{data:t,defaultError:l}).message;return{...i,path:o,message:l}};function W(e,t){const n=Bb(),r=Vb({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===$u?void 0:$u].filter(i=>!!i)});e.common.issues.push(r)}class ut{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){const r=[];for(const i of n){if(i.status==="aborted")return re;i.status==="dirty"&&t.dirty(),r.push(i.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,n){const r=[];for(const i of n){const o=await i.key,s=await i.value;r.push({key:o,value:s})}return ut.mergeObjectSync(t,r)}static mergeObjectSync(t,n){const r={};for(const i of n){const{key:o,value:s}=i;if(o.status==="aborted"||s.status==="aborted")return re;o.status==="dirty"&&t.dirty(),s.status==="dirty"&&t.dirty(),o.value!=="__proto__"&&(typeof s.value<"u"||i.alwaysSet)&&(r[o.value]=s.value)}return{status:t.value,value:r}}}const re=Object.freeze({status:"aborted"}),Zi=e=>({status:"dirty",value:e}),Ot=e=>({status:"valid",value:e}),bp=e=>e.status==="aborted",Sp=e=>e.status==="dirty",yi=e=>e.status==="valid",ll=e=>typeof Promise<"u"&&e instanceof Promise;var ee;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(ee||(ee={}));class on{constructor(t,n,r,i){this._cachedPath=[],this.parent=t,this.data=n,this._path=r,this._key=i}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const _p=(e,t)=>{if(yi(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new Nn(e.common.issues);return this._error=n,this._error}}};function de(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:i}=e;if(t&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:i}:{errorMap:(s,l)=>{const{message:a}=e;return s.code==="invalid_enum_value"?{message:a??l.defaultError}:typeof l.data>"u"?{message:a??r??l.defaultError}:s.code!=="invalid_type"?{message:l.defaultError}:{message:a??n??l.defaultError}},description:i}}class ge{get description(){return this._def.description}_getType(t){return Dn(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:Dn(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new ut,ctx:{common:t.parent.common,data:t.data,parsedType:Dn(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if(ll(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){const n=this._parse(t);return Promise.resolve(n)}parse(t,n){const r=this.safeParse(t,n);if(r.success)return r.data;throw r.error}safeParse(t,n){const r={common:{issues:[],async:(n==null?void 0:n.async)??!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Dn(t)},i=this._parseSync({data:t,path:r.path,parent:r});return _p(r,i)}"~validate"(t){var r,i;const n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Dn(t)};if(!this["~standard"].async)try{const o=this._parseSync({data:t,path:[],parent:n});return yi(o)?{value:o.value}:{issues:n.common.issues}}catch(o){(i=(r=o==null?void 0:o.message)==null?void 0:r.toLowerCase())!=null&&i.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:n}).then(o=>yi(o)?{value:o.value}:{issues:n.common.issues})}async parseAsync(t,n){const r=await this.safeParseAsync(t,n);if(r.success)return r.data;throw r.error}async safeParseAsync(t,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Dn(t)},i=this._parse({data:t,path:r.path,parent:r}),o=await(ll(i)?i:Promise.resolve(i));return _p(r,o)}refine(t,n){const r=i=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(i):n;return this._refinement((i,o)=>{const s=t(i),l=()=>o.addIssue({code:L.custom,...r(i)});return typeof Promise<"u"&&s instanceof Promise?s.then(a=>a?!0:(l(),!1)):s?!0:(l(),!1)})}refinement(t,n){return this._refinement((r,i)=>t(r)?!0:(i.addIssue(typeof n=="function"?n(r,i):n),!1))}_refinement(t){return new nr({schema:this,typeName:ie.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return bn.create(this,this._def)}nullable(){return Tr.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return rn.create(this)}promise(){return pl.create(this,this._def)}or(t){return ul.create([this,t],this._def)}and(t){return cl.create(this,t,this._def)}transform(t){return new nr({...de(this._def),schema:this,typeName:ie.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new ml({...de(this._def),innerType:this,defaultValue:n,typeName:ie.ZodDefault})}brand(){return new j1({typeName:ie.ZodBranded,type:this,...de(this._def)})}catch(t){const n=typeof t=="function"?t:()=>t;return new hl({...de(this._def),innerType:this,catchValue:n,typeName:ie.ZodCatch})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}pipe(t){return cd.create(this,t)}readonly(){return gl.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Hb=/^c[^\s-]{8,}$/i,Wb=/^[0-9a-z]+$/,qb=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Zb=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Gb=/^[a-z0-9_-]{21}$/i,Kb=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Qb=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Yb=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Xb="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Ia;const Jb=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,eS=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,tS=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,nS=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,rS=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,iS=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,E1="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",oS=new RegExp(`^${E1}$`);function N1(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);const n=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`}function sS(e){return new RegExp(`^${N1(e)}$`)}function lS(e){let t=`${E1}T${N1(e)}`;const n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function aS(e,t){return!!((t==="v4"||!t)&&Jb.test(e)||(t==="v6"||!t)&&tS.test(e))}function uS(e,t){if(!Kb.test(e))return!1;try{const[n]=e.split(".");if(!n)return!1;const r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),i=JSON.parse(atob(r));return!(typeof i!="object"||i===null||"typ"in i&&(i==null?void 0:i.typ)!=="JWT"||!i.alg||t&&i.alg!==t)}catch{return!1}}function cS(e,t){return!!((t==="v4"||!t)&&eS.test(e)||(t==="v6"||!t)&&nS.test(e))}class vn extends ge{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==K.string){const o=this._getOrReturnCtx(t);return W(o,{code:L.invalid_type,expected:K.string,received:o.parsedType}),re}const r=new ut;let i;for(const o of this._def.checks)if(o.kind==="min")t.data.length<o.value&&(i=this._getOrReturnCtx(t,i),W(i,{code:L.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="max")t.data.length>o.value&&(i=this._getOrReturnCtx(t,i),W(i,{code:L.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),r.dirty());else if(o.kind==="length"){const s=t.data.length>o.value,l=t.data.length<o.value;(s||l)&&(i=this._getOrReturnCtx(t,i),s?W(i,{code:L.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):l&&W(i,{code:L.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),r.dirty())}else if(o.kind==="email")Yb.test(t.data)||(i=this._getOrReturnCtx(t,i),W(i,{validation:"email",code:L.invalid_string,message:o.message}),r.dirty());else if(o.kind==="emoji")Ia||(Ia=new RegExp(Xb,"u")),Ia.test(t.data)||(i=this._getOrReturnCtx(t,i),W(i,{validation:"emoji",code:L.invalid_string,message:o.message}),r.dirty());else if(o.kind==="uuid")Zb.test(t.data)||(i=this._getOrReturnCtx(t,i),W(i,{validation:"uuid",code:L.invalid_string,message:o.message}),r.dirty());else if(o.kind==="nanoid")Gb.test(t.data)||(i=this._getOrReturnCtx(t,i),W(i,{validation:"nanoid",code:L.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid")Hb.test(t.data)||(i=this._getOrReturnCtx(t,i),W(i,{validation:"cuid",code:L.invalid_string,message:o.message}),r.dirty());else if(o.kind==="cuid2")Wb.test(t.data)||(i=this._getOrReturnCtx(t,i),W(i,{validation:"cuid2",code:L.invalid_string,message:o.message}),r.dirty());else if(o.kind==="ulid")qb.test(t.data)||(i=this._getOrReturnCtx(t,i),W(i,{validation:"ulid",code:L.invalid_string,message:o.message}),r.dirty());else if(o.kind==="url")try{new URL(t.data)}catch{i=this._getOrReturnCtx(t,i),W(i,{validation:"url",code:L.invalid_string,message:o.message}),r.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(t.data)||(i=this._getOrReturnCtx(t,i),W(i,{validation:"regex",code:L.invalid_string,message:o.message}),r.dirty())):o.kind==="trim"?t.data=t.data.trim():o.kind==="includes"?t.data.includes(o.value,o.position)||(i=this._getOrReturnCtx(t,i),W(i,{code:L.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),r.dirty()):o.kind==="toLowerCase"?t.data=t.data.toLowerCase():o.kind==="toUpperCase"?t.data=t.data.toUpperCase():o.kind==="startsWith"?t.data.startsWith(o.value)||(i=this._getOrReturnCtx(t,i),W(i,{code:L.invalid_string,validation:{startsWith:o.value},message:o.message}),r.dirty()):o.kind==="endsWith"?t.data.endsWith(o.value)||(i=this._getOrReturnCtx(t,i),W(i,{code:L.invalid_string,validation:{endsWith:o.value},message:o.message}),r.dirty()):o.kind==="datetime"?lS(o).test(t.data)||(i=this._getOrReturnCtx(t,i),W(i,{code:L.invalid_string,validation:"datetime",message:o.message}),r.dirty()):o.kind==="date"?oS.test(t.data)||(i=this._getOrReturnCtx(t,i),W(i,{code:L.invalid_string,validation:"date",message:o.message}),r.dirty()):o.kind==="time"?sS(o).test(t.data)||(i=this._getOrReturnCtx(t,i),W(i,{code:L.invalid_string,validation:"time",message:o.message}),r.dirty()):o.kind==="duration"?Qb.test(t.data)||(i=this._getOrReturnCtx(t,i),W(i,{validation:"duration",code:L.invalid_string,message:o.message}),r.dirty()):o.kind==="ip"?aS(t.data,o.version)||(i=this._getOrReturnCtx(t,i),W(i,{validation:"ip",code:L.invalid_string,message:o.message}),r.dirty()):o.kind==="jwt"?uS(t.data,o.alg)||(i=this._getOrReturnCtx(t,i),W(i,{validation:"jwt",code:L.invalid_string,message:o.message}),r.dirty()):o.kind==="cidr"?cS(t.data,o.version)||(i=this._getOrReturnCtx(t,i),W(i,{validation:"cidr",code:L.invalid_string,message:o.message}),r.dirty()):o.kind==="base64"?rS.test(t.data)||(i=this._getOrReturnCtx(t,i),W(i,{validation:"base64",code:L.invalid_string,message:o.message}),r.dirty()):o.kind==="base64url"?iS.test(t.data)||(i=this._getOrReturnCtx(t,i),W(i,{validation:"base64url",code:L.invalid_string,message:o.message}),r.dirty()):we.assertNever(o);return{status:r.value,value:t.data}}_regex(t,n,r){return this.refinement(i=>t.test(i),{validation:n,code:L.invalid_string,...ee.errToObj(r)})}_addCheck(t){return new vn({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...ee.errToObj(t)})}url(t){return this._addCheck({kind:"url",...ee.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...ee.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...ee.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...ee.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...ee.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...ee.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...ee.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...ee.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...ee.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...ee.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...ee.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...ee.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(t==null?void 0:t.offset)??!1,local:(t==null?void 0:t.local)??!1,...ee.errToObj(t==null?void 0:t.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,...ee.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...ee.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...ee.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n==null?void 0:n.position,...ee.errToObj(n==null?void 0:n.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...ee.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...ee.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...ee.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...ee.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...ee.errToObj(n)})}nonempty(t){return this.min(1,ee.errToObj(t))}trim(){return new vn({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new vn({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new vn({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}vn.create=e=>new vn({checks:[],typeName:ie.ZodString,coerce:(e==null?void 0:e.coerce)??!1,...de(e)});function dS(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,i=n>r?n:r,o=Number.parseInt(e.toFixed(i).replace(".","")),s=Number.parseInt(t.toFixed(i).replace(".",""));return o%s/10**i}class xi extends ge{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==K.number){const o=this._getOrReturnCtx(t);return W(o,{code:L.invalid_type,expected:K.number,received:o.parsedType}),re}let r;const i=new ut;for(const o of this._def.checks)o.kind==="int"?we.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),W(r,{code:L.invalid_type,expected:"integer",received:"float",message:o.message}),i.dirty()):o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(r=this._getOrReturnCtx(t,r),W(r,{code:L.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(r=this._getOrReturnCtx(t,r),W(r,{code:L.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="multipleOf"?dS(t.data,o.value)!==0&&(r=this._getOrReturnCtx(t,r),W(r,{code:L.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):o.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),W(r,{code:L.not_finite,message:o.message}),i.dirty()):we.assertNever(o);return{status:i.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,ee.toString(n))}gt(t,n){return this.setLimit("min",t,!1,ee.toString(n))}lte(t,n){return this.setLimit("max",t,!0,ee.toString(n))}lt(t,n){return this.setLimit("max",t,!1,ee.toString(n))}setLimit(t,n,r,i){return new xi({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:ee.toString(i)}]})}_addCheck(t){return new xi({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:ee.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:ee.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:ee.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:ee.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:ee.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:ee.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:ee.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:ee.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:ee.toString(t)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&we.isInteger(t.value))}get isFinite(){let t=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(t===null||r.value<t)&&(t=r.value)}return Number.isFinite(n)&&Number.isFinite(t)}}xi.create=e=>new xi({checks:[],typeName:ie.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...de(e)});class _o extends ge{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==K.bigint)return this._getInvalidInput(t);let r;const i=new ut;for(const o of this._def.checks)o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(r=this._getOrReturnCtx(t,r),W(r,{code:L.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(r=this._getOrReturnCtx(t,r),W(r,{code:L.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="multipleOf"?t.data%o.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),W(r,{code:L.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):we.assertNever(o);return{status:i.value,value:t.data}}_getInvalidInput(t){const n=this._getOrReturnCtx(t);return W(n,{code:L.invalid_type,expected:K.bigint,received:n.parsedType}),re}gte(t,n){return this.setLimit("min",t,!0,ee.toString(n))}gt(t,n){return this.setLimit("min",t,!1,ee.toString(n))}lte(t,n){return this.setLimit("max",t,!0,ee.toString(n))}lt(t,n){return this.setLimit("max",t,!1,ee.toString(n))}setLimit(t,n,r,i){return new _o({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:ee.toString(i)}]})}_addCheck(t){return new _o({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:ee.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:ee.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:ee.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:ee.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:ee.toString(n)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}_o.create=e=>new _o({checks:[],typeName:ie.ZodBigInt,coerce:(e==null?void 0:e.coerce)??!1,...de(e)});class Uu extends ge{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==K.boolean){const r=this._getOrReturnCtx(t);return W(r,{code:L.invalid_type,expected:K.boolean,received:r.parsedType}),re}return Ot(t.data)}}Uu.create=e=>new Uu({typeName:ie.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...de(e)});class al extends ge{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==K.date){const o=this._getOrReturnCtx(t);return W(o,{code:L.invalid_type,expected:K.date,received:o.parsedType}),re}if(Number.isNaN(t.data.getTime())){const o=this._getOrReturnCtx(t);return W(o,{code:L.invalid_date}),re}const r=new ut;let i;for(const o of this._def.checks)o.kind==="min"?t.data.getTime()<o.value&&(i=this._getOrReturnCtx(t,i),W(i,{code:L.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),r.dirty()):o.kind==="max"?t.data.getTime()>o.value&&(i=this._getOrReturnCtx(t,i),W(i,{code:L.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),r.dirty()):we.assertNever(o);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new al({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:ee.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:ee.toString(n)})}get minDate(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t!=null?new Date(t):null}}al.create=e=>new al({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:ie.ZodDate,...de(e)});class Cp extends ge{_parse(t){if(this._getType(t)!==K.symbol){const r=this._getOrReturnCtx(t);return W(r,{code:L.invalid_type,expected:K.symbol,received:r.parsedType}),re}return Ot(t.data)}}Cp.create=e=>new Cp({typeName:ie.ZodSymbol,...de(e)});class Bu extends ge{_parse(t){if(this._getType(t)!==K.undefined){const r=this._getOrReturnCtx(t);return W(r,{code:L.invalid_type,expected:K.undefined,received:r.parsedType}),re}return Ot(t.data)}}Bu.create=e=>new Bu({typeName:ie.ZodUndefined,...de(e)});class Vu extends ge{_parse(t){if(this._getType(t)!==K.null){const r=this._getOrReturnCtx(t);return W(r,{code:L.invalid_type,expected:K.null,received:r.parsedType}),re}return Ot(t.data)}}Vu.create=e=>new Vu({typeName:ie.ZodNull,...de(e)});class Ip extends ge{constructor(){super(...arguments),this._any=!0}_parse(t){return Ot(t.data)}}Ip.create=e=>new Ip({typeName:ie.ZodAny,...de(e)});class Hu extends ge{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Ot(t.data)}}Hu.create=e=>new Hu({typeName:ie.ZodUnknown,...de(e)});class tr extends ge{_parse(t){const n=this._getOrReturnCtx(t);return W(n,{code:L.invalid_type,expected:K.never,received:n.parsedType}),re}}tr.create=e=>new tr({typeName:ie.ZodNever,...de(e)});class Ep extends ge{_parse(t){if(this._getType(t)!==K.undefined){const r=this._getOrReturnCtx(t);return W(r,{code:L.invalid_type,expected:K.void,received:r.parsedType}),re}return Ot(t.data)}}Ep.create=e=>new Ep({typeName:ie.ZodVoid,...de(e)});class rn extends ge{_parse(t){const{ctx:n,status:r}=this._processInputParams(t),i=this._def;if(n.parsedType!==K.array)return W(n,{code:L.invalid_type,expected:K.array,received:n.parsedType}),re;if(i.exactLength!==null){const s=n.data.length>i.exactLength.value,l=n.data.length<i.exactLength.value;(s||l)&&(W(n,{code:s?L.too_big:L.too_small,minimum:l?i.exactLength.value:void 0,maximum:s?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),r.dirty())}if(i.minLength!==null&&n.data.length<i.minLength.value&&(W(n,{code:L.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),r.dirty()),i.maxLength!==null&&n.data.length>i.maxLength.value&&(W(n,{code:L.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((s,l)=>i.type._parseAsync(new on(n,s,n.path,l)))).then(s=>ut.mergeArray(r,s));const o=[...n.data].map((s,l)=>i.type._parseSync(new on(n,s,n.path,l)));return ut.mergeArray(r,o)}get element(){return this._def.type}min(t,n){return new rn({...this._def,minLength:{value:t,message:ee.toString(n)}})}max(t,n){return new rn({...this._def,maxLength:{value:t,message:ee.toString(n)}})}length(t,n){return new rn({...this._def,exactLength:{value:t,message:ee.toString(n)}})}nonempty(t){return this.min(1,t)}}rn.create=(e,t)=>new rn({type:e,minLength:null,maxLength:null,exactLength:null,typeName:ie.ZodArray,...de(t)});function Ur(e){if(e instanceof $e){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=bn.create(Ur(r))}return new $e({...e._def,shape:()=>t})}else return e instanceof rn?new rn({...e._def,type:Ur(e.element)}):e instanceof bn?bn.create(Ur(e.unwrap())):e instanceof Tr?Tr.create(Ur(e.unwrap())):e instanceof Er?Er.create(e.items.map(t=>Ur(t))):e}class $e extends ge{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),n=we.objectKeys(t);return this._cached={shape:t,keys:n},this._cached}_parse(t){if(this._getType(t)!==K.object){const u=this._getOrReturnCtx(t);return W(u,{code:L.invalid_type,expected:K.object,received:u.parsedType}),re}const{status:r,ctx:i}=this._processInputParams(t),{shape:o,keys:s}=this._getCached(),l=[];if(!(this._def.catchall instanceof tr&&this._def.unknownKeys==="strip"))for(const u in i.data)s.includes(u)||l.push(u);const a=[];for(const u of s){const f=o[u],d=i.data[u];a.push({key:{status:"valid",value:u},value:f._parse(new on(i,d,i.path,u)),alwaysSet:u in i.data})}if(this._def.catchall instanceof tr){const u=this._def.unknownKeys;if(u==="passthrough")for(const f of l)a.push({key:{status:"valid",value:f},value:{status:"valid",value:i.data[f]}});else if(u==="strict")l.length>0&&(W(i,{code:L.unrecognized_keys,keys:l}),r.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const u=this._def.catchall;for(const f of l){const d=i.data[f];a.push({key:{status:"valid",value:f},value:u._parse(new on(i,d,i.path,f)),alwaysSet:f in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const u=[];for(const f of a){const d=await f.key,m=await f.value;u.push({key:d,value:m,alwaysSet:f.alwaysSet})}return u}).then(u=>ut.mergeObjectSync(r,u)):ut.mergeObjectSync(r,a)}get shape(){return this._def.shape()}strict(t){return ee.errToObj,new $e({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,r)=>{var o,s;const i=((s=(o=this._def).errorMap)==null?void 0:s.call(o,n,r).message)??r.defaultError;return n.code==="unrecognized_keys"?{message:ee.errToObj(t).message??i}:{message:i}}}:{}})}strip(){return new $e({...this._def,unknownKeys:"strip"})}passthrough(){return new $e({...this._def,unknownKeys:"passthrough"})}extend(t){return new $e({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new $e({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:ie.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new $e({...this._def,catchall:t})}pick(t){const n={};for(const r of we.objectKeys(t))t[r]&&this.shape[r]&&(n[r]=this.shape[r]);return new $e({...this._def,shape:()=>n})}omit(t){const n={};for(const r of we.objectKeys(this.shape))t[r]||(n[r]=this.shape[r]);return new $e({...this._def,shape:()=>n})}deepPartial(){return Ur(this)}partial(t){const n={};for(const r of we.objectKeys(this.shape)){const i=this.shape[r];t&&!t[r]?n[r]=i:n[r]=i.optional()}return new $e({...this._def,shape:()=>n})}required(t){const n={};for(const r of we.objectKeys(this.shape))if(t&&!t[r])n[r]=this.shape[r];else{let o=this.shape[r];for(;o instanceof bn;)o=o._def.innerType;n[r]=o}return new $e({...this._def,shape:()=>n})}keyof(){return T1(we.objectKeys(this.shape))}}$e.create=(e,t)=>new $e({shape:()=>e,unknownKeys:"strip",catchall:tr.create(),typeName:ie.ZodObject,...de(t)});$e.strictCreate=(e,t)=>new $e({shape:()=>e,unknownKeys:"strict",catchall:tr.create(),typeName:ie.ZodObject,...de(t)});$e.lazycreate=(e,t)=>new $e({shape:e,unknownKeys:"strip",catchall:tr.create(),typeName:ie.ZodObject,...de(t)});class ul extends ge{_parse(t){const{ctx:n}=this._processInputParams(t),r=this._def.options;function i(o){for(const l of o)if(l.result.status==="valid")return l.result;for(const l of o)if(l.result.status==="dirty")return n.common.issues.push(...l.ctx.common.issues),l.result;const s=o.map(l=>new Nn(l.ctx.common.issues));return W(n,{code:L.invalid_union,unionErrors:s}),re}if(n.common.async)return Promise.all(r.map(async o=>{const s={...n,common:{...n.common,issues:[]},parent:null};return{result:await o._parseAsync({data:n.data,path:n.path,parent:s}),ctx:s}})).then(i);{let o;const s=[];for(const a of r){const u={...n,common:{...n.common,issues:[]},parent:null},f=a._parseSync({data:n.data,path:n.path,parent:u});if(f.status==="valid")return f;f.status==="dirty"&&!o&&(o={result:f,ctx:u}),u.common.issues.length&&s.push(u.common.issues)}if(o)return n.common.issues.push(...o.ctx.common.issues),o.result;const l=s.map(a=>new Nn(a));return W(n,{code:L.invalid_union,unionErrors:l}),re}}get options(){return this._def.options}}ul.create=(e,t)=>new ul({options:e,typeName:ie.ZodUnion,...de(t)});const mn=e=>e instanceof qu?mn(e.schema):e instanceof nr?mn(e.innerType()):e instanceof fl?[e.value]:e instanceof Nr?e.options:e instanceof Zu?we.objectValues(e.enum):e instanceof ml?mn(e._def.innerType):e instanceof Bu?[void 0]:e instanceof Vu?[null]:e instanceof bn?[void 0,...mn(e.unwrap())]:e instanceof Tr?[null,...mn(e.unwrap())]:e instanceof j1||e instanceof gl?mn(e.unwrap()):e instanceof hl?mn(e._def.innerType):[];class ud extends ge{_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==K.object)return W(n,{code:L.invalid_type,expected:K.object,received:n.parsedType}),re;const r=this.discriminator,i=n.data[r],o=this.optionsMap.get(i);return o?n.common.async?o._parseAsync({data:n.data,path:n.path,parent:n}):o._parseSync({data:n.data,path:n.path,parent:n}):(W(n,{code:L.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),re)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){const i=new Map;for(const o of n){const s=mn(o.shape[t]);if(!s.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const l of s){if(i.has(l))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(l)}`);i.set(l,o)}}return new ud({typeName:ie.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:i,...de(r)})}}function Wu(e,t){const n=Dn(e),r=Dn(t);if(e===t)return{valid:!0,data:e};if(n===K.object&&r===K.object){const i=we.objectKeys(t),o=we.objectKeys(e).filter(l=>i.indexOf(l)!==-1),s={...e,...t};for(const l of o){const a=Wu(e[l],t[l]);if(!a.valid)return{valid:!1};s[l]=a.data}return{valid:!0,data:s}}else if(n===K.array&&r===K.array){if(e.length!==t.length)return{valid:!1};const i=[];for(let o=0;o<e.length;o++){const s=e[o],l=t[o],a=Wu(s,l);if(!a.valid)return{valid:!1};i.push(a.data)}return{valid:!0,data:i}}else return n===K.date&&r===K.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class cl extends ge{_parse(t){const{status:n,ctx:r}=this._processInputParams(t),i=(o,s)=>{if(bp(o)||bp(s))return re;const l=Wu(o.value,s.value);return l.valid?((Sp(o)||Sp(s))&&n.dirty(),{status:n.value,value:l.data}):(W(r,{code:L.invalid_intersection_types}),re)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([o,s])=>i(o,s)):i(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}cl.create=(e,t,n)=>new cl({left:e,right:t,typeName:ie.ZodIntersection,...de(n)});class Er extends ge{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==K.array)return W(r,{code:L.invalid_type,expected:K.array,received:r.parsedType}),re;if(r.data.length<this._def.items.length)return W(r,{code:L.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),re;!this._def.rest&&r.data.length>this._def.items.length&&(W(r,{code:L.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const o=[...r.data].map((s,l)=>{const a=this._def.items[l]||this._def.rest;return a?a._parse(new on(r,s,r.path,l)):null}).filter(s=>!!s);return r.common.async?Promise.all(o).then(s=>ut.mergeArray(n,s)):ut.mergeArray(n,o)}get items(){return this._def.items}rest(t){return new Er({...this._def,rest:t})}}Er.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Er({items:e,typeName:ie.ZodTuple,rest:null,...de(t)})};class dl extends ge{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==K.object)return W(r,{code:L.invalid_type,expected:K.object,received:r.parsedType}),re;const i=[],o=this._def.keyType,s=this._def.valueType;for(const l in r.data)i.push({key:o._parse(new on(r,l,r.path,l)),value:s._parse(new on(r,r.data[l],r.path,l)),alwaysSet:l in r.data});return r.common.async?ut.mergeObjectAsync(n,i):ut.mergeObjectSync(n,i)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof ge?new dl({keyType:t,valueType:n,typeName:ie.ZodRecord,...de(r)}):new dl({keyType:vn.create(),valueType:t,typeName:ie.ZodRecord,...de(n)})}}class Np extends ge{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==K.map)return W(r,{code:L.invalid_type,expected:K.map,received:r.parsedType}),re;const i=this._def.keyType,o=this._def.valueType,s=[...r.data.entries()].map(([l,a],u)=>({key:i._parse(new on(r,l,r.path,[u,"key"])),value:o._parse(new on(r,a,r.path,[u,"value"]))}));if(r.common.async){const l=new Map;return Promise.resolve().then(async()=>{for(const a of s){const u=await a.key,f=await a.value;if(u.status==="aborted"||f.status==="aborted")return re;(u.status==="dirty"||f.status==="dirty")&&n.dirty(),l.set(u.value,f.value)}return{status:n.value,value:l}})}else{const l=new Map;for(const a of s){const u=a.key,f=a.value;if(u.status==="aborted"||f.status==="aborted")return re;(u.status==="dirty"||f.status==="dirty")&&n.dirty(),l.set(u.value,f.value)}return{status:n.value,value:l}}}}Np.create=(e,t,n)=>new Np({valueType:t,keyType:e,typeName:ie.ZodMap,...de(n)});class Co extends ge{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==K.set)return W(r,{code:L.invalid_type,expected:K.set,received:r.parsedType}),re;const i=this._def;i.minSize!==null&&r.data.size<i.minSize.value&&(W(r,{code:L.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),n.dirty()),i.maxSize!==null&&r.data.size>i.maxSize.value&&(W(r,{code:L.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),n.dirty());const o=this._def.valueType;function s(a){const u=new Set;for(const f of a){if(f.status==="aborted")return re;f.status==="dirty"&&n.dirty(),u.add(f.value)}return{status:n.value,value:u}}const l=[...r.data.values()].map((a,u)=>o._parse(new on(r,a,r.path,u)));return r.common.async?Promise.all(l).then(a=>s(a)):s(l)}min(t,n){return new Co({...this._def,minSize:{value:t,message:ee.toString(n)}})}max(t,n){return new Co({...this._def,maxSize:{value:t,message:ee.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}Co.create=(e,t)=>new Co({valueType:e,minSize:null,maxSize:null,typeName:ie.ZodSet,...de(t)});class qu extends ge{get schema(){return this._def.getter()}_parse(t){const{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}qu.create=(e,t)=>new qu({getter:e,typeName:ie.ZodLazy,...de(t)});class fl extends ge{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return W(n,{received:n.data,code:L.invalid_literal,expected:this._def.value}),re}return{status:"valid",value:t.data}}get value(){return this._def.value}}fl.create=(e,t)=>new fl({value:e,typeName:ie.ZodLiteral,...de(t)});function T1(e,t){return new Nr({values:e,typeName:ie.ZodEnum,...de(t)})}class Nr extends ge{_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),r=this._def.values;return W(n,{expected:we.joinValues(r),received:n.parsedType,code:L.invalid_type}),re}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){const n=this._getOrReturnCtx(t),r=this._def.values;return W(n,{received:n.data,code:L.invalid_enum_value,options:r}),re}return Ot(t.data)}get options(){return this._def.values}get enum(){const t={};for(const n of this._def.values)t[n]=n;return t}get Values(){const t={};for(const n of this._def.values)t[n]=n;return t}get Enum(){const t={};for(const n of this._def.values)t[n]=n;return t}extract(t,n=this._def){return Nr.create(t,{...this._def,...n})}exclude(t,n=this._def){return Nr.create(this.options.filter(r=>!t.includes(r)),{...this._def,...n})}}Nr.create=T1;class Zu extends ge{_parse(t){const n=we.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==K.string&&r.parsedType!==K.number){const i=we.objectValues(n);return W(r,{expected:we.joinValues(i),received:r.parsedType,code:L.invalid_type}),re}if(this._cache||(this._cache=new Set(we.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){const i=we.objectValues(n);return W(r,{received:r.data,code:L.invalid_enum_value,options:i}),re}return Ot(t.data)}get enum(){return this._def.values}}Zu.create=(e,t)=>new Zu({values:e,typeName:ie.ZodNativeEnum,...de(t)});class pl extends ge{unwrap(){return this._def.type}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==K.promise&&n.common.async===!1)return W(n,{code:L.invalid_type,expected:K.promise,received:n.parsedType}),re;const r=n.parsedType===K.promise?n.data:Promise.resolve(n.data);return Ot(r.then(i=>this._def.type.parseAsync(i,{path:n.path,errorMap:n.common.contextualErrorMap})))}}pl.create=(e,t)=>new pl({type:e,typeName:ie.ZodPromise,...de(t)});class nr extends ge{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ie.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:n,ctx:r}=this._processInputParams(t),i=this._def.effect||null,o={addIssue:s=>{W(r,s),s.fatal?n.abort():n.dirty()},get path(){return r.path}};if(o.addIssue=o.addIssue.bind(o),i.type==="preprocess"){const s=i.transform(r.data,o);if(r.common.async)return Promise.resolve(s).then(async l=>{if(n.value==="aborted")return re;const a=await this._def.schema._parseAsync({data:l,path:r.path,parent:r});return a.status==="aborted"?re:a.status==="dirty"||n.value==="dirty"?Zi(a.value):a});{if(n.value==="aborted")return re;const l=this._def.schema._parseSync({data:s,path:r.path,parent:r});return l.status==="aborted"?re:l.status==="dirty"||n.value==="dirty"?Zi(l.value):l}}if(i.type==="refinement"){const s=l=>{const a=i.refinement(l,o);if(r.common.async)return Promise.resolve(a);if(a instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return l};if(r.common.async===!1){const l=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return l.status==="aborted"?re:(l.status==="dirty"&&n.dirty(),s(l.value),{status:n.value,value:l.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(l=>l.status==="aborted"?re:(l.status==="dirty"&&n.dirty(),s(l.value).then(()=>({status:n.value,value:l.value}))))}if(i.type==="transform")if(r.common.async===!1){const s=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!yi(s))return re;const l=i.transform(s.value,o);if(l instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:l}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(s=>yi(s)?Promise.resolve(i.transform(s.value,o)).then(l=>({status:n.value,value:l})):re);we.assertNever(i)}}nr.create=(e,t,n)=>new nr({schema:e,typeName:ie.ZodEffects,effect:t,...de(n)});nr.createWithPreprocess=(e,t,n)=>new nr({schema:t,effect:{type:"preprocess",transform:e},typeName:ie.ZodEffects,...de(n)});class bn extends ge{_parse(t){return this._getType(t)===K.undefined?Ot(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}bn.create=(e,t)=>new bn({innerType:e,typeName:ie.ZodOptional,...de(t)});class Tr extends ge{_parse(t){return this._getType(t)===K.null?Ot(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Tr.create=(e,t)=>new Tr({innerType:e,typeName:ie.ZodNullable,...de(t)});class ml extends ge{_parse(t){const{ctx:n}=this._processInputParams(t);let r=n.data;return n.parsedType===K.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}ml.create=(e,t)=>new ml({innerType:e,typeName:ie.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...de(t)});class hl extends ge{_parse(t){const{ctx:n}=this._processInputParams(t),r={...n,common:{...n.common,issues:[]}},i=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return ll(i)?i.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Nn(r.common.issues)},input:r.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Nn(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}hl.create=(e,t)=>new hl({innerType:e,typeName:ie.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...de(t)});class Tp extends ge{_parse(t){if(this._getType(t)!==K.nan){const r=this._getOrReturnCtx(t);return W(r,{code:L.invalid_type,expected:K.nan,received:r.parsedType}),re}return{status:"valid",value:t.data}}}Tp.create=e=>new Tp({typeName:ie.ZodNaN,...de(e)});class j1 extends ge{_parse(t){const{ctx:n}=this._processInputParams(t),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class cd extends ge{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.common.async)return(async()=>{const o=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?re:o.status==="dirty"?(n.dirty(),Zi(o.value)):this._def.out._parseAsync({data:o.value,path:r.path,parent:r})})();{const i=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?re:i.status==="dirty"?(n.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:r.path,parent:r})}}static create(t,n){return new cd({in:t,out:n,typeName:ie.ZodPipeline})}}class gl extends ge{_parse(t){const n=this._def.innerType._parse(t),r=i=>(yi(i)&&(i.value=Object.freeze(i.value)),i);return ll(n)?n.then(i=>r(i)):r(n)}unwrap(){return this._def.innerType}}gl.create=(e,t)=>new gl({innerType:e,typeName:ie.ZodReadonly,...de(t)});var ie;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(ie||(ie={}));const c=vn.create,N=xi.create,V=Uu.create,Sn=Hu.create;tr.create;const M=rn.create,g=$e.create;ul.create;const vt=ud.create;cl.create;Er.create;const Dt=dl.create,P=fl.create,Y=Nr.create;pl.create;bn.create;Tr.create;const fS=nr.createWithPreprocess,pS=["head","index"],Hl=c().regex(/^[A-Za-z0-9][A-Za-z0-9-]{0,127}$/),yl=c().regex(/^[1-9][0-9]*$/),xl=c().regex(/^[A-Za-z0-9_.-]+$/),vl=c().min(1).max(255).refine(e=>!e.startsWith("-")&&e!=="HEAD"&&!e.startsWith("/")&&!e.endsWith("/")&&!e.endsWith(".")&&!/[\s~^:?*\[\\\x00-\x1f\x7f]/.test(e)&&!e.includes("..")&&!e.includes("@{")&&!e.includes("//")&&e.split("/").every(t=>!t.startsWith(".")&&!t.endsWith(".lock")),"Invalid Git branch"),dd=c().min(1).max(4096).refine(e=>!e.startsWith("/")&&!e.includes("\0")&&!e.split(/[\\/]/).includes("..")),fd=g({workspaceId:Hl,repoId:yl,owner:xl,name:xl,sourceBranch:vl,defaultBranch:vl}).strict(),mS=g({repoId:yl,owner:xl,name:xl,defaultBranch:c(),private:V(),description:c().nullable()}),A1=g({number:N().int().positive(),url:c().url().refine(e=>new URL(e).origin==="https://github.com"),base:c(),head:c()}),hS=fd.extend({initialCommit:c(),head:c(),actualBranch:c().nullable(),branches:M(c()).optional(),files:M(g({path:dd,previousPath:c().optional(),comparison:Y(pS).optional(),status:c(),added:N().nonnegative(),removed:N().nonnegative(),binary:V(),untracked:V().optional()})),totalFiles:N().int().nonnegative().optional(),filesTruncated:V().optional(),added:N().nonnegative(),removed:N().nonnegative(),dirty:V(),conflicted:V(),version:c(),measuredAt:N(),pendingPublication:g({operationId:Hl,expectedVersion:c(),stage:c()}).optional(),pr:A1.nullable().optional(),savedAt:N().nullable().optional()}),dr=g({sessionId:Hl});vt("action",[dr.extend({action:P("repositories"),page:N().int().min(1).max(1e3).optional(),search:c().max(100).optional()}).strict(),dr.extend({action:P("branches"),repoId:yl,page:N().int().min(1).max(1e3).optional()}).strict(),dr.extend({action:P("bind"),repoId:yl,branch:vl}).strict(),dr.extend({action:P("status")}).strict(),dr.extend({action:P("switch"),branch:vl,create:V().optional()}).strict(),dr.extend({action:P("diff"),filePath:dd}).strict(),dr.extend({action:P("publish"),operationId:Hl,expectedVersion:c().min(1).max(128)}).strict()]);g({binding:fd.nullable().optional(),workspace:hS.nullable().optional(),repositories:M(mS).optional(),branches:M(c()).optional(),hasMore:V().optional(),cache:Y(["warm","cold"]).optional(),diff:g({path:dd,patch:c(),binary:V(),truncated:V()}).optional(),pr:A1.optional()});new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");g({id:c().min(1),name:c().min(1),baseUrl:c().min(1),apiKey:c().min(1),remark:c().optional(),createdAt:N(),updatedAt:N()}).strict();const gS=g({id:c().min(1),name:c().min(1),baseUrl:c().min(1),remark:c().optional(),keyMasked:c(),hasKey:V(),createdAt:N(),updatedAt:N()}).strict();g({activeChannelId:c().nullable(),channels:M(gS)}).strict();g({}).strict();g({id:c().min(1).optional(),name:c().min(1),baseUrl:c().min(1),apiKey:c().optional(),remark:c().optional()}).strict();g({id:c().min(1)}).strict();g({id:c().min(1).nullable()}).strict();g({channelId:c().min(1).optional(),updatedAt:N().optional()}).strict().refine(e=>e.updatedAt===void 0||e.channelId!==void 0,{message:"updatedAt requires channelId"});g({channelId:c().nullable(),models:M(g({id:c().min(1),ownedBy:c().optional()}).strict())}).strict();const yS=["owner"],xS=["agent","owner","user-upload"],P1=g({id:c().min(1),relPath:c().min(1),from:Y(xS),label:c().optional(),size:N().int().nonnegative(),mime:c().min(1),addedAt:N().int().nonnegative(),lastEditedAt:N().int().nonnegative().optional(),stale:V().optional()});g({sessionId:c().min(1),relPath:c().min(1),ttlSeconds:N().int().positive().nullable().optional(),view:Y(["raw","md-rendered"]).optional()});g({url:c().min(1),expiresAt:N().int().nonnegative().nullable()});g({sessionId:c().min(1),relPath:c().min(1),label:c().optional(),origin:P("agent").optional()});g({entry:P1});g({sessionId:c().min(1),relPath:c().min(1)});g({removed:P(!0)});g({sessionId:c().min(1)});g({entries:M(P1)});g({attachmentId:c().min(1),url:c().min(1),relPath:c().min(1),sizeBytes:N().int().nonnegative(),mimeType:c().min(1)});const vS=vt("type",[g({type:P("persona"),id:c().min(1)}).strict(),g({type:P("chat"),id:c().min(1)}).strict(),g({type:P("*")}).strict()]),kS=Y(["read","send","admin"]),pd=g({resource:vS,actions:M(kS).min(1)}).strict(),wS=g({id:c().min(1),secretHash:c().regex(/^[a-f0-9]{64}$/),displayName:c(),grants:M(pd),issuedAt:N().int().nonnegative(),expiresAt:N().int().positive().optional(),maxUses:N().int().positive().optional(),usedCount:N().int().nonnegative(),peerOwnerId:c().min(1).optional(),firstUsedByPeerAt:N().int().positive().optional(),peerDisplayName:c().optional()}).strict(),bS=wS.omit({secretHash:!0});g({type:P("whoami:ok"),owner:g({id:c(),kind:Y(["owner","guest"]),displayName:c(),ownerId:c(),provider:c()}).strict(),capability:bS,grantedPersonas:M(g({id:c().min(1),displayName:c()}).strict())}).strict();g({selfUrl:c().min(1)});g({type:P("contact:handshake:ok"),owner:g({id:c(),ownerId:c(),provider:c(),displayName:c()}),grants:M(pd)});const SS=vt("status",[g({status:P("authorized"),login:c().min(1),source:Y(["git","file"])}).strict(),g({status:P("missing")}).strict(),g({status:P("invalid"),message:c().min(1)}).strict(),g({status:P("pending"),authUrl:c().url()}).strict()]);g({token:c().min(1)}).strict();g({returnTo:c().url().optional()}).strict();const _S=g({url:c().url(),bin:c(),sha256:c().regex(/^[0-9a-f]{64}$/),size:N().int().positive()}),CS=g({name:c().min(1),from:c().optional(),version:c().optional(),min:c().optional(),library:V().optional(),localVersion:c().optional(),artifact:_S.optional(),aptMissing:P(!0).optional(),aptVersion:c().optional()}),IS=g({name:c().min(1),env:M(c().min(1)).min(1)}),md=c().regex(/^[a-z0-9-]+$/,"连接器名只能是小写字母、数字和短横线"),R1=["proxy","env"],z1=["mcp","cli"],ES=["bearer","lark-sidecar"],NS=["none","shared","personal"],M1=["oauth","fields"],hd=c().regex(/^[A-Z][A-Z0-9_]*$/,"要填的变量名只能是大写字母、数字和下划线,且以字母开头"),L1=g({name:md,kind:Y(R1),runner:Y(z1),protocol:Y(ES).optional(),id:c().min(1),credentialSource:Y(NS).optional(),auth:Y(M1).optional(),publisherUnionId:c().regex(/^on_[A-Za-z0-9_-]+$/).optional(),fields:M(hd).default([]),http:g({url:c().min(1),headers:Dt(c(),c())}).optional()}),TS=e=>{if(!e||typeof e!="object")return e;let t=e;if("clis"in t&&Array.isArray(t.clis)){const{clis:n,...r}=t;t="packages"in r?r:{...r,packages:n}}if("assets"in t&&Array.isArray(t.assets)&&t.assets.length===0){const{assets:n,...r}=t;t=r}return t},O1=g({version:P(1),entry:c().max(240).regex(/^[A-Za-z0-9_.-]+(?:\/[A-Za-z0-9_.-]+)*\.mjs$/).refine(e=>!e.split("/").some(t=>[".",".."].includes(t))),timeoutSeconds:N().int().min(1).max(600),checks:M(c().regex(/^[a-z0-9][a-z0-9-]{0,63}$/)).min(1).max(64).refine(e=>new Set(e).size===e.length)}).strict(),D1={test:O1.optional(),packages:M(CS),secrets:M(IS),connectors:M(L1).default([])};g(D1);const gd=fS(TS,g({version:P(1),...D1}).strict()),jS=g({target:c().min(1),reason:c().min(1),file:c().min(1),quote:c().min(1)}),AS=["integration","production"],kt=Y(AS),Tn=c().regex(/^[a-z0-9.-]+(?::[0-9]+)?\/[a-z0-9._/-]+@sha256:[a-f0-9]{64}$/),Gu=c().regex(/^[a-f0-9]{40}$/),PS=c().refine(e=>{try{const t=new URL(e);return t.protocol==="https:"&&!t.username&&!t.password&&!t.search&&!t.hash&&t.pathname==="/"&&/(^|[.-])int([.-]|$)/.test(t.hostname)}catch{return!1}},"测试验证地址必须明确指向 int HTTPS 环境"),RS=g({version:P(1),runId:c().regex(/^[A-Za-z0-9_-]{1,128}$/),status:P("passed"),exitCode:P(0),result:g({version:P(1),runId:c().regex(/^[A-Za-z0-9_-]{1,128}$/),checks:M(g({name:c().regex(/^[a-z0-9][a-z0-9-]{0,63}$/),status:P("passed"),reason:c().max(1024).optional()}).strict()).min(1).max(64)}).strict(),execution:g({image:Tn,imageID:c().min(1).max(512),engine:Y(["codex","pi"]),podUid:c().min(1).max(512),jobUid:c().min(1).max(512)}).strict()}).strict(),F1=g({status:P("passed"),fingerprint:c().regex(/^[a-f0-9]{64}$/),checks:M(c().regex(/^[a-z0-9-]+$/)),endpoint:PS,verifiedAt:c().refine(e=>Number.isFinite(Date.parse(e))),test:RS.optional()}).strict(),$1=g({engine:c().min(1),model:c(),effort:c(),size:c().min(1),cpu:N().positive(),taskConcurrency:N().int().positive()}).strict(),U1=g({version:P(1),environment:P("integration"),component:P("persona"),image:Tn,commit:Gu,baseImage:Tn,pipelineCommit:Gu,repository:c().regex(/^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/),config:$1.optional(),verification:F1.refine(e=>e.checks.includes("persona-smoke")),test:O1.optional()}).strict().refine(e=>{if(!e.test)return e.verification.test===void 0;const t=e.verification.test;return["persona-dialogue","persona-task","persona-custom-test"].every(n=>e.verification.checks.includes(n))&&t!==void 0&&t.execution.image===e.image&&t.runId===t.result.runId&&t.result.checks.length===e.test.checks.length&&new Set(t.result.checks.map(n=>n.name)).size===e.test.checks.length&&t.result.checks.every(n=>e.test.checks.includes(n.name))},"Declared publisher acceptance requires complete candidate runtime evidence");g({version:P(1),environment:P("integration"),component:P("base"),image:Tn,commit:Gu,verification:F1.refine(e=>e.checks.includes("base-smoke"))}).strict();const jp={standard:"default",fast:"priority"},B1=Y([jp.standard,jp.fast]),zS=["tiny","small","medium","large","xlarge"],MS=Y(zS),LS=[.5,1,2],OS=N().refine(e=>LS.includes(e),"Unsupported CPU"),V1=g({model:c().optional(),effort:c().optional()}).strict(),kl=g({personaId:c(),label:c(),model:c().optional(),effort:c().optional(),serviceTier:B1.optional(),public:V(),iconKey:c().optional(),tool:c().optional(),size:c().optional(),cpu:N().finite().optional(),taskConcurrency:N().int().positive().optional(),cloudEngine:V1.optional(),createdAt:N(),updatedAt:N(),cloud:g({gatewayUrl:c().min(1),personaId:c().min(1),publishedByMe:V().optional(),environment:kt.optional(),expectedImage:Tn.optional(),testReleaseId:c().optional()}).strict().optional()}).strict(),DS=g({name:c().min(1),description:c().optional()}),FS=g({id:c().min(1)}),H1=g({writableRoots:M(c()).optional(),denyRead:M(c()).optional(),network:V().optional()}).strict(),$S=g({permissions:g({defaultMode:c().optional(),allow:M(c()).optional(),deny:M(c()).optional()}).optional(),sandbox:g({enabled:V().optional(),autoAllowBashIfSandboxed:V().optional(),allowUnsandboxedCommands:V().optional(),excludedCommands:M(c()).optional(),filesystem:g({denyRead:M(c()).optional(),allowRead:M(c()).optional(),denyWrite:M(c()).optional(),allowWrite:M(c()).optional()}).optional(),network:g({allowedDomains:M(c()).optional(),allowLocalBinding:V().optional()}).optional()}).optional()});kl.extend({personality:c().optional(),personalityLocal:c().optional(),personalityManaged:V().optional(),skills:M(DS).optional(),plugins:M(FS).optional(),sandboxSettings:$S.nullable().optional(),codexSandbox:H1.nullable().optional()});g({slug:c().regex(/^[a-z0-9]+(-[a-z0-9]+)*$/).max(32),label:c().min(1),personality:c(),model:c().optional(),effort:c().optional(),serviceTier:kl.shape.serviceTier,tool:c().optional(),public:V().optional(),iconKey:c().optional()}).strict();g({personaId:c().min(1)});g({personaId:c().min(1),patch:g({label:c().min(1).optional(),model:c().optional(),effort:c().optional(),serviceTier:kl.shape.serviceTier,tool:c().optional(),size:MS.optional(),cpu:OS.optional(),taskConcurrency:kl.shape.taskConcurrency,cloudEngine:V1.optional(),personality:c().optional(),personalityLocal:c().optional(),public:V().optional(),iconKey:c().nullable().optional(),codexSandbox:H1.optional()}).strict()}).strict();g({version:P(1),manifest:gd}).strict();const US=["hard","soft"],W1=Y(US),BS=Y(["scanning","done","failed"]),q1=g({id:c().min(1),manifest:gd,scanSessionId:c().optional(),status:BS,evidence:M(jS).default([]),notes:M(c()).default([]),head:c().min(1).optional(),baseKind:W1.default("hard"),base:c().min(1).optional(),startedAt:N(),finishedAt:N().optional(),error:c().optional()}).strict(),yd=g({id:c().min(1).optional(),environment:kt.optional(),legacy:V().optional(),head:c().min(1),contentHead:c().min(1),scanId:c().min(1),at:N(),pushed:V().optional(),runId:N().int().positive().optional(),runAttempt:N().int().positive().optional(),artifactId:N().int().positive().optional(),verified:U1.optional(),config:$1.optional(),reconfigOf:c().min(1).optional(),workflowVersion:N().int().positive().optional(),confirmation:g({fingerprint:c().regex(/^[a-f0-9]{64}$/),runId:N().int().positive(),runAttempt:N().int().positive(),at:N()}).strict().optional()}).strict(),VS=["prepared","main-pushed","dispatching","dispatched","completed","failed"],xd=g({id:c().min(1),releaseId:c().min(1),at:N(),verified:U1.optional(),phase:Y(VS),expectedMain:c().optional(),runId:N().int().positive().optional(),runAttempt:N().int().positive().optional(),error:c().optional()}).strict(),Ap=g({channelId:c().min(1),updatedAt:N()}).strict(),vd=g({integration:Ap.nullable().optional(),production:Ap.nullable().optional()}).strict();g({version:P(4),engineChannels:vd.optional(),scans:M(q1),releases:M(yd),promotions:M(xd).default([])}).strict();const HS=g({url:c().min(1),branch:c().min(1),head:c().min(1),dirty:V(),ahead:N()}).strict(),js=g({env:c().min(1),setAt:N().optional()}).strict(),WS=["pending","running","done","failed","waiting","skipped"],qS=Y(WS),ZS="verify",GS=["build","smoke","deploy",ZS],KS=Y(GS),QS=g({key:KS,status:qS,url:c().optional(),jobId:N().optional(),startedAt:N().optional(),completedAt:N().optional()}).strict(),As=g({runId:N(),headSha:c().min(1),status:Y(["queued","running","completed"]),htmlUrl:c().min(1),jobs:M(QS),environment:kt.optional(),branch:c().optional(),event:c().optional(),runAttempt:N().int().positive().optional(),conclusion:Y(["success","failure"]).optional(),promotionId:c().optional()}).strict(),Ea=g({runId:N(),status:As.shape.status,conclusion:Y(["success","failure"]).optional(),htmlUrl:c().min(1)}).strict(),Z1=g({personaId:c().min(1),engineChannels:vd.optional(),github:SS.optional(),publisherFeishuAuth:g({integration:g({connected:V(),authUrl:c().optional(),error:c().optional()}).strict(),production:g({connected:V(),authUrl:c().optional(),error:c().optional()}).strict()}).strict().optional(),repo:HS.optional(),scans:M(q1).default([]),releases:M(yd).default([]),promotions:M(xd).optional(),targets:g({integration:g({run:As.optional(),secrets:M(js).optional(),online:V().optional(),image:Tn.optional(),unpublish:Ea.optional()}).strict().optional(),production:g({run:As.optional(),secrets:M(js).optional(),online:V().optional(),image:Tn.optional(),unpublish:Ea.optional()}).strict().optional()}).strict().optional(),secrets:M(js).optional(),run:As.optional(),online:V().optional(),unpublish:Ea.optional(),historyError:c().optional()}).strict();g({before:N().nullable()}).strict();Z1.pick({personaId:!0,github:!0,repo:!0,scans:!0,releases:!0,promotions:!0,engineChannels:!0,historyError:!0});Z1.pick({scans:!0});g({environment:kt,secrets:M(js).optional(),engineChannels:vd.optional()}).strict();g({sha:c().min(1),actionsUrl:c().min(1),releaseId:c().optional()}).strict();const Do=g({personaId:c().min(1)}).strict();Do.extend({releaseHead:c().min(1).optional(),releaseId:c().min(1).optional(),environment:kt.optional()}).strict();Do.extend({scanBase:W1.optional()}).strict();Do.extend({scanId:c().min(1)}).strict();Do.extend({releaseId:c().min(1)}).strict();Do.extend({environment:kt.default("production")}).strict();g({confirmation:yd.shape.confirmation.unwrap()}).strict();g({promotion:xd}).strict();g({personaId:c().min(1),expectedImage:Tn}).strict();g({personaId:c().min(1),scanId:c().min(1),patch:g({manifest:gd.optional(),connector:L1.optional()}).strict()}).strict();g({personaId:c().min(1),environment:kt.default("production"),scanId:c().min(1),name:c().min(1),values:Dt(c(),c())}).strict();g({personaId:c().min(1),environment:kt.default("production"),channelId:c().min(1).optional(),auth:g({baseUrl:c(),apiKey:c()}).strict().nullable().optional()}).strict().refine(e=>e.channelId!==void 0||e.auth!==void 0,{message:"Either channelId or auth must be provided"});g({personaId:c().min(1),environment:kt.default("production"),releaseId:c().optional(),jobId:N()}).strict();g({personaId:c().min(1),kind:Y(["package","secret","connector"]),item:Dt(c(),Sn()),evidence:g({reason:c().min(1),file:c().min(1),quote:c().min(1)})}).strict();g({personaId:c().min(1),notes:M(c()).default([])}).strict();g({environment:kt.default("production")}).strict();const YS=g({deviceId:c().min(1),name:c().min(1),url:c().min(1)});g({type:P("device:list:ok"),devices:M(YS)});g({deviceId:c().min(1),url:c().min(1).optional(),name:c().optional()});g({type:P("device:connect:ok"),deviceId:c(),name:c(),url:c()});const G1=g({ownerId:c().min(1),provider:c().min(1),displayName:c().min(1),avatarUrl:c().optional(),unionId:c().optional()});g({type:P("auth:login:start:ok"),environment:kt.optional(),authUrl:c().min(1),state:c().min(1)});g({type:P("auth:getIdentity:ok"),identity:G1.nullable(),deviceId:c().min(1)});g({type:P("auth:logout:ok")});const K1=c().nullable();g({type:P("auth:apiKey:get:ok"),apiKey:c().nullable(),createdAt:c().nullable(),gatewayUrl:K1});g({type:P("auth:apiKey:regenerate:ok"),apiKey:c().min(1),createdAt:c().min(1),gatewayUrl:K1});g({type:P("auth:apiKey:revoke:ok"),revoked:V()});g({type:P("auth:login:done"),environment:kt.optional(),identity:G1});g({type:P("auth:login:failed"),environment:kt.optional(),reason:c()});g({deviceId:c().min(1),remoteAccessAllowed:V()}).strict();g({type:P("contact:setRemoteAccess:ok"),deviceId:c().min(1),remoteAccessAllowed:V()}).strict();g({type:P("contact:remote-access-updated"),deviceId:c().min(1),remoteAccessAllowed:V()}).strict();g({personaId:c().min(1)}).strict();const XS=["connected","missing","reauth"],JS=["link","fill"],e2=g({name:md,id:c().min(1),kind:Y(R1),runner:Y(z1),auth:Y(M1),status:Y(XS),action:Y(JS),authUrl:c().optional(),fields:M(hd)}).strict();g({connectors:M(e2)}).strict();g({personaId:c().min(1),name:md,values:Dt(hd,c().min(1))}).strict();const t2=g({deviceId:c().min(1),ownerId:c().min(1),provider:c().min(1),displayName:c(),remoteUrl:c().min(1),connectToken:c(),grants:M(pd),addedAt:N().int().nonnegative(),pinnedAt:N().int().nullable().default(null),remoteAccessAllowed:V().default(!1),note:c().default("")}).strict(),Q1=t2;g({deviceId:c().min(1)}).strict();g({type:P("contact:remove:ok"),deviceId:c().min(1)}).strict();g({type:P("contact:list:ok"),contacts:M(Q1)}).strict();g({type:P("contact:added"),contact:Q1}).strict();g({type:P("contact:removed"),deviceId:c().min(1)}).strict();g({deviceId:c().min(1),pinned:V()}).strict();g({deviceId:c().min(1),note:c()}).strict();g({type:P("contact:setNote:ok"),deviceId:c().min(1),note:c()}).strict();g({type:P("contact:pin:ok"),deviceId:c().min(1),pinnedAt:N().int().nullable()}).strict();g({type:P("contact:pinned"),deviceId:c().min(1),pinnedAt:N().int().nullable()}).strict();const kd=vt("kind",[g({kind:P("success"),text:c(),brief:c().optional(),filePaths:M(c()).optional()}),g({kind:P("failure"),reason:c(),brief:c().optional()})]);g({targetPersona:c().min(1).optional(),dispatchId:c().min(1).optional(),prompt:c(),brief:c().optional(),targetDeviceId:c().min(1).optional(),model:c().min(1).optional(),tool:c().min(1).optional(),sessionLabel:c().min(1).max(60).optional(),meta:Dt(Sn()).optional()}).refine(e=>e.targetPersona!==void 0||e.dispatchId!==void 0,{message:"either targetPersona (new dispatch) or dispatchId (follow-up) is required"}).refine(e=>!(e.dispatchId!==void 0&&e.targetDeviceId!==void 0),{message:"cross-device dispatch cannot be continued (dispatchId + targetDeviceId are mutually exclusive)"}).refine(e=>!(e.tool!==void 0&&e.targetDeviceId!==void 0),{message:"engine override is not supported for cross-device dispatch (tool + targetDeviceId are mutually exclusive)"}).refine(e=>!(e.dispatchId!==void 0&&(e.tool!==void 0||e.model!==void 0)),{message:"a follow-up dispatch cannot change engine or model (dispatchId excludes tool / model); start a new dispatch instead"});g({dispatchId:c().min(1),outcome:kd});const n2=["running","completed","failed"],wd=Y(n2),r2=g({dispatchId:c().min(1),sourceSessionId:c().min(1),sourcePersonaId:c().min(1).optional(),targetPersonaId:c().min(1),targetDeviceId:c().min(1).optional(),workerSessionId:c().min(1).optional(),taskText:c(),taskBrief:c().optional(),round:N().int().positive().optional(),status:wd,outcome:kd.optional(),meta:Dt(Sn()).optional(),createdAt:c().min(1),completedAt:c().min(1).optional(),deliveredAt:c().min(1).optional()});g({sourceSessionId:c().min(1).optional(),relatedSessionId:c().min(1).optional()});g({records:M(r2)});g({dispatchId:c().min(1)});g({type:P("personaDispatch:get:ok"),status:wd,outcome:kd.optional()});const i2=/^[a-z0-9][a-z0-9-]*$/;Y(["stopped","starting","running","crashed","invalid"]);const o2=new Set(["localhost","127.0.0.1"]);function s2(e){let t;try{t=new URL(e)}catch{return!1}return!!(t.protocol==="https:"||t.protocol==="http:"&&o2.has(t.hostname))}const cs=g({id:c().regex(i2),name:c().min(1),version:c().min(1),apiVersion:P("1"),runtime:g({startCommand:c().min(1)}).passthrough().optional(),entry:g({url:c().url().refine(s2,{message:"INVALID_URL_SCHEME: only https or http://localhost is allowed"})}).strict().optional()}).passthrough().superRefine((e,t)=>{var i;const n=!!e.runtime,r=!!((i=e.entry)!=null&&i.url);n&&r&&t.addIssue({code:L.custom,message:"INVALID_MANIFEST: entry.url and runtime cannot coexist"}),!n&&!r&&t.addIssue({code:L.custom,message:"INVALID_MANIFEST: must have either entry.url or runtime"})}),l2=vt("kind",[g({kind:P("local"),port:N().int().min(1).max(65535)}),g({kind:P("hosted"),url:c().url()})]);vt("state",[g({extId:c(),manifest:cs,state:P("stopped")}),g({extId:c(),manifest:cs,state:P("starting")}),g({extId:c(),manifest:cs,state:P("running"),target:l2}),g({extId:c(),manifest:cs,state:P("crashed")}),g({extId:c(),manifest:Sn().nullable(),state:P("invalid"),invalidReason:c().min(1)})]);g({snapshotHash:c().min(1),version:c().min(1),publishedAt:N()});const a2=vt("kind",[g({kind:P("p2p-tunnel"),ownerPrincipalId:c().min(1),extId:c().min(1)})]);vt("kind",[g({kind:P("p2p-tunnel"),ownerPrincipalId:c().min(1),extId:c().min(1),snapshotHash:c().min(1)})]);g({extId:c().min(1),name:c().min(1),version:c().min(1),contentHash:c().min(1),publishedAt:N()});const u2=vt("kind",[g({kind:P("clean")}),g({kind:P("ready-new-version"),fromVersion:c().min(1),toVersion:c().min(1)}),g({kind:P("error-same-hash"),version:c().min(1)}),g({kind:P("error-version-not-bumped"),localVersion:c().min(1),publishedVersion:c().min(1)}),g({kind:P("error-version-regression"),localVersion:c().min(1),publishedVersion:c().min(1)})]);g({localManifest:g({name:c().min(1),version:c().min(1),contentHash:c().min(1)}),publishState:vt("kind",[g({kind:P("unpublished")}),g({kind:P("published"),version:c().min(1),contentHash:c().min(1),publishedAt:N()})]),check:u2});g({extId:c().min(1),newVersion:c().min(1).nullish()});g({extId:c().min(1)});g({extId:c().min(1),snapshotHash:c().min(1)});g({channelRef:a2,snapshotHash:c().min(1),zipBase64:c().min(1)});g({id:c().min(1),peerDeviceId:c().min(1),senderDeviceId:c().min(1),text:c().min(1),createdAt:N().int().nonnegative(),readBy:Dt(c().min(1),N().int().positive()).default({}),origin:g({kind:P("persona"),personaId:c().min(1)}).optional()}).strict();g({peerDeviceId:c().min(1).optional(),id:c().min(1),text:c().min(1),createdAt:N().int().nonnegative(),origin:g({kind:P("persona"),personaId:c().min(1)}).optional()}).strict();g({peerDeviceId:c().min(1),sinceCreatedAt:N().int().nonnegative().optional()}).strict();g({peerDeviceId:c().min(1),upToCreatedAt:N().int().nonnegative()}).strict();g({peerDeviceId:c().min(1).optional(),text:c().min(1)});g({peerDeviceId:c().min(1).optional(),command:c().min(1),timeoutMs:N().int().positive().optional()}).strict();g({type:P("peerExec:run:ok"),stdout:c(),stderr:c(),exitCode:N().int().nullable(),timedOut:V(),stdoutTruncated:V(),stderrTruncated:V()}).strict();const Y1=vt("kind",[g({kind:P("at"),at:c().min(1)}),g({kind:P("every"),everyMs:N().int().positive(),anchorMs:N().int().nonnegative().optional()}),g({kind:P("cron"),expr:c().min(1),tz:c().min(1).optional()})]),Fo=c().trim().min(1);g({personaId:Fo,name:c().min(1),schedule:Y1,prompt:c().min(1),targetPersona:c().min(1).optional(),timeoutMs:N().int().positive().optional()});g({personaId:Fo,onlyMine:V().optional()});g({personaId:Fo,shiftId:c().min(1)});const c2=g({name:c().min(1).optional(),schedule:Y1.optional(),prompt:c().min(1).optional(),targetPersona:c().min(1).optional(),timeoutMs:N().int().positive().optional(),enabled:V().optional()});g({personaId:Fo,shiftId:c().min(1),patch:c2});g({personaId:Fo,shiftId:c().min(1),limit:N().int().positive().optional()});const bd=g({personaId:c().min(1),deviceId:c().min(1).optional()}),X1=g({id:c().min(1),name:c().min(1),memberPersonas:M(bd),memberContactDeviceIds:M(c().min(1)),createdAt:c().min(1),updatedAt:c().min(1)}),J1=c().trim().min(1);g({name:J1,memberPersonas:M(bd).default([]),memberContactDeviceIds:M(c().min(1)).default([])});g({channelId:c().min(1),name:J1.optional(),memberPersonas:M(bd).optional(),memberContactDeviceIds:M(c().min(1)).optional()});g({channelId:c().min(1)});g({channels:M(X1)});g({channel:X1});g({ok:P(!0),removedTopics:N().int().min(0)});const Be=c().trim().min(1),Sd=["master-confirmed","owner-needed"],_d=["open","resolved"],d2=Sd[0];Sd[1];_d[0];const f2=_d[1],p2=Y(Sd),m2=Y(_d),h2=g({id:Be.optional(),resolves:Be.optional(),type:p2,status:m2,question:Be,recommendation:Be}).superRefine((e,t)=>{e.type===d2&&e.status!==f2&&t.addIssue({code:L.custom,path:["status"],message:"master-confirmed decisions must be resolved"})}),g2=["planning","running","done"],y2=Y(g2),ey=g({at:c().min(1),actor:c().min(1),action:c().min(1),target:c().optional(),reason:c().min(1),artifacts:M(Be).optional(),decision:h2.optional()}),x2=g({rejectCount:N().int().min(0),accepted:V().default(!1),ordinal:N().int().min(1).optional(),overrideCount:N().int().min(0).optional()}),Cd=g({id:c().min(1),channelId:c().min(1),title:c(),masterSessionId:c().min(1),goal:c(),boundaries:c(),acceptanceCriteria:M(c()),activity:M(ey),lineMeta:Dt(x2),nextLineOrdinal:N().int().min(1).optional(),state:y2,createdAt:c().min(1),updatedAt:c().min(1)}),v2=g({lineId:c().min(1),dispatchId:c().min(1),workerSessionId:c().optional(),assignee:c().min(1),focus:c(),status:wd,acceptance:M(c()),rejectCount:N().int().min(0),accepted:V(),ordinal:N().int().min(1).nullable()});g({channelId:c().min(1)});g({topicId:c().min(1).optional(),sessionId:c().min(1).optional()}).refine(e=>e.topicId!==void 0||e.sessionId!==void 0,{message:"either topicId or sessionId is required"});g({channelId:c().min(1),title:Be.optional()});g({topicId:c().min(1),title:Be.optional(),goal:Be,boundaries:c(),acceptanceCriteria:M(Be).min(1)});g({topicId:c().min(1),action:Be,target:Be.optional(),reason:Be,artifacts:M(Be).optional(),decision:ey.shape.decision});g({topicId:c().min(1),lineId:Be,reason:Be});g({topicId:c().min(1),lineId:Be,reason:Be,artifacts:M(Be).optional(),watcherVerdict:Y(["pass","fail"]),overrideReason:Be.optional()}).refine(e=>e.watcherVerdict!=="fail"||!!e.overrideReason,{message:"watcherVerdict=fail 时必须给 overrideReason(推翻 watcher 的理由)",path:["overrideReason"]});g({topicId:c().min(1),state:Y(["done"])});g({topicId:c().min(1),title:Be});g({topicId:c().min(1)});const k2=Cd.extend({lineCount:N().int().min(0)});g({topics:M(k2)});g({topic:Cd,lines:M(v2)});g({topicId:c().min(1),masterSessionId:c().min(1)});g({rejectCount:N().int().min(1),needsOwnerAttention:V()});g({acceptedLines:N().int().min(1),totalLines:N().int().min(1),allAccepted:V(),overrides:N().int().min(0),needsOwnerAttention:V()});g({topic:Cd});g({ok:P(!0),removedMasterSessionId:c().min(1).nullable(),removedWorkerSessionIds:M(c().min(1))});const w2=["ask","allow","deny"],ty=Y(w2),b2=g({id:c().min(1),desc:c().min(1),action:ty});g({rules:M(b2)});g({ruleId:c().min(1)});g({action:ty,desc:c(),source:c().min(1)});const S2=["created","review-requested"],ny=/^[A-Za-z0-9._-]+$/,_i=c().min(1).regex(ny),Ci=c().min(1).regex(ny),$o=N().int().positive();g({role:Y(S2)});g({owner:_i,repo:Ci,number:$o});g({owner:_i,repo:Ci,number:$o,expectedHeadSha:c().min(1)});g({owner:_i,repo:Ci,number:$o,body:c().min(1)});g({owner:_i,repo:Ci,number:$o,ready:V()});g({owner:_i,repo:Ci});g({owner:_i,repo:Ci,number:$o,reviewers:M(c().min(1)).min(1)});g({personaId:c().min(1)});g({personaId:c().min(1)});const _2=["expired","cancelled","access_denied","lark_protocol_error","cloud_unreachable","internal_error"],C2=Y(_2);g({personaId:c().min(1),appId:c().min(1),appSecret:c().min(1),botName:c().min(1).optional()});const I2=g({chatId:c().min(1),chatName:c().optional(),lastActiveAt:N().int().optional()}),E2=g({state:Y(["unbound","provisioning","bound","broken"]),appId:c().optional(),botName:c().optional(),brokenReason:c().optional(),qrUrl:c().optional(),provisionId:c().optional(),errorReason:C2.optional(),groups:M(I2),needsUpgrade:V().optional(),upgradeQrUrl:c().optional()});E2.extend({personaId:c().min(1)});g({});g({onboardingCompletedAt:N()});const Wl=["claude","codex","pi"];g({});g({tools:M(g({id:Y(Wl),available:V(),version:c().optional(),path:c().optional()}))});g({});const N2=g({tool:Y(Wl),cwd:c(),toolSessionId:c(),label:c().optional(),createdAt:c(),updatedAt:c(),turns:N()});g({candidates:M(N2)});g({});g({registered:V()});g({tool:Y(Wl)});const Pp=g({usedPercent:N(),windowDurationMins:N().optional(),resetsAt:N().optional()}).strict(),T2=vt("kind",[g({kind:P("claude"),loggedIn:V(),authMethod:c().optional(),apiProvider:c().optional(),apiKeySource:c().optional(),email:c().optional(),orgName:c().optional(),subscriptionType:c().optional()}).strict(),g({kind:P("codex"),login:vt("type",[g({type:P("none")}).strict(),g({type:P("apiKey")}).strict(),g({type:P("chatgpt"),email:c(),planType:c()}).strict()]),provider:g({name:c(),baseUrl:c().optional()}).strict(),rateLimits:g({primary:Pp.optional(),secondary:Pp.optional()}).strict().optional()}).strict(),g({kind:P("pi"),providers:M(g({id:c(),modelCount:N(),credential:Y(["api_key","oauth"]).optional(),oauthExpiresAt:N().optional()}).strict())}).strict()]);g({tool:Y(Wl),installed:V(),version:c().optional(),path:c().optional(),account:T2.optional(),error:c().optional(),modelsLoadedAt:N().optional()}).strict();g({apiKey:c().min(1)}).strict();g({ok:P(!0)}).strict();const j2=["cloud-persona-metrics","cloud-persona-conversations"],A2=Y(j2);g({page:A2}).strict();g({url:c(),expiresAt:N().int()}).strict();const P2=["idle","running","running-idle","stopped","error","observing"],R2=["task-notification","slash-command","local-command","system-reminder","skill-hint","meta-text","attachment-skills","attachment-deferred-tools","dispatch-task","dispatch-result"];function ry(e){return e==="dispatch-task"||e==="dispatch-result"}const z2=["builtin","global","project","plugin"],M2=["builtin","global","project","policy","plugin"],iy=Y(["owner","guest"]);g({id:c().min(1),kind:iy,displayName:c(),feishuUnionId:c().optional()}).strict();const L2=g({did:c().min(1),displayName:c(),feishuUnionId:c().optional(),principal:iy}).strict(),O2=Y(P2),D2=g({inputTokens:N().int().nonnegative(),outputTokens:N().int().nonnegative(),cacheReadTokens:N().int().nonnegative().optional(),cacheCreateTokens:N().int().nonnegative().optional()}),oy={gitBranch:c().optional(),resolvedModel:c().optional(),resolvedEffort:c().optional(),contextUsage:D2.optional(),contextWindowSize:N().int().positive().optional(),aiLabel:c().optional()},F2=g(oy),sy=g({value:c(),label:c(),description:c().optional()}),$2=g({id:c().min(1),label:c().min(1),description:c().optional(),contextWindowSize:N().int().positive(),default:V().optional(),efforts:M(sy).optional(),defaultEffort:c().optional(),group:c().optional()}),U2=g({id:c().min(1),label:c().min(1),description:c().optional()}),B2=g({name:c().min(1),type:Y(["string","select","toggle"]),label:c().min(1),description:c().optional(),options:M(sy).optional(),default:Sn().optional(),scope:Y(["core","tool-specific"])});g({tool:c().min(1),refresh:V().optional()});const V2=g({rewind:V(),subagents:V(),tui:V(),observe:V(),fileSharing:V(),fork:V()});g({tool:c().min(1),toolSessionIdLabel:c().optional(),models:M($2),permissionModes:M(U2),configSchema:M(B2),features:V2});const H2=g({tool:c().min(1),pattern:c().min(1),createdAt:c().min(1).optional()});g({cloudEnvironment:kt.optional(),cloudExpectedImage:Tn.optional(),testReleaseId:c().optional(),sessionId:c().min(1),cloudExecutionId:c().min(1).optional(),cloudConversationId:c().min(1).optional(),cloudWorkspace:fd.optional(),cloudPendingTurns:M(g({id:c().min(1),text:c(),prepared:V().optional()})).optional(),cloudGatewaySessionId:c().min(1).optional(),cloudPendingCommand:g({id:c().min(1),text:c(),prepared:V().optional()}).optional(),cwd:c().min(1),tool:P("claude").or(c().min(1)).default("claude"),toolSessionId:c().optional(),label:c().optional(),model:c().optional(),permissionMode:c().optional(),effort:c().optional(),serviceTier:c().optional(),...oy,aiLabelGeneratedAt:c().optional(),permissionRules:M(H2).optional(),pinnedAt:N().int().nonnegative().nullable().optional(),archivedAt:N().int().nonnegative().nullable().optional(),pinSortOrder:N().int().nullable().optional(),unreadAt:c().min(1).nullable().optional(),iconKey:c().optional(),forkedFromSessionId:c().min(1).optional(),ephemeral:V().optional(),deployId:c().min(1).optional(),ownerPersonaId:c().min(1).optional(),projectPath:c().min(1).optional(),chatId:c().min(1).optional(),creatorPrincipalId:c().min(1).optional(),creatorDisplayName:c().min(1).optional(),creatorFeishuUnionId:c().min(1).optional(),originOwnerPrincipalId:c().min(1).optional(),originOwnerPersonaId:c().min(1).optional(),dispatchedFromSessionId:c().min(1).optional(),shiftFiredFromSessionId:c().min(1).optional(),larkChatId:c().min(1).optional(),larkChatName:c().min(1).optional(),larkChatType:Y(["p2p","group"]).optional(),createdAt:c().min(1),updatedAt:c().min(1)});const ft={turnId:c().min(1).optional(),seq:N().int().nonnegative().optional(),ts:c().optional(),uuid:c().optional()},W2=Y(R2),q2=g({readCount:N().int().nonnegative().optional(),searchCount:N().int().nonnegative().optional(),bashCount:N().int().nonnegative().optional(),editFileCount:N().int().nonnegative().optional(),linesAdded:N().int().nonnegative().optional(),linesRemoved:N().int().nonnegative().optional(),otherToolCount:N().int().nonnegative().optional()}),Z2=g({oldStart:N().int().nonnegative(),oldLines:N().int().nonnegative(),newStart:N().int().nonnegative(),newLines:N().int().nonnegative(),lines:M(c())}),G2=g({agentId:c().optional(),agentType:c().optional(),status:c().optional(),prompt:c().optional(),filePath:c().optional(),structuredPatch:M(Z2).optional(),stats:g({durationMs:N().int().nonnegative().optional(),tokens:N().int().nonnegative().optional(),toolUseCount:N().int().nonnegative().optional(),toolStats:q2.optional()}).optional()}),K2=g({path:c(),content:c(),mtimeMs:N().optional()}),Q2=g({label:c().min(1),description:c().optional()}),ly=g({question:c().min(1),multiSelect:V(),options:M(Q2).min(1)}),Y2=["completed","interrupted"];vt("kind",[g({...ft,kind:P("session_init"),toolSessionId:c().optional()}),g({...ft,kind:P("thinking"),text:c(),partialId:c().optional()}),g({...ft,kind:P("text"),text:c(),partialId:c().optional()}),g({...ft,kind:P("user_text"),text:c(),meta:W2.optional(),taskId:c().optional(),parentToolUseId:c().optional(),sender:L2.optional()}),g({...ft,kind:P("tool_call"),toolUseId:c(),tool:c(),toolKind:c().optional(),input:Sn()}),g({...ft,kind:P("tool_result"),toolUseId:c(),output:Sn().optional(),error:c().optional(),toolResultExtra:G2.optional(),sourceToolAssistantUUID:c().optional(),askQuestionAnswers:Dt(c(),c()).optional()}),g({...ft,kind:P("attachment_memories"),memories:M(K2)}),g({...ft,kind:P("permission_request"),requestId:c(),tool:c(),input:Sn(),toolUseId:c().optional()}),g({...ft,kind:P("ask_user_question"),toolUseId:c(),questions:M(ly)}),g({...ft,kind:P("turn_end"),durationMs:N().int().nonnegative().optional(),reason:Y(Y2).optional(),turnId:c().min(1).optional()}),g({...ft,kind:P("subagent_progress"),toolUseId:c(),agentId:c(),status:Y(["started","running","completed","failed"]),description:c().optional(),lastToolName:c().optional(),prompt:c().optional(),stats:g({durationMs:N().int().nonnegative().optional(),tokens:N().int().nonnegative().optional(),toolUseCount:N().int().nonnegative().optional()}).optional()}),g({...ft,kind:P("error"),message:c()}),g({...ft,kind:P("meta_update"),patch:F2}),g({...ft,kind:P("meta-text"),text:c(),metaSource:Y(["cc","owner"]).optional()})]);g({cwd:c().min(1).optional(),tool:c().optional(),label:c().optional(),aiLabel:c().optional(),model:c().optional(),permissionMode:c().optional(),effort:c().optional(),serviceTier:B1.optional(),iconKey:c().optional(),forkedFromSessionId:c().min(1).optional(),ephemeral:V().optional(),ownerPersonaId:c().min(1).optional(),projectPath:c().min(1).optional()}).refine(e=>e.cwd!=null||e.ownerPersonaId!=null||e.projectPath!=null,{message:"cwd / ownerPersonaId / projectPath 至少传一个"});g({path:c().min(1),name:c().min(1),createdAt:c().datetime(),pinnedAt:N().optional()});g({path:c().min(1),pinnedAt:N().nullable()});g({path:c().min(1)});g({path:c().min(1).optional(),name:c().min(1).optional()}).refine(e=>e.path!=null||e.name!=null,{message:"path 与 name 至少给一个"});g({cwd:c().min(1),tool:c().min(1),toolSessionId:c().min(1),label:c().optional(),aiLabel:c().optional(),iconKey:c().optional(),createdAt:c().datetime(),updatedAt:c().datetime(),ownerPersonaId:c().min(1).optional()});g({originOnly:V().optional(),ownerPersonaId:c().min(1).optional(),limit:N().int().positive().optional(),offset:N().int().nonnegative().optional()});g({sessionId:c().min(1)});g({sessionId:c().min(1),patch:g({label:c().optional(),model:c().optional(),permissionMode:c().optional(),effort:c().optional(),cwd:c().optional(),iconKey:c().optional(),ephemeral:P(!1).optional()})});g({id:c().min(1),text:c(),queuedAt:N(),senderDisplayName:c().optional()});g({sessionId:c().min(1),text:c(),queueWhileRunning:V().optional()});g({sessionId:c().min(1),id:c().min(1).optional()});g({sessionId:c().min(1),userMessageId:c().min(1),dryRun:V().optional()});g({canRewind:V(),error:c().optional(),filesChanged:M(c()).optional(),insertions:N().int().nonnegative().optional(),deletions:N().int().nonnegative().optional()});g({sessionId:c().min(1),userMessageId:c().min(1)});const X2=g({oldStart:N().int().nonnegative(),oldLines:N().int().nonnegative(),newStart:N().int().nonnegative(),newLines:N().int().nonnegative(),lines:M(c())}),J2=g({filePath:c().min(1),hunks:M(X2),insertions:N().int().nonnegative(),deletions:N().int().nonnegative(),status:Y(["modified","added","deleted"]).optional()});g({canRewind:V(),error:c().optional(),files:M(J2),totalInsertions:N().int().nonnegative(),totalDeletions:N().int().nonnegative()});g({userMessageIds:M(c())});g({sessionId:c().min(1),toolSessionId:c().min(1)});g({cwd:c().min(1),toolSessionId:c().min(1),messageUuid:c().min(1).optional(),turnId:c().min(1).optional(),sourceSessionId:c().min(1).optional(),targetCwd:c().min(1).optional()}).refine(e=>!!(e.messageUuid||e.turnId),"messageUuid or turnId required");g({forkedToolSessionId:c().min(1),forkedFilePath:c().min(1)});g({sessionId:c().min(1),toolSessionId:c().min(1),jsonlPath:c().optional()});g({sessionId:c().min(1),afterSeq:N().int().min(-1)});g({sessionId:c().min(1),permissionRequestId:c().min(1),allow:V(),permanent:V().optional(),pattern:c().optional()});g({projectPath:c().min(1)});g({sessionId:c().min(1),limit:N().int().positive().max(5e3).optional(),offset:N().int().nonnegative().optional(),snapshotId:c().uuid().optional(),slim:V().optional(),view:Y(["turns","items"]).optional(),cursor:c().min(1).max(16384).optional(),turnId:c().min(1).max(256).optional()}).superRefine((e,t)=>{e.view==="items"&&!e.turnId&&t.addIssue({code:L.custom,path:["turnId"],message:"items requires turnId"}),e.view&&(e.offset!==void 0||e.slim!==void 0)&&t.addIssue({code:L.custom,message:"native views do not accept offset or slim"}),!e.view&&(e.cursor!==void 0||e.turnId!==void 0)&&t.addIssue({code:L.custom,message:"cursor and turnId require a native view"}),e.view==="turns"&&e.turnId!==void 0&&t.addIssue({code:L.custom,path:["turnId"],message:"turns does not accept turnId"}),e.view&&e.limit!==void 0&&e.limit>100&&t.addIssue({code:L.custom,path:["limit"],message:"native page limit is 100"})});g({cwd:c().min(1),toolSessionId:c().min(1)});g({cwd:c().min(1),toolSessionId:c().min(1),subagentId:c().min(1)});g({cwd:c().min(1).optional(),path:c().optional(),showHidden:V().optional()});g({cwd:c().min(1),path:c().min(1)});g({cwd:c().min(1),tool:c().optional()});g({name:c().min(1),source:Y(z2),path:c().optional(),description:c().optional(),plugin:c().optional()});const e_=g({name:c().min(1),source:Y(M2),path:c().optional(),description:c().optional(),whenToUse:c().optional(),plugin:c().optional()});g({cwd:c().min(1),tool:c().optional()});g({agents:M(e_)});g({sessionId:c().optional()});g({sessionId:c().min(1).optional()});g({sessionId:c().min(1),pinned:V()});g({sessionId:c().min(1),archived:V()});g({query:c().min(1),sessionIds:M(c().min(1)),limit:N().int().positive().max(50).optional()});const t_=g({sessionId:c().min(1),snippet:c()});g({type:P("session:searchContent"),matches:M(t_)});g({type:P("peerSession:upsert:ok")});g({sessionId:c().min(1)});g({type:P("peerSession:remove:ok")});g({orderedIds:M(c().min(1)).min(1)});g({cwd:c().min(1)});g({isGitRoot:V(),gitRoot:c().nullable()});g({cwd:c().min(1)});g({branch:c().nullable()});g({cwd:c().min(1)});g({branches:M(c()),head:c().nullable()});const n_=g({cwd:c().min(1),updatedAt:c().min(1)});g({dirs:M(n_)});g({type:P("session:question"),sessionId:c().min(1),toolUseId:c().min(1),requestId:c().min(1),questions:M(ly).min(1)});g({type:P("session:question:cleared"),sessionId:c().min(1),toolUseId:c().min(1),answers:Dt(c(),c()).optional()});g({sessionId:c().min(1),toolUseId:c().min(1),answers:Dt(c(),c())});g({ok:P(!0)});g({sessionId:c().min(1),toolUseId:c().min(1)});g({ok:P(!0)});const ay=g({name:c().min(1),version:c().min(1),instanceId:c().min(1),deviceLabel:c().transform(e=>e.trim().slice(0,64)).optional()});g({type:P("auth"),token:c().min(1),scheme:P("bearer").optional(),clientInfo:ay.optional()});g({type:P("auth:ok"),version:c().min(1).optional(),protocolVersion:N().int().nonnegative().optional()});const r_=g({clientId:c().min(1),connectedAt:N().int().nonnegative(),self:V(),clientInfo:ay.optional()});g({type:P("device:connections:ok"),connections:M(r_)});g({type:P("tunnel:ready"),url:c().min(1),subdomain:c().min(1)});g({type:P("tunnel:exited"),code:N().int().nullable(),subdomain:c().nullable(),url:c().nullable()});g({type:P("tunnel:unavailable"),reason:c().min(1),failedAt:c().min(1)});const i_=g({sessionId:c().min(1),status:O2,freshSpawn:V(),pendingPermissionRequestIds:M(c().min(1)),pendingQuestionToolUseIds:M(c().min(1))});g({type:P("info"),version:c(),protocolVersion:N(),hostname:c(),os:c(),tools:M(g({id:c(),available:V()})),runningSessions:M(i_),tokenRole:Y(yS).optional(),isLoopback:V().optional(),httpBaseUrl:c().optional(),httpToken:c().optional(),daemonSource:Y(["ota","packaged"]).optional(),globalCliVersion:c().nullable().optional()});g({});g({method:c().min(1).optional()});const o_=["allowed","conditional","denied"],s_=Y(o_),l_=g({name:c().min(1),status:s_,description:c().min(1),args:M(g({name:c(),required:V()})).nullable(),argsSchema:Dt(Sn()).optional(),reason:c().optional()});g({type:P("meta:methods"),methods:M(l_)});const a_=/<system-reminder>此消息来自飞书群成员 (.+?)<\/system-reminder>\s*$/,u_=/<system-reminder>此消息来自 (owner|guest):(.+?)<\/system-reminder>\s*$/,c_="clawd-dispatch-task",d_="clawd-dispatch-result",Rp=120;function f_(e){if(!e)return[];const t=[];for(const n of["task","result"]){const r=n==="task"?c_:d_,i=new RegExp(`<${r}\\b([^>]*)>([\\s\\S]*?)</${r}>`,"gi");for(let o=i.exec(e);o!==null;o=i.exec(e))t.push({at:o.index,block:p_(n,o[1]??"",o[2]??"")})}return t.sort((n,r)=>n.at-r.at).map(n=>n.block)}function p_(e,t,n){var u;const r=k_(t),i=Ku(v_(Na(n,"detail")??n)),o=(u=Na(n,"brief"))==null?void 0:u.trim(),s=o&&o.length>0?Ku(o):m_(i),l=r.round!==void 0?Number.parseInt(r.round,10):void 0,a=r.status;return{kind:e,dispatchId:r["dispatch-id"]??"",...r.from?{from:r.from}:{},...e==="task"&&l!==void 0&&Number.isFinite(l)?{round:l}:{},...e==="result"&&(a==="success"||a==="failure")?{status:a}:{},brief:s,briefIsDerived:!(o&&o.length>0),detail:i,filePaths:x_(Na(n,"files"))}}function m_(e){const t=e.split(/\n\s*\n/).map(r=>r.trim()).find(r=>r.length>0);if(!t)return"";const n=t.replace(/\s+/g," ");return n.length>Rp?`${n.slice(0,Rp)}…`:n}const h_="clawd-dispatch-task|clawd-dispatch-result|brief|detail|files",g_=new RegExp(`<\\\\(\\\\*)(/?)(${h_})\\b`,"g");function y_(e){return Ku(e)}function Ku(e){return e.replace(g_,"<$1$2$3")}function Na(e,t){const n=new RegExp(`<${t}>([\\s\\S]*?)</${t}>`,"i").exec(e);return n?n[1]??"":null}function x_(e){return e?e.split(`
277
- `).map(t=>t.trim()).filter(t=>t.startsWith("- ")).map(t=>t.slice(2).trim()).filter(t=>t.length>0):[]}function v_(e){return e.replace(/^\n/,"").replace(/\n$/,"")}function k_(e){const t={},n=/([a-z-]+)="([^"]*)"/gi;for(let r=n.exec(e);r!==null;r=n.exec(e))t[r[1]]=w_(r[2]??"");return t}function w_(e){return e.replace(/&quot;/g,'"').replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&")}const b_=new Set(["permission-inline","question-card"]);function S_(e){return e.kind==="user-text"?!0:e.kind!=="user-meta"?!1:e.metaKind==="slash-command"||ry(e.metaKind)}function __(e){return e.kind==="user-text"&&e.continuesTurn===!0}function C_(e,t={}){const n=[];let r=null;const i=(o,s)=>{r&&(n.push(I_(r,o,s)),r=null)};for(const o of e){if(o.kind==="turn-end"){i(o,!0);continue}if(S_(o)&&(r===null||!__(o))){i(void 0,!0),r={query:o,body:[]};continue}r===null?r={body:[o]}:r.body.push(o)}return i(void 0,t.closeTrailing===!0),n}function I_(e,t,n){const{query:r,body:i}=e,o=E_(i,t,n),s=N_(i,o),l=j_(i,s),a=r??i[0]??t,u={kind:"turn",seq:a?a.seq:0,status:o,process:l,tail:s};return t!=null&&t.turnId&&(u.turnId=t.turnId),r&&(u.query=r),(t==null?void 0:t.durationMs)!==void 0&&(u.durationMs=t.durationMs),u}function E_(e,t,n){if(!n)return"running";if((t==null?void 0:t.reason)==="interrupted")return"interrupted";const r=Qu(e,i=>i.kind==="error");return r>=0&&!e.slice(r+1).some(o=>o.kind==="assistant-text")?"error":"done"}function N_(e,t){if(t==="running"){const r=[];for(let i=e.length-1;i>=0&&b_.has(e[i].kind);i--)r.unshift(e[i]);return r}const n=t==="error"?Qu(e,r=>r.kind==="error"):Qu(e,r=>r.kind==="assistant-text");return n>=0?[e[n]]:[]}const T_=new Set(["assistant-thinking","user-meta"]);function j_(e,t){const n=new Set(t),r=[];let i=null;const o=()=>{i&&(r.push({kind:"tool-group",seq:i[0].seq,items:i}),i=null)};for(const s of e){if(n.has(s)){o();continue}if(s.kind==="merged-tool"){i?i.push(s):i=[s];continue}if(T_.has(s.kind)){r.push(s);continue}o(),r.push(s)}return o(),r}function Qu(e,t){for(let n=e.length-1;n>=0;n--)if(t(e[n]))return n;return-1}const A_={Read:["正在读取","已读取"],Bash:["正在运行","已运行"],Grep:["正在搜索","已搜索"],Glob:["正在搜索","已搜索"],Edit:["正在编辑","已编辑"],Write:["正在写入","已写入"],WebFetch:["正在抓取","已抓取"],WebSearch:["正在搜索","已搜索"],Skill:["正在读取","已读取"]};function P_(e){if(!e||typeof e!="object")return"";const t=e,n=t.command??t.file_path??t.path??t.pattern??t.query??t.url??t.description;if(typeof n=="string")return n;for(const r of Object.values(t))if(typeof r=="string"&&r)return r;return""}function uy(e){const t=A_[e.tool],n=t?e.pending?t[0]:t[1]:e.pending?`正在执行 ${e.tool}`:`已执行 ${e.tool}`,r=P_(e.input);return r?`${n} ${r}`:n}function R_({item:e,renderItemDetail:t}){const[n,r]=U.useState(!1),i=n?sn:ln,o=n?(t==null?void 0:t(e))??null:null;return h.jsxs("div",{className:"min-w-0 max-w-full",children:[h.jsxs("button",{type:"button",onClick:()=>r(s=>!s),"aria-expanded":n,"data-testid":"tool-call-group-row",className:ve("flex w-full items-center gap-1.5 text-left cursor-pointer min-w-0 py-0.5 text-[13px] hover:text-text-200",e.error?"text-destructive/80":"text-text-400"),children:[e.pending?h.jsx(sr,{className:"w-3.5 h-3.5 animate-spin shrink-0"}):h.jsx(i,{className:"w-3.5 h-3.5 shrink-0 opacity-60"}),h.jsx("span",{className:"truncate min-w-0",children:uy(e)})]}),n?h.jsx("div",{"data-testid":"tool-call-group-row-detail",className:"pl-5 py-1 min-w-0 space-y-1.5 text-[12px] text-text-300",children:o!==null?o:h.jsxs(h.Fragment,{children:[h.jsx("pre",{className:"min-w-0 max-w-full overflow-auto whitespace-pre-wrap font-mono",children:JSON.stringify(e.input,null,2)}),e.output!==void 0?h.jsx("pre",{className:"min-w-0 max-w-full overflow-auto whitespace-pre-wrap font-mono text-text-400",children:typeof e.output=="string"?e.output:JSON.stringify(e.output,null,2)}):null,e.error?h.jsx("pre",{className:"min-w-0 max-w-full overflow-auto whitespace-pre-wrap font-mono text-destructive",children:e.error}):null]})}):null]})}function z_({items:e,renderItemDetail:t}){const[n,r]=U.useState(!1);if(e.length===0)return null;const i=e.some(a=>a.pending),o=i?[...e].reverse().find(a=>a.pending):e[e.length-1],s=!i&&e.length>1?` 等 ${e.length} 项`:"",l=n?sn:ln;return h.jsxs("div",{"data-testid":"tool-call-group",className:"min-w-0 max-w-full",children:[h.jsxs("button",{type:"button",onClick:()=>r(a=>!a),"aria-expanded":n,"data-testid":"tool-call-group-header",className:"flex w-full items-center gap-1.5 text-left cursor-pointer min-w-0 py-0.5 text-[13px] text-text-400 hover:text-text-200",children:[i&&!n?h.jsx(sr,{className:"w-3.5 h-3.5 animate-spin shrink-0"}):h.jsx(l,{className:"w-3.5 h-3.5 shrink-0"}),n?h.jsx("span",{className:"min-w-0 truncate opacity-70",children:i?"正在执行":`${e.length} 项`}):h.jsxs("span",{className:ve("truncate min-w-0",i&&"text-text-300"),children:[uy(o),s]})]}),n?h.jsx("div",{className:"mt-0.5 flex flex-col pl-5",children:e.map(a=>h.jsx(R_,{item:a,renderItemDetail:t},a.toolUseId))}):null]})}function M_(e){const t=Math.round(e/1e3);if(t<60)return`${t}秒`;const n=Math.floor(t/60),r=t%60;return r>0?`${n}分${r}秒`:`${n}分钟`}function L_(e,t){const n=t!==void 0?`耗时 ${M_(t)}`:"";switch(e){case"interrupted":return n?`已中断 · ${n}`:"已中断";case"error":return n?`出错 · ${n}`:"出错";default:return n||"已完成"}}function O_({status:e="done",durationMs:t,defaultExpanded:n=!1,onExpandedChange:r,children:i}){const[o,s]=U.useState(n),l=o?sn:ln;return h.jsxs("div",{"data-testid":"turn-process-block",className:"min-w-0 max-w-full border-t border-border pt-2",children:[h.jsxs("button",{type:"button",onClick:()=>{const a=!o;s(a),r==null||r(a)},"aria-expanded":o,"data-testid":"turn-process-block-header",className:ve("flex w-full items-center gap-1 text-left cursor-pointer min-w-0 py-0.5 text-[13px]",e!=="done"?"text-destructive/80 hover:text-destructive":"text-text-400 hover:text-text-200"),children:[h.jsx("span",{className:"truncate min-w-0",children:L_(e,t)}),h.jsx(l,{className:"w-3.5 h-3.5 shrink-0"})]}),o?h.jsx("div",{"data-testid":"turn-process-body",className:"mt-2 flex flex-col gap-2 border-l-2 border-border pl-3",children:i}):null]})}const D_=/<(system-reminder|related-dir|clawd-shift-fire)\b[^>]*>[\s\S]*?<\/\1>/gi,F_=/<builder-preview\b[^>]*\/>/gi,$_=/<(clawd-dispatch-task|clawd-dispatch-result)\b[^>]*>([\s\S]*?)<\/\1>/gi,U_=/<\/?(brief|detail|files)>/gi;function cy(e){return e?e.replace($_,(t,n,r)=>y_(r.replace(U_,"")).trim()).replace(D_,"").replace(F_,"").trim():""}const B_=cy;function V_(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const H_=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,W_=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,q_={};function zp(e,t){return(q_.jsx?W_:H_).test(e)}const Z_=/[ \t\n\f\r]/g;function G_(e){return typeof e=="object"?e.type==="text"?Mp(e.value):!1:Mp(e)}function Mp(e){return e.replace(Z_,"")===""}class Uo{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Uo.prototype.normal={};Uo.prototype.property={};Uo.prototype.space=void 0;function dy(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new Uo(n,r,t)}function Yu(e){return e.toLowerCase()}class wt{constructor(t,n){this.attribute=n,this.property=t}}wt.prototype.attribute="";wt.prototype.booleanish=!1;wt.prototype.boolean=!1;wt.prototype.commaOrSpaceSeparated=!1;wt.prototype.commaSeparated=!1;wt.prototype.defined=!1;wt.prototype.mustUseProperty=!1;wt.prototype.number=!1;wt.prototype.overloadedBoolean=!1;wt.prototype.property="";wt.prototype.spaceSeparated=!1;wt.prototype.space=void 0;let K_=0;const ce=Mr(),Fe=Mr(),Xu=Mr(),B=Mr(),Ee=Mr(),li=Mr(),St=Mr();function Mr(){return 2**++K_}const Ju=Object.freeze(Object.defineProperty({__proto__:null,boolean:ce,booleanish:Fe,commaOrSpaceSeparated:St,commaSeparated:li,number:B,overloadedBoolean:Xu,spaceSeparated:Ee},Symbol.toStringTag,{value:"Module"})),Ta=Object.keys(Ju);class Id extends wt{constructor(t,n,r,i){let o=-1;if(super(t,n),Lp(this,"space",i),typeof r=="number")for(;++o<Ta.length;){const s=Ta[o];Lp(this,Ta[o],(r&Ju[s])===Ju[s])}}}Id.prototype.defined=!0;function Lp(e,t,n){n&&(e[t]=n)}function Ii(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const o=new Id(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),t[r]=o,n[Yu(r)]=r,n[Yu(o.attribute)]=r}return new Uo(t,n,e.space)}const fy=Ii({properties:{ariaActiveDescendant:null,ariaAtomic:Fe,ariaAutoComplete:null,ariaBusy:Fe,ariaChecked:Fe,ariaColCount:B,ariaColIndex:B,ariaColSpan:B,ariaControls:Ee,ariaCurrent:null,ariaDescribedBy:Ee,ariaDetails:null,ariaDisabled:Fe,ariaDropEffect:Ee,ariaErrorMessage:null,ariaExpanded:Fe,ariaFlowTo:Ee,ariaGrabbed:Fe,ariaHasPopup:null,ariaHidden:Fe,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Ee,ariaLevel:B,ariaLive:null,ariaModal:Fe,ariaMultiLine:Fe,ariaMultiSelectable:Fe,ariaOrientation:null,ariaOwns:Ee,ariaPlaceholder:null,ariaPosInSet:B,ariaPressed:Fe,ariaReadOnly:Fe,ariaRelevant:null,ariaRequired:Fe,ariaRoleDescription:Ee,ariaRowCount:B,ariaRowIndex:B,ariaRowSpan:B,ariaSelected:Fe,ariaSetSize:B,ariaSort:null,ariaValueMax:B,ariaValueMin:B,ariaValueNow:B,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function py(e,t){return t in e?e[t]:t}function my(e,t){return py(e,t.toLowerCase())}const Q_=Ii({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:li,acceptCharset:Ee,accessKey:Ee,action:null,allow:null,allowFullScreen:ce,allowPaymentRequest:ce,allowUserMedia:ce,alt:null,as:null,async:ce,autoCapitalize:null,autoComplete:Ee,autoFocus:ce,autoPlay:ce,blocking:Ee,capture:null,charSet:null,checked:ce,cite:null,className:Ee,cols:B,colSpan:null,content:null,contentEditable:Fe,controls:ce,controlsList:Ee,coords:B|li,crossOrigin:null,data:null,dateTime:null,decoding:null,default:ce,defer:ce,dir:null,dirName:null,disabled:ce,download:Xu,draggable:Fe,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:ce,formTarget:null,headers:Ee,height:B,hidden:Xu,high:B,href:null,hrefLang:null,htmlFor:Ee,httpEquiv:Ee,id:null,imageSizes:null,imageSrcSet:null,inert:ce,inputMode:null,integrity:null,is:null,isMap:ce,itemId:null,itemProp:Ee,itemRef:Ee,itemScope:ce,itemType:Ee,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:ce,low:B,manifest:null,max:null,maxLength:B,media:null,method:null,min:null,minLength:B,multiple:ce,muted:ce,name:null,nonce:null,noModule:ce,noValidate:ce,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:ce,optimum:B,pattern:null,ping:Ee,placeholder:null,playsInline:ce,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:ce,referrerPolicy:null,rel:Ee,required:ce,reversed:ce,rows:B,rowSpan:B,sandbox:Ee,scope:null,scoped:ce,seamless:ce,selected:ce,shadowRootClonable:ce,shadowRootDelegatesFocus:ce,shadowRootMode:null,shape:null,size:B,sizes:null,slot:null,span:B,spellCheck:Fe,src:null,srcDoc:null,srcLang:null,srcSet:null,start:B,step:null,style:null,tabIndex:B,target:null,title:null,translate:null,type:null,typeMustMatch:ce,useMap:null,value:Fe,width:B,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Ee,axis:null,background:null,bgColor:null,border:B,borderColor:null,bottomMargin:B,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:ce,declare:ce,event:null,face:null,frame:null,frameBorder:null,hSpace:B,leftMargin:B,link:null,longDesc:null,lowSrc:null,marginHeight:B,marginWidth:B,noResize:ce,noHref:ce,noShade:ce,noWrap:ce,object:null,profile:null,prompt:null,rev:null,rightMargin:B,rules:null,scheme:null,scrolling:Fe,standby:null,summary:null,text:null,topMargin:B,valueType:null,version:null,vAlign:null,vLink:null,vSpace:B,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:ce,disableRemotePlayback:ce,prefix:null,property:null,results:B,security:null,unselectable:null},space:"html",transform:my}),Y_=Ii({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:St,accentHeight:B,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:B,amplitude:B,arabicForm:null,ascent:B,attributeName:null,attributeType:null,azimuth:B,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:B,by:null,calcMode:null,capHeight:B,className:Ee,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:B,diffuseConstant:B,direction:null,display:null,dur:null,divisor:B,dominantBaseline:null,download:ce,dx:null,dy:null,edgeMode:null,editable:null,elevation:B,enableBackground:null,end:null,event:null,exponent:B,externalResourcesRequired:null,fill:null,fillOpacity:B,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:li,g2:li,glyphName:li,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:B,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:B,horizOriginX:B,horizOriginY:B,id:null,ideographic:B,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:B,k:B,k1:B,k2:B,k3:B,k4:B,kernelMatrix:St,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:B,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:B,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:B,overlineThickness:B,paintOrder:null,panose1:null,path:null,pathLength:B,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Ee,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:B,pointsAtY:B,pointsAtZ:B,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:St,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:St,rev:St,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:St,requiredFeatures:St,requiredFonts:St,requiredFormats:St,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:B,specularExponent:B,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:B,strikethroughThickness:B,string:null,stroke:null,strokeDashArray:St,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:B,strokeOpacity:B,strokeWidth:null,style:null,surfaceScale:B,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:St,tabIndex:B,tableValues:null,target:null,targetX:B,targetY:B,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:St,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:B,underlineThickness:B,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:B,values:null,vAlphabetic:B,vMathematical:B,vectorEffect:null,vHanging:B,vIdeographic:B,version:null,vertAdvY:B,vertOriginX:B,vertOriginY:B,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:B,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:py}),hy=Ii({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),gy=Ii({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:my}),yy=Ii({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),X_={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},J_=/[A-Z]/g,Op=/-[a-z]/g,eC=/^data[-\w.:]+$/i;function tC(e,t){const n=Yu(t);let r=t,i=wt;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&eC.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(Op,rC);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!Op.test(o)){let s=o.replace(J_,nC);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}i=Id}return new i(r,t)}function nC(e){return"-"+e.toLowerCase()}function rC(e){return e.charAt(1).toUpperCase()}const iC=dy([fy,Q_,hy,gy,yy],"html"),Ed=dy([fy,Y_,hy,gy,yy],"svg");function oC(e){return e.join(" ").trim()}var Nd={},Dp=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,sC=/\n/g,lC=/^\s*/,aC=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,uC=/^:\s*/,cC=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,dC=/^[;\s]*/,fC=/^\s+|\s+$/g,pC=`
277
+ `).map(t=>t.trim()).filter(t=>t.startsWith("- ")).map(t=>t.slice(2).trim()).filter(t=>t.length>0):[]}function v_(e){return e.replace(/^\n/,"").replace(/\n$/,"")}function k_(e){const t={},n=/([a-z-]+)="([^"]*)"/gi;for(let r=n.exec(e);r!==null;r=n.exec(e))t[r[1]]=w_(r[2]??"");return t}function w_(e){return e.replace(/&quot;/g,'"').replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&")}const b_=new Set(["permission-inline","question-card"]);function S_(e){return e.kind==="user-text"?!0:e.kind!=="user-meta"?!1:e.metaKind==="slash-command"||ry(e.metaKind)}function __(e){return e.kind==="user-text"&&e.continuesTurn===!0}function C_(e,t={}){const n=[];let r=null;const i=(o,s)=>{r&&(n.push(I_(r,o,s)),r=null)};for(const o of e){if(o.kind==="turn-end"){i(o,o.inProgress!==!0);continue}if(S_(o)&&(r===null||!__(o))){i(void 0,!0),r={query:o,body:[]};continue}r===null?r={body:[o]}:r.body.push(o)}return i(void 0,t.closeTrailing===!0),n}function I_(e,t,n){const{query:r,body:i}=e,o=E_(i,t,n),s=N_(i,o),l=j_(i,s),a=r??i[0]??t,u={kind:"turn",seq:a?a.seq:0,status:o,process:l,tail:s};return t!=null&&t.turnId&&(u.turnId=t.turnId),r&&(u.query=r),(t==null?void 0:t.durationMs)!==void 0&&(u.durationMs=t.durationMs),u}function E_(e,t,n){if(!n)return"running";if((t==null?void 0:t.reason)==="interrupted")return"interrupted";const r=Qu(e,i=>i.kind==="error");return r>=0&&!e.slice(r+1).some(o=>o.kind==="assistant-text")?"error":"done"}function N_(e,t){if(t==="running"){const r=[];for(let i=e.length-1;i>=0&&b_.has(e[i].kind);i--)r.unshift(e[i]);return r}const n=t==="error"?Qu(e,r=>r.kind==="error"):Qu(e,r=>r.kind==="assistant-text");return n>=0?[e[n]]:[]}const T_=new Set(["assistant-thinking","user-meta"]);function j_(e,t){const n=new Set(t),r=[];let i=null;const o=()=>{i&&(r.push({kind:"tool-group",seq:i[0].seq,items:i}),i=null)};for(const s of e){if(n.has(s)){o();continue}if(s.kind==="merged-tool"){i?i.push(s):i=[s];continue}if(T_.has(s.kind)){r.push(s);continue}o(),r.push(s)}return o(),r}function Qu(e,t){for(let n=e.length-1;n>=0;n--)if(t(e[n]))return n;return-1}const A_={Read:["正在读取","已读取"],Bash:["正在运行","已运行"],Grep:["正在搜索","已搜索"],Glob:["正在搜索","已搜索"],Edit:["正在编辑","已编辑"],Write:["正在写入","已写入"],WebFetch:["正在抓取","已抓取"],WebSearch:["正在搜索","已搜索"],Skill:["正在读取","已读取"]};function P_(e){if(!e||typeof e!="object")return"";const t=e,n=t.command??t.file_path??t.path??t.pattern??t.query??t.url??t.description;if(typeof n=="string")return n;for(const r of Object.values(t))if(typeof r=="string"&&r)return r;return""}function uy(e){const t=A_[e.tool],n=t?e.pending?t[0]:t[1]:e.pending?`正在执行 ${e.tool}`:`已执行 ${e.tool}`,r=P_(e.input);return r?`${n} ${r}`:n}function R_({item:e,renderItemDetail:t}){const[n,r]=U.useState(!1),i=n?sn:ln,o=n?(t==null?void 0:t(e))??null:null;return h.jsxs("div",{className:"min-w-0 max-w-full",children:[h.jsxs("button",{type:"button",onClick:()=>r(s=>!s),"aria-expanded":n,"data-testid":"tool-call-group-row",className:ve("flex w-full items-center gap-1.5 text-left cursor-pointer min-w-0 py-0.5 text-[13px] hover:text-text-200",e.error?"text-destructive/80":"text-text-400"),children:[e.pending?h.jsx(sr,{className:"w-3.5 h-3.5 animate-spin shrink-0"}):h.jsx(i,{className:"w-3.5 h-3.5 shrink-0 opacity-60"}),h.jsx("span",{className:"truncate min-w-0",children:uy(e)})]}),n?h.jsx("div",{"data-testid":"tool-call-group-row-detail",className:"pl-5 py-1 min-w-0 space-y-1.5 text-[12px] text-text-300",children:o!==null?o:h.jsxs(h.Fragment,{children:[h.jsx("pre",{className:"min-w-0 max-w-full overflow-auto whitespace-pre-wrap font-mono",children:JSON.stringify(e.input,null,2)}),e.output!==void 0?h.jsx("pre",{className:"min-w-0 max-w-full overflow-auto whitespace-pre-wrap font-mono text-text-400",children:typeof e.output=="string"?e.output:JSON.stringify(e.output,null,2)}):null,e.error?h.jsx("pre",{className:"min-w-0 max-w-full overflow-auto whitespace-pre-wrap font-mono text-destructive",children:e.error}):null]})}):null]})}function z_({items:e,renderItemDetail:t}){const[n,r]=U.useState(!1);if(e.length===0)return null;const i=e.some(a=>a.pending),o=i?[...e].reverse().find(a=>a.pending):e[e.length-1],s=!i&&e.length>1?` 等 ${e.length} 项`:"",l=n?sn:ln;return h.jsxs("div",{"data-testid":"tool-call-group",className:"min-w-0 max-w-full",children:[h.jsxs("button",{type:"button",onClick:()=>r(a=>!a),"aria-expanded":n,"data-testid":"tool-call-group-header",className:"flex w-full items-center gap-1.5 text-left cursor-pointer min-w-0 py-0.5 text-[13px] text-text-400 hover:text-text-200",children:[i&&!n?h.jsx(sr,{className:"w-3.5 h-3.5 animate-spin shrink-0"}):h.jsx(l,{className:"w-3.5 h-3.5 shrink-0"}),n?h.jsx("span",{className:"min-w-0 truncate opacity-70",children:i?"正在执行":`${e.length} 项`}):h.jsxs("span",{className:ve("truncate min-w-0",i&&"text-text-300"),children:[uy(o),s]})]}),n?h.jsx("div",{className:"mt-0.5 flex flex-col pl-5",children:e.map(a=>h.jsx(R_,{item:a,renderItemDetail:t},a.toolUseId))}):null]})}function M_(e){const t=Math.round(e/1e3);if(t<60)return`${t}秒`;const n=Math.floor(t/60),r=t%60;return r>0?`${n}分${r}秒`:`${n}分钟`}function L_(e,t){const n=t!==void 0?`耗时 ${M_(t)}`:"";switch(e){case"interrupted":return n?`已中断 · ${n}`:"已中断";case"error":return n?`出错 · ${n}`:"出错";default:return n||"已完成"}}function O_({status:e="done",durationMs:t,defaultExpanded:n=!1,onExpandedChange:r,children:i}){const[o,s]=U.useState(n),l=o?sn:ln;return h.jsxs("div",{"data-testid":"turn-process-block",className:"min-w-0 max-w-full border-t border-border pt-2",children:[h.jsxs("button",{type:"button",onClick:()=>{const a=!o;s(a),r==null||r(a)},"aria-expanded":o,"data-testid":"turn-process-block-header",className:ve("flex w-full items-center gap-1 text-left cursor-pointer min-w-0 py-0.5 text-[13px]",e!=="done"?"text-destructive/80 hover:text-destructive":"text-text-400 hover:text-text-200"),children:[h.jsx("span",{className:"truncate min-w-0",children:L_(e,t)}),h.jsx(l,{className:"w-3.5 h-3.5 shrink-0"})]}),o?h.jsx("div",{"data-testid":"turn-process-body",className:"mt-2 flex flex-col gap-2 border-l-2 border-border pl-3",children:i}):null]})}const D_=/<(system-reminder|related-dir|clawd-shift-fire)\b[^>]*>[\s\S]*?<\/\1>/gi,F_=/<builder-preview\b[^>]*\/>/gi,$_=/<(clawd-dispatch-task|clawd-dispatch-result)\b[^>]*>([\s\S]*?)<\/\1>/gi,U_=/<\/?(brief|detail|files)>/gi;function cy(e){return e?e.replace($_,(t,n,r)=>y_(r.replace(U_,"")).trim()).replace(D_,"").replace(F_,"").trim():""}const B_=cy;function V_(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const H_=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,W_=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,q_={};function zp(e,t){return(q_.jsx?W_:H_).test(e)}const Z_=/[ \t\n\f\r]/g;function G_(e){return typeof e=="object"?e.type==="text"?Mp(e.value):!1:Mp(e)}function Mp(e){return e.replace(Z_,"")===""}class Uo{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Uo.prototype.normal={};Uo.prototype.property={};Uo.prototype.space=void 0;function dy(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new Uo(n,r,t)}function Yu(e){return e.toLowerCase()}class wt{constructor(t,n){this.attribute=n,this.property=t}}wt.prototype.attribute="";wt.prototype.booleanish=!1;wt.prototype.boolean=!1;wt.prototype.commaOrSpaceSeparated=!1;wt.prototype.commaSeparated=!1;wt.prototype.defined=!1;wt.prototype.mustUseProperty=!1;wt.prototype.number=!1;wt.prototype.overloadedBoolean=!1;wt.prototype.property="";wt.prototype.spaceSeparated=!1;wt.prototype.space=void 0;let K_=0;const ce=Mr(),Fe=Mr(),Xu=Mr(),B=Mr(),Ee=Mr(),li=Mr(),St=Mr();function Mr(){return 2**++K_}const Ju=Object.freeze(Object.defineProperty({__proto__:null,boolean:ce,booleanish:Fe,commaOrSpaceSeparated:St,commaSeparated:li,number:B,overloadedBoolean:Xu,spaceSeparated:Ee},Symbol.toStringTag,{value:"Module"})),Ta=Object.keys(Ju);class Id extends wt{constructor(t,n,r,i){let o=-1;if(super(t,n),Lp(this,"space",i),typeof r=="number")for(;++o<Ta.length;){const s=Ta[o];Lp(this,Ta[o],(r&Ju[s])===Ju[s])}}}Id.prototype.defined=!0;function Lp(e,t,n){n&&(e[t]=n)}function Ii(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const o=new Id(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),t[r]=o,n[Yu(r)]=r,n[Yu(o.attribute)]=r}return new Uo(t,n,e.space)}const fy=Ii({properties:{ariaActiveDescendant:null,ariaAtomic:Fe,ariaAutoComplete:null,ariaBusy:Fe,ariaChecked:Fe,ariaColCount:B,ariaColIndex:B,ariaColSpan:B,ariaControls:Ee,ariaCurrent:null,ariaDescribedBy:Ee,ariaDetails:null,ariaDisabled:Fe,ariaDropEffect:Ee,ariaErrorMessage:null,ariaExpanded:Fe,ariaFlowTo:Ee,ariaGrabbed:Fe,ariaHasPopup:null,ariaHidden:Fe,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Ee,ariaLevel:B,ariaLive:null,ariaModal:Fe,ariaMultiLine:Fe,ariaMultiSelectable:Fe,ariaOrientation:null,ariaOwns:Ee,ariaPlaceholder:null,ariaPosInSet:B,ariaPressed:Fe,ariaReadOnly:Fe,ariaRelevant:null,ariaRequired:Fe,ariaRoleDescription:Ee,ariaRowCount:B,ariaRowIndex:B,ariaRowSpan:B,ariaSelected:Fe,ariaSetSize:B,ariaSort:null,ariaValueMax:B,ariaValueMin:B,ariaValueNow:B,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function py(e,t){return t in e?e[t]:t}function my(e,t){return py(e,t.toLowerCase())}const Q_=Ii({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:li,acceptCharset:Ee,accessKey:Ee,action:null,allow:null,allowFullScreen:ce,allowPaymentRequest:ce,allowUserMedia:ce,alt:null,as:null,async:ce,autoCapitalize:null,autoComplete:Ee,autoFocus:ce,autoPlay:ce,blocking:Ee,capture:null,charSet:null,checked:ce,cite:null,className:Ee,cols:B,colSpan:null,content:null,contentEditable:Fe,controls:ce,controlsList:Ee,coords:B|li,crossOrigin:null,data:null,dateTime:null,decoding:null,default:ce,defer:ce,dir:null,dirName:null,disabled:ce,download:Xu,draggable:Fe,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:ce,formTarget:null,headers:Ee,height:B,hidden:Xu,high:B,href:null,hrefLang:null,htmlFor:Ee,httpEquiv:Ee,id:null,imageSizes:null,imageSrcSet:null,inert:ce,inputMode:null,integrity:null,is:null,isMap:ce,itemId:null,itemProp:Ee,itemRef:Ee,itemScope:ce,itemType:Ee,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:ce,low:B,manifest:null,max:null,maxLength:B,media:null,method:null,min:null,minLength:B,multiple:ce,muted:ce,name:null,nonce:null,noModule:ce,noValidate:ce,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:ce,optimum:B,pattern:null,ping:Ee,placeholder:null,playsInline:ce,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:ce,referrerPolicy:null,rel:Ee,required:ce,reversed:ce,rows:B,rowSpan:B,sandbox:Ee,scope:null,scoped:ce,seamless:ce,selected:ce,shadowRootClonable:ce,shadowRootDelegatesFocus:ce,shadowRootMode:null,shape:null,size:B,sizes:null,slot:null,span:B,spellCheck:Fe,src:null,srcDoc:null,srcLang:null,srcSet:null,start:B,step:null,style:null,tabIndex:B,target:null,title:null,translate:null,type:null,typeMustMatch:ce,useMap:null,value:Fe,width:B,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Ee,axis:null,background:null,bgColor:null,border:B,borderColor:null,bottomMargin:B,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:ce,declare:ce,event:null,face:null,frame:null,frameBorder:null,hSpace:B,leftMargin:B,link:null,longDesc:null,lowSrc:null,marginHeight:B,marginWidth:B,noResize:ce,noHref:ce,noShade:ce,noWrap:ce,object:null,profile:null,prompt:null,rev:null,rightMargin:B,rules:null,scheme:null,scrolling:Fe,standby:null,summary:null,text:null,topMargin:B,valueType:null,version:null,vAlign:null,vLink:null,vSpace:B,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:ce,disableRemotePlayback:ce,prefix:null,property:null,results:B,security:null,unselectable:null},space:"html",transform:my}),Y_=Ii({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:St,accentHeight:B,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:B,amplitude:B,arabicForm:null,ascent:B,attributeName:null,attributeType:null,azimuth:B,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:B,by:null,calcMode:null,capHeight:B,className:Ee,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:B,diffuseConstant:B,direction:null,display:null,dur:null,divisor:B,dominantBaseline:null,download:ce,dx:null,dy:null,edgeMode:null,editable:null,elevation:B,enableBackground:null,end:null,event:null,exponent:B,externalResourcesRequired:null,fill:null,fillOpacity:B,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:li,g2:li,glyphName:li,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:B,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:B,horizOriginX:B,horizOriginY:B,id:null,ideographic:B,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:B,k:B,k1:B,k2:B,k3:B,k4:B,kernelMatrix:St,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:B,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:B,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:B,overlineThickness:B,paintOrder:null,panose1:null,path:null,pathLength:B,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Ee,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:B,pointsAtY:B,pointsAtZ:B,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:St,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:St,rev:St,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:St,requiredFeatures:St,requiredFonts:St,requiredFormats:St,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:B,specularExponent:B,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:B,strikethroughThickness:B,string:null,stroke:null,strokeDashArray:St,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:B,strokeOpacity:B,strokeWidth:null,style:null,surfaceScale:B,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:St,tabIndex:B,tableValues:null,target:null,targetX:B,targetY:B,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:St,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:B,underlineThickness:B,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:B,values:null,vAlphabetic:B,vMathematical:B,vectorEffect:null,vHanging:B,vIdeographic:B,version:null,vertAdvY:B,vertOriginX:B,vertOriginY:B,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:B,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:py}),hy=Ii({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),gy=Ii({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:my}),yy=Ii({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),X_={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},J_=/[A-Z]/g,Op=/-[a-z]/g,eC=/^data[-\w.:]+$/i;function tC(e,t){const n=Yu(t);let r=t,i=wt;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&eC.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(Op,rC);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!Op.test(o)){let s=o.replace(J_,nC);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}i=Id}return new i(r,t)}function nC(e){return"-"+e.toLowerCase()}function rC(e){return e.charAt(1).toUpperCase()}const iC=dy([fy,Q_,hy,gy,yy],"html"),Ed=dy([fy,Y_,hy,gy,yy],"svg");function oC(e){return e.join(" ").trim()}var Nd={},Dp=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,sC=/\n/g,lC=/^\s*/,aC=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,uC=/^:\s*/,cC=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,dC=/^[;\s]*/,fC=/^\s+|\s+$/g,pC=`
278
278
  `,Fp="/",$p="*",hr="",mC="comment",hC="declaration";function gC(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function i(x){var b=x.match(sC);b&&(n+=b.length);var I=x.lastIndexOf(pC);r=~I?x.length-I:r+x.length}function o(){var x={line:n,column:r};return function(b){return b.position=new s(x),u(),b}}function s(x){this.start=x,this.end={line:n,column:r},this.source=t.source}s.prototype.content=e;function l(x){var b=new Error(t.source+":"+n+":"+r+": "+x);if(b.reason=x,b.filename=t.source,b.line=n,b.column=r,b.source=e,!t.silent)throw b}function a(x){var b=x.exec(e);if(b){var I=b[0];return i(I),e=e.slice(I.length),b}}function u(){a(lC)}function f(x){var b;for(x=x||[];b=d();)b!==!1&&x.push(b);return x}function d(){var x=o();if(!(Fp!=e.charAt(0)||$p!=e.charAt(1))){for(var b=2;hr!=e.charAt(b)&&($p!=e.charAt(b)||Fp!=e.charAt(b+1));)++b;if(b+=2,hr===e.charAt(b-1))return l("End of comment missing");var I=e.slice(2,b-2);return r+=2,i(I),e=e.slice(b),r+=2,x({type:mC,comment:I})}}function m(){var x=o(),b=a(aC);if(b){if(d(),!a(uC))return l("property missing ':'");var I=a(cC),y=x({type:hC,property:Up(b[0].replace(Dp,hr)),value:I?Up(I[0].replace(Dp,hr)):hr});return a(dC),y}}function p(){var x=[];f(x);for(var b;b=m();)b!==!1&&(x.push(b),f(x));return x}return u(),p()}function Up(e){return e?e.replace(fC,hr):hr}var yC=gC,xC=zs&&zs.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Nd,"__esModule",{value:!0});Nd.default=kC;const vC=xC(yC);function kC(e,t){let n=null;if(!e||typeof e!="string")return n;const r=(0,vC.default)(e),i=typeof t=="function";return r.forEach(o=>{if(o.type!=="declaration")return;const{property:s,value:l}=o;i?t(s,l,o):l&&(n=n||{},n[s]=l)}),n}var ql={};Object.defineProperty(ql,"__esModule",{value:!0});ql.camelCase=void 0;var wC=/^--[a-zA-Z0-9_-]+$/,bC=/-([a-z])/g,SC=/^[^-]+$/,_C=/^-(webkit|moz|ms|o|khtml)-/,CC=/^-(ms)-/,IC=function(e){return!e||SC.test(e)||wC.test(e)},EC=function(e,t){return t.toUpperCase()},Bp=function(e,t){return"".concat(t,"-")},NC=function(e,t){return t===void 0&&(t={}),IC(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(CC,Bp):e=e.replace(_C,Bp),e.replace(bC,EC))};ql.camelCase=NC;var TC=zs&&zs.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},jC=TC(Nd),AC=ql;function ec(e,t){var n={};return!e||typeof e!="string"||(0,jC.default)(e,function(r,i){r&&i&&(n[(0,AC.camelCase)(r,t)]=i)}),n}ec.default=ec;var PC=ec;const RC=fc(PC),xy=vy("end"),Td=vy("start");function vy(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function zC(e){const t=Td(e),n=xy(e);if(t&&n)return{start:t,end:n}}function ro(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Vp(e.position):"start"in e||"end"in e?Vp(e):"line"in e||"column"in e?tc(e):""}function tc(e){return Hp(e&&e.line)+":"+Hp(e&&e.column)}function Vp(e){return tc(e&&e.start)+"-"+tc(e&&e.end)}function Hp(e){return e&&typeof e=="number"?e:1}class it extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",o={},s=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?i=t:!o.cause&&t&&(s=!0,i=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof r=="string"){const a=r.indexOf(":");a===-1?o.ruleId=r:(o.source=r.slice(0,a),o.ruleId=r.slice(a+1))}if(!o.place&&o.ancestors&&o.ancestors){const a=o.ancestors[o.ancestors.length-1];a&&(o.place=a.position)}const l=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=l?l.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=l?l.line:void 0,this.name=ro(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=s&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}it.prototype.file="";it.prototype.name="";it.prototype.reason="";it.prototype.message="";it.prototype.stack="";it.prototype.column=void 0;it.prototype.line=void 0;it.prototype.ancestors=void 0;it.prototype.cause=void 0;it.prototype.fatal=void 0;it.prototype.place=void 0;it.prototype.ruleId=void 0;it.prototype.source=void 0;const jd={}.hasOwnProperty,MC=new Map,LC=/[A-Z]/g,OC=new Set(["table","tbody","thead","tfoot","tr"]),DC=new Set(["td","th"]),ky="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function FC(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=ZC(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=qC(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Ed:iC,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=wy(i,e,void 0);return o&&typeof o!="string"?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function wy(e,t,n){if(t.type==="element")return $C(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return UC(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return VC(e,t,n);if(t.type==="mdxjsEsm")return BC(e,t);if(t.type==="root")return HC(e,t,n);if(t.type==="text")return WC(e,t)}function $C(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=Ed,e.schema=i),e.ancestors.push(t);const o=Sy(e,t.tagName,!1),s=GC(e,t);let l=Pd(e,t);return OC.has(t.tagName)&&(l=l.filter(function(a){return typeof a=="string"?!G_(a):!0})),by(e,s,o,t),Ad(s,l),e.ancestors.pop(),e.schema=r,e.create(t,o,s,n)}function UC(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}Io(e,t.position)}function BC(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Io(e,t.position)}function VC(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=Ed,e.schema=i),e.ancestors.push(t);const o=t.name===null?e.Fragment:Sy(e,t.name,!0),s=KC(e,t),l=Pd(e,t);return by(e,s,o,t),Ad(s,l),e.ancestors.pop(),e.schema=r,e.create(t,o,s,n)}function HC(e,t,n){const r={};return Ad(r,Pd(e,t)),e.create(t,e.Fragment,r,n)}function WC(e,t){return t.value}function by(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Ad(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function qC(e,t,n){return r;function r(i,o,s,l){const u=Array.isArray(s.children)?n:t;return l?u(o,s,l):u(o,s)}}function ZC(e,t){return n;function n(r,i,o,s){const l=Array.isArray(o.children),a=Td(r);return t(i,o,s,l,{columnNumber:a?a.column-1:void 0,fileName:e,lineNumber:a?a.line:void 0},void 0)}}function GC(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&jd.call(t.properties,i)){const o=QC(e,i,t.properties[i]);if(o){const[s,l]=o;e.tableCellAlignToStyle&&s==="align"&&typeof l=="string"&&DC.has(t.tagName)?r=l:n[s]=l}}if(r){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function KC(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const o=r.data.estree.body[0];o.type;const s=o.expression;s.type;const l=s.properties[0];l.type,Object.assign(n,e.evaluater.evaluateExpression(l.argument))}else Io(e,t.position);else{const i=r.name;let o;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const l=r.value.data.estree.body[0];l.type,o=e.evaluater.evaluateExpression(l.expression)}else Io(e,t.position);else o=r.value===null?!0:r.value;n[i]=o}return n}function Pd(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:MC;for(;++r<t.children.length;){const o=t.children[r];let s;if(e.passKeys){const a=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(a){const u=i.get(a)||0;s=a+"-"+u,i.set(a,u+1)}}const l=wy(e,o,s);l!==void 0&&n.push(l)}return n}function QC(e,t,n){const r=tC(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?V_(n):oC(n)),r.property==="style"){let i=typeof n=="object"?n:YC(e,String(n));return e.stylePropertyNameCase==="css"&&(i=XC(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?X_[r.property]||r.property:r.attribute,n]}}function YC(e,t){try{return RC(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new it("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=ky+"#cannot-parse-style-attribute",i}}function Sy(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let o=-1,s;for(;++o<i.length;){const l=zp(i[o])?{type:"Identifier",name:i[o]}:{type:"Literal",value:i[o]};s=s?{type:"MemberExpression",object:s,property:l,computed:!!(o&&l.type==="Literal"),optional:!1}:l}r=s}else r=zp(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return jd.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);Io(e)}function Io(e,t){const n=new it("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=ky+"#cannot-handle-mdx-estrees-without-createevaluater",n}function XC(e){const t={};let n;for(n in e)jd.call(e,n)&&(t[JC(n)]=e[n]);return t}function JC(e){let t=e.replace(LC,eI);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function eI(e){return"-"+e.toLowerCase()}const ja={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},tI={};function Rd(e,t){const n=tI,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return _y(e,r,i)}function _y(e,t,n){if(nI(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return Wp(e.children,t,n)}return Array.isArray(e)?Wp(e,t,n):""}function Wp(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=_y(e[i],t,n);return r.join("")}function nI(e){return!!(e&&typeof e=="object")}const qp=document.createElement("i");function zd(e){const t="&"+e+";";qp.innerHTML=t;const n=qp.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Ye(e,t,n,r){const i=e.length;let o=0,s;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)s=Array.from(r),s.unshift(t,n),e.splice(...s);else for(n&&e.splice(t,n);o<r.length;)s=r.slice(o,o+1e4),s.unshift(t,0),e.splice(...s),o+=1e4,t+=1e4}function Ke(e,t){return e.length>0?(Ye(e,e.length,0,t),e):t}const Zp={}.hasOwnProperty;function Cy(e){const t={};let n=-1;for(;++n<e.length;)rI(t,e[n]);return t}function rI(e,t){let n;for(n in t){const i=(Zp.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let s;if(o)for(s in o){Zp.call(i,s)||(i[s]=[]);const l=o[s];iI(i[s],Array.isArray(l)?l:l?[l]:[])}}}function iI(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);Ye(e,0,0,r)}function Iy(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function Zt(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const lt=ar(/[A-Za-z]/),nt=ar(/[\dA-Za-z]/),oI=ar(/[#-'*+\--9=?A-Z^-~]/);function wl(e){return e!==null&&(e<32||e===127)}const nc=ar(/\d/),sI=ar(/[\dA-Fa-f]/),lI=ar(/[!-/:-@[-`{-~]/);function ne(e){return e!==null&&e<-2}function _e(e){return e!==null&&(e<0||e===32)}function me(e){return e===-2||e===-1||e===32}const Zl=ar(new RegExp("\\p{P}|\\p{S}","u")),jr=ar(/\s/);function ar(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Ei(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const o=e.charCodeAt(n);let s="";if(o===37&&nt(e.charCodeAt(n+1))&&nt(e.charCodeAt(n+2)))i=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(s=String.fromCharCode(o));else if(o>55295&&o<57344){const l=e.charCodeAt(n+1);o<56320&&l>56319&&l<57344?(s=String.fromCharCode(o,l),i=1):s="�"}else s=String.fromCharCode(o);s&&(t.push(e.slice(r,n),encodeURIComponent(s)),r=n+i+1,s=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function ke(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return s;function s(a){return me(a)?(e.enter(n),l(a)):t(a)}function l(a){return me(a)&&o++<i?(e.consume(a),l):(e.exit(n),t(a))}}const aI={tokenize:uI};function uI(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(l){if(l===null){e.consume(l);return}return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),ke(e,t,"linePrefix")}function i(l){return e.enter("paragraph"),o(l)}function o(l){const a=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=a),n=a,s(l)}function s(l){if(l===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(l);return}return ne(l)?(e.consume(l),e.exit("chunkText"),o):(e.consume(l),s)}}const cI={tokenize:dI},Gp={tokenize:fI};function dI(e){const t=this,n=[];let r=0,i,o,s;return l;function l(w){if(r<n.length){const E=n[r];return t.containerState=E[1],e.attempt(E[0].continuation,a,u)(w)}return u(w)}function a(w){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();const E=t.events.length;let j=E,S;for(;j--;)if(t.events[j][0]==="exit"&&t.events[j][1].type==="chunkFlow"){S=t.events[j][1].end;break}y(r);let A=E;for(;A<t.events.length;)t.events[A][1].end={...S},A++;return Ye(t.events,j+1,0,t.events.slice(E)),t.events.length=A,u(w)}return l(w)}function u(w){if(r===n.length){if(!i)return m(w);if(i.currentConstruct&&i.currentConstruct.concrete)return x(w);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Gp,f,d)(w)}function f(w){return i&&v(),y(r),m(w)}function d(w){return t.parser.lazy[t.now().line]=r!==n.length,s=t.now().offset,x(w)}function m(w){return t.containerState={},e.attempt(Gp,p,x)(w)}function p(w){return r++,n.push([t.currentConstruct,t.containerState]),m(w)}function x(w){if(w===null){i&&v(),y(0),e.consume(w);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:o}),b(w)}function b(w){if(w===null){I(e.exit("chunkFlow"),!0),y(0),e.consume(w);return}return ne(w)?(e.consume(w),I(e.exit("chunkFlow")),r=0,t.interrupt=void 0,l):(e.consume(w),b)}function I(w,E){const j=t.sliceStream(w);if(E&&j.push(null),w.previous=o,o&&(o.next=w),o=w,i.defineSkip(w.start),i.write(j),t.parser.lazy[w.start.line]){let S=i.events.length;for(;S--;)if(i.events[S][1].start.offset<s&&(!i.events[S][1].end||i.events[S][1].end.offset>s))return;const A=t.events.length;let T=A,$,C;for(;T--;)if(t.events[T][0]==="exit"&&t.events[T][1].type==="chunkFlow"){if($){C=t.events[T][1].end;break}$=!0}for(y(r),S=A;S<t.events.length;)t.events[S][1].end={...C},S++;Ye(t.events,T+1,0,t.events.slice(A)),t.events.length=S}}function y(w){let E=n.length;for(;E-- >w;){const j=n[E];t.containerState=j[1],j[0].exit.call(t,e)}n.length=w}function v(){i.write([null]),o=void 0,i=void 0,t.containerState._closeFlow=void 0}}function fI(e,t,n){return ke(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function vi(e){if(e===null||_e(e)||jr(e))return 1;if(Zl(e))return 2}function Ni(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const o=e[i].resolveAll;o&&!r.includes(o)&&(t=o(t,n),r.push(o))}return t}const rc={name:"attention",resolveAll:pI,tokenize:mI};function pI(e,t){let n=-1,r,i,o,s,l,a,u,f;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;a=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const d={...e[r][1].end},m={...e[n][1].start};Kp(d,-a),Kp(m,a),s={type:a>1?"strongSequence":"emphasisSequence",start:d,end:{...e[r][1].end}},l={type:a>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:m},o={type:a>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:a>1?"strong":"emphasis",start:{...s.start},end:{...l.end}},e[r][1].end={...s.start},e[n][1].start={...l.end},u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=Ke(u,[["enter",e[r][1],t],["exit",e[r][1],t]])),u=Ke(u,[["enter",i,t],["enter",s,t],["exit",s,t],["enter",o,t]]),u=Ke(u,Ni(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),u=Ke(u,[["exit",o,t],["enter",l,t],["exit",l,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(f=2,u=Ke(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):f=0,Ye(e,r-1,n-r+3,u),n=r+u.length-f-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function mI(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=vi(r);let o;return s;function s(a){return o=a,e.enter("attentionSequence"),l(a)}function l(a){if(a===o)return e.consume(a),l;const u=e.exit("attentionSequence"),f=vi(a),d=!f||f===2&&i||n.includes(a),m=!i||i===2&&f||n.includes(r);return u._open=!!(o===42?d:d&&(i||!m)),u._close=!!(o===42?m:m&&(f||!d)),t(a)}}function Kp(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const hI={name:"autolink",tokenize:gI};function gI(e,t,n){let r=0;return i;function i(p){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(p){return lt(p)?(e.consume(p),s):p===64?n(p):u(p)}function s(p){return p===43||p===45||p===46||nt(p)?(r=1,l(p)):u(p)}function l(p){return p===58?(e.consume(p),r=0,a):(p===43||p===45||p===46||nt(p))&&r++<32?(e.consume(p),l):(r=0,u(p))}function a(p){return p===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):p===null||p===32||p===60||wl(p)?n(p):(e.consume(p),a)}function u(p){return p===64?(e.consume(p),f):oI(p)?(e.consume(p),u):n(p)}function f(p){return nt(p)?d(p):n(p)}function d(p){return p===46?(e.consume(p),r=0,f):p===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):m(p)}function m(p){if((p===45||nt(p))&&r++<63){const x=p===45?m:d;return e.consume(p),x}return n(p)}}const Bo={partial:!0,tokenize:yI};function yI(e,t,n){return r;function r(o){return me(o)?ke(e,i,"linePrefix")(o):i(o)}function i(o){return o===null||ne(o)?t(o):n(o)}}const Ey={continuation:{tokenize:vI},exit:kI,name:"blockQuote",tokenize:xI};function xI(e,t,n){const r=this;return i;function i(s){if(s===62){const l=r.containerState;return l.open||(e.enter("blockQuote",{_container:!0}),l.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(s),e.exit("blockQuoteMarker"),o}return n(s)}function o(s){return me(s)?(e.enter("blockQuotePrefixWhitespace"),e.consume(s),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(s))}}function vI(e,t,n){const r=this;return i;function i(s){return me(s)?ke(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s):o(s)}function o(s){return e.attempt(Ey,t,n)(s)}}function kI(e){e.exit("blockQuote")}const Ny={name:"characterEscape",tokenize:wI};function wI(e,t,n){return r;function r(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),i}function i(o){return lI(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}const Ty={name:"characterReference",tokenize:bI};function bI(e,t,n){const r=this;let i=0,o,s;return l;function l(d){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),a}function a(d){return d===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(d),e.exit("characterReferenceMarkerNumeric"),u):(e.enter("characterReferenceValue"),o=31,s=nt,f(d))}function u(d){return d===88||d===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(d),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,s=sI,f):(e.enter("characterReferenceValue"),o=7,s=nc,f(d))}function f(d){if(d===59&&i){const m=e.exit("characterReferenceValue");return s===nt&&!zd(r.sliceSerialize(m))?n(d):(e.enter("characterReferenceMarker"),e.consume(d),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return s(d)&&i++<o?(e.consume(d),f):n(d)}}const Qp={partial:!0,tokenize:_I},Yp={concrete:!0,name:"codeFenced",tokenize:SI};function SI(e,t,n){const r=this,i={partial:!0,tokenize:j};let o=0,s=0,l;return a;function a(S){return u(S)}function u(S){const A=r.events[r.events.length-1];return o=A&&A[1].type==="linePrefix"?A[2].sliceSerialize(A[1],!0).length:0,l=S,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),f(S)}function f(S){return S===l?(s++,e.consume(S),f):s<3?n(S):(e.exit("codeFencedFenceSequence"),me(S)?ke(e,d,"whitespace")(S):d(S))}function d(S){return S===null||ne(S)?(e.exit("codeFencedFence"),r.interrupt?t(S):e.check(Qp,b,E)(S)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),m(S))}function m(S){return S===null||ne(S)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),d(S)):me(S)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),ke(e,p,"whitespace")(S)):S===96&&S===l?n(S):(e.consume(S),m)}function p(S){return S===null||ne(S)?d(S):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),x(S))}function x(S){return S===null||ne(S)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),d(S)):S===96&&S===l?n(S):(e.consume(S),x)}function b(S){return e.attempt(i,E,I)(S)}function I(S){return e.enter("lineEnding"),e.consume(S),e.exit("lineEnding"),y}function y(S){return o>0&&me(S)?ke(e,v,"linePrefix",o+1)(S):v(S)}function v(S){return S===null||ne(S)?e.check(Qp,b,E)(S):(e.enter("codeFlowValue"),w(S))}function w(S){return S===null||ne(S)?(e.exit("codeFlowValue"),v(S)):(e.consume(S),w)}function E(S){return e.exit("codeFenced"),t(S)}function j(S,A,T){let $=0;return C;function C(te){return S.enter("lineEnding"),S.consume(te),S.exit("lineEnding"),O}function O(te){return S.enter("codeFencedFence"),me(te)?ke(S,z,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(te):z(te)}function z(te){return te===l?(S.enter("codeFencedFenceSequence"),oe(te)):T(te)}function oe(te){return te===l?($++,S.consume(te),oe):$>=s?(S.exit("codeFencedFenceSequence"),me(te)?ke(S,Z,"whitespace")(te):Z(te)):T(te)}function Z(te){return te===null||ne(te)?(S.exit("codeFencedFence"),A(te)):T(te)}}}function _I(e,t,n){const r=this;return i;function i(s){return s===null?n(s):(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o)}function o(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}const Aa={name:"codeIndented",tokenize:II},CI={partial:!0,tokenize:EI};function II(e,t,n){const r=this;return i;function i(u){return e.enter("codeIndented"),ke(e,o,"linePrefix",5)(u)}function o(u){const f=r.events[r.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?s(u):n(u)}function s(u){return u===null?a(u):ne(u)?e.attempt(CI,s,a)(u):(e.enter("codeFlowValue"),l(u))}function l(u){return u===null||ne(u)?(e.exit("codeFlowValue"),s(u)):(e.consume(u),l)}function a(u){return e.exit("codeIndented"),t(u)}}function EI(e,t,n){const r=this;return i;function i(s){return r.parser.lazy[r.now().line]?n(s):ne(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i):ke(e,o,"linePrefix",5)(s)}function o(s){const l=r.events[r.events.length-1];return l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(s):ne(s)?i(s):n(s)}}const NI={name:"codeText",previous:jI,resolve:TI,tokenize:AI};function TI(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function jI(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function AI(e,t,n){let r=0,i,o;return s;function s(d){return e.enter("codeText"),e.enter("codeTextSequence"),l(d)}function l(d){return d===96?(e.consume(d),r++,l):(e.exit("codeTextSequence"),a(d))}function a(d){return d===null?n(d):d===32?(e.enter("space"),e.consume(d),e.exit("space"),a):d===96?(o=e.enter("codeTextSequence"),i=0,f(d)):ne(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),a):(e.enter("codeTextData"),u(d))}function u(d){return d===null||d===32||d===96||ne(d)?(e.exit("codeTextData"),a(d)):(e.consume(d),u)}function f(d){return d===96?(e.consume(d),i++,f):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(d)):(o.type="codeTextData",u(d))}}class PI{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const o=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&Ui(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Ui(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Ui(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);Ui(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Ui(this.left,n.reverse())}}}function Ui(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function jy(e){const t={};let n=-1,r,i,o,s,l,a,u;const f=new PI(e);for(;++n<f.length;){for(;n in t;)n=t[n];if(r=f.get(n),n&&r[1].type==="chunkFlow"&&f.get(n-1)[1].type==="listItemPrefix"&&(a=r[1]._tokenizer.events,o=0,o<a.length&&a[o][1].type==="lineEndingBlank"&&(o+=2),o<a.length&&a[o][1].type==="content"))for(;++o<a.length&&a[o][1].type!=="content";)a[o][1].type==="chunkText"&&(a[o][1]._isInFirstContentOfListItem=!0,o++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,RI(f,n)),n=t[n],u=!0);else if(r[1]._container){for(o=n,i=void 0;o--;)if(s=f.get(o),s[1].type==="lineEnding"||s[1].type==="lineEndingBlank")s[0]==="enter"&&(i&&(f.get(i)[1].type="lineEndingBlank"),s[1].type="lineEnding",i=o);else if(!(s[1].type==="linePrefix"||s[1].type==="listItemIndent"))break;i&&(r[1].end={...f.get(i)[1].start},l=f.slice(i,n),l.unshift(r),f.splice(i,n-i+1,l))}}return Ye(e,0,Number.POSITIVE_INFINITY,f.slice(0)),!u}function RI(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const o=[];let s=n._tokenizer;s||(s=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(s._contentTypeTextTrailing=!0));const l=s.events,a=[],u={};let f,d,m=-1,p=n,x=0,b=0;const I=[b];for(;p;){for(;e.get(++i)[1]!==p;);o.push(i),p._tokenizer||(f=r.sliceStream(p),p.next||f.push(null),d&&s.defineSkip(p.start),p._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(f),p._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++m<l.length;)l[m][0]==="exit"&&l[m-1][0]==="enter"&&l[m][1].type===l[m-1][1].type&&l[m][1].start.line!==l[m][1].end.line&&(b=m+1,I.push(b),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(s.events=[],p?(p._tokenizer=void 0,p.previous=void 0):I.pop(),m=I.length;m--;){const y=l.slice(I[m],I[m+1]),v=o.pop();a.push([v,v+y.length-1]),e.splice(v,2,y)}for(a.reverse(),m=-1;++m<a.length;)u[x+a[m][0]]=x+a[m][1],x+=a[m][1]-a[m][0]-1;return u}const zI={resolve:LI,tokenize:OI},MI={partial:!0,tokenize:DI};function LI(e){return jy(e),e}function OI(e,t){let n;return r;function r(l){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(l)}function i(l){return l===null?o(l):ne(l)?e.check(MI,s,o)(l):(e.consume(l),i)}function o(l){return e.exit("chunkContent"),e.exit("content"),t(l)}function s(l){return e.consume(l),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function DI(e,t,n){const r=this;return i;function i(s){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),ke(e,o,"linePrefix")}function o(s){if(s===null||ne(s))return n(s);const l=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(s):e.interrupt(r.parser.constructs.flow,n,t)(s)}}function Ay(e,t,n,r,i,o,s,l,a){const u=a||Number.POSITIVE_INFINITY;let f=0;return d;function d(y){return y===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(y),e.exit(o),m):y===null||y===32||y===41||wl(y)?n(y):(e.enter(r),e.enter(s),e.enter(l),e.enter("chunkString",{contentType:"string"}),b(y))}function m(y){return y===62?(e.enter(o),e.consume(y),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(l),e.enter("chunkString",{contentType:"string"}),p(y))}function p(y){return y===62?(e.exit("chunkString"),e.exit(l),m(y)):y===null||y===60||ne(y)?n(y):(e.consume(y),y===92?x:p)}function x(y){return y===60||y===62||y===92?(e.consume(y),p):p(y)}function b(y){return!f&&(y===null||y===41||_e(y))?(e.exit("chunkString"),e.exit(l),e.exit(s),e.exit(r),t(y)):f<u&&y===40?(e.consume(y),f++,b):y===41?(e.consume(y),f--,b):y===null||y===32||y===40||wl(y)?n(y):(e.consume(y),y===92?I:b)}function I(y){return y===40||y===41||y===92?(e.consume(y),b):b(y)}}function Py(e,t,n,r,i,o){const s=this;let l=0,a;return u;function u(p){return e.enter(r),e.enter(i),e.consume(p),e.exit(i),e.enter(o),f}function f(p){return l>999||p===null||p===91||p===93&&!a||p===94&&!l&&"_hiddenFootnoteSupport"in s.parser.constructs?n(p):p===93?(e.exit(o),e.enter(i),e.consume(p),e.exit(i),e.exit(r),t):ne(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),f):(e.enter("chunkString",{contentType:"string"}),d(p))}function d(p){return p===null||p===91||p===93||ne(p)||l++>999?(e.exit("chunkString"),f(p)):(e.consume(p),a||(a=!me(p)),p===92?m:d)}function m(p){return p===91||p===92||p===93?(e.consume(p),l++,d):d(p)}}function Ry(e,t,n,r,i,o){let s;return l;function l(m){return m===34||m===39||m===40?(e.enter(r),e.enter(i),e.consume(m),e.exit(i),s=m===40?41:m,a):n(m)}function a(m){return m===s?(e.enter(i),e.consume(m),e.exit(i),e.exit(r),t):(e.enter(o),u(m))}function u(m){return m===s?(e.exit(o),a(s)):m===null?n(m):ne(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),ke(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),f(m))}function f(m){return m===s||m===null||ne(m)?(e.exit("chunkString"),u(m)):(e.consume(m),m===92?d:f)}function d(m){return m===s||m===92?(e.consume(m),f):f(m)}}function io(e,t){let n;return r;function r(i){return ne(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):me(i)?ke(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const FI={name:"definition",tokenize:UI},$I={partial:!0,tokenize:BI};function UI(e,t,n){const r=this;let i;return o;function o(p){return e.enter("definition"),s(p)}function s(p){return Py.call(r,e,l,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function l(p){return i=Zt(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),a):n(p)}function a(p){return _e(p)?io(e,u)(p):u(p)}function u(p){return Ay(e,f,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function f(p){return e.attempt($I,d,d)(p)}function d(p){return me(p)?ke(e,m,"whitespace")(p):m(p)}function m(p){return p===null||ne(p)?(e.exit("definition"),r.parser.defined.push(i),t(p)):n(p)}}function BI(e,t,n){return r;function r(l){return _e(l)?io(e,i)(l):n(l)}function i(l){return Ry(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function o(l){return me(l)?ke(e,s,"whitespace")(l):s(l)}function s(l){return l===null||ne(l)?t(l):n(l)}}const VI={name:"hardBreakEscape",tokenize:HI};function HI(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),i}function i(o){return ne(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const WI={name:"headingAtx",resolve:qI,tokenize:ZI};function qI(e,t){let n=e.length-2,r=3,i,o;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},o={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},Ye(e,r,n-r+1,[["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t]])),e}function ZI(e,t,n){let r=0;return i;function i(f){return e.enter("atxHeading"),o(f)}function o(f){return e.enter("atxHeadingSequence"),s(f)}function s(f){return f===35&&r++<6?(e.consume(f),s):f===null||_e(f)?(e.exit("atxHeadingSequence"),l(f)):n(f)}function l(f){return f===35?(e.enter("atxHeadingSequence"),a(f)):f===null||ne(f)?(e.exit("atxHeading"),t(f)):me(f)?ke(e,l,"whitespace")(f):(e.enter("atxHeadingText"),u(f))}function a(f){return f===35?(e.consume(f),a):(e.exit("atxHeadingSequence"),l(f))}function u(f){return f===null||f===35||_e(f)?(e.exit("atxHeadingText"),l(f)):(e.consume(f),u)}}const GI=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Xp=["pre","script","style","textarea"],KI={concrete:!0,name:"htmlFlow",resolveTo:XI,tokenize:JI},QI={partial:!0,tokenize:t4},YI={partial:!0,tokenize:e4};function XI(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function JI(e,t,n){const r=this;let i,o,s,l,a;return u;function u(_){return f(_)}function f(_){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(_),d}function d(_){return _===33?(e.consume(_),m):_===47?(e.consume(_),o=!0,b):_===63?(e.consume(_),i=3,r.interrupt?t:k):lt(_)?(e.consume(_),s=String.fromCharCode(_),I):n(_)}function m(_){return _===45?(e.consume(_),i=2,p):_===91?(e.consume(_),i=5,l=0,x):lt(_)?(e.consume(_),i=4,r.interrupt?t:k):n(_)}function p(_){return _===45?(e.consume(_),r.interrupt?t:k):n(_)}function x(_){const Re="CDATA[";return _===Re.charCodeAt(l++)?(e.consume(_),l===Re.length?r.interrupt?t:z:x):n(_)}function b(_){return lt(_)?(e.consume(_),s=String.fromCharCode(_),I):n(_)}function I(_){if(_===null||_===47||_===62||_e(_)){const Re=_===47,Ce=s.toLowerCase();return!Re&&!o&&Xp.includes(Ce)?(i=1,r.interrupt?t(_):z(_)):GI.includes(s.toLowerCase())?(i=6,Re?(e.consume(_),y):r.interrupt?t(_):z(_)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(_):o?v(_):w(_))}return _===45||nt(_)?(e.consume(_),s+=String.fromCharCode(_),I):n(_)}function y(_){return _===62?(e.consume(_),r.interrupt?t:z):n(_)}function v(_){return me(_)?(e.consume(_),v):C(_)}function w(_){return _===47?(e.consume(_),C):_===58||_===95||lt(_)?(e.consume(_),E):me(_)?(e.consume(_),w):C(_)}function E(_){return _===45||_===46||_===58||_===95||nt(_)?(e.consume(_),E):j(_)}function j(_){return _===61?(e.consume(_),S):me(_)?(e.consume(_),j):w(_)}function S(_){return _===null||_===60||_===61||_===62||_===96?n(_):_===34||_===39?(e.consume(_),a=_,A):me(_)?(e.consume(_),S):T(_)}function A(_){return _===a?(e.consume(_),a=null,$):_===null||ne(_)?n(_):(e.consume(_),A)}function T(_){return _===null||_===34||_===39||_===47||_===60||_===61||_===62||_===96||_e(_)?j(_):(e.consume(_),T)}function $(_){return _===47||_===62||me(_)?w(_):n(_)}function C(_){return _===62?(e.consume(_),O):n(_)}function O(_){return _===null||ne(_)?z(_):me(_)?(e.consume(_),O):n(_)}function z(_){return _===45&&i===2?(e.consume(_),Q):_===60&&i===1?(e.consume(_),se):_===62&&i===4?(e.consume(_),ae):_===63&&i===3?(e.consume(_),k):_===93&&i===5?(e.consume(_),q):ne(_)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(QI,ye,oe)(_)):_===null||ne(_)?(e.exit("htmlFlowData"),oe(_)):(e.consume(_),z)}function oe(_){return e.check(YI,Z,ye)(_)}function Z(_){return e.enter("lineEnding"),e.consume(_),e.exit("lineEnding"),te}function te(_){return _===null||ne(_)?oe(_):(e.enter("htmlFlowData"),z(_))}function Q(_){return _===45?(e.consume(_),k):z(_)}function se(_){return _===47?(e.consume(_),s="",D):z(_)}function D(_){if(_===62){const Re=s.toLowerCase();return Xp.includes(Re)?(e.consume(_),ae):z(_)}return lt(_)&&s.length<8?(e.consume(_),s+=String.fromCharCode(_),D):z(_)}function q(_){return _===93?(e.consume(_),k):z(_)}function k(_){return _===62?(e.consume(_),ae):_===45&&i===2?(e.consume(_),k):z(_)}function ae(_){return _===null||ne(_)?(e.exit("htmlFlowData"),ye(_)):(e.consume(_),ae)}function ye(_){return e.exit("htmlFlow"),t(_)}}function e4(e,t,n){const r=this;return i;function i(s){return ne(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),o):n(s)}function o(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}function t4(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Bo,t,n)}}const n4={name:"htmlText",tokenize:r4};function r4(e,t,n){const r=this;let i,o,s;return l;function l(k){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(k),a}function a(k){return k===33?(e.consume(k),u):k===47?(e.consume(k),j):k===63?(e.consume(k),w):lt(k)?(e.consume(k),T):n(k)}function u(k){return k===45?(e.consume(k),f):k===91?(e.consume(k),o=0,x):lt(k)?(e.consume(k),v):n(k)}function f(k){return k===45?(e.consume(k),p):n(k)}function d(k){return k===null?n(k):k===45?(e.consume(k),m):ne(k)?(s=d,se(k)):(e.consume(k),d)}function m(k){return k===45?(e.consume(k),p):d(k)}function p(k){return k===62?Q(k):k===45?m(k):d(k)}function x(k){const ae="CDATA[";return k===ae.charCodeAt(o++)?(e.consume(k),o===ae.length?b:x):n(k)}function b(k){return k===null?n(k):k===93?(e.consume(k),I):ne(k)?(s=b,se(k)):(e.consume(k),b)}function I(k){return k===93?(e.consume(k),y):b(k)}function y(k){return k===62?Q(k):k===93?(e.consume(k),y):b(k)}function v(k){return k===null||k===62?Q(k):ne(k)?(s=v,se(k)):(e.consume(k),v)}function w(k){return k===null?n(k):k===63?(e.consume(k),E):ne(k)?(s=w,se(k)):(e.consume(k),w)}function E(k){return k===62?Q(k):w(k)}function j(k){return lt(k)?(e.consume(k),S):n(k)}function S(k){return k===45||nt(k)?(e.consume(k),S):A(k)}function A(k){return ne(k)?(s=A,se(k)):me(k)?(e.consume(k),A):Q(k)}function T(k){return k===45||nt(k)?(e.consume(k),T):k===47||k===62||_e(k)?$(k):n(k)}function $(k){return k===47?(e.consume(k),Q):k===58||k===95||lt(k)?(e.consume(k),C):ne(k)?(s=$,se(k)):me(k)?(e.consume(k),$):Q(k)}function C(k){return k===45||k===46||k===58||k===95||nt(k)?(e.consume(k),C):O(k)}function O(k){return k===61?(e.consume(k),z):ne(k)?(s=O,se(k)):me(k)?(e.consume(k),O):$(k)}function z(k){return k===null||k===60||k===61||k===62||k===96?n(k):k===34||k===39?(e.consume(k),i=k,oe):ne(k)?(s=z,se(k)):me(k)?(e.consume(k),z):(e.consume(k),Z)}function oe(k){return k===i?(e.consume(k),i=void 0,te):k===null?n(k):ne(k)?(s=oe,se(k)):(e.consume(k),oe)}function Z(k){return k===null||k===34||k===39||k===60||k===61||k===96?n(k):k===47||k===62||_e(k)?$(k):(e.consume(k),Z)}function te(k){return k===47||k===62||_e(k)?$(k):n(k)}function Q(k){return k===62?(e.consume(k),e.exit("htmlTextData"),e.exit("htmlText"),t):n(k)}function se(k){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),D}function D(k){return me(k)?ke(e,q,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(k):q(k)}function q(k){return e.enter("htmlTextData"),s(k)}}const Md={name:"labelEnd",resolveAll:l4,resolveTo:a4,tokenize:u4},i4={tokenize:c4},o4={tokenize:d4},s4={tokenize:f4};function l4(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&Ye(e,0,e.length,n),e}function a4(e,t){let n=e.length,r=0,i,o,s,l;for(;n--;)if(i=e[n][1],o){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(s){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(o=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(s=n);const a={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},u={type:"label",start:{...e[o][1].start},end:{...e[s][1].end}},f={type:"labelText",start:{...e[o+r+2][1].end},end:{...e[s-2][1].start}};return l=[["enter",a,t],["enter",u,t]],l=Ke(l,e.slice(o+1,o+r+3)),l=Ke(l,[["enter",f,t]]),l=Ke(l,Ni(t.parser.constructs.insideSpan.null,e.slice(o+r+4,s-3),t)),l=Ke(l,[["exit",f,t],e[s-2],e[s-1],["exit",u,t]]),l=Ke(l,e.slice(s+1)),l=Ke(l,[["exit",a,t]]),Ye(e,o,e.length,l),e}function u4(e,t,n){const r=this;let i=r.events.length,o,s;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){o=r.events[i][1];break}return l;function l(m){return o?o._inactive?d(m):(s=r.parser.defined.includes(Zt(r.sliceSerialize({start:o.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(m),e.exit("labelMarker"),e.exit("labelEnd"),a):n(m)}function a(m){return m===40?e.attempt(i4,f,s?f:d)(m):m===91?e.attempt(o4,f,s?u:d)(m):s?f(m):d(m)}function u(m){return e.attempt(s4,f,d)(m)}function f(m){return t(m)}function d(m){return o._balanced=!0,n(m)}}function c4(e,t,n){return r;function r(d){return e.enter("resource"),e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),i}function i(d){return _e(d)?io(e,o)(d):o(d)}function o(d){return d===41?f(d):Ay(e,s,l,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(d)}function s(d){return _e(d)?io(e,a)(d):f(d)}function l(d){return n(d)}function a(d){return d===34||d===39||d===40?Ry(e,u,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(d):f(d)}function u(d){return _e(d)?io(e,f)(d):f(d)}function f(d){return d===41?(e.enter("resourceMarker"),e.consume(d),e.exit("resourceMarker"),e.exit("resource"),t):n(d)}}function d4(e,t,n){const r=this;return i;function i(l){return Py.call(r,e,o,s,"reference","referenceMarker","referenceString")(l)}function o(l){return r.parser.defined.includes(Zt(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(l):n(l)}function s(l){return n(l)}}function f4(e,t,n){return r;function r(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),i}function i(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),t):n(o)}}const p4={name:"labelStartImage",resolveAll:Md.resolveAll,tokenize:m4};function m4(e,t,n){const r=this;return i;function i(l){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(l),e.exit("labelImageMarker"),o}function o(l){return l===91?(e.enter("labelMarker"),e.consume(l),e.exit("labelMarker"),e.exit("labelImage"),s):n(l)}function s(l){return l===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(l):t(l)}}const h4={name:"labelStartLink",resolveAll:Md.resolveAll,tokenize:g4};function g4(e,t,n){const r=this;return i;function i(s){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(s),e.exit("labelMarker"),e.exit("labelLink"),o}function o(s){return s===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(s):t(s)}}const Pa={name:"lineEnding",tokenize:y4};function y4(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),ke(e,t,"linePrefix")}}const Ps={name:"thematicBreak",tokenize:x4};function x4(e,t,n){let r=0,i;return o;function o(u){return e.enter("thematicBreak"),s(u)}function s(u){return i=u,l(u)}function l(u){return u===i?(e.enter("thematicBreakSequence"),a(u)):r>=3&&(u===null||ne(u))?(e.exit("thematicBreak"),t(u)):n(u)}function a(u){return u===i?(e.consume(u),r++,a):(e.exit("thematicBreakSequence"),me(u)?ke(e,l,"whitespace")(u):l(u))}}const pt={continuation:{tokenize:b4},exit:_4,name:"list",tokenize:w4},v4={partial:!0,tokenize:C4},k4={partial:!0,tokenize:S4};function w4(e,t,n){const r=this,i=r.events[r.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,s=0;return l;function l(p){const x=r.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(x==="listUnordered"?!r.containerState.marker||p===r.containerState.marker:nc(p)){if(r.containerState.type||(r.containerState.type=x,e.enter(x,{_container:!0})),x==="listUnordered")return e.enter("listItemPrefix"),p===42||p===45?e.check(Ps,n,u)(p):u(p);if(!r.interrupt||p===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),a(p)}return n(p)}function a(p){return nc(p)&&++s<10?(e.consume(p),a):(!r.interrupt||s<2)&&(r.containerState.marker?p===r.containerState.marker:p===41||p===46)?(e.exit("listItemValue"),u(p)):n(p)}function u(p){return e.enter("listItemMarker"),e.consume(p),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||p,e.check(Bo,r.interrupt?n:f,e.attempt(v4,m,d))}function f(p){return r.containerState.initialBlankLine=!0,o++,m(p)}function d(p){return me(p)?(e.enter("listItemPrefixWhitespace"),e.consume(p),e.exit("listItemPrefixWhitespace"),m):n(p)}function m(p){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(p)}}function b4(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Bo,i,o);function i(l){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,ke(e,t,"listItemIndent",r.containerState.size+1)(l)}function o(l){return r.containerState.furtherBlankLines||!me(l)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,s(l)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(k4,t,s)(l))}function s(l){return r.containerState._closeFlow=!0,r.interrupt=void 0,ke(e,e.attempt(pt,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function S4(e,t,n){const r=this;return ke(e,i,"listItemIndent",r.containerState.size+1);function i(o){const s=r.events[r.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===r.containerState.size?t(o):n(o)}}function _4(e){e.exit(this.containerState.type)}function C4(e,t,n){const r=this;return ke(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){const s=r.events[r.events.length-1];return!me(o)&&s&&s[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const Jp={name:"setextUnderline",resolveTo:I4,tokenize:E4};function I4(e,t){let n=e.length,r,i,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!o&&e[n][1].type==="definition"&&(o=n);const s={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",o?(e.splice(i,0,["enter",s,t]),e.splice(o+1,0,["exit",e[r][1],t]),e[r][1].end={...e[o][1].end}):e[r][1]=s,e.push(["exit",s,t]),e}function E4(e,t,n){const r=this;let i;return o;function o(u){let f=r.events.length,d;for(;f--;)if(r.events[f][1].type!=="lineEnding"&&r.events[f][1].type!=="linePrefix"&&r.events[f][1].type!=="content"){d=r.events[f][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||d)?(e.enter("setextHeadingLine"),i=u,s(u)):n(u)}function s(u){return e.enter("setextHeadingLineSequence"),l(u)}function l(u){return u===i?(e.consume(u),l):(e.exit("setextHeadingLineSequence"),me(u)?ke(e,a,"lineSuffix")(u):a(u))}function a(u){return u===null||ne(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const N4={tokenize:T4};function T4(e){const t=this,n=e.attempt(Bo,r,e.attempt(this.parser.constructs.flowInitial,i,ke(e,e.attempt(this.parser.constructs.flow,i,e.attempt(zI,i)),"linePrefix")));return n;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const j4={resolveAll:My()},A4=zy("string"),P4=zy("text");function zy(e){return{resolveAll:My(e==="text"?R4:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],o=n.attempt(i,s,l);return s;function s(f){return u(f)?o(f):l(f)}function l(f){if(f===null){n.consume(f);return}return n.enter("data"),n.consume(f),a}function a(f){return u(f)?(n.exit("data"),o(f)):(n.consume(f),a)}function u(f){if(f===null)return!0;const d=i[f];let m=-1;if(d)for(;++m<d.length;){const p=d[m];if(!p.previous||p.previous.call(r,r.previous))return!0}return!1}}}function My(e){return t;function t(n,r){let i=-1,o;for(;++i<=n.length;)o===void 0?n[i]&&n[i][1].type==="data"&&(o=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==o+2&&(n[o][1].end=n[i-1][1].end,n.splice(o+2,i-o-2),i=o+2),o=void 0);return e?e(n,r):n}}function R4(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],i=t.sliceStream(r);let o=i.length,s=-1,l=0,a;for(;o--;){const u=i[o];if(typeof u=="string"){for(s=u.length;u.charCodeAt(s-1)===32;)l++,s--;if(s)break;s=-1}else if(u===-2)a=!0,l++;else if(u!==-1){o++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(l=0),l){const u={type:n===e.length||a||l<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?s:r.start._bufferIndex+s,_index:r.start._index+o,line:r.end.line,column:r.end.column-l,offset:r.end.offset-l},end:{...r.end}};r.end={...u.start},r.start.offset===r.end.offset?Object.assign(r,u):(e.splice(n,0,["enter",u,t],["exit",u,t]),n+=2)}n++}return e}const z4={42:pt,43:pt,45:pt,48:pt,49:pt,50:pt,51:pt,52:pt,53:pt,54:pt,55:pt,56:pt,57:pt,62:Ey},M4={91:FI},L4={[-2]:Aa,[-1]:Aa,32:Aa},O4={35:WI,42:Ps,45:[Jp,Ps],60:KI,61:Jp,95:Ps,96:Yp,126:Yp},D4={38:Ty,92:Ny},F4={[-5]:Pa,[-4]:Pa,[-3]:Pa,33:p4,38:Ty,42:rc,60:[hI,n4],91:h4,92:[VI,Ny],93:Md,95:rc,96:NI},$4={null:[rc,j4]},U4={null:[42,95]},B4={null:[]},V4=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:U4,contentInitial:M4,disable:B4,document:z4,flow:O4,flowInitial:L4,insideSpan:$4,string:D4,text:F4},Symbol.toStringTag,{value:"Module"}));function H4(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},o=[];let s=[],l=[];const a={attempt:A(j),check:A(S),consume:v,enter:w,exit:E,interrupt:A(S,{interrupt:!0})},u={code:null,containerState:{},defineSkip:b,events:[],now:x,parser:e,previous:null,sliceSerialize:m,sliceStream:p,write:d};let f=t.tokenize.call(u,a);return t.resolveAll&&o.push(t),u;function d(O){return s=Ke(s,O),I(),s[s.length-1]!==null?[]:(T(t,0),u.events=Ni(o,u.events,u),u.events)}function m(O,z){return q4(p(O),z)}function p(O){return W4(s,O)}function x(){const{_bufferIndex:O,_index:z,line:oe,column:Z,offset:te}=r;return{_bufferIndex:O,_index:z,line:oe,column:Z,offset:te}}function b(O){i[O.line]=O.column,C()}function I(){let O;for(;r._index<s.length;){const z=s[r._index];if(typeof z=="string")for(O=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===O&&r._bufferIndex<z.length;)y(z.charCodeAt(r._bufferIndex));else y(z)}}function y(O){f=f(O)}function v(O){ne(O)?(r.line++,r.column=1,r.offset+=O===-3?2:1,C()):O!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===s[r._index].length&&(r._bufferIndex=-1,r._index++)),u.previous=O}function w(O,z){const oe=z||{};return oe.type=O,oe.start=x(),u.events.push(["enter",oe,u]),l.push(oe),oe}function E(O){const z=l.pop();return z.end=x(),u.events.push(["exit",z,u]),z}function j(O,z){T(O,z.from)}function S(O,z){z.restore()}function A(O,z){return oe;function oe(Z,te,Q){let se,D,q,k;return Array.isArray(Z)?ye(Z):"tokenize"in Z?ye([Z]):ae(Z);function ae(ue){return ot;function ot(Ft){const Te=Ft!==null&&ue[Ft],un=Ft!==null&&ue.null,cn=[...Array.isArray(Te)?Te:Te?[Te]:[],...Array.isArray(un)?un:un?[un]:[]];return ye(cn)(Ft)}}function ye(ue){return se=ue,D=0,ue.length===0?Q:_(ue[D])}function _(ue){return ot;function ot(Ft){return k=$(),q=ue,ue.partial||(u.currentConstruct=ue),ue.name&&u.parser.constructs.disable.null.includes(ue.name)?Ce():ue.tokenize.call(z?Object.assign(Object.create(u),z):u,a,Re,Ce)(Ft)}}function Re(ue){return O(q,k),te}function Ce(ue){return k.restore(),++D<se.length?_(se[D]):Q}}}function T(O,z){O.resolveAll&&!o.includes(O)&&o.push(O),O.resolve&&Ye(u.events,z,u.events.length-z,O.resolve(u.events.slice(z),u)),O.resolveTo&&(u.events=O.resolveTo(u.events,u))}function $(){const O=x(),z=u.previous,oe=u.currentConstruct,Z=u.events.length,te=Array.from(l);return{from:Z,restore:Q};function Q(){r=O,u.previous=z,u.currentConstruct=oe,u.events.length=Z,l=te,C()}}function C(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function W4(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,o=t.end._bufferIndex;let s;if(n===i)s=[e[n].slice(r,o)];else{if(s=e.slice(n,i),r>-1){const l=s[0];typeof l=="string"?s[0]=l.slice(r):s.shift()}o>0&&s.push(e[i].slice(0,o))}return s}function q4(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const o=e[n];let s;if(typeof o=="string")s=o;else switch(o){case-5:{s="\r";break}case-4:{s=`
279
279
  `;break}case-3:{s=`\r
280
280
  `;break}case-2:{s=t?" ":" ";break}case-1:{if(!t&&i)continue;s=" ";break}default:s=String.fromCharCode(o)}i=o===-2,r.push(s)}return r.join("")}function Z4(e){const r={constructs:Cy([V4,...(e||{}).extensions||[]]),content:i(aI),defined:[],document:i(cI),flow:i(N4),lazy:{},string:i(A4),text:i(P4)};return r;function i(o){return s;function s(l){return H4(r,o,l)}}}function G4(e){for(;!jy(e););return e}const em=/[\0\t\n\r]/g;function K4(){let e=1,t="",n=!0,r;return i;function i(o,s,l){const a=[];let u,f,d,m,p;for(o=t+(typeof o=="string"?o.toString():new TextDecoder(s||void 0).decode(o)),d=0,t="",n&&(o.charCodeAt(0)===65279&&d++,n=void 0);d<o.length;){if(em.lastIndex=d,u=em.exec(o),m=u&&u.index!==void 0?u.index:o.length,p=o.charCodeAt(m),!u){t=o.slice(d);break}if(p===10&&d===m&&r)a.push(-3),r=void 0;else switch(r&&(a.push(-5),r=void 0),d<m&&(a.push(o.slice(d,m)),e+=m-d),p){case 0:{a.push(65533),e++;break}case 9:{for(f=Math.ceil(e/4)*4,a.push(-2);e++<f;)a.push(-1);break}case 10:{a.push(-4),e=1;break}default:r=!0,e=1}d=m+1}return l&&(r&&a.push(-5),t&&a.push(t),a.push(null)),a}}const Q4=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Y4(e){return e.replace(Q4,X4)}function X4(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),o=i===120||i===88;return Iy(n.slice(o?2:1),o?16:10)}return zd(n)||e}const Ly={}.hasOwnProperty;function J4(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),eE(n)(G4(Z4(n).document().write(K4()(e,t,!0))))}function eE(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(Kd),autolinkProtocol:$,autolinkEmail:$,atxHeading:o(qd),blockQuote:o(un),characterEscape:$,characterReference:$,codeFenced:o(cn),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:o(cn,s),codeText:o(Lr,s),codeTextData:$,data:$,codeFlowValue:$,definition:o(Ti),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:o(Or),hardBreakEscape:o(Zd),hardBreakTrailing:o(Zd),htmlFlow:o(Gd,s),htmlFlowData:$,htmlText:o(Gd,s),htmlTextData:$,image:o(Fx),label:s,link:o(Kd),listItem:o($x),listItemValue:m,listOrdered:o(Qd,d),listUnordered:o(Qd),paragraph:o(Ux),reference:_,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:o(qd),strong:o(Bx),thematicBreak:o(Hx)},exit:{atxHeading:a(),atxHeadingSequence:j,autolink:a(),autolinkEmail:Te,autolinkProtocol:Ft,blockQuote:a(),characterEscapeValue:C,characterReferenceMarkerHexadecimal:Ce,characterReferenceMarkerNumeric:Ce,characterReferenceValue:ue,characterReference:ot,codeFenced:a(I),codeFencedFence:b,codeFencedFenceInfo:p,codeFencedFenceMeta:x,codeFlowValue:C,codeIndented:a(y),codeText:a(te),codeTextData:C,data:C,definition:a(),definitionDestinationString:E,definitionLabelString:v,definitionTitleString:w,emphasis:a(),hardBreakEscape:a(z),hardBreakTrailing:a(z),htmlFlow:a(oe),htmlFlowData:C,htmlText:a(Z),htmlTextData:C,image:a(se),label:q,labelText:D,lineEnding:O,link:a(Q),listItem:a(),listOrdered:a(),listUnordered:a(),paragraph:a(),referenceString:Re,resourceDestinationString:k,resourceTitleString:ae,resource:ye,setextHeading:a(T),setextHeadingLineSequence:A,setextHeadingText:S,strong:a(),thematicBreak:a()}};Oy(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(R){let H={type:"root",children:[]};const le={stack:[H],tokenStack:[],config:t,enter:l,exit:u,buffer:s,resume:f,data:n},xe=[];let Ie=-1;for(;++Ie<R.length;)if(R[Ie][1].type==="listOrdered"||R[Ie][1].type==="listUnordered")if(R[Ie][0]==="enter")xe.push(Ie);else{const $t=xe.pop();Ie=i(R,$t,Ie)}for(Ie=-1;++Ie<R.length;){const $t=t[R[Ie][0]];Ly.call($t,R[Ie][1].type)&&$t[R[Ie][1].type].call(Object.assign({sliceSerialize:R[Ie][2].sliceSerialize},le),R[Ie][1])}if(le.tokenStack.length>0){const $t=le.tokenStack[le.tokenStack.length-1];($t[1]||tm).call(le,void 0,$t[0])}for(H.position={start:Mn(R.length>0?R[0][1].start:{line:1,column:1,offset:0}),end:Mn(R.length>0?R[R.length-2][1].end:{line:1,column:1,offset:0})},Ie=-1;++Ie<t.transforms.length;)H=t.transforms[Ie](H)||H;return H}function i(R,H,le){let xe=H-1,Ie=-1,$t=!1,ur,dn,ji,Ai;for(;++xe<=le;){const bt=R[xe];switch(bt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{bt[0]==="enter"?Ie++:Ie--,Ai=void 0;break}case"lineEndingBlank":{bt[0]==="enter"&&(ur&&!Ai&&!Ie&&!ji&&(ji=xe),Ai=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Ai=void 0}if(!Ie&&bt[0]==="enter"&&bt[1].type==="listItemPrefix"||Ie===-1&&bt[0]==="exit"&&(bt[1].type==="listUnordered"||bt[1].type==="listOrdered")){if(ur){let Dr=xe;for(dn=void 0;Dr--;){const fn=R[Dr];if(fn[1].type==="lineEnding"||fn[1].type==="lineEndingBlank"){if(fn[0]==="exit")continue;dn&&(R[dn][1].type="lineEndingBlank",$t=!0),fn[1].type="lineEnding",dn=Dr}else if(!(fn[1].type==="linePrefix"||fn[1].type==="blockQuotePrefix"||fn[1].type==="blockQuotePrefixWhitespace"||fn[1].type==="blockQuoteMarker"||fn[1].type==="listItemIndent"))break}ji&&(!dn||ji<dn)&&(ur._spread=!0),ur.end=Object.assign({},dn?R[dn][1].start:bt[1].end),R.splice(dn||xe,0,["exit",ur,bt[2]]),xe++,le++}if(bt[1].type==="listItemPrefix"){const Dr={type:"listItem",_spread:!1,start:Object.assign({},bt[1].start),end:void 0};ur=Dr,R.splice(xe,0,["enter",Dr,bt[2]]),xe++,le++,ji=void 0,Ai=!0}}}return R[H][1]._spread=$t,le}function o(R,H){return le;function le(xe){l.call(this,R(xe),xe),H&&H.call(this,xe)}}function s(){this.stack.push({type:"fragment",children:[]})}function l(R,H,le){this.stack[this.stack.length-1].children.push(R),this.stack.push(R),this.tokenStack.push([H,le||void 0]),R.position={start:Mn(H.start),end:void 0}}function a(R){return H;function H(le){R&&R.call(this,le),u.call(this,le)}}function u(R,H){const le=this.stack.pop(),xe=this.tokenStack.pop();if(xe)xe[0].type!==R.type&&(H?H.call(this,R,xe[0]):(xe[1]||tm).call(this,R,xe[0]));else throw new Error("Cannot close `"+R.type+"` ("+ro({start:R.start,end:R.end})+"): it’s not open");le.position.end=Mn(R.end)}function f(){return Rd(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function m(R){if(this.data.expectingFirstListItemValue){const H=this.stack[this.stack.length-2];H.start=Number.parseInt(this.sliceSerialize(R),10),this.data.expectingFirstListItemValue=void 0}}function p(){const R=this.resume(),H=this.stack[this.stack.length-1];H.lang=R}function x(){const R=this.resume(),H=this.stack[this.stack.length-1];H.meta=R}function b(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function I(){const R=this.resume(),H=this.stack[this.stack.length-1];H.value=R.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function y(){const R=this.resume(),H=this.stack[this.stack.length-1];H.value=R.replace(/(\r?\n|\r)$/g,"")}function v(R){const H=this.resume(),le=this.stack[this.stack.length-1];le.label=H,le.identifier=Zt(this.sliceSerialize(R)).toLowerCase()}function w(){const R=this.resume(),H=this.stack[this.stack.length-1];H.title=R}function E(){const R=this.resume(),H=this.stack[this.stack.length-1];H.url=R}function j(R){const H=this.stack[this.stack.length-1];if(!H.depth){const le=this.sliceSerialize(R).length;H.depth=le}}function S(){this.data.setextHeadingSlurpLineEnding=!0}function A(R){const H=this.stack[this.stack.length-1];H.depth=this.sliceSerialize(R).codePointAt(0)===61?1:2}function T(){this.data.setextHeadingSlurpLineEnding=void 0}function $(R){const le=this.stack[this.stack.length-1].children;let xe=le[le.length-1];(!xe||xe.type!=="text")&&(xe=Vx(),xe.position={start:Mn(R.start),end:void 0},le.push(xe)),this.stack.push(xe)}function C(R){const H=this.stack.pop();H.value+=this.sliceSerialize(R),H.position.end=Mn(R.end)}function O(R){const H=this.stack[this.stack.length-1];if(this.data.atHardBreak){const le=H.children[H.children.length-1];le.position.end=Mn(R.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(H.type)&&($.call(this,R),C.call(this,R))}function z(){this.data.atHardBreak=!0}function oe(){const R=this.resume(),H=this.stack[this.stack.length-1];H.value=R}function Z(){const R=this.resume(),H=this.stack[this.stack.length-1];H.value=R}function te(){const R=this.resume(),H=this.stack[this.stack.length-1];H.value=R}function Q(){const R=this.stack[this.stack.length-1];if(this.data.inReference){const H=this.data.referenceType||"shortcut";R.type+="Reference",R.referenceType=H,delete R.url,delete R.title}else delete R.identifier,delete R.label;this.data.referenceType=void 0}function se(){const R=this.stack[this.stack.length-1];if(this.data.inReference){const H=this.data.referenceType||"shortcut";R.type+="Reference",R.referenceType=H,delete R.url,delete R.title}else delete R.identifier,delete R.label;this.data.referenceType=void 0}function D(R){const H=this.sliceSerialize(R),le=this.stack[this.stack.length-2];le.label=Y4(H),le.identifier=Zt(H).toLowerCase()}function q(){const R=this.stack[this.stack.length-1],H=this.resume(),le=this.stack[this.stack.length-1];if(this.data.inReference=!0,le.type==="link"){const xe=R.children;le.children=xe}else le.alt=H}function k(){const R=this.resume(),H=this.stack[this.stack.length-1];H.url=R}function ae(){const R=this.resume(),H=this.stack[this.stack.length-1];H.title=R}function ye(){this.data.inReference=void 0}function _(){this.data.referenceType="collapsed"}function Re(R){const H=this.resume(),le=this.stack[this.stack.length-1];le.label=H,le.identifier=Zt(this.sliceSerialize(R)).toLowerCase(),this.data.referenceType="full"}function Ce(R){this.data.characterReferenceType=R.type}function ue(R){const H=this.sliceSerialize(R),le=this.data.characterReferenceType;let xe;le?(xe=Iy(H,le==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):xe=zd(H);const Ie=this.stack[this.stack.length-1];Ie.value+=xe}function ot(R){const H=this.stack.pop();H.position.end=Mn(R.end)}function Ft(R){C.call(this,R);const H=this.stack[this.stack.length-1];H.url=this.sliceSerialize(R)}function Te(R){C.call(this,R);const H=this.stack[this.stack.length-1];H.url="mailto:"+this.sliceSerialize(R)}function un(){return{type:"blockquote",children:[]}}function cn(){return{type:"code",lang:null,meta:null,value:""}}function Lr(){return{type:"inlineCode",value:""}}function Ti(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Or(){return{type:"emphasis",children:[]}}function qd(){return{type:"heading",depth:0,children:[]}}function Zd(){return{type:"break"}}function Gd(){return{type:"html",value:""}}function Fx(){return{type:"image",title:null,url:"",alt:null}}function Kd(){return{type:"link",title:null,url:"",children:[]}}function Qd(R){return{type:"list",ordered:R.type==="listOrdered",start:null,spread:R._spread,children:[]}}function $x(R){return{type:"listItem",spread:R._spread,checked:null,children:[]}}function Ux(){return{type:"paragraph",children:[]}}function Bx(){return{type:"strong",children:[]}}function Vx(){return{type:"text",value:""}}function Hx(){return{type:"thematicBreak"}}}function Mn(e){return{line:e.line,column:e.column,offset:e.offset}}function Oy(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?Oy(e,r):tE(e,r)}}function tE(e,t){let n;for(n in t)if(Ly.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function tm(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+ro({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+ro({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+ro({start:t.start,end:t.end})+") is still open")}function nE(e){const t=this;t.parser=n;function n(r){return J4(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function rE(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function iE(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`