@wonderwhy-er/desktop-commander
Version:
MCP server for terminal operations and file editing
460 lines • 1.1 MB
JavaScript
"use strict";(()=>{var II=Object.create;var _l=Object.defineProperty;var DI=Object.getOwnPropertyDescriptor;var NI=Object.getOwnPropertyNames;var zI=Object.getPrototypeOf,OI=Object.prototype.hasOwnProperty;var RI=(e,t,n)=>t in e?_l(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Br=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,n)=>(typeof require<"u"?require:t)[n]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var K=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(o){throw n=[o],o}};var Rv=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(n){throw t=0,n}},en=(e,t)=>{for(var n in t)_l(e,n,{get:t[n],enumerable:!0})},PI=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of NI(t))!OI.call(e,r)&&r!==n&&_l(e,r,{get:()=>t[r],enumerable:!(o=DI(t,r))||o.enumerable});return e};var Pv=(e,t,n)=>(n=e!=null?II(zI(e)):{},PI(t||!e||!e.__esModule?_l(n,"default",{value:e,enumerable:!0}):n,e));var $e=(e,t,n)=>RI(e,typeof t!="symbol"?t+"":t,n);function S(e,t,n){function o(a,l){var u;Object.defineProperty(a,"_zod",{value:a._zod??{},enumerable:!1}),(u=a._zod).traits??(u.traits=new Set),a._zod.traits.add(e),t(a,l);for(let c in s.prototype)c in a||Object.defineProperty(a,c,{value:s.prototype[c].bind(a)});a._zod.constr=s,a._zod.def=l}let r=n?.Parent??Object;class i extends r{}Object.defineProperty(i,"name",{value:e});function s(a){var l;let u=n?.Parent?new i:this;o(u,a),(l=u._zod).deferred??(l.deferred=[]);for(let c of u._zod.deferred)c();return u}return Object.defineProperty(s,"init",{value:o}),Object.defineProperty(s,Symbol.hasInstance,{value:a=>n?.Parent&&a instanceof n.Parent?!0:a?._zod?.traits?.has(e)}),Object.defineProperty(s,"name",{value:e}),s}function Qe(e){return e&&Object.assign(vs,e),vs}var El,Cl,En,vs,jo=K(()=>{El=Object.freeze({status:"aborted"});Cl=Symbol("zod_brand"),En=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},vs={}});var B={};en(B,{BIGINT_FORMAT_RANGES:()=>bp,Class:()=>up,NUMBER_FORMAT_RANGES:()=>gp,aborted:()=>Hr,allowsEval:()=>pp,assert:()=>UI,assertEqual:()=>LI,assertIs:()=>jI,assertNever:()=>BI,assertNotEqual:()=>FI,assignProp:()=>fp,cached:()=>ws,captureStackTrace:()=>Tl,cleanEnum:()=>t3,cleanRegex:()=>Ss,clone:()=>Ft,createTransparentProxy:()=>KI,defineLazy:()=>Ae,esc:()=>Ur,escapeRegex:()=>Hn,extend:()=>QI,finalizeIssue:()=>Vt,floatSafeRemainder:()=>dp,getElementAtPath:()=>HI,getEnumValues:()=>ks,getLengthableOrigin:()=>Cs,getParsedType:()=>WI,getSizableOrigin:()=>Es,isObject:()=>Bo,isPlainObject:()=>Uo,issue:()=>yp,joinValues:()=>$,jsonStringifyReplacer:()=>cp,merge:()=>XI,normalizeParams:()=>L,nullish:()=>pr,numKeys:()=>VI,omit:()=>GI,optionalKeys:()=>mp,partial:()=>YI,pick:()=>JI,prefixIssues:()=>jt,primitiveTypes:()=>hp,promiseAllObject:()=>qI,propertyKeyTypes:()=>_s,randomString:()=>ZI,required:()=>e3,stringifyPrimitive:()=>j,unwrapMessage:()=>xs});function LI(e){return e}function FI(e){return e}function jI(e){}function BI(e){throw new Error}function UI(e){}function ks(e){let t=Object.values(e).filter(o=>typeof o=="number");return Object.entries(e).filter(([o,r])=>t.indexOf(+o)===-1).map(([o,r])=>r)}function $(e,t="|"){return e.map(n=>j(n)).join(t)}function cp(e,t){return typeof t=="bigint"?t.toString():t}function ws(e){return{get value(){{let n=e();return Object.defineProperty(this,"value",{value:n}),n}throw new Error("cached value already set")}}}function pr(e){return e==null}function Ss(e){let t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function dp(e,t){let n=(e.toString().split(".")[1]||"").length,o=(t.toString().split(".")[1]||"").length,r=n>o?n:o,i=Number.parseInt(e.toFixed(r).replace(".","")),s=Number.parseInt(t.toFixed(r).replace(".",""));return i%s/10**r}function Ae(e,t,n){Object.defineProperty(e,t,{get(){{let r=n();return e[t]=r,r}throw new Error("cached value already set")},set(r){Object.defineProperty(e,t,{value:r})},configurable:!0})}function fp(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function HI(e,t){return t?t.reduce((n,o)=>n?.[o],e):e}function qI(e){let t=Object.keys(e),n=t.map(o=>e[o]);return Promise.all(n).then(o=>{let r={};for(let i=0;i<t.length;i++)r[t[i]]=o[i];return r})}function ZI(e=10){let t="abcdefghijklmnopqrstuvwxyz",n="";for(let o=0;o<e;o++)n+=t[Math.floor(Math.random()*t.length)];return n}function Ur(e){return JSON.stringify(e)}function Bo(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Uo(e){if(Bo(e)===!1)return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(Bo(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function VI(e){let t=0;for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t++;return t}function Hn(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ft(e,t,n){let o=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(o._zod.parent=e),o}function L(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function KI(e){let t;return new Proxy({},{get(n,o,r){return t??(t=e()),Reflect.get(t,o,r)},set(n,o,r,i){return t??(t=e()),Reflect.set(t,o,r,i)},has(n,o){return t??(t=e()),Reflect.has(t,o)},deleteProperty(n,o){return t??(t=e()),Reflect.deleteProperty(t,o)},ownKeys(n){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(n,o){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,o)},defineProperty(n,o,r){return t??(t=e()),Reflect.defineProperty(t,o,r)}})}function j(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function mp(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}function JI(e,t){let n={},o=e._zod.def;for(let r in t){if(!(r in o.shape))throw new Error(`Unrecognized key: "${r}"`);t[r]&&(n[r]=o.shape[r])}return Ft(e,{...e._zod.def,shape:n,checks:[]})}function GI(e,t){let n={...e._zod.def.shape},o=e._zod.def;for(let r in t){if(!(r in o.shape))throw new Error(`Unrecognized key: "${r}"`);t[r]&&delete n[r]}return Ft(e,{...e._zod.def,shape:n,checks:[]})}function QI(e,t){if(!Uo(t))throw new Error("Invalid input to extend: expected a plain object");let n={...e._zod.def,get shape(){let o={...e._zod.def.shape,...t};return fp(this,"shape",o),o},checks:[]};return Ft(e,n)}function XI(e,t){return Ft(e,{...e._zod.def,get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return fp(this,"shape",n),n},catchall:t._zod.def.catchall,checks:[]})}function YI(e,t,n){let o=t._zod.def.shape,r={...o};if(n)for(let i in n){if(!(i in o))throw new Error(`Unrecognized key: "${i}"`);n[i]&&(r[i]=e?new e({type:"optional",innerType:o[i]}):o[i])}else for(let i in o)r[i]=e?new e({type:"optional",innerType:o[i]}):o[i];return Ft(t,{...t._zod.def,shape:r,checks:[]})}function e3(e,t,n){let o=t._zod.def.shape,r={...o};if(n)for(let i in n){if(!(i in r))throw new Error(`Unrecognized key: "${i}"`);n[i]&&(r[i]=new e({type:"nonoptional",innerType:o[i]}))}else for(let i in o)r[i]=new e({type:"nonoptional",innerType:o[i]});return Ft(t,{...t._zod.def,shape:r,checks:[]})}function Hr(e,t=0){for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function jt(e,t){return t.map(n=>{var o;return(o=n).path??(o.path=[]),n.path.unshift(e),n})}function xs(e){return typeof e=="string"?e:e?.message}function Vt(e,t,n){let o={...e,path:e.path??[]};if(!e.message){let r=xs(e.inst?._zod.def?.error?.(e))??xs(t?.error?.(e))??xs(n.customError?.(e))??xs(n.localeError?.(e))??"Invalid input";o.message=r}return delete o.inst,delete o.continue,t?.reportInput||delete o.input,o}function Es(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function Cs(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function yp(...e){let[t,n,o]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:o}:{...t}}function t3(e){return Object.entries(e).filter(([t,n])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}var Tl,pp,WI,_s,hp,gp,bp,up,ie=K(()=>{Tl=Error.captureStackTrace?Error.captureStackTrace:(...e)=>{};pp=ws(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});WI=e=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}},_s=new Set(["string","number","symbol"]),hp=new Set(["string","number","bigint","boolean","symbol","undefined"]);gp={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},bp={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};up=class{constructor(...t){}}});function qo(e,t=n=>n.message){let n={},o=[];for(let r of e.issues)r.path.length>0?(n[r.path[0]]=n[r.path[0]]||[],n[r.path[0]].push(t(r))):o.push(t(r));return{formErrors:o,fieldErrors:n}}function Zo(e,t){let n=t||function(i){return i.message},o={_errors:[]},r=i=>{for(let s of i.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(a=>r({issues:a}));else if(s.code==="invalid_key")r({issues:s.issues});else if(s.code==="invalid_element")r({issues:s.issues});else if(s.path.length===0)o._errors.push(n(s));else{let a=o,l=0;for(;l<s.path.length;){let u=s.path[l];l===s.path.length-1?(a[u]=a[u]||{_errors:[]},a[u]._errors.push(n(s))):a[u]=a[u]||{_errors:[]},a=a[u],l++}}};return r(e),o}function Al(e,t){let n=t||function(i){return i.message},o={errors:[]},r=(i,s=[])=>{var a,l;for(let u of i.issues)if(u.code==="invalid_union"&&u.errors.length)u.errors.map(c=>r({issues:c},u.path));else if(u.code==="invalid_key")r({issues:u.issues},u.path);else if(u.code==="invalid_element")r({issues:u.issues},u.path);else{let c=[...s,...u.path];if(c.length===0){o.errors.push(n(u));continue}let d=o,f=0;for(;f<c.length;){let h=c[f],p=f===c.length-1;typeof h=="string"?(d.properties??(d.properties={}),(a=d.properties)[h]??(a[h]={errors:[]}),d=d.properties[h]):(d.items??(d.items=[]),(l=d.items)[h]??(l[h]={errors:[]}),d=d.items[h]),p&&d.errors.push(n(u)),f++}}};return r(e),o}function Fv(e){let t=[];for(let n of e)typeof n=="number"?t.push(`[${n}]`):typeof n=="symbol"?t.push(`[${JSON.stringify(String(n))}]`):/[^\w$]/.test(n)?t.push(`[${JSON.stringify(n)}]`):(t.length&&t.push("."),t.push(n));return t.join("")}function Ml(e){let t=[],n=[...e.issues].sort((o,r)=>o.path.length-r.path.length);for(let o of n)t.push(`\u2716 ${o.message}`),o.path?.length&&t.push(` \u2192 at ${Fv(o.path)}`);return t.join(`
`)}var Lv,Ts,Ho,vp=K(()=>{jo();ie();Lv=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),Object.defineProperty(e,"message",{get(){return JSON.stringify(t,cp,2)},enumerable:!0}),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Ts=S("$ZodError",Lv),Ho=S("$ZodError",Lv,{Parent:Error})});var $l,As,Il,Ms,Dl,Vo,Nl,$s,zl=K(()=>{jo();vp();ie();$l=e=>(t,n,o,r)=>{let i=o?Object.assign(o,{async:!1}):{async:!1},s=t._zod.run({value:n,issues:[]},i);if(s instanceof Promise)throw new En;if(s.issues.length){let a=new(r?.Err??e)(s.issues.map(l=>Vt(l,i,Qe())));throw Tl(a,r?.callee),a}return s.value},As=$l(Ho),Il=e=>async(t,n,o,r)=>{let i=o?Object.assign(o,{async:!0}):{async:!0},s=t._zod.run({value:n,issues:[]},i);if(s instanceof Promise&&(s=await s),s.issues.length){let a=new(r?.Err??e)(s.issues.map(l=>Vt(l,i,Qe())));throw Tl(a,r?.callee),a}return s.value},Ms=Il(Ho),Dl=e=>(t,n,o)=>{let r=o?{...o,async:!1}:{async:!1},i=t._zod.run({value:n,issues:[]},r);if(i instanceof Promise)throw new En;return i.issues.length?{success:!1,error:new(e??Ts)(i.issues.map(s=>Vt(s,r,Qe())))}:{success:!0,data:i.value}},Vo=Dl(Ho),Nl=e=>async(t,n,o)=>{let r=o?Object.assign(o,{async:!0}):{async:!0},i=t._zod.run({value:n,issues:[]},r);return i instanceof Promise&&(i=await i),i.issues.length?{success:!1,error:new e(i.issues.map(s=>Vt(s,r,Qe())))}:{success:!0,data:i.value}},$s=Nl(Ho)});var hr={};en(hr,{_emoji:()=>jv,base64:()=>zp,base64url:()=>Ol,bigint:()=>Bp,boolean:()=>qp,browserEmail:()=>c3,cidrv4:()=>Dp,cidrv6:()=>Np,cuid:()=>xp,cuid2:()=>kp,date:()=>Pp,datetime:()=>Fp,domain:()=>d3,duration:()=>Cp,e164:()=>Rp,email:()=>Ap,emoji:()=>Mp,extendedDuration:()=>r3,guid:()=>Tp,hostname:()=>Op,html5Email:()=>a3,integer:()=>Up,ipv4:()=>$p,ipv6:()=>Ip,ksuid:()=>_p,lowercase:()=>Wp,nanoid:()=>Ep,null:()=>Zp,number:()=>Hp,rfc5322Email:()=>l3,string:()=>jp,time:()=>Lp,ulid:()=>wp,undefined:()=>Vp,unicodeEmail:()=>u3,uppercase:()=>Kp,uuid:()=>qr,uuid4:()=>o3,uuid6:()=>i3,uuid7:()=>s3,xid:()=>Sp});function Mp(){return new RegExp(jv,"u")}function Uv(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Lp(e){return new RegExp(`^${Uv(e)}$`)}function Fp(e){let t=Uv({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-]\\d{2}:\\d{2})");let o=`${t}(?:${n.join("|")})`;return new RegExp(`^${Bv}T(?:${o})$`)}var xp,kp,wp,Sp,_p,Ep,Cp,r3,Tp,qr,o3,i3,s3,Ap,a3,l3,u3,c3,jv,$p,Ip,Dp,Np,zp,Ol,Op,d3,Rp,Bv,Pp,jp,Bp,Up,Hp,qp,Zp,Vp,Wp,Kp,Rl=K(()=>{xp=/^[cC][^\s-]{8,}$/,kp=/^[0-9a-z]+$/,wp=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Sp=/^[0-9a-vA-V]{20}$/,_p=/^[A-Za-z0-9]{27}$/,Ep=/^[a-zA-Z0-9_-]{21}$/,Cp=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,r3=/^[-+]?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)?)??$/,Tp=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,qr=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$/,o3=qr(4),i3=qr(6),s3=qr(7),Ap=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,a3=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,l3=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,u3=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,c3=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,jv="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";$p=/^(?:(?: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])$/,Ip=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})$/,Dp=/^((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])\/([0-9]|[1-2][0-9]|3[0-2])$/,Np=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,zp=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Ol=/^[A-Za-z0-9_-]*$/,Op=/^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/,d3=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,Rp=/^\+(?:[0-9]){6,14}[0-9]$/,Bv="(?:(?:\\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])))",Pp=new RegExp(`^${Bv}$`);jp=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},Bp=/^\d+n?$/,Up=/^\d+$/,Hp=/^-?\d+(?:\.\d+)?/i,qp=/true|false/i,Zp=/null/i,Vp=/undefined/i,Wp=/^[^A-Z]*$/,Kp=/^[^a-z]*$/});function Hv(e,t,n){e.issues.length&&t.issues.push(...jt(n,e.issues))}var Ze,qv,Pl,Ll,Jp,Gp,Qp,Xp,Yp,eh,th,nh,rh,Wo,oh,ih,sh,ah,lh,uh,ch,dh,fh,Fl=K(()=>{jo();Rl();ie();Ze=S("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),qv={number:"number",bigint:"bigint",object:"date"},Pl=S("$ZodCheckLessThan",(e,t)=>{Ze.init(e,t);let n=qv[typeof t.value];e._zod.onattach.push(o=>{let r=o._zod.bag,i=(t.inclusive?r.maximum:r.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<i&&(t.inclusive?r.maximum=t.value:r.exclusiveMaximum=t.value)}),e._zod.check=o=>{(t.inclusive?o.value<=t.value:o.value<t.value)||o.issues.push({origin:n,code:"too_big",maximum:t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Ll=S("$ZodCheckGreaterThan",(e,t)=>{Ze.init(e,t);let n=qv[typeof t.value];e._zod.onattach.push(o=>{let r=o._zod.bag,i=(t.inclusive?r.minimum:r.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>i&&(t.inclusive?r.minimum=t.value:r.exclusiveMinimum=t.value)}),e._zod.check=o=>{(t.inclusive?o.value>=t.value:o.value>t.value)||o.issues.push({origin:n,code:"too_small",minimum:t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Jp=S("$ZodCheckMultipleOf",(e,t)=>{Ze.init(e,t),e._zod.onattach.push(n=>{var o;(o=n._zod.bag).multipleOf??(o.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%t.value===BigInt(0):dp(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),Gp=S("$ZodCheckNumberFormat",(e,t)=>{Ze.init(e,t),t.format=t.format||"float64";let n=t.format?.includes("int"),o=n?"int":"number",[r,i]=gp[t.format];e._zod.onattach.push(s=>{let a=s._zod.bag;a.format=t.format,a.minimum=r,a.maximum=i,n&&(a.pattern=Up)}),e._zod.check=s=>{let a=s.value;if(n){if(!Number.isInteger(a)){s.issues.push({expected:o,format:t.format,code:"invalid_type",input:a,inst:e});return}if(!Number.isSafeInteger(a)){a>0?s.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,continue:!t.abort}):s.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,continue:!t.abort});return}}a<r&&s.issues.push({origin:"number",input:a,code:"too_small",minimum:r,inclusive:!0,inst:e,continue:!t.abort}),a>i&&s.issues.push({origin:"number",input:a,code:"too_big",maximum:i,inst:e})}}),Qp=S("$ZodCheckBigIntFormat",(e,t)=>{Ze.init(e,t);let[n,o]=bp[t.format];e._zod.onattach.push(r=>{let i=r._zod.bag;i.format=t.format,i.minimum=n,i.maximum=o}),e._zod.check=r=>{let i=r.value;i<n&&r.issues.push({origin:"bigint",input:i,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!t.abort}),i>o&&r.issues.push({origin:"bigint",input:i,code:"too_big",maximum:o,inst:e})}}),Xp=S("$ZodCheckMaxSize",(e,t)=>{var n;Ze.init(e,t),(n=e._zod.def).when??(n.when=o=>{let r=o.value;return!pr(r)&&r.size!==void 0}),e._zod.onattach.push(o=>{let r=o._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<r&&(o._zod.bag.maximum=t.maximum)}),e._zod.check=o=>{let r=o.value;r.size<=t.maximum||o.issues.push({origin:Es(r),code:"too_big",maximum:t.maximum,input:r,inst:e,continue:!t.abort})}}),Yp=S("$ZodCheckMinSize",(e,t)=>{var n;Ze.init(e,t),(n=e._zod.def).when??(n.when=o=>{let r=o.value;return!pr(r)&&r.size!==void 0}),e._zod.onattach.push(o=>{let r=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>r&&(o._zod.bag.minimum=t.minimum)}),e._zod.check=o=>{let r=o.value;r.size>=t.minimum||o.issues.push({origin:Es(r),code:"too_small",minimum:t.minimum,input:r,inst:e,continue:!t.abort})}}),eh=S("$ZodCheckSizeEquals",(e,t)=>{var n;Ze.init(e,t),(n=e._zod.def).when??(n.when=o=>{let r=o.value;return!pr(r)&&r.size!==void 0}),e._zod.onattach.push(o=>{let r=o._zod.bag;r.minimum=t.size,r.maximum=t.size,r.size=t.size}),e._zod.check=o=>{let r=o.value,i=r.size;if(i===t.size)return;let s=i>t.size;o.issues.push({origin:Es(r),...s?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!t.abort})}}),th=S("$ZodCheckMaxLength",(e,t)=>{var n;Ze.init(e,t),(n=e._zod.def).when??(n.when=o=>{let r=o.value;return!pr(r)&&r.length!==void 0}),e._zod.onattach.push(o=>{let r=o._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<r&&(o._zod.bag.maximum=t.maximum)}),e._zod.check=o=>{let r=o.value;if(r.length<=t.maximum)return;let s=Cs(r);o.issues.push({origin:s,code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),nh=S("$ZodCheckMinLength",(e,t)=>{var n;Ze.init(e,t),(n=e._zod.def).when??(n.when=o=>{let r=o.value;return!pr(r)&&r.length!==void 0}),e._zod.onattach.push(o=>{let r=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>r&&(o._zod.bag.minimum=t.minimum)}),e._zod.check=o=>{let r=o.value;if(r.length>=t.minimum)return;let s=Cs(r);o.issues.push({origin:s,code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),rh=S("$ZodCheckLengthEquals",(e,t)=>{var n;Ze.init(e,t),(n=e._zod.def).when??(n.when=o=>{let r=o.value;return!pr(r)&&r.length!==void 0}),e._zod.onattach.push(o=>{let r=o._zod.bag;r.minimum=t.length,r.maximum=t.length,r.length=t.length}),e._zod.check=o=>{let r=o.value,i=r.length;if(i===t.length)return;let s=Cs(r),a=i>t.length;o.issues.push({origin:s,...a?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!t.abort})}}),Wo=S("$ZodCheckStringFormat",(e,t)=>{var n,o;Ze.init(e,t),e._zod.onattach.push(r=>{let i=r._zod.bag;i.format=t.format,t.pattern&&(i.patterns??(i.patterns=new Set),i.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:t.format,input:r.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(o=e._zod).check??(o.check=()=>{})}),oh=S("$ZodCheckRegex",(e,t)=>{Wo.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),ih=S("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Wp),Wo.init(e,t)}),sh=S("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Kp),Wo.init(e,t)}),ah=S("$ZodCheckIncludes",(e,t)=>{Ze.init(e,t);let n=Hn(t.includes),o=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=o,e._zod.onattach.push(r=>{let i=r._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(o)}),e._zod.check=r=>{r.value.includes(t.includes,t.position)||r.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:r.value,inst:e,continue:!t.abort})}}),lh=S("$ZodCheckStartsWith",(e,t)=>{Ze.init(e,t);let n=new RegExp(`^${Hn(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(o=>{let r=o._zod.bag;r.patterns??(r.patterns=new Set),r.patterns.add(n)}),e._zod.check=o=>{o.value.startsWith(t.prefix)||o.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:o.value,inst:e,continue:!t.abort})}}),uh=S("$ZodCheckEndsWith",(e,t)=>{Ze.init(e,t);let n=new RegExp(`.*${Hn(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(o=>{let r=o._zod.bag;r.patterns??(r.patterns=new Set),r.patterns.add(n)}),e._zod.check=o=>{o.value.endsWith(t.suffix)||o.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:o.value,inst:e,continue:!t.abort})}});ch=S("$ZodCheckProperty",(e,t)=>{Ze.init(e,t),e._zod.check=n=>{let o=t.schema._zod.run({value:n.value[t.property],issues:[]},{});if(o instanceof Promise)return o.then(r=>Hv(r,n,t.property));Hv(o,n,t.property)}}),dh=S("$ZodCheckMimeType",(e,t)=>{Ze.init(e,t);let n=new Set(t.mime);e._zod.onattach.push(o=>{o._zod.bag.mime=t.mime}),e._zod.check=o=>{n.has(o.value.type)||o.issues.push({code:"invalid_value",values:t.mime,input:o.value.type,inst:e})}}),fh=S("$ZodCheckOverwrite",(e,t)=>{Ze.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}})});var Is,ph=K(()=>{Is=class{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}let o=t.split(`
`).filter(s=>s),r=Math.min(...o.map(s=>s.length-s.trimStart().length)),i=o.map(s=>s.slice(r)).map(s=>" ".repeat(this.indent*2)+s);for(let s of i)this.content.push(s)}compile(){let t=Function,n=this?.args,r=[...(this?.content??[""]).map(i=>` ${i}`)];return new t(...n,r.join(`
`))}}});var hh,mh=K(()=>{hh={major:4,minor:0,patch:0}});function Rh(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}function rx(e){if(!Ol.test(e))return!1;let t=e.replace(/[-_]/g,o=>o==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return Rh(n)}function ox(e,t=null){try{let n=e.split(".");if(n.length!==3)return!1;let[o]=n;if(!o)return!1;let r=JSON.parse(atob(o));return!("typ"in r&&r?.typ!=="JWT"||!r.alg||t&&(!("alg"in r)||r.alg!==t))}catch{return!1}}function Vv(e,t,n){e.issues.length&&t.issues.push(...jt(n,e.issues)),t.value[n]=e.value}function jl(e,t,n){e.issues.length&&t.issues.push(...jt(n,e.issues)),t.value[n]=e.value}function Wv(e,t,n,o){e.issues.length?o[n]===void 0?n in o?t.value[n]=void 0:t.value[n]=e.value:t.issues.push(...jt(n,e.issues)):e.value===void 0?n in o&&(t.value[n]=void 0):t.value[n]=e.value}function Kv(e,t,n,o){for(let r of e)if(r.issues.length===0)return t.value=r.value,t;return t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(r=>r.issues.map(i=>Vt(i,o,Qe())))}),t}function gh(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Uo(e)&&Uo(t)){let n=Object.keys(t),o=Object.keys(e).filter(i=>n.indexOf(i)!==-1),r={...e,...t};for(let i of o){let s=gh(e[i],t[i]);if(!s.valid)return{valid:!1,mergeErrorPath:[i,...s.mergeErrorPath]};r[i]=s.data}return{valid:!0,data:r}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let o=0;o<e.length;o++){let r=e[o],i=t[o],s=gh(r,i);if(!s.valid)return{valid:!1,mergeErrorPath:[o,...s.mergeErrorPath]};n.push(s.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function Jv(e,t,n){if(t.issues.length&&e.issues.push(...t.issues),n.issues.length&&e.issues.push(...n.issues),Hr(e))return e;let o=gh(t.value,n.value);if(!o.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}function Bl(e,t,n){e.issues.length&&t.issues.push(...jt(n,e.issues)),t.value[n]=e.value}function Gv(e,t,n,o,r,i,s){e.issues.length&&(_s.has(typeof o)?n.issues.push(...jt(o,e.issues)):n.issues.push({origin:"map",code:"invalid_key",input:r,inst:i,issues:e.issues.map(a=>Vt(a,s,Qe()))})),t.issues.length&&(_s.has(typeof o)?n.issues.push(...jt(o,t.issues)):n.issues.push({origin:"map",code:"invalid_element",input:r,inst:i,key:o,issues:t.issues.map(a=>Vt(a,s,Qe()))})),n.value.set(e.value,t.value)}function Qv(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value)}function Xv(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}function Yv(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}function ex(e,t,n){return Hr(e)?e:t.out._zod.run({value:e.value,issues:e.issues},n)}function tx(e){return e.value=Object.freeze(e.value),e}function nx(e,t,n,o){if(!e){let r={code:"custom",input:n,inst:o,path:[...o._zod.def.path??[]],continue:!o._zod.def.abort};o._zod.def.params&&(r.params=o._zod.def.params),t.issues.push(yp(r))}}var ue,Zr,Pe,bh,yh,vh,xh,kh,wh,Sh,_h,Eh,Ch,Th,Ah,Mh,$h,Ih,Dh,Nh,zh,Oh,Ph,Lh,Fh,jh,Bh,Ul,Uh,Ds,Hl,Hh,qh,Zh,Vh,Wh,Ko,Kh,Jh,Gh,Ns,Qh,ql,Xh,Yh,Vr,em,tm,nm,rm,om,im,zs,sm,am,lm,um,cm,dm,fm,pm,Os,hm,mm,gm,bm,ym,Rs=K(()=>{Fl();jo();ph();zl();Rl();ie();mh();ie();ue=S("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=hh;let o=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&o.unshift(e);for(let r of o)for(let i of r._zod.onattach)i(e);if(o.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let r=(i,s,a)=>{let l=Hr(i),u;for(let c of s){if(c._zod.def.when){if(!c._zod.def.when(i))continue}else if(l)continue;let d=i.issues.length,f=c._zod.check(i);if(f instanceof Promise&&a?.async===!1)throw new En;if(u||f instanceof Promise)u=(u??Promise.resolve()).then(async()=>{await f,i.issues.length!==d&&(l||(l=Hr(i,d)))});else{if(i.issues.length===d)continue;l||(l=Hr(i,d))}}return u?u.then(()=>i):i};e._zod.run=(i,s)=>{let a=e._zod.parse(i,s);if(a instanceof Promise){if(s.async===!1)throw new En;return a.then(l=>r(l,o,s))}return r(a,o,s)}}e["~standard"]={validate:r=>{try{let i=Vo(e,r);return i.success?{value:i.data}:{issues:i.error?.issues}}catch{return $s(e,r).then(s=>s.success?{value:s.data}:{issues:s.error?.issues})}},vendor:"zod",version:1}}),Zr=S("$ZodString",(e,t)=>{ue.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??jp(e._zod.bag),e._zod.parse=(n,o)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),Pe=S("$ZodStringFormat",(e,t)=>{Wo.init(e,t),Zr.init(e,t)}),bh=S("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=Tp),Pe.init(e,t)}),yh=S("$ZodUUID",(e,t)=>{if(t.version){let o={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(o===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=qr(o))}else t.pattern??(t.pattern=qr());Pe.init(e,t)}),vh=S("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=Ap),Pe.init(e,t)}),xh=S("$ZodURL",(e,t)=>{Pe.init(e,t),e._zod.check=n=>{try{let o=n.value,r=new URL(o),i=r.href;t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(r.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:Op.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(r.protocol.endsWith(":")?r.protocol.slice(0,-1):r.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),!o.endsWith("/")&&i.endsWith("/")?n.value=i.slice(0,-1):n.value=i;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),kh=S("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Mp()),Pe.init(e,t)}),wh=S("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=Ep),Pe.init(e,t)}),Sh=S("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=xp),Pe.init(e,t)}),_h=S("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=kp),Pe.init(e,t)}),Eh=S("$ZodULID",(e,t)=>{t.pattern??(t.pattern=wp),Pe.init(e,t)}),Ch=S("$ZodXID",(e,t)=>{t.pattern??(t.pattern=Sp),Pe.init(e,t)}),Th=S("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=_p),Pe.init(e,t)}),Ah=S("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=Fp(t)),Pe.init(e,t)}),Mh=S("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=Pp),Pe.init(e,t)}),$h=S("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=Lp(t)),Pe.init(e,t)}),Ih=S("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Cp),Pe.init(e,t)}),Dh=S("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=$p),Pe.init(e,t),e._zod.onattach.push(n=>{let o=n._zod.bag;o.format="ipv4"})}),Nh=S("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Ip),Pe.init(e,t),e._zod.onattach.push(n=>{let o=n._zod.bag;o.format="ipv6"}),e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),zh=S("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Dp),Pe.init(e,t)}),Oh=S("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Np),Pe.init(e,t),e._zod.check=n=>{let[o,r]=n.value.split("/");try{if(!r)throw new Error;let i=Number(r);if(`${i}`!==r)throw new Error;if(i<0||i>128)throw new Error;new URL(`http://[${o}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});Ph=S("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=zp),Pe.init(e,t),e._zod.onattach.push(n=>{n._zod.bag.contentEncoding="base64"}),e._zod.check=n=>{Rh(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});Lh=S("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Ol),Pe.init(e,t),e._zod.onattach.push(n=>{n._zod.bag.contentEncoding="base64url"}),e._zod.check=n=>{rx(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),Fh=S("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Rp),Pe.init(e,t)});jh=S("$ZodJWT",(e,t)=>{Pe.init(e,t),e._zod.check=n=>{ox(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),Bh=S("$ZodCustomStringFormat",(e,t)=>{Pe.init(e,t),e._zod.check=n=>{t.fn(n.value)||n.issues.push({code:"invalid_format",format:t.format,input:n.value,inst:e,continue:!t.abort})}}),Ul=S("$ZodNumber",(e,t)=>{ue.init(e,t),e._zod.pattern=e._zod.bag.pattern??Hp,e._zod.parse=(n,o)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let r=n.value;if(typeof r=="number"&&!Number.isNaN(r)&&Number.isFinite(r))return n;let i=typeof r=="number"?Number.isNaN(r)?"NaN":Number.isFinite(r)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:r,inst:e,...i?{received:i}:{}}),n}}),Uh=S("$ZodNumber",(e,t)=>{Gp.init(e,t),Ul.init(e,t)}),Ds=S("$ZodBoolean",(e,t)=>{ue.init(e,t),e._zod.pattern=qp,e._zod.parse=(n,o)=>{if(t.coerce)try{n.value=!!n.value}catch{}let r=n.value;return typeof r=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:r,inst:e}),n}}),Hl=S("$ZodBigInt",(e,t)=>{ue.init(e,t),e._zod.pattern=Bp,e._zod.parse=(n,o)=>{if(t.coerce)try{n.value=BigInt(n.value)}catch{}return typeof n.value=="bigint"||n.issues.push({expected:"bigint",code:"invalid_type",input:n.value,inst:e}),n}}),Hh=S("$ZodBigInt",(e,t)=>{Qp.init(e,t),Hl.init(e,t)}),qh=S("$ZodSymbol",(e,t)=>{ue.init(e,t),e._zod.parse=(n,o)=>{let r=n.value;return typeof r=="symbol"||n.issues.push({expected:"symbol",code:"invalid_type",input:r,inst:e}),n}}),Zh=S("$ZodUndefined",(e,t)=>{ue.init(e,t),e._zod.pattern=Vp,e._zod.values=new Set([void 0]),e._zod.optin="optional",e._zod.optout="optional",e._zod.parse=(n,o)=>{let r=n.value;return typeof r>"u"||n.issues.push({expected:"undefined",code:"invalid_type",input:r,inst:e}),n}}),Vh=S("$ZodNull",(e,t)=>{ue.init(e,t),e._zod.pattern=Zp,e._zod.values=new Set([null]),e._zod.parse=(n,o)=>{let r=n.value;return r===null||n.issues.push({expected:"null",code:"invalid_type",input:r,inst:e}),n}}),Wh=S("$ZodAny",(e,t)=>{ue.init(e,t),e._zod.parse=n=>n}),Ko=S("$ZodUnknown",(e,t)=>{ue.init(e,t),e._zod.parse=n=>n}),Kh=S("$ZodNever",(e,t)=>{ue.init(e,t),e._zod.parse=(n,o)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)}),Jh=S("$ZodVoid",(e,t)=>{ue.init(e,t),e._zod.parse=(n,o)=>{let r=n.value;return typeof r>"u"||n.issues.push({expected:"void",code:"invalid_type",input:r,inst:e}),n}}),Gh=S("$ZodDate",(e,t)=>{ue.init(e,t),e._zod.parse=(n,o)=>{if(t.coerce)try{n.value=new Date(n.value)}catch{}let r=n.value,i=r instanceof Date;return i&&!Number.isNaN(r.getTime())||n.issues.push({expected:"date",code:"invalid_type",input:r,...i?{received:"Invalid Date"}:{},inst:e}),n}});Ns=S("$ZodArray",(e,t)=>{ue.init(e,t),e._zod.parse=(n,o)=>{let r=n.value;if(!Array.isArray(r))return n.issues.push({expected:"array",code:"invalid_type",input:r,inst:e}),n;n.value=Array(r.length);let i=[];for(let s=0;s<r.length;s++){let a=r[s],l=t.element._zod.run({value:a,issues:[]},o);l instanceof Promise?i.push(l.then(u=>Vv(u,n,s))):Vv(l,n,s)}return i.length?Promise.all(i).then(()=>n):n}});Qh=S("$ZodObject",(e,t)=>{ue.init(e,t);let n=ws(()=>{let d=Object.keys(t.shape);for(let h of d)if(!(t.shape[h]instanceof ue))throw new Error(`Invalid element at key "${h}": expected a Zod schema`);let f=mp(t.shape);return{shape:t.shape,keys:d,keySet:new Set(d),numKeys:d.length,optionalKeys:new Set(f)}});Ae(e._zod,"propValues",()=>{let d=t.shape,f={};for(let h in d){let p=d[h]._zod;if(p.values){f[h]??(f[h]=new Set);for(let m of p.values)f[h].add(m)}}return f});let o=d=>{let f=new Is(["shape","payload","ctx"]),h=n.value,p=y=>{let k=Ur(y);return`shape[${k}]._zod.run({ value: input[${k}], issues: [] }, ctx)`};f.write("const input = payload.value;");let m=Object.create(null),g=0;for(let y of h.keys)m[y]=`key_${g++}`;f.write("const newResult = {}");for(let y of h.keys)if(h.optionalKeys.has(y)){let k=m[y];f.write(`const ${k} = ${p(y)};`);let x=Ur(y);f.write(`
if (${k}.issues.length) {
if (input[${x}] === undefined) {
if (${x} in input) {
newResult[${x}] = undefined;
}
} else {
payload.issues = payload.issues.concat(
${k}.issues.map((iss) => ({
...iss,
path: iss.path ? [${x}, ...iss.path] : [${x}],
}))
);
}
} else if (${k}.value === undefined) {
if (${x} in input) newResult[${x}] = undefined;
} else {
newResult[${x}] = ${k}.value;
}
`)}else{let k=m[y];f.write(`const ${k} = ${p(y)};`),f.write(`
if (${k}.issues.length) payload.issues = payload.issues.concat(${k}.issues.map(iss => ({
...iss,
path: iss.path ? [${Ur(y)}, ...iss.path] : [${Ur(y)}]
})));`),f.write(`newResult[${Ur(y)}] = ${k}.value`)}f.write("payload.value = newResult;"),f.write("return payload;");let b=f.compile();return(y,k)=>b(d,y,k)},r,i=Bo,s=!vs.jitless,l=s&&pp.value,u=t.catchall,c;e._zod.parse=(d,f)=>{c??(c=n.value);let h=d.value;if(!i(h))return d.issues.push({expected:"object",code:"invalid_type",input:h,inst:e}),d;let p=[];if(s&&l&&f?.async===!1&&f.jitless!==!0)r||(r=o(t.shape)),d=r(d,f);else{d.value={};let k=c.shape;for(let x of c.keys){let E=k[x],I=E._zod.run({value:h[x],issues:[]},f),N=E._zod.optin==="optional"&&E._zod.optout==="optional";I instanceof Promise?p.push(I.then(D=>N?Wv(D,d,x,h):jl(D,d,x))):N?Wv(I,d,x,h):jl(I,d,x)}}if(!u)return p.length?Promise.all(p).then(()=>d):d;let m=[],g=c.keySet,b=u._zod,y=b.def.type;for(let k of Object.keys(h)){if(g.has(k))continue;if(y==="never"){m.push(k);continue}let x=b.run({value:h[k],issues:[]},f);x instanceof Promise?p.push(x.then(E=>jl(E,d,k))):jl(x,d,k)}return m.length&&d.issues.push({code:"unrecognized_keys",keys:m,input:h,inst:e}),p.length?Promise.all(p).then(()=>d):d}});ql=S("$ZodUnion",(e,t)=>{ue.init(e,t),Ae(e._zod,"optin",()=>t.options.some(n=>n._zod.optin==="optional")?"optional":void 0),Ae(e._zod,"optout",()=>t.options.some(n=>n._zod.optout==="optional")?"optional":void 0),Ae(e._zod,"values",()=>{if(t.options.every(n=>n._zod.values))return new Set(t.options.flatMap(n=>Array.from(n._zod.values)))}),Ae(e._zod,"pattern",()=>{if(t.options.every(n=>n._zod.pattern)){let n=t.options.map(o=>o._zod.pattern);return new RegExp(`^(${n.map(o=>Ss(o.source)).join("|")})$`)}}),e._zod.parse=(n,o)=>{let r=!1,i=[];for(let s of t.options){let a=s._zod.run({value:n.value,issues:[]},o);if(a instanceof Promise)i.push(a),r=!0;else{if(a.issues.length===0)return a;i.push(a)}}return r?Promise.all(i).then(s=>Kv(s,n,e,o)):Kv(i,n,e,o)}}),Xh=S("$ZodDiscriminatedUnion",(e,t)=>{ql.init(e,t);let n=e._zod.parse;Ae(e._zod,"propValues",()=>{let r={};for(let i of t.options){let s=i._zod.propValues;if(!s||Object.keys(s).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(i)}"`);for(let[a,l]of Object.entries(s)){r[a]||(r[a]=new Set);for(let u of l)r[a].add(u)}}return r});let o=ws(()=>{let r=t.options,i=new Map;for(let s of r){let a=s._zod.propValues[t.discriminator];if(!a||a.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(s)}"`);for(let l of a){if(i.has(l))throw new Error(`Duplicate discriminator value "${String(l)}"`);i.set(l,s)}}return i});e._zod.parse=(r,i)=>{let s=r.value;if(!Bo(s))return r.issues.push({code:"invalid_type",expected:"object",input:s,inst:e}),r;let a=o.value.get(s?.[t.discriminator]);return a?a._zod.run(r,i):t.unionFallback?n(r,i):(r.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",input:s,path:[t.discriminator],inst:e}),r)}}),Yh=S("$ZodIntersection",(e,t)=>{ue.init(e,t),e._zod.parse=(n,o)=>{let r=n.value,i=t.left._zod.run({value:r,issues:[]},o),s=t.right._zod.run({value:r,issues:[]},o);return i instanceof Promise||s instanceof Promise?Promise.all([i,s]).then(([l,u])=>Jv(n,l,u)):Jv(n,i,s)}});Vr=S("$ZodTuple",(e,t)=>{ue.init(e,t);let n=t.items,o=n.length-[...n].reverse().findIndex(r=>r._zod.optin!=="optional");e._zod.parse=(r,i)=>{let s=r.value;if(!Array.isArray(s))return r.issues.push({input:s,inst:e,expected:"tuple",code:"invalid_type"}),r;r.value=[];let a=[];if(!t.rest){let u=s.length>n.length,c=s.length<o-1;if(u||c)return r.issues.push({input:s,inst:e,origin:"array",...u?{code:"too_big",maximum:n.length}:{code:"too_small",minimum:n.length}}),r}let l=-1;for(let u of n){if(l++,l>=s.length&&l>=o)continue;let c=u._zod.run({value:s[l],issues:[]},i);c instanceof Promise?a.push(c.then(d=>Bl(d,r,l))):Bl(c,r,l)}if(t.rest){let u=s.slice(n.length);for(let c of u){l++;let d=t.rest._zod.run({value:c,issues:[]},i);d instanceof Promise?a.push(d.then(f=>Bl(f,r,l))):Bl(d,r,l)}}return a.length?Promise.all(a).then(()=>r):r}});em=S("$ZodRecord",(e,t)=>{ue.init(e,t),e._zod.parse=(n,o)=>{let r=n.value;if(!Uo(r))return n.issues.push({expected:"record",code:"invalid_type",input:r,inst:e}),n;let i=[];if(t.keyType._zod.values){let s=t.keyType._zod.values;n.value={};for(let l of s)if(typeof l=="string"||typeof l=="number"||typeof l=="symbol"){let u=t.valueType._zod.run({value:r[l],issues:[]},o);u instanceof Promise?i.push(u.then(c=>{c.issues.length&&n.issues.push(...jt(l,c.issues)),n.value[l]=c.value})):(u.issues.length&&n.issues.push(...jt(l,u.issues)),n.value[l]=u.value)}let a;for(let l in r)s.has(l)||(a=a??[],a.push(l));a&&a.length>0&&n.issues.push({code:"unrecognized_keys",input:r,inst:e,keys:a})}else{n.value={};for(let s of Reflect.ownKeys(r)){if(s==="__proto__")continue;let a=t.keyType._zod.run({value:s,issues:[]},o);if(a instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(a.issues.length){n.issues.push({origin:"record",code:"invalid_key",issues:a.issues.map(u=>Vt(u,o,Qe())),input:s,path:[s],inst:e}),n.value[a.value]=a.value;continue}let l=t.valueType._zod.run({value:r[s],issues:[]},o);l instanceof Promise?i.push(l.then(u=>{u.issues.length&&n.issues.push(...jt(s,u.issues)),n.value[a.value]=u.value})):(l.issues.length&&n.issues.push(...jt(s,l.issues)),n.value[a.value]=l.value)}}return i.length?Promise.all(i).then(()=>n):n}}),tm=S("$ZodMap",(e,t)=>{ue.init(e,t),e._zod.parse=(n,o)=>{let r=n.value;if(!(r instanceof Map))return n.issues.push({expected:"map",code:"invalid_type",input:r,inst:e}),n;let i=[];n.value=new Map;for(let[s,a]of r){let l=t.keyType._zod.run({value:s,issues:[]},o),u=t.valueType._zod.run({value:a,issues:[]},o);l instanceof Promise||u instanceof Promise?i.push(Promise.all([l,u]).then(([c,d])=>{Gv(c,d,n,s,r,e,o)})):Gv(l,u,n,s,r,e,o)}return i.length?Promise.all(i).then(()=>n):n}});nm=S("$ZodSet",(e,t)=>{ue.init(e,t),e._zod.parse=(n,o)=>{let r=n.value;if(!(r instanceof Set))return n.issues.push({input:r,inst:e,expected:"set",code:"invalid_type"}),n;let i=[];n.value=new Set;for(let s of r){let a=t.valueType._zod.run({value:s,issues:[]},o);a instanceof Promise?i.push(a.then(l=>Qv(l,n))):Qv(a,n)}return i.length?Promise.all(i).then(()=>n):n}});rm=S("$ZodEnum",(e,t)=>{ue.init(e,t);let n=ks(t.entries);e._zod.values=new Set(n),e._zod.pattern=new RegExp(`^(${n.filter(o=>_s.has(typeof o)).map(o=>typeof o=="string"?Hn(o):o.toString()).join("|")})$`),e._zod.parse=(o,r)=>{let i=o.value;return e._zod.values.has(i)||o.issues.push({code:"invalid_value",values:n,input:i,inst:e}),o}}),om=S("$ZodLiteral",(e,t)=>{ue.init(e,t),e._zod.values=new Set(t.values),e._zod.pattern=new RegExp(`^(${t.values.map(n=>typeof n=="string"?Hn(n):n?n.toString():String(n)).join("|")})$`),e._zod.parse=(n,o)=>{let r=n.value;return e._zod.values.has(r)||n.issues.push({code:"invalid_value",values:t.values,input:r,inst:e}),n}}),im=S("$ZodFile",(e,t)=>{ue.init(e,t),e._zod.parse=(n,o)=>{let r=n.value;return r instanceof File||n.issues.push({expected:"file",code:"invalid_type",input:r,inst:e}),n}}),zs=S("$ZodTransform",(e,t)=>{ue.init(e,t),e._zod.parse=(n,o)=>{let r=t.transform(n.value,n);if(o.async)return(r instanceof Promise?r:Promise.resolve(r)).then(s=>(n.value=s,n));if(r instanceof Promise)throw new En;return n.value=r,n}}),sm=S("$ZodOptional",(e,t)=>{ue.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Ae(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Ae(e._zod,"pattern",()=>{let n=t.innerType._zod.pattern;return n?new RegExp(`^(${Ss(n.source)})?$`):void 0}),e._zod.parse=(n,o)=>t.innerType._zod.optin==="optional"?t.innerType._zod.run(n,o):n.value===void 0?n:t.innerType._zod.run(n,o)}),am=S("$ZodNullable",(e,t)=>{ue.init(e,t),Ae(e._zod,"optin",()=>t.innerType._zod.optin),Ae(e._zod,"optout",()=>t.innerType._zod.optout),Ae(e._zod,"pattern",()=>{let n=t.innerType._zod.pattern;return n?new RegExp(`^(${Ss(n.source)}|null)$`):void 0}),Ae(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,o)=>n.value===null?n:t.innerType._zod.run(n,o)}),lm=S("$ZodDefault",(e,t)=>{ue.init(e,t),e._zod.optin="optional",Ae(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,o)=>{if(n.value===void 0)return n.value=t.defaultValue,n;let r=t.innerType._zod.run(n,o);return r instanceof Promise?r.then(i=>Xv(i,t)):Xv(r,t)}});um=S("$ZodPrefault",(e,t)=>{ue.init(e,t),e._zod.optin="optional",Ae(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,o)=>(n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,o))}),cm=S("$ZodNonOptional",(e,t)=>{ue.init(e,t),Ae(e._zod,"values",()=>{let n=t.innerType._zod.values;return n?new Set([...n].filter(o=>o!==void 0)):void 0}),e._zod.parse=(n,o)=>{let r=t.innerType._zod.run(n,o);return r instanceof Promise?r.then(i=>Yv(i,e)):Yv(r,e)}});dm=S("$ZodSuccess",(e,t)=>{ue.init(e,t),e._zod.parse=(n,o)=>{let r=t.innerType._zod.run(n,o);return r instanceof Promise?r.then(i=>(n.value=i.issues.length===0,n)):(n.value=r.issues.length===0,n)}}),fm=S("$ZodCatch",(e,t)=>{ue.init(e,t),e._zod.optin="optional",Ae(e._zod,"optout",()=>t.innerType._zod.optout),Ae(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,o)=>{let r=t.innerType._zod.run(n,o);return r instanceof Promise?r.then(i=>(n.value=i.value,i.issues.length&&(n.value=t.catchValue({...n,error:{issues:i.issues.map(s=>Vt(s,o,Qe()))},input:n.value}),n.issues=[]),n)):(n.value=r.value,r.issues.length&&(n.value=t.catchValue({...n,error:{issues:r.issues.map(i=>Vt(i,o,Qe()))},input:n.value}),n.issues=[]),n)}}),pm=S("$ZodNaN",(e,t)=>{ue.init(e,t),e._zod.parse=(n,o)=>((typeof n.value!="number"||!Number.isNaN(n.value))&&n.issues.push({input:n.value,inst:e,expected:"nan",code:"invalid_type"}),n)}),Os=S("$ZodPipe",(e,t)=>{ue.init(e,t),Ae(e._zod,"values",()=>t.in._zod.values),Ae(e._zod,"optin",()=>t.in._zod.optin),Ae(e._zod,"optout",()=>t.out._zod.optout),e._zod.parse=(n,o)=>{let r=t.in._zod.run(n,o);return r instanceof Promise?r.then(i=>ex(i,t,o)):ex(r,t,o)}});hm=S("$ZodReadonly",(e,t)=>{ue.init(e,t),Ae(e._zod,"propValues",()=>t.innerType._zod.propValues),Ae(e._zod,"values",()=>t.innerType._zod.values),Ae(e._zod,"optin",()=>t.innerType._zod.optin),Ae(e._zod,"optout",()=>t.innerType._zod.optout),e._zod.parse=(n,o)=>{let r=t.innerType._zod.run(n,o);return r instanceof Promise?r.then(tx):tx(r)}});mm=S("$ZodTemplateLiteral",(e,t)=>{ue.init(e,t);let n=[];for(let o of t.parts)if(o instanceof ue){if(!o._zod.pattern)throw new Error(`Invalid template literal part, no pattern found: ${[...o._zod.traits].shift()}`);let r=o._zod.pattern instanceof RegExp?o._zod.pattern.source:o._zod.pattern;if(!r)throw new Error(`Invalid template literal part: ${o._zod.traits}`);let i=r.startsWith("^")?1:0,s=r.endsWith("$")?r.length-1:r.length;n.push(r.slice(i,s))}else if(o===null||hp.has(typeof o))n.push(Hn(`${o}`));else throw new Error(`Invalid template literal part: ${o}`);e._zod.pattern=new RegExp(`^${n.join("")}$`),e._zod.parse=(o,r)=>typeof o.value!="string"?(o.issues.push({input:o.value,inst:e,expected:"template_literal",code:"invalid_type"}),o):(e._zod.pattern.lastIndex=0,e._zod.pattern.test(o.value)||o.issues.push({input:o.value,inst:e,code:"invalid_format",format:"template_literal",pattern:e._zod.pattern.source}),o)}),gm=S("$ZodPromise",(e,t)=>{ue.init(e,t),e._zod.parse=(n,o)=>Promise.resolve(n.value).then(r=>t.innerType._zod.run({value:r,issues:[]},o))}),bm=S("$ZodLazy",(e,t)=>{ue.init(e,t),Ae(e._zod,"innerType",()=>t.getter()),Ae(e._zod,"pattern",()=>e._zod.innerType._zod.pattern),Ae(e._zod,"propValues",()=>e._zod.innerType._zod.propValues),Ae(e._zod,"optin",()=>e._zod.innerType._zod.optin),Ae(e._zod,"optout",()=>e._zod.innerType._zod.optout),e._zod.parse=(n,o)=>e._zod.innerType._zod.run(n,o)}),ym=S("$ZodCustom",(e,t)=>{Ze.init(e,t),ue.init(e,t),e._zod.parse=(n,o)=>n,e._zod.check=n=>{let o=n.value,r=t.fn(o);if(r instanceof Promise)return r.then(i=>nx(i,n,o,e));nx(r,n,o,e)}})});function sx(){return{localeError:f3()}}var f3,ax=K(()=>{ie();f3=()=>{let e={string:{unit:"\u062D\u0631\u0641",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},file:{unit:"\u0628\u0627\u064A\u062A",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},array:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},set:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"number";case"object":{if(Array.isArray(r))return"array";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"\u0645\u062F\u062E\u0644",email:"\u0628\u0631\u064A\u062F \u0625\u0644\u0643\u062A\u0631\u0648\u0646\u064A",url:"\u0631\u0627\u0628\u0637",emoji:"\u0625\u064A\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u064A\u062E \u0648\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",date:"\u062A\u0627\u0631\u064A\u062E \u0628\u0645\u0639\u064A\u0627\u0631 ISO",time:"\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",duration:"\u0645\u062F\u0629 \u0628\u0645\u0639\u064A\u0627\u0631 ISO",ipv4:"\u0639\u0646\u0648\u0627\u0646 IPv4",ipv6:"\u0639\u0646\u0648\u0627\u0646 IPv6",cidrv4:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv4",cidrv6:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv6",base64:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64-encoded",base64url:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64url-encoded",json_string:"\u0646\u064E\u0635 \u0639\u0644\u0649 \u0647\u064A\u0626\u0629 JSON",e164:"\u0631\u0642\u0645 \u0647\u0627\u062A\u0641 \u0628\u0645\u0639\u064A\u0627\u0631 E.164",jwt:"JWT",template_literal:"\u0645\u062F\u062E\u0644"};return r=>{switch(r.code){case"invalid_type":return`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${r.expected}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${n(r.input)}`;case"invalid_value":return r.values.length===1?`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${j(r.values[0])}`:`\u0627\u062E\u062A\u064A\u0627\u0631 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062A\u0648\u0642\u0639 \u0627\u0646\u062A\u0642\u0627\u0621 \u0623\u062D\u062F \u0647\u0630\u0647 \u0627\u0644\u062E\u064A\u0627\u0631\u0627\u062A: ${$(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?` \u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${r.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${i} ${r.maximum.toString()} ${s.unit??"\u0639\u0646\u0635\u0631"}`:`\u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${r.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${i} ${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${r.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${i} ${r.minimum.toString()} ${s.unit}`:`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${r.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${i} ${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0628\u062F\u0623 \u0628\u0640 "${r.prefix}"`:i.format==="ends_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0646\u062A\u0647\u064A \u0628\u0640 "${i.suffix}"`:i.format==="includes"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u062A\u0636\u0645\u0651\u064E\u0646 "${i.includes}"`:i.format==="regex"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0637\u0627\u0628\u0642 \u0627\u0644\u0646\u0645\u0637 ${i.pattern}`:`${o[i.format]??r.format} \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644`}case"not_multiple_of":return`\u0631\u0642\u0645 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0643\u0648\u0646 \u0645\u0646 \u0645\u0636\u0627\u0639\u0641\u0627\u062A ${r.divisor}`;case"unrecognized_keys":return`\u0645\u0639\u0631\u0641${r.keys.length>1?"\u0627\u062A":""} \u063A\u0631\u064A\u0628${r.keys.length>1?"\u0629":""}: ${$(r.keys,"\u060C ")}`;case"invalid_key":return`\u0645\u0639\u0631\u0641 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${r.origin}`;case"invalid_union":return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644";case"invalid_element":return`\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${r.origin}`;default:return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644"}}}});function lx(){return{localeError:p3()}}var p3,ux=K(()=>{ie();p3=()=>{let e={string:{unit:"simvol",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"element",verb:"olmal\u0131d\u0131r"},set:{unit:"element",verb:"olmal\u0131d\u0131r"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"number";case"object":{if(Array.isArray(r))return"array";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"};return r=>{switch(r.code){case"invalid_type":return`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${r.expected}, daxil olan ${n(r.input)}`;case"invalid_value":return r.values.length===1?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${j(r.values[0])}`:`Yanl\u0131\u015F se\xE7im: a\u015Fa\u011F\u0131dak\u0131lardan biri olmal\u0131d\u0131r: ${$(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${r.origin??"d\u0259y\u0259r"} ${i}${r.maximum.toString()} ${s.unit??"element"}`:`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${r.origin??"d\u0259y\u0259r"} ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${r.origin} ${i}${r.minimum.toString()} ${s.unit}`:`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${r.origin} ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Yanl\u0131\u015F m\u0259tn: "${i.prefix}" il\u0259 ba\u015Flamal\u0131d\u0131r`:i.format==="ends_with"?`Yanl\u0131\u015F m\u0259tn: "${i.suffix}" il\u0259 bitm\u0259lidir`:i.format==="includes"?`Yanl\u0131\u015F m\u0259tn: "${i.includes}" daxil olmal\u0131d\u0131r`:i.format==="regex"?`Yanl\u0131\u015F m\u0259tn: ${i.pattern} \u015Fablonuna uy\u011Fun olmal\u0131d\u0131r`:`Yanl\u0131\u015F ${o[i.format]??r.format}`}case"not_multiple_of":return`Yanl\u0131\u015F \u0259d\u0259d: ${r.divisor} il\u0259 b\xF6l\xFCn\u0259 bil\u0259n olmal\u0131d\u0131r`;case"unrecognized_keys":return`Tan\u0131nmayan a\xE7ar${r.keys.length>1?"lar":""}: ${$(r.keys,", ")}`;case"invalid_key":return`${r.origin} daxilind\u0259 yanl\u0131\u015F a\xE7ar`;case"invalid_union":return"Yanl\u0131\u015F d\u0259y\u0259r";case"invalid_element":return`${r.origin} daxilind\u0259 yanl\u0131\u015F d\u0259y\u0259r`;default:return"Yanl\u0131\u015F d\u0259y\u0259r"}}}});function cx(e,t,n,o){let r=Math.abs(e),i=r%10,s=r%100;return s>=11&&s<=19?o:i===1?t:i>=2&&i<=4?n:o}function dx(){return{localeError:h3()}}var h3,fx=K(()=>{ie();h3=()=>{let e={string:{unit:{one:"\u0441\u0456\u043C\u0432\u0430\u043B",few:"\u0441\u0456\u043C\u0432\u0430\u043B\u044B",many:"\u0441\u0456\u043C\u0432\u0430\u043B\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u044B",many:"\u0431\u0430\u0439\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"\u043B\u0456\u043A";case"object":{if(Array.isArray(r))return"\u043C\u0430\u0441\u0456\u045E";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"\u0443\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0430\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0456 \u0447\u0430\u0441",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0447\u0430\u0441",duration:"ISO \u043F\u0440\u0430\u0446\u044F\u0433\u043B\u0430\u0441\u0446\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0430\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0430\u0441",cidrv4:"IPv4 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",base64:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64",base64url:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64url",json_string:"JSON \u0440\u0430\u0434\u043E\u043A",e164:"\u043D\u0443\u043C\u0430\u0440 E.164",jwt:"JWT",template_literal:"\u0443\u0432\u043E\u0434"};return r=>{switch(r.code){case"invalid_type":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F ${r.expected}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${n(r.input)}`;case"invalid_value":return r.values.length===1?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F ${j(r.values[0])}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0432\u0430\u0440\u044B\u044F\u043D\u0442: \u0447\u0430\u043A\u0430\u045E\u0441\u044F \u0430\u0434\u0437\u0456\u043D \u0437 ${$(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);if(s){let a=Number(r.maximum),l=cx(a,s.unit.one,s.unit.few,s.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${r.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${s.verb} ${i}${r.maximum.toString()} ${l}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${r.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);if(s){let a=Number(r.minimum),l=cx(a,s.unit.one,s.unit.few,s.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${r.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${s.verb} ${i}${r.minimum.toString()} ${l}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${r.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u043F\u0430\u0447\u044B\u043D\u0430\u0446\u0446\u0430 \u0437 "${i.prefix}"`:i.format==="ends_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u0430\u043A\u0430\u043D\u0447\u0432\u0430\u0446\u0446\u0430 \u043D\u0430 "${i.suffix}"`:i.format==="includes"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u043C\u044F\u0448\u0447\u0430\u0446\u044C "${i.includes}"`:i.format==="regex"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0430\u0434\u043F\u0430\u0432\u044F\u0434\u0430\u0446\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${i.pattern}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B ${o[i.format]??r.format}`}case"not_multiple_of":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043B\u0456\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0431\u044B\u0446\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${r.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u0430\u0437\u043D\u0430\u043D\u044B ${r.keys.length>1?"\u043A\u043B\u044E\u0447\u044B":"\u043A\u043B\u044E\u0447"}: ${$(r.keys,", ")}`;case"invalid_key":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043A\u043B\u044E\u0447 \u0443 ${r.origin}`;case"invalid_union":return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434";case"invalid_element":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u0430\u0435 \u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435 \u045E ${r.origin}`;default:return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434"}}}});function px(){return{localeError:m3()}}var m3,hx=K(()=>{ie();m3=()=>{let e={string:{unit:"car\xE0cters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"number";case"object":{if(Array.isArray(r))return"array";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"entrada",email:"adre\xE7a electr\xF2nica",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i hora ISO",date:"data ISO",time:"hora ISO",duration:"durada ISO",ipv4:"adre\xE7a IPv4",ipv6:"adre\xE7a IPv6",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"};return r=>{switch(r.code){case"invalid_type":return`Tipus inv\xE0lid: s'esperava ${r.expected}, s'ha rebut ${n(r.input)}`;case"invalid_value":return r.values.length===1?`Valor inv\xE0lid: s'esperava ${j(r.values[0])}`:`Opci\xF3 inv\xE0lida: s'esperava una de ${$(r.values," o ")}`;case"too_big":{let i=r.inclusive?"com a m\xE0xim":"menys de",s=t(r.origin);return s?`Massa gran: s'esperava que ${r.origin??"el valor"} contingu\xE9s ${i} ${r.maximum.toString()} ${s.unit??"elements"}`:`Massa gran: s'esperava que ${r.origin??"el valor"} fos ${i} ${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?"com a m\xEDnim":"m\xE9s de",s=t(r.origin);return s?`Massa petit: s'esperava que ${r.origin} contingu\xE9s ${i} ${r.minimum.toString()} ${s.unit}`:`Massa petit: s'esperava que ${r.origin} fos ${i} ${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Format inv\xE0lid: ha de comen\xE7ar amb "${i.prefix}"`:i.format==="ends_with"?`Format inv\xE0lid: ha d'acabar amb "${i.suffix}"`:i.format==="includes"?`Format inv\xE0lid: ha d'incloure "${i.includes}"`:i.format==="regex"?`Format inv\xE0lid: ha de coincidir amb el patr\xF3 ${i.pattern}`:`Format inv\xE0lid per a ${o[i.format]??r.format}`}case"not_multiple_of":return`N\xFAmero inv\xE0lid: ha de ser m\xFAltiple de ${r.divisor}`;case"unrecognized_keys":return`Clau${r.keys.length>1?"s":""} no reconeguda${r.keys.length>1?"s":""}: ${$(r.keys,", ")}`;case"invalid_key":return`Clau inv\xE0lida a ${r.origin}`;case"invalid_union":return"Entrada inv\xE0lida";case"invalid_element":return`Element inv\xE0lid a ${r.origin}`;default:return"Entrada inv\xE0lida"}}}});function mx(){return{localeError:g3()}}var g3,gx=K(()=>{ie();g3=()=>{let e={string:{unit:"znak\u016F",verb:"m\xEDt"},file:{unit:"bajt\u016F",verb:"m\xEDt"},array:{unit:"prvk\u016F",verb:"m\xEDt"},set:{unit:"prvk\u016F",verb:"m\xEDt"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"\u010D\xEDslo";case"string":return"\u0159et\u011Bzec";case"boolean":return"boolean";case"bigint":return"bigint";case"function":return"funkce";case"symbol":return"symbol";case"undefined":return"undefined";case"object":{if(Array.isArray(r))return"pole";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"regul\xE1rn\xED v\xFDraz",email:"e-mailov\xE1 adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"datum a \u010Das ve form\xE1tu ISO",date:"datum ve form\xE1tu ISO",time:"\u010Das ve form\xE1tu ISO",duration:"doba trv\xE1n\xED ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64",base64url:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64url",json_string:"\u0159et\u011Bzec ve form\xE1tu JSON",e164:"\u010D\xEDslo E.164",jwt:"JWT",template_literal:"vstup"};return r=>{switch(r.code){case"invalid_type":return`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${r.expected}, obdr\u017Eeno ${n(r.input)}`;case"invalid_value":return r.values.length===1?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${j(r.values[0])}`:`Neplatn\xE1 mo\u017Enost: o\u010Dek\xE1v\xE1na jedna z hodnot ${$(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${r.origin??"hodnota"} mus\xED m\xEDt ${i}${r.maximum.toString()} ${s.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${r.origin??"hodnota"} mus\xED b\xFDt ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${r.origin??"hodnota"} mus\xED m\xEDt ${i}${r.minimum.toString()} ${s.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${r.origin??"hodnota"} mus\xED b\xFDt ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED za\u010D\xEDnat na "${i.prefix}"`:i.format==="ends_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED kon\u010Dit na "${i.suffix}"`:i.format==="includes"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED obsahovat "${i.includes}"`:i.format==="regex"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED odpov\xEDdat vzoru ${i.pattern}`:`Neplatn\xFD form\xE1t ${o[i.format]??r.format}`}case"not_multiple_of":return`Neplatn\xE9 \u010D\xEDslo: mus\xED b\xFDt n\xE1sobkem ${r.divisor}`;case"unrecognized_keys":return`Nezn\xE1m\xE9 kl\xED\u010De: ${$(r.keys,", ")}`;case"invalid_key":return`Neplatn\xFD kl\xED\u010D v ${r.origin}`;case"invalid_union":return"Neplatn\xFD vstup";case"invalid_element":return`Neplatn\xE1 hodnota v ${r.origin}`;default:return"Neplatn\xFD vstup"}}}});function bx(){return{localeError:b3()}}var b3,yx=K(()=>{ie();b3=()=>{let e={string:{unit:"Zeichen",verb:"zu haben"},file:{unit:"Bytes",verb:"zu haben"},array:{unit:"Elemente",verb:"zu haben"},set:{unit:"Elemente",verb:"zu haben"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"Zahl";case"object":{if(Array.isArray(r))return"Array";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"Eingabe",email:"E-Mail-Adresse",url:"URL",emoji:"Emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-Datum und -Uhrzeit",date:"ISO-Datum",time:"ISO-Uhrzeit",duration:"ISO-Dauer",ipv4:"IPv4-Adresse",ipv6:"IPv6-Adresse",cidrv4:"IPv4-Bereich",cidrv6:"IPv6-Bereich",base64:"Base64-codierter String",base64url:"Base64-URL-codierter String",json_string:"JSON-String",e164:"E.164-Nummer",jwt:"JWT",template_literal:"Eingabe"};return r=>{switch(r.code){case"invalid_type":return`Ung\xFCltige Eingabe: erwartet ${r.expected}, erhalten ${n(r.input)}`;case"invalid_value":return r.values.length===1?`Ung\xFCltige Eingabe: erwartet ${j(r.values[0])}`:`Ung\xFCltige Option: erwartet eine von ${$(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`Zu gro\xDF: erwartet, dass ${r.origin??"Wert"} ${i}${r.maximum.toString()} ${s.unit??"Elemente"} hat`:`Zu gro\xDF: erwartet, dass ${r.origin??"Wert"} ${i}${r.maximum.toString()} ist`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`Zu klein: erwartet, dass ${r.origin} ${i}${r.minimum.toString()} ${s.unit} hat`:`Zu klein: erwartet, dass ${r.origin} ${i}${r.minimum.toString()} ist`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Ung\xFCltiger String: muss mit "${i.prefix}" beginnen`:i.format==="ends_with"?`Ung\xFCltiger String: muss mit "${i.suffix}" enden`:i.format==="includes"?`Ung\xFCltiger String: muss "${i.includes}" enthalten`:i.format==="regex"?`Ung\xFCltiger String: muss dem Muster ${i.pattern} entsprechen`:`Ung\xFCltig: ${o[i.format]??r.format}`}case"not_multiple_of":return`Ung\xFCltige Zahl: muss ein Vielfaches von ${r.divisor} sein`;case"unrecognized_keys":return`${r.keys.length>1?"Unbekannte Schl\xFCssel":"Unbekannter Schl\xFCssel"}: ${$(r.keys,", ")}`;case"invalid_key":return`Ung\xFCltiger Schl\xFCssel in ${r.origin}`;case"invalid_union":return"Ung\xFCltige Eingabe";case"invalid_element":return`Ung\xFCltiger Wert in ${r.origin}`;default:return"Ung\xFCltige Eingabe"}}}});function Zl(){return{localeError:v3()}}var y3,v3,vm=K(()=>{ie();y3=e=>{let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"number";case"object":{if(Array.isArray(e))return"array";if(e===null)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return t},v3=()=>{let e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"}};function t(o){return e[o]??null}let n={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"};return o=>{switch(o.code){case"invalid_type":return`Invalid input: expected ${o.expected}, received ${y3(o.input)}`;case"invalid_value":return o.values.length===1?`Invalid input: expected ${j(o.values[0])}`:`Invalid option: expected one of ${$(o.values,"|")}`;case"too_big":{let r=o.inclusive?"<=":"<",i=t(o.origin);return i?`Too big: expected ${o.origin??"value"} to have ${r}${o.maximum.toString()} ${i.unit??"elements"}`:`Too big: expected ${o.origin??"value"} to be ${r}${o.maximum.toString()}`}case"too_small":{let r=o.inclusive?">=":">",i=t(o.origin);return i?`Too small: expected ${o.origin} to have ${r}${o.minimum.toString()} ${i.unit}`:`Too small: expected ${o.origin} to be ${r}${o.minimum.toString()}`}case"invalid_format":{let r=o;return r.format==="starts_with"?`Invalid string: must start with "${r.prefix}"`:r.format==="ends_with"?`Invalid string: must end with "${r.suffix}"`:r.format==="includes"?`Invalid string: must include "${r.includes}"`:r.format==="regex"?`Invalid string: must match pattern ${r.pattern}`:`Invalid ${n[r.format]??o.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${o.divisor}`;case"unrecognized_keys":return`Unrecognized key${o.keys.length>1?"s":""}: ${$(o.keys,", ")}`;case"invalid_key":return`Invalid key in ${o.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${o.origin}`;default:return"Invalid input"}}}});function vx(){return{localeError:k3()}}var x3,k3,xx=K(()=>{ie();x3=e=>{let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"nombro";case"object":{if(Array.isArray(e))return"tabelo";if(e===null)return"senvalora";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return t},k3=()=>{let e={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function t(o){return e[o]??null}let n={regex:"enigo",email:"retadreso",url:"URL",emoji:"emo\u011Dio",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datotempo",date:"ISO-dato",time:"ISO-tempo",duration:"ISO-da\u016Dro",ipv4:"IPv4-adreso",ipv6:"IPv6-adreso",cidrv4:"IPv4-rango",cidrv6:"IPv6-rango",base64:"64-ume kodita karaktraro",base64url:"URL-64-ume kodita karaktraro",json_string:"JSON-karaktraro",e164:"E.164-nombro",jwt:"JWT",template_literal:"enigo"};return o=>{switch(o.code){case"invalid_type":return`Nevalida enigo: atendi\u011Dis ${o.expected}, ricevi\u011Dis ${x3(o.input)}`;case"invalid_value":return o.values.length===1?`Nevalida enigo: atendi\u011Dis ${j(o.values[0])}`:`Nevalida opcio: atendi\u011Dis unu el ${$(o.values,"|")}`;case"too_big":{let r=o.inclusive?"<=":"<",i=t(o.origin);return i?`Tro granda: atendi\u011Dis ke ${o.origin??"valoro"} havu ${r}${o.maximum.toString()} ${i.unit??"elementojn"}`:`Tro granda: atendi\u011Dis ke ${o.origin??"valoro"} havu ${r}${o.maximum.toString()}`}case"too_small":{let r=o.inclusive?">=":">",i=t(o.origin);return i?`Tro malgranda: atendi\u011Dis ke ${o.origin} havu ${r}${o.minimum.toString()} ${i.unit}`:`Tro malgranda: atendi\u011Dis ke ${o.origin} estu ${r}${o.minimum.toString()}`}case"invalid_format":{let r=o;return r.format==="starts_with"?`Nevalida karaktraro: devas komenci\u011Di per "${r.prefix}"`:r.format==="ends_with"?`Nevalida karaktraro: devas fini\u011Di per "${r.suffix}"`:r.format==="includes"?`Nevalida karaktraro: devas inkluzivi "${r.includes}"`:r.format==="regex"?`Nevalida karaktraro: devas kongrui kun la modelo ${r.pattern}`:`Nevalida ${n[r.format]??o.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${o.divisor}`;case"unrecognized_keys":return`Nekonata${o.keys.length>1?"j":""} \u015Dlosilo${o.keys.length>1?"j":""}: ${$(o.keys,", ")}`;case"invalid_key":return`Nevalida \u015Dlosilo en ${o.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${o.origin}`;default:return"Nevalida enigo"}}}});function kx(){return{localeError:w3()}}var w3,wx=K(()=>{ie();w3=()=>{let e={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"n\xFAmero";case"object":{if(Array.isArray(r))return"arreglo";if(r===null)return"nulo";if(Object.getPrototypeOf(r)!==Object.prototype)return r.constructor.name}}return i},o={regex:"entrada",email:"direcci\xF3n de correo electr\xF3nico",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"fecha y hora ISO",date:"fecha ISO",time:"hora ISO",duration:"duraci\xF3n ISO",ipv4:"direcci\xF3n IPv4",ipv6:"direcci\xF3n IPv6",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"};return r=>{switch(r.code){case"invalid_type":return`Entrada inv\xE1lida: se esperaba ${r.expected}, recibido ${n(r.input)}`;case"invalid_value":return r.values.length===1?`Entrada inv\xE1lida: se esperaba ${j(r.values[0])}`:`Opci\xF3n inv\xE1lida: se esperaba una de ${$(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`Demasiado grande: se esperaba que ${r.origin??"valor"} tuviera ${i}${r.maximum.toString()} ${s.unit??"elementos"}`:`Demasiado grande: se esperaba que ${r.origin??"valor"} fuera ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`Demasiado peque\xF1o: se esperaba que ${r.origin} tuviera ${i}${r.minimum.toString()} ${s.unit}`:`Demasiado peque\xF1o: se esperaba que ${r.origin} fuera ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Cadena inv\xE1lida: debe comenzar con "${i.prefix}"`:i.format==="ends_with"?`Cadena inv\xE1lida: debe terminar en "${i.suffix}"`:i.format==="includes"?`Cadena inv\xE1lida: debe incluir "${i.includes}"`:i.format==="regex"?`Cadena inv\xE1lida: debe coincidir con el patr\xF3n ${i.pattern}`:`Inv\xE1lido ${o[i.format]??r.format}`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: debe ser m\xFAltiplo de ${r.divisor}`;case"unrecognized_keys":return`Llave${r.keys.length>1?"s":""} desconocida${r.keys.length>1?"s":""}: ${$(r.keys,", ")}`;case"invalid_key":return`Llave inv\xE1lida en ${r.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido en ${r.origin}`;default:return"Entrada inv\xE1lida"}}}});function Sx(){return{localeError:S3()}}var S3,_x=K(()=>{ie();S3=()=>{let e={string:{unit:"\u06A9\u0627\u0631\u0627\u06A9\u062A\u0631",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},file:{unit:"\u0628\u0627\u06CC\u062A",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},array:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},set:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"\u0639\u062F\u062F";case"object":{if(Array.isArray(r))return"\u0622\u0631\u0627\u06CC\u0647";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"\u0648\u0631\u0648\u062F\u06CC",email:"\u0622\u062F\u0631\u0633 \u0627\u06CC\u0645\u06CC\u0644",url:"URL",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u06CC\u062E \u0648 \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",date:"\u062A\u0627\u0631\u06CC\u062E \u0627\u06CC\u0632\u0648",time:"\u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",duration:"\u0645\u062F\u062A \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",ipv4:"IPv4 \u0622\u062F\u0631\u0633",ipv6:"IPv6 \u0622\u062F\u0631\u0633",cidrv4:"IPv4 \u062F\u0627\u0645\u0646\u0647",cidrv6:"IPv6 \u062F\u0627\u0645\u0646\u0647",base64:"base64-encoded \u0631\u0634\u062A\u0647",base64url:"base64url-encoded \u0631\u0634\u062A\u0647",json_string:"JSON \u0631\u0634\u062A\u0647",e164:"E.164 \u0639\u062F\u062F",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u06CC"};return r=>{switch(r.code){case"invalid_type":return`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${r.expected} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${n(r.input)} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`;case"invalid_value":return r.values.length===1?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${j(r.values[0])} \u0645\u06CC\u200C\u0628\u0648\u062F`:`\u06AF\u0632\u06CC\u0646\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A \u06CC\u06A9\u06CC \u0627\u0632 ${$(r.values,"|")} \u0645\u06CC\u200C\u0628\u0648\u062F`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${r.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${i}${r.maximum.toString()} ${s.unit??"\u0639\u0646\u0635\u0631"} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${r.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${i}${r.maximum.toString()} \u0628\u0627\u0634\u062F`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${r.origin} \u0628\u0627\u06CC\u062F ${i}${r.minimum.toString()} ${s.unit} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${r.origin} \u0628\u0627\u06CC\u062F ${i}${r.minimum.toString()} \u0628\u0627\u0634\u062F`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${i.prefix}" \u0634\u0631\u0648\u0639 \u0634\u0648\u062F`:i.format==="ends_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${i.suffix}" \u062A\u0645\u0627\u0645 \u0634\u0648\u062F`:i.format==="includes"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0634\u0627\u0645\u0644 "${i.includes}" \u0628\u0627\u0634\u062F`:i.format==="regex"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 \u0627\u0644\u06AF\u0648\u06CC ${i.pattern} \u0645\u0637\u0627\u0628\u0642\u062A \u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F`:`${o[i.format]??r.format} \u0646\u0627\u0645\u0639\u062A\u0628\u0631`}case"not_multiple_of":return`\u0639\u062F\u062F \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0645\u0636\u0631\u0628 ${r.divisor} \u0628\u0627\u0634\u062F`;case"unrecognized_keys":return`\u06A9\u0644\u06CC\u062F${r.keys.length>1?"\u0647\u0627\u06CC":""} \u0646\u0627\u0634\u0646\u0627\u0633: ${$(r.keys,", ")}`;case"invalid_key":return`\u06A9\u0644\u06CC\u062F \u0646\u0627\u0634\u0646\u0627\u0633 \u062F\u0631 ${r.origin}`;case"invalid_union":return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631";case"invalid_element":return`\u0645\u0642\u062F\u0627\u0631 \u0646\u0627\u0645\u0639\u062A\u0628\u0631 \u062F\u0631 ${r.origin}`;default:return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631"}}}});function Ex(){return{localeError:_3()}}var _3,Cx=K(()=>{ie();_3=()=>{let e={string:{unit:"merkki\xE4",subject:"merkkijonon"},file:{unit:"tavua",subject:"tiedoston"},array:{unit:"alkiota",subject:"listan"},set:{unit:"alkiota",subject:"joukon"},number:{unit:"",subject:"luvun"},bigint:{unit:"",subject:"suuren kokonaisluvun"},int:{unit:"",subject:"kokonaisluvun"},date:{unit:"",subject:"p\xE4iv\xE4m\xE4\xE4r\xE4n"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"number";case"object":{if(Array.isArray(r))return"array";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"s\xE4\xE4nn\xF6llinen lauseke",email:"s\xE4hk\xF6postiosoite",url:"URL-osoite",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-aikaleima",date:"ISO-p\xE4iv\xE4m\xE4\xE4r\xE4",time:"ISO-aika",duration:"ISO-kesto",ipv4:"IPv4-osoite",ipv6:"IPv6-osoite",cidrv4:"IPv4-alue",cidrv6:"IPv6-alue",base64:"base64-koodattu merkkijono",base64url:"base64url-koodattu merkkijono",json_string:"JSON-merkkijono",e164:"E.164-luku",jwt:"JWT",template_literal:"templaattimerkkijono"};return r=>{switch(r.code){case"invalid_type":return`Virheellinen tyyppi: odotettiin ${r.expected}, oli ${n(r.input)}`;case"invalid_value":return r.values.length===1?`Virheellinen sy\xF6te: t\xE4ytyy olla ${j(r.values[0])}`:`Virheellinen valinta: t\xE4ytyy olla yksi seuraavista: ${$(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`Liian suuri: ${s.subject} t\xE4ytyy olla ${i}${r.maximum.toString()} ${s.unit}`.trim():`Liian suuri: arvon t\xE4ytyy olla ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`Liian pieni: ${s.subject} t\xE4ytyy olla ${i}${r.minimum.toString()} ${s.unit}`.trim():`Liian pieni: arvon t\xE4ytyy olla ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Virheellinen sy\xF6te: t\xE4ytyy alkaa "${i.prefix}"`:i.format==="ends_with"?`Virheellinen sy\xF6te: t\xE4ytyy loppua "${i.suffix}"`:i.format==="includes"?`Virheellinen sy\xF6te: t\xE4ytyy sis\xE4lt\xE4\xE4 "${i.includes}"`:i.format==="regex"?`Virheellinen sy\xF6te: t\xE4ytyy vastata s\xE4\xE4nn\xF6llist\xE4 lauseketta ${i.pattern}`:`Virheellinen ${o[i.format]??r.format}`}case"not_multiple_of":return`Virheellinen luku: t\xE4ytyy olla luvun ${r.divisor} monikerta`;case"unrecognized_keys":return`${r.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${$(r.keys,", ")}`;case"invalid_key":return"Virheellinen avain tietueessa";case"invalid_union":return"Virheellinen unioni";case"invalid_element":return"Virheellinen arvo joukossa";default:return"Virheellinen sy\xF6te"}}}});function Tx(){return{localeError:E3()}}var E3,Ax=K(()=>{ie();E3=()=>{let e={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"nombre";case"object":{if(Array.isArray(r))return"tableau";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"entr\xE9e",email:"adresse e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date et heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"};return r=>{switch(r.code){case"invalid_type":return`Entr\xE9e invalide : ${r.expected} attendu, ${n(r.input)} re\xE7u`;case"invalid_value":return r.values.length===1?`Entr\xE9e invalide : ${j(r.values[0])} attendu`:`Option invalide : une valeur parmi ${$(r.values,"|")} attendue`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`Trop grand : ${r.origin??"valeur"} doit ${s.verb} ${i}${r.maximum.toString()} ${s.unit??"\xE9l\xE9ment(s)"}`:`Trop grand : ${r.origin??"valeur"} doit \xEAtre ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`Trop petit : ${r.origin} doit ${s.verb} ${i}${r.minimum.toString()} ${s.unit}`:`Trop petit : ${r.origin} doit \xEAtre ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${i.prefix}"`:i.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${i.suffix}"`:i.format==="includes"?`Cha\xEEne invalide : doit inclure "${i.includes}"`:i.format==="regex"?`Cha\xEEne invalide : doit correspondre au mod\xE8le ${i.pattern}`:`${o[i.format]??r.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${r.divisor}`;case"unrecognized_keys":return`Cl\xE9${r.keys.length>1?"s":""} non reconnue${r.keys.length>1?"s":""} : ${$(r.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${r.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${r.origin}`;default:return"Entr\xE9e invalide"}}}});function Mx(){return{localeError:C3()}}var C3,$x=K(()=>{ie();C3=()=>{let e={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"number";case"object":{if(Array.isArray(r))return"array";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"entr\xE9e",email:"adresse courriel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date-heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"};return r=>{switch(r.code){case"invalid_type":return`Entr\xE9e invalide : attendu ${r.expected}, re\xE7u ${n(r.input)}`;case"invalid_value":return r.values.length===1?`Entr\xE9e invalide : attendu ${j(r.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${$(r.values,"|")}`;case"too_big":{let i=r.inclusive?"\u2264":"<",s=t(r.origin);return s?`Trop grand : attendu que ${r.origin??"la valeur"} ait ${i}${r.maximum.toString()} ${s.unit}`:`Trop grand : attendu que ${r.origin??"la valeur"} soit ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?"\u2265":">",s=t(r.origin);return s?`Trop petit : attendu que ${r.origin} ait ${i}${r.minimum.toString()} ${s.unit}`:`Trop petit : attendu que ${r.origin} soit ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${i.prefix}"`:i.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${i.suffix}"`:i.format==="includes"?`Cha\xEEne invalide : doit inclure "${i.includes}"`:i.format==="regex"?`Cha\xEEne invalide : doit correspondre au motif ${i.pattern}`:`${o[i.format]??r.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${r.divisor}`;case"unrecognized_keys":return`Cl\xE9${r.keys.length>1?"s":""} non reconnue${r.keys.length>1?"s":""} : ${$(r.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${r.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${r.origin}`;default:return"Entr\xE9e invalide"}}}});function Ix(){return{localeError:T3()}}var T3,Dx=K(()=>{ie();T3=()=>{let e={string:{unit:"\u05D0\u05D5\u05EA\u05D9\u05D5\u05EA",verb:"\u05DC\u05DB\u05DC\u05D5\u05DC"},file:{unit:"\u05D1\u05D9\u05D9\u05D8\u05D9\u05DD",verb:"\u05DC\u05DB\u05DC\u05D5\u05DC"},array:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",verb:"\u05DC\u05DB\u05DC\u05D5\u05DC"},set:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",verb:"\u05DC\u05DB\u05DC\u05D5\u05DC"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"number";case"object":{if(Array.isArray(r))return"array";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"\u05E7\u05DC\u05D8",email:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05D0\u05D9\u05DE\u05D9\u05D9\u05DC",url:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05E8\u05E9\u05EA",emoji:"\u05D0\u05D9\u05DE\u05D5\u05D2'\u05D9",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u05EA\u05D0\u05E8\u05D9\u05DA \u05D5\u05D6\u05DE\u05DF ISO",date:"\u05EA\u05D0\u05E8\u05D9\u05DA ISO",time:"\u05D6\u05DE\u05DF ISO",duration:"\u05DE\u05E9\u05DA \u05D6\u05DE\u05DF ISO",ipv4:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv4",ipv6:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv6",cidrv4:"\u05D8\u05D5\u05D5\u05D7 IPv4",cidrv6:"\u05D8\u05D5\u05D5\u05D7 IPv6",base64:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64",base64url:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64 \u05DC\u05DB\u05EA\u05D5\u05D1\u05D5\u05EA \u05E8\u05E9\u05EA",json_string:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA JSON",e164:"\u05DE\u05E1\u05E4\u05E8 E.164",jwt:"JWT",template_literal:"\u05E7\u05DC\u05D8"};return r=>{switch(r.code){case"invalid_type":return`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA ${r.expected}, \u05D4\u05EA\u05E7\u05D1\u05DC ${n(r.input)}`;case"invalid_value":return r.values.length===1?`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA ${j(r.values[0])}`:`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05D0\u05D7\u05EA \u05DE\u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA ${$(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${r.origin??"value"} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${i}${r.maximum.toString()} ${s.unit??"elements"}`:`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${r.origin??"value"} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${r.origin} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${i}${r.minimum.toString()} ${s.unit}`:`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${r.origin} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05E0\u05D4: \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D7\u05D9\u05DC \u05D1"${i.prefix}"`:i.format==="ends_with"?`\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05E0\u05D4: \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05E1\u05EA\u05D9\u05D9\u05DD \u05D1 "${i.suffix}"`:i.format==="includes"?`\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05E0\u05D4: \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05DB\u05DC\u05D5\u05DC "${i.includes}"`:i.format==="regex"?`\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05E0\u05D4: \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D0\u05D9\u05DD \u05DC\u05EA\u05D1\u05E0\u05D9\u05EA ${i.pattern}`:`${o[i.format]??r.format} \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF`}case"not_multiple_of":return`\u05DE\u05E1\u05E4\u05E8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA \u05DE\u05DB\u05E4\u05DC\u05D4 \u05E9\u05DC ${r.divisor}`;case"unrecognized_keys":return`\u05DE\u05E4\u05EA\u05D7${r.keys.length>1?"\u05D5\u05EA":""} \u05DC\u05D0 \u05DE\u05D6\u05D5\u05D4${r.keys.length>1?"\u05D9\u05DD":"\u05D4"}: ${$(r.keys,", ")}`;case"invalid_key":return`\u05DE\u05E4\u05EA\u05D7 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1${r.origin}`;case"invalid_union":return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF";case"invalid_element":return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1${r.origin}`;default:return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF"}}}});function Nx(){return{localeError:A3()}}var A3,zx=K(()=>{ie();A3=()=>{let e={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"sz\xE1m";case"object":{if(Array.isArray(r))return"t\xF6mb";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"bemenet",email:"email c\xEDm",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO id\u0151b\xE9lyeg",date:"ISO d\xE1tum",time:"ISO id\u0151",duration:"ISO id\u0151intervallum",ipv4:"IPv4 c\xEDm",ipv6:"IPv6 c\xEDm",cidrv4:"IPv4 tartom\xE1ny",cidrv6:"IPv6 tartom\xE1ny",base64:"base64-k\xF3dolt string",base64url:"base64url-k\xF3dolt string",json_string:"JSON string",e164:"E.164 sz\xE1m",jwt:"JWT",template_literal:"bemenet"};return r=>{switch(r.code){case"invalid_type":return`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${r.expected}, a kapott \xE9rt\xE9k ${n(r.input)}`;case"invalid_value":return r.values.length===1?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${j(r.values[0])}`:`\xC9rv\xE9nytelen opci\xF3: valamelyik \xE9rt\xE9k v\xE1rt ${$(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`T\xFAl nagy: ${r.origin??"\xE9rt\xE9k"} m\xE9rete t\xFAl nagy ${i}${r.maximum.toString()} ${s.unit??"elem"}`:`T\xFAl nagy: a bemeneti \xE9rt\xE9k ${r.origin??"\xE9rt\xE9k"} t\xFAl nagy: ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${r.origin} m\xE9rete t\xFAl kicsi ${i}${r.minimum.toString()} ${s.unit}`:`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${r.origin} t\xFAl kicsi ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\xC9rv\xE9nytelen string: "${i.prefix}" \xE9rt\xE9kkel kell kezd\u0151dnie`:i.format==="ends_with"?`\xC9rv\xE9nytelen string: "${i.suffix}" \xE9rt\xE9kkel kell v\xE9gz\u0151dnie`:i.format==="includes"?`\xC9rv\xE9nytelen string: "${i.includes}" \xE9rt\xE9ket kell tartalmaznia`:i.format==="regex"?`\xC9rv\xE9nytelen string: ${i.pattern} mint\xE1nak kell megfelelnie`:`\xC9rv\xE9nytelen ${o[i.format]??r.format}`}case"not_multiple_of":return`\xC9rv\xE9nytelen sz\xE1m: ${r.divisor} t\xF6bbsz\xF6r\xF6s\xE9nek kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${r.keys.length>1?"s":""}: ${$(r.keys,", ")}`;case"invalid_key":return`\xC9rv\xE9nytelen kulcs ${r.origin}`;case"invalid_union":return"\xC9rv\xE9nytelen bemenet";case"invalid_element":return`\xC9rv\xE9nytelen \xE9rt\xE9k: ${r.origin}`;default:return"\xC9rv\xE9nytelen bemenet"}}}});function Ox(){return{localeError:M3()}}var M3,Rx=K(()=>{ie();M3=()=>{let e={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"number";case"object":{if(Array.isArray(r))return"array";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"input",email:"alamat email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tanggal dan waktu format ISO",date:"tanggal format ISO",time:"jam format ISO",duration:"durasi format ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"rentang alamat IPv4",cidrv6:"rentang alamat IPv6",base64:"string dengan enkode base64",base64url:"string dengan enkode base64url",json_string:"string JSON",e164:"angka E.164",jwt:"JWT",template_literal:"input"};return r=>{switch(r.code){case"invalid_type":return`Input tidak valid: diharapkan ${r.expected}, diterima ${n(r.input)}`;case"invalid_value":return r.values.length===1?`Input tidak valid: diharapkan ${j(r.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${$(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`Terlalu besar: diharapkan ${r.origin??"value"} memiliki ${i}${r.maximum.toString()} ${s.unit??"elemen"}`:`Terlalu besar: diharapkan ${r.origin??"value"} menjadi ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`Terlalu kecil: diharapkan ${r.origin} memiliki ${i}${r.minimum.toString()} ${s.unit}`:`Terlalu kecil: diharapkan ${r.origin} menjadi ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`String tidak valid: harus dimulai dengan "${i.prefix}"`:i.format==="ends_with"?`String tidak valid: harus berakhir dengan "${i.suffix}"`:i.format==="includes"?`String tidak valid: harus menyertakan "${i.includes}"`:i.format==="regex"?`String tidak valid: harus sesuai pola ${i.pattern}`:`${o[i.format]??r.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${r.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${r.keys.length>1?"s":""}: ${$(r.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${r.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${r.origin}`;default:return"Input tidak valid"}}}});function Px(){return{localeError:$3()}}var $3,Lx=K(()=>{ie();$3=()=>{let e={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"numero";case"object":{if(Array.isArray(r))return"vettore";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"input",email:"indirizzo email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e ora ISO",date:"data ISO",time:"ora ISO",duration:"durata ISO",ipv4:"indirizzo IPv4",ipv6:"indirizzo IPv6",cidrv4:"intervallo IPv4",cidrv6:"intervallo IPv6",base64:"stringa codificata in base64",base64url:"URL codificata in base64",json_string:"stringa JSON",e164:"numero E.164",jwt:"JWT",template_literal:"input"};return r=>{switch(r.code){case"invalid_type":return`Input non valido: atteso ${r.expected}, ricevuto ${n(r.input)}`;case"invalid_value":return r.values.length===1?`Input non valido: atteso ${j(r.values[0])}`:`Opzione non valida: atteso uno tra ${$(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`Troppo grande: ${r.origin??"valore"} deve avere ${i}${r.maximum.toString()} ${s.unit??"elementi"}`:`Troppo grande: ${r.origin??"valore"} deve essere ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`Troppo piccolo: ${r.origin} deve avere ${i}${r.minimum.toString()} ${s.unit}`:`Troppo piccolo: ${r.origin} deve essere ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Stringa non valida: deve iniziare con "${i.prefix}"`:i.format==="ends_with"?`Stringa non valida: deve terminare con "${i.suffix}"`:i.format==="includes"?`Stringa non valida: deve includere "${i.includes}"`:i.format==="regex"?`Stringa non valida: deve corrispondere al pattern ${i.pattern}`:`Invalid ${o[i.format]??r.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${r.divisor}`;case"unrecognized_keys":return`Chiav${r.keys.length>1?"i":"e"} non riconosciut${r.keys.length>1?"e":"a"}: ${$(r.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${r.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${r.origin}`;default:return"Input non valido"}}}});function Fx(){return{localeError:I3()}}var I3,jx=K(()=>{ie();I3=()=>{let e={string:{unit:"\u6587\u5B57",verb:"\u3067\u3042\u308B"},file:{unit:"\u30D0\u30A4\u30C8",verb:"\u3067\u3042\u308B"},array:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"},set:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"\u6570\u5024";case"object":{if(Array.isArray(r))return"\u914D\u5217";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"\u5165\u529B\u5024",email:"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9",url:"URL",emoji:"\u7D75\u6587\u5B57",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u6642",date:"ISO\u65E5\u4ED8",time:"ISO\u6642\u523B",duration:"ISO\u671F\u9593",ipv4:"IPv4\u30A2\u30C9\u30EC\u30B9",ipv6:"IPv6\u30A2\u30C9\u30EC\u30B9",cidrv4:"IPv4\u7BC4\u56F2",cidrv6:"IPv6\u7BC4\u56F2",base64:"base64\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",base64url:"base64url\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",json_string:"JSON\u6587\u5B57\u5217",e164:"E.164\u756A\u53F7",jwt:"JWT",template_literal:"\u5165\u529B\u5024"};return r=>{switch(r.code){case"invalid_type":return`\u7121\u52B9\u306A\u5165\u529B: ${r.expected}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${n(r.input)}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`;case"invalid_value":return r.values.length===1?`\u7121\u52B9\u306A\u5165\u529B: ${j(r.values[0])}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u9078\u629E: ${$(r.values,"\u3001")}\u306E\u3044\u305A\u308C\u304B\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"too_big":{let i=r.inclusive?"\u4EE5\u4E0B\u3067\u3042\u308B":"\u3088\u308A\u5C0F\u3055\u3044",s=t(r.origin);return s?`\u5927\u304D\u3059\u304E\u308B\u5024: ${r.origin??"\u5024"}\u306F${r.maximum.toString()}${s.unit??"\u8981\u7D20"}${i}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5927\u304D\u3059\u304E\u308B\u5024: ${r.origin??"\u5024"}\u306F${r.maximum.toString()}${i}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"too_small":{let i=r.inclusive?"\u4EE5\u4E0A\u3067\u3042\u308B":"\u3088\u308A\u5927\u304D\u3044",s=t(r.origin);return s?`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${r.origin}\u306F${r.minimum.toString()}${s.unit}${i}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${r.origin}\u306F${r.minimum.toString()}${i}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${i.prefix}"\u3067\u59CB\u307E\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:i.format==="ends_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${i.suffix}"\u3067\u7D42\u308F\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:i.format==="includes"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${i.includes}"\u3092\u542B\u3080\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:i.format==="regex"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: \u30D1\u30BF\u30FC\u30F3${i.pattern}\u306B\u4E00\u81F4\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u7121\u52B9\u306A${o[i.format]??r.format}`}case"not_multiple_of":return`\u7121\u52B9\u306A\u6570\u5024: ${r.divisor}\u306E\u500D\u6570\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"unrecognized_keys":return`\u8A8D\u8B58\u3055\u308C\u3066\u3044\u306A\u3044\u30AD\u30FC${r.keys.length>1?"\u7FA4":""}: ${$(r.keys,"\u3001")}`;case"invalid_key":return`${r.origin}\u5185\u306E\u7121\u52B9\u306A\u30AD\u30FC`;case"invalid_union":return"\u7121\u52B9\u306A\u5165\u529B";case"invalid_element":return`${r.origin}\u5185\u306E\u7121\u52B9\u306A\u5024`;default:return"\u7121\u52B9\u306A\u5165\u529B"}}}});function Bx(){return{localeError:D3()}}var D3,Ux=K(()=>{ie();D3=()=>{let e={string:{unit:"\u178F\u17BD\u17A2\u1780\u17D2\u179F\u179A",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},file:{unit:"\u1794\u17C3",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},array:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},set:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"\u1798\u17B7\u1793\u1798\u17C2\u1793\u1787\u17B6\u179B\u17C1\u1781 (NaN)":"\u179B\u17C1\u1781";case"object":{if(Array.isArray(r))return"\u17A2\u17B6\u179A\u17C1 (Array)";if(r===null)return"\u1782\u17D2\u1798\u17B6\u1793\u178F\u1798\u17D2\u179B\u17C3 (null)";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B",email:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793\u17A2\u17CA\u17B8\u1798\u17C2\u179B",url:"URL",emoji:"\u179F\u1789\u17D2\u1789\u17B6\u17A2\u17B6\u179A\u1798\u17D2\u1798\u178E\u17CD",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 \u1793\u17B7\u1784\u1798\u17C9\u17C4\u1784 ISO",date:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 ISO",time:"\u1798\u17C9\u17C4\u1784 ISO",duration:"\u179A\u1799\u17C8\u1796\u17C1\u179B ISO",ipv4:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",ipv6:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",cidrv4:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",cidrv6:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",base64:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64",base64url:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64url",json_string:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A JSON",e164:"\u179B\u17C1\u1781 E.164",jwt:"JWT",template_literal:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B"};return r=>{switch(r.code){case"invalid_type":return`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${r.expected} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${n(r.input)}`;case"invalid_value":return r.values.length===1?`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${j(r.values[0])}`:`\u1787\u1798\u17D2\u179A\u17BE\u179F\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1787\u17B6\u1798\u17BD\u1799\u1780\u17D2\u1793\u17BB\u1784\u1785\u17C6\u178E\u17C4\u1798 ${$(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${r.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${i} ${r.maximum.toString()} ${s.unit??"\u1792\u17B6\u178F\u17BB"}`:`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${r.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${i} ${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${r.origin} ${i} ${r.minimum.toString()} ${s.unit}`:`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${r.origin} ${i} ${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1785\u17B6\u1794\u17CB\u1795\u17D2\u178F\u17BE\u1798\u178A\u17C4\u1799 "${i.prefix}"`:i.format==="ends_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1794\u1789\u17D2\u1785\u1794\u17CB\u178A\u17C4\u1799 "${i.suffix}"`:i.format==="includes"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1798\u17B6\u1793 "${i.includes}"`:i.format==="regex"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1795\u17D2\u1782\u17BC\u1795\u17D2\u1782\u1784\u1793\u17B9\u1784\u1791\u1798\u17D2\u179A\u1784\u17CB\u178A\u17C2\u179B\u1794\u17B6\u1793\u1780\u17C6\u178E\u178F\u17CB ${i.pattern}`:`\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 ${o[i.format]??r.format}`}case"not_multiple_of":return`\u179B\u17C1\u1781\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1787\u17B6\u1796\u17A0\u17BB\u1782\u17BB\u178E\u1793\u17C3 ${r.divisor}`;case"unrecognized_keys":return`\u179A\u1780\u1783\u17BE\u1789\u179F\u17C4\u1798\u17B7\u1793\u179F\u17D2\u1782\u17B6\u179B\u17CB\u17D6 ${$(r.keys,", ")}`;case"invalid_key":return`\u179F\u17C4\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${r.origin}`;case"invalid_union":return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C";case"invalid_element":return`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${r.origin}`;default:return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C"}}}});function Hx(){return{localeError:N3()}}var N3,qx=K(()=>{ie();N3=()=>{let e={string:{unit:"\uBB38\uC790",verb:"to have"},file:{unit:"\uBC14\uC774\uD2B8",verb:"to have"},array:{unit:"\uAC1C",verb:"to have"},set:{unit:"\uAC1C",verb:"to have"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"number";case"object":{if(Array.isArray(r))return"array";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"\uC785\uB825",email:"\uC774\uBA54\uC77C \uC8FC\uC18C",url:"URL",emoji:"\uC774\uBAA8\uC9C0",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \uB0A0\uC9DC\uC2DC\uAC04",date:"ISO \uB0A0\uC9DC",time:"ISO \uC2DC\uAC04",duration:"ISO \uAE30\uAC04",ipv4:"IPv4 \uC8FC\uC18C",ipv6:"IPv6 \uC8FC\uC18C",cidrv4:"IPv4 \uBC94\uC704",cidrv6:"IPv6 \uBC94\uC704",base64:"base64 \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",base64url:"base64url \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",json_string:"JSON \uBB38\uC790\uC5F4",e164:"E.164 \uBC88\uD638",jwt:"JWT",template_literal:"\uC785\uB825"};return r=>{switch(r.code){case"invalid_type":return`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 ${r.expected}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${n(r.input)}\uC785\uB2C8\uB2E4`;case"invalid_value":return r.values.length===1?`\uC798\uBABB\uB41C \uC785\uB825: \uAC12\uC740 ${j(r.values[0])} \uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC635\uC158: ${$(r.values,"\uB610\uB294 ")} \uC911 \uD558\uB098\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"too_big":{let i=r.inclusive?"\uC774\uD558":"\uBBF8\uB9CC",s=i==="\uBBF8\uB9CC"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",a=t(r.origin),l=a?.unit??"\uC694\uC18C";return a?`${r.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${r.maximum.toString()}${l} ${i}${s}`:`${r.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${r.maximum.toString()} ${i}${s}`}case"too_small":{let i=r.inclusive?"\uC774\uC0C1":"\uCD08\uACFC",s=i==="\uC774\uC0C1"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",a=t(r.origin),l=a?.unit??"\uC694\uC18C";return a?`${r.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${r.minimum.toString()}${l} ${i}${s}`:`${r.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${r.minimum.toString()} ${i}${s}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${i.prefix}"(\uC73C)\uB85C \uC2DC\uC791\uD574\uC57C \uD569\uB2C8\uB2E4`:i.format==="ends_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${i.suffix}"(\uC73C)\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4`:i.format==="includes"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${i.includes}"\uC744(\uB97C) \uD3EC\uD568\uD574\uC57C \uD569\uB2C8\uB2E4`:i.format==="regex"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: \uC815\uADDC\uC2DD ${i.pattern} \uD328\uD134\uACFC \uC77C\uCE58\uD574\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C ${o[i.format]??r.format}`}case"not_multiple_of":return`\uC798\uBABB\uB41C \uC22B\uC790: ${r.divisor}\uC758 \uBC30\uC218\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"unrecognized_keys":return`\uC778\uC2DD\uD560 \uC218 \uC5C6\uB294 \uD0A4: ${$(r.keys,", ")}`;case"invalid_key":return`\uC798\uBABB\uB41C \uD0A4: ${r.origin}`;case"invalid_union":return"\uC798\uBABB\uB41C \uC785\uB825";case"invalid_element":return`\uC798\uBABB\uB41C \uAC12: ${r.origin}`;default:return"\uC798\uBABB\uB41C \uC785\uB825"}}}});function Zx(){return{localeError:z3()}}var z3,Vx=K(()=>{ie();z3=()=>{let e={string:{unit:"\u0437\u043D\u0430\u0446\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},file:{unit:"\u0431\u0430\u0458\u0442\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},array:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},set:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"\u0431\u0440\u043E\u0458";case"object":{if(Array.isArray(r))return"\u043D\u0438\u0437\u0430";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"\u0432\u043D\u0435\u0441",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u043D\u0430 \u0435-\u043F\u043E\u0448\u0442\u0430",url:"URL",emoji:"\u0435\u043C\u043E\u045F\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0443\u043C \u0438 \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0443\u043C",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u0432\u0440\u0435\u043C\u0435\u0442\u0440\u0430\u0435\u045A\u0435",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441\u0430",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441\u0430",cidrv4:"IPv4 \u043E\u043F\u0441\u0435\u0433",cidrv6:"IPv6 \u043E\u043F\u0441\u0435\u0433",base64:"base64-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",base64url:"base64url-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",json_string:"JSON \u043D\u0438\u0437\u0430",e164:"E.164 \u0431\u0440\u043E\u0458",jwt:"JWT",template_literal:"\u0432\u043D\u0435\u0441"};return r=>{switch(r.code){case"invalid_type":return`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${r.expected}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${n(r.input)}`;case"invalid_value":return r.values.length===1?`Invalid input: expected ${j(r.values[0])}`:`\u0413\u0440\u0435\u0448\u0430\u043D\u0430 \u043E\u043F\u0446\u0438\u0458\u0430: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 \u0435\u0434\u043D\u0430 ${$(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${r.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0438\u043C\u0430 ${i}${r.maximum.toString()} ${s.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0438"}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${r.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0431\u0438\u0434\u0435 ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${r.origin} \u0434\u0430 \u0438\u043C\u0430 ${i}${r.minimum.toString()} ${s.unit}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${r.origin} \u0434\u0430 \u0431\u0438\u0434\u0435 ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u043D\u0443\u0432\u0430 \u0441\u043E "${i.prefix}"`:i.format==="ends_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u0432\u0440\u0448\u0443\u0432\u0430 \u0441\u043E "${i.suffix}"`:i.format==="includes"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0432\u043A\u043B\u0443\u0447\u0443\u0432\u0430 "${i.includes}"`:i.format==="regex"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u043E\u0434\u0433\u043E\u0430\u0440\u0430 \u043D\u0430 \u043F\u0430\u0442\u0435\u0440\u043D\u043E\u0442 ${i.pattern}`:`Invalid ${o[i.format]??r.format}`}case"not_multiple_of":return`\u0413\u0440\u0435\u0448\u0435\u043D \u0431\u0440\u043E\u0458: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0431\u0438\u0434\u0435 \u0434\u0435\u043B\u0438\u0432 \u0441\u043E ${r.divisor}`;case"unrecognized_keys":return`${r.keys.length>1?"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D\u0438 \u043A\u043B\u0443\u0447\u0435\u0432\u0438":"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D \u043A\u043B\u0443\u0447"}: ${$(r.keys,", ")}`;case"invalid_key":return`\u0413\u0440\u0435\u0448\u0435\u043D \u043A\u043B\u0443\u0447 \u0432\u043E ${r.origin}`;case"invalid_union":return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441";case"invalid_element":return`\u0413\u0440\u0435\u0448\u043D\u0430 \u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442 \u0432\u043E ${r.origin}`;default:return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441"}}}});function Wx(){return{localeError:O3()}}var O3,Kx=K(()=>{ie();O3=()=>{let e={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"nombor";case"object":{if(Array.isArray(r))return"array";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"input",email:"alamat e-mel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tarikh masa ISO",date:"tarikh ISO",time:"masa ISO",duration:"tempoh ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"julat IPv4",cidrv6:"julat IPv6",base64:"string dikodkan base64",base64url:"string dikodkan base64url",json_string:"string JSON",e164:"nombor E.164",jwt:"JWT",template_literal:"input"};return r=>{switch(r.code){case"invalid_type":return`Input tidak sah: dijangka ${r.expected}, diterima ${n(r.input)}`;case"invalid_value":return r.values.length===1?`Input tidak sah: dijangka ${j(r.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${$(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`Terlalu besar: dijangka ${r.origin??"nilai"} ${s.verb} ${i}${r.maximum.toString()} ${s.unit??"elemen"}`:`Terlalu besar: dijangka ${r.origin??"nilai"} adalah ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`Terlalu kecil: dijangka ${r.origin} ${s.verb} ${i}${r.minimum.toString()} ${s.unit}`:`Terlalu kecil: dijangka ${r.origin} adalah ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`String tidak sah: mesti bermula dengan "${i.prefix}"`:i.format==="ends_with"?`String tidak sah: mesti berakhir dengan "${i.suffix}"`:i.format==="includes"?`String tidak sah: mesti mengandungi "${i.includes}"`:i.format==="regex"?`String tidak sah: mesti sepadan dengan corak ${i.pattern}`:`${o[i.format]??r.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${r.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${$(r.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${r.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${r.origin}`;default:return"Input tidak sah"}}}});function Jx(){return{localeError:R3()}}var R3,Gx=K(()=>{ie();R3=()=>{let e={string:{unit:"tekens"},file:{unit:"bytes"},array:{unit:"elementen"},set:{unit:"elementen"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"getal";case"object":{if(Array.isArray(r))return"array";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"invoer",email:"emailadres",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum en tijd",date:"ISO datum",time:"ISO tijd",duration:"ISO duur",ipv4:"IPv4-adres",ipv6:"IPv6-adres",cidrv4:"IPv4-bereik",cidrv6:"IPv6-bereik",base64:"base64-gecodeerde tekst",base64url:"base64 URL-gecodeerde tekst",json_string:"JSON string",e164:"E.164-nummer",jwt:"JWT",template_literal:"invoer"};return r=>{switch(r.code){case"invalid_type":return`Ongeldige invoer: verwacht ${r.expected}, ontving ${n(r.input)}`;case"invalid_value":return r.values.length===1?`Ongeldige invoer: verwacht ${j(r.values[0])}`:`Ongeldige optie: verwacht \xE9\xE9n van ${$(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`Te lang: verwacht dat ${r.origin??"waarde"} ${i}${r.maximum.toString()} ${s.unit??"elementen"} bevat`:`Te lang: verwacht dat ${r.origin??"waarde"} ${i}${r.maximum.toString()} is`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`Te kort: verwacht dat ${r.origin} ${i}${r.minimum.toString()} ${s.unit} bevat`:`Te kort: verwacht dat ${r.origin} ${i}${r.minimum.toString()} is`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Ongeldige tekst: moet met "${i.prefix}" beginnen`:i.format==="ends_with"?`Ongeldige tekst: moet op "${i.suffix}" eindigen`:i.format==="includes"?`Ongeldige tekst: moet "${i.includes}" bevatten`:i.format==="regex"?`Ongeldige tekst: moet overeenkomen met patroon ${i.pattern}`:`Ongeldig: ${o[i.format]??r.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${r.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${r.keys.length>1?"s":""}: ${$(r.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${r.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${r.origin}`;default:return"Ongeldige invoer"}}}});function Qx(){return{localeError:P3()}}var P3,Xx=K(()=>{ie();P3=()=>{let e={string:{unit:"tegn",verb:"\xE5 ha"},file:{unit:"bytes",verb:"\xE5 ha"},array:{unit:"elementer",verb:"\xE5 inneholde"},set:{unit:"elementer",verb:"\xE5 inneholde"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"tall";case"object":{if(Array.isArray(r))return"liste";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"input",email:"e-postadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslett",date:"ISO-dato",time:"ISO-klokkeslett",duration:"ISO-varighet",ipv4:"IPv4-omr\xE5de",ipv6:"IPv6-omr\xE5de",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkodet streng",base64url:"base64url-enkodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"};return r=>{switch(r.code){case"invalid_type":return`Ugyldig input: forventet ${r.expected}, fikk ${n(r.input)}`;case"invalid_value":return r.values.length===1?`Ugyldig verdi: forventet ${j(r.values[0])}`:`Ugyldig valg: forventet en av ${$(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`For stor(t): forventet ${r.origin??"value"} til \xE5 ha ${i}${r.maximum.toString()} ${s.unit??"elementer"}`:`For stor(t): forventet ${r.origin??"value"} til \xE5 ha ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`For lite(n): forventet ${r.origin} til \xE5 ha ${i}${r.minimum.toString()} ${s.unit}`:`For lite(n): forventet ${r.origin} til \xE5 ha ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Ugyldig streng: m\xE5 starte med "${i.prefix}"`:i.format==="ends_with"?`Ugyldig streng: m\xE5 ende med "${i.suffix}"`:i.format==="includes"?`Ugyldig streng: m\xE5 inneholde "${i.includes}"`:i.format==="regex"?`Ugyldig streng: m\xE5 matche m\xF8nsteret ${i.pattern}`:`Ugyldig ${o[i.format]??r.format}`}case"not_multiple_of":return`Ugyldig tall: m\xE5 v\xE6re et multiplum av ${r.divisor}`;case"unrecognized_keys":return`${r.keys.length>1?"Ukjente n\xF8kler":"Ukjent n\xF8kkel"}: ${$(r.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8kkel i ${r.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${r.origin}`;default:return"Ugyldig input"}}}});function Yx(){return{localeError:L3()}}var L3,ek=K(()=>{ie();L3=()=>{let e={string:{unit:"harf",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"unsur",verb:"olmal\u0131d\u0131r"},set:{unit:"unsur",verb:"olmal\u0131d\u0131r"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"numara";case"object":{if(Array.isArray(r))return"saf";if(r===null)return"gayb";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"giren",email:"epostag\xE2h",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO heng\xE2m\u0131",date:"ISO tarihi",time:"ISO zaman\u0131",duration:"ISO m\xFCddeti",ipv4:"IPv4 ni\u015F\xE2n\u0131",ipv6:"IPv6 ni\u015F\xE2n\u0131",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-\u015Fifreli metin",base64url:"base64url-\u015Fifreli metin",json_string:"JSON metin",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"giren"};return r=>{switch(r.code){case"invalid_type":return`F\xE2sit giren: umulan ${r.expected}, al\u0131nan ${n(r.input)}`;case"invalid_value":return r.values.length===1?`F\xE2sit giren: umulan ${j(r.values[0])}`:`F\xE2sit tercih: m\xFBteberler ${$(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`Fazla b\xFCy\xFCk: ${r.origin??"value"}, ${i}${r.maximum.toString()} ${s.unit??"elements"} sahip olmal\u0131yd\u0131.`:`Fazla b\xFCy\xFCk: ${r.origin??"value"}, ${i}${r.maximum.toString()} olmal\u0131yd\u0131.`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`Fazla k\xFC\xE7\xFCk: ${r.origin}, ${i}${r.minimum.toString()} ${s.unit} sahip olmal\u0131yd\u0131.`:`Fazla k\xFC\xE7\xFCk: ${r.origin}, ${i}${r.minimum.toString()} olmal\u0131yd\u0131.`}case"invalid_format":{let i=r;return i.format==="starts_with"?`F\xE2sit metin: "${i.prefix}" ile ba\u015Flamal\u0131.`:i.format==="ends_with"?`F\xE2sit metin: "${i.suffix}" ile bitmeli.`:i.format==="includes"?`F\xE2sit metin: "${i.includes}" ihtiv\xE2 etmeli.`:i.format==="regex"?`F\xE2sit metin: ${i.pattern} nak\u015F\u0131na uymal\u0131.`:`F\xE2sit ${o[i.format]??r.format}`}case"not_multiple_of":return`F\xE2sit say\u0131: ${r.divisor} kat\u0131 olmal\u0131yd\u0131.`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar ${r.keys.length>1?"s":""}: ${$(r.keys,", ")}`;case"invalid_key":return`${r.origin} i\xE7in tan\u0131nmayan anahtar var.`;case"invalid_union":return"Giren tan\u0131namad\u0131.";case"invalid_element":return`${r.origin} i\xE7in tan\u0131nmayan k\u0131ymet var.`;default:return"K\u0131ymet tan\u0131namad\u0131."}}}});function tk(){return{localeError:F3()}}var F3,nk=K(()=>{ie();F3=()=>{let e={string:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},file:{unit:"\u0628\u0627\u06CC\u067C\u0633",verb:"\u0648\u0644\u0631\u064A"},array:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},set:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"\u0639\u062F\u062F";case"object":{if(Array.isArray(r))return"\u0627\u0631\u06D0";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"\u0648\u0631\u0648\u062F\u064A",email:"\u0628\u0631\u06CC\u069A\u0646\u0627\u0644\u06CC\u06A9",url:"\u06CC\u0648 \u0622\u0631 \u0627\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0646\u06CC\u067C\u0647 \u0627\u0648 \u0648\u062E\u062A",date:"\u0646\u06D0\u067C\u0647",time:"\u0648\u062E\u062A",duration:"\u0645\u0648\u062F\u0647",ipv4:"\u062F IPv4 \u067E\u062A\u0647",ipv6:"\u062F IPv6 \u067E\u062A\u0647",cidrv4:"\u062F IPv4 \u0633\u0627\u062D\u0647",cidrv6:"\u062F IPv6 \u0633\u0627\u062D\u0647",base64:"base64-encoded \u0645\u062A\u0646",base64url:"base64url-encoded \u0645\u062A\u0646",json_string:"JSON \u0645\u062A\u0646",e164:"\u062F E.164 \u0634\u0645\u06D0\u0631\u0647",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u064A"};return r=>{switch(r.code){case"invalid_type":return`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${r.expected} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${n(r.input)} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`;case"invalid_value":return r.values.length===1?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${j(r.values[0])} \u0648\u0627\u06CC`:`\u0646\u0627\u0633\u0645 \u0627\u0646\u062A\u062E\u0627\u0628: \u0628\u0627\u06CC\u062F \u06CC\u0648 \u0644\u0647 ${$(r.values,"|")} \u0685\u062E\u0647 \u0648\u0627\u06CC`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${r.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${i}${r.maximum.toString()} ${s.unit??"\u0639\u0646\u0635\u0631\u0648\u0646\u0647"} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${r.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${i}${r.maximum.toString()} \u0648\u064A`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${r.origin} \u0628\u0627\u06CC\u062F ${i}${r.minimum.toString()} ${s.unit} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${r.origin} \u0628\u0627\u06CC\u062F ${i}${r.minimum.toString()} \u0648\u064A`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${i.prefix}" \u0633\u0631\u0647 \u067E\u06CC\u0644 \u0634\u064A`:i.format==="ends_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${i.suffix}" \u0633\u0631\u0647 \u067E\u0627\u06CC \u062A\u0647 \u0648\u0631\u0633\u064A\u0696\u064A`:i.format==="includes"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F "${i.includes}" \u0648\u0644\u0631\u064A`:i.format==="regex"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F ${i.pattern} \u0633\u0631\u0647 \u0645\u0637\u0627\u0628\u0642\u062A \u0648\u0644\u0631\u064A`:`${o[i.format]??r.format} \u0646\u0627\u0633\u0645 \u062F\u06CC`}case"not_multiple_of":return`\u0646\u0627\u0633\u0645 \u0639\u062F\u062F: \u0628\u0627\u06CC\u062F \u062F ${r.divisor} \u0645\u0636\u0631\u0628 \u0648\u064A`;case"unrecognized_keys":return`\u0646\u0627\u0633\u0645 ${r.keys.length>1?"\u06A9\u0644\u06CC\u0689\u0648\u0646\u0647":"\u06A9\u0644\u06CC\u0689"}: ${$(r.keys,", ")}`;case"invalid_key":return`\u0646\u0627\u0633\u0645 \u06A9\u0644\u06CC\u0689 \u067E\u0647 ${r.origin} \u06A9\u06D0`;case"invalid_union":return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A";case"invalid_element":return`\u0646\u0627\u0633\u0645 \u0639\u0646\u0635\u0631 \u067E\u0647 ${r.origin} \u06A9\u06D0`;default:return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A"}}}});function rk(){return{localeError:j3()}}var j3,ok=K(()=>{ie();j3=()=>{let e={string:{unit:"znak\xF3w",verb:"mie\u0107"},file:{unit:"bajt\xF3w",verb:"mie\u0107"},array:{unit:"element\xF3w",verb:"mie\u0107"},set:{unit:"element\xF3w",verb:"mie\u0107"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"liczba";case"object":{if(Array.isArray(r))return"tablica";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"wyra\u017Cenie",email:"adres email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i godzina w formacie ISO",date:"data w formacie ISO",time:"godzina w formacie ISO",duration:"czas trwania ISO",ipv4:"adres IPv4",ipv6:"adres IPv6",cidrv4:"zakres IPv4",cidrv6:"zakres IPv6",base64:"ci\u0105g znak\xF3w zakodowany w formacie base64",base64url:"ci\u0105g znak\xF3w zakodowany w formacie base64url",json_string:"ci\u0105g znak\xF3w w formacie JSON",e164:"liczba E.164",jwt:"JWT",template_literal:"wej\u015Bcie"};return r=>{switch(r.code){case"invalid_type":return`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${r.expected}, otrzymano ${n(r.input)}`;case"invalid_value":return r.values.length===1?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${j(r.values[0])}`:`Nieprawid\u0142owa opcja: oczekiwano jednej z warto\u015Bci ${$(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`Za du\u017Ca warto\u015B\u0107: oczekiwano, \u017Ce ${r.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${i}${r.maximum.toString()} ${s.unit??"element\xF3w"}`:`Zbyt du\u017C(y/a/e): oczekiwano, \u017Ce ${r.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`Za ma\u0142a warto\u015B\u0107: oczekiwano, \u017Ce ${r.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${i}${r.minimum.toString()} ${s.unit??"element\xF3w"}`:`Zbyt ma\u0142(y/a/e): oczekiwano, \u017Ce ${r.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zaczyna\u0107 si\u0119 od "${i.prefix}"`:i.format==="ends_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi ko\u0144czy\u0107 si\u0119 na "${i.suffix}"`:i.format==="includes"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zawiera\u0107 "${i.includes}"`:i.format==="regex"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi odpowiada\u0107 wzorcowi ${i.pattern}`:`Nieprawid\u0142ow(y/a/e) ${o[i.format]??r.format}`}case"not_multiple_of":return`Nieprawid\u0142owa liczba: musi by\u0107 wielokrotno\u015Bci\u0105 ${r.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${r.keys.length>1?"s":""}: ${$(r.keys,", ")}`;case"invalid_key":return`Nieprawid\u0142owy klucz w ${r.origin}`;case"invalid_union":return"Nieprawid\u0142owe dane wej\u015Bciowe";case"invalid_element":return`Nieprawid\u0142owa warto\u015B\u0107 w ${r.origin}`;default:return"Nieprawid\u0142owe dane wej\u015Bciowe"}}}});function ik(){return{localeError:B3()}}var B3,sk=K(()=>{ie();B3=()=>{let e={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"n\xFAmero";case"object":{if(Array.isArray(r))return"array";if(r===null)return"nulo";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"padr\xE3o",email:"endere\xE7o de e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e hora ISO",date:"data ISO",time:"hora ISO",duration:"dura\xE7\xE3o ISO",ipv4:"endere\xE7o IPv4",ipv6:"endere\xE7o IPv6",cidrv4:"faixa de IPv4",cidrv6:"faixa de IPv6",base64:"texto codificado em base64",base64url:"URL codificada em base64",json_string:"texto JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"};return r=>{switch(r.code){case"invalid_type":return`Tipo inv\xE1lido: esperado ${r.expected}, recebido ${n(r.input)}`;case"invalid_value":return r.values.length===1?`Entrada inv\xE1lida: esperado ${j(r.values[0])}`:`Op\xE7\xE3o inv\xE1lida: esperada uma das ${$(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`Muito grande: esperado que ${r.origin??"valor"} tivesse ${i}${r.maximum.toString()} ${s.unit??"elementos"}`:`Muito grande: esperado que ${r.origin??"valor"} fosse ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`Muito pequeno: esperado que ${r.origin} tivesse ${i}${r.minimum.toString()} ${s.unit}`:`Muito pequeno: esperado que ${r.origin} fosse ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Texto inv\xE1lido: deve come\xE7ar com "${i.prefix}"`:i.format==="ends_with"?`Texto inv\xE1lido: deve terminar com "${i.suffix}"`:i.format==="includes"?`Texto inv\xE1lido: deve incluir "${i.includes}"`:i.format==="regex"?`Texto inv\xE1lido: deve corresponder ao padr\xE3o ${i.pattern}`:`${o[i.format]??r.format} inv\xE1lido`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: deve ser m\xFAltiplo de ${r.divisor}`;case"unrecognized_keys":return`Chave${r.keys.length>1?"s":""} desconhecida${r.keys.length>1?"s":""}: ${$(r.keys,", ")}`;case"invalid_key":return`Chave inv\xE1lida em ${r.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido em ${r.origin}`;default:return"Campo inv\xE1lido"}}}});function ak(e,t,n,o){let r=Math.abs(e),i=r%10,s=r%100;return s>=11&&s<=19?o:i===1?t:i>=2&&i<=4?n:o}function lk(){return{localeError:U3()}}var U3,uk=K(()=>{ie();U3=()=>{let e={string:{unit:{one:"\u0441\u0438\u043C\u0432\u043E\u043B",few:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",many:"\u0441\u0438\u043C\u0432\u043E\u043B\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u0430",many:"\u0431\u0430\u0439\u0442"},verb:"\u0438\u043C\u0435\u0442\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"\u0447\u0438\u0441\u043B\u043E";case"object":{if(Array.isArray(r))return"\u043C\u0430\u0441\u0441\u0438\u0432";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"\u0432\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0438 \u0432\u0440\u0435\u043C\u044F",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u044F",duration:"ISO \u0434\u043B\u0438\u0442\u0435\u043B\u044C\u043D\u043E\u0441\u0442\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64",base64url:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64url",json_string:"JSON \u0441\u0442\u0440\u043E\u043A\u0430",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0432\u043E\u0434"};return r=>{switch(r.code){case"invalid_type":return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${r.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${n(r.input)}`;case"invalid_value":return r.values.length===1?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${j(r.values[0])}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0430\u0440\u0438\u0430\u043D\u0442: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C \u043E\u0434\u043D\u043E \u0438\u0437 ${$(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);if(s){let a=Number(r.maximum),l=ak(a,s.unit.one,s.unit.few,s.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${r.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${i}${r.maximum.toString()} ${l}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${r.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);if(s){let a=Number(r.minimum),l=ak(a,s.unit.one,s.unit.few,s.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${r.origin} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${i}${r.minimum.toString()} ${l}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${r.origin} \u0431\u0443\u0434\u0435\u0442 ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u043D\u0430\u0447\u0438\u043D\u0430\u0442\u044C\u0441\u044F \u0441 "${i.prefix}"`:i.format==="ends_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0437\u0430\u043A\u0430\u043D\u0447\u0438\u0432\u0430\u0442\u044C\u0441\u044F \u043D\u0430 "${i.suffix}"`:i.format==="includes"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u0434\u0435\u0440\u0436\u0430\u0442\u044C "${i.includes}"`:i.format==="regex"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043E\u0432\u0430\u0442\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${i.pattern}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 ${o[i.format]??r.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0447\u0438\u0441\u043B\u043E: \u0434\u043E\u043B\u0436\u043D\u043E \u0431\u044B\u0442\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${r.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u043E\u0437\u043D\u0430\u043D\u043D${r.keys.length>1?"\u044B\u0435":"\u044B\u0439"} \u043A\u043B\u044E\u0447${r.keys.length>1?"\u0438":""}: ${$(r.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u043A\u043B\u044E\u0447 \u0432 ${r.origin}`;case"invalid_union":return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435";case"invalid_element":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0432 ${r.origin}`;default:return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435"}}}});function ck(){return{localeError:H3()}}var H3,dk=K(()=>{ie();H3=()=>{let e={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"\u0161tevilo";case"object":{if(Array.isArray(r))return"tabela";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"vnos",email:"e-po\u0161tni naslov",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum in \u010Das",date:"ISO datum",time:"ISO \u010Das",duration:"ISO trajanje",ipv4:"IPv4 naslov",ipv6:"IPv6 naslov",cidrv4:"obseg IPv4",cidrv6:"obseg IPv6",base64:"base64 kodiran niz",base64url:"base64url kodiran niz",json_string:"JSON niz",e164:"E.164 \u0161tevilka",jwt:"JWT",template_literal:"vnos"};return r=>{switch(r.code){case"invalid_type":return`Neveljaven vnos: pri\u010Dakovano ${r.expected}, prejeto ${n(r.input)}`;case"invalid_value":return r.values.length===1?`Neveljaven vnos: pri\u010Dakovano ${j(r.values[0])}`:`Neveljavna mo\u017Enost: pri\u010Dakovano eno izmed ${$(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`Preveliko: pri\u010Dakovano, da bo ${r.origin??"vrednost"} imelo ${i}${r.maximum.toString()} ${s.unit??"elementov"}`:`Preveliko: pri\u010Dakovano, da bo ${r.origin??"vrednost"} ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`Premajhno: pri\u010Dakovano, da bo ${r.origin} imelo ${i}${r.minimum.toString()} ${s.unit}`:`Premajhno: pri\u010Dakovano, da bo ${r.origin} ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Neveljaven niz: mora se za\u010Deti z "${i.prefix}"`:i.format==="ends_with"?`Neveljaven niz: mora se kon\u010Dati z "${i.suffix}"`:i.format==="includes"?`Neveljaven niz: mora vsebovati "${i.includes}"`:i.format==="regex"?`Neveljaven niz: mora ustrezati vzorcu ${i.pattern}`:`Neveljaven ${o[i.format]??r.format}`}case"not_multiple_of":return`Neveljavno \u0161tevilo: mora biti ve\u010Dkratnik ${r.divisor}`;case"unrecognized_keys":return`Neprepoznan${r.keys.length>1?"i klju\u010Di":" klju\u010D"}: ${$(r.keys,", ")}`;case"invalid_key":return`Neveljaven klju\u010D v ${r.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${r.origin}`;default:return"Neveljaven vnos"}}}});function fk(){return{localeError:q3()}}var q3,pk=K(()=>{ie();q3=()=>{let e={string:{unit:"tecken",verb:"att ha"},file:{unit:"bytes",verb:"att ha"},array:{unit:"objekt",verb:"att inneh\xE5lla"},set:{unit:"objekt",verb:"att inneh\xE5lla"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"antal";case"object":{if(Array.isArray(r))return"lista";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"regulj\xE4rt uttryck",email:"e-postadress",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datum och tid",date:"ISO-datum",time:"ISO-tid",duration:"ISO-varaktighet",ipv4:"IPv4-intervall",ipv6:"IPv6-intervall",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodad str\xE4ng",base64url:"base64url-kodad str\xE4ng",json_string:"JSON-str\xE4ng",e164:"E.164-nummer",jwt:"JWT",template_literal:"mall-literal"};return r=>{switch(r.code){case"invalid_type":return`Ogiltig inmatning: f\xF6rv\xE4ntat ${r.expected}, fick ${n(r.input)}`;case"invalid_value":return r.values.length===1?`Ogiltig inmatning: f\xF6rv\xE4ntat ${j(r.values[0])}`:`Ogiltigt val: f\xF6rv\xE4ntade en av ${$(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`F\xF6r stor(t): f\xF6rv\xE4ntade ${r.origin??"v\xE4rdet"} att ha ${i}${r.maximum.toString()} ${s.unit??"element"}`:`F\xF6r stor(t): f\xF6rv\xE4ntat ${r.origin??"v\xE4rdet"} att ha ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`F\xF6r lite(t): f\xF6rv\xE4ntade ${r.origin??"v\xE4rdet"} att ha ${i}${r.minimum.toString()} ${s.unit}`:`F\xF6r lite(t): f\xF6rv\xE4ntade ${r.origin??"v\xE4rdet"} att ha ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Ogiltig str\xE4ng: m\xE5ste b\xF6rja med "${i.prefix}"`:i.format==="ends_with"?`Ogiltig str\xE4ng: m\xE5ste sluta med "${i.suffix}"`:i.format==="includes"?`Ogiltig str\xE4ng: m\xE5ste inneh\xE5lla "${i.includes}"`:i.format==="regex"?`Ogiltig str\xE4ng: m\xE5ste matcha m\xF6nstret "${i.pattern}"`:`Ogiltig(t) ${o[i.format]??r.format}`}case"not_multiple_of":return`Ogiltigt tal: m\xE5ste vara en multipel av ${r.divisor}`;case"unrecognized_keys":return`${r.keys.length>1?"Ok\xE4nda nycklar":"Ok\xE4nd nyckel"}: ${$(r.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${r.origin??"v\xE4rdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt v\xE4rde i ${r.origin??"v\xE4rdet"}`;default:return"Ogiltig input"}}}});function hk(){return{localeError:Z3()}}var Z3,mk=K(()=>{ie();Z3=()=>{let e={string:{unit:"\u0B8E\u0BB4\u0BC1\u0BA4\u0BCD\u0BA4\u0BC1\u0B95\u0BCD\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},file:{unit:"\u0BAA\u0BC8\u0B9F\u0BCD\u0B9F\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},array:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},set:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"\u0B8E\u0BA3\u0BCD \u0B85\u0BB2\u0BCD\u0BB2\u0BBE\u0BA4\u0BA4\u0BC1":"\u0B8E\u0BA3\u0BCD";case"object":{if(Array.isArray(r))return"\u0B85\u0BA3\u0BBF";if(r===null)return"\u0BB5\u0BC6\u0BB1\u0BC1\u0BAE\u0BC8";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"\u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1",email:"\u0BAE\u0BBF\u0BA9\u0BCD\u0BA9\u0B9E\u0BCD\u0B9A\u0BB2\u0BCD \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0BA4\u0BC7\u0BA4\u0BBF \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",date:"ISO \u0BA4\u0BC7\u0BA4\u0BBF",time:"ISO \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",duration:"ISO \u0B95\u0BBE\u0BB2 \u0B85\u0BB3\u0BB5\u0BC1",ipv4:"IPv4 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",ipv6:"IPv6 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",cidrv4:"IPv4 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",cidrv6:"IPv6 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",base64:"base64-encoded \u0B9A\u0BB0\u0BAE\u0BCD",base64url:"base64url-encoded \u0B9A\u0BB0\u0BAE\u0BCD",json_string:"JSON \u0B9A\u0BB0\u0BAE\u0BCD",e164:"E.164 \u0B8E\u0BA3\u0BCD",jwt:"JWT",template_literal:"input"};return r=>{switch(r.code){case"invalid_type":return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${r.expected}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n(r.input)}`;case"invalid_value":return r.values.length===1?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${j(r.values[0])}`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0BB0\u0BC1\u0BAA\u0BCD\u0BAA\u0BAE\u0BCD: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${$(r.values,"|")} \u0B87\u0BB2\u0BCD \u0B92\u0BA9\u0BCD\u0BB1\u0BC1`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${r.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${i}${r.maximum.toString()} ${s.unit??"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD"} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${r.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${i}${r.maximum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${r.origin} ${i}${r.minimum.toString()} ${s.unit} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${r.origin} ${i}${r.minimum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${i.prefix}" \u0B87\u0BB2\u0BCD \u0BA4\u0BCA\u0B9F\u0B99\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:i.format==="ends_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${i.suffix}" \u0B87\u0BB2\u0BCD \u0BAE\u0BC1\u0B9F\u0BBF\u0BB5\u0B9F\u0BC8\u0BAF \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:i.format==="includes"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${i.includes}" \u0B90 \u0B89\u0BB3\u0BCD\u0BB3\u0B9F\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:i.format==="regex"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: ${i.pattern} \u0BAE\u0BC1\u0BB1\u0BC8\u0BAA\u0BBE\u0B9F\u0BCD\u0B9F\u0BC1\u0B9F\u0BA9\u0BCD \u0BAA\u0BCA\u0BB0\u0BC1\u0BA8\u0BCD\u0BA4 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 ${o[i.format]??r.format}`}case"not_multiple_of":return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B8E\u0BA3\u0BCD: ${r.divisor} \u0B87\u0BA9\u0BCD \u0BAA\u0BB2\u0BAE\u0BBE\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`;case"unrecognized_keys":return`\u0B85\u0B9F\u0BC8\u0BAF\u0BBE\u0BB3\u0BAE\u0BCD \u0BA4\u0BC6\u0BB0\u0BBF\u0BAF\u0BBE\u0BA4 \u0BB5\u0BBF\u0B9A\u0BC8${r.keys.length>1?"\u0B95\u0BB3\u0BCD":""}: ${$(r.keys,", ")}`;case"invalid_key":return`${r.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0B9A\u0BC8`;case"invalid_union":return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1";case"invalid_element":return`${r.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1`;default:return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1"}}}});function gk(){return{localeError:V3()}}var V3,bk=K(()=>{ie();V3=()=>{let e={string:{unit:"\u0E15\u0E31\u0E27\u0E2D\u0E31\u0E01\u0E29\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},file:{unit:"\u0E44\u0E1A\u0E15\u0E4C",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},array:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},set:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"\u0E44\u0E21\u0E48\u0E43\u0E0A\u0E48\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02 (NaN)":"\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02";case"object":{if(Array.isArray(r))return"\u0E2D\u0E32\u0E23\u0E4C\u0E40\u0E23\u0E22\u0E4C (Array)";if(r===null)return"\u0E44\u0E21\u0E48\u0E21\u0E35\u0E04\u0E48\u0E32 (null)";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19",email:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48\u0E2D\u0E35\u0E40\u0E21\u0E25",url:"URL",emoji:"\u0E2D\u0E34\u0E42\u0E21\u0E08\u0E34",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",date:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E41\u0E1A\u0E1A ISO",time:"\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",duration:"\u0E0A\u0E48\u0E27\u0E07\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",ipv4:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv4",ipv6:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv6",cidrv4:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv4",cidrv6:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv6",base64:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64",base64url:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64 \u0E2A\u0E33\u0E2B\u0E23\u0E31\u0E1A URL",json_string:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A JSON",e164:"\u0E40\u0E1A\u0E2D\u0E23\u0E4C\u0E42\u0E17\u0E23\u0E28\u0E31\u0E1E\u0E17\u0E4C\u0E23\u0E30\u0E2B\u0E27\u0E48\u0E32\u0E07\u0E1B\u0E23\u0E30\u0E40\u0E17\u0E28 (E.164)",jwt:"\u0E42\u0E17\u0E40\u0E04\u0E19 JWT",template_literal:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19"};return r=>{switch(r.code){case"invalid_type":return`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${r.expected} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${n(r.input)}`;case"invalid_value":return r.values.length===1?`\u0E04\u0E48\u0E32\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${j(r.values[0])}`:`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19\u0E2B\u0E19\u0E36\u0E48\u0E07\u0E43\u0E19 ${$(r.values,"|")}`;case"too_big":{let i=r.inclusive?"\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19":"\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32",s=t(r.origin);return s?`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${r.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${i} ${r.maximum.toString()} ${s.unit??"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23"}`:`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${r.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${i} ${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?"\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E19\u0E49\u0E2D\u0E22":"\u0E21\u0E32\u0E01\u0E01\u0E27\u0E48\u0E32",s=t(r.origin);return s?`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${r.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${i} ${r.minimum.toString()} ${s.unit}`:`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${r.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${i} ${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E02\u0E36\u0E49\u0E19\u0E15\u0E49\u0E19\u0E14\u0E49\u0E27\u0E22 "${i.prefix}"`:i.format==="ends_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E25\u0E07\u0E17\u0E49\u0E32\u0E22\u0E14\u0E49\u0E27\u0E22 "${i.suffix}"`:i.format==="includes"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E21\u0E35 "${i.includes}" \u0E2D\u0E22\u0E39\u0E48\u0E43\u0E19\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21`:i.format==="regex"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14 ${i.pattern}`:`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: ${o[i.format]??r.format}`}case"not_multiple_of":return`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E40\u0E1B\u0E47\u0E19\u0E08\u0E33\u0E19\u0E27\u0E19\u0E17\u0E35\u0E48\u0E2B\u0E32\u0E23\u0E14\u0E49\u0E27\u0E22 ${r.divisor} \u0E44\u0E14\u0E49\u0E25\u0E07\u0E15\u0E31\u0E27`;case"unrecognized_keys":return`\u0E1E\u0E1A\u0E04\u0E35\u0E22\u0E4C\u0E17\u0E35\u0E48\u0E44\u0E21\u0E48\u0E23\u0E39\u0E49\u0E08\u0E31\u0E01: ${$(r.keys,", ")}`;case"invalid_key":return`\u0E04\u0E35\u0E22\u0E4C\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${r.origin}`;case"invalid_union":return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E44\u0E21\u0E48\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E22\u0E39\u0E40\u0E19\u0E35\u0E22\u0E19\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14\u0E44\u0E27\u0E49";case"invalid_element":return`\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${r.origin}`;default:return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07"}}}});function yk(){return{localeError:K3()}}var W3,K3,vk=K(()=>{ie();W3=e=>{let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":"number";case"object":{if(Array.isArray(e))return"array";if(e===null)return"null";if(Object.getPrototypeOf(e)!==Object.prototype&&e.constructor)return e.constructor.name}}return t},K3=()=>{let e={string:{unit:"karakter",verb:"olmal\u0131"},file:{unit:"bayt",verb:"olmal\u0131"},array:{unit:"\xF6\u011Fe",verb:"olmal\u0131"},set:{unit:"\xF6\u011Fe",verb:"olmal\u0131"}};function t(o){return e[o]??null}let n={regex:"girdi",email:"e-posta adresi",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO tarih ve saat",date:"ISO tarih",time:"ISO saat",duration:"ISO s\xFCre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",cidrv4:"IPv4 aral\u0131\u011F\u0131",cidrv6:"IPv6 aral\u0131\u011F\u0131",base64:"base64 ile \u015Fifrelenmi\u015F metin",base64url:"base64url ile \u015Fifrelenmi\u015F metin",json_string:"JSON dizesi",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"\u015Eablon dizesi"};return o=>{switch(o.code){case"invalid_type":return`Ge\xE7ersiz de\u011Fer: beklenen ${o.expected}, al\u0131nan ${W3(o.input)}`;case"invalid_value":return o.values.length===1?`Ge\xE7ersiz de\u011Fer: beklenen ${j(o.values[0])}`:`Ge\xE7ersiz se\xE7enek: a\u015Fa\u011F\u0131dakilerden biri olmal\u0131: ${$(o.values,"|")}`;case"too_big":{let r=o.inclusive?"<=":"<",i=t(o.origin);return i?`\xC7ok b\xFCy\xFCk: beklenen ${o.origin??"de\u011Fer"} ${r}${o.maximum.toString()} ${i.unit??"\xF6\u011Fe"}`:`\xC7ok b\xFCy\xFCk: beklenen ${o.origin??"de\u011Fer"} ${r}${o.maximum.toString()}`}case"too_small":{let r=o.inclusive?">=":">",i=t(o.origin);return i?`\xC7ok k\xFC\xE7\xFCk: beklenen ${o.origin} ${r}${o.minimum.toString()} ${i.unit}`:`\xC7ok k\xFC\xE7\xFCk: beklenen ${o.origin} ${r}${o.minimum.toString()}`}case"invalid_format":{let r=o;return r.format==="starts_with"?`Ge\xE7ersiz metin: "${r.prefix}" ile ba\u015Flamal\u0131`:r.format==="ends_with"?`Ge\xE7ersiz metin: "${r.suffix}" ile bitmeli`:r.format==="includes"?`Ge\xE7ersiz metin: "${r.includes}" i\xE7ermeli`:r.format==="regex"?`Ge\xE7ersiz metin: ${r.pattern} desenine uymal\u0131`:`Ge\xE7ersiz ${n[r.format]??o.format}`}case"not_multiple_of":return`Ge\xE7ersiz say\u0131: ${o.divisor} ile tam b\xF6l\xFCnebilmeli`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar${o.keys.length>1?"lar":""}: ${$(o.keys,", ")}`;case"invalid_key":return`${o.origin} i\xE7inde ge\xE7ersiz anahtar`;case"invalid_union":return"Ge\xE7ersiz de\u011Fer";case"invalid_element":return`${o.origin} i\xE7inde ge\xE7ersiz de\u011Fer`;default:return"Ge\xE7ersiz de\u011Fer"}}}});function xk(){return{localeError:J3()}}var J3,kk=K(()=>{ie();J3=()=>{let e={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},file:{unit:"\u0431\u0430\u0439\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"\u0447\u0438\u0441\u043B\u043E";case"object":{if(Array.isArray(r))return"\u043C\u0430\u0441\u0438\u0432";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u0435\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0457 \u043F\u043E\u0448\u0442\u0438",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0434\u0430\u0442\u0430 \u0442\u0430 \u0447\u0430\u0441 ISO",date:"\u0434\u0430\u0442\u0430 ISO",time:"\u0447\u0430\u0441 ISO",duration:"\u0442\u0440\u0438\u0432\u0430\u043B\u0456\u0441\u0442\u044C ISO",ipv4:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv4",ipv6:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv6",cidrv4:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv4",cidrv6:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv6",base64:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64",base64url:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64url",json_string:"\u0440\u044F\u0434\u043E\u043A JSON",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"};return r=>{switch(r.code){case"invalid_type":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${r.expected}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${n(r.input)}`;case"invalid_value":return r.values.length===1?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${j(r.values[0])}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0430 \u043E\u043F\u0446\u0456\u044F: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F \u043E\u0434\u043D\u0435 \u0437 ${$(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${r.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} ${s.verb} ${i}${r.maximum.toString()} ${s.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432"}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${r.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} \u0431\u0443\u0434\u0435 ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${r.origin} ${s.verb} ${i}${r.minimum.toString()} ${s.unit}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${r.origin} \u0431\u0443\u0434\u0435 ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043F\u043E\u0447\u0438\u043D\u0430\u0442\u0438\u0441\u044F \u0437 "${i.prefix}"`:i.format==="ends_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0437\u0430\u043A\u0456\u043D\u0447\u0443\u0432\u0430\u0442\u0438\u0441\u044F \u043D\u0430 "${i.suffix}"`:i.format==="includes"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043C\u0456\u0441\u0442\u0438\u0442\u0438 "${i.includes}"`:i.format==="regex"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0432\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u0430\u0442\u0438 \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${i.pattern}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 ${o[i.format]??r.format}`}case"not_multiple_of":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0447\u0438\u0441\u043B\u043E: \u043F\u043E\u0432\u0438\u043D\u043D\u043E \u0431\u0443\u0442\u0438 \u043A\u0440\u0430\u0442\u043D\u0438\u043C ${r.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u043E\u0437\u043F\u0456\u0437\u043D\u0430\u043D\u0438\u0439 \u043A\u043B\u044E\u0447${r.keys.length>1?"\u0456":""}: ${$(r.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u043A\u043B\u044E\u0447 \u0443 ${r.origin}`;case"invalid_union":return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456";case"invalid_element":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F \u0443 ${r.origin}`;default:return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"}}}});function wk(){return{localeError:G3()}}var G3,Sk=K(()=>{ie();G3=()=>{let e={string:{unit:"\u062D\u0631\u0648\u0641",verb:"\u06C1\u0648\u0646\u0627"},file:{unit:"\u0628\u0627\u0626\u0679\u0633",verb:"\u06C1\u0648\u0646\u0627"},array:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"},set:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"\u0646\u0645\u0628\u0631";case"object":{if(Array.isArray(r))return"\u0622\u0631\u06D2";if(r===null)return"\u0646\u0644";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"\u0627\u0646 \u067E\u0679",email:"\u0627\u06CC \u0645\u06CC\u0644 \u0627\u06CC\u0688\u0631\u06CC\u0633",url:"\u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",uuidv4:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 4",uuidv6:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 6",nanoid:"\u0646\u06CC\u0646\u0648 \u0622\u0626\u06CC \u0688\u06CC",guid:"\u062C\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid2:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC 2",ulid:"\u06CC\u0648 \u0627\u06CC\u0644 \u0622\u0626\u06CC \u0688\u06CC",xid:"\u0627\u06CC\u06A9\u0633 \u0622\u0626\u06CC \u0688\u06CC",ksuid:"\u06A9\u06D2 \u0627\u06CC\u0633 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",datetime:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0688\u06CC\u0679 \u0679\u0627\u0626\u0645",date:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u062A\u0627\u0631\u06CC\u062E",time:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0648\u0642\u062A",duration:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0645\u062F\u062A",ipv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0627\u06CC\u0688\u0631\u06CC\u0633",ipv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0627\u06CC\u0688\u0631\u06CC\u0633",cidrv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0631\u06CC\u0646\u062C",cidrv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0631\u06CC\u0646\u062C",base64:"\u0628\u06CC\u0633 64 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",base64url:"\u0628\u06CC\u0633 64 \u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",json_string:"\u062C\u06D2 \u0627\u06CC\u0633 \u0627\u0648 \u0627\u06CC\u0646 \u0633\u0679\u0631\u0646\u06AF",e164:"\u0627\u06CC 164 \u0646\u0645\u0628\u0631",jwt:"\u062C\u06D2 \u0688\u0628\u0644\u06CC\u0648 \u0679\u06CC",template_literal:"\u0627\u0646 \u067E\u0679"};return r=>{switch(r.code){case"invalid_type":return`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${r.expected} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${n(r.input)} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`;case"invalid_value":return r.values.length===1?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${j(r.values[0])} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`:`\u063A\u0644\u0637 \u0622\u067E\u0634\u0646: ${$(r.values,"|")} \u0645\u06CC\u06BA \u0633\u06D2 \u0627\u06CC\u06A9 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`\u0628\u06C1\u062A \u0628\u0691\u0627: ${r.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u06D2 ${i}${r.maximum.toString()} ${s.unit??"\u0639\u0646\u0627\u0635\u0631"} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0628\u0691\u0627: ${r.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u0627 ${i}${r.maximum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${r.origin} \u06A9\u06D2 ${i}${r.minimum.toString()} ${s.unit} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${r.origin} \u06A9\u0627 ${i}${r.minimum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${i.prefix}" \u0633\u06D2 \u0634\u0631\u0648\u0639 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:i.format==="ends_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${i.suffix}" \u067E\u0631 \u062E\u062A\u0645 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:i.format==="includes"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${i.includes}" \u0634\u0627\u0645\u0644 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:i.format==="regex"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: \u067E\u06CC\u0679\u0631\u0646 ${i.pattern} \u0633\u06D2 \u0645\u06CC\u0686 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:`\u063A\u0644\u0637 ${o[i.format]??r.format}`}case"not_multiple_of":return`\u063A\u0644\u0637 \u0646\u0645\u0628\u0631: ${r.divisor} \u06A9\u0627 \u0645\u0636\u0627\u0639\u0641 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`;case"unrecognized_keys":return`\u063A\u06CC\u0631 \u062A\u0633\u0644\u06CC\u0645 \u0634\u062F\u06C1 \u06A9\u06CC${r.keys.length>1?"\u0632":""}: ${$(r.keys,"\u060C ")}`;case"invalid_key":return`${r.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u06A9\u06CC`;case"invalid_union":return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679";case"invalid_element":return`${r.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u0648\u06CC\u0644\u06CC\u0648`;default:return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679"}}}});function _k(){return{localeError:Q3()}}var Q3,Ek=K(()=>{ie();Q3=()=>{let e={string:{unit:"k\xFD t\u1EF1",verb:"c\xF3"},file:{unit:"byte",verb:"c\xF3"},array:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"},set:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"s\u1ED1";case"object":{if(Array.isArray(r))return"m\u1EA3ng";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"\u0111\u1EA7u v\xE0o",email:"\u0111\u1ECBa ch\u1EC9 email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ng\xE0y gi\u1EDD ISO",date:"ng\xE0y ISO",time:"gi\u1EDD ISO",duration:"kho\u1EA3ng th\u1EDDi gian ISO",ipv4:"\u0111\u1ECBa ch\u1EC9 IPv4",ipv6:"\u0111\u1ECBa ch\u1EC9 IPv6",cidrv4:"d\u1EA3i IPv4",cidrv6:"d\u1EA3i IPv6",base64:"chu\u1ED7i m\xE3 h\xF3a base64",base64url:"chu\u1ED7i m\xE3 h\xF3a base64url",json_string:"chu\u1ED7i JSON",e164:"s\u1ED1 E.164",jwt:"JWT",template_literal:"\u0111\u1EA7u v\xE0o"};return r=>{switch(r.code){case"invalid_type":return`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${r.expected}, nh\u1EADn \u0111\u01B0\u1EE3c ${n(r.input)}`;case"invalid_value":return r.values.length===1?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${j(r.values[0])}`:`T\xF9y ch\u1ECDn kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i m\u1ED9t trong c\xE1c gi\xE1 tr\u1ECB ${$(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${r.origin??"gi\xE1 tr\u1ECB"} ${s.verb} ${i}${r.maximum.toString()} ${s.unit??"ph\u1EA7n t\u1EED"}`:`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${r.origin??"gi\xE1 tr\u1ECB"} ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${r.origin} ${s.verb} ${i}${r.minimum.toString()} ${s.unit}`:`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${r.origin} ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i b\u1EAFt \u0111\u1EA7u b\u1EB1ng "${i.prefix}"`:i.format==="ends_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i k\u1EBFt th\xFAc b\u1EB1ng "${i.suffix}"`:i.format==="includes"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i bao g\u1ED3m "${i.includes}"`:i.format==="regex"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i kh\u1EDBp v\u1EDBi m\u1EABu ${i.pattern}`:`${o[i.format]??r.format} kh\xF4ng h\u1EE3p l\u1EC7`}case"not_multiple_of":return`S\u1ED1 kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i l\xE0 b\u1ED9i s\u1ED1 c\u1EE7a ${r.divisor}`;case"unrecognized_keys":return`Kh\xF3a kh\xF4ng \u0111\u01B0\u1EE3c nh\u1EADn d\u1EA1ng: ${$(r.keys,", ")}`;case"invalid_key":return`Kh\xF3a kh\xF4ng h\u1EE3p l\u1EC7 trong ${r.origin}`;case"invalid_union":return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7";case"invalid_element":return`Gi\xE1 tr\u1ECB kh\xF4ng h\u1EE3p l\u1EC7 trong ${r.origin}`;default:return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7"}}}});function Ck(){return{localeError:X3()}}var X3,Tk=K(()=>{ie();X3=()=>{let e={string:{unit:"\u5B57\u7B26",verb:"\u5305\u542B"},file:{unit:"\u5B57\u8282",verb:"\u5305\u542B"},array:{unit:"\u9879",verb:"\u5305\u542B"},set:{unit:"\u9879",verb:"\u5305\u542B"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"\u975E\u6570\u5B57(NaN)":"\u6570\u5B57";case"object":{if(Array.isArray(r))return"\u6570\u7EC4";if(r===null)return"\u7A7A\u503C(null)";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"\u8F93\u5165",email:"\u7535\u5B50\u90AE\u4EF6",url:"URL",emoji:"\u8868\u60C5\u7B26\u53F7",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u671F\u65F6\u95F4",date:"ISO\u65E5\u671F",time:"ISO\u65F6\u95F4",duration:"ISO\u65F6\u957F",ipv4:"IPv4\u5730\u5740",ipv6:"IPv6\u5730\u5740",cidrv4:"IPv4\u7F51\u6BB5",cidrv6:"IPv6\u7F51\u6BB5",base64:"base64\u7F16\u7801\u5B57\u7B26\u4E32",base64url:"base64url\u7F16\u7801\u5B57\u7B26\u4E32",json_string:"JSON\u5B57\u7B26\u4E32",e164:"E.164\u53F7\u7801",jwt:"JWT",template_literal:"\u8F93\u5165"};return r=>{switch(r.code){case"invalid_type":return`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${r.expected}\uFF0C\u5B9E\u9645\u63A5\u6536 ${n(r.input)}`;case"invalid_value":return r.values.length===1?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${j(r.values[0])}`:`\u65E0\u6548\u9009\u9879\uFF1A\u671F\u671B\u4EE5\u4E0B\u4E4B\u4E00 ${$(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${r.origin??"\u503C"} ${i}${r.maximum.toString()} ${s.unit??"\u4E2A\u5143\u7D20"}`:`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${r.origin??"\u503C"} ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${r.origin} ${i}${r.minimum.toString()} ${s.unit}`:`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${r.origin} ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${i.prefix}" \u5F00\u5934`:i.format==="ends_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${i.suffix}" \u7ED3\u5C3E`:i.format==="includes"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u5305\u542B "${i.includes}"`:i.format==="regex"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u6EE1\u8DB3\u6B63\u5219\u8868\u8FBE\u5F0F ${i.pattern}`:`\u65E0\u6548${o[i.format]??r.format}`}case"not_multiple_of":return`\u65E0\u6548\u6570\u5B57\uFF1A\u5FC5\u987B\u662F ${r.divisor} \u7684\u500D\u6570`;case"unrecognized_keys":return`\u51FA\u73B0\u672A\u77E5\u7684\u952E(key): ${$(r.keys,", ")}`;case"invalid_key":return`${r.origin} \u4E2D\u7684\u952E(key)\u65E0\u6548`;case"invalid_union":return"\u65E0\u6548\u8F93\u5165";case"invalid_element":return`${r.origin} \u4E2D\u5305\u542B\u65E0\u6548\u503C(value)`;default:return"\u65E0\u6548\u8F93\u5165"}}}});function Ak(){return{localeError:Y3()}}var Y3,Mk=K(()=>{ie();Y3=()=>{let e={string:{unit:"\u5B57\u5143",verb:"\u64C1\u6709"},file:{unit:"\u4F4D\u5143\u7D44",verb:"\u64C1\u6709"},array:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"},set:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"}};function t(r){return e[r]??null}let n=r=>{let i=typeof r;switch(i){case"number":return Number.isNaN(r)?"NaN":"number";case"object":{if(Array.isArray(r))return"array";if(r===null)return"null";if(Object.getPrototypeOf(r)!==Object.prototype&&r.constructor)return r.constructor.name}}return i},o={regex:"\u8F38\u5165",email:"\u90F5\u4EF6\u5730\u5740",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u65E5\u671F\u6642\u9593",date:"ISO \u65E5\u671F",time:"ISO \u6642\u9593",duration:"ISO \u671F\u9593",ipv4:"IPv4 \u4F4D\u5740",ipv6:"IPv6 \u4F4D\u5740",cidrv4:"IPv4 \u7BC4\u570D",cidrv6:"IPv6 \u7BC4\u570D",base64:"base64 \u7DE8\u78BC\u5B57\u4E32",base64url:"base64url \u7DE8\u78BC\u5B57\u4E32",json_string:"JSON \u5B57\u4E32",e164:"E.164 \u6578\u503C",jwt:"JWT",template_literal:"\u8F38\u5165"};return r=>{switch(r.code){case"invalid_type":return`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${r.expected}\uFF0C\u4F46\u6536\u5230 ${n(r.input)}`;case"invalid_value":return r.values.length===1?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${j(r.values[0])}`:`\u7121\u6548\u7684\u9078\u9805\uFF1A\u9810\u671F\u70BA\u4EE5\u4E0B\u5176\u4E2D\u4E4B\u4E00 ${$(r.values,"|")}`;case"too_big":{let i=r.inclusive?"<=":"<",s=t(r.origin);return s?`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${r.origin??"\u503C"} \u61C9\u70BA ${i}${r.maximum.toString()} ${s.unit??"\u500B\u5143\u7D20"}`:`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${r.origin??"\u503C"} \u61C9\u70BA ${i}${r.maximum.toString()}`}case"too_small":{let i=r.inclusive?">=":">",s=t(r.origin);return s?`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${r.origin} \u61C9\u70BA ${i}${r.minimum.toString()} ${s.unit}`:`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${r.origin} \u61C9\u70BA ${i}${r.minimum.toString()}`}case"invalid_format":{let i=r;return i.format==="starts_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${i.prefix}" \u958B\u982D`:i.format==="ends_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${i.suffix}" \u7D50\u5C3E`:i.format==="includes"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u5305\u542B "${i.includes}"`:i.format==="regex"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u7B26\u5408\u683C\u5F0F ${i.pattern}`:`\u7121\u6548\u7684 ${o[i.format]??r.format}`}case"not_multiple_of":return`\u7121\u6548\u7684\u6578\u5B57\uFF1A\u5FC5\u9808\u70BA ${r.divisor} \u7684\u500D\u6578`;case"unrecognized_keys":return`\u7121\u6CD5\u8B58\u5225\u7684\u9375\u503C${r.keys.length>1?"\u5011":""}\uFF1A${$(r.keys,"\u3001")}`;case"invalid_key":return`${r.origin} \u4E2D\u6709\u7121\u6548\u7684\u9375\u503C`;case"invalid_union":return"\u7121\u6548\u7684\u8F38\u5165\u503C";case"invalid_element":return`${r.origin} \u4E2D\u6709\u7121\u6548\u7684\u503C`;default:return"\u7121\u6548\u7684\u8F38\u5165\u503C"}}}});var Jo={};en(Jo,{ar:()=>sx,az:()=>lx,be:()=>dx,ca:()=>px,cs:()=>mx,de:()=>bx,en:()=>Zl,eo:()=>vx,es:()=>kx,fa:()=>Sx,fi:()=>Ex,fr:()=>Tx,frCA:()=>Mx,he:()=>Ix,hu:()=>Nx,id:()=>Ox,it:()=>Px,ja:()=>Fx,kh:()=>Bx,ko:()=>Hx,mk:()=>Zx,ms:()=>Wx,nl:()=>Jx,no:()=>Qx,ota:()=>Yx,pl:()=>rk,ps:()=>tk,pt:()=>ik,ru:()=>lk,sl:()=>ck,sv:()=>fk,ta:()=>hk,th:()=>gk,tr:()=>yk,ua:()=>xk,ur:()=>wk,vi:()=>_k,zhCN:()=>Ck,zhTW:()=>Ak});var xm=K(()=>{ax();ux();fx();hx();gx();yx();vm();xx();wx();_x();Cx();Ax();$x();Dx();zx();Rx();Lx();jx();Ux();qx();Vx();Kx();Gx();Xx();ek();nk();ok();sk();uk();dk();pk();mk();bk();vk();kk();Sk();Ek();Tk();Mk()});function Ps(){return new Go}var Vl,Wl,Go,pn,km=K(()=>{Vl=Symbol("ZodOutput"),Wl=Symbol("ZodInput"),Go=class{constructor(){this._map=new Map,this._idmap=new Map}add(t,...n){let o=n[0];if(this._map.set(t,o),o&&typeof o=="object"&&"id"in o){if(this._idmap.has(o.id))throw new Error(`ID ${o.id} already exists in the registry`);this._idmap.set(o.id,t)}return this}clear(){return this._map=new Map,this._idmap=new Map,this}remove(t){let n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){let n=t._zod.parent;if(n){let o={...this.get(n)??{}};return delete o.id,{...o,...this._map.get(t)}}return this._map.get(t)}has(t){return this._map.has(t)}};pn=Ps()});function wm(e,t){return new e({type:"string",...L(t)})}function Sm(e,t){return new e({type:"string",coerce:!0,...L(t)})}function Kl(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...L(t)})}function Ls(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...L(t)})}function Jl(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...L(t)})}function Gl(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...L(t)})}function Ql(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...L(t)})}function Xl(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...L(t)})}function Yl(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...L(t)})}function eu(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...L(t)})}function tu(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...L(t)})}function nu(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...L(t)})}function ru(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...L(t)})}function ou(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...L(t)})}function iu(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...L(t)})}function su(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...L(t)})}function au(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...L(t)})}function lu(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...L(t)})}function uu(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...L(t)})}function cu(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...L(t)})}function du(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...L(t)})}function fu(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...L(t)})}function pu(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...L(t)})}function hu(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...L(t)})}function _m(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...L(t)})}function Em(e,t){return new e({type:"string",format:"date",check:"string_format",...L(t)})}function Cm(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...L(t)})}function Tm(e,t){return new e({type:"string",format:"duration",check:"string_format",...L(t)})}function Am(e,t){return new e({type:"number",checks:[],...L(t)})}function Mm(e,t){return new e({type:"number",coerce:!0,checks:[],...L(t)})}function $m(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...L(t)})}function Im(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float32",...L(t)})}function Dm(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float64",...L(t)})}function Nm(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"int32",...L(t)})}function zm(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"uint32",...L(t)})}function Om(e,t){return new e({type:"boolean",...L(t)})}function Rm(e,t){return new e({type:"boolean",coerce:!0,...L(t)})}function Pm(e,t){return new e({type:"bigint",...L(t)})}function Lm(e,t){return new e({type:"bigint",coerce:!0,...L(t)})}function Fm(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...L(t)})}function jm(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...L(t)})}function Bm(e,t){return new e({type:"symbol",...L(t)})}function Um(e,t){return new e({type:"undefined",...L(t)})}function Hm(e,t){return new e({type:"null",...L(t)})}function qm(e){return new e({type:"any"})}function Qo(e){return new e({type:"unknown"})}function Zm(e,t){return new e({type:"never",...L(t)})}function Vm(e,t){return new e({type:"void",...L(t)})}function Wm(e,t){return new e({type:"date",...L(t)})}function Km(e,t){return new e({type:"date",coerce:!0,...L(t)})}function Jm(e,t){return new e({type:"nan",...L(t)})}function Cn(e,t){return new Pl({check:"less_than",...L(t),value:e,inclusive:!1})}function Wt(e,t){return new Pl({check:"less_than",...L(t),value:e,inclusive:!0})}function Tn(e,t){return new Ll({check:"greater_than",...L(t),value:e,inclusive:!1})}function zt(e,t){return new Ll({check:"greater_than",...L(t),value:e,inclusive:!0})}function gu(e){return Tn(0,e)}function bu(e){return Cn(0,e)}function yu(e){return Wt(0,e)}function vu(e){return zt(0,e)}function mr(e,t){return new Jp({check:"multiple_of",...L(t),value:e})}function Wr(e,t){return new Xp({check:"max_size",...L(t),maximum:e})}function gr(e,t){return new Yp({check:"min_size",...L(t),minimum:e})}function Xo(e,t){return new eh({check:"size_equals",...L(t),size:e})}function Kr(e,t){return new th({check:"max_length",...L(t),maximum:e})}function qn(e,t){return new nh({check:"min_length",...L(t),minimum:e})}function Jr(e,t){return new rh({check:"length_equals",...L(t),length:e})}function Yo(e,t){return new oh({check:"string_format",format:"regex",...L(t),pattern:e})}function ei(e){return new ih({check:"string_format",format:"lowercase",...L(e)})}function ti(e){return new sh({check:"string_format",format:"uppercase",...L(e)})}function ni(e,t){return new ah({check:"string_format",format:"includes",...L(t),includes:e})}function ri(e,t){return new lh({check:"string_format",format:"starts_with",...L(t),prefix:e})}function oi(e,t){return new uh({check:"string_format",format:"ends_with",...L(t),suffix:e})}function xu(e,t,n){return new ch({check:"property",property:e,schema:t,...L(n)})}function ii(e,t){return new dh({check:"mime_type",mime:e,...L(t)})}function An(e){return new fh({check:"overwrite",tx:e})}function si(e){return An(t=>t.normalize(e))}function ai(){return An(e=>e.trim())}function li(){return An(e=>e.toLowerCase())}function ui(){return An(e=>e.toUpperCase())}function Fs(e,t,n){return new e({type:"array",element:t,...L(n)})}function e6(e,t,n){return new e({type:"union",options:t,...L(n)})}function t6(e,t,n,o){return new e({type:"union",options:n,discriminator:t,...L(o)})}function n6(e,t,n){return new e({type:"intersection",left:t,right:n})}function Gm(e,t,n,o){let r=n instanceof ue,i=r?o:n,s=r?n:null;return new e({type:"tuple",items:t,rest:s,...L(i)})}function r6(e,t,n,o){return new e({type:"record",keyType:t,valueType:n,...L(o)})}function o6(e,t,n,o){return new e({type:"map",keyType:t,valueType:n,...L(o)})}function i6(e,t,n){return new e({type:"set",valueType:t,...L(n)})}function s6(e,t,n){let o=Array.isArray(t)?Object.fromEntries(t.map(r=>[r,r])):t;return new e({type:"enum",entries:o,...L(n)})}function a6(e,t,n){return new e({type:"enum",entries:t,...L(n)})}function l6(e,t,n){return new e({type:"literal",values:Array.isArray(t)?t:[t],...L(n)})}function Qm(e,t){return new e({type:"file",...L(t)})}function u6(e,t){return new e({type:"transform",transform:t})}function c6(e,t){return new e({type:"optional",innerType:t})}function d6(e,t){return new e({type:"nullable",innerType:t})}function f6(e,t,n){return new e({type:"default",innerType:t,get defaultValue(){return typeof n=="function"?n():n}})}function p6(e,t,n){return new e({type:"nonoptional",innerType:t,...L(n)})}function h6(e,t){return new e({type:"success",innerType:t})}function m6(e,t,n){return new e({type:"catch",innerType:t,catchValue:typeof n=="function"?n:()=>n})}function g6(e,t,n){return new e({type:"pipe",in:t,out:n})}function b6(e,t){return new e({type:"readonly",innerType:t})}function y6(e,t,n){return new e({type:"template_literal",parts:t,...L(n)})}function v6(e,t){return new e({type:"lazy",getter:t})}function x6(e,t){return new e({type:"promise",innerType:t})}function Xm(e,t,n){let o=L(n);return o.abort??(o.abort=!0),new e({type:"custom",check:"custom",fn:t,...o})}function Ym(e,t,n){return new e({type:"custom",check:"custom",fn:t,...L(n)})}function e0(e,t){let n=L(t),o=n.truthy??["true","1","yes","on","y","enabled"],r=n.falsy??["false","0","no","off","n","disabled"];n.case!=="sensitive"&&(o=o.map(p=>typeof p=="string"?p.toLowerCase():p),r=r.map(p=>typeof p=="string"?p.toLowerCase():p));let i=new Set(o),s=new Set(r),a=e.Pipe??Os,l=e.Boolean??Ds,u=e.String??Zr,c=e.Transform??zs,d=new c({type:"transform",transform:(p,m)=>{let g=p;return n.case!=="sensitive"&&(g=g.toLowerCase()),i.has(g)?!0:s.has(g)?!1:(m.issues.push({code:"invalid_value",expected:"stringbool",values:[...i,...s],input:m.value,inst:d}),{})},error:n.error}),f=new a({type:"pipe",in:new u({type:"string",error:n.error}),out:d,error:n.error});return new a({type:"pipe",in:f,out:new l({type:"boolean",error:n.error}),error:n.error})}function t0(e,t,n,o={}){let r=L(o),i={...L(o),check:"string_format",type:"string",format:t,fn:typeof n=="function"?n:a=>n.test(a),...r};return n instanceof RegExp&&(i.pattern=n),new e(i)}var mu,n0=K(()=>{Fl();Rs();ie();mu={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6}});function wu(e){return new ku({type:"function",input:Array.isArray(e?.input)?Gm(Vr,e?.input):e?.input??Fs(Ns,Qo(Ko)),output:e?.output??Qo(Ko)})}var ku,$k=K(()=>{n0();zl();Rs();Rs();ku=class{constructor(t){this._def=t,this.def=t}implement(t){if(typeof t!="function")throw new Error("implement() must be called with a function");let n=((...o)=>{let r=this._def.input?As(this._def.input,o,void 0,{callee:n}):o;if(!Array.isArray(r))throw new Error("Invalid arguments schema: not an array or tuple schema.");let i=t(...r);return this._def.output?As(this._def.output,i,void 0,{callee:n}):i});return n}implementAsync(t){if(typeof t!="function")throw new Error("implement() must be called with a function");let n=(async(...o)=>{let r=this._def.input?await Ms(this._def.input,o,void 0,{callee:n}):o;if(!Array.isArray(r))throw new Error("Invalid arguments schema: not an array or tuple schema.");let i=await t(...r);return this._def.output?Ms(this._def.output,i,void 0,{callee:n}):i});return n}input(...t){let n=this.constructor;return Array.isArray(t[0])?new n({type:"function",input:new Vr({type:"tuple",items:t[0],rest:t[1]}),output:this._def.output}):new n({type:"function",input:t[0],output:this._def.output})}output(t){let n=this.constructor;return new n({type:"function",input:this._def.input,output:t})}}});function Su(e,t){if(e instanceof Go){let o=new js(t),r={};for(let a of e._idmap.entries()){let[l,u]=a;o.process(u)}let i={},s={registry:e,uri:t?.uri,defs:r};for(let a of e._idmap.entries()){let[l,u]=a;i[l]=o.emit(u,{...t,external:s})}if(Object.keys(r).length>0){let a=o.target==="draft-2020-12"?"$defs":"definitions";i.__shared={[a]:r}}return{schemas:i}}let n=new js(t);return n.process(e),n.emit(e,t)}function ut(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;switch(r.type){case"string":case"number":case"bigint":case"boolean":case"date":case"symbol":case"undefined":case"null":case"any":case"unknown":case"never":case"void":case"literal":case"enum":case"nan":case"file":case"template_literal":return!1;case"array":return ut(r.element,n);case"object":{for(let i in r.shape)if(ut(r.shape[i],n))return!0;return!1}case"union":{for(let i of r.options)if(ut(i,n))return!0;return!1}case"intersection":return ut(r.left,n)||ut(r.right,n);case"tuple":{for(let i of r.items)if(ut(i,n))return!0;return!!(r.rest&&ut(r.rest,n))}case"record":return ut(r.keyType,n)||ut(r.valueType,n);case"map":return ut(r.keyType,n)||ut(r.valueType,n);case"set":return ut(r.valueType,n);case"promise":case"optional":case"nonoptional":case"nullable":case"readonly":return ut(r.innerType,n);case"lazy":return ut(r.getter(),n);case"default":return ut(r.innerType,n);case"prefault":return ut(r.innerType,n);case"custom":return!1;case"transform":return!0;case"pipe":return ut(r.in,n)||ut(r.out,n);case"success":return!1;case"catch":return!1;default:}throw new Error(`Unknown schema type: ${r.type}`)}var js,Ik=K(()=>{km();ie();js=class{constructor(t){this.counter=0,this.metadataRegistry=t?.metadata??pn,this.target=t?.target??"draft-2020-12",this.unrepresentable=t?.unrepresentable??"throw",this.override=t?.override??(()=>{}),this.io=t?.io??"output",this.seen=new Map}process(t,n={path:[],schemaPath:[]}){var o;let r=t._zod.def,i={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},s=this.seen.get(t);if(s)return s.count++,n.schemaPath.includes(t)&&(s.cycle=n.path),s.schema;let a={schema:{},count:1,cycle:void 0,path:n.path};this.seen.set(t,a);let l=t._zod.toJSONSchema?.();if(l)a.schema=l;else{let d={...n,schemaPath:[...n.schemaPath,t],path:n.path},f=t._zod.parent;if(f)a.ref=f,this.process(f,d),this.seen.get(f).isParent=!0;else{let h=a.schema;switch(r.type){case"string":{let p=h;p.type="string";let{minimum:m,maximum:g,format:b,patterns:y,contentEncoding:k}=t._zod.bag;if(typeof m=="number"&&(p.minLength=m),typeof g=="number"&&(p.maxLength=g),b&&(p.format=i[b]??b,p.format===""&&delete p.format),k&&(p.contentEncoding=k),y&&y.size>0){let x=[...y];x.length===1?p.pattern=x[0].source:x.length>1&&(a.schema.allOf=[...x.map(E=>({...this.target==="draft-7"?{type:"string"}:{},pattern:E.source}))])}break}case"number":{let p=h,{minimum:m,maximum:g,format:b,multipleOf:y,exclusiveMaximum:k,exclusiveMinimum:x}=t._zod.bag;typeof b=="string"&&b.includes("int")?p.type="integer":p.type="number",typeof x=="number"&&(p.exclusiveMinimum=x),typeof m=="number"&&(p.minimum=m,typeof x=="number"&&(x>=m?delete p.minimum:delete p.exclusiveMinimum)),typeof k=="number"&&(p.exclusiveMaximum=k),typeof g=="number"&&(p.maximum=g,typeof k=="number"&&(k<=g?delete p.maximum:delete p.exclusiveMaximum)),typeof y=="number"&&(p.multipleOf=y);break}case"boolean":{let p=h;p.type="boolean";break}case"bigint":{if(this.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema");break}case"symbol":{if(this.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema");break}case"null":{h.type="null";break}case"any":break;case"unknown":break;case"undefined":{if(this.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema");break}case"void":{if(this.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema");break}case"never":{h.not={};break}case"date":{if(this.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema");break}case"array":{let p=h,{minimum:m,maximum:g}=t._zod.bag;typeof m=="number"&&(p.minItems=m),typeof g=="number"&&(p.maxItems=g),p.type="array",p.items=this.process(r.element,{...d,path:[...d.path,"items"]});break}case"object":{let p=h;p.type="object",p.properties={};let m=r.shape;for(let y in m)p.properties[y]=this.process(m[y],{...d,path:[...d.path,"properties",y]});let g=new Set(Object.keys(m)),b=new Set([...g].filter(y=>{let k=r.shape[y]._zod;return this.io==="input"?k.optin===void 0:k.optout===void 0}));b.size>0&&(p.required=Array.from(b)),r.catchall?._zod.def.type==="never"?p.additionalProperties=!1:r.catchall?r.catchall&&(p.additionalProperties=this.process(r.catchall,{...d,path:[...d.path,"additionalProperties"]})):this.io==="output"&&(p.additionalProperties=!1);break}case"union":{let p=h;p.anyOf=r.options.map((m,g)=>this.process(m,{...d,path:[...d.path,"anyOf",g]}));break}case"intersection":{let p=h,m=this.process(r.left,{...d,path:[...d.path,"allOf",0]}),g=this.process(r.right,{...d,path:[...d.path,"allOf",1]}),b=k=>"allOf"in k&&Object.keys(k).length===1,y=[...b(m)?m.allOf:[m],...b(g)?g.allOf:[g]];p.allOf=y;break}case"tuple":{let p=h;p.type="array";let m=r.items.map((y,k)=>this.process(y,{...d,path:[...d.path,"prefixItems",k]}));if(this.target==="draft-2020-12"?p.prefixItems=m:p.items=m,r.rest){let y=this.process(r.rest,{...d,path:[...d.path,"items"]});this.target==="draft-2020-12"?p.items=y:p.additionalItems=y}r.rest&&(p.items=this.process(r.rest,{...d,path:[...d.path,"items"]}));let{minimum:g,maximum:b}=t._zod.bag;typeof g=="number"&&(p.minItems=g),typeof b=="number"&&(p.maxItems=b);break}case"record":{let p=h;p.type="object",p.propertyNames=this.process(r.keyType,{...d,path:[...d.path,"propertyNames"]}),p.additionalProperties=this.process(r.valueType,{...d,path:[...d.path,"additionalProperties"]});break}case"map":{if(this.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema");break}case"set":{if(this.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema");break}case"enum":{let p=h,m=ks(r.entries);m.every(g=>typeof g=="number")&&(p.type="number"),m.every(g=>typeof g=="string")&&(p.type="string"),p.enum=m;break}case"literal":{let p=h,m=[];for(let g of r.values)if(g===void 0){if(this.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof g=="bigint"){if(this.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");m.push(Number(g))}else m.push(g);if(m.length!==0)if(m.length===1){let g=m[0];p.type=g===null?"null":typeof g,p.const=g}else m.every(g=>typeof g=="number")&&(p.type="number"),m.every(g=>typeof g=="string")&&(p.type="string"),m.every(g=>typeof g=="boolean")&&(p.type="string"),m.every(g=>g===null)&&(p.type="null"),p.enum=m;break}case"file":{let p=h,m={type:"string",format:"binary",contentEncoding:"binary"},{minimum:g,maximum:b,mime:y}=t._zod.bag;g!==void 0&&(m.minLength=g),b!==void 0&&(m.maxLength=b),y?y.length===1?(m.contentMediaType=y[0],Object.assign(p,m)):p.anyOf=y.map(k=>({...m,contentMediaType:k})):Object.assign(p,m);break}case"transform":{if(this.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema");break}case"nullable":{let p=this.process(r.innerType,d);h.anyOf=[p,{type:"null"}];break}case"nonoptional":{this.process(r.innerType,d),a.ref=r.innerType;break}case"success":{let p=h;p.type="boolean";break}case"default":{this.process(r.innerType,d),a.ref=r.innerType,h.default=JSON.parse(JSON.stringify(r.defaultValue));break}case"prefault":{this.process(r.innerType,d),a.ref=r.innerType,this.io==="input"&&(h._prefault=JSON.parse(JSON.stringify(r.defaultValue)));break}case"catch":{this.process(r.innerType,d),a.ref=r.innerType;let p;try{p=r.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}h.default=p;break}case"nan":{if(this.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema");break}case"template_literal":{let p=h,m=t._zod.pattern;if(!m)throw new Error("Pattern not found in template literal");p.type="string",p.pattern=m.source;break}case"pipe":{let p=this.io==="input"?r.in._zod.def.type==="transform"?r.out:r.in:r.out;this.process(p,d),a.ref=p;break}case"readonly":{this.process(r.innerType,d),a.ref=r.innerType,h.readOnly=!0;break}case"promise":{this.process(r.innerType,d),a.ref=r.innerType;break}case"optional":{this.process(r.innerType,d),a.ref=r.innerType;break}case"lazy":{let p=t._zod.innerType;this.process(p,d),a.ref=p;break}case"custom":{if(this.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema");break}default:}}}let u=this.metadataRegistry.get(t);return u&&Object.assign(a.schema,u),this.io==="input"&&ut(t)&&(delete a.schema.examples,delete a.schema.default),this.io==="input"&&a.schema._prefault&&((o=a.schema).default??(o.default=a.schema._prefault)),delete a.schema._prefault,this.seen.get(t).schema}emit(t,n){let o={cycles:n?.cycles??"ref",reused:n?.reused??"inline",external:n?.external??void 0},r=this.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let i=c=>{let d=this.target==="draft-2020-12"?"$defs":"definitions";if(o.external){let m=o.external.registry.get(c[0])?.id,g=o.external.uri??(y=>y);if(m)return{ref:g(m)};let b=c[1].defId??c[1].schema.id??`schema${this.counter++}`;return c[1].defId=b,{defId:b,ref:`${g("__shared")}#/${d}/${b}`}}if(c[1]===r)return{ref:"#"};let h=`#/${d}/`,p=c[1].schema.id??`__schema${this.counter++}`;return{defId:p,ref:h+p}},s=c=>{if(c[1].schema.$ref)return;let d=c[1],{ref:f,defId:h}=i(c);d.def={...d.schema},h&&(d.defId=h);let p=d.schema;for(let m in p)delete p[m];p.$ref=f};if(o.cycles==="throw")for(let c of this.seen.entries()){let d=c[1];if(d.cycle)throw new Error(`Cycle detected: #/${d.cycle?.join("/")}/<root>
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let c of this.seen.entries()){let d=c[1];if(t===c[0]){s(c);continue}if(o.external){let h=o.external.registry.get(c[0])?.id;if(t!==c[0]&&h){s(c);continue}}if(this.metadataRegistry.get(c[0])?.id){s(c);continue}if(d.cycle){s(c);continue}if(d.count>1&&o.reused==="ref"){s(c);continue}}let a=(c,d)=>{let f=this.seen.get(c),h=f.def??f.schema,p={...h};if(f.ref===null)return;let m=f.ref;if(f.ref=null,m){a(m,d);let g=this.seen.get(m).schema;g.$ref&&d.target==="draft-7"?(h.allOf=h.allOf??[],h.allOf.push(g)):(Object.assign(h,g),Object.assign(h,p))}f.isParent||this.override({zodSchema:c,jsonSchema:h,path:f.path??[]})};for(let c of[...this.seen.entries()].reverse())a(c[0],{target:this.target});let l={};if(this.target==="draft-2020-12"?l.$schema="https://json-schema.org/draft/2020-12/schema":this.target==="draft-7"?l.$schema="http://json-schema.org/draft-07/schema#":console.warn(`Invalid target: ${this.target}`),o.external?.uri){let c=o.external.registry.get(t)?.id;if(!c)throw new Error("Schema is missing an `id` property");l.$id=o.external.uri(c)}Object.assign(l,r.def);let u=o.external?.defs??{};for(let c of this.seen.entries()){let d=c[1];d.def&&d.defId&&(u[d.defId]=d.def)}o.external||Object.keys(u).length>0&&(this.target==="draft-2020-12"?l.$defs=u:l.definitions=u);try{return JSON.parse(JSON.stringify(l))}catch{throw new Error("Error converting schema to JSON.")}}}});var Dk={};var Nk=K(()=>{});var Mn={};en(Mn,{$ZodAny:()=>Wh,$ZodArray:()=>Ns,$ZodAsyncError:()=>En,$ZodBase64:()=>Ph,$ZodBase64URL:()=>Lh,$ZodBigInt:()=>Hl,$ZodBigIntFormat:()=>Hh,$ZodBoolean:()=>Ds,$ZodCIDRv4:()=>zh,$ZodCIDRv6:()=>Oh,$ZodCUID:()=>Sh,$ZodCUID2:()=>_h,$ZodCatch:()=>fm,$ZodCheck:()=>Ze,$ZodCheckBigIntFormat:()=>Qp,$ZodCheckEndsWith:()=>uh,$ZodCheckGreaterThan:()=>Ll,$ZodCheckIncludes:()=>ah,$ZodCheckLengthEquals:()=>rh,$ZodCheckLessThan:()=>Pl,$ZodCheckLowerCase:()=>ih,$ZodCheckMaxLength:()=>th,$ZodCheckMaxSize:()=>Xp,$ZodCheckMimeType:()=>dh,$ZodCheckMinLength:()=>nh,$ZodCheckMinSize:()=>Yp,$ZodCheckMultipleOf:()=>Jp,$ZodCheckNumberFormat:()=>Gp,$ZodCheckOverwrite:()=>fh,$ZodCheckProperty:()=>ch,$ZodCheckRegex:()=>oh,$ZodCheckSizeEquals:()=>eh,$ZodCheckStartsWith:()=>lh,$ZodCheckStringFormat:()=>Wo,$ZodCheckUpperCase:()=>sh,$ZodCustom:()=>ym,$ZodCustomStringFormat:()=>Bh,$ZodDate:()=>Gh,$ZodDefault:()=>lm,$ZodDiscriminatedUnion:()=>Xh,$ZodE164:()=>Fh,$ZodEmail:()=>vh,$ZodEmoji:()=>kh,$ZodEnum:()=>rm,$ZodError:()=>Ts,$ZodFile:()=>im,$ZodFunction:()=>ku,$ZodGUID:()=>bh,$ZodIPv4:()=>Dh,$ZodIPv6:()=>Nh,$ZodISODate:()=>Mh,$ZodISODateTime:()=>Ah,$ZodISODuration:()=>Ih,$ZodISOTime:()=>$h,$ZodIntersection:()=>Yh,$ZodJWT:()=>jh,$ZodKSUID:()=>Th,$ZodLazy:()=>bm,$ZodLiteral:()=>om,$ZodMap:()=>tm,$ZodNaN:()=>pm,$ZodNanoID:()=>wh,$ZodNever:()=>Kh,$ZodNonOptional:()=>cm,$ZodNull:()=>Vh,$ZodNullable:()=>am,$ZodNumber:()=>Ul,$ZodNumberFormat:()=>Uh,$ZodObject:()=>Qh,$ZodOptional:()=>sm,$ZodPipe:()=>Os,$ZodPrefault:()=>um,$ZodPromise:()=>gm,$ZodReadonly:()=>hm,$ZodRealError:()=>Ho,$ZodRecord:()=>em,$ZodRegistry:()=>Go,$ZodSet:()=>nm,$ZodString:()=>Zr,$ZodStringFormat:()=>Pe,$ZodSuccess:()=>dm,$ZodSymbol:()=>qh,$ZodTemplateLiteral:()=>mm,$ZodTransform:()=>zs,$ZodTuple:()=>Vr,$ZodType:()=>ue,$ZodULID:()=>Eh,$ZodURL:()=>xh,$ZodUUID:()=>yh,$ZodUndefined:()=>Zh,$ZodUnion:()=>ql,$ZodUnknown:()=>Ko,$ZodVoid:()=>Jh,$ZodXID:()=>Ch,$brand:()=>Cl,$constructor:()=>S,$input:()=>Wl,$output:()=>Vl,Doc:()=>Is,JSONSchema:()=>Dk,JSONSchemaGenerator:()=>js,NEVER:()=>El,TimePrecision:()=>mu,_any:()=>qm,_array:()=>Fs,_base64:()=>du,_base64url:()=>fu,_bigint:()=>Pm,_boolean:()=>Om,_catch:()=>m6,_cidrv4:()=>uu,_cidrv6:()=>cu,_coercedBigint:()=>Lm,_coercedBoolean:()=>Rm,_coercedDate:()=>Km,_coercedNumber:()=>Mm,_coercedString:()=>Sm,_cuid:()=>nu,_cuid2:()=>ru,_custom:()=>Xm,_date:()=>Wm,_default:()=>f6,_discriminatedUnion:()=>t6,_e164:()=>pu,_email:()=>Kl,_emoji:()=>eu,_endsWith:()=>oi,_enum:()=>s6,_file:()=>Qm,_float32:()=>Im,_float64:()=>Dm,_gt:()=>Tn,_gte:()=>zt,_guid:()=>Ls,_includes:()=>ni,_int:()=>$m,_int32:()=>Nm,_int64:()=>Fm,_intersection:()=>n6,_ipv4:()=>au,_ipv6:()=>lu,_isoDate:()=>Em,_isoDateTime:()=>_m,_isoDuration:()=>Tm,_isoTime:()=>Cm,_jwt:()=>hu,_ksuid:()=>su,_lazy:()=>v6,_length:()=>Jr,_literal:()=>l6,_lowercase:()=>ei,_lt:()=>Cn,_lte:()=>Wt,_map:()=>o6,_max:()=>Wt,_maxLength:()=>Kr,_maxSize:()=>Wr,_mime:()=>ii,_min:()=>zt,_minLength:()=>qn,_minSize:()=>gr,_multipleOf:()=>mr,_nan:()=>Jm,_nanoid:()=>tu,_nativeEnum:()=>a6,_negative:()=>bu,_never:()=>Zm,_nonnegative:()=>vu,_nonoptional:()=>p6,_nonpositive:()=>yu,_normalize:()=>si,_null:()=>Hm,_nullable:()=>d6,_number:()=>Am,_optional:()=>c6,_overwrite:()=>An,_parse:()=>$l,_parseAsync:()=>Il,_pipe:()=>g6,_positive:()=>gu,_promise:()=>x6,_property:()=>xu,_readonly:()=>b6,_record:()=>r6,_refine:()=>Ym,_regex:()=>Yo,_safeParse:()=>Dl,_safeParseAsync:()=>Nl,_set:()=>i6,_size:()=>Xo,_startsWith:()=>ri,_string:()=>wm,_stringFormat:()=>t0,_stringbool:()=>e0,_success:()=>h6,_symbol:()=>Bm,_templateLiteral:()=>y6,_toLowerCase:()=>li,_toUpperCase:()=>ui,_transform:()=>u6,_trim:()=>ai,_tuple:()=>Gm,_uint32:()=>zm,_uint64:()=>jm,_ulid:()=>ou,_undefined:()=>Um,_union:()=>e6,_unknown:()=>Qo,_uppercase:()=>ti,_url:()=>Yl,_uuid:()=>Jl,_uuidv4:()=>Gl,_uuidv6:()=>Ql,_uuidv7:()=>Xl,_void:()=>Vm,_xid:()=>iu,clone:()=>Ft,config:()=>Qe,flattenError:()=>qo,formatError:()=>Zo,function:()=>wu,globalConfig:()=>vs,globalRegistry:()=>pn,isValidBase64:()=>Rh,isValidBase64URL:()=>rx,isValidJWT:()=>ox,locales:()=>Jo,parse:()=>As,parseAsync:()=>Ms,prettifyError:()=>Ml,regexes:()=>hr,registry:()=>Ps,safeParse:()=>Vo,safeParseAsync:()=>$s,toDotPath:()=>Fv,toJSONSchema:()=>Su,treeifyError:()=>Al,util:()=>B,version:()=>hh});var Bt=K(()=>{jo();zl();vp();Rs();Fl();mh();ie();Rl();xm();km();ph();$k();n0();Ik();Nk()});var r0=K(()=>{Bt()});var Gr={};en(Gr,{ZodISODate:()=>Us,ZodISODateTime:()=>Bs,ZodISODuration:()=>qs,ZodISOTime:()=>Hs,date:()=>i0,datetime:()=>o0,duration:()=>a0,time:()=>s0});function o0(e){return _m(Bs,e)}function i0(e){return Em(Us,e)}function s0(e){return Cm(Hs,e)}function a0(e){return Tm(qs,e)}var Bs,Us,Hs,qs,Cu=K(()=>{Bt();Tu();Bs=S("ZodISODateTime",(e,t)=>{Ah.init(e,t),Le.init(e,t)});Us=S("ZodISODate",(e,t)=>{Mh.init(e,t),Le.init(e,t)});Hs=S("ZodISOTime",(e,t)=>{$h.init(e,t),Le.init(e,t)});qs=S("ZodISODuration",(e,t)=>{Ih.init(e,t),Le.init(e,t)})});var Pk,Lk,Qr,l0=K(()=>{Bt();Bt();Pk=(e,t)=>{Ts.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>Zo(e,n)},flatten:{value:n=>qo(e,n)},addIssue:{value:n=>e.issues.push(n)},addIssues:{value:n=>e.issues.push(...n)},isEmpty:{get(){return e.issues.length===0}}})},Lk=S("ZodError",Pk),Qr=S("ZodError",Pk,{Parent:Error})});var Au,Mu,$u,Iu,u0=K(()=>{Bt();l0();Au=$l(Qr),Mu=Il(Qr),$u=Dl(Qr),Iu=Nl(Qr)});function T(e){return wm(di,e)}function Fk(e){return Kl(zu,e)}function jk(e){return Ls(Zs,e)}function Bk(e){return Jl($n,e)}function Uk(e){return Gl($n,e)}function Hk(e){return Ql($n,e)}function qk(e){return Xl($n,e)}function Zk(e){return Yl(Ou,e)}function Vk(e){return eu(Ru,e)}function Wk(e){return tu(Pu,e)}function Kk(e){return nu(Lu,e)}function Jk(e){return ru(Fu,e)}function Gk(e){return ou(ju,e)}function Qk(e){return iu(Bu,e)}function Xk(e){return su(Uu,e)}function Yk(e){return au(Hu,e)}function ew(e){return lu(qu,e)}function tw(e){return uu(Zu,e)}function nw(e){return cu(Vu,e)}function rw(e){return du(Wu,e)}function ow(e){return fu(Ku,e)}function iw(e){return pu(Ju,e)}function sw(e){return hu(Gu,e)}function aw(e,t,n={}){return t0(c0,e,t,n)}function _e(e){return Am(fi,e)}function Du(e){return $m(Xr,e)}function lw(e){return Im(Xr,e)}function uw(e){return Dm(Xr,e)}function cw(e){return Nm(Xr,e)}function dw(e){return zm(Xr,e)}function Xe(e){return Om(pi,e)}function fw(e){return Pm(hi,e)}function pw(e){return Fm(Qu,e)}function hw(e){return jm(Qu,e)}function mw(e){return Bm(d0,e)}function gw(e){return Um(f0,e)}function Ks(e){return Hm(p0,e)}function bw(){return qm(h0)}function Be(){return Qo(m0)}function Js(e){return Zm(g0,e)}function yw(e){return Vm(b0,e)}function vw(e){return Wm(Gs,e)}function me(e,t){return Fs(y0,e,t)}function xw(e){let t=e._zod.def.shape;return G(Object.keys(t))}function V(e,t){let n={type:"object",get shape(){return B.assignProp(this,"shape",{...e}),this.shape},...B.normalizeParams(t)};return new Qs(n)}function kw(e,t){return new Qs({type:"object",get shape(){return B.assignProp(this,"shape",{...e}),this.shape},catchall:Js(),...B.normalizeParams(t)})}function yt(e,t){return new Qs({type:"object",get shape(){return B.assignProp(this,"shape",{...e}),this.shape},catchall:Be(),...B.normalizeParams(t)})}function De(e,t){return new Xu({type:"union",options:e,...B.normalizeParams(t)})}function Xs(e,t,n){return new v0({type:"union",options:t,discriminator:e,...B.normalizeParams(n)})}function mi(e,t){return new x0({type:"intersection",left:e,right:t})}function ww(e,t,n){let o=t instanceof ue,r=o?n:t,i=o?t:null;return new k0({type:"tuple",items:e,rest:i,...B.normalizeParams(r)})}function Ne(e,t,n){return new Yu({type:"record",keyType:e,valueType:t,...B.normalizeParams(n)})}function Sw(e,t,n){return new Yu({type:"record",keyType:De([e,Js()]),valueType:t,...B.normalizeParams(n)})}function _w(e,t,n){return new w0({type:"map",keyType:e,valueType:t,...B.normalizeParams(n)})}function Ew(e,t){return new S0({type:"set",valueType:e,...B.normalizeParams(t)})}function Tt(e,t){let n=Array.isArray(e)?Object.fromEntries(e.map(o=>[o,o])):e;return new ci({type:"enum",entries:n,...B.normalizeParams(t)})}function Cw(e,t){return new ci({type:"enum",entries:e,...B.normalizeParams(t)})}function G(e,t){return new _0({type:"literal",values:Array.isArray(e)?e:[e],...B.normalizeParams(t)})}function Tw(e){return Qm(E0,e)}function tc(e){return new ec({type:"transform",transform:e})}function Fe(e){return new nc({type:"optional",innerType:e})}function Vs(e){return new C0({type:"nullable",innerType:e})}function Aw(e){return Fe(Vs(e))}function A0(e,t){return new T0({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():t}})}function $0(e,t){return new M0({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():t}})}function I0(e,t){return new rc({type:"nonoptional",innerType:e,...B.normalizeParams(t)})}function Mw(e){return new D0({type:"success",innerType:e})}function z0(e,t){return new N0({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}function $w(e){return Jm(O0,e)}function Ws(e,t){return new oc({type:"pipe",in:e,out:t})}function P0(e){return new R0({type:"readonly",innerType:e})}function Iw(e,t){return new L0({type:"template_literal",parts:e,...B.normalizeParams(t)})}function j0(e){return new F0({type:"lazy",getter:e})}function Dw(e){return new B0({type:"promise",innerType:e})}function U0(e){let t=new Ze({check:"custom"});return t._zod.check=e,t}function ic(e,t){return Xm(Ys,e??(()=>!0),t)}function H0(e,t={}){return Ym(Ys,e,t)}function q0(e){let t=U0(n=>(n.addIssue=o=>{if(typeof o=="string")n.issues.push(B.issue(o,n.value,t._zod.def));else{let r=o;r.fatal&&(r.continue=!1),r.code??(r.code="custom"),r.input??(r.input=n.value),r.inst??(r.inst=t),r.continue??(r.continue=!t._zod.def.abort),n.issues.push(B.issue(r))}},e(n.value,n)));return t}function Nw(e,t={error:`Input not instance of ${e.name}`}){let n=new Ys({type:"custom",check:"custom",fn:o=>o instanceof e,abort:!0,...B.normalizeParams(t)});return n._zod.bag.Class=e,n}function Ow(e){let t=j0(()=>De([T(e),_e(),Xe(),Ks(),me(t),Ne(T(),t)]));return t}function ea(e,t){return Ws(tc(e),t)}var pe,Nu,di,Le,zu,Zs,$n,Ou,Ru,Pu,Lu,Fu,ju,Bu,Uu,Hu,qu,Zu,Vu,Wu,Ku,Ju,Gu,c0,fi,Xr,pi,hi,Qu,d0,f0,p0,h0,m0,g0,b0,Gs,y0,Qs,Xu,v0,x0,k0,Yu,w0,S0,ci,_0,E0,ec,nc,C0,T0,M0,rc,D0,N0,O0,oc,R0,L0,F0,B0,Ys,zw,Tu=K(()=>{Bt();Bt();r0();Cu();u0();pe=S("ZodType",(e,t)=>(ue.init(e,t),e.def=t,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone({...t,checks:[...t.checks??[],...n.map(o=>typeof o=="function"?{_zod:{check:o,def:{check:"custom"},onattach:[]}}:o)]}),e.clone=(n,o)=>Ft(e,n,o),e.brand=()=>e,e.register=((n,o)=>(n.add(e,o),e)),e.parse=(n,o)=>Au(e,n,o,{callee:e.parse}),e.safeParse=(n,o)=>$u(e,n,o),e.parseAsync=async(n,o)=>Mu(e,n,o,{callee:e.parseAsync}),e.safeParseAsync=async(n,o)=>Iu(e,n,o),e.spa=e.safeParseAsync,e.refine=(n,o)=>e.check(H0(n,o)),e.superRefine=n=>e.check(q0(n)),e.overwrite=n=>e.check(An(n)),e.optional=()=>Fe(e),e.nullable=()=>Vs(e),e.nullish=()=>Fe(Vs(e)),e.nonoptional=n=>I0(e,n),e.array=()=>me(e),e.or=n=>De([e,n]),e.and=n=>mi(e,n),e.transform=n=>Ws(e,tc(n)),e.default=n=>A0(e,n),e.prefault=n=>$0(e,n),e.catch=n=>z0(e,n),e.pipe=n=>Ws(e,n),e.readonly=()=>P0(e),e.describe=n=>{let o=e.clone();return pn.add(o,{description:n}),o},Object.defineProperty(e,"description",{get(){return pn.get(e)?.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return pn.get(e);let o=e.clone();return pn.add(o,n[0]),o},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),Nu=S("_ZodString",(e,t)=>{Zr.init(e,t),pe.init(e,t);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...o)=>e.check(Yo(...o)),e.includes=(...o)=>e.check(ni(...o)),e.startsWith=(...o)=>e.check(ri(...o)),e.endsWith=(...o)=>e.check(oi(...o)),e.min=(...o)=>e.check(qn(...o)),e.max=(...o)=>e.check(Kr(...o)),e.length=(...o)=>e.check(Jr(...o)),e.nonempty=(...o)=>e.check(qn(1,...o)),e.lowercase=o=>e.check(ei(o)),e.uppercase=o=>e.check(ti(o)),e.trim=()=>e.check(ai()),e.normalize=(...o)=>e.check(si(...o)),e.toLowerCase=()=>e.check(li()),e.toUpperCase=()=>e.check(ui())}),di=S("ZodString",(e,t)=>{Zr.init(e,t),Nu.init(e,t),e.email=n=>e.check(Kl(zu,n)),e.url=n=>e.check(Yl(Ou,n)),e.jwt=n=>e.check(hu(Gu,n)),e.emoji=n=>e.check(eu(Ru,n)),e.guid=n=>e.check(Ls(Zs,n)),e.uuid=n=>e.check(Jl($n,n)),e.uuidv4=n=>e.check(Gl($n,n)),e.uuidv6=n=>e.check(Ql($n,n)),e.uuidv7=n=>e.check(Xl($n,n)),e.nanoid=n=>e.check(tu(Pu,n)),e.guid=n=>e.check(Ls(Zs,n)),e.cuid=n=>e.check(nu(Lu,n)),e.cuid2=n=>e.check(ru(Fu,n)),e.ulid=n=>e.check(ou(ju,n)),e.base64=n=>e.check(du(Wu,n)),e.base64url=n=>e.check(fu(Ku,n)),e.xid=n=>e.check(iu(Bu,n)),e.ksuid=n=>e.check(su(Uu,n)),e.ipv4=n=>e.check(au(Hu,n)),e.ipv6=n=>e.check(lu(qu,n)),e.cidrv4=n=>e.check(uu(Zu,n)),e.cidrv6=n=>e.check(cu(Vu,n)),e.e164=n=>e.check(pu(Ju,n)),e.datetime=n=>e.check(o0(n)),e.date=n=>e.check(i0(n)),e.time=n=>e.check(s0(n)),e.duration=n=>e.check(a0(n))});Le=S("ZodStringFormat",(e,t)=>{Pe.init(e,t),Nu.init(e,t)}),zu=S("ZodEmail",(e,t)=>{vh.init(e,t),Le.init(e,t)});Zs=S("ZodGUID",(e,t)=>{bh.init(e,t),Le.init(e,t)});$n=S("ZodUUID",(e,t)=>{yh.init(e,t),Le.init(e,t)});Ou=S("ZodURL",(e,t)=>{xh.init(e,t),Le.init(e,t)});Ru=S("ZodEmoji",(e,t)=>{kh.init(e,t),Le.init(e,t)});Pu=S("ZodNanoID",(e,t)=>{wh.init(e,t),Le.init(e,t)});Lu=S("ZodCUID",(e,t)=>{Sh.init(e,t),Le.init(e,t)});Fu=S("ZodCUID2",(e,t)=>{_h.init(e,t),Le.init(e,t)});ju=S("ZodULID",(e,t)=>{Eh.init(e,t),Le.init(e,t)});Bu=S("ZodXID",(e,t)=>{Ch.init(e,t),Le.init(e,t)});Uu=S("ZodKSUID",(e,t)=>{Th.init(e,t),Le.init(e,t)});Hu=S("ZodIPv4",(e,t)=>{Dh.init(e,t),Le.init(e,t)});qu=S("ZodIPv6",(e,t)=>{Nh.init(e,t),Le.init(e,t)});Zu=S("ZodCIDRv4",(e,t)=>{zh.init(e,t),Le.init(e,t)});Vu=S("ZodCIDRv6",(e,t)=>{Oh.init(e,t),Le.init(e,t)});Wu=S("ZodBase64",(e,t)=>{Ph.init(e,t),Le.init(e,t)});Ku=S("ZodBase64URL",(e,t)=>{Lh.init(e,t),Le.init(e,t)});Ju=S("ZodE164",(e,t)=>{Fh.init(e,t),Le.init(e,t)});Gu=S("ZodJWT",(e,t)=>{jh.init(e,t),Le.init(e,t)});c0=S("ZodCustomStringFormat",(e,t)=>{Bh.init(e,t),Le.init(e,t)});fi=S("ZodNumber",(e,t)=>{Ul.init(e,t),pe.init(e,t),e.gt=(o,r)=>e.check(Tn(o,r)),e.gte=(o,r)=>e.check(zt(o,r)),e.min=(o,r)=>e.check(zt(o,r)),e.lt=(o,r)=>e.check(Cn(o,r)),e.lte=(o,r)=>e.check(Wt(o,r)),e.max=(o,r)=>e.check(Wt(o,r)),e.int=o=>e.check(Du(o)),e.safe=o=>e.check(Du(o)),e.positive=o=>e.check(Tn(0,o)),e.nonnegative=o=>e.check(zt(0,o)),e.negative=o=>e.check(Cn(0,o)),e.nonpositive=o=>e.check(Wt(0,o)),e.multipleOf=(o,r)=>e.check(mr(o,r)),e.step=(o,r)=>e.check(mr(o,r)),e.finite=()=>e;let n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});Xr=S("ZodNumberFormat",(e,t)=>{Uh.init(e,t),fi.init(e,t)});pi=S("ZodBoolean",(e,t)=>{Ds.init(e,t),pe.init(e,t)});hi=S("ZodBigInt",(e,t)=>{Hl.init(e,t),pe.init(e,t),e.gte=(o,r)=>e.check(zt(o,r)),e.min=(o,r)=>e.check(zt(o,r)),e.gt=(o,r)=>e.check(Tn(o,r)),e.gte=(o,r)=>e.check(zt(o,r)),e.min=(o,r)=>e.check(zt(o,r)),e.lt=(o,r)=>e.check(Cn(o,r)),e.lte=(o,r)=>e.check(Wt(o,r)),e.max=(o,r)=>e.check(Wt(o,r)),e.positive=o=>e.check(Tn(BigInt(0),o)),e.negative=o=>e.check(Cn(BigInt(0),o)),e.nonpositive=o=>e.check(Wt(BigInt(0),o)),e.nonnegative=o=>e.check(zt(BigInt(0),o)),e.multipleOf=(o,r)=>e.check(mr(o,r));let n=e._zod.bag;e.minValue=n.minimum??null,e.maxValue=n.maximum??null,e.format=n.format??null});Qu=S("ZodBigIntFormat",(e,t)=>{Hh.init(e,t),hi.init(e,t)});d0=S("ZodSymbol",(e,t)=>{qh.init(e,t),pe.init(e,t)});f0=S("ZodUndefined",(e,t)=>{Zh.init(e,t),pe.init(e,t)});p0=S("ZodNull",(e,t)=>{Vh.init(e,t),pe.init(e,t)});h0=S("ZodAny",(e,t)=>{Wh.init(e,t),pe.init(e,t)});m0=S("ZodUnknown",(e,t)=>{Ko.init(e,t),pe.init(e,t)});g0=S("ZodNever",(e,t)=>{Kh.init(e,t),pe.init(e,t)});b0=S("ZodVoid",(e,t)=>{Jh.init(e,t),pe.init(e,t)});Gs=S("ZodDate",(e,t)=>{Gh.init(e,t),pe.init(e,t),e.min=(o,r)=>e.check(zt(o,r)),e.max=(o,r)=>e.check(Wt(o,r));let n=e._zod.bag;e.minDate=n.minimum?new Date(n.minimum):null,e.maxDate=n.maximum?new Date(n.maximum):null});y0=S("ZodArray",(e,t)=>{Ns.init(e,t),pe.init(e,t),e.element=t.element,e.min=(n,o)=>e.check(qn(n,o)),e.nonempty=n=>e.check(qn(1,n)),e.max=(n,o)=>e.check(Kr(n,o)),e.length=(n,o)=>e.check(Jr(n,o)),e.unwrap=()=>e.element});Qs=S("ZodObject",(e,t)=>{Qh.init(e,t),pe.init(e,t),B.defineLazy(e,"shape",()=>t.shape),e.keyof=()=>Tt(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Be()}),e.loose=()=>e.clone({...e._zod.def,catchall:Be()}),e.strict=()=>e.clone({...e._zod.def,catchall:Js()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>B.extend(e,n),e.merge=n=>B.merge(e,n),e.pick=n=>B.pick(e,n),e.omit=n=>B.omit(e,n),e.partial=(...n)=>B.partial(nc,e,n[0]),e.required=(...n)=>B.required(rc,e,n[0])});Xu=S("ZodUnion",(e,t)=>{ql.init(e,t),pe.init(e,t),e.options=t.options});v0=S("ZodDiscriminatedUnion",(e,t)=>{Xu.init(e,t),Xh.init(e,t)});x0=S("ZodIntersection",(e,t)=>{Yh.init(e,t),pe.init(e,t)});k0=S("ZodTuple",(e,t)=>{Vr.init(e,t),pe.init(e,t),e.rest=n=>e.clone({...e._zod.def,rest:n})});Yu=S("ZodRecord",(e,t)=>{em.init(e,t),pe.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});w0=S("ZodMap",(e,t)=>{tm.init(e,t),pe.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});S0=S("ZodSet",(e,t)=>{nm.init(e,t),pe.init(e,t),e.min=(...n)=>e.check(gr(...n)),e.nonempty=n=>e.check(gr(1,n)),e.max=(...n)=>e.check(Wr(...n)),e.size=(...n)=>e.check(Xo(...n))});ci=S("ZodEnum",(e,t)=>{rm.init(e,t),pe.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(o,r)=>{let i={};for(let s of o)if(n.has(s))i[s]=t.entries[s];else throw new Error(`Key ${s} not found in enum`);return new ci({...t,checks:[],...B.normalizeParams(r),entries:i})},e.exclude=(o,r)=>{let i={...t.entries};for(let s of o)if(n.has(s))delete i[s];else throw new Error(`Key ${s} not found in enum`);return new ci({...t,checks:[],...B.normalizeParams(r),entries:i})}});_0=S("ZodLiteral",(e,t)=>{om.init(e,t),pe.init(e,t),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});E0=S("ZodFile",(e,t)=>{im.init(e,t),pe.init(e,t),e.min=(n,o)=>e.check(gr(n,o)),e.max=(n,o)=>e.check(Wr(n,o)),e.mime=(n,o)=>e.check(ii(Array.isArray(n)?n:[n],o))});ec=S("ZodTransform",(e,t)=>{zs.init(e,t),pe.init(e,t),e._zod.parse=(n,o)=>{n.addIssue=i=>{if(typeof i=="string")n.issues.push(B.issue(i,n.value,t));else{let s=i;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=n.value),s.inst??(s.inst=e),s.continue??(s.continue=!0),n.issues.push(B.issue(s))}};let r=t.transform(n.value,n);return r instanceof Promise?r.then(i=>(n.value=i,n)):(n.value=r,n)}});nc=S("ZodOptional",(e,t)=>{sm.init(e,t),pe.init(e,t),e.unwrap=()=>e._zod.def.innerType});C0=S("ZodNullable",(e,t)=>{am.init(e,t),pe.init(e,t),e.unwrap=()=>e._zod.def.innerType});T0=S("ZodDefault",(e,t)=>{lm.init(e,t),pe.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});M0=S("ZodPrefault",(e,t)=>{um.init(e,t),pe.init(e,t),e.unwrap=()=>e._zod.def.innerType});rc=S("ZodNonOptional",(e,t)=>{cm.init(e,t),pe.init(e,t),e.unwrap=()=>e._zod.def.innerType});D0=S("ZodSuccess",(e,t)=>{dm.init(e,t),pe.init(e,t),e.unwrap=()=>e._zod.def.innerType});N0=S("ZodCatch",(e,t)=>{fm.init(e,t),pe.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});O0=S("ZodNaN",(e,t)=>{pm.init(e,t),pe.init(e,t)});oc=S("ZodPipe",(e,t)=>{Os.init(e,t),pe.init(e,t),e.in=t.in,e.out=t.out});R0=S("ZodReadonly",(e,t)=>{hm.init(e,t),pe.init(e,t)});L0=S("ZodTemplateLiteral",(e,t)=>{mm.init(e,t),pe.init(e,t)});F0=S("ZodLazy",(e,t)=>{bm.init(e,t),pe.init(e,t),e.unwrap=()=>e._zod.def.getter()});B0=S("ZodPromise",(e,t)=>{gm.init(e,t),pe.init(e,t),e.unwrap=()=>e._zod.def.innerType});Ys=S("ZodCustom",(e,t)=>{ym.init(e,t),pe.init(e,t)});zw=(...e)=>e0({Pipe:oc,Boolean:pi,String:di,Transform:ec},...e)});function Pw(e){Qe({customError:e})}function Lw(){return Qe().customError}var Rw,Fw=K(()=>{Bt();Rw={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"}});var sc={};en(sc,{bigint:()=>C6,boolean:()=>E6,date:()=>T6,number:()=>_6,string:()=>S6});function S6(e){return Sm(di,e)}function _6(e){return Mm(fi,e)}function E6(e){return Rm(pi,e)}function C6(e){return Lm(hi,e)}function T6(e){return Km(Gs,e)}var jw=K(()=>{Bt();Tu()});var v={};en(v,{$brand:()=>Cl,$input:()=>Wl,$output:()=>Vl,NEVER:()=>El,TimePrecision:()=>mu,ZodAny:()=>h0,ZodArray:()=>y0,ZodBase64:()=>Wu,ZodBase64URL:()=>Ku,ZodBigInt:()=>hi,ZodBigIntFormat:()=>Qu,ZodBoolean:()=>pi,ZodCIDRv4:()=>Zu,ZodCIDRv6:()=>Vu,ZodCUID:()=>Lu,ZodCUID2:()=>Fu,ZodCatch:()=>N0,ZodCustom:()=>Ys,ZodCustomStringFormat:()=>c0,ZodDate:()=>Gs,ZodDefault:()=>T0,ZodDiscriminatedUnion:()=>v0,ZodE164:()=>Ju,ZodEmail:()=>zu,ZodEmoji:()=>Ru,ZodEnum:()=>ci,ZodError:()=>Lk,ZodFile:()=>E0,ZodGUID:()=>Zs,ZodIPv4:()=>Hu,ZodIPv6:()=>qu,ZodISODate:()=>Us,ZodISODateTime:()=>Bs,ZodISODuration:()=>qs,ZodISOTime:()=>Hs,ZodIntersection:()=>x0,ZodIssueCode:()=>Rw,ZodJWT:()=>Gu,ZodKSUID:()=>Uu,ZodLazy:()=>F0,ZodLiteral:()=>_0,ZodMap:()=>w0,ZodNaN:()=>O0,ZodNanoID:()=>Pu,ZodNever:()=>g0,ZodNonOptional:()=>rc,ZodNull:()=>p0,ZodNullable:()=>C0,ZodNumber:()=>fi,ZodNumberFormat:()=>Xr,ZodObject:()=>Qs,ZodOptional:()=>nc,ZodPipe:()=>oc,ZodPrefault:()=>M0,ZodPromise:()=>B0,ZodReadonly:()=>R0,ZodRealError:()=>Qr,ZodRecord:()=>Yu,ZodSet:()=>S0,ZodString:()=>di,ZodStringFormat:()=>Le,ZodSuccess:()=>D0,ZodSymbol:()=>d0,ZodTemplateLiteral:()=>L0,ZodTransform:()=>ec,ZodTuple:()=>k0,ZodType:()=>pe,ZodULID:()=>ju,ZodURL:()=>Ou,ZodUUID:()=>$n,ZodUndefined:()=>f0,ZodUnion:()=>Xu,ZodUnknown:()=>m0,ZodVoid:()=>b0,ZodXID:()=>Bu,_ZodString:()=>Nu,_default:()=>A0,any:()=>bw,array:()=>me,base64:()=>rw,base64url:()=>ow,bigint:()=>fw,boolean:()=>Xe,catch:()=>z0,check:()=>U0,cidrv4:()=>tw,cidrv6:()=>nw,clone:()=>Ft,coerce:()=>sc,config:()=>Qe,core:()=>Mn,cuid:()=>Kk,cuid2:()=>Jk,custom:()=>ic,date:()=>vw,discriminatedUnion:()=>Xs,e164:()=>iw,email:()=>Fk,emoji:()=>Vk,endsWith:()=>oi,enum:()=>Tt,file:()=>Tw,flattenError:()=>qo,float32:()=>lw,float64:()=>uw,formatError:()=>Zo,function:()=>wu,getErrorMap:()=>Lw,globalRegistry:()=>pn,gt:()=>Tn,gte:()=>zt,guid:()=>jk,includes:()=>ni,instanceof:()=>Nw,int:()=>Du,int32:()=>cw,int64:()=>pw,intersection:()=>mi,ipv4:()=>Yk,ipv6:()=>ew,iso:()=>Gr,json:()=>Ow,jwt:()=>sw,keyof:()=>xw,ksuid:()=>Xk,lazy:()=>j0,length:()=>Jr,literal:()=>G,locales:()=>Jo,looseObject:()=>yt,lowercase:()=>ei,lt:()=>Cn,lte:()=>Wt,map:()=>_w,maxLength:()=>Kr,maxSize:()=>Wr,mime:()=>ii,minLength:()=>qn,minSize:()=>gr,multipleOf:()=>mr,nan:()=>$w,nanoid:()=>Wk,nativeEnum:()=>Cw,negative:()=>bu,never:()=>Js,nonnegative:()=>vu,nonoptional:()=>I0,nonpositive:()=>yu,normalize:()=>si,null:()=>Ks,nullable:()=>Vs,nullish:()=>Aw,number:()=>_e,object:()=>V,optional:()=>Fe,overwrite:()=>An,parse:()=>Au,parseAsync:()=>Mu,partialRecord:()=>Sw,pipe:()=>Ws,positive:()=>gu,prefault:()=>$0,preprocess:()=>ea,prettifyError:()=>Ml,promise:()=>Dw,property:()=>xu,readonly:()=>P0,record:()=>Ne,refine:()=>H0,regex:()=>Yo,regexes:()=>hr,registry:()=>Ps,safeParse:()=>$u,safeParseAsync:()=>Iu,set:()=>Ew,setErrorMap:()=>Pw,size:()=>Xo,startsWith:()=>ri,strictObject:()=>kw,string:()=>T,stringFormat:()=>aw,stringbool:()=>zw,success:()=>Mw,superRefine:()=>q0,symbol:()=>mw,templateLiteral:()=>Iw,toJSONSchema:()=>Su,toLowerCase:()=>li,toUpperCase:()=>ui,transform:()=>tc,treeifyError:()=>Al,trim:()=>ai,tuple:()=>ww,uint32:()=>dw,uint64:()=>hw,ulid:()=>Gk,undefined:()=>gw,union:()=>De,unknown:()=>Be,uppercase:()=>ti,url:()=>Zk,uuid:()=>Bk,uuidv4:()=>Uk,uuidv6:()=>Hk,uuidv7:()=>qk,void:()=>yw,xid:()=>Qk});var Z0=K(()=>{Bt();Tu();r0();l0();u0();Fw();Bt();vm();Bt();xm();Cu();Cu();jw();Qe(Zl())});var Bw,V0=K(()=>{Z0();Z0();Bw=v});var W0={};en(W0,{$brand:()=>Cl,$input:()=>Wl,$output:()=>Vl,NEVER:()=>El,TimePrecision:()=>mu,ZodAny:()=>h0,ZodArray:()=>y0,ZodBase64:()=>Wu,ZodBase64URL:()=>Ku,ZodBigInt:()=>hi,ZodBigIntFormat:()=>Qu,ZodBoolean:()=>pi,ZodCIDRv4:()=>Zu,ZodCIDRv6:()=>Vu,ZodCUID:()=>Lu,ZodCUID2:()=>Fu,ZodCatch:()=>N0,ZodCustom:()=>Ys,ZodCustomStringFormat:()=>c0,ZodDate:()=>Gs,ZodDefault:()=>T0,ZodDiscriminatedUnion:()=>v0,ZodE164:()=>Ju,ZodEmail:()=>zu,ZodEmoji:()=>Ru,ZodEnum:()=>ci,ZodError:()=>Lk,ZodFile:()=>E0,ZodGUID:()=>Zs,ZodIPv4:()=>Hu,ZodIPv6:()=>qu,ZodISODate:()=>Us,ZodISODateTime:()=>Bs,ZodISODuration:()=>qs,ZodISOTime:()=>Hs,ZodIntersection:()=>x0,ZodIssueCode:()=>Rw,ZodJWT:()=>Gu,ZodKSUID:()=>Uu,ZodLazy:()=>F0,ZodLiteral:()=>_0,ZodMap:()=>w0,ZodNaN:()=>O0,ZodNanoID:()=>Pu,ZodNever:()=>g0,ZodNonOptional:()=>rc,ZodNull:()=>p0,ZodNullable:()=>C0,ZodNumber:()=>fi,ZodNumberFormat:()=>Xr,ZodObject:()=>Qs,ZodOptional:()=>nc,ZodPipe:()=>oc,ZodPrefault:()=>M0,ZodPromise:()=>B0,ZodReadonly:()=>R0,ZodRealError:()=>Qr,ZodRecord:()=>Yu,ZodSet:()=>S0,ZodString:()=>di,ZodStringFormat:()=>Le,ZodSuccess:()=>D0,ZodSymbol:()=>d0,ZodTemplateLiteral:()=>L0,ZodTransform:()=>ec,ZodTuple:()=>k0,ZodType:()=>pe,ZodULID:()=>ju,ZodURL:()=>Ou,ZodUUID:()=>$n,ZodUndefined:()=>f0,ZodUnion:()=>Xu,ZodUnknown:()=>m0,ZodVoid:()=>b0,ZodXID:()=>Bu,_ZodString:()=>Nu,_default:()=>A0,any:()=>bw,array:()=>me,base64:()=>rw,base64url:()=>ow,bigint:()=>fw,boolean:()=>Xe,catch:()=>z0,check:()=>U0,cidrv4:()=>tw,cidrv6:()=>nw,clone:()=>Ft,coerce:()=>sc,config:()=>Qe,core:()=>Mn,cuid:()=>Kk,cuid2:()=>Jk,custom:()=>ic,date:()=>vw,default:()=>A6,discriminatedUnion:()=>Xs,e164:()=>iw,email:()=>Fk,emoji:()=>Vk,endsWith:()=>oi,enum:()=>Tt,file:()=>Tw,flattenError:()=>qo,float32:()=>lw,float64:()=>uw,formatError:()=>Zo,function:()=>wu,getErrorMap:()=>Lw,globalRegistry:()=>pn,gt:()=>Tn,gte:()=>zt,guid:()=>jk,includes:()=>ni,instanceof:()=>Nw,int:()=>Du,int32:()=>cw,int64:()=>pw,intersection:()=>mi,ipv4:()=>Yk,ipv6:()=>ew,iso:()=>Gr,json:()=>Ow,jwt:()=>sw,keyof:()=>xw,ksuid:()=>Xk,lazy:()=>j0,length:()=>Jr,literal:()=>G,locales:()=>Jo,looseObject:()=>yt,lowercase:()=>ei,lt:()=>Cn,lte:()=>Wt,map:()=>_w,maxLength:()=>Kr,maxSize:()=>Wr,mime:()=>ii,minLength:()=>qn,minSize:()=>gr,multipleOf:()=>mr,nan:()=>$w,nanoid:()=>Wk,nativeEnum:()=>Cw,negative:()=>bu,never:()=>Js,nonnegative:()=>vu,nonoptional:()=>I0,nonpositive:()=>yu,normalize:()=>si,null:()=>Ks,nullable:()=>Vs,nullish:()=>Aw,number:()=>_e,object:()=>V,optional:()=>Fe,overwrite:()=>An,parse:()=>Au,parseAsync:()=>Mu,partialRecord:()=>Sw,pipe:()=>Ws,positive:()=>gu,prefault:()=>$0,preprocess:()=>ea,prettifyError:()=>Ml,promise:()=>Dw,property:()=>xu,readonly:()=>P0,record:()=>Ne,refine:()=>H0,regex:()=>Yo,regexes:()=>hr,registry:()=>Ps,safeParse:()=>$u,safeParseAsync:()=>Iu,set:()=>Ew,setErrorMap:()=>Pw,size:()=>Xo,startsWith:()=>ri,strictObject:()=>kw,string:()=>T,stringFormat:()=>aw,stringbool:()=>zw,success:()=>Mw,superRefine:()=>q0,symbol:()=>mw,templateLiteral:()=>Iw,toJSONSchema:()=>Su,toLowerCase:()=>li,toUpperCase:()=>ui,transform:()=>tc,treeifyError:()=>Al,trim:()=>ai,tuple:()=>ww,uint32:()=>dw,uint64:()=>hw,ulid:()=>Gk,undefined:()=>gw,union:()=>De,unknown:()=>Be,uppercase:()=>ti,url:()=>Zk,uuid:()=>Bk,uuidv4:()=>Uk,uuidv6:()=>Hk,uuidv7:()=>qk,void:()=>yw,xid:()=>Qk,z:()=>v});var A6,ta=K(()=>{V0();V0();A6=Bw});var RS=Rv((dJ,OS)=>{function SS(e){return e instanceof Map?e.clear=e.delete=e.set=function(){throw new Error("map is read-only")}:e instanceof Set&&(e.add=e.clear=e.delete=function(){throw new Error("set is read-only")}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach(t=>{let n=e[t],o=typeof n;(o==="object"||o==="function")&&!Object.isFrozen(n)&&SS(n)}),e}var Ec=class{constructor(t){t.data===void 0&&(t.data={}),this.data=t.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}};function _S(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function vr(e,...t){let n=Object.create(null);for(let o in e)n[o]=e[o];return t.forEach(function(o){for(let r in o)n[r]=o[r]}),n}var KN="</span>",bS=e=>!!e.scope,JN=(e,{prefix:t})=>{if(e.startsWith("language:"))return e.replace("language:","language-");if(e.includes(".")){let n=e.split(".");return[`${t}${n.shift()}`,...n.map((o,r)=>`${o}${"_".repeat(r+1)}`)].join(" ")}return`${t}${e}`},xg=class{constructor(t,n){this.buffer="",this.classPrefix=n.classPrefix,t.walk(this)}addText(t){this.buffer+=_S(t)}openNode(t){if(!bS(t))return;let n=JN(t.scope,{prefix:this.classPrefix});this.span(n)}closeNode(t){bS(t)&&(this.buffer+=KN)}value(){return this.buffer}span(t){this.buffer+=`<span class="${t}">`}},yS=(e={})=>{let t={children:[]};return Object.assign(t,e),t},kg=class e{constructor(){this.rootNode=yS(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(t){this.top.children.push(t)}openNode(t){let n=yS({scope:t});this.add(n),this.stack.push(n)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(t){return this.constructor._walk(t,this.rootNode)}static _walk(t,n){return typeof n=="string"?t.addText(n):n.children&&(t.openNode(n),n.children.forEach(o=>this._walk(t,o)),t.closeNode(n)),t}static _collapse(t){typeof t!="string"&&t.children&&(t.children.every(n=>typeof n=="string")?t.children=[t.children.join("")]:t.children.forEach(n=>{e._collapse(n)}))}},wg=class extends kg{constructor(t){super(),this.options=t}addText(t){t!==""&&this.add(t)}startScope(t){this.openNode(t)}endScope(){this.closeNode()}__addSublanguage(t,n){let o=t.root;n&&(o.scope=`language:${n}`),this.add(o)}toHTML(){return new xg(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}};function ha(e){return e?typeof e=="string"?e:e.source:null}function ES(e){return eo("(?=",e,")")}function GN(e){return eo("(?:",e,")*")}function QN(e){return eo("(?:",e,")?")}function eo(...e){return e.map(n=>ha(n)).join("")}function XN(e){let t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function Tc(...e){return"("+(XN(e).capture?"":"?:")+e.map(o=>ha(o)).join("|")+")"}function CS(e){return new RegExp(e.toString()+"|").exec("").length-1}function YN(e,t){let n=e&&e.exec(t);return n&&n.index===0}var e4=new RegExp(Tc(/\[(?:[^\\\]]|\\.)*\]/,/\(\?<(?![=!])[^>]+>/,/\(\?'[^']+'/,/\(\??/,/\\([1-9][0-9]*)/,/\\./));function _g(e,{joinWith:t}){let n=0;return e.map(o=>{n+=1;let r=n,i=ha(o),s="";for(;i.length>0;){let a=e4.exec(i);if(!a){s+=i;break}s+=i.substring(0,a.index),i=i.substring(a.index+a[0].length),a[0][0]==="\\"&&a[1]?s+="\\"+String(Number(a[1])+r):(s+=a[0],(a[0]==="("||/^\(\?[<']/.test(a[0]))&&n++)}return s}).map(o=>`(${o})`).join(t)}var t4=/\b\B/,TS="[a-zA-Z]\\w*",Eg="[a-zA-Z_]\\w*",AS="\\b\\d+(\\.\\d+)?",MS="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",$S="\\b(0b[01]+)",n4="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",r4=(e={})=>{let t=/^#![ ]*\//;return e.binary&&(e.begin=eo(t,/.*\b/,e.binary,/\b.*/)),vr({scope:"meta",begin:t,end:/$/,relevance:0,"on:begin":(n,o)=>{n.index!==0&&o.ignoreMatch()}},e)},ma={begin:"\\\\[\\s\\S]",relevance:0},o4={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[ma]},i4={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[ma]},s4={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},Ac=function(e,t,n={}){let o=vr({scope:"comment",begin:e,end:t,contains:[]},n);o.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});let r=Tc("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return o.contains.push({begin:eo(/[ ]+/,"(",r,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),o},a4=Ac("//","$"),l4=Ac("/\\*","\\*/"),u4=Ac("#","$"),c4={scope:"number",begin:AS,relevance:0},d4={scope:"number",begin:MS,relevance:0},f4={scope:"number",begin:$S,relevance:0},p4={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[ma,{begin:/\[/,end:/\]/,relevance:0,contains:[ma]}]},h4={scope:"title",begin:TS,relevance:0},m4={scope:"title",begin:Eg,relevance:0},g4={begin:"\\.\\s*"+Eg,relevance:0},b4=function(e){return Object.assign(e,{"on:begin":(t,n)=>{n.data._beginMatch=t[1]},"on:end":(t,n)=>{n.data._beginMatch!==t[1]&&n.ignoreMatch()}})},_c=Object.freeze({__proto__:null,APOS_STRING_MODE:o4,BACKSLASH_ESCAPE:ma,BINARY_NUMBER_MODE:f4,BINARY_NUMBER_RE:$S,COMMENT:Ac,C_BLOCK_COMMENT_MODE:l4,C_LINE_COMMENT_MODE:a4,C_NUMBER_MODE:d4,C_NUMBER_RE:MS,END_SAME_AS_BEGIN:b4,HASH_COMMENT_MODE:u4,IDENT_RE:TS,MATCH_NOTHING_RE:t4,METHOD_GUARD:g4,NUMBER_MODE:c4,NUMBER_RE:AS,PHRASAL_WORDS_MODE:s4,QUOTE_STRING_MODE:i4,REGEXP_MODE:p4,RE_STARTERS_RE:n4,SHEBANG:r4,TITLE_MODE:h4,UNDERSCORE_IDENT_RE:Eg,UNDERSCORE_TITLE_MODE:m4});function y4(e,t){e.input[e.index-1]==="."&&t.ignoreMatch()}function v4(e,t){e.className!==void 0&&(e.scope=e.className,delete e.className)}function x4(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=y4,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0&&(e.relevance=0))}function k4(e,t){Array.isArray(e.illegal)&&(e.illegal=Tc(...e.illegal))}function w4(e,t){if(e.match){if(e.begin||e.end)throw new Error("begin & end are not supported with match");e.begin=e.match,delete e.match}}function S4(e,t){e.relevance===void 0&&(e.relevance=1)}var _4=(e,t)=>{if(!e.beforeMatch)return;if(e.starts)throw new Error("beforeMatch cannot be used with starts");let n=Object.assign({},e);Object.keys(e).forEach(o=>{delete e[o]}),e.keywords=n.keywords,e.begin=eo(n.beforeMatch,ES(n.begin)),e.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},e.relevance=0,delete n.beforeMatch},E4=["of","and","for","in","not","or","if","then","parent","list","value"],C4="keyword";function IS(e,t,n=C4){let o=Object.create(null);return typeof e=="string"?r(n,e.split(" ")):Array.isArray(e)?r(n,e):Object.keys(e).forEach(function(i){Object.assign(o,IS(e[i],t,i))}),o;function r(i,s){t&&(s=s.map(a=>a.toLowerCase())),s.forEach(function(a){let l=a.split("|");o[l[0]]=[i,T4(l[0],l[1])]})}}function T4(e,t){return t?Number(t):A4(e)?0:1}function A4(e){return E4.includes(e.toLowerCase())}var vS={},Yr=e=>{console.error(e)},xS=(e,...t)=>{console.log(`WARN: ${e}`,...t)},wi=(e,t)=>{vS[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),vS[`${e}/${t}`]=!0)},Cc=new Error;function DS(e,t,{key:n}){let o=0,r=e[n],i={},s={};for(let a=1;a<=t.length;a++)s[a+o]=r[a],i[a+o]=!0,o+=CS(t[a-1]);e[n]=s,e[n]._emit=i,e[n]._multi=!0}function M4(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw Yr("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Cc;if(typeof e.beginScope!="object"||e.beginScope===null)throw Yr("beginScope must be object"),Cc;DS(e,e.begin,{key:"beginScope"}),e.begin=_g(e.begin,{joinWith:""})}}function $4(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw Yr("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Cc;if(typeof e.endScope!="object"||e.endScope===null)throw Yr("endScope must be object"),Cc;DS(e,e.end,{key:"endScope"}),e.end=_g(e.end,{joinWith:""})}}function I4(e){e.scope&&typeof e.scope=="object"&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function D4(e){I4(e),typeof e.beginScope=="string"&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope=="string"&&(e.endScope={_wrap:e.endScope}),M4(e),$4(e)}function N4(e){function t(s,a){return new RegExp(ha(s),"m"+(e.case_insensitive?"i":"")+(e.unicodeRegex?"u":"")+(a?"g":""))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(a,l){l.position=this.position++,this.matchIndexes[this.matchAt]=l,this.regexes.push([l,a]),this.matchAt+=CS(a)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);let a=this.regexes.map(l=>l[1]);this.matcherRe=t(_g(a,{joinWith:"|"}),!0),this.lastIndex=0}exec(a){this.matcherRe.lastIndex=this.lastIndex;let l=this.matcherRe.exec(a);if(!l)return null;let u=l.findIndex((d,f)=>f>0&&d!==void 0),c=this.matchIndexes[u];return l.splice(0,u),Object.assign(l,c)}}class o{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(a){if(this.multiRegexes[a])return this.multiRegexes[a];let l=new n;return this.rules.slice(a).forEach(([u,c])=>l.addRule(u,c)),l.compile(),this.multiRegexes[a]=l,l}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(a,l){this.rules.push([a,l]),l.type==="begin"&&this.count++}exec(a){let l=this.getMatcher(this.regexIndex);l.lastIndex=this.lastIndex;let u=l.exec(a);if(this.resumingScanAtSamePosition()&&!(u&&u.index===this.lastIndex)){let c=this.getMatcher(0);c.lastIndex=this.lastIndex+1,u=c.exec(a)}return u&&(this.regexIndex+=u.position+1,this.regexIndex===this.count&&this.considerAll()),u}}function r(s){let a=new o;return s.contains.forEach(l=>a.addRule(l.begin,{rule:l,type:"begin"})),s.terminatorEnd&&a.addRule(s.terminatorEnd,{type:"end"}),s.illegal&&a.addRule(s.illegal,{type:"illegal"}),a}function i(s,a){let l=s;if(s.isCompiled)return l;[v4,w4,D4,_4].forEach(c=>c(s,a)),e.compilerExtensions.forEach(c=>c(s,a)),s.__beforeBegin=null,[x4,k4,S4].forEach(c=>c(s,a)),s.isCompiled=!0;let u=null;return typeof s.keywords=="object"&&s.keywords.$pattern&&(s.keywords=Object.assign({},s.keywords),u=s.keywords.$pattern,delete s.keywords.$pattern),u=u||/\w+/,s.keywords&&(s.keywords=IS(s.keywords,e.case_insensitive)),l.keywordPatternRe=t(u,!0),a&&(s.begin||(s.begin=/\B|\b/),l.beginRe=t(l.begin),!s.end&&!s.endsWithParent&&(s.end=/\B|\b/),s.end&&(l.endRe=t(l.end)),l.terminatorEnd=ha(l.end)||"",s.endsWithParent&&a.terminatorEnd&&(l.terminatorEnd+=(s.end?"|":"")+a.terminatorEnd)),s.illegal&&(l.illegalRe=t(s.illegal)),s.contains||(s.contains=[]),s.contains=[].concat(...s.contains.map(function(c){return z4(c==="self"?s:c)})),s.contains.forEach(function(c){i(c,l)}),s.starts&&i(s.starts,a),l.matcher=r(l),l}if(e.compilerExtensions||(e.compilerExtensions=[]),e.contains&&e.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=vr(e.classNameAliases||{}),i(e)}function NS(e){return e?e.endsWithParent||NS(e.starts):!1}function z4(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return vr(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:NS(e)?vr(e,{starts:e.starts?vr(e.starts):null}):Object.isFrozen(e)?vr(e):e}var O4="11.12.0",Sg=class extends Error{constructor(t,n){super(t),this.name="HTMLInjectionError",this.html=n}},vg=_S,kS=vr,wS=Symbol("nomatch"),R4=7,zS=function(e){let t=Object.create(null),n=Object.create(null),o=[],r=!0,i="Could not find the language '{}', did you forget to load/include a language module?",s={disableAutodetect:!0,name:"Plain text",contains:[]},a={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:wg};function l(A){return a.noHighlightRe.test(A)}function u(A){let H=A.className+" ";H+=A.parentNode?A.parentNode.className:"";let q=a.languageDetectRe.exec(H);if(q){let te=D(q[1]);return te||(xS(i.replace("{}",q[1])),xS("Falling back to no-highlight mode for this block.",A)),te?q[1]:"no-highlight"}return H.split(/\s+/).find(te=>l(te)||D(te))}function c(A,H,q){let te="",se="";typeof H=="object"?(te=A,q=H.ignoreIllegals,se=H.language):(wi("10.7.0","highlight(lang, code, ...args) has been deprecated."),wi("10.7.0",`Please use highlight(code, options) instead.
https://github.com/highlightjs/highlight.js/issues/2277`),se=A,te=H),q===void 0&&(q=!0);let w={code:te,language:se};xe("before:highlight",w);let _=w.result?w.result:d(w.language,w.code,q);return _.code=w.code,xe("after:highlight",_),_}function d(A,H,q,te){let se=Object.create(null);function w(C,z){return C.keywords[z]}function _(){if(!ae.keywords){tt.addText(Ie);return}let C=0;ae.keywordPatternRe.lastIndex=0;let z=ae.keywordPatternRe.exec(Ie),U="";for(;z;){U+=Ie.substring(C,z.index);let le=qe.case_insensitive?z[0].toLowerCase():z[0],Se=w(ae,le);if(Se){let[nt,_n]=Se;if(tt.addText(U),U="",se[le]=(se[le]||0)+1,se[le]<=R4&&(Fr+=_n),nt.startsWith("_"))U+=z[0];else{let jr=qe.classNameAliases[nt]||nt;ne(z[0],jr)}}else U+=z[0];C=ae.keywordPatternRe.lastIndex,z=ae.keywordPatternRe.exec(Ie)}U+=Ie.substring(C),tt.addText(U)}function O(){if(Ie==="")return;let C=null;if(typeof ae.subLanguage=="string"){if(!t[ae.subLanguage]){tt.addText(Ie);return}C=d(ae.subLanguage,Ie,!0,bs[ae.subLanguage]),bs[ae.subLanguage]=C._top}else C=h(Ie,ae.subLanguage.length?ae.subLanguage:null);ae.relevance>0&&(Fr+=C.relevance),tt.__addSublanguage(C._emitter,C.language)}function P(){ae.subLanguage!=null?O():_(),Ie=""}function ne(C,z){C!==""&&(tt.startScope(z),tt.addText(C),tt.endScope())}function Y(C,z){let U=1,le=z.length-1;for(;U<=le;){if(!C._emit[U]){U++;continue}let Se=qe.classNameAliases[C[U]]||C[U],nt=z[U];Se?ne(nt,Se):(Ie=nt,_(),Ie=""),U++}}function we(C,z){return C.scope&&typeof C.scope=="string"&&tt.openNode(qe.classNameAliases[C.scope]||C.scope),C.beginScope&&(C.beginScope._wrap?(ne(Ie,qe.classNameAliases[C.beginScope._wrap]||C.beginScope._wrap),Ie=""):C.beginScope._multi&&(Y(C.beginScope,z),Ie="")),ae=Object.create(C,{parent:{value:ae}}),ae}function lt(C,z,U){let le=YN(C.endRe,U);if(le){if(C["on:end"]){let Se=new Ec(C);C["on:end"](z,Se),Se.isMatchIgnored&&(le=!1)}if(le){for(;C.endsParent&&C.parent;)C=C.parent;return C}}if(C.endsWithParent)return lt(C.parent,z,U)}function ve(C){return ae.matcher.regexIndex===0?(Ie+=C[0],1):(Fo=!0,0)}function Re(C){let z=C[0],U=C.rule,le=new Ec(U),Se=[U.__beforeBegin,U["on:begin"]];for(let nt of Se)if(nt&&(nt(C,le),le.isMatchIgnored))return ve(z);return U.skip?Ie+=z:(U.excludeBegin&&(Ie+=z),P(),!U.returnBegin&&!U.excludeBegin&&(Ie=z)),we(U,C),U.returnBegin?0:z.length}function bt(C){let z=C[0],U=H.substring(C.index),le=lt(ae,C,U);if(!le)return wS;let Se=ae;ae.endScope&&ae.endScope._wrap?(P(),ne(z,ae.endScope._wrap)):ae.endScope&&ae.endScope._multi?(P(),Y(ae.endScope,C)):Se.skip?Ie+=z:(Se.returnEnd||Se.excludeEnd||(Ie+=z),P(),Se.excludeEnd&&(Ie=z));do ae.scope&&tt.closeNode(),!ae.skip&&!ae.subLanguage&&(Fr+=ae.relevance),ae=ae.parent;while(ae!==le.parent);return le.starts&&we(le.starts,C),Se.returnEnd?0:z.length}function Ct(){let C=[];for(let z=ae;z!==qe;z=z.parent)z.scope&&C.unshift(z.scope);C.forEach(z=>tt.openNode(z))}let He={};function ze(C,z){let U=z&&z[0];if(Ie+=C,U==null)return P(),0;if(He.type==="begin"&&z.type==="end"&&He.index===z.index&&U===""){if(Ie+=H.slice(z.index,z.index+1),!r){let le=new Error(`0 width match regex (${A})`);throw le.languageName=A,le.badRule=He.rule,le}return 1}if(He=z,z.type==="begin")return Re(z);if(z.type==="illegal"&&!q){let le=new Error('Illegal lexeme "'+U+'" for mode "'+(ae.scope||"<unnamed>")+'"');throw le.mode=ae,le}else if(z.type==="end"){let le=bt(z);if(le!==wS)return le}if(z.type==="illegal"&&U==="")return z.index===H.length||(Ie+=`
`),1;if(Lo>1e5&&Lo>z.index*3)throw new Error("potential infinite loop, way more iterations than matches");return Ie+=U,U.length}let qe=D(A);if(!qe)throw Yr(i.replace("{}",A)),new Error('Unknown language: "'+A+'"');let Po=N4(qe),wn="",ae=te||Po,bs={},tt=new a.__emitter(a);Ct();let Ie="",Fr=0,Sn=0,Lo=0,Fo=!1;try{if(qe.__emitTokens)qe.__emitTokens(H,tt);else{for(ae.matcher.considerAll();;){Lo++,Fo?Fo=!1:ae.matcher.considerAll(),ae.matcher.lastIndex=Sn;let C=ae.matcher.exec(H);if(!C)break;let z=H.substring(Sn,C.index),U=ze(z,C);Sn=C.index+U}ze(H.substring(Sn))}return tt.finalize(),wn=tt.toHTML(),{language:A,value:wn,relevance:Fr,illegal:!1,_emitter:tt,_top:ae}}catch(C){if(C.message&&C.message.includes("Illegal"))return{language:A,value:vg(H),illegal:!0,relevance:0,_illegalBy:{message:C.message,index:Sn,context:H.slice(Sn-100,Sn+100),mode:C.mode,resultSoFar:wn},_emitter:tt};if(r)return{language:A,value:vg(H),illegal:!1,relevance:0,errorRaised:C,_emitter:tt,_top:ae};throw C}}function f(A){let H={value:vg(A),illegal:!1,relevance:0,_top:s,_emitter:new a.__emitter(a)};return H._emitter.addText(A),H}function h(A,H){H=H||a.languages||Object.keys(t);let q=f(A),te=H.filter(D).filter(re).map(P=>d(P,A,!1));te.unshift(q);let se=te.sort((P,ne)=>{if(P.relevance!==ne.relevance)return ne.relevance-P.relevance;if(P.language&&ne.language){if(D(P.language).supersetOf===ne.language)return 1;if(D(ne.language).supersetOf===P.language)return-1}return 0}),[w,_]=se,O=w;return O.secondBest=_,O}function p(A,H,q){let te=H&&n[H]||q;A.classList.add("hljs"),A.classList.add(`language-${te}`)}function m(A){let H=null,q=u(A);if(l(q))return;if(xe("before:highlightElement",{el:A,language:q}),A.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",A);return}if(A.children.length>0&&(a.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(A)),a.throwUnescapedHTML))throw new Sg("One of your code blocks includes unescaped HTML.",A.innerHTML);H=A;let te=H.textContent,se=q?c(te,{language:q,ignoreIllegals:!0}):h(te);A.innerHTML=se.value,A.dataset.highlighted="yes",p(A,q,se.language),A.result={language:se.language,re:se.relevance,relevance:se.relevance},se.secondBest&&(A.secondBest={language:se.secondBest.language,relevance:se.secondBest.relevance}),xe("after:highlightElement",{el:A,result:se,text:te})}function g(A){a=kS(a,A)}let b=()=>{x(),wi("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function y(){x(),wi("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let k=!1;function x(){function A(){x()}if(document.readyState==="loading"){k||window.addEventListener("DOMContentLoaded",A,!1),k=!0;return}document.querySelectorAll(a.cssSelector).forEach(m)}function E(A,H){let q=null;try{q=H(e)}catch(te){if(Yr("Language definition for '{}' could not be registered.".replace("{}",A)),r)Yr(te);else throw te;q=s}q.name||(q.name=A),t[A]=q,q.rawDefinition=H.bind(null,e),q.aliases&&W(q.aliases,{languageName:A})}function I(A){delete t[A];for(let H of Object.keys(n))n[H]===A&&delete n[H]}function N(){return Object.keys(t)}function D(A){return A=(A||"").toLowerCase(),t[A]||t[n[A]]}function W(A,{languageName:H}){typeof A=="string"&&(A=[A]),A.forEach(q=>{n[q.toLowerCase()]=H})}function re(A){let H=D(A);return H&&!H.disableAutodetect}function Oe(A){A["before:highlightBlock"]&&!A["before:highlightElement"]&&(A["before:highlightElement"]=H=>{A["before:highlightBlock"](Object.assign({block:H.el},H))}),A["after:highlightBlock"]&&!A["after:highlightElement"]&&(A["after:highlightElement"]=H=>{A["after:highlightBlock"](Object.assign({block:H.el},H))})}function We(A){Oe(A),o.push(A)}function Ge(A){let H=o.indexOf(A);H!==-1&&o.splice(H,1)}function xe(A,H){let q=A;o.forEach(function(te){te[q]&&te[q](H)})}function oe(A){return wi("10.7.0","highlightBlock will be removed entirely in v12.0"),wi("10.7.0","Please use highlightElement now."),m(A)}Object.assign(e,{highlight:c,highlightAuto:h,highlightAll:x,highlightElement:m,highlightBlock:oe,configure:g,initHighlighting:b,initHighlightingOnLoad:y,registerLanguage:E,unregisterLanguage:I,listLanguages:N,getLanguage:D,registerAliases:W,autoDetection:re,inherit:kS,addPlugin:We,removePlugin:Ge}),e.debugMode=function(){r=!1},e.safeMode=function(){r=!0},e.versionString=O4,e.regex={concat:eo,lookahead:ES,either:Tc,optional:QN,anyNumberOfTimes:GN};for(let A in _c)typeof _c[A]=="object"&&SS(_c[A]);return Object.assign(e,_c),e},Si=zS({});Si.newInstance=()=>zS({});OS.exports=Si;Si.HighlightJS=Si;Si.default=Si});var b$=Rv((jne,g$)=>{var dv=!0,h$=!1,m$=!1;g$.exports=function(e,t){t&&(dv=!t.enabled,h$=!!t.label,m$=!!t.labelAfter),e.core.ruler.after("inline","github-task-lists",function(n){for(var o=n.tokens,r=2;r<o.length;r++)uB(o,r)&&(cB(o[r],n.Token),p$(o[r-2],"class","task-list-item"+(dv?"":" enabled")),p$(o[lB(o,r-2)],"class","contains-task-list"))})};function p$(e,t,n){var o=e.attrIndex(t),r=[t,n];o<0?e.attrPush(r):e.attrs[o]=r}function lB(e,t){for(var n=e[t].level-1,o=t-1;o>=0;o--)if(e[o].level===n)return o;return-1}function uB(e,t){return mB(e[t])&&gB(e[t-1])&&bB(e[t-2])&&yB(e[t])}function cB(e,t){if(e.children.unshift(dB(e,t)),e.children[1].content=e.children[1].content.slice(3),e.content=e.content.slice(3),h$)if(m$){e.children.pop();var n="task-item-"+Math.ceil(Math.random()*(1e4*1e3)-1e3);e.children[0].content=e.children[0].content.slice(0,-1)+' id="'+n+'">',e.children.push(hB(e.content,n,t))}else e.children.unshift(fB(t)),e.children.push(pB(t))}function dB(e,t){var n=new t("html_inline","",0),o=dv?' disabled="" ':"";return e.content.indexOf("[ ] ")===0?n.content='<input class="task-list-item-checkbox"'+o+'type="checkbox">':(e.content.indexOf("[x] ")===0||e.content.indexOf("[X] ")===0)&&(n.content='<input class="task-list-item-checkbox" checked=""'+o+'type="checkbox">'),n}function fB(e){var t=new e("html_inline","",0);return t.content="<label>",t}function pB(e){var t=new e("html_inline","",0);return t.content="</label>",t}function hB(e,t,n){var o=new n("html_inline","",0);return o.content='<label class="task-list-item-label" for="'+t+'">'+e+"</label>",o.attrs=[{for:t}],o}function mB(e){return e.type==="inline"}function gB(e){return e.type==="paragraph_open"}function bB(e){return e.type==="list_item_open"}function yB(e){return e.content.indexOf("[ ] ")===0||e.content.indexOf("[x] ")===0||e.content.indexOf("[X] ")===0}});Bt();function _u(e){return!!e._zod}function Eu(e,t){return _u(e)?Vo(e,t):e.safeParse(t)}function zk(e){if(!e)return;let t;if(_u(e)?t=e._zod?.def?.shape:t=e.shape,!!t){if(typeof t=="function")try{return t()}catch{return}return t}}function Ok(e){if(_u(e)){let i=e._zod?.def;if(i){if(i.value!==void 0)return i.value;if(Array.isArray(i.values)&&i.values.length>0)return i.values[0]}}let n=e._def;if(n){if(n.value!==void 0)return n.value;if(Array.isArray(n.values)&&n.values.length>0)return n.values[0]}let o=e.value;if(o!==void 0)return o}ta();var br="io.modelcontextprotocol/related-task",lc="2.0",ct=ic(e=>e!==null&&(typeof e=="object"||typeof e=="function")),Uw=De([T(),_e().int()]),Hw=T(),Hq=yt({ttl:_e().optional(),pollInterval:_e().optional()}),M6=V({ttl:_e().optional()}),$6=V({taskId:T()}),J0=yt({progressToken:Uw.optional(),[br]:$6.optional()}),Kt=V({_meta:J0.optional()}),na=Kt.extend({task:M6.optional()}),qw=e=>na.safeParse(e).success,vt=V({method:T(),params:Kt.loose().optional()}),tn=V({_meta:J0.optional()}),nn=V({method:T(),params:tn.loose().optional()}),xt=yt({_meta:J0.optional()}),bi=De([T(),_e().int()]),Zw=V({jsonrpc:G(lc),id:bi,...vt.shape}).strict(),G0=e=>Zw.safeParse(e).success,Vw=V({jsonrpc:G(lc),...nn.shape}).strict(),Ww=e=>Vw.safeParse(e).success,Q0=V({jsonrpc:G(lc),id:bi,result:xt}).strict(),ra=e=>Q0.safeParse(e).success;var Ee;(function(e){e[e.ConnectionClosed=-32e3]="ConnectionClosed",e[e.RequestTimeout=-32001]="RequestTimeout",e[e.ParseError=-32700]="ParseError",e[e.InvalidRequest=-32600]="InvalidRequest",e[e.MethodNotFound=-32601]="MethodNotFound",e[e.InvalidParams=-32602]="InvalidParams",e[e.InternalError=-32603]="InternalError",e[e.UrlElicitationRequired=-32042]="UrlElicitationRequired"})(Ee||(Ee={}));var X0=V({jsonrpc:G(lc),id:bi.optional(),error:V({code:_e().int(),message:T(),data:Be().optional()})}).strict();var Kw=e=>X0.safeParse(e).success;var Jw=De([Zw,Vw,Q0,X0]),qq=De([Q0,X0]),uc=xt.strict(),I6=tn.extend({requestId:bi.optional(),reason:T().optional()}),cc=nn.extend({method:G("notifications/cancelled"),params:I6}),D6=V({src:T(),mimeType:T().optional(),sizes:me(T()).optional(),theme:Tt(["light","dark"]).optional()}),oa=V({icons:me(D6).optional()}),gi=V({name:T(),title:T().optional()}),ia=gi.extend({...gi.shape,...oa.shape,version:T(),websiteUrl:T().optional(),description:T().optional()}),N6=mi(V({applyDefaults:Xe().optional()}),Ne(T(),Be())),z6=ea(e=>e&&typeof e=="object"&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,mi(V({form:N6.optional(),url:ct.optional()}),Ne(T(),Be()).optional())),O6=yt({list:ct.optional(),cancel:ct.optional(),requests:yt({sampling:yt({createMessage:ct.optional()}).optional(),elicitation:yt({create:ct.optional()}).optional()}).optional()}),R6=yt({list:ct.optional(),cancel:ct.optional(),requests:yt({tools:yt({call:ct.optional()}).optional()}).optional()}),P6=V({experimental:Ne(T(),ct).optional(),sampling:V({context:ct.optional(),tools:ct.optional()}).optional(),elicitation:z6.optional(),roots:V({listChanged:Xe().optional()}).optional(),tasks:O6.optional(),extensions:Ne(T(),ct).optional()}),L6=Kt.extend({protocolVersion:T(),capabilities:P6,clientInfo:ia}),F6=vt.extend({method:G("initialize"),params:L6});var j6=V({experimental:Ne(T(),ct).optional(),logging:ct.optional(),completions:ct.optional(),prompts:V({listChanged:Xe().optional()}).optional(),resources:V({subscribe:Xe().optional(),listChanged:Xe().optional()}).optional(),tools:V({listChanged:Xe().optional()}).optional(),tasks:R6.optional(),extensions:Ne(T(),ct).optional()}),B6=xt.extend({protocolVersion:T(),capabilities:j6,serverInfo:ia,instructions:T().optional()}),U6=nn.extend({method:G("notifications/initialized"),params:tn.optional()});var yi=vt.extend({method:G("ping"),params:Kt.optional()}),H6=V({progress:_e(),total:Fe(_e()),message:Fe(T())}),q6=V({...tn.shape,...H6.shape,progressToken:Uw}),dc=nn.extend({method:G("notifications/progress"),params:q6}),Z6=Kt.extend({cursor:Hw.optional()}),sa=vt.extend({params:Z6.optional()}),aa=xt.extend({nextCursor:Hw.optional()}),V6=Tt(["working","input_required","completed","failed","cancelled"]),la=V({taskId:T(),status:V6,ttl:De([_e(),Ks()]),createdAt:T(),lastUpdatedAt:T(),pollInterval:Fe(_e()),statusMessage:Fe(T())}),fc=xt.extend({task:la}),W6=tn.merge(la),ua=nn.extend({method:G("notifications/tasks/status"),params:W6}),pc=vt.extend({method:G("tasks/get"),params:Kt.extend({taskId:T()})}),hc=xt.merge(la),mc=vt.extend({method:G("tasks/result"),params:Kt.extend({taskId:T()})}),Zq=xt.loose(),gc=sa.extend({method:G("tasks/list")}),bc=aa.extend({tasks:me(la)}),yc=vt.extend({method:G("tasks/cancel"),params:Kt.extend({taskId:T()})}),Gw=xt.merge(la),Qw=V({uri:T(),mimeType:Fe(T()),_meta:Ne(T(),Be()).optional()}),Xw=Qw.extend({text:T()}),Y0=T().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:"Invalid Base64 string"}),Yw=Qw.extend({blob:Y0}),ca=Tt(["user","assistant"]),vi=V({audience:me(ca).optional(),priority:_e().min(0).max(1).optional(),lastModified:Gr.datetime({offset:!0}).optional()}),eS=V({...gi.shape,...oa.shape,uri:T(),description:Fe(T()),mimeType:Fe(T()),size:Fe(_e()),annotations:vi.optional(),_meta:Fe(yt({}))}),K6=V({...gi.shape,...oa.shape,uriTemplate:T(),description:Fe(T()),mimeType:Fe(T()),annotations:vi.optional(),_meta:Fe(yt({}))}),J6=sa.extend({method:G("resources/list")}),eg=aa.extend({resources:me(eS)}),G6=sa.extend({method:G("resources/templates/list")}),Q6=aa.extend({resourceTemplates:me(K6)}),tg=Kt.extend({uri:T()}),X6=tg,Y6=vt.extend({method:G("resources/read"),params:X6}),ng=xt.extend({contents:me(De([Xw,Yw]))}),eD=nn.extend({method:G("notifications/resources/list_changed"),params:tn.optional()}),tD=tg,nD=vt.extend({method:G("resources/subscribe"),params:tD}),rD=tg,oD=vt.extend({method:G("resources/unsubscribe"),params:rD}),iD=tn.extend({uri:T()}),sD=nn.extend({method:G("notifications/resources/updated"),params:iD}),aD=V({name:T(),description:Fe(T()),required:Fe(Xe())}),lD=V({...gi.shape,...oa.shape,description:Fe(T()),arguments:Fe(me(aD)),_meta:Fe(yt({}))}),uD=sa.extend({method:G("prompts/list")}),cD=aa.extend({prompts:me(lD)}),dD=Kt.extend({name:T(),arguments:Ne(T(),T()).optional()}),fD=vt.extend({method:G("prompts/get"),params:dD}),rg=V({type:G("text"),text:T(),annotations:vi.optional(),_meta:Ne(T(),Be()).optional()}),og=V({type:G("image"),data:Y0,mimeType:T(),annotations:vi.optional(),_meta:Ne(T(),Be()).optional()}),ig=V({type:G("audio"),data:Y0,mimeType:T(),annotations:vi.optional(),_meta:Ne(T(),Be()).optional()}),pD=V({type:G("tool_use"),name:T(),id:T(),input:Ne(T(),Be()),_meta:Ne(T(),Be()).optional()}),sg=V({type:G("resource"),resource:De([Xw,Yw]),annotations:vi.optional(),_meta:Ne(T(),Be()).optional()}),ag=eS.extend({type:G("resource_link")}),xi=De([rg,og,ig,ag,sg]),hD=V({role:ca,content:xi}),mD=xt.extend({description:T().optional(),messages:me(hD)}),gD=nn.extend({method:G("notifications/prompts/list_changed"),params:tn.optional()}),bD=V({title:T().optional(),readOnlyHint:Xe().optional(),destructiveHint:Xe().optional(),idempotentHint:Xe().optional(),openWorldHint:Xe().optional()}),yD=V({taskSupport:Tt(["required","optional","forbidden"]).optional()}),vc=V({...gi.shape,...oa.shape,description:T().optional(),inputSchema:V({type:G("object"),properties:Ne(T(),ct).optional(),required:me(T()).optional()}).catchall(Be()),outputSchema:V({type:G("object"),properties:Ne(T(),ct).optional(),required:me(T()).optional()}).catchall(Be()).optional(),annotations:bD.optional(),execution:yD.optional(),_meta:Ne(T(),Be()).optional()}),lg=sa.extend({method:G("tools/list")}),vD=aa.extend({tools:me(vc)}),ki=xt.extend({content:me(xi).default([]),structuredContent:Ne(T(),Be()).optional(),isError:Xe().optional()}),Vq=ki.or(xt.extend({toolResult:Be()})),xD=na.extend({name:T(),arguments:Ne(T(),Be()).optional()}),ug=vt.extend({method:G("tools/call"),params:xD}),kD=nn.extend({method:G("notifications/tools/list_changed"),params:tn.optional()}),Wq=V({autoRefresh:Xe().default(!0),debounceMs:_e().int().nonnegative().default(300)}),tS=Tt(["debug","info","notice","warning","error","critical","alert","emergency"]),wD=Kt.extend({level:tS}),SD=vt.extend({method:G("logging/setLevel"),params:wD}),_D=tn.extend({level:tS,logger:T().optional(),data:Be()}),ED=nn.extend({method:G("notifications/message"),params:_D}),CD=V({name:T().optional()}),TD=V({hints:me(CD).optional(),costPriority:_e().min(0).max(1).optional(),speedPriority:_e().min(0).max(1).optional(),intelligencePriority:_e().min(0).max(1).optional()}),AD=V({mode:Tt(["auto","required","none"]).optional()}),MD=V({type:G("tool_result"),toolUseId:T().describe("The unique identifier for the corresponding tool call."),content:me(xi).default([]),structuredContent:V({}).loose().optional(),isError:Xe().optional(),_meta:Ne(T(),Be()).optional()}),$D=Xs("type",[rg,og,ig]),ac=Xs("type",[rg,og,ig,pD,MD]),ID=V({role:ca,content:De([ac,me(ac)]),_meta:Ne(T(),Be()).optional()}),DD=na.extend({messages:me(ID),modelPreferences:TD.optional(),systemPrompt:T().optional(),includeContext:Tt(["none","thisServer","allServers"]).optional(),temperature:_e().optional(),maxTokens:_e().int(),stopSequences:me(T()).optional(),metadata:ct.optional(),tools:me(vc).optional(),toolChoice:AD.optional()}),ND=vt.extend({method:G("sampling/createMessage"),params:DD}),cg=xt.extend({model:T(),stopReason:Fe(Tt(["endTurn","stopSequence","maxTokens"]).or(T())),role:ca,content:$D}),dg=xt.extend({model:T(),stopReason:Fe(Tt(["endTurn","stopSequence","maxTokens","toolUse"]).or(T())),role:ca,content:De([ac,me(ac)])}),zD=V({type:G("boolean"),title:T().optional(),description:T().optional(),default:Xe().optional()}),OD=V({type:G("string"),title:T().optional(),description:T().optional(),minLength:_e().optional(),maxLength:_e().optional(),format:Tt(["email","uri","date","date-time"]).optional(),default:T().optional()}),RD=V({type:Tt(["number","integer"]),title:T().optional(),description:T().optional(),minimum:_e().optional(),maximum:_e().optional(),default:_e().optional()}),PD=V({type:G("string"),title:T().optional(),description:T().optional(),enum:me(T()),default:T().optional()}),LD=V({type:G("string"),title:T().optional(),description:T().optional(),oneOf:me(V({const:T(),title:T()})),default:T().optional()}),FD=V({type:G("string"),title:T().optional(),description:T().optional(),enum:me(T()),enumNames:me(T()).optional(),default:T().optional()}),jD=De([PD,LD]),BD=V({type:G("array"),title:T().optional(),description:T().optional(),minItems:_e().optional(),maxItems:_e().optional(),items:V({type:G("string"),enum:me(T())}),default:me(T()).optional()}),UD=V({type:G("array"),title:T().optional(),description:T().optional(),minItems:_e().optional(),maxItems:_e().optional(),items:V({anyOf:me(V({const:T(),title:T()}))}),default:me(T()).optional()}),HD=De([BD,UD]),qD=De([FD,jD,HD]),ZD=De([qD,zD,OD,RD]),VD=na.extend({mode:G("form").optional(),message:T(),requestedSchema:V({type:G("object"),properties:Ne(T(),ZD),required:me(T()).optional()})}),WD=na.extend({mode:G("url"),message:T(),elicitationId:T(),url:T().url()}),KD=De([VD,WD]),JD=vt.extend({method:G("elicitation/create"),params:KD}),GD=tn.extend({elicitationId:T()}),QD=nn.extend({method:G("notifications/elicitation/complete"),params:GD}),XD=xt.extend({action:Tt(["accept","decline","cancel"]),content:ea(e=>e===null?void 0:e,Ne(T(),De([T(),_e(),Xe(),me(T())])).optional())}),YD=V({type:G("ref/resource"),uri:T()});var eN=V({type:G("ref/prompt"),name:T()}),tN=Kt.extend({ref:De([eN,YD]),argument:V({name:T(),value:T()}),context:V({arguments:Ne(T(),T()).optional()}).optional()}),nN=vt.extend({method:G("completion/complete"),params:tN});var rN=xt.extend({completion:yt({values:me(T()).max(100),total:Fe(_e().int()),hasMore:Fe(Xe())})}),oN=V({uri:T().startsWith("file://"),name:T().optional(),_meta:Ne(T(),Be()).optional()}),iN=vt.extend({method:G("roots/list"),params:Kt.optional()}),sN=xt.extend({roots:me(oN)}),aN=nn.extend({method:G("notifications/roots/list_changed"),params:tn.optional()}),Kq=De([yi,F6,nN,SD,fD,uD,J6,G6,Y6,nD,oD,ug,lg,pc,mc,gc,yc]),Jq=De([cc,dc,U6,aN,ua]),Gq=De([uc,cg,dg,XD,sN,hc,bc,fc]),Qq=De([yi,ND,JD,iN,pc,mc,gc,yc]),Xq=De([cc,dc,ED,sD,eD,kD,gD,ua,QD]),Yq=De([uc,B6,rN,mD,cD,eg,Q6,ng,ki,vD,hc,bc,fc]),ge=class e extends Error{constructor(t,n,o){super(`MCP error ${t}: ${n}`),this.code=t,this.data=o,this.name="McpError"}static fromError(t,n,o){if(t===Ee.UrlElicitationRequired&&o){let r=o;if(r.elicitations)return new K0(r.elicitations,n)}return new e(t,n,o)}},K0=class extends ge{constructor(t,n=`URL elicitation${t.length>1?"s":""} required`){super(Ee.UrlElicitationRequired,n,{elicitations:t})}get elicitations(){return this.data?.elicitations??[]}};function yr(e){return e==="completed"||e==="failed"||e==="cancelled"}var DZ=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function fg(e){let n=zk(e)?.method;if(!n)throw new Error("Schema is missing a method literal");let o=Ok(n);if(typeof o!="string")throw new Error("Schema method literal must be a string");return o}function pg(e,t){let n=Eu(e,t);if(!n.success)throw n.error;return n.data}var pN=6e4,xc=class{constructor(t){this._options=t,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this._taskProgressTokens=new Map,this._requestResolvers=new Map,this.setNotificationHandler(cc,n=>{this._oncancel(n)}),this.setNotificationHandler(dc,n=>{this._onprogress(n)}),this.setRequestHandler(yi,n=>({})),this._taskStore=t?.taskStore,this._taskMessageQueue=t?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(pc,async(n,o)=>{let r=await this._taskStore.getTask(n.params.taskId,o.sessionId);if(!r)throw new ge(Ee.InvalidParams,"Failed to retrieve task: Task not found");return{...r}}),this.setRequestHandler(mc,async(n,o)=>{let r=async()=>{let i=n.params.taskId;if(!await this._taskStore.getTask(i,o.sessionId))throw new ge(Ee.InvalidParams,`Task not found: ${i}`);if(this._taskMessageQueue){let a;for(;a=await this._taskMessageQueue.dequeue(i,o.sessionId);){if(a.type==="response"||a.type==="error"){let l=a.message,u=l.id,c=this._requestResolvers.get(u);if(c)if(this._requestResolvers.delete(u),a.type==="response")c(l);else{let d=l,f=new ge(d.error.code,d.error.message,d.error.data);c(f)}else{let d=a.type==="response"?"Response":"Error";this._onerror(new Error(`${d} handler missing for request ${u}`))}continue}await this._transport?.send(a.message,{relatedRequestId:o.requestId})}}let s=await this._taskStore.getTask(i,o.sessionId);if(!s)throw new ge(Ee.InvalidParams,`Task not found: ${i}`);if(!yr(s.status))return await this._waitForTaskUpdate(i,o.signal,o.sessionId),await r();if(yr(s.status)){let a=await this._taskStore.getTaskResult(i,o.sessionId);return this._clearTaskQueue(i,o.sessionId),{...a,_meta:{...a._meta,[br]:{taskId:i}}}}return await r()};return await r()}),this.setRequestHandler(gc,async(n,o)=>{try{let{tasks:r,nextCursor:i}=await this._taskStore.listTasks(n.params?.cursor,o.sessionId);return{tasks:r,nextCursor:i,_meta:{}}}catch(r){throw new ge(Ee.InvalidParams,`Failed to list tasks: ${r instanceof Error?r.message:String(r)}`)}}),this.setRequestHandler(yc,async(n,o)=>{try{let r=await this._taskStore.getTask(n.params.taskId,o.sessionId);if(!r)throw new ge(Ee.InvalidParams,`Task not found: ${n.params.taskId}`);if(yr(r.status))throw new ge(Ee.InvalidParams,`Cannot cancel task in terminal status: ${r.status}`);await this._taskStore.updateTaskStatus(n.params.taskId,"cancelled","Client cancelled task execution.",o.sessionId),this._clearTaskQueue(n.params.taskId,o.sessionId);let i=await this._taskStore.getTask(n.params.taskId,o.sessionId);if(!i)throw new ge(Ee.InvalidParams,`Task not found after cancellation: ${n.params.taskId}`);return{_meta:{},...i}}catch(r){throw r instanceof ge?r:new ge(Ee.InvalidRequest,`Failed to cancel task: ${r instanceof Error?r.message:String(r)}`)}}))}async _oncancel(t){if(!t.params.requestId)return;this._requestHandlerAbortControllers.get(t.params.requestId)?.abort(t.params.reason)}_setupTimeout(t,n,o,r,i=!1){this._timeoutInfo.set(t,{timeoutId:setTimeout(r,n),startTime:Date.now(),timeout:n,maxTotalTimeout:o,resetTimeoutOnProgress:i,onTimeout:r})}_resetTimeout(t){let n=this._timeoutInfo.get(t);if(!n)return!1;let o=Date.now()-n.startTime;if(n.maxTotalTimeout&&o>=n.maxTotalTimeout)throw this._timeoutInfo.delete(t),ge.fromError(Ee.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:n.maxTotalTimeout,totalElapsed:o});return clearTimeout(n.timeoutId),n.timeoutId=setTimeout(n.onTimeout,n.timeout),!0}_cleanupTimeout(t){let n=this._timeoutInfo.get(t);n&&(clearTimeout(n.timeoutId),this._timeoutInfo.delete(t))}async connect(t){if(this._transport)throw new Error("Already connected to a transport. Call close() before connecting to a new transport, or use a separate Protocol instance per connection.");this._transport=t;let n=this.transport?.onclose;this._transport.onclose=()=>{n?.(),this._onclose()};let o=this.transport?.onerror;this._transport.onerror=i=>{o?.(i),this._onerror(i)};let r=this._transport?.onmessage;this._transport.onmessage=(i,s)=>{r?.(i,s),ra(i)||Kw(i)?this._onresponse(i):G0(i)?this._onrequest(i,s):Ww(i)?this._onnotification(i):this._onerror(new Error(`Unknown message type: ${JSON.stringify(i)}`))},await this._transport.start()}_onclose(){let t=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();for(let o of this._timeoutInfo.values())clearTimeout(o.timeoutId);this._timeoutInfo.clear();for(let o of this._requestHandlerAbortControllers.values())o.abort();this._requestHandlerAbortControllers.clear();let n=ge.fromError(Ee.ConnectionClosed,"Connection closed");this._transport=void 0,this.onclose?.();for(let o of t.values())o(n)}_onerror(t){this.onerror?.(t)}_onnotification(t){let n=this._notificationHandlers.get(t.method)??this.fallbackNotificationHandler;n!==void 0&&Promise.resolve().then(()=>n(t)).catch(o=>this._onerror(new Error(`Uncaught error in notification handler: ${o}`)))}_onrequest(t,n){let o=this._requestHandlers.get(t.method)??this.fallbackRequestHandler,r=this._transport,i=t.params?._meta?.[br]?.taskId,s=r?.sessionId,a=this._taskStore,l=!0,u;if(i&&a&&this._taskMessageQueue&&s!==void 0&&(l=!1,u=(async()=>{if(!await a.getTask(i,s))throw new ge(Ee.InvalidParams,`Task not found: ${i}`);l=!0})()),o===void 0){let p={jsonrpc:"2.0",id:t.id,error:{code:Ee.MethodNotFound,message:"Method not found"}};if(i&&u){let m={type:"error",message:p,timestamp:Date.now()};u.then(()=>this._enqueueTaskMessage(i,m,s),()=>r?.send(p)).catch(g=>this._onerror(new Error(`Failed to send an error response: ${g}`)))}else i&&this._taskMessageQueue?this._enqueueTaskMessage(i,{type:"error",message:p,timestamp:Date.now()},r?.sessionId).catch(m=>this._onerror(new Error(`Failed to enqueue error response: ${m}`))):r?.send(p).catch(m=>this._onerror(new Error(`Failed to send an error response: ${m}`)));return}let c=new AbortController;this._requestHandlerAbortControllers.set(t.id,c);let d=qw(t.params)?t.params.task:void 0,f=this._taskStore?this.requestTaskStore(t,r?.sessionId):void 0,h={signal:c.signal,sessionId:r?.sessionId,_meta:t.params?._meta,sendNotification:async p=>{if(c.signal.aborted)return;let m={relatedRequestId:t.id};i&&(m.relatedTask={taskId:i}),await this.notification(p,m)},sendRequest:async(p,m,g)=>{if(c.signal.aborted)throw new ge(Ee.ConnectionClosed,"Request was cancelled");let b={...g,relatedRequestId:t.id};i&&!b.relatedTask&&(b.relatedTask={taskId:i});let y=b.relatedTask?.taskId??i;return y&&f&&await f.updateTaskStatus(y,"input_required"),await this.request(p,m,b)},authInfo:n?.authInfo,requestId:t.id,requestInfo:n?.requestInfo,taskId:i,taskStore:f,taskRequestedTtl:d?.ttl,closeSSEStream:n?.closeSSEStream,closeStandaloneSSEStream:n?.closeStandaloneSSEStream};(u??Promise.resolve()).then(()=>{if(u&&c.signal.aborted)throw new ge(Ee.ConnectionClosed,"Request was cancelled");d&&this.assertTaskHandlerCapability(t.method)}).then(()=>o(t,h)).then(async p=>{if(c.signal.aborted)return;let m={result:p,jsonrpc:"2.0",id:t.id};i&&this._taskMessageQueue?await this._enqueueTaskMessage(i,{type:"response",message:m,timestamp:Date.now()},r?.sessionId):await r?.send(m)},async p=>{if(c.signal.aborted)return;let m={jsonrpc:"2.0",id:t.id,error:{code:Number.isSafeInteger(p.code)?p.code:Ee.InternalError,message:p.message??"Internal error",...p.data!==void 0&&{data:p.data}}};i&&this._taskMessageQueue&&l?await this._enqueueTaskMessage(i,{type:"error",message:m,timestamp:Date.now()},r?.sessionId):await r?.send(m)}).catch(p=>this._onerror(new Error(`Failed to send response: ${p}`))).finally(()=>{this._requestHandlerAbortControllers.get(t.id)===c&&this._requestHandlerAbortControllers.delete(t.id)})}_onprogress(t){let{progressToken:n,...o}=t.params,r=Number(n),i=this._progressHandlers.get(r);if(!i){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(t)}`));return}let s=this._responseHandlers.get(r),a=this._timeoutInfo.get(r);if(a&&s&&a.resetTimeoutOnProgress)try{this._resetTimeout(r)}catch(l){this._responseHandlers.delete(r),this._progressHandlers.delete(r),this._cleanupTimeout(r),s(l);return}i(o)}_onresponse(t){let n=Number(t.id),o=this._requestResolvers.get(n);if(o){if(this._requestResolvers.delete(n),ra(t))o(t);else{let s=new ge(t.error.code,t.error.message,t.error.data);o(s)}return}let r=this._responseHandlers.get(n);if(r===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(t)}`));return}this._responseHandlers.delete(n),this._cleanupTimeout(n);let i=!1;if(ra(t)&&t.result&&typeof t.result=="object"){let s=t.result;if(s.task&&typeof s.task=="object"){let a=s.task;typeof a.taskId=="string"&&(i=!0,this._taskProgressTokens.set(a.taskId,n))}}if(i||this._progressHandlers.delete(n),ra(t))r(t);else{let s=ge.fromError(t.error.code,t.error.message,t.error.data);r(s)}}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream(t,n,o){let{task:r}=o??{};if(!r){try{yield{type:"result",result:await this.request(t,n,o)}}catch(s){yield{type:"error",error:s instanceof ge?s:new ge(Ee.InternalError,String(s))}}return}let i;try{let s=await this.request(t,fc,o);if(s.task)i=s.task.taskId,yield{type:"taskCreated",task:s.task};else throw new ge(Ee.InternalError,"Task creation did not return a task");for(;;){let a=await this.getTask({taskId:i},o);if(yield{type:"taskStatus",task:a},yr(a.status)){a.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:i},n,o)}:a.status==="failed"?yield{type:"error",error:new ge(Ee.InternalError,`Task ${i} failed`)}:a.status==="cancelled"&&(yield{type:"error",error:new ge(Ee.InternalError,`Task ${i} was cancelled`)});return}if(a.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:i},n,o)};return}let l=a.pollInterval??this._options?.defaultTaskPollInterval??1e3;await new Promise(u=>setTimeout(u,l)),o?.signal?.throwIfAborted()}}catch(s){yield{type:"error",error:s instanceof ge?s:new ge(Ee.InternalError,String(s))}}}request(t,n,o){let{relatedRequestId:r,resumptionToken:i,onresumptiontoken:s,task:a,relatedTask:l}=o??{};return new Promise((u,c)=>{let d=y=>{c(y)};if(!this._transport){d(new Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(t.method),a&&this.assertTaskCapability(t.method)}catch(y){d(y);return}o?.signal?.throwIfAborted();let f=this._requestMessageId++,h={...t,jsonrpc:"2.0",id:f};o?.onprogress&&(this._progressHandlers.set(f,o.onprogress),h.params={...t.params,_meta:{...t.params?._meta||{},progressToken:f}}),a&&(h.params={...h.params,task:a}),l&&(h.params={...h.params,_meta:{...h.params?._meta||{},[br]:l}});let p=y=>{this._responseHandlers.delete(f),this._progressHandlers.delete(f),this._cleanupTimeout(f),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:f,reason:String(y)}},{relatedRequestId:r,resumptionToken:i,onresumptiontoken:s}).catch(x=>this._onerror(new Error(`Failed to send cancellation: ${x}`)));let k=y instanceof ge?y:new ge(Ee.RequestTimeout,String(y));c(k)};this._responseHandlers.set(f,y=>{if(!o?.signal?.aborted){if(y instanceof Error)return c(y);try{let k=Eu(n,y.result);k.success?u(k.data):c(k.error)}catch(k){c(k)}}}),o?.signal?.addEventListener("abort",()=>{p(o?.signal?.reason)});let m=o?.timeout??pN,g=()=>p(ge.fromError(Ee.RequestTimeout,"Request timed out",{timeout:m}));this._setupTimeout(f,m,o?.maxTotalTimeout,g,o?.resetTimeoutOnProgress??!1);let b=l?.taskId;if(b){let y=k=>{let x=this._responseHandlers.get(f);x?x(k):this._onerror(new Error(`Response handler missing for side-channeled request ${f}`))};this._requestResolvers.set(f,y),this._enqueueTaskMessage(b,{type:"request",message:h,timestamp:Date.now()}).catch(k=>{this._cleanupTimeout(f),c(k)})}else this._transport.send(h,{relatedRequestId:r,resumptionToken:i,onresumptiontoken:s}).catch(y=>{this._cleanupTimeout(f),c(y)})})}async getTask(t,n){return this.request({method:"tasks/get",params:t},hc,n)}async getTaskResult(t,n,o){return this.request({method:"tasks/result",params:t},n,o)}async listTasks(t,n){return this.request({method:"tasks/list",params:t},bc,n)}async cancelTask(t,n){return this.request({method:"tasks/cancel",params:t},Gw,n)}async notification(t,n){if(!this._transport)throw new Error("Not connected");this.assertNotificationCapability(t.method);let o=n?.relatedTask?.taskId;if(o){let a={...t,jsonrpc:"2.0",params:{...t.params,_meta:{...t.params?._meta||{},[br]:n.relatedTask}}};await this._enqueueTaskMessage(o,{type:"notification",message:a,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes(t.method)&&!t.params&&!n?.relatedRequestId&&!n?.relatedTask){if(this._pendingDebouncedNotifications.has(t.method))return;this._pendingDebouncedNotifications.add(t.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(t.method),!this._transport)return;let a={...t,jsonrpc:"2.0"};n?.relatedTask&&(a={...a,params:{...a.params,_meta:{...a.params?._meta||{},[br]:n.relatedTask}}}),this._transport?.send(a,n).catch(l=>this._onerror(l))});return}let s={...t,jsonrpc:"2.0"};n?.relatedTask&&(s={...s,params:{...s.params,_meta:{...s.params?._meta||{},[br]:n.relatedTask}}}),await this._transport.send(s,n)}setRequestHandler(t,n){let o=fg(t);this.assertRequestHandlerCapability(o),this._requestHandlers.set(o,(r,i)=>{let s=pg(t,r);return Promise.resolve(n(s,i))})}removeRequestHandler(t){this._requestHandlers.delete(t)}assertCanSetRequestHandler(t){if(this._requestHandlers.has(t))throw new Error(`A request handler for ${t} already exists, which would be overridden`)}setNotificationHandler(t,n){let o=fg(t);this._notificationHandlers.set(o,r=>{let i=pg(t,r);return Promise.resolve(n(i))})}removeNotificationHandler(t){this._notificationHandlers.delete(t)}_cleanupTaskProgressHandler(t){let n=this._taskProgressTokens.get(t);n!==void 0&&(this._progressHandlers.delete(n),this._taskProgressTokens.delete(t))}async _enqueueTaskMessage(t,n,o){if(!this._taskStore||!this._taskMessageQueue)throw new Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");let r=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue(t,n,o??this._transport?.sessionId,r)}async _clearTaskQueue(t,n){if(this._taskMessageQueue){let o=await this._taskMessageQueue.dequeueAll(t,n);for(let r of o)if(r.type==="request"&&G0(r.message)){let i=r.message.id,s=this._requestResolvers.get(i);s?(s(new ge(Ee.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(i)):this._onerror(new Error(`Resolver missing for request ${i} during task ${t} cleanup`))}}}async _waitForTaskUpdate(t,n,o){let r=this._options?.defaultTaskPollInterval??1e3;try{let i=await this._taskStore?.getTask(t,o);i?.pollInterval&&(r=i.pollInterval)}catch{}return new Promise((i,s)=>{if(n.aborted){s(new ge(Ee.InvalidRequest,"Request cancelled"));return}let a=setTimeout(i,r);n.addEventListener("abort",()=>{clearTimeout(a),s(new ge(Ee.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore(t,n){let o=this._taskStore;if(!o)throw new Error("No task store configured");return{createTask:async r=>{if(!t)throw new Error("No request provided");return await o.createTask(r,t.id,{method:t.method,params:t.params},n)},getTask:async r=>{let i=await o.getTask(r,n);if(!i)throw new ge(Ee.InvalidParams,"Failed to retrieve task: Task not found");return i},storeTaskResult:async(r,i,s)=>{await o.storeTaskResult(r,i,s,n);let a=await o.getTask(r,n);if(a){let l=ua.parse({method:"notifications/tasks/status",params:a});await this.notification(l),yr(a.status)&&this._cleanupTaskProgressHandler(r)}},getTaskResult:r=>o.getTaskResult(r,n),updateTaskStatus:async(r,i,s)=>{let a=await o.getTask(r,n);if(!a)throw new ge(Ee.InvalidParams,`Task "${r}" not found - it may have been cleaned up`);if(yr(a.status))throw new ge(Ee.InvalidParams,`Cannot update task "${r}" from terminal status "${a.status}" to "${i}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await o.updateTaskStatus(r,i,s,n);let l=await o.getTask(r,n);if(l){let u=ua.parse({method:"notifications/tasks/status",params:l});await this.notification(u),yr(l.status)&&this._cleanupTaskProgressHandler(r)}},listTasks:r=>o.listTasks(r,n)}}};function nS(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function rS(e,t){let n={...e};for(let o in t){let r=o,i=t[r];if(i===void 0)continue;let s=n[r];nS(s)&&nS(i)?n[r]={...s,...i}:n[r]=i}return n}ta();ta();var IK=(e=>typeof Br<"u"?Br:typeof Proxy<"u"?new Proxy(e,{get:(t,n)=>(typeof Br<"u"?Br:t)[n]}):e)(function(e){if(typeof Br<"u")return Br.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')}),hg=class extends xc{constructor(){super(...arguments);$e(this,"_registeredMethods",new Set);$e(this,"_eventSlots",new Map);$e(this,"setRequestHandler",(n,o)=>{this._assertMethodNotRegistered(n,"setRequestHandler"),super.setRequestHandler(n,o)});$e(this,"setNotificationHandler",(n,o)=>{this._assertMethodNotRegistered(n,"setNotificationHandler"),super.setNotificationHandler(n,o)});$e(this,"replaceRequestHandler",(n,o)=>{let r=n.shape.method.value;this._registeredMethods.add(r),super.setRequestHandler(n,o)})}onEventDispatch(n,o){}_ensureEventSlot(n){let o=this._eventSlots.get(n);if(!o){let r=this.eventSchemas[n];if(!r)throw Error(`Unknown event: ${String(n)}`);o={listeners:[]},this._eventSlots.set(n,o);let i=r.shape.method.value;this._registeredMethods.add(i);let s=o;super.setNotificationHandler(r,a=>{let l=a.params;this.onEventDispatch(n,l),s.onHandler?.(l);for(let u of[...s.listeners])u(l)})}return o}setEventHandler(n,o){let r=this._ensureEventSlot(n);r.onHandler&&o&&console.warn(`[MCP Apps] on${String(n)} handler replaced. Use addEventListener("${String(n)}", \u2026) to add multiple listeners without replacing.`),r.onHandler=o}getEventHandler(n){return this._eventSlots.get(n)?.onHandler}addEventListener(n,o){this._ensureEventSlot(n).listeners.push(o)}removeEventListener(n,o){let r=this._eventSlots.get(n);if(!r)return;let i=r.listeners.indexOf(o);i!==-1&&r.listeners.splice(i,1)}warnIfRequestHandlerReplaced(n,o,r){o&&r&&console.warn(`[MCP Apps] ${n} handler replaced. Previous handler will no longer be called.`)}_assertMethodNotRegistered(n,o){let r=n.shape.method.value;if(this._registeredMethods.has(r))throw Error(`Handler for "${r}" already registered (via ${o}). Use addEventListener() to attach multiple listeners, or the on* setter for replace semantics.`);this._registeredMethods.add(r)}},hN="2026-01-26";var mN="ui/notifications/tool-input-partial";var mg=class{constructor(t=window.parent,n){$e(this,"eventTarget");$e(this,"eventSource");$e(this,"messageListener");$e(this,"onclose");$e(this,"onerror");$e(this,"onmessage");$e(this,"sessionId");$e(this,"setProtocolVersion");this.eventTarget=t,this.eventSource=n,this.messageListener=o=>{if(n&&o.source!==this.eventSource){console.debug("Ignoring message from unknown source",o);return}let r=Jw.safeParse(o.data);r.success?(console.debug("Parsed message",r.data),this.onmessage?.(r.data)):o.data?.jsonrpc!=="2.0"?console.debug("Ignoring non-JSON-RPC message",r.error.message,o):(console.error("Failed to parse message",r.error.message,o),this.onerror?.(Error("Invalid JSON-RPC message received: "+r.error.message)))}}async start(){window.addEventListener("message",this.messageListener)}async send(t,n){t.method!==mN&&console.debug("Sending message",t),this.eventTarget.postMessage(t,"*")}async close(){window.removeEventListener("message",this.messageListener),this.onclose?.()}},gN=v.union([v.literal("light"),v.literal("dark")]).describe("Color theme preference for the host environment."),fa=v.union([v.literal("inline"),v.literal("fullscreen"),v.literal("pip")]).describe("Display mode for UI presentation."),bN=v.union([v.literal("--color-background-primary"),v.literal("--color-background-secondary"),v.literal("--color-background-tertiary"),v.literal("--color-background-inverse"),v.literal("--color-background-ghost"),v.literal("--color-background-info"),v.literal("--color-background-danger"),v.literal("--color-background-success"),v.literal("--color-background-warning"),v.literal("--color-background-disabled"),v.literal("--color-text-primary"),v.literal("--color-text-secondary"),v.literal("--color-text-tertiary"),v.literal("--color-text-inverse"),v.literal("--color-text-ghost"),v.literal("--color-text-info"),v.literal("--color-text-danger"),v.literal("--color-text-success"),v.literal("--color-text-warning"),v.literal("--color-text-disabled"),v.literal("--color-border-primary"),v.literal("--color-border-secondary"),v.literal("--color-border-tertiary"),v.literal("--color-border-inverse"),v.literal("--color-border-ghost"),v.literal("--color-border-info"),v.literal("--color-border-danger"),v.literal("--color-border-success"),v.literal("--color-border-warning"),v.literal("--color-border-disabled"),v.literal("--color-ring-primary"),v.literal("--color-ring-secondary"),v.literal("--color-ring-inverse"),v.literal("--color-ring-info"),v.literal("--color-ring-danger"),v.literal("--color-ring-success"),v.literal("--color-ring-warning"),v.literal("--font-sans"),v.literal("--font-mono"),v.literal("--font-weight-normal"),v.literal("--font-weight-medium"),v.literal("--font-weight-semibold"),v.literal("--font-weight-bold"),v.literal("--font-text-xs-size"),v.literal("--font-text-sm-size"),v.literal("--font-text-md-size"),v.literal("--font-text-lg-size"),v.literal("--font-heading-xs-size"),v.literal("--font-heading-sm-size"),v.literal("--font-heading-md-size"),v.literal("--font-heading-lg-size"),v.literal("--font-heading-xl-size"),v.literal("--font-heading-2xl-size"),v.literal("--font-heading-3xl-size"),v.literal("--font-text-xs-line-height"),v.literal("--font-text-sm-line-height"),v.literal("--font-text-md-line-height"),v.literal("--font-text-lg-line-height"),v.literal("--font-heading-xs-line-height"),v.literal("--font-heading-sm-line-height"),v.literal("--font-heading-md-line-height"),v.literal("--font-heading-lg-line-height"),v.literal("--font-heading-xl-line-height"),v.literal("--font-heading-2xl-line-height"),v.literal("--font-heading-3xl-line-height"),v.literal("--border-radius-xs"),v.literal("--border-radius-sm"),v.literal("--border-radius-md"),v.literal("--border-radius-lg"),v.literal("--border-radius-xl"),v.literal("--border-radius-full"),v.literal("--border-width-regular"),v.literal("--shadow-hairline"),v.literal("--shadow-sm"),v.literal("--shadow-md"),v.literal("--shadow-lg")]).describe("CSS variable keys available to MCP apps for theming."),yN=v.record(bN.describe(`Style variables for theming MCP apps.
Individual style keys are optional - hosts may provide any subset of these values.
Values are strings containing CSS values (colors, sizes, font stacks, etc.).
Note: This type uses \`Record<K, string | undefined>\` rather than \`Partial<Record<K, string>>\`
for compatibility with Zod schema generation. Both are functionally equivalent for validation.`),v.union([v.string(),v.undefined()]).describe(`Style variables for theming MCP apps.
Individual style keys are optional - hosts may provide any subset of these values.
Values are strings containing CSS values (colors, sizes, font stacks, etc.).
Note: This type uses \`Record<K, string | undefined>\` rather than \`Partial<Record<K, string>>\`
for compatibility with Zod schema generation. Both are functionally equivalent for validation.`)).describe(`Style variables for theming MCP apps.
Individual style keys are optional - hosts may provide any subset of these values.
Values are strings containing CSS values (colors, sizes, font stacks, etc.).
Note: This type uses \`Record<K, string | undefined>\` rather than \`Partial<Record<K, string>>\`
for compatibility with Zod schema generation. Both are functionally equivalent for validation.`),LK=v.object({method:v.literal("ui/open-link"),params:v.object({url:v.string().describe("URL to open in the host's browser")})}),vN=v.object({isError:v.boolean().optional().describe("True if the host failed to open the URL (e.g., due to security policy).")}).passthrough(),xN=v.object({isError:v.boolean().optional().describe("True if the download failed (e.g., user cancelled or host denied).")}).passthrough(),kN=v.object({isError:v.boolean().optional().describe("True if the host rejected or failed to deliver the message.")}).passthrough(),FK=v.object({method:v.literal("ui/notifications/sandbox-proxy-ready"),params:v.object({})}),gg=v.object({connectDomains:v.array(v.string()).optional().describe(`Origins for network requests (fetch/XHR/WebSocket).
- Maps to CSP \`connect-src\` directive
- Empty or omitted \u2192 no network connections (secure default)`),resourceDomains:v.array(v.string()).optional().describe("Origins for static resources (images, scripts, stylesheets, fonts, media).\n\n- Maps to CSP `img-src`, `script-src`, `style-src`, `font-src`, `media-src` directives\n- Wildcard subdomains supported: `https://*.example.com`\n- Empty or omitted \u2192 no network resources (secure default)"),frameDomains:v.array(v.string()).optional().describe("Origins for nested iframes.\n\n- Maps to CSP `frame-src` directive\n- Empty or omitted \u2192 no nested iframes allowed (`frame-src 'none'`)"),baseUriDomains:v.array(v.string()).optional().describe("Allowed base URIs for the document.\n\n- Maps to CSP `base-uri` directive\n- Empty or omitted \u2192 only same origin allowed (`base-uri 'self'`)")}),bg=v.object({camera:v.object({}).optional().describe("Request camera access.\n\nMaps to Permission Policy `camera` feature."),microphone:v.object({}).optional().describe("Request microphone access.\n\nMaps to Permission Policy `microphone` feature."),geolocation:v.object({}).optional().describe("Request geolocation access.\n\nMaps to Permission Policy `geolocation` feature."),clipboardWrite:v.object({}).optional().describe("Request clipboard write access.\n\nMaps to Permission Policy `clipboard-write` feature.")}),jK=v.object({method:v.literal("ui/notifications/size-changed"),params:v.object({width:v.number().optional().describe("New width in pixels."),height:v.number().optional().describe("New height in pixels.")})}),wN=v.object({method:v.literal("ui/notifications/tool-input"),params:v.object({arguments:v.record(v.string(),v.unknown().describe("Complete tool call arguments as key-value pairs.")).optional().describe("Complete tool call arguments as key-value pairs.")})}),SN=v.object({method:v.literal("ui/notifications/tool-input-partial"),params:v.object({arguments:v.record(v.string(),v.unknown().describe("Partial tool call arguments (incomplete, may change).")).optional().describe("Partial tool call arguments (incomplete, may change).")})}),_N=v.object({method:v.literal("ui/notifications/tool-cancelled"),params:v.object({reason:v.string().optional().describe('Optional reason for the cancellation (e.g., "user action", "timeout").')})}),EN=v.object({fonts:v.string().optional()}),CN=v.object({variables:yN.optional().describe("CSS variables for theming the app."),css:EN.optional().describe("CSS blocks that apps can inject.")}),TN=v.object({method:v.literal("ui/resource-teardown"),params:v.object({})}),BK=v.record(v.string(),v.unknown()),oS=v.object({text:v.object({}).optional().describe("Host supports text content blocks."),image:v.object({}).optional().describe("Host supports image content blocks."),audio:v.object({}).optional().describe("Host supports audio content blocks."),resource:v.object({}).optional().describe("Host supports resource content blocks."),resourceLink:v.object({}).optional().describe("Host supports resource link content blocks."),structuredContent:v.object({}).optional().describe("Host supports structured content.")}),UK=v.object({method:v.literal("ui/notifications/request-teardown"),params:v.object({}).optional()}),AN=v.object({experimental:v.record(v.string(),v.record(v.string(),v.any()).describe("Experimental features keyed by identifier.")).optional().describe("Experimental features keyed by identifier."),openLinks:v.object({}).optional().describe("Host supports opening external URLs."),downloadFile:v.object({}).optional().describe("Host supports file downloads via ui/download-file."),serverTools:v.object({listChanged:v.boolean().optional().describe("Host supports tools/list_changed notifications.")}).optional().describe("Host can proxy tool calls to the MCP server."),serverResources:v.object({listChanged:v.boolean().optional().describe("Host supports resources/list_changed notifications.")}).optional().describe("Host can proxy resource reads to the MCP server."),logging:v.object({}).optional().describe("Host accepts log messages."),sandbox:v.object({permissions:bg.optional().describe("Permissions granted by the host (camera, microphone, geolocation)."),csp:gg.optional().describe("CSP domains approved by the host.")}).optional().describe("Sandbox configuration applied by the host."),updateModelContext:oS.optional().describe("Host accepts context updates (ui/update-model-context) to be included in the model's context for future turns."),message:oS.optional().describe("Host supports receiving content messages (ui/message) from the view."),sampling:v.object({tools:v.object({}).optional().describe("Host supports tool use via `tools` and `toolChoice` parameters.")}).optional().describe("Host supports LLM sampling (sampling/createMessage) from the view.\nMirrors the MCP `ClientCapabilities.sampling` shape so hosts can pass it through.")}),MN=v.object({experimental:v.record(v.string(),v.record(v.string(),v.any()).describe("Experimental features keyed by identifier.")).optional().describe("Experimental features keyed by identifier."),tools:v.object({listChanged:v.boolean().optional().describe("App supports tools/list_changed notifications.")}).optional().describe("App exposes MCP-style tools that the host can call."),availableDisplayModes:v.array(fa).optional().describe("Display modes the app supports.")}),HK=v.object({method:v.literal("ui/notifications/initialized"),params:v.object({}).optional()}),qK=v.object({csp:gg.optional().describe("Content Security Policy configuration for UI resources."),permissions:bg.optional().describe("Sandbox permissions requested by the UI resource."),domain:v.string().optional().describe(`Dedicated origin for view sandbox.
Useful when views need stable, dedicated origins for OAuth callbacks, CORS policies, or API key allowlists.
**Host-dependent:** The format and validation rules for this field are determined by each host. Servers MUST consult host-specific documentation for the expected domain format. Common patterns include:
- Hash-based subdomains (e.g., \`{hash}.claudemcpcontent.com\`)
- URL-derived subdomains (e.g., \`www-example-com.oaiusercontent.com\`)
If omitted, host uses default sandbox origin (typically per-conversation).`),prefersBorder:v.boolean().optional().describe(`Visual boundary preference - true if view prefers a visible border.
Boolean requesting whether a visible border and background is provided by the host. Specifying an explicit value for this is recommended because hosts' defaults may vary.
- \`true\`: request visible border + background
- \`false\`: request no visible border + background
- omitted: host decides border`)}),ZK=v.object({method:v.literal("ui/request-display-mode"),params:v.object({mode:fa.describe("The display mode being requested.")})}),$N=v.object({mode:fa.describe("The display mode that was actually set. May differ from requested if not supported.")}).passthrough(),IN=v.union([v.literal("model"),v.literal("app")]).describe("Tool visibility scope - who can access the tool."),VK=v.object({resourceUri:v.string().optional(),visibility:v.array(IN).optional().describe(`Who can access this tool. Default: ["model", "app"]
- "model": Tool visible to and callable by the agent
- "app": Tool callable by the app from this server only`),csp:v.never().optional(),permissions:v.never().optional()}),WK=v.object({mimeTypes:v.array(v.string()).optional().describe('Array of supported MIME types for UI resources.\nMust include `"text/html;profile=mcp-app"` for MCP Apps support.')}),KK=v.object({method:v.literal("ui/download-file"),params:v.object({contents:v.array(v.union([sg,ag])).describe("Resource contents to download \u2014 embedded (inline data) or linked (host fetches). Uses standard MCP resource types.")})}),JK=v.object({method:v.literal("ui/message"),params:v.object({role:v.literal("user").describe('Message role, currently only "user" is supported.'),content:v.array(xi).describe("Message content blocks (text, image, etc.).")})}),GK=v.object({method:v.literal("ui/notifications/sandbox-resource-ready"),params:v.object({html:v.string().describe("HTML content to load into the inner iframe."),sandbox:v.string().optional().describe("Optional override for the inner iframe's sandbox attribute."),csp:gg.optional().describe("CSP configuration from resource metadata."),permissions:bg.optional().describe("Sandbox permissions from resource metadata.")})}),DN=v.object({method:v.literal("ui/notifications/tool-result"),params:ki.describe("Standard MCP tool execution result.")}),aS=v.object({toolInfo:v.object({id:bi.optional().describe("JSON-RPC id of the tools/call request."),tool:vc.describe("Tool definition including name, inputSchema, etc.")}).optional().describe("Metadata of the tool call that instantiated this App."),theme:gN.optional().describe("Current color theme preference."),styles:CN.optional().describe("Style configuration for theming the app."),displayMode:fa.optional().describe("How the UI is currently displayed."),availableDisplayModes:v.array(fa).optional().describe("Display modes the host supports."),containerDimensions:v.union([v.object({height:v.number().describe("Fixed container height in pixels.")}),v.object({maxHeight:v.union([v.number(),v.undefined()]).optional().describe("Maximum container height in pixels.")})]).and(v.union([v.object({width:v.number().describe("Fixed container width in pixels.")}),v.object({maxWidth:v.union([v.number(),v.undefined()]).optional().describe("Maximum container width in pixels.")})])).optional().describe(`Container dimensions. Represents the dimensions of the iframe or other
container holding the app. Specify either width or maxWidth, and either height or maxHeight.`),locale:v.string().optional().describe("User's language and region preference in BCP 47 format."),timeZone:v.string().optional().describe("User's timezone in IANA format."),userAgent:v.string().optional().describe("Host application identifier."),platform:v.union([v.literal("web"),v.literal("desktop"),v.literal("mobile")]).optional().describe("Platform type for responsive design decisions."),deviceCapabilities:v.object({touch:v.boolean().optional().describe("Whether the device supports touch input."),hover:v.boolean().optional().describe("Whether the device supports hover interactions.")}).optional().describe("Device input capabilities."),safeAreaInsets:v.object({top:v.number().describe("Top safe area inset in pixels."),right:v.number().describe("Right safe area inset in pixels."),bottom:v.number().describe("Bottom safe area inset in pixels."),left:v.number().describe("Left safe area inset in pixels.")}).optional().describe("Mobile safe area boundaries in pixels.")}).passthrough(),NN=v.object({method:v.literal("ui/notifications/host-context-changed"),params:aS.describe("Partial context update containing only changed fields.")}),QK=v.object({method:v.literal("ui/update-model-context"),params:v.object({content:v.array(xi).optional().describe("Context content blocks (text, image, etc.)."),structuredContent:v.record(v.string(),v.unknown().describe("Structured content for machine-readable context data.")).optional().describe("Structured content for machine-readable context data.")})}),XK=v.object({method:v.literal("ui/initialize"),params:v.object({appInfo:ia.describe("App identification (name and version)."),appCapabilities:MN.describe("Features and capabilities this app provides."),protocolVersion:v.string().describe("Protocol version this app supports.")})}),zN=v.object({protocolVersion:v.string().describe('Negotiated protocol version string (e.g., "2025-11-21").'),hostInfo:ia.describe("Host application identification and version."),hostCapabilities:AN.describe("Features and capabilities provided by the host."),hostContext:aS.describe("Rich context about the host environment.")}).passthrough(),ON={target:"draft-2020-12"};async function iS(e,t){let n=e["~standard"];if(n.jsonSchema)return n.jsonSchema[t](ON);if(n.vendor==="zod"){let{z:o}=await Promise.resolve().then(()=>(ta(),W0));return o.toJSONSchema(e,{io:t})}throw Error(`Schema (vendor: ${n.vendor}) does not implement Standard JSON Schema (~standard.jsonSchema). Use a library that does (zod v4, ArkType, Valibot) or wrap your schema accordingly.`)}async function sS(e,t,n=""){let o=await e["~standard"].validate(t);if(o.issues){let r=o.issues.map(i=>{let s=i.path?.map(a=>typeof a=="object"?a.key:a).join(".");return s?`${s}: ${i.message}`:i.message}).join("; ");throw Error(n+r)}return o.value}function lS(e){let t=document.documentElement;t.setAttribute("data-theme",e),t.style.colorScheme=e}function uS(e,t=document.documentElement){for(let[n,o]of Object.entries(e))o!==void 0&&t.style.setProperty(n,o)}function cS(e){if(document.getElementById("__mcp-host-fonts"))return;let t=document.createElement("style");t.id="__mcp-host-fonts",t.textContent=e,document.head.appendChild(t)}var wc=class wc extends hg{constructor(n,o={},r={autoResize:!0}){super(r);$e(this,"_appInfo");$e(this,"_capabilities");$e(this,"options");$e(this,"_hostCapabilities");$e(this,"_hostInfo");$e(this,"_hostContext");$e(this,"_registeredTools",{});$e(this,"_initializedSent",!1);$e(this,"eventSchemas",{toolinput:wN,toolinputpartial:SN,toolresult:DN,toolcancelled:_N,hostcontextchanged:NN});$e(this,"_everHadListener",new Set);$e(this,"_toolHandlersInitialized",!1);$e(this,"_onteardown");$e(this,"_oncalltool");$e(this,"_onlisttools");$e(this,"sendOpenLink",this.openLink);this._appInfo=n,this._capabilities=o,this.options=r,r.allowUnsafeEval||v.config({jitless:!0}),this.setRequestHandler(yi,i=>(console.log("Received ping:",i.params),{})),this.setEventHandler("hostcontextchanged",void 0)}_assertInitialized(n){if(this._initializedSent)return;let o=`[ext-apps] App.${n}() called before connect() completed the ui/initialize handshake. Await app.connect() before calling this method, or move data loading to an ontoolresult handler.`;if(this.options?.strict)throw Error(o);console.warn(`${o}. This will throw in a future release.`)}_assertHandlerTiming(n){if(!wc.ONE_SHOT_EVENTS.has(n)||this._everHadListener.has(n)||(this._everHadListener.add(n),!this._initializedSent))return;let o=`[ext-apps] "${String(n)}" handler registered after connect() completed the ui/initialize handshake. The host may have already sent this notification. Register handlers before calling app.connect().`;if(this.options?.strict)throw Error(o);console.warn(o)}setEventHandler(n,o){o&&this._assertHandlerTiming(n),super.setEventHandler(n,o)}addEventListener(n,o){this._assertHandlerTiming(n),super.addEventListener(n,o)}onEventDispatch(n,o){n==="hostcontextchanged"&&(this._hostContext={...this._hostContext,...o})}registerCapabilities(n){if(this.transport)throw Error("Cannot register capabilities after transport is established");this._capabilities=rS(this._capabilities,n)}registerTool(n,o,r){if(this._registeredTools[n])throw Error(`Tool ${n} is already registered`);let i=this,s=()=>{i._initializedSent&&i._capabilities.tools?.listChanged&&i.sendToolListChanged()},a=o.inputSchema!==void 0,l={title:o.title,description:o.description,inputSchema:o.inputSchema,outputSchema:o.outputSchema,annotations:o.annotations,_meta:o._meta,enabled:!0,enable(){this.enabled=!0,s()},disable(){this.enabled=!1,s()},update(u){Object.assign(this,u),s()},remove(){i._registeredTools[n]===l&&(delete i._registeredTools[n],s())},handler:async(u,c)=>{if(!l.enabled)throw Error(`Tool ${n} is disabled`);let d;if(a){let f=l.inputSchema,h=f?await sS(f,u??{},`Invalid input for tool ${n}: `):u??{};d=await r(h,c)}else d=await r(c);return l.outputSchema&&!d.isError&&(d.structuredContent=await sS(l.outputSchema,d.structuredContent,`Invalid output for tool ${n}: `)),d}};return this._registeredTools[n]=l,!this._capabilities.tools&&!this.transport&&this.registerCapabilities({tools:{listChanged:!0}}),this.ensureToolHandlersInitialized(),s(),l}ensureToolHandlersInitialized(){this._toolHandlersInitialized||(this._toolHandlersInitialized=!0,this.oncalltool=async(n,o)=>{let r=this._registeredTools[n.name];if(!r)throw Error(`Tool ${n.name} not found`);return r.handler(n.arguments,o)},this.onlisttools=async(n,o)=>({tools:await Promise.all(Object.entries(this._registeredTools).filter(([r,i])=>i.enabled).map(async([r,i])=>{let s={name:r,title:i.title,description:i.description,inputSchema:i.inputSchema?await iS(i.inputSchema,"input"):{type:"object",properties:{}}};return i.outputSchema&&(s.outputSchema=await iS(i.outputSchema,"output")),i.annotations&&(s.annotations=i.annotations),i._meta&&(s._meta=i._meta),s}))}))}async sendToolListChanged(n={}){this._assertInitialized("sendToolListChanged"),await this.notification({method:"notifications/tools/list_changed",params:n})}getHostCapabilities(){return this._hostCapabilities}getHostVersion(){return this._hostInfo}getHostContext(){return this._hostContext}get ontoolinput(){return this.getEventHandler("toolinput")}set ontoolinput(n){this.setEventHandler("toolinput",n)}get ontoolinputpartial(){return this.getEventHandler("toolinputpartial")}set ontoolinputpartial(n){this.setEventHandler("toolinputpartial",n)}get ontoolresult(){return this.getEventHandler("toolresult")}set ontoolresult(n){this.setEventHandler("toolresult",n)}get ontoolcancelled(){return this.getEventHandler("toolcancelled")}set ontoolcancelled(n){this.setEventHandler("toolcancelled",n)}get onhostcontextchanged(){return this.getEventHandler("hostcontextchanged")}set onhostcontextchanged(n){this.setEventHandler("hostcontextchanged",n)}get onteardown(){return this._onteardown}set onteardown(n){this.warnIfRequestHandlerReplaced("onteardown",this._onteardown,n),this._onteardown=n,this.replaceRequestHandler(TN,(o,r)=>{if(!this._onteardown)throw Error("No onteardown handler set");return this._onteardown(o.params,r)})}get oncalltool(){return this._oncalltool}set oncalltool(n){this.warnIfRequestHandlerReplaced("oncalltool",this._oncalltool,n),this._oncalltool=n,this.replaceRequestHandler(ug,(o,r)=>{if(!this._oncalltool)throw Error("No oncalltool handler set");return this._oncalltool(o.params,r)})}get onlisttools(){return this._onlisttools}set onlisttools(n){this.warnIfRequestHandlerReplaced("onlisttools",this._onlisttools,n),this._onlisttools=n,this.replaceRequestHandler(lg,(o,r)=>{if(!this._onlisttools)throw Error("No onlisttools handler set");return this._onlisttools(o.params,r)})}assertCapabilityForMethod(n){switch(n){case"sampling/createMessage":if(!this._hostCapabilities?.sampling)throw Error(`Host does not support sampling (required for ${n})`);break}}assertRequestHandlerCapability(n){switch(n){case"tools/call":case"tools/list":if(!this._capabilities.tools)throw Error(`Client does not support tool capability (required for ${n})`);return;case"ping":case"ui/resource-teardown":return;default:throw Error(`No handler for method ${n} registered`)}}assertNotificationCapability(n){}assertTaskCapability(n){throw Error("Tasks are not supported in MCP Apps")}assertTaskHandlerCapability(n){throw Error("Task handlers are not supported in MCP Apps")}async callServerTool(n,o){if(this._assertInitialized("callServerTool"),typeof n=="string")throw Error(`callServerTool() expects an object as its first argument, but received a string ("${n}"). Did you mean: callServerTool({ name: "${n}", arguments: { ... } })?`);return await this.request({method:"tools/call",params:n},ki,{onprogress:()=>{},resetTimeoutOnProgress:!0,...o})}async readServerResource(n,o){return this._assertInitialized("readServerResource"),await this.request({method:"resources/read",params:n},ng,o)}async listServerResources(n,o){return this._assertInitialized("listServerResources"),await this.request({method:"resources/list",params:n},eg,o)}async createSamplingMessage(n,o){this._assertInitialized("createSamplingMessage");let r=n.tools?dg:cg;return await this.request({method:"sampling/createMessage",params:n},r,o)}sendMessage(n,o){return this._assertInitialized("sendMessage"),this.request({method:"ui/message",params:n},kN,o)}sendLog(n){return this.notification({method:"notifications/message",params:n})}updateModelContext(n,o){return this._assertInitialized("updateModelContext"),this.request({method:"ui/update-model-context",params:n},uc,o)}openLink(n,o){return this._assertInitialized("openLink"),this.request({method:"ui/open-link",params:n},vN,o)}downloadFile(n,o){return this._assertInitialized("downloadFile"),this.request({method:"ui/download-file",params:n},xN,o)}requestTeardown(n={}){return this.notification({method:"ui/notifications/request-teardown",params:n})}requestDisplayMode(n,o){return this._assertInitialized("requestDisplayMode"),this.request({method:"ui/request-display-mode",params:n},$N,o)}sendSizeChanged(n){return this.notification({method:"ui/notifications/size-changed",params:n})}setupSizeChangedNotifications(){let n=!1,o=0,r=0,i=()=>{n||(n=!0,requestAnimationFrame(()=>{n=!1;let a=document.documentElement,l=a.style.height;a.style.height="max-content";let u=Math.ceil(a.getBoundingClientRect().height);a.style.height=l;let c=Math.ceil(window.innerWidth);(c!==o||u!==r)&&(o=c,r=u,this.sendSizeChanged({width:c,height:u}))}))};i();let s=new ResizeObserver(i);return s.observe(document.documentElement),s.observe(document.body),()=>s.disconnect()}async connect(n=new mg(window.parent,window.parent),o){if(this.transport)throw Error("App is already connected. Call close() before connecting again.");this._initializedSent=!1,await super.connect(n);try{let r=await this.request({method:"ui/initialize",params:{appCapabilities:this._capabilities,appInfo:this._appInfo,protocolVersion:hN}},zN,o);if(r===void 0)throw Error(`Server sent invalid initialize result: ${r}`);this._hostCapabilities=r.hostCapabilities,this._hostInfo=r.hostInfo,this._hostContext=r.hostContext,await this.notification({method:"ui/notifications/initialized"}),this._initializedSent=!0,this.options?.autoResize&&this.setupSizeChangedNotifications()}catch(r){throw this.close(),r}}};$e(wc,"ONE_SHOT_EVENTS",new Set(["toolinput","toolinputpartial","toolresult","toolcancelled"]));var kc=wc;var RN='<svg viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="M7 10l5 5 5-5z"></path></svg>',PN='<svg viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="M7 14l5-5 5 5z"></path></svg>';function LN(e,t){if(!e)return;let n=t?"Collapse":"Expand";e.title=n,e.setAttribute("aria-label",n),e.innerHTML=t?PN:RN}function FN(e,t){e&&(e.classList.toggle("expanded",t),e.classList.toggle("collapsed",!t))}function jN(e){let{shell:t,toggleButton:n,initialExpanded:o,onToggle:r,onScrollAfterExpand:i,onRender:s}=e,a=o,l=!1,u=typeof i=="function",c=h=>{let p=a;a=h,FN(t,a),LN(n,a),!p&&a&&(l=!1)},d=()=>{c(!a),r?.(a),s?.()},f=h=>{if(!a||l)return;let p=h?.target instanceof Node?h.target:null;p&&t&&!t.contains(p)||(l=!0,i?.())};return c(a),n?.addEventListener("click",d),u&&(t?.addEventListener("scroll",f,{passive:!0}),document.addEventListener("scroll",f,{passive:!0,capture:!0})),{getExpanded:()=>a,setExpanded:c,toggle:d,dispose:()=>{n?.removeEventListener("click",d),u&&(t?.removeEventListener("scroll",f),document.removeEventListener("scroll",f,!0))}}}function dS(e){let{shell:t,compactRow:n,initialExpanded:o,onToggle:r,onScrollAfterExpand:i,onRender:s}=e,a=jN({shell:t,toggleButton:null,initialExpanded:o,onToggle:c=>{n?.setAttribute("aria-expanded",String(c)),r?.(c)},onScrollAfterExpand:i,onRender:s});n?.setAttribute("aria-expanded",String(o));let l=()=>{a.toggle()},u=c=>{c.key!=="Enter"&&c.key!==" "||(c.preventDefault(),a.toggle())};return n?.addEventListener("click",l),n?.addEventListener("keydown",u),{getExpanded:a.getExpanded,setExpanded:a.setExpanded,toggle:a.toggle,dispose:()=>{n?.removeEventListener("click",l),n?.removeEventListener("keydown",u),a.dispose()}}}var fS="desktop-commander:widget-state",yg="__dc_widget_id__:";function BN(){let e=typeof globalThis.crypto=="object"?globalThis.crypto:void 0;return typeof e?.randomUUID=="function"?e.randomUUID():`widget-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,10)}`}function UN(e){let t=e.indexOf(yg);if(t===-1)return;let n=e.slice(t+yg.length).split("|",1)[0];if(n)try{return decodeURIComponent(n)}catch{return n}}function HN(){if(typeof window>"u")return"unknown-instance";let e=typeof window.name=="string"?window.name:"",t=UN(e);if(t)return t;let n=BN(),o=`${yg}${encodeURIComponent(n)}`;try{window.name=e?`${e}|${o}`:o}catch{}return n}function qN(){if(typeof window>"u")return`${fS}:unknown`;let e=window.location.pathname||"unknown",t=HN();return`${fS}:${e}:${encodeURIComponent(t)}`}function ZN(){if(!(typeof window>"u"))try{return window.sessionStorage}catch{return}}function VN(){return typeof window<"u"&&typeof window.openai?.setWidgetState=="function"}function pS(e){if(!VN()){let t=ZN(),n=qN();return{read(){if(t)try{let o=t.getItem(n);if(!o)return;let i=JSON.parse(o)?.payload;return i===void 0||e&&!e(i)?void 0:i}catch{return}},write(o){if(t)try{t.setItem(n,JSON.stringify({payload:o}))}catch{}}}}return{read(){try{let t=window.openai?.widgetState;if(t==null)return;let n=t.payload;return n===void 0||e&&!e(n)?void 0:n}catch{return}},write(t){try{window.openai?.setWidgetState?.({payload:t})}catch{}}}}function rn(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function pa(e){let t=e.variant??"ready",n=`compact-row compact-row--${t}`,o=e.id?` id="${rn(e.id)}"`:"",i=e.interactive??t==="ready"?' role="button" tabindex="0"':"",s=typeof e.expanded=="boolean"?` aria-expanded="${String(e.expanded)}"`:"",a=e.expandable?'<svg class="compact-chevron" viewBox="0 0 24 24" aria-hidden="true"><path d="M10 6l6 6-6 6z"/></svg>':"",l=e.filename?`<span class="compact-filename">${rn(e.filename)}</span>`:"";return`<div class="${n}"${o}${i}${s}>${a}<span class="compact-label">${rn(e.label)}</span>${l}</div>`}function Sc(e){return typeof e=="object"&&e!==null}function hS(e,t){if(!Sc(e))return;(e.theme==="light"||e.theme==="dark")&&lS(e.theme);let n=Sc(e.styles)?e.styles:null,o=Sc(n?.variables)?n.variables:null,r=Sc(n?.css)?n.css:null,i=typeof r?.fonts=="string"?r.fonts:null;o&&uS(o),i&&cS(i),typeof e.initiallyExpanded=="boolean"&&(t.expanded=e.initiallyExpanded),typeof e.compact=="boolean"&&typeof t.compact=="boolean"&&(t.compact=e.compact),typeof e.hideSummaryRow=="boolean"&&(t.hideSummaryRow=e.hideSummaryRow,e.hideSummaryRow&&(t.expanded=!0,typeof t.compact=="boolean"&&(t.compact=!0)))}async function mS(e){let{app:t,chrome:n,onContextApplied:o,onConnected:r}=e;t.onhostcontextchanged=s=>{hS(s,n),o?.()},await t.connect();let i=t.getHostContext();i&&(hS(i,n),o?.()),await r?.()}function WN(e){let t={};if(!e)return t;for(let[n,o]of Object.entries(e))(typeof o=="string"||typeof o=="number"||typeof o=="boolean"||o===null)&&(t[n]=o);return t}function gS(e,t){let n=t.baseParams??{};return(o,r={})=>{e("track_ui_event",{event:o,component:t.component,params:{...n,...WN(r)}}).catch(()=>{})}}var PS=Pv(RS(),1);var Ye=PS.default;function LS(e){let t=e.regex,n={},o={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{begin:t.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},o]});let r={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},i=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),s={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},a={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,n,r]};r.contains.push(a);let l={match:/\\"/},u={className:"string",begin:/'/,end:/'/},c={match:/\\'/},d={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,n]},f=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],h=e.SHEBANG({binary:`(${f.join("|")})`,relevance:10}),p={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},m=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],g=["true","false"],b={match:/(\/[a-z._-]+)+/},y=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],k=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],x=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],E=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:m,literal:g,built_in:[...y,...k,"set","shopt",...x,...E]},contains:[h,e.SHEBANG(),p,d,i,s,b,a,l,u,c,n]}}var P4=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},UNICODE_RANGE:{scope:"number",begin:/\b[Uu]\+[0-9A-Fa-f][0-9A-Fa-f?]{0,5}(-[0-9A-Fa-f][0-9A-Fa-f]{0,5})?/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),L4=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],F4=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],j4=[...L4,...F4],B4=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),U4=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),H4=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),q4=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","corner-bottom-left-shape","corner-bottom-right-shape","corner-shape","corner-top-left-shape","corner-top-right-shape","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","unicode-range","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function FS(e){let t=e.regex,n=P4(e),o={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},r="and or not only",i=/@-?\w[\w]*(-\w+)*/,s="[a-zA-Z-][a-zA-Z0-9_-]*",a=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[n.BLOCK_COMMENT,o,n.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+s,relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+U4.join("|")+")"},{begin:":(:)?("+H4.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+q4.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,n.UNICODE_RANGE,...a,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...a,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n.FUNCTION_DISPATCH]},{begin:t.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:i},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:r,attribute:B4.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...a,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+j4.join("|")+")\\b"}]}}function jS(e){let i={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:i,illegal:"</",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"string",variants:[e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,{begin:"`",end:"`"}]},{className:"number",variants:[{match:/-?\b0[xX]\.[a-fA-F0-9](_?[a-fA-F0-9])*[pP][+-]?\d(_?\d)*i?/,relevance:0},{match:/-?\b0[xX](_?[a-fA-F0-9])+((\.([a-fA-F0-9](_?[a-fA-F0-9])*)?)?[pP][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b0[oO](_?[0-7])*i?/,relevance:0},{match:/-?\b0[bB](_?[01])*i?/,relevance:0},{match:/-?\.\d(_?\d)*([eE][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b\d(_?\d)*(\.(\d(_?\d)*)?)?([eE][+-]?\d(_?\d)*)?i?/,relevance:0}]},{begin:/:=/},{className:"function",beginKeywords:"func",end:"\\s*(\\{|$)",excludeEnd:!0,contains:[e.TITLE_MODE,{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:i,illegal:/["']/}]}]}}var _i="[0-9](_*[0-9])*",Mc=`\\.(${_i})`,$c="[0-9a-fA-F](_*[0-9a-fA-F])*",BS={className:"number",variants:[{begin:`(\\b(${_i})((${Mc})|\\.)?|(${Mc}))[eE][+-]?(${_i})[fFdD]?\\b`},{begin:`\\b(${_i})((${Mc})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${Mc})[fFdD]?\\b`},{begin:`\\b(${_i})[fFdD]\\b`},{begin:`\\b0[xX]((${$c})\\.?|(${$c})?\\.(${$c}))[pP][+-]?(${_i})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${$c})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function US(e,t,n){return n===-1?"":e.replace(t,o=>US(e,t,n-1))}function HS(e){let t=e.regex,n="[\xC0-\u02B8a-zA-Z_$][\xC0-\u02B8a-zA-Z_$0-9]*",o="(?:(?:\\s*\\[\\s*])+)?",r=n+"<@@@>"+o,s="(?:"+("\\?(?:\\s+(?:extends|super)\\s+"+r+")?")+"|"+r+")",a=US("(?:\\s*<\\s*"+s+"(?:\\s*,\\s*"+s+")*\\s*>)?",/<@@@>/g,2),f={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits","goto","when"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},h={className:"meta",begin:"@"+n,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},p={className:"params",begin:/\(/,end:/\)/,keywords:f,relevance:0,contains:[e.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:f,illegal:/<\/|#/,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[e.BACKSLASH_ESCAPE]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,n],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{beginKeywords:"new throw return else yield assert",relevance:0},{begin:[n,t.concat(a,o,/\s+/),n,o,/\s*/,/=(?!=)/],className:{1:"type",3:"variable",6:"operator"}},{begin:[/record/,/\s+/,n],className:{1:"keyword",3:"title.class"},contains:[p,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{begin:[n,t.concat(a,o,/\s+/),n,/\s*(?=\()/],className:{1:"type",3:"title.function"},keywords:f,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:f,relevance:0,contains:[h,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,BS,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},BS,h]}}var qS="[A-Za-z$_][0-9A-Za-z$_]*",Z4=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],V4=["true","false","null","undefined","NaN","Infinity"],ZS=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],VS=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],WS=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],W4=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","self","global"],K4=[].concat(WS,ZS,VS);function KS(e){let t=e.regex,n=(q,{after:te})=>{let se="</"+q[0].slice(1);return q.input.indexOf(se,te)!==-1},o=qS,r={begin:"<>",end:"</>"},i=/<[A-Za-z0-9\\._:-]+\s*\/>/,s={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(q,te)=>{let se=q[0].length+q.index,w=q.input[se];if(w==="<"||w===","){te.ignoreMatch();return}w===">"&&(n(q,{after:se})||te.ignoreMatch());let _,O=q.input.substring(se);if(_=O.match(/^\s*=/)){te.ignoreMatch();return}if((_=O.match(/^\s+extends\s+/))&&_.index===0){te.ignoreMatch();return}}},a={$pattern:qS,keyword:Z4,literal:V4,built_in:K4,"variable.language":W4},l="[0-9](_?[0-9])*",u=`\\.(${l})`,c="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",d={className:"number",variants:[{begin:`(\\b(${c})((${u})|\\.)?|(${u}))[eE][+-]?(${l})\\b`},{begin:`\\b(${c})\\b((${u})\\b|\\.)?|(${u})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},f={className:"subst",begin:"\\$\\{",end:"\\}",keywords:a,contains:[]},h={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:"xml"}},p={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:"css"}},m={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:"graphql"}},g={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,f]},y={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:o+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},k=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,h,p,m,g,{match:/\$\d+/},d];f.contains=k.concat({begin:/\{/,end:/\}/,keywords:a,contains:["self"].concat(k)});let x=[].concat(y,f.contains),E=x.concat([{begin:/(\s*)\(/,end:/\)/,keywords:a,contains:["self"].concat(x)}]),I={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:E},N={variants:[{match:[/class/,/\s+/,o,/\s+/,/extends/,/\s+/,t.concat(o,"(",t.concat(/\./,o),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,o],scope:{1:"keyword",3:"title.class"}}]},D={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...ZS,...VS]}},W={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},re={variants:[{match:[/function/,/\s+/,o,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[I],illegal:/%/},Oe={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function We(q){return t.concat("(?!",q.join("|"),")")}let Ge={match:t.concat(/\b/,We([...WS,"super","import","await"].map(q=>`${q}\\s*\\(`)),o,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},xe={begin:t.concat(/\./,t.lookahead(t.concat(o,/(?![0-9A-Za-z$_(])/))),end:o,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},oe={match:[/get|set/,/\s+/,o,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},I]},A="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",H={match:[/const|var|let/,/\s+/,o,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(A)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[I]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:a,exports:{PARAMS_CONTAINS:E,CLASS_REFERENCE:D},illegal:/#(?![$_A-Za-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),W,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,h,p,m,g,y,{match:/\$\d+/},d,D,{scope:"attr",match:o+t.lookahead(":"),relevance:0},H,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[y,e.REGEXP_MODE,{className:"function",begin:A,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:E}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:r.begin,end:r.end},{match:i},{begin:s.begin,"on:begin":s.isTrulyOpeningTag,end:s.end}],subLanguage:"xml",contains:[{begin:s.begin,end:s.end,skip:!0,contains:["self"]}]}]},re,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[I,e.inherit(e.TITLE_MODE,{begin:o,className:"title.function"})]},{match:/\.\.\./,relevance:0},xe,{match:"\\$"+o,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[I]},Ge,Oe,N,oe,{match:/\$[(.]/}]}}var J4="([-+]?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)|NaN|[-+]?Infinity",G4={scope:"number",match:J4,relevance:0};function JS(e){let t={className:"attr",begin:/(("(\\.|[^\\"\r\n])*")|('(\\.|[^\\'\r\n])*'))(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:"punctuation",relevance:0},o=["true","false","null"],r={scope:"literal",beginKeywords:o.join(" ")};return{name:"JSON",aliases:["jsonc","json5"],keywords:{literal:o},contains:[t,n,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,r,G4,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}function GS(e){let t=e.regex,n={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},o={match:/^ {0,3}([-*_])[ \t]*(?:\1[ \t]*){2,}$/},r={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},i={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},s={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},a=/[A-Za-z][A-Za-z0-9+.-]*/,l={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:t.concat(/\[.+?\]\(/,a,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},u={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},c={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},d=e.inherit(u,{contains:[]}),f=e.inherit(c,{contains:[]});u.contains.push(f),c.contains.push(d);let h=[n,l];return[u,c,d,f].forEach(b=>{b.contains=b.contains.concat(h)}),h=h.concat(u,c),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:h},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:h}]}]},n,i,o,u,c,{className:"quote",begin:"^>\\s+",contains:h,end:"$"},r,l,s,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function QS(e){let t=e.regex,n=/[\p{XID_Start}_]\p{XID_Continue}*/u,o=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","lazy","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],a={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:o,built_in:["__import__","abs","aiter","all","anext","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozendict","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","sentinel","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},l={className:"meta",begin:/^(>>>|\.\.\.) /},u={className:"subst",begin:/\{/,end:/\}/,keywords:a,illegal:/#/},c={begin:/\{\{/,relevance:0},d={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,l],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,l],relevance:10},{begin:/([fFtT][rR]|[rR][fFtT]|[fFtT])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,l,c,u]},{begin:/([fFtT][rR]|[rR][fFtT]|[fFtT])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,l,c,u]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fFtT][rR]|[rR][fFtT]|[fFtT])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,c,u]},{begin:/([fFtT][rR]|[rR][fFtT]|[fFtT])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,c,u]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},f="[0-9](_?[0-9])*",h=`(\\b(${f}))?\\.(${f})|\\b(${f})\\.`,p=`\\b|${o.join("|")}`,m={className:"number",relevance:0,variants:[{begin:`(\\b(${f})|(${h}))[eE][+-]?(${f})[jJ]?(?=${p})`},{begin:`(${h})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${p})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${p})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${p})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${p})`},{begin:`\\b(${f})[jJ](?=${p})`}]},g={className:"comment",begin:t.lookahead(/# type:/),end:/$/,keywords:a,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},b={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:["self",l,m,d,e.HASH_COMMENT_MODE]}]};return u.contains=[d,m,l],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:a,illegal:/(<\/|\?)|=>/,contains:[l,m,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},d,g,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[b]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[m,b,d]}]}}function XS(e){let t=e.regex,n="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",o=t.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),r=t.concat(o,/(::\w+)*/),s={"variable.constant":["__FILE__","__LINE__","__ENCODING__"],"variable.language":["self","super"],keyword:["alias","and","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield",...["include","extend","prepend","public","private","protected","raise","throw"]],built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"],literal:["true","false","nil"]},a={className:"doctag",begin:"@[A-Za-z]+"},l={begin:"#<",end:">"},u=[e.COMMENT("#","$",{contains:[a]}),e.COMMENT("^=begin","^=end",{contains:[a],relevance:10}),e.COMMENT("^__END__",e.MATCH_NOTHING_RE)],c={className:"subst",begin:/#\{/,end:/\}/,keywords:s},d={className:"string",contains:[e.BACKSLASH_ESCAPE,c],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?</,end:/>/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:t.concat(/<<[-~]?'?/,t.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[e.BACKSLASH_ESCAPE,c]})]}]},f="[1-9](_?[0-9])*|0",h="[0-9](_?[0-9])*",p={className:"number",relevance:0,variants:[{begin:`\\b(${f})(\\.(${h}))?([eE][+-]?(${h})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},m={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:s}]},I=[d,{variants:[{match:[/class\s+/,r,/\s+<\s+/,r]},{match:[/\b(class|module)\s+/,r]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:s},{match:[/(include|extend)\s+/,r],scope:{2:"title.class"},keywords:s},{relevance:0,match:[r,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:o,scope:"title.class"},{match:[/def/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[m]},{begin:"::"},{className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[d,{begin:n}],relevance:0},p,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|(?!=)/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:s},{begin:"("+e.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[e.BACKSLASH_ESCAPE,c],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(l,u),relevance:0}].concat(l,u);c.contains=I,m.contains=I;let re=[{begin:/^\s*=>/,starts:{end:"$",contains:I}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:s,contains:I}}];return u.unshift(l),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:s,illegal:/\/\*/,contains:[e.SHEBANG({binary:"ruby"})].concat(re).concat(u).concat(I)}}function YS(e){let t=e.regex,n=/(r#)?/,o=t.concat(n,e.UNDERSCORE_IDENT_RE),r=t.concat(n,e.IDENT_RE),i={scope:"title.function.invoke",relevance:0,begin:t.concat(/\b/,/(?!(?:let|for|while|if|else|match)\b)/,r,t.lookahead(/\s*\(/))},s="([ui](8|16|32|64|128|size)|f(16|32|64|128))?",a=["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","raw","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","union","unsafe","unsized","use","virtual","where","while","yield"],l=["true","false","Some","None","Ok","Err"],u=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],c=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f16","f32","f64","f128","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:e.IDENT_RE+"!?",type:c,keyword:a,literal:l,built_in:u},illegal:"</",contains:[e.C_LINE_COMMENT_MODE,e.COMMENT("/\\*","\\*/",{contains:["self"]}),e.inherit(e.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{scope:"symbol",begin:/'[a-zA-Z_][a-zA-Z0-9_]*(?!')/},{scope:"string",variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{begin:/b?'/,end:/'/,contains:[{scope:"char.escape",match:/\\('|"|\\|\w|x\w{2}|u\w{4}|U\w{8})/}]}]},{scope:"number",variants:[{begin:"\\b0b([01_]+)"+s},{begin:"\\b0o([0-7_]+)"+s},{begin:"\\b0x([A-Fa-f0-9_]+)"+s},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)"+s}],relevance:0},{begin:[/\bsafe/,/\s+/,/extern/],scope:{1:"keyword",3:"keyword"}},{begin:[/fn/,/\s+/,o],scope:{1:"keyword",3:"title.function"}},{scope:"meta",begin:"#!?\\[",end:"\\]",contains:[{scope:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,o],scope:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,o,/\s+/,/in/],scope:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,o],scope:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,o],scope:{1:"keyword",3:"title.class"}},{begin:e.IDENT_RE+"::",keywords:{keyword:"Self",built_in:u,type:c}},{scope:"punctuation",begin:"->"},i]}}function e_(e){let t=e.regex,n=e.COMMENT("--","$"),o={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},r={begin:/"/,end:/"/,contains:[{match:/""/}]},i=["true","false","unknown"],s=["double precision","large object","with timezone","without timezone"],a=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],l=["add","asc","collation","desc","final","first","last","view"],u=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],c=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],d=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],f=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],h=c,p=[...u,...l].filter(E=>!c.includes(E)),m={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},g={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},b={match:t.concat(/\b/,t.either(...h),/\s*\(/),relevance:0,keywords:{built_in:h}};function y(E){return t.concat(/\b/,t.either(...E.map(I=>I.replace(/\s+/,"\\s+"))),/\b/)}let k={scope:"keyword",match:y(f),relevance:0};function x(E,{exceptions:I,when:N}={}){let D=N;return I=I||[],E.map(W=>W.match(/\|\d+$/)||I.includes(W)?W:D(W)?`${W}|0`:W)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:x(p,{when:E=>E.length<3}),literal:i,type:a,built_in:d},contains:[{scope:"type",match:y(s)},k,b,m,o,r,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,n,g]}}var Ic="[A-Za-z$_][0-9A-Za-z$_]*",t_=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],n_=["true","false","null","undefined","NaN","Infinity"],r_=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],o_=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],i_=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],s_=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","self","global"],a_=[].concat(i_,r_,o_);function Q4(e){let t=e.regex,n=(q,{after:te})=>{let se="</"+q[0].slice(1);return q.input.indexOf(se,te)!==-1},o=Ic,r={begin:"<>",end:"</>"},i=/<[A-Za-z0-9\\._:-]+\s*\/>/,s={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(q,te)=>{let se=q[0].length+q.index,w=q.input[se];if(w==="<"||w===","){te.ignoreMatch();return}w===">"&&(n(q,{after:se})||te.ignoreMatch());let _,O=q.input.substring(se);if(_=O.match(/^\s*=/)){te.ignoreMatch();return}if((_=O.match(/^\s+extends\s+/))&&_.index===0){te.ignoreMatch();return}}},a={$pattern:Ic,keyword:t_,literal:n_,built_in:a_,"variable.language":s_},l="[0-9](_?[0-9])*",u=`\\.(${l})`,c="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",d={className:"number",variants:[{begin:`(\\b(${c})((${u})|\\.)?|(${u}))[eE][+-]?(${l})\\b`},{begin:`\\b(${c})\\b((${u})\\b|\\.)?|(${u})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},f={className:"subst",begin:"\\$\\{",end:"\\}",keywords:a,contains:[]},h={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:"xml"}},p={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:"css"}},m={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,f],subLanguage:"graphql"}},g={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,f]},y={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:o+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},k=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,h,p,m,g,{match:/\$\d+/},d];f.contains=k.concat({begin:/\{/,end:/\}/,keywords:a,contains:["self"].concat(k)});let x=[].concat(y,f.contains),E=x.concat([{begin:/(\s*)\(/,end:/\)/,keywords:a,contains:["self"].concat(x)}]),I={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:E},N={variants:[{match:[/class/,/\s+/,o,/\s+/,/extends/,/\s+/,t.concat(o,"(",t.concat(/\./,o),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,o],scope:{1:"keyword",3:"title.class"}}]},D={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...r_,...o_]}},W={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},re={variants:[{match:[/function/,/\s+/,o,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[I],illegal:/%/},Oe={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function We(q){return t.concat("(?!",q.join("|"),")")}let Ge={match:t.concat(/\b/,We([...i_,"super","import","await"].map(q=>`${q}\\s*\\(`)),o,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},xe={begin:t.concat(/\./,t.lookahead(t.concat(o,/(?![0-9A-Za-z$_(])/))),end:o,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},oe={match:[/get|set/,/\s+/,o,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},I]},A="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",H={match:[/const|var|let/,/\s+/,o,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(A)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[I]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:a,exports:{PARAMS_CONTAINS:E,CLASS_REFERENCE:D},illegal:/#(?![$_A-Za-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),W,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,h,p,m,g,y,{match:/\$\d+/},d,D,{scope:"attr",match:o+t.lookahead(":"),relevance:0},H,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[y,e.REGEXP_MODE,{className:"function",begin:A,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:E}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:r.begin,end:r.end},{match:i},{begin:s.begin,"on:begin":s.isTrulyOpeningTag,end:s.end}],subLanguage:"xml",contains:[{begin:s.begin,end:s.end,skip:!0,contains:["self"]}]}]},re,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[I,e.inherit(e.TITLE_MODE,{begin:o,className:"title.function"})]},{match:/\.\.\./,relevance:0},xe,{match:"\\$"+o,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[I]},Ge,Oe,N,oe,{match:/\$[(.]/}]}}function l_(e){let t=e.regex,n=Q4(e),o=Ic,r=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],i={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},s={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:r},contains:[n.exports.CLASS_REFERENCE]},a={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},l=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],u={$pattern:Ic,keyword:t_.concat(l),literal:n_,built_in:a_.concat(r),"variable.language":s_},c={className:"meta",begin:"@"+o},d=(m,g,b)=>{let y=m.contains.findIndex(k=>k.label===g);if(y===-1)throw new Error("can not find mode to replace");m.contains.splice(y,1,b)};Object.assign(n.keywords,u),n.exports.PARAMS_CONTAINS.push(c);let f=n.contains.find(m=>m.scope==="attr"),h=Object.assign({},f,{match:t.concat(o,t.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,f,h]),n.contains=n.contains.concat([c,i,s,h]),d(n,"shebang",e.SHEBANG()),d(n,"use_strict",a);let p=n.contains.find(m=>m.label==="func.def");return p.relevance=0,Object.assign(n,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),n}function Cg(e){let t=e.regex,n=t.concat(/[\p{L}_]/u,t.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),o=/[\p{L}0-9._:-]+/u,r={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},i={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},s=e.inherit(i,{begin:/\(/,end:/\)/}),a=e.inherit(e.APOS_STRING_MODE,{className:"string"}),l=e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),u={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:o,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[r]},{begin:/'/,end:/'/,contains:[r]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[i,l,a,s,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[i,s,l,a]}]}]},e.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},r,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[l]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[u],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:"css"}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[u],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:"javascript"}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:t.concat(/</,t.lookahead(t.concat(n,t.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:n,relevance:0,starts:u}]},{className:"tag",begin:t.concat(/<\//,t.lookahead(t.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function Dc(e){let t="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",o={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},r={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},i={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},s={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,r]},a=e.inherit(s,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),f={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},h={end:",",endsWithParent:!0,excludeEnd:!0,keywords:t,relevance:0},p={begin:/\{/,end:/\}/,contains:[h],illegal:"\\n",relevance:0},m={begin:"\\[",end:"\\]",contains:[h],illegal:"\\n",relevance:0},g=[o,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+n},{className:"type",begin:"!<"+n+">"},{className:"type",begin:"!"+n},{className:"type",begin:"!!"+n},{className:"meta",begin:"&"+e.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+e.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:t,keywords:{literal:t}},f,{className:"number",begin:e.C_NUMBER_RE+"\\b",relevance:0},p,m,i,s],b=[...g];return b.pop(),b.push(a),h.contains=b,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:g}}Ye.registerLanguage("bash",LS);Ye.registerLanguage("css",FS);Ye.registerLanguage("go",jS);Ye.registerLanguage("java",HS);Ye.registerLanguage("javascript",KS);Ye.registerLanguage("json",JS);Ye.registerLanguage("markdown",GS);Ye.registerLanguage("python",QS);Ye.registerLanguage("ruby",XS);Ye.registerLanguage("rust",YS);Ye.registerLanguage("sql",e_);Ye.registerLanguage("typescript",l_);Ye.registerLanguage("xml",Cg);Ye.registerLanguage("html",Cg);Ye.registerLanguage("yaml",Dc);Ye.registerLanguage("toml",Dc);Ye.registerLanguage("ini",Dc);function wt(e){return rn(e)}function Nc(e,t){let n=(t||"").toLowerCase();if(!n||n==="text")return wt(e);try{return Ye.getLanguage(n)?Ye.highlight(e,{language:n,ignoreIllegals:!0}).value:Ye.highlightAuto(e).value}catch{return wt(e)}}function Ve(e){return e.replace(/^\[Reading [^\]]+\]\r?\n(?:\r?\n)?/,"")}function Ut(e){let t=e.match(/^\[Reading (\d+) lines from (?:line )?(\d+|start) \(total: (\d+) lines/);if(!t)return;let n=Number.parseInt(t[1],10),o=t[2]==="start",r=o?0:Number.parseInt(t[2],10),i=o?1:r,s=Number.parseInt(t[3],10);return{fromLine:i,toLine:i+n-1,totalLines:s,isPartial:n<s,readOffset:r}}function zc(e){return e.availableDisplayModes?.includes("fullscreen")?{canFullscreen:!0}:{canFullscreen:!1,reason:"Fullscreen editing is unavailable in this host."}}function u_(e){return Ut(e)?.isPartial===!0}function xr(e){return typeof e=="object"&&e!==null}function Ot(e){let t=e.trim().replace(/\\/g,"/"),n=t.split("/").pop()??t,o=n.lastIndexOf(".");return o<=0||o===n.length-1?"none":n.slice(o+1).toLowerCase()}function Oc(e){return xr(e)?typeof e.fileName=="string"&&typeof e.filePath=="string"&&typeof e.fileType=="string":!1}function Tg(e,t){return{...e,content:t}}function Ht(e){if(!xr(e))return;let t=e.content;if(Array.isArray(t)){for(let n of t)if(xr(n)&&n.type==="text"&&typeof n.text=="string"&&n.text.trim().length>0)return n.text}}function X4(e){if(!xr(e))return;let t=e.content;if(!Array.isArray(t))return;let n=[];for(let o of t)xr(o)&&o.type==="text"&&typeof o.text=="string"&&o.text.trim().length>0&&n.push(o.text);return n.length>0?n.join(`
`):void 0}function Rc(e){if(!xr(e))return;let t=Oc(e.structuredContent)?e.structuredContent:Oc(e)?e:null;if(t)return Tg(t,X4(e)??"")}function c_(e){if(!xr(e))throw new Error("edit_block did not return a valid result.");if(e.isError===!0){let t=Ht(e)??"";throw new Error(t||"edit_block failed.")}if(!xr(e.structuredContent)){let t=Ht(e)??"";throw new Error(t||"edit_block did not confirm success.")}}function kr(e){return/^https?:\/\//i.test(e)}function d_(e){return e.replace(/\\/g,"/").split("/").filter(Boolean).map(o=>wt(o)).join(' <span class="breadcrumb-sep">\u203A</span> ')}function Ag(e){let t=Ve(e);if(t==="")return 0;let n=t.split(`
`);return n[n.length-1]===""?n.length-1:n.length}function Mg(e){let t=e.split(`
`),n=[],o=[];for(let a of t)/^\[(DIR|FILE|DENIED|NOT_FOUND|WARNING)\]/.test(a.trim())?o.push(a.trim()):o.length===0&&n.push(a);let r=[];for(let a of o){if(a.startsWith("[WARNING]")){let h=a.replace(/^\[WARNING\]\s*/,""),p=h.indexOf(":"),m=p>=0?h.slice(0,p).trim():"",g=p>=0?h.slice(p+1).trim():h,b=m.replace(/\\/g,"/").split("/").filter(Boolean);r.push({name:m,fullPath:m,isDir:!1,isDenied:!1,isNotFound:!1,isWarning:!0,warningText:g,depth:b.length});continue}let l=a.startsWith("[DIR]"),u=a.startsWith("[DENIED]"),c=a.startsWith("[NOT_FOUND]"),d=a.replace(/^\[(DIR|FILE|DENIED|NOT_FOUND)\]\s*/,""),f=d.replace(/\\/g,"/").split("/");r.push({name:d,fullPath:d,isDir:l,isDenied:u,isNotFound:c,isWarning:!1,warningText:"",depth:f.length-1})}let i=[],s=[i];for(let a of r){let u={name:a.fullPath.replace(/\\/g,"/").split("/").pop()??a.fullPath,isDir:a.isDir,isDenied:a.isDenied,isNotFound:a.isNotFound,isWarning:a.isWarning,warningText:a.warningText,children:[],relativePath:a.fullPath};for(;s.length>a.depth+1;)s.pop();s[s.length-1].push(u),a.isDir&&s.push(u.children)}return{hint:n.join(`
`).trim(),entries:i}}var f_=0;function $g(e,t){if(e.length===0)return'<div class="dir-tree"><span class="dir-empty">Empty directory</span></div>';function n(o){return o.map(r=>{let i=`de-${f_++}`,s=`${t}/${r.relativePath.replace(/\\/g,"/")}`,a=wt(s);if(r.isWarning)return`<div class="dir-entry"><button class="dir-row dir-row-warning dir-load-more" data-loadpath="${a}"><span class="dir-warning-icon">\u26A0\uFE0F</span> <span class="dir-warning-text">${wt(r.warningText)} \u2014 click to load all</span></button></div>`;if(r.isDenied)return`<div class="dir-entry"><span class="dir-icon">\u{1F6AB}</span> <span class="dir-name-denied">${wt(r.name)}</span></div>`;if(r.isNotFound)return`<div class="dir-entry"><span class="dir-icon">\u2753</span> <span class="dir-name-denied">${wt(r.name)}</span></div>`;if(r.isDir){let l=r.children.length>0,u=`<span class="dir-chevron${l?" expanded":""}">${l?"\u25BC":"\u25B6"}</span>`,c=`<button class="dir-open-btn" data-openpath="${a}" title="Open in Finder">\u{1F4C2}</button>`,d=l?`<div class="dir-children" id="${i}-ch">${n(r.children)}</div>`:"";return`<div class="dir-entry-group" id="${i}"><div class="dir-row dir-row-folder" data-path="${a}" data-eid="${i}" data-loaded="${l}">${u} <span class="dir-icon">\u{1F4C1}</span> <span class="dir-name">${wt(r.name)}</span>${c}</div>${d}</div>`}return`<div class="dir-entry"><div class="dir-row dir-row-file" data-path="${a}"><span class="file-icon">\u{1F4C4}</span> <span class="file-name">${wt(r.name)}</span></div></div>`}).join("")}return`<div class="dir-tree">${n(e)}</div>`}function p_(e,t){f_=0;let{hint:n,entries:o}=Mg(e);return{notice:n||void 0,html:`<div class="panel-content directory-content">${$g(o,t)}</div>`}}function h_(e){let t=e.container.querySelector(".dir-tree");t&&t.addEventListener("click",async n=>{let o=n.target.closest(".dir-open-btn");if(o){n.stopPropagation();let a=o.dataset.openpath;if(!a)return;let l=e.buildOpenInFolderCommand(a);if(l)try{await e.callTool?.("start_process",{command:l,timeout_ms:12e3,origin:"ui"})}catch{}return}let r=n.target.closest(".dir-load-more");if(r){n.stopPropagation();let a=r.dataset.loadpath;if(!a)return;r.querySelector(".dir-warning-text").textContent="Loading\u2026",r.disabled=!0;try{let l=await e.callTool?.("list_directory",{path:a,depth:1,origin:"ui"}),u=Ht(l)??"";if(u){let c=Mg(u),d=$g(c.entries,a),f=r.closest(".dir-children");if(f){let h=document.createElement("div");h.innerHTML=d;let p=h.querySelector(".dir-tree");f.innerHTML=p?p.innerHTML:""}}}catch{r.querySelector(".dir-warning-text").textContent="Failed to load",r.disabled=!1}return}let i=n.target.closest(".dir-row");if(!i)return;let s=i.dataset.path;if(s){if(i.classList.contains("dir-row-folder")){let a=i.dataset.eid;if(!a)return;let l=document.getElementById(`${a}-ch`),u=i.querySelector(".dir-chevron");if(l){let c=l.classList.toggle("dir-collapsed");u?.classList.toggle("expanded",!c),u&&(u.textContent=c?"\u25B6":"\u25BC");return}if(i.dataset.loaded==="true")return;u&&(u.textContent="\u23F3");try{let c=await e.callTool?.("list_directory",{path:s,depth:2,origin:"ui"}),d=Ht(c)??"";if(d){i.dataset.loaded="true";let f=Mg(d),h=$g(f.entries,s),p=document.createElement("div");p.className="dir-children",p.id=`${a}-ch`;let m=document.createElement("div");m.innerHTML=h;let g=m.querySelector(".dir-tree");p.innerHTML=g?g.innerHTML:'<span class="dir-empty">Empty</span>',i.parentElement?.appendChild(p),u?.classList.add("expanded"),u&&(u.textContent="\u25BC")}}catch{u&&(u.textContent="\u26A0")}return}if(i.classList.contains("dir-row-file")){i.classList.add("dir-loading");try{let a=await e.callTool?.("read_file",{path:s,origin:"ui"});if(!a||typeof a!="object"||a===null)return;let l=a.structuredContent;if(l&&typeof l=="object"){let u=Ht(a)??"";e.onOpenPayload(Tg(l,u))}}catch{i.classList.remove("dir-loading")}}}})}var m_=Object.defineProperty,Ig=(e,t)=>{let n={};for(var o in e)m_(n,o,{get:e[o],enumerable:!0});return t||m_(n,Symbol.toStringTag,{value:"Module"}),n};function At(e){this.content=e}At.prototype={constructor:At,find:function(e){for(var t=0;t<this.content.length;t+=2)if(this.content[t]===e)return t;return-1},get:function(e){var t=this.find(e);return t==-1?void 0:this.content[t+1]},update:function(e,t,n){var o=n&&n!=e?this.remove(n):this,r=o.find(e),i=o.content.slice();return r==-1?i.push(n||e,t):(i[r+1]=t,n&&(i[r]=n)),new At(i)},remove:function(e){var t=this.find(e);if(t==-1)return this;var n=this.content.slice();return n.splice(t,2),new At(n)},addToStart:function(e,t){return new At([e,t].concat(this.remove(e).content))},addToEnd:function(e,t){var n=this.remove(e).content.slice();return n.push(e,t),new At(n)},addBefore:function(e,t,n){var o=this.remove(t),r=o.content.slice(),i=o.find(e);return r.splice(i==-1?r.length:i,0,t,n),new At(r)},forEach:function(e){for(var t=0;t<this.content.length;t+=2)e(this.content[t],this.content[t+1])},prepend:function(e){return e=At.from(e),e.size?new At(e.content.concat(this.subtract(e).content)):this},append:function(e){return e=At.from(e),e.size?new At(this.subtract(e).content.concat(e.content)):this},subtract:function(e){var t=this;e=At.from(e);for(var n=0;n<e.content.length;n+=2)t=t.remove(e.content[n]);return t},toObject:function(){var e={};return this.forEach(function(t,n){e[t]=n}),e},get size(){return this.content.length>>1}};At.from=function(e){if(e instanceof At)return e;var t=[];if(e)for(var n in e)t.push(n,e[n]);return new At(t)};var Dg=At;function C_(e,t,n){for(let o=0;;o++){if(o==e.childCount||o==t.childCount)return e.childCount==t.childCount?null:n;let r=e.child(o),i=t.child(o);if(r==i){n+=r.nodeSize;continue}if(!r.sameMarkup(i))return n;if(r.isText&&r.text!=i.text){let s=r.text,a=i.text,l=0;for(;s[l]==a[l];l++)n++;return l&&l<s.length&&l<a.length&&M_(s.charCodeAt(l-1))&&A_(s.charCodeAt(l))&&n--,n}if(r.content.size||i.content.size){let s=C_(r.content,i.content,n+1);if(s!=null)return s}n+=r.nodeSize}}function T_(e,t,n,o){for(let r=e.childCount,i=t.childCount;;){if(r==0||i==0)return r==i?null:{a:n,b:o};let s=e.child(--r),a=t.child(--i),l=s.nodeSize;if(s==a){n-=l,o-=l;continue}if(!s.sameMarkup(a))return{a:n,b:o};if(s.isText&&s.text!=a.text){let u=s.text,c=a.text,d=u.length,f=c.length;for(;d>0&&f>0&&u[d-1]==c[f-1];)d--,f--,n--,o--;return d&&f&&d<u.length&&M_(u.charCodeAt(d-1))&&A_(u.charCodeAt(d))&&(n++,o++),{a:n,b:o}}if(s.content.size||a.content.size){let u=T_(s.content,a.content,n-1,o-1);if(u)return u}n-=l,o-=l}}function A_(e){return e>=56320&&e<57344}function M_(e){return e>=55296&&e<56320}var M=class e{constructor(t,n){if(this.content=t,this.size=n||0,n==null)for(let o=0;o<t.length;o++)this.size+=t[o].nodeSize}nodesBetween(t,n,o,r=0,i){for(let s=0,a=0;a<n;s++){let l=this.content[s],u=a+l.nodeSize;if(u>t&&o(l,r+a,i||null,s)!==!1&&l.content.size){let c=a+1;l.nodesBetween(Math.max(0,t-c),Math.min(l.content.size,n-c),o,r+c)}a=u}}descendants(t){this.nodesBetween(0,this.size,t)}textBetween(t,n,o,r){let i="",s=!0;return this.nodesBetween(t,n,(a,l)=>{let u=a.isText?a.text.slice(Math.max(t,l)-l,n-l):a.isLeaf?r?typeof r=="function"?r(a):r:a.type.spec.leafText?a.type.spec.leafText(a):"":"";a.isBlock&&(a.isLeaf&&u||a.isTextblock)&&o&&(s?s=!1:i+=o),i+=u},0),i}append(t){if(!t.size)return this;if(!this.size)return t;let n=this.lastChild,o=t.firstChild,r=this.content.slice(),i=0;for(n.isText&&n.sameMarkup(o)&&(r[r.length-1]=n.withText(n.text+o.text),i=1);i<t.content.length;i++)r.push(t.content[i]);return new e(r,this.size+t.size)}cut(t,n=this.size){if(t==0&&n==this.size)return this;let o=[],r=0;if(n>t)for(let i=0,s=0;s<n;i++){let a=this.content[i],l=s+a.nodeSize;l>t&&((s<t||l>n)&&(a.isText?a=a.cut(Math.max(0,t-s),Math.min(a.text.length,n-s)):a=a.cut(Math.max(0,t-s-1),Math.min(a.content.size,n-s-1))),o.push(a),r+=a.nodeSize),s=l}return new e(o,r)}cutByIndex(t,n){return t==n?e.empty:t==0&&n==this.content.length?this:new e(this.content.slice(t,n))}replaceChild(t,n){let o=this.content[t];if(o==n)return this;let r=this.content.slice(),i=this.size+n.nodeSize-o.nodeSize;return r[t]=n,new e(r,i)}addToStart(t){return new e([t].concat(this.content),this.size+t.nodeSize)}addToEnd(t){return new e(this.content.concat(t),this.size+t.nodeSize)}eq(t){if(this.content.length!=t.content.length)return!1;for(let n=0;n<this.content.length;n++)if(!this.content[n].eq(t.content[n]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(t){let n=this.content[t];if(!n)throw new RangeError("Index "+t+" out of range for "+this);return n}maybeChild(t){return this.content[t]||null}forEach(t){for(let n=0,o=0;n<this.content.length;n++){let r=this.content[n];t(r,o,n),o+=r.nodeSize}}findDiffStart(t,n=0){return C_(this,t,n)}findDiffEnd(t,n=this.size,o=t.size){return T_(this,t,n,o)}findIndex(t){if(t==0)return Pc(0,t);if(t==this.size)return Pc(this.content.length,t);if(t>this.size||t<0)throw new RangeError(`Position ${t} outside of fragment (${this})`);for(let n=0,o=0;;n++){let r=this.child(n),i=o+r.nodeSize;if(i>=t)return i==t?Pc(n+1,i):Pc(n,o);o=i}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(t=>t.toJSON()):null}static fromJSON(t,n){if(!n)return e.empty;if(!Array.isArray(n))throw new RangeError("Invalid input for Fragment.fromJSON");return e.fromArray(n.map(t.nodeFromJSON))}static fromArray(t){if(!t.length)return e.empty;let n,o=0;for(let r=0;r<t.length;r++){let i=t[r];o+=i.nodeSize,r&&i.isText&&t[r-1].sameMarkup(i)?(n||(n=t.slice(0,r)),n[n.length-1]=i.withText(n[n.length-1].text+i.text)):n&&n.push(i)}return new e(n||t,o)}static from(t){if(!t)return e.empty;if(t instanceof e)return t;if(Array.isArray(t))return this.fromArray(t);if(t.attrs)return new e([t],t.nodeSize);throw new RangeError("Can not convert "+t+" to a Fragment"+(t.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}};M.empty=new M([],0);var Ng={index:0,offset:0};function Pc(e,t){return Ng.index=e,Ng.offset=t,Ng}function jc(e,t){if(e===t)return!0;if(!(e&&typeof e=="object")||!(t&&typeof t=="object"))return!1;let n=Array.isArray(e);if(Array.isArray(t)!=n)return!1;if(n){if(e.length!=t.length)return!1;for(let o=0;o<e.length;o++)if(!jc(e[o],t[o]))return!1}else{for(let o in e)if(!(o in t)||!jc(e[o],t[o]))return!1;for(let o in t)if(!(o in e))return!1}return!0}var be=class e{constructor(t,n){this.type=t,this.attrs=n}addToSet(t){let n,o=!1;for(let r=0;r<t.length;r++){let i=t[r];if(this.eq(i))return t;if(this.type.excludes(i.type))n||(n=t.slice(0,r));else{if(i.type.excludes(this.type))return t;!o&&i.type.rank>this.type.rank&&(n||(n=t.slice(0,r)),n.push(this),o=!0),n&&n.push(i)}}return n||(n=t.slice()),o||n.push(this),n}removeFromSet(t){for(let n=0;n<t.length;n++)if(this.eq(t[n]))return t.slice(0,n).concat(t.slice(n+1));return t}isInSet(t){for(let n=0;n<t.length;n++)if(this.eq(t[n]))return!0;return!1}eq(t){return this==t||this.type==t.type&&jc(this.attrs,t.attrs)}toJSON(){let t={type:this.type.name};for(let n in this.attrs){t.attrs=this.attrs;break}return t}static fromJSON(t,n){if(!n)throw new RangeError("Invalid input for Mark.fromJSON");let o=t.marks[n.type];if(!o)throw new RangeError(`There is no mark type ${n.type} in this schema`);return o.create(n.attrs)}static sameSet(t,n){if(t==n)return!0;if(t.length!=n.length)return!1;for(let o=0;o<t.length;o++)if(!t[o].eq(n[o]))return!1;return!0}static setFrom(t){if(!t||Array.isArray(t)&&t.length==0)return e.none;if(t instanceof e)return[t];let n=t.slice();return n.sort((o,r)=>o.type.rank-r.type.rank),n}};be.none=[];var wr=class extends Error{},F=class e{constructor(t,n,o){this.content=t,this.openStart=n,this.openEnd=o}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(t,n){let o=I_(this.content,t+this.openStart,n,this.openStart+1,this.openEnd+1);return o&&new e(o,this.openStart,this.openEnd)}removeBetween(t,n){return new e($_(this.content,t+this.openStart,n+this.openStart),this.openStart,this.openEnd)}eq(t){return this.content.eq(t.content)&&this.openStart==t.openStart&&this.openEnd==t.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let t={content:this.content.toJSON()};return this.openStart>0&&(t.openStart=this.openStart),this.openEnd>0&&(t.openEnd=this.openEnd),t}static fromJSON(t,n){if(!n)return e.empty;let o=n.openStart||0,r=n.openEnd||0;if(typeof o!="number"||typeof r!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new e(M.fromJSON(t,n.content),o,r)}static maxOpen(t,n=!0){let o=0,r=0;for(let i=t.firstChild;i&&!i.isLeaf&&(n||!i.type.spec.isolating);i=i.firstChild)o++;for(let i=t.lastChild;i&&!i.isLeaf&&(n||!i.type.spec.isolating);i=i.lastChild)r++;return new e(t,o,r)}};F.empty=new F(M.empty,0,0);function $_(e,t,n){let{index:o,offset:r}=e.findIndex(t),i=e.maybeChild(o),{index:s,offset:a}=e.findIndex(n);if(r==t||i.isText){if(a!=n&&!e.child(s).isText)throw new RangeError("Removing non-flat range");return e.cut(0,t).append(e.cut(n))}if(o!=s)throw new RangeError("Removing non-flat range");return e.replaceChild(o,i.copy($_(i.content,t-r-1,n-r-1)))}function I_(e,t,n,o,r,i){let{index:s,offset:a}=e.findIndex(t),l=e.maybeChild(s);if(a==t||l.isText)return i&&o<=0&&r<=0&&!i.canReplace(s,s,n)?null:e.cut(0,t).append(n).append(e.cut(t));let u=I_(l.content,t-a-1,n,s==0?o-1:0,s==e.childCount-1?r-1:0,l);return u&&e.replaceChild(s,l.copy(u))}function Y4(e,t,n){if(n.openStart>e.depth)throw new wr("Inserted content deeper than insertion position");if(e.depth-n.openStart!=t.depth-n.openEnd)throw new wr("Inconsistent open depths");return D_(e,t,n,0)}function D_(e,t,n,o){let r=e.index(o),i=e.node(o);if(r==t.index(o)&&o<e.depth-n.openStart){let s=D_(e,t,n,o+1);return i.copy(i.content.replaceChild(r,s))}else if(n.content.size)if(!n.openStart&&!n.openEnd&&e.depth==o&&t.depth==o){let s=e.parent,a=s.content;return no(s,a.cut(0,e.parentOffset).append(n.content).append(a.cut(t.parentOffset)))}else{let{start:s,end:a}=ez(n,e);return no(i,z_(e,s,a,t,o))}else return no(i,Bc(e,t,o))}function N_(e,t){if(!t.type.compatibleContent(e.type))throw new wr("Cannot join "+t.type.name+" onto "+e.type.name)}function zg(e,t,n){let o=e.node(n);return N_(o,t.node(n)),o}function to(e,t){let n=t.length-1;n>=0&&e.isText&&e.sameMarkup(t[n])?t[n]=e.withText(t[n].text+e.text):t.push(e)}function ga(e,t,n,o){let r=(t||e).node(n),i=0,s=t?t.index(n):r.childCount;e&&(i=e.index(n),e.depth>n?i++:e.textOffset&&(to(e.nodeAfter,o),i++));for(let a=i;a<s;a++)to(r.child(a),o);t&&t.depth==n&&t.textOffset&&to(t.nodeBefore,o)}function no(e,t){if(!e.type.validContent(t))throw new wr("Invalid content for node "+e.type.name);return e.copy(t)}function z_(e,t,n,o,r){let i=e.depth>r&&zg(e,t,r+1),s=o.depth>r&&zg(n,o,r+1),a=[];return ga(null,e,r,a),i&&s&&t.index(r)==n.index(r)?(N_(i,s),to(no(i,z_(e,t,n,o,r+1)),a)):(i&&to(no(i,Bc(e,t,r+1)),a),ga(t,n,r,a),s&&to(no(s,Bc(n,o,r+1)),a)),ga(o,null,r,a),new M(a)}function Bc(e,t,n){let o=[];if(ga(null,e,n,o),e.depth>n){let r=zg(e,t,n+1);to(no(r,Bc(e,t,n+1)),o)}return ga(t,null,n,o),new M(o)}function ez(e,t){let n=t.depth-e.openStart,r=t.node(n).copy(e.content);for(let i=n-1;i>=0;i--)r=t.node(i).copy(M.from(r));return{start:r.resolveNoCache(e.openStart+n),end:r.resolveNoCache(r.content.size-e.openEnd-n)}}var Uc=class e{constructor(t,n,o){this.pos=t,this.path=n,this.parentOffset=o,this.depth=n.length/3-1}resolveDepth(t){return t==null?this.depth:t<0?this.depth+t:t}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(t){return this.path[this.resolveDepth(t)*3]}index(t){return this.path[this.resolveDepth(t)*3+1]}indexAfter(t){return t=this.resolveDepth(t),this.index(t)+(t==this.depth&&!this.textOffset?0:1)}start(t){return t=this.resolveDepth(t),t==0?0:this.path[t*3-1]+1}end(t){return t=this.resolveDepth(t),this.start(t)+this.node(t).content.size}before(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position before the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]}after(t){if(t=this.resolveDepth(t),!t)throw new RangeError("There is no position after the top-level node");return t==this.depth+1?this.pos:this.path[t*3-1]+this.path[t*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let t=this.parent,n=this.index(this.depth);if(n==t.childCount)return null;let o=this.pos-this.path[this.path.length-1],r=t.child(n);return o?t.child(n).cut(o):r}get nodeBefore(){let t=this.index(this.depth),n=this.pos-this.path[this.path.length-1];return n?this.parent.child(t).cut(0,n):t==0?null:this.parent.child(t-1)}posAtIndex(t,n){n=this.resolveDepth(n);let o=this.path[n*3],r=n==0?0:this.path[n*3-1]+1;for(let i=0;i<t;i++)r+=o.child(i).nodeSize;return r}marks(){let t=this.parent,n=this.index();if(t.content.size==0)return be.none;if(this.textOffset)return t.child(n).marks;let o=t.maybeChild(n-1),r=t.maybeChild(n);if(!o){let a=o;o=r,r=a}let i=o.marks;for(var s=0;s<i.length;s++)i[s].type.spec.inclusive===!1&&(!r||!i[s].isInSet(r.marks))&&(i=i[s--].removeFromSet(i));return i}marksAcross(t){let n=this.parent.maybeChild(this.index());if(!n||!n.isInline)return null;let o=n.marks,r=t.parent.maybeChild(t.index());for(var i=0;i<o.length;i++)o[i].type.spec.inclusive===!1&&(!r||!o[i].isInSet(r.marks))&&(o=o[i--].removeFromSet(o));return o}sharedDepth(t){for(let n=this.depth;n>0;n--)if(this.start(n)<=t&&this.end(n)>=t)return n;return 0}blockRange(t=this,n){if(t.pos<this.pos)return t.blockRange(this);for(let o=this.depth-(this.parent.inlineContent||this.pos==t.pos?1:0);o>=0;o--)if(t.pos<=this.end(o)&&(!n||n(this.node(o))))return new ro(this,t,o);return null}sameParent(t){return this.pos-this.parentOffset==t.pos-t.parentOffset}max(t){return t.pos>this.pos?t:this}min(t){return t.pos<this.pos?t:this}toString(){let t="";for(let n=1;n<=this.depth;n++)t+=(t?"/":"")+this.node(n).type.name+"_"+this.index(n-1);return t+":"+this.parentOffset}static resolve(t,n){if(!(n>=0&&n<=t.content.size))throw new RangeError("Position "+n+" out of range");let o=[],r=0,i=n;for(let s=t;;){let{index:a,offset:l}=s.content.findIndex(i),u=i-l;if(o.push(s,a,r+l),!u||(s=s.child(a),s.isText))break;i=u-1,r+=l+1}return new e(n,o,i)}static resolveCached(t,n){let o=g_.get(t);if(o)for(let i=0;i<o.elts.length;i++){let s=o.elts[i];if(s.pos==n)return s}else g_.set(t,o=new Og);let r=o.elts[o.i]=e.resolve(t,n);return o.i=(o.i+1)%tz,r}},Og=class{constructor(){this.elts=[],this.i=0}},tz=12,g_=new WeakMap,ro=class{constructor(t,n,o){this.$from=t,this.$to=n,this.depth=o}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}},nz=Object.create(null),hn=class e{constructor(t,n,o,r=be.none){this.type=t,this.attrs=n,this.marks=r,this.content=o||M.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(t){return this.content.child(t)}maybeChild(t){return this.content.maybeChild(t)}forEach(t){this.content.forEach(t)}nodesBetween(t,n,o,r=0){this.content.nodesBetween(t,n,o,r,this)}descendants(t){this.nodesBetween(0,this.content.size,t)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(t,n,o,r){return this.content.textBetween(t,n,o,r)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(t){return this==t||this.sameMarkup(t)&&this.content.eq(t.content)}sameMarkup(t){return this.hasMarkup(t.type,t.attrs,t.marks)}hasMarkup(t,n,o){return this.type==t&&jc(this.attrs,n||t.defaultAttrs||nz)&&be.sameSet(this.marks,o||be.none)}copy(t=null){return t==this.content?this:new e(this.type,this.attrs,t,this.marks)}mark(t){return t==this.marks?this:new e(this.type,this.attrs,this.content,t)}cut(t,n=this.content.size){return t==0&&n==this.content.size?this:this.copy(this.content.cut(t,n))}slice(t,n=this.content.size,o=!1){if(t==n)return F.empty;let r=this.resolve(t),i=this.resolve(n),s=o?0:r.sharedDepth(n),a=r.start(s),u=r.node(s).content.cut(r.pos-a,i.pos-a);return new F(u,r.depth-s,i.depth-s)}replace(t,n,o){return Y4(this.resolve(t),this.resolve(n),o)}nodeAt(t){for(let n=this;;){let{index:o,offset:r}=n.content.findIndex(t);if(n=n.maybeChild(o),!n)return null;if(r==t||n.isText)return n;t-=r+1}}childAfter(t){let{index:n,offset:o}=this.content.findIndex(t);return{node:this.content.maybeChild(n),index:n,offset:o}}childBefore(t){if(t==0)return{node:null,index:0,offset:0};let{index:n,offset:o}=this.content.findIndex(t);if(o<t)return{node:this.content.child(n),index:n,offset:o};let r=this.content.child(n-1);return{node:r,index:n-1,offset:o-r.nodeSize}}resolve(t){return Uc.resolveCached(this,t)}resolveNoCache(t){return Uc.resolve(this,t)}rangeHasMark(t,n,o){let r=!1;return n>t&&this.nodesBetween(t,n,i=>(o.isInSet(i.marks)&&(r=!0),!r)),r}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let t=this.type.name;return this.content.size&&(t+="("+this.content.toStringInner()+")"),O_(this.marks,t)}contentMatchAt(t){let n=this.type.contentMatch.matchFragment(this.content,0,t);if(!n)throw new Error("Called contentMatchAt on a node with invalid content");return n}canReplace(t,n,o=M.empty,r=0,i=o.childCount){let s=this.contentMatchAt(t).matchFragment(o,r,i),a=s&&s.matchFragment(this.content,n);if(!a||!a.validEnd)return!1;for(let l=r;l<i;l++)if(!this.type.allowsMarks(o.child(l).marks))return!1;return!0}canReplaceWith(t,n,o,r){if(r&&!this.type.allowsMarks(r))return!1;let i=this.contentMatchAt(t).matchType(o),s=i&&i.matchFragment(this.content,n);return s?s.validEnd:!1}canAppend(t){return t.content.size?this.canReplace(this.childCount,this.childCount,t.content):this.type.compatibleContent(t.type)}check(){this.type.checkContent(this.content),b_(this.type.attrs,this.attrs,"node",this.type.name);let t=be.none;for(let n=0;n<this.marks.length;n++){let o=this.marks[n];b_(o.type.attrs,o.attrs,"mark",o.type.name),t=o.addToSet(t)}if(!be.sameSet(t,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(n=>n.type.name)}`);this.content.forEach(n=>n.check())}toJSON(){let t={type:this.type.name};for(let n in this.attrs){t.attrs=this.attrs;break}return this.content.size&&(t.content=this.content.toJSON()),this.marks.length&&(t.marks=this.marks.map(n=>n.toJSON())),t}static fromJSON(t,n){if(!n)throw new RangeError("Invalid input for Node.fromJSON");let o;if(n.marks){if(!Array.isArray(n.marks))throw new RangeError("Invalid mark data for Node.fromJSON");o=n.marks.map(t.markFromJSON)}if(n.type=="text"){if(typeof n.text!="string")throw new RangeError("Invalid text node in JSON");return t.text(n.text,o)}let r=M.fromJSON(t,n.content);return t.nodeType(n.type).create(n.attrs,r,o)}};hn.prototype.text=void 0;var Rg=class e extends hn{constructor(t,n,o,r){if(super(t,n,null,r),!o)throw new RangeError("Empty text nodes are not allowed");this.text=o}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):O_(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(t,n){return this.text.slice(t,n)}get nodeSize(){return this.text.length}mark(t){return t==this.marks?this:new e(this.type,this.attrs,this.text,t)}withText(t){return t==this.text?this:new e(this.type,this.attrs,t,this.marks)}cut(t=0,n=this.text.length){return t==0&&n==this.text.length?this:this.withText(this.text.slice(t,n))}eq(t){return this.sameMarkup(t)&&this.text==t.text}toJSON(){let t=super.toJSON();return t.text=this.text,t}};function O_(e,t){for(let n=e.length-1;n>=0;n--)t=e[n].type.name+"("+t+")";return t}function b_(e,t,n,o){for(let r in t)if(!(r in e))throw new RangeError(`Unsupported attribute ${r} for ${n} of type ${o}`);for(let r in e)e[r].validate&&e[r].validate(t[r])}var oo=class e{constructor(t){this.validEnd=t,this.next=[],this.wrapCache=[]}static parse(t,n){let o=new Pg(t,n);if(o.next==null)return e.empty;let r=R_(o);o.next&&o.err("Unexpected trailing text");let i=uz(lz(r));return cz(i,o),i}matchType(t){for(let n=0;n<this.next.length;n++)if(this.next[n].type==t)return this.next[n].next;return null}matchFragment(t,n=0,o=t.childCount){let r=this;for(let i=n;r&&i<o;i++)r=r.matchType(t.child(i).type);return r}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let t=0;t<this.next.length;t++){let{type:n}=this.next[t];if(!(n.isText||n.hasRequiredAttrs()))return n}return null}compatible(t){for(let n=0;n<this.next.length;n++)for(let o=0;o<t.next.length;o++)if(this.next[n].type==t.next[o].type)return!0;return!1}fillBefore(t,n=!1,o=0){let r=[this];function i(s,a){let l=s.matchFragment(t,o);if(l&&(!n||l.validEnd))return M.from(a.map(u=>u.createAndFill()));for(let u=0;u<s.next.length;u++){let{type:c,next:d}=s.next[u];if(!(c.isText||c.hasRequiredAttrs())&&r.indexOf(d)==-1){r.push(d);let f=i(d,a.concat(c));if(f)return f}}return null}return i(this,[])}findWrapping(t){for(let o=0;o<this.wrapCache.length;o+=2)if(this.wrapCache[o]==t)return this.wrapCache[o+1];let n=this.computeWrapping(t);return this.wrapCache.push(t,n),n}computeWrapping(t){let n=Object.create(null),o=[{match:this,type:null,via:null}];for(;o.length;){let r=o.shift(),i=r.match;if(i.matchType(t)){let s=[];for(let a=r;a.type;a=a.via)s.push(a.type);return s.reverse()}for(let s=0;s<i.next.length;s++){let{type:a,next:l}=i.next[s];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in n)&&(!r.type||l.validEnd)&&(o.push({match:a.contentMatch,type:a,via:r}),n[a.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(t){if(t>=this.next.length)throw new RangeError(`There's no ${t}th edge in this content match`);return this.next[t]}toString(){let t=[];function n(o){t.push(o);for(let r=0;r<o.next.length;r++)t.indexOf(o.next[r].next)==-1&&n(o.next[r].next)}return n(this),t.map((o,r)=>{let i=r+(o.validEnd?"*":" ")+" ";for(let s=0;s<o.next.length;s++)i+=(s?", ":"")+o.next[s].type.name+"->"+t.indexOf(o.next[s].next);return i}).join(`
`)}};oo.empty=new oo(!0);var Pg=class{constructor(t,n){this.string=t,this.nodeTypes=n,this.inline=null,this.pos=0,this.tokens=t.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(t){return this.next==t&&(this.pos++||!0)}err(t){throw new SyntaxError(t+" (in content expression '"+this.string+"')")}};function R_(e){let t=[];do t.push(rz(e));while(e.eat("|"));return t.length==1?t[0]:{type:"choice",exprs:t}}function rz(e){let t=[];do t.push(oz(e));while(e.next&&e.next!=")"&&e.next!="|");return t.length==1?t[0]:{type:"seq",exprs:t}}function oz(e){let t=az(e);for(;;)if(e.eat("+"))t={type:"plus",expr:t};else if(e.eat("*"))t={type:"star",expr:t};else if(e.eat("?"))t={type:"opt",expr:t};else if(e.eat("{"))t=iz(e,t);else break;return t}function y_(e){/\D/.test(e.next)&&e.err("Expected number, got '"+e.next+"'");let t=Number(e.next);return e.pos++,t}function iz(e,t){let n=y_(e),o=n;return e.eat(",")&&(e.next!="}"?o=y_(e):o=-1),e.eat("}")||e.err("Unclosed braced range"),{type:"range",min:n,max:o,expr:t}}function sz(e,t){let n=e.nodeTypes,o=n[t];if(o)return[o];let r=[];for(let i in n){let s=n[i];s.isInGroup(t)&&r.push(s)}return r.length==0&&e.err("No node type or group '"+t+"' found"),r}function az(e){if(e.eat("(")){let t=R_(e);return e.eat(")")||e.err("Missing closing paren"),t}else if(/\W/.test(e.next))e.err("Unexpected token '"+e.next+"'");else{let t=sz(e,e.next).map(n=>(e.inline==null?e.inline=n.isInline:e.inline!=n.isInline&&e.err("Mixing inline and block content"),{type:"name",value:n}));return e.pos++,t.length==1?t[0]:{type:"choice",exprs:t}}}function lz(e){let t=[[]];return r(i(e,0),n()),t;function n(){return t.push([])-1}function o(s,a,l){let u={term:l,to:a};return t[s].push(u),u}function r(s,a){s.forEach(l=>l.to=a)}function i(s,a){if(s.type=="choice")return s.exprs.reduce((l,u)=>l.concat(i(u,a)),[]);if(s.type=="seq")for(let l=0;;l++){let u=i(s.exprs[l],a);if(l==s.exprs.length-1)return u;r(u,a=n())}else if(s.type=="star"){let l=n();return o(a,l),r(i(s.expr,l),l),[o(l)]}else if(s.type=="plus"){let l=n();return r(i(s.expr,a),l),r(i(s.expr,l),l),[o(l)]}else{if(s.type=="opt")return[o(a)].concat(i(s.expr,a));if(s.type=="range"){let l=a;for(let u=0;u<s.min;u++){let c=n();r(i(s.expr,l),c),l=c}if(s.max==-1)r(i(s.expr,l),l);else for(let u=s.min;u<s.max;u++){let c=n();o(l,c),r(i(s.expr,l),c),l=c}return[o(l)]}else{if(s.type=="name")return[o(a,void 0,s.value)];throw new Error("Unknown expr type")}}}}function P_(e,t){return t-e}function v_(e,t){let n=[];return o(t),n.sort(P_);function o(r){let i=e[r];if(i.length==1&&!i[0].term)return o(i[0].to);n.push(r);for(let s=0;s<i.length;s++){let{term:a,to:l}=i[s];!a&&n.indexOf(l)==-1&&o(l)}}}function uz(e){let t=Object.create(null);return n(v_(e,0));function n(o){let r=[];o.forEach(s=>{e[s].forEach(({term:a,to:l})=>{if(!a)return;let u;for(let c=0;c<r.length;c++)r[c][0]==a&&(u=r[c][1]);v_(e,l).forEach(c=>{u||r.push([a,u=[]]),u.indexOf(c)==-1&&u.push(c)})})});let i=t[o.join(",")]=new oo(o.indexOf(e.length-1)>-1);for(let s=0;s<r.length;s++){let a=r[s][1].sort(P_);i.next.push({type:r[s][0],next:t[a.join(",")]||n(a)})}return i}}function cz(e,t){for(let n=0,o=[e];n<o.length;n++){let r=o[n],i=!r.validEnd,s=[];for(let a=0;a<r.next.length;a++){let{type:l,next:u}=r.next[a];s.push(l.name),i&&!(l.isText||l.hasRequiredAttrs())&&(i=!1),o.indexOf(u)==-1&&o.push(u)}i&&t.err("Only non-generatable nodes ("+s.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function L_(e){let t=Object.create(null);for(let n in e){let o=e[n];if(!o.hasDefault)return null;t[n]=o.default}return t}function F_(e,t){let n=Object.create(null);for(let o in e){let r=e[o],i=t&&t[o];if(i===void 0)if(r.hasDefault)i=r.default;else throw new RangeError("No value supplied for attribute "+o);else r.validate&&r.validate(i);n[o]=i}return n}function j_(e,t){let n=Object.create(null);if(t)for(let o in t)n[o]=new Lg(e,o,t[o]);return n}var Hc=class e{constructor(t,n,o){this.name=t,this.schema=n,this.spec=o,this.markSet=null,this.groups=o.group?o.group.split(" "):[],this.attrs=j_(t,o.attrs),this.defaultAttrs=L_(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(o.inline||t=="text"),this.isText=t=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==oo.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(t){return this.groups.indexOf(t)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let t in this.attrs)if(this.attrs[t].isRequired)return!0;return!1}compatibleContent(t){return this==t||this.contentMatch.compatible(t.contentMatch)}computeAttrs(t){return!t&&this.defaultAttrs?this.defaultAttrs:F_(this.attrs,t)}create(t=null,n,o){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new hn(this,this.computeAttrs(t),M.from(n),be.setFrom(o))}createChecked(t=null,n,o){return n=M.from(n),this.checkContent(n),new hn(this,this.computeAttrs(t),n,be.setFrom(o))}createAndFill(t=null,n,o){if(t=this.computeAttrs(t),n=M.from(n),n.size){let s=this.contentMatch.fillBefore(n);if(!s)return null;n=s.append(n)}let r=this.contentMatch.matchFragment(n),i=r&&r.fillBefore(M.empty,!0);return i?new hn(this,t,n.append(i),be.setFrom(o)):null}validContent(t){let n=this.contentMatch.matchFragment(t);if(!n||!n.validEnd)return!1;for(let o=0;o<t.childCount;o++)if(!this.allowsMarks(t.child(o).marks))return!1;return!0}checkContent(t){if(!this.validContent(t))throw new RangeError(`Invalid content for node ${this.name}: ${t.toString().slice(0,50)}`)}checkAttrs(t){}allowsMarkType(t){return this.markSet==null||this.markSet.indexOf(t)>-1}allowsMarks(t){if(this.markSet==null)return!0;for(let n=0;n<t.length;n++)if(!this.allowsMarkType(t[n].type))return!1;return!0}allowedMarks(t){if(this.markSet==null)return t;let n;for(let o=0;o<t.length;o++)this.allowsMarkType(t[o].type)?n&&n.push(t[o]):n||(n=t.slice(0,o));return n?n.length?n:be.none:t}static compile(t,n){let o=Object.create(null);t.forEach((i,s)=>o[i]=new e(i,n,s));let r=n.spec.topNode||"doc";if(!o[r])throw new RangeError("Schema is missing its top node type ('"+r+"')");if(!o.text)throw new RangeError("Every schema needs a 'text' type");for(let i in o.text.attrs)throw new RangeError("The text node type should not have attributes");return o}};function dz(e,t,n){let o=n.split("|");return r=>{let i=r===null?"null":typeof r;if(o.indexOf(i)<0)throw new RangeError(`Expected value of type ${o} for attribute ${t} on type ${e}, got ${i}`)}}var Lg=class{constructor(t,n,o){this.hasDefault=Object.prototype.hasOwnProperty.call(o,"default"),this.default=o.default,this.validate=typeof o.validate=="string"?dz(t,n,o.validate):o.validate}get isRequired(){return!this.hasDefault}},ya=class e{constructor(t,n,o,r){this.name=t,this.rank=n,this.schema=o,this.spec=r,this.attrs=j_(t,r.attrs),this.excluded=null;let i=L_(this.attrs);this.instance=i?new be(this,i):null}create(t=null){return!t&&this.instance?this.instance:new be(this,F_(this.attrs,t))}static compile(t,n){let o=Object.create(null),r=0;return t.forEach((i,s)=>o[i]=new e(i,r++,n,s)),o}removeFromSet(t){for(var n=0;n<t.length;n++)t[n].type==this&&(t=t.slice(0,n).concat(t.slice(n+1)),n--);return t}isInSet(t){for(let n=0;n<t.length;n++)if(t[n].type==this)return t[n]}excludes(t){return this.excluded.indexOf(t)>-1}},Vn=class{constructor(t){this.linebreakReplacement=null,this.cached=Object.create(null);let n=this.spec={};for(let r in t)n[r]=t[r];n.nodes=Dg.from(t.nodes),n.marks=Dg.from(t.marks||{}),this.nodes=Hc.compile(this.spec.nodes,this),this.marks=ya.compile(this.spec.marks,this);let o=Object.create(null);for(let r in this.nodes){if(r in this.marks)throw new RangeError(r+" can not be both a node and a mark");let i=this.nodes[r],s=i.spec.content||"",a=i.spec.marks;if(i.contentMatch=o[s]||(o[s]=oo.parse(s,this.nodes)),i.inlineContent=i.contentMatch.inlineContent,i.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!i.isInline||!i.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=i}i.markSet=a=="_"?null:a?x_(this,a.split(" ")):a==""||!i.inlineContent?[]:null}for(let r in this.marks){let i=this.marks[r],s=i.spec.excludes;i.excluded=s==null?[i]:s==""?[]:x_(this,s.split(" "))}this.nodeFromJSON=r=>hn.fromJSON(this,r),this.markFromJSON=r=>be.fromJSON(this,r),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(t,n=null,o,r){if(typeof t=="string")t=this.nodeType(t);else if(t instanceof Hc){if(t.schema!=this)throw new RangeError("Node type from different schema used ("+t.name+")")}else throw new RangeError("Invalid node type: "+t);return t.createChecked(n,o,r)}text(t,n){let o=this.nodes.text;return new Rg(o,o.defaultAttrs,t,be.setFrom(n))}mark(t,n){return typeof t=="string"&&(t=this.marks[t]),t.create(n)}nodeType(t){let n=this.nodes[t];if(!n)throw new RangeError("Unknown node type: "+t);return n}};function x_(e,t){let n=[];for(let o=0;o<t.length;o++){let r=t[o],i=e.marks[r],s=i;if(i)n.push(i);else for(let a in e.marks){let l=e.marks[a];(r=="_"||l.spec.group&&l.spec.group.split(" ").indexOf(r)>-1)&&n.push(s=l)}if(!s)throw new SyntaxError("Unknown mark type: '"+t[o]+"'")}return n}function fz(e){return e.tag!=null}function pz(e){return e.style!=null}var mn=class e{constructor(t,n){this.schema=t,this.rules=n,this.tags=[],this.styles=[];let o=this.matchedStyles=[];n.forEach(r=>{if(fz(r))this.tags.push(r);else if(pz(r)){let i=/[^=]*/.exec(r.style)[0];o.indexOf(i)<0&&o.push(i),this.styles.push(r)}}),this.normalizeLists=!this.tags.some(r=>{if(!/^(ul|ol)\b/.test(r.tag)||!r.node)return!1;let i=t.nodes[r.node];return i.contentMatch.matchType(i)})}parse(t,n={}){let o=new qc(this,n,!1);return o.addAll(t,be.none,n.from,n.to),o.finish()}parseSlice(t,n={}){let o=new qc(this,n,!0);return o.addAll(t,be.none,n.from,n.to),F.maxOpen(o.finish())}matchTag(t,n,o){for(let r=o?this.tags.indexOf(o)+1:0;r<this.tags.length;r++){let i=this.tags[r];if(gz(t,i.tag)&&(i.namespace===void 0||t.namespaceURI==i.namespace)&&(!i.context||n.matchesContext(i.context))){if(i.getAttrs){let s=i.getAttrs(t);if(s===!1)continue;i.attrs=s||void 0}return i}}}matchStyle(t,n,o,r){for(let i=r?this.styles.indexOf(r)+1:0;i<this.styles.length;i++){let s=this.styles[i],a=s.style;if(!(a.indexOf(t)!=0||s.context&&!o.matchesContext(s.context)||a.length>t.length&&(a.charCodeAt(t.length)!=61||a.slice(t.length+1)!=n))){if(s.getAttrs){let l=s.getAttrs(n);if(l===!1)continue;s.attrs=l||void 0}return s}}}static schemaRules(t){let n=[];function o(r){let i=r.priority==null?50:r.priority,s=0;for(;s<n.length;s++){let a=n[s];if((a.priority==null?50:a.priority)<i)break}n.splice(s,0,r)}for(let r in t.marks){let i=t.marks[r].spec.parseDOM;i&&i.forEach(s=>{o(s=w_(s)),s.mark||s.ignore||s.clearMark||(s.mark=r)})}for(let r in t.nodes){let i=t.nodes[r].spec.parseDOM;i&&i.forEach(s=>{o(s=w_(s)),s.node||s.ignore||s.mark||(s.node=r)})}return n}static fromSchema(t){return t.cached.domParser||(t.cached.domParser=new e(t,e.schemaRules(t)))}},B_={address:!0,article:!0,aside:!0,blockquote:!0,body:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},hz={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},U_={ol:!0,ul:!0},va=1,Fg=2,ba=4;function k_(e,t,n){return t!=null?(t?va:0)|(t==="full"?Fg:0):e&&e.whitespace=="pre"?va|Fg:n&~ba}var Ei=class{constructor(t,n,o,r,i,s){this.type=t,this.attrs=n,this.marks=o,this.solid=r,this.options=s,this.content=[],this.activeMarks=be.none,this.match=i||(s&ba?null:t.contentMatch)}findWrapping(t){if(!this.match){if(!this.type)return[];let n=this.type.contentMatch.fillBefore(M.from(t));if(n)this.match=this.type.contentMatch.matchFragment(n);else{let o=this.type.contentMatch,r;return(r=o.findWrapping(t.type))?(this.match=o,r):null}}return this.match.findWrapping(t.type)}finish(t){if(!(this.options&va)){let o=this.content[this.content.length-1],r;if(o&&o.isText&&(r=/[ \t\r\n\u000c]+$/.exec(o.text))){let i=o;o.text.length==r[0].length?this.content.pop():this.content[this.content.length-1]=i.withText(i.text.slice(0,i.text.length-r[0].length))}}let n=M.from(this.content);return!t&&this.match&&(n=n.append(this.match.fillBefore(M.empty,!0))),this.type?this.type.create(this.attrs,n,this.marks):n}inlineContext(t){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:t.parentNode&&!B_.hasOwnProperty(t.parentNode.nodeName.toLowerCase())}},qc=class{constructor(t,n,o){this.parser=t,this.options=n,this.isOpen=o,this.open=0,this.localPreserveWS=!1;let r=n.topNode,i,s=k_(null,n.preserveWhitespace,0)|(o?ba:0);r?i=new Ei(r.type,r.attrs,be.none,!0,n.topMatch||r.type.contentMatch,s):o?i=new Ei(null,null,be.none,!0,null,s):i=new Ei(t.schema.topNodeType,null,be.none,!0,null,s),this.nodes=[i],this.find=n.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(t,n){t.nodeType==3?this.addTextNode(t,n):t.nodeType==1&&this.addElement(t,n)}addTextNode(t,n){let o=t.nodeValue,r=this.top,i=r.options&Fg?"full":this.localPreserveWS||(r.options&va)>0,{schema:s}=this.parser;if(i==="full"||r.inlineContext(t)||/[^ \t\r\n\u000c]/.test(o)){if(i)if(i==="full")o=o.replace(/\r\n?/g,`
`);else if(s.linebreakReplacement&&/[\r\n]/.test(o)&&this.top.findWrapping(s.linebreakReplacement.create())){let a=o.split(/\r?\n|\r/);for(let l=0;l<a.length;l++)l&&this.insertNode(s.linebreakReplacement.create(),n,!0),a[l]&&this.insertNode(s.text(a[l]),n,!/\S/.test(a[l]));o=""}else o=o.replace(/\r?\n|\r/g," ");else if(o=o.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(o)&&this.open==this.nodes.length-1){let a=r.content[r.content.length-1],l=t.previousSibling;(!a||l&&l.nodeName=="BR"||a.isText&&/[ \t\r\n\u000c]$/.test(a.text))&&(o=o.slice(1))}o&&this.insertNode(s.text(o),n,!/\S/.test(o)),this.findInText(t)}else this.findInside(t)}addElement(t,n,o){let r=this.localPreserveWS,i=this.top;(t.tagName=="PRE"||/pre/.test(t.style&&t.style.whiteSpace))&&(this.localPreserveWS=!0);let s=t.nodeName.toLowerCase(),a;U_.hasOwnProperty(s)&&this.parser.normalizeLists&&mz(t);let l=this.options.ruleFromNode&&this.options.ruleFromNode(t)||(a=this.parser.matchTag(t,this,o));e:if(l?l.ignore:hz.hasOwnProperty(s))this.findInside(t),this.ignoreFallback(t,n);else if(!l||l.skip||l.closeParent){l&&l.closeParent?this.open=Math.max(0,this.open-1):l&&l.skip.nodeType&&(t=l.skip);let u,c=this.needsBlock;if(B_.hasOwnProperty(s))i.content.length&&i.content[0].isInline&&this.open&&(this.open--,i=this.top),u=!0,i.type||(this.needsBlock=!0);else if(!t.firstChild){this.leafFallback(t,n);break e}let d=l&&l.skip?n:this.readStyles(t,n);d&&this.addAll(t,d),u&&this.sync(i),this.needsBlock=c}else{let u=this.readStyles(t,n);u&&this.addElementByRule(t,l,u,l.consuming===!1?a:void 0)}this.localPreserveWS=r}leafFallback(t,n){t.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(t.ownerDocument.createTextNode(`
`),n)}ignoreFallback(t,n){t.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),n,!0)}readStyles(t,n){let o=t.style;if(o&&o.length)for(let r=0;r<this.parser.matchedStyles.length;r++){let i=this.parser.matchedStyles[r],s=o.getPropertyValue(i);if(s)for(let a=void 0;;){let l=this.parser.matchStyle(i,s,this,a);if(!l)break;if(l.ignore)return null;if(l.clearMark?n=n.filter(u=>!l.clearMark(u)):n=n.concat(this.parser.schema.marks[l.mark].create(l.attrs)),l.consuming===!1)a=l;else break}}return n}addElementByRule(t,n,o,r){let i,s;if(n.node)if(s=this.parser.schema.nodes[n.node],s.isLeaf)this.insertNode(s.create(n.attrs),o,t.nodeName=="BR")||this.leafFallback(t,o);else{let l=this.enter(s,n.attrs||null,o,n.preserveWhitespace);l&&(i=!0,o=l)}else{let l=this.parser.schema.marks[n.mark];o=o.concat(l.create(n.attrs))}let a=this.top;if(s&&s.isLeaf)this.findInside(t);else if(r)this.addElement(t,o,r);else if(n.getContent)this.findInside(t),n.getContent(t,this.parser.schema).forEach(l=>this.insertNode(l,o,!1));else{let l=t;typeof n.contentElement=="string"?l=t.querySelector(n.contentElement):typeof n.contentElement=="function"?l=n.contentElement(t):n.contentElement&&(l=n.contentElement),this.findAround(t,l,!0),this.addAll(l,o),this.findAround(t,l,!1)}i&&this.sync(a)&&this.open--}addAll(t,n,o,r){let i=o||0;for(let s=o?t.childNodes[o]:t.firstChild,a=r==null?null:t.childNodes[r];s!=a;s=s.nextSibling,++i)this.findAtPoint(t,i),this.addDOM(s,n);this.findAtPoint(t,i)}findPlace(t,n,o){let r,i;for(let s=this.open,a=0;s>=0;s--){let l=this.nodes[s],u=l.findWrapping(t);if(u&&(!r||r.length>u.length+a)&&(r=u,i=l,!u.length))break;if(l.solid){if(o)break;a+=2}}if(!r)return null;this.sync(i);for(let s=0;s<r.length;s++)n=this.enterInner(r[s],null,n,!1);return n}insertNode(t,n,o){if(t.isInline&&this.needsBlock&&!this.top.type){let i=this.textblockFromContext();i&&(n=this.enterInner(i,null,n))}let r=this.findPlace(t,n,o);if(r){this.closeExtra();let i=this.top;i.match&&(i.match=i.match.matchType(t.type));let s=be.none;for(let a of r.concat(t.marks))(i.type?i.type.allowsMarkType(a.type):S_(a.type,t.type))&&(s=a.addToSet(s));return i.content.push(t.mark(s)),!0}return!1}enter(t,n,o,r){let i=this.findPlace(t.create(n),o,!1);return i&&(i=this.enterInner(t,n,o,!0,r)),i}enterInner(t,n,o,r=!1,i){this.closeExtra();let s=this.top;s.match=s.match&&s.match.matchType(t);let a=k_(t,i,s.options);s.options&ba&&s.content.length==0&&(a|=ba);let l=be.none;return o=o.filter(u=>(s.type?s.type.allowsMarkType(u.type):S_(u.type,t))?(l=u.addToSet(l),!1):!0),this.nodes.push(new Ei(t,n,l,r,null,a)),this.open++,o}closeExtra(t=!1){let n=this.nodes.length-1;if(n>this.open){for(;n>this.open;n--)this.nodes[n-1].content.push(this.nodes[n].finish(t));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(t){for(let n=this.open;n>=0;n--){if(this.nodes[n]==t)return this.open=n,!0;this.localPreserveWS&&(this.nodes[n].options|=va)}return!1}get currentPos(){this.closeExtra();let t=0;for(let n=this.open;n>=0;n--){let o=this.nodes[n].content;for(let r=o.length-1;r>=0;r--)t+=o[r].nodeSize;n&&t++}return t}findAtPoint(t,n){if(this.find)for(let o=0;o<this.find.length;o++)this.find[o].node==t&&this.find[o].offset==n&&(this.find[o].pos=this.currentPos)}findInside(t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].pos==null&&t.nodeType==1&&t.contains(this.find[n].node)&&(this.find[n].pos=this.currentPos)}findAround(t,n,o){if(t!=n&&this.find)for(let r=0;r<this.find.length;r++)this.find[r].pos==null&&t.nodeType==1&&t.contains(this.find[r].node)&&n.compareDocumentPosition(this.find[r].node)&(o?2:4)&&(this.find[r].pos=this.currentPos)}findInText(t){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==t&&(this.find[n].pos=this.currentPos-(t.nodeValue.length-this.find[n].offset))}matchesContext(t){if(t.indexOf("|")>-1)return t.split(/\s*\|\s*/).some(this.matchesContext,this);let n=t.split("/"),o=this.options.context,r=!this.isOpen&&(!o||o.parent.type==this.nodes[0].type),i=-(o?o.depth+1:0)+(r?0:1),s=(a,l)=>{for(;a>=0;a--){let u=n[a];if(u==""){if(a==n.length-1||a==0)continue;for(;l>=i;l--)if(s(a-1,l))return!0;return!1}else{let c=l>0||l==0&&r?this.nodes[l].type:o&&l>=i?o.node(l-i).type:null;if(!c||c.name!=u&&!c.isInGroup(u))return!1;l--}}return!0};return s(n.length-1,this.open)}textblockFromContext(){let t=this.options.context;if(t)for(let n=t.depth;n>=0;n--){let o=t.node(n).contentMatchAt(t.indexAfter(n)).defaultType;if(o&&o.isTextblock&&o.defaultAttrs)return o}for(let n in this.parser.schema.nodes){let o=this.parser.schema.nodes[n];if(o.isTextblock&&o.defaultAttrs)return o}}};function mz(e){for(let t=e.firstChild,n=null;t;t=t.nextSibling){let o=t.nodeType==1?t.nodeName.toLowerCase():null;o&&U_.hasOwnProperty(o)&&n?(n.appendChild(t),t=n):o=="li"?n=t:o&&(n=null)}}function gz(e,t){return(e.matches||e.msMatchesSelector||e.webkitMatchesSelector||e.mozMatchesSelector).call(e,t)}function w_(e){let t={};for(let n in e)t[n]=e[n];return t}function S_(e,t){let n=t.schema.nodes;for(let o in n){let r=n[o];if(!r.allowsMarkType(e))continue;let i=[],s=a=>{i.push(a);for(let l=0;l<a.edgeCount;l++){let{type:u,next:c}=a.edge(l);if(u==t||i.indexOf(c)<0&&s(c))return!0}};if(s(r.contentMatch))return!0}}var Wn=class e{constructor(t,n){this.nodes=t,this.marks=n}serializeFragment(t,n={},o){o||(o=Lc(n).createDocumentFragment());let r=o,i=[];return t.forEach(s=>{if(i.length||s.marks.length){let a=0,l=0;for(;a<i.length&&l<s.marks.length;){let u=s.marks[l];if(!this.marks[u.type.name]){l++;continue}if(!u.eq(i[a][0])||u.type.spec.spanning===!1)break;a++,l++}for(;a<i.length;)r=i.pop()[1];for(;l<s.marks.length;){let u=s.marks[l++],c=this.serializeMark(u,s.isInline,n);c&&(i.push([u,r]),r.appendChild(c.dom),r=c.contentDOM||c.dom)}}r.appendChild(this.serializeNodeInner(s,n))}),o}serializeNodeInner(t,n){if(t.isText)return Lc(n).createTextNode(t.text);let{dom:o,contentDOM:r}=Fc(Lc(n),this.nodes[t.type.name](t),null,t.attrs);if(r){if(t.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(t.content,n,r)}return o}serializeNode(t,n={}){let o=this.serializeNodeInner(t,n);for(let r=t.marks.length-1;r>=0;r--){let i=this.serializeMark(t.marks[r],t.isInline,n);i&&((i.contentDOM||i.dom).appendChild(o),o=i.dom)}return o}serializeMark(t,n,o={}){let r=this.marks[t.type.name];return r&&Fc(Lc(o),r(t,n),null,t.attrs)}static renderSpec(t,n,o=null,r){return typeof n=="string"?{dom:t.createTextNode(n)}:Fc(t,n,o,r)}static fromSchema(t){return t.cached.domSerializer||(t.cached.domSerializer=new e(this.nodesFromSchema(t),this.marksFromSchema(t)))}static nodesFromSchema(t){let n=__(t.nodes);return n.text||(n.text=o=>o.text),n}static marksFromSchema(t){return __(t.marks)}};function __(e){let t={};for(let n in e){let o=e[n].spec.toDOM;o&&(t[n]=o)}return t}function Lc(e){return e.document||window.document}var E_=new WeakMap;function bz(e){let t=E_.get(e);return t===void 0&&E_.set(e,t=yz(e)),t}function yz(e){let t=null;function n(o){if(o&&typeof o=="object")if(Array.isArray(o))if(typeof o[0]=="string")t||(t=[]),t.push(o);else for(let r=0;r<o.length;r++)n(o[r]);else for(let r in o)n(o[r])}return n(e),t}function Fc(e,t,n,o){if(t.nodeType==1)return{dom:t};if(t.dom&&t.dom.nodeType==1)return t;let r=t[0],i;if(typeof r!="string")throw new RangeError("Invalid array passed to renderSpec");if(o&&(i=bz(o))&&i.indexOf(t)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let s=r.indexOf(" ");s>0&&(n=r.slice(0,s),r=r.slice(s+1));let a,l=n?e.createElementNS(n,r):e.createElement(r),u=t[1],c=1;if(u&&typeof u=="object"&&u.nodeType==null&&!Array.isArray(u)){c=2;for(let d in u)if(u[d]!=null){let f=d.indexOf(" ");f>0?l.setAttributeNS(d.slice(0,f),d.slice(f+1),u[d]):d=="style"&&l.style?l.style.cssText=u[d]:l.setAttribute(d,u[d])}}for(let d=c;d<t.length;d++){let f=t[d];if(f===0){if(d<t.length-1||d>c)throw new RangeError("Content hole must be the only child of its parent node");return{dom:l,contentDOM:l}}else if(typeof f=="string")l.appendChild(e.createTextNode(f));else{let{dom:h,contentDOM:p}=Fc(e,f,n,o);if(l.appendChild(h),p){if(a)throw new RangeError("Multiple content holes");a=p}}}return{dom:l,contentDOM:a}}var W_=65535,K_=Math.pow(2,16);function vz(e,t){return e+t*K_}function H_(e){return e&W_}function xz(e){return(e-(e&W_))/K_}var J_=1,G_=2,Zc=4,Q_=8,wa=class{constructor(t,n,o){this.pos=t,this.delInfo=n,this.recover=o}get deleted(){return(this.delInfo&Q_)>0}get deletedBefore(){return(this.delInfo&(J_|Zc))>0}get deletedAfter(){return(this.delInfo&(G_|Zc))>0}get deletedAcross(){return(this.delInfo&Zc)>0}},Kn=class e{constructor(t,n=!1){if(this.ranges=t,this.inverted=n,!t.length&&e.empty)return e.empty}recover(t){let n=0,o=H_(t);if(!this.inverted)for(let r=0;r<o;r++)n+=this.ranges[r*3+2]-this.ranges[r*3+1];return this.ranges[o*3]+n+xz(t)}mapResult(t,n=1){return this._map(t,n,!1)}map(t,n=1){return this._map(t,n,!0)}_map(t,n,o){let r=0,i=this.inverted?2:1,s=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?r:0);if(l>t)break;let u=this.ranges[a+i],c=this.ranges[a+s],d=l+u;if(t<=d){let f=u?t==l?-1:t==d?1:n:n,h=l+r+(f<0?0:c);if(o)return h;let p=t==(n<0?l:d)?null:vz(a/3,t-l),m=0;return u&&(m|=t==l?G_:t==d?J_:Zc,(n<0?t!=l:t!=d)&&(m|=Q_)),new wa(h,m,p)}r+=c-u}return o?t+r:new wa(t+r,0,null)}touches(t,n){let o=0,r=H_(n),i=this.inverted?2:1,s=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?o:0);if(l>t)break;let u=this.ranges[a+i],c=l+u;if(t<=c&&a==r*3)return!0;o+=this.ranges[a+s]-u}return!1}forEach(t){let n=this.inverted?2:1,o=this.inverted?1:2;for(let r=0,i=0;r<this.ranges.length;r+=3){let s=this.ranges[r],a=s-(this.inverted?i:0),l=s+(this.inverted?0:i),u=this.ranges[r+n],c=this.ranges[r+o];t(a,a+u,l,l+c),i+=c-u}}invert(){return new e(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(t){return t==0?e.empty:new e(t<0?[0,-t,0]:[0,0,t])}};Kn.empty=new Kn([]);var Sa=class e{constructor(t,n,o=0,r=t?t.length:0){this.mirror=n,this.from=o,this.to=r,this._maps=t||[],this.ownData=!(t||n)}get maps(){return this._maps}slice(t=0,n=this.maps.length){return new e(this._maps,this.mirror,t,n)}appendMap(t,n){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(t),n!=null&&this.setMirror(this._maps.length-1,n)}appendMapping(t){for(let n=t.from,o=this._maps.length;n<t.to;n++){let r=t.getMirror(n);r!=null&&(r=r<n&&r>=t.from?o+(r-t.from):void 0),this.appendMap(t._maps[n],r)}}getMirror(t){if(this.mirror){for(let n=0;n<this.mirror.length;n++)if(this.mirror[n]==t)return this.mirror[n+(n%2?-1:1)]}}setMirror(t,n){this.mirror||(this.mirror=[]),this.mirror.push(t,n)}appendMappingInverted(t){for(let n=t.to-1,o=this._maps.length+t._maps.length;n>=t.from;n--){let r=t.getMirror(n);r!=null&&(r=r>n&&r<t.to?o-(r-t.from)-1:void 0),this.appendMap(t._maps[n].invert(),r)}}invert(){let t=new e;return t.appendMappingInverted(this),t}map(t,n=1){if(this.mirror)return this._map(t,n,!0);for(let o=this.from;o<this.to;o++)t=this._maps[o].map(t,n);return t}mapResult(t,n=1){return this._map(t,n,!1)}_map(t,n,o){let r=0;for(let i=this.from;i<this.to;i++){let s=this._maps[i],a=s.mapResult(t,n);if(a.recover!=null){let l=this.getMirror(i);if(l!=null&&l>i&&l<this.to){i=l,t=this._maps[l].recover(a.recover);continue}}r|=a.delInfo,t=a.pos}return o?t:new wa(t,r,null)}},jg=Object.create(null),et=class{getMap(){return Kn.empty}merge(t){return null}static fromJSON(t,n){if(!n||!n.stepType)throw new RangeError("Invalid input for Step.fromJSON");let o=jg[n.stepType];if(!o)throw new RangeError(`No step type ${n.stepType} defined`);return o.fromJSON(t,n)}static jsonID(t,n){if(t in jg)throw new RangeError("Duplicate use of step JSON ID "+t);return jg[t]=n,n.prototype.jsonID=t,n}},pt=class e{constructor(t,n){this.doc=t,this.failed=n}static ok(t){return new e(t,null)}static fail(t){return new e(null,t)}static fromReplace(t,n,o,r){try{return e.ok(t.replace(n,o,r))}catch(i){if(i instanceof wr)return e.fail(i.message);throw i}}};function qg(e,t,n){let o=[];for(let r=0;r<e.childCount;r++){let i=e.child(r);i.content.size&&(i=i.copy(qg(i.content,t,i))),i.isInline&&(i=t(i,n,r)),o.push(i)}return M.fromArray(o)}var io=class e extends et{constructor(t,n,o){super(),this.from=t,this.to=n,this.mark=o}apply(t){let n=t.slice(this.from,this.to),o=t.resolve(this.from),r=o.node(o.sharedDepth(this.to)),i=new F(qg(n.content,(s,a)=>!s.isAtom||!a.type.allowsMarkType(this.mark.type)?s:s.mark(this.mark.addToSet(s.marks)),r),n.openStart,n.openEnd);return pt.fromReplace(t,this.from,this.to,i)}invert(t){let n=[];return t.nodesBetween(this.from,this.to,(o,r)=>{if(o.isInline&&o.isAtom){let i=this.mark.addToSet(o.marks);if(!be.sameSet(i,o.marks)){let s=Math.max(this.from,r),a=Math.min(this.to,r+o.nodeSize);Vc(In,s,a,this.mark,n);for(let l of o.marks)l.isInSet(i)||Vc(e,s,a,l,n)}}}),n.length==1?n[0]:new _a(n)}map(t){let n=t.map(this.from,1),o=t.map(this.to,-1);return n>=o?null:new e(n,o,this.mark)}merge(t){return t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new e(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new e(n.from,n.to,t.markFromJSON(n.mark))}};et.jsonID("addMark",io);var In=class e extends et{constructor(t,n,o){super(),this.from=t,this.to=n,this.mark=o}apply(t){let n=t.slice(this.from,this.to),o=new F(qg(n.content,r=>r.mark(this.mark.removeFromSet(r.marks)),t),n.openStart,n.openEnd);return pt.fromReplace(t,this.from,this.to,o)}invert(t){let n=[];return t.nodesBetween(this.from,this.to,(o,r)=>{o.isInline&&o.isAtom&&this.mark.isInSet(o.marks)&&Vc(io,Math.max(this.from,r),Math.min(this.to,r+o.nodeSize),this.mark,n)}),n.length==1?n[0]:new _a(n)}map(t){let n=t.map(this.from,1),o=t.map(this.to,-1);return n>=o?null:new e(n,o,this.mark)}merge(t){return t instanceof e&&t.mark.eq(this.mark)&&this.from<=t.to&&this.to>=t.from?new e(Math.min(this.from,t.from),Math.max(this.to,t.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new e(n.from,n.to,t.markFromJSON(n.mark))}};et.jsonID("removeMark",In);function Vc(e,t,n,o,r){let i=r.length?r[r.length-1]:null;i&&i instanceof e&&i.to==t&&i.mark.eq(o)?r[r.length-1]=new e(i.from,n,o):r.push(new e(t,n,o))}var _a=class e extends et{constructor(t){super(),this.steps=t}apply(t){for(let n of this.steps){let o=n.apply(t);if(!o.doc)return o;t=o.doc}return new pt(t,null)}invert(t){return new e(this.steps.map(n=>n.invert(t)))}map(t){let n=[];for(let o of this.steps){let r=o.map(t);r&&n.push(r)}return n.length?new e(n):null}toJSON(){return{stepType:"markSet",steps:this.steps.map(t=>t.toJSON())}}static fromJSON(t,n){if(!Array.isArray(n.steps)||!n.steps.every(o=>o.stepType=="addMark"||o.stepType=="removeMark"))throw new RangeError("Invalid JSON for MarkSetStep");return new e(n.steps.map(o=>et.fromJSON(t,o)))}};et.jsonID("markSet",_a);var Ea=class e extends et{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return pt.fail("No node at mark step's position");let o=n.type.create(n.attrs,null,this.mark.addToSet(n.marks));return pt.fromReplace(t,this.pos,this.pos+1,new F(M.from(o),0,n.isLeaf?0:1))}invert(t){let n=t.nodeAt(this.pos);if(n){let o=this.mark.addToSet(n.marks);if(o.length==n.marks.length){for(let r=0;r<n.marks.length;r++)if(!n.marks[r].isInSet(o))return new e(this.pos,n.marks[r]);return new e(this.pos,this.mark)}}return new Ci(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new e(n.pos,t.markFromJSON(n.mark))}};et.jsonID("addNodeMark",Ea);var Ci=class e extends et{constructor(t,n){super(),this.pos=t,this.mark=n}apply(t){let n=t.nodeAt(this.pos);if(!n)return pt.fail("No node at mark step's position");let o=n.type.create(n.attrs,null,this.mark.removeFromSet(n.marks));return pt.fromReplace(t,this.pos,this.pos+1,new F(M.from(o),0,n.isLeaf?0:1))}invert(t){let n=t.nodeAt(this.pos);return!n||!this.mark.isInSet(n.marks)?this:new Ea(this.pos,this.mark)}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(t,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new e(n.pos,t.markFromJSON(n.mark))}};et.jsonID("removeNodeMark",Ci);var rt=class e extends et{constructor(t,n,o,r=!1){super(),this.from=t,this.to=n,this.slice=o,this.structure=r}apply(t){return this.structure&&Ug(t,this.from,this.to)?pt.fail("Structure replace would overwrite content"):pt.fromReplace(t,this.from,this.to,this.slice)}getMap(){return new Kn([this.from,this.to-this.from,this.slice.size])}invert(t){return new e(this.from,this.from+this.slice.size,t.slice(this.from,this.to))}map(t){let n=t.mapResult(this.to,-1),o=this.from==this.to&&e.MAP_BIAS<0?n:t.mapResult(this.from,1);return o.deletedAcross&&n.deletedAcross?null:new e(o.pos,Math.max(o.pos,n.pos),this.slice,this.structure)}merge(t){if(!(t instanceof e)||t.structure||this.structure)return null;if(this.from+this.slice.size==t.from&&!this.slice.openEnd&&!t.slice.openStart){let n=this.slice.size+t.slice.size==0?F.empty:new F(this.slice.content.append(t.slice.content),this.slice.openStart,t.slice.openEnd);return new e(this.from,this.to+(t.to-t.from),n,this.structure)}else if(t.to==this.from&&!this.slice.openStart&&!t.slice.openEnd){let n=this.slice.size+t.slice.size==0?F.empty:new F(t.slice.content.append(this.slice.content),t.slice.openStart,this.slice.openEnd);return new e(t.from,this.to,n,this.structure)}else return null}toJSON(){let t={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new e(n.from,n.to,F.fromJSON(t,n.slice),!!n.structure)}};rt.MAP_BIAS=1;et.jsonID("replace",rt);var ot=class e extends et{constructor(t,n,o,r,i,s,a=!1){super(),this.from=t,this.to=n,this.gapFrom=o,this.gapTo=r,this.slice=i,this.insert=s,this.structure=a}apply(t){if(this.structure&&(Ug(t,this.from,this.gapFrom)||Ug(t,this.gapTo,this.to)))return pt.fail("Structure gap-replace would overwrite content");let n=t.slice(this.gapFrom,this.gapTo);if(n.openStart||n.openEnd)return pt.fail("Gap is not a flat range");let o=this.slice.insertAt(this.insert,n.content);return o?pt.fromReplace(t,this.from,this.to,o):pt.fail("Content does not fit in gap")}getMap(){return new Kn([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(t){let n=this.gapTo-this.gapFrom;return new e(this.from,this.from+this.slice.size+n,this.from+this.insert,this.from+this.insert+n,t.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(t){let n=t.mapResult(this.from,1),o=t.mapResult(this.to,-1),r=this.from==this.gapFrom?n.pos:t.map(this.gapFrom,-1),i=this.to==this.gapTo?o.pos:t.map(this.gapTo,1);return n.deletedAcross&&o.deletedAcross||r<n.pos||i>o.pos||r>i?null:new e(n.pos,o.pos,r,i,this.slice,this.insert,this.structure)}toJSON(){let t={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(t.slice=this.slice.toJSON()),this.structure&&(t.structure=!0),t}static fromJSON(t,n){if(typeof n.from!="number"||typeof n.to!="number"||typeof n.gapFrom!="number"||typeof n.gapTo!="number"||typeof n.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new e(n.from,n.to,n.gapFrom,n.gapTo,F.fromJSON(t,n.slice),n.insert,!!n.structure)}};et.jsonID("replaceAround",ot);function Ug(e,t,n){let o=e.resolve(t),r=n-t,i=o.depth;for(;r>0&&i>0&&o.indexAfter(i)==o.node(i).childCount;)i--,r--;if(r>0){let s=o.node(i).maybeChild(o.indexAfter(i));for(;r>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,r--}}return!1}function kz(e,t,n,o){let r=[];e.doc.nodesBetween(t,n,(i,s,a)=>{if(!i.isInline)return;let l=i.marks;if(!o.isInSet(l)&&a.type.allowsMarkType(o.type)){let u=Math.max(s,t),c=Math.min(s+i.nodeSize,n);Vc(io,u,c,o,r)}}),r.forEach(i=>e.step(i))}function wz(e,t,n,o){let r=[],i=0;e.doc.nodesBetween(t,n,(s,a)=>{if(!s.isInline||!s.isAtom)return;i++;let l=null;if(o instanceof ya){let u=s.marks,c;for(;c=o.isInSet(u);)(l||(l=[])).push(c),u=c.removeFromSet(u)}else o?o.isInSet(s.marks)&&(l=[o]):l=s.marks;if(l&&l.length){let u=Math.min(a+s.nodeSize,n);for(let c=0;c<l.length;c++){let d=l[c],f;for(let h=0;h<r.length;h++){let p=r[h];p.step==i-1&&d.eq(r[h].style)&&(f=p)}f?(f.to=u,f.step=i):r.push({style:d,from:Math.max(a,t),to:u,step:i})}}}),r.forEach(s=>e.step(new In(s.from,s.to,s.style)))}function Zg(e,t,n,o=n.contentMatch,r=!0){let i=e.doc.nodeAt(t),s=[],a=t+1;for(let l=0;l<i.childCount;l++){let u=i.child(l),c=a+u.nodeSize,d=o.matchType(u.type);if(!d)s.push(new rt(a,c,F.empty));else{o=d;for(let f=0;f<u.marks.length;f++)n.allowsMarkType(u.marks[f].type)||e.step(new In(a,c,u.marks[f]));if(r&&u.isText&&n.whitespace!="pre"){let f,h=/\r?\n|\r/g,p;for(;f=h.exec(u.text);)p||(p=new F(M.from(n.schema.text(" ",n.allowedMarks(u.marks))),0,0)),s.push(new rt(a+f.index,a+f.index+f[0].length,p))}}a=c}if(!o.validEnd){let l=o.fillBefore(M.empty,!0);e.replace(a,a,new F(l,0,0))}for(let l=s.length-1;l>=0;l--)e.step(s[l])}function Sz(e,t,n){return(t==0||e.canReplace(t,e.childCount))&&(n==e.childCount||e.canReplace(0,n))}function Gn(e){let n=e.parent.content.cutByIndex(e.startIndex,e.endIndex);for(let o=e.depth,r=0,i=0;;--o){let s=e.$from.node(o),a=e.$from.index(o)+r,l=e.$to.indexAfter(o)-i;if(o<e.depth&&s.canReplace(a,l,n))return o;if(o==0||s.type.spec.isolating||!Sz(s,a,l))break;a&&(r=1),l<s.childCount&&(i=1)}return null}function _z(e,t,n){let{$from:o,$to:r,depth:i}=t,s=o.before(i+1),a=r.after(i+1),l=s,u=a,c=M.empty,d=0;for(let p=i,m=!1;p>n;p--)m||o.index(p)>0?(m=!0,c=M.from(o.node(p).copy(c)),d++):l--;let f=M.empty,h=0;for(let p=i,m=!1;p>n;p--)m||r.after(p+1)<r.end(p)?(m=!0,f=M.from(r.node(p).copy(f)),h++):u++;e.step(new ot(l,u,s,a,new F(c.append(f),d,h),c.size-d,!0))}function Ai(e,t,n=null,o=e){let r=Ez(e,t),i=r&&Cz(o,t);return i?r.map(q_).concat({type:t,attrs:n}).concat(i.map(q_)):null}function q_(e){return{type:e,attrs:null}}function Ez(e,t){let{parent:n,startIndex:o,endIndex:r}=e,i=n.contentMatchAt(o).findWrapping(t);if(!i)return null;let s=i.length?i[0]:t;return n.canReplaceWith(o,r,s)?i:null}function Cz(e,t){let{parent:n,startIndex:o,endIndex:r}=e,i=n.child(o),s=t.contentMatch.findWrapping(i.type);if(!s)return null;let l=(s.length?s[s.length-1]:t).contentMatch;for(let u=o;l&&u<r;u++)l=l.matchType(n.child(u).type);return!l||!l.validEnd?null:s}function Tz(e,t,n){let o=M.empty;for(let s=n.length-1;s>=0;s--){if(o.size){let a=n[s].type.contentMatch.matchFragment(o);if(!a||!a.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}o=M.from(n[s].type.create(n[s].attrs,o))}let r=t.start,i=t.end;e.step(new ot(r,i,r,i,new F(o,0,0),n.length,!0))}function Az(e,t,n,o,r){if(!o.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let i=e.steps.length;e.doc.nodesBetween(t,n,(s,a)=>{let l=typeof r=="function"?r(s):r;if(s.isTextblock&&!s.hasMarkup(o,l)&&Mz(e.doc,e.mapping.slice(i).map(a),o)){let u=null;if(o.schema.linebreakReplacement){let h=o.whitespace=="pre",p=!!o.contentMatch.matchType(o.schema.linebreakReplacement);h&&!p?u=!1:!h&&p&&(u=!0)}u===!1&&Y_(e,s,a,i),Zg(e,e.mapping.slice(i).map(a,1),o,void 0,u===null);let c=e.mapping.slice(i),d=c.map(a,1),f=c.map(a+s.nodeSize,1);return e.step(new ot(d,f,d+1,f-1,new F(M.from(o.create(l,null,s.marks)),0,0),1,!0)),u===!0&&X_(e,s,a,i),!1}})}function X_(e,t,n,o){t.forEach((r,i)=>{if(r.isText){let s,a=/\r?\n|\r/g;for(;s=a.exec(r.text);){let l=e.mapping.slice(o).map(n+1+i+s.index);e.replaceWith(l,l+1,t.type.schema.linebreakReplacement.create())}}})}function Y_(e,t,n,o){t.forEach((r,i)=>{if(r.type==r.type.schema.linebreakReplacement){let s=e.mapping.slice(o).map(n+1+i);e.replaceWith(s,s+1,t.type.schema.text(`
`))}})}function Mz(e,t,n){let o=e.resolve(t),r=o.index();return o.parent.canReplaceWith(r,r+1,n)}function $z(e,t,n,o,r){let i=e.doc.nodeAt(t);if(!i)throw new RangeError("No node at given position");n||(n=i.type);let s=n.create(o,null,r||i.marks);if(i.isLeaf)return e.replaceWith(t,t+i.nodeSize,s);if(!n.validContent(i.content))throw new RangeError("Invalid content for node type "+n.name);e.step(new ot(t,t+i.nodeSize,t+1,t+i.nodeSize-1,new F(M.from(s),0,0),1,!0))}function on(e,t,n=1,o){let r=e.resolve(t),i=r.depth-n,s=o&&o[o.length-1]||r.parent;if(i<0||r.parent.type.spec.isolating||!r.parent.canReplace(r.index(),r.parent.childCount)||!s.type.validContent(r.parent.content.cutByIndex(r.index(),r.parent.childCount)))return!1;for(let u=r.depth-1,c=n-2;u>i;u--,c--){let d=r.node(u),f=r.index(u);if(d.type.spec.isolating)return!1;let h=d.content.cutByIndex(f,d.childCount),p=o&&o[c+1];p&&(h=h.replaceChild(0,p.type.create(p.attrs)));let m=o&&o[c]||d;if(!d.canReplace(f+1,d.childCount)||!m.type.validContent(h))return!1}let a=r.indexAfter(i),l=o&&o[0];return r.node(i).canReplaceWith(a,a,l?l.type:r.node(i+1).type)}function Iz(e,t,n=1,o){let r=e.doc.resolve(t),i=M.empty,s=M.empty;for(let a=r.depth,l=r.depth-n,u=n-1;a>l;a--,u--){i=M.from(r.node(a).copy(i));let c=o&&o[u];s=M.from(c?c.type.create(c.attrs,s):r.node(a).copy(s))}e.step(new rt(t,t,new F(i.append(s),n,n),!0))}function gn(e,t){let n=e.resolve(t),o=n.index();return eE(n.nodeBefore,n.nodeAfter)&&n.parent.canReplace(o,o+1)}function Dz(e,t){t.content.size||e.type.compatibleContent(t.type);let n=e.contentMatchAt(e.childCount),{linebreakReplacement:o}=e.type.schema;for(let r=0;r<t.childCount;r++){let i=t.child(r),s=i.type==o?e.type.schema.nodes.text:i.type;if(n=n.matchType(s),!n||!e.type.allowsMarks(i.marks))return!1}return n.validEnd}function eE(e,t){return!!(e&&t&&!e.isLeaf&&Dz(e,t))}function Mi(e,t,n=-1){let o=e.resolve(t);for(let r=o.depth;;r--){let i,s,a=o.index(r);if(r==o.depth?(i=o.nodeBefore,s=o.nodeAfter):n>0?(i=o.node(r+1),a++,s=o.node(r).maybeChild(a)):(i=o.node(r).maybeChild(a-1),s=o.node(r+1)),i&&!i.isTextblock&&eE(i,s)&&o.node(r).canReplace(a,a+1))return t;if(r==0)break;t=n<0?o.before(r):o.after(r)}}function Nz(e,t,n){let o=null,{linebreakReplacement:r}=e.doc.type.schema,i=e.doc.resolve(t-n),s=i.node().type;if(r&&s.inlineContent){let c=s.whitespace=="pre",d=!!s.contentMatch.matchType(r);c&&!d?o=!1:!c&&d&&(o=!0)}let a=e.steps.length;if(o===!1){let c=e.doc.resolve(t+n);Y_(e,c.node(),c.before(),a)}s.inlineContent&&Zg(e,t+n-1,s,i.node().contentMatchAt(i.index()),o==null);let l=e.mapping.slice(a),u=l.map(t-n);if(e.step(new rt(u,l.map(t+n,-1),F.empty,!0)),o===!0){let c=e.doc.resolve(u);X_(e,c.node(),c.before(),e.steps.length)}return e}function zz(e,t,n){let o=e.resolve(t);if(o.parent.canReplaceWith(o.index(),o.index(),n))return t;if(o.parentOffset==0)for(let r=o.depth-1;r>=0;r--){let i=o.index(r);if(o.node(r).canReplaceWith(i,i,n))return o.before(r+1);if(i>0)return null}if(o.parentOffset==o.parent.content.size)for(let r=o.depth-1;r>=0;r--){let i=o.indexAfter(r);if(o.node(r).canReplaceWith(i,i,n))return o.after(r+1);if(i<o.node(r).childCount)return null}return null}function Jc(e,t,n){let o=e.resolve(t);if(!n.content.size)return t;let r=n.content;for(let i=0;i<n.openStart;i++)r=r.firstChild.content;for(let i=1;i<=(n.openStart==0&&n.size?2:1);i++)for(let s=o.depth;s>=0;s--){let a=s==o.depth?0:o.pos<=(o.start(s+1)+o.end(s+1))/2?-1:1;for(let l=0;l<2;l++){if(l){if(!a)break;a=-a}let u=o.index(s)+(a>0?1:0),c=o.node(s),d=!1;if(i==1)d=c.canReplace(u,u,r);else{let f=c.contentMatchAt(u).findWrapping(r.firstChild.type);d=f&&c.canReplaceWith(u,u,f[0])}if(d)return a==0?o.pos:a<0?o.before(s+1):o.after(s+1)}}return null}function Ca(e,t,n=t,o=F.empty){if(t==n&&!o.size)return null;let r=e.resolve(t),i=e.resolve(n);return tE(r,i,o)?new rt(t,n,o):new Hg(r,i,o).fit()}function tE(e,t,n){return!n.openStart&&!n.openEnd&&e.start()==t.start()&&e.parent.canReplace(e.index(),t.index(),n.content)}var Hg=class{constructor(t,n,o){this.$from=t,this.$to=n,this.unplaced=o,this.frontier=[],this.placed=M.empty;for(let r=0;r<=t.depth;r++){let i=t.node(r);this.frontier.push({type:i.type,match:i.contentMatchAt(t.indexAfter(r))})}for(let r=t.depth;r>0;r--)this.placed=M.from(t.node(r).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let u=this.findFittable();u?this.placeNodes(u):this.openMore()||this.dropNode()}let t=this.mustMoveInline(),n=this.placed.size-this.depth-this.$from.depth,o=this.$from,r=this.close(t<0?this.$to:o.doc.resolve(t));if(!r)return null;let i=this.placed,s=o.depth,a=r.depth;for(;s&&a&&i.childCount==1;)i=i.firstChild.content,s--,a--;let l=new F(i,s,a);return t>-1?new ot(o.pos,t,this.$to.pos,this.$to.end(),l,n):l.size||o.pos!=this.$to.pos?new rt(o.pos,r.pos,l):null}findFittable(){let t=this.unplaced.openStart;for(let n=this.unplaced.content,o=0,r=this.unplaced.openEnd;o<t;o++){let i=n.firstChild;if(n.childCount>1&&(r=0),i.type.spec.isolating&&r<=o){t=o;break}n=i.content}for(let n=1;n<=2;n++)for(let o=n==1?t:this.unplaced.openStart;o>=0;o--){let r,i=null;o?(i=Z_(this.unplaced.content,o-1).firstChild,r=i.content):r=this.unplaced.content;let s=r.firstChild;for(let a=this.depth;a>=0;a--){let{type:l,match:u}=this.frontier[a],c,d=null;if(n==1&&(s?u.matchType(s.type)||(d=u.fillBefore(M.from(s),!1)):i&&l.compatibleContent(i.type)))return{sliceDepth:o,frontierDepth:a,parent:i,inject:d};if(n==2&&s&&(c=u.findWrapping(s.type)))return{sliceDepth:o,frontierDepth:a,parent:i,wrap:c};if(i&&u.matchType(i.type))break}}}openMore(){let{content:t,openStart:n,openEnd:o}=this.unplaced;return V_(t,-1)<=n?!1:(this.unplaced.size>1&&V_(t,1)>o&&o++,this.unplaced=new F(t,n+1,o),!0)}dropNode(){let{content:t,openStart:n,openEnd:o}=this.unplaced,r=Z_(t,n);if(r.childCount<=1&&n>0){let i=t.size-n<=n+r.size;this.unplaced=new F(xa(t,n-1,1),n-1,i?n-1:o)}else this.unplaced=new F(xa(t,n,1),n,o)}placeNodes({sliceDepth:t,frontierDepth:n,parent:o,inject:r,wrap:i}){for(;this.depth>n;)this.closeFrontierNode();if(i)for(let m=0;m<i.length;m++)this.openFrontierNode(i[m]);let s=this.unplaced,a=o?o.content:s.content,l=s.openStart-t,u=0,c=[],{match:d,type:f}=this.frontier[n];if(r){for(let m=0;m<r.childCount;m++)c.push(r.child(m));d=d.matchFragment(r)}let h=a.size+t-(s.content.size-s.openEnd);for(;u<a.childCount;){let m=a.child(u),g=d.matchType(m.type);if(!g)break;u++,(u>1||l==0||m.content.size)&&(d=g,c.push(nE(m.mark(f.allowedMarks(m.marks)),u==1?l:0,u==a.childCount?h:-1)))}let p=u==a.childCount;p||(h=-1),this.placed=ka(this.placed,n,M.from(c)),this.frontier[n].match=d,p&&h<0&&o&&o.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let m=0,g=c[c.length-1];g&&m<h;m++)this.frontier.push({type:g.type,match:g.contentMatchAt(g.childCount)}),g=g.lastChild;this.unplaced=p?t==0?F.empty:new F(xa(s.content,t-1,1),t-1,h<0?s.openEnd:t-1):new F(xa(s.content,t,u),t,s.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let t=this.frontier[this.depth],n;if(!t.type.isTextblock||!Bg(this.$to,this.$to.depth,t.type,t.match,!1)||this.$to.depth==this.depth&&(n=this.findCloseLevel(this.$to))&&n.depth==this.depth)return-1;let{depth:o}=this.$to,r=this.$to.after(o);for(;o>1&&r==this.$to.end(--o);)++r;return r}findCloseLevel(t){e:for(let n=Math.min(this.depth,t.depth);n>=0;n--){let{match:o,type:r}=this.frontier[n],i=n<t.depth&&t.end(n+1)==t.pos+(t.depth-(n+1)),s=Bg(t,n,r,o,i);if(s){for(let a=n-1;a>=0;a--){let{match:l,type:u}=this.frontier[a],c=Bg(t,a,u,l,!0);if(!c||c.childCount)continue e}return{depth:n,fit:s,move:i?t.doc.resolve(t.after(n+1)):t}}}}close(t){let n=this.findCloseLevel(t);if(!n)return null;for(;this.depth>n.depth;)this.closeFrontierNode();n.fit.childCount&&(this.placed=ka(this.placed,n.depth,n.fit)),t=n.move;for(let o=n.depth+1;o<=t.depth;o++){let r=t.node(o),i=r.type.contentMatch.fillBefore(r.content,!0,t.index(o));this.openFrontierNode(r.type,r.attrs,i)}return t}openFrontierNode(t,n=null,o){let r=this.frontier[this.depth];r.match=r.match.matchType(t),this.placed=ka(this.placed,this.depth,M.from(t.create(n,o))),this.frontier.push({type:t,match:t.contentMatch})}closeFrontierNode(){let n=this.frontier.pop().match.fillBefore(M.empty,!0);n.childCount&&(this.placed=ka(this.placed,this.frontier.length,n))}};function xa(e,t,n){return t==0?e.cutByIndex(n,e.childCount):e.replaceChild(0,e.firstChild.copy(xa(e.firstChild.content,t-1,n)))}function ka(e,t,n){return t==0?e.append(n):e.replaceChild(e.childCount-1,e.lastChild.copy(ka(e.lastChild.content,t-1,n)))}function Z_(e,t){for(let n=0;n<t;n++)e=e.firstChild.content;return e}function nE(e,t,n){if(t<=0)return e;let o=e.content;return t>1&&(o=o.replaceChild(0,nE(o.firstChild,t-1,o.childCount==1?n-1:0))),t>0&&(o=e.type.contentMatch.fillBefore(o).append(o),n<=0&&(o=o.append(e.type.contentMatch.matchFragment(o).fillBefore(M.empty,!0)))),e.copy(o)}function Bg(e,t,n,o,r){let i=e.node(t),s=r?e.indexAfter(t):e.index(t);if(s==i.childCount&&!n.compatibleContent(i.type))return null;let a=o.fillBefore(i.content,!0,s);return a&&!Oz(n,i.content,s)?a:null}function Oz(e,t,n){for(let o=n;o<t.childCount;o++)if(!e.allowsMarks(t.child(o).marks))return!0;return!1}function Rz(e){return e.spec.defining||e.spec.definingForContent}function V_(e,t){for(let n=0;;n++){let o=t<0?e.firstChild:e.lastChild;if(!o||o.isAtom)return n;e=o.content}}function Pz(e,t,n,o){if(!o.size)return e.deleteRange(t,n);let r=e.doc.resolve(t),i=e.doc.resolve(n);if(tE(r,i,o))return e.step(new rt(t,n,o));let s=oE(r,i);s[s.length-1]==0&&s.pop();let a=-(r.depth+1);s.unshift(a);for(let f=r.depth,h=r.pos-1;f>0;f--,h--){let p=r.node(f).type.spec;if(p.defining||p.definingAsContext||p.isolating)break;s.indexOf(f)>-1?a=f:r.before(f)==h&&s.splice(1,0,-f)}let l=s.indexOf(a),u=[],c=o.openStart;for(let f=o.content,h=0;;h++){let p=f.firstChild;if(u.push(p),h==o.openStart)break;f=p.content}for(let f=c-1;f>=0;f--){let h=u[f],p=Rz(h.type);if(p&&!h.sameMarkup(r.node(Math.abs(a)-1)))c=f;else if(p||!h.type.isTextblock)break}for(let f=o.openStart;f>=0;f--){let h=(f+c+1)%(o.openStart+1),p=u[h];if(p)for(let m=0;m<s.length;m++){let g=s[(m+l)%s.length],b=!0;g<0&&(b=!1,g=-g);let y=r.node(g-1),k=r.index(g-1);if(y.canReplaceWith(k,k,p.type,p.marks))return e.replace(r.before(g),b?i.after(g):n,new F(rE(o.content,0,o.openStart,h),h,o.openEnd))}}let d=e.steps.length;for(let f=s.length-1;f>=0&&(e.replace(t,n,o),!(e.steps.length>d));f--){let h=s[f];h<0||(t=r.before(h),n=i.after(h))}}function rE(e,t,n,o,r){if(t<n){let i=e.firstChild;e=e.replaceChild(0,i.copy(rE(i.content,t+1,n,o,i)))}if(t>o){let i=r.contentMatchAt(0),s=i.fillBefore(e).append(e);e=s.append(i.matchFragment(s).fillBefore(M.empty,!0))}return e}function Lz(e,t,n,o){if(!o.isInline&&t==n&&e.doc.resolve(t).parent.content.size){let r=zz(e.doc,t,o.type);r!=null&&(t=n=r)}e.replaceRange(t,n,new F(M.from(o),0,0))}function Fz(e,t,n){let o=e.doc.resolve(t),r=e.doc.resolve(n);if(o.parent.isTextblock&&r.parent.isTextblock&&o.start()!=r.start()&&o.parentOffset==0&&r.parentOffset==0){let s=o.sharedDepth(n),a=!1;for(let l=o.depth;l>s;l--)o.node(l).type.spec.isolating&&(a=!0);for(let l=r.depth;l>s;l--)r.node(l).type.spec.isolating&&(a=!0);if(!a){for(let l=o.depth;l>0&&t==o.start(l);l--)t=o.before(l);for(let l=r.depth;l>0&&n==r.start(l);l--)n=r.before(l);o=e.doc.resolve(t),r=e.doc.resolve(n)}}let i=oE(o,r);for(let s=0;s<i.length;s++){let a=i[s],l=s==i.length-1;if(l&&a==0||o.node(a).type.contentMatch.validEnd)return e.delete(o.start(a),r.end(a));if(a>0&&(l||o.node(a-1).canReplace(o.index(a-1),r.indexAfter(a-1))))return e.delete(o.before(a),r.after(a))}for(let s=1;s<=o.depth&&s<=r.depth;s++)if(t-o.start(s)==o.depth-s&&n>o.end(s)&&r.end(s)-n!=r.depth-s&&o.start(s-1)==r.start(s-1)&&o.node(s-1).canReplace(o.index(s-1),r.index(s-1)))return e.delete(o.before(s),n);e.delete(t,n)}function oE(e,t){let n=[],o=Math.min(e.depth,t.depth);for(let r=o;r>=0;r--){let i=e.start(r);if(i<e.pos-(e.depth-r)||t.end(r)>t.pos+(t.depth-r)||e.node(r).type.spec.isolating||t.node(r).type.spec.isolating)break;(i==t.start(r)||r==e.depth&&r==t.depth&&e.parent.inlineContent&&t.parent.inlineContent&&r&&t.start(r-1)==i-1)&&n.push(r)}return n}var Wc=class e extends et{constructor(t,n,o){super(),this.pos=t,this.attr=n,this.value=o}apply(t){let n=t.nodeAt(this.pos);if(!n)return pt.fail("No node at attribute step's position");let o=Object.create(null);for(let i in n.attrs)o[i]=n.attrs[i];o[this.attr]=this.value;let r=n.type.create(o,null,n.marks);return pt.fromReplace(t,this.pos,this.pos+1,new F(M.from(r),0,n.isLeaf?0:1))}getMap(){return Kn.empty}invert(t){return new e(this.pos,this.attr,t.nodeAt(this.pos).attrs[this.attr])}map(t){let n=t.mapResult(this.pos,1);return n.deletedAfter?null:new e(n.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.pos!="number"||typeof n.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new e(n.pos,n.attr,n.value)}};et.jsonID("attr",Wc);var Kc=class e extends et{constructor(t,n){super(),this.attr=t,this.value=n}apply(t){let n=Object.create(null);for(let r in t.attrs)n[r]=t.attrs[r];n[this.attr]=this.value;let o=t.type.create(n,t.content,t.marks);return pt.ok(o)}getMap(){return Kn.empty}invert(t){return new e(this.attr,t.attrs[this.attr])}map(t){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(t,n){if(typeof n.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new e(n.attr,n.value)}};et.jsonID("docAttr",Kc);var Ti=class extends Error{};Ti=function e(t){let n=Error.call(this,t);return n.__proto__=e.prototype,n};Ti.prototype=Object.create(Error.prototype);Ti.prototype.constructor=Ti;Ti.prototype.name="TransformError";var Jn=class{constructor(t){this.doc=t,this.steps=[],this.docs=[],this.mapping=new Sa}get before(){return this.docs.length?this.docs[0]:this.doc}step(t){let n=this.maybeStep(t);if(n.failed)throw new Ti(n.failed);return this}maybeStep(t){let n=t.apply(this.doc);return n.failed||this.addStep(t,n.doc),n}get docChanged(){return this.steps.length>0}changedRange(){let t=1e9,n=-1e9;for(let o=0;o<this.mapping.maps.length;o++){let r=this.mapping.maps[o];o&&(t=r.map(t,1),n=r.map(n,-1)),r.forEach((i,s,a,l)=>{t=Math.min(t,a),n=Math.max(n,l)})}return t==1e9?null:{from:t,to:n}}addStep(t,n){this.docs.push(this.doc),this.steps.push(t),this.mapping.appendMap(t.getMap()),this.doc=n}replace(t,n=t,o=F.empty){let r=Ca(this.doc,t,n,o);return r&&this.step(r),this}replaceWith(t,n,o){return this.replace(t,n,new F(M.from(o),0,0))}delete(t,n){return this.replace(t,n,F.empty)}insert(t,n){return this.replaceWith(t,t,n)}replaceRange(t,n,o){return Pz(this,t,n,o),this}replaceRangeWith(t,n,o){return Lz(this,t,n,o),this}deleteRange(t,n){return Fz(this,t,n),this}lift(t,n){return _z(this,t,n),this}join(t,n=1){return Nz(this,t,n),this}wrap(t,n){return Tz(this,t,n),this}setBlockType(t,n=t,o,r=null){return Az(this,t,n,o,r),this}setNodeMarkup(t,n,o=null,r){return $z(this,t,n,o,r),this}setNodeAttribute(t,n,o){return this.step(new Wc(t,n,o)),this}setDocAttribute(t,n){return this.step(new Kc(t,n)),this}addNodeMark(t,n){return this.step(new Ea(t,n)),this}removeNodeMark(t,n){let o=this.doc.nodeAt(t);if(!o)throw new RangeError("No node at position "+t);if(n instanceof be)n.isInSet(o.marks)&&this.step(new Ci(t,n));else{let r=o.marks,i,s=[];for(;i=n.isInSet(r);)s.push(new Ci(t,i)),r=i.removeFromSet(r);for(let a=s.length-1;a>=0;a--)this.step(s[a])}return this}split(t,n=1,o){return Iz(this,t,n,o),this}addMark(t,n,o){return kz(this,t,n,o),this}removeMark(t,n,o){return wz(this,t,n,o),this}clearIncompatible(t,n,o){return Zg(this,t,n,o),this}};var Vg=Object.create(null),Q=class{constructor(t,n,o){this.$anchor=t,this.$head=n,this.ranges=o||[new Ii(t.min(n),t.max(n))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let t=this.ranges;for(let n=0;n<t.length;n++)if(t[n].$from.pos!=t[n].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(t,n=F.empty){let o=n.content.lastChild,r=null;for(let a=0;a<n.openEnd;a++)r=o,o=o.lastChild;let i=t.steps.length,s=this.ranges;for(let a=0;a<s.length;a++){let{$from:l,$to:u}=s[a],c=t.mapping.slice(i);t.replaceRange(c.map(l.pos),c.map(u.pos),a?F.empty:n),a==0&&aE(t,i,(o?o.isInline:r&&r.isTextblock)?-1:1)}}replaceWith(t,n){let o=t.steps.length,r=this.ranges;for(let i=0;i<r.length;i++){let{$from:s,$to:a}=r[i],l=t.mapping.slice(o),u=l.map(s.pos),c=l.map(a.pos);i?t.deleteRange(u,c):(t.replaceRangeWith(u,c,n),aE(t,o,n.isInline?-1:1))}}static findFrom(t,n,o=!1){let r=t.parent.inlineContent?new Z(t):$i(t.node(0),t.parent,t.pos,t.index(),n,o);if(r)return r;for(let i=t.depth-1;i>=0;i--){let s=n<0?$i(t.node(0),t.node(i),t.before(i+1),t.index(i),n,o):$i(t.node(0),t.node(i),t.after(i+1),t.index(i)+1,n,o);if(s)return s}return null}static near(t,n=1){return this.findFrom(t,n)||this.findFrom(t,-n)||new Rt(t.node(0))}static atStart(t){return $i(t,t,0,0,1)||new Rt(t)}static atEnd(t){return $i(t,t,t.content.size,t.childCount,-1)||new Rt(t)}static fromJSON(t,n){if(!n||!n.type)throw new RangeError("Invalid input for Selection.fromJSON");let o=Vg[n.type];if(!o)throw new RangeError(`No selection type ${n.type} defined`);return o.fromJSON(t,n)}static jsonID(t,n){if(t in Vg)throw new RangeError("Duplicate use of selection JSON ID "+t);return Vg[t]=n,n.prototype.jsonID=t,n}getBookmark(){return Z.between(this.$anchor,this.$head).getBookmark()}};Q.prototype.visible=!0;var Ii=class{constructor(t,n){this.$from=t,this.$to=n}},iE=!1;function sE(e){!iE&&!e.parent.inlineContent&&(iE=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+e.parent.type.name+")"))}var Z=class e extends Q{constructor(t,n=t){sE(t),sE(n),super(t,n)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(t,n){let o=t.resolve(n.map(this.head));if(!o.parent.inlineContent)return Q.near(o);let r=t.resolve(n.map(this.anchor));return new e(r.parent.inlineContent?r:o,o)}replace(t,n=F.empty){if(super.replace(t,n),n==F.empty){let o=this.$from.marksAcross(this.$to);o&&t.ensureMarks(o)}}eq(t){return t instanceof e&&t.anchor==this.anchor&&t.head==this.head}getBookmark(){return new Qc(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(t,n){if(typeof n.anchor!="number"||typeof n.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new e(t.resolve(n.anchor),t.resolve(n.head))}static create(t,n,o=n){let r=t.resolve(n);return new this(r,o==n?r:t.resolve(o))}static between(t,n,o){let r=t.pos-n.pos;if((!o||r)&&(o=r>=0?1:-1),!n.parent.inlineContent){let i=Q.findFrom(n,o,!0)||Q.findFrom(n,-o,!0);if(i)n=i.$head;else return Q.near(n,o)}return t.parent.inlineContent||(r==0?t=n:(t=(Q.findFrom(t,-o,!0)||Q.findFrom(t,o,!0)).$anchor,t.pos<n.pos!=r<0&&(t=n))),new e(t,n)}};Q.jsonID("text",Z);var Qc=class e{constructor(t,n){this.anchor=t,this.head=n}map(t){return new e(t.map(this.anchor),t.map(this.head))}resolve(t){return Z.between(t.resolve(this.anchor),t.resolve(this.head))}},X=class e extends Q{constructor(t){let n=t.nodeAfter,o=t.node(0).resolve(t.pos+n.nodeSize);super(t,o),this.node=n}map(t,n){let{deleted:o,pos:r}=n.mapResult(this.anchor),i=t.resolve(r);return o?Q.near(i):new e(i)}content(){return new F(M.from(this.node),0,0)}eq(t){return t instanceof e&&t.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new Kg(this.anchor)}static fromJSON(t,n){if(typeof n.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new e(t.resolve(n.anchor))}static create(t,n){return new e(t.resolve(n))}static isSelectable(t){return!t.isText&&t.type.spec.selectable!==!1}};X.prototype.visible=!1;Q.jsonID("node",X);var Kg=class e{constructor(t){this.anchor=t}map(t){let{deleted:n,pos:o}=t.mapResult(this.anchor);return n?new Qc(o,o):new e(o)}resolve(t){let n=t.resolve(this.anchor),o=n.nodeAfter;return o&&X.isSelectable(o)?new X(n):Q.near(n)}},Rt=class e extends Q{constructor(t){super(t.resolve(0),t.resolve(t.content.size))}replace(t,n=F.empty){if(n==F.empty){t.delete(0,t.doc.content.size);let o=Q.atStart(t.doc);o.eq(t.selection)||t.setSelection(o)}else super.replace(t,n)}toJSON(){return{type:"all"}}static fromJSON(t){return new e(t)}map(t){return new e(t)}eq(t){return t instanceof e}getBookmark(){return jz}};Q.jsonID("all",Rt);var jz={map(){return this},resolve(e){return new Rt(e)}};function $i(e,t,n,o,r,i=!1){if(t.inlineContent)return Z.create(e,n);for(let s=o-(r>0?0:1);r>0?s<t.childCount:s>=0;s+=r){let a=t.child(s);if(a.isAtom){if(!i&&X.isSelectable(a))return X.create(e,n-(r<0?a.nodeSize:0))}else{let l=$i(e,a,n+r,r<0?a.childCount:0,r,i);if(l)return l}n+=a.nodeSize*r}return null}function aE(e,t,n){let o=e.steps.length-1;if(o<t)return;let r=e.steps[o];if(!(r instanceof rt||r instanceof ot))return;let i=e.mapping.maps[o],s;i.forEach((a,l,u,c)=>{s==null&&(s=c)}),e.setSelection(Q.near(e.doc.resolve(s),n))}var lE=1,Gc=2,uE=4,Jg=class extends Jn{constructor(t){super(t.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=t.selection,this.storedMarks=t.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(t){if(t.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=t,this.curSelectionFor=this.steps.length,this.updated=(this.updated|lE)&~Gc,this.storedMarks=null,this}get selectionSet(){return(this.updated&lE)>0}setStoredMarks(t){return this.storedMarks=t,this.updated|=Gc,this}ensureMarks(t){return be.sameSet(this.storedMarks||this.selection.$from.marks(),t)||this.setStoredMarks(t),this}addStoredMark(t){return this.ensureMarks(t.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(t){return this.ensureMarks(t.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&Gc)>0}addStep(t,n){super.addStep(t,n),this.updated=this.updated&~Gc,this.storedMarks=null}setTime(t){return this.time=t,this}replaceSelection(t){return this.selection.replace(this,t),this}replaceSelectionWith(t,n=!0){let o=this.selection;return n&&(t=t.mark(this.storedMarks||(o.empty?o.$from.marks():o.$from.marksAcross(o.$to)||be.none))),o.replaceWith(this,t),this}deleteSelection(){return this.selection.replace(this),this}insertText(t,n,o){let r=this.doc.type.schema;if(n==null)return t?this.replaceSelectionWith(r.text(t),!0):this.deleteSelection();{if(o==null&&(o=n),!t)return this.deleteRange(n,o);let i=this.storedMarks;if(!i){let s=this.doc.resolve(n);i=o==n?s.marks():s.marksAcross(this.doc.resolve(o))}return this.replaceRangeWith(n,o,r.text(t,i)),!this.selection.empty&&this.selection.to==n+t.length&&this.setSelection(Q.near(this.selection.$to)),this}}setMeta(t,n){return this.meta[typeof t=="string"?t:t.key]=n,this}getMeta(t){return this.meta[typeof t=="string"?t:t.key]}get isGeneric(){for(let t in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=uE,this}get scrolledIntoView(){return(this.updated&uE)>0}};function cE(e,t){return!t||!e?e:e.bind(t)}var so=class{constructor(t,n,o){this.name=t,this.init=cE(n.init,o),this.apply=cE(n.apply,o)}},Bz=[new so("doc",{init(e){return e.doc||e.schema.topNodeType.createAndFill()},apply(e){return e.doc}}),new so("selection",{init(e,t){return e.selection||Q.atStart(t.doc)},apply(e){return e.selection}}),new so("storedMarks",{init(e){return e.storedMarks||null},apply(e,t,n,o){return o.selection.$cursor?e.storedMarks:null}}),new so("scrollToSelection",{init(){return 0},apply(e,t){return e.scrolledIntoView?t+1:t}})],Ta=class{constructor(t,n){this.schema=t,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=Bz.slice(),n&&n.forEach(o=>{if(this.pluginsByKey[o.key])throw new RangeError("Adding different instances of a keyed plugin ("+o.key+")");this.plugins.push(o),this.pluginsByKey[o.key]=o,o.spec.state&&this.fields.push(new so(o.key,o.spec.state,o))})}},ao=class e{constructor(t){this.config=t}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(t){return this.applyTransaction(t).state}filterTransaction(t,n=-1){for(let o=0;o<this.config.plugins.length;o++)if(o!=n){let r=this.config.plugins[o];if(r.spec.filterTransaction&&!r.spec.filterTransaction.call(r,t,this))return!1}return!0}applyTransaction(t){if(!this.filterTransaction(t))return{state:this,transactions:[]};let n=[t],o=this.applyInner(t),r=null;for(;;){let i=!1;for(let s=0;s<this.config.plugins.length;s++){let a=this.config.plugins[s];if(a.spec.appendTransaction){let l=r?r[s].n:0,u=r?r[s].state:this,c=l<n.length&&a.spec.appendTransaction.call(a,l?n.slice(l):n,u,o);if(c&&o.filterTransaction(c,s)){if(c.setMeta("appendedTransaction",t),!r){r=[];for(let d=0;d<this.config.plugins.length;d++)r.push(d<s?{state:o,n:n.length}:{state:this,n:0})}n.push(c),o=o.applyInner(c),i=!0}r&&(r[s]={state:o,n:n.length})}}if(!i)return{state:o,transactions:n}}}applyInner(t){if(!t.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let n=new e(this.config),o=this.config.fields;for(let r=0;r<o.length;r++){let i=o[r];n[i.name]=i.apply(t,this[i.name],this,n)}return n}get tr(){return new Jg(this)}static create(t){let n=new Ta(t.doc?t.doc.type.schema:t.schema,t.plugins),o=new e(n);for(let r=0;r<n.fields.length;r++)o[n.fields[r].name]=n.fields[r].init(t,o);return o}reconfigure(t){let n=new Ta(this.schema,t.plugins),o=n.fields,r=new e(n);for(let i=0;i<o.length;i++){let s=o[i].name;r[s]=this.hasOwnProperty(s)?this[s]:o[i].init(t,r)}return r}toJSON(t){let n={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(n.storedMarks=this.storedMarks.map(o=>o.toJSON())),t&&typeof t=="object")for(let o in t){if(o=="doc"||o=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let r=t[o],i=r.spec.state;i&&i.toJSON&&(n[o]=i.toJSON.call(r,this[r.key]))}return n}static fromJSON(t,n,o){if(!n)throw new RangeError("Invalid input for EditorState.fromJSON");if(!t.schema)throw new RangeError("Required config field 'schema' missing");let r=new Ta(t.schema,t.plugins),i=new e(r);return r.fields.forEach(s=>{if(s.name=="doc")i.doc=hn.fromJSON(t.schema,n.doc);else if(s.name=="selection")i.selection=Q.fromJSON(i.doc,n.selection);else if(s.name=="storedMarks")n.storedMarks&&(i.storedMarks=n.storedMarks.map(t.schema.markFromJSON));else{if(o)for(let a in o){let l=o[a],u=l.spec.state;if(l.key==s.name&&u&&u.fromJSON&&Object.prototype.hasOwnProperty.call(n,a)){i[s.name]=u.fromJSON.call(l,t,n[a],i);return}}i[s.name]=s.init(t,i)}}),i}};function dE(e,t,n){for(let o in e){let r=e[o];r instanceof Function?r=r.bind(t):o=="handleDOMEvents"&&(r=dE(r,t,{})),n[o]=r}return n}var de=class{constructor(t){this.spec=t,this.props={},t.props&&dE(t.props,this,this.props),this.key=t.key?t.key.key:fE("plugin")}getState(t){return t[this.key]}},Wg=Object.create(null);function fE(e){return e in Wg?e+"$"+ ++Wg[e]:(Wg[e]=0,e+"$")}var ke=class{constructor(t="key"){this.key=fE(t)}get(t){return t.config.pluginsByKey[this.key]}getState(t){return t[this.key]}};var hE=(e,t)=>e.selection.empty?!1:(t&&t(e.tr.deleteSelection().scrollIntoView()),!0);function mE(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("backward",e):n.parentOffset>0)?null:n}var Qg=(e,t,n)=>{let o=mE(e,n);if(!o)return!1;let r=Yg(o);if(!r){let s=o.blockRange(),a=s&&Gn(s);return a==null?!1:(t&&t(e.tr.lift(s,a).scrollIntoView()),!0)}let i=r.nodeBefore;if(wE(e,r,t,-1))return!0;if(o.parent.content.size==0&&(Di(i,"end")||X.isSelectable(i)))for(let s=o.depth;;s--){let a=Ca(e.doc,o.before(s),o.after(s),F.empty);if(a&&a.slice.size<a.to-a.from){if(t){let l=e.tr.step(a);l.setSelection(Di(i,"end")?Q.findFrom(l.doc.resolve(l.mapping.map(r.pos,-1)),-1):X.create(l.doc,r.pos-i.nodeSize)),t(l.scrollIntoView())}return!0}if(s==1||o.node(s-1).childCount>1)break}return i.isAtom&&r.depth==o.depth-1?(t&&t(e.tr.delete(r.pos-i.nodeSize,r.pos).scrollIntoView()),!0):!1},Xc=(e,t,n)=>{let o=mE(e,n);if(!o)return!1;let r=Yg(o);return r?gE(e,r,t):!1},Yc=(e,t,n)=>{let o=bE(e,n);if(!o)return!1;let r=nb(o);return r?gE(e,r,t):!1};function gE(e,t,n){let o=t.nodeBefore,r=o,i=t.pos-1;for(;!r.isTextblock;i--){if(r.type.spec.isolating)return!1;let c=r.lastChild;if(!c)return!1;r=c}let s=t.nodeAfter,a=s,l=t.pos+1;for(;!a.isTextblock;l++){if(a.type.spec.isolating)return!1;let c=a.firstChild;if(!c)return!1;a=c}let u=Ca(e.doc,i,l,F.empty);if(!u||u.from!=i||u instanceof rt&&u.slice.size>=l-i)return!1;if(n){let c=e.tr.step(u);c.setSelection(Z.create(c.doc,i)),n(c.scrollIntoView())}return!0}function Di(e,t,n=!1){for(let o=e;o;o=t=="start"?o.firstChild:o.lastChild){if(o.isTextblock)return!0;if(n&&o.childCount!=1)return!1}return!1}var Xg=(e,t,n)=>{let{$head:o,empty:r}=e.selection,i=o;if(!r)return!1;if(o.parent.isTextblock){if(n?!n.endOfTextblock("backward",e):o.parentOffset>0)return!1;i=Yg(o)}let s=i&&i.nodeBefore;return!s||!X.isSelectable(s)?!1:(t&&t(e.tr.setSelection(X.create(e.doc,i.pos-s.nodeSize)).scrollIntoView()),!0)};function Yg(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){if(e.index(t)>0)return e.doc.resolve(e.before(t+1));if(e.node(t).type.spec.isolating)break}return null}function bE(e,t){let{$cursor:n}=e.selection;return!n||(t?!t.endOfTextblock("forward",e):n.parentOffset<n.parent.content.size)?null:n}var eb=(e,t,n)=>{let o=bE(e,n);if(!o)return!1;let r=nb(o);if(!r)return!1;let i=r.nodeAfter;if(wE(e,r,t,1))return!0;if(o.parent.content.size==0&&(Di(i,"start")||X.isSelectable(i))){let s=Ca(e.doc,o.before(),o.after(),F.empty);if(s&&s.slice.size<s.to-s.from){if(t){let a=e.tr.step(s);a.setSelection(Di(i,"start")?Q.findFrom(a.doc.resolve(a.mapping.map(r.pos)),1):X.create(a.doc,a.mapping.map(r.pos))),t(a.scrollIntoView())}return!0}}return i.isAtom&&r.depth==o.depth-1?(t&&t(e.tr.delete(r.pos,r.pos+i.nodeSize).scrollIntoView()),!0):!1},tb=(e,t,n)=>{let{$head:o,empty:r}=e.selection,i=o;if(!r)return!1;if(o.parent.isTextblock){if(n?!n.endOfTextblock("forward",e):o.parentOffset<o.parent.content.size)return!1;i=nb(o)}let s=i&&i.nodeAfter;return!s||!X.isSelectable(s)?!1:(t&&t(e.tr.setSelection(X.create(e.doc,i.pos)).scrollIntoView()),!0)};function nb(e){if(!e.parent.type.spec.isolating)for(let t=e.depth-1;t>=0;t--){let n=e.node(t);if(e.index(t)+1<n.childCount)return e.doc.resolve(e.after(t+1));if(n.type.spec.isolating)break}return null}var yE=(e,t)=>{let n=e.selection,o=n instanceof X,r;if(o){if(n.node.isTextblock||!gn(e.doc,n.from))return!1;r=n.from}else if(r=Mi(e.doc,n.from,-1),r==null)return!1;if(t){let i=e.tr.join(r);o&&i.setSelection(X.create(i.doc,r-e.doc.resolve(r).nodeBefore.nodeSize)),t(i.scrollIntoView())}return!0},vE=(e,t)=>{let n=e.selection,o;if(n instanceof X){if(n.node.isTextblock||!gn(e.doc,n.to))return!1;o=n.to}else if(o=Mi(e.doc,n.to,1),o==null)return!1;return t&&t(e.tr.join(o).scrollIntoView()),!0},xE=(e,t)=>{let{$from:n,$to:o}=e.selection,r=n.blockRange(o),i=r&&Gn(r);return i==null?!1:(t&&t(e.tr.lift(r,i).scrollIntoView()),!0)},rb=(e,t)=>{let{$head:n,$anchor:o}=e.selection;return!n.parent.type.spec.code||!n.sameParent(o)?!1:(t&&t(e.tr.insertText(`
`).scrollIntoView()),!0)};function ob(e){for(let t=0;t<e.edgeCount;t++){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}var ib=(e,t)=>{let{$head:n,$anchor:o}=e.selection;if(!n.parent.type.spec.code||!n.sameParent(o))return!1;let r=n.node(-1),i=n.indexAfter(-1),s=ob(r.contentMatchAt(i));if(!s||!r.canReplaceWith(i,i,s))return!1;if(t){let a=n.after(),l=e.tr.replaceWith(a,a,s.createAndFill());l.setSelection(Q.near(l.doc.resolve(a),1)),t(l.scrollIntoView())}return!0},sb=(e,t)=>{let n=e.selection,{$from:o,$to:r}=n;if(n instanceof Rt||o.parent.inlineContent||r.parent.inlineContent)return!1;let i=ob(r.parent.contentMatchAt(r.indexAfter()));if(!i||!i.isTextblock)return!1;if(t){let s=(!o.parentOffset&&r.index()<r.parent.childCount?o:r).pos,a=e.tr.insert(s,i.createAndFill());a.setSelection(Z.create(a.doc,s+1)),t(a.scrollIntoView())}return!0},ab=(e,t)=>{let{$cursor:n}=e.selection;if(!n||n.parent.content.size)return!1;if(n.depth>1&&n.after()!=n.end(-1)){let i=n.before();if(on(e.doc,i))return t&&t(e.tr.split(i).scrollIntoView()),!0}let o=n.blockRange(),r=o&&Gn(o);return r==null?!1:(t&&t(e.tr.lift(o,r).scrollIntoView()),!0)};function Uz(e){return(t,n)=>{if(t.selection instanceof X&&t.selection.node.isBlock){let{$from:h}=t.selection;return!h.parentOffset||!on(t.doc,h.pos)?!1:(n&&n(t.tr.split(h.pos).scrollIntoView()),!0)}if(!t.selection.$from.depth)return!1;let o=t.tr;!t.selection.empty&&(t.selection instanceof Z||t.selection instanceof Rt)&&o.deleteSelection();let{$from:r}=o.selection,i=o.steps.length,s=[],a,l,u=!1,c=!1;for(let h=r.depth;;h--)if(r.node(h).isBlock){u=r.end(h)==r.pos+(r.depth-h),c=r.start(h)==r.pos-(r.depth-h),l=ob(r.node(h-1).contentMatchAt(r.indexAfter(h-1)));let m=e&&e(r.parent,u,r);s.unshift(m||(u&&l?{type:l}:null)),a=h;break}else{if(h==1)return!1;s.unshift(null)}let d=r.pos,f=on(o.doc,d,s.length,s);if(f||(s[0]=l?{type:l}:null,f=on(o.doc,d,s.length,s)),!f)return!1;if(o.split(d,s.length,s),!u&&c&&r.node(a).type!=l){let h=o.mapping.slice(i),p=h.map(r.before(a)),m=o.doc.resolve(p);l&&r.node(a-1).canReplaceWith(m.index(),m.index()+1,l)&&o.setNodeMarkup(h.map(r.before(a)),l)}return n&&n(o.scrollIntoView()),!0}}var Hz=Uz();var kE=(e,t)=>{let{$from:n,to:o}=e.selection,r,i=n.sharedDepth(o);return i==0?!1:(r=n.before(i),t&&t(e.tr.setSelection(X.create(e.doc,r))),!0)},qz=(e,t)=>(t&&t(e.tr.setSelection(new Rt(e.doc))),!0);function Zz(e,t,n){let o=t.nodeBefore,r=t.nodeAfter,i=t.index();return!o||!r||!o.type.compatibleContent(r.type)?!1:!o.content.size&&t.parent.canReplace(i-1,i)?(n&&n(e.tr.delete(t.pos-o.nodeSize,t.pos).scrollIntoView()),!0):!t.parent.canReplace(i,i+1)||!(r.isTextblock||gn(e.doc,t.pos))?!1:(n&&n(e.tr.join(t.pos).scrollIntoView()),!0)}function wE(e,t,n,o){let r=t.nodeBefore,i=t.nodeAfter,s,a,l=r.type.spec.isolating||i.type.spec.isolating;if(!l&&Zz(e,t,n))return!0;let u=!l&&t.parent.canReplace(t.index(),t.index()+1);if(u&&(s=(a=r.contentMatchAt(r.childCount)).findWrapping(i.type))&&a.matchType(s[0]||i.type).validEnd){if(n){let h=t.pos+i.nodeSize,p=M.empty;for(let b=s.length-1;b>=0;b--)p=M.from(s[b].create(null,p));p=M.from(r.copy(p));let m=e.tr.step(new ot(t.pos-1,h,t.pos,h,new F(p,1,0),s.length,!0)),g=m.doc.resolve(h+2*s.length);g.nodeAfter&&g.nodeAfter.type==r.type&&gn(m.doc,g.pos)&&m.join(g.pos),n(m.scrollIntoView())}return!0}let c=i.type.spec.isolating||o>0&&l?null:Q.findFrom(t,1),d=c&&c.$from.blockRange(c.$to),f=d&&Gn(d);if(f!=null&&f>=t.depth)return n&&n(e.tr.lift(d,f).scrollIntoView()),!0;if(u&&Di(i,"start",!0)&&Di(r,"end")){let h=r,p=[];for(;p.push(h),!h.isTextblock;)h=h.lastChild;let m=i,g=1;for(;!m.isTextblock;m=m.firstChild)g++;if(h.canReplace(h.childCount,h.childCount,m.content)){if(n){let b=M.empty;for(let k=p.length-1;k>=0;k--)b=M.from(p[k].copy(b));let y=e.tr.step(new ot(t.pos-p.length,t.pos+i.nodeSize,t.pos+g,t.pos+i.nodeSize-g,new F(b,p.length,0),0,!0));n(y.scrollIntoView())}return!0}}return!1}function SE(e){return function(t,n){let o=t.selection,r=e<0?o.$from:o.$to,i=r.depth;for(;r.node(i).isInline;){if(!i)return!1;i--}return r.node(i).isTextblock?(n&&n(t.tr.setSelection(Z.create(t.doc,e<0?r.start(i):r.end(i)))),!0):!1}}var lb=SE(-1),ub=SE(1);function _E(e,t=null){return function(n,o){let{$from:r,$to:i}=n.selection,s=r.blockRange(i),a=s&&Ai(s,e,t);return a?(o&&o(n.tr.wrap(s,a).scrollIntoView()),!0):!1}}function cb(e,t=null){return function(n,o){let r=!1;for(let i=0;i<n.selection.ranges.length&&!r;i++){let{$from:{pos:s},$to:{pos:a}}=n.selection.ranges[i];n.doc.nodesBetween(s,a,(l,u)=>{if(r)return!1;if(!(!l.isTextblock||l.hasMarkup(e,t)))if(l.type==e)r=!0;else{let c=n.doc.resolve(u),d=c.index();r=c.parent.canReplaceWith(d,d+1,e)}})}if(!r)return!1;if(o){let i=n.tr;for(let s=0;s<n.selection.ranges.length;s++){let{$from:{pos:a},$to:{pos:l}}=n.selection.ranges[s];i.setBlockType(a,l,e,t)}o(i.scrollIntoView())}return!0}}function db(...e){return function(t,n,o){for(let r=0;r<e.length;r++)if(e[r](t,n,o))return!0;return!1}}var Gg=db(hE,Qg,Xg),pE=db(hE,eb,tb),Sr={Enter:db(rb,sb,ab,Hz),"Mod-Enter":ib,Backspace:Gg,"Mod-Backspace":Gg,"Shift-Backspace":Gg,Delete:pE,"Mod-Delete":pE,"Mod-a":qz},Vz={"Ctrl-h":Sr.Backspace,"Alt-Backspace":Sr["Mod-Backspace"],"Ctrl-d":Sr.Delete,"Ctrl-Alt-Backspace":Sr["Mod-Delete"],"Alt-Delete":Sr["Mod-Delete"],"Alt-d":Sr["Mod-Delete"],"Ctrl-a":lb,"Ctrl-e":ub};for(let e in Sr)Vz[e]=Sr[e];var fG=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform?os.platform()=="darwin":!1;function EE(e,t=null){return function(n,o){let{$from:r,$to:i}=n.selection,s=r.blockRange(i);if(!s)return!1;let a=o?n.tr:null;return Wz(a,s,e,t)?(o&&o(a.scrollIntoView()),!0):!1}}function Wz(e,t,n,o=null){let r=!1,i=t,s=t.$from.doc;if(t.depth>=2&&t.$from.node(t.depth-1).type.compatibleContent(n)&&t.startIndex==0){if(t.$from.index(t.depth-1)==0)return!1;let l=s.resolve(t.start-2);i=new ro(l,l,t.depth),t.endIndex<t.parent.childCount&&(t=new ro(t.$from,s.resolve(t.$to.end(t.depth)),t.depth)),r=!0}let a=Ai(i,n,o,t);return a?(e&&Kz(e,t,a,r,n),!0):!1}function Kz(e,t,n,o,r){let i=M.empty;for(let c=n.length-1;c>=0;c--)i=M.from(n[c].type.create(n[c].attrs,i));e.step(new ot(t.start-(o?2:0),t.end,t.start,t.end,new F(i,0,0),n.length,!0));let s=0;for(let c=0;c<n.length;c++)n[c].type==r&&(s=c+1);let a=n.length-s,l=t.start+n.length-(o?2:0),u=t.parent;for(let c=t.startIndex,d=t.endIndex,f=!0;c<d;c++,f=!1)!f&&on(e.doc,l,a)&&(e.split(l,a),l+=2*a),l+=u.child(c).nodeSize;return e}function CE(e){return function(t,n){let{$from:o,$to:r}=t.selection,i=o.blockRange(r,s=>s.childCount>0&&s.firstChild.type==e);return i?n?o.node(i.depth-1).type==e?Jz(t,n,e,i):Gz(t,n,i):!0:!1}}function Jz(e,t,n,o){let r=e.tr,i=o.end,s=o.$to.end(o.depth);i<s&&(r.step(new ot(i-1,s,i,s,new F(M.from(n.create(null,o.parent.copy())),1,0),1,!0)),o=new ro(r.doc.resolve(o.$from.pos),r.doc.resolve(s),o.depth));let a=Gn(o);if(a==null)return!1;r.lift(o,a);let l=r.doc.resolve(r.mapping.map(i,-1)-1);return gn(r.doc,l.pos)&&l.nodeBefore.type==l.nodeAfter.type&&r.join(l.pos),t(r.scrollIntoView()),!0}function Gz(e,t,n){let o=e.tr,r=n.parent;for(let h=n.end,p=n.endIndex-1,m=n.startIndex;p>m;p--)h-=r.child(p).nodeSize,o.delete(h-1,h+1);let i=o.doc.resolve(n.start),s=i.nodeAfter;if(o.mapping.map(n.end)!=n.start+i.nodeAfter.nodeSize)return!1;let a=n.startIndex==0,l=n.endIndex==r.childCount,u=i.node(-1),c=i.index(-1);if(!u.canReplace(c+(a?0:1),c+1,s.content.append(l?M.empty:M.from(r))))return!1;let d=i.pos,f=d+s.nodeSize;return o.step(new ot(d-(a?1:0),f+(l?1:0),d+1,f-1,new F((a?M.empty:M.from(r.copy(M.empty))).append(l?M.empty:M.from(r.copy(M.empty))),a?0:1,l?0:1),a?0:1)),t(o.scrollIntoView()),!0}function TE(e){return function(t,n){let{$from:o,$to:r}=t.selection,i=o.blockRange(r,u=>u.childCount>0&&u.firstChild.type==e);if(!i)return!1;let s=i.startIndex;if(s==0)return!1;let a=i.parent,l=a.child(s-1);if(l.type!=e)return!1;if(n){let u=l.lastChild&&l.lastChild.type==a.type,c=M.from(u?e.create():null),d=new F(M.from(e.create(null,M.from(a.type.create(null,c)))),u?3:1,0),f=i.start,h=i.end;n(t.tr.step(new ot(f-(u?3:1),h,f,h,d,1,!0)).scrollIntoView())}return!0}}var St=function(e){for(var t=0;;t++)if(e=e.previousSibling,!e)return t},Ri=function(e){let t=e.assignedSlot||e.parentNode;return t&&t.nodeType==11?t.host:t},gb=null,Xn=function(e,t,n){let o=gb||(gb=document.createRange());return o.setEnd(e,n??e.nodeValue.length),o.setStart(e,t||0),o},Qz=function(){gb=null},go=function(e,t,n,o){return n&&(AE(e,t,n,o,-1)||AE(e,t,n,o,1))},Xz=/^(img|br|input|textarea|hr)$/i;function AE(e,t,n,o,r){for(var i;;){if(e==n&&t==o)return!0;if(t==(r<0?0:$t(e))){let s=e.parentNode;if(!s||!ee(s)||Ra(e)||Xz.test(e.nodeName)||e.contentEditable=="false")return!1;t=St(e)+(r<0?0:1),e=s}else if(ee(e)){let s=e.childNodes[t+(r<0?-1:0)];if(ee(s)&&s.contentEditable=="false")if(!((i=s.pmViewDesc)===null||i===void 0)&&i.ignoreForSelection)t+=r;else return!1;else e=s,t=r<0?$t(e):0}else return!1}}function $t(e){return e.nodeType==3?e.nodeValue.length:e.childNodes.length}function ee(e){return e.nodeType==1}function dt(e){return e.nodeType==3}function bo(e,t){return t?e.contains(ee(t)?t:t.parentNode):!1}function Yz(e,t){for(;;){if(dt(e)&&t)return e;if(ee(e)&&t>0){if(e.contentEditable=="false")return null;e=e.childNodes[t-1],t=$t(e)}else if(e.parentNode&&!Ra(e))t=St(e),e=e.parentNode;else return null}}function eO(e,t){for(;;){if(dt(e)&&t<e.nodeValue.length)return e;if(ee(e)&&t<e.childNodes.length){if(e.contentEditable=="false")return null;e=e.childNodes[t],t=0}else if(e.parentNode&&!Ra(e))t=St(e)+1,e=e.parentNode;else return null}}function tO(e,t,n){for(let o=t==0,r=t==$t(e);o||r;){if(e==n)return!0;let i=St(e);if(e=e.parentNode,!e)return!1;o=o&&i==0,r=r&&i==$t(e)}}function Ra(e){let t;for(let n=e;n&&!(t=n.pmViewDesc);n=n.parentNode);return t&&t.node&&t.node.isBlock&&(t.dom==e||t.contentDOM==e)}var cd=function(e){return e.focusNode&&go(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)};function lo(e,t){let n=document.createEvent("Event");return n.initEvent("keydown",!0,!0),n.keyCode=e,n.key=n.code=t,n}function nO(e){let t=e.activeElement;for(;t&&t.shadowRoot;)t=t.shadowRoot.activeElement;return t}function rO(e,t,n){if(e.caretPositionFromPoint)try{let o=e.caretPositionFromPoint(t,n);if(o)return{node:o.offsetNode,offset:Math.min($t(o.offsetNode),o.offset)}}catch{}if(e.caretRangeFromPoint){let o=e.caretRangeFromPoint(t,n);if(o)return{node:o.startContainer,offset:Math.min($t(o.startContainer),o.startOffset)}}}var Dn=typeof navigator<"u"?navigator:null,ME=typeof document<"u"?document:null,Ar=Dn&&Dn.userAgent||"",bb=/Edge\/(\d+)/.exec(Ar),o2=/MSIE \d/.exec(Ar),yb=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Ar),qt=!!(o2||yb||bb),Cr=o2?document.documentMode:yb?+yb[1]:bb?+bb[1]:0,Jt=!qt&&/gecko\/(\d+)/i.test(Ar);Jt&&+(/Firefox\/(\d+)/.exec(Ar)||[0,0])[1];var vb=!qt&&/Chrome\/(\d+)/.exec(Ar),_t=!!vb,i2=vb?+vb[1]:0,It=!qt&&!!Dn&&/Apple Computer/.test(Dn.vendor),Pi=It&&(/Mobile\/\w+/.test(Ar)||!!Dn&&Dn.maxTouchPoints>2),sn=Pi||(Dn?/Mac/.test(Dn.platform):!1),s2=Dn?/Win/.test(Dn.platform):!1,Yn=/Android \d/.test(Ar),dd=!!ME&&"webkitFontSmoothing"in ME.documentElement.style,oO=dd?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function iO(e){let t=e.defaultView&&e.defaultView.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:e.documentElement.clientWidth,top:0,bottom:e.documentElement.clientHeight}}function Qn(e,t){return typeof e=="number"?e:e[t]}function sO(e){let t=e.getBoundingClientRect(),n=t.width/e.offsetWidth||1,o=t.height/e.offsetHeight||1;return{left:t.left,right:t.left+e.clientWidth*n,top:t.top,bottom:t.top+e.clientHeight*o}}function $E(e,t,n){if(!xb(t)&&t.left==0)return;let o=e.someProp("scrollThreshold")||0,r=e.someProp("scrollMargin")||5,i=e.dom.ownerDocument;for(let s=n||e.dom;s;){if(!ee(s)){s=Ri(s);continue}let a=s==i.body,l=a?iO(i):sO(s),u=0,c=0;if(t.top<l.top+Qn(o,"top")?c=-(l.top-t.top+Qn(r,"top")):t.bottom>l.bottom-Qn(o,"bottom")&&(c=t.bottom-t.top>l.bottom-l.top?t.top+Qn(r,"top")-l.top:t.bottom-l.bottom+Qn(r,"bottom")),t.left<l.left+Qn(o,"left")?u=-(l.left-t.left+Qn(r,"left")):t.right>l.right-Qn(o,"right")&&(u=t.right-l.right+Qn(r,"right")),u||c)if(a)i.defaultView.scrollBy(u,c);else{let f=s.scrollLeft,h=s.scrollTop;c&&(s.scrollTop+=c),u&&(s.scrollLeft+=u);let p=s.scrollLeft-f,m=s.scrollTop-h;t={left:t.left-p,top:t.top-m,right:t.right-p,bottom:t.bottom-m}}let d=a?"fixed":getComputedStyle(s).position;if(/^(fixed|sticky)$/.test(d))break;s=d=="absolute"?s.offsetParent:Ri(s)}}function aO(e){let t=e.dom.getBoundingClientRect(),n=Math.max(0,t.top),o,r;for(let i=(t.left+t.right)/2,s=n+1;s<Math.min(innerHeight,t.bottom);s+=5){let a=e.root.elementFromPoint(i,s);if(!a||a==e.dom||!e.dom.contains(a))continue;let l=a.getBoundingClientRect();if(l.top>=n-20){o=a,r=l.top;break}}return{refDOM:o,refTop:r,stack:a2(e.dom)}}function a2(e){let t=[],n=e.ownerDocument;for(let o=e;o&&(t.push({dom:o,top:o.scrollTop,left:o.scrollLeft}),e!=n);o=Ri(o));return t}function lO({refDOM:e,refTop:t,stack:n}){let o=e?e.getBoundingClientRect().top:0;l2(n,o==0?0:o-t)}function l2(e,t){for(let n=0;n<e.length;n++){let{dom:o,top:r,left:i}=e[n];o.scrollTop!=r+t&&(o.scrollTop=r+t),o.scrollLeft!=i&&(o.scrollLeft=i)}}var Ni=null;function uO(e){if(e.setActive)return e.setActive();if(Ni)return e.focus(Ni);let t=a2(e);e.focus(Ni==null?{get preventScroll(){return Ni={preventScroll:!0},!0}}:void 0),Ni||(Ni=!1,l2(t,0))}function u2(e,t){let n,o=2e8,r,i=0,s=t.top,a=t.top,l,u;for(let c=e.firstChild,d=0;c;c=c.nextSibling,d++){let f;if(ee(c))f=c.getClientRects();else if(dt(c))f=Xn(c).getClientRects();else continue;for(let h=0;h<f.length;h++){let p=f[h];if(p.top<=s&&p.bottom>=a){s=Math.max(p.bottom,s),a=Math.min(p.top,a);let m=p.left>t.left?p.left-t.left:p.right<t.left?t.left-p.right:0;if(m<o){n=c,o=m,r=m&&dt(n)?{left:p.right<t.left?p.right:p.left,top:t.top}:t,ee(c)&&m&&(i=d+(t.left>=(p.left+p.right)/2?1:0));continue}}else p.top>t.top&&!l&&p.left<=t.left&&p.right>=t.left&&(l=c,u={left:Math.max(p.left,Math.min(p.right,t.left)),top:p.top});!n&&(t.left>=p.right&&t.top>=p.top||t.left>=p.left&&t.top>=p.bottom)&&(i=d+1)}}return!n&&l&&(n=l,r=u,o=0),n&&dt(n)?cO(n,r):!n||o?{node:e,offset:i}:u2(n,r)}function cO(e,t){let n=e.nodeValue.length,o=document.createRange(),r;for(let i=0;i<n;i++){o.setEnd(e,i+1),o.setStart(e,i);let s=_r(o,1);if(s.top!=s.bottom&&Rb(t,s)){r={node:e,offset:i+(t.left>=(s.left+s.right)/2?1:0)};break}}return o.detach(),r||{node:e,offset:0}}function Rb(e,t){return e.left>=t.left-1&&e.left<=t.right+1&&e.top>=t.top-1&&e.top<=t.bottom+1}function dO(e,t){let n=e.parentNode;return n&&/^li$/i.test(n.nodeName)&&t.left<e.getBoundingClientRect().left?n:e}function fO(e,t,n){let{node:o,offset:r}=u2(t,n),i=-1;if(ee(o)&&!o.firstChild){let s=o.getBoundingClientRect();i=s.left!=s.right&&n.left>(s.left+s.right)/2?1:-1}return e.docView.posFromDOM(o,r,i)}function pO(e,t,n,o){let r=-1;for(let i=t,s=!1;i!=e.dom;){let a=e.docView.nearestDesc(i,!0),l;if(!a)return null;if(ee(a.dom)&&(a.node.isBlock&&a.parent||!a.contentDOM)&&((l=a.dom.getBoundingClientRect()).width||l.height)&&(a.node.isBlock&&a.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(a.dom.nodeName)&&(!s&&l.left>o.left||l.top>o.top?r=a.posBefore:(!s&&l.right<o.left||l.bottom<o.top)&&(r=a.posAfter),s=!0),!a.contentDOM&&r<0&&!a.node.isText))return(a.node.isBlock?o.top<(l.top+l.bottom)/2:o.left<(l.left+l.right)/2)?a.posBefore:a.posAfter;i=a.dom.parentNode}return r>-1?r:e.docView.posFromDOM(t,n,-1)}function c2(e,t,n){let o=e.childNodes.length;if(o&&n.top<n.bottom)for(let r=Math.max(0,Math.min(o-1,Math.floor(o*(t.top-n.top)/(n.bottom-n.top))-2)),i=r;;){let s=e.childNodes[i];if(ee(s)){let a=s.getClientRects();for(let l=0;l<a.length;l++){let u=a[l];if(Rb(t,u))return c2(s,t,u)}}if((i=(i+1)%o)==r)break}return e}function hO(e,t){let n=e.dom.ownerDocument,o,r=0,i=rO(n,t.left,t.top);i&&({node:o,offset:r}=i);let s=(e.root.elementFromPoint?e.root:n).elementFromPoint(t.left,t.top),a;if(!s||!e.dom.contains(s)){let u=e.dom.getBoundingClientRect();if(!Rb(t,u)||(s=c2(e.dom,t,u),!s))return null}if(It)for(let u=s;o&&u;u=Ri(u))u.draggable&&(o=void 0);if(s=dO(s,t),o){if(Jt&&ee(o)&&(r=Math.min(r,o.childNodes.length),r<o.childNodes.length)){let c=o.childNodes[r],d;c.nodeName=="IMG"&&(d=c.getBoundingClientRect()).right<=t.left&&d.bottom>t.top&&r++}let u;dd&&r&&ee(o)&&ee(u=o.childNodes[r-1])&&u.contentEditable=="false"&&u.getBoundingClientRect().top>=t.top&&r--,o==e.dom&&r==o.childNodes.length-1&&ee(o.lastChild)&&t.top>o.lastChild.getBoundingClientRect().bottom?a=e.state.doc.content.size:(r==0||!ee(o)||o.childNodes[r-1].nodeName!="BR")&&(a=pO(e,o,r,t))}a==null&&(a=fO(e,s,t));let l=e.docView.nearestDesc(s,!0);return{pos:a,inside:l?l.posAtStart-l.border:-1}}function xb(e){return e.top<e.bottom||e.left<e.right}function _r(e,t){let n=e.getClientRects();if(n.length){let o=n[t<0?0:n.length-1];if(xb(o))return o}return Array.prototype.find.call(n,xb)||e.getBoundingClientRect()}var mO=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function d2(e,t,n){let{node:o,offset:r,atom:i}=e.docView.domFromPos(t,n<0?-1:1),s=dd||Jt;if(dt(o))if(s&&(mO.test(o.nodeValue)||(n<0?!r:r==o.nodeValue.length))){let l=_r(Xn(o,r,r),n);if(Jt&&r&&/\s/.test(o.nodeValue[r-1])&&r<o.nodeValue.length){let u=_r(Xn(o,r-1,r-1),-1);if(u.top==l.top){let c=_r(Xn(o,r,r+1),-1);if(c.top!=l.top)return Aa(c,c.left<u.left)}}return l}else{let l=r,u=r,c=n<0?1:-1;return n<0&&!r?(u++,c=-1):n>=0&&r==o.nodeValue.length?(l--,c=1):n<0?l--:u++,Aa(_r(Xn(o,l,u),c),c<0)}if(!e.state.doc.resolve(t-(i||0)).parent.inlineContent){if(i==null&&r&&(n<0||r==$t(o))){let l=o.childNodes[r-1];if(ee(l))return fb(l.getBoundingClientRect(),!1)}if(i==null&&r<$t(o)){let l=o.childNodes[r];if(ee(l))return fb(l.getBoundingClientRect(),!0)}return fb(o.getBoundingClientRect(),n>=0)}if(i==null&&r&&(n<0||r==$t(o))){let l=o.childNodes[r-1],u=dt(l)?Xn(l,$t(l)-(s?0:1)):ee(l)&&(l.nodeName!="BR"||!l.nextSibling)?l:null;if(u)return Aa(_r(u,1),!1)}if(i==null&&r<$t(o)){let l=o.childNodes[r];for(;l.pmViewDesc&&l.pmViewDesc.ignoreForCoords;)l=l.nextSibling;let u=l?dt(l)?Xn(l,0,s?0:1):ee(l)?l:null:null;if(u)return Aa(_r(u,-1),!0)}return Aa(_r(dt(o)?Xn(o):o,-n),n>=0)}function Aa(e,t){if(e.width==0)return e;let n=t?e.left:e.right;return{top:e.top,bottom:e.bottom,left:n,right:n}}function fb(e,t){if(e.height==0)return e;let n=t?e.top:e.bottom;return{top:n,bottom:n,left:e.left,right:e.right}}function f2(e,t,n){let o=e.state,r=e.root.activeElement;o!=t&&e.updateState(t),r!=e.dom&&e.focus();try{return n()}finally{o!=t&&e.updateState(o),r!=e.dom&&r&&r.focus()}}function gO(e,t,n){let o=t.selection,r=n=="up"?o.$from:o.$to;return f2(e,t,()=>{let{node:i}=e.docView.domFromPos(r.pos,n=="up"?-1:1);for(;;){let a=e.docView.nearestDesc(i,!0);if(!a)break;if(a.node.isBlock){i=a.contentDOM||a.dom;break}i=a.dom.parentNode}let s=d2(e,r.pos,1);for(let a=i.firstChild;a;a=a.nextSibling){let l;if(ee(a))l=a.getClientRects();else if(dt(a))l=Xn(a,0,a.nodeValue.length).getClientRects();else continue;for(let u=0;u<l.length;u++){let c=l[u];if(c.bottom>c.top+1&&(n=="up"?s.top-c.top>(c.bottom-s.top)*2:c.bottom-s.bottom>(s.bottom-c.top)*2))return!1}}return!0})}var bO=/[\u0590-\u08ac]/;function yO(e,t,n){let{$head:o}=t.selection;if(!o.parent.isTextblock)return!1;let r=o.parentOffset,i=!r,s=r==o.parent.content.size,a=e.domSelection();return a?!bO.test(o.parent.textContent)||!a.modify?n=="left"||n=="backward"?i:s:f2(e,t,()=>{let{focusNode:l,focusOffset:u,anchorNode:c,anchorOffset:d}=e.domSelectionRange(),f=a.caretBidiLevel;a.modify("move",n,"character");let h=o.depth?e.docView.domAfterPos(o.before()):e.dom,{focusNode:p,focusOffset:m}=e.domSelectionRange(),g=p&&!bo(h,p)||l==p&&u==m;try{a.collapse(c,d),l&&(l!=c||u!=d)&&a.extend&&a.extend(l,u)}catch{}return f!=null&&(a.caretBidiLevel=f),g}):o.pos==o.start()||o.pos==o.end()}var IE=null,DE=null,NE=!1;function vO(e,t,n){return IE==t&&DE==n?NE:(IE=t,DE=n,NE=n=="up"||n=="down"?gO(e,t,n):yO(e,t,n))}var an=0,zE=1,uo=2,bn=3,yo=class{constructor(t,n,o,r){this.parent=t,this.children=n,this.dom=o,this.contentDOM=r,this.dirty=an,o.pmViewDesc=this}matchesWidget(t){return!1}matchesMark(t){return!1}matchesNode(t,n,o){return!1}matchesHack(t){return!1}parseRule(t){return null}stopEvent(t){return!1}get size(){let t=0;for(let n=0;n<this.children.length;n++)t+=this.children[n].size;return t}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let t=0;t<this.children.length;t++)this.children[t].destroy()}posBeforeChild(t){for(let n=0,o=this.posAtStart;;n++){let r=this.children[n];if(r==t)return o;o+=r.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(t,n,o){if(this.contentDOM&&bo(this.contentDOM,t))if(o<0){let i,s;if(t==this.contentDOM)i=t.childNodes[n-1];else{for(;t.parentNode!=this.contentDOM;)t=t.parentNode;i=t.previousSibling}for(;i&&!((s=i.pmViewDesc)&&s.parent==this);)i=i.previousSibling;return i?this.posBeforeChild(s)+s.size:this.posAtStart}else{let i,s;if(t==this.contentDOM)i=t.childNodes[n];else{for(;t.parentNode!=this.contentDOM;)t=t.parentNode;i=t.nextSibling}for(;i&&!((s=i.pmViewDesc)&&s.parent==this);)i=i.nextSibling;return i?this.posBeforeChild(s):this.posAtEnd}let r;if(t==this.dom&&this.contentDOM)r=n>St(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))r=!!(t.compareDocumentPosition(this.contentDOM)&4);else if(this.dom.firstChild){if(n==0)for(let i=t;;i=i.parentNode){if(i==this.dom){r=!1;break}if(i.previousSibling)break}if(r==null&&n==t.childNodes.length)for(let i=t;;i=i.parentNode){if(i==this.dom){r=!0;break}if(i.nextSibling)break}}return r??o>0?this.posAtEnd:this.posAtStart}nearestDesc(t,n=!1){for(let o=!0,r=t;r;r=r.parentNode){let i=this.getDesc(r),s;if(i&&(!n||i.node))if(o&&(s=i.nodeDOM)&&!(ee(s)?bo(s,t):s==t))o=!1;else return i}}getDesc(t){let n=t.pmViewDesc;for(let o=n;o;o=o.parent)if(o==this)return n}posFromDOM(t,n,o){for(let r=t;r;r=r.parentNode){let i=this.getDesc(r);if(i)return i.localPosFromDOM(t,n,o)}return-1}descAt(t){for(let n=0,o=0;n<this.children.length;n++){let r=this.children[n],i=o+r.size;if(o==t&&i!=o){for(;!r.border&&r.children.length;)for(let s=0;s<r.children.length;s++){let a=r.children[s];if(a.size){r=a;break}}return r}if(t<i)return r.descAt(t-o-r.border);o=i}}domFromPos(t,n){if(!this.contentDOM)return{node:this.dom,offset:0,atom:t+1};let o=0,r=0;for(let i=0;o<this.children.length;o++){let s=this.children[o],a=i+s.size;if(a>t){r=t-i;break}i=a}if(r)return this.children[o].domFromPos(r-this.children[o].border,n);for(;o>0;o--){let i=this.children[o-1];if(i.size||!(i instanceof nd||i instanceof ed&&i.side>=0))break}if(n<=0){let i,s=!0;for(;i=o?this.children[o-1]:null,!(!i||i.dom.parentNode==this.contentDOM);o--,s=!1);return i&&n&&s&&!i.border&&!i.domAtom?i.domFromPos(i.size,n):{node:this.contentDOM,offset:i?St(i.dom)+1:0}}else{let i,s=!0;for(;i=o<this.children.length?this.children[o]:null,!(!i||i.dom.parentNode==this.contentDOM);o++,s=!1);return i&&s&&!i.border&&!i.domAtom?i.domFromPos(0,n):{node:this.contentDOM,offset:i?St(i.dom):this.contentDOM.childNodes.length}}}parseRange(t,n,o=0){if(this.children.length==0)return{node:this.contentDOM,from:t,to:n,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let r=-1,i=-1;for(let s=o,a=0;;a++){let l=this.children[a],u=s+l.size;if(r==-1&&t<=u){let c=s+l.border;if(t>=c&&n<=u-l.border&&l.node&&l.contentDOM&&this.contentDOM.contains(l.contentDOM))return l.parseRange(t,n,c);t=s;for(let d=a;d>0;d--){let f=this.children[d-1];if(f.size&&f.dom.parentNode==this.contentDOM&&!f.emptyChildAt(1)){r=St(f.dom)+1;break}t-=f.size}r==-1&&(r=0)}if(r>-1&&(u>n||a==this.children.length-1)){n=u;for(let c=a+1;c<this.children.length;c++){let d=this.children[c];if(d.size&&d.dom.parentNode==this.contentDOM&&!d.emptyChildAt(-1)){i=St(d.dom);break}n+=d.size}i==-1&&(i=this.contentDOM.childNodes.length);break}s=u}return{node:this.contentDOM,from:t,to:n,fromOffset:r,toOffset:i}}emptyChildAt(t){if(this.border||!this.contentDOM||!this.children.length)return!1;let n=this.children[t<0?0:this.children.length-1];return n.size==0||n.emptyChildAt(t)}domAfterPos(t){let{node:n,offset:o}=this.domFromPos(t,0);if(!ee(n)||o==n.childNodes.length)throw new RangeError("No node after pos "+t);return n.childNodes[o]}setSelection(t,n,o,r=!1){let i=Math.min(t,n),s=Math.max(t,n);for(let h=0,p=0;h<this.children.length;h++){let m=this.children[h],g=p+m.size;if(i>p&&s<g)return m.setSelection(t-p-m.border,n-p-m.border,o,r);p=g}let a=this.domFromPos(t,t?-1:1),l=n==t?a:this.domFromPos(n,n?-1:1),u=o.root.getSelection(),c=o.domSelectionRange(),d=!1;if((Jt||It)&&t==n){let{node:h,offset:p}=a;if(dt(h)){if(d=!!(p&&h.nodeValue[p-1]==`
`),d&&p==h.nodeValue.length)for(let m=h,g;m;m=m.parentNode){if(g=m.nextSibling){g.nodeName=="BR"&&(a=l={node:g.parentNode,offset:St(g)+1});break}let b=m.pmViewDesc;if(b&&b.node&&b.node.isBlock)break}}else{let m=h.childNodes[p-1];d=m&&(m.nodeName=="BR"||m.contentEditable=="false")}}if(Jt&&c.focusNode&&c.focusNode!=l.node&&ee(c.focusNode)){let h=c.focusNode.childNodes[c.focusOffset];h&&h.contentEditable=="false"&&(r=!0)}if(!(r||d&&It)&&go(a.node,a.offset,c.anchorNode,c.anchorOffset)&&go(l.node,l.offset,c.focusNode,c.focusOffset))return;let f=!1;if((u.extend||t==n)&&!(d&&Jt)){u.collapse(a.node,a.offset);try{t!=n&&u.extend(l.node,l.offset),f=!0}catch{}}if(!f){if(t>n){let p=a;a=l,l=p}let h=document.createRange();h.setEnd(l.node,l.offset),h.setStart(a.node,a.offset),u.removeAllRanges(),u.addRange(h)}}ignoreMutation(t){return!this.contentDOM&&t.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(t,n){for(let o=0,r=0;r<this.children.length;r++){let i=this.children[r],s=o+i.size;if(o==s?t<=s&&n>=o:t<s&&n>o){let a=o+i.border,l=s-i.border;if(t>=a&&n<=l){this.dirty=t==o||n==s?uo:zE,t==a&&n==l&&(i.contentLost||i.dom.parentNode!=this.contentDOM)?i.dirty=bn:i.markDirty(t-a,n-a);return}else i.dirty=i.dom==i.contentDOM&&i.dom.parentNode==this.contentDOM&&!i.children.length?uo:bn}o=s}this.dirty=uo}markParentsDirty(){let t=1;for(let n=this.parent;n;n=n.parent,t++){let o=t==1?uo:zE;n.dirty<o&&(n.dirty=o)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(t){return!1}},ed=class extends yo{constructor(t,n,o,r){let i,s=n.type.toDOM;if(typeof s=="function"&&(s=s(o,()=>{if(!i)return r;if(i.parent)return i.parent.posBeforeChild(i)})),!n.type.spec.raw){let a=ee(s)?s:document.createElement("span");a!=s&&a.appendChild(s),a.hasAttribute("contenteditable")||(a.contentEditable="false"),a.classList.add("ProseMirror-widget")}super(t,[],s,null),this.widget=n,this.widget=n,i=this}matchesWidget(t){return this.dirty==an&&t.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(t){let n=this.widget.spec.stopEvent;return n?n(t):!1}ignoreMutation(t){return t.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}},kb=class extends yo{constructor(t,n,o,r){super(t,[],n,null),this.textDOM=o,this.text=r}get size(){return this.text.length}localPosFromDOM(t,n){return t!=this.textDOM?this.posAtStart+(n?this.size:0):this.posAtStart+n}domFromPos(t){return{node:this.textDOM,offset:t}}ignoreMutation(t){return t.type==="characterData"&&t.target.nodeValue==t.oldValue}},fo=class e extends yo{constructor(t,n,o,r,i){super(t,[],o,r),this.mark=n,this.spec=i}static create(t,n,o,r){let i=r.nodeViews[n.type.name],s=i&&i(n,r,o);return(!s||!s.dom)&&(s=Wn.renderSpec(document,n.type.spec.toDOM(n,o),null,n.attrs)),new e(t,n,s.dom,s.contentDOM||s.dom,s)}parseRule(){return this.dirty&bn||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(t){return this.dirty!=bn&&this.mark.eq(t)}markDirty(t,n){if(super.markDirty(t,n),this.dirty!=an){let o=this.parent;for(;!o.node;)o=o.parent;o.dirty<this.dirty&&(o.dirty=this.dirty),this.dirty=an}}slice(t,n,o){let r=e.create(this.parent,this.mark,!0,o),i=this.children,s=this.size;n<s&&(i=Eb(i,n,s,o)),t>0&&(i=Eb(i,0,t,o));for(let a=0;a<i.length;a++)i[a].parent=r;return r.children=i,r}ignoreMutation(t){return this.spec.ignoreMutation?this.spec.ignoreMutation(t):super.ignoreMutation(t)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}},Tr=class e extends yo{constructor(t,n,o,r,i,s,a){super(t,[],i,s),this.node=n,this.outerDeco=o,this.innerDeco=r,this.nodeDOM=a}static create(t,n,o,r,i,s){let a=i.nodeViews[n.type.name],l,u=a&&a(n,i,()=>{if(!l)return s;if(l.parent)return l.parent.posBeforeChild(l)},o,r),c=u&&u.dom,d=u&&u.contentDOM;if(n.isText){if(!c)c=document.createTextNode(n.text);else if(!dt(c))throw new RangeError("Text must be rendered as a DOM text node")}else c||({dom:c,contentDOM:d}=Wn.renderSpec(document,n.type.spec.toDOM(n),null,n.attrs));!d&&!n.isText&&c.nodeName!="BR"&&(c.hasAttribute("contenteditable")||(c.contentEditable="false"),n.type.spec.draggable&&(c.draggable=!0));let f=c;return c=m2(c,o,n),u?l=new wb(t,n,o,r,c,d||null,f,u):n.isText?new td(t,n,o,r,c,f):new e(t,n,o,r,c,d||null,f)}parseRule(t){if(this.node.type.spec.reparseInView)return null;let n={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(n.preserveWhitespace="full"),!this.contentDOM)n.getContent=()=>this.node.content;else if(!this.contentLost)n.contentElement=this.contentDOM;else{for(let o=this.children.length-1;o>=0;o--){let r=this.children[o];if(this.dom.contains(r.dom.parentNode)){n.contentElement=r.dom.parentNode;break}}if(!n.contentElement){let o=t&&t.find(r=>ee(r)&&t.indexOf(r.parentNode)<0&&this.dom.contains(r));o?n.contentElement=o:n.getContent=()=>M.empty}}return n}matchesNode(t,n,o){return this.dirty==an&&t.eq(this.node)&&rd(n,this.outerDeco)&&o.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(t,n){let o=this.node.inlineContent,r=n,i=t.composing?this.localCompositionInfo(t,n):null,s=i&&i.pos>-1?i:null,a=i&&i.pos<0,l=new _b(this,s&&s.node,t),u=this.node.inlineContent,c=u&&this.node.isBlock;SO(this.node,this.innerDeco,(d,f,h)=>{d.spec.marks?l.syncToMarks(d.spec.marks,o,t,f):d.type.side>=0&&!h&&l.syncToMarks(f==this.node.childCount?be.none:this.node.child(f).marks,o,t,f),l.placeWidget(d,t,r)},(d,f,h,p)=>{l.syncToMarks(d.marks,o,t,p),c&&d.isAtom&&!d.isText&&l.addHackNode("IMG",l.top);let m;l.findNodeMatch(d,f,h,p)||a&&t.state.selection.from>r&&t.state.selection.to<r+d.nodeSize&&(m=l.findIndexWithChild(i.node))>-1&&l.updateNodeAt(d,f,h,m,t)||l.updateNextNode(d,f,h,t,p,r)||l.addNode(d,f,h,t,r),r+=d.nodeSize,u&&(c=d.isAtom&&!d.isText)}),l.syncToMarks([],o,t,0),this.node.isTextblock&&l.addTextblockHacks(),l.destroyRest(),(l.changed||this.dirty==uo)&&(s&&this.protectLocalComposition(t,s),p2(this.contentDOM,this.children,t),Pi&&_O(this.dom))}localCompositionInfo(t,n){let{from:o,to:r}=t.state.selection;if(!(t.state.selection instanceof Z)||o<n||r>n+this.node.content.size)return null;let i=t.input.compositionNode;if(!i||!this.dom.contains(i.parentNode))return null;if(this.node.inlineContent){let s=i.nodeValue,a=EO(this.node.content,s,o-n,r-n);return a<0?null:{node:i,pos:a,text:s}}else return{node:i,pos:-1,text:""}}protectLocalComposition(t,{node:n,pos:o,text:r}){if(this.getDesc(n))return;let i=n;for(;i.parentNode!=this.contentDOM;i=i.parentNode){for(;i.previousSibling;)i.parentNode.removeChild(i.previousSibling);for(;i.nextSibling;)i.parentNode.removeChild(i.nextSibling);i.pmViewDesc&&(i.pmViewDesc=void 0)}let s=new kb(this,i,n,r);t.input.compositionNodes.push(s),this.children=Eb(this.children,o,o+r.length,t,s)}update(t,n,o,r){return this.dirty==bn||!t.sameMarkup(this.node)?!1:(this.updateInner(t,n,o,r),!0)}updateInner(t,n,o,r){this.updateOuterDeco(n),this.node=t,this.innerDeco=o,this.contentDOM&&this.updateChildren(r,this.posAtStart),this.dirty=an}updateOuterDeco(t){if(rd(t,this.outerDeco))return;let n=!ee(this.nodeDOM),o=this.dom;this.dom=h2(this.dom,this.nodeDOM,Sb(this.outerDeco,this.node,n),Sb(t,this.node,n)),this.dom!=o&&(o.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=t}selectNode(){ee(this.nodeDOM)&&(this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.nodeDOM.draggable=!0))}deselectNode(){ee(this.nodeDOM)&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.nodeDOM.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}};function OE(e,t,n,o,r){m2(o,t,e);let i=new Tr(void 0,e,t,n,o,o,o);return i.contentDOM&&i.updateChildren(r,0),i}var td=class e extends Tr{constructor(t,n,o,r,i,s){super(t,n,o,r,i,null,s)}parseRule(){let t=this.nodeDOM.parentNode;for(;t&&t!=this.dom&&!t.pmIsDeco;)t=t.parentNode;return{skip:t||!0}}update(t,n,o,r){return this.dirty==bn||this.dirty!=an&&!this.inParent()||!t.sameMarkup(this.node)?!1:(this.updateOuterDeco(n),(this.dirty!=an||t.text!=this.node.text)&&t.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=t.text,r.trackWrites==this.nodeDOM&&(r.trackWrites=null)),this.node=t,this.dirty=an,!0)}inParent(){let t=this.parent.contentDOM;for(let n=this.nodeDOM;n;n=n.parentNode)if(n==t)return!0;return!1}domFromPos(t){return{node:this.nodeDOM,offset:t}}localPosFromDOM(t,n,o){return t==this.nodeDOM?this.posAtStart+Math.min(n,this.node.text.length):super.localPosFromDOM(t,n,o)}ignoreMutation(t){return t.type!="characterData"&&t.type!="selection"}slice(t,n,o){let r=this.node.cut(t,n),i=document.createTextNode(r.text);return new e(this.parent,r,this.outerDeco,this.innerDeco,i,i)}markDirty(t,n){super.markDirty(t,n),this.dom!=this.nodeDOM&&(t==0||n==this.nodeDOM.nodeValue.length)&&(this.dirty=bn)}get domAtom(){return!1}isText(t){return this.node.text==t}},nd=class extends yo{parseRule(){return{ignore:!0}}matchesHack(t){return this.dirty==an&&this.dom.nodeName==t}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}},wb=class extends Tr{constructor(t,n,o,r,i,s,a,l){super(t,n,o,r,i,s,a),this.spec=l}update(t,n,o,r){if(this.dirty==bn)return!1;if(this.spec.update&&(this.node.type==t.type||this.spec.multiType)){let i=this.spec.update(t,n,o);return i&&this.updateInner(t,n,o,r),i}else return!this.contentDOM&&!t.isLeaf?!1:super.update(t,n,o,r)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(t,n,o,r){this.spec.setSelection?this.spec.setSelection(t,n,o.root):super.setSelection(t,n,o,r)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(t){return this.spec.stopEvent?this.spec.stopEvent(t):!1}ignoreMutation(t){return this.spec.ignoreMutation?this.spec.ignoreMutation(t):super.ignoreMutation(t)}};function p2(e,t,n){let o=e.firstChild,r=!1;for(let i=0;i<t.length;i++){let s=t[i],a=s.dom;if(a.parentNode==e){for(;a!=o;)o=RE(o),r=!0;o=o.nextSibling}else r=!0,e.insertBefore(a,o);if(s instanceof fo){let l=o?o.previousSibling:e.lastChild;p2(s.contentDOM,s.children,n),o=l?l.nextSibling:e.firstChild}}for(;o;)o=RE(o),r=!0;r&&n.trackWrites==e&&(n.trackWrites=null)}var $a=function(e){e&&(this.nodeName=e)};$a.prototype=Object.create(null);var co=[new $a];function Sb(e,t,n){if(e.length==0)return co;let o=n?co[0]:new $a,r=[o];for(let i=0;i<e.length;i++){let s=e[i].type.attrs;if(s){s.nodeName&&r.push(o=new $a(s.nodeName));for(let a in s){let l=s[a];l!=null&&(n&&r.length==1&&r.push(o=new $a(t.isInline?"span":"div")),a=="class"?o.class=(o.class?o.class+" ":"")+l:a=="style"?o.style=(o.style?o.style+";":"")+l:a!="nodeName"&&(o[a]=l))}}}return r}function h2(e,t,n,o){if(n==co&&o==co)return t;let r=t;for(let i=0;i<o.length;i++){let s=o[i],a=n[i];if(i){let l;a&&a.nodeName==s.nodeName&&r!=e&&(l=r.parentNode)&&l.nodeName.toLowerCase()==s.nodeName||(l=document.createElement(s.nodeName),l.pmIsDeco=!0,l.appendChild(r),a=co[0]),r=l}xO(r,a||co[0],s)}return r}function xO(e,t,n){for(let o in t)o!="class"&&o!="style"&&o!="nodeName"&&!(o in n)&&e.removeAttribute(o);for(let o in n)o!="class"&&o!="style"&&o!="nodeName"&&n[o]!=t[o]&&e.setAttribute(o,n[o]);if(t.class!=n.class){let o=t.class?t.class.split(" ").filter(Boolean):[],r=n.class?n.class.split(" ").filter(Boolean):[];for(let i=0;i<o.length;i++)r.indexOf(o[i])==-1&&e.classList.remove(o[i]);for(let i=0;i<r.length;i++)o.indexOf(r[i])==-1&&e.classList.add(r[i]);e.classList.length==0&&e.removeAttribute("class")}if(t.style!=n.style){if(t.style){let o=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,r;for(;r=o.exec(t.style);)e.style.removeProperty(r[1])}n.style&&(e.style.cssText+=n.style)}}function m2(e,t,n){return h2(e,e,co,Sb(t,n,!ee(e)))}function rd(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].type.eq(t[n].type))return!1;return!0}function RE(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}var _b=class{constructor(t,n,o){this.lock=n,this.view=o,this.index=0,this.stack=[],this.changed=!1,this.top=t,this.preMatch=kO(t.node.content,t)}destroyBetween(t,n){if(t!=n){for(let o=t;o<n;o++)this.top.children[o].destroy();this.top.children.splice(t,n-t),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(t,n,o,r){let i=0,s=this.stack.length>>1,a=Math.min(s,t.length);for(;i<a&&(i==s-1?this.top:this.stack[i+1<<1]).matchesMark(t[i])&&t[i].type.spec.spanning!==!1;)i++;for(;i<s;)this.destroyRest(),this.top.dirty=an,this.index=this.stack.pop(),this.top=this.stack.pop(),s--;for(;s<t.length;){this.stack.push(this.top,this.index+1);let l=-1,u=this.top.children.length;r<this.preMatch.index&&(u=Math.min(this.index+3,u));for(let c=this.index;c<u;c++){let d=this.top.children[c];if(d.matchesMark(t[s])&&!this.isLocked(d.dom)){l=c;break}}if(l<0&&this.index<this.top.children.length){let c=this.top.children[this.index];c instanceof fo&&c.dirty!=bn&&c.mark.type==t[s].type&&c.spec.update&&!this.isLocked(c.dom)&&c.spec.update(t[s])&&(c.mark=t[s],l=this.index,this.changed=!0)}if(l>-1)l>this.index&&(this.changed=!0,this.destroyBetween(this.index,l)),this.top=this.top.children[this.index];else{let c=fo.create(this.top,t[s],n,o);this.top.children.splice(this.index,0,c),this.top=c,this.changed=!0}this.index=0,s++}}findNodeMatch(t,n,o,r){let i=-1,s;if(r>=this.preMatch.index&&(s=this.preMatch.matches[r-this.preMatch.index]).parent==this.top&&s.matchesNode(t,n,o))i=this.top.children.indexOf(s,this.index);else for(let a=this.index,l=Math.min(this.top.children.length,a+5);a<l;a++){let u=this.top.children[a];if(u.matchesNode(t,n,o)&&!this.preMatch.matched.has(u)){i=a;break}}return i<0?!1:(this.destroyBetween(this.index,i),this.index++,!0)}updateNodeAt(t,n,o,r,i){let s=this.top.children[r];return s.dirty==bn&&s.dom==s.contentDOM&&(s.dirty=uo),s.update(t,n,o,i)?(this.destroyBetween(this.index,r),this.index++,!0):!1}findIndexWithChild(t){for(;;){let n=t.parentNode;if(!n)return-1;if(n==this.top.contentDOM){let o=t.pmViewDesc;if(o){for(let r=this.index;r<this.top.children.length;r++)if(this.top.children[r]==o)return r}return-1}t=n}}updateNextNode(t,n,o,r,i,s){for(let a=this.index;a<this.top.children.length;a++){let l=this.top.children[a];if(l instanceof Tr){let u=this.preMatch.matched.get(l);if(u!=null&&u!=i)return!1;let c=l.dom,d,f=this.isLocked(c)&&!(t.isText&&l.node&&l.node.isText&&l.nodeDOM.nodeValue==t.text&&l.dirty!=bn&&rd(n,l.outerDeco));if(!f&&l.update(t,n,o,r))return this.destroyBetween(this.index,a),l.dom!=c&&(this.changed=!0),this.index++,!0;if(!f&&(d=this.recreateWrapper(l,t,n,o,r,s)))return this.destroyBetween(this.index,a),this.top.children[this.index]=d,d.contentDOM&&(d.dirty=uo,d.updateChildren(r,s+1),d.dirty=an),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(t,n,o,r,i,s){if(t.dirty||n.isAtom||!t.children.length||!t.node.content.eq(n.content)||!rd(o,t.outerDeco)||!r.eq(t.innerDeco))return null;let a=Tr.create(this.top,n,o,r,i,s);if(a.contentDOM){a.children=t.children,t.children=[];for(let l of a.children)l.parent=a}return t.destroy(),a}addNode(t,n,o,r,i){let s=Tr.create(this.top,t,n,o,r,i);s.contentDOM&&s.updateChildren(r,i+1),this.top.children.splice(this.index++,0,s),this.changed=!0}placeWidget(t,n,o){let r=this.index<this.top.children.length?this.top.children[this.index]:null;if(r&&r.matchesWidget(t)&&(t==r.widget||!r.widget.type.toDOM.parentNode))this.index++;else{let i=new ed(this.top,t,n,o);this.top.children.splice(this.index++,0,i),this.changed=!0}}addTextblockHacks(){let t=this.top.children[this.index-1],n=this.top;for(;t instanceof fo;)n=t,t=n.children[n.children.length-1];(!t||!(t instanceof td)||/\n$/.test(t.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(t.node.text))&&((It||_t)&&t&&t.dom.contentEditable=="false"&&this.addHackNode("IMG",n),this.addHackNode("BR",this.top))}addHackNode(t,n){if(n==this.top&&this.index<n.children.length&&n.children[this.index].matchesHack(t))this.index++;else{let o=document.createElement(t);t=="IMG"&&(o.className="ProseMirror-separator",o.alt=""),t=="BR"&&(o.className="ProseMirror-trailingBreak");let r=new nd(this.top,[],o,null);n!=this.top?n.children.push(r):n.children.splice(this.index++,0,r),this.changed=!0}}isLocked(t){return this.lock&&(t==this.lock||ee(t)&&t.contains(this.lock.parentNode))}};function kO(e,t){let n=t,o=n.children.length,r=e.childCount,i=new Map,s=[];e:for(;r>0;){let a;for(;;)if(o){let u=n.children[o-1];if(u instanceof fo)n=u,o=u.children.length;else{a=u,o--;break}}else{if(n==t)break e;o=n.parent.children.indexOf(n),n=n.parent}let l=a.node;if(l){if(l!=e.child(r-1))break;--r,i.set(a,r),s.push(a)}}return{index:r,matched:i,matches:s.reverse()}}function wO(e,t){return e.type.side-t.type.side}function SO(e,t,n,o){let r=t.locals(e),i=0;if(r.length==0){for(let u=0;u<e.childCount;u++){let c=e.child(u);o(c,r,t.forChild(i,c),u),i+=c.nodeSize}return}let s=0,a=[],l=null;for(let u=0;;){let c,d;for(;s<r.length&&r[s].to==i;){let g=r[s++];g.widget&&(c?(d||(d=[c])).push(g):c=g)}if(c)if(d){d.sort(wO);for(let g=0;g<d.length;g++)n(d[g],u,!!l)}else n(c,u,!!l);let f,h;if(l)h=-1,f=l,l=null;else if(u<e.childCount)h=u,f=e.child(u++);else break;for(let g=0;g<a.length;g++)a[g].to<=i&&a.splice(g--,1);for(;s<r.length&&r[s].from<=i&&r[s].to>i;)a.push(r[s++]);let p=i+f.nodeSize;if(f.isText){let g=p;s<r.length&&r[s].from<g&&(g=r[s].from);for(let b=0;b<a.length;b++)a[b].to<g&&(g=a[b].to);g<p&&(l=f.cut(g-i),f=f.cut(0,g-i),p=g,h=-1)}else for(;s<r.length&&r[s].to<p;)s++;let m=f.isInline&&!f.isLeaf?a.filter(g=>!g.inline):a.slice();o(f,m,t.forChild(i,f),h),i=p}}function _O(e){if(e.nodeName=="UL"||e.nodeName=="OL"){let t=e.style.cssText;e.style.cssText=t+"; list-style: square !important",window.getComputedStyle(e).listStyle,e.style.cssText=t}}function EO(e,t,n,o){for(let r=0,i=0;r<e.childCount&&i<=o;){let s=e.child(r++),a=i;if(i+=s.nodeSize,!s.isText)continue;let l=s.text;for(;r<e.childCount;){let u=e.child(r++);if(i+=u.nodeSize,!u.isText)break;l+=u.text}if(i>=n){if(i>=o&&l.slice(o-t.length-a,o-a)==t)return o-t.length;let u=a<o?l.lastIndexOf(t,o-a-1):-1;if(u>=0&&u+t.length+a>=n)return a+u;if(n==o&&l.length>=o+t.length-a&&l.slice(o-a,o-a+t.length)==t)return o}}return-1}function Eb(e,t,n,o,r){let i=[];for(let s=0,a=0;s<e.length;s++){let l=e[s],u=a,c=a+=l.size;u>=n||c<=t?i.push(l):(u<t&&i.push(l.slice(0,t-u,o)),r&&(i.push(r),r=void 0),c>n&&i.push(l.slice(n-u,l.size,o)))}return i}function Pb(e,t=null){let n=e.domSelectionRange(),o=e.state.doc;if(!n.focusNode)return null;let r=e.docView.nearestDesc(n.focusNode),i=r&&r.size==0,s=e.docView.posFromDOM(n.focusNode,n.focusOffset,1);if(s<0)return null;let a=o.resolve(s),l,u;if(cd(n)){for(l=s;r&&!r.node;)r=r.parent;if(r&&r.node.isAtom&&X.isSelectable(r.node)&&r.parent&&!(r.node.isInline&&tO(n.focusNode,n.focusOffset,r.dom))){let d=r.posBefore;u=new X(s==d?a:o.resolve(d))}else if(Jt&&t=="key"&&s>e.state.selection.to&&ee(n.focusNode)&&n.focusOffset==n.focusNode.childNodes.length&&r&&r.posAtStart>e.state.selection.to)for(let d=n.focusNode;;d=d.parentNode){if(getComputedStyle(d).overflow!="visible"){u=Q.findFrom(o.resolve(r.posAtStart),1);break}if(d==r.dom||d.nextSibling||!d.parentNode||!ee(d.parentNode))break}}else{if(n instanceof e.dom.ownerDocument.defaultView.Selection&&n.rangeCount>1){let d=s,f=s;for(let h=0;h<n.rangeCount;h++){let p=n.getRangeAt(h);d=Math.min(d,e.docView.posFromDOM(p.startContainer,p.startOffset,1)),f=Math.max(f,e.docView.posFromDOM(p.endContainer,p.endOffset,-1))}if(d<0)return null;[l,s]=f==e.state.selection.anchor?[f,d]:[d,f],a=o.resolve(s)}else l=e.docView.posFromDOM(n.anchorNode,n.anchorOffset,1);if(l<0)return null}let c=o.resolve(l);if(!u){let d=t=="pointer"||e.state.selection.head<a.pos&&!i?1:-1;u=Lb(e,c,a,d)}return u}function g2(e){return e.editable?e.hasFocus():y2(e)&&document.activeElement&&document.activeElement.contains(e.dom)}function tr(e,t=!1){let n=e.state.selection;if(b2(e,n),!g2(e))return;let o=e.input.mouseDown;if(!t&&_t&&o){let r=e.domSelectionRange(),i=e.domObserver.currentSelection;if(r.anchorNode&&i.anchorNode&&go(r.anchorNode,r.anchorOffset,i.anchorNode,i.anchorOffset)&&o.delaySelUpdate()){e.domObserver.setCurSelection();return}}if(e.domObserver.disconnectSelection(),e.cursorWrapper)TO(e);else{let{anchor:r,head:i}=n,s,a;PE&&!(n instanceof Z)&&(n.$from.parent.inlineContent||(s=LE(e,n.from)),!n.empty&&!n.$from.parent.inlineContent&&(a=LE(e,n.to))),e.docView.setSelection(r,i,e,t),PE&&(s&&FE(s),a&&FE(a)),n.visible?e.dom.classList.remove("ProseMirror-hideselection"):(e.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&CO(e))}e.domObserver.setCurSelection(),e.domObserver.connectSelection()}var PE=It||_t&&i2<63;function LE(e,t){let{node:n,offset:o}=e.docView.domFromPos(t,0),r=o<n.childNodes.length?n.childNodes[o]:null,i=o?n.childNodes[o-1]:null;if(It&&r&&r.contentEditable=="false")return pb(r);if((!r||r.contentEditable=="false")&&(!i||i.contentEditable=="false")){if(r)return pb(r);if(i)return pb(i)}}function pb(e){return e.contentEditable="true",It&&e.draggable&&(e.draggable=!1,e.wasDraggable=!0),e}function FE(e){e.contentEditable="false",e.wasDraggable&&(e.draggable=!0,e.wasDraggable=null)}function CO(e){let t=e.dom.ownerDocument;t.removeEventListener("selectionchange",e.input.hideSelectionGuard);let n=e.domSelectionRange(),o=n.anchorNode,r=n.anchorOffset;t.addEventListener("selectionchange",e.input.hideSelectionGuard=()=>{(n.anchorNode!=o||n.anchorOffset!=r)&&(t.removeEventListener("selectionchange",e.input.hideSelectionGuard),setTimeout(()=>{(!g2(e)||e.state.selection.visible)&&e.dom.classList.remove("ProseMirror-hideselection")},20))})}function TO(e){let t=e.domSelection();if(!t)return;let n=e.cursorWrapper.dom,o=n.nodeName=="IMG";o?t.collapse(n.parentNode,St(n)+1):t.collapse(n,0),!o&&!e.state.selection.visible&&qt&&Cr<=11&&(n.disabled=!0,n.disabled=!1)}function b2(e,t){if(t instanceof X){let n=e.docView.descAt(t.from);n!=e.lastSelectedViewDesc&&(jE(e),n&&n.selectNode(),e.lastSelectedViewDesc=n)}else jE(e)}function jE(e){e.lastSelectedViewDesc&&(e.lastSelectedViewDesc.parent&&e.lastSelectedViewDesc.deselectNode(),e.lastSelectedViewDesc=void 0)}function Lb(e,t,n,o){return e.someProp("createSelectionBetween",r=>r(e,t,n))||Z.between(t,n,o)}function BE(e){return e.editable&&!e.hasFocus()?!1:y2(e)}function y2(e){let t=e.domSelectionRange();if(!t.anchorNode)return!1;try{return bo(e.dom,t.anchorNode)&&(e.editable||bo(e.dom,t.focusNode))}catch{return!1}}function AO(e){let t=e.docView.domFromPos(e.state.selection.anchor,0),n=e.domSelectionRange();return go(t.node,t.offset,n.anchorNode,n.anchorOffset)}function Cb(e,t){let{$anchor:n,$head:o}=e.selection,r=t>0?n.max(o):n.min(o),i=r.parent.inlineContent?r.depth?e.doc.resolve(t>0?r.after():r.before()):null:r;return i&&Q.findFrom(i,t)}function Er(e,t){return e.dispatch(e.state.tr.setSelection(t).scrollIntoView()),!0}function UE(e,t,n){let o=e.state.selection;if(o instanceof Z)if(n.indexOf("s")>-1){let{$head:r}=o,i=r.textOffset?null:t<0?r.nodeBefore:r.nodeAfter;if(!i||i.isText||!i.isLeaf)return!1;let s=e.state.doc.resolve(r.pos+i.nodeSize*(t<0?-1:1));return Er(e,new Z(o.$anchor,s))}else if(o.empty){if(e.endOfTextblock(t>0?"forward":"backward")){let r=Cb(e.state,t);return r&&r instanceof X?Er(e,r):!1}else if(!(sn&&n.indexOf("m")>-1)){let r=o.$head,i=r.textOffset?null:t<0?r.nodeBefore:r.nodeAfter,s;if(!i||i.isText)return!1;let a=t<0?r.pos-i.nodeSize:r.pos;return i.isAtom||(s=e.docView.descAt(a))&&!s.contentDOM?X.isSelectable(i)?Er(e,new X(t<0?e.state.doc.resolve(r.pos-i.nodeSize):r)):Er(e,new Z(e.state.doc.resolve(t<0?a:a+i.nodeSize))):!1}}else return!1;else{if(o instanceof X&&o.node.isInline)return Er(e,new Z(t>0?o.$to:o.$from));{let r=Cb(e.state,t);return r?Er(e,r):!1}}}function Ia(e,t){let n=e.pmViewDesc;return n?n.size==0&&(t<0||e.nextSibling||e.nodeName!="BR"):ee(e)&&e.contentEditable=="false"}function zi(e,t){return t<0?MO(e):$O(e)}function MO(e){let t=e.domSelectionRange(),n=t.focusNode,o=t.focusOffset;if(!n)return;let r,i,s=!1;for(Jt&&ee(n)&&o<$t(n)&&Ia(n.childNodes[o],-1)&&(s=!0);;)if(o>0){if(!ee(n))break;let a=n.childNodes[o-1];if(Ia(a,-1))r=n,i=--o;else if(dt(a))n=a,o=n.nodeValue.length;else break}else{if(v2(n))break;{let a=n.previousSibling;for(;a&&Ia(a,-1);)r=n.parentNode,i=St(a),a=a.previousSibling;if(a)n=a,o=$t(n);else{if(n=n.parentNode,n==e.dom)break;o=0}}}s?Tb(e,n,o):r&&Tb(e,r,i)}function $O(e){let t=e.domSelectionRange(),n=t.focusNode,o=t.focusOffset;if(!n)return;let r=$t(n),i,s;for(;;)if(o<r){if(!ee(n))break;let a=n.childNodes[o];if(Ia(a,1))i=n,s=++o;else break}else{if(v2(n))break;{let a=n.nextSibling;for(;a&&Ia(a,1);)i=a.parentNode,s=St(a)+1,a=a.nextSibling;if(a)n=a,o=0,r=$t(n);else{if(n=n.parentNode,n==e.dom)break;o=r=0}}}i&&Tb(e,i,s)}function v2(e){let t=e.pmViewDesc;return t&&t.node&&t.node.isBlock}function IO(e,t){for(;e&&t==e.childNodes.length&&!Ra(e);)t=St(e)+1,e=e.parentNode;for(;e&&t<e.childNodes.length;){let n=e.childNodes[t];if(dt(n))return n;if(ee(n)&&n.contentEditable=="false")break;e=n,t=0}}function DO(e,t){for(;e&&!t&&!Ra(e);)t=St(e),e=e.parentNode;for(;e&&t;){let n=e.childNodes[t-1];if(dt(n))return n;if(ee(n)&&n.contentEditable=="false")break;e=n,t=e.childNodes.length}}function Tb(e,t,n){if(!dt(t)){let i,s;(s=IO(t,n))?(t=s,n=0):(i=DO(t,n))&&(t=i,n=i.nodeValue.length)}let o=e.domSelection();if(!o)return;if(cd(o)){let i=document.createRange();i.setEnd(t,n),i.setStart(t,n),o.removeAllRanges(),o.addRange(i)}else o.extend&&o.extend(t,n);e.domObserver.setCurSelection();let{state:r}=e;setTimeout(()=>{e.state==r&&tr(e)},50)}function HE(e,t){let n=e.state.doc.resolve(t);if(!(_t||s2)&&n.parent.inlineContent){let r=e.coordsAtPos(t);if(t>n.start()){let i=e.coordsAtPos(t-1),s=(i.top+i.bottom)/2;if(s>r.top&&s<r.bottom&&Math.abs(i.left-r.left)>1)return i.left<r.left?"ltr":"rtl"}if(t<n.end()){let i=e.coordsAtPos(t+1),s=(i.top+i.bottom)/2;if(s>r.top&&s<r.bottom&&Math.abs(i.left-r.left)>1)return i.left>r.left?"ltr":"rtl"}}return getComputedStyle(e.dom).direction=="rtl"?"rtl":"ltr"}function qE(e,t,n){let o=e.state.selection;if(o instanceof Z&&!o.empty||n.indexOf("s")>-1||sn&&n.indexOf("m")>-1)return!1;let{$from:r,$to:i}=o;if(!r.parent.inlineContent||e.endOfTextblock(t<0?"up":"down")){let s=Cb(e.state,t);if(s&&s instanceof X)return Er(e,s)}if(!r.parent.inlineContent){let s=t<0?r:i,a=o instanceof Rt?Q.near(s,t):Q.findFrom(s,t);return a?Er(e,a):!1}return!1}function ZE(e,t){if(!(e.state.selection instanceof Z))return!0;let{$head:n,$anchor:o,empty:r}=e.state.selection;if(!n.sameParent(o))return!0;if(!r)return!1;if(e.endOfTextblock(t>0?"forward":"backward"))return!0;let i=!n.textOffset&&(t<0?n.nodeBefore:n.nodeAfter);if(i&&!i.isText){let s=e.state.tr;return t<0?s.delete(n.pos-i.nodeSize,n.pos):s.delete(n.pos,n.pos+i.nodeSize),e.dispatch(s),!0}return!1}function VE(e,t,n){e.domObserver.stop(),t.contentEditable=n,e.domObserver.start()}function NO(e){if(!It||e.state.selection.$head.parentOffset>0)return!1;let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(t&&ee(t)&&n==0&&t.firstChild&&ee(t.firstChild)&&t.firstChild.contentEditable=="false"){let o=t.firstChild;VE(e,o,"true"),setTimeout(()=>VE(e,o,"false"),20)}return!1}function zO(e){let t="";return e.ctrlKey&&(t+="c"),e.metaKey&&(t+="m"),e.altKey&&(t+="a"),e.shiftKey&&(t+="s"),t}function OO(e,t){let n=t.keyCode,o=zO(t);if(n==8||sn&&n==72&&o=="c")return ZE(e,-1)||zi(e,-1);if(n==46&&!t.shiftKey||sn&&n==68&&o=="c")return ZE(e,1)||zi(e,1);if(n==13||n==27)return!0;if(n==37||sn&&n==66&&o=="c"){let r=n==37?HE(e,e.state.selection.from)=="ltr"?-1:1:-1;return UE(e,r,o)||zi(e,r)}else if(n==39||sn&&n==70&&o=="c"){let r=n==39?HE(e,e.state.selection.from)=="ltr"?1:-1:1;return UE(e,r,o)||zi(e,r)}else{if(n==38||sn&&n==80&&o=="c")return qE(e,-1,o)||zi(e,-1);if(n==40||sn&&n==78&&o=="c")return NO(e)||qE(e,1,o)||zi(e,1);if(o==(sn?"m":"c")&&(n==66||n==73||n==89||n==90))return!0}return!1}function Fb(e,t){e.someProp("transformCopied",h=>{t=h(t,e)});let n=[],{content:o,openStart:r,openEnd:i}=t;for(;r>1&&i>1&&o.childCount==1&&o.firstChild.childCount==1;){r--,i--;let h=o.firstChild;n.push(h.type.name,h.attrs!=h.type.defaultAttrs?h.attrs:null),o=h.content}let s=e.someProp("clipboardSerializer")||Wn.fromSchema(e.state.schema),a=E2(),l=a.createElement("div");l.appendChild(s.serializeFragment(o,{document:a}));let u=l.firstChild,c,d=0;for(;u&&ee(u)&&(c=_2[u.nodeName.toLowerCase()]);){for(let h=c.length-1;h>=0;h--){let p=a.createElement(c[h]);for(;l.firstChild;)p.appendChild(l.firstChild);l.appendChild(p),d++}u=l.firstChild}u&&ee(u)&&u.setAttribute("data-pm-slice",`${r} ${i}${d?` -${d}`:""} ${JSON.stringify(n)}`);let f=e.someProp("clipboardTextSerializer",h=>h(t,e))||t.content.textBetween(0,t.content.size,`
`);return{dom:l,text:f,slice:t}}function x2(e,t,n,o,r){let i=r.parent.type.spec.code,s,a;if(!n&&!t)return null;let l=!!t&&(o||i||!n);if(l){if(e.someProp("transformPastedText",f=>{t=f(t,i||o,e)}),i)return a=new F(M.from(e.state.schema.text(t.replace(/\r\n?/g,`
`))),0,0),e.someProp("transformPasted",f=>{a=f(a,e,!0)}),a;let d=e.someProp("clipboardTextParser",f=>f(t,r,o,e));if(d)a=d;else{let f=r.marks(),{schema:h}=e.state,p=Wn.fromSchema(h);s=document.createElement("div"),t.split(/(?:\r\n?|\n)+/).forEach(m=>{let g=s.appendChild(document.createElement("p"));m&&g.appendChild(p.serializeNode(h.text(m,f)))})}}else e.someProp("transformPastedHTML",d=>{n=d(n,e)}),s=FO(n),dd&&jO(s);let u=s&&s.querySelector("[data-pm-slice]"),c=u&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(u.getAttribute("data-pm-slice")||"");if(c&&c[3])for(let d=+c[3];d>0;d--){let f=s.firstChild;for(;f&&!ee(f);)f=f.nextSibling;if(!f)break;s=f}if(a||(a=(e.someProp("clipboardParser")||e.someProp("domParser")||mn.fromSchema(e.state.schema)).parseSlice(s,{preserveWhitespace:!!(l||c),context:r,ruleFromNode(f){return f.nodeName=="BR"&&!f.nextSibling&&f.parentNode&&!RO.test(f.parentNode.nodeName)?{ignore:!0}:null}})),c)a=BO(WE(a,+c[1],+c[2]),c[4]);else if(a=F.maxOpen(PO(a.content,r),!0),a.openStart||a.openEnd){let d=0,f=0;for(let h=a.content.firstChild;d<a.openStart&&!h.type.spec.isolating;d++,h=h.firstChild);for(let h=a.content.lastChild;f<a.openEnd&&!h.type.spec.isolating;f++,h=h.lastChild);a=WE(a,d,f)}return e.someProp("transformPasted",d=>{a=d(a,e,l)}),a}var RO=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function PO(e,t){if(e.childCount<2)return e;for(let n=t.depth;n>=0;n--){let r=t.node(n).contentMatchAt(t.index(n)),i,s=[];if(e.forEach(a=>{if(!s)return;let l=r.findWrapping(a.type),u;if(!l)return s=null;if(u=s.length&&i.length&&w2(l,i,a,s[s.length-1],0))s[s.length-1]=u;else{s.length&&(s[s.length-1]=S2(s[s.length-1],i.length));let c=k2(a,l);s.push(c),r=r.matchType(c.type),i=l}}),s)return M.from(s)}return e}function k2(e,t,n=0){for(let o=t.length-1;o>=n;o--)e=t[o].create(null,M.from(e));return e}function w2(e,t,n,o,r){if(r<e.length&&r<t.length&&e[r]==t[r]){let i=w2(e,t,n,o.lastChild,r+1);if(i)return o.copy(o.content.replaceChild(o.childCount-1,i));if(o.contentMatchAt(o.childCount).matchType(r==e.length-1?n.type:e[r+1]))return o.copy(o.content.append(M.from(k2(n,e,r+1))))}}function S2(e,t){if(t==0)return e;let n=e.content.replaceChild(e.childCount-1,S2(e.lastChild,t-1)),o=e.contentMatchAt(e.childCount).fillBefore(M.empty,!0);return e.copy(n.append(o))}function Ab(e,t,n,o,r,i){let s=t<0?e.firstChild:e.lastChild,a=s.content;return e.childCount>1&&(i=0),r<o-1&&(a=Ab(a,t,n,o,r+1,i)),r>=n&&(a=t<0?s.contentMatchAt(0).fillBefore(a,i<=r).append(a):a.append(s.contentMatchAt(s.childCount).fillBefore(M.empty,!0))),e.replaceChild(t<0?0:e.childCount-1,s.copy(a))}function WE(e,t,n){return t<e.openStart&&(e=new F(Ab(e.content,-1,t,e.openStart,0,e.openEnd),t,e.openEnd)),n<e.openEnd&&(e=new F(Ab(e.content,1,n,e.openEnd,0,0),e.openStart,n)),e}var _2={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};function E2(){return document.implementation.createHTMLDocument("title")}var Ma=null;function LO(e){let t=window.trustedTypes;if(!t)return e;if(!Ma){if(Ma=t.defaultPolicy)try{return Ma.createHTML(e)}catch{}Ma=t.createPolicy("ProseMirrorClipboard",{createHTML:n=>n})}return Ma.createHTML(e)}function FO(e){let t=/^(\s*<meta [^>]*>)*/.exec(e);t&&(e=e.slice(t[0].length));let n=E2(),o=n.body,r=/<([a-z][^>\s]+)/i.exec(e),i;if((i=r&&_2[r[1].toLowerCase()])&&(e=i.map(s=>"<"+s+">").join("")+e+i.map(s=>"</"+s+">").reverse().join("")),o.innerHTML=LO(e),i)for(let s=0;s<i.length;s++)o=o.querySelector(i[s])||o;for(let s=0;s<n.styleSheets.length;s++){let a=n.styleSheets[s];for(let l=0;l<a.rules.length;l++){let u=a.rules[l];if(u instanceof CSSStyleRule){let c=o.querySelectorAll(u.selectorText);for(let d=0;d<c.length;d++)c[d].style.cssText+=u.style.cssText}}}return o}function jO(e){let t=e.querySelectorAll(_t?"span:not([class]):not([style])":"span.Apple-converted-space");for(let n=0;n<t.length;n++){let o=t[n];o.childNodes.length==1&&o.textContent=="\xA0"&&o.parentNode&&o.parentNode.replaceChild(e.ownerDocument.createTextNode(" "),o)}}function BO(e,t){if(!e.size)return e;let n=e.content.firstChild.type.schema,o;try{o=JSON.parse(t)}catch{return e}let{content:r,openStart:i,openEnd:s}=e;for(let a=o.length-2;a>=0;a-=2){let l=n.nodes[o[a]];if(!l||l.hasRequiredAttrs())break;try{r=M.from(l.create(o[a+1],r))}catch{break}i++,s++}return new F(r,i,s)}var Pt={},Lt={},UO={touchstart:!0,touchmove:!0},Mb=class{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:"",button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.badSafariComposition=!1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}};function HO(e){for(let t in Pt){let n=Pt[t];e.dom.addEventListener(t,e.input.eventHandlers[t]=o=>{ZO(e,o)&&!jb(e,o)&&(e.editable||!(o.type in Lt))&&n(e,o)},UO[t]?{passive:!0}:void 0)}It&&e.dom.addEventListener("input",()=>null),$b(e)}function er(e,t){e.input.lastSelectionOrigin=t,e.input.lastSelectionTime=Date.now()}function qO(e){e.input.mouseDown&&e.input.mouseDown.done(),e.domObserver.stop();for(let t in e.input.eventHandlers)e.dom.removeEventListener(t,e.input.eventHandlers[t]);clearTimeout(e.input.composingTimeout),clearTimeout(e.input.lastIOSEnterFallbackTimeout)}function $b(e){e.someProp("handleDOMEvents",t=>{for(let n in t)e.input.eventHandlers[n]||e.dom.addEventListener(n,e.input.eventHandlers[n]=o=>jb(e,o))})}function jb(e,t){return e.someProp("handleDOMEvents",n=>{let o=n[t.type];return o?o(e,t)||t.defaultPrevented:!1})}function ZO(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n=t.target;n!=e.dom;n=n.parentNode)if(!n||n.nodeType==11||n.pmViewDesc&&n.pmViewDesc.stopEvent(t))return!1;return!0}function VO(e,t){!jb(e,t)&&Pt[t.type]&&(e.editable||!(t.type in Lt))&&Pt[t.type](e,t)}Lt.keydown=(e,t)=>{let n=t;if(e.input.shiftKey=n.keyCode==16||n.shiftKey,!A2(e)&&(e.input.lastKeyCode=n.keyCode,e.input.lastKeyCodeTime=Date.now(),!(Yn&&_t&&n.keyCode==13)))if(n.keyCode!=229&&e.domObserver.forceFlush(),Pi&&n.keyCode==13&&!n.ctrlKey&&!n.altKey&&!n.metaKey){let o=Date.now();e.input.lastIOSEnter=o,e.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{e.input.lastIOSEnter==o&&(e.someProp("handleKeyDown",r=>r(e,lo(13,"Enter"))),e.input.lastIOSEnter=0)},200)}else e.someProp("handleKeyDown",o=>o(e,n))||OO(e,n)?n.preventDefault():er(e,"key")};Lt.keyup=(e,t)=>{t.keyCode==16&&(e.input.shiftKey=!1)};Lt.keypress=(e,t)=>{let n=t;if(A2(e)||!n.charCode||n.ctrlKey&&!n.altKey||sn&&n.metaKey)return;if(e.someProp("handleKeyPress",r=>r(e,n))){n.preventDefault();return}let o=e.state.selection;if(!(o instanceof Z)||!o.$from.sameParent(o.$to)){let r=String.fromCharCode(n.charCode),i=()=>e.state.tr.insertText(r).scrollIntoView();!/[\r\n]/.test(r)&&!e.someProp("handleTextInput",s=>s(e,o.$from.pos,o.$to.pos,r,i))&&e.dispatch(i()),n.preventDefault()}};function Pa(e){return{left:e.clientX,top:e.clientY}}function WO(e,t){let n=t.x-e.clientX,o=t.y-e.clientY;return n*n+o*o<100}function Bb(e,t,n,o,r){if(o==-1)return!1;let i=e.state.doc.resolve(o);for(let s=i.depth+1;s>0;s--)if(e.someProp(t,a=>s>i.depth?a(e,n,i.nodeAfter,i.before(s),r,!0):a(e,n,i.node(s),i.before(s),r,!1)))return!0;return!1}function La(e,t,n){if(e.focused||e.focus(),e.state.selection.eq(t))return;let o=e.state.tr.setSelection(t);o.setMeta("pointer",!0),e.dispatch(o)}function KO(e,t){if(t==-1)return!1;let n=e.state.doc.resolve(t),o=n.nodeAfter;return o&&o.isAtom&&X.isSelectable(o)?(La(e,new X(n)),!0):!1}function JO(e,t){if(t==-1)return!1;let n=e.state.selection,o,r;n instanceof X&&(o=n.node);let i=e.state.doc.resolve(t);for(let s=i.depth+1;s>0;s--){let a=s>i.depth?i.nodeAfter:i.node(s);if(X.isSelectable(a)){o&&n.$from.depth>0&&s>=n.$from.depth&&i.before(n.$from.depth+1)==n.$from.pos?r=i.before(n.$from.depth):r=i.before(s);break}}return r!=null?(La(e,X.create(e.state.doc,r)),!0):!1}function GO(e,t,n,o,r){return Bb(e,"handleClickOn",t,n,o)||e.someProp("handleClick",i=>i(e,t,o))||(r?JO(e,n):KO(e,n))}function QO(e,t,n,o){return Bb(e,"handleDoubleClickOn",t,n,o)||e.someProp("handleDoubleClick",r=>r(e,t,o))}function XO(e,t,n,o){return Bb(e,"handleTripleClickOn",t,n,o)||e.someProp("handleTripleClick",r=>r(e,t,o))||YO(e,n,o)}function YO(e,t,n){if(n.button!=0)return!1;let o=C2(e,t,!0),r=e.state.doc;return o?(La(e,o),o instanceof Z&&r.eq(e.state.doc)&&(e.input.mouseDown=new Db(e,o)),!0):!1}function C2(e,t,n){let o=e.state.doc;if(t==-1)return o.inlineContent?Z.create(o,0,o.content.size):null;let r=o.resolve(t);for(let i=r.depth+1;i>0;i--){let s=i>r.depth?r.nodeAfter:r.node(i),a=r.before(i);if(s.inlineContent)return Z.create(o,a+1,a+1+s.content.size);if(n&&X.isSelectable(s))return X.create(o,a)}return null}function Ub(e){return id(e)}var T2=sn?"metaKey":"ctrlKey";Pt.mousedown=(e,t)=>{let n=t;e.input.shiftKey=n.shiftKey;let o=Ub(e),r=Date.now(),i="singleClick";r-e.input.lastClick.time<500&&WO(n,e.input.lastClick)&&!n[T2]&&e.input.lastClick.button==n.button&&(e.input.lastClick.type=="singleClick"?i="doubleClick":e.input.lastClick.type=="doubleClick"&&(i="tripleClick")),e.input.lastClick={time:r,x:n.clientX,y:n.clientY,type:i,button:n.button},e.input.mouseDown&&e.input.mouseDown.done();let s=e.posAtCoords(Pa(n));s&&(i=="singleClick"?e.input.mouseDown=new Ib(e,s,n,!!o):(i=="doubleClick"?QO:XO)(e,s.pos,s.inside,n)?n.preventDefault():er(e,"pointer"))};var od=class{constructor(t){this.view=t,this.mightDrag=null,t.root.addEventListener("mouseup",this.up=this.up.bind(this)),t.root.addEventListener("mousemove",this.move=this.move.bind(this))}up(t){this.done()}move(t){t.buttons==0&&this.done()}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.view.input.mouseDown==this&&(this.view.input.mouseDown=null)}delaySelUpdate(){return!1}},Ib=class extends od{constructor(t,n,o,r){super(t),this.pos=n,this.event=o,this.flushed=r,this.delayedSelectionSync=!1,this.startDoc=t.state.doc,this.selectNode=!!o[T2],this.allowDefault=o.shiftKey;let i,s;if(n.inside>-1)i=t.state.doc.nodeAt(n.inside),s=n.inside;else{let c=t.state.doc.resolve(n.pos);i=c.parent,s=c.depth?c.before():0}let a=r?null:o.target,l=a?t.docView.nearestDesc(a,!0):null;this.target=l&&ee(l.nodeDOM)?l.nodeDOM:null;let{selection:u}=t.state;o.button==0&&(i.type.spec.draggable&&i.type.spec.selectable!==!1||u instanceof X&&u.from<=s&&u.to>s)&&(this.mightDrag={node:i,pos:s,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&Jt&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),er(t,"pointer")}done(){super.done(),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>{this.view.isDestroyed||tr(this.view)})}up(t){if(this.done(),!this.view.dom.contains(t.target))return;let n=this.pos;this.view.state.doc!=this.startDoc&&(n=this.view.posAtCoords(Pa(t))),this.updateAllowDefault(t),this.allowDefault||!n?er(this.view,"pointer"):GO(this.view,n.pos,n.inside,t,this.selectNode)?t.preventDefault():t.button==0&&(this.flushed||It&&this.mightDrag&&!this.mightDrag.node.isAtom||_t&&!this.view.state.selection.visible&&Math.min(Math.abs(n.pos-this.view.state.selection.from),Math.abs(n.pos-this.view.state.selection.to))<=2)?(La(this.view,Q.near(this.view.state.doc.resolve(n.pos))),t.preventDefault()):er(this.view,"pointer")}move(t){this.updateAllowDefault(t),er(this.view,"pointer"),super.move(t)}updateAllowDefault(t){!this.allowDefault&&(Math.abs(this.event.x-t.clientX)>4||Math.abs(this.event.y-t.clientY)>4)&&(this.allowDefault=!0)}delaySelUpdate(){return this.allowDefault?(this.delayedSelectionSync=!0,!0):!1}},Db=class extends od{constructor(t,n){super(t),this.startSelection=n,this.startDoc=t.state.doc}move(t){if(t.buttons==0||this.view.isDestroyed||!this.view.state.doc.eq(this.startDoc)){this.done();return}t.preventDefault(),er(this.view,"pointer");let n=this.view.posAtCoords(Pa(t)),o=n&&C2(this.view,n.inside,!1);if(!o)return;let{doc:r}=this.view.state,i=this.startSelection,[s,a]=o.from<i.from?[i.to,o.from]:[i.from,o.to];La(this.view,Z.create(r,s,a))}};Pt.touchstart=e=>{e.input.lastTouch=Date.now(),Ub(e),er(e,"pointer")};Pt.touchmove=e=>{e.input.lastTouch=Date.now(),er(e,"pointer")};Pt.contextmenu=e=>Ub(e);function A2(e,t){return e.composing?!0:It&&Math.abs(Date.now()-e.input.compositionEndedAt)<500?(e.input.compositionEndedAt=-2e8,!0):!1}var eR=Yn?5e3:-1;Lt.compositionstart=Lt.compositionupdate=e=>{if(!e.composing){e.domObserver.flush();let{state:t}=e,n=t.selection.$to;if(t.selection instanceof Z&&t.selection.empty&&(t.storedMarks||!n.textOffset&&n.parentOffset&&n.nodeBefore.marks.some(o=>o.type.spec.inclusive===!1)||_t&&s2&&tR(e)))e.markCursor=e.state.storedMarks||n.marks(),id(e,!0),e.markCursor=null;else if(id(e,!t.selection.empty),Jt&&t.selection.empty&&n.parentOffset&&!n.textOffset&&n.nodeBefore.marks.length){let o=e.domSelectionRange();for(let r=o.focusNode,i=o.focusOffset;r&&ee(r)&&i!=0;){let s=i<0?r.lastChild:r.childNodes[i-1];if(!s)break;if(dt(s)){let a=e.domSelection();a&&a.collapse(s,s.nodeValue.length);break}else r=s,i=-1}}e.input.composing=!0}M2(e,eR)};function tR(e){let{focusNode:t,focusOffset:n}=e.domSelectionRange();if(!t||!ee(t)||n>=t.childNodes.length)return!1;let o=t.childNodes[n];return ee(o)&&o.contentEditable=="false"}Lt.compositionend=(e,t)=>{e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=Date.now(),e.input.compositionPendingChanges=e.domObserver.pendingRecords().length?e.input.compositionID:0,e.input.compositionNode=null,e.input.badSafariComposition?e.domObserver.forceFlush():e.input.compositionPendingChanges&&Promise.resolve().then(()=>e.domObserver.flush()),e.input.compositionID++,M2(e,20))};function M2(e,t){clearTimeout(e.input.composingTimeout),t>-1&&(e.input.composingTimeout=setTimeout(()=>id(e),t))}function $2(e){for(e.composing&&(e.input.composing=!1,e.input.compositionEndedAt=Date.now());e.input.compositionNodes.length>0;)e.input.compositionNodes.pop().markParentsDirty()}function nR(e){let t=e.domSelectionRange();if(!t.focusNode)return null;let n=Yz(t.focusNode,t.focusOffset),o=eO(t.focusNode,t.focusOffset);if(n&&o&&n!=o){let r=o.pmViewDesc,i=e.domObserver.lastChangedTextNode;if(n==i||o==i)return i;if(!r||!r.isText(o.nodeValue))return o;if(e.input.compositionNode==o){let s=n.pmViewDesc;if(!(!s||!s.isText(n.nodeValue)))return o}}return n||o}function id(e,t=!1){if(!(Yn&&e.domObserver.flushingSoon>=0)){if(e.domObserver.forceFlush(),$2(e),t||e.docView&&e.docView.dirty){let n=Pb(e),o=e.state.selection;return n&&!n.eq(o)?e.dispatch(e.state.tr.setSelection(n)):(e.markCursor||t)&&!o.$from.node(o.$from.sharedDepth(o.to)).inlineContent?e.dispatch(e.state.tr.deleteSelection()):e.updateState(e.state),!0}return!1}}function rR(e,t){if(!e.dom.parentNode)return;let n=e.dom.parentNode.appendChild(document.createElement("div"));n.appendChild(t),n.style.cssText="position: fixed; left: -10000px; top: 10px";let o=getSelection(),r=document.createRange();r.selectNodeContents(t),e.dom.blur(),o.removeAllRanges(),o.addRange(r),setTimeout(()=>{n.parentNode&&n.parentNode.removeChild(n),e.focus()},50)}var Da=qt&&Cr<15||Pi&&oO<604;Pt.copy=Lt.cut=(e,t)=>{let n=t,o=e.state.selection,r=n.type=="cut";if(o.empty)return;let i=Da?null:n.clipboardData,s=o.content(),{dom:a,text:l}=Fb(e,s);i?(n.preventDefault(),i.clearData(),i.setData("text/html",a.innerHTML),i.setData("text/plain",l)):rR(e,a),r&&e.dispatch(e.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function oR(e){return e.openStart==0&&e.openEnd==0&&e.content.childCount==1?e.content.firstChild:null}function iR(e,t){if(!e.dom.parentNode)return;let n=e.input.shiftKey||e.state.selection.$from.parent.type.spec.code,o=e.dom.parentNode.appendChild(document.createElement(n?"textarea":"div"));n||(o.contentEditable="true"),o.style.cssText="position: fixed; left: -10000px; top: 10px",o.focus();let r=e.input.shiftKey&&e.input.lastKeyCode!=45;setTimeout(()=>{e.focus(),o.parentNode&&o.parentNode.removeChild(o),n?Na(e,o.value,null,r,t):Na(e,o.textContent,o.innerHTML,r,t)},50)}function Na(e,t,n,o,r){let i=x2(e,t,n,o,e.state.selection.$from);if(e.someProp("handlePaste",l=>l(e,r,i||F.empty)))return!0;if(!i)return!1;let s=oR(i),a=s?e.state.tr.replaceSelectionWith(s,o):e.state.tr.replaceSelection(i);return e.dispatch(a.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function I2(e){let t=e.getData("text/plain")||e.getData("Text");if(t)return t;let n=e.getData("text/uri-list");return n?n.replace(/\r?\n/g," "):""}Lt.paste=(e,t)=>{let n=t;if(e.composing&&!Yn)return;let o=Da?null:n.clipboardData,r=e.input.shiftKey&&e.input.lastKeyCode!=45;o&&Na(e,I2(o),o.getData("text/html"),r,n)?n.preventDefault():iR(e,n)};var sd=class{constructor(t,n,o){this.slice=t,this.move=n,this.node=o}},sR=sn?"altKey":"ctrlKey";function D2(e,t){let n;return e.someProp("dragCopies",o=>{n=n||o(t)}),n!=null?!n:!t[sR]}Pt.dragstart=(e,t)=>{let n=t,o=e.input.mouseDown;if(o&&o.done(),!n.dataTransfer)return;let r=e.state.selection,i=r.empty?null:e.posAtCoords(Pa(n)),s;if(!(i&&i.pos>=r.from&&i.pos<=(r instanceof X?r.to-1:r.to))){if(o&&o.mightDrag)s=X.create(e.state.doc,o.mightDrag.pos);else if(n.target&&ee(n.target)){let d=e.docView.nearestDesc(n.target,!0);d&&d.node.type.spec.draggable&&d!=e.docView&&(s=X.create(e.state.doc,d.posBefore))}}let a=(s||e.state.selection).content(),{dom:l,text:u,slice:c}=Fb(e,a);(!n.dataTransfer.files.length||!_t||i2>120)&&n.dataTransfer.clearData(),n.dataTransfer.setData(Da?"Text":"text/html",l.innerHTML),n.dataTransfer.effectAllowed="copyMove",Da||n.dataTransfer.setData("text/plain",u),e.dragging=new sd(c,D2(e,n),s)};Pt.dragend=e=>{let t=e.dragging;window.setTimeout(()=>{e.dragging==t&&(e.dragging=null)},50)};Lt.dragover=Lt.dragenter=(e,t)=>t.preventDefault();Lt.drop=(e,t)=>{try{aR(e,t,e.dragging)}finally{e.dragging=null}};function aR(e,t,n){if(!t.dataTransfer)return;let o=e.posAtCoords(Pa(t));if(!o)return;let r=e.state.doc.resolve(o.pos),i=n&&n.slice;i?e.someProp("transformPasted",h=>{i=h(i,e,!1)}):i=x2(e,I2(t.dataTransfer),Da?null:t.dataTransfer.getData("text/html"),!1,r);let s=!!(n&&D2(e,t));if(e.someProp("handleDrop",h=>h(e,t,i||F.empty,s))){t.preventDefault();return}if(!i)return;t.preventDefault();let a=i?Jc(e.state.doc,r.pos,i):r.pos;a==null&&(a=r.pos);let l=e.state.tr;if(s){let{node:h}=n;h?h.replace(l):l.deleteSelection()}let u=l.mapping.map(a),c=i.openStart==0&&i.openEnd==0&&i.content.childCount==1,d=l.doc;if(c?l.replaceRangeWith(u,u,i.content.firstChild):l.replaceRange(u,u,i),l.doc.eq(d))return;let f=l.doc.resolve(u);if(c&&X.isSelectable(i.content.firstChild)&&f.nodeAfter&&f.nodeAfter.sameMarkup(i.content.firstChild))l.setSelection(new X(f));else{let h=l.mapping.map(a);l.mapping.maps[l.mapping.maps.length-1].forEach((p,m,g,b)=>h=b),l.setSelection(Lb(e,f,l.doc.resolve(h)))}e.focus(),e.dispatch(l.setMeta("uiEvent","drop"))}Pt.focus=e=>{e.input.lastFocus=Date.now(),e.focused||(e.domObserver.stop(),e.dom.classList.add("ProseMirror-focused"),e.domObserver.start(),e.focused=!0,setTimeout(()=>{e.docView&&e.hasFocus()&&!e.domObserver.currentSelection.eq(e.domSelectionRange())&&tr(e)},20))};Pt.blur=(e,t)=>{let n=t;e.focused&&(e.domObserver.stop(),e.dom.classList.remove("ProseMirror-focused"),e.domObserver.start(),n.relatedTarget&&e.dom.contains(n.relatedTarget)&&e.domObserver.currentSelection.clear(),e.focused=!1)};Pt.beforeinput=(e,t)=>{if(Yn&&t.inputType=="deleteContentBackward"){e.domObserver.flushSoon();let{domChangeCount:o}=e.input;setTimeout(()=>{if(e.input.domChangeCount!=o||(e.dom.blur(),e.focus(),e.someProp("handleKeyDown",i=>i(e,lo(8,"Backspace")))))return;let{$cursor:r}=e.state.selection;r&&r.pos>0&&e.dispatch(e.state.tr.delete(r.pos-1,r.pos).scrollIntoView())},50)}};for(let e in Lt)Pt[e]=Lt[e];function za(e,t){if(e==t)return!0;for(let n in e)if(e[n]!==t[n])return!1;for(let n in t)if(!(n in e))return!1;return!0}var ad=class e{constructor(t,n){this.toDOM=t,this.spec=n||ho,this.side=this.spec.side||0}map(t,n,o,r){let{pos:i,deleted:s}=t.mapResult(n.from+r,this.side<0?-1:1);return s?null:new ft(i-o,i-o,this)}valid(){return!0}eq(t){return this==t||t instanceof e&&(this.spec.key&&this.spec.key==t.spec.key||this.toDOM==t.toDOM&&za(this.spec,t.spec))}destroy(t){this.spec.destroy&&this.spec.destroy(t)}},po=class e{constructor(t,n){this.attrs=t,this.spec=n||ho}map(t,n,o,r){let i=t.map(n.from+r,this.spec.inclusiveStart?-1:1)-o,s=t.map(n.to+r,this.spec.inclusiveEnd?1:-1)-o;return i>=s?null:new ft(i,s,this)}valid(t,n){return n.from<n.to}eq(t){return this==t||t instanceof e&&za(this.attrs,t.attrs)&&za(this.spec,t.spec)}static is(t){return t.type instanceof e}destroy(){}},Nb=class e{constructor(t,n){this.attrs=t,this.spec=n||ho}map(t,n,o,r){let i=t.mapResult(n.from+r,1);if(i.deleted)return null;let s=t.mapResult(n.to+r,-1);return s.deleted||s.pos<=i.pos?null:new ft(i.pos-o,s.pos-o,this)}valid(t,n){let{index:o,offset:r}=t.content.findIndex(n.from),i;return r==n.from&&!(i=t.child(o)).isText&&r+i.nodeSize==n.to}eq(t){return this==t||t instanceof e&&za(this.attrs,t.attrs)&&za(this.spec,t.spec)}destroy(){}},ft=class e{constructor(t,n,o){this.from=t,this.to=n,this.type=o}copy(t,n){return new e(t,n,this.type)}eq(t,n=0){return this.type.eq(t.type)&&this.from+n==t.from&&this.to+n==t.to}map(t,n,o){return this.type.map(t,this,n,o)}static widget(t,n,o){return new e(t,t,new ad(n,o))}static inline(t,n,o,r){return new e(t,n,new po(o,r))}static node(t,n,o,r){return new e(t,n,new Nb(o,r))}get spec(){return this.type.spec}get inline(){return this.type instanceof po}get widget(){return this.type instanceof ad}},Oi=[],ho={},Te=class e{constructor(t,n){this.local=t.length?t:Oi,this.children=n.length?n:Oi}static create(t,n){return n.length?ud(n,t,0,ho):Mt}find(t,n,o){let r=[];return this.findInner(t??0,n??1e9,r,0,o),r}findInner(t,n,o,r,i){for(let s=0;s<this.local.length;s++){let a=this.local[s];a.from<=n&&a.to>=t&&(!i||i(a.spec))&&o.push(a.copy(a.from+r,a.to+r))}for(let s=0;s<this.children.length;s+=3)if(this.children[s]<n&&this.children[s+1]>t){let a=this.children[s]+1;this.children[s+2].findInner(t-a,n-a,o,r+a,i)}}map(t,n,o){return this==Mt||t.maps.length==0?this:this.mapInner(t,n,0,0,o||ho)}mapInner(t,n,o,r,i){let s;for(let a=0;a<this.local.length;a++){let l=this.local[a].map(t,o,r);l&&l.type.valid(n,l)?(s||(s=[])).push(l):i.onRemove&&i.onRemove(this.local[a].spec)}return this.children.length?lR(this.children,s||[],t,n,o,r,i):s?new e(s.sort(mo),Oi):Mt}add(t,n){return n.length?this==Mt?e.create(t,n):this.addInner(t,n,0):this}addInner(t,n,o){let r,i=0;t.forEach((a,l)=>{let u=l+o,c;if(c=z2(n,a,u)){for(r||(r=this.children.slice());i<r.length&&r[i]<l;)i+=3;r[i]==l?r[i+2]=r[i+2].addInner(a,c,u+1):r.splice(i,0,l,l+a.nodeSize,ud(c,a,u+1,ho)),i+=3}});let s=N2(i?O2(n):n,-o);for(let a=0;a<s.length;a++)s[a].type.valid(t,s[a])||s.splice(a--,1);return new e(s.length?this.local.concat(s).sort(mo):this.local,r||this.children)}remove(t){return t.length==0||this==Mt?this:this.removeInner(t,0)}removeInner(t,n){let o=this.children,r=this.local;for(let i=0;i<o.length;i+=3){let s,a=o[i]+n,l=o[i+1]+n;for(let c=0,d;c<t.length;c++)(d=t[c])&&d.from>a&&d.to<l&&(t[c]=null,(s||(s=[])).push(d));if(!s)continue;o==this.children&&(o=this.children.slice());let u=o[i+2].removeInner(s,a+1);u!=Mt?o[i+2]=u:(o.splice(i,3),i-=3)}if(r.length){for(let i=0,s;i<t.length;i++)if(s=t[i])for(let a=0;a<r.length;a++)r[a].eq(s,n)&&(r==this.local&&(r=this.local.slice()),r.splice(a--,1))}return o==this.children&&r==this.local?this:r.length||o.length?new e(r,o):Mt}forChild(t,n){if(this==Mt)return this;if(n.isLeaf)return e.empty;let o,r;for(let a=0;a<this.children.length;a+=3)if(this.children[a]>=t){this.children[a]==t&&(o=this.children[a+2]);break}let i=t+1,s=i+n.content.size;for(let a=0;a<this.local.length;a++){let l=this.local[a];if(l.from<s&&l.to>i&&l.type instanceof po){let u=Math.max(i,l.from)-i,c=Math.min(s,l.to)-i;u<c&&(r||(r=[])).push(l.copy(u,c))}}if(r){let a=new e(r.sort(mo),Oi);return o?new ld([a,o]):a}return o||Mt}eq(t){if(this==t)return!0;if(!(t instanceof e)||this.local.length!=t.local.length||this.children.length!=t.children.length)return!1;for(let n=0;n<this.local.length;n++)if(!this.local[n].eq(t.local[n]))return!1;for(let n=0;n<this.children.length;n+=3)if(this.children[n]!=t.children[n]||this.children[n+1]!=t.children[n+1]||!this.children[n+2].eq(t.children[n+2]))return!1;return!0}locals(t){return Hb(this.localsInner(t))}localsInner(t){if(this==Mt)return Oi;if(t.inlineContent||!this.local.some(po.is))return this.local;let n=[];for(let o=0;o<this.local.length;o++)this.local[o].type instanceof po||n.push(this.local[o]);return n}forEachSet(t){t(this)}};Te.empty=new Te([],[]);Te.removeOverlap=Hb;var Mt=Te.empty,ld=class e{constructor(t){this.members=t}map(t,n){let o=this.members.map(r=>r.map(t,n,ho));return e.from(o)}forChild(t,n){if(n.isLeaf)return Te.empty;let o=[];for(let r=0;r<this.members.length;r++){let i=this.members[r].forChild(t,n);i!=Mt&&(i instanceof e?o=o.concat(i.members):o.push(i))}return e.from(o)}eq(t){if(!(t instanceof e)||t.members.length!=this.members.length)return!1;for(let n=0;n<this.members.length;n++)if(!this.members[n].eq(t.members[n]))return!1;return!0}locals(t){let n,o=!0;for(let r=0;r<this.members.length;r++){let i=this.members[r].localsInner(t);if(i.length)if(!n)n=i;else{o&&(n=n.slice(),o=!1);for(let s=0;s<i.length;s++)n.push(i[s])}}return n?Hb(o?n:n.sort(mo)):Oi}static from(t){switch(t.length){case 0:return Mt;case 1:return t[0];default:return new e(t.every(n=>n instanceof Te)?t:t.reduce((n,o)=>n.concat(o instanceof Te?o:o.members),[]))}}forEachSet(t){for(let n=0;n<this.members.length;n++)this.members[n].forEachSet(t)}};function lR(e,t,n,o,r,i,s){let a=e.slice();for(let u=0,c=i;u<n.maps.length;u++){let d=0;n.maps[u].forEach((f,h,p,m)=>{let g=m-p-(h-f);for(let b=0;b<a.length;b+=3){let y=a[b+1];if(y<0||f>y+c-d)continue;let k=a[b]+c-d;h>=k?a[b+1]=f<=k?-2:-1:f>=c&&g&&(a[b]+=g,a[b+1]+=g)}d+=g}),c=n.maps[u].map(c,-1)}let l=!1;for(let u=0;u<a.length;u+=3)if(a[u+1]<0){if(a[u+1]==-2){l=!0,a[u+1]=-1;continue}let c=n.map(e[u]+i),d=c-r;if(d<0||d>=o.content.size){l=!0;continue}let f=n.map(e[u+1]+i,-1),h=f-r,{index:p,offset:m}=o.content.findIndex(d),g=o.maybeChild(p);if(g&&m==d&&m+g.nodeSize==h){let b=a[u+2].mapInner(n,g,c+1,e[u]+i+1,s);b!=Mt?(a[u]=d,a[u+1]=h,a[u+2]=b):(a[u+1]=-2,l=!0)}else l=!0}if(l){let u=uR(a,e,t,n,r,i,s),c=ud(u,o,0,s);t=c.local;for(let d=0;d<a.length;d+=3)a[d+1]<0&&(a.splice(d,3),d-=3);for(let d=0,f=0;d<c.children.length;d+=3){let h=c.children[d];for(;f<a.length&&a[f]<h;)f+=3;a.splice(f,0,c.children[d],c.children[d+1],c.children[d+2])}}return new Te(t.sort(mo),a)}function N2(e,t){if(!t||!e.length)return e;let n=[];for(let o=0;o<e.length;o++){let r=e[o];n.push(new ft(r.from+t,r.to+t,r.type))}return n}function uR(e,t,n,o,r,i,s){function a(l,u){for(let c=0;c<l.local.length;c++){let d=l.local[c].map(o,r,u);d?n.push(d):s.onRemove&&s.onRemove(l.local[c].spec)}for(let c=0;c<l.children.length;c+=3)a(l.children[c+2],l.children[c]+u+1)}for(let l=0;l<e.length;l+=3)e[l+1]==-1&&a(e[l+2],t[l]+i+1);return n}function z2(e,t,n){if(t.isLeaf)return null;let o=n+t.nodeSize,r=null;for(let i=0,s;i<e.length;i++)(s=e[i])&&s.from>n&&s.to<o&&((r||(r=[])).push(s),e[i]=null);return r}function O2(e){let t=[];for(let n=0;n<e.length;n++)e[n]!=null&&t.push(e[n]);return t}function ud(e,t,n,o){let r=[],i=!1;t.forEach((a,l)=>{let u=z2(e,a,l+n);if(u){i=!0;let c=ud(u,a,n+l+1,o);c!=Mt&&r.push(l,l+a.nodeSize,c)}});let s=N2(i?O2(e):e,-n).sort(mo);for(let a=0;a<s.length;a++)s[a].type.valid(t,s[a])||(o.onRemove&&o.onRemove(s[a].spec),s.splice(a--,1));return s.length||r.length?new Te(s,r):Mt}function mo(e,t){return e.from-t.from||e.to-t.to}function Hb(e){let t=e;for(let n=0;n<t.length-1;n++){let o=t[n];if(o.from!=o.to)for(let r=n+1;r<t.length;r++){let i=t[r];if(i.from==o.from){i.to!=o.to&&(t==e&&(t=e.slice()),t[r]=i.copy(i.from,o.to),KE(t,r+1,i.copy(o.to,i.to)));continue}else{i.from<o.to&&(t==e&&(t=e.slice()),t[n]=o.copy(o.from,i.from),KE(t,r,o.copy(i.from,o.to)));break}}}return t}function KE(e,t,n){for(;t<e.length&&mo(n,e[t])>0;)t++;e.splice(t,0,n)}function hb(e){let t=[];return e.someProp("decorations",n=>{let o=n(e.state);o&&o!=Mt&&t.push(o)}),e.cursorWrapper&&t.push(Te.create(e.state.doc,[e.cursorWrapper.deco])),ld.from(t)}var cR={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},dR=qt&&Cr<=11,zb=class{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(t){this.anchorNode=t.anchorNode,this.anchorOffset=t.anchorOffset,this.focusNode=t.focusNode,this.focusOffset=t.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(t){return t.anchorNode==this.anchorNode&&t.anchorOffset==this.anchorOffset&&t.focusNode==this.focusNode&&t.focusOffset==this.focusOffset}},Ob=class{constructor(t,n){this.view=t,this.handleDOMChange=n,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new zb,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(o=>{for(let r=0;r<o.length;r++)this.queue.push(o[r]);qt&&Cr<=11&&o.some(r=>r.type=="childList"&&r.removedNodes.length||r.type=="characterData"&&r.oldValue.length>r.target.nodeValue.length)?this.flushSoon():It&&t.composing&&o.some(r=>r.type=="childList"&&r.target.nodeName=="TR")?(t.input.badSafariComposition=!0,this.flushSoon()):this.flush()}),dR&&(this.onCharData=o=>{this.queue.push({target:o.target,type:"characterData",oldValue:o.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,cR)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let t=this.observer.takeRecords();if(t.length){for(let n=0;n<t.length;n++)this.queue.push(t[n]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(BE(this.view)){if(this.suppressingSelectionUpdates)return tr(this.view);if(qt&&Cr<=11&&!this.view.state.selection.empty){let t=this.view.domSelectionRange();if(t.focusNode&&go(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(t){if(!t.focusNode)return!0;let n=new Set,o;for(let i=t.focusNode;i;i=Ri(i))n.add(i);for(let i=t.anchorNode;i;i=Ri(i))if(n.has(i)){o=i;break}let r=o&&this.view.docView.nearestDesc(o);if(r&&r.ignoreMutation({type:"selection",target:dt(o)?o.parentNode:o}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let t of this.observer.takeRecords())this.queue.push(t);return this.queue}flush(){let{view:t}=this;if(!t.docView||this.flushingSoon>-1)return;let n=this.pendingRecords();n.length&&(this.queue=[]);let o=t.domSelectionRange(),r=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(o)&&BE(t)&&!this.ignoreSelectionChange(o),i=-1,s=-1,a=!1,l=[];if(t.editable)for(let c=0;c<n.length;c++){let d=this.registerMutation(n[c],l);d&&(i=i<0?d.from:Math.min(d.from,i),s=s<0?d.to:Math.max(d.to,s),d.typeOver&&(a=!0))}if(l.some(c=>c.nodeName=="BR")&&(t.input.lastKeyCode==8||t.input.lastKeyCode==46||_t&&(t.composing||t.input.compositionEndedAt>Date.now()-50)&&n.some(c=>c.type=="childList"&&c.removedNodes.length))){for(let c of l)if(c.nodeName=="BR"&&c.parentNode){let d=c.nextSibling;for(;d&&ee(d);){if(d.contentEditable=="false"){c.parentNode.removeChild(c);break}d=d.firstChild}}}else if(Jt&&l.length){let c=l.filter(d=>d.nodeName=="BR");if(c.length==2){let[d,f]=c;d.parentNode&&d.parentNode.parentNode==f.parentNode?f.remove():d.remove()}else{let{focusNode:d}=this.currentSelection;for(let f of c){let h=f.parentNode;h&&h.nodeName=="LI"&&(!d||hR(t,d)!=h)&&f.remove()}}}let u=null;i<0&&r&&t.input.lastFocus>Date.now()-200&&Math.max(t.input.lastTouch,t.input.lastClick.time)<Date.now()-300&&cd(o)&&(u=Pb(t))&&u.eq(Q.near(t.state.doc.resolve(0),1))?(t.input.lastFocus=0,tr(t),this.currentSelection.set(o),t.scrollToSelection()):(i>-1||r)&&(i>-1&&(t.docView.markDirty(i,s),fR(t)),t.input.badSafariComposition&&(t.input.badSafariComposition=!1,mR(t,l)),this.handleDOMChange(i,s,a,l),t.docView&&t.docView.dirty?t.updateState(t.state):this.currentSelection.eq(o)||tr(t),this.currentSelection.set(o))}registerMutation(t,n){if(n.indexOf(t.target)>-1)return null;let o=this.view.docView.nearestDesc(t.target);if(t.type=="attributes"&&(o==this.view.docView||t.attributeName=="contenteditable"||t.attributeName=="style"&&!t.oldValue&&!t.target.getAttribute("style"))||!o||o.ignoreMutation(t))return null;if(t.type=="childList"){for(let c=0;c<t.addedNodes.length;c++){let d=t.addedNodes[c];n.push(d),dt(d)&&(this.lastChangedTextNode=d)}if(o.contentDOM&&o.contentDOM!=o.dom&&!o.contentDOM.contains(t.target))return{from:o.posBefore,to:o.posAfter};let r=t.previousSibling,i=t.nextSibling;if(qt&&Cr<=11&&t.addedNodes.length)for(let c=0;c<t.addedNodes.length;c++){let{previousSibling:d,nextSibling:f}=t.addedNodes[c];(!d||Array.prototype.indexOf.call(t.addedNodes,d)<0)&&(r=d),(!f||Array.prototype.indexOf.call(t.addedNodes,f)<0)&&(i=f)}let s=r&&r.parentNode==t.target?St(r)+1:0,a=o.localPosFromDOM(t.target,s,-1),l=i&&i.parentNode==t.target?St(i):t.target.childNodes.length,u=o.localPosFromDOM(t.target,l,1);return{from:a,to:u}}else return t.type=="attributes"?{from:o.posAtStart-o.border,to:o.posAtEnd+o.border}:(this.lastChangedTextNode=t.target,{from:o.posAtStart,to:o.posAtEnd,typeOver:t.target.nodeValue==t.oldValue})}},JE=new WeakMap,GE=!1;function fR(e){if(!JE.has(e)&&(JE.set(e,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(e.dom).whiteSpace)!==-1)){if(e.requiresGeckoHackNode=Jt,GE)return;console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."),GE=!0}}function QE(e,t){let n=t.startContainer,o=t.startOffset,r=t.endContainer,i=t.endOffset,s=e.domAtPos(e.state.selection.anchor);return go(s.node,s.offset,r,i)&&([n,o,r,i]=[r,i,n,o]),{anchorNode:n,anchorOffset:o,focusNode:r,focusOffset:i}}function pR(e,t){if(t.getComposedRanges){let r=t.getComposedRanges(e.root)[0];if(r)return QE(e,r)}let n;function o(r){r.preventDefault(),r.stopImmediatePropagation(),n=r.getTargetRanges()[0]}return e.dom.addEventListener("beforeinput",o,!0),document.execCommand("indent"),e.dom.removeEventListener("beforeinput",o,!0),n?QE(e,n):null}function hR(e,t){for(let n=t.parentNode;n&&n!=e.dom;n=n.parentNode){let o=e.docView.nearestDesc(n,!0);if(o&&o.node.isBlock)return n}return null}function mR(e,t){var n;let{focusNode:o,focusOffset:r}=e.domSelectionRange();for(let i of t)if(((n=i.parentNode)===null||n===void 0?void 0:n.nodeName)=="TR"){let s=i.nextSibling;for(;s&&s.nodeName!="TD"&&s.nodeName!="TH";)s=s.nextSibling;if(s){let a=s;for(;;){let l=a.firstChild;if(!l||!ee(l)||l.contentEditable=="false"||/^(BR|IMG)$/.test(l.nodeName))break;a=l}a.insertBefore(i,a.firstChild),o==i&&e.domSelection().collapse(i,r)}else i.parentNode.removeChild(i)}}function gR(e,t,n,o){let{node:r,fromOffset:i,toOffset:s,from:a,to:l}=e.docView.parseRange(t,n),u=e.domSelectionRange(),c,d=u.anchorNode;if(d&&bo(e.dom,d)&&(c=[{node:d,offset:u.anchorOffset}],cd(u)||c.push({node:u.focusNode,offset:u.focusOffset})),_t&&e.input.lastKeyCode===8)for(let b=s;b>i;b--){let y=r.childNodes[b-1],k=y.pmViewDesc;if(y.nodeName=="BR"&&!k){s=b;break}if(!k||k.size)break}let f=e.state.doc,h=e.someProp("domParser")||mn.fromSchema(e.state.schema),p=f.resolve(a),m=null,g=h.parse(r,{topNode:p.parent,topMatch:p.parent.contentMatchAt(p.index()),topOpen:!0,from:i,to:s,preserveWhitespace:p.parent.type.whitespace=="pre"?"full":!0,findPositions:c,ruleFromNode:bR(o),context:p});if(c&&c[0].pos!=null){let b=c[0].pos,y=c[1]&&c[1].pos;y==null&&(y=b),m={anchor:b+a,head:y+a}}return{doc:g,sel:m,from:a,to:l}}var bR=e=>t=>{let n=t.pmViewDesc;if(n)return n.parseRule(e);if(t.nodeName=="BR"&&t.parentNode){if(It&&/^(ul|ol)$/i.test(t.parentNode.nodeName)){let o=document.createElement("div");return o.appendChild(document.createElement("li")),{skip:o}}else if(t.parentNode.lastChild==t||It&&/^(tr|table)$/i.test(t.parentNode.nodeName))return{ignore:!0}}else if(t.nodeName=="IMG"&&t.getAttribute("mark-placeholder"))return{ignore:!0};return null},yR=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function vR(e,t,n,o,r){let i=e.input.compositionPendingChanges||(e.composing?e.input.compositionID:0);if(e.input.compositionPendingChanges=0,t<0){let N=e.input.lastSelectionTime>Date.now()-50?e.input.lastSelectionOrigin:null,D=Pb(e,N);if(D&&!e.state.selection.eq(D)){if(_t&&Yn&&e.input.lastKeyCode===13&&Date.now()-100<e.input.lastKeyCodeTime&&e.someProp("handleKeyDown",re=>re(e,lo(13,"Enter"))))return;let W=e.state.tr.setSelection(D);N=="pointer"?W.setMeta("pointer",!0):N=="key"&&W.scrollIntoView(),i&&W.setMeta("composition",i),e.dispatch(W)}return}let s=e.state.doc.resolve(t),a=s.sharedDepth(n);t=s.before(a+1),n=e.state.doc.resolve(n).after(a+1);let l=e.state.selection,u=gR(e,t,n,r),c=e.state.doc,d=c.slice(u.from,u.to),f,h;e.input.lastKeyCode===8&&Date.now()-100<e.input.lastKeyCodeTime?(f=e.state.selection.to,h="end"):(f=e.state.selection.from,h="start"),e.input.lastKeyCode=null;let p=SR(d.content,u.doc.content,u.from,f,h);if(p&&e.input.domChangeCount++,(Pi&&e.input.lastIOSEnter>Date.now()-225||Yn)&&r.some(N=>ee(N)&&!yR.test(N.nodeName))&&(!p||p.endA>=p.endB)&&e.someProp("handleKeyDown",N=>N(e,lo(13,"Enter")))){e.input.lastIOSEnter=0;return}if(!p)if(o&&l instanceof Z&&!l.empty&&l.$head.sameParent(l.$anchor)&&!e.composing&&!(u.sel&&u.sel.anchor!=u.sel.head))p={start:l.from,endA:l.to,endB:l.to};else{if(u.sel){let N=XE(e,e.state.doc,u.sel);if(N&&!N.eq(e.state.selection)){let D=e.state.tr.setSelection(N);i&&D.setMeta("composition",i),e.dispatch(D)}}return}e.state.selection.from<e.state.selection.to&&p.start==p.endB&&e.state.selection instanceof Z&&(p.start>e.state.selection.from&&p.start<=e.state.selection.from+2&&e.state.selection.from>=u.from?p.start=e.state.selection.from:p.endA<e.state.selection.to&&p.endA>=e.state.selection.to-2&&e.state.selection.to<=u.to&&(p.endB+=e.state.selection.to-p.endA,p.endA=e.state.selection.to)),qt&&Cr<=11&&p.endB==p.start+1&&p.endA==p.start&&p.start>u.from&&u.doc.textBetween(p.start-u.from-1,p.start-u.from+1)==" \xA0"&&(p.start--,p.endA--,p.endB--);let m=u.doc.resolveNoCache(p.start-u.from),g=u.doc.resolveNoCache(p.endB-u.from),b=c.resolve(p.start),y=m.sameParent(g)&&m.parent.inlineContent&&b.end()>=p.endA;if((Pi&&e.input.lastIOSEnter>Date.now()-225&&(!y||r.some(N=>N.nodeName=="DIV"||N.nodeName=="P"))||!y&&wR(u.doc,m.pos,g.pos))&&e.someProp("handleKeyDown",N=>N(e,lo(13,"Enter")))){e.input.lastIOSEnter=0;return}if(e.state.selection.anchor>p.start&&kR(c,p.start,p.endA,m,g)&&e.someProp("handleKeyDown",N=>N(e,lo(8,"Backspace")))){Yn&&_t&&e.domObserver.suppressSelectionUpdates();return}_t&&p.endB==p.start&&(e.input.lastChromeDelete=Date.now()),Yn&&!y&&m.start()!=g.start()&&g.parentOffset==0&&m.depth==g.depth&&u.sel&&u.sel.anchor==u.sel.head&&u.sel.head==p.endA&&(p.endB-=2,g=u.doc.resolveNoCache(p.endB-u.from),setTimeout(()=>{e.someProp("handleKeyDown",function(N){return N(e,lo(13,"Enter"))})},20));let k=p.start,x=p.endA,E=N=>{let D=N||e.state.tr.replace(k,x,u.doc.slice(p.start-u.from,p.endB-u.from));if(u.sel){let W=XE(e,D.doc,u.sel);W&&!(_t&&e.composing&&W.empty&&(p.start!=p.endB||e.input.lastChromeDelete<Date.now()-100)&&(W.head==k||W.head==D.mapping.map(x)-1)||qt&&W.empty&&W.head==k)&&D.setSelection(W)}return i&&D.setMeta("composition",i),D.scrollIntoView()},I;if(y)if(m.pos==g.pos){qt&&Cr<=11&&m.parentOffset==0&&(e.domObserver.suppressSelectionUpdates(),setTimeout(()=>tr(e),20));let N=E(e.state.tr.delete(k,x)),D=c.resolve(p.start).marksAcross(c.resolve(p.endA));D&&N.ensureMarks(D),e.dispatch(N)}else if(p.endA==p.endB&&(I=xR(m.parent.content.cut(m.parentOffset,g.parentOffset),b.parent.content.cut(b.parentOffset,p.endA-b.start())))){let N=E(e.state.tr);I.type=="add"?N.addMark(k,x,I.mark):N.removeMark(k,x,I.mark),e.dispatch(N)}else if(m.parent.child(m.index()).isText&&m.index()==g.index()-(g.textOffset?0:1)){let N=m.parent.textBetween(m.parentOffset,g.parentOffset),D=()=>E(e.state.tr.insertText(N,k,x));e.someProp("handleTextInput",W=>W(e,k,x,N,D))||e.dispatch(D())}else e.dispatch(E());else e.dispatch(E())}function XE(e,t,n){return Math.max(n.anchor,n.head)>t.content.size?null:Lb(e,t.resolve(n.anchor),t.resolve(n.head))}function xR(e,t){let n=e.firstChild.marks,o=t.firstChild.marks,r=n,i=o,s,a,l;for(let c=0;c<o.length;c++)r=o[c].removeFromSet(r);for(let c=0;c<n.length;c++)i=n[c].removeFromSet(i);if(r.length==1&&i.length==0)a=r[0],s="add",l=c=>c.mark(a.addToSet(c.marks));else if(r.length==0&&i.length==1)a=i[0],s="remove",l=c=>c.mark(a.removeFromSet(c.marks));else return null;let u=[];for(let c=0;c<t.childCount;c++)u.push(l(t.child(c)));if(M.from(u).eq(e))return{mark:a,type:s}}function kR(e,t,n,o,r){if(n-t<=r.pos-o.pos||mb(o,!0,!1)<r.pos)return!1;let i=e.resolve(t);if(!o.parent.isTextblock){let a=i.nodeAfter;return a!=null&&n==t+a.nodeSize}if(i.parentOffset<i.parent.content.size||!i.parent.isTextblock)return!1;let s=e.resolve(mb(i,!0,!0));return!s.parent.isTextblock||s.pos>n||mb(s,!0,!1)<n?!1:o.parent.content.cut(o.parentOffset).eq(s.parent.content)}function wR(e,t,n){let o=0,r=0;return e.nodesBetween(t,n,(i,s)=>{i.isTextblock&&s>=t&&s<n?o++:(i.isText?/\S/.test(i.text.slice(Math.max(0,t-s),Math.min(i.nodeSize,n-s))):i.isLeaf)&&r++}),r==0&&o==1}function mb(e,t,n){let o=e.depth,r=t?e.end():e.pos;for(;o>0&&(t||e.indexAfter(o)==e.node(o).childCount);)o--,r++,t=!1;if(n){let i=e.node(o).maybeChild(e.indexAfter(o));for(;i&&!i.isLeaf;)i=i.firstChild,r++}return r}function SR(e,t,n,o,r){let i=e.findDiffStart(t,n),s=n+e.size,a=n+t.size;if(i==null)return null;let{a:l,b:u}=e.findDiffEnd(t,s,a);if(r=="end"){let c=Math.max(0,i-Math.min(l,u));o-=l+c-i}if(l<i&&s<a){let c=o<=i&&o>=l?i-o:0;i-=c,u=i+(u-l),l=i}else if(u<i){let c=o<=i&&o>=u?i-o:0;i-=c,l=i+(l-u),u=i}return{start:i,endA:l,endB:u}}var Oa=class{constructor(t,n){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new Mb,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=n,this.state=n.state,this.directPlugins=n.plugins||[],this.directPlugins.forEach(r2),this.dispatch=this.dispatch.bind(this),this.dom=t&&t.mount||document.createElement("div"),t&&(t.appendChild?t.appendChild(this.dom):typeof t=="function"?t(this.dom):t.mount&&(this.mounted=!0)),this.editable=t2(this),e2(this),this.nodeViews=n2(this),this.docView=OE(this.state.doc,YE(this),hb(this),this.dom,this),this.domObserver=new Ob(this,(o,r,i,s)=>vR(this,o,r,i,s)),this.domObserver.start(),HO(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let t=this._props;this._props={};for(let n in t)this._props[n]=t[n];this._props.state=this.state}return this._props}update(t){t.handleDOMEvents!=this._props.handleDOMEvents&&$b(this);let n=this._props;this._props=t,t.plugins&&(t.plugins.forEach(r2),this.directPlugins=t.plugins),this.updateStateInner(t.state,n)}setProps(t){let n={};for(let o in this._props)n[o]=this._props[o];n.state=this.state;for(let o in t)n[o]=t[o];this.update(n)}updateState(t){this.updateStateInner(t,this._props)}updateStateInner(t,n){var o;let r=this.state,i=!1,s=!1;t.storedMarks&&this.composing&&($2(this),s=!0),this.state=t;let a=r.plugins!=t.plugins||this._props.plugins!=n.plugins;if(a||this._props.plugins!=n.plugins||this._props.nodeViews!=n.nodeViews){let h=n2(this);ER(h,this.nodeViews)&&(this.nodeViews=h,i=!0)}(a||n.handleDOMEvents!=this._props.handleDOMEvents)&&$b(this),this.editable=t2(this),e2(this);let l=hb(this),u=YE(this),c=r.plugins!=t.plugins&&!r.doc.eq(t.doc)?"reset":t.scrollToSelection>r.scrollToSelection?"to selection":"preserve",d=i||!this.docView.matchesNode(t.doc,u,l);(d||!t.selection.eq(r.selection))&&(s=!0);let f=c=="preserve"&&s&&this.dom.style.overflowAnchor==null&&aO(this);if(s){this.domObserver.stop();let h=d&&(qt||_t)&&!this.composing&&!r.selection.empty&&!t.selection.empty&&_R(r.selection,t.selection);if(d){let m=_t?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=nR(this)),(i||!this.docView.update(t.doc,u,l,this))&&(this.docView.updateOuterDeco(u),this.docView.destroy(),this.docView=OE(t.doc,u,l,this.dom,this)),m&&(!this.trackWrites||!this.dom.contains(this.trackWrites))&&(h=!0)}let p=this.input.mouseDown;h||!(p&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&AO(this)&&p.delaySelUpdate())?tr(this,h):(b2(this,t.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(r),!((o=this.dragging)===null||o===void 0)&&o.node&&!r.doc.eq(t.doc)&&this.updateDraggedNode(this.dragging,r),c=="reset"?this.dom.scrollTop=0:c=="to selection"?this.scrollToSelection():f&&lO(f)}scrollToSelection(){let t=this.domSelectionRange().focusNode;if(!(!t||!bo(this.dom,t))){if(!this.someProp("handleScrollToSelection",n=>n(this)))if(this.state.selection instanceof X){let n=this.docView.domAfterPos(this.state.selection.from);ee(n)&&$E(this,n.getBoundingClientRect(),t)}else $E(this,this.coordsAtPos(this.state.selection.head,1),t)}}destroyPluginViews(){let t;for(;t=this.pluginViews.pop();)t.destroy&&t.destroy()}updatePluginViews(t){if(!t||t.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let n=0;n<this.directPlugins.length;n++){let o=this.directPlugins[n];o.spec.view&&this.pluginViews.push(o.spec.view(this))}for(let n=0;n<this.state.plugins.length;n++){let o=this.state.plugins[n];o.spec.view&&this.pluginViews.push(o.spec.view(this))}}else for(let n=0;n<this.pluginViews.length;n++){let o=this.pluginViews[n];o.update&&o.update(this,t)}}updateDraggedNode(t,n){let o=t.node,r=-1;if(o.from<this.state.doc.content.size&&this.state.doc.nodeAt(o.from)==o.node)r=o.from;else{let i=o.from+(this.state.doc.content.size-n.doc.content.size);(i>0&&i<this.state.doc.content.size&&this.state.doc.nodeAt(i))==o.node&&(r=i)}this.dragging=new sd(t.slice,t.move,r<0?void 0:X.create(this.state.doc,r))}someProp(t,n){let o=this._props&&this._props[t],r;if(o!=null&&(r=n?n(o):o))return r;for(let s=0;s<this.directPlugins.length;s++){let a=this.directPlugins[s].props[t];if(a!=null&&(r=n?n(a):a))return r}let i=this.state.plugins;if(i)for(let s=0;s<i.length;s++){let a=i[s].props[t];if(a!=null&&(r=n?n(a):a))return r}}hasFocus(){if(qt){let t=this.root.activeElement;if(t==this.dom)return!0;if(!t||!this.dom.contains(t))return!1;for(;t&&this.dom!=t&&this.dom.contains(t);){if(t.contentEditable=="false")return!1;t=t.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&uO(this.dom),tr(this),this.domObserver.start()}get root(){let t=this._root;if(t==null){for(let n=this.dom.parentNode;n;n=n.parentNode)if(n.nodeType==9||n.nodeType==11&&n.host)return n.getSelection||(Object.getPrototypeOf(n).getSelection=()=>n.ownerDocument.getSelection()),this._root=n}return t||document}updateRoot(){this._root=null}posAtCoords(t){return hO(this,t)}coordsAtPos(t,n=1){return d2(this,t,n)}domAtPos(t,n=0){return this.docView.domFromPos(t,n)}nodeDOM(t){let n=this.docView.descAt(t);return n?n.nodeDOM:null}posAtDOM(t,n,o=-1){let r=this.docView.posFromDOM(t,n,o);if(r==null)throw new RangeError("DOM position not inside the editor");return r}endOfTextblock(t,n){return vO(this,n||this.state,t)}pasteHTML(t,n){return Na(this,"",t,!1,n||new ClipboardEvent("paste"))}pasteText(t,n){return Na(this,t,null,!0,n||new ClipboardEvent("paste"))}serializeForClipboard(t){return Fb(this,t)}destroy(){this.docView&&(qO(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],hb(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,Qz())}get isDestroyed(){return this.docView==null}dispatchEvent(t){return VO(this,t)}domSelectionRange(){let t=this.dom.isConnected!==!1&&this.domSelection();return t?It&&this.root.nodeType===11&&nO(this.dom.ownerDocument)==this.dom&&pR(this,t)||t:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}};Oa.prototype.dispatch=function(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))};function YE(e){let t=Object.create(null);return t.class="ProseMirror",t.contenteditable=String(e.editable),e.someProp("attributes",n=>{if(typeof n=="function"&&(n=n(e.state)),n)for(let o in n)o=="class"?t.class+=" "+n[o]:o=="style"?t.style=(t.style?t.style+";":"")+n[o]:!t[o]&&o!="contenteditable"&&o!="nodeName"&&(t[o]=String(n[o]))}),t.translate||(t.translate="no"),[ft.node(0,e.state.doc.content.size,t)]}function e2(e){if(e.markCursor){let t=document.createElement("img");t.className="ProseMirror-separator",t.setAttribute("mark-placeholder","true"),t.setAttribute("alt",""),e.cursorWrapper={dom:t,deco:ft.widget(e.state.selection.from,t,{raw:!0,marks:e.markCursor})}}else e.cursorWrapper=null}function t2(e){return!e.someProp("editable",t=>t(e.state)===!1)}function _R(e,t){let n=Math.min(e.$anchor.sharedDepth(e.head),t.$anchor.sharedDepth(t.head));return e.$anchor.start(n)!=t.$anchor.start(n)}function n2(e){let t=Object.create(null);function n(o){for(let r in o)Object.prototype.hasOwnProperty.call(t,r)||(t[r]=o[r])}return e.someProp("nodeViews",n),e.someProp("markViews",n),t}function ER(e,t){let n=0,o=0;for(let r in e){if(e[r]!=t[r])return!0;n++}for(let r in t)o++;return n!=o}function r2(e){if(e.spec.state||e.spec.filterTransaction||e.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}var nr={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},pd={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},CR=typeof navigator<"u"&&/Mac/.test(navigator.platform),TR=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(it=0;it<10;it++)nr[48+it]=nr[96+it]=String(it);var it;for(it=1;it<=24;it++)nr[it+111]="F"+it;var it;for(it=65;it<=90;it++)nr[it]=String.fromCharCode(it+32),pd[it]=String.fromCharCode(it);var it;for(fd in nr)pd.hasOwnProperty(fd)||(pd[fd]=nr[fd]);var fd;function R2(e){var t=CR&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||TR&&e.shiftKey&&e.key&&e.key.length==1||e.key=="Unidentified",n=!t&&e.key||(e.shiftKey?pd:nr)[e.keyCode]||e.key||"Unidentified";return n=="Esc"&&(n="Escape"),n=="Del"&&(n="Delete"),n=="Left"&&(n="ArrowLeft"),n=="Up"&&(n="ArrowUp"),n=="Right"&&(n="ArrowRight"),n=="Down"&&(n="ArrowDown"),n}var AR=typeof navigator<"u"&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),MR=typeof navigator<"u"&&/Win/.test(navigator.platform);function $R(e){let t=e.split(/-(?!$)/),n=t[t.length-1];n=="Space"&&(n=" ");let o,r,i,s;for(let a=0;a<t.length-1;a++){let l=t[a];if(/^(cmd|meta|m)$/i.test(l))s=!0;else if(/^a(lt)?$/i.test(l))o=!0;else if(/^(c|ctrl|control)$/i.test(l))r=!0;else if(/^s(hift)?$/i.test(l))i=!0;else if(/^mod$/i.test(l))AR?s=!0:r=!0;else throw new Error("Unrecognized modifier name: "+l)}return o&&(n="Alt-"+n),r&&(n="Ctrl-"+n),s&&(n="Meta-"+n),i&&(n="Shift-"+n),n}function IR(e){let t=Object.create(null);for(let n in e)t[$R(n)]=e[n];return t}function qb(e,t,n=!0){return t.altKey&&(e="Alt-"+e),t.ctrlKey&&(e="Ctrl-"+e),t.metaKey&&(e="Meta-"+e),n&&t.shiftKey&&(e="Shift-"+e),e}function P2(e){return new de({props:{handleKeyDown:Fa(e)}})}function Fa(e){let t=IR(e);return function(n,o){let r=R2(o),i,s=t[qb(r,o)];if(s&&s(n.state,n.dispatch,n))return!0;if(r.length==1&&r!=" "){if(o.shiftKey){let a=t[qb(r,o,!1)];if(a&&a(n.state,n.dispatch,n))return!0}if((o.altKey||o.metaKey||o.ctrlKey)&&!(MR&&o.ctrlKey&&o.altKey)&&(i=nr[o.keyCode])&&i!=r){let a=t[qb(i,o)];if(a&&a(n.state,n.dispatch,n))return!0}}return!1}}var hd=200,Et=function(){};Et.prototype.append=function(t){return t.length?(t=Et.from(t),!this.length&&t||t.length<hd&&this.leafAppend(t)||this.length<hd&&t.leafPrepend(this)||this.appendInner(t)):this};Et.prototype.prepend=function(t){return t.length?Et.from(t).append(this):this};Et.prototype.appendInner=function(t){return new DR(this,t)};Et.prototype.slice=function(t,n){return t===void 0&&(t=0),n===void 0&&(n=this.length),t>=n?Et.empty:this.sliceInner(Math.max(0,t),Math.min(this.length,n))};Et.prototype.get=function(t){if(!(t<0||t>=this.length))return this.getInner(t)};Et.prototype.forEach=function(t,n,o){n===void 0&&(n=0),o===void 0&&(o=this.length),n<=o?this.forEachInner(t,n,o,0):this.forEachInvertedInner(t,n,o,0)};Et.prototype.map=function(t,n,o){n===void 0&&(n=0),o===void 0&&(o=this.length);var r=[];return this.forEach(function(i,s){return r.push(t(i,s))},n,o),r};Et.from=function(t){return t instanceof Et?t:t&&t.length?new L2(t):Et.empty};var L2=(function(e){function t(o){e.call(this),this.values=o}e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t;var n={length:{configurable:!0},depth:{configurable:!0}};return t.prototype.flatten=function(){return this.values},t.prototype.sliceInner=function(r,i){return r==0&&i==this.length?this:new t(this.values.slice(r,i))},t.prototype.getInner=function(r){return this.values[r]},t.prototype.forEachInner=function(r,i,s,a){for(var l=i;l<s;l++)if(r(this.values[l],a+l)===!1)return!1},t.prototype.forEachInvertedInner=function(r,i,s,a){for(var l=i-1;l>=s;l--)if(r(this.values[l],a+l)===!1)return!1},t.prototype.leafAppend=function(r){if(this.length+r.length<=hd)return new t(this.values.concat(r.flatten()))},t.prototype.leafPrepend=function(r){if(this.length+r.length<=hd)return new t(r.flatten().concat(this.values))},n.length.get=function(){return this.values.length},n.depth.get=function(){return 0},Object.defineProperties(t.prototype,n),t})(Et);Et.empty=new L2([]);var DR=(function(e){function t(n,o){e.call(this),this.left=n,this.right=o,this.length=n.length+o.length,this.depth=Math.max(n.depth,o.depth)+1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},t.prototype.getInner=function(o){return o<this.left.length?this.left.get(o):this.right.get(o-this.left.length)},t.prototype.forEachInner=function(o,r,i,s){var a=this.left.length;if(r<a&&this.left.forEachInner(o,r,Math.min(i,a),s)===!1||i>a&&this.right.forEachInner(o,Math.max(r-a,0),Math.min(this.length,i)-a,s+a)===!1)return!1},t.prototype.forEachInvertedInner=function(o,r,i,s){var a=this.left.length;if(r>a&&this.right.forEachInvertedInner(o,r-a,Math.max(i,a)-a,s+a)===!1||i<a&&this.left.forEachInvertedInner(o,Math.min(r,a),i,s)===!1)return!1},t.prototype.sliceInner=function(o,r){if(o==0&&r==this.length)return this;var i=this.left.length;return r<=i?this.left.slice(o,r):o>=i?this.right.slice(o-i,r-i):this.left.slice(o,i).append(this.right.slice(0,r-i))},t.prototype.leafAppend=function(o){var r=this.right.leafAppend(o);if(r)return new t(this.left,r)},t.prototype.leafPrepend=function(o){var r=this.left.leafPrepend(o);if(r)return new t(r,this.right)},t.prototype.appendInner=function(o){return this.left.depth>=Math.max(this.right.depth,o.depth)+1?new t(this.left,new t(this.right,o)):new t(this,o)},t})(Et),Zb=Et;var NR=500,vo=class e{constructor(t,n){this.items=t,this.eventCount=n}popEvent(t,n){if(this.eventCount==0)return null;let o=this.items.length;for(;;o--)if(this.items.get(o-1).selection){--o;break}let r,i;n&&(r=this.remapping(o,this.items.length),i=r.maps.length);let s=t.tr,a,l,u=[],c=[];return this.items.forEach((d,f)=>{if(!d.step){r||(r=this.remapping(o,f+1),i=r.maps.length),i--,c.push(d);return}if(r){c.push(new Nn(d.map));let h=d.step.map(r.slice(i)),p;h&&s.maybeStep(h).doc&&(p=s.mapping.maps[s.mapping.maps.length-1],u.push(new Nn(p,void 0,void 0,u.length+c.length))),i--,p&&r.appendMap(p,i)}else s.maybeStep(d.step);if(d.selection)return a=r?d.selection.map(r.slice(i)):d.selection,l=new e(this.items.slice(0,o).append(c.reverse().concat(u)),this.eventCount-1),!1},this.items.length,0),{remaining:l,transform:s,selection:a}}addTransform(t,n,o,r){let i=[],s=this.eventCount,a=this.items,l=!r&&a.length?a.get(a.length-1):null;for(let c=0;c<t.steps.length;c++){let d=t.steps[c].invert(t.docs[c]),f=new Nn(t.mapping.maps[c],d,n),h;(h=l&&l.merge(f))&&(f=h,c?i.pop():a=a.slice(0,a.length-1)),i.push(f),n&&(s++,n=void 0),r||(l=f)}let u=s-o.depth;return u>OR&&(a=zR(a,u),s-=u),new e(a.append(i),s)}remapping(t,n){let o=new Sa;return this.items.forEach((r,i)=>{let s=r.mirrorOffset!=null&&i-r.mirrorOffset>=t?o.maps.length-r.mirrorOffset:void 0;o.appendMap(r.map,s)},t,n),o}addMaps(t){return this.eventCount==0?this:new e(this.items.append(t.map(n=>new Nn(n))),this.eventCount)}rebased(t,n){if(!this.eventCount)return this;n=Math.min(this.items.length,n);let o=[],r=this.items.length-n,i=t.mapping,s=t.steps.length,a=this.eventCount;this.items.forEach(f=>{f.selection&&a--},r);let l=n;this.items.forEach(f=>{let h=i.getMirror(--l);if(h==null)return;s=Math.min(s,h);let p=i.maps[h];if(f.step){let m=t.steps[h].invert(t.docs[h]),g=f.selection&&f.selection.map(i.slice(l+1,h));g&&a++,o.push(new Nn(p,m,g))}else o.push(new Nn(p))},r);let u=[];for(let f=n;f<s;f++)u.push(new Nn(i.maps[f]));let c=this.items.slice(0,r).append(u).append(o),d=new e(c,a);return d.emptyItemCount()>NR&&(d=d.compress(this.items.length-o.length)),d}emptyItemCount(){let t=0;return this.items.forEach(n=>{n.step||t++}),t}compress(t=this.items.length){let n=this.remapping(0,t),o=n.maps.length,r=[],i=0;return this.items.forEach((s,a)=>{if(a>=t)r.push(s),s.selection&&i++;else if(s.step){let l=s.step.map(n.slice(o)),u=l&&l.getMap();if(o--,u&&n.appendMap(u,o),l){let c=s.selection&&s.selection.map(n.slice(o));c&&i++;let d=new Nn(u.invert(),l,c),f,h=r.length-1;(f=r.length&&r[h].merge(d))?r[h]=f:r.push(d)}}else s.map&&o--},this.items.length,0),new e(Zb.from(r.reverse()),i)}};vo.empty=new vo(Zb.empty,0);function zR(e,t){let n;return e.forEach((o,r)=>{if(o.selection&&t--==0)return n=r,!1}),e.slice(n)}var Nn=class e{constructor(t,n,o,r){this.map=t,this.step=n,this.selection=o,this.mirrorOffset=r}merge(t){if(this.step&&t.step&&!t.selection){let n=t.step.merge(this.step);if(n)return new e(n.getMap().invert(),n,this.selection)}}},zn=class{constructor(t,n,o,r,i){this.done=t,this.undone=n,this.prevRanges=o,this.prevTime=r,this.prevComposition=i}},OR=20;function RR(e,t,n,o){let r=n.getMeta(Mr),i;if(r)return r.historyState;n.getMeta(U2)&&(e=new zn(e.done,e.undone,null,0,-1));let s=n.getMeta("appendedTransaction");if(n.steps.length==0)return e;if(s&&s.getMeta(Mr))return s.getMeta(Mr).redo?new zn(e.done.addTransform(n,void 0,o,md(t)),e.undone,F2(n.mapping.maps),e.prevTime,e.prevComposition):new zn(e.done,e.undone.addTransform(n,void 0,o,md(t)),null,e.prevTime,e.prevComposition);if(n.getMeta("addToHistory")!==!1&&!(s&&s.getMeta("addToHistory")===!1)){let a=n.getMeta("composition"),l=e.prevTime==0||!s&&e.prevComposition!=a&&(e.prevTime<(n.time||0)-o.newGroupDelay||!PR(n,e.prevRanges)),u=s?Vb(e.prevRanges,n.mapping):F2(n.mapping.maps);return new zn(e.done.addTransform(n,l?t.selection.getBookmark():void 0,o,md(t)),vo.empty,u,n.time,a??e.prevComposition)}else return(i=n.getMeta("rebased"))?new zn(e.done.rebased(n,i),e.undone.rebased(n,i),Vb(e.prevRanges,n.mapping),e.prevTime,e.prevComposition):new zn(e.done.addMaps(n.mapping.maps),e.undone.addMaps(n.mapping.maps),Vb(e.prevRanges,n.mapping),e.prevTime,e.prevComposition)}function PR(e,t){if(!t)return!1;if(!e.docChanged)return!0;let n=!1;return e.mapping.maps[0].forEach((o,r)=>{for(let i=0;i<t.length;i+=2)o<=t[i+1]&&r>=t[i]&&(n=!0)}),n}function F2(e){let t=[];for(let n=e.length-1;n>=0&&t.length==0;n--)e[n].forEach((o,r,i,s)=>t.push(i,s));return t}function Vb(e,t){if(!e)return null;let n=[];for(let o=0;o<e.length;o+=2){let r=t.map(e[o],1),i=t.map(e[o+1],-1);r<=i&&n.push(r,i)}return n}function LR(e,t){for(let n=0;n<t.steps.length;n++){let o=t.mapping.maps[n],r=-1;if(o.forEach((i,s)=>r=s),r<0){let i=t.steps[n];(i instanceof io||i instanceof In)&&(r=i.to)}if(r>-1)return Q.near(e.doc.resolve(r))}return e.selection}function FR(e,t,n){let o=md(t),r=Mr.get(t).spec.config,i=(n?e.undone:e.done).popEvent(t,o);if(!i)return null;let s=i.selection.resolve(i.transform.doc),a=(n?e.done:e.undone).addTransform(i.transform,LR(t,i.transform).getBookmark(),r,o),l=new zn(n?a:i.remaining,n?i.remaining:a,null,0,-1);return i.transform.setSelection(s).setMeta(Mr,{redo:n,historyState:l})}var Wb=!1,j2=null;function md(e){let t=e.plugins;if(j2!=t){Wb=!1,j2=t;for(let n=0;n<t.length;n++)if(t[n].spec.historyPreserveItems){Wb=!0;break}}return Wb}function B2(e){return e.setMeta(U2,!0)}var Mr=new ke("history"),U2=new ke("closeHistory");function H2(e={}){return e={depth:e.depth||100,newGroupDelay:e.newGroupDelay||500},new de({key:Mr,state:{init(){return new zn(vo.empty,vo.empty,null,0,-1)},apply(t,n,o){return RR(n,o,t,e)}},config:e,props:{handleDOMEvents:{beforeinput(t,n){let o=n.inputType,r=o=="historyUndo"?Kb:o=="historyRedo"?Jb:null;return!r||!t.editable?!1:(n.preventDefault(),r(t.state,t.dispatch))}}}})}function gd(e,t){return(n,o)=>{let r=Mr.getState(n);if(!r||(e?r.undone:r.done).eventCount==0)return!1;if(o){let i=FR(r,n,e);i&&o(t?i.scrollIntoView():i)}return!0}}var Kb=gd(!1,!0),Jb=gd(!0,!0),BG=gd(!1,!1),UG=gd(!0,!1);function q2(e){return e.getMeta(Mr)!=null}function Ed(e){let{state:t,transaction:n}=e,{selection:o}=n,{doc:r}=n,{storedMarks:i}=n;return{...t,apply:t.apply.bind(t),applyTransaction:t.applyTransaction.bind(t),plugins:t.plugins,schema:t.schema,reconfigure:t.reconfigure.bind(t),toJSON:t.toJSON.bind(t),get storedMarks(){return i},get selection(){return o},get doc(){return r},get tr(){return o=n.selection,r=n.doc,i=n.storedMarks,n}}}var Ui=class dC{constructor(t){this.editor=t.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=t.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){let{rawCommands:t,editor:n,state:o}=this,{view:r}=n,{tr:i}=o,s=this.buildProps(i);return Object.fromEntries(Object.entries(t).map(([a,l])=>[a,(...c)=>{let d=l(...c)(s);return!i.getMeta("preventDispatch")&&!this.hasCustomState&&r.dispatch(i),d}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(t,n=!0){let{rawCommands:o,editor:r,state:i}=this,{view:s}=r,a=[],l=!!t,u=t||i.tr,c=()=>(!l&&n&&!u.getMeta("preventDispatch")&&!this.hasCustomState&&s.dispatch(u),a.every(f=>f===!0)),d={...Object.fromEntries(Object.entries(o).map(([f,h])=>[f,(...m)=>{let g=this.buildProps(u,n),b=h(...m)(g);return a.push(b),d}])),run:c};return d}static createFakeChain(){let t=new Proxy({},{get:(n,o)=>{if(o!=="then")return o==="run"?()=>!1:()=>t}});return t}createCan(t){let{rawCommands:n,state:o}=this,r=!1,i=t||o.tr,s=this.buildProps(i,r);return{...Object.fromEntries(Object.entries(n).map(([a,l])=>[a,(...u)=>l(...u)({...s,dispatch:void 0})])),chain:()=>this.createChain(i,r)}}static createFallbackCan(){let t=dC.createFakeChain();return new Proxy({chain:()=>t},{get:(n,o)=>{if(o!=="then")return o==="chain"?n.chain:()=>!1}})}buildProps(t,n=!0){let{rawCommands:o,editor:r,state:i}=this,{view:s}=r,a={tr:t,editor:r,view:s,state:Ed({state:i,transaction:t}),dispatch:n?()=>{}:void 0,chain:()=>this.createChain(t,n),can:()=>this.createCan(t),get commands(){return Object.fromEntries(Object.entries(o).map(([l,u])=>[l,(...c)=>u(...c)(a)]))}};return a}},jR=()=>({editor:e,view:t})=>(requestAnimationFrame(()=>{if(!e.isDestroyed){var n;t.dom.blur(),(n=window)===null||n===void 0||(n=n.getSelection())===null||n===void 0||n.removeAllRanges()}}),!0),BR=(e=!0)=>({commands:t})=>t.setContent("",{emitUpdate:e}),UR=()=>({tr:e,dispatch:t})=>{let{selection:n}=e,{ranges:o}=n;if(!t)return!0;let r=e.mapping.maps.length;return o.forEach(({$from:i,$to:s})=>{let a=i.pos,l=s.pos,u=e.mapping.slice(r),c=1;e.doc.nodesBetween(u.map(a),u.map(l),(d,f)=>{c=Math.max(c,e.doc.resolve(f).depth+1)});for(let d=0;d<c;d+=1){let f=e.doc,h=e.mapping.maps.length,p=e.mapping.slice(r),m=h,g=e.mapping.slice(h),b=p.map(a),y=p.map(l);if(f.nodesBetween(b,y,(k,x)=>{if(k.type.isText)return;e.mapping.maps.length!==m&&(m=e.mapping.maps.length,g=e.mapping.slice(h));let E=e.doc.resolve(g.map(x)),I=e.doc.resolve(g.map(x+k.nodeSize)),N=E.blockRange(I);if(!N)return;let D=Gn(N);if(k.type.isTextblock){let{defaultType:W}=E.parent.contentMatchAt(E.index()),re=e.doc.nodeAt(N.start);W&&re&&!re.hasMarkup(W)&&W.validContent(re.content)&&e.setNodeMarkup(N.start,W)}(D||D===0)&&e.lift(N,D)}),e.doc.eq(f))break}}),!0},HR=e=>t=>e(t),qR=()=>({state:e,dispatch:t})=>sb(e,t),ZR=(e,t)=>({editor:n,tr:o})=>{let{state:r}=n,i=r.doc.slice(e.from,e.to);o.deleteRange(e.from,e.to);let s=o.mapping.map(t);return o.insert(s,i.content),o.setSelection(new Z(o.doc.resolve(Math.max(s-1,0)))),!0},VR=()=>({tr:e,dispatch:t})=>{let{selection:n}=e,o=n.$anchor.node();if(o.content.size>0)return!1;let r=e.selection.$anchor;for(let i=r.depth;i>0;i-=1)if(r.node(i).type===o.type){if(t){let s=r.before(i),a=r.after(i);e.delete(s,a).scrollIntoView()}return!0}return!1};function st(e,t){if(typeof e=="string"){if(!t.nodes[e])throw Error(`There is no node type named '${e}'. Maybe you forgot to add the extension?`);return t.nodes[e]}return e}var WR=e=>({tr:t,state:n,dispatch:o})=>{let r=st(e,n.schema),i=t.selection.$anchor;for(let s=i.depth;s>0;s-=1)if(i.node(s).type===r){if(o){let a=i.before(s),l=i.after(s);t.delete(a,l).scrollIntoView()}return!0}return!1},KR=e=>({tr:t,dispatch:n})=>{let{from:o,to:r}=e;return n&&t.delete(o,r),!0},JR=e=>e.content?/^text(\*|\+)/.test(e.content):!1,Z2=(e,t,n)=>{if(!e.parent.isInline||n==="left"&&e.pos>e.start()||n==="right"&&e.pos<e.end())return e.pos;let o=t.nodes[e.parent.type.name].spec;return JR(o)?n==="left"?e.start()-1:e.end()+1:e.pos},GR=(e,t,n)=>({from:Z2(e,n,"left"),to:Z2(t,n,"right")}),QR=()=>({state:e,dispatch:t})=>{if(e.selection.empty)return!1;if(t){let n=e.tr,{ranges:o}=e.selection,r=e.selection instanceof Z?e.selection.$from.marksAcross(e.selection.$to):null,i=n.steps.length;o.forEach(s=>{let a=n.mapping.slice(i),l=n.doc.resolve(a.map(s.$from.pos)),u=n.doc.resolve(a.map(s.$to.pos)),{from:c,to:d}=GR(l,u,e.schema);n.deleteRange(c,d)}),n.selection.empty||n.setSelection(Z.near(n.doc.resolve(n.selection.from))),r&&n.ensureMarks(r),n.scrollIntoView(),t(n)}return!0},XR=()=>({commands:e})=>e.keyboardShortcut("Enter"),YR=()=>({state:e,dispatch:t})=>ib(e,t);function ey(e){return Object.prototype.toString.call(e)==="[object RegExp]"}function Sd(e,t,n={strict:!0}){let o=Object.keys(t);return o.length?o.every(r=>n.strict?t[r]===e[r]:ey(t[r])?t[r].test(e[r]):t[r]===e[r]):!0}function fC(e,t,n={}){return e.find(o=>o.type===t&&Sd(Object.fromEntries(Object.keys(n).map(r=>[r,o.attrs[r]])),n))}function V2(e,t,n={}){return!!fC(e,t,n)}function ty(e,t,n){if(!e||!t)return;let o=e.parent.childAfter(e.parentOffset);if((!o.node||!o.node.marks.some(l=>l.type===t))&&(o=e.parent.childBefore(e.parentOffset)),!o.node||!o.node.marks.some(l=>l.type===t))return;if(!n){let l=o.node.marks.find(u=>u.type===t);l&&(n=l.attrs)}if(!fC([...o.node.marks],t,n))return;let r=o.index,i=e.start()+o.offset,s=r+1,a=i+o.node.nodeSize;for(;r>0&&V2([...e.parent.child(r-1).marks],t,n);)r-=1,i-=e.parent.child(r).nodeSize;for(;s<e.parent.childCount&&V2([...e.parent.child(s).marks],t,n);)a+=e.parent.child(s).nodeSize,s+=1;return{from:i,to:a}}function rr(e,t){if(typeof e=="string"){if(!t.marks[e])throw Error(`There is no mark type named '${e}'. Maybe you forgot to add the extension?`);return t.marks[e]}return e}var eP=(e,t)=>({tr:n,state:o,dispatch:r})=>{let i=rr(e,o.schema),{doc:s,selection:a}=n,{$from:l,from:u,to:c}=a;if(r){let d=ty(l,i,t);if(d&&d.from<=u&&d.to>=c){let f=Z.create(s,d.from,d.to);n.setSelection(f)}}return!0},tP=e=>t=>{let n=typeof e=="function"?e(t):e;for(let o=0;o<n.length;o+=1)if(n[o](t))return!0;return!1};function pC(e){return e instanceof Z}function xo(e=0,t=0,n=0){return Math.min(Math.max(e,t),n)}function Gb(e,t=null){if(!t)return null;let n=Q.atStart(e),o=Q.atEnd(e);if(t==="start"||t===!0)return n;if(t==="end")return o;let r=n.from,i=o.to;return t==="all"?Z.create(e,xo(0,r,i),xo(e.content.size,r,i)):Z.create(e,xo(t,r,i),xo(t,r,i))}function W2(){return["Android"].includes(navigator.platform)||/android/i.test(navigator.userAgent)}function _d(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}function nP(){return typeof navigator<"u"?/^((?!chrome|android).)*safari/i.test(navigator.userAgent):!1}var rP=(e=null,t={})=>({editor:n,view:o,tr:r,dispatch:i})=>{t={scrollIntoView:!0,...t};let s=()=>{(_d()||W2())&&o.dom.focus(),nP()&&!_d()&&!W2()&&o.dom.focus({preventScroll:!0}),requestAnimationFrame(()=>{n.isDestroyed||(o.focus(),t?.scrollIntoView&&n.commands.scrollIntoView())})};try{if(o.hasFocus()&&e===null||e===!1)return!0}catch{return!1}if(i&&e===null&&!pC(n.state.selection))return s(),!0;let a=Gb(r.doc,e)||n.state.selection,l=n.state.selection.eq(a);return i&&(l||r.setSelection(a),l&&r.storedMarks&&r.setStoredMarks(r.storedMarks),s()),!0},oP=(e,t)=>n=>e.every((o,r)=>t(o,{...n,index:r})),iP=(e,t)=>({tr:n,commands:o})=>o.insertContentAt({from:n.selection.from,to:n.selection.to},e,t),hC=e=>{let t=e.childNodes;for(let n=t.length-1;n>=0;n-=1){let o=t[n];o.nodeType===3&&o.nodeValue&&/^(\n\s\s|\n)$/.test(o.nodeValue)?e.removeChild(o):o.nodeType===1&&hC(o)}return e};function bd(e){if(typeof window>"u")throw new Error("[tiptap error]: there is no window object available, so this function cannot be used");let t=`<body>${e}</body>`,n=new window.DOMParser().parseFromString(t,"text/html").body;return hC(n)}function mC(e){return typeof e?.nodesBetween=="function"}function Hi(e,t,n){if(mC(e))return e;let o=typeof e=="object"&&e!==null;n={slice:!0,parseOptions:{},...n};let r=typeof e=="string";if(o)try{if(Array.isArray(e)&&e.length>0)return M.fromArray(e.map(s=>t.nodeFromJSON(s)));let i=t.nodeFromJSON(e);return n.errorOnInvalidContent&&i.check(),i}catch(i){if(n.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:i});return console.warn("[tiptap warn]: Invalid content.","Passed value:",e,"Error:",i),Hi("",t,n)}if(r){if(n.errorOnInvalidContent){let s=!1,a="",l=new Vn({topNode:t.spec.topNode,marks:t.spec.marks,nodes:t.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:u=>(s=!0,a=typeof u=="string"?u:u.outerHTML,null)}]}})});if(n.slice?mn.fromSchema(l).parseSlice(bd(e),n.parseOptions):mn.fromSchema(l).parse(bd(e),n.parseOptions),n.errorOnInvalidContent&&s)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${a}`)})}let i=mn.fromSchema(t);return n.slice?i.parseSlice(bd(e),n.parseOptions).content:i.parse(bd(e),n.parseOptions)}return Hi("",t,n)}function gC(e){return!("type"in e)}function bC(e,t,n){let o=e.steps.length-1;if(o<t)return;let r=e.steps[o];if(!(r instanceof rt||r instanceof ot))return;let i=e.mapping.maps[o],s=0;i.forEach((a,l,u,c)=>{s===0&&(s=c)}),e.setSelection(Q.near(e.doc.resolve(s),n))}var sP=(e,t,n)=>({tr:o,dispatch:r,editor:i})=>{if(r){n={parseOptions:i.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...n};let a,l=g=>{i.emit("contentError",{editor:i,error:g,disableCollaboration:()=>{"collaboration"in i.storage&&typeof i.storage.collaboration=="object"&&i.storage.collaboration&&(i.storage.collaboration.isDisabled=!0)}})},u={preserveWhitespace:"full",...n.parseOptions};if(!n.errorOnInvalidContent&&!i.options.enableContentCheck&&i.options.emitContentError)try{Hi(t,i.schema,{parseOptions:u,errorOnInvalidContent:!0})}catch(g){l(g)}try{var s;a=Hi(t,i.schema,{parseOptions:u,errorOnInvalidContent:(s=n.errorOnInvalidContent)!==null&&s!==void 0?s:i.options.enableContentCheck})}catch(g){return l(g),!1}let{from:c,to:d}=typeof e=="number"?{from:e,to:e}:{from:e.from,to:e.to},f=!0,h=!0,p=gC(a)?a.content:[a];if(p.forEach(g=>{g.check(),f=f?g.isText&&g.marks.length===0:!1,h=h?g.isBlock:!1}),c===d&&h){let{parent:g}=o.doc.resolve(c);g.isTextblock&&!g.type.spec.code&&!g.childCount&&(c-=1,d+=1)}let m;if(f)Array.isArray(t)?m=t.map(g=>g.text||"").join(""):mC(t)?m=p.map(g=>{var b;return(b=g.text)!==null&&b!==void 0?b:""}).join(""):typeof t=="object"&&t&&t.text?m=t.text:m=t,o.insertText(m,c,d);else{m=M.from(p);let g=o.doc.resolve(c),b=g.node(),y=g.parentOffset===0,k=b.isText||b.isTextblock,x=b.content.size>0;y&&k&&x&&h&&(c=Math.max(0,c-1)),o.replaceWith(c,d,p)}n.updateSelection&&bC(o,o.steps.length-1,-1),n.applyInputRules&&o.setMeta("applyInputRules",{from:c,text:m}),n.applyPasteRules&&o.setMeta("applyPasteRules",{from:c,text:m})}return!0};function yC(e){for(let t=0;t<e.edgeCount;t+=1){let{type:n}=e.edge(t);if(n.isTextblock&&!n.hasRequiredAttrs())return n}return null}var aP=(e={})=>({tr:t,dispatch:n,editor:o})=>{let{pos:r,attrs:i,content:s,updateSelection:a=!0}=e,l;typeof r=="number"?l=t.doc.resolve(r):r?l=r:l=t.selection.$from;let u=yC(l.parent.contentMatchAt(l.index()));if(!u)return!1;let c=Object.keys(u.spec.attrs||{}),d=i?Object.fromEntries(Object.entries(i).filter(([h])=>c.includes(h))):{},f;if(s){let h=Hi(s,o.schema);f=u.createAndFill(d,h)}else f=u.createAndFill(d);return f?(n&&(t.insert(l.pos,f),a&&bC(t,t.steps.length-1,-1)),!0):!1},lP=()=>({state:e,dispatch:t})=>yE(e,t),uP=()=>({state:e,dispatch:t})=>vE(e,t),cP=()=>({state:e,dispatch:t})=>Qg(e,t),dP=()=>({state:e,dispatch:t})=>eb(e,t),vC=(e,t)=>{let n=e.resolve(t),o=n.nodeBefore,r=n.nodeAfter;return!o||!r?!1:!o.type.spec.isolating&&!r.type.spec.isolating},fP=()=>({state:e,dispatch:t,tr:n})=>{try{let o=Mi(e.doc,e.selection.$from.pos,-1);return o==null||!vC(e.doc,o)?!1:(n.join(o,2),t&&t(n),!0)}catch{return!1}},pP=()=>({state:e,dispatch:t,tr:n})=>{try{let o=Mi(e.doc,e.selection.$from.pos,1);return o==null||!vC(e.doc,o)?!1:(n.join(o,2),t&&t(n),!0)}catch{return!1}},hP=()=>({state:e,dispatch:t})=>Xc(e,t),mP=()=>({state:e,dispatch:t})=>Yc(e,t);function xC(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function gP(e){let t=e.split(/-(?!$)/),n=t[t.length-1];n==="Space"&&(n=" ");let o,r,i,s;for(let a=0;a<t.length-1;a+=1){let l=t[a];if(/^(cmd|meta|m)$/i.test(l))s=!0;else if(/^a(lt)?$/i.test(l))o=!0;else if(/^(c|ctrl|control)$/i.test(l))r=!0;else if(/^s(hift)?$/i.test(l))i=!0;else if(/^mod$/i.test(l))_d()||xC()?s=!0:r=!0;else throw new Error(`Unrecognized modifier name: ${l}`)}return o&&(n=`Alt-${n}`),r&&(n=`Ctrl-${n}`),s&&(n=`Meta-${n}`),i&&(n=`Shift-${n}`),n}var bP=e=>({editor:t,view:n,tr:o,dispatch:r})=>{let i=gP(e).split(/-(?!$)/),s=i.find(u=>!["Alt","Ctrl","Meta","Shift"].includes(u)),a=new KeyboardEvent("keydown",{key:s==="Space"?" ":s,altKey:i.includes("Alt"),ctrlKey:i.includes("Ctrl"),metaKey:i.includes("Meta"),shiftKey:i.includes("Shift"),bubbles:!0,cancelable:!0}),l=t.captureTransaction(()=>{n.someProp("handleKeyDown",u=>u(n,a))});return l?.steps.forEach(u=>{let c=u.map(o.mapping);c&&r&&o.maybeStep(c)}),!0};function On(e,t,n={}){let{from:o,to:r,empty:i}=e.selection,s=t?st(t,e.schema):null,a=[];e.doc.nodesBetween(o,r,(c,d)=>{if(c.isText)return;let f=Math.max(o,d),h=Math.min(r,d+c.nodeSize);a.push({node:c,from:f,to:h})});let l=r-o,u=a.filter(c=>s?s.name===c.node.type.name:!0).filter(c=>Sd(c.node.attrs,n,{strict:!1}));return i?!!u.length:u.reduce((c,d)=>c+d.to-d.from,0)>=l}var yP=(e,t={})=>({state:n,dispatch:o})=>On(n,st(e,n.schema),t)?xE(n,o):!1,vP=()=>({state:e,dispatch:t})=>ab(e,t),xP=e=>({state:t,dispatch:n})=>{let o=st(e,t.schema);return CE(o)(t,n)},kP=()=>({state:e,dispatch:t})=>rb(e,t);function Cd(e,t){return t.nodes[e]?"node":t.marks[e]?"mark":null}function K2(e,t){let n=typeof t=="string"?[t]:t;return Object.keys(e).reduce((o,r)=>(n.includes(r)||(o[r]=e[r]),o),{})}var wP=(e,t)=>({tr:n,state:o,dispatch:r})=>{let i=null,s=null,a=Cd(typeof e=="string"?e:e.name,o.schema);if(!a)return!1;a==="node"&&(i=st(e,o.schema)),a==="mark"&&(s=rr(e,o.schema));let l=!1;return n.selection.ranges.forEach(u=>{o.doc.nodesBetween(u.$from.pos,u.$to.pos,(c,d)=>{i&&i===c.type&&(l=!0,r&&n.setNodeMarkup(d,void 0,K2(c.attrs,t))),s&&c.marks.length&&c.marks.forEach(f=>{s===f.type&&(l=!0,r&&n.addMark(d,d+c.nodeSize,s.create(K2(f.attrs,t))))})})}),l},SP=()=>({tr:e,dispatch:t})=>(t&&e.scrollIntoView(),!0),_P=()=>({tr:e,dispatch:t})=>{if(t){let n=new Rt(e.doc);e.setSelection(n)}return!0},EP=()=>({state:e,dispatch:t})=>Xg(e,t),CP=()=>({state:e,dispatch:t})=>tb(e,t),TP=()=>({state:e,dispatch:t})=>kE(e,t),AP=()=>({state:e,dispatch:t})=>ub(e,t),MP=()=>({state:e,dispatch:t})=>lb(e,t);function Qb(e,t,n={},o={}){return Hi(e,t,{slice:!1,parseOptions:n,errorOnInvalidContent:o.errorOnInvalidContent})}var $P=(e,{errorOnInvalidContent:t,emitUpdate:n=!0,parseOptions:o={}}={})=>({editor:r,tr:i,dispatch:s,commands:a})=>{let{doc:l}=i;if(o.preserveWhitespace!=="full"){let u=Qb(e,r.schema,o,{errorOnInvalidContent:t??r.options.enableContentCheck});if(s){let c=gC(u)?u.content:[u];i.replaceWith(0,l.content.size,c).setMeta("preventUpdate",!n)}return!0}return s&&i.setMeta("preventUpdate",!n),a.insertContentAt({from:0,to:l.content.size},e,{parseOptions:o,errorOnInvalidContent:t??r.options.enableContentCheck})};function kC(e,t){let n=rr(t,e.schema),{from:o,to:r,empty:i}=e.selection,s=[];i?(e.storedMarks&&s.push(...e.storedMarks),s.push(...e.selection.$head.marks())):e.doc.nodesBetween(o,r,l=>{s.push(...l.marks)});let a=s.find(l=>l.type.name===n.name);return a?{...a.attrs}:{}}function ny(e,t){let n=new Jn(e);return t.forEach(o=>{o.steps.forEach(r=>{n.step(r)})}),n}function wC(e,t,n){let o=[];return e.nodesBetween(t.from,t.to,(r,i)=>{n(r)&&o.push({node:r,pos:i})}),o}function Zi(e,t){for(let n=e.depth;n>0;n-=1){let o=e.node(n);if(t(o))return{pos:n>0?e.before(n):0,start:e.start(n),depth:n,node:o}}}function Td(e){return t=>Zi(t.$from,e)}function J(e,t,n){return e.config[t]===void 0&&e.parent?J(e.parent,t,n):typeof e.config[t]=="function"?e.config[t].bind({...n,parent:e.parent?J(e.parent,t,n):null}):e.config[t]}function ry(e){return e.map(t=>{let n=J(t,"addExtensions",{name:t.name,options:t.options,storage:t.storage});return n?[t,...ry(n())]:t}).flat(10)}function Vi(e,t){let n=Wn.fromSchema(t).serializeFragment(e),o=document.implementation.createHTMLDocument().createElement("div");return o.appendChild(n),o.innerHTML}function SC(e,t){let n=new Map;for(let r of e){var o;let i=(o=n.get(r.type))!==null&&o!==void 0?o:new Map;i.set(r.name,r),n.set(r.type,i)}return[...Object.values(t.nodes),...Object.values(t.marks)].flatMap(r=>{var i;return Object.entries((i=r.spec.attrs)!==null&&i!==void 0?i:{}).map(([s,a])=>{var l;let u=(l=n.get(r.name))===null||l===void 0?void 0:l.get(s),c=Object.hasOwn(a,"default");return{type:r.name,name:s,attribute:{rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,...u?.attribute,default:a.default,isRequired:!c,validate:a.validate}}})})}var IP={content:"string",marks:"string",group:"string",inline:"boolean",atom:"boolean",selectable:"boolean",draggable:"boolean",code:"boolean",whitespace:["pre","normal"],definingAsContext:"boolean",definingForContent:"boolean",defining:"boolean",isolating:"boolean",linebreakReplacement:"boolean"},DP={inclusive:"boolean",excludes:"string",group:"string",spanning:"boolean",code:"boolean"};function NP(e,t,n){return Object.fromEntries(Object.entries(t).flatMap(([o,r])=>{let i=e[o];if(i===void 0)return[];if(!(typeof r=="string"?typeof i===r:typeof i=="string"&&r.includes(i)))throw new RangeError(`Invalid schemaSpec field '${n}.${o}'`);return[[o,i]]}))}function J2(e,t,n,o){return{...Object.fromEntries(Object.entries(t).filter(([r])=>r!=="attrs"&&!Object.hasOwn(o,r))),...NP(n,o,e),attrs:n.attrs}}function G2(e,t,n){for(let o of Object.keys(t))if(!Object.hasOwn(e,o))throw new RangeError(`schemaSpec requires a local ${n} extension named '${o}'`);for(let o of Object.keys(e))if(!Object.hasOwn(t,o))throw new RangeError(`Local ${n} extension '${o}' is not in schemaSpec`)}function zP(e,t){G2(e.nodes,t.nodes,"node"),G2(e.marks,t.marks,"mark");let n=t.spec.nodes,o=t.spec.marks;return t.spec.nodes.forEach((r,i)=>{n=n.update(r,J2(r,e.nodes[r],i,IP))}),t.spec.marks.forEach((r,i)=>{o=o.update(r,J2(r,e.marks[r],i,DP))}),{topNode:t.topNodeType.name,nodes:n,marks:o}}function _C(e){let t=e.filter((n,o)=>e.indexOf(n)!==o);return Array.from(new Set(t))}function qi(e){return{baseExtensions:e.filter(t=>t.type==="extension"),nodeExtensions:e.filter(t=>t.type==="node"),markExtensions:e.filter(t=>t.type==="mark")}}function oy(e){let t=[],{nodeExtensions:n,markExtensions:o}=qi(e),r=[...n,...o],i={default:null,validate:void 0,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1},s=n.filter(u=>u.name!=="text").map(u=>u.name),a=o.map(u=>u.name),l=[...s,...a];return e.forEach(u=>{let c=J(u,"addGlobalAttributes",{name:u.name,options:u.options,storage:u.storage,extensions:r});c&&c().forEach(d=>{let f;Array.isArray(d.types)?f=d.types:d.types==="*"?f=l:d.types==="nodes"?f=s:d.types==="marks"?f=a:f=[],f.forEach(h=>{Object.entries(d.attributes).forEach(([p,m])=>{t.push({type:h,name:p,attribute:{...i,...m}})})})})}),r.forEach(u=>{let c=J(u,"addAttributes",{name:u.name,options:u.options,storage:u.storage});if(!c)return;let d=c();Object.entries(d).forEach(([f,h])=>{let p={...i,...h};typeof p?.default=="function"&&(p.default=p.default()),p?.isRequired&&p?.default===void 0&&delete p.default,t.push({type:u.name,name:f,attribute:p})})}),t}function Xb(e){return typeof e=="function"}function Ce(e,t=void 0,...n){return Xb(e)?t?e.bind(t)(...n):e(...n):e}function OP(e={}){return Object.keys(e).length===0&&e.constructor===Object}function RP(e){let t=[],n="",o=!1,r=!1,i=0,s=e.length;for(let a=0;a<s;a+=1){let l=e[a];if(l==="'"&&!r){o=!o,n+=l;continue}if(l==='"'&&!o){r=!r,n+=l;continue}if(!o&&!r){if(l==="("){i+=1,n+=l;continue}if(l===")"&&i>0){i-=1,n+=l;continue}if(l===";"&&i===0){t.push(n),n="";continue}}n+=l}return n&&t.push(n),t}function Q2(e){let t=[],n=RP(e||""),o=n.length;for(let r=0;r<o;r+=1){let i=n[r],s=i.indexOf(":");if(s===-1)continue;let a=i.slice(0,s).trim(),l=i.slice(s+1).trim();a&&l&&t.push([a,l])}return t}function fe(...e){return e.filter(t=>!!t).reduce((t,n)=>{let o={...t};return Object.entries(n).forEach(([r,i])=>{if(r==="__proto__"){Object.defineProperty(o,r,{configurable:!0,enumerable:!0,value:i,writable:!0});return}if(!o[r]){o[r]=i;return}if(r==="class"){let s=i?String(i).split(" "):[],a=o[r]?o[r].split(" "):[],l=s.filter(u=>!a.includes(u));o[r]=[...a,...l].join(" ")}else if(r==="style"){let s=new Map([...Q2(o[r]),...Q2(i)]);o[r]=Array.from(s.entries()).map(([a,l])=>`${a}: ${l}`).join("; ")}else o[r]=i}),o},{})}function $r(e,t){return t.filter(n=>n.type===e.type.name).filter(n=>n.attribute.rendered).map(n=>n.attribute.renderHTML?n.attribute.renderHTML(e.attrs)||{}:{[n.name]:e.attrs[n.name]}).reduce((n,o)=>fe(n,o),{})}function PP(e){return typeof e!="string"?e:e.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(e):e==="true"?!0:e==="false"?!1:e}function X2(e,t){return"style"in e?e:{...e,getAttrs:n=>{let o=e.getAttrs?e.getAttrs(n):e.attrs;if(o===!1)return!1;let r=t.reduce((i,s)=>{let a=s.attribute.parseHTML?s.attribute.parseHTML(n):PP(n.getAttribute(s.name));return a==null?i:{...i,[s.name]:a}},{});return{...o,...r}}}}function Y2(e){return Object.fromEntries(Object.entries(e).filter(([t,n])=>t==="attrs"&&OP(n)?!1:n!=null))}function eC(e){var t,n;let o={};return!(!(e==null||(t=e.attribute)===null||t===void 0)&&t.isRequired)&&"default"in(e?.attribute||{})&&(o.default=e.attribute.default),(e==null||(n=e.attribute)===null||n===void 0?void 0:n.validate)!==void 0&&(o.validate=e.attribute.validate),[e.name,o]}function tC(e,t,n=oy(e)){var o;let{nodeExtensions:r,markExtensions:i}=qi(e);return{topNode:(o=r.find(s=>J(s,"topNode")))===null||o===void 0?void 0:o.name,nodes:Object.fromEntries(r.map(s=>{let a=n.filter(h=>h.type===s.name),l={name:s.name,options:s.options,storage:s.storage,editor:t},u=Y2({...e.reduce((h,p)=>{let m=J(p,"extendNodeSchema",l);return{...h,...m?m(s):{}}},{}),content:Ce(J(s,"content",l)),marks:Ce(J(s,"marks",l)),group:Ce(J(s,"group",l)),inline:Ce(J(s,"inline",l)),atom:Ce(J(s,"atom",l)),selectable:Ce(J(s,"selectable",l)),draggable:Ce(J(s,"draggable",l)),code:Ce(J(s,"code",l)),whitespace:Ce(J(s,"whitespace",l)),linebreakReplacement:Ce(J(s,"linebreakReplacement",l)),defining:Ce(J(s,"defining",l)),isolating:Ce(J(s,"isolating",l)),attrs:Object.fromEntries(a.map(eC))}),c=Ce(J(s,"parseHTML",l));c&&(u.parseDOM=c.map(h=>X2(h,a)));let d=J(s,"renderHTML",l);d&&(u.toDOM=h=>d({node:h,HTMLAttributes:$r(h,a)}));let f=J(s,"renderText",l);return f&&(u.toText=f),[s.name,u]})),marks:Object.fromEntries(i.map(s=>{let a=n.filter(f=>f.type===s.name),l={name:s.name,options:s.options,storage:s.storage,editor:t},u=Y2({...e.reduce((f,h)=>{let p=J(h,"extendMarkSchema",l);return{...f,...p?p(s):{}}},{}),inclusive:Ce(J(s,"inclusive",l)),excludes:Ce(J(s,"excludes",l)),group:Ce(J(s,"group",l)),spanning:Ce(J(s,"spanning",l)),code:Ce(J(s,"code",l)),attrs:Object.fromEntries(a.map(eC))}),c=Ce(J(s,"parseHTML",l));c&&(u.parseDOM=c.map(f=>X2(f,a)));let d=J(s,"renderHTML",l);return d&&(u.toDOM=f=>d({mark:f,HTMLAttributes:$r(f,a)})),[s.name,u]}))}}function LP(e,t,n){if(n===void 0)return new Vn(tC(e,t));let o=_C(e.filter(s=>s.type!=="extension").map(s=>s.name));if(o.length)throw new RangeError(`Duplicate local schema types: ${o.join(", ")}`);let r=new Vn(n),i=tC(e,t,SC(oy(e),r));return new Vn(zP(i,r))}function Ua(e){return e.sort((n,o)=>{let r=J(n,"priority")||100,i=J(o,"priority")||100;return r>i?-1:r<i?1:0})}function EC(e){let t=Ua(ry(e)),n=_C(t.map(o=>o.name));return n.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${n.map(o=>`'${o}'`).join(", ")}]. This can lead to issues.`),t}function CC(e,t,n){let{from:o,to:r}=t,{blockSeparator:i=`
`,textSerializers:s={}}=n||{},a="";return e.nodesBetween(o,r,(l,u,c,d)=>{l.isBlock&&u>o&&(a+=i);let f=s?.[l.type.name];if(f)return c&&(a+=f({node:l,pos:u,parent:c,index:d,range:t})),!1;if(l.isText){var h;a+=l==null||(h=l.text)===null||h===void 0?void 0:h.slice(Math.max(o,u)-u,r-u)}}),a}function FP(e,t){return CC(e,{from:0,to:e.content.size},t)}function TC(e){return Object.fromEntries(Object.entries(e.nodes).filter(([,t])=>t.spec.toText).map(([t,n])=>[t,n.spec.toText]))}function jP(e,t){let n=st(t,e.schema),{from:o,to:r}=e.selection,i=[];e.doc.nodesBetween(o,r,a=>{i.push(a)});let s=i.reverse().find(a=>a.type.name===n.name);return s?{...s.attrs}:{}}function iy(e,t){let n=Cd(typeof t=="string"?t:t.name,e.schema);return n==="node"?jP(e,t):n==="mark"?kC(e,t):{}}function BP(e,t=JSON.stringify){let n={};return e.filter(o=>{let r=t(o);return Object.prototype.hasOwnProperty.call(n,r)?!1:n[r]=!0})}function UP(e){let t=BP(e);return t.length===1?t:t.filter((n,o)=>!t.filter((r,i)=>i!==o).some(r=>n.oldRange.from>=r.oldRange.from&&n.oldRange.to<=r.oldRange.to&&n.newRange.from>=r.newRange.from&&n.newRange.to<=r.newRange.to))}function Wi(e){let{mapping:t,steps:n}=e,o=[],r=t.invert();return t.maps.forEach((i,s)=>{let a=[];if(i.ranges.length)i.forEach((u,c)=>{a.push({from:u,to:c})});else{let{from:u,to:c}=n[s];if(u===void 0||c===void 0)return;a.push({from:u,to:c})}let l=t.slice(s);a.forEach(({from:u,to:c})=>{let d=l.map(u,-1),f=l.map(c),h=r.map(d,-1),p=r.map(f);o.push({oldRange:{from:h,to:p},newRange:{from:d,to:f}})})}),UP(o)}function Ha(e,t,n){let o=[];return e===t?n.resolve(e).marks().forEach(r=>{let i=ty(n.resolve(e),r.type);i&&o.push({mark:r,...i})}):n.nodesBetween(e,t,(r,i)=>{!r||r?.nodeSize===void 0||o.push(...r.marks.map(s=>({from:i,to:i+r.nodeSize,mark:s})))}),o}var AC=(e,t,n,o=20)=>{let r=e.doc.resolve(n),i=o,s=null;for(;i>0&&s===null;){let a=r.node(i);a?.type.name===t?s=a:i-=1}return[s,i]},MC=e=>{let t=e.depth-1;if(t<0)return null;let n=e.index(t);return n===0?null:e.node(t).child(n-1)};function Li(e,t){return t.nodes[e]||t.marks[e]||null}function wd(e,t,n){return Object.fromEntries(Object.entries(n).filter(([o])=>{let r=e.find(i=>i.type===t&&i.name===o);return r?r.attribute.keepOnSplit:!1}))}var HP=(e,t=500)=>{let n="",o=e.parentOffset;return e.parent.nodesBetween(Math.max(0,o-t),o,(r,i,s,a)=>{var l,u;let c=((l=(u=r.type.spec).toText)===null||l===void 0?void 0:l.call(u,{node:r,pos:i,parent:s,index:a}))||r.textContent||"%leaf%";n+=r.isAtom&&!r.isText?c:c.slice(0,Math.max(0,o-i))}),n};function Yb(e,t,n={}){let{empty:o,ranges:r}=e.selection,i=t?rr(t,e.schema):null;if(o)return!!(e.storedMarks||e.selection.$from.marks()).filter(c=>i?i.name===c.type.name:!0).find(c=>Sd(c.attrs,n,{strict:!1}));let s=0,a=[];if(r.forEach(({$from:c,$to:d})=>{let f=c.pos,h=d.pos;e.doc.nodesBetween(f,h,(p,m)=>{if(i&&p.inlineContent&&!p.type.allowsMarkType(i))return!1;if(!p.isText&&!p.marks.length)return;let g=Math.max(f,m),b=Math.min(h,m+p.nodeSize),y=b-g;s+=y,a.push(...p.marks.map(k=>({mark:k,from:g,to:b})))})}),s===0)return!1;let l=a.filter(c=>i?i.name===c.mark.type.name:!0).filter(c=>Sd(c.mark.attrs,n,{strict:!1})).reduce((c,d)=>c+d.to-d.from,0),u=a.filter(c=>i?c.mark.type!==i&&c.mark.type.excludes(i):!0).reduce((c,d)=>c+d.to-d.from,0);return(l>0?l+u:l)>=s}function qP(e,t,n={}){if(!t)return On(e,null,n)||Yb(e,null,n);let o=Cd(t,e.schema);return o==="node"?On(e,t,n):o==="mark"?Yb(e,t,n):!1}var $C=(e,t)=>{let{$from:n,$to:o,$anchor:r}=e.selection;if(t){let i=Td(a=>a.type.name===t)(e.selection);if(!i)return!1;let s=e.doc.resolve(i.pos+1);return r.pos+1===s.end()}return!(o.parentOffset<o.parent.nodeSize-2||n.pos!==o.pos)},IC=e=>{let{$from:t,$to:n}=e.selection;return!(t.parentOffset>0||t.pos!==n.pos)};function nC(e,t){return Array.isArray(t)?t.some(n=>(typeof n=="string"?n:n.name)===e.name):t}function ja(e,t){let{nodeExtensions:n}=qi(t),o=n.find(i=>i.name===e);if(!o)return!1;let r=Ce(J(o,"group",{name:o.name,options:o.options,storage:o.storage}));return typeof r!="string"?!1:r.split(" ").includes("list")}function Ki(e,{checkChildren:t=!0,ignoreWhitespace:n=!1}={}){if(n){if(e.type.name==="hardBreak")return!0;if(e.isText){var o;return!/\S/.test((o=e.text)!==null&&o!==void 0?o:"")}}if(e.isText)return!e.text;if(e.isAtom||e.isLeaf)return!1;if(e.content.childCount===0)return!0;if(t){let r=!0;return e.content.forEach(i=>{r!==!1&&(Ki(i,{ignoreWhitespace:n,checkChildren:t})||(r=!1))}),r}return!1}function Ad(e){return e instanceof X}function ZP(e){if(e===null||typeof e!="object")return!1;let t=e;return!(typeof t.apply!="function"||typeof t.getMap!="function"||typeof t.invert!="function"||typeof t.map!="function"||typeof t.merge!="function"||typeof t.toJSON!="function")}function VP(e){if(e===null||typeof e!="object")return!1;let t=e;if(!ZP(t))return!1;let n=t.toJSON();return!(n===null||typeof n!="object"||n.stepType!=="replace")}var DC=class NC{constructor(t){this.position=t}static fromJSON(t){return new NC(t.position)}toJSON(){return{position:this.position}}};function WP(e,t){let n=t.mapping.mapResult(e.position);return{position:new DC(n.pos),mapResult:n}}function KP(e){return new DC(e)}function JP(e,t,n){let{selection:o}=t,r=null;if(pC(o)&&(r=o.$cursor),r){var i;let a=(i=e.storedMarks)!==null&&i!==void 0?i:r.marks();return r.parent.type.allowsMarkType(n)&&(!!n.isInSet(a)||!a.some(l=>l.type.excludes(n)))}let{ranges:s}=o;return s.some(({$from:a,$to:l})=>{let u=a.depth===0?e.doc.inlineContent&&e.doc.type.allowsMarkType(n):!1;return e.doc.nodesBetween(a.pos,l.pos,(c,d,f)=>{if(u)return!1;if(c.isInline){let h=!f||f.type.allowsMarkType(n),p=!!n.isInSet(c.marks)||!c.marks.some(m=>m.type.excludes(n));u=h&&p}return!u}),u})}var GP=(e,t={})=>({tr:n,state:o,dispatch:r})=>{let{selection:i}=n,{empty:s,ranges:a}=i,l=rr(e,o.schema);if(r)if(s){let u=kC(o,l);n.addStoredMark(l.create({...u,...t}))}else a.forEach(u=>{let c=u.$from.pos,d=u.$to.pos;o.doc.nodesBetween(c,d,(f,h)=>{let p=Math.max(h,c),m=Math.min(h+f.nodeSize,d);f.marks.find(g=>g.type===l)?f.marks.forEach(g=>{l===g.type&&n.addMark(p,m,l.create({...g.attrs,...t}))}):n.addMark(p,m,l.create(t))})});return JP(o,n,l)},QP=(e,t)=>({tr:n})=>(n.setMeta(e,t),!0),XP=(e,t={})=>({state:n,dispatch:o,chain:r})=>{let i=st(e,n.schema),s;return n.selection.$anchor.sameParent(n.selection.$head)&&(s=n.selection.$anchor.parent.attrs),i.isTextblock?r().command(({commands:a})=>cb(i,{...s,...t})(n)?!0:a.clearNodes()).command(({state:a})=>cb(i,{...s,...t})(a,o)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},YP=e=>({tr:t,dispatch:n})=>{if(n){let{doc:o}=t,r=xo(e,0,o.content.size),i=X.create(o,r);t.setSelection(i)}return!0},eL=(e,t)=>({tr:n,state:o,dispatch:r})=>{let{selection:i}=o,s,a;return typeof t=="number"?(s=t,a=t):t&&"from"in t&&"to"in t?(s=t.from,a=t.to):(s=i.from,a=i.to),r&&n.doc.nodesBetween(s,a,(l,u)=>{l.isText||n.setNodeMarkup(u,void 0,{...l.attrs,dir:e})}),!0},tL=e=>({tr:t,dispatch:n})=>{if(n){let{doc:o}=t,{from:r,to:i}=typeof e=="number"?{from:e,to:e}:e,s=Z.atStart(o).from,a=Z.atEnd(o).to,l=xo(r,s,a),u=xo(i,s,a),c=Z.create(o,l,u);t.setSelection(c)}return!0},nL=e=>({state:t,dispatch:n})=>{let o=st(e,t.schema);return TE(o)(t,n)};function rC(e,t){let n=e.storedMarks||e.selection.$to.parentOffset&&e.selection.$from.marks();if(n){let o=n.filter(r=>t?.includes(r.type.name));e.tr.ensureMarks(o)}}var rL=({keepMarks:e=!0}={})=>({tr:t,state:n,dispatch:o,editor:r})=>{let{selection:i,doc:s}=t,{$from:a,$to:l}=i,u=r.extensionManager.attributes,c=wd(u,a.node().type.name,a.node().attrs);if(i instanceof X&&i.node.isBlock)return!a.parentOffset||!on(s,a.pos)?!1:(o&&(e&&rC(n,r.extensionManager.splittableMarks),t.split(a.pos).scrollIntoView()),!0);if(!a.parent.isBlock)return!1;let d=l.parentOffset===l.parent.content.size,f=a.depth===0?void 0:yC(a.node(-1).contentMatchAt(a.indexAfter(-1))),h=d&&f?[{type:f,attrs:c}]:void 0,p=i instanceof Z&&!i.empty?ao.create({doc:t.doc,selection:i}).tr.deleteSelection():null,m=p?p.doc:t.doc,g=p?p.mapping.map(a.pos):a.pos,b=on(m,g,1,h);if(!h&&!b&&on(m,g,1,f?[{type:f}]:void 0)&&(b=!0,h=f?[{type:f,attrs:c}]:void 0),o){if(b){let y=t.steps.length;if(i instanceof Z&&t.deleteSelection(),t.split(t.mapping.slice(y).map(a.pos),1,h),f&&!d&&!a.parentOffset&&a.parent.type!==f){let k=t.mapping.slice(y).map(a.before()),x=t.doc.resolve(k);a.node(-1).canReplaceWith(x.index(),x.index()+1,f)&&t.setNodeMarkup(t.mapping.slice(y).map(a.before()),f)}}e&&rC(n,r.extensionManager.splittableMarks),t.scrollIntoView()}return b},oL=(e,t={})=>({tr:n,state:o,dispatch:r,editor:i})=>{let s=st(e,o.schema),{$from:a,$to:l}=o.selection,u=o.selection.node;if(u&&u.isBlock||a.depth<2||!a.sameParent(l))return!1;let c=a.node(-1);if(c.type!==s)return!1;let d=i.extensionManager.attributes;if(a.parent.content.size===0&&a.node(-1).childCount===a.indexAfter(-1)){if(a.depth===2||a.node(-3).type!==s||a.index(-2)!==a.node(-2).childCount-1)return!1;if(r){var f;let x=M.empty,E=a.index(-1)?1:a.index(-2)?2:3;for(let Oe=a.depth-E;Oe>=a.depth-3;Oe-=1)x=M.from(a.node(Oe).copy(x));let I=a.indexAfter(-1)<a.node(-2).childCount?1:a.indexAfter(-2)<a.node(-3).childCount?2:3,N={...wd(d,a.node().type.name,a.node().attrs),...t},D=((f=s.contentMatch.defaultType)===null||f===void 0?void 0:f.createAndFill(N))||void 0;x=x.append(M.from(s.createAndFill(null,D)||void 0));let W=a.before(a.depth-(E-1));n.replace(W,a.after(-I),new F(x,4-E,0));let re=-1;n.doc.nodesBetween(W,n.doc.content.size,(Oe,We)=>{if(re>-1)return!1;Oe.isTextblock&&Oe.content.size===0&&(re=We+1)}),re>-1&&n.setSelection(Z.near(n.doc.resolve(re))),n.scrollIntoView()}return!0}let h=l.pos===a.end()?c.contentMatchAt(0).defaultType:null,p={...wd(d,c.type.name,c.attrs),...t},m={...wd(d,a.node().type.name,a.node().attrs),...t},g=a.parentOffset===0&&a.index(-1)===0,b=a.before(-1);n.delete(a.pos,l.pos);let y=g?c.attrs:p,k=h?[{type:s,attrs:y},{type:h,attrs:m}]:[{type:s,attrs:y}];if(!on(n.doc,a.pos,2))return!1;if(r){let{selection:x,storedMarks:E}=o,{splittableMarks:I}=i.extensionManager,N=E||x.$to.parentOffset&&x.$from.marks();if(n.split(a.pos,2,k).scrollIntoView(),g&&n.setNodeMarkup(b,void 0,p),!N||!r)return!0;let D=N.filter(W=>I.includes(W.type.name));n.ensureMarks(D)}return!0};function zC(e,t,n){if(!e.validContent(t))return null;try{return e.create(n,t)}catch{return null}}function sy(e,t){if(e.pendingContent.length===0)return!0;let n=zC(t,M.from(e.pendingContent));return n?(e.items.push(n),e.pendingContent=[],!0):!1}function iL(e,t,n){return n.validContent(M.from([...t.pendingContent,e]))?(t.pendingContent.push(e),!0):!sy(t,n)||!n.validContent(M.from(e))?!1:(t.pendingContent.push(e),!0)}function sL(e,t,n,o){let r=o(e,n);if(!r)return!1;let i=zC(n.listType,M.from(r),e.attrs);return i?n.itemType.validContent(M.from([...t.pendingContent,i]))?(t.pendingContent.push(i),!0):sy(t,n.itemType)?(t.items.push(...r),!0):!1:!1}function aL(e,t,n){let o={items:[],pendingContent:[]};for(let r=0;r<e.childCount;r+=1){let i=e.child(r);if(!(t.isListNode(i)?sL(i,o,t,n):iL(i,o,t.itemType)))return null}return sy(o,t.itemType)?o.items:null}function OC(e,t){let n=[];for(let o=0;o<e.childCount;o+=1){let r=aL(e.child(o),t,OC);if(!r)return null;n.push(...r)}return n}function oC(e,t){let n=null;return e.descendants((o,r)=>o!==t?!0:(n=r,!1)),n}function iC(e){return!e||e==="1"?null:e}function RC(e,t){return iC(e)===iC(t)}var yd=(e,t)=>{let n=Td(i=>i.type===t)(e.selection);if(!n)return!0;let o=e.doc.resolve(Math.max(0,n.pos-1)).before(n.depth);if(o===void 0)return!0;let r=e.doc.nodeAt(o);return!(n.node.type===r?.type&&gn(e.doc,n.pos))||!RC(n.node.attrs.type,r?.attrs.type)||e.join(n.pos),!0},vd=(e,t)=>{let n=Td(i=>i.type===t)(e.selection);if(!n)return!0;let o=e.doc.resolve(n.start).after(n.depth);if(o===void 0)return!0;let r=e.doc.nodeAt(o);return!(n.node.type===r?.type&&gn(e.doc,o))||!RC(n.node.attrs.type,r?.attrs.type)||e.join(o),!0};function lL(e){let t=e.doc,n=t.firstChild;if(!n)return null;let o=t.resolve(1),r=t.resolve(n.nodeSize-1);return Z.between(o,r)}var uL=(e,t,n,o={})=>({editor:r,tr:i,state:s,dispatch:a,chain:l,commands:u,can:c})=>{let{extensions:d,splittableMarks:f}=r.extensionManager,h=st(e,s.schema),p=st(t,s.schema),{selection:m,storedMarks:g}=s,{$from:b,$to:y}=m,k=b.blockRange(y),x=g||m.$to.parentOffset&&m.$from.marks();if(!k)return!1;let E=Td(xe=>ja(xe.type.name,d))(m),I=m.from===0&&m.to===s.doc.content.size,N=s.doc.content.content,D=N.length===1?N[0]:null,W=I&&D&&ja(D.type.name,d)?{node:D,pos:0,depth:0}:null,re=E??W,Oe=!!E&&k.depth>=1&&k.depth-E.depth<=1,We=!!W;if((Oe||We)&&re){if(re.node.type===h)return I&&We?l().command(({tr:xe,dispatch:oe})=>{let A=lL(xe);return A?(xe.setSelection(A),oe&&oe(xe),!0):!1}).liftListItem(p).run():u.liftListItem(p);if(ja(re.node.type.name,d)&&h.validContent(re.node.content))return l().command(()=>(i.setNodeMarkup(re.pos,h),!0)).command(()=>yd(i,h)).command(()=>vd(i,h)).run();if(ja(re.node.type.name,d)){var Ge;let xe=(Ge=re.node.firstChild)===null||Ge===void 0?void 0:Ge.type;if(xe&&xe!==p){let oe=OC(re.node,{listType:h,itemType:p,isListNode:H=>ja(H.type.name,d)}),A=oe?M.from(oe):null;return!A||!h.validContent(A)?!1:l().command(()=>{let{$anchor:H,$head:q}=i.selection,te=H.parent,se=q.parent,w=H.parentOffset,_=q.parentOffset,O;try{O=h.create(o,A)}catch{return!1}if(i.replaceWith(re.pos,re.pos+re.node.nodeSize,O),te.inlineContent&&se.inlineContent){let P=oC(O,te),ne=oC(O,se);if(P!==null&&ne!==null){let Y=re.pos+P+2+w,we=re.pos+ne+2+_;i.setSelection(Z.create(i.doc,Y,we))}}return!0}).command(()=>yd(i,h)).command(()=>vd(i,h)).run()}}}return!n||!x||!a?l().command(()=>c().wrapInList(h,o)?!0:u.clearNodes()).wrapInList(h,o).command(()=>yd(i,h)).command(()=>vd(i,h)).run():l().command(()=>{let xe=c().wrapInList(h,o),oe=x.filter(A=>f.includes(A.type.name));return i.ensureMarks(oe),xe?!0:u.clearNodes()}).wrapInList(h,o).command(()=>yd(i,h)).command(()=>vd(i,h)).run()},cL=(e,t={},n={})=>({state:o,commands:r})=>{let{extendEmptyMarkRange:i=!1}=n,s=rr(e,o.schema);return Yb(o,s,t)?r.unsetMark(s,{extendEmptyMarkRange:i}):r.setMark(s,t)},dL=(e,t,n={})=>({state:o,commands:r})=>{let i=st(e,o.schema),s=st(t,o.schema),a=On(o,i,n),l;return o.selection.$anchor.sameParent(o.selection.$head)&&(l=o.selection.$anchor.parent.attrs),a?r.setNode(s,l):r.setNode(i,{...l,...n})},fL=(e,t={})=>({state:n,commands:o})=>{let r=st(e,n.schema);return On(n,r,t)?o.lift(r):o.wrapIn(r,t)},pL=()=>({state:e,dispatch:t})=>{let n=e.plugins;for(let o=0;o<n.length;o+=1){let r=n[o],i;if(r.spec.isInputRules&&(i=r.getState(e))){if(t){let s=e.tr,a=i.transform;for(let l=a.steps.length-1;l>=0;l-=1)s.step(a.steps[l].invert(a.docs[l]));if(i.text){let l=s.doc.resolve(i.from).marks();s.replaceWith(i.from,i.to,e.schema.text(i.text,l))}else s.delete(i.from,i.to)}return!0}}return!1},hL=(e={})=>({tr:t,dispatch:n,editor:o})=>{let{ignoreClearable:r=!1}=e,{selection:i}=t,{empty:s,ranges:a}=i;if(s)return!0;let{nonClearableMarks:l}=o.extensionManager;if(n){let u=Object.values(o.schema.marks).filter(c=>r||!l.includes(c.name));a.forEach(c=>{for(let d of u)t.removeMark(c.$from.pos,c.$to.pos,d)})}return!0},mL=(e,t={})=>({tr:n,state:o,dispatch:r})=>{let{extendEmptyMarkRange:i=!1}=t,{selection:s}=n,a=rr(e,o.schema),{$from:l,empty:u,ranges:c}=s;if(!r)return!0;if(u&&i){var d;let{from:f,to:h}=s,p=ty(l,a,(d=l.marks().find(m=>m.type===a))===null||d===void 0?void 0:d.attrs);p&&(f=p.from,h=p.to),n.removeMark(f,h,a)}else c.forEach(f=>{n.removeMark(f.$from.pos,f.$to.pos,a)});return n.removeStoredMark(a),!0},gL=e=>({tr:t,state:n,dispatch:o})=>{let{selection:r}=n,i,s;return typeof e=="number"?(i=e,s=e):e&&"from"in e&&"to"in e?(i=e.from,s=e.to):(i=r.from,s=r.to),o&&t.doc.nodesBetween(i,s,(a,l)=>{if(a.isText)return;let u={...a.attrs};delete u.dir,t.setNodeMarkup(l,void 0,u)}),!0},bL=(e,t={})=>({tr:n,state:o,dispatch:r})=>{let i=null,s=null,a=Cd(typeof e=="string"?e:e.name,o.schema);if(!a)return!1;a==="node"&&(i=st(e,o.schema)),a==="mark"&&(s=rr(e,o.schema));let l=!1;return n.selection.ranges.forEach(u=>{let c=u.$from.pos,d=u.$to.pos,f,h,p,m;n.selection.empty?o.doc.nodesBetween(c,d,(g,b)=>{i&&i===g.type&&(l=!0,p=Math.max(b,c),m=Math.min(b+g.nodeSize,d),f=b,h=g)}):o.doc.nodesBetween(c,d,(g,b)=>{b<c&&i&&i===g.type&&(l=!0,p=Math.max(b,c),m=Math.min(b+g.nodeSize,d),f=b,h=g),b>=c&&b<=d&&(i&&i===g.type&&(l=!0,r&&n.setNodeMarkup(b,void 0,{...g.attrs,...t})),s&&g.marks.length&&g.marks.forEach(y=>{if(s===y.type&&(l=!0,r)){let k=Math.max(b,c),x=Math.min(b+g.nodeSize,d);n.addMark(k,x,s.create({...y.attrs,...t}))}}))}),h&&(f!==void 0&&r&&n.setNodeMarkup(f,void 0,{...h.attrs,...t}),s&&h.marks.length&&h.marks.forEach(g=>{s===g.type&&r&&n.addMark(p,m,s.create({...g.attrs,...t}))}))}),l},ji=new ke("__tiptap_decorations__"),yL=e=>({tr:t,dispatch:n})=>(n&&t.setMeta(ji,{type:"force",name:e}),!0),vL=(e,t={})=>({state:n,dispatch:o})=>{let r=st(e,n.schema);return _E(r,t)(n,o)},xL=(e,t={})=>({state:n,dispatch:o})=>{let r=st(e,n.schema);return EE(r,t)(n,o)},kL=Ig({blur:()=>jR,clearContent:()=>BR,clearNodes:()=>UR,command:()=>HR,createParagraphNear:()=>qR,cut:()=>ZR,deleteCurrentNode:()=>VR,deleteNode:()=>WR,deleteRange:()=>KR,deleteSelection:()=>QR,enter:()=>XR,exitCode:()=>YR,extendMarkRange:()=>eP,first:()=>tP,focus:()=>rP,forEach:()=>oP,insertContent:()=>iP,insertContentAt:()=>sP,insertDefaultBlock:()=>aP,joinBackward:()=>cP,joinDown:()=>uP,joinForward:()=>dP,joinItemBackward:()=>fP,joinItemForward:()=>pP,joinTextblockBackward:()=>hP,joinTextblockForward:()=>mP,joinUp:()=>lP,keyboardShortcut:()=>bP,lift:()=>yP,liftEmptyBlock:()=>vP,liftListItem:()=>xP,newlineInCode:()=>kP,resetAttributes:()=>wP,scrollIntoView:()=>SP,selectAll:()=>_P,selectNodeBackward:()=>EP,selectNodeForward:()=>CP,selectParentNode:()=>TP,selectTextblockEnd:()=>AP,selectTextblockStart:()=>MP,setContent:()=>$P,setMark:()=>GP,setMeta:()=>QP,setNode:()=>XP,setNodeSelection:()=>YP,setTextDirection:()=>eL,setTextSelection:()=>tL,sinkListItem:()=>nL,splitBlock:()=>rL,splitListItem:()=>oL,toggleList:()=>uL,toggleMark:()=>cL,toggleNode:()=>dL,toggleWrap:()=>fL,undoInputRule:()=>pL,unsetAllMarks:()=>hL,unsetMark:()=>mL,unsetTextDirection:()=>gL,updateAttributes:()=>bL,updateDecorations:()=>yL,wrapIn:()=>vL,wrapInList:()=>xL}),Bi=new WeakMap;function wL(e,t){var n;Bi.set(e,((n=Bi.get(e))!==null&&n!==void 0?n:0)+1);try{return t()}finally{var o;let r=((o=Bi.get(e))!==null&&o!==void 0?o:1)-1;r>0?Bi.set(e,r):Bi.delete(e)}}function SL(e){return Bi.has(e)}var _L=class{constructor(){this.callbacks={}}on(e,t){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(t),this}emit(e,...t){let n=this.callbacks[e];return n&&n.forEach(o=>o.apply(this,t)),this}off(e,t){let n=this.callbacks[e];return n&&(t?this.callbacks[e]=n.filter(o=>o!==t):delete this.callbacks[e]),this}once(e,t){let n=(...o)=>{this.off(e,n),t.apply(this,o)};return this.on(e,n)}removeAllListeners(){this.callbacks={}}},PC=typeof process<"u"&&!1;function EL(e){return e.kind==="widget"}function LC(e,t){let n=[],o=new Set;for(let r of e)r.kind==="widget"&&EL(r)&&o.add(r.key),n.push(r.toPMDecoration(t));return{decorations:n,widgetKeys:o}}function CL(e,t,n){let{decorations:o,widgetKeys:r}=LC(t,n);return{set:Te.create(e,o),widgetKeys:r}}function FC({position:e,from:t,to:n,docSize:o}){return e<t?!1:e<n?!0:e===n&&n===o}function TL({decorations:e,from:t,to:n,docSize:o,extensionName:r,warnedExtensions:i}){return e.filter(s=>FC({position:s.anchor,from:t,to:n,docSize:o})?!0:(s.anchor===n||i.has(r)||(i.add(r),console.warn(`[tiptap warn]: Extension "${r}" returned a decoration outside the requested range [${t}, ${n}). It was ignored.`)),!1))}function jC(e){var t;let n=(t=e.spec)===null||t===void 0?void 0:t.key;return typeof n=="string"?n:void 0}function AL(e){let t=new Map,n=new Map;for(let s of e.find()){var o,r,i;let a=jC(s);if(!a)continue;let l=(o=s.spec.extensionName)!==null&&o!==void 0?o:"unknown",u=(r=t.get(a))!==null&&r!==void 0?r:new Set;u.add(l),t.set(a,u),n.set(a,((i=n.get(a))!==null&&i!==void 0?i:0)+1)}return Array.from(t,([s,a])=>({key:s,extensions:a})).filter(({key:s})=>{var a;return((a=n.get(s))!==null&&a!==void 0?a:0)>1})}function BC(e){return e.jsonID==="attr"}function ML(e){let t=!1;if(e.getMap().forEach(()=>{t=!0}),t||BC(e))return!0;let n=e;return typeof n.from=="number"&&typeof n.to=="number"}function $L(e,t){let n=null,o=0,r=0;for(let i=0;i<e.childCount&&!(r>t.to);i+=1){let s=r+e.child(i).nodeSize;s>=t.from&&(n===null&&(n=r),o=s),r=s}return n===null?null:{from:n,to:o}}function IL(e,t){if(e.steps.some(i=>!ML(i)))return{type:"full"};let n=Wi(e).map(({newRange:i})=>i);e.steps.forEach((i,s)=>{if(!BC(i))return;let a=e.mapping.slice(s);n.push({from:a.map(i.pos,-1),to:a.map(i.pos+1)})});let o=[];for(let i of n){let s=$L(t,i);s&&o.push(s)}o.sort((i,s)=>i.from-s.from);let r=[];for(let i of o){let s=r[r.length-1];s&&i.from<=s.to?s.to=Math.max(s.to,i.to):r.push({...i})}return{type:"ranges",ranges:r}}function UC(e,t,n,o){return e.map(t,n,{onRemove:r=>{let i=r?.key;typeof i=="string"&&o.delete(i)}})}function DL(e,t,n){var o,r;let i=(o=t.decorationSetsByExtension[e])!==null&&o!==void 0?o:Te.empty,s=new Set((r=t.widgetKeysByExtension[e])!==null&&r!==void 0?r:[]);return{set:UC(i,n.mapping,n.doc,s),widgetKeys:s}}function sC(e,t){let n=Object.values(t).flatMap(o=>o.find());return Te.create(e,n)}function aC(e){let t=new Set;for(let n of Object.values(e))for(let o of n)t.add(o);return t}function NL(e,t){var n;switch((n=t.update)!==null&&n!==void 0?n:"document"){case"document":if(t.createInRange)throw new Error(`[tiptap error]: Extension "${e}" provides createInRange() but does not use the "changedRanges" decoration update strategy.`);return;case"changedRanges":if(!t.createInRange)throw new Error(`[tiptap error]: Extension "${e}" uses the "changedRanges" decoration update strategy but does not provide createInRange().`);return;case"manual":if(t.createInRange)throw new Error(`[tiptap error]: Extension "${e}" uses the "manual" decoration update strategy, which is not compatible with createInRange(). createInRange() requires the "changedRanges" strategy.`);if(t.shouldUpdate)throw new Error(`[tiptap error]: Extension "${e}" cannot combine the "manual" decoration update strategy with shouldUpdate().`);return;default:throw new Error(`[tiptap error]: Extension "${e}" uses an unknown decoration update strategy. Expected "document", "changedRanges", or "manual".`)}}function zL(e,t,n){return n?!0:e.update==="manual"?!1:e.shouldUpdate?e.shouldUpdate(t):t.tr.docChanged}var OL=new Set;var RL=class{constructor(e){this.warnedWidgetKeys=new Set,this.warnedOutOfRangeExtensions=new Set,this.handleBeforeTransaction=({nextState:t})=>{let n=ji.getState(t);n&&this.warnDuplicateWidgetKeys(n)},this.editor=e.editor,this.entries=this.resolveEntries(e.entries),this.entries.forEach(({name:t,spec:n})=>NL(t,n)),this.plugin=this.entries.length>0?this.createPlugin():null,this.editor.on("beforeTransaction",this.handleBeforeTransaction)}destroy(){this.editor.off("beforeTransaction",this.handleBeforeTransaction)}liveWidgetKeys(){var e,t;return(e=(t=ji.getState(this.editor.state))===null||t===void 0?void 0:t.widgetKeys)!==null&&e!==void 0?e:OL}get mountedView(){return this.editor.isDestroyed?null:this.editor.view}resolveEntries(e){let t=[];for(let{name:n,addDecorations:o}of e){let r=o();r&&t.push({name:n,spec:r})}return t}createPlugin(){let{editor:e,entries:t}=this;return new de({key:ji,state:{init:(n,o)=>{let r={},i={};for(let{name:a,spec:l}of t){let{set:u,widgetKeys:c}=this.buildFullSet(a,l,o);r[a]=u,i[a]=c}let s={decorationSetsByExtension:r,widgetKeysByExtension:i,mergedDecorationSet:this.buildMergedSet(o.doc,r),widgetKeys:aC(i)};return this.warnDuplicateWidgetKeys(s),s},apply:(n,o,r,i)=>{let s=n.getMeta(ji),a=s?.type==="force"&&!s.name,l=s?.type==="force"?s.name:void 0,u={},c={},d=new Set;return wL(e,()=>{for(let{name:f,spec:h}of t){let p=a||l===f;if(zL(h,{editor:e,tr:n,oldState:r,newState:i},p))if(h.update==="changedRanges"&&n.docChanged&&!p){let m=this.applyChangedRangesRecompute(f,h,o,n,i);u[f]=m.set,c[f]=m.widgetKeys,d.add(f)}else{let{set:m,widgetKeys:g}=this.buildFullSet(f,h,i);u[f]=m,c[f]=g,d.add(f)}else{let m=DL(f,o,n);u[f]=m.set,c[f]=m.widgetKeys}}}),d.size===0&&!n.docChanged?o:{decorationSetsByExtension:u,widgetKeysByExtension:c,mergedDecorationSet:this.mergeAfterApply({entries:t,previous:o,tr:n,decorationSetsByExtension:u,recomputedNames:d}),widgetKeys:aC(c)}}},props:{decorations(n){var o,r;return(o=(r=ji.getState(n))===null||r===void 0?void 0:r.mergedDecorationSet)!==null&&o!==void 0?o:Te.empty}}})}applyChangedRangesRecompute(e,t,n,o,r){let i=IL(o,r.doc);return i.type==="full"?this.buildFullSet(e,t,r):this.rebuildRanges(e,t,n,o,r,i.ranges)}rebuildRanges(e,t,n,o,r,i){var s,a;let l=(s=n.decorationSetsByExtension[e])!==null&&s!==void 0?s:Te.empty,u=new Set((a=n.widgetKeysByExtension[e])!==null&&a!==void 0?a:[]),c=UC(l,o.mapping,o.doc,u),d=r.doc.content.size;for(let{from:f,to:h}of i){let p=c.find(f,h).filter(b=>FC({position:b.from,from:f,to:h,docSize:d}));for(let b of p){let y=jC(b);y&&u.delete(y)}c=c.remove(p);let{decorations:m,widgetKeys:g}=LC(TL({decorations:this.runCreate(e,"createInRange",()=>t.createInRange({editor:this.editor,state:r,view:this.mountedView,from:f,to:h})),from:f,to:h,docSize:d,extensionName:e,warnedExtensions:this.warnedOutOfRangeExtensions}),e);c=c.add(r.doc,m);for(let b of g)u.add(b)}return{set:c,widgetKeys:u}}buildFullSet(e,t,n){let o=this.runCreate(e,"create",()=>t.create({editor:this.editor,state:n,view:this.mountedView}));return CL(n.doc,o,e)}runCreate(e,t,n){try{return n()}catch(o){return console.error(`[tiptap error]: Extension "${e}" threw in \`addDecorations().${t}()\`. Its decorations were dropped for this update.`,o),[]}}warnDuplicateWidgetKeys(e){if(!PC)return;if(e.widgetKeys.size===0){this.warnedWidgetKeys.clear();return}let t=AL(e.mergedDecorationSet),n=new Set(t.map(({key:o})=>o));for(let{key:o,extensions:r}of t){if(this.warnedWidgetKeys.has(o))continue;let i=Array.from(r).map(s=>`"${s}"`).join(", ");console.warn(`[tiptap warn]: Duplicate widget decoration key "${o}" in extension${r.size===1?"":"s"} ${i}. Widget decoration keys must be globally unique, otherwise ProseMirror misplaces the widget DOM. Use a stable, unique key (e.g. \`comment-\${id}\`).`)}this.warnedWidgetKeys=n}buildMergedSet(e,t){let n=Object.keys(t);return n.length===1?t[n[0]]:sC(e,t)}mergeAfterApply({entries:e,previous:t,tr:n,decorationSetsByExtension:o,recomputedNames:r}){return e.length===1?o[e[0].name]:r.size===0?t.mergedDecorationSet.map(n.mapping,n.doc):sC(n.doc,o)}};function HC(e,t){let{selection:n}=e,{$from:o}=n;if(n instanceof X){let i=o.index();return o.parent.canReplaceWith(i,i+1,t)}let r=o.depth;for(;r>=0;){let i=o.index(r);if(o.node(r).contentMatchAt(i).matchType(t))return!0;r-=1}return!1}function PL(e,t,n){let o=document.querySelector(`style[data-tiptap-style${n?`-${n}`:""}]`);if(o!==null)return o;let r=document.createElement("style");return t&&r.setAttribute("nonce",t),r.setAttribute(`data-tiptap-style${n?`-${n}`:""}`,""),r.innerHTML=e,document.getElementsByTagName("head")[0].appendChild(r),r}function LL(e){return typeof e=="number"}function FL(e){return Object.prototype.toString.call(e).slice(8,-1)}function xd(e){return FL(e)!=="Object"?!1:e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype}function qC(e){return typeof e=="string"&&e.trim().length>0&&!/[;{}]/.test(e)}function jL(e,t){return e.replace(/^[ \t]*/,n=>{let r=0;for(let i of n)r+=i===" "?4-r%4:1;return" ".repeat(Math.max(0,r-t))})}function BL(e,t){let n=`text
${e}
`,o=t(n)[0];return(o?.type==="paragraph"||o?.type==="text")&&o.raw===n}function UL(e,t,n){var o;let r=t.split(`
`),i=(o=n.isParagraphContinuation)!==null&&o!==void 0?o:(a=>BL(a,n.blockTokens)),s=0;for(let a of r){if(!a.trim()||!i(a))break;s+=1}return{mainContent:[e,...r.slice(0,s).map(a=>a.trimStart())].join(`
`),nestedContent:r.slice(s).join(`
`)}}function ay(e,t,n){let o=e.split(`
`),r=[],i="",s=0,a=t.baseIndentSize||2;for(;s<o.length;){let c=o[s],d=c.match(t.itemPattern);if(!d){if(r.length>0)break;if(c.trim()===""){s+=1,i=`${i}${c}
`;continue}else return}let f=t.extractItemData(d),{indentLevel:h,mainContent:p}=f;i=`${i}${c}
`;let m=[p];for(s+=1;s<o.length;){var l;let k=o[s];if(k.trim()===""){var u;let x=o.slice(s+1).findIndex(E=>E.trim()!=="");if(x===-1)break;if((((u=o[s+1+x].match(/^(\s*)/))===null||u===void 0||(u=u[1])===null||u===void 0?void 0:u.length)||0)>h){m.push(k),i=`${i}${k}
`,s+=1;continue}else break}if((((l=k.match(/^(\s*)/))===null||l===void 0||(l=l[1])===null||l===void 0?void 0:l.length)||0)>h)m.push(k),i=`${i}${k}
`,s+=1;else break}let g,b=m.slice(1);if(b.length>0){let k=UL(p,b.map(E=>jL(E,h+a)).join(`
`),n);f.mainContent=k.mainContent;let x=k.nestedContent;x.trim()&&(t.customNestedParser?g=t.customNestedParser(x):g=n.blockTokens(x))}let y=t.createToken(f,g);r.push(y)}if(r.length!==0)return{items:r,raw:i.slice(0,e.length)}}var lC=4;function uC(e){let t=0;for(let n of e)t=n===" "?t+lC-t%lC:t+1;return t}function ly(e,t,n,o,r){if(!e||!Array.isArray(e.content))return"";let i=typeof n=="function"?n(o):n,[s,...a]=e.content,l=t.renderChildren([s]),u=`${i}${r?.indentMainContent?l.split(`
`).map((c,d)=>d===0?c:t.indent(c)).join(`
`):l}`;return a&&a.length>0&&a.forEach((c,d)=>{var f,h;let p=(f=(h=t.renderChild)===null||h===void 0?void 0:h.call(t,c,d+1))!==null&&f!==void 0?f:t.renderChildren([c]);if(p!=null){let m=b=>{if(!r?.alignNestedToPrefix)return t.indent(b);let y=t.indent(""),k=uC(i);return(uC(y)>=k?y:" ".repeat(k))+b},g=p.split(`
`).map(b=>m(b||"")).join(`
`);u+=c.type==="paragraph"?`
${g}`:`
${g}`}}),u}function ZC(e,t){let n={...e};return xd(e)&&xd(t)&&Object.keys(t).forEach(o=>{xd(t[o])&&xd(e[o])?n[o]=ZC(e[o],t[o]):n[o]=t[o]}),n}function HL(e,t,n={}){let{state:o}=t,{doc:r,tr:i}=o,s=e;r.descendants((a,l)=>{let u=i.mapping.map(l),c=i.mapping.map(l)+a.nodeSize,d=null;if(a.marks.forEach(h=>{if(h!==s)return!1;d=h}),!d)return;let f=!1;if(Object.keys(n).forEach(h=>{n[h]!==d.attrs[h]&&(f=!0)}),f){let h=e.type.create({...e.attrs,...n});i.removeMark(u,c,e.type),i.addMark(u,c,h)}}),i.docChanged&&t.view.dispatch(i)}var Ji=class{constructor(e){var t;this.find=e.find,this.handler=e.handler,this.undoable=(t=e.undoable)!==null&&t!==void 0?t:!0}},qL=(e,t)=>{if(ey(t))return t.exec(e);let n=t(e);if(!n)return null;let o=[n.text];return o.index=n.index,o.input=e,o.data=n.data,n.replaceWith&&(n.text.includes(n.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),o.push(n.replaceWith)),o};function ZL(e){let{editor:t,from:n,to:o,text:r,insertText:i}=e;if(!i)return{inputTransaction:null,tr:t.view.state.tr};let s=t.view.state.tr.insertText(r,n,o);return{inputTransaction:s,tr:ao.create({doc:s.doc,selection:s.selection,storedMarks:s.storedMarks}).tr}}function VL(e){let{editor:t,from:n,to:o,text:r,rule:i,match:s,plugin:a,insertText:l}=e,{view:u}=t,{inputTransaction:c,tr:d}=ZL({editor:t,from:n,to:o,text:r,insertText:l}),f=c?n+r.length:o,h=Ed({state:u.state,transaction:d}),p={from:n-(s[0].length-r.length),to:f},{commands:m,chain:g,can:b}=new Ui({editor:t,state:h});return i.handler({state:h,range:p,match:s,commands:m,chain:g,can:b})===null||!d.steps.length?!1:(c&&(u.dispatch(c),!u.state.doc.eq(c.doc))||(B2(d),d.setMeta("inputRule",!0),i.undoable&&d.setMeta(a,{transform:d,from:n,to:f,text:r}),u.dispatch(d)),!0)}function WL(e,t,n){let o=t[0].length-n.length;if(o<=0)return!0;let r=e.parentOffset-o;return r>=0&&e.parent.textBetween(r,e.parentOffset)===t[0].slice(0,o)}function kd(e){var t;let{editor:n,from:o,to:r,text:i,rules:s,plugin:a,insertText:l}=e,{view:u}=n;if(u.composing)return!1;let c=u.state.doc.resolve(o);if(c.parent.type.spec.code||!((t=c.nodeBefore||c.nodeAfter)===null||t===void 0)&&t.marks.find(f=>f.type.spec.code))return!1;let d=HP(c)+i;for(let f of s){let h=qL(d,f.find);if(!(!h||!WL(c,h,i))&&VL({editor:n,from:o,to:r,text:i,rule:f,match:h,plugin:a,insertText:l}))return!0}return!1}function KL(e){let{editor:t,rules:n}=e,o=new de({state:{init(){return null},apply(r,i,s){var a;let l=r.getMeta(o);if(l)return l;if(i&&(!((a=r.getMeta("appendedTransaction"))===null||a===void 0)&&a.getMeta(o))){let c=new Jn(i.transform.before);for(let d of[...i.transform.steps,...r.steps])c.step(d);return{...i,transform:c}}let u=r.getMeta("applyInputRules");return u&&setTimeout(()=>{let{text:c}=u;typeof c=="string"?c=c:c=Vi(M.from(c),s.schema);let{from:d}=u,f=d+c.length;kd({editor:t,from:d,to:f,text:c,rules:n,plugin:o})}),r.selectionSet||r.docChanged?null:i}},props:{handleTextInput(r,i,s,a){return kd({editor:t,from:i,to:s,text:a,rules:n,plugin:o,insertText:!0})},handleDOMEvents:{compositionend:r=>(setTimeout(()=>{let{$cursor:i}=r.state.selection;i&&kd({editor:t,from:i.pos,to:i.pos,text:"",rules:n,plugin:o})}),!1)},handleKeyDown(r,i){if(i.key!=="Enter")return!1;let{$cursor:s}=r.state.selection;return s?kd({editor:t,from:s.pos,to:s.pos,text:`
`,rules:n,plugin:o}):!1}},isInputRules:!0});return o}var uy=class{constructor(e={}){this.type="extendable",this.parent=null,this.child=null,this.name="",this.config={name:this.name},this.config={...this.config,...e},this.name=this.config.name}get options(){return{...Ce(J(this,"addOptions",{name:this.name}))}}get storage(){return{...Ce(J(this,"addStorage",{name:this.name,options:this.options}))}}configure(e={}){let t=this.extend({...this.config,addOptions:()=>ZC(this.options,e)});return t.name=this.name,t.parent=this.parent,this.child=null,t}extend(e={}){let t=new this.constructor({...this.config,...e});return t.parent=this,this.child=t,t.name="name"in e?e.name:t.parent.name,t}},at=class VC extends uy{constructor(...t){super(...t),this.type="mark"}static create(t={}){let n=typeof t=="function"?t():t;return new VC(n)}static handleExit({editor:t,mark:n}){let{tr:o}=t.state,r=t.state.selection.$from;if(r.pos===r.end()){let i=r.marks();if(!i.find(a=>a?.type.name===n.name))return!1;let s=i.find(a=>a?.type.name===n.name);return s&&o.removeStoredMark(s),o.insertText(" ",r.pos),t.view.dispatch(o),!0}return!1}configure(t){return super.configure(t)}extend(t){let n=typeof t=="function"?t():t;return super.extend(n)}},cy=class{constructor(e){this.find=e.find,this.handler=e.handler}},JL=(e,t,n)=>{if(ey(t))return[...e.matchAll(t)];let o=t(e,n);return o?o.map(r=>{let i=[r.text];return i.index=r.index,i.input=e,i.data=r.data,r.replaceWith&&(r.text.includes(r.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),i.push(r.replaceWith)),i}):[]};function GL(e){let{editor:t,state:n,from:o,to:r,rule:i,pasteEvent:s,dropEvent:a}=e,{commands:l,chain:u,can:c}=new Ui({editor:t,state:n}),d=[];return n.doc.nodesBetween(o,r,(f,h)=>{var p,m,g,b;if(!((p=f.type)===null||p===void 0||(p=p.spec)===null||p===void 0)&&p.code||!(f.isText||f.isTextblock||f.isInline))return;let y=(m=(g=(b=f.content)===null||b===void 0?void 0:b.size)!==null&&g!==void 0?g:f.nodeSize)!==null&&m!==void 0?m:0,k=Math.max(o,h),x=Math.min(r,h+y);if(k>=x)return;let E=f.isText?f.text||"":f.textBetween(k-h,x-h,void 0,"\uFFFC");JL(E,i.find,s).forEach(I=>{if(I.index===void 0)return;let N=k+I.index+1,D=N+I[0].length,W={from:n.tr.mapping.map(N),to:n.tr.mapping.map(D)},re=i.handler({state:n,range:W,match:I,commands:l,chain:u,can:c,pasteEvent:s,dropEvent:a});d.push(re)})}),d.every(f=>f!==null)}var Fi=null,QL=e=>{var t;let n=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(t=n.clipboardData)===null||t===void 0||t.setData("text/html",e),n};function XL(e){let{editor:t,rules:n}=e,o=null,r=!1,i=!1,s=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,a;try{a=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{a=null}let l=({state:u,from:c,to:d,rule:f,pasteEvt:h})=>{let p=u.tr,m=Ed({state:u,transaction:p});if(!(!GL({editor:t,state:m,from:Math.max(c-1,0),to:d.b-1,rule:f,pasteEvent:h,dropEvent:a})||!p.steps.length)){try{a=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{a=null}return s=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,p}};return t.on("destroy",()=>{Fi===t&&(Fi=null)}),n.map(u=>new de({view(c){let d=h=>{var p;o=!((p=c.dom.parentElement)===null||p===void 0)&&p.contains(h.target)?c.dom.parentElement:null,o&&(Fi=t)},f=()=>{Fi&&(Fi=null)};return window.addEventListener("dragstart",d),window.addEventListener("dragend",f),{destroy(){window.removeEventListener("dragstart",d),window.removeEventListener("dragend",f)}}},props:{handleDOMEvents:{drop:(c,d)=>{if(i=o===c.dom.parentElement,a=d,!i){let f=Fi;f?.isEditable&&setTimeout(()=>{if(f.isDestroyed)return;let h=f.state.selection;h&&f.commands.deleteRange({from:h.from,to:h.to})},10)}return!1},paste:(c,d)=>{var f;let h=(f=d.clipboardData)===null||f===void 0?void 0:f.getData("text/html");return s=d,r=!!h?.includes("data-pm-slice"),!1}}},appendTransaction:(c,d,f)=>{let h=c[0],p=h.getMeta("uiEvent")==="paste"&&!r,m=h.getMeta("uiEvent")==="drop"&&!i,g=h.getMeta("applyPasteRules"),b=!!g;if(!p&&!m&&!b)return;if(b){let{text:x}=g;typeof x=="string"?x=x:x=Vi(M.from(x),f.schema);let{from:E}=g,I=E+x.length,N=QL(x);return l({rule:u,state:f,from:E,to:{b:I},pasteEvt:N})}let y=d.doc.content.findDiffStart(f.doc.content),k=d.doc.content.findDiffEnd(f.doc.content);if(!(!LL(y)||!k||y===k.b))return l({rule:u,state:f,from:y,to:k,pasteEvt:s})}}))}var Md=class{constructor(e,t){this.splittableMarks=[],this.nonClearableMarks=[],this.decorationManager=null,this.editor=t,this.baseExtensions=e,this.extensions=EC(e),this.hasSchemaSpec=t.options.schemaSpec!==void 0,this.schema=LP(this.extensions,t,t.options.schemaSpec),this.setupExtensions()}get commands(){return this.extensions.reduce((e,t)=>{let n=J(t,"addCommands",{name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:this.editor,type:Li(t.name,this.schema)});return n?{...e,...n()}:e},{})}get plugins(){let{editor:e}=this,t=Ua([...this.extensions].reverse()).flatMap(o=>{let r={name:o.name,options:o.options,storage:this.editor.extensionStorage[o.name],editor:e,type:Li(o.name,this.schema)},i=[],s=J(o,"addKeyboardShortcuts",r),a={};if(o.type==="mark"&&J(o,"exitable",r)&&(a.ArrowRight=()=>at.handleExit({editor:e,mark:o})),s){let f=Object.fromEntries(Object.entries(s()).map(([h,p])=>[h,()=>p({editor:e})]));a={...a,...f}}let l=P2(a);i.push(l);let u=J(o,"addInputRules",r);if(nC(o,e.options.enableInputRules)&&u){let f=u();if(f&&f.length){let h=KL({editor:e,rules:f}),p=Array.isArray(h)?h:[h];i.push(...p)}}let c=J(o,"addPasteRules",r);if(nC(o,e.options.enablePasteRules)&&c){let f=c();if(f&&f.length){let h=XL({editor:e,rules:f});i.push(...h)}}let d=J(o,"addProseMirrorPlugins",r);if(d){let f=d();i.push(...f)}return i}),n=this.createDecorationPlugin();return n&&t.push(n),t}createDecorationPlugin(){var e;let{editor:t}=this;(e=this.decorationManager)===null||e===void 0||e.destroy();let n=[];return this.extensions.forEach(o=>{let r=J(o,"addDecorations",{name:o.name,options:o.options,storage:this.editor.extensionStorage[o.name],editor:t,type:Li(o.name,this.schema)});r&&n.push({name:o.name,addDecorations:r})}),this.decorationManager=new RL({editor:t,entries:n}),this.decorationManager.plugin}get attributes(){let e=oy(this.extensions);return this.hasSchemaSpec?SC(e,this.schema):e}get nodeViews(){let{editor:e}=this,{nodeExtensions:t}=qi(this.extensions);return Object.fromEntries(t.filter(n=>!!J(n,"addNodeView")).map(n=>{let o=this.attributes.filter(a=>a.type===n.name),r=J(n,"addNodeView",{name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:e,type:st(n.name,this.schema)});if(!r)return[];let i=r();if(!i)return[];let s=(a,l,u,c,d)=>{let f=$r(a,o);return i({node:a,view:l,getPos:u,decorations:c,innerDecorations:d,editor:e,extension:n,HTMLAttributes:f})};return[n.name,s]}))}dispatchTransaction(e){let{editor:t}=this;return Ua([...this.extensions].reverse()).reduceRight((n,o)=>{let r={name:o.name,options:o.options,storage:this.editor.extensionStorage[o.name],editor:t,type:Li(o.name,this.schema)},i=J(o,"dispatchTransaction",r);return i?s=>{i.call(r,{transaction:s,next:n})}:n},e)}transformPastedHTML(e){let{editor:t}=this;return Ua([...this.extensions]).reduce((n,o)=>{let r={name:o.name,options:o.options,storage:this.editor.extensionStorage[o.name],editor:t,type:Li(o.name,this.schema)},i=J(o,"transformPastedHTML",r);return i?(s,a)=>{let l=n(s,a);return i.call(r,l)}:n},e||(n=>n))}get markViews(){let{editor:e}=this,{markExtensions:t}=qi(this.extensions);return Object.fromEntries(t.filter(n=>!!J(n,"addMarkView")).map(n=>{let o=this.attributes.filter(s=>s.type===n.name),r=J(n,"addMarkView",{name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:e,type:rr(n.name,this.schema)});if(!r)return[];let i=(s,a,l)=>{let u=$r(s,o);return r()({mark:s,view:a,inline:l,editor:e,extension:n,HTMLAttributes:u,updateAttributes:c=>{HL(s,e,c)}})};return[n.name,i]}))}destroy(){var e;(e=this.decorationManager)===null||e===void 0||e.destroy(),this.extensions.forEach(t=>{let n=t;for(;n.parent;){let o=n.parent;o.child===n&&(o.child=null),n=o}}),this.extensions=[],this.baseExtensions=[],this.decorationManager=null,this.schema=null,this.editor=null}setupExtensions(){let e=this.extensions;this.editor.extensionStorage=Object.fromEntries(e.map(t=>[t.name,t.storage])),e.forEach(t=>{let n={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:this.editor,type:Li(t.name,this.schema)};if(t.type==="mark"){var o,r;(!((o=Ce(J(t,"keepOnSplit",n)))!==null&&o!==void 0)||o)&&this.splittableMarks.push(t.name),!((r=Ce(J(t,"clearable",n)))!==null&&r!==void 0)||r||this.nonClearableMarks.push(t.name)}let i=J(t,"onBeforeCreate",n),s=J(t,"onCreate",n),a=J(t,"onUpdate",n),l=J(t,"onSelectionUpdate",n),u=J(t,"onTransaction",n),c=J(t,"onFocus",n),d=J(t,"onBlur",n),f=J(t,"onDestroy",n);i&&this.editor.on("beforeCreate",i),s&&this.editor.on("create",s),a&&this.editor.on("update",a),l&&this.editor.on("selectionUpdate",l),u&&this.editor.on("transaction",u),c&&this.editor.on("focus",c),d&&this.editor.on("blur",d),f&&this.editor.on("destroy",f)})}};Md.resolve=EC;Md.sort=Ua;Md.flatten=ry;var Me=class WC extends uy{constructor(...t){super(...t),this.type="extension"}static create(t={}){let n=typeof t=="function"?t():t;return new WC(n)}configure(t){return super.configure(t)}extend(t){let n=typeof t=="function"?t():t;return super.extend(n)}},KC=Me.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new de({key:new ke("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{let{editor:e}=this,{state:t,schema:n}=e,{doc:o,selection:r}=t,i=TC(n),{blockSeparator:s}=this.options,a={...s!==void 0?{blockSeparator:s}:{},textSerializers:i};return[...r.ranges].sort((l,u)=>l.$from.pos-u.$from.pos).map(({$from:l,$to:u})=>CC(o,{from:l.pos,to:u.pos},a)).join(s??`
`)}}})]}}),JC=Me.create({name:"commands",addCommands(){return{...kL}}}),GC=Me.create({name:"delete",onUpdate({transaction:e,appendedTransactions:t}){var n,o;let r=()=>{var i,s,a;if((i=(s=this.editor.options.coreExtensionOptions)===null||s===void 0||(s=s.delete)===null||s===void 0||(a=s.filterTransaction)===null||a===void 0?void 0:a.call(s,e))!==null&&i!==void 0?i:e.getMeta("y-sync$"))return;let l=ny(e.before,[e,...t]);Wi(l).forEach(c=>{l.mapping.mapResult(c.oldRange.from).deletedAfter&&l.mapping.mapResult(c.oldRange.to).deletedBefore&&l.before.nodesBetween(c.oldRange.from,c.oldRange.to,(d,f)=>{let h=f+d.nodeSize-2,p=c.oldRange.from<=f&&h<=c.oldRange.to;this.editor.emit("delete",{type:"node",node:d,from:f,to:h,newFrom:l.mapping.map(f),newTo:l.mapping.map(h),deletedRange:c.oldRange,newRange:c.newRange,partial:!p,editor:this.editor,transaction:e,combinedTransform:l})})});let u=l.mapping;l.steps.forEach((c,d)=>{if(c instanceof In){var f,h;let p=u.slice(d).map(c.from,-1),m=u.slice(d).map(c.to),g=u.invert().map(p,-1),b=u.invert().map(m),y=p>0?(f=l.doc.nodeAt(p-1))===null||f===void 0?void 0:f.marks.some(x=>x.eq(c.mark)):!1,k=(h=l.doc.nodeAt(m))===null||h===void 0?void 0:h.marks.some(x=>x.eq(c.mark));this.editor.emit("delete",{type:"mark",mark:c.mark,from:c.from,to:c.to,deletedRange:{from:g,to:b},newRange:{from:p,to:m},partial:!!(k||y),editor:this.editor,transaction:e,combinedTransform:l})}})};!((n=(o=this.editor.options.coreExtensionOptions)===null||o===void 0||(o=o.delete)===null||o===void 0?void 0:o.async)!==null&&n!==void 0)||n?setTimeout(r,0):r()}}),QC=Me.create({name:"drop",addProseMirrorPlugins(){return[new de({key:new ke("tiptapDrop"),props:{handleDrop:(e,t,n,o)=>{this.editor.emit("drop",{editor:this.editor,event:t,slice:n,moved:o})}}})]}}),XC=Me.create({name:"editable",addProseMirrorPlugins(){return[new de({key:new ke("editable"),props:{editable:()=>this.editor.options.editable}})]}}),YC=new ke("focusEvents"),eT=Me.create({name:"focusEvents",addProseMirrorPlugins(){let{editor:e}=this;return[new de({key:YC,props:{handleDOMEvents:{focus:(t,n)=>{e.isFocused=!0;let o=e.state.tr.setMeta("focus",{event:n}).setMeta("addToHistory",!1);return t.dispatch(o),!1},blur:(t,n)=>{e.isFocused=!1;let o=e.state.tr.setMeta("blur",{event:n}).setMeta("addToHistory",!1);return t.dispatch(o),!1}}}})]}});function YL(e){let{empty:t,from:n,to:o}=e.selection;return t?!1:n===Q.atStart(e.doc).from&&o===Q.atEnd(e.doc).to}var tT=Me.create({name:"keymap",addKeyboardShortcuts(){let e=()=>this.editor.commands.first(({commands:s})=>[()=>s.undoInputRule(),()=>s.command(({tr:a})=>{let{selection:l,doc:u}=a,{empty:c,$anchor:d}=l,{pos:f,parent:h}=d,p=d.parent.isTextblock&&f>0?a.doc.resolve(f-1):d,m=p.parent.type.spec.isolating,g=d.pos-d.parentOffset,b=m&&p.parent.childCount===1?g===d.pos:Q.atStart(u).from===f;return!c||!h.type.isTextblock||h.textContent.length||!b||b&&d.parent.type.name==="paragraph"?!1:s.clearNodes()}),()=>s.deleteSelection(),()=>s.joinBackward(),()=>s.selectNodeBackward()]),t=()=>this.editor.commands.first(({commands:s})=>[()=>s.deleteSelection(),()=>s.deleteCurrentNode(),()=>s.joinForward(),()=>s.selectNodeForward()]),o={Enter:()=>this.editor.commands.first(({commands:s})=>[()=>s.newlineInCode(),()=>s.createParagraphNear(),()=>s.liftEmptyBlock(),()=>s.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:e,"Mod-Backspace":e,"Shift-Backspace":e,Delete:t,"Mod-Delete":t,"Mod-a":()=>this.editor.commands.selectAll()},r={...o},i={...o,"Ctrl-h":e,"Alt-Backspace":e,"Ctrl-d":t,"Ctrl-Alt-Backspace":t,"Alt-Delete":t,"Alt-d":t,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return _d()||xC()?i:r},addProseMirrorPlugins(){return[new de({key:new ke("clearDocument"),appendTransaction:(e,t,n)=>{if(e.some(l=>l.getMeta("composition")))return;let o=e.some(l=>l.docChanged)&&!t.doc.eq(n.doc),r=e.some(l=>l.getMeta("preventClearDocument"));if(!o||r||!YL(t)||!Ki(n.doc))return;let i=n.tr,s=Ed({state:n,transaction:i}),{commands:a}=new Ui({editor:this.editor,state:s});if(a.clearNodes(),!(!i.steps.length&&!n.storedMarks))return i.setStoredMarks(null)}})]}}),nT=Me.create({name:"paste",addProseMirrorPlugins(){return[new de({key:new ke("tiptapPaste"),props:{handlePaste:(e,t,n)=>{this.editor.emit("paste",{editor:this.editor,event:t,slice:n})}}})]}}),rT=Me.create({name:"tabindex",addOptions(){return{value:void 0}},addProseMirrorPlugins(){return[new de({key:new ke("tabindex"),props:{attributes:()=>{var e;return!this.editor.isEditable&&this.options.value===void 0?{}:{tabindex:(e=this.options.value)!==null&&e!==void 0?e:"0"}}}})]}}),oT=Me.create({name:"textDirection",addOptions(){return{direction:void 0}},addGlobalAttributes(){if(!this.options.direction)return[];let{nodeExtensions:e}=qi(this.extensions);return[{types:e.filter(t=>t.name!=="text").map(t=>t.name),attributes:{dir:{default:this.options.direction,parseHTML:t=>{let n=t.getAttribute("dir");return n&&(n==="ltr"||n==="rtl"||n==="auto")?n:this.options.direction},renderHTML:t=>t.dir?{dir:t.dir}:{}}}}]},addProseMirrorPlugins(){return[new de({key:new ke("textDirection"),props:{attributes:()=>{let e=this.options.direction;return e?{dir:e}:{}}}})]}}),iT=Ig({ClipboardTextSerializer:()=>KC,Commands:()=>JC,Delete:()=>GC,Drop:()=>QC,Editable:()=>XC,FocusEvents:()=>eT,Keymap:()=>tT,Paste:()=>nT,Tabindex:()=>rT,TextDirection:()=>oT,focusEventsPluginKey:()=>YC}),cC=!1;function e8(e){if(cC)return;cC=!0;let t;try{let n=rt.fromJSON(e,{from:0,to:0});if(!VP(n))return;t=n.slice.content}catch{return}t instanceof M||console.warn("[tiptap warn]: prosemirror-model is loaded more than once. Wrapping and splitting nodes will fail. Deduplicate it in your lock file, or alias it to a single copy in your bundler.")}var t8=class Ba{get name(){return this.node.type.name}constructor(t,n,o=!1,r=null){this.currentNode=null,this.actualDepth=null,this.isBlock=o,this.resolvedPos=t,this.editor=n,this.currentNode=r}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var t;return(t=this.actualDepth)!==null&&t!==void 0?t:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(t){let n=this.from,o=this.to;if(this.isBlock){if(this.content.size===0){console.error(`You can\u2019t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);return}n=this.from+1,o=this.to-1}this.editor.commands.insertContentAt({from:n,to:o},t)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+(this.node.isText?0:1)}get parent(){if(this.depth===0)return null;let t=this.resolvedPos.start(this.resolvedPos.depth-1),n=this.resolvedPos.doc.resolve(t);return new Ba(n,this.editor)}get before(){let t=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return t.depth!==this.depth&&(t=this.resolvedPos.doc.resolve(this.from-3)),new Ba(t,this.editor)}get after(){let t=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return t.depth!==this.depth&&(t=this.resolvedPos.doc.resolve(this.to+3)),new Ba(t,this.editor)}get children(){let t=[];return this.node.content.forEach((n,o)=>{let r=n.isBlock&&!n.isTextblock,i=n.isAtom&&!n.isText,s=n.isInline,a=this.pos+o+(i?0:1);if(a<0||a>this.resolvedPos.doc.nodeSize-2)return;let l=this.resolvedPos.doc.resolve(a);if(!r&&!s&&l.depth<=this.depth)return;let u=new Ba(l,this.editor,r,r||s?n:null);r&&(u.actualDepth=this.depth+1),t.push(u)}),t}get firstChild(){return this.children[0]||null}get lastChild(){let t=this.children;return t[t.length-1]||null}closest(t,n={}){let o=null,r=this.parent;for(;r&&!o;){if(r.node.type.name===t)if(Object.keys(n).length>0){let i=r.node.attrs,s=Object.keys(n);for(let a=0;a<s.length;a+=1){let l=s[a];if(i[l]!==n[l])break}}else o=r;r=r.parent}return o}querySelector(t,n={}){return this.querySelectorAll(t,n,!0)[0]||null}querySelectorAll(t,n={},o=!1){let r=[];if(!this.children||this.children.length===0)return r;let i=Object.keys(n);return this.children.forEach(s=>{o&&r.length>0||(s.node.type.name===t&&i.every(a=>n[a]===s.node.attrs[a])&&r.push(s),!(o&&r.length>0)&&(r=r.concat(s.querySelectorAll(t,n,o))))}),r}setAttribute(t){let{tr:n}=this.editor.state;n.setNodeMarkup(this.from,void 0,{...this.node.attrs,...t}),this.editor.view.dispatch(n)}},n8=`.ProseMirror {
position: relative;
}
.ProseMirror {
word-wrap: break-word;
white-space: pre-wrap;
white-space: break-spaces;
-webkit-font-variant-ligatures: none;
font-variant-ligatures: none;
font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */
}
.ProseMirror [contenteditable="false"] {
white-space: normal;
}
.ProseMirror [contenteditable="false"] [contenteditable="true"] {
white-space: pre-wrap;
}
.ProseMirror pre {
white-space: pre-wrap;
}
img.ProseMirror-separator {
display: inline !important;
border: none !important;
margin: 0 !important;
width: 0 !important;
height: 0 !important;
}
.ProseMirror-gapcursor {
display: none;
pointer-events: none;
position: absolute;
margin: 0;
}
.ProseMirror-gapcursor:after {
content: "";
display: block;
position: absolute;
top: -2px;
width: 20px;
border-top: 1px solid black;
animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;
}
@keyframes ProseMirror-cursor-blink {
to {
visibility: hidden;
}
}
.ProseMirror-hideselection *::selection {
background: transparent;
}
.ProseMirror-hideselection *::-moz-selection {
background: transparent;
}
.ProseMirror-hideselection * {
caret-color: transparent;
}
.ProseMirror-focused .ProseMirror-gapcursor {
display: block;
}`,sT=class extends _L{constructor(e={}){super(),this.css=null,this.className="tiptap",this.editorView=null,this.isFocused=!1,this.destroyed=!1,this.isInitialized=!1,this.extensionStorage={},this.instanceId=Math.random().toString(36).slice(2,9),this.hasWarnedStaleDecorationRead=!1,this.options={element:typeof document<"u"?document.createElement("div"):null,content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,textDirection:void 0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,emitContentError:!1,onBeforeCreate:()=>null,onCreate:()=>null,onMount:()=>null,onUnmount:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:n})=>{throw n},onPaste:()=>null,onDrop:()=>null,onDelete:()=>null,enableExtensionDispatchTransaction:!0},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.utils={getUpdatedPosition:WP,createMappablePosition:KP},this.setOptions(e),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.on("mount",this.options.onMount),this.on("unmount",this.options.onUnmount),this.on("contentError",this.options.onContentError),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),this.on("drop",({event:n,slice:o,moved:r})=>this.options.onDrop(n,o,r)),this.on("paste",({event:n,slice:o})=>this.options.onPaste(n,o)),this.on("delete",this.options.onDelete);let t=this.createDoc();if(!this.editorState){let n=Gb(t,this.options.autofocus);this.editorState=ao.create({doc:t,schema:this.schema,selection:n||void 0})}e8(this.schema),this.options.element&&this.mount(this.options.element)}mount(e){if(typeof document>"u")throw new Error("[tiptap error]: The editor cannot be mounted because there is no 'document' defined in this environment.");this.createView(e),this.emit("mount",{editor:this}),this.css&&!document.head.contains(this.css)&&document.head.appendChild(this.css),window.setTimeout(()=>{this.isDestroyed||(this.options.autofocus!==!1&&this.options.autofocus!==null&&this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0)},0)}unmount(){if(this.editorView){this.editorState=this.editorView.state;let e=this.editorView.dom;e?.editor&&delete e.editor,this.editorView.destroy()}if(this.editorView=null,this.isInitialized=!1,this.css&&!document.querySelectorAll(`.${this.className}`).length)try{typeof this.css.remove=="function"?this.css.remove():this.css.parentNode&&this.css.parentNode.removeChild(this.css)}catch(e){console.warn("Failed to remove CSS element:",e)}this.css=null,this.emit("unmount",{editor:this})}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager?this.commandManager.chain():Ui.createFakeChain()}can(){return this.commandManager?this.commandManager.can():Ui.createFallbackCan()}injectCSS(){this.options.injectCSS&&typeof document<"u"&&(this.css=PL(n8,this.options.injectNonce))}setOptions(e={}){this.options={...this.options,...e},!(!this.editorView||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps({...this.options.editorProps,attributes:this.getEditorViewAttributes()}),this.view.updateState(this.state))}setEditable(e,t=!0){this.setOptions({editable:e}),t&&this.emit("update",{editor:this,transaction:this.state.tr,appendedTransactions:[]})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get view(){return this.editorView?this.editorView:new Proxy({state:this.editorState,updateState:e=>{this.editorState=e},dispatch:e=>{this.dispatchTransaction(e)},composing:!1,dragging:null,editable:!0,isDestroyed:!1},{get:(e,t)=>{if(this.editorView)return this.editorView[t];if(t==="state")return this.editorState;if(t in e)return Reflect.get(e,t);throw new Error(`[tiptap error]: The editor view is not available. Cannot access view['${t}']. The editor may not be mounted yet.`)}})}get state(){return PC&&!this.hasWarnedStaleDecorationRead&&SL(this)&&(this.hasWarnedStaleDecorationRead=!0,console.warn("[tiptap warn]: `editor.state` was read while decoration `create()` was running. It returns the pre-transaction document. Use the `state` argument passed to `create()` instead. Helpers like `editor.isActive()` read `editor.state` too, so pass `state` to their standalone versions instead of calling them on the editor.")),this.editorView&&(this.editorState=this.view.state),this.editorState}registerPlugin(e,t){let n=Xb(t)?t(e,[...this.state.plugins]):[...this.state.plugins,e],o=this.state.reconfigure({plugins:n});return this.view.updateState(o),o}unregisterPlugin(e){if(this.isDestroyed)return;let t=this.state.plugins,n=t;if([].concat(e).forEach(r=>{let i=typeof r=="string"?`${r}$`:r.key;n=n.filter(s=>!s.key.startsWith(i))}),t.length===n.length)return;let o=this.state.reconfigure({plugins:n});return this.view.updateState(o),o}createExtensionManager(){var e,t;let n=[...this.options.enableCoreExtensions?[XC,KC.configure({blockSeparator:(e=this.options.coreExtensionOptions)===null||e===void 0||(e=e.clipboardTextSerializer)===null||e===void 0?void 0:e.blockSeparator}),JC,eT,tT,rT.configure({value:(t=this.options.coreExtensionOptions)===null||t===void 0||(t=t.tabindex)===null||t===void 0?void 0:t.value}),QC,nT,GC,oT.configure({direction:this.options.textDirection})].filter(o=>typeof this.options.enableCoreExtensions=="object"?this.options.enableCoreExtensions[o.name]!==!1:!0):[],...this.options.extensions].filter(o=>["extension","node","mark"].includes(o?.type));this.extensionManager=new Md(n,this)}createCommandManager(){this.commandManager=new Ui({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createDoc(){let e;try{e=Qb(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(t){if(!(t instanceof Error)||!["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(t.message))throw t;let n=Qb(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1});return this.editorState=ao.create({doc:n,schema:this.schema,selection:Gb(n,this.options.autofocus)||void 0}),this.emit("contentError",{editor:this,error:t,disableCollaboration:()=>{"collaboration"in this.storage&&typeof this.storage.collaboration=="object"&&this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(o=>o.name!=="collaboration"),this.createExtensionManager()}}),this.editorState.doc}return e}getEditorViewAttributes(){var e;let t=(e=this.options.editorProps)===null||e===void 0?void 0:e.attributes;return Xb(t)?n=>({role:"textbox",...t(n)}):{role:"textbox",...t}}createView(e){let{editorProps:t,enableExtensionDispatchTransaction:n}=this.options,o=t.dispatchTransaction||this.dispatchTransaction.bind(this),r=n?this.extensionManager.dispatchTransaction(o):o,i=t.transformPastedHTML,s=this.extensionManager.transformPastedHTML(i);this.editorView=new Oa(e,{...t,attributes:this.getEditorViewAttributes(),dispatchTransaction:r,transformPastedHTML:s,state:this.editorState,markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews});let a=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(a),this.prependClass(),this.injectCSS();let l=this.view.dom;l.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`${this.className} ${this.view.dom.className}`}captureTransaction(e){this.isCapturingTransaction=!0,e(),this.isCapturingTransaction=!1;let t=this.capturedTransaction;return this.capturedTransaction=null,t}dispatchTransaction(e){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=e;return}e.steps.forEach(u=>{var c;return(c=this.capturedTransaction)===null||c===void 0?void 0:c.step(u)});return}let{state:t,transactions:n}=this.state.applyTransaction(e),o=!this.state.selection.eq(t.selection),r=n.includes(e),i=this.state;if(this.emit("beforeTransaction",{editor:this,transaction:e,nextState:t}),!r)return;this.view.updateState(t),this.emit("transaction",{editor:this,transaction:e,appendedTransactions:n.slice(1)}),o&&this.emit("selectionUpdate",{editor:this,transaction:e});let s=n.findLast(u=>u.getMeta("focus")||u.getMeta("blur")),a=s?.getMeta("focus"),l=s?.getMeta("blur");a&&this.emit("focus",{editor:this,event:a.event,transaction:s}),l&&this.emit("blur",{editor:this,event:l.event,transaction:s}),!(e.getMeta("preventUpdate")||!n.some(u=>u.docChanged)||i.doc.eq(t.doc))&&this.emit("update",{editor:this,transaction:e,appendedTransactions:n.slice(1)})}getAttributes(e){return iy(this.state,e)}isActive(e,t){let n=typeof e=="string"?e:null,o=typeof e=="string"?t:e;return qP(this.state,n,o)}getJSON(){return this.state.doc.toJSON()}getHTML(){return Vi(this.state.doc.content,this.schema)}getText(e){let{blockSeparator:t=`
`,textSerializers:n={}}=e||{};return FP(this.state.doc,{blockSeparator:t,textSerializers:{...TC(this.schema),...n}})}get isEmpty(){return Ki(this.state.doc)}destroy(){this.destroyed||(this.destroyed=!0,this.emit("destroy"),this.unmount(),this.removeAllListeners(),this.extensionManager.destroy(),this.extensionManager=null,this.schema=null,this.commandManager=null,this.extensionStorage={})}get isDestroyed(){var e,t;return(e=(t=this.editorView)===null||t===void 0?void 0:t.isDestroyed)!==null&&e!==void 0?e:!0}$node(e,t){var n;return((n=this.$doc)===null||n===void 0?void 0:n.querySelector(e,t))||null}$nodes(e,t){var n;return((n=this.$doc)===null||n===void 0?void 0:n.querySelectorAll(e,t))||null}$pos(e){let t=this.state.doc.resolve(e),n=e>0&&t.nodeAfter&&!t.nodeAfter.isText&&t.nodeAfter.isAtom?t.nodeAfter:null;return new t8(t,this,!1,n)}get $doc(){return this.$pos(0)}};function ln(e){return new Ji({find:e.find,handler:({state:t,range:n,match:o})=>{let r=Ce(e.getAttributes,void 0,o);if(r===!1||r===null)return null;let{tr:i}=t,s=o[o.length-1],a=o[0];if(s){let l=a.search(/\S/),u=n.from+a.indexOf(s),c=u+s.length;if(Ha(n.from,n.to,t.doc).filter(f=>f.mark.type.excluded.find(h=>h===e.type&&h!==f.mark.type)).filter(f=>f.to>u).length)return null;c<n.to&&i.delete(c,n.to),u>n.from&&i.delete(n.from+l,u);let d=n.from+l+s.length;i.addMark(n.from+l,d,e.type.create(r||{})),i.removeStoredMark(e.type)}},undoable:e.undoable})}function $d(e){return new Ji({find:e.find,handler:({state:t,range:n,match:o})=>{let r=Ce(e.getAttributes,void 0,o)||{},{tr:i}=t,s=n.from,a=n.to,l=e.type.create(r);if(o[1]){let u=s+o[0].lastIndexOf(o[1]);if(u>a?u=a:a=u+o[1].length,n.to-n.from<o[0].length){let c=o[0][o[0].length-1];i.insertText(c,s+o[0].length-1)}i.replaceWith(u,a,l)}else if(o[0]){let u=e.type.isInline?s:s-1;i.insert(u,e.type.create(r)).delete(i.mapping.map(s),i.mapping.map(a))}i.scrollIntoView()},undoable:e.undoable})}function qa(e){return new Ji({find:e.find,handler:({state:t,range:n,match:o})=>{let r=t.doc.resolve(n.from),i=Ce(e.getAttributes,void 0,o)||{};if(!r.node(-1).canReplaceWith(r.index(-1),r.indexAfter(-1),e.type))return null;t.tr.delete(n.from,n.to).setBlockType(n.from,n.from,e.type,i)},undoable:e.undoable})}function Ir(e){return new Ji({find:e.find,handler:({state:t,range:n,match:o,chain:r})=>{let i=Ce(e.getAttributes,void 0,o)||{},s=t.tr.delete(n.from,n.to),a=s.doc.resolve(n.from).blockRange(),l=a&&Ai(a,e.type,i);if(!l)return null;if(s.wrap(a,l),e.keepMarks&&e.editor){let{selection:c,storedMarks:d}=t,{splittableMarks:f}=e.editor.extensionManager,h=d||c.$to.parentOffset&&c.$from.marks();if(h){let p=h.filter(m=>f.includes(m.type.name));s.ensureMarks(p)}}if(e.keepAttributes){let c=e.type.name==="bulletList"||e.type.name==="orderedList"?"listItem":"taskList";r().updateAttributes(c,i).run()}let u=s.doc.resolve(n.from-1).nodeBefore;u&&u.type===e.type&&gn(s.doc,n.from-1)&&(!e.joinPredicate||e.joinPredicate(o,u))&&s.join(n.from-1)},undoable:e.undoable})}var r8=e=>"touches"in e,aT=class{constructor(e){var t,n,o,r,i,s;this.directions=["bottom-left","bottom-right","top-left","top-right"],this.minSize={height:8,width:8},this.preserveAspectRatio=!1,this.classNames={container:"",wrapper:"",handle:"",resizing:""},this.initialWidth=0,this.initialHeight=0,this.aspectRatio=1,this.isResizing=!1,this.activeHandle=null,this.startX=0,this.startY=0,this.startWidth=0,this.startHeight=0,this.isShiftKeyPressed=!1,this.lastEditableState=void 0,this.handleMap=new Map,this.handleEditorUpdate=()=>{let a=this.editor.isEditable;a!==this.lastEditableState&&(this.lastEditableState=a,a?a&&this.handleMap.size===0&&this.attachHandles():this.removeHandles())},this.handleMouseMove=a=>{if(!this.isResizing||!this.activeHandle)return;let l=a.clientX-this.startX,u=a.clientY-this.startY;this.handleResize(l,u)},this.handleTouchMove=a=>{if(!this.isResizing||!this.activeHandle)return;let l=a.touches[0];if(!l)return;let u=l.clientX-this.startX,c=l.clientY-this.startY;this.handleResize(u,c)},this.handleMouseUp=()=>{if(!this.isResizing)return;let a=this.element.offsetWidth,l=this.element.offsetHeight;this.onCommit(a,l),this.isResizing=!1,this.activeHandle=null,this.container.dataset.resizeState="false",this.classNames.resizing&&this.container.classList.remove(this.classNames.resizing),document.removeEventListener("mousemove",this.handleMouseMove),document.removeEventListener("mouseup",this.handleMouseUp),document.removeEventListener("keydown",this.handleKeyDown),document.removeEventListener("keyup",this.handleKeyUp)},this.handleKeyDown=a=>{a.key==="Shift"&&(this.isShiftKeyPressed=!0)},this.handleKeyUp=a=>{a.key==="Shift"&&(this.isShiftKeyPressed=!1)},this.node=e.node,this.editor=e.editor,this.element=e.element,this.element.draggable=!1,this.contentElement=e.contentElement,this.getPos=e.getPos,this.onResize=e.onResize,this.onCommit=e.onCommit,this.onUpdate=e.onUpdate,!((t=e.options)===null||t===void 0)&&t.min&&(this.minSize={...this.minSize,...e.options.min}),!((n=e.options)===null||n===void 0)&&n.max&&(this.maxSize=e.options.max),!(e==null||(o=e.options)===null||o===void 0)&&o.directions&&(this.directions=e.options.directions),!((r=e.options)===null||r===void 0)&&r.preserveAspectRatio&&(this.preserveAspectRatio=e.options.preserveAspectRatio),!((i=e.options)===null||i===void 0)&&i.className&&(this.classNames={container:e.options.className.container||"",wrapper:e.options.className.wrapper||"",handle:e.options.className.handle||"",resizing:e.options.className.resizing||""}),!((s=e.options)===null||s===void 0)&&s.createCustomHandle&&(this.createCustomHandle=e.options.createCustomHandle),this.wrapper=this.createWrapper(),this.container=this.createContainer(),this.applyInitialSize(),this.attachHandles(),this.editor.on("update",this.handleEditorUpdate)}get dom(){return this.container}get contentDOM(){var e;return(e=this.contentElement)!==null&&e!==void 0?e:null}update(e,t,n){return e.type!==this.node.type?!1:(this.node=e,this.onUpdate?this.onUpdate(e,t,n):!0)}destroy(){this.isResizing&&(this.container.dataset.resizeState="false",this.classNames.resizing&&this.container.classList.remove(this.classNames.resizing),document.removeEventListener("mousemove",this.handleMouseMove),document.removeEventListener("mouseup",this.handleMouseUp),document.removeEventListener("keydown",this.handleKeyDown),document.removeEventListener("keyup",this.handleKeyUp),this.isResizing=!1,this.activeHandle=null),this.editor.off("update",this.handleEditorUpdate),this.container.remove()}createContainer(){let e=document.createElement("div");return e.dataset.resizeContainer="",e.dataset.node=this.node.type.name,e.style.display=this.node.type.isInline?"inline-flex":"flex",this.classNames.container&&(e.className=this.classNames.container),e.appendChild(this.wrapper),e}createWrapper(){let e=document.createElement("div");return e.style.position="relative",e.style.display="block",e.dataset.resizeWrapper="",this.classNames.wrapper&&(e.className=this.classNames.wrapper),e.appendChild(this.element),e}createHandle(e){let t=document.createElement("div");return t.dataset.resizeHandle=e,t.style.position="absolute",this.classNames.handle&&(t.className=this.classNames.handle),t}positionHandle(e,t){let n=t.includes("top"),o=t.includes("bottom"),r=t.includes("left"),i=t.includes("right");n&&(e.style.top="0"),o&&(e.style.bottom="0"),r&&(e.style.left="0"),i&&(e.style.right="0"),(t==="top"||t==="bottom")&&(e.style.left="0",e.style.right="0"),(t==="left"||t==="right")&&(e.style.top="0",e.style.bottom="0")}attachHandles(){this.directions.forEach(e=>{let t;this.createCustomHandle?t=this.createCustomHandle(e):t=this.createHandle(e),t instanceof HTMLElement||(console.warn(`[ResizableNodeView] createCustomHandle("${e}") did not return an HTMLElement. Falling back to default handle.`),t=this.createHandle(e)),this.createCustomHandle||this.positionHandle(t,e),t.addEventListener("mousedown",n=>this.handleResizeStart(n,e)),t.addEventListener("touchstart",n=>this.handleResizeStart(n,e)),this.handleMap.set(e,t),this.wrapper.appendChild(t)})}removeHandles(){this.handleMap.forEach(e=>e.remove()),this.handleMap.clear()}applyInitialSize(){let e=this.node.attrs.width,t=this.node.attrs.height;e?(this.element.style.width=`${e}px`,this.initialWidth=e):this.initialWidth=this.element.offsetWidth,t?(this.element.style.height=`${t}px`,this.initialHeight=t):this.initialHeight=this.element.offsetHeight,this.initialWidth>0&&this.initialHeight>0&&(this.aspectRatio=this.initialWidth/this.initialHeight)}handleResizeStart(e,t){e.preventDefault(),e.stopPropagation(),this.isResizing=!0,this.activeHandle=t,r8(e)?(this.startX=e.touches[0].clientX,this.startY=e.touches[0].clientY):(this.startX=e.clientX,this.startY=e.clientY),this.startWidth=this.element.offsetWidth,this.startHeight=this.element.offsetHeight,this.startWidth>0&&this.startHeight>0&&(this.aspectRatio=this.startWidth/this.startHeight),this.getPos(),this.container.dataset.resizeState="true",this.classNames.resizing&&this.container.classList.add(this.classNames.resizing),document.addEventListener("mousemove",this.handleMouseMove),document.addEventListener("touchmove",this.handleTouchMove),document.addEventListener("mouseup",this.handleMouseUp),document.addEventListener("keydown",this.handleKeyDown),document.addEventListener("keyup",this.handleKeyUp)}handleResize(e,t){if(!this.activeHandle)return;let n=this.preserveAspectRatio||this.isShiftKeyPressed,{width:o,height:r}=this.calculateNewDimensions(this.activeHandle,e,t),i=this.applyConstraints(o,r,n);this.element.style.width=`${i.width}px`,this.element.style.height=`${i.height}px`,this.onResize&&this.onResize(i.width,i.height)}calculateNewDimensions(e,t,n){let o=this.startWidth,r=this.startHeight,i=e.includes("right"),s=e.includes("left"),a=e.includes("bottom"),l=e.includes("top");return i?o=this.startWidth+t:s&&(o=this.startWidth-t),a?r=this.startHeight+n:l&&(r=this.startHeight-n),(e==="right"||e==="left")&&(o=this.startWidth+(i?t:-t)),(e==="top"||e==="bottom")&&(r=this.startHeight+(a?n:-n)),this.preserveAspectRatio||this.isShiftKeyPressed?this.applyAspectRatio(o,r,e):{width:o,height:r}}applyConstraints(e,t,n){var o,r;if(!n){var i,s;let u=Math.max(this.minSize.width,e),c=Math.max(this.minSize.height,t);return!((i=this.maxSize)===null||i===void 0)&&i.width&&(u=Math.min(this.maxSize.width,u)),!((s=this.maxSize)===null||s===void 0)&&s.height&&(c=Math.min(this.maxSize.height,c)),{width:u,height:c}}let a=e,l=t;return a<this.minSize.width&&(a=this.minSize.width,l=a/this.aspectRatio),l<this.minSize.height&&(l=this.minSize.height,a=l*this.aspectRatio),!((o=this.maxSize)===null||o===void 0)&&o.width&&a>this.maxSize.width&&(a=this.maxSize.width,l=a/this.aspectRatio),!((r=this.maxSize)===null||r===void 0)&&r.height&&l>this.maxSize.height&&(l=this.maxSize.height,a=l*this.aspectRatio),{width:a,height:l}}applyAspectRatio(e,t,n){let o=n==="left"||n==="right",r=n==="top"||n==="bottom";return o?{width:e,height:e/this.aspectRatio}:r?{width:t*this.aspectRatio,height:t}:{width:e,height:e/this.aspectRatio}}};var ce=class lT extends uy{constructor(...t){super(...t),this.type="node"}static create(t={}){let n=typeof t=="function"?t():t;return new lT(n)}configure(t){return super.configure(t)}extend(t){let n=typeof t=="function"?t():t;return super.extend(n)}};function Gt(e){return new cy({find:e.find,handler:({state:t,range:n,match:o,pasteEvent:r})=>{let i=Ce(e.getAttributes,void 0,o,r);if(i===!1||i===null)return null;let{tr:s}=t,a=o[o.length-1],l=o[0],u=n.to;if(a){let c=l.search(/\S/),d=n.from+l.indexOf(a),f=d+a.length;if(Ha(n.from,n.to,t.doc).filter(h=>h.mark.type.excluded.find(p=>p===e.type&&p!==h.mark.type)).filter(h=>h.to>d).length)return null;f<n.to&&s.delete(f,n.to),d>n.from&&s.delete(n.from+c,d),u=n.from+c+a.length,s.addMark(n.from+c,u,e.type.create(i||{})),o.index!==void 0&&o.input!==void 0&&o.index+o[0].length>=o.input.length||s.removeStoredMark(e.type)}}})}var uT=new WeakSet,cT=new WeakSet;function ko(e){let t=e;return uT.add(t),t}function dy(e){return Array.isArray(e)&&uT.has(e)}function dT(e){return e.flatMap(t=>t==null?[]:Array.isArray(t)&&cT.has(t)&&!dy(t)?dT(t):[t])}function o8(e,t){if(e==="slot")return 0;if(e instanceof Function){let r=e(t);return Array.isArray(r)&&!dy(r)&&!cT.has(r)?ko(r):r}let{children:n,...o}=t??{};if(e==="svg")throw new Error("SVG elements are not supported in the JSX syntax, use the array syntax instead");if(Array.isArray(n)){if(dy(n))return ko([e,o,n]);if(n.length===0)return ko([e,o]);let r=dT(n);return r.length===0?ko([e,o]):ko([e,o,...r])}return n!=null?ko([e,o,n]):ko([e,o])}var Gi=(e,t)=>o8(e,t);var i8=(e,t)=>{var n;let{state:o}=e,{selection:r}=o;if(!r.empty)return!1;let{$from:i}=r;if(i.parentOffset!==0)return!1;let s=i.depth-1;if(s<0)return!1;let a=i.node(s),l=i.index(s);if(l===0)return!1;if(a.type===t)return e.commands.lift(t.name);let u=a.child(l-1);if(u.type!==t||!(!((n=u.lastChild)===null||n===void 0)&&n.isTextblock))return!1;let c=i.before()-1-1;return e.commands.command(({tr:d,dispatch:f})=>{if(!f)return!0;let h=i.parent.content,p=new F(h,0,0);return d.replace(c,i.after(),p),d.setSelection(Z.create(d.doc,c)),d.scrollIntoView(),f(d),!0})},s8=/^\s*>\s$/,fT=ce.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:e}){return Gi("blockquote",{...fe(this.options.HTMLAttributes,e),children:Gi("slot",{})})},parseMarkdown:(e,t)=>{var n;let o=(n=t.parseBlockChildren)!==null&&n!==void 0?n:t.parseChildren;return t.createNode("blockquote",void 0,o(e.tokens||[]))},renderMarkdown:(e,t)=>{if(!e.content)return"";let n=">",o=[];return e.content.forEach((r,i)=>{var s,a;let l=((s=(a=t.renderChild)===null||a===void 0?void 0:a.call(t,r,i))!==null&&s!==void 0?s:t.renderChildren([r])).split(`
`).map(u=>u.trim()===""?n:`${n} ${u}`);o.push(l.join(`
`))}),o.join(`
${n}
`)},addCommands(){return{setBlockquote:()=>({commands:e})=>e.wrapIn(this.name),toggleBlockquote:()=>({commands:e})=>e.toggleWrap(this.name),unsetBlockquote:()=>({commands:e})=>e.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote(),Backspace:()=>i8(this.editor,this.type)}},addInputRules(){return[Ir({find:s8,type:this.type})]}});var a8=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,l8=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,u8=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,c8=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,pT=at.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:e=>e.style.fontWeight!=="normal"&&null},{style:"font-weight=400",clearMark:e=>e.type.name===this.name},{style:"font-weight",getAttrs:e=>/^(bold(er)?|[5-9]\d{2,})$/.test(e)&&null}]},renderHTML({HTMLAttributes:e}){return Gi("strong",{...fe(this.options.HTMLAttributes,e),children:Gi("slot",{})})},markdownTokenName:"strong",parseMarkdown:(e,t)=>t.applyMark("bold",t.parseInline(e.tokens||[])),markdownOptions:{htmlReopen:{open:"<strong>",close:"</strong>"}},renderMarkdown:(e,t)=>`**${t.renderChildren(e)}**`,addCommands(){return{setBold:()=>({commands:e})=>e.setMark(this.name),toggleBold:()=>({commands:e})=>e.toggleMark(this.name),unsetBold:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[ln({find:a8,type:this.type}),ln({find:u8,type:this.type})]},addPasteRules(){return[Gt({find:l8,type:this.type}),Gt({find:c8,type:this.type})]}});var d8=e=>{let t=/`([^`]+)`(?!`)$/.exec(e);return!t||t.index>0&&e[t.index-1]==="`"?null:{index:t.index,text:t[0],replaceWith:t[1]}},f8=e=>{let t=/`([^`]+)`(?!`)/g,n=[],o;for(;(o=t.exec(e))!==null;)o.index>0&&e[o.index-1]==="`"||n.push({index:o.index,text:o[0],replaceWith:o[1]});return n};function p8(e){let t=new Set((e.match(/`+/g)||[]).map(o=>o.length)),n=1;for(;t.has(n);)n+=1;return n}var hT=at.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:e}){return["code",fe(this.options.HTMLAttributes,e),0]},markdownTokenName:"codespan",parseMarkdown:(e,t)=>t.applyMark("code",[{type:"text",text:e.text||""}]),renderMarkdown:(e,t,n)=>{var o;if(!e.content)return"";let r=typeof(n==null||(o=n.meta)===null||o===void 0?void 0:o.markText)=="string"?n.meta.markText:"",i="`".repeat(p8(r)),s=r.startsWith("`")||r.endsWith("`")?" ":"";return`${i}${s}${t.renderChildren(e.content)}${s}${i}`},addCommands(){return{setCode:()=>({commands:e})=>e.setMark(this.name),toggleCode:()=>({commands:e})=>e.toggleMark(this.name),unsetCode:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[ln({find:d8,type:this.type})]},addPasteRules(){return[Gt({find:f8,type:this.type})]}});var fy=4,h8=/^```([a-z]+)?[\s\n]$/,m8=/^~~~([a-z]+)?[\s\n]$/,mT=ce.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,exitOnArrowUp:!0,defaultLanguage:null,enableTabIndentation:!1,tabSize:fy,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:e=>{var t;let{languageClassPrefix:n}=this.options;if(!n)return null;let o=[...((t=e.firstElementChild)===null||t===void 0?void 0:t.classList)||[]].filter(r=>r.startsWith(n)).map(r=>r.replace(n,""))[0];return o||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:e,HTMLAttributes:t}){return["pre",fe(this.options.HTMLAttributes,t),["code",{class:e.attrs.language?this.options.languageClassPrefix+e.attrs.language:null},0]]},markdownTokenName:"code",parseMarkdown:(e,t)=>{var n,o;return((n=e.raw)===null||n===void 0?void 0:n.startsWith("```"))===!1&&((o=e.raw)===null||o===void 0?void 0:o.startsWith("~~~"))===!1&&e.codeBlockStyle!=="indented"?[]:t.createNode("codeBlock",{language:e.lang||null},e.text?[t.createTextNode(e.text)]:[])},renderMarkdown:(e,t)=>{var n;let o="",r=((n=e.attrs)===null||n===void 0?void 0:n.language)||"";return e.content?o=[`\`\`\`${r}`,t.renderChildren(e.content),"```"].join(`
`):o=`\`\`\`${r}
\`\`\``,o},addCommands(){return{setCodeBlock:e=>({commands:t})=>t.setNode(this.name,e),toggleCodeBlock:e=>({commands:t})=>t.toggleNode(this.name,"paragraph",e)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{let{empty:e,$anchor:t}=this.editor.state.selection,n=t.pos===1;return!e||t.parent.type.name!==this.name?!1:n||!t.parent.textContent.length?this.editor.commands.clearNodes():!1},Tab:({editor:e})=>{var t;if(!this.options.enableTabIndentation)return!1;let n=(t=this.options.tabSize)!==null&&t!==void 0?t:fy,{state:o}=e,{selection:r}=o,{$from:i,empty:s}=r;if(i.parent.type!==this.type)return!1;let a=" ".repeat(n);return s?e.commands.insertContent(a):e.commands.command(({tr:l})=>{let{from:u,to:c}=r,d=o.doc.textBetween(u,c,`
`,`
`).split(`
`).map(f=>a+f).join(`
`);return l.replaceWith(u,c,o.schema.text(d)),!0})},"Shift-Tab":({editor:e})=>{var t;if(!this.options.enableTabIndentation)return!1;let n=(t=this.options.tabSize)!==null&&t!==void 0?t:fy,{state:o}=e,{selection:r}=o,{$from:i,empty:s}=r;return i.parent.type!==this.type?!1:s?e.commands.command(({tr:a})=>{var l;let{pos:u}=i,c=i.start(),d=i.end(),f=o.doc.textBetween(c,d,`
`,`
`).split(`
`),h=0,p=0,m=u-c;for(let k=0;k<f.length;k+=1){if(p+f[k].length>=m){h=k;break}p+=f[k].length+1}let g=((l=f[h].match(/^ */))===null||l===void 0?void 0:l[0])||"",b=Math.min(g.length,n);if(b===0)return!0;let y=c;for(let k=0;k<h;k+=1)y+=f[k].length+1;return a.delete(y,y+b),u-y<=b&&a.setSelection(Z.create(a.doc,y)),!0}):e.commands.command(({tr:a})=>{let{from:l,to:u}=r,c=o.doc.textBetween(l,u,`
`,`
`).split(`
`).map(d=>{var f;let h=((f=d.match(/^ */))===null||f===void 0?void 0:f[0])||"",p=Math.min(h.length,n);return d.slice(p)}).join(`
`);return a.replaceWith(l,u,o.schema.text(c)),!0})},Enter:({editor:e})=>{if(!this.options.exitOnTripleEnter)return!1;let{state:t}=e,{selection:n}=t,{$from:o,empty:r}=n;if(!r||o.parent.type!==this.type)return!1;let i=o.parentOffset===o.parent.nodeSize-2,s=o.parent.textContent.endsWith(`
`);return!i||!s?!1:e.chain().command(({tr:a})=>(a.delete(o.pos-2,o.pos),!0)).exitCode().run()},ArrowUp:({editor:e})=>{if(!this.options.exitOnArrowUp)return!1;let{state:t}=e,{selection:n}=t,{$from:o,empty:r}=n;if(!r||o.parent.type!==this.type||o.parentOffset!==0)return!1;let i=o.before();return i>0?!1:e.commands.insertDefaultBlock({pos:i})},ArrowDown:({editor:e})=>{if(!this.options.exitOnArrowDown)return!1;let{state:t}=e,{selection:n,doc:o}=t,{$from:r,empty:i}=n;if(!i||r.parent.type!==this.type||r.parentOffset!==r.parent.nodeSize-2)return!1;let s=r.after();return s===void 0?!1:o.nodeAt(s)?e.commands.command(({tr:a})=>(a.setSelection(Q.near(o.resolve(s))),!0)):e.commands.exitCode()}}},addInputRules(){return[qa({find:h8,type:this.type,getAttributes:e=>({language:e[1]})}),qa({find:m8,type:this.type,getAttributes:e=>({language:e[1]})})]},addProseMirrorPlugins(){return[new de({key:new ke("codeBlockVSCodeHandler"),props:{handlePaste:(e,t)=>{if(!t.clipboardData||this.editor.isActive(this.type.name))return!1;let n=t.clipboardData.getData("text/plain"),o=t.clipboardData.getData("vscode-editor-data"),r=o?JSON.parse(o):void 0,i=r?.mode;if(!n||!i)return!1;let{tr:s,schema:a}=e.state,l=a.text(n.replace(/\r\n?/g,`
`));return s.replaceSelectionWith(this.type.create({language:i},l)),s.selection.$from.parent.type!==this.type&&s.setSelection(Z.near(s.doc.resolve(Math.max(0,s.selection.from-2)))),s.setMeta("paste",!0),e.dispatch(s),!0}}})]}});var gT=ce.create({name:"doc",topNode:!0,content:"block+",renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`
`):""});var bT=ce.create({name:"hardBreak",markdownTokenName:"br",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:e}){return["br",fe(this.options.HTMLAttributes,e)]},renderText(){return`
`},renderMarkdown:()=>`
`,parseMarkdown:()=>({type:"hardBreak"}),addCommands(){return{setHardBreak:()=>({commands:e,chain:t,state:n,editor:o})=>e.first([()=>e.exitCode(),()=>e.command(()=>{let{selection:r,storedMarks:i}=n;if(r.$from.parent.type.spec.isolating)return!1;let{keepMarks:s}=this.options,{splittableMarks:a}=o.extensionManager,l=i||r.$to.parentOffset&&r.$from.marks();return t().insertContent({type:this.name}).command(({tr:u,dispatch:c})=>{if(c&&l&&s){let d=l.filter(f=>a.includes(f.type.name));u.ensureMarks(d)}return!0}).scrollIntoView().run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}});var yT=ce.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(e=>({tag:`h${e}`,attrs:{level:e}}))},renderHTML({node:e,HTMLAttributes:t}){return[`h${this.options.levels.includes(e.attrs.level)?e.attrs.level:this.options.levels[0]}`,fe(this.options.HTMLAttributes,t),0]},parseMarkdown(e,t){let n=e.depth||1;return this.options.levels.includes(n)?t.createNode("heading",{level:n},t.parseInline(e.tokens||[])):t.createNode("paragraph",void 0,t.parseInline(e.tokens||[]))},renderMarkdown:(e,t)=>{var n;let o=!((n=e.attrs)===null||n===void 0)&&n.level?parseInt(e.attrs.level,10):1,r="#".repeat(o);return e.content?`${r} ${t.renderChildren(e.content)}`:""},addCommands(){return{setHeading:e=>({commands:t})=>this.options.levels.includes(e.level)?t.setNode(this.name,e):!1,toggleHeading:e=>({commands:t})=>this.options.levels.includes(e.level)?t.toggleNode(this.name,"paragraph",e):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((e,t)=>({...e,[`Mod-Alt-${t}`]:()=>this.editor.commands.toggleHeading({level:t})}),{})},addInputRules(){return this.options.levels.map(e=>qa({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${e}})\\s$`),type:this.type,getAttributes:{level:e}}))}});var vT=ce.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{},nextNodeType:"paragraph"}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:e}){return["hr",fe(this.options.HTMLAttributes,e)]},markdownTokenName:"hr",parseMarkdown:(e,t)=>t.createNode("horizontalRule"),renderMarkdown:()=>"---",addCommands(){return{setHorizontalRule:()=>({chain:e,state:t})=>{if(!HC(t,t.schema.nodes[this.name]))return!1;let{selection:n}=t,{$to:o}=n,r=e();return Ad(n)?r.insertContentAt(o.pos,{type:this.name}):r.insertContent({type:this.name}),r.command(({state:i,tr:s,dispatch:a})=>{if(a){let{$to:l}=s.selection,u=l.end();if(l.nodeAfter)l.nodeAfter.isTextblock?s.setSelection(Z.create(s.doc,l.pos+1)):l.nodeAfter.isBlock?s.setSelection(X.create(s.doc,l.pos)):s.setSelection(Z.create(s.doc,l.pos));else{let c=i.schema.nodes[this.options.nextNodeType]||l.parent.type.contentMatch.defaultType,d=c?.create();d&&(s.insert(u,d),s.setSelection(Z.create(s.doc,u+1)))}s.scrollIntoView()}return!0}).run()}}},addInputRules(){return[$d({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}});var g8=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,b8=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,y8=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,v8=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,xT=at.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:e=>e.style.fontStyle!=="normal"&&null},{style:"font-style=normal",clearMark:e=>e.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:e}){return["em",fe(this.options.HTMLAttributes,e),0]},addCommands(){return{setItalic:()=>({commands:e})=>e.setMark(this.name),toggleItalic:()=>({commands:e})=>e.toggleMark(this.name),unsetItalic:()=>({commands:e})=>e.unsetMark(this.name)}},markdownTokenName:"em",parseMarkdown:(e,t)=>t.applyMark("italic",t.parseInline(e.tokens||[])),markdownOptions:{htmlReopen:{open:"<em>",close:"</em>"}},renderMarkdown:(e,t)=>`*${t.renderChildren(e)}*`,addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[ln({find:g8,type:this.type}),ln({find:y8,type:this.type})]},addPasteRules(){return[Gt({find:b8,type:this.type}),Gt({find:v8,type:this.type})]}});var x8="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2odyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos6kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rck0msd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5m\xF6gensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12b0cam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2oodside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",k8="\u03B5\u03BB1\u03C52\u0431\u04331\u0435\u043B3\u0434\u0435\u0442\u04384\u0435\u044E2\u043A\u0430\u0442\u043E\u043B\u0438\u043A6\u043E\u043C3\u043C\u043A\u04342\u043E\u043D1\u0441\u043A\u0432\u04306\u043E\u043D\u043B\u0430\u0439\u043D5\u0440\u04333\u0440\u0443\u04412\u04442\u0441\u0430\u0439\u04423\u0440\u04313\u0443\u043A\u04403\u049B\u0430\u04373\u0570\u0561\u05753\u05D9\u05E9\u05E8\u05D0\u05DC5\u05E7\u05D5\u05DD3\u0627\u0628\u0648\u0638\u0628\u064A5\u0631\u0627\u0645\u0643\u06485\u0644\u0627\u0631\u062F\u06464\u0628\u062D\u0631\u064A\u06465\u062C\u0632\u0627\u0626\u06315\u0633\u0639\u0648\u062F\u064A\u06296\u0639\u0644\u064A\u0627\u06465\u0645\u063A\u0631\u06285\u0645\u0627\u0631\u0627\u062A5\u06CC\u0631\u0627\u06465\u0628\u0627\u0631\u062A2\u0632\u0627\u06314\u064A\u062A\u06433\u06BE\u0627\u0631\u062A5\u062A\u0648\u0646\u06334\u0633\u0648\u062F\u0627\u06463\u0631\u064A\u06295\u0634\u0628\u0643\u06294\u0639\u0631\u0627\u06422\u06282\u0645\u0627\u06464\u0641\u0644\u0633\u0637\u064A\u06466\u0642\u0637\u06313\u0643\u0627\u062B\u0648\u0644\u064A\u06436\u0648\u06453\u0645\u0635\u06312\u0644\u064A\u0633\u064A\u06275\u0648\u0631\u064A\u062A\u0627\u0646\u064A\u06277\u0642\u06394\u0647\u0645\u0631\u0627\u06475\u067E\u0627\u06A9\u0633\u062A\u0627\u06467\u0680\u0627\u0631\u062A4\u0915\u0949\u092E3\u0928\u0947\u091F3\u092D\u093E\u0930\u09240\u092E\u094D3\u094B\u09245\u0938\u0902\u0917\u0920\u09285\u09AC\u09BE\u0982\u09B2\u09BE5\u09AD\u09BE\u09B0\u09A42\u09F0\u09A44\u0A2D\u0A3E\u0A30\u0A244\u0AAD\u0ABE\u0AB0\u0AA44\u0B2D\u0B3E\u0B30\u0B244\u0B87\u0BA8\u0BCD\u0BA4\u0BBF\u0BAF\u0BBE6\u0BB2\u0B99\u0BCD\u0B95\u0BC86\u0B9A\u0BBF\u0B99\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0BC2\u0BB0\u0BCD11\u0C2D\u0C3E\u0C30\u0C24\u0C4D5\u0CAD\u0CBE\u0CB0\u0CA44\u0D2D\u0D3E\u0D30\u0D24\u0D025\u0DBD\u0D82\u0D9A\u0DCF4\u0E04\u0E2D\u0E213\u0E44\u0E17\u0E223\u0EA5\u0EB2\u0EA73\u10D2\u10D42\u307F\u3093\u306A3\u30A2\u30DE\u30BE\u30F34\u30AF\u30E9\u30A6\u30C94\u30B0\u30FC\u30B0\u30EB4\u30B3\u30E02\u30B9\u30C8\u30A23\u30BB\u30FC\u30EB3\u30D5\u30A1\u30C3\u30B7\u30E7\u30F36\u30DD\u30A4\u30F3\u30C84\u4E16\u754C2\u4E2D\u4FE11\u56FD1\u570B1\u6587\u7F513\u4E9A\u9A6C\u900A3\u4F01\u4E1A2\u4F5B\u5C712\u4FE1\u606F2\u5065\u5EB72\u516B\u53662\u516C\u53F81\u76CA2\u53F0\u6E7E1\u70632\u5546\u57CE1\u5E971\u68072\u5609\u91CC0\u5927\u9152\u5E975\u5728\u7EBF2\u5927\u62FF2\u5929\u4E3B\u65593\u5A31\u4E502\u5BB6\u96FB2\u5E7F\u4E1C2\u5FAE\u535A2\u6148\u55842\u6211\u7231\u4F603\u624B\u673A2\u62DB\u80582\u653F\u52A11\u5E9C2\u65B0\u52A0\u57612\u95FB2\u65F6\u5C1A2\u66F8\u7C4D2\u673A\u67842\u6DE1\u9A6C\u95213\u6E38\u620F2\u6FB3\u95802\u70B9\u770B2\u79FB\u52A82\u7EC4\u7EC7\u673A\u67844\u7F51\u57401\u5E971\u7AD91\u7EDC2\u8054\u901A2\u8C37\u6B4C2\u8D2D\u72692\u901A\u8CA92\u96C6\u56E22\u96FB\u8A0A\u76C8\u79D14\u98DE\u5229\u6D663\u98DF\u54C12\u9910\u53852\u9999\u683C\u91CC\u62C93\u6E2F2\uB2F7\uB1371\uCEF42\uC0BC\uC1312\uD55C\uAD6D2",yy="numeric",vy="ascii",xy="alpha",Va="asciinumeric",Za="alphanumeric",ky="domain",CT="emoji",w8="scheme",S8="slashscheme",py="whitespace";function _8(e,t){return e in t||(t[e]=[]),t[e]}function So(e,t,n){t[yy]&&(t[Va]=!0,t[Za]=!0),t[vy]&&(t[Va]=!0,t[xy]=!0),t[Va]&&(t[Za]=!0),t[xy]&&(t[Za]=!0),t[Za]&&(t[ky]=!0),t[CT]&&(t[ky]=!0);for(let o in t){let r=_8(o,n);r.indexOf(e)<0&&r.push(e)}}function E8(e,t){let n={};for(let o in t)t[o].indexOf(e)>=0&&(n[o]=!0);return n}function Zt(e=null){this.j={},this.jr=[],this.jd=null,this.t=e}Zt.groups={};Zt.prototype={accepts(){return!!this.t},go(e){let t=this,n=t.j[e];if(n)return n;for(let o=0;o<t.jr.length;o++){let r=t.jr[o][0],i=t.jr[o][1];if(i&&r.test(e))return i}return t.jd},has(e,t=!1){return t?e in this.j:!!this.go(e)},ta(e,t,n,o){for(let r=0;r<e.length;r++)this.tt(e[r],t,n,o)},tr(e,t,n,o){o=o||Zt.groups;let r;return t&&t.j?r=t:(r=new Zt(t),n&&o&&So(t,n,o)),this.jr.push([e,r]),r},ts(e,t,n,o){let r=this,i=e.length;if(!i)return r;for(let s=0;s<i-1;s++)r=r.tt(e[s]);return r.tt(e[i-1],t,n,o)},tt(e,t,n,o){o=o||Zt.groups;let r=this;if(t&&t.j)return r.j[e]=t,t;let i=t,s,a=r.go(e);if(a?(s=new Zt,Object.assign(s.j,a.j),s.jr.push.apply(s.jr,a.jr),s.jd=a.jd,s.t=a.t):s=new Zt,i){if(o)if(s.t&&typeof s.t=="string"){let l=Object.assign(E8(s.t,o),n);So(i,l,o)}else n&&So(i,n,o);s.t=i}return r.j[e]=s,s}};var he=(e,t,n,o,r)=>e.ta(t,n,o,r),Ke=(e,t,n,o,r)=>e.tr(t,n,o,r),kT=(e,t,n,o,r)=>e.ts(t,n,o,r),R=(e,t,n,o,r)=>e.tt(t,n,o,r),sr="WORD",wy="UWORD",TT="ASCIINUMERICAL",AT="ALPHANUMERICAL",Qa="LOCALHOST",Sy="TLD",_y="UTLD",zd="SCHEME",Qi="SLASH_SCHEME",Cy="NUM",Ey="WS",Ty="NL",Wa="OPENBRACE",Ka="CLOSEBRACE",Rd="OPENBRACKET",Pd="CLOSEBRACKET",Ld="OPENPAREN",Fd="CLOSEPAREN",jd="OPENANGLEBRACKET",Bd="CLOSEANGLEBRACKET",Ud="FULLWIDTHLEFTPAREN",Hd="FULLWIDTHRIGHTPAREN",qd="LEFTCORNERBRACKET",Zd="RIGHTCORNERBRACKET",Vd="LEFTWHITECORNERBRACKET",Wd="RIGHTWHITECORNERBRACKET",Kd="FULLWIDTHLESSTHAN",Jd="FULLWIDTHGREATERTHAN",Gd="AMPERSAND",Qd="APOSTROPHE",Xd="ASTERISK",Nr="AT",Yd="BACKSLASH",ef="BACKTICK",tf="CARET",_o="COLON",Ay="COMMA",nf="DOLLAR",Rn="DOT",rf="EQUALS",My="EXCLAMATION",cn="HYPHEN",Ja="PERCENT",of="PIPE",sf="PLUS",Yi="POUND",wo="QUERY",$y="QUOTE",MT="FULLWIDTHMIDDLEDOT",Iy="SEMI",Pn="SLASH",Ga="TILDE",af="UNDERSCORE",$T="EMOJI",lf="SYM",IT=Object.freeze({__proto__:null,ALPHANUMERICAL:AT,AMPERSAND:Gd,APOSTROPHE:Qd,ASCIINUMERICAL:TT,ASTERISK:Xd,AT:Nr,BACKSLASH:Yd,BACKTICK:ef,CARET:tf,CLOSEANGLEBRACKET:Bd,CLOSEBRACE:Ka,CLOSEBRACKET:Pd,CLOSEPAREN:Fd,COLON:_o,COMMA:Ay,DOLLAR:nf,DOT:Rn,EMOJI:$T,EQUALS:rf,EXCLAMATION:My,FULLWIDTHGREATERTHAN:Jd,FULLWIDTHLEFTPAREN:Ud,FULLWIDTHLESSTHAN:Kd,FULLWIDTHMIDDLEDOT:MT,FULLWIDTHRIGHTPAREN:Hd,HYPHEN:cn,LEFTCORNERBRACKET:qd,LEFTWHITECORNERBRACKET:Vd,LOCALHOST:Qa,NL:Ty,NUM:Cy,OPENANGLEBRACKET:jd,OPENBRACE:Wa,OPENBRACKET:Rd,OPENPAREN:Ld,PERCENT:Ja,PIPE:of,PLUS:sf,POUND:Yi,QUERY:wo,QUOTE:$y,RIGHTCORNERBRACKET:Zd,RIGHTWHITECORNERBRACKET:Wd,SCHEME:zd,SEMI:Iy,SLASH:Pn,SLASH_SCHEME:Qi,SYM:lf,TILDE:Ga,TLD:Sy,UNDERSCORE:af,UTLD:_y,UWORD:wy,WORD:sr,WS:Ey}),or=/[a-z]/,Xi=/[a-z]/i,Od=/[\u{1F000}-\u{1FAFF}\u{2600}-\u{27BF}]|\u{FE0F}/u;try{Xi=new RegExp("\\p{L}","u"),Od=new RegExp("\\p{Emoji}","u")}catch{}var ir=/\d/,hy=/\s/;var wT="\r",my=`
`,C8="\uFE0F",T8="\u200D",gy="\uFFFC",Id=null,Dd=null;function A8(e=[]){let t={};Zt.groups=t;let n=new Zt;Id==null&&(Id=ST(x8)),Dd==null&&(Dd=ST(k8)),R(n,"'",Qd),R(n,"{",Wa),R(n,"}",Ka),R(n,"[",Rd),R(n,"]",Pd),R(n,"(",Ld),R(n,")",Fd),R(n,"<",jd),R(n,">",Bd),R(n,"\uFF08",Ud),R(n,"\uFF09",Hd),R(n,"\u300C",qd),R(n,"\u300D",Zd),R(n,"\u300E",Vd),R(n,"\u300F",Wd),R(n,"\uFF1C",Kd),R(n,"\uFF1E",Jd),R(n,"&",Gd),R(n,"*",Xd),R(n,"@",Nr),R(n,"`",ef),R(n,"^",tf),R(n,":",_o),R(n,",",Ay),R(n,"$",nf),R(n,".",Rn),R(n,"=",rf),R(n,"!",My),R(n,"-",cn),R(n,"%",Ja),R(n,"|",of),R(n,"+",sf),R(n,"#",Yi),R(n,"?",wo),R(n,'"',$y),R(n,"/",Pn),R(n,";",Iy),R(n,"~",Ga),R(n,"_",af),R(n,"\\",Yd),R(n,"\u30FB",MT);let o=Ke(n,ir,Cy,{[yy]:!0});Ke(o,ir,o);let r=Ke(o,or,TT,{[Va]:!0}),i=Ke(o,Xi,AT,{[Za]:!0}),s=Ke(n,or,sr,{[vy]:!0});Ke(s,ir,r),Ke(s,or,s),Ke(r,ir,r),Ke(r,or,r);let a=Ke(n,Xi,wy,{[xy]:!0});Ke(a,or),Ke(a,ir,i),Ke(a,Xi,a),Ke(i,ir,i),Ke(i,or),Ke(i,Xi,i);let l=R(n,my,Ty,{[py]:!0}),u=R(n,wT,Ey,{[py]:!0}),c=Ke(n,hy,Ey,{[py]:!0});R(n,gy,c),R(u,my,l),R(u,gy,c),Ke(u,hy,c),R(c,wT),R(c,my),Ke(c,hy,c),R(c,gy,c);let d=Ke(n,Od,$T,{[CT]:!0});R(d,"#"),Ke(d,Od,d),R(d,C8,d);let f=R(d,T8);R(f,"#"),Ke(f,Od,d);let h=[[or,s],[ir,r]],p=[[or,null],[Xi,a],[ir,i]];for(let m=0;m<Id.length;m++)Dr(n,Id[m],Sy,sr,h);for(let m=0;m<Dd.length;m++)Dr(n,Dd[m],_y,wy,p);So(Sy,{tld:!0,ascii:!0},t),So(_y,{utld:!0,alpha:!0},t),Dr(n,"file",zd,sr,h),Dr(n,"mailto",zd,sr,h),Dr(n,"http",Qi,sr,h),Dr(n,"https",Qi,sr,h),Dr(n,"ftp",Qi,sr,h),Dr(n,"ftps",Qi,sr,h),So(zd,{scheme:!0,ascii:!0},t),So(Qi,{slashscheme:!0,ascii:!0},t),e=e.sort((m,g)=>m[0]>g[0]?1:-1);for(let m=0;m<e.length;m++){let g=e[m][0],y=e[m][1]?{[w8]:!0}:{[S8]:!0};g.indexOf("-")>=0?y[ky]=!0:or.test(g)?ir.test(g)?y[Va]=!0:y[vy]=!0:y[yy]=!0,kT(n,g,g,y)}return kT(n,"localhost",Qa,{ascii:!0}),n.jd=new Zt(lf),{start:n,tokens:Object.assign({groups:t},IT)}}function DT(e,t){let n=M8(t.replace(/[A-Z]/g,a=>a.toLowerCase())),o=n.length,r=[],i=0,s=0;for(;s<o;){let a=e,l=null,u=0,c=null,d=-1,f=-1;for(;s<o&&(l=a.go(n[s]));)a=l,a.accepts()?(d=0,f=0,c=a):d>=0&&(d+=n[s].length,f++),u+=n[s].length,i+=n[s].length,s++;i-=d,s-=f,u-=d,r.push({t:c.t,v:t.slice(i-u,i),s:i-u,e:i})}return r}function M8(e){let t=[],n=e.length,o=0;for(;o<n;){let r=e.charCodeAt(o),i,s=r<55296||r>56319||o+1===n||(i=e.charCodeAt(o+1))<56320||i>57343?e[o]:e.slice(o,o+2);t.push(s),o+=s.length}return t}function Dr(e,t,n,o,r){let i,s=t.length;for(let a=0;a<s-1;a++){let l=t[a];e.j[l]?i=e.j[l]:(i=new Zt(o),i.jr=r.slice(),e.j[l]=i),e=i}return i=new Zt(n),i.jr=r.slice(),e.j[t[s-1]]=i,i}function ST(e){let t=[],n=[],o=0,r="0123456789";for(;o<e.length;){let i=0;for(;r.indexOf(e[o+i])>=0;)i++;if(i>0){t.push(n.join(""));for(let s=parseInt(e.substring(o,o+i),10);s>0;s--)n.pop();o+=i}else n.push(e[o]),o++}return t}var Xa={defaultProtocol:"http",events:null,format:_T,formatHref:_T,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],ignoreClasses:[],render:null};function Dy(e,t=null){let n=Object.assign({},Xa);e&&(n=Object.assign(n,e instanceof Dy?e.o:e));let o=n.ignoreTags,r=[];for(let i=0;i<o.length;i++)r.push(o[i].toUpperCase());this.o=n,t&&(this.defaultRender=t),this.ignoreTags=r,this.ignoreClasses=n.ignoreClasses.slice()}Dy.prototype={o:Xa,ignoreTags:[],ignoreClasses:[],isIgnoredClass(e){if(typeof e!="string"||this.ignoreClasses.length===0)return!1;let t=e.split(/\s+/);for(let n=0;n<t.length;n++)if(this.ignoreClasses.indexOf(t[n])>=0)return!0;return!1},defaultRender(e){return e},check(e){return this.get("validate",e.toString(),e)},get(e,t,n){let o=t!=null,r=this.o[e];return r&&(typeof r=="object"?(r=n.t in r?r[n.t]:Xa[e],typeof r=="function"&&o&&(r=r(t,n))):typeof r=="function"&&o&&(r=r(t,n.t,n)),r)},getObj(e,t,n){let o=this.o[e];return typeof o=="function"&&t!=null&&(o=o(t,n.t,n)),o},render(e){let t=e.render(this);return(this.get("render",null,e)||this.defaultRender)(t,e.t,e)}};function _T(e){return e}function NT(e,t){this.t="token",this.v=e,this.tk=t}NT.prototype={isLink:!1,toString(){return this.v},toHref(e){return this.toString()},toFormattedString(e){let t=this.toString(),n=e.get("truncate",t,this),o=e.get("format",t,this);return n&&o.length>n?o.substring(0,n)+"\u2026":o},toFormattedHref(e){return e.get("formatHref",this.toHref(e.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(e=Xa.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(e),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(e){return{type:this.t,value:this.toFormattedString(e),isLink:this.isLink,href:this.toFormattedHref(e),start:this.startIndex(),end:this.endIndex()}},validate(e){return e.get("validate",this.toString(),this)},render(e){let t=this,n=this.toHref(e.get("defaultProtocol")),o=e.get("formatHref",n,this),r=e.get("tagName",n,t),i=this.toFormattedString(e),s={},a=e.get("className",n,t),l=e.get("target",n,t),u=e.get("rel",n,t),c=e.getObj("attributes",n,t),d=e.getObj("events",n,t);return s.href=o,a&&(s.class=a),l&&(s.target=l),u&&(s.rel=u),c&&Object.assign(s,c),{tagName:r,attributes:s,content:i,eventListeners:d}}};function uf(e,t){class n extends NT{constructor(r,i){super(r,i),this.t=e}}for(let o in t)n.prototype[o]=t[o];return n.t=e,n}var $8=uf("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),ET=uf("text"),I8=uf("nl"),Nd=uf("url",{isLink:!0,toHref(e=Xa.defaultProtocol){return this.hasProtocol()?this.v:`${e}://${this.v}`},hasProtocol(){let e=this.tk;return e.length>=2&&e[0].t!==Qa&&e[1].t===_o}});var un=e=>new Zt(e);function D8({groups:e}){let t=e.domain.concat([Gd,Xd,Nr,Yd,ef,tf,nf,rf,cn,Cy,Ja,of,sf,Yi,Pn,lf,Ga,af]),n=[Qd,_o,Ay,Rn,My,Ja,wo,$y,Iy,jd,Bd,Wa,Ka,Pd,Rd,Ld,Fd,Ud,Hd,qd,Zd,Vd,Wd,Kd,Jd],o=[Gd,Qd,Xd,Yd,ef,tf,nf,rf,cn,Wa,Ka,Ja,of,sf,Yi,wo,Pn,lf,Ga,af],r=un(),i=R(r,Ga);he(i,o,i),he(i,e.domain,i);let s=un(),a=un(),l=un();he(r,e.domain,s),he(r,e.scheme,a),he(r,e.slashscheme,l),he(s,o,i),he(s,e.domain,s);let u=R(s,Nr);R(i,Nr,u),R(a,Nr,u),R(l,Nr,u);let c=R(i,Rn);he(c,o,i),he(c,e.domain,i);let d=un();he(u,e.domain,d),he(d,e.domain,d);let f=R(d,Rn);he(f,e.domain,d);let h=un($8);he(f,e.tld,h),he(f,e.utld,h),R(u,Qa,h);let p=R(d,cn);R(p,cn,p),he(p,e.domain,d),he(h,e.domain,d),R(h,Rn,f),R(h,cn,p);let m=R(s,cn),g=R(s,Rn);R(m,cn,m),he(m,e.domain,s),he(g,o,i),he(g,e.domain,s);let b=un(Nd);he(g,e.tld,b),he(g,e.utld,b),he(b,e.domain,s),he(b,o,i),R(b,Rn,g),R(b,cn,m),R(b,Nr,u);let y=R(b,_o),k=un(Nd);he(y,e.numeric,k);let x=un(Nd),E=un();he(x,t,x),he(x,n,E),he(E,t,x),he(E,n,E),R(b,Pn,x),R(k,Pn,x),R(b,wo,E),R(b,Yi,x),R(k,wo,E),R(k,Yi,x);let I=R(a,_o),N=R(l,_o),D=R(N,Pn),W=R(D,Pn);he(a,e.domain,s),R(a,Rn,g),R(a,cn,m),he(l,e.domain,s),R(l,Rn,g),R(l,cn,m),he(I,e.domain,x),R(I,Pn,x),R(I,wo,x),he(W,e.domain,x),he(W,t,x),R(W,Pn,x);let re=[[Wa,Ka],[Rd,Pd],[Ld,Fd],[jd,Bd],[Ud,Hd],[qd,Zd],[Vd,Wd],[Kd,Jd]];for(let Oe=0;Oe<re.length;Oe++){let[We,Ge]=re[Oe],xe=R(x,We);R(E,We,xe);let oe=un(Nd);he(xe,t,oe);let A=un();he(xe,n,A),R(xe,Ge,x),he(oe,t,oe),he(oe,n,A),he(A,t,oe),he(A,n,A),R(oe,Ge,x),R(A,Ge,x)}return R(r,Qa,b),R(r,Ty,I8),{start:r,tokens:IT}}function N8(e,t,n){let o=n.length,r=0,i=[],s=[],a=[];for(;r<o;){let l=e,u=null,c=null,d=0,f=null,h=-1,p=[];for(;r<o&&!(u=l.go(n[r].t));)s.push(n[r++]);for(;r<o&&(c=u||l.go(n[r].t));)if(u=null,l=c,r++,d++,l.accepts())h=0,f=l,p=[];else if(h>=0&&h++,p.push(l),a[r]&&a[r].has(l))break;for(let m=0,g=r-p.length+1;m<p.length;m++,g++)(a[g]||(a[g]=new Set)).add(p[m]);if(h<0)r-=d,r<o&&(s.push(n[r]),r++);else{s.length>0&&(i.push(by(ET,t,s)),s=[]),r-=h,d-=h;let m=f.t,g=n.slice(r-d,r);i.push(by(m,t,g))}}return s.length>0&&i.push(by(ET,t,s)),i}function by(e,t,n){let o=n[0].s,r=n[n.length-1].e,i=t.slice(o,r);return new e(i,n)}var z8=typeof console<"u"&&console&&console.warn||(()=>{}),O8="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",Ue={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function zT(){return Zt.groups={},Ue.scanner=null,Ue.parser=null,Ue.tokenQueue=[],Ue.pluginQueue=[],Ue.customSchemes=[],Ue.initialized=!1,Ue}function Ny(e,t=!1){if(Ue.initialized&&z8(`linkifyjs: already initialized - will not register custom scheme "${e}" ${O8}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(e))throw new Error(`linkifyjs: incorrect scheme format.
1. Must only contain digits, lowercase ASCII letters or "-"
2. Cannot start or end with "-"
3. "-" cannot repeat`);Ue.customSchemes.push([e,t])}function R8(){Ue.scanner=A8(Ue.customSchemes);for(let e=0;e<Ue.tokenQueue.length;e++)Ue.tokenQueue[e][1]({scanner:Ue.scanner});Ue.parser=D8(Ue.scanner.tokens);for(let e=0;e<Ue.pluginQueue.length;e++)Ue.pluginQueue[e][1]({scanner:Ue.scanner,parser:Ue.parser});return Ue.initialized=!0,Ue}function cf(e){return Ue.initialized||R8(),N8(Ue.parser.start,e,DT(Ue.scanner.start,e))}cf.scan=DT;function zy(e,t=null,n=null){if(t&&typeof t=="object"){if(n)throw Error(`linkifyjs: Invalid link type ${t}; must be a string`);n=t,t=null}let o=new Dy(n),r=cf(e),i=[];for(let s=0;s<r.length;s++){let a=r[s];a.isLink&&(!t||a.t===t)&&o.check(a)&&i.push(a.toFormattedObject(o))}return i}var df="[\0- \xA0\u1680\u180E\u2000-\u2029\u205F\u3000]",P8=new RegExp(df),L8=new RegExp(`${df}$`),F8=new RegExp(`${df}+$`),j8=new RegExp(df,"g");function B8(e,t,n){var o,r;let i=e.doc.resolve(t.to);if(!(!((o=i.nodeBefore)===null||o===void 0)&&o.isText))return;let s=(r=e.doc.textBetween(t.from,t.to,"\uFFFC","\uFFFC").match(F8))===null||r===void 0?void 0:r[0];if(!s)return;let a=t.to-s.length,l=Ha(a,t.to,e.doc).filter(d=>d.mark.type===n);if(!l.length)return;let{nodeAfter:u}=i;if(u&&l.some(d=>d.mark.isInSet(u.marks)))return;let c=e.storedMarks;e.removeMark(a,t.to,n),e.setStoredMarks(c),e.selection.empty&&e.selection.from===t.to&&e.removeStoredMark(n)}function U8(e){return e.length===1?e[0].isLink:e.length===3&&e[1].isLink?["()","[]"].includes(e[0].value+e[2].value):!1}function H8(e){return new de({key:new ke("autolink"),appendTransaction:(t,n,o)=>{let r=t.some(l=>l.docChanged)&&!n.doc.eq(o.doc),i=t.some(l=>l.getMeta("preventAutolink"));if(!r||i)return;let{tr:s}=o,a=ny(n.doc,[...t]);if(!t.some(q2)){let l=[];a.steps.forEach((u,c)=>{if(!(u instanceof rt)||!u.slice.size)return;let d=a.mapping.slice(c+1),f=d.map(u.from,1),h=d.map(u.from+u.slice.size,-1);f<h&&l.push({from:f,to:h})}),l.sort((u,c)=>c.to-u.to),l.forEach(u=>B8(s,u,e.type))}if(Wi(a).forEach(({newRange:l})=>{let u=wC(o.doc,l,f=>f.isTextblock),c,d;if(u.length>1)c=u[0],d=o.doc.textBetween(c.pos,c.pos+c.node.nodeSize,void 0," ");else if(u.length){let f=o.doc.textBetween(l.from,l.to," "," ");if(!L8.test(f))return;c=u[0],d=o.doc.textBetween(c.pos,l.to,void 0," ")}if(c&&d){let f=d.split(P8).filter(Boolean);if(f.length<=0)return!1;let h=f[f.length-1],p=c.pos+d.lastIndexOf(h);if(!h)return!1;let m=cf(h).map(g=>g.toObject(e.defaultProtocol));if(!U8(m))return!1;m.filter(g=>g.isLink).map(g=>({...g,from:p+g.start+1,to:p+g.end+1})).filter(g=>o.schema.marks.code?!o.doc.rangeHasMark(g.from,g.to,o.schema.marks.code):!0).filter(g=>e.validate(g.value)).filter(g=>e.shouldAutoLink(g.value)).forEach(g=>{Ha(g.from,g.to,o.doc).some(b=>b.mark.type===e.type)||s.addMark(g.from,g.to,e.type.create({href:g.href}))})}}),!!s.steps.length)return s}})}function q8(e){return new de({key:new ke("handleClickLink"),props:{handleClick:(t,n,o)=>{if(o.button!==0||!t.editable)return!1;let r=null;if(o.target instanceof HTMLAnchorElement)r=o.target;else{let l=o.target;if(!l)return!1;let u=e.editor.view.dom;r=l.closest("a"),r&&!u.contains(r)&&(r=null)}if(!r)return!1;let i=!1;if(e.enableClickSelection&&(i=e.editor.commands.extendMarkRange(e.type.name)),e.openOnClick){var s,a;let l=iy(t.state,e.type.name),u=(s=r.href)!==null&&s!==void 0?s:l.href,c=(a=r.target)!==null&&a!==void 0?a:l.target;u&&(window.open(u,c),i=!0)}return i}}})}var Z8=/\[([^[\]]+)\]\(((?:[^\s()]|\([^\s()]*\))+)(?:\s+(?:(["'])(.*?)\3|“(.*?)”|‘(.*?)’))?\)$/,V8=/\[([^[\]]+)\]\(((?:[^\s()]|\([^\s()]*\))+)(?:\s+(?:(["'])(.*?)\3|“(.*?)”|‘(.*?)’))?\)/g;function OT(e,t){let n=0;for(let o=t-1;o>=0&&e[o]==="\\";o-=1)n+=1;return n%2===1}function W8(e,t){let n=0,o=0;for(;o<t;){if(e[o]!=="`"){o+=1;continue}if(n===0&&OT(e,o)){o+=1;continue}let r=0;for(;o<t&&e[o]==="`";)r+=1,o+=1;n===0?n=r:r===n&&(n=0)}return n>0}function RT(e,t,n){var o,r;let[,i,s]=t;return(t.index?e[t.index-1]:void 0)==="!"||OT(e,(o=t.index)!==null&&o!==void 0?o:0)||W8(e,(r=t.index)!==null&&r!==void 0?r:0)?!1:!!i.trim()&&n(s)}function PT(e){var t,n;let[o,r,i,,s,a,l]=e,u=(t=s??a)!==null&&t!==void 0?t:l;return{index:(n=e.index)!==null&&n!==void 0?n:0,text:o,replaceWith:r,data:{href:i,title:u||null,markdown:!0}}}function K8(e,t){return e.index<t.index+t.text.length&&t.index<e.index+e.text.length}function LT(e){var t,n,o;return{href:(t=e.data)===null||t===void 0?void 0:t.href,title:(n=(o=e.data)===null||o===void 0?void 0:o.title)!==null&&n!==void 0?n:null}}function J8(e){let t=ln({find:n=>{let o=Z8.exec(n);return!o||!RT(n,o,e.isAllowedHref)?null:PT(o)},type:e.type,getAttributes:LT});return new Ji({find:t.find,handler:n=>{let o=t.handler(n);return o!==null&&n.state.tr.steps.length&&n.state.tr.setMeta("preventAutolink",!0),o}})}function G8(e){let t=Gt({find:n=>{var o,r;let i=[];for(let a of n.matchAll(V8))RT(n,a,e.isAllowedHref)&&i.push(PT(a));let s=((o=(r=e.findPlainUrls)===null||r===void 0?void 0:r.call(e,n))!==null&&o!==void 0?o:[]).filter(a=>!i.some(l=>K8(l,a)));return[...i,...s]},type:e.type,getAttributes:LT});return new cy({find:t.find,handler:n=>{var o;let r=t.handler(n);return r!==null&&n.state.tr.steps.length&&(!((o=n.match.data)===null||o===void 0)&&o.markdown)&&n.state.tr.setMeta("preventAutolink",!0),r}})}function Q8(e){return new de({key:new ke("handlePasteLink"),props:{handlePaste:(t,n,o)=>{let{shouldAutoLink:r}=e,{state:i}=t,{selection:s}=i,{empty:a}=s;if(a)return!1;let l="";o.content.forEach(c=>{l+=c.textContent});let u=zy(l,{defaultProtocol:e.defaultProtocol}).find(c=>c.isLink&&c.value===l);return!l||!u||r!==void 0&&!r(u.value)?!1:e.editor.commands.setMark(e.type,{href:u.href})}}})}function ar(e,t){let n=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return t&&t.forEach(o=>{let r=typeof o=="string"?o:o.scheme;r&&n.push(r)}),!e||e.replace(j8,"").match(new RegExp(`^(?:(?:${n.map(o=>o.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")).join("|")}):|[^a-z]|[a-z0-9+.\\-]+(?:[^a-z+.\\-:]|$))`,"i"))}var FT=at.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(e=>{if(typeof e=="string"){Ny(e);return}Ny(e.scheme,e.optionalSlashes)})},onDestroy(){zT()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,enableClickSelection:!1,linkOnPaste:!0,markdownLinks:!1,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(e,t)=>!!ar(e,t.protocols),validate:e=>!!e,shouldAutoLink:e=>{let t=/^[a-z][a-z0-9+.-]*:\/\//i.test(e),n=/^[a-z][a-z0-9+.-]*:/i.test(e);if(t||n&&!e.includes("@"))return!0;let o=(e.includes("@")?e.split("@").pop():e).split(/[/?#:]/)[0];return!(/^\d{1,3}(\.\d{1,3}){3}$/.test(o)||!/\./.test(o))}}},addAttributes(){var e,t,n;return{href:{default:null,parseHTML(o){return o.getAttribute("href")}},target:{default:(e=this.options.HTMLAttributes.target)!==null&&e!==void 0?e:null},rel:{default:(t=this.options.HTMLAttributes.rel)!==null&&t!==void 0?t:null},class:{default:(n=this.options.HTMLAttributes.class)!==null&&n!==void 0?n:null},title:{default:null}}},parseHTML(){return[{tag:"a[href]",getAttrs:e=>{let t=e.getAttribute("href");return!t||!this.options.isAllowedUri(t,{defaultValidate:n=>!!ar(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:e}){return this.options.isAllowedUri(e.href,{defaultValidate:t=>!!ar(t,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",fe(this.options.HTMLAttributes,e),0]:["a",fe(this.options.HTMLAttributes,{...e,href:""}),0]},markdownTokenName:"link",parseMarkdown:(e,t)=>t.applyMark("link",t.parseInline(e.tokens||[]),{href:e.href,title:e.title||null}),renderMarkdown:(e,t)=>{var n,o,r,i;let s=(n=(o=e.attrs)===null||o===void 0?void 0:o.href)!==null&&n!==void 0?n:"",a=(r=(i=e.attrs)===null||i===void 0?void 0:i.title)!==null&&r!==void 0?r:"",l=t.renderChildren(e);return a?`[${l}](${s} "${a}")`:`[${l}](${s})`},addCommands(){return{setLink:e=>({chain:t})=>{let{href:n}=e;return this.options.isAllowedUri(n,{defaultValidate:o=>!!ar(o,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?t().setMark(this.name,e).setMeta("preventAutolink",!0).run():!1},toggleLink:e=>({chain:t})=>{let{href:n}=e||{};return n&&!this.options.isAllowedUri(n,{defaultValidate:o=>!!ar(o,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:t().toggleMark(this.name,e,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()},unsetLink:()=>({chain:e})=>e().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addInputRules(){return this.options.markdownLinks?[J8({type:this.type,isAllowedHref:e=>this.options.isAllowedUri(e,{defaultValidate:t=>!!ar(t,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})})]:[]},addPasteRules(){let e=t=>{let n=[];if(t){let{protocols:o,defaultProtocol:r}=this.options;zy(t,{defaultProtocol:r}).filter(i=>i.isLink&&this.options.isAllowedUri(i.value,{defaultValidate:s=>!!ar(s,o),protocols:o,defaultProtocol:r})).forEach(i=>{this.options.shouldAutoLink(i.value)&&n.push({text:i.value,data:{href:i.href},index:i.start})})}return n};return this.options.markdownLinks?[G8({type:this.type,isAllowedHref:t=>this.options.isAllowedUri(t,{defaultValidate:n=>!!ar(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol}),findPlainUrls:e})]:[Gt({find:e,type:this.type,getAttributes:t=>{var n;return{href:(n=t.data)===null||n===void 0?void 0:n.href}}})]},addProseMirrorPlugins(){let e=[],{protocols:t,defaultProtocol:n}=this.options;return this.options.autolink&&e.push(H8({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:o=>this.options.isAllowedUri(o,{defaultValidate:r=>!!ar(r,t),protocols:t,defaultProtocol:n}),shouldAutoLink:this.options.shouldAutoLink})),e.push(q8({type:this.type,editor:this.editor,openOnClick:this.options.openOnClick==="whenNotEditable"?!0:this.options.openOnClick,enableClickSelection:this.options.enableClickSelection})),this.options.linkOnPaste&&e.push(Q8({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type,shouldAutoLink:this.options.shouldAutoLink})),e}});var X8="listItem",jT="textStyle",BT=/^\s*([-+*])\s$/,Oy=ce.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:e}){return["ul",fe(this.options.HTMLAttributes,e),0]},markdownTokenName:"list",parseMarkdown:(e,t)=>e.type!=="list"||e.ordered?[]:{type:"bulletList",content:e.items?t.parseChildren(e.items):[]},renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`
`):"",markdownOptions:{indentsContent:!0},addCommands(){return{toggleBulletList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(X8,this.editor.getAttributes(jT)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let e=Ir({find:BT,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(e=Ir({find:BT,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(jT),editor:this.editor})),[e]}}),Y8=(e,t,n)=>{let{selection:o}=e;if(!o.empty)return null;let{$from:r}=o;if(!r.parent.isTextblock||r.parentOffset!==r.parent.content.size)return null;let i=-1;for(let h=r.depth;h>0;h-=1)if(r.node(h).type.name===t){i=h;break}if(i<0)return null;let s=r.node(i),a=r.index(i);if(a+1>=s.childCount)return null;let l=s.child(a+1);if(!n.includes(l.type.name))return null;let u=e.schema.nodes[t],c=!1;if(l.forEach(h=>{h.type===u&&h.childCount>1&&(c=!0)}),!c)return null;let d=e.doc.resolve(r.after()).nodeAfter;if(!d||!n.includes(d.type.name))return null;let f=[];return d.forEach(h=>{f.push(h)}),f.length===0?null:{listItemDepth:i,nestedList:d,nestedListPos:r.after(),insertPos:r.after(i),items:f}},e5=(e,t,n,o)=>{let r=Y8(e,n,o);if(!r)return!1;let{selection:i}=e,{nestedList:s,nestedListPos:a,insertPos:l,items:u}=r,c=e.tr;c.delete(a,a+s.nodeSize);let d=c.mapping.map(l);return c.insert(d,M.from(u)),c.setSelection(i.map(c.doc,c.mapping)),t&&t(c),!0},t5=(e,t,n)=>e5(e.state,e.view.dispatch,t,n),GT=(e,t)=>Me.create({name:`${e}BranchingDeleteKeymap`,priority:101,addKeyboardShortcuts(){let n=()=>t5(this.editor,e,t);return{Delete:n,"Mod-Delete":n}}}),QT=[[1e3,"m"],[900,"cm"],[500,"d"],[400,"cd"],[100,"c"],[90,"xc"],[50,"l"],[40,"xl"],[10,"x"],[9,"ix"],[5,"v"],[4,"iv"],[1,"i"]],ff="abcdefghijklmnopqrstuvwxyz",XT=String.raw`\d+|[ivxlcdmIVXLCDM]+|${"[a-zA-Z]{1,2}"}`;function mf(e){let t=e,n="";for(let[o,r]of QT)for(;t>=o;)n+=r,t-=o;return n}function Ry(e){return mf(e).toUpperCase()}function YT(e){let t=e.toLowerCase(),n=0,o=0;for(;n<t.length;){let r=!1;for(let[i,s]of QT)if(t.startsWith(s,n)){o+=i,n+=s.length,r=!0;break}if(!r)return 0}return o}function n5(e){if(!/^[ivxlcdmIVXLCDM]+$/.test(e))return!1;let t=YT(e);return t<=0?!1:(e===e.toLowerCase()?mf(t):Ry(t))===e}function r5(e){let t=e.toLowerCase();if(t.length===1)return t.charCodeAt(0)-97+1;if(t.length===2){let n=t.charCodeAt(0)-97,o=t.charCodeAt(1)-97;return(n+1)*26+o+1}return 0}function pf(e){if(e<=26)return ff[e-1];let t=Math.floor((e-1)/26)-1,n=(e-1)%26;return t<0?ff[n]:ff[t]+ff[n]}function gf(e){if(!(!e||/^\d+$/.test(e))){if(n5(e))return e===e.toLowerCase()?"i":"I";if(/^[a-z]{1,2}$/.test(e))return"a";if(/^[A-Z]{1,2}$/.test(e))return"A"}}function Py(e){if(/^\d+$/.test(e))return parseInt(e,10);let t=gf(e);if(t==="i"||t==="I")return YT(e);if(t==="a"||t==="A"){let o=r5(e);return o>0?o:1}let n=parseInt(e,10);return Number.isNaN(n)?1:n}function o5(e,t){if(e==="numeric")return String(t);switch(e){case"a":return pf(t);case"A":return pf(t).toUpperCase();case"i":return mf(t);case"I":return Ry(t);default:return String(t)}}function i5(e){var t;if(e.length===0)return!1;let n=(t=gf(e[0]))!==null&&t!==void 0?t:"numeric",o=Py(e[0]);if(o<1)return!1;for(let r=0;r<e.length;r++){let i=o5(n,o+r);if(e[r]!==i)return!1}return!0}function s5(e){return{type:gf(e),start:Py(e)}}function a5(e){let{type:t,start:n}=s5(e),o={};return t&&(o.type=t),n!==1&&(o.start=n),o}function l5(e,t,n=". "){let o=t+1;if(!e||e==="1")return`${o}${n}`;switch(e){case"a":return`${pf(o)}${n}`;case"A":return`${pf(o).toUpperCase()}${n}`;case"i":return`${mf(o)}${n}`;case"I":return`${Ry(o)}${n}`;default:return`${o}${n}`}}function u5(e){return!e[0]||e[0].type==="paragraph"?e:[{type:"paragraph",content:[]},...e]}function c5(e){var t,n;let o=(t=e.content)===null||t===void 0?void 0:t[0];return o?.type==="paragraph"&&!(!((n=o.content)===null||n===void 0)&&n.length)}var d5=" ",UT=1,f5=e=>{var t;return((t=e?.level)!==null&&t!==void 0?t:UT)>UT};function p5(e){var t,n;let o=(t=e.tokens)===null||t===void 0?void 0:t[0];return!!(e.text&&((n=e.tokens)===null||n===void 0?void 0:n.length)===1&&o?.type==="list"&&o.ordered&&o.raw===e.text)}function h5(e,t){return t.tokenizeInline?t.parseInline(t.tokenizeInline(e)):t.parseInline([{type:"text",raw:e,text:e}])}var Ly=ce.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:e}){return["li",fe(this.options.HTMLAttributes,e),0]},markdownTokenName:"list_item",parseMarkdown:(e,t)=>{var n;if(e.type!=="list_item")return[];let o=(n=t.parseBlockChildren)!==null&&n!==void 0?n:t.parseChildren,r=[];if(e.tokens&&e.tokens.length>0){if(p5(e))return{type:"listItem",content:[{type:"paragraph",content:h5(e.text||"",t)}]};let[s,...a]=e.tokens;if(s.type==="heading"){var i;return{type:"listItem",content:[{type:"paragraph",content:t.parseInline((i=s.tokens)!==null&&i!==void 0?i:[])},...a.length>0?o(a):[]]}}if(e.tokens.some(l=>l.type==="paragraph"))r=o(e.tokens);else if(s.type==="text"&&s.tokens&&s.tokens.length>0){if(r=[{type:"paragraph",content:t.parseInline(s.tokens)}],e.tokens.length>1){let l=o(e.tokens.slice(1));r.push(...l)}}else r=o(e.tokens)}return r.length===0&&(r=[{type:"paragraph",content:[]}]),{type:"listItem",content:u5(r)}},renderMarkdown:(e,t,n)=>{let o=s=>{if(s.parentType==="bulletList")return"- ";if(s.parentType==="orderedList"){var a,l;let u=((a=s.meta)===null||a===void 0||(a=a.parentAttrs)===null||a===void 0?void 0:a.start)||1;return l5((l=s.meta)===null||l===void 0||(l=l.parentAttrs)===null||l===void 0?void 0:l.type,u-1+(s.index||0),". ")}return"- "},r=ly(e,t,o,n,{alignNestedToPrefix:n?.parentType==="orderedList"});if(!c5(e)||!f5(n))return r;let i=o(n);return`${i}${d5}${r.slice(i.length)}`},addExtensions(){return[GT(this.name,[this.options.bulletListTypeName,this.options.orderedListTypeName])]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),Fy=(e,t)=>{let{$from:n}=t.selection,o=st(e,t.schema),r=null,i=n.depth,s=n.pos,a=null;for(;i>0&&a===null;)r=n.node(i),r.type===o?a=i:(i-=1,s-=1);return a===null?null:{$pos:t.doc.resolve(s),depth:a}},eA=(e,t)=>{let n=Fy(e,t);if(!n)return!1;let[,o]=AC(t,e,n.$pos.pos+4);return o},m5=(e,t,n)=>{let{$anchor:o}=e.selection,r=Math.max(0,o.pos-2),i=e.doc.resolve(r).node();return!(!i||!n.includes(i.type.name))},HT=(e,t,n)=>{if(e.commands.undoInputRule())return!0;if(e.state.selection.from!==e.state.selection.to)return!1;if(!On(e.state,t)&&m5(e.state,t,n)){let{$anchor:i}=e.state.selection,s=e.state.doc.resolve(i.before()-1),a=[];s.node().descendants((c,d)=>{c.type.name===t&&a.push({node:c,pos:d})});let l=a.at(-1);if(!l)return!1;let u=e.state.doc.resolve(s.start()+l.pos+1);return e.chain().command(({tr:c})=>{let d=u.end();return c.delete(i.before(),i.after()).insert(d,i.parent),c.setSelection(Z.create(c.doc,d+1)),!0}).command(({state:c,dispatch:d})=>(Xc(c,d),!0)).run()}if(!On(e.state,t)||!IC(e.state))return!1;let{$from:o}=e.state.selection,r=o.depth-1;return o.node(r).type!==e.schema.nodes[t]||o.index(r)!==0?!1:e.chain().liftListItem(t).run()},g5=(e,t)=>{let n=eA(e,t),o=Fy(e,t);return!o||!n?!1:n>o.depth},b5=(e,t)=>{let n=eA(e,t),o=Fy(e,t);return!o||!n?!1:n<o.depth},qT=(e,t)=>!On(e.state,t)||!$C(e.state,t)||!e.state.selection.empty?!1:g5(t,e.state)?e.chain().focus(e.state.selection.from+4).lift(t).joinBackward().run():b5(t,e.state)?e.commands.command(({state:n,dispatch:o})=>Yc(n,o)):e.commands.joinItemForward(),y5=(e,t,n)=>{let{state:o}=e,{selection:r}=o;if(!r.empty)return!1;let{$from:i}=r;if(i.parentOffset!==0||!i.parent.isTextblock||On(o,t))return!1;let s=MC(i);if(!s||!n.includes(s.type.name))return!1;let a=s.lastChild;if(!a||a.type.name!==t)return!1;let l=i.parent;if(!a.canReplace(a.childCount,a.childCount,M.from(l)))return!1;let u=i.before(),c=i.after(),d=u-2;return e.commands.command(({tr:f,dispatch:h})=>(h&&(f.delete(u,c).insert(d,M.from(l)),f.setSelection(Z.create(f.doc,d+1)),f.scrollIntoView()),!0))};var jy=Me.create({name:"listKeymap",addOptions(){return{listTypes:[{itemName:"listItem",wrapperNames:["bulletList","orderedList"]},{itemName:"taskItem",wrapperNames:["taskList"]}]}},addKeyboardShortcuts(){return{Delete:({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n})=>{e.state.schema.nodes[n]!==void 0&&qT(e,n)&&(t=!0)}),t},"Mod-Delete":({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n})=>{e.state.schema.nodes[n]!==void 0&&qT(e,n)&&(t=!0)}),t},Backspace:({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:o})=>{e.state.schema.nodes[n]!==void 0&&HT(e,n,o)&&(t=!0)}),t},"Mod-Backspace":({editor:e})=>{let t=!1;return this.options.listTypes.forEach(({itemName:n,wrapperNames:o})=>{e.state.schema.nodes[n]!==void 0&&HT(e,n,o)&&(t=!0)}),t},Tab:({editor:e})=>{for(let{itemName:t,wrapperNames:n}of this.options.listTypes)if(e.state.schema.nodes[t]!==void 0&&y5(e,t,n))return!0;return!1}}}}),hf=new RegExp(`^(\\s*)(${XT})([.)])\\s+(.*)$`),v5=/^\s/,es={heading:/^#{1,6}(?:\s|$)/,bulletItem:/^[-+*]\s+/,codeFence:/^(?:```|~~~)/,blockMath:/^\$\$/,thematicBreak:/^(?:(?:-[ \t]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})$/};function x5(e){return hf.test(e.trimStart())}function k5(e){let t=e.trimStart();return es.bulletItem.test(t)||x5(t)||es.heading.test(t)||es.thematicBreak.test(t)&&!t.startsWith("-")||/^>\s?/.test(t)||es.codeFence.test(t)||es.blockMath.test(t)}function w5(e){return Object.values(es).some(t=>t.test(e))}function S5(e){let t=[],n=[],o=!1;return e.forEach(r=>{if(o){n.push(r);return}if(r.trim()===""){o=!0,n.push(r);return}if(t.length>0&&k5(r)){o=!0,n.push(r);return}t.push(r)}),{paragraphLines:t,blockLines:n}}function ZT(e){let t=[],n=0,o=0;for(;n<e.length;){let r=e[n],i=r.match(hf);if(!i)break;let[,s,a,l,u]=i,c=s.length,d=parseInt(a,10),f=isNaN(d)?gf(a):void 0,h=isNaN(d)?Py(a):d,p=[u],m=n+1,g=[r],b=!1;for(;m<e.length;){let y=e[m];if(y.match(hf))break;if(y.trim()==="")g.push(y),p.push(""),b=!0,m+=1;else if(y.match(v5)){let k=y.length-y.trimStart().length,x=c+a.length+1;g.push(y),p.push(y.slice(Math.min(k,x))),m+=1}else{if(b||w5(y))break;g.push(y),p.push(y),m+=1}}t.push({indent:c,number:h,type:f,content:p.join(`
`).trim(),contentLines:p,raw:g.join(`
`)}),o=m,n=m}return[t,o]}var _5=new RegExp(`^(${XT})([.)])\\s+(.+)$`);function E5(e){let t=e.split(`
`).filter(o=>o.trim().length>0);if(t.length===0)return null;let n=[];for(let o of t){let r=o.trim().match(_5);if(!r)return null;n.push({marker:r[1],content:r[3]})}return i5(n.map(o=>o.marker))?{type:"orderedList",attrs:a5(n[0].marker),content:n.map(o=>({type:"listItem",content:[{type:"paragraph",content:[{type:"text",text:o.content}]}]}))}:null}function tA(e,t,n){let o=[],r=0;for(;r<e.length;){let i=e[r];if(i.indent===t){let{paragraphLines:s,blockLines:a}=S5(i.contentLines),l=s.join(`
`).trim(),u=[];l&&u.push({type:"paragraph",raw:l,tokens:n.inlineTokens(l)});let c=a.join(`
`).trim();if(c){let h=n.blockTokens(c);u.push(...h)}let d=r+1,f=[];for(;d<e.length&&e[d].indent>t;)f.push(e[d]),d+=1;if(f.length>0){let h=tA(f,Math.min(...f.map(p=>p.indent)),n);u.push({type:"list",ordered:!0,start:f[0].number,typeMarker:f[0].type,items:h,raw:f.map(p=>p.raw).join(`
`)})}o.push({type:"list_item",raw:i.raw,tokens:u}),r=d}else r+=1}return o}function C5(e,t){return e.map(n=>{if(n.type!=="list_item")return t.parseChildren([n])[0];let o=[];return n.tokens&&n.tokens.length>0&&n.tokens.forEach(r=>{if(r.type==="paragraph"||r.type==="list"||r.type==="blockquote"||r.type==="code")o.push(...t.parseChildren([r]));else if(r.type==="text"&&r.tokens){let i=t.parseChildren([r]);o.push({type:"paragraph",content:i})}else{let i=t.parseChildren([r]);i.length>0&&o.push(...i)}}),{type:"listItem",content:o}})}var T5=64;function VT(e,t){let n=[],o=0;for(;n.length<t;){let r=e.indexOf(`
`,o);if(r===-1)return n.push(e.slice(o)),n;n.push(e.slice(o,r)),o=r+1}return n}function A5(e){let t=e.indexOf(`
`),n=t===-1?e:e.slice(0,t);if(!hf.test(n))return[[],0,[]];let o=T5,r=VT(e,o),i=ZT(r);for(;i[1]===r.length&&r.length===o;)o*=2,r=VT(e,o),i=ZT(r);return[i[0],i[1],r]}var M5="listItem",WT="textStyle",KT=/^(\d+)\.\s$/;function JT(e){let t=e.match(/list-style-type\s*:\s*([^;]+)/i);if(!t)return null;switch(t[1].trim().toLowerCase()){case"upper-roman":return"I";case"lower-roman":return"i";case"upper-alpha":case"upper-latin":return"A";case"lower-alpha":case"lower-latin":return"a";default:return null}}var By=ce.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:e=>e.hasAttribute("start")?parseInt(e.getAttribute("start")||"",10):1},type:{default:null,parseHTML:e=>{let t=e.getAttribute("type");if(t)return t;let n=e.getAttribute("style");if(n){let r=JT(n);if(r)return r}let o=e.querySelector("li");if(o){let r=o.getAttribute("style");if(r){let i=JT(r);if(i)return i}}return null}}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:e}){let{start:t,type:n,...o}=e,r=fe(this.options.HTMLAttributes,o);return t!==1&&(r.start=t),n&&n!=="1"&&(r.type=n),["ol",r,0]},markdownTokenName:"list",parseMarkdown:(e,t)=>{if(e.type!=="list"||!e.ordered)return[];let n=e.start||1,o=e.typeMarker,r=e.items?C5(e.items,t):[],i={};return n!==1&&(i.start=n),o&&(i.type=o),Object.keys(i).length>0?{type:"orderedList",attrs:i,content:r}:{type:"orderedList",content:r}},renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`
`):"",markdownTokenizer:{name:"orderedList",level:"block",start:()=>-1,tokenize:(e,t,n)=>{var o,r;let[i,s,a]=A5(e);if(i.length===0)return;let l=tA(i,i[0].indent,n);if(l.length!==0)return{type:"list",ordered:!0,start:((o=i[0])===null||o===void 0?void 0:o.number)||1,typeMarker:(r=i[0])===null||r===void 0?void 0:r.type,items:l,raw:a.slice(0,s).join(`
`)}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleOrderedList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(M5,this.editor.getAttributes(WT)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addProseMirrorPlugins(){return[new de({props:{handlePaste:(e,t)=>{var n,o;let r=(n=t.clipboardData)===null||n===void 0?void 0:n.getData("text/html");if(r?.trim())return!1;let i=(o=t.clipboardData)===null||o===void 0?void 0:o.getData("text/plain");if(!i)return!1;let s=E5(i);if(!s)return!1;try{let a=e.state.schema.nodeFromJSON(s),l=e.state.tr.replaceSelectionWith(a);return e.dispatch(l),!0}catch{return!1}}}})]},addInputRules(){let e=(n,o)=>(!o.attrs.type||o.attrs.type==="1")&&o.childCount+o.attrs.start===+n[1],t=Ir({find:KT,type:this.type,getAttributes:n=>({start:+n[1]}),joinPredicate:e});return(this.options.keepMarks||this.options.keepAttributes)&&(t=Ir({find:KT,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:n=>({start:+n[1],...this.editor.getAttributes(WT)}),joinPredicate:e,editor:this.editor})),[t]}}),$5=/^\s*(\[([( |x])?\])\s$/,I5="position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0",D5=(e,t,n)=>{var o;return(n==null||(o=n.checkboxLabel)===null||o===void 0?void 0:o.call(n,e,t))||`Task item checkbox for ${e.textContent||"empty task item"}`},N5=ce.create({name:"taskItem",addOptions(){return{nested:!1,HTMLAttributes:{},taskListTypeName:"taskList",a11y:void 0}},content(){return this.options.nested?"paragraph block*":"paragraph+"},defining:!0,addAttributes(){return{checked:{default:!1,keepOnSplit:!1,parseHTML:e=>{let t=e.getAttribute("data-checked");return t===""||t==="true"},renderHTML:e=>({"data-checked":e.checked})}}},parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51,contentElement:e=>{var t;return(t=e.querySelector("div"))!==null&&t!==void 0?t:e}}]},renderHTML({node:e,HTMLAttributes:t}){return["li",fe(this.options.HTMLAttributes,t,{"data-type":this.name}),["label",["input",{type:"checkbox",checked:e.attrs.checked?"checked":null}],["span"]],["div",0]]},parseMarkdown:(e,t)=>{let n=[];if(e.tokens&&e.tokens.length>0?n.push(t.createNode("paragraph",{},t.parseInline(e.tokens))):e.text?n.push(t.createNode("paragraph",{},[t.createNode("text",{text:e.text})])):n.push(t.createNode("paragraph",{},[])),e.nestedTokens&&e.nestedTokens.length>0){let o=t.parseChildren(e.nestedTokens);n.push(...o)}return t.createNode("taskItem",{checked:e.checked||!1},n)},renderMarkdown:(e,t)=>{var n;let o=`- [${!((n=e.attrs)===null||n===void 0)&&n.checked?"x":" "}] `;return ly(e,t,o,void 0,{indentMainContent:!0})},addExtensions(){return this.options.nested?[GT(this.name,[this.options.taskListTypeName])]:[]},addKeyboardShortcuts(){let e={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...e,Tab:()=>this.editor.commands.sinkListItem(this.name)}:e},addNodeView(){return({node:e,HTMLAttributes:t,getPos:n,editor:o})=>{let r=document.createElement("li"),i=document.createElement("label"),s=document.createElement("span"),a=document.createElement("input"),l=document.createElement("div");s.style.cssText=I5;let u=d=>{let f=D5(d,d.attrs.checked,this.options.a11y);a.setAttribute("aria-label",f),s.textContent=f};u(e),i.contentEditable="false",a.type="checkbox",a.addEventListener("mousedown",d=>d.preventDefault()),a.addEventListener("change",d=>{if(!o.isEditable&&!this.options.onReadOnlyChecked){a.checked=!a.checked;return}let{checked:f}=d.target;o.isEditable&&typeof n=="function"&&o.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:h})=>{let p=n();if(typeof p!="number")return!1;let m=h.doc.nodeAt(p);return h.setNodeMarkup(p,void 0,{...m?.attrs,checked:f}),!0}).run(),!o.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(e,f)||(a.checked=!a.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([d,f])=>{r.setAttribute(d,f)}),r.dataset.checked=e.attrs.checked,a.checked=e.attrs.checked,i.append(a,s),r.append(i,l),Object.entries(t).forEach(([d,f])=>{r.setAttribute(d,f)});let c=new Set(Object.keys(t));return{dom:r,contentDOM:l,update:d=>{if(d.type!==this.type)return!1;r.dataset.checked=d.attrs.checked,a.checked=d.attrs.checked,u(d);let f=o.extensionManager.attributes,h=$r(d,f),p=new Set(Object.keys(h)),m=this.options.HTMLAttributes;return c.forEach(g=>{p.has(g)||(g in m?r.setAttribute(g,m[g]):r.removeAttribute(g))}),Object.entries(h).forEach(([g,b])=>{b==null?g in m?r.setAttribute(g,m[g]):r.removeAttribute(g):r.setAttribute(g,b)}),c=p,!0}}}},addInputRules(){return[Ir({find:$5,type:this.type,getAttributes:e=>({checked:e[e.length-1]==="x"})})]}}),z5=ce.create({name:"taskList",addOptions(){return{itemTypeName:"taskItem",HTMLAttributes:{}}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul[data-type="${this.name}"]`,priority:51}]},renderHTML({HTMLAttributes:e}){return["ul",fe(this.options.HTMLAttributes,e,{"data-type":this.name}),0]},parseMarkdown:(e,t)=>t.createNode("taskList",{},t.parseChildren(e.items||[])),renderMarkdown:(e,t)=>e.content?t.renderChildren(e.content,`
`):"",markdownTokenizer:{name:"taskList",level:"block",start(e){var t;let n=(t=e.match(/^\s*[-+*]\s+\[([ xX])\]\s+/))===null||t===void 0?void 0:t.index;return n!==void 0?n:-1},tokenize(e,t,n){let o=i=>{let s=ay(i,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:a=>({indentLevel:a[1].length,mainContent:a[4],checked:a[3].toLowerCase()==="x"}),createToken:(a,l)=>({type:"taskItem",raw:"",mainContent:a.mainContent,indentLevel:a.indentLevel,checked:a.checked,text:a.mainContent,tokens:n.inlineTokens(a.mainContent),nestedTokens:l}),customNestedParser:o},n);if(s){let a={type:"taskList",raw:s.raw,items:s.items},l=i.slice(s.raw.length);return l.trim()?[a,...n.blockTokens(l)]:[a]}return n.blockTokens(i)},r=ay(e,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:i=>({indentLevel:i[1].length,mainContent:i[4],checked:i[3].toLowerCase()==="x"}),createToken:(i,s)=>({type:"taskItem",raw:"",mainContent:i.mainContent,indentLevel:i.indentLevel,checked:i.checked,text:i.mainContent,tokens:n.inlineTokens(i.mainContent),nestedTokens:s}),customNestedParser:o},n);if(r)return{type:"taskList",raw:r.raw,items:r.items}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleTaskList:()=>({commands:e})=>e.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}}),JQ=Me.create({name:"listKit",addExtensions(){let e=[];return this.options.bulletList!==!1&&e.push(Oy.configure(this.options.bulletList)),this.options.listItem!==!1&&e.push(Ly.configure(this.options.listItem)),this.options.listKeymap!==!1&&e.push(jy.configure(this.options.listKeymap)),this.options.orderedList!==!1&&e.push(By.configure(this.options.orderedList)),this.options.taskItem!==!1&&e.push(N5.configure(this.options.taskItem)),this.options.taskList!==!1&&e.push(z5.configure(this.options.taskList)),e}});var bf=" ",Uy="\xA0",nA=ce.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:e}){return["p",fe(this.options.HTMLAttributes,e),0]},parseMarkdown:(e,t)=>{let n=e.tokens||[];if(n.length===1&&n[0].type==="image")return t.parseChildren([n[0]]);let o=t.parseInline(n);return n.length===1&&n[0].type==="text"&&(n[0].raw===bf||n[0].text===bf||n[0].raw===Uy||n[0].text===Uy)&&o.length===1&&o[0].type==="text"&&(o[0].text===bf||o[0].text===Uy)?t.createNode("paragraph",void 0,[]):t.createNode("paragraph",void 0,o)},renderMarkdown:(e,t,n)=>{if(!e)return"";let o=Array.isArray(e.content)?e.content:[];if(o.length===0){var r,i;let s=Array.isArray(n==null||(r=n.previousNode)===null||r===void 0?void 0:r.content)?n.previousNode.content:[];return(n==null||(i=n.previousNode)===null||i===void 0?void 0:i.type)==="paragraph"&&s.length===0?bf:""}return t.renderChildren(o)},addCommands(){return{setParagraph:()=>({commands:e})=>e.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}});var O5=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,R5=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,rA=at.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:e=>e.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:e}){return["s",fe(this.options.HTMLAttributes,e),0]},markdownTokenName:"del",parseMarkdown:(e,t)=>t.applyMark("strike",t.parseInline(e.tokens||[])),renderMarkdown:(e,t)=>`~~${t.renderChildren(e)}~~`,addCommands(){return{setStrike:()=>({commands:e})=>e.setMark(this.name),toggleStrike:()=>({commands:e})=>e.toggleMark(this.name),unsetStrike:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[ln({find:O5,type:this.type})]},addPasteRules(){return[Gt({find:R5,type:this.type})]}});var oA=ce.create({name:"text",group:"inline",parseMarkdown:e=>({type:"text",text:e.text||""}),renderMarkdown:e=>e.text||""});var iA=at.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:e=>e.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:e}){return["u",fe(this.options.HTMLAttributes,e),0]},parseMarkdown(e,t){return t.applyMark(this.name||"underline",t.parseInline(e.tokens||[]))},renderMarkdown(e,t){return`<u>${t.renderChildren(e)}</u>`},markdownTokenizer:{name:"underline",level:"inline",start(e){return e.toLowerCase().indexOf("<u>")},tokenize(e,t,n){if(!/^<u>/i.test(e))return;let o=/\\[\s\S]|`+|<\/u>/gi;o.lastIndex=3;let r=o.exec(e);for(;r;){if(r[0].startsWith("`")){let i=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/.exec(e.slice(r.index));i&&(o.lastIndex=r.index+i[0].length)}else if(!r[0].startsWith("\\")){let i=e.slice(3,r.index);return i?{type:"underline",raw:e.slice(0,o.lastIndex),text:i,tokens:n.inlineTokens(i)}:void 0}r=o.exec(e)}}},addCommands(){return{setUnderline:()=>({commands:e})=>e.setMark(this.name),toggleUnderline:()=>({commands:e})=>e.toggleMark(this.name),unsetUnderline:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}});function sA(e={}){return new de({view(t){return new Hy(t,e)}})}var Hy=class{constructor(t,n){var o;this.editorView=t,this.cursorPos=null,this.element=null,this.timeout=-1,this.lastDragEvent=null,this.width=(o=n.width)!==null&&o!==void 0?o:1,this.color=n.color===!1?void 0:n.color||"black",this.class=n.class,this.handlers=["dragover","dragend","drop","dragleave"].map(r=>{let i=s=>{this[r](s)};return t.dom.addEventListener(r,i),{name:r,handler:i}})}destroy(){this.setCursor(null),this.handlers.forEach(({name:t,handler:n})=>this.editorView.dom.removeEventListener(t,n))}update(t,n){if(this.cursorPos!=null&&n.doc!=t.state.doc)if(this.lastDragEvent){let o=this.computeTarget(this.lastDragEvent);o==this.cursorPos?this.updateOverlay():this.setCursor(o)}else this.updateOverlay()}setCursor(t){t!=this.cursorPos&&(this.cursorPos=t,t==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let t=this.editorView.state.doc.resolve(this.cursorPos),n=!t.parent.inlineContent,o,r=this.editorView.dom,i=r.getBoundingClientRect(),s=i.width/r.offsetWidth,a=i.height/r.offsetHeight;if(n){let d=t.nodeBefore,f=t.nodeAfter;if(d||f){let h=this.editorView.nodeDOM(this.cursorPos-(d?d.nodeSize:0));if(h){let p=h.getBoundingClientRect(),m=d?p.bottom:p.top;d&&f&&(m=(m+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let g=this.width/2*a;o={left:p.left,right:p.right,top:m-g,bottom:m+g}}}}if(!o){let d=this.editorView.coordsAtPos(this.cursorPos),f=this.width/2*s;o={left:d.left-f,right:d.left+f,top:d.top,bottom:d.bottom}}let l=this.editorView.dom.offsetParent;this.element||(this.element=l.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",n),this.element.classList.toggle("prosemirror-dropcursor-inline",!n);let u,c;if(!l||l==document.body&&getComputedStyle(l).position=="static")u=-pageXOffset,c=-pageYOffset;else{let d=l.getBoundingClientRect(),f=d.width/l.offsetWidth,h=d.height/l.offsetHeight;u=d.left-l.scrollLeft*f,c=d.top-l.scrollTop*h}this.element.style.left=(o.left-u)/s+"px",this.element.style.top=(o.top-c)/a+"px",this.element.style.width=(o.right-o.left)/s+"px",this.element.style.height=(o.bottom-o.top)/a+"px"}scheduleRemoval(t){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),t)}computeTarget(t){let n=this.editorView.posAtCoords({left:t.clientX,top:t.clientY}),o=n&&n.inside>=0&&this.editorView.state.doc.nodeAt(n.inside),r=o&&o.type.spec.disableDropCursor,i=typeof r=="function"?r(this.editorView,n,t):r;if(!n||i)return null;let s=n.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let a=Jc(this.editorView.state.doc,s,this.editorView.dragging.slice);a!=null&&(s=a)}return s}dragover(t){if(!this.editorView.editable)return;this.lastDragEvent=t;let n=this.computeTarget(t);n!=null&&(this.setCursor(n),this.scheduleRemoval(5e3))}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(t){this.editorView.dom.contains(t.relatedTarget)||this.setCursor(null)}};var Dt=class e extends Q{constructor(t){super(t,t)}map(t,n){let o=t.resolve(n.map(this.head));return e.valid(o)?new e(o):Q.near(o)}content(){return F.empty}eq(t){return t instanceof e&&t.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(t,n){if(typeof n.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new e(t.resolve(n.pos))}getBookmark(){return new qy(this.anchor)}static valid(t){let n=t.parent;if(n.inlineContent||!P5(t)||!L5(t))return!1;let o=n.type.spec.allowGapCursor;if(o!=null)return o;let r=n.contentMatchAt(t.index()).defaultType;return r&&r.isTextblock}static findGapCursorFrom(t,n,o=!1){e:for(;;){if(!o&&e.valid(t))return t;let r=t.pos,i=null;for(let s=t.depth;;s--){let a=t.node(s);if(n>0?t.indexAfter(s)<a.childCount:t.index(s)>0){i=a.child(n>0?t.indexAfter(s):t.index(s)-1);break}else if(s==0)return null;r+=n;let l=t.doc.resolve(r);if(e.valid(l))return l}for(;;){let s=n>0?i.firstChild:i.lastChild;if(!s){if(i.isAtom&&!i.isText&&!X.isSelectable(i)){t=t.doc.resolve(r+i.nodeSize*n),o=!1;continue e}break}i=s,r+=n;let a=t.doc.resolve(r);if(e.valid(a))return a}return null}}};Dt.prototype.visible=!1;Dt.findFrom=Dt.findGapCursorFrom;Q.jsonID("gapcursor",Dt);var qy=class e{constructor(t){this.pos=t}map(t){return new e(t.map(this.pos))}resolve(t){let n=t.resolve(this.pos);return Dt.valid(n)?new Dt(n):Q.near(n)}};function aA(e){return e.isAtom||e.spec.isolating||e.spec.createGapCursor}function P5(e){for(let t=e.depth;t>=0;t--){let n=e.index(t),o=e.node(t);if(n==0){if(o.type.spec.isolating)return!0;continue}for(let r=o.child(n-1);;r=r.lastChild){if(r.childCount==0&&!r.inlineContent||aA(r.type))return!0;if(r.inlineContent)return!1}}return!0}function L5(e){for(let t=e.depth;t>=0;t--){let n=e.indexAfter(t),o=e.node(t);if(n==o.childCount){if(o.type.spec.isolating)return!0;continue}for(let r=o.child(n);;r=r.firstChild){if(r.childCount==0&&!r.inlineContent||aA(r.type))return!0;if(r.inlineContent)return!1}}return!0}function lA(){return new de({props:{decorations:U5,createSelectionBetween(e,t,n){return t.pos==n.pos&&Dt.valid(n)?new Dt(n):null},handleClick:j5,handleKeyDown:F5,handleDOMEvents:{beforeinput:B5}}})}var F5=Fa({ArrowLeft:yf("horiz",-1),ArrowRight:yf("horiz",1),ArrowUp:yf("vert",-1),ArrowDown:yf("vert",1)});function yf(e,t){let n=e=="vert"?t>0?"down":"up":t>0?"right":"left";return function(o,r,i){let s=o.selection,a=t>0?s.$to:s.$from,l=s.empty;if(s instanceof Z){if(!i.endOfTextblock(n)||a.depth==0)return!1;l=!1,a=o.doc.resolve(t>0?a.after():a.before())}let u=Dt.findGapCursorFrom(a,t,l);return u?(r&&r(o.tr.setSelection(new Dt(u))),!0):!1}}function j5(e,t,n){if(!e||!e.editable)return!1;let o=e.state.doc.resolve(t);if(!Dt.valid(o))return!1;let r=e.posAtCoords({left:n.clientX,top:n.clientY});return r&&r.inside>-1&&X.isSelectable(e.state.doc.nodeAt(r.inside))?!1:(e.dispatch(e.state.tr.setSelection(new Dt(o))),!0)}function B5(e,t){if(t.inputType!="insertCompositionText"||!(e.state.selection instanceof Dt))return!1;let{$from:n}=e.state.selection,o=n.parent.contentMatchAt(n.index()).findWrapping(e.state.schema.nodes.text);if(!o)return!1;let r=M.empty;for(let s=o.length-1;s>=0;s--)r=M.from(o[s].createAndFill(null,r));let i=e.state.tr.replace(n.pos,n.pos,new F(r,0,0));return i.setSelection(Z.near(i.doc.resolve(n.pos+1))),e.dispatch(i),!1}function U5(e){if(!(e.selection instanceof Dt))return null;let t=document.createElement("div");return t.className="ProseMirror-gapcursor",Te.create(e.doc,[ft.widget(e.selection.head,t,{key:"gapcursor"})])}var SX=Me.create({name:"characterCount",addOptions(){return{limit:null,autoTrim:!0,mode:"textSize",textCounter:e=>e.length,wordCounter:e=>e.split(" ").filter(t=>t!=="").length}},addStorage(){return{characters:()=>0,words:()=>0}},onBeforeCreate(){this.storage.characters=e=>{let t=e?.node||this.editor.state.doc;if((e?.mode||this.options.mode)==="textSize"){let n=t.textBetween(0,t.content.size,void 0," ");return this.options.textCounter(n)}return t.nodeSize},this.storage.words=e=>{let t=e?.node||this.editor.state.doc,n=t.textBetween(0,t.content.size," "," ");return this.options.wordCounter(n)}},addProseMirrorPlugins(){let e=!1;return[new de({key:new ke("characterCount"),appendTransaction:(t,n,o)=>{if(e)return;let r=this.options.limit,i=this.options.autoTrim;if(r==null||r===0||i===!1){e=!0;return}let s=this.storage.characters({node:o.doc});if(s>r){let a=s-r,l=0,u=a;console.warn(`[CharacterCount] Initial content exceeded limit of ${r} characters. Content was automatically trimmed.`);let c=o.tr.deleteRange(l,u);return e=!0,c}e=!0},filterTransaction:(t,n)=>{let o=this.options.limit;if(!t.docChanged||o===0||o===null||o===void 0)return!0;let r=this.storage.characters({node:n.doc}),i=this.storage.characters({node:t.doc});if(i<=o||r>o&&i>o&&i<=r)return!0;if(r>o&&i>o&&i>r||!t.getMeta("paste"))return!1;let s=t.selection.$head.pos,a=s-(i-o),l=s;return t.deleteRange(a,l),!(this.storage.characters({node:t.doc})>o)}})]}}),dA=Me.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[sA(this.options)]}}),_X=Me.create({name:"focus",addOptions(){return{className:"has-focus",mode:"all"}},addProseMirrorPlugins(){return[new de({key:new ke("focus"),props:{decorations:({doc:e,selection:t})=>{let{isEditable:n,isFocused:o}=this.editor,{anchor:r}=t,i=[];if(!n||!o)return Te.create(e,[]);let s=0;this.options.mode==="deepest"&&e.descendants((l,u)=>{if(!l.isText){if(!(r>=u&&r<=u+l.nodeSize-1))return!1;s+=1}});let a=0;return e.descendants((l,u)=>{if(l.isText||!(r>=u&&r<=u+l.nodeSize-1))return!1;if(a+=1,this.options.mode==="deepest"&&s-a>0||this.options.mode==="shallowest"&&a>1)return this.options.mode==="deepest";i.push(ft.node(u,u+l.nodeSize,{class:this.options.className}))}),Te.create(e,i)}}})]}}),fA=Me.create({name:"gapCursor",addProseMirrorPlugins(){return[lA()]},extendNodeSchema(e){var t;let n={name:e.name,options:e.options,storage:e.storage};return{allowGapCursor:(t=Ce(J(e,"allowGapCursor",n)))!==null&&t!==void 0?t:null}}}),pA="placeholder",uA=new ke("tiptap__placeholder");function hA(e){let{editor:t,placeholder:n,dataAttribute:o,pos:r,node:i,isEmptyDoc:s,hasAnchor:a,classes:{emptyNode:l,emptyEditor:u}}=e,c=[l];return s&&c.push(u),ft.node(r,r+i.nodeSize,{class:c.join(" "),[o]:typeof n=="function"?n({editor:t,node:i,pos:r,hasAnchor:a}):n})}function mA(e,t){return typeof e=="function"?e(t):e}function gA({editor:e,options:t,dataAttribute:n,doc:o,selection:r,from:i,to:s}){let{anchor:a}=r,l=[],u=e.isEmpty;return o.nodesBetween(i,s,(c,d)=>{let f=a>=d&&a<=d+c.nodeSize,h=!c.isLeaf&&Ki(c);return c.type.isTextblock&&(f||!t.showOnlyCurrent)&&h&&l.push(hA({editor:e,isEmptyDoc:u,dataAttribute:n,hasAnchor:f,placeholder:t.placeholder,classes:{emptyEditor:t.emptyEditorClass,emptyNode:mA(t.emptyNodeClass,{editor:e,node:c,pos:d,hasAnchor:f})},node:c,pos:d})),t.includeChildren}),l}function bA({editor:e,options:t,dataAttribute:n,doc:o,selection:r}){if(!(e.isEditable||!t.showOnlyWhenEditable))return null;let{anchor:i}=r,s=[],a=e.isEmpty;if(t.showOnlyCurrent&&!t.includeChildren){let l=o.resolve(i),u=l.depth>0?l.node(1):l.nodeAfter,c=l.depth>0?l.before(1):i;if(u&&u.type.isTextblock&&Ki(u)){let d=i>=c&&i<=c+u.nodeSize;s.push(hA({editor:e,isEmptyDoc:a,dataAttribute:n,hasAnchor:d,placeholder:t.placeholder,classes:{emptyEditor:t.emptyEditorClass,emptyNode:mA(t.emptyNodeClass,{editor:e,node:u,pos:c,hasAnchor:d})},node:u,pos:c}))}}else s.push(...gA({editor:e,options:t,dataAttribute:n,doc:o,selection:r,from:0,to:o.content.size}));return Te.create(o,s)}function Ya(e,t){let n=e.resolve(t);if(n.depth===0){var o;let i=(o=n.nodeAfter)!==null&&o!==void 0?o:n.nodeBefore;if(!i)return{from:t,to:t};let s=n.nodeAfter?t:t-i.nodeSize;return{from:s,to:s+i.nodeSize}}let r=n.before(1);return{from:r,to:r+n.node(1).nodeSize}}function el(e,t){return{from:Math.max(0,t.from),to:Math.min(e.content.size,t.to)}}function H5(e,t,n){let o=[];return e.forEach((r,i)=>{let s=i,a=s+r.nodeSize,l=s+1,u=a+1;l<n&&u>t&&o.push({from:s,to:a})}),o}function q5(e){if(e.length===0)return[];let t=[...e].sort((o,r)=>o.from-r.from),n=[{...t[0]}];for(let o=1;o<t.length;o+=1){let r=n[n.length-1],i=t[o];i.from<=r.to?r.to=Math.max(r.to,i.to):n.push({...i})}return n}function Z5(e,t){let n=H5(e,t.from,t.to);return n.push(el(e,Ya(e,t.from))),t.to>t.from?n.push(el(e,Ya(e,Math.min(t.to,e.content.size+1)-1))):t.from<e.content.size+1&&n.push(el(e,Ya(e,Math.min(t.from+1,e.content.size)))),n}function V5(e,t,n){let o=[];if(e.docChanged){let r=Wi(e);for(let i of r)o.push(...Z5(n.doc,i.newRange))}return e.selectionSet&&(o.push(el(n.doc,Ya(n.doc,e.mapping.map(t.selection.anchor)))),o.push(el(n.doc,Ya(n.doc,n.selection.anchor)))),q5(o)}function W5(e,t,n){let o=Math.max(0,Math.min(e,n.content.size));return{from:o,to:Math.max(o,Math.min(t,n.content.size))}}function K5({decorations:e,ranges:t,editor:n,options:o,dataAttribute:r,doc:i,selection:s}){let a=e;for(let l of t){let{from:u,to:c}=W5(l.from,l.to,i),d=a.find(u,c).filter(h=>h.from>=u&&h.to<=c);d.length&&(a=a.remove(d));let f=gA({editor:n,options:o,dataAttribute:r,doc:i,selection:s,from:u,to:c});f.length&&(a=a.add(i,f))}return a}function J5({editor:e,options:t,dataAttribute:n}){return{init(o,r){let i=bA({editor:e,options:t,dataAttribute:n,doc:r.doc,selection:r.selection});return i??Te.empty},apply(o,r,i,s){return!o.docChanged&&!o.selectionSet?r:K5({decorations:r.map(o.mapping,o.doc),ranges:V5(o,i,s),editor:e,options:t,dataAttribute:n,doc:s.doc,selection:s.selection})}}}function G5(e){return e.replace(/\s+/g,"-").replace(/[^a-zA-Z0-9-]/g,"").replace(/^[0-9-]+/,"").replace(/^-+/,"").toLowerCase()}function Q5({editor:e,options:t}){let n=t.dataAttribute?`data-${G5(t.dataAttribute)}`:`data-${pA}`,o=t.showOnlyCurrent&&!t.includeChildren;return new de({key:uA,...o?{}:{state:J5({editor:e,options:t,dataAttribute:n})},props:{decorations:o?({doc:r,selection:i})=>bA({editor:e,options:t,dataAttribute:n,doc:r,selection:i}):r=>{var i;return t.showOnlyWhenEditable&&!e.isEditable?Te.empty:(i=uA.getState(r))!==null&&i!==void 0?i:Te.empty}}})}var EX=Me.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",dataAttribute:pA,placeholder:"Write something \u2026",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[Q5({editor:this.editor,options:this.options})]}});function Zy(e,t){return!e.selection.empty&&!Ad(e.selection)&&t.isEditable}function X5(e,t){return Zy(e,t)&&!t.isFocused&&!t.view.dragging}function Y5(){var e;(e=window.getSelection())===null||e===void 0||e.removeAllRanges()}function e9(e){e.focus()}var CX=Me.create({name:"selection",addOptions(){return{className:"selection"}},addProseMirrorPlugins(){let{editor:e,options:t}=this;return[new de({key:new ke("selection"),props:{decorations(n){return X5(n,e)?Te.create(n.doc,[ft.inline(n.selection.from,n.selection.to,{class:t.className})]):null},handleDOMEvents:{blur(n){return Zy(n.state,e)&&Y5(),!1},focus(n){return Zy(n.state,e)&&requestAnimationFrame(()=>{!e.isDestroyed&&n.hasFocus()&&e9(n)}),!1}}}})]}});function cA({types:e,node:t}){return t&&Array.isArray(e)&&e.includes(t.type)||t?.type===e}var yA=Me.create({name:"trailingNode",addOptions(){return{node:void 0,notAfter:[]}},addProseMirrorPlugins(){var e;let t=new ke(this.name),n=this.options.node||((e=this.editor.schema.topNodeType.contentMatch.defaultType)===null||e===void 0?void 0:e.name)||"paragraph",o=Object.entries(this.editor.schema.nodes).map(([,r])=>r).filter(r=>(this.options.notAfter||[]).concat(n).includes(r.name));return[new de({key:t,appendTransaction:(r,i,s)=>{let{doc:a,tr:l,schema:u}=s,c=t.getState(s),d=a.content.size,f=u.nodes[n];if(!r.some(h=>h.getMeta("skipTrailingNode"))&&c)return l.insert(d,f.create())},state:{init:(r,i)=>{let s=i.tr.doc.lastChild;return!cA({node:s,types:o})},apply:(r,i)=>{if(!r.docChanged||r.getMeta("__uniqueIDTransaction"))return i;let s=r.doc.lastChild;return!cA({node:s,types:o})}}})]}}),vA=Me.create({name:"undoRedo",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:e,dispatch:t})=>Kb(e,t),redo:()=>({state:e,dispatch:t})=>Jb(e,t)}},addProseMirrorPlugins(){return[H2(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-\u044F":()=>this.editor.commands.undo(),"Shift-Mod-\u044F":()=>this.editor.commands.redo()}}});var t9=Me.create({name:"starterKit",addExtensions(){let e=[];if(this.options.bold!==!1&&e.push(pT.configure(this.options.bold)),this.options.blockquote!==!1&&e.push(fT.configure(this.options.blockquote)),this.options.bulletList!==!1&&e.push(Oy.configure(this.options.bulletList)),this.options.code!==!1&&e.push(hT.configure(this.options.code)),this.options.codeBlock!==!1&&e.push(mT.configure(this.options.codeBlock)),this.options.document!==!1&&e.push(gT.configure(this.options.document)),this.options.dropcursor!==!1&&e.push(dA.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&e.push(fA.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&e.push(bT.configure(this.options.hardBreak)),this.options.heading!==!1&&e.push(yT.configure(this.options.heading)),this.options.undoRedo!==!1&&e.push(vA.configure(this.options.undoRedo)),this.options.horizontalRule!==!1&&e.push(vT.configure(this.options.horizontalRule)),this.options.italic!==!1&&e.push(xT.configure(this.options.italic)),this.options.listItem!==!1&&e.push(Ly.configure(this.options.listItem)),this.options.listKeymap!==!1){var t;e.push(jy.configure((t=this.options)===null||t===void 0?void 0:t.listKeymap))}if(this.options.link!==!1){var n;e.push(FT.configure((n=this.options)===null||n===void 0?void 0:n.link))}if(this.options.orderedList!==!1&&e.push(By.configure(this.options.orderedList)),this.options.paragraph!==!1&&e.push(nA.configure(this.options.paragraph)),this.options.strike!==!1&&e.push(rA.configure(this.options.strike)),this.options.text!==!1&&e.push(oA.configure(this.options.text)),this.options.underline!==!1){var o;e.push(iA.configure((o=this.options)===null||o===void 0?void 0:o.underline))}if(this.options.trailingNode!==!1){var r;e.push(yA.configure((r=this.options)===null||r===void 0?void 0:r.trailingNode))}return e}}),xA=t9;var n9=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,r9=ce.create({name:"image",addOptions(){return{inline:!1,allowBase64:!1,HTMLAttributes:{},resize:!1}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null},width:{default:null},height:{default:null}}},parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML({HTMLAttributes:e}){return["img",fe(this.options.HTMLAttributes,e)]},parseMarkdown:(e,t)=>t.createNode("image",{src:e.href,title:e.title,alt:e.text}),renderMarkdown:e=>{var t,n,o,r,i,s;let a=(t=(n=e.attrs)===null||n===void 0?void 0:n.src)!==null&&t!==void 0?t:"",l=(o=(r=e.attrs)===null||r===void 0?void 0:r.alt)!==null&&o!==void 0?o:"",u=(i=(s=e.attrs)===null||s===void 0?void 0:s.title)!==null&&i!==void 0?i:"";return u?``:``},addNodeView(){if(!this.options.resize||!this.options.resize.enabled||typeof document>"u")return null;let{directions:e,minWidth:t,minHeight:n,alwaysPreserveAspectRatio:o}=this.options.resize,r=new Set(["src","width","height"]);return({node:i,getPos:s,HTMLAttributes:a,editor:l})=>{let u=document.createElement("img");u.draggable=!1;let c=fe(this.options.HTMLAttributes,a);Object.entries(c).forEach(([b,y])=>{if(y!=null)switch(b){case"src":case"width":case"height":break;default:u.setAttribute(b,y)}}),c.src!==null&&(u.src=c.src);let d={...a},f=b=>{if(typeof b=="string"&&b!==""){u.getAttribute("src")!==b&&(u.src=b);return}u.hasAttribute("src")&&u.removeAttribute("src"),u.src!==""&&(u.src="")};f(a.src);let h=b=>{if(b.type!==i.type)return!1;let y=l.extensionManager.attributes.filter(x=>x.type===b.type.name),k=$r(b,y);return Object.keys(d).forEach(x=>{!r.has(x)&&!(x in k)&&u.removeAttribute(x)}),Object.entries(k).forEach(([x,E])=>{r.has(x)||(E!=null?u.setAttribute(x,E):u.removeAttribute(x))}),f(k.src),d=k,!0},p=new aT({element:u,editor:l,node:i,getPos:s,onResize:(b,y)=>{u.style.width=`${b}px`,u.style.height=`${y}px`},onCommit:(b,y)=>{let k=s();k!==void 0&&this.editor.chain().setNodeSelection(k).updateAttributes(this.name,{width:b,height:y}).run()},onUpdate:h,options:{directions:e,min:{width:t,height:n},preserveAspectRatio:o===!0}}),m=p.dom,g=()=>{m.style.visibility="",m.style.pointerEvents=""};return m.style.visibility="hidden",m.style.pointerEvents="none",u.complete&&u.naturalWidth>0?g():(u.onload=g,u.onerror=g),p}},addCommands(){return{setImage:e=>({commands:t})=>t.insertContent({type:this.name,attrs:e})}},addInputRules(){return[$d({find:n9,type:this.type,getAttributes:e=>{let[,,t,n,o]=e;return{src:n,alt:t,title:o}}})]}}),kA=r9;var Wy,Ky;if(typeof WeakMap<"u"){let e=new WeakMap;Wy=t=>e.get(t),Ky=(t,n)=>(e.set(t,n),n)}else{let e=[],n=0;Wy=o=>{for(let r=0;r<e.length;r+=2)if(e[r]==o)return e[r+1]},Ky=(o,r)=>(n==10&&(n=0),e[n++]=o,e[n++]=r)}var Je=class{constructor(e,t,n,o){this.width=e,this.height=t,this.map=n,this.problems=o}findCell(e){for(let t=0;t<this.map.length;t++){let n=this.map[t];if(n!=e)continue;let o=t%this.width,r=t/this.width|0,i=o+1,s=r+1;for(let a=1;i<this.width&&this.map[t+a]==n;a++)i++;for(let a=1;s<this.height&&this.map[t+this.width*a]==n;a++)s++;return{left:o,top:r,right:i,bottom:s}}throw new RangeError(`No cell with offset ${e} found`)}colCount(e){for(let t=0;t<this.map.length;t++)if(this.map[t]==e)return t%this.width;throw new RangeError(`No cell with offset ${e} found`)}nextCell(e,t,n){let{left:o,right:r,top:i,bottom:s}=this.findCell(e);return t=="horiz"?(n<0?o==0:r==this.width)?null:this.map[i*this.width+(n<0?o-1:r)]:(n<0?i==0:s==this.height)?null:this.map[o+this.width*(n<0?i-1:s)]}rectBetween(e,t){let{left:n,right:o,top:r,bottom:i}=this.findCell(e),{left:s,right:a,top:l,bottom:u}=this.findCell(t);return{left:Math.min(n,s),top:Math.min(r,l),right:Math.max(o,a),bottom:Math.max(i,u)}}cellsInRect(e){let t=[],n={};for(let o=e.top;o<e.bottom;o++)for(let r=e.left;r<e.right;r++){let i=o*this.width+r,s=this.map[i];n[s]||(n[s]=!0,!(r==e.left&&r&&this.map[i-1]==s||o==e.top&&o&&this.map[i-this.width]==s)&&t.push(s))}return t}positionAt(e,t,n){for(let o=0,r=0;;o++){let i=r+n.child(o).nodeSize;if(o==e){let s=t+e*this.width,a=(e+1)*this.width;for(;s<a&&this.map[s]<r;)s++;return s==a?i-1:this.map[s]}r=i}}static get(e){return Wy(e)||Ky(e,o9(e))}};function o9(e){if(e.type.spec.tableRole!="table")throw new RangeError("Not a table node: "+e.type.name);let t=i9(e),n=e.childCount,o=[],r=0,i=null,s=[];for(let u=0,c=t*n;u<c;u++)o[u]=0;for(let u=0,c=0;u<n;u++){let d=e.child(u);c++;for(let p=0;;p++){for(;r<o.length&&o[r]!=0;)r++;if(p==d.childCount)break;let m=d.child(p),{colspan:g,rowspan:b,colwidth:y}=m.attrs;for(let k=0;k<b;k++){if(k+u>=n){(i||(i=[])).push({type:"overlong_rowspan",pos:c,n:b-k});break}let x=r+k*t;for(let E=0;E<g;E++){o[x+E]==0?o[x+E]=c:(i||(i=[])).push({type:"collision",row:u,pos:c,n:g-E});let I=y&&y[E];if(I){let N=(x+E)%t*2,D=s[N];D==null||D!=I&&s[N+1]==1?(s[N]=I,s[N+1]=1):D==I&&s[N+1]++}}}r+=g,c+=m.nodeSize}let f=(u+1)*t,h=0;for(;r<f;)o[r++]==0&&h++;h&&(i||(i=[])).push({type:"missing",row:u,n:h}),c++}(t===0||n===0)&&(i||(i=[])).push({type:"zero_sized"});let a=new Je(t,n,o,i),l=!1;for(let u=0;!l&&u<s.length;u+=2)s[u]!=null&&s[u+1]<n&&(l=!0);return l&&s9(a,s,e),a}function i9(e){let t=-1,n=!1;for(let o=0;o<e.childCount;o++){let r=e.child(o),i=0;if(n)for(let s=0;s<o;s++){let a=e.child(s);for(let l=0;l<a.childCount;l++){let u=a.child(l);s+u.attrs.rowspan>o&&(i+=u.attrs.colspan)}}for(let s=0;s<r.childCount;s++){let a=r.child(s);i+=a.attrs.colspan,a.attrs.rowspan>1&&(n=!0)}t==-1?t=i:t!=i&&(t=Math.max(t,i))}return t}function s9(e,t,n){e.problems||(e.problems=[]);let o={};for(let r=0;r<e.map.length;r++){let i=e.map[r];if(o[i])continue;o[i]=!0;let s=n.nodeAt(i);if(!s)throw new RangeError(`No cell with offset ${i} found`);let a=null,l=s.attrs;for(let u=0;u<l.colspan;u++){let c=t[(r+u)%e.width*2];c!=null&&(!l.colwidth||l.colwidth[u]!=c)&&((a||(a=a9(l)))[u]=c)}a&&e.problems.unshift({type:"colwidth mismatch",pos:i,colwidth:a})}}function a9(e){if(e.colwidth)return e.colwidth.slice();let t=[];for(let n=0;n<e.colspan;n++)t.push(0);return t}function Nt(e){let t=e.cached.tableNodeTypes;if(!t){t=e.cached.tableNodeTypes={};for(let n in e.nodes){let o=e.nodes[n],r=o.spec.tableRole;r&&(t[r]=o)}}return t}var zr=new ke("selectingCells");function Eo(e){for(let t=e.depth-1;t>0;t--)if(e.node(t).type.spec.tableRole=="row")return e.node(0).resolve(e.before(t+1));return null}function l9(e){for(let t=e.depth;t>0;t--){let n=e.node(t).type.spec.tableRole;if(n==="cell"||n==="header_cell")return e.node(t)}return null}function yn(e){let t=e.selection.$head;for(let n=t.depth;n>0;n--)if(t.node(n).type.spec.tableRole=="row")return!0;return!1}function _f(e){let t=e.selection;if("$anchorCell"in t&&t.$anchorCell)return t.$anchorCell.pos>t.$headCell.pos?t.$anchorCell:t.$headCell;if("node"in t&&t.node&&t.node.type.spec.tableRole=="cell")return t.$anchor;let n=Eo(t.$head)||u9(t.$head);if(n)return n;throw new RangeError(`No cell found around position ${t.head}`)}function u9(e){for(let t=e.nodeAfter,n=e.pos;t;t=t.firstChild,n++){let o=t.type.spec.tableRole;if(o=="cell"||o=="header_cell")return e.doc.resolve(n)}for(let t=e.nodeBefore,n=e.pos;t;t=t.lastChild,n--){let o=t.type.spec.tableRole;if(o=="cell"||o=="header_cell")return e.doc.resolve(n-t.nodeSize)}}function Jy(e){return e.parent.type.spec.tableRole=="row"&&!!e.nodeAfter}function c9(e){return e.node(0).resolve(e.pos+e.nodeAfter.nodeSize)}function Xy(e,t){return e.depth==t.depth&&e.pos>=t.start(-1)&&e.pos<=t.end(-1)}function IA(e,t,n){let o=e.node(-1),r=Je.get(o),i=e.start(-1),s=r.nextCell(e.pos-i,t,n);return s==null?null:e.node(0).resolve(i+s)}function Co(e,t,n=1){let o={...e,colspan:e.colspan-n};return o.colwidth&&(o.colwidth=o.colwidth.slice(),o.colwidth.splice(t,n),o.colwidth.some(r=>r>0)||(o.colwidth=null)),o}function DA(e,t,n=1){let o={...e,colspan:e.colspan+n};if(o.colwidth){o.colwidth=o.colwidth.slice();for(let r=0;r<n;r++)o.colwidth.splice(t,0,0)}return o}function d9(e,t,n){let o=Nt(t.type.schema).header_cell;for(let r=0;r<e.height;r++)if(t.nodeAt(e.map[n+r*e.width]).type!=o)return!1;return!0}var je=class lr extends Q{constructor(t,n=t){let o=t.node(-1),r=Je.get(o),i=t.start(-1),s=r.rectBetween(t.pos-i,n.pos-i),a=t.node(0),l=r.cellsInRect(s).filter(c=>c!=n.pos-i);l.unshift(n.pos-i);let u=l.map(c=>{let d=o.nodeAt(c);if(!d)throw new RangeError(`No cell with offset ${c} found`);let f=i+c+1;return new Ii(a.resolve(f),a.resolve(f+d.content.size))});super(u[0].$from,u[0].$to,u),this.$anchorCell=t,this.$headCell=n}map(t,n){let o=t.resolve(n.map(this.$anchorCell.pos)),r=t.resolve(n.map(this.$headCell.pos));if(Jy(o)&&Jy(r)&&Xy(o,r)){let i=this.$anchorCell.node(-1)!=o.node(-1);return i&&this.isRowSelection()?lr.rowSelection(o,r):i&&this.isColSelection()?lr.colSelection(o,r):new lr(o,r)}return Z.between(o,r)}content(){let t=this.$anchorCell.node(-1),n=Je.get(t),o=this.$anchorCell.start(-1),r=n.rectBetween(this.$anchorCell.pos-o,this.$headCell.pos-o),i={},s=[];for(let l=r.top;l<r.bottom;l++){let u=[];for(let c=l*n.width+r.left,d=r.left;d<r.right;d++,c++){let f=n.map[c];if(i[f])continue;i[f]=!0;let h=n.findCell(f),p=t.nodeAt(f);if(!p)throw new RangeError(`No cell with offset ${f} found`);let m=r.left-h.left,g=h.right-r.right;if(m>0||g>0){let b=p.attrs;if(m>0&&(b=Co(b,0,m)),g>0&&(b=Co(b,b.colspan-g,g)),h.left<r.left){if(p=p.type.createAndFill(b),!p)throw new RangeError(`Could not create cell with attrs ${JSON.stringify(b)}`)}else p=p.type.create(b,p.content)}if(h.top<r.top||h.bottom>r.bottom){let b={...p.attrs,rowspan:Math.min(h.bottom,r.bottom)-Math.max(h.top,r.top)};h.top<r.top?p=p.type.createAndFill(b):p=p.type.create(b,p.content)}u.push(p)}s.push(t.child(l).copy(M.from(u)))}let a=this.isColSelection()&&this.isRowSelection()?t:s;return new F(M.from(a),1,1)}replace(t,n=F.empty){let o=t.steps.length,r=this.ranges;for(let s=0;s<r.length;s++){let{$from:a,$to:l}=r[s],u=t.mapping.slice(o);t.replace(u.map(a.pos),u.map(l.pos),s?F.empty:n)}let i=Q.findFrom(t.doc.resolve(t.mapping.slice(o).map(this.to)),-1);i&&t.setSelection(i)}replaceWith(t,n){this.replace(t,new F(M.from(n),0,0))}forEachCell(t){let n=this.$anchorCell.node(-1),o=Je.get(n),r=this.$anchorCell.start(-1),i=o.cellsInRect(o.rectBetween(this.$anchorCell.pos-r,this.$headCell.pos-r));for(let s=0;s<i.length;s++)t(n.nodeAt(i[s]),r+i[s])}isColSelection(){let t=this.$anchorCell.index(-1),n=this.$headCell.index(-1);if(Math.min(t,n)>0)return!1;let o=t+this.$anchorCell.nodeAfter.attrs.rowspan,r=n+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(o,r)==this.$headCell.node(-1).childCount}static colSelection(t,n=t){let o=t.node(-1),r=Je.get(o),i=t.start(-1),s=r.findCell(t.pos-i),a=r.findCell(n.pos-i),l=t.node(0);return s.top<=a.top?(s.top>0&&(t=l.resolve(i+r.map[s.left])),a.bottom<r.height&&(n=l.resolve(i+r.map[r.width*(r.height-1)+a.right-1]))):(a.top>0&&(n=l.resolve(i+r.map[a.left])),s.bottom<r.height&&(t=l.resolve(i+r.map[r.width*(r.height-1)+s.right-1]))),new lr(t,n)}isRowSelection(){let t=this.$anchorCell.node(-1),n=Je.get(t),o=this.$anchorCell.start(-1),r=n.colCount(this.$anchorCell.pos-o),i=n.colCount(this.$headCell.pos-o);if(Math.min(r,i)>0)return!1;let s=r+this.$anchorCell.nodeAfter.attrs.colspan,a=i+this.$headCell.nodeAfter.attrs.colspan;return Math.max(s,a)==n.width}eq(t){return t instanceof lr&&t.$anchorCell.pos==this.$anchorCell.pos&&t.$headCell.pos==this.$headCell.pos}static rowSelection(t,n=t){let o=t.node(-1),r=Je.get(o),i=t.start(-1),s=r.findCell(t.pos-i),a=r.findCell(n.pos-i),l=t.node(0);return s.left<=a.left?(s.left>0&&(t=l.resolve(i+r.map[s.top*r.width])),a.right<r.width&&(n=l.resolve(i+r.map[r.width*(a.top+1)-1]))):(a.left>0&&(n=l.resolve(i+r.map[a.top*r.width])),s.right<r.width&&(t=l.resolve(i+r.map[r.width*(s.top+1)-1]))),new lr(t,n)}toJSON(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(t,n){return new lr(t.resolve(n.anchor),t.resolve(n.head))}static create(t,n,o=n){return new lr(t.resolve(n),t.resolve(o))}getBookmark(){return new f9(this.$anchorCell.pos,this.$headCell.pos)}};je.prototype.visible=!1;Q.jsonID("cell",je);var f9=class NA{constructor(t,n){this.anchor=t,this.head=n}map(t){return new NA(t.map(this.anchor),t.map(this.head))}resolve(t){let n=t.resolve(this.anchor),o=t.resolve(this.head);return n.parent.type.spec.tableRole=="row"&&o.parent.type.spec.tableRole=="row"&&n.index()<n.parent.childCount&&o.index()<o.parent.childCount&&Xy(n,o)?new je(n,o):Q.near(o,1)}};function p9(e){if(!(e.selection instanceof je))return null;let t=[];return e.selection.forEachCell((n,o)=>{t.push(ft.node(o,o+n.nodeSize,{class:"selectedCell"}))}),Te.create(e.doc,t)}function h9({$from:e,$to:t}){if(e.pos==t.pos||e.pos<t.pos-6)return!1;let n=e.pos,o=t.pos,r=e.depth;for(;r>=0&&!(e.after(r+1)<e.end(r));r--,n++);for(let i=t.depth;i>=0&&!(t.before(i+1)>t.start(i));i--,o--);return n==o&&/row|table/.test(e.node(r).type.spec.tableRole)}function m9({$from:e,$to:t}){let n,o;for(let r=e.depth;r>0;r--){let i=e.node(r);if(i.type.spec.tableRole==="cell"||i.type.spec.tableRole==="header_cell"){n=i;break}}for(let r=t.depth;r>0;r--){let i=t.node(r);if(i.type.spec.tableRole==="cell"||i.type.spec.tableRole==="header_cell"){o=i;break}}return n!==o&&t.parentOffset===0}function g9(e,t,n){let o=(t||e).selection,r=(t||e).doc,i,s;if(o instanceof X&&(s=o.node.type.spec.tableRole)){if(s=="cell"||s=="header_cell")i=je.create(r,o.from);else if(s=="row"){let a=r.resolve(o.from+1);i=je.rowSelection(a,a)}else if(!n){let a=Je.get(o.node),l=o.from+1,u=l+a.map[a.width*a.height-1];i=je.create(r,l+1,u)}}else o instanceof Z&&h9(o)?i=Z.create(r,o.from):o instanceof Z&&m9(o)&&(i=Z.create(r,o.$from.start(),o.$from.end()));return i&&(t||(t=e.tr)).setSelection(i),t}var b9=new ke("fix-tables");function zA(e,t,n,o){let r=e.childCount,i=t.childCount;e:for(let s=0,a=0;s<i;s++){let l=t.child(s);for(let u=a,c=Math.min(r,s+3);u<c;u++)if(e.child(u)==l){a=u+1,n+=l.nodeSize;continue e}o(l,n),a<r&&e.child(a).sameMarkup(l)?zA(e.child(a),l,n+1,o):l.nodesBetween(0,l.content.size,o,n+1),n+=l.nodeSize}}function Yy(e,t){let n,o=(r,i)=>{r.type.spec.tableRole=="table"&&(n=y9(e,r,i,n))};return t?t.doc!=e.doc&&zA(t.doc,e.doc,0,o):e.doc.descendants(o),n}function y9(e,t,n,o){let r=Je.get(t);if(!r.problems)return o;o||(o=e.tr);let i=[];for(let l=0;l<r.height;l++)i.push(0);for(let l=0;l<r.problems.length;l++){let u=r.problems[l];if(u.type=="collision"){let c=t.nodeAt(u.pos);if(!c)continue;let d=c.attrs;for(let f=0;f<d.rowspan;f++)i[u.row+f]+=u.n;o.setNodeMarkup(o.mapping.map(n+1+u.pos),null,Co(d,d.colspan-u.n,u.n))}else if(u.type=="missing")i[u.row]+=u.n;else if(u.type=="overlong_rowspan"){let c=t.nodeAt(u.pos);if(!c)continue;o.setNodeMarkup(o.mapping.map(n+1+u.pos),null,{...c.attrs,rowspan:c.attrs.rowspan-u.n})}else if(u.type=="colwidth mismatch"){let c=t.nodeAt(u.pos);if(!c)continue;o.setNodeMarkup(o.mapping.map(n+1+u.pos),null,{...c.attrs,colwidth:u.colwidth})}else if(u.type=="zero_sized"){let c=o.mapping.map(n);o.delete(c,c+t.nodeSize)}}let s,a;for(let l=0;l<i.length;l++)i[l]&&(s==null&&(s=l),a=l);for(let l=0,u=n+1;l<r.height;l++){let c=t.child(l),d=u+c.nodeSize,f=i[l];if(f>0){let h="cell";c.firstChild&&(h=c.firstChild.type.spec.tableRole);let p=[];for(let g=0;g<f;g++){let b=Nt(e.schema)[h].createAndFill();b&&p.push(b)}let m=(l==0||s==l-1)&&a==l?u+1:d-1;o.insert(o.mapping.map(m),p)}u=d}return o.setMeta(b9,{fixTables:!0})}function Ln(e){let t=e.selection,n=_f(e),o=n.node(-1),r=n.start(-1),i=Je.get(o);return{...t instanceof je?i.rectBetween(t.$anchorCell.pos-r,t.$headCell.pos-r):i.findCell(n.pos-r),tableStart:r,map:i,table:o}}function OA(e,{map:t,tableStart:n,table:o},r){let i=r>0?-1:0;d9(t,o,r+i)&&(i=r==0||r==t.width?null:0);for(let s=0;s<t.height;s++){let a=s*t.width+r;if(r>0&&r<t.width&&t.map[a-1]==t.map[a]){let l=t.map[a],u=o.nodeAt(l);e.setNodeMarkup(e.mapping.map(n+l),null,DA(u.attrs,r-t.colCount(l))),s+=u.attrs.rowspan-1}else{let l=i==null?Nt(o.type.schema).cell:o.nodeAt(t.map[a+i]).type,u=t.positionAt(s,r,o);e.insert(e.mapping.map(n+u),l.createAndFill())}}return e}function RA(e,t){if(!yn(e))return!1;if(t){let n=Ln(e);t(OA(e.tr,n,n.left))}return!0}function PA(e,t){if(!yn(e))return!1;if(t){let n=Ln(e);t(OA(e.tr,n,n.right))}return!0}function v9(e,{map:t,table:n,tableStart:o},r){let i=e.mapping.maps.length;for(let s=0;s<t.height;){let a=s*t.width+r,l=t.map[a],u=n.nodeAt(l),c=u.attrs;if(r>0&&t.map[a-1]==l||r<t.width-1&&t.map[a+1]==l)e.setNodeMarkup(e.mapping.slice(i).map(o+l),null,Co(c,r-t.colCount(l)));else{let d=e.mapping.slice(i).map(o+l);e.delete(d,d+u.nodeSize)}s+=c.rowspan}}function LA(e,t){if(!yn(e))return!1;if(t){let n=Ln(e),o=e.tr;if(n.left==0&&n.right==n.map.width)return!1;for(let r=n.right-1;v9(o,n,r),r!=n.left;r--){let i=n.tableStart?o.doc.nodeAt(n.tableStart-1):o.doc;if(!i)throw new RangeError("No table found");n.table=i,n.map=Je.get(i)}t(o)}return!0}function x9(e,t,n){var o;let r=Nt(t.type.schema).header_cell;for(let i=0;i<e.width;i++)if(((o=t.nodeAt(e.map[i+n*e.width]))===null||o===void 0?void 0:o.type)!=r)return!1;return!0}function FA(e,{map:t,tableStart:n,table:o},r){let i=n;for(let u=0;u<r;u++)i+=o.child(u).nodeSize;let s=[],a=r>0?-1:0;x9(t,o,r+a)&&(a=r==0||r==t.height?null:0);for(let u=0,c=t.width*r;u<t.width;u++,c++)if(r>0&&r<t.height&&t.map[c]==t.map[c-t.width]){let d=t.map[c],f=o.nodeAt(d).attrs;e.setNodeMarkup(n+d,null,{...f,rowspan:f.rowspan+1}),u+=f.colspan-1}else{var l;let d=a==null?Nt(o.type.schema).cell:(l=o.nodeAt(t.map[c+a*t.width]))===null||l===void 0?void 0:l.type,f=d?.createAndFill();f&&s.push(f)}return e.insert(i,Nt(o.type.schema).row.create(null,s)),e}function jA(e,t){if(!yn(e))return!1;if(t){let n=Ln(e);t(FA(e.tr,n,n.top))}return!0}function BA(e,t){if(!yn(e))return!1;if(t){let n=Ln(e);t(FA(e.tr,n,n.bottom))}return!0}function k9(e,{map:t,table:n,tableStart:o},r){let i=0;for(let u=0;u<r;u++)i+=n.child(u).nodeSize;let s=i+n.child(r).nodeSize,a=e.mapping.maps.length;e.delete(i+o,s+o);let l=new Set;for(let u=0,c=r*t.width;u<t.width;u++,c++){let d=t.map[c];if(!l.has(d)){if(l.add(d),r>0&&d==t.map[c-t.width]){let f=n.nodeAt(d).attrs;e.setNodeMarkup(e.mapping.slice(a).map(d+o),null,{...f,rowspan:f.rowspan-1}),u+=f.colspan-1}else if(r<t.height&&d==t.map[c+t.width]){let f=n.nodeAt(d),h=f.attrs,p=f.type.create({...h,rowspan:f.attrs.rowspan-1},f.content),m=t.positionAt(r+1,u,n);e.insert(e.mapping.slice(a).map(o+m),p),u+=h.colspan-1}}}}function UA(e,t){if(!yn(e))return!1;if(t){let n=Ln(e),o=e.tr;if(n.top==0&&n.bottom==n.map.height)return!1;for(let r=n.bottom-1;k9(o,n,r),r!=n.top;r--){let i=n.tableStart?o.doc.nodeAt(n.tableStart-1):o.doc;if(!i)throw new RangeError("No table found");n.table=i,n.map=Je.get(n.table)}t(o)}return!0}function wA(e){let t=e.content;return t.childCount==1&&t.child(0).isTextblock&&t.child(0).childCount==0}function w9({width:e,height:t,map:n},o){let r=o.top*e+o.left,i=r,s=(o.bottom-1)*e+o.left,a=r+(o.right-o.left-1);for(let l=o.top;l<o.bottom;l++){if(o.left>0&&n[i]==n[i-1]||o.right<e&&n[a]==n[a+1])return!0;i+=e,a+=e}for(let l=o.left;l<o.right;l++){if(o.top>0&&n[r]==n[r-e]||o.bottom<t&&n[s]==n[s+e])return!0;r++,s++}return!1}function e1(e,t){let n=e.selection;if(!(n instanceof je)||n.$anchorCell.pos==n.$headCell.pos)return!1;let o=Ln(e),{map:r}=o;if(w9(r,o))return!1;if(t){let i=e.tr,s={},a=M.empty,l,u;for(let c=o.top;c<o.bottom;c++)for(let d=o.left;d<o.right;d++){let f=r.map[c*r.width+d],h=o.table.nodeAt(f);if(!(s[f]||!h))if(s[f]=!0,l==null)l=f,u=h;else{wA(h)||(a=a.append(h.content));let p=i.mapping.map(f+o.tableStart);i.delete(p,p+h.nodeSize)}}if(l==null||u==null)return!0;if(i.setNodeMarkup(l+o.tableStart,null,{...DA(u.attrs,u.attrs.colspan,o.right-o.left-u.attrs.colspan),rowspan:o.bottom-o.top}),a.size>0){let c=l+1+u.content.size,d=wA(u)?l+1:c;i.replaceWith(d+o.tableStart,c+o.tableStart,a)}i.setSelection(new je(i.doc.resolve(l+o.tableStart))),t(i)}return!0}function t1(e,t){let n=Nt(e.schema);return S9(({node:o})=>n[o.type.spec.tableRole])(e,t)}function S9(e){return(t,n)=>{let o=t.selection,r,i;if(o instanceof je){if(o.$anchorCell.pos!=o.$headCell.pos)return!1;r=o.$anchorCell.nodeAfter,i=o.$anchorCell.pos}else{var s;if(r=l9(o.$from),!r)return!1;i=(s=Eo(o.$from))===null||s===void 0?void 0:s.pos}if(r==null||i==null||r.attrs.colspan==1&&r.attrs.rowspan==1)return!1;if(n){let a=r.attrs,l=[],u=a.colwidth;a.rowspan>1&&(a={...a,rowspan:1}),a.colspan>1&&(a={...a,colspan:1});let c=Ln(t),d=t.tr;for(let h=0;h<c.right-c.left;h++)l.push(u?{...a,colwidth:u&&u[h]?[u[h]]:null}:a);let f;for(let h=c.top;h<c.bottom;h++){let p=c.map.positionAt(h,c.left,c.table);h==c.top&&(p+=r.nodeSize);for(let m=c.left,g=0;m<c.right;m++,g++)m==c.left&&h==c.top||d.insert(f=d.mapping.map(p+c.tableStart,1),e({node:r,row:h,col:m}).createAndFill(l[g]))}d.setNodeMarkup(i,e({node:r,row:c.top,col:c.left}),l[0]),o instanceof je&&d.setSelection(new je(d.doc.resolve(o.$anchorCell.pos),f?d.doc.resolve(f):void 0)),n(d)}return!0}}function HA(e,t){return function(n,o){if(!yn(n))return!1;let r=_f(n);if(r.nodeAfter.attrs[e]===t)return!1;if(o){let i=n.tr;n.selection instanceof je?n.selection.forEachCell((s,a)=>{s.attrs[e]!==t&&i.setNodeMarkup(a,null,{...s.attrs,[e]:t})}):i.setNodeMarkup(r.pos,null,{...r.nodeAfter.attrs,[e]:t}),o(i)}return!0}}function _9(e){return function(t,n){if(!yn(t))return!1;if(n){let o=Nt(t.schema),r=Ln(t),i=t.tr,s=r.map.cellsInRect(e=="column"?{left:r.left,top:0,right:r.right,bottom:r.map.height}:e=="row"?{left:0,top:r.top,right:r.map.width,bottom:r.bottom}:r),a=s.map(l=>r.table.nodeAt(l));for(let l=0;l<s.length;l++)a[l].type==o.header_cell&&i.setNodeMarkup(r.tableStart+s[l],o.cell,a[l].attrs);if(i.steps.length===0)for(let l=0;l<s.length;l++)i.setNodeMarkup(r.tableStart+s[l],o.header_cell,a[l].attrs);n(i)}return!0}}function SA(e,t,n){let o=t.map.cellsInRect({left:0,top:0,right:e=="row"?t.map.width:1,bottom:e=="column"?t.map.height:1});for(let r=0;r<o.length;r++){let i=t.table.nodeAt(o[r]);if(i&&i.type!==n.header_cell)return!1}return!0}function ts(e,t){return t=t||{useDeprecatedLogic:!1},t.useDeprecatedLogic?_9(e):function(n,o){if(!yn(n))return!1;if(o){let r=Nt(n.schema),i=Ln(n),s=n.tr,a=SA("row",i,r),l=SA("column",i,r),u=(e==="column"?a:e==="row"&&l)?1:0,c=e=="column"?{left:0,top:u,right:1,bottom:i.map.height}:e=="row"?{left:u,top:0,right:i.map.width,bottom:1}:i,d=e=="column"?l?r.cell:r.header_cell:e=="row"?a?r.cell:r.header_cell:r.cell;i.map.cellsInRect(c).forEach(f=>{let h=f+i.tableStart,p=s.doc.nodeAt(h);p&&s.setNodeMarkup(h,d,p.attrs)}),o(s)}return!0}}var YX=ts("row",{useDeprecatedLogic:!0}),eY=ts("column",{useDeprecatedLogic:!0}),qA=ts("cell",{useDeprecatedLogic:!0});function E9(e,t){if(t<0){let n=e.nodeBefore;if(n)return e.pos-n.nodeSize;for(let o=e.index(-1)-1,r=e.before();o>=0;o--){let i=e.node(-1).child(o),s=i.lastChild;if(s)return r-1-s.nodeSize;r-=i.nodeSize}}else{if(e.index()<e.parent.childCount-1)return e.pos+e.nodeAfter.nodeSize;let n=e.node(-1);for(let o=e.indexAfter(-1),r=e.after();o<n.childCount;o++){let i=n.child(o);if(i.childCount)return r+1;r+=i.nodeSize}}return null}function n1(e){return function(t,n){if(!yn(t))return!1;let o=E9(_f(t),e);if(o==null)return!1;if(n){let r=t.doc.resolve(o);n(t.tr.setSelection(Z.between(r,c9(r))).scrollIntoView())}return!0}}function ZA(e,t){let n=e.selection.$anchor;for(let o=n.depth;o>0;o--)if(n.node(o).type.spec.tableRole=="table")return t&&t(e.tr.delete(n.before(o),n.after(o)).scrollIntoView()),!0;return!1}function vf(e,t){let n=e.selection;if(!(n instanceof je))return!1;if(t){let o=e.tr,r=Nt(e.schema).cell.createAndFill().content;n.forEachCell((i,s)=>{i.content.eq(r)||o.replace(o.mapping.map(s+1),o.mapping.map(s+i.nodeSize-1),new F(r,0,0))}),o.docChanged&&t(o)}return!0}function C9(e){if(e.size===0)return null;let{content:t,openStart:n,openEnd:o}=e;for(;t.childCount==1&&(n>0&&o>0||t.child(0).type.spec.tableRole=="table");)n--,o--,t=t.child(0).content;let r=t.child(0),i=r.type.spec.tableRole,s=r.type.schema,a=[];if(i=="row")for(let l=0;l<t.childCount;l++){let u=t.child(l).content,c=l?0:Math.max(0,n-1),d=l<t.childCount-1?0:Math.max(0,o-1);(c||d)&&(u=Gy(Nt(s).row,new F(u,c,d)).content),a.push(u)}else if(i=="cell"||i=="header_cell")a.push(n||o?Gy(Nt(s).row,new F(t,n,o)).content:t);else return null;return T9(s,a)}function T9(e,t){let n=[];for(let r=0;r<t.length;r++){let i=t[r];for(let s=i.childCount-1;s>=0;s--){let{rowspan:a,colspan:l}=i.child(s).attrs;for(let u=r;u<r+a;u++)n[u]=(n[u]||0)+l}}let o=0;for(let r=0;r<n.length;r++)o=Math.max(o,n[r]);for(let r=0;r<n.length;r++)if(r>=t.length&&t.push(M.empty),n[r]<o){let i=Nt(e).cell.createAndFill(),s=[];for(let a=n[r];a<o;a++)s.push(i);t[r]=t[r].append(M.from(s))}return{height:t.length,width:o,rows:t}}function Gy(e,t){let n=e.createAndFill();return new Jn(n).replace(0,n.content.size,t).doc}function A9({width:e,height:t,rows:n},o,r){if(e!=o){let i=[],s=[];for(let a=0;a<n.length;a++){let l=n[a],u=[];for(let c=i[a]||0,d=0;c<o;d++){let f=l.child(d%l.childCount);c+f.attrs.colspan>o&&(f=f.type.createChecked(Co(f.attrs,f.attrs.colspan,c+f.attrs.colspan-o),f.content)),u.push(f),c+=f.attrs.colspan;for(let h=1;h<f.attrs.rowspan;h++)i[a+h]=(i[a+h]||0)+f.attrs.colspan}s.push(M.from(u))}n=s,e=o}if(t!=r){let i=[];for(let s=0,a=0;s<r;s++,a++){let l=[],u=n[a%t];for(let c=0;c<u.childCount;c++){let d=u.child(c);s+d.attrs.rowspan>r&&(d=d.type.create({...d.attrs,rowspan:Math.max(1,r-d.attrs.rowspan)},d.content)),l.push(d)}i.push(M.from(l))}n=i,t=r}return{width:e,height:t,rows:n}}function M9(e,t,n,o,r,i,s){let a=e.doc.type.schema,l=Nt(a),u,c;if(r>t.width)for(let d=0,f=0;d<t.height;d++){let h=n.child(d);f+=h.nodeSize;let p=[],m;h.lastChild==null||h.lastChild.type==l.cell?m=u||(u=l.cell.createAndFill()):m=c||(c=l.header_cell.createAndFill());for(let g=t.width;g<r;g++)p.push(m);e.insert(e.mapping.slice(s).map(f-1+o),p)}if(i>t.height){let d=[];for(let p=0,m=(t.height-1)*t.width;p<Math.max(t.width,r);p++){let g=p>=t.width?!1:n.nodeAt(t.map[m+p]).type==l.header_cell;d.push(g?c||(c=l.header_cell.createAndFill()):u||(u=l.cell.createAndFill()))}let f=l.row.create(null,M.from(d)),h=[];for(let p=t.height;p<i;p++)h.push(f);e.insert(e.mapping.slice(s).map(o+n.nodeSize-2),h)}return!!(u||c)}function _A(e,t,n,o,r,i,s,a){if(s==0||s==t.height)return!1;let l=!1;for(let u=r;u<i;u++){let c=s*t.width+u,d=t.map[c];if(t.map[c-t.width]==d){l=!0;let f=n.nodeAt(d),{top:h,left:p}=t.findCell(d);e.setNodeMarkup(e.mapping.slice(a).map(d+o),null,{...f.attrs,rowspan:s-h}),e.insert(e.mapping.slice(a).map(t.positionAt(s,p,n)),f.type.createAndFill({...f.attrs,rowspan:h+f.attrs.rowspan-s})),u+=f.attrs.colspan-1}}return l}function EA(e,t,n,o,r,i,s,a){if(s==0||s==t.width)return!1;let l=!1;for(let u=r;u<i;u++){let c=u*t.width+s,d=t.map[c];if(t.map[c-1]==d){l=!0;let f=n.nodeAt(d),h=t.colCount(d),p=e.mapping.slice(a).map(d+o);e.setNodeMarkup(p,null,Co(f.attrs,s-h,f.attrs.colspan-(s-h))),e.insert(p+f.nodeSize,f.type.createAndFill(Co(f.attrs,0,s-h))),u+=f.attrs.rowspan-1}}return l}function CA(e,t,n,o,r){let i=n?e.doc.nodeAt(n-1):e.doc;if(!i)throw new Error("No table found");let s=Je.get(i),{top:a,left:l}=o,u=l+r.width,c=a+r.height,d=e.tr,f=0;function h(){if(i=n?d.doc.nodeAt(n-1):d.doc,!i)throw new Error("No table found");s=Je.get(i),f=d.mapping.maps.length}M9(d,s,i,n,u,c,f)&&h(),_A(d,s,i,n,l,u,a,f)&&h(),_A(d,s,i,n,l,u,c,f)&&h(),EA(d,s,i,n,a,c,l,f)&&h(),EA(d,s,i,n,a,c,u,f)&&h();for(let p=a;p<c;p++){let m=s.positionAt(p,l,i),g=s.positionAt(p,u,i);d.replace(d.mapping.slice(f).map(m+n),d.mapping.slice(f).map(g+n),new F(r.rows[p-a],0,0))}h(),d.setSelection(new je(d.doc.resolve(n+s.positionAt(a,l,i)),d.doc.resolve(n+s.positionAt(c-1,u-1,i)))),t(d)}var $9=Fa({ArrowLeft:xf("horiz",-1),ArrowRight:xf("horiz",1),ArrowUp:xf("vert",-1),ArrowDown:xf("vert",1),"Shift-ArrowLeft":kf("horiz",-1),"Shift-ArrowRight":kf("horiz",1),"Shift-ArrowUp":kf("vert",-1),"Shift-ArrowDown":kf("vert",1),Backspace:vf,"Mod-Backspace":vf,Delete:vf,"Mod-Delete":vf});function wf(e,t,n){return n.eq(e.selection)?!1:(t&&t(e.tr.setSelection(n).scrollIntoView()),!0)}function xf(e,t){return(n,o,r)=>{if(!r)return!1;let i=n.selection;if(i instanceof je)return wf(n,o,Q.near(i.$headCell,t));if(e!="horiz"&&!i.empty)return!1;let s=VA(r,e,t);if(s==null)return!1;if(e=="horiz")return wf(n,o,Q.near(n.doc.resolve(i.head+t),t));{let a=n.doc.resolve(s),l=IA(a,e,t),u;return l?u=Q.near(l,1):t<0?u=Q.near(n.doc.resolve(a.before(-1)),-1):u=Q.near(n.doc.resolve(a.after(-1)),1),wf(n,o,u)}}}function kf(e,t){return(n,o,r)=>{if(!r)return!1;let i=n.selection,s;if(i instanceof je)s=i;else{let l=VA(r,e,t);if(l==null)return!1;s=new je(n.doc.resolve(l))}let a=IA(s.$headCell,e,t);return a?wf(n,o,new je(s.$anchorCell,a)):!1}}function I9(e,t){let n=e.state.doc,o=Eo(n.resolve(t));return o?(e.dispatch(e.state.tr.setSelection(new je(o))),!0):!1}function D9(e,t,n){if(!yn(e.state))return!1;let o=C9(n),r=e.state.selection;if(r instanceof je){o||(o={width:1,height:1,rows:[M.from(Gy(Nt(e.state.schema).cell,n))]});let i=r.$anchorCell.node(-1),s=r.$anchorCell.start(-1),a=Je.get(i).rectBetween(r.$anchorCell.pos-s,r.$headCell.pos-s);return o=A9(o,a.right-a.left,a.bottom-a.top),CA(e.state,e.dispatch,s,a,o),!0}else if(o){let i=_f(e.state),s=i.start(-1);return CA(e.state,e.dispatch,s,Je.get(i.node(-1)).findCell(i.pos-s),o),!0}else return!1}function N9(e,t){var n;if(t.button!=0||t.ctrlKey||t.metaKey)return;let o=TA(e,t.target),r;if(t.shiftKey&&e.state.selection instanceof je)i(e.state.selection.$anchorCell,t),t.preventDefault();else if(t.shiftKey&&o&&(r=Eo(e.state.selection.$anchor))!=null&&((n=Vy(e,t))===null||n===void 0?void 0:n.pos)!=r.pos)i(r,t),t.preventDefault();else if(!o)return;function i(l,u){let c=Vy(e,u),d=zr.getState(e.state)==null;if(!c||!Xy(l,c))if(d)c=l;else return;let f=new je(l,c);if(d||!e.state.selection.eq(f)){let h=e.state.tr.setSelection(f);d&&h.setMeta(zr,l.pos),e.dispatch(h)}}function s(){e.root.removeEventListener("mouseup",s),e.root.removeEventListener("dragstart",s),e.root.removeEventListener("mousemove",a),zr.getState(e.state)!=null&&e.dispatch(e.state.tr.setMeta(zr,-1))}function a(l){let u=l,c=zr.getState(e.state),d;if(c!=null)d=e.state.doc.resolve(c);else if(TA(e,u.target)!=o&&(d=Vy(e,t),!d))return s();d&&i(d,u)}e.root.addEventListener("mouseup",s),e.root.addEventListener("dragstart",s),e.root.addEventListener("mousemove",a)}function VA(e,t,n){if(!(e.state.selection instanceof Z))return null;let{$head:o}=e.state.selection;for(let r=o.depth-1;r>=0;r--){let i=o.node(r);if((n<0?o.index(r):o.indexAfter(r))!=(n<0?0:i.childCount))return null;if(i.type.spec.tableRole=="cell"||i.type.spec.tableRole=="header_cell"){let s=o.before(r),a=t=="vert"?n>0?"down":"up":n>0?"right":"left";return e.endOfTextblock(a)?s:null}}return null}function TA(e,t){for(;t&&t!=e.dom;t=t.parentNode)if(t.nodeName=="TD"||t.nodeName=="TH")return t;return null}function Vy(e,t){let n=e.posAtCoords({left:t.clientX,top:t.clientY});if(!n)return null;let{inside:o,pos:r}=n;return o>=0&&Eo(e.state.doc.resolve(o))||Eo(e.state.doc.resolve(r))}var z9=class{constructor(e,t){this.node=e,this.defaultCellMinWidth=t,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.table.style.setProperty("--default-cell-min-width",`${t}px`),this.colgroup=this.table.appendChild(document.createElement("colgroup")),Qy(e,this.colgroup,this.table,t),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(e){return e.type!=this.node.type?!1:(this.node=e,Qy(e,this.colgroup,this.table,this.defaultCellMinWidth),!0)}ignoreMutation(e){return e.type=="attributes"&&(e.target==this.table||this.colgroup.contains(e.target))}};function Qy(e,t,n,o,r,i){let s=0,a=!0,l=t.firstChild,u=e.firstChild;if(u){for(let d=0,f=0;d<u.childCount;d++){let{colspan:h,colwidth:p}=u.child(d).attrs;for(let m=0;m<h;m++,f++){let g=r==f?i:p&&p[m],b=g?g+"px":"";if(s+=g||o,g||(a=!1),l)l.style.width!=b&&(l.style.width=b),l=l.nextSibling;else{let y=document.createElement("col");y.style.width=b,t.appendChild(y)}}}for(;l;){var c;let d=l.nextSibling;(c=l.parentNode)===null||c===void 0||c.removeChild(l),l=d}a?(n.style.width=s+"px",n.style.minWidth=""):(n.style.width="",n.style.minWidth=s+"px")}}var Qt=new ke("tableColumnResizing");function WA({handleWidth:e=5,cellMinWidth:t=25,defaultCellMinWidth:n=100,View:o=z9,lastColumnResizable:r=!0}={}){let i=new de({key:Qt,state:{init(s,a){var l;let u=(l=i.spec)===null||l===void 0||(l=l.props)===null||l===void 0?void 0:l.nodeViews,c=Nt(a.schema).table.name;return o&&u&&(u[c]=(d,f)=>new o(d,n,f)),new O9(-1,!1)},apply(s,a){return a.apply(s)}},props:{attributes:s=>{let a=Qt.getState(s);return a&&a.activeHandle>-1?{class:"resize-cursor"}:{}},handleDOMEvents:{mousemove:(s,a)=>{R9(s,a,e,r)},mouseleave:s=>{P9(s)},mousedown:(s,a)=>{L9(s,a,t,n)}},decorations:s=>{let a=Qt.getState(s);if(a&&a.activeHandle>-1)return H9(s,a.activeHandle)},nodeViews:{}}});return i}var O9=class Sf{constructor(t,n){this.activeHandle=t,this.dragging=n}apply(t){let n=this,o=t.getMeta(Qt);if(o&&o.setHandle!=null)return new Sf(o.setHandle,!1);if(o&&o.setDragging!==void 0)return new Sf(n.activeHandle,o.setDragging);if(n.activeHandle>-1&&t.docChanged){let r=t.mapping.map(n.activeHandle,-1);return Jy(t.doc.resolve(r))||(r=-1),new Sf(r,n.dragging)}return n}};function R9(e,t,n,o){if(!e.editable)return;let r=Qt.getState(e.state);if(r&&!r.dragging){let i=j9(t.target),s=-1;if(i){let{left:a,right:l}=i.getBoundingClientRect();t.clientX-a<=n?s=AA(e,t,"left",n):l-t.clientX<=n&&(s=AA(e,t,"right",n))}if(s!=r.activeHandle){if(!o&&s!==-1){let a=e.state.doc.resolve(s),l=a.node(-1),u=Je.get(l),c=a.start(-1);if(u.colCount(a.pos-c)+a.nodeAfter.attrs.colspan-1==u.width-1)return}KA(e,s)}}}function P9(e){if(!e.editable)return;let t=Qt.getState(e.state);t&&t.activeHandle>-1&&!t.dragging&&KA(e,-1)}function L9(e,t,n,o){var r;if(!e.editable)return!1;let i=(r=e.dom.ownerDocument.defaultView)!==null&&r!==void 0?r:window,s=Qt.getState(e.state);if(!s||s.activeHandle==-1||s.dragging)return!1;let a=e.state.doc.nodeAt(s.activeHandle),l=F9(e,s.activeHandle,a.attrs);e.dispatch(e.state.tr.setMeta(Qt,{setDragging:{startX:t.clientX,startWidth:l}}));function u(d){i.removeEventListener("mouseup",u),i.removeEventListener("mousemove",c);let f=Qt.getState(e.state);f?.dragging&&(B9(e,f.activeHandle,MA(f.dragging,d,n)),e.dispatch(e.state.tr.setMeta(Qt,{setDragging:null})))}function c(d){if(!d.which)return u(d);let f=Qt.getState(e.state);if(f&&f.dragging){let h=MA(f.dragging,d,n);$A(e,f.activeHandle,h,o)}}return $A(e,s.activeHandle,l,o),i.addEventListener("mouseup",u),i.addEventListener("mousemove",c),t.preventDefault(),!0}function F9(e,t,{colspan:n,colwidth:o}){let r=o&&o[o.length-1];if(r)return r;let i=e.domAtPos(t),s=i.node.childNodes[i.offset].offsetWidth,a=n;if(o)for(let l=0;l<n;l++)o[l]&&(s-=o[l],a--);return s/a}function j9(e){for(;e&&e.nodeName!="TD"&&e.nodeName!="TH";)e=e.classList&&e.classList.contains("ProseMirror")?null:e.parentNode;return e}function AA(e,t,n,o){let r=n=="right"?-o:o,i=e.posAtCoords({left:t.clientX+r,top:t.clientY});if(!i)return-1;let{pos:s}=i,a=Eo(e.state.doc.resolve(s));if(!a)return-1;if(n=="right")return a.pos;let l=Je.get(a.node(-1)),u=a.start(-1),c=l.map.indexOf(a.pos-u);return c%l.width==0?-1:u+l.map[c-1]}function MA(e,t,n){let o=t.clientX-e.startX;return Math.max(n,e.startWidth+o)}function KA(e,t){e.dispatch(e.state.tr.setMeta(Qt,{setHandle:t}))}function B9(e,t,n){let o=e.state.doc.resolve(t),r=o.node(-1),i=Je.get(r),s=o.start(-1),a=i.colCount(o.pos-s)+o.nodeAfter.attrs.colspan-1,l=e.state.tr;for(let u=0;u<i.height;u++){let c=u*i.width+a;if(u&&i.map[c]==i.map[c-i.width])continue;let d=i.map[c],f=r.nodeAt(d).attrs,h=f.colspan==1?0:a-i.colCount(d);if(f.colwidth&&f.colwidth[h]==n)continue;let p=f.colwidth?f.colwidth.slice():U9(f.colspan);p[h]=n,l.setNodeMarkup(s+d,null,{...f,colwidth:p})}l.docChanged&&e.dispatch(l)}function $A(e,t,n,o){let r=e.state.doc.resolve(t),i=r.node(-1),s=r.start(-1),a=Je.get(i).colCount(r.pos-s)+r.nodeAfter.attrs.colspan-1,l=e.domAtPos(r.start(-1)).node;for(;l&&l.nodeName!="TABLE";)l=l.parentNode;l&&Qy(i,l.firstChild,l,o,a,n)}function U9(e){return Array(e).fill(0)}function H9(e,t){let n=[],o=e.doc.resolve(t),r=o.node(-1);if(!r)return Te.empty;let i=Je.get(r),s=o.start(-1),a=i.colCount(o.pos-s)+o.nodeAfter.attrs.colspan-1;for(let u=0;u<i.height;u++){let c=a+u*i.width;if((a==i.width-1||i.map[c]!=i.map[c+1])&&(u==0||i.map[c]!=i.map[c-i.width])){var l;let d=i.map[c],f=s+d+r.nodeAt(d).nodeSize-1,h=document.createElement("div");h.className="column-resize-handle",!((l=Qt.getState(e))===null||l===void 0)&&l.dragging&&n.push(ft.node(s+d,s+d+r.nodeAt(d).nodeSize,{class:"column-resize-dragging"})),n.push(ft.widget(f,h))}}return Te.create(e.doc,n)}function JA({allowTableNodeSelection:e=!1}={}){return new de({key:zr,state:{init(){return null},apply(t,n){let o=t.getMeta(zr);if(o!=null)return o==-1?null:o;if(n==null||!t.docChanged)return n;let{deleted:r,pos:i}=t.mapping.mapResult(n);return r?null:i}},props:{decorations:p9,handleDOMEvents:{mousedown:N9},createSelectionBetween(t){return zr.getState(t.state)!=null?t.state.selection:null},handleTripleClick:I9,handleKeyDown:$9,handlePaste:D9},appendTransaction(t,n,o){return g9(o,Yy(o,n),e)}})}function tl(e){return e==="left"||e==="right"||e==="center"?e:null}function q9(e){let t=(e.style.textAlign||"").trim().toLowerCase(),n=(e.getAttribute("align")||"").trim().toLowerCase();return tl(t||n)}function Z9(e){return tl(e?.align)}function eM(){return{default:null,parseHTML:e=>q9(e),renderHTML:e=>{let t=tl(e.align);return qC(t)?{style:`text-align: ${t}`}:{}}}}function V9(e){var t;let n=e.parentElement,o=e.closest("table");if(!n||!o)return null;let r=Array.from(n.children).indexOf(e),i=(t=o.querySelectorAll("colgroup > col")[r])===null||t===void 0?void 0:t.getAttribute("width");return i?[parseInt(i,10)]:null}function tM(e){let t=e.getAttribute("colwidth");return t?t.split(",").map(n=>parseInt(n,10)):V9(e)}var W9=/[ \t\r\n\f]+/g;function nM(e){var t;return e.children.length>0?!1:((t=e.textContent)!==null&&t!==void 0?t:"").replace(W9,"")===""}function rM(e){let t=e.createAndFill();if(!t)throw new Error(`[tiptap error]: "${e.name}" has no default content to backfill.`);return t.content}function Cf(e,t,n){if(!(n in t))return;let o=t[n];(o===1||o==="1"||o===null||o===void 0)&&delete e[n]}var nl=ce.create({name:"tableCell",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:tM},align:eM()}},tableRole:"cell",isolating:!0,parseHTML(){return[{tag:"td",getAttrs:e=>nM(e)?{}:!1,getContent:(e,t)=>rM(t.nodes[this.name])},{tag:"td"}]},renderHTML({HTMLAttributes:e}){let t=fe(this.options.HTMLAttributes,e);return Cf(t,e,"colspan"),Cf(t,e,"rowspan"),["td",t,0]}}),rl=ce.create({name:"tableHeader",addOptions(){return{HTMLAttributes:{}}},content:"block+",addAttributes(){return{colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:tM},align:eM()}},tableRole:"header_cell",isolating:!0,parseHTML(){return[{tag:"th",getAttrs:e=>nM(e)?{}:!1,getContent:(e,t)=>rM(t.nodes[this.name])},{tag:"th"}]},renderHTML({HTMLAttributes:e}){let t=fe(this.options.HTMLAttributes,e);return Cf(t,e,"colspan"),Cf(t,e,"rowspan"),["th",t,0]}}),ol=ce.create({name:"tableRow",addOptions(){return{HTMLAttributes:{}}},content:"(tableCell | tableHeader)*",tableRole:"row",parseHTML(){return[{tag:"tr"}]},renderHTML({HTMLAttributes:e}){return["tr",fe(this.options.HTMLAttributes,e),0]}});function r1(e,t){return t?["width",`${Math.max(t,e)}px`]:["min-width",`${e}px`]}function GA(e,t,n,o,r,i){let s=0,a=!0,l=t.firstChild,u=e.firstChild;if(u!==null)for(let f=0,h=0;f<u.childCount;f+=1){let{colspan:p,colwidth:m}=u.child(f).attrs;for(let g=0;g<p;g+=1,h+=1){let b=r===h?i:m&&m[g],y=b?`${b}px`:"";if(s+=b||o,b||(a=!1),l){if(l.style.width!==y){let[k,x]=r1(o,b);l.style.setProperty(k,x)}l=l.nextSibling}else{let k=document.createElement("col"),[x,E]=r1(o,b);k.style.setProperty(x,E),t.appendChild(k)}}}for(;l;){var c;let f=l.nextSibling;(c=l.parentNode)===null||c===void 0||c.removeChild(l),l=f}let d=e.attrs.style&&typeof e.attrs.style=="string"&&/\bwidth\s*:/i.test(e.attrs.style);a&&!d?(n.style.width=`${s}px`,n.style.minWidth=""):(n.style.width="",n.style.minWidth=`${s}px`)}var K9=class{constructor(e,t,n,o={}){this.node=e,this.cellMinWidth=t,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table"));for(let[r,i]of Object.entries(o))i!=null&&(r==="style"?this.table.style.cssText=String(i):this.table.setAttribute(r,String(i)));e.attrs.style&&(this.table.style.cssText=e.attrs.style),this.colgroup=this.table.appendChild(document.createElement("colgroup")),GA(e,this.colgroup,this.table,t),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(e){return e.sameMarkup(this.node)?(this.node=e,GA(e,this.colgroup,this.table,this.cellMinWidth),!0):!1}ignoreMutation(e){let t=e.target,n=this.dom.contains(t),o=this.contentDOM.contains(t);return!!(n&&!o&&(e.type==="attributes"||e.type==="childList"||e.type==="characterData"))}};function J9(e,t,n,o){let r=0,i=!0,s=[],a=e.firstChild;if(!a)return{};for(let c=0,d=0;c<a.childCount;c+=1){let{colspan:f,colwidth:h}=a.child(c).attrs;for(let p=0;p<f;p+=1,d+=1){let m=n===d?o:h&&h[p];r+=m||t,m||(i=!1);let[g,b]=r1(t,m);s.push(["col",{style:`${g}: ${b}`}])}}let l=i?`${r}px`:"",u=i?"":`${r}px`;return{colgroup:["colgroup",{},...s],tableWidth:l,tableMinWidth:u}}function QA(e,t){return t?e.createChecked(null,t):e.createAndFill()}function G9(e){if(e.cached.tableNodeTypes)return e.cached.tableNodeTypes;let t={};return Object.keys(e.nodes).forEach(n=>{let o=e.nodes[n];o.spec.tableRole&&(t[o.spec.tableRole]=o)}),e.cached.tableNodeTypes=t,t}function Q9(e,t,n,o,r){let i=G9(e),s=[],a=[];for(let u=0;u<n;u+=1){let c=QA(i.cell,r);if(c&&a.push(c),o){let d=QA(i.header_cell,r);d&&s.push(d)}}let l=[];for(let u=0;u<t;u+=1)l.push(i.row.createChecked(null,o&&u===0?s:a));return i.table.createChecked(null,l)}function oM(e){return e instanceof je}var Ef=({editor:e})=>{let{selection:t}=e.state;if(!oM(t))return!1;let n=0,o=Zi(t.ranges[0].$from,r=>r.type.name==="table");return o?.node.descendants(r=>{if(r.type.name==="table")return!1;["tableCell","tableHeader"].includes(r.type.name)&&(n+=1)}),n!==t.ranges.length?!1:(e.commands.deleteTable(),!0)};function XA(e,t){let n=e.mapping.map(t),o=Zi(e.selection.$from,s=>s.type.name==="table");if(o?.pos===n)return;let r=e.doc.nodeAt(n);if(!r)return;let i=n+r.nodeSize-1;e.setSelection(Z.near(e.doc.resolve(i),-1))}function X9(e){let t="",n=0;for(;n<e.length;){if(e[n]==="\\"&&n+1<e.length){t+=e[n]+e[n+1],n+=2;continue}if(e[n]!=="`"){t+=e[n++];continue}let o=0;for(;n+o<e.length&&e[n+o]==="`";)o+=1;let r=n+o,i=!1;for(;r<e.length;){if(e[r]!=="`"){r+=1;continue}let s=0;for(;r+s<e.length&&e[r+s]==="`";)s+=1;if(s===o){let a=e.slice(n+o,r);t+=e.slice(n,n+o)+a.replace(/\\\||\|/g,l=>l==="|"?"\\|":l)+e.slice(r,r+o),n=r+o,i=!0;break}r+=s}i||(t+=e.slice(n,n+o),n+=o)}return t}function Y9(e){return e.split(`
`).map(t=>!t.includes("|")||!t.includes("`")?t:X9(t)).join(`
`)}function eF(e){return(e||"").replaceAll(""," ").replace(/\s+/g," ").trim()}function YA(e,t){return t?e.split(t).join(`
`):e}function tF(e){return e.replace(/\\.|\|/g,t=>t==="|"?"\\|":t)}function nF(e,t,n={}){if(!e||!e.content||e.content.length===0)return"";let o=[];e.content.forEach(f=>{let h=[];f.content&&f.content.forEach(p=>{let m="";p.content&&Array.isArray(p.content)&&p.content.length>1?m=p.content.map(k=>YA(t.renderChildren(k),n.cellLineSeparator)).join(`
`):m=YA(p.content?t.renderChildren(p.content):"",n.cellLineSeparator);let g=tF(eF(m.replace(/[ \t]*\r?\n[ \t]*/g,"<br>"))),b=p.type==="tableHeader",y=Z9(p.attrs);h.push({text:g,isHeader:b,align:y})}),o.push(h)});let r=o.reduce((f,h)=>Math.max(f,h.length),0);if(r===0)return"";let i=Array.from({length:r}).fill(0);o.forEach(f=>{for(let p=0;p<r;p+=1){var h;let m=(((h=f[p])===null||h===void 0?void 0:h.text)||"").length;m>i[p]&&(i[p]=m),i[p]<3&&(i[p]=3)}});let s=(f,h)=>f+" ".repeat(Math.max(0,h-f.length)),a=o[0],l=a.some(f=>f.isHeader),u=Array.from({length:r}).fill(null);o.forEach(f=>{for(let p=0;p<r;p+=1){var h;!u[p]&&(!((h=f[p])===null||h===void 0)&&h.align)&&(u[p]=f[p].align)}});let c=`
`,d=Array.from({length:r}).map((f,h)=>l&&a[h]&&a[h].text||"");return c+=`| ${d.map((f,h)=>s(f,i[h])).join(" | ")} |
`,c+=`| ${i.map((f,h)=>{let p=Math.max(3,f),m=u[h];return m==="left"?`:${"-".repeat(p)}`:m==="right"?`${"-".repeat(p)}:`:m==="center"?`:${"-".repeat(p)}:`:"-".repeat(p)}).join(" | ")} |
`,(l?o.slice(1):o).forEach(f=>{c+=`| ${Array.from({length:r}).fill(0).map((h,p)=>s(f[p]&&f[p].text||"",i[p])).join(" | ")} |
`}),c}var rF=new ke("preserveCellSelectionOnContextMenu");function oF(e,t){let n=e.posAtCoords({left:t.clientX,top:t.clientY});if(n)return n.pos;if(!(t.target instanceof Node))return null;try{return e.posAtDOM(t.target,0)}catch{return null}}function iF(e,t){let n=!1;return e.forEachCell((o,r)=>{t>=r&&t<r+o.nodeSize&&(n=!0)}),n}function sF(){return new de({key:rF,props:{handleDOMEvents:{mousedown(e,t){if(t.button!==2)return!1;let{selection:n}=e.state;if(!oM(n)||n.ranges.length<2)return!1;let o=oF(e,t);return o==null||!iF(n,o)?!1:(t.preventDefault(),!0)}}}})}var o1=ce.create({name:"table",addOptions(){return{HTMLAttributes:{},resizable:!1,renderWrapper:!1,handleWidth:5,cellMinWidth:25,View:K9,lastColumnResizable:!0,allowTableNodeSelection:!1}},content:"tableRow+",tableRole:"table",isolating:!0,group:"block",parseHTML(){return[{tag:"table"}]},renderHTML({node:e,HTMLAttributes:t}){let{colgroup:n,tableWidth:o,tableMinWidth:r}=J9(e,this.options.cellMinWidth),i=t.style;function s(){return i||(o?`width: ${o}`:`min-width: ${r}`)}let a=["table",fe(this.options.HTMLAttributes,t,{style:s()}),n,["tbody",0]];return this.options.renderWrapper?["div",{class:"tableWrapper"},a]:a},parseMarkdown:(e,t)=>{let n=[],o=Array.isArray(e.align)?e.align:[];if(e.header){let r=[];e.header.forEach((i,s)=>{var a;let l=tl((a=o[s])!==null&&a!==void 0?a:i.align),u=l?{align:l}:{};r.push(t.createNode("tableHeader",u,[{type:"paragraph",content:t.parseInline(i.tokens)}]))}),n.push(t.createNode("tableRow",{},r))}return e.rows&&e.rows.forEach(r=>{let i=[];r.forEach((s,a)=>{var l;let u=tl((l=o[a])!==null&&l!==void 0?l:s.align),c=u?{align:u}:{};i.push(t.createNode("tableCell",c,[{type:"paragraph",content:t.parseInline(s.tokens)}]))}),n.push(t.createNode("tableRow",{},i))}),t.createNode("table",void 0,n)},renderMarkdown:(e,t)=>nF(e,t),markdownTokenizer:{name:"table",level:"block",start:e=>{let t=e.split(`
`);if(t.length<2)return-1;let n=t[1];return!/^[ \t|:]*-[ \t|:-]*$/.test(n)||!n.includes("|")?-1:t[0].includes("|")?0:-1},tokenize(e,t,n){let o=e.indexOf(`
`),r=o>=0?e.slice(0,o):e,i=r.split(`
`);if(i.length<2)return;let s=i[1];if(!/^[ \t|:]*-[ \t|:-]*$/.test(s)||!s.includes("|"))return;let a=Y9(r);if(a===r)return;let l=n.blockTokens(a)[0];if(l?.type!=="table"||!l.raw)return;let u=l.raw.split(`
`).length,c=e.split(`
`).slice(0,u).join(`
`);return{...l,raw:c}}},addCommands(){return{insertTable:({rows:e=3,cols:t=3,withHeaderRow:n=!0}={})=>({tr:o,dispatch:r,editor:i})=>{let s=Q9(i.schema,e,t,n);if(r){let a=o.selection.from+1;o.replaceSelectionWith(s).scrollIntoView().setSelection(Z.near(o.doc.resolve(a)))}return!0},addColumnBefore:()=>({state:e,dispatch:t})=>RA(e,t),addColumnAfter:()=>({state:e,dispatch:t})=>PA(e,t),deleteColumn:()=>({state:e,dispatch:t})=>{let n=Zi(e.selection.$from,o=>o.type.name==="table");return LA(e,t&&(o=>{n&&XA(o,n.pos),t(o)}))},addRowBefore:()=>({state:e,dispatch:t})=>jA(e,t),addRowAfter:()=>({state:e,dispatch:t})=>BA(e,t),deleteRow:()=>({state:e,dispatch:t})=>{let n=Zi(e.selection.$from,o=>o.type.name==="table");return UA(e,t&&(o=>{n&&XA(o,n.pos),t(o)}))},deleteTable:()=>({state:e,dispatch:t})=>ZA(e,t),mergeCells:()=>({state:e,dispatch:t})=>e1(e,t),splitCell:()=>({state:e,dispatch:t})=>t1(e,t),toggleHeaderColumn:()=>({state:e,dispatch:t})=>ts("column")(e,t),toggleHeaderRow:()=>({state:e,dispatch:t})=>ts("row")(e,t),toggleHeaderCell:()=>({state:e,dispatch:t})=>qA(e,t),mergeOrSplit:()=>({state:e,dispatch:t})=>e1(e,t)?!0:t1(e,t),setCellAttribute:(e,t)=>({state:n,dispatch:o})=>HA(e,t)(n,o),goToNextCell:()=>({state:e,dispatch:t})=>n1(1)(e,t),goToPreviousCell:()=>({state:e,dispatch:t})=>n1(-1)(e,t),fixTables:()=>({state:e,dispatch:t})=>(t&&Yy(e),!0),setCellSelection:e=>({tr:t,dispatch:n})=>{if(n){let o=je.create(t.doc,e.anchorCell,e.headCell);t.setSelection(o)}return!0}}},addKeyboardShortcuts(){return{Tab:()=>this.editor.commands.goToNextCell()?!0:this.editor.can().addRowAfter()?this.editor.chain().addRowAfter().goToNextCell().run():!1,"Shift-Tab":()=>this.editor.commands.goToPreviousCell(),Backspace:Ef,"Mod-Backspace":Ef,Delete:Ef,"Mod-Delete":Ef}},addProseMirrorPlugins(){return[...this.options.resizable&&this.editor.isEditable?[WA({handleWidth:this.options.handleWidth,cellMinWidth:this.options.cellMinWidth,defaultCellMinWidth:this.options.cellMinWidth,View:null,lastColumnResizable:this.options.lastColumnResizable})]:[],JA({allowTableNodeSelection:this.options.allowTableNodeSelection}),sF()]},addNodeView(){let e=this.options.View;return e?({node:t,view:n,HTMLAttributes:o})=>{let r=fe(this.options.HTMLAttributes,o);return new e(t,this.options.cellMinWidth,n,r)}:null},extendNodeSchema(e){let t={name:e.name,options:e.options,storage:e.storage};return{tableRole:Ce(J(e,"tableRole",t))}}}),uY=Me.create({name:"tableKit",addExtensions(){let e=[];return this.options.table!==!1&&e.push(o1.configure(this.options.table)),this.options.tableCell!==!1&&e.push(nl.configure(this.options.tableCell)),this.options.tableHeader!==!1&&e.push(rl.configure(this.options.tableHeader)),this.options.tableRow!==!1&&e.push(ol.configure(this.options.tableRow)),e}});var f1={};en(f1,{arrayReplaceAt:()=>DF,asciiTrim:()=>Io,assign:()=>ss,escapeHtml:()=>cr,escapeRE:()=>HF,fromCodePoint:()=>as,has:()=>IF,isMdAsciiPunct:()=>Mo,isPunctChar:()=>EM,isPunctCharCode:()=>Ao,isSpace:()=>ye,isString:()=>Lf,isValidEntityCode:()=>Ff,isWhiteSpace:()=>To,lib:()=>qF,normalizeReference:()=>$o,unescapeAll:()=>ur,unescapeMd:()=>PF});var If={};en(If,{decode:()=>il,encode:()=>Mf,format:()=>ns,parse:()=>sl});var iM={};function aF(e){let t=iM[e];if(t)return t;t=iM[e]=[];for(let n=0;n<128;n++){let o=String.fromCharCode(n);t.push(o)}for(let n=0;n<e.length;n++){let o=e.charCodeAt(n);t[o]="%"+("0"+o.toString(16).toUpperCase()).slice(-2)}return t}function Tf(e,t){typeof t!="string"&&(t=Tf.defaultChars);let n=aF(t);return e.replace(/(%[a-f0-9]{2})+/gi,function(o){let r="";for(let i=0,s=o.length;i<s;i+=3){let a=parseInt(o.slice(i+1,i+3),16);if(a<128){r+=n[a];continue}if((a&224)===192&&i+3<s){let l=parseInt(o.slice(i+4,i+6),16);if((l&192)===128){let u=a<<6&1984|l&63;u<128?r+="\uFFFD\uFFFD":r+=String.fromCharCode(u),i+=3;continue}}if((a&240)===224&&i+6<s){let l=parseInt(o.slice(i+4,i+6),16),u=parseInt(o.slice(i+7,i+9),16);if((l&192)===128&&(u&192)===128){let c=a<<12&61440|l<<6&4032|u&63;c<2048||c>=55296&&c<=57343?r+="\uFFFD\uFFFD\uFFFD":r+=String.fromCharCode(c),i+=6;continue}}if((a&248)===240&&i+9<s){let l=parseInt(o.slice(i+4,i+6),16),u=parseInt(o.slice(i+7,i+9),16),c=parseInt(o.slice(i+10,i+12),16);if((l&192)===128&&(u&192)===128&&(c&192)===128){let d=a<<18&1835008|l<<12&258048|u<<6&4032|c&63;d<65536||d>1114111?r+="\uFFFD\uFFFD\uFFFD\uFFFD":(d-=65536,r+=String.fromCharCode(55296+(d>>10),56320+(d&1023))),i+=9;continue}}r+="\uFFFD"}return r})}Tf.defaultChars=";/?:@&=+$,#";Tf.componentChars="";var il=Tf;var sM={};function lF(e){let t=sM[e];if(t)return t;t=sM[e]=[];for(let n=0;n<128;n++){let o=String.fromCharCode(n);/^[0-9a-z]$/i.test(o)?t.push(o):t.push("%"+("0"+n.toString(16).toUpperCase()).slice(-2))}for(let n=0;n<e.length;n++)t[e.charCodeAt(n)]=e[n];return t}function Af(e,t,n){typeof t!="string"&&(n=t,t=Af.defaultChars),typeof n>"u"&&(n=!0);let o=lF(t),r="";for(let i=0,s=e.length;i<s;i++){let a=e.charCodeAt(i);if(n&&a===37&&i+2<s&&/^[0-9a-f]{2}$/i.test(e.slice(i+1,i+3))){r+=e.slice(i,i+3),i+=2;continue}if(a<128){r+=o[a];continue}if(a>=55296&&a<=57343){if(a>=55296&&a<=56319&&i+1<s){let l=e.charCodeAt(i+1);if(l>=56320&&l<=57343){r+=encodeURIComponent(e[i]+e[i+1]),i++;continue}}r+="%EF%BF%BD";continue}r+=encodeURIComponent(e[i])}return r}Af.defaultChars=";/?:@&=+$,-_.!~*'()#";Af.componentChars="-_.!~*'()";var Mf=Af;function ns(e){let t="";return t+=e.protocol||"",t+=e.slashes?"//":"",t+=e.auth?e.auth+"@":"",e.hostname&&e.hostname.indexOf(":")!==-1?t+="["+e.hostname+"]":t+=e.hostname||"",t+=e.port?":"+e.port:"",t+=e.pathname||"",t+=e.search||"",t+=e.hash||"",t}function $f(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}var uF=/^([a-z0-9.+-]+:)/i,cF=/:[0-9]*$/,dF=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,fF=["<",">",'"',"`"," ","\r",`
`," "],pF=["{","}","|","\\","^","`"].concat(fF),hF=["'"].concat(pF),aM=["%","/","?",";","#"].concat(hF),lM=["/","?","#"],mF=255,uM=/^[+a-z0-9A-Z_-]{0,63}$/,gF=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,cM={javascript:!0,"javascript:":!0},dM={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function bF(e,t){if(e&&e instanceof $f)return e;let n=new $f;return n.parse(e,t),n}$f.prototype.parse=function(e,t){let n,o,r,i=e;if(i=i.trim(),!t&&e.split("#").length===1){let u=dF.exec(i);if(u)return this.pathname=u[1],u[2]&&(this.search=u[2]),this}let s=uF.exec(i);if(s&&(s=s[0],n=s.toLowerCase(),this.protocol=s,i=i.substr(s.length)),(t||s||i.match(/^\/\/[^@\/]+@[^@\/]+/))&&(r=i.substr(0,2)==="//",r&&!(s&&cM[s])&&(i=i.substr(2),this.slashes=!0)),!cM[s]&&(r||s&&!dM[s])){let u=-1;for(let p=0;p<lM.length;p++)o=i.indexOf(lM[p]),o!==-1&&(u===-1||o<u)&&(u=o);let c,d;u===-1?d=i.lastIndexOf("@"):d=i.lastIndexOf("@",u),d!==-1&&(c=i.slice(0,d),i=i.slice(d+1),this.auth=c),u=-1;for(let p=0;p<aM.length;p++)o=i.indexOf(aM[p]),o!==-1&&(u===-1||o<u)&&(u=o);u===-1&&(u=i.length),i[u-1]===":"&&u--;let f=i.slice(0,u);i=i.slice(u),this.parseHost(f),this.hostname=this.hostname||"";let h=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!h){let p=this.hostname.split(/\./);for(let m=0,g=p.length;m<g;m++){let b=p[m];if(b&&!b.match(uM)){let y="";for(let k=0,x=b.length;k<x;k++)b.charCodeAt(k)>127?y+="x":y+=b[k];if(!y.match(uM)){let k=p.slice(0,m),x=p.slice(m+1),E=b.match(gF);E&&(k.push(E[1]),x.unshift(E[2])),x.length&&(i=x.join(".")+i),this.hostname=k.join(".");break}}}}this.hostname.length>mF&&(this.hostname=""),h&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}let a=i.indexOf("#");a!==-1&&(this.hash=i.substr(a),i=i.slice(0,a));let l=i.indexOf("?");return l!==-1&&(this.search=i.substr(l),i=i.slice(0,l)),i&&(this.pathname=i),dM[n]&&this.hostname&&!this.pathname&&(this.pathname=""),this};$f.prototype.parseHost=function(e){let t=cF.exec(e);t&&(t=t[0],t!==":"&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)};var sl=bF;var i1={};en(i1,{Any:()=>Df,Cc:()=>Nf,Cf:()=>fM,P:()=>rs,S:()=>zf,Z:()=>Of});var Df=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;var Nf=/[\0-\x1F\x7F-\x9F]/;var fM=/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u0890\u0891\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD80D[\uDC30-\uDC3F]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/;var rs=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDEAD\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/;var zf=/[\$\+<->\^`\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u0888\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20C0\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B97-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uAB6A\uAB6B\uFB29\uFBB2-\uFBC2\uFD40-\uFD4F\uFDCF\uFDFC-\uFDFF\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD833[\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD838[\uDD4F\uDEFF]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED7\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDF76\uDF7B-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0\uDCB1\uDD00-\uDE53\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC5\uDECE-\uDEDB\uDEE0-\uDEE8\uDEF0-\uDEF8\uDF00-\uDF92\uDF94-\uDFCA]/;var Of=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/;var pM=new Uint16Array('\u1D41<\xD5\u0131\u028A\u049D\u057B\u05D0\u0675\u06DE\u07A2\u07D6\u080F\u0A4A\u0A91\u0DA1\u0E6D\u0F09\u0F26\u10CA\u1228\u12E1\u1415\u149D\u14C3\u14DF\u1525\0\0\0\0\0\0\u156B\u16CD\u198D\u1C12\u1DDD\u1F7E\u2060\u21B0\u228D\u23C0\u23FB\u2442\u2824\u2912\u2D08\u2E48\u2FCE\u3016\u32BA\u3639\u37AC\u38FE\u3A28\u3A71\u3AE0\u3B2E\u0800EMabcfglmnoprstu\\bfms\x7F\x84\x8B\x90\x95\x98\xA6\xB3\xB9\xC8\xCFlig\u803B\xC6\u40C6P\u803B&\u4026cute\u803B\xC1\u40C1reve;\u4102\u0100iyx}rc\u803B\xC2\u40C2;\u4410r;\uC000\u{1D504}rave\u803B\xC0\u40C0pha;\u4391acr;\u4100d;\u6A53\u0100gp\x9D\xA1on;\u4104f;\uC000\u{1D538}plyFunction;\u6061ing\u803B\xC5\u40C5\u0100cs\xBE\xC3r;\uC000\u{1D49C}ign;\u6254ilde\u803B\xC3\u40C3ml\u803B\xC4\u40C4\u0400aceforsu\xE5\xFB\xFE\u0117\u011C\u0122\u0127\u012A\u0100cr\xEA\xF2kslash;\u6216\u0176\xF6\xF8;\u6AE7ed;\u6306y;\u4411\u0180crt\u0105\u010B\u0114ause;\u6235noullis;\u612Ca;\u4392r;\uC000\u{1D505}pf;\uC000\u{1D539}eve;\u42D8c\xF2\u0113mpeq;\u624E\u0700HOacdefhilorsu\u014D\u0151\u0156\u0180\u019E\u01A2\u01B5\u01B7\u01BA\u01DC\u0215\u0273\u0278\u027Ecy;\u4427PY\u803B\xA9\u40A9\u0180cpy\u015D\u0162\u017Aute;\u4106\u0100;i\u0167\u0168\u62D2talDifferentialD;\u6145leys;\u612D\u0200aeio\u0189\u018E\u0194\u0198ron;\u410Cdil\u803B\xC7\u40C7rc;\u4108nint;\u6230ot;\u410A\u0100dn\u01A7\u01ADilla;\u40B8terDot;\u40B7\xF2\u017Fi;\u43A7rcle\u0200DMPT\u01C7\u01CB\u01D1\u01D6ot;\u6299inus;\u6296lus;\u6295imes;\u6297o\u0100cs\u01E2\u01F8kwiseContourIntegral;\u6232eCurly\u0100DQ\u0203\u020FoubleQuote;\u601Duote;\u6019\u0200lnpu\u021E\u0228\u0247\u0255on\u0100;e\u0225\u0226\u6237;\u6A74\u0180git\u022F\u0236\u023Aruent;\u6261nt;\u622FourIntegral;\u622E\u0100fr\u024C\u024E;\u6102oduct;\u6210nterClockwiseContourIntegral;\u6233oss;\u6A2Fcr;\uC000\u{1D49E}p\u0100;C\u0284\u0285\u62D3ap;\u624D\u0580DJSZacefios\u02A0\u02AC\u02B0\u02B4\u02B8\u02CB\u02D7\u02E1\u02E6\u0333\u048D\u0100;o\u0179\u02A5trahd;\u6911cy;\u4402cy;\u4405cy;\u440F\u0180grs\u02BF\u02C4\u02C7ger;\u6021r;\u61A1hv;\u6AE4\u0100ay\u02D0\u02D5ron;\u410E;\u4414l\u0100;t\u02DD\u02DE\u6207a;\u4394r;\uC000\u{1D507}\u0100af\u02EB\u0327\u0100cm\u02F0\u0322ritical\u0200ADGT\u0300\u0306\u0316\u031Ccute;\u40B4o\u0174\u030B\u030D;\u42D9bleAcute;\u42DDrave;\u4060ilde;\u42DCond;\u62C4ferentialD;\u6146\u0470\u033D\0\0\0\u0342\u0354\0\u0405f;\uC000\u{1D53B}\u0180;DE\u0348\u0349\u034D\u40A8ot;\u60DCqual;\u6250ble\u0300CDLRUV\u0363\u0372\u0382\u03CF\u03E2\u03F8ontourIntegra\xEC\u0239o\u0274\u0379\0\0\u037B\xBB\u0349nArrow;\u61D3\u0100eo\u0387\u03A4ft\u0180ART\u0390\u0396\u03A1rrow;\u61D0ightArrow;\u61D4e\xE5\u02CAng\u0100LR\u03AB\u03C4eft\u0100AR\u03B3\u03B9rrow;\u67F8ightArrow;\u67FAightArrow;\u67F9ight\u0100AT\u03D8\u03DErrow;\u61D2ee;\u62A8p\u0241\u03E9\0\0\u03EFrrow;\u61D1ownArrow;\u61D5erticalBar;\u6225n\u0300ABLRTa\u0412\u042A\u0430\u045E\u047F\u037Crrow\u0180;BU\u041D\u041E\u0422\u6193ar;\u6913pArrow;\u61F5reve;\u4311eft\u02D2\u043A\0\u0446\0\u0450ightVector;\u6950eeVector;\u695Eector\u0100;B\u0459\u045A\u61BDar;\u6956ight\u01D4\u0467\0\u0471eeVector;\u695Fector\u0100;B\u047A\u047B\u61C1ar;\u6957ee\u0100;A\u0486\u0487\u62A4rrow;\u61A7\u0100ct\u0492\u0497r;\uC000\u{1D49F}rok;\u4110\u0800NTacdfglmopqstux\u04BD\u04C0\u04C4\u04CB\u04DE\u04E2\u04E7\u04EE\u04F5\u0521\u052F\u0536\u0552\u055D\u0560\u0565G;\u414AH\u803B\xD0\u40D0cute\u803B\xC9\u40C9\u0180aiy\u04D2\u04D7\u04DCron;\u411Arc\u803B\xCA\u40CA;\u442Dot;\u4116r;\uC000\u{1D508}rave\u803B\xC8\u40C8ement;\u6208\u0100ap\u04FA\u04FEcr;\u4112ty\u0253\u0506\0\0\u0512mallSquare;\u65FBerySmallSquare;\u65AB\u0100gp\u0526\u052Aon;\u4118f;\uC000\u{1D53C}silon;\u4395u\u0100ai\u053C\u0549l\u0100;T\u0542\u0543\u6A75ilde;\u6242librium;\u61CC\u0100ci\u0557\u055Ar;\u6130m;\u6A73a;\u4397ml\u803B\xCB\u40CB\u0100ip\u056A\u056Fsts;\u6203onentialE;\u6147\u0280cfios\u0585\u0588\u058D\u05B2\u05CCy;\u4424r;\uC000\u{1D509}lled\u0253\u0597\0\0\u05A3mallSquare;\u65FCerySmallSquare;\u65AA\u0370\u05BA\0\u05BF\0\0\u05C4f;\uC000\u{1D53D}All;\u6200riertrf;\u6131c\xF2\u05CB\u0600JTabcdfgorst\u05E8\u05EC\u05EF\u05FA\u0600\u0612\u0616\u061B\u061D\u0623\u066C\u0672cy;\u4403\u803B>\u403Emma\u0100;d\u05F7\u05F8\u4393;\u43DCreve;\u411E\u0180eiy\u0607\u060C\u0610dil;\u4122rc;\u411C;\u4413ot;\u4120r;\uC000\u{1D50A};\u62D9pf;\uC000\u{1D53E}eater\u0300EFGLST\u0635\u0644\u064E\u0656\u065B\u0666qual\u0100;L\u063E\u063F\u6265ess;\u62DBullEqual;\u6267reater;\u6AA2ess;\u6277lantEqual;\u6A7Eilde;\u6273cr;\uC000\u{1D4A2};\u626B\u0400Aacfiosu\u0685\u068B\u0696\u069B\u069E\u06AA\u06BE\u06CARDcy;\u442A\u0100ct\u0690\u0694ek;\u42C7;\u405Eirc;\u4124r;\u610ClbertSpace;\u610B\u01F0\u06AF\0\u06B2f;\u610DizontalLine;\u6500\u0100ct\u06C3\u06C5\xF2\u06A9rok;\u4126mp\u0144\u06D0\u06D8ownHum\xF0\u012Fqual;\u624F\u0700EJOacdfgmnostu\u06FA\u06FE\u0703\u0707\u070E\u071A\u071E\u0721\u0728\u0744\u0778\u078B\u078F\u0795cy;\u4415lig;\u4132cy;\u4401cute\u803B\xCD\u40CD\u0100iy\u0713\u0718rc\u803B\xCE\u40CE;\u4418ot;\u4130r;\u6111rave\u803B\xCC\u40CC\u0180;ap\u0720\u072F\u073F\u0100cg\u0734\u0737r;\u412AinaryI;\u6148lie\xF3\u03DD\u01F4\u0749\0\u0762\u0100;e\u074D\u074E\u622C\u0100gr\u0753\u0758ral;\u622Bsection;\u62C2isible\u0100CT\u076C\u0772omma;\u6063imes;\u6062\u0180gpt\u077F\u0783\u0788on;\u412Ef;\uC000\u{1D540}a;\u4399cr;\u6110ilde;\u4128\u01EB\u079A\0\u079Ecy;\u4406l\u803B\xCF\u40CF\u0280cfosu\u07AC\u07B7\u07BC\u07C2\u07D0\u0100iy\u07B1\u07B5rc;\u4134;\u4419r;\uC000\u{1D50D}pf;\uC000\u{1D541}\u01E3\u07C7\0\u07CCr;\uC000\u{1D4A5}rcy;\u4408kcy;\u4404\u0380HJacfos\u07E4\u07E8\u07EC\u07F1\u07FD\u0802\u0808cy;\u4425cy;\u440Cppa;\u439A\u0100ey\u07F6\u07FBdil;\u4136;\u441Ar;\uC000\u{1D50E}pf;\uC000\u{1D542}cr;\uC000\u{1D4A6}\u0580JTaceflmost\u0825\u0829\u082C\u0850\u0863\u09B3\u09B8\u09C7\u09CD\u0A37\u0A47cy;\u4409\u803B<\u403C\u0280cmnpr\u0837\u083C\u0841\u0844\u084Dute;\u4139bda;\u439Bg;\u67EAlacetrf;\u6112r;\u619E\u0180aey\u0857\u085C\u0861ron;\u413Ddil;\u413B;\u441B\u0100fs\u0868\u0970t\u0500ACDFRTUVar\u087E\u08A9\u08B1\u08E0\u08E6\u08FC\u092F\u095B\u0390\u096A\u0100nr\u0883\u088FgleBracket;\u67E8row\u0180;BR\u0899\u089A\u089E\u6190ar;\u61E4ightArrow;\u61C6eiling;\u6308o\u01F5\u08B7\0\u08C3bleBracket;\u67E6n\u01D4\u08C8\0\u08D2eeVector;\u6961ector\u0100;B\u08DB\u08DC\u61C3ar;\u6959loor;\u630Aight\u0100AV\u08EF\u08F5rrow;\u6194ector;\u694E\u0100er\u0901\u0917e\u0180;AV\u0909\u090A\u0910\u62A3rrow;\u61A4ector;\u695Aiangle\u0180;BE\u0924\u0925\u0929\u62B2ar;\u69CFqual;\u62B4p\u0180DTV\u0937\u0942\u094CownVector;\u6951eeVector;\u6960ector\u0100;B\u0956\u0957\u61BFar;\u6958ector\u0100;B\u0965\u0966\u61BCar;\u6952ight\xE1\u039Cs\u0300EFGLST\u097E\u098B\u0995\u099D\u09A2\u09ADqualGreater;\u62DAullEqual;\u6266reater;\u6276ess;\u6AA1lantEqual;\u6A7Dilde;\u6272r;\uC000\u{1D50F}\u0100;e\u09BD\u09BE\u62D8ftarrow;\u61DAidot;\u413F\u0180npw\u09D4\u0A16\u0A1Bg\u0200LRlr\u09DE\u09F7\u0A02\u0A10eft\u0100AR\u09E6\u09ECrrow;\u67F5ightArrow;\u67F7ightArrow;\u67F6eft\u0100ar\u03B3\u0A0Aight\xE1\u03BFight\xE1\u03CAf;\uC000\u{1D543}er\u0100LR\u0A22\u0A2CeftArrow;\u6199ightArrow;\u6198\u0180cht\u0A3E\u0A40\u0A42\xF2\u084C;\u61B0rok;\u4141;\u626A\u0400acefiosu\u0A5A\u0A5D\u0A60\u0A77\u0A7C\u0A85\u0A8B\u0A8Ep;\u6905y;\u441C\u0100dl\u0A65\u0A6FiumSpace;\u605Flintrf;\u6133r;\uC000\u{1D510}nusPlus;\u6213pf;\uC000\u{1D544}c\xF2\u0A76;\u439C\u0480Jacefostu\u0AA3\u0AA7\u0AAD\u0AC0\u0B14\u0B19\u0D91\u0D97\u0D9Ecy;\u440Acute;\u4143\u0180aey\u0AB4\u0AB9\u0ABEron;\u4147dil;\u4145;\u441D\u0180gsw\u0AC7\u0AF0\u0B0Eative\u0180MTV\u0AD3\u0ADF\u0AE8ediumSpace;\u600Bhi\u0100cn\u0AE6\u0AD8\xEB\u0AD9eryThi\xEE\u0AD9ted\u0100GL\u0AF8\u0B06reaterGreate\xF2\u0673essLes\xF3\u0A48Line;\u400Ar;\uC000\u{1D511}\u0200Bnpt\u0B22\u0B28\u0B37\u0B3Areak;\u6060BreakingSpace;\u40A0f;\u6115\u0680;CDEGHLNPRSTV\u0B55\u0B56\u0B6A\u0B7C\u0BA1\u0BEB\u0C04\u0C5E\u0C84\u0CA6\u0CD8\u0D61\u0D85\u6AEC\u0100ou\u0B5B\u0B64ngruent;\u6262pCap;\u626DoubleVerticalBar;\u6226\u0180lqx\u0B83\u0B8A\u0B9Bement;\u6209ual\u0100;T\u0B92\u0B93\u6260ilde;\uC000\u2242\u0338ists;\u6204reater\u0380;EFGLST\u0BB6\u0BB7\u0BBD\u0BC9\u0BD3\u0BD8\u0BE5\u626Fqual;\u6271ullEqual;\uC000\u2267\u0338reater;\uC000\u226B\u0338ess;\u6279lantEqual;\uC000\u2A7E\u0338ilde;\u6275ump\u0144\u0BF2\u0BFDownHump;\uC000\u224E\u0338qual;\uC000\u224F\u0338e\u0100fs\u0C0A\u0C27tTriangle\u0180;BE\u0C1A\u0C1B\u0C21\u62EAar;\uC000\u29CF\u0338qual;\u62ECs\u0300;EGLST\u0C35\u0C36\u0C3C\u0C44\u0C4B\u0C58\u626Equal;\u6270reater;\u6278ess;\uC000\u226A\u0338lantEqual;\uC000\u2A7D\u0338ilde;\u6274ested\u0100GL\u0C68\u0C79reaterGreater;\uC000\u2AA2\u0338essLess;\uC000\u2AA1\u0338recedes\u0180;ES\u0C92\u0C93\u0C9B\u6280qual;\uC000\u2AAF\u0338lantEqual;\u62E0\u0100ei\u0CAB\u0CB9verseElement;\u620CghtTriangle\u0180;BE\u0CCB\u0CCC\u0CD2\u62EBar;\uC000\u29D0\u0338qual;\u62ED\u0100qu\u0CDD\u0D0CuareSu\u0100bp\u0CE8\u0CF9set\u0100;E\u0CF0\u0CF3\uC000\u228F\u0338qual;\u62E2erset\u0100;E\u0D03\u0D06\uC000\u2290\u0338qual;\u62E3\u0180bcp\u0D13\u0D24\u0D4Eset\u0100;E\u0D1B\u0D1E\uC000\u2282\u20D2qual;\u6288ceeds\u0200;EST\u0D32\u0D33\u0D3B\u0D46\u6281qual;\uC000\u2AB0\u0338lantEqual;\u62E1ilde;\uC000\u227F\u0338erset\u0100;E\u0D58\u0D5B\uC000\u2283\u20D2qual;\u6289ilde\u0200;EFT\u0D6E\u0D6F\u0D75\u0D7F\u6241qual;\u6244ullEqual;\u6247ilde;\u6249erticalBar;\u6224cr;\uC000\u{1D4A9}ilde\u803B\xD1\u40D1;\u439D\u0700Eacdfgmoprstuv\u0DBD\u0DC2\u0DC9\u0DD5\u0DDB\u0DE0\u0DE7\u0DFC\u0E02\u0E20\u0E22\u0E32\u0E3F\u0E44lig;\u4152cute\u803B\xD3\u40D3\u0100iy\u0DCE\u0DD3rc\u803B\xD4\u40D4;\u441Eblac;\u4150r;\uC000\u{1D512}rave\u803B\xD2\u40D2\u0180aei\u0DEE\u0DF2\u0DF6cr;\u414Cga;\u43A9cron;\u439Fpf;\uC000\u{1D546}enCurly\u0100DQ\u0E0E\u0E1AoubleQuote;\u601Cuote;\u6018;\u6A54\u0100cl\u0E27\u0E2Cr;\uC000\u{1D4AA}ash\u803B\xD8\u40D8i\u016C\u0E37\u0E3Cde\u803B\xD5\u40D5es;\u6A37ml\u803B\xD6\u40D6er\u0100BP\u0E4B\u0E60\u0100ar\u0E50\u0E53r;\u603Eac\u0100ek\u0E5A\u0E5C;\u63DEet;\u63B4arenthesis;\u63DC\u0480acfhilors\u0E7F\u0E87\u0E8A\u0E8F\u0E92\u0E94\u0E9D\u0EB0\u0EFCrtialD;\u6202y;\u441Fr;\uC000\u{1D513}i;\u43A6;\u43A0usMinus;\u40B1\u0100ip\u0EA2\u0EADncareplan\xE5\u069Df;\u6119\u0200;eio\u0EB9\u0EBA\u0EE0\u0EE4\u6ABBcedes\u0200;EST\u0EC8\u0EC9\u0ECF\u0EDA\u627Aqual;\u6AAFlantEqual;\u627Cilde;\u627Eme;\u6033\u0100dp\u0EE9\u0EEEuct;\u620Fortion\u0100;a\u0225\u0EF9l;\u621D\u0100ci\u0F01\u0F06r;\uC000\u{1D4AB};\u43A8\u0200Ufos\u0F11\u0F16\u0F1B\u0F1FOT\u803B"\u4022r;\uC000\u{1D514}pf;\u611Acr;\uC000\u{1D4AC}\u0600BEacefhiorsu\u0F3E\u0F43\u0F47\u0F60\u0F73\u0FA7\u0FAA\u0FAD\u1096\u10A9\u10B4\u10BEarr;\u6910G\u803B\xAE\u40AE\u0180cnr\u0F4E\u0F53\u0F56ute;\u4154g;\u67EBr\u0100;t\u0F5C\u0F5D\u61A0l;\u6916\u0180aey\u0F67\u0F6C\u0F71ron;\u4158dil;\u4156;\u4420\u0100;v\u0F78\u0F79\u611Cerse\u0100EU\u0F82\u0F99\u0100lq\u0F87\u0F8Eement;\u620Builibrium;\u61CBpEquilibrium;\u696Fr\xBB\u0F79o;\u43A1ght\u0400ACDFTUVa\u0FC1\u0FEB\u0FF3\u1022\u1028\u105B\u1087\u03D8\u0100nr\u0FC6\u0FD2gleBracket;\u67E9row\u0180;BL\u0FDC\u0FDD\u0FE1\u6192ar;\u61E5eftArrow;\u61C4eiling;\u6309o\u01F5\u0FF9\0\u1005bleBracket;\u67E7n\u01D4\u100A\0\u1014eeVector;\u695Dector\u0100;B\u101D\u101E\u61C2ar;\u6955loor;\u630B\u0100er\u102D\u1043e\u0180;AV\u1035\u1036\u103C\u62A2rrow;\u61A6ector;\u695Biangle\u0180;BE\u1050\u1051\u1055\u62B3ar;\u69D0qual;\u62B5p\u0180DTV\u1063\u106E\u1078ownVector;\u694FeeVector;\u695Cector\u0100;B\u1082\u1083\u61BEar;\u6954ector\u0100;B\u1091\u1092\u61C0ar;\u6953\u0100pu\u109B\u109Ef;\u611DndImplies;\u6970ightarrow;\u61DB\u0100ch\u10B9\u10BCr;\u611B;\u61B1leDelayed;\u69F4\u0680HOacfhimoqstu\u10E4\u10F1\u10F7\u10FD\u1119\u111E\u1151\u1156\u1161\u1167\u11B5\u11BB\u11BF\u0100Cc\u10E9\u10EEHcy;\u4429y;\u4428FTcy;\u442Ccute;\u415A\u0280;aeiy\u1108\u1109\u110E\u1113\u1117\u6ABCron;\u4160dil;\u415Erc;\u415C;\u4421r;\uC000\u{1D516}ort\u0200DLRU\u112A\u1134\u113E\u1149ownArrow\xBB\u041EeftArrow\xBB\u089AightArrow\xBB\u0FDDpArrow;\u6191gma;\u43A3allCircle;\u6218pf;\uC000\u{1D54A}\u0272\u116D\0\0\u1170t;\u621Aare\u0200;ISU\u117B\u117C\u1189\u11AF\u65A1ntersection;\u6293u\u0100bp\u118F\u119Eset\u0100;E\u1197\u1198\u628Fqual;\u6291erset\u0100;E\u11A8\u11A9\u6290qual;\u6292nion;\u6294cr;\uC000\u{1D4AE}ar;\u62C6\u0200bcmp\u11C8\u11DB\u1209\u120B\u0100;s\u11CD\u11CE\u62D0et\u0100;E\u11CD\u11D5qual;\u6286\u0100ch\u11E0\u1205eeds\u0200;EST\u11ED\u11EE\u11F4\u11FF\u627Bqual;\u6AB0lantEqual;\u627Dilde;\u627FTh\xE1\u0F8C;\u6211\u0180;es\u1212\u1213\u1223\u62D1rset\u0100;E\u121C\u121D\u6283qual;\u6287et\xBB\u1213\u0580HRSacfhiors\u123E\u1244\u1249\u1255\u125E\u1271\u1276\u129F\u12C2\u12C8\u12D1ORN\u803B\xDE\u40DEADE;\u6122\u0100Hc\u124E\u1252cy;\u440By;\u4426\u0100bu\u125A\u125C;\u4009;\u43A4\u0180aey\u1265\u126A\u126Fron;\u4164dil;\u4162;\u4422r;\uC000\u{1D517}\u0100ei\u127B\u1289\u01F2\u1280\0\u1287efore;\u6234a;\u4398\u0100cn\u128E\u1298kSpace;\uC000\u205F\u200ASpace;\u6009lde\u0200;EFT\u12AB\u12AC\u12B2\u12BC\u623Cqual;\u6243ullEqual;\u6245ilde;\u6248pf;\uC000\u{1D54B}ipleDot;\u60DB\u0100ct\u12D6\u12DBr;\uC000\u{1D4AF}rok;\u4166\u0AE1\u12F7\u130E\u131A\u1326\0\u132C\u1331\0\0\0\0\0\u1338\u133D\u1377\u1385\0\u13FF\u1404\u140A\u1410\u0100cr\u12FB\u1301ute\u803B\xDA\u40DAr\u0100;o\u1307\u1308\u619Fcir;\u6949r\u01E3\u1313\0\u1316y;\u440Eve;\u416C\u0100iy\u131E\u1323rc\u803B\xDB\u40DB;\u4423blac;\u4170r;\uC000\u{1D518}rave\u803B\xD9\u40D9acr;\u416A\u0100di\u1341\u1369er\u0100BP\u1348\u135D\u0100ar\u134D\u1350r;\u405Fac\u0100ek\u1357\u1359;\u63DFet;\u63B5arenthesis;\u63DDon\u0100;P\u1370\u1371\u62C3lus;\u628E\u0100gp\u137B\u137Fon;\u4172f;\uC000\u{1D54C}\u0400ADETadps\u1395\u13AE\u13B8\u13C4\u03E8\u13D2\u13D7\u13F3rrow\u0180;BD\u1150\u13A0\u13A4ar;\u6912ownArrow;\u61C5ownArrow;\u6195quilibrium;\u696Eee\u0100;A\u13CB\u13CC\u62A5rrow;\u61A5own\xE1\u03F3er\u0100LR\u13DE\u13E8eftArrow;\u6196ightArrow;\u6197i\u0100;l\u13F9\u13FA\u43D2on;\u43A5ing;\u416Ecr;\uC000\u{1D4B0}ilde;\u4168ml\u803B\xDC\u40DC\u0480Dbcdefosv\u1427\u142C\u1430\u1433\u143E\u1485\u148A\u1490\u1496ash;\u62ABar;\u6AEBy;\u4412ash\u0100;l\u143B\u143C\u62A9;\u6AE6\u0100er\u1443\u1445;\u62C1\u0180bty\u144C\u1450\u147Aar;\u6016\u0100;i\u144F\u1455cal\u0200BLST\u1461\u1465\u146A\u1474ar;\u6223ine;\u407Ceparator;\u6758ilde;\u6240ThinSpace;\u600Ar;\uC000\u{1D519}pf;\uC000\u{1D54D}cr;\uC000\u{1D4B1}dash;\u62AA\u0280cefos\u14A7\u14AC\u14B1\u14B6\u14BCirc;\u4174dge;\u62C0r;\uC000\u{1D51A}pf;\uC000\u{1D54E}cr;\uC000\u{1D4B2}\u0200fios\u14CB\u14D0\u14D2\u14D8r;\uC000\u{1D51B};\u439Epf;\uC000\u{1D54F}cr;\uC000\u{1D4B3}\u0480AIUacfosu\u14F1\u14F5\u14F9\u14FD\u1504\u150F\u1514\u151A\u1520cy;\u442Fcy;\u4407cy;\u442Ecute\u803B\xDD\u40DD\u0100iy\u1509\u150Drc;\u4176;\u442Br;\uC000\u{1D51C}pf;\uC000\u{1D550}cr;\uC000\u{1D4B4}ml;\u4178\u0400Hacdefos\u1535\u1539\u153F\u154B\u154F\u155D\u1560\u1564cy;\u4416cute;\u4179\u0100ay\u1544\u1549ron;\u417D;\u4417ot;\u417B\u01F2\u1554\0\u155BoWidt\xE8\u0AD9a;\u4396r;\u6128pf;\u6124cr;\uC000\u{1D4B5}\u0BE1\u1583\u158A\u1590\0\u15B0\u15B6\u15BF\0\0\0\0\u15C6\u15DB\u15EB\u165F\u166D\0\u1695\u169B\u16B2\u16B9\0\u16BEcute\u803B\xE1\u40E1reve;\u4103\u0300;Ediuy\u159C\u159D\u15A1\u15A3\u15A8\u15AD\u623E;\uC000\u223E\u0333;\u623Frc\u803B\xE2\u40E2te\u80BB\xB4\u0306;\u4430lig\u803B\xE6\u40E6\u0100;r\xB2\u15BA;\uC000\u{1D51E}rave\u803B\xE0\u40E0\u0100ep\u15CA\u15D6\u0100fp\u15CF\u15D4sym;\u6135\xE8\u15D3ha;\u43B1\u0100ap\u15DFc\u0100cl\u15E4\u15E7r;\u4101g;\u6A3F\u0264\u15F0\0\0\u160A\u0280;adsv\u15FA\u15FB\u15FF\u1601\u1607\u6227nd;\u6A55;\u6A5Clope;\u6A58;\u6A5A\u0380;elmrsz\u1618\u1619\u161B\u161E\u163F\u164F\u1659\u6220;\u69A4e\xBB\u1619sd\u0100;a\u1625\u1626\u6221\u0461\u1630\u1632\u1634\u1636\u1638\u163A\u163C\u163E;\u69A8;\u69A9;\u69AA;\u69AB;\u69AC;\u69AD;\u69AE;\u69AFt\u0100;v\u1645\u1646\u621Fb\u0100;d\u164C\u164D\u62BE;\u699D\u0100pt\u1654\u1657h;\u6222\xBB\xB9arr;\u637C\u0100gp\u1663\u1667on;\u4105f;\uC000\u{1D552}\u0380;Eaeiop\u12C1\u167B\u167D\u1682\u1684\u1687\u168A;\u6A70cir;\u6A6F;\u624Ad;\u624Bs;\u4027rox\u0100;e\u12C1\u1692\xF1\u1683ing\u803B\xE5\u40E5\u0180cty\u16A1\u16A6\u16A8r;\uC000\u{1D4B6};\u402Amp\u0100;e\u12C1\u16AF\xF1\u0288ilde\u803B\xE3\u40E3ml\u803B\xE4\u40E4\u0100ci\u16C2\u16C8onin\xF4\u0272nt;\u6A11\u0800Nabcdefiklnoprsu\u16ED\u16F1\u1730\u173C\u1743\u1748\u1778\u177D\u17E0\u17E6\u1839\u1850\u170D\u193D\u1948\u1970ot;\u6AED\u0100cr\u16F6\u171Ek\u0200ceps\u1700\u1705\u170D\u1713ong;\u624Cpsilon;\u43F6rime;\u6035im\u0100;e\u171A\u171B\u623Dq;\u62CD\u0176\u1722\u1726ee;\u62BDed\u0100;g\u172C\u172D\u6305e\xBB\u172Drk\u0100;t\u135C\u1737brk;\u63B6\u0100oy\u1701\u1741;\u4431quo;\u601E\u0280cmprt\u1753\u175B\u1761\u1764\u1768aus\u0100;e\u010A\u0109ptyv;\u69B0s\xE9\u170Cno\xF5\u0113\u0180ahw\u176F\u1771\u1773;\u43B2;\u6136een;\u626Cr;\uC000\u{1D51F}g\u0380costuvw\u178D\u179D\u17B3\u17C1\u17D5\u17DB\u17DE\u0180aiu\u1794\u1796\u179A\xF0\u0760rc;\u65EFp\xBB\u1371\u0180dpt\u17A4\u17A8\u17ADot;\u6A00lus;\u6A01imes;\u6A02\u0271\u17B9\0\0\u17BEcup;\u6A06ar;\u6605riangle\u0100du\u17CD\u17D2own;\u65BDp;\u65B3plus;\u6A04e\xE5\u1444\xE5\u14ADarow;\u690D\u0180ako\u17ED\u1826\u1835\u0100cn\u17F2\u1823k\u0180lst\u17FA\u05AB\u1802ozenge;\u69EBriangle\u0200;dlr\u1812\u1813\u1818\u181D\u65B4own;\u65BEeft;\u65C2ight;\u65B8k;\u6423\u01B1\u182B\0\u1833\u01B2\u182F\0\u1831;\u6592;\u65914;\u6593ck;\u6588\u0100eo\u183E\u184D\u0100;q\u1843\u1846\uC000=\u20E5uiv;\uC000\u2261\u20E5t;\u6310\u0200ptwx\u1859\u185E\u1867\u186Cf;\uC000\u{1D553}\u0100;t\u13CB\u1863om\xBB\u13CCtie;\u62C8\u0600DHUVbdhmptuv\u1885\u1896\u18AA\u18BB\u18D7\u18DB\u18EC\u18FF\u1905\u190A\u1910\u1921\u0200LRlr\u188E\u1890\u1892\u1894;\u6557;\u6554;\u6556;\u6553\u0280;DUdu\u18A1\u18A2\u18A4\u18A6\u18A8\u6550;\u6566;\u6569;\u6564;\u6567\u0200LRlr\u18B3\u18B5\u18B7\u18B9;\u655D;\u655A;\u655C;\u6559\u0380;HLRhlr\u18CA\u18CB\u18CD\u18CF\u18D1\u18D3\u18D5\u6551;\u656C;\u6563;\u6560;\u656B;\u6562;\u655Fox;\u69C9\u0200LRlr\u18E4\u18E6\u18E8\u18EA;\u6555;\u6552;\u6510;\u650C\u0280;DUdu\u06BD\u18F7\u18F9\u18FB\u18FD;\u6565;\u6568;\u652C;\u6534inus;\u629Flus;\u629Eimes;\u62A0\u0200LRlr\u1919\u191B\u191D\u191F;\u655B;\u6558;\u6518;\u6514\u0380;HLRhlr\u1930\u1931\u1933\u1935\u1937\u1939\u193B\u6502;\u656A;\u6561;\u655E;\u653C;\u6524;\u651C\u0100ev\u0123\u1942bar\u803B\xA6\u40A6\u0200ceio\u1951\u1956\u195A\u1960r;\uC000\u{1D4B7}mi;\u604Fm\u0100;e\u171A\u171Cl\u0180;bh\u1968\u1969\u196B\u405C;\u69C5sub;\u67C8\u016C\u1974\u197El\u0100;e\u1979\u197A\u6022t\xBB\u197Ap\u0180;Ee\u012F\u1985\u1987;\u6AAE\u0100;q\u06DC\u06DB\u0CE1\u19A7\0\u19E8\u1A11\u1A15\u1A32\0\u1A37\u1A50\0\0\u1AB4\0\0\u1AC1\0\0\u1B21\u1B2E\u1B4D\u1B52\0\u1BFD\0\u1C0C\u0180cpr\u19AD\u19B2\u19DDute;\u4107\u0300;abcds\u19BF\u19C0\u19C4\u19CA\u19D5\u19D9\u6229nd;\u6A44rcup;\u6A49\u0100au\u19CF\u19D2p;\u6A4Bp;\u6A47ot;\u6A40;\uC000\u2229\uFE00\u0100eo\u19E2\u19E5t;\u6041\xEE\u0693\u0200aeiu\u19F0\u19FB\u1A01\u1A05\u01F0\u19F5\0\u19F8s;\u6A4Don;\u410Ddil\u803B\xE7\u40E7rc;\u4109ps\u0100;s\u1A0C\u1A0D\u6A4Cm;\u6A50ot;\u410B\u0180dmn\u1A1B\u1A20\u1A26il\u80BB\xB8\u01ADptyv;\u69B2t\u8100\xA2;e\u1A2D\u1A2E\u40A2r\xE4\u01B2r;\uC000\u{1D520}\u0180cei\u1A3D\u1A40\u1A4Dy;\u4447ck\u0100;m\u1A47\u1A48\u6713ark\xBB\u1A48;\u43C7r\u0380;Ecefms\u1A5F\u1A60\u1A62\u1A6B\u1AA4\u1AAA\u1AAE\u65CB;\u69C3\u0180;el\u1A69\u1A6A\u1A6D\u42C6q;\u6257e\u0261\u1A74\0\0\u1A88rrow\u0100lr\u1A7C\u1A81eft;\u61BAight;\u61BB\u0280RSacd\u1A92\u1A94\u1A96\u1A9A\u1A9F\xBB\u0F47;\u64C8st;\u629Birc;\u629Aash;\u629Dnint;\u6A10id;\u6AEFcir;\u69C2ubs\u0100;u\u1ABB\u1ABC\u6663it\xBB\u1ABC\u02EC\u1AC7\u1AD4\u1AFA\0\u1B0Aon\u0100;e\u1ACD\u1ACE\u403A\u0100;q\xC7\xC6\u026D\u1AD9\0\0\u1AE2a\u0100;t\u1ADE\u1ADF\u402C;\u4040\u0180;fl\u1AE8\u1AE9\u1AEB\u6201\xEE\u1160e\u0100mx\u1AF1\u1AF6ent\xBB\u1AE9e\xF3\u024D\u01E7\u1AFE\0\u1B07\u0100;d\u12BB\u1B02ot;\u6A6Dn\xF4\u0246\u0180fry\u1B10\u1B14\u1B17;\uC000\u{1D554}o\xE4\u0254\u8100\xA9;s\u0155\u1B1Dr;\u6117\u0100ao\u1B25\u1B29rr;\u61B5ss;\u6717\u0100cu\u1B32\u1B37r;\uC000\u{1D4B8}\u0100bp\u1B3C\u1B44\u0100;e\u1B41\u1B42\u6ACF;\u6AD1\u0100;e\u1B49\u1B4A\u6AD0;\u6AD2dot;\u62EF\u0380delprvw\u1B60\u1B6C\u1B77\u1B82\u1BAC\u1BD4\u1BF9arr\u0100lr\u1B68\u1B6A;\u6938;\u6935\u0270\u1B72\0\0\u1B75r;\u62DEc;\u62DFarr\u0100;p\u1B7F\u1B80\u61B6;\u693D\u0300;bcdos\u1B8F\u1B90\u1B96\u1BA1\u1BA5\u1BA8\u622Arcap;\u6A48\u0100au\u1B9B\u1B9Ep;\u6A46p;\u6A4Aot;\u628Dr;\u6A45;\uC000\u222A\uFE00\u0200alrv\u1BB5\u1BBF\u1BDE\u1BE3rr\u0100;m\u1BBC\u1BBD\u61B7;\u693Cy\u0180evw\u1BC7\u1BD4\u1BD8q\u0270\u1BCE\0\0\u1BD2re\xE3\u1B73u\xE3\u1B75ee;\u62CEedge;\u62CFen\u803B\xA4\u40A4earrow\u0100lr\u1BEE\u1BF3eft\xBB\u1B80ight\xBB\u1BBDe\xE4\u1BDD\u0100ci\u1C01\u1C07onin\xF4\u01F7nt;\u6231lcty;\u632D\u0980AHabcdefhijlorstuwz\u1C38\u1C3B\u1C3F\u1C5D\u1C69\u1C75\u1C8A\u1C9E\u1CAC\u1CB7\u1CFB\u1CFF\u1D0D\u1D7B\u1D91\u1DAB\u1DBB\u1DC6\u1DCDr\xF2\u0381ar;\u6965\u0200glrs\u1C48\u1C4D\u1C52\u1C54ger;\u6020eth;\u6138\xF2\u1133h\u0100;v\u1C5A\u1C5B\u6010\xBB\u090A\u016B\u1C61\u1C67arow;\u690Fa\xE3\u0315\u0100ay\u1C6E\u1C73ron;\u410F;\u4434\u0180;ao\u0332\u1C7C\u1C84\u0100gr\u02BF\u1C81r;\u61CAtseq;\u6A77\u0180glm\u1C91\u1C94\u1C98\u803B\xB0\u40B0ta;\u43B4ptyv;\u69B1\u0100ir\u1CA3\u1CA8sht;\u697F;\uC000\u{1D521}ar\u0100lr\u1CB3\u1CB5\xBB\u08DC\xBB\u101E\u0280aegsv\u1CC2\u0378\u1CD6\u1CDC\u1CE0m\u0180;os\u0326\u1CCA\u1CD4nd\u0100;s\u0326\u1CD1uit;\u6666amma;\u43DDin;\u62F2\u0180;io\u1CE7\u1CE8\u1CF8\u40F7de\u8100\xF7;o\u1CE7\u1CF0ntimes;\u62C7n\xF8\u1CF7cy;\u4452c\u026F\u1D06\0\0\u1D0Arn;\u631Eop;\u630D\u0280lptuw\u1D18\u1D1D\u1D22\u1D49\u1D55lar;\u4024f;\uC000\u{1D555}\u0280;emps\u030B\u1D2D\u1D37\u1D3D\u1D42q\u0100;d\u0352\u1D33ot;\u6251inus;\u6238lus;\u6214quare;\u62A1blebarwedg\xE5\xFAn\u0180adh\u112E\u1D5D\u1D67ownarrow\xF3\u1C83arpoon\u0100lr\u1D72\u1D76ef\xF4\u1CB4igh\xF4\u1CB6\u0162\u1D7F\u1D85karo\xF7\u0F42\u026F\u1D8A\0\0\u1D8Ern;\u631Fop;\u630C\u0180cot\u1D98\u1DA3\u1DA6\u0100ry\u1D9D\u1DA1;\uC000\u{1D4B9};\u4455l;\u69F6rok;\u4111\u0100dr\u1DB0\u1DB4ot;\u62F1i\u0100;f\u1DBA\u1816\u65BF\u0100ah\u1DC0\u1DC3r\xF2\u0429a\xF2\u0FA6angle;\u69A6\u0100ci\u1DD2\u1DD5y;\u445Fgrarr;\u67FF\u0900Dacdefglmnopqrstux\u1E01\u1E09\u1E19\u1E38\u0578\u1E3C\u1E49\u1E61\u1E7E\u1EA5\u1EAF\u1EBD\u1EE1\u1F2A\u1F37\u1F44\u1F4E\u1F5A\u0100Do\u1E06\u1D34o\xF4\u1C89\u0100cs\u1E0E\u1E14ute\u803B\xE9\u40E9ter;\u6A6E\u0200aioy\u1E22\u1E27\u1E31\u1E36ron;\u411Br\u0100;c\u1E2D\u1E2E\u6256\u803B\xEA\u40EAlon;\u6255;\u444Dot;\u4117\u0100Dr\u1E41\u1E45ot;\u6252;\uC000\u{1D522}\u0180;rs\u1E50\u1E51\u1E57\u6A9Aave\u803B\xE8\u40E8\u0100;d\u1E5C\u1E5D\u6A96ot;\u6A98\u0200;ils\u1E6A\u1E6B\u1E72\u1E74\u6A99nters;\u63E7;\u6113\u0100;d\u1E79\u1E7A\u6A95ot;\u6A97\u0180aps\u1E85\u1E89\u1E97cr;\u4113ty\u0180;sv\u1E92\u1E93\u1E95\u6205et\xBB\u1E93p\u01001;\u1E9D\u1EA4\u0133\u1EA1\u1EA3;\u6004;\u6005\u6003\u0100gs\u1EAA\u1EAC;\u414Bp;\u6002\u0100gp\u1EB4\u1EB8on;\u4119f;\uC000\u{1D556}\u0180als\u1EC4\u1ECE\u1ED2r\u0100;s\u1ECA\u1ECB\u62D5l;\u69E3us;\u6A71i\u0180;lv\u1EDA\u1EDB\u1EDF\u43B5on\xBB\u1EDB;\u43F5\u0200csuv\u1EEA\u1EF3\u1F0B\u1F23\u0100io\u1EEF\u1E31rc\xBB\u1E2E\u0269\u1EF9\0\0\u1EFB\xED\u0548ant\u0100gl\u1F02\u1F06tr\xBB\u1E5Dess\xBB\u1E7A\u0180aei\u1F12\u1F16\u1F1Als;\u403Dst;\u625Fv\u0100;D\u0235\u1F20D;\u6A78parsl;\u69E5\u0100Da\u1F2F\u1F33ot;\u6253rr;\u6971\u0180cdi\u1F3E\u1F41\u1EF8r;\u612Fo\xF4\u0352\u0100ah\u1F49\u1F4B;\u43B7\u803B\xF0\u40F0\u0100mr\u1F53\u1F57l\u803B\xEB\u40EBo;\u60AC\u0180cip\u1F61\u1F64\u1F67l;\u4021s\xF4\u056E\u0100eo\u1F6C\u1F74ctatio\xEE\u0559nential\xE5\u0579\u09E1\u1F92\0\u1F9E\0\u1FA1\u1FA7\0\0\u1FC6\u1FCC\0\u1FD3\0\u1FE6\u1FEA\u2000\0\u2008\u205Allingdotse\xF1\u1E44y;\u4444male;\u6640\u0180ilr\u1FAD\u1FB3\u1FC1lig;\u8000\uFB03\u0269\u1FB9\0\0\u1FBDg;\u8000\uFB00ig;\u8000\uFB04;\uC000\u{1D523}lig;\u8000\uFB01lig;\uC000fj\u0180alt\u1FD9\u1FDC\u1FE1t;\u666Dig;\u8000\uFB02ns;\u65B1of;\u4192\u01F0\u1FEE\0\u1FF3f;\uC000\u{1D557}\u0100ak\u05BF\u1FF7\u0100;v\u1FFC\u1FFD\u62D4;\u6AD9artint;\u6A0D\u0100ao\u200C\u2055\u0100cs\u2011\u2052\u03B1\u201A\u2030\u2038\u2045\u2048\0\u2050\u03B2\u2022\u2025\u2027\u202A\u202C\0\u202E\u803B\xBD\u40BD;\u6153\u803B\xBC\u40BC;\u6155;\u6159;\u615B\u01B3\u2034\0\u2036;\u6154;\u6156\u02B4\u203E\u2041\0\0\u2043\u803B\xBE\u40BE;\u6157;\u615C5;\u6158\u01B6\u204C\0\u204E;\u615A;\u615D8;\u615El;\u6044wn;\u6322cr;\uC000\u{1D4BB}\u0880Eabcdefgijlnorstv\u2082\u2089\u209F\u20A5\u20B0\u20B4\u20F0\u20F5\u20FA\u20FF\u2103\u2112\u2138\u0317\u213E\u2152\u219E\u0100;l\u064D\u2087;\u6A8C\u0180cmp\u2090\u2095\u209Dute;\u41F5ma\u0100;d\u209C\u1CDA\u43B3;\u6A86reve;\u411F\u0100iy\u20AA\u20AErc;\u411D;\u4433ot;\u4121\u0200;lqs\u063E\u0642\u20BD\u20C9\u0180;qs\u063E\u064C\u20C4lan\xF4\u0665\u0200;cdl\u0665\u20D2\u20D5\u20E5c;\u6AA9ot\u0100;o\u20DC\u20DD\u6A80\u0100;l\u20E2\u20E3\u6A82;\u6A84\u0100;e\u20EA\u20ED\uC000\u22DB\uFE00s;\u6A94r;\uC000\u{1D524}\u0100;g\u0673\u061Bmel;\u6137cy;\u4453\u0200;Eaj\u065A\u210C\u210E\u2110;\u6A92;\u6AA5;\u6AA4\u0200Eaes\u211B\u211D\u2129\u2134;\u6269p\u0100;p\u2123\u2124\u6A8Arox\xBB\u2124\u0100;q\u212E\u212F\u6A88\u0100;q\u212E\u211Bim;\u62E7pf;\uC000\u{1D558}\u0100ci\u2143\u2146r;\u610Am\u0180;el\u066B\u214E\u2150;\u6A8E;\u6A90\u8300>;cdlqr\u05EE\u2160\u216A\u216E\u2173\u2179\u0100ci\u2165\u2167;\u6AA7r;\u6A7Aot;\u62D7Par;\u6995uest;\u6A7C\u0280adels\u2184\u216A\u2190\u0656\u219B\u01F0\u2189\0\u218Epro\xF8\u209Er;\u6978q\u0100lq\u063F\u2196les\xF3\u2088i\xED\u066B\u0100en\u21A3\u21ADrtneqq;\uC000\u2269\uFE00\xC5\u21AA\u0500Aabcefkosy\u21C4\u21C7\u21F1\u21F5\u21FA\u2218\u221D\u222F\u2268\u227Dr\xF2\u03A0\u0200ilmr\u21D0\u21D4\u21D7\u21DBrs\xF0\u1484f\xBB\u2024il\xF4\u06A9\u0100dr\u21E0\u21E4cy;\u444A\u0180;cw\u08F4\u21EB\u21EFir;\u6948;\u61ADar;\u610Firc;\u4125\u0180alr\u2201\u220E\u2213rts\u0100;u\u2209\u220A\u6665it\xBB\u220Alip;\u6026con;\u62B9r;\uC000\u{1D525}s\u0100ew\u2223\u2229arow;\u6925arow;\u6926\u0280amopr\u223A\u223E\u2243\u225E\u2263rr;\u61FFtht;\u623Bk\u0100lr\u2249\u2253eftarrow;\u61A9ightarrow;\u61AAf;\uC000\u{1D559}bar;\u6015\u0180clt\u226F\u2274\u2278r;\uC000\u{1D4BD}as\xE8\u21F4rok;\u4127\u0100bp\u2282\u2287ull;\u6043hen\xBB\u1C5B\u0AE1\u22A3\0\u22AA\0\u22B8\u22C5\u22CE\0\u22D5\u22F3\0\0\u22F8\u2322\u2367\u2362\u237F\0\u2386\u23AA\u23B4cute\u803B\xED\u40ED\u0180;iy\u0771\u22B0\u22B5rc\u803B\xEE\u40EE;\u4438\u0100cx\u22BC\u22BFy;\u4435cl\u803B\xA1\u40A1\u0100fr\u039F\u22C9;\uC000\u{1D526}rave\u803B\xEC\u40EC\u0200;ino\u073E\u22DD\u22E9\u22EE\u0100in\u22E2\u22E6nt;\u6A0Ct;\u622Dfin;\u69DCta;\u6129lig;\u4133\u0180aop\u22FE\u231A\u231D\u0180cgt\u2305\u2308\u2317r;\u412B\u0180elp\u071F\u230F\u2313in\xE5\u078Ear\xF4\u0720h;\u4131f;\u62B7ed;\u41B5\u0280;cfot\u04F4\u232C\u2331\u233D\u2341are;\u6105in\u0100;t\u2338\u2339\u621Eie;\u69DDdo\xF4\u2319\u0280;celp\u0757\u234C\u2350\u235B\u2361al;\u62BA\u0100gr\u2355\u2359er\xF3\u1563\xE3\u234Darhk;\u6A17rod;\u6A3C\u0200cgpt\u236F\u2372\u2376\u237By;\u4451on;\u412Ff;\uC000\u{1D55A}a;\u43B9uest\u803B\xBF\u40BF\u0100ci\u238A\u238Fr;\uC000\u{1D4BE}n\u0280;Edsv\u04F4\u239B\u239D\u23A1\u04F3;\u62F9ot;\u62F5\u0100;v\u23A6\u23A7\u62F4;\u62F3\u0100;i\u0777\u23AElde;\u4129\u01EB\u23B8\0\u23BCcy;\u4456l\u803B\xEF\u40EF\u0300cfmosu\u23CC\u23D7\u23DC\u23E1\u23E7\u23F5\u0100iy\u23D1\u23D5rc;\u4135;\u4439r;\uC000\u{1D527}ath;\u4237pf;\uC000\u{1D55B}\u01E3\u23EC\0\u23F1r;\uC000\u{1D4BF}rcy;\u4458kcy;\u4454\u0400acfghjos\u240B\u2416\u2422\u2427\u242D\u2431\u2435\u243Bppa\u0100;v\u2413\u2414\u43BA;\u43F0\u0100ey\u241B\u2420dil;\u4137;\u443Ar;\uC000\u{1D528}reen;\u4138cy;\u4445cy;\u445Cpf;\uC000\u{1D55C}cr;\uC000\u{1D4C0}\u0B80ABEHabcdefghjlmnoprstuv\u2470\u2481\u2486\u248D\u2491\u250E\u253D\u255A\u2580\u264E\u265E\u2665\u2679\u267D\u269A\u26B2\u26D8\u275D\u2768\u278B\u27C0\u2801\u2812\u0180art\u2477\u247A\u247Cr\xF2\u09C6\xF2\u0395ail;\u691Barr;\u690E\u0100;g\u0994\u248B;\u6A8Bar;\u6962\u0963\u24A5\0\u24AA\0\u24B1\0\0\0\0\0\u24B5\u24BA\0\u24C6\u24C8\u24CD\0\u24F9ute;\u413Amptyv;\u69B4ra\xEE\u084Cbda;\u43BBg\u0180;dl\u088E\u24C1\u24C3;\u6991\xE5\u088E;\u6A85uo\u803B\xAB\u40ABr\u0400;bfhlpst\u0899\u24DE\u24E6\u24E9\u24EB\u24EE\u24F1\u24F5\u0100;f\u089D\u24E3s;\u691Fs;\u691D\xEB\u2252p;\u61ABl;\u6939im;\u6973l;\u61A2\u0180;ae\u24FF\u2500\u2504\u6AABil;\u6919\u0100;s\u2509\u250A\u6AAD;\uC000\u2AAD\uFE00\u0180abr\u2515\u2519\u251Drr;\u690Crk;\u6772\u0100ak\u2522\u252Cc\u0100ek\u2528\u252A;\u407B;\u405B\u0100es\u2531\u2533;\u698Bl\u0100du\u2539\u253B;\u698F;\u698D\u0200aeuy\u2546\u254B\u2556\u2558ron;\u413E\u0100di\u2550\u2554il;\u413C\xEC\u08B0\xE2\u2529;\u443B\u0200cqrs\u2563\u2566\u256D\u257Da;\u6936uo\u0100;r\u0E19\u1746\u0100du\u2572\u2577har;\u6967shar;\u694Bh;\u61B2\u0280;fgqs\u258B\u258C\u0989\u25F3\u25FF\u6264t\u0280ahlrt\u2598\u25A4\u25B7\u25C2\u25E8rrow\u0100;t\u0899\u25A1a\xE9\u24F6arpoon\u0100du\u25AF\u25B4own\xBB\u045Ap\xBB\u0966eftarrows;\u61C7ight\u0180ahs\u25CD\u25D6\u25DErrow\u0100;s\u08F4\u08A7arpoon\xF3\u0F98quigarro\xF7\u21F0hreetimes;\u62CB\u0180;qs\u258B\u0993\u25FAlan\xF4\u09AC\u0280;cdgs\u09AC\u260A\u260D\u261D\u2628c;\u6AA8ot\u0100;o\u2614\u2615\u6A7F\u0100;r\u261A\u261B\u6A81;\u6A83\u0100;e\u2622\u2625\uC000\u22DA\uFE00s;\u6A93\u0280adegs\u2633\u2639\u263D\u2649\u264Bppro\xF8\u24C6ot;\u62D6q\u0100gq\u2643\u2645\xF4\u0989gt\xF2\u248C\xF4\u099Bi\xED\u09B2\u0180ilr\u2655\u08E1\u265Asht;\u697C;\uC000\u{1D529}\u0100;E\u099C\u2663;\u6A91\u0161\u2669\u2676r\u0100du\u25B2\u266E\u0100;l\u0965\u2673;\u696Alk;\u6584cy;\u4459\u0280;acht\u0A48\u2688\u268B\u2691\u2696r\xF2\u25C1orne\xF2\u1D08ard;\u696Bri;\u65FA\u0100io\u269F\u26A4dot;\u4140ust\u0100;a\u26AC\u26AD\u63B0che\xBB\u26AD\u0200Eaes\u26BB\u26BD\u26C9\u26D4;\u6268p\u0100;p\u26C3\u26C4\u6A89rox\xBB\u26C4\u0100;q\u26CE\u26CF\u6A87\u0100;q\u26CE\u26BBim;\u62E6\u0400abnoptwz\u26E9\u26F4\u26F7\u271A\u272F\u2741\u2747\u2750\u0100nr\u26EE\u26F1g;\u67ECr;\u61FDr\xEB\u08C1g\u0180lmr\u26FF\u270D\u2714eft\u0100ar\u09E6\u2707ight\xE1\u09F2apsto;\u67FCight\xE1\u09FDparrow\u0100lr\u2725\u2729ef\xF4\u24EDight;\u61AC\u0180afl\u2736\u2739\u273Dr;\u6985;\uC000\u{1D55D}us;\u6A2Dimes;\u6A34\u0161\u274B\u274Fst;\u6217\xE1\u134E\u0180;ef\u2757\u2758\u1800\u65CAnge\xBB\u2758ar\u0100;l\u2764\u2765\u4028t;\u6993\u0280achmt\u2773\u2776\u277C\u2785\u2787r\xF2\u08A8orne\xF2\u1D8Car\u0100;d\u0F98\u2783;\u696D;\u600Eri;\u62BF\u0300achiqt\u2798\u279D\u0A40\u27A2\u27AE\u27BBquo;\u6039r;\uC000\u{1D4C1}m\u0180;eg\u09B2\u27AA\u27AC;\u6A8D;\u6A8F\u0100bu\u252A\u27B3o\u0100;r\u0E1F\u27B9;\u601Arok;\u4142\u8400<;cdhilqr\u082B\u27D2\u2639\u27DC\u27E0\u27E5\u27EA\u27F0\u0100ci\u27D7\u27D9;\u6AA6r;\u6A79re\xE5\u25F2mes;\u62C9arr;\u6976uest;\u6A7B\u0100Pi\u27F5\u27F9ar;\u6996\u0180;ef\u2800\u092D\u181B\u65C3r\u0100du\u2807\u280Dshar;\u694Ahar;\u6966\u0100en\u2817\u2821rtneqq;\uC000\u2268\uFE00\xC5\u281E\u0700Dacdefhilnopsu\u2840\u2845\u2882\u288E\u2893\u28A0\u28A5\u28A8\u28DA\u28E2\u28E4\u0A83\u28F3\u2902Dot;\u623A\u0200clpr\u284E\u2852\u2863\u287Dr\u803B\xAF\u40AF\u0100et\u2857\u2859;\u6642\u0100;e\u285E\u285F\u6720se\xBB\u285F\u0100;s\u103B\u2868to\u0200;dlu\u103B\u2873\u2877\u287Bow\xEE\u048Cef\xF4\u090F\xF0\u13D1ker;\u65AE\u0100oy\u2887\u288Cmma;\u6A29;\u443Cash;\u6014asuredangle\xBB\u1626r;\uC000\u{1D52A}o;\u6127\u0180cdn\u28AF\u28B4\u28C9ro\u803B\xB5\u40B5\u0200;acd\u1464\u28BD\u28C0\u28C4s\xF4\u16A7ir;\u6AF0ot\u80BB\xB7\u01B5us\u0180;bd\u28D2\u1903\u28D3\u6212\u0100;u\u1D3C\u28D8;\u6A2A\u0163\u28DE\u28E1p;\u6ADB\xF2\u2212\xF0\u0A81\u0100dp\u28E9\u28EEels;\u62A7f;\uC000\u{1D55E}\u0100ct\u28F8\u28FDr;\uC000\u{1D4C2}pos\xBB\u159D\u0180;lm\u2909\u290A\u290D\u43BCtimap;\u62B8\u0C00GLRVabcdefghijlmoprstuvw\u2942\u2953\u297E\u2989\u2998\u29DA\u29E9\u2A15\u2A1A\u2A58\u2A5D\u2A83\u2A95\u2AA4\u2AA8\u2B04\u2B07\u2B44\u2B7F\u2BAE\u2C34\u2C67\u2C7C\u2CE9\u0100gt\u2947\u294B;\uC000\u22D9\u0338\u0100;v\u2950\u0BCF\uC000\u226B\u20D2\u0180elt\u295A\u2972\u2976ft\u0100ar\u2961\u2967rrow;\u61CDightarrow;\u61CE;\uC000\u22D8\u0338\u0100;v\u297B\u0C47\uC000\u226A\u20D2ightarrow;\u61CF\u0100Dd\u298E\u2993ash;\u62AFash;\u62AE\u0280bcnpt\u29A3\u29A7\u29AC\u29B1\u29CCla\xBB\u02DEute;\u4144g;\uC000\u2220\u20D2\u0280;Eiop\u0D84\u29BC\u29C0\u29C5\u29C8;\uC000\u2A70\u0338d;\uC000\u224B\u0338s;\u4149ro\xF8\u0D84ur\u0100;a\u29D3\u29D4\u666El\u0100;s\u29D3\u0B38\u01F3\u29DF\0\u29E3p\u80BB\xA0\u0B37mp\u0100;e\u0BF9\u0C00\u0280aeouy\u29F4\u29FE\u2A03\u2A10\u2A13\u01F0\u29F9\0\u29FB;\u6A43on;\u4148dil;\u4146ng\u0100;d\u0D7E\u2A0Aot;\uC000\u2A6D\u0338p;\u6A42;\u443Dash;\u6013\u0380;Aadqsx\u0B92\u2A29\u2A2D\u2A3B\u2A41\u2A45\u2A50rr;\u61D7r\u0100hr\u2A33\u2A36k;\u6924\u0100;o\u13F2\u13F0ot;\uC000\u2250\u0338ui\xF6\u0B63\u0100ei\u2A4A\u2A4Ear;\u6928\xED\u0B98ist\u0100;s\u0BA0\u0B9Fr;\uC000\u{1D52B}\u0200Eest\u0BC5\u2A66\u2A79\u2A7C\u0180;qs\u0BBC\u2A6D\u0BE1\u0180;qs\u0BBC\u0BC5\u2A74lan\xF4\u0BE2i\xED\u0BEA\u0100;r\u0BB6\u2A81\xBB\u0BB7\u0180Aap\u2A8A\u2A8D\u2A91r\xF2\u2971rr;\u61AEar;\u6AF2\u0180;sv\u0F8D\u2A9C\u0F8C\u0100;d\u2AA1\u2AA2\u62FC;\u62FAcy;\u445A\u0380AEadest\u2AB7\u2ABA\u2ABE\u2AC2\u2AC5\u2AF6\u2AF9r\xF2\u2966;\uC000\u2266\u0338rr;\u619Ar;\u6025\u0200;fqs\u0C3B\u2ACE\u2AE3\u2AEFt\u0100ar\u2AD4\u2AD9rro\xF7\u2AC1ightarro\xF7\u2A90\u0180;qs\u0C3B\u2ABA\u2AEAlan\xF4\u0C55\u0100;s\u0C55\u2AF4\xBB\u0C36i\xED\u0C5D\u0100;r\u0C35\u2AFEi\u0100;e\u0C1A\u0C25i\xE4\u0D90\u0100pt\u2B0C\u2B11f;\uC000\u{1D55F}\u8180\xAC;in\u2B19\u2B1A\u2B36\u40ACn\u0200;Edv\u0B89\u2B24\u2B28\u2B2E;\uC000\u22F9\u0338ot;\uC000\u22F5\u0338\u01E1\u0B89\u2B33\u2B35;\u62F7;\u62F6i\u0100;v\u0CB8\u2B3C\u01E1\u0CB8\u2B41\u2B43;\u62FE;\u62FD\u0180aor\u2B4B\u2B63\u2B69r\u0200;ast\u0B7B\u2B55\u2B5A\u2B5Flle\xEC\u0B7Bl;\uC000\u2AFD\u20E5;\uC000\u2202\u0338lint;\u6A14\u0180;ce\u0C92\u2B70\u2B73u\xE5\u0CA5\u0100;c\u0C98\u2B78\u0100;e\u0C92\u2B7D\xF1\u0C98\u0200Aait\u2B88\u2B8B\u2B9D\u2BA7r\xF2\u2988rr\u0180;cw\u2B94\u2B95\u2B99\u619B;\uC000\u2933\u0338;\uC000\u219D\u0338ghtarrow\xBB\u2B95ri\u0100;e\u0CCB\u0CD6\u0380chimpqu\u2BBD\u2BCD\u2BD9\u2B04\u0B78\u2BE4\u2BEF\u0200;cer\u0D32\u2BC6\u0D37\u2BC9u\xE5\u0D45;\uC000\u{1D4C3}ort\u026D\u2B05\0\0\u2BD6ar\xE1\u2B56m\u0100;e\u0D6E\u2BDF\u0100;q\u0D74\u0D73su\u0100bp\u2BEB\u2BED\xE5\u0CF8\xE5\u0D0B\u0180bcp\u2BF6\u2C11\u2C19\u0200;Ees\u2BFF\u2C00\u0D22\u2C04\u6284;\uC000\u2AC5\u0338et\u0100;e\u0D1B\u2C0Bq\u0100;q\u0D23\u2C00c\u0100;e\u0D32\u2C17\xF1\u0D38\u0200;Ees\u2C22\u2C23\u0D5F\u2C27\u6285;\uC000\u2AC6\u0338et\u0100;e\u0D58\u2C2Eq\u0100;q\u0D60\u2C23\u0200gilr\u2C3D\u2C3F\u2C45\u2C47\xEC\u0BD7lde\u803B\xF1\u40F1\xE7\u0C43iangle\u0100lr\u2C52\u2C5Ceft\u0100;e\u0C1A\u2C5A\xF1\u0C26ight\u0100;e\u0CCB\u2C65\xF1\u0CD7\u0100;m\u2C6C\u2C6D\u43BD\u0180;es\u2C74\u2C75\u2C79\u4023ro;\u6116p;\u6007\u0480DHadgilrs\u2C8F\u2C94\u2C99\u2C9E\u2CA3\u2CB0\u2CB6\u2CD3\u2CE3ash;\u62ADarr;\u6904p;\uC000\u224D\u20D2ash;\u62AC\u0100et\u2CA8\u2CAC;\uC000\u2265\u20D2;\uC000>\u20D2nfin;\u69DE\u0180Aet\u2CBD\u2CC1\u2CC5rr;\u6902;\uC000\u2264\u20D2\u0100;r\u2CCA\u2CCD\uC000<\u20D2ie;\uC000\u22B4\u20D2\u0100At\u2CD8\u2CDCrr;\u6903rie;\uC000\u22B5\u20D2im;\uC000\u223C\u20D2\u0180Aan\u2CF0\u2CF4\u2D02rr;\u61D6r\u0100hr\u2CFA\u2CFDk;\u6923\u0100;o\u13E7\u13E5ear;\u6927\u1253\u1A95\0\0\0\0\0\0\0\0\0\0\0\0\0\u2D2D\0\u2D38\u2D48\u2D60\u2D65\u2D72\u2D84\u1B07\0\0\u2D8D\u2DAB\0\u2DC8\u2DCE\0\u2DDC\u2E19\u2E2B\u2E3E\u2E43\u0100cs\u2D31\u1A97ute\u803B\xF3\u40F3\u0100iy\u2D3C\u2D45r\u0100;c\u1A9E\u2D42\u803B\xF4\u40F4;\u443E\u0280abios\u1AA0\u2D52\u2D57\u01C8\u2D5Alac;\u4151v;\u6A38old;\u69BClig;\u4153\u0100cr\u2D69\u2D6Dir;\u69BF;\uC000\u{1D52C}\u036F\u2D79\0\0\u2D7C\0\u2D82n;\u42DBave\u803B\xF2\u40F2;\u69C1\u0100bm\u2D88\u0DF4ar;\u69B5\u0200acit\u2D95\u2D98\u2DA5\u2DA8r\xF2\u1A80\u0100ir\u2D9D\u2DA0r;\u69BEoss;\u69BBn\xE5\u0E52;\u69C0\u0180aei\u2DB1\u2DB5\u2DB9cr;\u414Dga;\u43C9\u0180cdn\u2DC0\u2DC5\u01CDron;\u43BF;\u69B6pf;\uC000\u{1D560}\u0180ael\u2DD4\u2DD7\u01D2r;\u69B7rp;\u69B9\u0380;adiosv\u2DEA\u2DEB\u2DEE\u2E08\u2E0D\u2E10\u2E16\u6228r\xF2\u1A86\u0200;efm\u2DF7\u2DF8\u2E02\u2E05\u6A5Dr\u0100;o\u2DFE\u2DFF\u6134f\xBB\u2DFF\u803B\xAA\u40AA\u803B\xBA\u40BAgof;\u62B6r;\u6A56lope;\u6A57;\u6A5B\u0180clo\u2E1F\u2E21\u2E27\xF2\u2E01ash\u803B\xF8\u40F8l;\u6298i\u016C\u2E2F\u2E34de\u803B\xF5\u40F5es\u0100;a\u01DB\u2E3As;\u6A36ml\u803B\xF6\u40F6bar;\u633D\u0AE1\u2E5E\0\u2E7D\0\u2E80\u2E9D\0\u2EA2\u2EB9\0\0\u2ECB\u0E9C\0\u2F13\0\0\u2F2B\u2FBC\0\u2FC8r\u0200;ast\u0403\u2E67\u2E72\u0E85\u8100\xB6;l\u2E6D\u2E6E\u40B6le\xEC\u0403\u0269\u2E78\0\0\u2E7Bm;\u6AF3;\u6AFDy;\u443Fr\u0280cimpt\u2E8B\u2E8F\u2E93\u1865\u2E97nt;\u4025od;\u402Eil;\u6030enk;\u6031r;\uC000\u{1D52D}\u0180imo\u2EA8\u2EB0\u2EB4\u0100;v\u2EAD\u2EAE\u43C6;\u43D5ma\xF4\u0A76ne;\u660E\u0180;tv\u2EBF\u2EC0\u2EC8\u43C0chfork\xBB\u1FFD;\u43D6\u0100au\u2ECF\u2EDFn\u0100ck\u2ED5\u2EDDk\u0100;h\u21F4\u2EDB;\u610E\xF6\u21F4s\u0480;abcdemst\u2EF3\u2EF4\u1908\u2EF9\u2EFD\u2F04\u2F06\u2F0A\u2F0E\u402Bcir;\u6A23ir;\u6A22\u0100ou\u1D40\u2F02;\u6A25;\u6A72n\u80BB\xB1\u0E9Dim;\u6A26wo;\u6A27\u0180ipu\u2F19\u2F20\u2F25ntint;\u6A15f;\uC000\u{1D561}nd\u803B\xA3\u40A3\u0500;Eaceinosu\u0EC8\u2F3F\u2F41\u2F44\u2F47\u2F81\u2F89\u2F92\u2F7E\u2FB6;\u6AB3p;\u6AB7u\xE5\u0ED9\u0100;c\u0ECE\u2F4C\u0300;acens\u0EC8\u2F59\u2F5F\u2F66\u2F68\u2F7Eppro\xF8\u2F43urlye\xF1\u0ED9\xF1\u0ECE\u0180aes\u2F6F\u2F76\u2F7Approx;\u6AB9qq;\u6AB5im;\u62E8i\xED\u0EDFme\u0100;s\u2F88\u0EAE\u6032\u0180Eas\u2F78\u2F90\u2F7A\xF0\u2F75\u0180dfp\u0EEC\u2F99\u2FAF\u0180als\u2FA0\u2FA5\u2FAAlar;\u632Eine;\u6312urf;\u6313\u0100;t\u0EFB\u2FB4\xEF\u0EFBrel;\u62B0\u0100ci\u2FC0\u2FC5r;\uC000\u{1D4C5};\u43C8ncsp;\u6008\u0300fiopsu\u2FDA\u22E2\u2FDF\u2FE5\u2FEB\u2FF1r;\uC000\u{1D52E}pf;\uC000\u{1D562}rime;\u6057cr;\uC000\u{1D4C6}\u0180aeo\u2FF8\u3009\u3013t\u0100ei\u2FFE\u3005rnion\xF3\u06B0nt;\u6A16st\u0100;e\u3010\u3011\u403F\xF1\u1F19\xF4\u0F14\u0A80ABHabcdefhilmnoprstux\u3040\u3051\u3055\u3059\u30E0\u310E\u312B\u3147\u3162\u3172\u318E\u3206\u3215\u3224\u3229\u3258\u326E\u3272\u3290\u32B0\u32B7\u0180art\u3047\u304A\u304Cr\xF2\u10B3\xF2\u03DDail;\u691Car\xF2\u1C65ar;\u6964\u0380cdenqrt\u3068\u3075\u3078\u307F\u308F\u3094\u30CC\u0100eu\u306D\u3071;\uC000\u223D\u0331te;\u4155i\xE3\u116Emptyv;\u69B3g\u0200;del\u0FD1\u3089\u308B\u308D;\u6992;\u69A5\xE5\u0FD1uo\u803B\xBB\u40BBr\u0580;abcfhlpstw\u0FDC\u30AC\u30AF\u30B7\u30B9\u30BC\u30BE\u30C0\u30C3\u30C7\u30CAp;\u6975\u0100;f\u0FE0\u30B4s;\u6920;\u6933s;\u691E\xEB\u225D\xF0\u272El;\u6945im;\u6974l;\u61A3;\u619D\u0100ai\u30D1\u30D5il;\u691Ao\u0100;n\u30DB\u30DC\u6236al\xF3\u0F1E\u0180abr\u30E7\u30EA\u30EEr\xF2\u17E5rk;\u6773\u0100ak\u30F3\u30FDc\u0100ek\u30F9\u30FB;\u407D;\u405D\u0100es\u3102\u3104;\u698Cl\u0100du\u310A\u310C;\u698E;\u6990\u0200aeuy\u3117\u311C\u3127\u3129ron;\u4159\u0100di\u3121\u3125il;\u4157\xEC\u0FF2\xE2\u30FA;\u4440\u0200clqs\u3134\u3137\u313D\u3144a;\u6937dhar;\u6969uo\u0100;r\u020E\u020Dh;\u61B3\u0180acg\u314E\u315F\u0F44l\u0200;ips\u0F78\u3158\u315B\u109Cn\xE5\u10BBar\xF4\u0FA9t;\u65AD\u0180ilr\u3169\u1023\u316Esht;\u697D;\uC000\u{1D52F}\u0100ao\u3177\u3186r\u0100du\u317D\u317F\xBB\u047B\u0100;l\u1091\u3184;\u696C\u0100;v\u318B\u318C\u43C1;\u43F1\u0180gns\u3195\u31F9\u31FCht\u0300ahlrst\u31A4\u31B0\u31C2\u31D8\u31E4\u31EErrow\u0100;t\u0FDC\u31ADa\xE9\u30C8arpoon\u0100du\u31BB\u31BFow\xEE\u317Ep\xBB\u1092eft\u0100ah\u31CA\u31D0rrow\xF3\u0FEAarpoon\xF3\u0551ightarrows;\u61C9quigarro\xF7\u30CBhreetimes;\u62CCg;\u42DAingdotse\xF1\u1F32\u0180ahm\u320D\u3210\u3213r\xF2\u0FEAa\xF2\u0551;\u600Foust\u0100;a\u321E\u321F\u63B1che\xBB\u321Fmid;\u6AEE\u0200abpt\u3232\u323D\u3240\u3252\u0100nr\u3237\u323Ag;\u67EDr;\u61FEr\xEB\u1003\u0180afl\u3247\u324A\u324Er;\u6986;\uC000\u{1D563}us;\u6A2Eimes;\u6A35\u0100ap\u325D\u3267r\u0100;g\u3263\u3264\u4029t;\u6994olint;\u6A12ar\xF2\u31E3\u0200achq\u327B\u3280\u10BC\u3285quo;\u603Ar;\uC000\u{1D4C7}\u0100bu\u30FB\u328Ao\u0100;r\u0214\u0213\u0180hir\u3297\u329B\u32A0re\xE5\u31F8mes;\u62CAi\u0200;efl\u32AA\u1059\u1821\u32AB\u65B9tri;\u69CEluhar;\u6968;\u611E\u0D61\u32D5\u32DB\u32DF\u332C\u3338\u3371\0\u337A\u33A4\0\0\u33EC\u33F0\0\u3428\u3448\u345A\u34AD\u34B1\u34CA\u34F1\0\u3616\0\0\u3633cute;\u415Bqu\xEF\u27BA\u0500;Eaceinpsy\u11ED\u32F3\u32F5\u32FF\u3302\u330B\u330F\u331F\u3326\u3329;\u6AB4\u01F0\u32FA\0\u32FC;\u6AB8on;\u4161u\xE5\u11FE\u0100;d\u11F3\u3307il;\u415Frc;\u415D\u0180Eas\u3316\u3318\u331B;\u6AB6p;\u6ABAim;\u62E9olint;\u6A13i\xED\u1204;\u4441ot\u0180;be\u3334\u1D47\u3335\u62C5;\u6A66\u0380Aacmstx\u3346\u334A\u3357\u335B\u335E\u3363\u336Drr;\u61D8r\u0100hr\u3350\u3352\xEB\u2228\u0100;o\u0A36\u0A34t\u803B\xA7\u40A7i;\u403Bwar;\u6929m\u0100in\u3369\xF0nu\xF3\xF1t;\u6736r\u0100;o\u3376\u2055\uC000\u{1D530}\u0200acoy\u3382\u3386\u3391\u33A0rp;\u666F\u0100hy\u338B\u338Fcy;\u4449;\u4448rt\u026D\u3399\0\0\u339Ci\xE4\u1464ara\xEC\u2E6F\u803B\xAD\u40AD\u0100gm\u33A8\u33B4ma\u0180;fv\u33B1\u33B2\u33B2\u43C3;\u43C2\u0400;deglnpr\u12AB\u33C5\u33C9\u33CE\u33D6\u33DE\u33E1\u33E6ot;\u6A6A\u0100;q\u12B1\u12B0\u0100;E\u33D3\u33D4\u6A9E;\u6AA0\u0100;E\u33DB\u33DC\u6A9D;\u6A9Fe;\u6246lus;\u6A24arr;\u6972ar\xF2\u113D\u0200aeit\u33F8\u3408\u340F\u3417\u0100ls\u33FD\u3404lsetm\xE9\u336Ahp;\u6A33parsl;\u69E4\u0100dl\u1463\u3414e;\u6323\u0100;e\u341C\u341D\u6AAA\u0100;s\u3422\u3423\u6AAC;\uC000\u2AAC\uFE00\u0180flp\u342E\u3433\u3442tcy;\u444C\u0100;b\u3438\u3439\u402F\u0100;a\u343E\u343F\u69C4r;\u633Ff;\uC000\u{1D564}a\u0100dr\u344D\u0402es\u0100;u\u3454\u3455\u6660it\xBB\u3455\u0180csu\u3460\u3479\u349F\u0100au\u3465\u346Fp\u0100;s\u1188\u346B;\uC000\u2293\uFE00p\u0100;s\u11B4\u3475;\uC000\u2294\uFE00u\u0100bp\u347F\u348F\u0180;es\u1197\u119C\u3486et\u0100;e\u1197\u348D\xF1\u119D\u0180;es\u11A8\u11AD\u3496et\u0100;e\u11A8\u349D\xF1\u11AE\u0180;af\u117B\u34A6\u05B0r\u0165\u34AB\u05B1\xBB\u117Car\xF2\u1148\u0200cemt\u34B9\u34BE\u34C2\u34C5r;\uC000\u{1D4C8}tm\xEE\xF1i\xEC\u3415ar\xE6\u11BE\u0100ar\u34CE\u34D5r\u0100;f\u34D4\u17BF\u6606\u0100an\u34DA\u34EDight\u0100ep\u34E3\u34EApsilo\xEE\u1EE0h\xE9\u2EAFs\xBB\u2852\u0280bcmnp\u34FB\u355E\u1209\u358B\u358E\u0480;Edemnprs\u350E\u350F\u3511\u3515\u351E\u3523\u352C\u3531\u3536\u6282;\u6AC5ot;\u6ABD\u0100;d\u11DA\u351Aot;\u6AC3ult;\u6AC1\u0100Ee\u3528\u352A;\u6ACB;\u628Alus;\u6ABFarr;\u6979\u0180eiu\u353D\u3552\u3555t\u0180;en\u350E\u3545\u354Bq\u0100;q\u11DA\u350Feq\u0100;q\u352B\u3528m;\u6AC7\u0100bp\u355A\u355C;\u6AD5;\u6AD3c\u0300;acens\u11ED\u356C\u3572\u3579\u357B\u3326ppro\xF8\u32FAurlye\xF1\u11FE\xF1\u11F3\u0180aes\u3582\u3588\u331Bppro\xF8\u331Aq\xF1\u3317g;\u666A\u0680123;Edehlmnps\u35A9\u35AC\u35AF\u121C\u35B2\u35B4\u35C0\u35C9\u35D5\u35DA\u35DF\u35E8\u35ED\u803B\xB9\u40B9\u803B\xB2\u40B2\u803B\xB3\u40B3;\u6AC6\u0100os\u35B9\u35BCt;\u6ABEub;\u6AD8\u0100;d\u1222\u35C5ot;\u6AC4s\u0100ou\u35CF\u35D2l;\u67C9b;\u6AD7arr;\u697Bult;\u6AC2\u0100Ee\u35E4\u35E6;\u6ACC;\u628Blus;\u6AC0\u0180eiu\u35F4\u3609\u360Ct\u0180;en\u121C\u35FC\u3602q\u0100;q\u1222\u35B2eq\u0100;q\u35E7\u35E4m;\u6AC8\u0100bp\u3611\u3613;\u6AD4;\u6AD6\u0180Aan\u361C\u3620\u362Drr;\u61D9r\u0100hr\u3626\u3628\xEB\u222E\u0100;o\u0A2B\u0A29war;\u692Alig\u803B\xDF\u40DF\u0BE1\u3651\u365D\u3660\u12CE\u3673\u3679\0\u367E\u36C2\0\0\0\0\0\u36DB\u3703\0\u3709\u376C\0\0\0\u3787\u0272\u3656\0\0\u365Bget;\u6316;\u43C4r\xEB\u0E5F\u0180aey\u3666\u366B\u3670ron;\u4165dil;\u4163;\u4442lrec;\u6315r;\uC000\u{1D531}\u0200eiko\u3686\u369D\u36B5\u36BC\u01F2\u368B\0\u3691e\u01004f\u1284\u1281a\u0180;sv\u3698\u3699\u369B\u43B8ym;\u43D1\u0100cn\u36A2\u36B2k\u0100as\u36A8\u36AEppro\xF8\u12C1im\xBB\u12ACs\xF0\u129E\u0100as\u36BA\u36AE\xF0\u12C1rn\u803B\xFE\u40FE\u01EC\u031F\u36C6\u22E7es\u8180\xD7;bd\u36CF\u36D0\u36D8\u40D7\u0100;a\u190F\u36D5r;\u6A31;\u6A30\u0180eps\u36E1\u36E3\u3700\xE1\u2A4D\u0200;bcf\u0486\u36EC\u36F0\u36F4ot;\u6336ir;\u6AF1\u0100;o\u36F9\u36FC\uC000\u{1D565}rk;\u6ADA\xE1\u3362rime;\u6034\u0180aip\u370F\u3712\u3764d\xE5\u1248\u0380adempst\u3721\u374D\u3740\u3751\u3757\u375C\u375Fngle\u0280;dlqr\u3730\u3731\u3736\u3740\u3742\u65B5own\xBB\u1DBBeft\u0100;e\u2800\u373E\xF1\u092E;\u625Cight\u0100;e\u32AA\u374B\xF1\u105Aot;\u65ECinus;\u6A3Alus;\u6A39b;\u69CDime;\u6A3Bezium;\u63E2\u0180cht\u3772\u377D\u3781\u0100ry\u3777\u377B;\uC000\u{1D4C9};\u4446cy;\u445Brok;\u4167\u0100io\u378B\u378Ex\xF4\u1777head\u0100lr\u3797\u37A0eftarro\xF7\u084Fightarrow\xBB\u0F5D\u0900AHabcdfghlmoprstuw\u37D0\u37D3\u37D7\u37E4\u37F0\u37FC\u380E\u381C\u3823\u3834\u3851\u385D\u386B\u38A9\u38CC\u38D2\u38EA\u38F6r\xF2\u03EDar;\u6963\u0100cr\u37DC\u37E2ute\u803B\xFA\u40FA\xF2\u1150r\u01E3\u37EA\0\u37EDy;\u445Eve;\u416D\u0100iy\u37F5\u37FArc\u803B\xFB\u40FB;\u4443\u0180abh\u3803\u3806\u380Br\xF2\u13ADlac;\u4171a\xF2\u13C3\u0100ir\u3813\u3818sht;\u697E;\uC000\u{1D532}rave\u803B\xF9\u40F9\u0161\u3827\u3831r\u0100lr\u382C\u382E\xBB\u0957\xBB\u1083lk;\u6580\u0100ct\u3839\u384D\u026F\u383F\0\0\u384Arn\u0100;e\u3845\u3846\u631Cr\xBB\u3846op;\u630Fri;\u65F8\u0100al\u3856\u385Acr;\u416B\u80BB\xA8\u0349\u0100gp\u3862\u3866on;\u4173f;\uC000\u{1D566}\u0300adhlsu\u114B\u3878\u387D\u1372\u3891\u38A0own\xE1\u13B3arpoon\u0100lr\u3888\u388Cef\xF4\u382Digh\xF4\u382Fi\u0180;hl\u3899\u389A\u389C\u43C5\xBB\u13FAon\xBB\u389Aparrows;\u61C8\u0180cit\u38B0\u38C4\u38C8\u026F\u38B6\0\0\u38C1rn\u0100;e\u38BC\u38BD\u631Dr\xBB\u38BDop;\u630Eng;\u416Fri;\u65F9cr;\uC000\u{1D4CA}\u0180dir\u38D9\u38DD\u38E2ot;\u62F0lde;\u4169i\u0100;f\u3730\u38E8\xBB\u1813\u0100am\u38EF\u38F2r\xF2\u38A8l\u803B\xFC\u40FCangle;\u69A7\u0780ABDacdeflnoprsz\u391C\u391F\u3929\u392D\u39B5\u39B8\u39BD\u39DF\u39E4\u39E8\u39F3\u39F9\u39FD\u3A01\u3A20r\xF2\u03F7ar\u0100;v\u3926\u3927\u6AE8;\u6AE9as\xE8\u03E1\u0100nr\u3932\u3937grt;\u699C\u0380eknprst\u34E3\u3946\u394B\u3952\u395D\u3964\u3996app\xE1\u2415othin\xE7\u1E96\u0180hir\u34EB\u2EC8\u3959op\xF4\u2FB5\u0100;h\u13B7\u3962\xEF\u318D\u0100iu\u3969\u396Dgm\xE1\u33B3\u0100bp\u3972\u3984setneq\u0100;q\u397D\u3980\uC000\u228A\uFE00;\uC000\u2ACB\uFE00setneq\u0100;q\u398F\u3992\uC000\u228B\uFE00;\uC000\u2ACC\uFE00\u0100hr\u399B\u399Fet\xE1\u369Ciangle\u0100lr\u39AA\u39AFeft\xBB\u0925ight\xBB\u1051y;\u4432ash\xBB\u1036\u0180elr\u39C4\u39D2\u39D7\u0180;be\u2DEA\u39CB\u39CFar;\u62BBq;\u625Alip;\u62EE\u0100bt\u39DC\u1468a\xF2\u1469r;\uC000\u{1D533}tr\xE9\u39AEsu\u0100bp\u39EF\u39F1\xBB\u0D1C\xBB\u0D59pf;\uC000\u{1D567}ro\xF0\u0EFBtr\xE9\u39B4\u0100cu\u3A06\u3A0Br;\uC000\u{1D4CB}\u0100bp\u3A10\u3A18n\u0100Ee\u3980\u3A16\xBB\u397En\u0100Ee\u3992\u3A1E\xBB\u3990igzag;\u699A\u0380cefoprs\u3A36\u3A3B\u3A56\u3A5B\u3A54\u3A61\u3A6Airc;\u4175\u0100di\u3A40\u3A51\u0100bg\u3A45\u3A49ar;\u6A5Fe\u0100;q\u15FA\u3A4F;\u6259erp;\u6118r;\uC000\u{1D534}pf;\uC000\u{1D568}\u0100;e\u1479\u3A66at\xE8\u1479cr;\uC000\u{1D4CC}\u0AE3\u178E\u3A87\0\u3A8B\0\u3A90\u3A9B\0\0\u3A9D\u3AA8\u3AAB\u3AAF\0\0\u3AC3\u3ACE\0\u3AD8\u17DC\u17DFtr\xE9\u17D1r;\uC000\u{1D535}\u0100Aa\u3A94\u3A97r\xF2\u03C3r\xF2\u09F6;\u43BE\u0100Aa\u3AA1\u3AA4r\xF2\u03B8r\xF2\u09EBa\xF0\u2713is;\u62FB\u0180dpt\u17A4\u3AB5\u3ABE\u0100fl\u3ABA\u17A9;\uC000\u{1D569}im\xE5\u17B2\u0100Aa\u3AC7\u3ACAr\xF2\u03CEr\xF2\u0A01\u0100cq\u3AD2\u17B8r;\uC000\u{1D4CD}\u0100pt\u17D6\u3ADCr\xE9\u17D4\u0400acefiosu\u3AF0\u3AFD\u3B08\u3B0C\u3B11\u3B15\u3B1B\u3B21c\u0100uy\u3AF6\u3AFBte\u803B\xFD\u40FD;\u444F\u0100iy\u3B02\u3B06rc;\u4177;\u444Bn\u803B\xA5\u40A5r;\uC000\u{1D536}cy;\u4457pf;\uC000\u{1D56A}cr;\uC000\u{1D4CE}\u0100cm\u3B26\u3B29y;\u444El\u803B\xFF\u40FF\u0500acdefhiosw\u3B42\u3B48\u3B54\u3B58\u3B64\u3B69\u3B6D\u3B74\u3B7A\u3B80cute;\u417A\u0100ay\u3B4D\u3B52ron;\u417E;\u4437ot;\u417C\u0100et\u3B5D\u3B61tr\xE6\u155Fa;\u43B6r;\uC000\u{1D537}cy;\u4436grarr;\u61DDpf;\uC000\u{1D56B}cr;\uC000\u{1D4CF}\u0100jn\u3B85\u3B87;\u600Dj;\u600C'.split("").map(e=>e.charCodeAt(0)));var hM=new Uint16Array("\u0200aglq \x1B\u026D\0\0p;\u4026os;\u4027t;\u403Et;\u403Cuot;\u4022".split("").map(e=>e.charCodeAt(0)));var s1,yF=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]),a1=(s1=String.fromCodePoint)!==null&&s1!==void 0?s1:function(e){let t="";return e>65535&&(e-=65536,t+=String.fromCharCode(e>>>10&1023|55296),e=56320|e&1023),t+=String.fromCharCode(e),t};function l1(e){var t;return e>=55296&&e<=57343||e>1114111?65533:(t=yF.get(e))!==null&&t!==void 0?t:e}var mt;(function(e){e[e.NUM=35]="NUM",e[e.SEMI=59]="SEMI",e[e.EQUALS=61]="EQUALS",e[e.ZERO=48]="ZERO",e[e.NINE=57]="NINE",e[e.LOWER_A=97]="LOWER_A",e[e.LOWER_F=102]="LOWER_F",e[e.LOWER_X=120]="LOWER_X",e[e.LOWER_Z=122]="LOWER_Z",e[e.UPPER_A=65]="UPPER_A",e[e.UPPER_F=70]="UPPER_F",e[e.UPPER_Z=90]="UPPER_Z"})(mt||(mt={}));var vF=32,Or;(function(e){e[e.VALUE_LENGTH=49152]="VALUE_LENGTH",e[e.BRANCH_LENGTH=16256]="BRANCH_LENGTH",e[e.JUMP_TABLE=127]="JUMP_TABLE"})(Or||(Or={}));function u1(e){return e>=mt.ZERO&&e<=mt.NINE}function xF(e){return e>=mt.UPPER_A&&e<=mt.UPPER_F||e>=mt.LOWER_A&&e<=mt.LOWER_F}function kF(e){return e>=mt.UPPER_A&&e<=mt.UPPER_Z||e>=mt.LOWER_A&&e<=mt.LOWER_Z||u1(e)}function wF(e){return e===mt.EQUALS||kF(e)}var ht;(function(e){e[e.EntityStart=0]="EntityStart",e[e.NumericStart=1]="NumericStart",e[e.NumericDecimal=2]="NumericDecimal",e[e.NumericHex=3]="NumericHex",e[e.NamedEntity=4]="NamedEntity"})(ht||(ht={}));var vn;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(vn||(vn={}));var Rf=class{constructor(t,n,o){this.decodeTree=t,this.emitCodePoint=n,this.errors=o,this.state=ht.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=vn.Strict}startEntity(t){this.decodeMode=t,this.state=ht.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(t,n){switch(this.state){case ht.EntityStart:return t.charCodeAt(n)===mt.NUM?(this.state=ht.NumericStart,this.consumed+=1,this.stateNumericStart(t,n+1)):(this.state=ht.NamedEntity,this.stateNamedEntity(t,n));case ht.NumericStart:return this.stateNumericStart(t,n);case ht.NumericDecimal:return this.stateNumericDecimal(t,n);case ht.NumericHex:return this.stateNumericHex(t,n);case ht.NamedEntity:return this.stateNamedEntity(t,n)}}stateNumericStart(t,n){return n>=t.length?-1:(t.charCodeAt(n)|vF)===mt.LOWER_X?(this.state=ht.NumericHex,this.consumed+=1,this.stateNumericHex(t,n+1)):(this.state=ht.NumericDecimal,this.stateNumericDecimal(t,n))}addToNumericResult(t,n,o,r){if(n!==o){let i=o-n;this.result=this.result*Math.pow(r,i)+parseInt(t.substr(n,i),r),this.consumed+=i}}stateNumericHex(t,n){let o=n;for(;n<t.length;){let r=t.charCodeAt(n);if(u1(r)||xF(r))n+=1;else return this.addToNumericResult(t,o,n,16),this.emitNumericEntity(r,3)}return this.addToNumericResult(t,o,n,16),-1}stateNumericDecimal(t,n){let o=n;for(;n<t.length;){let r=t.charCodeAt(n);if(u1(r))n+=1;else return this.addToNumericResult(t,o,n,10),this.emitNumericEntity(r,2)}return this.addToNumericResult(t,o,n,10),-1}emitNumericEntity(t,n){var o;if(this.consumed<=n)return(o=this.errors)===null||o===void 0||o.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(t===mt.SEMI)this.consumed+=1;else if(this.decodeMode===vn.Strict)return 0;return this.emitCodePoint(l1(this.result),this.consumed),this.errors&&(t!==mt.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(t,n){let{decodeTree:o}=this,r=o[this.treeIndex],i=(r&Or.VALUE_LENGTH)>>14;for(;n<t.length;n++,this.excess++){let s=t.charCodeAt(n);if(this.treeIndex=SF(o,r,this.treeIndex+Math.max(1,i),s),this.treeIndex<0)return this.result===0||this.decodeMode===vn.Attribute&&(i===0||wF(s))?0:this.emitNotTerminatedNamedEntity();if(r=o[this.treeIndex],i=(r&Or.VALUE_LENGTH)>>14,i!==0){if(s===mt.SEMI)return this.emitNamedEntityData(this.treeIndex,i,this.consumed+this.excess);this.decodeMode!==vn.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var t;let{result:n,decodeTree:o}=this,r=(o[n]&Or.VALUE_LENGTH)>>14;return this.emitNamedEntityData(n,r,this.consumed),(t=this.errors)===null||t===void 0||t.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(t,n,o){let{decodeTree:r}=this;return this.emitCodePoint(n===1?r[t]&~Or.VALUE_LENGTH:r[t+1],o),n===3&&this.emitCodePoint(r[t+2],o),o}end(){var t;switch(this.state){case ht.NamedEntity:return this.result!==0&&(this.decodeMode!==vn.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case ht.NumericDecimal:return this.emitNumericEntity(0,2);case ht.NumericHex:return this.emitNumericEntity(0,3);case ht.NumericStart:return(t=this.errors)===null||t===void 0||t.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case ht.EntityStart:return 0}}};function mM(e){let t="",n=new Rf(e,o=>t+=a1(o));return function(r,i){let s=0,a=0;for(;(a=r.indexOf("&",a))>=0;){t+=r.slice(s,a),n.startEntity(i);let u=n.write(r,a+1);if(u<0){s=a+n.end();break}s=a+u,a=u===0?s+1:s}let l=t+r.slice(s);return t="",l}}function SF(e,t,n,o){let r=(t&Or.BRANCH_LENGTH)>>7,i=t&Or.JUMP_TABLE;if(r===0)return i!==0&&o===i?n:-1;if(i){let l=o-i;return l<0||l>=r?-1:e[n+l]-1}let s=n,a=s+r-1;for(;s<=a;){let l=s+a>>>1,u=e[l];if(u<o)s=l+1;else if(u>o)a=l-1;else return e[l+r]}return-1}var gM=mM(pM),ZY=mM(hM);function is(e,t=vn.Legacy){return gM(e,t)}function al(e){return gM(e,vn.Strict)}function Pf(e){for(let t=1;t<e.length;t++)e[t][0]+=e[t-1][0]+1;return e}var _F=new Map(Pf([[9,"	"],[0,"
"],[22,"!"],[0,"""],[0,"#"],[0,"$"],[0,"%"],[0,"&"],[0,"'"],[0,"("],[0,")"],[0,"*"],[0,"+"],[0,","],[1,"."],[0,"/"],[10,":"],[0,";"],[0,{v:"<",n:8402,o:"<⃒"}],[0,{v:"=",n:8421,o:"=⃥"}],[0,{v:">",n:8402,o:">⃒"}],[0,"?"],[0,"@"],[26,"["],[0,"\"],[0,"]"],[0,"^"],[0,"_"],[0,"`"],[5,{n:106,o:"fj"}],[20,"{"],[0,"|"],[0,"}"],[34," "],[0,"¡"],[0,"¢"],[0,"£"],[0,"¤"],[0,"¥"],[0,"¦"],[0,"§"],[0,"¨"],[0,"©"],[0,"ª"],[0,"«"],[0,"¬"],[0,"­"],[0,"®"],[0,"¯"],[0,"°"],[0,"±"],[0,"²"],[0,"³"],[0,"´"],[0,"µ"],[0,"¶"],[0,"·"],[0,"¸"],[0,"¹"],[0,"º"],[0,"»"],[0,"¼"],[0,"½"],[0,"¾"],[0,"¿"],[0,"À"],[0,"Á"],[0,"Â"],[0,"Ã"],[0,"Ä"],[0,"Å"],[0,"Æ"],[0,"Ç"],[0,"È"],[0,"É"],[0,"Ê"],[0,"Ë"],[0,"Ì"],[0,"Í"],[0,"Î"],[0,"Ï"],[0,"Ð"],[0,"Ñ"],[0,"Ò"],[0,"Ó"],[0,"Ô"],[0,"Õ"],[0,"Ö"],[0,"×"],[0,"Ø"],[0,"Ù"],[0,"Ú"],[0,"Û"],[0,"Ü"],[0,"Ý"],[0,"Þ"],[0,"ß"],[0,"à"],[0,"á"],[0,"â"],[0,"ã"],[0,"ä"],[0,"å"],[0,"æ"],[0,"ç"],[0,"è"],[0,"é"],[0,"ê"],[0,"ë"],[0,"ì"],[0,"í"],[0,"î"],[0,"ï"],[0,"ð"],[0,"ñ"],[0,"ò"],[0,"ó"],[0,"ô"],[0,"õ"],[0,"ö"],[0,"÷"],[0,"ø"],[0,"ù"],[0,"ú"],[0,"û"],[0,"ü"],[0,"ý"],[0,"þ"],[0,"ÿ"],[0,"Ā"],[0,"ā"],[0,"Ă"],[0,"ă"],[0,"Ą"],[0,"ą"],[0,"Ć"],[0,"ć"],[0,"Ĉ"],[0,"ĉ"],[0,"Ċ"],[0,"ċ"],[0,"Č"],[0,"č"],[0,"Ď"],[0,"ď"],[0,"Đ"],[0,"đ"],[0,"Ē"],[0,"ē"],[2,"Ė"],[0,"ė"],[0,"Ę"],[0,"ę"],[0,"Ě"],[0,"ě"],[0,"Ĝ"],[0,"ĝ"],[0,"Ğ"],[0,"ğ"],[0,"Ġ"],[0,"ġ"],[0,"Ģ"],[1,"Ĥ"],[0,"ĥ"],[0,"Ħ"],[0,"ħ"],[0,"Ĩ"],[0,"ĩ"],[0,"Ī"],[0,"ī"],[2,"Į"],[0,"į"],[0,"İ"],[0,"ı"],[0,"IJ"],[0,"ij"],[0,"Ĵ"],[0,"ĵ"],[0,"Ķ"],[0,"ķ"],[0,"ĸ"],[0,"Ĺ"],[0,"ĺ"],[0,"Ļ"],[0,"ļ"],[0,"Ľ"],[0,"ľ"],[0,"Ŀ"],[0,"ŀ"],[0,"Ł"],[0,"ł"],[0,"Ń"],[0,"ń"],[0,"Ņ"],[0,"ņ"],[0,"Ň"],[0,"ň"],[0,"ʼn"],[0,"Ŋ"],[0,"ŋ"],[0,"Ō"],[0,"ō"],[2,"Ő"],[0,"ő"],[0,"Œ"],[0,"œ"],[0,"Ŕ"],[0,"ŕ"],[0,"Ŗ"],[0,"ŗ"],[0,"Ř"],[0,"ř"],[0,"Ś"],[0,"ś"],[0,"Ŝ"],[0,"ŝ"],[0,"Ş"],[0,"ş"],[0,"Š"],[0,"š"],[0,"Ţ"],[0,"ţ"],[0,"Ť"],[0,"ť"],[0,"Ŧ"],[0,"ŧ"],[0,"Ũ"],[0,"ũ"],[0,"Ū"],[0,"ū"],[0,"Ŭ"],[0,"ŭ"],[0,"Ů"],[0,"ů"],[0,"Ű"],[0,"ű"],[0,"Ų"],[0,"ų"],[0,"Ŵ"],[0,"ŵ"],[0,"Ŷ"],[0,"ŷ"],[0,"Ÿ"],[0,"Ź"],[0,"ź"],[0,"Ż"],[0,"ż"],[0,"Ž"],[0,"ž"],[19,"ƒ"],[34,"Ƶ"],[63,"ǵ"],[65,"ȷ"],[142,"ˆ"],[0,"ˇ"],[16,"˘"],[0,"˙"],[0,"˚"],[0,"˛"],[0,"˜"],[0,"˝"],[51,"̑"],[127,"Α"],[0,"Β"],[0,"Γ"],[0,"Δ"],[0,"Ε"],[0,"Ζ"],[0,"Η"],[0,"Θ"],[0,"Ι"],[0,"Κ"],[0,"Λ"],[0,"Μ"],[0,"Ν"],[0,"Ξ"],[0,"Ο"],[0,"Π"],[0,"Ρ"],[1,"Σ"],[0,"Τ"],[0,"Υ"],[0,"Φ"],[0,"Χ"],[0,"Ψ"],[0,"Ω"],[7,"α"],[0,"β"],[0,"γ"],[0,"δ"],[0,"ε"],[0,"ζ"],[0,"η"],[0,"θ"],[0,"ι"],[0,"κ"],[0,"λ"],[0,"μ"],[0,"ν"],[0,"ξ"],[0,"ο"],[0,"π"],[0,"ρ"],[0,"ς"],[0,"σ"],[0,"τ"],[0,"υ"],[0,"φ"],[0,"χ"],[0,"ψ"],[0,"ω"],[7,"ϑ"],[0,"ϒ"],[2,"ϕ"],[0,"ϖ"],[5,"Ϝ"],[0,"ϝ"],[18,"ϰ"],[0,"ϱ"],[3,"ϵ"],[0,"϶"],[10,"Ё"],[0,"Ђ"],[0,"Ѓ"],[0,"Є"],[0,"Ѕ"],[0,"І"],[0,"Ї"],[0,"Ј"],[0,"Љ"],[0,"Њ"],[0,"Ћ"],[0,"Ќ"],[1,"Ў"],[0,"Џ"],[0,"А"],[0,"Б"],[0,"В"],[0,"Г"],[0,"Д"],[0,"Е"],[0,"Ж"],[0,"З"],[0,"И"],[0,"Й"],[0,"К"],[0,"Л"],[0,"М"],[0,"Н"],[0,"О"],[0,"П"],[0,"Р"],[0,"С"],[0,"Т"],[0,"У"],[0,"Ф"],[0,"Х"],[0,"Ц"],[0,"Ч"],[0,"Ш"],[0,"Щ"],[0,"Ъ"],[0,"Ы"],[0,"Ь"],[0,"Э"],[0,"Ю"],[0,"Я"],[0,"а"],[0,"б"],[0,"в"],[0,"г"],[0,"д"],[0,"е"],[0,"ж"],[0,"з"],[0,"и"],[0,"й"],[0,"к"],[0,"л"],[0,"м"],[0,"н"],[0,"о"],[0,"п"],[0,"р"],[0,"с"],[0,"т"],[0,"у"],[0,"ф"],[0,"х"],[0,"ц"],[0,"ч"],[0,"ш"],[0,"щ"],[0,"ъ"],[0,"ы"],[0,"ь"],[0,"э"],[0,"ю"],[0,"я"],[1,"ё"],[0,"ђ"],[0,"ѓ"],[0,"є"],[0,"ѕ"],[0,"і"],[0,"ї"],[0,"ј"],[0,"љ"],[0,"њ"],[0,"ћ"],[0,"ќ"],[1,"ў"],[0,"џ"],[7074," "],[0," "],[0," "],[0," "],[1," "],[0," "],[0," "],[0," "],[0,"​"],[0,"‌"],[0,"‍"],[0,"‎"],[0,"‏"],[0,"‐"],[2,"–"],[0,"—"],[0,"―"],[0,"‖"],[1,"‘"],[0,"’"],[0,"‚"],[1,"“"],[0,"”"],[0,"„"],[1,"†"],[0,"‡"],[0,"•"],[2,"‥"],[0,"…"],[9,"‰"],[0,"‱"],[0,"′"],[0,"″"],[0,"‴"],[0,"‵"],[3,"‹"],[0,"›"],[3,"‾"],[2,"⁁"],[1,"⁃"],[0,"⁄"],[10,"⁏"],[7,"⁗"],[7,{v:" ",n:8202,o:"  "}],[0,"⁠"],[0,"⁡"],[0,"⁢"],[0,"⁣"],[72,"€"],[46,"⃛"],[0,"⃜"],[37,"ℂ"],[2,"℅"],[4,"ℊ"],[0,"ℋ"],[0,"ℌ"],[0,"ℍ"],[0,"ℎ"],[0,"ℏ"],[0,"ℐ"],[0,"ℑ"],[0,"ℒ"],[0,"ℓ"],[1,"ℕ"],[0,"№"],[0,"℗"],[0,"℘"],[0,"ℙ"],[0,"ℚ"],[0,"ℛ"],[0,"ℜ"],[0,"ℝ"],[0,"℞"],[3,"™"],[1,"ℤ"],[2,"℧"],[0,"ℨ"],[0,"℩"],[2,"ℬ"],[0,"ℭ"],[1,"ℯ"],[0,"ℰ"],[0,"ℱ"],[1,"ℳ"],[0,"ℴ"],[0,"ℵ"],[0,"ℶ"],[0,"ℷ"],[0,"ℸ"],[12,"ⅅ"],[0,"ⅆ"],[0,"ⅇ"],[0,"ⅈ"],[10,"⅓"],[0,"⅔"],[0,"⅕"],[0,"⅖"],[0,"⅗"],[0,"⅘"],[0,"⅙"],[0,"⅚"],[0,"⅛"],[0,"⅜"],[0,"⅝"],[0,"⅞"],[49,"←"],[0,"↑"],[0,"→"],[0,"↓"],[0,"↔"],[0,"↕"],[0,"↖"],[0,"↗"],[0,"↘"],[0,"↙"],[0,"↚"],[0,"↛"],[1,{v:"↝",n:824,o:"↝̸"}],[0,"↞"],[0,"↟"],[0,"↠"],[0,"↡"],[0,"↢"],[0,"↣"],[0,"↤"],[0,"↥"],[0,"↦"],[0,"↧"],[1,"↩"],[0,"↪"],[0,"↫"],[0,"↬"],[0,"↭"],[0,"↮"],[1,"↰"],[0,"↱"],[0,"↲"],[0,"↳"],[1,"↵"],[0,"↶"],[0,"↷"],[2,"↺"],[0,"↻"],[0,"↼"],[0,"↽"],[0,"↾"],[0,"↿"],[0,"⇀"],[0,"⇁"],[0,"⇂"],[0,"⇃"],[0,"⇄"],[0,"⇅"],[0,"⇆"],[0,"⇇"],[0,"⇈"],[0,"⇉"],[0,"⇊"],[0,"⇋"],[0,"⇌"],[0,"⇍"],[0,"⇎"],[0,"⇏"],[0,"⇐"],[0,"⇑"],[0,"⇒"],[0,"⇓"],[0,"⇔"],[0,"⇕"],[0,"⇖"],[0,"⇗"],[0,"⇘"],[0,"⇙"],[0,"⇚"],[0,"⇛"],[1,"⇝"],[6,"⇤"],[0,"⇥"],[15,"⇵"],[7,"⇽"],[0,"⇾"],[0,"⇿"],[0,"∀"],[0,"∁"],[0,{v:"∂",n:824,o:"∂̸"}],[0,"∃"],[0,"∄"],[0,"∅"],[1,"∇"],[0,"∈"],[0,"∉"],[1,"∋"],[0,"∌"],[2,"∏"],[0,"∐"],[0,"∑"],[0,"−"],[0,"∓"],[0,"∔"],[1,"∖"],[0,"∗"],[0,"∘"],[1,"√"],[2,"∝"],[0,"∞"],[0,"∟"],[0,{v:"∠",n:8402,o:"∠⃒"}],[0,"∡"],[0,"∢"],[0,"∣"],[0,"∤"],[0,"∥"],[0,"∦"],[0,"∧"],[0,"∨"],[0,{v:"∩",n:65024,o:"∩︀"}],[0,{v:"∪",n:65024,o:"∪︀"}],[0,"∫"],[0,"∬"],[0,"∭"],[0,"∮"],[0,"∯"],[0,"∰"],[0,"∱"],[0,"∲"],[0,"∳"],[0,"∴"],[0,"∵"],[0,"∶"],[0,"∷"],[0,"∸"],[1,"∺"],[0,"∻"],[0,{v:"∼",n:8402,o:"∼⃒"}],[0,{v:"∽",n:817,o:"∽̱"}],[0,{v:"∾",n:819,o:"∾̳"}],[0,"∿"],[0,"≀"],[0,"≁"],[0,{v:"≂",n:824,o:"≂̸"}],[0,"≃"],[0,"≄"],[0,"≅"],[0,"≆"],[0,"≇"],[0,"≈"],[0,"≉"],[0,"≊"],[0,{v:"≋",n:824,o:"≋̸"}],[0,"≌"],[0,{v:"≍",n:8402,o:"≍⃒"}],[0,{v:"≎",n:824,o:"≎̸"}],[0,{v:"≏",n:824,o:"≏̸"}],[0,{v:"≐",n:824,o:"≐̸"}],[0,"≑"],[0,"≒"],[0,"≓"],[0,"≔"],[0,"≕"],[0,"≖"],[0,"≗"],[1,"≙"],[0,"≚"],[1,"≜"],[2,"≟"],[0,"≠"],[0,{v:"≡",n:8421,o:"≡⃥"}],[0,"≢"],[1,{v:"≤",n:8402,o:"≤⃒"}],[0,{v:"≥",n:8402,o:"≥⃒"}],[0,{v:"≦",n:824,o:"≦̸"}],[0,{v:"≧",n:824,o:"≧̸"}],[0,{v:"≨",n:65024,o:"≨︀"}],[0,{v:"≩",n:65024,o:"≩︀"}],[0,{v:"≪",n:new Map(Pf([[824,"≪̸"],[7577,"≪⃒"]]))}],[0,{v:"≫",n:new Map(Pf([[824,"≫̸"],[7577,"≫⃒"]]))}],[0,"≬"],[0,"≭"],[0,"≮"],[0,"≯"],[0,"≰"],[0,"≱"],[0,"≲"],[0,"≳"],[0,"≴"],[0,"≵"],[0,"≶"],[0,"≷"],[0,"≸"],[0,"≹"],[0,"≺"],[0,"≻"],[0,"≼"],[0,"≽"],[0,"≾"],[0,{v:"≿",n:824,o:"≿̸"}],[0,"⊀"],[0,"⊁"],[0,{v:"⊂",n:8402,o:"⊂⃒"}],[0,{v:"⊃",n:8402,o:"⊃⃒"}],[0,"⊄"],[0,"⊅"],[0,"⊆"],[0,"⊇"],[0,"⊈"],[0,"⊉"],[0,{v:"⊊",n:65024,o:"⊊︀"}],[0,{v:"⊋",n:65024,o:"⊋︀"}],[1,"⊍"],[0,"⊎"],[0,{v:"⊏",n:824,o:"⊏̸"}],[0,{v:"⊐",n:824,o:"⊐̸"}],[0,"⊑"],[0,"⊒"],[0,{v:"⊓",n:65024,o:"⊓︀"}],[0,{v:"⊔",n:65024,o:"⊔︀"}],[0,"⊕"],[0,"⊖"],[0,"⊗"],[0,"⊘"],[0,"⊙"],[0,"⊚"],[0,"⊛"],[1,"⊝"],[0,"⊞"],[0,"⊟"],[0,"⊠"],[0,"⊡"],[0,"⊢"],[0,"⊣"],[0,"⊤"],[0,"⊥"],[1,"⊧"],[0,"⊨"],[0,"⊩"],[0,"⊪"],[0,"⊫"],[0,"⊬"],[0,"⊭"],[0,"⊮"],[0,"⊯"],[0,"⊰"],[1,"⊲"],[0,"⊳"],[0,{v:"⊴",n:8402,o:"⊴⃒"}],[0,{v:"⊵",n:8402,o:"⊵⃒"}],[0,"⊶"],[0,"⊷"],[0,"⊸"],[0,"⊹"],[0,"⊺"],[0,"⊻"],[1,"⊽"],[0,"⊾"],[0,"⊿"],[0,"⋀"],[0,"⋁"],[0,"⋂"],[0,"⋃"],[0,"⋄"],[0,"⋅"],[0,"⋆"],[0,"⋇"],[0,"⋈"],[0,"⋉"],[0,"⋊"],[0,"⋋"],[0,"⋌"],[0,"⋍"],[0,"⋎"],[0,"⋏"],[0,"⋐"],[0,"⋑"],[0,"⋒"],[0,"⋓"],[0,"⋔"],[0,"⋕"],[0,"⋖"],[0,"⋗"],[0,{v:"⋘",n:824,o:"⋘̸"}],[0,{v:"⋙",n:824,o:"⋙̸"}],[0,{v:"⋚",n:65024,o:"⋚︀"}],[0,{v:"⋛",n:65024,o:"⋛︀"}],[2,"⋞"],[0,"⋟"],[0,"⋠"],[0,"⋡"],[0,"⋢"],[0,"⋣"],[2,"⋦"],[0,"⋧"],[0,"⋨"],[0,"⋩"],[0,"⋪"],[0,"⋫"],[0,"⋬"],[0,"⋭"],[0,"⋮"],[0,"⋯"],[0,"⋰"],[0,"⋱"],[0,"⋲"],[0,"⋳"],[0,"⋴"],[0,{v:"⋵",n:824,o:"⋵̸"}],[0,"⋶"],[0,"⋷"],[1,{v:"⋹",n:824,o:"⋹̸"}],[0,"⋺"],[0,"⋻"],[0,"⋼"],[0,"⋽"],[0,"⋾"],[6,"⌅"],[0,"⌆"],[1,"⌈"],[0,"⌉"],[0,"⌊"],[0,"⌋"],[0,"⌌"],[0,"⌍"],[0,"⌎"],[0,"⌏"],[0,"⌐"],[1,"⌒"],[0,"⌓"],[1,"⌕"],[0,"⌖"],[5,"⌜"],[0,"⌝"],[0,"⌞"],[0,"⌟"],[2,"⌢"],[0,"⌣"],[9,"⌭"],[0,"⌮"],[7,"⌶"],[6,"⌽"],[1,"⌿"],[60,"⍼"],[51,"⎰"],[0,"⎱"],[2,"⎴"],[0,"⎵"],[0,"⎶"],[37,"⏜"],[0,"⏝"],[0,"⏞"],[0,"⏟"],[2,"⏢"],[4,"⏧"],[59,"␣"],[164,"Ⓢ"],[55,"─"],[1,"│"],[9,"┌"],[3,"┐"],[3,"└"],[3,"┘"],[3,"├"],[7,"┤"],[7,"┬"],[7,"┴"],[7,"┼"],[19,"═"],[0,"║"],[0,"╒"],[0,"╓"],[0,"╔"],[0,"╕"],[0,"╖"],[0,"╗"],[0,"╘"],[0,"╙"],[0,"╚"],[0,"╛"],[0,"╜"],[0,"╝"],[0,"╞"],[0,"╟"],[0,"╠"],[0,"╡"],[0,"╢"],[0,"╣"],[0,"╤"],[0,"╥"],[0,"╦"],[0,"╧"],[0,"╨"],[0,"╩"],[0,"╪"],[0,"╫"],[0,"╬"],[19,"▀"],[3,"▄"],[3,"█"],[8,"░"],[0,"▒"],[0,"▓"],[13,"□"],[8,"▪"],[0,"▫"],[1,"▭"],[0,"▮"],[2,"▱"],[1,"△"],[0,"▴"],[0,"▵"],[2,"▸"],[0,"▹"],[3,"▽"],[0,"▾"],[0,"▿"],[2,"◂"],[0,"◃"],[6,"◊"],[0,"○"],[32,"◬"],[2,"◯"],[8,"◸"],[0,"◹"],[0,"◺"],[0,"◻"],[0,"◼"],[8,"★"],[0,"☆"],[7,"☎"],[49,"♀"],[1,"♂"],[29,"♠"],[2,"♣"],[1,"♥"],[0,"♦"],[3,"♪"],[2,"♭"],[0,"♮"],[0,"♯"],[163,"✓"],[3,"✗"],[8,"✠"],[21,"✶"],[33,"❘"],[25,"❲"],[0,"❳"],[84,"⟈"],[0,"⟉"],[28,"⟦"],[0,"⟧"],[0,"⟨"],[0,"⟩"],[0,"⟪"],[0,"⟫"],[0,"⟬"],[0,"⟭"],[7,"⟵"],[0,"⟶"],[0,"⟷"],[0,"⟸"],[0,"⟹"],[0,"⟺"],[1,"⟼"],[2,"⟿"],[258,"⤂"],[0,"⤃"],[0,"⤄"],[0,"⤅"],[6,"⤌"],[0,"⤍"],[0,"⤎"],[0,"⤏"],[0,"⤐"],[0,"⤑"],[0,"⤒"],[0,"⤓"],[2,"⤖"],[2,"⤙"],[0,"⤚"],[0,"⤛"],[0,"⤜"],[0,"⤝"],[0,"⤞"],[0,"⤟"],[0,"⤠"],[2,"⤣"],[0,"⤤"],[0,"⤥"],[0,"⤦"],[0,"⤧"],[0,"⤨"],[0,"⤩"],[0,"⤪"],[8,{v:"⤳",n:824,o:"⤳̸"}],[1,"⤵"],[0,"⤶"],[0,"⤷"],[0,"⤸"],[0,"⤹"],[2,"⤼"],[0,"⤽"],[7,"⥅"],[2,"⥈"],[0,"⥉"],[0,"⥊"],[0,"⥋"],[2,"⥎"],[0,"⥏"],[0,"⥐"],[0,"⥑"],[0,"⥒"],[0,"⥓"],[0,"⥔"],[0,"⥕"],[0,"⥖"],[0,"⥗"],[0,"⥘"],[0,"⥙"],[0,"⥚"],[0,"⥛"],[0,"⥜"],[0,"⥝"],[0,"⥞"],[0,"⥟"],[0,"⥠"],[0,"⥡"],[0,"⥢"],[0,"⥣"],[0,"⥤"],[0,"⥥"],[0,"⥦"],[0,"⥧"],[0,"⥨"],[0,"⥩"],[0,"⥪"],[0,"⥫"],[0,"⥬"],[0,"⥭"],[0,"⥮"],[0,"⥯"],[0,"⥰"],[0,"⥱"],[0,"⥲"],[0,"⥳"],[0,"⥴"],[0,"⥵"],[0,"⥶"],[1,"⥸"],[0,"⥹"],[1,"⥻"],[0,"⥼"],[0,"⥽"],[0,"⥾"],[0,"⥿"],[5,"⦅"],[0,"⦆"],[4,"⦋"],[0,"⦌"],[0,"⦍"],[0,"⦎"],[0,"⦏"],[0,"⦐"],[0,"⦑"],[0,"⦒"],[0,"⦓"],[0,"⦔"],[0,"⦕"],[0,"⦖"],[3,"⦚"],[1,"⦜"],[0,"⦝"],[6,"⦤"],[0,"⦥"],[0,"⦦"],[0,"⦧"],[0,"⦨"],[0,"⦩"],[0,"⦪"],[0,"⦫"],[0,"⦬"],[0,"⦭"],[0,"⦮"],[0,"⦯"],[0,"⦰"],[0,"⦱"],[0,"⦲"],[0,"⦳"],[0,"⦴"],[0,"⦵"],[0,"⦶"],[0,"⦷"],[1,"⦹"],[1,"⦻"],[0,"⦼"],[1,"⦾"],[0,"⦿"],[0,"⧀"],[0,"⧁"],[0,"⧂"],[0,"⧃"],[0,"⧄"],[0,"⧅"],[3,"⧉"],[3,"⧍"],[0,"⧎"],[0,{v:"⧏",n:824,o:"⧏̸"}],[0,{v:"⧐",n:824,o:"⧐̸"}],[11,"⧜"],[0,"⧝"],[0,"⧞"],[4,"⧣"],[0,"⧤"],[0,"⧥"],[5,"⧫"],[8,"⧴"],[1,"⧶"],[9,"⨀"],[0,"⨁"],[0,"⨂"],[1,"⨄"],[1,"⨆"],[5,"⨌"],[0,"⨍"],[2,"⨐"],[0,"⨑"],[0,"⨒"],[0,"⨓"],[0,"⨔"],[0,"⨕"],[0,"⨖"],[0,"⨗"],[10,"⨢"],[0,"⨣"],[0,"⨤"],[0,"⨥"],[0,"⨦"],[0,"⨧"],[1,"⨩"],[0,"⨪"],[2,"⨭"],[0,"⨮"],[0,"⨯"],[0,"⨰"],[0,"⨱"],[1,"⨳"],[0,"⨴"],[0,"⨵"],[0,"⨶"],[0,"⨷"],[0,"⨸"],[0,"⨹"],[0,"⨺"],[0,"⨻"],[0,"⨼"],[2,"⨿"],[0,"⩀"],[1,"⩂"],[0,"⩃"],[0,"⩄"],[0,"⩅"],[0,"⩆"],[0,"⩇"],[0,"⩈"],[0,"⩉"],[0,"⩊"],[0,"⩋"],[0,"⩌"],[0,"⩍"],[2,"⩐"],[2,"⩓"],[0,"⩔"],[0,"⩕"],[0,"⩖"],[0,"⩗"],[0,"⩘"],[1,"⩚"],[0,"⩛"],[0,"⩜"],[0,"⩝"],[1,"⩟"],[6,"⩦"],[3,"⩪"],[2,{v:"⩭",n:824,o:"⩭̸"}],[0,"⩮"],[0,"⩯"],[0,{v:"⩰",n:824,o:"⩰̸"}],[0,"⩱"],[0,"⩲"],[0,"⩳"],[0,"⩴"],[0,"⩵"],[1,"⩷"],[0,"⩸"],[0,"⩹"],[0,"⩺"],[0,"⩻"],[0,"⩼"],[0,{v:"⩽",n:824,o:"⩽̸"}],[0,{v:"⩾",n:824,o:"⩾̸"}],[0,"⩿"],[0,"⪀"],[0,"⪁"],[0,"⪂"],[0,"⪃"],[0,"⪄"],[0,"⪅"],[0,"⪆"],[0,"⪇"],[0,"⪈"],[0,"⪉"],[0,"⪊"],[0,"⪋"],[0,"⪌"],[0,"⪍"],[0,"⪎"],[0,"⪏"],[0,"⪐"],[0,"⪑"],[0,"⪒"],[0,"⪓"],[0,"⪔"],[0,"⪕"],[0,"⪖"],[0,"⪗"],[0,"⪘"],[0,"⪙"],[0,"⪚"],[2,"⪝"],[0,"⪞"],[0,"⪟"],[0,"⪠"],[0,{v:"⪡",n:824,o:"⪡̸"}],[0,{v:"⪢",n:824,o:"⪢̸"}],[1,"⪤"],[0,"⪥"],[0,"⪦"],[0,"⪧"],[0,"⪨"],[0,"⪩"],[0,"⪪"],[0,"⪫"],[0,{v:"⪬",n:65024,o:"⪬︀"}],[0,{v:"⪭",n:65024,o:"⪭︀"}],[0,"⪮"],[0,{v:"⪯",n:824,o:"⪯̸"}],[0,{v:"⪰",n:824,o:"⪰̸"}],[2,"⪳"],[0,"⪴"],[0,"⪵"],[0,"⪶"],[0,"⪷"],[0,"⪸"],[0,"⪹"],[0,"⪺"],[0,"⪻"],[0,"⪼"],[0,"⪽"],[0,"⪾"],[0,"⪿"],[0,"⫀"],[0,"⫁"],[0,"⫂"],[0,"⫃"],[0,"⫄"],[0,{v:"⫅",n:824,o:"⫅̸"}],[0,{v:"⫆",n:824,o:"⫆̸"}],[0,"⫇"],[0,"⫈"],[2,{v:"⫋",n:65024,o:"⫋︀"}],[0,{v:"⫌",n:65024,o:"⫌︀"}],[2,"⫏"],[0,"⫐"],[0,"⫑"],[0,"⫒"],[0,"⫓"],[0,"⫔"],[0,"⫕"],[0,"⫖"],[0,"⫗"],[0,"⫘"],[0,"⫙"],[0,"⫚"],[0,"⫛"],[8,"⫤"],[1,"⫦"],[0,"⫧"],[0,"⫨"],[0,"⫩"],[1,"⫫"],[0,"⫬"],[0,"⫭"],[0,"⫮"],[0,"⫯"],[0,"⫰"],[0,"⫱"],[0,"⫲"],[0,"⫳"],[9,{v:"⫽",n:8421,o:"⫽⃥"}],[44343,{n:new Map(Pf([[56476,"𝒜"],[1,"𝒞"],[0,"𝒟"],[2,"𝒢"],[2,"𝒥"],[0,"𝒦"],[2,"𝒩"],[0,"𝒪"],[0,"𝒫"],[0,"𝒬"],[1,"𝒮"],[0,"𝒯"],[0,"𝒰"],[0,"𝒱"],[0,"𝒲"],[0,"𝒳"],[0,"𝒴"],[0,"𝒵"],[0,"𝒶"],[0,"𝒷"],[0,"𝒸"],[0,"𝒹"],[1,"𝒻"],[1,"𝒽"],[0,"𝒾"],[0,"𝒿"],[0,"𝓀"],[0,"𝓁"],[0,"𝓂"],[0,"𝓃"],[1,"𝓅"],[0,"𝓆"],[0,"𝓇"],[0,"𝓈"],[0,"𝓉"],[0,"𝓊"],[0,"𝓋"],[0,"𝓌"],[0,"𝓍"],[0,"𝓎"],[0,"𝓏"],[52,"𝔄"],[0,"𝔅"],[1,"𝔇"],[0,"𝔈"],[0,"𝔉"],[0,"𝔊"],[2,"𝔍"],[0,"𝔎"],[0,"𝔏"],[0,"𝔐"],[0,"𝔑"],[0,"𝔒"],[0,"𝔓"],[0,"𝔔"],[1,"𝔖"],[0,"𝔗"],[0,"𝔘"],[0,"𝔙"],[0,"𝔚"],[0,"𝔛"],[0,"𝔜"],[1,"𝔞"],[0,"𝔟"],[0,"𝔠"],[0,"𝔡"],[0,"𝔢"],[0,"𝔣"],[0,"𝔤"],[0,"𝔥"],[0,"𝔦"],[0,"𝔧"],[0,"𝔨"],[0,"𝔩"],[0,"𝔪"],[0,"𝔫"],[0,"𝔬"],[0,"𝔭"],[0,"𝔮"],[0,"𝔯"],[0,"𝔰"],[0,"𝔱"],[0,"𝔲"],[0,"𝔳"],[0,"𝔴"],[0,"𝔵"],[0,"𝔶"],[0,"𝔷"],[0,"𝔸"],[0,"𝔹"],[1,"𝔻"],[0,"𝔼"],[0,"𝔽"],[0,"𝔾"],[1,"𝕀"],[0,"𝕁"],[0,"𝕂"],[0,"𝕃"],[0,"𝕄"],[1,"𝕆"],[3,"𝕊"],[0,"𝕋"],[0,"𝕌"],[0,"𝕍"],[0,"𝕎"],[0,"𝕏"],[0,"𝕐"],[1,"𝕒"],[0,"𝕓"],[0,"𝕔"],[0,"𝕕"],[0,"𝕖"],[0,"𝕗"],[0,"𝕘"],[0,"𝕙"],[0,"𝕚"],[0,"𝕛"],[0,"𝕜"],[0,"𝕝"],[0,"𝕞"],[0,"𝕟"],[0,"𝕠"],[0,"𝕡"],[0,"𝕢"],[0,"𝕣"],[0,"𝕤"],[0,"𝕥"],[0,"𝕦"],[0,"𝕧"],[0,"𝕨"],[0,"𝕩"],[0,"𝕪"],[0,"𝕫"]]))}],[8906,"ff"],[0,"fi"],[0,"fl"],[0,"ffi"],[0,"ffl"]]));var EF=new Map([[34,"""],[38,"&"],[39,"'"],[60,"<"],[62,">"]]),CF=String.prototype.codePointAt!=null?(e,t)=>e.codePointAt(t):(e,t)=>(e.charCodeAt(t)&64512)===55296?(e.charCodeAt(t)-55296)*1024+e.charCodeAt(t+1)-56320+65536:e.charCodeAt(t);function c1(e,t){return function(o){let r,i=0,s="";for(;r=e.exec(o);)i!==r.index&&(s+=o.substring(i,r.index)),s+=t.get(r[0].charCodeAt(0)),i=r.index+1;return s+o.substring(i)}}var bM=c1(/[&<>'"]/g,EF),yM=c1(/["&\u00A0]/g,new Map([[34,"""],[38,"&"],[160," "]])),vM=c1(/[&<>\u00A0]/g,new Map([[38,"&"],[60,"<"],[62,">"],[160," "]]));var xM;(function(e){e[e.XML=0]="XML",e[e.HTML=1]="HTML"})(xM||(xM={}));var kM;(function(e){e[e.UTF8=0]="UTF8",e[e.ASCII=1]="ASCII",e[e.Extensive=2]="Extensive",e[e.Attribute=3]="Attribute",e[e.Text=4]="Text"})(kM||(kM={}));function MF(e){return Object.prototype.toString.call(e)}function Lf(e){return MF(e)==="[object String]"}var $F=Object.prototype.hasOwnProperty;function IF(e,t){return $F.call(e,t)}function ss(e){return Array.prototype.slice.call(arguments,1).forEach(function(n){if(n){if(typeof n!="object")throw new TypeError(n+"must be object");Object.keys(n).forEach(function(o){e[o]=n[o]})}}),e}function DF(e,t,n){return[].concat(e.slice(0,t),n,e.slice(t+1))}function Ff(e){return!(e>=55296&&e<=57343||e>=64976&&e<=65007||(e&65535)===65535||(e&65535)===65534||e>=0&&e<=8||e===11||e>=14&&e<=31||e>=127&&e<=159||e>1114111)}function as(e){if(e>65535){e-=65536;let t=55296+(e>>10),n=56320+(e&1023);return String.fromCharCode(t,n)}return String.fromCharCode(e)}var _M=/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g,NF=/&([a-z#][a-z0-9]{1,31});/gi,zF=new RegExp(_M.source+"|"+NF.source,"gi"),OF=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function RF(e,t){if(t.charCodeAt(0)===35&&OF.test(t)){let o=t[1].toLowerCase()==="x"?parseInt(t.slice(2),16):parseInt(t.slice(1),10);return Ff(o)?as(o):e}let n=is(e);return n!==e?n:e}function PF(e){return e.indexOf("\\")<0?e:e.replace(_M,"$1")}function ur(e){return e.indexOf("\\")<0&&e.indexOf("&")<0?e:e.replace(zF,function(t,n,o){return n||RF(t,o)})}var LF=/[&<>"]/,FF=/[&<>"]/g,jF={"&":"&","<":"<",">":">",'"':"""};function BF(e){return jF[e]}function cr(e){return LF.test(e)?e.replace(FF,BF):e}var UF=/[.?*+^$[\]\\(){}|-]/g;function HF(e){return e.replace(UF,"\\$&")}function ye(e){switch(e){case 9:case 32:return!0}return!1}function To(e){if(e>=8192&&e<=8202)return!0;switch(e){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1}function EM(e){return rs.test(e)||zf.test(e)}function Ao(e){return EM(as(e))}function Mo(e){switch(e){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}}function $o(e){return e=e.trim().replace(/\s+/g," "),"\u1E9E".toLowerCase()==="\u1E7E"&&(e=e.replace(/ẞ/g,"\xDF")),e.toLowerCase().toUpperCase()}function SM(e){return e===32||e===9||e===10||e===13}function Io(e){let t=0;for(;t<e.length&&SM(e.charCodeAt(t));t++);let n=e.length-1;for(;n>=t&&SM(e.charCodeAt(n));n--);return e.slice(t,n+1)}var qF={mdurl:If,ucmicro:i1};var g1={};en(g1,{parseLinkDestination:()=>h1,parseLinkLabel:()=>p1,parseLinkTitle:()=>m1});function p1(e,t,n){let o,r,i,s,a=e.posMax,l=e.pos;for(e.pos=t+1,o=1;e.pos<a;){if(i=e.src.charCodeAt(e.pos),i===93&&(o--,o===0)){r=!0;break}if(s=e.pos,e.md.inline.skipToken(e),i===91){if(s===e.pos-1)o++;else if(n)return e.pos=l,-1}}let u=-1;return r&&(u=e.pos),e.pos=l,u}function h1(e,t,n){let o,r=t,i={ok:!1,pos:0,str:""};if(e.charCodeAt(r)===60){for(r++;r<n;){if(o=e.charCodeAt(r),o===10||o===60)return i;if(o===62)return i.pos=r+1,i.str=ur(e.slice(t+1,r)),i.ok=!0,i;if(o===92&&r+1<n){r+=2;continue}r++}return i}let s=0;for(;r<n&&(o=e.charCodeAt(r),!(o===32||o<32||o===127));){if(o===92&&r+1<n){if(e.charCodeAt(r+1)===32){r++;continue}r+=2;continue}if(o===40&&(s++,s>32))return i;if(o===41){if(s===0)break;s--}r++}return t===r||s!==0||(i.str=ur(e.slice(t,r)),i.pos=r,i.ok=!0),i}function m1(e,t,n,o){let r,i=t,s={ok:!1,can_continue:!1,pos:0,str:"",marker:0};if(o)s.str=o.str,s.marker=o.marker;else{if(i>=n)return s;let a=e.charCodeAt(i);if(a!==34&&a!==39&&a!==40)return s;t++,i++,a===40&&(a=41),s.marker=a}for(;i<n;){if(r=e.charCodeAt(i),r===s.marker)return s.pos=i+1,s.str+=ur(e.slice(t,i)),s.ok=!0,s;if(r===40&&s.marker===41)return s;r===92&&i+1<n&&i++,i++}return s.can_continue=!0,s.str+=ur(e.slice(t,i)),s}var Fn={};Fn.code_inline=function(e,t,n,o,r){let i=e[t];return"<code"+r.renderAttrs(i)+">"+cr(i.content)+"</code>"};Fn.code_block=function(e,t,n,o,r){let i=e[t];return"<pre"+r.renderAttrs(i)+"><code>"+cr(e[t].content)+`</code></pre>
`};Fn.fence=function(e,t,n,o,r){let i=e[t],s=i.info?ur(i.info).trim():"",a="",l="";if(s){let c=s.split(/(\s+)/g);a=c[0],l=c.slice(2).join("")}let u;if(n.highlight?u=n.highlight(i.content,a,l)||cr(i.content):u=cr(i.content),u.indexOf("<pre")===0)return u+`
`;if(s){let c=i.attrIndex("class"),d=i.attrs?i.attrs.slice():[];c<0?d.push(["class",n.langPrefix+a]):(d[c]=d[c].slice(),d[c][1]+=" "+n.langPrefix+a);let f={attrs:d};return`<pre><code${r.renderAttrs(f)}>${u}</code></pre>
`}return`<pre><code${r.renderAttrs(i)}>${u}</code></pre>
`};Fn.image=function(e,t,n,o,r){let i=e[t];return i.attrs[i.attrIndex("alt")][1]=r.renderInlineAsText(i.children,n,o),r.renderToken(e,t,n)};Fn.hardbreak=function(e,t,n){return n.xhtmlOut?`<br />
`:`<br>
`};Fn.softbreak=function(e,t,n){return n.breaks?n.xhtmlOut?`<br />
`:`<br>
`:`
`};Fn.text=function(e,t){return cr(e[t].content)};Fn.html_block=function(e,t){return e[t].content};Fn.html_inline=function(e,t){return e[t].content};function ls(){this.rules=ss({},Fn)}ls.prototype.renderAttrs=function(t){let n,o,r;if(!t.attrs)return"";for(r="",n=0,o=t.attrs.length;n<o;n++)r+=" "+cr(t.attrs[n][0])+'="'+cr(t.attrs[n][1])+'"';return r};ls.prototype.renderToken=function(t,n,o){let r=t[n],i="";if(r.hidden)return"";r.block&&r.nesting!==-1&&n&&t[n-1].hidden&&(i+=`
`),i+=(r.nesting===-1?"</":"<")+r.tag,i+=this.renderAttrs(r),r.nesting===0&&o.xhtmlOut&&(i+=" /");let s=!1;if(r.block&&(s=!0,r.nesting===1&&n+1<t.length)){let a=t[n+1];(a.type==="inline"||a.hidden||a.nesting===-1&&a.tag===r.tag)&&(s=!1)}return i+=s?`>
`:">",i};ls.prototype.renderInline=function(e,t,n){let o="",r=this.rules;for(let i=0,s=e.length;i<s;i++){let a=e[i].type;typeof r[a]<"u"?o+=r[a](e,i,t,n,this):o+=this.renderToken(e,i,t)}return o};ls.prototype.renderInlineAsText=function(e,t,n){let o="";for(let r=0,i=e.length;r<i;r++)switch(e[r].type){case"text":o+=e[r].content;break;case"image":o+=this.renderInlineAsText(e[r].children,t,n);break;case"html_inline":case"html_block":o+=e[r].content;break;case"softbreak":case"hardbreak":o+=`
`;break;default:}return o};ls.prototype.render=function(e,t,n){let o="",r=this.rules;for(let i=0,s=e.length;i<s;i++){let a=e[i].type;a==="inline"?o+=this.renderInline(e[i].children,t,n):typeof r[a]<"u"?o+=r[a](e,i,t,n,this):o+=this.renderToken(e,i,t,n)}return o};var CM=ls;function xn(){this.__rules__=[],this.__cache__=null}xn.prototype.__find__=function(e){for(let t=0;t<this.__rules__.length;t++)if(this.__rules__[t].name===e)return t;return-1};xn.prototype.__compile__=function(){let e=this,t=[""];e.__rules__.forEach(function(n){n.enabled&&n.alt.forEach(function(o){t.indexOf(o)<0&&t.push(o)})}),e.__cache__={},t.forEach(function(n){e.__cache__[n]=[],e.__rules__.forEach(function(o){o.enabled&&(n&&o.alt.indexOf(n)<0||e.__cache__[n].push(o.fn))})})};xn.prototype.at=function(e,t,n){let o=this.__find__(e),r=n||{};if(o===-1)throw new Error("Parser rule not found: "+e);this.__rules__[o].fn=t,this.__rules__[o].alt=r.alt||[],this.__cache__=null};xn.prototype.before=function(e,t,n,o){let r=this.__find__(e),i=o||{};if(r===-1)throw new Error("Parser rule not found: "+e);this.__rules__.splice(r,0,{name:t,enabled:!0,fn:n,alt:i.alt||[]}),this.__cache__=null};xn.prototype.after=function(e,t,n,o){let r=this.__find__(e),i=o||{};if(r===-1)throw new Error("Parser rule not found: "+e);this.__rules__.splice(r+1,0,{name:t,enabled:!0,fn:n,alt:i.alt||[]}),this.__cache__=null};xn.prototype.push=function(e,t,n){let o=n||{};this.__rules__.push({name:e,enabled:!0,fn:t,alt:o.alt||[]}),this.__cache__=null};xn.prototype.enable=function(e,t){Array.isArray(e)||(e=[e]);let n=[];return e.forEach(function(o){let r=this.__find__(o);if(r<0){if(t)return;throw new Error("Rules manager: invalid rule name "+o)}this.__rules__[r].enabled=!0,n.push(o)},this),this.__cache__=null,n};xn.prototype.enableOnly=function(e,t){Array.isArray(e)||(e=[e]),this.__rules__.forEach(function(n){n.enabled=!1}),this.enable(e,t)};xn.prototype.disable=function(e,t){Array.isArray(e)||(e=[e]);let n=[];return e.forEach(function(o){let r=this.__find__(o);if(r<0){if(t)return;throw new Error("Rules manager: invalid rule name "+o)}this.__rules__[r].enabled=!1,n.push(o)},this),this.__cache__=null,n};xn.prototype.getRules=function(e){return this.__cache__===null&&this.__compile__(),this.__cache__[e]||[]};var Do=xn;function us(e,t,n){this.type=e,this.tag=t,this.attrs=null,this.map=null,this.nesting=n,this.level=0,this.children=null,this.content="",this.markup="",this.info="",this.meta=null,this.block=!1,this.hidden=!1}us.prototype.attrIndex=function(t){if(!this.attrs)return-1;let n=this.attrs;for(let o=0,r=n.length;o<r;o++)if(n[o][0]===t)return o;return-1};us.prototype.attrPush=function(t){this.attrs?this.attrs.push(t):this.attrs=[t]};us.prototype.attrSet=function(t,n){let o=this.attrIndex(t),r=[t,n];o<0?this.attrPush(r):this.attrs[o]=r};us.prototype.attrGet=function(t){let n=this.attrIndex(t),o=null;return n>=0&&(o=this.attrs[n][1]),o};us.prototype.attrJoin=function(t,n){let o=this.attrIndex(t);o<0?this.attrPush([t,n]):this.attrs[o][1]=this.attrs[o][1]+" "+n};var dr=us;function TM(e,t,n){this.src=e,this.env=n,this.tokens=[],this.inlineMode=!1,this.md=t}TM.prototype.Token=dr;var AM=TM;var ZF=/\r\n?|\n/g,VF=/\0/g;function b1(e){let t;t=e.src.replace(ZF,`
`),t=t.replace(VF,"\uFFFD"),e.src=t}function y1(e){let t;e.inlineMode?(t=new e.Token("inline","",0),t.content=e.src,t.map=[0,1],t.children=[],e.tokens.push(t)):e.md.block.parse(e.src,e.md,e.env,e.tokens)}function v1(e){let t=e.tokens;for(let n=0,o=t.length;n<o;n++){let r=t[n];r.type==="inline"&&e.md.inline.parse(r.content,e.md,e.env,r.children)}}function WF(e){return/^<a[>\s]/i.test(e)}function KF(e){return/^<\/a\s*>/i.test(e)}function x1(e){let t=e.tokens;if(e.md.options.linkify)for(let n=0,o=t.length;n<o;n++){if(t[n].type!=="inline"||!e.md.linkify.pretest(t[n].content))continue;let r=t[n].children,i=[],s=0;for(let a=r.length-1;a>=0;a--){let l=r[a];if(l.type==="link_close"){for(a--;r[a].level!==l.level&&r[a].type!=="link_open";)a--;continue}if(l.type==="html_inline"&&(WF(l.content)&&s>0&&s--,KF(l.content)&&s++),!(s>0)&&l.type==="text"&&e.md.linkify.test(l.content)){let u=l.content,c=e.md.linkify.match(u),d=[],f=l.level,h=0;c.length>0&&c[0].index===0&&a>0&&r[a-1].type==="text_special"&&(c=c.slice(1));for(let p=0;p<c.length;p++){let m=c[p].url,g=e.md.normalizeLink(m);if(!e.md.validateLink(g))continue;let b=c[p].text;c[p].schema?c[p].schema==="mailto:"&&!/^mailto:/i.test(b)?b=e.md.normalizeLinkText("mailto:"+b).replace(/^mailto:/,""):b=e.md.normalizeLinkText(b):b=e.md.normalizeLinkText("http://"+b).replace(/^http:\/\//,"");let y=c[p].index;if(y>h){let I=new e.Token("text","",0);I.content=u.slice(h,y),I.level=f,d.push(I)}let k=new e.Token("link_open","a",1);k.attrs=[["href",g]],k.level=f++,k.markup="linkify",k.info="auto",d.push(k);let x=new e.Token("text","",0);x.content=b,x.level=f,d.push(x);let E=new e.Token("link_close","a",-1);E.level=--f,E.markup="linkify",E.info="auto",d.push(E),h=c[p].lastIndex}if(h<u.length){let p=new e.Token("text","",0);p.content=u.slice(h),p.level=f,d.push(p)}i.push({index:a,nodes:d})}}if(i.length>0){let a=r.length;for(let d of i)a+=d.nodes.length-1;let l=new Array(a),u=0,c=0;i.reverse();for(let d=0;d<r.length;d++){let f=i[u];if(f?.index===d){for(let h of f.nodes)l[c++]=h;u++}else l[c++]=r[d]}t[n].children=l}}}var MM=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,JF=/\((c|tm|r)\)/i,GF=/\((c|tm|r)\)/ig,QF={c:"\xA9",r:"\xAE",tm:"\u2122"};function XF(e,t){return QF[t.toLowerCase()]}function YF(e){let t=0;for(let n=e.length-1;n>=0;n--){let o=e[n];o.type==="text"&&!t&&(o.content=o.content.replace(GF,XF)),o.type==="link_open"&&o.info==="auto"&&t--,o.type==="link_close"&&o.info==="auto"&&t++}}function ej(e){let t=0;for(let n=e.length-1;n>=0;n--){let o=e[n];o.type==="text"&&!t&&MM.test(o.content)&&(o.content=o.content.replace(/\+-/g,"\xB1").replace(/\.{2,}/g,"\u2026").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]|$)/mg,"$1\u2014").replace(/(^|\s)--(?=\s|$)/mg,"$1\u2013").replace(/(^|[^-\s])--(?=[^-\s]|$)/mg,"$1\u2013")),o.type==="link_open"&&o.info==="auto"&&t--,o.type==="link_close"&&o.info==="auto"&&t++}}function k1(e){let t;if(e.md.options.typographer)for(t=e.tokens.length-1;t>=0;t--)e.tokens[t].type==="inline"&&(JF.test(e.tokens[t].content)&&YF(e.tokens[t].children),MM.test(e.tokens[t].content)&&ej(e.tokens[t].children))}var tj=/['"]/,$M=/['"]/g,IM="\u2019",nj=1e3;function DM(e,t,n){for(;e.length>n;){let o=e.pop();o.isSingleQuote?t.single=o.prevSameQuoteIdx:t.double=o.prevSameQuoteIdx}}function jf(e,t,n,o){e[t]||(e[t]=[]),e[t].push({pos:n,ch:o})}function rj(e,t){let n="",o=0;t.sort((r,i)=>r.pos-i.pos);for(let r=0;r<t.length;r++){let i=t[r];n+=e.slice(o,i.pos)+i.ch,o=i.pos+1}return n+e.slice(o)}function oj(e,t){let n,o=[],r={single:-1,double:-1},i={};for(let s=0;s<e.length;s++){let a=e[s],l=e[s].level;for(n=o.length-1;n>=0&&!(o[n].level<=l);n--);if(DM(o,r,n+1),a.type!=="text")continue;let u=a.content,c=0,d=u.length;e:for(;c<d;){$M.lastIndex=c;let f=$M.exec(u);if(!f)break;let h=!0,p=!0;c=f.index+1;let m=f[0]==="'",g=32;if(f.index-1>=0)g=u.charCodeAt(f.index-1);else for(n=s-1;n>=0&&!(e[n].type==="softbreak"||e[n].type==="hardbreak");n--)if(e[n].content){g=e[n].content.charCodeAt(e[n].content.length-1);break}let b=32;if(c<d)b=u.charCodeAt(c);else for(n=s+1;n<e.length&&!(e[n].type==="softbreak"||e[n].type==="hardbreak");n++)if(e[n].content){b=e[n].content.charCodeAt(0);break}let y=Mo(g)||Ao(g),k=Mo(b)||Ao(b),x=To(g),E=To(b);if(E?h=!1:k&&(x||y||(h=!1)),x?p=!1:y&&(E||k||(p=!1)),b===34&&f[0]==='"'&&g>=48&&g<=57&&(p=h=!1),h&&p&&(h=y,p=k),!h&&!p){m&&jf(i,s,f.index,IM);continue}if(p&&(n=m?r.single:r.double,n>=0&&o[n].level===l)){let I=o[n],N,D;m?(N=t.md.options.quotes[2],D=t.md.options.quotes[3]):(N=t.md.options.quotes[0],D=t.md.options.quotes[1]),jf(i,s,f.index,D),jf(i,I.tokenIdx,I.contentPos,N),DM(o,r,n);continue e}if(h){if(o.length>=nj)return;o.push({tokenIdx:s,contentPos:f.index,isSingleQuote:m,level:l,prevSameQuoteIdx:m?r.single:r.double}),m?r.single=o.length-1:r.double=o.length-1}else p&&m&&jf(i,s,f.index,IM)}}Object.keys(i).forEach(function(s){e[s].content=rj(e[s].content,i[s])})}function w1(e){if(e.md.options.typographer)for(let t=e.tokens.length-1;t>=0;t--)e.tokens[t].type!=="inline"||!tj.test(e.tokens[t].content)||oj(e.tokens[t].children,e)}function S1(e){let t,n,o=e.tokens,r=o.length;for(let i=0;i<r;i++){if(o[i].type!=="inline")continue;let s=o[i].children,a=s.length;for(t=0;t<a;t++)s[t].type==="text_special"&&(s[t].type="text");for(t=n=0;t<a;t++)s[t].type==="text"&&t+1<a&&s[t+1].type==="text"?s[t+1].content=s[t].content+s[t+1].content:(t!==n&&(s[n]=s[t]),n++);t!==n&&(s.length=n)}}var _1=[["normalize",b1],["block",y1],["inline",v1],["linkify",x1],["replacements",k1],["smartquotes",w1],["text_join",S1]];function E1(){this.ruler=new Do;for(let e=0;e<_1.length;e++)this.ruler.push(_1[e][0],_1[e][1])}E1.prototype.process=function(e){let t=this.ruler.getRules("");for(let n=0,o=t.length;n<o;n++)t[n](e)};E1.prototype.State=AM;var NM=E1;function jn(e,t,n,o){this.src=e,this.md=t,this.env=n,this.tokens=o,this.bMarks=[],this.eMarks=[],this.tShift=[],this.sCount=[],this.bsCount=[],this.blkIndent=0,this.line=0,this.lineMax=0,this.tight=!1,this.ddIndent=-1,this.listIndent=-1,this.parentType="root",this.level=0;let r=this.src;for(let i=0,s=0,a=0,l=0,u=r.length,c=!1;s<u;s++){let d=r.charCodeAt(s);if(!c)if(ye(d)){a++,d===9?l+=4-l%4:l++;continue}else c=!0;(d===10||s===u-1)&&(d!==10&&s++,this.bMarks.push(i),this.eMarks.push(s),this.tShift.push(a),this.sCount.push(l),this.bsCount.push(0),c=!1,a=0,l=0,i=s+1)}this.bMarks.push(r.length),this.eMarks.push(r.length),this.tShift.push(0),this.sCount.push(0),this.bsCount.push(0),this.lineMax=this.bMarks.length-1}jn.prototype.push=function(e,t,n){let o=new dr(e,t,n);return o.block=!0,n<0&&this.level--,o.level=this.level,n>0&&this.level++,this.tokens.push(o),o};jn.prototype.isEmpty=function(t){return this.bMarks[t]+this.tShift[t]>=this.eMarks[t]};jn.prototype.skipEmptyLines=function(t){for(let n=this.lineMax;t<n&&!(this.bMarks[t]+this.tShift[t]<this.eMarks[t]);t++);return t};jn.prototype.skipSpaces=function(t){for(let n=this.src.length;t<n;t++){let o=this.src.charCodeAt(t);if(!ye(o))break}return t};jn.prototype.skipSpacesBack=function(t,n){if(t<=n)return t;for(;t>n;)if(!ye(this.src.charCodeAt(--t)))return t+1;return t};jn.prototype.skipChars=function(t,n){for(let o=this.src.length;t<o&&this.src.charCodeAt(t)===n;t++);return t};jn.prototype.skipCharsBack=function(t,n,o){if(t<=o)return t;for(;t>o;)if(n!==this.src.charCodeAt(--t))return t+1;return t};jn.prototype.getLines=function(t,n,o,r){if(t>=n)return"";let i=new Array(n-t);for(let s=0,a=t;a<n;a++,s++){let l=0,u=this.bMarks[a],c=u,d;for(a+1<n||r?d=this.eMarks[a]+1:d=this.eMarks[a];c<d&&l<o;){let f=this.src.charCodeAt(c);if(ye(f))f===9?l+=4-(l+this.bsCount[a])%4:l++;else if(c-u<this.tShift[a])l++;else break;c++}l>o?i[s]=new Array(l-o+1).join(" ")+this.src.slice(c,d):i[s]=this.src.slice(c,d)}return i.join("")};jn.prototype.Token=dr;var zM=jn;var ij=65536;function C1(e,t){let n=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];return e.src.slice(n,o)}function OM(e){let t=[],n=e.length,o=0,r=e.charCodeAt(o),i=!1,s=0,a="";for(;o<n;)r===124&&(i?(a+=e.substring(s,o-1),s=o):(t.push(a+e.substring(s,o)),a="",s=o+1)),i=r===92,o++,r=e.charCodeAt(o);return t.push(a+e.substring(s)),t}function T1(e,t,n,o){if(t+2>n)return!1;let r=t+1;if(e.sCount[r]<e.blkIndent||e.sCount[r]-e.blkIndent>=4)return!1;let i=e.bMarks[r]+e.tShift[r];if(i>=e.eMarks[r])return!1;let s=e.src.charCodeAt(i++);if(s!==124&&s!==45&&s!==58||i>=e.eMarks[r])return!1;let a=e.src.charCodeAt(i++);if(a!==124&&a!==45&&a!==58&&!ye(a)||s===45&&ye(a))return!1;for(;i<e.eMarks[r];){let x=e.src.charCodeAt(i);if(x!==124&&x!==45&&x!==58&&!ye(x))return!1;i++}let l=C1(e,t+1),u=l.split("|"),c=[];for(let x=0;x<u.length;x++){let E=u[x].trim();if(!E){if(x===0||x===u.length-1)continue;return!1}if(!/^:?-+:?$/.test(E))return!1;E.charCodeAt(E.length-1)===58?c.push(E.charCodeAt(0)===58?"center":"right"):E.charCodeAt(0)===58?c.push("left"):c.push("")}if(l=C1(e,t).trim(),l.indexOf("|")===-1||e.sCount[t]-e.blkIndent>=4)return!1;u=OM(l),u.length&&u[0]===""&&u.shift(),u.length&&u[u.length-1]===""&&u.pop();let d=u.length;if(d===0||d!==c.length)return!1;if(o)return!0;let f=e.parentType;e.parentType="table";let h=e.md.block.ruler.getRules("blockquote"),p=e.push("table_open","table",1),m=[t,0];p.map=m;let g=e.push("thead_open","thead",1);g.map=[t,t+1];let b=e.push("tr_open","tr",1);b.map=[t,t+1];for(let x=0;x<u.length;x++){let E=e.push("th_open","th",1);c[x]&&(E.attrs=[["style","text-align:"+c[x]]]);let I=e.push("inline","",0);I.content=u[x].trim(),I.children=[],e.push("th_close","th",-1)}e.push("tr_close","tr",-1),e.push("thead_close","thead",-1);let y,k=0;for(r=t+2;r<n&&!(e.sCount[r]<e.blkIndent);r++){let x=!1;for(let I=0,N=h.length;I<N;I++)if(h[I](e,r,n,!0)){x=!0;break}if(x||(l=C1(e,r).trim(),!l)||e.sCount[r]-e.blkIndent>=4||(u=OM(l),u.length&&u[0]===""&&u.shift(),u.length&&u[u.length-1]===""&&u.pop(),k+=d-u.length,k>ij))break;if(r===t+2){let I=e.push("tbody_open","tbody",1);I.map=y=[t+2,0]}let E=e.push("tr_open","tr",1);E.map=[r,r+1];for(let I=0;I<d;I++){let N=e.push("td_open","td",1);c[I]&&(N.attrs=[["style","text-align:"+c[I]]]);let D=e.push("inline","",0);D.content=u[I]?u[I].trim():"",D.children=[],e.push("td_close","td",-1)}e.push("tr_close","tr",-1)}return y&&(e.push("tbody_close","tbody",-1),y[1]=r),e.push("table_close","table",-1),m[1]=r,e.parentType=f,e.line=r,!0}function A1(e,t,n){if(e.sCount[t]-e.blkIndent<4)return!1;let o=t+1,r=o;for(;o<n;){if(e.isEmpty(o)){o++;continue}if(e.sCount[o]-e.blkIndent>=4){o++,r=o;continue}break}e.line=r;let i=e.push("code_block","code",0);return i.content=e.getLines(t,r,4+e.blkIndent,!1)+`
`,i.map=[t,e.line],!0}function M1(e,t,n,o){let r=e.bMarks[t]+e.tShift[t],i=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||r+3>i)return!1;let s=e.src.charCodeAt(r);if(s!==126&&s!==96)return!1;let a=r;r=e.skipChars(r,s);let l=r-a;if(l<3)return!1;let u=e.src.slice(a,r),c=e.src.slice(r,i);if(s===96&&c.indexOf(String.fromCharCode(s))>=0)return!1;if(o)return!0;let d=t,f=!1;for(;d++,!(d>=n||(r=a=e.bMarks[d]+e.tShift[d],i=e.eMarks[d],r<i&&e.sCount[d]<e.blkIndent));)if(e.src.charCodeAt(r)===s&&!(e.sCount[d]-e.blkIndent>=4)&&(r=e.skipChars(r,s),!(r-a<l)&&(r=e.skipSpaces(r),!(r<i)))){f=!0;break}l=e.sCount[t],e.line=d+(f?1:0);let h=e.push("fence","code",0);return h.info=c,h.content=e.getLines(t+1,d,l,!0),h.markup=u,h.map=[t,e.line],!0}function $1(e,t,n,o){let r=e.bMarks[t]+e.tShift[t],i=e.eMarks[t],s=e.lineMax;if(e.sCount[t]-e.blkIndent>=4||e.src.charCodeAt(r)!==62)return!1;if(o)return!0;let a=[],l=[],u=[],c=[],d=e.md.block.ruler.getRules("blockquote"),f=e.parentType;e.parentType="blockquote";let h=!1,p;for(p=t;p<n;p++){let k=e.sCount[p]<e.blkIndent;if(r=e.bMarks[p]+e.tShift[p],i=e.eMarks[p],r>=i)break;if(e.src.charCodeAt(r++)===62&&!k){let E=e.sCount[p]+1,I,N;e.src.charCodeAt(r)===32?(r++,E++,N=!1,I=!0):e.src.charCodeAt(r)===9?(I=!0,(e.bsCount[p]+E)%4===3?(r++,E++,N=!1):N=!0):I=!1;let D=E;for(a.push(e.bMarks[p]),e.bMarks[p]=r;r<i;){let W=e.src.charCodeAt(r);if(ye(W))W===9?D+=4-(D+e.bsCount[p]+(N?1:0))%4:D++;else break;r++}h=r>=i,l.push(e.bsCount[p]),e.bsCount[p]=e.sCount[p]+1+(I?1:0),u.push(e.sCount[p]),e.sCount[p]=D-E,c.push(e.tShift[p]),e.tShift[p]=r-e.bMarks[p];continue}if(h)break;let x=!1;for(let E=0,I=d.length;E<I;E++)if(d[E](e,p,n,!0)){x=!0;break}if(x){e.lineMax=p,e.blkIndent!==0&&(a.push(e.bMarks[p]),l.push(e.bsCount[p]),c.push(e.tShift[p]),u.push(e.sCount[p]),e.sCount[p]-=e.blkIndent);break}a.push(e.bMarks[p]),l.push(e.bsCount[p]),c.push(e.tShift[p]),u.push(e.sCount[p]),e.sCount[p]=-1}let m=e.blkIndent;e.blkIndent=0;let g=e.push("blockquote_open","blockquote",1);g.markup=">";let b=[t,0];g.map=b,e.md.block.tokenize(e,t,p);let y=e.push("blockquote_close","blockquote",-1);y.markup=">",e.lineMax=s,e.parentType=f,b[1]=e.line;for(let k=0;k<c.length;k++)e.bMarks[k+t]=a[k],e.tShift[k+t]=c[k],e.sCount[k+t]=u[k],e.bsCount[k+t]=l[k];return e.blkIndent=m,!0}function I1(e,t,n,o){let r=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let i=e.bMarks[t]+e.tShift[t],s=e.src.charCodeAt(i++);if(s!==42&&s!==45&&s!==95)return!1;let a=1;for(;i<r;){let u=e.src.charCodeAt(i++);if(u!==s&&!ye(u))return!1;u===s&&a++}if(a<3)return!1;if(o)return!0;e.line=t+1;let l=e.push("hr","hr",0);return l.map=[t,e.line],l.markup=Array(a+1).join(String.fromCharCode(s)),!0}function RM(e,t){let n=e.eMarks[t],o=e.bMarks[t]+e.tShift[t],r=e.src.charCodeAt(o++);if(r!==42&&r!==45&&r!==43)return-1;if(o<n){let i=e.src.charCodeAt(o);if(!ye(i))return-1}return o}function PM(e,t){let n=e.bMarks[t]+e.tShift[t],o=e.eMarks[t],r=n;if(r+1>=o)return-1;let i=e.src.charCodeAt(r++);if(i<48||i>57)return-1;for(;;){if(r>=o)return-1;if(i=e.src.charCodeAt(r++),i>=48&&i<=57){if(r-n>=10)return-1;continue}if(i===41||i===46)break;return-1}return r<o&&(i=e.src.charCodeAt(r),!ye(i))?-1:r}function sj(e,t){let n=e.level+2;for(let o=t+2,r=e.tokens.length-2;o<r;o++)e.tokens[o].level===n&&e.tokens[o].type==="paragraph_open"&&(e.tokens[o+2].hidden=!0,e.tokens[o].hidden=!0,o+=2)}function D1(e,t,n,o){let r,i,s,a,l=t,u=!0;if(e.sCount[l]-e.blkIndent>=4||e.listIndent>=0&&e.sCount[l]-e.listIndent>=4&&e.sCount[l]<e.blkIndent)return!1;let c=!1;o&&e.parentType==="paragraph"&&e.sCount[l]>=e.blkIndent&&(c=!0);let d,f,h;if((h=PM(e,l))>=0){if(d=!0,s=e.bMarks[l]+e.tShift[l],f=Number(e.src.slice(s,h-1)),c&&f!==1)return!1}else if((h=RM(e,l))>=0)d=!1;else return!1;if(c&&e.skipSpaces(h)>=e.eMarks[l])return!1;if(o)return!0;let p=e.src.charCodeAt(h-1),m=e.tokens.length;d?(a=e.push("ordered_list_open","ol",1),f!==1&&(a.attrs=[["start",f]])):a=e.push("bullet_list_open","ul",1);let g=[l,0];a.map=g,a.markup=String.fromCharCode(p);let b=!1,y=e.md.block.ruler.getRules("list"),k=e.parentType;for(e.parentType="list";l<n;){i=h,r=e.eMarks[l];let x=e.sCount[l]+h-(e.bMarks[l]+e.tShift[l]),E=x;for(;i<r;){let oe=e.src.charCodeAt(i);if(oe===9)E+=4-(E+e.bsCount[l])%4;else if(oe===32)E++;else break;i++}let I=i,N;I>=r?N=1:N=E-x,N>4&&(N=1);let D=x+N;a=e.push("list_item_open","li",1),a.markup=String.fromCharCode(p);let W=[l,0];a.map=W,d&&(a.info=e.src.slice(s,h-1));let re=e.tight,Oe=e.tShift[l],We=e.sCount[l],Ge=e.listIndent;if(e.listIndent=e.blkIndent,e.blkIndent=D,e.tight=!0,e.tShift[l]=I-e.bMarks[l],e.sCount[l]=E,I>=r&&e.isEmpty(l+1)?e.line=Math.min(e.line+2,n):e.md.block.tokenize(e,l,n,!0),(!e.tight||b)&&(u=!1),b=e.line-l>1&&e.isEmpty(e.line-1),e.blkIndent=e.listIndent,e.listIndent=Ge,e.tShift[l]=Oe,e.sCount[l]=We,e.tight=re,a=e.push("list_item_close","li",-1),a.markup=String.fromCharCode(p),l=e.line,W[1]=l,l>=n||e.sCount[l]<e.blkIndent||e.sCount[l]-e.blkIndent>=4)break;let xe=!1;for(let oe=0,A=y.length;oe<A;oe++)if(y[oe](e,l,n,!0)){xe=!0;break}if(xe)break;if(d){if(h=PM(e,l),h<0)break;s=e.bMarks[l]+e.tShift[l]}else if(h=RM(e,l),h<0)break;if(p!==e.src.charCodeAt(h-1))break}return d?a=e.push("ordered_list_close","ol",-1):a=e.push("bullet_list_close","ul",-1),a.markup=String.fromCharCode(p),g[1]=l,e.line=l,e.parentType=k,u&&sj(e,m),!0}var N1=999;function aj(e){let t=e.length;for(let n=0;n<e.length-1;n++){let o=e.charCodeAt(n);if(o<55296||o>56319)continue;let r=e.charCodeAt(n+1);r>=56320&&r<=57343&&(t--,n++)}return t}function ll(e,t){return Math.min(e.eMarks[t]+1,e.src.length)}function Bf(e,t){let n=e.lineMax;if(t>=n||e.isEmpty(t))return-1;let o=!1;if(e.sCount[t]-e.blkIndent>3&&(o=!0),e.sCount[t]<0&&(o=!0),!o){let r=e.md.block.ruler.getRules("reference"),i=e.parentType;e.parentType="reference";let s=!1;for(let a=0,l=r.length;a<l;a++)if(r[a](e,t,n,!0)){s=!0;break}if(e.parentType=i,s)return-1}return e.bMarks[t]+e.tShift[t]}function z1(e,t,n,o){let r=e.src,i=e.bMarks[t]+e.tShift[t],s=t+1;if(e.sCount[t]-e.blkIndent>=4||r.charCodeAt(i)!==91)return!1;let a=ll(e,t),l="",u=-1,c=++i;for(;i<a;){if(l.length+i-c>N1*2)return!1;let x=r.charCodeAt(i);if(x===91)return!1;if(x===93){u=i;break}if(x===92&&(x=r.charCodeAt(++i)),x===10&&i<a){let E=Bf(e,s);if(E<0)return!1;l+=r.slice(c,a),i=c=E,a=ll(e,s++);continue}i++}if(u<0||r.charCodeAt(u+1)!==58||(l+=r.slice(c,u),l.length>N1&&aj(l)>N1))return!1;for(i=u+2;i<a;){let x=r.charCodeAt(i);if(x===10){let E=Bf(e,s);if(E<0)break;i=E,a=ll(e,s++)}else if(ye(x))i++;else break}let d=e.md.helpers.parseLinkDestination(r,i,a);if(!d.ok)return!1;let f=e.md.normalizeLink(d.str);if(!e.md.validateLink(f))return!1;i=d.pos;let h=i,p=a,m=s;for(;i<a;){let x=r.charCodeAt(i);if(x===10){let E=Bf(e,s);if(E<0)break;i=E,a=ll(e,s++)}else if(ye(x))i++;else break}let g=i,b=e.md.helpers.parseLinkTitle(r,i,a);for(;b.can_continue;){let x=Bf(e,s);if(x<0)break;i=x,a=ll(e,s++),b=e.md.helpers.parseLinkTitle(r,i,a,b)}let y;for(g!==h&&b.ok?(y=b.str,i=b.pos):(y="",i=h,a=p,s=m);i<a;){let x=r.charCodeAt(i);if(!ye(x))break;i++}if(i<a&&r.charCodeAt(i)!==10&&y)for(y="",i=h,a=p,s=m;i<a;){let x=r.charCodeAt(i);if(!ye(x))break;i++}if(i<a&&r.charCodeAt(i)!==10)return!1;let k=$o(l);return k?(o||(typeof e.env.references>"u"&&(e.env.references={}),typeof e.env.references[k]>"u"&&(e.env.references[k]={title:y,href:f}),e.line=s),!0):!1}var LM=["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"];var lj="[a-zA-Z_:][a-zA-Z0-9:._-]*",uj="[^\"'=<>`\\x00-\\x20]+",cj="'[^']*'",dj='"[^"]*"',fj="(?:"+uj+"|"+cj+"|"+dj+")",pj="(?:\\s+"+lj+"(?:\\s*=\\s*"+fj+")?)",FM="<[A-Za-z][A-Za-z0-9\\-]*"+pj+"*\\s*\\/?>",jM="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",hj="<!---?>|<!--(?:[^-]|-[^-]|--[^>])*-->",mj="<[?][\\s\\S]*?[?]>",gj="<![A-Za-z][^>]*>",bj="<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",ote=new RegExp("^(?:"+FM+"|"+jM+"|"+hj+"|"+mj+"|"+gj+"|"+bj+")"),Uf=new RegExp("^(?:"+FM+"|"+jM+")");var No=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^<!--/,/-->/,!0],[/^<\?/,/\?>/,!0],[/^<![A-Za-z]/,/>/,!0],[/^<!\[CDATA\[/,/\]\]>/,!0],[new RegExp("^</?("+LM.join("|")+")(?=(\\s|/?>|$))","i"),/^$/,!0],[new RegExp(Uf.source+"\\s*$"),/^$/,!1]];function O1(e,t,n,o){let r=e.bMarks[t]+e.tShift[t],i=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||!e.md.options.html||e.src.charCodeAt(r)!==60)return!1;let s=e.src.slice(r,i),a=0;for(;a<No.length&&!No[a][0].test(s);a++);if(a===No.length)return!1;if(o)return No[a][2];let l=t+1,u=No[a][1].test("");if(!No[a][1].test(s)){for(;l<n&&!(e.sCount[l]<e.blkIndent&&(u||!e.isEmpty(l)));l++)if(r=e.bMarks[l]+e.tShift[l],i=e.eMarks[l],s=e.src.slice(r,i),No[a][1].test(s)){s.length!==0&&l++;break}}e.line=l;let c=e.push("html_block","",0);return c.map=[t,l],c.content=e.getLines(t,l,e.blkIndent,!0),!0}function R1(e,t,n,o){let r=e.bMarks[t]+e.tShift[t],i=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let s=e.src.charCodeAt(r);if(s!==35||r>=i)return!1;let a=1;for(s=e.src.charCodeAt(++r);s===35&&r<i&&a<=6;)a++,s=e.src.charCodeAt(++r);if(a>6||r<i&&!ye(s))return!1;if(o)return!0;i=e.skipSpacesBack(i,r);let l=e.skipCharsBack(i,35,r);l>r&&ye(e.src.charCodeAt(l-1))&&(i=l),e.line=t+1;let u=e.push("heading_open","h"+String(a),1);u.markup="########".slice(0,a),u.map=[t,e.line];let c=e.push("inline","",0);c.content=Io(e.src.slice(r,i)),c.map=[t,e.line],c.children=[];let d=e.push("heading_close","h"+String(a),-1);return d.markup="########".slice(0,a),!0}function P1(e,t,n){let o=e.md.block.ruler.getRules("paragraph");if(e.sCount[t]-e.blkIndent>=4)return!1;let r=e.parentType;e.parentType="paragraph";let i=0,s,a=t+1;for(;a<n&&!e.isEmpty(a);a++){if(e.sCount[a]-e.blkIndent>3)continue;if(e.sCount[a]>=e.blkIndent){let h=e.bMarks[a]+e.tShift[a],p=e.eMarks[a];if(h<p&&(s=e.src.charCodeAt(h),(s===45||s===61)&&(h=e.skipChars(h,s),h=e.skipSpaces(h),h>=p))){i=s===61?1:2;break}}if(e.sCount[a]<0)continue;let f=!1;for(let h=0,p=o.length;h<p;h++)if(o[h](e,a,n,!0)){f=!0;break}if(f)break}if(!i)return e.parentType=r,!1;let l=Io(e.getLines(t,a,e.blkIndent,!1));e.line=a+1;let u=e.push("heading_open","h"+String(i),1);u.markup=String.fromCharCode(s),u.map=[t,e.line];let c=e.push("inline","",0);c.content=l,c.map=[t,e.line-1],c.children=[];let d=e.push("heading_close","h"+String(i),-1);return d.markup=String.fromCharCode(s),e.parentType=r,!0}function L1(e,t,n){let o=e.md.block.ruler.getRules("paragraph"),r=e.parentType,i=t+1;for(e.parentType="paragraph";i<n&&!e.isEmpty(i);i++){if(e.sCount[i]-e.blkIndent>3||e.sCount[i]<0)continue;let u=!1;for(let c=0,d=o.length;c<d;c++)if(o[c](e,i,n,!0)){u=!0;break}if(u)break}let s=Io(e.getLines(t,i,e.blkIndent,!1));e.line=i;let a=e.push("paragraph_open","p",1);a.map=[t,e.line];let l=e.push("inline","",0);return l.content=s,l.map=[t,e.line],l.children=[],e.push("paragraph_close","p",-1),e.parentType=r,!0}var Hf=[["table",T1,["paragraph","reference"]],["code",A1],["fence",M1,["paragraph","reference","blockquote","list"]],["blockquote",$1,["paragraph","reference","blockquote","list"]],["hr",I1,["paragraph","reference","blockquote","list"]],["list",D1,["paragraph","reference","blockquote"]],["reference",z1],["html_block",O1,["paragraph","reference","blockquote"]],["heading",R1,["paragraph","reference","blockquote"]],["lheading",P1],["paragraph",L1]];function qf(){this.ruler=new Do;for(let e=0;e<Hf.length;e++)this.ruler.push(Hf[e][0],Hf[e][1],{alt:(Hf[e][2]||[]).slice()})}qf.prototype.tokenize=function(e,t,n){let o=this.ruler.getRules(""),r=o.length,i=e.md.options.maxNesting,s=t,a=!1;for(;s<n&&(e.line=s=e.skipEmptyLines(s),!(s>=n||e.sCount[s]<e.blkIndent));){if(e.level>=i){e.line=n;break}let l=e.line,u=!1;for(let c=0;c<r;c++)if(u=o[c](e,s,n,!1),u){if(l>=e.line)throw new Error("block rule didn't increment state.line");break}if(!u)throw new Error("none of the block rules matched");e.tight=!a,e.isEmpty(e.line-1)&&(a=!0),s=e.line,s<n&&e.isEmpty(s)&&(a=!0,s++,e.line=s)}};qf.prototype.parse=function(e,t,n,o){if(!e)return;let r=new this.State(e,t,n,o);this.tokenize(r,r.line,r.lineMax)};qf.prototype.State=zM;var BM=qf;function ul(e,t,n,o){this.src=e,this.env=n,this.md=t,this.tokens=o,this.tokens_meta=Array(o.length),this.pos=0,this.posMax=this.src.length,this.level=0,this.pending="",this.pendingLevel=0,this.cache={},this.delimiters=[],this._prev_delimiters=[],this.backticks={},this.backticksScanned=!1,this.skipHtmlSpecial=!1,this.linkLevel=0}ul.prototype.pushPending=function(){let e=new dr("text","",0);return e.content=this.pending,e.level=this.pendingLevel,this.tokens.push(e),this.pending="",e};ul.prototype.push=function(e,t,n){this.pending&&this.pushPending();let o=new dr(e,t,n),r=null;return n<0&&(this.level--,this.delimiters=this._prev_delimiters.pop()),o.level=this.level,n>0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],r={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(o),this.tokens_meta.push(r),o};ul.prototype.scanDelims=function(e,t){let n=this.posMax,o=this.src.charCodeAt(e),r;if(e===0)r=32;else if(e===1)r=this.src.charCodeAt(0),(r&63488)===55296&&(r=65533);else if(r=this.src.charCodeAt(e-1),(r&64512)===56320){let g=this.src.charCodeAt(e-2);r=(g&64512)===55296?65536+(g-55296<<10)+(r-56320):65533}else(r&64512)===55296&&(r=65533);let i=e;for(;i<n&&this.src.charCodeAt(i)===o;)i++;let s=i-e,a=i<n?this.src.charCodeAt(i):32;if((a&64512)===55296){let g=this.src.charCodeAt(i+1);a=(g&64512)===56320?65536+(a-55296<<10)+(g-56320):65533}else(a&64512)===56320&&(a=65533);let l=Mo(r)||Ao(r),u=Mo(a)||Ao(a),c=To(r),d=To(a),f=!d&&(!u||c||l),h=!c&&(!l||d||u);return{can_open:f&&(t||!h||l),can_close:h&&(t||!f||u),length:s}};ul.prototype.Token=dr;var UM=ul;function yj(e){switch(e){case 10:case 33:case 35:case 36:case 37:case 38:case 42:case 43:case 45:case 58:case 60:case 61:case 62:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 125:case 126:return!0;default:return!1}}function F1(e,t){let n=e.pos;for(;n<e.posMax&&!yj(e.src.charCodeAt(n));)n++;return n===e.pos?!1:(t||(e.pending+=e.src.slice(e.pos,n)),e.pos=n,!0)}function vj(e){return e>=65&&e<=90||e>=97&&e<=122}function xj(e){return e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||e===43||e===45||e===46}function j1(e,t){if(!e.md.options.linkify||e.linkLevel>0)return!1;let n=e.pos,o=e.posMax;if(n+3>o||e.src.charCodeAt(n)!==58||e.src.charCodeAt(n+1)!==47||e.src.charCodeAt(n+2)!==47)return!1;let r=n-Math.min(10,e.pending.length,n),i=n;for(;i>r&&xj(e.src.charCodeAt(i-1));)i--;if(i===n||!vj(e.src.charCodeAt(i)))return!1;let s=n-i,a=e.md.linkify.matchAtStart(e.src.slice(i));if(!a)return!1;let l=a.url;if(l.length<=s)return!1;let u=l.length;for(;u>0&&l.charCodeAt(u-1)===42;)u--;u!==l.length&&(l=l.slice(0,u));let c=e.md.normalizeLink(l);if(!e.md.validateLink(c))return!1;if(!t){e.pending=e.pending.slice(0,-s);let d=e.push("link_open","a",1);d.attrs=[["href",c]],d.markup="linkify",d.info="auto";let f=e.push("text","",0);f.content=e.md.normalizeLinkText(l);let h=e.push("link_close","a",-1);h.markup="linkify",h.info="auto"}return e.pos+=l.length-s,!0}function B1(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==10)return!1;let o=e.pending.length-1,r=e.posMax;if(!t)if(o>=0&&e.pending.charCodeAt(o)===32)if(o>=1&&e.pending.charCodeAt(o-1)===32){let i=o-1;for(;i>=1&&e.pending.charCodeAt(i-1)===32;)i--;e.pending=e.pending.slice(0,i),e.push("hardbreak","br",0)}else e.pending=e.pending.slice(0,-1),e.push("softbreak","br",0);else e.push("softbreak","br",0);for(n++;n<r&&ye(e.src.charCodeAt(n));)n++;return e.pos=n,!0}var U1=[];for(let e=0;e<256;e++)U1.push(0);"\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-".split("").forEach(function(e){U1[e.charCodeAt(0)]=1});function H1(e,t){let n=e.pos,o=e.posMax;if(e.src.charCodeAt(n)!==92||(n++,n>=o))return!1;let r=e.src.charCodeAt(n);if(r===10){for(t||e.push("hardbreak","br",0),n++;n<o&&(r=e.src.charCodeAt(n),!!ye(r));)n++;return e.pos=n,!0}if(r===32){if(!t){let a=e.push("text_special","",0);a.content="\\",a.markup="\\",a.info="escape"}return e.pos=n,!0}let i=e.src[n];if(r>=55296&&r<=56319&&n+1<o){let a=e.src.charCodeAt(n+1);a>=56320&&a<=57343&&(i+=e.src[n+1],n++)}let s="\\"+i;if(!t){let a=e.push("text_special","",0);r<256&&U1[r]!==0?a.content=i:a.content=s,a.markup=s,a.info="escape"}return e.pos=n+1,!0}function q1(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==96)return!1;let r=n;n++;let i=e.posMax;for(;n<i&&e.src.charCodeAt(n)===96;)n++;let s=e.src.slice(r,n),a=s.length;if(e.backticksScanned&&(e.backticks[a]||0)<=r)return t||(e.pending+=s),e.pos+=a,!0;let l=n,u;for(;(u=e.src.indexOf("`",l))!==-1;){for(l=u+1;l<i&&e.src.charCodeAt(l)===96;)l++;let c=l-u;if(c===a){if(!t){let d=e.push("code_inline","code",0);d.markup=s,d.content=e.src.slice(n,u).replace(/\n/g," ").replace(/^ (.+) $/,"$1")}return e.pos=l,!0}e.backticks[c]=u}return e.backticksScanned=!0,t||(e.pending+=s),e.pos+=a,!0}function kj(e,t){let n=e.pos,o=e.src.charCodeAt(n);if(t||o!==126)return!1;let r=e.scanDelims(e.pos,!0),i=r.length,s=String.fromCharCode(o);if(i<2)return!1;let a;i%2&&(a=e.push("text","",0),a.content=s,i--);for(let l=0;l<i;l+=2)a=e.push("text","",0),a.content=s+s,e.delimiters.push({marker:o,length:0,token:e.tokens.length-1,end:-1,open:r.can_open,close:r.can_close});return e.pos+=r.length,!0}function HM(e,t){let n,o=[],r=t.length;for(let i=0;i<r;i++){let s=t[i];if(s.marker!==126||s.end===-1)continue;let a=t[s.end];n=e.tokens[s.token],n.type="s_open",n.tag="s",n.nesting=1,n.markup="~~",n.content="",n=e.tokens[a.token],n.type="s_close",n.tag="s",n.nesting=-1,n.markup="~~",n.content="",e.tokens[a.token-1].type==="text"&&e.tokens[a.token-1].content==="~"&&o.push(a.token-1)}for(;o.length;){let i=o.pop(),s=i+1;for(;s<e.tokens.length&&e.tokens[s].type==="s_close";)s++;s--,i!==s&&(n=e.tokens[s],e.tokens[s]=e.tokens[i],e.tokens[i]=n)}}function wj(e){let t=e.tokens_meta,n=e.tokens_meta.length;HM(e,e.delimiters);for(let o=0;o<n;o++)t[o]&&t[o].delimiters&&HM(e,t[o].delimiters)}var Z1={tokenize:kj,postProcess:wj};function Sj(e,t){let n=e.pos,o=e.src.charCodeAt(n);if(t||o!==95&&o!==42)return!1;let r=e.scanDelims(e.pos,o===42);for(let i=0;i<r.length;i++){let s=e.push("text","",0);s.content=String.fromCharCode(o),e.delimiters.push({marker:o,length:r.length,token:e.tokens.length-1,end:-1,open:r.can_open,close:r.can_close})}return e.pos+=r.length,!0}function qM(e,t){let n=t.length;for(let o=n-1;o>=0;o--){let r=t[o];if(r.marker!==95&&r.marker!==42||r.end===-1)continue;let i=t[r.end],s=o>0&&t[o-1].end===r.end+1&&t[o-1].marker===r.marker&&t[o-1].token===r.token-1&&t[r.end+1].token===i.token+1,a=String.fromCharCode(r.marker),l=e.tokens[r.token];l.type=s?"strong_open":"em_open",l.tag=s?"strong":"em",l.nesting=1,l.markup=s?a+a:a,l.content="";let u=e.tokens[i.token];u.type=s?"strong_close":"em_close",u.tag=s?"strong":"em",u.nesting=-1,u.markup=s?a+a:a,u.content="",s&&(e.tokens[t[o-1].token].content="",e.tokens[t[r.end+1].token].content="",o--)}}function _j(e){let t=e.tokens_meta,n=e.tokens_meta.length;qM(e,e.delimiters);for(let o=0;o<n;o++)t[o]&&t[o].delimiters&&qM(e,t[o].delimiters)}var V1={tokenize:Sj,postProcess:_j};function W1(e,t){let n,o,r,i,s="",a="",l=e.pos,u=!0;if(e.src.charCodeAt(e.pos)!==91)return!1;let c=e.pos,d=e.posMax,f=e.pos+1,h=e.md.helpers.parseLinkLabel(e,e.pos,!0);if(h<0)return!1;let p=h+1;if(p<d&&e.src.charCodeAt(p)===40){for(u=!1,p++;p<d&&(n=e.src.charCodeAt(p),!(!ye(n)&&n!==10));p++);if(p>=d)return!1;if(l=p,r=e.md.helpers.parseLinkDestination(e.src,p,e.posMax),r.ok){for(s=e.md.normalizeLink(r.str),e.md.validateLink(s)?p=r.pos:s="",l=p;p<d&&(n=e.src.charCodeAt(p),!(!ye(n)&&n!==10));p++);if(r=e.md.helpers.parseLinkTitle(e.src,p,e.posMax),p<d&&l!==p&&r.ok)for(a=r.str,p=r.pos;p<d&&(n=e.src.charCodeAt(p),!(!ye(n)&&n!==10));p++);}(p>=d||e.src.charCodeAt(p)!==41)&&(u=!0),p++}if(u){if(typeof e.env.references>"u")return!1;if(p<d&&e.src.charCodeAt(p)===91?(l=p+1,p=e.md.helpers.parseLinkLabel(e,p),p>=0?o=e.src.slice(l,p++):p=h+1):p=h+1,o||(o=e.src.slice(f,h)),i=e.env.references[$o(o)],!i)return e.pos=c,!1;s=i.href,a=i.title}if(!t){e.pos=f,e.posMax=h;let m=e.push("link_open","a",1),g=[["href",s]];m.attrs=g,a&&g.push(["title",a]),e.linkLevel++,e.md.inline.tokenize(e),e.linkLevel--,e.push("link_close","a",-1)}return e.pos=p,e.posMax=d,!0}function K1(e,t){let n,o,r,i,s,a,l,u,c="",d=e.pos,f=e.posMax;if(e.src.charCodeAt(e.pos)!==33||e.src.charCodeAt(e.pos+1)!==91)return!1;let h=e.pos+2,p=e.md.helpers.parseLinkLabel(e,e.pos+1,!1);if(p<0)return!1;if(i=p+1,i<f&&e.src.charCodeAt(i)===40){for(i++;i<f&&(n=e.src.charCodeAt(i),!(!ye(n)&&n!==10));i++);if(i>=f)return!1;for(u=i,a=e.md.helpers.parseLinkDestination(e.src,i,e.posMax),a.ok&&(c=e.md.normalizeLink(a.str),e.md.validateLink(c)?i=a.pos:c=""),u=i;i<f&&(n=e.src.charCodeAt(i),!(!ye(n)&&n!==10));i++);if(a=e.md.helpers.parseLinkTitle(e.src,i,e.posMax),i<f&&u!==i&&a.ok)for(l=a.str,i=a.pos;i<f&&(n=e.src.charCodeAt(i),!(!ye(n)&&n!==10));i++);else l="";if(i>=f||e.src.charCodeAt(i)!==41)return e.pos=d,!1;i++}else{if(typeof e.env.references>"u")return!1;if(i<f&&e.src.charCodeAt(i)===91?(u=i+1,i=e.md.helpers.parseLinkLabel(e,i),i>=0?r=e.src.slice(u,i++):i=p+1):i=p+1,r||(r=e.src.slice(h,p)),s=e.env.references[$o(r)],!s)return e.pos=d,!1;c=s.href,l=s.title}if(!t){o=e.src.slice(h,p);let m=[];e.md.inline.parse(o,e.md,e.env,m);let g=e.push("image","img",0),b=[["src",c],["alt",""]];g.attrs=b,g.children=m,g.content=o,l&&b.push(["title",l])}return e.pos=i,e.posMax=f,!0}var Ej=/^([a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)$/,Cj=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function J1(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==60)return!1;let o=e.pos,r=e.posMax;for(;;){if(++n>=r)return!1;let s=e.src.charCodeAt(n);if(s===60)return!1;if(s===62)break}let i=e.src.slice(o+1,n);if(Cj.test(i)){let s=e.md.normalizeLink(i);if(!e.md.validateLink(s))return!1;if(!t){let a=e.push("link_open","a",1);a.attrs=[["href",s]],a.markup="autolink",a.info="auto";let l=e.push("text","",0);l.content=e.md.normalizeLinkText(i);let u=e.push("link_close","a",-1);u.markup="autolink",u.info="auto"}return e.pos+=i.length+2,!0}if(Ej.test(i)){let s=e.md.normalizeLink("mailto:"+i);if(!e.md.validateLink(s))return!1;if(!t){let a=e.push("link_open","a",1);a.attrs=[["href",s]],a.markup="autolink",a.info="auto";let l=e.push("text","",0);l.content=e.md.normalizeLinkText(i);let u=e.push("link_close","a",-1);u.markup="autolink",u.info="auto"}return e.pos+=i.length+2,!0}return!1}function Tj(e){return/^<a[>\s]/i.test(e)}function Aj(e){return/^<\/a\s*>/i.test(e)}function ZM(e){let t=e|32;return t>=97&&t<=122}function Mj(e,t){let n=e.src,o,r;if(n.startsWith("<!--",t)){if(n.startsWith(">",t+4))return t+5;if(n.startsWith("->",t+4))return t+6;o=t+4,r="-->"}else if(n.startsWith("<![CDATA[",t))o=t+9,r="]]>";else if(n.charCodeAt(t+1)===63)o=t+2,r="?>";else if(ZM(n.charCodeAt(t+2)))o=t+3,r=">";else return-1;if(e.skipHtmlSpecial)return-1;let i=n.indexOf(r,o);return i<0?(e.skipHtmlSpecial=!0,-1):i+r.length}function G1(e,t){if(!e.md.options.html)return!1;let n=e.posMax,o=e.pos;if(e.src.charCodeAt(o)!==60||o+2>=n)return!1;let r,i=e.src.charCodeAt(o+1);if(i===33||i===63)r=Mj(e,o);else if(i===47||ZM(i)){let s=e.src.slice(o).match(Uf);r=s?o+s[0].length:-1}else return!1;if(r<0)return!1;if(!t){let s=e.push("html_inline","",0);s.content=e.src.slice(o,r),Tj(s.content)&&e.linkLevel++,Aj(s.content)&&e.linkLevel--}return e.pos=r,!0}var $j=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,Ij=/^&([a-z][a-z0-9]{1,31});/i;function Q1(e,t){let n=e.pos,o=e.posMax;if(e.src.charCodeAt(n)!==38||n+1>=o)return!1;if(e.src.charCodeAt(n+1)===35){let i=e.src.slice(n).match($j);if(i){if(!t){let s=i[1][0].toLowerCase()==="x"?parseInt(i[1].slice(1),16):parseInt(i[1],10),a=e.push("text_special","",0);a.content=Ff(s)?as(s):as(65533),a.markup=i[0],a.info="entity"}return e.pos+=i[0].length,!0}}else{let i=e.src.slice(n).match(Ij);if(i){let s=al(i[0]);if(s!==i[0]){if(!t){let a=e.push("text_special","",0);a.content=s,a.markup=i[0],a.info="entity"}return e.pos+=i[0].length,!0}}}return!1}function VM(e){let t={},n=e.length;if(!n)return;let o=0,r=-2,i=[];for(let s=0;s<n;s++){let a=e[s];if(i.push(0),(e[o].marker!==a.marker||r!==a.token-1)&&(o=s),r=a.token,a.length=a.length||0,!a.close)continue;t.hasOwnProperty(a.marker)||(t[a.marker]=[-1,-1,-1,-1,-1,-1]);let l=t[a.marker][(a.open?3:0)+a.length%3],u=o-i[o]-1,c=u;for(;u>l;u-=i[u]+1){let d=e[u];if(d.marker===a.marker&&d.open&&d.end<0){let f=!1;if((d.close||a.open)&&(d.length+a.length)%3===0&&(d.length%3!==0||a.length%3!==0)&&(f=!0),!f){let h=u>0&&!e[u-1].open?i[u-1]+1:0;i[s]=s-u+h,i[u]=h,a.open=!1,d.end=s,d.close=!1,c=-1,r=-2;break}}}c!==-1&&(t[a.marker][(a.open?3:0)+(a.length||0)%3]=c)}}function X1(e){let t=e.tokens_meta,n=e.tokens_meta.length;VM(e.delimiters);for(let o=0;o<n;o++)t[o]&&t[o].delimiters&&VM(t[o].delimiters)}function Y1(e){let t,n,o=0,r=e.tokens,i=e.tokens.length;for(t=n=0;t<i;t++)r[t].nesting<0&&o--,r[t].level=o,r[t].nesting>0&&o++,r[t].type==="text"&&t+1<i&&r[t+1].type==="text"?r[t+1].content=r[t].content+r[t+1].content:(t!==n&&(r[n]=r[t]),n++);t!==n&&(r.length=n)}var ev=[["text",F1],["linkify",j1],["newline",B1],["escape",H1],["backticks",q1],["strikethrough",Z1.tokenize],["emphasis",V1.tokenize],["link",W1],["image",K1],["autolink",J1],["html_inline",G1],["entity",Q1]],tv=[["balance_pairs",X1],["strikethrough",Z1.postProcess],["emphasis",V1.postProcess],["fragments_join",Y1]];function cl(){this.ruler=new Do;for(let e=0;e<ev.length;e++)this.ruler.push(ev[e][0],ev[e][1]);this.ruler2=new Do;for(let e=0;e<tv.length;e++)this.ruler2.push(tv[e][0],tv[e][1])}cl.prototype.skipToken=function(e){let t=e.pos,n=this.ruler.getRules(""),o=n.length,r=e.md.options.maxNesting,i=e.cache;if(typeof i[t]<"u"){e.pos=i[t];return}let s=!1;if(e.level<r){for(let a=0;a<o;a++)if(e.level++,s=n[a](e,!0),e.level--,s){if(t>=e.pos)throw new Error("inline rule didn't increment state.pos");break}}else e.pos=e.posMax;s||e.pos++,i[t]=e.pos};cl.prototype.tokenize=function(e){let t=this.ruler.getRules(""),n=t.length,o=e.posMax,r=e.md.options.maxNesting;for(;e.pos<o;){let i=e.pos,s=!1;if(e.level<r){for(let a=0;a<n;a++)if(s=t[a](e,!1),s){if(i>=e.pos)throw new Error("inline rule didn't increment state.pos");break}}if(s){if(e.pos>=o)break;continue}e.pending+=e.src[e.pos++]}e.pending&&e.pushPending()};cl.prototype.parse=function(e,t,n,o){let r=new this.State(e,t,n,o);this.tokenize(r);let i=this.ruler2.getRules(""),s=i.length;for(let a=0;a<s;a++)i[a](r)};cl.prototype.State=UM;var WM=cl;function KM(e){let t={};e=e||{},t.src_Any=Df.source,t.src_Cc=Nf.source,t.src_Z=Of.source,t.src_P=rs.source,t.src_ZPCc=[t.src_Z,t.src_P,t.src_Cc].join("|"),t.src_ZCc=[t.src_Z,t.src_Cc].join("|");let n="[><\uFF5C]";return t.src_pseudo_letter=`(?:(?!${n}|${t.src_ZPCc})${t.src_Any})`,t.src_ip4="(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)",t.src_auth=`(?:(?:(?!${t.src_ZCc}|[@/\\[\\]()]).){1,50}@)?`,t.src_port="(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?",t.src_host_terminator=`(?=$|${n}|${t.src_ZPCc})(?!${e["---"]?"-(?!--)|":"-|"}_|:\\d|\\.-|\\.(?!$|${t.src_ZPCc}))`,t.src_path=`(?:[/?#](?:(?!${t.src_ZCc}|${n}|[()[\\]{}.,"'?!\\-;]).|\\[(?:(?!${t.src_ZCc}|\\]).)*\\]|\\((?:(?!${t.src_ZCc}|[)]).)*\\)|\\{(?:(?!${t.src_ZCc}|[}]).)*\\}|\\"(?:(?!${t.src_ZCc}|["]).)+\\"|\\'(?:(?!${t.src_ZCc}|[']).)+\\'|\\'(?=${t.src_pseudo_letter}|[-])|\\.{2,}[a-zA-Z0-9%/&]|\\.(?!${t.src_ZCc}|[.]|$)|`+(e["---"]?"\\-(?!--(?:[^-]|$))(?:-*)|":"\\-+|")+`,(?!${t.src_ZCc}|$)|;(?!${t.src_ZCc}|$)|\\!+(?!${t.src_ZCc}|[!]|$)|\\?(?!${t.src_ZCc}|[?]|$))+|\\/)?`,t.src_email_name='[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]{0,63}',t.src_xn="xn--[a-z0-9\\-]{1,59}",t.src_domain_root="(?:"+t.src_xn+`|${t.src_pseudo_letter}{1,63})`,t.src_domain="(?:"+t.src_xn+`|(?:${t.src_pseudo_letter})|(?:${t.src_pseudo_letter}(?:-|${t.src_pseudo_letter}){0,61}${t.src_pseudo_letter}))`,t.src_host=`(?:(?:(?:(?:${t.src_domain})\\.)*${t.src_domain}))`,t.tpl_host_fuzzy="(?:"+t.src_ip4+`|(?:(?:(?:${t.src_domain})\\.)+(?:%TLDS%)))`,t.tpl_host_no_ip_fuzzy=`(?:(?:(?:${t.src_domain})\\.)+(?:%TLDS%))`,t.src_host_strict=t.src_host+t.src_host_terminator,t.tpl_host_fuzzy_strict=t.tpl_host_fuzzy+t.src_host_terminator,t.src_host_port_strict=t.src_host+t.src_port+t.src_host_terminator,t.tpl_host_port_fuzzy_strict=t.tpl_host_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_port_no_ip_fuzzy_strict=t.tpl_host_no_ip_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_fuzzy_test=`localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:${t.src_ZPCc}|>|$))`,t.tpl_email_fuzzy=`(^|${n}|"|\\(|${t.src_ZCc})(${t.src_email_name}@${t.tpl_host_fuzzy_strict})`,t.tpl_link_fuzzy=`(^|(?![.:/\\-_@])(?:[$+<=>^\`|\uFF5C]|${t.src_ZPCc}))((?![$+<=>^\`|\uFF5C])${t.tpl_host_port_fuzzy_strict}${t.src_path})`,t.tpl_link_no_ip_fuzzy=`(^|(?![.:/\\-_@])(?:[$+<=>^\`|\uFF5C]|${t.src_ZPCc}))((?![$+<=>^\`|\uFF5C])${t.tpl_host_port_no_ip_fuzzy_strict}${t.src_path})`,t}function nv(e){return Array.prototype.slice.call(arguments,1).forEach(function(n){n&&Object.keys(n).forEach(function(o){e[o]=n[o]})}),e}function Vf(e){return Object.prototype.toString.call(e)}function Dj(e){return Vf(e)==="[object String]"}function Nj(e){return Vf(e)==="[object Object]"}function zj(e){return Vf(e)==="[object RegExp]"}function JM(e){return Vf(e)==="[object Function]"}function Oj(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}var QM={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function Rj(e){return Object.keys(e||{}).reduce(function(t,n){return t||QM.hasOwnProperty(n)},!1)}var Pj={"http:":{validate:function(e,t,n){let o=e.slice(t);return n.re.http||(n.re.http=new RegExp(`^\\/\\/${n.re.src_auth}${n.re.src_host_port_strict}${n.re.src_path}`,"i")),n.re.http.test(o)?o.match(n.re.http)[0].length:0}},"https:":"http:","ftp:":"http:","//":{validate:function(e,t,n){let o=e.slice(t);return n.re.no_http||(n.re.no_http=new RegExp("^"+n.re.src_auth+`(?:localhost|(?:(?:${n.re.src_domain})\\.)+${n.re.src_domain_root})`+n.re.src_port+n.re.src_host_terminator+n.re.src_path,"i")),n.re.no_http.test(o)?t>=3&&e[t-3]===":"||t>=3&&e[t-3]==="/"?0:o.match(n.re.no_http)[0].length:0}},"mailto:":{validate:function(e,t,n){let o=e.slice(t);return n.re.mailto||(n.re.mailto=new RegExp(`^${n.re.src_email_name}@${n.re.src_host_strict}`,"i")),n.re.mailto.test(o)?o.match(n.re.mailto)[0].length:0}}},Lj="a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]",Fj="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|\u0440\u0444".split("|");function jj(e){return function(t,n){let o=t.slice(n);return e.test(o)?o.match(e)[0].length:0}}function GM(){return function(e,t){t.normalize(e)}}function Zf(e){let t=e.re=KM(e.__opts__),n=e.__tlds__.slice();e.onCompile(),e.__tlds_replaced__||n.push(Lj),n.push(t.src_xn),t.src_tlds=n.join("|");function o(a){return a.replace("%TLDS%",t.src_tlds)}t.email_fuzzy=RegExp(o(t.tpl_email_fuzzy),"i"),t.email_fuzzy_global=RegExp(o(t.tpl_email_fuzzy),"ig"),t.link_fuzzy=RegExp(o(t.tpl_link_fuzzy),"i"),t.link_fuzzy_global=RegExp(o(t.tpl_link_fuzzy),"ig"),t.link_no_ip_fuzzy=RegExp(o(t.tpl_link_no_ip_fuzzy),"i"),t.link_no_ip_fuzzy_global=RegExp(o(t.tpl_link_no_ip_fuzzy),"ig"),t.host_fuzzy_test=RegExp(o(t.tpl_host_fuzzy_test),"i");let r=[];e.__compiled__={};function i(a,l){throw new Error(`(LinkifyIt) Invalid schema "${a}": ${l}`)}Object.keys(e.__schemas__).forEach(function(a){let l=e.__schemas__[a];if(l===null)return;let u={validate:null,link:null};if(e.__compiled__[a]=u,Nj(l)){zj(l.validate)?u.validate=jj(l.validate):JM(l.validate)?u.validate=l.validate:i(a,l),JM(l.normalize)?u.normalize=l.normalize:l.normalize?i(a,l):u.normalize=GM();return}if(Dj(l)){r.push(a);return}i(a,l)}),r.forEach(function(a){e.__compiled__[e.__schemas__[a]]&&(e.__compiled__[a].validate=e.__compiled__[e.__schemas__[a]].validate,e.__compiled__[a].normalize=e.__compiled__[e.__schemas__[a]].normalize)}),e.__compiled__[""]={validate:null,normalize:GM()};let s=Object.keys(e.__compiled__).filter(function(a){return a.length>0&&e.__compiled__[a]}).map(Oj).join("|");e.re.schema_test=RegExp(`(^|(?!_)(?:[><\uFF5C]|${t.src_ZPCc}))(${s})`,"i"),e.re.schema_search=RegExp(`(^|(?!_)(?:[><\uFF5C]|${t.src_ZPCc}))(${s})`,"ig"),e.re.schema_at_start=RegExp(`^${e.re.schema_search.source}`,"i"),e.re.pretest=RegExp(`(${e.re.schema_test.source})|(${e.re.host_fuzzy_test.source})|@`,"i")}function XM(e,t,n,o){let r=e.slice(n,o);this.schema=t.toLowerCase(),this.index=n,this.lastIndex=o,this.raw=r,this.text=r,this.url=r}function Xt(e,t){if(!(this instanceof Xt))return new Xt(e,t);t||Rj(e)&&(t=e,e={}),this.__opts__=nv({},QM,t),this.__schemas__=nv({},Pj,e),this.__compiled__={},this.__tlds__=Fj,this.__tlds_replaced__=!1,this.re={},Zf(this)}Xt.prototype.add=function(t,n){return this.__schemas__[t]=n,Zf(this),this};Xt.prototype.set=function(t){return this.__opts__=nv(this.__opts__,t),this};Xt.prototype.test=function(t){if(!t.length)return!1;let n,o;if(this.re.schema_test.test(t)){for(o=this.re.schema_search,o.lastIndex=0;(n=o.exec(t))!==null;)if(this.testSchemaAt(t,n[2],o.lastIndex))return!0}return!!(this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&t.search(this.re.host_fuzzy_test)>=0&&t.match(this.__opts__.fuzzyIP?this.re.link_fuzzy:this.re.link_no_ip_fuzzy)!==null||this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"]&&t.indexOf("@")>=0&&t.match(this.re.email_fuzzy)!==null)};Xt.prototype.pretest=function(t){return this.re.pretest.test(t)};Xt.prototype.testSchemaAt=function(t,n,o){return this.__compiled__[n.toLowerCase()]?this.__compiled__[n.toLowerCase()].validate(t,o,this):0};Xt.prototype.match=function(t){let n=[],o=[],r=[],i=[],s,a,l;function u(f,h){return f?h?f.index!==h.index?f.index<h.index?f:h:f.lastIndex>=h.lastIndex?f:h:f:h}if(!t.length)return null;if(this.re.schema_test.test(t))for(l=this.re.schema_search,l.lastIndex=0;(s=l.exec(t))!==null;)a=this.testSchemaAt(t,s[2],l.lastIndex),a&&o.push({schema:s[2],index:s.index+s[1].length,lastIndex:s.index+s[0].length+a});if(this.__opts__.fuzzyLink&&this.__compiled__["http:"])for(l=this.__opts__.fuzzyIP?this.re.link_fuzzy_global:this.re.link_no_ip_fuzzy_global,l.lastIndex=0;(s=l.exec(t))!==null;)r.push({schema:"",index:s.index+s[1].length,lastIndex:s.index+s[0].length});if(this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"])for(l=this.re.email_fuzzy_global,l.lastIndex=0;(s=l.exec(t))!==null;)i.push({schema:"mailto:",index:s.index+s[1].length,lastIndex:s.index+s[0].length});let c=[0,0,0],d=0;for(;;){let f=[o[c[0]],i[c[1]],r[c[2]]],h=u(u(f[0],f[1]),f[2]);if(!h)break;if(h===f[0]?c[0]++:h===f[1]?c[1]++:c[2]++,h.index<d)continue;let p=new XM(t,h.schema,h.index,h.lastIndex);this.__compiled__[p.schema].normalize(p,this),n.push(p),d=h.lastIndex}return n.length?n:null};Xt.prototype.matchAtStart=function(t){if(!t.length)return null;let n=this.re.schema_at_start.exec(t);if(!n)return null;let o=this.testSchemaAt(t,n[2],n[0].length);if(!o)return null;let r=new XM(t,n[2],n.index+n[1].length,n.index+n[0].length+o);return this.__compiled__[r.schema].normalize(r,this),r};Xt.prototype.tlds=function(t,n){return t=Array.isArray(t)?t:[t],n?(this.__tlds__=this.__tlds__.concat(t).sort().filter(function(o,r,i){return o!==i[r-1]}).reverse(),Zf(this),this):(this.__tlds__=t.slice(),this.__tlds_replaced__=!0,Zf(this),this)};Xt.prototype.normalize=function(t){t.schema||(t.url=`http://${t.url}`),t.schema==="mailto:"&&!/^mailto:/i.test(t.url)&&(t.url=`mailto:${t.url}`)};Xt.prototype.onCompile=function(){};var YM=Xt;var Bj=/^xn--/,Uj=/[^\0-\x7F]/,Hj=/[\x2E\u3002\uFF0E\uFF61]/g,qj={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},rv=35,Bn=Math.floor,ov=String.fromCharCode;function Rr(e){throw new RangeError(qj[e])}function Zj(e,t){let n=[],o=e.length;for(;o--;)n[o]=t(e[o]);return n}function t$(e,t){let n=e.split("@"),o="";n.length>1&&(o=n[0]+"@",e=n[1]),e=e.replace(Hj,".");let r=e.split("."),i=Zj(r,t).join(".");return o+i}function n$(e){let t=[],n=0,o=e.length;for(;n<o;){let r=e.charCodeAt(n++);if(r>=55296&&r<=56319&&n<o){let i=e.charCodeAt(n++);(i&64512)==56320?t.push(((r&1023)<<10)+(i&1023)+65536):(t.push(r),n--)}else t.push(r)}return t}var Vj=e=>String.fromCodePoint(...e),Wj=function(e){return e>=48&&e<58?26+(e-48):e>=65&&e<91?e-65:e>=97&&e<123?e-97:36},e$=function(e,t){return e+22+75*(e<26)-((t!=0)<<5)},r$=function(e,t,n){let o=0;for(e=n?Bn(e/700):e>>1,e+=Bn(e/t);e>rv*26>>1;o+=36)e=Bn(e/rv);return Bn(o+(rv+1)*e/(e+38))},o$=function(e){let t=[],n=e.length,o=0,r=128,i=72,s=e.lastIndexOf("-");s<0&&(s=0);for(let a=0;a<s;++a)e.charCodeAt(a)>=128&&Rr("not-basic"),t.push(e.charCodeAt(a));for(let a=s>0?s+1:0;a<n;){let l=o;for(let c=1,d=36;;d+=36){a>=n&&Rr("invalid-input");let f=Wj(e.charCodeAt(a++));f>=36&&Rr("invalid-input"),f>Bn((2147483647-o)/c)&&Rr("overflow"),o+=f*c;let h=d<=i?1:d>=i+26?26:d-i;if(f<h)break;let p=36-h;c>Bn(2147483647/p)&&Rr("overflow"),c*=p}let u=t.length+1;i=r$(o-l,u,l==0),Bn(o/u)>2147483647-r&&Rr("overflow"),r+=Bn(o/u),o%=u,t.splice(o++,0,r)}return String.fromCodePoint(...t)},i$=function(e){let t=[];e=n$(e);let n=e.length,o=128,r=0,i=72;for(let l of e)l<128&&t.push(ov(l));let s=t.length,a=s;for(s&&t.push("-");a<n;){let l=2147483647;for(let c of e)c>=o&&c<l&&(l=c);let u=a+1;l-o>Bn((2147483647-r)/u)&&Rr("overflow"),r+=(l-o)*u,o=l;for(let c of e)if(c<o&&++r>2147483647&&Rr("overflow"),c===o){let d=r;for(let f=36;;f+=36){let h=f<=i?1:f>=i+26?26:f-i;if(d<h)break;let p=d-h,m=36-h;t.push(ov(e$(h+p%m,0))),d=Bn(p/m)}t.push(ov(e$(d,0))),i=r$(r,u,a===s),r=0,++a}++r,++o}return t.join("")},Kj=function(e){return t$(e,function(t){return Bj.test(t)?o$(t.slice(4).toLowerCase()):t})},Jj=function(e){return t$(e,function(t){return Uj.test(t)?"xn--"+i$(t):t})},Gj={version:"2.3.1",ucs2:{decode:n$,encode:Vj},decode:o$,encode:i$,toASCII:Jj,toUnicode:Kj};var iv=Gj;var s$={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"\u201C\u201D\u2018\u2019",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}};var a$={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"\u201C\u201D\u2018\u2019",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["paragraph"]},inline:{rules:["text"],rules2:["balance_pairs","fragments_join"]}}};var l$={options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"\u201C\u201D\u2018\u2019",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["blockquote","code","fence","heading","hr","html_block","lheading","list","reference","paragraph"]},inline:{rules:["autolink","backticks","emphasis","entity","escape","html_inline","image","link","newline","text"],rules2:["balance_pairs","emphasis","fragments_join"]}}};var Qj={default:s$,zero:a$,commonmark:l$},Xj=/^(vbscript|javascript|file|data):/,Yj=/^data:image\/(gif|png|jpeg|webp);/;function eB(e){let t=e.trim().toLowerCase();return Xj.test(t)?Yj.test(t):!0}var u$=["http:","https:","mailto:"];function tB(e){let t=sl(e,!0);if(t.hostname&&(!t.protocol||u$.indexOf(t.protocol)>=0))try{t.hostname=iv.toASCII(t.hostname)}catch{}return Mf(ns(t))}function nB(e){let t=sl(e,!0);if(t.hostname&&(!t.protocol||u$.indexOf(t.protocol)>=0))try{t.hostname=iv.toUnicode(t.hostname)}catch{}return il(ns(t),il.defaultChars+"%")}function dn(e,t){if(!(this instanceof dn))return new dn(e,t);t||Lf(e)||(t=e||{},e="default"),this.inline=new WM,this.block=new BM,this.core=new NM,this.renderer=new CM,this.linkify=new YM,this.validateLink=eB,this.normalizeLink=tB,this.normalizeLinkText=nB,this.utils=f1,this.helpers=ss({},g1),this.options={},this.configure(e),t&&this.set(t)}dn.prototype.set=function(e){return ss(this.options,e),this};dn.prototype.configure=function(e){let t=this;if(Lf(e)){let n=e;if(e=Qj[n],!e)throw new Error('Wrong `markdown-it` preset "'+n+'", check name')}if(!e)throw new Error("Wrong `markdown-it` preset, can't be empty");return e.options&&t.set(e.options),e.components&&Object.keys(e.components).forEach(function(n){e.components[n].rules&&t[n].ruler.enableOnly(e.components[n].rules),e.components[n].rules2&&t[n].ruler2.enableOnly(e.components[n].rules2)}),this};dn.prototype.enable=function(e,t){let n=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach(function(r){n=n.concat(this[r].ruler.enable(e,!0))},this),n=n.concat(this.inline.ruler2.enable(e,!0));let o=e.filter(function(r){return n.indexOf(r)<0});if(o.length&&!t)throw new Error("MarkdownIt. Failed to enable unknown rule(s): "+o);return this};dn.prototype.disable=function(e,t){let n=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach(function(r){n=n.concat(this[r].ruler.disable(e,!0))},this),n=n.concat(this.inline.ruler2.disable(e,!0));let o=e.filter(function(r){return n.indexOf(r)<0});if(o.length&&!t)throw new Error("MarkdownIt. Failed to disable unknown rule(s): "+o);return this};dn.prototype.use=function(e){let t=[this].concat(Array.prototype.slice.call(arguments,1));return e.apply(e,t),this};dn.prototype.parse=function(e,t){if(typeof e!="string")throw new Error("Input data should be a String");let n=new this.core.State(e,this,t);return this.core.process(n),n.tokens};dn.prototype.render=function(e,t){return t=t||{},this.renderer.render(this.parse(e,t),this.options,t)};dn.prototype.parseInline=function(e,t){let n=new this.core.State(e,this,t);return n.inlineMode=!0,this.core.process(n),n.tokens};dn.prototype.renderInline=function(e,t){return t=t||{},this.renderer.render(this.parseInline(e,t),this.options,t)};var Pr=dn;var rB=new Vn({nodes:{doc:{content:"block+"},paragraph:{content:"inline*",group:"block",parseDOM:[{tag:"p"}],toDOM(){return["p",0]}},blockquote:{content:"block+",group:"block",parseDOM:[{tag:"blockquote"}],toDOM(){return["blockquote",0]}},horizontal_rule:{group:"block",parseDOM:[{tag:"hr"}],toDOM(){return["div",["hr"]]}},heading:{attrs:{level:{default:1}},content:"(text | image)*",group:"block",defining:!0,parseDOM:[{tag:"h1",attrs:{level:1}},{tag:"h2",attrs:{level:2}},{tag:"h3",attrs:{level:3}},{tag:"h4",attrs:{level:4}},{tag:"h5",attrs:{level:5}},{tag:"h6",attrs:{level:6}}],toDOM(e){return["h"+e.attrs.level,0]}},code_block:{content:"text*",group:"block",code:!0,defining:!0,marks:"",attrs:{params:{default:""}},parseDOM:[{tag:"pre",preserveWhitespace:"full",getAttrs:e=>({params:e.getAttribute("data-params")||""})}],toDOM(e){return["pre",e.attrs.params?{"data-params":e.attrs.params}:{},["code",0]]}},ordered_list:{content:"list_item+",group:"block",attrs:{order:{default:1},tight:{default:!1}},parseDOM:[{tag:"ol",getAttrs(e){return{order:e.hasAttribute("start")?+e.getAttribute("start"):1,tight:e.hasAttribute("data-tight")}}}],toDOM(e){return["ol",{start:e.attrs.order==1?null:e.attrs.order,"data-tight":e.attrs.tight?"true":null},0]}},bullet_list:{content:"list_item+",group:"block",attrs:{tight:{default:!1}},parseDOM:[{tag:"ul",getAttrs:e=>({tight:e.hasAttribute("data-tight")})}],toDOM(e){return["ul",{"data-tight":e.attrs.tight?"true":null},0]}},list_item:{content:"block+",defining:!0,parseDOM:[{tag:"li"}],toDOM(){return["li",0]}},text:{group:"inline"},image:{inline:!0,attrs:{src:{},alt:{default:null},title:{default:null}},group:"inline",draggable:!0,parseDOM:[{tag:"img[src]",getAttrs(e){return{src:e.getAttribute("src"),title:e.getAttribute("title"),alt:e.getAttribute("alt")}}}],toDOM(e){return["img",e.attrs]}},hard_break:{inline:!0,group:"inline",selectable:!1,parseDOM:[{tag:"br"}],toDOM(){return["br"]}}},marks:{em:{parseDOM:[{tag:"i"},{tag:"em"},{style:"font-style=italic"},{style:"font-style=normal",clearMark:e=>e.type.name=="em"}],toDOM(){return["em"]}},strong:{parseDOM:[{tag:"strong"},{tag:"b",getAttrs:e=>e.style.fontWeight!="normal"&&null},{style:"font-weight=400",clearMark:e=>e.type.name=="strong"},{style:"font-weight",getAttrs:e=>/^(bold(er)?|[5-9]\d{2,})$/.test(e)&&null}],toDOM(){return["strong"]}},link:{attrs:{href:{},title:{default:null}},inclusive:!1,parseDOM:[{tag:"a[href]",getAttrs(e){return{href:e.getAttribute("href"),title:e.getAttribute("title")}}}],toDOM(e){return["a",e.attrs]}},code:{code:!0,parseDOM:[{tag:"code"}],toDOM(){return["code"]}}}});function oB(e,t){if(e.isText&&t.isText&&be.sameSet(e.marks,t.marks))return e.withText(e.text+t.text)}var lv=class{constructor(t,n){this.schema=t,this.tokenHandlers=n,this.stack=[{type:t.topNodeType,attrs:null,content:[],marks:be.none}]}top(){return this.stack[this.stack.length-1]}push(t){this.stack.length&&this.top().content.push(t)}addText(t){if(!t)return;let n=this.top(),o=n.content,r=o[o.length-1],i=this.schema.text(t,n.marks),s;r&&(s=oB(r,i))?o[o.length-1]=s:o.push(i)}openMark(t){let n=this.top();n.marks=t.addToSet(n.marks)}closeMark(t){let n=this.top();n.marks=t.removeFromSet(n.marks)}parseTokens(t){for(let n=0;n<t.length;n++){let o=t[n],r=this.tokenHandlers[o.type];if(!r)throw new Error("Token type `"+o.type+"` not supported by Markdown parser");r(this,o,t,n)}}addNode(t,n,o){let r=this.top(),i=t.createAndFill(n,o,r?r.marks:[]);return i?(this.push(i),i):null}openNode(t,n){this.stack.push({type:t,attrs:n,content:[],marks:be.none})}closeNode(){let t=this.stack.pop();return this.addNode(t.type,t.attrs,t.content)}};function dl(e,t,n,o){return e.getAttrs?e.getAttrs(t,n,o):e.attrs instanceof Function?e.attrs(t):e.attrs}function sv(e,t){return e.noCloseToken||t=="code_inline"||t=="code_block"||t=="fence"}function c$(e){return e[e.length-1]==`
`?e.slice(0,e.length-1):e}function av(){}function iB(e,t){let n=Object.create(null);for(let o in t){let r=t[o];if(r.block){let i=e.nodeType(r.block);sv(r,o)?n[o]=(s,a,l,u)=>{s.openNode(i,dl(r,a,l,u)),s.addText(c$(a.content)),s.closeNode()}:(n[o+"_open"]=(s,a,l,u)=>s.openNode(i,dl(r,a,l,u)),n[o+"_close"]=s=>s.closeNode())}else if(r.node){let i=e.nodeType(r.node);n[o]=(s,a,l,u)=>s.addNode(i,dl(r,a,l,u))}else if(r.mark){let i=e.marks[r.mark];sv(r,o)?n[o]=(s,a,l,u)=>{s.openMark(i.create(dl(r,a,l,u))),s.addText(c$(a.content)),s.closeMark(i)}:(n[o+"_open"]=(s,a,l,u)=>s.openMark(i.create(dl(r,a,l,u))),n[o+"_close"]=s=>s.closeMark(i))}else if(r.ignore)sv(r,o)?n[o]=av:(n[o+"_open"]=av,n[o+"_close"]=av);else throw new RangeError("Unrecognized parsing spec "+JSON.stringify(r))}return n.text=(o,r)=>o.addText(r.content),n.inline=(o,r)=>o.parseTokens(r.children),n.softbreak=n.softbreak||(o=>o.addText(" ")),n}var uv=class{constructor(t,n,o){this.schema=t,this.tokenizer=n,this.tokens=o,this.tokenHandlers=iB(t,o)}parse(t,n={}){let o=new lv(this.schema,this.tokenHandlers),r;o.parseTokens(this.tokenizer.parse(t,n));do r=o.closeNode();while(o.stack.length);return r||this.schema.topNodeType.createAndFill()}};function d$(e,t){for(;++t<e.length;)if(e[t].type!="list_item_open")return e[t].hidden;return!1}var Lne=new uv(rB,Pr("commonmark",{html:!1}),{blockquote:{block:"blockquote"},paragraph:{block:"paragraph"},list_item:{block:"list_item"},bullet_list:{block:"bullet_list",getAttrs:(e,t,n)=>({tight:d$(t,n)})},ordered_list:{block:"ordered_list",getAttrs:(e,t,n)=>({order:+e.attrGet("start")||1,tight:d$(t,n)})},heading:{block:"heading",getAttrs:e=>({level:+e.tag.slice(1)})},code_block:{block:"code_block",noCloseToken:!0},fence:{block:"code_block",getAttrs:e=>({params:e.info||""}),noCloseToken:!0},hr:{node:"horizontal_rule"},image:{node:"image",getAttrs:e=>({src:e.attrGet("src"),title:e.attrGet("title")||null,alt:e.children[0]&&e.children[0].content||null})},hardbreak:{node:"hard_break"},em:{mark:"em"},strong:{mark:"strong"},link:{mark:"link",getAttrs:e=>({href:e.attrGet("href"),title:e.attrGet("title")||null})},code_inline:{mark:"code",noCloseToken:!0}}),sB={open:"",close:"",mixable:!0},cv=class{constructor(t,n,o={}){this.nodes=t,this.marks=n,this.options=o}serialize(t,n={}){n=Object.assign({},this.options,n);let o=new fl(this.nodes,this.marks,n);return o.renderContent(t),o.out}},kn=new cv({blockquote(e,t){e.wrapBlock("> ",null,t,()=>e.renderContent(t))},code_block(e,t){let n=t.textContent.match(/`{3,}/gm),o=n?n.sort().slice(-1)[0]+"`":"```";e.write(o+(t.attrs.params||"")+`
`),e.text(t.textContent,!1),e.write(`
`),e.write(o),e.closeBlock(t)},heading(e,t){e.write(e.repeat("#",t.attrs.level)+" "),e.renderInline(t,!1),e.closeBlock(t)},horizontal_rule(e,t){e.write(t.attrs.markup||"---"),e.closeBlock(t)},bullet_list(e,t){e.renderList(t," ",()=>(t.attrs.bullet||"*")+" ")},ordered_list(e,t){let n=t.attrs.order||1,o=String(n+t.childCount-1).length,r=e.repeat(" ",o+2);e.renderList(t,r,i=>{let s=String(n+i);return e.repeat(" ",o-s.length)+s+". "})},list_item(e,t){e.renderContent(t)},paragraph(e,t){e.renderInline(t),e.closeBlock(t)},image(e,t){e.write("]/g,"\\$&")+(t.attrs.title?' "'+t.attrs.title.replace(/"/g,'\\"')+'"':"")+")")},hard_break(e,t,n,o){for(let r=o+1;r<n.childCount;r++)if(n.child(r).type!=t.type){e.write(`\\
`);return}},text(e,t){e.text(t.text,!e.inAutolink)}},{em:{open:"*",close:"*",mixable:!0,expelEnclosingWhitespace:!0},strong:{open:"**",close:"**",mixable:!0,expelEnclosingWhitespace:!0},link:{open(e,t,n,o){return e.inAutolink=aB(t,n,o),e.inAutolink?"<":"["},close(e,t,n,o){let{inAutolink:r}=e;return e.inAutolink=void 0,r?">":"]("+t.attrs.href.replace(/[\(\)"]/g,"\\$&")+(t.attrs.title?` "${t.attrs.title.replace(/"/g,'\\"')}"`:"")+")"},mixable:!0},code:{open(e,t,n,o){return f$(n.child(o),-1)},close(e,t,n,o){return f$(n.child(o-1),1)},escape:!1}});function f$(e,t){let n=/`+/g,o,r=0;if(e.isText)for(;o=n.exec(e.text);)r=Math.max(r,o[0].length);let i=r>0&&t>0?" `":"`";for(let s=0;s<r;s++)i+="`";return r>0&&t<0&&(i+=" "),i}function aB(e,t,n){if(e.attrs.title||!/^\w+:/.test(e.attrs.href))return!1;let o=t.child(n);return!o.isText||o.text!=e.attrs.href||o.marks[o.marks.length-1]!=e?!1:n==t.childCount-1||!e.isInSet(t.child(n+1).marks)}var fl=class{constructor(t,n,o){this.nodes=t,this.marks=n,this.options=o,this.delim="",this.out="",this.closed=null,this.inAutolink=void 0,this.atBlockStart=!1,this.inTightList=!1,typeof this.options.tightLists>"u"&&(this.options.tightLists=!1),typeof this.options.hardBreakNodeName>"u"&&(this.options.hardBreakNodeName="hard_break")}flushClose(t=2){if(this.closed){if(this.atBlank()||(this.out+=`
`),t>1){let n=this.delim,o=/\s+$/.exec(n);o&&(n=n.slice(0,n.length-o[0].length));for(let r=1;r<t;r++)this.out+=n+`
`}this.closed=null}}getMark(t){let n=this.marks[t];if(!n){if(this.options.strict!==!1)throw new Error(`Mark type \`${t}\` not supported by Markdown renderer`);n=sB}return n}wrapBlock(t,n,o,r){let i=this.delim;this.write(n??t),this.delim+=t,r(),this.delim=i,this.closeBlock(o)}atBlank(){return/(^|\n)$/.test(this.out)}ensureNewLine(){this.atBlank()||(this.out+=`
`)}write(t){this.flushClose(),this.delim&&this.atBlank()&&(this.out+=this.delim),t&&(this.out+=t)}closeBlock(t){this.closed=t}text(t,n=!0){let o=t.split(`
`);for(let r=0;r<o.length;r++)this.write(),!n&&o[r][0]=="["&&/(^|[^\\])\!$/.test(this.out)&&(this.out=this.out.slice(0,this.out.length-1)+"\\!"),this.out+=n?this.esc(o[r],this.atBlockStart):o[r],r!=o.length-1&&(this.out+=`
`)}render(t,n,o){if(this.nodes[t.type.name])this.nodes[t.type.name](this,t,n,o);else{if(this.options.strict!==!1)throw new Error("Token type `"+t.type.name+"` not supported by Markdown renderer");t.type.isLeaf||(t.type.inlineContent?this.renderInline(t):this.renderContent(t),t.isBlock&&this.closeBlock(t))}}renderContent(t){t.forEach((n,o,r)=>this.render(n,t,r))}renderInline(t,n=!0){this.atBlockStart=n;let o=[],r="",i=(s,a,l)=>{let u=s?s.marks:[];s&&s.type.name===this.options.hardBreakNodeName&&(u=u.filter(m=>{if(l+1==t.childCount)return!1;let g=t.child(l+1);return m.isInSet(g.marks)&&(!g.isText||/\S/.test(g.text))}));let c=r;if(r="",s&&s.isText&&u.some(m=>{let g=this.getMark(m.type.name);return g&&g.expelEnclosingWhitespace&&!m.isInSet(o)})){let[m,g,b]=/^(\s*)(.*)$/m.exec(s.text);g&&(c+=g,s=b?s.withText(b):null,s||(u=o))}if(s&&s.isText&&u.some(m=>{let g=this.getMark(m.type.name);return g&&g.expelEnclosingWhitespace&&!this.isMarkAhead(t,l+1,m)})){let[m,g,b]=/^(.*?)(\s*)$/m.exec(s.text);b&&(r=b,s=g?s.withText(g):null,s||(u=o))}let d=u.length?u[u.length-1]:null,f=d&&this.getMark(d.type.name).escape===!1,h=u.length-(f?1:0);e:for(let m=0;m<h;m++){let g=u[m];if(!this.getMark(g.type.name).mixable)break;for(let b=0;b<o.length;b++){let y=o[b];if(!this.getMark(y.type.name).mixable)break;if(g.eq(y)){m>b?u=u.slice(0,b).concat(g).concat(u.slice(b,m)).concat(u.slice(m+1,h)):b>m&&(u=u.slice(0,m).concat(u.slice(m+1,b)).concat(g).concat(u.slice(b,h)));continue e}}}let p=0;for(;p<Math.min(o.length,h)&&u[p].eq(o[p]);)++p;for(;p<o.length;)this.text(this.markString(o.pop(),!1,t,l),!1);if(c&&this.text(c),s){for(;o.length<h;){let m=u[o.length];o.push(m),this.text(this.markString(m,!0,t,l),!1),this.atBlockStart=!1}f&&s.isText?this.text(this.markString(d,!0,t,l)+s.text+this.markString(d,!1,t,l+1),!1):this.render(s,t,l),this.atBlockStart=!1}s?.isText&&s.nodeSize>0&&(this.atBlockStart=!1)};t.forEach(i),i(null,0,t.childCount),this.atBlockStart=!1}renderList(t,n,o){this.closed&&this.closed.type==t.type?this.flushClose(3):this.inTightList&&this.flushClose(1);let r=typeof t.attrs.tight<"u"?t.attrs.tight:this.options.tightLists,i=this.inTightList;this.inTightList=r,t.forEach((s,a,l)=>{l&&r&&this.flushClose(1),this.wrapBlock(n,o(l),t,()=>this.render(s,t,l))}),this.inTightList=i}esc(t,n=!1){return t=t.replace(/[`*\\~\[\]_]/g,(o,r)=>o=="_"&&r>0&&r+1<t.length&&t[r-1].match(/\w/)&&t[r+1].match(/\w/)?o:"\\"+o),n&&(t=t.replace(/^(\+[ ]|[\-*>])/,"\\$&").replace(/^(\s*)(#{1,6})(\s|$)/,"$1\\$2$3").replace(/^(\s*\d+)\.\s/,"$1\\. ")),this.options.escapeExtraCharacters&&(t=t.replace(this.options.escapeExtraCharacters,"\\$&")),t}quote(t){let n=t.indexOf('"')==-1?'""':t.indexOf("'")==-1?"''":"()";return n[0]+t+n[1]}repeat(t,n){let o="";for(let r=0;r<n;r++)o+=t;return o}markString(t,n,o,r){let i=this.getMark(t.type.name),s=n?i.open:i.close;return typeof s=="string"?s:s(this,t,o,r)}getEnclosingWhitespace(t){return{leading:(t.match(/^(\s+)/)||[void 0])[0],trailing:(t.match(/(\s+)$/)||[void 0])[0]}}isMarkAhead(t,n,o){for(;;n++){if(n>=t.childCount)return!1;let r=t.child(n);if(r.type.name!=this.options.hardBreakNodeName)return o.isInSet(r.marks);n++}}};var k$=Pv(b$(),1);var vB=Object.defineProperty,xB=(e,t,n)=>t in e?vB(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Wf=(e,t,n)=>(xB(e,typeof t!="symbol"?t+"":t,n),n),kB=Me.create({name:"markdownTightLists",addOptions:()=>({tight:!0,tightClass:"tight",listTypes:["bulletList","orderedList"]}),addGlobalAttributes(){return[{types:this.options.listTypes,attributes:{tight:{default:this.options.tight,parseHTML:e=>e.getAttribute("data-tight")==="true"||!e.querySelector("p"),renderHTML:e=>({class:e.tight?this.options.tightClass:null,"data-tight":e.tight?"true":null})}}}]},addCommands(){var e=this;return{toggleTight:function(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return n=>{let{editor:o,commands:r}=n;function i(s){if(!o.isActive(s))return!1;let a=o.getAttributes(s);return r.updateAttributes(s,{tight:t??!(a!=null&&a.tight)})}return e.options.listTypes.some(s=>i(s))}}}}}),y$=Pr();function w$(e,t){return y$.inline.State.prototype.scanDelims.call({src:e,posMax:e.length}),new y$.inline.State(e,null,null,[]).scanDelims(t,!0)}function S$(e,t,n,o){let r=e.substring(0,n)+e.substring(n+t.length);return r=r.substring(0,n+o)+t+r.substring(n+o),r}function wB(e,t,n,o){let r=n,i=e;for(;r<o&&!w$(i,r).can_open;)i=S$(i,t,r,1),r++;return{text:i,from:r,to:o}}function SB(e,t,n,o){let r=o,i=e;for(;r>n&&!w$(i,r).can_close;)i=S$(i,t,r,-1),r--;return{text:i,from:n,to:r}}function _B(e,t,n,o){let r={text:e,from:n,to:o};return r=wB(r.text,t,r.from,r.to),r=SB(r.text,t,r.from,r.to),r.to-r.from<t.length+1&&(r.text=r.text.substring(0,r.from)+r.text.substring(r.to+t.length)),r.text}var pv=class extends fl{constructor(t,n,o){super(t,n,o??{}),Wf(this,"inTable",!1),this.inlines=[]}render(t,n,o){super.render(t,n,o);let r=this.inlines[this.inlines.length-1];if(r!=null&&r.start&&r!==null&&r!==void 0&&r.end){let{delimiter:i,start:s,end:a}=this.normalizeInline(r);this.out=_B(this.out,i,s,a),this.inlines.pop()}}markString(t,n,o,r){let i=this.marks[t.type.name];if(i.expelEnclosingWhitespace)if(n)this.inlines.push({start:this.out.length,delimiter:i.open});else{let s=this.inlines.pop();this.inlines.push({...s,end:this.out.length})}return super.markString(t,n,o,r)}normalizeInline(t){let{start:n,end:o}=t;for(;this.out.charAt(n).match(/\s/);)n++;return{...t,start:n}}},_$=at.create({name:"markdownHTMLMark",addStorage(){return{markdown:{serialize:{open(e,t){var n,o;return this.editor.storage.markdown.options.html?(n=(o=v$(t))===null||o===void 0?void 0:o[0])!==null&&n!==void 0?n:"":(console.warn(`Tiptap Markdown: "${t.type.name}" mark is only available in html mode`),"")},close(e,t){var n,o;return this.editor.storage.markdown.options.html&&(n=(o=v$(t))===null||o===void 0?void 0:o[1])!==null&&n!==void 0?n:""}},parse:{}}}}});function v$(e){let t=e.type.schema,n=t.text(" ",[e]),r=Vi(M.from(n),t).match(/^(<.*?>) (<\/.*?>)$/);return r?[r[1],r[2]]:null}function gv(e){let t=`<body>${e}</body>`;return new window.DOMParser().parseFromString(t,"text/html").body}function EB(e){return e?.replace(/</g,"<").replace(/>/g,">")}function CB(e){let t=e.parentElement,n=t.cloneNode();for(;t.firstChild&&t.firstChild!==e;)n.appendChild(t.firstChild);n.childNodes.length>0&&t.parentElement.insertBefore(n,t),t.parentElement.insertBefore(e,t),t.childNodes.length===0&&t.remove()}function TB(e){let t=e.parentNode;for(;e.firstChild;)t.insertBefore(e.firstChild,e);t.removeChild(e)}var Jf=ce.create({name:"markdownHTMLNode",addStorage(){return{markdown:{serialize(e,t,n){this.editor.storage.markdown.options.html?e.write(AB(t,n)):(console.warn(`Tiptap Markdown: "${t.type.name}" node is only available in html mode`),e.write(`[${t.type.name}]`)),t.isBlock&&e.closeBlock(t)},parse:{}}}}});function AB(e,t){let n=e.type.schema,o=Vi(M.from(e),n);return e.isBlock&&(t instanceof M||t.type.name===n.topNodeType.name)?MB(o):o}function MB(e){let n=gv(e).firstElementChild;return n.innerHTML=n.innerHTML.trim()?`
${n.innerHTML}
`:`
`,n.outerHTML}var $B=ce.create({name:"blockquote"}),IB=$B.extend({addStorage(){return{markdown:{serialize:kn.nodes.blockquote,parse:{}}}}}),DB=ce.create({name:"bulletList"}),E$=DB.extend({addStorage(){return{markdown:{serialize(e,t){return e.renderList(t," ",()=>(this.editor.storage.markdown.options.bulletListMarker||"-")+" ")},parse:{}}}}}),NB=ce.create({name:"codeBlock"}),zB=NB.extend({addStorage(){return{markdown:{serialize(e,t){e.write("```"+(t.attrs.language||"")+`
`),e.text(t.textContent,!1),e.ensureNewLine(),e.write("```"),e.closeBlock(t)},parse:{setup(e){var t;e.set({langPrefix:(t=this.options.languageClassPrefix)!==null&&t!==void 0?t:"language-"})},updateDOM(e){e.innerHTML=e.innerHTML.replace(/\n<\/code><\/pre>/g,"</code></pre>")}}}}}}),OB=ce.create({name:"hardBreak"}),C$=OB.extend({addStorage(){return{markdown:{serialize(e,t,n,o){for(let r=o+1;r<n.childCount;r++)if(n.child(r).type!=t.type){e.write(e.inTable?Jf.storage.markdown.serialize.call(this,e,t,n):`\\
`);return}},parse:{}}}}}),RB=ce.create({name:"heading"}),PB=RB.extend({addStorage(){return{markdown:{serialize:kn.nodes.heading,parse:{}}}}}),LB=ce.create({name:"horizontalRule"}),FB=LB.extend({addStorage(){return{markdown:{serialize:kn.nodes.horizontal_rule,parse:{}}}}}),jB=ce.create({name:"image"}),BB=jB.extend({addStorage(){return{markdown:{serialize:kn.nodes.image,parse:{}}}}}),UB=ce.create({name:"listItem"}),HB=UB.extend({addStorage(){return{markdown:{serialize:kn.nodes.list_item,parse:{}}}}}),qB=ce.create({name:"orderedList"});function ZB(e,t,n){let o=0;for(;n-o>0&&t.child(n-o-1).type.name===e.type.name;o++);return o}var VB=qB.extend({addStorage(){return{markdown:{serialize(e,t,n,o){let r=t.attrs.start||1,i=String(r+t.childCount-1).length,s=e.repeat(" ",i+2),l=ZB(t,n,o)%2?") ":". ";e.renderList(t,s,u=>{let c=String(r+u);return e.repeat(" ",i-c.length)+c+l})},parse:{}}}}}),WB=ce.create({name:"paragraph"}),KB=WB.extend({addStorage(){return{markdown:{serialize:kn.nodes.paragraph,parse:{}}}}});function fv(e){var t,n;return(t=e==null||(n=e.content)===null||n===void 0?void 0:n.content)!==null&&t!==void 0?t:[]}var JB=ce.create({name:"table"}),GB=JB.extend({addStorage(){return{markdown:{serialize(e,t,n){if(!QB(t)){Jf.storage.markdown.serialize.call(this,e,t,n);return}e.inTable=!0,t.forEach((o,r,i)=>{if(e.write("| "),o.forEach((s,a,l)=>{l&&e.write(" | ");let u=s.firstChild;u.textContent.trim()&&e.renderInline(u)}),e.write(" |"),e.ensureNewLine(),!i){let s=Array.from({length:o.childCount}).map(()=>"---").join(" | ");e.write(`| ${s} |`),e.ensureNewLine()}}),e.closeBlock(t),e.inTable=!1},parse:{}}}}});function x$(e){return e.attrs.colspan>1||e.attrs.rowspan>1}function QB(e){let t=fv(e),n=t[0],o=t.slice(1);return!(fv(n).some(r=>r.type.name!=="tableHeader"||x$(r)||r.childCount>1)||o.some(r=>fv(r).some(i=>i.type.name==="tableHeader"||x$(i)||i.childCount>1)))}var XB=ce.create({name:"taskItem"}),YB=XB.extend({addStorage(){return{markdown:{serialize(e,t){let n=t.attrs.checked?"[x]":"[ ]";e.write(`${n} `),e.renderContent(t)},parse:{updateDOM(e){[...e.querySelectorAll(".task-list-item")].forEach(t=>{let n=t.querySelector("input");t.setAttribute("data-type","taskItem"),n&&(t.setAttribute("data-checked",n.checked),n.remove())})}}}}}}),eU=ce.create({name:"taskList"}),tU=eU.extend({addStorage(){return{markdown:{serialize:E$.storage.markdown.serialize,parse:{setup(e){e.use(k$.default)},updateDOM(e){[...e.querySelectorAll(".contains-task-list")].forEach(t=>{t.setAttribute("data-type","taskList")})}}}}}}),nU=ce.create({name:"text"}),rU=nU.extend({addStorage(){return{markdown:{serialize(e,t){e.text(EB(t.text))},parse:{}}}}}),oU=at.create({name:"bold"}),iU=oU.extend({addStorage(){return{markdown:{serialize:kn.marks.strong,parse:{}}}}}),sU=at.create({name:"code"}),aU=sU.extend({addStorage(){return{markdown:{serialize:kn.marks.code,parse:{}}}}}),lU=at.create({name:"italic"}),uU=lU.extend({addStorage(){return{markdown:{serialize:kn.marks.em,parse:{}}}}}),cU=at.create({name:"link"}),dU=cU.extend({addStorage(){return{markdown:{serialize:kn.marks.link,parse:{}}}}}),fU=at.create({name:"strike"}),pU=fU.extend({addStorage(){return{markdown:{serialize:{open:"~~",close:"~~",expelEnclosingWhitespace:!0},parse:{}}}}}),hU=[IB,E$,zB,C$,PB,FB,Jf,BB,HB,VB,KB,GB,YB,tU,rU,iU,aU,_$,uU,dU,pU];function Kf(e){var t,n;let o=(t=e.storage)===null||t===void 0?void 0:t.markdown,r=(n=hU.find(i=>i.name===e.name))===null||n===void 0?void 0:n.storage.markdown;return o||r?{...r,...o}:null}var hv=class{constructor(t){Wf(this,"editor",null),this.editor=t}serialize(t){let n=new pv(this.nodes,this.marks,{hardBreakNodeName:C$.name});return n.renderContent(t),n.out}get nodes(){var t;return{...Object.fromEntries(Object.keys(this.editor.schema.nodes).map(n=>[n,this.serializeNode(Jf)])),...Object.fromEntries((t=this.editor.extensionManager.extensions.filter(n=>n.type==="node"&&this.serializeNode(n)).map(n=>[n.name,this.serializeNode(n)]))!==null&&t!==void 0?t:[])}}get marks(){var t;return{...Object.fromEntries(Object.keys(this.editor.schema.marks).map(n=>[n,this.serializeMark(_$)])),...Object.fromEntries((t=this.editor.extensionManager.extensions.filter(n=>n.type==="mark"&&this.serializeMark(n)).map(n=>[n.name,this.serializeMark(n)]))!==null&&t!==void 0?t:[])}}serializeNode(t){var n;return(n=Kf(t))===null||n===void 0||(n=n.serialize)===null||n===void 0?void 0:n.bind({editor:this.editor,options:t.options})}serializeMark(t){var n;let o=(n=Kf(t))===null||n===void 0?void 0:n.serialize;return o?{...o,open:typeof o.open=="function"?o.open.bind({editor:this.editor,options:t.options}):o.open,close:typeof o.close=="function"?o.close.bind({editor:this.editor,options:t.options}):o.close}:null}},mv=class{constructor(t,n){Wf(this,"editor",null),Wf(this,"md",null);let{html:o,linkify:r,breaks:i}=n;this.editor=t,this.md=this.withPatchedRenderer(Pr({html:o,linkify:r,breaks:i}))}parse(t){let{inline:n}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(typeof t=="string"){this.editor.extensionManager.extensions.forEach(i=>{var s;return(s=Kf(i))===null||s===void 0||(s=s.parse)===null||s===void 0||(s=s.setup)===null||s===void 0?void 0:s.call({editor:this.editor,options:i.options},this.md)});let o=this.md.render(t),r=gv(o);return this.editor.extensionManager.extensions.forEach(i=>{var s;return(s=Kf(i))===null||s===void 0||(s=s.parse)===null||s===void 0||(s=s.updateDOM)===null||s===void 0?void 0:s.call({editor:this.editor,options:i.options},r)}),this.normalizeDOM(r,{inline:n,content:t}),r.innerHTML}return t}normalizeDOM(t,n){let{inline:o,content:r}=n;return this.normalizeBlocks(t),t.querySelectorAll("*").forEach(i=>{var s;((s=i.nextSibling)===null||s===void 0?void 0:s.nodeType)===Node.TEXT_NODE&&!i.closest("pre")&&(i.nextSibling.textContent=i.nextSibling.textContent.replace(/^\n/,""))}),o&&this.normalizeInline(t,r),t}normalizeBlocks(t){let o=Object.values(this.editor.schema.nodes).filter(r=>r.isBlock).map(r=>{var i;return(i=r.spec.parseDOM)===null||i===void 0?void 0:i.map(s=>s.tag)}).flat().filter(Boolean).join(",");o&&[...t.querySelectorAll(o)].forEach(r=>{r.parentElement.matches("p")&&CB(r)})}normalizeInline(t,n){var o;if((o=t.firstElementChild)!==null&&o!==void 0&&o.matches("p")){var r,i,s,a;let l=t.firstElementChild,{nextElementSibling:u}=l,c=(r=(i=n.match(/^\s+/))===null||i===void 0?void 0:i[0])!==null&&r!==void 0?r:"",d=u?"":(s=(a=n.match(/\s+$/))===null||a===void 0?void 0:a[0])!==null&&s!==void 0?s:"";if(n.match(/^\n\n/)){l.innerHTML=`${l.innerHTML}${d}`;return}TB(l),t.innerHTML=`${c}${t.innerHTML}${d}`}}withPatchedRenderer(t){let n=o=>function(){let r=o(...arguments);return r===`
`?r:r[r.length-1]===`
`?r.slice(0,-1):r};return t.renderer.rules.hardbreak=n(t.renderer.rules.hardbreak),t.renderer.rules.softbreak=n(t.renderer.rules.softbreak),t.renderer.rules.fence=n(t.renderer.rules.fence),t.renderer.rules.code_block=n(t.renderer.rules.code_block),t.renderer.renderToken=n(t.renderer.renderToken.bind(t.renderer)),t}},mU=Me.create({name:"markdownClipboard",addOptions(){return{transformPastedText:!1,transformCopiedText:!1}},addProseMirrorPlugins(){return[new de({key:new ke("markdownClipboard"),props:{clipboardTextParser:(e,t,n)=>{if(n||!this.options.transformPastedText)return null;let o=this.editor.storage.markdown.parser.parse(e,{inline:!0});return mn.fromSchema(this.editor.schema).parseSlice(gv(o),{preserveWhitespace:!0,context:t})},clipboardTextSerializer:e=>this.options.transformCopiedText?this.editor.storage.markdown.serializer.serialize(e.content):null}})]}}),T$=Me.create({name:"markdown",priority:50,addOptions(){return{html:!0,tightLists:!0,tightListClass:"tight",bulletListMarker:"-",linkify:!1,breaks:!1,transformPastedText:!1,transformCopiedText:!1}},addCommands(){let e=iT.Commands.config.addCommands();return{setContent:(t,n)=>o=>e.setContent(o.editor.storage.markdown.parser.parse(t),n)(o),insertContentAt:(t,n,o)=>r=>e.insertContentAt(t,r.editor.storage.markdown.parser.parse(n,{inline:!0}),o)(r)}},onBeforeCreate(){this.editor.storage.markdown={options:{...this.options},parser:new mv(this.editor,this.options),serializer:new hv(this.editor),getMarkdown:()=>this.editor.storage.markdown.serializer.serialize(this.editor.state.doc)},this.editor.options.initialContent=this.editor.options.content,this.editor.options.content=this.editor.storage.markdown.parser.parse(this.editor.options.content)},onCreate(){this.editor.options.content=this.editor.options.initialContent,delete this.editor.options.initialContent},addStorage(){return{}},addExtensions(){return[kB.configure({tight:this.options.tightLists,tightClass:this.options.tightListClass}),mU.configure({transformPastedText:this.options.transformPastedText,transformCopiedText:this.options.transformCopiedText})]}});function gU(e){let t=e.normalize("NFKD").replace(/[\u0300-\u036f]/g,"").toLowerCase().trim().replace(/[^a-z0-9\s-]/g," ").replace(/\s+/g,"-").replace(/-+/g,"-").replace(/^-+|-+$/g,"");return t.length>0?t:"section"}function zo(e){return gU(e)}function Oo(){let e=new Map,t=new Set;return n=>{let o=zo(n),r=e.get(o)??1,i=r===1?o:`${o}-${r}`;for(;t.has(i);)r+=1,i=`${o}-${r}`;return e.set(o,r+1),t.add(i),i}}function cs(e){return/^[A-Za-z]:[\\/]/.test(e)}function hl(e){return e.replace(/\\/g,"/")}function Un(e){return hl(e).replace(/\/+/g,"/")}function pl(e){let t=Un(e);return cs(t)?t.slice(0,3):t.startsWith("/")?"/":""}function Gf(e){let t=Un(e),n=pl(t);return t.slice(n.length).split("/").filter(Boolean)}function Ro(e){let t=pl(e),n=Gf(e);return n.length<=1?t||".":`${t}${n.slice(0,-1).join("/")}`}function A$(e){let t=pl(e),n=Gf(e),o=[];for(let r=n.length-1;r>=1;r-=1){let i=`${t}${n.slice(0,r).join("/")}`;o.push(i||".")}return t&&o[o.length-1]!==t&&o.push(t),o}function M$(e,t){let n=Un(e),o=Un(t),r=pl(n),i=pl(o);if(r!==i)return o;let s=Gf(n),a=Gf(o),l=0;for(;l<s.length&&l<a.length&&s[l]===a[l];)l+=1;let u=new Array(Math.max(s.length-l,0)).fill(".."),c=a.slice(l),d=[...u,...c].join("/");return d.length>0?d:"."}var bU=/\[\[([^\]|#]*)(?:#([^\]|]+))?(?:\|([^\]]+))?\]\]/g,yU=/^(`{3,}|~{3,})/;function Xf(e){return encodeURI(hl(e))}function bv(e){try{return decodeURIComponent(e)}catch{return e}}function D$(e){let t=e.match(/^\[\[([^\]|#]*)(?:#([^\]|]+))?(?:\|([^\]]+))?\]\]$/);return t?{path:(t[1]??"").trim(),anchor:t[2]?.trim(),alias:t[3]?.trim()}:null}function vU(e){return e.alias&&e.alias.length>0?e.alias:e.path&&e.anchor?`${e.path}#${e.anchor}`:e.path?e.path:e.anchor??""}function xU(e){return/\.[A-Za-z0-9_-]+$/.test(e)?e:`${e}.md`}function N$(e){if(!e.path)return e.anchor?`#${zo(e.anchor)}`:"#";let t=xU(hl(e.path)),n=t.startsWith("./")||t.startsWith("../")||t.startsWith("/")||cs(t)?t:`./${t}`,o=Xf(n);return e.anchor?`${o}#${zo(e.anchor)}`:o}function $$(e){return e.replace(bU,t=>{let n=D$(t);if(!n)return t;let o=vU(n),r=N$(n);return`[${o}](${r} "mcp-wiki:${encodeURIComponent(t)}")`})}function kU(e){let t="",n=0;for(;n<e.length;){let o=e.indexOf("`",n);if(o===-1){t+=$$(e.slice(n));break}t+=$$(e.slice(n,o));let r=o;for(;r<e.length&&e[r]==="`";)r+=1;let i=e.slice(o,r),s=e.indexOf(i,r);if(s===-1){t+=e.slice(o);break}t+=e.slice(o,s+i.length),n=s+i.length}return t}function Qf(e){if(!(!e||e.length===0))return bv(e)}function wU(e){let t=e.indexOf("#");return t===-1?{pathPart:e}:{pathPart:e.slice(0,t),anchorPart:e.slice(t+1)}}function SU(e){let t=Un(e),n=t.endsWith("/")?t:`${t}/`;return cs(n)?new URL(`file:///${Xf(n)}`):n.startsWith("/")?new URL(`file://${Xf(n)}`):new URL(`file:///${Xf(n)}`)}function _U(e){let t=bv(e.pathname);return/^\/[A-Za-z]:\//.test(t)?t.slice(1):t}function EU(e){return/^[A-Za-z][A-Za-z0-9+.-]*:/.test(e)&&!cs(e)}function I$(e,t){let n=hl(bv(t));if(n.startsWith("/")||cs(n))return Un(n);let o=Ro(e);if(o==="."&&!Un(e).includes("/"))return Un(n);let r=new URL(encodeURI(n),SU(o));return Un(_U(r))}function z$(e){return e.replace(/\[([^\]]*)\]\(([^)\s]*)(?:\s+"mcp-wiki:([^"]+)")\)/g,(t,n,o,r)=>{try{return decodeURIComponent(r)}catch{return`[[${r}]]`}})}function ml(e){let t=e.split(`
`),n=null;return t.map(o=>{let i=o.trimStart().match(yU);if(i){let s=i[1];return n?s[0]===n[0]&&s.length>=n.length&&(n=null):n=s,o}return n?o:kU(o)}).join(`
`)}function O$(e,t){let n=D$(t);if(n){let i=N$(n);if(i.startsWith("#"))return{kind:"anchor",href:t,anchor:Qf(i.slice(1))};let[s,a]=i.split("#");return{kind:"file",href:t,targetPath:I$(e,s),...a?{anchor:Qf(a)}:{}}}if(EU(t))return{kind:"external",href:t,url:t};if(t.startsWith("#"))return{kind:"anchor",href:t,anchor:Qf(t.slice(1))};let{pathPart:o,anchorPart:r}=wU(t);return{kind:"file",href:t,targetPath:I$(e,o),...r?{anchor:Qf(r)}:{}}}var CU=/^(---\r?\n[\s\S]*?\r?\n---\r?\n)/,TU=/\[([^\]]+)\]\(([^)\s]+)(?:\s+"[^"]*")?\)/g,AU=/\*\*([^*\n]*?`[^`\n]+`[^*\n]*?)\*\*/g,U$="TIPTAPPIPEESCX";function MU(e,t){if(/^`[^`]+`$/.test(e))return!0;let n=/^[a-z][a-z0-9+.-]*:/i.test(t),o=t.startsWith("./")||t.startsWith("../")||t.startsWith("/")||t.startsWith("#");return!!(!n&&!o&&t.includes("/"))}function $U(e){let t=e.includes(`\r
`)?`\r
`:`
`,n=t===`\r
`?e.replace(/\r\n/g,`
`):e,o=n.match(CU),r=o?o[0]:"",i=r?n.slice(r.length):n,s=i.match(/^\n*/)?.[0]??"";i=i.slice(s.length);let a=i.endsWith(`
`)?`
`:"",l=[],u=i,c=0;u=u.replace(TU,(m,g,b)=>{if(!MU(g,b))return m;let y=`TIPTAPCODELINK${String(c).padStart(4,"0")}`;return l.push({placeholder:y,original:m}),c+=1,y});let d=[],f=0;u=u.replace(AU,m=>{let g=`TIPTAPBOLDCODE${String(f).padStart(4,"0")}`;return d.push({placeholder:g,original:m}),f+=1,g});let h=0;return u=u.replace(/\\\|/g,()=>(h+=1,U$)),{editorInput:ml(u),context:{originalInput:e,frontmatter:r,frontmatterGap:s,trailingNewline:a,eol:t,codeLinks:l,boldCodeRuns:d,pipeEscapeCount:h}}}function IU(e,t){let n=z$(e);for(let{placeholder:o,original:r}of t.codeLinks)n=n.split(o).join(r);for(let{placeholder:o,original:r}of t.boldCodeRuns)n=n.split(o).join(r);return t.pipeEscapeCount>0&&(n=n.split(U$).join("\\|")),n=OU(n,t.originalInput),n=RU(n,t.originalInput),n=PU(n,t.originalInput),n=DU(n,t.originalInput),n=NU(n,t.originalInput),n=n.replace(/^\n+/,""),n=zU(n,t.originalInput),n=LU(n,t.originalInput),n=n.replace(/\n+$/,"")+t.trailingNewline,t.frontmatter&&(n=t.frontmatter+t.frontmatterGap+n),t.eol===`\r
`&&(n=n.replace(/\n/g,`\r
`)),n}function DU(e,t){let n=/^\|[\s:\-|]+\|$/,o=t.replace(/\r\n/g,`
`).split(`
`).filter(s=>n.test(s));if(o.length===0)return e;let r=e.split(`
`),i=0;for(let s=0;s<r.length;s+=1)if(n.test(r[s])&&i<o.length){let a=o[i].split("|").length,l=r[s].split("|").length;a===l&&(r[s]=o[i]),i+=1}return r.join(`
`)}function NU(e,t){let n=/^(\s*)([*\-+])(\s)/,o=t.replace(/\r\n/g,`
`).split(`
`),r=[];for(let a of o){let l=a.match(n);l&&r.push(l[2])}if(r.length===0)return e;let i=e.split(`
`),s=0;for(let a=0;a<i.length;a+=1){let l=i[a].match(n);if(!l)continue;let u=r[s];u&&u!==l[2]&&(i[a]=l[1]+u+l[3]+i[a].slice(l[0].length)),s+=1}return i.join(`
`)}function zU(e,t){let n=t.replace(/\r\n/g,`
`).split(`
`),o=e;for(let r=0;r<n.length-1;r+=1){let i=n[r],s=n[r+1];if(!i||!s)continue;let a=/^\s*([-*+]|\d+\.)\s/.test(i),l=/^ +\S/.test(s)&&!/^\s*([-*+]|\d+\.)\s/.test(s),u=a&&l;if(!u&&(R$(i)||R$(s)))continue;let c=`${i}
${s}`;if(o.indexOf(c)!==-1)continue;let d=[{joiner:" ",b:s},{joiner:"",b:s}];if(u){let f=s.replace(/^\s+/,"");d.push({joiner:" ",b:f})}for(let{joiner:f,b:h}of d){let p=`${i}${f}${h}`,m=o.indexOf(p);if(m!==-1){o=o.slice(0,m)+c+o.slice(m+p.length);break}}}return o}function R$(e){return/^\s*(#{1,6}\s|[-*+]\s|\d+\.\s|>\s|```|\|.*\|\s*$|---|\s*$)/.test(e)}function OU(e,t){let n=t.replace(/\r\n/g,`
`).split(`
`),o=!1,r=e.split(`
`);for(let i=0;i<r.length;i+=1){let s=r[i];if(/^\s*```/.test(s)){o=!o;continue}if(o||!/\\[\[\]~]/.test(s))continue;let a=P$(s);if(n.some(u=>P$(u)===a)){if(n.find(c=>c===s)!==void 0)continue;r[i]=a}}return r.join(`
`)}function P$(e){return e.replace(/\\([\[\]~])/g,"$1")}function RU(e,t){let n=t.replace(/\r\n/g,`
`).split(`
`),o=!1,r=e.split(`
`);for(let i=0;i<r.length;i+=1){let s=r[i];if(/^\s*```/.test(s)){o=!o;continue}if(o||!/&(?:lt|gt|amp);/.test(s))continue;let a=L$(s);!n.some(c=>L$(c)===a)||n.find(c=>c===s)!==void 0||(r[i]=a)}return r.join(`
`)}function L$(e){return e.replace(/</g,"<").replace(/>/g,">").replace(/&/g,"&")}function PU(e,t){let n=t.replace(/\r\n/g,`
`).split(`
`),o=[];for(let i of n)/[^ ] $/.test(i)&&o.push(i.slice(0,-2));if(o.length===0)return e;let r=e;for(let i of o){let s=`${i}\\
`;if(r.includes(s)){r=r.replace(s,`${i}
`);continue}let a=`${i}
`,l=r.indexOf(a);l!==-1&&(r=r.slice(0,l)+`${i}
`+r.slice(l+a.length))}return r}function LU(e,t){let n=t.replace(/\r\n/g,`
`).split(`
`),o=new Set;for(let s=0;s<n.length-1;s+=1){let a=n[s],l=n[s+1];a&&l&&o.add(`${a}${l}`)}let r=e.split(`
`),i=[];for(let s=0;s<r.length;s+=1){let a=r[s];if(a===""&&s>0&&s<r.length-1){let l=r[s-1],u=r[s+1];if(l&&u&&o.has(`${l}${u}`))continue}i.push(a)}return i.join(`
`)}function FU(){return[xA.configure({heading:{levels:[1,2,3,4,5,6]},codeBlock:{HTMLAttributes:{class:"code-viewer"}},link:{openOnClick:!1,autolink:!0,HTMLAttributes:{"data-markdown-link":"true"}},strike:!1}),kA.configure({allowBase64:!0,inline:!0}),o1.configure({resizable:!1,HTMLAttributes:{class:"markdown-table"}}),ol,rl,nl,T$.configure({html:!0,tightLists:!0,bulletListMarker:"-",linkify:!1,breaks:!1,transformPastedText:!0,transformCopiedText:!1})]}function F$(e,t){if(e===t)return[];let n=e.split(`
`),o=t.split(`
`),r=n.length,i=o.length,s=[];if(r*i>1e6)return vv(n,o,0,r,0,i);let a=Array.from({length:r+1},()=>Array(i+1).fill(0));for(let h=1;h<=r;h+=1)for(let p=1;p<=i;p+=1)a[h][p]=n[h-1]===o[p-1]?a[h-1][p-1]+1:Math.max(a[h-1][p],a[h][p-1]);let l=[],u=r,c=i;for(;u>0&&c>0;)n[u-1]===o[c-1]?(l.unshift([u-1,c-1]),u-=1,c-=1):a[u-1][c]>=a[u][c-1]?u-=1:c-=1;let d=0,f=0;for(let[h,p]of l)(h>d||p>f)&&s.push({fromLine:Math.max(1,f-3),toLine:Math.max(f+1,p+3)}),d=h+1,f=p+1;return(d<r||f<i)&&s.push({fromLine:Math.max(1,f-3),toLine:Math.max(f+1,i+3)}),s}function vv(e,t,n,o,r,i){for(;n<o&&r<i&&e[n]===t[r];)n++,r++;for(;n<o&&r<i&&e[o-1]===t[i-1];)o--,i--;if(n===o&&r===i)return[];let s=new Map,a=new Map;for(let l=n;l<o;l+=1){let u=s.get(e[l]);s.set(e[l],{count:(u?.count??0)+1,index:l})}for(let l=r;l<i;l+=1){let u=a.get(t[l]);a.set(t[l],{count:(u?.count??0)+1,index:l})}for(let l=n;l<o;l+=1){let u=s.get(e[l]),c=a.get(e[l]);if(u?.count===1&&c?.count===1)return[...vv(e,t,n,l,r,c.index),...vv(e,t,l+1,o,c.index+1,i)]}return[{fromLine:Math.max(1,r-3),toLine:Math.max(r+1,i+3)}]}function j$(e,t){let n=t.relatedTarget,o=e?.closest(".tool-shell");return!!(n&&(e?.contains(n)||o?.contains(n)))}function jU(){return`
<button class="markdown-format-button" type="button" data-format="bold"><strong>B</strong></button>
<button class="markdown-format-button" type="button" data-format="italic"><em>I</em></button>
<button class="markdown-format-button" type="button" data-format="strike"><span style="text-decoration:line-through">S</span></button>
<span class="markdown-format-sep" aria-hidden="true"></span>
<label class="markdown-format-size" title="Block style" aria-label="Block style">
<select id="markdown-block-style">
<option value="p" selected>Normal</option>
<option value="h1">H1</option>
<option value="h2">H2</option>
<option value="h3">H3</option>
</select>
</label>
<span class="markdown-format-sep" aria-hidden="true"></span>
<button class="markdown-format-button" type="button" data-format="quote" title="Quote" aria-label="Quote">❝</button>
<button class="markdown-format-button" type="button" data-format="list" title="List" aria-label="List">•</button>
<button class="markdown-format-button" type="button" data-format="link" title="Link" aria-label="Link">🔗</button>
<button class="markdown-format-button" type="button" data-format="code" title="Code" aria-label="Code">‹›</button>
`}function B$(e){return e==="raw"?'<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="16 18 22 12 16 6"></polyline><polyline points="8 6 2 12 8 18"></polyline></svg>':'<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M4 7h16"></path><path d="M4 12h10"></path><path d="M4 17h7"></path></svg>'}function BU(e,t){return e.filter(o=>o.text===t.text).length<=1?t.text:`${t.text} (#${t.id})`}function H$(){return'<button class="markdown-editor-copy-button" type="button" id="copy-active-markdown" title="Copy" aria-label="Copy"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="9" y="9" width="13" height="13" rx="2" ry="2"/><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"/></svg><span>Copy</span></button>'}function q$(e){return`
<div class="markdown-editor-mode-toggle" role="tablist" aria-label="Editor mode">
<div class="markdown-editor-mode-toggle-indicator markdown-editor-mode-toggle-indicator--${e}" aria-hidden="true"></div>
<button class="markdown-editor-mode-option${e==="raw"?" is-active":""}" type="button" id="markdown-mode-raw" role="tab" aria-selected="${e==="raw"?"true":"false"}" title="Raw" aria-label="Raw">${B$("raw")}<span>Raw</span></button>
<button class="markdown-editor-mode-option${e==="markdown"?" is-active":""}" type="button" id="markdown-mode-markdown" role="tab" aria-selected="${e==="markdown"?"true":"false"}" title="Preview" aria-label="Preview">${B$("markdown")}<span>Preview</span></button>
</div>
`}function Z$(e){let t=e.view==="markdown";return`
<div class="markdown-editor-shell markdown-editor-shell--${e.view}">
<section class="markdown-editor-pane markdown-editor-pane--${e.view}" aria-label="Markdown editor">
${t?`<div id="markdown-editor-context-menu" class="markdown-editor-context-menu" hidden>${jU()}</div><div id="markdown-link-modal" class="markdown-link-modal" hidden><div class="markdown-link-modal-card"><div class="markdown-link-mode-tabs"><button type="button" id="markdown-link-mode-file" class="markdown-link-mode-tab is-active">File</button><button type="button" id="markdown-link-mode-url" class="markdown-link-mode-tab">URL</button></div><div id="markdown-link-file-fields"><label class="markdown-link-modal-label" for="markdown-link-search">Find note</label><input id="markdown-link-search" class="markdown-link-modal-input" type="text" placeholder="Search files..." /><div id="markdown-link-results" class="markdown-link-results"></div><label class="markdown-link-modal-label" for="markdown-link-heading">Heading</label><select id="markdown-link-heading" class="markdown-link-modal-input markdown-link-modal-select"><option value="">None</option></select><label class="markdown-link-modal-label" for="markdown-link-alias">Alias</label><input id="markdown-link-alias" class="markdown-link-modal-input" type="text" placeholder="Optional label" /></div><div id="markdown-link-url-fields" hidden><label class="markdown-link-modal-label" for="markdown-link-input">URL</label><input id="markdown-link-input" class="markdown-link-modal-input" type="url" placeholder="https://example.com" /><label class="markdown-link-modal-label" for="markdown-link-label">Label</label><input id="markdown-link-label" class="markdown-link-modal-input" type="text" placeholder="Optional label" /></div><div class="markdown-link-modal-actions"><button type="button" id="markdown-link-cancel" class="markdown-link-modal-button">Cancel</button><button type="button" id="markdown-link-apply" class="markdown-link-modal-button markdown-link-modal-button--primary">Insert</button></div></div></div>`:""}
<div id="markdown-editor-root" class="markdown-editor-root"></div>
</section>
</div>
`}function UU(e){let t=e.selectionStart,n=e.selectionEnd,o=`${e.value.slice(0,t)} ${e.value.slice(n)}`;e.value=o,e.selectionStart=t+1,e.selectionEnd=t+1}function yv(e){let t=Oo(),n=Array.from(e.querySelectorAll("h1, h2, h3, h4, h5, h6"));for(let o of n){let r=o.textContent?.trim()??"";if(!r){o.hasAttribute("id")&&o.removeAttribute("id"),o.hasAttribute("data-heading-id")&&o.removeAttribute("data-heading-id");continue}let i=t(r);o.id!==i&&(o.id=i),o.getAttribute("data-heading-id")!==i&&o.setAttribute("data-heading-id",i)}}function V$(e){let t=e.target.closest(".markdown-editor-shell"),n=t?.querySelector("#markdown-editor-context-menu"),o=t?Array.from(t.querySelectorAll("[data-format]")):[],r=t?.querySelector("#markdown-block-style"),i=t?.querySelector("#markdown-link-modal"),s=t?.querySelector("#markdown-link-mode-file"),a=t?.querySelector("#markdown-link-mode-url"),l=t?.querySelector("#markdown-link-file-fields"),u=t?.querySelector("#markdown-link-url-fields"),c=t?.querySelector("#markdown-link-search"),d=t?.querySelector("#markdown-link-results"),f=t?.querySelector("#markdown-link-heading"),h=t?.querySelector("#markdown-link-alias"),p=t?.querySelector("#markdown-link-input"),m=t?.querySelector("#markdown-link-label"),g=t?.querySelector("#markdown-link-apply"),b=t?.querySelector("#markdown-link-cancel"),y="file",k=[],x=null,E="Search for a file to link",I=0,N=0;if(e.view==="markdown"){e.target.replaceChildren();let oe=!1,A=()=>{oe=!0},{editorInput:H,context:q}=$U(e.value),te=()=>{let z=w.storage.markdown?.getMarkdown()??"";return IU(z,q)},se="",w=new sT({element:e.target,extensions:FU(),content:H,editorProps:{attributes:{class:"markdown-editor-surface markdown-editor-surface--markdown markdown markdown-doc",role:"textbox","aria-multiline":"true"}},onUpdate:({editor:C})=>{if(yv(C.view.dom),!oe)return;let z=te(),U=F$(se,z);se=z,e.onChange(z,U)},onSelectionUpdate:()=>{O()},onBlur:({event:C})=>{j$(t,C)||(n&&(n.hidden=!0),e.onBlur?.())}});se=te();let _=w.view.dom;yv(_);let O=()=>{if(!n)return;let{from:C,to:z,empty:U}=w.state.selection;if(U||!w.isFocused){n.hidden=!0;return}let le=w.view.coordsAtPos(C),Se=w.view.coordsAtPos(z),nt=t;if(!nt)return;let _n=nt.getBoundingClientRect(),jr=(le.left+Se.right)/2;n.hidden=!1;let ys=Math.max(12,jr-_n.left-n.offsetWidth/2),ap=Math.max(12,le.top-_n.top-n.offsetHeight-10);n.style.left=`${ys}px`,n.style.top=`${ap}px`},P=(C=[],z="None")=>{if(!f)return;f.replaceChildren();let U=document.createElement("option");U.value="",U.textContent=z,f.appendChild(U);for(let le of C){let Se=document.createElement("option");Se.value=le.id,Se.textContent=BU(C,le),Se.dataset.headingText=le.text,f.appendChild(Se)}},ne=async C=>{if(!f)return;let z=++N;P([],"Loading\u2026");try{let U=await e.loadHeadings?.(C.path)??[];if(z!==N||x?.path!==C.path)return;P(U)}catch{if(z!==N||x?.path!==C.path)return;P([],"Failed to load headings")}},Y=()=>{if(!d)return;if(k.length===0){let z=document.createElement("div");z.className="markdown-link-results-empty",z.textContent=E,d.replaceChildren(z);return}let C=document.createDocumentFragment();for(let z of k){let U=document.createElement("button");U.type="button",U.className=`markdown-link-result${x?.path===z.path?" is-active":""}`,U.dataset.linkPath=z.path;let le=document.createElement("span");le.className="markdown-link-result-title",le.textContent=z.title;let Se=document.createElement("span");Se.className="markdown-link-result-path",Se.textContent=z.relativePath,U.append(le,Se),U.addEventListener("click",()=>{x=z,Y(),ne(z)}),C.appendChild(U)}d.replaceChildren(C)},we=C=>{y=C,s?.classList.toggle("is-active",C==="file"),a?.classList.toggle("is-active",C==="url"),l&&(l.hidden=C!=="file"),u&&(u.hidden=C!=="url")},lt=async()=>{if(!c||!e.searchLinks)return;let C=c.value.trim();if(C.length===0){I+=1,k=[],x=null,E="Search for a file to link",P(),Y();return}let z=++I;try{let U=await e.searchLinks(C);if(z!==I||C!==c.value.trim())return;k=U,x=U[0]??null,E=U.length===0?"No matching files found":"Search for a file to link",Y(),x?ne(x):P()}catch{if(z!==I)return;k=[],x=null,E="Search failed. Try again.",P(),Y()}},ve=()=>{i?.setAttribute("hidden",""),p&&(p.value=""),m&&(m.value=""),h&&(h.value=""),c&&(c.value=""),P(),k=[],x=null,E="Search for a file to link",Y()},Re=()=>{if(!i)return;let C=w.state.doc.textBetween(w.state.selection.from,w.state.selection.to," ").trim();i.removeAttribute("hidden"),we("url"),m&&(m.value=C),p&&(p.value="",p.focus()),k=[],x=null,E="Search for a file to link",P(),Y()},bt=()=>{if(A(),y==="url"){let C=p?.value?.trim();if(!C){ve();return}let z=m?.value?.trim()||C,{from:U,to:le,empty:Se}=w.state.selection;Se?w.chain().focus().insertContent({type:"text",text:z,marks:[{type:"link",attrs:{href:C}}]}).run():w.chain().focus().deleteRange({from:U,to:le}).insertContent({type:"text",text:z,marks:[{type:"link",attrs:{href:C}}]}).run()}else if(x){let C=f?.value?.trim(),z=f?.selectedOptions[0]?.dataset.headingText?.trim(),U=h?.value?.trim(),Se=`[[${x.path===e.currentFilePath?"":x.wikiPath}${C?`#${C}`:""}${U?`|${U}`:""}]]`,nt=`${x.relativePath}${C?`#${C}`:""}`,_n=U||z||x.title,{from:jr,to:ys,empty:ap}=w.state.selection,Ov=w.chain().focus();ap||Ov.deleteRange({from:jr,to:ys}),Ov.insertContent({type:"text",text:_n,marks:[{type:"link",attrs:{href:nt,title:`mcp-wiki:${encodeURIComponent(Se)}`}}]}).run()}ve()},Ct=C=>{let U=C.currentTarget.dataset.format;if(U)switch(A(),U){case"bold":w.chain().focus().toggleBold().run();break;case"italic":w.chain().focus().toggleItalic().run();break;case"strike":w.chain().focus().toggleStrike().run();break;case"quote":w.chain().focus().toggleBlockquote().run();break;case"list":w.chain().focus().toggleBulletList().run();break;case"code":w.chain().focus().toggleCode().run();break;case"link":Re();break}},He=()=>{let C=r?.value;if(!C)return;if(C==="p"){A(),w.chain().focus().setParagraph().run();return}let z=/^h([1-6])$/.exec(C);if(z){A();let U=Number.parseInt(z[1],10);w.chain().focus().toggleHeading({level:U}).run()}},ze=document.createElement("div");ze.className="markdown-link-popover",ze.hidden=!0,_.parentElement?.appendChild(ze);let qe=null,Po=C=>{qe&&(clearTimeout(qe),qe=null);let z=C.getAttribute("href")??"";ze.innerHTML='<button class="markdown-link-popover-btn" id="link-popover-edit" type="button" title="Edit link"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"/><path d="M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"/></svg></button><button class="markdown-link-popover-btn" id="link-popover-open" type="button" title="Open link"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"/><polyline points="15 3 21 3 21 9"/><line x1="10" y1="14" x2="21" y2="3"/></svg></button>',ze.hidden=!1,ze.querySelector("#link-popover-open")?.addEventListener("click",nt=>{nt.preventDefault(),nt.stopPropagation(),ze.hidden=!0,C.dispatchEvent(new MouseEvent("click",{bubbles:!0,cancelable:!0}))},{once:!0}),ze.querySelector("#link-popover-edit")?.addEventListener("click",nt=>{if(nt.preventDefault(),nt.stopPropagation(),ze.hidden=!0,!i)return;let _n=w.view.posAtDOM(C,0);if(_n>=0){let ys=_n+(C.textContent?.length??0);w.chain().focus().setTextSelection({from:_n,to:ys}).run()}let jr=C.textContent?.trim()??"";i.removeAttribute("hidden"),we("url"),p&&(p.value=z),m&&(m.value=jr)},{once:!0});let U=C.getBoundingClientRect(),le=_.parentElement;if(!le)return;let Se=le.getBoundingClientRect();ze.style.left=`${Math.max(4,U.left-Se.left)}px`,ze.style.top=`${U.bottom-Se.top+4}px`},wn=()=>{qe=setTimeout(()=>{ze.hidden=!0},200)},ae=C=>{let z=C.target?.closest?.("a[href]");z&&_.contains(z)&&Po(z)},bs=C=>{C.target?.closest?.("a[href]")&&wn()},tt=()=>{qe&&(clearTimeout(qe),qe=null)},Ie=()=>{wn()},Fr=()=>we("file"),Sn=()=>{we("url"),p?.focus()},Lo=()=>{lt()},Fo=C=>{C.target===i&&ve()};return _.addEventListener("beforeinput",A),_.addEventListener("paste",A),_.addEventListener("cut",A),_.addEventListener("drop",A),_.addEventListener("mouseover",ae),_.addEventListener("mouseout",bs),ze.addEventListener("mouseenter",tt),ze.addEventListener("mouseleave",Ie),o.forEach(C=>C.addEventListener("click",Ct)),r?.addEventListener("change",He),s?.addEventListener("click",Fr),a?.addEventListener("click",Sn),c?.addEventListener("input",Lo),g?.addEventListener("click",bt),b?.addEventListener("click",ve),i?.addEventListener("click",Fo),typeof e.initialScrollTop=="number"&&(_.scrollTop=e.initialScrollTop),Y(),{destroy:()=>{_.removeEventListener("beforeinput",A),_.removeEventListener("paste",A),_.removeEventListener("cut",A),_.removeEventListener("drop",A),_.removeEventListener("mouseover",ae),_.removeEventListener("mouseout",bs),ze.removeEventListener("mouseenter",tt),ze.removeEventListener("mouseleave",Ie),o.forEach(C=>C.removeEventListener("click",Ct)),r?.removeEventListener("change",He),s?.removeEventListener("click",Fr),a?.removeEventListener("click",Sn),c?.removeEventListener("input",Lo),g?.removeEventListener("click",bt),b?.removeEventListener("click",ve),i?.removeEventListener("click",Fo),ze.remove(),qe&&clearTimeout(qe),w.destroy(),e.target.replaceChildren()},focus:()=>{w.commands.focus()},getValue:()=>te(),setValue:C=>{w.commands.setContent(ml(C),{emitUpdate:!1}),se=te(),yv(_)},revealLine:(C,z)=>{if(z){let U=_.querySelector(`#${CSS.escape(z)}`);if(U){U.scrollIntoView({block:"start",inline:"nearest"}),_.scrollTop=Math.max(_.scrollTop-24,0),U.setAttribute("tabindex","-1"),U.focus({preventScroll:!0});return}}w.commands.focus()},setScrollTop:C=>{_.scrollTop=Math.max(0,C)}}}let D=document.createElement("textarea");D.className="markdown-editor-textarea markdown-editor-textarea--raw",D.spellcheck=!1,D.setAttribute("autocomplete","off"),D.setAttribute("autocorrect","off"),D.setAttribute("autocapitalize","off"),D.placeholder="Edit raw markdown...",D.value=e.value;let W=D.value;e.target.replaceChildren(D);let re=()=>{D.style.height="auto",D.style.height=`${Math.max(D.scrollHeight,640)}px`},Oe=()=>{let oe=D.value,A=F$(W,oe);W=oe,e.onChange(oe,A)},We=()=>{re(),Oe()},Ge=oe=>{j$(t,oe)||e.onBlur?.()},xe=oe=>{oe.key==="Tab"&&(oe.preventDefault(),UU(D),re(),Oe())};return D.addEventListener("input",We),D.addEventListener("keydown",xe),D.addEventListener("focusout",Ge),re(),typeof e.initialScrollTop=="number"&&(D.scrollTop=e.initialScrollTop),{destroy:()=>{D.removeEventListener("input",We),D.removeEventListener("keydown",xe),D.removeEventListener("focusout",Ge),e.target.replaceChildren()},focus:()=>{D.focus()},getValue:()=>D.value,setValue:oe=>{D.value=oe,W=oe,re()},revealLine:oe=>{let A=Math.max(1,Math.floor(oe)),H=D.value.split(`
`),q=0;for(let se=1;se<A&&se<=H.length;se+=1)q+=H[se-1].length+1;D.focus(),D.setSelectionRange(q,q);let te=Number.parseFloat(window.getComputedStyle(D).lineHeight||"20")||20;D.scrollTop=Math.max(0,(A-1)*te-te*2)},setScrollTop:oe=>{D.scrollTop=Math.max(0,oe)}}}function W$(){return'<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="9" y="9" width="13" height="13" rx="2" ry="2"/><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"/></svg>'}function HU(){return'<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"/></svg>'}function qU(){return'<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M9 14 4 9l5-5"/><path d="M4 9h11a5 5 0 1 1 0 10h-1"/></svg>'}function ZU(){return'<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="15 3 21 3 21 9"/><polyline points="9 21 3 21 3 15"/><line x1="21" y1="3" x2="14" y2="10"/><line x1="3" y1="21" x2="10" y2="14"/></svg>'}function VU(e){return e.fileDeleted?'<span class="panel-save-status panel-save-status--saved">File deleted</span>':e.saveIndicator!=="saved"?"":`<span class="panel-save-status panel-save-status--${e.saving?"saving":"saved"}">Saved</span>`}function K$(e){let t=Ut(e.payload.content),n=e.body.notice?`<div class="notice">${e.body.notice}</div>`:"",o=d_(e.payload.filePath),r=t?t.toLine-t.fromLine+1:Ag(e.payload.content),i=e.payload.fileType==="markdown"?"MARKDOWN":e.payload.fileType==="html"?"HTML":e.payload.fileType==="image"?"IMAGE":e.payload.fileType==="directory"?"DIRECTORY":e.fileExtension!=="none"?e.fileExtension.toUpperCase():"TEXT",s=t?.isPartial?`View lines ${t.fromLine}\u2013${t.toLine}`:e.payload.fileType==="directory"?"View directory":"View file",a=t?.isPartial?`${i} \u2022 LINES ${t.fromLine}\u2013${t.toLine} OF ${t.totalLines}`:`${i} \u2022 ${r} LINE${r!==1?"S":""}`;if(e.markdownWorkspace){let I=Ve(e.markdownWorkspace.draftContent),N=I.trim().split(/\s+/).filter(Boolean).length,D=Ag(I);a=`${i} \u2022 EDIT MODE \u2022 ${D} LINES \u2022 ${N} WORDS`}let l=e.currentDisplayMode==="fullscreen",u=e.payload.fileType==="html"?`<button class="panel-action" id="toggle-html-mode">${e.htmlMode==="rendered"?"Source":"Rendered"}</button>`:"",c=e.hasDirectoryBackButton&&e.payload.fileType!=="directory"?'<button class="panel-action dir-back-btn" id="dir-back" title="Back to directory">\u2190 Back</button>':"",d=e.payload.fileType==="markdown",f=d&&!!e.markdownWorkspace,h=f&&(e.markdownWorkspace.fileDeleted||e.markdownWorkspace.loadingDocument||!e.isMarkdownUndoAvailable),p=f&&e.markdownWorkspace.fileDeleted,m=t?.isPartial&&t.fromLine>1,g=t?.isPartial&&t.toLine<t.totalLines&&t.totalLines-t.toLine>1,b=m?`<button class="load-lines-banner" id="load-before">\u2191 Load lines 1\u2013${t.fromLine-1}</button>`:"",y=g?`<button class="load-lines-banner" id="load-after">\u2193 Load lines ${t.toLine+1}\u2013${t.totalLines}</button>`:"",k=e.isExpanded||l,x=e.capabilities.canOpenInFolder,E=e.capabilities.canCopy;return{effectiveExpanded:k,html:`
<main id="tool-shell" class="shell tool-shell ${k?"expanded":"collapsed"}${e.hideSummaryRow?" host-framed":""}${l?" fullscreen":""}">
${l?"":pa({id:"compact-toggle",label:s,filename:e.payload.fileName,variant:"ready",expandable:!0,expanded:e.isExpanded,interactive:!0})}
<section class="panel">
<div class="panel-topbar">
${c}
${e.hideSummaryRow?"":`<span class="panel-breadcrumb" title="${rn(e.payload.filePath)}">${o}</span>`}
<span class="panel-topbar-actions">
${f?VU(e.markdownWorkspace):""}
${u}
${f&&l?q$(e.markdownWorkspace.editorView):""}
${d&&!l&&e.canGoFullscreen?`<button class="panel-action" id="expand-fullscreen" title="Expand" aria-label="Expand">${ZU()}</button>`:""}
${f?`<button class="panel-action" id="revert-markdown" ${l?"":'title="Undo" aria-label="Undo" '}${h?"disabled":""}>${qU()}${l?" Undo":""}</button>`:""}
${f&&l?H$():""}
${d&&!l?`<button class="panel-action" id="copy-active-markdown" title="Copy" aria-label="Copy">${W$()}</button>`:""}
${E&&e.capabilities.supportsPreview&&!d?`<button class="panel-action" id="copy-source" title="Copy source" aria-label="Copy source">${W$()}</button>`:""}
${x&&f&&l?`<button class="panel-action" id="open-in-editor" ${p?"disabled":""}>${e.markdownEditorAppIcon} Open in ${rn(e.defaultMarkdownEditorName??"editor")}</button>`:""}
${x&&!(f&&l)?`<button class="panel-action" id="open-in-folder" title="Open in folder" aria-label="Open in folder" ${f&&p?"disabled":""}>${HU()}</button>`:""}
</span>
</div>
${n}
<div class="panel-content-wrapper">
${b}
${e.body.html}
${y}
</div>
<div class="panel-footer">
<span>${a}</span>
</div>
</section>
</main>
`}}var WU={js:"javascript",cjs:"javascript",mjs:"javascript",ts:"typescript",jsx:"javascript",tsx:"typescript",json:"json",yaml:"yaml",yml:"yaml",toml:"toml",ini:"ini",xml:"xml",html:"html",htm:"html",css:"css",scss:"css",less:"css",sh:"bash",bash:"bash",zsh:"bash",py:"python",rb:"ruby",java:"java",go:"go",rs:"rust",sql:"sql",md:"markdown",markdown:"markdown"};function KU(e){let t=e.toLowerCase().match(/\.([a-z0-9]+)$/);return t?t[1]:""}function xv(e){let t=KU(e);return WU[t]??"text"}function J$(e,t){if(xv(t)!=="json")return{content:e};try{return{content:`${JSON.stringify(JSON.parse(e),null,2)}
`}}catch{return{content:e,notice:"Invalid JSON. Showing raw source."}}}function gl(e,t="text",n=1){let i=Nc(e,t||"text").split(`
`);return i.length>0&&i[i.length-1]===""&&i.pop(),`<pre class="code-viewer"><table class="code-table"><tbody>${i.map((a,l)=>{let u=n+l;return`<tr class="code-line" data-line="${u}"><td class="line-num" data-line="${u}">${u}</td><td class="line-content">${a||" "}</td></tr>`}).join(`
`)}</tbody></table></pre>`}function JU(){if(typeof window>"u"||typeof document>"u")return{background:"Canvas",text:"CanvasText",fontFamily:"system-ui, sans-serif"};let e=window.getComputedStyle(document.documentElement),t=e.getPropertyValue("--panel").trim()||"Canvas",n=e.getPropertyValue("--text").trim()||"CanvasText",o=e.getPropertyValue("--font-sans").trim()||"system-ui, sans-serif";return{background:t,text:n,fontFamily:o}}function GU(e){let t=JU(),n=`<!doctype html><html><head><meta charset="utf-8" /><style>html,body{margin:0;padding:0;background:${t.background};color:${t.text};}body{font-family:${t.fontFamily};padding:16px;line-height:1.5;}img{max-width:100%;height:auto;}</style></head><body>${e}</body></html>`;return`<iframe class="html-rendered-frame" title="Rendered HTML preview" sandbox="allow-scripts allow-forms allow-popups" referrerpolicy="no-referrer" srcdoc="${wt(n)}"></iframe>`}function G$(e,t){if(t==="source")return{html:`<div class="panel-content source-content">${gl(e,"html")}</div>`};try{return{html:`<div class="panel-content html-content">${GU(e)}</div>`}}catch{return{html:`<div class="panel-content source-content">${gl(e,"html")}</div>`,notice:"HTML renderer failed. Showing source instead."}}}var QU=new Set(["image/png","image/jpeg","image/gif","image/webp","image/bmp","image/svg","image/svg+xml"]);function kv(e){return e?e.toLowerCase().split(";",1)[0].trim():""}function Q$(e){let t=kv(e);return t.length>0&&QU.has(t)}function X$(e){return`<pre class="code-viewer"><code class="hljs language-text">${wt(e)}</code></pre>`}function XU(e){let t=kv(e.mimeType);if(!Q$(t))return{notice:"Preview is unavailable for this image format.",html:'<div class="panel-content source-content"></div>'};if(!e.content||e.content.trim().length===0)return{notice:"Preview is unavailable because image data is missing.",html:'<div class="panel-content source-content"></div>'};let n=`data:${t};base64,${e.content}`;return{html:`<div class="panel-content image-content"><div class="image-preview"><img src="${wt(n)}" alt="${wt(e.fileName)}" loading="eager" decoding="async"></div></div>`}}function bl(e,t){return{supportsPreview:!0,canCopy:t,canOpenInFolder:!kr(e.filePath)}}var wv={directory:{getCapabilities:e=>bl(e,!1),renderBody:({payload:e})=>p_(Ve(e.content),e.filePath)},html:{getCapabilities:e=>bl(e,!0),renderBody:({payload:e,htmlMode:t})=>G$(Ve(e.content),t)},image:{getCapabilities:e=>bl(e,!1),renderBody:({payload:e})=>XU(e)},markdown:{getCapabilities:e=>bl(e,!1),renderBody:({payload:e,markdownController:t})=>{try{return t.buildBody(e)}catch{return{notice:"Markdown renderer failed. Showing raw source instead.",html:`<div class="panel-content source-content">${X$(Ve(e.content))}</div>`}}}},text:{getCapabilities:e=>bl(e,!0),renderBody:({payload:e,startLine:t})=>{let n=Ve(e.content),o=xv(e.filePath),r=J$(n,e.filePath);return{notice:r.notice,html:`<div class="panel-content source-content">${gl(r.content,o,t)}</div>`}}},unsupported:{getCapabilities:e=>{let t=Ve(e.content).trim().length>0;return{supportsPreview:t,canCopy:t,canOpenInFolder:!kr(e.filePath)}},renderBody:({payload:e})=>{let t=Ve(e.content);return t.trim().length===0?{notice:"Preview is not available for this file type.",html:'<div class="panel-content source-content"></div>'}:{html:`<div class="panel-content source-content">${X$(t)}</div>`}}}};function Y$(e){return wv[e.fileType]?.getCapabilities(e)??{supportsPreview:!1,canCopy:!1,canOpenInFolder:!kr(e.filePath)}}function eI(e){return(wv[e.payload.fileType]??wv.text).renderBody(e)}function ds(e){return`'${e.replace(/'/g,"'\\''")}'`}function tI(e){let t=[];for(let o=0;o<e.length;o+=1){let r=e.charCodeAt(o);t.push(r&255,r>>8)}let n="";for(let o of t)n+=String.fromCharCode(o);return btoa(n)}function Sv(e,t){let n=e.trim();if(!n||t(n))return;let o=navigator.userAgent.toLowerCase();if(o.includes("win")){let i=`Start-Process -FilePath explorer.exe -ArgumentList @('/select,','${n.replace(/'/g,"''")}')`;return`powershell.exe -NoProfile -NonInteractive -EncodedCommand ${tI(i)}`}return o.includes("mac")?`open -R ${ds(n)}`:`xdg-open ${ds(Ro(n))}`}function nI(e,t,n){let o=e.trim();if(!o||t(o))return;let r=n.get(o);if(r?.appPath&&navigator.userAgent.toLowerCase().includes("mac"))return`open -a ${ds(r.appPath)} ${ds(o)}`;let i=navigator.userAgent.toLowerCase();if(i.includes("win")){let a=`Start-Process -FilePath '${o.replace(/'/g,"''")}'`;return`powershell.exe -NoProfile -NonInteractive -EncodedCommand ${tI(a)}`}return i.includes("mac")?`open ${ds(o)}`:`xdg-open ${ds(o)}`}function rI(){return'<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M12 20h9"/><path d="M16.5 3.5a2.1 2.1 0 1 1 3 3L7 19l-4 1 1-4Z"/></svg>'}function oI(e){if(e.isMarkdownEditing)return e.previousAbortController&&e.previousAbortController.abort(),null;let t=document.querySelector(".panel-content-wrapper");if(!t)return e.previousAbortController;let n=t;e.previousAbortController?.abort();let o=new AbortController,r=null,i="",s=null;function a(d){if(!r)return;let h=d.getRangeAt(0).getBoundingClientRect(),p=n.getBoundingClientRect(),m=h.left+h.width/2-p.left,g=h.top-p.top+n.scrollTop-32,b=r.offsetWidth||200;m=Math.max(8,Math.min(m-b/2,n.clientWidth-b-8)),g=Math.max(4,g),r.style.left=`${m}px`,r.style.top=`${g}px`}function l(d){s&&(clearTimeout(s),s=null),r||(r=document.createElement("div"),r.className="selection-hint",r.textContent="AI can see your selection",n.appendChild(r)),r.classList.add("visible"),a(d)}function u(){r&&(r.classList.remove("visible"),s=setTimeout(()=>{r?.remove(),r=null},200))}function c(d){let f=d.anchorNode?.parentElement?.closest(".code-line"),h=d.focusNode?.parentElement?.closest(".code-line");if(f&&h){let p=parseInt(f.dataset.line??"",10),m=parseInt(h.dataset.line??"",10);if(!isNaN(p)&&!isNaN(m)){let g=Math.min(p,m),b=Math.max(p,m);return g===b?`line ${g}`:`lines ${g}\u2013${b}`}}return""}return document.addEventListener("selectionchange",()=>{let d=document.getSelection();if(!d||d.isCollapsed){i&&(i="",e.updateContext?.(""),u());return}let f=d.toString().trim();if(!f||f===i)return;let h=n.contains(d.anchorNode),p=n.contains(d.focusNode);if(!h&&!p){i&&(i="",e.updateContext?.(""),u());return}i=f;let m=c(d),g=m?` (${m})`:"",b=`User selected text from file ${e.payload.filePath}${g}:
\`\`\`
${f}
\`\`\``;e.updateContext?.(b),l(d),e.trackUiEvent?.("text_selected",{file_type:e.payload.fileType,file_extension:e.getFileExtensionForAnalytics(e.payload.filePath),char_count:f.length})},{signal:o.signal}),o}function _v(e,t){Array.from(e.querySelectorAll("[data-toc-id]")).forEach(o=>{let r=o.dataset.tocId===t;o.classList.toggle("is-active",r),o.setAttribute("aria-current",r?"location":"false")})}function iI(e,t){return e.map(n=>`<button class="document-outline-link markdown-toc-link${n.id===t?" is-active":""}" type="button" data-toc-id="${rn(n.id)}" data-level="${n.level}" aria-current="${n.id===t?"location":"false"}">${rn(n.text)}</button>`).join("")}function sI(){return'<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="15 18 9 12 15 6"/></svg>'}function YU(){return'<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="9 18 15 12 9 6"/></svg>'}function aI(e,t){return e.length===0?"":`
<aside class="document-outline-shell markdown-toc-shell" aria-label="Table of contents">
<div class="document-outline-header markdown-toc-header">
<span class="document-outline-title markdown-toc-title">Contents</span>
<button class="document-outline-toggle" id="toc-toggle" type="button" title="Collapse sidebar" aria-label="Collapse sidebar">${sI()}</button>
</div>
<nav class="document-outline-nav markdown-toc-nav">${iI(e,t)}</nav>
</aside>
`}function lI(e){let t=e.shell.querySelector(".document-outline-nav");if(!t)return null;let n=e.outline,o=a=>{let c=a.target?.closest("[data-toc-id]")?.dataset.tocId;c&&(e.onSelect(c),_v(t,c))},r=()=>{let a=n.map(c=>{let d=document.getElementById(c.id);return d?{item:c,element:d}:null}).filter(c=>c!==null);if(a.length===0)return;let l=e.scrollContainer.scrollTop,u=a.reduce((c,d)=>d.element.offsetTop-l<=96?d.item.id:c,a[0].item.id);_v(t,u)},i=e.shell.querySelector("#toc-toggle"),s=()=>{let a=e.shell.classList.toggle("markdown-toc-collapsed");i&&(i.innerHTML=a?YU():sI(),i.title=a?"Expand sidebar":"Collapse sidebar",i.setAttribute("aria-label",a?"Expand sidebar":"Collapse sidebar"))};return i?.addEventListener("click",s),t.addEventListener("click",o),e.scrollContainer.addEventListener("scroll",r,{passive:!0}),r(),{dispose:()=>{t.removeEventListener("click",o),e.scrollContainer.removeEventListener("scroll",r),i?.removeEventListener("click",s)},refresh:(a,l)=>{n=a,t.innerHTML=iI(n,l),_v(t,l??null),r()}}}function uI(e){if(!e)return"";let t=Array.isArray(e.children)?e.children:[];return t.length===0?typeof e.content=="string"?e.content:"":t.map(n=>typeof n.content=="string"?n.content:"").join("")}var e7=Pr;function Yf(e={}){return new e7({html:!1,linkify:!0,typographer:!1,...e.highlight?{highlight:e.highlight}:{}})}function ep(e){return ml(e)}function tp(e,t,n){let o=e[t];if(o?.type!=="heading_open"||typeof o.tag!="string")return null;let r=Number.parseInt(o.tag.replace(/^h/i,""),10);if(!Number.isFinite(r))return null;let i=e[t+1],s=uI(i).trim();if(!s)return null;let a=Array.isArray(o.map)?o.map:void 0;return{id:n(s),text:s,level:r,line:typeof a?.[0]=="number"?a[0]+1:t+1}}var t7=Yf();function fs(e){let t=t7.parse(ep(e),{}),n=Oo(),o=[];for(let r=0;r<t.length;r+=1){let i=tp(t,r,n);i&&o.push(i)}return o}var yl=Yf({highlight(e,t){let n=(t||"text").toLowerCase(),o=Nc(e,n);return`<pre class="code-viewer"><code class="hljs language-${n}">${o}</code></pre>`}}),cI=yl.renderer.rules.heading_open;yl.renderer.rules.heading_open=(...e)=>{let t=e[0],n=e[1],o=e[2],r=e[3]??{},i=e[4],s=typeof r.nextSlug=="function"?r.nextSlug:Oo();r.nextSlug=s;let a=tp(t,n,s),l=t[n];return a&&(l.attrSet?.("id",a.id),l.attrSet?.("data-heading-id",a.id)),typeof cI=="function"?cI(...e):i.renderToken(t,n,o)};var dI=yl.renderer.rules.link_open;yl.renderer.rules.link_open=(...e)=>{let t=e[0],n=e[1],o=e[2],r=e[4],i=t[n];i.attrSet?.("data-markdown-link","true");let s=i.attrGet?.("title");if(s?.startsWith("mcp-wiki:")){let a=decodeURIComponent(s.slice(9));i.attrSet?.("data-wiki-link",a),Array.isArray(i.attrs)&&(i.attrs=i.attrs.filter(([l])=>l!=="title"))}return typeof dI=="function"?dI(...e):r.renderToken(t,n,o)};function fI(e){return yl.render(ep(e),{nextSlug:Oo()})}function pI(e){return fI(e).replace(/<\s*br\s*\/?>/gi,`
`).replace(/<\/p>/gi,`
`).replace(/<\/h[1-6]>/gi,`
`).replace(/<\/li>/gi,`
`).replace(/<li>/gi,"- ").replace(/<[^>]+>/g,"").replace(/ /g," ").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/'/g,"'").replace(/"/g,'"').replace(/\n{3,}/g,`
`).trim()}var mI=40;function n7(e,t){return e.length!==t.length?!1:e.every((n,o)=>{let r=t[o];return n.id===r.id&&n.text===r.text&&n.level===r.level&&n.line===r.line})}function r7(e){return e.split(`
`).map(t=>t.trim()).filter(Boolean)}function o7(e){return e.split(`
`).map(t=>t.trim()).filter(t=>t.startsWith("\u{1F4C1} ")).map(t=>t.slice(3).trim())}function hI(e){return e.replace(/\.md$/i,"")}function i7(e,t){let n=e.length,o=t.length,r=Array.from({length:n+1},()=>Array(o+1).fill(0));for(let d=1;d<=n;d+=1)for(let f=1;f<=o;f+=1)r[d][f]=e[d-1]===t[f-1]?r[d-1][f-1]+1:Math.max(r[d-1][f],r[d][f-1]);let i=[],s=n,a=o;for(;s>0&&a>0;)e[s-1]===t[a-1]?(i.unshift([s-1,a-1]),s-=1,a-=1):r[s-1][a]>=r[s][a-1]?s-=1:a-=1;let l=[],u=0,c=0;for(let[d,f]of i)(d>u||f>c)&&l.push({oldStart:u,oldEnd:d,newStart:c,newEnd:f}),u=d+1,c=f+1;return(u<n||c<o)&&l.push({oldStart:u,oldEnd:n,newStart:c,newEnd:o}),l}function s7(e,t){if(e.length<=1)return e;let n=[{...e[0]}];for(let o=1;o<e.length;o+=1){let r=n[n.length-1],i=e[o];if(i.oldStart-r.oldEnd<t){r.oldEnd=i.oldEnd,r.newEnd=i.newEnd;continue}n.push({...i})}return n}function gI(e){let t=e.map(o=>({fromLine:Math.max(1,Math.floor(o.fromLine)),toLine:Math.max(1,Math.floor(o.toLine))})).sort((o,r)=>o.fromLine-r.fromLine||o.toLine-r.toLine),n=[];for(let o of t){let r={fromLine:Math.min(o.fromLine,o.toLine),toLine:Math.max(o.fromLine,o.toLine)},i=n[n.length-1];i&&r.fromLine<=i.toLine+1?i.toLine=Math.max(i.toLine,r.toLine):n.push(r)}return n}function a7(e,t){if(t.length===0)return!0;let n=Math.min(e.oldStart,e.newStart)+1,o=Math.max(e.oldEnd,e.newEnd)+1;return t.some(r=>n<=r.toLine&&o>=r.fromLine)}function l7(e,t){return Ev(e,t,0,e.length,0,t.length)}function Ev(e,t,n,o,r,i){for(;n<o&&r<i&&e[n]===t[r];)n++,r++;for(;n<o&&r<i&&e[o-1]===t[i-1];)o--,i--;if(n===o&&r===i)return[];let s=new Map,a=new Map;for(let l=n;l<o;l+=1){let u=s.get(e[l]);s.set(e[l],{count:(u?.count??0)+1,index:l})}for(let l=r;l<i;l+=1){let u=a.get(t[l]);a.set(t[l],{count:(u?.count??0)+1,index:l})}for(let l=n;l<o;l+=1){let u=s.get(e[l]),c=a.get(e[l]);if(u?.count===1&&c?.count===1)return[...Ev(e,t,n,l,r,c.index),...Ev(e,t,l+1,o,c.index+1,i)]}return[{oldStart:n,oldEnd:o,newStart:r,newEnd:i}]}function bI(e,t){let n=e.split(`
`),o=t.split(`
`),r=Math.ceil(Math.max(n.length,o.length)/mI),i=[];for(let s=0;s<r;s+=1){let a=Math.floor(s*n.length/r),l=Math.floor((s+1)*n.length/r),u=Math.floor(s*o.length/r),c=Math.floor((s+1)*o.length/r),d=n.slice(a,l).join(`
`),f=o.slice(u,c).join(`
`);d!==f&&i.push({old_string:d,new_string:f})}return i}function u7(e){return e.flatMap(t=>Math.max(t.old_string.split(`
`).length,t.new_string.split(`
`).length)>mI?bI(t.old_string,t.new_string):[t])}function c7(e,t,n=[]){if(e===t)return[];let o=e.split(`
`),r=t.split(`
`),i=o.length*r.length>1e6?l7(o,r):i7(o,r);if(i.length===0)return[];let s=3,a=gI(n),u=s7(i,s*2+1).filter(c=>a7(c,a)).map(c=>{let d=Math.max(0,c.oldStart-s),f=Math.min(o.length,c.oldEnd+s),h=o.slice(d,f).join(`
`),p=[...o.slice(d,c.oldStart),...r.slice(c.newStart,c.newEnd),...o.slice(c.oldEnd,f)].join(`
`);return{old_string:h,new_string:p}}).filter(c=>c.old_string!==c.new_string);return u.length===1&&u[0].old_string===e&&u[0].new_string===t?bI(e,t):u7(u)}function d7(e,t){return t.reduce((n,o)=>n.replace(o.old_string,o.new_string),e)}function f7(e){return typeof e=="object"&&e!==null}function p7(e){if(!f7(e)||e.isError!==!0)return!1;let t=Ht(e)?.toLowerCase()??"";return t.includes("not found")||t.includes("no such file")||t.includes("enoent")}function yI(e){let t,n,o,r=null,i=1e3;function s(){r!==null&&clearTimeout(r),r=setTimeout(()=>{r=null,A()},i)}function a(){r!==null&&(clearTimeout(r),r=null)}function l(){a(),n?.destroy(),n=void 0,o?.dispose(),o=void 0}function u(){t=void 0,l()}function c(w){return Ve(w.content)}function d(w,_,O={}){let P=O.keepDraft?w.draftContent:_;w.sourceContent=_,w.fullDocumentContent=_,w.draftContent=P,w.outline=fs(_),w.dirty=P!==_,w.dirtyLineRanges=[],w.fileDeleted=!1,w.outline.some(ne=>ne.id===w.activeHeadingId)||(w.activeHeadingId=w.outline[0]?.id??null)}async function f(w,_,O){let P=await e.callTool?.("read_file",{path:w,...typeof _=="number"?{offset:O??0,length:_}:{},origin:"ui"});return{rawResult:P,payload:Rc(P)??null}}async function h(w,_,O){return(await f(w,_,O)).payload}async function p(w){let _=Ut(w.content);return _?.isPartial?await h(w.filePath,_.totalLines)??w:w}async function m(w){let _=await h(w);return _?p(_):null}function g(w){let _=Ve(w.content);if(!t||t.filePath!==w.filePath||t.sourceContent!==_){let O=fs(_);t={filePath:w.filePath,sourceContent:_,fullDocumentContent:_,draftContent:_,outline:O,mode:"edit",dirty:!1,dirtyLineRanges:[],activeHeadingId:O[0]?.id??null,pendingAnchor:null,notice:null,error:null,saving:!1,loadingDocument:!1,editorView:"markdown",editorScrollTop:0,saveIndicator:"idle",fileDeleted:!1}}return t}function b(w){return w.draftContent!==w.fullDocumentContent}function y(w){let _=g(w),O=_.outline,ne=e.getCurrentDisplayMode()==="fullscreen"?aI(O,_.activeHeadingId):"";return!_.activeHeadingId&&O.length>0&&(_.activeHeadingId=O[0].id),{notice:[_.error,_.notice].find(we=>typeof we=="string"&&we.trim().length>0),html:`
<div class="panel-content markdown-content markdown-content--workspace">
<div class="markdown-workspace markdown-workspace--edit${ne?" markdown-workspace--with-toc":""}">
${ne}
<section class="markdown-workspace-main markdown-workspace-main--editor">
${Z$({view:_.editorView})}
</section>
</div>
</div>
`}}async function k(w){let _=A$(w),O=new Set(["[DIR] .git","[DIR] .obsidian","[FILE] package.json","[FILE] pnpm-workspace.yaml","[FILE] turbo.json"]);for(let P of _)try{let ne=await e.callTool?.("list_directory",{path:P,depth:1,origin:"ui"}),Y=Ht(ne)??"";if(r7(Y).some(lt=>O.has(lt)))return P}catch{}return Ro(w)}async function x(w,_){let O=_.trim();if(O.length===0)return[];let P=await k(w),ne=await e.callTool?.("start_search",{path:P,pattern:O,searchType:"files",filePattern:"*.md",maxResults:20,earlyTermination:!1,literalSearch:!0,origin:"ui"}),Y=Ht(ne)??"",we=o7(Y),lt=Ro(w);return we.map(ve=>{let Re=ve.replace(/\\/g,"/"),bt=Re.split("/").pop()??Re,Ct=hI(bt),He=M$(lt,Re),ze=hI(He.startsWith("./")?He.slice(2):He);return{path:Re,title:Ct,wikiPath:ze,relativePath:He}})}async function E(w,_){if(_===w&&t)return t.outline.map(P=>({id:P.id,text:P.text}));let O=await m(_);return O?fs(c(O)).map(P=>({id:P.id,text:P.text})):[]}function I(w){let _=w.trim();return _?document.getElementById(_)??document.getElementById(zo(_)):null}function N(w){let _=I(w);if(!_)return!1;let O=[],P=_.parentElement;for(;P;){let we=window.getComputedStyle(P).overflowY;(we==="auto"||we==="scroll"||we==="overlay")&&P.scrollHeight>P.clientHeight&&O.push(P),P=P.parentElement}_.scrollIntoView({block:"start",inline:"nearest"});for(let Y of O){let we=Y.getBoundingClientRect(),lt=_.getBoundingClientRect(),ve=Math.max(Y.scrollTop+(lt.top-we.top)-24,0);Y.scrollTop=ve}let ne=document.scrollingElement;if(ne){let Y=_.getBoundingClientRect().top,we=Math.max(ne.scrollTop+Y-24,0);ne.scrollTop=we}return _.setAttribute("tabindex","-1"),_.focus({preventScroll:!0}),t&&(t.activeHeadingId=_.id||zo(w)),!0}function D(){let w=t?.pendingAnchor;!t||!w||(t.pendingAnchor=null,N(w)||(t.error=`Heading not found: ${w}`,e.rerender()))}function W(w,_,O,P){e.updateSaveStatus(w,_),window.setTimeout(()=>{P&&!P()||e.updateSaveStatus("","")},O)}async function re(w){try{let _=Ut(w.content),{rawResult:O,payload:P}=_?.isPartial?await f(w.filePath,_.toLine-_.fromLine+1,_.readOffset):await f(w.filePath);if(!P){p7(O)&&(t&&(t.fileDeleted=!0),e.updateSaveStatus("File deleted","saved"));return}let ne=c(P),Y=c(w);if(ne===Y)return;e.storePayloadOverride(P),t=void 0,e.rerender()}catch{}}async function Oe(w,_={}){let O=g(w),P=Ut(w.content);if(!P?.isPartial){_.keepEditMode&&(O.mode="edit",O.editorView="markdown",O.notice=null,O.error=null,O.draftContent=O.sourceContent,O.dirty=!1,e.rerender());return}O.loadingDocument=!0,O.notice="Loading full document\u2026",O.error=null,e.rerender();try{let ne=await h(w.filePath,P.totalLines);if(!ne){O.error="Failed to load the full document.",O.notice=null,O.loadingDocument=!1,e.rerender();return}e.syncPayload?.(ne);let Y=g(ne);Y.loadingDocument=!1,Y.notice=null,Y.error=null,d(Y,Y.sourceContent),_.keepEditMode&&(Y.mode="edit",Y.editorView="markdown",e.rerender())}catch{O.loadingDocument=!1,O.notice=null,O.error="Failed to load the full document.",e.rerender()}}async function We(w,_){let O=g(w);if(O.dirty&&!window.confirm("Discard unsaved changes and follow this link?"))return;let P=O$(w.filePath,_);if(O.notice=null,O.error=null,P.kind==="external"&&P.url){if(!await e.openExternalLink?.(P.url))try{window.open(P.url,"_blank","noopener")}catch{}return}if(P.kind==="anchor"&&P.anchor){!N(P.anchor)&&t&&(t.error=`Heading not found: ${P.anchor}`,e.rerender());return}if(P.kind==="file"&&P.targetPath){if(await e.openExternalLink?.(P.targetPath))return;let Y=await h(P.targetPath);if(!Y){t&&(t.error=`Unable to open ${P.targetPath}.`,e.rerender());return}e.syncPayload?.(Y);let we=g(Y);we.pendingAnchor=P.anchor??null,we.error=null,we.notice=null,e.rerender()}}async function Ge(w){let _=g(w);if(_.error=null,_.notice=null,u_(w.content)){await Oe(w,{keepEditMode:!0});return}_.mode="edit",_.draftContent=_.fullDocumentContent,_.dirty=!1,_.editorView="markdown",e.setExpanded(!0),e.rerender()}async function xe(){return zc({availableDisplayModes:e.getAvailableDisplayModes()}).canFullscreen?await e.requestDisplayMode?.("fullscreen")==="fullscreen":!1}function oe(){if(!t)return;let w=t.filePath;t.draftContent=t.fullDocumentContent,t.dirty=!1,t.dirtyLineRanges=[],t.error=null,t.notice=null,e.rerender(),W("Reverted","saved",1500),e.trackUiEvent?.("markdown_reverted",{file_extension:Ot(w)})}async function A(){if(!t||t.saving||!t.dirty||t.fileDeleted)return;a();let w=t;w.saving=!0,w.saveIndicator="saving",w.error=null,w.notice=null;try{let _=c7(w.fullDocumentContent,w.draftContent,w.dirtyLineRanges);if(_.length===0){w.saving=!1,w.saveIndicator="idle",w.dirty=!1,w.dirtyLineRanges=[];return}let O=0,P=[],ne=null;for(let ve of _)try{let Re=await e.callTool?.("edit_block",{file_path:w.filePath,old_string:ve.old_string,new_string:ve.new_string,expected_replacements:1,origin:"ui"});c_(Re),O++}catch(Re){P.push(ve),ne=Re}if(P.length>0){let ve=new Error(`${O} of ${_.length} edit${_.length===1?"":"s"} applied; ${P.length} could not land because the text changed on disk.`);throw ve.appliedCount=O,ve.skippedCount=P.length,ve.totalCount=_.length,ve.underlyingError=ne,ve}let Y=d7(w.fullDocumentContent,_);w.fullDocumentContent=Y,w.sourceContent=Y,w.draftContent=Y,w.outline=fs(w.sourceContent),w.dirty=!1,w.dirtyLineRanges=[],w.saving=!1,w.saveIndicator="saved",w.outline.some(ve=>ve.id===w.activeHeadingId)||(w.activeHeadingId=w.outline[0]?.id??null);let we=e.getCurrentPayload();if(we){let Re=we.content.match(/^(\[Reading [^\]]+\]\r?\n(?:\r?\n)?)/)?.[1]??"";e.storePayloadOverride({...we,content:Re+Y})}let lt=document.getElementById("revert-markdown");lt&&(lt.disabled=!b(w)),W("Saved","saved",1800,()=>!w.dirty&&!w.saving?(w.saveIndicator="idle",!0):!1),e.trackUiEvent?.("markdown_saved",{file_extension:Ot(w.filePath),blocks:_.length})}catch(_){w.saving=!1,w.saveIndicator="idle";let O=_,P=typeof O.appliedCount=="number"?O.appliedCount:0,ne=typeof O.skippedCount=="number"?O.skippedCount:0,Y=typeof O.totalCount=="number"?O.totalCount:0,we=P>0&&ne>0,lt=P===0&&ne>0,ve=await m(w.filePath).catch(()=>null),Re=!1,bt=null;if(ve){let Ct=c(ve);Ct!==w.fullDocumentContent&&(d(w,Ct,{keepDraft:!0}),e.storePayloadOverride(ve),Re=!0,bt=Ct)}if(w.notice=null,we)w.error=`${P} of ${Y} edit${Y===1?"":"s"} saved. ${ne} ${ne===1?"edit":"edits"} did not apply because that text changed on disk \u2014 your draft still has them; save again to merge.`,e.rerender(),W("Saved (partial)","saved",3e3),e.trackUiEvent?.("markdown_save_partial",{file_extension:Ot(w.filePath),applied:P,skipped:ne,total:Y});else if(lt&&Re&&e.showConflictDialog&&bt!==null){let Ct=bt,ze=w.filePath.replace(/\\/g,"/").split("/").pop()||w.filePath;w.error=null,e.rerender(),e.trackUiEvent?.("markdown_save_conflict_shown",{file_extension:Ot(w.filePath)}),e.showConflictDialog({fileName:ze,onUseDiskVersion:()=>{t===w&&(d(w,Ct),e.rerender()),e.trackUiEvent?.("markdown_save_conflict_resolved",{file_extension:Ot(w.filePath),action:"use_disk"})},onSaveMyChanges:()=>{e.trackUiEvent?.("markdown_save_conflict_resolved",{file_extension:Ot(w.filePath),action:"save_mine"}),A()},onCancel:()=>{t===w&&(w.error="File changed on disk. Save again to merge your edits, or reopen to discard them.",e.rerender()),e.trackUiEvent?.("markdown_save_conflict_resolved",{file_extension:Ot(w.filePath),action:"dismissed"})}})}else w.error=Re?"File changed on disk. Save again to merge your edits, or reopen the file to discard them.":_ instanceof Error?_.message:"Save failed.",e.rerender(),W("Save failed","saving",3e3);e.trackUiEvent?.("markdown_save_failed",{file_extension:Ot(w.filePath),reloaded_from_disk:Re,applied:P,skipped:ne,total:Y})}}function H(w,_){let O=g(w),P=document.querySelector(".panel-content-wrapper");O.editorScrollTop=P?.scrollTop??0;let ne=O.editorView;O.editorView=_,O.notice=null,O.error=null,e.rerender(),ne!==_&&e.trackUiEvent?.("markdown_view_toggled",{file_extension:Ot(w.filePath),view:_}),typeof O.editorScrollTop=="number"&&window.requestAnimationFrame(()=>{let Y=document.querySelector(".panel-content-wrapper");Y&&(Y.scrollTop=O.editorScrollTop)})}function q(w){let _=g(w),O=document.querySelector(".panel-content-wrapper"),P=_.outline,ne=Ot(w.filePath),Y=!1;{let ve=document.getElementById("markdown-editor-root");ve&&(n=V$({target:ve,value:_.draftContent,view:_.editorView,initialScrollTop:_.editorScrollTop,currentFilePath:w.filePath,searchLinks:He=>x(w.filePath,He),loadHeadings:He=>E(w.filePath,He),onChange:(He,ze)=>{if(He===_.draftContent)return;if(_.draftContent=He,_.dirty=He!==_.fullDocumentContent,_.dirty){let wn=ze&&ze.length>0?ze:[{fromLine:1,toLine:He.split(`
`).length}];_.dirtyLineRanges=gI([..._.dirtyLineRanges,...wn])}else _.dirtyLineRanges=[];_.dirty&&!Y&&(Y=!0,e.trackUiEvent?.("markdown_edit_started",{file_extension:ne,view:_.editorView})),_.dirty&&s();let qe=fs(He);n7(_.outline,qe)||(_.outline=qe,_.outline.some(wn=>wn.id===_.activeHeadingId)||(_.activeHeadingId=_.outline[0]?.id??null),o?.refresh(_.outline,_.activeHeadingId)),_.dirty&&_.saveIndicator==="saved"&&(_.saveIndicator="idle");let Po=document.getElementById("revert-markdown");Po&&(Po.disabled=!b(_))},onBlur:()=>{_.dirty&&(a(),A())}}),n.focus()),document.getElementById("revert-markdown")?.addEventListener("click",()=>{oe()}),document.getElementById("markdown-mode-raw")?.addEventListener("click",()=>{H(w,"raw")}),document.getElementById("markdown-mode-markdown")?.addEventListener("click",()=>{H(w,"markdown")})}document.getElementById("expand-fullscreen")?.addEventListener("click",()=>{xe()}),O&&O.addEventListener("click",ve=>{let bt=ve.target?.closest("a[href]");if(!bt||!bt.closest(".markdown-doc"))return;let Ct=bt.getAttribute("href");Ct&&(ve.preventDefault(),We(w,Ct))});let lt=document.querySelector(".document-outline-shell");lt&&O&&(o=lI({shell:lt,outline:P,scrollContainer:O,onSelect:ve=>{let Re=_.outline.find(bt=>bt.id===ve);Re&&typeof Re.line=="number"&&(n?.revealLine(Re.line,Re.id),_.activeHeadingId=Re.id)}})??void 0),window.setTimeout(()=>{D()},0)}function te(w){let _=g(w),O=_.draftContent;return _.editorView==="raw"?O:pI(O)||O}async function se(w){let _=t?.saveIndicator==="saved"||t?.dirty;if(t&&(t.notice=null,t.editorView="markdown"),_&&w){let O=Ut(w.content);if(O?.isPartial){let P=await h(w.filePath,O.toLine-O.fromLine+1,O.readOffset);if(P)return P}}}return{attachHandlers:q,buildBody:y,clear:u,disposeHandles:l,ensureCompletePayload:p,getCopyText:te,getState:g,handleInlineExitFromFullscreen:se,isUndoAvailable:b,readCompletePayload:m,readPayload:h,readPayloadContent:c,refreshFromDisk:re,requestEditMode:Ge,requestFullscreen:xe,saveDocument:A,setEditorView:H}}function vI(){return`
<div class="md-conflict-modal" id="md-conflict-modal" role="dialog" aria-modal="true" aria-labelledby="md-conflict-title" aria-describedby="md-conflict-body" hidden>
<div class="md-conflict-card">
<header class="md-conflict-header">
<h3 id="md-conflict-title">\u26A0 This file changed on disk</h3>
<button type="button" class="md-conflict-close" id="md-conflict-close" aria-label="Close">
<svg viewBox="0 0 24 24" aria-hidden="true" focusable="false">
<path d="M7 7l10 10M17 7L7 17" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"/>
</svg>
</button>
</header>
<div class="md-conflict-body" id="md-conflict-body">
<p>
Something else modified
<strong class="md-conflict-filename" id="md-conflict-filename"></strong>
while you were editing. Your unsaved edits are preserved.
</p>
<p>If you save now:</p>
<ul>
<li>Changes you made to lines the external edit didn't touch will be saved alongside the external changes.</li>
<li>Changes you made to lines that also changed externally will overwrite the external version on those lines.</li>
</ul>
</div>
<footer class="md-conflict-footer">
<button type="button" class="md-conflict-btn md-conflict-btn--secondary" id="md-conflict-use-disk">
Use disk version
</button>
<button type="button" class="md-conflict-btn md-conflict-btn--primary" id="md-conflict-save-mine">
Save my changes
</button>
</footer>
</div>
</div>
`}function xI(e){let{container:t}=e,n=t.querySelector("#md-conflict-modal"),o=t.querySelector("#md-conflict-filename"),r=t.querySelector("#md-conflict-use-disk"),i=t.querySelector("#md-conflict-save-mine"),s=t.querySelector("#md-conflict-close"),a=null,l=null,u=()=>{if(!n||n.hidden)return;n.hidden=!0,document.removeEventListener("keydown",c,!0),n.removeEventListener("click",d);let p=a?.onCancel;if(a=null,l&&document.contains(l))try{l.focus()}catch{}l=null,p?.()},c=p=>{if(!(!n||n.hidden)){if(p.key==="Escape"){p.stopPropagation(),p.preventDefault(),u();return}if(p.key==="Tab"){let m=[r,i,s].filter(x=>!!x);if(m.length===0)return;let g=document.activeElement,b=g?m.indexOf(g):-1,y=p.shiftKey?-1:1,k=b===-1?y===1?0:m.length-1:(b+y+m.length)%m.length;p.preventDefault(),m[k].focus()}}},d=p=>{p.target===n&&p.stopPropagation()},f=()=>{let p=a?.onUseDiskVersion;a=null,u(),p?.()},h=()=>{let p=a?.onSaveMyChanges;a=null,u(),p?.()};return r?.addEventListener("click",f),i?.addEventListener("click",h),s?.addEventListener("click",u),{open:p=>{if(!n){p.onCancel?.();return}a=p,o&&(o.textContent=p.fileName),l=document.activeElement??null,n.hidden=!1,document.addEventListener("keydown",c,!0),n.addEventListener("click",d),window.requestAnimationFrame(()=>{i?.focus()})},close:u,isOpen:()=>!!n&&!n.hidden}}function kI(e){let t=b=>e.container.querySelector(`#${b}`),n=b=>{let y=document.createElement("textarea");y.value=b,y.setAttribute("readonly",""),y.style.position="fixed",y.style.top="-9999px",document.body.appendChild(y),y.select();let k=document.execCommand("copy");return document.body.removeChild(y),k},o=(b,y,k,x)=>{b.setAttribute("title",y),b.setAttribute("aria-label",y),b.textContent=y,x&&setTimeout(()=>{b.textContent=k,b.setAttribute("title",k),b.setAttribute("aria-label",k)},x)},r=(b,y,k,x)=>{b.setAttribute("title",y),b.setAttribute("aria-label",y),b.dataset.status=y,x&&setTimeout(()=>{b.setAttribute("title",k),b.setAttribute("aria-label",k),delete b.dataset.status},x)},i=async b=>{try{return navigator.clipboard?.writeText?(await navigator.clipboard.writeText(b),!0):n(b)}catch{return n(b)}},s=e.getFileExtensionForAnalytics(e.payload.filePath),a=t("copy-source");a?.addEventListener("click",async()=>{e.trackUiEvent?.("copy_clicked",{file_type:e.payload.fileType,file_extension:s});let b=await i(Ve(e.payload.content));o(a,b?"Copied!":"Copy failed","Copy",1500)});let l=t("copy-active-markdown");l?.addEventListener("click",async()=>{let b=e.markdownController.getCopyText(e.payload);if(!b)return;let y=await i(b);y&&(e.updateSaveStatus("Copied","saved"),window.setTimeout(()=>e.updateSaveStatus("",""),1500)),r(l,y?"Copied!":"Copy failed","Copy",1500)}),t("toggle-html-mode")?.addEventListener("click",()=>{let b=e.htmlMode==="rendered"?"source":"rendered";e.trackUiEvent?.("html_view_toggled",{file_type:e.payload.fileType,file_extension:s}),e.render(e.payload,b,e.getIsExpanded())});let c=t("open-in-folder");if(c){let b=e.buildOpenInFolderCommand(e.payload.filePath);b?c.addEventListener("click",async()=>{e.trackUiEvent?.("open_in_folder",{file_type:e.payload.fileType,file_extension:s});try{await e.callTool?.("start_process",{command:b,timeout_ms:12e3,origin:"ui"})}catch{}}):c.disabled=!0}let d=t("open-in-editor");if(d){let b=e.buildOpenInEditorCommand(e.payload.filePath);b?d.addEventListener("click",async()=>{e.trackUiEvent?.("open_in_editor",{file_type:e.payload.fileType,file_extension:s});try{await e.callTool?.("start_process",{command:b,timeout_ms:12e3,origin:"ui"})}catch{}}):d.disabled=!0}let f=t("load-before"),h=t("load-after");if(!f&&!h)return;let p=Ut(e.payload.content);if(!p?.isPartial)return;let m=Ve(e.payload.content),g=async(b,y)=>{let k=b.textContent;b.textContent="Loading\u2026",b.disabled=!0,e.trackUiEvent?.(y==="before"?"load_lines_before":"load_lines_after",{file_type:e.payload.fileType,file_extension:s});try{let x=y==="before"?{path:e.payload.filePath,offset:0,length:p.fromLine-1,origin:"ui"}:{path:e.payload.filePath,offset:p.toLine,origin:"ui"},E=await e.callTool?.("read_file",x),I=Ht(E);if(I&&typeof I=="string"){let N=Ve(I),D=y==="before"?`${N}${N.endsWith(`
`)?"":`
`}${m}`:`${m}${m.endsWith(`
`)?"":`
`}${N}`,W=y==="before"?1:p.fromLine,re=y==="after"?p.totalLines:p.toLine,Oe=re-W+1,We=p.totalLines-re,xe=W>1||re<p.totalLines?`[Reading ${Oe} lines from ${W===1?"start":`line ${W}`} (total: ${p.totalLines} lines, ${We} remaining)]
`:"";e.render({...e.payload,content:xe+D},e.htmlMode,e.getIsExpanded());return}}catch{}b.textContent="Failed to load",setTimeout(()=>{b.textContent=k,b.disabled=!1},2e3)};f?.addEventListener("click",()=>{g(f,"before")}),h?.addEventListener("click",()=>{g(h,"after")})}var fn=!1,op=!1,fr,hs,Iv,Dv,_I,Nv,zv,vl,gt,EI="rendered",Sl,rp,CI,TI,Lr,Cv,Tv,ps,ms=null,Av=new Map;function h7(e){return typeof e?.sourceTool=="string"?e.sourceTool:"read_file"}async function ip(e,t){return Dv?Dv(e,t):void 0}function AI(){let e=Sl?.availableDisplayModes;return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}function gs(){return typeof Sl?.displayMode=="string"?Sl.displayMode:null}function m7(e){Lr=e,gt=e,TI?.(e)}function np(e){if(!Lr)return e;if(Lr.filePath!==e.filePath)return Lr=void 0,e;let t=Ve(e.content),n=Ve(Lr.content);return t===n?e:Lr}function MI(e,t){let n=document.querySelector(".panel-save-status");if(e)if(n)n.textContent=e,n.className=`panel-save-status panel-save-status--${t}`;else{let o=document.querySelector(".panel-topbar-actions");if(o){let r=document.createElement("span");r.className=`panel-save-status panel-save-status--${t}`,r.textContent=e,o.prepend(r)}}else n&&n.remove()}var Yt=yI({callTool:ip,openExternalLink:async e=>Nv?Nv(e):void 0,requestDisplayMode:async e=>zv?zv(e):void 0,getAvailableDisplayModes:AI,getCurrentDisplayMode:gs,getCurrentPayload:()=>gt,setExpanded:e=>{fn=e},syncPayload:e=>CI?.(e),storePayloadOverride:m7,rerender:()=>{rp?.()},updateSaveStatus:MI,trackUiEvent:(e,t)=>hs?.(e,t),showConflictDialog:e=>{if(Iv){Iv.open(e);return}console.warn("[file-preview] conflictDialogController not ready; firing onCancel fallback"),e.onCancel?.()}}),g7=["path","offset","length","sheet","range","isUrl"];function b7(e){if(!e||typeof e!="object")return;let t=e,n=typeof t.path=="string"?t.path:typeof t.file_path=="string"?t.file_path:void 0;if(!n)return;let o={path:n};for(let r of g7)r!=="path"&&t[r]!==void 0&&(o[r]=t[r]);return o}function y7(e){if(!e||typeof e!="object")return;let t=e;if(t.old_string!==void 0||t.new_string!==void 0)return"edit_block";if(t.content!==void 0)return"write_file"}var wI=8e3,Mv;async function SI(e,t,n){let o=typeof e.path=="string"?e.path:void 0;if(!o){n();return}if(Mv!==o){Mv=o;try{let r=await Promise.race([ip("read_file",{...e,origin:"ui"}),new Promise((s,a)=>{setTimeout(()=>a(new Error(`RPC read_file did not respond within ${wI}ms`)),wI)})]),i=Rc(r);if(i){t(i);return}}catch{}finally{Mv=void 0}n()}}var v7=1e4,xl;function sp(){xl!==void 0&&(clearTimeout(xl),xl=void 0)}function kl(e,t){sp(),e.innerHTML=`
<main class="shell">
${pa({label:t,variant:"status",interactive:!1})}
</main>
`,document.body.classList.add("dc-ready")}function $v(e){e.innerHTML=`
<main class="shell">
${pa({label:"Preparing preview\u2026",variant:"loading",interactive:!1})}
</main>
`,document.body.classList.add("dc-ready"),sp(),xl=setTimeout(()=>{xl=void 0,kl(e,"Unable to generate preview in this environment.")},v7)}function wl(e,t,n="rendered",o=!1){if(sp(),fn=o,EI=n,vl?.dispose(),vl=void 0,!t||t.fileType!=="markdown"?Yt.clear():Yt.disposeHandles(),!t){ms?.abort(),ms=null,gt=void 0,kl(e,"No preview available for this response."),fr?.();return}gt=t;let r=Y$(t);!r.supportsPreview&&op&&(fn=!1);let i=Ut(t.content),s=eI({payload:t,htmlMode:n,startLine:i?.fromLine??1,markdownController:Yt}),a=t.fileType==="markdown"?Yt.getState(t):void 0,l=Ot(t.filePath),c=!(gs()==="fullscreen")&&zc({availableDisplayModes:AI()}).canFullscreen;t.fileType==="markdown"&&t.defaultEditorName&&Av.set(t.filePath,{appName:t.defaultEditorName,appPath:t.defaultEditorPath});let d=t.fileType==="markdown"?Av.get(t.filePath):void 0,f=K$({payload:t,body:s,capabilities:r,fileExtension:l,htmlMode:n,currentDisplayMode:gs(),isExpanded:fn,hideSummaryRow:op,markdownWorkspace:a,canGoFullscreen:c,isMarkdownUndoAvailable:a?Yt.isUndoAvailable(a):!1,defaultMarkdownEditorName:d?.appName,markdownEditorAppIcon:rI(),hasDirectoryBackButton:!!ps});e.innerHTML=f.html,document.body.classList.add("dc-ready"),kI({container:e,payload:t,htmlMode:n,getIsExpanded:()=>fn,callTool:ip,trackUiEvent:hs,getFileExtensionForAnalytics:Ot,buildOpenInFolderCommand:m=>Sv(m,kr),buildOpenInEditorCommand:m=>nI(m,kr,Av),render:(m,g="rendered",b=fn)=>{wl(e,m,g,b)},updateSaveStatus:MI,markdownController:Yt}),t.fileType==="markdown"&&Yt.attachHandlers(t),ms=oI({payload:t,isMarkdownEditing:t.fileType==="markdown"&&!!a,updateContext:_I,trackUiEvent:hs,getFileExtensionForAnalytics:Ot,previousAbortController:ms}),t.fileType==="directory"&&h_({container:e,callTool:ip,buildOpenInFolderCommand:m=>Sv(m,kr),onOpenPayload:m=>{ps=t,wl(e,m,"rendered",!0)}});let h=document.getElementById("dir-back");if(h&&ps){let m=ps;h.addEventListener("click",()=>{ps=void 0,wl(e,m,"rendered",!0)})}t.fileType==="directory"&&(ps=void 0);let p=document.getElementById("compact-toggle");vl=dS({shell:document.getElementById("tool-shell"),compactRow:p,initialExpanded:f.effectiveExpanded,onToggle:m=>{fn=m,hs?.(m?"expand":"collapse",{file_type:t.fileType,file_extension:l})},onScrollAfterExpand:()=>{hs?.("scroll_after_expand",{file_type:t.fileType,file_extension:l})},onRender:fr}),fr?.()}function $I(){let e=document.getElementById("app");if(!e)return;if($v(e),!document.getElementById("md-conflict-modal")){let b=document.createElement("div");b.innerHTML=vI();let y=b.firstElementChild;y&&document.body.appendChild(y)}Iv=xI({container:document});let t=new kc({name:"Desktop Commander File Preview",version:"1.0.0"},{updateModelContext:{text:{}}},{autoResize:!0}),n={expanded:fn,hideSummaryRow:op},o=()=>{fn=n.expanded,op=n.hideSummaryRow},r=pS(b=>Oc(b)&&typeof b.content=="string"),i=b=>{b&&r.write(b),wl(e,b,"rendered",fn)},s=()=>{let b=r.read();b&&(gt&>.filePath===b.filePath&&Ve(gt.content)===Ve(b.content)||i(b))};CI=i,TI=b=>{r.write(b)},rp=()=>{wl(e,gt,EI,fn)};let a,l,u,c=!1,d=!1,f=(b,y)=>{if(!d){if(d=!0,b){Cv=b,i(b),b.fileType==="markdown"&&gs()==="fullscreen"&&Yt.requestEditMode(b),b.fileType==="markdown"&&Yt.refreshFromDisk(b);return}kl(e,y??"No preview available for this response."),fr?.()}};fr=()=>{},Dv=(b,y)=>t.callServerTool({name:b,arguments:y}),_I=b=>{let y=b?{content:[{type:"text",text:b}]}:{content:[]};t.updateModelContext(y).catch(()=>{})},Nv=async b=>(await t.openLink({url:b})).isError!==!0,zv=async b=>{let y=await t.requestDisplayMode({mode:b});return typeof y.mode=="string"?y.mode:null};let h=gS((b,y)=>t.callServerTool({name:b,arguments:y}),{component:"file_preview"});hs=(b,y={})=>h(b,{tool_name:h7(gt??Cv),...y}),t.ontoolinput=b=>{let y=typeof b.arguments?.path=="string"?b.arguments.path:void 0,k=b7(b.arguments);if(u=y7(b.arguments),k&&(l=k),!d&&a&&y&&a.filePath===y){let x=a;a=void 0,f(x);return}$v(e),fr?.(),c=!1,k&&!u&&SI(k,x=>{c=!0,d?i(np(x)):f(np(x))},()=>{})},t.ontoolresult=b=>{if(a=void 0,c)return;let y=Ht(b),k=b?.isError===!0,x=l??(gt?.filePath?{path:gt.filePath}:void 0),E=N=>{c=!0;let D=u?{...N,sourceTool:u}:N;d?i(np(D)):f(np(D))},I=()=>{y&&(d?(kl(e,y),fr?.()):f(void 0,y))};if(!k&&x){$v(e),fr?.(),SI(x,E,I);return}I()},t.ontoolcancelled=b=>{f(void 0,b.reason??"Tool was cancelled.")};let p=()=>{document.visibilityState==="visible"&&s()},m=()=>{document.visibilityState!=="visible"&&s()},g=()=>{sp(),vl?.dispose(),vl=void 0,Yt.disposeHandles(),ms?.abort(),ms=null,document.removeEventListener("visibilitychange",p),window.removeEventListener("focus",m)};document.addEventListener("visibilitychange",p),window.addEventListener("focus",m),t.onteardown=async()=>(g(),{}),mS({app:t,chrome:n,onContextApplied:()=>{let b=gs();o(),Sl=t.getHostContext();let y=gs(),k=b!==y;if(b==="fullscreen"&&y==="inline"&>?.fileType==="markdown"){fn=!0,n.expanded=!0;let x=Tv??Cv;(x?Ut(x.content)?.isPartial===!0:!1)&&x?(Lr=x,gt=x,r.write(x),Yt.handleInlineExitFromFullscreen(x).then(I=>{I&&(gt=I,Lr=I,r.write(I),rp?.())})):Yt.handleInlineExitFromFullscreen(),Tv=void 0}b!=="fullscreen"&&y==="fullscreen"&>?.fileType==="markdown"&&(Tv=gt,Ut(gt.content)?.isPartial&&Yt.requestEditMode(gt)),d&&k&&rp?.()},onConnected:()=>{Sl=t.getHostContext(),a=r.read()??void 0}}).catch(()=>{kl(e,"Failed to connect to host."),fr?.()}),window.addEventListener("beforeunload",()=>{g()},{once:!0})}$I();})();