@zipify/wysiwyg 4.11.2 → 4.11.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +46 -42
- package/dist/node.js +24 -20
- package/dist/wysiwyg.mjs +5 -6
- package/lib/components/base/colorPicker/ColorPicker.vue +2 -3
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -1,64 +1,68 @@
|
|
|
1
|
-
"use strict";var
|
|
2
|
-
`)}displayWidth(i){return t(i).length}styleTitle(i){return i}styleUsage(i){return i.split(" ").map(s=>s==="[options]"?this.styleOptionText(s):s==="[command]"?this.styleSubcommandText(s):s[0]==="["||s[0]==="<"?this.styleArgumentText(s):this.styleCommandText(s)).join(" ")}styleCommandDescription(i){return this.styleDescriptionText(i)}styleOptionDescription(i){return this.styleDescriptionText(i)}styleSubcommandDescription(i){return this.styleDescriptionText(i)}styleArgumentDescription(i){return this.styleDescriptionText(i)}styleDescriptionText(i){return i}styleOptionTerm(i){return this.styleOptionText(i)}styleSubcommandTerm(i){return i.split(" ").map(s=>s==="[options]"?this.styleOptionText(s):s[0]==="["||s[0]==="<"?this.styleArgumentText(s):this.styleSubcommandText(s)).join(" ")}styleArgumentTerm(i){return this.styleArgumentText(i)}styleOptionText(i){return i}styleArgumentText(i){return i}styleSubcommandText(i){return i}styleCommandText(i){return i}padWidth(i,s){return Math.max(s.longestOptionTermLength(i,s),s.longestGlobalOptionTermLength(i,s),s.longestSubcommandTermLength(i,s),s.longestArgumentTermLength(i,s))}preformatted(i){return/\n[^\S\r\n]/.test(i)}formatItem(i,s,a,u){const h=" ".repeat(2);if(!a)return h+i;const
|
|
3
|
-
`+" ".repeat(s+
|
|
4
|
-
${h}`)}boxWrap(i,s){if(s<this.minWidthToWrap)return i;const a=i.split(/\r\n|\n/),u=/[\s]*[^\s]+/g,c=[];return a.forEach(h=>{const
|
|
5
|
-
`)}}function t(r){const i=/\x1b\[\d*(;\d*)*m/g;return r.replace(i,"")}return
|
|
1
|
+
"use strict";var LC=require("node:events"),PC=require("node:child_process"),DC=require("node:path"),$C=require("node:fs"),FC=require("node:process"),zm=require("path"),Hm=require("jsdom"),na=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function BC(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Mt={},ra={},ia={},Wm;function sa(){if(Wm)return ia;Wm=1;class n extends Error{constructor(r,i,s){super(s),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=i,this.exitCode=r,this.nestedError=void 0}}class e extends n{constructor(r){super(1,"commander.invalidArgument",r),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}}return ia.CommanderError=n,ia.InvalidArgumentError=e,ia}var Vm;function Nc(){if(Vm)return ra;Vm=1;const{InvalidArgumentError:n}=sa();class e{constructor(i,s){switch(this.description=s||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,i[0]){case"<":this.required=!0,this._name=i.slice(1,-1);break;case"[":this.required=!1,this._name=i.slice(1,-1);break;default:this.required=!0,this._name=i;break}this._name.length>3&&this._name.slice(-3)==="..."&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_concatValue(i,s){return s===this.defaultValue||!Array.isArray(s)?[i]:s.concat(i)}default(i,s){return this.defaultValue=i,this.defaultValueDescription=s,this}argParser(i){return this.parseArg=i,this}choices(i){return this.argChoices=i.slice(),this.parseArg=(s,a)=>{if(!this.argChoices.includes(s))throw new n(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(s,a):s},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}}function t(r){const i=r.name()+(r.variadic===!0?"...":"");return r.required?"<"+i+">":"["+i+"]"}return ra.Argument=e,ra.humanReadableArgName=t,ra}var oa={},aa={},Um;function qm(){if(Um)return aa;Um=1;const{humanReadableArgName:n}=Nc();class e{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(i){this.helpWidth=this.helpWidth??i.helpWidth??80}visibleCommands(i){const s=i.commands.filter(u=>!u._hidden),a=i._getHelpCommand();return a&&!a._hidden&&s.push(a),this.sortSubcommands&&s.sort((u,c)=>u.name().localeCompare(c.name())),s}compareOptions(i,s){const a=u=>u.short?u.short.replace(/^-/,""):u.long.replace(/^--/,"");return a(i).localeCompare(a(s))}visibleOptions(i){const s=i.options.filter(u=>!u.hidden),a=i._getHelpOption();if(a&&!a.hidden){const u=a.short&&i._findOption(a.short),c=a.long&&i._findOption(a.long);!u&&!c?s.push(a):a.long&&!c?s.push(i.createOption(a.long,a.description)):a.short&&!u&&s.push(i.createOption(a.short,a.description))}return this.sortOptions&&s.sort(this.compareOptions),s}visibleGlobalOptions(i){if(!this.showGlobalOptions)return[];const s=[];for(let a=i.parent;a;a=a.parent){const u=a.options.filter(c=>!c.hidden);s.push(...u)}return this.sortOptions&&s.sort(this.compareOptions),s}visibleArguments(i){return i._argsDescription&&i.registeredArguments.forEach(s=>{s.description=s.description||i._argsDescription[s.name()]||""}),i.registeredArguments.find(s=>s.description)?i.registeredArguments:[]}subcommandTerm(i){const s=i.registeredArguments.map(a=>n(a)).join(" ");return i._name+(i._aliases[0]?"|"+i._aliases[0]:"")+(i.options.length?" [options]":"")+(s?" "+s:"")}optionTerm(i){return i.flags}argumentTerm(i){return i.name()}longestSubcommandTermLength(i,s){return s.visibleCommands(i).reduce((a,u)=>Math.max(a,this.displayWidth(s.styleSubcommandTerm(s.subcommandTerm(u)))),0)}longestOptionTermLength(i,s){return s.visibleOptions(i).reduce((a,u)=>Math.max(a,this.displayWidth(s.styleOptionTerm(s.optionTerm(u)))),0)}longestGlobalOptionTermLength(i,s){return s.visibleGlobalOptions(i).reduce((a,u)=>Math.max(a,this.displayWidth(s.styleOptionTerm(s.optionTerm(u)))),0)}longestArgumentTermLength(i,s){return s.visibleArguments(i).reduce((a,u)=>Math.max(a,this.displayWidth(s.styleArgumentTerm(s.argumentTerm(u)))),0)}commandUsage(i){let s=i._name;i._aliases[0]&&(s=s+"|"+i._aliases[0]);let a="";for(let u=i.parent;u;u=u.parent)a=u.name()+" "+a;return a+s+" "+i.usage()}commandDescription(i){return i.description()}subcommandDescription(i){return i.summary()||i.description()}optionDescription(i){const s=[];return i.argChoices&&s.push(`choices: ${i.argChoices.map(a=>JSON.stringify(a)).join(", ")}`),i.defaultValue!==void 0&&(i.required||i.optional||i.isBoolean()&&typeof i.defaultValue=="boolean")&&s.push(`default: ${i.defaultValueDescription||JSON.stringify(i.defaultValue)}`),i.presetArg!==void 0&&i.optional&&s.push(`preset: ${JSON.stringify(i.presetArg)}`),i.envVar!==void 0&&s.push(`env: ${i.envVar}`),s.length>0?`${i.description} (${s.join(", ")})`:i.description}argumentDescription(i){const s=[];if(i.argChoices&&s.push(`choices: ${i.argChoices.map(a=>JSON.stringify(a)).join(", ")}`),i.defaultValue!==void 0&&s.push(`default: ${i.defaultValueDescription||JSON.stringify(i.defaultValue)}`),s.length>0){const a=`(${s.join(", ")})`;return i.description?`${i.description} ${a}`:a}return i.description}formatHelp(i,s){const a=s.padWidth(i,s),u=s.helpWidth??80;function c(v,E){return s.formatItem(v,a,E,s)}let h=[`${s.styleTitle("Usage:")} ${s.styleUsage(s.commandUsage(i))}`,""];const m=s.commandDescription(i);m.length>0&&(h=h.concat([s.boxWrap(s.styleCommandDescription(m),u),""]));const d=s.visibleArguments(i).map(v=>c(s.styleArgumentTerm(s.argumentTerm(v)),s.styleArgumentDescription(s.argumentDescription(v))));d.length>0&&(h=h.concat([s.styleTitle("Arguments:"),...d,""]));const y=s.visibleOptions(i).map(v=>c(s.styleOptionTerm(s.optionTerm(v)),s.styleOptionDescription(s.optionDescription(v))));if(y.length>0&&(h=h.concat([s.styleTitle("Options:"),...y,""])),s.showGlobalOptions){const v=s.visibleGlobalOptions(i).map(E=>c(s.styleOptionTerm(s.optionTerm(E)),s.styleOptionDescription(s.optionDescription(E))));v.length>0&&(h=h.concat([s.styleTitle("Global Options:"),...v,""]))}const _=s.visibleCommands(i).map(v=>c(s.styleSubcommandTerm(s.subcommandTerm(v)),s.styleSubcommandDescription(s.subcommandDescription(v))));return _.length>0&&(h=h.concat([s.styleTitle("Commands:"),..._,""])),h.join(`
|
|
2
|
+
`)}displayWidth(i){return t(i).length}styleTitle(i){return i}styleUsage(i){return i.split(" ").map(s=>s==="[options]"?this.styleOptionText(s):s==="[command]"?this.styleSubcommandText(s):s[0]==="["||s[0]==="<"?this.styleArgumentText(s):this.styleCommandText(s)).join(" ")}styleCommandDescription(i){return this.styleDescriptionText(i)}styleOptionDescription(i){return this.styleDescriptionText(i)}styleSubcommandDescription(i){return this.styleDescriptionText(i)}styleArgumentDescription(i){return this.styleDescriptionText(i)}styleDescriptionText(i){return i}styleOptionTerm(i){return this.styleOptionText(i)}styleSubcommandTerm(i){return i.split(" ").map(s=>s==="[options]"?this.styleOptionText(s):s[0]==="["||s[0]==="<"?this.styleArgumentText(s):this.styleSubcommandText(s)).join(" ")}styleArgumentTerm(i){return this.styleArgumentText(i)}styleOptionText(i){return i}styleArgumentText(i){return i}styleSubcommandText(i){return i}styleCommandText(i){return i}padWidth(i,s){return Math.max(s.longestOptionTermLength(i,s),s.longestGlobalOptionTermLength(i,s),s.longestSubcommandTermLength(i,s),s.longestArgumentTermLength(i,s))}preformatted(i){return/\n[^\S\r\n]/.test(i)}formatItem(i,s,a,u){const h=" ".repeat(2);if(!a)return h+i;const m=i.padEnd(s+i.length-u.displayWidth(i)),d=2,_=(this.helpWidth??80)-s-d-2;let v;return _<this.minWidthToWrap||u.preformatted(a)?v=a:v=u.boxWrap(a,_).replace(/\n/g,`
|
|
3
|
+
`+" ".repeat(s+d)),h+m+" ".repeat(d)+v.replace(/\n/g,`
|
|
4
|
+
${h}`)}boxWrap(i,s){if(s<this.minWidthToWrap)return i;const a=i.split(/\r\n|\n/),u=/[\s]*[^\s]+/g,c=[];return a.forEach(h=>{const m=h.match(u);if(m===null){c.push("");return}let d=[m.shift()],y=this.displayWidth(d[0]);m.forEach(_=>{const v=this.displayWidth(_);if(y+v<=s){d.push(_),y+=v;return}c.push(d.join(""));const E=_.trimStart();d=[E],y=this.displayWidth(E)}),c.push(d.join(""))}),c.join(`
|
|
5
|
+
`)}}function t(r){const i=/\x1b\[\d*(;\d*)*m/g;return r.replace(i,"")}return aa.Help=e,aa.stripColor=t,aa}var la={},Km;function Gm(){if(Km)return la;Km=1;const{InvalidArgumentError:n}=sa();class e{constructor(a,u){this.flags=a,this.description=u||"",this.required=a.includes("<"),this.optional=a.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(a),this.mandatory=!1;const c=i(a);this.short=c.shortFlag,this.long=c.longFlag,this.negate=!1,this.long&&(this.negate=this.long.startsWith("--no-")),this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0}default(a,u){return this.defaultValue=a,this.defaultValueDescription=u,this}preset(a){return this.presetArg=a,this}conflicts(a){return this.conflictsWith=this.conflictsWith.concat(a),this}implies(a){let u=a;return typeof a=="string"&&(u={[a]:!0}),this.implied=Object.assign(this.implied||{},u),this}env(a){return this.envVar=a,this}argParser(a){return this.parseArg=a,this}makeOptionMandatory(a=!0){return this.mandatory=!!a,this}hideHelp(a=!0){return this.hidden=!!a,this}_concatValue(a,u){return u===this.defaultValue||!Array.isArray(u)?[a]:u.concat(a)}choices(a){return this.argChoices=a.slice(),this.parseArg=(u,c)=>{if(!this.argChoices.includes(u))throw new n(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(u,c):u},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return this.negate?r(this.name().replace(/^no-/,"")):r(this.name())}is(a){return this.short===a||this.long===a}isBoolean(){return!this.required&&!this.optional&&!this.negate}}class t{constructor(a){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,a.forEach(u=>{u.negate?this.negativeOptions.set(u.attributeName(),u):this.positiveOptions.set(u.attributeName(),u)}),this.negativeOptions.forEach((u,c)=>{this.positiveOptions.has(c)&&this.dualOptions.add(c)})}valueFromOption(a,u){const c=u.attributeName();if(!this.dualOptions.has(c))return!0;const h=this.negativeOptions.get(c).presetArg,m=h!==void 0?h:!1;return u.negate===(m===a)}}function r(s){return s.split("-").reduce((a,u)=>a+u[0].toUpperCase()+u.slice(1))}function i(s){let a,u;const c=/^-[^-]$/,h=/^--[^-]/,m=s.split(/[ |,]+/).concat("guard");if(c.test(m[0])&&(a=m.shift()),h.test(m[0])&&(u=m.shift()),!a&&c.test(m[0])&&(a=m.shift()),!a&&h.test(m[0])&&(a=u,u=m.shift()),m[0].startsWith("-")){const d=m[0],y=`option creation failed due to '${d}' in option flags '${s}'`;throw/^-[^-][^-]/.test(d)?new Error(`${y}
|
|
6
6
|
- a short flag is a single dash and a single character
|
|
7
7
|
- either use a single dash and a single character (for a short flag)
|
|
8
|
-
- or use a double dash for a long option (and can have two, like '--ws, --workspace')`):c.test(
|
|
9
|
-
- too many short flags`):h.test(
|
|
8
|
+
- or use a double dash for a long option (and can have two, like '--ws, --workspace')`):c.test(d)?new Error(`${y}
|
|
9
|
+
- too many short flags`):h.test(d)?new Error(`${y}
|
|
10
10
|
- too many long flags`):new Error(`${y}
|
|
11
|
-
- unrecognised flag format`)}if(a===void 0&&u===void 0)throw new Error(`option creation failed due to no flags found in '${s}'.`);return{shortFlag:a,longFlag:u}}return
|
|
11
|
+
- unrecognised flag format`)}if(a===void 0&&u===void 0)throw new Error(`option creation failed due to no flags found in '${s}'.`);return{shortFlag:a,longFlag:u}}return la.Option=e,la.DualOptions=t,la}var Rc={},Jm;function zC(){if(Jm)return Rc;Jm=1;const n=3;function e(r,i){if(Math.abs(r.length-i.length)>n)return Math.max(r.length,i.length);const s=[];for(let a=0;a<=r.length;a++)s[a]=[a];for(let a=0;a<=i.length;a++)s[0][a]=a;for(let a=1;a<=i.length;a++)for(let u=1;u<=r.length;u++){let c=1;r[u-1]===i[a-1]?c=0:c=1,s[u][a]=Math.min(s[u-1][a]+1,s[u][a-1]+1,s[u-1][a-1]+c),u>1&&a>1&&r[u-1]===i[a-2]&&r[u-2]===i[a-1]&&(s[u][a]=Math.min(s[u][a],s[u-2][a-2]+1))}return s[r.length][i.length]}function t(r,i){if(!i||i.length===0)return"";i=Array.from(new Set(i));const s=r.startsWith("--");s&&(r=r.slice(2),i=i.map(h=>h.slice(2)));let a=[],u=n;const c=.4;return i.forEach(h=>{if(h.length<=1)return;const m=e(r,h),d=Math.max(r.length,h.length);(d-m)/d>c&&(m<u?(u=m,a=[h]):m===u&&a.push(h))}),a.sort((h,m)=>h.localeCompare(m)),s&&(a=a.map(h=>`--${h}`)),a.length>1?`
|
|
12
12
|
(Did you mean one of ${a.join(", ")}?)`:a.length===1?`
|
|
13
|
-
(Did you mean ${a[0]}?)`:""}return
|
|
14
|
-
- specify the name in Command constructor or using .name()`);return
|
|
15
|
-
Expecting one of '${k.join("', '")}'`);return this._lifeCycleHooks[g]?this._lifeCycleHooks[g].push(
|
|
16
|
-
- already used by option '${
|
|
17
|
-
- either make a new Command for each call to parse, or stop storing options as properties`);this._name=this._savedState._name,this._scriptPath=null,this.rawArgs=[],this._optionValues={...this._savedState._optionValues},this._optionValueSources={...this._savedState._optionValueSources},this.args=[],this.processedArgs=[]}_checkForMissingExecutable(g,
|
|
13
|
+
(Did you mean ${a[0]}?)`:""}return Rc.suggestSimilar=t,Rc}var jm;function HC(){if(jm)return oa;jm=1;const n=LC.EventEmitter,e=PC,t=DC,r=$C,i=FC,{Argument:s,humanReadableArgName:a}=Nc(),{CommanderError:u}=sa(),{Help:c,stripColor:h}=qm(),{Option:m,DualOptions:d}=Gm(),{suggestSimilar:y}=zC();class _ extends n{constructor(g){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!1,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=g||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._savedState=null,this._outputConfiguration={writeOut:S=>i.stdout.write(S),writeErr:S=>i.stderr.write(S),outputError:(S,k)=>k(S),getOutHelpWidth:()=>i.stdout.isTTY?i.stdout.columns:void 0,getErrHelpWidth:()=>i.stderr.isTTY?i.stderr.columns:void 0,getOutHasColors:()=>E()??(i.stdout.isTTY&&i.stdout.hasColors?.()),getErrHasColors:()=>E()??(i.stderr.isTTY&&i.stderr.hasColors?.()),stripColor:S=>h(S)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={}}copyInheritedSettings(g){return this._outputConfiguration=g._outputConfiguration,this._helpOption=g._helpOption,this._helpCommand=g._helpCommand,this._helpConfiguration=g._helpConfiguration,this._exitCallback=g._exitCallback,this._storeOptionsAsProperties=g._storeOptionsAsProperties,this._combineFlagAndOptionalValue=g._combineFlagAndOptionalValue,this._allowExcessArguments=g._allowExcessArguments,this._enablePositionalOptions=g._enablePositionalOptions,this._showHelpAfterError=g._showHelpAfterError,this._showSuggestionAfterError=g._showSuggestionAfterError,this}_getCommandAndAncestors(){const g=[];for(let S=this;S;S=S.parent)g.push(S);return g}command(g,S,k){let T=S,A=k;typeof T=="object"&&T!==null&&(A=T,T=null),A=A||{};const[,$,U]=g.match(/([^ ]+) *(.*)/),z=this.createCommand($);return T&&(z.description(T),z._executableHandler=!0),A.isDefault&&(this._defaultCommandName=z._name),z._hidden=!!(A.noHelp||A.hidden),z._executableFile=A.executableFile||null,U&&z.arguments(U),this._registerCommand(z),z.parent=this,z.copyInheritedSettings(this),T?this:z}createCommand(g){return new _(g)}createHelp(){return Object.assign(new c,this.configureHelp())}configureHelp(g){return g===void 0?this._helpConfiguration:(this._helpConfiguration=g,this)}configureOutput(g){return g===void 0?this._outputConfiguration:(Object.assign(this._outputConfiguration,g),this)}showHelpAfterError(g=!0){return typeof g!="string"&&(g=!!g),this._showHelpAfterError=g,this}showSuggestionAfterError(g=!0){return this._showSuggestionAfterError=!!g,this}addCommand(g,S){if(!g._name)throw new Error(`Command passed to .addCommand() must have a name
|
|
14
|
+
- specify the name in Command constructor or using .name()`);return S=S||{},S.isDefault&&(this._defaultCommandName=g._name),(S.noHelp||S.hidden)&&(g._hidden=!0),this._registerCommand(g),g.parent=this,g._checkForBrokenPassThrough(),this}createArgument(g,S){return new s(g,S)}argument(g,S,k,T){const A=this.createArgument(g,S);return typeof k=="function"?A.default(T).argParser(k):A.default(k),this.addArgument(A),this}arguments(g){return g.trim().split(/ +/).forEach(S=>{this.argument(S)}),this}addArgument(g){const S=this.registeredArguments.slice(-1)[0];if(S&&S.variadic)throw new Error(`only the last argument can be variadic '${S.name()}'`);if(g.required&&g.defaultValue!==void 0&&g.parseArg===void 0)throw new Error(`a default value for a required argument is never used: '${g.name()}'`);return this.registeredArguments.push(g),this}helpCommand(g,S){if(typeof g=="boolean")return this._addImplicitHelpCommand=g,this;g=g??"help [command]";const[,k,T]=g.match(/([^ ]+) *(.*)/),A=S??"display help for command",$=this.createCommand(k);return $.helpOption(!1),T&&$.arguments(T),A&&$.description(A),this._addImplicitHelpCommand=!0,this._helpCommand=$,this}addHelpCommand(g,S){return typeof g!="object"?(this.helpCommand(g,S),this):(this._addImplicitHelpCommand=!0,this._helpCommand=g,this)}_getHelpCommand(){return this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"))?(this._helpCommand===void 0&&this.helpCommand(void 0,void 0),this._helpCommand):null}hook(g,S){const k=["preSubcommand","preAction","postAction"];if(!k.includes(g))throw new Error(`Unexpected value for event passed to hook : '${g}'.
|
|
15
|
+
Expecting one of '${k.join("', '")}'`);return this._lifeCycleHooks[g]?this._lifeCycleHooks[g].push(S):this._lifeCycleHooks[g]=[S],this}exitOverride(g){return g?this._exitCallback=g:this._exitCallback=S=>{if(S.code!=="commander.executeSubCommandAsync")throw S},this}_exit(g,S,k){this._exitCallback&&this._exitCallback(new u(g,S,k)),i.exit(g)}action(g){const S=k=>{const T=this.registeredArguments.length,A=k.slice(0,T);return this._storeOptionsAsProperties?A[T]=this:A[T]=this.opts(),A.push(this),g.apply(this,A)};return this._actionHandler=S,this}createOption(g,S){return new m(g,S)}_callParseArg(g,S,k,T){try{return g.parseArg(S,k)}catch(A){if(A.code==="commander.invalidArgument"){const $=`${T} ${A.message}`;this.error($,{exitCode:A.exitCode,code:A.code})}throw A}}_registerOption(g){const S=g.short&&this._findOption(g.short)||g.long&&this._findOption(g.long);if(S){const k=g.long&&this._findOption(g.long)?g.long:g.short;throw new Error(`Cannot add option '${g.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${k}'
|
|
16
|
+
- already used by option '${S.flags}'`)}this.options.push(g)}_registerCommand(g){const S=T=>[T.name()].concat(T.aliases()),k=S(g).find(T=>this._findCommand(T));if(k){const T=S(this._findCommand(k)).join("|"),A=S(g).join("|");throw new Error(`cannot add command '${A}' as already have command '${T}'`)}this.commands.push(g)}addOption(g){this._registerOption(g);const S=g.name(),k=g.attributeName();if(g.negate){const A=g.long.replace(/^--no-/,"--");this._findOption(A)||this.setOptionValueWithSource(k,g.defaultValue===void 0?!0:g.defaultValue,"default")}else g.defaultValue!==void 0&&this.setOptionValueWithSource(k,g.defaultValue,"default");const T=(A,$,U)=>{A==null&&g.presetArg!==void 0&&(A=g.presetArg);const z=this.getOptionValue(k);A!==null&&g.parseArg?A=this._callParseArg(g,A,z,$):A!==null&&g.variadic&&(A=g._concatValue(A,z)),A==null&&(g.negate?A=!1:g.isBoolean()||g.optional?A=!0:A=""),this.setOptionValueWithSource(k,A,U)};return this.on("option:"+S,A=>{const $=`error: option '${g.flags}' argument '${A}' is invalid.`;T(A,$,"cli")}),g.envVar&&this.on("optionEnv:"+S,A=>{const $=`error: option '${g.flags}' value '${A}' from env '${g.envVar}' is invalid.`;T(A,$,"env")}),this}_optionEx(g,S,k,T,A){if(typeof S=="object"&&S instanceof m)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");const $=this.createOption(S,k);if($.makeOptionMandatory(!!g.mandatory),typeof T=="function")$.default(A).argParser(T);else if(T instanceof RegExp){const U=T;T=(z,ee)=>{const te=U.exec(z);return te?te[0]:ee},$.default(A).argParser(T)}else $.default(T);return this.addOption($)}option(g,S,k,T){return this._optionEx({},g,S,k,T)}requiredOption(g,S,k,T){return this._optionEx({mandatory:!0},g,S,k,T)}combineFlagAndOptionalValue(g=!0){return this._combineFlagAndOptionalValue=!!g,this}allowUnknownOption(g=!0){return this._allowUnknownOption=!!g,this}allowExcessArguments(g=!0){return this._allowExcessArguments=!!g,this}enablePositionalOptions(g=!0){return this._enablePositionalOptions=!!g,this}passThroughOptions(g=!0){return this._passThroughOptions=!!g,this._checkForBrokenPassThrough(),this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions)throw new Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}storeOptionsAsProperties(g=!0){if(this.options.length)throw new Error("call .storeOptionsAsProperties() before adding options");if(Object.keys(this._optionValues).length)throw new Error("call .storeOptionsAsProperties() before setting option values");return this._storeOptionsAsProperties=!!g,this}getOptionValue(g){return this._storeOptionsAsProperties?this[g]:this._optionValues[g]}setOptionValue(g,S){return this.setOptionValueWithSource(g,S,void 0)}setOptionValueWithSource(g,S,k){return this._storeOptionsAsProperties?this[g]=S:this._optionValues[g]=S,this._optionValueSources[g]=k,this}getOptionValueSource(g){return this._optionValueSources[g]}getOptionValueSourceWithGlobals(g){let S;return this._getCommandAndAncestors().forEach(k=>{k.getOptionValueSource(g)!==void 0&&(S=k.getOptionValueSource(g))}),S}_prepareUserArgs(g,S){if(g!==void 0&&!Array.isArray(g))throw new Error("first parameter to parse must be array or undefined");if(S=S||{},g===void 0&&S.from===void 0){i.versions?.electron&&(S.from="electron");const T=i.execArgv??[];(T.includes("-e")||T.includes("--eval")||T.includes("-p")||T.includes("--print"))&&(S.from="eval")}g===void 0&&(g=i.argv),this.rawArgs=g.slice();let k;switch(S.from){case void 0:case"node":this._scriptPath=g[1],k=g.slice(2);break;case"electron":i.defaultApp?(this._scriptPath=g[1],k=g.slice(2)):k=g.slice(1);break;case"user":k=g.slice(0);break;case"eval":k=g.slice(1);break;default:throw new Error(`unexpected parse option { from: '${S.from}' }`)}return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||"program",k}parse(g,S){this._prepareForParse();const k=this._prepareUserArgs(g,S);return this._parseCommand([],k),this}async parseAsync(g,S){this._prepareForParse();const k=this._prepareUserArgs(g,S);return await this._parseCommand([],k),this}_prepareForParse(){this._savedState===null?this.saveStateBeforeParse():this.restoreStateBeforeParse()}saveStateBeforeParse(){this._savedState={_name:this._name,_optionValues:{...this._optionValues},_optionValueSources:{...this._optionValueSources}}}restoreStateBeforeParse(){if(this._storeOptionsAsProperties)throw new Error(`Can not call parse again when storeOptionsAsProperties is true.
|
|
17
|
+
- either make a new Command for each call to parse, or stop storing options as properties`);this._name=this._savedState._name,this._scriptPath=null,this.rawArgs=[],this._optionValues={...this._savedState._optionValues},this._optionValueSources={...this._savedState._optionValueSources},this.args=[],this.processedArgs=[]}_checkForMissingExecutable(g,S,k){if(r.existsSync(g))return;const T=S?`searched for local subcommand relative to directory '${S}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",A=`'${g}' does not exist
|
|
18
18
|
- if '${k}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
|
|
19
19
|
- if the default executable name is not suitable, use the executableFile option to supply a custom name or path
|
|
20
|
-
- ${
|
|
20
|
+
- ${T}`;throw new Error(A)}_executeSubCommand(g,S){S=S.slice();let k=!1;const T=[".js",".ts",".tsx",".mjs",".cjs"];function A(te,Se){const vt=t.resolve(te,Se);if(r.existsSync(vt))return vt;if(T.includes(t.extname(Se)))return;const Cn=T.find($t=>r.existsSync(`${vt}${$t}`));if(Cn)return`${vt}${Cn}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let $=g._executableFile||`${this._name}-${g._name}`,U=this._executableDir||"";if(this._scriptPath){let te;try{te=r.realpathSync(this._scriptPath)}catch{te=this._scriptPath}U=t.resolve(t.dirname(te),U)}if(U){let te=A(U,$);if(!te&&!g._executableFile&&this._scriptPath){const Se=t.basename(this._scriptPath,t.extname(this._scriptPath));Se!==this._name&&(te=A(U,`${Se}-${g._name}`))}$=te||$}k=T.includes(t.extname($));let z;i.platform!=="win32"?k?(S.unshift($),S=v(i.execArgv).concat(S),z=e.spawn(i.argv[0],S,{stdio:"inherit"})):z=e.spawn($,S,{stdio:"inherit"}):(this._checkForMissingExecutable($,U,g._name),S.unshift($),S=v(i.execArgv).concat(S),z=e.spawn(i.execPath,S,{stdio:"inherit"})),z.killed||["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(Se=>{i.on(Se,()=>{z.killed===!1&&z.exitCode===null&&z.kill(Se)})});const ee=this._exitCallback;z.on("close",te=>{te=te??1,ee?ee(new u(te,"commander.executeSubCommandAsync","(close)")):i.exit(te)}),z.on("error",te=>{if(te.code==="ENOENT")this._checkForMissingExecutable($,U,g._name);else if(te.code==="EACCES")throw new Error(`'${$}' not executable`);if(!ee)i.exit(1);else{const Se=new u(1,"commander.executeSubCommandAsync","(error)");Se.nestedError=te,ee(Se)}}),this.runningCommand=z}_dispatchSubcommand(g,S,k){const T=this._findCommand(g);T||this.help({error:!0}),T._prepareForParse();let A;return A=this._chainOrCallSubCommandHook(A,T,"preSubcommand"),A=this._chainOrCall(A,()=>{if(T._executableHandler)this._executeSubCommand(T,S.concat(k));else return T._parseCommand(S,k)}),A}_dispatchHelpCommand(g){g||this.help();const S=this._findCommand(g);return S&&!S._executableHandler&&S.help(),this._dispatchSubcommand(g,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){this.registeredArguments.forEach((g,S)=>{g.required&&this.args[S]==null&&this.missingArgument(g.name())}),!(this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)&&this.args.length>this.registeredArguments.length&&this._excessArguments(this.args)}_processArguments(){const g=(k,T,A)=>{let $=T;if(T!==null&&k.parseArg){const U=`error: command-argument value '${T}' is invalid for argument '${k.name()}'.`;$=this._callParseArg(k,T,A,U)}return $};this._checkNumberOfArguments();const S=[];this.registeredArguments.forEach((k,T)=>{let A=k.defaultValue;k.variadic?T<this.args.length?(A=this.args.slice(T),k.parseArg&&(A=A.reduce(($,U)=>g(k,U,$),k.defaultValue))):A===void 0&&(A=[]):T<this.args.length&&(A=this.args[T],k.parseArg&&(A=g(k,A,k.defaultValue))),S[T]=A}),this.processedArgs=S}_chainOrCall(g,S){return g&&g.then&&typeof g.then=="function"?g.then(()=>S()):S()}_chainOrCallHooks(g,S){let k=g;const T=[];return this._getCommandAndAncestors().reverse().filter(A=>A._lifeCycleHooks[S]!==void 0).forEach(A=>{A._lifeCycleHooks[S].forEach($=>{T.push({hookedCommand:A,callback:$})})}),S==="postAction"&&T.reverse(),T.forEach(A=>{k=this._chainOrCall(k,()=>A.callback(A.hookedCommand,this))}),k}_chainOrCallSubCommandHook(g,S,k){let T=g;return this._lifeCycleHooks[k]!==void 0&&this._lifeCycleHooks[k].forEach(A=>{T=this._chainOrCall(T,()=>A(this,S))}),T}_parseCommand(g,S){const k=this.parseOptions(S);if(this._parseOptionsEnv(),this._parseOptionsImplied(),g=g.concat(k.operands),S=k.unknown,this.args=g.concat(S),g&&this._findCommand(g[0]))return this._dispatchSubcommand(g[0],g.slice(1),S);if(this._getHelpCommand()&&g[0]===this._getHelpCommand().name())return this._dispatchHelpCommand(g[1]);if(this._defaultCommandName)return this._outputHelpIfRequested(S),this._dispatchSubcommand(this._defaultCommandName,g,S);this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName&&this.help({error:!0}),this._outputHelpIfRequested(k.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();const T=()=>{k.unknown.length>0&&this.unknownOption(k.unknown[0])},A=`command:${this.name()}`;if(this._actionHandler){T(),this._processArguments();let $;return $=this._chainOrCallHooks($,"preAction"),$=this._chainOrCall($,()=>this._actionHandler(this.processedArgs)),this.parent&&($=this._chainOrCall($,()=>{this.parent.emit(A,g,S)})),$=this._chainOrCallHooks($,"postAction"),$}if(this.parent&&this.parent.listenerCount(A))T(),this._processArguments(),this.parent.emit(A,g,S);else if(g.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",g,S);this.listenerCount("command:*")?this.emit("command:*",g,S):this.commands.length?this.unknownCommand():(T(),this._processArguments())}else this.commands.length?(T(),this.help({error:!0})):(T(),this._processArguments())}_findCommand(g){if(g)return this.commands.find(S=>S._name===g||S._aliases.includes(g))}_findOption(g){return this.options.find(S=>S.is(g))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(g=>{g.options.forEach(S=>{S.mandatory&&g.getOptionValue(S.attributeName())===void 0&&g.missingMandatoryOptionValue(S)})})}_checkForConflictingLocalOptions(){const g=this.options.filter(k=>{const T=k.attributeName();return this.getOptionValue(T)===void 0?!1:this.getOptionValueSource(T)!=="default"});g.filter(k=>k.conflictsWith.length>0).forEach(k=>{const T=g.find(A=>k.conflictsWith.includes(A.attributeName()));T&&this._conflictingOption(k,T)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(g=>{g._checkForConflictingLocalOptions()})}parseOptions(g){const S=[],k=[];let T=S;const A=g.slice();function $(z){return z.length>1&&z[0]==="-"}let U=null;for(;A.length;){const z=A.shift();if(z==="--"){T===k&&T.push(z),T.push(...A);break}if(U&&!$(z)){this.emit(`option:${U.name()}`,z);continue}if(U=null,$(z)){const ee=this._findOption(z);if(ee){if(ee.required){const te=A.shift();te===void 0&&this.optionMissingArgument(ee),this.emit(`option:${ee.name()}`,te)}else if(ee.optional){let te=null;A.length>0&&!$(A[0])&&(te=A.shift()),this.emit(`option:${ee.name()}`,te)}else this.emit(`option:${ee.name()}`);U=ee.variadic?ee:null;continue}}if(z.length>2&&z[0]==="-"&&z[1]!=="-"){const ee=this._findOption(`-${z[1]}`);if(ee){ee.required||ee.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${ee.name()}`,z.slice(2)):(this.emit(`option:${ee.name()}`),A.unshift(`-${z.slice(2)}`));continue}}if(/^--[^=]+=/.test(z)){const ee=z.indexOf("="),te=this._findOption(z.slice(0,ee));if(te&&(te.required||te.optional)){this.emit(`option:${te.name()}`,z.slice(ee+1));continue}}if($(z)&&(T=k),(this._enablePositionalOptions||this._passThroughOptions)&&S.length===0&&k.length===0){if(this._findCommand(z)){S.push(z),A.length>0&&k.push(...A);break}else if(this._getHelpCommand()&&z===this._getHelpCommand().name()){S.push(z),A.length>0&&S.push(...A);break}else if(this._defaultCommandName){k.push(z),A.length>0&&k.push(...A);break}}if(this._passThroughOptions){T.push(z),A.length>0&&T.push(...A);break}T.push(z)}return{operands:S,unknown:k}}opts(){if(this._storeOptionsAsProperties){const g={},S=this.options.length;for(let k=0;k<S;k++){const T=this.options[k].attributeName();g[T]=T===this._versionOptionName?this._version:this[T]}return g}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((g,S)=>Object.assign(g,S.opts()),{})}error(g,S){this._outputConfiguration.outputError(`${g}
|
|
21
21
|
`,this._outputConfiguration.writeErr),typeof this._showHelpAfterError=="string"?this._outputConfiguration.writeErr(`${this._showHelpAfterError}
|
|
22
22
|
`):this._showHelpAfterError&&(this._outputConfiguration.writeErr(`
|
|
23
|
-
`),this.outputHelp({error:!0}));const k=
|
|
24
|
-
`),this._exit(0,"commander.version",g)}),this}description(g,
|
|
25
|
-
Expecting one of '${k.join("', '")}'`);const
|
|
26
|
-
`)}),this}_outputHelpIfRequested(g){const v=this._getHelpOption();v&&g.find(A=>v.is(A))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}}function S(N){return N.map(g=>{if(!g.startsWith("--inspect"))return g;let v,k="127.0.0.1",A="9229",T;return(T=g.match(/^(--inspect(-brk)?)$/))!==null?v=T[1]:(T=g.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(v=T[1],/^\d+$/.test(T[3])?A=T[3]:k=T[3]):(T=g.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(v=T[1],k=T[3],A=T[4]),v&&A!=="0"?`${v}=${k}:${parseInt(A)+1}`:g})}function E(){if(i.env.NO_COLOR||i.env.FORCE_COLOR==="0"||i.env.FORCE_COLOR==="false")return!1;if(i.env.FORCE_COLOR||i.env.CLICOLOR_FORCE!==void 0)return!0}return qo.Command=_,qo.useColor=E,qo}var pm;function $C(){if(pm)return Ot;pm=1;const{Argument:n}=uc(),{Command:e}=zC(),{CommanderError:t,InvalidArgumentError:r}=Uo(),{Help:i}=um(),{Option:s}=fm();return Ot.program=new e,Ot.createCommand=a=>new e(a),Ot.createOption=(a,u)=>new s(a,u),Ot.createArgument=(a,u)=>new n(a,u),Ot.Command=e,Ot.Option=s,Ot.Argument=n,Ot.Help=i,Ot.CommanderError=t,Ot.InvalidArgumentError=r,Ot.InvalidOptionArgumentError=r,Ot}var HC=$C(),WC=FC(HC);const{program:kN,createCommand:AN,createArgument:TN,createOption:ON,CommanderError:MN,InvalidArgumentError:IN,InvalidOptionArgumentError:NN,Command:VC,Argument:RN,Option:LN,Help:PN}=WC;function UC(n){const e=Object.create(null);for(const t of n.split(","))e[t]=1;return t=>t in e}const us=process.env.NODE_ENV!=="production"?Object.freeze({}):{};process.env.NODE_ENV!=="production"&&Object.freeze([]);const pi=()=>{},qC=n=>n.charCodeAt(0)===111&&n.charCodeAt(1)===110&&(n.charCodeAt(2)>122||n.charCodeAt(2)<97),or=Object.assign,KC=Object.prototype.hasOwnProperty,fc=(n,e)=>KC.call(n,e),Fe=Array.isArray,mi=n=>Jo(n)==="[object Map]",GC=n=>Jo(n)==="[object Set]",Qe=n=>typeof n=="function",Ln=n=>typeof n=="string",cs=n=>typeof n=="symbol",gt=n=>n!==null&&typeof n=="object",JC=n=>(gt(n)||Qe(n))&&Qe(n.then)&&Qe(n.catch),jC=Object.prototype.toString,Jo=n=>jC.call(n),mm=n=>Jo(n).slice(8,-1),YC=n=>Jo(n)==="[object Object]",hc=n=>Ln(n)&&n!=="NaN"&&n[0]!=="-"&&""+parseInt(n,10)===n,XC=n=>{const e=Object.create(null);return t=>e[t]||(e[t]=n(t))},ZC=XC(n=>n.charAt(0).toUpperCase()+n.slice(1)),ar=(n,e)=>!Object.is(n,e);let gm;const jo=()=>gm||(gm=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function dc(n){if(Fe(n)){const e={};for(let t=0;t<n.length;t++){const r=n[t],i=Ln(r)?nE(r):dc(r);if(i)for(const s in i)e[s]=i[s]}return e}else if(Ln(n)||gt(n))return n}const QC=/;(?![^(]*\))/g,eE=/:([^]+)/,tE=/\/\*[^]*?\*\//g;function nE(n){const e={};return n.replace(tE,"").split(QC).forEach(t=>{if(t){const r=t.split(eE);r.length>1&&(e[r[0].trim()]=r[1].trim())}}),e}function pc(n){let e="";if(Ln(n))e=n;else if(Fe(n))for(let t=0;t<n.length;t++){const r=pc(n[t]);r&&(e+=r+" ")}else if(gt(n))for(const t in n)n[t]&&(e+=t+" ");return e.trim()}function Pn(n,...e){console.warn(`[Vue warn] ${n}`,...e)}let we;const mc=new WeakSet;class rE{constructor(e){this.fn=e,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,mc.has(this)&&(mc.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||bm(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,xm(this),_m(this);const e=we,t=sn;we=this,sn=!0;try{return this.fn()}finally{process.env.NODE_ENV!=="production"&&we!==this&&Pn("Active effect was not restored correctly - this is likely a Vue internal bug."),wm(this),we=e,sn=t,this.flags&=-3}}stop(){if(this.flags&1){for(let e=this.deps;e;e=e.nextDep)_c(e);this.deps=this.depsTail=void 0,xm(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?mc.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){bc(this)&&this.run()}get dirty(){return bc(this)}}let ym=0,fs,hs;function bm(n,e=!1){if(n.flags|=8,e){n.next=hs,hs=n;return}n.next=fs,fs=n}function gc(){ym++}function yc(){if(--ym>0)return;if(hs){let e=hs;for(hs=void 0;e;){const t=e.next;e.next=void 0,e.flags&=-9,e=t}}let n;for(;fs;){let e=fs;for(fs=void 0;e;){const t=e.next;if(e.next=void 0,e.flags&=-9,e.flags&1)try{e.trigger()}catch(r){n||(n=r)}e=t}}if(n)throw n}function _m(n){for(let e=n.deps;e;e=e.nextDep)e.version=-1,e.prevActiveLink=e.dep.activeLink,e.dep.activeLink=e}function wm(n){let e,t=n.depsTail,r=t;for(;r;){const i=r.prevDep;r.version===-1?(r===t&&(t=i),_c(r),iE(r)):e=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=i}n.deps=e,n.depsTail=t}function bc(n){for(let e=n.deps;e;e=e.nextDep)if(e.dep.version!==e.version||e.dep.computed&&(vm(e.dep.computed)||e.dep.version!==e.version))return!0;return!!n._dirty}function vm(n){if(n.flags&4&&!(n.flags&16)||(n.flags&=-17,n.globalVersion===ds))return;n.globalVersion=ds;const e=n.dep;if(n.flags|=2,e.version>0&&!n.isSSR&&n.deps&&!bc(n)){n.flags&=-3;return}const t=we,r=sn;we=n,sn=!0;try{_m(n);const i=n.fn(n._value);(e.version===0||ar(i,n._value))&&(n._value=i,e.version++)}catch(i){throw e.version++,i}finally{we=t,sn=r,wm(n),n.flags&=-3}}function _c(n,e=!1){const{dep:t,prevSub:r,nextSub:i}=n;if(r&&(r.nextSub=i,n.prevSub=void 0),i&&(i.prevSub=r,n.nextSub=void 0),process.env.NODE_ENV!=="production"&&t.subsHead===n&&(t.subsHead=i),t.subs===n&&(t.subs=r,!r&&t.computed)){t.computed.flags&=-5;for(let s=t.computed.deps;s;s=s.nextDep)_c(s,!0)}!e&&!--t.sc&&t.map&&t.map.delete(t.key)}function iE(n){const{prevDep:e,nextDep:t}=n;e&&(e.nextDep=t,n.prevDep=void 0),t&&(t.prevDep=e,n.nextDep=void 0)}let sn=!0;const Sm=[];function Yo(){Sm.push(sn),sn=!1}function Xo(){const n=Sm.pop();sn=n===void 0?!0:n}function xm(n){const{cleanup:e}=n;if(n.cleanup=void 0,e){const t=we;we=void 0;try{e()}finally{we=t}}}let ds=0,sE=class{constructor(e,t){this.sub=e,this.dep=t,this.version=t.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}};class wc{constructor(e){this.computed=e,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,process.env.NODE_ENV!=="production"&&(this.subsHead=void 0)}track(e){if(!we||!sn||we===this.computed)return;let t=this.activeLink;if(t===void 0||t.sub!==we)t=this.activeLink=new sE(we,this),we.deps?(t.prevDep=we.depsTail,we.depsTail.nextDep=t,we.depsTail=t):we.deps=we.depsTail=t,Cm(t);else if(t.version===-1&&(t.version=this.version,t.nextDep)){const r=t.nextDep;r.prevDep=t.prevDep,t.prevDep&&(t.prevDep.nextDep=r),t.prevDep=we.depsTail,t.nextDep=void 0,we.depsTail.nextDep=t,we.depsTail=t,we.deps===t&&(we.deps=r)}return process.env.NODE_ENV!=="production"&&we.onTrack&&we.onTrack(or({effect:we},e)),t}trigger(e){this.version++,ds++,this.notify(e)}notify(e){gc();try{if(process.env.NODE_ENV!=="production")for(let t=this.subsHead;t;t=t.nextSub)t.sub.onTrigger&&!(t.sub.flags&8)&&t.sub.onTrigger(or({effect:t.sub},e));for(let t=this.subs;t;t=t.prevSub)t.sub.notify()&&t.sub.dep.notify()}finally{yc()}}}function Cm(n){if(n.dep.sc++,n.sub.flags&4){const e=n.dep.computed;if(e&&!n.dep.subs){e.flags|=20;for(let r=e.deps;r;r=r.nextDep)Cm(r)}const t=n.dep.subs;t!==n&&(n.prevSub=t,t&&(t.nextSub=n)),process.env.NODE_ENV!=="production"&&n.dep.subsHead===void 0&&(n.dep.subsHead=n),n.dep.subs=n}}const Zo=new WeakMap,Dr=Symbol(process.env.NODE_ENV!=="production"?"Object iterate":""),vc=Symbol(process.env.NODE_ENV!=="production"?"Map keys iterate":""),ps=Symbol(process.env.NODE_ENV!=="production"?"Array iterate":"");function yt(n,e,t){if(sn&&we){let r=Zo.get(n);r||Zo.set(n,r=new Map);let i=r.get(t);i||(r.set(t,i=new wc),i.map=r,i.key=t),process.env.NODE_ENV!=="production"?i.track({target:n,type:e,key:t}):i.track()}}function lr(n,e,t,r,i,s){const a=Zo.get(n);if(!a){ds++;return}const u=c=>{c&&(process.env.NODE_ENV!=="production"?c.trigger({target:n,type:e,key:t,newValue:r,oldValue:i,oldTarget:s}):c.trigger())};if(gc(),e==="clear")a.forEach(u);else{const c=Fe(n),h=c&&hc(t);if(c&&t==="length"){const p=Number(r);a.forEach((m,y)=>{(y==="length"||y===ps||!cs(y)&&y>=p)&&u(m)})}else switch((t!==void 0||a.has(void 0))&&u(a.get(t)),h&&u(a.get(ps)),e){case"add":c?h&&u(a.get("length")):(u(a.get(Dr)),mi(n)&&u(a.get(vc)));break;case"delete":c||(u(a.get(Dr)),mi(n)&&u(a.get(vc)));break;case"set":mi(n)&&u(a.get(Dr));break}}yc()}function oE(n,e){const t=Zo.get(n);return t&&t.get(e)}function gi(n){const e=he(n);return e===n?e:(yt(e,"iterate",ps),bt(n)?e:e.map(at))}function Sc(n){return yt(n=he(n),"iterate",ps),n}const aE={__proto__:null,[Symbol.iterator](){return xc(this,Symbol.iterator,at)},concat(...n){return gi(this).concat(...n.map(e=>Fe(e)?gi(e):e))},entries(){return xc(this,"entries",n=>(n[1]=at(n[1]),n))},every(n,e){return Dn(this,"every",n,e,void 0,arguments)},filter(n,e){return Dn(this,"filter",n,e,t=>t.map(at),arguments)},find(n,e){return Dn(this,"find",n,e,at,arguments)},findIndex(n,e){return Dn(this,"findIndex",n,e,void 0,arguments)},findLast(n,e){return Dn(this,"findLast",n,e,at,arguments)},findLastIndex(n,e){return Dn(this,"findLastIndex",n,e,void 0,arguments)},forEach(n,e){return Dn(this,"forEach",n,e,void 0,arguments)},includes(...n){return Cc(this,"includes",n)},indexOf(...n){return Cc(this,"indexOf",n)},join(n){return gi(this).join(n)},lastIndexOf(...n){return Cc(this,"lastIndexOf",n)},map(n,e){return Dn(this,"map",n,e,void 0,arguments)},pop(){return ms(this,"pop")},push(...n){return ms(this,"push",n)},reduce(n,...e){return Em(this,"reduce",n,e)},reduceRight(n,...e){return Em(this,"reduceRight",n,e)},shift(){return ms(this,"shift")},some(n,e){return Dn(this,"some",n,e,void 0,arguments)},splice(...n){return ms(this,"splice",n)},toReversed(){return gi(this).toReversed()},toSorted(n){return gi(this).toSorted(n)},toSpliced(...n){return gi(this).toSpliced(...n)},unshift(...n){return ms(this,"unshift",n)},values(){return xc(this,"values",at)}};function xc(n,e,t){const r=Sc(n),i=r[e]();return r!==n&&!bt(n)&&(i._next=i.next,i.next=()=>{const s=i._next();return s.value&&(s.value=t(s.value)),s}),i}const lE=Array.prototype;function Dn(n,e,t,r,i,s){const a=Sc(n),u=a!==n&&!bt(n),c=a[e];if(c!==lE[e]){const m=c.apply(n,s);return u?at(m):m}let h=t;a!==n&&(u?h=function(m,y){return t.call(this,at(m),y,n)}:t.length>2&&(h=function(m,y){return t.call(this,m,y,n)}));const p=c.call(a,h,r);return u&&i?i(p):p}function Em(n,e,t,r){const i=Sc(n);let s=t;return i!==n&&(bt(n)?t.length>3&&(s=function(a,u,c){return t.call(this,a,u,c,n)}):s=function(a,u,c){return t.call(this,a,at(u),c,n)}),i[e](s,...r)}function Cc(n,e,t){const r=he(n);yt(r,"iterate",ps);const i=r[e](...t);return(i===-1||i===!1)&&ta(t[0])?(t[0]=he(t[0]),r[e](...t)):i}function ms(n,e,t=[]){Yo(),gc();const r=he(n)[e].apply(n,t);return yc(),Xo(),r}const uE=UC("__proto__,__v_isRef,__isVue"),km=new Set(Object.getOwnPropertyNames(Symbol).filter(n=>n!=="arguments"&&n!=="caller").map(n=>Symbol[n]).filter(cs));function cE(n){cs(n)||(n=String(n));const e=he(this);return yt(e,"has",n),e.hasOwnProperty(n)}class Am{constructor(e=!1,t=!1){this._isReadonly=e,this._isShallow=t}get(e,t,r){if(t==="__v_skip")return e.__v_skip;const i=this._isReadonly,s=this._isShallow;if(t==="__v_isReactive")return!i;if(t==="__v_isReadonly")return i;if(t==="__v_isShallow")return s;if(t==="__v_raw")return r===(i?s?wE:Im:s?_E:Mm).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(r)?e:void 0;const a=Fe(e);if(!i){let c;if(a&&(c=aE[t]))return c;if(t==="hasOwnProperty")return cE}const u=Reflect.get(e,t,lt(e)?e:r);return(cs(t)?km.has(t):uE(t))||(i||yt(e,"get",t),s)?u:lt(u)?a&&hc(t)?u:u.value:gt(u)?i?Nm(u):kc(u):u}}class fE extends Am{constructor(e=!1){super(!1,e)}set(e,t,r,i){let s=e[t];if(!this._isShallow){const c=Fn(s);if(!bt(r)&&!Fn(r)&&(s=he(s),r=he(r)),!Fe(e)&<(s)&&!lt(r))return c?!1:(s.value=r,!0)}const a=Fe(e)&&hc(t)?Number(t)<e.length:fc(e,t),u=Reflect.set(e,t,r,lt(e)?e:i);return e===he(i)&&(a?ar(r,s)&&lr(e,"set",t,r,s):lr(e,"add",t,r)),u}deleteProperty(e,t){const r=fc(e,t),i=e[t],s=Reflect.deleteProperty(e,t);return s&&r&&lr(e,"delete",t,void 0,i),s}has(e,t){const r=Reflect.has(e,t);return(!cs(t)||!km.has(t))&&yt(e,"has",t),r}ownKeys(e){return yt(e,"iterate",Fe(e)?"length":Dr),Reflect.ownKeys(e)}}class hE extends Am{constructor(e=!1){super(!0,e)}set(e,t){return process.env.NODE_ENV!=="production"&&Pn(`Set operation on key "${String(t)}" failed: target is readonly.`,e),!0}deleteProperty(e,t){return process.env.NODE_ENV!=="production"&&Pn(`Delete operation on key "${String(t)}" failed: target is readonly.`,e),!0}}const dE=new fE,pE=new hE,Ec=n=>n,Qo=n=>Reflect.getPrototypeOf(n);function mE(n,e,t){return function(...r){const i=this.__v_raw,s=he(i),a=mi(s),u=n==="entries"||n===Symbol.iterator&&a,c=n==="keys"&&a,h=i[n](...r),p=t?Ec:e?Ac:at;return!e&&yt(s,"iterate",c?vc:Dr),{next(){const{value:m,done:y}=h.next();return y?{value:m,done:y}:{value:u?[p(m[0]),p(m[1])]:p(m),done:y}},[Symbol.iterator](){return this}}}}function ea(n){return function(...e){if(process.env.NODE_ENV!=="production"){const t=e[0]?`on key "${e[0]}" `:"";Pn(`${ZC(n)} operation ${t}failed: target is readonly.`,he(this))}return n==="delete"?!1:n==="clear"?void 0:this}}function gE(n,e){const t={get(i){const s=this.__v_raw,a=he(s),u=he(i);n||(ar(i,u)&&yt(a,"get",i),yt(a,"get",u));const{has:c}=Qo(a),h=e?Ec:n?Ac:at;if(c.call(a,i))return h(s.get(i));if(c.call(a,u))return h(s.get(u));s!==a&&s.get(i)},get size(){const i=this.__v_raw;return!n&&yt(he(i),"iterate",Dr),Reflect.get(i,"size",i)},has(i){const s=this.__v_raw,a=he(s),u=he(i);return n||(ar(i,u)&&yt(a,"has",i),yt(a,"has",u)),i===u?s.has(i):s.has(i)||s.has(u)},forEach(i,s){const a=this,u=a.__v_raw,c=he(u),h=e?Ec:n?Ac:at;return!n&&yt(c,"iterate",Dr),u.forEach((p,m)=>i.call(s,h(p),h(m),a))}};return or(t,n?{add:ea("add"),set:ea("set"),delete:ea("delete"),clear:ea("clear")}:{add(i){!e&&!bt(i)&&!Fn(i)&&(i=he(i));const s=he(this);return Qo(s).has.call(s,i)||(s.add(i),lr(s,"add",i,i)),this},set(i,s){!e&&!bt(s)&&!Fn(s)&&(s=he(s));const a=he(this),{has:u,get:c}=Qo(a);let h=u.call(a,i);h?process.env.NODE_ENV!=="production"&&Om(a,u,i):(i=he(i),h=u.call(a,i));const p=c.call(a,i);return a.set(i,s),h?ar(s,p)&&lr(a,"set",i,s,p):lr(a,"add",i,s),this},delete(i){const s=he(this),{has:a,get:u}=Qo(s);let c=a.call(s,i);c?process.env.NODE_ENV!=="production"&&Om(s,a,i):(i=he(i),c=a.call(s,i));const h=u?u.call(s,i):void 0,p=s.delete(i);return c&&lr(s,"delete",i,void 0,h),p},clear(){const i=he(this),s=i.size!==0,a=process.env.NODE_ENV!=="production"?mi(i)?new Map(i):new Set(i):void 0,u=i.clear();return s&&lr(i,"clear",void 0,void 0,a),u}}),["keys","values","entries",Symbol.iterator].forEach(i=>{t[i]=mE(i,n,e)}),t}function Tm(n,e){const t=gE(n,e);return(r,i,s)=>i==="__v_isReactive"?!n:i==="__v_isReadonly"?n:i==="__v_raw"?r:Reflect.get(fc(t,i)&&i in r?t:r,i,s)}const yE={get:Tm(!1,!1)},bE={get:Tm(!0,!1)};function Om(n,e,t){const r=he(t);if(r!==t&&e.call(n,r)){const i=mm(n);Pn(`Reactive ${i} contains both the raw and reactive versions of the same object${i==="Map"?" as keys":""}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`)}}const Mm=new WeakMap,_E=new WeakMap,Im=new WeakMap,wE=new WeakMap;function vE(n){switch(n){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function SE(n){return n.__v_skip||!Object.isExtensible(n)?0:vE(mm(n))}function kc(n){return Fn(n)?n:Rm(n,!1,dE,yE,Mm)}function Nm(n){return Rm(n,!0,pE,bE,Im)}function Rm(n,e,t,r,i){if(!gt(n))return process.env.NODE_ENV!=="production"&&Pn(`value cannot be made ${e?"readonly":"reactive"}: ${String(n)}`),n;if(n.__v_raw&&!(e&&n.__v_isReactive))return n;const s=i.get(n);if(s)return s;const a=SE(n);if(a===0)return n;const u=new Proxy(n,a===2?r:t);return i.set(n,u),u}function gs(n){return Fn(n)?gs(n.__v_raw):!!(n&&n.__v_isReactive)}function Fn(n){return!!(n&&n.__v_isReadonly)}function bt(n){return!!(n&&n.__v_isShallow)}function ta(n){return n?!!n.__v_raw:!1}function he(n){const e=n&&n.__v_raw;return e?he(e):n}const at=n=>gt(n)?kc(n):n,Ac=n=>gt(n)?Nm(n):n;function lt(n){return n?n.__v_isRef===!0:!1}function na(n){return xE(n,!1)}function xE(n,e){return lt(n)?n:new CE(n,e)}class CE{constructor(e,t){this.dep=new wc,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=t?e:he(e),this._value=t?e:at(e),this.__v_isShallow=t}get value(){return process.env.NODE_ENV!=="production"?this.dep.track({target:this,type:"get",key:"value"}):this.dep.track(),this._value}set value(e){const t=this._rawValue,r=this.__v_isShallow||bt(e)||Fn(e);e=r?e:he(e),ar(e,t)&&(this._rawValue=e,this._value=r?e:at(e),process.env.NODE_ENV!=="production"?this.dep.trigger({target:this,type:"set",key:"value",newValue:e,oldValue:t}):this.dep.trigger())}}function V(n){return lt(n)?n.value:n}class EE{constructor(e,t,r){this._object=e,this._key=t,this._defaultValue=r,this.__v_isRef=!0,this._value=void 0}get value(){const e=this._object[this._key];return this._value=e===void 0?this._defaultValue:e}set value(e){this._object[this._key]=e}get dep(){return oE(he(this._object),this._key)}}class kE{constructor(e){this._getter=e,this.__v_isRef=!0,this.__v_isReadonly=!0,this._value=void 0}get value(){return this._value=this._getter()}}function yi(n,e,t){return lt(n)?n:Qe(n)?new kE(n):gt(n)&&arguments.length>1?AE(n,e,t):na(n)}function AE(n,e,t){const r=n[e];return lt(r)?r:new EE(n,e,t)}class TE{constructor(e,t,r){this.fn=e,this.setter=t,this._value=void 0,this.dep=new wc(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=ds-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!t,this.isSSR=r}notify(){if(this.flags|=16,!(this.flags&8)&&we!==this)return bm(this,!0),!0;process.env.NODE_ENV}get value(){const e=process.env.NODE_ENV!=="production"?this.dep.track({target:this,type:"get",key:"value"}):this.dep.track();return vm(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter?this.setter(e):process.env.NODE_ENV!=="production"&&Pn("Write operation failed: computed value is readonly")}}function OE(n,e,t=!1){let r,i;Qe(n)?r=n:(r=n.get,i=n.set);const s=new TE(r,i,t);return process.env.NODE_ENV,s}const ra={},ia=new WeakMap;let Fr;function ME(n,e=!1,t=Fr){if(t){let r=ia.get(t);r||ia.set(t,r=[]),r.push(n)}else process.env.NODE_ENV!=="production"&&!e&&Pn("onWatcherCleanup() was called when there was no active watcher to associate with.")}function IE(n,e,t=us){const{immediate:r,deep:i,once:s,scheduler:a,augmentJob:u,call:c}=t,h=A=>{(t.onWarn||Pn)("Invalid watch source: ",A,"A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.")},p=A=>i?A:bt(A)||i===!1||i===0?ur(A,1):ur(A);let m,y,_,S,E=!1,N=!1;if(lt(n)?(y=()=>n.value,E=bt(n)):gs(n)?(y=()=>p(n),E=!0):Fe(n)?(N=!0,E=n.some(A=>gs(A)||bt(A)),y=()=>n.map(A=>{if(lt(A))return A.value;if(gs(A))return p(A);if(Qe(A))return c?c(A,2):A();process.env.NODE_ENV!=="production"&&h(A)})):Qe(n)?e?y=c?()=>c(n,2):n:y=()=>{if(_){Yo();try{_()}finally{Xo()}}const A=Fr;Fr=m;try{return c?c(n,3,[S]):n(S)}finally{Fr=A}}:(y=pi,process.env.NODE_ENV!=="production"&&h(n)),e&&i){const A=y,T=i===!0?1/0:i;y=()=>ur(A(),T)}const g=()=>{m.stop()};if(s&&e){const A=e;e=(...T)=>{A(...T),g()}}let v=N?new Array(n.length).fill(ra):ra;const k=A=>{if(!(!(m.flags&1)||!m.dirty&&!A))if(e){const T=m.run();if(i||E||(N?T.some((F,U)=>ar(F,v[U])):ar(T,v))){_&&_();const F=Fr;Fr=m;try{const U=[T,v===ra?void 0:N&&v[0]===ra?[]:v,S];c?c(e,3,U):e(...U),v=T}finally{Fr=F}}}else m.run()};return u&&u(k),m=new rE(y),m.scheduler=a?()=>a(k,!1):k,S=A=>ME(A,!1,m),_=m.onStop=()=>{const A=ia.get(m);if(A){if(c)c(A,4);else for(const T of A)T();ia.delete(m)}},process.env.NODE_ENV!=="production"&&(m.onTrack=t.onTrack,m.onTrigger=t.onTrigger),e?r?k(!0):v=m.run():a?a(k.bind(null,!0),!0):m.run(),g.pause=m.pause.bind(m),g.resume=m.resume.bind(m),g.stop=g,g}function ur(n,e=1/0,t){if(e<=0||!gt(n)||n.__v_skip||(t=t||new Set,t.has(n)))return n;if(t.add(n),e--,lt(n))ur(n.value,e,t);else if(Fe(n))for(let r=0;r<n.length;r++)ur(n[r],e,t);else if(GC(n)||mi(n))n.forEach(r=>{ur(r,e,t)});else if(YC(n)){for(const r in n)ur(n[r],e,t);for(const r of Object.getOwnPropertySymbols(n))Object.prototype.propertyIsEnumerable.call(n,r)&&ur(n[r],e,t)}return n}const Br=[];function NE(n){Br.push(n)}function RE(){Br.pop()}let Tc=!1;function ut(n,...e){if(Tc)return;Tc=!0,Yo();const t=Br.length?Br[Br.length-1].component:null,r=t&&t.appContext.config.warnHandler,i=LE();if(r)sa(r,t,11,[n+e.map(s=>{var a,u;return(u=(a=s.toString)==null?void 0:a.call(s))!=null?u:JSON.stringify(s)}).join(""),t&&t.proxy,i.map(({vnode:s})=>`at <${Xm(t,s.type)}>`).join(`
|
|
23
|
+
`),this.outputHelp({error:!0}));const k=S||{},T=k.exitCode||1,A=k.code||"commander.error";this._exit(T,A,g)}_parseOptionsEnv(){this.options.forEach(g=>{if(g.envVar&&g.envVar in i.env){const S=g.attributeName();(this.getOptionValue(S)===void 0||["default","config","env"].includes(this.getOptionValueSource(S)))&&(g.required||g.optional?this.emit(`optionEnv:${g.name()}`,i.env[g.envVar]):this.emit(`optionEnv:${g.name()}`))}})}_parseOptionsImplied(){const g=new d(this.options),S=k=>this.getOptionValue(k)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(k));this.options.filter(k=>k.implied!==void 0&&S(k.attributeName())&&g.valueFromOption(this.getOptionValue(k.attributeName()),k)).forEach(k=>{Object.keys(k.implied).filter(T=>!S(T)).forEach(T=>{this.setOptionValueWithSource(T,k.implied[T],"implied")})})}missingArgument(g){const S=`error: missing required argument '${g}'`;this.error(S,{code:"commander.missingArgument"})}optionMissingArgument(g){const S=`error: option '${g.flags}' argument missing`;this.error(S,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(g){const S=`error: required option '${g.flags}' not specified`;this.error(S,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(g,S){const k=$=>{const U=$.attributeName(),z=this.getOptionValue(U),ee=this.options.find(Se=>Se.negate&&U===Se.attributeName()),te=this.options.find(Se=>!Se.negate&&U===Se.attributeName());return ee&&(ee.presetArg===void 0&&z===!1||ee.presetArg!==void 0&&z===ee.presetArg)?ee:te||$},T=$=>{const U=k($),z=U.attributeName();return this.getOptionValueSource(z)==="env"?`environment variable '${U.envVar}'`:`option '${U.flags}'`},A=`error: ${T(g)} cannot be used with ${T(S)}`;this.error(A,{code:"commander.conflictingOption"})}unknownOption(g){if(this._allowUnknownOption)return;let S="";if(g.startsWith("--")&&this._showSuggestionAfterError){let T=[],A=this;do{const $=A.createHelp().visibleOptions(A).filter(U=>U.long).map(U=>U.long);T=T.concat($),A=A.parent}while(A&&!A._enablePositionalOptions);S=y(g,T)}const k=`error: unknown option '${g}'${S}`;this.error(k,{code:"commander.unknownOption"})}_excessArguments(g){if(this._allowExcessArguments)return;const S=this.registeredArguments.length,k=S===1?"":"s",A=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${S} argument${k} but got ${g.length}.`;this.error(A,{code:"commander.excessArguments"})}unknownCommand(){const g=this.args[0];let S="";if(this._showSuggestionAfterError){const T=[];this.createHelp().visibleCommands(this).forEach(A=>{T.push(A.name()),A.alias()&&T.push(A.alias())}),S=y(g,T)}const k=`error: unknown command '${g}'${S}`;this.error(k,{code:"commander.unknownCommand"})}version(g,S,k){if(g===void 0)return this._version;this._version=g,S=S||"-V, --version",k=k||"output the version number";const T=this.createOption(S,k);return this._versionOptionName=T.attributeName(),this._registerOption(T),this.on("option:"+T.name(),()=>{this._outputConfiguration.writeOut(`${g}
|
|
24
|
+
`),this._exit(0,"commander.version",g)}),this}description(g,S){return g===void 0&&S===void 0?this._description:(this._description=g,S&&(this._argsDescription=S),this)}summary(g){return g===void 0?this._summary:(this._summary=g,this)}alias(g){if(g===void 0)return this._aliases[0];let S=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(S=this.commands[this.commands.length-1]),g===S._name)throw new Error("Command alias can't be the same as its name");const k=this.parent?._findCommand(g);if(k){const T=[k.name()].concat(k.aliases()).join("|");throw new Error(`cannot add alias '${g}' to command '${this.name()}' as already have command '${T}'`)}return S._aliases.push(g),this}aliases(g){return g===void 0?this._aliases:(g.forEach(S=>this.alias(S)),this)}usage(g){if(g===void 0){if(this._usage)return this._usage;const S=this.registeredArguments.map(k=>a(k));return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?S:[]).join(" ")}return this._usage=g,this}name(g){return g===void 0?this._name:(this._name=g,this)}nameFromFilename(g){return this._name=t.basename(g,t.extname(g)),this}executableDir(g){return g===void 0?this._executableDir:(this._executableDir=g,this)}helpInformation(g){const S=this.createHelp(),k=this._getOutputContext(g);S.prepareContext({error:k.error,helpWidth:k.helpWidth,outputHasColors:k.hasColors});const T=S.formatHelp(this,S);return k.hasColors?T:this._outputConfiguration.stripColor(T)}_getOutputContext(g){g=g||{};const S=!!g.error;let k,T,A;return S?(k=U=>this._outputConfiguration.writeErr(U),T=this._outputConfiguration.getErrHasColors(),A=this._outputConfiguration.getErrHelpWidth()):(k=U=>this._outputConfiguration.writeOut(U),T=this._outputConfiguration.getOutHasColors(),A=this._outputConfiguration.getOutHelpWidth()),{error:S,write:U=>(T||(U=this._outputConfiguration.stripColor(U)),k(U)),hasColors:T,helpWidth:A}}outputHelp(g){let S;typeof g=="function"&&(S=g,g=void 0);const k=this._getOutputContext(g),T={error:k.error,write:k.write,command:this};this._getCommandAndAncestors().reverse().forEach($=>$.emit("beforeAllHelp",T)),this.emit("beforeHelp",T);let A=this.helpInformation({error:k.error});if(S&&(A=S(A),typeof A!="string"&&!Buffer.isBuffer(A)))throw new Error("outputHelp callback must return a string or a Buffer");k.write(A),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit("afterHelp",T),this._getCommandAndAncestors().forEach($=>$.emit("afterAllHelp",T))}helpOption(g,S){return typeof g=="boolean"?(g?this._helpOption=this._helpOption??void 0:this._helpOption=null,this):(g=g??"-h, --help",S=S??"display help for command",this._helpOption=this.createOption(g,S),this)}_getHelpOption(){return this._helpOption===void 0&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(g){return this._helpOption=g,this}help(g){this.outputHelp(g);let S=Number(i.exitCode??0);S===0&&g&&typeof g!="function"&&g.error&&(S=1),this._exit(S,"commander.help","(outputHelp)")}addHelpText(g,S){const k=["beforeAll","before","after","afterAll"];if(!k.includes(g))throw new Error(`Unexpected value for position to addHelpText.
|
|
25
|
+
Expecting one of '${k.join("', '")}'`);const T=`${g}Help`;return this.on(T,A=>{let $;typeof S=="function"?$=S({error:A.error,command:A.command}):$=S,$&&A.write(`${$}
|
|
26
|
+
`)}),this}_outputHelpIfRequested(g){const S=this._getHelpOption();S&&g.find(T=>S.is(T))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}}function v(N){return N.map(g=>{if(!g.startsWith("--inspect"))return g;let S,k="127.0.0.1",T="9229",A;return(A=g.match(/^(--inspect(-brk)?)$/))!==null?S=A[1]:(A=g.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(S=A[1],/^\d+$/.test(A[3])?T=A[3]:k=A[3]):(A=g.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(S=A[1],k=A[3],T=A[4]),S&&T!=="0"?`${S}=${k}:${parseInt(T)+1}`:g})}function E(){if(i.env.NO_COLOR||i.env.FORCE_COLOR==="0"||i.env.FORCE_COLOR==="false")return!1;if(i.env.FORCE_COLOR||i.env.CLICOLOR_FORCE!==void 0)return!0}return oa.Command=_,oa.useColor=E,oa}var Ym;function WC(){if(Ym)return Mt;Ym=1;const{Argument:n}=Nc(),{Command:e}=HC(),{CommanderError:t,InvalidArgumentError:r}=sa(),{Help:i}=qm(),{Option:s}=Gm();return Mt.program=new e,Mt.createCommand=a=>new e(a),Mt.createOption=(a,u)=>new s(a,u),Mt.createArgument=(a,u)=>new n(a,u),Mt.Command=e,Mt.Option=s,Mt.Argument=n,Mt.Help=i,Mt.CommanderError=t,Mt.InvalidArgumentError=r,Mt.InvalidOptionArgumentError=r,Mt}var VC=WC(),UC=BC(VC);const{program:mL,createCommand:gL,createArgument:yL,createOption:bL,CommanderError:_L,InvalidArgumentError:wL,InvalidOptionArgumentError:vL,Command:qC,Argument:SL,Option:xL,Help:EL}=UC;function KC(n){const e=Object.create(null);for(const t of n.split(","))e[t]=1;return t=>t in e}const xs=process.env.NODE_ENV!=="production"?Object.freeze({}):{};process.env.NODE_ENV!=="production"&&Object.freeze([]);const Ei=()=>{},GC=n=>n.charCodeAt(0)===111&&n.charCodeAt(1)===110&&(n.charCodeAt(2)>122||n.charCodeAt(2)<97),cr=Object.assign,JC=Object.prototype.hasOwnProperty,Lc=(n,e)=>JC.call(n,e),$e=Array.isArray,Ci=n=>ua(n)==="[object Map]",jC=n=>ua(n)==="[object Set]",Qe=n=>typeof n=="function",$n=n=>typeof n=="string",Es=n=>typeof n=="symbol",yt=n=>n!==null&&typeof n=="object",YC=n=>(yt(n)||Qe(n))&&Qe(n.then)&&Qe(n.catch),XC=Object.prototype.toString,ua=n=>XC.call(n),Xm=n=>ua(n).slice(8,-1),ZC=n=>ua(n)==="[object Object]",Pc=n=>$n(n)&&n!=="NaN"&&n[0]!=="-"&&""+parseInt(n,10)===n,QC=n=>{const e=Object.create(null);return t=>e[t]||(e[t]=n(t))},ek=QC(n=>n.charAt(0).toUpperCase()+n.slice(1)),fr=(n,e)=>!Object.is(n,e);let Zm;const ca=()=>Zm||(Zm=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Dc(n){if($e(n)){const e={};for(let t=0;t<n.length;t++){const r=n[t],i=$n(r)?ik(r):Dc(r);if(i)for(const s in i)e[s]=i[s]}return e}else if($n(n)||yt(n))return n}const tk=/;(?![^(]*\))/g,nk=/:([^]+)/,rk=/\/\*[^]*?\*\//g;function ik(n){const e={};return n.replace(rk,"").split(tk).forEach(t=>{if(t){const r=t.split(nk);r.length>1&&(e[r[0].trim()]=r[1].trim())}}),e}function $c(n){let e="";if($n(n))e=n;else if($e(n))for(let t=0;t<n.length;t++){const r=$c(n[t]);r&&(e+=r+" ")}else if(yt(n))for(const t in n)n[t]&&(e+=t+" ");return e.trim()}function Fn(n,...e){console.warn(`[Vue warn] ${n}`,...e)}let we;const Fc=new WeakSet;class sk{constructor(e){this.fn=e,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,Fc.has(this)&&(Fc.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||eg(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,sg(this),tg(this);const e=we,t=an;we=this,an=!0;try{return this.fn()}finally{process.env.NODE_ENV!=="production"&&we!==this&&Fn("Active effect was not restored correctly - this is likely a Vue internal bug."),ng(this),we=e,an=t,this.flags&=-3}}stop(){if(this.flags&1){for(let e=this.deps;e;e=e.nextDep)Wc(e);this.deps=this.depsTail=void 0,sg(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?Fc.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){Hc(this)&&this.run()}get dirty(){return Hc(this)}}let Qm=0,Cs,ks;function eg(n,e=!1){if(n.flags|=8,e){n.next=ks,ks=n;return}n.next=Cs,Cs=n}function Bc(){Qm++}function zc(){if(--Qm>0)return;if(ks){let e=ks;for(ks=void 0;e;){const t=e.next;e.next=void 0,e.flags&=-9,e=t}}let n;for(;Cs;){let e=Cs;for(Cs=void 0;e;){const t=e.next;if(e.next=void 0,e.flags&=-9,e.flags&1)try{e.trigger()}catch(r){n||(n=r)}e=t}}if(n)throw n}function tg(n){for(let e=n.deps;e;e=e.nextDep)e.version=-1,e.prevActiveLink=e.dep.activeLink,e.dep.activeLink=e}function ng(n){let e,t=n.depsTail,r=t;for(;r;){const i=r.prevDep;r.version===-1?(r===t&&(t=i),Wc(r),ok(r)):e=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=i}n.deps=e,n.depsTail=t}function Hc(n){for(let e=n.deps;e;e=e.nextDep)if(e.dep.version!==e.version||e.dep.computed&&(rg(e.dep.computed)||e.dep.version!==e.version))return!0;return!!n._dirty}function rg(n){if(n.flags&4&&!(n.flags&16)||(n.flags&=-17,n.globalVersion===Ts))return;n.globalVersion=Ts;const e=n.dep;if(n.flags|=2,e.version>0&&!n.isSSR&&n.deps&&!Hc(n)){n.flags&=-3;return}const t=we,r=an;we=n,an=!0;try{tg(n);const i=n.fn(n._value);(e.version===0||fr(i,n._value))&&(n._value=i,e.version++)}catch(i){throw e.version++,i}finally{we=t,an=r,ng(n),n.flags&=-3}}function Wc(n,e=!1){const{dep:t,prevSub:r,nextSub:i}=n;if(r&&(r.nextSub=i,n.prevSub=void 0),i&&(i.prevSub=r,n.nextSub=void 0),process.env.NODE_ENV!=="production"&&t.subsHead===n&&(t.subsHead=i),t.subs===n&&(t.subs=r,!r&&t.computed)){t.computed.flags&=-5;for(let s=t.computed.deps;s;s=s.nextDep)Wc(s,!0)}!e&&!--t.sc&&t.map&&t.map.delete(t.key)}function ok(n){const{prevDep:e,nextDep:t}=n;e&&(e.nextDep=t,n.prevDep=void 0),t&&(t.prevDep=e,n.nextDep=void 0)}let an=!0;const ig=[];function fa(){ig.push(an),an=!1}function ha(){const n=ig.pop();an=n===void 0?!0:n}function sg(n){const{cleanup:e}=n;if(n.cleanup=void 0,e){const t=we;we=void 0;try{e()}finally{we=t}}}let Ts=0,ak=class{constructor(e,t){this.sub=e,this.dep=t,this.version=t.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}};class Vc{constructor(e){this.computed=e,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,process.env.NODE_ENV!=="production"&&(this.subsHead=void 0)}track(e){if(!we||!an||we===this.computed)return;let t=this.activeLink;if(t===void 0||t.sub!==we)t=this.activeLink=new ak(we,this),we.deps?(t.prevDep=we.depsTail,we.depsTail.nextDep=t,we.depsTail=t):we.deps=we.depsTail=t,og(t);else if(t.version===-1&&(t.version=this.version,t.nextDep)){const r=t.nextDep;r.prevDep=t.prevDep,t.prevDep&&(t.prevDep.nextDep=r),t.prevDep=we.depsTail,t.nextDep=void 0,we.depsTail.nextDep=t,we.depsTail=t,we.deps===t&&(we.deps=r)}return process.env.NODE_ENV!=="production"&&we.onTrack&&we.onTrack(cr({effect:we},e)),t}trigger(e){this.version++,Ts++,this.notify(e)}notify(e){Bc();try{if(process.env.NODE_ENV!=="production")for(let t=this.subsHead;t;t=t.nextSub)t.sub.onTrigger&&!(t.sub.flags&8)&&t.sub.onTrigger(cr({effect:t.sub},e));for(let t=this.subs;t;t=t.prevSub)t.sub.notify()&&t.sub.dep.notify()}finally{zc()}}}function og(n){if(n.dep.sc++,n.sub.flags&4){const e=n.dep.computed;if(e&&!n.dep.subs){e.flags|=20;for(let r=e.deps;r;r=r.nextDep)og(r)}const t=n.dep.subs;t!==n&&(n.prevSub=t,t&&(t.nextSub=n)),process.env.NODE_ENV!=="production"&&n.dep.subsHead===void 0&&(n.dep.subsHead=n),n.dep.subs=n}}const da=new WeakMap,Wr=Symbol(process.env.NODE_ENV!=="production"?"Object iterate":""),Uc=Symbol(process.env.NODE_ENV!=="production"?"Map keys iterate":""),As=Symbol(process.env.NODE_ENV!=="production"?"Array iterate":"");function bt(n,e,t){if(an&&we){let r=da.get(n);r||da.set(n,r=new Map);let i=r.get(t);i||(r.set(t,i=new Vc),i.map=r,i.key=t),process.env.NODE_ENV!=="production"?i.track({target:n,type:e,key:t}):i.track()}}function hr(n,e,t,r,i,s){const a=da.get(n);if(!a){Ts++;return}const u=c=>{c&&(process.env.NODE_ENV!=="production"?c.trigger({target:n,type:e,key:t,newValue:r,oldValue:i,oldTarget:s}):c.trigger())};if(Bc(),e==="clear")a.forEach(u);else{const c=$e(n),h=c&&Pc(t);if(c&&t==="length"){const m=Number(r);a.forEach((d,y)=>{(y==="length"||y===As||!Es(y)&&y>=m)&&u(d)})}else switch((t!==void 0||a.has(void 0))&&u(a.get(t)),h&&u(a.get(As)),e){case"add":c?h&&u(a.get("length")):(u(a.get(Wr)),Ci(n)&&u(a.get(Uc)));break;case"delete":c||(u(a.get(Wr)),Ci(n)&&u(a.get(Uc)));break;case"set":Ci(n)&&u(a.get(Wr));break}}zc()}function lk(n,e){const t=da.get(n);return t&&t.get(e)}function ki(n){const e=he(n);return e===n?e:(bt(e,"iterate",As),_t(n)?e:e.map(at))}function qc(n){return bt(n=he(n),"iterate",As),n}const uk={__proto__:null,[Symbol.iterator](){return Kc(this,Symbol.iterator,at)},concat(...n){return ki(this).concat(...n.map(e=>$e(e)?ki(e):e))},entries(){return Kc(this,"entries",n=>(n[1]=at(n[1]),n))},every(n,e){return Bn(this,"every",n,e,void 0,arguments)},filter(n,e){return Bn(this,"filter",n,e,t=>t.map(at),arguments)},find(n,e){return Bn(this,"find",n,e,at,arguments)},findIndex(n,e){return Bn(this,"findIndex",n,e,void 0,arguments)},findLast(n,e){return Bn(this,"findLast",n,e,at,arguments)},findLastIndex(n,e){return Bn(this,"findLastIndex",n,e,void 0,arguments)},forEach(n,e){return Bn(this,"forEach",n,e,void 0,arguments)},includes(...n){return Gc(this,"includes",n)},indexOf(...n){return Gc(this,"indexOf",n)},join(n){return ki(this).join(n)},lastIndexOf(...n){return Gc(this,"lastIndexOf",n)},map(n,e){return Bn(this,"map",n,e,void 0,arguments)},pop(){return Os(this,"pop")},push(...n){return Os(this,"push",n)},reduce(n,...e){return ag(this,"reduce",n,e)},reduceRight(n,...e){return ag(this,"reduceRight",n,e)},shift(){return Os(this,"shift")},some(n,e){return Bn(this,"some",n,e,void 0,arguments)},splice(...n){return Os(this,"splice",n)},toReversed(){return ki(this).toReversed()},toSorted(n){return ki(this).toSorted(n)},toSpliced(...n){return ki(this).toSpliced(...n)},unshift(...n){return Os(this,"unshift",n)},values(){return Kc(this,"values",at)}};function Kc(n,e,t){const r=qc(n),i=r[e]();return r!==n&&!_t(n)&&(i._next=i.next,i.next=()=>{const s=i._next();return s.value&&(s.value=t(s.value)),s}),i}const ck=Array.prototype;function Bn(n,e,t,r,i,s){const a=qc(n),u=a!==n&&!_t(n),c=a[e];if(c!==ck[e]){const d=c.apply(n,s);return u?at(d):d}let h=t;a!==n&&(u?h=function(d,y){return t.call(this,at(d),y,n)}:t.length>2&&(h=function(d,y){return t.call(this,d,y,n)}));const m=c.call(a,h,r);return u&&i?i(m):m}function ag(n,e,t,r){const i=qc(n);let s=t;return i!==n&&(_t(n)?t.length>3&&(s=function(a,u,c){return t.call(this,a,u,c,n)}):s=function(a,u,c){return t.call(this,a,at(u),c,n)}),i[e](s,...r)}function Gc(n,e,t){const r=he(n);bt(r,"iterate",As);const i=r[e](...t);return(i===-1||i===!1)&&ga(t[0])?(t[0]=he(t[0]),r[e](...t)):i}function Os(n,e,t=[]){fa(),Bc();const r=he(n)[e].apply(n,t);return zc(),ha(),r}const fk=KC("__proto__,__v_isRef,__isVue"),lg=new Set(Object.getOwnPropertyNames(Symbol).filter(n=>n!=="arguments"&&n!=="caller").map(n=>Symbol[n]).filter(Es));function hk(n){Es(n)||(n=String(n));const e=he(this);return bt(e,"has",n),e.hasOwnProperty(n)}class ug{constructor(e=!1,t=!1){this._isReadonly=e,this._isShallow=t}get(e,t,r){if(t==="__v_skip")return e.__v_skip;const i=this._isReadonly,s=this._isShallow;if(t==="__v_isReactive")return!i;if(t==="__v_isReadonly")return i;if(t==="__v_isShallow")return s;if(t==="__v_raw")return r===(i?s?Sk:dg:s?vk:hg).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(r)?e:void 0;const a=$e(e);if(!i){let c;if(a&&(c=uk[t]))return c;if(t==="hasOwnProperty")return hk}const u=Reflect.get(e,t,lt(e)?e:r);return(Es(t)?lg.has(t):fk(t))||(i||bt(e,"get",t),s)?u:lt(u)?a&&Pc(t)?u:u.value:yt(u)?i?pg(u):jc(u):u}}class dk extends ug{constructor(e=!1){super(!1,e)}set(e,t,r,i){let s=e[t];if(!this._isShallow){const c=zn(s);if(!_t(r)&&!zn(r)&&(s=he(s),r=he(r)),!$e(e)&<(s)&&!lt(r))return c?!1:(s.value=r,!0)}const a=$e(e)&&Pc(t)?Number(t)<e.length:Lc(e,t),u=Reflect.set(e,t,r,lt(e)?e:i);return e===he(i)&&(a?fr(r,s)&&hr(e,"set",t,r,s):hr(e,"add",t,r)),u}deleteProperty(e,t){const r=Lc(e,t),i=e[t],s=Reflect.deleteProperty(e,t);return s&&r&&hr(e,"delete",t,void 0,i),s}has(e,t){const r=Reflect.has(e,t);return(!Es(t)||!lg.has(t))&&bt(e,"has",t),r}ownKeys(e){return bt(e,"iterate",$e(e)?"length":Wr),Reflect.ownKeys(e)}}class pk extends ug{constructor(e=!1){super(!0,e)}set(e,t){return process.env.NODE_ENV!=="production"&&Fn(`Set operation on key "${String(t)}" failed: target is readonly.`,e),!0}deleteProperty(e,t){return process.env.NODE_ENV!=="production"&&Fn(`Delete operation on key "${String(t)}" failed: target is readonly.`,e),!0}}const mk=new dk,gk=new pk,Jc=n=>n,pa=n=>Reflect.getPrototypeOf(n);function yk(n,e,t){return function(...r){const i=this.__v_raw,s=he(i),a=Ci(s),u=n==="entries"||n===Symbol.iterator&&a,c=n==="keys"&&a,h=i[n](...r),m=t?Jc:e?Yc:at;return!e&&bt(s,"iterate",c?Uc:Wr),{next(){const{value:d,done:y}=h.next();return y?{value:d,done:y}:{value:u?[m(d[0]),m(d[1])]:m(d),done:y}},[Symbol.iterator](){return this}}}}function ma(n){return function(...e){if(process.env.NODE_ENV!=="production"){const t=e[0]?`on key "${e[0]}" `:"";Fn(`${ek(n)} operation ${t}failed: target is readonly.`,he(this))}return n==="delete"?!1:n==="clear"?void 0:this}}function bk(n,e){const t={get(i){const s=this.__v_raw,a=he(s),u=he(i);n||(fr(i,u)&&bt(a,"get",i),bt(a,"get",u));const{has:c}=pa(a),h=e?Jc:n?Yc:at;if(c.call(a,i))return h(s.get(i));if(c.call(a,u))return h(s.get(u));s!==a&&s.get(i)},get size(){const i=this.__v_raw;return!n&&bt(he(i),"iterate",Wr),Reflect.get(i,"size",i)},has(i){const s=this.__v_raw,a=he(s),u=he(i);return n||(fr(i,u)&&bt(a,"has",i),bt(a,"has",u)),i===u?s.has(i):s.has(i)||s.has(u)},forEach(i,s){const a=this,u=a.__v_raw,c=he(u),h=e?Jc:n?Yc:at;return!n&&bt(c,"iterate",Wr),u.forEach((m,d)=>i.call(s,h(m),h(d),a))}};return cr(t,n?{add:ma("add"),set:ma("set"),delete:ma("delete"),clear:ma("clear")}:{add(i){!e&&!_t(i)&&!zn(i)&&(i=he(i));const s=he(this);return pa(s).has.call(s,i)||(s.add(i),hr(s,"add",i,i)),this},set(i,s){!e&&!_t(s)&&!zn(s)&&(s=he(s));const a=he(this),{has:u,get:c}=pa(a);let h=u.call(a,i);h?process.env.NODE_ENV!=="production"&&fg(a,u,i):(i=he(i),h=u.call(a,i));const m=c.call(a,i);return a.set(i,s),h?fr(s,m)&&hr(a,"set",i,s,m):hr(a,"add",i,s),this},delete(i){const s=he(this),{has:a,get:u}=pa(s);let c=a.call(s,i);c?process.env.NODE_ENV!=="production"&&fg(s,a,i):(i=he(i),c=a.call(s,i));const h=u?u.call(s,i):void 0,m=s.delete(i);return c&&hr(s,"delete",i,void 0,h),m},clear(){const i=he(this),s=i.size!==0,a=process.env.NODE_ENV!=="production"?Ci(i)?new Map(i):new Set(i):void 0,u=i.clear();return s&&hr(i,"clear",void 0,void 0,a),u}}),["keys","values","entries",Symbol.iterator].forEach(i=>{t[i]=yk(i,n,e)}),t}function cg(n,e){const t=bk(n,e);return(r,i,s)=>i==="__v_isReactive"?!n:i==="__v_isReadonly"?n:i==="__v_raw"?r:Reflect.get(Lc(t,i)&&i in r?t:r,i,s)}const _k={get:cg(!1,!1)},wk={get:cg(!0,!1)};function fg(n,e,t){const r=he(t);if(r!==t&&e.call(n,r)){const i=Xm(n);Fn(`Reactive ${i} contains both the raw and reactive versions of the same object${i==="Map"?" as keys":""}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`)}}const hg=new WeakMap,vk=new WeakMap,dg=new WeakMap,Sk=new WeakMap;function xk(n){switch(n){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Ek(n){return n.__v_skip||!Object.isExtensible(n)?0:xk(Xm(n))}function jc(n){return zn(n)?n:mg(n,!1,mk,_k,hg)}function pg(n){return mg(n,!0,gk,wk,dg)}function mg(n,e,t,r,i){if(!yt(n))return process.env.NODE_ENV!=="production"&&Fn(`value cannot be made ${e?"readonly":"reactive"}: ${String(n)}`),n;if(n.__v_raw&&!(e&&n.__v_isReactive))return n;const s=i.get(n);if(s)return s;const a=Ek(n);if(a===0)return n;const u=new Proxy(n,a===2?r:t);return i.set(n,u),u}function Ms(n){return zn(n)?Ms(n.__v_raw):!!(n&&n.__v_isReactive)}function zn(n){return!!(n&&n.__v_isReadonly)}function _t(n){return!!(n&&n.__v_isShallow)}function ga(n){return n?!!n.__v_raw:!1}function he(n){const e=n&&n.__v_raw;return e?he(e):n}const at=n=>yt(n)?jc(n):n,Yc=n=>yt(n)?pg(n):n;function lt(n){return n?n.__v_isRef===!0:!1}function ya(n){return Ck(n,!1)}function Ck(n,e){return lt(n)?n:new kk(n,e)}class kk{constructor(e,t){this.dep=new Vc,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=t?e:he(e),this._value=t?e:at(e),this.__v_isShallow=t}get value(){return process.env.NODE_ENV!=="production"?this.dep.track({target:this,type:"get",key:"value"}):this.dep.track(),this._value}set value(e){const t=this._rawValue,r=this.__v_isShallow||_t(e)||zn(e);e=r?e:he(e),fr(e,t)&&(this._rawValue=e,this._value=r?e:at(e),process.env.NODE_ENV!=="production"?this.dep.trigger({target:this,type:"set",key:"value",newValue:e,oldValue:t}):this.dep.trigger())}}function W(n){return lt(n)?n.value:n}class Tk{constructor(e,t,r){this._object=e,this._key=t,this._defaultValue=r,this.__v_isRef=!0,this._value=void 0}get value(){const e=this._object[this._key];return this._value=e===void 0?this._defaultValue:e}set value(e){this._object[this._key]=e}get dep(){return lk(he(this._object),this._key)}}class Ak{constructor(e){this._getter=e,this.__v_isRef=!0,this.__v_isReadonly=!0,this._value=void 0}get value(){return this._value=this._getter()}}function Ti(n,e,t){return lt(n)?n:Qe(n)?new Ak(n):yt(n)&&arguments.length>1?Ok(n,e,t):ya(n)}function Ok(n,e,t){const r=n[e];return lt(r)?r:new Tk(n,e,t)}class Mk{constructor(e,t,r){this.fn=e,this.setter=t,this._value=void 0,this.dep=new Vc(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Ts-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!t,this.isSSR=r}notify(){if(this.flags|=16,!(this.flags&8)&&we!==this)return eg(this,!0),!0;process.env.NODE_ENV}get value(){const e=process.env.NODE_ENV!=="production"?this.dep.track({target:this,type:"get",key:"value"}):this.dep.track();return rg(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter?this.setter(e):process.env.NODE_ENV!=="production"&&Fn("Write operation failed: computed value is readonly")}}function Ik(n,e,t=!1){let r,i;Qe(n)?r=n:(r=n.get,i=n.set);const s=new Mk(r,i,t);return process.env.NODE_ENV,s}const ba={},_a=new WeakMap;let Vr;function Nk(n,e=!1,t=Vr){if(t){let r=_a.get(t);r||_a.set(t,r=[]),r.push(n)}else process.env.NODE_ENV!=="production"&&!e&&Fn("onWatcherCleanup() was called when there was no active watcher to associate with.")}function Rk(n,e,t=xs){const{immediate:r,deep:i,once:s,scheduler:a,augmentJob:u,call:c}=t,h=T=>{(t.onWarn||Fn)("Invalid watch source: ",T,"A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.")},m=T=>i?T:_t(T)||i===!1||i===0?dr(T,1):dr(T);let d,y,_,v,E=!1,N=!1;if(lt(n)?(y=()=>n.value,E=_t(n)):Ms(n)?(y=()=>m(n),E=!0):$e(n)?(N=!0,E=n.some(T=>Ms(T)||_t(T)),y=()=>n.map(T=>{if(lt(T))return T.value;if(Ms(T))return m(T);if(Qe(T))return c?c(T,2):T();process.env.NODE_ENV!=="production"&&h(T)})):Qe(n)?e?y=c?()=>c(n,2):n:y=()=>{if(_){fa();try{_()}finally{ha()}}const T=Vr;Vr=d;try{return c?c(n,3,[v]):n(v)}finally{Vr=T}}:(y=Ei,process.env.NODE_ENV!=="production"&&h(n)),e&&i){const T=y,A=i===!0?1/0:i;y=()=>dr(T(),A)}const g=()=>{d.stop()};if(s&&e){const T=e;e=(...A)=>{T(...A),g()}}let S=N?new Array(n.length).fill(ba):ba;const k=T=>{if(!(!(d.flags&1)||!d.dirty&&!T))if(e){const A=d.run();if(i||E||(N?A.some(($,U)=>fr($,S[U])):fr(A,S))){_&&_();const $=Vr;Vr=d;try{const U=[A,S===ba?void 0:N&&S[0]===ba?[]:S,v];c?c(e,3,U):e(...U),S=A}finally{Vr=$}}}else d.run()};return u&&u(k),d=new sk(y),d.scheduler=a?()=>a(k,!1):k,v=T=>Nk(T,!1,d),_=d.onStop=()=>{const T=_a.get(d);if(T){if(c)c(T,4);else for(const A of T)A();_a.delete(d)}},process.env.NODE_ENV!=="production"&&(d.onTrack=t.onTrack,d.onTrigger=t.onTrigger),e?r?k(!0):S=d.run():a?a(k.bind(null,!0),!0):d.run(),g.pause=d.pause.bind(d),g.resume=d.resume.bind(d),g.stop=g,g}function dr(n,e=1/0,t){if(e<=0||!yt(n)||n.__v_skip||(t=t||new Set,t.has(n)))return n;if(t.add(n),e--,lt(n))dr(n.value,e,t);else if($e(n))for(let r=0;r<n.length;r++)dr(n[r],e,t);else if(jC(n)||Ci(n))n.forEach(r=>{dr(r,e,t)});else if(ZC(n)){for(const r in n)dr(n[r],e,t);for(const r of Object.getOwnPropertySymbols(n))Object.prototype.propertyIsEnumerable.call(n,r)&&dr(n[r],e,t)}return n}const Ur=[];function Lk(n){Ur.push(n)}function Pk(){Ur.pop()}let Xc=!1;function ut(n,...e){if(Xc)return;Xc=!0,fa();const t=Ur.length?Ur[Ur.length-1].component:null,r=t&&t.appContext.config.warnHandler,i=Dk();if(r)wa(r,t,11,[n+e.map(s=>{var a,u;return(u=(a=s.toString)==null?void 0:a.call(s))!=null?u:JSON.stringify(s)}).join(""),t&&t.proxy,i.map(({vnode:s})=>`at <${Rg(t,s.type)}>`).join(`
|
|
27
27
|
`),i]);else{const s=[`[Vue warn]: ${n}`,...e];i.length&&s.push(`
|
|
28
|
-
|
|
29
|
-
`],...DE(t))}),e}function DE({vnode:n,recurseCount:e}){const t=e>0?`... (${e} recursive calls)`:"",r=n.component?n.component.parent==null:!1,i=` at <${Xm(n.component,n.type,r)}`,s=">"+t;return n.props?[i,...FE(n.props),s]:[i+s]}function FE(n){const e=[],t=Object.keys(n);return t.slice(0,3).forEach(r=>{e.push(...Lm(r,n[r]))}),t.length>3&&e.push(" ..."),e}function Lm(n,e,t){return Ln(e)?(e=JSON.stringify(e),t?e:[`${n}=${e}`]):typeof e=="number"||typeof e=="boolean"||e==null?t?e:[`${n}=${e}`]:lt(e)?(e=Lm(n,he(e.value),!0),t?e:[`${n}=Ref<`,e,">"]):Qe(e)?[`${n}=fn${e.name?`<${e.name}>`:""}`]:(e=he(e),t?e:[`${n}=`,e])}const Pm={sp:"serverPrefetch hook",bc:"beforeCreate hook",c:"created hook",bm:"beforeMount hook",m:"mounted hook",bu:"beforeUpdate hook",u:"updated",bum:"beforeUnmount hook",um:"unmounted hook",a:"activated hook",da:"deactivated hook",ec:"errorCaptured hook",rtc:"renderTracked hook",rtg:"renderTriggered hook",0:"setup function",1:"render function",2:"watcher getter",3:"watcher callback",4:"watcher cleanup function",5:"native event handler",6:"component event handler",7:"vnode hook",8:"directive hook",9:"transition hook",10:"app errorHandler",11:"app warnHandler",12:"ref function",13:"async component loader",14:"scheduler flush",15:"component update",16:"app unmount cleanup function"};function sa(n,e,t,r){try{return r?n(...r):n()}catch(i){Oc(i,e,t)}}function Dm(n,e,t,r){if(Qe(n)){const i=sa(n,e,t,r);return i&&JC(i)&&i.catch(s=>{Oc(s,e,t)}),i}if(Fe(n)){const i=[];for(let s=0;s<n.length;s++)i.push(Dm(n[s],e,t,r));return i}else process.env.NODE_ENV!=="production"&&ut(`Invalid value type passed to callWithAsyncErrorHandling(): ${typeof n}`)}function Oc(n,e,t,r=!0){const i=e?e.vnode:null,{errorHandler:s,throwUnhandledErrorInProduction:a}=e&&e.appContext.config||us;if(e){let u=e.parent;const c=e.proxy,h=process.env.NODE_ENV!=="production"?Pm[t]:`https://vuejs.org/error-reference/#runtime-${t}`;for(;u;){const p=u.ec;if(p){for(let m=0;m<p.length;m++)if(p[m](n,c,h)===!1)return}u=u.parent}if(s){Yo(),sa(s,null,10,[n,c,h]),Xo();return}}BE(n,t,i,r,a)}function BE(n,e,t,r=!0,i=!1){if(process.env.NODE_ENV!=="production"){const s=Pm[e];if(t&&NE(t),ut(`Unhandled error${s?` during execution of ${s}`:""}`),t&&RE(),r)throw n;console.error(n)}else{if(i)throw n;console.error(n)}}const qt=[];let Bn=-1;const bi=[];let cr=null,_i=0;const zE=Promise.resolve();let Mc=null;const $E=100;function HE(n){let e=Bn+1,t=qt.length;for(;e<t;){const r=e+t>>>1,i=qt[r],s=ys(i);s<n||s===n&&i.flags&2?e=r+1:t=r}return e}function Fm(n){if(!(n.flags&1)){const e=ys(n),t=qt[qt.length-1];!t||!(n.flags&2)&&e>=ys(t)?qt.push(n):qt.splice(HE(e),0,n),n.flags|=1,Bm()}}function Bm(){Mc||(Mc=zE.then($m))}function zm(n){Fe(n)?bi.push(...n):cr&&n.id===-1?cr.splice(_i+1,0,n):n.flags&1||(bi.push(n),n.flags|=1),Bm()}function WE(n){if(bi.length){const e=[...new Set(bi)].sort((t,r)=>ys(t)-ys(r));if(bi.length=0,cr){cr.push(...e);return}for(cr=e,process.env.NODE_ENV!=="production"&&(n=n||new Map),_i=0;_i<cr.length;_i++){const t=cr[_i];process.env.NODE_ENV!=="production"&&Hm(n,t)||(t.flags&4&&(t.flags&=-2),t.flags&8||t(),t.flags&=-2)}cr=null,_i=0}}const ys=n=>n.id==null?n.flags&2?-1:1/0:n.id;function $m(n){process.env.NODE_ENV!=="production"&&(n=n||new Map);const e=process.env.NODE_ENV!=="production"?t=>Hm(n,t):pi;try{for(Bn=0;Bn<qt.length;Bn++){const t=qt[Bn];if(t&&!(t.flags&8)){if(process.env.NODE_ENV!=="production"&&e(t))continue;t.flags&4&&(t.flags&=-2),sa(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2)}}}finally{for(;Bn<qt.length;Bn++){const t=qt[Bn];t&&(t.flags&=-2)}Bn=-1,qt.length=0,WE(n),Mc=null,(qt.length||bi.length)&&$m(n)}}function Hm(n,e){const t=n.get(e)||0;if(t>$E){const r=e.i,i=r&&Ym(r.type);return Oc(`Maximum recursive updates exceeded${i?` in component <${i}>`:""}. This means you have a reactive effect that is mutating its own dependencies and thus recursively triggering itself. Possible sources include component template, render function, updated hook or watcher source function.`,null,10),!0}return n.set(e,t+1),!1}const Ic=new Map;process.env.NODE_ENV!=="production"&&(jo().__VUE_HMR_RUNTIME__={createRecord:Nc(VE),rerender:Nc(UE),reload:Nc(qE)});const oa=new Map;function VE(n,e){return oa.has(n)?!1:(oa.set(n,{initialDef:aa(e),instances:new Set}),!0)}function aa(n){return Zm(n)?n.__vccOpts:n}function UE(n,e){const t=oa.get(n);t&&(t.initialDef.render=e,[...t.instances].forEach(r=>{e&&(r.render=e,aa(r.type).render=e),r.renderCache=[],r.update()}))}function qE(n,e){const t=oa.get(n);if(!t)return;e=aa(e),Wm(t.initialDef,e);const r=[...t.instances];for(let i=0;i<r.length;i++){const s=r[i],a=aa(s.type);let u=Ic.get(a);u||(a!==t.initialDef&&Wm(a,e),Ic.set(a,u=new Set)),u.add(s),s.appContext.propsCache.delete(s.type),s.appContext.emitsCache.delete(s.type),s.appContext.optionsCache.delete(s.type),s.ceReload?(u.add(s),s.ceReload(e.styles),u.delete(s)):s.parent?Fm(()=>{s.parent.update(),u.delete(s)}):s.appContext.reload?s.appContext.reload():typeof window<"u"?window.location.reload():console.warn("[HMR] Root or manually mounted instance modified. Full reload required."),s.root.ce&&s!==s.root&&s.root.ce._removeChildStyle(a)}zm(()=>{Ic.clear()})}function Wm(n,e){or(n,e);for(const t in n)t!=="__file"&&!(t in e)&&delete n[t]}function Nc(n){return(e,t)=>{try{return n(e,t)}catch(r){console.error(r),console.warn("[HMR] Something went wrong during Vue component hot-reload. Full reload required.")}}}let wi,la=[];function Vm(n,e){var t,r;wi=n,wi?(wi.enabled=!0,la.forEach(({event:i,args:s})=>wi.emit(i,...s)),la=[]):typeof window<"u"&&window.HTMLElement&&!((r=(t=window.navigator)==null?void 0:t.userAgent)!=null&&r.includes("jsdom"))?((e.__VUE_DEVTOOLS_HOOK_REPLAY__=e.__VUE_DEVTOOLS_HOOK_REPLAY__||[]).push(s=>{Vm(s,e)}),setTimeout(()=>{wi||(e.__VUE_DEVTOOLS_HOOK_REPLAY__=null,la=[])},3e3)):la=[]}let vi=null,KE=null;const GE=n=>n.__isTeleport;function Um(n,e){n.shapeFlag&6&&n.component?(n.transition=e,Um(n.component.subTree,e)):n.shapeFlag&128?(n.ssContent.transition=e.clone(n.ssContent),n.ssFallback.transition=e.clone(n.ssFallback)):n.transition=e}jo().requestIdleCallback,jo().cancelIdleCallback;const JE=Symbol.for("v-ndc"),jE={};process.env.NODE_ENV!=="production"&&(jE.ownKeys=n=>(ut("Avoid app logic that relies on enumerating keys on a component instance. The keys will be empty in production mode to avoid performance overhead."),Reflect.ownKeys(n)));let YE=null;function XE(n,e,t=!1){const r=fa||vi;if(r||YE){const i=r?r.parent==null?r.vnode.appContext&&r.vnode.appContext.provides:r.parent.provides:void 0;if(i&&n in i)return i[n];if(arguments.length>1)return t&&Qe(e)?e.call(r&&r.proxy):e;process.env.NODE_ENV!=="production"&&ut(`injection "${String(n)}" not found.`)}else process.env.NODE_ENV!=="production"&&ut("inject() can only be used inside setup() or functional components.")}const ZE={},qm=n=>Object.getPrototypeOf(n)===ZE,QE=s5,e5=Symbol.for("v-scx"),t5=()=>{{const n=XE(e5);return n||process.env.NODE_ENV!=="production"&&ut("Server rendering context not provided. Make sure to only call useSSRContext() conditionally in the server build."),n}};function n5(n,e,t){return process.env.NODE_ENV!=="production"&&!Qe(e)&&ut("`watch(fn, options?)` signature has been moved to a separate API. Use `watchEffect(fn, options?)` instead. `watch` now only supports `watch(source, cb, options?) signature."),r5(n,e,t)}function r5(n,e,t=us){const{immediate:r,deep:i,flush:s,once:a}=t;process.env.NODE_ENV!=="production"&&!e&&(r!==void 0&&ut('watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.'),i!==void 0&&ut('watch() "deep" option is only respected when using the watch(source, callback, options?) signature.'),a!==void 0&&ut('watch() "once" option is only respected when using the watch(source, callback, options?) signature.'));const u=or({},t);process.env.NODE_ENV!=="production"&&(u.onWarn=ut);const c=e&&r||!e&&s!=="post";let h;if(ha){if(s==="sync"){const _=t5();h=_.__watcherHandles||(_.__watcherHandles=[])}else if(!c){const _=()=>{};return _.stop=pi,_.resume=pi,_.pause=pi,_}}const p=fa;u.call=(_,S,E)=>Dm(_,p,S,E);let m=!1;s==="post"?u.scheduler=_=>{QE(_,p&&p.suspense)}:s!=="sync"&&(m=!0,u.scheduler=(_,S)=>{S?_():Fm(_)}),u.augmentJob=_=>{e&&(_.flags|=4),m&&(_.flags|=2,p&&(_.id=p.uid,_.i=p))};const y=IE(n,e,u);return ha&&(h?h.push(y):c&&y()),y}const i5=n=>n.__isSuspense;function s5(n,e){e&&e.pendingBranch?Fe(n)?e.effects.push(...n):e.effects.push(n):zm(n)}const Km=Symbol.for("v-fgt"),o5=Symbol.for("v-txt"),a5=Symbol.for("v-cmt");function l5(n){return n?n.__v_isVNode===!0:!1}const u5=(...n)=>Jm(...n),Gm=({key:n})=>n??null,ua=({ref:n,ref_key:e,ref_for:t})=>(typeof n=="number"&&(n=""+n),n!=null?Ln(n)||lt(n)||Qe(n)?{i:vi,r:n,k:e,f:!!t}:n:null);function c5(n,e=null,t=null,r=0,i=null,s=n===Km?0:1,a=!1,u=!1){const c={__v_isVNode:!0,__v_skip:!0,type:n,props:e,key:e&&Gm(e),ref:e&&ua(e),scopeId:KE,slotScopeIds:null,children:t,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:s,patchFlag:r,dynamicProps:i,dynamicChildren:null,appContext:null,ctx:vi};return u?(Rc(c,t),s&128&&n.normalize(c)):t&&(c.shapeFlag|=Ln(t)?8:16),process.env.NODE_ENV!=="production"&&c.key!==c.key&&ut("VNode created with invalid key (NaN). VNode type:",c.type),c}const f5=process.env.NODE_ENV!=="production"?u5:Jm;function Jm(n,e=null,t=null,r=0,i=null,s=!1){if((!n||n===JE)&&(process.env.NODE_ENV!=="production"&&!n&&ut(`Invalid vnode type when creating vnode: ${n}.`),n=a5),l5(n)){const u=ca(n,e,!0);return t&&Rc(u,t),u.patchFlag=-2,u}if(Zm(n)&&(n=n.__vccOpts),e){e=h5(e);let{class:u,style:c}=e;u&&!Ln(u)&&(e.class=pc(u)),gt(c)&&(ta(c)&&!Fe(c)&&(c=or({},c)),e.style=dc(c))}const a=Ln(n)?1:i5(n)?128:GE(n)?64:gt(n)?4:Qe(n)?2:0;return process.env.NODE_ENV!=="production"&&a&4&&ta(n)&&(n=he(n),ut("Vue received a Component that was made a reactive object. This can lead to unnecessary performance overhead and should be avoided by marking the component with `markRaw` or using `shallowRef` instead of `ref`.",`
|
|
30
|
-
Component that was made reactive: `,n)),c5(n,e,t,r,i,a,s,!0)}function h5(n){return n?ta(n)||qm(n)?or({},n):n:null}function ca(n,e,t=!1,r=!1){const{props:i,ref:s,patchFlag:a,children:u,transition:c}=n,h=e?p5(i||{},e):i,p={__v_isVNode:!0,__v_skip:!0,type:n.type,props:h,key:h&&Gm(h),ref:e&&e.ref?t&&s?Fe(s)?s.concat(ua(e)):[s,ua(e)]:ua(e):s,scopeId:n.scopeId,slotScopeIds:n.slotScopeIds,children:process.env.NODE_ENV!=="production"&&a===-1&&Fe(u)?u.map(jm):u,target:n.target,targetStart:n.targetStart,targetAnchor:n.targetAnchor,staticCount:n.staticCount,shapeFlag:n.shapeFlag,patchFlag:e&&n.type!==Km?a===-1?16:a|16:a,dynamicProps:n.dynamicProps,dynamicChildren:n.dynamicChildren,appContext:n.appContext,dirs:n.dirs,transition:c,component:n.component,suspense:n.suspense,ssContent:n.ssContent&&ca(n.ssContent),ssFallback:n.ssFallback&&ca(n.ssFallback),el:n.el,anchor:n.anchor,ctx:n.ctx,ce:n.ce};return c&&r&&Um(p,c.clone(p)),p}function jm(n){const e=ca(n);return Fe(n.children)&&(e.children=n.children.map(jm)),e}function d5(n=" ",e=0){return f5(o5,null,n,e)}function Rc(n,e){let t=0;const{shapeFlag:r}=n;if(e==null)e=null;else if(Fe(e))t=16;else if(typeof e=="object")if(r&65){const i=e.default;i&&(i._c&&(i._d=!1),Rc(n,i()),i._c&&(i._d=!0));return}else t=32,!e._&&!qm(e)&&(e._ctx=vi);else Qe(e)?(e={default:e,_ctx:vi},t=32):(e=String(e),r&64?(t=16,e=[d5(e)]):t=8);n.children=e,n.shapeFlag|=t}function p5(...n){const e={};for(let t=0;t<n.length;t++){const r=n[t];for(const i in r)if(i==="class")e.class!==r.class&&(e.class=pc([e.class,r.class]));else if(i==="style")e.style=dc([e.style,r.style]);else if(qC(i)){const s=e[i],a=r[i];a&&s!==a&&!(Fe(s)&&s.includes(a))&&(e[i]=s?[].concat(s,a):a)}else i!==""&&(e[i]=r[i])}return e}let fa=null;const m5=()=>fa||vi;{const n=jo(),e=(t,r)=>{let i;return(i=n[t])||(i=n[t]=[]),i.push(r),s=>{i.length>1?i.forEach(a=>a(s)):i[0](s)}};e("__VUE_INSTANCE_SETTERS__",t=>fa=t),e("__VUE_SSR_SETTERS__",t=>ha=t)}let ha=!1;process.env.NODE_ENV;const g5=/(?:^|[-_])(\w)/g,y5=n=>n.replace(g5,e=>e.toUpperCase()).replace(/[-_]/g,"");function Ym(n,e=!0){return Qe(n)?n.displayName||n.name:n.name||e&&n.__name}function Xm(n,e,t=!1){let r=Ym(e);if(!r&&e.__file){const i=e.__file.match(/([^/\\]+)\.\w+$/);i&&(r=i[1])}if(!r&&n&&n.parent){const i=s=>{for(const a in s)if(s[a]===e)return a};r=i(n.components||n.parent.type.components)||i(n.appContext.components)}return r?y5(r):t?"App":"Anonymous"}function Zm(n){return Qe(n)&&"__vccOpts"in n}const ge=(n,e)=>{const t=OE(n,e,ha);if(process.env.NODE_ENV!=="production"){const r=m5();r&&r.appContext.config.warnRecursiveComputed&&(t._warnRecursive=!0)}return t};function b5(){if(process.env.NODE_ENV==="production"||typeof window>"u")return;const n={style:"color:#3ba776"},e={style:"color:#1677ff"},t={style:"color:#f5222d"},r={style:"color:#eb2f96"},i={__vue_custom_formatter:!0,header(m){return gt(m)?m.__isVue?["div",n,"VueInstance"]:lt(m)?["div",{},["span",n,p(m)],"<",u("_value"in m?m._value:m),">"]:gs(m)?["div",{},["span",n,bt(m)?"ShallowReactive":"Reactive"],"<",u(m),`>${Fn(m)?" (readonly)":""}`]:Fn(m)?["div",{},["span",n,bt(m)?"ShallowReadonly":"Readonly"],"<",u(m),">"]:null:null},hasBody(m){return m&&m.__isVue},body(m){if(m&&m.__isVue)return["div",{},...s(m.$)]}};function s(m){const y=[];m.type.props&&m.props&&y.push(a("props",he(m.props))),m.setupState!==us&&y.push(a("setup",m.setupState)),m.data!==us&&y.push(a("data",he(m.data)));const _=c(m,"computed");_&&y.push(a("computed",_));const S=c(m,"inject");return S&&y.push(a("injected",S)),y.push(["div",{},["span",{style:r.style+";opacity:0.66"},"$ (internal): "],["object",{object:m}]]),y}function a(m,y){return y=or({},y),Object.keys(y).length?["div",{style:"line-height:1.25em;margin-bottom:0.6em"},["div",{style:"color:#476582"},m],["div",{style:"padding-left:1.25em"},...Object.keys(y).map(_=>["div",{},["span",r,_+": "],u(y[_],!1)])]]:["span",{}]}function u(m,y=!0){return typeof m=="number"?["span",e,m]:typeof m=="string"?["span",t,JSON.stringify(m)]:typeof m=="boolean"?["span",r,m]:gt(m)?["object",{object:y?he(m):m}]:["span",t,String(m)]}function c(m,y){const _=m.type;if(Qe(_))return;const S={};for(const E in m.ctx)h(_,E,y)&&(S[E]=m.ctx[E]);return S}function h(m,y,_){const S=m[_];if(Fe(S)&&S.includes(y)||gt(S)&&y in S||m.extends&&h(m.extends,y,_)||m.mixins&&m.mixins.some(E=>h(E,y,_)))return!0}function p(m){return bt(m)?"ShallowRef":m.effect?"ComputedRef":"Ref"}window.devtoolsFormatters?window.devtoolsFormatters.push(i):window.devtoolsFormatters=[i]}process.env.NODE_ENV,process.env.NODE_ENV,process.env.NODE_ENV;function _5(){b5()}process.env.NODE_ENV!=="production"&&_5();function et(n){this.content=n}et.prototype={constructor:et,find:function(n){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===n)return e;return-1},get:function(n){var e=this.find(n);return e==-1?void 0:this.content[e+1]},update:function(n,e,t){var r=t&&t!=n?this.remove(t):this,i=r.find(n),s=r.content.slice();return i==-1?s.push(t||n,e):(s[i+1]=e,t&&(s[i]=t)),new et(s)},remove:function(n){var e=this.find(n);if(e==-1)return this;var t=this.content.slice();return t.splice(e,2),new et(t)},addToStart:function(n,e){return new et([n,e].concat(this.remove(n).content))},addToEnd:function(n,e){var t=this.remove(n).content.slice();return t.push(n,e),new et(t)},addBefore:function(n,e,t){var r=this.remove(e),i=r.content.slice(),s=r.find(n);return i.splice(s==-1?i.length:s,0,e,t),new et(i)},forEach:function(n){for(var e=0;e<this.content.length;e+=2)n(this.content[e],this.content[e+1])},prepend:function(n){return n=et.from(n),n.size?new et(n.content.concat(this.subtract(n).content)):this},append:function(n){return n=et.from(n),n.size?new et(this.subtract(n).content.concat(n.content)):this},subtract:function(n){var e=this;n=et.from(n);for(var t=0;t<n.content.length;t+=2)e=e.remove(n.content[t]);return e},toObject:function(){var n={};return this.forEach(function(e,t){n[e]=t}),n},get size(){return this.content.length>>1}},et.from=function(n){if(n instanceof et)return n;var e=[];if(n)for(var t in n)e.push(t,n[t]);return new et(e)};function Qm(n,e,t){for(let r=0;;r++){if(r==n.childCount||r==e.childCount)return n.childCount==e.childCount?null:t;let i=n.child(r),s=e.child(r);if(i==s){t+=i.nodeSize;continue}if(!i.sameMarkup(s))return t;if(i.isText&&i.text!=s.text){for(let a=0;i.text[a]==s.text[a];a++)t++;return t}if(i.content.size||s.content.size){let a=Qm(i.content,s.content,t+1);if(a!=null)return a}t+=i.nodeSize}}function eg(n,e,t,r){for(let i=n.childCount,s=e.childCount;;){if(i==0||s==0)return i==s?null:{a:t,b:r};let a=n.child(--i),u=e.child(--s),c=a.nodeSize;if(a==u){t-=c,r-=c;continue}if(!a.sameMarkup(u))return{a:t,b:r};if(a.isText&&a.text!=u.text){let h=0,p=Math.min(a.text.length,u.text.length);for(;h<p&&a.text[a.text.length-h-1]==u.text[u.text.length-h-1];)h++,t--,r--;return{a:t,b:r}}if(a.content.size||u.content.size){let h=eg(a.content,u.content,t-1,r-1);if(h)return h}t-=c,r-=c}}class z{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,t,r,i=0,s){for(let a=0,u=0;u<t;a++){let c=this.content[a],h=u+c.nodeSize;if(h>e&&r(c,i+u,s||null,a)!==!1&&c.content.size){let p=u+1;c.nodesBetween(Math.max(0,e-p),Math.min(c.content.size,t-p),r,i+p)}u=h}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,r,i){let s="",a=!0;return this.nodesBetween(e,t,(u,c)=>{let h=u.isText?u.text.slice(Math.max(e,c)-c,t-c):u.isLeaf?i?typeof i=="function"?i(u):i:u.type.spec.leafText?u.type.spec.leafText(u):"":"";u.isBlock&&(u.isLeaf&&h||u.isTextblock)&&r&&(a?a=!1:s+=r),s+=h},0),s}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,r=e.firstChild,i=this.content.slice(),s=0;for(t.isText&&t.sameMarkup(r)&&(i[i.length-1]=t.withText(t.text+r.text),s=1);s<e.content.length;s++)i.push(e.content[s]);return new z(i,this.size+e.size)}cut(e,t=this.size){if(e==0&&t==this.size)return this;let r=[],i=0;if(t>e)for(let s=0,a=0;a<t;s++){let u=this.content[s],c=a+u.nodeSize;c>e&&((a<e||c>t)&&(u.isText?u=u.cut(Math.max(0,e-a),Math.min(u.text.length,t-a)):u=u.cut(Math.max(0,e-a-1),Math.min(u.content.size,t-a-1))),r.push(u),i+=u.nodeSize),a=c}return new z(r,i)}cutByIndex(e,t){return e==t?z.empty:e==0&&t==this.content.length?this:new z(this.content.slice(e,t))}replaceChild(e,t){let r=this.content[e];if(r==t)return this;let i=this.content.slice(),s=this.size+t.nodeSize-r.nodeSize;return i[e]=t,new z(i,s)}addToStart(e){return new z([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new z(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))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(e){let t=this.content[e];if(!t)throw new RangeError("Index "+e+" out of range for "+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,r=0;t<this.content.length;t++){let i=this.content[t];e(i,r,t),r+=i.nodeSize}}findDiffStart(e,t=0){return Qm(this,e,t)}findDiffEnd(e,t=this.size,r=e.size){return eg(this,e,t,r)}findIndex(e,t=-1){if(e==0)return da(0,e);if(e==this.size)return da(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let r=0,i=0;;r++){let s=this.child(r),a=i+s.nodeSize;if(a>=e)return a==e||t>0?da(r+1,a):da(r,i);i=a}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,t){if(!t)return z.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new z(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return z.empty;let t,r=0;for(let i=0;i<e.length;i++){let s=e[i];r+=s.nodeSize,i&&s.isText&&e[i-1].sameMarkup(s)?(t||(t=e.slice(0,i)),t[t.length-1]=s.withText(t[t.length-1].text+s.text)):t&&t.push(s)}return new z(t||e,r)}static from(e){if(!e)return z.empty;if(e instanceof z)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new z([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}z.empty=new z([],0);const Lc={index:0,offset:0};function da(n,e){return Lc.index=n,Lc.offset=e,Lc}function pa(n,e){if(n===e)return!0;if(!(n&&typeof n=="object")||!(e&&typeof e=="object"))return!1;let t=Array.isArray(n);if(Array.isArray(e)!=t)return!1;if(t){if(n.length!=e.length)return!1;for(let r=0;r<n.length;r++)if(!pa(n[r],e[r]))return!1}else{for(let r in n)if(!(r in e)||!pa(n[r],e[r]))return!1;for(let r in e)if(!(r in n))return!1}return!0}let Te=class wh{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,r=!1;for(let i=0;i<e.length;i++){let s=e[i];if(this.eq(s))return e;if(this.type.excludes(s.type))t||(t=e.slice(0,i));else{if(s.type.excludes(this.type))return e;!r&&s.type.rank>this.type.rank&&(t||(t=e.slice(0,i)),t.push(this),r=!0),t&&t.push(s)}}return t||(t=e.slice()),r||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&pa(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[t.type];if(!r)throw new RangeError(`There is no mark type ${t.type} in this schema`);let i=r.create(t.attrs);return r.checkAttrs(i.attrs),i}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(t[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return wh.none;if(e instanceof wh)return[e];let t=e.slice();return t.sort((r,i)=>r.type.rank-i.type.rank),t}};Te.none=[];class ma extends Error{}class K{constructor(e,t,r){this.content=e,this.openStart=t,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let r=ng(this.content,e+this.openStart,t);return r&&new K(r,this.openStart,this.openEnd)}removeBetween(e,t){return new K(tg(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,t){if(!t)return K.empty;let r=t.openStart||0,i=t.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new K(z.fromJSON(e,t.content),r,i)}static maxOpen(e,t=!0){let r=0,i=0;for(let s=e.firstChild;s&&!s.isLeaf&&(t||!s.type.spec.isolating);s=s.firstChild)r++;for(let s=e.lastChild;s&&!s.isLeaf&&(t||!s.type.spec.isolating);s=s.lastChild)i++;return new K(e,r,i)}}K.empty=new K(z.empty,0,0);function tg(n,e,t){let{index:r,offset:i}=n.findIndex(e),s=n.maybeChild(r),{index:a,offset:u}=n.findIndex(t);if(i==e||s.isText){if(u!=t&&!n.child(a).isText)throw new RangeError("Removing non-flat range");return n.cut(0,e).append(n.cut(t))}if(r!=a)throw new RangeError("Removing non-flat range");return n.replaceChild(r,s.copy(tg(s.content,e-i-1,t-i-1)))}function ng(n,e,t,r){let{index:i,offset:s}=n.findIndex(e),a=n.maybeChild(i);if(s==e||a.isText)return n.cut(0,e).append(t).append(n.cut(e));let u=ng(a.content,e-s-1,t);return u&&n.replaceChild(i,a.copy(u))}function w5(n,e,t){if(t.openStart>n.depth)throw new ma("Inserted content deeper than insertion position");if(n.depth-t.openStart!=e.depth-t.openEnd)throw new ma("Inconsistent open depths");return rg(n,e,t,0)}function rg(n,e,t,r){let i=n.index(r),s=n.node(r);if(i==e.index(r)&&r<n.depth-t.openStart){let a=rg(n,e,t,r+1);return s.copy(s.content.replaceChild(i,a))}else if(t.content.size)if(!t.openStart&&!t.openEnd&&n.depth==r&&e.depth==r){let a=n.parent,u=a.content;return $r(a,u.cut(0,n.parentOffset).append(t.content).append(u.cut(e.parentOffset)))}else{let{start:a,end:u}=v5(t,n);return $r(s,sg(n,a,u,e,r))}else return $r(s,ga(n,e,r))}function ig(n,e){if(!e.type.compatibleContent(n.type))throw new ma("Cannot join "+e.type.name+" onto "+n.type.name)}function Pc(n,e,t){let r=n.node(t);return ig(r,e.node(t)),r}function zr(n,e){let t=e.length-1;t>=0&&n.isText&&n.sameMarkup(e[t])?e[t]=n.withText(e[t].text+n.text):e.push(n)}function bs(n,e,t,r){let i=(e||n).node(t),s=0,a=e?e.index(t):i.childCount;n&&(s=n.index(t),n.depth>t?s++:n.textOffset&&(zr(n.nodeAfter,r),s++));for(let u=s;u<a;u++)zr(i.child(u),r);e&&e.depth==t&&e.textOffset&&zr(e.nodeBefore,r)}function $r(n,e){return n.type.checkContent(e),n.copy(e)}function sg(n,e,t,r,i){let s=n.depth>i&&Pc(n,e,i+1),a=r.depth>i&&Pc(t,r,i+1),u=[];return bs(null,n,i,u),s&&a&&e.index(i)==t.index(i)?(ig(s,a),zr($r(s,sg(n,e,t,r,i+1)),u)):(s&&zr($r(s,ga(n,e,i+1)),u),bs(e,t,i,u),a&&zr($r(a,ga(t,r,i+1)),u)),bs(r,null,i,u),new z(u)}function ga(n,e,t){let r=[];if(bs(null,n,t,r),n.depth>t){let i=Pc(n,e,t+1);zr($r(i,ga(n,e,t+1)),r)}return bs(e,null,t,r),new z(r)}function v5(n,e){let t=e.depth-n.openStart,i=e.node(t).copy(n.content);for(let s=t-1;s>=0;s--)i=e.node(s).copy(z.from(i));return{start:i.resolveNoCache(n.openStart+t),end:i.resolveNoCache(i.content.size-n.openEnd-t)}}class Us{constructor(e,t,r){this.pos=e,this.path=t,this.parentOffset=r,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=e.child(t);return r?e.child(t).cut(r):i}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let r=this.path[t*3],i=t==0?0:this.path[t*3-1]+1;for(let s=0;s<e;s++)i+=r.child(s).nodeSize;return i}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return Te.none;if(this.textOffset)return e.child(t).marks;let r=e.maybeChild(t-1),i=e.maybeChild(t);if(!r){let u=r;r=i,i=u}let s=r.marks;for(var a=0;a<s.length;a++)s[a].type.spec.inclusive===!1&&(!i||!s[a].isInSet(i.marks))&&(s=s[a--].removeFromSet(s));return s}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let r=t.marks,i=e.parent.maybeChild(e.index());for(var s=0;s<r.length;s++)r[s].type.spec.inclusive===!1&&(!i||!r[s].isInSet(i.marks))&&(r=r[s--].removeFromSet(r));return r}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!t||t(this.node(r))))return new ya(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let t=1;t<=this.depth;t++)e+=(e?"/":"")+this.node(t).type.name+"_"+this.index(t-1);return e+":"+this.parentOffset}static resolve(e,t){if(!(t>=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");let r=[],i=0,s=t;for(let a=e;;){let{index:u,offset:c}=a.content.findIndex(s),h=s-c;if(r.push(a,u,i+c),!h||(a=a.child(u),a.isText))break;s=h-1,i+=c+1}return new Us(t,r,s)}static resolveCached(e,t){let r=og.get(e);if(r)for(let s=0;s<r.elts.length;s++){let a=r.elts[s];if(a.pos==t)return a}else og.set(e,r=new S5);let i=r.elts[r.i]=Us.resolve(e,t);return r.i=(r.i+1)%x5,i}}class S5{constructor(){this.elts=[],this.i=0}}const x5=12,og=new WeakMap;class ya{constructor(e,t,r){this.$from=e,this.$to=t,this.depth=r}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)}}const C5=Object.create(null);let fr=class vh{constructor(e,t,r,i=Te.none){this.type=e,this.attrs=t,this.marks=i,this.content=r||z.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,r,i=0){this.content.nodesBetween(e,t,r,i,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,t,r,i){return this.content.textBetween(e,t,r,i)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,r){return this.type==e&&pa(this.attrs,t||e.defaultAttrs||C5)&&Te.sameSet(this.marks,r||Te.none)}copy(e=null){return e==this.content?this:new vh(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new vh(this.type,this.attrs,this.content,e)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,r=!1){if(e==t)return K.empty;let i=this.resolve(e),s=this.resolve(t),a=r?0:i.sharedDepth(t),u=i.start(a),h=i.node(a).content.cut(i.pos-u,s.pos-u);return new K(h,i.depth-a,s.depth-a)}replace(e,t,r){return w5(this.resolve(e),this.resolve(t),r)}nodeAt(e){for(let t=this;;){let{index:r,offset:i}=t.content.findIndex(e);if(t=t.maybeChild(r),!t)return null;if(i==e||t.isText)return t;e-=i+1}}childAfter(e){let{index:t,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(t),index:t,offset:r};let i=this.content.child(t-1);return{node:i,index:t-1,offset:r-i.nodeSize}}resolve(e){return Us.resolveCached(this,e)}resolveNoCache(e){return Us.resolve(this,e)}rangeHasMark(e,t,r){let i=!1;return t>e&&this.nodesBetween(e,t,s=>(r.isInSet(s.marks)&&(i=!0),!i)),i}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 e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),ag(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,r=z.empty,i=0,s=r.childCount){let a=this.contentMatchAt(e).matchFragment(r,i,s),u=a&&a.matchFragment(this.content,t);if(!u||!u.validEnd)return!1;for(let c=i;c<s;c++)if(!this.type.allowsMarks(r.child(c).marks))return!1;return!0}canReplaceWith(e,t,r,i){if(i&&!this.type.allowsMarks(i))return!1;let s=this.contentMatchAt(e).matchType(r),a=s&&s.matchFragment(this.content,t);return a?a.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=Te.none;for(let t=0;t<this.marks.length;t++){let r=this.marks[t];r.type.checkAttrs(r.attrs),e=r.addToSet(e)}if(!Te.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(t=>t.type.name)}`);this.content.forEach(t=>t.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(t=>t.toJSON())),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let r;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=t.marks.map(e.markFromJSON)}if(t.type=="text"){if(typeof t.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(t.text,r)}let i=z.fromJSON(e,t.content),s=e.nodeType(t.type).create(t.attrs,i,r);return s.type.checkAttrs(s.attrs),s}};fr.prototype.text=void 0;class Ll extends fr{constructor(e,t,r,i){if(super(e,t,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):ag(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new Ll(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Ll(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function ag(n,e){for(let t=n.length-1;t>=0;t--)e=n[t].type.name+"("+e+")";return e}class Xr{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let r=new E5(e,t);if(r.next==null)return Xr.empty;let i=lg(r);r.next&&r.err("Unexpected trailing text");let s=N5(I5(i));return R5(s,r),s}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,r=e.childCount){let i=this;for(let s=t;i&&s<r;s++)i=i.matchType(e.child(s).type);return i}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let r=0;r<e.next.length;r++)if(this.next[t].type==e.next[r].type)return!0;return!1}fillBefore(e,t=!1,r=0){let i=[this];function s(a,u){let c=a.matchFragment(e,r);if(c&&(!t||c.validEnd))return z.from(u.map(h=>h.createAndFill()));for(let h=0;h<a.next.length;h++){let{type:p,next:m}=a.next[h];if(!(p.isText||p.hasRequiredAttrs())&&i.indexOf(m)==-1){i.push(m);let y=s(m,u.concat(p));if(y)return y}}return null}return s(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let i=r.shift(),s=i.match;if(s.matchType(e)){let a=[];for(let u=i;u.type;u=u.via)a.push(u.type);return a.reverse()}for(let a=0;a<s.next.length;a++){let{type:u,next:c}=s.next[a];!u.isLeaf&&!u.hasRequiredAttrs()&&!(u.name in t)&&(!i.type||c.validEnd)&&(r.push({match:u.contentMatch,type:u,via:i}),t[u.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(r){e.push(r);for(let i=0;i<r.next.length;i++)e.indexOf(r.next[i].next)==-1&&t(r.next[i].next)}return t(this),e.map((r,i)=>{let s=i+(r.validEnd?"*":" ")+" ";for(let a=0;a<r.next.length;a++)s+=(a?", ":"")+r.next[a].type.name+"->"+e.indexOf(r.next[a].next);return s}).join(`
|
|
31
|
-
`)}}Xr.empty=new Xr(!0);class E5{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.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(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function lg(n){let e=[];do e.push(k5(n));while(n.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function k5(n){let e=[];do e.push(A5(n));while(n.next&&n.next!=")"&&n.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function A5(n){let e=M5(n);for(;;)if(n.eat("+"))e={type:"plus",expr:e};else if(n.eat("*"))e={type:"star",expr:e};else if(n.eat("?"))e={type:"opt",expr:e};else if(n.eat("{"))e=T5(n,e);else break;return e}function ug(n){/\D/.test(n.next)&&n.err("Expected number, got '"+n.next+"'");let e=Number(n.next);return n.pos++,e}function T5(n,e){let t=ug(n),r=t;return n.eat(",")&&(n.next!="}"?r=ug(n):r=-1),n.eat("}")||n.err("Unclosed braced range"),{type:"range",min:t,max:r,expr:e}}function O5(n,e){let t=n.nodeTypes,r=t[e];if(r)return[r];let i=[];for(let s in t){let a=t[s];a.isInGroup(e)&&i.push(a)}return i.length==0&&n.err("No node type or group '"+e+"' found"),i}function M5(n){if(n.eat("(")){let e=lg(n);return n.eat(")")||n.err("Missing closing paren"),e}else if(/\W/.test(n.next))n.err("Unexpected token '"+n.next+"'");else{let e=O5(n,n.next).map(t=>(n.inline==null?n.inline=t.isInline:n.inline!=t.isInline&&n.err("Mixing inline and block content"),{type:"name",value:t}));return n.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function I5(n){let e=[[]];return i(s(n,0),t()),e;function t(){return e.push([])-1}function r(a,u,c){let h={term:c,to:u};return e[a].push(h),h}function i(a,u){a.forEach(c=>c.to=u)}function s(a,u){if(a.type=="choice")return a.exprs.reduce((c,h)=>c.concat(s(h,u)),[]);if(a.type=="seq")for(let c=0;;c++){let h=s(a.exprs[c],u);if(c==a.exprs.length-1)return h;i(h,u=t())}else if(a.type=="star"){let c=t();return r(u,c),i(s(a.expr,c),c),[r(c)]}else if(a.type=="plus"){let c=t();return i(s(a.expr,u),c),i(s(a.expr,c),c),[r(c)]}else{if(a.type=="opt")return[r(u)].concat(s(a.expr,u));if(a.type=="range"){let c=u;for(let h=0;h<a.min;h++){let p=t();i(s(a.expr,c),p),c=p}if(a.max==-1)i(s(a.expr,c),c);else for(let h=a.min;h<a.max;h++){let p=t();r(c,p),i(s(a.expr,c),p),c=p}return[r(c)]}else{if(a.type=="name")return[r(u,void 0,a.value)];throw new Error("Unknown expr type")}}}}function cg(n,e){return e-n}function fg(n,e){let t=[];return r(e),t.sort(cg);function r(i){let s=n[i];if(s.length==1&&!s[0].term)return r(s[0].to);t.push(i);for(let a=0;a<s.length;a++){let{term:u,to:c}=s[a];!u&&t.indexOf(c)==-1&&r(c)}}}function N5(n){let e=Object.create(null);return t(fg(n,0));function t(r){let i=[];r.forEach(a=>{n[a].forEach(({term:u,to:c})=>{if(!u)return;let h;for(let p=0;p<i.length;p++)i[p][0]==u&&(h=i[p][1]);fg(n,c).forEach(p=>{h||i.push([u,h=[]]),h.indexOf(p)==-1&&h.push(p)})})});let s=e[r.join(",")]=new Xr(r.indexOf(n.length-1)>-1);for(let a=0;a<i.length;a++){let u=i[a][1].sort(cg);s.next.push({type:i[a][0],next:e[u.join(",")]||t(u)})}return s}}function R5(n,e){for(let t=0,r=[n];t<r.length;t++){let i=r[t],s=!i.validEnd,a=[];for(let u=0;u<i.next.length;u++){let{type:c,next:h}=i.next[u];a.push(c.name),s&&!(c.isText||c.hasRequiredAttrs())&&(s=!1),r.indexOf(h)==-1&&r.push(h)}s&&e.err("Only non-generatable nodes ("+a.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function hg(n){let e=Object.create(null);for(let t in n){let r=n[t];if(!r.hasDefault)return null;e[t]=r.default}return e}function dg(n,e){let t=Object.create(null);for(let r in n){let i=e&&e[r];if(i===void 0){let s=n[r];if(s.hasDefault)i=s.default;else throw new RangeError("No value supplied for attribute "+r)}t[r]=i}return t}function pg(n,e,t,r){for(let i in e)if(!(i in n))throw new RangeError(`Unsupported attribute ${i} for ${t} of type ${i}`);for(let i in n){let s=n[i];s.validate&&s.validate(e[i])}}function mg(n,e){let t=Object.create(null);if(e)for(let r in e)t[r]=new P5(n,r,e[r]);return t}let gg=class qy{constructor(e,t,r){this.name=e,this.schema=t,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=mg(e,r.attrs),this.defaultAttrs=hg(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==Xr.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:dg(this.attrs,e)}create(e=null,t,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new fr(this,this.computeAttrs(e),z.from(t),Te.setFrom(r))}createChecked(e=null,t,r){return t=z.from(t),this.checkContent(t),new fr(this,this.computeAttrs(e),t,Te.setFrom(r))}createAndFill(e=null,t,r){if(e=this.computeAttrs(e),t=z.from(t),t.size){let a=this.contentMatch.fillBefore(t);if(!a)return null;t=a.append(t)}let i=this.contentMatch.matchFragment(t),s=i&&i.fillBefore(z.empty,!0);return s?new fr(this,e,t.append(s),Te.setFrom(r)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let r=0;r<e.childCount;r++)if(!this.allowsMarks(e.child(r).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){pg(this.attrs,e,"node",this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let t;for(let r=0;r<e.length;r++)this.allowsMarkType(e[r].type)?t&&t.push(e[r]):t||(t=e.slice(0,r));return t?t.length?t:Te.none:e}static compile(e,t){let r=Object.create(null);e.forEach((s,a)=>r[s]=new qy(s,t,a));let i=t.spec.topNode||"doc";if(!r[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let s in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};function L5(n,e,t){let r=t.split("|");return i=>{let s=i===null?"null":typeof i;if(r.indexOf(s)<0)throw new RangeError(`Expected value of type ${r} for attribute ${e} on type ${n}, got ${s}`)}}class P5{constructor(e,t,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?L5(e,t,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class Pl{constructor(e,t,r,i){this.name=e,this.rank=t,this.schema=r,this.spec=i,this.attrs=mg(e,i.attrs),this.excluded=null;let s=hg(this.attrs);this.instance=s?new Te(this,s):null}create(e=null){return!e&&this.instance?this.instance:new Te(this,dg(this.attrs,e))}static compile(e,t){let r=Object.create(null),i=0;return e.forEach((s,a)=>r[s]=new Pl(s,i++,t,a)),r}removeFromSet(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}isInSet(e){for(let t=0;t<e.length;t++)if(e[t].type==this)return e[t]}checkAttrs(e){pg(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class yg{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let t=this.spec={};for(let i in e)t[i]=e[i];t.nodes=et.from(e.nodes),t.marks=et.from(e.marks||{}),this.nodes=gg.compile(this.spec.nodes,this),this.marks=Pl.compile(this.spec.marks,this);let r=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let s=this.nodes[i],a=s.spec.content||"",u=s.spec.marks;if(s.contentMatch=r[a]||(r[a]=Xr.parse(a,this.nodes)),s.inlineContent=s.contentMatch.inlineContent,s.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!s.isInline||!s.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=s}s.markSet=u=="_"?null:u?bg(this,u.split(" ")):u==""||!s.inlineContent?[]:null}for(let i in this.marks){let s=this.marks[i],a=s.spec.excludes;s.excluded=a==null?[s]:a==""?[]:bg(this,a.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,t=null,r,i){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof gg){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(t,r,i)}text(e,t){let r=this.nodes.text;return new Ll(r,r.defaultAttrs,e,Te.setFrom(t))}mark(e,t){return typeof e=="string"&&(e=this.marks[e]),e.create(t)}nodeFromJSON(e){return fr.fromJSON(this,e)}markFromJSON(e){return Te.fromJSON(this,e)}nodeType(e){let t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t}}function bg(n,e){let t=[];for(let r=0;r<e.length;r++){let i=e[r],s=n.marks[i],a=s;if(s)t.push(s);else for(let u in n.marks){let c=n.marks[u];(i=="_"||c.spec.group&&c.spec.group.split(" ").indexOf(i)>-1)&&t.push(a=c)}if(!a)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return t}function D5(n){return n.tag!=null}function F5(n){return n.style!=null}let _s=class Sh{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let r=this.matchedStyles=[];t.forEach(i=>{if(D5(i))this.tags.push(i);else if(F5(i)){let s=/[^=]*/.exec(i.style)[0];r.indexOf(s)<0&&r.push(s),this.styles.push(i)}}),this.normalizeLists=!this.tags.some(i=>{if(!/^(ul|ol)\b/.test(i.tag)||!i.node)return!1;let s=e.nodes[i.node];return s.contentMatch.matchType(s)})}parse(e,t={}){let r=new Sg(this,t,!1);return r.addAll(e,Te.none,t.from,t.to),r.finish()}parseSlice(e,t={}){let r=new Sg(this,t,!0);return r.addAll(e,Te.none,t.from,t.to),K.maxOpen(r.finish())}matchTag(e,t,r){for(let i=r?this.tags.indexOf(r)+1:0;i<this.tags.length;i++){let s=this.tags[i];if($5(e,s.tag)&&(s.namespace===void 0||e.namespaceURI==s.namespace)&&(!s.context||t.matchesContext(s.context))){if(s.getAttrs){let a=s.getAttrs(e);if(a===!1)continue;s.attrs=a||void 0}return s}}}matchStyle(e,t,r,i){for(let s=i?this.styles.indexOf(i)+1:0;s<this.styles.length;s++){let a=this.styles[s],u=a.style;if(!(u.indexOf(e)!=0||a.context&&!r.matchesContext(a.context)||u.length>e.length&&(u.charCodeAt(e.length)!=61||u.slice(e.length+1)!=t))){if(a.getAttrs){let c=a.getAttrs(t);if(c===!1)continue;a.attrs=c||void 0}return a}}}static schemaRules(e){let t=[];function r(i){let s=i.priority==null?50:i.priority,a=0;for(;a<t.length;a++){let u=t[a];if((u.priority==null?50:u.priority)<s)break}t.splice(a,0,i)}for(let i in e.marks){let s=e.marks[i].spec.parseDOM;s&&s.forEach(a=>{r(a=xg(a)),a.mark||a.ignore||a.clearMark||(a.mark=i)})}for(let i in e.nodes){let s=e.nodes[i].spec.parseDOM;s&&s.forEach(a=>{r(a=xg(a)),a.node||a.ignore||a.mark||(a.node=i)})}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Sh(e,Sh.schemaRules(e)))}};const _g={address:!0,article:!0,aside:!0,blockquote:!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},B5={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},wg={ol:!0,ul:!0},ws=1,Dc=2,ba=4;function vg(n,e,t){return e!=null?(e?ws:0)|(e==="full"?Dc:0):n&&n.whitespace=="pre"?ws|Dc:t&-5}class _a{constructor(e,t,r,i,s,a){this.type=e,this.attrs=t,this.marks=r,this.solid=i,this.options=a,this.content=[],this.activeMarks=Te.none,this.match=s||(a&ba?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(z.from(e));if(t)this.match=this.type.contentMatch.matchFragment(t);else{let r=this.type.contentMatch,i;return(i=r.findWrapping(e.type))?(this.match=r,i):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&ws)){let r=this.content[this.content.length-1],i;if(r&&r.isText&&(i=/[ \t\r\n\u000c]+$/.exec(r.text))){let s=r;r.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=s.withText(s.text.slice(0,s.text.length-i[0].length))}}let t=z.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(z.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!_g.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class Sg{constructor(e,t,r){this.parser=e,this.options=t,this.isOpen=r,this.open=0,this.localPreserveWS=!1;let i=t.topNode,s,a=vg(null,t.preserveWhitespace,0)|(r?ba:0);i?s=new _a(i.type,i.attrs,Te.none,!0,t.topMatch||i.type.contentMatch,a):r?s=new _a(null,null,Te.none,!0,null,a):s=new _a(e.schema.topNodeType,null,Te.none,!0,null,a),this.nodes=[s],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,t){e.nodeType==3?this.addTextNode(e,t):e.nodeType==1&&this.addElement(e,t)}addTextNode(e,t){let r=e.nodeValue,i=this.top,s=i.options&Dc?"full":this.localPreserveWS||(i.options&ws)>0;if(s==="full"||i.inlineContext(e)||/[^ \t\r\n\u000c]/.test(r)){if(s)s!=="full"?r=r.replace(/\r?\n|\r/g," "):r=r.replace(/\r\n?/g,`
|
|
32
|
-
`);else if(r=r.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(r)&&this.open==this.nodes.length-1){let a=i.content[i.content.length-1],u=e.previousSibling;(!a||u&&u.nodeName=="BR"||a.isText&&/[ \t\r\n\u000c]$/.test(a.text))&&(r=r.slice(1))}r&&this.insertNode(this.parser.schema.text(r),t),this.findInText(e)}else this.findInside(e)}addElement(e,t,r){let i=this.localPreserveWS,s=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let a=e.nodeName.toLowerCase(),u;
|
|
33
|
-
`),t)}ignoreFallback(e,t){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),t)}readStyles(e,t){let r=e.style;if(r&&r.length)for(let i=0;i<this.parser.matchedStyles.length;i++){let s=this.parser.matchedStyles[i],a=r.getPropertyValue(s);if(a)for(let u=void 0;;){let c=this.parser.matchStyle(s,a,this,u);if(!c)break;if(c.ignore)return null;if(c.clearMark?t=t.filter(h=>!c.clearMark(h)):t=t.concat(this.parser.schema.marks[c.mark].create(c.attrs)),c.consuming===!1)u=c;else break}}return t}addElementByRule(e,t,r,i){let s,a;if(t.node)if(a=this.parser.schema.nodes[t.node],a.isLeaf)this.insertNode(a.create(t.attrs),r)||this.leafFallback(e,r);else{let c=this.enter(a,t.attrs||null,r,t.preserveWhitespace);c&&(s=!0,r=c)}else{let c=this.parser.schema.marks[t.mark];r=r.concat(c.create(t.attrs))}let u=this.top;if(a&&a.isLeaf)this.findInside(e);else if(i)this.addElement(e,r,i);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(c=>this.insertNode(c,r));else{let c=e;typeof t.contentElement=="string"?c=e.querySelector(t.contentElement):typeof t.contentElement=="function"?c=t.contentElement(e):t.contentElement&&(c=t.contentElement),this.findAround(e,c,!0),this.addAll(c,r),this.findAround(e,c,!1)}s&&this.sync(u)&&this.open--}addAll(e,t,r,i){let s=r||0;for(let a=r?e.childNodes[r]:e.firstChild,u=i==null?null:e.childNodes[i];a!=u;a=a.nextSibling,++s)this.findAtPoint(e,s),this.addDOM(a,t);this.findAtPoint(e,s)}findPlace(e,t){let r,i;for(let s=this.open;s>=0;s--){let a=this.nodes[s],u=a.findWrapping(e);if(u&&(!r||r.length>u.length)&&(r=u,i=a,!u.length)||a.solid)break}if(!r)return null;this.sync(i);for(let s=0;s<r.length;s++)t=this.enterInner(r[s],null,t,!1);return t}insertNode(e,t){if(e.isInline&&this.needsBlock&&!this.top.type){let i=this.textblockFromContext();i&&(t=this.enterInner(i,null,t))}let r=this.findPlace(e,t);if(r){this.closeExtra();let i=this.top;i.match&&(i.match=i.match.matchType(e.type));let s=Te.none;for(let a of r.concat(e.marks))(i.type?i.type.allowsMarkType(a.type):Cg(a.type,e.type))&&(s=a.addToSet(s));return i.content.push(e.mark(s)),!0}return!1}enter(e,t,r,i){let s=this.findPlace(e.create(t),r);return s&&(s=this.enterInner(e,t,r,!0,i)),s}enterInner(e,t,r,i=!1,s){this.closeExtra();let a=this.top;a.match=a.match&&a.match.matchType(e);let u=vg(e,s,a.options);a.options&ba&&a.content.length==0&&(u|=ba);let c=Te.none;return r=r.filter(h=>(a.type?a.type.allowsMarkType(h.type):Cg(h.type,e))?(c=h.addToSet(c),!1):!0),this.nodes.push(new _a(e,t,c,i,null,u)),this.open++,r}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));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(e){for(let t=this.open;t>=0;t--){if(this.nodes[t]==e)return this.open=t,!0;this.localPreserveWS&&(this.nodes[t].options|=ws)}return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let r=this.nodes[t].content;for(let i=r.length-1;i>=0;i--)e+=r[i].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&this.find[r].offset==t&&(this.find[r].pos=this.currentPos)}findInside(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].pos==null&&e.nodeType==1&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}findAround(e,t,r){if(e!=t&&this.find)for(let i=0;i<this.find.length;i++)this.find[i].pos==null&&e.nodeType==1&&e.contains(this.find[i].node)&&t.compareDocumentPosition(this.find[i].node)&(r?2:4)&&(this.find[i].pos=this.currentPos)}findInText(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split("/"),r=this.options.context,i=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),s=-(r?r.depth+1:0)+(i?0:1),a=(u,c)=>{for(;u>=0;u--){let h=t[u];if(h==""){if(u==t.length-1||u==0)continue;for(;c>=s;c--)if(a(u-1,c))return!0;return!1}else{let p=c>0||c==0&&i?this.nodes[c].type:r&&c>=s?r.node(c-s).type:null;if(!p||p.name!=h&&!p.isInGroup(h))return!1;c--}}return!0};return a(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let r=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let t in this.parser.schema.nodes){let r=this.parser.schema.nodes[t];if(r.isTextblock&&r.defaultAttrs)return r}}}function z5(n){for(let e=n.firstChild,t=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&wg.hasOwnProperty(r)&&t?(t.appendChild(e),e=t):r=="li"?t=e:r&&(t=null)}}function $5(n,e){return(n.matches||n.msMatchesSelector||n.webkitMatchesSelector||n.mozMatchesSelector).call(n,e)}function xg(n){let e={};for(let t in n)e[t]=n[t];return e}function Cg(n,e){let t=e.schema.nodes;for(let r in t){let i=t[r];if(!i.allowsMarkType(n))continue;let s=[],a=u=>{s.push(u);for(let c=0;c<u.edgeCount;c++){let{type:h,next:p}=u.edge(c);if(h==e||s.indexOf(p)<0&&a(p))return!0}};if(a(i.contentMatch))return!0}}class Vs{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},r){r||(r=Fc(t).createDocumentFragment());let i=r,s=[];return e.forEach(a=>{if(s.length||a.marks.length){let u=0,c=0;for(;u<s.length&&c<a.marks.length;){let h=a.marks[c];if(!this.marks[h.type.name]){c++;continue}if(!h.eq(s[u][0])||h.type.spec.spanning===!1)break;u++,c++}for(;u<s.length;)i=s.pop()[1];for(;c<a.marks.length;){let h=a.marks[c++],p=this.serializeMark(h,a.isInline,t);p&&(s.push([h,i]),i.appendChild(p.dom),i=p.contentDOM||p.dom)}}i.appendChild(this.serializeNodeInner(a,t))}),r}serializeNodeInner(e,t){let{dom:r,contentDOM:i}=wa(Fc(t),this.nodes[e.type.name](e),null,e.attrs);if(i){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,t,i)}return r}serializeNode(e,t={}){let r=this.serializeNodeInner(e,t);for(let i=e.marks.length-1;i>=0;i--){let s=this.serializeMark(e.marks[i],e.isInline,t);s&&((s.contentDOM||s.dom).appendChild(r),r=s.dom)}return r}serializeMark(e,t,r={}){let i=this.marks[e.type.name];return i&&wa(Fc(r),i(e,t),null,e.attrs)}static renderSpec(e,t,r=null,i){return wa(e,t,r,i)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new Vs(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=Eg(e.nodes);return t.text||(t.text=r=>r.text),t}static marksFromSchema(e){return Eg(e.marks)}}function Eg(n){let e={};for(let t in n){let r=n[t].spec.toDOM;r&&(e[t]=r)}return e}function Fc(n){return n.document||window.document}const kg=new WeakMap;function H5(n){let e=kg.get(n);return e===void 0&&kg.set(n,e=W5(n)),e}function W5(n){let e=null;function t(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")e||(e=[]),e.push(r);else for(let i=0;i<r.length;i++)t(r[i]);else for(let i in r)t(r[i])}return t(n),e}function wa(n,e,t,r){if(typeof e=="string")return{dom:n.createTextNode(e)};if(e.nodeType!=null)return{dom:e};if(e.dom&&e.dom.nodeType!=null)return e;let i=e[0],s;if(typeof i!="string")throw new RangeError("Invalid array passed to renderSpec");if(r&&(s=H5(r))&&s.indexOf(e)>-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 a=i.indexOf(" ");a>0&&(t=i.slice(0,a),i=i.slice(a+1));let u,c=t?n.createElementNS(t,i):n.createElement(i),h=e[1],p=1;if(h&&typeof h=="object"&&h.nodeType==null&&!Array.isArray(h)){p=2;for(let m in h)if(h[m]!=null){let y=m.indexOf(" ");y>0?c.setAttributeNS(m.slice(0,y),m.slice(y+1),h[m]):c.setAttribute(m,h[m])}}for(let m=p;m<e.length;m++){let y=e[m];if(y===0){if(m<e.length-1||m>p)throw new RangeError("Content hole must be the only child of its parent node");return{dom:c,contentDOM:c}}else{let{dom:_,contentDOM:S}=wa(n,y,t,r);if(c.appendChild(_),S){if(u)throw new RangeError("Multiple content holes");u=S}}}return{dom:c,contentDOM:u}}const Ag=65535,Tg=Math.pow(2,16);function V5(n,e){return n+e*Tg}function Og(n){return n&Ag}function U5(n){return(n-(n&Ag))/Tg}const Mg=1,Ig=2,va=4,Ng=8;class Bc{constructor(e,t,r){this.pos=e,this.delInfo=t,this.recover=r}get deleted(){return(this.delInfo&Ng)>0}get deletedBefore(){return(this.delInfo&(Mg|va))>0}get deletedAfter(){return(this.delInfo&(Ig|va))>0}get deletedAcross(){return(this.delInfo&va)>0}}class Lt{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&Lt.empty)return Lt.empty}recover(e){let t=0,r=Og(e);if(!this.inverted)for(let i=0;i<r;i++)t+=this.ranges[i*3+2]-this.ranges[i*3+1];return this.ranges[r*3]+t+U5(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,r){let i=0,s=this.inverted?2:1,a=this.inverted?1:2;for(let u=0;u<this.ranges.length;u+=3){let c=this.ranges[u]-(this.inverted?i:0);if(c>e)break;let h=this.ranges[u+s],p=this.ranges[u+a],m=c+h;if(e<=m){let y=h?e==c?-1:e==m?1:t:t,_=c+i+(y<0?0:p);if(r)return _;let S=e==(t<0?c:m)?null:V5(u/3,e-c),E=e==c?Ig:e==m?Mg:va;return(t<0?e!=c:e!=m)&&(E|=Ng),new Bc(_,E,S)}i+=p-h}return r?e+i:new Bc(e+i,0,null)}touches(e,t){let r=0,i=Og(t),s=this.inverted?2:1,a=this.inverted?1:2;for(let u=0;u<this.ranges.length;u+=3){let c=this.ranges[u]-(this.inverted?r:0);if(c>e)break;let h=this.ranges[u+s],p=c+h;if(e<=p&&u==i*3)return!0;r+=this.ranges[u+a]-h}return!1}forEach(e){let t=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,s=0;i<this.ranges.length;i+=3){let a=this.ranges[i],u=a-(this.inverted?s:0),c=a+(this.inverted?0:s),h=this.ranges[i+t],p=this.ranges[i+r];e(u,u+h,c,c+p),s+=p-h}}invert(){return new Lt(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?Lt.empty:new Lt(e<0?[0,-e,0]:[0,0,e])}}Lt.empty=new Lt([]);class Fi{constructor(e=[],t,r=0,i=e.length){this.maps=e,this.mirror=t,this.from=r,this.to=i}slice(e=0,t=this.maps.length){return new Fi(this.maps,this.mirror,e,t)}copy(){return new Fi(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)}appendMap(e,t){this.to=this.maps.push(e),t!=null&&this.setMirror(this.maps.length-1,t)}appendMapping(e){for(let t=0,r=this.maps.length;t<e.maps.length;t++){let i=e.getMirror(t);this.appendMap(e.maps[t],i!=null&&i<t?r+i:void 0)}}getMirror(e){if(this.mirror){for(let t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]}}setMirror(e,t){this.mirror||(this.mirror=[]),this.mirror.push(e,t)}appendMappingInverted(e){for(let t=e.maps.length-1,r=this.maps.length+e.maps.length;t>=0;t--){let i=e.getMirror(t);this.appendMap(e.maps[t].invert(),i!=null&&i>t?r-i-1:void 0)}}invert(){let e=new Fi;return e.appendMappingInverted(this),e}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let r=this.from;r<this.to;r++)e=this.maps[r].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,r){let i=0;for(let s=this.from;s<this.to;s++){let a=this.maps[s],u=a.mapResult(e,t);if(u.recover!=null){let c=this.getMirror(s);if(c!=null&&c>s&&c<this.to){s=c,e=this.maps[c].recover(u.recover);continue}}i|=u.delInfo,e=u.pos}return r?e:new Bc(e,i,null)}}const zc=Object.create(null);class Ue{getMap(){return Lt.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=zc[t.stepType];if(!r)throw new RangeError(`No step type ${t.stepType} defined`);return r.fromJSON(e,t)}static jsonID(e,t){if(e in zc)throw new RangeError("Duplicate use of step JSON ID "+e);return zc[e]=t,t.prototype.jsonID=e,t}}class De{constructor(e,t){this.doc=e,this.failed=t}static ok(e){return new De(e,null)}static fail(e){return new De(null,e)}static fromReplace(e,t,r,i){try{return De.ok(e.replace(t,r,i))}catch(s){if(s instanceof ma)return De.fail(s.message);throw s}}}function $c(n,e,t){let r=[];for(let i=0;i<n.childCount;i++){let s=n.child(i);s.content.size&&(s=s.copy($c(s.content,e,s))),s.isInline&&(s=e(s,t,i)),r.push(s)}return z.fromArray(r)}class Er extends Ue{constructor(e,t,r){super(),this.from=e,this.to=t,this.mark=r}apply(e){let t=e.slice(this.from,this.to),r=e.resolve(this.from),i=r.node(r.sharedDepth(this.to)),s=new K($c(t.content,(a,u)=>!a.isAtom||!u.type.allowsMarkType(this.mark.type)?a:a.mark(this.mark.addToSet(a.marks)),i),t.openStart,t.openEnd);return De.fromReplace(e,this.from,this.to,s)}invert(){return new wn(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new Er(t.pos,r.pos,this.mark)}merge(e){return e instanceof Er&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Er(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Er(t.from,t.to,e.markFromJSON(t.mark))}}Ue.jsonID("addMark",Er);class wn extends Ue{constructor(e,t,r){super(),this.from=e,this.to=t,this.mark=r}apply(e){let t=e.slice(this.from,this.to),r=new K($c(t.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),t.openStart,t.openEnd);return De.fromReplace(e,this.from,this.to,r)}invert(){return new Er(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new wn(t.pos,r.pos,this.mark)}merge(e){return e instanceof wn&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new wn(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new wn(t.from,t.to,e.markFromJSON(t.mark))}}Ue.jsonID("removeMark",wn);class kr extends Ue{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return De.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return De.fromReplace(e,this.pos,this.pos+1,new K(z.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);if(t){let r=this.mark.addToSet(t.marks);if(r.length==t.marks.length){for(let i=0;i<t.marks.length;i++)if(!t.marks[i].isInSet(r))return new kr(this.pos,t.marks[i]);return new kr(this.pos,this.mark)}}return new Bi(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new kr(t.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new kr(t.pos,e.markFromJSON(t.mark))}}Ue.jsonID("addNodeMark",kr);class Bi extends Ue{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return De.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return De.fromReplace(e,this.pos,this.pos+1,new K(z.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);return!t||!this.mark.isInSet(t.marks)?this:new kr(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new Bi(t.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new Bi(t.pos,e.markFromJSON(t.mark))}}Ue.jsonID("removeNodeMark",Bi);class je extends Ue{constructor(e,t,r,i=!1){super(),this.from=e,this.to=t,this.slice=r,this.structure=i}apply(e){return this.structure&&Hc(e,this.from,this.to)?De.fail("Structure replace would overwrite content"):De.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new Lt([this.from,this.to-this.from,this.slice.size])}invert(e){return new je(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deletedAcross&&r.deletedAcross?null:new je(t.pos,Math.max(t.pos,r.pos),this.slice)}merge(e){if(!(e instanceof je)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let t=this.slice.size+e.slice.size==0?K.empty:new K(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new je(this.from,this.to+(e.to-e.from),t,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let t=this.slice.size+e.slice.size==0?K.empty:new K(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new je(e.from,this.to,t,this.structure)}else return null}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new je(t.from,t.to,K.fromJSON(e,t.slice),!!t.structure)}}Ue.jsonID("replace",je);class Je extends Ue{constructor(e,t,r,i,s,a,u=!1){super(),this.from=e,this.to=t,this.gapFrom=r,this.gapTo=i,this.slice=s,this.insert=a,this.structure=u}apply(e){if(this.structure&&(Hc(e,this.from,this.gapFrom)||Hc(e,this.gapTo,this.to)))return De.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return De.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,t.content);return r?De.fromReplace(e,this.from,this.to,r):De.fail("Content does not fit in gap")}getMap(){return new Lt([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let t=this.gapTo-this.gapFrom;return new Je(this.from,this.from+this.slice.size+t,this.from+this.insert,this.from+this.insert+t,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),i=this.from==this.gapFrom?t.pos:e.map(this.gapFrom,-1),s=this.to==this.gapTo?r.pos:e.map(this.gapTo,1);return t.deletedAcross&&r.deletedAcross||i<t.pos||s>r.pos?null:new Je(t.pos,r.pos,i,s,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number"||typeof t.gapFrom!="number"||typeof t.gapTo!="number"||typeof t.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Je(t.from,t.to,t.gapFrom,t.gapTo,K.fromJSON(e,t.slice),t.insert,!!t.structure)}}Ue.jsonID("replaceAround",Je);function Hc(n,e,t){let r=n.resolve(e),i=t-e,s=r.depth;for(;i>0&&s>0&&r.indexAfter(s)==r.node(s).childCount;)s--,i--;if(i>0){let a=r.node(s).maybeChild(r.indexAfter(s));for(;i>0;){if(!a||a.isLeaf)return!0;a=a.firstChild,i--}}return!1}function q5(n,e,t,r){let i=[],s=[],a,u;n.doc.nodesBetween(e,t,(c,h,p)=>{if(!c.isInline)return;let m=c.marks;if(!r.isInSet(m)&&p.type.allowsMarkType(r.type)){let y=Math.max(h,e),_=Math.min(h+c.nodeSize,t),S=r.addToSet(m);for(let E=0;E<m.length;E++)m[E].isInSet(S)||(a&&a.to==y&&a.mark.eq(m[E])?a.to=_:i.push(a=new wn(y,_,m[E])));u&&u.to==y?u.to=_:s.push(u=new Er(y,_,r))}}),i.forEach(c=>n.step(c)),s.forEach(c=>n.step(c))}function K5(n,e,t,r){let i=[],s=0;n.doc.nodesBetween(e,t,(a,u)=>{if(!a.isInline)return;s++;let c=null;if(r instanceof Pl){let h=a.marks,p;for(;p=r.isInSet(h);)(c||(c=[])).push(p),h=p.removeFromSet(h)}else r?r.isInSet(a.marks)&&(c=[r]):c=a.marks;if(c&&c.length){let h=Math.min(u+a.nodeSize,t);for(let p=0;p<c.length;p++){let m=c[p],y;for(let _=0;_<i.length;_++){let S=i[_];S.step==s-1&&m.eq(i[_].style)&&(y=S)}y?(y.to=h,y.step=s):i.push({style:m,from:Math.max(u,e),to:h,step:s})}}}),i.forEach(a=>n.step(new wn(a.from,a.to,a.style)))}function Wc(n,e,t,r=t.contentMatch,i=!0){let s=n.doc.nodeAt(e),a=[],u=e+1;for(let c=0;c<s.childCount;c++){let h=s.child(c),p=u+h.nodeSize,m=r.matchType(h.type);if(!m)a.push(new je(u,p,K.empty));else{r=m;for(let y=0;y<h.marks.length;y++)t.allowsMarkType(h.marks[y].type)||n.step(new wn(u,p,h.marks[y]));if(i&&h.isText&&t.whitespace!="pre"){let y,_=/\r?\n|\r/g,S;for(;y=_.exec(h.text);)S||(S=new K(z.from(t.schema.text(" ",t.allowedMarks(h.marks))),0,0)),a.push(new je(u+y.index,u+y.index+y[0].length,S))}}u=p}if(!r.validEnd){let c=r.fillBefore(z.empty,!0);n.replace(u,u,new K(c,0,0))}for(let c=a.length-1;c>=0;c--)n.step(a[c])}function G5(n,e,t){return(e==0||n.canReplace(e,n.childCount))&&(t==n.childCount||n.canReplace(0,t))}function Si(n){let t=n.parent.content.cutByIndex(n.startIndex,n.endIndex);for(let r=n.depth;;--r){let i=n.$from.node(r),s=n.$from.index(r),a=n.$to.indexAfter(r);if(r<n.depth&&i.canReplace(s,a,t))return r;if(r==0||i.type.spec.isolating||!G5(i,s,a))break}return null}function J5(n,e,t){let{$from:r,$to:i,depth:s}=e,a=r.before(s+1),u=i.after(s+1),c=a,h=u,p=z.empty,m=0;for(let S=s,E=!1;S>t;S--)E||r.index(S)>0?(E=!0,p=z.from(r.node(S).copy(p)),m++):c--;let y=z.empty,_=0;for(let S=s,E=!1;S>t;S--)E||i.after(S+1)<i.end(S)?(E=!0,y=z.from(i.node(S).copy(y)),_++):h++;n.step(new Je(c,h,a,u,new K(p.append(y),m,_),p.size-m,!0))}function Vc(n,e,t=null,r=n){let i=j5(n,e),s=i&&Y5(r,e);return s?i.map(Rg).concat({type:e,attrs:t}).concat(s.map(Rg)):null}function Rg(n){return{type:n,attrs:null}}function j5(n,e){let{parent:t,startIndex:r,endIndex:i}=n,s=t.contentMatchAt(r).findWrapping(e);if(!s)return null;let a=s.length?s[0]:e;return t.canReplaceWith(r,i,a)?s:null}function Y5(n,e){let{parent:t,startIndex:r,endIndex:i}=n,s=t.child(r),a=e.contentMatch.findWrapping(s.type);if(!a)return null;let c=(a.length?a[a.length-1]:e).contentMatch;for(let h=r;c&&h<i;h++)c=c.matchType(t.child(h).type);return!c||!c.validEnd?null:a}function X5(n,e,t){let r=z.empty;for(let a=t.length-1;a>=0;a--){if(r.size){let u=t[a].type.contentMatch.matchFragment(r);if(!u||!u.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=z.from(t[a].type.create(t[a].attrs,r))}let i=e.start,s=e.end;n.step(new Je(i,s,i,s,new K(r,0,0),t.length,!0))}function Z5(n,e,t,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let s=n.steps.length;n.doc.nodesBetween(e,t,(a,u)=>{let c=typeof i=="function"?i(a):i;if(a.isTextblock&&!a.hasMarkup(r,c)&&Q5(n.doc,n.mapping.slice(s).map(u),r)){let h=null;if(r.schema.linebreakReplacement){let _=r.whitespace=="pre",S=!!r.contentMatch.matchType(r.schema.linebreakReplacement);_&&!S?h=!1:!_&&S&&(h=!0)}h===!1&&Pg(n,a,u,s),Wc(n,n.mapping.slice(s).map(u,1),r,void 0,h===null);let p=n.mapping.slice(s),m=p.map(u,1),y=p.map(u+a.nodeSize,1);return n.step(new Je(m,y,m+1,y-1,new K(z.from(r.create(c,null,a.marks)),0,0),1,!0)),h===!0&&Lg(n,a,u,s),!1}})}function Lg(n,e,t,r){e.forEach((i,s)=>{if(i.isText){let a,u=/\r?\n|\r/g;for(;a=u.exec(i.text);){let c=n.mapping.slice(r).map(t+1+s+a.index);n.replaceWith(c,c+1,e.type.schema.linebreakReplacement.create())}}})}function Pg(n,e,t,r){e.forEach((i,s)=>{if(i.type==i.type.schema.linebreakReplacement){let a=n.mapping.slice(r).map(t+1+s);n.replaceWith(a,a+1,e.type.schema.text(`
|
|
34
|
-
`))}})}function Q5(n,e,t){let r=n.resolve(e),i=r.index();return r.parent.canReplaceWith(i,i+1,t)}function ek(n,e,t,r,i){let s=n.doc.nodeAt(e);if(!s)throw new RangeError("No node at given position");t||(t=s.type);let a=t.create(r,null,i||s.marks);if(s.isLeaf)return n.replaceWith(e,e+s.nodeSize,a);if(!t.validContent(s.content))throw new RangeError("Invalid content for node type "+t.name);n.step(new Je(e,e+s.nodeSize,e+1,e+s.nodeSize-1,new K(z.from(a),0,0),1,!0))}function zn(n,e,t=1,r){let i=n.resolve(e),s=i.depth-t,a=r&&r[r.length-1]||i.parent;if(s<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!a.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let h=i.depth-1,p=t-2;h>s;h--,p--){let m=i.node(h),y=i.index(h);if(m.type.spec.isolating)return!1;let _=m.content.cutByIndex(y,m.childCount),S=r&&r[p+1];S&&(_=_.replaceChild(0,S.type.create(S.attrs)));let E=r&&r[p]||m;if(!m.canReplace(y+1,m.childCount)||!E.type.validContent(_))return!1}let u=i.indexAfter(s),c=r&&r[0];return i.node(s).canReplaceWith(u,u,c?c.type:i.node(s+1).type)}function tk(n,e,t=1,r){let i=n.doc.resolve(e),s=z.empty,a=z.empty;for(let u=i.depth,c=i.depth-t,h=t-1;u>c;u--,h--){s=z.from(i.node(u).copy(s));let p=r&&r[h];a=z.from(p?p.type.create(p.attrs,a):i.node(u).copy(a))}n.step(new je(e,e,new K(s.append(a),t,t),!0))}function hr(n,e){let t=n.resolve(e),r=t.index();return Dg(t.nodeBefore,t.nodeAfter)&&t.parent.canReplace(r,r+1)}function nk(n,e){e.content.size||n.type.compatibleContent(e.type);let t=n.contentMatchAt(n.childCount),{linebreakReplacement:r}=n.type.schema;for(let i=0;i<e.childCount;i++){let s=e.child(i),a=s.type==r?n.type.schema.nodes.text:s.type;if(t=t.matchType(a),!t||!n.type.allowsMarks(s.marks))return!1}return t.validEnd}function Dg(n,e){return!!(n&&e&&!n.isLeaf&&nk(n,e))}function Sa(n,e,t=-1){let r=n.resolve(e);for(let i=r.depth;;i--){let s,a,u=r.index(i);if(i==r.depth?(s=r.nodeBefore,a=r.nodeAfter):t>0?(s=r.node(i+1),u++,a=r.node(i).maybeChild(u)):(s=r.node(i).maybeChild(u-1),a=r.node(i+1)),s&&!s.isTextblock&&Dg(s,a)&&r.node(i).canReplace(u,u+1))return e;if(i==0)break;e=t<0?r.before(i):r.after(i)}}function rk(n,e,t){let r=null,{linebreakReplacement:i}=n.doc.type.schema,s=n.doc.resolve(e-t),a=s.node().type;if(i&&a.inlineContent){let p=a.whitespace=="pre",m=!!a.contentMatch.matchType(i);p&&!m?r=!1:!p&&m&&(r=!0)}let u=n.steps.length;if(r===!1){let p=n.doc.resolve(e+t);Pg(n,p.node(),p.before(),u)}a.inlineContent&&Wc(n,e+t-1,a,s.node().contentMatchAt(s.index()),r==null);let c=n.mapping.slice(u),h=c.map(e-t);if(n.step(new je(h,c.map(e+t,-1),K.empty,!0)),r===!0){let p=n.doc.resolve(h);Lg(n,p.node(),p.before(),n.steps.length)}return n}function ik(n,e,t){let r=n.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),t))return e;if(r.parentOffset==0)for(let i=r.depth-1;i>=0;i--){let s=r.index(i);if(r.node(i).canReplaceWith(s,s,t))return r.before(i+1);if(s>0)return null}if(r.parentOffset==r.parent.content.size)for(let i=r.depth-1;i>=0;i--){let s=r.indexAfter(i);if(r.node(i).canReplaceWith(s,s,t))return r.after(i+1);if(s<r.node(i).childCount)return null}return null}function sk(n,e,t){let r=n.resolve(e);if(!t.content.size)return e;let i=t.content;for(let s=0;s<t.openStart;s++)i=i.firstChild.content;for(let s=1;s<=(t.openStart==0&&t.size?2:1);s++)for(let a=r.depth;a>=0;a--){let u=a==r.depth?0:r.pos<=(r.start(a+1)+r.end(a+1))/2?-1:1,c=r.index(a)+(u>0?1:0),h=r.node(a),p=!1;if(s==1)p=h.canReplace(c,c,i);else{let m=h.contentMatchAt(c).findWrapping(i.firstChild.type);p=m&&h.canReplaceWith(c,c,m[0])}if(p)return u==0?r.pos:u<0?r.before(a+1):r.after(a+1)}return null}function xa(n,e,t=e,r=K.empty){if(e==t&&!r.size)return null;let i=n.resolve(e),s=n.resolve(t);return Fg(i,s,r)?new je(e,t,r):new ok(i,s,r).fit()}function Fg(n,e,t){return!t.openStart&&!t.openEnd&&n.start()==e.start()&&n.parent.canReplace(n.index(),e.index(),t.content)}class ok{constructor(e,t,r){this.$from=e,this.$to=t,this.unplaced=r,this.frontier=[],this.placed=z.empty;for(let i=0;i<=e.depth;i++){let s=e.node(i);this.frontier.push({type:s.type,match:s.contentMatchAt(e.indexAfter(i))})}for(let i=e.depth;i>0;i--)this.placed=z.from(e.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let h=this.findFittable();h?this.placeNodes(h):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),t=this.placed.size-this.depth-this.$from.depth,r=this.$from,i=this.close(e<0?this.$to:r.doc.resolve(e));if(!i)return null;let s=this.placed,a=r.depth,u=i.depth;for(;a&&u&&s.childCount==1;)s=s.firstChild.content,a--,u--;let c=new K(s,a,u);return e>-1?new Je(r.pos,e,this.$to.pos,this.$to.end(),c,t):c.size||r.pos!=this.$to.pos?new je(r.pos,i.pos,c):null}findFittable(){let e=this.unplaced.openStart;for(let t=this.unplaced.content,r=0,i=this.unplaced.openEnd;r<e;r++){let s=t.firstChild;if(t.childCount>1&&(i=0),s.type.spec.isolating&&i<=r){e=r;break}t=s.content}for(let t=1;t<=2;t++)for(let r=t==1?e:this.unplaced.openStart;r>=0;r--){let i,s=null;r?(s=Uc(this.unplaced.content,r-1).firstChild,i=s.content):i=this.unplaced.content;let a=i.firstChild;for(let u=this.depth;u>=0;u--){let{type:c,match:h}=this.frontier[u],p,m=null;if(t==1&&(a?h.matchType(a.type)||(m=h.fillBefore(z.from(a),!1)):s&&c.compatibleContent(s.type)))return{sliceDepth:r,frontierDepth:u,parent:s,inject:m};if(t==2&&a&&(p=h.findWrapping(a.type)))return{sliceDepth:r,frontierDepth:u,parent:s,wrap:p};if(s&&h.matchType(s.type))break}}}openMore(){let{content:e,openStart:t,openEnd:r}=this.unplaced,i=Uc(e,t);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new K(e,t+1,Math.max(r,i.size+t>=e.size-r?t+1:0)),!0)}dropNode(){let{content:e,openStart:t,openEnd:r}=this.unplaced,i=Uc(e,t);if(i.childCount<=1&&t>0){let s=e.size-t<=t+i.size;this.unplaced=new K(vs(e,t-1,1),t-1,s?t-1:r)}else this.unplaced=new K(vs(e,t,1),t,r)}placeNodes({sliceDepth:e,frontierDepth:t,parent:r,inject:i,wrap:s}){for(;this.depth>t;)this.closeFrontierNode();if(s)for(let E=0;E<s.length;E++)this.openFrontierNode(s[E]);let a=this.unplaced,u=r?r.content:a.content,c=a.openStart-e,h=0,p=[],{match:m,type:y}=this.frontier[t];if(i){for(let E=0;E<i.childCount;E++)p.push(i.child(E));m=m.matchFragment(i)}let _=u.size+e-(a.content.size-a.openEnd);for(;h<u.childCount;){let E=u.child(h),N=m.matchType(E.type);if(!N)break;h++,(h>1||c==0||E.content.size)&&(m=N,p.push(Bg(E.mark(y.allowedMarks(E.marks)),h==1?c:0,h==u.childCount?_:-1)))}let S=h==u.childCount;S||(_=-1),this.placed=Ss(this.placed,t,z.from(p)),this.frontier[t].match=m,S&&_<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let E=0,N=u;E<_;E++){let g=N.lastChild;this.frontier.push({type:g.type,match:g.contentMatchAt(g.childCount)}),N=g.content}this.unplaced=S?e==0?K.empty:new K(vs(a.content,e-1,1),e-1,_<0?a.openEnd:e-1):new K(vs(a.content,e,h),a.openStart,a.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],t;if(!e.type.isTextblock||!qc(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(t=this.findCloseLevel(this.$to))&&t.depth==this.depth)return-1;let{depth:r}=this.$to,i=this.$to.after(r);for(;r>1&&i==this.$to.end(--r);)++i;return i}findCloseLevel(e){e:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:r,type:i}=this.frontier[t],s=t<e.depth&&e.end(t+1)==e.pos+(e.depth-(t+1)),a=qc(e,t,i,r,s);if(a){for(let u=t-1;u>=0;u--){let{match:c,type:h}=this.frontier[u],p=qc(e,u,h,c,!0);if(!p||p.childCount)continue e}return{depth:t,fit:a,move:s?e.doc.resolve(e.after(t+1)):e}}}}close(e){let t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=Ss(this.placed,t.depth,t.fit)),e=t.move;for(let r=t.depth+1;r<=e.depth;r++){let i=e.node(r),s=i.type.contentMatch.fillBefore(i.content,!0,e.index(r));this.openFrontierNode(i.type,i.attrs,s)}return e}openFrontierNode(e,t=null,r){let i=this.frontier[this.depth];i.match=i.match.matchType(e),this.placed=Ss(this.placed,this.depth,z.from(e.create(t,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let t=this.frontier.pop().match.fillBefore(z.empty,!0);t.childCount&&(this.placed=Ss(this.placed,this.frontier.length,t))}}function vs(n,e,t){return e==0?n.cutByIndex(t,n.childCount):n.replaceChild(0,n.firstChild.copy(vs(n.firstChild.content,e-1,t)))}function Ss(n,e,t){return e==0?n.append(t):n.replaceChild(n.childCount-1,n.lastChild.copy(Ss(n.lastChild.content,e-1,t)))}function Uc(n,e){for(let t=0;t<e;t++)n=n.firstChild.content;return n}function Bg(n,e,t){if(e<=0)return n;let r=n.content;return e>1&&(r=r.replaceChild(0,Bg(r.firstChild,e-1,r.childCount==1?t-1:0))),e>0&&(r=n.type.contentMatch.fillBefore(r).append(r),t<=0&&(r=r.append(n.type.contentMatch.matchFragment(r).fillBefore(z.empty,!0)))),n.copy(r)}function qc(n,e,t,r,i){let s=n.node(e),a=i?n.indexAfter(e):n.index(e);if(a==s.childCount&&!t.compatibleContent(s.type))return null;let u=r.fillBefore(s.content,!0,a);return u&&!ak(t,s.content,a)?u:null}function ak(n,e,t){for(let r=t;r<e.childCount;r++)if(!n.allowsMarks(e.child(r).marks))return!0;return!1}function lk(n){return n.spec.defining||n.spec.definingForContent}function uk(n,e,t,r){if(!r.size)return n.deleteRange(e,t);let i=n.doc.resolve(e),s=n.doc.resolve(t);if(Fg(i,s,r))return n.step(new je(e,t,r));let a=$g(i,n.doc.resolve(t));a[a.length-1]==0&&a.pop();let u=-(i.depth+1);a.unshift(u);for(let y=i.depth,_=i.pos-1;y>0;y--,_--){let S=i.node(y).type.spec;if(S.defining||S.definingAsContext||S.isolating)break;a.indexOf(y)>-1?u=y:i.before(y)==_&&a.splice(1,0,-y)}let c=a.indexOf(u),h=[],p=r.openStart;for(let y=r.content,_=0;;_++){let S=y.firstChild;if(h.push(S),_==r.openStart)break;y=S.content}for(let y=p-1;y>=0;y--){let _=h[y],S=lk(_.type);if(S&&!_.sameMarkup(i.node(Math.abs(u)-1)))p=y;else if(S||!_.type.isTextblock)break}for(let y=r.openStart;y>=0;y--){let _=(y+p+1)%(r.openStart+1),S=h[_];if(S)for(let E=0;E<a.length;E++){let N=a[(E+c)%a.length],g=!0;N<0&&(g=!1,N=-N);let v=i.node(N-1),k=i.index(N-1);if(v.canReplaceWith(k,k,S.type,S.marks))return n.replace(i.before(N),g?s.after(N):t,new K(zg(r.content,0,r.openStart,_),_,r.openEnd))}}let m=n.steps.length;for(let y=a.length-1;y>=0&&(n.replace(e,t,r),!(n.steps.length>m));y--){let _=a[y];_<0||(e=i.before(_),t=s.after(_))}}function zg(n,e,t,r,i){if(e<t){let s=n.firstChild;n=n.replaceChild(0,s.copy(zg(s.content,e+1,t,r,s)))}if(e>r){let s=i.contentMatchAt(0),a=s.fillBefore(n).append(n);n=a.append(s.matchFragment(a).fillBefore(z.empty,!0))}return n}function ck(n,e,t,r){if(!r.isInline&&e==t&&n.doc.resolve(e).parent.content.size){let i=ik(n.doc,e,r.type);i!=null&&(e=t=i)}n.replaceRange(e,t,new K(z.from(r),0,0))}function fk(n,e,t){let r=n.doc.resolve(e),i=n.doc.resolve(t),s=$g(r,i);for(let a=0;a<s.length;a++){let u=s[a],c=a==s.length-1;if(c&&u==0||r.node(u).type.contentMatch.validEnd)return n.delete(r.start(u),i.end(u));if(u>0&&(c||r.node(u-1).canReplace(r.index(u-1),i.indexAfter(u-1))))return n.delete(r.before(u),i.after(u))}for(let a=1;a<=r.depth&&a<=i.depth;a++)if(e-r.start(a)==r.depth-a&&t>r.end(a)&&i.end(a)-t!=i.depth-a&&r.start(a-1)==i.start(a-1)&&r.node(a-1).canReplace(r.index(a-1),i.index(a-1)))return n.delete(r.before(a),t);n.delete(e,t)}function $g(n,e){let t=[],r=Math.min(n.depth,e.depth);for(let i=r;i>=0;i--){let s=n.start(i);if(s<n.pos-(n.depth-i)||e.end(i)>e.pos+(e.depth-i)||n.node(i).type.spec.isolating||e.node(i).type.spec.isolating)break;(s==e.start(i)||i==n.depth&&i==e.depth&&n.parent.inlineContent&&e.parent.inlineContent&&i&&e.start(i-1)==s-1)&&t.push(i)}return t}class zi extends Ue{constructor(e,t,r){super(),this.pos=e,this.attr=t,this.value=r}apply(e){let t=e.nodeAt(this.pos);if(!t)return De.fail("No node at attribute step's position");let r=Object.create(null);for(let s in t.attrs)r[s]=t.attrs[s];r[this.attr]=this.value;let i=t.type.create(r,null,t.marks);return De.fromReplace(e,this.pos,this.pos+1,new K(z.from(i),0,t.isLeaf?0:1))}getMap(){return Lt.empty}invert(e){return new zi(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new zi(t.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,t){if(typeof t.pos!="number"||typeof t.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new zi(t.pos,t.attr,t.value)}}Ue.jsonID("attr",zi);class qs extends Ue{constructor(e,t){super(),this.attr=e,this.value=t}apply(e){let t=Object.create(null);for(let i in e.attrs)t[i]=e.attrs[i];t[this.attr]=this.value;let r=e.type.create(t,e.content,e.marks);return De.ok(r)}getMap(){return Lt.empty}invert(e){return new qs(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,t){if(typeof t.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new qs(t.attr,t.value)}}Ue.jsonID("docAttr",qs);let xi=class extends Error{};xi=function n(e){let t=Error.call(this,e);return t.__proto__=n.prototype,t},xi.prototype=Object.create(Error.prototype),xi.prototype.constructor=xi,xi.prototype.name="TransformError";class hk{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new Fi}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new xi(t.failed);return this}maybeStep(e){let t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t}get docChanged(){return this.steps.length>0}addStep(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t}replace(e,t=e,r=K.empty){let i=xa(this.doc,e,t,r);return i&&this.step(i),this}replaceWith(e,t,r){return this.replace(e,t,new K(z.from(r),0,0))}delete(e,t){return this.replace(e,t,K.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,r){return uk(this,e,t,r),this}replaceRangeWith(e,t,r){return ck(this,e,t,r),this}deleteRange(e,t){return fk(this,e,t),this}lift(e,t){return J5(this,e,t),this}join(e,t=1){return rk(this,e,t),this}wrap(e,t){return X5(this,e,t),this}setBlockType(e,t=e,r,i=null){return Z5(this,e,t,r,i),this}setNodeMarkup(e,t,r=null,i){return ek(this,e,t,r,i),this}setNodeAttribute(e,t,r){return this.step(new zi(e,t,r)),this}setDocAttribute(e,t){return this.step(new qs(e,t)),this}addNodeMark(e,t){return this.step(new kr(e,t)),this}removeNodeMark(e,t){if(!(t instanceof Te)){let r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at position "+e);if(t=t.isInSet(r.marks),!t)return this}return this.step(new Bi(e,t)),this}split(e,t=1,r){return tk(this,e,t,r),this}addMark(e,t,r){return q5(this,e,t,r),this}removeMark(e,t,r){return K5(this,e,t,r),this}clearIncompatible(e,t,r){return Wc(this,e,t,r),this}}const Kc=Object.create(null);class ye{constructor(e,t,r){this.$anchor=e,this.$head=t,this.ranges=r||[new dk(e.min(t),e.max(t))]}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 e=this.ranges;for(let t=0;t<e.length;t++)if(e[t].$from.pos!=e[t].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,t=K.empty){let r=t.content.lastChild,i=null;for(let u=0;u<t.openEnd;u++)i=r,r=r.lastChild;let s=e.steps.length,a=this.ranges;for(let u=0;u<a.length;u++){let{$from:c,$to:h}=a[u],p=e.mapping.slice(s);e.replaceRange(p.map(c.pos),p.map(h.pos),u?K.empty:t),u==0&&Vg(e,s,(r?r.isInline:i&&i.isTextblock)?-1:1)}}replaceWith(e,t){let r=e.steps.length,i=this.ranges;for(let s=0;s<i.length;s++){let{$from:a,$to:u}=i[s],c=e.mapping.slice(r),h=c.map(a.pos),p=c.map(u.pos);s?e.deleteRange(h,p):(e.replaceRangeWith(h,p,t),Vg(e,r,t.isInline?-1:1))}}static findFrom(e,t,r=!1){let i=e.parent.inlineContent?new pe(e):Ci(e.node(0),e.parent,e.pos,e.index(),t,r);if(i)return i;for(let s=e.depth-1;s>=0;s--){let a=t<0?Ci(e.node(0),e.node(s),e.before(s+1),e.index(s),t,r):Ci(e.node(0),e.node(s),e.after(s+1),e.index(s)+1,t,r);if(a)return a}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new Rt(e.node(0))}static atStart(e){return Ci(e,e,0,0,1)||new Rt(e)}static atEnd(e){return Ci(e,e,e.content.size,e.childCount,-1)||new Rt(e)}static fromJSON(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=Kc[t.type];if(!r)throw new RangeError(`No selection type ${t.type} defined`);return r.fromJSON(e,t)}static jsonID(e,t){if(e in Kc)throw new RangeError("Duplicate use of selection JSON ID "+e);return Kc[e]=t,t.prototype.jsonID=e,t}getBookmark(){return pe.between(this.$anchor,this.$head).getBookmark()}}ye.prototype.visible=!0;class dk{constructor(e,t){this.$from=e,this.$to=t}}let Hg=!1;function Wg(n){!Hg&&!n.parent.inlineContent&&(Hg=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+n.parent.type.name+")"))}class pe extends ye{constructor(e,t=e){Wg(e),Wg(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,t){let r=e.resolve(t.map(this.head));if(!r.parent.inlineContent)return ye.near(r);let i=e.resolve(t.map(this.anchor));return new pe(i.parent.inlineContent?i:r,r)}replace(e,t=K.empty){if(super.replace(e,t),t==K.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof pe&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new Dl(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,t){if(typeof t.anchor!="number"||typeof t.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new pe(e.resolve(t.anchor),e.resolve(t.head))}static create(e,t,r=t){let i=e.resolve(t);return new this(i,r==t?i:e.resolve(r))}static between(e,t,r){let i=e.pos-t.pos;if((!r||i)&&(r=i>=0?1:-1),!t.parent.inlineContent){let s=ye.findFrom(t,r,!0)||ye.findFrom(t,-r,!0);if(s)t=s.$head;else return ye.near(t,r)}return e.parent.inlineContent||(i==0?e=t:(e=(ye.findFrom(e,-r,!0)||ye.findFrom(e,r,!0)).$anchor,e.pos<t.pos!=i<0&&(e=t))),new pe(e,t)}}ye.jsonID("text",pe);class Dl{constructor(e,t){this.anchor=e,this.head=t}map(e){return new Dl(e.map(this.anchor),e.map(this.head))}resolve(e){return pe.between(e.resolve(this.anchor),e.resolve(this.head))}}class Q extends ye{constructor(e){let t=e.nodeAfter,r=e.node(0).resolve(e.pos+t.nodeSize);super(e,r),this.node=t}map(e,t){let{deleted:r,pos:i}=t.mapResult(this.anchor),s=e.resolve(i);return r?ye.near(s):new Q(s)}content(){return new K(z.from(this.node),0,0)}eq(e){return e instanceof Q&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new xh(this.anchor)}static fromJSON(e,t){if(typeof t.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new Q(e.resolve(t.anchor))}static create(e,t){return new Q(e.resolve(t))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}}Q.prototype.visible=!1,ye.jsonID("node",Q);class xh{constructor(e){this.anchor=e}map(e){let{deleted:t,pos:r}=e.mapResult(this.anchor);return t?new Dl(r,r):new xh(r)}resolve(e){let t=e.resolve(this.anchor),r=t.nodeAfter;return r&&Q.isSelectable(r)?new Q(t):ye.near(t)}}class Rt extends ye{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,t=K.empty){if(t==K.empty){e.delete(0,e.doc.content.size);let r=ye.atStart(e.doc);r.eq(e.selection)||e.setSelection(r)}else super.replace(e,t)}toJSON(){return{type:"all"}}static fromJSON(e){return new Rt(e)}map(e){return new Rt(e)}eq(e){return e instanceof Rt}getBookmark(){return pk}}ye.jsonID("all",Rt);const pk={map(){return this},resolve(n){return new Rt(n)}};function Ci(n,e,t,r,i,s=!1){if(e.inlineContent)return pe.create(n,t);for(let a=r-(i>0?0:1);i>0?a<e.childCount:a>=0;a+=i){let u=e.child(a);if(u.isAtom){if(!s&&Q.isSelectable(u))return Q.create(n,t-(i<0?u.nodeSize:0))}else{let c=Ci(n,u,t+i,i<0?u.childCount:0,i,s);if(c)return c}t+=u.nodeSize*i}return null}function Vg(n,e,t){let r=n.steps.length-1;if(r<e)return;let i=n.steps[r];if(!(i instanceof je||i instanceof Je))return;let s=n.mapping.maps[r],a;s.forEach((u,c,h,p)=>{a==null&&(a=p)}),n.setSelection(ye.near(n.doc.resolve(a),t))}function Ug(n,e){return!e||!n?n:n.bind(e)}class Ca{constructor(e,t,r){this.name=e,this.init=Ug(t.init,r),this.apply=Ug(t.apply,r)}}new Ca("doc",{init(n){return n.doc||n.schema.topNodeType.createAndFill()},apply(n){return n.doc}}),new Ca("selection",{init(n,e){return n.selection||ye.atStart(e.doc)},apply(n){return n.selection}}),new Ca("storedMarks",{init(n){return n.storedMarks||null},apply(n,e,t,r){return r.selection.$cursor?n.storedMarks:null}}),new Ca("scrollToSelection",{init(){return 0},apply(n,e){return n.scrolledIntoView?e+1:e}});function qg(n,e,t){for(let r in n){let i=n[r];i instanceof Function?i=i.bind(e):r=="handleDOMEvents"&&(i=qg(i,e,{})),t[r]=i}return t}class ct{constructor(e){this.spec=e,this.props={},e.props&&qg(e.props,this,this.props),this.key=e.key?e.key.key:Kg("plugin")}getState(e){return e[this.key]}}const Gc=Object.create(null);function Kg(n){return n in Gc?n+"$"+ ++Gc[n]:(Gc[n]=0,n+"$")}class Mt{constructor(e="key"){this.key=Kg(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const Hr=function(n){for(var e=0;;e++)if(n=n.previousSibling,!n)return e},Gg=function(n,e,t,r){return t&&(Jg(n,e,t,r,-1)||Jg(n,e,t,r,1))},mk=/^(img|br|input|textarea|hr)$/i;function Jg(n,e,t,r,i){for(;;){if(n==t&&e==r)return!0;if(e==(i<0?0:Ea(n))){let s=n.parentNode;if(!s||s.nodeType!=1||Jc(n)||mk.test(n.nodeName)||n.contentEditable=="false")return!1;e=Hr(n)+(i<0?0:1),n=s}else if(n.nodeType==1){if(n=n.childNodes[e+(i<0?-1:0)],n.contentEditable=="false")return!1;e=i<0?Ea(n):0}else return!1}}function Ea(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function gk(n,e,t){for(let r=e==0,i=e==Ea(n);r||i;){if(n==t)return!0;let s=Hr(n);if(n=n.parentNode,!n)return!1;r=r&&s==0,i=i&&s==Ea(n)}}function Jc(n){let e;for(let t=n;t&&!(e=t.pmViewDesc);t=t.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==n||e.contentDOM==n)}const jg=function(n){return n.focusNode&&Gg(n.focusNode,n.focusOffset,n.anchorNode,n.anchorOffset)};function Yg(n,e){let t=document.createEvent("Event");return t.initEvent("keydown",!0,!0),t.keyCode=n,t.key=t.code=e,t}const pn=typeof navigator<"u"?navigator:null,Xg=typeof document<"u"?document:null,dr=pn&&pn.userAgent||"",jc=/Edge\/(\d+)/.exec(dr),Zg=/MSIE \d/.exec(dr),Yc=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(dr),xs=!!(Zg||Yc||jc),Qg=Zg?document.documentMode:Yc?+Yc[1]:jc?+jc[1]:0,ka=!xs&&/gecko\/(\d+)/i.test(dr);ka&&+(/Firefox\/(\d+)/.exec(dr)||[0,0])[1];const Xc=!xs&&/Chrome\/(\d+)/.exec(dr),pr=!!Xc,e0=Xc?+Xc[1]:0,Wr=!xs&&!!pn&&/Apple Computer/.test(pn.vendor),Zc=Wr&&(/Mobile\/\w+/.test(dr)||!!pn&&pn.maxTouchPoints>2),Kt=Zc||(pn?/Mac/.test(pn.platform):!1),yk=pn?/Win/.test(pn.platform):!1,Cs=/Android \d/.test(dr),Qc=!!Xg&&"webkitFontSmoothing"in Xg.documentElement.style,bk=Qc?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function _k(n,e=null){let t=n.domSelectionRange(),r=n.state.doc;if(!t.focusNode)return null;let i=n.docView.nearestDesc(t.focusNode),s=i&&i.size==0,a=n.docView.posFromDOM(t.focusNode,t.focusOffset,1);if(a<0)return null;let u=r.resolve(a),c,h;if(jg(t)){for(c=a;i&&!i.node;)i=i.parent;let m=i.node;if(i&&m.isAtom&&Q.isSelectable(m)&&i.parent&&!(m.isInline&&gk(t.focusNode,t.focusOffset,i.dom))){let y=i.posBefore;h=new Q(a==y?u:r.resolve(y))}}else{if(t instanceof n.dom.ownerDocument.defaultView.Selection&&t.rangeCount>1){let m=a,y=a;for(let _=0;_<t.rangeCount;_++){let S=t.getRangeAt(_);m=Math.min(m,n.docView.posFromDOM(S.startContainer,S.startOffset,1)),y=Math.max(y,n.docView.posFromDOM(S.endContainer,S.endOffset,-1))}if(m<0)return null;[c,a]=y==n.state.selection.anchor?[y,m]:[m,y],u=r.resolve(a)}else c=n.docView.posFromDOM(t.anchorNode,t.anchorOffset,1);if(c<0)return null}let p=r.resolve(c);if(!h){let m=e=="pointer"||n.state.selection.head<u.pos&&!s?1:-1;h=o0(n,p,u,m)}return h}function t0(n){return n.editable?n.hasFocus():xk(n)&&document.activeElement&&document.activeElement.contains(n.dom)}function ef(n,e=!1){let t=n.state.selection;if(Sk(n,t),!!t0(n)){if(!e&&n.input.mouseDown&&n.input.mouseDown.allowDefault&&pr){let r=n.domSelectionRange(),i=n.domObserver.currentSelection;if(r.anchorNode&&i.anchorNode&&Gg(r.anchorNode,r.anchorOffset,i.anchorNode,i.anchorOffset)){n.input.mouseDown.delayedSelectionSync=!0,n.domObserver.setCurSelection();return}}if(n.domObserver.disconnectSelection(),n.cursorWrapper)vk(n);else{let{anchor:r,head:i}=t,s,a;n0&&!(t instanceof pe)&&(t.$from.parent.inlineContent||(s=r0(n,t.from)),!t.empty&&!t.$from.parent.inlineContent&&(a=r0(n,t.to))),n.docView.setSelection(r,i,n,e),n0&&(s&&i0(s),a&&i0(a)),t.visible?n.dom.classList.remove("ProseMirror-hideselection"):(n.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&wk(n))}n.domObserver.setCurSelection(),n.domObserver.connectSelection()}}const n0=Wr||pr&&e0<63;function r0(n,e){let{node:t,offset:r}=n.docView.domFromPos(e,0),i=r<t.childNodes.length?t.childNodes[r]:null,s=r?t.childNodes[r-1]:null;if(Wr&&i&&i.contentEditable=="false")return tf(i);if((!i||i.contentEditable=="false")&&(!s||s.contentEditable=="false")){if(i)return tf(i);if(s)return tf(s)}}function tf(n){return n.contentEditable="true",Wr&&n.draggable&&(n.draggable=!1,n.wasDraggable=!0),n}function i0(n){n.contentEditable="false",n.wasDraggable&&(n.draggable=!0,n.wasDraggable=null)}function wk(n){let e=n.dom.ownerDocument;e.removeEventListener("selectionchange",n.input.hideSelectionGuard);let t=n.domSelectionRange(),r=t.anchorNode,i=t.anchorOffset;e.addEventListener("selectionchange",n.input.hideSelectionGuard=()=>{(t.anchorNode!=r||t.anchorOffset!=i)&&(e.removeEventListener("selectionchange",n.input.hideSelectionGuard),setTimeout(()=>{(!t0(n)||n.state.selection.visible)&&n.dom.classList.remove("ProseMirror-hideselection")},20))})}function vk(n){let e=n.domSelection(),t=document.createRange();if(!e)return;let r=n.cursorWrapper.dom,i=r.nodeName=="IMG";i?t.setStart(r.parentNode,Hr(r)+1):t.setStart(r,0),t.collapse(!0),e.removeAllRanges(),e.addRange(t),!i&&!n.state.selection.visible&&xs&&Qg<=11&&(r.disabled=!0,r.disabled=!1)}function Sk(n,e){if(e instanceof Q){let t=n.docView.descAt(e.from);t!=n.lastSelectedViewDesc&&(s0(n),t&&t.selectNode(),n.lastSelectedViewDesc=t)}else s0(n)}function s0(n){n.lastSelectedViewDesc&&(n.lastSelectedViewDesc.parent&&n.lastSelectedViewDesc.deselectNode(),n.lastSelectedViewDesc=void 0)}function o0(n,e,t,r){return n.someProp("createSelectionBetween",i=>i(n,e,t))||pe.between(e,t,r)}function xk(n){let e=n.domSelectionRange();if(!e.anchorNode)return!1;try{return n.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(n.editable||n.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch{return!1}}function nf(n,e){let{$anchor:t,$head:r}=n.selection,i=e>0?t.max(r):t.min(r),s=i.parent.inlineContent?i.depth?n.doc.resolve(e>0?i.after():i.before()):null:i;return s&&ye.findFrom(s,e)}function mr(n,e){return n.dispatch(n.state.tr.setSelection(e).scrollIntoView()),!0}function a0(n,e,t){let r=n.state.selection;if(r instanceof pe)if(t.indexOf("s")>-1){let{$head:i}=r,s=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter;if(!s||s.isText||!s.isLeaf)return!1;let a=n.state.doc.resolve(i.pos+s.nodeSize*(e<0?-1:1));return mr(n,new pe(r.$anchor,a))}else if(r.empty){if(n.endOfTextblock(e>0?"forward":"backward")){let i=nf(n.state,e);return i&&i instanceof Q?mr(n,i):!1}else if(!(Kt&&t.indexOf("m")>-1)){let i=r.$head,s=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter,a;if(!s||s.isText)return!1;let u=e<0?i.pos-s.nodeSize:i.pos;return s.isAtom||(a=n.docView.descAt(u))&&!a.contentDOM?Q.isSelectable(s)?mr(n,new Q(e<0?n.state.doc.resolve(i.pos-s.nodeSize):i)):Qc?mr(n,new pe(n.state.doc.resolve(e<0?u:u+s.nodeSize))):!1:!1}}else return!1;else{if(r instanceof Q&&r.node.isInline)return mr(n,new pe(e>0?r.$to:r.$from));{let i=nf(n.state,e);return i?mr(n,i):!1}}}function Aa(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function Es(n,e){let t=n.pmViewDesc;return t&&t.size==0&&(e<0||n.nextSibling||n.nodeName!="BR")}function Ei(n,e){return e<0?Ck(n):Ek(n)}function Ck(n){let e=n.domSelectionRange(),t=e.focusNode,r=e.focusOffset;if(!t)return;let i,s,a=!1;for(ka&&t.nodeType==1&&r<Aa(t)&&Es(t.childNodes[r],-1)&&(a=!0);;)if(r>0){if(t.nodeType!=1)break;{let u=t.childNodes[r-1];if(Es(u,-1))i=t,s=--r;else if(u.nodeType==3)t=u,r=t.nodeValue.length;else break}}else{if(l0(t))break;{let u=t.previousSibling;for(;u&&Es(u,-1);)i=t.parentNode,s=Hr(u),u=u.previousSibling;if(u)t=u,r=Aa(t);else{if(t=t.parentNode,t==n.dom)break;r=0}}}a?rf(n,t,r):i&&rf(n,i,s)}function Ek(n){let e=n.domSelectionRange(),t=e.focusNode,r=e.focusOffset;if(!t)return;let i=Aa(t),s,a;for(;;)if(r<i){if(t.nodeType!=1)break;let u=t.childNodes[r];if(Es(u,1))s=t,a=++r;else break}else{if(l0(t))break;{let u=t.nextSibling;for(;u&&Es(u,1);)s=u.parentNode,a=Hr(u)+1,u=u.nextSibling;if(u)t=u,r=0,i=Aa(t);else{if(t=t.parentNode,t==n.dom)break;r=i=0}}}s&&rf(n,s,a)}function l0(n){let e=n.pmViewDesc;return e&&e.node&&e.node.isBlock}function kk(n,e){for(;n&&e==n.childNodes.length&&!Jc(n);)e=Hr(n)+1,n=n.parentNode;for(;n&&e<n.childNodes.length;){let t=n.childNodes[e];if(t.nodeType==3)return t;if(t.nodeType==1&&t.contentEditable=="false")break;n=t,e=0}}function Ak(n,e){for(;n&&!e&&!Jc(n);)e=Hr(n),n=n.parentNode;for(;n&&e;){let t=n.childNodes[e-1];if(t.nodeType==3)return t;if(t.nodeType==1&&t.contentEditable=="false")break;n=t,e=n.childNodes.length}}function rf(n,e,t){if(e.nodeType!=3){let s,a;(a=kk(e,t))?(e=a,t=0):(s=Ak(e,t))&&(e=s,t=s.nodeValue.length)}let r=n.domSelection();if(!r)return;if(jg(r)){let s=document.createRange();s.setEnd(e,t),s.setStart(e,t),r.removeAllRanges(),r.addRange(s)}else r.extend&&r.extend(e,t);n.domObserver.setCurSelection();let{state:i}=n;setTimeout(()=>{n.state==i&&ef(n)},50)}function u0(n,e){let t=n.state.doc.resolve(e);if(!(pr||yk)&&t.parent.inlineContent){let i=n.coordsAtPos(e);if(e>t.start()){let s=n.coordsAtPos(e-1),a=(s.top+s.bottom)/2;if(a>i.top&&a<i.bottom&&Math.abs(s.left-i.left)>1)return s.left<i.left?"ltr":"rtl"}if(e<t.end()){let s=n.coordsAtPos(e+1),a=(s.top+s.bottom)/2;if(a>i.top&&a<i.bottom&&Math.abs(s.left-i.left)>1)return s.left>i.left?"ltr":"rtl"}}return getComputedStyle(n.dom).direction=="rtl"?"rtl":"ltr"}function c0(n,e,t){let r=n.state.selection;if(r instanceof pe&&!r.empty||t.indexOf("s")>-1||Kt&&t.indexOf("m")>-1)return!1;let{$from:i,$to:s}=r;if(!i.parent.inlineContent||n.endOfTextblock(e<0?"up":"down")){let a=nf(n.state,e);if(a&&a instanceof Q)return mr(n,a)}if(!i.parent.inlineContent){let a=e<0?i:s,u=r instanceof Rt?ye.near(a,e):ye.findFrom(a,e);return u?mr(n,u):!1}return!1}function f0(n,e){if(!(n.state.selection instanceof pe))return!0;let{$head:t,$anchor:r,empty:i}=n.state.selection;if(!t.sameParent(r))return!0;if(!i)return!1;if(n.endOfTextblock(e>0?"forward":"backward"))return!0;let s=!t.textOffset&&(e<0?t.nodeBefore:t.nodeAfter);if(s&&!s.isText){let a=n.state.tr;return e<0?a.delete(t.pos-s.nodeSize,t.pos):a.delete(t.pos,t.pos+s.nodeSize),n.dispatch(a),!0}return!1}function h0(n,e,t){n.domObserver.stop(),e.contentEditable=t,n.domObserver.start()}function Tk(n){if(!Wr||n.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:t}=n.domSelectionRange();if(e&&e.nodeType==1&&t==0&&e.firstChild&&e.firstChild.contentEditable=="false"){let r=e.firstChild;h0(n,r,"true"),setTimeout(()=>h0(n,r,"false"),20)}return!1}function Ok(n){let e="";return n.ctrlKey&&(e+="c"),n.metaKey&&(e+="m"),n.altKey&&(e+="a"),n.shiftKey&&(e+="s"),e}function Mk(n,e){let t=e.keyCode,r=Ok(e);if(t==8||Kt&&t==72&&r=="c")return f0(n,-1)||Ei(n,-1);if(t==46&&!e.shiftKey||Kt&&t==68&&r=="c")return f0(n,1)||Ei(n,1);if(t==13||t==27)return!0;if(t==37||Kt&&t==66&&r=="c"){let i=t==37?u0(n,n.state.selection.from)=="ltr"?-1:1:-1;return a0(n,i,r)||Ei(n,i)}else if(t==39||Kt&&t==70&&r=="c"){let i=t==39?u0(n,n.state.selection.from)=="ltr"?1:-1:1;return a0(n,i,r)||Ei(n,i)}else{if(t==38||Kt&&t==80&&r=="c")return c0(n,-1,r)||Ei(n,-1);if(t==40||Kt&&t==78&&r=="c")return Tk(n)||c0(n,1,r)||Ei(n,1);if(r==(Kt?"m":"c")&&(t==66||t==73||t==89||t==90))return!0}return!1}function d0(n,e){n.someProp("transformCopied",_=>{e=_(e,n)});let t=[],{content:r,openStart:i,openEnd:s}=e;for(;i>1&&s>1&&r.childCount==1&&r.firstChild.childCount==1;){i--,s--;let _=r.firstChild;t.push(_.type.name,_.attrs!=_.type.defaultAttrs?_.attrs:null),r=_.content}let a=n.someProp("clipboardSerializer")||Vs.fromSchema(n.state.schema),u=v0(),c=u.createElement("div");c.appendChild(a.serializeFragment(r,{document:u}));let h=c.firstChild,p,m=0;for(;h&&h.nodeType==1&&(p=_0[h.nodeName.toLowerCase()]);){for(let _=p.length-1;_>=0;_--){let S=u.createElement(p[_]);for(;c.firstChild;)S.appendChild(c.firstChild);c.appendChild(S),m++}h=c.firstChild}h&&h.nodeType==1&&h.setAttribute("data-pm-slice",`${i} ${s}${m?` -${m}`:""} ${JSON.stringify(t)}`);let y=n.someProp("clipboardTextSerializer",_=>_(e,n))||e.content.textBetween(0,e.content.size,`
|
|
28
|
+
`,...$k(i)),console.warn(...s)}ha(),Xc=!1}function Dk(){let n=Ur[Ur.length-1];if(!n)return[];const e=[];for(;n;){const t=e[0];t&&t.vnode===n?t.recurseCount++:e.push({vnode:n,recurseCount:0});const r=n.component&&n.component.parent;n=r&&r.vnode}return e}function $k(n){const e=[];return n.forEach((t,r)=>{e.push(...r===0?[]:[`
|
|
29
|
+
`],...Fk(t))}),e}function Fk({vnode:n,recurseCount:e}){const t=e>0?`... (${e} recursive calls)`:"",r=n.component?n.component.parent==null:!1,i=` at <${Rg(n.component,n.type,r)}`,s=">"+t;return n.props?[i,...Bk(n.props),s]:[i+s]}function Bk(n){const e=[],t=Object.keys(n);return t.slice(0,3).forEach(r=>{e.push(...gg(r,n[r]))}),t.length>3&&e.push(" ..."),e}function gg(n,e,t){return $n(e)?(e=JSON.stringify(e),t?e:[`${n}=${e}`]):typeof e=="number"||typeof e=="boolean"||e==null?t?e:[`${n}=${e}`]:lt(e)?(e=gg(n,he(e.value),!0),t?e:[`${n}=Ref<`,e,">"]):Qe(e)?[`${n}=fn${e.name?`<${e.name}>`:""}`]:(e=he(e),t?e:[`${n}=`,e])}const yg={sp:"serverPrefetch hook",bc:"beforeCreate hook",c:"created hook",bm:"beforeMount hook",m:"mounted hook",bu:"beforeUpdate hook",u:"updated",bum:"beforeUnmount hook",um:"unmounted hook",a:"activated hook",da:"deactivated hook",ec:"errorCaptured hook",rtc:"renderTracked hook",rtg:"renderTriggered hook",0:"setup function",1:"render function",2:"watcher getter",3:"watcher callback",4:"watcher cleanup function",5:"native event handler",6:"component event handler",7:"vnode hook",8:"directive hook",9:"transition hook",10:"app errorHandler",11:"app warnHandler",12:"ref function",13:"async component loader",14:"scheduler flush",15:"component update",16:"app unmount cleanup function"};function wa(n,e,t,r){try{return r?n(...r):n()}catch(i){Zc(i,e,t)}}function bg(n,e,t,r){if(Qe(n)){const i=wa(n,e,t,r);return i&&YC(i)&&i.catch(s=>{Zc(s,e,t)}),i}if($e(n)){const i=[];for(let s=0;s<n.length;s++)i.push(bg(n[s],e,t,r));return i}else process.env.NODE_ENV!=="production"&&ut(`Invalid value type passed to callWithAsyncErrorHandling(): ${typeof n}`)}function Zc(n,e,t,r=!0){const i=e?e.vnode:null,{errorHandler:s,throwUnhandledErrorInProduction:a}=e&&e.appContext.config||xs;if(e){let u=e.parent;const c=e.proxy,h=process.env.NODE_ENV!=="production"?yg[t]:`https://vuejs.org/error-reference/#runtime-${t}`;for(;u;){const m=u.ec;if(m){for(let d=0;d<m.length;d++)if(m[d](n,c,h)===!1)return}u=u.parent}if(s){fa(),wa(s,null,10,[n,c,h]),ha();return}}zk(n,t,i,r,a)}function zk(n,e,t,r=!0,i=!1){if(process.env.NODE_ENV!=="production"){const s=yg[e];if(t&&Lk(t),ut(`Unhandled error${s?` during execution of ${s}`:""}`),t&&Pk(),r)throw n;console.error(n)}else{if(i)throw n;console.error(n)}}const Kt=[];let Hn=-1;const Ai=[];let pr=null,Oi=0;const Hk=Promise.resolve();let Qc=null;const Wk=100;function Vk(n){let e=Hn+1,t=Kt.length;for(;e<t;){const r=e+t>>>1,i=Kt[r],s=Is(i);s<n||s===n&&i.flags&2?e=r+1:t=r}return e}function _g(n){if(!(n.flags&1)){const e=Is(n),t=Kt[Kt.length-1];!t||!(n.flags&2)&&e>=Is(t)?Kt.push(n):Kt.splice(Vk(e),0,n),n.flags|=1,wg()}}function wg(){Qc||(Qc=Hk.then(Sg))}function vg(n){$e(n)?Ai.push(...n):pr&&n.id===-1?pr.splice(Oi+1,0,n):n.flags&1||(Ai.push(n),n.flags|=1),wg()}function Uk(n){if(Ai.length){const e=[...new Set(Ai)].sort((t,r)=>Is(t)-Is(r));if(Ai.length=0,pr){pr.push(...e);return}for(pr=e,process.env.NODE_ENV!=="production"&&(n=n||new Map),Oi=0;Oi<pr.length;Oi++){const t=pr[Oi];process.env.NODE_ENV!=="production"&&xg(n,t)||(t.flags&4&&(t.flags&=-2),t.flags&8||t(),t.flags&=-2)}pr=null,Oi=0}}const Is=n=>n.id==null?n.flags&2?-1:1/0:n.id;function Sg(n){process.env.NODE_ENV!=="production"&&(n=n||new Map);const e=process.env.NODE_ENV!=="production"?t=>xg(n,t):Ei;try{for(Hn=0;Hn<Kt.length;Hn++){const t=Kt[Hn];if(t&&!(t.flags&8)){if(process.env.NODE_ENV!=="production"&&e(t))continue;t.flags&4&&(t.flags&=-2),wa(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2)}}}finally{for(;Hn<Kt.length;Hn++){const t=Kt[Hn];t&&(t.flags&=-2)}Hn=-1,Kt.length=0,Uk(n),Qc=null,(Kt.length||Ai.length)&&Sg(n)}}function xg(n,e){const t=n.get(e)||0;if(t>Wk){const r=e.i,i=r&&Ng(r.type);return Zc(`Maximum recursive updates exceeded${i?` in component <${i}>`:""}. This means you have a reactive effect that is mutating its own dependencies and thus recursively triggering itself. Possible sources include component template, render function, updated hook or watcher source function.`,null,10),!0}return n.set(e,t+1),!1}const ef=new Map;process.env.NODE_ENV!=="production"&&(ca().__VUE_HMR_RUNTIME__={createRecord:tf(qk),rerender:tf(Kk),reload:tf(Gk)});const va=new Map;function qk(n,e){return va.has(n)?!1:(va.set(n,{initialDef:Sa(e),instances:new Set}),!0)}function Sa(n){return Lg(n)?n.__vccOpts:n}function Kk(n,e){const t=va.get(n);t&&(t.initialDef.render=e,[...t.instances].forEach(r=>{e&&(r.render=e,Sa(r.type).render=e),r.renderCache=[],r.update()}))}function Gk(n,e){const t=va.get(n);if(!t)return;e=Sa(e),Eg(t.initialDef,e);const r=[...t.instances];for(let i=0;i<r.length;i++){const s=r[i],a=Sa(s.type);let u=ef.get(a);u||(a!==t.initialDef&&Eg(a,e),ef.set(a,u=new Set)),u.add(s),s.appContext.propsCache.delete(s.type),s.appContext.emitsCache.delete(s.type),s.appContext.optionsCache.delete(s.type),s.ceReload?(u.add(s),s.ceReload(e.styles),u.delete(s)):s.parent?_g(()=>{s.parent.update(),u.delete(s)}):s.appContext.reload?s.appContext.reload():typeof window<"u"?window.location.reload():console.warn("[HMR] Root or manually mounted instance modified. Full reload required."),s.root.ce&&s!==s.root&&s.root.ce._removeChildStyle(a)}vg(()=>{ef.clear()})}function Eg(n,e){cr(n,e);for(const t in n)t!=="__file"&&!(t in e)&&delete n[t]}function tf(n){return(e,t)=>{try{return n(e,t)}catch(r){console.error(r),console.warn("[HMR] Something went wrong during Vue component hot-reload. Full reload required.")}}}let Mi,xa=[];function Cg(n,e){var t,r;Mi=n,Mi?(Mi.enabled=!0,xa.forEach(({event:i,args:s})=>Mi.emit(i,...s)),xa=[]):typeof window<"u"&&window.HTMLElement&&!((r=(t=window.navigator)==null?void 0:t.userAgent)!=null&&r.includes("jsdom"))?((e.__VUE_DEVTOOLS_HOOK_REPLAY__=e.__VUE_DEVTOOLS_HOOK_REPLAY__||[]).push(s=>{Cg(s,e)}),setTimeout(()=>{Mi||(e.__VUE_DEVTOOLS_HOOK_REPLAY__=null,xa=[])},3e3)):xa=[]}let Ii=null,Jk=null;const jk=n=>n.__isTeleport;function kg(n,e){n.shapeFlag&6&&n.component?(n.transition=e,kg(n.component.subTree,e)):n.shapeFlag&128?(n.ssContent.transition=e.clone(n.ssContent),n.ssFallback.transition=e.clone(n.ssFallback)):n.transition=e}ca().requestIdleCallback,ca().cancelIdleCallback;const Yk=Symbol.for("v-ndc"),Xk={};process.env.NODE_ENV!=="production"&&(Xk.ownKeys=n=>(ut("Avoid app logic that relies on enumerating keys on a component instance. The keys will be empty in production mode to avoid performance overhead."),Reflect.ownKeys(n)));let Zk=null;function Qk(n,e,t=!1){const r=ka||Ii;if(r||Zk){const i=r?r.parent==null?r.vnode.appContext&&r.vnode.appContext.provides:r.parent.provides:void 0;if(i&&n in i)return i[n];if(arguments.length>1)return t&&Qe(e)?e.call(r&&r.proxy):e;process.env.NODE_ENV!=="production"&&ut(`injection "${String(n)}" not found.`)}else process.env.NODE_ENV!=="production"&&ut("inject() can only be used inside setup() or functional components.")}const e5={},Tg=n=>Object.getPrototypeOf(n)===e5,t5=a5,n5=Symbol.for("v-scx"),r5=()=>{{const n=Qk(n5);return n||process.env.NODE_ENV!=="production"&&ut("Server rendering context not provided. Make sure to only call useSSRContext() conditionally in the server build."),n}};function i5(n,e,t){return process.env.NODE_ENV!=="production"&&!Qe(e)&&ut("`watch(fn, options?)` signature has been moved to a separate API. Use `watchEffect(fn, options?)` instead. `watch` now only supports `watch(source, cb, options?) signature."),s5(n,e,t)}function s5(n,e,t=xs){const{immediate:r,deep:i,flush:s,once:a}=t;process.env.NODE_ENV!=="production"&&!e&&(r!==void 0&&ut('watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.'),i!==void 0&&ut('watch() "deep" option is only respected when using the watch(source, callback, options?) signature.'),a!==void 0&&ut('watch() "once" option is only respected when using the watch(source, callback, options?) signature.'));const u=cr({},t);process.env.NODE_ENV!=="production"&&(u.onWarn=ut);const c=e&&r||!e&&s!=="post";let h;if(Ta){if(s==="sync"){const _=r5();h=_.__watcherHandles||(_.__watcherHandles=[])}else if(!c){const _=()=>{};return _.stop=Ei,_.resume=Ei,_.pause=Ei,_}}const m=ka;u.call=(_,v,E)=>bg(_,m,v,E);let d=!1;s==="post"?u.scheduler=_=>{t5(_,m&&m.suspense)}:s!=="sync"&&(d=!0,u.scheduler=(_,v)=>{v?_():_g(_)}),u.augmentJob=_=>{e&&(_.flags|=4),d&&(_.flags|=2,m&&(_.id=m.uid,_.i=m))};const y=Rk(n,e,u);return Ta&&(h?h.push(y):c&&y()),y}const o5=n=>n.__isSuspense;function a5(n,e){e&&e.pendingBranch?$e(n)?e.effects.push(...n):e.effects.push(n):vg(n)}const Ag=Symbol.for("v-fgt"),l5=Symbol.for("v-txt"),u5=Symbol.for("v-cmt");function c5(n){return n?n.__v_isVNode===!0:!1}const f5=(...n)=>Mg(...n),Og=({key:n})=>n??null,Ea=({ref:n,ref_key:e,ref_for:t})=>(typeof n=="number"&&(n=""+n),n!=null?$n(n)||lt(n)||Qe(n)?{i:Ii,r:n,k:e,f:!!t}:n:null);function h5(n,e=null,t=null,r=0,i=null,s=n===Ag?0:1,a=!1,u=!1){const c={__v_isVNode:!0,__v_skip:!0,type:n,props:e,key:e&&Og(e),ref:e&&Ea(e),scopeId:Jk,slotScopeIds:null,children:t,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:s,patchFlag:r,dynamicProps:i,dynamicChildren:null,appContext:null,ctx:Ii};return u?(nf(c,t),s&128&&n.normalize(c)):t&&(c.shapeFlag|=$n(t)?8:16),process.env.NODE_ENV!=="production"&&c.key!==c.key&&ut("VNode created with invalid key (NaN). VNode type:",c.type),c}const d5=process.env.NODE_ENV!=="production"?f5:Mg;function Mg(n,e=null,t=null,r=0,i=null,s=!1){if((!n||n===Yk)&&(process.env.NODE_ENV!=="production"&&!n&&ut(`Invalid vnode type when creating vnode: ${n}.`),n=u5),c5(n)){const u=Ca(n,e,!0);return t&&nf(u,t),u.patchFlag=-2,u}if(Lg(n)&&(n=n.__vccOpts),e){e=p5(e);let{class:u,style:c}=e;u&&!$n(u)&&(e.class=$c(u)),yt(c)&&(ga(c)&&!$e(c)&&(c=cr({},c)),e.style=Dc(c))}const a=$n(n)?1:o5(n)?128:jk(n)?64:yt(n)?4:Qe(n)?2:0;return process.env.NODE_ENV!=="production"&&a&4&&ga(n)&&(n=he(n),ut("Vue received a Component that was made a reactive object. This can lead to unnecessary performance overhead and should be avoided by marking the component with `markRaw` or using `shallowRef` instead of `ref`.",`
|
|
30
|
+
Component that was made reactive: `,n)),h5(n,e,t,r,i,a,s,!0)}function p5(n){return n?ga(n)||Tg(n)?cr({},n):n:null}function Ca(n,e,t=!1,r=!1){const{props:i,ref:s,patchFlag:a,children:u,transition:c}=n,h=e?g5(i||{},e):i,m={__v_isVNode:!0,__v_skip:!0,type:n.type,props:h,key:h&&Og(h),ref:e&&e.ref?t&&s?$e(s)?s.concat(Ea(e)):[s,Ea(e)]:Ea(e):s,scopeId:n.scopeId,slotScopeIds:n.slotScopeIds,children:process.env.NODE_ENV!=="production"&&a===-1&&$e(u)?u.map(Ig):u,target:n.target,targetStart:n.targetStart,targetAnchor:n.targetAnchor,staticCount:n.staticCount,shapeFlag:n.shapeFlag,patchFlag:e&&n.type!==Ag?a===-1?16:a|16:a,dynamicProps:n.dynamicProps,dynamicChildren:n.dynamicChildren,appContext:n.appContext,dirs:n.dirs,transition:c,component:n.component,suspense:n.suspense,ssContent:n.ssContent&&Ca(n.ssContent),ssFallback:n.ssFallback&&Ca(n.ssFallback),el:n.el,anchor:n.anchor,ctx:n.ctx,ce:n.ce};return c&&r&&kg(m,c.clone(m)),m}function Ig(n){const e=Ca(n);return $e(n.children)&&(e.children=n.children.map(Ig)),e}function m5(n=" ",e=0){return d5(l5,null,n,e)}function nf(n,e){let t=0;const{shapeFlag:r}=n;if(e==null)e=null;else if($e(e))t=16;else if(typeof e=="object")if(r&65){const i=e.default;i&&(i._c&&(i._d=!1),nf(n,i()),i._c&&(i._d=!0));return}else t=32,!e._&&!Tg(e)&&(e._ctx=Ii);else Qe(e)?(e={default:e,_ctx:Ii},t=32):(e=String(e),r&64?(t=16,e=[m5(e)]):t=8);n.children=e,n.shapeFlag|=t}function g5(...n){const e={};for(let t=0;t<n.length;t++){const r=n[t];for(const i in r)if(i==="class")e.class!==r.class&&(e.class=$c([e.class,r.class]));else if(i==="style")e.style=Dc([e.style,r.style]);else if(GC(i)){const s=e[i],a=r[i];a&&s!==a&&!($e(s)&&s.includes(a))&&(e[i]=s?[].concat(s,a):a)}else i!==""&&(e[i]=r[i])}return e}let ka=null;const y5=()=>ka||Ii;{const n=ca(),e=(t,r)=>{let i;return(i=n[t])||(i=n[t]=[]),i.push(r),s=>{i.length>1?i.forEach(a=>a(s)):i[0](s)}};e("__VUE_INSTANCE_SETTERS__",t=>ka=t),e("__VUE_SSR_SETTERS__",t=>Ta=t)}let Ta=!1;process.env.NODE_ENV;const b5=/(?:^|[-_])(\w)/g,_5=n=>n.replace(b5,e=>e.toUpperCase()).replace(/[-_]/g,"");function Ng(n,e=!0){return Qe(n)?n.displayName||n.name:n.name||e&&n.__name}function Rg(n,e,t=!1){let r=Ng(e);if(!r&&e.__file){const i=e.__file.match(/([^/\\]+)\.\w+$/);i&&(r=i[1])}if(!r&&n&&n.parent){const i=s=>{for(const a in s)if(s[a]===e)return a};r=i(n.components||n.parent.type.components)||i(n.appContext.components)}return r?_5(r):t?"App":"Anonymous"}function Lg(n){return Qe(n)&&"__vccOpts"in n}const ge=(n,e)=>{const t=Ik(n,e,Ta);if(process.env.NODE_ENV!=="production"){const r=y5();r&&r.appContext.config.warnRecursiveComputed&&(t._warnRecursive=!0)}return t};function w5(){if(process.env.NODE_ENV==="production"||typeof window>"u")return;const n={style:"color:#3ba776"},e={style:"color:#1677ff"},t={style:"color:#f5222d"},r={style:"color:#eb2f96"},i={__vue_custom_formatter:!0,header(d){return yt(d)?d.__isVue?["div",n,"VueInstance"]:lt(d)?["div",{},["span",n,m(d)],"<",u("_value"in d?d._value:d),">"]:Ms(d)?["div",{},["span",n,_t(d)?"ShallowReactive":"Reactive"],"<",u(d),`>${zn(d)?" (readonly)":""}`]:zn(d)?["div",{},["span",n,_t(d)?"ShallowReadonly":"Readonly"],"<",u(d),">"]:null:null},hasBody(d){return d&&d.__isVue},body(d){if(d&&d.__isVue)return["div",{},...s(d.$)]}};function s(d){const y=[];d.type.props&&d.props&&y.push(a("props",he(d.props))),d.setupState!==xs&&y.push(a("setup",d.setupState)),d.data!==xs&&y.push(a("data",he(d.data)));const _=c(d,"computed");_&&y.push(a("computed",_));const v=c(d,"inject");return v&&y.push(a("injected",v)),y.push(["div",{},["span",{style:r.style+";opacity:0.66"},"$ (internal): "],["object",{object:d}]]),y}function a(d,y){return y=cr({},y),Object.keys(y).length?["div",{style:"line-height:1.25em;margin-bottom:0.6em"},["div",{style:"color:#476582"},d],["div",{style:"padding-left:1.25em"},...Object.keys(y).map(_=>["div",{},["span",r,_+": "],u(y[_],!1)])]]:["span",{}]}function u(d,y=!0){return typeof d=="number"?["span",e,d]:typeof d=="string"?["span",t,JSON.stringify(d)]:typeof d=="boolean"?["span",r,d]:yt(d)?["object",{object:y?he(d):d}]:["span",t,String(d)]}function c(d,y){const _=d.type;if(Qe(_))return;const v={};for(const E in d.ctx)h(_,E,y)&&(v[E]=d.ctx[E]);return v}function h(d,y,_){const v=d[_];if($e(v)&&v.includes(y)||yt(v)&&y in v||d.extends&&h(d.extends,y,_)||d.mixins&&d.mixins.some(E=>h(E,y,_)))return!0}function m(d){return _t(d)?"ShallowRef":d.effect?"ComputedRef":"Ref"}window.devtoolsFormatters?window.devtoolsFormatters.push(i):window.devtoolsFormatters=[i]}process.env.NODE_ENV,process.env.NODE_ENV,process.env.NODE_ENV;function v5(){w5()}process.env.NODE_ENV!=="production"&&v5();function et(n){this.content=n}et.prototype={constructor:et,find:function(n){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===n)return e;return-1},get:function(n){var e=this.find(n);return e==-1?void 0:this.content[e+1]},update:function(n,e,t){var r=t&&t!=n?this.remove(t):this,i=r.find(n),s=r.content.slice();return i==-1?s.push(t||n,e):(s[i+1]=e,t&&(s[i]=t)),new et(s)},remove:function(n){var e=this.find(n);if(e==-1)return this;var t=this.content.slice();return t.splice(e,2),new et(t)},addToStart:function(n,e){return new et([n,e].concat(this.remove(n).content))},addToEnd:function(n,e){var t=this.remove(n).content.slice();return t.push(n,e),new et(t)},addBefore:function(n,e,t){var r=this.remove(e),i=r.content.slice(),s=r.find(n);return i.splice(s==-1?i.length:s,0,e,t),new et(i)},forEach:function(n){for(var e=0;e<this.content.length;e+=2)n(this.content[e],this.content[e+1])},prepend:function(n){return n=et.from(n),n.size?new et(n.content.concat(this.subtract(n).content)):this},append:function(n){return n=et.from(n),n.size?new et(this.subtract(n).content.concat(n.content)):this},subtract:function(n){var e=this;n=et.from(n);for(var t=0;t<n.content.length;t+=2)e=e.remove(n.content[t]);return e},toObject:function(){var n={};return this.forEach(function(e,t){n[e]=t}),n},get size(){return this.content.length>>1}},et.from=function(n){if(n instanceof et)return n;var e=[];if(n)for(var t in n)e.push(t,n[t]);return new et(e)};function Pg(n,e,t){for(let r=0;;r++){if(r==n.childCount||r==e.childCount)return n.childCount==e.childCount?null:t;let i=n.child(r),s=e.child(r);if(i==s){t+=i.nodeSize;continue}if(!i.sameMarkup(s))return t;if(i.isText&&i.text!=s.text){for(let a=0;i.text[a]==s.text[a];a++)t++;return t}if(i.content.size||s.content.size){let a=Pg(i.content,s.content,t+1);if(a!=null)return a}t+=i.nodeSize}}function Dg(n,e,t,r){for(let i=n.childCount,s=e.childCount;;){if(i==0||s==0)return i==s?null:{a:t,b:r};let a=n.child(--i),u=e.child(--s),c=a.nodeSize;if(a==u){t-=c,r-=c;continue}if(!a.sameMarkup(u))return{a:t,b:r};if(a.isText&&a.text!=u.text){let h=0,m=Math.min(a.text.length,u.text.length);for(;h<m&&a.text[a.text.length-h-1]==u.text[u.text.length-h-1];)h++,t--,r--;return{a:t,b:r}}if(a.content.size||u.content.size){let h=Dg(a.content,u.content,t-1,r-1);if(h)return h}t-=c,r-=c}}let V=class ht{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,t,r,i=0,s){for(let a=0,u=0;u<t;a++){let c=this.content[a],h=u+c.nodeSize;if(h>e&&r(c,i+u,s||null,a)!==!1&&c.content.size){let m=u+1;c.nodesBetween(Math.max(0,e-m),Math.min(c.content.size,t-m),r,i+m)}u=h}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,r,i){let s="",a=!0;return this.nodesBetween(e,t,(u,c)=>{let h=u.isText?u.text.slice(Math.max(e,c)-c,t-c):u.isLeaf?i?typeof i=="function"?i(u):i:u.type.spec.leafText?u.type.spec.leafText(u):"":"";u.isBlock&&(u.isLeaf&&h||u.isTextblock)&&r&&(a?a=!1:s+=r),s+=h},0),s}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,r=e.firstChild,i=this.content.slice(),s=0;for(t.isText&&t.sameMarkup(r)&&(i[i.length-1]=t.withText(t.text+r.text),s=1);s<e.content.length;s++)i.push(e.content[s]);return new ht(i,this.size+e.size)}cut(e,t=this.size){if(e==0&&t==this.size)return this;let r=[],i=0;if(t>e)for(let s=0,a=0;a<t;s++){let u=this.content[s],c=a+u.nodeSize;c>e&&((a<e||c>t)&&(u.isText?u=u.cut(Math.max(0,e-a),Math.min(u.text.length,t-a)):u=u.cut(Math.max(0,e-a-1),Math.min(u.content.size,t-a-1))),r.push(u),i+=u.nodeSize),a=c}return new ht(r,i)}cutByIndex(e,t){return e==t?ht.empty:e==0&&t==this.content.length?this:new ht(this.content.slice(e,t))}replaceChild(e,t){let r=this.content[e];if(r==t)return this;let i=this.content.slice(),s=this.size+t.nodeSize-r.nodeSize;return i[e]=t,new ht(i,s)}addToStart(e){return new ht([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new ht(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))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(e){let t=this.content[e];if(!t)throw new RangeError("Index "+e+" out of range for "+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,r=0;t<this.content.length;t++){let i=this.content[t];e(i,r,t),r+=i.nodeSize}}findDiffStart(e,t=0){return Pg(this,e,t)}findDiffEnd(e,t=this.size,r=e.size){return Dg(this,e,t,r)}findIndex(e,t=-1){if(e==0)return Aa(0,e);if(e==this.size)return Aa(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let r=0,i=0;;r++){let s=this.child(r),a=i+s.nodeSize;if(a>=e)return a==e||t>0?Aa(r+1,a):Aa(r,i);i=a}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,t){if(!t)return ht.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new ht(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return ht.empty;let t,r=0;for(let i=0;i<e.length;i++){let s=e[i];r+=s.nodeSize,i&&s.isText&&e[i-1].sameMarkup(s)?(t||(t=e.slice(0,i)),t[t.length-1]=s.withText(t[t.length-1].text+s.text)):t&&t.push(s)}return new ht(t||e,r)}static from(e){if(!e)return ht.empty;if(e instanceof ht)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new ht([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}};V.empty=new V([],0);const rf={index:0,offset:0};function Aa(n,e){return rf.index=n,rf.offset=e,rf}function Oa(n,e){if(n===e)return!0;if(!(n&&typeof n=="object")||!(e&&typeof e=="object"))return!1;let t=Array.isArray(n);if(Array.isArray(e)!=t)return!1;if(t){if(n.length!=e.length)return!1;for(let r=0;r<n.length;r++)if(!Oa(n[r],e[r]))return!1}else{for(let r in n)if(!(r in e)||!Oa(n[r],e[r]))return!1;for(let r in e)if(!(r in n))return!1}return!0}let Ae=class nd{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,r=!1;for(let i=0;i<e.length;i++){let s=e[i];if(this.eq(s))return e;if(this.type.excludes(s.type))t||(t=e.slice(0,i));else{if(s.type.excludes(this.type))return e;!r&&s.type.rank>this.type.rank&&(t||(t=e.slice(0,i)),t.push(this),r=!0),t&&t.push(s)}}return t||(t=e.slice()),r||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&Oa(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[t.type];if(!r)throw new RangeError(`There is no mark type ${t.type} in this schema`);let i=r.create(t.attrs);return r.checkAttrs(i.attrs),i}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(t[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return nd.none;if(e instanceof nd)return[e];let t=e.slice();return t.sort((r,i)=>r.type.rank-i.type.rank),t}};Ae.none=[];class Ma extends Error{}class K{constructor(e,t,r){this.content=e,this.openStart=t,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let r=Fg(this.content,e+this.openStart,t);return r&&new K(r,this.openStart,this.openEnd)}removeBetween(e,t){return new K($g(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,t){if(!t)return K.empty;let r=t.openStart||0,i=t.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new K(V.fromJSON(e,t.content),r,i)}static maxOpen(e,t=!0){let r=0,i=0;for(let s=e.firstChild;s&&!s.isLeaf&&(t||!s.type.spec.isolating);s=s.firstChild)r++;for(let s=e.lastChild;s&&!s.isLeaf&&(t||!s.type.spec.isolating);s=s.lastChild)i++;return new K(e,r,i)}}K.empty=new K(V.empty,0,0);function $g(n,e,t){let{index:r,offset:i}=n.findIndex(e),s=n.maybeChild(r),{index:a,offset:u}=n.findIndex(t);if(i==e||s.isText){if(u!=t&&!n.child(a).isText)throw new RangeError("Removing non-flat range");return n.cut(0,e).append(n.cut(t))}if(r!=a)throw new RangeError("Removing non-flat range");return n.replaceChild(r,s.copy($g(s.content,e-i-1,t-i-1)))}function Fg(n,e,t,r){let{index:i,offset:s}=n.findIndex(e),a=n.maybeChild(i);if(s==e||a.isText)return n.cut(0,e).append(t).append(n.cut(e));let u=Fg(a.content,e-s-1,t);return u&&n.replaceChild(i,a.copy(u))}function S5(n,e,t){if(t.openStart>n.depth)throw new Ma("Inserted content deeper than insertion position");if(n.depth-t.openStart!=e.depth-t.openEnd)throw new Ma("Inconsistent open depths");return Bg(n,e,t,0)}function Bg(n,e,t,r){let i=n.index(r),s=n.node(r);if(i==e.index(r)&&r<n.depth-t.openStart){let a=Bg(n,e,t,r+1);return s.copy(s.content.replaceChild(i,a))}else if(t.content.size)if(!t.openStart&&!t.openEnd&&n.depth==r&&e.depth==r){let a=n.parent,u=a.content;return Kr(a,u.cut(0,n.parentOffset).append(t.content).append(u.cut(e.parentOffset)))}else{let{start:a,end:u}=x5(t,n);return Kr(s,Hg(n,a,u,e,r))}else return Kr(s,Ia(n,e,r))}function zg(n,e){if(!e.type.compatibleContent(n.type))throw new Ma("Cannot join "+e.type.name+" onto "+n.type.name)}function sf(n,e,t){let r=n.node(t);return zg(r,e.node(t)),r}function qr(n,e){let t=e.length-1;t>=0&&n.isText&&n.sameMarkup(e[t])?e[t]=n.withText(e[t].text+n.text):e.push(n)}function Ns(n,e,t,r){let i=(e||n).node(t),s=0,a=e?e.index(t):i.childCount;n&&(s=n.index(t),n.depth>t?s++:n.textOffset&&(qr(n.nodeAfter,r),s++));for(let u=s;u<a;u++)qr(i.child(u),r);e&&e.depth==t&&e.textOffset&&qr(e.nodeBefore,r)}function Kr(n,e){return n.type.checkContent(e),n.copy(e)}function Hg(n,e,t,r,i){let s=n.depth>i&&sf(n,e,i+1),a=r.depth>i&&sf(t,r,i+1),u=[];return Ns(null,n,i,u),s&&a&&e.index(i)==t.index(i)?(zg(s,a),qr(Kr(s,Hg(n,e,t,r,i+1)),u)):(s&&qr(Kr(s,Ia(n,e,i+1)),u),Ns(e,t,i,u),a&&qr(Kr(a,Ia(t,r,i+1)),u)),Ns(r,null,i,u),new V(u)}function Ia(n,e,t){let r=[];if(Ns(null,n,t,r),n.depth>t){let i=sf(n,e,t+1);qr(Kr(i,Ia(n,e,t+1)),r)}return Ns(e,null,t,r),new V(r)}function x5(n,e){let t=e.depth-n.openStart,i=e.node(t).copy(n.content);for(let s=t-1;s>=0;s--)i=e.node(s).copy(V.from(i));return{start:i.resolveNoCache(n.openStart+t),end:i.resolveNoCache(i.content.size-n.openEnd-t)}}class so{constructor(e,t,r){this.pos=e,this.path=t,this.parentOffset=r,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=e.child(t);return r?e.child(t).cut(r):i}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let r=this.path[t*3],i=t==0?0:this.path[t*3-1]+1;for(let s=0;s<e;s++)i+=r.child(s).nodeSize;return i}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return Ae.none;if(this.textOffset)return e.child(t).marks;let r=e.maybeChild(t-1),i=e.maybeChild(t);if(!r){let u=r;r=i,i=u}let s=r.marks;for(var a=0;a<s.length;a++)s[a].type.spec.inclusive===!1&&(!i||!s[a].isInSet(i.marks))&&(s=s[a--].removeFromSet(s));return s}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let r=t.marks,i=e.parent.maybeChild(e.index());for(var s=0;s<r.length;s++)r[s].type.spec.inclusive===!1&&(!i||!r[s].isInSet(i.marks))&&(r=r[s--].removeFromSet(r));return r}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!t||t(this.node(r))))return new Na(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let t=1;t<=this.depth;t++)e+=(e?"/":"")+this.node(t).type.name+"_"+this.index(t-1);return e+":"+this.parentOffset}static resolve(e,t){if(!(t>=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");let r=[],i=0,s=t;for(let a=e;;){let{index:u,offset:c}=a.content.findIndex(s),h=s-c;if(r.push(a,u,i+c),!h||(a=a.child(u),a.isText))break;s=h-1,i+=c+1}return new so(t,r,s)}static resolveCached(e,t){let r=Wg.get(e);if(r)for(let s=0;s<r.elts.length;s++){let a=r.elts[s];if(a.pos==t)return a}else Wg.set(e,r=new E5);let i=r.elts[r.i]=so.resolve(e,t);return r.i=(r.i+1)%C5,i}}class E5{constructor(){this.elts=[],this.i=0}}const C5=12,Wg=new WeakMap;class Na{constructor(e,t,r){this.$from=e,this.$to=t,this.depth=r}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)}}const k5=Object.create(null);let mr=class rd{constructor(e,t,r,i=Ae.none){this.type=e,this.attrs=t,this.marks=i,this.content=r||V.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,r,i=0){this.content.nodesBetween(e,t,r,i,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,t,r,i){return this.content.textBetween(e,t,r,i)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,r){return this.type==e&&Oa(this.attrs,t||e.defaultAttrs||k5)&&Ae.sameSet(this.marks,r||Ae.none)}copy(e=null){return e==this.content?this:new rd(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new rd(this.type,this.attrs,this.content,e)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,r=!1){if(e==t)return K.empty;let i=this.resolve(e),s=this.resolve(t),a=r?0:i.sharedDepth(t),u=i.start(a),h=i.node(a).content.cut(i.pos-u,s.pos-u);return new K(h,i.depth-a,s.depth-a)}replace(e,t,r){return S5(this.resolve(e),this.resolve(t),r)}nodeAt(e){for(let t=this;;){let{index:r,offset:i}=t.content.findIndex(e);if(t=t.maybeChild(r),!t)return null;if(i==e||t.isText)return t;e-=i+1}}childAfter(e){let{index:t,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(t),index:t,offset:r};let i=this.content.child(t-1);return{node:i,index:t-1,offset:r-i.nodeSize}}resolve(e){return so.resolveCached(this,e)}resolveNoCache(e){return so.resolve(this,e)}rangeHasMark(e,t,r){let i=!1;return t>e&&this.nodesBetween(e,t,s=>(r.isInSet(s.marks)&&(i=!0),!i)),i}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 e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),Vg(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,r=V.empty,i=0,s=r.childCount){let a=this.contentMatchAt(e).matchFragment(r,i,s),u=a&&a.matchFragment(this.content,t);if(!u||!u.validEnd)return!1;for(let c=i;c<s;c++)if(!this.type.allowsMarks(r.child(c).marks))return!1;return!0}canReplaceWith(e,t,r,i){if(i&&!this.type.allowsMarks(i))return!1;let s=this.contentMatchAt(e).matchType(r),a=s&&s.matchFragment(this.content,t);return a?a.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=Ae.none;for(let t=0;t<this.marks.length;t++){let r=this.marks[t];r.type.checkAttrs(r.attrs),e=r.addToSet(e)}if(!Ae.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(t=>t.type.name)}`);this.content.forEach(t=>t.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(t=>t.toJSON())),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let r;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=t.marks.map(e.markFromJSON)}if(t.type=="text"){if(typeof t.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(t.text,r)}let i=V.fromJSON(e,t.content),s=e.nodeType(t.type).create(t.attrs,i,r);return s.type.checkAttrs(s.attrs),s}};mr.prototype.text=void 0;class ru extends mr{constructor(e,t,r,i){if(super(e,t,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Vg(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new ru(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new ru(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function Vg(n,e){for(let t=n.length-1;t>=0;t--)e=n[t].type.name+"("+e+")";return e}class ai{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let r=new T5(e,t);if(r.next==null)return ai.empty;let i=Ug(r);r.next&&r.err("Unexpected trailing text");let s=L5(R5(i));return P5(s,r),s}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,r=e.childCount){let i=this;for(let s=t;i&&s<r;s++)i=i.matchType(e.child(s).type);return i}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let r=0;r<e.next.length;r++)if(this.next[t].type==e.next[r].type)return!0;return!1}fillBefore(e,t=!1,r=0){let i=[this];function s(a,u){let c=a.matchFragment(e,r);if(c&&(!t||c.validEnd))return V.from(u.map(h=>h.createAndFill()));for(let h=0;h<a.next.length;h++){let{type:m,next:d}=a.next[h];if(!(m.isText||m.hasRequiredAttrs())&&i.indexOf(d)==-1){i.push(d);let y=s(d,u.concat(m));if(y)return y}}return null}return s(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let i=r.shift(),s=i.match;if(s.matchType(e)){let a=[];for(let u=i;u.type;u=u.via)a.push(u.type);return a.reverse()}for(let a=0;a<s.next.length;a++){let{type:u,next:c}=s.next[a];!u.isLeaf&&!u.hasRequiredAttrs()&&!(u.name in t)&&(!i.type||c.validEnd)&&(r.push({match:u.contentMatch,type:u,via:i}),t[u.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(r){e.push(r);for(let i=0;i<r.next.length;i++)e.indexOf(r.next[i].next)==-1&&t(r.next[i].next)}return t(this),e.map((r,i)=>{let s=i+(r.validEnd?"*":" ")+" ";for(let a=0;a<r.next.length;a++)s+=(a?", ":"")+r.next[a].type.name+"->"+e.indexOf(r.next[a].next);return s}).join(`
|
|
31
|
+
`)}}ai.empty=new ai(!0);class T5{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.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(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function Ug(n){let e=[];do e.push(A5(n));while(n.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function A5(n){let e=[];do e.push(O5(n));while(n.next&&n.next!=")"&&n.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function O5(n){let e=N5(n);for(;;)if(n.eat("+"))e={type:"plus",expr:e};else if(n.eat("*"))e={type:"star",expr:e};else if(n.eat("?"))e={type:"opt",expr:e};else if(n.eat("{"))e=M5(n,e);else break;return e}function qg(n){/\D/.test(n.next)&&n.err("Expected number, got '"+n.next+"'");let e=Number(n.next);return n.pos++,e}function M5(n,e){let t=qg(n),r=t;return n.eat(",")&&(n.next!="}"?r=qg(n):r=-1),n.eat("}")||n.err("Unclosed braced range"),{type:"range",min:t,max:r,expr:e}}function I5(n,e){let t=n.nodeTypes,r=t[e];if(r)return[r];let i=[];for(let s in t){let a=t[s];a.isInGroup(e)&&i.push(a)}return i.length==0&&n.err("No node type or group '"+e+"' found"),i}function N5(n){if(n.eat("(")){let e=Ug(n);return n.eat(")")||n.err("Missing closing paren"),e}else if(/\W/.test(n.next))n.err("Unexpected token '"+n.next+"'");else{let e=I5(n,n.next).map(t=>(n.inline==null?n.inline=t.isInline:n.inline!=t.isInline&&n.err("Mixing inline and block content"),{type:"name",value:t}));return n.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function R5(n){let e=[[]];return i(s(n,0),t()),e;function t(){return e.push([])-1}function r(a,u,c){let h={term:c,to:u};return e[a].push(h),h}function i(a,u){a.forEach(c=>c.to=u)}function s(a,u){if(a.type=="choice")return a.exprs.reduce((c,h)=>c.concat(s(h,u)),[]);if(a.type=="seq")for(let c=0;;c++){let h=s(a.exprs[c],u);if(c==a.exprs.length-1)return h;i(h,u=t())}else if(a.type=="star"){let c=t();return r(u,c),i(s(a.expr,c),c),[r(c)]}else if(a.type=="plus"){let c=t();return i(s(a.expr,u),c),i(s(a.expr,c),c),[r(c)]}else{if(a.type=="opt")return[r(u)].concat(s(a.expr,u));if(a.type=="range"){let c=u;for(let h=0;h<a.min;h++){let m=t();i(s(a.expr,c),m),c=m}if(a.max==-1)i(s(a.expr,c),c);else for(let h=a.min;h<a.max;h++){let m=t();r(c,m),i(s(a.expr,c),m),c=m}return[r(c)]}else{if(a.type=="name")return[r(u,void 0,a.value)];throw new Error("Unknown expr type")}}}}function Kg(n,e){return e-n}function Gg(n,e){let t=[];return r(e),t.sort(Kg);function r(i){let s=n[i];if(s.length==1&&!s[0].term)return r(s[0].to);t.push(i);for(let a=0;a<s.length;a++){let{term:u,to:c}=s[a];!u&&t.indexOf(c)==-1&&r(c)}}}function L5(n){let e=Object.create(null);return t(Gg(n,0));function t(r){let i=[];r.forEach(a=>{n[a].forEach(({term:u,to:c})=>{if(!u)return;let h;for(let m=0;m<i.length;m++)i[m][0]==u&&(h=i[m][1]);Gg(n,c).forEach(m=>{h||i.push([u,h=[]]),h.indexOf(m)==-1&&h.push(m)})})});let s=e[r.join(",")]=new ai(r.indexOf(n.length-1)>-1);for(let a=0;a<i.length;a++){let u=i[a][1].sort(Kg);s.next.push({type:i[a][0],next:e[u.join(",")]||t(u)})}return s}}function P5(n,e){for(let t=0,r=[n];t<r.length;t++){let i=r[t],s=!i.validEnd,a=[];for(let u=0;u<i.next.length;u++){let{type:c,next:h}=i.next[u];a.push(c.name),s&&!(c.isText||c.hasRequiredAttrs())&&(s=!1),r.indexOf(h)==-1&&r.push(h)}s&&e.err("Only non-generatable nodes ("+a.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function Jg(n){let e=Object.create(null);for(let t in n){let r=n[t];if(!r.hasDefault)return null;e[t]=r.default}return e}function jg(n,e){let t=Object.create(null);for(let r in n){let i=e&&e[r];if(i===void 0){let s=n[r];if(s.hasDefault)i=s.default;else throw new RangeError("No value supplied for attribute "+r)}t[r]=i}return t}function Yg(n,e,t,r){for(let i in e)if(!(i in n))throw new RangeError(`Unsupported attribute ${i} for ${t} of type ${i}`);for(let i in n){let s=n[i];s.validate&&s.validate(e[i])}}function Xg(n,e){let t=Object.create(null);if(e)for(let r in e)t[r]=new $5(n,r,e[r]);return t}let Zg=class Gb{constructor(e,t,r){this.name=e,this.schema=t,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=Xg(e,r.attrs),this.defaultAttrs=Jg(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==ai.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:jg(this.attrs,e)}create(e=null,t,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new mr(this,this.computeAttrs(e),V.from(t),Ae.setFrom(r))}createChecked(e=null,t,r){return t=V.from(t),this.checkContent(t),new mr(this,this.computeAttrs(e),t,Ae.setFrom(r))}createAndFill(e=null,t,r){if(e=this.computeAttrs(e),t=V.from(t),t.size){let a=this.contentMatch.fillBefore(t);if(!a)return null;t=a.append(t)}let i=this.contentMatch.matchFragment(t),s=i&&i.fillBefore(V.empty,!0);return s?new mr(this,e,t.append(s),Ae.setFrom(r)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let r=0;r<e.childCount;r++)if(!this.allowsMarks(e.child(r).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){Yg(this.attrs,e,"node",this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let t;for(let r=0;r<e.length;r++)this.allowsMarkType(e[r].type)?t&&t.push(e[r]):t||(t=e.slice(0,r));return t?t.length?t:Ae.none:e}static compile(e,t){let r=Object.create(null);e.forEach((s,a)=>r[s]=new Gb(s,t,a));let i=t.spec.topNode||"doc";if(!r[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let s in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};function D5(n,e,t){let r=t.split("|");return i=>{let s=i===null?"null":typeof i;if(r.indexOf(s)<0)throw new RangeError(`Expected value of type ${r} for attribute ${e} on type ${n}, got ${s}`)}}class $5{constructor(e,t,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?D5(e,t,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class iu{constructor(e,t,r,i){this.name=e,this.rank=t,this.schema=r,this.spec=i,this.attrs=Xg(e,i.attrs),this.excluded=null;let s=Jg(this.attrs);this.instance=s?new Ae(this,s):null}create(e=null){return!e&&this.instance?this.instance:new Ae(this,jg(this.attrs,e))}static compile(e,t){let r=Object.create(null),i=0;return e.forEach((s,a)=>r[s]=new iu(s,i++,t,a)),r}removeFromSet(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}isInSet(e){for(let t=0;t<e.length;t++)if(e[t].type==this)return e[t]}checkAttrs(e){Yg(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class Qg{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let t=this.spec={};for(let i in e)t[i]=e[i];t.nodes=et.from(e.nodes),t.marks=et.from(e.marks||{}),this.nodes=Zg.compile(this.spec.nodes,this),this.marks=iu.compile(this.spec.marks,this);let r=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let s=this.nodes[i],a=s.spec.content||"",u=s.spec.marks;if(s.contentMatch=r[a]||(r[a]=ai.parse(a,this.nodes)),s.inlineContent=s.contentMatch.inlineContent,s.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!s.isInline||!s.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=s}s.markSet=u=="_"?null:u?e0(this,u.split(" ")):u==""||!s.inlineContent?[]:null}for(let i in this.marks){let s=this.marks[i],a=s.spec.excludes;s.excluded=a==null?[s]:a==""?[]:e0(this,a.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,t=null,r,i){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof Zg){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(t,r,i)}text(e,t){let r=this.nodes.text;return new ru(r,r.defaultAttrs,e,Ae.setFrom(t))}mark(e,t){return typeof e=="string"&&(e=this.marks[e]),e.create(t)}nodeFromJSON(e){return mr.fromJSON(this,e)}markFromJSON(e){return Ae.fromJSON(this,e)}nodeType(e){let t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t}}function e0(n,e){let t=[];for(let r=0;r<e.length;r++){let i=e[r],s=n.marks[i],a=s;if(s)t.push(s);else for(let u in n.marks){let c=n.marks[u];(i=="_"||c.spec.group&&c.spec.group.split(" ").indexOf(i)>-1)&&t.push(a=c)}if(!a)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return t}function F5(n){return n.tag!=null}function B5(n){return n.style!=null}let Rs=class id{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let r=this.matchedStyles=[];t.forEach(i=>{if(F5(i))this.tags.push(i);else if(B5(i)){let s=/[^=]*/.exec(i.style)[0];r.indexOf(s)<0&&r.push(s),this.styles.push(i)}}),this.normalizeLists=!this.tags.some(i=>{if(!/^(ul|ol)\b/.test(i.tag)||!i.node)return!1;let s=e.nodes[i.node];return s.contentMatch.matchType(s)})}parse(e,t={}){let r=new i0(this,t,!1);return r.addAll(e,Ae.none,t.from,t.to),r.finish()}parseSlice(e,t={}){let r=new i0(this,t,!0);return r.addAll(e,Ae.none,t.from,t.to),K.maxOpen(r.finish())}matchTag(e,t,r){for(let i=r?this.tags.indexOf(r)+1:0;i<this.tags.length;i++){let s=this.tags[i];if(W5(e,s.tag)&&(s.namespace===void 0||e.namespaceURI==s.namespace)&&(!s.context||t.matchesContext(s.context))){if(s.getAttrs){let a=s.getAttrs(e);if(a===!1)continue;s.attrs=a||void 0}return s}}}matchStyle(e,t,r,i){for(let s=i?this.styles.indexOf(i)+1:0;s<this.styles.length;s++){let a=this.styles[s],u=a.style;if(!(u.indexOf(e)!=0||a.context&&!r.matchesContext(a.context)||u.length>e.length&&(u.charCodeAt(e.length)!=61||u.slice(e.length+1)!=t))){if(a.getAttrs){let c=a.getAttrs(t);if(c===!1)continue;a.attrs=c||void 0}return a}}}static schemaRules(e){let t=[];function r(i){let s=i.priority==null?50:i.priority,a=0;for(;a<t.length;a++){let u=t[a];if((u.priority==null?50:u.priority)<s)break}t.splice(a,0,i)}for(let i in e.marks){let s=e.marks[i].spec.parseDOM;s&&s.forEach(a=>{r(a=s0(a)),a.mark||a.ignore||a.clearMark||(a.mark=i)})}for(let i in e.nodes){let s=e.nodes[i].spec.parseDOM;s&&s.forEach(a=>{r(a=s0(a)),a.node||a.ignore||a.mark||(a.node=i)})}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new id(e,id.schemaRules(e)))}};const t0={address:!0,article:!0,aside:!0,blockquote:!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},z5={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},n0={ol:!0,ul:!0},Ls=1,of=2,Ra=4;function r0(n,e,t){return e!=null?(e?Ls:0)|(e==="full"?of:0):n&&n.whitespace=="pre"?Ls|of:t&-5}class La{constructor(e,t,r,i,s,a){this.type=e,this.attrs=t,this.marks=r,this.solid=i,this.options=a,this.content=[],this.activeMarks=Ae.none,this.match=s||(a&Ra?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(V.from(e));if(t)this.match=this.type.contentMatch.matchFragment(t);else{let r=this.type.contentMatch,i;return(i=r.findWrapping(e.type))?(this.match=r,i):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&Ls)){let r=this.content[this.content.length-1],i;if(r&&r.isText&&(i=/[ \t\r\n\u000c]+$/.exec(r.text))){let s=r;r.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=s.withText(s.text.slice(0,s.text.length-i[0].length))}}let t=V.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(V.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!t0.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class i0{constructor(e,t,r){this.parser=e,this.options=t,this.isOpen=r,this.open=0,this.localPreserveWS=!1;let i=t.topNode,s,a=r0(null,t.preserveWhitespace,0)|(r?Ra:0);i?s=new La(i.type,i.attrs,Ae.none,!0,t.topMatch||i.type.contentMatch,a):r?s=new La(null,null,Ae.none,!0,null,a):s=new La(e.schema.topNodeType,null,Ae.none,!0,null,a),this.nodes=[s],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,t){e.nodeType==3?this.addTextNode(e,t):e.nodeType==1&&this.addElement(e,t)}addTextNode(e,t){let r=e.nodeValue,i=this.top,s=i.options&of?"full":this.localPreserveWS||(i.options&Ls)>0;if(s==="full"||i.inlineContext(e)||/[^ \t\r\n\u000c]/.test(r)){if(s)s!=="full"?r=r.replace(/\r?\n|\r/g," "):r=r.replace(/\r\n?/g,`
|
|
32
|
+
`);else if(r=r.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(r)&&this.open==this.nodes.length-1){let a=i.content[i.content.length-1],u=e.previousSibling;(!a||u&&u.nodeName=="BR"||a.isText&&/[ \t\r\n\u000c]$/.test(a.text))&&(r=r.slice(1))}r&&this.insertNode(this.parser.schema.text(r),t),this.findInText(e)}else this.findInside(e)}addElement(e,t,r){let i=this.localPreserveWS,s=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let a=e.nodeName.toLowerCase(),u;n0.hasOwnProperty(a)&&this.parser.normalizeLists&&H5(e);let c=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(u=this.parser.matchTag(e,this,r));e:if(c?c.ignore:z5.hasOwnProperty(a))this.findInside(e),this.ignoreFallback(e,t);else if(!c||c.skip||c.closeParent){c&&c.closeParent?this.open=Math.max(0,this.open-1):c&&c.skip.nodeType&&(e=c.skip);let h,m=this.needsBlock;if(t0.hasOwnProperty(a))s.content.length&&s.content[0].isInline&&this.open&&(this.open--,s=this.top),h=!0,s.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,t);break e}let d=c&&c.skip?t:this.readStyles(e,t);d&&this.addAll(e,d),h&&this.sync(s),this.needsBlock=m}else{let h=this.readStyles(e,t);h&&this.addElementByRule(e,c,h,c.consuming===!1?u:void 0)}this.localPreserveWS=i}leafFallback(e,t){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
|
|
33
|
+
`),t)}ignoreFallback(e,t){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),t)}readStyles(e,t){let r=e.style;if(r&&r.length)for(let i=0;i<this.parser.matchedStyles.length;i++){let s=this.parser.matchedStyles[i],a=r.getPropertyValue(s);if(a)for(let u=void 0;;){let c=this.parser.matchStyle(s,a,this,u);if(!c)break;if(c.ignore)return null;if(c.clearMark?t=t.filter(h=>!c.clearMark(h)):t=t.concat(this.parser.schema.marks[c.mark].create(c.attrs)),c.consuming===!1)u=c;else break}}return t}addElementByRule(e,t,r,i){let s,a;if(t.node)if(a=this.parser.schema.nodes[t.node],a.isLeaf)this.insertNode(a.create(t.attrs),r)||this.leafFallback(e,r);else{let c=this.enter(a,t.attrs||null,r,t.preserveWhitespace);c&&(s=!0,r=c)}else{let c=this.parser.schema.marks[t.mark];r=r.concat(c.create(t.attrs))}let u=this.top;if(a&&a.isLeaf)this.findInside(e);else if(i)this.addElement(e,r,i);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(c=>this.insertNode(c,r));else{let c=e;typeof t.contentElement=="string"?c=e.querySelector(t.contentElement):typeof t.contentElement=="function"?c=t.contentElement(e):t.contentElement&&(c=t.contentElement),this.findAround(e,c,!0),this.addAll(c,r),this.findAround(e,c,!1)}s&&this.sync(u)&&this.open--}addAll(e,t,r,i){let s=r||0;for(let a=r?e.childNodes[r]:e.firstChild,u=i==null?null:e.childNodes[i];a!=u;a=a.nextSibling,++s)this.findAtPoint(e,s),this.addDOM(a,t);this.findAtPoint(e,s)}findPlace(e,t){let r,i;for(let s=this.open;s>=0;s--){let a=this.nodes[s],u=a.findWrapping(e);if(u&&(!r||r.length>u.length)&&(r=u,i=a,!u.length)||a.solid)break}if(!r)return null;this.sync(i);for(let s=0;s<r.length;s++)t=this.enterInner(r[s],null,t,!1);return t}insertNode(e,t){if(e.isInline&&this.needsBlock&&!this.top.type){let i=this.textblockFromContext();i&&(t=this.enterInner(i,null,t))}let r=this.findPlace(e,t);if(r){this.closeExtra();let i=this.top;i.match&&(i.match=i.match.matchType(e.type));let s=Ae.none;for(let a of r.concat(e.marks))(i.type?i.type.allowsMarkType(a.type):o0(a.type,e.type))&&(s=a.addToSet(s));return i.content.push(e.mark(s)),!0}return!1}enter(e,t,r,i){let s=this.findPlace(e.create(t),r);return s&&(s=this.enterInner(e,t,r,!0,i)),s}enterInner(e,t,r,i=!1,s){this.closeExtra();let a=this.top;a.match=a.match&&a.match.matchType(e);let u=r0(e,s,a.options);a.options&Ra&&a.content.length==0&&(u|=Ra);let c=Ae.none;return r=r.filter(h=>(a.type?a.type.allowsMarkType(h.type):o0(h.type,e))?(c=h.addToSet(c),!1):!0),this.nodes.push(new La(e,t,c,i,null,u)),this.open++,r}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));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(e){for(let t=this.open;t>=0;t--){if(this.nodes[t]==e)return this.open=t,!0;this.localPreserveWS&&(this.nodes[t].options|=Ls)}return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let r=this.nodes[t].content;for(let i=r.length-1;i>=0;i--)e+=r[i].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&this.find[r].offset==t&&(this.find[r].pos=this.currentPos)}findInside(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].pos==null&&e.nodeType==1&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}findAround(e,t,r){if(e!=t&&this.find)for(let i=0;i<this.find.length;i++)this.find[i].pos==null&&e.nodeType==1&&e.contains(this.find[i].node)&&t.compareDocumentPosition(this.find[i].node)&(r?2:4)&&(this.find[i].pos=this.currentPos)}findInText(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split("/"),r=this.options.context,i=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),s=-(r?r.depth+1:0)+(i?0:1),a=(u,c)=>{for(;u>=0;u--){let h=t[u];if(h==""){if(u==t.length-1||u==0)continue;for(;c>=s;c--)if(a(u-1,c))return!0;return!1}else{let m=c>0||c==0&&i?this.nodes[c].type:r&&c>=s?r.node(c-s).type:null;if(!m||m.name!=h&&!m.isInGroup(h))return!1;c--}}return!0};return a(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let r=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let t in this.parser.schema.nodes){let r=this.parser.schema.nodes[t];if(r.isTextblock&&r.defaultAttrs)return r}}}function H5(n){for(let e=n.firstChild,t=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&n0.hasOwnProperty(r)&&t?(t.appendChild(e),e=t):r=="li"?t=e:r&&(t=null)}}function W5(n,e){return(n.matches||n.msMatchesSelector||n.webkitMatchesSelector||n.mozMatchesSelector).call(n,e)}function s0(n){let e={};for(let t in n)e[t]=n[t];return e}function o0(n,e){let t=e.schema.nodes;for(let r in t){let i=t[r];if(!i.allowsMarkType(n))continue;let s=[],a=u=>{s.push(u);for(let c=0;c<u.edgeCount;c++){let{type:h,next:m}=u.edge(c);if(h==e||s.indexOf(m)<0&&a(m))return!0}};if(a(i.contentMatch))return!0}}class io{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},r){r||(r=af(t).createDocumentFragment());let i=r,s=[];return e.forEach(a=>{if(s.length||a.marks.length){let u=0,c=0;for(;u<s.length&&c<a.marks.length;){let h=a.marks[c];if(!this.marks[h.type.name]){c++;continue}if(!h.eq(s[u][0])||h.type.spec.spanning===!1)break;u++,c++}for(;u<s.length;)i=s.pop()[1];for(;c<a.marks.length;){let h=a.marks[c++],m=this.serializeMark(h,a.isInline,t);m&&(s.push([h,i]),i.appendChild(m.dom),i=m.contentDOM||m.dom)}}i.appendChild(this.serializeNodeInner(a,t))}),r}serializeNodeInner(e,t){let{dom:r,contentDOM:i}=Pa(af(t),this.nodes[e.type.name](e),null,e.attrs);if(i){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,t,i)}return r}serializeNode(e,t={}){let r=this.serializeNodeInner(e,t);for(let i=e.marks.length-1;i>=0;i--){let s=this.serializeMark(e.marks[i],e.isInline,t);s&&((s.contentDOM||s.dom).appendChild(r),r=s.dom)}return r}serializeMark(e,t,r={}){let i=this.marks[e.type.name];return i&&Pa(af(r),i(e,t),null,e.attrs)}static renderSpec(e,t,r=null,i){return Pa(e,t,r,i)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new io(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=a0(e.nodes);return t.text||(t.text=r=>r.text),t}static marksFromSchema(e){return a0(e.marks)}}function a0(n){let e={};for(let t in n){let r=n[t].spec.toDOM;r&&(e[t]=r)}return e}function af(n){return n.document||window.document}const l0=new WeakMap;function V5(n){let e=l0.get(n);return e===void 0&&l0.set(n,e=U5(n)),e}function U5(n){let e=null;function t(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")e||(e=[]),e.push(r);else for(let i=0;i<r.length;i++)t(r[i]);else for(let i in r)t(r[i])}return t(n),e}function Pa(n,e,t,r){if(typeof e=="string")return{dom:n.createTextNode(e)};if(e.nodeType!=null)return{dom:e};if(e.dom&&e.dom.nodeType!=null)return e;let i=e[0],s;if(typeof i!="string")throw new RangeError("Invalid array passed to renderSpec");if(r&&(s=V5(r))&&s.indexOf(e)>-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 a=i.indexOf(" ");a>0&&(t=i.slice(0,a),i=i.slice(a+1));let u,c=t?n.createElementNS(t,i):n.createElement(i),h=e[1],m=1;if(h&&typeof h=="object"&&h.nodeType==null&&!Array.isArray(h)){m=2;for(let d in h)if(h[d]!=null){let y=d.indexOf(" ");y>0?c.setAttributeNS(d.slice(0,y),d.slice(y+1),h[d]):c.setAttribute(d,h[d])}}for(let d=m;d<e.length;d++){let y=e[d];if(y===0){if(d<e.length-1||d>m)throw new RangeError("Content hole must be the only child of its parent node");return{dom:c,contentDOM:c}}else{let{dom:_,contentDOM:v}=Pa(n,y,t,r);if(c.appendChild(_),v){if(u)throw new RangeError("Multiple content holes");u=v}}}return{dom:c,contentDOM:u}}const u0=65535,c0=Math.pow(2,16);function q5(n,e){return n+e*c0}function f0(n){return n&u0}function K5(n){return(n-(n&u0))/c0}const h0=1,d0=2,Da=4,p0=8;class lf{constructor(e,t,r){this.pos=e,this.delInfo=t,this.recover=r}get deleted(){return(this.delInfo&p0)>0}get deletedBefore(){return(this.delInfo&(h0|Da))>0}get deletedAfter(){return(this.delInfo&(d0|Da))>0}get deletedAcross(){return(this.delInfo&Da)>0}}class Pt{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&Pt.empty)return Pt.empty}recover(e){let t=0,r=f0(e);if(!this.inverted)for(let i=0;i<r;i++)t+=this.ranges[i*3+2]-this.ranges[i*3+1];return this.ranges[r*3]+t+K5(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,r){let i=0,s=this.inverted?2:1,a=this.inverted?1:2;for(let u=0;u<this.ranges.length;u+=3){let c=this.ranges[u]-(this.inverted?i:0);if(c>e)break;let h=this.ranges[u+s],m=this.ranges[u+a],d=c+h;if(e<=d){let y=h?e==c?-1:e==d?1:t:t,_=c+i+(y<0?0:m);if(r)return _;let v=e==(t<0?c:d)?null:q5(u/3,e-c),E=e==c?d0:e==d?h0:Da;return(t<0?e!=c:e!=d)&&(E|=p0),new lf(_,E,v)}i+=m-h}return r?e+i:new lf(e+i,0,null)}touches(e,t){let r=0,i=f0(t),s=this.inverted?2:1,a=this.inverted?1:2;for(let u=0;u<this.ranges.length;u+=3){let c=this.ranges[u]-(this.inverted?r:0);if(c>e)break;let h=this.ranges[u+s],m=c+h;if(e<=m&&u==i*3)return!0;r+=this.ranges[u+a]-h}return!1}forEach(e){let t=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,s=0;i<this.ranges.length;i+=3){let a=this.ranges[i],u=a-(this.inverted?s:0),c=a+(this.inverted?0:s),h=this.ranges[i+t],m=this.ranges[i+r];e(u,u+h,c,c+m),s+=m-h}}invert(){return new Pt(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?Pt.empty:new Pt(e<0?[0,-e,0]:[0,0,e])}}Pt.empty=new Pt([]);class Xi{constructor(e=[],t,r=0,i=e.length){this.maps=e,this.mirror=t,this.from=r,this.to=i}slice(e=0,t=this.maps.length){return new Xi(this.maps,this.mirror,e,t)}copy(){return new Xi(this.maps.slice(),this.mirror&&this.mirror.slice(),this.from,this.to)}appendMap(e,t){this.to=this.maps.push(e),t!=null&&this.setMirror(this.maps.length-1,t)}appendMapping(e){for(let t=0,r=this.maps.length;t<e.maps.length;t++){let i=e.getMirror(t);this.appendMap(e.maps[t],i!=null&&i<t?r+i:void 0)}}getMirror(e){if(this.mirror){for(let t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]}}setMirror(e,t){this.mirror||(this.mirror=[]),this.mirror.push(e,t)}appendMappingInverted(e){for(let t=e.maps.length-1,r=this.maps.length+e.maps.length;t>=0;t--){let i=e.getMirror(t);this.appendMap(e.maps[t].invert(),i!=null&&i>t?r-i-1:void 0)}}invert(){let e=new Xi;return e.appendMappingInverted(this),e}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let r=this.from;r<this.to;r++)e=this.maps[r].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,r){let i=0;for(let s=this.from;s<this.to;s++){let a=this.maps[s],u=a.mapResult(e,t);if(u.recover!=null){let c=this.getMirror(s);if(c!=null&&c>s&&c<this.to){s=c,e=this.maps[c].recover(u.recover);continue}}i|=u.delInfo,e=u.pos}return r?e:new lf(e,i,null)}}const uf=Object.create(null);class Ue{getMap(){return Pt.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=uf[t.stepType];if(!r)throw new RangeError(`No step type ${t.stepType} defined`);return r.fromJSON(e,t)}static jsonID(e,t){if(e in uf)throw new RangeError("Duplicate use of step JSON ID "+e);return uf[e]=t,t.prototype.jsonID=e,t}}class De{constructor(e,t){this.doc=e,this.failed=t}static ok(e){return new De(e,null)}static fail(e){return new De(null,e)}static fromReplace(e,t,r,i){try{return De.ok(e.replace(t,r,i))}catch(s){if(s instanceof Ma)return De.fail(s.message);throw s}}}function cf(n,e,t){let r=[];for(let i=0;i<n.childCount;i++){let s=n.child(i);s.content.size&&(s=s.copy(cf(s.content,e,s))),s.isInline&&(s=e(s,t,i)),r.push(s)}return V.fromArray(r)}class Ir extends Ue{constructor(e,t,r){super(),this.from=e,this.to=t,this.mark=r}apply(e){let t=e.slice(this.from,this.to),r=e.resolve(this.from),i=r.node(r.sharedDepth(this.to)),s=new K(cf(t.content,(a,u)=>!a.isAtom||!u.type.allowsMarkType(this.mark.type)?a:a.mark(this.mark.addToSet(a.marks)),i),t.openStart,t.openEnd);return De.fromReplace(e,this.from,this.to,s)}invert(){return new xn(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new Ir(t.pos,r.pos,this.mark)}merge(e){return e instanceof Ir&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Ir(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new Ir(t.from,t.to,e.markFromJSON(t.mark))}}Ue.jsonID("addMark",Ir);class xn extends Ue{constructor(e,t,r){super(),this.from=e,this.to=t,this.mark=r}apply(e){let t=e.slice(this.from,this.to),r=new K(cf(t.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),t.openStart,t.openEnd);return De.fromReplace(e,this.from,this.to,r)}invert(){return new Ir(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new xn(t.pos,r.pos,this.mark)}merge(e){return e instanceof xn&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new xn(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new xn(t.from,t.to,e.markFromJSON(t.mark))}}Ue.jsonID("removeMark",xn);class Nr extends Ue{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return De.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return De.fromReplace(e,this.pos,this.pos+1,new K(V.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);if(t){let r=this.mark.addToSet(t.marks);if(r.length==t.marks.length){for(let i=0;i<t.marks.length;i++)if(!t.marks[i].isInSet(r))return new Nr(this.pos,t.marks[i]);return new Nr(this.pos,this.mark)}}return new Zi(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new Nr(t.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new Nr(t.pos,e.markFromJSON(t.mark))}}Ue.jsonID("addNodeMark",Nr);class Zi extends Ue{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return De.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return De.fromReplace(e,this.pos,this.pos+1,new K(V.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);return!t||!this.mark.isInSet(t.marks)?this:new Nr(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new Zi(t.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new Zi(t.pos,e.markFromJSON(t.mark))}}Ue.jsonID("removeNodeMark",Zi);class je extends Ue{constructor(e,t,r,i=!1){super(),this.from=e,this.to=t,this.slice=r,this.structure=i}apply(e){return this.structure&&ff(e,this.from,this.to)?De.fail("Structure replace would overwrite content"):De.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new Pt([this.from,this.to-this.from,this.slice.size])}invert(e){return new je(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deletedAcross&&r.deletedAcross?null:new je(t.pos,Math.max(t.pos,r.pos),this.slice)}merge(e){if(!(e instanceof je)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let t=this.slice.size+e.slice.size==0?K.empty:new K(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new je(this.from,this.to+(e.to-e.from),t,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let t=this.slice.size+e.slice.size==0?K.empty:new K(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new je(e.from,this.to,t,this.structure)}else return null}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new je(t.from,t.to,K.fromJSON(e,t.slice),!!t.structure)}}Ue.jsonID("replace",je);class Je extends Ue{constructor(e,t,r,i,s,a,u=!1){super(),this.from=e,this.to=t,this.gapFrom=r,this.gapTo=i,this.slice=s,this.insert=a,this.structure=u}apply(e){if(this.structure&&(ff(e,this.from,this.gapFrom)||ff(e,this.gapTo,this.to)))return De.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return De.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,t.content);return r?De.fromReplace(e,this.from,this.to,r):De.fail("Content does not fit in gap")}getMap(){return new Pt([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let t=this.gapTo-this.gapFrom;return new Je(this.from,this.from+this.slice.size+t,this.from+this.insert,this.from+this.insert+t,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),i=this.from==this.gapFrom?t.pos:e.map(this.gapFrom,-1),s=this.to==this.gapTo?r.pos:e.map(this.gapTo,1);return t.deletedAcross&&r.deletedAcross||i<t.pos||s>r.pos?null:new Je(t.pos,r.pos,i,s,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number"||typeof t.gapFrom!="number"||typeof t.gapTo!="number"||typeof t.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new Je(t.from,t.to,t.gapFrom,t.gapTo,K.fromJSON(e,t.slice),t.insert,!!t.structure)}}Ue.jsonID("replaceAround",Je);function ff(n,e,t){let r=n.resolve(e),i=t-e,s=r.depth;for(;i>0&&s>0&&r.indexAfter(s)==r.node(s).childCount;)s--,i--;if(i>0){let a=r.node(s).maybeChild(r.indexAfter(s));for(;i>0;){if(!a||a.isLeaf)return!0;a=a.firstChild,i--}}return!1}function G5(n,e,t,r){let i=[],s=[],a,u;n.doc.nodesBetween(e,t,(c,h,m)=>{if(!c.isInline)return;let d=c.marks;if(!r.isInSet(d)&&m.type.allowsMarkType(r.type)){let y=Math.max(h,e),_=Math.min(h+c.nodeSize,t),v=r.addToSet(d);for(let E=0;E<d.length;E++)d[E].isInSet(v)||(a&&a.to==y&&a.mark.eq(d[E])?a.to=_:i.push(a=new xn(y,_,d[E])));u&&u.to==y?u.to=_:s.push(u=new Ir(y,_,r))}}),i.forEach(c=>n.step(c)),s.forEach(c=>n.step(c))}function J5(n,e,t,r){let i=[],s=0;n.doc.nodesBetween(e,t,(a,u)=>{if(!a.isInline)return;s++;let c=null;if(r instanceof iu){let h=a.marks,m;for(;m=r.isInSet(h);)(c||(c=[])).push(m),h=m.removeFromSet(h)}else r?r.isInSet(a.marks)&&(c=[r]):c=a.marks;if(c&&c.length){let h=Math.min(u+a.nodeSize,t);for(let m=0;m<c.length;m++){let d=c[m],y;for(let _=0;_<i.length;_++){let v=i[_];v.step==s-1&&d.eq(i[_].style)&&(y=v)}y?(y.to=h,y.step=s):i.push({style:d,from:Math.max(u,e),to:h,step:s})}}}),i.forEach(a=>n.step(new xn(a.from,a.to,a.style)))}function hf(n,e,t,r=t.contentMatch,i=!0){let s=n.doc.nodeAt(e),a=[],u=e+1;for(let c=0;c<s.childCount;c++){let h=s.child(c),m=u+h.nodeSize,d=r.matchType(h.type);if(!d)a.push(new je(u,m,K.empty));else{r=d;for(let y=0;y<h.marks.length;y++)t.allowsMarkType(h.marks[y].type)||n.step(new xn(u,m,h.marks[y]));if(i&&h.isText&&t.whitespace!="pre"){let y,_=/\r?\n|\r/g,v;for(;y=_.exec(h.text);)v||(v=new K(V.from(t.schema.text(" ",t.allowedMarks(h.marks))),0,0)),a.push(new je(u+y.index,u+y.index+y[0].length,v))}}u=m}if(!r.validEnd){let c=r.fillBefore(V.empty,!0);n.replace(u,u,new K(c,0,0))}for(let c=a.length-1;c>=0;c--)n.step(a[c])}function j5(n,e,t){return(e==0||n.canReplace(e,n.childCount))&&(t==n.childCount||n.canReplace(0,t))}function Ni(n){let t=n.parent.content.cutByIndex(n.startIndex,n.endIndex);for(let r=n.depth;;--r){let i=n.$from.node(r),s=n.$from.index(r),a=n.$to.indexAfter(r);if(r<n.depth&&i.canReplace(s,a,t))return r;if(r==0||i.type.spec.isolating||!j5(i,s,a))break}return null}function Y5(n,e,t){let{$from:r,$to:i,depth:s}=e,a=r.before(s+1),u=i.after(s+1),c=a,h=u,m=V.empty,d=0;for(let v=s,E=!1;v>t;v--)E||r.index(v)>0?(E=!0,m=V.from(r.node(v).copy(m)),d++):c--;let y=V.empty,_=0;for(let v=s,E=!1;v>t;v--)E||i.after(v+1)<i.end(v)?(E=!0,y=V.from(i.node(v).copy(y)),_++):h++;n.step(new Je(c,h,a,u,new K(m.append(y),d,_),m.size-d,!0))}function df(n,e,t=null,r=n){let i=X5(n,e),s=i&&Z5(r,e);return s?i.map(m0).concat({type:e,attrs:t}).concat(s.map(m0)):null}function m0(n){return{type:n,attrs:null}}function X5(n,e){let{parent:t,startIndex:r,endIndex:i}=n,s=t.contentMatchAt(r).findWrapping(e);if(!s)return null;let a=s.length?s[0]:e;return t.canReplaceWith(r,i,a)?s:null}function Z5(n,e){let{parent:t,startIndex:r,endIndex:i}=n,s=t.child(r),a=e.contentMatch.findWrapping(s.type);if(!a)return null;let c=(a.length?a[a.length-1]:e).contentMatch;for(let h=r;c&&h<i;h++)c=c.matchType(t.child(h).type);return!c||!c.validEnd?null:a}function Q5(n,e,t){let r=V.empty;for(let a=t.length-1;a>=0;a--){if(r.size){let u=t[a].type.contentMatch.matchFragment(r);if(!u||!u.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=V.from(t[a].type.create(t[a].attrs,r))}let i=e.start,s=e.end;n.step(new Je(i,s,i,s,new K(r,0,0),t.length,!0))}function eT(n,e,t,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let s=n.steps.length;n.doc.nodesBetween(e,t,(a,u)=>{let c=typeof i=="function"?i(a):i;if(a.isTextblock&&!a.hasMarkup(r,c)&&tT(n.doc,n.mapping.slice(s).map(u),r)){let h=null;if(r.schema.linebreakReplacement){let _=r.whitespace=="pre",v=!!r.contentMatch.matchType(r.schema.linebreakReplacement);_&&!v?h=!1:!_&&v&&(h=!0)}h===!1&&y0(n,a,u,s),hf(n,n.mapping.slice(s).map(u,1),r,void 0,h===null);let m=n.mapping.slice(s),d=m.map(u,1),y=m.map(u+a.nodeSize,1);return n.step(new Je(d,y,d+1,y-1,new K(V.from(r.create(c,null,a.marks)),0,0),1,!0)),h===!0&&g0(n,a,u,s),!1}})}function g0(n,e,t,r){e.forEach((i,s)=>{if(i.isText){let a,u=/\r?\n|\r/g;for(;a=u.exec(i.text);){let c=n.mapping.slice(r).map(t+1+s+a.index);n.replaceWith(c,c+1,e.type.schema.linebreakReplacement.create())}}})}function y0(n,e,t,r){e.forEach((i,s)=>{if(i.type==i.type.schema.linebreakReplacement){let a=n.mapping.slice(r).map(t+1+s);n.replaceWith(a,a+1,e.type.schema.text(`
|
|
34
|
+
`))}})}function tT(n,e,t){let r=n.resolve(e),i=r.index();return r.parent.canReplaceWith(i,i+1,t)}function nT(n,e,t,r,i){let s=n.doc.nodeAt(e);if(!s)throw new RangeError("No node at given position");t||(t=s.type);let a=t.create(r,null,i||s.marks);if(s.isLeaf)return n.replaceWith(e,e+s.nodeSize,a);if(!t.validContent(s.content))throw new RangeError("Invalid content for node type "+t.name);n.step(new Je(e,e+s.nodeSize,e+1,e+s.nodeSize-1,new K(V.from(a),0,0),1,!0))}function Wn(n,e,t=1,r){let i=n.resolve(e),s=i.depth-t,a=r&&r[r.length-1]||i.parent;if(s<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!a.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let h=i.depth-1,m=t-2;h>s;h--,m--){let d=i.node(h),y=i.index(h);if(d.type.spec.isolating)return!1;let _=d.content.cutByIndex(y,d.childCount),v=r&&r[m+1];v&&(_=_.replaceChild(0,v.type.create(v.attrs)));let E=r&&r[m]||d;if(!d.canReplace(y+1,d.childCount)||!E.type.validContent(_))return!1}let u=i.indexAfter(s),c=r&&r[0];return i.node(s).canReplaceWith(u,u,c?c.type:i.node(s+1).type)}function rT(n,e,t=1,r){let i=n.doc.resolve(e),s=V.empty,a=V.empty;for(let u=i.depth,c=i.depth-t,h=t-1;u>c;u--,h--){s=V.from(i.node(u).copy(s));let m=r&&r[h];a=V.from(m?m.type.create(m.attrs,a):i.node(u).copy(a))}n.step(new je(e,e,new K(s.append(a),t,t),!0))}function gr(n,e){let t=n.resolve(e),r=t.index();return b0(t.nodeBefore,t.nodeAfter)&&t.parent.canReplace(r,r+1)}function iT(n,e){e.content.size||n.type.compatibleContent(e.type);let t=n.contentMatchAt(n.childCount),{linebreakReplacement:r}=n.type.schema;for(let i=0;i<e.childCount;i++){let s=e.child(i),a=s.type==r?n.type.schema.nodes.text:s.type;if(t=t.matchType(a),!t||!n.type.allowsMarks(s.marks))return!1}return t.validEnd}function b0(n,e){return!!(n&&e&&!n.isLeaf&&iT(n,e))}function $a(n,e,t=-1){let r=n.resolve(e);for(let i=r.depth;;i--){let s,a,u=r.index(i);if(i==r.depth?(s=r.nodeBefore,a=r.nodeAfter):t>0?(s=r.node(i+1),u++,a=r.node(i).maybeChild(u)):(s=r.node(i).maybeChild(u-1),a=r.node(i+1)),s&&!s.isTextblock&&b0(s,a)&&r.node(i).canReplace(u,u+1))return e;if(i==0)break;e=t<0?r.before(i):r.after(i)}}function sT(n,e,t){let r=null,{linebreakReplacement:i}=n.doc.type.schema,s=n.doc.resolve(e-t),a=s.node().type;if(i&&a.inlineContent){let m=a.whitespace=="pre",d=!!a.contentMatch.matchType(i);m&&!d?r=!1:!m&&d&&(r=!0)}let u=n.steps.length;if(r===!1){let m=n.doc.resolve(e+t);y0(n,m.node(),m.before(),u)}a.inlineContent&&hf(n,e+t-1,a,s.node().contentMatchAt(s.index()),r==null);let c=n.mapping.slice(u),h=c.map(e-t);if(n.step(new je(h,c.map(e+t,-1),K.empty,!0)),r===!0){let m=n.doc.resolve(h);g0(n,m.node(),m.before(),n.steps.length)}return n}function oT(n,e,t){let r=n.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),t))return e;if(r.parentOffset==0)for(let i=r.depth-1;i>=0;i--){let s=r.index(i);if(r.node(i).canReplaceWith(s,s,t))return r.before(i+1);if(s>0)return null}if(r.parentOffset==r.parent.content.size)for(let i=r.depth-1;i>=0;i--){let s=r.indexAfter(i);if(r.node(i).canReplaceWith(s,s,t))return r.after(i+1);if(s<r.node(i).childCount)return null}return null}function aT(n,e,t){let r=n.resolve(e);if(!t.content.size)return e;let i=t.content;for(let s=0;s<t.openStart;s++)i=i.firstChild.content;for(let s=1;s<=(t.openStart==0&&t.size?2:1);s++)for(let a=r.depth;a>=0;a--){let u=a==r.depth?0:r.pos<=(r.start(a+1)+r.end(a+1))/2?-1:1,c=r.index(a)+(u>0?1:0),h=r.node(a),m=!1;if(s==1)m=h.canReplace(c,c,i);else{let d=h.contentMatchAt(c).findWrapping(i.firstChild.type);m=d&&h.canReplaceWith(c,c,d[0])}if(m)return u==0?r.pos:u<0?r.before(a+1):r.after(a+1)}return null}function Fa(n,e,t=e,r=K.empty){if(e==t&&!r.size)return null;let i=n.resolve(e),s=n.resolve(t);return _0(i,s,r)?new je(e,t,r):new lT(i,s,r).fit()}function _0(n,e,t){return!t.openStart&&!t.openEnd&&n.start()==e.start()&&n.parent.canReplace(n.index(),e.index(),t.content)}class lT{constructor(e,t,r){this.$from=e,this.$to=t,this.unplaced=r,this.frontier=[],this.placed=V.empty;for(let i=0;i<=e.depth;i++){let s=e.node(i);this.frontier.push({type:s.type,match:s.contentMatchAt(e.indexAfter(i))})}for(let i=e.depth;i>0;i--)this.placed=V.from(e.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let h=this.findFittable();h?this.placeNodes(h):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),t=this.placed.size-this.depth-this.$from.depth,r=this.$from,i=this.close(e<0?this.$to:r.doc.resolve(e));if(!i)return null;let s=this.placed,a=r.depth,u=i.depth;for(;a&&u&&s.childCount==1;)s=s.firstChild.content,a--,u--;let c=new K(s,a,u);return e>-1?new Je(r.pos,e,this.$to.pos,this.$to.end(),c,t):c.size||r.pos!=this.$to.pos?new je(r.pos,i.pos,c):null}findFittable(){let e=this.unplaced.openStart;for(let t=this.unplaced.content,r=0,i=this.unplaced.openEnd;r<e;r++){let s=t.firstChild;if(t.childCount>1&&(i=0),s.type.spec.isolating&&i<=r){e=r;break}t=s.content}for(let t=1;t<=2;t++)for(let r=t==1?e:this.unplaced.openStart;r>=0;r--){let i,s=null;r?(s=pf(this.unplaced.content,r-1).firstChild,i=s.content):i=this.unplaced.content;let a=i.firstChild;for(let u=this.depth;u>=0;u--){let{type:c,match:h}=this.frontier[u],m,d=null;if(t==1&&(a?h.matchType(a.type)||(d=h.fillBefore(V.from(a),!1)):s&&c.compatibleContent(s.type)))return{sliceDepth:r,frontierDepth:u,parent:s,inject:d};if(t==2&&a&&(m=h.findWrapping(a.type)))return{sliceDepth:r,frontierDepth:u,parent:s,wrap:m};if(s&&h.matchType(s.type))break}}}openMore(){let{content:e,openStart:t,openEnd:r}=this.unplaced,i=pf(e,t);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new K(e,t+1,Math.max(r,i.size+t>=e.size-r?t+1:0)),!0)}dropNode(){let{content:e,openStart:t,openEnd:r}=this.unplaced,i=pf(e,t);if(i.childCount<=1&&t>0){let s=e.size-t<=t+i.size;this.unplaced=new K(Ps(e,t-1,1),t-1,s?t-1:r)}else this.unplaced=new K(Ps(e,t,1),t,r)}placeNodes({sliceDepth:e,frontierDepth:t,parent:r,inject:i,wrap:s}){for(;this.depth>t;)this.closeFrontierNode();if(s)for(let E=0;E<s.length;E++)this.openFrontierNode(s[E]);let a=this.unplaced,u=r?r.content:a.content,c=a.openStart-e,h=0,m=[],{match:d,type:y}=this.frontier[t];if(i){for(let E=0;E<i.childCount;E++)m.push(i.child(E));d=d.matchFragment(i)}let _=u.size+e-(a.content.size-a.openEnd);for(;h<u.childCount;){let E=u.child(h),N=d.matchType(E.type);if(!N)break;h++,(h>1||c==0||E.content.size)&&(d=N,m.push(w0(E.mark(y.allowedMarks(E.marks)),h==1?c:0,h==u.childCount?_:-1)))}let v=h==u.childCount;v||(_=-1),this.placed=Ds(this.placed,t,V.from(m)),this.frontier[t].match=d,v&&_<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let E=0,N=u;E<_;E++){let g=N.lastChild;this.frontier.push({type:g.type,match:g.contentMatchAt(g.childCount)}),N=g.content}this.unplaced=v?e==0?K.empty:new K(Ps(a.content,e-1,1),e-1,_<0?a.openEnd:e-1):new K(Ps(a.content,e,h),a.openStart,a.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],t;if(!e.type.isTextblock||!mf(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(t=this.findCloseLevel(this.$to))&&t.depth==this.depth)return-1;let{depth:r}=this.$to,i=this.$to.after(r);for(;r>1&&i==this.$to.end(--r);)++i;return i}findCloseLevel(e){e:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:r,type:i}=this.frontier[t],s=t<e.depth&&e.end(t+1)==e.pos+(e.depth-(t+1)),a=mf(e,t,i,r,s);if(a){for(let u=t-1;u>=0;u--){let{match:c,type:h}=this.frontier[u],m=mf(e,u,h,c,!0);if(!m||m.childCount)continue e}return{depth:t,fit:a,move:s?e.doc.resolve(e.after(t+1)):e}}}}close(e){let t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=Ds(this.placed,t.depth,t.fit)),e=t.move;for(let r=t.depth+1;r<=e.depth;r++){let i=e.node(r),s=i.type.contentMatch.fillBefore(i.content,!0,e.index(r));this.openFrontierNode(i.type,i.attrs,s)}return e}openFrontierNode(e,t=null,r){let i=this.frontier[this.depth];i.match=i.match.matchType(e),this.placed=Ds(this.placed,this.depth,V.from(e.create(t,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let t=this.frontier.pop().match.fillBefore(V.empty,!0);t.childCount&&(this.placed=Ds(this.placed,this.frontier.length,t))}}function Ps(n,e,t){return e==0?n.cutByIndex(t,n.childCount):n.replaceChild(0,n.firstChild.copy(Ps(n.firstChild.content,e-1,t)))}function Ds(n,e,t){return e==0?n.append(t):n.replaceChild(n.childCount-1,n.lastChild.copy(Ds(n.lastChild.content,e-1,t)))}function pf(n,e){for(let t=0;t<e;t++)n=n.firstChild.content;return n}function w0(n,e,t){if(e<=0)return n;let r=n.content;return e>1&&(r=r.replaceChild(0,w0(r.firstChild,e-1,r.childCount==1?t-1:0))),e>0&&(r=n.type.contentMatch.fillBefore(r).append(r),t<=0&&(r=r.append(n.type.contentMatch.matchFragment(r).fillBefore(V.empty,!0)))),n.copy(r)}function mf(n,e,t,r,i){let s=n.node(e),a=i?n.indexAfter(e):n.index(e);if(a==s.childCount&&!t.compatibleContent(s.type))return null;let u=r.fillBefore(s.content,!0,a);return u&&!uT(t,s.content,a)?u:null}function uT(n,e,t){for(let r=t;r<e.childCount;r++)if(!n.allowsMarks(e.child(r).marks))return!0;return!1}function cT(n){return n.spec.defining||n.spec.definingForContent}function fT(n,e,t,r){if(!r.size)return n.deleteRange(e,t);let i=n.doc.resolve(e),s=n.doc.resolve(t);if(_0(i,s,r))return n.step(new je(e,t,r));let a=S0(i,n.doc.resolve(t));a[a.length-1]==0&&a.pop();let u=-(i.depth+1);a.unshift(u);for(let y=i.depth,_=i.pos-1;y>0;y--,_--){let v=i.node(y).type.spec;if(v.defining||v.definingAsContext||v.isolating)break;a.indexOf(y)>-1?u=y:i.before(y)==_&&a.splice(1,0,-y)}let c=a.indexOf(u),h=[],m=r.openStart;for(let y=r.content,_=0;;_++){let v=y.firstChild;if(h.push(v),_==r.openStart)break;y=v.content}for(let y=m-1;y>=0;y--){let _=h[y],v=cT(_.type);if(v&&!_.sameMarkup(i.node(Math.abs(u)-1)))m=y;else if(v||!_.type.isTextblock)break}for(let y=r.openStart;y>=0;y--){let _=(y+m+1)%(r.openStart+1),v=h[_];if(v)for(let E=0;E<a.length;E++){let N=a[(E+c)%a.length],g=!0;N<0&&(g=!1,N=-N);let S=i.node(N-1),k=i.index(N-1);if(S.canReplaceWith(k,k,v.type,v.marks))return n.replace(i.before(N),g?s.after(N):t,new K(v0(r.content,0,r.openStart,_),_,r.openEnd))}}let d=n.steps.length;for(let y=a.length-1;y>=0&&(n.replace(e,t,r),!(n.steps.length>d));y--){let _=a[y];_<0||(e=i.before(_),t=s.after(_))}}function v0(n,e,t,r,i){if(e<t){let s=n.firstChild;n=n.replaceChild(0,s.copy(v0(s.content,e+1,t,r,s)))}if(e>r){let s=i.contentMatchAt(0),a=s.fillBefore(n).append(n);n=a.append(s.matchFragment(a).fillBefore(V.empty,!0))}return n}function hT(n,e,t,r){if(!r.isInline&&e==t&&n.doc.resolve(e).parent.content.size){let i=oT(n.doc,e,r.type);i!=null&&(e=t=i)}n.replaceRange(e,t,new K(V.from(r),0,0))}function dT(n,e,t){let r=n.doc.resolve(e),i=n.doc.resolve(t),s=S0(r,i);for(let a=0;a<s.length;a++){let u=s[a],c=a==s.length-1;if(c&&u==0||r.node(u).type.contentMatch.validEnd)return n.delete(r.start(u),i.end(u));if(u>0&&(c||r.node(u-1).canReplace(r.index(u-1),i.indexAfter(u-1))))return n.delete(r.before(u),i.after(u))}for(let a=1;a<=r.depth&&a<=i.depth;a++)if(e-r.start(a)==r.depth-a&&t>r.end(a)&&i.end(a)-t!=i.depth-a&&r.start(a-1)==i.start(a-1)&&r.node(a-1).canReplace(r.index(a-1),i.index(a-1)))return n.delete(r.before(a),t);n.delete(e,t)}function S0(n,e){let t=[],r=Math.min(n.depth,e.depth);for(let i=r;i>=0;i--){let s=n.start(i);if(s<n.pos-(n.depth-i)||e.end(i)>e.pos+(e.depth-i)||n.node(i).type.spec.isolating||e.node(i).type.spec.isolating)break;(s==e.start(i)||i==n.depth&&i==e.depth&&n.parent.inlineContent&&e.parent.inlineContent&&i&&e.start(i-1)==s-1)&&t.push(i)}return t}class Qi extends Ue{constructor(e,t,r){super(),this.pos=e,this.attr=t,this.value=r}apply(e){let t=e.nodeAt(this.pos);if(!t)return De.fail("No node at attribute step's position");let r=Object.create(null);for(let s in t.attrs)r[s]=t.attrs[s];r[this.attr]=this.value;let i=t.type.create(r,null,t.marks);return De.fromReplace(e,this.pos,this.pos+1,new K(V.from(i),0,t.isLeaf?0:1))}getMap(){return Pt.empty}invert(e){return new Qi(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new Qi(t.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,t){if(typeof t.pos!="number"||typeof t.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new Qi(t.pos,t.attr,t.value)}}Ue.jsonID("attr",Qi);class oo extends Ue{constructor(e,t){super(),this.attr=e,this.value=t}apply(e){let t=Object.create(null);for(let i in e.attrs)t[i]=e.attrs[i];t[this.attr]=this.value;let r=e.type.create(t,e.content,e.marks);return De.ok(r)}getMap(){return Pt.empty}invert(e){return new oo(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,t){if(typeof t.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new oo(t.attr,t.value)}}Ue.jsonID("docAttr",oo);let Ri=class extends Error{};Ri=function n(e){let t=Error.call(this,e);return t.__proto__=n.prototype,t},Ri.prototype=Object.create(Error.prototype),Ri.prototype.constructor=Ri,Ri.prototype.name="TransformError";class pT{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new Xi}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new Ri(t.failed);return this}maybeStep(e){let t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t}get docChanged(){return this.steps.length>0}addStep(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t}replace(e,t=e,r=K.empty){let i=Fa(this.doc,e,t,r);return i&&this.step(i),this}replaceWith(e,t,r){return this.replace(e,t,new K(V.from(r),0,0))}delete(e,t){return this.replace(e,t,K.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,r){return fT(this,e,t,r),this}replaceRangeWith(e,t,r){return hT(this,e,t,r),this}deleteRange(e,t){return dT(this,e,t),this}lift(e,t){return Y5(this,e,t),this}join(e,t=1){return sT(this,e,t),this}wrap(e,t){return Q5(this,e,t),this}setBlockType(e,t=e,r,i=null){return eT(this,e,t,r,i),this}setNodeMarkup(e,t,r=null,i){return nT(this,e,t,r,i),this}setNodeAttribute(e,t,r){return this.step(new Qi(e,t,r)),this}setDocAttribute(e,t){return this.step(new oo(e,t)),this}addNodeMark(e,t){return this.step(new Nr(e,t)),this}removeNodeMark(e,t){if(!(t instanceof Ae)){let r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at position "+e);if(t=t.isInSet(r.marks),!t)return this}return this.step(new Zi(e,t)),this}split(e,t=1,r){return rT(this,e,t,r),this}addMark(e,t,r){return G5(this,e,t,r),this}removeMark(e,t,r){return J5(this,e,t,r),this}clearIncompatible(e,t,r){return hf(this,e,t,r),this}}const gf=Object.create(null);class ye{constructor(e,t,r){this.$anchor=e,this.$head=t,this.ranges=r||[new mT(e.min(t),e.max(t))]}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 e=this.ranges;for(let t=0;t<e.length;t++)if(e[t].$from.pos!=e[t].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,t=K.empty){let r=t.content.lastChild,i=null;for(let u=0;u<t.openEnd;u++)i=r,r=r.lastChild;let s=e.steps.length,a=this.ranges;for(let u=0;u<a.length;u++){let{$from:c,$to:h}=a[u],m=e.mapping.slice(s);e.replaceRange(m.map(c.pos),m.map(h.pos),u?K.empty:t),u==0&&C0(e,s,(r?r.isInline:i&&i.isTextblock)?-1:1)}}replaceWith(e,t){let r=e.steps.length,i=this.ranges;for(let s=0;s<i.length;s++){let{$from:a,$to:u}=i[s],c=e.mapping.slice(r),h=c.map(a.pos),m=c.map(u.pos);s?e.deleteRange(h,m):(e.replaceRangeWith(h,m,t),C0(e,r,t.isInline?-1:1))}}static findFrom(e,t,r=!1){let i=e.parent.inlineContent?new pe(e):Li(e.node(0),e.parent,e.pos,e.index(),t,r);if(i)return i;for(let s=e.depth-1;s>=0;s--){let a=t<0?Li(e.node(0),e.node(s),e.before(s+1),e.index(s),t,r):Li(e.node(0),e.node(s),e.after(s+1),e.index(s)+1,t,r);if(a)return a}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new Lt(e.node(0))}static atStart(e){return Li(e,e,0,0,1)||new Lt(e)}static atEnd(e){return Li(e,e,e.content.size,e.childCount,-1)||new Lt(e)}static fromJSON(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=gf[t.type];if(!r)throw new RangeError(`No selection type ${t.type} defined`);return r.fromJSON(e,t)}static jsonID(e,t){if(e in gf)throw new RangeError("Duplicate use of selection JSON ID "+e);return gf[e]=t,t.prototype.jsonID=e,t}getBookmark(){return pe.between(this.$anchor,this.$head).getBookmark()}}ye.prototype.visible=!0;class mT{constructor(e,t){this.$from=e,this.$to=t}}let x0=!1;function E0(n){!x0&&!n.parent.inlineContent&&(x0=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+n.parent.type.name+")"))}class pe extends ye{constructor(e,t=e){E0(e),E0(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,t){let r=e.resolve(t.map(this.head));if(!r.parent.inlineContent)return ye.near(r);let i=e.resolve(t.map(this.anchor));return new pe(i.parent.inlineContent?i:r,r)}replace(e,t=K.empty){if(super.replace(e,t),t==K.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof pe&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new su(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,t){if(typeof t.anchor!="number"||typeof t.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new pe(e.resolve(t.anchor),e.resolve(t.head))}static create(e,t,r=t){let i=e.resolve(t);return new this(i,r==t?i:e.resolve(r))}static between(e,t,r){let i=e.pos-t.pos;if((!r||i)&&(r=i>=0?1:-1),!t.parent.inlineContent){let s=ye.findFrom(t,r,!0)||ye.findFrom(t,-r,!0);if(s)t=s.$head;else return ye.near(t,r)}return e.parent.inlineContent||(i==0?e=t:(e=(ye.findFrom(e,-r,!0)||ye.findFrom(e,r,!0)).$anchor,e.pos<t.pos!=i<0&&(e=t))),new pe(e,t)}}ye.jsonID("text",pe);class su{constructor(e,t){this.anchor=e,this.head=t}map(e){return new su(e.map(this.anchor),e.map(this.head))}resolve(e){return pe.between(e.resolve(this.anchor),e.resolve(this.head))}}class Q extends ye{constructor(e){let t=e.nodeAfter,r=e.node(0).resolve(e.pos+t.nodeSize);super(e,r),this.node=t}map(e,t){let{deleted:r,pos:i}=t.mapResult(this.anchor),s=e.resolve(i);return r?ye.near(s):new Q(s)}content(){return new K(V.from(this.node),0,0)}eq(e){return e instanceof Q&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new sd(this.anchor)}static fromJSON(e,t){if(typeof t.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new Q(e.resolve(t.anchor))}static create(e,t){return new Q(e.resolve(t))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}}Q.prototype.visible=!1,ye.jsonID("node",Q);class sd{constructor(e){this.anchor=e}map(e){let{deleted:t,pos:r}=e.mapResult(this.anchor);return t?new su(r,r):new sd(r)}resolve(e){let t=e.resolve(this.anchor),r=t.nodeAfter;return r&&Q.isSelectable(r)?new Q(t):ye.near(t)}}class Lt extends ye{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,t=K.empty){if(t==K.empty){e.delete(0,e.doc.content.size);let r=ye.atStart(e.doc);r.eq(e.selection)||e.setSelection(r)}else super.replace(e,t)}toJSON(){return{type:"all"}}static fromJSON(e){return new Lt(e)}map(e){return new Lt(e)}eq(e){return e instanceof Lt}getBookmark(){return gT}}ye.jsonID("all",Lt);const gT={map(){return this},resolve(n){return new Lt(n)}};function Li(n,e,t,r,i,s=!1){if(e.inlineContent)return pe.create(n,t);for(let a=r-(i>0?0:1);i>0?a<e.childCount:a>=0;a+=i){let u=e.child(a);if(u.isAtom){if(!s&&Q.isSelectable(u))return Q.create(n,t-(i<0?u.nodeSize:0))}else{let c=Li(n,u,t+i,i<0?u.childCount:0,i,s);if(c)return c}t+=u.nodeSize*i}return null}function C0(n,e,t){let r=n.steps.length-1;if(r<e)return;let i=n.steps[r];if(!(i instanceof je||i instanceof Je))return;let s=n.mapping.maps[r],a;s.forEach((u,c,h,m)=>{a==null&&(a=m)}),n.setSelection(ye.near(n.doc.resolve(a),t))}function k0(n,e){return!e||!n?n:n.bind(e)}class Ba{constructor(e,t,r){this.name=e,this.init=k0(t.init,r),this.apply=k0(t.apply,r)}}new Ba("doc",{init(n){return n.doc||n.schema.topNodeType.createAndFill()},apply(n){return n.doc}}),new Ba("selection",{init(n,e){return n.selection||ye.atStart(e.doc)},apply(n){return n.selection}}),new Ba("storedMarks",{init(n){return n.storedMarks||null},apply(n,e,t,r){return r.selection.$cursor?n.storedMarks:null}}),new Ba("scrollToSelection",{init(){return 0},apply(n,e){return n.scrolledIntoView?e+1:e}});function T0(n,e,t){for(let r in n){let i=n[r];i instanceof Function?i=i.bind(e):r=="handleDOMEvents"&&(i=T0(i,e,{})),t[r]=i}return t}class ct{constructor(e){this.spec=e,this.props={},e.props&&T0(e.props,this,this.props),this.key=e.key?e.key.key:A0("plugin")}getState(e){return e[this.key]}}const yf=Object.create(null);function A0(n){return n in yf?n+"$"+ ++yf[n]:(yf[n]=0,n+"$")}class It{constructor(e="key"){this.key=A0(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const Gr=function(n){for(var e=0;;e++)if(n=n.previousSibling,!n)return e},O0=function(n,e,t,r){return t&&(M0(n,e,t,r,-1)||M0(n,e,t,r,1))},yT=/^(img|br|input|textarea|hr)$/i;function M0(n,e,t,r,i){for(;;){if(n==t&&e==r)return!0;if(e==(i<0?0:za(n))){let s=n.parentNode;if(!s||s.nodeType!=1||bf(n)||yT.test(n.nodeName)||n.contentEditable=="false")return!1;e=Gr(n)+(i<0?0:1),n=s}else if(n.nodeType==1){if(n=n.childNodes[e+(i<0?-1:0)],n.contentEditable=="false")return!1;e=i<0?za(n):0}else return!1}}function za(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function bT(n,e,t){for(let r=e==0,i=e==za(n);r||i;){if(n==t)return!0;let s=Gr(n);if(n=n.parentNode,!n)return!1;r=r&&s==0,i=i&&s==za(n)}}function bf(n){let e;for(let t=n;t&&!(e=t.pmViewDesc);t=t.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==n||e.contentDOM==n)}const I0=function(n){return n.focusNode&&O0(n.focusNode,n.focusOffset,n.anchorNode,n.anchorOffset)};function N0(n,e){let t=document.createEvent("Event");return t.initEvent("keydown",!0,!0),t.keyCode=n,t.key=t.code=e,t}const gn=typeof navigator<"u"?navigator:null,R0=typeof document<"u"?document:null,yr=gn&&gn.userAgent||"",_f=/Edge\/(\d+)/.exec(yr),L0=/MSIE \d/.exec(yr),wf=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(yr),$s=!!(L0||wf||_f),P0=L0?document.documentMode:wf?+wf[1]:_f?+_f[1]:0,Ha=!$s&&/gecko\/(\d+)/i.test(yr);Ha&&+(/Firefox\/(\d+)/.exec(yr)||[0,0])[1];const vf=!$s&&/Chrome\/(\d+)/.exec(yr),br=!!vf,D0=vf?+vf[1]:0,Jr=!$s&&!!gn&&/Apple Computer/.test(gn.vendor),Sf=Jr&&(/Mobile\/\w+/.test(yr)||!!gn&&gn.maxTouchPoints>2),Gt=Sf||(gn?/Mac/.test(gn.platform):!1),_T=gn?/Win/.test(gn.platform):!1,Fs=/Android \d/.test(yr),xf=!!R0&&"webkitFontSmoothing"in R0.documentElement.style,wT=xf?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function vT(n,e=null){let t=n.domSelectionRange(),r=n.state.doc;if(!t.focusNode)return null;let i=n.docView.nearestDesc(t.focusNode),s=i&&i.size==0,a=n.docView.posFromDOM(t.focusNode,t.focusOffset,1);if(a<0)return null;let u=r.resolve(a),c,h;if(I0(t)){for(c=a;i&&!i.node;)i=i.parent;let d=i.node;if(i&&d.isAtom&&Q.isSelectable(d)&&i.parent&&!(d.isInline&&bT(t.focusNode,t.focusOffset,i.dom))){let y=i.posBefore;h=new Q(a==y?u:r.resolve(y))}}else{if(t instanceof n.dom.ownerDocument.defaultView.Selection&&t.rangeCount>1){let d=a,y=a;for(let _=0;_<t.rangeCount;_++){let v=t.getRangeAt(_);d=Math.min(d,n.docView.posFromDOM(v.startContainer,v.startOffset,1)),y=Math.max(y,n.docView.posFromDOM(v.endContainer,v.endOffset,-1))}if(d<0)return null;[c,a]=y==n.state.selection.anchor?[y,d]:[d,y],u=r.resolve(a)}else c=n.docView.posFromDOM(t.anchorNode,t.anchorOffset,1);if(c<0)return null}let m=r.resolve(c);if(!h){let d=e=="pointer"||n.state.selection.head<u.pos&&!s?1:-1;h=W0(n,m,u,d)}return h}function $0(n){return n.editable?n.hasFocus():CT(n)&&document.activeElement&&document.activeElement.contains(n.dom)}function Ef(n,e=!1){let t=n.state.selection;if(ET(n,t),!!$0(n)){if(!e&&n.input.mouseDown&&n.input.mouseDown.allowDefault&&br){let r=n.domSelectionRange(),i=n.domObserver.currentSelection;if(r.anchorNode&&i.anchorNode&&O0(r.anchorNode,r.anchorOffset,i.anchorNode,i.anchorOffset)){n.input.mouseDown.delayedSelectionSync=!0,n.domObserver.setCurSelection();return}}if(n.domObserver.disconnectSelection(),n.cursorWrapper)xT(n);else{let{anchor:r,head:i}=t,s,a;F0&&!(t instanceof pe)&&(t.$from.parent.inlineContent||(s=B0(n,t.from)),!t.empty&&!t.$from.parent.inlineContent&&(a=B0(n,t.to))),n.docView.setSelection(r,i,n,e),F0&&(s&&z0(s),a&&z0(a)),t.visible?n.dom.classList.remove("ProseMirror-hideselection"):(n.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&ST(n))}n.domObserver.setCurSelection(),n.domObserver.connectSelection()}}const F0=Jr||br&&D0<63;function B0(n,e){let{node:t,offset:r}=n.docView.domFromPos(e,0),i=r<t.childNodes.length?t.childNodes[r]:null,s=r?t.childNodes[r-1]:null;if(Jr&&i&&i.contentEditable=="false")return Cf(i);if((!i||i.contentEditable=="false")&&(!s||s.contentEditable=="false")){if(i)return Cf(i);if(s)return Cf(s)}}function Cf(n){return n.contentEditable="true",Jr&&n.draggable&&(n.draggable=!1,n.wasDraggable=!0),n}function z0(n){n.contentEditable="false",n.wasDraggable&&(n.draggable=!0,n.wasDraggable=null)}function ST(n){let e=n.dom.ownerDocument;e.removeEventListener("selectionchange",n.input.hideSelectionGuard);let t=n.domSelectionRange(),r=t.anchorNode,i=t.anchorOffset;e.addEventListener("selectionchange",n.input.hideSelectionGuard=()=>{(t.anchorNode!=r||t.anchorOffset!=i)&&(e.removeEventListener("selectionchange",n.input.hideSelectionGuard),setTimeout(()=>{(!$0(n)||n.state.selection.visible)&&n.dom.classList.remove("ProseMirror-hideselection")},20))})}function xT(n){let e=n.domSelection(),t=document.createRange();if(!e)return;let r=n.cursorWrapper.dom,i=r.nodeName=="IMG";i?t.setStart(r.parentNode,Gr(r)+1):t.setStart(r,0),t.collapse(!0),e.removeAllRanges(),e.addRange(t),!i&&!n.state.selection.visible&&$s&&P0<=11&&(r.disabled=!0,r.disabled=!1)}function ET(n,e){if(e instanceof Q){let t=n.docView.descAt(e.from);t!=n.lastSelectedViewDesc&&(H0(n),t&&t.selectNode(),n.lastSelectedViewDesc=t)}else H0(n)}function H0(n){n.lastSelectedViewDesc&&(n.lastSelectedViewDesc.parent&&n.lastSelectedViewDesc.deselectNode(),n.lastSelectedViewDesc=void 0)}function W0(n,e,t,r){return n.someProp("createSelectionBetween",i=>i(n,e,t))||pe.between(e,t,r)}function CT(n){let e=n.domSelectionRange();if(!e.anchorNode)return!1;try{return n.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(n.editable||n.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch{return!1}}function kf(n,e){let{$anchor:t,$head:r}=n.selection,i=e>0?t.max(r):t.min(r),s=i.parent.inlineContent?i.depth?n.doc.resolve(e>0?i.after():i.before()):null:i;return s&&ye.findFrom(s,e)}function _r(n,e){return n.dispatch(n.state.tr.setSelection(e).scrollIntoView()),!0}function V0(n,e,t){let r=n.state.selection;if(r instanceof pe)if(t.indexOf("s")>-1){let{$head:i}=r,s=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter;if(!s||s.isText||!s.isLeaf)return!1;let a=n.state.doc.resolve(i.pos+s.nodeSize*(e<0?-1:1));return _r(n,new pe(r.$anchor,a))}else if(r.empty){if(n.endOfTextblock(e>0?"forward":"backward")){let i=kf(n.state,e);return i&&i instanceof Q?_r(n,i):!1}else if(!(Gt&&t.indexOf("m")>-1)){let i=r.$head,s=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter,a;if(!s||s.isText)return!1;let u=e<0?i.pos-s.nodeSize:i.pos;return s.isAtom||(a=n.docView.descAt(u))&&!a.contentDOM?Q.isSelectable(s)?_r(n,new Q(e<0?n.state.doc.resolve(i.pos-s.nodeSize):i)):xf?_r(n,new pe(n.state.doc.resolve(e<0?u:u+s.nodeSize))):!1:!1}}else return!1;else{if(r instanceof Q&&r.node.isInline)return _r(n,new pe(e>0?r.$to:r.$from));{let i=kf(n.state,e);return i?_r(n,i):!1}}}function Wa(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function Bs(n,e){let t=n.pmViewDesc;return t&&t.size==0&&(e<0||n.nextSibling||n.nodeName!="BR")}function Pi(n,e){return e<0?kT(n):TT(n)}function kT(n){let e=n.domSelectionRange(),t=e.focusNode,r=e.focusOffset;if(!t)return;let i,s,a=!1;for(Ha&&t.nodeType==1&&r<Wa(t)&&Bs(t.childNodes[r],-1)&&(a=!0);;)if(r>0){if(t.nodeType!=1)break;{let u=t.childNodes[r-1];if(Bs(u,-1))i=t,s=--r;else if(u.nodeType==3)t=u,r=t.nodeValue.length;else break}}else{if(U0(t))break;{let u=t.previousSibling;for(;u&&Bs(u,-1);)i=t.parentNode,s=Gr(u),u=u.previousSibling;if(u)t=u,r=Wa(t);else{if(t=t.parentNode,t==n.dom)break;r=0}}}a?Tf(n,t,r):i&&Tf(n,i,s)}function TT(n){let e=n.domSelectionRange(),t=e.focusNode,r=e.focusOffset;if(!t)return;let i=Wa(t),s,a;for(;;)if(r<i){if(t.nodeType!=1)break;let u=t.childNodes[r];if(Bs(u,1))s=t,a=++r;else break}else{if(U0(t))break;{let u=t.nextSibling;for(;u&&Bs(u,1);)s=u.parentNode,a=Gr(u)+1,u=u.nextSibling;if(u)t=u,r=0,i=Wa(t);else{if(t=t.parentNode,t==n.dom)break;r=i=0}}}s&&Tf(n,s,a)}function U0(n){let e=n.pmViewDesc;return e&&e.node&&e.node.isBlock}function AT(n,e){for(;n&&e==n.childNodes.length&&!bf(n);)e=Gr(n)+1,n=n.parentNode;for(;n&&e<n.childNodes.length;){let t=n.childNodes[e];if(t.nodeType==3)return t;if(t.nodeType==1&&t.contentEditable=="false")break;n=t,e=0}}function OT(n,e){for(;n&&!e&&!bf(n);)e=Gr(n),n=n.parentNode;for(;n&&e;){let t=n.childNodes[e-1];if(t.nodeType==3)return t;if(t.nodeType==1&&t.contentEditable=="false")break;n=t,e=n.childNodes.length}}function Tf(n,e,t){if(e.nodeType!=3){let s,a;(a=AT(e,t))?(e=a,t=0):(s=OT(e,t))&&(e=s,t=s.nodeValue.length)}let r=n.domSelection();if(!r)return;if(I0(r)){let s=document.createRange();s.setEnd(e,t),s.setStart(e,t),r.removeAllRanges(),r.addRange(s)}else r.extend&&r.extend(e,t);n.domObserver.setCurSelection();let{state:i}=n;setTimeout(()=>{n.state==i&&Ef(n)},50)}function q0(n,e){let t=n.state.doc.resolve(e);if(!(br||_T)&&t.parent.inlineContent){let i=n.coordsAtPos(e);if(e>t.start()){let s=n.coordsAtPos(e-1),a=(s.top+s.bottom)/2;if(a>i.top&&a<i.bottom&&Math.abs(s.left-i.left)>1)return s.left<i.left?"ltr":"rtl"}if(e<t.end()){let s=n.coordsAtPos(e+1),a=(s.top+s.bottom)/2;if(a>i.top&&a<i.bottom&&Math.abs(s.left-i.left)>1)return s.left>i.left?"ltr":"rtl"}}return getComputedStyle(n.dom).direction=="rtl"?"rtl":"ltr"}function K0(n,e,t){let r=n.state.selection;if(r instanceof pe&&!r.empty||t.indexOf("s")>-1||Gt&&t.indexOf("m")>-1)return!1;let{$from:i,$to:s}=r;if(!i.parent.inlineContent||n.endOfTextblock(e<0?"up":"down")){let a=kf(n.state,e);if(a&&a instanceof Q)return _r(n,a)}if(!i.parent.inlineContent){let a=e<0?i:s,u=r instanceof Lt?ye.near(a,e):ye.findFrom(a,e);return u?_r(n,u):!1}return!1}function G0(n,e){if(!(n.state.selection instanceof pe))return!0;let{$head:t,$anchor:r,empty:i}=n.state.selection;if(!t.sameParent(r))return!0;if(!i)return!1;if(n.endOfTextblock(e>0?"forward":"backward"))return!0;let s=!t.textOffset&&(e<0?t.nodeBefore:t.nodeAfter);if(s&&!s.isText){let a=n.state.tr;return e<0?a.delete(t.pos-s.nodeSize,t.pos):a.delete(t.pos,t.pos+s.nodeSize),n.dispatch(a),!0}return!1}function J0(n,e,t){n.domObserver.stop(),e.contentEditable=t,n.domObserver.start()}function MT(n){if(!Jr||n.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:t}=n.domSelectionRange();if(e&&e.nodeType==1&&t==0&&e.firstChild&&e.firstChild.contentEditable=="false"){let r=e.firstChild;J0(n,r,"true"),setTimeout(()=>J0(n,r,"false"),20)}return!1}function IT(n){let e="";return n.ctrlKey&&(e+="c"),n.metaKey&&(e+="m"),n.altKey&&(e+="a"),n.shiftKey&&(e+="s"),e}function NT(n,e){let t=e.keyCode,r=IT(e);if(t==8||Gt&&t==72&&r=="c")return G0(n,-1)||Pi(n,-1);if(t==46&&!e.shiftKey||Gt&&t==68&&r=="c")return G0(n,1)||Pi(n,1);if(t==13||t==27)return!0;if(t==37||Gt&&t==66&&r=="c"){let i=t==37?q0(n,n.state.selection.from)=="ltr"?-1:1:-1;return V0(n,i,r)||Pi(n,i)}else if(t==39||Gt&&t==70&&r=="c"){let i=t==39?q0(n,n.state.selection.from)=="ltr"?1:-1:1;return V0(n,i,r)||Pi(n,i)}else{if(t==38||Gt&&t==80&&r=="c")return K0(n,-1,r)||Pi(n,-1);if(t==40||Gt&&t==78&&r=="c")return MT(n)||K0(n,1,r)||Pi(n,1);if(r==(Gt?"m":"c")&&(t==66||t==73||t==89||t==90))return!0}return!1}function j0(n,e){n.someProp("transformCopied",_=>{e=_(e,n)});let t=[],{content:r,openStart:i,openEnd:s}=e;for(;i>1&&s>1&&r.childCount==1&&r.firstChild.childCount==1;){i--,s--;let _=r.firstChild;t.push(_.type.name,_.attrs!=_.type.defaultAttrs?_.attrs:null),r=_.content}let a=n.someProp("clipboardSerializer")||io.fromSchema(n.state.schema),u=r1(),c=u.createElement("div");c.appendChild(a.serializeFragment(r,{document:u}));let h=c.firstChild,m,d=0;for(;h&&h.nodeType==1&&(m=t1[h.nodeName.toLowerCase()]);){for(let _=m.length-1;_>=0;_--){let v=u.createElement(m[_]);for(;c.firstChild;)v.appendChild(c.firstChild);c.appendChild(v),d++}h=c.firstChild}h&&h.nodeType==1&&h.setAttribute("data-pm-slice",`${i} ${s}${d?` -${d}`:""} ${JSON.stringify(t)}`);let y=n.someProp("clipboardTextSerializer",_=>_(e,n))||e.content.textBetween(0,e.content.size,`
|
|
35
35
|
|
|
36
|
-
`);return{dom:c,text:y,slice:e}}function
|
|
37
|
-
`))),0,0):K.empty;let m=n.someProp("clipboardTextParser",y=>y(e,i,r,n));if(m)u=m;else{let y=i.marks(),{schema:_}=n.state,S=Vs.fromSchema(_);a=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(E=>{let N=a.appendChild(document.createElement("p"));E&&N.appendChild(S.serializeNode(_.text(E,y)))})}}else n.someProp("transformPastedHTML",m=>{t=m(t,n)}),a=Lk(t),Qc&&Pk(a);let h=a&&a.querySelector("[data-pm-slice]"),p=h&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(h.getAttribute("data-pm-slice")||"");if(p&&p[3])for(let m=+p[3];m>0;m--){let y=a.firstChild;for(;y&&y.nodeType!=1;)y=y.nextSibling;if(!y)break;a=y}if(u||(u=(n.someProp("clipboardParser")||n.someProp("domParser")||_s.fromSchema(n.state.schema)).parseSlice(a,{preserveWhitespace:!!(c||p),context:i,ruleFromNode(y){return y.nodeName=="BR"&&!y.nextSibling&&y.parentNode&&!Ik.test(y.parentNode.nodeName)?{ignore:!0}:null}})),p)u=Dk(b0(u,+p[1],+p[2]),p[4]);else if(u=K.maxOpen(Nk(u.content,i),!0),u.openStart||u.openEnd){let m=0,y=0;for(let _=u.content.firstChild;m<u.openStart&&!_.type.spec.isolating;m++,_=_.firstChild);for(let _=u.content.lastChild;y<u.openEnd&&!_.type.spec.isolating;y++,_=_.lastChild);u=b0(u,m,y)}return n.someProp("transformPasted",m=>{u=m(u,n)}),u}const Ik=/^(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 Nk(n,e){if(n.childCount<2)return n;for(let t=e.depth;t>=0;t--){let i=e.node(t).contentMatchAt(e.index(t)),s,a=[];if(n.forEach(u=>{if(!a)return;let c=i.findWrapping(u.type),h;if(!c)return a=null;if(h=a.length&&s.length&&g0(c,s,u,a[a.length-1],0))a[a.length-1]=h;else{a.length&&(a[a.length-1]=y0(a[a.length-1],s.length));let p=m0(u,c);a.push(p),i=i.matchType(p.type),s=c}}),a)return z.from(a)}return n}function m0(n,e,t=0){for(let r=e.length-1;r>=t;r--)n=e[r].create(null,z.from(n));return n}function g0(n,e,t,r,i){if(i<n.length&&i<e.length&&n[i]==e[i]){let s=g0(n,e,t,r.lastChild,i+1);if(s)return r.copy(r.content.replaceChild(r.childCount-1,s));if(r.contentMatchAt(r.childCount).matchType(i==n.length-1?t.type:n[i+1]))return r.copy(r.content.append(z.from(m0(t,n,i+1))))}}function y0(n,e){if(e==0)return n;let t=n.content.replaceChild(n.childCount-1,y0(n.lastChild,e-1)),r=n.contentMatchAt(n.childCount).fillBefore(z.empty,!0);return n.copy(t.append(r))}function sf(n,e,t,r,i,s){let a=e<0?n.firstChild:n.lastChild,u=a.content;return n.childCount>1&&(s=0),i<r-1&&(u=sf(u,e,t,r,i+1,s)),i>=t&&(u=e<0?a.contentMatchAt(0).fillBefore(u,s<=i).append(u):u.append(a.contentMatchAt(a.childCount).fillBefore(z.empty,!0))),n.replaceChild(e<0?0:n.childCount-1,a.copy(u))}function b0(n,e,t){return e<n.openStart&&(n=new K(sf(n.content,-1,e,n.openStart,0,n.openEnd),e,n.openEnd)),t<n.openEnd&&(n=new K(sf(n.content,1,t,n.openEnd,0,0),n.openStart,t)),n}const _0={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};let w0=null;function v0(){return w0||(w0=document.implementation.createHTMLDocument("title"))}let of=null;function Rk(n){let e=window.trustedTypes;return e?(of||(of=e.createPolicy("ProseMirrorClipboard",{createHTML:t=>t})),of.createHTML(n)):n}function Lk(n){let e=/^(\s*<meta [^>]*>)*/.exec(n);e&&(n=n.slice(e[0].length));let t=v0().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(n),i;if((i=r&&_0[r[1].toLowerCase()])&&(n=i.map(s=>"<"+s+">").join("")+n+i.map(s=>"</"+s+">").reverse().join("")),t.innerHTML=Rk(n),i)for(let s=0;s<i.length;s++)t=t.querySelector(i[s])||t;return t}function Pk(n){let e=n.querySelectorAll(pr?"span:not([class]):not([style])":"span.Apple-converted-space");for(let t=0;t<e.length;t++){let r=e[t];r.childNodes.length==1&&r.textContent=="\xA0"&&r.parentNode&&r.parentNode.replaceChild(n.ownerDocument.createTextNode(" "),r)}}function Dk(n,e){if(!n.size)return n;let t=n.content.firstChild.type.schema,r;try{r=JSON.parse(e)}catch{return n}let{content:i,openStart:s,openEnd:a}=n;for(let u=r.length-2;u>=0;u-=2){let c=t.nodes[r[u]];if(!c||c.hasRequiredAttrs())break;i=z.from(c.create(r[u+1],i)),s++,a++}return new K(i,s,a)}const on={},It={};function gr(n,e){n.input.lastSelectionOrigin=e,n.input.lastSelectionTime=Date.now()}It.keydown=(n,e)=>{let t=e;if(n.input.shiftKey=t.keyCode==16||t.shiftKey,!x0(n,t)&&(n.input.lastKeyCode=t.keyCode,n.input.lastKeyCodeTime=Date.now(),!(Cs&&pr&&t.keyCode==13)))if(t.keyCode!=229&&n.domObserver.forceFlush(),Zc&&t.keyCode==13&&!t.ctrlKey&&!t.altKey&&!t.metaKey){let r=Date.now();n.input.lastIOSEnter=r,n.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{n.input.lastIOSEnter==r&&(n.someProp("handleKeyDown",i=>i(n,Yg(13,"Enter"))),n.input.lastIOSEnter=0)},200)}else n.someProp("handleKeyDown",r=>r(n,t))||Mk(n,t)?t.preventDefault():gr(n,"key")},It.keyup=(n,e)=>{e.keyCode==16&&(n.input.shiftKey=!1)},It.keypress=(n,e)=>{let t=e;if(x0(n,t)||!t.charCode||t.ctrlKey&&!t.altKey||Kt&&t.metaKey)return;if(n.someProp("handleKeyPress",i=>i(n,t))){t.preventDefault();return}let r=n.state.selection;if(!(r instanceof pe)||!r.$from.sameParent(r.$to)){let i=String.fromCharCode(t.charCode);!/[\r\n]/.test(i)&&!n.someProp("handleTextInput",s=>s(n,r.$from.pos,r.$to.pos,i))&&n.dispatch(n.state.tr.insertText(i).scrollIntoView()),t.preventDefault()}};function Ta(n){return{left:n.clientX,top:n.clientY}}function Fk(n,e){let t=e.x-n.clientX,r=e.y-n.clientY;return t*t+r*r<100}function af(n,e,t,r,i){if(r==-1)return!1;let s=n.state.doc.resolve(r);for(let a=s.depth+1;a>0;a--)if(n.someProp(e,u=>a>s.depth?u(n,t,s.nodeAfter,s.before(a),i,!0):u(n,t,s.node(a),s.before(a),i,!1)))return!0;return!1}function ki(n,e,t){if(n.focused||n.focus(),n.state.selection.eq(e))return;let r=n.state.tr.setSelection(e);r.setMeta("pointer",!0),n.dispatch(r)}function Bk(n,e){if(e==-1)return!1;let t=n.state.doc.resolve(e),r=t.nodeAfter;return r&&r.isAtom&&Q.isSelectable(r)?(ki(n,new Q(t)),!0):!1}function zk(n,e){if(e==-1)return!1;let t=n.state.selection,r,i;t instanceof Q&&(r=t.node);let s=n.state.doc.resolve(e);for(let a=s.depth+1;a>0;a--){let u=a>s.depth?s.nodeAfter:s.node(a);if(Q.isSelectable(u)){r&&t.$from.depth>0&&a>=t.$from.depth&&s.before(t.$from.depth+1)==t.$from.pos?i=s.before(t.$from.depth):i=s.before(a);break}}return i!=null?(ki(n,Q.create(n.state.doc,i)),!0):!1}function $k(n,e,t,r,i){return af(n,"handleClickOn",e,t,r)||n.someProp("handleClick",s=>s(n,e,r))||(i?zk(n,t):Bk(n,t))}function Hk(n,e,t,r){return af(n,"handleDoubleClickOn",e,t,r)||n.someProp("handleDoubleClick",i=>i(n,e,r))}function Wk(n,e,t,r){return af(n,"handleTripleClickOn",e,t,r)||n.someProp("handleTripleClick",i=>i(n,e,r))||Vk(n,t,r)}function Vk(n,e,t){if(t.button!=0)return!1;let r=n.state.doc;if(e==-1)return r.inlineContent?(ki(n,pe.create(r,0,r.content.size)),!0):!1;let i=r.resolve(e);for(let s=i.depth+1;s>0;s--){let a=s>i.depth?i.nodeAfter:i.node(s),u=i.before(s);if(a.inlineContent)ki(n,pe.create(r,u+1,u+1+a.content.size));else if(Q.isSelectable(a))ki(n,Q.create(r,u));else continue;return!0}}function lf(n){return Oa(n)}const S0=Kt?"metaKey":"ctrlKey";on.mousedown=(n,e)=>{let t=e;n.input.shiftKey=t.shiftKey;let r=lf(n),i=Date.now(),s="singleClick";i-n.input.lastClick.time<500&&Fk(t,n.input.lastClick)&&!t[S0]&&(n.input.lastClick.type=="singleClick"?s="doubleClick":n.input.lastClick.type=="doubleClick"&&(s="tripleClick")),n.input.lastClick={time:i,x:t.clientX,y:t.clientY,type:s};let a=n.posAtCoords(Ta(t));a&&(s=="singleClick"?(n.input.mouseDown&&n.input.mouseDown.done(),n.input.mouseDown=new Uk(n,a,t,!!r)):(s=="doubleClick"?Hk:Wk)(n,a.pos,a.inside,t)?t.preventDefault():gr(n,"pointer"))};class Uk{constructor(e,t,r,i){this.view=e,this.pos=t,this.event=r,this.flushed=i,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!r[S0],this.allowDefault=r.shiftKey;let s,a;if(t.inside>-1)s=e.state.doc.nodeAt(t.inside),a=t.inside;else{let p=e.state.doc.resolve(t.pos);s=p.parent,a=p.depth?p.before():0}const u=i?null:r.target,c=u?e.docView.nearestDesc(u,!0):null;this.target=c&&c.dom.nodeType==1?c.dom:null;let{selection:h}=e.state;(r.button==0&&s.type.spec.draggable&&s.type.spec.selectable!==!1||h instanceof Q&&h.from<=a&&h.to>a)&&(this.mightDrag={node:s,pos:a,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&ka&&!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()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),gr(e,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),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(()=>ef(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let t=this.pos;this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(Ta(e))),this.updateAllowDefault(e),this.allowDefault||!t?gr(this.view,"pointer"):$k(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||Wr&&this.mightDrag&&!this.mightDrag.node.isAtom||pr&&!this.view.state.selection.visible&&Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to))<=2)?(ki(this.view,ye.near(this.view.state.doc.resolve(t.pos))),e.preventDefault()):gr(this.view,"pointer")}move(e){this.updateAllowDefault(e),gr(this.view,"pointer"),e.buttons==0&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}}on.touchstart=n=>{n.input.lastTouch=Date.now(),lf(n),gr(n,"pointer")},on.touchmove=n=>{n.input.lastTouch=Date.now(),gr(n,"pointer")},on.contextmenu=n=>lf(n);function x0(n,e){return n.composing?!0:Wr&&Math.abs(e.timeStamp-n.input.compositionEndedAt)<500?(n.input.compositionEndedAt=-2e8,!0):!1}const qk=Cs?5e3:-1;It.compositionstart=It.compositionupdate=n=>{if(!n.composing){n.domObserver.flush();let{state:e}=n,t=e.selection.$to;if(e.selection instanceof pe&&(e.storedMarks||!t.textOffset&&t.parentOffset&&t.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)))n.markCursor=n.state.storedMarks||t.marks(),Oa(n,!0),n.markCursor=null;else if(Oa(n,!e.selection.empty),ka&&e.selection.empty&&t.parentOffset&&!t.textOffset&&t.nodeBefore.marks.length){let r=n.domSelectionRange();for(let i=r.focusNode,s=r.focusOffset;i&&i.nodeType==1&&s!=0;){let a=s<0?i.lastChild:i.childNodes[s-1];if(!a)break;if(a.nodeType==3){let u=n.domSelection();u&&u.collapse(a,a.nodeValue.length);break}else i=a,s=-1}}n.input.composing=!0}C0(n,qk)},It.compositionend=(n,e)=>{n.composing&&(n.input.composing=!1,n.input.compositionEndedAt=e.timeStamp,n.input.compositionPendingChanges=n.domObserver.pendingRecords().length?n.input.compositionID:0,n.input.compositionNode=null,n.input.compositionPendingChanges&&Promise.resolve().then(()=>n.domObserver.flush()),n.input.compositionID++,C0(n,20))};function C0(n,e){clearTimeout(n.input.composingTimeout),e>-1&&(n.input.composingTimeout=setTimeout(()=>Oa(n),e))}function Kk(n){for(n.composing&&(n.input.composing=!1,n.input.compositionEndedAt=Gk());n.input.compositionNodes.length>0;)n.input.compositionNodes.pop().markParentsDirty()}function Gk(){let n=document.createEvent("Event");return n.initEvent("event",!0,!0),n.timeStamp}function Oa(n,e=!1){if(!(Cs&&n.domObserver.flushingSoon>=0)){if(n.domObserver.forceFlush(),Kk(n),e||n.docView&&n.docView.dirty){let t=_k(n);return t&&!t.eq(n.state.selection)?n.dispatch(n.state.tr.setSelection(t)):(n.markCursor||e)&&!n.state.selection.empty?n.dispatch(n.state.tr.deleteSelection()):n.updateState(n.state),!0}return!1}}function Jk(n,e){if(!n.dom.parentNode)return;let t=n.dom.parentNode.appendChild(document.createElement("div"));t.appendChild(e),t.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),i=document.createRange();i.selectNodeContents(e),n.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout(()=>{t.parentNode&&t.parentNode.removeChild(t),n.focus()},50)}const ks=xs&&Qg<15||Zc&&bk<604;on.copy=It.cut=(n,e)=>{let t=e,r=n.state.selection,i=t.type=="cut";if(r.empty)return;let s=ks?null:t.clipboardData,a=r.content(),{dom:u,text:c}=d0(n,a);s?(t.preventDefault(),s.clearData(),s.setData("text/html",u.innerHTML),s.setData("text/plain",c)):Jk(n,u),i&&n.dispatch(n.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function jk(n){return n.openStart==0&&n.openEnd==0&&n.content.childCount==1?n.content.firstChild:null}function Yk(n,e){if(!n.dom.parentNode)return;let t=n.input.shiftKey||n.state.selection.$from.parent.type.spec.code,r=n.dom.parentNode.appendChild(document.createElement(t?"textarea":"div"));t||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let i=n.input.shiftKey&&n.input.lastKeyCode!=45;setTimeout(()=>{n.focus(),r.parentNode&&r.parentNode.removeChild(r),t?uf(n,r.value,null,i,e):uf(n,r.textContent,r.innerHTML,i,e)},50)}function uf(n,e,t,r,i){let s=p0(n,e,t,r,n.state.selection.$from);if(n.someProp("handlePaste",c=>c(n,i,s||K.empty)))return!0;if(!s)return!1;let a=jk(s),u=a?n.state.tr.replaceSelectionWith(a,r):n.state.tr.replaceSelection(s);return n.dispatch(u.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function E0(n){let e=n.getData("text/plain")||n.getData("Text");if(e)return e;let t=n.getData("text/uri-list");return t?t.replace(/\r?\n/g," "):""}It.paste=(n,e)=>{let t=e;if(n.composing&&!Cs)return;let r=ks?null:t.clipboardData,i=n.input.shiftKey&&n.input.lastKeyCode!=45;r&&uf(n,E0(r),r.getData("text/html"),i,t)?t.preventDefault():Yk(n,t)};class Xk{constructor(e,t,r){this.slice=e,this.move=t,this.node=r}}const k0=Kt?"altKey":"ctrlKey";on.dragstart=(n,e)=>{let t=e,r=n.input.mouseDown;if(r&&r.done(),!t.dataTransfer)return;let i=n.state.selection,s=i.empty?null:n.posAtCoords(Ta(t)),a;if(!(s&&s.pos>=i.from&&s.pos<=(i instanceof Q?i.to-1:i.to))){if(r&&r.mightDrag)a=Q.create(n.state.doc,r.mightDrag.pos);else if(t.target&&t.target.nodeType==1){let m=n.docView.nearestDesc(t.target,!0);m&&m.node.type.spec.draggable&&m!=n.docView&&(a=Q.create(n.state.doc,m.posBefore))}}let u=(a||n.state.selection).content(),{dom:c,text:h,slice:p}=d0(n,u);(!t.dataTransfer.files.length||!pr||e0>120)&&t.dataTransfer.clearData(),t.dataTransfer.setData(ks?"Text":"text/html",c.innerHTML),t.dataTransfer.effectAllowed="copyMove",ks||t.dataTransfer.setData("text/plain",h),n.dragging=new Xk(p,!t[k0],a)},on.dragend=n=>{let e=n.dragging;window.setTimeout(()=>{n.dragging==e&&(n.dragging=null)},50)},It.dragover=It.dragenter=(n,e)=>e.preventDefault(),It.drop=(n,e)=>{let t=e,r=n.dragging;if(n.dragging=null,!t.dataTransfer)return;let i=n.posAtCoords(Ta(t));if(!i)return;let s=n.state.doc.resolve(i.pos),a=r&&r.slice;a?n.someProp("transformPasted",S=>{a=S(a,n)}):a=p0(n,E0(t.dataTransfer),ks?null:t.dataTransfer.getData("text/html"),!1,s);let u=!!(r&&!t[k0]);if(n.someProp("handleDrop",S=>S(n,t,a||K.empty,u))){t.preventDefault();return}if(!a)return;t.preventDefault();let c=a?sk(n.state.doc,s.pos,a):s.pos;c==null&&(c=s.pos);let h=n.state.tr;if(u){let{node:S}=r;S?S.replace(h):h.deleteSelection()}let p=h.mapping.map(c),m=a.openStart==0&&a.openEnd==0&&a.content.childCount==1,y=h.doc;if(m?h.replaceRangeWith(p,p,a.content.firstChild):h.replaceRange(p,p,a),h.doc.eq(y))return;let _=h.doc.resolve(p);if(m&&Q.isSelectable(a.content.firstChild)&&_.nodeAfter&&_.nodeAfter.sameMarkup(a.content.firstChild))h.setSelection(new Q(_));else{let S=h.mapping.map(c);h.mapping.maps[h.mapping.maps.length-1].forEach((E,N,g,v)=>S=v),h.setSelection(o0(n,_,h.doc.resolve(S)))}n.focus(),n.dispatch(h.setMeta("uiEvent","drop"))},on.focus=n=>{n.input.lastFocus=Date.now(),n.focused||(n.domObserver.stop(),n.dom.classList.add("ProseMirror-focused"),n.domObserver.start(),n.focused=!0,setTimeout(()=>{n.docView&&n.hasFocus()&&!n.domObserver.currentSelection.eq(n.domSelectionRange())&&ef(n)},20))},on.blur=(n,e)=>{let t=e;n.focused&&(n.domObserver.stop(),n.dom.classList.remove("ProseMirror-focused"),n.domObserver.start(),t.relatedTarget&&n.dom.contains(t.relatedTarget)&&n.domObserver.currentSelection.clear(),n.focused=!1)},on.beforeinput=(n,e)=>{if(pr&&Cs&&e.inputType=="deleteContentBackward"){n.domObserver.flushSoon();let{domChangeCount:r}=n.input;setTimeout(()=>{if(n.input.domChangeCount!=r||(n.dom.blur(),n.focus(),n.someProp("handleKeyDown",s=>s(n,Yg(8,"Backspace")))))return;let{$cursor:i}=n.state.selection;i&&i.pos>0&&n.dispatch(n.state.tr.delete(i.pos-1,i.pos).scrollIntoView())},50)}};for(let n in It)on[n]=It[n];function As(n,e){if(n==e)return!0;for(let t in n)if(n[t]!==e[t])return!1;for(let t in e)if(!(t in n))return!1;return!0}class Fl{constructor(e,t){this.toDOM=e,this.spec=t||Vr,this.side=this.spec.side||0}map(e,t,r,i){let{pos:s,deleted:a}=e.mapResult(t.from+i,this.side<0?-1:1);return a?null:new vn(s-r,s-r,this)}valid(){return!0}eq(e){return this==e||e instanceof Fl&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&As(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class Cr{constructor(e,t){this.attrs=e,this.spec=t||Vr}map(e,t,r,i){let s=e.map(t.from+i,this.spec.inclusiveStart?-1:1)-r,a=e.map(t.to+i,this.spec.inclusiveEnd?1:-1)-r;return s>=a?null:new vn(s,a,this)}valid(e,t){return t.from<t.to}eq(e){return this==e||e instanceof Cr&&As(this.attrs,e.attrs)&&As(this.spec,e.spec)}static is(e){return e.type instanceof Cr}destroy(){}}let Zk=class Ky{constructor(e,t){this.attrs=e,this.spec=t||Vr}map(e,t,r,i){let s=e.mapResult(t.from+i,1);if(s.deleted)return null;let a=e.mapResult(t.to+i,-1);return a.deleted||a.pos<=s.pos?null:new vn(s.pos-r,a.pos-r,this)}valid(e,t){let{index:r,offset:i}=e.content.findIndex(t.from),s;return i==t.from&&!(s=e.child(r)).isText&&i+s.nodeSize==t.to}eq(e){return this==e||e instanceof Ky&&As(this.attrs,e.attrs)&&As(this.spec,e.spec)}destroy(){}};class vn{constructor(e,t,r){this.from=e,this.to=t,this.type=r}copy(e,t){return new vn(e,t,this.type)}eq(e,t=0){return this.type.eq(e.type)&&this.from+t==e.from&&this.to+t==e.to}map(e,t,r){return this.type.map(e,this,t,r)}static widget(e,t,r){return new vn(e,e,new Fl(t,r))}static inline(e,t,r,i){return new vn(e,t,new Cr(r,i))}static node(e,t,r,i){return new vn(e,t,new Zk(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof Cr}get widget(){return this.type instanceof Fl}}const Ai=[],Vr={};class Ye{constructor(e,t){this.local=e.length?e:Ai,this.children=t.length?t:Ai}static create(e,t){return t.length?Ma(t,e,0,Vr):ft}find(e,t,r){let i=[];return this.findInner(e??0,t??1e9,i,0,r),i}findInner(e,t,r,i,s){for(let a=0;a<this.local.length;a++){let u=this.local[a];u.from<=t&&u.to>=e&&(!s||s(u.spec))&&r.push(u.copy(u.from+i,u.to+i))}for(let a=0;a<this.children.length;a+=3)if(this.children[a]<t&&this.children[a+1]>e){let u=this.children[a]+1;this.children[a+2].findInner(e-u,t-u,r,i+u,s)}}map(e,t,r){return this==ft||e.maps.length==0?this:this.mapInner(e,t,0,0,r||Vr)}mapInner(e,t,r,i,s){let a;for(let u=0;u<this.local.length;u++){let c=this.local[u].map(e,r,i);c&&c.type.valid(t,c)?(a||(a=[])).push(c):s.onRemove&&s.onRemove(this.local[u].spec)}return this.children.length?Qk(this.children,a||[],e,t,r,i,s):a?new Ye(a.sort(Ur),Ai):ft}add(e,t){return t.length?this==ft?Ye.create(e,t):this.addInner(e,t,0):this}addInner(e,t,r){let i,s=0;e.forEach((u,c)=>{let h=c+r,p;if(p=T0(t,u,h)){for(i||(i=this.children.slice());s<i.length&&i[s]<c;)s+=3;i[s]==c?i[s+2]=i[s+2].addInner(u,p,h+1):i.splice(s,0,c,c+u.nodeSize,Ma(p,u,h+1,Vr)),s+=3}});let a=A0(s?O0(t):t,-r);for(let u=0;u<a.length;u++)a[u].type.valid(e,a[u])||a.splice(u--,1);return new Ye(a.length?this.local.concat(a).sort(Ur):this.local,i||this.children)}remove(e){return e.length==0||this==ft?this:this.removeInner(e,0)}removeInner(e,t){let r=this.children,i=this.local;for(let s=0;s<r.length;s+=3){let a,u=r[s]+t,c=r[s+1]+t;for(let p=0,m;p<e.length;p++)(m=e[p])&&m.from>u&&m.to<c&&(e[p]=null,(a||(a=[])).push(m));if(!a)continue;r==this.children&&(r=this.children.slice());let h=r[s+2].removeInner(a,u+1);h!=ft?r[s+2]=h:(r.splice(s,3),s-=3)}if(i.length){for(let s=0,a;s<e.length;s++)if(a=e[s])for(let u=0;u<i.length;u++)i[u].eq(a,t)&&(i==this.local&&(i=this.local.slice()),i.splice(u--,1))}return r==this.children&&i==this.local?this:i.length||r.length?new Ye(i,r):ft}forChild(e,t){if(this==ft)return this;if(t.isLeaf)return Ye.empty;let r,i;for(let u=0;u<this.children.length;u+=3)if(this.children[u]>=e){this.children[u]==e&&(r=this.children[u+2]);break}let s=e+1,a=s+t.content.size;for(let u=0;u<this.local.length;u++){let c=this.local[u];if(c.from<a&&c.to>s&&c.type instanceof Cr){let h=Math.max(s,c.from)-s,p=Math.min(a,c.to)-s;h<p&&(i||(i=[])).push(c.copy(h,p))}}if(i){let u=new Ye(i.sort(Ur),Ai);return r?new Zr([u,r]):u}return r||ft}eq(e){if(this==e)return!0;if(!(e instanceof Ye)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let t=0;t<this.local.length;t++)if(!this.local[t].eq(e.local[t]))return!1;for(let t=0;t<this.children.length;t+=3)if(this.children[t]!=e.children[t]||this.children[t+1]!=e.children[t+1]||!this.children[t+2].eq(e.children[t+2]))return!1;return!0}locals(e){return cf(this.localsInner(e))}localsInner(e){if(this==ft)return Ai;if(e.inlineContent||!this.local.some(Cr.is))return this.local;let t=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof Cr||t.push(this.local[r]);return t}forEachSet(e){e(this)}}Ye.empty=new Ye([],[]),Ye.removeOverlap=cf;const ft=Ye.empty;class Zr{constructor(e){this.members=e}map(e,t){const r=this.members.map(i=>i.map(e,t,Vr));return Zr.from(r)}forChild(e,t){if(t.isLeaf)return Ye.empty;let r=[];for(let i=0;i<this.members.length;i++){let s=this.members[i].forChild(e,t);s!=ft&&(s instanceof Zr?r=r.concat(s.members):r.push(s))}return Zr.from(r)}eq(e){if(!(e instanceof Zr)||e.members.length!=this.members.length)return!1;for(let t=0;t<this.members.length;t++)if(!this.members[t].eq(e.members[t]))return!1;return!0}locals(e){let t,r=!0;for(let i=0;i<this.members.length;i++){let s=this.members[i].localsInner(e);if(s.length)if(!t)t=s;else{r&&(t=t.slice(),r=!1);for(let a=0;a<s.length;a++)t.push(s[a])}}return t?cf(r?t:t.sort(Ur)):Ai}static from(e){switch(e.length){case 0:return ft;case 1:return e[0];default:return new Zr(e.every(t=>t instanceof Ye)?e:e.reduce((t,r)=>t.concat(r instanceof Ye?r:r.members),[]))}}forEachSet(e){for(let t=0;t<this.members.length;t++)this.members[t].forEachSet(e)}}function Qk(n,e,t,r,i,s,a){let u=n.slice();for(let h=0,p=s;h<t.maps.length;h++){let m=0;t.maps[h].forEach((y,_,S,E)=>{let N=E-S-(_-y);for(let g=0;g<u.length;g+=3){let v=u[g+1];if(v<0||y>v+p-m)continue;let k=u[g]+p-m;_>=k?u[g+1]=y<=k?-2:-1:y>=p&&N&&(u[g]+=N,u[g+1]+=N)}m+=N}),p=t.maps[h].map(p,-1)}let c=!1;for(let h=0;h<u.length;h+=3)if(u[h+1]<0){if(u[h+1]==-2){c=!0,u[h+1]=-1;continue}let p=t.map(n[h]+s),m=p-i;if(m<0||m>=r.content.size){c=!0;continue}let y=t.map(n[h+1]+s,-1),_=y-i,{index:S,offset:E}=r.content.findIndex(m),N=r.maybeChild(S);if(N&&E==m&&E+N.nodeSize==_){let g=u[h+2].mapInner(t,N,p+1,n[h]+s+1,a);g!=ft?(u[h]=m,u[h+1]=_,u[h+2]=g):(u[h+1]=-2,c=!0)}else c=!0}if(c){let h=eA(u,n,e,t,i,s,a),p=Ma(h,r,0,a);e=p.local;for(let m=0;m<u.length;m+=3)u[m+1]<0&&(u.splice(m,3),m-=3);for(let m=0,y=0;m<p.children.length;m+=3){let _=p.children[m];for(;y<u.length&&u[y]<_;)y+=3;u.splice(y,0,p.children[m],p.children[m+1],p.children[m+2])}}return new Ye(e.sort(Ur),u)}function A0(n,e){if(!e||!n.length)return n;let t=[];for(let r=0;r<n.length;r++){let i=n[r];t.push(new vn(i.from+e,i.to+e,i.type))}return t}function eA(n,e,t,r,i,s,a){function u(c,h){for(let p=0;p<c.local.length;p++){let m=c.local[p].map(r,i,h);m?t.push(m):a.onRemove&&a.onRemove(c.local[p].spec)}for(let p=0;p<c.children.length;p+=3)u(c.children[p+2],c.children[p]+h+1)}for(let c=0;c<n.length;c+=3)n[c+1]==-1&&u(n[c+2],e[c]+s+1);return t}function T0(n,e,t){if(e.isLeaf)return null;let r=t+e.nodeSize,i=null;for(let s=0,a;s<n.length;s++)(a=n[s])&&a.from>t&&a.to<r&&((i||(i=[])).push(a),n[s]=null);return i}function O0(n){let e=[];for(let t=0;t<n.length;t++)n[t]!=null&&e.push(n[t]);return e}function Ma(n,e,t,r){let i=[],s=!1;e.forEach((u,c)=>{let h=T0(n,u,c+t);if(h){s=!0;let p=Ma(h,u,t+c+1,r);p!=ft&&i.push(c,c+u.nodeSize,p)}});let a=A0(s?O0(n):n,-t).sort(Ur);for(let u=0;u<a.length;u++)a[u].type.valid(e,a[u])||(r.onRemove&&r.onRemove(a[u].spec),a.splice(u--,1));return a.length||i.length?new Ye(a,i):ft}function Ur(n,e){return n.from-e.from||n.to-e.to}function cf(n){let e=n;for(let t=0;t<e.length-1;t++){let r=e[t];if(r.from!=r.to)for(let i=t+1;i<e.length;i++){let s=e[i];if(s.from==r.from){s.to!=r.to&&(e==n&&(e=n.slice()),e[i]=s.copy(s.from,r.to),M0(e,i+1,s.copy(r.to,s.to)));continue}else{s.from<r.to&&(e==n&&(e=n.slice()),e[t]=r.copy(r.from,s.from),M0(e,i,r.copy(s.from,r.to)));break}}}return e}function M0(n,e,t){for(;e<n.length&&Ur(t,n[e])>0;)e++;n.splice(e,0,t)}for(var yr={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:"'"},Ia={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},tA=typeof navigator<"u"&&/Mac/.test(navigator.platform),nA=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),tt=0;tt<10;tt++)yr[48+tt]=yr[96+tt]=String(tt);for(var tt=1;tt<=24;tt++)yr[tt+111]="F"+tt;for(var tt=65;tt<=90;tt++)yr[tt]=String.fromCharCode(tt+32),Ia[tt]=String.fromCharCode(tt);for(var ff in yr)Ia.hasOwnProperty(ff)||(Ia[ff]=yr[ff]);function rA(n){var e=tA&&n.metaKey&&n.shiftKey&&!n.ctrlKey&&!n.altKey||nA&&n.shiftKey&&n.key&&n.key.length==1||n.key=="Unidentified",t=!e&&n.key||(n.shiftKey?Ia:yr)[n.keyCode]||n.key||"Unidentified";return t=="Esc"&&(t="Escape"),t=="Del"&&(t="Delete"),t=="Left"&&(t="ArrowLeft"),t=="Up"&&(t="ArrowUp"),t=="Right"&&(t="ArrowRight"),t=="Down"&&(t="ArrowDown"),t}const iA=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function sA(n){let e=n.split(/-(?!$)/),t=e[e.length-1];t=="Space"&&(t=" ");let r,i,s,a;for(let u=0;u<e.length-1;u++){let c=e[u];if(/^(cmd|meta|m)$/i.test(c))a=!0;else if(/^a(lt)?$/i.test(c))r=!0;else if(/^(c|ctrl|control)$/i.test(c))i=!0;else if(/^s(hift)?$/i.test(c))s=!0;else if(/^mod$/i.test(c))iA?a=!0:i=!0;else throw new Error("Unrecognized modifier name: "+c)}return r&&(t="Alt-"+t),i&&(t="Ctrl-"+t),a&&(t="Meta-"+t),s&&(t="Shift-"+t),t}function oA(n){let e=Object.create(null);for(let t in n)e[sA(t)]=n[t];return e}function hf(n,e,t=!0){return e.altKey&&(n="Alt-"+n),e.ctrlKey&&(n="Ctrl-"+n),e.metaKey&&(n="Meta-"+n),t&&e.shiftKey&&(n="Shift-"+n),n}function aA(n){return new ct({props:{handleKeyDown:lA(n)}})}function lA(n){let e=oA(n);return function(t,r){let i=rA(r),s,a=e[hf(i,r)];if(a&&a(t.state,t.dispatch,t))return!0;if(i.length==1&&i!=" "){if(r.shiftKey){let u=e[hf(i,r,!1)];if(u&&u(t.state,t.dispatch,t))return!0}if((r.shiftKey||r.altKey||r.metaKey||i.charCodeAt(0)>127)&&(s=yr[r.keyCode])&&s!=i){let u=e[hf(s,r)];if(u&&u(t.state,t.dispatch,t))return!0}}return!1}}const df=(n,e)=>n.selection.empty?!1:(e&&e(n.tr.deleteSelection().scrollIntoView()),!0);function I0(n,e){let{$cursor:t}=n.selection;return!t||(e?!e.endOfTextblock("backward",n):t.parentOffset>0)?null:t}const N0=(n,e,t)=>{let r=I0(n,t);if(!r)return!1;let i=pf(r);if(!i){let a=r.blockRange(),u=a&&Si(a);return u==null?!1:(e&&e(n.tr.lift(a,u).scrollIntoView()),!0)}let s=i.nodeBefore;if(H0(n,i,e,-1))return!0;if(r.parent.content.size==0&&(Ti(s,"end")||Q.isSelectable(s)))for(let a=r.depth;;a--){let u=xa(n.doc,r.before(a),r.after(a),K.empty);if(u&&u.slice.size<u.to-u.from){if(e){let c=n.tr.step(u);c.setSelection(Ti(s,"end")?ye.findFrom(c.doc.resolve(c.mapping.map(i.pos,-1)),-1):Q.create(c.doc,i.pos-s.nodeSize)),e(c.scrollIntoView())}return!0}if(a==1||r.node(a-1).childCount>1)break}return s.isAtom&&i.depth==r.depth-1?(e&&e(n.tr.delete(i.pos-s.nodeSize,i.pos).scrollIntoView()),!0):!1},uA=(n,e,t)=>{let r=I0(n,t);if(!r)return!1;let i=pf(r);return i?R0(n,i,e):!1},cA=(n,e,t)=>{let r=P0(n,t);if(!r)return!1;let i=mf(r);return i?R0(n,i,e):!1};function R0(n,e,t){let r=e.nodeBefore,i=r,s=e.pos-1;for(;!i.isTextblock;s--){if(i.type.spec.isolating)return!1;let p=i.lastChild;if(!p)return!1;i=p}let a=e.nodeAfter,u=a,c=e.pos+1;for(;!u.isTextblock;c++){if(u.type.spec.isolating)return!1;let p=u.firstChild;if(!p)return!1;u=p}let h=xa(n.doc,s,c,K.empty);if(!h||h.from!=s||h instanceof je&&h.slice.size>=c-s)return!1;if(t){let p=n.tr.step(h);p.setSelection(pe.create(p.doc,s)),t(p.scrollIntoView())}return!0}function Ti(n,e,t=!1){for(let r=n;r;r=e=="start"?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(t&&r.childCount!=1)return!1}return!1}const L0=(n,e,t)=>{let{$head:r,empty:i}=n.selection,s=r;if(!i)return!1;if(r.parent.isTextblock){if(t?!t.endOfTextblock("backward",n):r.parentOffset>0)return!1;s=pf(r)}let a=s&&s.nodeBefore;return!a||!Q.isSelectable(a)?!1:(e&&e(n.tr.setSelection(Q.create(n.doc,s.pos-a.nodeSize)).scrollIntoView()),!0)};function pf(n){if(!n.parent.type.spec.isolating)for(let e=n.depth-1;e>=0;e--){if(n.index(e)>0)return n.doc.resolve(n.before(e+1));if(n.node(e).type.spec.isolating)break}return null}function P0(n,e){let{$cursor:t}=n.selection;return!t||(e?!e.endOfTextblock("forward",n):t.parentOffset<t.parent.content.size)?null:t}const D0=(n,e,t)=>{let r=P0(n,t);if(!r)return!1;let i=mf(r);if(!i)return!1;let s=i.nodeAfter;if(H0(n,i,e,1))return!0;if(r.parent.content.size==0&&(Ti(s,"start")||Q.isSelectable(s))){let a=xa(n.doc,r.before(),r.after(),K.empty);if(a&&a.slice.size<a.to-a.from){if(e){let u=n.tr.step(a);u.setSelection(Ti(s,"start")?ye.findFrom(u.doc.resolve(u.mapping.map(i.pos)),1):Q.create(u.doc,u.mapping.map(i.pos))),e(u.scrollIntoView())}return!0}}return s.isAtom&&i.depth==r.depth-1?(e&&e(n.tr.delete(i.pos,i.pos+s.nodeSize).scrollIntoView()),!0):!1},F0=(n,e,t)=>{let{$head:r,empty:i}=n.selection,s=r;if(!i)return!1;if(r.parent.isTextblock){if(t?!t.endOfTextblock("forward",n):r.parentOffset<r.parent.content.size)return!1;s=mf(r)}let a=s&&s.nodeAfter;return!a||!Q.isSelectable(a)?!1:(e&&e(n.tr.setSelection(Q.create(n.doc,s.pos)).scrollIntoView()),!0)};function mf(n){if(!n.parent.type.spec.isolating)for(let e=n.depth-1;e>=0;e--){let t=n.node(e);if(n.index(e)+1<t.childCount)return n.doc.resolve(n.after(e+1));if(t.type.spec.isolating)break}return null}const fA=(n,e)=>{let t=n.selection,r=t instanceof Q,i;if(r){if(t.node.isTextblock||!hr(n.doc,t.from))return!1;i=t.from}else if(i=Sa(n.doc,t.from,-1),i==null)return!1;if(e){let s=n.tr.join(i);r&&s.setSelection(Q.create(s.doc,i-n.doc.resolve(i).nodeBefore.nodeSize)),e(s.scrollIntoView())}return!0},hA=(n,e)=>{let t=n.selection,r;if(t instanceof Q){if(t.node.isTextblock||!hr(n.doc,t.to))return!1;r=t.to}else if(r=Sa(n.doc,t.to,1),r==null)return!1;return e&&e(n.tr.join(r).scrollIntoView()),!0},dA=(n,e)=>{let{$from:t,$to:r}=n.selection,i=t.blockRange(r),s=i&&Si(i);return s==null?!1:(e&&e(n.tr.lift(i,s).scrollIntoView()),!0)},B0=(n,e)=>{let{$head:t,$anchor:r}=n.selection;return!t.parent.type.spec.code||!t.sameParent(r)?!1:(e&&e(n.tr.insertText(`
|
|
38
|
-
`).scrollIntoView()),!0)};function gf(n){for(let e=0;e<n.edgeCount;e++){let{type:t}=n.edge(e);if(t.isTextblock&&!t.hasRequiredAttrs())return t}return null}const pA=(n,e)=>{let{$head:t,$anchor:r}=n.selection;if(!t.parent.type.spec.code||!t.sameParent(r))return!1;let i=t.node(-1),s=t.indexAfter(-1),a=gf(i.contentMatchAt(s));if(!a||!i.canReplaceWith(s,s,a))return!1;if(e){let u=t.after(),c=n.tr.replaceWith(u,u,a.createAndFill());c.setSelection(ye.near(c.doc.resolve(u),1)),e(c.scrollIntoView())}return!0},z0=(n,e)=>{let t=n.selection,{$from:r,$to:i}=t;if(t instanceof Rt||r.parent.inlineContent||i.parent.inlineContent)return!1;let s=gf(i.parent.contentMatchAt(i.indexAfter()));if(!s||!s.isTextblock)return!1;if(e){let a=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,u=n.tr.insert(a,s.createAndFill());u.setSelection(pe.create(u.doc,a+1)),e(u.scrollIntoView())}return!0},$0=(n,e)=>{let{$cursor:t}=n.selection;if(!t||t.parent.content.size)return!1;if(t.depth>1&&t.after()!=t.end(-1)){let s=t.before();if(zn(n.doc,s))return e&&e(n.tr.split(s).scrollIntoView()),!0}let r=t.blockRange(),i=r&&Si(r);return i==null?!1:(e&&e(n.tr.lift(r,i).scrollIntoView()),!0)};function mA(n){return(e,t)=>{let{$from:r,$to:i}=e.selection;if(e.selection instanceof Q&&e.selection.node.isBlock)return!r.parentOffset||!zn(e.doc,r.pos)?!1:(t&&t(e.tr.split(r.pos).scrollIntoView()),!0);if(!r.depth)return!1;let s=[],a,u,c=!1,h=!1;for(let _=r.depth;;_--)if(r.node(_).isBlock){c=r.end(_)==r.pos+(r.depth-_),h=r.start(_)==r.pos-(r.depth-_),u=gf(r.node(_-1).contentMatchAt(r.indexAfter(_-1))),s.unshift(c&&u?{type:u}:null),a=_;break}else{if(_==1)return!1;s.unshift(null)}let p=e.tr;(e.selection instanceof pe||e.selection instanceof Rt)&&p.deleteSelection();let m=p.mapping.map(r.pos),y=zn(p.doc,m,s.length,s);if(y||(s[0]=u?{type:u}:null,y=zn(p.doc,m,s.length,s)),p.split(m,s.length,s),!c&&h&&r.node(a).type!=u){let _=p.mapping.map(r.before(a)),S=p.doc.resolve(_);u&&r.node(a-1).canReplaceWith(S.index(),S.index()+1,u)&&p.setNodeMarkup(p.mapping.map(r.before(a)),u)}return t&&t(p.scrollIntoView()),!0}}const gA=mA(),yA=(n,e)=>{let{$from:t,to:r}=n.selection,i,s=t.sharedDepth(r);return s==0?!1:(i=t.before(s),e&&e(n.tr.setSelection(Q.create(n.doc,i))),!0)};function bA(n,e,t){let r=e.nodeBefore,i=e.nodeAfter,s=e.index();return!r||!i||!r.type.compatibleContent(i.type)?!1:!r.content.size&&e.parent.canReplace(s-1,s)?(t&&t(n.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(s,s+1)||!(i.isTextblock||hr(n.doc,e.pos))?!1:(t&&t(n.tr.join(e.pos).scrollIntoView()),!0)}function H0(n,e,t,r){let i=e.nodeBefore,s=e.nodeAfter,a,u,c=i.type.spec.isolating||s.type.spec.isolating;if(!c&&bA(n,e,t))return!0;let h=!c&&e.parent.canReplace(e.index(),e.index()+1);if(h&&(a=(u=i.contentMatchAt(i.childCount)).findWrapping(s.type))&&u.matchType(a[0]||s.type).validEnd){if(t){let _=e.pos+s.nodeSize,S=z.empty;for(let g=a.length-1;g>=0;g--)S=z.from(a[g].create(null,S));S=z.from(i.copy(S));let E=n.tr.step(new Je(e.pos-1,_,e.pos,_,new K(S,1,0),a.length,!0)),N=E.doc.resolve(_+2*a.length);N.nodeAfter&&N.nodeAfter.type==i.type&&hr(E.doc,N.pos)&&E.join(N.pos),t(E.scrollIntoView())}return!0}let p=s.type.spec.isolating||r>0&&c?null:ye.findFrom(e,1),m=p&&p.$from.blockRange(p.$to),y=m&&Si(m);if(y!=null&&y>=e.depth)return t&&t(n.tr.lift(m,y).scrollIntoView()),!0;if(h&&Ti(s,"start",!0)&&Ti(i,"end")){let _=i,S=[];for(;S.push(_),!_.isTextblock;)_=_.lastChild;let E=s,N=1;for(;!E.isTextblock;E=E.firstChild)N++;if(_.canReplace(_.childCount,_.childCount,E.content)){if(t){let g=z.empty;for(let k=S.length-1;k>=0;k--)g=z.from(S[k].copy(g));let v=n.tr.step(new Je(e.pos-S.length,e.pos+s.nodeSize,e.pos+N,e.pos+s.nodeSize-N,new K(g,S.length,0),0,!0));t(v.scrollIntoView())}return!0}}return!1}function W0(n){return function(e,t){let r=e.selection,i=n<0?r.$from:r.$to,s=i.depth;for(;i.node(s).isInline;){if(!s)return!1;s--}return i.node(s).isTextblock?(t&&t(e.tr.setSelection(pe.create(e.doc,n<0?i.start(s):i.end(s)))),!0):!1}}const _A=W0(-1),wA=W0(1);function vA(n,e=null){return function(t,r){let{$from:i,$to:s}=t.selection,a=i.blockRange(s),u=a&&Vc(a,n,e);return u?(r&&r(t.tr.wrap(a,u).scrollIntoView()),!0):!1}}function V0(n,e=null){return function(t,r){let i=!1;for(let s=0;s<t.selection.ranges.length&&!i;s++){let{$from:{pos:a},$to:{pos:u}}=t.selection.ranges[s];t.doc.nodesBetween(a,u,(c,h)=>{if(i)return!1;if(!(!c.isTextblock||c.hasMarkup(n,e)))if(c.type==n)i=!0;else{let p=t.doc.resolve(h),m=p.index();i=p.parent.canReplaceWith(m,m+1,n)}})}if(!i)return!1;if(r){let s=t.tr;for(let a=0;a<t.selection.ranges.length;a++){let{$from:{pos:u},$to:{pos:c}}=t.selection.ranges[a];s.setBlockType(u,c,n,e)}r(s.scrollIntoView())}return!0}}function yf(...n){return function(e,t,r){for(let i=0;i<n.length;i++)if(n[i](e,t,r))return!0;return!1}}yf(df,N0,L0),yf(df,D0,F0),yf(B0,z0,$0,gA),typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function SA(n,e=null){return function(t,r){let{$from:i,$to:s}=t.selection,a=i.blockRange(s);if(!a)return!1;let u=r?t.tr:null;return xA(u,a,n,e)?(r&&r(u.scrollIntoView()),!0):!1}}function xA(n,e,t,r=null){let i=!1,s=e,a=e.$from.doc;if(e.depth>=2&&e.$from.node(e.depth-1).type.compatibleContent(t)&&e.startIndex==0){if(e.$from.index(e.depth-1)==0)return!1;let c=a.resolve(e.start-2);s=new ya(c,c,e.depth),e.endIndex<e.parent.childCount&&(e=new ya(e.$from,a.resolve(e.$to.end(e.depth)),e.depth)),i=!0}let u=Vc(s,t,r,e);return u?(n&&CA(n,e,u,i,t),!0):!1}function CA(n,e,t,r,i){let s=z.empty;for(let p=t.length-1;p>=0;p--)s=z.from(t[p].type.create(t[p].attrs,s));n.step(new Je(e.start-(r?2:0),e.end,e.start,e.end,new K(s,0,0),t.length,!0));let a=0;for(let p=0;p<t.length;p++)t[p].type==i&&(a=p+1);let u=t.length-a,c=e.start+t.length-(r?2:0),h=e.parent;for(let p=e.startIndex,m=e.endIndex,y=!0;p<m;p++,y=!1)!y&&zn(n.doc,c,u)&&(n.split(c,u),c+=2*u),c+=h.child(p).nodeSize;return n}function EA(n){return function(e,t){let{$from:r,$to:i}=e.selection,s=r.blockRange(i,a=>a.childCount>0&&a.firstChild.type==n);return s?t?r.node(s.depth-1).type==n?kA(e,t,n,s):AA(e,t,s):!0:!1}}function kA(n,e,t,r){let i=n.tr,s=r.end,a=r.$to.end(r.depth);s<a&&(i.step(new Je(s-1,a,s,a,new K(z.from(t.create(null,r.parent.copy())),1,0),1,!0)),r=new ya(i.doc.resolve(r.$from.pos),i.doc.resolve(a),r.depth));const u=Si(r);if(u==null)return!1;i.lift(r,u);let c=i.mapping.map(s,-1)-1;return hr(i.doc,c)&&i.join(c),e(i.scrollIntoView()),!0}function AA(n,e,t){let r=n.tr,i=t.parent;for(let _=t.end,S=t.endIndex-1,E=t.startIndex;S>E;S--)_-=i.child(S).nodeSize,r.delete(_-1,_+1);let s=r.doc.resolve(t.start),a=s.nodeAfter;if(r.mapping.map(t.end)!=t.start+s.nodeAfter.nodeSize)return!1;let u=t.startIndex==0,c=t.endIndex==i.childCount,h=s.node(-1),p=s.index(-1);if(!h.canReplace(p+(u?0:1),p+1,a.content.append(c?z.empty:z.from(i))))return!1;let m=s.pos,y=m+a.nodeSize;return r.step(new Je(m-(u?1:0),y+(c?1:0),m+1,y-1,new K((u?z.empty:z.from(i.copy(z.empty))).append(c?z.empty:z.from(i.copy(z.empty))),u?0:1,c?0:1),u?0:1)),e(r.scrollIntoView()),!0}function TA(n){return function(e,t){let{$from:r,$to:i}=e.selection,s=r.blockRange(i,h=>h.childCount>0&&h.firstChild.type==n);if(!s)return!1;let a=s.startIndex;if(a==0)return!1;let u=s.parent,c=u.child(a-1);if(c.type!=n)return!1;if(t){let h=c.lastChild&&c.lastChild.type==u.type,p=z.from(h?n.create():null),m=new K(z.from(n.create(null,z.from(u.type.create(null,p)))),h?3:1,0),y=s.start,_=s.end;t(e.tr.step(new Je(y-(h?3:1),_,y,_,m,1,!0)).scrollIntoView())}return!0}}function Na(n){const{state:e,transaction:t}=n;let{selection:r}=t,{doc:i}=t,{storedMarks:s}=t;return{...e,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return s},get selection(){return r},get doc(){return i},get tr(){return r=t.selection,i=t.doc,s=t.storedMarks,t}}}class bf{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:e,editor:t,state:r}=this,{view:i}=t,{tr:s}=r,a=this.buildProps(s);return Object.fromEntries(Object.entries(e).map(([u,c])=>[u,(...p)=>{const m=c(...p)(a);return!s.getMeta("preventDispatch")&&!this.hasCustomState&&i.dispatch(s),m}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,t=!0){const{rawCommands:r,editor:i,state:s}=this,{view:a}=i,u=[],c=!!e,h=e||s.tr,p=()=>(!c&&t&&!h.getMeta("preventDispatch")&&!this.hasCustomState&&a.dispatch(h),u.every(y=>y===!0)),m={...Object.fromEntries(Object.entries(r).map(([y,_])=>[y,(...E)=>{const N=this.buildProps(h,t),g=_(...E)(N);return u.push(g),m}])),run:p};return m}createCan(e){const{rawCommands:t,state:r}=this,i=!1,s=e||r.tr,a=this.buildProps(s,i);return{...Object.fromEntries(Object.entries(t).map(([c,h])=>[c,(...p)=>h(...p)({...a,dispatch:void 0})])),chain:()=>this.createChain(s,i)}}buildProps(e,t=!0){const{rawCommands:r,editor:i,state:s}=this,{view:a}=i,u={tr:e,editor:i,view:a,state:Na({state:s,transaction:e}),dispatch:t?()=>{}:void 0,chain:()=>this.createChain(e,t),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(r).map(([c,h])=>[c,(...p)=>h(...p)(u)]))}};return u}}function J(n,e,t){return n.config[e]===void 0&&n.parent?J(n.parent,e,t):typeof n.config[e]=="function"?n.config[e].bind({...t,parent:n.parent?J(n.parent,e,t):null}):n.config[e]}function Ra(n){const e=n.filter(i=>i.type==="extension"),t=n.filter(i=>i.type==="node"),r=n.filter(i=>i.type==="mark");return{baseExtensions:e,nodeExtensions:t,markExtensions:r}}function U0(n){const e=[],{nodeExtensions:t,markExtensions:r}=Ra(n),i=[...t,...r],s={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return n.forEach(a=>{const u={name:a.name,options:a.options,storage:a.storage,extensions:i},c=J(a,"addGlobalAttributes",u);if(!c)return;c().forEach(p=>{p.types.forEach(m=>{Object.entries(p.attributes).forEach(([y,_])=>{e.push({type:m,name:y,attribute:{...s,..._}})})})})}),i.forEach(a=>{const u={name:a.name,options:a.options,storage:a.storage},c=J(a,"addAttributes",u);if(!c)return;const h=c();Object.entries(h).forEach(([p,m])=>{const y={...s,...m};typeof y?.default=="function"&&(y.default=y.default()),y?.isRequired&&y?.default===void 0&&delete y.default,e.push({type:a.name,name:p,attribute:y})})}),e}function qe(n,e){if(typeof n=="string"){if(!e.nodes[n])throw Error(`There is no node type named '${n}'. Maybe you forgot to add the extension?`);return e.nodes[n]}return n}function Oi(...n){return n.filter(e=>!!e).reduce((e,t)=>{const r={...e};return Object.entries(t).forEach(([i,s])=>{if(!r[i]){r[i]=s;return}if(i==="class"){const u=s?String(s).split(" "):[],c=r[i]?r[i].split(" "):[],h=u.filter(p=>!c.includes(p));r[i]=[...c,...h].join(" ")}else if(i==="style"){const u=s?s.split(";").map(p=>p.trim()).filter(Boolean):[],c=r[i]?r[i].split(";").map(p=>p.trim()).filter(Boolean):[],h=new Map;c.forEach(p=>{const[m,y]=p.split(":").map(_=>_.trim());h.set(m,y)}),u.forEach(p=>{const[m,y]=p.split(":").map(_=>_.trim());h.set(m,y)}),r[i]=Array.from(h.entries()).map(([p,m])=>`${p}: ${m}`).join("; ")}else r[i]=s}),r},{})}function _f(n,e){return e.filter(t=>t.type===n.type.name).filter(t=>t.attribute.rendered).map(t=>t.attribute.renderHTML?t.attribute.renderHTML(n.attrs)||{}:{[t.name]:n.attrs[t.name]}).reduce((t,r)=>Oi(t,r),{})}function OA(n){return typeof n=="function"}function de(n,e=void 0,...t){return OA(n)?e?n.bind(e)(...t):n(...t):n}function MA(n={}){return Object.keys(n).length===0&&n.constructor===Object}function IA(n){return typeof n!="string"?n:n.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(n):n==="true"?!0:n==="false"?!1:n}function q0(n,e){return"style"in n?n:{...n,getAttrs:t=>{const r=n.getAttrs?n.getAttrs(t):n.attrs;if(r===!1)return!1;const i=e.reduce((s,a)=>{const u=a.attribute.parseHTML?a.attribute.parseHTML(t):IA(t.getAttribute(a.name));return u==null?s:{...s,[a.name]:u}},{});return{...r,...i}}}}function K0(n){return Object.fromEntries(Object.entries(n).filter(([e,t])=>e==="attrs"&&MA(t)?!1:t!=null))}function G0(n,e){var t;const r=U0(n),{nodeExtensions:i,markExtensions:s}=Ra(n),a=(t=i.find(h=>J(h,"topNode")))===null||t===void 0?void 0:t.name,u=Object.fromEntries(i.map(h=>{const p=r.filter(g=>g.type===h.name),m={name:h.name,options:h.options,storage:h.storage,editor:e},y=n.reduce((g,v)=>{const k=J(v,"extendNodeSchema",m);return{...g,...k?k(h):{}}},{}),_=K0({...y,content:de(J(h,"content",m)),marks:de(J(h,"marks",m)),group:de(J(h,"group",m)),inline:de(J(h,"inline",m)),atom:de(J(h,"atom",m)),selectable:de(J(h,"selectable",m)),draggable:de(J(h,"draggable",m)),code:de(J(h,"code",m)),whitespace:de(J(h,"whitespace",m)),linebreakReplacement:de(J(h,"linebreakReplacement",m)),defining:de(J(h,"defining",m)),isolating:de(J(h,"isolating",m)),attrs:Object.fromEntries(p.map(g=>{var v;return[g.name,{default:(v=g?.attribute)===null||v===void 0?void 0:v.default}]}))}),S=de(J(h,"parseHTML",m));S&&(_.parseDOM=S.map(g=>q0(g,p)));const E=J(h,"renderHTML",m);E&&(_.toDOM=g=>E({node:g,HTMLAttributes:_f(g,p)}));const N=J(h,"renderText",m);return N&&(_.toText=N),[h.name,_]})),c=Object.fromEntries(s.map(h=>{const p=r.filter(N=>N.type===h.name),m={name:h.name,options:h.options,storage:h.storage,editor:e},y=n.reduce((N,g)=>{const v=J(g,"extendMarkSchema",m);return{...N,...v?v(h):{}}},{}),_=K0({...y,inclusive:de(J(h,"inclusive",m)),excludes:de(J(h,"excludes",m)),group:de(J(h,"group",m)),spanning:de(J(h,"spanning",m)),code:de(J(h,"code",m)),attrs:Object.fromEntries(p.map(N=>{var g;return[N.name,{default:(g=N?.attribute)===null||g===void 0?void 0:g.default}]}))}),S=de(J(h,"parseHTML",m));S&&(_.parseDOM=S.map(N=>q0(N,p)));const E=J(h,"renderHTML",m);return E&&(_.toDOM=N=>E({mark:N,HTMLAttributes:_f(N,p)})),[h.name,_]}));return new yg({topNode:a,nodes:u,marks:c})}function wf(n,e){return e.nodes[n]||e.marks[n]||null}function J0(n,e){return Array.isArray(e)?e.some(t=>(typeof t=="string"?t:t.name)===n.name):e}function j0(n,e){const t=Vs.fromSchema(e).serializeFragment(n),i=document.implementation.createHTMLDocument().createElement("div");return i.appendChild(t),i.innerHTML}const NA=(n,e=500)=>{let t="";const r=n.parentOffset;return n.parent.nodesBetween(Math.max(0,r-e),r,(i,s,a,u)=>{var c,h;const p=((h=(c=i.type.spec).toText)===null||h===void 0?void 0:h.call(c,{node:i,pos:s,parent:a,index:u}))||i.textContent||"%leaf%";t+=i.isAtom&&!i.isText?p:p.slice(0,Math.max(0,r-s))}),t};function vf(n){return Object.prototype.toString.call(n)==="[object RegExp]"}class Y0{constructor(e){this.find=e.find,this.handler=e.handler}}const RA=(n,e)=>{if(vf(e))return e.exec(n);const t=e(n);if(!t)return null;const r=[t.text];return r.index=t.index,r.input=n,r.data=t.data,t.replaceWith&&(t.text.includes(t.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(t.replaceWith)),r};function La(n){var e;const{editor:t,from:r,to:i,text:s,rules:a,plugin:u}=n,{view:c}=t;if(c.composing)return!1;const h=c.state.doc.resolve(r);if(h.parent.type.spec.code||!((e=h.nodeBefore||h.nodeAfter)===null||e===void 0)&&e.marks.find(y=>y.type.spec.code))return!1;let p=!1;const m=NA(h)+s;return a.forEach(y=>{if(p)return;const _=RA(m,y.find);if(!_)return;const S=c.state.tr,E=Na({state:c.state,transaction:S}),N={from:r-(_[0].length-s.length),to:i},{commands:g,chain:v,can:k}=new bf({editor:t,state:E});y.handler({state:E,range:N,match:_,commands:g,chain:v,can:k})===null||!S.steps.length||(S.setMeta(u,{transform:S,from:r,to:i,text:s}),c.dispatch(S),p=!0)}),p}function LA(n){const{editor:e,rules:t}=n,r=new ct({state:{init(){return null},apply(i,s,a){const u=i.getMeta(r);if(u)return u;const c=i.getMeta("applyInputRules");return!!c&&setTimeout(()=>{let{text:p}=c;typeof p=="string"?p=p:p=j0(z.from(p),a.schema);const{from:m}=c,y=m+p.length;La({editor:e,from:m,to:y,text:p,rules:t,plugin:r})}),i.selectionSet||i.docChanged?null:s}},props:{handleTextInput(i,s,a,u){return La({editor:e,from:s,to:a,text:u,rules:t,plugin:r})},handleDOMEvents:{compositionend:i=>(setTimeout(()=>{const{$cursor:s}=i.state.selection;s&&La({editor:e,from:s.pos,to:s.pos,text:"",rules:t,plugin:r})}),!1)},handleKeyDown(i,s){if(s.key!=="Enter")return!1;const{$cursor:a}=i.state.selection;return a?La({editor:e,from:a.pos,to:a.pos,text:`
|
|
39
|
-
`,rules:t,plugin:r}):!1}},isInputRules:!0});return r}function
|
|
36
|
+
`);return{dom:c,text:y,slice:e}}function Y0(n,e,t,r,i){let s=i.parent.type.spec.code,a,u;if(!t&&!e)return null;let c=e&&(r||s||!t);if(c){if(n.someProp("transformPastedText",y=>{e=y(e,s||r,n)}),s)return e?new K(V.from(n.state.schema.text(e.replace(/\r\n?/g,`
|
|
37
|
+
`))),0,0):K.empty;let d=n.someProp("clipboardTextParser",y=>y(e,i,r,n));if(d)u=d;else{let y=i.marks(),{schema:_}=n.state,v=io.fromSchema(_);a=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(E=>{let N=a.appendChild(document.createElement("p"));E&&N.appendChild(v.serializeNode(_.text(E,y)))})}}else n.someProp("transformPastedHTML",d=>{t=d(t,n)}),a=DT(t),xf&&$T(a);let h=a&&a.querySelector("[data-pm-slice]"),m=h&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(h.getAttribute("data-pm-slice")||"");if(m&&m[3])for(let d=+m[3];d>0;d--){let y=a.firstChild;for(;y&&y.nodeType!=1;)y=y.nextSibling;if(!y)break;a=y}if(u||(u=(n.someProp("clipboardParser")||n.someProp("domParser")||Rs.fromSchema(n.state.schema)).parseSlice(a,{preserveWhitespace:!!(c||m),context:i,ruleFromNode(y){return y.nodeName=="BR"&&!y.nextSibling&&y.parentNode&&!RT.test(y.parentNode.nodeName)?{ignore:!0}:null}})),m)u=FT(e1(u,+m[1],+m[2]),m[4]);else if(u=K.maxOpen(LT(u.content,i),!0),u.openStart||u.openEnd){let d=0,y=0;for(let _=u.content.firstChild;d<u.openStart&&!_.type.spec.isolating;d++,_=_.firstChild);for(let _=u.content.lastChild;y<u.openEnd&&!_.type.spec.isolating;y++,_=_.lastChild);u=e1(u,d,y)}return n.someProp("transformPasted",d=>{u=d(u,n)}),u}const RT=/^(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 LT(n,e){if(n.childCount<2)return n;for(let t=e.depth;t>=0;t--){let i=e.node(t).contentMatchAt(e.index(t)),s,a=[];if(n.forEach(u=>{if(!a)return;let c=i.findWrapping(u.type),h;if(!c)return a=null;if(h=a.length&&s.length&&Z0(c,s,u,a[a.length-1],0))a[a.length-1]=h;else{a.length&&(a[a.length-1]=Q0(a[a.length-1],s.length));let m=X0(u,c);a.push(m),i=i.matchType(m.type),s=c}}),a)return V.from(a)}return n}function X0(n,e,t=0){for(let r=e.length-1;r>=t;r--)n=e[r].create(null,V.from(n));return n}function Z0(n,e,t,r,i){if(i<n.length&&i<e.length&&n[i]==e[i]){let s=Z0(n,e,t,r.lastChild,i+1);if(s)return r.copy(r.content.replaceChild(r.childCount-1,s));if(r.contentMatchAt(r.childCount).matchType(i==n.length-1?t.type:n[i+1]))return r.copy(r.content.append(V.from(X0(t,n,i+1))))}}function Q0(n,e){if(e==0)return n;let t=n.content.replaceChild(n.childCount-1,Q0(n.lastChild,e-1)),r=n.contentMatchAt(n.childCount).fillBefore(V.empty,!0);return n.copy(t.append(r))}function Af(n,e,t,r,i,s){let a=e<0?n.firstChild:n.lastChild,u=a.content;return n.childCount>1&&(s=0),i<r-1&&(u=Af(u,e,t,r,i+1,s)),i>=t&&(u=e<0?a.contentMatchAt(0).fillBefore(u,s<=i).append(u):u.append(a.contentMatchAt(a.childCount).fillBefore(V.empty,!0))),n.replaceChild(e<0?0:n.childCount-1,a.copy(u))}function e1(n,e,t){return e<n.openStart&&(n=new K(Af(n.content,-1,e,n.openStart,0,n.openEnd),e,n.openEnd)),t<n.openEnd&&(n=new K(Af(n.content,1,t,n.openEnd,0,0),n.openStart,t)),n}const t1={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};let n1=null;function r1(){return n1||(n1=document.implementation.createHTMLDocument("title"))}let Of=null;function PT(n){let e=window.trustedTypes;return e?(Of||(Of=e.createPolicy("ProseMirrorClipboard",{createHTML:t=>t})),Of.createHTML(n)):n}function DT(n){let e=/^(\s*<meta [^>]*>)*/.exec(n);e&&(n=n.slice(e[0].length));let t=r1().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(n),i;if((i=r&&t1[r[1].toLowerCase()])&&(n=i.map(s=>"<"+s+">").join("")+n+i.map(s=>"</"+s+">").reverse().join("")),t.innerHTML=PT(n),i)for(let s=0;s<i.length;s++)t=t.querySelector(i[s])||t;return t}function $T(n){let e=n.querySelectorAll(br?"span:not([class]):not([style])":"span.Apple-converted-space");for(let t=0;t<e.length;t++){let r=e[t];r.childNodes.length==1&&r.textContent=="\xA0"&&r.parentNode&&r.parentNode.replaceChild(n.ownerDocument.createTextNode(" "),r)}}function FT(n,e){if(!n.size)return n;let t=n.content.firstChild.type.schema,r;try{r=JSON.parse(e)}catch{return n}let{content:i,openStart:s,openEnd:a}=n;for(let u=r.length-2;u>=0;u-=2){let c=t.nodes[r[u]];if(!c||c.hasRequiredAttrs())break;i=V.from(c.create(r[u+1],i)),s++,a++}return new K(i,s,a)}const ln={},Nt={};function wr(n,e){n.input.lastSelectionOrigin=e,n.input.lastSelectionTime=Date.now()}Nt.keydown=(n,e)=>{let t=e;if(n.input.shiftKey=t.keyCode==16||t.shiftKey,!s1(n,t)&&(n.input.lastKeyCode=t.keyCode,n.input.lastKeyCodeTime=Date.now(),!(Fs&&br&&t.keyCode==13)))if(t.keyCode!=229&&n.domObserver.forceFlush(),Sf&&t.keyCode==13&&!t.ctrlKey&&!t.altKey&&!t.metaKey){let r=Date.now();n.input.lastIOSEnter=r,n.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{n.input.lastIOSEnter==r&&(n.someProp("handleKeyDown",i=>i(n,N0(13,"Enter"))),n.input.lastIOSEnter=0)},200)}else n.someProp("handleKeyDown",r=>r(n,t))||NT(n,t)?t.preventDefault():wr(n,"key")},Nt.keyup=(n,e)=>{e.keyCode==16&&(n.input.shiftKey=!1)},Nt.keypress=(n,e)=>{let t=e;if(s1(n,t)||!t.charCode||t.ctrlKey&&!t.altKey||Gt&&t.metaKey)return;if(n.someProp("handleKeyPress",i=>i(n,t))){t.preventDefault();return}let r=n.state.selection;if(!(r instanceof pe)||!r.$from.sameParent(r.$to)){let i=String.fromCharCode(t.charCode);!/[\r\n]/.test(i)&&!n.someProp("handleTextInput",s=>s(n,r.$from.pos,r.$to.pos,i))&&n.dispatch(n.state.tr.insertText(i).scrollIntoView()),t.preventDefault()}};function Va(n){return{left:n.clientX,top:n.clientY}}function BT(n,e){let t=e.x-n.clientX,r=e.y-n.clientY;return t*t+r*r<100}function Mf(n,e,t,r,i){if(r==-1)return!1;let s=n.state.doc.resolve(r);for(let a=s.depth+1;a>0;a--)if(n.someProp(e,u=>a>s.depth?u(n,t,s.nodeAfter,s.before(a),i,!0):u(n,t,s.node(a),s.before(a),i,!1)))return!0;return!1}function Di(n,e,t){if(n.focused||n.focus(),n.state.selection.eq(e))return;let r=n.state.tr.setSelection(e);r.setMeta("pointer",!0),n.dispatch(r)}function zT(n,e){if(e==-1)return!1;let t=n.state.doc.resolve(e),r=t.nodeAfter;return r&&r.isAtom&&Q.isSelectable(r)?(Di(n,new Q(t)),!0):!1}function HT(n,e){if(e==-1)return!1;let t=n.state.selection,r,i;t instanceof Q&&(r=t.node);let s=n.state.doc.resolve(e);for(let a=s.depth+1;a>0;a--){let u=a>s.depth?s.nodeAfter:s.node(a);if(Q.isSelectable(u)){r&&t.$from.depth>0&&a>=t.$from.depth&&s.before(t.$from.depth+1)==t.$from.pos?i=s.before(t.$from.depth):i=s.before(a);break}}return i!=null?(Di(n,Q.create(n.state.doc,i)),!0):!1}function WT(n,e,t,r,i){return Mf(n,"handleClickOn",e,t,r)||n.someProp("handleClick",s=>s(n,e,r))||(i?HT(n,t):zT(n,t))}function VT(n,e,t,r){return Mf(n,"handleDoubleClickOn",e,t,r)||n.someProp("handleDoubleClick",i=>i(n,e,r))}function UT(n,e,t,r){return Mf(n,"handleTripleClickOn",e,t,r)||n.someProp("handleTripleClick",i=>i(n,e,r))||qT(n,t,r)}function qT(n,e,t){if(t.button!=0)return!1;let r=n.state.doc;if(e==-1)return r.inlineContent?(Di(n,pe.create(r,0,r.content.size)),!0):!1;let i=r.resolve(e);for(let s=i.depth+1;s>0;s--){let a=s>i.depth?i.nodeAfter:i.node(s),u=i.before(s);if(a.inlineContent)Di(n,pe.create(r,u+1,u+1+a.content.size));else if(Q.isSelectable(a))Di(n,Q.create(r,u));else continue;return!0}}function If(n){return Ua(n)}const i1=Gt?"metaKey":"ctrlKey";ln.mousedown=(n,e)=>{let t=e;n.input.shiftKey=t.shiftKey;let r=If(n),i=Date.now(),s="singleClick";i-n.input.lastClick.time<500&&BT(t,n.input.lastClick)&&!t[i1]&&(n.input.lastClick.type=="singleClick"?s="doubleClick":n.input.lastClick.type=="doubleClick"&&(s="tripleClick")),n.input.lastClick={time:i,x:t.clientX,y:t.clientY,type:s};let a=n.posAtCoords(Va(t));a&&(s=="singleClick"?(n.input.mouseDown&&n.input.mouseDown.done(),n.input.mouseDown=new KT(n,a,t,!!r)):(s=="doubleClick"?VT:UT)(n,a.pos,a.inside,t)?t.preventDefault():wr(n,"pointer"))};class KT{constructor(e,t,r,i){this.view=e,this.pos=t,this.event=r,this.flushed=i,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!r[i1],this.allowDefault=r.shiftKey;let s,a;if(t.inside>-1)s=e.state.doc.nodeAt(t.inside),a=t.inside;else{let m=e.state.doc.resolve(t.pos);s=m.parent,a=m.depth?m.before():0}const u=i?null:r.target,c=u?e.docView.nearestDesc(u,!0):null;this.target=c&&c.dom.nodeType==1?c.dom:null;let{selection:h}=e.state;(r.button==0&&s.type.spec.draggable&&s.type.spec.selectable!==!1||h instanceof Q&&h.from<=a&&h.to>a)&&(this.mightDrag={node:s,pos:a,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&Ha&&!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()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),wr(e,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),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(()=>Ef(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let t=this.pos;this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(Va(e))),this.updateAllowDefault(e),this.allowDefault||!t?wr(this.view,"pointer"):WT(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||Jr&&this.mightDrag&&!this.mightDrag.node.isAtom||br&&!this.view.state.selection.visible&&Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to))<=2)?(Di(this.view,ye.near(this.view.state.doc.resolve(t.pos))),e.preventDefault()):wr(this.view,"pointer")}move(e){this.updateAllowDefault(e),wr(this.view,"pointer"),e.buttons==0&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}}ln.touchstart=n=>{n.input.lastTouch=Date.now(),If(n),wr(n,"pointer")},ln.touchmove=n=>{n.input.lastTouch=Date.now(),wr(n,"pointer")},ln.contextmenu=n=>If(n);function s1(n,e){return n.composing?!0:Jr&&Math.abs(e.timeStamp-n.input.compositionEndedAt)<500?(n.input.compositionEndedAt=-2e8,!0):!1}const GT=Fs?5e3:-1;Nt.compositionstart=Nt.compositionupdate=n=>{if(!n.composing){n.domObserver.flush();let{state:e}=n,t=e.selection.$to;if(e.selection instanceof pe&&(e.storedMarks||!t.textOffset&&t.parentOffset&&t.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)))n.markCursor=n.state.storedMarks||t.marks(),Ua(n,!0),n.markCursor=null;else if(Ua(n,!e.selection.empty),Ha&&e.selection.empty&&t.parentOffset&&!t.textOffset&&t.nodeBefore.marks.length){let r=n.domSelectionRange();for(let i=r.focusNode,s=r.focusOffset;i&&i.nodeType==1&&s!=0;){let a=s<0?i.lastChild:i.childNodes[s-1];if(!a)break;if(a.nodeType==3){let u=n.domSelection();u&&u.collapse(a,a.nodeValue.length);break}else i=a,s=-1}}n.input.composing=!0}o1(n,GT)},Nt.compositionend=(n,e)=>{n.composing&&(n.input.composing=!1,n.input.compositionEndedAt=e.timeStamp,n.input.compositionPendingChanges=n.domObserver.pendingRecords().length?n.input.compositionID:0,n.input.compositionNode=null,n.input.compositionPendingChanges&&Promise.resolve().then(()=>n.domObserver.flush()),n.input.compositionID++,o1(n,20))};function o1(n,e){clearTimeout(n.input.composingTimeout),e>-1&&(n.input.composingTimeout=setTimeout(()=>Ua(n),e))}function JT(n){for(n.composing&&(n.input.composing=!1,n.input.compositionEndedAt=jT());n.input.compositionNodes.length>0;)n.input.compositionNodes.pop().markParentsDirty()}function jT(){let n=document.createEvent("Event");return n.initEvent("event",!0,!0),n.timeStamp}function Ua(n,e=!1){if(!(Fs&&n.domObserver.flushingSoon>=0)){if(n.domObserver.forceFlush(),JT(n),e||n.docView&&n.docView.dirty){let t=vT(n);return t&&!t.eq(n.state.selection)?n.dispatch(n.state.tr.setSelection(t)):(n.markCursor||e)&&!n.state.selection.empty?n.dispatch(n.state.tr.deleteSelection()):n.updateState(n.state),!0}return!1}}function YT(n,e){if(!n.dom.parentNode)return;let t=n.dom.parentNode.appendChild(document.createElement("div"));t.appendChild(e),t.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),i=document.createRange();i.selectNodeContents(e),n.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout(()=>{t.parentNode&&t.parentNode.removeChild(t),n.focus()},50)}const zs=$s&&P0<15||Sf&&wT<604;ln.copy=Nt.cut=(n,e)=>{let t=e,r=n.state.selection,i=t.type=="cut";if(r.empty)return;let s=zs?null:t.clipboardData,a=r.content(),{dom:u,text:c}=j0(n,a);s?(t.preventDefault(),s.clearData(),s.setData("text/html",u.innerHTML),s.setData("text/plain",c)):YT(n,u),i&&n.dispatch(n.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function XT(n){return n.openStart==0&&n.openEnd==0&&n.content.childCount==1?n.content.firstChild:null}function ZT(n,e){if(!n.dom.parentNode)return;let t=n.input.shiftKey||n.state.selection.$from.parent.type.spec.code,r=n.dom.parentNode.appendChild(document.createElement(t?"textarea":"div"));t||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let i=n.input.shiftKey&&n.input.lastKeyCode!=45;setTimeout(()=>{n.focus(),r.parentNode&&r.parentNode.removeChild(r),t?Nf(n,r.value,null,i,e):Nf(n,r.textContent,r.innerHTML,i,e)},50)}function Nf(n,e,t,r,i){let s=Y0(n,e,t,r,n.state.selection.$from);if(n.someProp("handlePaste",c=>c(n,i,s||K.empty)))return!0;if(!s)return!1;let a=XT(s),u=a?n.state.tr.replaceSelectionWith(a,r):n.state.tr.replaceSelection(s);return n.dispatch(u.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function a1(n){let e=n.getData("text/plain")||n.getData("Text");if(e)return e;let t=n.getData("text/uri-list");return t?t.replace(/\r?\n/g," "):""}Nt.paste=(n,e)=>{let t=e;if(n.composing&&!Fs)return;let r=zs?null:t.clipboardData,i=n.input.shiftKey&&n.input.lastKeyCode!=45;r&&Nf(n,a1(r),r.getData("text/html"),i,t)?t.preventDefault():ZT(n,t)};class QT{constructor(e,t,r){this.slice=e,this.move=t,this.node=r}}const l1=Gt?"altKey":"ctrlKey";ln.dragstart=(n,e)=>{let t=e,r=n.input.mouseDown;if(r&&r.done(),!t.dataTransfer)return;let i=n.state.selection,s=i.empty?null:n.posAtCoords(Va(t)),a;if(!(s&&s.pos>=i.from&&s.pos<=(i instanceof Q?i.to-1:i.to))){if(r&&r.mightDrag)a=Q.create(n.state.doc,r.mightDrag.pos);else if(t.target&&t.target.nodeType==1){let d=n.docView.nearestDesc(t.target,!0);d&&d.node.type.spec.draggable&&d!=n.docView&&(a=Q.create(n.state.doc,d.posBefore))}}let u=(a||n.state.selection).content(),{dom:c,text:h,slice:m}=j0(n,u);(!t.dataTransfer.files.length||!br||D0>120)&&t.dataTransfer.clearData(),t.dataTransfer.setData(zs?"Text":"text/html",c.innerHTML),t.dataTransfer.effectAllowed="copyMove",zs||t.dataTransfer.setData("text/plain",h),n.dragging=new QT(m,!t[l1],a)},ln.dragend=n=>{let e=n.dragging;window.setTimeout(()=>{n.dragging==e&&(n.dragging=null)},50)},Nt.dragover=Nt.dragenter=(n,e)=>e.preventDefault(),Nt.drop=(n,e)=>{let t=e,r=n.dragging;if(n.dragging=null,!t.dataTransfer)return;let i=n.posAtCoords(Va(t));if(!i)return;let s=n.state.doc.resolve(i.pos),a=r&&r.slice;a?n.someProp("transformPasted",v=>{a=v(a,n)}):a=Y0(n,a1(t.dataTransfer),zs?null:t.dataTransfer.getData("text/html"),!1,s);let u=!!(r&&!t[l1]);if(n.someProp("handleDrop",v=>v(n,t,a||K.empty,u))){t.preventDefault();return}if(!a)return;t.preventDefault();let c=a?aT(n.state.doc,s.pos,a):s.pos;c==null&&(c=s.pos);let h=n.state.tr;if(u){let{node:v}=r;v?v.replace(h):h.deleteSelection()}let m=h.mapping.map(c),d=a.openStart==0&&a.openEnd==0&&a.content.childCount==1,y=h.doc;if(d?h.replaceRangeWith(m,m,a.content.firstChild):h.replaceRange(m,m,a),h.doc.eq(y))return;let _=h.doc.resolve(m);if(d&&Q.isSelectable(a.content.firstChild)&&_.nodeAfter&&_.nodeAfter.sameMarkup(a.content.firstChild))h.setSelection(new Q(_));else{let v=h.mapping.map(c);h.mapping.maps[h.mapping.maps.length-1].forEach((E,N,g,S)=>v=S),h.setSelection(W0(n,_,h.doc.resolve(v)))}n.focus(),n.dispatch(h.setMeta("uiEvent","drop"))},ln.focus=n=>{n.input.lastFocus=Date.now(),n.focused||(n.domObserver.stop(),n.dom.classList.add("ProseMirror-focused"),n.domObserver.start(),n.focused=!0,setTimeout(()=>{n.docView&&n.hasFocus()&&!n.domObserver.currentSelection.eq(n.domSelectionRange())&&Ef(n)},20))},ln.blur=(n,e)=>{let t=e;n.focused&&(n.domObserver.stop(),n.dom.classList.remove("ProseMirror-focused"),n.domObserver.start(),t.relatedTarget&&n.dom.contains(t.relatedTarget)&&n.domObserver.currentSelection.clear(),n.focused=!1)},ln.beforeinput=(n,e)=>{if(br&&Fs&&e.inputType=="deleteContentBackward"){n.domObserver.flushSoon();let{domChangeCount:r}=n.input;setTimeout(()=>{if(n.input.domChangeCount!=r||(n.dom.blur(),n.focus(),n.someProp("handleKeyDown",s=>s(n,N0(8,"Backspace")))))return;let{$cursor:i}=n.state.selection;i&&i.pos>0&&n.dispatch(n.state.tr.delete(i.pos-1,i.pos).scrollIntoView())},50)}};for(let n in Nt)ln[n]=Nt[n];function Hs(n,e){if(n==e)return!0;for(let t in n)if(n[t]!==e[t])return!1;for(let t in e)if(!(t in n))return!1;return!0}class ou{constructor(e,t){this.toDOM=e,this.spec=t||jr,this.side=this.spec.side||0}map(e,t,r,i){let{pos:s,deleted:a}=e.mapResult(t.from+i,this.side<0?-1:1);return a?null:new En(s-r,s-r,this)}valid(){return!0}eq(e){return this==e||e instanceof ou&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&Hs(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class Mr{constructor(e,t){this.attrs=e,this.spec=t||jr}map(e,t,r,i){let s=e.map(t.from+i,this.spec.inclusiveStart?-1:1)-r,a=e.map(t.to+i,this.spec.inclusiveEnd?1:-1)-r;return s>=a?null:new En(s,a,this)}valid(e,t){return t.from<t.to}eq(e){return this==e||e instanceof Mr&&Hs(this.attrs,e.attrs)&&Hs(this.spec,e.spec)}static is(e){return e.type instanceof Mr}destroy(){}}let eA=class Jb{constructor(e,t){this.attrs=e,this.spec=t||jr}map(e,t,r,i){let s=e.mapResult(t.from+i,1);if(s.deleted)return null;let a=e.mapResult(t.to+i,-1);return a.deleted||a.pos<=s.pos?null:new En(s.pos-r,a.pos-r,this)}valid(e,t){let{index:r,offset:i}=e.content.findIndex(t.from),s;return i==t.from&&!(s=e.child(r)).isText&&i+s.nodeSize==t.to}eq(e){return this==e||e instanceof Jb&&Hs(this.attrs,e.attrs)&&Hs(this.spec,e.spec)}destroy(){}};class En{constructor(e,t,r){this.from=e,this.to=t,this.type=r}copy(e,t){return new En(e,t,this.type)}eq(e,t=0){return this.type.eq(e.type)&&this.from+t==e.from&&this.to+t==e.to}map(e,t,r){return this.type.map(e,this,t,r)}static widget(e,t,r){return new En(e,e,new ou(t,r))}static inline(e,t,r,i){return new En(e,t,new Mr(r,i))}static node(e,t,r,i){return new En(e,t,new eA(r,i))}get spec(){return this.type.spec}get inline(){return this.type instanceof Mr}get widget(){return this.type instanceof ou}}const $i=[],jr={};class Ye{constructor(e,t){this.local=e.length?e:$i,this.children=t.length?t:$i}static create(e,t){return t.length?qa(t,e,0,jr):ft}find(e,t,r){let i=[];return this.findInner(e??0,t??1e9,i,0,r),i}findInner(e,t,r,i,s){for(let a=0;a<this.local.length;a++){let u=this.local[a];u.from<=t&&u.to>=e&&(!s||s(u.spec))&&r.push(u.copy(u.from+i,u.to+i))}for(let a=0;a<this.children.length;a+=3)if(this.children[a]<t&&this.children[a+1]>e){let u=this.children[a]+1;this.children[a+2].findInner(e-u,t-u,r,i+u,s)}}map(e,t,r){return this==ft||e.maps.length==0?this:this.mapInner(e,t,0,0,r||jr)}mapInner(e,t,r,i,s){let a;for(let u=0;u<this.local.length;u++){let c=this.local[u].map(e,r,i);c&&c.type.valid(t,c)?(a||(a=[])).push(c):s.onRemove&&s.onRemove(this.local[u].spec)}return this.children.length?tA(this.children,a||[],e,t,r,i,s):a?new Ye(a.sort(Yr),$i):ft}add(e,t){return t.length?this==ft?Ye.create(e,t):this.addInner(e,t,0):this}addInner(e,t,r){let i,s=0;e.forEach((u,c)=>{let h=c+r,m;if(m=c1(t,u,h)){for(i||(i=this.children.slice());s<i.length&&i[s]<c;)s+=3;i[s]==c?i[s+2]=i[s+2].addInner(u,m,h+1):i.splice(s,0,c,c+u.nodeSize,qa(m,u,h+1,jr)),s+=3}});let a=u1(s?f1(t):t,-r);for(let u=0;u<a.length;u++)a[u].type.valid(e,a[u])||a.splice(u--,1);return new Ye(a.length?this.local.concat(a).sort(Yr):this.local,i||this.children)}remove(e){return e.length==0||this==ft?this:this.removeInner(e,0)}removeInner(e,t){let r=this.children,i=this.local;for(let s=0;s<r.length;s+=3){let a,u=r[s]+t,c=r[s+1]+t;for(let m=0,d;m<e.length;m++)(d=e[m])&&d.from>u&&d.to<c&&(e[m]=null,(a||(a=[])).push(d));if(!a)continue;r==this.children&&(r=this.children.slice());let h=r[s+2].removeInner(a,u+1);h!=ft?r[s+2]=h:(r.splice(s,3),s-=3)}if(i.length){for(let s=0,a;s<e.length;s++)if(a=e[s])for(let u=0;u<i.length;u++)i[u].eq(a,t)&&(i==this.local&&(i=this.local.slice()),i.splice(u--,1))}return r==this.children&&i==this.local?this:i.length||r.length?new Ye(i,r):ft}forChild(e,t){if(this==ft)return this;if(t.isLeaf)return Ye.empty;let r,i;for(let u=0;u<this.children.length;u+=3)if(this.children[u]>=e){this.children[u]==e&&(r=this.children[u+2]);break}let s=e+1,a=s+t.content.size;for(let u=0;u<this.local.length;u++){let c=this.local[u];if(c.from<a&&c.to>s&&c.type instanceof Mr){let h=Math.max(s,c.from)-s,m=Math.min(a,c.to)-s;h<m&&(i||(i=[])).push(c.copy(h,m))}}if(i){let u=new Ye(i.sort(Yr),$i);return r?new li([u,r]):u}return r||ft}eq(e){if(this==e)return!0;if(!(e instanceof Ye)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let t=0;t<this.local.length;t++)if(!this.local[t].eq(e.local[t]))return!1;for(let t=0;t<this.children.length;t+=3)if(this.children[t]!=e.children[t]||this.children[t+1]!=e.children[t+1]||!this.children[t+2].eq(e.children[t+2]))return!1;return!0}locals(e){return Rf(this.localsInner(e))}localsInner(e){if(this==ft)return $i;if(e.inlineContent||!this.local.some(Mr.is))return this.local;let t=[];for(let r=0;r<this.local.length;r++)this.local[r].type instanceof Mr||t.push(this.local[r]);return t}forEachSet(e){e(this)}}Ye.empty=new Ye([],[]),Ye.removeOverlap=Rf;const ft=Ye.empty;class li{constructor(e){this.members=e}map(e,t){const r=this.members.map(i=>i.map(e,t,jr));return li.from(r)}forChild(e,t){if(t.isLeaf)return Ye.empty;let r=[];for(let i=0;i<this.members.length;i++){let s=this.members[i].forChild(e,t);s!=ft&&(s instanceof li?r=r.concat(s.members):r.push(s))}return li.from(r)}eq(e){if(!(e instanceof li)||e.members.length!=this.members.length)return!1;for(let t=0;t<this.members.length;t++)if(!this.members[t].eq(e.members[t]))return!1;return!0}locals(e){let t,r=!0;for(let i=0;i<this.members.length;i++){let s=this.members[i].localsInner(e);if(s.length)if(!t)t=s;else{r&&(t=t.slice(),r=!1);for(let a=0;a<s.length;a++)t.push(s[a])}}return t?Rf(r?t:t.sort(Yr)):$i}static from(e){switch(e.length){case 0:return ft;case 1:return e[0];default:return new li(e.every(t=>t instanceof Ye)?e:e.reduce((t,r)=>t.concat(r instanceof Ye?r:r.members),[]))}}forEachSet(e){for(let t=0;t<this.members.length;t++)this.members[t].forEachSet(e)}}function tA(n,e,t,r,i,s,a){let u=n.slice();for(let h=0,m=s;h<t.maps.length;h++){let d=0;t.maps[h].forEach((y,_,v,E)=>{let N=E-v-(_-y);for(let g=0;g<u.length;g+=3){let S=u[g+1];if(S<0||y>S+m-d)continue;let k=u[g]+m-d;_>=k?u[g+1]=y<=k?-2:-1:y>=m&&N&&(u[g]+=N,u[g+1]+=N)}d+=N}),m=t.maps[h].map(m,-1)}let c=!1;for(let h=0;h<u.length;h+=3)if(u[h+1]<0){if(u[h+1]==-2){c=!0,u[h+1]=-1;continue}let m=t.map(n[h]+s),d=m-i;if(d<0||d>=r.content.size){c=!0;continue}let y=t.map(n[h+1]+s,-1),_=y-i,{index:v,offset:E}=r.content.findIndex(d),N=r.maybeChild(v);if(N&&E==d&&E+N.nodeSize==_){let g=u[h+2].mapInner(t,N,m+1,n[h]+s+1,a);g!=ft?(u[h]=d,u[h+1]=_,u[h+2]=g):(u[h+1]=-2,c=!0)}else c=!0}if(c){let h=nA(u,n,e,t,i,s,a),m=qa(h,r,0,a);e=m.local;for(let d=0;d<u.length;d+=3)u[d+1]<0&&(u.splice(d,3),d-=3);for(let d=0,y=0;d<m.children.length;d+=3){let _=m.children[d];for(;y<u.length&&u[y]<_;)y+=3;u.splice(y,0,m.children[d],m.children[d+1],m.children[d+2])}}return new Ye(e.sort(Yr),u)}function u1(n,e){if(!e||!n.length)return n;let t=[];for(let r=0;r<n.length;r++){let i=n[r];t.push(new En(i.from+e,i.to+e,i.type))}return t}function nA(n,e,t,r,i,s,a){function u(c,h){for(let m=0;m<c.local.length;m++){let d=c.local[m].map(r,i,h);d?t.push(d):a.onRemove&&a.onRemove(c.local[m].spec)}for(let m=0;m<c.children.length;m+=3)u(c.children[m+2],c.children[m]+h+1)}for(let c=0;c<n.length;c+=3)n[c+1]==-1&&u(n[c+2],e[c]+s+1);return t}function c1(n,e,t){if(e.isLeaf)return null;let r=t+e.nodeSize,i=null;for(let s=0,a;s<n.length;s++)(a=n[s])&&a.from>t&&a.to<r&&((i||(i=[])).push(a),n[s]=null);return i}function f1(n){let e=[];for(let t=0;t<n.length;t++)n[t]!=null&&e.push(n[t]);return e}function qa(n,e,t,r){let i=[],s=!1;e.forEach((u,c)=>{let h=c1(n,u,c+t);if(h){s=!0;let m=qa(h,u,t+c+1,r);m!=ft&&i.push(c,c+u.nodeSize,m)}});let a=u1(s?f1(n):n,-t).sort(Yr);for(let u=0;u<a.length;u++)a[u].type.valid(e,a[u])||(r.onRemove&&r.onRemove(a[u].spec),a.splice(u--,1));return a.length||i.length?new Ye(a,i):ft}function Yr(n,e){return n.from-e.from||n.to-e.to}function Rf(n){let e=n;for(let t=0;t<e.length-1;t++){let r=e[t];if(r.from!=r.to)for(let i=t+1;i<e.length;i++){let s=e[i];if(s.from==r.from){s.to!=r.to&&(e==n&&(e=n.slice()),e[i]=s.copy(s.from,r.to),h1(e,i+1,s.copy(r.to,s.to)));continue}else{s.from<r.to&&(e==n&&(e=n.slice()),e[t]=r.copy(r.from,s.from),h1(e,i,r.copy(s.from,r.to)));break}}}return e}function h1(n,e,t){for(;e<n.length&&Yr(t,n[e])>0;)e++;n.splice(e,0,t)}for(var vr={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:"'"},Ka={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},rA=typeof navigator<"u"&&/Mac/.test(navigator.platform),iA=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),tt=0;tt<10;tt++)vr[48+tt]=vr[96+tt]=String(tt);for(var tt=1;tt<=24;tt++)vr[tt+111]="F"+tt;for(var tt=65;tt<=90;tt++)vr[tt]=String.fromCharCode(tt+32),Ka[tt]=String.fromCharCode(tt);for(var Lf in vr)Ka.hasOwnProperty(Lf)||(Ka[Lf]=vr[Lf]);function sA(n){var e=rA&&n.metaKey&&n.shiftKey&&!n.ctrlKey&&!n.altKey||iA&&n.shiftKey&&n.key&&n.key.length==1||n.key=="Unidentified",t=!e&&n.key||(n.shiftKey?Ka:vr)[n.keyCode]||n.key||"Unidentified";return t=="Esc"&&(t="Escape"),t=="Del"&&(t="Delete"),t=="Left"&&(t="ArrowLeft"),t=="Up"&&(t="ArrowUp"),t=="Right"&&(t="ArrowRight"),t=="Down"&&(t="ArrowDown"),t}const oA=typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):!1;function aA(n){let e=n.split(/-(?!$)/),t=e[e.length-1];t=="Space"&&(t=" ");let r,i,s,a;for(let u=0;u<e.length-1;u++){let c=e[u];if(/^(cmd|meta|m)$/i.test(c))a=!0;else if(/^a(lt)?$/i.test(c))r=!0;else if(/^(c|ctrl|control)$/i.test(c))i=!0;else if(/^s(hift)?$/i.test(c))s=!0;else if(/^mod$/i.test(c))oA?a=!0:i=!0;else throw new Error("Unrecognized modifier name: "+c)}return r&&(t="Alt-"+t),i&&(t="Ctrl-"+t),a&&(t="Meta-"+t),s&&(t="Shift-"+t),t}function lA(n){let e=Object.create(null);for(let t in n)e[aA(t)]=n[t];return e}function Pf(n,e,t=!0){return e.altKey&&(n="Alt-"+n),e.ctrlKey&&(n="Ctrl-"+n),e.metaKey&&(n="Meta-"+n),t&&e.shiftKey&&(n="Shift-"+n),n}function uA(n){return new ct({props:{handleKeyDown:cA(n)}})}function cA(n){let e=lA(n);return function(t,r){let i=sA(r),s,a=e[Pf(i,r)];if(a&&a(t.state,t.dispatch,t))return!0;if(i.length==1&&i!=" "){if(r.shiftKey){let u=e[Pf(i,r,!1)];if(u&&u(t.state,t.dispatch,t))return!0}if((r.shiftKey||r.altKey||r.metaKey||i.charCodeAt(0)>127)&&(s=vr[r.keyCode])&&s!=i){let u=e[Pf(s,r)];if(u&&u(t.state,t.dispatch,t))return!0}}return!1}}const Df=(n,e)=>n.selection.empty?!1:(e&&e(n.tr.deleteSelection().scrollIntoView()),!0);function d1(n,e){let{$cursor:t}=n.selection;return!t||(e?!e.endOfTextblock("backward",n):t.parentOffset>0)?null:t}const p1=(n,e,t)=>{let r=d1(n,t);if(!r)return!1;let i=$f(r);if(!i){let a=r.blockRange(),u=a&&Ni(a);return u==null?!1:(e&&e(n.tr.lift(a,u).scrollIntoView()),!0)}let s=i.nodeBefore;if(x1(n,i,e,-1))return!0;if(r.parent.content.size==0&&(Fi(s,"end")||Q.isSelectable(s)))for(let a=r.depth;;a--){let u=Fa(n.doc,r.before(a),r.after(a),K.empty);if(u&&u.slice.size<u.to-u.from){if(e){let c=n.tr.step(u);c.setSelection(Fi(s,"end")?ye.findFrom(c.doc.resolve(c.mapping.map(i.pos,-1)),-1):Q.create(c.doc,i.pos-s.nodeSize)),e(c.scrollIntoView())}return!0}if(a==1||r.node(a-1).childCount>1)break}return s.isAtom&&i.depth==r.depth-1?(e&&e(n.tr.delete(i.pos-s.nodeSize,i.pos).scrollIntoView()),!0):!1},fA=(n,e,t)=>{let r=d1(n,t);if(!r)return!1;let i=$f(r);return i?m1(n,i,e):!1},hA=(n,e,t)=>{let r=y1(n,t);if(!r)return!1;let i=Ff(r);return i?m1(n,i,e):!1};function m1(n,e,t){let r=e.nodeBefore,i=r,s=e.pos-1;for(;!i.isTextblock;s--){if(i.type.spec.isolating)return!1;let m=i.lastChild;if(!m)return!1;i=m}let a=e.nodeAfter,u=a,c=e.pos+1;for(;!u.isTextblock;c++){if(u.type.spec.isolating)return!1;let m=u.firstChild;if(!m)return!1;u=m}let h=Fa(n.doc,s,c,K.empty);if(!h||h.from!=s||h instanceof je&&h.slice.size>=c-s)return!1;if(t){let m=n.tr.step(h);m.setSelection(pe.create(m.doc,s)),t(m.scrollIntoView())}return!0}function Fi(n,e,t=!1){for(let r=n;r;r=e=="start"?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(t&&r.childCount!=1)return!1}return!1}const g1=(n,e,t)=>{let{$head:r,empty:i}=n.selection,s=r;if(!i)return!1;if(r.parent.isTextblock){if(t?!t.endOfTextblock("backward",n):r.parentOffset>0)return!1;s=$f(r)}let a=s&&s.nodeBefore;return!a||!Q.isSelectable(a)?!1:(e&&e(n.tr.setSelection(Q.create(n.doc,s.pos-a.nodeSize)).scrollIntoView()),!0)};function $f(n){if(!n.parent.type.spec.isolating)for(let e=n.depth-1;e>=0;e--){if(n.index(e)>0)return n.doc.resolve(n.before(e+1));if(n.node(e).type.spec.isolating)break}return null}function y1(n,e){let{$cursor:t}=n.selection;return!t||(e?!e.endOfTextblock("forward",n):t.parentOffset<t.parent.content.size)?null:t}const b1=(n,e,t)=>{let r=y1(n,t);if(!r)return!1;let i=Ff(r);if(!i)return!1;let s=i.nodeAfter;if(x1(n,i,e,1))return!0;if(r.parent.content.size==0&&(Fi(s,"start")||Q.isSelectable(s))){let a=Fa(n.doc,r.before(),r.after(),K.empty);if(a&&a.slice.size<a.to-a.from){if(e){let u=n.tr.step(a);u.setSelection(Fi(s,"start")?ye.findFrom(u.doc.resolve(u.mapping.map(i.pos)),1):Q.create(u.doc,u.mapping.map(i.pos))),e(u.scrollIntoView())}return!0}}return s.isAtom&&i.depth==r.depth-1?(e&&e(n.tr.delete(i.pos,i.pos+s.nodeSize).scrollIntoView()),!0):!1},_1=(n,e,t)=>{let{$head:r,empty:i}=n.selection,s=r;if(!i)return!1;if(r.parent.isTextblock){if(t?!t.endOfTextblock("forward",n):r.parentOffset<r.parent.content.size)return!1;s=Ff(r)}let a=s&&s.nodeAfter;return!a||!Q.isSelectable(a)?!1:(e&&e(n.tr.setSelection(Q.create(n.doc,s.pos)).scrollIntoView()),!0)};function Ff(n){if(!n.parent.type.spec.isolating)for(let e=n.depth-1;e>=0;e--){let t=n.node(e);if(n.index(e)+1<t.childCount)return n.doc.resolve(n.after(e+1));if(t.type.spec.isolating)break}return null}const dA=(n,e)=>{let t=n.selection,r=t instanceof Q,i;if(r){if(t.node.isTextblock||!gr(n.doc,t.from))return!1;i=t.from}else if(i=$a(n.doc,t.from,-1),i==null)return!1;if(e){let s=n.tr.join(i);r&&s.setSelection(Q.create(s.doc,i-n.doc.resolve(i).nodeBefore.nodeSize)),e(s.scrollIntoView())}return!0},pA=(n,e)=>{let t=n.selection,r;if(t instanceof Q){if(t.node.isTextblock||!gr(n.doc,t.to))return!1;r=t.to}else if(r=$a(n.doc,t.to,1),r==null)return!1;return e&&e(n.tr.join(r).scrollIntoView()),!0},mA=(n,e)=>{let{$from:t,$to:r}=n.selection,i=t.blockRange(r),s=i&&Ni(i);return s==null?!1:(e&&e(n.tr.lift(i,s).scrollIntoView()),!0)},w1=(n,e)=>{let{$head:t,$anchor:r}=n.selection;return!t.parent.type.spec.code||!t.sameParent(r)?!1:(e&&e(n.tr.insertText(`
|
|
38
|
+
`).scrollIntoView()),!0)};function Bf(n){for(let e=0;e<n.edgeCount;e++){let{type:t}=n.edge(e);if(t.isTextblock&&!t.hasRequiredAttrs())return t}return null}const gA=(n,e)=>{let{$head:t,$anchor:r}=n.selection;if(!t.parent.type.spec.code||!t.sameParent(r))return!1;let i=t.node(-1),s=t.indexAfter(-1),a=Bf(i.contentMatchAt(s));if(!a||!i.canReplaceWith(s,s,a))return!1;if(e){let u=t.after(),c=n.tr.replaceWith(u,u,a.createAndFill());c.setSelection(ye.near(c.doc.resolve(u),1)),e(c.scrollIntoView())}return!0},v1=(n,e)=>{let t=n.selection,{$from:r,$to:i}=t;if(t instanceof Lt||r.parent.inlineContent||i.parent.inlineContent)return!1;let s=Bf(i.parent.contentMatchAt(i.indexAfter()));if(!s||!s.isTextblock)return!1;if(e){let a=(!r.parentOffset&&i.index()<i.parent.childCount?r:i).pos,u=n.tr.insert(a,s.createAndFill());u.setSelection(pe.create(u.doc,a+1)),e(u.scrollIntoView())}return!0},S1=(n,e)=>{let{$cursor:t}=n.selection;if(!t||t.parent.content.size)return!1;if(t.depth>1&&t.after()!=t.end(-1)){let s=t.before();if(Wn(n.doc,s))return e&&e(n.tr.split(s).scrollIntoView()),!0}let r=t.blockRange(),i=r&&Ni(r);return i==null?!1:(e&&e(n.tr.lift(r,i).scrollIntoView()),!0)};function yA(n){return(e,t)=>{let{$from:r,$to:i}=e.selection;if(e.selection instanceof Q&&e.selection.node.isBlock)return!r.parentOffset||!Wn(e.doc,r.pos)?!1:(t&&t(e.tr.split(r.pos).scrollIntoView()),!0);if(!r.depth)return!1;let s=[],a,u,c=!1,h=!1;for(let _=r.depth;;_--)if(r.node(_).isBlock){c=r.end(_)==r.pos+(r.depth-_),h=r.start(_)==r.pos-(r.depth-_),u=Bf(r.node(_-1).contentMatchAt(r.indexAfter(_-1))),s.unshift(c&&u?{type:u}:null),a=_;break}else{if(_==1)return!1;s.unshift(null)}let m=e.tr;(e.selection instanceof pe||e.selection instanceof Lt)&&m.deleteSelection();let d=m.mapping.map(r.pos),y=Wn(m.doc,d,s.length,s);if(y||(s[0]=u?{type:u}:null,y=Wn(m.doc,d,s.length,s)),m.split(d,s.length,s),!c&&h&&r.node(a).type!=u){let _=m.mapping.map(r.before(a)),v=m.doc.resolve(_);u&&r.node(a-1).canReplaceWith(v.index(),v.index()+1,u)&&m.setNodeMarkup(m.mapping.map(r.before(a)),u)}return t&&t(m.scrollIntoView()),!0}}const bA=yA(),_A=(n,e)=>{let{$from:t,to:r}=n.selection,i,s=t.sharedDepth(r);return s==0?!1:(i=t.before(s),e&&e(n.tr.setSelection(Q.create(n.doc,i))),!0)};function wA(n,e,t){let r=e.nodeBefore,i=e.nodeAfter,s=e.index();return!r||!i||!r.type.compatibleContent(i.type)?!1:!r.content.size&&e.parent.canReplace(s-1,s)?(t&&t(n.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(s,s+1)||!(i.isTextblock||gr(n.doc,e.pos))?!1:(t&&t(n.tr.join(e.pos).scrollIntoView()),!0)}function x1(n,e,t,r){let i=e.nodeBefore,s=e.nodeAfter,a,u,c=i.type.spec.isolating||s.type.spec.isolating;if(!c&&wA(n,e,t))return!0;let h=!c&&e.parent.canReplace(e.index(),e.index()+1);if(h&&(a=(u=i.contentMatchAt(i.childCount)).findWrapping(s.type))&&u.matchType(a[0]||s.type).validEnd){if(t){let _=e.pos+s.nodeSize,v=V.empty;for(let g=a.length-1;g>=0;g--)v=V.from(a[g].create(null,v));v=V.from(i.copy(v));let E=n.tr.step(new Je(e.pos-1,_,e.pos,_,new K(v,1,0),a.length,!0)),N=E.doc.resolve(_+2*a.length);N.nodeAfter&&N.nodeAfter.type==i.type&&gr(E.doc,N.pos)&&E.join(N.pos),t(E.scrollIntoView())}return!0}let m=s.type.spec.isolating||r>0&&c?null:ye.findFrom(e,1),d=m&&m.$from.blockRange(m.$to),y=d&&Ni(d);if(y!=null&&y>=e.depth)return t&&t(n.tr.lift(d,y).scrollIntoView()),!0;if(h&&Fi(s,"start",!0)&&Fi(i,"end")){let _=i,v=[];for(;v.push(_),!_.isTextblock;)_=_.lastChild;let E=s,N=1;for(;!E.isTextblock;E=E.firstChild)N++;if(_.canReplace(_.childCount,_.childCount,E.content)){if(t){let g=V.empty;for(let k=v.length-1;k>=0;k--)g=V.from(v[k].copy(g));let S=n.tr.step(new Je(e.pos-v.length,e.pos+s.nodeSize,e.pos+N,e.pos+s.nodeSize-N,new K(g,v.length,0),0,!0));t(S.scrollIntoView())}return!0}}return!1}function E1(n){return function(e,t){let r=e.selection,i=n<0?r.$from:r.$to,s=i.depth;for(;i.node(s).isInline;){if(!s)return!1;s--}return i.node(s).isTextblock?(t&&t(e.tr.setSelection(pe.create(e.doc,n<0?i.start(s):i.end(s)))),!0):!1}}const vA=E1(-1),SA=E1(1);function xA(n,e=null){return function(t,r){let{$from:i,$to:s}=t.selection,a=i.blockRange(s),u=a&&df(a,n,e);return u?(r&&r(t.tr.wrap(a,u).scrollIntoView()),!0):!1}}function C1(n,e=null){return function(t,r){let i=!1;for(let s=0;s<t.selection.ranges.length&&!i;s++){let{$from:{pos:a},$to:{pos:u}}=t.selection.ranges[s];t.doc.nodesBetween(a,u,(c,h)=>{if(i)return!1;if(!(!c.isTextblock||c.hasMarkup(n,e)))if(c.type==n)i=!0;else{let m=t.doc.resolve(h),d=m.index();i=m.parent.canReplaceWith(d,d+1,n)}})}if(!i)return!1;if(r){let s=t.tr;for(let a=0;a<t.selection.ranges.length;a++){let{$from:{pos:u},$to:{pos:c}}=t.selection.ranges[a];s.setBlockType(u,c,n,e)}r(s.scrollIntoView())}return!0}}function zf(...n){return function(e,t,r){for(let i=0;i<n.length;i++)if(n[i](e,t,r))return!0;return!1}}zf(Df,p1,g1),zf(Df,b1,_1),zf(w1,v1,S1,bA),typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function EA(n,e=null){return function(t,r){let{$from:i,$to:s}=t.selection,a=i.blockRange(s);if(!a)return!1;let u=r?t.tr:null;return CA(u,a,n,e)?(r&&r(u.scrollIntoView()),!0):!1}}function CA(n,e,t,r=null){let i=!1,s=e,a=e.$from.doc;if(e.depth>=2&&e.$from.node(e.depth-1).type.compatibleContent(t)&&e.startIndex==0){if(e.$from.index(e.depth-1)==0)return!1;let c=a.resolve(e.start-2);s=new Na(c,c,e.depth),e.endIndex<e.parent.childCount&&(e=new Na(e.$from,a.resolve(e.$to.end(e.depth)),e.depth)),i=!0}let u=df(s,t,r,e);return u?(n&&kA(n,e,u,i,t),!0):!1}function kA(n,e,t,r,i){let s=V.empty;for(let m=t.length-1;m>=0;m--)s=V.from(t[m].type.create(t[m].attrs,s));n.step(new Je(e.start-(r?2:0),e.end,e.start,e.end,new K(s,0,0),t.length,!0));let a=0;for(let m=0;m<t.length;m++)t[m].type==i&&(a=m+1);let u=t.length-a,c=e.start+t.length-(r?2:0),h=e.parent;for(let m=e.startIndex,d=e.endIndex,y=!0;m<d;m++,y=!1)!y&&Wn(n.doc,c,u)&&(n.split(c,u),c+=2*u),c+=h.child(m).nodeSize;return n}function TA(n){return function(e,t){let{$from:r,$to:i}=e.selection,s=r.blockRange(i,a=>a.childCount>0&&a.firstChild.type==n);return s?t?r.node(s.depth-1).type==n?AA(e,t,n,s):OA(e,t,s):!0:!1}}function AA(n,e,t,r){let i=n.tr,s=r.end,a=r.$to.end(r.depth);s<a&&(i.step(new Je(s-1,a,s,a,new K(V.from(t.create(null,r.parent.copy())),1,0),1,!0)),r=new Na(i.doc.resolve(r.$from.pos),i.doc.resolve(a),r.depth));const u=Ni(r);if(u==null)return!1;i.lift(r,u);let c=i.mapping.map(s,-1)-1;return gr(i.doc,c)&&i.join(c),e(i.scrollIntoView()),!0}function OA(n,e,t){let r=n.tr,i=t.parent;for(let _=t.end,v=t.endIndex-1,E=t.startIndex;v>E;v--)_-=i.child(v).nodeSize,r.delete(_-1,_+1);let s=r.doc.resolve(t.start),a=s.nodeAfter;if(r.mapping.map(t.end)!=t.start+s.nodeAfter.nodeSize)return!1;let u=t.startIndex==0,c=t.endIndex==i.childCount,h=s.node(-1),m=s.index(-1);if(!h.canReplace(m+(u?0:1),m+1,a.content.append(c?V.empty:V.from(i))))return!1;let d=s.pos,y=d+a.nodeSize;return r.step(new Je(d-(u?1:0),y+(c?1:0),d+1,y-1,new K((u?V.empty:V.from(i.copy(V.empty))).append(c?V.empty:V.from(i.copy(V.empty))),u?0:1,c?0:1),u?0:1)),e(r.scrollIntoView()),!0}function MA(n){return function(e,t){let{$from:r,$to:i}=e.selection,s=r.blockRange(i,h=>h.childCount>0&&h.firstChild.type==n);if(!s)return!1;let a=s.startIndex;if(a==0)return!1;let u=s.parent,c=u.child(a-1);if(c.type!=n)return!1;if(t){let h=c.lastChild&&c.lastChild.type==u.type,m=V.from(h?n.create():null),d=new K(V.from(n.create(null,V.from(u.type.create(null,m)))),h?3:1,0),y=s.start,_=s.end;t(e.tr.step(new Je(y-(h?3:1),_,y,_,d,1,!0)).scrollIntoView())}return!0}}function Ga(n){const{state:e,transaction:t}=n;let{selection:r}=t,{doc:i}=t,{storedMarks:s}=t;return{...e,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return s},get selection(){return r},get doc(){return i},get tr(){return r=t.selection,i=t.doc,s=t.storedMarks,t}}}class Hf{constructor(e){this.editor=e.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=e.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:e,editor:t,state:r}=this,{view:i}=t,{tr:s}=r,a=this.buildProps(s);return Object.fromEntries(Object.entries(e).map(([u,c])=>[u,(...m)=>{const d=c(...m)(a);return!s.getMeta("preventDispatch")&&!this.hasCustomState&&i.dispatch(s),d}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(e,t=!0){const{rawCommands:r,editor:i,state:s}=this,{view:a}=i,u=[],c=!!e,h=e||s.tr,m=()=>(!c&&t&&!h.getMeta("preventDispatch")&&!this.hasCustomState&&a.dispatch(h),u.every(y=>y===!0)),d={...Object.fromEntries(Object.entries(r).map(([y,_])=>[y,(...E)=>{const N=this.buildProps(h,t),g=_(...E)(N);return u.push(g),d}])),run:m};return d}createCan(e){const{rawCommands:t,state:r}=this,i=!1,s=e||r.tr,a=this.buildProps(s,i);return{...Object.fromEntries(Object.entries(t).map(([c,h])=>[c,(...m)=>h(...m)({...a,dispatch:void 0})])),chain:()=>this.createChain(s,i)}}buildProps(e,t=!0){const{rawCommands:r,editor:i,state:s}=this,{view:a}=i,u={tr:e,editor:i,view:a,state:Ga({state:s,transaction:e}),dispatch:t?()=>{}:void 0,chain:()=>this.createChain(e,t),can:()=>this.createCan(e),get commands(){return Object.fromEntries(Object.entries(r).map(([c,h])=>[c,(...m)=>h(...m)(u)]))}};return u}}function J(n,e,t){return n.config[e]===void 0&&n.parent?J(n.parent,e,t):typeof n.config[e]=="function"?n.config[e].bind({...t,parent:n.parent?J(n.parent,e,t):null}):n.config[e]}function Ja(n){const e=n.filter(i=>i.type==="extension"),t=n.filter(i=>i.type==="node"),r=n.filter(i=>i.type==="mark");return{baseExtensions:e,nodeExtensions:t,markExtensions:r}}function k1(n){const e=[],{nodeExtensions:t,markExtensions:r}=Ja(n),i=[...t,...r],s={default:null,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return n.forEach(a=>{const u={name:a.name,options:a.options,storage:a.storage,extensions:i},c=J(a,"addGlobalAttributes",u);if(!c)return;c().forEach(m=>{m.types.forEach(d=>{Object.entries(m.attributes).forEach(([y,_])=>{e.push({type:d,name:y,attribute:{...s,..._}})})})})}),i.forEach(a=>{const u={name:a.name,options:a.options,storage:a.storage},c=J(a,"addAttributes",u);if(!c)return;const h=c();Object.entries(h).forEach(([m,d])=>{const y={...s,...d};typeof y?.default=="function"&&(y.default=y.default()),y?.isRequired&&y?.default===void 0&&delete y.default,e.push({type:a.name,name:m,attribute:y})})}),e}function qe(n,e){if(typeof n=="string"){if(!e.nodes[n])throw Error(`There is no node type named '${n}'. Maybe you forgot to add the extension?`);return e.nodes[n]}return n}function Bi(...n){return n.filter(e=>!!e).reduce((e,t)=>{const r={...e};return Object.entries(t).forEach(([i,s])=>{if(!r[i]){r[i]=s;return}if(i==="class"){const u=s?String(s).split(" "):[],c=r[i]?r[i].split(" "):[],h=u.filter(m=>!c.includes(m));r[i]=[...c,...h].join(" ")}else if(i==="style"){const u=s?s.split(";").map(m=>m.trim()).filter(Boolean):[],c=r[i]?r[i].split(";").map(m=>m.trim()).filter(Boolean):[],h=new Map;c.forEach(m=>{const[d,y]=m.split(":").map(_=>_.trim());h.set(d,y)}),u.forEach(m=>{const[d,y]=m.split(":").map(_=>_.trim());h.set(d,y)}),r[i]=Array.from(h.entries()).map(([m,d])=>`${m}: ${d}`).join("; ")}else r[i]=s}),r},{})}function Wf(n,e){return e.filter(t=>t.type===n.type.name).filter(t=>t.attribute.rendered).map(t=>t.attribute.renderHTML?t.attribute.renderHTML(n.attrs)||{}:{[t.name]:n.attrs[t.name]}).reduce((t,r)=>Bi(t,r),{})}function IA(n){return typeof n=="function"}function de(n,e=void 0,...t){return IA(n)?e?n.bind(e)(...t):n(...t):n}function NA(n={}){return Object.keys(n).length===0&&n.constructor===Object}function RA(n){return typeof n!="string"?n:n.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(n):n==="true"?!0:n==="false"?!1:n}function T1(n,e){return"style"in n?n:{...n,getAttrs:t=>{const r=n.getAttrs?n.getAttrs(t):n.attrs;if(r===!1)return!1;const i=e.reduce((s,a)=>{const u=a.attribute.parseHTML?a.attribute.parseHTML(t):RA(t.getAttribute(a.name));return u==null?s:{...s,[a.name]:u}},{});return{...r,...i}}}}function A1(n){return Object.fromEntries(Object.entries(n).filter(([e,t])=>e==="attrs"&&NA(t)?!1:t!=null))}function O1(n,e){var t;const r=k1(n),{nodeExtensions:i,markExtensions:s}=Ja(n),a=(t=i.find(h=>J(h,"topNode")))===null||t===void 0?void 0:t.name,u=Object.fromEntries(i.map(h=>{const m=r.filter(g=>g.type===h.name),d={name:h.name,options:h.options,storage:h.storage,editor:e},y=n.reduce((g,S)=>{const k=J(S,"extendNodeSchema",d);return{...g,...k?k(h):{}}},{}),_=A1({...y,content:de(J(h,"content",d)),marks:de(J(h,"marks",d)),group:de(J(h,"group",d)),inline:de(J(h,"inline",d)),atom:de(J(h,"atom",d)),selectable:de(J(h,"selectable",d)),draggable:de(J(h,"draggable",d)),code:de(J(h,"code",d)),whitespace:de(J(h,"whitespace",d)),linebreakReplacement:de(J(h,"linebreakReplacement",d)),defining:de(J(h,"defining",d)),isolating:de(J(h,"isolating",d)),attrs:Object.fromEntries(m.map(g=>{var S;return[g.name,{default:(S=g?.attribute)===null||S===void 0?void 0:S.default}]}))}),v=de(J(h,"parseHTML",d));v&&(_.parseDOM=v.map(g=>T1(g,m)));const E=J(h,"renderHTML",d);E&&(_.toDOM=g=>E({node:g,HTMLAttributes:Wf(g,m)}));const N=J(h,"renderText",d);return N&&(_.toText=N),[h.name,_]})),c=Object.fromEntries(s.map(h=>{const m=r.filter(N=>N.type===h.name),d={name:h.name,options:h.options,storage:h.storage,editor:e},y=n.reduce((N,g)=>{const S=J(g,"extendMarkSchema",d);return{...N,...S?S(h):{}}},{}),_=A1({...y,inclusive:de(J(h,"inclusive",d)),excludes:de(J(h,"excludes",d)),group:de(J(h,"group",d)),spanning:de(J(h,"spanning",d)),code:de(J(h,"code",d)),attrs:Object.fromEntries(m.map(N=>{var g;return[N.name,{default:(g=N?.attribute)===null||g===void 0?void 0:g.default}]}))}),v=de(J(h,"parseHTML",d));v&&(_.parseDOM=v.map(N=>T1(N,m)));const E=J(h,"renderHTML",d);return E&&(_.toDOM=N=>E({mark:N,HTMLAttributes:Wf(N,m)})),[h.name,_]}));return new Qg({topNode:a,nodes:u,marks:c})}function Vf(n,e){return e.nodes[n]||e.marks[n]||null}function M1(n,e){return Array.isArray(e)?e.some(t=>(typeof t=="string"?t:t.name)===n.name):e}function I1(n,e){const t=io.fromSchema(e).serializeFragment(n),i=document.implementation.createHTMLDocument().createElement("div");return i.appendChild(t),i.innerHTML}const LA=(n,e=500)=>{let t="";const r=n.parentOffset;return n.parent.nodesBetween(Math.max(0,r-e),r,(i,s,a,u)=>{var c,h;const m=((h=(c=i.type.spec).toText)===null||h===void 0?void 0:h.call(c,{node:i,pos:s,parent:a,index:u}))||i.textContent||"%leaf%";t+=i.isAtom&&!i.isText?m:m.slice(0,Math.max(0,r-s))}),t};function Uf(n){return Object.prototype.toString.call(n)==="[object RegExp]"}class N1{constructor(e){this.find=e.find,this.handler=e.handler}}const PA=(n,e)=>{if(Uf(e))return e.exec(n);const t=e(n);if(!t)return null;const r=[t.text];return r.index=t.index,r.input=n,r.data=t.data,t.replaceWith&&(t.text.includes(t.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(t.replaceWith)),r};function ja(n){var e;const{editor:t,from:r,to:i,text:s,rules:a,plugin:u}=n,{view:c}=t;if(c.composing)return!1;const h=c.state.doc.resolve(r);if(h.parent.type.spec.code||!((e=h.nodeBefore||h.nodeAfter)===null||e===void 0)&&e.marks.find(y=>y.type.spec.code))return!1;let m=!1;const d=LA(h)+s;return a.forEach(y=>{if(m)return;const _=PA(d,y.find);if(!_)return;const v=c.state.tr,E=Ga({state:c.state,transaction:v}),N={from:r-(_[0].length-s.length),to:i},{commands:g,chain:S,can:k}=new Hf({editor:t,state:E});y.handler({state:E,range:N,match:_,commands:g,chain:S,can:k})===null||!v.steps.length||(v.setMeta(u,{transform:v,from:r,to:i,text:s}),c.dispatch(v),m=!0)}),m}function DA(n){const{editor:e,rules:t}=n,r=new ct({state:{init(){return null},apply(i,s,a){const u=i.getMeta(r);if(u)return u;const c=i.getMeta("applyInputRules");return!!c&&setTimeout(()=>{let{text:m}=c;typeof m=="string"?m=m:m=I1(V.from(m),a.schema);const{from:d}=c,y=d+m.length;ja({editor:e,from:d,to:y,text:m,rules:t,plugin:r})}),i.selectionSet||i.docChanged?null:s}},props:{handleTextInput(i,s,a,u){return ja({editor:e,from:s,to:a,text:u,rules:t,plugin:r})},handleDOMEvents:{compositionend:i=>(setTimeout(()=>{const{$cursor:s}=i.state.selection;s&&ja({editor:e,from:s.pos,to:s.pos,text:"",rules:t,plugin:r})}),!1)},handleKeyDown(i,s){if(s.key!=="Enter")return!1;const{$cursor:a}=i.state.selection;return a?ja({editor:e,from:a.pos,to:a.pos,text:`
|
|
39
|
+
`,rules:t,plugin:r}):!1}},isInputRules:!0});return r}function $A(n){return Object.prototype.toString.call(n).slice(8,-1)}function Ya(n){return $A(n)!=="Object"?!1:n.constructor===Object&&Object.getPrototypeOf(n)===Object.prototype}function Xa(n,e){const t={...n};return Ya(n)&&Ya(e)&&Object.keys(e).forEach(r=>{Ya(e[r])&&Ya(n[r])?t[r]=Xa(n[r],e[r]):t[r]=e[r]}),t}class Rt{constructor(e={}){this.type="mark",this.name="mark",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=de(J(this,"addOptions",{name:this.name}))),this.storage=de(J(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Rt(e)}configure(e={}){const t=this.extend({...this.config,addOptions:()=>Xa(this.options,e)});return t.name=this.name,t.parent=this.parent,t}extend(e={}){const t=new Rt(e);return t.parent=this,this.child=t,t.name=e.name?e.name:t.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`),t.options=de(J(t,"addOptions",{name:t.name})),t.storage=de(J(t,"addStorage",{name:t.name,options:t.options})),t}static handleExit({editor:e,mark:t}){const{tr:r}=e.state,i=e.state.selection.$from;if(i.pos===i.end()){const a=i.marks();if(!!!a.find(h=>h?.type.name===t.name))return!1;const c=a.find(h=>h?.type.name===t.name);return c&&r.removeStoredMark(c),r.insertText(" ",i.pos),e.view.dispatch(r),!0}return!1}}function FA(n){return typeof n=="number"}class BA{constructor(e){this.find=e.find,this.handler=e.handler}}const zA=(n,e,t)=>{if(Uf(e))return[...n.matchAll(e)];const r=e(n,t);return r?r.map(i=>{const s=[i.text];return s.index=i.index,s.input=n,s.data=i.data,i.replaceWith&&(i.text.includes(i.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),s.push(i.replaceWith)),s}):[]};function HA(n){const{editor:e,state:t,from:r,to:i,rule:s,pasteEvent:a,dropEvent:u}=n,{commands:c,chain:h,can:m}=new Hf({editor:e,state:t}),d=[];return t.doc.nodesBetween(r,i,(_,v)=>{if(!_.isTextblock||_.type.spec.code)return;const E=Math.max(r,v),N=Math.min(i,v+_.content.size),g=_.textBetween(E-v,N-v,void 0,"\uFFFC");zA(g,s.find,a).forEach(k=>{if(k.index===void 0)return;const T=E+k.index+1,A=T+k[0].length,$={from:t.tr.mapping.map(T),to:t.tr.mapping.map(A)},U=s.handler({state:t,range:$,match:k,commands:c,chain:h,can:m,pasteEvent:a,dropEvent:u});d.push(U)})}),d.every(_=>_!==null)}let Za=null;const WA=n=>{var e;const t=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(e=t.clipboardData)===null||e===void 0||e.setData("text/html",n),t};function VA(n){const{editor:e,rules:t}=n;let r=null,i=!1,s=!1,a=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,u;try{u=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{u=null}const c=({state:m,from:d,to:y,rule:_,pasteEvt:v})=>{const E=m.tr,N=Ga({state:m,transaction:E});if(!(!HA({editor:e,state:N,from:Math.max(d-1,0),to:y.b-1,rule:_,pasteEvent:v,dropEvent:u})||!E.steps.length)){try{u=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{u=null}return a=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,E}};return t.map(m=>new ct({view(d){const y=v=>{var E;r=!((E=d.dom.parentElement)===null||E===void 0)&&E.contains(v.target)?d.dom.parentElement:null,r&&(Za=e)},_=()=>{Za&&(Za=null)};return window.addEventListener("dragstart",y),window.addEventListener("dragend",_),{destroy(){window.removeEventListener("dragstart",y),window.removeEventListener("dragend",_)}}},props:{handleDOMEvents:{drop:(d,y)=>{if(s=r===d.dom.parentElement,u=y,!s){const _=Za;_&&setTimeout(()=>{const v=_.state.selection;v&&_.commands.deleteRange({from:v.from,to:v.to})},10)}return!1},paste:(d,y)=>{var _;const v=(_=y.clipboardData)===null||_===void 0?void 0:_.getData("text/html");return a=y,i=!!v?.includes("data-pm-slice"),!1}}},appendTransaction:(d,y,_)=>{const v=d[0],E=v.getMeta("uiEvent")==="paste"&&!i,N=v.getMeta("uiEvent")==="drop"&&!s,g=v.getMeta("applyPasteRules"),S=!!g;if(!E&&!N&&!S)return;if(S){let{text:A}=g;typeof A=="string"?A=A:A=I1(V.from(A),_.schema);const{from:$}=g,U=$+A.length,z=WA(A);return c({rule:m,state:_,from:$,to:{b:U},pasteEvt:z})}const k=y.doc.content.findDiffStart(_.doc.content),T=y.doc.content.findDiffEnd(_.doc.content);if(!(!FA(k)||!T||k===T.b))return c({rule:m,state:_,from:k,to:T,pasteEvt:a})}}))}function UA(n){const e=n.filter((t,r)=>n.indexOf(t)!==r);return Array.from(new Set(e))}class Yi{constructor(e,t){this.splittableMarks=[],this.editor=t,this.extensions=Yi.resolve(e),this.schema=O1(this.extensions,t),this.setupExtensions()}static resolve(e){const t=Yi.sort(Yi.flatten(e)),r=UA(t.map(i=>i.name));return r.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${r.map(i=>`'${i}'`).join(", ")}]. This can lead to issues.`),t}static flatten(e){return e.map(t=>{const r={name:t.name,options:t.options,storage:t.storage},i=J(t,"addExtensions",r);return i?[t,...this.flatten(i())]:t}).flat(10)}static sort(e){return e.sort((r,i)=>{const s=J(r,"priority")||100,a=J(i,"priority")||100;return s>a?-1:s<a?1:0})}get commands(){return this.extensions.reduce((e,t)=>{const r={name:t.name,options:t.options,storage:t.storage,editor:this.editor,type:Vf(t.name,this.schema)},i=J(t,"addCommands",r);return i?{...e,...i()}:e},{})}get plugins(){const{editor:e}=this,t=Yi.sort([...this.extensions].reverse()),r=[],i=[],s=t.map(a=>{const u={name:a.name,options:a.options,storage:a.storage,editor:e,type:Vf(a.name,this.schema)},c=[],h=J(a,"addKeyboardShortcuts",u);let m={};if(a.type==="mark"&&J(a,"exitable",u)&&(m.ArrowRight=()=>Rt.handleExit({editor:e,mark:a})),h){const E=Object.fromEntries(Object.entries(h()).map(([N,g])=>[N,()=>g({editor:e})]));m={...m,...E}}const d=uA(m);c.push(d);const y=J(a,"addInputRules",u);M1(a,e.options.enableInputRules)&&y&&r.push(...y());const _=J(a,"addPasteRules",u);M1(a,e.options.enablePasteRules)&&_&&i.push(..._());const v=J(a,"addProseMirrorPlugins",u);if(v){const E=v();c.push(...E)}return c}).flat();return[DA({editor:e,rules:r}),...VA({editor:e,rules:i}),...s]}get attributes(){return k1(this.extensions)}get nodeViews(){const{editor:e}=this,{nodeExtensions:t}=Ja(this.extensions);return Object.fromEntries(t.filter(r=>!!J(r,"addNodeView")).map(r=>{const i=this.attributes.filter(c=>c.type===r.name),s={name:r.name,options:r.options,storage:r.storage,editor:e,type:qe(r.name,this.schema)},a=J(r,"addNodeView",s);if(!a)return[];const u=(c,h,m,d,y)=>{const _=Wf(c,i);return a()({node:c,view:h,getPos:m,decorations:d,innerDecorations:y,editor:e,extension:r,HTMLAttributes:_})};return[r.name,u]}))}setupExtensions(){this.extensions.forEach(e=>{var t;this.editor.extensionStorage[e.name]=e.storage;const r={name:e.name,options:e.options,storage:e.storage,editor:this.editor,type:Vf(e.name,this.schema)};e.type==="mark"&&(!((t=de(J(e,"keepOnSplit",r)))!==null&&t!==void 0)||t)&&this.splittableMarks.push(e.name);const i=J(e,"onBeforeCreate",r),s=J(e,"onCreate",r),a=J(e,"onUpdate",r),u=J(e,"onSelectionUpdate",r),c=J(e,"onTransaction",r),h=J(e,"onFocus",r),m=J(e,"onBlur",r),d=J(e,"onDestroy",r);i&&this.editor.on("beforeCreate",i),s&&this.editor.on("create",s),a&&this.editor.on("update",a),u&&this.editor.on("selectionUpdate",u),c&&this.editor.on("transaction",c),h&&this.editor.on("focus",h),m&&this.editor.on("blur",m),d&&this.editor.on("destroy",d)})}}class Re{constructor(e={}){this.type="extension",this.name="extension",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=de(J(this,"addOptions",{name:this.name}))),this.storage=de(J(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Re(e)}configure(e={}){const t=this.extend({...this.config,addOptions:()=>Xa(this.options,e)});return t.name=this.name,t.parent=this.parent,t}extend(e={}){const t=new Re({...this.config,...e});return t.parent=this,this.child=t,t.name=e.name?e.name:t.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`),t.options=de(J(t,"addOptions",{name:t.name})),t.storage=de(J(t,"addStorage",{name:t.name,options:t.options})),t}}function qA(n,e,t){const{from:r,to:i}=e,{blockSeparator:s=`
|
|
40
40
|
|
|
41
|
-
`,textSerializers:a={}}=t||{};let u="";return n.nodesBetween(r,i,(c,h,p,m)=>{var y;c.isBlock&&h>r&&(u+=s);const _=a?.[c.type.name];if(_)return p&&(u+=_({node:c,pos:h,parent:p,index:m,range:e})),!1;c.isText&&(u+=(y=c?.text)===null||y===void 0?void 0:y.slice(Math.max(r,h)-h,i-h))}),u}function UA(n){return Object.fromEntries(Object.entries(n.nodes).filter(([,e])=>e.spec.toText).map(([e,t])=>[e,t.spec.toText]))}Re.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new ct({key:new Mt("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:n}=this,{state:e,schema:t}=n,{doc:r,selection:i}=e,{ranges:s}=i,a=Math.min(...s.map(p=>p.$from.pos)),u=Math.max(...s.map(p=>p.$to.pos)),c=UA(t);return VA(r,{from:a,to:u},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:c})}}})]}});const qA=()=>({editor:n,view:e})=>(requestAnimationFrame(()=>{var t;n.isDestroyed||(e.dom.blur(),(t=window?.getSelection())===null||t===void 0||t.removeAllRanges())}),!0),KA=(n=!1)=>({commands:e})=>e.setContent("",n),GA=()=>({state:n,tr:e,dispatch:t})=>{const{selection:r}=e,{ranges:i}=r;return t&&i.forEach(({$from:s,$to:a})=>{n.doc.nodesBetween(s.pos,a.pos,(u,c)=>{if(u.type.isText)return;const{doc:h,mapping:p}=e,m=h.resolve(p.map(c)),y=h.resolve(p.map(c+u.nodeSize)),_=m.blockRange(y);if(!_)return;const S=Si(_);if(u.type.isTextblock){const{defaultType:E}=m.parent.contentMatchAt(m.index());e.setNodeMarkup(_.start,E)}(S||S===0)&&e.lift(_,S)})}),!0},JA=n=>e=>n(e),jA=()=>({state:n,dispatch:e})=>z0(n,e),YA=(n,e)=>({editor:t,tr:r})=>{const{state:i}=t,s=i.doc.slice(n.from,n.to);r.deleteRange(n.from,n.to);const a=r.mapping.map(e);return r.insert(a,s.content),r.setSelection(new pe(r.doc.resolve(a-1))),!0},XA=()=>({tr:n,dispatch:e})=>{const{selection:t}=n,r=t.$anchor.node();if(r.content.size>0)return!1;const i=n.selection.$anchor;for(let s=i.depth;s>0;s-=1)if(i.node(s).type===r.type){if(e){const u=i.before(s),c=i.after(s);n.delete(u,c).scrollIntoView()}return!0}return!1},ZA=n=>({tr:e,state:t,dispatch:r})=>{const i=qe(n,t.schema),s=e.selection.$anchor;for(let a=s.depth;a>0;a-=1)if(s.node(a).type===i){if(r){const c=s.before(a),h=s.after(a);e.delete(c,h).scrollIntoView()}return!0}return!1},QA=n=>({tr:e,dispatch:t})=>{const{from:r,to:i}=n;return t&&e.delete(r,i),!0},eT=()=>({state:n,dispatch:e})=>df(n,e),tT=()=>({commands:n})=>n.keyboardShortcut("Enter"),nT=()=>({state:n,dispatch:e})=>pA(n,e);function Ba(n,e,t={strict:!0}){const r=Object.keys(e);return r.length?r.every(i=>t.strict?e[i]===n[i]:vf(e[i])?e[i].test(n[i]):e[i]===n[i]):!0}function X0(n,e,t={}){return n.find(r=>r.type===e&&Ba(Object.fromEntries(Object.keys(t).map(i=>[i,r.attrs[i]])),t))}function Z0(n,e,t={}){return!!X0(n,e,t)}function Sf(n,e,t){var r;if(!n||!e)return;let i=n.parent.childAfter(n.parentOffset);if((!i.node||!i.node.marks.some(p=>p.type===e))&&(i=n.parent.childBefore(n.parentOffset)),!i.node||!i.node.marks.some(p=>p.type===e)||(t=t||((r=i.node.marks[0])===null||r===void 0?void 0:r.attrs),!X0([...i.node.marks],e,t)))return;let a=i.index,u=n.start()+i.offset,c=a+1,h=u+i.node.nodeSize;for(;a>0&&Z0([...n.parent.child(a-1).marks],e,t);)a-=1,u-=n.parent.child(a).nodeSize;for(;c<n.parent.childCount&&Z0([...n.parent.child(c).marks],e,t);)h+=n.parent.child(c).nodeSize,c+=1;return{from:u,to:h}}function mn(n,e){if(typeof n=="string"){if(!e.marks[n])throw Error(`There is no mark type named '${n}'. Maybe you forgot to add the extension?`);return e.marks[n]}return n}const rT=(n,e={})=>({tr:t,state:r,dispatch:i})=>{const s=mn(n,r.schema),{doc:a,selection:u}=t,{$from:c,from:h,to:p}=u;if(i){const m=Sf(c,s,e);if(m&&m.from<=h&&m.to>=p){const y=pe.create(a,m.from,m.to);t.setSelection(y)}}return!0},iT=n=>e=>{const t=typeof n=="function"?n(e):n;for(let r=0;r<t.length;r+=1)if(t[r](e))return!0;return!1};function Q0(n){return n instanceof pe}function qr(n=0,e=0,t=0){return Math.min(Math.max(n,e),t)}function sT(n,e=null){if(!e)return null;const t=ye.atStart(n),r=ye.atEnd(n);if(e==="start"||e===!0)return t;if(e==="end")return r;const i=t.from,s=r.to;return e==="all"?pe.create(n,qr(0,i,s),qr(n.content.size,i,s)):pe.create(n,qr(e,i,s),qr(e,i,s))}function oT(){return navigator.platform==="Android"||/android/i.test(navigator.userAgent)}function xf(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}const aT=(n=null,e={})=>({editor:t,view:r,tr:i,dispatch:s})=>{e={scrollIntoView:!0,...e};const a=()=>{(xf()||oT())&&r.dom.focus(),requestAnimationFrame(()=>{t.isDestroyed||(r.focus(),e?.scrollIntoView&&t.commands.scrollIntoView())})};if(r.hasFocus()&&n===null||n===!1)return!0;if(s&&n===null&&!Q0(t.state.selection))return a(),!0;const u=sT(i.doc,n)||t.state.selection,c=t.state.selection.eq(u);return s&&(c||i.setSelection(u),c&&i.storedMarks&&i.setStoredMarks(i.storedMarks),a()),!0},lT=(n,e)=>t=>n.every((r,i)=>e(r,{...t,index:i})),uT=(n,e)=>({tr:t,commands:r})=>r.insertContentAt({from:t.selection.from,to:t.selection.to},n,e),e1=n=>{const e=n.childNodes;for(let t=e.length-1;t>=0;t-=1){const r=e[t];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?n.removeChild(r):r.nodeType===1&&e1(r)}return n};function za(n){const e=`<body>${n}</body>`,t=new window.DOMParser().parseFromString(e,"text/html").body;return e1(t)}function $a(n,e,t){if(n instanceof fr||n instanceof z)return n;t={slice:!0,parseOptions:{},...t};const r=typeof n=="object"&&n!==null,i=typeof n=="string";if(r)try{if(Array.isArray(n)&&n.length>0)return z.fromArray(n.map(u=>e.nodeFromJSON(u)));const a=e.nodeFromJSON(n);return t.errorOnInvalidContent&&a.check(),a}catch(s){if(t.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:s});return console.warn("[tiptap warn]: Invalid content.","Passed value:",n,"Error:",s),$a("",e,t)}if(i){if(t.errorOnInvalidContent){let a=!1,u="";const c=new yg({topNode:e.spec.topNode,marks:e.spec.marks,nodes:e.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:h=>(a=!0,u=typeof h=="string"?h:h.outerHTML,null)}]}})});if(t.slice?_s.fromSchema(c).parseSlice(za(n),t.parseOptions):_s.fromSchema(c).parse(za(n),t.parseOptions),t.errorOnInvalidContent&&a)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${u}`)})}const s=_s.fromSchema(e);return t.slice?s.parseSlice(za(n),t.parseOptions).content:s.parse(za(n),t.parseOptions)}return $a("",e,t)}function cT(n,e,t){const r=n.steps.length-1;if(r<e)return;const i=n.steps[r];if(!(i instanceof je||i instanceof Je))return;const s=n.mapping.maps[r];let a=0;s.forEach((u,c,h,p)=>{a===0&&(a=p)}),n.setSelection(ye.near(n.doc.resolve(a),t))}const fT=n=>!("type"in n),hT=(n,e,t)=>({tr:r,dispatch:i,editor:s})=>{var a;if(i){t={parseOptions:s.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...t};let u;try{u=$a(e,s.schema,{parseOptions:{preserveWhitespace:"full",...t.parseOptions},errorOnInvalidContent:(a=t.errorOnInvalidContent)!==null&&a!==void 0?a:s.options.enableContentCheck})}catch(S){return s.emit("contentError",{editor:s,error:S,disableCollaboration:()=>{s.storage.collaboration&&(s.storage.collaboration.isDisabled=!0)}}),!1}let{from:c,to:h}=typeof n=="number"?{from:n,to:n}:{from:n.from,to:n.to},p=!0,m=!0;if((fT(u)?u:[u]).forEach(S=>{S.check(),p=p?S.isText&&S.marks.length===0:!1,m=m?S.isBlock:!1}),c===h&&m){const{parent:S}=r.doc.resolve(c);S.isTextblock&&!S.type.spec.code&&!S.childCount&&(c-=1,h+=1)}let _;if(p){if(Array.isArray(e))_=e.map(S=>S.text||"").join("");else if(e instanceof z){let S="";e.forEach(E=>{E.text&&(S+=E.text)}),_=S}else typeof e=="object"&&e&&e.text?_=e.text:_=e;r.insertText(_,c,h)}else _=u,r.replaceWith(c,h,_);t.updateSelection&&cT(r,r.steps.length-1,-1),t.applyInputRules&&r.setMeta("applyInputRules",{from:c,text:_}),t.applyPasteRules&&r.setMeta("applyPasteRules",{from:c,text:_})}return!0},dT=()=>({state:n,dispatch:e})=>fA(n,e),pT=()=>({state:n,dispatch:e})=>hA(n,e),mT=()=>({state:n,dispatch:e})=>N0(n,e),gT=()=>({state:n,dispatch:e})=>D0(n,e),yT=()=>({state:n,dispatch:e,tr:t})=>{try{const r=Sa(n.doc,n.selection.$from.pos,-1);return r==null?!1:(t.join(r,2),e&&e(t),!0)}catch{return!1}},bT=()=>({state:n,dispatch:e,tr:t})=>{try{const r=Sa(n.doc,n.selection.$from.pos,1);return r==null?!1:(t.join(r,2),e&&e(t),!0)}catch{return!1}},_T=()=>({state:n,dispatch:e})=>uA(n,e),wT=()=>({state:n,dispatch:e})=>cA(n,e);function t1(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function vT(n){const e=n.split(/-(?!$)/);let t=e[e.length-1];t==="Space"&&(t=" ");let r,i,s,a;for(let u=0;u<e.length-1;u+=1){const c=e[u];if(/^(cmd|meta|m)$/i.test(c))a=!0;else if(/^a(lt)?$/i.test(c))r=!0;else if(/^(c|ctrl|control)$/i.test(c))i=!0;else if(/^s(hift)?$/i.test(c))s=!0;else if(/^mod$/i.test(c))xf()||t1()?a=!0:i=!0;else throw new Error(`Unrecognized modifier name: ${c}`)}return r&&(t=`Alt-${t}`),i&&(t=`Ctrl-${t}`),a&&(t=`Meta-${t}`),s&&(t=`Shift-${t}`),t}const ST=n=>({editor:e,view:t,tr:r,dispatch:i})=>{const s=vT(n).split(/-(?!$)/),a=s.find(h=>!["Alt","Ctrl","Meta","Shift"].includes(h)),u=new KeyboardEvent("keydown",{key:a==="Space"?" ":a,altKey:s.includes("Alt"),ctrlKey:s.includes("Ctrl"),metaKey:s.includes("Meta"),shiftKey:s.includes("Shift"),bubbles:!0,cancelable:!0}),c=e.captureTransaction(()=>{t.someProp("handleKeyDown",h=>h(t,u))});return c?.steps.forEach(h=>{const p=h.map(r.mapping);p&&i&&r.maybeStep(p)}),!0};function Cf(n,e,t={}){const{from:r,to:i,empty:s}=n.selection,a=e?qe(e,n.schema):null,u=[];n.doc.nodesBetween(r,i,(m,y)=>{if(m.isText)return;const _=Math.max(r,y),S=Math.min(i,y+m.nodeSize);u.push({node:m,from:_,to:S})});const c=i-r,h=u.filter(m=>a?a.name===m.node.type.name:!0).filter(m=>Ba(m.node.attrs,t,{strict:!1}));return s?!!h.length:h.reduce((m,y)=>m+y.to-y.from,0)>=c}const xT=(n,e={})=>({state:t,dispatch:r})=>{const i=qe(n,t.schema);return Cf(t,i,e)?dA(t,r):!1},CT=()=>({state:n,dispatch:e})=>$0(n,e),ET=n=>({state:e,dispatch:t})=>{const r=qe(n,e.schema);return EA(r)(e,t)},kT=()=>({state:n,dispatch:e})=>B0(n,e);function Ef(n,e){return e.nodes[n]?"node":e.marks[n]?"mark":null}function n1(n,e){const t=typeof e=="string"?[e]:e;return Object.keys(n).reduce((r,i)=>(t.includes(i)||(r[i]=n[i]),r),{})}const AT=(n,e)=>({tr:t,state:r,dispatch:i})=>{let s=null,a=null;const u=Ef(typeof n=="string"?n:n.name,r.schema);return u?(u==="node"&&(s=qe(n,r.schema)),u==="mark"&&(a=mn(n,r.schema)),i&&t.selection.ranges.forEach(c=>{r.doc.nodesBetween(c.$from.pos,c.$to.pos,(h,p)=>{s&&s===h.type&&t.setNodeMarkup(p,void 0,n1(h.attrs,e)),a&&h.marks.length&&h.marks.forEach(m=>{a===m.type&&t.addMark(p,p+h.nodeSize,a.create(n1(m.attrs,e)))})})}),!0):!1},TT=()=>({tr:n,dispatch:e})=>(e&&n.scrollIntoView(),!0),OT=()=>({tr:n,dispatch:e})=>{if(e){const t=new Rt(n.doc);n.setSelection(t)}return!0},MT=()=>({state:n,dispatch:e})=>L0(n,e),IT=()=>({state:n,dispatch:e})=>F0(n,e),NT=()=>({state:n,dispatch:e})=>yA(n,e),RT=()=>({state:n,dispatch:e})=>wA(n,e),LT=()=>({state:n,dispatch:e})=>_A(n,e);function PT(n,e,t={},r={}){return $a(n,e,{slice:!1,parseOptions:t,errorOnInvalidContent:r.errorOnInvalidContent})}const DT=(n,e=!1,t={},r={})=>({editor:i,tr:s,dispatch:a,commands:u})=>{var c,h;const{doc:p}=s;if(t.preserveWhitespace!=="full"){const m=PT(n,i.schema,t,{errorOnInvalidContent:(c=r.errorOnInvalidContent)!==null&&c!==void 0?c:i.options.enableContentCheck});return a&&s.replaceWith(0,p.content.size,m).setMeta("preventUpdate",!e),!0}return a&&s.setMeta("preventUpdate",!e),u.insertContentAt({from:0,to:p.content.size},n,{parseOptions:t,errorOnInvalidContent:(h=r.errorOnInvalidContent)!==null&&h!==void 0?h:i.options.enableContentCheck})};function r1(n,e){const t=mn(e,n.schema),{from:r,to:i,empty:s}=n.selection,a=[];s?(n.storedMarks&&a.push(...n.storedMarks),a.push(...n.selection.$head.marks())):n.doc.nodesBetween(r,i,c=>{a.push(...c.marks)});const u=a.find(c=>c.type.name===t.name);return u?{...u.attrs}:{}}function FT(n,e){const t=new hk(n);return e.forEach(r=>{r.steps.forEach(i=>{t.step(i)})}),t}function BT(n){for(let e=0;e<n.edgeCount;e+=1){const{type:t}=n.edge(e);if(t.isTextblock&&!t.hasRequiredAttrs())return t}return null}function zT(n,e,t){const r=[];return n.nodesBetween(e.from,e.to,(i,s)=>{t(i)&&r.push({node:i,pos:s})}),r}function $T(n,e){for(let t=n.depth;t>0;t-=1){const r=n.node(t);if(e(r))return{pos:t>0?n.before(t):0,start:n.start(t),depth:t,node:r}}}function kf(n){return e=>$T(e.$from,n)}function HT(n,e){const t=Di.resolve(n);return G0(t,e)}function WT(n,e){const t=qe(e,n.schema),{from:r,to:i}=n.selection,s=[];n.doc.nodesBetween(r,i,u=>{s.push(u)});const a=s.reverse().find(u=>u.type.name===t.name);return a?{...a.attrs}:{}}function VT(n,e){const t=Ef(typeof e=="string"?e:e.name,n.schema);return t==="node"?WT(n,e):t==="mark"?r1(n,e):{}}function UT(n,e=JSON.stringify){const t={};return n.filter(r=>{const i=e(r);return Object.prototype.hasOwnProperty.call(t,i)?!1:t[i]=!0})}function qT(n){const e=UT(n);return e.length===1?e:e.filter((t,r)=>!e.filter((s,a)=>a!==r).some(s=>t.oldRange.from>=s.oldRange.from&&t.oldRange.to<=s.oldRange.to&&t.newRange.from>=s.newRange.from&&t.newRange.to<=s.newRange.to))}function KT(n){const{mapping:e,steps:t}=n,r=[];return e.maps.forEach((i,s)=>{const a=[];if(i.ranges.length)i.forEach((u,c)=>{a.push({from:u,to:c})});else{const{from:u,to:c}=t[s];if(u===void 0||c===void 0)return;a.push({from:u,to:c})}a.forEach(({from:u,to:c})=>{const h=e.slice(s).map(u,-1),p=e.slice(s).map(c),m=e.invert().map(h,-1),y=e.invert().map(p);r.push({oldRange:{from:m,to:y},newRange:{from:h,to:p}})})}),qT(r)}function i1(n,e,t){const r=[];return n===e?t.resolve(n).marks().forEach(i=>{const s=t.resolve(n),a=Sf(s,i.type);a&&r.push({mark:i,...a})}):t.nodesBetween(n,e,(i,s)=>{!i||i?.nodeSize===void 0||r.push(...i.marks.map(a=>({from:s,to:s+i.nodeSize,mark:a})))}),r}function Ha(n,e,t){return Object.fromEntries(Object.entries(t).filter(([r])=>{const i=n.find(s=>s.type===e&&s.name===r);return i?i.attribute.keepOnSplit:!1}))}function GT(n,e,t={}){const{empty:r,ranges:i}=n.selection,s=e?mn(e,n.schema):null;if(r)return!!(n.storedMarks||n.selection.$from.marks()).filter(m=>s?s.name===m.type.name:!0).find(m=>Ba(m.attrs,t,{strict:!1}));let a=0;const u=[];if(i.forEach(({$from:m,$to:y})=>{const _=m.pos,S=y.pos;n.doc.nodesBetween(_,S,(E,N)=>{if(!E.isText&&!E.marks.length)return;const g=Math.max(_,N),v=Math.min(S,N+E.nodeSize),k=v-g;a+=k,u.push(...E.marks.map(A=>({mark:A,from:g,to:v})))})}),a===0)return!1;const c=u.filter(m=>s?s.name===m.mark.type.name:!0).filter(m=>Ba(m.mark.attrs,t,{strict:!1})).reduce((m,y)=>m+y.to-y.from,0),h=u.filter(m=>s?m.mark.type!==s&&m.mark.type.excludes(s):!0).reduce((m,y)=>m+y.to-y.from,0);return(c>0?c+h:c)>=a}function s1(n,e){const{nodeExtensions:t}=Ra(e),r=t.find(a=>a.name===n);if(!r)return!1;const i={name:r.name,options:r.options,storage:r.storage},s=de(J(r,"group",i));return typeof s!="string"?!1:s.split(" ").includes("list")}function o1(n,{checkChildren:e=!0,ignoreWhitespace:t=!1}={}){var r;if(t){if(n.type.name==="hardBreak")return!0;if(n.isText)return/^\s*$/m.test((r=n.text)!==null&&r!==void 0?r:"")}if(n.isText)return!n.text;if(n.isAtom||n.isLeaf)return!1;if(n.content.childCount===0)return!0;if(e){let i=!0;return n.content.forEach(s=>{i!==!1&&(o1(s,{ignoreWhitespace:t,checkChildren:e})||(i=!1))}),i}return!1}function JT(n,e,t){var r;const{selection:i}=e;let s=null;if(Q0(i)&&(s=i.$cursor),s){const u=(r=n.storedMarks)!==null&&r!==void 0?r:s.marks();return!!t.isInSet(u)||!u.some(c=>c.type.excludes(t))}const{ranges:a}=i;return a.some(({$from:u,$to:c})=>{let h=u.depth===0?n.doc.inlineContent&&n.doc.type.allowsMarkType(t):!1;return n.doc.nodesBetween(u.pos,c.pos,(p,m,y)=>{if(h)return!1;if(p.isInline){const _=!y||y.type.allowsMarkType(t),S=!!t.isInSet(p.marks)||!p.marks.some(E=>E.type.excludes(t));h=_&&S}return!h}),h})}const jT=(n,e={})=>({tr:t,state:r,dispatch:i})=>{const{selection:s}=t,{empty:a,ranges:u}=s,c=mn(n,r.schema);if(i)if(a){const h=r1(r,c);t.addStoredMark(c.create({...h,...e}))}else u.forEach(h=>{const p=h.$from.pos,m=h.$to.pos;r.doc.nodesBetween(p,m,(y,_)=>{const S=Math.max(_,p),E=Math.min(_+y.nodeSize,m);y.marks.find(g=>g.type===c)?y.marks.forEach(g=>{c===g.type&&t.addMark(S,E,c.create({...g.attrs,...e}))}):t.addMark(S,E,c.create(e))})});return JT(r,t,c)},YT=(n,e)=>({tr:t})=>(t.setMeta(n,e),!0),XT=(n,e={})=>({state:t,dispatch:r,chain:i})=>{const s=qe(n,t.schema);let a;return t.selection.$anchor.sameParent(t.selection.$head)&&(a=t.selection.$anchor.parent.attrs),s.isTextblock?i().command(({commands:u})=>V0(s,{...a,...e})(t)?!0:u.clearNodes()).command(({state:u})=>V0(s,{...a,...e})(u,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},ZT=n=>({tr:e,dispatch:t})=>{if(t){const{doc:r}=e,i=qr(n,0,r.content.size),s=Q.create(r,i);e.setSelection(s)}return!0},QT=n=>({tr:e,dispatch:t})=>{if(t){const{doc:r}=e,{from:i,to:s}=typeof n=="number"?{from:n,to:n}:n,a=pe.atStart(r).from,u=pe.atEnd(r).to,c=qr(i,a,u),h=qr(s,a,u),p=pe.create(r,c,h);e.setSelection(p)}return!0},eO=n=>({state:e,dispatch:t})=>{const r=qe(n,e.schema);return TA(r)(e,t)};function a1(n,e){const t=n.storedMarks||n.selection.$to.parentOffset&&n.selection.$from.marks();if(t){const r=t.filter(i=>e?.includes(i.type.name));n.tr.ensureMarks(r)}}const tO=({keepMarks:n=!0}={})=>({tr:e,state:t,dispatch:r,editor:i})=>{const{selection:s,doc:a}=e,{$from:u,$to:c}=s,h=i.extensionManager.attributes,p=Ha(h,u.node().type.name,u.node().attrs);if(s instanceof Q&&s.node.isBlock)return!u.parentOffset||!zn(a,u.pos)?!1:(r&&(n&&a1(t,i.extensionManager.splittableMarks),e.split(u.pos).scrollIntoView()),!0);if(!u.parent.isBlock)return!1;const m=c.parentOffset===c.parent.content.size,y=u.depth===0?void 0:BT(u.node(-1).contentMatchAt(u.indexAfter(-1)));let _=m&&y?[{type:y,attrs:p}]:void 0,S=zn(e.doc,e.mapping.map(u.pos),1,_);if(!_&&!S&&zn(e.doc,e.mapping.map(u.pos),1,y?[{type:y}]:void 0)&&(S=!0,_=y?[{type:y,attrs:p}]:void 0),r){if(S&&(s instanceof pe&&e.deleteSelection(),e.split(e.mapping.map(u.pos),1,_),y&&!m&&!u.parentOffset&&u.parent.type!==y)){const E=e.mapping.map(u.before()),N=e.doc.resolve(E);u.node(-1).canReplaceWith(N.index(),N.index()+1,y)&&e.setNodeMarkup(e.mapping.map(u.before()),y)}n&&a1(t,i.extensionManager.splittableMarks),e.scrollIntoView()}return S},nO=(n,e={})=>({tr:t,state:r,dispatch:i,editor:s})=>{var a;const u=qe(n,r.schema),{$from:c,$to:h}=r.selection,p=r.selection.node;if(p&&p.isBlock||c.depth<2||!c.sameParent(h))return!1;const m=c.node(-1);if(m.type!==u)return!1;const y=s.extensionManager.attributes;if(c.parent.content.size===0&&c.node(-1).childCount===c.indexAfter(-1)){if(c.depth===2||c.node(-3).type!==u||c.index(-2)!==c.node(-2).childCount-1)return!1;if(i){let g=z.empty;const v=c.index(-1)?1:c.index(-2)?2:3;for(let H=c.depth-v;H>=c.depth-3;H-=1)g=z.from(c.node(H).copy(g));const k=c.indexAfter(-1)<c.node(-2).childCount?1:c.indexAfter(-2)<c.node(-3).childCount?2:3,A={...Ha(y,c.node().type.name,c.node().attrs),...e},T=((a=u.contentMatch.defaultType)===null||a===void 0?void 0:a.createAndFill(A))||void 0;g=g.append(z.from(u.createAndFill(null,T)||void 0));const F=c.before(c.depth-(v-1));t.replace(F,c.after(-k),new K(g,4-v,0));let U=-1;t.doc.nodesBetween(F,t.doc.content.size,(H,ee)=>{if(U>-1)return!1;H.isTextblock&&H.content.size===0&&(U=ee+1)}),U>-1&&t.setSelection(pe.near(t.doc.resolve(U))),t.scrollIntoView()}return!0}const _=h.pos===c.end()?m.contentMatchAt(0).defaultType:null,S={...Ha(y,m.type.name,m.attrs),...e},E={...Ha(y,c.node().type.name,c.node().attrs),...e};t.delete(c.pos,h.pos);const N=_?[{type:u,attrs:S},{type:_,attrs:E}]:[{type:u,attrs:S}];if(!zn(t.doc,c.pos,2))return!1;if(i){const{selection:g,storedMarks:v}=r,{splittableMarks:k}=s.extensionManager,A=v||g.$to.parentOffset&&g.$from.marks();if(t.split(c.pos,2,N).scrollIntoView(),!A||!i)return!0;const T=A.filter(F=>k.includes(F.type.name));t.ensureMarks(T)}return!0},Af=(n,e)=>{const t=kf(a=>a.type===e)(n.selection);if(!t)return!0;const r=n.doc.resolve(Math.max(0,t.pos-1)).before(t.depth);if(r===void 0)return!0;const i=n.doc.nodeAt(r);return t.node.type===i?.type&&hr(n.doc,t.pos)&&n.join(t.pos),!0},Tf=(n,e)=>{const t=kf(a=>a.type===e)(n.selection);if(!t)return!0;const r=n.doc.resolve(t.start).after(t.depth);if(r===void 0)return!0;const i=n.doc.nodeAt(r);return t.node.type===i?.type&&hr(n.doc,r)&&n.join(r),!0},rO=(n,e,t,r={})=>({editor:i,tr:s,state:a,dispatch:u,chain:c,commands:h,can:p})=>{const{extensions:m,splittableMarks:y}=i.extensionManager,_=qe(n,a.schema),S=qe(e,a.schema),{selection:E,storedMarks:N}=a,{$from:g,$to:v}=E,k=g.blockRange(v),A=N||E.$to.parentOffset&&E.$from.marks();if(!k)return!1;const T=kf(F=>s1(F.type.name,m))(E);if(k.depth>=1&&T&&k.depth-T.depth<=1){if(T.node.type===_)return h.liftListItem(S);if(s1(T.node.type.name,m)&&_.validContent(T.node.content)&&u)return c().command(()=>(s.setNodeMarkup(T.pos,_),!0)).command(()=>Af(s,_)).command(()=>Tf(s,_)).run()}return!t||!A||!u?c().command(()=>p().wrapInList(_,r)?!0:h.clearNodes()).wrapInList(_,r).command(()=>Af(s,_)).command(()=>Tf(s,_)).run():c().command(()=>{const F=p().wrapInList(_,r),U=A.filter(H=>y.includes(H.type.name));return s.ensureMarks(U),F?!0:h.clearNodes()}).wrapInList(_,r).command(()=>Af(s,_)).command(()=>Tf(s,_)).run()},iO=(n,e={},t={})=>({state:r,commands:i})=>{const{extendEmptyMarkRange:s=!1}=t,a=mn(n,r.schema);return GT(r,a,e)?i.unsetMark(a,{extendEmptyMarkRange:s}):i.setMark(a,e)},sO=(n,e,t={})=>({state:r,commands:i})=>{const s=qe(n,r.schema),a=qe(e,r.schema),u=Cf(r,s,t);let c;return r.selection.$anchor.sameParent(r.selection.$head)&&(c=r.selection.$anchor.parent.attrs),u?i.setNode(a,c):i.setNode(s,{...c,...t})},oO=(n,e={})=>({state:t,commands:r})=>{const i=qe(n,t.schema);return Cf(t,i,e)?r.lift(i):r.wrapIn(i,e)},aO=()=>({state:n,dispatch:e})=>{const t=n.plugins;for(let r=0;r<t.length;r+=1){const i=t[r];let s;if(i.spec.isInputRules&&(s=i.getState(n))){if(e){const a=n.tr,u=s.transform;for(let c=u.steps.length-1;c>=0;c-=1)a.step(u.steps[c].invert(u.docs[c]));if(s.text){const c=a.doc.resolve(s.from).marks();a.replaceWith(s.from,s.to,n.schema.text(s.text,c))}else a.delete(s.from,s.to)}return!0}}return!1},lO=()=>({tr:n,dispatch:e})=>{const{selection:t}=n,{empty:r,ranges:i}=t;return r||e&&i.forEach(s=>{n.removeMark(s.$from.pos,s.$to.pos)}),!0},uO=(n,e={})=>({tr:t,state:r,dispatch:i})=>{var s;const{extendEmptyMarkRange:a=!1}=e,{selection:u}=t,c=mn(n,r.schema),{$from:h,empty:p,ranges:m}=u;if(!i)return!0;if(p&&a){let{from:y,to:_}=u;const S=(s=h.marks().find(N=>N.type===c))===null||s===void 0?void 0:s.attrs,E=Sf(h,c,S);E&&(y=E.from,_=E.to),t.removeMark(y,_,c)}else m.forEach(y=>{t.removeMark(y.$from.pos,y.$to.pos,c)});return t.removeStoredMark(c),!0},cO=(n,e={})=>({tr:t,state:r,dispatch:i})=>{let s=null,a=null;const u=Ef(typeof n=="string"?n:n.name,r.schema);return u?(u==="node"&&(s=qe(n,r.schema)),u==="mark"&&(a=mn(n,r.schema)),i&&t.selection.ranges.forEach(c=>{const h=c.$from.pos,p=c.$to.pos;let m,y,_,S;t.selection.empty?r.doc.nodesBetween(h,p,(E,N)=>{s&&s===E.type&&(_=Math.max(N,h),S=Math.min(N+E.nodeSize,p),m=N,y=E)}):r.doc.nodesBetween(h,p,(E,N)=>{N<h&&s&&s===E.type&&(_=Math.max(N,h),S=Math.min(N+E.nodeSize,p),m=N,y=E),N>=h&&N<=p&&(s&&s===E.type&&t.setNodeMarkup(N,void 0,{...E.attrs,...e}),a&&E.marks.length&&E.marks.forEach(g=>{if(a===g.type){const v=Math.max(N,h),k=Math.min(N+E.nodeSize,p);t.addMark(v,k,a.create({...g.attrs,...e}))}}))}),y&&(m!==void 0&&t.setNodeMarkup(m,void 0,{...y.attrs,...e}),a&&y.marks.length&&y.marks.forEach(E=>{a===E.type&&t.addMark(_,S,a.create({...E.attrs,...e}))}))}),!0):!1},fO=(n,e={})=>({state:t,dispatch:r})=>{const i=qe(n,t.schema);return vA(i,e)(t,r)},hO=(n,e={})=>({state:t,dispatch:r})=>{const i=qe(n,t.schema);return SA(i,e)(t,r)};var dO=Object.freeze({__proto__:null,blur:qA,clearContent:KA,clearNodes:GA,command:JA,createParagraphNear:jA,cut:YA,deleteCurrentNode:XA,deleteNode:ZA,deleteRange:QA,deleteSelection:eT,enter:tT,exitCode:nT,extendMarkRange:rT,first:iT,focus:aT,forEach:lT,insertContent:uT,insertContentAt:hT,joinBackward:mT,joinDown:pT,joinForward:gT,joinItemBackward:yT,joinItemForward:bT,joinTextblockBackward:_T,joinTextblockForward:wT,joinUp:dT,keyboardShortcut:ST,lift:xT,liftEmptyBlock:CT,liftListItem:ET,newlineInCode:kT,resetAttributes:AT,scrollIntoView:TT,selectAll:OT,selectNodeBackward:MT,selectNodeForward:IT,selectParentNode:NT,selectTextblockEnd:RT,selectTextblockStart:LT,setContent:DT,setMark:jT,setMeta:YT,setNode:XT,setNodeSelection:ZT,setTextSelection:QT,sinkListItem:eO,splitBlock:tO,splitListItem:nO,toggleList:rO,toggleMark:iO,toggleNode:sO,toggleWrap:oO,undoInputRule:aO,unsetAllMarks:lO,unsetMark:uO,updateAttributes:cO,wrapIn:fO,wrapInList:hO});Re.create({name:"commands",addCommands(){return{...dO}}}),Re.create({name:"drop",addProseMirrorPlugins(){return[new ct({key:new Mt("tiptapDrop"),props:{handleDrop:(n,e,t,r)=>{this.editor.emit("drop",{editor:this.editor,event:e,slice:t,moved:r})}}})]}}),Re.create({name:"editable",addProseMirrorPlugins(){return[new ct({key:new Mt("editable"),props:{editable:()=>this.editor.options.editable}})]}}),Re.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:n}=this;return[new ct({key:new Mt("focusEvents"),props:{handleDOMEvents:{focus:(e,t)=>{n.isFocused=!0;const r=n.state.tr.setMeta("focus",{event:t}).setMeta("addToHistory",!1);return e.dispatch(r),!1},blur:(e,t)=>{n.isFocused=!1;const r=n.state.tr.setMeta("blur",{event:t}).setMeta("addToHistory",!1);return e.dispatch(r),!1}}}})]}}),Re.create({name:"keymap",addKeyboardShortcuts(){const n=()=>this.editor.commands.first(({commands:a})=>[()=>a.undoInputRule(),()=>a.command(({tr:u})=>{const{selection:c,doc:h}=u,{empty:p,$anchor:m}=c,{pos:y,parent:_}=m,S=m.parent.isTextblock&&y>0?u.doc.resolve(y-1):m,E=S.parent.type.spec.isolating,N=m.pos-m.parentOffset,g=E&&S.parent.childCount===1?N===m.pos:ye.atStart(h).from===y;return!p||!_.type.isTextblock||_.textContent.length||!g||g&&m.parent.type.name==="paragraph"?!1:a.clearNodes()}),()=>a.deleteSelection(),()=>a.joinBackward(),()=>a.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:a})=>[()=>a.deleteSelection(),()=>a.deleteCurrentNode(),()=>a.joinForward(),()=>a.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:a})=>[()=>a.newlineInCode(),()=>a.createParagraphNear(),()=>a.liftEmptyBlock(),()=>a.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:n,"Mod-Backspace":n,"Shift-Backspace":n,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},i={...r},s={...r,"Ctrl-h":n,"Alt-Backspace":n,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return xf()||t1()?s:i},addProseMirrorPlugins(){return[new ct({key:new Mt("clearDocument"),appendTransaction:(n,e,t)=>{if(n.some(E=>E.getMeta("composition")))return;const r=n.some(E=>E.docChanged)&&!e.doc.eq(t.doc),i=n.some(E=>E.getMeta("preventClearDocument"));if(!r||i)return;const{empty:s,from:a,to:u}=e.selection,c=ye.atStart(e.doc).from,h=ye.atEnd(e.doc).to;if(s||!(a===c&&u===h)||!o1(t.doc))return;const y=t.tr,_=Na({state:t,transaction:y}),{commands:S}=new bf({editor:this.editor,state:_});if(S.clearNodes(),!!y.steps.length)return y}})]}}),Re.create({name:"paste",addProseMirrorPlugins(){return[new ct({key:new Mt("tiptapPaste"),props:{handlePaste:(n,e,t)=>{this.editor.emit("paste",{editor:this.editor,event:e,slice:t})}}})]}}),Re.create({name:"tabindex",addProseMirrorPlugins(){return[new ct({key:new Mt("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}});function pO(n){return new Y0({find:n.find,handler:({state:e,range:t,match:r})=>{const i=e.doc.resolve(t.from),s=de(n.getAttributes,void 0,r)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),n.type))return null;e.tr.delete(t.from,t.to).setBlockType(t.from,t.from,n.type,s)}})}function mO(n){return new Y0({find:n.find,handler:({state:e,range:t,match:r,chain:i})=>{const s=de(n.getAttributes,void 0,r)||{},a=e.tr.delete(t.from,t.to),c=a.doc.resolve(t.from).blockRange(),h=c&&Vc(c,n.type,s);if(!h)return null;if(a.wrap(c,h),n.keepMarks&&n.editor){const{selection:m,storedMarks:y}=e,{splittableMarks:_}=n.editor.extensionManager,S=y||m.$to.parentOffset&&m.$from.marks();if(S){const E=S.filter(N=>_.includes(N.type.name));a.ensureMarks(E)}}if(n.keepAttributes){const m=n.type.name==="bulletList"||n.type.name==="orderedList"?"listItem":"taskList";i().updateAttributes(m,s).run()}const p=a.doc.resolve(t.from-1).nodeBefore;p&&p.type===n.type&&hr(a.doc,t.from-1)&&(!n.joinPredicate||n.joinPredicate(r,p))&&a.join(t.from-1)}})}class jn{constructor(e={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=de(J(this,"addOptions",{name:this.name}))),this.storage=de(J(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new jn(e)}configure(e={}){const t=this.extend({...this.config,addOptions:()=>Da(this.options,e)});return t.name=this.name,t.parent=this.parent,t}extend(e={}){const t=new jn(e);return t.parent=this,this.child=t,t.name=e.name?e.name:t.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`),t.options=de(J(t,"addOptions",{name:t.name})),t.storage=de(J(t,"addStorage",{name:t.name,options:t.options})),t}}function gO(n){return new FA({find:n.find,handler:({state:e,range:t,match:r,pasteEvent:i})=>{const s=de(n.getAttributes,void 0,r,i);if(s===!1||s===null)return null;const{tr:a}=e,u=r[r.length-1],c=r[0];let h=t.to;if(u){const p=c.search(/\S/),m=t.from+c.indexOf(u),y=m+u.length;if(i1(t.from,t.to,e.doc).filter(S=>S.mark.type.excluded.find(N=>N===n.type&&N!==S.mark.type)).filter(S=>S.to>m).length)return null;y<t.to&&a.delete(y,t.to),m>t.from&&a.delete(t.from+p,m),h=t.from+p+u.length,a.addMark(t.from+p,h,n.type.create(s||{})),a.removeStoredMark(n.type)}}})}const yO=jn.create({name:"text",group:"inline"});var Wa=200,Ke=function(){};Ke.prototype.append=function(e){return e.length?(e=Ke.from(e),!this.length&&e||e.length<Wa&&this.leafAppend(e)||this.length<Wa&&e.leafPrepend(this)||this.appendInner(e)):this},Ke.prototype.prepend=function(e){return e.length?Ke.from(e).append(this):this},Ke.prototype.appendInner=function(e){return new bO(this,e)},Ke.prototype.slice=function(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.length),e>=t?Ke.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},Ke.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},Ke.prototype.forEach=function(e,t,r){t===void 0&&(t=0),r===void 0&&(r=this.length),t<=r?this.forEachInner(e,t,r,0):this.forEachInvertedInner(e,t,r,0)},Ke.prototype.map=function(e,t,r){t===void 0&&(t=0),r===void 0&&(r=this.length);var i=[];return this.forEach(function(s,a){return i.push(e(s,a))},t,r),i},Ke.from=function(e){return e instanceof Ke?e:e&&e.length?new l1(e):Ke.empty};var l1=function(n){function e(r){n.call(this),this.values=r}n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e;var t={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(i,s){return i==0&&s==this.length?this:new e(this.values.slice(i,s))},e.prototype.getInner=function(i){return this.values[i]},e.prototype.forEachInner=function(i,s,a,u){for(var c=s;c<a;c++)if(i(this.values[c],u+c)===!1)return!1},e.prototype.forEachInvertedInner=function(i,s,a,u){for(var c=s-1;c>=a;c--)if(i(this.values[c],u+c)===!1)return!1},e.prototype.leafAppend=function(i){if(this.length+i.length<=Wa)return new e(this.values.concat(i.flatten()))},e.prototype.leafPrepend=function(i){if(this.length+i.length<=Wa)return new e(i.flatten().concat(this.values))},t.length.get=function(){return this.values.length},t.depth.get=function(){return 0},Object.defineProperties(e.prototype,t),e}(Ke);Ke.empty=new l1([]);var bO=function(n){function e(t,r){n.call(this),this.left=t,this.right=r,this.length=t.length+r.length,this.depth=Math.max(t.depth,r.depth)+1}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(r){return r<this.left.length?this.left.get(r):this.right.get(r-this.left.length)},e.prototype.forEachInner=function(r,i,s,a){var u=this.left.length;if(i<u&&this.left.forEachInner(r,i,Math.min(s,u),a)===!1||s>u&&this.right.forEachInner(r,Math.max(i-u,0),Math.min(this.length,s)-u,a+u)===!1)return!1},e.prototype.forEachInvertedInner=function(r,i,s,a){var u=this.left.length;if(i>u&&this.right.forEachInvertedInner(r,i-u,Math.max(s,u)-u,a+u)===!1||s<u&&this.left.forEachInvertedInner(r,Math.min(i,u),s,a)===!1)return!1},e.prototype.sliceInner=function(r,i){if(r==0&&i==this.length)return this;var s=this.left.length;return i<=s?this.left.slice(r,i):r>=s?this.right.slice(r-s,i-s):this.left.slice(r,s).append(this.right.slice(0,i-s))},e.prototype.leafAppend=function(r){var i=this.right.leafAppend(r);if(i)return new e(this.left,i)},e.prototype.leafPrepend=function(r){var i=this.left.leafPrepend(r);if(i)return new e(i,this.right)},e.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new e(this.left,new e(this.right,r)):new e(this,r)},e}(Ke);const _O=500;class un{constructor(e,t){this.items=e,this.eventCount=t}popEvent(e,t){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,s;t&&(i=this.remapping(r,this.items.length),s=i.maps.length);let a=e.tr,u,c,h=[],p=[];return this.items.forEach((m,y)=>{if(!m.step){i||(i=this.remapping(r,y+1),s=i.maps.length),s--,p.push(m);return}if(i){p.push(new bn(m.map));let _=m.step.map(i.slice(s)),S;_&&a.maybeStep(_).doc&&(S=a.mapping.maps[a.mapping.maps.length-1],h.push(new bn(S,void 0,void 0,h.length+p.length))),s--,S&&i.appendMap(S,s)}else a.maybeStep(m.step);if(m.selection)return u=i?m.selection.map(i.slice(s)):m.selection,c=new un(this.items.slice(0,r).append(p.reverse().concat(h)),this.eventCount-1),!1},this.items.length,0),{remaining:c,transform:a,selection:u}}addTransform(e,t,r,i){let s=[],a=this.eventCount,u=this.items,c=!i&&u.length?u.get(u.length-1):null;for(let p=0;p<e.steps.length;p++){let m=e.steps[p].invert(e.docs[p]),y=new bn(e.mapping.maps[p],m,t),_;(_=c&&c.merge(y))&&(y=_,p?s.pop():u=u.slice(0,u.length-1)),s.push(y),t&&(a++,t=void 0),i||(c=y)}let h=a-r.depth;return h>vO&&(u=wO(u,h),a-=h),new un(u.append(s),a)}remapping(e,t){let r=new Fi;return this.items.forEach((i,s)=>{let a=i.mirrorOffset!=null&&s-i.mirrorOffset>=e?r.maps.length-i.mirrorOffset:void 0;r.appendMap(i.map,a)},e,t),r}addMaps(e){return this.eventCount==0?this:new un(this.items.append(e.map(t=>new bn(t))),this.eventCount)}rebased(e,t){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-t),s=e.mapping,a=e.steps.length,u=this.eventCount;this.items.forEach(y=>{y.selection&&u--},i);let c=t;this.items.forEach(y=>{let _=s.getMirror(--c);if(_==null)return;a=Math.min(a,_);let S=s.maps[_];if(y.step){let E=e.steps[_].invert(e.docs[_]),N=y.selection&&y.selection.map(s.slice(c+1,_));N&&u++,r.push(new bn(S,E,N))}else r.push(new bn(S))},i);let h=[];for(let y=t;y<a;y++)h.push(new bn(s.maps[y]));let p=this.items.slice(0,i).append(h).append(r),m=new un(p,u);return m.emptyItemCount()>_O&&(m=m.compress(this.items.length-r.length)),m}emptyItemCount(){let e=0;return this.items.forEach(t=>{t.step||e++}),e}compress(e=this.items.length){let t=this.remapping(0,e),r=t.maps.length,i=[],s=0;return this.items.forEach((a,u)=>{if(u>=e)i.push(a),a.selection&&s++;else if(a.step){let c=a.step.map(t.slice(r)),h=c&&c.getMap();if(r--,h&&t.appendMap(h,r),c){let p=a.selection&&a.selection.map(t.slice(r));p&&s++;let m=new bn(h.invert(),c,p),y,_=i.length-1;(y=i.length&&i[_].merge(m))?i[_]=y:i.push(m)}}else a.map&&r--},this.items.length,0),new un(Ke.from(i.reverse()),s)}}un.empty=new un(Ke.empty,0);function wO(n,e){let t;return n.forEach((r,i)=>{if(r.selection&&e--==0)return t=i,!1}),n.slice(t)}class bn{constructor(e,t,r,i){this.map=e,this.step=t,this.selection=r,this.mirrorOffset=i}merge(e){if(this.step&&e.step&&!e.selection){let t=e.step.merge(this.step);if(t)return new bn(t.getMap().invert(),t,this.selection)}}}class br{constructor(e,t,r,i,s){this.done=e,this.undone=t,this.prevRanges=r,this.prevTime=i,this.prevComposition=s}}const vO=20;function SO(n,e,t,r){let i=t.getMeta(Kr),s;if(i)return i.historyState;t.getMeta(EO)&&(n=new br(n.done,n.undone,null,0,-1));let a=t.getMeta("appendedTransaction");if(t.steps.length==0)return n;if(a&&a.getMeta(Kr))return a.getMeta(Kr).redo?new br(n.done.addTransform(t,void 0,r,Va(e)),n.undone,u1(t.mapping.maps),n.prevTime,n.prevComposition):new br(n.done,n.undone.addTransform(t,void 0,r,Va(e)),null,n.prevTime,n.prevComposition);if(t.getMeta("addToHistory")!==!1&&!(a&&a.getMeta("addToHistory")===!1)){let u=t.getMeta("composition"),c=n.prevTime==0||!a&&n.prevComposition!=u&&(n.prevTime<(t.time||0)-r.newGroupDelay||!xO(t,n.prevRanges)),h=a?Of(n.prevRanges,t.mapping):u1(t.mapping.maps);return new br(n.done.addTransform(t,c?e.selection.getBookmark():void 0,r,Va(e)),un.empty,h,t.time,u??n.prevComposition)}else return(s=t.getMeta("rebased"))?new br(n.done.rebased(t,s),n.undone.rebased(t,s),Of(n.prevRanges,t.mapping),n.prevTime,n.prevComposition):new br(n.done.addMaps(t.mapping.maps),n.undone.addMaps(t.mapping.maps),Of(n.prevRanges,t.mapping),n.prevTime,n.prevComposition)}function xO(n,e){if(!e)return!1;if(!n.docChanged)return!0;let t=!1;return n.mapping.maps[0].forEach((r,i)=>{for(let s=0;s<e.length;s+=2)r<=e[s+1]&&i>=e[s]&&(t=!0)}),t}function u1(n){let e=[];for(let t=n.length-1;t>=0&&e.length==0;t--)n[t].forEach((r,i,s,a)=>e.push(s,a));return e}function Of(n,e){if(!n)return null;let t=[];for(let r=0;r<n.length;r+=2){let i=e.map(n[r],1),s=e.map(n[r+1],-1);i<=s&&t.push(i,s)}return t}function CO(n,e,t){let r=Va(e),i=Kr.get(e).spec.config,s=(t?n.undone:n.done).popEvent(e,r);if(!s)return null;let a=s.selection.resolve(s.transform.doc),u=(t?n.done:n.undone).addTransform(s.transform,e.selection.getBookmark(),i,r),c=new br(t?u:s.remaining,t?s.remaining:u,null,0,-1);return s.transform.setSelection(a).setMeta(Kr,{redo:t,historyState:c})}let Mf=!1,c1=null;function Va(n){let e=n.plugins;if(c1!=e){Mf=!1,c1=e;for(let t=0;t<e.length;t++)if(e[t].spec.historyPreserveItems){Mf=!0;break}}return Mf}const Kr=new Mt("history"),EO=new Mt("closeHistory");function kO(n={}){return n={depth:n.depth||100,newGroupDelay:n.newGroupDelay||500},new ct({key:Kr,state:{init(){return new br(un.empty,un.empty,null,0,-1)},apply(e,t,r){return SO(t,r,e,n)}},config:n,props:{handleDOMEvents:{beforeinput(e,t){let r=t.inputType,i=r=="historyUndo"?h1:r=="historyRedo"?d1:null;return i?(t.preventDefault(),i(e.state,e.dispatch)):!1}}}})}function f1(n,e){return(t,r)=>{let i=Kr.getState(t);if(!i||(n?i.undone:i.done).eventCount==0)return!1;if(r){let s=CO(i,t,n);s&&r(e?s.scrollIntoView():s)}return!0}}const h1=f1(!1,!0),d1=f1(!0,!0),AO=Re.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:n,dispatch:e})=>h1(n,e),redo:()=>({state:n,dispatch:e})=>d1(n,e)}},addProseMirrorPlugins(){return[kO(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 If=(n=>(n.COMMON="common",n.DESKTOP="desktop",n.TABLET="tablet",n.MOBILE="mobile",n))(If||{});const TO=["common","mobile","tablet","desktop"];var Ua=(n=>(n.UPPERCASE="uppercase",n.LOWERCASE="lowercase",n.CAPITALIZE="capitalize",n))(Ua||{}),_r=(n=>(n.LEFT="left",n.CENTER="center",n.RIGHT="right",n.JUSTIFY="justify",n))(_r||{});const OO=["left","center","right","justify"];var oe=(n=>(n.DOCUMENT="doc",n.PARAGRAPH="paragraph",n.HEADING="heading",n.LIST="list",n.LIST_ITEM="listItem",n.TEXT="text",n))(oe||{});const Nf=["paragraph","list","heading"];var an=(n=>(n.DISC="disc",n.CIRCLE="circle",n.SQUARE="square",n.DECIMAL="decimal",n.ROMAN="roman",n.LATIN="latin",n))(an||{});const MO=["disc","circle","square","decimal","roman","latin"],IO=["decimal","roman","latin"];var Oe=(n=>(n.ALIGNMENT="alignment",n.BACKGROUND_COLOR="background_color",n.FONT_COLOR="font_color",n.FONT_FAMILY="font_family",n.FONT_SIZE="font_size",n.FONT_STYLE="font_style",n.FONT_WEIGHT="font_weight",n.LINE_HEIGHT="line_height",n.TEXT_DECORATION="text_decoration",n.SUPERSCRIPT="superscript",n.MARGIN="margin",n.LINK="link",n.STYLE_PRESET="style_preset",n))(Oe||{});const p1=["alignment","line_height","margin"],qa=["line_height"],m1=["text_decoration","link","superscript","background_color"],g1=["background_color","font_color","font_family","font_size","font_style","font_weight","text_decoration","superscript"];var Gt=(n=>(n.SETTINGS="settings",n.ALL="_",n))(Gt||{}),Rf=(n=>(n.BLANK="_blank",n.SELF="_self",n))(Rf||{}),Mi=(n=>(n.URL="url",n.BLOCK="block",n))(Mi||{});class Lf{static create(e,t){const r=new this(e,t||{});return new ct({key:new Mt(this.name),props:r._buildProps()})}constructor(e,t){this.options=t,this.editor=e}_buildProps(){const t=Object.entries(this.addProps()).map(([r,i])=>[r,i.bind(this)]);return Object.fromEntries(t)}addProps(){return{}}}class NO extends Lf{addProps(){return{transformPastedHTML:this._transformPastedHTML,handlePaste:this._handlePaste}}_transformPastedHTML(e){if(e.includes("data-pm-slice")&&e.includes("zw-style"))return e;const t=Bl.build(e);return t.normalizeHTML(),this._removeDeprecatedStyles(t),t.normalizedHTML}_removeDeprecatedStyles(e){const t=e.dom.querySelectorAll('[style*="margin"]');for(const r of Array.from(t))r.style.removeProperty("margin"),r.style.removeProperty("margin-top"),r.style.removeProperty("margin-right"),r.style.removeProperty("margin-bottom"),r.style.removeProperty("margin-left")}_handlePaste(e,t,r){const i=this._insertPastedContent(e,r).scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste");return e.dispatch(i),!0}_insertPastedContent({state:e},t){return this._isFullBlockSelected(e)?e.tr.replaceSelectionWith(t.content,!1):e.tr.replaceSelection(t)}_isFullBlockSelected(e){const t=this._expandSelectionToBlocks(e),r=this._isMatchPosition(t.from,e.selection.from),i=this._isMatchPosition(t.to,e.selection.to);return r&&i}_expandSelectionToBlocks({selection:e,doc:t}){let r=e.from,i=e.to;return t.nodesBetween(r,i,(s,a,u)=>{u.type.name===oe.DOCUMENT&&(r=Math.min(r,a+1),i=Math.max(i,a+s.nodeSize-1))}),{from:r,to:i}}_isMatchPosition(e,t){return Math.abs(e-t)<5}}class RO extends Lf{addProps(){return{decorations:this._buildDecorations}}_buildDecorations({doc:e}){const t=[];if(!this.editor.isEditable)return null;if(!(e.childCount>1))return e.descendants((r,i)=>{if(!r.childCount){const s=vn.node(i,i+r.nodeSize,{class:"zw-wysiwyg__placeholder","data-placeholder":"Type your text here..."});t.push(s)}return!1}),Ye.create(e,t)}}const LO="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2ntley5rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6logistics9properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3ncaster6d0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2psy3ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0america6xi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5m\xF6gensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",PO="\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",Ii=(n,e)=>{for(const t in e)n[t]=e[t];return n},Pf="numeric",Df="ascii",Ff="alpha",Ts="asciinumeric",Os="alphanumeric",Bf="domain",y1="emoji",DO="scheme",FO="slashscheme",zf="whitespace";function BO(n,e){return n in e||(e[n]=[]),e[n]}function Gr(n,e,t){e[Pf]&&(e[Ts]=!0,e[Os]=!0),e[Df]&&(e[Ts]=!0,e[Ff]=!0),e[Ts]&&(e[Os]=!0),e[Ff]&&(e[Os]=!0),e[Os]&&(e[Bf]=!0),e[y1]&&(e[Bf]=!0);for(const r in e){const i=BO(r,t);i.indexOf(n)<0&&i.push(n)}}function zO(n,e){const t={};for(const r in e)e[r].indexOf(n)>=0&&(t[r]=!0);return t}function _t(n=null){this.j={},this.jr=[],this.jd=null,this.t=n}_t.groups={},_t.prototype={accepts(){return!!this.t},go(n){const e=this,t=e.j[n];if(t)return t;for(let r=0;r<e.jr.length;r++){const i=e.jr[r][0],s=e.jr[r][1];if(s&&i.test(n))return s}return e.jd},has(n,e=!1){return e?n in this.j:!!this.go(n)},ta(n,e,t,r){for(let i=0;i<n.length;i++)this.tt(n[i],e,t,r)},tr(n,e,t,r){r=r||_t.groups;let i;return e&&e.j?i=e:(i=new _t(e),t&&r&&Gr(e,t,r)),this.jr.push([n,i]),i},ts(n,e,t,r){let i=this;const s=n.length;if(!s)return i;for(let a=0;a<s-1;a++)i=i.tt(n[a]);return i.tt(n[s-1],e,t,r)},tt(n,e,t,r){r=r||_t.groups;const i=this;if(e&&e.j)return i.j[n]=e,e;const s=e;let a,u=i.go(n);if(u?(a=new _t,Ii(a.j,u.j),a.jr.push.apply(a.jr,u.jr),a.jd=u.jd,a.t=u.t):a=new _t,s){if(r)if(a.t&&typeof a.t=="string"){const c=Ii(zO(a.t,r),t);Gr(s,c,r)}else t&&Gr(s,t,r);a.t=s}return i.j[n]=a,a}};const ae=(n,e,t,r,i)=>n.ta(e,t,r,i),Ne=(n,e,t,r,i)=>n.tr(e,t,r,i),b1=(n,e,t,r,i)=>n.ts(e,t,r,i),$=(n,e,t,r,i)=>n.tt(e,t,r,i),$n="WORD",$f="UWORD",_1="ASCIINUMERICAL",w1="ALPHANUMERICAL",Ms="LOCALHOST",Hf="TLD",Wf="UTLD",Ka="SCHEME",Ni="SLASH_SCHEME",Vf="NUM",Uf="WS",qf="NL",Is="OPENBRACE",Ns="CLOSEBRACE",Ga="OPENBRACKET",Ja="CLOSEBRACKET",ja="OPENPAREN",Ya="CLOSEPAREN",Xa="OPENANGLEBRACKET",Za="CLOSEANGLEBRACKET",Qa="FULLWIDTHLEFTPAREN",el="FULLWIDTHRIGHTPAREN",tl="LEFTCORNERBRACKET",nl="RIGHTCORNERBRACKET",rl="LEFTWHITECORNERBRACKET",il="RIGHTWHITECORNERBRACKET",sl="FULLWIDTHLESSTHAN",ol="FULLWIDTHGREATERTHAN",al="AMPERSAND",Kf="APOSTROPHE",ll="ASTERISK",wr="AT",ul="BACKSLASH",cl="BACKTICK",fl="CARET",vr="COLON",Gf="COMMA",hl="DOLLAR",gn="DOT",dl="EQUALS",Jf="EXCLAMATION",Jt="HYPHEN",Rs="PERCENT",pl="PIPE",ml="PLUS",gl="POUND",Ls="QUERY",jf="QUOTE",v1="FULLWIDTHMIDDLEDOT",Yf="SEMI",yn="SLASH",Ps="TILDE",yl="UNDERSCORE",S1="EMOJI",bl="SYM";var x1=Object.freeze({__proto__:null,WORD:$n,UWORD:$f,ASCIINUMERICAL:_1,ALPHANUMERICAL:w1,LOCALHOST:Ms,TLD:Hf,UTLD:Wf,SCHEME:Ka,SLASH_SCHEME:Ni,NUM:Vf,WS:Uf,NL:qf,OPENBRACE:Is,CLOSEBRACE:Ns,OPENBRACKET:Ga,CLOSEBRACKET:Ja,OPENPAREN:ja,CLOSEPAREN:Ya,OPENANGLEBRACKET:Xa,CLOSEANGLEBRACKET:Za,FULLWIDTHLEFTPAREN:Qa,FULLWIDTHRIGHTPAREN:el,LEFTCORNERBRACKET:tl,RIGHTCORNERBRACKET:nl,LEFTWHITECORNERBRACKET:rl,RIGHTWHITECORNERBRACKET:il,FULLWIDTHLESSTHAN:sl,FULLWIDTHGREATERTHAN:ol,AMPERSAND:al,APOSTROPHE:Kf,ASTERISK:ll,AT:wr,BACKSLASH:ul,BACKTICK:cl,CARET:fl,COLON:vr,COMMA:Gf,DOLLAR:hl,DOT:gn,EQUALS:dl,EXCLAMATION:Jf,HYPHEN:Jt,PERCENT:Rs,PIPE:pl,PLUS:ml,POUND:gl,QUERY:Ls,QUOTE:jf,FULLWIDTHMIDDLEDOT:v1,SEMI:Yf,SLASH:yn,TILDE:Ps,UNDERSCORE:yl,EMOJI:S1,SYM:bl});const Hn=/[a-z]/,Ds=/\p{L}/u,Xf=/\p{Emoji}/u,Wn=/\d/,Zf=/\s/,C1="\r",Qf=`
|
|
42
|
-
|
|
41
|
+
`,textSerializers:a={}}=t||{};let u="";return n.nodesBetween(r,i,(c,h,m,d)=>{var y;c.isBlock&&h>r&&(u+=s);const _=a?.[c.type.name];if(_)return m&&(u+=_({node:c,pos:h,parent:m,index:d,range:e})),!1;c.isText&&(u+=(y=c?.text)===null||y===void 0?void 0:y.slice(Math.max(r,h)-h,i-h))}),u}function KA(n){return Object.fromEntries(Object.entries(n.nodes).filter(([,e])=>e.spec.toText).map(([e,t])=>[e,t.spec.toText]))}Re.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new ct({key:new It("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:n}=this,{state:e,schema:t}=n,{doc:r,selection:i}=e,{ranges:s}=i,a=Math.min(...s.map(m=>m.$from.pos)),u=Math.max(...s.map(m=>m.$to.pos)),c=KA(t);return qA(r,{from:a,to:u},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:c})}}})]}});const GA=()=>({editor:n,view:e})=>(requestAnimationFrame(()=>{var t;n.isDestroyed||(e.dom.blur(),(t=window?.getSelection())===null||t===void 0||t.removeAllRanges())}),!0),JA=(n=!1)=>({commands:e})=>e.setContent("",n),jA=()=>({state:n,tr:e,dispatch:t})=>{const{selection:r}=e,{ranges:i}=r;return t&&i.forEach(({$from:s,$to:a})=>{n.doc.nodesBetween(s.pos,a.pos,(u,c)=>{if(u.type.isText)return;const{doc:h,mapping:m}=e,d=h.resolve(m.map(c)),y=h.resolve(m.map(c+u.nodeSize)),_=d.blockRange(y);if(!_)return;const v=Ni(_);if(u.type.isTextblock){const{defaultType:E}=d.parent.contentMatchAt(d.index());e.setNodeMarkup(_.start,E)}(v||v===0)&&e.lift(_,v)})}),!0},YA=n=>e=>n(e),XA=()=>({state:n,dispatch:e})=>v1(n,e),ZA=(n,e)=>({editor:t,tr:r})=>{const{state:i}=t,s=i.doc.slice(n.from,n.to);r.deleteRange(n.from,n.to);const a=r.mapping.map(e);return r.insert(a,s.content),r.setSelection(new pe(r.doc.resolve(a-1))),!0},QA=()=>({tr:n,dispatch:e})=>{const{selection:t}=n,r=t.$anchor.node();if(r.content.size>0)return!1;const i=n.selection.$anchor;for(let s=i.depth;s>0;s-=1)if(i.node(s).type===r.type){if(e){const u=i.before(s),c=i.after(s);n.delete(u,c).scrollIntoView()}return!0}return!1},eO=n=>({tr:e,state:t,dispatch:r})=>{const i=qe(n,t.schema),s=e.selection.$anchor;for(let a=s.depth;a>0;a-=1)if(s.node(a).type===i){if(r){const c=s.before(a),h=s.after(a);e.delete(c,h).scrollIntoView()}return!0}return!1},tO=n=>({tr:e,dispatch:t})=>{const{from:r,to:i}=n;return t&&e.delete(r,i),!0},nO=()=>({state:n,dispatch:e})=>Df(n,e),rO=()=>({commands:n})=>n.keyboardShortcut("Enter"),iO=()=>({state:n,dispatch:e})=>gA(n,e);function Qa(n,e,t={strict:!0}){const r=Object.keys(e);return r.length?r.every(i=>t.strict?e[i]===n[i]:Uf(e[i])?e[i].test(n[i]):e[i]===n[i]):!0}function R1(n,e,t={}){return n.find(r=>r.type===e&&Qa(Object.fromEntries(Object.keys(t).map(i=>[i,r.attrs[i]])),t))}function L1(n,e,t={}){return!!R1(n,e,t)}function qf(n,e,t){var r;if(!n||!e)return;let i=n.parent.childAfter(n.parentOffset);if((!i.node||!i.node.marks.some(m=>m.type===e))&&(i=n.parent.childBefore(n.parentOffset)),!i.node||!i.node.marks.some(m=>m.type===e)||(t=t||((r=i.node.marks[0])===null||r===void 0?void 0:r.attrs),!R1([...i.node.marks],e,t)))return;let a=i.index,u=n.start()+i.offset,c=a+1,h=u+i.node.nodeSize;for(;a>0&&L1([...n.parent.child(a-1).marks],e,t);)a-=1,u-=n.parent.child(a).nodeSize;for(;c<n.parent.childCount&&L1([...n.parent.child(c).marks],e,t);)h+=n.parent.child(c).nodeSize,c+=1;return{from:u,to:h}}function yn(n,e){if(typeof n=="string"){if(!e.marks[n])throw Error(`There is no mark type named '${n}'. Maybe you forgot to add the extension?`);return e.marks[n]}return n}const sO=(n,e={})=>({tr:t,state:r,dispatch:i})=>{const s=yn(n,r.schema),{doc:a,selection:u}=t,{$from:c,from:h,to:m}=u;if(i){const d=qf(c,s,e);if(d&&d.from<=h&&d.to>=m){const y=pe.create(a,d.from,d.to);t.setSelection(y)}}return!0},oO=n=>e=>{const t=typeof n=="function"?n(e):n;for(let r=0;r<t.length;r+=1)if(t[r](e))return!0;return!1};function P1(n){return n instanceof pe}function Xr(n=0,e=0,t=0){return Math.min(Math.max(n,e),t)}function aO(n,e=null){if(!e)return null;const t=ye.atStart(n),r=ye.atEnd(n);if(e==="start"||e===!0)return t;if(e==="end")return r;const i=t.from,s=r.to;return e==="all"?pe.create(n,Xr(0,i,s),Xr(n.content.size,i,s)):pe.create(n,Xr(e,i,s),Xr(e,i,s))}function lO(){return navigator.platform==="Android"||/android/i.test(navigator.userAgent)}function Kf(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}const uO=(n=null,e={})=>({editor:t,view:r,tr:i,dispatch:s})=>{e={scrollIntoView:!0,...e};const a=()=>{(Kf()||lO())&&r.dom.focus(),requestAnimationFrame(()=>{t.isDestroyed||(r.focus(),e?.scrollIntoView&&t.commands.scrollIntoView())})};if(r.hasFocus()&&n===null||n===!1)return!0;if(s&&n===null&&!P1(t.state.selection))return a(),!0;const u=aO(i.doc,n)||t.state.selection,c=t.state.selection.eq(u);return s&&(c||i.setSelection(u),c&&i.storedMarks&&i.setStoredMarks(i.storedMarks),a()),!0},cO=(n,e)=>t=>n.every((r,i)=>e(r,{...t,index:i})),fO=(n,e)=>({tr:t,commands:r})=>r.insertContentAt({from:t.selection.from,to:t.selection.to},n,e),D1=n=>{const e=n.childNodes;for(let t=e.length-1;t>=0;t-=1){const r=e[t];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?n.removeChild(r):r.nodeType===1&&D1(r)}return n};function el(n){const e=`<body>${n}</body>`,t=new window.DOMParser().parseFromString(e,"text/html").body;return D1(t)}function tl(n,e,t){if(n instanceof mr||n instanceof V)return n;t={slice:!0,parseOptions:{},...t};const r=typeof n=="object"&&n!==null,i=typeof n=="string";if(r)try{if(Array.isArray(n)&&n.length>0)return V.fromArray(n.map(u=>e.nodeFromJSON(u)));const a=e.nodeFromJSON(n);return t.errorOnInvalidContent&&a.check(),a}catch(s){if(t.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:s});return console.warn("[tiptap warn]: Invalid content.","Passed value:",n,"Error:",s),tl("",e,t)}if(i){if(t.errorOnInvalidContent){let a=!1,u="";const c=new Qg({topNode:e.spec.topNode,marks:e.spec.marks,nodes:e.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:h=>(a=!0,u=typeof h=="string"?h:h.outerHTML,null)}]}})});if(t.slice?Rs.fromSchema(c).parseSlice(el(n),t.parseOptions):Rs.fromSchema(c).parse(el(n),t.parseOptions),t.errorOnInvalidContent&&a)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${u}`)})}const s=Rs.fromSchema(e);return t.slice?s.parseSlice(el(n),t.parseOptions).content:s.parse(el(n),t.parseOptions)}return tl("",e,t)}function hO(n,e,t){const r=n.steps.length-1;if(r<e)return;const i=n.steps[r];if(!(i instanceof je||i instanceof Je))return;const s=n.mapping.maps[r];let a=0;s.forEach((u,c,h,m)=>{a===0&&(a=m)}),n.setSelection(ye.near(n.doc.resolve(a),t))}const dO=n=>!("type"in n),pO=(n,e,t)=>({tr:r,dispatch:i,editor:s})=>{var a;if(i){t={parseOptions:s.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...t};let u;try{u=tl(e,s.schema,{parseOptions:{preserveWhitespace:"full",...t.parseOptions},errorOnInvalidContent:(a=t.errorOnInvalidContent)!==null&&a!==void 0?a:s.options.enableContentCheck})}catch(v){return s.emit("contentError",{editor:s,error:v,disableCollaboration:()=>{s.storage.collaboration&&(s.storage.collaboration.isDisabled=!0)}}),!1}let{from:c,to:h}=typeof n=="number"?{from:n,to:n}:{from:n.from,to:n.to},m=!0,d=!0;if((dO(u)?u:[u]).forEach(v=>{v.check(),m=m?v.isText&&v.marks.length===0:!1,d=d?v.isBlock:!1}),c===h&&d){const{parent:v}=r.doc.resolve(c);v.isTextblock&&!v.type.spec.code&&!v.childCount&&(c-=1,h+=1)}let _;if(m){if(Array.isArray(e))_=e.map(v=>v.text||"").join("");else if(e instanceof V){let v="";e.forEach(E=>{E.text&&(v+=E.text)}),_=v}else typeof e=="object"&&e&&e.text?_=e.text:_=e;r.insertText(_,c,h)}else _=u,r.replaceWith(c,h,_);t.updateSelection&&hO(r,r.steps.length-1,-1),t.applyInputRules&&r.setMeta("applyInputRules",{from:c,text:_}),t.applyPasteRules&&r.setMeta("applyPasteRules",{from:c,text:_})}return!0},mO=()=>({state:n,dispatch:e})=>dA(n,e),gO=()=>({state:n,dispatch:e})=>pA(n,e),yO=()=>({state:n,dispatch:e})=>p1(n,e),bO=()=>({state:n,dispatch:e})=>b1(n,e),_O=()=>({state:n,dispatch:e,tr:t})=>{try{const r=$a(n.doc,n.selection.$from.pos,-1);return r==null?!1:(t.join(r,2),e&&e(t),!0)}catch{return!1}},wO=()=>({state:n,dispatch:e,tr:t})=>{try{const r=$a(n.doc,n.selection.$from.pos,1);return r==null?!1:(t.join(r,2),e&&e(t),!0)}catch{return!1}},vO=()=>({state:n,dispatch:e})=>fA(n,e),SO=()=>({state:n,dispatch:e})=>hA(n,e);function $1(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function xO(n){const e=n.split(/-(?!$)/);let t=e[e.length-1];t==="Space"&&(t=" ");let r,i,s,a;for(let u=0;u<e.length-1;u+=1){const c=e[u];if(/^(cmd|meta|m)$/i.test(c))a=!0;else if(/^a(lt)?$/i.test(c))r=!0;else if(/^(c|ctrl|control)$/i.test(c))i=!0;else if(/^s(hift)?$/i.test(c))s=!0;else if(/^mod$/i.test(c))Kf()||$1()?a=!0:i=!0;else throw new Error(`Unrecognized modifier name: ${c}`)}return r&&(t=`Alt-${t}`),i&&(t=`Ctrl-${t}`),a&&(t=`Meta-${t}`),s&&(t=`Shift-${t}`),t}const EO=n=>({editor:e,view:t,tr:r,dispatch:i})=>{const s=xO(n).split(/-(?!$)/),a=s.find(h=>!["Alt","Ctrl","Meta","Shift"].includes(h)),u=new KeyboardEvent("keydown",{key:a==="Space"?" ":a,altKey:s.includes("Alt"),ctrlKey:s.includes("Ctrl"),metaKey:s.includes("Meta"),shiftKey:s.includes("Shift"),bubbles:!0,cancelable:!0}),c=e.captureTransaction(()=>{t.someProp("handleKeyDown",h=>h(t,u))});return c?.steps.forEach(h=>{const m=h.map(r.mapping);m&&i&&r.maybeStep(m)}),!0};function Gf(n,e,t={}){const{from:r,to:i,empty:s}=n.selection,a=e?qe(e,n.schema):null,u=[];n.doc.nodesBetween(r,i,(d,y)=>{if(d.isText)return;const _=Math.max(r,y),v=Math.min(i,y+d.nodeSize);u.push({node:d,from:_,to:v})});const c=i-r,h=u.filter(d=>a?a.name===d.node.type.name:!0).filter(d=>Qa(d.node.attrs,t,{strict:!1}));return s?!!h.length:h.reduce((d,y)=>d+y.to-y.from,0)>=c}const CO=(n,e={})=>({state:t,dispatch:r})=>{const i=qe(n,t.schema);return Gf(t,i,e)?mA(t,r):!1},kO=()=>({state:n,dispatch:e})=>S1(n,e),TO=n=>({state:e,dispatch:t})=>{const r=qe(n,e.schema);return TA(r)(e,t)},AO=()=>({state:n,dispatch:e})=>w1(n,e);function Jf(n,e){return e.nodes[n]?"node":e.marks[n]?"mark":null}function F1(n,e){const t=typeof e=="string"?[e]:e;return Object.keys(n).reduce((r,i)=>(t.includes(i)||(r[i]=n[i]),r),{})}const OO=(n,e)=>({tr:t,state:r,dispatch:i})=>{let s=null,a=null;const u=Jf(typeof n=="string"?n:n.name,r.schema);return u?(u==="node"&&(s=qe(n,r.schema)),u==="mark"&&(a=yn(n,r.schema)),i&&t.selection.ranges.forEach(c=>{r.doc.nodesBetween(c.$from.pos,c.$to.pos,(h,m)=>{s&&s===h.type&&t.setNodeMarkup(m,void 0,F1(h.attrs,e)),a&&h.marks.length&&h.marks.forEach(d=>{a===d.type&&t.addMark(m,m+h.nodeSize,a.create(F1(d.attrs,e)))})})}),!0):!1},MO=()=>({tr:n,dispatch:e})=>(e&&n.scrollIntoView(),!0),IO=()=>({tr:n,dispatch:e})=>{if(e){const t=new Lt(n.doc);n.setSelection(t)}return!0},NO=()=>({state:n,dispatch:e})=>g1(n,e),RO=()=>({state:n,dispatch:e})=>_1(n,e),LO=()=>({state:n,dispatch:e})=>_A(n,e),PO=()=>({state:n,dispatch:e})=>SA(n,e),DO=()=>({state:n,dispatch:e})=>vA(n,e);function $O(n,e,t={},r={}){return tl(n,e,{slice:!1,parseOptions:t,errorOnInvalidContent:r.errorOnInvalidContent})}const FO=(n,e=!1,t={},r={})=>({editor:i,tr:s,dispatch:a,commands:u})=>{var c,h;const{doc:m}=s;if(t.preserveWhitespace!=="full"){const d=$O(n,i.schema,t,{errorOnInvalidContent:(c=r.errorOnInvalidContent)!==null&&c!==void 0?c:i.options.enableContentCheck});return a&&s.replaceWith(0,m.content.size,d).setMeta("preventUpdate",!e),!0}return a&&s.setMeta("preventUpdate",!e),u.insertContentAt({from:0,to:m.content.size},n,{parseOptions:t,errorOnInvalidContent:(h=r.errorOnInvalidContent)!==null&&h!==void 0?h:i.options.enableContentCheck})};function B1(n,e){const t=yn(e,n.schema),{from:r,to:i,empty:s}=n.selection,a=[];s?(n.storedMarks&&a.push(...n.storedMarks),a.push(...n.selection.$head.marks())):n.doc.nodesBetween(r,i,c=>{a.push(...c.marks)});const u=a.find(c=>c.type.name===t.name);return u?{...u.attrs}:{}}function BO(n,e){const t=new pT(n);return e.forEach(r=>{r.steps.forEach(i=>{t.step(i)})}),t}function zO(n){for(let e=0;e<n.edgeCount;e+=1){const{type:t}=n.edge(e);if(t.isTextblock&&!t.hasRequiredAttrs())return t}return null}function HO(n,e,t){const r=[];return n.nodesBetween(e.from,e.to,(i,s)=>{t(i)&&r.push({node:i,pos:s})}),r}function WO(n,e){for(let t=n.depth;t>0;t-=1){const r=n.node(t);if(e(r))return{pos:t>0?n.before(t):0,start:n.start(t),depth:t,node:r}}}function jf(n){return e=>WO(e.$from,n)}function VO(n,e){const t=Yi.resolve(n);return O1(t,e)}function UO(n,e){const t=qe(e,n.schema),{from:r,to:i}=n.selection,s=[];n.doc.nodesBetween(r,i,u=>{s.push(u)});const a=s.reverse().find(u=>u.type.name===t.name);return a?{...a.attrs}:{}}function qO(n,e){const t=Jf(typeof e=="string"?e:e.name,n.schema);return t==="node"?UO(n,e):t==="mark"?B1(n,e):{}}function KO(n,e=JSON.stringify){const t={};return n.filter(r=>{const i=e(r);return Object.prototype.hasOwnProperty.call(t,i)?!1:t[i]=!0})}function GO(n){const e=KO(n);return e.length===1?e:e.filter((t,r)=>!e.filter((s,a)=>a!==r).some(s=>t.oldRange.from>=s.oldRange.from&&t.oldRange.to<=s.oldRange.to&&t.newRange.from>=s.newRange.from&&t.newRange.to<=s.newRange.to))}function JO(n){const{mapping:e,steps:t}=n,r=[];return e.maps.forEach((i,s)=>{const a=[];if(i.ranges.length)i.forEach((u,c)=>{a.push({from:u,to:c})});else{const{from:u,to:c}=t[s];if(u===void 0||c===void 0)return;a.push({from:u,to:c})}a.forEach(({from:u,to:c})=>{const h=e.slice(s).map(u,-1),m=e.slice(s).map(c),d=e.invert().map(h,-1),y=e.invert().map(m);r.push({oldRange:{from:d,to:y},newRange:{from:h,to:m}})})}),GO(r)}function z1(n,e,t){const r=[];return n===e?t.resolve(n).marks().forEach(i=>{const s=t.resolve(n),a=qf(s,i.type);a&&r.push({mark:i,...a})}):t.nodesBetween(n,e,(i,s)=>{!i||i?.nodeSize===void 0||r.push(...i.marks.map(a=>({from:s,to:s+i.nodeSize,mark:a})))}),r}function nl(n,e,t){return Object.fromEntries(Object.entries(t).filter(([r])=>{const i=n.find(s=>s.type===e&&s.name===r);return i?i.attribute.keepOnSplit:!1}))}function jO(n,e,t={}){const{empty:r,ranges:i}=n.selection,s=e?yn(e,n.schema):null;if(r)return!!(n.storedMarks||n.selection.$from.marks()).filter(d=>s?s.name===d.type.name:!0).find(d=>Qa(d.attrs,t,{strict:!1}));let a=0;const u=[];if(i.forEach(({$from:d,$to:y})=>{const _=d.pos,v=y.pos;n.doc.nodesBetween(_,v,(E,N)=>{if(!E.isText&&!E.marks.length)return;const g=Math.max(_,N),S=Math.min(v,N+E.nodeSize),k=S-g;a+=k,u.push(...E.marks.map(T=>({mark:T,from:g,to:S})))})}),a===0)return!1;const c=u.filter(d=>s?s.name===d.mark.type.name:!0).filter(d=>Qa(d.mark.attrs,t,{strict:!1})).reduce((d,y)=>d+y.to-y.from,0),h=u.filter(d=>s?d.mark.type!==s&&d.mark.type.excludes(s):!0).reduce((d,y)=>d+y.to-y.from,0);return(c>0?c+h:c)>=a}function H1(n,e){const{nodeExtensions:t}=Ja(e),r=t.find(a=>a.name===n);if(!r)return!1;const i={name:r.name,options:r.options,storage:r.storage},s=de(J(r,"group",i));return typeof s!="string"?!1:s.split(" ").includes("list")}function W1(n,{checkChildren:e=!0,ignoreWhitespace:t=!1}={}){var r;if(t){if(n.type.name==="hardBreak")return!0;if(n.isText)return/^\s*$/m.test((r=n.text)!==null&&r!==void 0?r:"")}if(n.isText)return!n.text;if(n.isAtom||n.isLeaf)return!1;if(n.content.childCount===0)return!0;if(e){let i=!0;return n.content.forEach(s=>{i!==!1&&(W1(s,{ignoreWhitespace:t,checkChildren:e})||(i=!1))}),i}return!1}function YO(n,e,t){var r;const{selection:i}=e;let s=null;if(P1(i)&&(s=i.$cursor),s){const u=(r=n.storedMarks)!==null&&r!==void 0?r:s.marks();return!!t.isInSet(u)||!u.some(c=>c.type.excludes(t))}const{ranges:a}=i;return a.some(({$from:u,$to:c})=>{let h=u.depth===0?n.doc.inlineContent&&n.doc.type.allowsMarkType(t):!1;return n.doc.nodesBetween(u.pos,c.pos,(m,d,y)=>{if(h)return!1;if(m.isInline){const _=!y||y.type.allowsMarkType(t),v=!!t.isInSet(m.marks)||!m.marks.some(E=>E.type.excludes(t));h=_&&v}return!h}),h})}const XO=(n,e={})=>({tr:t,state:r,dispatch:i})=>{const{selection:s}=t,{empty:a,ranges:u}=s,c=yn(n,r.schema);if(i)if(a){const h=B1(r,c);t.addStoredMark(c.create({...h,...e}))}else u.forEach(h=>{const m=h.$from.pos,d=h.$to.pos;r.doc.nodesBetween(m,d,(y,_)=>{const v=Math.max(_,m),E=Math.min(_+y.nodeSize,d);y.marks.find(g=>g.type===c)?y.marks.forEach(g=>{c===g.type&&t.addMark(v,E,c.create({...g.attrs,...e}))}):t.addMark(v,E,c.create(e))})});return YO(r,t,c)},ZO=(n,e)=>({tr:t})=>(t.setMeta(n,e),!0),QO=(n,e={})=>({state:t,dispatch:r,chain:i})=>{const s=qe(n,t.schema);let a;return t.selection.$anchor.sameParent(t.selection.$head)&&(a=t.selection.$anchor.parent.attrs),s.isTextblock?i().command(({commands:u})=>C1(s,{...a,...e})(t)?!0:u.clearNodes()).command(({state:u})=>C1(s,{...a,...e})(u,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},eM=n=>({tr:e,dispatch:t})=>{if(t){const{doc:r}=e,i=Xr(n,0,r.content.size),s=Q.create(r,i);e.setSelection(s)}return!0},tM=n=>({tr:e,dispatch:t})=>{if(t){const{doc:r}=e,{from:i,to:s}=typeof n=="number"?{from:n,to:n}:n,a=pe.atStart(r).from,u=pe.atEnd(r).to,c=Xr(i,a,u),h=Xr(s,a,u),m=pe.create(r,c,h);e.setSelection(m)}return!0},nM=n=>({state:e,dispatch:t})=>{const r=qe(n,e.schema);return MA(r)(e,t)};function V1(n,e){const t=n.storedMarks||n.selection.$to.parentOffset&&n.selection.$from.marks();if(t){const r=t.filter(i=>e?.includes(i.type.name));n.tr.ensureMarks(r)}}const rM=({keepMarks:n=!0}={})=>({tr:e,state:t,dispatch:r,editor:i})=>{const{selection:s,doc:a}=e,{$from:u,$to:c}=s,h=i.extensionManager.attributes,m=nl(h,u.node().type.name,u.node().attrs);if(s instanceof Q&&s.node.isBlock)return!u.parentOffset||!Wn(a,u.pos)?!1:(r&&(n&&V1(t,i.extensionManager.splittableMarks),e.split(u.pos).scrollIntoView()),!0);if(!u.parent.isBlock)return!1;const d=c.parentOffset===c.parent.content.size,y=u.depth===0?void 0:zO(u.node(-1).contentMatchAt(u.indexAfter(-1)));let _=d&&y?[{type:y,attrs:m}]:void 0,v=Wn(e.doc,e.mapping.map(u.pos),1,_);if(!_&&!v&&Wn(e.doc,e.mapping.map(u.pos),1,y?[{type:y}]:void 0)&&(v=!0,_=y?[{type:y,attrs:m}]:void 0),r){if(v&&(s instanceof pe&&e.deleteSelection(),e.split(e.mapping.map(u.pos),1,_),y&&!d&&!u.parentOffset&&u.parent.type!==y)){const E=e.mapping.map(u.before()),N=e.doc.resolve(E);u.node(-1).canReplaceWith(N.index(),N.index()+1,y)&&e.setNodeMarkup(e.mapping.map(u.before()),y)}n&&V1(t,i.extensionManager.splittableMarks),e.scrollIntoView()}return v},iM=(n,e={})=>({tr:t,state:r,dispatch:i,editor:s})=>{var a;const u=qe(n,r.schema),{$from:c,$to:h}=r.selection,m=r.selection.node;if(m&&m.isBlock||c.depth<2||!c.sameParent(h))return!1;const d=c.node(-1);if(d.type!==u)return!1;const y=s.extensionManager.attributes;if(c.parent.content.size===0&&c.node(-1).childCount===c.indexAfter(-1)){if(c.depth===2||c.node(-3).type!==u||c.index(-2)!==c.node(-2).childCount-1)return!1;if(i){let g=V.empty;const S=c.index(-1)?1:c.index(-2)?2:3;for(let z=c.depth-S;z>=c.depth-3;z-=1)g=V.from(c.node(z).copy(g));const k=c.indexAfter(-1)<c.node(-2).childCount?1:c.indexAfter(-2)<c.node(-3).childCount?2:3,T={...nl(y,c.node().type.name,c.node().attrs),...e},A=((a=u.contentMatch.defaultType)===null||a===void 0?void 0:a.createAndFill(T))||void 0;g=g.append(V.from(u.createAndFill(null,A)||void 0));const $=c.before(c.depth-(S-1));t.replace($,c.after(-k),new K(g,4-S,0));let U=-1;t.doc.nodesBetween($,t.doc.content.size,(z,ee)=>{if(U>-1)return!1;z.isTextblock&&z.content.size===0&&(U=ee+1)}),U>-1&&t.setSelection(pe.near(t.doc.resolve(U))),t.scrollIntoView()}return!0}const _=h.pos===c.end()?d.contentMatchAt(0).defaultType:null,v={...nl(y,d.type.name,d.attrs),...e},E={...nl(y,c.node().type.name,c.node().attrs),...e};t.delete(c.pos,h.pos);const N=_?[{type:u,attrs:v},{type:_,attrs:E}]:[{type:u,attrs:v}];if(!Wn(t.doc,c.pos,2))return!1;if(i){const{selection:g,storedMarks:S}=r,{splittableMarks:k}=s.extensionManager,T=S||g.$to.parentOffset&&g.$from.marks();if(t.split(c.pos,2,N).scrollIntoView(),!T||!i)return!0;const A=T.filter($=>k.includes($.type.name));t.ensureMarks(A)}return!0},Yf=(n,e)=>{const t=jf(a=>a.type===e)(n.selection);if(!t)return!0;const r=n.doc.resolve(Math.max(0,t.pos-1)).before(t.depth);if(r===void 0)return!0;const i=n.doc.nodeAt(r);return t.node.type===i?.type&&gr(n.doc,t.pos)&&n.join(t.pos),!0},Xf=(n,e)=>{const t=jf(a=>a.type===e)(n.selection);if(!t)return!0;const r=n.doc.resolve(t.start).after(t.depth);if(r===void 0)return!0;const i=n.doc.nodeAt(r);return t.node.type===i?.type&&gr(n.doc,r)&&n.join(r),!0},sM=(n,e,t,r={})=>({editor:i,tr:s,state:a,dispatch:u,chain:c,commands:h,can:m})=>{const{extensions:d,splittableMarks:y}=i.extensionManager,_=qe(n,a.schema),v=qe(e,a.schema),{selection:E,storedMarks:N}=a,{$from:g,$to:S}=E,k=g.blockRange(S),T=N||E.$to.parentOffset&&E.$from.marks();if(!k)return!1;const A=jf($=>H1($.type.name,d))(E);if(k.depth>=1&&A&&k.depth-A.depth<=1){if(A.node.type===_)return h.liftListItem(v);if(H1(A.node.type.name,d)&&_.validContent(A.node.content)&&u)return c().command(()=>(s.setNodeMarkup(A.pos,_),!0)).command(()=>Yf(s,_)).command(()=>Xf(s,_)).run()}return!t||!T||!u?c().command(()=>m().wrapInList(_,r)?!0:h.clearNodes()).wrapInList(_,r).command(()=>Yf(s,_)).command(()=>Xf(s,_)).run():c().command(()=>{const $=m().wrapInList(_,r),U=T.filter(z=>y.includes(z.type.name));return s.ensureMarks(U),$?!0:h.clearNodes()}).wrapInList(_,r).command(()=>Yf(s,_)).command(()=>Xf(s,_)).run()},oM=(n,e={},t={})=>({state:r,commands:i})=>{const{extendEmptyMarkRange:s=!1}=t,a=yn(n,r.schema);return jO(r,a,e)?i.unsetMark(a,{extendEmptyMarkRange:s}):i.setMark(a,e)},aM=(n,e,t={})=>({state:r,commands:i})=>{const s=qe(n,r.schema),a=qe(e,r.schema),u=Gf(r,s,t);let c;return r.selection.$anchor.sameParent(r.selection.$head)&&(c=r.selection.$anchor.parent.attrs),u?i.setNode(a,c):i.setNode(s,{...c,...t})},lM=(n,e={})=>({state:t,commands:r})=>{const i=qe(n,t.schema);return Gf(t,i,e)?r.lift(i):r.wrapIn(i,e)},uM=()=>({state:n,dispatch:e})=>{const t=n.plugins;for(let r=0;r<t.length;r+=1){const i=t[r];let s;if(i.spec.isInputRules&&(s=i.getState(n))){if(e){const a=n.tr,u=s.transform;for(let c=u.steps.length-1;c>=0;c-=1)a.step(u.steps[c].invert(u.docs[c]));if(s.text){const c=a.doc.resolve(s.from).marks();a.replaceWith(s.from,s.to,n.schema.text(s.text,c))}else a.delete(s.from,s.to)}return!0}}return!1},cM=()=>({tr:n,dispatch:e})=>{const{selection:t}=n,{empty:r,ranges:i}=t;return r||e&&i.forEach(s=>{n.removeMark(s.$from.pos,s.$to.pos)}),!0},fM=(n,e={})=>({tr:t,state:r,dispatch:i})=>{var s;const{extendEmptyMarkRange:a=!1}=e,{selection:u}=t,c=yn(n,r.schema),{$from:h,empty:m,ranges:d}=u;if(!i)return!0;if(m&&a){let{from:y,to:_}=u;const v=(s=h.marks().find(N=>N.type===c))===null||s===void 0?void 0:s.attrs,E=qf(h,c,v);E&&(y=E.from,_=E.to),t.removeMark(y,_,c)}else d.forEach(y=>{t.removeMark(y.$from.pos,y.$to.pos,c)});return t.removeStoredMark(c),!0},hM=(n,e={})=>({tr:t,state:r,dispatch:i})=>{let s=null,a=null;const u=Jf(typeof n=="string"?n:n.name,r.schema);return u?(u==="node"&&(s=qe(n,r.schema)),u==="mark"&&(a=yn(n,r.schema)),i&&t.selection.ranges.forEach(c=>{const h=c.$from.pos,m=c.$to.pos;let d,y,_,v;t.selection.empty?r.doc.nodesBetween(h,m,(E,N)=>{s&&s===E.type&&(_=Math.max(N,h),v=Math.min(N+E.nodeSize,m),d=N,y=E)}):r.doc.nodesBetween(h,m,(E,N)=>{N<h&&s&&s===E.type&&(_=Math.max(N,h),v=Math.min(N+E.nodeSize,m),d=N,y=E),N>=h&&N<=m&&(s&&s===E.type&&t.setNodeMarkup(N,void 0,{...E.attrs,...e}),a&&E.marks.length&&E.marks.forEach(g=>{if(a===g.type){const S=Math.max(N,h),k=Math.min(N+E.nodeSize,m);t.addMark(S,k,a.create({...g.attrs,...e}))}}))}),y&&(d!==void 0&&t.setNodeMarkup(d,void 0,{...y.attrs,...e}),a&&y.marks.length&&y.marks.forEach(E=>{a===E.type&&t.addMark(_,v,a.create({...E.attrs,...e}))}))}),!0):!1},dM=(n,e={})=>({state:t,dispatch:r})=>{const i=qe(n,t.schema);return xA(i,e)(t,r)},pM=(n,e={})=>({state:t,dispatch:r})=>{const i=qe(n,t.schema);return EA(i,e)(t,r)};var mM=Object.freeze({__proto__:null,blur:GA,clearContent:JA,clearNodes:jA,command:YA,createParagraphNear:XA,cut:ZA,deleteCurrentNode:QA,deleteNode:eO,deleteRange:tO,deleteSelection:nO,enter:rO,exitCode:iO,extendMarkRange:sO,first:oO,focus:uO,forEach:cO,insertContent:fO,insertContentAt:pO,joinBackward:yO,joinDown:gO,joinForward:bO,joinItemBackward:_O,joinItemForward:wO,joinTextblockBackward:vO,joinTextblockForward:SO,joinUp:mO,keyboardShortcut:EO,lift:CO,liftEmptyBlock:kO,liftListItem:TO,newlineInCode:AO,resetAttributes:OO,scrollIntoView:MO,selectAll:IO,selectNodeBackward:NO,selectNodeForward:RO,selectParentNode:LO,selectTextblockEnd:PO,selectTextblockStart:DO,setContent:FO,setMark:XO,setMeta:ZO,setNode:QO,setNodeSelection:eM,setTextSelection:tM,sinkListItem:nM,splitBlock:rM,splitListItem:iM,toggleList:sM,toggleMark:oM,toggleNode:aM,toggleWrap:lM,undoInputRule:uM,unsetAllMarks:cM,unsetMark:fM,updateAttributes:hM,wrapIn:dM,wrapInList:pM});Re.create({name:"commands",addCommands(){return{...mM}}}),Re.create({name:"drop",addProseMirrorPlugins(){return[new ct({key:new It("tiptapDrop"),props:{handleDrop:(n,e,t,r)=>{this.editor.emit("drop",{editor:this.editor,event:e,slice:t,moved:r})}}})]}}),Re.create({name:"editable",addProseMirrorPlugins(){return[new ct({key:new It("editable"),props:{editable:()=>this.editor.options.editable}})]}}),Re.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:n}=this;return[new ct({key:new It("focusEvents"),props:{handleDOMEvents:{focus:(e,t)=>{n.isFocused=!0;const r=n.state.tr.setMeta("focus",{event:t}).setMeta("addToHistory",!1);return e.dispatch(r),!1},blur:(e,t)=>{n.isFocused=!1;const r=n.state.tr.setMeta("blur",{event:t}).setMeta("addToHistory",!1);return e.dispatch(r),!1}}}})]}}),Re.create({name:"keymap",addKeyboardShortcuts(){const n=()=>this.editor.commands.first(({commands:a})=>[()=>a.undoInputRule(),()=>a.command(({tr:u})=>{const{selection:c,doc:h}=u,{empty:m,$anchor:d}=c,{pos:y,parent:_}=d,v=d.parent.isTextblock&&y>0?u.doc.resolve(y-1):d,E=v.parent.type.spec.isolating,N=d.pos-d.parentOffset,g=E&&v.parent.childCount===1?N===d.pos:ye.atStart(h).from===y;return!m||!_.type.isTextblock||_.textContent.length||!g||g&&d.parent.type.name==="paragraph"?!1:a.clearNodes()}),()=>a.deleteSelection(),()=>a.joinBackward(),()=>a.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:a})=>[()=>a.deleteSelection(),()=>a.deleteCurrentNode(),()=>a.joinForward(),()=>a.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:a})=>[()=>a.newlineInCode(),()=>a.createParagraphNear(),()=>a.liftEmptyBlock(),()=>a.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:n,"Mod-Backspace":n,"Shift-Backspace":n,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},i={...r},s={...r,"Ctrl-h":n,"Alt-Backspace":n,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return Kf()||$1()?s:i},addProseMirrorPlugins(){return[new ct({key:new It("clearDocument"),appendTransaction:(n,e,t)=>{if(n.some(E=>E.getMeta("composition")))return;const r=n.some(E=>E.docChanged)&&!e.doc.eq(t.doc),i=n.some(E=>E.getMeta("preventClearDocument"));if(!r||i)return;const{empty:s,from:a,to:u}=e.selection,c=ye.atStart(e.doc).from,h=ye.atEnd(e.doc).to;if(s||!(a===c&&u===h)||!W1(t.doc))return;const y=t.tr,_=Ga({state:t,transaction:y}),{commands:v}=new Hf({editor:this.editor,state:_});if(v.clearNodes(),!!y.steps.length)return y}})]}}),Re.create({name:"paste",addProseMirrorPlugins(){return[new ct({key:new It("tiptapPaste"),props:{handlePaste:(n,e,t)=>{this.editor.emit("paste",{editor:this.editor,event:e,slice:t})}}})]}}),Re.create({name:"tabindex",addProseMirrorPlugins(){return[new ct({key:new It("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}});function gM(n){return new N1({find:n.find,handler:({state:e,range:t,match:r})=>{const i=e.doc.resolve(t.from),s=de(n.getAttributes,void 0,r)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),n.type))return null;e.tr.delete(t.from,t.to).setBlockType(t.from,t.from,n.type,s)}})}function yM(n){return new N1({find:n.find,handler:({state:e,range:t,match:r,chain:i})=>{const s=de(n.getAttributes,void 0,r)||{},a=e.tr.delete(t.from,t.to),c=a.doc.resolve(t.from).blockRange(),h=c&&df(c,n.type,s);if(!h)return null;if(a.wrap(c,h),n.keepMarks&&n.editor){const{selection:d,storedMarks:y}=e,{splittableMarks:_}=n.editor.extensionManager,v=y||d.$to.parentOffset&&d.$from.marks();if(v){const E=v.filter(N=>_.includes(N.type.name));a.ensureMarks(E)}}if(n.keepAttributes){const d=n.type.name==="bulletList"||n.type.name==="orderedList"?"listItem":"taskList";i().updateAttributes(d,s).run()}const m=a.doc.resolve(t.from-1).nodeBefore;m&&m.type===n.type&&gr(a.doc,t.from-1)&&(!n.joinPredicate||n.joinPredicate(r,m))&&a.join(t.from-1)}})}class Qn{constructor(e={}){this.type="node",this.name="node",this.parent=null,this.child=null,this.config={name:this.name,defaultOptions:{}},this.config={...this.config,...e},this.name=this.config.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${this.name}".`),this.options=this.config.defaultOptions,this.config.addOptions&&(this.options=de(J(this,"addOptions",{name:this.name}))),this.storage=de(J(this,"addStorage",{name:this.name,options:this.options}))||{}}static create(e={}){return new Qn(e)}configure(e={}){const t=this.extend({...this.config,addOptions:()=>Xa(this.options,e)});return t.name=this.name,t.parent=this.parent,t}extend(e={}){const t=new Qn(e);return t.parent=this,this.child=t,t.name=e.name?e.name:t.parent.name,e.defaultOptions&&Object.keys(e.defaultOptions).length>0&&console.warn(`[tiptap warn]: BREAKING CHANGE: "defaultOptions" is deprecated. Please use "addOptions" instead. Found in extension: "${t.name}".`),t.options=de(J(t,"addOptions",{name:t.name})),t.storage=de(J(t,"addStorage",{name:t.name,options:t.options})),t}}function bM(n){return new BA({find:n.find,handler:({state:e,range:t,match:r,pasteEvent:i})=>{const s=de(n.getAttributes,void 0,r,i);if(s===!1||s===null)return null;const{tr:a}=e,u=r[r.length-1],c=r[0];let h=t.to;if(u){const m=c.search(/\S/),d=t.from+c.indexOf(u),y=d+u.length;if(z1(t.from,t.to,e.doc).filter(v=>v.mark.type.excluded.find(N=>N===n.type&&N!==v.mark.type)).filter(v=>v.to>d).length)return null;y<t.to&&a.delete(y,t.to),d>t.from&&a.delete(t.from+m,d),h=t.from+m+u.length,a.addMark(t.from+m,h,n.type.create(s||{})),a.removeStoredMark(n.type)}}})}const _M=Qn.create({name:"text",group:"inline"});var rl=200,Ke=function(){};Ke.prototype.append=function(e){return e.length?(e=Ke.from(e),!this.length&&e||e.length<rl&&this.leafAppend(e)||this.length<rl&&e.leafPrepend(this)||this.appendInner(e)):this},Ke.prototype.prepend=function(e){return e.length?Ke.from(e).append(this):this},Ke.prototype.appendInner=function(e){return new wM(this,e)},Ke.prototype.slice=function(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.length),e>=t?Ke.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))},Ke.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)},Ke.prototype.forEach=function(e,t,r){t===void 0&&(t=0),r===void 0&&(r=this.length),t<=r?this.forEachInner(e,t,r,0):this.forEachInvertedInner(e,t,r,0)},Ke.prototype.map=function(e,t,r){t===void 0&&(t=0),r===void 0&&(r=this.length);var i=[];return this.forEach(function(s,a){return i.push(e(s,a))},t,r),i},Ke.from=function(e){return e instanceof Ke?e:e&&e.length?new U1(e):Ke.empty};var U1=function(n){function e(r){n.call(this),this.values=r}n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e;var t={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(i,s){return i==0&&s==this.length?this:new e(this.values.slice(i,s))},e.prototype.getInner=function(i){return this.values[i]},e.prototype.forEachInner=function(i,s,a,u){for(var c=s;c<a;c++)if(i(this.values[c],u+c)===!1)return!1},e.prototype.forEachInvertedInner=function(i,s,a,u){for(var c=s-1;c>=a;c--)if(i(this.values[c],u+c)===!1)return!1},e.prototype.leafAppend=function(i){if(this.length+i.length<=rl)return new e(this.values.concat(i.flatten()))},e.prototype.leafPrepend=function(i){if(this.length+i.length<=rl)return new e(i.flatten().concat(this.values))},t.length.get=function(){return this.values.length},t.depth.get=function(){return 0},Object.defineProperties(e.prototype,t),e}(Ke);Ke.empty=new U1([]);var wM=function(n){function e(t,r){n.call(this),this.left=t,this.right=r,this.length=t.length+r.length,this.depth=Math.max(t.depth,r.depth)+1}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(r){return r<this.left.length?this.left.get(r):this.right.get(r-this.left.length)},e.prototype.forEachInner=function(r,i,s,a){var u=this.left.length;if(i<u&&this.left.forEachInner(r,i,Math.min(s,u),a)===!1||s>u&&this.right.forEachInner(r,Math.max(i-u,0),Math.min(this.length,s)-u,a+u)===!1)return!1},e.prototype.forEachInvertedInner=function(r,i,s,a){var u=this.left.length;if(i>u&&this.right.forEachInvertedInner(r,i-u,Math.max(s,u)-u,a+u)===!1||s<u&&this.left.forEachInvertedInner(r,Math.min(i,u),s,a)===!1)return!1},e.prototype.sliceInner=function(r,i){if(r==0&&i==this.length)return this;var s=this.left.length;return i<=s?this.left.slice(r,i):r>=s?this.right.slice(r-s,i-s):this.left.slice(r,s).append(this.right.slice(0,i-s))},e.prototype.leafAppend=function(r){var i=this.right.leafAppend(r);if(i)return new e(this.left,i)},e.prototype.leafPrepend=function(r){var i=this.left.leafPrepend(r);if(i)return new e(i,this.right)},e.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new e(this.left,new e(this.right,r)):new e(this,r)},e}(Ke);const vM=500;class fn{constructor(e,t){this.items=e,this.eventCount=t}popEvent(e,t){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,s;t&&(i=this.remapping(r,this.items.length),s=i.maps.length);let a=e.tr,u,c,h=[],m=[];return this.items.forEach((d,y)=>{if(!d.step){i||(i=this.remapping(r,y+1),s=i.maps.length),s--,m.push(d);return}if(i){m.push(new vn(d.map));let _=d.step.map(i.slice(s)),v;_&&a.maybeStep(_).doc&&(v=a.mapping.maps[a.mapping.maps.length-1],h.push(new vn(v,void 0,void 0,h.length+m.length))),s--,v&&i.appendMap(v,s)}else a.maybeStep(d.step);if(d.selection)return u=i?d.selection.map(i.slice(s)):d.selection,c=new fn(this.items.slice(0,r).append(m.reverse().concat(h)),this.eventCount-1),!1},this.items.length,0),{remaining:c,transform:a,selection:u}}addTransform(e,t,r,i){let s=[],a=this.eventCount,u=this.items,c=!i&&u.length?u.get(u.length-1):null;for(let m=0;m<e.steps.length;m++){let d=e.steps[m].invert(e.docs[m]),y=new vn(e.mapping.maps[m],d,t),_;(_=c&&c.merge(y))&&(y=_,m?s.pop():u=u.slice(0,u.length-1)),s.push(y),t&&(a++,t=void 0),i||(c=y)}let h=a-r.depth;return h>xM&&(u=SM(u,h),a-=h),new fn(u.append(s),a)}remapping(e,t){let r=new Xi;return this.items.forEach((i,s)=>{let a=i.mirrorOffset!=null&&s-i.mirrorOffset>=e?r.maps.length-i.mirrorOffset:void 0;r.appendMap(i.map,a)},e,t),r}addMaps(e){return this.eventCount==0?this:new fn(this.items.append(e.map(t=>new vn(t))),this.eventCount)}rebased(e,t){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-t),s=e.mapping,a=e.steps.length,u=this.eventCount;this.items.forEach(y=>{y.selection&&u--},i);let c=t;this.items.forEach(y=>{let _=s.getMirror(--c);if(_==null)return;a=Math.min(a,_);let v=s.maps[_];if(y.step){let E=e.steps[_].invert(e.docs[_]),N=y.selection&&y.selection.map(s.slice(c+1,_));N&&u++,r.push(new vn(v,E,N))}else r.push(new vn(v))},i);let h=[];for(let y=t;y<a;y++)h.push(new vn(s.maps[y]));let m=this.items.slice(0,i).append(h).append(r),d=new fn(m,u);return d.emptyItemCount()>vM&&(d=d.compress(this.items.length-r.length)),d}emptyItemCount(){let e=0;return this.items.forEach(t=>{t.step||e++}),e}compress(e=this.items.length){let t=this.remapping(0,e),r=t.maps.length,i=[],s=0;return this.items.forEach((a,u)=>{if(u>=e)i.push(a),a.selection&&s++;else if(a.step){let c=a.step.map(t.slice(r)),h=c&&c.getMap();if(r--,h&&t.appendMap(h,r),c){let m=a.selection&&a.selection.map(t.slice(r));m&&s++;let d=new vn(h.invert(),c,m),y,_=i.length-1;(y=i.length&&i[_].merge(d))?i[_]=y:i.push(d)}}else a.map&&r--},this.items.length,0),new fn(Ke.from(i.reverse()),s)}}fn.empty=new fn(Ke.empty,0);function SM(n,e){let t;return n.forEach((r,i)=>{if(r.selection&&e--==0)return t=i,!1}),n.slice(t)}class vn{constructor(e,t,r,i){this.map=e,this.step=t,this.selection=r,this.mirrorOffset=i}merge(e){if(this.step&&e.step&&!e.selection){let t=e.step.merge(this.step);if(t)return new vn(t.getMap().invert(),t,this.selection)}}}class Sr{constructor(e,t,r,i,s){this.done=e,this.undone=t,this.prevRanges=r,this.prevTime=i,this.prevComposition=s}}const xM=20;function EM(n,e,t,r){let i=t.getMeta(Zr),s;if(i)return i.historyState;t.getMeta(TM)&&(n=new Sr(n.done,n.undone,null,0,-1));let a=t.getMeta("appendedTransaction");if(t.steps.length==0)return n;if(a&&a.getMeta(Zr))return a.getMeta(Zr).redo?new Sr(n.done.addTransform(t,void 0,r,il(e)),n.undone,q1(t.mapping.maps),n.prevTime,n.prevComposition):new Sr(n.done,n.undone.addTransform(t,void 0,r,il(e)),null,n.prevTime,n.prevComposition);if(t.getMeta("addToHistory")!==!1&&!(a&&a.getMeta("addToHistory")===!1)){let u=t.getMeta("composition"),c=n.prevTime==0||!a&&n.prevComposition!=u&&(n.prevTime<(t.time||0)-r.newGroupDelay||!CM(t,n.prevRanges)),h=a?Zf(n.prevRanges,t.mapping):q1(t.mapping.maps);return new Sr(n.done.addTransform(t,c?e.selection.getBookmark():void 0,r,il(e)),fn.empty,h,t.time,u??n.prevComposition)}else return(s=t.getMeta("rebased"))?new Sr(n.done.rebased(t,s),n.undone.rebased(t,s),Zf(n.prevRanges,t.mapping),n.prevTime,n.prevComposition):new Sr(n.done.addMaps(t.mapping.maps),n.undone.addMaps(t.mapping.maps),Zf(n.prevRanges,t.mapping),n.prevTime,n.prevComposition)}function CM(n,e){if(!e)return!1;if(!n.docChanged)return!0;let t=!1;return n.mapping.maps[0].forEach((r,i)=>{for(let s=0;s<e.length;s+=2)r<=e[s+1]&&i>=e[s]&&(t=!0)}),t}function q1(n){let e=[];for(let t=n.length-1;t>=0&&e.length==0;t--)n[t].forEach((r,i,s,a)=>e.push(s,a));return e}function Zf(n,e){if(!n)return null;let t=[];for(let r=0;r<n.length;r+=2){let i=e.map(n[r],1),s=e.map(n[r+1],-1);i<=s&&t.push(i,s)}return t}function kM(n,e,t){let r=il(e),i=Zr.get(e).spec.config,s=(t?n.undone:n.done).popEvent(e,r);if(!s)return null;let a=s.selection.resolve(s.transform.doc),u=(t?n.done:n.undone).addTransform(s.transform,e.selection.getBookmark(),i,r),c=new Sr(t?u:s.remaining,t?s.remaining:u,null,0,-1);return s.transform.setSelection(a).setMeta(Zr,{redo:t,historyState:c})}let Qf=!1,K1=null;function il(n){let e=n.plugins;if(K1!=e){Qf=!1,K1=e;for(let t=0;t<e.length;t++)if(e[t].spec.historyPreserveItems){Qf=!0;break}}return Qf}const Zr=new It("history"),TM=new It("closeHistory");function AM(n={}){return n={depth:n.depth||100,newGroupDelay:n.newGroupDelay||500},new ct({key:Zr,state:{init(){return new Sr(fn.empty,fn.empty,null,0,-1)},apply(e,t,r){return EM(t,r,e,n)}},config:n,props:{handleDOMEvents:{beforeinput(e,t){let r=t.inputType,i=r=="historyUndo"?J1:r=="historyRedo"?j1:null;return i?(t.preventDefault(),i(e.state,e.dispatch)):!1}}}})}function G1(n,e){return(t,r)=>{let i=Zr.getState(t);if(!i||(n?i.undone:i.done).eventCount==0)return!1;if(r){let s=kM(i,t,n);s&&r(e?s.scrollIntoView():s)}return!0}}const J1=G1(!1,!0),j1=G1(!0,!0),OM=Re.create({name:"history",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:n,dispatch:e})=>J1(n,e),redo:()=>({state:n,dispatch:e})=>j1(n,e)}},addProseMirrorPlugins(){return[AM(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 eh=(n=>(n.COMMON="common",n.DESKTOP="desktop",n.TABLET="tablet",n.MOBILE="mobile",n))(eh||{});const MM=["common","mobile","tablet","desktop"];var sl=(n=>(n.UPPERCASE="uppercase",n.LOWERCASE="lowercase",n.CAPITALIZE="capitalize",n))(sl||{}),xr=(n=>(n.LEFT="left",n.CENTER="center",n.RIGHT="right",n.JUSTIFY="justify",n))(xr||{});const IM=["left","center","right","justify"];var oe=(n=>(n.DOCUMENT="doc",n.PARAGRAPH="paragraph",n.HEADING="heading",n.LIST="list",n.LIST_ITEM="listItem",n.TEXT="text",n))(oe||{});const th=["paragraph","list","heading"];var un=(n=>(n.DISC="disc",n.CIRCLE="circle",n.SQUARE="square",n.DECIMAL="decimal",n.ROMAN="roman",n.LATIN="latin",n))(un||{});const NM=["disc","circle","square","decimal","roman","latin"],RM=["decimal","roman","latin"];var Oe=(n=>(n.ALIGNMENT="alignment",n.BACKGROUND_COLOR="background_color",n.FONT_COLOR="font_color",n.FONT_FAMILY="font_family",n.FONT_SIZE="font_size",n.FONT_STYLE="font_style",n.FONT_WEIGHT="font_weight",n.LINE_HEIGHT="line_height",n.TEXT_DECORATION="text_decoration",n.SUPERSCRIPT="superscript",n.MARGIN="margin",n.LINK="link",n.STYLE_PRESET="style_preset",n))(Oe||{});const Y1=["alignment","line_height","margin"],ol=["line_height"],X1=["text_decoration","link","superscript","background_color"],Z1=["background_color","font_color","font_family","font_size","font_style","font_weight","text_decoration","superscript"];var Jt=(n=>(n.SETTINGS="settings",n.ALL="_",n))(Jt||{}),nh=(n=>(n.BLANK="_blank",n.SELF="_self",n))(nh||{}),zi=(n=>(n.URL="url",n.BLOCK="block",n))(zi||{});class rh{static create(e,t){const r=new this(e,t||{});return new ct({key:new It(this.name),props:r._buildProps()})}constructor(e,t){this.options=t,this.editor=e}_buildProps(){const t=Object.entries(this.addProps()).map(([r,i])=>[r,i.bind(this)]);return Object.fromEntries(t)}addProps(){return{}}}class LM extends rh{addProps(){return{transformPastedHTML:this._transformPastedHTML,handlePaste:this._handlePaste}}_transformPastedHTML(e){if(e.includes("data-pm-slice")&&e.includes("zw-style"))return e;const t=au.build(e);return t.normalizeHTML(),this._removeDeprecatedStyles(t),t.normalizedHTML}_removeDeprecatedStyles(e){const t=e.dom.querySelectorAll('[style*="margin"]');for(const r of Array.from(t))r.style.removeProperty("margin"),r.style.removeProperty("margin-top"),r.style.removeProperty("margin-right"),r.style.removeProperty("margin-bottom"),r.style.removeProperty("margin-left")}_handlePaste(e,t,r){const i=this._insertPastedContent(e,r).scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste");return e.dispatch(i),!0}_insertPastedContent({state:e},t){return this._isFullBlockSelected(e)?e.tr.replaceSelectionWith(t.content,!1):e.tr.replaceSelection(t)}_isFullBlockSelected(e){const t=this._expandSelectionToBlocks(e),r=this._isMatchPosition(t.from,e.selection.from),i=this._isMatchPosition(t.to,e.selection.to);return r&&i}_expandSelectionToBlocks({selection:e,doc:t}){let r=e.from,i=e.to;return t.nodesBetween(r,i,(s,a,u)=>{u.type.name===oe.DOCUMENT&&(r=Math.min(r,a+1),i=Math.max(i,a+s.nodeSize-1))}),{from:r,to:i}}_isMatchPosition(e,t){return Math.abs(e-t)<5}}class PM extends rh{addProps(){return{decorations:this._buildDecorations}}_buildDecorations({doc:e}){const t=[];if(!this.editor.isEditable)return null;if(!(e.childCount>1))return e.descendants((r,i)=>{if(!r.childCount){const s=En.node(i,i+r.nodeSize,{class:"zw-wysiwyg__placeholder","data-placeholder":"Type your text here..."});t.push(s)}return!1}),Ye.create(e,t)}}const DM="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2ntley5rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6logistics9properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3ncaster6d0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2psy3ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0america6xi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5m\xF6gensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",$M="\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",Hi=(n,e)=>{for(const t in e)n[t]=e[t];return n},ih="numeric",sh="ascii",oh="alpha",Ws="asciinumeric",Vs="alphanumeric",ah="domain",Q1="emoji",FM="scheme",BM="slashscheme",lh="whitespace";function zM(n,e){return n in e||(e[n]=[]),e[n]}function Qr(n,e,t){e[ih]&&(e[Ws]=!0,e[Vs]=!0),e[sh]&&(e[Ws]=!0,e[oh]=!0),e[Ws]&&(e[Vs]=!0),e[oh]&&(e[Vs]=!0),e[Vs]&&(e[ah]=!0),e[Q1]&&(e[ah]=!0);for(const r in e){const i=zM(r,t);i.indexOf(n)<0&&i.push(n)}}function HM(n,e){const t={};for(const r in e)e[r].indexOf(n)>=0&&(t[r]=!0);return t}function wt(n=null){this.j={},this.jr=[],this.jd=null,this.t=n}wt.groups={},wt.prototype={accepts(){return!!this.t},go(n){const e=this,t=e.j[n];if(t)return t;for(let r=0;r<e.jr.length;r++){const i=e.jr[r][0],s=e.jr[r][1];if(s&&i.test(n))return s}return e.jd},has(n,e=!1){return e?n in this.j:!!this.go(n)},ta(n,e,t,r){for(let i=0;i<n.length;i++)this.tt(n[i],e,t,r)},tr(n,e,t,r){r=r||wt.groups;let i;return e&&e.j?i=e:(i=new wt(e),t&&r&&Qr(e,t,r)),this.jr.push([n,i]),i},ts(n,e,t,r){let i=this;const s=n.length;if(!s)return i;for(let a=0;a<s-1;a++)i=i.tt(n[a]);return i.tt(n[s-1],e,t,r)},tt(n,e,t,r){r=r||wt.groups;const i=this;if(e&&e.j)return i.j[n]=e,e;const s=e;let a,u=i.go(n);if(u?(a=new wt,Hi(a.j,u.j),a.jr.push.apply(a.jr,u.jr),a.jd=u.jd,a.t=u.t):a=new wt,s){if(r)if(a.t&&typeof a.t=="string"){const c=Hi(HM(a.t,r),t);Qr(s,c,r)}else t&&Qr(s,t,r);a.t=s}return i.j[n]=a,a}};const ae=(n,e,t,r,i)=>n.ta(e,t,r,i),Ne=(n,e,t,r,i)=>n.tr(e,t,r,i),ey=(n,e,t,r,i)=>n.ts(e,t,r,i),B=(n,e,t,r,i)=>n.tt(e,t,r,i),Vn="WORD",uh="UWORD",ty="ASCIINUMERICAL",ny="ALPHANUMERICAL",Us="LOCALHOST",ch="TLD",fh="UTLD",al="SCHEME",Wi="SLASH_SCHEME",hh="NUM",dh="WS",ph="NL",qs="OPENBRACE",Ks="CLOSEBRACE",ll="OPENBRACKET",ul="CLOSEBRACKET",cl="OPENPAREN",fl="CLOSEPAREN",hl="OPENANGLEBRACKET",dl="CLOSEANGLEBRACKET",pl="FULLWIDTHLEFTPAREN",ml="FULLWIDTHRIGHTPAREN",gl="LEFTCORNERBRACKET",yl="RIGHTCORNERBRACKET",bl="LEFTWHITECORNERBRACKET",_l="RIGHTWHITECORNERBRACKET",wl="FULLWIDTHLESSTHAN",vl="FULLWIDTHGREATERTHAN",Sl="AMPERSAND",mh="APOSTROPHE",xl="ASTERISK",Er="AT",El="BACKSLASH",Cl="BACKTICK",kl="CARET",Cr="COLON",gh="COMMA",Tl="DOLLAR",bn="DOT",Al="EQUALS",yh="EXCLAMATION",jt="HYPHEN",Gs="PERCENT",Ol="PIPE",Ml="PLUS",Il="POUND",Js="QUERY",bh="QUOTE",ry="FULLWIDTHMIDDLEDOT",_h="SEMI",_n="SLASH",js="TILDE",Nl="UNDERSCORE",iy="EMOJI",Rl="SYM";var sy=Object.freeze({__proto__:null,WORD:Vn,UWORD:uh,ASCIINUMERICAL:ty,ALPHANUMERICAL:ny,LOCALHOST:Us,TLD:ch,UTLD:fh,SCHEME:al,SLASH_SCHEME:Wi,NUM:hh,WS:dh,NL:ph,OPENBRACE:qs,CLOSEBRACE:Ks,OPENBRACKET:ll,CLOSEBRACKET:ul,OPENPAREN:cl,CLOSEPAREN:fl,OPENANGLEBRACKET:hl,CLOSEANGLEBRACKET:dl,FULLWIDTHLEFTPAREN:pl,FULLWIDTHRIGHTPAREN:ml,LEFTCORNERBRACKET:gl,RIGHTCORNERBRACKET:yl,LEFTWHITECORNERBRACKET:bl,RIGHTWHITECORNERBRACKET:_l,FULLWIDTHLESSTHAN:wl,FULLWIDTHGREATERTHAN:vl,AMPERSAND:Sl,APOSTROPHE:mh,ASTERISK:xl,AT:Er,BACKSLASH:El,BACKTICK:Cl,CARET:kl,COLON:Cr,COMMA:gh,DOLLAR:Tl,DOT:bn,EQUALS:Al,EXCLAMATION:yh,HYPHEN:jt,PERCENT:Gs,PIPE:Ol,PLUS:Ml,POUND:Il,QUERY:Js,QUOTE:bh,FULLWIDTHMIDDLEDOT:ry,SEMI:_h,SLASH:_n,TILDE:js,UNDERSCORE:Nl,EMOJI:iy,SYM:Rl});const Un=/[a-z]/,Ys=/\p{L}/u,wh=/\p{Emoji}/u,qn=/\d/,vh=/\s/,oy="\r",Sh=`
|
|
42
|
+
`,WM="\uFE0F",VM="\u200D",xh="\uFFFC";let Ll=null,Pl=null;function UM(n=[]){const e={};wt.groups=e;const t=new wt;Ll==null&&(Ll=ly(DM)),Pl==null&&(Pl=ly($M)),B(t,"'",mh),B(t,"{",qs),B(t,"}",Ks),B(t,"[",ll),B(t,"]",ul),B(t,"(",cl),B(t,")",fl),B(t,"<",hl),B(t,">",dl),B(t,"\uFF08",pl),B(t,"\uFF09",ml),B(t,"\u300C",gl),B(t,"\u300D",yl),B(t,"\u300E",bl),B(t,"\u300F",_l),B(t,"\uFF1C",wl),B(t,"\uFF1E",vl),B(t,"&",Sl),B(t,"*",xl),B(t,"@",Er),B(t,"`",Cl),B(t,"^",kl),B(t,":",Cr),B(t,",",gh),B(t,"$",Tl),B(t,".",bn),B(t,"=",Al),B(t,"!",yh),B(t,"-",jt),B(t,"%",Gs),B(t,"|",Ol),B(t,"+",Ml),B(t,"#",Il),B(t,"?",Js),B(t,'"',bh),B(t,"/",_n),B(t,";",_h),B(t,"~",js),B(t,"_",Nl),B(t,"\\",El),B(t,"\u30FB",ry);const r=Ne(t,qn,hh,{[ih]:!0});Ne(r,qn,r);const i=Ne(r,Un,ty,{[Ws]:!0}),s=Ne(r,Ys,ny,{[Vs]:!0}),a=Ne(t,Un,Vn,{[sh]:!0});Ne(a,qn,i),Ne(a,Un,a),Ne(i,qn,i),Ne(i,Un,i);const u=Ne(t,Ys,uh,{[oh]:!0});Ne(u,Un),Ne(u,qn,s),Ne(u,Ys,u),Ne(s,qn,s),Ne(s,Un),Ne(s,Ys,s);const c=B(t,Sh,ph,{[lh]:!0}),h=B(t,oy,dh,{[lh]:!0}),m=Ne(t,vh,dh,{[lh]:!0});B(t,xh,m),B(h,Sh,c),B(h,xh,m),Ne(h,vh,m),B(m,oy),B(m,Sh),Ne(m,vh,m),B(m,xh,m);const d=Ne(t,wh,iy,{[Q1]:!0});B(d,"#"),Ne(d,wh,d),B(d,WM,d);const y=B(d,VM);B(y,"#"),Ne(y,wh,d);const _=[[Un,a],[qn,i]],v=[[Un,null],[Ys,u],[qn,s]];for(let E=0;E<Ll.length;E++)kr(t,Ll[E],ch,Vn,_);for(let E=0;E<Pl.length;E++)kr(t,Pl[E],fh,uh,v);Qr(ch,{tld:!0,ascii:!0},e),Qr(fh,{utld:!0,alpha:!0},e),kr(t,"file",al,Vn,_),kr(t,"mailto",al,Vn,_),kr(t,"http",Wi,Vn,_),kr(t,"https",Wi,Vn,_),kr(t,"ftp",Wi,Vn,_),kr(t,"ftps",Wi,Vn,_),Qr(al,{scheme:!0,ascii:!0},e),Qr(Wi,{slashscheme:!0,ascii:!0},e),n=n.sort((E,N)=>E[0]>N[0]?1:-1);for(let E=0;E<n.length;E++){const N=n[E][0],S=n[E][1]?{[FM]:!0}:{[BM]:!0};N.indexOf("-")>=0?S[ah]=!0:Un.test(N)?qn.test(N)?S[Ws]=!0:S[sh]=!0:S[ih]=!0,ey(t,N,N,S)}return ey(t,"localhost",Us,{ascii:!0}),t.jd=new wt(Rl),{start:t,tokens:Hi({groups:e},sy)}}function ay(n,e){const t=qM(e.replace(/[A-Z]/g,u=>u.toLowerCase())),r=t.length,i=[];let s=0,a=0;for(;a<r;){let u=n,c=null,h=0,m=null,d=-1,y=-1;for(;a<r&&(c=u.go(t[a]));)u=c,u.accepts()?(d=0,y=0,m=u):d>=0&&(d+=t[a].length,y++),h+=t[a].length,s+=t[a].length,a++;s-=d,a-=y,h-=d,i.push({t:m.t,v:e.slice(s-h,s),s:s-h,e:s})}return i}function qM(n){const e=[],t=n.length;let r=0;for(;r<t;){let i=n.charCodeAt(r),s,a=i<55296||i>56319||r+1===t||(s=n.charCodeAt(r+1))<56320||s>57343?n[r]:n.slice(r,r+2);e.push(a),r+=a.length}return e}function kr(n,e,t,r,i){let s;const a=e.length;for(let u=0;u<a-1;u++){const c=e[u];n.j[c]?s=n.j[c]:(s=new wt(r),s.jr=i.slice(),n.j[c]=s),n=s}return s=new wt(t),s.jr=i.slice(),n.j[e[a-1]]=s,s}function ly(n){const e=[],t=[];let r=0,i="0123456789";for(;r<n.length;){let s=0;for(;i.indexOf(n[r+s])>=0;)s++;if(s>0){e.push(t.join(""));for(let a=parseInt(n.substring(r,r+s),10);a>0;a--)t.pop();r+=s}else t.push(n[r]),r++}return e}const Xs={defaultProtocol:"http",events:null,format:uy,formatHref:uy,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function Eh(n,e=null){let t=Hi({},Xs);n&&(t=Hi(t,n instanceof Eh?n.o:n));const r=t.ignoreTags,i=[];for(let s=0;s<r.length;s++)i.push(r[s].toUpperCase());this.o=t,e&&(this.defaultRender=e),this.ignoreTags=i}Eh.prototype={o:Xs,ignoreTags:[],defaultRender(n){return n},check(n){return this.get("validate",n.toString(),n)},get(n,e,t){const r=e!=null;let i=this.o[n];return i&&(typeof i=="object"?(i=t.t in i?i[t.t]:Xs[n],typeof i=="function"&&r&&(i=i(e,t))):typeof i=="function"&&r&&(i=i(e,t.t,t)),i)},getObj(n,e,t){let r=this.o[n];return typeof r=="function"&&e!=null&&(r=r(e,t.t,t)),r},render(n){const e=n.render(this);return(this.get("render",null,n)||this.defaultRender)(e,n.t,n)}};function uy(n){return n}function cy(n,e){this.t="token",this.v=n,this.tk=e}cy.prototype={isLink:!1,toString(){return this.v},toHref(n){return this.toString()},toFormattedString(n){const e=this.toString(),t=n.get("truncate",e,this),r=n.get("format",e,this);return t&&r.length>t?r.substring(0,t)+"\u2026":r},toFormattedHref(n){return n.get("formatHref",this.toHref(n.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(n=Xs.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(n),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(n){return{type:this.t,value:this.toFormattedString(n),isLink:this.isLink,href:this.toFormattedHref(n),start:this.startIndex(),end:this.endIndex()}},validate(n){return n.get("validate",this.toString(),this)},render(n){const e=this,t=this.toHref(n.get("defaultProtocol")),r=n.get("formatHref",t,this),i=n.get("tagName",t,e),s=this.toFormattedString(n),a={},u=n.get("className",t,e),c=n.get("target",t,e),h=n.get("rel",t,e),m=n.getObj("attributes",t,e),d=n.getObj("events",t,e);return a.href=r,u&&(a.class=u),c&&(a.target=c),h&&(a.rel=h),m&&Hi(a,m),{tagName:i,attributes:a,content:s,eventListeners:d}}};function Dl(n,e){class t extends cy{constructor(i,s){super(i,s),this.t=n}}for(const r in e)t.prototype[r]=e[r];return t.t=n,t}const fy=Dl("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),hy=Dl("text"),KM=Dl("nl"),$l=Dl("url",{isLink:!0,toHref(n=Xs.defaultProtocol){return this.hasProtocol()?this.v:`${n}://${this.v}`},hasProtocol(){const n=this.tk;return n.length>=2&&n[0].t!==Us&&n[1].t===Cr}}),Yt=n=>new wt(n);function GM({groups:n}){const e=n.domain.concat([Sl,xl,Er,El,Cl,kl,Tl,Al,jt,hh,Gs,Ol,Ml,Il,_n,Rl,js,Nl]),t=[Cr,gh,bn,yh,Gs,Js,bh,_h,hl,dl,qs,Ks,ul,ll,cl,fl,pl,ml,gl,yl,bl,_l,wl,vl],r=[Sl,mh,xl,El,Cl,kl,Tl,Al,jt,qs,Ks,Gs,Ol,Ml,Il,Js,_n,Rl,js,Nl],i=Yt(),s=B(i,js);ae(s,r,s),ae(s,n.domain,s);const a=Yt(),u=Yt(),c=Yt();ae(i,n.domain,a),ae(i,n.scheme,u),ae(i,n.slashscheme,c),ae(a,r,s),ae(a,n.domain,a);const h=B(a,Er);B(s,Er,h),B(u,Er,h),B(c,Er,h);const m=B(s,bn);ae(m,r,s),ae(m,n.domain,s);const d=Yt();ae(h,n.domain,d),ae(d,n.domain,d);const y=B(d,bn);ae(y,n.domain,d);const _=Yt(fy);ae(y,n.tld,_),ae(y,n.utld,_),B(h,Us,_);const v=B(d,jt);B(v,jt,v),ae(v,n.domain,d),ae(_,n.domain,d),B(_,bn,y),B(_,jt,v);const E=B(_,Cr);ae(E,n.numeric,fy);const N=B(a,jt),g=B(a,bn);B(N,jt,N),ae(N,n.domain,a),ae(g,r,s),ae(g,n.domain,a);const S=Yt($l);ae(g,n.tld,S),ae(g,n.utld,S),ae(S,n.domain,a),ae(S,r,s),B(S,bn,g),B(S,jt,N),B(S,Er,h);const k=B(S,Cr),T=Yt($l);ae(k,n.numeric,T);const A=Yt($l),$=Yt();ae(A,e,A),ae(A,t,$),ae($,e,A),ae($,t,$),B(S,_n,A),B(T,_n,A);const U=B(u,Cr),z=B(c,Cr),ee=B(z,_n),te=B(ee,_n);ae(u,n.domain,a),B(u,bn,g),B(u,jt,N),ae(c,n.domain,a),B(c,bn,g),B(c,jt,N),ae(U,n.domain,A),B(U,_n,A),B(U,Js,A),ae(te,n.domain,A),ae(te,e,A),B(te,_n,A);const Se=[[qs,Ks],[ll,ul],[cl,fl],[hl,dl],[pl,ml],[gl,yl],[bl,_l],[wl,vl]];for(let vt=0;vt<Se.length;vt++){const[Cn,$t]=Se[vt],kn=B(A,Cn);B($,Cn,kn),B(kn,$t,A);const We=Yt($l);ae(kn,e,We);const St=Yt();ae(kn,t),ae(We,e,We),ae(We,t,St),ae(St,e,We),ae(St,t,St),B(We,$t,A),B(St,$t,A)}return B(i,Us,S),B(i,ph,KM),{start:i,tokens:sy}}function JM(n,e,t){let r=t.length,i=0,s=[],a=[];for(;i<r;){let u=n,c=null,h=null,m=0,d=null,y=-1;for(;i<r&&!(c=u.go(t[i].t));)a.push(t[i++]);for(;i<r&&(h=c||u.go(t[i].t));)c=null,u=h,u.accepts()?(y=0,d=u):y>=0&&y++,i++,m++;if(y<0)i-=m,i<r&&(a.push(t[i]),i++);else{a.length>0&&(s.push(Ch(hy,e,a)),a=[]),i-=y,m-=y;const _=d.t,v=t.slice(i-m,i);s.push(Ch(_,e,v))}}return a.length>0&&s.push(Ch(hy,e,a)),s}function Ch(n,e,t){const r=t[0].s,i=t[t.length-1].e,s=e.slice(r,i);return new n(s,t)}const jM=typeof console<"u"&&console&&console.warn||(()=>{}),YM="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",ke={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function XM(){return wt.groups={},ke.scanner=null,ke.parser=null,ke.tokenQueue=[],ke.pluginQueue=[],ke.customSchemes=[],ke.initialized=!1,ke}function dy(n,e=!1){if(ke.initialized&&jM(`linkifyjs: already initialized - will not register custom scheme "${n}" ${YM}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(n))throw new Error(`linkifyjs: incorrect scheme format.
|
|
43
43
|
1. Must only contain digits, lowercase ASCII letters or "-"
|
|
44
44
|
2. Cannot start or end with "-"
|
|
45
|
-
3. "-" cannot repeat`);ke.customSchemes.push([n,e])}function YO(){ke.scanner=WO(ke.customSchemes);for(let n=0;n<ke.tokenQueue.length;n++)ke.tokenQueue[n][1]({scanner:ke.scanner});ke.parser=qO(ke.scanner.tokens);for(let n=0;n<ke.pluginQueue.length;n++)ke.pluginQueue[n][1]({scanner:ke.scanner,parser:ke.parser});return ke.initialized=!0,ke}function xl(n){return ke.initialized||YO(),KO(ke.parser.start,n,E1(ke.scanner.start,n))}xl.scan=E1;function N1(n,e=null,t=null){if(e&&typeof e=="object"){if(t)throw Error(`linkifyjs: Invalid link type ${e}; must be a string`);t=e,e=null}const r=new th(t),i=xl(n),s=[];for(let a=0;a<i.length;a++){const u=i[a];u.isLink&&(!e||u.t===e)&&r.check(u)&&s.push(u.toFormattedObject(r))}return s}function XO(n,e=null){const t=xl(n);return t.length===1&&t[0].isLink&&(!e||t[0].t===e)}class ZO extends Lf{addProps(){return{handlePaste:this._handlePaste}}_handlePaste(e,t,r){if(e.state.selection.empty)return!1;const i=r.content.textBetween(0,r.content.size).trim(),s=XO(i);if(!i||!s)return!1;const a=this._createLinkAttrs(i,r.content);return this.editor.commands.applyLink(a),!0}_createLinkAttrs(e,t){return kh.query(t,{typeName:oe.TEXT,mark:{typeName:Oe.LINK},getMark:{typeName:Oe.LINK}})?.attrs||{href:e}}}function W(n){return(...e)=>t=>n(t,...e)}function Cl(n){const e=Object.entries(n).reduce((t,[r,i])=>{if(!i)return t;const s=r.replace(/_/g,"-");return`${t}--zw-${s}:${i};`},"");return e?{style:e}:null}function Jr(n){const e=Cl(n);return["span",e?{...e,class:"zw-style"}:{},0]}function QO(n){return n.toLowerCase().replace(/(?:^|\s)\S/g,e=>e.toUpperCase())}function Yt(n,...e){return({editor:t})=>(t.commands[n](...e),!0)}var eM=Object.defineProperty,tM=(n,e,t)=>e in n?eM(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,Vn=(n,e,t)=>tM(n,typeof e!="symbol"?e+"":e,t),R1,L1,P1;function $e(n,e){let t=n.length;Array.isArray(n[0])||(n=[n]),Array.isArray(e[0])||(e=e.map(a=>[a]));let r=e[0].length,i=e[0].map((a,u)=>e.map(c=>c[u])),s=n.map(a=>i.map(u=>{let c=0;if(!Array.isArray(a)){for(let h of u)c+=a*h;return c}for(let h=0;h<a.length;h++)c+=a[h]*(u[h]||0);return c}));return t===1&&(s=s[0]),r===1?s.map(a=>a[0]):s}function D1(n){return Bs(n)==="string"}function Bs(n){return(Object.prototype.toString.call(n).match(/^\[object\s+(.*?)\]$/)[1]||"").toLowerCase()}function rh(n,{precision:e,unit:t}){return ih(n)?"none":nM(n,e)+(t??"")}function ih(n){return Number.isNaN(n)||n instanceof Number&&n?.none}function nM(n,e){if(n===0)return 0;let t=~~n,r=0;t&&e&&(r=~~Math.log10(Math.abs(t))+1);const i=10**(e-r);return Math.floor(n*i+.5)/i}const rM={deg:1,grad:.9,rad:180/Math.PI,turn:360};function iM(n){if(!n)return;n=n.trim();const e=/^([a-z]+)\((.+?)\)$/i,t=/^-?[\d.]+$/,r=/%|deg|g?rad|turn$/,i=/\/?\s*(none|[-\w.]+(?:%|deg|g?rad|turn)?)/g;let s=n.match(e);if(s){let a=[];return s[2].replace(i,(u,c)=>{let h=c.match(r),p=c;if(h){let m=h[0],y=p.slice(0,-m.length);m==="%"?(p=new Number(y/100),p.type="<percentage>"):(p=new Number(y*rM[m]),p.type="<angle>",p.unit=m)}else t.test(p)?(p=new Number(p),p.type="<number>"):p==="none"&&(p=new Number(NaN),p.none=!0);u.startsWith("/")&&(p=p instanceof Number?p:new Number(p),p.alpha=!0),typeof p=="object"&&p instanceof Number&&(p.raw=c),a.push(p)}),{name:s[1].toLowerCase(),rawName:s[1],rawArgs:s[2],args:a}}}function sM(n){return n[n.length-1]}function F1(n,e,t){return isNaN(n)?e:isNaN(e)?n:n+(e-n)*t}function oM(n,e,t){return(t-n)/(e-n)}function B1(n,e,t){return F1(e[0],e[1],oM(n[0],n[1],t))}function aM(n){return n.map(e=>e.split("|").map(t=>{t=t.trim();let r=t.match(/^(<[a-z]+>)\[(-?[.\d]+),\s*(-?[.\d]+)\]?$/);if(r){let i=new String(r[1]);return i.range=[+r[2],+r[3]],i}return t}))}function lM(n,e,t){return Math.max(Math.min(t,e),n)}function sh(n,e){return Math.sign(n)===Math.sign(e)?n:-n}function Un(n,e){return sh(Math.abs(n)**e,n)}function z1(n,e){return e===0?0:n/e}function uM(n,e,t=0,r=n.length){for(;t<r;){const i=t+r>>1;n[i]<e?t=i+1:r=i}return t}class cM{add(e,t,r){if(typeof arguments[0]!="string"){for(var e in arguments[0])this.add(e,arguments[0][e],arguments[1]);return}(Array.isArray(e)?e:[e]).forEach(function(i){this[i]=this[i]||[],t&&this[i][r?"unshift":"push"](t)},this)}run(e,t){this[e]=this[e]||[],this[e].forEach(function(r){r.call(t&&t.context?t.context:t,t)})}}const El=new cM,qn={D50:[.3457/.3585,1,(1-.3457-.3585)/.3585],D65:[.3127/.329,1,(1-.3127-.329)/.329]};function oh(n){return Array.isArray(n)?n:qn[n]}function kl(n,e,t,r={}){if(n=oh(n),e=oh(e),!n||!e)throw new TypeError(`Missing white point to convert ${n?"":"from"}${!n&&!e?"/":""}${e?"":"to"}`);if(n===e)return t;let i={W1:n,W2:e,XYZ:t,options:r};if(El.run("chromatic-adaptation-start",i),i.M||(i.W1===qn.D65&&i.W2===qn.D50?i.M=[[1.0479297925449969,.022946870601609652,-.05019226628920524],[.02962780877005599,.9904344267538799,-.017073799063418826],[-.009243040646204504,.015055191490298152,.7518742814281371]]:i.W1===qn.D50&&i.W2===qn.D65&&(i.M=[[.955473421488075,-.02309845494876471,.06325924320057072],[-.0283697093338637,1.0099953980813041,.021041441191917323],[.012314014864481998,-.020507649298898964,1.330365926242124]])),El.run("chromatic-adaptation-end",i),i.M)return $e(i.M,i.XYZ);throw new TypeError("Only Bradford CAT with white points D50 and D65 supported for now.")}const zs={gamut_mapping:"css",precision:5,deltaE:"76",verbose:((P1=(L1=(R1=globalThis?.process)==null?void 0:R1.env)==null?void 0:L1.NODE_ENV)==null?void 0:P1.toLowerCase())!=="test",warn:function(e){var t,r;this.verbose&&((r=(t=globalThis?.console)==null?void 0:t.warn)==null||r.call(t,e))}},fM=new Set(["<number>","<percentage>","<angle>"]);function $1(n,e,t,r){return Object.entries(n.coords).map(([s,a],u)=>{let c=e.coordGrammar[u],h=r[u],p=h?.type,m;if(h.none?m=c.find(S=>fM.has(S)):m=c.find(S=>S==p),!m){let S=a.name||s;throw new TypeError(`${p??h.raw} not allowed for ${S} in ${t}()`)}let y=m.range;p==="<percentage>"&&(y||(y=[0,1]));let _=a.range||a.refRange;return y&&_&&(r[u]=B1(y,_,r[u])),m})}function H1(n,{meta:e}={}){var t,r,i,s;let a={str:(t=String(n))==null?void 0:t.trim()};if(El.run("parse-start",a),a.color)return a.color;if(a.parsed=iM(a.str),a.parsed){let u=a.parsed.name;if(u==="color"){let c=a.parsed.args.shift(),h=c.startsWith("--")?c.substring(2):`--${c}`,p=[c,h],m=a.parsed.rawArgs.indexOf("/")>0?a.parsed.args.pop():1;for(let S of le.all){let E=S.getFormat("color");if(E&&(p.includes(E.id)||(r=E.ids)!=null&&r.filter(N=>p.includes(N)).length)){const N=Object.keys(S.coords).map((v,k)=>a.parsed.args[k]||0);let g;return E.coordGrammar&&(g=$1(S,E,"color",N)),e&&Object.assign(e,{formatId:"color",types:g}),E.id.startsWith("--")&&!c.startsWith("--")&&zs.warn(`${S.name} is a non-standard space and not currently supported in the CSS spec. Use prefixed color(${E.id}) instead of color(${c}).`),c.startsWith("--")&&!E.id.startsWith("--")&&zs.warn(`${S.name} is a standard space and supported in the CSS spec. Use color(${E.id}) instead of prefixed color(${c}).`),{spaceId:S.id,coords:N,alpha:m}}}let y="",_=c in le.registry?c:h;if(_ in le.registry){let S=(s=(i=le.registry[_].formats)==null?void 0:i.color)==null?void 0:s.id;S&&(y=`Did you mean color(${S})?`)}throw new TypeError(`Cannot parse color(${c}). `+(y||"Missing a plugin?"))}else for(let c of le.all){let h=c.getFormat(u);if(h&&h.type==="function"){let p=1;(h.lastAlpha||sM(a.parsed.args).alpha)&&(p=a.parsed.args.pop());let m=a.parsed.args,y;return h.coordGrammar&&(y=$1(c,h,u,m)),e&&Object.assign(e,{formatId:h.name,types:y}),{spaceId:c.id,coords:m,alpha:p}}}}else for(let u of le.all)for(let c in u.formats){let h=u.formats[c];if(h.type!=="custom"||h.test&&!h.test(a.str))continue;let p=h.parse(a.str);if(p)return p.alpha??(p.alpha=1),e&&(e.formatId=c),p}throw new TypeError(`Could not parse ${n} as a color. Missing a plugin?`)}function Ge(n){if(Array.isArray(n))return n.map(Ge);if(!n)throw new TypeError("Empty color reference");D1(n)&&(n=H1(n));let e=n.space||n.spaceId;return e instanceof le||(n.space=le.get(e)),n.alpha===void 0&&(n.alpha=1),n}const hM=75e-6,ah=class ln{constructor(e){var t;this.id=e.id,this.name=e.name,this.base=e.base?ln.get(e.base):null,this.aliases=e.aliases,this.base&&(this.fromBase=e.fromBase,this.toBase=e.toBase);let r=e.coords??this.base.coords;for(let s in r)"name"in r[s]||(r[s].name=s);this.coords=r;let i=e.white??this.base.white??"D65";this.white=oh(i),this.formats=e.formats??{};for(let s in this.formats){let a=this.formats[s];a.type||(a.type="function"),a.name||(a.name=s)}(t=this.formats.color)!=null&&t.id||(this.formats.color={...this.formats.color??{},id:e.cssId||this.id}),e.gamutSpace?this.gamutSpace=e.gamutSpace==="self"?this:ln.get(e.gamutSpace):this.isPolar?this.gamutSpace=this.base:this.gamutSpace=this,this.gamutSpace.isUnbounded&&(this.inGamut=(s,a)=>!0),this.referred=e.referred,Object.defineProperty(this,"path",{value:dM(this).reverse(),writable:!1,enumerable:!0,configurable:!0}),El.run("colorspace-init-end",this)}inGamut(e,{epsilon:t=hM}={}){if(!this.equals(this.gamutSpace))return e=this.to(this.gamutSpace,e),this.gamutSpace.inGamut(e,{epsilon:t});let r=Object.values(this.coords);return e.every((i,s)=>{let a=r[s];if(a.type!=="angle"&&a.range){if(Number.isNaN(i))return!0;let[u,c]=a.range;return(u===void 0||i>=u-t)&&(c===void 0||i<=c+t)}return!0})}get isUnbounded(){return Object.values(this.coords).every(e=>!("range"in e))}get cssId(){var e,t;return((t=(e=this.formats)==null?void 0:e.color)==null?void 0:t.id)||this.id}get isPolar(){for(let e in this.coords)if(this.coords[e].type==="angle")return!0;return!1}getFormat(e){if(typeof e=="object")return e=W1(e,this),e;let t;return e==="default"?t=Object.values(this.formats)[0]:t=this.formats[e],t?(t=W1(t,this),t):null}equals(e){return e?this===e||this.id===e||this.id===e.id:!1}to(e,t){if(arguments.length===1){const u=Ge(e);[e,t]=[u.space,u.coords]}if(e=ln.get(e),this.equals(e))return t;t=t.map(u=>Number.isNaN(u)?0:u);let r=this.path,i=e.path,s,a;for(let u=0;u<r.length&&r[u].equals(i[u]);u++)s=r[u],a=u;if(!s)throw new Error(`Cannot convert between color spaces ${this} and ${e}: no connection space was found`);for(let u=r.length-1;u>a;u--)t=r[u].toBase(t);for(let u=a+1;u<i.length;u++)t=i[u].fromBase(t);return t}from(e,t){if(arguments.length===1){const r=Ge(e);[e,t]=[r.space,r.coords]}return e=ln.get(e),e.to(this,t)}toString(){return`${this.name} (${this.id})`}getMinCoords(){let e=[];for(let t in this.coords){let r=this.coords[t],i=r.range||r.refRange;e.push(i?.min??0)}return e}static get all(){return[...new Set(Object.values(ln.registry))]}static register(e,t){if(arguments.length===1&&(t=arguments[0],e=t.id),t=this.get(t),this.registry[e]&&this.registry[e]!==t)throw new Error(`Duplicate color space registration: '${e}'`);if(this.registry[e]=t,arguments.length===1&&t.aliases)for(let r of t.aliases)this.register(r,t);return t}static get(e,...t){if(!e||e instanceof ln)return e;if(Bs(e)==="string"){let i=ln.registry[e.toLowerCase()];if(!i)throw new TypeError(`No color space found with id = "${e}"`);return i}if(t.length)return ln.get(...t);throw new TypeError(`${e} is not a valid color space`)}static resolveCoord(e,t){var r;let i=Bs(e),s,a;if(i==="string"?e.includes(".")?[s,a]=e.split("."):[s,a]=[,e]:Array.isArray(e)?[s,a]=e:(s=e.space,a=e.coordId),s=ln.get(s),s||(s=t),!s)throw new TypeError(`Cannot resolve coordinate reference ${e}: No color space specified and relative references are not allowed here`);if(i=Bs(a),i==="number"||i==="string"&&a>=0){let h=Object.entries(s.coords)[a];if(h)return{space:s,id:h[0],index:a,...h[1]}}s=ln.get(s);let u=a.toLowerCase(),c=0;for(let h in s.coords){let p=s.coords[h];if(h.toLowerCase()===u||((r=p.name)==null?void 0:r.toLowerCase())===u)return{space:s,id:h,index:c,...p};c++}throw new TypeError(`No "${a}" coordinate found in ${s.name}. Its coordinates are: ${Object.keys(s.coords).join(", ")}`)}};Vn(ah,"registry",{}),Vn(ah,"DEFAULT_FORMAT",{type:"functions",name:"color"});let le=ah;function dM(n){let e=[n];for(let t=n;t=t.base;)e.push(t);return e}function W1(n,{coords:e}={}){if(n.coords&&!n.coordGrammar){n.type||(n.type="function"),n.name||(n.name="color"),n.coordGrammar=aM(n.coords);let t=Object.entries(e).map(([r,i],s)=>{let a=n.coordGrammar[s][0],u=i.range||i.refRange,c=a.range,h="";return a=="<percentage>"?(c=[0,100],h="%"):a=="<angle>"&&(h="deg"),{fromRange:u,toRange:c,suffix:h}});n.serializeCoords=(r,i)=>r.map((s,a)=>{let{fromRange:u,toRange:c,suffix:h}=t[a];return u&&c&&(s=B1(u,c,s)),s=rh(s,{precision:i,unit:h}),s})}return n}const Kn=new le({id:"xyz-d65",name:"XYZ D65",coords:{x:{name:"X"},y:{name:"Y"},z:{name:"Z"}},white:"D65",formats:{color:{ids:["xyz-d65","xyz"]}},aliases:["xyz"]});class V1 extends le{constructor(e){e.coords||(e.coords={r:{range:[0,1],name:"Red"},g:{range:[0,1],name:"Green"},b:{range:[0,1],name:"Blue"}}),e.base||(e.base=Kn),e.toXYZ_M&&e.fromXYZ_M&&(e.toBase??(e.toBase=t=>{let r=$e(e.toXYZ_M,t);return this.white!==this.base.white&&(r=kl(this.white,this.base.white,r)),r}),e.fromBase??(e.fromBase=t=>(t=kl(this.base.white,this.white,t),$e(e.fromXYZ_M,t)))),e.referred??(e.referred="display"),super(e)}}function lh(n,e){return n=Ge(n),!e||n.space.equals(e)?n.coords.slice():(e=le.get(e),e.from(n))}function Gn(n,e){n=Ge(n);let{space:t,index:r}=le.resolveCoord(e,n.space);return lh(n,t)[r]}function U1(n,e,t){return n=Ge(n),e=le.get(e),n.coords=e.to(n.space,t),n}U1.returns="color";function uh(n,e,t){if(n=Ge(n),arguments.length===2&&Bs(arguments[1])==="object"){let r=arguments[1];for(let i in r)uh(n,i,r[i])}else{typeof t=="function"&&(t=t(Gn(n,e)));let{space:r,index:i}=le.resolveCoord(e,n.space),s=lh(n,r);s[i]=t,U1(n,r,s)}return n}uh.returns="color";const pM=new le({id:"xyz-d50",name:"XYZ D50",white:"D50",base:Kn,fromBase:n=>kl(Kn.white,"D50",n),toBase:n=>kl("D50",Kn.white,n)}),mM=216/24389,q1=24/116,Al=24389/27;let ch=qn.D50;const Jn=new le({id:"lab",name:"Lab",coords:{l:{refRange:[0,100],name:"Lightness"},a:{refRange:[-125,125]},b:{refRange:[-125,125]}},white:ch,base:pM,fromBase(n){let t=n.map((r,i)=>r/ch[i]).map(r=>r>mM?Math.cbrt(r):(Al*r+16)/116);return[116*t[1]-16,500*(t[0]-t[1]),200*(t[1]-t[2])]},toBase(n){let e=[];return e[1]=(n[0]+16)/116,e[0]=n[1]/500+e[1],e[2]=e[1]-n[2]/200,[e[0]>q1?Math.pow(e[0],3):(116*e[0]-16)/Al,n[0]>8?Math.pow((n[0]+16)/116,3):n[0]/Al,e[2]>q1?Math.pow(e[2],3):(116*e[2]-16)/Al].map((r,i)=>r*ch[i])},formats:{lab:{coords:["<number> | <percentage>","<number> | <percentage>[-1,1]","<number> | <percentage>[-1,1]"]}}});function xr(n){return(n%360+360)%360}const Tl=new le({id:"lch",name:"LCH",coords:{l:{refRange:[0,100],name:"Lightness"},c:{refRange:[0,150],name:"Chroma"},h:{refRange:[0,360],type:"angle",name:"Hue"}},base:Jn,fromBase(n){let[e,t,r]=n,i;const s=.02;return Math.abs(t)<s&&Math.abs(r)<s?i=NaN:i=Math.atan2(r,t)*180/Math.PI,[e,Math.sqrt(t**2+r**2),xr(i)]},toBase(n){let[e,t,r]=n;return t<0&&(t=0),isNaN(r)&&(r=0),[e,t*Math.cos(r*Math.PI/180),t*Math.sin(r*Math.PI/180)]},formats:{lch:{coords:["<number> | <percentage>","<number> | <percentage>","<number> | <angle>"]}}}),K1=25**7,Ol=Math.PI,G1=180/Ol,Ri=Ol/180;function J1(n){const e=n*n;return e*e*e*n}function j1(n,e,{kL:t=1,kC:r=1,kH:i=1}={}){[n,e]=Ge([n,e]);let[s,a,u]=Jn.from(n),c=Tl.from(Jn,[s,a,u])[1],[h,p,m]=Jn.from(e),y=Tl.from(Jn,[h,p,m])[1];c<0&&(c=0),y<0&&(y=0);let _=(c+y)/2,S=J1(_),E=.5*(1-Math.sqrt(S/(S+K1))),N=(1+E)*a,g=(1+E)*p,v=Math.sqrt(N**2+u**2),k=Math.sqrt(g**2+m**2),A=N===0&&u===0?0:Math.atan2(u,N),T=g===0&&m===0?0:Math.atan2(m,g);A<0&&(A+=2*Ol),T<0&&(T+=2*Ol),A*=G1,T*=G1;let F=h-s,U=k-v,H=T-A,ee=A+T,te=Math.abs(H),Se;v*k===0?Se=0:te<=180?Se=H:H>180?Se=H-360:H<-180?Se=H+360:zs.warn("the unthinkable has happened");let wt=2*Math.sqrt(k*v)*Math.sin(Se*Ri/2),Sn=(s+h)/2,Dt=(v+k)/2,xn=J1(Dt),We;v*k===0?We=ee:te<=180?We=ee/2:ee<360?We=(ee+360)/2:We=(ee-360)/2;let vt=(Sn-50)**2,Yn=1+.015*vt/Math.sqrt(20+vt),Gs=1+.045*Dt,cn=1;cn-=.17*Math.cos((We-30)*Ri),cn+=.24*Math.cos(2*We*Ri),cn+=.32*Math.cos((3*We+6)*Ri),cn-=.2*Math.cos((4*We-63)*Ri);let St=1+.015*Dt*cn,zl=30*Math.exp(-1*((We-275)/25)**2),$l=2*Math.sqrt(xn/(xn+K1)),Hl=-1*Math.sin(2*zl*Ri)*$l,Xt=(F/(t*Yn))**2;return Xt+=(U/(r*Gs))**2,Xt+=(wt/(i*St))**2,Xt+=Hl*(U/(r*Gs))*(wt/(i*St)),Math.sqrt(Xt)}const gM=[[.819022437996703,.3619062600528904,-.1288737815209879],[.0329836539323885,.9292868615863434,.0361446663506424],[.0481771893596242,.2642395317527308,.6335478284694309]],yM=[[1.2268798758459243,-.5578149944602171,.2813910456659647],[-.0405757452148008,1.112286803280317,-.0717110580655164],[-.0763729366746601,-.4214933324022432,1.5869240198367816]],bM=[[.210454268309314,.7936177747023054,-.0040720430116193],[1.9779985324311684,-2.42859224204858,.450593709617411],[.0259040424655478,.7827717124575296,-.8086757549230774]],_M=[[1,.3963377773761749,.2158037573099136],[1,-.1055613458156586,-.0638541728258133],[1,-.0894841775298119,-1.2914855480194092]],$s=new le({id:"oklab",name:"Oklab",coords:{l:{refRange:[0,1],name:"Lightness"},a:{refRange:[-.4,.4]},b:{refRange:[-.4,.4]}},white:"D65",base:Kn,fromBase(n){let t=$e(gM,n).map(r=>Math.cbrt(r));return $e(bM,t)},toBase(n){let t=$e(_M,n).map(r=>r**3);return $e(yM,t)},formats:{oklab:{coords:["<percentage> | <number>","<number> | <percentage>[-1,1]","<number> | <percentage>[-1,1]"]}}});function fh(n,e){[n,e]=Ge([n,e]);let[t,r,i]=$s.from(n),[s,a,u]=$s.from(e),c=t-s,h=r-a,p=i-u;return Math.sqrt(c**2+h**2+p**2)}const wM=75e-6;function Li(n,e,{epsilon:t=wM}={}){n=Ge(n),e||(e=n.space),e=le.get(e);let r=n.coords;return e!==n.space&&(r=e.from(n)),e.inGamut(r,{epsilon:t})}function hh(n){return{space:n.space,coords:n.coords.slice(),alpha:n.alpha}}function vM(n,e,t="lab"){t=le.get(t);let r=t.from(n),i=t.from(e);return Math.sqrt(r.reduce((s,a,u)=>{let c=i[u];return isNaN(a)||isNaN(c)?s:s+(c-a)**2},0))}function SM(n,e){return vM(n,e,"lab")}const xM=Math.PI,Y1=xM/180;function CM(n,e,{l:t=2,c:r=1}={}){[n,e]=Ge([n,e]);let[i,s,a]=Jn.from(n),[,u,c]=Tl.from(Jn,[i,s,a]),[h,p,m]=Jn.from(e),y=Tl.from(Jn,[h,p,m])[1];u<0&&(u=0),y<0&&(y=0);let _=i-h,S=u-y,E=s-p,N=a-m,g=E**2+N**2-S**2,v=.511;i>=16&&(v=.040975*i/(1+.01765*i));let k=.0638*u/(1+.0131*u)+.638,A;Number.isNaN(c)&&(c=0),c>=164&&c<=345?A=.56+Math.abs(.2*Math.cos((c+168)*Y1)):A=.36+Math.abs(.4*Math.cos((c+35)*Y1));let T=Math.pow(u,4),F=Math.sqrt(T/(T+1900)),U=k*(F*A+1-F),H=(_/(t*v))**2;return H+=(S/(r*k))**2,H+=g/U**2,Math.sqrt(H)}const X1=203,Z1=new le({id:"xyz-abs-d65",cssId:"--xyz-abs-d65",name:"Absolute XYZ D65",coords:{x:{refRange:[0,9504.7],name:"Xa"},y:{refRange:[0,1e4],name:"Ya"},z:{refRange:[0,10888.3],name:"Za"}},base:Kn,fromBase(n){return n.map(e=>Math.max(e*X1,0))},toBase(n){return n.map(e=>Math.max(e/X1,0))}}),Ml=1.15,Il=.66,Q1=2610/2**14,EM=2**14/2610,ey=3424/2**12,ty=2413/2**7,ny=2392/2**7,kM=1.7*2523/2**5,ry=2**5/(1.7*2523),Nl=-.56,dh=16295499532821565e-27,AM=[[.41478972,.579999,.014648],[-.20151,1.120649,.0531008],[-.0166008,.2648,.6684799]],TM=[[1.9242264357876067,-1.0047923125953657,.037651404030618],[.35031676209499907,.7264811939316552,-.06538442294808501],[-.09098281098284752,-.3127282905230739,1.5227665613052603]],OM=[[.5,.5,0],[3.524,-4.066708,.542708],[.199076,1.096799,-1.295875]],MM=[[1,.1386050432715393,.05804731615611886],[.9999999999999999,-.1386050432715393,-.05804731615611886],[.9999999999999998,-.09601924202631895,-.8118918960560388]],IM=new le({id:"jzazbz",name:"Jzazbz",coords:{jz:{refRange:[0,1],name:"Jz"},az:{refRange:[-.5,.5]},bz:{refRange:[-.5,.5]}},base:Z1,fromBase(n){let[e,t,r]=n,i=Ml*e-(Ml-1)*r,s=Il*t-(Il-1)*e,u=$e(AM,[i,s,r]).map(function(y){let _=ey+ty*(y/1e4)**Q1,S=1+ny*(y/1e4)**Q1;return(_/S)**kM}),[c,h,p]=$e(OM,u);return[(1+Nl)*c/(1+Nl*c)-dh,h,p]},toBase(n){let[e,t,r]=n,i=(e+dh)/(1+Nl-Nl*(e+dh)),a=$e(MM,[i,t,r]).map(function(y){let _=ey-y**ry,S=ny*y**ry-ty;return 1e4*(_/S)**EM}),[u,c,h]=$e(TM,a),p=(u+(Ml-1)*h)/Ml,m=(c+(Il-1)*p)/Il;return[p,m,h]},formats:{color:{coords:["<number> | <percentage>","<number> | <percentage>[-1,1]","<number> | <percentage>[-1,1]"]}}}),iy=new le({id:"jzczhz",name:"JzCzHz",coords:{jz:{refRange:[0,1],name:"Jz"},cz:{refRange:[0,1],name:"Chroma"},hz:{refRange:[0,360],type:"angle",name:"Hue"}},base:IM,fromBase(n){let[e,t,r]=n,i;const s=2e-4;return Math.abs(t)<s&&Math.abs(r)<s?i=NaN:i=Math.atan2(r,t)*180/Math.PI,[e,Math.sqrt(t**2+r**2),xr(i)]},toBase(n){return[n[0],n[1]*Math.cos(n[2]*Math.PI/180),n[1]*Math.sin(n[2]*Math.PI/180)]}});function NM(n,e){[n,e]=Ge([n,e]);let[t,r,i]=iy.from(n),[s,a,u]=iy.from(e),c=t-s,h=r-a;Number.isNaN(i)&&Number.isNaN(u)?(i=0,u=0):Number.isNaN(i)?i=u:Number.isNaN(u)&&(u=i);let p=i-u,m=2*Math.sqrt(r*a)*Math.sin(p/2*(Math.PI/180));return Math.sqrt(c**2+h**2+m**2)}const sy=3424/4096,oy=2413/128,ay=2392/128,ly=2610/16384,RM=2523/32,LM=16384/2610,uy=32/2523,PM=[[.3592832590121217,.6976051147779502,-.035891593232029],[-.1920808463704993,1.100476797037432,.0753748658519118],[.0070797844607479,.0748396662186362,.8433265453898765]],DM=[[2048/4096,2048/4096,0],[6610/4096,-13613/4096,7003/4096],[17933/4096,-17390/4096,-543/4096]],FM=[[.9999999999999998,.0086090370379328,.111029625003026],[.9999999999999998,-.0086090370379328,-.1110296250030259],[.9999999999999998,.5600313357106791,-.3206271749873188]],BM=[[2.0701522183894223,-1.3263473389671563,.2066510476294053],[.3647385209748072,.6805660249472273,-.0453045459220347],[-.0497472075358123,-.0492609666966131,1.1880659249923042]],cy=new le({id:"ictcp",name:"ICTCP",coords:{i:{refRange:[0,1],name:"I"},ct:{refRange:[-.5,.5],name:"CT"},cp:{refRange:[-.5,.5],name:"CP"}},base:Z1,fromBase(n){let e=$e(PM,n);return zM(e)},toBase(n){let e=$M(n);return $e(BM,e)}});function zM(n){let e=n.map(function(t){let r=sy+oy*(t/1e4)**ly,i=1+ay*(t/1e4)**ly;return(r/i)**RM});return $e(DM,e)}function $M(n){return $e(FM,n).map(function(r){let i=Math.max(r**uy-sy,0),s=oy-ay*r**uy;return 1e4*(i/s)**LM})}function HM(n,e){[n,e]=Ge([n,e]);let[t,r,i]=cy.from(n),[s,a,u]=cy.from(e);return 720*Math.sqrt((t-s)**2+.25*(r-a)**2+(i-u)**2)}const WM=qn.D65,fy=.42,hy=1/fy,ph=2*Math.PI,dy=[[.401288,.650173,-.051461],[-.250268,1.204414,.045854],[-.002079,.048952,.953127]],VM=[[1.8620678550872327,-1.0112546305316843,.14918677544445175],[.38752654323613717,.6214474419314753,-.008973985167612518],[-.015841498849333856,-.03412293802851557,1.0499644368778496]],UM=[[460,451,288],[460,-891,-261],[460,-220,-6300]],qM={dark:[.8,.525,.8],dim:[.9,.59,.9],average:[1,.69,1]},jr={h:[20.14,90,164.25,237.53,380.14],e:[.8,.7,1,1.2,.8],H:[0,100,200,300,400]},KM=180/Math.PI,py=Math.PI/180;function my(n,e){return n.map(r=>{const i=Un(e*Math.abs(r)*.01,fy);return 400*sh(i,r)/(i+27.13)})}function GM(n,e){const t=100/e*27.13**hy;return n.map(r=>{const i=Math.abs(r);return sh(t*Un(i/(400-i),hy),r)})}function JM(n){let e=xr(n);e<=jr.h[0]&&(e+=360);const t=uM(jr.h,e)-1,[r,i]=jr.h.slice(t,t+2),[s,a]=jr.e.slice(t,t+2),u=jr.H[t],c=(e-r)/s;return u+100*c/(c+(i-e)/a)}function jM(n){let e=(n%400+400)%400;const t=Math.floor(.01*e);e=e%100;const[r,i]=jr.h.slice(t,t+2),[s,a]=jr.e.slice(t,t+2);return xr((e*(a*r-s*i)-100*r*a)/(e*(a-s)-100*a))}function gy(n,e,t,r,i){const s={};s.discounting=i,s.refWhite=n,s.surround=r;const a=n.map(E=>E*100);s.la=e,s.yb=t;const u=a[1],c=$e(dy,a);r=qM[s.surround];const h=r[0];s.c=r[1],s.nc=r[2];const m=(1/(5*s.la+1))**4;s.fl=m*s.la+.1*(1-m)*(1-m)*Math.cbrt(5*s.la),s.flRoot=s.fl**.25,s.n=s.yb/u,s.z=1.48+Math.sqrt(s.n),s.nbb=.725*s.n**-.2,s.ncb=s.nbb;const y=Math.max(Math.min(h*(1-1/3.6*Math.exp((-s.la-42)/92)),1),0);s.dRgb=c.map(E=>F1(1,u/E,y)),s.dRgbInv=s.dRgb.map(E=>1/E);const _=c.map((E,N)=>E*s.dRgb[N]),S=my(_,s.fl);return s.aW=s.nbb*(2*S[0]+S[1]+.05*S[2]),s}const yy=gy(WM,64/Math.PI*.2,20,"average",!1);function mh(n,e){if(!(n.J!==void 0^n.Q!==void 0))throw new Error("Conversion requires one and only one: 'J' or 'Q'");if(!(n.C!==void 0^n.M!==void 0^n.s!==void 0))throw new Error("Conversion requires one and only one: 'C', 'M' or 's'");if(!(n.h!==void 0^n.H!==void 0))throw new Error("Conversion requires one and only one: 'h' or 'H'");if(n.J===0||n.Q===0)return[0,0,0];let t=0;n.h!==void 0?t=xr(n.h)*py:t=jM(n.H)*py;const r=Math.cos(t),i=Math.sin(t);let s=0;n.J!==void 0?s=Un(n.J,1/2)*.1:n.Q!==void 0&&(s=.25*e.c*n.Q/((e.aW+4)*e.flRoot));let a=0;n.C!==void 0?a=n.C/s:n.M!==void 0?a=n.M/e.flRoot/s:n.s!==void 0&&(a=4e-4*n.s**2*(e.aW+4)/e.c);const u=Un(a*Math.pow(1.64-Math.pow(.29,e.n),-.73),10/9),c=.25*(Math.cos(t+2)+3.8),h=e.aW*Un(s,2/e.c/e.z),p=5e4/13*e.nc*e.ncb*c,m=h/e.nbb,y=23*(m+.305)*z1(u,23*p+u*(11*r+108*i)),_=y*r,S=y*i,E=GM($e(UM,[m,_,S]).map(N=>N*1/1403),e.fl);return $e(VM,E.map((N,g)=>N*e.dRgbInv[g])).map(N=>N/100)}function by(n,e){const t=n.map(k=>k*100),r=my($e(dy,t).map((k,A)=>k*e.dRgb[A]),e.fl),i=r[0]+(-12*r[1]+r[2])/11,s=(r[0]+r[1]-2*r[2])/9,a=(Math.atan2(s,i)%ph+ph)%ph,u=.25*(Math.cos(a+2)+3.8),c=5e4/13*e.nc*e.ncb*z1(u*Math.sqrt(i**2+s**2),r[0]+r[1]+1.05*r[2]+.305),h=Un(c,.9)*Math.pow(1.64-Math.pow(.29,e.n),.73),p=e.nbb*(2*r[0]+r[1]+.05*r[2]),m=Un(p/e.aW,.5*e.c*e.z),y=100*Un(m,2),_=4/e.c*m*(e.aW+4)*e.flRoot,S=h*m,E=S*e.flRoot,N=xr(a*KM),g=JM(N),v=50*Un(e.c*h/(e.aW+4),1/2);return{J:y,C:S,h:N,s:v,Q:_,M:E,H:g}}new le({id:"cam16-jmh",cssId:"--cam16-jmh",name:"CAM16-JMh",coords:{j:{refRange:[0,100],name:"J"},m:{refRange:[0,105],name:"Colorfulness"},h:{refRange:[0,360],type:"angle",name:"Hue"}},base:Kn,fromBase(n){const e=by(n,yy);return[e.J,e.M,e.h]},toBase(n){return mh({J:n[0],M:n[1],h:n[2]},yy)}});const YM=qn.D65,XM=216/24389,_y=24389/27;function ZM(n){return 116*(n>XM?Math.cbrt(n):(_y*n+16)/116)-16}function gh(n){return n>8?Math.pow((n+16)/116,3):n/_y}function QM(n,e){let[t,r,i]=n,s=[],a=0;if(i===0)return[0,0,0];let u=gh(i);i>0?a=.00379058511492914*i**2+.608983189401032*i+.9155088574762233:a=9514440756550361e-21*i**2+.08693057439788597*i-21.928975842194614;const c=2e-12,h=15;let p=0,m=1/0;for(;p<=h;){s=mh({J:a,C:r,h:t},e);const y=Math.abs(s[1]-u);if(y<m){if(y<=c)return s;m=y}a=a-(s[1]-u)*a/(2*s[1]),p+=1}return mh({J:a,C:r,h:t},e)}function eI(n,e){const t=ZM(n[1]);if(t===0)return[0,0,0];const r=by(n,yh);return[xr(r.h),r.C,t]}const yh=gy(YM,200/Math.PI*gh(50),gh(50)*100,"average",!1),Rl=new le({id:"hct",name:"HCT",coords:{h:{refRange:[0,360],type:"angle",name:"Hue"},c:{refRange:[0,145],name:"Colorfulness"},t:{refRange:[0,100],name:"Tone"}},base:Kn,fromBase(n){return eI(n)},toBase(n){return QM(n,yh)},formats:{color:{id:"--hct",coords:["<number> | <angle>","<percentage> | <number>","<percentage> | <number>"]}}}),tI=Math.PI/180,wy=[1,.007,.0228];function vy(n){n[1]<0&&(n=Rl.fromBase(Rl.toBase(n)));const e=Math.log(Math.max(1+wy[2]*n[1]*yh.flRoot,1))/wy[2],t=n[0]*tI,r=e*Math.cos(t),i=e*Math.sin(t);return[n[2],r,i]}function nI(n,e){[n,e]=Ge([n,e]);let[t,r,i]=vy(Rl.from(n)),[s,a,u]=vy(Rl.from(e));return Math.sqrt((t-s)**2+(r-a)**2+(i-u)**2)}const Sy={deltaE76:SM,deltaECMC:CM,deltaE2000:j1,deltaEJz:NM,deltaEITP:HM,deltaEOK:fh,deltaEHCT:nI};function rI(n){const e=n?Math.floor(Math.log10(Math.abs(n))):0;return Math.max(parseFloat(`1e${e-2}`),1e-6)}const xy={hct:{method:"hct.c",jnd:2,deltaEMethod:"hct",blackWhiteClamp:{}},"hct-tonal":{method:"hct.c",jnd:0,deltaEMethod:"hct",blackWhiteClamp:{channel:"hct.t",min:0,max:100}}};function Hs(n,{method:e=zs.gamut_mapping,space:t=void 0,deltaEMethod:r="",jnd:i=2,blackWhiteClamp:s={}}={}){if(n=Ge(n),D1(arguments[1])?t=arguments[1]:t||(t=n.space),t=le.get(t),Li(n,t,{epsilon:0}))return n;let a;if(e==="css")a=iI(n,{space:t});else{if(e!=="clip"&&!Li(n,t)){Object.prototype.hasOwnProperty.call(xy,e)&&({method:e,jnd:i,deltaEMethod:r,blackWhiteClamp:s}=xy[e]);let u=j1;if(r!==""){for(let h in Sy)if("deltae"+r.toLowerCase()===h.toLowerCase()){u=Sy[h];break}}let c=Hs(He(n,t),{method:"clip",space:t});if(u(n,c)>i){if(Object.keys(s).length===3){let v=le.resolveCoord(s.channel),k=Gn(He(n,v.space),v.id);if(ih(k)&&(k=0),k>=s.max)return He({space:"xyz-d65",coords:qn.D65},n.space);if(k<=s.min)return He({space:"xyz-d65",coords:[0,0,0]},n.space)}let h=le.resolveCoord(e),p=h.space,m=h.id,y=He(n,p);y.coords.forEach((v,k)=>{ih(v)&&(y.coords[k]=0)});let S=(h.range||h.refRange)[0],E=rI(i),N=S,g=Gn(y,m);for(;g-N>E;){let v=hh(y);v=Hs(v,{space:t,method:"clip"}),u(y,v)-i<E?N=Gn(y,m):g=Gn(y,m),uh(y,m,(N+g)/2)}a=He(y,t)}else a=c}else a=He(n,t);if(e==="clip"||!Li(a,t,{epsilon:0})){let u=Object.values(t.coords).map(c=>c.range||[]);a.coords=a.coords.map((c,h)=>{let[p,m]=u[h];return p!==void 0&&(c=Math.max(p,c)),m!==void 0&&(c=Math.min(c,m)),c})}}return t!==n.space&&(a=He(a,n.space)),n.coords=a.coords,n}Hs.returns="color";const Cy={WHITE:{space:$s,coords:[1,0,0]},BLACK:{space:$s,coords:[0,0,0]}};function iI(n,{space:e}={}){n=Ge(n),e||(e=n.space),e=le.get(e);const i=le.get("oklch");if(e.isUnbounded)return He(n,e);const s=He(n,i);let a=s.coords[0];if(a>=1){const S=He(Cy.WHITE,e);return S.alpha=n.alpha,He(S,e)}if(a<=0){const S=He(Cy.BLACK,e);return S.alpha=n.alpha,He(S,e)}if(Li(s,e,{epsilon:0}))return He(s,e);function u(S){const E=He(S,e),N=Object.values(e.coords);return E.coords=E.coords.map((g,v)=>{if("range"in N[v]){const[k,A]=N[v].range;return lM(k,g,A)}return g}),E}let c=0,h=s.coords[1],p=!0,m=hh(s),y=u(m),_=fh(y,m);if(_<.02)return y;for(;h-c>1e-4;){const S=(c+h)/2;if(m.coords[1]=S,p&&Li(m,e,{epsilon:0}))c=S;else if(y=u(m),_=fh(y,m),_<.02){if(.02-_<1e-4)break;p=!1,c=S}else h=S}return y}function He(n,e,{inGamut:t}={}){n=Ge(n),e=le.get(e);let r=e.from(n),i={space:e,coords:r,alpha:n.alpha};return t&&(i=Hs(i,t===!0?void 0:t)),i}He.returns="color";function sI(n,{precision:e=zs.precision,format:t="default",inGamut:r=!0,...i}={}){var s;let a;n=Ge(n);let u=t;t=n.space.getFormat(t)??n.space.getFormat("default")??le.DEFAULT_FORMAT;let c=n.coords.slice();if(r||(r=t.toGamut),r&&!Li(n)&&(c=Hs(hh(n),r===!0?void 0:r).coords),t.type==="custom")if(i.precision=e,t.serialize)a=t.serialize(c,n.alpha,i);else throw new TypeError(`format ${u} can only be used to parse colors, not for serialization`);else{let h=t.name||"color";t.serializeCoords?c=t.serializeCoords(c,e):e!==null&&(c=c.map(_=>rh(_,{precision:e})));let p=[...c];if(h==="color"){let _=t.id||((s=t.ids)==null?void 0:s[0])||n.space.id;p.unshift(_)}let m=n.alpha;e!==null&&(m=rh(m,{precision:e}));let y=n.alpha>=1||t.noAlpha?"":`${t.commas?",":" /"} ${m}`;a=`${h}(${p.join(t.commas?", ":" ")}${y})`}return a}const oI=[[.41239079926595934,.357584339383878,.1804807884018343],[.21263900587151027,.715168678767756,.07219231536073371],[.01933081871559182,.11919477979462598,.9505321522496607]],aI=[[3.2409699419045226,-1.537383177570094,-.4986107602930034],[-.9692436362808796,1.8759675015077202,.04155505740717559],[.05563007969699366,-.20397695888897652,1.0569715142428786]],lI=new V1({id:"srgb-linear",name:"Linear sRGB",white:"D65",toXYZ_M:oI,fromXYZ_M:aI}),Ey={aliceblue:[240/255,248/255,1],antiquewhite:[250/255,235/255,215/255],aqua:[0,1,1],aquamarine:[127/255,1,212/255],azure:[240/255,1,1],beige:[245/255,245/255,220/255],bisque:[1,228/255,196/255],black:[0,0,0],blanchedalmond:[1,235/255,205/255],blue:[0,0,1],blueviolet:[138/255,43/255,226/255],brown:[165/255,42/255,42/255],burlywood:[222/255,184/255,135/255],cadetblue:[95/255,158/255,160/255],chartreuse:[127/255,1,0],chocolate:[210/255,105/255,30/255],coral:[1,127/255,80/255],cornflowerblue:[100/255,149/255,237/255],cornsilk:[1,248/255,220/255],crimson:[220/255,20/255,60/255],cyan:[0,1,1],darkblue:[0,0,139/255],darkcyan:[0,139/255,139/255],darkgoldenrod:[184/255,134/255,11/255],darkgray:[169/255,169/255,169/255],darkgreen:[0,100/255,0],darkgrey:[169/255,169/255,169/255],darkkhaki:[189/255,183/255,107/255],darkmagenta:[139/255,0,139/255],darkolivegreen:[85/255,107/255,47/255],darkorange:[1,140/255,0],darkorchid:[153/255,50/255,204/255],darkred:[139/255,0,0],darksalmon:[233/255,150/255,122/255],darkseagreen:[143/255,188/255,143/255],darkslateblue:[72/255,61/255,139/255],darkslategray:[47/255,79/255,79/255],darkslategrey:[47/255,79/255,79/255],darkturquoise:[0,206/255,209/255],darkviolet:[148/255,0,211/255],deeppink:[1,20/255,147/255],deepskyblue:[0,191/255,1],dimgray:[105/255,105/255,105/255],dimgrey:[105/255,105/255,105/255],dodgerblue:[30/255,144/255,1],firebrick:[178/255,34/255,34/255],floralwhite:[1,250/255,240/255],forestgreen:[34/255,139/255,34/255],fuchsia:[1,0,1],gainsboro:[220/255,220/255,220/255],ghostwhite:[248/255,248/255,1],gold:[1,215/255,0],goldenrod:[218/255,165/255,32/255],gray:[128/255,128/255,128/255],green:[0,128/255,0],greenyellow:[173/255,1,47/255],grey:[128/255,128/255,128/255],honeydew:[240/255,1,240/255],hotpink:[1,105/255,180/255],indianred:[205/255,92/255,92/255],indigo:[75/255,0,130/255],ivory:[1,1,240/255],khaki:[240/255,230/255,140/255],lavender:[230/255,230/255,250/255],lavenderblush:[1,240/255,245/255],lawngreen:[124/255,252/255,0],lemonchiffon:[1,250/255,205/255],lightblue:[173/255,216/255,230/255],lightcoral:[240/255,128/255,128/255],lightcyan:[224/255,1,1],lightgoldenrodyellow:[250/255,250/255,210/255],lightgray:[211/255,211/255,211/255],lightgreen:[144/255,238/255,144/255],lightgrey:[211/255,211/255,211/255],lightpink:[1,182/255,193/255],lightsalmon:[1,160/255,122/255],lightseagreen:[32/255,178/255,170/255],lightskyblue:[135/255,206/255,250/255],lightslategray:[119/255,136/255,153/255],lightslategrey:[119/255,136/255,153/255],lightsteelblue:[176/255,196/255,222/255],lightyellow:[1,1,224/255],lime:[0,1,0],limegreen:[50/255,205/255,50/255],linen:[250/255,240/255,230/255],magenta:[1,0,1],maroon:[128/255,0,0],mediumaquamarine:[102/255,205/255,170/255],mediumblue:[0,0,205/255],mediumorchid:[186/255,85/255,211/255],mediumpurple:[147/255,112/255,219/255],mediumseagreen:[60/255,179/255,113/255],mediumslateblue:[123/255,104/255,238/255],mediumspringgreen:[0,250/255,154/255],mediumturquoise:[72/255,209/255,204/255],mediumvioletred:[199/255,21/255,133/255],midnightblue:[25/255,25/255,112/255],mintcream:[245/255,1,250/255],mistyrose:[1,228/255,225/255],moccasin:[1,228/255,181/255],navajowhite:[1,222/255,173/255],navy:[0,0,128/255],oldlace:[253/255,245/255,230/255],olive:[128/255,128/255,0],olivedrab:[107/255,142/255,35/255],orange:[1,165/255,0],orangered:[1,69/255,0],orchid:[218/255,112/255,214/255],palegoldenrod:[238/255,232/255,170/255],palegreen:[152/255,251/255,152/255],paleturquoise:[175/255,238/255,238/255],palevioletred:[219/255,112/255,147/255],papayawhip:[1,239/255,213/255],peachpuff:[1,218/255,185/255],peru:[205/255,133/255,63/255],pink:[1,192/255,203/255],plum:[221/255,160/255,221/255],powderblue:[176/255,224/255,230/255],purple:[128/255,0,128/255],rebeccapurple:[102/255,51/255,153/255],red:[1,0,0],rosybrown:[188/255,143/255,143/255],royalblue:[65/255,105/255,225/255],saddlebrown:[139/255,69/255,19/255],salmon:[250/255,128/255,114/255],sandybrown:[244/255,164/255,96/255],seagreen:[46/255,139/255,87/255],seashell:[1,245/255,238/255],sienna:[160/255,82/255,45/255],silver:[192/255,192/255,192/255],skyblue:[135/255,206/255,235/255],slateblue:[106/255,90/255,205/255],slategray:[112/255,128/255,144/255],slategrey:[112/255,128/255,144/255],snow:[1,250/255,250/255],springgreen:[0,1,127/255],steelblue:[70/255,130/255,180/255],tan:[210/255,180/255,140/255],teal:[0,128/255,128/255],thistle:[216/255,191/255,216/255],tomato:[1,99/255,71/255],turquoise:[64/255,224/255,208/255],violet:[238/255,130/255,238/255],wheat:[245/255,222/255,179/255],white:[1,1,1],whitesmoke:[245/255,245/255,245/255],yellow:[1,1,0],yellowgreen:[154/255,205/255,50/255]};let ky=Array(3).fill("<percentage> | <number>[0, 255]"),Ay=Array(3).fill("<number>[0, 255]");const Ty=new V1({id:"srgb",name:"sRGB",base:lI,fromBase:n=>n.map(e=>{let t=e<0?-1:1,r=e*t;return r>.0031308?t*(1.055*r**(1/2.4)-.055):12.92*e}),toBase:n=>n.map(e=>{let t=e<0?-1:1,r=e*t;return r<=.04045?e/12.92:t*((r+.055)/1.055)**2.4}),formats:{rgb:{coords:ky},rgb_number:{name:"rgb",commas:!0,coords:Ay,noAlpha:!0},color:{},rgba:{coords:ky,commas:!0,lastAlpha:!0},rgba_number:{name:"rgba",commas:!0,coords:Ay},hex:{type:"custom",toGamut:!0,test:n=>/^#([a-f0-9]{3,4}){1,2}$/i.test(n),parse(n){n.length<=5&&(n=n.replace(/[a-f0-9]/gi,"$&$&"));let e=[];return n.replace(/[a-f0-9]{2}/gi,t=>{e.push(parseInt(t,16)/255)}),{spaceId:"srgb",coords:e.slice(0,3),alpha:e.slice(3)[0]}},serialize:(n,e,{collapse:t=!0}={})=>{e<1&&n.push(e),n=n.map(s=>Math.round(s*255));let r=t&&n.every(s=>s%17===0);return"#"+n.map(s=>r?(s/17).toString(16):s.toString(16).padStart(2,"0")).join("")}},keyword:{type:"custom",test:n=>/^[a-z]+$/i.test(n),parse(n){n=n.toLowerCase();let e={spaceId:"srgb",coords:null,alpha:1};if(n==="transparent"?(e.coords=Ey.black,e.alpha=0):e.coords=Ey[n],e.coords)return e}}}});function uI(n){return Gn(n,[Kn,"y"])}const Oy=new le({id:"hsl",name:"HSL",coords:{h:{refRange:[0,360],type:"angle",name:"Hue"},s:{range:[0,100],name:"Saturation"},l:{range:[0,100],name:"Lightness"}},base:Ty,fromBase:n=>{let e=Math.max(...n),t=Math.min(...n),[r,i,s]=n,[a,u,c]=[NaN,0,(t+e)/2],h=e-t;if(h!==0){switch(u=c===0||c===1?0:(e-c)/Math.min(c,1-c),e){case r:a=(i-s)/h+(i<s?6:0);break;case i:a=(s-r)/h+2;break;case s:a=(r-i)/h+4}a=a*60}return u<0&&(a+=180,u=Math.abs(u)),a>=360&&(a-=360),[a,u*100,c*100]},toBase:n=>{let[e,t,r]=n;e=e%360,e<0&&(e+=360),t/=100,r/=100;function i(s){let a=(s+e/30)%12,u=t*Math.min(r,1-r);return r-u*Math.max(-1,Math.min(a-3,9-a,1))}return[i(0),i(8),i(4)]},formats:{hsl:{coords:["<number> | <angle>","<percentage>","<percentage>"]},hsla:{coords:["<number> | <angle>","<percentage>","<percentage>"],commas:!0,lastAlpha:!0}}}),cI=new le({id:"hsv",name:"HSV",coords:{h:{refRange:[0,360],type:"angle",name:"Hue"},s:{range:[0,100],name:"Saturation"},v:{range:[0,100],name:"Value"}},base:Oy,fromBase(n){let[e,t,r]=n;t/=100,r/=100;let i=r+t*Math.min(r,1-r);return[e,i===0?0:200*(1-r/i),100*i]},toBase(n){let[e,t,r]=n;t/=100,r/=100;let i=r*(1-t/2);return[e,i===0||i===1?0:(r-i)/Math.min(i,1-i)*100,i*100]},formats:{color:{id:"--hsv",coords:["<number> | <angle>","<percentage> | <number>","<percentage> | <number>"]}}}),fI=new le({id:"oklch",name:"Oklch",coords:{l:{refRange:[0,1],name:"Lightness"},c:{refRange:[0,.4],name:"Chroma"},h:{refRange:[0,360],type:"angle",name:"Hue"}},white:"D65",base:$s,fromBase(n){let[e,t,r]=n,i;const s=2e-4;return Math.abs(t)<s&&Math.abs(r)<s?i=NaN:i=Math.atan2(r,t)*180/Math.PI,[e,Math.sqrt(t**2+r**2),xr(i)]},toBase(n){let[e,t,r]=n,i,s;return isNaN(r)?(i=0,s=0):(i=t*Math.cos(r*Math.PI/180),s=t*Math.sin(r*Math.PI/180)),[e,i,s]},formats:{oklch:{coords:["<percentage> | <number>","<number> | <percentage>[0,1]","<number> | <angle>"]}}});class Pt{constructor(e){Vn(this,"data"),this.data=He(e,"srgb")}static fromTransparent(){return new Pt({spaceId:"srgb",coords:[1,1,1],alpha:0})}static fromBlack(){return new Pt({spaceId:"srgb",coords:[0,0,0],alpha:1})}static fromWhite(){return new Pt({spaceId:"srgb",coords:[1,1,1],alpha:1})}get r(){return Math.round(this.data.coords[0]*255)}get g(){return Math.round(this.data.coords[1]*255)}get b(){return Math.round(this.data.coords[2]*255)}get h(){return Gn(this.data,"hsv.h")}get s(){return Gn(this.data,"hsv.s")}get v(){return Gn(this.data,"hsv.v")}get alpha(){return this.data.alpha.valueOf()}get alphaPercent(){return Math.round(this.alpha*100)}get isTransparent(){return this.alpha===0}get isDark(){return uI(this.data)<.5}withAlpha(e){return new Pt({...this.data,alpha:e})}withRgb(e){const t=this.alpha===0?1:this.alpha;return new Pt({spaceId:"srgb",alpha:e.a??t,coords:[e.r?e.r/255:this.data.coords[0],e.g?e.g/255:this.data.coords[1],e.b?e.b/255:this.data.coords[2]]})}withHsv(e){const r=lh(this.data,"hsv"),i=Math.max(e.s??r[1],1e-5),s=Math.max(e.v??r[2],1e-5),a=this.alpha===0?1:this.alpha;return new Pt({alpha:a,spaceId:"hsv",coords:[e.h??r[0],i,s]})}toString(){return this.alpha===1?this.toHexString():this.toRgbaString()}toHexString(){const e=sI(this.data,{format:"hex"}).toUpperCase();return e.length===4?`#${e[1]}${e[1]}${e[2]}${e[2]}${e[3]}${e[3]}`:e.slice(0,7)}toRgbaString(){return`rgba(${this.r}, ${this.g}, ${this.b}, ${this.alphaPercent}%)`}clone(){return new Pt(this.data)}}class hI{constructor(e){Vn(this,"_color"),Vn(this,"isEmpty",!1),this.update(e)}get color(){return this._color}setColor(e){this._color=e}setEmpty(e){this.isEmpty=e}toString(){return this.isEmpty?"":this.color.toString()}isEqual(e){return this.toString()===e}update({solidColor:e,isEmpty:t}){this.setColor(e),this.setEmpty(t)}}let My=999;function dI(){return My+=1,My}function pI(n){return n?n.startsWith("linear-gradient("):!1}function mI(){const n=Pt.fromTransparent();return{isEmpty:!0,isGradient:!1,solidColor:n,angle:0,transitions:[{color:n.clone(),offset:0},{color:n.clone(),offset:100}]}}le.register(Ty),le.register(cI),le.register(Oy),le.register(fI);function Iy(n){if(!n)return Pt.fromTransparent();try{return new Pt(He(H1(n),"srgb"))}catch(e){return console.warn(e),Pt.fromBlack()}}function gI(n){const e={"to top":0,"to top right":45,"to right":90,"to bottom right":135,"to bottom":180,"to bottom left":225,"to left":270,"to top left":315};return e[n]?e[n]:n.includes("deg")?Number.parseInt(n.trim().replace("deg","")):0}function yI(n){return n.map(e=>{const[t,r]=e.trim().split(/\s+(?![^(]*\))/);return{color:Iy(t),offset:Number.parseFloat(r.replace("%",""))}})}function bI(n){const e=n.indexOf("("),t=n.lastIndexOf(")"),[r,...i]=n.slice(e+1,t).split(/,(?![^(]*\))/),s=yI(i),a=gI(r);return{isEmpty:!1,isGradient:!0,solidColor:s[0].color,angle:a,transitions:s}}function _I(n){const e=Iy(n),t=Pt.fromWhite();return{isEmpty:!1,isGradient:!1,solidColor:e,angle:0,transitions:[{color:t,offset:0},{color:e.withAlpha(1),offset:100}]}}function wI(n,e=!0){if(!n)return mI();const t=pI(n)?bI(n):_I(n);return t.isGradient&&!e?{...t,isGradient:!1}:t}class Ch{constructor(e,t=0){Vn(this,"id"),this.color=e,this.offset=t,this.id=dI()}setOffset(e){this.offset=e}toString(){return`${this.color.toString()} ${this.offset}%`}clone(e){return new Ch(this.color.clone(),e)}}class vI{constructor(e){Vn(this,"isEmpty",!1),Vn(this,"_angle",0),Vn(this,"_transitions",[]),this.update(e)}get transitions(){return this._transitions}get canAddTransition(){return this.transitions.length<5}get canRemoveTransition(){return this.transitions.length>2}get angle(){return this._angle}setAngle(e){this._angle=e}setEmpty(e){this.isEmpty=e}addTransition(e){this.transitions.push(e),this.sortTransitions()}removeTransition(e){this._transitions=this.transitions.filter(({id:t})=>t!==e.id)}sortTransitions(){this._transitions=this.transitions.sort((e,t)=>e.offset-t.offset)}toString(e){if(this.isEmpty)return"";const t=this.transitions.map(r=>r.toString());return`linear-gradient(${e??this.angle}deg, ${t.join(", ")})`}isEqual(e){return this.toString()===e}update(e){this._angle=e.angle,this._transitions=e.transitions.map(({color:t,offset:r})=>new Ch(t,r)),this.setEmpty(e.isEmpty)}hasTransition(e){return this.transitions.some(t=>t.id===e.id)}}function SI(n){const e=wI(n);return(e.isGradient?new vI(e):new hI(e)).toString()}function Ny(n){return SI(n)}function Ry(n,e){if(!n.includes("em"))return parseInt(n);const t=Pi.getComputedStyle(e).fontSize,r=parseFloat(n)*parseFloat(t);return Math.round(r)}function xI(n,e){return(n.firstElementChild||n).style.fontSize||Pi.getComputedStyle(e).fontSize}function CI(n,e,t){if(!n.includes("px"))return n;const r=xI(e,t),i=Ry(r,t);return i?(parseInt(n)/i).toFixed(2):null}const EI={start:_r.LEFT,end:_r.RIGHT};function kI(n){const e=EI[n]||n;return OO.includes(e)?e:null}const Ly=(n,e,t,r)=>({from:Math.max(r,n.pos),to:Math.min(r+t.nodeSize,e.pos)});function Py(n,e){return n.resolve(e).depth+1}function AI(n,e,t,r){const i=Py(n,r),s=e.from-i<=r,a=e.to+i>=t.nodeSize+r;return s&&a}const TI=(n,e)=>n.eq(e);function OI(n,e,t,r=TI){const i=n.resolve(e).path.slice().reverse();for(const s of i)if(typeof s!="number"){for(const a of s.marks)if(r(a,t))return!0}return!1}function MI(n,e){const t=typeof e=="string"?e:e.name;return n.find(r=>r.type.name===t)}var Ws={exports:{}};var II=Ws.exports,Dy;function NI(){return Dy||(Dy=1,function(n,e){(function(){var t,r="4.17.21",i=200,s="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",a="Expected a function",u="Invalid `variable` option passed into `_.template`",c="__lodash_hash_undefined__",h=500,p="__lodash_placeholder__",m=1,y=2,_=4,S=1,E=2,N=1,g=2,v=4,k=8,A=16,T=32,F=64,U=128,H=256,ee=512,te=30,Se="...",wt=800,Sn=16,Dt=1,xn=2,We=3,vt=1/0,Yn=9007199254740991,Gs=17976931348623157e292,cn=NaN,St=4294967295,zl=St-1,$l=St>>>1,Hl=[["ary",U],["bind",N],["bindKey",g],["curry",k],["curryRight",A],["flip",ee],["partial",T],["partialRight",F],["rearg",H]],Xt="[object Arguments]",Js="[object Array]",Gy="[object AsyncFunction]",$i="[object Boolean]",Hi="[object Date]",Jy="[object DOMException]",js="[object Error]",Ys="[object Function]",Ah="[object GeneratorFunction]",Zt="[object Map]",Wi="[object Number]",jy="[object Null]",Cn="[object Object]",Th="[object Promise]",Yy="[object Proxy]",Vi="[object RegExp]",Qt="[object Set]",Ui="[object String]",Xs="[object Symbol]",Xy="[object Undefined]",qi="[object WeakMap]",Zy="[object WeakSet]",Ki="[object ArrayBuffer]",Qr="[object DataView]",Wl="[object Float32Array]",Vl="[object Float64Array]",Ul="[object Int8Array]",ql="[object Int16Array]",Kl="[object Int32Array]",Gl="[object Uint8Array]",Jl="[object Uint8ClampedArray]",jl="[object Uint16Array]",Yl="[object Uint32Array]",Qy=/\b__p \+= '';/g,eb=/\b(__p \+=) '' \+/g,tb=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Oh=/&(?:amp|lt|gt|quot|#39);/g,Mh=/[&<>"']/g,nb=RegExp(Oh.source),rb=RegExp(Mh.source),ib=/<%-([\s\S]+?)%>/g,sb=/<%([\s\S]+?)%>/g,Ih=/<%=([\s\S]+?)%>/g,ob=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ab=/^\w*$/,lb=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Xl=/[\\^$.*+?()[\]{}|]/g,ub=RegExp(Xl.source),Zl=/^\s+/,cb=/\s/,fb=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,hb=/\{\n\/\* \[wrapped with (.+)\] \*/,db=/,? & /,pb=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,mb=/[()=,{}\[\]\/\s]/,gb=/\\(\\)?/g,yb=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Nh=/\w*$/,bb=/^[-+]0x[0-9a-f]+$/i,_b=/^0b[01]+$/i,wb=/^\[object .+?Constructor\]$/,vb=/^0o[0-7]+$/i,Sb=/^(?:0|[1-9]\d*)$/,xb=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Zs=/($^)/,Cb=/['\n\r\u2028\u2029\\]/g,Qs="\\ud800-\\udfff",Eb="\\u0300-\\u036f",kb="\\ufe20-\\ufe2f",Ab="\\u20d0-\\u20ff",Rh=Eb+kb+Ab,Lh="\\u2700-\\u27bf",Ph="a-z\\xdf-\\xf6\\xf8-\\xff",Tb="\\xac\\xb1\\xd7\\xf7",Ob="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Mb="\\u2000-\\u206f",Ib=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Dh="A-Z\\xc0-\\xd6\\xd8-\\xde",Fh="\\ufe0e\\ufe0f",Bh=Tb+Ob+Mb+Ib,Ql="['\u2019]",Nb="["+Qs+"]",zh="["+Bh+"]",eo="["+Rh+"]",$h="\\d+",Rb="["+Lh+"]",Hh="["+Ph+"]",Wh="[^"+Qs+Bh+$h+Lh+Ph+Dh+"]",eu="\\ud83c[\\udffb-\\udfff]",Lb="(?:"+eo+"|"+eu+")",Vh="[^"+Qs+"]",tu="(?:\\ud83c[\\udde6-\\uddff]){2}",nu="[\\ud800-\\udbff][\\udc00-\\udfff]",ei="["+Dh+"]",Uh="\\u200d",qh="(?:"+Hh+"|"+Wh+")",Pb="(?:"+ei+"|"+Wh+")",Kh="(?:"+Ql+"(?:d|ll|m|re|s|t|ve))?",Gh="(?:"+Ql+"(?:D|LL|M|RE|S|T|VE))?",Jh=Lb+"?",jh="["+Fh+"]?",Db="(?:"+Uh+"(?:"+[Vh,tu,nu].join("|")+")"+jh+Jh+")*",Fb="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Bb="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Yh=jh+Jh+Db,zb="(?:"+[Rb,tu,nu].join("|")+")"+Yh,$b="(?:"+[Vh+eo+"?",eo,tu,nu,Nb].join("|")+")",Hb=RegExp(Ql,"g"),Wb=RegExp(eo,"g"),ru=RegExp(eu+"(?="+eu+")|"+$b+Yh,"g"),Vb=RegExp([ei+"?"+Hh+"+"+Kh+"(?="+[zh,ei,"$"].join("|")+")",Pb+"+"+Gh+"(?="+[zh,ei+qh,"$"].join("|")+")",ei+"?"+qh+"+"+Kh,ei+"+"+Gh,Bb,Fb,$h,zb].join("|"),"g"),Ub=RegExp("["+Uh+Qs+Rh+Fh+"]"),qb=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Kb=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Gb=-1,Ee={};Ee[Wl]=Ee[Vl]=Ee[Ul]=Ee[ql]=Ee[Kl]=Ee[Gl]=Ee[Jl]=Ee[jl]=Ee[Yl]=!0,Ee[Xt]=Ee[Js]=Ee[Ki]=Ee[$i]=Ee[Qr]=Ee[Hi]=Ee[js]=Ee[Ys]=Ee[Zt]=Ee[Wi]=Ee[Cn]=Ee[Vi]=Ee[Qt]=Ee[Ui]=Ee[qi]=!1;var Ce={};Ce[Xt]=Ce[Js]=Ce[Ki]=Ce[Qr]=Ce[$i]=Ce[Hi]=Ce[Wl]=Ce[Vl]=Ce[Ul]=Ce[ql]=Ce[Kl]=Ce[Zt]=Ce[Wi]=Ce[Cn]=Ce[Vi]=Ce[Qt]=Ce[Ui]=Ce[Xs]=Ce[Gl]=Ce[Jl]=Ce[jl]=Ce[Yl]=!0,Ce[js]=Ce[Ys]=Ce[qi]=!1;var Jb={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"s"},jb={"&":"&","<":"<",">":">",'"':""","'":"'"},Yb={"&":"&","<":"<",">":">",""":'"',"'":"'"},Xb={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Zb=parseFloat,Qb=parseInt,Xh=typeof Ho=="object"&&Ho&&Ho.Object===Object&&Ho,e2=typeof self=="object"&&self&&self.Object===Object&&self,Xe=Xh||e2||Function("return this")(),iu=e&&!e.nodeType&&e,Ar=iu&&!0&&n&&!n.nodeType&&n,Zh=Ar&&Ar.exports===iu,su=Zh&&Xh.process,Ft=function(){try{var M=Ar&&Ar.require&&Ar.require("util").types;return M||su&&su.binding&&su.binding("util")}catch{}}(),Qh=Ft&&Ft.isArrayBuffer,ed=Ft&&Ft.isDate,td=Ft&&Ft.isMap,nd=Ft&&Ft.isRegExp,rd=Ft&&Ft.isSet,id=Ft&&Ft.isTypedArray;function xt(M,L,R){switch(R.length){case 0:return M.call(L);case 1:return M.call(L,R[0]);case 2:return M.call(L,R[0],R[1]);case 3:return M.call(L,R[0],R[1],R[2])}return M.apply(L,R)}function t2(M,L,R,G){for(var ne=-1,be=M==null?0:M.length;++ne<be;){var Be=M[ne];L(G,Be,R(Be),M)}return G}function Bt(M,L){for(var R=-1,G=M==null?0:M.length;++R<G&&L(M[R],R,M)!==!1;);return M}function n2(M,L){for(var R=M==null?0:M.length;R--&&L(M[R],R,M)!==!1;);return M}function sd(M,L){for(var R=-1,G=M==null?0:M.length;++R<G;)if(!L(M[R],R,M))return!1;return!0}function Xn(M,L){for(var R=-1,G=M==null?0:M.length,ne=0,be=[];++R<G;){var Be=M[R];L(Be,R,M)&&(be[ne++]=Be)}return be}function to(M,L){var R=M==null?0:M.length;return!!R&&ti(M,L,0)>-1}function ou(M,L,R){for(var G=-1,ne=M==null?0:M.length;++G<ne;)if(R(L,M[G]))return!0;return!1}function Ae(M,L){for(var R=-1,G=M==null?0:M.length,ne=Array(G);++R<G;)ne[R]=L(M[R],R,M);return ne}function Zn(M,L){for(var R=-1,G=L.length,ne=M.length;++R<G;)M[ne+R]=L[R];return M}function au(M,L,R,G){var ne=-1,be=M==null?0:M.length;for(G&&be&&(R=M[++ne]);++ne<be;)R=L(R,M[ne],ne,M);return R}function r2(M,L,R,G){var ne=M==null?0:M.length;for(G&&ne&&(R=M[--ne]);ne--;)R=L(R,M[ne],ne,M);return R}function lu(M,L){for(var R=-1,G=M==null?0:M.length;++R<G;)if(L(M[R],R,M))return!0;return!1}var i2=uu("length");function s2(M){return M.split("")}function o2(M){return M.match(pb)||[]}function od(M,L,R){var G;return R(M,function(ne,be,Be){if(L(ne,be,Be))return G=be,!1}),G}function no(M,L,R,G){for(var ne=M.length,be=R+(G?1:-1);G?be--:++be<ne;)if(L(M[be],be,M))return be;return-1}function ti(M,L,R){return L===L?b2(M,L,R):no(M,ad,R)}function a2(M,L,R,G){for(var ne=R-1,be=M.length;++ne<be;)if(G(M[ne],L))return ne;return-1}function ad(M){return M!==M}function ld(M,L){var R=M==null?0:M.length;return R?fu(M,L)/R:cn}function uu(M){return function(L){return L==null?t:L[M]}}function cu(M){return function(L){return M==null?t:M[L]}}function ud(M,L,R,G,ne){return ne(M,function(be,Be,xe){R=G?(G=!1,be):L(R,be,Be,xe)}),R}function l2(M,L){var R=M.length;for(M.sort(L);R--;)M[R]=M[R].value;return M}function fu(M,L){for(var R,G=-1,ne=M.length;++G<ne;){var be=L(M[G]);be!==t&&(R=R===t?be:R+be)}return R}function hu(M,L){for(var R=-1,G=Array(M);++R<M;)G[R]=L(R);return G}function u2(M,L){return Ae(L,function(R){return[R,M[R]]})}function cd(M){return M&&M.slice(0,pd(M)+1).replace(Zl,"")}function Ct(M){return function(L){return M(L)}}function du(M,L){return Ae(L,function(R){return M[R]})}function Gi(M,L){return M.has(L)}function fd(M,L){for(var R=-1,G=M.length;++R<G&&ti(L,M[R],0)>-1;);return R}function hd(M,L){for(var R=M.length;R--&&ti(L,M[R],0)>-1;);return R}function c2(M,L){for(var R=M.length,G=0;R--;)M[R]===L&&++G;return G}var f2=cu(Jb),h2=cu(jb);function d2(M){return"\\"+Xb[M]}function p2(M,L){return M==null?t:M[L]}function ni(M){return Ub.test(M)}function m2(M){return qb.test(M)}function g2(M){for(var L,R=[];!(L=M.next()).done;)R.push(L.value);return R}function pu(M){var L=-1,R=Array(M.size);return M.forEach(function(G,ne){R[++L]=[ne,G]}),R}function dd(M,L){return function(R){return M(L(R))}}function Qn(M,L){for(var R=-1,G=M.length,ne=0,be=[];++R<G;){var Be=M[R];(Be===L||Be===p)&&(M[R]=p,be[ne++]=R)}return be}function ro(M){var L=-1,R=Array(M.size);return M.forEach(function(G){R[++L]=G}),R}function y2(M){var L=-1,R=Array(M.size);return M.forEach(function(G){R[++L]=[G,G]}),R}function b2(M,L,R){for(var G=R-1,ne=M.length;++G<ne;)if(M[G]===L)return G;return-1}function _2(M,L,R){for(var G=R+1;G--;)if(M[G]===L)return G;return G}function ri(M){return ni(M)?v2(M):i2(M)}function en(M){return ni(M)?S2(M):s2(M)}function pd(M){for(var L=M.length;L--&&cb.test(M.charAt(L)););return L}var w2=cu(Yb);function v2(M){for(var L=ru.lastIndex=0;ru.test(M);)++L;return L}function S2(M){return M.match(ru)||[]}function x2(M){return M.match(Vb)||[]}var C2=function M(L){L=L==null?Xe:ii.defaults(Xe.Object(),L,ii.pick(Xe,Kb));var R=L.Array,G=L.Date,ne=L.Error,be=L.Function,Be=L.Math,xe=L.Object,mu=L.RegExp,E2=L.String,zt=L.TypeError,io=R.prototype,k2=be.prototype,si=xe.prototype,so=L["__core-js_shared__"],oo=k2.toString,ve=si.hasOwnProperty,A2=0,md=function(){var o=/[^.]+$/.exec(so&&so.keys&&so.keys.IE_PROTO||"");return o?"Symbol(src)_1."+o:""}(),ao=si.toString,T2=oo.call(xe),O2=Xe._,M2=mu("^"+oo.call(ve).replace(Xl,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),lo=Zh?L.Buffer:t,er=L.Symbol,uo=L.Uint8Array,gd=lo?lo.allocUnsafe:t,co=dd(xe.getPrototypeOf,xe),yd=xe.create,bd=si.propertyIsEnumerable,fo=io.splice,_d=er?er.isConcatSpreadable:t,Ji=er?er.iterator:t,Tr=er?er.toStringTag:t,ho=function(){try{var o=Rr(xe,"defineProperty");return o({},"",{}),o}catch{}}(),I2=L.clearTimeout!==Xe.clearTimeout&&L.clearTimeout,N2=G&&G.now!==Xe.Date.now&&G.now,R2=L.setTimeout!==Xe.setTimeout&&L.setTimeout,po=Be.ceil,mo=Be.floor,gu=xe.getOwnPropertySymbols,L2=lo?lo.isBuffer:t,wd=L.isFinite,P2=io.join,D2=dd(xe.keys,xe),ze=Be.max,nt=Be.min,F2=G.now,B2=L.parseInt,vd=Be.random,z2=io.reverse,yu=Rr(L,"DataView"),ji=Rr(L,"Map"),bu=Rr(L,"Promise"),oi=Rr(L,"Set"),Yi=Rr(L,"WeakMap"),Xi=Rr(xe,"create"),go=Yi&&new Yi,ai={},$2=Lr(yu),H2=Lr(ji),W2=Lr(bu),V2=Lr(oi),U2=Lr(Yi),yo=er?er.prototype:t,Zi=yo?yo.valueOf:t,Sd=yo?yo.toString:t;function w(o){if(Ie(o)&&!re(o)&&!(o instanceof fe)){if(o instanceof $t)return o;if(ve.call(o,"__wrapped__"))return xp(o)}return new $t(o)}var li=function(){function o(){}return function(l){if(!Me(l))return{};if(yd)return yd(l);o.prototype=l;var f=new o;return o.prototype=t,f}}();function bo(){}function $t(o,l){this.__wrapped__=o,this.__actions__=[],this.__chain__=!!l,this.__index__=0,this.__values__=t}w.templateSettings={escape:ib,evaluate:sb,interpolate:Ih,variable:"",imports:{_:w}},w.prototype=bo.prototype,w.prototype.constructor=w,$t.prototype=li(bo.prototype),$t.prototype.constructor=$t;function fe(o){this.__wrapped__=o,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=St,this.__views__=[]}function q2(){var o=new fe(this.__wrapped__);return o.__actions__=ht(this.__actions__),o.__dir__=this.__dir__,o.__filtered__=this.__filtered__,o.__iteratees__=ht(this.__iteratees__),o.__takeCount__=this.__takeCount__,o.__views__=ht(this.__views__),o}function K2(){if(this.__filtered__){var o=new fe(this);o.__dir__=-1,o.__filtered__=!0}else o=this.clone(),o.__dir__*=-1;return o}function G2(){var o=this.__wrapped__.value(),l=this.__dir__,f=re(o),d=l<0,b=f?o.length:0,x=sw(0,b,this.__views__),C=x.start,O=x.end,I=O-C,P=d?O:C-1,D=this.__iteratees__,B=D.length,q=0,j=nt(I,this.__takeCount__);if(!f||!d&&b==I&&j==I)return Kd(o,this.__actions__);var X=[];e:for(;I--&&q<j;){P+=l;for(var se=-1,Z=o[P];++se<B;){var ce=D[se],me=ce.iteratee,At=ce.type,ot=me(Z);if(At==xn)Z=ot;else if(!ot){if(At==Dt)continue e;break e}}X[q++]=Z}return X}fe.prototype=li(bo.prototype),fe.prototype.constructor=fe;function Or(o){var l=-1,f=o==null?0:o.length;for(this.clear();++l<f;){var d=o[l];this.set(d[0],d[1])}}function J2(){this.__data__=Xi?Xi(null):{},this.size=0}function j2(o){var l=this.has(o)&&delete this.__data__[o];return this.size-=l?1:0,l}function Y2(o){var l=this.__data__;if(Xi){var f=l[o];return f===c?t:f}return ve.call(l,o)?l[o]:t}function X2(o){var l=this.__data__;return Xi?l[o]!==t:ve.call(l,o)}function Z2(o,l){var f=this.__data__;return this.size+=this.has(o)?0:1,f[o]=Xi&&l===t?c:l,this}Or.prototype.clear=J2,Or.prototype.delete=j2,Or.prototype.get=Y2,Or.prototype.has=X2,Or.prototype.set=Z2;function En(o){var l=-1,f=o==null?0:o.length;for(this.clear();++l<f;){var d=o[l];this.set(d[0],d[1])}}function Q2(){this.__data__=[],this.size=0}function e_(o){var l=this.__data__,f=_o(l,o);if(f<0)return!1;var d=l.length-1;return f==d?l.pop():fo.call(l,f,1),--this.size,!0}function t_(o){var l=this.__data__,f=_o(l,o);return f<0?t:l[f][1]}function n_(o){return _o(this.__data__,o)>-1}function r_(o,l){var f=this.__data__,d=_o(f,o);return d<0?(++this.size,f.push([o,l])):f[d][1]=l,this}En.prototype.clear=Q2,En.prototype.delete=e_,En.prototype.get=t_,En.prototype.has=n_,En.prototype.set=r_;function kn(o){var l=-1,f=o==null?0:o.length;for(this.clear();++l<f;){var d=o[l];this.set(d[0],d[1])}}function i_(){this.size=0,this.__data__={hash:new Or,map:new(ji||En),string:new Or}}function s_(o){var l=Io(this,o).delete(o);return this.size-=l?1:0,l}function o_(o){return Io(this,o).get(o)}function a_(o){return Io(this,o).has(o)}function l_(o,l){var f=Io(this,o),d=f.size;return f.set(o,l),this.size+=f.size==d?0:1,this}kn.prototype.clear=i_,kn.prototype.delete=s_,kn.prototype.get=o_,kn.prototype.has=a_,kn.prototype.set=l_;function Mr(o){var l=-1,f=o==null?0:o.length;for(this.__data__=new kn;++l<f;)this.add(o[l])}function u_(o){return this.__data__.set(o,c),this}function c_(o){return this.__data__.has(o)}Mr.prototype.add=Mr.prototype.push=u_,Mr.prototype.has=c_;function tn(o){var l=this.__data__=new En(o);this.size=l.size}function f_(){this.__data__=new En,this.size=0}function h_(o){var l=this.__data__,f=l.delete(o);return this.size=l.size,f}function d_(o){return this.__data__.get(o)}function p_(o){return this.__data__.has(o)}function m_(o,l){var f=this.__data__;if(f instanceof En){var d=f.__data__;if(!ji||d.length<i-1)return d.push([o,l]),this.size=++f.size,this;f=this.__data__=new kn(d)}return f.set(o,l),this.size=f.size,this}tn.prototype.clear=f_,tn.prototype.delete=h_,tn.prototype.get=d_,tn.prototype.has=p_,tn.prototype.set=m_;function xd(o,l){var f=re(o),d=!f&&Pr(o),b=!f&&!d&&sr(o),x=!f&&!d&&!b&&hi(o),C=f||d||b||x,O=C?hu(o.length,E2):[],I=O.length;for(var P in o)(l||ve.call(o,P))&&!(C&&(P=="length"||b&&(P=="offset"||P=="parent")||x&&(P=="buffer"||P=="byteLength"||P=="byteOffset")||Mn(P,I)))&&O.push(P);return O}function Cd(o){var l=o.length;return l?o[Ou(0,l-1)]:t}function g_(o,l){return No(ht(o),Ir(l,0,o.length))}function y_(o){return No(ht(o))}function _u(o,l,f){(f!==t&&!nn(o[l],f)||f===t&&!(l in o))&&An(o,l,f)}function Qi(o,l,f){var d=o[l];(!(ve.call(o,l)&&nn(d,f))||f===t&&!(l in o))&&An(o,l,f)}function _o(o,l){for(var f=o.length;f--;)if(nn(o[f][0],l))return f;return-1}function b_(o,l,f,d){return tr(o,function(b,x,C){l(d,b,f(b),C)}),d}function Ed(o,l){return o&&hn(l,Ve(l),o)}function __(o,l){return o&&hn(l,pt(l),o)}function An(o,l,f){l=="__proto__"&&ho?ho(o,l,{configurable:!0,enumerable:!0,value:f,writable:!0}):o[l]=f}function wu(o,l){for(var f=-1,d=l.length,b=R(d),x=o==null;++f<d;)b[f]=x?t:ec(o,l[f]);return b}function Ir(o,l,f){return o===o&&(f!==t&&(o=o<=f?o:f),l!==t&&(o=o>=l?o:l)),o}function Ht(o,l,f,d,b,x){var C,O=l&m,I=l&y,P=l&_;if(f&&(C=b?f(o,d,b,x):f(o)),C!==t)return C;if(!Me(o))return o;var D=re(o);if(D){if(C=aw(o),!O)return ht(o,C)}else{var B=rt(o),q=B==Ys||B==Ah;if(sr(o))return jd(o,O);if(B==Cn||B==Xt||q&&!b){if(C=I||q?{}:pp(o),!O)return I?Y_(o,__(C,o)):j_(o,Ed(C,o))}else{if(!Ce[B])return b?o:{};C=lw(o,B,O)}}x||(x=new tn);var j=x.get(o);if(j)return j;x.set(o,C),Vp(o)?o.forEach(function(Z){C.add(Ht(Z,l,f,Z,o,x))}):Hp(o)&&o.forEach(function(Z,ce){C.set(ce,Ht(Z,l,f,ce,o,x))});var X=P?I?$u:zu:I?pt:Ve,se=D?t:X(o);return Bt(se||o,function(Z,ce){se&&(ce=Z,Z=o[ce]),Qi(C,ce,Ht(Z,l,f,ce,o,x))}),C}function w_(o){var l=Ve(o);return function(f){return kd(f,o,l)}}function kd(o,l,f){var d=f.length;if(o==null)return!d;for(o=xe(o);d--;){var b=f[d],x=l[b],C=o[b];if(C===t&&!(b in o)||!x(C))return!1}return!0}function Ad(o,l,f){if(typeof o!="function")throw new zt(a);return as(function(){o.apply(t,f)},l)}function es(o,l,f,d){var b=-1,x=to,C=!0,O=o.length,I=[],P=l.length;if(!O)return I;f&&(l=Ae(l,Ct(f))),d?(x=ou,C=!1):l.length>=i&&(x=Gi,C=!1,l=new Mr(l));e:for(;++b<O;){var D=o[b],B=f==null?D:f(D);if(D=d||D!==0?D:0,C&&B===B){for(var q=P;q--;)if(l[q]===B)continue e;I.push(D)}else x(l,B,d)||I.push(D)}return I}var tr=ep(fn),Td=ep(Su,!0);function v_(o,l){var f=!0;return tr(o,function(d,b,x){return f=!!l(d,b,x),f}),f}function wo(o,l,f){for(var d=-1,b=o.length;++d<b;){var x=o[d],C=l(x);if(C!=null&&(O===t?C===C&&!kt(C):f(C,O)))var O=C,I=x}return I}function S_(o,l,f,d){var b=o.length;for(f=ie(f),f<0&&(f=-f>b?0:b+f),d=d===t||d>b?b:ie(d),d<0&&(d+=b),d=f>d?0:qp(d);f<d;)o[f++]=l;return o}function Od(o,l){var f=[];return tr(o,function(d,b,x){l(d,b,x)&&f.push(d)}),f}function Ze(o,l,f,d,b){var x=-1,C=o.length;for(f||(f=cw),b||(b=[]);++x<C;){var O=o[x];l>0&&f(O)?l>1?Ze(O,l-1,f,d,b):Zn(b,O):d||(b[b.length]=O)}return b}var vu=tp(),Md=tp(!0);function fn(o,l){return o&&vu(o,l,Ve)}function Su(o,l){return o&&Md(o,l,Ve)}function vo(o,l){return Xn(l,function(f){return In(o[f])})}function Nr(o,l){l=rr(l,o);for(var f=0,d=l.length;o!=null&&f<d;)o=o[dn(l[f++])];return f&&f==d?o:t}function Id(o,l,f){var d=l(o);return re(o)?d:Zn(d,f(o))}function it(o){return o==null?o===t?Xy:jy:Tr&&Tr in xe(o)?iw(o):yw(o)}function xu(o,l){return o>l}function x_(o,l){return o!=null&&ve.call(o,l)}function C_(o,l){return o!=null&&l in xe(o)}function E_(o,l,f){return o>=nt(l,f)&&o<ze(l,f)}function Cu(o,l,f){for(var d=f?ou:to,b=o[0].length,x=o.length,C=x,O=R(x),I=1/0,P=[];C--;){var D=o[C];C&&l&&(D=Ae(D,Ct(l))),I=nt(D.length,I),O[C]=!f&&(l||b>=120&&D.length>=120)?new Mr(C&&D):t}D=o[0];var B=-1,q=O[0];e:for(;++B<b&&P.length<I;){var j=D[B],X=l?l(j):j;if(j=f||j!==0?j:0,!(q?Gi(q,X):d(P,X,f))){for(C=x;--C;){var se=O[C];if(!(se?Gi(se,X):d(o[C],X,f)))continue e}q&&q.push(X),P.push(j)}}return P}function k_(o,l,f,d){return fn(o,function(b,x,C){l(d,f(b),x,C)}),d}function ts(o,l,f){l=rr(l,o),o=bp(o,l);var d=o==null?o:o[dn(Vt(l))];return d==null?t:xt(d,o,f)}function Nd(o){return Ie(o)&&it(o)==Xt}function A_(o){return Ie(o)&&it(o)==Ki}function T_(o){return Ie(o)&&it(o)==Hi}function ns(o,l,f,d,b){return o===l?!0:o==null||l==null||!Ie(o)&&!Ie(l)?o!==o&&l!==l:O_(o,l,f,d,ns,b)}function O_(o,l,f,d,b,x){var C=re(o),O=re(l),I=C?Js:rt(o),P=O?Js:rt(l);I=I==Xt?Cn:I,P=P==Xt?Cn:P;var D=I==Cn,B=P==Cn,q=I==P;if(q&&sr(o)){if(!sr(l))return!1;C=!0,D=!1}if(q&&!D)return x||(x=new tn),C||hi(o)?fp(o,l,f,d,b,x):nw(o,l,I,f,d,b,x);if(!(f&S)){var j=D&&ve.call(o,"__wrapped__"),X=B&&ve.call(l,"__wrapped__");if(j||X){var se=j?o.value():o,Z=X?l.value():l;return x||(x=new tn),b(se,Z,f,d,x)}}return q?(x||(x=new tn),rw(o,l,f,d,b,x)):!1}function M_(o){return Ie(o)&&rt(o)==Zt}function Eu(o,l,f,d){var b=f.length,x=b,C=!d;if(o==null)return!x;for(o=xe(o);b--;){var O=f[b];if(C&&O[2]?O[1]!==o[O[0]]:!(O[0]in o))return!1}for(;++b<x;){O=f[b];var I=O[0],P=o[I],D=O[1];if(C&&O[2]){if(P===t&&!(I in o))return!1}else{var B=new tn;if(d)var q=d(P,D,I,o,l,B);if(!(q===t?ns(D,P,S|E,d,B):q))return!1}}return!0}function Rd(o){if(!Me(o)||hw(o))return!1;var l=In(o)?M2:wb;return l.test(Lr(o))}function I_(o){return Ie(o)&&it(o)==Vi}function N_(o){return Ie(o)&&rt(o)==Qt}function R_(o){return Ie(o)&&Bo(o.length)&&!!Ee[it(o)]}function Ld(o){return typeof o=="function"?o:o==null?mt:typeof o=="object"?re(o)?Fd(o[0],o[1]):Dd(o):nm(o)}function ku(o){if(!ss(o))return D2(o);var l=[];for(var f in xe(o))ve.call(o,f)&&f!="constructor"&&l.push(f);return l}function L_(o){if(!Me(o))return gw(o);var l=ss(o),f=[];for(var d in o)d=="constructor"&&(l||!ve.call(o,d))||f.push(d);return f}function Au(o,l){return o<l}function Pd(o,l){var f=-1,d=dt(o)?R(o.length):[];return tr(o,function(b,x,C){d[++f]=l(b,x,C)}),d}function Dd(o){var l=Wu(o);return l.length==1&&l[0][2]?gp(l[0][0],l[0][1]):function(f){return f===o||Eu(f,o,l)}}function Fd(o,l){return Uu(o)&&mp(l)?gp(dn(o),l):function(f){var d=ec(f,o);return d===t&&d===l?tc(f,o):ns(l,d,S|E)}}function So(o,l,f,d,b){o!==l&&vu(l,function(x,C){if(b||(b=new tn),Me(x))P_(o,l,C,f,So,d,b);else{var O=d?d(Ku(o,C),x,C+"",o,l,b):t;O===t&&(O=x),_u(o,C,O)}},pt)}function P_(o,l,f,d,b,x,C){var O=Ku(o,f),I=Ku(l,f),P=C.get(I);if(P){_u(o,f,P);return}var D=x?x(O,I,f+"",o,l,C):t,B=D===t;if(B){var q=re(I),j=!q&&sr(I),X=!q&&!j&&hi(I);D=I,q||j||X?re(O)?D=O:Le(O)?D=ht(O):j?(B=!1,D=jd(I,!0)):X?(B=!1,D=Yd(I,!0)):D=[]:ls(I)||Pr(I)?(D=O,Pr(O)?D=Kp(O):(!Me(O)||In(O))&&(D=pp(I))):B=!1}B&&(C.set(I,D),b(D,I,d,x,C),C.delete(I)),_u(o,f,D)}function Bd(o,l){var f=o.length;if(f)return l+=l<0?f:0,Mn(l,f)?o[l]:t}function zd(o,l,f){l.length?l=Ae(l,function(x){return re(x)?function(C){return Nr(C,x.length===1?x[0]:x)}:x}):l=[mt];var d=-1;l=Ae(l,Ct(Y()));var b=Pd(o,function(x,C,O){var I=Ae(l,function(P){return P(x)});return{criteria:I,index:++d,value:x}});return l2(b,function(x,C){return J_(x,C,f)})}function D_(o,l){return $d(o,l,function(f,d){return tc(o,d)})}function $d(o,l,f){for(var d=-1,b=l.length,x={};++d<b;){var C=l[d],O=Nr(o,C);f(O,C)&&rs(x,rr(C,o),O)}return x}function F_(o){return function(l){return Nr(l,o)}}function Tu(o,l,f,d){var b=d?a2:ti,x=-1,C=l.length,O=o;for(o===l&&(l=ht(l)),f&&(O=Ae(o,Ct(f)));++x<C;)for(var I=0,P=l[x],D=f?f(P):P;(I=b(O,D,I,d))>-1;)O!==o&&fo.call(O,I,1),fo.call(o,I,1);return o}function Hd(o,l){for(var f=o?l.length:0,d=f-1;f--;){var b=l[f];if(f==d||b!==x){var x=b;Mn(b)?fo.call(o,b,1):Nu(o,b)}}return o}function Ou(o,l){return o+mo(vd()*(l-o+1))}function B_(o,l,f,d){for(var b=-1,x=ze(po((l-o)/(f||1)),0),C=R(x);x--;)C[d?x:++b]=o,o+=f;return C}function Mu(o,l){var f="";if(!o||l<1||l>Yn)return f;do l%2&&(f+=o),l=mo(l/2),l&&(o+=o);while(l);return f}function ue(o,l){return Gu(yp(o,l,mt),o+"")}function z_(o){return Cd(di(o))}function $_(o,l){var f=di(o);return No(f,Ir(l,0,f.length))}function rs(o,l,f,d){if(!Me(o))return o;l=rr(l,o);for(var b=-1,x=l.length,C=x-1,O=o;O!=null&&++b<x;){var I=dn(l[b]),P=f;if(I==="__proto__"||I==="constructor"||I==="prototype")return o;if(b!=C){var D=O[I];P=d?d(D,I,O):t,P===t&&(P=Me(D)?D:Mn(l[b+1])?[]:{})}Qi(O,I,P),O=O[I]}return o}var Wd=go?function(o,l){return go.set(o,l),o}:mt,H_=ho?function(o,l){return ho(o,"toString",{configurable:!0,enumerable:!1,value:rc(l),writable:!0})}:mt;function W_(o){return No(di(o))}function Wt(o,l,f){var d=-1,b=o.length;l<0&&(l=-l>b?0:b+l),f=f>b?b:f,f<0&&(f+=b),b=l>f?0:f-l>>>0,l>>>=0;for(var x=R(b);++d<b;)x[d]=o[d+l];return x}function V_(o,l){var f;return tr(o,function(d,b,x){return f=l(d,b,x),!f}),!!f}function xo(o,l,f){var d=0,b=o==null?d:o.length;if(typeof l=="number"&&l===l&&b<=$l){for(;d<b;){var x=d+b>>>1,C=o[x];C!==null&&!kt(C)&&(f?C<=l:C<l)?d=x+1:b=x}return b}return Iu(o,l,mt,f)}function Iu(o,l,f,d){var b=0,x=o==null?0:o.length;if(x===0)return 0;l=f(l);for(var C=l!==l,O=l===null,I=kt(l),P=l===t;b<x;){var D=mo((b+x)/2),B=f(o[D]),q=B!==t,j=B===null,X=B===B,se=kt(B);if(C)var Z=d||X;else P?Z=X&&(d||q):O?Z=X&&q&&(d||!j):I?Z=X&&q&&!j&&(d||!se):j||se?Z=!1:Z=d?B<=l:B<l;Z?b=D+1:x=D}return nt(x,zl)}function Vd(o,l){for(var f=-1,d=o.length,b=0,x=[];++f<d;){var C=o[f],O=l?l(C):C;if(!f||!nn(O,I)){var I=O;x[b++]=C===0?0:C}}return x}function Ud(o){return typeof o=="number"?o:kt(o)?cn:+o}function Et(o){if(typeof o=="string")return o;if(re(o))return Ae(o,Et)+"";if(kt(o))return Sd?Sd.call(o):"";var l=o+"";return l=="0"&&1/o==-1/0?"-0":l}function nr(o,l,f){var d=-1,b=to,x=o.length,C=!0,O=[],I=O;if(f)C=!1,b=ou;else if(x>=i){var P=l?null:ew(o);if(P)return ro(P);C=!1,b=Gi,I=new Mr}else I=l?[]:O;e:for(;++d<x;){var D=o[d],B=l?l(D):D;if(D=f||D!==0?D:0,C&&B===B){for(var q=I.length;q--;)if(I[q]===B)continue e;l&&I.push(B),O.push(D)}else b(I,B,f)||(I!==O&&I.push(B),O.push(D))}return O}function Nu(o,l){return l=rr(l,o),o=bp(o,l),o==null||delete o[dn(Vt(l))]}function qd(o,l,f,d){return rs(o,l,f(Nr(o,l)),d)}function Co(o,l,f,d){for(var b=o.length,x=d?b:-1;(d?x--:++x<b)&&l(o[x],x,o););return f?Wt(o,d?0:x,d?x+1:b):Wt(o,d?x+1:0,d?b:x)}function Kd(o,l){var f=o;return f instanceof fe&&(f=f.value()),au(l,function(d,b){return b.func.apply(b.thisArg,Zn([d],b.args))},f)}function Ru(o,l,f){var d=o.length;if(d<2)return d?nr(o[0]):[];for(var b=-1,x=R(d);++b<d;)for(var C=o[b],O=-1;++O<d;)O!=b&&(x[b]=es(x[b]||C,o[O],l,f));return nr(Ze(x,1),l,f)}function Gd(o,l,f){for(var d=-1,b=o.length,x=l.length,C={};++d<b;){var O=d<x?l[d]:t;f(C,o[d],O)}return C}function Lu(o){return Le(o)?o:[]}function Pu(o){return typeof o=="function"?o:mt}function rr(o,l){return re(o)?o:Uu(o,l)?[o]:Sp(_e(o))}var U_=ue;function ir(o,l,f){var d=o.length;return f=f===t?d:f,!l&&f>=d?o:Wt(o,l,f)}var Jd=I2||function(o){return Xe.clearTimeout(o)};function jd(o,l){if(l)return o.slice();var f=o.length,d=gd?gd(f):new o.constructor(f);return o.copy(d),d}function Du(o){var l=new o.constructor(o.byteLength);return new uo(l).set(new uo(o)),l}function q_(o,l){var f=l?Du(o.buffer):o.buffer;return new o.constructor(f,o.byteOffset,o.byteLength)}function K_(o){var l=new o.constructor(o.source,Nh.exec(o));return l.lastIndex=o.lastIndex,l}function G_(o){return Zi?xe(Zi.call(o)):{}}function Yd(o,l){var f=l?Du(o.buffer):o.buffer;return new o.constructor(f,o.byteOffset,o.length)}function Xd(o,l){if(o!==l){var f=o!==t,d=o===null,b=o===o,x=kt(o),C=l!==t,O=l===null,I=l===l,P=kt(l);if(!O&&!P&&!x&&o>l||x&&C&&I&&!O&&!P||d&&C&&I||!f&&I||!b)return 1;if(!d&&!x&&!P&&o<l||P&&f&&b&&!d&&!x||O&&f&&b||!C&&b||!I)return-1}return 0}function J_(o,l,f){for(var d=-1,b=o.criteria,x=l.criteria,C=b.length,O=f.length;++d<C;){var I=Xd(b[d],x[d]);if(I){if(d>=O)return I;var P=f[d];return I*(P=="desc"?-1:1)}}return o.index-l.index}function Zd(o,l,f,d){for(var b=-1,x=o.length,C=f.length,O=-1,I=l.length,P=ze(x-C,0),D=R(I+P),B=!d;++O<I;)D[O]=l[O];for(;++b<C;)(B||b<x)&&(D[f[b]]=o[b]);for(;P--;)D[O++]=o[b++];return D}function Qd(o,l,f,d){for(var b=-1,x=o.length,C=-1,O=f.length,I=-1,P=l.length,D=ze(x-O,0),B=R(D+P),q=!d;++b<D;)B[b]=o[b];for(var j=b;++I<P;)B[j+I]=l[I];for(;++C<O;)(q||b<x)&&(B[j+f[C]]=o[b++]);return B}function ht(o,l){var f=-1,d=o.length;for(l||(l=R(d));++f<d;)l[f]=o[f];return l}function hn(o,l,f,d){var b=!f;f||(f={});for(var x=-1,C=l.length;++x<C;){var O=l[x],I=d?d(f[O],o[O],O,f,o):t;I===t&&(I=o[O]),b?An(f,O,I):Qi(f,O,I)}return f}function j_(o,l){return hn(o,Vu(o),l)}function Y_(o,l){return hn(o,hp(o),l)}function Eo(o,l){return function(f,d){var b=re(f)?t2:b_,x=l?l():{};return b(f,o,Y(d,2),x)}}function ui(o){return ue(function(l,f){var d=-1,b=f.length,x=b>1?f[b-1]:t,C=b>2?f[2]:t;for(x=o.length>3&&typeof x=="function"?(b--,x):t,C&&st(f[0],f[1],C)&&(x=b<3?t:x,b=1),l=xe(l);++d<b;){var O=f[d];O&&o(l,O,d,x)}return l})}function ep(o,l){return function(f,d){if(f==null)return f;if(!dt(f))return o(f,d);for(var b=f.length,x=l?b:-1,C=xe(f);(l?x--:++x<b)&&d(C[x],x,C)!==!1;);return f}}function tp(o){return function(l,f,d){for(var b=-1,x=xe(l),C=d(l),O=C.length;O--;){var I=C[o?O:++b];if(f(x[I],I,x)===!1)break}return l}}function X_(o,l,f){var d=l&N,b=is(o);function x(){var C=this&&this!==Xe&&this instanceof x?b:o;return C.apply(d?f:this,arguments)}return x}function np(o){return function(l){l=_e(l);var f=ni(l)?en(l):t,d=f?f[0]:l.charAt(0),b=f?ir(f,1).join(""):l.slice(1);return d[o]()+b}}function ci(o){return function(l){return au(em(Qp(l).replace(Hb,"")),o,"")}}function is(o){return function(){var l=arguments;switch(l.length){case 0:return new o;case 1:return new o(l[0]);case 2:return new o(l[0],l[1]);case 3:return new o(l[0],l[1],l[2]);case 4:return new o(l[0],l[1],l[2],l[3]);case 5:return new o(l[0],l[1],l[2],l[3],l[4]);case 6:return new o(l[0],l[1],l[2],l[3],l[4],l[5]);case 7:return new o(l[0],l[1],l[2],l[3],l[4],l[5],l[6])}var f=li(o.prototype),d=o.apply(f,l);return Me(d)?d:f}}function Z_(o,l,f){var d=is(o);function b(){for(var x=arguments.length,C=R(x),O=x,I=fi(b);O--;)C[O]=arguments[O];var P=x<3&&C[0]!==I&&C[x-1]!==I?[]:Qn(C,I);if(x-=P.length,x<f)return ap(o,l,ko,b.placeholder,t,C,P,t,t,f-x);var D=this&&this!==Xe&&this instanceof b?d:o;return xt(D,this,C)}return b}function rp(o){return function(l,f,d){var b=xe(l);if(!dt(l)){var x=Y(f,3);l=Ve(l),f=function(O){return x(b[O],O,b)}}var C=o(l,f,d);return C>-1?b[x?l[C]:C]:t}}function ip(o){return On(function(l){var f=l.length,d=f,b=$t.prototype.thru;for(o&&l.reverse();d--;){var x=l[d];if(typeof x!="function")throw new zt(a);if(b&&!C&&Mo(x)=="wrapper")var C=new $t([],!0)}for(d=C?d:f;++d<f;){x=l[d];var O=Mo(x),I=O=="wrapper"?Hu(x):t;I&&qu(I[0])&&I[1]==(U|k|T|H)&&!I[4].length&&I[9]==1?C=C[Mo(I[0])].apply(C,I[3]):C=x.length==1&&qu(x)?C[O]():C.thru(x)}return function(){var P=arguments,D=P[0];if(C&&P.length==1&&re(D))return C.plant(D).value();for(var B=0,q=f?l[B].apply(this,P):D;++B<f;)q=l[B].call(this,q);return q}})}function ko(o,l,f,d,b,x,C,O,I,P){var D=l&U,B=l&N,q=l&g,j=l&(k|A),X=l&ee,se=q?t:is(o);function Z(){for(var ce=arguments.length,me=R(ce),At=ce;At--;)me[At]=arguments[At];if(j)var ot=fi(Z),Tt=c2(me,ot);if(d&&(me=Zd(me,d,b,j)),x&&(me=Qd(me,x,C,j)),ce-=Tt,j&&ce<P){var Pe=Qn(me,ot);return ap(o,l,ko,Z.placeholder,f,me,Pe,O,I,P-ce)}var rn=B?f:this,Rn=q?rn[o]:o;return ce=me.length,O?me=bw(me,O):X&&ce>1&&me.reverse(),D&&I<ce&&(me.length=I),this&&this!==Xe&&this instanceof Z&&(Rn=se||is(Rn)),Rn.apply(rn,me)}return Z}function sp(o,l){return function(f,d){return k_(f,o,l(d),{})}}function Ao(o,l){return function(f,d){var b;if(f===t&&d===t)return l;if(f!==t&&(b=f),d!==t){if(b===t)return d;typeof f=="string"||typeof d=="string"?(f=Et(f),d=Et(d)):(f=Ud(f),d=Ud(d)),b=o(f,d)}return b}}function Fu(o){return On(function(l){return l=Ae(l,Ct(Y())),ue(function(f){var d=this;return o(l,function(b){return xt(b,d,f)})})})}function To(o,l){l=l===t?" ":Et(l);var f=l.length;if(f<2)return f?Mu(l,o):l;var d=Mu(l,po(o/ri(l)));return ni(l)?ir(en(d),0,o).join(""):d.slice(0,o)}function Q_(o,l,f,d){var b=l&N,x=is(o);function C(){for(var O=-1,I=arguments.length,P=-1,D=d.length,B=R(D+I),q=this&&this!==Xe&&this instanceof C?x:o;++P<D;)B[P]=d[P];for(;I--;)B[P++]=arguments[++O];return xt(q,b?f:this,B)}return C}function op(o){return function(l,f,d){return d&&typeof d!="number"&&st(l,f,d)&&(f=d=t),l=Nn(l),f===t?(f=l,l=0):f=Nn(f),d=d===t?l<f?1:-1:Nn(d),B_(l,f,d,o)}}function Oo(o){return function(l,f){return typeof l=="string"&&typeof f=="string"||(l=Ut(l),f=Ut(f)),o(l,f)}}function ap(o,l,f,d,b,x,C,O,I,P){var D=l&k,B=D?C:t,q=D?t:C,j=D?x:t,X=D?t:x;l|=D?T:F,l&=~(D?F:T),l&v||(l&=-4);var se=[o,l,b,j,B,X,q,O,I,P],Z=f.apply(t,se);return qu(o)&&_p(Z,se),Z.placeholder=d,wp(Z,o,l)}function Bu(o){var l=Be[o];return function(f,d){if(f=Ut(f),d=d==null?0:nt(ie(d),292),d&&wd(f)){var b=(_e(f)+"e").split("e"),x=l(b[0]+"e"+(+b[1]+d));return b=(_e(x)+"e").split("e"),+(b[0]+"e"+(+b[1]-d))}return l(f)}}var ew=oi&&1/ro(new oi([,-0]))[1]==vt?function(o){return new oi(o)}:oc;function lp(o){return function(l){var f=rt(l);return f==Zt?pu(l):f==Qt?y2(l):u2(l,o(l))}}function Tn(o,l,f,d,b,x,C,O){var I=l&g;if(!I&&typeof o!="function")throw new zt(a);var P=d?d.length:0;if(P||(l&=-97,d=b=t),C=C===t?C:ze(ie(C),0),O=O===t?O:ie(O),P-=b?b.length:0,l&F){var D=d,B=b;d=b=t}var q=I?t:Hu(o),j=[o,l,f,d,b,D,B,x,C,O];if(q&&mw(j,q),o=j[0],l=j[1],f=j[2],d=j[3],b=j[4],O=j[9]=j[9]===t?I?0:o.length:ze(j[9]-P,0),!O&&l&(k|A)&&(l&=-25),!l||l==N)var X=X_(o,l,f);else l==k||l==A?X=Z_(o,l,O):(l==T||l==(N|T))&&!b.length?X=Q_(o,l,f,d):X=ko.apply(t,j);var se=q?Wd:_p;return wp(se(X,j),o,l)}function up(o,l,f,d){return o===t||nn(o,si[f])&&!ve.call(d,f)?l:o}function cp(o,l,f,d,b,x){return Me(o)&&Me(l)&&(x.set(l,o),So(o,l,t,cp,x),x.delete(l)),o}function tw(o){return ls(o)?t:o}function fp(o,l,f,d,b,x){var C=f&S,O=o.length,I=l.length;if(O!=I&&!(C&&I>O))return!1;var P=x.get(o),D=x.get(l);if(P&&D)return P==l&&D==o;var B=-1,q=!0,j=f&E?new Mr:t;for(x.set(o,l),x.set(l,o);++B<O;){var X=o[B],se=l[B];if(d)var Z=C?d(se,X,B,l,o,x):d(X,se,B,o,l,x);if(Z!==t){if(Z)continue;q=!1;break}if(j){if(!lu(l,function(ce,me){if(!Gi(j,me)&&(X===ce||b(X,ce,f,d,x)))return j.push(me)})){q=!1;break}}else if(!(X===se||b(X,se,f,d,x))){q=!1;break}}return x.delete(o),x.delete(l),q}function nw(o,l,f,d,b,x,C){switch(f){case Qr:if(o.byteLength!=l.byteLength||o.byteOffset!=l.byteOffset)return!1;o=o.buffer,l=l.buffer;case Ki:return!(o.byteLength!=l.byteLength||!x(new uo(o),new uo(l)));case $i:case Hi:case Wi:return nn(+o,+l);case js:return o.name==l.name&&o.message==l.message;case Vi:case Ui:return o==l+"";case Zt:var O=pu;case Qt:var I=d&S;if(O||(O=ro),o.size!=l.size&&!I)return!1;var P=C.get(o);if(P)return P==l;d|=E,C.set(o,l);var D=fp(O(o),O(l),d,b,x,C);return C.delete(o),D;case Xs:if(Zi)return Zi.call(o)==Zi.call(l)}return!1}function rw(o,l,f,d,b,x){var C=f&S,O=zu(o),I=O.length,P=zu(l),D=P.length;if(I!=D&&!C)return!1;for(var B=I;B--;){var q=O[B];if(!(C?q in l:ve.call(l,q)))return!1}var j=x.get(o),X=x.get(l);if(j&&X)return j==l&&X==o;var se=!0;x.set(o,l),x.set(l,o);for(var Z=C;++B<I;){q=O[B];var ce=o[q],me=l[q];if(d)var At=C?d(me,ce,q,l,o,x):d(ce,me,q,o,l,x);if(!(At===t?ce===me||b(ce,me,f,d,x):At)){se=!1;break}Z||(Z=q=="constructor")}if(se&&!Z){var ot=o.constructor,Tt=l.constructor;ot!=Tt&&"constructor"in o&&"constructor"in l&&!(typeof ot=="function"&&ot instanceof ot&&typeof Tt=="function"&&Tt instanceof Tt)&&(se=!1)}return x.delete(o),x.delete(l),se}function On(o){return Gu(yp(o,t,kp),o+"")}function zu(o){return Id(o,Ve,Vu)}function $u(o){return Id(o,pt,hp)}var Hu=go?function(o){return go.get(o)}:oc;function Mo(o){for(var l=o.name+"",f=ai[l],d=ve.call(ai,l)?f.length:0;d--;){var b=f[d],x=b.func;if(x==null||x==o)return b.name}return l}function fi(o){var l=ve.call(w,"placeholder")?w:o;return l.placeholder}function Y(){var o=w.iteratee||ic;return o=o===ic?Ld:o,arguments.length?o(arguments[0],arguments[1]):o}function Io(o,l){var f=o.__data__;return fw(l)?f[typeof l=="string"?"string":"hash"]:f.map}function Wu(o){for(var l=Ve(o),f=l.length;f--;){var d=l[f],b=o[d];l[f]=[d,b,mp(b)]}return l}function Rr(o,l){var f=p2(o,l);return Rd(f)?f:t}function iw(o){var l=ve.call(o,Tr),f=o[Tr];try{o[Tr]=t;var d=!0}catch{}var b=ao.call(o);return d&&(l?o[Tr]=f:delete o[Tr]),b}var Vu=gu?function(o){return o==null?[]:(o=xe(o),Xn(gu(o),function(l){return bd.call(o,l)}))}:ac,hp=gu?function(o){for(var l=[];o;)Zn(l,Vu(o)),o=co(o);return l}:ac,rt=it;(yu&&rt(new yu(new ArrayBuffer(1)))!=Qr||ji&&rt(new ji)!=Zt||bu&&rt(bu.resolve())!=Th||oi&&rt(new oi)!=Qt||Yi&&rt(new Yi)!=qi)&&(rt=function(o){var l=it(o),f=l==Cn?o.constructor:t,d=f?Lr(f):"";if(d)switch(d){case $2:return Qr;case H2:return Zt;case W2:return Th;case V2:return Qt;case U2:return qi}return l});function sw(o,l,f){for(var d=-1,b=f.length;++d<b;){var x=f[d],C=x.size;switch(x.type){case"drop":o+=C;break;case"dropRight":l-=C;break;case"take":l=nt(l,o+C);break;case"takeRight":o=ze(o,l-C);break}}return{start:o,end:l}}function ow(o){var l=o.match(hb);return l?l[1].split(db):[]}function dp(o,l,f){l=rr(l,o);for(var d=-1,b=l.length,x=!1;++d<b;){var C=dn(l[d]);if(!(x=o!=null&&f(o,C)))break;o=o[C]}return x||++d!=b?x:(b=o==null?0:o.length,!!b&&Bo(b)&&Mn(C,b)&&(re(o)||Pr(o)))}function aw(o){var l=o.length,f=new o.constructor(l);return l&&typeof o[0]=="string"&&ve.call(o,"index")&&(f.index=o.index,f.input=o.input),f}function pp(o){return typeof o.constructor=="function"&&!ss(o)?li(co(o)):{}}function lw(o,l,f){var d=o.constructor;switch(l){case Ki:return Du(o);case $i:case Hi:return new d(+o);case Qr:return q_(o,f);case Wl:case Vl:case Ul:case ql:case Kl:case Gl:case Jl:case jl:case Yl:return Yd(o,f);case Zt:return new d;case Wi:case Ui:return new d(o);case Vi:return K_(o);case Qt:return new d;case Xs:return G_(o)}}function uw(o,l){var f=l.length;if(!f)return o;var d=f-1;return l[d]=(f>1?"& ":"")+l[d],l=l.join(f>2?", ":" "),o.replace(fb,`{
|
|
45
|
+
3. "-" cannot repeat`);ke.customSchemes.push([n,e])}function ZM(){ke.scanner=UM(ke.customSchemes);for(let n=0;n<ke.tokenQueue.length;n++)ke.tokenQueue[n][1]({scanner:ke.scanner});ke.parser=GM(ke.scanner.tokens);for(let n=0;n<ke.pluginQueue.length;n++)ke.pluginQueue[n][1]({scanner:ke.scanner,parser:ke.parser});return ke.initialized=!0,ke}function Fl(n){return ke.initialized||ZM(),JM(ke.parser.start,n,ay(ke.scanner.start,n))}Fl.scan=ay;function py(n,e=null,t=null){if(e&&typeof e=="object"){if(t)throw Error(`linkifyjs: Invalid link type ${e}; must be a string`);t=e,e=null}const r=new Eh(t),i=Fl(n),s=[];for(let a=0;a<i.length;a++){const u=i[a];u.isLink&&(!e||u.t===e)&&r.check(u)&&s.push(u.toFormattedObject(r))}return s}function QM(n,e=null){const t=Fl(n);return t.length===1&&t[0].isLink&&(!e||t[0].t===e)}class eI extends rh{addProps(){return{handlePaste:this._handlePaste}}_handlePaste(e,t,r){if(e.state.selection.empty)return!1;const i=r.content.textBetween(0,r.content.size).trim(),s=QM(i);if(!i||!s)return!1;const a=this._createLinkAttrs(i,r.content);return this.editor.commands.applyLink(a),!0}_createLinkAttrs(e,t){return ld.query(t,{typeName:oe.TEXT,mark:{typeName:Oe.LINK},getMark:{typeName:Oe.LINK}})?.attrs||{href:e}}}function H(n){return(...e)=>t=>n(t,...e)}function Bl(n){const e=Object.entries(n).reduce((t,[r,i])=>{if(!i)return t;const s=r.replace(/_/g,"-");return`${t}--zw-${s}:${i};`},"");return e?{style:e}:null}function ei(n){const e=Bl(n);return["span",e?{...e,class:"zw-style"}:{},0]}function tI(n){return n.toLowerCase().replace(/(?:^|\s)\S/g,e=>e.toUpperCase())}function Xt(n,...e){return({editor:t})=>(t.commands[n](...e),!0)}const kh=process.env.NODE_ENV!=="production"?Object.freeze({}):{};process.env.NODE_ENV!=="production"&&Object.freeze([]);const my=()=>{},nI=n=>n.charCodeAt(0)===111&&n.charCodeAt(1)===110&&(n.charCodeAt(2)>122||n.charCodeAt(2)<97),zl=Object.assign,wn=Array.isArray,ti=n=>typeof n=="function",Tr=n=>typeof n=="string",rI=n=>typeof n=="symbol",ni=n=>n!==null&&typeof n=="object";let gy;const Hl=()=>gy||(gy=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Th(n){if(wn(n)){const e={};for(let t=0;t<n.length;t++){const r=n[t],i=Tr(r)?aI(r):Th(r);if(i)for(const s in i)e[s]=i[s]}return e}else if(Tr(n)||ni(n))return n}const iI=/;(?![^(]*\))/g,sI=/:([^]+)/,oI=/\/\*[^]*?\*\//g;function aI(n){const e={};return n.replace(oI,"").split(iI).forEach(t=>{if(t){const r=t.split(sI);r.length>1&&(e[r[0].trim()]=r[1].trim())}}),e}function Ah(n){let e="";if(Tr(n))e=n;else if(wn(n))for(let t=0;t<n.length;t++){const r=Ah(n[t]);r&&(e+=r+" ")}else if(ni(n))for(const t in n)n[t]&&(e+=t+" ");return e.trim()}Symbol(process.env.NODE_ENV!=="production"?"Object iterate":""),Symbol(process.env.NODE_ENV!=="production"?"Map keys iterate":""),Symbol(process.env.NODE_ENV!=="production"?"Array iterate":""),new Set(Object.getOwnPropertyNames(Symbol).filter(n=>n!=="arguments"&&n!=="caller").map(n=>Symbol[n]).filter(rI));function yy(n){return Oh(n)?yy(n.__v_raw):!!(n&&n.__v_isReactive)}function Oh(n){return!!(n&&n.__v_isReadonly)}function Mh(n){return!!(n&&n.__v_isShallow)}function Ih(n){return n?!!n.__v_raw:!1}function ri(n){const e=n&&n.__v_raw;return e?ri(e):n}function Nh(n){return n?n.__v_isRef===!0:!1}const ii=[];function lI(n){ii.push(n)}function uI(){ii.pop()}let Rh=!1;function Vi(n,...e){if(Rh)return;Rh=!0;const t=ii.length?ii[ii.length-1].component:null,r=t&&t.appContext.config.warnHandler,i=cI();if(r)Lh(r,t,11,[n+e.map(s=>{var a,u;return(u=(a=s.toString)==null?void 0:a.call(s))!=null?u:JSON.stringify(s)}).join(""),t&&t.proxy,i.map(({vnode:s})=>`at <${Ry(t,s.type)}>`).join(`
|
|
46
|
+
`),i]);else{const s=[`[Vue warn]: ${n}`,...e];i.length&&s.push(`
|
|
47
|
+
`,...fI(i)),console.warn(...s)}Rh=!1}function cI(){let n=ii[ii.length-1];if(!n)return[];const e=[];for(;n;){const t=e[0];t&&t.vnode===n?t.recurseCount++:e.push({vnode:n,recurseCount:0});const r=n.component&&n.component.parent;n=r&&r.vnode}return e}function fI(n){const e=[];return n.forEach((t,r)=>{e.push(...r===0?[]:[`
|
|
48
|
+
`],...hI(t))}),e}function hI({vnode:n,recurseCount:e}){const t=e>0?`... (${e} recursive calls)`:"",r=n.component?n.component.parent==null:!1,i=` at <${Ry(n.component,n.type,r)}`,s=">"+t;return n.props?[i,...dI(n.props),s]:[i+s]}function dI(n){const e=[],t=Object.keys(n);return t.slice(0,3).forEach(r=>{e.push(...by(r,n[r]))}),t.length>3&&e.push(" ..."),e}function by(n,e,t){return Tr(e)?(e=JSON.stringify(e),t?e:[`${n}=${e}`]):typeof e=="number"||typeof e=="boolean"||e==null?t?e:[`${n}=${e}`]:Nh(e)?(e=by(n,ri(e.value),!0),t?e:[`${n}=Ref<`,e,">"]):ti(e)?[`${n}=fn${e.name?`<${e.name}>`:""}`]:(e=ri(e),t?e:[`${n}=`,e])}const _y={sp:"serverPrefetch hook",bc:"beforeCreate hook",c:"created hook",bm:"beforeMount hook",m:"mounted hook",bu:"beforeUpdate hook",u:"updated",bum:"beforeUnmount hook",um:"unmounted hook",a:"activated hook",da:"deactivated hook",ec:"errorCaptured hook",rtc:"renderTracked hook",rtg:"renderTriggered hook",0:"setup function",1:"render function",2:"watcher getter",3:"watcher callback",4:"watcher cleanup function",5:"native event handler",6:"component event handler",7:"vnode hook",8:"directive hook",9:"transition hook",10:"app errorHandler",11:"app warnHandler",12:"ref function",13:"async component loader",14:"scheduler flush",15:"component update",16:"app unmount cleanup function"};function Lh(n,e,t,r){try{return r?n(...r):n()}catch(i){wy(i,e,t)}}function wy(n,e,t,r=!0){const i=e?e.vnode:null,{errorHandler:s,throwUnhandledErrorInProduction:a}=e&&e.appContext.config||kh;if(e){let u=e.parent;const c=e.proxy,h=process.env.NODE_ENV!=="production"?_y[t]:`https://vuejs.org/error-reference/#runtime-${t}`;for(;u;){const m=u.ec;if(m){for(let d=0;d<m.length;d++)if(m[d](n,c,h)===!1)return}u=u.parent}if(s){Lh(s,null,10,[n,c,h]);return}}pI(n,t,i,r,a)}function pI(n,e,t,r=!0,i=!1){if(process.env.NODE_ENV!=="production"){const s=_y[e];if(t&&lI(t),Vi(`Unhandled error${s?` during execution of ${s}`:""}`),t&&uI(),r)throw n;console.error(n)}else{if(i)throw n;console.error(n)}}const Zt=[];let Kn=-1;const Ui=[];let Ar=null,qi=0;const mI=Promise.resolve();let Ph=null;const gI=100;function yI(n){let e=Kn+1,t=Zt.length;for(;e<t;){const r=e+t>>>1,i=Zt[r],s=Zs(i);s<n||s===n&&i.flags&2?e=r+1:t=r}return e}function bI(n){if(!(n.flags&1)){const e=Zs(n),t=Zt[Zt.length-1];!t||!(n.flags&2)&&e>=Zs(t)?Zt.push(n):Zt.splice(yI(e),0,n),n.flags|=1,vy()}}function vy(){Ph||(Ph=mI.then(Sy))}function _I(n){wn(n)?Ui.push(...n):Ar&&n.id===-1?Ar.splice(qi+1,0,n):n.flags&1||(Ui.push(n),n.flags|=1),vy()}function wI(n){if(Ui.length){const e=[...new Set(Ui)].sort((t,r)=>Zs(t)-Zs(r));if(Ui.length=0,Ar){Ar.push(...e);return}for(Ar=e,process.env.NODE_ENV!=="production"&&(n=n||new Map),qi=0;qi<Ar.length;qi++){const t=Ar[qi];process.env.NODE_ENV!=="production"&&xy(n,t)||(t.flags&4&&(t.flags&=-2),t.flags&8||t(),t.flags&=-2)}Ar=null,qi=0}}const Zs=n=>n.id==null?n.flags&2?-1:1/0:n.id;function Sy(n){process.env.NODE_ENV!=="production"&&(n=n||new Map);const e=process.env.NODE_ENV!=="production"?t=>xy(n,t):my;try{for(Kn=0;Kn<Zt.length;Kn++){const t=Zt[Kn];if(t&&!(t.flags&8)){if(process.env.NODE_ENV!=="production"&&e(t))continue;t.flags&4&&(t.flags&=-2),Lh(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2)}}}finally{for(;Kn<Zt.length;Kn++){const t=Zt[Kn];t&&(t.flags&=-2)}Kn=-1,Zt.length=0,wI(n),Ph=null,(Zt.length||Ui.length)&&Sy(n)}}function xy(n,e){const t=n.get(e)||0;if(t>gI){const r=e.i,i=r&&Ny(r.type);return wy(`Maximum recursive updates exceeded${i?` in component <${i}>`:""}. This means you have a reactive effect that is mutating its own dependencies and thus recursively triggering itself. Possible sources include component template, render function, updated hook or watcher source function.`,null,10),!0}return n.set(e,t+1),!1}const Dh=new Map;process.env.NODE_ENV!=="production"&&(Hl().__VUE_HMR_RUNTIME__={createRecord:$h(vI),rerender:$h(SI),reload:$h(xI)});const Wl=new Map;function vI(n,e){return Wl.has(n)?!1:(Wl.set(n,{initialDef:Vl(e),instances:new Set}),!0)}function Vl(n){return Ly(n)?n.__vccOpts:n}function SI(n,e){const t=Wl.get(n);t&&(t.initialDef.render=e,[...t.instances].forEach(r=>{e&&(r.render=e,Vl(r.type).render=e),r.renderCache=[],r.job.flags&8||r.update()}))}function xI(n,e){const t=Wl.get(n);if(!t)return;e=Vl(e),Ey(t.initialDef,e);const r=[...t.instances];for(let i=0;i<r.length;i++){const s=r[i],a=Vl(s.type);let u=Dh.get(a);u||(a!==t.initialDef&&Ey(a,e),Dh.set(a,u=new Set)),u.add(s),s.appContext.propsCache.delete(s.type),s.appContext.emitsCache.delete(s.type),s.appContext.optionsCache.delete(s.type),s.ceReload?(u.add(s),s.ceReload(e.styles),u.delete(s)):s.parent?bI(()=>{s.job.flags&8||(s.parent.update(),u.delete(s))}):s.appContext.reload?s.appContext.reload():typeof window<"u"?window.location.reload():console.warn("[HMR] Root or manually mounted instance modified. Full reload required."),s.root.ce&&s!==s.root&&s.root.ce._removeChildStyle(a)}_I(()=>{Dh.clear()})}function Ey(n,e){zl(n,e);for(const t in n)t!=="__file"&&!(t in e)&&delete n[t]}function $h(n){return(e,t)=>{try{return n(e,t)}catch(r){console.error(r),console.warn("[HMR] Something went wrong during Vue component hot-reload. Full reload required.")}}}let Ki,Ul=[];function Cy(n,e){var t,r;Ki=n,Ki?(Ki.enabled=!0,Ul.forEach(({event:i,args:s})=>Ki.emit(i,...s)),Ul=[]):typeof window<"u"&&window.HTMLElement&&!((r=(t=window.navigator)==null?void 0:t.userAgent)!=null&&r.includes("jsdom"))?((e.__VUE_DEVTOOLS_HOOK_REPLAY__=e.__VUE_DEVTOOLS_HOOK_REPLAY__||[]).push(s=>{Cy(s,e)}),setTimeout(()=>{Ki||(e.__VUE_DEVTOOLS_HOOK_REPLAY__=null,Ul=[])},3e3)):Ul=[]}let ql=null,EI=null;const CI=n=>n.__isTeleport;function ky(n,e){n.shapeFlag&6&&n.component?(n.transition=e,ky(n.component.subTree,e)):n.shapeFlag&128?(n.ssContent.transition=e.clone(n.ssContent),n.ssFallback.transition=e.clone(n.ssFallback)):n.transition=e}Hl().requestIdleCallback,Hl().cancelIdleCallback;const kI=Symbol.for("v-ndc"),TI={};process.env.NODE_ENV!=="production"&&(TI.ownKeys=n=>(Vi("Avoid app logic that relies on enumerating keys on a component instance. The keys will be empty in production mode to avoid performance overhead."),Reflect.ownKeys(n)));const AI={},Ty=n=>Object.getPrototypeOf(n)===AI,OI=n=>n.__isSuspense,Ay=Symbol.for("v-fgt"),MI=Symbol.for("v-txt"),II=Symbol.for("v-cmt");function NI(n){return n?n.__v_isVNode===!0:!1}const RI=(...n)=>My(...n),Oy=({key:n})=>n??null,Kl=({ref:n,ref_key:e,ref_for:t})=>(typeof n=="number"&&(n=""+n),n!=null?Tr(n)||Nh(n)||ti(n)?{i:ql,r:n,k:e,f:!!t}:n:null);function LI(n,e=null,t=null,r=0,i=null,s=n===Ay?0:1,a=!1,u=!1){const c={__v_isVNode:!0,__v_skip:!0,type:n,props:e,key:e&&Oy(e),ref:e&&Kl(e),scopeId:EI,slotScopeIds:null,children:t,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:s,patchFlag:r,dynamicProps:i,dynamicChildren:null,appContext:null,ctx:ql};return u?(Fh(c,t),s&128&&n.normalize(c)):t&&(c.shapeFlag|=Tr(t)?8:16),process.env.NODE_ENV!=="production"&&c.key!==c.key&&Vi("VNode created with invalid key (NaN). VNode type:",c.type),c}const PI=process.env.NODE_ENV!=="production"?RI:My;function My(n,e=null,t=null,r=0,i=null,s=!1){if((!n||n===kI)&&(process.env.NODE_ENV!=="production"&&!n&&Vi(`Invalid vnode type when creating vnode: ${n}.`),n=II),NI(n)){const u=Gl(n,e,!0);return t&&Fh(u,t),u.patchFlag=-2,u}if(Ly(n)&&(n=n.__vccOpts),e){e=DI(e);let{class:u,style:c}=e;u&&!Tr(u)&&(e.class=Ah(u)),ni(c)&&(Ih(c)&&!wn(c)&&(c=zl({},c)),e.style=Th(c))}const a=Tr(n)?1:OI(n)?128:CI(n)?64:ni(n)?4:ti(n)?2:0;return process.env.NODE_ENV!=="production"&&a&4&&Ih(n)&&(n=ri(n),Vi("Vue received a Component that was made a reactive object. This can lead to unnecessary performance overhead and should be avoided by marking the component with `markRaw` or using `shallowRef` instead of `ref`.",`
|
|
49
|
+
Component that was made reactive: `,n)),LI(n,e,t,r,i,a,s,!0)}function DI(n){return n?Ih(n)||Ty(n)?zl({},n):n:null}function Gl(n,e,t=!1,r=!1){const{props:i,ref:s,patchFlag:a,children:u,transition:c}=n,h=e?FI(i||{},e):i,m={__v_isVNode:!0,__v_skip:!0,type:n.type,props:h,key:h&&Oy(h),ref:e&&e.ref?t&&s?wn(s)?s.concat(Kl(e)):[s,Kl(e)]:Kl(e):s,scopeId:n.scopeId,slotScopeIds:n.slotScopeIds,children:process.env.NODE_ENV!=="production"&&a===-1&&wn(u)?u.map(Iy):u,target:n.target,targetStart:n.targetStart,targetAnchor:n.targetAnchor,staticCount:n.staticCount,shapeFlag:n.shapeFlag,patchFlag:e&&n.type!==Ay?a===-1?16:a|16:a,dynamicProps:n.dynamicProps,dynamicChildren:n.dynamicChildren,appContext:n.appContext,dirs:n.dirs,transition:c,component:n.component,suspense:n.suspense,ssContent:n.ssContent&&Gl(n.ssContent),ssFallback:n.ssFallback&&Gl(n.ssFallback),placeholder:n.placeholder,el:n.el,anchor:n.anchor,ctx:n.ctx,ce:n.ce};return c&&r&&ky(m,c.clone(m)),m}function Iy(n){const e=Gl(n);return wn(n.children)&&(e.children=n.children.map(Iy)),e}function $I(n=" ",e=0){return PI(MI,null,n,e)}function Fh(n,e){let t=0;const{shapeFlag:r}=n;if(e==null)e=null;else if(wn(e))t=16;else if(typeof e=="object")if(r&65){const i=e.default;i&&(i._c&&(i._d=!1),Fh(n,i()),i._c&&(i._d=!0));return}else t=32,!e._&&!Ty(e)&&(e._ctx=ql);else ti(e)?(e={default:e,_ctx:ql},t=32):(e=String(e),r&64?(t=16,e=[$I(e)]):t=8);n.children=e,n.shapeFlag|=t}function FI(...n){const e={};for(let t=0;t<n.length;t++){const r=n[t];for(const i in r)if(i==="class")e.class!==r.class&&(e.class=Ah([e.class,r.class]));else if(i==="style")e.style=Th([e.style,r.style]);else if(nI(i)){const s=e[i],a=r[i];a&&s!==a&&!(wn(s)&&s.includes(a))&&(e[i]=s?[].concat(s,a):a)}else i!==""&&(e[i]=r[i])}return e}{const n=Hl(),e=(t,r)=>{let i;return(i=n[t])||(i=n[t]=[]),i.push(r),s=>{i.length>1?i.forEach(a=>a(s)):i[0](s)}};e("__VUE_INSTANCE_SETTERS__",t=>t),e("__VUE_SSR_SETTERS__",t=>t)}process.env.NODE_ENV;const BI=/(?:^|[-_])\w/g,zI=n=>n.replace(BI,e=>e.toUpperCase()).replace(/[-_]/g,"");function Ny(n,e=!0){return ti(n)?n.displayName||n.name:n.name||e&&n.__name}function Ry(n,e,t=!1){let r=Ny(e);if(!r&&e.__file){const i=e.__file.match(/([^/\\]+)\.\w+$/);i&&(r=i[1])}if(!r&&n){const i=s=>{for(const a in s)if(s[a]===e)return a};r=i(n.components)||n.parent&&i(n.parent.type.components)||i(n.appContext.components)}return r?zI(r):t?"App":"Anonymous"}function Ly(n){return ti(n)&&"__vccOpts"in n}function HI(){if(process.env.NODE_ENV==="production"||typeof window>"u")return;const n={style:"color:#3ba776"},e={style:"color:#1677ff"},t={style:"color:#f5222d"},r={style:"color:#eb2f96"},i={__vue_custom_formatter:!0,header(d){if(!ni(d))return null;if(d.__isVue)return["div",n,"VueInstance"];if(Nh(d)){const y=d.value;return["div",{},["span",n,m(d)],"<",u(y),">"]}else{if(yy(d))return["div",{},["span",n,Mh(d)?"ShallowReactive":"Reactive"],"<",u(d),`>${Oh(d)?" (readonly)":""}`];if(Oh(d))return["div",{},["span",n,Mh(d)?"ShallowReadonly":"Readonly"],"<",u(d),">"]}return null},hasBody(d){return d&&d.__isVue},body(d){if(d&&d.__isVue)return["div",{},...s(d.$)]}};function s(d){const y=[];d.type.props&&d.props&&y.push(a("props",ri(d.props))),d.setupState!==kh&&y.push(a("setup",d.setupState)),d.data!==kh&&y.push(a("data",ri(d.data)));const _=c(d,"computed");_&&y.push(a("computed",_));const v=c(d,"inject");return v&&y.push(a("injected",v)),y.push(["div",{},["span",{style:r.style+";opacity:0.66"},"$ (internal): "],["object",{object:d}]]),y}function a(d,y){return y=zl({},y),Object.keys(y).length?["div",{style:"line-height:1.25em;margin-bottom:0.6em"},["div",{style:"color:#476582"},d],["div",{style:"padding-left:1.25em"},...Object.keys(y).map(_=>["div",{},["span",r,_+": "],u(y[_],!1)])]]:["span",{}]}function u(d,y=!0){return typeof d=="number"?["span",e,d]:typeof d=="string"?["span",t,JSON.stringify(d)]:typeof d=="boolean"?["span",r,d]:ni(d)?["object",{object:y?ri(d):d}]:["span",t,String(d)]}function c(d,y){const _=d.type;if(ti(_))return;const v={};for(const E in d.ctx)h(_,E,y)&&(v[E]=d.ctx[E]);return v}function h(d,y,_){const v=d[_];if(wn(v)&&v.includes(y)||ni(v)&&y in v||d.extends&&h(d.extends,y,_)||d.mixins&&d.mixins.some(E=>h(E,y,_)))return!0}function m(d){return Mh(d)?"ShallowRef":d.effect?"ComputedRef":"Ref"}window.devtoolsFormatters?window.devtoolsFormatters.push(i):window.devtoolsFormatters=[i]}process.env.NODE_ENV,process.env.NODE_ENV,process.env.NODE_ENV;function WI(){HI()}process.env.NODE_ENV!=="production"&&WI();var VI=Object.defineProperty,UI=(n,e,t)=>e in n?VI(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,Gn=(n,e,t)=>UI(n,typeof e!="symbol"?e+"":e,t),Py,Dy,$y;function ze(n,e){let t=n.length;Array.isArray(n[0])||(n=[n]),Array.isArray(e[0])||(e=e.map(a=>[a]));let r=e[0].length,i=e[0].map((a,u)=>e.map(c=>c[u])),s=n.map(a=>i.map(u=>{let c=0;if(!Array.isArray(a)){for(let h of u)c+=a*h;return c}for(let h=0;h<a.length;h++)c+=a[h]*(u[h]||0);return c}));return t===1&&(s=s[0]),r===1?s.map(a=>a[0]):s}function Fy(n){return Qs(n)==="string"}function Qs(n){return(Object.prototype.toString.call(n).match(/^\[object\s+(.*?)\]$/)[1]||"").toLowerCase()}function Bh(n,{precision:e,unit:t}){return zh(n)?"none":qI(n,e)+(t??"")}function zh(n){return Number.isNaN(n)||n instanceof Number&&n?.none}function qI(n,e){if(n===0)return 0;let t=~~n,r=0;t&&e&&(r=~~Math.log10(Math.abs(t))+1);const i=10**(e-r);return Math.floor(n*i+.5)/i}const KI={deg:1,grad:.9,rad:180/Math.PI,turn:360};function GI(n){if(!n)return;n=n.trim();const e=/^([a-z]+)\((.+?)\)$/i,t=/^-?[\d.]+$/,r=/%|deg|g?rad|turn$/,i=/\/?\s*(none|[-\w.]+(?:%|deg|g?rad|turn)?)/g;let s=n.match(e);if(s){let a=[];return s[2].replace(i,(u,c)=>{let h=c.match(r),m=c;if(h){let d=h[0],y=m.slice(0,-d.length);d==="%"?(m=new Number(y/100),m.type="<percentage>"):(m=new Number(y*KI[d]),m.type="<angle>",m.unit=d)}else t.test(m)?(m=new Number(m),m.type="<number>"):m==="none"&&(m=new Number(NaN),m.none=!0);u.startsWith("/")&&(m=m instanceof Number?m:new Number(m),m.alpha=!0),typeof m=="object"&&m instanceof Number&&(m.raw=c),a.push(m)}),{name:s[1].toLowerCase(),rawName:s[1],rawArgs:s[2],args:a}}}function JI(n){return n[n.length-1]}function By(n,e,t){return isNaN(n)?e:isNaN(e)?n:n+(e-n)*t}function jI(n,e,t){return(t-n)/(e-n)}function zy(n,e,t){return By(e[0],e[1],jI(n[0],n[1],t))}function YI(n){return n.map(e=>e.split("|").map(t=>{t=t.trim();let r=t.match(/^(<[a-z]+>)\[(-?[.\d]+),\s*(-?[.\d]+)\]?$/);if(r){let i=new String(r[1]);return i.range=[+r[2],+r[3]],i}return t}))}function XI(n,e,t){return Math.max(Math.min(t,e),n)}function Hh(n,e){return Math.sign(n)===Math.sign(e)?n:-n}function Jn(n,e){return Hh(Math.abs(n)**e,n)}function Hy(n,e){return e===0?0:n/e}function ZI(n,e,t=0,r=n.length){for(;t<r;){const i=t+r>>1;n[i]<e?t=i+1:r=i}return t}class QI{add(e,t,r){if(typeof arguments[0]!="string"){for(var e in arguments[0])this.add(e,arguments[0][e],arguments[1]);return}(Array.isArray(e)?e:[e]).forEach(function(i){this[i]=this[i]||[],t&&this[i][r?"unshift":"push"](t)},this)}run(e,t){this[e]=this[e]||[],this[e].forEach(function(r){r.call(t&&t.context?t.context:t,t)})}}const Jl=new QI,jn={D50:[.3457/.3585,1,(1-.3457-.3585)/.3585],D65:[.3127/.329,1,(1-.3127-.329)/.329]};function Wh(n){return Array.isArray(n)?n:jn[n]}function jl(n,e,t,r={}){if(n=Wh(n),e=Wh(e),!n||!e)throw new TypeError(`Missing white point to convert ${n?"":"from"}${!n&&!e?"/":""}${e?"":"to"}`);if(n===e)return t;let i={W1:n,W2:e,XYZ:t,options:r};if(Jl.run("chromatic-adaptation-start",i),i.M||(i.W1===jn.D65&&i.W2===jn.D50?i.M=[[1.0479297925449969,.022946870601609652,-.05019226628920524],[.02962780877005599,.9904344267538799,-.017073799063418826],[-.009243040646204504,.015055191490298152,.7518742814281371]]:i.W1===jn.D50&&i.W2===jn.D65&&(i.M=[[.955473421488075,-.02309845494876471,.06325924320057072],[-.0283697093338637,1.0099953980813041,.021041441191917323],[.012314014864481998,-.020507649298898964,1.330365926242124]])),Jl.run("chromatic-adaptation-end",i),i.M)return ze(i.M,i.XYZ);throw new TypeError("Only Bradford CAT with white points D50 and D65 supported for now.")}const eo={gamut_mapping:"css",precision:5,deltaE:"76",verbose:(($y=(Dy=(Py=globalThis?.process)==null?void 0:Py.env)==null?void 0:Dy.NODE_ENV)==null?void 0:$y.toLowerCase())!=="test",warn:function(e){var t,r;this.verbose&&((r=(t=globalThis?.console)==null?void 0:t.warn)==null||r.call(t,e))}},eN=new Set(["<number>","<percentage>","<angle>"]);function Wy(n,e,t,r){return Object.entries(n.coords).map(([s,a],u)=>{let c=e.coordGrammar[u],h=r[u],m=h?.type,d;if(h.none?d=c.find(v=>eN.has(v)):d=c.find(v=>v==m),!d){let v=a.name||s;throw new TypeError(`${m??h.raw} not allowed for ${v} in ${t}()`)}let y=d.range;m==="<percentage>"&&(y||(y=[0,1]));let _=a.range||a.refRange;return y&&_&&(r[u]=zy(y,_,r[u])),d})}function Vy(n,{meta:e}={}){var t,r,i,s;let a={str:(t=String(n))==null?void 0:t.trim()};if(Jl.run("parse-start",a),a.color)return a.color;if(a.parsed=GI(a.str),a.parsed){let u=a.parsed.name;if(u==="color"){let c=a.parsed.args.shift(),h=c.startsWith("--")?c.substring(2):`--${c}`,m=[c,h],d=a.parsed.rawArgs.indexOf("/")>0?a.parsed.args.pop():1;for(let v of le.all){let E=v.getFormat("color");if(E&&(m.includes(E.id)||(r=E.ids)!=null&&r.filter(N=>m.includes(N)).length)){const N=Object.keys(v.coords).map((S,k)=>a.parsed.args[k]||0);let g;return E.coordGrammar&&(g=Wy(v,E,"color",N)),e&&Object.assign(e,{formatId:"color",types:g}),E.id.startsWith("--")&&!c.startsWith("--")&&eo.warn(`${v.name} is a non-standard space and not currently supported in the CSS spec. Use prefixed color(${E.id}) instead of color(${c}).`),c.startsWith("--")&&!E.id.startsWith("--")&&eo.warn(`${v.name} is a standard space and supported in the CSS spec. Use color(${E.id}) instead of prefixed color(${c}).`),{spaceId:v.id,coords:N,alpha:d}}}let y="",_=c in le.registry?c:h;if(_ in le.registry){let v=(s=(i=le.registry[_].formats)==null?void 0:i.color)==null?void 0:s.id;v&&(y=`Did you mean color(${v})?`)}throw new TypeError(`Cannot parse color(${c}). `+(y||"Missing a plugin?"))}else for(let c of le.all){let h=c.getFormat(u);if(h&&h.type==="function"){let m=1;(h.lastAlpha||JI(a.parsed.args).alpha)&&(m=a.parsed.args.pop());let d=a.parsed.args,y;return h.coordGrammar&&(y=Wy(c,h,u,d)),e&&Object.assign(e,{formatId:h.name,types:y}),{spaceId:c.id,coords:d,alpha:m}}}}else for(let u of le.all)for(let c in u.formats){let h=u.formats[c];if(h.type!=="custom"||h.test&&!h.test(a.str))continue;let m=h.parse(a.str);if(m)return m.alpha??(m.alpha=1),e&&(e.formatId=c),m}throw new TypeError(`Could not parse ${n} as a color. Missing a plugin?`)}function Ge(n){if(Array.isArray(n))return n.map(Ge);if(!n)throw new TypeError("Empty color reference");Fy(n)&&(n=Vy(n));let e=n.space||n.spaceId;return e instanceof le||(n.space=le.get(e)),n.alpha===void 0&&(n.alpha=1),n}const tN=75e-6,Vh=class cn{constructor(e){var t;this.id=e.id,this.name=e.name,this.base=e.base?cn.get(e.base):null,this.aliases=e.aliases,this.base&&(this.fromBase=e.fromBase,this.toBase=e.toBase);let r=e.coords??this.base.coords;for(let s in r)"name"in r[s]||(r[s].name=s);this.coords=r;let i=e.white??this.base.white??"D65";this.white=Wh(i),this.formats=e.formats??{};for(let s in this.formats){let a=this.formats[s];a.type||(a.type="function"),a.name||(a.name=s)}(t=this.formats.color)!=null&&t.id||(this.formats.color={...this.formats.color??{},id:e.cssId||this.id}),e.gamutSpace?this.gamutSpace=e.gamutSpace==="self"?this:cn.get(e.gamutSpace):this.isPolar?this.gamutSpace=this.base:this.gamutSpace=this,this.gamutSpace.isUnbounded&&(this.inGamut=(s,a)=>!0),this.referred=e.referred,Object.defineProperty(this,"path",{value:nN(this).reverse(),writable:!1,enumerable:!0,configurable:!0}),Jl.run("colorspace-init-end",this)}inGamut(e,{epsilon:t=tN}={}){if(!this.equals(this.gamutSpace))return e=this.to(this.gamutSpace,e),this.gamutSpace.inGamut(e,{epsilon:t});let r=Object.values(this.coords);return e.every((i,s)=>{let a=r[s];if(a.type!=="angle"&&a.range){if(Number.isNaN(i))return!0;let[u,c]=a.range;return(u===void 0||i>=u-t)&&(c===void 0||i<=c+t)}return!0})}get isUnbounded(){return Object.values(this.coords).every(e=>!("range"in e))}get cssId(){var e,t;return((t=(e=this.formats)==null?void 0:e.color)==null?void 0:t.id)||this.id}get isPolar(){for(let e in this.coords)if(this.coords[e].type==="angle")return!0;return!1}getFormat(e){if(typeof e=="object")return e=Uy(e,this),e;let t;return e==="default"?t=Object.values(this.formats)[0]:t=this.formats[e],t?(t=Uy(t,this),t):null}equals(e){return e?this===e||this.id===e||this.id===e.id:!1}to(e,t){if(arguments.length===1){const u=Ge(e);[e,t]=[u.space,u.coords]}if(e=cn.get(e),this.equals(e))return t;t=t.map(u=>Number.isNaN(u)?0:u);let r=this.path,i=e.path,s,a;for(let u=0;u<r.length&&r[u].equals(i[u]);u++)s=r[u],a=u;if(!s)throw new Error(`Cannot convert between color spaces ${this} and ${e}: no connection space was found`);for(let u=r.length-1;u>a;u--)t=r[u].toBase(t);for(let u=a+1;u<i.length;u++)t=i[u].fromBase(t);return t}from(e,t){if(arguments.length===1){const r=Ge(e);[e,t]=[r.space,r.coords]}return e=cn.get(e),e.to(this,t)}toString(){return`${this.name} (${this.id})`}getMinCoords(){let e=[];for(let t in this.coords){let r=this.coords[t],i=r.range||r.refRange;e.push(i?.min??0)}return e}static get all(){return[...new Set(Object.values(cn.registry))]}static register(e,t){if(arguments.length===1&&(t=arguments[0],e=t.id),t=this.get(t),this.registry[e]&&this.registry[e]!==t)throw new Error(`Duplicate color space registration: '${e}'`);if(this.registry[e]=t,arguments.length===1&&t.aliases)for(let r of t.aliases)this.register(r,t);return t}static get(e,...t){if(!e||e instanceof cn)return e;if(Qs(e)==="string"){let i=cn.registry[e.toLowerCase()];if(!i)throw new TypeError(`No color space found with id = "${e}"`);return i}if(t.length)return cn.get(...t);throw new TypeError(`${e} is not a valid color space`)}static resolveCoord(e,t){var r;let i=Qs(e),s,a;if(i==="string"?e.includes(".")?[s,a]=e.split("."):[s,a]=[,e]:Array.isArray(e)?[s,a]=e:(s=e.space,a=e.coordId),s=cn.get(s),s||(s=t),!s)throw new TypeError(`Cannot resolve coordinate reference ${e}: No color space specified and relative references are not allowed here`);if(i=Qs(a),i==="number"||i==="string"&&a>=0){let h=Object.entries(s.coords)[a];if(h)return{space:s,id:h[0],index:a,...h[1]}}s=cn.get(s);let u=a.toLowerCase(),c=0;for(let h in s.coords){let m=s.coords[h];if(h.toLowerCase()===u||((r=m.name)==null?void 0:r.toLowerCase())===u)return{space:s,id:h,index:c,...m};c++}throw new TypeError(`No "${a}" coordinate found in ${s.name}. Its coordinates are: ${Object.keys(s.coords).join(", ")}`)}};Gn(Vh,"registry",{}),Gn(Vh,"DEFAULT_FORMAT",{type:"functions",name:"color"});let le=Vh;function nN(n){let e=[n];for(let t=n;t=t.base;)e.push(t);return e}function Uy(n,{coords:e}={}){if(n.coords&&!n.coordGrammar){n.type||(n.type="function"),n.name||(n.name="color"),n.coordGrammar=YI(n.coords);let t=Object.entries(e).map(([r,i],s)=>{let a=n.coordGrammar[s][0],u=i.range||i.refRange,c=a.range,h="";return a=="<percentage>"?(c=[0,100],h="%"):a=="<angle>"&&(h="deg"),{fromRange:u,toRange:c,suffix:h}});n.serializeCoords=(r,i)=>r.map((s,a)=>{let{fromRange:u,toRange:c,suffix:h}=t[a];return u&&c&&(s=zy(u,c,s)),s=Bh(s,{precision:i,unit:h}),s})}return n}const Yn=new le({id:"xyz-d65",name:"XYZ D65",coords:{x:{name:"X"},y:{name:"Y"},z:{name:"Z"}},white:"D65",formats:{color:{ids:["xyz-d65","xyz"]}},aliases:["xyz"]});class qy extends le{constructor(e){e.coords||(e.coords={r:{range:[0,1],name:"Red"},g:{range:[0,1],name:"Green"},b:{range:[0,1],name:"Blue"}}),e.base||(e.base=Yn),e.toXYZ_M&&e.fromXYZ_M&&(e.toBase??(e.toBase=t=>{let r=ze(e.toXYZ_M,t);return this.white!==this.base.white&&(r=jl(this.white,this.base.white,r)),r}),e.fromBase??(e.fromBase=t=>(t=jl(this.base.white,this.white,t),ze(e.fromXYZ_M,t)))),e.referred??(e.referred="display"),super(e)}}function Uh(n,e){return n=Ge(n),!e||n.space.equals(e)?n.coords.slice():(e=le.get(e),e.from(n))}function Xn(n,e){n=Ge(n);let{space:t,index:r}=le.resolveCoord(e,n.space);return Uh(n,t)[r]}function Ky(n,e,t){return n=Ge(n),e=le.get(e),n.coords=e.to(n.space,t),n}Ky.returns="color";function qh(n,e,t){if(n=Ge(n),arguments.length===2&&Qs(arguments[1])==="object"){let r=arguments[1];for(let i in r)qh(n,i,r[i])}else{typeof t=="function"&&(t=t(Xn(n,e)));let{space:r,index:i}=le.resolveCoord(e,n.space),s=Uh(n,r);s[i]=t,Ky(n,r,s)}return n}qh.returns="color";const rN=new le({id:"xyz-d50",name:"XYZ D50",white:"D50",base:Yn,fromBase:n=>jl(Yn.white,"D50",n),toBase:n=>jl("D50",Yn.white,n)}),iN=216/24389,Gy=24/116,Yl=24389/27;let Kh=jn.D50;const Zn=new le({id:"lab",name:"Lab",coords:{l:{refRange:[0,100],name:"Lightness"},a:{refRange:[-125,125]},b:{refRange:[-125,125]}},white:Kh,base:rN,fromBase(n){let t=n.map((r,i)=>r/Kh[i]).map(r=>r>iN?Math.cbrt(r):(Yl*r+16)/116);return[116*t[1]-16,500*(t[0]-t[1]),200*(t[1]-t[2])]},toBase(n){let e=[];return e[1]=(n[0]+16)/116,e[0]=n[1]/500+e[1],e[2]=e[1]-n[2]/200,[e[0]>Gy?Math.pow(e[0],3):(116*e[0]-16)/Yl,n[0]>8?Math.pow((n[0]+16)/116,3):n[0]/Yl,e[2]>Gy?Math.pow(e[2],3):(116*e[2]-16)/Yl].map((r,i)=>r*Kh[i])},formats:{lab:{coords:["<number> | <percentage>","<number> | <percentage>[-1,1]","<number> | <percentage>[-1,1]"]}}});function Or(n){return(n%360+360)%360}const Xl=new le({id:"lch",name:"LCH",coords:{l:{refRange:[0,100],name:"Lightness"},c:{refRange:[0,150],name:"Chroma"},h:{refRange:[0,360],type:"angle",name:"Hue"}},base:Zn,fromBase(n){let[e,t,r]=n,i;const s=.02;return Math.abs(t)<s&&Math.abs(r)<s?i=NaN:i=Math.atan2(r,t)*180/Math.PI,[e,Math.sqrt(t**2+r**2),Or(i)]},toBase(n){let[e,t,r]=n;return t<0&&(t=0),isNaN(r)&&(r=0),[e,t*Math.cos(r*Math.PI/180),t*Math.sin(r*Math.PI/180)]},formats:{lch:{coords:["<number> | <percentage>","<number> | <percentage>","<number> | <angle>"]}}}),Jy=25**7,Zl=Math.PI,jy=180/Zl,Gi=Zl/180;function Yy(n){const e=n*n;return e*e*e*n}function Xy(n,e,{kL:t=1,kC:r=1,kH:i=1}={}){[n,e]=Ge([n,e]);let[s,a,u]=Zn.from(n),c=Xl.from(Zn,[s,a,u])[1],[h,m,d]=Zn.from(e),y=Xl.from(Zn,[h,m,d])[1];c<0&&(c=0),y<0&&(y=0);let _=(c+y)/2,v=Yy(_),E=.5*(1-Math.sqrt(v/(v+Jy))),N=(1+E)*a,g=(1+E)*m,S=Math.sqrt(N**2+u**2),k=Math.sqrt(g**2+d**2),T=N===0&&u===0?0:Math.atan2(u,N),A=g===0&&d===0?0:Math.atan2(d,g);T<0&&(T+=2*Zl),A<0&&(A+=2*Zl),T*=jy,A*=jy;let $=h-s,U=k-S,z=A-T,ee=T+A,te=Math.abs(z),Se;S*k===0?Se=0:te<=180?Se=z:z>180?Se=z-360:z<-180?Se=z+360:eo.warn("the unthinkable has happened");let vt=2*Math.sqrt(k*S)*Math.sin(Se*Gi/2),Cn=(s+h)/2,$t=(S+k)/2,kn=Yy($t),We;S*k===0?We=ee:te<=180?We=ee/2:ee<360?We=(ee+360)/2:We=(ee-360)/2;let St=(Cn-50)**2,er=1+.015*St/Math.sqrt(20+St),lo=1+.045*$t,hn=1;hn-=.17*Math.cos((We-30)*Gi),hn+=.24*Math.cos(2*We*Gi),hn+=.32*Math.cos((3*We+6)*Gi),hn-=.2*Math.cos((4*We-63)*Gi);let xt=1+.015*$t*hn,lu=30*Math.exp(-1*((We-275)/25)**2),uu=2*Math.sqrt(kn/(kn+Jy)),cu=-1*Math.sin(2*lu*Gi)*uu,Qt=($/(t*er))**2;return Qt+=(U/(r*lo))**2,Qt+=(vt/(i*xt))**2,Qt+=cu*(U/(r*lo))*(vt/(i*xt)),Math.sqrt(Qt)}const sN=[[.819022437996703,.3619062600528904,-.1288737815209879],[.0329836539323885,.9292868615863434,.0361446663506424],[.0481771893596242,.2642395317527308,.6335478284694309]],oN=[[1.2268798758459243,-.5578149944602171,.2813910456659647],[-.0405757452148008,1.112286803280317,-.0717110580655164],[-.0763729366746601,-.4214933324022432,1.5869240198367816]],aN=[[.210454268309314,.7936177747023054,-.0040720430116193],[1.9779985324311684,-2.42859224204858,.450593709617411],[.0259040424655478,.7827717124575296,-.8086757549230774]],lN=[[1,.3963377773761749,.2158037573099136],[1,-.1055613458156586,-.0638541728258133],[1,-.0894841775298119,-1.2914855480194092]],to=new le({id:"oklab",name:"Oklab",coords:{l:{refRange:[0,1],name:"Lightness"},a:{refRange:[-.4,.4]},b:{refRange:[-.4,.4]}},white:"D65",base:Yn,fromBase(n){let t=ze(sN,n).map(r=>Math.cbrt(r));return ze(aN,t)},toBase(n){let t=ze(lN,n).map(r=>r**3);return ze(oN,t)},formats:{oklab:{coords:["<percentage> | <number>","<number> | <percentage>[-1,1]","<number> | <percentage>[-1,1]"]}}});function Gh(n,e){[n,e]=Ge([n,e]);let[t,r,i]=to.from(n),[s,a,u]=to.from(e),c=t-s,h=r-a,m=i-u;return Math.sqrt(c**2+h**2+m**2)}const uN=75e-6;function Ji(n,e,{epsilon:t=uN}={}){n=Ge(n),e||(e=n.space),e=le.get(e);let r=n.coords;return e!==n.space&&(r=e.from(n)),e.inGamut(r,{epsilon:t})}function Jh(n){return{space:n.space,coords:n.coords.slice(),alpha:n.alpha}}function cN(n,e,t="lab"){t=le.get(t);let r=t.from(n),i=t.from(e);return Math.sqrt(r.reduce((s,a,u)=>{let c=i[u];return isNaN(a)||isNaN(c)?s:s+(c-a)**2},0))}function fN(n,e){return cN(n,e,"lab")}const hN=Math.PI,Zy=hN/180;function dN(n,e,{l:t=2,c:r=1}={}){[n,e]=Ge([n,e]);let[i,s,a]=Zn.from(n),[,u,c]=Xl.from(Zn,[i,s,a]),[h,m,d]=Zn.from(e),y=Xl.from(Zn,[h,m,d])[1];u<0&&(u=0),y<0&&(y=0);let _=i-h,v=u-y,E=s-m,N=a-d,g=E**2+N**2-v**2,S=.511;i>=16&&(S=.040975*i/(1+.01765*i));let k=.0638*u/(1+.0131*u)+.638,T;Number.isNaN(c)&&(c=0),c>=164&&c<=345?T=.56+Math.abs(.2*Math.cos((c+168)*Zy)):T=.36+Math.abs(.4*Math.cos((c+35)*Zy));let A=Math.pow(u,4),$=Math.sqrt(A/(A+1900)),U=k*($*T+1-$),z=(_/(t*S))**2;return z+=(v/(r*k))**2,z+=g/U**2,Math.sqrt(z)}const Qy=203,eb=new le({id:"xyz-abs-d65",cssId:"--xyz-abs-d65",name:"Absolute XYZ D65",coords:{x:{refRange:[0,9504.7],name:"Xa"},y:{refRange:[0,1e4],name:"Ya"},z:{refRange:[0,10888.3],name:"Za"}},base:Yn,fromBase(n){return n.map(e=>Math.max(e*Qy,0))},toBase(n){return n.map(e=>Math.max(e/Qy,0))}}),Ql=1.15,eu=.66,tb=2610/2**14,pN=2**14/2610,nb=3424/2**12,rb=2413/2**7,ib=2392/2**7,mN=1.7*2523/2**5,sb=2**5/(1.7*2523),tu=-.56,jh=16295499532821565e-27,gN=[[.41478972,.579999,.014648],[-.20151,1.120649,.0531008],[-.0166008,.2648,.6684799]],yN=[[1.9242264357876067,-1.0047923125953657,.037651404030618],[.35031676209499907,.7264811939316552,-.06538442294808501],[-.09098281098284752,-.3127282905230739,1.5227665613052603]],bN=[[.5,.5,0],[3.524,-4.066708,.542708],[.199076,1.096799,-1.295875]],_N=[[1,.1386050432715393,.05804731615611886],[.9999999999999999,-.1386050432715393,-.05804731615611886],[.9999999999999998,-.09601924202631895,-.8118918960560388]],wN=new le({id:"jzazbz",name:"Jzazbz",coords:{jz:{refRange:[0,1],name:"Jz"},az:{refRange:[-.5,.5]},bz:{refRange:[-.5,.5]}},base:eb,fromBase(n){let[e,t,r]=n,i=Ql*e-(Ql-1)*r,s=eu*t-(eu-1)*e,u=ze(gN,[i,s,r]).map(function(y){let _=nb+rb*(y/1e4)**tb,v=1+ib*(y/1e4)**tb;return(_/v)**mN}),[c,h,m]=ze(bN,u);return[(1+tu)*c/(1+tu*c)-jh,h,m]},toBase(n){let[e,t,r]=n,i=(e+jh)/(1+tu-tu*(e+jh)),a=ze(_N,[i,t,r]).map(function(y){let _=nb-y**sb,v=ib*y**sb-rb;return 1e4*(_/v)**pN}),[u,c,h]=ze(yN,a),m=(u+(Ql-1)*h)/Ql,d=(c+(eu-1)*m)/eu;return[m,d,h]},formats:{color:{coords:["<number> | <percentage>","<number> | <percentage>[-1,1]","<number> | <percentage>[-1,1]"]}}}),ob=new le({id:"jzczhz",name:"JzCzHz",coords:{jz:{refRange:[0,1],name:"Jz"},cz:{refRange:[0,1],name:"Chroma"},hz:{refRange:[0,360],type:"angle",name:"Hue"}},base:wN,fromBase(n){let[e,t,r]=n,i;const s=2e-4;return Math.abs(t)<s&&Math.abs(r)<s?i=NaN:i=Math.atan2(r,t)*180/Math.PI,[e,Math.sqrt(t**2+r**2),Or(i)]},toBase(n){return[n[0],n[1]*Math.cos(n[2]*Math.PI/180),n[1]*Math.sin(n[2]*Math.PI/180)]}});function vN(n,e){[n,e]=Ge([n,e]);let[t,r,i]=ob.from(n),[s,a,u]=ob.from(e),c=t-s,h=r-a;Number.isNaN(i)&&Number.isNaN(u)?(i=0,u=0):Number.isNaN(i)?i=u:Number.isNaN(u)&&(u=i);let m=i-u,d=2*Math.sqrt(r*a)*Math.sin(m/2*(Math.PI/180));return Math.sqrt(c**2+h**2+d**2)}const ab=3424/4096,lb=2413/128,ub=2392/128,cb=2610/16384,SN=2523/32,xN=16384/2610,fb=32/2523,EN=[[.3592832590121217,.6976051147779502,-.035891593232029],[-.1920808463704993,1.100476797037432,.0753748658519118],[.0070797844607479,.0748396662186362,.8433265453898765]],CN=[[2048/4096,2048/4096,0],[6610/4096,-13613/4096,7003/4096],[17933/4096,-17390/4096,-543/4096]],kN=[[.9999999999999998,.0086090370379328,.111029625003026],[.9999999999999998,-.0086090370379328,-.1110296250030259],[.9999999999999998,.5600313357106791,-.3206271749873188]],TN=[[2.0701522183894223,-1.3263473389671563,.2066510476294053],[.3647385209748072,.6805660249472273,-.0453045459220347],[-.0497472075358123,-.0492609666966131,1.1880659249923042]],hb=new le({id:"ictcp",name:"ICTCP",coords:{i:{refRange:[0,1],name:"I"},ct:{refRange:[-.5,.5],name:"CT"},cp:{refRange:[-.5,.5],name:"CP"}},base:eb,fromBase(n){let e=ze(EN,n);return AN(e)},toBase(n){let e=ON(n);return ze(TN,e)}});function AN(n){let e=n.map(function(t){let r=ab+lb*(t/1e4)**cb,i=1+ub*(t/1e4)**cb;return(r/i)**SN});return ze(CN,e)}function ON(n){return ze(kN,n).map(function(r){let i=Math.max(r**fb-ab,0),s=lb-ub*r**fb;return 1e4*(i/s)**xN})}function MN(n,e){[n,e]=Ge([n,e]);let[t,r,i]=hb.from(n),[s,a,u]=hb.from(e);return 720*Math.sqrt((t-s)**2+.25*(r-a)**2+(i-u)**2)}const IN=jn.D65,db=.42,pb=1/db,Yh=2*Math.PI,mb=[[.401288,.650173,-.051461],[-.250268,1.204414,.045854],[-.002079,.048952,.953127]],NN=[[1.8620678550872327,-1.0112546305316843,.14918677544445175],[.38752654323613717,.6214474419314753,-.008973985167612518],[-.015841498849333856,-.03412293802851557,1.0499644368778496]],RN=[[460,451,288],[460,-891,-261],[460,-220,-6300]],LN={dark:[.8,.525,.8],dim:[.9,.59,.9],average:[1,.69,1]},si={h:[20.14,90,164.25,237.53,380.14],e:[.8,.7,1,1.2,.8],H:[0,100,200,300,400]},PN=180/Math.PI,gb=Math.PI/180;function yb(n,e){return n.map(r=>{const i=Jn(e*Math.abs(r)*.01,db);return 400*Hh(i,r)/(i+27.13)})}function DN(n,e){const t=100/e*27.13**pb;return n.map(r=>{const i=Math.abs(r);return Hh(t*Jn(i/(400-i),pb),r)})}function $N(n){let e=Or(n);e<=si.h[0]&&(e+=360);const t=ZI(si.h,e)-1,[r,i]=si.h.slice(t,t+2),[s,a]=si.e.slice(t,t+2),u=si.H[t],c=(e-r)/s;return u+100*c/(c+(i-e)/a)}function FN(n){let e=(n%400+400)%400;const t=Math.floor(.01*e);e=e%100;const[r,i]=si.h.slice(t,t+2),[s,a]=si.e.slice(t,t+2);return Or((e*(a*r-s*i)-100*r*a)/(e*(a-s)-100*a))}function bb(n,e,t,r,i){const s={};s.discounting=i,s.refWhite=n,s.surround=r;const a=n.map(E=>E*100);s.la=e,s.yb=t;const u=a[1],c=ze(mb,a);r=LN[s.surround];const h=r[0];s.c=r[1],s.nc=r[2];const d=(1/(5*s.la+1))**4;s.fl=d*s.la+.1*(1-d)*(1-d)*Math.cbrt(5*s.la),s.flRoot=s.fl**.25,s.n=s.yb/u,s.z=1.48+Math.sqrt(s.n),s.nbb=.725*s.n**-.2,s.ncb=s.nbb;const y=Math.max(Math.min(h*(1-1/3.6*Math.exp((-s.la-42)/92)),1),0);s.dRgb=c.map(E=>By(1,u/E,y)),s.dRgbInv=s.dRgb.map(E=>1/E);const _=c.map((E,N)=>E*s.dRgb[N]),v=yb(_,s.fl);return s.aW=s.nbb*(2*v[0]+v[1]+.05*v[2]),s}const _b=bb(IN,64/Math.PI*.2,20,"average",!1);function Xh(n,e){if(!(n.J!==void 0^n.Q!==void 0))throw new Error("Conversion requires one and only one: 'J' or 'Q'");if(!(n.C!==void 0^n.M!==void 0^n.s!==void 0))throw new Error("Conversion requires one and only one: 'C', 'M' or 's'");if(!(n.h!==void 0^n.H!==void 0))throw new Error("Conversion requires one and only one: 'h' or 'H'");if(n.J===0||n.Q===0)return[0,0,0];let t=0;n.h!==void 0?t=Or(n.h)*gb:t=FN(n.H)*gb;const r=Math.cos(t),i=Math.sin(t);let s=0;n.J!==void 0?s=Jn(n.J,1/2)*.1:n.Q!==void 0&&(s=.25*e.c*n.Q/((e.aW+4)*e.flRoot));let a=0;n.C!==void 0?a=n.C/s:n.M!==void 0?a=n.M/e.flRoot/s:n.s!==void 0&&(a=4e-4*n.s**2*(e.aW+4)/e.c);const u=Jn(a*Math.pow(1.64-Math.pow(.29,e.n),-.73),10/9),c=.25*(Math.cos(t+2)+3.8),h=e.aW*Jn(s,2/e.c/e.z),m=5e4/13*e.nc*e.ncb*c,d=h/e.nbb,y=23*(d+.305)*Hy(u,23*m+u*(11*r+108*i)),_=y*r,v=y*i,E=DN(ze(RN,[d,_,v]).map(N=>N*1/1403),e.fl);return ze(NN,E.map((N,g)=>N*e.dRgbInv[g])).map(N=>N/100)}function wb(n,e){const t=n.map(k=>k*100),r=yb(ze(mb,t).map((k,T)=>k*e.dRgb[T]),e.fl),i=r[0]+(-12*r[1]+r[2])/11,s=(r[0]+r[1]-2*r[2])/9,a=(Math.atan2(s,i)%Yh+Yh)%Yh,u=.25*(Math.cos(a+2)+3.8),c=5e4/13*e.nc*e.ncb*Hy(u*Math.sqrt(i**2+s**2),r[0]+r[1]+1.05*r[2]+.305),h=Jn(c,.9)*Math.pow(1.64-Math.pow(.29,e.n),.73),m=e.nbb*(2*r[0]+r[1]+.05*r[2]),d=Jn(m/e.aW,.5*e.c*e.z),y=100*Jn(d,2),_=4/e.c*d*(e.aW+4)*e.flRoot,v=h*d,E=v*e.flRoot,N=Or(a*PN),g=$N(N),S=50*Jn(e.c*h/(e.aW+4),1/2);return{J:y,C:v,h:N,s:S,Q:_,M:E,H:g}}new le({id:"cam16-jmh",cssId:"--cam16-jmh",name:"CAM16-JMh",coords:{j:{refRange:[0,100],name:"J"},m:{refRange:[0,105],name:"Colorfulness"},h:{refRange:[0,360],type:"angle",name:"Hue"}},base:Yn,fromBase(n){const e=wb(n,_b);return[e.J,e.M,e.h]},toBase(n){return Xh({J:n[0],M:n[1],h:n[2]},_b)}});const BN=jn.D65,zN=216/24389,vb=24389/27;function HN(n){return 116*(n>zN?Math.cbrt(n):(vb*n+16)/116)-16}function Zh(n){return n>8?Math.pow((n+16)/116,3):n/vb}function WN(n,e){let[t,r,i]=n,s=[],a=0;if(i===0)return[0,0,0];let u=Zh(i);i>0?a=.00379058511492914*i**2+.608983189401032*i+.9155088574762233:a=9514440756550361e-21*i**2+.08693057439788597*i-21.928975842194614;const c=2e-12,h=15;let m=0,d=1/0;for(;m<=h;){s=Xh({J:a,C:r,h:t},e);const y=Math.abs(s[1]-u);if(y<d){if(y<=c)return s;d=y}a=a-(s[1]-u)*a/(2*s[1]),m+=1}return Xh({J:a,C:r,h:t},e)}function VN(n,e){const t=HN(n[1]);if(t===0)return[0,0,0];const r=wb(n,Qh);return[Or(r.h),r.C,t]}const Qh=bb(BN,200/Math.PI*Zh(50),Zh(50)*100,"average",!1),nu=new le({id:"hct",name:"HCT",coords:{h:{refRange:[0,360],type:"angle",name:"Hue"},c:{refRange:[0,145],name:"Colorfulness"},t:{refRange:[0,100],name:"Tone"}},base:Yn,fromBase(n){return VN(n)},toBase(n){return WN(n,Qh)},formats:{color:{id:"--hct",coords:["<number> | <angle>","<percentage> | <number>","<percentage> | <number>"]}}}),UN=Math.PI/180,Sb=[1,.007,.0228];function xb(n){n[1]<0&&(n=nu.fromBase(nu.toBase(n)));const e=Math.log(Math.max(1+Sb[2]*n[1]*Qh.flRoot,1))/Sb[2],t=n[0]*UN,r=e*Math.cos(t),i=e*Math.sin(t);return[n[2],r,i]}function qN(n,e){[n,e]=Ge([n,e]);let[t,r,i]=xb(nu.from(n)),[s,a,u]=xb(nu.from(e));return Math.sqrt((t-s)**2+(r-a)**2+(i-u)**2)}const Eb={deltaE76:fN,deltaECMC:dN,deltaE2000:Xy,deltaEJz:vN,deltaEITP:MN,deltaEOK:Gh,deltaEHCT:qN};function KN(n){const e=n?Math.floor(Math.log10(Math.abs(n))):0;return Math.max(parseFloat(`1e${e-2}`),1e-6)}const Cb={hct:{method:"hct.c",jnd:2,deltaEMethod:"hct",blackWhiteClamp:{}},"hct-tonal":{method:"hct.c",jnd:0,deltaEMethod:"hct",blackWhiteClamp:{channel:"hct.t",min:0,max:100}}};function no(n,{method:e=eo.gamut_mapping,space:t=void 0,deltaEMethod:r="",jnd:i=2,blackWhiteClamp:s={}}={}){if(n=Ge(n),Fy(arguments[1])?t=arguments[1]:t||(t=n.space),t=le.get(t),Ji(n,t,{epsilon:0}))return n;let a;if(e==="css")a=GN(n,{space:t});else{if(e!=="clip"&&!Ji(n,t)){Object.prototype.hasOwnProperty.call(Cb,e)&&({method:e,jnd:i,deltaEMethod:r,blackWhiteClamp:s}=Cb[e]);let u=Xy;if(r!==""){for(let h in Eb)if("deltae"+r.toLowerCase()===h.toLowerCase()){u=Eb[h];break}}let c=no(He(n,t),{method:"clip",space:t});if(u(n,c)>i){if(Object.keys(s).length===3){let S=le.resolveCoord(s.channel),k=Xn(He(n,S.space),S.id);if(zh(k)&&(k=0),k>=s.max)return He({space:"xyz-d65",coords:jn.D65},n.space);if(k<=s.min)return He({space:"xyz-d65",coords:[0,0,0]},n.space)}let h=le.resolveCoord(e),m=h.space,d=h.id,y=He(n,m);y.coords.forEach((S,k)=>{zh(S)&&(y.coords[k]=0)});let v=(h.range||h.refRange)[0],E=KN(i),N=v,g=Xn(y,d);for(;g-N>E;){let S=Jh(y);S=no(S,{space:t,method:"clip"}),u(y,S)-i<E?N=Xn(y,d):g=Xn(y,d),qh(y,d,(N+g)/2)}a=He(y,t)}else a=c}else a=He(n,t);if(e==="clip"||!Ji(a,t,{epsilon:0})){let u=Object.values(t.coords).map(c=>c.range||[]);a.coords=a.coords.map((c,h)=>{let[m,d]=u[h];return m!==void 0&&(c=Math.max(m,c)),d!==void 0&&(c=Math.min(c,d)),c})}}return t!==n.space&&(a=He(a,n.space)),n.coords=a.coords,n}no.returns="color";const kb={WHITE:{space:to,coords:[1,0,0]},BLACK:{space:to,coords:[0,0,0]}};function GN(n,{space:e}={}){n=Ge(n),e||(e=n.space),e=le.get(e);const i=le.get("oklch");if(e.isUnbounded)return He(n,e);const s=He(n,i);let a=s.coords[0];if(a>=1){const v=He(kb.WHITE,e);return v.alpha=n.alpha,He(v,e)}if(a<=0){const v=He(kb.BLACK,e);return v.alpha=n.alpha,He(v,e)}if(Ji(s,e,{epsilon:0}))return He(s,e);function u(v){const E=He(v,e),N=Object.values(e.coords);return E.coords=E.coords.map((g,S)=>{if("range"in N[S]){const[k,T]=N[S].range;return XI(k,g,T)}return g}),E}let c=0,h=s.coords[1],m=!0,d=Jh(s),y=u(d),_=Gh(y,d);if(_<.02)return y;for(;h-c>1e-4;){const v=(c+h)/2;if(d.coords[1]=v,m&&Ji(d,e,{epsilon:0}))c=v;else if(y=u(d),_=Gh(y,d),_<.02){if(.02-_<1e-4)break;m=!1,c=v}else h=v}return y}function He(n,e,{inGamut:t}={}){n=Ge(n),e=le.get(e);let r=e.from(n),i={space:e,coords:r,alpha:n.alpha};return t&&(i=no(i,t===!0?void 0:t)),i}He.returns="color";function JN(n,{precision:e=eo.precision,format:t="default",inGamut:r=!0,...i}={}){var s;let a;n=Ge(n);let u=t;t=n.space.getFormat(t)??n.space.getFormat("default")??le.DEFAULT_FORMAT;let c=n.coords.slice();if(r||(r=t.toGamut),r&&!Ji(n)&&(c=no(Jh(n),r===!0?void 0:r).coords),t.type==="custom")if(i.precision=e,t.serialize)a=t.serialize(c,n.alpha,i);else throw new TypeError(`format ${u} can only be used to parse colors, not for serialization`);else{let h=t.name||"color";t.serializeCoords?c=t.serializeCoords(c,e):e!==null&&(c=c.map(_=>Bh(_,{precision:e})));let m=[...c];if(h==="color"){let _=t.id||((s=t.ids)==null?void 0:s[0])||n.space.id;m.unshift(_)}let d=n.alpha;e!==null&&(d=Bh(d,{precision:e}));let y=n.alpha>=1||t.noAlpha?"":`${t.commas?",":" /"} ${d}`;a=`${h}(${m.join(t.commas?", ":" ")}${y})`}return a}const jN=[[.41239079926595934,.357584339383878,.1804807884018343],[.21263900587151027,.715168678767756,.07219231536073371],[.01933081871559182,.11919477979462598,.9505321522496607]],YN=[[3.2409699419045226,-1.537383177570094,-.4986107602930034],[-.9692436362808796,1.8759675015077202,.04155505740717559],[.05563007969699366,-.20397695888897652,1.0569715142428786]],XN=new qy({id:"srgb-linear",name:"Linear sRGB",white:"D65",toXYZ_M:jN,fromXYZ_M:YN}),Tb={aliceblue:[240/255,248/255,1],antiquewhite:[250/255,235/255,215/255],aqua:[0,1,1],aquamarine:[127/255,1,212/255],azure:[240/255,1,1],beige:[245/255,245/255,220/255],bisque:[1,228/255,196/255],black:[0,0,0],blanchedalmond:[1,235/255,205/255],blue:[0,0,1],blueviolet:[138/255,43/255,226/255],brown:[165/255,42/255,42/255],burlywood:[222/255,184/255,135/255],cadetblue:[95/255,158/255,160/255],chartreuse:[127/255,1,0],chocolate:[210/255,105/255,30/255],coral:[1,127/255,80/255],cornflowerblue:[100/255,149/255,237/255],cornsilk:[1,248/255,220/255],crimson:[220/255,20/255,60/255],cyan:[0,1,1],darkblue:[0,0,139/255],darkcyan:[0,139/255,139/255],darkgoldenrod:[184/255,134/255,11/255],darkgray:[169/255,169/255,169/255],darkgreen:[0,100/255,0],darkgrey:[169/255,169/255,169/255],darkkhaki:[189/255,183/255,107/255],darkmagenta:[139/255,0,139/255],darkolivegreen:[85/255,107/255,47/255],darkorange:[1,140/255,0],darkorchid:[153/255,50/255,204/255],darkred:[139/255,0,0],darksalmon:[233/255,150/255,122/255],darkseagreen:[143/255,188/255,143/255],darkslateblue:[72/255,61/255,139/255],darkslategray:[47/255,79/255,79/255],darkslategrey:[47/255,79/255,79/255],darkturquoise:[0,206/255,209/255],darkviolet:[148/255,0,211/255],deeppink:[1,20/255,147/255],deepskyblue:[0,191/255,1],dimgray:[105/255,105/255,105/255],dimgrey:[105/255,105/255,105/255],dodgerblue:[30/255,144/255,1],firebrick:[178/255,34/255,34/255],floralwhite:[1,250/255,240/255],forestgreen:[34/255,139/255,34/255],fuchsia:[1,0,1],gainsboro:[220/255,220/255,220/255],ghostwhite:[248/255,248/255,1],gold:[1,215/255,0],goldenrod:[218/255,165/255,32/255],gray:[128/255,128/255,128/255],green:[0,128/255,0],greenyellow:[173/255,1,47/255],grey:[128/255,128/255,128/255],honeydew:[240/255,1,240/255],hotpink:[1,105/255,180/255],indianred:[205/255,92/255,92/255],indigo:[75/255,0,130/255],ivory:[1,1,240/255],khaki:[240/255,230/255,140/255],lavender:[230/255,230/255,250/255],lavenderblush:[1,240/255,245/255],lawngreen:[124/255,252/255,0],lemonchiffon:[1,250/255,205/255],lightblue:[173/255,216/255,230/255],lightcoral:[240/255,128/255,128/255],lightcyan:[224/255,1,1],lightgoldenrodyellow:[250/255,250/255,210/255],lightgray:[211/255,211/255,211/255],lightgreen:[144/255,238/255,144/255],lightgrey:[211/255,211/255,211/255],lightpink:[1,182/255,193/255],lightsalmon:[1,160/255,122/255],lightseagreen:[32/255,178/255,170/255],lightskyblue:[135/255,206/255,250/255],lightslategray:[119/255,136/255,153/255],lightslategrey:[119/255,136/255,153/255],lightsteelblue:[176/255,196/255,222/255],lightyellow:[1,1,224/255],lime:[0,1,0],limegreen:[50/255,205/255,50/255],linen:[250/255,240/255,230/255],magenta:[1,0,1],maroon:[128/255,0,0],mediumaquamarine:[102/255,205/255,170/255],mediumblue:[0,0,205/255],mediumorchid:[186/255,85/255,211/255],mediumpurple:[147/255,112/255,219/255],mediumseagreen:[60/255,179/255,113/255],mediumslateblue:[123/255,104/255,238/255],mediumspringgreen:[0,250/255,154/255],mediumturquoise:[72/255,209/255,204/255],mediumvioletred:[199/255,21/255,133/255],midnightblue:[25/255,25/255,112/255],mintcream:[245/255,1,250/255],mistyrose:[1,228/255,225/255],moccasin:[1,228/255,181/255],navajowhite:[1,222/255,173/255],navy:[0,0,128/255],oldlace:[253/255,245/255,230/255],olive:[128/255,128/255,0],olivedrab:[107/255,142/255,35/255],orange:[1,165/255,0],orangered:[1,69/255,0],orchid:[218/255,112/255,214/255],palegoldenrod:[238/255,232/255,170/255],palegreen:[152/255,251/255,152/255],paleturquoise:[175/255,238/255,238/255],palevioletred:[219/255,112/255,147/255],papayawhip:[1,239/255,213/255],peachpuff:[1,218/255,185/255],peru:[205/255,133/255,63/255],pink:[1,192/255,203/255],plum:[221/255,160/255,221/255],powderblue:[176/255,224/255,230/255],purple:[128/255,0,128/255],rebeccapurple:[102/255,51/255,153/255],red:[1,0,0],rosybrown:[188/255,143/255,143/255],royalblue:[65/255,105/255,225/255],saddlebrown:[139/255,69/255,19/255],salmon:[250/255,128/255,114/255],sandybrown:[244/255,164/255,96/255],seagreen:[46/255,139/255,87/255],seashell:[1,245/255,238/255],sienna:[160/255,82/255,45/255],silver:[192/255,192/255,192/255],skyblue:[135/255,206/255,235/255],slateblue:[106/255,90/255,205/255],slategray:[112/255,128/255,144/255],slategrey:[112/255,128/255,144/255],snow:[1,250/255,250/255],springgreen:[0,1,127/255],steelblue:[70/255,130/255,180/255],tan:[210/255,180/255,140/255],teal:[0,128/255,128/255],thistle:[216/255,191/255,216/255],tomato:[1,99/255,71/255],turquoise:[64/255,224/255,208/255],violet:[238/255,130/255,238/255],wheat:[245/255,222/255,179/255],white:[1,1,1],whitesmoke:[245/255,245/255,245/255],yellow:[1,1,0],yellowgreen:[154/255,205/255,50/255]};let Ab=Array(3).fill("<percentage> | <number>[0, 255]"),Ob=Array(3).fill("<number>[0, 255]");const Mb=new qy({id:"srgb",name:"sRGB",base:XN,fromBase:n=>n.map(e=>{let t=e<0?-1:1,r=e*t;return r>.0031308?t*(1.055*r**(1/2.4)-.055):12.92*e}),toBase:n=>n.map(e=>{let t=e<0?-1:1,r=e*t;return r<=.04045?e/12.92:t*((r+.055)/1.055)**2.4}),formats:{rgb:{coords:Ab},rgb_number:{name:"rgb",commas:!0,coords:Ob,noAlpha:!0},color:{},rgba:{coords:Ab,commas:!0,lastAlpha:!0},rgba_number:{name:"rgba",commas:!0,coords:Ob},hex:{type:"custom",toGamut:!0,test:n=>/^#([a-f0-9]{3,4}){1,2}$/i.test(n),parse(n){n.length<=5&&(n=n.replace(/[a-f0-9]/gi,"$&$&"));let e=[];return n.replace(/[a-f0-9]{2}/gi,t=>{e.push(parseInt(t,16)/255)}),{spaceId:"srgb",coords:e.slice(0,3),alpha:e.slice(3)[0]}},serialize:(n,e,{collapse:t=!0}={})=>{e<1&&n.push(e),n=n.map(s=>Math.round(s*255));let r=t&&n.every(s=>s%17===0);return"#"+n.map(s=>r?(s/17).toString(16):s.toString(16).padStart(2,"0")).join("")}},keyword:{type:"custom",test:n=>/^[a-z]+$/i.test(n),parse(n){n=n.toLowerCase();let e={spaceId:"srgb",coords:null,alpha:1};if(n==="transparent"?(e.coords=Tb.black,e.alpha=0):e.coords=Tb[n],e.coords)return e}}}});function ZN(n){return Xn(n,[Yn,"y"])}const Ib=new le({id:"hsl",name:"HSL",coords:{h:{refRange:[0,360],type:"angle",name:"Hue"},s:{range:[0,100],name:"Saturation"},l:{range:[0,100],name:"Lightness"}},base:Mb,fromBase:n=>{let e=Math.max(...n),t=Math.min(...n),[r,i,s]=n,[a,u,c]=[NaN,0,(t+e)/2],h=e-t;if(h!==0){switch(u=c===0||c===1?0:(e-c)/Math.min(c,1-c),e){case r:a=(i-s)/h+(i<s?6:0);break;case i:a=(s-r)/h+2;break;case s:a=(r-i)/h+4}a=a*60}return u<0&&(a+=180,u=Math.abs(u)),a>=360&&(a-=360),[a,u*100,c*100]},toBase:n=>{let[e,t,r]=n;e=e%360,e<0&&(e+=360),t/=100,r/=100;function i(s){let a=(s+e/30)%12,u=t*Math.min(r,1-r);return r-u*Math.max(-1,Math.min(a-3,9-a,1))}return[i(0),i(8),i(4)]},formats:{hsl:{coords:["<number> | <angle>","<percentage>","<percentage>"]},hsla:{coords:["<number> | <angle>","<percentage>","<percentage>"],commas:!0,lastAlpha:!0}}}),QN=new le({id:"hsv",name:"HSV",coords:{h:{refRange:[0,360],type:"angle",name:"Hue"},s:{range:[0,100],name:"Saturation"},v:{range:[0,100],name:"Value"}},base:Ib,fromBase(n){let[e,t,r]=n;t/=100,r/=100;let i=r+t*Math.min(r,1-r);return[e,i===0?0:200*(1-r/i),100*i]},toBase(n){let[e,t,r]=n;t/=100,r/=100;let i=r*(1-t/2);return[e,i===0||i===1?0:(r-i)/Math.min(i,1-i)*100,i*100]},formats:{color:{id:"--hsv",coords:["<number> | <angle>","<percentage> | <number>","<percentage> | <number>"]}}}),eR=new le({id:"oklch",name:"Oklch",coords:{l:{refRange:[0,1],name:"Lightness"},c:{refRange:[0,.4],name:"Chroma"},h:{refRange:[0,360],type:"angle",name:"Hue"}},white:"D65",base:to,fromBase(n){let[e,t,r]=n,i;const s=2e-4;return Math.abs(t)<s&&Math.abs(r)<s?i=NaN:i=Math.atan2(r,t)*180/Math.PI,[e,Math.sqrt(t**2+r**2),Or(i)]},toBase(n){let[e,t,r]=n,i,s;return isNaN(r)?(i=0,s=0):(i=t*Math.cos(r*Math.PI/180),s=t*Math.sin(r*Math.PI/180)),[e,i,s]},formats:{oklch:{coords:["<percentage> | <number>","<number> | <percentage>[0,1]","<number> | <angle>"]}}});class Dt{constructor(e){Gn(this,"data"),this.data=He(e,"srgb")}static fromTransparent(){return new Dt({spaceId:"srgb",coords:[1,1,1],alpha:0})}static fromBlack(){return new Dt({spaceId:"srgb",coords:[0,0,0],alpha:1})}static fromWhite(){return new Dt({spaceId:"srgb",coords:[1,1,1],alpha:1})}get r(){return Math.round(this.data.coords[0]*255)}get g(){return Math.round(this.data.coords[1]*255)}get b(){return Math.round(this.data.coords[2]*255)}get h(){return Xn(this.data,"hsv.h")}get s(){return Xn(this.data,"hsv.s")}get v(){return Xn(this.data,"hsv.v")}get alpha(){return this.data.alpha.valueOf()}get alphaPercent(){return Math.round(this.alpha*100)}get isTransparent(){return this.alpha===0}get isDark(){return ZN(this.data)<.5}withAlpha(e){return new Dt({...this.data,alpha:e})}withRgb(e){const t=this.alpha===0?1:this.alpha;return new Dt({spaceId:"srgb",alpha:e.a??t,coords:[e.r?e.r/255:this.data.coords[0],e.g?e.g/255:this.data.coords[1],e.b?e.b/255:this.data.coords[2]]})}withHsv(e){const r=Uh(this.data,"hsv"),i=Math.max(e.s??r[1],1e-5),s=Math.max(e.v??r[2],1e-5),a=this.alpha===0?1:this.alpha;return new Dt({alpha:a,spaceId:"hsv",coords:[e.h??r[0],i,s]})}toString(){return this.alpha===1?this.toHexString():this.toRgbaString()}toHexString(){const e=JN(this.data,{format:"hex"}).toUpperCase();return e.length===4?`#${e[1]}${e[1]}${e[2]}${e[2]}${e[3]}${e[3]}`:e.slice(0,7)}toRgbaString(){return`rgba(${this.r}, ${this.g}, ${this.b}, ${this.alphaPercent}%)`}clone(){return new Dt(this.data)}}class tR{constructor(e){Gn(this,"_color"),Gn(this,"isEmpty",!1),this.update(e)}get color(){return this._color}setColor(e){this._color=e}setEmpty(e){this.isEmpty=e}toString(){return this.isEmpty?"":this.color.toString()}isEqual(e){return this.toString()===e}update({solidColor:e,isEmpty:t}){this.setColor(e),this.setEmpty(t)}}let Nb=999;function nR(){return Nb+=1,Nb}function rR(n){return n?n.startsWith("linear-gradient("):!1}function iR(){const n=Dt.fromTransparent();return{isEmpty:!0,isGradient:!1,solidColor:n,angle:0,transitions:[{color:n.clone(),offset:0},{color:n.clone(),offset:100}]}}le.register(Mb),le.register(QN),le.register(Ib),le.register(eR);function Rb(n){if(!n)return Dt.fromTransparent();try{return new Dt(He(Vy(n),"srgb"))}catch(e){return console.warn(e),Dt.fromBlack()}}function sR(n){const e={"to top":0,"to top right":45,"to right":90,"to bottom right":135,"to bottom":180,"to bottom left":225,"to left":270,"to top left":315};return e[n]?e[n]:n.includes("deg")?Number.parseInt(n.trim().replace("deg","")):0}function oR(n){return n.map(e=>{const[t,r]=e.trim().split(/\s+(?![^(]*\))/);return{color:Rb(t),offset:Number.parseFloat(r.replace("%",""))}})}function aR(n){const e=n.indexOf("("),t=n.lastIndexOf(")"),[r,...i]=n.slice(e+1,t).split(/,(?![^(]*\))/),s=oR(i),a=sR(r);return{isEmpty:!1,isGradient:!0,solidColor:s[0].color,angle:a,transitions:s}}function lR(n){const e=Rb(n),t=Dt.fromWhite();return{isEmpty:!1,isGradient:!1,solidColor:e,angle:0,transitions:[{color:t,offset:0},{color:e.withAlpha(1),offset:100}]}}function uR(n,e=!0){if(!n)return iR();const t=rR(n)?aR(n):lR(n);return t.isGradient&&!e?{...t,isGradient:!1}:t}class od{constructor(e,t=0){Gn(this,"id"),this.color=e,this.offset=t,this.id=nR()}setOffset(e){this.offset=e}toString(){return`${this.color.toString()} ${this.offset}%`}clone(e){return new od(this.color.clone(),e)}}class cR{constructor(e){Gn(this,"isEmpty",!1),Gn(this,"_angle",0),Gn(this,"_transitions",[]),this.update(e)}get transitions(){return this._transitions}get canAddTransition(){return this.transitions.length<5}get canRemoveTransition(){return this.transitions.length>2}get angle(){return this._angle}setAngle(e){this._angle=e}setEmpty(e){this.isEmpty=e}addTransition(e){this.transitions.push(e),this.sortTransitions()}removeTransition(e){this._transitions=this.transitions.filter(({id:t})=>t!==e.id)}sortTransitions(){this._transitions=this.transitions.sort((e,t)=>e.offset-t.offset)}toString(e){if(this.isEmpty)return"";const t=this.transitions.map(r=>r.toString());return`linear-gradient(${e??this.angle}deg, ${t.join(", ")})`}isEqual(e){return this.toString()===e}update(e){this._angle=e.angle,this._transitions=e.transitions.map(({color:t,offset:r})=>new od(t,r)),this.setEmpty(e.isEmpty)}hasTransition(e){return this.transitions.some(t=>t.id===e.id)}}function fR(n){const e=uR(n);return(e.isGradient?new cR(e):new tR(e)).toString()}function Lb(n){return fR(n)}function Pb(n,e){if(!n.includes("em"))return parseInt(n);const t=ji.getComputedStyle(e).fontSize,r=parseFloat(n)*parseFloat(t);return Math.round(r)}function hR(n,e){return(n.firstElementChild||n).style.fontSize||ji.getComputedStyle(e).fontSize}function dR(n,e,t){if(!n.includes("px"))return n;const r=hR(e,t),i=Pb(r,t);return i?(parseInt(n)/i).toFixed(2):null}const pR={start:xr.LEFT,end:xr.RIGHT};function mR(n){const e=pR[n]||n;return IM.includes(e)?e:null}const Db=(n,e,t,r)=>({from:Math.max(r,n.pos),to:Math.min(r+t.nodeSize,e.pos)});function $b(n,e){return n.resolve(e).depth+1}function gR(n,e,t,r){const i=$b(n,r),s=e.from-i<=r,a=e.to+i>=t.nodeSize+r;return s&&a}const yR=(n,e)=>n.eq(e);function bR(n,e,t,r=yR){const i=n.resolve(e).path.slice().reverse();for(const s of i)if(typeof s!="number"){for(const a of s.marks)if(r(a,t))return!0}return!1}function _R(n,e){const t=typeof e=="string"?e:e.name;return n.find(r=>r.type.name===t)}var ro={exports:{}};var wR=ro.exports,Fb;function vR(){return Fb||(Fb=1,function(n,e){(function(){var t,r="4.17.21",i=200,s="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",a="Expected a function",u="Invalid `variable` option passed into `_.template`",c="__lodash_hash_undefined__",h=500,m="__lodash_placeholder__",d=1,y=2,_=4,v=1,E=2,N=1,g=2,S=4,k=8,T=16,A=32,$=64,U=128,z=256,ee=512,te=30,Se="...",vt=800,Cn=16,$t=1,kn=2,We=3,St=1/0,er=9007199254740991,lo=17976931348623157e292,hn=NaN,xt=4294967295,lu=xt-1,uu=xt>>>1,cu=[["ary",U],["bind",N],["bindKey",g],["curry",k],["curryRight",T],["flip",ee],["partial",A],["partialRight",$],["rearg",z]],Qt="[object Arguments]",uo="[object Array]",jb="[object AsyncFunction]",es="[object Boolean]",ts="[object Date]",Yb="[object DOMException]",co="[object Error]",fo="[object Function]",ud="[object GeneratorFunction]",en="[object Map]",ns="[object Number]",Xb="[object Null]",Tn="[object Object]",cd="[object Promise]",Zb="[object Proxy]",rs="[object RegExp]",tn="[object Set]",is="[object String]",ho="[object Symbol]",Qb="[object Undefined]",ss="[object WeakMap]",e_="[object WeakSet]",as="[object ArrayBuffer]",ui="[object DataView]",fu="[object Float32Array]",hu="[object Float64Array]",du="[object Int8Array]",pu="[object Int16Array]",mu="[object Int32Array]",gu="[object Uint8Array]",yu="[object Uint8ClampedArray]",bu="[object Uint16Array]",_u="[object Uint32Array]",t_=/\b__p \+= '';/g,n_=/\b(__p \+=) '' \+/g,r_=/(__e\(.*?\)|\b__t\)) \+\n'';/g,fd=/&(?:amp|lt|gt|quot|#39);/g,hd=/[&<>"']/g,i_=RegExp(fd.source),s_=RegExp(hd.source),o_=/<%-([\s\S]+?)%>/g,a_=/<%([\s\S]+?)%>/g,dd=/<%=([\s\S]+?)%>/g,l_=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,u_=/^\w*$/,c_=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,wu=/[\\^$.*+?()[\]{}|]/g,f_=RegExp(wu.source),vu=/^\s+/,h_=/\s/,d_=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,p_=/\{\n\/\* \[wrapped with (.+)\] \*/,m_=/,? & /,g_=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,y_=/[()=,{}\[\]\/\s]/,b_=/\\(\\)?/g,__=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,pd=/\w*$/,w_=/^[-+]0x[0-9a-f]+$/i,v_=/^0b[01]+$/i,S_=/^\[object .+?Constructor\]$/,x_=/^0o[0-7]+$/i,E_=/^(?:0|[1-9]\d*)$/,C_=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,po=/($^)/,k_=/['\n\r\u2028\u2029\\]/g,mo="\\ud800-\\udfff",T_="\\u0300-\\u036f",A_="\\ufe20-\\ufe2f",O_="\\u20d0-\\u20ff",md=T_+A_+O_,gd="\\u2700-\\u27bf",yd="a-z\\xdf-\\xf6\\xf8-\\xff",M_="\\xac\\xb1\\xd7\\xf7",I_="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",N_="\\u2000-\\u206f",R_=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",bd="A-Z\\xc0-\\xd6\\xd8-\\xde",_d="\\ufe0e\\ufe0f",wd=M_+I_+N_+R_,Su="['\u2019]",L_="["+mo+"]",vd="["+wd+"]",go="["+md+"]",Sd="\\d+",P_="["+gd+"]",xd="["+yd+"]",Ed="[^"+mo+wd+Sd+gd+yd+bd+"]",xu="\\ud83c[\\udffb-\\udfff]",D_="(?:"+go+"|"+xu+")",Cd="[^"+mo+"]",Eu="(?:\\ud83c[\\udde6-\\uddff]){2}",Cu="[\\ud800-\\udbff][\\udc00-\\udfff]",ci="["+bd+"]",kd="\\u200d",Td="(?:"+xd+"|"+Ed+")",$_="(?:"+ci+"|"+Ed+")",Ad="(?:"+Su+"(?:d|ll|m|re|s|t|ve))?",Od="(?:"+Su+"(?:D|LL|M|RE|S|T|VE))?",Md=D_+"?",Id="["+_d+"]?",F_="(?:"+kd+"(?:"+[Cd,Eu,Cu].join("|")+")"+Id+Md+")*",B_="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",z_="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Nd=Id+Md+F_,H_="(?:"+[P_,Eu,Cu].join("|")+")"+Nd,W_="(?:"+[Cd+go+"?",go,Eu,Cu,L_].join("|")+")",V_=RegExp(Su,"g"),U_=RegExp(go,"g"),ku=RegExp(xu+"(?="+xu+")|"+W_+Nd,"g"),q_=RegExp([ci+"?"+xd+"+"+Ad+"(?="+[vd,ci,"$"].join("|")+")",$_+"+"+Od+"(?="+[vd,ci+Td,"$"].join("|")+")",ci+"?"+Td+"+"+Ad,ci+"+"+Od,z_,B_,Sd,H_].join("|"),"g"),K_=RegExp("["+kd+mo+md+_d+"]"),G_=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,J_=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],j_=-1,Ce={};Ce[fu]=Ce[hu]=Ce[du]=Ce[pu]=Ce[mu]=Ce[gu]=Ce[yu]=Ce[bu]=Ce[_u]=!0,Ce[Qt]=Ce[uo]=Ce[as]=Ce[es]=Ce[ui]=Ce[ts]=Ce[co]=Ce[fo]=Ce[en]=Ce[ns]=Ce[Tn]=Ce[rs]=Ce[tn]=Ce[is]=Ce[ss]=!1;var Ee={};Ee[Qt]=Ee[uo]=Ee[as]=Ee[ui]=Ee[es]=Ee[ts]=Ee[fu]=Ee[hu]=Ee[du]=Ee[pu]=Ee[mu]=Ee[en]=Ee[ns]=Ee[Tn]=Ee[rs]=Ee[tn]=Ee[is]=Ee[ho]=Ee[gu]=Ee[yu]=Ee[bu]=Ee[_u]=!0,Ee[co]=Ee[fo]=Ee[ss]=!1;var Y_={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"s"},X_={"&":"&","<":"<",">":">",'"':""","'":"'"},Z_={"&":"&","<":"<",">":">",""":'"',"'":"'"},Q_={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},e2=parseFloat,t2=parseInt,Rd=typeof na=="object"&&na&&na.Object===Object&&na,n2=typeof self=="object"&&self&&self.Object===Object&&self,Xe=Rd||n2||Function("return this")(),Tu=e&&!e.nodeType&&e,Rr=Tu&&!0&&n&&!n.nodeType&&n,Ld=Rr&&Rr.exports===Tu,Au=Ld&&Rd.process,Ft=function(){try{var M=Rr&&Rr.require&&Rr.require("util").types;return M||Au&&Au.binding&&Au.binding("util")}catch{}}(),Pd=Ft&&Ft.isArrayBuffer,Dd=Ft&&Ft.isDate,$d=Ft&&Ft.isMap,Fd=Ft&&Ft.isRegExp,Bd=Ft&&Ft.isSet,zd=Ft&&Ft.isTypedArray;function Et(M,L,R){switch(R.length){case 0:return M.call(L);case 1:return M.call(L,R[0]);case 2:return M.call(L,R[0],R[1]);case 3:return M.call(L,R[0],R[1],R[2])}return M.apply(L,R)}function r2(M,L,R,G){for(var ne=-1,be=M==null?0:M.length;++ne<be;){var Fe=M[ne];L(G,Fe,R(Fe),M)}return G}function Bt(M,L){for(var R=-1,G=M==null?0:M.length;++R<G&&L(M[R],R,M)!==!1;);return M}function i2(M,L){for(var R=M==null?0:M.length;R--&&L(M[R],R,M)!==!1;);return M}function Hd(M,L){for(var R=-1,G=M==null?0:M.length;++R<G;)if(!L(M[R],R,M))return!1;return!0}function tr(M,L){for(var R=-1,G=M==null?0:M.length,ne=0,be=[];++R<G;){var Fe=M[R];L(Fe,R,M)&&(be[ne++]=Fe)}return be}function yo(M,L){var R=M==null?0:M.length;return!!R&&fi(M,L,0)>-1}function Ou(M,L,R){for(var G=-1,ne=M==null?0:M.length;++G<ne;)if(R(L,M[G]))return!0;return!1}function Te(M,L){for(var R=-1,G=M==null?0:M.length,ne=Array(G);++R<G;)ne[R]=L(M[R],R,M);return ne}function nr(M,L){for(var R=-1,G=L.length,ne=M.length;++R<G;)M[ne+R]=L[R];return M}function Mu(M,L,R,G){var ne=-1,be=M==null?0:M.length;for(G&&be&&(R=M[++ne]);++ne<be;)R=L(R,M[ne],ne,M);return R}function s2(M,L,R,G){var ne=M==null?0:M.length;for(G&&ne&&(R=M[--ne]);ne--;)R=L(R,M[ne],ne,M);return R}function Iu(M,L){for(var R=-1,G=M==null?0:M.length;++R<G;)if(L(M[R],R,M))return!0;return!1}var o2=Nu("length");function a2(M){return M.split("")}function l2(M){return M.match(g_)||[]}function Wd(M,L,R){var G;return R(M,function(ne,be,Fe){if(L(ne,be,Fe))return G=be,!1}),G}function bo(M,L,R,G){for(var ne=M.length,be=R+(G?1:-1);G?be--:++be<ne;)if(L(M[be],be,M))return be;return-1}function fi(M,L,R){return L===L?w2(M,L,R):bo(M,Vd,R)}function u2(M,L,R,G){for(var ne=R-1,be=M.length;++ne<be;)if(G(M[ne],L))return ne;return-1}function Vd(M){return M!==M}function Ud(M,L){var R=M==null?0:M.length;return R?Lu(M,L)/R:hn}function Nu(M){return function(L){return L==null?t:L[M]}}function Ru(M){return function(L){return M==null?t:M[L]}}function qd(M,L,R,G,ne){return ne(M,function(be,Fe,xe){R=G?(G=!1,be):L(R,be,Fe,xe)}),R}function c2(M,L){var R=M.length;for(M.sort(L);R--;)M[R]=M[R].value;return M}function Lu(M,L){for(var R,G=-1,ne=M.length;++G<ne;){var be=L(M[G]);be!==t&&(R=R===t?be:R+be)}return R}function Pu(M,L){for(var R=-1,G=Array(M);++R<M;)G[R]=L(R);return G}function f2(M,L){return Te(L,function(R){return[R,M[R]]})}function Kd(M){return M&&M.slice(0,Yd(M)+1).replace(vu,"")}function Ct(M){return function(L){return M(L)}}function Du(M,L){return Te(L,function(R){return M[R]})}function ls(M,L){return M.has(L)}function Gd(M,L){for(var R=-1,G=M.length;++R<G&&fi(L,M[R],0)>-1;);return R}function Jd(M,L){for(var R=M.length;R--&&fi(L,M[R],0)>-1;);return R}function h2(M,L){for(var R=M.length,G=0;R--;)M[R]===L&&++G;return G}var d2=Ru(Y_),p2=Ru(X_);function m2(M){return"\\"+Q_[M]}function g2(M,L){return M==null?t:M[L]}function hi(M){return K_.test(M)}function y2(M){return G_.test(M)}function b2(M){for(var L,R=[];!(L=M.next()).done;)R.push(L.value);return R}function $u(M){var L=-1,R=Array(M.size);return M.forEach(function(G,ne){R[++L]=[ne,G]}),R}function jd(M,L){return function(R){return M(L(R))}}function rr(M,L){for(var R=-1,G=M.length,ne=0,be=[];++R<G;){var Fe=M[R];(Fe===L||Fe===m)&&(M[R]=m,be[ne++]=R)}return be}function _o(M){var L=-1,R=Array(M.size);return M.forEach(function(G){R[++L]=G}),R}function _2(M){var L=-1,R=Array(M.size);return M.forEach(function(G){R[++L]=[G,G]}),R}function w2(M,L,R){for(var G=R-1,ne=M.length;++G<ne;)if(M[G]===L)return G;return-1}function v2(M,L,R){for(var G=R+1;G--;)if(M[G]===L)return G;return G}function di(M){return hi(M)?x2(M):o2(M)}function nn(M){return hi(M)?E2(M):a2(M)}function Yd(M){for(var L=M.length;L--&&h_.test(M.charAt(L)););return L}var S2=Ru(Z_);function x2(M){for(var L=ku.lastIndex=0;ku.test(M);)++L;return L}function E2(M){return M.match(ku)||[]}function C2(M){return M.match(q_)||[]}var k2=function M(L){L=L==null?Xe:pi.defaults(Xe.Object(),L,pi.pick(Xe,J_));var R=L.Array,G=L.Date,ne=L.Error,be=L.Function,Fe=L.Math,xe=L.Object,Fu=L.RegExp,T2=L.String,zt=L.TypeError,wo=R.prototype,A2=be.prototype,mi=xe.prototype,vo=L["__core-js_shared__"],So=A2.toString,ve=mi.hasOwnProperty,O2=0,Xd=function(){var o=/[^.]+$/.exec(vo&&vo.keys&&vo.keys.IE_PROTO||"");return o?"Symbol(src)_1."+o:""}(),xo=mi.toString,M2=So.call(xe),I2=Xe._,N2=Fu("^"+So.call(ve).replace(wu,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Eo=Ld?L.Buffer:t,ir=L.Symbol,Co=L.Uint8Array,Zd=Eo?Eo.allocUnsafe:t,ko=jd(xe.getPrototypeOf,xe),Qd=xe.create,ep=mi.propertyIsEnumerable,To=wo.splice,tp=ir?ir.isConcatSpreadable:t,us=ir?ir.iterator:t,Lr=ir?ir.toStringTag:t,Ao=function(){try{var o=Br(xe,"defineProperty");return o({},"",{}),o}catch{}}(),R2=L.clearTimeout!==Xe.clearTimeout&&L.clearTimeout,L2=G&&G.now!==Xe.Date.now&&G.now,P2=L.setTimeout!==Xe.setTimeout&&L.setTimeout,Oo=Fe.ceil,Mo=Fe.floor,Bu=xe.getOwnPropertySymbols,D2=Eo?Eo.isBuffer:t,np=L.isFinite,$2=wo.join,F2=jd(xe.keys,xe),Be=Fe.max,nt=Fe.min,B2=G.now,z2=L.parseInt,rp=Fe.random,H2=wo.reverse,zu=Br(L,"DataView"),cs=Br(L,"Map"),Hu=Br(L,"Promise"),gi=Br(L,"Set"),fs=Br(L,"WeakMap"),hs=Br(xe,"create"),Io=fs&&new fs,yi={},W2=zr(zu),V2=zr(cs),U2=zr(Hu),q2=zr(gi),K2=zr(fs),No=ir?ir.prototype:t,ds=No?No.valueOf:t,ip=No?No.toString:t;function w(o){if(Ie(o)&&!re(o)&&!(o instanceof fe)){if(o instanceof Ht)return o;if(ve.call(o,"__wrapped__"))return sm(o)}return new Ht(o)}var bi=function(){function o(){}return function(l){if(!Me(l))return{};if(Qd)return Qd(l);o.prototype=l;var f=new o;return o.prototype=t,f}}();function Ro(){}function Ht(o,l){this.__wrapped__=o,this.__actions__=[],this.__chain__=!!l,this.__index__=0,this.__values__=t}w.templateSettings={escape:o_,evaluate:a_,interpolate:dd,variable:"",imports:{_:w}},w.prototype=Ro.prototype,w.prototype.constructor=w,Ht.prototype=bi(Ro.prototype),Ht.prototype.constructor=Ht;function fe(o){this.__wrapped__=o,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=xt,this.__views__=[]}function G2(){var o=new fe(this.__wrapped__);return o.__actions__=dt(this.__actions__),o.__dir__=this.__dir__,o.__filtered__=this.__filtered__,o.__iteratees__=dt(this.__iteratees__),o.__takeCount__=this.__takeCount__,o.__views__=dt(this.__views__),o}function J2(){if(this.__filtered__){var o=new fe(this);o.__dir__=-1,o.__filtered__=!0}else o=this.clone(),o.__dir__*=-1;return o}function j2(){var o=this.__wrapped__.value(),l=this.__dir__,f=re(o),p=l<0,b=f?o.length:0,x=av(0,b,this.__views__),C=x.start,O=x.end,I=O-C,P=p?O:C-1,D=this.__iteratees__,F=D.length,q=0,j=nt(I,this.__takeCount__);if(!f||!p&&b==I&&j==I)return Ap(o,this.__actions__);var X=[];e:for(;I--&&q<j;){P+=l;for(var se=-1,Z=o[P];++se<F;){var ce=D[se],me=ce.iteratee,At=ce.type,ot=me(Z);if(At==kn)Z=ot;else if(!ot){if(At==$t)continue e;break e}}X[q++]=Z}return X}fe.prototype=bi(Ro.prototype),fe.prototype.constructor=fe;function Pr(o){var l=-1,f=o==null?0:o.length;for(this.clear();++l<f;){var p=o[l];this.set(p[0],p[1])}}function Y2(){this.__data__=hs?hs(null):{},this.size=0}function X2(o){var l=this.has(o)&&delete this.__data__[o];return this.size-=l?1:0,l}function Z2(o){var l=this.__data__;if(hs){var f=l[o];return f===c?t:f}return ve.call(l,o)?l[o]:t}function Q2(o){var l=this.__data__;return hs?l[o]!==t:ve.call(l,o)}function ew(o,l){var f=this.__data__;return this.size+=this.has(o)?0:1,f[o]=hs&&l===t?c:l,this}Pr.prototype.clear=Y2,Pr.prototype.delete=X2,Pr.prototype.get=Z2,Pr.prototype.has=Q2,Pr.prototype.set=ew;function An(o){var l=-1,f=o==null?0:o.length;for(this.clear();++l<f;){var p=o[l];this.set(p[0],p[1])}}function tw(){this.__data__=[],this.size=0}function nw(o){var l=this.__data__,f=Lo(l,o);if(f<0)return!1;var p=l.length-1;return f==p?l.pop():To.call(l,f,1),--this.size,!0}function rw(o){var l=this.__data__,f=Lo(l,o);return f<0?t:l[f][1]}function iw(o){return Lo(this.__data__,o)>-1}function sw(o,l){var f=this.__data__,p=Lo(f,o);return p<0?(++this.size,f.push([o,l])):f[p][1]=l,this}An.prototype.clear=tw,An.prototype.delete=nw,An.prototype.get=rw,An.prototype.has=iw,An.prototype.set=sw;function On(o){var l=-1,f=o==null?0:o.length;for(this.clear();++l<f;){var p=o[l];this.set(p[0],p[1])}}function ow(){this.size=0,this.__data__={hash:new Pr,map:new(cs||An),string:new Pr}}function aw(o){var l=Ko(this,o).delete(o);return this.size-=l?1:0,l}function lw(o){return Ko(this,o).get(o)}function uw(o){return Ko(this,o).has(o)}function cw(o,l){var f=Ko(this,o),p=f.size;return f.set(o,l),this.size+=f.size==p?0:1,this}On.prototype.clear=ow,On.prototype.delete=aw,On.prototype.get=lw,On.prototype.has=uw,On.prototype.set=cw;function Dr(o){var l=-1,f=o==null?0:o.length;for(this.__data__=new On;++l<f;)this.add(o[l])}function fw(o){return this.__data__.set(o,c),this}function hw(o){return this.__data__.has(o)}Dr.prototype.add=Dr.prototype.push=fw,Dr.prototype.has=hw;function rn(o){var l=this.__data__=new An(o);this.size=l.size}function dw(){this.__data__=new An,this.size=0}function pw(o){var l=this.__data__,f=l.delete(o);return this.size=l.size,f}function mw(o){return this.__data__.get(o)}function gw(o){return this.__data__.has(o)}function yw(o,l){var f=this.__data__;if(f instanceof An){var p=f.__data__;if(!cs||p.length<i-1)return p.push([o,l]),this.size=++f.size,this;f=this.__data__=new On(p)}return f.set(o,l),this.size=f.size,this}rn.prototype.clear=dw,rn.prototype.delete=pw,rn.prototype.get=mw,rn.prototype.has=gw,rn.prototype.set=yw;function sp(o,l){var f=re(o),p=!f&&Hr(o),b=!f&&!p&&ur(o),x=!f&&!p&&!b&&Si(o),C=f||p||b||x,O=C?Pu(o.length,T2):[],I=O.length;for(var P in o)(l||ve.call(o,P))&&!(C&&(P=="length"||b&&(P=="offset"||P=="parent")||x&&(P=="buffer"||P=="byteLength"||P=="byteOffset")||Rn(P,I)))&&O.push(P);return O}function op(o){var l=o.length;return l?o[Zu(0,l-1)]:t}function bw(o,l){return Go(dt(o),$r(l,0,o.length))}function _w(o){return Go(dt(o))}function Wu(o,l,f){(f!==t&&!sn(o[l],f)||f===t&&!(l in o))&&Mn(o,l,f)}function ps(o,l,f){var p=o[l];(!(ve.call(o,l)&&sn(p,f))||f===t&&!(l in o))&&Mn(o,l,f)}function Lo(o,l){for(var f=o.length;f--;)if(sn(o[f][0],l))return f;return-1}function ww(o,l,f,p){return sr(o,function(b,x,C){l(p,b,f(b),C)}),p}function ap(o,l){return o&&pn(l,Ve(l),o)}function vw(o,l){return o&&pn(l,mt(l),o)}function Mn(o,l,f){l=="__proto__"&&Ao?Ao(o,l,{configurable:!0,enumerable:!0,value:f,writable:!0}):o[l]=f}function Vu(o,l){for(var f=-1,p=l.length,b=R(p),x=o==null;++f<p;)b[f]=x?t:xc(o,l[f]);return b}function $r(o,l,f){return o===o&&(f!==t&&(o=o<=f?o:f),l!==t&&(o=o>=l?o:l)),o}function Wt(o,l,f,p,b,x){var C,O=l&d,I=l&y,P=l&_;if(f&&(C=b?f(o,p,b,x):f(o)),C!==t)return C;if(!Me(o))return o;var D=re(o);if(D){if(C=uv(o),!O)return dt(o,C)}else{var F=rt(o),q=F==fo||F==ud;if(ur(o))return Ip(o,O);if(F==Tn||F==Qt||q&&!b){if(C=I||q?{}:Yp(o),!O)return I?Zw(o,vw(C,o)):Xw(o,ap(C,o))}else{if(!Ee[F])return b?o:{};C=cv(o,F,O)}}x||(x=new rn);var j=x.get(o);if(j)return j;x.set(o,C),Cm(o)?o.forEach(function(Z){C.add(Wt(Z,l,f,Z,o,x))}):xm(o)&&o.forEach(function(Z,ce){C.set(ce,Wt(Z,l,f,ce,o,x))});var X=P?I?uc:lc:I?mt:Ve,se=D?t:X(o);return Bt(se||o,function(Z,ce){se&&(ce=Z,Z=o[ce]),ps(C,ce,Wt(Z,l,f,ce,o,x))}),C}function Sw(o){var l=Ve(o);return function(f){return lp(f,o,l)}}function lp(o,l,f){var p=f.length;if(o==null)return!p;for(o=xe(o);p--;){var b=f[p],x=l[b],C=o[b];if(C===t&&!(b in o)||!x(C))return!1}return!0}function up(o,l,f){if(typeof o!="function")throw new zt(a);return vs(function(){o.apply(t,f)},l)}function ms(o,l,f,p){var b=-1,x=yo,C=!0,O=o.length,I=[],P=l.length;if(!O)return I;f&&(l=Te(l,Ct(f))),p?(x=Ou,C=!1):l.length>=i&&(x=ls,C=!1,l=new Dr(l));e:for(;++b<O;){var D=o[b],F=f==null?D:f(D);if(D=p||D!==0?D:0,C&&F===F){for(var q=P;q--;)if(l[q]===F)continue e;I.push(D)}else x(l,F,p)||I.push(D)}return I}var sr=Dp(dn),cp=Dp(qu,!0);function xw(o,l){var f=!0;return sr(o,function(p,b,x){return f=!!l(p,b,x),f}),f}function Po(o,l,f){for(var p=-1,b=o.length;++p<b;){var x=o[p],C=l(x);if(C!=null&&(O===t?C===C&&!Tt(C):f(C,O)))var O=C,I=x}return I}function Ew(o,l,f,p){var b=o.length;for(f=ie(f),f<0&&(f=-f>b?0:b+f),p=p===t||p>b?b:ie(p),p<0&&(p+=b),p=f>p?0:Tm(p);f<p;)o[f++]=l;return o}function fp(o,l){var f=[];return sr(o,function(p,b,x){l(p,b,x)&&f.push(p)}),f}function Ze(o,l,f,p,b){var x=-1,C=o.length;for(f||(f=hv),b||(b=[]);++x<C;){var O=o[x];l>0&&f(O)?l>1?Ze(O,l-1,f,p,b):nr(b,O):p||(b[b.length]=O)}return b}var Uu=$p(),hp=$p(!0);function dn(o,l){return o&&Uu(o,l,Ve)}function qu(o,l){return o&&hp(o,l,Ve)}function Do(o,l){return tr(l,function(f){return Ln(o[f])})}function Fr(o,l){l=ar(l,o);for(var f=0,p=l.length;o!=null&&f<p;)o=o[mn(l[f++])];return f&&f==p?o:t}function dp(o,l,f){var p=l(o);return re(o)?p:nr(p,f(o))}function it(o){return o==null?o===t?Qb:Xb:Lr&&Lr in xe(o)?ov(o):_v(o)}function Ku(o,l){return o>l}function Cw(o,l){return o!=null&&ve.call(o,l)}function kw(o,l){return o!=null&&l in xe(o)}function Tw(o,l,f){return o>=nt(l,f)&&o<Be(l,f)}function Gu(o,l,f){for(var p=f?Ou:yo,b=o[0].length,x=o.length,C=x,O=R(x),I=1/0,P=[];C--;){var D=o[C];C&&l&&(D=Te(D,Ct(l))),I=nt(D.length,I),O[C]=!f&&(l||b>=120&&D.length>=120)?new Dr(C&&D):t}D=o[0];var F=-1,q=O[0];e:for(;++F<b&&P.length<I;){var j=D[F],X=l?l(j):j;if(j=f||j!==0?j:0,!(q?ls(q,X):p(P,X,f))){for(C=x;--C;){var se=O[C];if(!(se?ls(se,X):p(o[C],X,f)))continue e}q&&q.push(X),P.push(j)}}return P}function Aw(o,l,f,p){return dn(o,function(b,x,C){l(p,f(b),x,C)}),p}function gs(o,l,f){l=ar(l,o),o=em(o,l);var p=o==null?o:o[mn(Ut(l))];return p==null?t:Et(p,o,f)}function pp(o){return Ie(o)&&it(o)==Qt}function Ow(o){return Ie(o)&&it(o)==as}function Mw(o){return Ie(o)&&it(o)==ts}function ys(o,l,f,p,b){return o===l?!0:o==null||l==null||!Ie(o)&&!Ie(l)?o!==o&&l!==l:Iw(o,l,f,p,ys,b)}function Iw(o,l,f,p,b,x){var C=re(o),O=re(l),I=C?uo:rt(o),P=O?uo:rt(l);I=I==Qt?Tn:I,P=P==Qt?Tn:P;var D=I==Tn,F=P==Tn,q=I==P;if(q&&ur(o)){if(!ur(l))return!1;C=!0,D=!1}if(q&&!D)return x||(x=new rn),C||Si(o)?Gp(o,l,f,p,b,x):iv(o,l,I,f,p,b,x);if(!(f&v)){var j=D&&ve.call(o,"__wrapped__"),X=F&&ve.call(l,"__wrapped__");if(j||X){var se=j?o.value():o,Z=X?l.value():l;return x||(x=new rn),b(se,Z,f,p,x)}}return q?(x||(x=new rn),sv(o,l,f,p,b,x)):!1}function Nw(o){return Ie(o)&&rt(o)==en}function Ju(o,l,f,p){var b=f.length,x=b,C=!p;if(o==null)return!x;for(o=xe(o);b--;){var O=f[b];if(C&&O[2]?O[1]!==o[O[0]]:!(O[0]in o))return!1}for(;++b<x;){O=f[b];var I=O[0],P=o[I],D=O[1];if(C&&O[2]){if(P===t&&!(I in o))return!1}else{var F=new rn;if(p)var q=p(P,D,I,o,l,F);if(!(q===t?ys(D,P,v|E,p,F):q))return!1}}return!0}function mp(o){if(!Me(o)||pv(o))return!1;var l=Ln(o)?N2:S_;return l.test(zr(o))}function Rw(o){return Ie(o)&&it(o)==rs}function Lw(o){return Ie(o)&&rt(o)==tn}function Pw(o){return Ie(o)&&Qo(o.length)&&!!Ce[it(o)]}function gp(o){return typeof o=="function"?o:o==null?gt:typeof o=="object"?re(o)?_p(o[0],o[1]):bp(o):Fm(o)}function ju(o){if(!ws(o))return F2(o);var l=[];for(var f in xe(o))ve.call(o,f)&&f!="constructor"&&l.push(f);return l}function Dw(o){if(!Me(o))return bv(o);var l=ws(o),f=[];for(var p in o)p=="constructor"&&(l||!ve.call(o,p))||f.push(p);return f}function Yu(o,l){return o<l}function yp(o,l){var f=-1,p=pt(o)?R(o.length):[];return sr(o,function(b,x,C){p[++f]=l(b,x,C)}),p}function bp(o){var l=fc(o);return l.length==1&&l[0][2]?Zp(l[0][0],l[0][1]):function(f){return f===o||Ju(f,o,l)}}function _p(o,l){return dc(o)&&Xp(l)?Zp(mn(o),l):function(f){var p=xc(f,o);return p===t&&p===l?Ec(f,o):ys(l,p,v|E)}}function $o(o,l,f,p,b){o!==l&&Uu(l,function(x,C){if(b||(b=new rn),Me(x))$w(o,l,C,f,$o,p,b);else{var O=p?p(mc(o,C),x,C+"",o,l,b):t;O===t&&(O=x),Wu(o,C,O)}},mt)}function $w(o,l,f,p,b,x,C){var O=mc(o,f),I=mc(l,f),P=C.get(I);if(P){Wu(o,f,P);return}var D=x?x(O,I,f+"",o,l,C):t,F=D===t;if(F){var q=re(I),j=!q&&ur(I),X=!q&&!j&&Si(I);D=I,q||j||X?re(O)?D=O:Le(O)?D=dt(O):j?(F=!1,D=Ip(I,!0)):X?(F=!1,D=Np(I,!0)):D=[]:Ss(I)||Hr(I)?(D=O,Hr(O)?D=Am(O):(!Me(O)||Ln(O))&&(D=Yp(I))):F=!1}F&&(C.set(I,D),b(D,I,p,x,C),C.delete(I)),Wu(o,f,D)}function wp(o,l){var f=o.length;if(f)return l+=l<0?f:0,Rn(l,f)?o[l]:t}function vp(o,l,f){l.length?l=Te(l,function(x){return re(x)?function(C){return Fr(C,x.length===1?x[0]:x)}:x}):l=[gt];var p=-1;l=Te(l,Ct(Y()));var b=yp(o,function(x,C,O){var I=Te(l,function(P){return P(x)});return{criteria:I,index:++p,value:x}});return c2(b,function(x,C){return Yw(x,C,f)})}function Fw(o,l){return Sp(o,l,function(f,p){return Ec(o,p)})}function Sp(o,l,f){for(var p=-1,b=l.length,x={};++p<b;){var C=l[p],O=Fr(o,C);f(O,C)&&bs(x,ar(C,o),O)}return x}function Bw(o){return function(l){return Fr(l,o)}}function Xu(o,l,f,p){var b=p?u2:fi,x=-1,C=l.length,O=o;for(o===l&&(l=dt(l)),f&&(O=Te(o,Ct(f)));++x<C;)for(var I=0,P=l[x],D=f?f(P):P;(I=b(O,D,I,p))>-1;)O!==o&&To.call(O,I,1),To.call(o,I,1);return o}function xp(o,l){for(var f=o?l.length:0,p=f-1;f--;){var b=l[f];if(f==p||b!==x){var x=b;Rn(b)?To.call(o,b,1):tc(o,b)}}return o}function Zu(o,l){return o+Mo(rp()*(l-o+1))}function zw(o,l,f,p){for(var b=-1,x=Be(Oo((l-o)/(f||1)),0),C=R(x);x--;)C[p?x:++b]=o,o+=f;return C}function Qu(o,l){var f="";if(!o||l<1||l>er)return f;do l%2&&(f+=o),l=Mo(l/2),l&&(o+=o);while(l);return f}function ue(o,l){return gc(Qp(o,l,gt),o+"")}function Hw(o){return op(xi(o))}function Ww(o,l){var f=xi(o);return Go(f,$r(l,0,f.length))}function bs(o,l,f,p){if(!Me(o))return o;l=ar(l,o);for(var b=-1,x=l.length,C=x-1,O=o;O!=null&&++b<x;){var I=mn(l[b]),P=f;if(I==="__proto__"||I==="constructor"||I==="prototype")return o;if(b!=C){var D=O[I];P=p?p(D,I,O):t,P===t&&(P=Me(D)?D:Rn(l[b+1])?[]:{})}ps(O,I,P),O=O[I]}return o}var Ep=Io?function(o,l){return Io.set(o,l),o}:gt,Vw=Ao?function(o,l){return Ao(o,"toString",{configurable:!0,enumerable:!1,value:kc(l),writable:!0})}:gt;function Uw(o){return Go(xi(o))}function Vt(o,l,f){var p=-1,b=o.length;l<0&&(l=-l>b?0:b+l),f=f>b?b:f,f<0&&(f+=b),b=l>f?0:f-l>>>0,l>>>=0;for(var x=R(b);++p<b;)x[p]=o[p+l];return x}function qw(o,l){var f;return sr(o,function(p,b,x){return f=l(p,b,x),!f}),!!f}function Fo(o,l,f){var p=0,b=o==null?p:o.length;if(typeof l=="number"&&l===l&&b<=uu){for(;p<b;){var x=p+b>>>1,C=o[x];C!==null&&!Tt(C)&&(f?C<=l:C<l)?p=x+1:b=x}return b}return ec(o,l,gt,f)}function ec(o,l,f,p){var b=0,x=o==null?0:o.length;if(x===0)return 0;l=f(l);for(var C=l!==l,O=l===null,I=Tt(l),P=l===t;b<x;){var D=Mo((b+x)/2),F=f(o[D]),q=F!==t,j=F===null,X=F===F,se=Tt(F);if(C)var Z=p||X;else P?Z=X&&(p||q):O?Z=X&&q&&(p||!j):I?Z=X&&q&&!j&&(p||!se):j||se?Z=!1:Z=p?F<=l:F<l;Z?b=D+1:x=D}return nt(x,lu)}function Cp(o,l){for(var f=-1,p=o.length,b=0,x=[];++f<p;){var C=o[f],O=l?l(C):C;if(!f||!sn(O,I)){var I=O;x[b++]=C===0?0:C}}return x}function kp(o){return typeof o=="number"?o:Tt(o)?hn:+o}function kt(o){if(typeof o=="string")return o;if(re(o))return Te(o,kt)+"";if(Tt(o))return ip?ip.call(o):"";var l=o+"";return l=="0"&&1/o==-1/0?"-0":l}function or(o,l,f){var p=-1,b=yo,x=o.length,C=!0,O=[],I=O;if(f)C=!1,b=Ou;else if(x>=i){var P=l?null:nv(o);if(P)return _o(P);C=!1,b=ls,I=new Dr}else I=l?[]:O;e:for(;++p<x;){var D=o[p],F=l?l(D):D;if(D=f||D!==0?D:0,C&&F===F){for(var q=I.length;q--;)if(I[q]===F)continue e;l&&I.push(F),O.push(D)}else b(I,F,f)||(I!==O&&I.push(F),O.push(D))}return O}function tc(o,l){return l=ar(l,o),o=em(o,l),o==null||delete o[mn(Ut(l))]}function Tp(o,l,f,p){return bs(o,l,f(Fr(o,l)),p)}function Bo(o,l,f,p){for(var b=o.length,x=p?b:-1;(p?x--:++x<b)&&l(o[x],x,o););return f?Vt(o,p?0:x,p?x+1:b):Vt(o,p?x+1:0,p?b:x)}function Ap(o,l){var f=o;return f instanceof fe&&(f=f.value()),Mu(l,function(p,b){return b.func.apply(b.thisArg,nr([p],b.args))},f)}function nc(o,l,f){var p=o.length;if(p<2)return p?or(o[0]):[];for(var b=-1,x=R(p);++b<p;)for(var C=o[b],O=-1;++O<p;)O!=b&&(x[b]=ms(x[b]||C,o[O],l,f));return or(Ze(x,1),l,f)}function Op(o,l,f){for(var p=-1,b=o.length,x=l.length,C={};++p<b;){var O=p<x?l[p]:t;f(C,o[p],O)}return C}function rc(o){return Le(o)?o:[]}function ic(o){return typeof o=="function"?o:gt}function ar(o,l){return re(o)?o:dc(o,l)?[o]:im(_e(o))}var Kw=ue;function lr(o,l,f){var p=o.length;return f=f===t?p:f,!l&&f>=p?o:Vt(o,l,f)}var Mp=R2||function(o){return Xe.clearTimeout(o)};function Ip(o,l){if(l)return o.slice();var f=o.length,p=Zd?Zd(f):new o.constructor(f);return o.copy(p),p}function sc(o){var l=new o.constructor(o.byteLength);return new Co(l).set(new Co(o)),l}function Gw(o,l){var f=l?sc(o.buffer):o.buffer;return new o.constructor(f,o.byteOffset,o.byteLength)}function Jw(o){var l=new o.constructor(o.source,pd.exec(o));return l.lastIndex=o.lastIndex,l}function jw(o){return ds?xe(ds.call(o)):{}}function Np(o,l){var f=l?sc(o.buffer):o.buffer;return new o.constructor(f,o.byteOffset,o.length)}function Rp(o,l){if(o!==l){var f=o!==t,p=o===null,b=o===o,x=Tt(o),C=l!==t,O=l===null,I=l===l,P=Tt(l);if(!O&&!P&&!x&&o>l||x&&C&&I&&!O&&!P||p&&C&&I||!f&&I||!b)return 1;if(!p&&!x&&!P&&o<l||P&&f&&b&&!p&&!x||O&&f&&b||!C&&b||!I)return-1}return 0}function Yw(o,l,f){for(var p=-1,b=o.criteria,x=l.criteria,C=b.length,O=f.length;++p<C;){var I=Rp(b[p],x[p]);if(I){if(p>=O)return I;var P=f[p];return I*(P=="desc"?-1:1)}}return o.index-l.index}function Lp(o,l,f,p){for(var b=-1,x=o.length,C=f.length,O=-1,I=l.length,P=Be(x-C,0),D=R(I+P),F=!p;++O<I;)D[O]=l[O];for(;++b<C;)(F||b<x)&&(D[f[b]]=o[b]);for(;P--;)D[O++]=o[b++];return D}function Pp(o,l,f,p){for(var b=-1,x=o.length,C=-1,O=f.length,I=-1,P=l.length,D=Be(x-O,0),F=R(D+P),q=!p;++b<D;)F[b]=o[b];for(var j=b;++I<P;)F[j+I]=l[I];for(;++C<O;)(q||b<x)&&(F[j+f[C]]=o[b++]);return F}function dt(o,l){var f=-1,p=o.length;for(l||(l=R(p));++f<p;)l[f]=o[f];return l}function pn(o,l,f,p){var b=!f;f||(f={});for(var x=-1,C=l.length;++x<C;){var O=l[x],I=p?p(f[O],o[O],O,f,o):t;I===t&&(I=o[O]),b?Mn(f,O,I):ps(f,O,I)}return f}function Xw(o,l){return pn(o,hc(o),l)}function Zw(o,l){return pn(o,Jp(o),l)}function zo(o,l){return function(f,p){var b=re(f)?r2:ww,x=l?l():{};return b(f,o,Y(p,2),x)}}function _i(o){return ue(function(l,f){var p=-1,b=f.length,x=b>1?f[b-1]:t,C=b>2?f[2]:t;for(x=o.length>3&&typeof x=="function"?(b--,x):t,C&&st(f[0],f[1],C)&&(x=b<3?t:x,b=1),l=xe(l);++p<b;){var O=f[p];O&&o(l,O,p,x)}return l})}function Dp(o,l){return function(f,p){if(f==null)return f;if(!pt(f))return o(f,p);for(var b=f.length,x=l?b:-1,C=xe(f);(l?x--:++x<b)&&p(C[x],x,C)!==!1;);return f}}function $p(o){return function(l,f,p){for(var b=-1,x=xe(l),C=p(l),O=C.length;O--;){var I=C[o?O:++b];if(f(x[I],I,x)===!1)break}return l}}function Qw(o,l,f){var p=l&N,b=_s(o);function x(){var C=this&&this!==Xe&&this instanceof x?b:o;return C.apply(p?f:this,arguments)}return x}function Fp(o){return function(l){l=_e(l);var f=hi(l)?nn(l):t,p=f?f[0]:l.charAt(0),b=f?lr(f,1).join(""):l.slice(1);return p[o]()+b}}function wi(o){return function(l){return Mu(Dm(Pm(l).replace(V_,"")),o,"")}}function _s(o){return function(){var l=arguments;switch(l.length){case 0:return new o;case 1:return new o(l[0]);case 2:return new o(l[0],l[1]);case 3:return new o(l[0],l[1],l[2]);case 4:return new o(l[0],l[1],l[2],l[3]);case 5:return new o(l[0],l[1],l[2],l[3],l[4]);case 6:return new o(l[0],l[1],l[2],l[3],l[4],l[5]);case 7:return new o(l[0],l[1],l[2],l[3],l[4],l[5],l[6])}var f=bi(o.prototype),p=o.apply(f,l);return Me(p)?p:f}}function ev(o,l,f){var p=_s(o);function b(){for(var x=arguments.length,C=R(x),O=x,I=vi(b);O--;)C[O]=arguments[O];var P=x<3&&C[0]!==I&&C[x-1]!==I?[]:rr(C,I);if(x-=P.length,x<f)return Vp(o,l,Ho,b.placeholder,t,C,P,t,t,f-x);var D=this&&this!==Xe&&this instanceof b?p:o;return Et(D,this,C)}return b}function Bp(o){return function(l,f,p){var b=xe(l);if(!pt(l)){var x=Y(f,3);l=Ve(l),f=function(O){return x(b[O],O,b)}}var C=o(l,f,p);return C>-1?b[x?l[C]:C]:t}}function zp(o){return Nn(function(l){var f=l.length,p=f,b=Ht.prototype.thru;for(o&&l.reverse();p--;){var x=l[p];if(typeof x!="function")throw new zt(a);if(b&&!C&&qo(x)=="wrapper")var C=new Ht([],!0)}for(p=C?p:f;++p<f;){x=l[p];var O=qo(x),I=O=="wrapper"?cc(x):t;I&&pc(I[0])&&I[1]==(U|k|A|z)&&!I[4].length&&I[9]==1?C=C[qo(I[0])].apply(C,I[3]):C=x.length==1&&pc(x)?C[O]():C.thru(x)}return function(){var P=arguments,D=P[0];if(C&&P.length==1&&re(D))return C.plant(D).value();for(var F=0,q=f?l[F].apply(this,P):D;++F<f;)q=l[F].call(this,q);return q}})}function Ho(o,l,f,p,b,x,C,O,I,P){var D=l&U,F=l&N,q=l&g,j=l&(k|T),X=l&ee,se=q?t:_s(o);function Z(){for(var ce=arguments.length,me=R(ce),At=ce;At--;)me[At]=arguments[At];if(j)var ot=vi(Z),Ot=h2(me,ot);if(p&&(me=Lp(me,p,b,j)),x&&(me=Pp(me,x,C,j)),ce-=Ot,j&&ce<P){var Pe=rr(me,ot);return Vp(o,l,Ho,Z.placeholder,f,me,Pe,O,I,P-ce)}var on=F?f:this,Dn=q?on[o]:o;return ce=me.length,O?me=wv(me,O):X&&ce>1&&me.reverse(),D&&I<ce&&(me.length=I),this&&this!==Xe&&this instanceof Z&&(Dn=se||_s(Dn)),Dn.apply(on,me)}return Z}function Hp(o,l){return function(f,p){return Aw(f,o,l(p),{})}}function Wo(o,l){return function(f,p){var b;if(f===t&&p===t)return l;if(f!==t&&(b=f),p!==t){if(b===t)return p;typeof f=="string"||typeof p=="string"?(f=kt(f),p=kt(p)):(f=kp(f),p=kp(p)),b=o(f,p)}return b}}function oc(o){return Nn(function(l){return l=Te(l,Ct(Y())),ue(function(f){var p=this;return o(l,function(b){return Et(b,p,f)})})})}function Vo(o,l){l=l===t?" ":kt(l);var f=l.length;if(f<2)return f?Qu(l,o):l;var p=Qu(l,Oo(o/di(l)));return hi(l)?lr(nn(p),0,o).join(""):p.slice(0,o)}function tv(o,l,f,p){var b=l&N,x=_s(o);function C(){for(var O=-1,I=arguments.length,P=-1,D=p.length,F=R(D+I),q=this&&this!==Xe&&this instanceof C?x:o;++P<D;)F[P]=p[P];for(;I--;)F[P++]=arguments[++O];return Et(q,b?f:this,F)}return C}function Wp(o){return function(l,f,p){return p&&typeof p!="number"&&st(l,f,p)&&(f=p=t),l=Pn(l),f===t?(f=l,l=0):f=Pn(f),p=p===t?l<f?1:-1:Pn(p),zw(l,f,p,o)}}function Uo(o){return function(l,f){return typeof l=="string"&&typeof f=="string"||(l=qt(l),f=qt(f)),o(l,f)}}function Vp(o,l,f,p,b,x,C,O,I,P){var D=l&k,F=D?C:t,q=D?t:C,j=D?x:t,X=D?t:x;l|=D?A:$,l&=~(D?$:A),l&S||(l&=-4);var se=[o,l,b,j,F,X,q,O,I,P],Z=f.apply(t,se);return pc(o)&&tm(Z,se),Z.placeholder=p,nm(Z,o,l)}function ac(o){var l=Fe[o];return function(f,p){if(f=qt(f),p=p==null?0:nt(ie(p),292),p&&np(f)){var b=(_e(f)+"e").split("e"),x=l(b[0]+"e"+(+b[1]+p));return b=(_e(x)+"e").split("e"),+(b[0]+"e"+(+b[1]-p))}return l(f)}}var nv=gi&&1/_o(new gi([,-0]))[1]==St?function(o){return new gi(o)}:Oc;function Up(o){return function(l){var f=rt(l);return f==en?$u(l):f==tn?_2(l):f2(l,o(l))}}function In(o,l,f,p,b,x,C,O){var I=l&g;if(!I&&typeof o!="function")throw new zt(a);var P=p?p.length:0;if(P||(l&=-97,p=b=t),C=C===t?C:Be(ie(C),0),O=O===t?O:ie(O),P-=b?b.length:0,l&$){var D=p,F=b;p=b=t}var q=I?t:cc(o),j=[o,l,f,p,b,D,F,x,C,O];if(q&&yv(j,q),o=j[0],l=j[1],f=j[2],p=j[3],b=j[4],O=j[9]=j[9]===t?I?0:o.length:Be(j[9]-P,0),!O&&l&(k|T)&&(l&=-25),!l||l==N)var X=Qw(o,l,f);else l==k||l==T?X=ev(o,l,O):(l==A||l==(N|A))&&!b.length?X=tv(o,l,f,p):X=Ho.apply(t,j);var se=q?Ep:tm;return nm(se(X,j),o,l)}function qp(o,l,f,p){return o===t||sn(o,mi[f])&&!ve.call(p,f)?l:o}function Kp(o,l,f,p,b,x){return Me(o)&&Me(l)&&(x.set(l,o),$o(o,l,t,Kp,x),x.delete(l)),o}function rv(o){return Ss(o)?t:o}function Gp(o,l,f,p,b,x){var C=f&v,O=o.length,I=l.length;if(O!=I&&!(C&&I>O))return!1;var P=x.get(o),D=x.get(l);if(P&&D)return P==l&&D==o;var F=-1,q=!0,j=f&E?new Dr:t;for(x.set(o,l),x.set(l,o);++F<O;){var X=o[F],se=l[F];if(p)var Z=C?p(se,X,F,l,o,x):p(X,se,F,o,l,x);if(Z!==t){if(Z)continue;q=!1;break}if(j){if(!Iu(l,function(ce,me){if(!ls(j,me)&&(X===ce||b(X,ce,f,p,x)))return j.push(me)})){q=!1;break}}else if(!(X===se||b(X,se,f,p,x))){q=!1;break}}return x.delete(o),x.delete(l),q}function iv(o,l,f,p,b,x,C){switch(f){case ui:if(o.byteLength!=l.byteLength||o.byteOffset!=l.byteOffset)return!1;o=o.buffer,l=l.buffer;case as:return!(o.byteLength!=l.byteLength||!x(new Co(o),new Co(l)));case es:case ts:case ns:return sn(+o,+l);case co:return o.name==l.name&&o.message==l.message;case rs:case is:return o==l+"";case en:var O=$u;case tn:var I=p&v;if(O||(O=_o),o.size!=l.size&&!I)return!1;var P=C.get(o);if(P)return P==l;p|=E,C.set(o,l);var D=Gp(O(o),O(l),p,b,x,C);return C.delete(o),D;case ho:if(ds)return ds.call(o)==ds.call(l)}return!1}function sv(o,l,f,p,b,x){var C=f&v,O=lc(o),I=O.length,P=lc(l),D=P.length;if(I!=D&&!C)return!1;for(var F=I;F--;){var q=O[F];if(!(C?q in l:ve.call(l,q)))return!1}var j=x.get(o),X=x.get(l);if(j&&X)return j==l&&X==o;var se=!0;x.set(o,l),x.set(l,o);for(var Z=C;++F<I;){q=O[F];var ce=o[q],me=l[q];if(p)var At=C?p(me,ce,q,l,o,x):p(ce,me,q,o,l,x);if(!(At===t?ce===me||b(ce,me,f,p,x):At)){se=!1;break}Z||(Z=q=="constructor")}if(se&&!Z){var ot=o.constructor,Ot=l.constructor;ot!=Ot&&"constructor"in o&&"constructor"in l&&!(typeof ot=="function"&&ot instanceof ot&&typeof Ot=="function"&&Ot instanceof Ot)&&(se=!1)}return x.delete(o),x.delete(l),se}function Nn(o){return gc(Qp(o,t,lm),o+"")}function lc(o){return dp(o,Ve,hc)}function uc(o){return dp(o,mt,Jp)}var cc=Io?function(o){return Io.get(o)}:Oc;function qo(o){for(var l=o.name+"",f=yi[l],p=ve.call(yi,l)?f.length:0;p--;){var b=f[p],x=b.func;if(x==null||x==o)return b.name}return l}function vi(o){var l=ve.call(w,"placeholder")?w:o;return l.placeholder}function Y(){var o=w.iteratee||Tc;return o=o===Tc?gp:o,arguments.length?o(arguments[0],arguments[1]):o}function Ko(o,l){var f=o.__data__;return dv(l)?f[typeof l=="string"?"string":"hash"]:f.map}function fc(o){for(var l=Ve(o),f=l.length;f--;){var p=l[f],b=o[p];l[f]=[p,b,Xp(b)]}return l}function Br(o,l){var f=g2(o,l);return mp(f)?f:t}function ov(o){var l=ve.call(o,Lr),f=o[Lr];try{o[Lr]=t;var p=!0}catch{}var b=xo.call(o);return p&&(l?o[Lr]=f:delete o[Lr]),b}var hc=Bu?function(o){return o==null?[]:(o=xe(o),tr(Bu(o),function(l){return ep.call(o,l)}))}:Mc,Jp=Bu?function(o){for(var l=[];o;)nr(l,hc(o)),o=ko(o);return l}:Mc,rt=it;(zu&&rt(new zu(new ArrayBuffer(1)))!=ui||cs&&rt(new cs)!=en||Hu&&rt(Hu.resolve())!=cd||gi&&rt(new gi)!=tn||fs&&rt(new fs)!=ss)&&(rt=function(o){var l=it(o),f=l==Tn?o.constructor:t,p=f?zr(f):"";if(p)switch(p){case W2:return ui;case V2:return en;case U2:return cd;case q2:return tn;case K2:return ss}return l});function av(o,l,f){for(var p=-1,b=f.length;++p<b;){var x=f[p],C=x.size;switch(x.type){case"drop":o+=C;break;case"dropRight":l-=C;break;case"take":l=nt(l,o+C);break;case"takeRight":o=Be(o,l-C);break}}return{start:o,end:l}}function lv(o){var l=o.match(p_);return l?l[1].split(m_):[]}function jp(o,l,f){l=ar(l,o);for(var p=-1,b=l.length,x=!1;++p<b;){var C=mn(l[p]);if(!(x=o!=null&&f(o,C)))break;o=o[C]}return x||++p!=b?x:(b=o==null?0:o.length,!!b&&Qo(b)&&Rn(C,b)&&(re(o)||Hr(o)))}function uv(o){var l=o.length,f=new o.constructor(l);return l&&typeof o[0]=="string"&&ve.call(o,"index")&&(f.index=o.index,f.input=o.input),f}function Yp(o){return typeof o.constructor=="function"&&!ws(o)?bi(ko(o)):{}}function cv(o,l,f){var p=o.constructor;switch(l){case as:return sc(o);case es:case ts:return new p(+o);case ui:return Gw(o,f);case fu:case hu:case du:case pu:case mu:case gu:case yu:case bu:case _u:return Np(o,f);case en:return new p;case ns:case is:return new p(o);case rs:return Jw(o);case tn:return new p;case ho:return jw(o)}}function fv(o,l){var f=l.length;if(!f)return o;var p=f-1;return l[p]=(f>1?"& ":"")+l[p],l=l.join(f>2?", ":" "),o.replace(d_,`{
|
|
46
50
|
/* [wrapped with `+l+`] */
|
|
47
|
-
`)}function cw(o){return re(o)||Pr(o)||!!(_d&&o&&o[_d])}function Mn(o,l){var f=typeof o;return l=l??Yn,!!l&&(f=="number"||f!="symbol"&&Sb.test(o))&&o>-1&&o%1==0&&o<l}function st(o,l,f){if(!Me(f))return!1;var d=typeof l;return(d=="number"?dt(f)&&Mn(l,f.length):d=="string"&&l in f)?nn(f[l],o):!1}function Uu(o,l){if(re(o))return!1;var f=typeof o;return f=="number"||f=="symbol"||f=="boolean"||o==null||kt(o)?!0:ab.test(o)||!ob.test(o)||l!=null&&o in xe(l)}function fw(o){var l=typeof o;return l=="string"||l=="number"||l=="symbol"||l=="boolean"?o!=="__proto__":o===null}function qu(o){var l=Mo(o),f=w[l];if(typeof f!="function"||!(l in fe.prototype))return!1;if(o===f)return!0;var d=Hu(f);return!!d&&o===d[0]}function hw(o){return!!md&&md in o}var dw=so?In:lc;function ss(o){var l=o&&o.constructor,f=typeof l=="function"&&l.prototype||si;return o===f}function mp(o){return o===o&&!Me(o)}function gp(o,l){return function(f){return f==null?!1:f[o]===l&&(l!==t||o in xe(f))}}function pw(o){var l=Do(o,function(d){return f.size===h&&f.clear(),d}),f=l.cache;return l}function mw(o,l){var f=o[1],d=l[1],b=f|d,x=b<(N|g|U),C=d==U&&f==k||d==U&&f==H&&o[7].length<=l[8]||d==(U|H)&&l[7].length<=l[8]&&f==k;if(!(x||C))return o;d&N&&(o[2]=l[2],b|=f&N?0:v);var O=l[3];if(O){var I=o[3];o[3]=I?Zd(I,O,l[4]):O,o[4]=I?Qn(o[3],p):l[4]}return O=l[5],O&&(I=o[5],o[5]=I?Qd(I,O,l[6]):O,o[6]=I?Qn(o[5],p):l[6]),O=l[7],O&&(o[7]=O),d&U&&(o[8]=o[8]==null?l[8]:nt(o[8],l[8])),o[9]==null&&(o[9]=l[9]),o[0]=l[0],o[1]=b,o}function gw(o){var l=[];if(o!=null)for(var f in xe(o))l.push(f);return l}function yw(o){return ao.call(o)}function yp(o,l,f){return l=ze(l===t?o.length-1:l,0),function(){for(var d=arguments,b=-1,x=ze(d.length-l,0),C=R(x);++b<x;)C[b]=d[l+b];b=-1;for(var O=R(l+1);++b<l;)O[b]=d[b];return O[l]=f(C),xt(o,this,O)}}function bp(o,l){return l.length<2?o:Nr(o,Wt(l,0,-1))}function bw(o,l){for(var f=o.length,d=nt(l.length,f),b=ht(o);d--;){var x=l[d];o[d]=Mn(x,f)?b[x]:t}return o}function Ku(o,l){if(!(l==="constructor"&&typeof o[l]=="function")&&l!="__proto__")return o[l]}var _p=vp(Wd),as=R2||function(o,l){return Xe.setTimeout(o,l)},Gu=vp(H_);function wp(o,l,f){var d=l+"";return Gu(o,uw(d,_w(ow(d),f)))}function vp(o){var l=0,f=0;return function(){var d=F2(),b=Sn-(d-f);if(f=d,b>0){if(++l>=wt)return arguments[0]}else l=0;return o.apply(t,arguments)}}function No(o,l){var f=-1,d=o.length,b=d-1;for(l=l===t?d:l;++f<l;){var x=Ou(f,b),C=o[x];o[x]=o[f],o[f]=C}return o.length=l,o}var Sp=pw(function(o){var l=[];return o.charCodeAt(0)===46&&l.push(""),o.replace(lb,function(f,d,b,x){l.push(b?x.replace(gb,"$1"):d||f)}),l});function dn(o){if(typeof o=="string"||kt(o))return o;var l=o+"";return l=="0"&&1/o==-1/0?"-0":l}function Lr(o){if(o!=null){try{return oo.call(o)}catch{}try{return o+""}catch{}}return""}function _w(o,l){return Bt(Hl,function(f){var d="_."+f[0];l&f[1]&&!to(o,d)&&o.push(d)}),o.sort()}function xp(o){if(o instanceof fe)return o.clone();var l=new $t(o.__wrapped__,o.__chain__);return l.__actions__=ht(o.__actions__),l.__index__=o.__index__,l.__values__=o.__values__,l}function ww(o,l,f){(f?st(o,l,f):l===t)?l=1:l=ze(ie(l),0);var d=o==null?0:o.length;if(!d||l<1)return[];for(var b=0,x=0,C=R(po(d/l));b<d;)C[x++]=Wt(o,b,b+=l);return C}function vw(o){for(var l=-1,f=o==null?0:o.length,d=0,b=[];++l<f;){var x=o[l];x&&(b[d++]=x)}return b}function Sw(){var o=arguments.length;if(!o)return[];for(var l=R(o-1),f=arguments[0],d=o;d--;)l[d-1]=arguments[d];return Zn(re(f)?ht(f):[f],Ze(l,1))}var xw=ue(function(o,l){return Le(o)?es(o,Ze(l,1,Le,!0)):[]}),Cw=ue(function(o,l){var f=Vt(l);return Le(f)&&(f=t),Le(o)?es(o,Ze(l,1,Le,!0),Y(f,2)):[]}),Ew=ue(function(o,l){var f=Vt(l);return Le(f)&&(f=t),Le(o)?es(o,Ze(l,1,Le,!0),t,f):[]});function kw(o,l,f){var d=o==null?0:o.length;return d?(l=f||l===t?1:ie(l),Wt(o,l<0?0:l,d)):[]}function Aw(o,l,f){var d=o==null?0:o.length;return d?(l=f||l===t?1:ie(l),l=d-l,Wt(o,0,l<0?0:l)):[]}function Tw(o,l){return o&&o.length?Co(o,Y(l,3),!0,!0):[]}function Ow(o,l){return o&&o.length?Co(o,Y(l,3),!0):[]}function Mw(o,l,f,d){var b=o==null?0:o.length;return b?(f&&typeof f!="number"&&st(o,l,f)&&(f=0,d=b),S_(o,l,f,d)):[]}function Cp(o,l,f){var d=o==null?0:o.length;if(!d)return-1;var b=f==null?0:ie(f);return b<0&&(b=ze(d+b,0)),no(o,Y(l,3),b)}function Ep(o,l,f){var d=o==null?0:o.length;if(!d)return-1;var b=d-1;return f!==t&&(b=ie(f),b=f<0?ze(d+b,0):nt(b,d-1)),no(o,Y(l,3),b,!0)}function kp(o){var l=o==null?0:o.length;return l?Ze(o,1):[]}function Iw(o){var l=o==null?0:o.length;return l?Ze(o,vt):[]}function Nw(o,l){var f=o==null?0:o.length;return f?(l=l===t?1:ie(l),Ze(o,l)):[]}function Rw(o){for(var l=-1,f=o==null?0:o.length,d={};++l<f;){var b=o[l];d[b[0]]=b[1]}return d}function Ap(o){return o&&o.length?o[0]:t}function Lw(o,l,f){var d=o==null?0:o.length;if(!d)return-1;var b=f==null?0:ie(f);return b<0&&(b=ze(d+b,0)),ti(o,l,b)}function Pw(o){var l=o==null?0:o.length;return l?Wt(o,0,-1):[]}var Dw=ue(function(o){var l=Ae(o,Lu);return l.length&&l[0]===o[0]?Cu(l):[]}),Fw=ue(function(o){var l=Vt(o),f=Ae(o,Lu);return l===Vt(f)?l=t:f.pop(),f.length&&f[0]===o[0]?Cu(f,Y(l,2)):[]}),Bw=ue(function(o){var l=Vt(o),f=Ae(o,Lu);return l=typeof l=="function"?l:t,l&&f.pop(),f.length&&f[0]===o[0]?Cu(f,t,l):[]});function zw(o,l){return o==null?"":P2.call(o,l)}function Vt(o){var l=o==null?0:o.length;return l?o[l-1]:t}function $w(o,l,f){var d=o==null?0:o.length;if(!d)return-1;var b=d;return f!==t&&(b=ie(f),b=b<0?ze(d+b,0):nt(b,d-1)),l===l?_2(o,l,b):no(o,ad,b,!0)}function Hw(o,l){return o&&o.length?Bd(o,ie(l)):t}var Ww=ue(Tp);function Tp(o,l){return o&&o.length&&l&&l.length?Tu(o,l):o}function Vw(o,l,f){return o&&o.length&&l&&l.length?Tu(o,l,Y(f,2)):o}function Uw(o,l,f){return o&&o.length&&l&&l.length?Tu(o,l,t,f):o}var qw=On(function(o,l){var f=o==null?0:o.length,d=wu(o,l);return Hd(o,Ae(l,function(b){return Mn(b,f)?+b:b}).sort(Xd)),d});function Kw(o,l){var f=[];if(!(o&&o.length))return f;var d=-1,b=[],x=o.length;for(l=Y(l,3);++d<x;){var C=o[d];l(C,d,o)&&(f.push(C),b.push(d))}return Hd(o,b),f}function Ju(o){return o==null?o:z2.call(o)}function Gw(o,l,f){var d=o==null?0:o.length;return d?(f&&typeof f!="number"&&st(o,l,f)?(l=0,f=d):(l=l==null?0:ie(l),f=f===t?d:ie(f)),Wt(o,l,f)):[]}function Jw(o,l){return xo(o,l)}function jw(o,l,f){return Iu(o,l,Y(f,2))}function Yw(o,l){var f=o==null?0:o.length;if(f){var d=xo(o,l);if(d<f&&nn(o[d],l))return d}return-1}function Xw(o,l){return xo(o,l,!0)}function Zw(o,l,f){return Iu(o,l,Y(f,2),!0)}function Qw(o,l){var f=o==null?0:o.length;if(f){var d=xo(o,l,!0)-1;if(nn(o[d],l))return d}return-1}function ev(o){return o&&o.length?Vd(o):[]}function tv(o,l){return o&&o.length?Vd(o,Y(l,2)):[]}function nv(o){var l=o==null?0:o.length;return l?Wt(o,1,l):[]}function rv(o,l,f){return o&&o.length?(l=f||l===t?1:ie(l),Wt(o,0,l<0?0:l)):[]}function iv(o,l,f){var d=o==null?0:o.length;return d?(l=f||l===t?1:ie(l),l=d-l,Wt(o,l<0?0:l,d)):[]}function sv(o,l){return o&&o.length?Co(o,Y(l,3),!1,!0):[]}function ov(o,l){return o&&o.length?Co(o,Y(l,3)):[]}var av=ue(function(o){return nr(Ze(o,1,Le,!0))}),lv=ue(function(o){var l=Vt(o);return Le(l)&&(l=t),nr(Ze(o,1,Le,!0),Y(l,2))}),uv=ue(function(o){var l=Vt(o);return l=typeof l=="function"?l:t,nr(Ze(o,1,Le,!0),t,l)});function cv(o){return o&&o.length?nr(o):[]}function fv(o,l){return o&&o.length?nr(o,Y(l,2)):[]}function hv(o,l){return l=typeof l=="function"?l:t,o&&o.length?nr(o,t,l):[]}function ju(o){if(!(o&&o.length))return[];var l=0;return o=Xn(o,function(f){if(Le(f))return l=ze(f.length,l),!0}),hu(l,function(f){return Ae(o,uu(f))})}function Op(o,l){if(!(o&&o.length))return[];var f=ju(o);return l==null?f:Ae(f,function(d){return xt(l,t,d)})}var dv=ue(function(o,l){return Le(o)?es(o,l):[]}),pv=ue(function(o){return Ru(Xn(o,Le))}),mv=ue(function(o){var l=Vt(o);return Le(l)&&(l=t),Ru(Xn(o,Le),Y(l,2))}),gv=ue(function(o){var l=Vt(o);return l=typeof l=="function"?l:t,Ru(Xn(o,Le),t,l)}),yv=ue(ju);function bv(o,l){return Gd(o||[],l||[],Qi)}function _v(o,l){return Gd(o||[],l||[],rs)}var wv=ue(function(o){var l=o.length,f=l>1?o[l-1]:t;return f=typeof f=="function"?(o.pop(),f):t,Op(o,f)});function Mp(o){var l=w(o);return l.__chain__=!0,l}function vv(o,l){return l(o),o}function Ro(o,l){return l(o)}var Sv=On(function(o){var l=o.length,f=l?o[0]:0,d=this.__wrapped__,b=function(x){return wu(x,o)};return l>1||this.__actions__.length||!(d instanceof fe)||!Mn(f)?this.thru(b):(d=d.slice(f,+f+(l?1:0)),d.__actions__.push({func:Ro,args:[b],thisArg:t}),new $t(d,this.__chain__).thru(function(x){return l&&!x.length&&x.push(t),x}))});function xv(){return Mp(this)}function Cv(){return new $t(this.value(),this.__chain__)}function Ev(){this.__values__===t&&(this.__values__=Up(this.value()));var o=this.__index__>=this.__values__.length,l=o?t:this.__values__[this.__index__++];return{done:o,value:l}}function kv(){return this}function Av(o){for(var l,f=this;f instanceof bo;){var d=xp(f);d.__index__=0,d.__values__=t,l?b.__wrapped__=d:l=d;var b=d;f=f.__wrapped__}return b.__wrapped__=o,l}function Tv(){var o=this.__wrapped__;if(o instanceof fe){var l=o;return this.__actions__.length&&(l=new fe(this)),l=l.reverse(),l.__actions__.push({func:Ro,args:[Ju],thisArg:t}),new $t(l,this.__chain__)}return this.thru(Ju)}function Ov(){return Kd(this.__wrapped__,this.__actions__)}var Mv=Eo(function(o,l,f){ve.call(o,f)?++o[f]:An(o,f,1)});function Iv(o,l,f){var d=re(o)?sd:v_;return f&&st(o,l,f)&&(l=t),d(o,Y(l,3))}function Nv(o,l){var f=re(o)?Xn:Od;return f(o,Y(l,3))}var Rv=rp(Cp),Lv=rp(Ep);function Pv(o,l){return Ze(Lo(o,l),1)}function Dv(o,l){return Ze(Lo(o,l),vt)}function Fv(o,l,f){return f=f===t?1:ie(f),Ze(Lo(o,l),f)}function Ip(o,l){var f=re(o)?Bt:tr;return f(o,Y(l,3))}function Np(o,l){var f=re(o)?n2:Td;return f(o,Y(l,3))}var Bv=Eo(function(o,l,f){ve.call(o,f)?o[f].push(l):An(o,f,[l])});function zv(o,l,f,d){o=dt(o)?o:di(o),f=f&&!d?ie(f):0;var b=o.length;return f<0&&(f=ze(b+f,0)),zo(o)?f<=b&&o.indexOf(l,f)>-1:!!b&&ti(o,l,f)>-1}var $v=ue(function(o,l,f){var d=-1,b=typeof l=="function",x=dt(o)?R(o.length):[];return tr(o,function(C){x[++d]=b?xt(l,C,f):ts(C,l,f)}),x}),Hv=Eo(function(o,l,f){An(o,f,l)});function Lo(o,l){var f=re(o)?Ae:Pd;return f(o,Y(l,3))}function Wv(o,l,f,d){return o==null?[]:(re(l)||(l=l==null?[]:[l]),f=d?t:f,re(f)||(f=f==null?[]:[f]),zd(o,l,f))}var Vv=Eo(function(o,l,f){o[f?0:1].push(l)},function(){return[[],[]]});function Uv(o,l,f){var d=re(o)?au:ud,b=arguments.length<3;return d(o,Y(l,4),f,b,tr)}function qv(o,l,f){var d=re(o)?r2:ud,b=arguments.length<3;return d(o,Y(l,4),f,b,Td)}function Kv(o,l){var f=re(o)?Xn:Od;return f(o,Fo(Y(l,3)))}function Gv(o){var l=re(o)?Cd:z_;return l(o)}function Jv(o,l,f){(f?st(o,l,f):l===t)?l=1:l=ie(l);var d=re(o)?g_:$_;return d(o,l)}function jv(o){var l=re(o)?y_:W_;return l(o)}function Yv(o){if(o==null)return 0;if(dt(o))return zo(o)?ri(o):o.length;var l=rt(o);return l==Zt||l==Qt?o.size:ku(o).length}function Xv(o,l,f){var d=re(o)?lu:V_;return f&&st(o,l,f)&&(l=t),d(o,Y(l,3))}var Zv=ue(function(o,l){if(o==null)return[];var f=l.length;return f>1&&st(o,l[0],l[1])?l=[]:f>2&&st(l[0],l[1],l[2])&&(l=[l[0]]),zd(o,Ze(l,1),[])}),Po=N2||function(){return Xe.Date.now()};function Qv(o,l){if(typeof l!="function")throw new zt(a);return o=ie(o),function(){if(--o<1)return l.apply(this,arguments)}}function Rp(o,l,f){return l=f?t:l,l=o&&l==null?o.length:l,Tn(o,U,t,t,t,t,l)}function Lp(o,l){var f;if(typeof l!="function")throw new zt(a);return o=ie(o),function(){return--o>0&&(f=l.apply(this,arguments)),o<=1&&(l=t),f}}var Yu=ue(function(o,l,f){var d=N;if(f.length){var b=Qn(f,fi(Yu));d|=T}return Tn(o,d,l,f,b)}),Pp=ue(function(o,l,f){var d=N|g;if(f.length){var b=Qn(f,fi(Pp));d|=T}return Tn(l,d,o,f,b)});function Dp(o,l,f){l=f?t:l;var d=Tn(o,k,t,t,t,t,t,l);return d.placeholder=Dp.placeholder,d}function Fp(o,l,f){l=f?t:l;var d=Tn(o,A,t,t,t,t,t,l);return d.placeholder=Fp.placeholder,d}function Bp(o,l,f){var d,b,x,C,O,I,P=0,D=!1,B=!1,q=!0;if(typeof o!="function")throw new zt(a);l=Ut(l)||0,Me(f)&&(D=!!f.leading,B="maxWait"in f,x=B?ze(Ut(f.maxWait)||0,l):x,q="trailing"in f?!!f.trailing:q);function j(Pe){var rn=d,Rn=b;return d=b=t,P=Pe,C=o.apply(Rn,rn),C}function X(Pe){return P=Pe,O=as(ce,l),D?j(Pe):C}function se(Pe){var rn=Pe-I,Rn=Pe-P,rm=l-rn;return B?nt(rm,x-Rn):rm}function Z(Pe){var rn=Pe-I,Rn=Pe-P;return I===t||rn>=l||rn<0||B&&Rn>=x}function ce(){var Pe=Po();if(Z(Pe))return me(Pe);O=as(ce,se(Pe))}function me(Pe){return O=t,q&&d?j(Pe):(d=b=t,C)}function At(){O!==t&&Jd(O),P=0,d=I=b=O=t}function ot(){return O===t?C:me(Po())}function Tt(){var Pe=Po(),rn=Z(Pe);if(d=arguments,b=this,I=Pe,rn){if(O===t)return X(I);if(B)return Jd(O),O=as(ce,l),j(I)}return O===t&&(O=as(ce,l)),C}return Tt.cancel=At,Tt.flush=ot,Tt}var eS=ue(function(o,l){return Ad(o,1,l)}),tS=ue(function(o,l,f){return Ad(o,Ut(l)||0,f)});function nS(o){return Tn(o,ee)}function Do(o,l){if(typeof o!="function"||l!=null&&typeof l!="function")throw new zt(a);var f=function(){var d=arguments,b=l?l.apply(this,d):d[0],x=f.cache;if(x.has(b))return x.get(b);var C=o.apply(this,d);return f.cache=x.set(b,C)||x,C};return f.cache=new(Do.Cache||kn),f}Do.Cache=kn;function Fo(o){if(typeof o!="function")throw new zt(a);return function(){var l=arguments;switch(l.length){case 0:return!o.call(this);case 1:return!o.call(this,l[0]);case 2:return!o.call(this,l[0],l[1]);case 3:return!o.call(this,l[0],l[1],l[2])}return!o.apply(this,l)}}function rS(o){return Lp(2,o)}var iS=U_(function(o,l){l=l.length==1&&re(l[0])?Ae(l[0],Ct(Y())):Ae(Ze(l,1),Ct(Y()));var f=l.length;return ue(function(d){for(var b=-1,x=nt(d.length,f);++b<x;)d[b]=l[b].call(this,d[b]);return xt(o,this,d)})}),Xu=ue(function(o,l){var f=Qn(l,fi(Xu));return Tn(o,T,t,l,f)}),zp=ue(function(o,l){var f=Qn(l,fi(zp));return Tn(o,F,t,l,f)}),sS=On(function(o,l){return Tn(o,H,t,t,t,l)});function oS(o,l){if(typeof o!="function")throw new zt(a);return l=l===t?l:ie(l),ue(o,l)}function aS(o,l){if(typeof o!="function")throw new zt(a);return l=l==null?0:ze(ie(l),0),ue(function(f){var d=f[l],b=ir(f,0,l);return d&&Zn(b,d),xt(o,this,b)})}function lS(o,l,f){var d=!0,b=!0;if(typeof o!="function")throw new zt(a);return Me(f)&&(d="leading"in f?!!f.leading:d,b="trailing"in f?!!f.trailing:b),Bp(o,l,{leading:d,maxWait:l,trailing:b})}function uS(o){return Rp(o,1)}function cS(o,l){return Xu(Pu(l),o)}function fS(){if(!arguments.length)return[];var o=arguments[0];return re(o)?o:[o]}function hS(o){return Ht(o,_)}function dS(o,l){return l=typeof l=="function"?l:t,Ht(o,_,l)}function pS(o){return Ht(o,m|_)}function mS(o,l){return l=typeof l=="function"?l:t,Ht(o,m|_,l)}function gS(o,l){return l==null||kd(o,l,Ve(l))}function nn(o,l){return o===l||o!==o&&l!==l}var yS=Oo(xu),bS=Oo(function(o,l){return o>=l}),Pr=Nd(function(){return arguments}())?Nd:function(o){return Ie(o)&&ve.call(o,"callee")&&!bd.call(o,"callee")},re=R.isArray,_S=Qh?Ct(Qh):A_;function dt(o){return o!=null&&Bo(o.length)&&!In(o)}function Le(o){return Ie(o)&&dt(o)}function wS(o){return o===!0||o===!1||Ie(o)&&it(o)==$i}var sr=L2||lc,vS=ed?Ct(ed):T_;function SS(o){return Ie(o)&&o.nodeType===1&&!ls(o)}function xS(o){if(o==null)return!0;if(dt(o)&&(re(o)||typeof o=="string"||typeof o.splice=="function"||sr(o)||hi(o)||Pr(o)))return!o.length;var l=rt(o);if(l==Zt||l==Qt)return!o.size;if(ss(o))return!ku(o).length;for(var f in o)if(ve.call(o,f))return!1;return!0}function CS(o,l){return ns(o,l)}function ES(o,l,f){f=typeof f=="function"?f:t;var d=f?f(o,l):t;return d===t?ns(o,l,t,f):!!d}function Zu(o){if(!Ie(o))return!1;var l=it(o);return l==js||l==Jy||typeof o.message=="string"&&typeof o.name=="string"&&!ls(o)}function kS(o){return typeof o=="number"&&wd(o)}function In(o){if(!Me(o))return!1;var l=it(o);return l==Ys||l==Ah||l==Gy||l==Yy}function $p(o){return typeof o=="number"&&o==ie(o)}function Bo(o){return typeof o=="number"&&o>-1&&o%1==0&&o<=Yn}function Me(o){var l=typeof o;return o!=null&&(l=="object"||l=="function")}function Ie(o){return o!=null&&typeof o=="object"}var Hp=td?Ct(td):M_;function AS(o,l){return o===l||Eu(o,l,Wu(l))}function TS(o,l,f){return f=typeof f=="function"?f:t,Eu(o,l,Wu(l),f)}function OS(o){return Wp(o)&&o!=+o}function MS(o){if(dw(o))throw new ne(s);return Rd(o)}function IS(o){return o===null}function NS(o){return o==null}function Wp(o){return typeof o=="number"||Ie(o)&&it(o)==Wi}function ls(o){if(!Ie(o)||it(o)!=Cn)return!1;var l=co(o);if(l===null)return!0;var f=ve.call(l,"constructor")&&l.constructor;return typeof f=="function"&&f instanceof f&&oo.call(f)==T2}var Qu=nd?Ct(nd):I_;function RS(o){return $p(o)&&o>=-9007199254740991&&o<=Yn}var Vp=rd?Ct(rd):N_;function zo(o){return typeof o=="string"||!re(o)&&Ie(o)&&it(o)==Ui}function kt(o){return typeof o=="symbol"||Ie(o)&&it(o)==Xs}var hi=id?Ct(id):R_;function LS(o){return o===t}function PS(o){return Ie(o)&&rt(o)==qi}function DS(o){return Ie(o)&&it(o)==Zy}var FS=Oo(Au),BS=Oo(function(o,l){return o<=l});function Up(o){if(!o)return[];if(dt(o))return zo(o)?en(o):ht(o);if(Ji&&o[Ji])return g2(o[Ji]());var l=rt(o),f=l==Zt?pu:l==Qt?ro:di;return f(o)}function Nn(o){if(!o)return o===0?o:0;if(o=Ut(o),o===vt||o===-1/0){var l=o<0?-1:1;return l*Gs}return o===o?o:0}function ie(o){var l=Nn(o),f=l%1;return l===l?f?l-f:l:0}function qp(o){return o?Ir(ie(o),0,St):0}function Ut(o){if(typeof o=="number")return o;if(kt(o))return cn;if(Me(o)){var l=typeof o.valueOf=="function"?o.valueOf():o;o=Me(l)?l+"":l}if(typeof o!="string")return o===0?o:+o;o=cd(o);var f=_b.test(o);return f||vb.test(o)?Qb(o.slice(2),f?2:8):bb.test(o)?cn:+o}function Kp(o){return hn(o,pt(o))}function zS(o){return o?Ir(ie(o),-9007199254740991,Yn):o===0?o:0}function _e(o){return o==null?"":Et(o)}var $S=ui(function(o,l){if(ss(l)||dt(l)){hn(l,Ve(l),o);return}for(var f in l)ve.call(l,f)&&Qi(o,f,l[f])}),Gp=ui(function(o,l){hn(l,pt(l),o)}),$o=ui(function(o,l,f,d){hn(l,pt(l),o,d)}),HS=ui(function(o,l,f,d){hn(l,Ve(l),o,d)}),WS=On(wu);function VS(o,l){var f=li(o);return l==null?f:Ed(f,l)}var US=ue(function(o,l){o=xe(o);var f=-1,d=l.length,b=d>2?l[2]:t;for(b&&st(l[0],l[1],b)&&(d=1);++f<d;)for(var x=l[f],C=pt(x),O=-1,I=C.length;++O<I;){var P=C[O],D=o[P];(D===t||nn(D,si[P])&&!ve.call(o,P))&&(o[P]=x[P])}return o}),qS=ue(function(o){return o.push(t,cp),xt(Jp,t,o)});function KS(o,l){return od(o,Y(l,3),fn)}function GS(o,l){return od(o,Y(l,3),Su)}function JS(o,l){return o==null?o:vu(o,Y(l,3),pt)}function jS(o,l){return o==null?o:Md(o,Y(l,3),pt)}function YS(o,l){return o&&fn(o,Y(l,3))}function XS(o,l){return o&&Su(o,Y(l,3))}function ZS(o){return o==null?[]:vo(o,Ve(o))}function QS(o){return o==null?[]:vo(o,pt(o))}function ec(o,l,f){var d=o==null?t:Nr(o,l);return d===t?f:d}function ex(o,l){return o!=null&&dp(o,l,x_)}function tc(o,l){return o!=null&&dp(o,l,C_)}var tx=sp(function(o,l,f){l!=null&&typeof l.toString!="function"&&(l=ao.call(l)),o[l]=f},rc(mt)),nx=sp(function(o,l,f){l!=null&&typeof l.toString!="function"&&(l=ao.call(l)),ve.call(o,l)?o[l].push(f):o[l]=[f]},Y),rx=ue(ts);function Ve(o){return dt(o)?xd(o):ku(o)}function pt(o){return dt(o)?xd(o,!0):L_(o)}function ix(o,l){var f={};return l=Y(l,3),fn(o,function(d,b,x){An(f,l(d,b,x),d)}),f}function sx(o,l){var f={};return l=Y(l,3),fn(o,function(d,b,x){An(f,b,l(d,b,x))}),f}var ox=ui(function(o,l,f){So(o,l,f)}),Jp=ui(function(o,l,f,d){So(o,l,f,d)}),ax=On(function(o,l){var f={};if(o==null)return f;var d=!1;l=Ae(l,function(x){return x=rr(x,o),d||(d=x.length>1),x}),hn(o,$u(o),f),d&&(f=Ht(f,m|y|_,tw));for(var b=l.length;b--;)Nu(f,l[b]);return f});function lx(o,l){return jp(o,Fo(Y(l)))}var ux=On(function(o,l){return o==null?{}:D_(o,l)});function jp(o,l){if(o==null)return{};var f=Ae($u(o),function(d){return[d]});return l=Y(l),$d(o,f,function(d,b){return l(d,b[0])})}function cx(o,l,f){l=rr(l,o);var d=-1,b=l.length;for(b||(b=1,o=t);++d<b;){var x=o==null?t:o[dn(l[d])];x===t&&(d=b,x=f),o=In(x)?x.call(o):x}return o}function fx(o,l,f){return o==null?o:rs(o,l,f)}function hx(o,l,f,d){return d=typeof d=="function"?d:t,o==null?o:rs(o,l,f,d)}var Yp=lp(Ve),Xp=lp(pt);function dx(o,l,f){var d=re(o),b=d||sr(o)||hi(o);if(l=Y(l,4),f==null){var x=o&&o.constructor;b?f=d?new x:[]:Me(o)?f=In(x)?li(co(o)):{}:f={}}return(b?Bt:fn)(o,function(C,O,I){return l(f,C,O,I)}),f}function px(o,l){return o==null?!0:Nu(o,l)}function mx(o,l,f){return o==null?o:qd(o,l,Pu(f))}function gx(o,l,f,d){return d=typeof d=="function"?d:t,o==null?o:qd(o,l,Pu(f),d)}function di(o){return o==null?[]:du(o,Ve(o))}function yx(o){return o==null?[]:du(o,pt(o))}function bx(o,l,f){return f===t&&(f=l,l=t),f!==t&&(f=Ut(f),f=f===f?f:0),l!==t&&(l=Ut(l),l=l===l?l:0),Ir(Ut(o),l,f)}function _x(o,l,f){return l=Nn(l),f===t?(f=l,l=0):f=Nn(f),o=Ut(o),E_(o,l,f)}function wx(o,l,f){if(f&&typeof f!="boolean"&&st(o,l,f)&&(l=f=t),f===t&&(typeof l=="boolean"?(f=l,l=t):typeof o=="boolean"&&(f=o,o=t)),o===t&&l===t?(o=0,l=1):(o=Nn(o),l===t?(l=o,o=0):l=Nn(l)),o>l){var d=o;o=l,l=d}if(f||o%1||l%1){var b=vd();return nt(o+b*(l-o+Zb("1e-"+((b+"").length-1))),l)}return Ou(o,l)}var vx=ci(function(o,l,f){return l=l.toLowerCase(),o+(f?Zp(l):l)});function Zp(o){return nc(_e(o).toLowerCase())}function Qp(o){return o=_e(o),o&&o.replace(xb,f2).replace(Wb,"")}function Sx(o,l,f){o=_e(o),l=Et(l);var d=o.length;f=f===t?d:Ir(ie(f),0,d);var b=f;return f-=l.length,f>=0&&o.slice(f,b)==l}function xx(o){return o=_e(o),o&&rb.test(o)?o.replace(Mh,h2):o}function Cx(o){return o=_e(o),o&&ub.test(o)?o.replace(Xl,"\\$&"):o}var Ex=ci(function(o,l,f){return o+(f?"-":"")+l.toLowerCase()}),kx=ci(function(o,l,f){return o+(f?" ":"")+l.toLowerCase()}),Ax=np("toLowerCase");function Tx(o,l,f){o=_e(o),l=ie(l);var d=l?ri(o):0;if(!l||d>=l)return o;var b=(l-d)/2;return To(mo(b),f)+o+To(po(b),f)}function Ox(o,l,f){o=_e(o),l=ie(l);var d=l?ri(o):0;return l&&d<l?o+To(l-d,f):o}function Mx(o,l,f){o=_e(o),l=ie(l);var d=l?ri(o):0;return l&&d<l?To(l-d,f)+o:o}function Ix(o,l,f){return f||l==null?l=0:l&&(l=+l),B2(_e(o).replace(Zl,""),l||0)}function Nx(o,l,f){return(f?st(o,l,f):l===t)?l=1:l=ie(l),Mu(_e(o),l)}function Rx(){var o=arguments,l=_e(o[0]);return o.length<3?l:l.replace(o[1],o[2])}var Lx=ci(function(o,l,f){return o+(f?"_":"")+l.toLowerCase()});function Px(o,l,f){return f&&typeof f!="number"&&st(o,l,f)&&(l=f=t),f=f===t?St:f>>>0,f?(o=_e(o),o&&(typeof l=="string"||l!=null&&!Qu(l))&&(l=Et(l),!l&&ni(o))?ir(en(o),0,f):o.split(l,f)):[]}var Dx=ci(function(o,l,f){return o+(f?" ":"")+nc(l)});function Fx(o,l,f){return o=_e(o),f=f==null?0:Ir(ie(f),0,o.length),l=Et(l),o.slice(f,f+l.length)==l}function Bx(o,l,f){var d=w.templateSettings;f&&st(o,l,f)&&(l=t),o=_e(o),l=$o({},l,d,up);var b=$o({},l.imports,d.imports,up),x=Ve(b),C=du(b,x),O,I,P=0,D=l.interpolate||Zs,B="__p += '",q=mu((l.escape||Zs).source+"|"+D.source+"|"+(D===Ih?yb:Zs).source+"|"+(l.evaluate||Zs).source+"|$","g"),j="//# sourceURL="+(ve.call(l,"sourceURL")?(l.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Gb+"]")+`
|
|
48
|
-
`;o.replace(q,function(Z,ce,me,At,ot,
|
|
51
|
+
`)}function hv(o){return re(o)||Hr(o)||!!(tp&&o&&o[tp])}function Rn(o,l){var f=typeof o;return l=l??er,!!l&&(f=="number"||f!="symbol"&&E_.test(o))&&o>-1&&o%1==0&&o<l}function st(o,l,f){if(!Me(f))return!1;var p=typeof l;return(p=="number"?pt(f)&&Rn(l,f.length):p=="string"&&l in f)?sn(f[l],o):!1}function dc(o,l){if(re(o))return!1;var f=typeof o;return f=="number"||f=="symbol"||f=="boolean"||o==null||Tt(o)?!0:u_.test(o)||!l_.test(o)||l!=null&&o in xe(l)}function dv(o){var l=typeof o;return l=="string"||l=="number"||l=="symbol"||l=="boolean"?o!=="__proto__":o===null}function pc(o){var l=qo(o),f=w[l];if(typeof f!="function"||!(l in fe.prototype))return!1;if(o===f)return!0;var p=cc(f);return!!p&&o===p[0]}function pv(o){return!!Xd&&Xd in o}var mv=vo?Ln:Ic;function ws(o){var l=o&&o.constructor,f=typeof l=="function"&&l.prototype||mi;return o===f}function Xp(o){return o===o&&!Me(o)}function Zp(o,l){return function(f){return f==null?!1:f[o]===l&&(l!==t||o in xe(f))}}function gv(o){var l=Xo(o,function(p){return f.size===h&&f.clear(),p}),f=l.cache;return l}function yv(o,l){var f=o[1],p=l[1],b=f|p,x=b<(N|g|U),C=p==U&&f==k||p==U&&f==z&&o[7].length<=l[8]||p==(U|z)&&l[7].length<=l[8]&&f==k;if(!(x||C))return o;p&N&&(o[2]=l[2],b|=f&N?0:S);var O=l[3];if(O){var I=o[3];o[3]=I?Lp(I,O,l[4]):O,o[4]=I?rr(o[3],m):l[4]}return O=l[5],O&&(I=o[5],o[5]=I?Pp(I,O,l[6]):O,o[6]=I?rr(o[5],m):l[6]),O=l[7],O&&(o[7]=O),p&U&&(o[8]=o[8]==null?l[8]:nt(o[8],l[8])),o[9]==null&&(o[9]=l[9]),o[0]=l[0],o[1]=b,o}function bv(o){var l=[];if(o!=null)for(var f in xe(o))l.push(f);return l}function _v(o){return xo.call(o)}function Qp(o,l,f){return l=Be(l===t?o.length-1:l,0),function(){for(var p=arguments,b=-1,x=Be(p.length-l,0),C=R(x);++b<x;)C[b]=p[l+b];b=-1;for(var O=R(l+1);++b<l;)O[b]=p[b];return O[l]=f(C),Et(o,this,O)}}function em(o,l){return l.length<2?o:Fr(o,Vt(l,0,-1))}function wv(o,l){for(var f=o.length,p=nt(l.length,f),b=dt(o);p--;){var x=l[p];o[p]=Rn(x,f)?b[x]:t}return o}function mc(o,l){if(!(l==="constructor"&&typeof o[l]=="function")&&l!="__proto__")return o[l]}var tm=rm(Ep),vs=P2||function(o,l){return Xe.setTimeout(o,l)},gc=rm(Vw);function nm(o,l,f){var p=l+"";return gc(o,fv(p,vv(lv(p),f)))}function rm(o){var l=0,f=0;return function(){var p=B2(),b=Cn-(p-f);if(f=p,b>0){if(++l>=vt)return arguments[0]}else l=0;return o.apply(t,arguments)}}function Go(o,l){var f=-1,p=o.length,b=p-1;for(l=l===t?p:l;++f<l;){var x=Zu(f,b),C=o[x];o[x]=o[f],o[f]=C}return o.length=l,o}var im=gv(function(o){var l=[];return o.charCodeAt(0)===46&&l.push(""),o.replace(c_,function(f,p,b,x){l.push(b?x.replace(b_,"$1"):p||f)}),l});function mn(o){if(typeof o=="string"||Tt(o))return o;var l=o+"";return l=="0"&&1/o==-1/0?"-0":l}function zr(o){if(o!=null){try{return So.call(o)}catch{}try{return o+""}catch{}}return""}function vv(o,l){return Bt(cu,function(f){var p="_."+f[0];l&f[1]&&!yo(o,p)&&o.push(p)}),o.sort()}function sm(o){if(o instanceof fe)return o.clone();var l=new Ht(o.__wrapped__,o.__chain__);return l.__actions__=dt(o.__actions__),l.__index__=o.__index__,l.__values__=o.__values__,l}function Sv(o,l,f){(f?st(o,l,f):l===t)?l=1:l=Be(ie(l),0);var p=o==null?0:o.length;if(!p||l<1)return[];for(var b=0,x=0,C=R(Oo(p/l));b<p;)C[x++]=Vt(o,b,b+=l);return C}function xv(o){for(var l=-1,f=o==null?0:o.length,p=0,b=[];++l<f;){var x=o[l];x&&(b[p++]=x)}return b}function Ev(){var o=arguments.length;if(!o)return[];for(var l=R(o-1),f=arguments[0],p=o;p--;)l[p-1]=arguments[p];return nr(re(f)?dt(f):[f],Ze(l,1))}var Cv=ue(function(o,l){return Le(o)?ms(o,Ze(l,1,Le,!0)):[]}),kv=ue(function(o,l){var f=Ut(l);return Le(f)&&(f=t),Le(o)?ms(o,Ze(l,1,Le,!0),Y(f,2)):[]}),Tv=ue(function(o,l){var f=Ut(l);return Le(f)&&(f=t),Le(o)?ms(o,Ze(l,1,Le,!0),t,f):[]});function Av(o,l,f){var p=o==null?0:o.length;return p?(l=f||l===t?1:ie(l),Vt(o,l<0?0:l,p)):[]}function Ov(o,l,f){var p=o==null?0:o.length;return p?(l=f||l===t?1:ie(l),l=p-l,Vt(o,0,l<0?0:l)):[]}function Mv(o,l){return o&&o.length?Bo(o,Y(l,3),!0,!0):[]}function Iv(o,l){return o&&o.length?Bo(o,Y(l,3),!0):[]}function Nv(o,l,f,p){var b=o==null?0:o.length;return b?(f&&typeof f!="number"&&st(o,l,f)&&(f=0,p=b),Ew(o,l,f,p)):[]}function om(o,l,f){var p=o==null?0:o.length;if(!p)return-1;var b=f==null?0:ie(f);return b<0&&(b=Be(p+b,0)),bo(o,Y(l,3),b)}function am(o,l,f){var p=o==null?0:o.length;if(!p)return-1;var b=p-1;return f!==t&&(b=ie(f),b=f<0?Be(p+b,0):nt(b,p-1)),bo(o,Y(l,3),b,!0)}function lm(o){var l=o==null?0:o.length;return l?Ze(o,1):[]}function Rv(o){var l=o==null?0:o.length;return l?Ze(o,St):[]}function Lv(o,l){var f=o==null?0:o.length;return f?(l=l===t?1:ie(l),Ze(o,l)):[]}function Pv(o){for(var l=-1,f=o==null?0:o.length,p={};++l<f;){var b=o[l];p[b[0]]=b[1]}return p}function um(o){return o&&o.length?o[0]:t}function Dv(o,l,f){var p=o==null?0:o.length;if(!p)return-1;var b=f==null?0:ie(f);return b<0&&(b=Be(p+b,0)),fi(o,l,b)}function $v(o){var l=o==null?0:o.length;return l?Vt(o,0,-1):[]}var Fv=ue(function(o){var l=Te(o,rc);return l.length&&l[0]===o[0]?Gu(l):[]}),Bv=ue(function(o){var l=Ut(o),f=Te(o,rc);return l===Ut(f)?l=t:f.pop(),f.length&&f[0]===o[0]?Gu(f,Y(l,2)):[]}),zv=ue(function(o){var l=Ut(o),f=Te(o,rc);return l=typeof l=="function"?l:t,l&&f.pop(),f.length&&f[0]===o[0]?Gu(f,t,l):[]});function Hv(o,l){return o==null?"":$2.call(o,l)}function Ut(o){var l=o==null?0:o.length;return l?o[l-1]:t}function Wv(o,l,f){var p=o==null?0:o.length;if(!p)return-1;var b=p;return f!==t&&(b=ie(f),b=b<0?Be(p+b,0):nt(b,p-1)),l===l?v2(o,l,b):bo(o,Vd,b,!0)}function Vv(o,l){return o&&o.length?wp(o,ie(l)):t}var Uv=ue(cm);function cm(o,l){return o&&o.length&&l&&l.length?Xu(o,l):o}function qv(o,l,f){return o&&o.length&&l&&l.length?Xu(o,l,Y(f,2)):o}function Kv(o,l,f){return o&&o.length&&l&&l.length?Xu(o,l,t,f):o}var Gv=Nn(function(o,l){var f=o==null?0:o.length,p=Vu(o,l);return xp(o,Te(l,function(b){return Rn(b,f)?+b:b}).sort(Rp)),p});function Jv(o,l){var f=[];if(!(o&&o.length))return f;var p=-1,b=[],x=o.length;for(l=Y(l,3);++p<x;){var C=o[p];l(C,p,o)&&(f.push(C),b.push(p))}return xp(o,b),f}function yc(o){return o==null?o:H2.call(o)}function jv(o,l,f){var p=o==null?0:o.length;return p?(f&&typeof f!="number"&&st(o,l,f)?(l=0,f=p):(l=l==null?0:ie(l),f=f===t?p:ie(f)),Vt(o,l,f)):[]}function Yv(o,l){return Fo(o,l)}function Xv(o,l,f){return ec(o,l,Y(f,2))}function Zv(o,l){var f=o==null?0:o.length;if(f){var p=Fo(o,l);if(p<f&&sn(o[p],l))return p}return-1}function Qv(o,l){return Fo(o,l,!0)}function eS(o,l,f){return ec(o,l,Y(f,2),!0)}function tS(o,l){var f=o==null?0:o.length;if(f){var p=Fo(o,l,!0)-1;if(sn(o[p],l))return p}return-1}function nS(o){return o&&o.length?Cp(o):[]}function rS(o,l){return o&&o.length?Cp(o,Y(l,2)):[]}function iS(o){var l=o==null?0:o.length;return l?Vt(o,1,l):[]}function sS(o,l,f){return o&&o.length?(l=f||l===t?1:ie(l),Vt(o,0,l<0?0:l)):[]}function oS(o,l,f){var p=o==null?0:o.length;return p?(l=f||l===t?1:ie(l),l=p-l,Vt(o,l<0?0:l,p)):[]}function aS(o,l){return o&&o.length?Bo(o,Y(l,3),!1,!0):[]}function lS(o,l){return o&&o.length?Bo(o,Y(l,3)):[]}var uS=ue(function(o){return or(Ze(o,1,Le,!0))}),cS=ue(function(o){var l=Ut(o);return Le(l)&&(l=t),or(Ze(o,1,Le,!0),Y(l,2))}),fS=ue(function(o){var l=Ut(o);return l=typeof l=="function"?l:t,or(Ze(o,1,Le,!0),t,l)});function hS(o){return o&&o.length?or(o):[]}function dS(o,l){return o&&o.length?or(o,Y(l,2)):[]}function pS(o,l){return l=typeof l=="function"?l:t,o&&o.length?or(o,t,l):[]}function bc(o){if(!(o&&o.length))return[];var l=0;return o=tr(o,function(f){if(Le(f))return l=Be(f.length,l),!0}),Pu(l,function(f){return Te(o,Nu(f))})}function fm(o,l){if(!(o&&o.length))return[];var f=bc(o);return l==null?f:Te(f,function(p){return Et(l,t,p)})}var mS=ue(function(o,l){return Le(o)?ms(o,l):[]}),gS=ue(function(o){return nc(tr(o,Le))}),yS=ue(function(o){var l=Ut(o);return Le(l)&&(l=t),nc(tr(o,Le),Y(l,2))}),bS=ue(function(o){var l=Ut(o);return l=typeof l=="function"?l:t,nc(tr(o,Le),t,l)}),_S=ue(bc);function wS(o,l){return Op(o||[],l||[],ps)}function vS(o,l){return Op(o||[],l||[],bs)}var SS=ue(function(o){var l=o.length,f=l>1?o[l-1]:t;return f=typeof f=="function"?(o.pop(),f):t,fm(o,f)});function hm(o){var l=w(o);return l.__chain__=!0,l}function xS(o,l){return l(o),o}function Jo(o,l){return l(o)}var ES=Nn(function(o){var l=o.length,f=l?o[0]:0,p=this.__wrapped__,b=function(x){return Vu(x,o)};return l>1||this.__actions__.length||!(p instanceof fe)||!Rn(f)?this.thru(b):(p=p.slice(f,+f+(l?1:0)),p.__actions__.push({func:Jo,args:[b],thisArg:t}),new Ht(p,this.__chain__).thru(function(x){return l&&!x.length&&x.push(t),x}))});function CS(){return hm(this)}function kS(){return new Ht(this.value(),this.__chain__)}function TS(){this.__values__===t&&(this.__values__=km(this.value()));var o=this.__index__>=this.__values__.length,l=o?t:this.__values__[this.__index__++];return{done:o,value:l}}function AS(){return this}function OS(o){for(var l,f=this;f instanceof Ro;){var p=sm(f);p.__index__=0,p.__values__=t,l?b.__wrapped__=p:l=p;var b=p;f=f.__wrapped__}return b.__wrapped__=o,l}function MS(){var o=this.__wrapped__;if(o instanceof fe){var l=o;return this.__actions__.length&&(l=new fe(this)),l=l.reverse(),l.__actions__.push({func:Jo,args:[yc],thisArg:t}),new Ht(l,this.__chain__)}return this.thru(yc)}function IS(){return Ap(this.__wrapped__,this.__actions__)}var NS=zo(function(o,l,f){ve.call(o,f)?++o[f]:Mn(o,f,1)});function RS(o,l,f){var p=re(o)?Hd:xw;return f&&st(o,l,f)&&(l=t),p(o,Y(l,3))}function LS(o,l){var f=re(o)?tr:fp;return f(o,Y(l,3))}var PS=Bp(om),DS=Bp(am);function $S(o,l){return Ze(jo(o,l),1)}function FS(o,l){return Ze(jo(o,l),St)}function BS(o,l,f){return f=f===t?1:ie(f),Ze(jo(o,l),f)}function dm(o,l){var f=re(o)?Bt:sr;return f(o,Y(l,3))}function pm(o,l){var f=re(o)?i2:cp;return f(o,Y(l,3))}var zS=zo(function(o,l,f){ve.call(o,f)?o[f].push(l):Mn(o,f,[l])});function HS(o,l,f,p){o=pt(o)?o:xi(o),f=f&&!p?ie(f):0;var b=o.length;return f<0&&(f=Be(b+f,0)),ea(o)?f<=b&&o.indexOf(l,f)>-1:!!b&&fi(o,l,f)>-1}var WS=ue(function(o,l,f){var p=-1,b=typeof l=="function",x=pt(o)?R(o.length):[];return sr(o,function(C){x[++p]=b?Et(l,C,f):gs(C,l,f)}),x}),VS=zo(function(o,l,f){Mn(o,f,l)});function jo(o,l){var f=re(o)?Te:yp;return f(o,Y(l,3))}function US(o,l,f,p){return o==null?[]:(re(l)||(l=l==null?[]:[l]),f=p?t:f,re(f)||(f=f==null?[]:[f]),vp(o,l,f))}var qS=zo(function(o,l,f){o[f?0:1].push(l)},function(){return[[],[]]});function KS(o,l,f){var p=re(o)?Mu:qd,b=arguments.length<3;return p(o,Y(l,4),f,b,sr)}function GS(o,l,f){var p=re(o)?s2:qd,b=arguments.length<3;return p(o,Y(l,4),f,b,cp)}function JS(o,l){var f=re(o)?tr:fp;return f(o,Zo(Y(l,3)))}function jS(o){var l=re(o)?op:Hw;return l(o)}function YS(o,l,f){(f?st(o,l,f):l===t)?l=1:l=ie(l);var p=re(o)?bw:Ww;return p(o,l)}function XS(o){var l=re(o)?_w:Uw;return l(o)}function ZS(o){if(o==null)return 0;if(pt(o))return ea(o)?di(o):o.length;var l=rt(o);return l==en||l==tn?o.size:ju(o).length}function QS(o,l,f){var p=re(o)?Iu:qw;return f&&st(o,l,f)&&(l=t),p(o,Y(l,3))}var ex=ue(function(o,l){if(o==null)return[];var f=l.length;return f>1&&st(o,l[0],l[1])?l=[]:f>2&&st(l[0],l[1],l[2])&&(l=[l[0]]),vp(o,Ze(l,1),[])}),Yo=L2||function(){return Xe.Date.now()};function tx(o,l){if(typeof l!="function")throw new zt(a);return o=ie(o),function(){if(--o<1)return l.apply(this,arguments)}}function mm(o,l,f){return l=f?t:l,l=o&&l==null?o.length:l,In(o,U,t,t,t,t,l)}function gm(o,l){var f;if(typeof l!="function")throw new zt(a);return o=ie(o),function(){return--o>0&&(f=l.apply(this,arguments)),o<=1&&(l=t),f}}var _c=ue(function(o,l,f){var p=N;if(f.length){var b=rr(f,vi(_c));p|=A}return In(o,p,l,f,b)}),ym=ue(function(o,l,f){var p=N|g;if(f.length){var b=rr(f,vi(ym));p|=A}return In(l,p,o,f,b)});function bm(o,l,f){l=f?t:l;var p=In(o,k,t,t,t,t,t,l);return p.placeholder=bm.placeholder,p}function _m(o,l,f){l=f?t:l;var p=In(o,T,t,t,t,t,t,l);return p.placeholder=_m.placeholder,p}function wm(o,l,f){var p,b,x,C,O,I,P=0,D=!1,F=!1,q=!0;if(typeof o!="function")throw new zt(a);l=qt(l)||0,Me(f)&&(D=!!f.leading,F="maxWait"in f,x=F?Be(qt(f.maxWait)||0,l):x,q="trailing"in f?!!f.trailing:q);function j(Pe){var on=p,Dn=b;return p=b=t,P=Pe,C=o.apply(Dn,on),C}function X(Pe){return P=Pe,O=vs(ce,l),D?j(Pe):C}function se(Pe){var on=Pe-I,Dn=Pe-P,Bm=l-on;return F?nt(Bm,x-Dn):Bm}function Z(Pe){var on=Pe-I,Dn=Pe-P;return I===t||on>=l||on<0||F&&Dn>=x}function ce(){var Pe=Yo();if(Z(Pe))return me(Pe);O=vs(ce,se(Pe))}function me(Pe){return O=t,q&&p?j(Pe):(p=b=t,C)}function At(){O!==t&&Mp(O),P=0,p=I=b=O=t}function ot(){return O===t?C:me(Yo())}function Ot(){var Pe=Yo(),on=Z(Pe);if(p=arguments,b=this,I=Pe,on){if(O===t)return X(I);if(F)return Mp(O),O=vs(ce,l),j(I)}return O===t&&(O=vs(ce,l)),C}return Ot.cancel=At,Ot.flush=ot,Ot}var nx=ue(function(o,l){return up(o,1,l)}),rx=ue(function(o,l,f){return up(o,qt(l)||0,f)});function ix(o){return In(o,ee)}function Xo(o,l){if(typeof o!="function"||l!=null&&typeof l!="function")throw new zt(a);var f=function(){var p=arguments,b=l?l.apply(this,p):p[0],x=f.cache;if(x.has(b))return x.get(b);var C=o.apply(this,p);return f.cache=x.set(b,C)||x,C};return f.cache=new(Xo.Cache||On),f}Xo.Cache=On;function Zo(o){if(typeof o!="function")throw new zt(a);return function(){var l=arguments;switch(l.length){case 0:return!o.call(this);case 1:return!o.call(this,l[0]);case 2:return!o.call(this,l[0],l[1]);case 3:return!o.call(this,l[0],l[1],l[2])}return!o.apply(this,l)}}function sx(o){return gm(2,o)}var ox=Kw(function(o,l){l=l.length==1&&re(l[0])?Te(l[0],Ct(Y())):Te(Ze(l,1),Ct(Y()));var f=l.length;return ue(function(p){for(var b=-1,x=nt(p.length,f);++b<x;)p[b]=l[b].call(this,p[b]);return Et(o,this,p)})}),wc=ue(function(o,l){var f=rr(l,vi(wc));return In(o,A,t,l,f)}),vm=ue(function(o,l){var f=rr(l,vi(vm));return In(o,$,t,l,f)}),ax=Nn(function(o,l){return In(o,z,t,t,t,l)});function lx(o,l){if(typeof o!="function")throw new zt(a);return l=l===t?l:ie(l),ue(o,l)}function ux(o,l){if(typeof o!="function")throw new zt(a);return l=l==null?0:Be(ie(l),0),ue(function(f){var p=f[l],b=lr(f,0,l);return p&&nr(b,p),Et(o,this,b)})}function cx(o,l,f){var p=!0,b=!0;if(typeof o!="function")throw new zt(a);return Me(f)&&(p="leading"in f?!!f.leading:p,b="trailing"in f?!!f.trailing:b),wm(o,l,{leading:p,maxWait:l,trailing:b})}function fx(o){return mm(o,1)}function hx(o,l){return wc(ic(l),o)}function dx(){if(!arguments.length)return[];var o=arguments[0];return re(o)?o:[o]}function px(o){return Wt(o,_)}function mx(o,l){return l=typeof l=="function"?l:t,Wt(o,_,l)}function gx(o){return Wt(o,d|_)}function yx(o,l){return l=typeof l=="function"?l:t,Wt(o,d|_,l)}function bx(o,l){return l==null||lp(o,l,Ve(l))}function sn(o,l){return o===l||o!==o&&l!==l}var _x=Uo(Ku),wx=Uo(function(o,l){return o>=l}),Hr=pp(function(){return arguments}())?pp:function(o){return Ie(o)&&ve.call(o,"callee")&&!ep.call(o,"callee")},re=R.isArray,vx=Pd?Ct(Pd):Ow;function pt(o){return o!=null&&Qo(o.length)&&!Ln(o)}function Le(o){return Ie(o)&&pt(o)}function Sx(o){return o===!0||o===!1||Ie(o)&&it(o)==es}var ur=D2||Ic,xx=Dd?Ct(Dd):Mw;function Ex(o){return Ie(o)&&o.nodeType===1&&!Ss(o)}function Cx(o){if(o==null)return!0;if(pt(o)&&(re(o)||typeof o=="string"||typeof o.splice=="function"||ur(o)||Si(o)||Hr(o)))return!o.length;var l=rt(o);if(l==en||l==tn)return!o.size;if(ws(o))return!ju(o).length;for(var f in o)if(ve.call(o,f))return!1;return!0}function kx(o,l){return ys(o,l)}function Tx(o,l,f){f=typeof f=="function"?f:t;var p=f?f(o,l):t;return p===t?ys(o,l,t,f):!!p}function vc(o){if(!Ie(o))return!1;var l=it(o);return l==co||l==Yb||typeof o.message=="string"&&typeof o.name=="string"&&!Ss(o)}function Ax(o){return typeof o=="number"&&np(o)}function Ln(o){if(!Me(o))return!1;var l=it(o);return l==fo||l==ud||l==jb||l==Zb}function Sm(o){return typeof o=="number"&&o==ie(o)}function Qo(o){return typeof o=="number"&&o>-1&&o%1==0&&o<=er}function Me(o){var l=typeof o;return o!=null&&(l=="object"||l=="function")}function Ie(o){return o!=null&&typeof o=="object"}var xm=$d?Ct($d):Nw;function Ox(o,l){return o===l||Ju(o,l,fc(l))}function Mx(o,l,f){return f=typeof f=="function"?f:t,Ju(o,l,fc(l),f)}function Ix(o){return Em(o)&&o!=+o}function Nx(o){if(mv(o))throw new ne(s);return mp(o)}function Rx(o){return o===null}function Lx(o){return o==null}function Em(o){return typeof o=="number"||Ie(o)&&it(o)==ns}function Ss(o){if(!Ie(o)||it(o)!=Tn)return!1;var l=ko(o);if(l===null)return!0;var f=ve.call(l,"constructor")&&l.constructor;return typeof f=="function"&&f instanceof f&&So.call(f)==M2}var Sc=Fd?Ct(Fd):Rw;function Px(o){return Sm(o)&&o>=-9007199254740991&&o<=er}var Cm=Bd?Ct(Bd):Lw;function ea(o){return typeof o=="string"||!re(o)&&Ie(o)&&it(o)==is}function Tt(o){return typeof o=="symbol"||Ie(o)&&it(o)==ho}var Si=zd?Ct(zd):Pw;function Dx(o){return o===t}function $x(o){return Ie(o)&&rt(o)==ss}function Fx(o){return Ie(o)&&it(o)==e_}var Bx=Uo(Yu),zx=Uo(function(o,l){return o<=l});function km(o){if(!o)return[];if(pt(o))return ea(o)?nn(o):dt(o);if(us&&o[us])return b2(o[us]());var l=rt(o),f=l==en?$u:l==tn?_o:xi;return f(o)}function Pn(o){if(!o)return o===0?o:0;if(o=qt(o),o===St||o===-1/0){var l=o<0?-1:1;return l*lo}return o===o?o:0}function ie(o){var l=Pn(o),f=l%1;return l===l?f?l-f:l:0}function Tm(o){return o?$r(ie(o),0,xt):0}function qt(o){if(typeof o=="number")return o;if(Tt(o))return hn;if(Me(o)){var l=typeof o.valueOf=="function"?o.valueOf():o;o=Me(l)?l+"":l}if(typeof o!="string")return o===0?o:+o;o=Kd(o);var f=v_.test(o);return f||x_.test(o)?t2(o.slice(2),f?2:8):w_.test(o)?hn:+o}function Am(o){return pn(o,mt(o))}function Hx(o){return o?$r(ie(o),-9007199254740991,er):o===0?o:0}function _e(o){return o==null?"":kt(o)}var Wx=_i(function(o,l){if(ws(l)||pt(l)){pn(l,Ve(l),o);return}for(var f in l)ve.call(l,f)&&ps(o,f,l[f])}),Om=_i(function(o,l){pn(l,mt(l),o)}),ta=_i(function(o,l,f,p){pn(l,mt(l),o,p)}),Vx=_i(function(o,l,f,p){pn(l,Ve(l),o,p)}),Ux=Nn(Vu);function qx(o,l){var f=bi(o);return l==null?f:ap(f,l)}var Kx=ue(function(o,l){o=xe(o);var f=-1,p=l.length,b=p>2?l[2]:t;for(b&&st(l[0],l[1],b)&&(p=1);++f<p;)for(var x=l[f],C=mt(x),O=-1,I=C.length;++O<I;){var P=C[O],D=o[P];(D===t||sn(D,mi[P])&&!ve.call(o,P))&&(o[P]=x[P])}return o}),Gx=ue(function(o){return o.push(t,Kp),Et(Mm,t,o)});function Jx(o,l){return Wd(o,Y(l,3),dn)}function jx(o,l){return Wd(o,Y(l,3),qu)}function Yx(o,l){return o==null?o:Uu(o,Y(l,3),mt)}function Xx(o,l){return o==null?o:hp(o,Y(l,3),mt)}function Zx(o,l){return o&&dn(o,Y(l,3))}function Qx(o,l){return o&&qu(o,Y(l,3))}function eE(o){return o==null?[]:Do(o,Ve(o))}function tE(o){return o==null?[]:Do(o,mt(o))}function xc(o,l,f){var p=o==null?t:Fr(o,l);return p===t?f:p}function nE(o,l){return o!=null&&jp(o,l,Cw)}function Ec(o,l){return o!=null&&jp(o,l,kw)}var rE=Hp(function(o,l,f){l!=null&&typeof l.toString!="function"&&(l=xo.call(l)),o[l]=f},kc(gt)),iE=Hp(function(o,l,f){l!=null&&typeof l.toString!="function"&&(l=xo.call(l)),ve.call(o,l)?o[l].push(f):o[l]=[f]},Y),sE=ue(gs);function Ve(o){return pt(o)?sp(o):ju(o)}function mt(o){return pt(o)?sp(o,!0):Dw(o)}function oE(o,l){var f={};return l=Y(l,3),dn(o,function(p,b,x){Mn(f,l(p,b,x),p)}),f}function aE(o,l){var f={};return l=Y(l,3),dn(o,function(p,b,x){Mn(f,b,l(p,b,x))}),f}var lE=_i(function(o,l,f){$o(o,l,f)}),Mm=_i(function(o,l,f,p){$o(o,l,f,p)}),uE=Nn(function(o,l){var f={};if(o==null)return f;var p=!1;l=Te(l,function(x){return x=ar(x,o),p||(p=x.length>1),x}),pn(o,uc(o),f),p&&(f=Wt(f,d|y|_,rv));for(var b=l.length;b--;)tc(f,l[b]);return f});function cE(o,l){return Im(o,Zo(Y(l)))}var fE=Nn(function(o,l){return o==null?{}:Fw(o,l)});function Im(o,l){if(o==null)return{};var f=Te(uc(o),function(p){return[p]});return l=Y(l),Sp(o,f,function(p,b){return l(p,b[0])})}function hE(o,l,f){l=ar(l,o);var p=-1,b=l.length;for(b||(b=1,o=t);++p<b;){var x=o==null?t:o[mn(l[p])];x===t&&(p=b,x=f),o=Ln(x)?x.call(o):x}return o}function dE(o,l,f){return o==null?o:bs(o,l,f)}function pE(o,l,f,p){return p=typeof p=="function"?p:t,o==null?o:bs(o,l,f,p)}var Nm=Up(Ve),Rm=Up(mt);function mE(o,l,f){var p=re(o),b=p||ur(o)||Si(o);if(l=Y(l,4),f==null){var x=o&&o.constructor;b?f=p?new x:[]:Me(o)?f=Ln(x)?bi(ko(o)):{}:f={}}return(b?Bt:dn)(o,function(C,O,I){return l(f,C,O,I)}),f}function gE(o,l){return o==null?!0:tc(o,l)}function yE(o,l,f){return o==null?o:Tp(o,l,ic(f))}function bE(o,l,f,p){return p=typeof p=="function"?p:t,o==null?o:Tp(o,l,ic(f),p)}function xi(o){return o==null?[]:Du(o,Ve(o))}function _E(o){return o==null?[]:Du(o,mt(o))}function wE(o,l,f){return f===t&&(f=l,l=t),f!==t&&(f=qt(f),f=f===f?f:0),l!==t&&(l=qt(l),l=l===l?l:0),$r(qt(o),l,f)}function vE(o,l,f){return l=Pn(l),f===t?(f=l,l=0):f=Pn(f),o=qt(o),Tw(o,l,f)}function SE(o,l,f){if(f&&typeof f!="boolean"&&st(o,l,f)&&(l=f=t),f===t&&(typeof l=="boolean"?(f=l,l=t):typeof o=="boolean"&&(f=o,o=t)),o===t&&l===t?(o=0,l=1):(o=Pn(o),l===t?(l=o,o=0):l=Pn(l)),o>l){var p=o;o=l,l=p}if(f||o%1||l%1){var b=rp();return nt(o+b*(l-o+e2("1e-"+((b+"").length-1))),l)}return Zu(o,l)}var xE=wi(function(o,l,f){return l=l.toLowerCase(),o+(f?Lm(l):l)});function Lm(o){return Cc(_e(o).toLowerCase())}function Pm(o){return o=_e(o),o&&o.replace(C_,d2).replace(U_,"")}function EE(o,l,f){o=_e(o),l=kt(l);var p=o.length;f=f===t?p:$r(ie(f),0,p);var b=f;return f-=l.length,f>=0&&o.slice(f,b)==l}function CE(o){return o=_e(o),o&&s_.test(o)?o.replace(hd,p2):o}function kE(o){return o=_e(o),o&&f_.test(o)?o.replace(wu,"\\$&"):o}var TE=wi(function(o,l,f){return o+(f?"-":"")+l.toLowerCase()}),AE=wi(function(o,l,f){return o+(f?" ":"")+l.toLowerCase()}),OE=Fp("toLowerCase");function ME(o,l,f){o=_e(o),l=ie(l);var p=l?di(o):0;if(!l||p>=l)return o;var b=(l-p)/2;return Vo(Mo(b),f)+o+Vo(Oo(b),f)}function IE(o,l,f){o=_e(o),l=ie(l);var p=l?di(o):0;return l&&p<l?o+Vo(l-p,f):o}function NE(o,l,f){o=_e(o),l=ie(l);var p=l?di(o):0;return l&&p<l?Vo(l-p,f)+o:o}function RE(o,l,f){return f||l==null?l=0:l&&(l=+l),z2(_e(o).replace(vu,""),l||0)}function LE(o,l,f){return(f?st(o,l,f):l===t)?l=1:l=ie(l),Qu(_e(o),l)}function PE(){var o=arguments,l=_e(o[0]);return o.length<3?l:l.replace(o[1],o[2])}var DE=wi(function(o,l,f){return o+(f?"_":"")+l.toLowerCase()});function $E(o,l,f){return f&&typeof f!="number"&&st(o,l,f)&&(l=f=t),f=f===t?xt:f>>>0,f?(o=_e(o),o&&(typeof l=="string"||l!=null&&!Sc(l))&&(l=kt(l),!l&&hi(o))?lr(nn(o),0,f):o.split(l,f)):[]}var FE=wi(function(o,l,f){return o+(f?" ":"")+Cc(l)});function BE(o,l,f){return o=_e(o),f=f==null?0:$r(ie(f),0,o.length),l=kt(l),o.slice(f,f+l.length)==l}function zE(o,l,f){var p=w.templateSettings;f&&st(o,l,f)&&(l=t),o=_e(o),l=ta({},l,p,qp);var b=ta({},l.imports,p.imports,qp),x=Ve(b),C=Du(b,x),O,I,P=0,D=l.interpolate||po,F="__p += '",q=Fu((l.escape||po).source+"|"+D.source+"|"+(D===dd?__:po).source+"|"+(l.evaluate||po).source+"|$","g"),j="//# sourceURL="+(ve.call(l,"sourceURL")?(l.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++j_+"]")+`
|
|
52
|
+
`;o.replace(q,function(Z,ce,me,At,ot,Ot){return me||(me=At),F+=o.slice(P,Ot).replace(k_,m2),ce&&(O=!0,F+=`' +
|
|
49
53
|
__e(`+ce+`) +
|
|
50
|
-
'`),ot&&(I=!0,
|
|
54
|
+
'`),ot&&(I=!0,F+=`';
|
|
51
55
|
`+ot+`;
|
|
52
|
-
__p += '`),me&&(
|
|
56
|
+
__p += '`),me&&(F+=`' +
|
|
53
57
|
((__t = (`+me+`)) == null ? '' : __t) +
|
|
54
|
-
'`),P=
|
|
55
|
-
`;var X=ve.call(l,"variable")&&l.variable;if(!X)
|
|
56
|
-
`+
|
|
58
|
+
'`),P=Ot+Z.length,Z}),F+=`';
|
|
59
|
+
`;var X=ve.call(l,"variable")&&l.variable;if(!X)F=`with (obj) {
|
|
60
|
+
`+F+`
|
|
57
61
|
}
|
|
58
|
-
`;else if(
|
|
62
|
+
`;else if(y_.test(X))throw new ne(u);F=(I?F.replace(t_,""):F).replace(n_,"$1").replace(r_,"$1;"),F="function("+(X||"obj")+`) {
|
|
59
63
|
`+(X?"":`obj || (obj = {});
|
|
60
64
|
`)+"var __t, __p = ''"+(O?", __e = _.escape":"")+(I?`, __j = Array.prototype.join;
|
|
61
65
|
function print() { __p += __j.call(arguments, '') }
|
|
62
66
|
`:`;
|
|
63
|
-
`)+
|
|
64
|
-
}`;var se=tm(function(){return be(x,j+"return "+B).apply(t,C)});if(se.source=B,Zu(se))throw se;return se}function zx(o){return _e(o).toLowerCase()}function $x(o){return _e(o).toUpperCase()}function Hx(o,l,f){if(o=_e(o),o&&(f||l===t))return cd(o);if(!o||!(l=Et(l)))return o;var d=en(o),b=en(l),x=fd(d,b),C=hd(d,b)+1;return ir(d,x,C).join("")}function Wx(o,l,f){if(o=_e(o),o&&(f||l===t))return o.slice(0,pd(o)+1);if(!o||!(l=Et(l)))return o;var d=en(o),b=hd(d,en(l))+1;return ir(d,0,b).join("")}function Vx(o,l,f){if(o=_e(o),o&&(f||l===t))return o.replace(Zl,"");if(!o||!(l=Et(l)))return o;var d=en(o),b=fd(d,en(l));return ir(d,b).join("")}function Ux(o,l){var f=te,d=Se;if(Me(l)){var b="separator"in l?l.separator:b;f="length"in l?ie(l.length):f,d="omission"in l?Et(l.omission):d}o=_e(o);var x=o.length;if(ni(o)){var C=en(o);x=C.length}if(f>=x)return o;var O=f-ri(d);if(O<1)return d;var I=C?ir(C,0,O).join(""):o.slice(0,O);if(b===t)return I+d;if(C&&(O+=I.length-O),Qu(b)){if(o.slice(O).search(b)){var P,D=I;for(b.global||(b=mu(b.source,_e(Nh.exec(b))+"g")),b.lastIndex=0;P=b.exec(D);)var B=P.index;I=I.slice(0,B===t?O:B)}}else if(o.indexOf(Et(b),O)!=O){var q=I.lastIndexOf(b);q>-1&&(I=I.slice(0,q))}return I+d}function qx(o){return o=_e(o),o&&nb.test(o)?o.replace(Oh,w2):o}var Kx=ci(function(o,l,f){return o+(f?" ":"")+l.toUpperCase()}),nc=np("toUpperCase");function em(o,l,f){return o=_e(o),l=f?t:l,l===t?m2(o)?x2(o):o2(o):o.match(l)||[]}var tm=ue(function(o,l){try{return xt(o,t,l)}catch(f){return Zu(f)?f:new ne(f)}}),Gx=On(function(o,l){return Bt(l,function(f){f=dn(f),An(o,f,Yu(o[f],o))}),o});function Jx(o){var l=o==null?0:o.length,f=Y();return o=l?Ae(o,function(d){if(typeof d[1]!="function")throw new zt(a);return[f(d[0]),d[1]]}):[],ue(function(d){for(var b=-1;++b<l;){var x=o[b];if(xt(x[0],this,d))return xt(x[1],this,d)}})}function jx(o){return w_(Ht(o,m))}function rc(o){return function(){return o}}function Yx(o,l){return o==null||o!==o?l:o}var Xx=ip(),Zx=ip(!0);function mt(o){return o}function ic(o){return Ld(typeof o=="function"?o:Ht(o,m))}function Qx(o){return Dd(Ht(o,m))}function eC(o,l){return Fd(o,Ht(l,m))}var tC=ue(function(o,l){return function(f){return ts(f,o,l)}}),nC=ue(function(o,l){return function(f){return ts(o,f,l)}});function sc(o,l,f){var d=Ve(l),b=vo(l,d);f==null&&!(Me(l)&&(b.length||!d.length))&&(f=l,l=o,o=this,b=vo(l,Ve(l)));var x=!(Me(f)&&"chain"in f)||!!f.chain,C=In(o);return Bt(b,function(O){var I=l[O];o[O]=I,C&&(o.prototype[O]=function(){var P=this.__chain__;if(x||P){var D=o(this.__wrapped__),B=D.__actions__=ht(this.__actions__);return B.push({func:I,args:arguments,thisArg:o}),D.__chain__=P,D}return I.apply(o,Zn([this.value()],arguments))})}),o}function rC(){return Xe._===this&&(Xe._=O2),this}function oc(){}function iC(o){return o=ie(o),ue(function(l){return Bd(l,o)})}var sC=Fu(Ae),oC=Fu(sd),aC=Fu(lu);function nm(o){return Uu(o)?uu(dn(o)):F_(o)}function lC(o){return function(l){return o==null?t:Nr(o,l)}}var uC=op(),cC=op(!0);function ac(){return[]}function lc(){return!1}function fC(){return{}}function hC(){return""}function dC(){return!0}function pC(o,l){if(o=ie(o),o<1||o>Yn)return[];var f=St,d=nt(o,St);l=Y(l),o-=St;for(var b=hu(d,l);++f<o;)l(f);return b}function mC(o){return re(o)?Ae(o,dn):kt(o)?[o]:ht(Sp(_e(o)))}function gC(o){var l=++A2;return _e(o)+l}var yC=Ao(function(o,l){return o+l},0),bC=Bu("ceil"),_C=Ao(function(o,l){return o/l},1),wC=Bu("floor");function vC(o){return o&&o.length?wo(o,mt,xu):t}function SC(o,l){return o&&o.length?wo(o,Y(l,2),xu):t}function xC(o){return ld(o,mt)}function CC(o,l){return ld(o,Y(l,2))}function EC(o){return o&&o.length?wo(o,mt,Au):t}function kC(o,l){return o&&o.length?wo(o,Y(l,2),Au):t}var AC=Ao(function(o,l){return o*l},1),TC=Bu("round"),OC=Ao(function(o,l){return o-l},0);function MC(o){return o&&o.length?fu(o,mt):0}function IC(o,l){return o&&o.length?fu(o,Y(l,2)):0}return w.after=Qv,w.ary=Rp,w.assign=$S,w.assignIn=Gp,w.assignInWith=$o,w.assignWith=HS,w.at=WS,w.before=Lp,w.bind=Yu,w.bindAll=Gx,w.bindKey=Pp,w.castArray=fS,w.chain=Mp,w.chunk=ww,w.compact=vw,w.concat=Sw,w.cond=Jx,w.conforms=jx,w.constant=rc,w.countBy=Mv,w.create=VS,w.curry=Dp,w.curryRight=Fp,w.debounce=Bp,w.defaults=US,w.defaultsDeep=qS,w.defer=eS,w.delay=tS,w.difference=xw,w.differenceBy=Cw,w.differenceWith=Ew,w.drop=kw,w.dropRight=Aw,w.dropRightWhile=Tw,w.dropWhile=Ow,w.fill=Mw,w.filter=Nv,w.flatMap=Pv,w.flatMapDeep=Dv,w.flatMapDepth=Fv,w.flatten=kp,w.flattenDeep=Iw,w.flattenDepth=Nw,w.flip=nS,w.flow=Xx,w.flowRight=Zx,w.fromPairs=Rw,w.functions=ZS,w.functionsIn=QS,w.groupBy=Bv,w.initial=Pw,w.intersection=Dw,w.intersectionBy=Fw,w.intersectionWith=Bw,w.invert=tx,w.invertBy=nx,w.invokeMap=$v,w.iteratee=ic,w.keyBy=Hv,w.keys=Ve,w.keysIn=pt,w.map=Lo,w.mapKeys=ix,w.mapValues=sx,w.matches=Qx,w.matchesProperty=eC,w.memoize=Do,w.merge=ox,w.mergeWith=Jp,w.method=tC,w.methodOf=nC,w.mixin=sc,w.negate=Fo,w.nthArg=iC,w.omit=ax,w.omitBy=lx,w.once=rS,w.orderBy=Wv,w.over=sC,w.overArgs=iS,w.overEvery=oC,w.overSome=aC,w.partial=Xu,w.partialRight=zp,w.partition=Vv,w.pick=ux,w.pickBy=jp,w.property=nm,w.propertyOf=lC,w.pull=Ww,w.pullAll=Tp,w.pullAllBy=Vw,w.pullAllWith=Uw,w.pullAt=qw,w.range=uC,w.rangeRight=cC,w.rearg=sS,w.reject=Kv,w.remove=Kw,w.rest=oS,w.reverse=Ju,w.sampleSize=Jv,w.set=fx,w.setWith=hx,w.shuffle=jv,w.slice=Gw,w.sortBy=Zv,w.sortedUniq=ev,w.sortedUniqBy=tv,w.split=Px,w.spread=aS,w.tail=nv,w.take=rv,w.takeRight=iv,w.takeRightWhile=sv,w.takeWhile=ov,w.tap=vv,w.throttle=lS,w.thru=Ro,w.toArray=Up,w.toPairs=Yp,w.toPairsIn=Xp,w.toPath=mC,w.toPlainObject=Kp,w.transform=dx,w.unary=uS,w.union=av,w.unionBy=lv,w.unionWith=uv,w.uniq=cv,w.uniqBy=fv,w.uniqWith=hv,w.unset=px,w.unzip=ju,w.unzipWith=Op,w.update=mx,w.updateWith=gx,w.values=di,w.valuesIn=yx,w.without=dv,w.words=em,w.wrap=cS,w.xor=pv,w.xorBy=mv,w.xorWith=gv,w.zip=yv,w.zipObject=bv,w.zipObjectDeep=_v,w.zipWith=wv,w.entries=Yp,w.entriesIn=Xp,w.extend=Gp,w.extendWith=$o,sc(w,w),w.add=yC,w.attempt=tm,w.camelCase=vx,w.capitalize=Zp,w.ceil=bC,w.clamp=bx,w.clone=hS,w.cloneDeep=pS,w.cloneDeepWith=mS,w.cloneWith=dS,w.conformsTo=gS,w.deburr=Qp,w.defaultTo=Yx,w.divide=_C,w.endsWith=Sx,w.eq=nn,w.escape=xx,w.escapeRegExp=Cx,w.every=Iv,w.find=Rv,w.findIndex=Cp,w.findKey=KS,w.findLast=Lv,w.findLastIndex=Ep,w.findLastKey=GS,w.floor=wC,w.forEach=Ip,w.forEachRight=Np,w.forIn=JS,w.forInRight=jS,w.forOwn=YS,w.forOwnRight=XS,w.get=ec,w.gt=yS,w.gte=bS,w.has=ex,w.hasIn=tc,w.head=Ap,w.identity=mt,w.includes=zv,w.indexOf=Lw,w.inRange=_x,w.invoke=rx,w.isArguments=Pr,w.isArray=re,w.isArrayBuffer=_S,w.isArrayLike=dt,w.isArrayLikeObject=Le,w.isBoolean=wS,w.isBuffer=sr,w.isDate=vS,w.isElement=SS,w.isEmpty=xS,w.isEqual=CS,w.isEqualWith=ES,w.isError=Zu,w.isFinite=kS,w.isFunction=In,w.isInteger=$p,w.isLength=Bo,w.isMap=Hp,w.isMatch=AS,w.isMatchWith=TS,w.isNaN=OS,w.isNative=MS,w.isNil=NS,w.isNull=IS,w.isNumber=Wp,w.isObject=Me,w.isObjectLike=Ie,w.isPlainObject=ls,w.isRegExp=Qu,w.isSafeInteger=RS,w.isSet=Vp,w.isString=zo,w.isSymbol=kt,w.isTypedArray=hi,w.isUndefined=LS,w.isWeakMap=PS,w.isWeakSet=DS,w.join=zw,w.kebabCase=Ex,w.last=Vt,w.lastIndexOf=$w,w.lowerCase=kx,w.lowerFirst=Ax,w.lt=FS,w.lte=BS,w.max=vC,w.maxBy=SC,w.mean=xC,w.meanBy=CC,w.min=EC,w.minBy=kC,w.stubArray=ac,w.stubFalse=lc,w.stubObject=fC,w.stubString=hC,w.stubTrue=dC,w.multiply=AC,w.nth=Hw,w.noConflict=rC,w.noop=oc,w.now=Po,w.pad=Tx,w.padEnd=Ox,w.padStart=Mx,w.parseInt=Ix,w.random=wx,w.reduce=Uv,w.reduceRight=qv,w.repeat=Nx,w.replace=Rx,w.result=cx,w.round=TC,w.runInContext=M,w.sample=Gv,w.size=Yv,w.snakeCase=Lx,w.some=Xv,w.sortedIndex=Jw,w.sortedIndexBy=jw,w.sortedIndexOf=Yw,w.sortedLastIndex=Xw,w.sortedLastIndexBy=Zw,w.sortedLastIndexOf=Qw,w.startCase=Dx,w.startsWith=Fx,w.subtract=OC,w.sum=MC,w.sumBy=IC,w.template=Bx,w.times=pC,w.toFinite=Nn,w.toInteger=ie,w.toLength=qp,w.toLower=zx,w.toNumber=Ut,w.toSafeInteger=zS,w.toString=_e,w.toUpper=$x,w.trim=Hx,w.trimEnd=Wx,w.trimStart=Vx,w.truncate=Ux,w.unescape=qx,w.uniqueId=gC,w.upperCase=Kx,w.upperFirst=nc,w.each=Ip,w.eachRight=Np,w.first=Ap,sc(w,function(){var o={};return fn(w,function(l,f){ve.call(w.prototype,f)||(o[f]=l)}),o}(),{chain:!1}),w.VERSION=r,Bt(["bind","bindKey","curry","curryRight","partial","partialRight"],function(o){w[o].placeholder=w}),Bt(["drop","take"],function(o,l){fe.prototype[o]=function(f){f=f===t?1:ze(ie(f),0);var d=this.__filtered__&&!l?new fe(this):this.clone();return d.__filtered__?d.__takeCount__=nt(f,d.__takeCount__):d.__views__.push({size:nt(f,St),type:o+(d.__dir__<0?"Right":"")}),d},fe.prototype[o+"Right"]=function(f){return this.reverse()[o](f).reverse()}}),Bt(["filter","map","takeWhile"],function(o,l){var f=l+1,d=f==Dt||f==We;fe.prototype[o]=function(b){var x=this.clone();return x.__iteratees__.push({iteratee:Y(b,3),type:f}),x.__filtered__=x.__filtered__||d,x}}),Bt(["head","last"],function(o,l){var f="take"+(l?"Right":"");fe.prototype[o]=function(){return this[f](1).value()[0]}}),Bt(["initial","tail"],function(o,l){var f="drop"+(l?"":"Right");fe.prototype[o]=function(){return this.__filtered__?new fe(this):this[f](1)}}),fe.prototype.compact=function(){return this.filter(mt)},fe.prototype.find=function(o){return this.filter(o).head()},fe.prototype.findLast=function(o){return this.reverse().find(o)},fe.prototype.invokeMap=ue(function(o,l){return typeof o=="function"?new fe(this):this.map(function(f){return ts(f,o,l)})}),fe.prototype.reject=function(o){return this.filter(Fo(Y(o)))},fe.prototype.slice=function(o,l){o=ie(o);var f=this;return f.__filtered__&&(o>0||l<0)?new fe(f):(o<0?f=f.takeRight(-o):o&&(f=f.drop(o)),l!==t&&(l=ie(l),f=l<0?f.dropRight(-l):f.take(l-o)),f)},fe.prototype.takeRightWhile=function(o){return this.reverse().takeWhile(o).reverse()},fe.prototype.toArray=function(){return this.take(St)},fn(fe.prototype,function(o,l){var f=/^(?:filter|find|map|reject)|While$/.test(l),d=/^(?:head|last)$/.test(l),b=w[d?"take"+(l=="last"?"Right":""):l],x=d||/^find/.test(l);b&&(w.prototype[l]=function(){var C=this.__wrapped__,O=d?[1]:arguments,I=C instanceof fe,P=O[0],D=I||re(C),B=function(ce){var me=b.apply(w,Zn([ce],O));return d&&q?me[0]:me};D&&f&&typeof P=="function"&&P.length!=1&&(I=D=!1);var q=this.__chain__,j=!!this.__actions__.length,X=x&&!q,se=I&&!j;if(!x&&D){C=se?C:new fe(this);var Z=o.apply(C,O);return Z.__actions__.push({func:Ro,args:[B],thisArg:t}),new $t(Z,q)}return X&&se?o.apply(this,O):(Z=this.thru(B),X?d?Z.value()[0]:Z.value():Z)})}),Bt(["pop","push","shift","sort","splice","unshift"],function(o){var l=io[o],f=/^(?:push|sort|unshift)$/.test(o)?"tap":"thru",d=/^(?:pop|shift)$/.test(o);w.prototype[o]=function(){var b=arguments;if(d&&!this.__chain__){var x=this.value();return l.apply(re(x)?x:[],b)}return this[f](function(C){return l.apply(re(C)?C:[],b)})}}),fn(fe.prototype,function(o,l){var f=w[l];if(f){var d=f.name+"";ve.call(ai,d)||(ai[d]=[]),ai[d].push({name:l,func:f})}}),ai[ko(t,g).name]=[{name:"wrapper",func:t}],fe.prototype.clone=q2,fe.prototype.reverse=K2,fe.prototype.value=G2,w.prototype.at=Sv,w.prototype.chain=xv,w.prototype.commit=Cv,w.prototype.next=Ev,w.prototype.plant=Av,w.prototype.reverse=Tv,w.prototype.toJSON=w.prototype.valueOf=w.prototype.value=Ov,w.prototype.first=w.prototype.head,Ji&&(w.prototype[Ji]=kv),w},ii=C2();Ar?((Ar.exports=ii)._=ii,iu._=ii):Xe._=ii}).call(II)}(Ws,Ws.exports)),Ws.exports}var Fy=NI();function bh(n){return n.type.create(Fy.cloneDeep(n.attrs))}function _h({tr:n,node:e,position:t,mark:r}){return e.isText?n.removeMark(t,t+e.nodeSize,r):n.removeNodeMark(t,r)}const RI=Re.create({name:"node_processor",addCommands(){return{setBlockAttributes:W(({commands:n,state:e},t,r,i={})=>{const s=V(n.getBlockAttributes(t))??{},{doc:a,tr:u}=e,{from:c,to:h}=u.selection;a.nodesBetween(c,h,(p,m)=>{Nf.includes(p.type.name)&&u.setNodeAttribute(m,t,{...i,...s,...r})})}),getBlockAttributes:W(({editor:n},e,t)=>ge(()=>{let r=Object.assign({},t||{});for(const i of Nf)Object.assign(r,n.getAttributes(i)?.[e]||{});return Object.keys(r).length?r:null})),removeBlockAttributes:W(({commands:n},e)=>{for(const t of Nf)n.resetAttributes(t,e)}),applyMark:W(({state:n,commands:e},t,r,i={})=>{const{tr:s,doc:a,schema:u}=n,{$from:c,$to:h}=s.selection,p=mn(Oe.LINK,u),m=mn(t,u);if(!(m.spec.group||"").includes(Gt.SETTINGS))return e.setMark(t,r);if(c.pos===h.pos)return;const _=S=>{if(!i.onAppliedToParent||i.onAppliedToParent(S)===!1){const{tr:E,node:N,position:g,mark:v}=S;_h({tr:E,node:N,position:g,mark:v.type})}};a.nodesBetween(c.pos,h.pos,(S,E)=>{if(S.type.name===oe.LIST)return;const N=MI(S.marks,t),g=m.create({...N?.attrs||{},...r}),v=Ly(c,h,S,E);if(!p.isInSet(S.marks)&&OI(s.doc,E,g,i.isAppliedToParent))return _({tr:s,node:S,position:E,mark:g});if(S.isText){s.addMark(v.from,v.to,g);return}AI(s.doc,s.selection,S,E)&&s.addNodeMark(E,g)})}),getMarks:W(({editor:n},e)=>{const t=yi(n,"state");return ge(()=>{const{selection:r,doc:i}=V(t),{from:s,to:a}=V(r),u=[];return i.nodesBetween(s,a,c=>{for(const h of c.marks)h.type.name===e&&u.unshift(h.attrs)}),u})}),getMark:W(({commands:n},e)=>{const t=n.getMarks(e);return ge(()=>V(t)[0]??null)}),hasMark:W(({commands:n},e)=>{const t=n.getMark(e);return ge(()=>!!V(t))}),getCommonSettingMark:W(({commands:n},e,t)=>{const r=n.getMark(e);return ge(()=>V(r)?.value??V(t))}),getDeviceSettingMark:W(({commands:n},e,t)=>{const r=n.getMarks(e),i=n.getDevice();return ge(()=>{for(const s of V(r)){const a=s[V(i)];if(a)return a}return V(t)})}),removeAllMarks:W(({state:n})=>{const{tr:e,doc:t}=n,{from:r,to:i}=e.selection;t.nodesBetween(r,i,(s,a)=>{for(const u of s.marks)_h({tr:e,node:s,position:a,mark:u})})}),removeMarks:W(({state:n},e)=>{const{tr:t,doc:r}=n,{from:i,to:s}=t.selection;r.nodesBetween(i,s,(a,u)=>{const c=a.marks.filter(h=>e.includes(h.type.name));for(const h of c)_h({tr:t,node:a,position:u,mark:h})})})}}}),LI=Re.create({name:"text_processor",addCommands(){return{getSelectedText:W(({state:n})=>{const{from:e,to:t}=n.selection;return n.doc.textBetween(e,t," ")}),transformText:W(({state:n},e)=>{const{$from:t,$to:r}=n.tr.selection;t.pos!==r.pos&&n.doc.nodesBetween(t.pos,r.pos,(i,s)=>{if(!i.isText)return;const a=Ly(t,r,i,s),u=Math.max(0,t.pos-s),c=Math.max(0,r.pos-s),h=e({text:i.textContent.substring(u,c)}),p=n.schema.text(h,i.marks);n.tr.replaceWith(a.from,a.to,p)})})}}}),PI=Re.create({name:"selection_processor",addStorage:()=>({selection:null}),addCommands(){return{storeSelection:W(({state:n})=>{this.storage.selection=n.selection}),restoreSelection:W(({commands:n})=>{this.storage.selection&&n.setTextSelection(this.storage.selection)}),expandSelection:W(({tr:n,commands:e},t)=>{let r=n.selection.from,i=n.selection.to;return n.doc.nodesBetween(r,i,(s,a,u)=>{if(t({node:s,parent:u})){const c=s.isText?0:Py(n.doc,a);r=Math.min(r,a+c),i=Math.max(i,a+s.nodeSize-c)}}),e.setTextSelection({from:r,to:i})}),expandSelectionToBlock:W(({commands:n})=>n.expandSelection(({parent:e})=>e.type.name===oe.DOCUMENT))}}}),DI=jn.create({name:"doc",topNode:!0,content:"block+"});class Ks extends Ue{constructor(e,t,r,i="SetDocAttr"){super(),this.key=e,this.value=t,this.schema=r,this.stepType=i}apply(e){this.prevValue=e.attrs.meta[this.key];const t=fr.fromJSON(this.schema,e.toJSON());return t.attrs.meta[this.key]=this.value,De.ok(t)}invert(){return new Ks(this.key,this.prevValue,this.schema,"revertSetDocAttr")}map(){return null}toJSON(){return{stepType:this.stepType,key:this.key,value:this.value}}static fromJSON(e){return new Ks(e.key,e.value,e.stepType)}}Ue.jsonID("setDocAttr",Ks);const FI=DI.extend({marks:Gt.SETTINGS,addAttributes:()=>({meta:{default:{}}}),onCreate(){this.editor.view.dom.addEventListener("click",n=>{n.target.closest("a")&&n.preventDefault()})},addCommands(){return{setDocMetaAttributes:W(({state:n},e,t)=>{n.tr.step(new Ks(e,t,n.schema))})}}}),BI=jn.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:n}){return["p",Oi(this.options.HTMLAttributes,n),0]},addCommands(){return{setParagraph:()=>({commands:n})=>n.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),zI=BI.extend({marks:Gt.ALL,addOptions:()=>({HTMLAttributes:{class:"zw-style"}})}),$I=jn.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(n=>({tag:`h${n}`,attrs:{level:n}}))},renderHTML({node:n,HTMLAttributes:e}){return[`h${this.options.levels.includes(n.attrs.level)?n.attrs.level:this.options.levels[0]}`,Oi(this.options.HTMLAttributes,e),0]},addCommands(){return{setHeading:n=>({commands:e})=>this.options.levels.includes(n.level)?e.setNode(this.name,n):!1,toggleHeading:n=>({commands:e})=>this.options.levels.includes(n.level)?e.toggleNode(this.name,"paragraph",n):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((n,e)=>({...n,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(n=>pO({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${n}})\\s$`),type:this.type,getAttributes:{level:n}}))}}),HI=$I.extend({marks:Gt.ALL,addOptions:()=>({levels:[1,2,3,4],HTMLAttributes:{class:"zw-style"}})}),WI=Re.create({name:"prose_mirror_plugins",addProseMirrorPlugins(){return[NO.create(this.editor),RO.create(this.editor)]}}),VI=()=>[FI,zI,HI,yO,AO,RI,LI,PI,WI],UI=Nt.create({name:Oe.FONT_FAMILY,group:Gt.SETTINGS,addOptions:()=>({fonts:[]}),addAttributes:()=>({value:{required:!0}}),addCommands(){return{applyFontFamily:W(({commands:n},e)=>{n.applyMark(this.name,{value:e});const t=n.findFontByName(e);let r=V(n.getFontWeight());t.isWeightSupported(r)||(r=t.findClosestWeight(r),n.applyFontWeight(r));const i=n.isSettingCustomized(Oe.FONT_STYLE).value;t.isItalicOnly?n.applyItalic():!t.isItalicSupported(r)&&i&&n.removeItalic()}),getFont:W(({commands:n})=>{const e=V(this.options.defaultPreset),t=n.findFontByName(e.common.font_family),r=n.getFontFamily();return ge(()=>n.findFontByName(V(r))||t)}),findFontByName:W((n,e)=>V(this.options.fonts).find(t=>t.name===e)??this.options.defaultFont),getFontFamily:W(({commands:n})=>n.getCommonSettingMark(this.name,n.getDefaultFontFamily())),getDefaultFontFamily:W(({commands:n})=>{const e=n.getPreset();return ge(()=>V(e).common.font_family)})}},parseHTML(){const n=e=>({value:e.replace(/["']/g,"")});return[{style:"--zw-font-family",getAttrs:n},{style:"font-family",getAttrs:n}]},renderHTML({HTMLAttributes:n}){const e=n.value?`"${n.value}"`:null;return Jr({font_family:e})}}),qI=Re.create({name:Oe.STYLE_PRESET,addGlobalAttributes(){return[{types:[oe.PARAGRAPH,oe.HEADING],attributes:{preset:{isRequired:!1,default:{id:V(this.options.defaultId)},parseHTML:n=>{const e=V(this.options.presets);if(n.parentElement.tagName==="LI")return null;for(const{id:t,node:r,fallbackClass:i}of e){if(i&&n.classList.contains(i))return{id:t};const s=V(this.options.styleRenderer).makePresetCssClass({id:t});if(n.matches(s))return{id:t};if(n.tagName===`H${r?.level}`)return{id:t}}return n.tagName==="P"?{id:V(this.options.defaultId)}:null},renderHTML:n=>n.preset?{class:V(this.options.styleRenderer).makePresetHtmlClass(n.preset)}:null}}}]},addCommands(){function n(t,r){return t.find(i=>r===i.id)}function e(t,r){const i={};for(const s of Object.keys(t)){const a=t[s],u=r[s],c=!u||u.toLowerCase()==="inherit";i[s]=c?a:u}return i}return{getPresetList:W(()=>ge(()=>V(this.options.presets).filter(t=>!t.hidden))),getPreset:W(({commands:t})=>{const r=t.getBlockAttributes("preset",{id:V(this.options.defaultId)}),i=t.getPresetList(),s=t.isLink(),a=t.getLinkPreset();return ge(()=>{const u=n(V(i),V(r).id);if(!V(s))return u;const c=V(a);return{id:u.id,common:e(u.common,c.common),mobile:e(u.mobile,c.mobile),tablet:e(u.tablet,c.tablet),desktop:e(u.desktop,c.desktop)}})}),applyPreset:W(({commands:t,chain:r},i)=>{const s=V(t.getPresetList()),a=n(s,i),u=a.node?.type??oe.PARAGRAPH,c={preset:{id:i}};a.node&&(c.level=a.node.level);for(const h of p1)c[h]=V(t.getBlockAttributes(h));r().removeList().setNode(u,c).run()}),applyDefaultPreset:W(({commands:t})=>{t.applyPreset(V(this.options.defaultId))}),removePreset:W(({commands:t})=>{t.setNode(oe.PARAGRAPH,{preset:null})}),getPresetCustomization:W(({editor:t,commands:r})=>{const i=yi(t,"state");return ge(()=>{const{selection:s,doc:a}=V(i),{from:u,to:c}=s;return r._getSettingCustomization(a,u,c)})}),isSettingCustomized:W(({commands:t},r)=>{const i=t.getPresetCustomization(),s=qa.includes(r)?"attributes":"marks";return ge(()=>V(i)[s]?.includes(r)??!1)}),getContentCustomization:W(({editor:t,commands:r})=>{const i=yi(t,"state");return ge(()=>{const{doc:s}=V(i);return r._getSettingCustomization(s,0,s.content.size)})}),_getSettingCustomization:W((t,r,i,s)=>{const a=new Set,u=new Set;return r.nodesBetween(i,s,c=>{for(const[h,p]of Object.entries(c.attrs))qa.includes(h)&&p&&u.add(h);for(const{type:h}of c.marks)g1.includes(h.name)&&a.add(h.name)}),{attributes:Array.from(u),marks:Array.from(a)}}),removePresetCustomization:W(({chain:t})=>{t().storeSelection().expandSelectionToBlock().removeMarks(g1).resetAttributes(oe.PARAGRAPH,qa).resetAttributes(oe.HEADING,qa).restoreSelection().run()}),removeFormat:W(({chain:t})=>{t().storeSelection().expandSelectionToBlock().removeAllMarks().applyDefaultPreset().restoreSelection().run()})}},onCreate(){this.options.styleRenderer.inject(Pi.head,V(this.options.presets))}}),KI=Nt.create({name:Oe.FONT_WEIGHT,group:Gt.SETTINGS,addAttributes:()=>({value:{required:!0}}),addCommands(){return{applyFontWeight:W(({commands:n},e)=>{n.applyMark(this.name,{value:e}),V(n.getFont()).isItalicSupported(e)||n.removeItalic()}),toggleBold:W(({commands:n})=>{const e=V(n.getFontWeight()),t=V(n.getFont()),i=Number(e)>=600?"400":"700",s=t.findClosestWeight(i);n.applyFontWeight(s)}),getFontWeight:W(({commands:n})=>{const e=n.getCommonSettingMark(this.name,n.getDefaultFontWeight()),t=n.getFont();return ge(()=>{const r=V(e),i=V(t);return i.isWeightSupported(r)?r:i.findClosestWeight(r)})}),getDefaultFontWeight:W(({commands:n})=>{const e=n.getPreset();return ge(()=>V(e).common.font_weight)})}},addKeyboardShortcuts:()=>({"Mod-b":Yt("toggleBold"),"Mod-B":Yt("toggleBold")}),parseHTML(){const n=e=>e==="bold"?{value:"700"}:Number(e)?{value:e}:!1;return[{style:"--zw-font-weight",getAttrs:n},{style:"font-weight",getAttrs:n},{tag:"b",attrs:{value:"700"}},{tag:"strong",attrs:{value:"700"}}]},renderHTML({HTMLAttributes:n}){return Jr({font_weight:n.value})}}),GI=Nt.create({name:Oe.FONT_SIZE,group:Gt.SETTINGS,addOptions:()=>({minSize:1,maxSize:100}),addAttributes(){return{mobile:{default:null},tablet:{default:null},desktop:{default:null}}},addCommands(){return{getFontSize:W(({commands:n})=>n.getDeviceSettingMark(this.name,n.getDefaultFontSize())),getDefaultFontSize:W(({commands:n})=>{const e=n.getDevice(),t=n.getPreset();return ge(()=>V(t)[V(e)].font_size.replace("px",""))}),applyFontSize:W(({commands:n},e)=>{const t=V(n.getDevice());n.applyMark(this.name,{[t]:e},{isAppliedToParent:(r,i)=>r.type.name!==i.type.name?!1:r.attrs[t]===i.attrs[t],onAppliedToParent:({tr:r,node:i,position:s,mark:a})=>{const u={...a.attrs,[t]:null};if(!Object.values(u).some(p=>!!p))return!1;const h=a.type.create(u);if(i.isText){r.addMark(s,s+i.nodeSize,h);return}r.addNodeMark(s,h)}})}),increaseFontSize:W(({commands:n})=>{const e=Number(V(n.getFontSize())),t=Math.min(e+1,V(this.options.maxSize));n.applyFontSize(String(t))}),decreaseFontSize:W(({commands:n})=>{const e=Number(V(n.getFontSize())),t=Math.max(e-1,V(this.options.minSize));n.applyFontSize(String(t))})}},addKeyboardShortcuts:()=>({"Mod-Shift-=":Yt("increaseFontSize"),"Mod-Shift--":Yt("decreaseFontSize")}),parseHTML(){const n=e=>{if(!e)return null;const t=V(this.options.wrapperRef),r=Ry(e,t);return String(r)};return[{tag:'[style*="--zw-font-size"]',getAttrs:({style:e})=>({mobile:n(e.getPropertyValue("--zw-font-size-mobile")),tablet:n(e.getPropertyValue("--zw-font-size-tablet")),desktop:n(e.getPropertyValue("--zw-font-size-desktop"))})},{style:"font-size",getAttrs:e=>{const t=n(e);return{desktop:t,tablet:t,mobile:null}}}]},renderHTML({HTMLAttributes:n}){const e=t=>t?`${t}px`:null;return Jr({font_size_mobile:e(n.mobile),font_size_tablet:e(n.tablet),font_size_desktop:e(n.desktop)})}}),JI=Nt.create({name:Oe.FONT_COLOR,group:Gt.SETTINGS,addAttributes:()=>({value:{required:!0}}),addCommands(){return{getFontColor:W(({commands:n})=>n.getCommonSettingMark(this.name,n.getDefaultFontColor())),getDefaultFontColor:W(({commands:n})=>{const e=n.getPreset();return ge(()=>V(e).common.color)}),applyFontColor:W(({commands:n},e)=>{n.applyMark(this.name,{value:e})})}},parseHTML(){const n=e=>({value:Ny(e)});return[{style:"--zw-font-color",getAttrs:n},{style:"color",getAttrs:n}]},renderHTML({HTMLAttributes:n}){return Jr({font_color:n.value})}}),jI=Nt.create({name:Oe.BACKGROUND_COLOR,addAttributes:()=>({value:{required:!0}}),addCommands(){return{getBackgroundColor:W(({commands:n})=>n.getCommonSettingMark(this.name,"rgba(255, 255, 255, 0%)")),applyBackgroundColor:W(({commands:n},e)=>{n.applyMark(this.name,{value:e})})}},parseHTML(){const n=e=>({value:Ny(e)});return[{style:"--zw-background-color",getAttrs:n},{style:"background-color",getAttrs:n}]},renderHTML({HTMLAttributes:n}){return Jr({background_color:n.value})}}),YI=Re.create({name:"device_manager",addCommands(){return{getDevice:W(()=>yi(this.options,"device"))}}}),XI=Nt.create({name:Oe.FONT_STYLE,group:Gt.SETTINGS,addAttributes:()=>({italic:{required:!0}}),addCommands(){return{isItalic:W(({commands:n})=>{const e=n.getMark(this.name),t=n.getDefaultFontStyle();return ge(()=>V(e)?.italic??V(t).italic)}),isItalicAvailable:W(({commands:n})=>{const e=n.getFont(),t=n.getFontWeight();return ge(()=>{const r=V(e),i=V(t);return r.isItalicSupported(i)&&!r.isWeightItalicOnly(i)})}),getDefaultFontStyle:W(({commands:n})=>{const e=n.getPreset();return ge(()=>({italic:V(e).common.font_style==="italic"}))}),toggleItalic:W(({commands:n})=>{V(n.isItalicAvailable())&&(V(n.isItalic())?n.removeItalic():n.applyItalic())}),applyItalic:W(({commands:n})=>{n.applyMark(this.name,{italic:!0})}),removeItalic:W(({commands:n})=>{n.applyMark(this.name,{italic:!1})})}},addKeyboardShortcuts:()=>({"Mod-i":Yt("toggleItalic"),"Mod-I":Yt("toggleItalic")}),parseHTML(){const n=e=>({italic:e.includes("italic")});return[{tag:"i",attrs:{italic:!0}},{style:"--zw-font-style",getAttrs:n},{style:"font-style",getAttrs:n}]},renderHTML({HTMLAttributes:n}){const e=n.italic?"italic":"normal";return Jr({font_style:e})}}),ZI=Nt.create({name:Oe.TEXT_DECORATION,priority:1e3,addAttributes:()=>({underline:{default:!1},strike_through:{default:!1}}),addCommands(){return{isUnderline:W(({commands:n})=>{const e=n.getTextDecoration();return ge(()=>V(e).underline)}),isStrikeThrough:W(({commands:n})=>{const e=n.getTextDecoration();return ge(()=>V(e).strike_through)}),getTextDecoration:W(({commands:n})=>{const e=n.getMark(this.name),t=n.getDefaultTextDecoration();return ge(()=>{const r=V(e)??{},i=V(t);return{underline:r.underline||i.underline,strike_through:r.strike_through||i.strike_through}})}),isUnderlineCustomized:W(({commands:n})=>{const e=n.isUnderline(),t=n.getDefaultTextDecoration();return ge(()=>V(e)!==V(t).underline)}),getDefaultTextDecoration:W(({commands:n})=>{const e=n.getPreset();return ge(()=>{const{text_decoration:t}=V(e).common;return{underline:t.includes("underline"),strike_through:t.includes("line-through")}})}),toggleUnderline:W(({commands:n})=>{n.toggleTextDecoration("underline")}),toggleStrikeThrough:W(({commands:n})=>{n.toggleTextDecoration("strike_through")}),toggleTextDecoration:W(({commands:n},e,t=null)=>{const r=V(n.getTextDecoration()),i=t??!r[e];n.applyMark(this.name,{[e]:i})}),applyTextDecoration:W(({commands:n},e)=>{n.toggleTextDecoration(e,!0)}),removeTextDecoration:W(({commands:n},e)=>{n.toggleTextDecoration(e,!1)})}},addKeyboardShortcuts:()=>({"Mod-u":Yt("toggleUnderline"),"Mod-U":Yt("toggleUnderline")}),parseHTML(){const n=e=>{const t=e.includes("underline"),r=e.includes("line-through");return!t&&!r?!1:{underline:t,strike_through:r}};return[{style:"--zw-text-decoration",getAttrs:n},{style:"text-decoration-line",getAttrs:n},{style:"text-decoration",getAttrs:n},{tag:"s",attrs:{underline:!1,strike_through:!0}},{tag:"u",attrs:{underline:!0,strike_through:!1}}]},renderHTML({HTMLAttributes:n}){const e=[];return n.underline&&e.push("underline"),n.strike_through&&e.push("line-through"),e.length||e.push("none"),Jr({text_decoration:e.join(" ")})}}),QI=Re.create({name:"case_style",addCommands(){return{applyCaseStyle:W(({commands:n},e)=>{switch(e){case Ua.CAPITALIZE:return n.applyCapitalize();case Ua.LOWERCASE:return n.applyLowerCase();case Ua.UPPERCASE:return n.applyUpperCase()}}),applyCapitalize:W(({commands:n})=>{n.transformText(({text:e})=>QO(e))}),applyLowerCase:W(({commands:n})=>{n.transformText(({text:e})=>e.toLowerCase())}),applyUpperCase:W(({commands:n})=>{n.transformText(({text:e})=>e.toUpperCase())})}}}),By={mobile:null,tablet:null,desktop:null},eN=Re.create({name:Oe.ALIGNMENT,addGlobalAttributes:()=>[{types:[oe.PARAGRAPH,oe.HEADING],attributes:{[Oe.ALIGNMENT]:{isRequired:!1,parseHTML({style:n}){const e=kI(n.textAlign);if(e)return{desktop:e,tablet:e,mobile:e};const t=n.getPropertyValue("--zw-alignment-mobile")||null,r=n.getPropertyValue("--zw-alignment-tablet")||null,i=n.getPropertyValue("--zw-alignment-desktop")||null;return!t&&!r&&!i?null:{desktop:i,tablet:r,mobile:t}},renderHTML(n){return n.alignment?Cl({alignment_mobile:n.alignment.mobile,alignment_tablet:n.alignment.tablet,alignment_desktop:n.alignment.desktop}):null}}}}],addCommands(){return{applyAlignment:W(({commands:n},e)=>{const t=V(n.getDevice());n.setBlockAttributes(this.name,{[t]:e},By)}),removeAlignment:W(({commands:n})=>n.removeBlockAttributes(this.name)),getAlignment:W(({commands:n})=>{const e=n.getBlockAttributes(this.name,By),t=n.getDevice(),r=n.getDefaultAlignment();return ge(()=>V(e)?.[V(t)]??V(r))}),getDefaultAlignment:W(({commands:n})=>{const e=n.getDevice(),t=n.getPreset();return ge(()=>V(t)[V(e)].alignment??_r.LEFT)})}},addKeyboardShortcuts:()=>({"Mod-Shift-l":Yt("applyAlignment",_r.LEFT),"Mod-Shift-e":Yt("applyAlignment",_r.CENTER),"Mod-Shift-r":Yt("applyAlignment",_r.RIGHT),"Mod-Shift-j":Yt("applyAlignment",_r.JUSTIFY)})}),zy={mobile:null,tablet:null,desktop:null},tN=Re.create({name:Oe.LINE_HEIGHT,addGlobalAttributes(){return[{types:[oe.PARAGRAPH,oe.HEADING],attributes:{[Oe.LINE_HEIGHT]:{isRequired:!1,parseHTML:n=>{if(n.matches('[style*="--zw-line-height"]')){const s=n.style.getPropertyValue("--zw-line-height-tablet")||null,a=n.style.getPropertyValue("--zw-line-height-desktop")||null;return{mobile:null,tablet:s,desktop:a}}const e=n.style.lineHeight;if(!e)return null;const t=V(this.options.wrapperRef),r=CI(e,n,t);return r?{desktop:r,tablet:r,mobile:null}:null},renderHTML(n){return n.line_height?Cl({line_height_mobile:n.line_height.mobile,line_height_tablet:n.line_height.tablet,line_height_desktop:n.line_height.desktop}):null}}}}]},addCommands(){return{getLineHeight:W(({commands:n})=>{const e=n.getBlockAttributes(this.name,zy),t=n.getDevice(),r=n.getDefaultLineHeight();return ge(()=>V(e)?.[V(t)]??V(r))}),getDefaultLineHeight:W(({commands:n})=>{const e=n.getDevice(),t=n.getPreset();return ge(()=>V(t)[V(e)].line_height)}),applyLineHeight:W(({commands:n},e)=>{const t=V(n.getDevice());n.setBlockAttributes(this.name,{[t]:e},zy)})}}}),nN=jn.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:n}){return["li",Oi(this.options.HTMLAttributes,n),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),rN=nN.extend({name:oe.LIST_ITEM,marks:Gt.SETTINGS,addCommands(){const n=({selection:e})=>e.$cursor.before(e.$cursor.depth-1);return{listItemNewline:W(({commands:e,tr:t})=>{const r=t.doc.nodeAt(n(t));if(!t.selection.$cursor.node().textContent)return!1;e.splitListItem(this.name);const s=n(t);for(const a of r.marks)t.addNodeMark(s,bh(a));return!0})}},addOptions:()=>({HTMLAttributes:{class:"zw-style"}}),addKeyboardShortcuts:()=>({Enter:n=>{const{state:e,commands:t}=n.editor;if(e.selection.$cursor?.path.some(i=>i.type?.name===oe.LIST))return t.listItemNewline()}})});function iN(n,e){if(m1.includes(e.type)||e.type.isInSet(n.marks))return!1;for(const t of n.content.content)if(t.childCount&&(!t.marks||!e.isInSet(t.marks)))return!1;return!0}function sN(n){const e=n.selection.$from.start(),t=n.selection.$to.end();n.doc.nodesBetween(e,t,(r,i)=>{if(r.type.name===oe.LIST)return;if(r.type.name!==oe.LIST_ITEM)return!1;const s=[];return r.forEach(a=>{for(const u of a.marks){if(u.isInSet(s)){n.removeNodeMark(i+1,u);continue}iN(r,u)&&(n.removeNodeMark(i+1,u),n.addNodeMark(i,bh(u)),s.push(u))}}),!1})}const oN=jn.create({name:oe.LIST,content:`${oe.LIST_ITEM}+`,group:"block list",marks:Gt.SETTINGS,addExtensions:()=>[rN],addOptions:()=>({baseClass:"",presetClass:""}),addAttributes:()=>({bullet:{default:{type:an.DISC}}}),parseHTML(){const n={a:an.ROMAN,i:an.LATIN,1:an.DECIMAL},e=t=>{for(const r of MO){const i=`.${V(this.options.baseClass)}${r}`;if(t.matches(i)||n[t.type.toLowerCase()]===r)return r}};return[{tag:"ol",getAttrs:t=>({bullet:{type:e(t)||an.DECIMAL}})},{tag:"ul",getAttrs:t=>({bullet:{type:e(t)||an.DISC}})}]},renderHTML({HTMLAttributes:n}){const e=[V(this.options.baseClass)+n.bullet.type,V(this.options.presetClass)];return[IO.includes(n.bullet.type)?"ol":"ul",{class:e.join(" ")},0]},addCommands(){return{getListType:W(({commands:n})=>{const e=n.getBlockAttributes("bullet",{type:null});return ge(()=>V(e).type??null)}),applyList:W(({commands:n,chain:e},t)=>V(n.getListType())===t?n.removeList():e().applyDefaultPreset().toggleList(oe.LIST,oe.LIST_ITEM).setBlockAttributes("bullet",{type:t}).command(({tr:i})=>sN(i)).run()),removeList:W(({chain:n})=>n().expandSelection(({parent:e})=>e.type.name===oe.LIST).command(({tr:e})=>{const t=e.selection.$from.start(),r=e.selection.$to.end();return e.doc.nodesBetween(t,r,(i,s,a)=>{if([oe.LIST,oe.LIST_ITEM].includes(i.type.name))return;if(a.type.name!==oe.LIST_ITEM)return!1;const u=a.marks.filter(c=>!c.type.isInSet(i.marks));for(const c of u)e.addNodeMark(s,bh(c));return!1}),!0}).liftListItem(oe.LIST_ITEM).run())}},addInputRules(){const n=(e,t)=>mO({find:t,type:this.type,getAttributes:{bullet:{type:e}},joinPredicate:(r,{attrs:i})=>i.bullet.type===e});return[n(an.DISC,/^\s*([-+*])\s$/),n(an.DECIMAL,/^(\d+)\.\s$/),n(an.LATIN,/^([ivx]{1,3})\.\s$/i),n(an.ROMAN,/^([a-z])\.\s$/i)]}});function aN(n){return n.length===1?n[0].isLink:n.length===3&&n[1].isLink?["()","[]"].includes(n[0].value+n[2].value):!1}function lN(n){return new ct({key:new Mt("autolink"),appendTransaction:(e,t,r)=>{const i=e.some(h=>h.docChanged)&&!t.doc.eq(r.doc),s=e.some(h=>h.getMeta("preventAutolink"));if(!i||s)return;const{tr:a}=r,u=FT(t.doc,[...e]);if(KT(u).forEach(({newRange:h})=>{const p=zT(r.doc,h,_=>_.isTextblock);let m,y;if(p.length>1?(m=p[0],y=r.doc.textBetween(m.pos,m.pos+m.node.nodeSize,void 0," ")):p.length&&r.doc.textBetween(h.from,h.to," "," ").endsWith(" ")&&(m=p[0],y=r.doc.textBetween(m.pos,h.to,void 0," ")),m&&y){const _=y.split(" ").filter(g=>g!=="");if(_.length<=0)return!1;const S=_[_.length-1],E=m.pos+y.lastIndexOf(S);if(!S)return!1;const N=xl(S).map(g=>g.toObject(n.defaultProtocol));if(!aN(N))return!1;N.filter(g=>g.isLink).map(g=>({...g,from:E+g.start+1,to:E+g.end+1})).filter(g=>r.schema.marks.code?!r.doc.rangeHasMark(g.from,g.to,r.schema.marks.code):!0).filter(g=>n.validate(g.value)).filter(g=>n.shouldAutoLink(g.value)).forEach(g=>{i1(g.from,g.to,r.doc).some(v=>v.mark.type===n.type)||a.addMark(g.from,g.to,n.type.create({href:g.href}))})}}),!!a.steps.length)return a}})}function uN(n){return new ct({key:new Mt("handleClickLink"),props:{handleClick:(e,t,r)=>{var i,s;if(r.button!==0||!e.editable)return!1;let a=r.target;const u=[];for(;a.nodeName!=="DIV";)u.push(a),a=a.parentNode;if(!u.find(y=>y.nodeName==="A"))return!1;const c=VT(e.state,n.type.name),h=r.target,p=(i=h?.href)!==null&&i!==void 0?i:c.href,m=(s=h?.target)!==null&&s!==void 0?s:c.target;return h&&p?(window.open(p,m),!0):!1}}})}function cN(n){return new ct({key:new Mt("handlePasteLink"),props:{handlePaste:(e,t,r)=>{const{state:i}=e,{selection:s}=i,{empty:a}=s;if(a)return!1;let u="";r.content.forEach(h=>{u+=h.textContent});const c=N1(u,{defaultProtocol:n.defaultProtocol}).find(h=>h.isLink&&h.value===u);return!u||!c?!1:n.editor.commands.setMark(n.type,{href:c.href})}}})}const fN=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g;function Yr(n,e){const t=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return e&&e.forEach(r=>{const i=typeof r=="string"?r:r.scheme;i&&t.push(i)}),!n||n.replace(fN,"").match(new RegExp(`^(?:(?:${t.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}const hN=Nt.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(n=>{if(typeof n=="string"){I1(n);return}I1(n.scheme,n.optionalSlashes)})},onDestroy(){jO()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(n,e)=>!!Yr(n,e.protocols),validate:n=>!!n,shouldAutoLink:n=>!!n}},addAttributes(){return{href:{default:null,parseHTML(n){return n.getAttribute("href")}},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class}}},parseHTML(){return[{tag:"a[href]",getAttrs:n=>{const e=n.getAttribute("href");return!e||!this.options.isAllowedUri(e,{defaultValidate:t=>!!Yr(t,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:n}){return this.options.isAllowedUri(n.href,{defaultValidate:e=>!!Yr(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",Oi(this.options.HTMLAttributes,n),0]:["a",Oi(this.options.HTMLAttributes,{...n,href:""}),0]},addCommands(){return{setLink:n=>({chain:e})=>{const{href:t}=n;return this.options.isAllowedUri(t,{defaultValidate:r=>!!Yr(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?e().setMark(this.name,n).setMeta("preventAutolink",!0).run():!1},toggleLink:n=>({chain:e})=>{const{href:t}=n;return this.options.isAllowedUri(t,{defaultValidate:r=>!!Yr(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?e().toggleMark(this.name,n,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run():!1},unsetLink:()=>({chain:n})=>n().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[gO({find:n=>{const e=[];if(n){const{protocols:t,defaultProtocol:r}=this.options,i=N1(n).filter(s=>s.isLink&&this.options.isAllowedUri(s.value,{defaultValidate:a=>!!Yr(a,t),protocols:t,defaultProtocol:r}));i.length&&i.forEach(s=>e.push({text:s.value,data:{href:s.href},index:s.start}))}return e},type:this.type,getAttributes:n=>{var e;return{href:(e=n.data)===null||e===void 0?void 0:e.href}}})]},addProseMirrorPlugins(){const n=[],{protocols:e,defaultProtocol:t}=this.options;return this.options.autolink&&n.push(lN({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:r=>this.options.isAllowedUri(r,{defaultValidate:i=>!!Yr(i,e),protocols:e,defaultProtocol:t}),shouldAutoLink:this.options.shouldAutoLink})),this.options.openOnClick===!0&&n.push(uN({type:this.type})),this.options.linkOnPaste&&n.push(cN({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type})),n}}),dN=hN.extend({name:Oe.LINK,addOptions(){return{...this.parent?.(),openOnClick:!1,linkOnPaste:!1}},addAttributes(){return{href:{default:null,parseHTML:n=>{const e=n.getAttribute("href");return e.startsWith("#")?parseFloat(n.getAttribute("href").replace("#","")):e}},target:{default:Rf.SELF,parseHTML:n=>n.getAttribute("target")||Rf.SELF},destination:{default:Mi.URL,parseHTML:n=>{const e=n.getAttribute("href");if(!e.startsWith("#"))return Mi.URL;const t=e.replace("#","");return V(this.options.pageBlocks).find(s=>s.id===parseInt(t))?Mi.BLOCK:Mi.URL}}}},addCommands(){const{unsetLink:n}=this.parent();return{removeLink:n,applyLink:W(({commands:e,chain:t},r)=>(e.setMeta("preventAutolink",!0),e.getSelectedText()?t().applyMark(this.name,r).expandSelectionToLink().command(({tr:i})=>(r.text&&i.insertText(r.text,i.selection.from,i.selection.to),!0)).run():e.insertContent(Hy.text(r.text,[Hy.mark(Oe.LINK,r)])))),expandSelectionToLink:W(({commands:e})=>{e.expandSelection(({node:t})=>this.type.isInSet(t.marks))}),isLink:W(({commands:e})=>e.hasMark(this.name)),getLinkPreset:W(()=>ge(()=>V(this.options.preset)))}},addProseMirrorPlugins(){return[...this.parent(),ZO.create(this.editor)]},renderHTML({HTMLAttributes:n}){const e=n.destination===Mi.BLOCK?`#${n.href}`:n.href,t=V(this.options.basePresetClass)+V(this.options.preset).id;return["a",{href:e,target:n.target,class:`${t} zw-style`},0]}}),pN=Nt.create({name:Oe.SUPERSCRIPT,addCommands(){return{applySuperscript:W(({commands:n})=>{n.setMark(this.name)}),removeSuperscript:W(({commands:n})=>{n.unsetMark(this.name)}),toggleSuperscript:W(({commands:n})=>{V(n.isSuperscript())?n.removeSuperscript():n.applySuperscript()}),isSuperscript:W(({commands:n})=>{const e=n.getMark(this.name);return ge(()=>!!V(e))})}},parseHTML(){return[{tag:"sup"},{style:"vertical-align",getAttrs:n=>n!=="super"?!1:null}]},renderHTML(){return["sup",{class:"zw-superscript"},0]}}),mN=Re.create({name:Oe.MARGIN,addGlobalAttributes:()=>[{types:[oe.PARAGRAPH,oe.HEADING],attributes:{[Oe.MARGIN]:{isRequired:!1,parseHTML(n){const{margin:e,marginTop:t,marginRight:r,marginBottom:i,marginLeft:s}=n.style;return[e,t,r,i,s].some(c=>!!c)?e?{value:e}:{value:[t||0,r||0,i||0,s||0].join(" ")}:null},renderHTML(n){return n.margin?Cl({margin:n.margin.value}):null}}}}]});function gN(n){const e=r=>n.presetsRef.value.find(i=>i.id===r),t=kc({default:null,link:null});return n5(n.presetsRef,()=>{t.default=e(n.defaultPresetId),t.link=e(n.linkPresetId)},{immediate:!0,deep:!0}),VI().concat([qI.configure({presets:n.presetsRef,defaultId:n.defaultPresetId,styleRenderer:new vN({baseClass:n.basePresetClass,makeVariable:n.makePresetVariable,linkPresetId:n.linkPresetId})}),oN.configure({baseClass:n.baseListClass,presetClass:n.basePresetClass+n.defaultPresetId}),YI.configure({device:n.deviceRef}),GI.configure({minSize:n.minFontSize,maxSize:n.maxFontSize,wrapperRef:n.wrapperRef}),UI.configure({fonts:n.fonts,defaultPreset:yi(t,"default"),defaultFont:n.defaultFont}),KI,JI,jI,XI,ZI,QI,pN,eN,tN.configure({wrapperRef:n.wrapperRef}),dN.configure({preset:yi(t,"link"),basePresetClass:n.basePresetClass,pageBlocks:n.pageBlocksRef}),mN])}class yN{_domParser=new DOMParser;types=window;parse(e){return this._domParser.parseFromString(e,"text/html")}}class $y{content;constructor({content:e}){this.content=e}normalize(){throw new Error("Implement abstract method")}}class _n extends $y{static BLOCK_NODE_NAMES=["P","H1","H2","H3","H4"];static ROOT_NODE_NAMES=_n.BLOCK_NODE_NAMES.concat("UL","OL");static BLOCK_STYLES=["text-align","line-height","margin","margin-top","margin-bottom","margin-left","margin-right"];_parser;constructor({content:e,parser:t}){super({content:e}),this._parser=t,this.dom=null}normalize(){return this.normalizeHTML(),this.normalizedHTML}normalizeHTML(){this.dom=this._parser.parse(this.content.replace(/(\r)?\n/g,"")),this._removeComments(),this._normalizeRootTags(),this._iterateNodes(this._normalizeBreakLines,e=>e.tagName==="BR"),this._iterateNodes(this._removeEmptyNodes,this._isBlockNode),this._iterateNodes(this._normalizeListItems,e=>e.tagName==="LI"),this._normalizeBlockTextDecoration(),this._normalizeBlockBackgroundColor()}get normalizedHTML(){return this.dom.body.innerHTML}get _NodeFilter(){return this._parser.types.NodeFilter}get _Node(){return this._parser.types.Node}_removeComments(){const e=this._createNodeIterator(this._NodeFilter.SHOW_COMMENT);this._runIterator(e,t=>t.remove())}_normalizeRootTags(){const e=Array.from(this.dom.body.childNodes),t=this.dom.createDocumentFragment();let r;for(const i of e){if(this._isRootNode(i)){t.append(i),r=null;continue}r||(r=this.dom.createElement("p"),t.append(r)),r.append(i)}this.dom.body.innerHTML="",this.dom.body.append(t)}_createNodeIterator(e,t){return this.dom.createNodeIterator(this.dom.body,e,t)}_iterateNodes(e,t=()=>!0){const r=s=>s.tagName!=="BODY"&&t.call(this,s),i=this._createNodeIterator(this._NodeFilter.SHOW_ELEMENT,{acceptNode:s=>r(s)?this._NodeFilter.FILTER_ACCEPT:this._NodeFilter.FILTER_REJECT});this._runIterator(i,e)}_runIterator(e,t){let r=e.nextNode();for(;r;)t.call(this,r),r=e.nextNode()}_removeEmptyNodes(e){e.innerHTML.trim()||e.remove()}_normalizeListItems(e){const t=this.dom.createDocumentFragment(),r=Array.from(e.childNodes);let i,s;const a=u=>{this._assignElementProperties(u,e,_n.BLOCK_STYLES),t.append(u)};this._assignElementProperties(e,e.parentElement,_n.BLOCK_STYLES);for(const u of r){if(this._isBlockNode(u)){a(u),i=null,s=u;continue}if(u.tagName==="BR"&&s&&s?.tagName!=="BR"){u.remove(),s=u;continue}if(u.tagName==="BR"){const c=this.dom.createElement("p");c.append(u),a(c),i=null,s=u;continue}i||(i=this.dom.createElement("p"),a(i)),i.append(u),s=u}e.append(t),this._removeStyleProperties(e,_n.BLOCK_STYLES),this._removeStyleProperties(e.parentElement,_n.BLOCK_STYLES),this._assignElementProperties(e,e.parentElement),e.parentElement.lastElementChild===e&&this._removeStyleProperties(e.parentElement)}_isBlockNode(e){return _n.BLOCK_NODE_NAMES.includes(e.tagName)}_isRootNode(e){return _n.ROOT_NODE_NAMES.includes(e.tagName)}_assignElementProperties(e,t,r=Array.from(t.style)){for(const i of r){const s=t.style.getPropertyValue(i);s&&!e.style.getPropertyValue(i)&&e.style.setProperty(i,s)}}_removeStyleProperties(e,t=Array.from(e.style)){for(const r of t)e.style.removeProperty(r);e.style.length===0&&e.removeAttribute("style")}_normalizeBreakLines({parentElement:e}){if(!this._isBlockNode(e)||!e.textContent)return;const t=this.dom.createDocumentFragment(),r=Array.from(e.childNodes),i=e.cloneNode(!0);i.innerHTML="";let s=i.cloneNode();const a=u=>{this._assignElementProperties(u,e,_n.BLOCK_STYLES),t.append(u)};for(const u of r){if(u.tagName==="BR"){a(s),s=i.cloneNode();continue}s.append(u)}t.append(s),e.replaceWith(t)}_normalizeBlockTextDecoration(){const e=this.dom.querySelectorAll('[style*="text-decoration"]:where(p, h1, h2, h3, h4, li)');for(const t of e)this._moveTextDecorationToChildren(t)}_moveTextDecorationToChildren(e){const t=this._parseTextDecoration(e);if(e.style.removeProperty("text-decoration-line"),e.style.removeProperty("text-decoration"),e.style.cssText||e.removeAttribute("style"),!t.none)for(const r of e.childNodes){const i=this._wrapTextNode(e,r),s=this._parseTextDecoration(i),a={underline:s.underline||t.underline,line_through:s.line_through||t.line_through};i.style.removeProperty("text-decoration-line"),i.style.removeProperty("text-decoration"),i.style.textDecoration=Object.entries(a).filter(([,u])=>u).map(([u])=>u.replace("_","-")).join(" ")}}_parseTextDecoration(e){const{textDecoration:t,textDecorationLine:r}=e.style,i=t||r||"";return{none:i.includes("none"),underline:i.includes("underline"),line_through:i.includes("line-through")}}_normalizeBlockBackgroundColor(){const e=this.dom.querySelectorAll('[style*="background-color"]:where(p, h1, h2, h3, h4, li)');for(const t of e)this._moveBackgroundColorToChildren(t)}_moveBackgroundColorToChildren(e){const t=e.style.backgroundColor;e.style.removeProperty("background-color"),e.style.cssText||e.removeAttribute("style");for(const r of e.childNodes){const i=this._wrapTextNode(e,r),s=i.style.backgroundColor||t;i.style.backgroundColor=s}}_wrapTextNode(e,t){if(t.nodeType!==this._Node.TEXT_NODE)return t;const r=this.dom.createElement("span");return r.append(t.cloneNode()),e.replaceChild(r,t),r}}class bN extends $y{normalize(){return this._iterateNodes(this._bubbleMarks),this.content}_iterateNodes(e){this._iterateChildNodes(this.content,e)}_iterateChildNodes(e,t){for(const r of e.content)r.content&&this._iterateChildNodes(r,t),t.call(this,r)}_bubbleMarks(e){if(e.content&&e.type!==oe.LIST){for(const t of e.content)if(!this._isLink(t)&&t.marks)for(const r of t.marks.slice()){if(this._includesMark(e,r)){this._removeMark(t,r);continue}this._canBubbleMark(e,r)&&(this._removeMark(t,r),this._addMark(e,r))}}}_canBubbleMark(e,t){if(m1.includes(t.type)||this._includesMarkType(e,t.type))return!1;for(const r of e.content)if(!(!r.content&&e.type===oe.LIST_ITEM)&&(!r.marks||!this._includesMark(r,t)))return!1;return!0}_includesMark(e,t){return e.marks?.some(r=>Fy.isEqual(r,t))??!1}_includesMarkType(e,t){return e.marks?.some(r=>r.type===t)??!1}_isLink(e){return e.type===oe.TEXT&&this._includesMarkType(e,Oe.LINK)}_removeMark(e,t){if(!e.marks)return;const r=this._findMarkIndexByType(e,t.type);r>=0&&e.marks.splice(r,1),e.marks.length||delete e.marks}_addMark(e,t){this._removeMark(e,t),e.marks??=[],e.marks.push(t)}_findMarkIndexByType(e,t){return e.marks?.findIndex(r=>r.type===t)??null}}class Bl{static build(e,t={}){return typeof e=="string"?this._buildHtml(e,t):this._buildJson(e)}static _buildHtml(e,t){return new _n({content:e,parser:t.parser||new yN})}static _buildJson(e){return new bN({content:e})}static normalize(e,t={}){return Bl.build(e,t).normalize()}}class Pi{static window=globalThis.window;static use(e){this.window=e}static get document(){return this.window.document}static get body(){return this.document.body}static get head(){return this.document.head}static getComputedStyle(e){return this.window.getComputedStyle(e)}}class Eh{static build({config:e,nodeDomParser:t}){const r=gN({fonts:e.fonts,minFontSize:0,maxFontSize:0,presetsRef:na(e.presets),defaultPresetId:e.defaultPresetId,linkPresetId:e.linkPresetId,makePresetVariable:()=>"",basePresetClass:e.basePresetClass,baseListClass:e.baseListClass,deviceRef:na(If.DESKTOP),pageBlocksRef:na([]),wrapperRef:Pi.document.createElement("p")}),i=HT(r);return new Eh({schema:i,domParser:_s.fromSchema(i),nodeDomParser:t})}_schema;_domParser;_nodeDomParser;constructor({schema:e,domParser:t,nodeDomParser:r}){this._schema=e,this._domParser=t,this._nodeDomParser=r}toJSON(e){const t=Bl.build(e,{parser:this._nodeDomParser});return t.normalizeHTML(),this._domParser.parse(t.dom.body).toJSON()}}function _N(n,e){return n.type===e}function wN(n){return typeof n=="string"}class Hy{static doc(e){return{type:oe.DOCUMENT,content:e}}static list(e,t){return{type:oe.LIST,attrs:{bullet:{type:e}},content:t.map(r=>_N(r,oe.LIST_ITEM)?r:this.listItem([r].flat()))}}static listItem(...e){const{attrs:t,content:r,marks:i}=this.normalizeTextBlockArgs(e);return{type:oe.LIST_ITEM,...t?{attrs:t}:{},...i?{marks:i}:{},content:[r].flat().map(s=>wN(s)?this.paragraph(s):s)}}static heading(e,...t){const r=this.textBlock(t);return r.attrs??={},r.attrs.level=e,{type:oe.HEADING,...r}}static paragraph(...e){return{type:oe.PARAGRAPH,...this.textBlock(e)}}static textBlock(e){const{attrs:t,content:r,marks:i}=this.normalizeTextBlockArgs(e);return{content:typeof r=="string"?[this.text(r)]:[r].flat(),...t?{attrs:t}:{},...i?{marks:i}:{}}}static normalizeTextBlockArgs(e){return e.length===1?{attrs:null,marks:null,content:e[0]}:e.length===2?{attrs:e[0],marks:null,content:e[1]}:{attrs:e[0],marks:e[1],content:e[2]}}static text(e,t){return{type:oe.TEXT,...t?{marks:t}:{},text:e}}static link(e,t,r=[]){return this.text(e,[this.mark(Oe.LINK,t),...r])}static mark(e,t){return{type:e,attrs:t}}static populateAllDevices(e){return{mobile:e,tablet:e,desktop:e}}}class vN{_baseClass;_makeVariable;_linkPresetId;constructor({baseClass:e,makeVariable:t,linkPresetId:r}){this._baseClass=e,this._makeVariable=t,this._linkPresetId=r}inject(e,t){let r=e.querySelector("[data-zw-styles]");r||(r=Pi.document.createElement("style"),r.dataset.zwStyles="",r.innerHTML=this.render(t),e.append(r))}render(e){let t="";for(const r of e){const i=r.id===this._linkPresetId,s=this.makePresetCssClass(r);t+=` ${s} {`;for(const a of TO)for(const u of Object.keys(r[a])){const c=this._makeVariable({device:a,preset:r,property:u}),h=this._makeInternalVariableName(u,a);if(t+=`${h}: var(${c}, inherit);`,i&&!p1.includes(u)){const p=h.replace("preset-","");t+=`${p}: var(${h});`}}t+="}"}return t}_makeInternalVariableName(e,t){const r=e==="color"?"font-color":e.replace(/_/i,"-"),i=t===If.COMMON?"":`-${t}`;return`--zw-preset-${r}${i}`}makePresetHtmlClass(e){return this._baseClass+e.id}makePresetCssClass(e){return this.makePresetHtmlClass(e).split(" ").map(t=>`.${t}`).join("")}}class kh{static _instance;static get instance(){return this._instance??=new kh,this._instance}static query(e,t){return this.instance.query(e,t)}query(e,t){let r=null;return e.descendants(i=>{if(r)return!1;if(this.matchNode(i,t))return r=i,!1}),r?t.getMark?this.getMark(r,t.getMark):r:null}matchNode(e,t){return!(t.typeName&&t.typeName!==e.type.name||t.mark&&!this.getMark(e,t.mark))}getMark(e,t){return e.marks.find(r=>this.matchMark(r,t))||null}matchMark(e,t){return e.type.name===t.typeName}}class Wy{static createWindow(){return new sm.JSDOM().window}types;parse(e){const{window:t}=new sm.JSDOM(e);return this.types=t,t.document}}class Vy{name;description;argument;options=[];doCommand(){throw new Error('Command "doCommand" is required')}install(e){if(!this.name)throw new Error('Command "name" is required');let t=e.command(this.name);if(this.description&&(t=t.description(this.description)),this.argument&&(t=t.argument(this.argument)),this.options.length)for(const r of this.options)t=t.option(r.flags,r.description,r.default);t.action(this.doCommand.bind(this))}output(e){}}class SN extends Vy{name="to-json";description="migrate html to json";argument="<html...>";options=[{flags:"-c, --config <path>",description:"Generator config",default:im.resolve(__dirname,"../bin/zp.config.json")},{flags:"-f, --format <type>",description:"Set output format",default:"rb"}];doCommand(e,{config:t,format:r}){Pi.use(Wy.createWindow());const i=im.resolve(process.cwd(),t),s=Eh.build({config:require(i).editor,nodeDomParser:new Wy}),a=e.map(h=>s.toJSON(this._formatInputHtml(h))),u=a.length===1?a[0]:a,c=this._stringifyContent(u);this.output(r==="rb"?this._formatOutputRb(c):c)}_formatInputHtml(e){return e.replace(/\\(["'])/g,"$1").replace(/rgba\(\d{1,3}, ?\d{1,3}, ?\d{1,3}, (\d{1,2}%)\)/g,(t,r)=>t.replace(r,parseFloat(r)/100))}_stringifyContent(e){return JSON.stringify(e,(r,i)=>i===null?void 0:i,2)}_formatOutputRb(e){return e.replace(/\\"/g,'"').replace(/font-family: ?'(.+)'/g,'font-family: "$1"').replace(/'/g,"\\'").replace(/^[\t ]*"[^:\n\r]+(?<!\\)":/gm,t=>t.replace(/"/g,"")).replace(/: "(.+)"([,\n])/g,": '$1'$2")}}var xN="4.11.2";class CN extends Vy{name="version";description="display cli version";doCommand(){this.output(xN)}}const Uy=new VC,EN=[SN,CN];for(const n of EN)new n().install(Uy);Uy.parse();
|
|
67
|
+
`)+F+`return __p
|
|
68
|
+
}`;var se=$m(function(){return be(x,j+"return "+F).apply(t,C)});if(se.source=F,vc(se))throw se;return se}function HE(o){return _e(o).toLowerCase()}function WE(o){return _e(o).toUpperCase()}function VE(o,l,f){if(o=_e(o),o&&(f||l===t))return Kd(o);if(!o||!(l=kt(l)))return o;var p=nn(o),b=nn(l),x=Gd(p,b),C=Jd(p,b)+1;return lr(p,x,C).join("")}function UE(o,l,f){if(o=_e(o),o&&(f||l===t))return o.slice(0,Yd(o)+1);if(!o||!(l=kt(l)))return o;var p=nn(o),b=Jd(p,nn(l))+1;return lr(p,0,b).join("")}function qE(o,l,f){if(o=_e(o),o&&(f||l===t))return o.replace(vu,"");if(!o||!(l=kt(l)))return o;var p=nn(o),b=Gd(p,nn(l));return lr(p,b).join("")}function KE(o,l){var f=te,p=Se;if(Me(l)){var b="separator"in l?l.separator:b;f="length"in l?ie(l.length):f,p="omission"in l?kt(l.omission):p}o=_e(o);var x=o.length;if(hi(o)){var C=nn(o);x=C.length}if(f>=x)return o;var O=f-di(p);if(O<1)return p;var I=C?lr(C,0,O).join(""):o.slice(0,O);if(b===t)return I+p;if(C&&(O+=I.length-O),Sc(b)){if(o.slice(O).search(b)){var P,D=I;for(b.global||(b=Fu(b.source,_e(pd.exec(b))+"g")),b.lastIndex=0;P=b.exec(D);)var F=P.index;I=I.slice(0,F===t?O:F)}}else if(o.indexOf(kt(b),O)!=O){var q=I.lastIndexOf(b);q>-1&&(I=I.slice(0,q))}return I+p}function GE(o){return o=_e(o),o&&i_.test(o)?o.replace(fd,S2):o}var JE=wi(function(o,l,f){return o+(f?" ":"")+l.toUpperCase()}),Cc=Fp("toUpperCase");function Dm(o,l,f){return o=_e(o),l=f?t:l,l===t?y2(o)?C2(o):l2(o):o.match(l)||[]}var $m=ue(function(o,l){try{return Et(o,t,l)}catch(f){return vc(f)?f:new ne(f)}}),jE=Nn(function(o,l){return Bt(l,function(f){f=mn(f),Mn(o,f,_c(o[f],o))}),o});function YE(o){var l=o==null?0:o.length,f=Y();return o=l?Te(o,function(p){if(typeof p[1]!="function")throw new zt(a);return[f(p[0]),p[1]]}):[],ue(function(p){for(var b=-1;++b<l;){var x=o[b];if(Et(x[0],this,p))return Et(x[1],this,p)}})}function XE(o){return Sw(Wt(o,d))}function kc(o){return function(){return o}}function ZE(o,l){return o==null||o!==o?l:o}var QE=zp(),eC=zp(!0);function gt(o){return o}function Tc(o){return gp(typeof o=="function"?o:Wt(o,d))}function tC(o){return bp(Wt(o,d))}function nC(o,l){return _p(o,Wt(l,d))}var rC=ue(function(o,l){return function(f){return gs(f,o,l)}}),iC=ue(function(o,l){return function(f){return gs(o,f,l)}});function Ac(o,l,f){var p=Ve(l),b=Do(l,p);f==null&&!(Me(l)&&(b.length||!p.length))&&(f=l,l=o,o=this,b=Do(l,Ve(l)));var x=!(Me(f)&&"chain"in f)||!!f.chain,C=Ln(o);return Bt(b,function(O){var I=l[O];o[O]=I,C&&(o.prototype[O]=function(){var P=this.__chain__;if(x||P){var D=o(this.__wrapped__),F=D.__actions__=dt(this.__actions__);return F.push({func:I,args:arguments,thisArg:o}),D.__chain__=P,D}return I.apply(o,nr([this.value()],arguments))})}),o}function sC(){return Xe._===this&&(Xe._=I2),this}function Oc(){}function oC(o){return o=ie(o),ue(function(l){return wp(l,o)})}var aC=oc(Te),lC=oc(Hd),uC=oc(Iu);function Fm(o){return dc(o)?Nu(mn(o)):Bw(o)}function cC(o){return function(l){return o==null?t:Fr(o,l)}}var fC=Wp(),hC=Wp(!0);function Mc(){return[]}function Ic(){return!1}function dC(){return{}}function pC(){return""}function mC(){return!0}function gC(o,l){if(o=ie(o),o<1||o>er)return[];var f=xt,p=nt(o,xt);l=Y(l),o-=xt;for(var b=Pu(p,l);++f<o;)l(f);return b}function yC(o){return re(o)?Te(o,mn):Tt(o)?[o]:dt(im(_e(o)))}function bC(o){var l=++O2;return _e(o)+l}var _C=Wo(function(o,l){return o+l},0),wC=ac("ceil"),vC=Wo(function(o,l){return o/l},1),SC=ac("floor");function xC(o){return o&&o.length?Po(o,gt,Ku):t}function EC(o,l){return o&&o.length?Po(o,Y(l,2),Ku):t}function CC(o){return Ud(o,gt)}function kC(o,l){return Ud(o,Y(l,2))}function TC(o){return o&&o.length?Po(o,gt,Yu):t}function AC(o,l){return o&&o.length?Po(o,Y(l,2),Yu):t}var OC=Wo(function(o,l){return o*l},1),MC=ac("round"),IC=Wo(function(o,l){return o-l},0);function NC(o){return o&&o.length?Lu(o,gt):0}function RC(o,l){return o&&o.length?Lu(o,Y(l,2)):0}return w.after=tx,w.ary=mm,w.assign=Wx,w.assignIn=Om,w.assignInWith=ta,w.assignWith=Vx,w.at=Ux,w.before=gm,w.bind=_c,w.bindAll=jE,w.bindKey=ym,w.castArray=dx,w.chain=hm,w.chunk=Sv,w.compact=xv,w.concat=Ev,w.cond=YE,w.conforms=XE,w.constant=kc,w.countBy=NS,w.create=qx,w.curry=bm,w.curryRight=_m,w.debounce=wm,w.defaults=Kx,w.defaultsDeep=Gx,w.defer=nx,w.delay=rx,w.difference=Cv,w.differenceBy=kv,w.differenceWith=Tv,w.drop=Av,w.dropRight=Ov,w.dropRightWhile=Mv,w.dropWhile=Iv,w.fill=Nv,w.filter=LS,w.flatMap=$S,w.flatMapDeep=FS,w.flatMapDepth=BS,w.flatten=lm,w.flattenDeep=Rv,w.flattenDepth=Lv,w.flip=ix,w.flow=QE,w.flowRight=eC,w.fromPairs=Pv,w.functions=eE,w.functionsIn=tE,w.groupBy=zS,w.initial=$v,w.intersection=Fv,w.intersectionBy=Bv,w.intersectionWith=zv,w.invert=rE,w.invertBy=iE,w.invokeMap=WS,w.iteratee=Tc,w.keyBy=VS,w.keys=Ve,w.keysIn=mt,w.map=jo,w.mapKeys=oE,w.mapValues=aE,w.matches=tC,w.matchesProperty=nC,w.memoize=Xo,w.merge=lE,w.mergeWith=Mm,w.method=rC,w.methodOf=iC,w.mixin=Ac,w.negate=Zo,w.nthArg=oC,w.omit=uE,w.omitBy=cE,w.once=sx,w.orderBy=US,w.over=aC,w.overArgs=ox,w.overEvery=lC,w.overSome=uC,w.partial=wc,w.partialRight=vm,w.partition=qS,w.pick=fE,w.pickBy=Im,w.property=Fm,w.propertyOf=cC,w.pull=Uv,w.pullAll=cm,w.pullAllBy=qv,w.pullAllWith=Kv,w.pullAt=Gv,w.range=fC,w.rangeRight=hC,w.rearg=ax,w.reject=JS,w.remove=Jv,w.rest=lx,w.reverse=yc,w.sampleSize=YS,w.set=dE,w.setWith=pE,w.shuffle=XS,w.slice=jv,w.sortBy=ex,w.sortedUniq=nS,w.sortedUniqBy=rS,w.split=$E,w.spread=ux,w.tail=iS,w.take=sS,w.takeRight=oS,w.takeRightWhile=aS,w.takeWhile=lS,w.tap=xS,w.throttle=cx,w.thru=Jo,w.toArray=km,w.toPairs=Nm,w.toPairsIn=Rm,w.toPath=yC,w.toPlainObject=Am,w.transform=mE,w.unary=fx,w.union=uS,w.unionBy=cS,w.unionWith=fS,w.uniq=hS,w.uniqBy=dS,w.uniqWith=pS,w.unset=gE,w.unzip=bc,w.unzipWith=fm,w.update=yE,w.updateWith=bE,w.values=xi,w.valuesIn=_E,w.without=mS,w.words=Dm,w.wrap=hx,w.xor=gS,w.xorBy=yS,w.xorWith=bS,w.zip=_S,w.zipObject=wS,w.zipObjectDeep=vS,w.zipWith=SS,w.entries=Nm,w.entriesIn=Rm,w.extend=Om,w.extendWith=ta,Ac(w,w),w.add=_C,w.attempt=$m,w.camelCase=xE,w.capitalize=Lm,w.ceil=wC,w.clamp=wE,w.clone=px,w.cloneDeep=gx,w.cloneDeepWith=yx,w.cloneWith=mx,w.conformsTo=bx,w.deburr=Pm,w.defaultTo=ZE,w.divide=vC,w.endsWith=EE,w.eq=sn,w.escape=CE,w.escapeRegExp=kE,w.every=RS,w.find=PS,w.findIndex=om,w.findKey=Jx,w.findLast=DS,w.findLastIndex=am,w.findLastKey=jx,w.floor=SC,w.forEach=dm,w.forEachRight=pm,w.forIn=Yx,w.forInRight=Xx,w.forOwn=Zx,w.forOwnRight=Qx,w.get=xc,w.gt=_x,w.gte=wx,w.has=nE,w.hasIn=Ec,w.head=um,w.identity=gt,w.includes=HS,w.indexOf=Dv,w.inRange=vE,w.invoke=sE,w.isArguments=Hr,w.isArray=re,w.isArrayBuffer=vx,w.isArrayLike=pt,w.isArrayLikeObject=Le,w.isBoolean=Sx,w.isBuffer=ur,w.isDate=xx,w.isElement=Ex,w.isEmpty=Cx,w.isEqual=kx,w.isEqualWith=Tx,w.isError=vc,w.isFinite=Ax,w.isFunction=Ln,w.isInteger=Sm,w.isLength=Qo,w.isMap=xm,w.isMatch=Ox,w.isMatchWith=Mx,w.isNaN=Ix,w.isNative=Nx,w.isNil=Lx,w.isNull=Rx,w.isNumber=Em,w.isObject=Me,w.isObjectLike=Ie,w.isPlainObject=Ss,w.isRegExp=Sc,w.isSafeInteger=Px,w.isSet=Cm,w.isString=ea,w.isSymbol=Tt,w.isTypedArray=Si,w.isUndefined=Dx,w.isWeakMap=$x,w.isWeakSet=Fx,w.join=Hv,w.kebabCase=TE,w.last=Ut,w.lastIndexOf=Wv,w.lowerCase=AE,w.lowerFirst=OE,w.lt=Bx,w.lte=zx,w.max=xC,w.maxBy=EC,w.mean=CC,w.meanBy=kC,w.min=TC,w.minBy=AC,w.stubArray=Mc,w.stubFalse=Ic,w.stubObject=dC,w.stubString=pC,w.stubTrue=mC,w.multiply=OC,w.nth=Vv,w.noConflict=sC,w.noop=Oc,w.now=Yo,w.pad=ME,w.padEnd=IE,w.padStart=NE,w.parseInt=RE,w.random=SE,w.reduce=KS,w.reduceRight=GS,w.repeat=LE,w.replace=PE,w.result=hE,w.round=MC,w.runInContext=M,w.sample=jS,w.size=ZS,w.snakeCase=DE,w.some=QS,w.sortedIndex=Yv,w.sortedIndexBy=Xv,w.sortedIndexOf=Zv,w.sortedLastIndex=Qv,w.sortedLastIndexBy=eS,w.sortedLastIndexOf=tS,w.startCase=FE,w.startsWith=BE,w.subtract=IC,w.sum=NC,w.sumBy=RC,w.template=zE,w.times=gC,w.toFinite=Pn,w.toInteger=ie,w.toLength=Tm,w.toLower=HE,w.toNumber=qt,w.toSafeInteger=Hx,w.toString=_e,w.toUpper=WE,w.trim=VE,w.trimEnd=UE,w.trimStart=qE,w.truncate=KE,w.unescape=GE,w.uniqueId=bC,w.upperCase=JE,w.upperFirst=Cc,w.each=dm,w.eachRight=pm,w.first=um,Ac(w,function(){var o={};return dn(w,function(l,f){ve.call(w.prototype,f)||(o[f]=l)}),o}(),{chain:!1}),w.VERSION=r,Bt(["bind","bindKey","curry","curryRight","partial","partialRight"],function(o){w[o].placeholder=w}),Bt(["drop","take"],function(o,l){fe.prototype[o]=function(f){f=f===t?1:Be(ie(f),0);var p=this.__filtered__&&!l?new fe(this):this.clone();return p.__filtered__?p.__takeCount__=nt(f,p.__takeCount__):p.__views__.push({size:nt(f,xt),type:o+(p.__dir__<0?"Right":"")}),p},fe.prototype[o+"Right"]=function(f){return this.reverse()[o](f).reverse()}}),Bt(["filter","map","takeWhile"],function(o,l){var f=l+1,p=f==$t||f==We;fe.prototype[o]=function(b){var x=this.clone();return x.__iteratees__.push({iteratee:Y(b,3),type:f}),x.__filtered__=x.__filtered__||p,x}}),Bt(["head","last"],function(o,l){var f="take"+(l?"Right":"");fe.prototype[o]=function(){return this[f](1).value()[0]}}),Bt(["initial","tail"],function(o,l){var f="drop"+(l?"":"Right");fe.prototype[o]=function(){return this.__filtered__?new fe(this):this[f](1)}}),fe.prototype.compact=function(){return this.filter(gt)},fe.prototype.find=function(o){return this.filter(o).head()},fe.prototype.findLast=function(o){return this.reverse().find(o)},fe.prototype.invokeMap=ue(function(o,l){return typeof o=="function"?new fe(this):this.map(function(f){return gs(f,o,l)})}),fe.prototype.reject=function(o){return this.filter(Zo(Y(o)))},fe.prototype.slice=function(o,l){o=ie(o);var f=this;return f.__filtered__&&(o>0||l<0)?new fe(f):(o<0?f=f.takeRight(-o):o&&(f=f.drop(o)),l!==t&&(l=ie(l),f=l<0?f.dropRight(-l):f.take(l-o)),f)},fe.prototype.takeRightWhile=function(o){return this.reverse().takeWhile(o).reverse()},fe.prototype.toArray=function(){return this.take(xt)},dn(fe.prototype,function(o,l){var f=/^(?:filter|find|map|reject)|While$/.test(l),p=/^(?:head|last)$/.test(l),b=w[p?"take"+(l=="last"?"Right":""):l],x=p||/^find/.test(l);b&&(w.prototype[l]=function(){var C=this.__wrapped__,O=p?[1]:arguments,I=C instanceof fe,P=O[0],D=I||re(C),F=function(ce){var me=b.apply(w,nr([ce],O));return p&&q?me[0]:me};D&&f&&typeof P=="function"&&P.length!=1&&(I=D=!1);var q=this.__chain__,j=!!this.__actions__.length,X=x&&!q,se=I&&!j;if(!x&&D){C=se?C:new fe(this);var Z=o.apply(C,O);return Z.__actions__.push({func:Jo,args:[F],thisArg:t}),new Ht(Z,q)}return X&&se?o.apply(this,O):(Z=this.thru(F),X?p?Z.value()[0]:Z.value():Z)})}),Bt(["pop","push","shift","sort","splice","unshift"],function(o){var l=wo[o],f=/^(?:push|sort|unshift)$/.test(o)?"tap":"thru",p=/^(?:pop|shift)$/.test(o);w.prototype[o]=function(){var b=arguments;if(p&&!this.__chain__){var x=this.value();return l.apply(re(x)?x:[],b)}return this[f](function(C){return l.apply(re(C)?C:[],b)})}}),dn(fe.prototype,function(o,l){var f=w[l];if(f){var p=f.name+"";ve.call(yi,p)||(yi[p]=[]),yi[p].push({name:l,func:f})}}),yi[Ho(t,g).name]=[{name:"wrapper",func:t}],fe.prototype.clone=G2,fe.prototype.reverse=J2,fe.prototype.value=j2,w.prototype.at=ES,w.prototype.chain=CS,w.prototype.commit=kS,w.prototype.next=TS,w.prototype.plant=OS,w.prototype.reverse=MS,w.prototype.toJSON=w.prototype.valueOf=w.prototype.value=IS,w.prototype.first=w.prototype.head,us&&(w.prototype[us]=AS),w},pi=k2();Rr?((Rr.exports=pi)._=pi,Tu._=pi):Xe._=pi}).call(wR)}(ro,ro.exports)),ro.exports}var Bb=vR();function ed(n){return n.type.create(Bb.cloneDeep(n.attrs))}function td({tr:n,node:e,position:t,mark:r}){return e.isText?n.removeMark(t,t+e.nodeSize,r):n.removeNodeMark(t,r)}const SR=Re.create({name:"node_processor",addCommands(){return{setBlockAttributes:H(({commands:n,state:e},t,r,i={})=>{const s=W(n.getBlockAttributes(t))??{},{doc:a,tr:u}=e,{from:c,to:h}=u.selection;a.nodesBetween(c,h,(m,d)=>{th.includes(m.type.name)&&u.setNodeAttribute(d,t,{...i,...s,...r})})}),getBlockAttributes:H(({editor:n},e,t)=>ge(()=>{let r=Object.assign({},t||{});for(const i of th)Object.assign(r,n.getAttributes(i)?.[e]||{});return Object.keys(r).length?r:null})),removeBlockAttributes:H(({commands:n},e)=>{for(const t of th)n.resetAttributes(t,e)}),applyMark:H(({state:n,commands:e},t,r,i={})=>{const{tr:s,doc:a,schema:u}=n,{$from:c,$to:h}=s.selection,m=yn(Oe.LINK,u),d=yn(t,u);if(!(d.spec.group||"").includes(Jt.SETTINGS))return e.setMark(t,r);if(c.pos===h.pos)return;const _=v=>{if(!i.onAppliedToParent||i.onAppliedToParent(v)===!1){const{tr:E,node:N,position:g,mark:S}=v;td({tr:E,node:N,position:g,mark:S.type})}};a.nodesBetween(c.pos,h.pos,(v,E)=>{if(v.type.name===oe.LIST)return;const N=_R(v.marks,t),g=d.create({...N?.attrs||{},...r}),S=Db(c,h,v,E);if(!m.isInSet(v.marks)&&bR(s.doc,E,g,i.isAppliedToParent))return _({tr:s,node:v,position:E,mark:g});if(v.isText){s.addMark(S.from,S.to,g);return}gR(s.doc,s.selection,v,E)&&s.addNodeMark(E,g)})}),getMarks:H(({editor:n},e)=>{const t=Ti(n,"state");return ge(()=>{const{selection:r,doc:i}=W(t),{from:s,to:a}=W(r),u=[];return i.nodesBetween(s,a,c=>{for(const h of c.marks)h.type.name===e&&u.unshift(h.attrs)}),u})}),getMark:H(({commands:n},e)=>{const t=n.getMarks(e);return ge(()=>W(t)[0]??null)}),hasMark:H(({commands:n},e)=>{const t=n.getMark(e);return ge(()=>!!W(t))}),getCommonSettingMark:H(({commands:n},e,t)=>{const r=n.getMark(e);return ge(()=>W(r)?.value??W(t))}),getDeviceSettingMark:H(({commands:n},e,t)=>{const r=n.getMarks(e),i=n.getDevice();return ge(()=>{for(const s of W(r)){const a=s[W(i)];if(a)return a}return W(t)})}),removeAllMarks:H(({state:n})=>{const{tr:e,doc:t}=n,{from:r,to:i}=e.selection;t.nodesBetween(r,i,(s,a)=>{for(const u of s.marks)td({tr:e,node:s,position:a,mark:u})})}),removeMarks:H(({state:n},e)=>{const{tr:t,doc:r}=n,{from:i,to:s}=t.selection;r.nodesBetween(i,s,(a,u)=>{const c=a.marks.filter(h=>e.includes(h.type.name));for(const h of c)td({tr:t,node:a,position:u,mark:h})})})}}}),xR=Re.create({name:"text_processor",addCommands(){return{getSelectedText:H(({state:n})=>{const{from:e,to:t}=n.selection;return n.doc.textBetween(e,t," ")}),transformText:H(({state:n},e)=>{const{$from:t,$to:r}=n.tr.selection;t.pos!==r.pos&&n.doc.nodesBetween(t.pos,r.pos,(i,s)=>{if(!i.isText)return;const a=Db(t,r,i,s),u=Math.max(0,t.pos-s),c=Math.max(0,r.pos-s),h=e({text:i.textContent.substring(u,c)}),m=n.schema.text(h,i.marks);n.tr.replaceWith(a.from,a.to,m)})})}}}),ER=Re.create({name:"selection_processor",addStorage:()=>({selection:null}),addCommands(){return{storeSelection:H(({state:n})=>{this.storage.selection=n.selection}),restoreSelection:H(({commands:n})=>{this.storage.selection&&n.setTextSelection(this.storage.selection)}),expandSelection:H(({tr:n,commands:e},t)=>{let r=n.selection.from,i=n.selection.to;return n.doc.nodesBetween(r,i,(s,a,u)=>{if(t({node:s,parent:u})){const c=s.isText?0:$b(n.doc,a);r=Math.min(r,a+c),i=Math.max(i,a+s.nodeSize-c)}}),e.setTextSelection({from:r,to:i})}),expandSelectionToBlock:H(({commands:n})=>n.expandSelection(({parent:e})=>e.type.name===oe.DOCUMENT))}}}),CR=Qn.create({name:"doc",topNode:!0,content:"block+"});class ao extends Ue{constructor(e,t,r,i="SetDocAttr"){super(),this.key=e,this.value=t,this.schema=r,this.stepType=i}apply(e){this.prevValue=e.attrs.meta[this.key];const t=mr.fromJSON(this.schema,e.toJSON());return t.attrs.meta[this.key]=this.value,De.ok(t)}invert(){return new ao(this.key,this.prevValue,this.schema,"revertSetDocAttr")}map(){return null}toJSON(){return{stepType:this.stepType,key:this.key,value:this.value}}static fromJSON(e){return new ao(e.key,e.value,e.stepType)}}Ue.jsonID("setDocAttr",ao);const kR=CR.extend({marks:Jt.SETTINGS,addAttributes:()=>({meta:{default:{}}}),onCreate(){this.editor.view.dom.addEventListener("click",n=>{n.target.closest("a")&&n.preventDefault()})},addCommands(){return{setDocMetaAttributes:H(({state:n},e,t)=>{n.tr.step(new ao(e,t,n.schema))})}}}),TR=Qn.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:n}){return["p",Bi(this.options.HTMLAttributes,n),0]},addCommands(){return{setParagraph:()=>({commands:n})=>n.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),AR=TR.extend({marks:Jt.ALL,addOptions:()=>({HTMLAttributes:{class:"zw-style"}})}),OR=Qn.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(n=>({tag:`h${n}`,attrs:{level:n}}))},renderHTML({node:n,HTMLAttributes:e}){return[`h${this.options.levels.includes(n.attrs.level)?n.attrs.level:this.options.levels[0]}`,Bi(this.options.HTMLAttributes,e),0]},addCommands(){return{setHeading:n=>({commands:e})=>this.options.levels.includes(n.level)?e.setNode(this.name,n):!1,toggleHeading:n=>({commands:e})=>this.options.levels.includes(n.level)?e.toggleNode(this.name,"paragraph",n):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((n,e)=>({...n,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(n=>gM({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${n}})\\s$`),type:this.type,getAttributes:{level:n}}))}}),MR=OR.extend({marks:Jt.ALL,addOptions:()=>({levels:[1,2,3,4],HTMLAttributes:{class:"zw-style"}})}),IR=Re.create({name:"prose_mirror_plugins",addProseMirrorPlugins(){return[LM.create(this.editor),PM.create(this.editor)]}}),NR=()=>[kR,AR,MR,_M,OM,SR,xR,ER,IR],RR=Rt.create({name:Oe.FONT_FAMILY,group:Jt.SETTINGS,addOptions:()=>({fonts:[]}),addAttributes:()=>({value:{required:!0}}),addCommands(){return{applyFontFamily:H(({commands:n},e)=>{n.applyMark(this.name,{value:e});const t=n.findFontByName(e);let r=W(n.getFontWeight());t.isWeightSupported(r)||(r=t.findClosestWeight(r),n.applyFontWeight(r));const i=n.isSettingCustomized(Oe.FONT_STYLE).value;t.isItalicOnly?n.applyItalic():!t.isItalicSupported(r)&&i&&n.removeItalic()}),getFont:H(({commands:n})=>{const e=W(this.options.defaultPreset),t=n.findFontByName(e.common.font_family),r=n.getFontFamily();return ge(()=>n.findFontByName(W(r))||t)}),findFontByName:H((n,e)=>W(this.options.fonts).find(t=>t.name===e)??this.options.defaultFont),getFontFamily:H(({commands:n})=>n.getCommonSettingMark(this.name,n.getDefaultFontFamily())),getDefaultFontFamily:H(({commands:n})=>{const e=n.getPreset();return ge(()=>W(e).common.font_family)})}},parseHTML(){const n=e=>({value:e.replace(/["']/g,"")});return[{style:"--zw-font-family",getAttrs:n},{style:"font-family",getAttrs:n}]},renderHTML({HTMLAttributes:n}){const e=n.value?`"${n.value}"`:null;return ei({font_family:e})}}),LR=Re.create({name:Oe.STYLE_PRESET,addGlobalAttributes(){return[{types:[oe.PARAGRAPH,oe.HEADING],attributes:{preset:{isRequired:!1,default:{id:W(this.options.defaultId)},parseHTML:n=>{const e=W(this.options.presets);if(n.parentElement.tagName==="LI")return null;for(const{id:t,node:r,fallbackClass:i}of e){if(i&&n.classList.contains(i))return{id:t};const s=W(this.options.styleRenderer).makePresetCssClass({id:t});if(n.matches(s))return{id:t};if(n.tagName===`H${r?.level}`)return{id:t}}return n.tagName==="P"?{id:W(this.options.defaultId)}:null},renderHTML:n=>n.preset?{class:W(this.options.styleRenderer).makePresetHtmlClass(n.preset)}:null}}}]},addCommands(){function n(t,r){return t.find(i=>r===i.id)}function e(t,r){const i={};for(const s of Object.keys(t)){const a=t[s],u=r[s],c=!u||u.toLowerCase()==="inherit";i[s]=c?a:u}return i}return{getPresetList:H(()=>ge(()=>W(this.options.presets).filter(t=>!t.hidden))),getPreset:H(({commands:t})=>{const r=t.getBlockAttributes("preset",{id:W(this.options.defaultId)}),i=t.getPresetList(),s=t.isLink(),a=t.getLinkPreset();return ge(()=>{const u=n(W(i),W(r).id);if(!W(s))return u;const c=W(a);return{id:u.id,common:e(u.common,c.common),mobile:e(u.mobile,c.mobile),tablet:e(u.tablet,c.tablet),desktop:e(u.desktop,c.desktop)}})}),applyPreset:H(({commands:t,chain:r},i)=>{const s=W(t.getPresetList()),a=n(s,i),u=a.node?.type??oe.PARAGRAPH,c={preset:{id:i}};a.node&&(c.level=a.node.level);for(const h of Y1)c[h]=W(t.getBlockAttributes(h));r().removeList().setNode(u,c).run()}),applyDefaultPreset:H(({commands:t})=>{t.applyPreset(W(this.options.defaultId))}),removePreset:H(({commands:t})=>{t.setNode(oe.PARAGRAPH,{preset:null})}),getPresetCustomization:H(({editor:t,commands:r})=>{const i=Ti(t,"state");return ge(()=>{const{selection:s,doc:a}=W(i),{from:u,to:c}=s;return r._getSettingCustomization(a,u,c)})}),isSettingCustomized:H(({commands:t},r)=>{const i=t.getPresetCustomization(),s=ol.includes(r)?"attributes":"marks";return ge(()=>W(i)[s]?.includes(r)??!1)}),getContentCustomization:H(({editor:t,commands:r})=>{const i=Ti(t,"state");return ge(()=>{const{doc:s}=W(i);return r._getSettingCustomization(s,0,s.content.size)})}),_getSettingCustomization:H((t,r,i,s)=>{const a=new Set,u=new Set;return r.nodesBetween(i,s,c=>{for(const[h,m]of Object.entries(c.attrs))ol.includes(h)&&m&&u.add(h);for(const{type:h}of c.marks)Z1.includes(h.name)&&a.add(h.name)}),{attributes:Array.from(u),marks:Array.from(a)}}),removePresetCustomization:H(({chain:t})=>{t().storeSelection().expandSelectionToBlock().removeMarks(Z1).resetAttributes(oe.PARAGRAPH,ol).resetAttributes(oe.HEADING,ol).restoreSelection().run()}),removeFormat:H(({chain:t})=>{t().storeSelection().expandSelectionToBlock().removeAllMarks().applyDefaultPreset().restoreSelection().run()})}},onCreate(){this.options.styleRenderer.inject(ji.head,W(this.options.presets))}}),PR=Rt.create({name:Oe.FONT_WEIGHT,group:Jt.SETTINGS,addAttributes:()=>({value:{required:!0}}),addCommands(){return{applyFontWeight:H(({commands:n},e)=>{n.applyMark(this.name,{value:e}),W(n.getFont()).isItalicSupported(e)||n.removeItalic()}),toggleBold:H(({commands:n})=>{const e=W(n.getFontWeight()),t=W(n.getFont()),i=Number(e)>=600?"400":"700",s=t.findClosestWeight(i);n.applyFontWeight(s)}),getFontWeight:H(({commands:n})=>{const e=n.getCommonSettingMark(this.name,n.getDefaultFontWeight()),t=n.getFont();return ge(()=>{const r=W(e),i=W(t);return i.isWeightSupported(r)?r:i.findClosestWeight(r)})}),getDefaultFontWeight:H(({commands:n})=>{const e=n.getPreset();return ge(()=>W(e).common.font_weight)})}},addKeyboardShortcuts:()=>({"Mod-b":Xt("toggleBold"),"Mod-B":Xt("toggleBold")}),parseHTML(){const n=e=>e==="bold"?{value:"700"}:Number(e)?{value:e}:!1;return[{style:"--zw-font-weight",getAttrs:n},{style:"font-weight",getAttrs:n},{tag:"b",attrs:{value:"700"}},{tag:"strong",attrs:{value:"700"}}]},renderHTML({HTMLAttributes:n}){return ei({font_weight:n.value})}}),DR=Rt.create({name:Oe.FONT_SIZE,group:Jt.SETTINGS,addOptions:()=>({minSize:1,maxSize:100}),addAttributes(){return{mobile:{default:null},tablet:{default:null},desktop:{default:null}}},addCommands(){return{getFontSize:H(({commands:n})=>n.getDeviceSettingMark(this.name,n.getDefaultFontSize())),getDefaultFontSize:H(({commands:n})=>{const e=n.getDevice(),t=n.getPreset();return ge(()=>W(t)[W(e)].font_size.replace("px",""))}),applyFontSize:H(({commands:n},e)=>{const t=W(n.getDevice());n.applyMark(this.name,{[t]:e},{isAppliedToParent:(r,i)=>r.type.name!==i.type.name?!1:r.attrs[t]===i.attrs[t],onAppliedToParent:({tr:r,node:i,position:s,mark:a})=>{const u={...a.attrs,[t]:null};if(!Object.values(u).some(m=>!!m))return!1;const h=a.type.create(u);if(i.isText){r.addMark(s,s+i.nodeSize,h);return}r.addNodeMark(s,h)}})}),increaseFontSize:H(({commands:n})=>{const e=Number(W(n.getFontSize())),t=Math.min(e+1,W(this.options.maxSize));n.applyFontSize(String(t))}),decreaseFontSize:H(({commands:n})=>{const e=Number(W(n.getFontSize())),t=Math.max(e-1,W(this.options.minSize));n.applyFontSize(String(t))})}},addKeyboardShortcuts:()=>({"Mod-Shift-=":Xt("increaseFontSize"),"Mod-Shift--":Xt("decreaseFontSize")}),parseHTML(){const n=e=>{if(!e)return null;const t=W(this.options.wrapperRef),r=Pb(e,t);return String(r)};return[{tag:'[style*="--zw-font-size"]',getAttrs:({style:e})=>({mobile:n(e.getPropertyValue("--zw-font-size-mobile")),tablet:n(e.getPropertyValue("--zw-font-size-tablet")),desktop:n(e.getPropertyValue("--zw-font-size-desktop"))})},{style:"font-size",getAttrs:e=>{const t=n(e);return{desktop:t,tablet:t,mobile:null}}}]},renderHTML({HTMLAttributes:n}){const e=t=>t?`${t}px`:null;return ei({font_size_mobile:e(n.mobile),font_size_tablet:e(n.tablet),font_size_desktop:e(n.desktop)})}}),$R=Rt.create({name:Oe.FONT_COLOR,group:Jt.SETTINGS,addAttributes:()=>({value:{required:!0}}),addCommands(){return{getFontColor:H(({commands:n})=>n.getCommonSettingMark(this.name,n.getDefaultFontColor())),getDefaultFontColor:H(({commands:n})=>{const e=n.getPreset();return ge(()=>W(e).common.color)}),applyFontColor:H(({commands:n},e)=>{n.applyMark(this.name,{value:e})})}},parseHTML(){const n=e=>({value:Lb(e)});return[{style:"--zw-font-color",getAttrs:n},{style:"color",getAttrs:n}]},renderHTML({HTMLAttributes:n}){return ei({font_color:n.value})}}),FR=Rt.create({name:Oe.BACKGROUND_COLOR,addAttributes:()=>({value:{required:!0}}),addCommands(){return{getBackgroundColor:H(({commands:n})=>n.getCommonSettingMark(this.name,"rgba(255, 255, 255, 0%)")),applyBackgroundColor:H(({commands:n},e)=>{n.applyMark(this.name,{value:e})})}},parseHTML(){const n=e=>({value:Lb(e)});return[{style:"--zw-background-color",getAttrs:n},{style:"background-color",getAttrs:n}]},renderHTML({HTMLAttributes:n}){return ei({background_color:n.value})}}),BR=Re.create({name:"device_manager",addCommands(){return{getDevice:H(()=>Ti(this.options,"device"))}}}),zR=Rt.create({name:Oe.FONT_STYLE,group:Jt.SETTINGS,addAttributes:()=>({italic:{required:!0}}),addCommands(){return{isItalic:H(({commands:n})=>{const e=n.getMark(this.name),t=n.getDefaultFontStyle();return ge(()=>W(e)?.italic??W(t).italic)}),isItalicAvailable:H(({commands:n})=>{const e=n.getFont(),t=n.getFontWeight();return ge(()=>{const r=W(e),i=W(t);return r.isItalicSupported(i)&&!r.isWeightItalicOnly(i)})}),getDefaultFontStyle:H(({commands:n})=>{const e=n.getPreset();return ge(()=>({italic:W(e).common.font_style==="italic"}))}),toggleItalic:H(({commands:n})=>{W(n.isItalicAvailable())&&(W(n.isItalic())?n.removeItalic():n.applyItalic())}),applyItalic:H(({commands:n})=>{n.applyMark(this.name,{italic:!0})}),removeItalic:H(({commands:n})=>{n.applyMark(this.name,{italic:!1})})}},addKeyboardShortcuts:()=>({"Mod-i":Xt("toggleItalic"),"Mod-I":Xt("toggleItalic")}),parseHTML(){const n=e=>({italic:e.includes("italic")});return[{tag:"i",attrs:{italic:!0}},{style:"--zw-font-style",getAttrs:n},{style:"font-style",getAttrs:n}]},renderHTML({HTMLAttributes:n}){const e=n.italic?"italic":"normal";return ei({font_style:e})}}),HR=Rt.create({name:Oe.TEXT_DECORATION,priority:1e3,addAttributes:()=>({underline:{default:!1},strike_through:{default:!1}}),addCommands(){return{isUnderline:H(({commands:n})=>{const e=n.getTextDecoration();return ge(()=>W(e).underline)}),isStrikeThrough:H(({commands:n})=>{const e=n.getTextDecoration();return ge(()=>W(e).strike_through)}),getTextDecoration:H(({commands:n})=>{const e=n.getMark(this.name),t=n.getDefaultTextDecoration();return ge(()=>{const r=W(e)??{},i=W(t);return{underline:r.underline||i.underline,strike_through:r.strike_through||i.strike_through}})}),isUnderlineCustomized:H(({commands:n})=>{const e=n.isUnderline(),t=n.getDefaultTextDecoration();return ge(()=>W(e)!==W(t).underline)}),getDefaultTextDecoration:H(({commands:n})=>{const e=n.getPreset();return ge(()=>{const{text_decoration:t}=W(e).common;return{underline:t.includes("underline"),strike_through:t.includes("line-through")}})}),toggleUnderline:H(({commands:n})=>{n.toggleTextDecoration("underline")}),toggleStrikeThrough:H(({commands:n})=>{n.toggleTextDecoration("strike_through")}),toggleTextDecoration:H(({commands:n},e,t=null)=>{const r=W(n.getTextDecoration()),i=t??!r[e];n.applyMark(this.name,{[e]:i})}),applyTextDecoration:H(({commands:n},e)=>{n.toggleTextDecoration(e,!0)}),removeTextDecoration:H(({commands:n},e)=>{n.toggleTextDecoration(e,!1)})}},addKeyboardShortcuts:()=>({"Mod-u":Xt("toggleUnderline"),"Mod-U":Xt("toggleUnderline")}),parseHTML(){const n=e=>{const t=e.includes("underline"),r=e.includes("line-through");return!t&&!r?!1:{underline:t,strike_through:r}};return[{style:"--zw-text-decoration",getAttrs:n},{style:"text-decoration-line",getAttrs:n},{style:"text-decoration",getAttrs:n},{tag:"s",attrs:{underline:!1,strike_through:!0}},{tag:"u",attrs:{underline:!0,strike_through:!1}}]},renderHTML({HTMLAttributes:n}){const e=[];return n.underline&&e.push("underline"),n.strike_through&&e.push("line-through"),e.length||e.push("none"),ei({text_decoration:e.join(" ")})}}),WR=Re.create({name:"case_style",addCommands(){return{applyCaseStyle:H(({commands:n},e)=>{switch(e){case sl.CAPITALIZE:return n.applyCapitalize();case sl.LOWERCASE:return n.applyLowerCase();case sl.UPPERCASE:return n.applyUpperCase()}}),applyCapitalize:H(({commands:n})=>{n.transformText(({text:e})=>tI(e))}),applyLowerCase:H(({commands:n})=>{n.transformText(({text:e})=>e.toLowerCase())}),applyUpperCase:H(({commands:n})=>{n.transformText(({text:e})=>e.toUpperCase())})}}}),zb={mobile:null,tablet:null,desktop:null},VR=Re.create({name:Oe.ALIGNMENT,addGlobalAttributes:()=>[{types:[oe.PARAGRAPH,oe.HEADING],attributes:{[Oe.ALIGNMENT]:{isRequired:!1,parseHTML({style:n}){const e=mR(n.textAlign);if(e)return{desktop:e,tablet:e,mobile:e};const t=n.getPropertyValue("--zw-alignment-mobile")||null,r=n.getPropertyValue("--zw-alignment-tablet")||null,i=n.getPropertyValue("--zw-alignment-desktop")||null;return!t&&!r&&!i?null:{desktop:i,tablet:r,mobile:t}},renderHTML(n){return n.alignment?Bl({alignment_mobile:n.alignment.mobile,alignment_tablet:n.alignment.tablet,alignment_desktop:n.alignment.desktop}):null}}}}],addCommands(){return{applyAlignment:H(({commands:n},e)=>{const t=W(n.getDevice());n.setBlockAttributes(this.name,{[t]:e},zb)}),removeAlignment:H(({commands:n})=>n.removeBlockAttributes(this.name)),getAlignment:H(({commands:n})=>{const e=n.getBlockAttributes(this.name,zb),t=n.getDevice(),r=n.getDefaultAlignment();return ge(()=>W(e)?.[W(t)]??W(r))}),getDefaultAlignment:H(({commands:n})=>{const e=n.getDevice(),t=n.getPreset();return ge(()=>W(t)[W(e)].alignment??xr.LEFT)})}},addKeyboardShortcuts:()=>({"Mod-Shift-l":Xt("applyAlignment",xr.LEFT),"Mod-Shift-e":Xt("applyAlignment",xr.CENTER),"Mod-Shift-r":Xt("applyAlignment",xr.RIGHT),"Mod-Shift-j":Xt("applyAlignment",xr.JUSTIFY)})}),Hb={mobile:null,tablet:null,desktop:null},UR=Re.create({name:Oe.LINE_HEIGHT,addGlobalAttributes(){return[{types:[oe.PARAGRAPH,oe.HEADING],attributes:{[Oe.LINE_HEIGHT]:{isRequired:!1,parseHTML:n=>{if(n.matches('[style*="--zw-line-height"]')){const s=n.style.getPropertyValue("--zw-line-height-tablet")||null,a=n.style.getPropertyValue("--zw-line-height-desktop")||null;return{mobile:null,tablet:s,desktop:a}}const e=n.style.lineHeight;if(!e)return null;const t=W(this.options.wrapperRef),r=dR(e,n,t);return r?{desktop:r,tablet:r,mobile:null}:null},renderHTML(n){return n.line_height?Bl({line_height_mobile:n.line_height.mobile,line_height_tablet:n.line_height.tablet,line_height_desktop:n.line_height.desktop}):null}}}}]},addCommands(){return{getLineHeight:H(({commands:n})=>{const e=n.getBlockAttributes(this.name,Hb),t=n.getDevice(),r=n.getDefaultLineHeight();return ge(()=>W(e)?.[W(t)]??W(r))}),getDefaultLineHeight:H(({commands:n})=>{const e=n.getDevice(),t=n.getPreset();return ge(()=>W(t)[W(e)].line_height)}),applyLineHeight:H(({commands:n},e)=>{const t=W(n.getDevice());n.setBlockAttributes(this.name,{[t]:e},Hb)})}}}),qR=Qn.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:n}){return["li",Bi(this.options.HTMLAttributes,n),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),KR=qR.extend({name:oe.LIST_ITEM,marks:Jt.SETTINGS,addCommands(){const n=({selection:e})=>e.$cursor.before(e.$cursor.depth-1);return{listItemNewline:H(({commands:e,tr:t})=>{const r=t.doc.nodeAt(n(t));if(!t.selection.$cursor.node().textContent)return!1;e.splitListItem(this.name);const s=n(t);for(const a of r.marks)t.addNodeMark(s,ed(a));return!0})}},addOptions:()=>({HTMLAttributes:{class:"zw-style"}}),addKeyboardShortcuts:()=>({Enter:n=>{const{state:e,commands:t}=n.editor;if(e.selection.$cursor?.path.some(i=>i.type?.name===oe.LIST))return t.listItemNewline()}})});function GR(n,e){if(X1.includes(e.type)||e.type.isInSet(n.marks))return!1;for(const t of n.content.content)if(t.childCount&&(!t.marks||!e.isInSet(t.marks)))return!1;return!0}function JR(n){const e=n.selection.$from.start(),t=n.selection.$to.end();n.doc.nodesBetween(e,t,(r,i)=>{if(r.type.name===oe.LIST)return;if(r.type.name!==oe.LIST_ITEM)return!1;const s=[];return r.forEach(a=>{for(const u of a.marks){if(u.isInSet(s)){n.removeNodeMark(i+1,u);continue}GR(r,u)&&(n.removeNodeMark(i+1,u),n.addNodeMark(i,ed(u)),s.push(u))}}),!1})}const jR=Qn.create({name:oe.LIST,content:`${oe.LIST_ITEM}+`,group:"block list",marks:Jt.SETTINGS,addExtensions:()=>[KR],addOptions:()=>({baseClass:"",presetClass:""}),addAttributes:()=>({bullet:{default:{type:un.DISC}}}),parseHTML(){const n={a:un.ROMAN,i:un.LATIN,1:un.DECIMAL},e=t=>{for(const r of NM){const i=`.${W(this.options.baseClass)}${r}`;if(t.matches(i)||n[t.type.toLowerCase()]===r)return r}};return[{tag:"ol",getAttrs:t=>({bullet:{type:e(t)||un.DECIMAL}})},{tag:"ul",getAttrs:t=>({bullet:{type:e(t)||un.DISC}})}]},renderHTML({HTMLAttributes:n}){const e=[W(this.options.baseClass)+n.bullet.type,W(this.options.presetClass)];return[RM.includes(n.bullet.type)?"ol":"ul",{class:e.join(" ")},0]},addCommands(){return{getListType:H(({commands:n})=>{const e=n.getBlockAttributes("bullet",{type:null});return ge(()=>W(e).type??null)}),applyList:H(({commands:n,chain:e},t)=>W(n.getListType())===t?n.removeList():e().applyDefaultPreset().toggleList(oe.LIST,oe.LIST_ITEM).setBlockAttributes("bullet",{type:t}).command(({tr:i})=>JR(i)).run()),removeList:H(({chain:n})=>n().expandSelection(({parent:e})=>e.type.name===oe.LIST).command(({tr:e})=>{const t=e.selection.$from.start(),r=e.selection.$to.end();return e.doc.nodesBetween(t,r,(i,s,a)=>{if([oe.LIST,oe.LIST_ITEM].includes(i.type.name))return;if(a.type.name!==oe.LIST_ITEM)return!1;const u=a.marks.filter(c=>!c.type.isInSet(i.marks));for(const c of u)e.addNodeMark(s,ed(c));return!1}),!0}).liftListItem(oe.LIST_ITEM).run())}},addInputRules(){const n=(e,t)=>yM({find:t,type:this.type,getAttributes:{bullet:{type:e}},joinPredicate:(r,{attrs:i})=>i.bullet.type===e});return[n(un.DISC,/^\s*([-+*])\s$/),n(un.DECIMAL,/^(\d+)\.\s$/),n(un.LATIN,/^([ivx]{1,3})\.\s$/i),n(un.ROMAN,/^([a-z])\.\s$/i)]}});function YR(n){return n.length===1?n[0].isLink:n.length===3&&n[1].isLink?["()","[]"].includes(n[0].value+n[2].value):!1}function XR(n){return new ct({key:new It("autolink"),appendTransaction:(e,t,r)=>{const i=e.some(h=>h.docChanged)&&!t.doc.eq(r.doc),s=e.some(h=>h.getMeta("preventAutolink"));if(!i||s)return;const{tr:a}=r,u=BO(t.doc,[...e]);if(JO(u).forEach(({newRange:h})=>{const m=HO(r.doc,h,_=>_.isTextblock);let d,y;if(m.length>1?(d=m[0],y=r.doc.textBetween(d.pos,d.pos+d.node.nodeSize,void 0," ")):m.length&&r.doc.textBetween(h.from,h.to," "," ").endsWith(" ")&&(d=m[0],y=r.doc.textBetween(d.pos,h.to,void 0," ")),d&&y){const _=y.split(" ").filter(g=>g!=="");if(_.length<=0)return!1;const v=_[_.length-1],E=d.pos+y.lastIndexOf(v);if(!v)return!1;const N=Fl(v).map(g=>g.toObject(n.defaultProtocol));if(!YR(N))return!1;N.filter(g=>g.isLink).map(g=>({...g,from:E+g.start+1,to:E+g.end+1})).filter(g=>r.schema.marks.code?!r.doc.rangeHasMark(g.from,g.to,r.schema.marks.code):!0).filter(g=>n.validate(g.value)).filter(g=>n.shouldAutoLink(g.value)).forEach(g=>{z1(g.from,g.to,r.doc).some(S=>S.mark.type===n.type)||a.addMark(g.from,g.to,n.type.create({href:g.href}))})}}),!!a.steps.length)return a}})}function ZR(n){return new ct({key:new It("handleClickLink"),props:{handleClick:(e,t,r)=>{var i,s;if(r.button!==0||!e.editable)return!1;let a=r.target;const u=[];for(;a.nodeName!=="DIV";)u.push(a),a=a.parentNode;if(!u.find(y=>y.nodeName==="A"))return!1;const c=qO(e.state,n.type.name),h=r.target,m=(i=h?.href)!==null&&i!==void 0?i:c.href,d=(s=h?.target)!==null&&s!==void 0?s:c.target;return h&&m?(window.open(m,d),!0):!1}}})}function QR(n){return new ct({key:new It("handlePasteLink"),props:{handlePaste:(e,t,r)=>{const{state:i}=e,{selection:s}=i,{empty:a}=s;if(a)return!1;let u="";r.content.forEach(h=>{u+=h.textContent});const c=py(u,{defaultProtocol:n.defaultProtocol}).find(h=>h.isLink&&h.value===u);return!u||!c?!1:n.editor.commands.setMark(n.type,{href:c.href})}}})}const eL=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g;function oi(n,e){const t=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return e&&e.forEach(r=>{const i=typeof r=="string"?r:r.scheme;i&&t.push(i)}),!n||n.replace(eL,"").match(new RegExp(`^(?:(?:${t.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}const tL=Rt.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(n=>{if(typeof n=="string"){dy(n);return}dy(n.scheme,n.optionalSlashes)})},onDestroy(){XM()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(n,e)=>!!oi(n,e.protocols),validate:n=>!!n,shouldAutoLink:n=>!!n}},addAttributes(){return{href:{default:null,parseHTML(n){return n.getAttribute("href")}},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class}}},parseHTML(){return[{tag:"a[href]",getAttrs:n=>{const e=n.getAttribute("href");return!e||!this.options.isAllowedUri(e,{defaultValidate:t=>!!oi(t,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:n}){return this.options.isAllowedUri(n.href,{defaultValidate:e=>!!oi(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",Bi(this.options.HTMLAttributes,n),0]:["a",Bi(this.options.HTMLAttributes,{...n,href:""}),0]},addCommands(){return{setLink:n=>({chain:e})=>{const{href:t}=n;return this.options.isAllowedUri(t,{defaultValidate:r=>!!oi(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?e().setMark(this.name,n).setMeta("preventAutolink",!0).run():!1},toggleLink:n=>({chain:e})=>{const{href:t}=n;return this.options.isAllowedUri(t,{defaultValidate:r=>!!oi(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?e().toggleMark(this.name,n,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run():!1},unsetLink:()=>({chain:n})=>n().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[bM({find:n=>{const e=[];if(n){const{protocols:t,defaultProtocol:r}=this.options,i=py(n).filter(s=>s.isLink&&this.options.isAllowedUri(s.value,{defaultValidate:a=>!!oi(a,t),protocols:t,defaultProtocol:r}));i.length&&i.forEach(s=>e.push({text:s.value,data:{href:s.href},index:s.start}))}return e},type:this.type,getAttributes:n=>{var e;return{href:(e=n.data)===null||e===void 0?void 0:e.href}}})]},addProseMirrorPlugins(){const n=[],{protocols:e,defaultProtocol:t}=this.options;return this.options.autolink&&n.push(XR({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:r=>this.options.isAllowedUri(r,{defaultValidate:i=>!!oi(i,e),protocols:e,defaultProtocol:t}),shouldAutoLink:this.options.shouldAutoLink})),this.options.openOnClick===!0&&n.push(ZR({type:this.type})),this.options.linkOnPaste&&n.push(QR({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type})),n}}),nL=tL.extend({name:Oe.LINK,addOptions(){return{...this.parent?.(),openOnClick:!1,linkOnPaste:!1}},addAttributes(){return{href:{default:null,parseHTML:n=>{const e=n.getAttribute("href");return e.startsWith("#")?parseFloat(n.getAttribute("href").replace("#","")):e}},target:{default:nh.SELF,parseHTML:n=>n.getAttribute("target")||nh.SELF},destination:{default:zi.URL,parseHTML:n=>{const e=n.getAttribute("href");if(!e.startsWith("#"))return zi.URL;const t=e.replace("#","");return W(this.options.pageBlocks).find(s=>s.id===parseInt(t))?zi.BLOCK:zi.URL}}}},addCommands(){const{unsetLink:n}=this.parent();return{removeLink:n,applyLink:H(({commands:e,chain:t},r)=>(e.setMeta("preventAutolink",!0),e.getSelectedText()?t().applyMark(this.name,r).expandSelectionToLink().command(({tr:i})=>(r.text&&i.insertText(r.text,i.selection.from,i.selection.to),!0)).run():e.insertContent(Vb.text(r.text,[Vb.mark(Oe.LINK,r)])))),expandSelectionToLink:H(({commands:e})=>{e.expandSelection(({node:t})=>this.type.isInSet(t.marks))}),isLink:H(({commands:e})=>e.hasMark(this.name)),getLinkPreset:H(()=>ge(()=>W(this.options.preset)))}},addProseMirrorPlugins(){return[...this.parent(),eI.create(this.editor)]},renderHTML({HTMLAttributes:n}){const e=n.destination===zi.BLOCK?`#${n.href}`:n.href,t=W(this.options.basePresetClass)+W(this.options.preset).id;return["a",{href:e,target:n.target,class:`${t} zw-style`},0]}}),rL=Rt.create({name:Oe.SUPERSCRIPT,addCommands(){return{applySuperscript:H(({commands:n})=>{n.setMark(this.name)}),removeSuperscript:H(({commands:n})=>{n.unsetMark(this.name)}),toggleSuperscript:H(({commands:n})=>{W(n.isSuperscript())?n.removeSuperscript():n.applySuperscript()}),isSuperscript:H(({commands:n})=>{const e=n.getMark(this.name);return ge(()=>!!W(e))})}},parseHTML(){return[{tag:"sup"},{style:"vertical-align",getAttrs:n=>n!=="super"?!1:null}]},renderHTML(){return["sup",{class:"zw-superscript"},0]}}),iL=Re.create({name:Oe.MARGIN,addGlobalAttributes:()=>[{types:[oe.PARAGRAPH,oe.HEADING],attributes:{[Oe.MARGIN]:{isRequired:!1,parseHTML(n){const{margin:e,marginTop:t,marginRight:r,marginBottom:i,marginLeft:s}=n.style;return[e,t,r,i,s].some(c=>!!c)?e?{value:e}:{value:[t||0,r||0,i||0,s||0].join(" ")}:null},renderHTML(n){return n.margin?Bl({margin:n.margin.value}):null}}}}]});function sL(n){const e=r=>n.presetsRef.value.find(i=>i.id===r),t=jc({default:null,link:null});return i5(n.presetsRef,()=>{t.default=e(n.defaultPresetId),t.link=e(n.linkPresetId)},{immediate:!0,deep:!0}),NR().concat([LR.configure({presets:n.presetsRef,defaultId:n.defaultPresetId,styleRenderer:new cL({baseClass:n.basePresetClass,makeVariable:n.makePresetVariable,linkPresetId:n.linkPresetId})}),jR.configure({baseClass:n.baseListClass,presetClass:n.basePresetClass+n.defaultPresetId}),BR.configure({device:n.deviceRef}),DR.configure({minSize:n.minFontSize,maxSize:n.maxFontSize,wrapperRef:n.wrapperRef}),RR.configure({fonts:n.fonts,defaultPreset:Ti(t,"default"),defaultFont:n.defaultFont}),PR,$R,FR,zR,HR,WR,rL,VR,UR.configure({wrapperRef:n.wrapperRef}),nL.configure({preset:Ti(t,"link"),basePresetClass:n.basePresetClass,pageBlocks:n.pageBlocksRef}),iL])}class oL{_domParser=new DOMParser;types=window;parse(e){return this._domParser.parseFromString(e,"text/html")}}class Wb{content;constructor({content:e}){this.content=e}normalize(){throw new Error("Implement abstract method")}}class Sn extends Wb{static BLOCK_NODE_NAMES=["P","H1","H2","H3","H4"];static ROOT_NODE_NAMES=Sn.BLOCK_NODE_NAMES.concat("UL","OL");static BLOCK_STYLES=["text-align","line-height","margin","margin-top","margin-bottom","margin-left","margin-right"];_parser;constructor({content:e,parser:t}){super({content:e}),this._parser=t,this.dom=null}normalize(){return this.normalizeHTML(),this.normalizedHTML}normalizeHTML(){this.dom=this._parser.parse(this.content.replace(/(\r)?\n/g,"")),this._removeComments(),this._normalizeRootTags(),this._iterateNodes(this._normalizeBreakLines,e=>e.tagName==="BR"),this._iterateNodes(this._removeEmptyNodes,this._isBlockNode),this._iterateNodes(this._normalizeListItems,e=>e.tagName==="LI"),this._normalizeBlockTextDecoration(),this._normalizeBlockBackgroundColor()}get normalizedHTML(){return this.dom.body.innerHTML}get _NodeFilter(){return this._parser.types.NodeFilter}get _Node(){return this._parser.types.Node}_removeComments(){const e=this._createNodeIterator(this._NodeFilter.SHOW_COMMENT);this._runIterator(e,t=>t.remove())}_normalizeRootTags(){const e=Array.from(this.dom.body.childNodes),t=this.dom.createDocumentFragment();let r;for(const i of e){if(this._isRootNode(i)){t.append(i),r=null;continue}r||(r=this.dom.createElement("p"),t.append(r)),r.append(i)}this.dom.body.innerHTML="",this.dom.body.append(t)}_createNodeIterator(e,t){return this.dom.createNodeIterator(this.dom.body,e,t)}_iterateNodes(e,t=()=>!0){const r=s=>s.tagName!=="BODY"&&t.call(this,s),i=this._createNodeIterator(this._NodeFilter.SHOW_ELEMENT,{acceptNode:s=>r(s)?this._NodeFilter.FILTER_ACCEPT:this._NodeFilter.FILTER_REJECT});this._runIterator(i,e)}_runIterator(e,t){let r=e.nextNode();for(;r;)t.call(this,r),r=e.nextNode()}_removeEmptyNodes(e){e.innerHTML.trim()||e.remove()}_normalizeListItems(e){const t=this.dom.createDocumentFragment(),r=Array.from(e.childNodes);let i,s;const a=u=>{this._assignElementProperties(u,e,Sn.BLOCK_STYLES),t.append(u)};this._assignElementProperties(e,e.parentElement,Sn.BLOCK_STYLES);for(const u of r){if(this._isBlockNode(u)){a(u),i=null,s=u;continue}if(u.tagName==="BR"&&s&&s?.tagName!=="BR"){u.remove(),s=u;continue}if(u.tagName==="BR"){const c=this.dom.createElement("p");c.append(u),a(c),i=null,s=u;continue}i||(i=this.dom.createElement("p"),a(i)),i.append(u),s=u}e.append(t),this._removeStyleProperties(e,Sn.BLOCK_STYLES),this._removeStyleProperties(e.parentElement,Sn.BLOCK_STYLES),this._assignElementProperties(e,e.parentElement),e.parentElement.lastElementChild===e&&this._removeStyleProperties(e.parentElement)}_isBlockNode(e){return Sn.BLOCK_NODE_NAMES.includes(e.tagName)}_isRootNode(e){return Sn.ROOT_NODE_NAMES.includes(e.tagName)}_assignElementProperties(e,t,r=Array.from(t.style)){for(const i of r){const s=t.style.getPropertyValue(i);s&&!e.style.getPropertyValue(i)&&e.style.setProperty(i,s)}}_removeStyleProperties(e,t=Array.from(e.style)){for(const r of t)e.style.removeProperty(r);e.style.length===0&&e.removeAttribute("style")}_normalizeBreakLines({parentElement:e}){if(!this._isBlockNode(e)||!e.textContent)return;const t=this.dom.createDocumentFragment(),r=Array.from(e.childNodes),i=e.cloneNode(!0);i.innerHTML="";let s=i.cloneNode();const a=u=>{this._assignElementProperties(u,e,Sn.BLOCK_STYLES),t.append(u)};for(const u of r){if(u.tagName==="BR"){a(s),s=i.cloneNode();continue}s.append(u)}t.append(s),e.replaceWith(t)}_normalizeBlockTextDecoration(){const e=this.dom.querySelectorAll('[style*="text-decoration"]:where(p, h1, h2, h3, h4, li)');for(const t of e)this._moveTextDecorationToChildren(t)}_moveTextDecorationToChildren(e){const t=this._parseTextDecoration(e);if(e.style.removeProperty("text-decoration-line"),e.style.removeProperty("text-decoration"),e.style.cssText||e.removeAttribute("style"),!t.none)for(const r of e.childNodes){const i=this._wrapTextNode(e,r),s=this._parseTextDecoration(i),a={underline:s.underline||t.underline,line_through:s.line_through||t.line_through};i.style.removeProperty("text-decoration-line"),i.style.removeProperty("text-decoration"),i.style.textDecoration=Object.entries(a).filter(([,u])=>u).map(([u])=>u.replace("_","-")).join(" ")}}_parseTextDecoration(e){const{textDecoration:t,textDecorationLine:r}=e.style,i=t||r||"";return{none:i.includes("none"),underline:i.includes("underline"),line_through:i.includes("line-through")}}_normalizeBlockBackgroundColor(){const e=this.dom.querySelectorAll('[style*="background-color"]:where(p, h1, h2, h3, h4, li)');for(const t of e)this._moveBackgroundColorToChildren(t)}_moveBackgroundColorToChildren(e){const t=e.style.backgroundColor;e.style.removeProperty("background-color"),e.style.cssText||e.removeAttribute("style");for(const r of e.childNodes){const i=this._wrapTextNode(e,r),s=i.style.backgroundColor||t;i.style.backgroundColor=s}}_wrapTextNode(e,t){if(t.nodeType!==this._Node.TEXT_NODE)return t;const r=this.dom.createElement("span");return r.append(t.cloneNode()),e.replaceChild(r,t),r}}class aL extends Wb{normalize(){return this._iterateNodes(this._bubbleMarks),this.content}_iterateNodes(e){this._iterateChildNodes(this.content,e)}_iterateChildNodes(e,t){for(const r of e.content)r.content&&this._iterateChildNodes(r,t),t.call(this,r)}_bubbleMarks(e){if(e.content&&e.type!==oe.LIST){for(const t of e.content)if(!this._isLink(t)&&t.marks)for(const r of t.marks.slice()){if(this._includesMark(e,r)){this._removeMark(t,r);continue}this._canBubbleMark(e,r)&&(this._removeMark(t,r),this._addMark(e,r))}}}_canBubbleMark(e,t){if(X1.includes(t.type)||this._includesMarkType(e,t.type))return!1;for(const r of e.content)if(!(!r.content&&e.type===oe.LIST_ITEM)&&(!r.marks||!this._includesMark(r,t)))return!1;return!0}_includesMark(e,t){return e.marks?.some(r=>Bb.isEqual(r,t))??!1}_includesMarkType(e,t){return e.marks?.some(r=>r.type===t)??!1}_isLink(e){return e.type===oe.TEXT&&this._includesMarkType(e,Oe.LINK)}_removeMark(e,t){if(!e.marks)return;const r=this._findMarkIndexByType(e,t.type);r>=0&&e.marks.splice(r,1),e.marks.length||delete e.marks}_addMark(e,t){this._removeMark(e,t),e.marks??=[],e.marks.push(t)}_findMarkIndexByType(e,t){return e.marks?.findIndex(r=>r.type===t)??null}}class au{static build(e,t={}){return typeof e=="string"?this._buildHtml(e,t):this._buildJson(e)}static _buildHtml(e,t){return new Sn({content:e,parser:t.parser||new oL})}static _buildJson(e){return new aL({content:e})}static normalize(e,t={}){return au.build(e,t).normalize()}}class ji{static window=globalThis.window;static use(e){this.window=e}static get document(){return this.window.document}static get body(){return this.document.body}static get head(){return this.document.head}static getComputedStyle(e){return this.window.getComputedStyle(e)}}class ad{static build({config:e,nodeDomParser:t}){const r=sL({fonts:e.fonts,minFontSize:0,maxFontSize:0,presetsRef:ya(e.presets),defaultPresetId:e.defaultPresetId,linkPresetId:e.linkPresetId,makePresetVariable:()=>"",basePresetClass:e.basePresetClass,baseListClass:e.baseListClass,deviceRef:ya(eh.DESKTOP),pageBlocksRef:ya([]),wrapperRef:ji.document.createElement("p")}),i=VO(r);return new ad({schema:i,domParser:Rs.fromSchema(i),nodeDomParser:t})}_schema;_domParser;_nodeDomParser;constructor({schema:e,domParser:t,nodeDomParser:r}){this._schema=e,this._domParser=t,this._nodeDomParser=r}toJSON(e){const t=au.build(e,{parser:this._nodeDomParser});return t.normalizeHTML(),this._domParser.parse(t.dom.body).toJSON()}}function lL(n,e){return n.type===e}function uL(n){return typeof n=="string"}class Vb{static doc(e){return{type:oe.DOCUMENT,content:e}}static list(e,t){return{type:oe.LIST,attrs:{bullet:{type:e}},content:t.map(r=>lL(r,oe.LIST_ITEM)?r:this.listItem([r].flat()))}}static listItem(...e){const{attrs:t,content:r,marks:i}=this.normalizeTextBlockArgs(e);return{type:oe.LIST_ITEM,...t?{attrs:t}:{},...i?{marks:i}:{},content:[r].flat().map(s=>uL(s)?this.paragraph(s):s)}}static heading(e,...t){const r=this.textBlock(t);return r.attrs??={},r.attrs.level=e,{type:oe.HEADING,...r}}static paragraph(...e){return{type:oe.PARAGRAPH,...this.textBlock(e)}}static textBlock(e){const{attrs:t,content:r,marks:i}=this.normalizeTextBlockArgs(e);return{content:typeof r=="string"?[this.text(r)]:[r].flat(),...t?{attrs:t}:{},...i?{marks:i}:{}}}static normalizeTextBlockArgs(e){return e.length===1?{attrs:null,marks:null,content:e[0]}:e.length===2?{attrs:e[0],marks:null,content:e[1]}:{attrs:e[0],marks:e[1],content:e[2]}}static text(e,t){return{type:oe.TEXT,...t?{marks:t}:{},text:e}}static link(e,t,r=[]){return this.text(e,[this.mark(Oe.LINK,t),...r])}static mark(e,t){return{type:e,attrs:t}}static populateAllDevices(e){return{mobile:e,tablet:e,desktop:e}}}class cL{_baseClass;_makeVariable;_linkPresetId;constructor({baseClass:e,makeVariable:t,linkPresetId:r}){this._baseClass=e,this._makeVariable=t,this._linkPresetId=r}inject(e,t){let r=e.querySelector("[data-zw-styles]");r||(r=ji.document.createElement("style"),r.dataset.zwStyles="",r.innerHTML=this.render(t),e.append(r))}render(e){let t="";for(const r of e){const i=r.id===this._linkPresetId,s=this.makePresetCssClass(r);t+=` ${s} {`;for(const a of MM)for(const u of Object.keys(r[a])){const c=this._makeVariable({device:a,preset:r,property:u}),h=this._makeInternalVariableName(u,a);if(t+=`${h}: var(${c}, inherit);`,i&&!Y1.includes(u)){const m=h.replace("preset-","");t+=`${m}: var(${h});`}}t+="}"}return t}_makeInternalVariableName(e,t){const r=e==="color"?"font-color":e.replace(/_/i,"-"),i=t===eh.COMMON?"":`-${t}`;return`--zw-preset-${r}${i}`}makePresetHtmlClass(e){return this._baseClass+e.id}makePresetCssClass(e){return this.makePresetHtmlClass(e).split(" ").map(t=>`.${t}`).join("")}}class ld{static _instance;static get instance(){return this._instance??=new ld,this._instance}static query(e,t){return this.instance.query(e,t)}query(e,t){let r=null;return e.descendants(i=>{if(r)return!1;if(this.matchNode(i,t))return r=i,!1}),r?t.getMark?this.getMark(r,t.getMark):r:null}matchNode(e,t){return!(t.typeName&&t.typeName!==e.type.name||t.mark&&!this.getMark(e,t.mark))}getMark(e,t){return e.marks.find(r=>this.matchMark(r,t))||null}matchMark(e,t){return e.type.name===t.typeName}}class Ub{static createWindow(){return new Hm.JSDOM().window}types;parse(e){const{window:t}=new Hm.JSDOM(e);return this.types=t,t.document}}class qb{name;description;argument;options=[];doCommand(){throw new Error('Command "doCommand" is required')}install(e){if(!this.name)throw new Error('Command "name" is required');let t=e.command(this.name);if(this.description&&(t=t.description(this.description)),this.argument&&(t=t.argument(this.argument)),this.options.length)for(const r of this.options)t=t.option(r.flags,r.description,r.default);t.action(this.doCommand.bind(this))}output(e){}}class fL extends qb{name="to-json";description="migrate html to json";argument="<html...>";options=[{flags:"-c, --config <path>",description:"Generator config",default:zm.resolve(__dirname,"../bin/zp.config.json")},{flags:"-f, --format <type>",description:"Set output format",default:"rb"}];doCommand(e,{config:t,format:r}){ji.use(Ub.createWindow());const i=zm.resolve(process.cwd(),t),s=ad.build({config:require(i).editor,nodeDomParser:new Ub}),a=e.map(h=>s.toJSON(this._formatInputHtml(h))),u=a.length===1?a[0]:a,c=this._stringifyContent(u);this.output(r==="rb"?this._formatOutputRb(c):c)}_formatInputHtml(e){return e.replace(/\\(["'])/g,"$1").replace(/rgba\(\d{1,3}, ?\d{1,3}, ?\d{1,3}, (\d{1,2}%)\)/g,(t,r)=>t.replace(r,parseFloat(r)/100))}_stringifyContent(e){return JSON.stringify(e,(r,i)=>i===null?void 0:i,2)}_formatOutputRb(e){return e.replace(/\\"/g,'"').replace(/font-family: ?'(.+)'/g,'font-family: "$1"').replace(/'/g,"\\'").replace(/^[\t ]*"[^:\n\r]+(?<!\\)":/gm,t=>t.replace(/"/g,"")).replace(/: "(.+)"([,\n])/g,": '$1'$2")}}var hL="4.11.3";class dL extends qb{name="version";description="display cli version";doCommand(){this.output(hL)}}const Kb=new qC,pL=[fL,dL];for(const n of pL)new n().install(Kb);Kb.parse();
|